diff --git a/debdiffs/mesa-v25.3.3/mesa_25.3.3-1~bpo13+1.debdiff b/debdiffs/mesa-v25.3.3/mesa_25.3.3-1~bpo13+1.debdiff new file mode 100644 index 0000000..8c488d2 --- /dev/null +++ b/debdiffs/mesa-v25.3.3/mesa_25.3.3-1~bpo13+1.debdiff @@ -0,0 +1,287568 @@ +Signing key on 752DE27C4DEB17019B4B6623CB703165A88984DC is not bound: + No binding signature at time 2026-01-07T12:26:53Z + because: Policy rejected non-revocation signature (PositiveCertification) requiring second pre-image resistance + because: SHA1 is not considered secure since 2023-02-01T00:00:00Z +dpkg-source: aviso: cannot verify inline signature for /home/qwerty/build-mesa-2533/builds/source/mesa_25.3.3-1.dsc: no acceptable signature found +dpkg-source: aviso: extrayendo el paquete fuente sin firmar (/home/qwerty/build-mesa-2533/mesa_25.3.3-1~bpo13+1.dsc) +diff -Nru mesa-25.3.3/debian/changelog mesa-25.3.3/debian/changelog +--- mesa-25.3.3/debian/changelog 2026-01-07 07:26:39.000000000 -0500 ++++ mesa-25.3.3/debian/changelog 2026-05-29 14:35:00.000000000 -0500 +@@ -1,3 +1,28 @@ ++mesa (25.3.3-1~bpo13+1) trixie-backports; urgency=medium ++ ++ * Non-maintainer upload. ++ * Backport to Trixie. ++ * Build-dependencies adapted for Trixie: ++ - Relax libdrm-dev dependency to >= 2.4.124-2. ++ - Adapt spirv-tools requirement to >= 2025.1~rc1-1. ++ - Downgrade LLVM stack: llvm-21-* → llvm-19-*. ++ - Relax directx-headers-dev: >= 1.614.1. ++ - Disable native D3D12 gallium driver. ++ * Patches: ++ - Added define-vulkan_manifest_suffix-global.patch to fix meson scope error. ++ - Added CVE-2026-40393-spirv.patch: Fix OOB in WebGPU (spirv). ++ - Added CVE-2026-40393-nir.patch: Fix OOB in WebGPU (nir). ++ * Fix FTBFS: Added missing src/util/stack_array.h header needed by CVE patches. ++ The CVE-2026-40393 patches (backported from upstream MR !39866) replace ++ NIR_VLA with STACK_ARRAY, which requires util/stack_array.h. This header ++ exists in newer Mesa versions but was not present in 25.3.3. ++ Added src/util/stack_array.h with STACK_ARRAY/STACK_ARRAY_FINISH macros. ++ * Fix FTBFS: Add missing rusticl files to mesa-opencl-icd.install. ++ The empty mesa-opencl-icd.install caused dh_missing to abort the build. ++ Added proper install paths for the rusticl OpenCL library and ICD file. ++ ++ -- stornic56 Fri, 29 May 2026 14:35:00 -0500 ++ + mesa (25.3.3-1) unstable; urgency=medium + + [ Timo Aaltonen ] +diff -Nru mesa-25.3.3/debian/control mesa-25.3.3/debian/control +--- mesa-25.3.3/debian/control 2026-01-07 07:26:39.000000000 -0500 ++++ mesa-25.3.3/debian/control 2026-05-29 14:35:00.000000000 -0500 +@@ -9,20 +9,20 @@ + bindgen (>= 0.71~) [amd64 arm64 armel armhf i386 loong64 mips64el powerpc ppc64 ppc64el riscv64 s390x x32], + bison, + cbindgen (>= 0.25) [amd64 arm64 armel armhf i386 loong64 mips64el powerpc ppc64 ppc64el riscv64 s390x x32], +- directx-headers-dev (>= 1.618.2) [linux-amd64 linux-arm64], ++ directx-headers-dev (>= 1.614.1-1) [linux-amd64 linux-arm64], + flatbuffers-compiler [linux-arm64], + flex, + glslang-tools [amd64 arm64 armel armhf i386 loong64 mips64el powerpc ppc64 ppc64el riscv64 s390x sparc64 x32], +- libclang-21-dev [amd64 arm64 armel armhf i386 loong64 mips64el powerpc ppc64 ppc64el riscv64 s390x sparc64 x32], +- libclang-cpp21-dev [amd64 arm64 armel armhf i386 loong64 mips64el powerpc ppc64 ppc64el riscv64 s390x sparc64 x32], +- libclc-21 [amd64 arm64 armel armhf i386 loong64 mips64el powerpc ppc64 ppc64el riscv64 s390x sparc64 x32], +- libclc-21-dev [amd64 arm64 armel armhf i386 loong64 mips64el powerpc ppc64 ppc64el riscv64 s390x sparc64 x32], +- libdrm-dev (>= 2.4.125-1), ++ libclang-19-dev [amd64 arm64 armel armhf i386 loong64 mips64el powerpc ppc64 ppc64el riscv64 s390x sparc64 x32], ++ libclang-cpp19-dev [amd64 arm64 armel armhf i386 loong64 mips64el powerpc ppc64 ppc64el riscv64 s390x sparc64 x32], ++ libclc-19 [amd64 arm64 armel armhf i386 loong64 mips64el powerpc ppc64 ppc64el riscv64 s390x sparc64 x32], ++ libclc-19-dev [amd64 arm64 armel armhf i386 loong64 mips64el powerpc ppc64 ppc64el riscv64 s390x sparc64 x32], ++ libdrm-dev (>= 2.4.124-2), + libelf-dev [amd64 arm64 armel armhf i386 loong64 mips64el powerpc ppc64 ppc64el riscv64 s390x sparc64 x32], + libexpat1-dev, + libflatbuffers-dev [linux-arm64], + libglvnd-core-dev (>= 1.3.2), +- libllvmspirvlib-21-dev [amd64 arm64 armel armhf i386 loong64 mips64el powerpc ppc64 ppc64el riscv64 s390x sparc64 x32], ++ libllvmspirvlib-19-dev [amd64 arm64 armel armhf i386 loong64 mips64el powerpc ppc64 ppc64el riscv64 s390x sparc64 x32], + libpng-dev [amd64 arm64 armel armhf i386 loong64 mips64el powerpc ppc64 ppc64el riscv64 s390x sparc64 x32], + librust-paste-dev [amd64 arm64 armhf i386 ppc64 riscv64 x32], + librust-rustc-hash-2-dev [amd64 arm64 armhf i386 ppc64 riscv64 x32], +@@ -48,8 +48,8 @@ + libxxf86vm-dev, + libzstd-dev, + linux-libc-dev (>= 2.6.31) [linux-any], +- llvm-21-dev [amd64 arm64 armel armhf i386 loong64 mips64el powerpc ppc64 ppc64el riscv64 s390x sparc64 x32], +- llvm-spirv-21 [amd64 arm64 armel armhf i386 loong64 mips64el powerpc ppc64 ppc64el riscv64 s390x x32], ++ llvm-19-dev [amd64 arm64 armel armhf i386 loong64 mips64el powerpc ppc64 ppc64el riscv64 s390x sparc64 x32], ++ llvm-spirv-19 [amd64 arm64 armel armhf i386 loong64 mips64el powerpc ppc64 ppc64el riscv64 s390x x32], + meson (>= 1.7.0), + pkgconf, + python3, +@@ -59,7 +59,7 @@ + python3-yaml, + rustc (>= 1.78) [amd64 arm64 armel armhf i386 loong64 mips64el powerpc ppc64 ppc64el riscv64 s390x x32], + rustfmt [amd64 arm64 armel armhf i386 loong64 mips64el powerpc ppc64 ppc64el riscv64 s390x x32], +- spirv-tools-dev (>= 2024.4~rc1) [amd64 arm64 armel armhf i386 loong64 mips64el powerpc ppc64 ppc64el riscv64 s390x sparc64 x32], ++ spirv-tools (>= 2025.1~rc1-1) [amd64 arm64 armel armhf i386 loong64 mips64el powerpc ppc64 ppc64el riscv64 s390x sparc64 x32], + valgrind [amd64 arm64 armhf i386 mips64el powerpc ppc64 ppc64el s390x], + wayland-protocols (>= 1.41), + x11proto-dev, +@@ -257,7 +257,7 @@ + Architecture: amd64 arm64 armel armhf i386 loong64 mips64el powerpc ppc64 ppc64el riscv64 s390x x32 + Pre-Depends: ${misc:Pre-Depends} + Depends: +- libclc-21, ++ libclc-19, + ocl-icd-libopencl1 | libopencl1, + ${misc:Depends}, + ${shlibs:Depends} +diff -Nru mesa-25.3.3/debian/control.in mesa-25.3.3/debian/control.in +--- mesa-25.3.3/debian/control.in 2026-01-07 07:14:30.000000000 -0500 ++++ mesa-25.3.3/debian/control.in 2026-05-26 16:23:02.000000000 -0500 +@@ -9,7 +9,7 @@ + bindgen (>= 0.71~) [@RUSTICL_ARCHS@], + bison, + cbindgen (>= 0.25) [@RUSTICL_ARCHS@], +- directx-headers-dev (>= 1.618.2) [linux-amd64 linux-arm64], ++ directx-headers-dev (>= 1.614.1-1) [linux-amd64 linux-arm64], + flatbuffers-compiler [linux-arm64], + flex, + glslang-tools [@LLVM_ARCHS@], +@@ -17,7 +17,7 @@ + libclang-cpp@LLVM_VERSION@-dev [@LLVM_ARCHS@], + libclc-@LLVM_VERSION@ [@LLVM_ARCHS@], + libclc-@LLVM_VERSION@-dev [@LLVM_ARCHS@], +- libdrm-dev (>= 2.4.125-1), ++ libdrm-dev (>= 2.4.124-2), + libelf-dev [@LLVM_ARCHS@], + libexpat1-dev, + libflatbuffers-dev [linux-arm64], +@@ -59,7 +59,7 @@ + python3-yaml, + rustc (>= 1.78) [@RUSTICL_ARCHS@], + rustfmt [@RUSTICL_ARCHS@], +- spirv-tools-dev (>= 2024.4~rc1) [@LLVM_ARCHS@], ++ spirv-tools (>= 2025.1~rc1-1) [@LLVM_ARCHS@], + valgrind [@VALGRIND_ARCHS@], + wayland-protocols (>= 1.41), + x11proto-dev, +diff -Nru mesa-25.3.3/debian/local/control mesa-25.3.3/debian/local/control +--- mesa-25.3.3/debian/local/control 2026-01-07 07:14:30.000000000 -0500 ++++ mesa-25.3.3/debian/local/control 2026-05-27 15:08:49.000000000 -0500 +@@ -1 +0,0 @@ +-report-with: xserver-xorg xserver-xorg-core +diff -Nru mesa-25.3.3/debian/local/script mesa-25.3.3/debian/local/script +--- mesa-25.3.3/debian/local/script 2026-01-07 07:14:30.000000000 -0500 ++++ mesa-25.3.3/debian/local/script 2026-05-27 15:08:58.000000000 -0500 +@@ -1,26 +1,2 @@ + #!/bin/sh +- +-SERVER_BUG_SCRIPT=/usr/share/bug/xserver-xorg-core/script +- +-exec >&3 +- +-echo "glxinfo:" +-echo "--------" +- +-if [ -z "$DISPLAY" ]; then +- echo "DISPLAY is not set." +-else +- if which glxinfo >/dev/null 2>&1; then +- glxinfo +- else +- echo "glxinfo is not available (missing mesa-utils package)." +- fi +-fi +- +-echo +- +-if [ -x "$SERVER_BUG_SCRIPT" ]; then +- $SERVER_BUG_SCRIPT 3>&1 +-else +- echo "$SERVER_BUG_SCRIPT not available" +-fi ++echo "Mesa 25.3.3 Backport Trixie" +diff -Nru mesa-25.3.3/debian/mesa-drm-shim.install mesa-25.3.3/debian/mesa-drm-shim.install +--- mesa-25.3.3/debian/mesa-drm-shim.install 2026-01-07 07:14:30.000000000 -0500 ++++ mesa-25.3.3/debian/mesa-drm-shim.install 2026-05-27 15:04:44.000000000 -0500 +@@ -1 +1 @@ +-usr/lib/*/lib*_drm_shim.so ++ +diff -Nru mesa-25.3.3/debian/mesa-opencl-icd.install mesa-25.3.3/debian/mesa-opencl-icd.install +--- mesa-25.3.3/debian/mesa-opencl-icd.install 2026-01-07 07:14:30.000000000 -0500 ++++ mesa-25.3.3/debian/mesa-opencl-icd.install 2026-05-29 13:40:38.000000000 -0500 +@@ -1,2 +1,4 @@ +-etc/OpenCL/vendors/rusticl.icd +-usr/lib/*/libRusticlOpenCL* ++etc/OpenCL/vendors/rusticl.icd ++usr/lib/*/libRusticlOpenCL.so ++usr/lib/*/libRusticlOpenCL.so.1 ++usr/lib/*/libRusticlOpenCL.so.1.0.0 +diff -Nru mesa-25.3.3/debian/patches/CVE-2026-40393-nir.patch mesa-25.3.3/debian/patches/CVE-2026-40393-nir.patch +--- mesa-25.3.3/debian/patches/CVE-2026-40393-nir.patch 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/debian/patches/CVE-2026-40393-nir.patch 2026-05-28 22:16:10.000000000 -0500 +@@ -0,0 +1,51 @@ ++From 9017d37e84771f921a63676dd8b955df9ef20f29 Mon Sep 17 00:00:00 2001 ++From: Ian Romanick ++Date: Fri, 23 Jan 2026 10:07:27 -0800 ++Subject: [PATCH] nir: Use STACK_ARRAY instead of NIR_VLA ++ ++The number of fields comes from the shader, so it could be a value large ++enough that using alloca would be problematic. ++ ++Fixes: c11833ab24d ("nir,spirv: Rework function calls") ++Reviewed-by: Caio Oliveira ++Reviewed-by: Ryan Neph ++Reviewed-by: Lionel Landwerlin ++Part-of: ++--- ++ src/compiler/nir/nir_functions.c | 5 +++-- ++ 1 file changed, 3 insertions(+), 2 deletions(-) ++ ++diff --git a/src/compiler/nir/nir_functions.c b/src/compiler/nir/nir_functions.c ++index 5d5f66293be3..d4b3e652f1c1 100644 ++--- a/src/compiler/nir/nir_functions.c +++++ b/src/compiler/nir/nir_functions.c ++@@ -22,10 +22,10 @@ ++ */ ++ ++ #include "util/u_printf.h" +++#include "util/stack_array.h" ++ #include "nir.h" ++ #include "nir_builder.h" ++ #include "nir_control_flow.h" ++-#include "nir_vla.h" ++ ++ /* ++ * TODO: write a proper inliner for GPUs. ++@@ -240,12 +240,13 @@ inline_functions_pass(nir_builder *b, ++ * to an SSA value first. ++ */ ++ const unsigned num_params = call->num_params; ++- NIR_VLA(nir_def *, params, num_params); +++ STACK_ARRAY(nir_def *, params, num_params); ++ for (unsigned i = 0; i < num_params; i++) { ++ params[i] = call->params[i].ssa; ++ } ++ ++ nir_inline_function_impl(b, call->callee->impl, params, NULL); +++ STACK_ARRAY_FINISH(params); ++ return true; ++ } ++ ++-- ++GitLab ++ +diff -Nru mesa-25.3.3/debian/patches/CVE-2026-40393-spirv.patch mesa-25.3.3/debian/patches/CVE-2026-40393-spirv.patch +--- mesa-25.3.3/debian/patches/CVE-2026-40393-spirv.patch 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/debian/patches/CVE-2026-40393-spirv.patch 2026-05-28 22:16:02.000000000 -0500 +@@ -0,0 +1,100 @@ ++From 3da828d2dd12e20ba2afc152db8d7236c7a48c13 Mon Sep 17 00:00:00 2001 ++From: Ian Romanick ++Date: Fri, 23 Jan 2026 09:58:26 -0800 ++Subject: [PATCH] spirv: Use STACK_ARRAY instead of NIR_VLA ++ ++The number of fields comes from the shader, so it could be a value large ++enough that using alloca would be problematic. ++ ++Fixes: 2a023f30a64 ("nir/spirv: Add basic support for types") ++Reviewed-by: Caio Oliveira ++Reviewed-by: Ryan Neph ++Reviewed-by: Lionel Landwerlin ++Part-of: ++--- ++ src/compiler/spirv/spirv_to_nir.c | 27 +++++++++++++++++---------- ++ 1 file changed, 17 insertions(+), 10 deletions(-) ++ ++diff --git a/src/compiler/spirv/spirv_to_nir.c b/src/compiler/spirv/spirv_to_nir.c ++index 282025a9c6e5..ef7f40aebf01 100644 ++--- a/src/compiler/spirv/spirv_to_nir.c +++++ b/src/compiler/spirv/spirv_to_nir.c ++@@ -27,7 +27,6 @@ ++ ++ #include "glsl_types.h" ++ #include "vtn_private.h" ++-#include "nir/nir_vla.h" ++ #include "nir/nir_control_flow.h" ++ #include "nir/nir_constant_expressions.h" ++ #include "nir/nir_deref.h" ++@@ -42,6 +41,7 @@ ++ #include "util/mesa-blake3.h" ++ #include "util/bfloat.h" ++ #include "util/float8.h" +++#include "util/stack_array.h" ++ ++ #include ++ ++@@ -1408,7 +1408,7 @@ vtn_type_get_nir_type(struct vtn_builder *b, struct vtn_type *type, ++ case vtn_base_type_struct: { ++ bool need_new_struct = false; ++ const uint32_t num_fields = type->length; ++- NIR_VLA(struct glsl_struct_field, fields, num_fields); +++ STACK_ARRAY(struct glsl_struct_field, fields, num_fields); ++ for (unsigned i = 0; i < num_fields; i++) { ++ fields[i] = *glsl_get_struct_field_data(type->type, i); ++ const struct glsl_type *field_nir_type = ++@@ -1418,20 +1418,25 @@ vtn_type_get_nir_type(struct vtn_builder *b, struct vtn_type *type, ++ need_new_struct = true; ++ } ++ } +++ +++ const struct glsl_type *result; ++ if (need_new_struct) { ++ if (glsl_type_is_interface(type->type)) { ++- return glsl_interface_type(fields, num_fields, ++- /* packing */ 0, false, ++- glsl_get_type_name(type->type)); +++ result = glsl_interface_type(fields, num_fields, +++ /* packing */ 0, false, +++ glsl_get_type_name(type->type)); ++ } else { ++- return glsl_struct_type(fields, num_fields, ++- glsl_get_type_name(type->type), ++- glsl_struct_type_is_packed(type->type)); +++ result = glsl_struct_type(fields, num_fields, +++ glsl_get_type_name(type->type), +++ glsl_struct_type_is_packed(type->type)); ++ } ++ } else { ++ /* No changes, just pass it on */ ++- return type->type; +++ result = type->type; ++ } +++ +++ STACK_ARRAY_FINISH(fields); +++ return result; ++ } ++ ++ case vtn_base_type_image: ++@@ -2077,7 +2082,7 @@ vtn_handle_type(struct vtn_builder *b, SpvOp opcode, ++ val->type->offsets = vtn_alloc_array(b, unsigned, num_fields); ++ val->type->packed = false; ++ ++- NIR_VLA(struct glsl_struct_field, fields, count); +++ STACK_ARRAY(struct glsl_struct_field, fields, count); ++ for (unsigned i = 0; i < num_fields; i++) { ++ val->type->members[i] = vtn_get_type(b, w[i + 2]); ++ const char *name = NULL; ++@@ -2133,6 +2138,8 @@ vtn_handle_type(struct vtn_builder *b, SpvOp opcode, ++ name ? name : "struct", ++ val->type->packed); ++ } +++ +++ STACK_ARRAY_FINISH(fields); ++ break; ++ } ++ ++-- ++GitLab ++ +diff -Nru mesa-25.3.3/debian/patches/define-vulkan_manifest_suffix-global.patch mesa-25.3.3/debian/patches/define-vulkan_manifest_suffix-global.patch +--- mesa-25.3.3/debian/patches/define-vulkan_manifest_suffix-global.patch 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/debian/patches/define-vulkan_manifest_suffix-global.patch 2026-05-26 22:09:24.000000000 -0500 +@@ -0,0 +1,18 @@ ++Description: Define vulkan_manifest_suffix globally to fix meson scope error ++Author: stornic56 ++Forwarded: not-needed ++Last-Update: 2026-05-26 ++--- ++Index: mesa-25.3.3/meson.build ++=================================================================== ++--- mesa-25.3.3.orig/meson.build +++++ mesa-25.3.3/meson.build ++@@ -33,6 +33,8 @@ cc = meson.get_compiler('c') ++ cpp = meson.get_compiler('cpp') ++ fs = import('fs') ++ +++vulkan_manifest_suffix = 'json' +++ ++ sizeof_pointer = cc.sizeof('void*').to_string() ++ ++ null_dep = dependency('', required : false) +diff -Nru mesa-25.3.3/debian/patches/path_max.diff mesa-25.3.3/debian/patches/path_max.diff +--- mesa-25.3.3/debian/patches/path_max.diff 2026-01-07 07:14:30.000000000 -0500 ++++ mesa-25.3.3/debian/patches/path_max.diff 1969-12-31 19:00:00.000000000 -0500 +@@ -1,26 +0,0 @@ +---- a/src/util/tests/cache_test.cpp +-+++ b/src/util/tests/cache_test.cpp +-@@ -84,8 +84,8 @@ check_directories_created(void *mem_ctx, +- { +- bool sub_dirs_created = false; +- +-- char buf[PATH_MAX]; +-- if (getcwd(buf, PATH_MAX)) { +-+ char *buf = getcwd(NULL, 0); +-+ if (buf) { +- char *full_path = ralloc_asprintf(mem_ctx, "%s%s", buf, ++cache_dir); +- struct stat sb; +- if (stat(full_path, &sb) != -1 && S_ISDIR(sb.st_mode)) +---- a/src/util/tests/process_test.c +-+++ b/src/util/tests/process_test.c +-@@ -36,6 +36,10 @@ +- #define PATH_MAX MAX_PATH +- #endif +- +-+#if !defined(PATH_MAX) && defined(__GNU__) +-+#define PATH_MAX (4096) +-+#endif +-+ +- static bool error = false; +- +- static void +diff -Nru mesa-25.3.3/debian/patches/series mesa-25.3.3/debian/patches/series +--- mesa-25.3.3/debian/patches/series 2026-01-07 07:26:10.000000000 -0500 ++++ mesa-25.3.3/debian/patches/series 2026-05-28 22:16:20.000000000 -0500 +@@ -1,4 +1,3 @@ +-path_max.diff +-src_glx_dri_common.h.diff +-vulkan-Don-t-emit-library_arch-if-the-library_path-is-jus.patch +-vulkan-Optionally-share-one-JSON-manifest-per-driver-betw.patch ++define-vulkan_manifest_suffix-global.patch ++CVE-2026-40393-nir.patch ++CVE-2026-40393-spirv.patch +diff -Nru mesa-25.3.3/debian/patches/src_glx_dri_common.h.diff mesa-25.3.3/debian/patches/src_glx_dri_common.h.diff +--- mesa-25.3.3/debian/patches/src_glx_dri_common.h.diff 2026-01-07 07:14:30.000000000 -0500 ++++ mesa-25.3.3/debian/patches/src_glx_dri_common.h.diff 1969-12-31 19:00:00.000000000 -0500 +@@ -1,13 +0,0 @@ +---- a/src/glx/dri_common.h +-+++ b/src/glx/dri_common.h +-@@ -56,6 +56,10 @@ extern struct glx_config *driConvertConf +- +- extern void driDestroyConfigs(const struct dri_config **configs); +- +-+#ifndef __GLXDRIdrawable +-+typedef struct __GLXDRIdrawableRec __GLXDRIdrawable; +-+#endif +-+ +- extern __GLXDRIdrawable * +- driFetchDrawable(struct glx_context *gc, GLXDrawable glxDrawable); +- +diff -Nru mesa-25.3.3/debian/patches/vulkan-Don-t-emit-library_arch-if-the-library_path-is-jus.patch mesa-25.3.3/debian/patches/vulkan-Don-t-emit-library_arch-if-the-library_path-is-jus.patch +--- mesa-25.3.3/debian/patches/vulkan-Don-t-emit-library_arch-if-the-library_path-is-jus.patch 2026-01-07 07:26:10.000000000 -0500 ++++ mesa-25.3.3/debian/patches/vulkan-Don-t-emit-library_arch-if-the-library_path-is-jus.patch 1969-12-31 19:00:00.000000000 -0500 +@@ -1,38 +0,0 @@ +-From: Simon McVittie +-Date: Thu, 11 Sep 2025 20:15:25 +0100 +-Subject: vulkan: Don't emit library_arch if the library_path is just a +- basename +- +-If the library_path is just a basename like `libvulkan_lvp.so`, then +-we can share the same JSON manifest between all of the architectures, +-like we already do for Vulkan layers. This is also how the Nvidia +-proprietary driver works, and how Mesa is packaged in Debian 13. +-However, this will only work if we don't mark the manifest as being +-architecture-specific. +- +-This partially reverts commit f7aa6ba9 "vulkan: Specify library_arch in +-ICD files". +- +-Signed-off-by: Simon McVittie +-Reviewed-by: Mel Henning +-Reviewed-by: Matt Turner +-Reviewed-by: Eric Engestrom +-Part-of: +-Applied-upstream: 26.0, commit:1ec7bc382d13f01371a4255004b2fd4f545739a9 +---- +- src/vulkan/util/vk_icd_gen.py | 2 +- +- 1 file changed, 1 insertion(+), 1 deletion(-) +- +-diff --git a/src/vulkan/util/vk_icd_gen.py b/src/vulkan/util/vk_icd_gen.py +-index 15adf5f..7760dd6 100644 +---- a/src/vulkan/util/vk_icd_gen.py +-+++ b/src/vulkan/util/vk_icd_gen.py +-@@ -75,7 +75,7 @@ if __name__ == '__main__': +- }, +- } +- +-- if args.sizeof_pointer: +-+ if args.sizeof_pointer and ('/' in lib_path or '\\' in lib_path): +- bit_width = args.sizeof_pointer * 8 +- if bit_width in [32, 64]: +- json_data['ICD']['library_arch'] = str(bit_width) +diff -Nru mesa-25.3.3/debian/patches/vulkan-Optionally-share-one-JSON-manifest-per-driver-betw.patch mesa-25.3.3/debian/patches/vulkan-Optionally-share-one-JSON-manifest-per-driver-betw.patch +--- mesa-25.3.3/debian/patches/vulkan-Optionally-share-one-JSON-manifest-per-driver-betw.patch 2026-01-07 07:26:10.000000000 -0500 ++++ mesa-25.3.3/debian/patches/vulkan-Optionally-share-one-JSON-manifest-per-driver-betw.patch 1969-12-31 19:00:00.000000000 -0500 +@@ -1,539 +0,0 @@ +-From: Simon McVittie +-Date: Thu, 25 Sep 2025 21:01:25 +0800 +-Subject: vulkan: Optionally share one JSON manifest per driver between +- architectures +- +-If the library_path is just a basename like `libvulkan_lvp.so`, then we +-can share the same JSON manifest like `lvp_icd.json` between all of the +-architectures, like we already do for Vulkan layers. The library will +-be looked up in the dynamic linker's default search path in this case, +-and in practice will be found in `${libdir}`. This is how the Mesa's +-EGL driver and Vulkan layers work, how Mesa is packaged in Debian 13, +-and also how the Nvidia proprietary driver works; it makes installation +-simpler for distros, especially on multiarch systems like Debian and +-the freedesktop.org SDK. +- +-However, if we want a separate manifest per architecture in order to +-be able to write the full path into it, we still need per-architecture +-filename disambiguation like `lvp_icd.x86_64.json`. +- +-We presumably still want a separate per architecture on Windows, because +-the concept of a single monolithic `${libdir}` is less common there, and +-it can also be helpful during development when setting `$VK_DRIVER_FILES` +-to force the use of a specific driver installed in a non-default location. +- +-Use the following parameter to passed to vk_icd_gen: +-'--icd-lib-path', vulkan_icd_lib_path, +-'--icd-filename', icd_file_name, +-output : 'virtio_icd.' + vulkan_manifest_suffix, +- +-and the output is passed by '--out', '@OUTPUT@', +-so we can detect vulkan_manifest_per_architecture from the --out parameter in script. +- +-Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13745 +-Signed-off-by: Simon McVittie +-Co-authored-by: Yonggang Luo +-Reviewed-by: Mel Henning +-Reviewed-by: Matt Turner +-Reviewed-by: Eric Engestrom +-Part-of: +-Applied-upstream: 26.0, commit:b860ae309a42dce317d275000016abc2b4ebe687 +---- +- meson.build | 7 +++++++ +- meson.options | 13 +++++++++++++ +- src/amd/vulkan/meson.build | 8 +++++--- +- src/asahi/vulkan/meson.build | 8 +++++--- +- src/broadcom/vulkan/meson.build | 8 +++++--- +- src/freedreno/vulkan/meson.build | 8 +++++--- +- src/gallium/targets/lavapipe/meson.build | 8 +++++--- +- src/gfxstream/guest/vulkan/meson.build | 8 +++++--- +- src/imagination/vulkan/meson.build | 8 +++++--- +- src/intel/vulkan/meson.build | 8 +++++--- +- src/intel/vulkan_hasvk/meson.build | 8 +++++--- +- src/microsoft/vulkan/meson.build | 8 +++++--- +- src/nouveau/vulkan/meson.build | 8 +++++--- +- src/panfrost/vulkan/meson.build | 8 +++++--- +- src/virtio/vulkan/meson.build | 8 +++++--- +- src/vulkan/util/vk_icd_gen.py | 14 +++++++++++--- +- 16 files changed, 96 insertions(+), 42 deletions(-) +- +-diff --git a/meson.build b/meson.build +-index f85cd26..4bf1676 100644 +---- a/meson.build +-+++ b/meson.build +-@@ -2280,6 +2280,13 @@ else +- vulkan_icd_lib_path = get_option('prefix') / get_option('libdir') +- endif +- +-+vulkan_manifest_per_architecture = get_option('vulkan-manifest-per-architecture') +-+ +-+if vulkan_manifest_per_architecture +-+ vulkan_manifest_suffix = '@0@.json'.format(host_machine.cpu()) +-+else +-+ vulkan_manifest_suffix = 'json' +-+endif +- +- subdir('include') +- subdir('bin') +-diff --git a/meson.options b/meson.options +-index b1f98d7..43c5823 100644 +---- a/meson.options +-+++ b/meson.options +-@@ -286,6 +286,19 @@ option( +- 'Default: $datadir/vulkan/icd.d' +- ) +- +-+option( +-+ 'vulkan-manifest-per-architecture', +-+ type : 'boolean', +-+ value : true, +-+ description : 'If true, Vulkan ICDs have a separate JSON manifest per ' + +-+ 'architecture, for example lvp_icd.x86_64.json. ' + +-+ '(Recommended for non-default ${prefix}.) ' + +-+ 'If false, all architectures share a single JSON manifest, ' + +-+ 'for example lvp_icd.json, referencing the library by its ' + +-+ 'basename. ' + +-+ '(Recommended for Unix OS distros installing into /usr.)' +-+) +-+ +- option( +- 'moltenvk-dir', +- type : 'string', +-diff --git a/src/amd/vulkan/meson.build b/src/amd/vulkan/meson.build +-index 78b19aa..d73e6d5 100644 +---- a/src/amd/vulkan/meson.build +-+++ b/src/amd/vulkan/meson.build +-@@ -289,7 +289,8 @@ icd_command = [ +- prog_python, '@INPUT0@', +- '--api-version', '1.4', '--xml', '@INPUT1@', +- '--sizeof-pointer', sizeof_pointer, +-- '--lib-path', vulkan_icd_lib_path / icd_file_name, +-+ '--icd-lib-path', vulkan_icd_lib_path, +-+ '--icd-filename', icd_file_name, +- '--out', '@OUTPUT@', +- ] +- if with_platform_windows +-@@ -299,7 +300,7 @@ endif +- radeon_icd = custom_target( +- 'radeon_icd', +- input : [vk_icd_gen, vk_api_xml], +-- output : 'radeon_icd.@0@.json'.format(host_machine.cpu()), +-+ output : 'radeon_icd.' + vulkan_manifest_suffix, +- command : icd_command, +- build_by_default : true, +- install_dir : with_vulkan_icd_dir, +-@@ -316,7 +317,8 @@ _dev_icd = custom_target( +- prog_python, '@INPUT0@', +- '--api-version', '1.4', '--xml', '@INPUT1@', +- '--sizeof-pointer', sizeof_pointer, +-- '--lib-path', meson.current_build_dir() / icd_file_name, +-+ '--icd-lib-path', meson.current_build_dir(), +-+ '--icd-filename', icd_file_name, +- '--out', '@OUTPUT@', +- ], +- build_by_default : true, +-diff --git a/src/asahi/vulkan/meson.build b/src/asahi/vulkan/meson.build +-index 820ee2d..a5e483c 100644 +---- a/src/asahi/vulkan/meson.build +-+++ b/src/asahi/vulkan/meson.build +-@@ -106,12 +106,13 @@ icd_file_name = libname_prefix + 'vulkan_asahi.' + libname_suffix +- +- asahi_icd = custom_target( +- input : [vk_icd_gen, vk_api_xml], +-- output : 'asahi_icd.@0@.json'.format(host_machine.cpu()), +-+ output : 'asahi_icd.' + vulkan_manifest_suffix, +- command : [ +- prog_python, '@INPUT0@', +- '--api-version', '1.4', '--xml', '@INPUT1@', +- '--sizeof-pointer', sizeof_pointer, +-- '--lib-path', vulkan_icd_lib_path / icd_file_name, +-+ '--icd-lib-path', vulkan_icd_lib_path, +-+ '--icd-filename', icd_file_name, +- '--out', '@OUTPUT@', +- ], +- build_by_default : true, +-@@ -128,7 +129,8 @@ custom_target( +- prog_python, '@INPUT0@', +- '--api-version', '1.4', '--xml', '@INPUT1@', +- '--sizeof-pointer', sizeof_pointer, +-- '--lib-path', meson.current_build_dir() / icd_file_name, +-+ '--icd-lib-path', meson.current_build_dir(), +-+ '--icd-filename', icd_file_name, +- '--out', '@OUTPUT@', +- ], +- build_by_default : true, +-diff --git a/src/broadcom/vulkan/meson.build b/src/broadcom/vulkan/meson.build +-index 42c1e35..d5cdbcd 100644 +---- a/src/broadcom/vulkan/meson.build +-+++ b/src/broadcom/vulkan/meson.build +-@@ -127,12 +127,13 @@ icd_file_name = libname_prefix + 'vulkan_broadcom.' + libname_suffix +- broadcom_icd = custom_target( +- 'broadcom_icd', +- input : [vk_icd_gen, vk_api_xml], +-- output : 'broadcom_icd.@0@.json'.format(host_machine.cpu()), +-+ output : 'broadcom_icd.' + vulkan_manifest_suffix, +- command : [ +- prog_python, '@INPUT0@', +- '--api-version', '1.3', '--xml', '@INPUT1@', +- '--sizeof-pointer', sizeof_pointer, +-- '--lib-path', vulkan_icd_lib_path / icd_file_name, +-+ '--icd-lib-path', vulkan_icd_lib_path, +-+ '--icd-filename', icd_file_name, +- '--out', '@OUTPUT@', +- ], +- build_by_default : true, +-@@ -150,7 +151,8 @@ _dev_icd = custom_target( +- prog_python, '@INPUT0@', +- '--api-version', '1.3', '--xml', '@INPUT1@', +- '--sizeof-pointer', sizeof_pointer, +-- '--lib-path', meson.current_build_dir() / icd_file_name, +-+ '--icd-lib-path', meson.current_build_dir(), +-+ '--icd-filename', icd_file_name, +- '--out', '@OUTPUT@', +- ], +- build_by_default : true, +-diff --git a/src/freedreno/vulkan/meson.build b/src/freedreno/vulkan/meson.build +-index 18e6aba..c530d6a 100644 +---- a/src/freedreno/vulkan/meson.build +-+++ b/src/freedreno/vulkan/meson.build +-@@ -202,12 +202,13 @@ icd_file_name = libname_prefix + 'vulkan_freedreno.' + libname_suffix +- freedreno_icd = custom_target( +- 'freedreno_icd', +- input : [vk_icd_gen, vk_api_xml], +-- output : 'freedreno_icd.@0@.json'.format(host_machine.cpu()), +-+ output : 'freedreno_icd.' + vulkan_manifest_suffix, +- command : [ +- prog_python, '@INPUT0@', +- '--api-version', '1.4', '--xml', '@INPUT1@', +- '--sizeof-pointer', sizeof_pointer, +-- '--lib-path', vulkan_icd_lib_path / icd_file_name, +-+ '--icd-lib-path', vulkan_icd_lib_path, +-+ '--icd-filename', icd_file_name, +- '--out', '@OUTPUT@', +- ], +- build_by_default : true, +-@@ -225,7 +226,8 @@ _dev_icd = custom_target( +- prog_python, '@INPUT0@', +- '--api-version', '1.4', '--xml', '@INPUT1@', +- '--sizeof-pointer', sizeof_pointer, +-- '--lib-path', meson.current_build_dir() / icd_file_name, +-+ '--icd-lib-path', meson.current_build_dir(), +-+ '--icd-filename', icd_file_name, +- '--out', '@OUTPUT@', +- ], +- build_by_default : true, +-diff --git a/src/gallium/targets/lavapipe/meson.build b/src/gallium/targets/lavapipe/meson.build +-index b79e3a4..d1d4e5b 100644 +---- a/src/gallium/targets/lavapipe/meson.build +-+++ b/src/gallium/targets/lavapipe/meson.build +-@@ -24,7 +24,8 @@ icd_command = [ +- prog_python, '@INPUT0@', +- '--api-version', '1.4', '--xml', '@INPUT1@', +- '--sizeof-pointer', sizeof_pointer, +-- '--lib-path', vulkan_icd_lib_path / icd_file_name, +-+ '--icd-lib-path', vulkan_icd_lib_path, +-+ '--icd-filename', icd_file_name, +- '--out', '@OUTPUT@', +- ] +- if host_machine.system() == 'windows' +-@@ -34,7 +35,7 @@ endif +- lvp_icd = custom_target( +- 'lvp_icd', +- input : [vk_icd_gen, vk_api_xml], +-- output : 'lvp_icd.@0@.json'.format(host_machine.cpu()), +-+ output : 'lvp_icd.' + vulkan_manifest_suffix, +- command : icd_command, +- build_by_default : true, +- install_dir : with_vulkan_icd_dir, +-@@ -51,7 +52,8 @@ _dev_icd = custom_target( +- prog_python, '@INPUT0@', +- '--api-version', '1.4', '--xml', '@INPUT1@', +- '--sizeof-pointer', sizeof_pointer, +-- '--lib-path', meson.current_build_dir() / icd_file_name, +-+ '--icd-lib-path', meson.current_build_dir(), +-+ '--icd-filename', icd_file_name, +- '--out', '@OUTPUT@', +- ], +- build_by_default : true, +-diff --git a/src/gfxstream/guest/vulkan/meson.build b/src/gfxstream/guest/vulkan/meson.build +-index b00d5e3..004606f 100644 +---- a/src/gfxstream/guest/vulkan/meson.build +-+++ b/src/gfxstream/guest/vulkan/meson.build +-@@ -49,12 +49,13 @@ icd_file_name = libname_prefix + 'vulkan_gfxstream.' + libname_suffix +- gfxstream_icd = custom_target( +- 'gfxstream_vk_icd', +- input : [vk_icd_gen, vk_api_xml], +-- output : 'gfxstream_vk_icd.@0@.json'.format(host_machine.cpu()), +-+ output : 'gfxstream_vk_icd.' + vulkan_manifest_suffix, +- command : [ +- prog_python, '@INPUT0@', +- '--api-version', '1.1', '--xml', '@INPUT1@', +- '--sizeof-pointer', sizeof_pointer, +-- '--lib-path', vulkan_icd_lib_path / icd_file_name, +-+ '--icd-lib-path', vulkan_icd_lib_path, +-+ '--icd-filename', icd_file_name, +- '--out', '@OUTPUT@', +- ], +- build_by_default : true, +-@@ -71,7 +72,8 @@ _dev_icd = custom_target( +- prog_python, '@INPUT0@', +- '--api-version', '1.3', '--xml', '@INPUT1@', +- '--sizeof-pointer', sizeof_pointer, +-- '--lib-path', meson.current_build_dir() / icd_file_name, +-+ '--icd-lib-path', meson.current_build_dir(), +-+ '--icd-filename', icd_file_name, +- '--out', '@OUTPUT@', +- ], +- build_by_default : true, +-diff --git a/src/imagination/vulkan/meson.build b/src/imagination/vulkan/meson.build +-index 245cd94..dfc3479 100644 +---- a/src/imagination/vulkan/meson.build +-+++ b/src/imagination/vulkan/meson.build +-@@ -141,12 +141,13 @@ icd_file_name = libname_prefix + 'vulkan_powervr_mesa.' + libname_suffix +- powervr_mesa_icd = custom_target( +- 'powervr_mesa_icd', +- input : [vk_icd_gen, vk_api_xml], +-- output : 'powervr_mesa_icd.@0@.json'.format(host_machine.cpu()), +-+ output : 'powervr_mesa_icd.' + vulkan_manifest_suffix, +- command : [ +- prog_python, '@INPUT0@', +- '--api-version', '1.4', '--xml', '@INPUT1@', +- '--sizeof-pointer', sizeof_pointer, +-- '--lib-path', vulkan_icd_lib_path / icd_file_name, +-+ '--icd-lib-path', vulkan_icd_lib_path, +-+ '--icd-filename', icd_file_name, +- '--out', '@OUTPUT@', +- ], +- build_by_default : true, +-@@ -163,7 +164,8 @@ _dev_icd = custom_target( +- prog_python, '@INPUT0@', +- '--api-version', '1.4', '--xml', '@INPUT1@', +- '--sizeof-pointer', sizeof_pointer, +-- '--lib-path', meson.current_build_dir() / icd_file_name, +-+ '--icd-lib-path', meson.current_build_dir(), +-+ '--icd-filename', icd_file_name, +- '--out', '@OUTPUT@', +- ], +- build_by_default : true, +-diff --git a/src/intel/vulkan/meson.build b/src/intel/vulkan/meson.build +-index 4963298..e810130 100644 +---- a/src/intel/vulkan/meson.build +-+++ b/src/intel/vulkan/meson.build +-@@ -51,12 +51,13 @@ icd_file_name = libname_prefix + 'vulkan_intel.' + libname_suffix +- intel_icd = custom_target( +- 'intel_icd', +- input : [vk_icd_gen, vk_api_xml], +-- output : 'intel_icd.@0@.json'.format(host_machine.cpu()), +-+ output : 'intel_icd.' + vulkan_manifest_suffix, +- command : [ +- prog_python, '@INPUT0@', +- '--api-version', '1.4', '--xml', '@INPUT1@', +- '--sizeof-pointer', sizeof_pointer, +-- '--lib-path', vulkan_icd_lib_path / icd_file_name, +-+ '--icd-lib-path', vulkan_icd_lib_path, +-+ '--icd-filename', icd_file_name, +- '--out', '@OUTPUT@', +- ], +- build_by_default : true, +-@@ -74,7 +75,8 @@ _dev_icd = custom_target( +- prog_python, '@INPUT0@', +- '--api-version', '1.4', '--xml', '@INPUT1@', +- '--sizeof-pointer', sizeof_pointer, +-- '--lib-path', meson.current_build_dir() / icd_file_name, +-+ '--icd-lib-path', meson.current_build_dir(), +-+ '--icd-filename', icd_file_name, +- '--out', '@OUTPUT@', +- ], +- build_by_default : true, +-diff --git a/src/intel/vulkan_hasvk/meson.build b/src/intel/vulkan_hasvk/meson.build +-index ed5ac74..ea17634 100644 +---- a/src/intel/vulkan_hasvk/meson.build +-+++ b/src/intel/vulkan_hasvk/meson.build +-@@ -21,12 +21,13 @@ icd_file_name = libname_prefix + 'vulkan_intel_hasvk.' + libname_suffix +- intel_hasvk_icd = custom_target( +- 'intel_hasvk_icd', +- input : [vk_icd_gen, vk_api_xml], +-- output : 'intel_hasvk_icd.@0@.json'.format(host_machine.cpu()), +-+ output : 'intel_hasvk_icd.' + vulkan_manifest_suffix, +- command : [ +- prog_python, '@INPUT0@', +- '--api-version', '1.3', '--xml', '@INPUT1@', +- '--sizeof-pointer', sizeof_pointer, +-- '--lib-path', vulkan_icd_lib_path / icd_file_name, +-+ '--icd-lib-path', vulkan_icd_lib_path, +-+ '--icd-filename', icd_file_name, +- '--out', '@OUTPUT@', +- ], +- build_by_default : true, +-@@ -44,7 +45,8 @@ _dev_icd = custom_target( +- prog_python, '@INPUT0@', +- '--api-version', '1.3', '--xml', '@INPUT1@', +- '--sizeof-pointer', sizeof_pointer, +-- '--lib-path', meson.current_build_dir() / icd_file_name, +-+ '--icd-lib-path', meson.current_build_dir(), +-+ '--icd-filename', icd_file_name, +- '--out', '@OUTPUT@', +- ], +- build_by_default : true, +-diff --git a/src/microsoft/vulkan/meson.build b/src/microsoft/vulkan/meson.build +-index 0349d2d..99239a3 100644 +---- a/src/microsoft/vulkan/meson.build +-+++ b/src/microsoft/vulkan/meson.build +-@@ -80,7 +80,8 @@ icd_command = [ +- prog_python, '@INPUT0@', +- '--api-version', '1.1', '--xml', '@INPUT1@', +- '--sizeof-pointer', sizeof_pointer, +-- '--lib-path', vulkan_icd_lib_path / icd_file_name, +-+ '--icd-lib-path', vulkan_icd_lib_path, +-+ '--icd-filename', icd_file_name, +- '--out', '@OUTPUT@', +- ] +- +-@@ -88,7 +89,8 @@ icd_dev_command = [ +- prog_python, '@INPUT0@', +- '--api-version', '1.1', '--xml', '@INPUT1@', +- '--sizeof-pointer', sizeof_pointer, +-- '--lib-path', join_paths(meson.current_build_dir(), icd_file_name), +-+ '--icd-lib-path', meson.current_build_dir(), +-+ '--icd-filename', icd_file_name, +- '--out', '@OUTPUT@', +- ] +- +-@@ -100,7 +102,7 @@ endif +- dzn_icd = custom_target( +- 'dzn_icd', +- input : [vk_icd_gen, vk_api_xml], +-- output : 'dzn_icd.@0@.json'.format(host_machine.cpu()), +-+ output : 'dzn_icd.' + vulkan_manifest_suffix, +- command : icd_command, +- build_by_default : true, +- install_dir : with_vulkan_icd_dir, +-diff --git a/src/nouveau/vulkan/meson.build b/src/nouveau/vulkan/meson.build +-index bf6e2f7..e5f951b 100644 +---- a/src/nouveau/vulkan/meson.build +-+++ b/src/nouveau/vulkan/meson.build +-@@ -166,12 +166,13 @@ icd_file_name = libname_prefix + 'vulkan_nouveau.' + libname_suffix +- nouveau_icd = custom_target( +- 'nouveau_icd', +- input : [vk_icd_gen, vk_api_xml], +-- output : 'nouveau_icd.@0@.json'.format(host_machine.cpu()), +-+ output : 'nouveau_icd.' + vulkan_manifest_suffix, +- command : [ +- prog_python, '@INPUT0@', +- '--api-version', '1.4', '--xml', '@INPUT1@', +- '--sizeof-pointer', sizeof_pointer, +-- '--lib-path', vulkan_icd_lib_path / icd_file_name, +-+ '--icd-lib-path', vulkan_icd_lib_path, +-+ '--icd-filename', icd_file_name, +- '--out', '@OUTPUT@', +- ], +- build_by_default : true, +-@@ -189,7 +190,8 @@ custom_target( +- prog_python, '@INPUT0@', +- '--api-version', '1.4', '--xml', '@INPUT1@', +- '--sizeof-pointer', sizeof_pointer, +-- '--lib-path', meson.current_build_dir() / icd_file_name, +-+ '--icd-lib-path', meson.current_build_dir(), +-+ '--icd-filename', icd_file_name, +- '--out', '@OUTPUT@', +- ], +- build_by_default : true, +-diff --git a/src/panfrost/vulkan/meson.build b/src/panfrost/vulkan/meson.build +-index 0f224db..e8ca051 100644 +---- a/src/panfrost/vulkan/meson.build +-+++ b/src/panfrost/vulkan/meson.build +-@@ -241,12 +241,13 @@ icd_file_name = libname_prefix + 'vulkan_panfrost.' + libname_suffix +- panfrost_icd = custom_target( +- 'panfrost_icd', +- input : [vk_icd_gen, vk_api_xml], +-- output : 'panfrost_icd.@0@.json'.format(host_machine.cpu()), +-+ output : 'panfrost_icd.' + vulkan_manifest_suffix, +- command : [ +- prog_python, '@INPUT0@', +- '--api-version', '1.4', '--xml', '@INPUT1@', +- '--sizeof-pointer', sizeof_pointer, +-- '--lib-path', vulkan_icd_lib_path / icd_file_name, +-+ '--icd-lib-path', vulkan_icd_lib_path, +-+ '--icd-filename', icd_file_name, +- '--out', '@OUTPUT@', +- ], +- build_by_default : true, +-@@ -264,7 +265,8 @@ _dev_icd = custom_target( +- prog_python, '@INPUT0@', +- '--api-version', '1.4', '--xml', '@INPUT1@', +- '--sizeof-pointer', sizeof_pointer, +-- '--lib-path', meson.current_build_dir() / icd_file_name, +-+ '--icd-lib-path', meson.current_build_dir(), +-+ '--icd-filename', icd_file_name, +- '--out', '@OUTPUT@', +- ], +- build_by_default : true, +-diff --git a/src/virtio/vulkan/meson.build b/src/virtio/vulkan/meson.build +-index e41faf6..2ad2b6f 100644 +---- a/src/virtio/vulkan/meson.build +-+++ b/src/virtio/vulkan/meson.build +-@@ -20,12 +20,13 @@ icd_file_name = libname_prefix + 'vulkan_virtio.' + libname_suffix +- virtio_icd = custom_target( +- 'virtio_icd', +- input : [vk_icd_gen, vk_api_xml], +-- output : 'virtio_icd.@0@.json'.format(host_machine.cpu()), +-+ output : 'virtio_icd.' + vulkan_manifest_suffix, +- command : [ +- prog_python, '@INPUT0@', +- '--api-version', '1.4', '--xml', '@INPUT1@', +- '--sizeof-pointer', sizeof_pointer, +-- '--lib-path', vulkan_icd_lib_path / icd_file_name, +-+ '--icd-lib-path', vulkan_icd_lib_path, +-+ '--icd-filename', icd_file_name, +- '--out', '@OUTPUT@', +- ], +- build_by_default : true, +-@@ -43,7 +44,8 @@ _dev_icd = custom_target( +- prog_python, '@INPUT0@', +- '--api-version', '1.4', '--xml', '@INPUT1@', +- '--sizeof-pointer', sizeof_pointer, +-- '--lib-path', meson.current_build_dir() / icd_file_name, +-+ '--icd-lib-path', meson.current_build_dir(), +-+ '--icd-filename', icd_file_name, +- '--out', '@OUTPUT@', +- ], +- build_by_default : true, +-diff --git a/src/vulkan/util/vk_icd_gen.py b/src/vulkan/util/vk_icd_gen.py +-index 7760dd6..d5fb0f0 100644 +---- a/src/vulkan/util/vk_icd_gen.py +-+++ b/src/vulkan/util/vk_icd_gen.py +-@@ -22,6 +22,7 @@ +- +- import argparse +- import json +-+import os +- import re +- import xml.etree.ElementTree as et +- +-@@ -48,8 +49,10 @@ if __name__ == '__main__': +- help='Vulkan registry XML for patch version') +- parser.add_argument('--sizeof-pointer', required=False, type=int, +- help='sizeof(void*) on the host cpu') +-- parser.add_argument('--lib-path', required=True, +-- help='Path to installed library') +-+ parser.add_argument('--icd-lib-path', required=True, +-+ help='Folder of icd lib_path to installed library') +-+ parser.add_argument('--icd-filename', required=True, +-+ help='Filename of icd lib_path to installed library') +- parser.add_argument('--out', required=False, +- help='Output json file.') +- parser.add_argument('--use-backslash', action='store_true', +-@@ -63,7 +66,12 @@ if __name__ == '__main__': +- else: +- re.match(r'\d+\.\d+\.\d+', version) +- +-- lib_path = args.lib_path +-+ lib_path = args.icd_filename +-+ if args.out and len(os.path.basename(args.out).split('.')) == 3: +-+ # The output filename is the form of '${icd_id}.${host_machine.cpu()}.json', +-+ # that means vulkan_manifest_per_architecture are true. +-+ lib_path = args.icd_lib_path + '/' + args.icd_filename +-+ +- if args.use_backslash: +- lib_path = lib_path.replace('/', '\\') +- +diff -Nru mesa-25.3.3/debian/rules mesa-25.3.3/debian/rules +--- mesa-25.3.3/debian/rules 2026-01-07 07:26:10.000000000 -0500 ++++ mesa-25.3.3/debian/rules 2026-05-29 11:29:26.000000000 -0500 +@@ -13,7 +13,7 @@ + DEB_HOST_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU) + + # for finding the correct llvm-config when meson doesn't know about it yet +-LLVM_VERSION = 21 ++LLVM_VERSION = 19 + export PATH:=/usr/lib/llvm-$(LLVM_VERSION)/bin/:$(PATH) + + export DEB_BUILD_MAINT_OPTIONS=optimize=-lto +@@ -110,9 +110,9 @@ + endif + + # WSL supports only amd64 and arm64 +- ifneq (,$(filter $(DEB_HOST_ARCH), amd64 arm64)) +- GALLIUM_DRIVERS += d3d12 +- endif ++ #ifneq (,$(filter $(DEB_HOST_ARCH), amd64 arm64)) ++ # GALLIUM_DRIVERS += d3d12 ++ #endif + + # asahi supports only arm64, amd64 and i386 + ifneq (,$(filter $(DEB_HOST_ARCH), arm64 amd64 i386)) +@@ -136,9 +136,6 @@ + confflags_GALLIUM += -Dllvm=enabled + + # Build rusticl for archs where rustc is available +- ifneq (,$(filter $(DEB_HOST_ARCH), $(RUSTICL_ARCHS))) +- confflags_GALLIUM += -Dgallium-rusticl=true +- endif + + ifneq (,$(filter $(DEB_HOST_ARCH), $(NVK_ARCHS))) + export MESON_PACKAGE_CACHE_DIR=/usr/share/cargo/registry/ +@@ -174,11 +171,19 @@ + -Dplatforms="[$(EGL_PLATFORMS_LIST)]" \ + -Dvulkan-drivers="[$(VULKAN_DRIVERS_LIST)]" \ + -Dvulkan-layers="[$(VULKAN_LAYERS_LIST)]" \ +- -Dvulkan-manifest-per-architecture=false \ ++ ++# -Dvulkan-manifest-per-architecture=false ++confflags += \ + -Dglvnd=enabled \ + -Db_ndebug=true \ + -Dbuild-tests=true \ +- -Dtools=drm-shim \ ++ ++# Only enable rusticl on architectures that support it in Trixie ++ifneq (,$(filter $(DEB_HOST_ARCH), amd64 arm64 armel armhf i386 loong64 mips64el powerpc ppc64 ppc64el riscv64 x32)) ++confflags += -Dgallium-rusticl=true ++endif ++ ++confflags += \ + $(confflags_DIRECT_RENDERING) \ + $(confflags_GBM) \ + $(confflags_GALLIUM) \ +diff -Nru mesa-25.3.3/debian/source/format mesa-25.3.3/debian/source/format +--- mesa-25.3.3/debian/source/format 2026-01-07 07:14:30.000000000 -0500 ++++ mesa-25.3.3/debian/source/format 1969-12-31 19:00:00.000000000 -0500 +@@ -1 +0,0 @@ +-3.0 (quilt) +diff -Nru mesa-25.3.3/debian/tests/control mesa-25.3.3/debian/tests/control +--- mesa-25.3.3/debian/tests/control 2026-01-07 07:14:30.000000000 -0500 ++++ mesa-25.3.3/debian/tests/control 1969-12-31 19:00:00.000000000 -0500 +@@ -1,3 +0,0 @@ +-Tests: gles-gbm-build-test +-Depends: build-essential, libgbm-dev, libgles2-mesa-dev, pkg-config +-Restrictions: superficial +diff -Nru mesa-25.3.3/debian/tests/gles-gbm-build-test mesa-25.3.3/debian/tests/gles-gbm-build-test +--- mesa-25.3.3/debian/tests/gles-gbm-build-test 2026-01-07 07:14:30.000000000 -0500 ++++ mesa-25.3.3/debian/tests/gles-gbm-build-test 1969-12-31 19:00:00.000000000 -0500 +@@ -1,9 +0,0 @@ +-#!/usr/bin/make -f +- +-CFLAGS=$(shell pkg-config --cflags glesv2 --cflags egl --cflags gbm) +-LIBS=$(shell pkg-config --libs glesv2 --libs egl --libs gbm) +- +-debian/tests/gles-gbm: debian/tests/gles-gbm.c +- gcc -g -o $@ $(CFLAGS) $< $(LIBS) +- @echo "Build test of $< succeeded" +- @rm -f $@ +diff -Nru mesa-25.3.3/debian/tests/gles-gbm.c mesa-25.3.3/debian/tests/gles-gbm.c +--- mesa-25.3.3/debian/tests/gles-gbm.c 2026-01-07 07:14:30.000000000 -0500 ++++ mesa-25.3.3/debian/tests/gles-gbm.c 1969-12-31 19:00:00.000000000 -0500 +@@ -1,179 +0,0 @@ +-// based on +-// https://www.khronos.org/registry/EGL/extensions/MESA/EGL_MESA_platform_gbm.txt +- +-#include +-#include +-#include +-#include +- +-#include +-#include +-#include +- +-#include +-#include +-#include +-#include +- +-struct my_display { +- struct gbm_device *gbm; +- EGLDisplay egl; +-}; +- +-struct my_config { +- struct my_display dpy; +- EGLConfig egl; +-}; +- +-struct my_window { +- struct my_config config; +- struct gbm_surface *gbm; +- EGLSurface egl; +-}; +- +-PFNEGLGETPLATFORMDISPLAYEXTPROC getPlatformDisplayEXT; +-PFNEGLCREATEPLATFORMWINDOWSURFACEEXTPROC createPlatformWindowSurfaceEXT; +- +-static void +-check_extensions(void) +-{ +- const char *client_extensions = eglQueryString(EGL_NO_DISPLAY, EGL_EXTENSIONS); +- +- if (!client_extensions) { +- abort(); +- } +- if (!strstr(client_extensions, "EGL_MESA_platform_gbm")) { +- abort(); +- } +- +- if (!strstr(client_extensions, "EGL_EXT_platform_base")) { +- abort(); +- } +- +- getPlatformDisplayEXT = +- (void *) eglGetProcAddress("eglGetPlatformDisplayEXT"); +- createPlatformWindowSurfaceEXT = +- (void *) eglGetProcAddress("eglCreatePlatformWindowSurfaceEXT"); +- +-} +- +-static struct my_display +-get_display(void) +-{ +- struct my_display dpy; +- EGLint major, minor; +- +- int fd = open("/dev/dri/card0", O_RDWR | FD_CLOEXEC); +- if (fd < 0) +- abort(); +- +- dpy.gbm = gbm_create_device(fd); +- if (!dpy.gbm) +- abort(); +- +- dpy.egl = getPlatformDisplayEXT(EGL_PLATFORM_GBM_MESA, dpy.gbm, NULL); +- +- if (dpy.egl == EGL_NO_DISPLAY) +- abort(); +- +- if (eglInitialize(dpy.egl, &major, &minor)) +- printf ("EGL %d.%d\n", major, minor); +- else +- abort(); +- +- return dpy; +-} +- +-static struct my_config +-get_config(struct my_display dpy) +-{ +- struct my_config config = { +- .dpy = dpy, +- }; +- +- EGLint egl_config_attribs[] = { +- EGL_BUFFER_SIZE, 32, +- EGL_DEPTH_SIZE, EGL_DONT_CARE, +- EGL_STENCIL_SIZE, EGL_DONT_CARE, +- EGL_RENDERABLE_TYPE, EGL_OPENGL_ES2_BIT, +- EGL_SURFACE_TYPE, EGL_WINDOW_BIT, +- EGL_NONE, +- }; +- +- EGLint num_configs; +- if (!eglGetConfigs(dpy.egl, NULL, 0, &num_configs)) +- abort(); +- +- EGLConfig *configs = malloc(num_configs * sizeof(EGLConfig)); +- if (!eglChooseConfig(dpy.egl, egl_config_attribs, +- configs, num_configs, &num_configs)) { +- abort(); +- } +- if (num_configs == 0) +- abort(); +- +- for (int i = 0; i < num_configs; ++i) { +- EGLint gbm_format; +- struct gbm_format_name_desc desc; +- +- if (!eglGetConfigAttrib(dpy.egl, configs[i], +- EGL_NATIVE_VISUAL_ID, &gbm_format)) { +- abort(); +- } +- +- printf ("found gbm_format: %s\n", gbm_format_get_name (gbm_format, &desc)); +- if (gbm_format == GBM_FORMAT_ARGB8888) { +- config.egl = configs[i]; +- free(configs); +- return config; +- } +- } +- +- // no egl config matching gbm format +- abort(); +-} +- +-static struct my_window +-get_window(struct my_config config) +-{ +- struct my_window window = { +- .config = config, +- }; +- +- window.gbm = gbm_surface_create(config.dpy.gbm, +- 256, 256, +- GBM_FORMAT_XRGB8888, +- GBM_BO_USE_RENDERING); +- if (!window.gbm) +- abort(); +- +- window.egl = createPlatformWindowSurfaceEXT(config.dpy.egl, +- config.egl, +- window.gbm, +- NULL); +- if (window.egl == EGL_NO_SURFACE) +- abort(); +- +- return window; +-} +- +-int +-main(void) +-{ +- check_extensions(); +- +- struct my_display dpy = get_display(); +- struct my_config config = get_config(dpy); +- struct my_window window = get_window(config); +- EGLContext context; +- +- context = eglCreateContext(dpy.egl, config.egl, EGL_NO_CONTEXT, NULL); +- eglMakeCurrent(dpy.egl, window.egl, window.egl, context); +- +- /* just so we have some gles symbols too */ +- glClearColor(1.0, 1.0, 1.0, 1.0); +- glClear(GL_COLOR_BUFFER_BIT); +- glFlush(); +- +- return EXIT_SUCCESS; +-} +diff -Nru mesa-25.3.3/debian/upstream/metadata mesa-25.3.3/debian/upstream/metadata +--- mesa-25.3.3/debian/upstream/metadata 2026-01-07 07:14:30.000000000 -0500 ++++ mesa-25.3.3/debian/upstream/metadata 1969-12-31 19:00:00.000000000 -0500 +@@ -1,4 +0,0 @@ +-Bug-Database: https://gitlab.freedesktop.org/mesa/mesa/-/issues +-Bug-Submit: https://gitlab.freedesktop.org/mesa/mesa/-/issues/new +-Repository: https://gitlab.freedesktop.org/mesa/mesa.git +-Repository-Browse: https://gitlab.freedesktop.org/mesa/mesa +diff -Nru mesa-25.3.3/debian/upstream/signing-key.asc mesa-25.3.3/debian/upstream/signing-key.asc +--- mesa-25.3.3/debian/upstream/signing-key.asc 2026-01-07 07:14:30.000000000 -0500 ++++ mesa-25.3.3/debian/upstream/signing-key.asc 1969-12-31 19:00:00.000000000 -0500 +@@ -1,877 +0,0 @@ +------BEGIN PGP PUBLIC KEY BLOCK----- +- +-xsBNBF5i1J4BCACsKVBDxUpz0m03D6ojiR4zZTuLJuI8qrc5HivZiJOKBWvKUm8/ +-SUSCCbJ5ka7zwfEQMepm0rdQfFj6BDqAqEAmG/WU9TTbNx3TBDtT3CBBXSDaiWjO +-BFlglWKXJeUfHYpfIB1sC6aIIdSnPlU57Fs7jA9FtHbJM3SSwab/492udHZY/bKV +-s53Z7KcZDKPMtuZCnGbOZ1+lu8EMHuw9TfqQZODUOvDPYjpzqZAjsTJwdNtOeyWv +-dafED7PTpuod6eQnvgUKFlj6aqoZhZa9/hWdGDhexLzRGM4pwZcUMEb+1pd1TBko +-wqXJbW3XLs5B/cGiEbqHyDVoaI6J/JleDY1RABEBAAHNIkVyaWMgRW5nZXN0cm9t +-IDxlcmljQGVuZ2VzdHJvbS5jaD7CwI4EEwEIADgWIQRXVR3hW5aPY0HCSPaNjjGv +-wyQopgUCXmLUngIbAwULCQgHAgYVCgkICwIEFgIDAQIeAQIXgAAKCRCNjjGvwyQo +-puKwCACTeD0Eh+M8IIEAuGVtPgy3jCDIoOnNg+QI6VAh9qNB4Yx0uPzvOwmvAODY +-fUdPbBxn9CIU1X3buJmI1G75c2ZT+ZXJbkute6oif+f2E6vLe+Ox0GeGIBNQK4iZ +-+pV0JPn3seqhDJAekRBWXNJszuVNxSDFsVi+qEoTPJZze7yOcc1QMcRsnJ+S7YFg +-jf/5aRrqdnLxVbph53Vrawas3rQk97Ln+vNd/Ca1HMv8vXMPtEFLk5JQI+gmdVv3 +-xcpz2ss3mMU5+YnY69T1EBemZIMcE17wPo7ROvT8x1fG2fnPwHqJieQFCMGKLW29 +-5peUY2OiHdLgaepbqWrB2Xxy+BY+xjMEWnyK+hYJKwYBBAHaRw8BAQdAciqI9uB5 +-/t6i0/M+WXq4meqx9RtBN3y0bo09IckAQSzNLUR5bGFuIEJha2VyIChJbnRlbCkg +-PGR5bGFuLmMuYmFrZXJAaW50ZWwuY29tPsKWBBMWCgA+FiEEccS3ViC8dXCLS9sl +-TJX6qz6wc+wFAlp8kU0CGwMFCQPCZwAFCwkIBwMFFQoJCAsFFgIDAQACHgECF4AA +-CgkQTJX6qz6wc+y6dwEApeItI4eluV6QU9i8gSyzZsxEgbrtpAfhqwLNwh6kjvAA +-/3hPDzhNPtNZ4Jw7QH5flaqyeJe1n+2trIdxUdD4GTcOzSVEeWxhbiBCYWtlciA8 +-YmFrZXIuZHlsYW4uY0BnbWFpbC5jb20+wpYEExYKAD4WIQRxxLdWILx1cItL2yVM +-lfqrPrBz7AUCWnyRvwIbAwUJA8JnAAULCQgHAwUVCgkICwUWAgMBAAIeAQIXgAAK +-CRBMlfqrPrBz7E4yAQDeLnajXKGm0cOKTTKZciCrwCu+adRzN2OICwTD74EkhwD/ +-fxFpWbRF+j0x8I1IhQKCDSzg9XWRBlr/CXMYHooWMgHNIUR5bGFuIEJha2VyIDxk +-eWxhbkBwbndiYWtlcnMuY29tPsKZBBMWCgBBAhsDBQkDwmcABQsJCAcCBhUKCQgL +-AgQWAgMBAh4BAheAFiEEccS3ViC8dXCLS9slTJX6qz6wc+wFAlp8kfoCGQEACgkQ +-TJX6qz6wc+xHwwD/Wum1XIULb5mG0nLL3QSJMnYr2aOa9Wa5gncUx/5Z5noBAJpu +-Ks0LQFHl7qPdGF3eXEfCqqz8AS8O1CVGVJ0uJLILzSVEeWxhbiBCYWtlciA8ZHls +-YW5iYWtlckBmYXN0bWFpbC5jb20+wpYEExYKAD4WIQRxxLdWILx1cItL2yVMlfqr +-PrBz7AUCWnyRNwIbAwUJA8JnAAULCQgHAwUVCgkICwUWAgMBAAIeAQIXgAAKCRBM +-lfqrPrBz7ESNAP0bHtnt9QyumRMWNoTFs/YbGYTTNY/wcJcHr6ZKcrbS1QD/REq4 +-tCa02dMHqkyBXEz0182hmAIjqfVTQo1sQwAimAnOOARafIr6EgorBgEEAZdVAQUB +-AQdA3VHAaYhkaOfoGJSd3xV+AQBGSUTsyFxlJ0e0giyLjigDAQgHwn4EGBYIACYW +-IQRxxLdWILx1cItL2yVMlfqrPrBz7AUCWnyK+gIbDAUJA8JnAAAKCRBMlfqrPrBz +-7JLLAQCGnVUyjuvWZwLLlH3sRqa7QRHfqfgBSVZqcds2FeHNTQEAwapDlvM3VbK6 +-QLblu2wnSkQWiOiZ86/0uC9FMUFPtgDGwU0EVAOsDwEQALIZdRzq9KY2TBl1NPNf +-W8dGAgNaimmi3noTmg476Azq6TIwNjvrQXEq+aHvTgjw2pN+DdFyzXx9I5d5GPWA +-MbzgyxTtAzeDohDLEID4hXt3av8M9kTPsfEQgoXEYnDbizCxAnL+KJl/9vx+WqIl +-vHdh7UsXtPmLD+AoOw3p6rMC0sqrD0j/hMFUTvrqfCYo1BmLDaMAUKzeXB+Y0ibt +-lpA0GkdNFpsxMswmIUXKcuxrV5Wx/0NHd5VdbhzagcplvEO9JZHbLPpdxD2V2KLz +-2xQ15yWeNIU063vrU/jME3BwRfYa5Cwk7+FrDkXKswkl7EBt1RO2yFnte+EO/9QI +-e3KpAFTD+/Bh7xHHv0er9845R0yNY5ZwMLPJhOYZ1sQlhEesQ1yw6Gi2LciQ6ODP +-DRQPIIfKNqkVXVklP8rPuuQyax022iLUFVMsh069CZ5dC03ZxplI3bTBlYd1mevP +-X8k587GkSx/ZHvzNq8h+htF5B0WhgwKO/hvj1YH8bK13m+d6qT3KL0MSEJjDm4bF +-CCMgoLgBk9W0P/8Zj6JiI97l0/CuFTUXIPdv1KBjEUT+5mWBvMEhXhqQrXW8LlD4 +-Kjk9jOGc8+B3txguOv9x4x8Y+R5YsJg7FlteD3YFkoomcUdjHsUnThYpLxKPMif+ +-oTO/LtKY8bFIJfrN3CfR8plhABEBAAHNJ0VtaWwgVmVsaWtvdiA8ZW1pbC5sLnZl +-bGlrb3ZAZ21haWwuY29tPsLBeQQTAQIAIwUCVAOsDwIbAwcLCQgHAwIBBhUIAgkK +-CwQWAgMBAh4BAheAAAoJEO2uN7As60kNX8AQAJ39Eq9LMvQvj/0di8WySM1HjQ08 +-XJAfIxo+D155uWF9ucfuZZhcnYw8ZNFuC9AKvTNndHu7wTxHG6XCJ9ubbTHRaFg4 +-qQO5JE6OuhGq8OHF+4u1e0Eqp9UbDpPSswQ45Z2oaGqXjK5WmoZuAdrll8W9CLYS +-1PjRAN0PTnZp3NZ5P3poVAHoZ/cJEx9rjLuFrBtRXXRcvcFSWNRzKH5Im/2U9yVb +-T1Y0T624KZ0iqg/3bsFKNfCHYZHp0zTPRoN/fA7FFz1LyrfiNL7E3yGxeZgUCqSf +-RiRUhDQzQ9pDz2W1zKidsbqtn7Ws2DG2IsSl85mnOvsujBWzD1HqTL+m+EEd9Ugz +-hpPXuFuLZd+cyKGa39PVJmpvfr5pgW2PwFz+j0jlys9fA4/iKfeF5jZmYNZ4aQ9J +-E2LHRUtAcvQfM7GMwASb7LlE4sOjtn+wY55tjExg8grmYnOsqGTvfsUQjnty9RJF +-fNuOZXcIg4glto1QtYVeQIdGF3KTyaGxXMqSXsgOJY8GPVELmvQReauNTMrxB/Ot +-NaI5rrP1YiRnixKzRvPXhDillHaqLwsotWMI1/8W6yoJOBtlTTrHVL/vlcnBywUQ +-1aRZg8RrHHNCIKzWtXMbxKes6NzJzkVPSsQBAtZTt6r1Tqd3gFcySiSK7OU4paqw +-PJeJtHfCSEjzSQAnxsFNBFc/b7YBEACkr2uZ+LcW7s8C/TxeyPpk6HFCoNkRvPbE +-zuDYuNZIIvN4tfxqi+lyng5P4w6beEi0Us2au43KYXnibIkde/rrhVCnrUQQqG32 +-oHLbTky+gRvJJ+kqyheoh1UVjs8v5eGSNYshbIjwivMXLWxlay8G4AGmauFwMJx8 +-76ANcBCydeYvuEelBY8GFdkbjIdd4hqXNEy4SNlf5wzCIZDK8B4v/sAXa/HUO0HC +-E4Ebq7lPSxtUdKzX2bf19HgA6Y6btkMEA7NoKPoCiKPueznGvi2YY3w7Os/IYwnC +-fG3Q3TCEZhtT/MFY/aVD/VyjyrwJRreOfqkUZbeVE7MGlXojRw/Pf/Mb+vqHkpk/ +-x5fwPlHNhf2EtuaDwdekUI/TYchlS42GdcdxP3n3jXxbWYhJZlCtK7tKK53iiyIk +-v2OnRfKt/OMczg6X/qSiV72OwJgy+opn+lyp0HcyzphUHbm5fyd6mu5z5GUUyPJY +-Pb9Bq2iaIXr157ci0SqzV8Z+ToAPoWlDScPDZBIgON2tyCXV1dV/XP+8NNHXbVBF +-XcKw3czhaK3dYYnQTgt83/kQpulPO4xflQDVK3S74wVhoIoPYz83UcOYAJ2XLIKV +-zq2aViNPrJ+BgHfzhGzeokza8H6L5LcW0qXFC4j16C95cWbM7RO/fsWsRe4y0S68 +-O0UKFPIXcwARAQABzSBBbmRyZXMgR29tZXogPGFnb21lekBpZ2FsaWEuY29tPsLB +-dwQTAQgAIQUCVz9z0QIbAwULCQgHAgYVCAkKCwIEFgIDAQIeAQIXgAAKCRDZYcWW +-pyA0Vu9GD/4xP2Kjs79f4qKsBePuTD9ynwsJcQLd1tXnejlwmXB1DxbKG2PE4HE3 +-OCt5sOyxhu8EoNPDjoPcmqROAxY60sz2mqMN7DNvhqPoNsSq6udjVLJqyZWna5HW +-zbiEVGEtlWq5A48F+Qfr/HmZNAztYdYg+vI6es9Ks/eNhRFJwrgDZh36Sv0f3b1H +-IR8LmRmHwew3KnB+nrVcwgzQw9G7B2N7P0HmvcYw7BF4AspshV4Kky5PfO+i0Qu+ +-PF9EVJNl7HvbOZ0atngiek8Kdri+1QO2+Cm5PZs4dxruX63uKVQP83wWgNtdbSyU +-3U3wadmnFrI1B/vZPkqEa2GOOdd1J1bUfqTaU+7xjHA+Nlqgu6lBWnp02SMkqdBR +-ccfat2OlngmL1gCzW3mYlYwHO5nLkVH1FImCvGoaezCc+7fXeTMzBruFkNQahCsa +-WXbpVgNqIktsDjw+8fWuQ7aRJQ2d7xz7wqiKyiJEx/pObCjh2zmVwmRQqeG2cyIa +-tL52Fh5bNA/OjifOqDER4/mByetDeyhuKs4SO/JkiQB/GYhSIL3KJV5pdhtlUH83 +-UvEqRK5eO/ey85PEl8rL1LXaEBBV1aqFJC0pEAQmixGeXTi096uAX9obnUNnAugb +-bzjBopqFzYEghRWSn8qah+3gfhmVNt8TUMSN6Ku1q7YypQs9IEPPOM0fQW5kcmVz +-IEdvbWV6IDx0YW50eTBAZ21haWwuY29tPsLBdwQTAQgAIQUCVz9vtgIbAwULCQgH +-AgYVCAkKCwIEFgIDAQIeAQIXgAAKCRDZYcWWpyA0VovCD/0XgK0vpDgoMNtqo3K7 +-AhKgnmMp2qAKifk0N6tbTdcedMsGa3iO7cypIMfgB6G7yDUo8xf+iaGsiX1si/r5 +-MGIl7cCch0gRj5joD1pZhEpPvxsyD2Mr7bPj4Nsy7CgMpmFQrxXGb93rq0PcYS7J +-raLOfXDQ0uwYsbR6vh5SeW0G/e+jGy+TS+VHAQB8Hy69KrUcUDTh+sQJOxyv0tXf +-tikuyznyodrxw8CSCeEUiNL+8P1Qb1ecPaOogFgyCTPGvPsp/pELBDa4Ru0bBIjU +-72KyzvmI9qeevJ3XpDFq5AUT9nkZ6Q7/9dahMZ9aDh6/dkNKURbRhNVXUNBzR8Qd +-HnU0Ys1GLe5tTgkYF3YXA5Azrab9C+eohfnzP3bG2MPkWIY+Cg7Xu9T0dIwb2gBy +-n06lEl1qC1RSOMAqlrSzwu249ZbWaFLPvcXxcCdzt/3GB3MFCIjoRAFh4a4h9gZB +-6ybDNX1yAT7gLmd0xMrF/kVkNzhA73WOvlrYDTKD1uJV28iLZBbmwPTv5wuWQam7 +-Uwtx2V33TkCdmUHHfzfdYI4iCGTw4njW/S3+gQNP15AwPfEuVS7hWjVsq1h1cRQT +-GWiG4ozVITxVImPsfDW5ewjVKy5uXUelSIraRsxPoI8OXz1W4rTWaCo0kU3C38kK +-EUXizPNY2ZQBBpr0jtEhDyHTbM0fQW5kcmVzIEdvbWV6IDx0YW50eUBpZ2FsaWEu +-Y29tPsLBjgQTAQgAOBYhBJRtCbXkyYReYwdf8dlhxZanIDRWBQJY0RyUAhsDBQsJ +-CAcCBhUICQoLAgQWAgMBAh4BAheAAAoJENlhxZanIDRW754QAKKS7VslnNY5hGTY +-Cm6af3cMOVA6QD2Uyi78tZMKFj0DpzAAcwG9eJW3NGCez1B6sPE0iJUvYx0vuNxy +-FZe3xwp0yELYOvpozsgSPIpfdgBbpJQv0PoYPxuEVX97giF+U5ZDzdssfymp30PX +-7E2X5qgDfxiOo8tjm4G6iaHhdeDY2osNg5JpIqr5L/hqZlnuCvNRig1FBSPgpPn7 +-txFhxHu60jd7Y0Z2J27IR5C5+7sEfRW5BqmQvsEQ8p8aFRd9eCGxick6wodSp0yc +-yxDPhxeQ3J+uMpD4VF6Ic4xSaECf57kJc4E1stWcp4j4WxOINqhuv1FVqUZvuGYR +-lCkq+vnpCEZTe371LcEbBaNHwYC7W4GDUhRcVXuLRcGmMRMK2n36qadVzt5Bgn1T +-4W7xw1rkoLt45OW4sQY4DUse1PKP4lv2pWS6qvWlJUQcqu6nccroSFAb2T+qcoIV +-uloWNBkXOf5+f3O+yqWJDgNKBE8X8JgNeDK6Kobkta3eL2QJbF2hWdeNhh/6/4cf +-WMKABL4gYifBtsXRK4ylr8Ubb0vhq4nTnb0NCSINVlq1e84/MrcXOOND9meuZK4U +-j1ea8wp25H2twEpPwZ6nyghylInyzcz/XP6GIji3WKyw/jbOQeejhHJ9IQxbSd5A +-phV7v5F6iWBneidEZup6kLtc4koNzsFNBFc/b7YBEADKASZJp8uZbAvlcU7v1Vif +-qoi5wmD44S6hCyIrnulbdI+RKeqELTQ0ruvje6W7GwMcJRNWx836TiH7V5IxBgXC +-n4IN/nzqZpBAVC/8q9Ni688zOATZ040XOFyg9wAuaH/Cwo85CiH7W5+Eufusjs8W +-Ic0N5tvnB53UbrqBGRHAUUuaKnxecefgm+DEkTA0jCbHV35qPzKdm2g/bn1xanpe +-0nxTPLOB00IzPD45rWBeuBoP13LEOhqOsvCkysl0iFdqhrxwEO6nTZSBPY8MU1XH +-YVJHZpSBYF16QrNax4/IJQMDwdvzMWS64YBwqkK0XSrkg94yackNSMNduRz9kLTF +-LlWGeIFh/ff0Womd3crrhNsrjEUh0mLqvs0fXq+i0GiMVV8/7cIg06aYeck9A0cM +-IUnVyYiPfXzietAM6sP2UoDZlXAXTh3l7iN0UC79S+Bik30G5DGsk2O4nAT/EDJ0 +-TWm8s3N+A8tf669ZWy4npfR6+9y3tGAAlYzU8e+tZCrRfXKJgDTAcc+sC0qUS5Mc +-IFZ243QVvWYVDRhbe5ePOAsDhuaZdadKkBX4AsVScpsCQcQD/3J0CquPxVtgsFgl +-mJfHc9olvgCI5HScLpl6pQn9/5udtz5VBNShROmvKCz60PE6chLLNdWOdWrx+RaS +-u09g/5Nc6Wl+gmFeNa39ywARAQABwsFfBBgBCAAJBQJXP2+2AhsMAAoJENlhxZan +-IDRWSmQP/17dBjiQkLy0haS5NQJrzDFCMlqbDrM9IGjuzy8oS4IVgowCERYjA0yK +-Q8WAxV+yUVelvSqghWBZwWX6yHWRgqw8RQT5/8j1D96IvM1k+fPbC5fBja3cptPB +-+fuW7YIWZIPvhDRntfFMnhEKvIjmwd7DUJn4mU9DNzSQSPadpSUsFkgX2IVi5MUv +-d93DIUeU2IcrpAd3VDDGY3gUW9EOIUpgMSeAIoojnsdZS8TeHbEznviZmOFHAQ3H +-UrxQUIjYbkdEUKLTz5RPejFKSkdxVtXAvqExOMtrnT9PkX2Dw5nP2O3escfPvZaN +-oDIKTlUwiublA80kQyaCEbBkKOqU/YzvbqoSBhapo8yp3CU93pWWIF9YPHofprD/ +-krml5UES2eVhqYEJ7tVbwZNaszXX2j9I3uaZe1tlc/sT5lZ/sJ0kIVJ84VikTmz4 +-LEqYHwRFV+62p3BeCG33g/9wCeN9QkxWHWeUSAtT/r7tjW+mQdLON41w4Q7zwtYh +-SmxjGyo2PP0vpR79oYQ8CDPreyTxWFJuOsqu8NbGhlj/B3TEzl3+0XQQlAfejerN +-9olT+KlOjssKzrvFOLtkGL9E+0n7qvCcp0yjw5d3DdCrCnhHtsGCJyMpRJVkNdpR +-yAEk17Sbt8g36TSVyc3LzJA+b6/cPamySsetyO6jSkApaLbAOl99xsFNBFrxh8QB +-EACmRH99FIPaqrH29i2N8nuTJZ/CJ/05zxwQx2v+7lkCCJOMXogsPEzbQM/LogiD +-Al3cIyRtIJ2zFxhoKpkFglGztQ0aJHJM6Xh6674Wf7xVQSQ5ImSC4jPv5Y1mZxqI +-+NRPsW0pI96hSTEnl8y7OgFFADrth6fQXq8j5qF25pZ36sWIqhIrQgwFBpfrGtPR +-ZNk0G7O6UdjGY2T7u79en9uwLNEqFfw/by+G8C5Uhd/wSlLBoEVkpJXqQkHcnQ+C +-XiUPmXEiyI84XhePhaIem10usnSXKnpTTbTlGMcHYIsQrJ8cHTzTfe4qnaBiXXEN +-6vVIADAEw+mh5IrtSkbn9EQ9WJ0PinMMRQk+mg9qIretgcz0Yk+2N4p/wipWwGpd +-XtTwqClb1vyZaigMPfW2rSOJbeUWcEd3tzEDYmEVLOuKOrY709vvdfXUe98gMLAQ +-s1SbiBdms+WZGjhqsFOFSgNBogAfBwA5LPtOnZabrwAAT0atPI0JPhtjjt32ApCD +-JBS4UvgAUE17uQ3XsZ8cMXIyg2jHhgcR1hdwvGS2X8lZM3BbNi+3gyuRKHRTeWov +-ZfMUsVIz6XONVbhJW0UPBepWD3FSMxwNRBYYhWh9eWGahZ5UQiNKh5iixh6wXh9q +-/evDQq9X5KK8KhBhQwqP/2s3ILRTr4Ca5Y6i1XsPBujyNQARAQABzSRKdWFuIEEu +-IFN1YXJleiA8amFzdWFyZXpAaWdhbGlhLmNvbT7CwZQEEwEKAD4WIQSlzJ/sk/L4 +-N8sESRIzaQm2sl+t+gUCWvGHxAIbAQUJA8JnAAULCQgHAwUVCgkICwUWAgMBAAIe +-AQIXgAAKCRAzaQm2sl+t+uZdEACNFUTBYd/79GtwFXWNFf/GvlHcDKMf7nL5E1th +-jbklyPl/bt0hmGJpIenuLg6MoIeWRZ3LdXCm0xRYEfddygWWSSJl0R5etzqKAaqS +-ss0j1dkrPLcSr2Zr74VS4TwwCdnNDpvlNAJokWtvyorUTspv7Q4mG7rVELK6Pa2D +-/TkGqaxnMULmP9sRzhjkKZmBAEcDBwynMJh0gTRkopSXOriP+y7WBjHcZj2mvo71 +-tD/bPYwcODMvG+aIb4GpFzoMgmeWFiVzO6TPAGjl4pJh3/33ieONIDilgRHOYuTD +-BYax9zWLfKT7wTJ3x0CvenREFl7uSnNW43Aq6pyarRvqp99QosLvUru67y+dscHn +-sclulU/BY8sAYn3IxW3lIXdVwovJ2XL0EjEVDTg/c57+HnWwP/DRKnlLx03jJsgm +-5VYnqqBiKrfKvFi3AsNXbjKiC2h85oLjwbX/b1GaaaGdCmW5+bParmvGh3XlDUiY +-5A+QBfnhYmOs3NHW96i1uAWFWXwcVQT7WEci2+zhWCoxBrrMbKqyYf/jRSHeplvr +-i3wQqwmy91cv4RJpNzLoIEfPZ3Lq22V/FEcB5suH7QylCoXFCKK2mqPIl50Cevro +-u687+FvcE/yLPtE/PkXnuqhYvmh3X4TJa5CPOYjgj/JjzISaw7vQO3pkquDbsq9L +-n16Vu80rSnVhbiBBLiBTdWFyZXogUm9tZXJvIDxqYXN1YXJlekBpZ2FsaWEuY29t +-PsLBlAQTAQoAPhYhBKXMn+yT8vg3ywRJEjNpCbayX636BQJa8YgSAhsBBQkDwmcA +-BQsJCAcDBRUKCQgLBRYCAwEAAh4BAheAAAoJEDNpCbayX636ilcQAIluwDOyuYbW +-pfXI6fAzhZsszGrgCwc7IQGi+BhJSkKzk5n+HxLEnHtGr9P4h+haSoY0NWImt+qP +-uX69w81unVoKPIPG/9UjlIl0Ws2CdisGm73LkXry7KJPi9KMUY0byCzIodVKrlVQ +-q3OVSvHm0hm8WDaQ1PSwv2+nZFBHvQTa9vaxAAN+m/EzlIfToACugwG+KtoJa9f9 +-YH0cLhemgoR5fio/ZET+WQER+sF++k9x8iwy6sCWy8aiPV1GWsyIiu/pam3SVeUJ +-etho+SEk8zbTspLbnIYv9DbzuC2YLwRVaVIleurntEbaCOZf5MQq/ZlZobtw460f +-FURcecCNRXFsK+NdOdVEUWnudKCYA8Z+Cp58D2FoaADA0Efg0SH8aafB64k9MTxI +-9lRh+uX0kwuuWI2+TJR5tBH9JEms+VCkQDTQIAGoTY4/1Co2OXTtmynQUitO9N+2 +-6pfaggum37kcZP5pLNFSdSFpDOLgmjKQvWlfJdd55m83sIVtJts5Z7MK2eGzFs6F +-SPgmvMGRi3H96O8b2wlW3bxtQIRICl3QtArCpIC9mSyISaKie9lQXtw3nez2/Jx6 +-OW6a4xKZMiONOTui/3nUz5Y8uI8EkFKE3DI95o/VIetB1uIbzhLEQvGJbo5kIyaG +-5TXd1VMblCh5U4GITbjf2SOCYMFPnjeazsFNBFrxiL0BEAC5cNzPOVeacLCNekXD +-qGnpkn4EHz3ug5vb3Z3eNG+3Yolgq+nNpephnaqwc+iTJpNm8ZfV2sWNVDuQ77Fz +-h7Iz5AJg1xInj7zu7Hq+8cKFsC8IwSYTyRSO8QZNirBkcUqt1snUVKcu4jBplJ2I +-0m2JL1gnVRh0udsDoaVo/RTS36gJgVf65T0nW2ndMXRES7F9/deFAnh/Omcr1un+ +-Tw68/fAqLtqD2CRKzM22Xpgh2duqpZrPku5xuyw/oAvWyAVkjH4E5YL4+q0e5LmL +-2h4W1/VYu4zekGuFeoDrTMYFWoclIiF0HH8B9UyBhQPC8PqQmhmG7dKQSdsXmwux +-zLkSh0tCsALSh0hC6xp+RodAMRTTBT+VqoRv0hErIbwBcsdLLJIXItWPFPD9sN9k +-+ptbdsuc8MllMQPFUjo6Kn4BGbfpNhX/QoVe+ngxIvfYO6n/bBqMhotfINMmLGLr +-2g9TAfsD7dLdc1j8MjmyRm8G6K7GRmoPKa7kahDWttM6Z/oykYU+cMDG/BwoW+3/ +-JzOuJugVkVkW6S6DwhtsE2rGVGqKw2WLnMJekMm6R5AohwD/YTliaTYWfqdjWRfv +-uEnxXbYufnNx7DfI06PDKWN0x3JJxobkj8mvZSxpWMsqDA+OMiV4pwOVxTcNS5ZJ +-SkUf2s7aWyJKio0rXtL26A8OqwARAQABwsF8BBgBCgAmFiEEpcyf7JPy+DfLBEkS +-M2kJtrJfrfoFAlrxiL0CGwwFCQPCZwAACgkQM2kJtrJfrfrAEw//ajSK0gKdw6EK +-eampgEkR2LmFsJOfZj6T1pEJE9UcFdnmckuHEK1fueV6dADaNsPoAI/OUGVFVe7n +-MThB3cNgVPjH8WDrWvvdW5oRF2yi3eo80WFkO9ZUCijiSWsRBmjie33xn6YMZTqr +-ef87VfprB+RWPrxP8T9GmdmgUlFIuvdfJ60w9yJ2MOkeG2EQ6ozI2oh88cVNM4b/ +-bE1C9rIu49+LFWtqBpgJg05OP16gm47G1LdqY8+ZMPOMze3S+kIGdqbzmFzFkzoq +-XjFaRg3XJPYi0W9XOTBOpNQ6lEL4nE7A6aTfHnUarxlEg0HW4JYjhIEf3Tyq/KR2 +-GwYU3n2bqV0NTQX5mK0WZYcuN8QLKpPFPabcQCEUbDPV1g45lW/aya8jmYwBR69m +-M9UsChI8tElLLYdR+T7Uterdsx1forz6fEzbOg85i/T3vFvOU/8qyj79eINBgwrL +-OzjrTXCOkQEPxk1ySqAL62FsgI3EnKNPsbFX4PUM/ezaqcZoH7em5sCCg6hKyabQ +-3UrYObbYMJTo56Ngj5qsK5Dw8rLpMnBUZroWXxGgHgptkjJrALv7BEnfW+mGNAul +-YdMOuA8zwQTITbbTunDIswVBOW1oVfsh++w2JR3YK4o4RIgam/fTKxoOckkovq1f +-1icBziBkvqkLuDv1Q5OpFeS6IB9z8bfOwU0EWvGI0gEQAMXXFjSr7eHBgsyvaPvf +-YHsELdhgCyrU1QZIxvX5tUqZArM+MyFjnzBUVW2MJcUDs0jk2YGI8o1PUYKfqVNA +-vOrP1fNFUQOoehJIAqmxe+/XTsyDMZGHQju1rOay0sbQgAEMEq7EOJlICbk2QI7c +-qouboN6l3mrqsHvxT1JzcSAUafrPiFh7iwCcsW2oQfz5VrQFStta4uRVIPxCATiY +-tH3DbRWSlbOGkerQT75wDXmCK0hh1FOQx5BP82+/ExtQusXZZ+HfYr+SuIsV1ODA +-gzJDO3Yhk9BJpzkQYvEQhW5eN1wBatrZtbU/IdI/CyZ3+Cn0H1GJjkaIZND9nzVU +-ycSGSYHLB5nCl5WeueRXD+aSVc3af8VpFo7Zf3XQmPOZmwL1ssG1jEJX7f5p83TK +-Ue9zOphpfFcQShXiS+h+BbJI4SHWgsI72rtDgLjwNZgjlS/ak27MPpekTy5yWExB +-34n2xQlpN9ar0VTeD98FAevOAtg7O0M1aAnKC3QIzG3/V0FYTz/C7kddeERzKjLO +-KirjpCCY2bnkRZHZvh5wtIKcP4lHDPRf0Lz8wHVFWvlZ4kXEJt27ZpgQgz6+kkK6 +-w1jJfT8dd9FIATjpQQUQCk+gxvmq58yQtd+co4aaonQ+PYPZwXVYj3LfQT4wtlX1 +-gPrHa97uZgWMZmLCckMgrgfHABEBAAHCw7IEGAEKACYWIQSlzJ/sk/L4N8sESRIz +-aQm2sl+t+gUCWvGI0gIbAgUJA8JnAAJACRAzaQm2sl+t+sF0IAQZAQoAHRYhBEfW +-GIdIHnjCWXzN4atmWqnuJz5zBQJa8YjSAAoJEKtmWqnuJz5ztEAQALULepX5li1Y +-fWmMgeADU5r3wiLA5hjUcpmqPi/xSI97V2raHfVIa6C5kFhgihG06TLeOHEbLYFL +-oWbqWJiGZMPFciWVxc3esLZC5nYRLUn4Qbw5CvUZA8a5tLgwrI5yv8r4yQ9eTZna +-Rbb+heSZvVPWgN61LrdN3kkTM9AYtaVsoayEo6l5g/D1N4CZIOgj6Ta2fvPsHK3h +-DY236kdzbP1B7cwQA7aqeKU3nDu0vo7HcZsZL6MNJZcYqARqUEWtZdBctbZFt5Lb +-ibW6H2pjVDpp6Unqg5+YlpVb3kqpqbAwOiAzrrZGx6PtAscGo0RimHPfxPME2mFn +-oS3lQd9TXt6p60VmkmmeDq27HgJM16zlUdrw4qOSpqUnxWEfgrL2tEuXxTOBRfGV +-wsuH6+5pp3ZtZWCjhyuy4oEUdznJIYlZlN97BwmPjJoPKapex9Hc8h2aAjRUrvp9 +-F5pg2FZQr4EwBsXMgB8y7m+urLJlg0LqfQySCGHIqVJZmgQ7HqKh/VwGBGxj3KGi +-JdaWS65C7As1XNEby/IQa/q8+4Q8TS30QAQZLm+6Umw/fAEZARv35tRQ5k1Gz8Vc +-qlVsXqIeVsv4Z5VfEbXutRazzPgLQ0is+jU2/877QerZN0KpdO8pUvWH05+THvj0 +-7sANxbsVoLx7tko9gQ3ozWIXjZK+HXp/ygMP/RpX1+cpu1LiKYmQ+9eRQ7BQA6Zm +-kO5IZlqYVIig7wbcsAMfj9jlFSUatiqzIPCpoW0BLChCJ/AlEK3HkIBYquUXL8QK +-Kj44zBJpqyMATbCMA15RVRMdWV581PfbsD2EKWSoOajh6qSn9FHvOHorBhftaFc9 +-10/8xP8YVFWm8FHZ8NEMqeLEzbaQX+FoiCnTNvRrtXwkMJwl1KQoJ6jvkvIp1kMi +-OregYoOeaYqrNOgyAC0iv5GTw/RLVAtymoi6F9IC44gmXNMokyjbSL1RRtPTifdM +-CnY6M6cXWjXwR2BQ55Ia6VKkJaoEZXnAuz+oQ9WeMiHG/KDQNkquGXaZfrSpU3wA +-7PYzybPyLhInWg3qS535V6X6nsvHXTgw8cDx2TU3RsJhGOaflD0qrk6692tdtXee +-SgC7crVXp6zldcvMwbB+2YQBSz3YpXySYsY3F8gSR20q+gp85e6Q9ZDlJkupCMI7 +-njD+NmsvHPJ++SrkHD97C59o7WQ6j34GuHqaJ+hqsWez3vp4h5Y5q3/1hJYlfCi3 +-wwFayKFd8atDCbwwg5L8+x2nCW1uK5wXNicgmSBwl5fD6pdDLoYju+p/ry+/8RzA +-+dnFMRFOL8D0xPVySUcnJCdrJzxWwmaaMevDd4A4kb5x3E3gKwRA7VQeKOrR3qSF +-ObFF0Zde+tGDvy7pxsFNBFMTUVoBEAC+tHKpu3d8CREOlMhB1L5DXuwhRh8Y7RK0 +-yIyih79YWHLshi2o7O9q4g6EAEYXJITqaLSl70FIR6E0XkUxqRWbdbkGHp9nlTcS +-0YyIAGx8EjJnIUmWxJWovUwGj6uuZ/DMih55wO+jeKEDRrDCVD/PFvBUBvIPjpbM +-hpU/7N0lkL4Uf7+X/T3RJlsGceLBJhLw/J5R01CWR9L5wM39y/k7oibJdoj7oBAp +-gBkZ1w5qyljxYChugc74LHATdkjLvlcm0g4pdcGYIXdRagcnd+cvM8VAb2W1OCBj +-7hzAPTGEok8eA4zIYTbyQvpVHw5AtrniepIMQ5U1hPf3t+u5BabEc7uVfXXcsrTa +-TMfJ60gwXc/qVcLIOa/9WOM3fl70NDoVN90APiMZoVNx7vU0+CY2diHX9IRZo6cL +-xDZLzWaeojb/9GtO15qw6vHpfP00JvnK55pWGAwIZT2edXGu9DnZnPUuFbCU0H72 +-DE6t8j67A1xAdaal1YzTS7P6JDwF0QsIzeVe6nJJNeowBYO38wMbJv3n6GaMPPkq +-OA6ewjnVeVIAST5wM+nLx7G/CcT2vhwsG8B9FE3irxhPmgk2EXba2EGgnXWsJeYw +-tvvHXJmOpvOQ6AIiTHpqDOkZOCFbu3miiIFIRsZy64ntfrlUKjK2copsmD93El9x +-nmkoNkAvuQARAQABzSJFcmljIEVuZ2VzdHJvbSA8ZXJpY0Blbmdlc3Ryb20udWs+ +-wsGUBBMBCAA+AhsDBQsJCAcDBRUKCQgLBRYCAwEAAh4BAheAFiEEzDHvKdMqZjeI +-lTDySB0OnZZOVZMFAlhhPxMFCQrxiDkACgkQSB0OnZZOVZM/IxAAin6JtWctMsG8 +-Fhy6OiW6/TW+oqZWJInElJhEyoXyQZM0CjlOQ+GifAXULphW49KfcDZChC8Rlddo +-yrStT0ZD6JAnxOjhlcofZ3KjgrZLIFvleDI0bp6rT2XWAdpbbHa3FzYTv/cWZIyr +-Lyi1hLI/Daf/OBjlHlT77OyzamORaP/F48g26eoNUTxyTIUb7XPKCJ/OeY79yOAg +-oR0qcKrtlSr9Eq2B52sckmiuB13TrB+qyEmGQOW5NuiIfYsOE6deZi3KoQc4/rzG +-Ur6FqDUbrRe2JnfZA5sgEz7ioRtSIHfmBjNO2C422e5hiR6mAfwI8jXDGpOab+PH +-2JfW7fDIMGgkZ2NCM3XZXXpUTJyG/Oeek3VIfGoccjuG/o29FPFoPVGhuh63tSVv +-WLuXSB/K2ndc5A7Bb4O1CoyJk75cS9Akohlr8jBGrG73PXhwv6LpU9D93eD7Syc3 +-QapuCXjnH6b9ykw5zPLTLCWgD7hb0pgatQS/YTy1dw+pUfnHfb+PeRkDbUp7/H7Q +-eBXnvXlFo5Vc4iuo+AdUI8/cC/YWB4tYtDPG+VF+glguFNyu/aD3DmIZ/3cKHxVY +-8Y7zcmp78PMBrHvvyMK7eNNKHWbr6D/Lr/rB4kQw9YwrsMGx45Nczi0++AceuSli +-+yNAPtCdTkNd+PjGySO6+C4OuGgFFC3NIUVyaWMgRW5nZXN0csO2bSA8MWFjZUBr +-ZXliYXNlLmlvPsLBfQQTAQgAJwUCVWc5DgIbAwUJFR/aAAULCQgHAgYVCAkKCwIE +-FgIDAQIeAQIXgAAKCRBIHQ6dlk5Vk7tMD/9XJvdrCakDw6clBDVeiiM4s6rEh0yM +-55M8L7LGuS3ZJk1nfLggm1FMAkp1SK6PSWOHGaNno8MBD7bVnfAXN1LZ8lBIxcQ5 +-yk0txJf062uuDvYZIBzfA3/sI2xo3D5psQziBAZg3d0ejQrlKziK4482BNvXi8MB +-2Jr8yNUWrX83Nq/bT4QFCWOfeloLll4Mfhh1C02H9hUJOvAZQ9l1kVpUYpXtGC0J +-/38Z7+ND/DZrduVNLQL+OeUclh+5TQ+8ZsqufrtLuOeLOQdt5WsSv6ykgtK0E28c +-W4X24VBrpVC0EKBNid7hkYyHJ34trnYCIhKOnphLXNf/yBJAjQdZi9UTleagECfG +-dnhVPRKQUpV9lpstPKe0rFb4xyl8SPZh60NlQz4zNFJEYG17gYPaxR3yeEY9PRao +-Nl1LI2YKAgcf9vVgNcKc3YZEuGjTwOwL0/KzFJRkjuIHrxcYQFIfJoJ0/9c4zFf8 +-RvIZ+fDvt3iRFM194VTlpwktLrUJi/iL9NViaxVYf9yfjj0ugdc0lTMpzrIoQ3Jm +-OdWkeqeILk38UIQ0hh9yn7WJoyIE42m59gnf9ARHfoZNhJRWJKSyZgvEFPzaOhQA +-GnPQJj1puQgX9P+dRWTHq6zBe2cCs/zWOV5wdUIiGhznofSLi2Zk6jaa+634IF1D +-Q0RVgrl3qHquzc0qRXJpYyBFbmdlc3Ryw7ZtIDxlcmljLmVuZ2VzdHJvbUBnbWFp +-bC5jb20+wsF/BBMBAgApAhsDBwsJCAcDAgEGFQgCCQoLBBYCAwECHgECF4AFAlVn +-KF8FCRUf2gAACgkQSB0OnZZOVZMBhg/8D3zSkcs+K4Fok7ZcHIOLjCAJX/IccMaj +-ppKpiEIl8rxzM0Qk6AG+emFm0e1Nyu9k+3vFRenhS4LjLdJ/9rQDW2HPKljpC7/2 +-Tg1Ucx7xEudChgW5+gmglSlezV0cY+hQw3rgXaBM0JTI11CNNGtx/PaL4ZCHkTkN +-FsYynAjFLZbEofTeFCMxkJTBvq/58JAiPrZOJrF/4yfGmD99ZnjAmHSGY4kviCRe +-vcYTEivQ6eu9mRGDvC2X3vFDc/E7+tq5Y1vSxEeCcqY1/M8bkXUG8K7d7F2/Nv0L +-ljHAWegaxu1wFQVHnFeLFFsmuDRbdcUd0p9huWALNrAgRo5t3ZQuZrvsZ2m0IXst +-1bjCIEC96HIjigffEYsVZEu/J9ctyjjXtz2Kb2S8heykExIZWrwbEZbrPP9bqxcc +-RD7kTGbRC9lkFfMGEPrLMWeKLAe0Iry9pi0O+g/QusXFhD5KPhNrfnzwUR/8I54E +-HY6eKo2tBT+o58fsHo/zHuf87zG3TXBMd8/m1u+Z9HJBARmlOfG2QQdqhok+dv/a +-X+vzxzJFB+41b3kyVjDOcP4hswTakRmA5VSKVvSoCgKuxlVbazIfVpX0DrJWVgyw +-yHVdmYpGjkZbncutWCdjQ87OQDVuP8nexHmHkkvrw7KLjVdygNM/XJLmnVJ0VUdS +-59OqTnycZjTNI0VyaWMgRW5nZXN0csO2bSA8ZXJpY0Blbmdlc3Ryb20uY2g+wsGZ +-BBMBCABDAhsDBwsJCAcDAgEGFQgCCQoLBBYCAwECHgECF4ACGQEWIQTMMe8p0ypm +-N4iVMPJIHQ6dlk5VkwUCWGE/EwUJCvGIOQAKCRBIHQ6dlk5Vk4J1EACIFOuNafK0 +-++4pca5nIIyoQ3w5963wJAaJW0W4BACPVBh3ZTmtE9KO6KI99j1O8eJnCOxo6ugf +-DK2Hc0oD6Vu6r8kLMrw+VTMZGcxKOEqOde+XdmahIXzcdpPd9A3kFSkNkJYZwzGi +-ZkJ5uyW83ITh7s01q2ztyCsd3GmDMy9nMva4r9GYnY+WUSRTMQSlo9B3N9QOFdw3 +-MZNTvvqN+jV6sUHUpp0/VnF9NQd8S1+1rgttLZeM6gDOj0OahT9qzfmwnMkYquA5 +-/RV/xDY8cJuI9sag6FScR7uNHnBMQlPH6QsF46eVumwFoHEXQ78teQfp4iyQG2mB +-09QedXOoEEki3xEqepQK/uyxaPewHlygjbhs61r9dG+me4TL4BP1wMsD8Gabg0MO +-fHHNCv88XEriSu0h/zw2868SXmJlTU7P0fEs9RVSVqHkTNrK1gDazblyO0e2/NtA +-iM0lgtMC+p2OCn+oedUaJhspO1Ldmu9+ytwyRUnB2iLcuqeWjflzQfhQte9Zk04D +-61qtQS3NjLXBTZ4tii/9xor36C4GrpIxtcW9n+4ASdhgXN/uNFQqLOgF5S70BQ+b +-gpgEzX+4LDLpu71AeK4N0zQfkitrsdo7erK1uc63434HXN06VlTlAtLCU7yom2cO +-kWTZckdvrv1XIs68/dTdQ9l10BG9jU8gZ8bBTQRSLgypARAAzqlmLFQ9SklZ//k0 +-FDlSkzTpjKx7rdJ1oVvv5XnS04JQNMvxy2/wGAq5x7/0b6fnZeCMo7qOzlxZATvy +-4qsb0PsSIadgq+/lDJQaTVBB1mtO0IFN/CUX/T/4oJK0UBt9G0kcVaqvIHyVUR8G +-/2RGsJzudzQZ4YvNzUg7HxVuLd4zDng9O+IRg4g0FYuy8kn9m9w6ODubCZJGyhhT +-iUWytne1VpHUQ07lc8buEynGyUPOfYpDjjRUzA3ki0n7fkze3r+xvYhh7fyeOukn +-QVXJTT8/bs46sSljLWOUwKdZM9J9j0E8iWrZs/gyegDB8bJNKiTiieBRtRD5axyN +-/U7akEaLnn9DR2T3ftJMMuE2dvYWZCK5Bt2zsB8R1p339ZDM+e9M3DHi2pGfRMZq +-SWEH2iXiv4cJKh0VP3TQEIkkZKU1iOBBRx0PWWBOBNLvgasGzWrEoHkZT6Atzbss +-R8DpGBX8mTzbFGZYCfIwffruJBlGhZ09eABFPOcpr8ecAwFVF1x5/bDRskpdByq+ +-vkUt0PRif1/UTU5A8YGfqj11eA3P6y181kwHM61JHqimlMexdF+e5xuuPNL9Wu6N +-duviXLULYV/vzodjaGy94TY+qc8zmQaHmD4NeFvI+8GwZ47SmuEMWTjchXymHL7V +-QghUl9tesyxm7ILiVUlOnTYo8tkAEQEAAc0jQ2FybCBXb3J0aCA8Y2FybC5kLndv +-cnRoQGludGVsLmNvbT7CwXcEEwEIACEFAlIuDd8CGwMFCwkIBwMFFQoJCAsFFgID +-AQACHgECF4AACgkQYAIzup5U3GFZUQ//R1OtLBkQhaXNgGKJIf6rtJ6kJvDOhZ4M +-3zxa8KYfG8kZBtPQcqeuSCHowwRW1VyZE1g1iweQAb9TELhT2GxAbY5pHBtST7MZ +-ec7Iz7PFXuz0PFdouTJk8f92sX3+mt3kHwA7HoTsrKSr65w8bNayRvym6q4fbepp +-nIPmKO+CnawT34rP3E3zB745Dq6vzjCBlu7jIYuSIyNdVuo3ttgsubIK7qzZk9wd +-jTslm2+rIqhyTX/7TQXus2NBh2fEvL9hwaAg4BYnEZG6qCJjETqpqq5+6RLNNeIC +-uqFLgzABHPp0ChtDMlOPh27OtbfLaU6wZmbHwbxooHCBfyzvGj6y3T6ox9JUs6Jh +-JSUfWwG6PtvQKqxusHF3qYucR203Q9FXMiX2IuXnG6bbZspV7fCfYcL38by3REYH +-N37DZr5PLueVLWZQhL0s0kzZ8JW1DSsmhtTQ9xdGDKnLxKYBFyZMxtqiCwC+aJAX +-vNySp11WQ+hpDPv311Zvdm+PS2V8aXk8UbHFSRhCWHOlwVJ3AxYqADFA8SNXiBho +-Aeq8dwJrjKEK6VSyGk/emcUToKOiaXEsJM+3sGuPLo/fruFTEzTLpVvsYqwQVguZ +-jIX15PGhZTXC9omZa3nWh4OrByFrAzxBpX3w0ojw5atAnkI5gKM4bT/nElv8T48z +-cgo1S9dwrQvNH0NhcmwgV29ydGggPGNhcmxAdGhld29ydGhzLm9yZz7CwXcEEwEI +-ACEFAlIuDdMCGwMFCwkIBwMFFQoJCAsFFgIDAQACHgECF4AACgkQYAIzup5U3GFo +-1hAAx6GLpdIaZKcsDjEGRZCbUwrzSd7azxVIJb84ney19nCurszR56DKbxwJx96T +-hefZDVV+b8UQ2LZEe568NOL+2qttMuPFpt2kg+/euo4V1VKHjtW1+AoIyKaF6CgQ +-tEMn6BJJ03YNgw8cX3j0ClbexysoF8sUseddzVHJkSYaBNtOaRf/ZT3gDgpjnQv1 +-nZgG62awJto5oIwQfgMgLfj33E0VqE5pszQMj+4u46gd3s2lgE1QUJTjN6XA5qnS +-2RxVQpuR0tLHP7AJ9dYpc3yHWDcGOImzDYQXpdDqw6cXWwhoIFW8ya0BXREiO5j9 +-J9T1xO4VDHzD6BzwV+8WCR0qIeXmje3McpY4zJsNJenX5Y+HZ2q35YZ3aWrOdp0r +-N2Jrw0FFi2iUyYAp0VSx8ZwTcMeKPsiyvkbAKSgEaK3eOVqAID3QugmyCW1XlmiY +-2sA8gZU62eaj/S9kGw1A8oBz+0QaJ6ASv84ft/ppi8CW+WCBjq77I76g4aIkV+cz +-1gsOh4P2xsiDmgu7TPgYh09VifZ7m1s2B+hrbAP6U9ZndDl+Cgrcu0k0jsL/ftSj +-i5RmDKHARZv7FfUzkMR+H/Ob2Y/aAZ2RbmfmcZHcBoIwjAoE3H4oFfD50dKlhUM6 +-5SN7CbJQD843rOrLBAShv8Rct20GreGi/jCvoR8ZncIg1FvNHkNhcmwgV29ydGgg +-PGN3b3J0aEBjd29ydGgub3JnPsLBegQTAQgAJAIbAwULCQgHAwUVCgkICwUWAgMB +-AAIeAQIXgAUCUi4SIgIZAQAKCRBgAjO6nlTcYYFND/4xGMEXTW9D41Aub59DhYeR +-/1C3ZcDJlqQ7X/u1HEaRNSJa0ITRJfDGKQL5mauOOM/zwr3iFQCkOY11xLIJGG4h +-lokOvSf4oI7ria+h75ViKhffgUppew6RZJnay/IU/288AO7rdzAl/GeQutp/30gw +-FAPOYMLHAcirxsw7Sfiwpy/hA5wZCHb8Oh46vXSkcuI/V26gFCMeNZj2KxiMokiy +-RIu/0bUvmMoMxFmyRK56H3tEsfNzCgYzLSVzPKWyL7zyCKBjz3CpvT/DvOaX8xg/ +-ZoqIeof1feGL3bHspQJ5Dt5EIMqokbubF50TPvPhMYzHTSlpMqXiwg4AAfB0mX3T +-0H1Ht15BQkH+CIGA2YLo2clrwGxJMqGlGHyc1z3lWSqyjDLWizhq7Gv1AHCUYMSQ +-EPuct400MBn4QcvzzZQYprk9fBVDodu5YuE88ZtH0J4sVObE6J8CA9zlcYcj+Bnt +-KsRuW1TClT9GzECrkJJvuQLd8LMVor5eXGFGbmJfTU6QS5UJl+LjVKzmTaDxoPkR +-ke7aLFZ54CAlPdoTJxmz35FZ4wPcfSoUZzZN6E8zSZDtSPgm9plwjCTVuG5LzW8B +-2tBXp7x1tT3/PRBbwAC1J56CirGQklfw3wPdF2mKwgylgmnOFSO2Ew4jzt/eruWm +-/Ka2Gp7JoBaBLim3pxdFcc0eQ2FybCBXb3J0aCA8Y3dvcnRoQGRlYmlhbi5vcmc+ +-wsF3BBMBCAAhBQJSLg2wAhsDBQsJCAcDBRUKCQgLBRYCAwEAAh4BAheAAAoJEGAC +-M7qeVNxh8IcP/A+6sDFbwune8GA6lb3d4CIpWzwNJVSYmG9nwiN8x42+vpqTRVGe +-PfxzGuk2bj+/+8+ehhRSIP4sIxGLMzvW+QjqGPYitTEcH7hLczgcEanlSuW06X/Z +-fBtbgoBeBVA1Yz04w98w1j5yUJULRU7juE3hHFVmRgB5S80ElehVY6aytDZhndbs +-y5jV6jUbq01QdygEutGyIXp35vO+fcoQmKGv/t6t3cs6Zm9hQOBAEZ/M+bF3R4Iw +-CoFQ3o94MiNoC6zazOeoThbCNvzbHI4R+NvOn6fY4r9OImn21dbCcMDDxnaqR4/w +-uuILqTPOZhzs4M3guXPWj4eCP9t6kQWdzozN62KMaVNa9Jmy/CiM8AM4MNPDhre8 +-ESNLm3VKsL7C8JD7kqXOUqMrdY2GmCb6MARQqFXbYOlJGYBRBk+Q1YdUl6CQ4mWo +-bmvjB6en0PWbLTbhuVHy2X7PuIB5QLQ7/Vfp4dBEJTksZAia5/1NfaaGQVmF4VdL +-6+X8x6To7/wzwnW5652/Vi/JL65hJgzSCHguG0PPRUUkpR9uEV6+WMlslCOYsUws +-Tkv/Pitg6+dupW3sfWqqJ6teKtunICK6HRJ8tTVwEbn8cLiGBFepYLjf3Wvkgz2T +-TtKCFcKu681pMhtd+7n5N/fnwMkNl+Gd6zqhcZ8nkgTlcjzaM3Njdg9D0f8AAFuE +-/wAAW38BEAABAQAAAAAAAAAAAAAAAP/Y/+AAEEpGSUYAAQEBAEgASAAA/+EC1EV4 +-aWYAAE1NACoAAAAIAAsBDwACAAAABgAAAJIBEAACAAAADgAAAJgBEgADAAAAAQAB +-AAABGgAFAAAAAQAAAKYBGwAFAAAAAQAAAK4BKAADAAAAAQACAAABMQACAAAACwAA +-ALYBMgACAAAAFAAAAMIBOwACAAAADQAAANaCmAACAAAAFQAAAOSHaQAEAAAAAQAA +-APoAAAAAQ2Fub24AQ2Fub24gRU9TIDYwRAAAAABIAAAAAQAAAEgAAAABR0lNUCAy +-LjguNgAAMjAxMzowOTowOSAxMToxODo1NQBSeWFuIFdhcm5pY2sAAE9wYWNpdHkg +-SW5jb3Jwb3JhdGVkAAAAHYKaAAUAAAABAAACXIKdAAUAAAABAAACZIgiAAMAAAAB +-AAEAAIgnAAMAAAABAGQAAJAAAAcAAAAEMDIzMJADAAIAAAAUAAACbJAEAAIAAAAU +-AAACgJEBAAcAAAAEAQIDAJIBAAoAAAABAAAClJICAAUAAAABAAACnJIEAAoAAAAB +-AAACpJIFAAUAAAABAAACrJIHAAMAAAABAAUAAJIJAAMAAAABABAAAJIKAAUAAAAB +-AAACtJKQAAIAAAADMjMAAJKRAAIAAAADMjMAAJKSAAIAAAADMjMAAKAAAAcAAAAE +-MDEwMKABAAMAAAABAAEAAKACAAQAAAABAAAA8KADAAQAAAABAAABIKIOAAUAAAAB +-AAACvKIPAAUAAAABAAACxKIQAAMAAAABAAIAAKQBAAMAAAABAAAAAKQCAAMAAAAB +-AAEAAKQDAAMAAAABAAAAAKQGAAMAAAABAAAAAAAAAAAAAAABAAAAoAAAAAUAAAAB +-MjAxMjoxMToyOCAwMjo1NTowNAAyMDEyOjExOjI4IDAyOjU1OjA0AAAAADsAAAAI +-AAAAJQAAAAgAAAAAAAAAAQAADSMAAASlAAAAHwAAAAEAAXxjAAAAIgAFDUcAAABy +-/+EKFWh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8APD94cGFja2V0IGJlZ2lu +-PSfvu78nIGlkPSdXNU0wTXBDZWhpSHpyZVN6TlRjemtjOWQnPz4KPHg6eG1wbWV0 +-YSB4bWxuczp4PSdhZG9iZTpuczptZXRhLyc+CjxyZGY6UkRGIHhtbG5zOnJkZj0n +-aHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyc+Cgog +-PHJkZjpEZXNjcmlwdGlvbiB4bWxuczpleGlmPSdodHRwOi8vbnMuYWRvYmUuY29t +-L2V4aWYvMS4wLyc+CiAgPGV4aWY6TWFrZT5DYW5vbjwvZXhpZjpNYWtlPgogIDxl +-eGlmOk1vZGVsPkNhbm9uIEVPUyA2MEQ8L2V4aWY6TW9kZWw+CiAgPGV4aWY6T3Jp +-ZW50YXRpb24+VG9wLWxlZnQ8L2V4aWY6T3JpZW50YXRpb24+CiAgPGV4aWY6WFJl +-c29sdXRpb24+NzI8L2V4aWY6WFJlc29sdXRpb24+CiAgPGV4aWY6WVJlc29sdXRp +-b24+NzI8L2V4aWY6WVJlc29sdXRpb24+CiAgPGV4aWY6UmVzb2x1dGlvblVuaXQ+ +-SW5jaDwvZXhpZjpSZXNvbHV0aW9uVW5pdD4KICA8ZXhpZjpTb2Z0d2FyZT5BcGVy +-dHVyZSAzLjQuMzwvZXhpZjpTb2Z0d2FyZT4KICA8ZXhpZjpEYXRlVGltZT4yMDEy +-OjExOjI4IDAyOjU1OjA0PC9leGlmOkRhdGVUaW1lPgogIDxleGlmOkFydGlzdD5S +-eWFuIFdhcm5pY2s8L2V4aWY6QXJ0aXN0PgogIDxleGlmOkNvcHlyaWdodD5PcGFj +-aXR5IEluY29ycG9yYXRlZCAoUGhvdG9ncmFwaGVyKSAtIFtOb25lXSAoRWRpdG9y +-KTwvZXhpZjpDb3B5cmlnaHQ+CiAgPGV4aWY6RXhwb3N1cmVUaW1lPjEvMTYwIHNl +-Yy48L2V4aWY6RXhwb3N1cmVUaW1lPgogIDxleGlmOkZOdW1iZXI+Zi81LjA8L2V4 +-aWY6Rk51bWJlcj4KICA8ZXhpZjpFeHBvc3VyZVByb2dyYW0+TWFudWFsPC9leGlm +-OkV4cG9zdXJlUHJvZ3JhbT4KICA8ZXhpZjpJU09TcGVlZFJhdGluZ3M+CiAgIDxy +-ZGY6U2VxPgogICAgPHJkZjpsaT4xMDA8L3JkZjpsaT4KICAgPC9yZGY6U2VxPgog +-IDwvZXhpZjpJU09TcGVlZFJhdGluZ3M+CiAgPGV4aWY6RXhpZlZlcnNpb24+RXhp +-ZiBWZXJzaW9uIDIuMzwvZXhpZjpFeGlmVmVyc2lvbj4KICA8ZXhpZjpEYXRlVGlt +-ZU9yaWdpbmFsPjIwMTI6MTE6MjggMDI6NTU6MDQ8L2V4aWY6RGF0ZVRpbWVPcmln +-aW5hbD4KICA8ZXhpZjpEYXRlVGltZURpZ2l0aXplZD4yMDEyOjExOjI4IDAyOjU1 +-OjA0PC9leGlmOkRhdGVUaW1lRGlnaXRpemVkPgogIDxleGlmOkNvbXBvbmVudHND +-b25maWd1cmF0aW9uPgogICA8cmRmOlNlcT4KICAgIDxyZGY6bGk+WSBDYiBDciAt +-PC9yZGY6bGk+CiAgIDwvcmRmOlNlcT4KICA8L2V4aWY6Q29tcG9uZW50c0NvbmZp +-Z3VyYXRpb24+CiAgPGV4aWY6U2h1dHRlclNwZWVkVmFsdWU+Ny4zOCBFViAoMS8x +-NjUgc2VjLik8L2V4aWY6U2h1dHRlclNwZWVkVmFsdWU+CiAgPGV4aWY6QXBlcnR1 +-cmVWYWx1ZT40LjYyIEVWIChmLzUuMCk8L2V4aWY6QXBlcnR1cmVWYWx1ZT4KICA8 +-ZXhpZjpFeHBvc3VyZUJpYXNWYWx1ZT4wLjAwIEVWPC9leGlmOkV4cG9zdXJlQmlh +-c1ZhbHVlPgogIDxleGlmOk1heEFwZXJ0dXJlVmFsdWU+Mi44MyBFViAoZi8yLjcp +-PC9leGlmOk1heEFwZXJ0dXJlVmFsdWU+CiAgPGV4aWY6TWV0ZXJpbmdNb2RlPlBh +-dHRlcm48L2V4aWY6TWV0ZXJpbmdNb2RlPgogIDxleGlmOkZsYXNoIHJkZjpwYXJz +-ZVR5cGU9J1Jlc291cmNlJz4KICA8L2V4aWY6Rmxhc2g+CiAgPGV4aWY6Rm9jYWxM +-ZW5ndGg+MzEuMCBtbTwvZXhpZjpGb2NhbExlbmd0aD4KICA8ZXhpZjpTdWJzZWNU +-aW1lPjIzPC9leGlmOlN1YnNlY1RpbWU+CiAgPGV4aWY6U3ViU2VjVGltZU9yaWdp +-bmFsPjIzPC9leGlmOlN1YlNlY1RpbWVPcmlnaW5hbD4KICA8ZXhpZjpTdWJTZWNU +-aW1lRGlnaXRpemVkPjIzPC9leGlmOlN1YlNlY1RpbWVEaWdpdGl6ZWQ+CiAgPGV4 +-aWY6Rmxhc2hQaXhWZXJzaW9uPkZsYXNoUGl4IFZlcnNpb24gMS4wPC9leGlmOkZs +-YXNoUGl4VmVyc2lvbj4KICA8ZXhpZjpDb2xvclNwYWNlPnNSR0I8L2V4aWY6Q29s +-b3JTcGFjZT4KICA8ZXhpZjpQaXhlbFhEaW1lbnNpb24+ODAwPC9leGlmOlBpeGVs +-WERpbWVuc2lvbj4KICA8ZXhpZjpQaXhlbFlEaW1lbnNpb24+NTMzPC9leGlmOlBp +-eGVsWURpbWVuc2lvbj4KICA8ZXhpZjpGb2NhbFBsYW5lWFJlc29sdXRpb24+Mjg2 +-NC4wOTwvZXhpZjpGb2NhbFBsYW5lWFJlc29sdXRpb24+CiAgPGV4aWY6Rm9jYWxQ +-bGFuZVlSZXNvbHV0aW9uPjI5MDQuMjA8L2V4aWY6Rm9jYWxQbGFuZVlSZXNvbHV0 +-aW9uPgogIDxleGlmOkZvY2FsUGxhbmVSZXNvbHV0aW9uVW5pdD5JbmNoPC9leGlm +-OkZvY2FsUGxhbmVSZXNvbHV0aW9uVW5pdD4KICA8ZXhpZjpDdXN0b21SZW5kZXJl +-ZD5Ob3JtYWwgcHJvY2VzczwvZXhpZjpDdXN0b21SZW5kZXJlZD4KICA8ZXhpZjpF +-eHBvc3VyZU1vZGU+TWFudWFsIGV4cG9zdXJlPC9leGlmOkV4cG9zdXJlTW9kZT4K +-ICA8ZXhpZjpXaGl0ZUJhbGFuY2U+QXV0byB3aGl0ZSBiYWxhbmNlPC9leGlmOldo +-aXRlQmFsYW5jZT4KICA8ZXhpZjpTY2VuZUNhcHR1cmVUeXBlPlN0YW5kYXJkPC9l +-eGlmOlNjZW5lQ2FwdHVyZVR5cGU+CiA8L3JkZjpEZXNjcmlwdGlvbj4KCjwvcmRm +-OlJERj4KPC94OnhtcG1ldGE+Cjw/eHBhY2tldCBlbmQ9J3InPz4K/+IMWElDQ19Q +-Uk9GSUxFAAEBAAAMSExpbm8CEAAAbW50clJHQiBYWVogB84AAgAJAAYAMQAAYWNz +-cE1TRlQAAAAASUVDIHNSR0IAAAAAAAAAAAAAAAAAAPbWAAEAAAAA0y1IUCAgAAAA +-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAARY3By +-dAAAAVAAAAAzZGVzYwAAAYQAAABsd3RwdAAAAfAAAAAUYmtwdAAAAgQAAAAUclhZ +-WgAAAhgAAAAUZ1hZWgAAAiwAAAAUYlhZWgAAAkAAAAAUZG1uZAAAAlQAAABwZG1k +-ZAAAAsQAAACIdnVlZAAAA0wAAACGdmlldwAAA9QAAAAkbHVtaQAAA/gAAAAUbWVh +-cwAABAwAAAAkdGVjaAAABDAAAAAMclRSQwAABDwAAAgMZ1RSQwAABDwAAAgMYlRS +-QwAABDwAAAgMdGV4dAAAAABDb3B5cmlnaHQgKGMpIDE5OTggSGV3bGV0dC1QYWNr +-YXJkIENvbXBhbnkAAGRlc2MAAAAAAAAAEnNSR0IgSUVDNjE5NjYtMi4xAAAAAAAA +-AAAAAAASc1JHQiBJRUM2MTk2Ni0yLjEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA +-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAFhZWiAAAAAAAADzUQABAAAAARbMWFla +-IAAAAAAAAAAAAAAAAAAAAABYWVogAAAAAAAAb6IAADj1AAADkFhZWiAAAAAAAABi +-mQAAt4UAABjaWFlaIAAAAAAAACSgAAAPhAAAts9kZXNjAAAAAAAAABZJRUMgaHR0 +-cDovL3d3dy5pZWMuY2gAAAAAAAAAAAAAABZJRUMgaHR0cDovL3d3dy5pZWMuY2gA +-AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAZGVz +-YwAAAAAAAAAuSUVDIDYxOTY2LTIuMSBEZWZhdWx0IFJHQiBjb2xvdXIgc3BhY2Ug +-LSBzUkdCAAAAAAAAAAAAAAAuSUVDIDYxOTY2LTIuMSBEZWZhdWx0IFJHQiBjb2xv +-dXIgc3BhY2UgLSBzUkdCAAAAAAAAAAAAAAAAAAAAAAAAAAAAAGRlc2MAAAAAAAAA +-LFJlZmVyZW5jZSBWaWV3aW5nIENvbmRpdGlvbiBpbiBJRUM2MTk2Ni0yLjEAAAAA +-AAAAAAAAACxSZWZlcmVuY2UgVmlld2luZyBDb25kaXRpb24gaW4gSUVDNjE5NjYt +-Mi4xAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAB2aWV3AAAAAAATpP4AFF8uABDP +-FAAD7cwABBMLAANcngAAAAFYWVogAAAAAABMCVYAUAAAAFcf521lYXMAAAAAAAAA +-AQAAAAAAAAAAAAAAAAAAAAAAAAKPAAAAAnNpZyAAAAAAQ1JUIGN1cnYAAAAAAAAE +-AAAAAAUACgAPABQAGQAeACMAKAAtADIANwA7AEAARQBKAE8AVABZAF4AYwBoAG0A +-cgB3AHwAgQCGAIsAkACVAJoAnwCkAKkArgCyALcAvADBAMYAywDQANUA2wDgAOUA +-6wDwAPYA+wEBAQcBDQETARkBHwElASsBMgE4AT4BRQFMAVIBWQFgAWcBbgF1AXwB +-gwGLAZIBmgGhAakBsQG5AcEByQHRAdkB4QHpAfIB+gIDAgwCFAIdAiYCLwI4AkEC +-SwJUAl0CZwJxAnoChAKOApgCogKsArYCwQLLAtUC4ALrAvUDAAMLAxYDIQMtAzgD +-QwNPA1oDZgNyA34DigOWA6IDrgO6A8cD0wPgA+wD+QQGBBMEIAQtBDsESARVBGME +-cQR+BIwEmgSoBLYExATTBOEE8AT+BQ0FHAUrBToFSQVYBWcFdwWGBZYFpgW1BcUF +-1QXlBfYGBgYWBicGNwZIBlkGagZ7BowGnQavBsAG0QbjBvUHBwcZBysHPQdPB2EH +-dAeGB5kHrAe/B9IH5Qf4CAsIHwgyCEYIWghuCIIIlgiqCL4I0gjnCPsJEAklCToJ +-TwlkCXkJjwmkCboJzwnlCfsKEQonCj0KVApqCoEKmAquCsUK3ArzCwsLIgs5C1EL +-aQuAC5gLsAvIC+EL+QwSDCoMQwxcDHUMjgynDMAM2QzzDQ0NJg1ADVoNdA2ODakN +-ww3eDfgOEw4uDkkOZA5/DpsOtg7SDu4PCQ8lD0EPXg96D5YPsw/PD+wQCRAmEEMQ +-YRB+EJsQuRDXEPURExExEU8RbRGMEaoRyRHoEgcSJhJFEmQShBKjEsMS4xMDEyMT +-QxNjE4MTpBPFE+UUBhQnFEkUahSLFK0UzhTwFRIVNBVWFXgVmxW9FeAWAxYmFkkW +-bBaPFrIW1hb6Fx0XQRdlF4kXrhfSF/cYGxhAGGUYihivGNUY+hkgGUUZaxmRGbcZ +-3RoEGioaURp3Gp4axRrsGxQbOxtjG4obshvaHAIcKhxSHHscoxzMHPUdHh1HHXAd +-mR3DHeweFh5AHmoelB6+HukfEx8+H2kflB+/H+ogFSBBIGwgmCDEIPAhHCFIIXUh +-oSHOIfsiJyJVIoIiryLdIwojOCNmI5QjwiPwJB8kTSR8JKsk2iUJJTglaCWXJccl +-9yYnJlcmhya3JugnGCdJJ3onqyfcKA0oPyhxKKIo1CkGKTgpaymdKdAqAio1Kmgq +-myrPKwIrNitpK50r0SwFLDksbiyiLNctDC1BLXYtqy3hLhYuTC6CLrcu7i8kL1ov +-kS/HL/4wNTBsMKQw2zESMUoxgjG6MfIyKjJjMpsy1DMNM0YzfzO4M/E0KzRlNJ40 +-2DUTNU01hzXCNf02NzZyNq426TckN2A3nDfXOBQ4UDiMOMg5BTlCOX85vDn5OjY6 +-dDqyOu87LTtrO6o76DwnPGU8pDzjPSI9YT2hPeA+ID5gPqA+4D8hP2E/oj/iQCNA +-ZECmQOdBKUFqQaxB7kIwQnJCtUL3QzpDfUPARANER0SKRM5FEkVVRZpF3kYiRmdG +-q0bwRzVHe0fASAVIS0iRSNdJHUljSalJ8Eo3Sn1KxEsMS1NLmkviTCpMcky6TQJN +-Sk2TTdxOJU5uTrdPAE9JT5NP3VAnUHFQu1EGUVBRm1HmUjFSfFLHUxNTX1OqU/ZU +-QlSPVNtVKFV1VcJWD1ZcVqlW91dEV5JX4FgvWH1Yy1kaWWlZuFoHWlZaplr1W0Vb +-lVvlXDVchlzWXSddeF3JXhpebF69Xw9fYV+zYAVgV2CqYPxhT2GiYfViSWKcYvBj +-Q2OXY+tkQGSUZOllPWWSZedmPWaSZuhnPWeTZ+loP2iWaOxpQ2maafFqSGqfavdr +-T2una/9sV2yvbQhtYG25bhJua27Ebx5veG/RcCtwhnDgcTpxlXHwcktypnMBc11z +-uHQUdHB0zHUodYV14XY+dpt2+HdWd7N4EXhueMx5KnmJeed6RnqlewR7Y3vCfCF8 +-gXzhfUF9oX4BfmJ+wn8jf4R/5YBHgKiBCoFrgc2CMIKSgvSDV4O6hB2EgITjhUeF +-q4YOhnKG14c7h5+IBIhpiM6JM4mZif6KZIrKizCLlov8jGOMyo0xjZiN/45mjs6P +-No+ekAaQbpDWkT+RqJIRknqS45NNk7aUIJSKlPSVX5XJljSWn5cKl3WX4JhMmLiZ +-JJmQmfyaaJrVm0Kbr5wcnImc951kndKeQJ6unx2fi5/6oGmg2KFHobaiJqKWowaj +-dqPmpFakx6U4pammGqaLpv2nbqfgqFKoxKk3qamqHKqPqwKrdavprFys0K1Erbiu +-La6hrxavi7AAsHWw6rFgsdayS7LCszizrrQltJy1E7WKtgG2ebbwt2i34LhZuNG5 +-SrnCuju6tbsuu6e8IbybvRW9j74KvoS+/796v/XAcMDswWfB48JfwtvDWMPUxFHE +-zsVLxcjGRsbDx0HHv8g9yLzJOsm5yjjKt8s2y7bMNcy1zTXNtc42zrbPN8+40DnQ +-utE80b7SP9LB00TTxtRJ1MvVTtXR1lXW2Ndc1+DYZNjo2WzZ8dp22vvbgNwF3Ird +-EN2W3hzeot8p36/gNuC94UThzOJT4tvjY+Pr5HPk/OWE5g3mlucf56noMui86Ubp +-0Opb6uXrcOv77IbtEe2c7ijutO9A78zwWPDl8XLx//KM8xnzp/Q09ML1UPXe9m32 +-+/eK+Bn4qPk4+cf6V/rn+3f8B/yY/Sn9uv5L/tz/bf///9sAQwADAgIDAgIDAwMD +-BAMDBAUIBQUEBAUKBwcGCAwKDAwLCgsLDQ4SEA0OEQ4LCxAWEBETFBUVFQwPFxgW +-FBgSFBUU/9sAQwEDBAQFBAUJBQUJFA0LDRQUFBQUFBQUFBQUFBQUFBQUFBQUFBQU +-FBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQU/8IAEQgBIADwAwERAAIRAQMRAf/E +-ABwAAAAHAQEAAAAAAAAAAAAAAAABAgMEBQYHCP/EABoBAAMBAQEBAAAAAAAAAAAA +-AAABAgMEBQb/2gAMAwEAAhADEAAAAfMpAGoFAYADAAYwAEAAAABgADYQAAAQGAAi +-AwAAAOOSY1AoABgAAGUsCJCbyaAUCQQBsJgAxGIikiMQAwAEMhsEqBQAABgaawUq +-eQhOMNSDB0GxJBpuSIVIYQACBLSgMABABskmCgAGAA0pC1VnUYIzEMkIsRvpgmuY +-AgtASGmwmNPMNhgAAACBkkwMahkAB6VaZbRGRGKCeE6ahQ6+4qNU6kkUepDAhaFN +-2wE0AAAAABkkxmAAwWndZ6qzp8aQQVbSZ1qnuI1ysAJLTyt1pEhCgXNsw2iAAAIA +-DRJjMYJMejy1lZ6OsnBCCVOtLWWfqbONJ81FqWiJbK1gaZTaIq9YtGG0kAAAAAZJ +-MowCl5adEx1pypwoSc0pudaqHrJvazduOuCicxKKxkZzTVOZvnpdeawpuOQBAAMA +-DJJjMDk0y1v8tAilWt7l1aFa6jHbay9ERMqCqW5cIYG0VSlZZrGaZcd6vKhaZTLk +-gAADAgaJA1Jm56Hn0RYpmbcx6vRmHXrFMtj5KCg0BMq2Rx0NkxnWXNKBzxrp8rLb +-c7WmQoMABAAbJMYTU51uXRHmraa6Pj395gcVPEmAGxLQm0WwNtDYo46F650nlvV5 +-+B24YemRUEAAAAbJMowNF/Gkea2c79Ww6uvNOxamBMpG5GVTYJCOUgIRVKaUw+eb +-8fGenyndJKoAwCQIECMZgaL2LE3sI26/j2dHczooykINOJOilDTADRSEoJdGaV48 +-Rrh5+6/Hl6ZnUAZAQAGgMFAYT4cvPXVxt1PLt6o5nwLmzGkaE0jZJQABkIq0pzSm +-TylZeeOzyBtg/UAYBoFAgACgMFy5ueumz36/l2dPCfFSRLbA20mC2VKAW20EE0rp +-qtDKkedu3yYunNI0QQAbA0IYYGABaNTntPy6OnZdXXE5k28SLbScSRC0XMpGinXD +-rQq6iC1Dl8I6fOzl4zducDAIAJpaAGBpaXLpnTpoMtetx0bxU2PKyZGlkqlya0mf +-TrkW8DNPCN4TTlkk6RJL25vtx5alG6vNABNIlTTNyYGkbnsfnfUXNRm1x9cz22BV +-eEJxZw8wqzC2hZ63pW+vCJT5eaVtc2b6fM1Getjj3UOkcw6uKt6PPANoSJ1W3UgD +-EGdu8z7DsC4+SHPvpvXS4xm1V8Z0x572eb3nm9Ci4PX2s57no5am3yXLpmPGh349 +-JWuV5956fIu7yqfq4ADCSWPptsMAJRXT+b1fQHF6WEzjTaZ6SW1E4g20e+EaSLHT +-VRtsYx0/Zy0yvnOXSYWBm8KMtagPP3o+JH6OAgYaCboIYAALDQR0eqfL+luY5IFJ +-9N9NebiXNUaOty2p202WmNFl0c/XTOcXyQV10zm0vPvo+FG24jCPSNDibVSYwCwU +-n688v6u2jBTwVnsvQkuZNOObQpbUqw0wBTJpzyOltTo2Tbzr08fC4V6PgQdOQqTL +-DB0GSTKUBgG/RXD7HXebeJUQY3lZkzeHNHEjWojbGxfRN+aW4IWSjszCTEl1dPoy +-058V9P5usvmabIAmaCqDGY1AGazLo9TcvsMZI5qRhb+6ZvXO57c3Va556bXmArJV +-Ulc5NpslRETywp436nzdVeCW0gEBMqgygCgMAN5VfZ7eqfP9dWGlOaC9OaXFveWv +-ISnnR11DNDI3wXnAjdaXEfU+er7wS2QGCIo7zMYGYKAAYAPU/me9oefXH59UrXPJ +-VlTaq/daLPVLcZzEsbnHl+3J0Tl77vNZXfLjPpeC0kxcLG6CEw5MYAAoDAxAOvcn +-qdc8/wBCqy2na5QAc0eXNOuZcVvvzis4FHMcvQydejqM+NjNcp9LzMX0ecmdI2mT +-g1IMEsIFAAMFAYANHjv6G872EY6m4cZMKn9O1GvROURlE0qhnoWvOlRx4+8eT+l4 +-zDQBppSAErLaHtgYADGAUBgYa6NvRHl+5TymlMyHY6OWOu26aZ+lEvRwxp45bGeC +-unLl3Z52X6OINkxtCwAEmioAKGBgDBQSw9Xc3XYcHrVmd1blrNWWuU03hPTN6FPa +-kJ3MJBni9+Pkvb5aHIYQGgwQw02nBgoYGAUEQPRNms830tHzd6c6r4Ke5k3nbaJU +-7wnpHpoBhVQ3ycU6vKpOjlAGCQCEiDFJtOQBjAOlMFVpPvmly/z/AF9xy9U2Jhw6 +-SnX3E/SLI0YNIoJCpZg74+TdPDUb81gx2WGiBlpwbqGHJgAMJBqgL8j37RQc/RzL +-yPe0ryjJVbeWaj3kmqMbjUEVJazFZc/34m9ManaLjK3alTTbRpujjOABA8UZT4+6 +-qfTuikCouDrwPm+1IqIYZ8uK4pdM6Z5vU5QN28K8sF0cVgLK788ibs5pWma5YaVS +-iEgFDfKA3CuzOPTwrSh3MoOfpwfm+yynEpocNVnHIRZHoxtGOcYnfk3ErmHRyNFG +-Flno9pmoSWmHIFILSWsFDtrn3AonyWVN1TDw3wXF7FJj0ovNBjAaitxGZlrHOch0 +-cfVIXI9sKe5ZcgdtNO3BB//EADAQAAEEAgECBQMEAgIDAAAAAAEAAgMEBRESEyEG +-ECAiMRQwQQcVIzIkNDM1QEJQ/9oACAEBAAEFAv8A440tIJzQGBiLQ0aCPZa/8T2r +-iCukiG66mkHcm6TA5wftce3NaOgFry/B+80DTeIMsy5OeQORjic8dN7G8OYkjjYn +-Ogan2GFv1D06y4rrvXVco3h4WvuRsL3GNjGyHbGwc2lvJR05HLp9MF4U0uk7umx8 +-hrmiNId1+HN4qN2ndvuNbyP0fQiavp+s+3xjLaoc3pFrbMvvc5zzwcUItqc7bWjL +-nTw7niqIw8IZI0z5+5joNGdpns14x1HytClrgBrW88ne4uawlQY8vMmOcxv0RX0P +-JMhbGC0E/wBW8NKY8g3+/wBuJnUeIxCWNUjXAdNwZo9J4eRHhJZX0vDD5VU8OOhT +-cBtS+Hu0+DcS7w9K5r/D0vJ+Fkan4uTldqSQuamO5D7WJr8mS7jjlaK7bdrrSVKj +-70ceGklmp+HvZTwrYxHSZGhCAugNuhaUardmFqdA0ixSaRPTastixJG6r3YOEn2f +-lYqANrzyvnnsxm7cx+PdbtYjBMrQijGE2FrFxRGlry+E4bWthTDtZapWchk4Pp8l +-Zi0/7IU1gxQMsbngd/B4Zrt6oboaWkGorS+C4Ao9lpO7J3dWSnjR8Sw/zT+5v2R8 +-2dOrU4jMo4AGYCv9OIXcmgLa2gij5PHnIdKbuJGLxBHzgD9S619qr7q9aXQpB0js +-U4Btc/xt8h5P2Hfgdi7yKf8A1l/tJ85ZnJtn2zDv9qq/SpHUlWXZw7uTqx9jT5/n +-8uK33c5fKKkClapuyvjbsiONqH/j9A9LDpzIyq2zNhO0dZ/JoPdvnyR7r8vX4JT3 +-7T1I3ayUWlmm8L0J2z0D0j5a3pFgcDhRyUH/ABtPfnxRlCdMNGVGy1dVTO0hJ7Zb +-ACfda1Py8LUcqxTXGvZ4og4XIGegoenD4ibJKSB7J4odMwVaNo3xBlEatZDSt52S +-BTeJ7L1D4onYKud6wqXOopJNp8pAyGS6amlu3DX8OX503wpOxk9E1os9B161SIPp +-+ZTP7ejATS4/AXcQZ44PYcJ2a52xYd2ZSEpbjK7G37OKpmSWhKuhUkFCL3RVNx2Y +-+Mc4ZEZLtl7Dk8nFbpZ3LOqjLxZiGzUBhiZ0Knk52ly2gPTgWizhuiH4q5E2KXCN +-doqxC54vZKvhad3LZPOQwtb+40sTX/Z20+rJjKwhTe0druy5DuanuJs3hKvPPHVd +-XqfthrWbTX8bumO8npvz6fBFv/Ilefo5KLzTxTtR7GnP7ZXHvyVpuMjji/ao43Wp +-Yq4hhs3XVq3TWvZP/wAdmMdUY7kWRXoQ6S2QIXNV1v8AHafyueT0z59OAs/S5qT/ +-AFqcbehoMcPiNx1xBTqjnKTGyPdFiYYl1BuJunByuewTnk6rN7YpA5Ed5fYrXcXW +-dPI+RTfUNhY+UZKhVe6E2e0jSvhR78nu0nO2hHoseAOZ3bYTFKzi6A941+LIVrsc +-l/2aLuyCHc+n9P7/ANRi5GchZj9kZ0i7vGeznIyBT3GwL94fetCM8Q0hTbLbdcqX +-2u+sfTMOVbIrM3ttP2sn/wBh+PMO9XhvOHBZCjlKt+F+ThmsBNPfqcU+XtaviNWr +-cuRmoU2V4n5R0LK2dDzJdDjkLwjrmUvcNPEmPlifTu9ZWG+/J/759AGz6o5XxHCZ +-A0su0oENVi5qzdl6LbEj781SmIzFEpmKzSJaX2HRujlcOmUzYTb7Q8RCW7Mf5rru +-pbJW0O/ke32PlYO/+4YouWSPG1lg6RjYpNPzsmJli8TySCS7brFt2ScyWmAzSWEK +-lyWPKOtWMhUxUdKCGHpNuWOlHvaf5N8iPs+Br/s5q7F1hH74ns6Mt/EV8zWhikxY +-mlgsUqDIIjMyKSe7K1ZHLRy1MVREbj3ffn4RZ6528x5H7Ph6wa2Zc7pkv5NjdxdI +-zkq2wpY2yh+Pa+OK5LTYcpZL7lh94T1mVWVW6a08TkrjWqWV00npjAkf9jwzh7GX +-yViLaPsLnkpkijPua7kLB4GSYFCy0H9xDW7dZk1xFmTjHmrPJ/kfRvifXWryW7Ax +-sfg/wxrqRSQ7Dok0KIojtIeQnqNRpuCioNTGBikHtylwQB7y96Hlry3pfPqPtaLG +-1+lOENmz+o9wx06n+rIxPZ2kHFRlMKfCHF0QcXxsCIABGhbmGsvd69n0b0OaPwPj +-0NCm3qP58D484vwx+pUUgyGMd1ce9OarQ0myaLJeKE/aR6e9dQas2mgZK1/G/wDk +-mEjoXMkD/N3wtofHmO6ACkGx4K8P/v8AmWtHDOYhmZxuHkdVY5FWWJ4OxZMa+tX1 +-2iL44zZEBrpHyK47+Nx/yLjdtB0Yn9QeWkQvx5t7BDuP0pgDI68nOMrJ4tl2Njnx +-u/EnuEkPd1dWKKNGQOjx7imY5ofaHTZe/o7/AGZof8VRu0mhzm79QGyT3d5fpxkh +-DdG4zG8OXyMljG3G8i0uRC+U+LY+nC6WjKNC07ZvfAZytxQj6aWPg/8A9RIQmzNc +-ED6Ie7nbY4HaPZYq8cbexN1l2oHdGTkgNqxTjtMuYmaqflOC6gAkkBXV0Z5eSsN7 +-5Dsqve82m+PHPaHp0em62NEKPetr5P8A/8QAKBEAAgIABgEEAwEBAQAAAAAAAAEC +-EQMQEiAhMTAEEyJBBTJRQEJQ/9oACAEDAQE/Af8AyqKKK/00Vuoor/EvHZf+GhbK +-Fk3/AJorZQhnZTKGUyiivPFbUM5ZGLo0mk0splZ15UhcHeSVmkjBntNntCjRRpNB +-7Z7VntHtEo15ERzSIYY8MhFIbWTKKKKFwdlck4jiPxrrPDX9OujUy/AxFDRjKpUT +-Xj+hC7I8F+NC6y9QvkT8f0Ijvrcs/UK8n4kxEc72Loed5IWWIrJrkfiQiIiittbV +-nIxOx+JCI51tQ9iLLHyjE7H40R8FEkJFFZajWLoxjTxtWx9mHhuTs0URWVZ3RqFb +-Io0lCiOI4S/p7bNOWJGyCXsNn1sj3slxA/H4OvB1GNBJiW5TiLSyhjkKWWJPSP1T +-uhYtkSUT9cFoXS2R72SVxPx00sCib1SKoSKy02YjlFfESxHIw9SfIuiR9i7Polha +-h+mjYsGCIoaMfwv9aPx+LpehiVYmlmIvlxnpF8VyWrFX8IJP5MckSZfIiPI3Q5RZ +-psSolyjH8WBLTiJkVeJZiP5sWbFwahsobK5Ioqho0FLJnqO/Eu0QlSUkYkE/kRKz +-TFQ6OTk0kXQ9iGepfPj9Lia1Rqs6F1sihQOhs1EXzsoiTPUv5bVuwZ6GKcJqxqLI +-jKFGyKG6NWVGk5QmNmoTGYv77Vy9+ppGFK32QOyiJKZqsbrvPUaizUXfREZifvtj +-34IOjAlqiR4sv4EXwPskqVmClifsRwrJQ09lRPh9k8SP0RbnOvocdCEYk6Q3qmPY +-vD6adcZX8aE/rK7dDwJP9GR97D7MWc5fYptLsi3/AEwfTSn2OEMJaUOVlmPicUR4 +-Z9eXAfyyTysvgwsTT2a44nA/QQxB/jIEPx+HDlnu/wDFGNSdLLEnSJu3lexRUvDg +-9i5jydEskvsfyMOVEMVGu/sk0YuLao+i2ujGl/DvcuH4fTq2dFDQxSFIoqX0fMuS +-7OyUSU6NWrevD6dEuy8mMQnlR0NkmY26962em56MTh5J5MTFlqLJMkzE8iEPP0+L +-okXHEVlZIaHEs1Go1EnZ9EyqyQ1XgoWx8mDjODojUkPY4mkorKRIllEksmhc7lk9 +-mFjOL5FJTRWbZZeciSJIeVnDXiY9kcWcemYXqISVM7GsqNJVZSJDHEaorKSz/8QA +-JBEAAgEDBQEBAAMBAAAAAAAAAAERAhAgAxIhMDFBQBMiMmH/2gAIAQIBAT8B/DH6 +-ZJJJJJ/LJJJOaZJJP64NptI72MkkkkdksJ/E3ixXkQ/xVPJI4HUbjcTaSe9jErOz +-cG83Ekm43G8VZuNwmT2MYhsqrN/BN1hNuRMVRIux2Y1JHbS+z6OzIIIu+mg+i6Xe +-rF2fTpcH0XU7VZvppZSLqqsx2eMYxekpF1OzHhBGEEYQIo62MY7q7vOUFDJxeDKq +-iSRk3XJA+CcEKpI/kRvtQ+R+41eYLw1auYKWMeFRsqOUMkV9slOhS1I9KLJlPOL8 +-wXprr+8ifAuR2kkpieTdRBVHwrYmK0wbinUhH8pUykoxeH2TWpnkq4KKyZs2Us4G +-Pi1NLF5aMKuSn0o6qlKNQpptI0JW5tAqbMV4IF6afUzUXIqme2+FPJBF5s7zhp+d +-SNVECQ1ahWdmQQNEEY6XmLyqUlaFwViEyR2i0m49tGFP+cXws9qZVQvhXaSRHGEC +-UXavT/nGrzp1Vy7/AATKVJUTZMkk4iSuoTKKZZTwsXz06tN/VallabEJigdm5VqU +-aVH0Z97dTwjkqQrf9KHJsIEhIaszTpkpUWjBt09Op4N8j5IJJE4NzvI3aDRpH7k/ +-OnUYybfcFdsQkRtzfQzUs7IVtptx0/wemrx6LnwaurSTjRx+BGvRuRzQ4JwTIIIs +-rIpdmJz2K2ro7uRp047jcTZWXhTZicWTH0QeX1NKR07XZEEECVlZeCYrQcpj6UVI +-V69KllelHh/nh5oXghMmbp3/AP/EADsQAAEDAgMECAMGBQUAAAAAAAEAAhEDIRIx +-QRAwUWEEEyAiMlJxgSNCkQVicqGxwRQzQEOCJFBjktH/2gAIAQEABj8C/wBqFxMn +-Zd0eys4O/ptV3T9Vc4VaStEdV+68Uq1jzX8z2Vj9Qr2/oyoA91ZZq59kcIJAUYcI +-C7x+qhzi0oRDjxQnP0VitPZeLYN9hQj8jmu6ICn3XdkAZuKv4fvLNSo+bgryp8IG +-ZKgdghDewFid4iMlJuOB1Qx2GsaLqm/9dU2chcDiuP6LDMoXRCGK10NGjIIowmme +-K4lxVV/0Q3vWEeiDNBmeKxWJ05Isp256leufEpjT4jnyXVUtMygTnxVllrsnRW+q +-nRfkEMS4N3oCawaD6J/OyhhxQwYpRfHq7gqRyxDFPunBouTE8FODNBsKC1XCMBRh +-7qgCAsIZ7rwyoc3Co3r6hbiIMAJ03rEfUqi2e8b4lhpS2l65oNGQsurvFOmD6rKS +-TmrhWCyWSyWSyWS8KyUjxDL/AMRsi057ugXeF7i934RdAjxPcnkEtYLD0UDw5Jst +-XhvEKw2ZbmE7g66Dtcju+h0hbuwf3WKYAFl/kmDNxQ7c9mNjKiP13dN2osjUj8IQ +-p/VBzs0N87ksJ3dQn5Uz1TTkgM417VstzUEaL0KndPHEKZsxsqJshFxvrI8wnjmh +-ugiIgFBuimUN8OCqeu7CDvm0lOcNbJozjU9rNRPYzVzCjECVb6KDkVj0cid1VewA +-MpXc4qHAz6IAwSgNSiESs7qxxK2IK9/Vc9t0VDGuhXqBiv0ieWFQ6DzXWeQqo/g3 +-sjs0XUXYX167j7Cy/iKficJh2SAQk+23wWV2hRUNIOPy6qW0CWeYNlTSI9kMJ2FF +-9S6f1DMLWCTZU6Y+0qDcbS44iIZ68117hT6QweIeEox3X6gp1M/MF0hh88br7PA/ +-t1Htd9UaWpGiptpCC0X9VfYF1lVwt9VVq03O6P0UfKzxH3XRwegl7WumoXPPxPUq +-m9/+nr54mZqHwT52iER+uwrjGQKezBTwPzi5XWnFPov4djIGp4oOYM84UkiE9g80 +-7qt0Q/OOtZ+IJmFxYS3MJ4HeOPFOpQEWCuu6/wBi1UuspO6huZ0QFGAP1WLDTH+K +-8WMqR8Kmm3nYVK7jiw8VZ7Hj0V2BSbkoqqPvHddCq/8AIGn3smDh3UEW5bO7Zec8 +-148PJivWfHBYnd481hbtJ0TlGuyx21/xHdWz09VSqD+8wVB6rq3eyB49nkrKVmrb +-DZXt2ekfi3bqDj3+jvt+EqWgSdU3j2iSbIMpmKc+LYFCKhAky1ZrPZ0jm79t310F +-1Fww1WDhxTatCu17TwR6O2oOtAxYdY2em0rq6ZhmpQELwF0cFBH12HJSTdQbrHQN +-/LojTqy2oNDsreu8ljnMP3TC6PXc8xiwvJvY7CqdLzLNFrT8PjsiygC+qsSPRAYv +-dd9xI2ZqLFNqDPDdHkFWP3t7wXRq/wAxbDvUZ7KNXyuRjVdXSZfVYa9FxdwCDm9D +-dcSCSmtqdGu68qB0dxP3QsPVOxcITW/wzu9lIzVQw2lgtCHRKFWocPjM2lBrbnUo +-vNlWrcAr76v0U6fEb++w8EJuVIGawVGAuF2lUqTmdZTbLTOYCpVHkANgyqtRjQCb +-Km8tGNk3TKhAmnkuktoH4ryQCpzIz5qFg1Kb0dp5u3/RSDGJ2A+hRUQr67ArtBRD +-XW8hTmiqWnyvumOLxbgsL/itd8gX3uSnVZ3TqjvC1Oe7Nx7WD5v13LOpgMokVKlQ +-5NAX57LbOSM2U5H9VLk0LmvMg1QhRGQz7cjPcU6FFvWVahwtbxKdRBxViMdSp5nJ +-ruWyVwV1zR480bwrOUnvKGjDGxzzp+aLnZnPeyslW+06re5S+HS/FqUyiM6zw1U+ +-bR2GriphQRZZQsth4rDPcbvjs+z6Thhe5nWO9XXXQCWHq797RUT90bclCzWey6lQ +-E4DNPadUWnJW3hTKb/5FP4lT04IAZAQqnRn2d8ruB4o9GrjDUp90jaTkiriQvErL +-nzWcLFpxR2B+uznuZ2QvtF0d/GGzyQUokQ2ro9GlVGF42kqIWULuuKu5yyUbXbcR +-3EbalFx8QWIZHbItVbk5YXgscNDuDtJImyM7M1ft8ttLpHkddMex2JpEgrlsuiKj +-ZRc34tPiMxturbLbY5KpUItCKJGQPa//xAAoEAEAAgIBAwQCAgMBAAAAAAABABEh +-MUEQUWEgcYGhkbHB8DDR8eH/2gAIAQEAAT8hqa6VK/x1K9VdK6V6SV67K3caQZnH +-ZnOziW1ncFJh0bRqsg3XECqSosqzepUCVKldblXK6hA610POof3SYux4GZoB04cs +-zmEbjsMuCOBPZCyAhe86/UpIqmE4hYCeYa/qXopV32fmWulW8ENyi5iMuLd+MS8T +-u6ggdKleklEqNKx9zPxLqw925U0SvPEc5YrtMad6tePeMDlV1z3ZkIdpKzBD3MKv +-8QnwpBfYIqbwDWzLHT4qCbt3wi5Yq7XAuYAGE4lQ9Qhv0igZfNfuA6ru5vn2l4Vj +-g7wMGjZ4CHT7sPBAbd0Mgfth23Hapf8ADBW35mmPm1F5nmKKaC/wIB/hvbLFO4LS +-sJY5bmJ+0AE59ZDqohbKCHcDJ8yrjoCwjVKHTR3H/JXDkxz8ljTtUMf15iAPszr4 +-7+8os37/AIlxXu2yXE2SoFVyeTEphxB/cHjdY97iBFEvFwfoBK0P4WEnBdeeYfzf +-4TqXeIYWv3Zb7epy2/s/MoRR2dDlidTKgGbv4hXQZU/DcfWPB/A8S5cfg32m9KyC +-NnuuWEvf0glWXzMyjffEZIyfhEdDkryzI8YQ99ygQV34hEOy69tf3zFRsBgRx6a9 +-Kg4vb2OfqBk3mrw1LFUrYfn/AMiWgJSB3oOC7o+WGAxhf6E4qXuMDcPoPzLaZK9n +-l+YytpXg1E0x71NjO1EG2mmDxPtPp6MS0Plsg9CciWu7xOSnVxOhDnvME5mYdyvR +-XSoHSickgDdTYnsD/TMalLEO3f8Ac1I8H2LBgXM5zBzNueTR+CMNbI/wghyykAJg +-ge8cjs6KRZFdp2ydl43sYnNLXeNz5HUXVURtO0bEv261K9NSnA3MKTAuXLfoPmCZ +-ul6LYsN/if8AYSPHDHEJslEeGmw+IcUFdiaYJ3BZ5RMRrCq8ShGxw94DdQWvMyva +-eK95QQrU+mVDjgTiHpNdVWYsSQ9jL/AJheAW+ohjm18FEuD2GifGoZTWUPjpcybL +-cRDlD+UOgNIVvhhljeoFArZcRUYMg68R/wAGj3hO0ieWpWGd0ji+V8QxFN84KcaV +-iH2UK4j5j2xXuK1neMG5YSvMTEv/AMSyXuFTzB+aiCmHDG+rv0VKh1MQXG6XUq9O +-MDvz/Ezqpnx/yDg70Mh+ZoyuZ5xajI7NxuBAMcPRZCkLaDSHvke0JqnIetS49aiR +-MvFbCtZi26Lq/wAX+ZhNG3icEW1j7x4Wkqo2UjnS5Rco2JVVzA9+n7pYyyUQLunn +-1o9I5i9FxVeczDdB75gI5PP7iCTbeDiXIwVE9kVs2ZihEk3NzdJwtIIRi3LE1xMq +-owQbR1PlUL+D0O5t6CD8hMZmejXmoy3AS7SLn/ogK4t6VGF5gqzLDIQUsD8wibIF +-ggb3Adqlr2QbB5LDLIdplXF+ExZlgWQKfMYyJXfXpDPoPx57RkBTg10HnxBzPJ2f +-9TI8vG5UwQt8TAA1iErbRwRG1fteJcfCLmG9lKligzVp9o7Ob8xSURXSio1JaxH2 +-Fij8xMbHm7Zj6+aP3K9V57olYt+liy2ZZ3v0q5teg2S+QgpsMPqLVe4Qe55gxiN1 +-njvH4BVpae0Sli26Jj+TvN6/me1ORXxBXx8n1L1+tnCBTi8mZSXmVdLYxllm4MDJ +-Dz2insHVwunW3BuPEy0DTVzPM9PJ7QrLEFibIi3et9URUE81MnoJnuPDFb+kjQTb +-BGZjm83Ncr8x93Zw94uHECtnDcZgUwbT4j/97Bd3hFMS4Lp/UlERRGKl6Tn5lR2M +-x+z3iDrjXKa7AcdqWaghWhcyxFu+C4Uog+XvH9pu/umXjPxStAGgI+SGuu3qAjju +-KDy5+n6iSuF7kv8ArSrsc3FMZizLObxD7TuGC+zifyjNU+M0lSa/FJnr4SFrPBMZ +-ZBlWN681MAS3iMPB3BJQZpqMKFjKGUi33uOrcwdkvwx+3B99doLhh6LsaD2n/wBy +-LsLv4TOwzEsCjGWvNRFaLvOa/SlxfjCvuZCuw/zOBz3TGKvaUiwGGiyp7iY4NhAW +-ypfxWXP8x2+ZWqo/v++lYmTMGbfSlt0crtw+4oFHgiMkR7zLmCmM4a13gooiRAvc +-S1AwyTSbpTysu8DQT3h7RkwJ96BabgVbnvN16mgsSn2f6OlFOm8FB1rp7zZRvLYf +-d/iH9hSPkcDMuD2mAO2cX8QQyzUuFB8pbIOXymILo5gFTMVxtmwlMiCgd+HXSngg +-N8uxLawF39aRaXSoYIg36vJ9UPY8l/c0oHXrx4Ykztl5Av7mWjcv8oaKxbMxHEKV +-67xUjQE49s294dsHLcmBjwaZfBx5j/txNsRuiOiFyvExB7X2mJMC8EBAcz+v46K6 +-XipUHovoblh62vb8S+sWBTib/JKjtLh3gX2VR7xVfekXsBz3w7W/DEDtcsRAcEDQ +-ZyyR8PGDk+8A1jhiCpgDcL3oEqFUw1uY6l8mcSmJ2RXmVOblIiEi6Dob6kqiX7ji +-XEiej2vtcocRyygb9p224SqRs8y01OOT2gGHeFCgGFS8R2RFompjh0NzCpk68sZB +-rdGV7QeYQGlmfoZqM8m15YBDIq4ambKuZF5TI6YTiWYeh1u+h0yPbW54cD9Pyyrm +-55c1KUlBTArWGbmIoNBH3i5dRLXPnMLAxL8JDKoU3iNO4FJtttvMqA0G+LhW+8na +-7zCwrmpRh8Eu2LV9ETHmVj56CiXNvSdDpRPe64K/UqiYndQ1OeBLHWSIEuohUOfL +-LgV7uxc7VKtD2hcOVJoZadpWGL7x9eHxw7EJvcg8RFwVzTR5jBXcY5ZqJmV0HjHC +-L9I9TcbfvLPlr99psVF6axV9FWh9xXaKYL92Al6OeIV5c82SwgC77RxzlgNR5BHP +-BEDaN3Mcq3jtL23l98ZWZrOToQQNQ0nrI+EU/J/fxCXu0qt4PBogfCGGniYEF+Jh +-uBDNZZcXmSsUWykNHa3Z1Km6g3ce2q3BCi7ofOqyjNVo13RcrZVHoWEOugHw9QLc +-yMPmEEy4do+ox8sU7FCZP/UE24lOBiaVY3PYHMNDSPqNoUxh0kFoLJggzHqX5J2E +-I9Hh+7z0JVRjDlxB6hZnglH6oyquuI3uiXY3+5KWmvzYx7w4dlLdag/6Zk052N6u +-ZpTPeKg1nsTZQfeNixXmWMGtsW4pXqVyEwmSAOmE2viXvoINxtiCh6MkuTKoVrBw +-8hPtr8ys1EHsamfUL/BRdEnhp28SjzFeCXCsAPB2zEabu9pTQK8yrtxriKxRk1M1 +-6IUhQ5hvNGrXMHjGF7xrhphuuOyEu453KGcOgy4cqLkrmVuX88TFG+6ILr7gUN1m +-OkGyExTxmTx7TlOsZq3eUz5I9CWg7DLlqvxxKNBdVIdcnusOq/E3VFjXaO4M76NY +-Pe+kC2mMC4daAllfEwRCBi3mUVM55qVWXM1xASncLQJQbiX69opYoUUxUVdkub/c +-QFGLlSVGzt5gf90Blz7Rma7dPiuIq0m2Z24VcQxaH7QS4Mu5dLR6gPio0t+DUreW +-ZN3BM6HDZzCMD9xZHEd2J2Nso3A5zw8nzDN7H2EwCycmmOCZhu0Bfdwbgl042YHd +-aXmb6PiZ7FyahDMi0jWcco8BP//aAAwDAQACAAMAAAAQIBtNAN2yb9hENNttppNg +-JNN+EhFJNENtpdDsMUExpAptMtJNGpk1/MX60EkkpgkPcgH04QmgEkkIFbk7z7ld +-FSQEkkJln8kREkxh/YEkgInnLieQEtilYgkAJKAdsoCrRAyOkkEN1EKKD0r08l22 +-AApzeILX/TS2XJGkAsCrgSM62fWfNDAEACd4WH2cs6bpHEkkAbfJ6zEkqPWDAEEg +-z+WqAm8I06IECkkJb14lzdq1alkgAp2+xwMKy0NbUk6g7EXNaj8yEjzem6A+YkzE +-BGcalvfjpg51wgnsUO7wID5TEgEWMWePKhjQiQagkGn8DDOSsx+OYlIAHLPc6Wzj +-5xwkntAMtDo7AtM+6LE7IkNGJL5TzKCjpkjJgABCaA219oqiMEAkgILcRq/pGiUI +-XEkgE110l6mF4EmWAkgAmQu4+4qTU21tAkAZkzzRWahk5gpAAw3Tj0gLkkkrrtlp +-Cmdq1vehzy8jppNuJ2t834ypPdwNstUfgkaNV9+Ij8tlA+Gvv9QNJDuxvtlsL8/U +-LulhXjhm/8QAIhEAAwADAAMBAAMBAQAAAAAAAAERECExIEFRMGFxkcFA/9oACAED +-AQE/ECE8oTNKUoiEJmE8p+iV8Qk8Hl+c8lCCRCRIiEIbO9IH8FE+kWYQhCfg3GLS +-E8EqiEJMOMW7v/wbOiwa2QhuJBvwG6QhCYf5UqEm+EVsho0J2IrshEfA3+ixHIL3 +-FljZDiw/wWUrganhyPHoaBgUNiDwNkbJrY8H+S2XYg+iDA2QwhObFAhYR8GjJZH0 +-nhjn2Nn7HlIai/BDw6wmVKbNoh2O6RoWvItsI6FBGglkEN6/BY4xEqFsSQtioGx9 +-LFLTQ2Ung0EjVEPponBCWvwWPYsDaISDdnoomUT8XkMnX5n0WDsXBCwsbOi1hdw8 +-FzEg1NeaZexDUw7EnDjEhBIgvsaYRBbhxiAYvzusOzgewtsLCcUNvBYLmOf0DRm4 +-mxOIWzi4WG9jM1EqiCQhS0ixQWGvyXcej0I9YWEqLA1YIPQ5cIGoWOm1Ht+HWV00 +-r0Rbg3c2DWhaImH1hT9FFNGxv7LQwktDL6HStmvRJTRI6igLf0XDyxKiy+MeDfRV +-CHhI3DSgpEOQpWuKl8Y21MUIeI2YK2LTQo4982LJjdPTOJ4bhWxojy+E5sig5pbb +-wMNbE+x9kKoVFBLscDwEwo3W8xy2dDwxC7l7Q6c+jm+9P/gn2DFP+AShKU3ERAOh +-tEHUGkCaIRBoE3RIwGG06Rwe4LSDxnSYS8+JYmga4WnRqMnrQl+DW9FMto9hcUyg +-k6xIxwdhZWhF8Gacvonqhk62x9xkDWin0LCVoqcRGez6LtD1IoxtiU+DhPRcpPxX +-0bV6OyH7DVGPmEqNGPYkuhCY0esC1LKsQSJvATqz6o+94WVvD+oTgs0cxQ9Aj0ug +-w+ipmgvoL9i7obr2O+j2o3ZMXvN0LBeKcNdFoGP2BNU60J0q1oZKshwoPBOm1vFp +-7NTisr6DDbN3ON3weYLxb1C0/wADEYQGwZINIFM0mL3YT1Rd/AuoHVAuiNUIcygx +-K2xZaMnlBr4KVMf9HQSC06TWhZUoVzHdgnGKXaozqxfydiNeyzYrQtsotGyRmLL1 +-+LtBWUuh6eEcdGOVvkJrRL2OG7g0nBDNsqFtidA+4tFeDgpS+VrU5Al6DPQkpWIs +-CtIypJkKSex+wKRtjCNpQMhyCbTfk7ovy17JYcjREdFi3watj+4uiNMRVLR+wamV +-nryhJjemaJgncE1mJ3BBcN7Q1fjxZLvgnRNkg8TKYpSZRCex74a6YhPY1E2lSimR +-Qxts3eITWG9QWEvxDtx/MsGphZ3AoPnBzwagx0MuC0smJMXngoGHsajwvpoQH2h6 +-ky25BaFtDKezvp/cc+yqQaaR2aIb2MNaqOM0VCeTrHed+iaYWWsJEPA9sLcIbMSx +-jcWhOi7XROaYnGLWLsSIiLCDQRZse3WP1q/w9kRJLUMGjfOhwNsb6U6N2NuCTTIp +-Mt6Puj//xAAhEQADAAMAAwEBAQEBAAAAAAAAAREQITEgMEFRYXFAsf/aAAgBAgEB +-PxD/AIJg1P8AnbniCwW/8TLhRZTzSlKyHSRKQUvteG9sTuOIfhsSbFeCyr2tBhZG +-o1JvBR70cEKXZcL1yjaXRTeh0VNlHcLZJ0TWDbGT4J6KXexPC9dmBO+NOiaCrkVl +-FgtFheqjaHpZDUGgnRA/I6Hj/wAil8P84JF/In6IL184NFgStCVtBuyM2cbzzCt8 +-watYEGvpYlob3BD4OyjYkXCeFw+EFrhWd2WDn0TaYm/QxcHgfPGIRCR5fgs16w8c +-C6MffB16XEteo9iTZRqcexj6VDdx0UhCD0XKLoZNetx4XzxNXxS4PWOvZLUNTNdD +-Ylcj0UhBBIUau8NWIoJ7g1PTxh1g+DweOsUQpbhKog4eLotXhx4fwSRuhhsG1hPp +-k/pGgw2hN3LoIanEiGJ3ohCnqLiyh42WJQ5FVbGGKXCNrTNNJqGaEzwjK/gvoILM +-+QTnSb0Ts/Fa2UayRCAaHhTQVCsMiz7D09FhNU+CoyxqFlNXi8LGyyu4pYGgQk0y +-OBpkFgTjYiYz0Q0n0QYnA9I62REIfgPEQv0pcPXlqDqGikg60VTGo3gk33BCHJhH +-00NfmDCwceDH48E6EFD+iRssZjNdiVsaIaG4VBW4NEYmWhOjRxi9FdhM9V8UptHD +-wQbG/hoJHg8FoLbA8D0xDEtiFqPL7CprxTggR0kK23h3sjwZpiTmFNN4X4IMNMox +-osPzM2PR+UTG5smGtQrBfoTG3T8ESNi24ThaGlYQ6VD3wRtYdk9o239FpD6WJgRs +-MkKx8owWmxbESox8KEBHAJxzwSJ6dDY1BvZQWj4iTTLRoGETRI6MBKdGpkGnwe0y +-xOr0qHQmxsR0ITY4Y9INGLuDiwpIBkZYsvpksVIjohcKomkGcCcKNlg8C0dCV0Zq +-ELwYqbJ+nXD7eCdFkmNso3gelxEt7y88ea6cmzfkFiod8FzyfSYfmuj00dxrbDCC +-GFjsVFI2JOQ/YTTI+l3CE9jiFoG+U5kLbCTBdF1T4F0PCQef3z+4OSMUjRwabE6s +-QTaP8H+BX8HsQXcXQhaKaD2iDg09CrZR1DV0xKVDsCVeIGpgu5p6fRoyfxCXY1Uf +-3zf4ImhnIRSj2oxHz/0+AKgW8IrRW+laGdxfwTEmhYVMU20SC5s//8QAJxABAAIC +-AgICAwADAQEBAAAAAQARITFBUWFxEIGRobEgwdHw8eH/2gAIAQEAAT8Qgy1ALIG5 +-SBXwNfF+JfiBhVoIlNXfxTLVfwCv8Eb+Dn4U/wCIbguVmoN/IWfAEIFy6iJ1URF7 +-vrH3KEC6FtSv7F4xWqy/iY8gWl/RGsbaUfa4vVhYpuZuFbXDFEsMyvmUiaZTBr4F +-Fsr5j8WkEDuUSpYlJuEeXpuAGf8A09TBopWo9VADatks9hr2wgoLMAFhBu3ylv3w +-Q6OAOQB3YZ+pQD2S4THLf1AJ8ALT5LSi4AW7c/Smcnuqbp1BRD++P516md1wOB9b +-JSYw6QW4hCMabMC3gmy7yepQQODL2/AMCo7l7lepQcQMSiVALnEW03AHuHmzuxHs +-a+40cyN+FboOISCVcIv2DbGCAUKy9EABRYoey8fuXASCqegZroiaDhslzXco0dUl +-fQgIRLE5/EcLkbbz6OZfwLVTR5XMSQgOFp+f9QaKbUNYto21Y/c3DT1BAT0rnyRK +-VXNyhyXKOvio6+NIPga+LiMuDAHvSCPvfbCN2wWyzkgkAgJVXldr7zFqQrZemvh/ +-cWFi+i1RQ+swa7pvd5UfFwmWkRQRXsKi8CUsAs6pYL/cYKFZocfN5uO7q4XWBdcF +-jLg7L1NV0bQyf69EZ9BzLw8RYhQOb+0lkZGT0f8AYjNNvuEVVXiHQo/wuXCbwIvx +-jmN7RzReOY70xjA6v/TZzDXpha5gErNYobxUuFQAnebw4vxpBUCkA3YUas5a6BMx +-01uFZ6W3R+EUQZklQvLIOVzqWQSEQbvAH3LbCdgDda2VUvytKLlt1kg15+KwMgOV +-iD1Llgvadq8r+qhlpv8AoomFGWnTp/krCVuPYX+4gMANZBcG24TsjJ+GF5INnqVX +-+FPzh8lUFrxKG8qg5uwenD9RB3HPHqOhC+xLOiIzAapeja605xGFpGTraXFHSykm +-qRrcWrcs2/ohoBqGoF4MWM14VqGswwPDo80JeibO8Y0j1FrUbFxY5ZysJrYMTfQO +-SWkba02YXghj014irDmpsIrBX/7LEGBxEcf0wQA9ts4POOZeCD0XQrD6/aAXmINx +-MLjHMNqsfX+D8jXxvUfRGRbty/b7qcF5uwFzhnFXxL/A9zJaXYO2MxRbLMg0a0CC +-OascwAUFTaFwdFqcp5QIizlBAMdlw1eHFxy91nJajbar4Mc3E2aEpdlqjrP86iU6 +-6sxOXTCg66AXluKXFdGUCihKHYjp2KVy+niALG1n1nmVddFVnb96jKUbldp5gVfs +-lD0wD1eg0X7Zly1iuvglf4DPwsnMqy3RlrdcwKM7BKI19qfiXDttsKD85iyZ9i4A +-PNQTYotTejyFb9GCrbpTFkcmVdW3v8axHCyoTJJPAn2kM7+WCD8EMzcBXxHBbwQ1 +-sHpA4gYNcktEGDfExNfSLM4uiUYG2El8PYxqZ4arQfyXMszs+3fiEwVaO3J6lXYb +-/wCPESolzy+VVAuGIDqDNiwTUpkCNZ4si3lSiMIK40FAfXcSsPJ3F33Q1yR6Forw +-4H2lX5g9LZU3gtlXd0Jl6PeoE45RRrX9lQAYzEzFIpClLxAK78Svi5ZQmrEEauoH +-HmAsVQpvnzGBM8+KgGB7iZPUtkZNxVIwFMZ/gxjgK1MFa/JmbD8KuUfJ6SvHwjBs +-zBsuVjSj6Jq9StC2CpKcceBX6i66h4xag/lleVtlMF3cxAxTXqYvV4lEWZ8RqBrs +-w3i7lWaI8gTlD3HVLRpMDaNzSua5lwphLzAvMwGitVGHtgVEHs5p54hsCyF+UOSi +-VKlRMfBqUwu+sMzNIcpwNP1DSuDjXL4BrtJgdUpZXgL2mL91xDSagx4CUg1QQeoB +-I3KFGkSssuWPa3qFSRrcLRgckJJf4jnqu5yGxB5F8CRMS65XnxAiLs74mtnC+5bA +-0aBwpLE2cerhKcC/iV8qvUUcTSV8ZB6h2gS0uh5lkZB/WHul+JU5M+Ls4a6/2uYS +-CZLBvt3H2qlZO4ro7uYWpamwM1hvPEEw7G4ke5iVbhADVw0obJfOC6UhykVE8y8G +-BdQVnsYxbK49IS4FrA+C5TBo2PfwlvwQTIxKqGoZEUscS+UUIavR/FgS0E80+9B7 +-hBbcF14z+NQWXSaJ+IClywdxo9dxETC8QQ1ntibQp5iasBzBdjVRoD8zxTxBA1nZ +-lhqrzuVLu8qO4tNZHLC0FS5eRCC+6htYB5e40zqZw8Qbi1OItqWHwag0xa5zDZpA +-OyyEbYZmecDxa16ZafZFOBNmIZeEv2hA9Kr10Rwbu2IqK14jVSczH0rwyxVzAAKL +-M28+YchHiA1aIY8MRqhKI7oqbtlgaPPU4DhZxcIkBNHqCC6RgKiX8GoI0RTolEAr +-4FpB5jmN7I7F61VL3+D8FywLlFK0WY97IdKktZV5r7K+oVgAl4rUuQcy2Q8LgSor +-xcGlQLc1KLjdQHDfYNkfCgL4Zk08OIAfBmNNw4HMcJCWAohK6GM/3G1XZE2/LMLo +-oU2lx86uoxTDKQVRQZHZFtb7+TmMnf18X8bWoAbX7fW4DMuVNAG8btimJF+/E4E4 +-eJjAJdE8B5NvuKkwCqx5vnMwQBahVsUsQ9ktURciUhqJh2j8S+6ypmv3GaqYTFIN +-DAb2X5gmpA/3cUMpsu73HWgwAKy+sOyr7g3suQS+alrdBmr9LIy90DYoHxLMqi0y +-ln3mEjhHAKt+dfiJS9269/J5iLVzzfUNfPGabx74hdgoGm3ay8y8JyQ5PAX0v65i +-E1/V/wDReDuUmhrUMe/PiOqnC4mDXQZA8yjE5lxVmXquaXCjmQ/QTcViRo9HYWf1 +-M5JrBV0mEfCQ1RXg/CIjJVjMDgNLxiDWQR5S9H5gca9Rw1nFuBzEj9PUJmQEA8IC +-cQkAWAsbEyspLegl/lyeSOvvyu119kDOzHkf/iVr1KlQBNZJXB7VmBXOPivhUjoM +-r0dxTjwCRv2j7gDMnNMYb9ofcYAORk0X8WTE26+UundxM4iGVlEi2wo/mNeFB8Ee +-VwolAv8Asx9Il/6xpCnIDmjbBo5ByVWTrQOXmFYQYUPCUH9Rgko2WPuNJAoxA4LG +-Z9TI7MeX9e473cWakyll7LMSiQ2DDq5eoGG02aKx6OIUUxRqOLIItjbYxzB9QdPv +-MsQfFfApzVLrMC4YJuV4WrxZx5lAwKehU9lcBFEgLrJPG7+iBAcla2bKzTn78RMC +-U0U1cXUg4GpZ200ZPSZ/Us4C0geWmP6jIrRcXk/5UqK7NLHzbf8ACUskUPLxiE1c +-ewndJvzGdRhbLDq4iE8UQLzHAUyLpmEQ57XsgYYUWX4snZPIz9mP7HpIsNt76l5w +-obCXhs/EU/1GuItRXLmeZgs0+Dc+rOSM0KgxicvC3+oWy7j2o/UYFrN87IDkQwb6 +-lFANIeInIwRIlzy8PRUW3Of2NP8AqOsDrJ/NI6UCu1aYXouqYfcqE0EsQaaouXgS +-XQ5H/wBcqxrAXqJkMMvqCqDC0ZPcum4Vp3KlzelObl7utHN3HKsNXtH/AM8QLL+p +-Qt964gsZxZQAwa+DcNwa5wJqht/QH6jqnGZof3EUocMdnIx5gDHqNue0bLQ4bjBH +-BqUOFZYWgGcXcsis25yRqBbQqyLcw4zuUa2XmcXhuHwi1b5uVnJogKrVbNxGfo91 +-AVukIYjVujeDqZyJcvzCwaLruWAbv+fNxg7v4NQHXwpTbGmtwK9GA5aauCmHKAFI +-hGKro5ioOmZR3gVKXpTGDhcYVP54lEyuih+4nEo4rwojheAyNwgRFN1EJKzliRFL +-c0fyZrk6p1Frtys1/wDky5hhbzGaFRbNzSPH1mUGU2L3/wDWNT3VHyazxAwBemGv +-gW9/BVltdQYw4S7ePLpPbshiuu5w2jYaR02R7FVzoV6v9I6XgxKcQ2UKKGDTRh6l +-OCsNkb4wbV/Igbto58ECDKA2QfElWj7jmZAo1/JwYQwU4QPqrvtXzGdzqAPcsR8R +-4SktFu/QPEyJXn31LSUy8R4ej/EFlRIPwofBiAZVPg1Dco8/Cof29Te2yj7KC/cR +-JHRCby5CyvCwSsAKgON8RwsnbdTb4SutFX8EHtTY5/7MvhFgRx6gAQwFyD4mRkAu +-2KaKy2RjMxN6W8ROYNCwu4Pstu1TUSeotajNg5E5Qzth5gatATQ5I4GtJfEzpeTe +-FP6J9Q3qFxGq7jjRiFUMjdZM/wCHR86RViCIbljP1v6mcYVaxX4/hBwBxdQHiNVk +-sD+llEbwAcf+sjs0gmhdxNXpUw7TuEZiOY2Drq4Ehayt0K5lnxEjwupYxbbY3Wps +-qKlvNej+y2eKxuLemDM0v23OaAxSKvNMXxM7aza+bjiMh1PEPfIFbTR+ahvGi3yv +-f5WACykyxXUSLi3BlwDv4VfA0ws+NIl5tE5IwtQBHIGOh0fslxJoAV48wrDWTpKG +-QpvYReWFguAqCPj+hkHk5jCnQQBdTwGolWXgrVntvUdGyCUpeM87lO+DBUaS361L +-ou5UGAiX6b+pTryHd1U9lGGUrfk8U8sQQUGVoBDXQHHuJcgPCLv2c+pUuy/iKU0I +-i/oX/UpX4Aok/hz8V87/ABp8fT8wK19/pAtBNZ/cBEnMhwEBhA2eGFFWm1GzucHE +-m4xxZCZ4H8YmyDrvoI5KtIiGDTUTg4ntGWvqKaxFsHJ4jIMDNpoPxFe28uPqWpBV +-Hm/MtGBTyrB7iGUn6dB6DEWC/ua7ghrmVCB0Q3EMZ+4e819fAbJfwNRm5dQ1GMpC +-7DVlSoHk4UdoFOGNjuUxQ8q+dQgxc3d68RgoC0KIqSm4vACYLg23H/VxMakqvIOA +-/Mp5hVLBTcojWOBhB6LLvf8A1YyFFWi3cC202201Jlxx1IlIUttl5DZHbDcWw+9g +-+Bz8XDcFI7JhUzipAzwcrwF4lIic6gvkKafEDjj8RCLjpWYumKWgPGo4hgOK3DGV +-wJj9RMgcjzXEeltoYOiWZd84EywYEUtQGvvJf7HJbNaG4bJW8mvZOLgH4ITOpoNr +-14jqK5c1CqGMFpZ1dQqKVtXwOJcuOrjRshq6lwayxs3CC06X6b3eY8hshtgX8Zv/ +-AEfkgvs2vEnOATZHRRrX3Li6DbzL7Dgw8yqlDKwxzZtGAMRECvM6RGoz7ZYrgqlo +-HllgCWN3HmX2+EjeBYzqI5OL8l8GCbGswCU7gBDnEzm29XOJx4z8U/lj4r41K1y+ +-C9vUNvgq/SFuZZfDf+opQARaUPoD6mG0wLvBl4CnprTA5sBzyGYKI8QnQPBmEs3g +-c/zKrGmBYd6TiQyYbgW3NRBr/bW49hBpeWyDFlohuvUXbwIuzggKE7OFHUOAWp5v +-s8y3KqevxB4BNrZLtOoMXTU1SwwqXmVLqWQUBz3DZInTBYNiV/JkApDI4+1+luKT +-nAicBVPoJRsDWtFsvI5rnJzG0uq5VbbXDzM9AnZMsPuoN5EDxK2B3y+5wtFtleIg +-bNYZPqKGDo1tccwOE3K83ElZu6fPuXeMDKvqu4a3OVrzeWGA5tB7sCGjBzg0krOs +-yOY7x/YVI61ACJRsGwdBLXxLMSw7xBY8OiFUk0xuG1WBty9o3hZQtCR4u0a1gALk +-eZsfg9kEY6E2mlq1pv6qOmbTsvSdj3CqFGXMKygfpgAKV25v/kr2znH+4pbBq4Zc +-A2hevzLJcWpdEuVIbev7l3Wk5YivILFqNnUq+oZayoF6NSnVZ6l06TDTMLqOLUx/ +-8lF9GHzBQdSwj1KUXrmXBpjEcymPBhbaRy9S649kdweVQtXSP3SQuFSjROWZfjtL +-NFjRfUFHPe97dw3+1+yOcI7EgtkM3z+IdAs6jHL2ZlmFefMqQaJtV+o22HkLKeQG +-E0zhsWl3fuWvzjMxpTz91BrqKmACJlghXRcAx7ov/wB6jwsFGrxDUMgh3CgcolkK +-1lMuefkzcA2xRjKg4QyLLN8wYS7rpj6jErW2CvTfsO4H/wBLYbJgO3eCCMowhEFL +-OBjFUUn5jY/MaQOQWHj15I3CKbwlwS2UlgE3zBnOvUxfhx1KApcA8S5LpRlFZzAD +-TYxlHao802n4lj2ZjLleJYqVlb1WMP5iJZidCYZZBMOfEAqU3iAkBQUc1EbVqbFA +-8T//2cLBdwQTAQgAIQUCUi4RRAIbAwULCQgHAwUVCgkICwUWAgMBAAIeAQIXgAAK +-CRBgAjO6nlTcYXZsD/9LwwWCLX8L3x69XjapEEDnjrZfAIFNCxFw/bMT36nUvLTd +-+brREjp/NDlNexdVR48q3yZ64dao13t0FAJJzddIQ6R0flaJ+lx0lFihXWO6aX9F +-kN8KKWQyhUPuhKRLHiY5DN1feGKiGe+3jiAkWQfpQgU2m+ayiGfe9/xAmIzSfkf0 +-tHYnWJ1eVQsE/egHUN+6rCRuhNOsGAZZc32r1qv2UkjSysnCoMvHytXFNSCCyKzQ +-8vkGs6t3netH3OGNLxbrxHzsXhzXRpdkDuDhqpZCaxIkq9lZUHit2JIzQF0FCAlS +-J0byfpp8uYW6gaJuQPaJMPgGA0/tJmDBQ0gI5iKedxUFaj7JJVr07EqR+8viVCKN +-AT2ad0RRDRTMwWcNZoeeC0ZybJIP/Qr4y5OGE1NiPOzmzysly9IBzNNvQPxF5Di9 +-c3CQOsRJswErP0CbIuU1Zay9MU0psAeXueK/k9qnjqKOjYp4nyBcGvxIAbLLvuoh +-kbL6HhnmNGhJpEyn/BR8WGQjcI8i3vzumEFjEqPxv5zEWUkD8roMZ6AHLKqJ8qw3 +-5eFBgPb7J1/Fs9v8ZyTtmir+f2nuJUl83gKdFPwB7lq+5T9WSivgO7U3mwinZIKk +-3h2T6llHnwfUp8vOG+EPYeduVBGFYNNpzh22oApGh/9o5ahNstR+5KcTGe1sDs7B +-TQRSLgypARAA6md1gnClZCkm5jR9wLF/sS+jZs2GT33kg2sdEyGqxDwqCH4dXX5G +-5KMRuLuqDG/fa7Ybzb713qleJAV+y4qqJ9RdLoySnhmZImNQY171f1NjBA89weC2 +-s8tq7986Qimeo3wwkrctYeGVIYcX6mZaksAZjM1rstzMRep2KVQDGHLiDTMMnWR/ +-QU/xEgURrGdHoXmqgP3idFEaeGepFmABdSihTkV3tYUfgdytPxCryCOtub4n4Fei +-ZQK+eNJxPGNx2cUwRKNWc0T7NMu6IpUW/bm5P+K1mbZL4zoB5wffMCSCrnjrHuHG +-vQ9GbCsRXYR9EgKs6HprVOmLGwz2pTqW+rAsghqzvPzvXaCpsmtBJcWTdt/CoZUi +-+TInhDgI+MKviuroBgzkR539SGDPoEFaSFmVhI6u/G6CV8c/i2wP81GvPvgrcnS1 +-FFj+q0jfaTLgPmiHiI7r3ZhT9Crj5JfJ1Xmf7vgzxg7BZT58lGp5zDLJCxC8E5Bq +-wgFDU8/BCAxR4NHqk1B/BYCl0a0+KI3CZGv64uqFBiN+qnd9oRpY8jUdwJ2Gf0Vv +-LbiHqPTVFZkDuZSZjJjIgCr7TNTxBaE1WG+wD0/ePIIdfIX4REDUiXzuVgexFSZ/ +-8tR48eaieASASc1JnTgZSkM3+kG/hbgOP+Oh6/P19pp55oEM+9ilnnkAEQEAAcLB +-XwQYAQgACQUCUi4MqQIbDAAKCRBgAjO6nlTcYbI4D/9l52AWRRgwuXA9kyL3/Lbn +-xf62P1OF4pU3Z940Dpnr1svdu5I+OzjxYDOOEk/QD1uzG7f0fPlCJkowFE3gQ6Pt +-j3Yp+XBPGk2Lg5PeGQs0NgWy1CD4XKAQ5CLHIbXTmpVdEnytCWG6+ikmAAFnUBi+ +-1YEIujRj6tMSfyb/gg0g7DLmKtB03MoPnlaLDJrkOfzEsBcfH+ucV/sSw5bxXaKW +-5XwJENwjI2ZLUgLMdJVv78Qz34hDkoGW7ywlqFxH0FAUkezi60y6UUAiD23h3nPE +-DAKi6yq6nbgNMYMYsVZ9t2u+uW8DZe8wf9H8neK3P1YSV5X5+6Jy2UHYR6+lTQ5I +-8SwqmJB0jZL1xMAypxdxSwwhQ33DhxQEXtajvYewQUk5xLFgm/5ihgz9vjX5UCUC +-HpAgHW/KI+7ObXYns1i64M2iGXobo7XCxZEIhWt6C5htXgdQkbgoiBB6LMXYf69Q +-zRtHqU4zOKDx+keuiwRWVpztqIAJkaa5qNKcKuzAYaQudRG4KIDhR/LR2a0Oa4x5 +-G6iLfFxOpkomzVSq/gMuw5yvrgOkEBYngUk7usMtmXzc9RvDCqGE2r6so2CkyQYt +-2bkpZcQWPe9wmkXublNloSXAZZB790Lrev69CWnP1InjCwxV/IsR+6KEnr6l/LEg +-OFG1blGjl1a9GsGFArw9HQ== +-=eI5g +------END PGP PUBLIC KEY BLOCK----- +diff -Nru mesa-25.3.3/meson.build mesa-25.3.3/meson.build +--- mesa-25.3.3/meson.build 2026-01-01 13:34:04.000000000 -0500 ++++ mesa-25.3.3/meson.build 2026-05-28 22:15:49.000000000 -0500 +@@ -33,6 +33,8 @@ + cpp = meson.get_compiler('cpp') + fs = import('fs') + ++vulkan_manifest_suffix = 'json' ++ + sizeof_pointer = cc.sizeof('void*').to_string() + + null_dep = dependency('', required : false) +diff -Nru mesa-25.3.3/.pc/applied-patches mesa-25.3.3/.pc/applied-patches +--- mesa-25.3.3/.pc/applied-patches 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/.pc/applied-patches 2026-05-28 22:16:26.000000000 -0500 +@@ -0,0 +1,3 @@ ++define-vulkan_manifest_suffix-global.patch ++CVE-2026-40393-nir.patch ++CVE-2026-40393-spirv.patch +diff -Nru mesa-25.3.3/.pc/CVE-2026-40393-nir.patch/src/compiler/nir/nir_functions.c mesa-25.3.3/.pc/CVE-2026-40393-nir.patch/src/compiler/nir/nir_functions.c +--- mesa-25.3.3/.pc/CVE-2026-40393-nir.patch/src/compiler/nir/nir_functions.c 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/.pc/CVE-2026-40393-nir.patch/src/compiler/nir/nir_functions.c 2026-05-28 22:16:26.000000000 -0500 +@@ -0,0 +1,570 @@ ++/* ++ * Copyright © 2015 Intel Corporation ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a ++ * copy of this software and associated documentation files (the "Software"), ++ * to deal in the Software without restriction, including without limitation ++ * the rights to use, copy, modify, merge, publish, distribute, sublicense, ++ * and/or sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice (including the next ++ * paragraph) shall be included in all copies or substantial portions of the ++ * Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ++ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS ++ * IN THE SOFTWARE. ++ */ ++ ++#include "util/u_printf.h" ++#include "nir.h" ++#include "nir_builder.h" ++#include "nir_control_flow.h" ++#include "nir_vla.h" ++ ++/* ++ * TODO: write a proper inliner for GPUs. ++ * This heuristic just inlines small functions, ++ * and tail calls get inlined as well. ++ */ ++static bool ++nir_function_can_inline(nir_function *function) ++{ ++ bool can_inline = true; ++ if (!function->should_inline) { ++ if (function->impl) { ++ nir_foreach_block(block, function->impl) { ++ nir_foreach_instr(instr, block) { ++ if (instr->type != nir_instr_type_intrinsic) ++ continue; ++ nir_intrinsic_instr *intr = nir_instr_as_intrinsic(instr); ++ if (intr->intrinsic == nir_intrinsic_barrier) ++ return true; ++ } ++ } ++ ++ if (function->impl->num_blocks > 2) ++ can_inline = false; ++ if (function->impl->ssa_alloc > 45) ++ can_inline = false; ++ } ++ } ++ return can_inline; ++} ++ ++static bool ++function_ends_in_jump(nir_function_impl *impl) ++{ ++ nir_block *last_block = nir_impl_last_block(impl); ++ return nir_block_ends_in_jump(last_block); ++} ++ ++/* A cast is used to deref function in/out params. However the bindless ++ * textures spec allows both uniforms and functions temps to be passed to a ++ * function param defined the same way. To deal with this we need to update ++ * this when we inline and know what variable mode we are dealing with. ++ */ ++static void ++fixup_cast_deref_mode(nir_deref_instr *deref) ++{ ++ nir_deref_instr *parent = nir_src_as_deref(deref->parent); ++ if (parent && deref->modes & nir_var_function_temp) { ++ if (parent->modes & nir_var_uniform) { ++ deref->modes |= nir_var_uniform; ++ } else if (parent->modes & nir_var_image) { ++ deref->modes |= nir_var_image; ++ } else if (parent->modes & nir_var_mem_ubo) { ++ deref->modes |= nir_var_mem_ubo; ++ } else if (parent->modes & nir_var_mem_ssbo) { ++ deref->modes |= nir_var_mem_ssbo; ++ } else ++ return; ++ ++ deref->modes ^= nir_var_function_temp; ++ ++ nir_foreach_use(use, &deref->def) { ++ if (nir_src_parent_instr(use)->type != nir_instr_type_deref) ++ continue; ++ ++ /* Recurse into children */ ++ fixup_cast_deref_mode(nir_instr_as_deref(nir_src_parent_instr(use))); ++ } ++ } ++} ++ ++nir_def * ++nir_inline_function_impl(struct nir_builder *b, ++ const nir_function_impl *impl, ++ nir_def **params, ++ struct hash_table *shader_var_remap) ++{ ++ nir_function_impl *copy = nir_function_impl_clone(b->shader, impl); ++ ++ exec_list_append(&b->impl->locals, ©->locals); ++ ++ /* Normally, NIR function returns are deref based, but for bindgen, we use a ++ * sideband here to let us lower derefs ahead-of-time. ++ */ ++ nir_def *ret_val = NULL; ++ ++ nir_foreach_block(block, copy) { ++ nir_foreach_instr_safe(instr, block) { ++ switch (instr->type) { ++ case nir_instr_type_deref: { ++ nir_deref_instr *deref = nir_instr_as_deref(instr); ++ ++ /* Note: This shouldn't change the mode of anything but the ++ * replaced nir_intrinsic_load_param intrinsics handled later in ++ * this switch table. Any incorrect modes should have already been ++ * detected by previous nir_vaidate calls. ++ */ ++ if (deref->deref_type == nir_deref_type_cast) { ++ fixup_cast_deref_mode(deref); ++ break; ++ } ++ ++ if (deref->deref_type != nir_deref_type_var) ++ break; ++ ++ /* We don't need to remap function variables. We already cloned ++ * them as part of nir_function_impl_clone and appended them to ++ * b->impl->locals. ++ */ ++ if (deref->var->data.mode == nir_var_function_temp) ++ break; ++ ++ /* If no map is provided, we assume that there are either no ++ * shader variables or they already live b->shader (this is the ++ * case for function inlining within a single shader. ++ */ ++ if (shader_var_remap == NULL) ++ break; ++ ++ struct hash_entry *entry = ++ _mesa_hash_table_search(shader_var_remap, deref->var); ++ if (entry == NULL) { ++ nir_variable *nvar = nir_variable_clone(deref->var, b->shader); ++ nir_shader_add_variable(b->shader, nvar); ++ entry = _mesa_hash_table_insert(shader_var_remap, ++ deref->var, nvar); ++ } ++ deref->var = entry->data; ++ break; ++ } ++ ++ case nir_instr_type_intrinsic: { ++ nir_intrinsic_instr *intr = nir_instr_as_intrinsic(instr); ++ if (intr->intrinsic == nir_intrinsic_bindgen_return) { ++ assert(ret_val == NULL && "expected exactly one return write"); ++ ret_val = intr->src[0].ssa; ++ nir_instr_remove(&intr->instr); ++ } else if (intr->intrinsic == nir_intrinsic_load_param) { ++ unsigned param_idx = nir_intrinsic_param_idx(intr); ++ assert(param_idx < impl->function->num_params); ++ nir_def_replace(&intr->def, params[param_idx]); ++ } ++ break; ++ } ++ ++ case nir_instr_type_jump: ++ /* Returns have to be lowered for this to work */ ++ assert(nir_instr_as_jump(instr)->type != nir_jump_return); ++ break; ++ ++ default: ++ break; ++ } ++ } ++ } ++ ++ bool nest_if = function_ends_in_jump(copy); ++ ++ /* Pluck the body out of the function and place it here */ ++ nir_cf_list body; ++ nir_cf_list_extract(&body, ©->body); ++ ++ if (nest_if) { ++ nir_if *cf = nir_push_if(b, nir_imm_true(b)); ++ nir_cf_reinsert(&body, nir_after_cf_list(&cf->then_list)); ++ nir_pop_if(b, cf); ++ } else { ++ /* Insert a nop at the cursor so we can keep track of where things are as ++ * we add/remove stuff from the CFG. ++ */ ++ nir_intrinsic_instr *nop = nir_nop(b); ++ nir_cf_reinsert(&body, nir_before_instr(&nop->instr)); ++ b->cursor = nir_instr_remove(&nop->instr); ++ } ++ ++ return ret_val; ++} ++ ++static bool inline_function_impl(nir_function_impl *impl, struct set *inlined); ++ ++static bool ++inline_functions_pass(nir_builder *b, ++ nir_instr *instr, ++ void *cb_data) ++{ ++ struct set *inlined = cb_data; ++ if (instr->type != nir_instr_type_call) ++ return false; ++ ++ nir_call_instr *call = nir_instr_as_call(instr); ++ if (!call->callee->impl) ++ return false; ++ ++ assert(!call->indirect_callee.ssa); ++ ++ if (b->shader->options->driver_functions && ++ b->shader->info.stage == MESA_SHADER_KERNEL) { ++ bool last_instr = (instr == nir_block_last_instr(instr->block)); ++ if (!nir_function_can_inline(call->callee) && !last_instr) { ++ return false; ++ } ++ } ++ ++ /* Make sure that the function we're calling is already inlined */ ++ inline_function_impl(call->callee->impl, inlined); ++ ++ b->cursor = nir_instr_remove(&call->instr); ++ ++ /* Rewrite all of the uses of the callee's parameters to use the call ++ * instructions sources. In order to ensure that the "load" happens ++ * here and not later (for register sources), we make sure to convert it ++ * to an SSA value first. ++ */ ++ const unsigned num_params = call->num_params; ++ NIR_VLA(nir_def *, params, num_params); ++ for (unsigned i = 0; i < num_params; i++) { ++ params[i] = call->params[i].ssa; ++ } ++ ++ nir_inline_function_impl(b, call->callee->impl, params, NULL); ++ return true; ++} ++ ++static bool ++inline_function_impl(nir_function_impl *impl, struct set *inlined) ++{ ++ if (_mesa_set_search(inlined, impl)) ++ return false; /* Already inlined */ ++ ++ bool progress; ++ progress = nir_function_instructions_pass(impl, inline_functions_pass, ++ nir_metadata_none, inlined); ++ if (progress) { ++ /* Indices are completely messed up now */ ++ nir_index_ssa_defs(impl); ++ } ++ ++ _mesa_set_add(inlined, impl); ++ ++ return progress; ++} ++ ++/** A pass to inline all functions in a shader into their callers ++ * ++ * For most use-cases, function inlining is a multi-step process. The general ++ * pattern employed by SPIR-V consumers and others is as follows: ++ * ++ * 1. nir_lower_variable_initializers(shader, nir_var_function_temp) ++ * ++ * This is needed because local variables from the callee are simply added ++ * to the locals list for the caller and the information about where the ++ * constant initializer logically happens is lost. If the callee is ++ * called in a loop, this can cause the variable to go from being ++ * initialized once per loop iteration to being initialized once at the ++ * top of the caller and values to persist from one invocation of the ++ * callee to the next. The simple solution to this problem is to get rid ++ * of constant initializers before function inlining. ++ * ++ * 2. nir_lower_returns(shader) ++ * ++ * nir_inline_functions assumes that all functions end "naturally" by ++ * execution reaching the end of the function without any return ++ * instructions causing instant jumps to the end. Thanks to NIR being ++ * structured, we can't represent arbitrary jumps to various points in the ++ * program which is what an early return in the callee would have to turn ++ * into when we inline it into the caller. Instead, we require returns to ++ * be lowered which lets us just copy+paste the callee directly into the ++ * caller. ++ * ++ * 3. nir_inline_functions(shader) ++ * ++ * This does the actual function inlining and the resulting shader will ++ * contain no call instructions. ++ * ++ * 4. nir_opt_deref(shader) ++ * ++ * Most functions contain pointer parameters where the result of a deref ++ * instruction is passed in as a parameter, loaded via a load_param ++ * intrinsic, and then turned back into a deref via a cast. Function ++ * inlining will get rid of the load_param but we are still left with a ++ * cast. Running nir_opt_deref gets rid of the intermediate cast and ++ * results in a whole deref chain again. This is currently required by a ++ * number of optimizations and lowering passes at least for certain ++ * variable modes. ++ * ++ * 5. Loop over the functions and delete all but the main entrypoint. ++ * ++ * In the Intel Vulkan driver this looks like this: ++ * ++ * nir_remove_non_entrypoints(nir); ++ * ++ * While nir_inline_functions does get rid of all call instructions, it ++ * doesn't get rid of any functions because it doesn't know what the "root ++ * function" is. Instead, it's up to the individual driver to know how to ++ * decide on a root function and delete the rest. With SPIR-V, ++ * spirv_to_nir returns the root function and so we can just use == whereas ++ * with GL, you may have to look for a function named "main". ++ * ++ * 6. nir_lower_variable_initializers(shader, ~nir_var_function_temp) ++ * ++ * Lowering constant initializers on inputs, outputs, global variables, ++ * etc. requires that we know the main entrypoint so that we know where to ++ * initialize them. Otherwise, we would have to assume that anything ++ * could be a main entrypoint and initialize them at the start of every ++ * function but that would clearly be wrong if any of those functions were ++ * ever called within another function. Simply requiring a single- ++ * entrypoint function shader is the best way to make it well-defined. ++ */ ++bool ++nir_inline_functions(nir_shader *shader) ++{ ++ struct set *inlined = _mesa_pointer_set_create(NULL); ++ bool progress = false; ++ ++ nir_foreach_function_impl(impl, shader) { ++ progress = inline_function_impl(impl, inlined) || progress; ++ } ++ ++ _mesa_set_destroy(inlined, NULL); ++ ++ return progress; ++} ++ ++struct lower_link_state { ++ struct hash_table *shader_var_remap; ++ const nir_shader *link_shader; ++ unsigned printf_index_offset; ++}; ++ ++static bool ++lower_calls_vars_instr(struct nir_builder *b, ++ nir_instr *instr, ++ void *cb_data) ++{ ++ struct lower_link_state *state = cb_data; ++ ++ switch (instr->type) { ++ case nir_instr_type_deref: { ++ nir_deref_instr *deref = nir_instr_as_deref(instr); ++ if (deref->deref_type != nir_deref_type_var) ++ return false; ++ if (deref->var->data.mode == nir_var_function_temp) ++ return false; ++ ++ assert(state->shader_var_remap); ++ struct hash_entry *entry = ++ _mesa_hash_table_search(state->shader_var_remap, deref->var); ++ if (entry == NULL) { ++ nir_variable *nvar = nir_variable_clone(deref->var, b->shader); ++ nir_shader_add_variable(b->shader, nvar); ++ entry = _mesa_hash_table_insert(state->shader_var_remap, ++ deref->var, nvar); ++ } ++ deref->var = entry->data; ++ break; ++ } ++ case nir_instr_type_call: { ++ nir_call_instr *ncall = nir_instr_as_call(instr); ++ if (!ncall->callee->name) ++ return false; ++ ++ nir_function *func = nir_shader_get_function_for_name(b->shader, ncall->callee->name); ++ if (func) { ++ ncall->callee = func; ++ break; ++ } ++ ++ nir_function *new_func; ++ new_func = nir_shader_get_function_for_name(state->link_shader, ncall->callee->name); ++ if (new_func) ++ ncall->callee = nir_function_clone(b->shader, new_func); ++ break; ++ } ++ case nir_instr_type_intrinsic: { ++ /* Reindex the offset of the printf intrinsic by the number of already ++ * present printfs in the shader where functions are linked into. ++ */ ++ if (state->printf_index_offset == 0) ++ return false; ++ ++ nir_intrinsic_instr *intrin = nir_instr_as_intrinsic(instr); ++ if (intrin->intrinsic != nir_intrinsic_printf) ++ return false; ++ ++ nir_intrinsic_set_fmt_idx(intrin, nir_intrinsic_fmt_idx(intrin) + state->printf_index_offset); ++ break; ++ } ++ default: ++ break; ++ } ++ return true; ++} ++ ++static bool ++lower_call_function_impl(struct nir_builder *b, ++ nir_function *callee, ++ const nir_function_impl *impl, ++ struct lower_link_state *state) ++{ ++ nir_function_impl *copy = nir_function_impl_clone(b->shader, impl); ++ copy->function = callee; ++ callee->impl = copy; ++ ++ return nir_function_instructions_pass(copy, ++ lower_calls_vars_instr, ++ nir_metadata_none, ++ state); ++} ++ ++static bool ++function_link_pass(struct nir_builder *b, ++ nir_instr *instr, ++ void *cb_data) ++{ ++ struct lower_link_state *state = cb_data; ++ ++ if (instr->type != nir_instr_type_call) ++ return false; ++ ++ nir_call_instr *call = nir_instr_as_call(instr); ++ nir_function *func = NULL; ++ ++ if (!call->callee->name) ++ return false; ++ ++ if (call->callee->impl) ++ return false; ++ ++ func = nir_shader_get_function_for_name(state->link_shader, call->callee->name); ++ if (!func || !func->impl) { ++ return false; ++ } ++ return lower_call_function_impl(b, call->callee, ++ func->impl, ++ state); ++} ++ ++bool ++nir_link_shader_functions(nir_shader *shader, ++ const nir_shader *link_shader) ++{ ++ void *ra_ctx = ralloc_context(NULL); ++ struct hash_table *copy_vars = _mesa_pointer_hash_table_create(ra_ctx); ++ bool progress = false, overall_progress = false; ++ ++ struct lower_link_state state = { ++ .shader_var_remap = copy_vars, ++ .link_shader = link_shader, ++ .printf_index_offset = shader->printf_info_count, ++ }; ++ /* do progress passes inside the pass */ ++ do { ++ progress = false; ++ nir_foreach_function_impl(impl, shader) { ++ bool this_progress = nir_function_instructions_pass(impl, ++ function_link_pass, ++ nir_metadata_none, ++ &state); ++ if (this_progress) ++ nir_index_ssa_defs(impl); ++ progress |= this_progress; ++ } ++ overall_progress |= progress; ++ } while (progress); ++ ++ if (overall_progress && link_shader->printf_info_count > 0) { ++ shader->printf_info = reralloc(shader, shader->printf_info, ++ u_printf_info, ++ shader->printf_info_count + ++ link_shader->printf_info_count); ++ ++ for (unsigned i = 0; i < link_shader->printf_info_count; i++) { ++ const u_printf_info *src_info = &link_shader->printf_info[i]; ++ u_printf_info *dst_info = &shader->printf_info[shader->printf_info_count++]; ++ ++ dst_info->num_args = src_info->num_args; ++ dst_info->arg_sizes = ralloc_array(shader, unsigned, dst_info->num_args); ++ memcpy(dst_info->arg_sizes, src_info->arg_sizes, ++ sizeof(dst_info->arg_sizes[0]) * dst_info->num_args); ++ ++ dst_info->string_size = src_info->string_size; ++ dst_info->strings = ralloc_memdup(shader, src_info->strings, ++ dst_info->string_size); ++ } ++ } ++ ++ ralloc_free(ra_ctx); ++ ++ return overall_progress; ++} ++ ++static void ++nir_mark_used_functions(struct nir_function *func, struct set *used_funcs); ++ ++static bool ++mark_used_pass_cb(struct nir_builder *b, ++ nir_instr *instr, void *data) ++{ ++ struct set *used_funcs = data; ++ if (instr->type != nir_instr_type_call) ++ return false; ++ nir_call_instr *call = nir_instr_as_call(instr); ++ ++ _mesa_set_add(used_funcs, call->callee); ++ ++ nir_mark_used_functions(call->callee, used_funcs); ++ return true; ++} ++ ++static void ++nir_mark_used_functions(struct nir_function *func, struct set *used_funcs) ++{ ++ if (func->impl) { ++ nir_function_instructions_pass(func->impl, ++ mark_used_pass_cb, ++ nir_metadata_none, ++ used_funcs); ++ } ++} ++ ++void ++nir_cleanup_functions(nir_shader *nir) ++{ ++ if (!nir->options->driver_functions) { ++ nir_remove_non_entrypoints(nir); ++ return; ++ } ++ ++ struct set *used_funcs = _mesa_set_create(NULL, _mesa_hash_pointer, ++ _mesa_key_pointer_equal); ++ foreach_list_typed_safe(nir_function, func, node, &nir->functions) { ++ if (func->is_entrypoint) { ++ _mesa_set_add(used_funcs, func); ++ nir_mark_used_functions(func, used_funcs); ++ } ++ } ++ foreach_list_typed_safe(nir_function, func, node, &nir->functions) { ++ if (!_mesa_set_search(used_funcs, func)) ++ exec_node_remove(&func->node); ++ } ++ _mesa_set_destroy(used_funcs, NULL); ++} +diff -Nru mesa-25.3.3/.pc/CVE-2026-40393-spirv.patch/src/compiler/spirv/spirv_to_nir.c mesa-25.3.3/.pc/CVE-2026-40393-spirv.patch/src/compiler/spirv/spirv_to_nir.c +--- mesa-25.3.3/.pc/CVE-2026-40393-spirv.patch/src/compiler/spirv/spirv_to_nir.c 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/.pc/CVE-2026-40393-spirv.patch/src/compiler/spirv/spirv_to_nir.c 2026-05-28 22:16:26.000000000 -0500 +@@ -0,0 +1,7691 @@ ++/* ++ * Copyright © 2015 Intel Corporation ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a ++ * copy of this software and associated documentation files (the "Software"), ++ * to deal in the Software without restriction, including without limitation ++ * the rights to use, copy, modify, merge, publish, distribute, sublicense, ++ * and/or sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice (including the next ++ * paragraph) shall be included in all copies or substantial portions of the ++ * Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ++ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS ++ * IN THE SOFTWARE. ++ * ++ * Authors: ++ * Faith Ekstrand (faith@gfxstrand.net) ++ * ++ */ ++ ++#include "glsl_types.h" ++#include "vtn_private.h" ++#include "nir/nir_vla.h" ++#include "nir/nir_control_flow.h" ++#include "nir/nir_constant_expressions.h" ++#include "nir/nir_deref.h" ++#include "spirv_info.h" ++#include "NonSemanticShaderDebugInfo100.h" ++ ++#include "util/format/u_format.h" ++#include "util/u_math.h" ++#include "util/u_string.h" ++#include "util/u_debug.h" ++#include "util/u_printf.h" ++#include "util/mesa-blake3.h" ++#include "util/bfloat.h" ++#include "util/float8.h" ++ ++#include ++ ++#ifndef PATH_MAX ++#define PATH_MAX 4096 ++#endif ++ ++/* Table of all implemented capabilities. These are the capabilities that are ++ * implemented in the spirv_to_nir, not what the device supports. ++ * ++ * This list should remain alphabetized. For the purposes of alphabetization, ++ * suffixes do not exist and 8 comes before 16. ++ */ ++static const struct spirv_capabilities implemented_capabilities = { ++ .Addresses = true, ++ .AtomicFloat16AddEXT = true, ++ .AtomicFloat32AddEXT = true, ++ .AtomicFloat64AddEXT = true, ++ .AtomicFloat16MinMaxEXT = true, ++ .AtomicFloat32MinMaxEXT = true, ++ .AtomicFloat64MinMaxEXT = true, ++ .AtomicStorage = true, ++ .BFloat16CooperativeMatrixKHR = true, ++ .BFloat16DotProductKHR = true, ++ .BFloat16TypeKHR = true, ++ .BitInstructions = true, ++ .ClipDistance = true, ++ .ComputeDerivativeGroupLinearKHR = true, ++ .ComputeDerivativeGroupQuadsKHR = true, ++ .CooperativeMatrixKHR = true, ++ .CooperativeMatrixConversionsNV = true, ++ .CoreBuiltinsARM = true, ++ .CullDistance = true, ++ .DemoteToHelperInvocation = true, ++ .DenormFlushToZero = true, ++ .DenormPreserve = true, ++ .DerivativeControl = true, ++ .DeviceGroup = true, ++ .DotProduct = true, ++ .DotProductInput4x8Bit = true, ++ .DotProductInput4x8BitPacked = true, ++ .DotProductInputAll = true, ++ .DrawParameters = true, ++ .ExpectAssumeKHR = true, ++ .Float8EXT = true, ++ .Float8CooperativeMatrixEXT = true, ++ .Float16 = true, ++ .Float16Buffer = true, ++ .Float64 = true, ++ .FloatControls2 = true, ++ .FragmentBarycentricKHR = true, ++ .FragmentDensityEXT = true, ++ .FragmentFullyCoveredEXT = true, ++ .FragmentMaskAMD = true, ++ .FragmentShaderPixelInterlockEXT = true, ++ .FragmentShaderSampleInterlockEXT = true, ++ .FragmentShadingRateKHR = true, ++ .GenericPointer = true, ++ .Geometry = true, ++ .GeometryPointSize = true, ++ .GeometryStreams = true, ++ .GroupNonUniform = true, ++ .GroupNonUniformArithmetic = true, ++ .GroupNonUniformBallot = true, ++ .GroupNonUniformClustered = true, ++ .GroupNonUniformQuad = true, ++ .GroupNonUniformRotateKHR = true, ++ .GroupNonUniformShuffle = true, ++ .GroupNonUniformShuffleRelative = true, ++ .GroupNonUniformVote = true, ++ .Groups = true, ++ .GroupUniformArithmeticKHR = true, ++ .Image1D = true, ++ .ImageBasic = true, ++ .ImageBuffer = true, ++ .ImageCubeArray = true, ++ .ImageGatherBiasLodAMD = true, ++ .ImageGatherExtended = true, ++ .ImageMipmap = true, ++ .ImageMSArray = true, ++ .ImageQuery = true, ++ .ImageReadWrite = true, ++ .ImageReadWriteLodAMD = true, ++ .ImageRect = true, ++ .InputAttachment = true, ++ .InputAttachmentArrayDynamicIndexingEXT = true, ++ .InputAttachmentArrayNonUniformIndexingEXT = true, ++ .Int8 = true, ++ .Int16 = true, ++ .Int64 = true, ++ .Int64Atomics = true, ++ .Int64ImageEXT = true, ++ .IntegerFunctions2INTEL = true, ++ .InterpolationFunction = true, ++ .Kernel = true, ++ .Linkage = true, ++ .LiteralSampler = true, ++ .Matrix = true, ++ .MeshShadingEXT = true, ++ .MeshShadingNV = true, ++ .MinLod = true, ++ .MultiView = true, ++ .MultiViewport = true, ++ .OptNoneINTEL = true, // FIXME: make codegen emit the EXT name ++ .PerViewAttributesNV = true, ++ .PhysicalStorageBufferAddresses = true, ++ .QuadControlKHR = true, ++ .RayCullMaskKHR = true, ++ .RayQueryKHR = true, ++ .RayQueryPositionFetchKHR = true, ++ .RayTracingKHR = true, ++ .RayTracingPositionFetchKHR = true, ++ .RayTraversalPrimitiveCullingKHR = true, ++ .ReplicatedCompositesEXT = true, ++ .RoundingModeRTE = true, ++ .RoundingModeRTZ = true, ++ .RuntimeDescriptorArrayEXT = true, ++ .Sampled1D = true, ++ .SampledBuffer = true, ++ .SampledCubeArray = true, ++ .SampledImageArrayDynamicIndexing = true, ++ .SampledImageArrayNonUniformIndexingEXT = true, ++ .SampledRect = true, ++ .SampleMaskPostDepthCoverage = true, ++ .SampleRateShading = true, ++ .Shader = true, ++ .ShaderClockKHR = true, ++ .ShaderEnqueueAMDX = true, ++ .ShaderLayer = true, ++ .ShaderNonUniformEXT = true, ++ .ShaderSMBuiltinsNV = true, ++ .ShaderViewportIndex = true, ++ .ShaderViewportIndexLayerEXT = true, ++ .ShaderViewportMaskNV = true, ++ .SignedZeroInfNanPreserve = true, ++ .SparseResidency = true, ++ .StencilExportEXT = true, ++ .StorageBuffer8BitAccess = true, ++ .StorageBufferArrayDynamicIndexing = true, ++ .StorageBufferArrayNonUniformIndexingEXT = true, ++ .StorageImageArrayDynamicIndexing = true, ++ .StorageImageArrayNonUniformIndexingEXT = true, ++ .StorageImageExtendedFormats = true, ++ .StorageImageMultisample = true, ++ .StorageImageReadWithoutFormat = true, ++ .StorageImageWriteWithoutFormat = true, ++ .StorageInputOutput16 = true, ++ .StoragePushConstant8 = true, ++ .StoragePushConstant16 = true, ++ .StorageTexelBufferArrayDynamicIndexingEXT = true, ++ .StorageTexelBufferArrayNonUniformIndexingEXT = true, ++ .StorageUniform16 = true, ++ .StorageUniformBufferBlock16 = true, ++ .SubgroupBallotKHR = true, ++ .SubgroupBufferBlockIOINTEL = true, ++ .SubgroupShuffleINTEL = true, ++ .SubgroupVoteKHR = true, ++ .Tessellation = true, ++ .TessellationPointSize = true, ++ .TransformFeedback = true, ++ .UniformAndStorageBuffer8BitAccess = true, ++ .UniformBufferArrayDynamicIndexing = true, ++ .UniformBufferArrayNonUniformIndexingEXT = true, ++ .UniformDecoration = true, ++ .UniformTexelBufferArrayDynamicIndexingEXT = true, ++ .UniformTexelBufferArrayNonUniformIndexingEXT = true, ++ .UntypedPointersKHR = true, ++ .VariablePointers = true, ++ .VariablePointersStorageBuffer = true, ++ .Vector16 = true, ++ .VulkanMemoryModel = true, ++ .VulkanMemoryModelDeviceScope = true, ++ .WorkgroupMemoryExplicitLayoutKHR = true, ++ .WorkgroupMemoryExplicitLayout8BitAccessKHR = true, ++ .WorkgroupMemoryExplicitLayout16BitAccessKHR = true, ++}; ++ ++uint32_t mesa_spirv_debug = 0; ++ ++static const struct debug_named_value mesa_spirv_debug_control[] = { ++ { "structured", MESA_SPIRV_DEBUG_STRUCTURED, ++ "Print information of the SPIR-V structured control flow parsing" }, ++ { "values", MESA_SPIRV_DEBUG_VALUES, ++ "Print information of the SPIR-V values" }, ++ { "asm", MESA_SPIRV_DEBUG_ASM, "Print the SPIR-V assembly" }, ++ { "color", MESA_SPIRV_DEBUG_COLOR, "Debug in color, if available" }, ++ DEBUG_NAMED_VALUE_END, ++}; ++ ++DEBUG_GET_ONCE_FLAGS_OPTION(mesa_spirv_debug, "MESA_SPIRV_DEBUG", mesa_spirv_debug_control, 0) ++ ++/* DO NOT CALL THIS FUNCTION DIRECTLY. Use mesa_spirv_debug_init() instead */ ++static void ++initialize_mesa_spirv_debug(void) ++{ ++ mesa_spirv_debug = debug_get_option_mesa_spirv_debug(); ++} ++ ++static void ++mesa_spirv_debug_init(void) ++{ ++ static once_flag initialized_debug_flag = ONCE_FLAG_INIT; ++ call_once(&initialized_debug_flag, initialize_mesa_spirv_debug); ++} ++ ++#ifndef NDEBUG ++static enum nir_spirv_debug_level ++vtn_default_log_level(void) ++{ ++ enum nir_spirv_debug_level level = NIR_SPIRV_DEBUG_LEVEL_WARNING; ++ const char *vtn_log_level_strings[] = { ++ [NIR_SPIRV_DEBUG_LEVEL_WARNING] = "warning", ++ [NIR_SPIRV_DEBUG_LEVEL_INFO] = "info", ++ [NIR_SPIRV_DEBUG_LEVEL_ERROR] = "error", ++ }; ++ const char *str = getenv("MESA_SPIRV_LOG_LEVEL"); ++ ++ if (str == NULL) ++ return level; ++ ++ for (int i = 0; i < ARRAY_SIZE(vtn_log_level_strings); i++) { ++ if (strcasecmp(str, vtn_log_level_strings[i]) == 0) { ++ level = i; ++ break; ++ } ++ } ++ ++ return level; ++} ++#endif ++ ++void ++vtn_log(struct vtn_builder *b, enum nir_spirv_debug_level level, ++ size_t spirv_offset, const char *message) ++{ ++ if (b->options->debug.func) { ++ b->options->debug.func(b->options->debug.private_data, ++ level, spirv_offset, message); ++ } ++ ++#ifndef NDEBUG ++ static enum nir_spirv_debug_level default_level = ++ NIR_SPIRV_DEBUG_LEVEL_INVALID; ++ ++ if (default_level == NIR_SPIRV_DEBUG_LEVEL_INVALID) ++ default_level = vtn_default_log_level(); ++ ++ if (level >= default_level) ++ fprintf(stderr, "%s\n", message); ++#endif ++} ++ ++void ++vtn_logf(struct vtn_builder *b, enum nir_spirv_debug_level level, ++ size_t spirv_offset, const char *fmt, ...) ++{ ++ va_list args; ++ char *msg; ++ ++ va_start(args, fmt); ++ msg = ralloc_vasprintf(NULL, fmt, args); ++ va_end(args); ++ ++ vtn_log(b, level, spirv_offset, msg); ++ ++ ralloc_free(msg); ++} ++ ++static void ++vtn_log_err(struct vtn_builder *b, ++ enum nir_spirv_debug_level level, const char *prefix, ++ const char *file, unsigned line, ++ const char *fmt, va_list args) ++{ ++ char *msg; ++ ++ msg = ralloc_strdup(NULL, prefix); ++ ++#ifndef NDEBUG ++ ralloc_asprintf_append(&msg, " In file %s:%u\n", file, line); ++#endif ++ ++ ralloc_asprintf_append(&msg, " "); ++ ++ ralloc_vasprintf_append(&msg, fmt, args); ++ ++ ralloc_asprintf_append(&msg, "\n %zu bytes into the SPIR-V binary", ++ b->spirv_offset); ++ ++ if (b->file) { ++ ralloc_asprintf_append(&msg, ++ "\n in SPIR-V source file %s, line %d, col %d", ++ b->file, b->line, b->col); ++ } ++ ++ vtn_log(b, level, b->spirv_offset, msg); ++ ++ ralloc_free(msg); ++} ++ ++static void ++vtn_dump_shader(struct vtn_builder *b, const char *path, const char *name) ++{ ++ char filename[PATH_MAX]; ++ const char* stage_ext = _mesa_shader_stage_to_file_ext(b->entry_point_stage); ++ int len = snprintf(filename, sizeof(filename), "%s/0x%s.%s", ++ path, name, stage_ext); ++ if (len < 0 || len >= sizeof(filename)) ++ return; ++ ++ FILE *f = fopen(filename, "wb"); ++ if (f == NULL) ++ return; ++ ++ fwrite(b->spirv, sizeof(*b->spirv), b->spirv_word_count, f); ++ fclose(f); ++ ++ vtn_info("SPIR-V shader dumped to %s", filename); ++} ++ ++void ++_vtn_warn(struct vtn_builder *b, const char *file, unsigned line, ++ const char *fmt, ...) ++{ ++ va_list args; ++ ++ va_start(args, fmt); ++ vtn_log_err(b, NIR_SPIRV_DEBUG_LEVEL_WARNING, "SPIR-V WARNING:\n", ++ file, line, fmt, args); ++ va_end(args); ++} ++ ++void ++_vtn_err(struct vtn_builder *b, const char *file, unsigned line, ++ const char *fmt, ...) ++{ ++ va_list args; ++ ++ va_start(args, fmt); ++ vtn_log_err(b, NIR_SPIRV_DEBUG_LEVEL_ERROR, "SPIR-V ERROR:\n", ++ file, line, fmt, args); ++ va_end(args); ++} ++ ++void ++_vtn_fail(struct vtn_builder *b, const char *file, unsigned line, ++ const char *fmt, ...) ++{ ++ va_list args; ++ ++ if (MESA_SPIRV_DEBUG(VALUES)) ++ vtn_dump_values(b, stderr); ++ ++ va_start(args, fmt); ++ vtn_log_err(b, NIR_SPIRV_DEBUG_LEVEL_ERROR, "SPIR-V parsing FAILED:\n", ++ file, line, fmt, args); ++ va_end(args); ++ ++ const char *dump_path = secure_getenv("MESA_SPIRV_FAIL_DUMP_PATH"); ++ if (dump_path) ++ vtn_dump_shader(b, dump_path, "fail"); ++ ++#ifndef NDEBUG ++ if (!b->options->skip_os_break_in_debug_build) ++ os_break(); ++#endif ++ ++ vtn_longjmp(b->fail_jump, 1); ++} ++ ++const char * ++vtn_value_type_to_string(enum vtn_value_type t) ++{ ++#define CASE(typ) case vtn_value_type_##typ: return #typ ++ switch (t) { ++ CASE(invalid); ++ CASE(undef); ++ CASE(string); ++ CASE(decoration_group); ++ CASE(type); ++ CASE(constant); ++ CASE(pointer); ++ CASE(function); ++ CASE(block); ++ CASE(ssa); ++ CASE(extension); ++ CASE(image_pointer); ++ } ++#undef CASE ++ UNREACHABLE("unknown value type"); ++ return "UNKNOWN"; ++} ++ ++static const char * ++vtn_base_type_to_string(enum vtn_base_type t) ++{ ++#define CASE(typ) case vtn_base_type_##typ: return #typ ++ switch (t) { ++ CASE(void); ++ CASE(scalar); ++ CASE(vector); ++ CASE(matrix); ++ CASE(array); ++ CASE(struct); ++ CASE(pointer); ++ CASE(image); ++ CASE(sampler); ++ CASE(sampled_image); ++ CASE(accel_struct); ++ CASE(ray_query); ++ CASE(function); ++ CASE(event); ++ CASE(cooperative_matrix); ++ } ++#undef CASE ++ UNREACHABLE("unknown base type"); ++ return "UNKNOWN"; ++} ++ ++ ++void ++_vtn_fail_value_type_mismatch(struct vtn_builder *b, uint32_t value_id, ++ enum vtn_value_type value_type) ++{ ++ struct vtn_value *val = vtn_untyped_value(b, value_id); ++ vtn_fail( ++ "SPIR-V id %u is the wrong kind of value: " ++ "expected '%s' but got '%s'", ++ vtn_id_for_value(b, val), ++ vtn_value_type_to_string(value_type), ++ vtn_value_type_to_string(val->value_type)); ++} ++ ++void _vtn_fail_value_not_pointer(struct vtn_builder *b, ++ uint32_t value_id) ++{ ++ struct vtn_value *val = vtn_untyped_value(b, value_id); ++ vtn_fail("SPIR-V id %u is the wrong kind of value: " ++ "expected 'pointer' OR null constant but got " ++ "'%s' (%s)", value_id, ++ vtn_value_type_to_string(val->value_type), ++ val->is_null_constant ? "null constant" : "not null constant"); ++} ++ ++static struct vtn_ssa_value * ++vtn_undef_ssa_value(struct vtn_builder *b, const struct glsl_type *type) ++{ ++ struct vtn_ssa_value *val = vtn_zalloc(b, struct vtn_ssa_value); ++ val->type = glsl_get_bare_type(type); ++ ++ if (glsl_type_is_cmat(type)) { ++ nir_deref_instr *mat = vtn_create_cmat_temporary(b, type, "cmat_undef"); ++ vtn_set_ssa_value_var(b, val, mat->var); ++ } else if (glsl_type_is_vector_or_scalar(type)) { ++ unsigned num_components = glsl_get_vector_elements(val->type); ++ unsigned bit_size = glsl_get_bit_size(val->type); ++ val->def = nir_undef(&b->nb, num_components, bit_size); ++ } else { ++ unsigned elems = glsl_get_length(val->type); ++ val->elems = vtn_alloc_array(b, struct vtn_ssa_value *, elems); ++ if (glsl_type_is_array_or_matrix(type)) { ++ const struct glsl_type *elem_type = glsl_get_array_element(type); ++ for (unsigned i = 0; i < elems; i++) ++ val->elems[i] = vtn_undef_ssa_value(b, elem_type); ++ } else { ++ vtn_assert(glsl_type_is_struct_or_ifc(type)); ++ for (unsigned i = 0; i < elems; i++) { ++ const struct glsl_type *elem_type = glsl_get_struct_field(type, i); ++ val->elems[i] = vtn_undef_ssa_value(b, elem_type); ++ } ++ } ++ } ++ ++ return val; ++} ++ ++struct vtn_ssa_value * ++vtn_const_ssa_value(struct vtn_builder *b, nir_constant *constant, ++ const struct glsl_type *type) ++{ ++ struct vtn_ssa_value *val = vtn_zalloc(b, struct vtn_ssa_value); ++ val->type = glsl_get_bare_type(type); ++ ++ if (glsl_type_is_cmat(type)) { ++ const struct glsl_type *element_type = glsl_get_cmat_element(type); ++ ++ nir_deref_instr *mat = vtn_create_cmat_temporary(b, type, "cmat_constant"); ++ nir_cmat_construct(&b->nb, &mat->def, ++ nir_build_imm(&b->nb, 1, glsl_get_bit_size(element_type), ++ constant->values)); ++ vtn_set_ssa_value_var(b, val, mat->var); ++ } else if (glsl_type_is_vector_or_scalar(type)) { ++ val->def = nir_build_imm(&b->nb, glsl_get_vector_elements(val->type), ++ glsl_get_bit_size(val->type), ++ constant->values); ++ } else { ++ unsigned elems = glsl_get_length(val->type); ++ val->elems = vtn_alloc_array(b, struct vtn_ssa_value *, elems); ++ if (glsl_type_is_array_or_matrix(type)) { ++ const struct glsl_type *elem_type = glsl_get_array_element(type); ++ for (unsigned i = 0; i < elems; i++) { ++ val->elems[i] = vtn_const_ssa_value(b, constant->elements[i], ++ elem_type); ++ } ++ } else { ++ vtn_assert(glsl_type_is_struct_or_ifc(type)); ++ for (unsigned i = 0; i < elems; i++) { ++ const struct glsl_type *elem_type = glsl_get_struct_field(type, i); ++ val->elems[i] = vtn_const_ssa_value(b, constant->elements[i], ++ elem_type); ++ } ++ } ++ } ++ ++ return val; ++} ++ ++struct vtn_ssa_value * ++vtn_ssa_value(struct vtn_builder *b, uint32_t value_id) ++{ ++ struct vtn_value *val = vtn_untyped_value(b, value_id); ++ switch (val->value_type) { ++ case vtn_value_type_undef: ++ return vtn_undef_ssa_value(b, val->type->type); ++ ++ case vtn_value_type_constant: ++ return vtn_const_ssa_value(b, val->constant, val->type->type); ++ ++ case vtn_value_type_ssa: ++ return val->ssa; ++ ++ case vtn_value_type_pointer: ++ vtn_assert(val->pointer->type && val->pointer->type->type); ++ struct vtn_ssa_value *ssa = ++ vtn_create_ssa_value(b, val->pointer->type->type); ++ ssa->def = vtn_pointer_to_ssa(b, val->pointer); ++ return ssa; ++ ++ default: ++ vtn_fail("Invalid type for an SSA value"); ++ } ++} ++ ++struct vtn_value * ++vtn_push_ssa_value(struct vtn_builder *b, uint32_t value_id, ++ struct vtn_ssa_value *ssa) ++{ ++ struct vtn_type *type = vtn_get_value_type(b, value_id); ++ ++ /* See vtn_create_ssa_value */ ++ vtn_fail_if(ssa->type != glsl_get_bare_type(type->type), ++ "Type mismatch for SPIR-V value %%%u", value_id); ++ ++ struct vtn_value *val; ++ if (type->base_type == vtn_base_type_pointer) { ++ val = vtn_push_pointer(b, value_id, vtn_pointer_from_ssa(b, ssa->def, type)); ++ } else { ++ /* Don't trip the value_type_ssa check in vtn_push_value */ ++ val = vtn_push_value(b, value_id, vtn_value_type_invalid); ++ val->value_type = vtn_value_type_ssa; ++ val->ssa = ssa; ++ } ++ ++ return val; ++} ++ ++nir_def * ++vtn_get_nir_ssa(struct vtn_builder *b, uint32_t value_id) ++{ ++ struct vtn_ssa_value *ssa = vtn_ssa_value(b, value_id); ++ vtn_fail_if(!glsl_type_is_vector_or_scalar(ssa->type), ++ "Expected a vector or scalar type"); ++ return ssa->def; ++} ++ ++struct vtn_value * ++vtn_push_nir_ssa(struct vtn_builder *b, uint32_t value_id, nir_def *def) ++{ ++ /* Types for all SPIR-V SSA values are set as part of a pre-pass so the ++ * type will be valid by the time we get here. ++ */ ++ struct vtn_type *type = vtn_get_value_type(b, value_id); ++ vtn_fail_if(def->num_components != glsl_get_vector_elements(type->type) || ++ def->bit_size != glsl_get_bit_size(type->type), ++ "Mismatch between NIR and SPIR-V type."); ++ struct vtn_ssa_value *ssa = vtn_create_ssa_value(b, type->type); ++ ssa->def = def; ++ return vtn_push_ssa_value(b, value_id, ssa); ++} ++ ++nir_deref_instr * ++vtn_get_deref_for_id(struct vtn_builder *b, uint32_t value_id) ++{ ++ return vtn_get_deref_for_ssa_value(b, vtn_ssa_value(b, value_id)); ++} ++ ++nir_deref_instr * ++vtn_get_deref_for_ssa_value(struct vtn_builder *b, struct vtn_ssa_value *ssa) ++{ ++ vtn_fail_if(!ssa->is_variable, "Expected an SSA value with a nir_variable"); ++ return nir_build_deref_var(&b->nb, ssa->var); ++} ++ ++struct vtn_value * ++vtn_push_var_ssa(struct vtn_builder *b, uint32_t value_id, nir_variable *var) ++{ ++ struct vtn_ssa_value *ssa = vtn_create_ssa_value(b, var->type); ++ vtn_set_ssa_value_var(b, ssa, var); ++ return vtn_push_ssa_value(b, value_id, ssa); ++} ++ ++static enum gl_access_qualifier ++spirv_to_gl_access_qualifier(struct vtn_builder *b, ++ SpvAccessQualifier access_qualifier) ++{ ++ switch (access_qualifier) { ++ case SpvAccessQualifierReadOnly: ++ return ACCESS_NON_WRITEABLE; ++ case SpvAccessQualifierWriteOnly: ++ return ACCESS_NON_READABLE; ++ case SpvAccessQualifierReadWrite: ++ return 0; ++ default: ++ vtn_fail("Invalid image access qualifier"); ++ } ++} ++ ++static nir_deref_instr * ++vtn_get_image(struct vtn_builder *b, uint32_t value_id, ++ enum gl_access_qualifier *access) ++{ ++ struct vtn_type *type = vtn_get_value_type(b, value_id); ++ vtn_assert(type->base_type == vtn_base_type_image); ++ if (access) ++ *access |= spirv_to_gl_access_qualifier(b, type->access_qualifier); ++ nir_variable_mode mode = glsl_type_is_image(type->glsl_image) ? ++ nir_var_image : nir_var_uniform; ++ return nir_build_deref_cast(&b->nb, vtn_get_nir_ssa(b, value_id), ++ mode, type->glsl_image, 0); ++} ++ ++static void ++vtn_push_image(struct vtn_builder *b, uint32_t value_id, ++ nir_deref_instr *deref, bool propagate_non_uniform) ++{ ++ struct vtn_type *type = vtn_get_value_type(b, value_id); ++ vtn_assert(type->base_type == vtn_base_type_image); ++ struct vtn_value *value = vtn_push_nir_ssa(b, value_id, &deref->def); ++ value->propagated_non_uniform = propagate_non_uniform; ++} ++ ++static nir_deref_instr * ++vtn_get_sampler(struct vtn_builder *b, uint32_t value_id) ++{ ++ struct vtn_type *type = vtn_get_value_type(b, value_id); ++ vtn_assert(type->base_type == vtn_base_type_sampler); ++ return nir_build_deref_cast(&b->nb, vtn_get_nir_ssa(b, value_id), ++ nir_var_uniform, glsl_bare_sampler_type(), 0); ++} ++ ++nir_def * ++vtn_sampled_image_to_nir_ssa(struct vtn_builder *b, ++ struct vtn_sampled_image si) ++{ ++ return nir_vec2(&b->nb, &si.image->def, &si.sampler->def); ++} ++ ++static void ++vtn_push_sampled_image(struct vtn_builder *b, uint32_t value_id, ++ struct vtn_sampled_image si, bool propagate_non_uniform) ++{ ++ struct vtn_type *type = vtn_get_value_type(b, value_id); ++ vtn_assert(type->base_type == vtn_base_type_sampled_image); ++ struct vtn_value *value = vtn_push_nir_ssa(b, value_id, ++ vtn_sampled_image_to_nir_ssa(b, si)); ++ value->propagated_non_uniform = propagate_non_uniform; ++} ++ ++static struct vtn_sampled_image ++vtn_get_sampled_image(struct vtn_builder *b, uint32_t value_id) ++{ ++ struct vtn_type *type = vtn_get_value_type(b, value_id); ++ vtn_assert(type->base_type == vtn_base_type_sampled_image); ++ nir_def *si_vec2 = vtn_get_nir_ssa(b, value_id); ++ ++ /* Even though this is a sampled image, we can end up here with a storage ++ * image because OpenCL doesn't distinguish between the two. ++ */ ++ const struct glsl_type *image_type = type->image->glsl_image; ++ nir_variable_mode image_mode = glsl_type_is_image(image_type) ? ++ nir_var_image : nir_var_uniform; ++ ++ struct vtn_sampled_image si = { NULL, }; ++ si.image = nir_build_deref_cast(&b->nb, nir_channel(&b->nb, si_vec2, 0), ++ image_mode, image_type, 0); ++ si.sampler = nir_build_deref_cast(&b->nb, nir_channel(&b->nb, si_vec2, 1), ++ nir_var_uniform, ++ glsl_bare_sampler_type(), 0); ++ return si; ++} ++ ++const char * ++vtn_string_literal(struct vtn_builder *b, const uint32_t *words, ++ unsigned word_count, unsigned *words_used) ++{ ++ /* From the SPIR-V spec: ++ * ++ * "A string is interpreted as a nul-terminated stream of characters. ++ * The character set is Unicode in the UTF-8 encoding scheme. The UTF-8 ++ * octets (8-bit bytes) are packed four per word, following the ++ * little-endian convention (i.e., the first octet is in the ++ * lowest-order 8 bits of the word). The final word contains the ++ * string’s nul-termination character (0), and all contents past the ++ * end of the string in the final word are padded with 0." ++ * ++ * On big-endian, we need to byte-swap. ++ */ ++#if UTIL_ARCH_BIG_ENDIAN ++ { ++ uint32_t *copy = vtn_alloc_array(b, uint32_t, word_count); ++ for (unsigned i = 0; i < word_count; i++) ++ copy[i] = util_bswap32(words[i]); ++ words = copy; ++ } ++#endif ++ ++ const char *str = (const char *)words; ++ const char *end = memchr(str, 0, word_count * 4); ++ vtn_fail_if(end == NULL, "String is not null-terminated"); ++ ++ if (words_used) ++ *words_used = DIV_ROUND_UP(end - str + 1, sizeof(*words)); ++ ++ return str; ++} ++ ++const uint32_t * ++vtn_foreach_instruction(struct vtn_builder *b, const uint32_t *start, ++ const uint32_t *end, vtn_instruction_handler handler) ++{ ++ const uint32_t *w = start; ++ while (w < end) { ++ SpvOp opcode = w[0] & SpvOpCodeMask; ++ unsigned count = w[0] >> SpvWordCountShift; ++ vtn_assert(count >= 1 && w + count <= end); ++ ++ b->spirv_offset = (uint8_t *)w - (uint8_t *)b->spirv; ++ ++ switch (opcode) { ++ case SpvOpNop: ++ break; /* Do nothing */ ++ ++ case SpvOpLine: ++ b->file = vtn_value(b, w[1], vtn_value_type_string)->str; ++ b->line = w[2]; ++ b->col = w[3]; ++ break; ++ ++ case SpvOpNoLine: ++ b->file = NULL; ++ b->line = -1; ++ b->col = -1; ++ break; ++ ++ default: ++ if (!handler(b, opcode, w, count)) ++ return w; ++ break; ++ } ++ ++ w += count; ++ } ++ ++ assert(w == end); ++ return w; ++} ++ ++static bool ++vtn_handle_debug_printf(struct vtn_builder *b, SpvOp ext_opcode, ++ const uint32_t *w, unsigned count) ++{ ++ vtn_assert(ext_opcode == 1); ++ ++ struct vtn_value *format = vtn_value(b, w[5], vtn_value_type_string); ++ ++ b->shader->info.uses_printf = true; ++ b->shader->printf_info_count++; ++ b->shader->printf_info = reralloc(b->shader, ++ b->shader->printf_info, ++ u_printf_info, ++ b->shader->printf_info_count); ++ ++ u_printf_info *info = ++ &b->shader->printf_info[b->shader->printf_info_count - 1]; ++ ++ uint32_t argc = count - 6; ++ *info = (u_printf_info) { ++ .arg_sizes = ralloc_array(b->shader, unsigned, argc), ++ .num_args = argc, ++ .strings = ralloc_strdup(b->shader, format->str), ++ .string_size = strlen(format->str) + 1, ++ }; ++ ++ uint32_t info_index = b->shader->printf_info_count; ++ ++ if (argc) { ++ glsl_struct_field *fields = calloc(argc, sizeof(glsl_struct_field)); ++ for (uint32_t i = 0; i < argc; i++) { ++ struct vtn_ssa_value *arg = vtn_ssa_value(b, w[6 + i]); ++ ++ fields[i].type = glsl_intN_t_type(arg->def->bit_size); ++ if (arg->def->num_components > 1) ++ fields[i].type = glsl_vector_type(fields[i].type->base_type, arg->def->num_components); ++ ++ fields[i].name = ""; ++ ++ info->arg_sizes[i] = arg->def->bit_size / 8; ++ } ++ ++ nir_variable *packed_args = nir_local_variable_create( ++ b->nb.impl, glsl_struct_type(fields, argc, "packed_args", false), "packed_args"); ++ nir_deref_instr *var_deref = nir_build_deref_var(&b->nb, packed_args); ++ for (uint32_t i = 0; i < argc; i++) { ++ struct vtn_ssa_value *arg = vtn_ssa_value(b, w[6 + i]); ++ nir_deref_instr *arg_deref = nir_build_deref_struct(&b->nb, var_deref, i); ++ nir_store_deref(&b->nb, arg_deref, arg->def, BITFIELD_MASK(NIR_MAX_VEC_COMPONENTS)); ++ } ++ ++ nir_printf(&b->nb, &var_deref->def, .fmt_idx = info_index); ++ ++ free(fields); ++ } else { ++ nir_printf(&b->nb, nir_undef(&b->nb, 1, 32), .fmt_idx = info_index); ++ } ++ ++ /* Do nothing. */ ++ return true; ++} ++ ++static bool ++vtn_handle_non_semantic_instruction(struct vtn_builder *b, SpvOp ext_opcode, ++ const uint32_t *w, unsigned count) ++{ ++ /* Do nothing. */ ++ return true; ++} ++ ++static bool ++vtn_handle_non_semantic_debug_break_instruction(struct vtn_builder *b, SpvOp ext_opcode, ++ const uint32_t *w, unsigned count) ++{ ++ nir_debug_break(&b->nb); ++ return true; ++} ++ ++static bool ++vtn_handle_non_semantic_debug_info(struct vtn_builder *b, SpvOp ext_opcode, ++ const uint32_t *w, unsigned count) ++{ ++ enum NonSemanticShaderDebugInfo100Instructions instr = w[4]; ++ ++ if (instr == NonSemanticShaderDebugInfo100DebugLine) { ++ uint32_t source_id = w[5]; ++ uint32_t line = vtn_constant_uint(b, w[6]); ++ uint32_t column = vtn_constant_uint(b, w[8]); ++ ++ b->file = vtn_value(b, source_id, vtn_value_type_string)->str; ++ b->line = line; ++ b->col = column; ++ } else if (instr == NonSemanticShaderDebugInfo100DebugSource) { ++ uint32_t result_id = w[2]; ++ uint32_t file_id = w[5]; ++ vtn_push_value(b, result_id, vtn_value_type_string)->str = ++ vtn_value(b, file_id, vtn_value_type_string)->str; ++ } ++ ++ return true; ++} ++ ++static void ++vtn_handle_extension(struct vtn_builder *b, SpvOp opcode, ++ const uint32_t *w, unsigned count) ++{ ++ switch (opcode) { ++ case SpvOpExtInstImport: { ++ struct vtn_value *val = vtn_push_value(b, w[1], vtn_value_type_extension); ++ const char *ext = vtn_string_literal(b, &w[2], count - 2, NULL); ++ if (strcmp(ext, "GLSL.std.450") == 0) { ++ val->ext_handler = vtn_handle_glsl450_instruction; ++ } else if ((strcmp(ext, "SPV_AMD_gcn_shader") == 0) ++ && (b->options && b->options->amd_gcn_shader)) { ++ val->ext_handler = vtn_handle_amd_gcn_shader_instruction; ++ } else if ((strcmp(ext, "SPV_AMD_shader_ballot") == 0) ++ && (b->options && b->options->amd_shader_ballot)) { ++ val->ext_handler = vtn_handle_amd_shader_ballot_instruction; ++ } else if ((strcmp(ext, "SPV_AMD_shader_trinary_minmax") == 0) ++ && (b->options && b->options->amd_trinary_minmax)) { ++ val->ext_handler = vtn_handle_amd_shader_trinary_minmax_instruction; ++ } else if ((strcmp(ext, "SPV_AMD_shader_explicit_vertex_parameter") == 0) ++ && (b->options && b->options->amd_shader_explicit_vertex_parameter)) { ++ val->ext_handler = vtn_handle_amd_shader_explicit_vertex_parameter_instruction; ++ } else if (strcmp(ext, "OpenCL.std") == 0) { ++ val->ext_handler = vtn_handle_opencl_instruction; ++ } else if ((strcmp(ext, "NonSemantic.DebugBreak") == 0) ++ && (b->options && b->options->emit_debug_break)) { ++ val->ext_handler = vtn_handle_non_semantic_debug_break_instruction; ++ } else if ((strcmp(ext, "NonSemantic.Shader.DebugInfo.100") == 0) ++ && (b->options && b->options->debug_info)) { ++ val->ext_handler = vtn_handle_non_semantic_debug_info; ++ } else if (strcmp(ext, "NonSemantic.DebugPrintf") == 0 ++ && (b->options && b->options->printf)) { ++ val->ext_handler = vtn_handle_debug_printf; ++ } else if (strstr(ext, "NonSemantic.") == ext) { ++ val->ext_handler = vtn_handle_non_semantic_instruction; ++ } else { ++ vtn_fail("Unsupported extension: %s", ext); ++ } ++ break; ++ } ++ ++ case SpvOpExtInst: ++ case SpvOpExtInstWithForwardRefsKHR: { ++ struct vtn_value *val = vtn_value(b, w[3], vtn_value_type_extension); ++ ++ if (opcode == SpvOpExtInstWithForwardRefsKHR) ++ assert(val->ext_handler == vtn_handle_non_semantic_instruction); ++ ++ bool handled = val->ext_handler(b, w[4], w, count); ++ vtn_assert(handled); ++ break; ++ } ++ ++ default: ++ vtn_fail_with_opcode("Unhandled opcode", opcode); ++ } ++} ++ ++static void ++_foreach_decoration_helper(struct vtn_builder *b, ++ struct vtn_value *base_value, ++ int parent_member, ++ struct vtn_value *value, ++ vtn_decoration_foreach_cb cb, void *data) ++{ ++ for (struct vtn_decoration *dec = value->decoration; dec; dec = dec->next) { ++ int member; ++ if (dec->scope == VTN_DEC_DECORATION) { ++ member = parent_member; ++ } else if (dec->scope >= VTN_DEC_STRUCT_MEMBER0) { ++ vtn_fail_if(value->value_type != vtn_value_type_type || ++ value->type->base_type != vtn_base_type_struct, ++ "OpMemberDecorate and OpGroupMemberDecorate are only " ++ "allowed on OpTypeStruct"); ++ /* This means we haven't recursed yet */ ++ assert(value == base_value); ++ ++ member = dec->scope - VTN_DEC_STRUCT_MEMBER0; ++ ++ vtn_fail_if(member >= base_value->type->length, ++ "OpMemberDecorate specifies member %d but the " ++ "OpTypeStruct has only %u members", ++ member, base_value->type->length); ++ } else { ++ /* Not a decoration */ ++ assert(dec->scope == VTN_DEC_EXECUTION_MODE || ++ dec->scope <= VTN_DEC_STRUCT_MEMBER_NAME0); ++ continue; ++ } ++ ++ if (dec->group) { ++ assert(dec->group->value_type == vtn_value_type_decoration_group); ++ _foreach_decoration_helper(b, base_value, member, dec->group, ++ cb, data); ++ } else { ++ cb(b, base_value, member, dec, data); ++ } ++ } ++} ++ ++/** Iterates (recursively if needed) over all of the decorations on a value ++ * ++ * This function iterates over all of the decorations applied to a given ++ * value. If it encounters a decoration group, it recurses into the group ++ * and iterates over all of those decorations as well. ++ */ ++void ++vtn_foreach_decoration(struct vtn_builder *b, struct vtn_value *value, ++ vtn_decoration_foreach_cb cb, void *data) ++{ ++ _foreach_decoration_helper(b, value, -1, value, cb, data); ++} ++ ++struct has_decoration_data { ++ SpvDecoration decoration; ++ bool result; ++}; ++ ++static void ++has_decoration_cb(struct vtn_builder *b, UNUSED struct vtn_value *val, ++ UNUSED int member, const struct vtn_decoration *dec, ++ void *_data) ++{ ++ struct has_decoration_data *data = (struct has_decoration_data *)_data; ++ if (dec->decoration == data->decoration) ++ data->result = true; ++} ++ ++bool ++vtn_has_decoration(struct vtn_builder *b, struct vtn_value *value, ++ SpvDecoration decoration) ++{ ++ struct has_decoration_data data = { ++ .decoration = decoration, ++ .result = false, ++ }; ++ ++ vtn_foreach_decoration(b, value, has_decoration_cb, &data); ++ ++ return data.result; ++} ++ ++void ++vtn_foreach_execution_mode(struct vtn_builder *b, struct vtn_value *value, ++ vtn_execution_mode_foreach_cb cb, void *data) ++{ ++ for (struct vtn_decoration *dec = value->decoration; dec; dec = dec->next) { ++ if (dec->scope != VTN_DEC_EXECUTION_MODE) ++ continue; ++ ++ assert(dec->group == NULL); ++ cb(b, value, dec, data); ++ } ++} ++ ++void ++vtn_handle_decoration(struct vtn_builder *b, SpvOp opcode, ++ const uint32_t *w, unsigned count) ++{ ++ const uint32_t *w_end = w + count; ++ const uint32_t target = w[1]; ++ w += 2; ++ ++ switch (opcode) { ++ case SpvOpDecorationGroup: ++ vtn_push_value(b, target, vtn_value_type_decoration_group); ++ break; ++ ++ case SpvOpDecorate: ++ case SpvOpDecorateId: ++ case SpvOpMemberDecorate: ++ case SpvOpDecorateString: ++ case SpvOpMemberDecorateString: ++ case SpvOpExecutionMode: ++ case SpvOpExecutionModeId: { ++ struct vtn_value *val = vtn_untyped_value(b, target); ++ ++ struct vtn_decoration *dec = vtn_zalloc(b, struct vtn_decoration); ++ switch (opcode) { ++ case SpvOpDecorate: ++ case SpvOpDecorateId: ++ case SpvOpDecorateString: ++ dec->scope = VTN_DEC_DECORATION; ++ break; ++ case SpvOpMemberDecorate: ++ case SpvOpMemberDecorateString: ++ dec->scope = VTN_DEC_STRUCT_MEMBER0 + *(w++); ++ vtn_fail_if(dec->scope < VTN_DEC_STRUCT_MEMBER0, /* overflow */ ++ "Member argument of OpMemberDecorate too large"); ++ break; ++ case SpvOpExecutionMode: ++ case SpvOpExecutionModeId: ++ dec->scope = VTN_DEC_EXECUTION_MODE; ++ break; ++ default: ++ UNREACHABLE("Invalid decoration opcode"); ++ } ++ dec->decoration = *(w++); ++ dec->num_operands = w_end - w; ++ dec->operands = w; ++ ++ /* Link into the list */ ++ dec->next = val->decoration; ++ val->decoration = dec; ++ break; ++ } ++ ++ case SpvOpMemberName: { ++ struct vtn_value *val = vtn_untyped_value(b, target); ++ struct vtn_decoration *dec = vtn_zalloc(b, struct vtn_decoration); ++ ++ dec->scope = VTN_DEC_STRUCT_MEMBER_NAME0 - *(w++); ++ ++ dec->member_name = vtn_string_literal(b, w, w_end - w, NULL); ++ ++ dec->next = val->decoration; ++ val->decoration = dec; ++ break; ++ } ++ ++ case SpvOpGroupMemberDecorate: ++ case SpvOpGroupDecorate: { ++ struct vtn_value *group = ++ vtn_value(b, target, vtn_value_type_decoration_group); ++ ++ for (; w < w_end; w++) { ++ struct vtn_value *val = vtn_untyped_value(b, *w); ++ struct vtn_decoration *dec = vtn_zalloc(b, struct vtn_decoration); ++ ++ dec->group = group; ++ if (opcode == SpvOpGroupDecorate) { ++ dec->scope = VTN_DEC_DECORATION; ++ } else { ++ dec->scope = VTN_DEC_STRUCT_MEMBER0 + *(++w); ++ vtn_fail_if(dec->scope < 0, /* Check for overflow */ ++ "Member argument of OpGroupMemberDecorate too large"); ++ } ++ ++ /* Link into the list */ ++ dec->next = val->decoration; ++ val->decoration = dec; ++ } ++ break; ++ } ++ ++ default: ++ UNREACHABLE("Unhandled opcode"); ++ } ++} ++ ++struct member_decoration_ctx { ++ unsigned num_fields; ++ struct glsl_struct_field *fields; ++ struct vtn_type *type; ++}; ++ ++/** ++ * Returns true if the given type contains a struct decorated Block or ++ * BufferBlock ++ */ ++bool ++vtn_type_contains_block(struct vtn_builder *b, struct vtn_type *type) ++{ ++ switch (type->base_type) { ++ case vtn_base_type_array: ++ return vtn_type_contains_block(b, type->array_element); ++ case vtn_base_type_struct: ++ if (type->block || type->buffer_block) ++ return true; ++ for (unsigned i = 0; i < type->length; i++) { ++ if (vtn_type_contains_block(b, type->members[i])) ++ return true; ++ } ++ return false; ++ default: ++ return false; ++ } ++} ++ ++bool ++vtn_type_is_block_array(struct vtn_builder *b, struct vtn_type *type) ++{ ++ return type->base_type == vtn_base_type_array && ++ vtn_type_contains_block(b, type->array_element); ++} ++ ++/** Returns true if two types are "compatible", i.e. you can do an OpLoad, ++ * OpStore, or OpCopyMemory between them without breaking anything. ++ * Technically, the SPIR-V rules require the exact same type ID but this lets ++ * us internally be a bit looser. ++ */ ++bool ++vtn_types_compatible(struct vtn_builder *b, ++ struct vtn_type *t1, struct vtn_type *t2) ++{ ++ if (t1->id == t2->id) ++ return true; ++ ++ if (t1->base_type != t2->base_type) ++ return false; ++ ++ switch (t1->base_type) { ++ case vtn_base_type_void: ++ case vtn_base_type_scalar: ++ case vtn_base_type_vector: ++ case vtn_base_type_matrix: ++ case vtn_base_type_image: ++ case vtn_base_type_sampler: ++ case vtn_base_type_sampled_image: ++ case vtn_base_type_event: ++ case vtn_base_type_cooperative_matrix: ++ return t1->type == t2->type; ++ ++ case vtn_base_type_array: ++ return t1->length == t2->length && ++ vtn_types_compatible(b, t1->array_element, t2->array_element); ++ ++ case vtn_base_type_pointer: ++ return vtn_types_compatible(b, t1->pointed, t2->pointed); ++ ++ case vtn_base_type_struct: ++ if (t1->length != t2->length) ++ return false; ++ ++ for (unsigned i = 0; i < t1->length; i++) { ++ if (!vtn_types_compatible(b, t1->members[i], t2->members[i])) ++ return false; ++ } ++ return true; ++ ++ case vtn_base_type_accel_struct: ++ case vtn_base_type_ray_query: ++ return true; ++ ++ case vtn_base_type_function: ++ /* This case shouldn't get hit since you can't copy around function ++ * types. Just require them to be identical. ++ */ ++ return false; ++ } ++ ++ vtn_fail("Invalid base type"); ++} ++ ++struct vtn_type * ++vtn_type_without_array(struct vtn_type *type) ++{ ++ while (type->base_type == vtn_base_type_array) ++ type = type->array_element; ++ return type; ++} ++ ++/* does a shallow copy of a vtn_type */ ++ ++static struct vtn_type * ++vtn_type_copy(struct vtn_builder *b, struct vtn_type *src) ++{ ++ struct vtn_type *dest = vtn_alloc(b, struct vtn_type); ++ *dest = *src; ++ ++ switch (src->base_type) { ++ case vtn_base_type_void: ++ case vtn_base_type_scalar: ++ case vtn_base_type_vector: ++ case vtn_base_type_matrix: ++ case vtn_base_type_array: ++ case vtn_base_type_pointer: ++ case vtn_base_type_image: ++ case vtn_base_type_sampler: ++ case vtn_base_type_sampled_image: ++ case vtn_base_type_event: ++ case vtn_base_type_accel_struct: ++ case vtn_base_type_ray_query: ++ case vtn_base_type_cooperative_matrix: ++ /* Nothing more to do */ ++ break; ++ ++ case vtn_base_type_struct: ++ dest->members = vtn_alloc_array(b, struct vtn_type *, src->length); ++ memcpy(dest->members, src->members, ++ src->length * sizeof(src->members[0])); ++ ++ dest->offsets = vtn_alloc_array(b, unsigned, src->length); ++ memcpy(dest->offsets, src->offsets, ++ src->length * sizeof(src->offsets[0])); ++ break; ++ ++ case vtn_base_type_function: ++ dest->params = vtn_alloc_array(b, struct vtn_type *, src->length); ++ memcpy(dest->params, src->params, src->length * sizeof(src->params[0])); ++ break; ++ } ++ ++ return dest; ++} ++ ++static bool ++vtn_type_needs_explicit_layout(struct vtn_builder *b, struct vtn_type *type, ++ enum vtn_variable_mode mode) ++{ ++ /* For OpenCL we never want to strip the info from the types, and it makes ++ * type comparisons easier in later stages. ++ */ ++ if (b->options->environment == NIR_SPIRV_OPENCL) ++ return true; ++ ++ switch (mode) { ++ case vtn_variable_mode_input: ++ case vtn_variable_mode_output: ++ /* Layout decorations kept because we need offsets for XFB arrays of ++ * blocks. ++ */ ++ return b->shader->info.has_transform_feedback_varyings; ++ ++ case vtn_variable_mode_ssbo: ++ case vtn_variable_mode_phys_ssbo: ++ case vtn_variable_mode_ubo: ++ case vtn_variable_mode_push_constant: ++ case vtn_variable_mode_shader_record: ++ return true; ++ ++ case vtn_variable_mode_workgroup: ++ return b->supported_capabilities.WorkgroupMemoryExplicitLayoutKHR; ++ ++ default: ++ return false; ++ } ++} ++ ++const struct glsl_type * ++vtn_type_get_nir_type(struct vtn_builder *b, struct vtn_type *type, ++ enum vtn_variable_mode mode) ++{ ++ if (type == NULL) ++ return glsl_void_type(); ++ ++ if (mode == vtn_variable_mode_atomic_counter) { ++ vtn_fail_if(glsl_without_array(type->type) != glsl_uint_type(), ++ "Variables in the AtomicCounter storage class should be " ++ "(possibly arrays of arrays of) uint."); ++ return glsl_type_wrap_in_arrays(glsl_atomic_uint_type(), type->type); ++ } ++ ++ if (mode == vtn_variable_mode_uniform) { ++ switch (type->base_type) { ++ case vtn_base_type_array: { ++ const struct glsl_type *elem_type = ++ vtn_type_get_nir_type(b, type->array_element, mode); ++ ++ return glsl_array_type(elem_type, type->length, ++ glsl_get_explicit_stride(type->type)); ++ } ++ ++ case vtn_base_type_struct: { ++ bool need_new_struct = false; ++ const uint32_t num_fields = type->length; ++ NIR_VLA(struct glsl_struct_field, fields, num_fields); ++ for (unsigned i = 0; i < num_fields; i++) { ++ fields[i] = *glsl_get_struct_field_data(type->type, i); ++ const struct glsl_type *field_nir_type = ++ vtn_type_get_nir_type(b, type->members[i], mode); ++ if (fields[i].type != field_nir_type) { ++ fields[i].type = field_nir_type; ++ need_new_struct = true; ++ } ++ } ++ if (need_new_struct) { ++ if (glsl_type_is_interface(type->type)) { ++ return glsl_interface_type(fields, num_fields, ++ /* packing */ 0, false, ++ glsl_get_type_name(type->type)); ++ } else { ++ return glsl_struct_type(fields, num_fields, ++ glsl_get_type_name(type->type), ++ glsl_struct_type_is_packed(type->type)); ++ } ++ } else { ++ /* No changes, just pass it on */ ++ return type->type; ++ } ++ } ++ ++ case vtn_base_type_image: ++ vtn_assert(glsl_type_is_texture(type->glsl_image)); ++ return type->glsl_image; ++ ++ case vtn_base_type_sampler: ++ return glsl_bare_sampler_type(); ++ ++ case vtn_base_type_sampled_image: ++ return glsl_texture_type_to_sampler(type->image->glsl_image, ++ false /* is_shadow */); ++ ++ default: ++ return type->type; ++ } ++ } ++ ++ if (mode == vtn_variable_mode_image) { ++ struct vtn_type *image_type = vtn_type_without_array(type); ++ vtn_assert(image_type->base_type == vtn_base_type_image); ++ return glsl_type_wrap_in_arrays(image_type->glsl_image, type->type); ++ } ++ ++ /* Layout decorations are allowed but ignored in certain conditions, ++ * to allow SPIR-V generators perform type deduplication. Discard ++ * unnecessary ones when passing to NIR. ++ */ ++ if (!vtn_type_needs_explicit_layout(b, type, mode)) ++ return glsl_get_bare_type(type->type); ++ ++ return type->type; ++} ++ ++static struct vtn_type * ++mutable_matrix_member(struct vtn_builder *b, struct vtn_type *type, int member) ++{ ++ type->members[member] = vtn_type_copy(b, type->members[member]); ++ type = type->members[member]; ++ ++ /* We may have an array of matrices.... Oh, joy! */ ++ while (glsl_type_is_array(type->type)) { ++ type->array_element = vtn_type_copy(b, type->array_element); ++ type = type->array_element; ++ } ++ ++ vtn_assert(glsl_type_is_matrix(type->type)); ++ ++ return type; ++} ++ ++static void ++vtn_handle_access_qualifier(struct vtn_builder *b, struct vtn_type *type, ++ int member, enum gl_access_qualifier access) ++{ ++ type->members[member] = vtn_type_copy(b, type->members[member]); ++ type = type->members[member]; ++ ++ type->access |= access; ++} ++ ++static void ++array_stride_decoration_cb(struct vtn_builder *b, ++ struct vtn_value *val, int member, ++ const struct vtn_decoration *dec, void *void_ctx) ++{ ++ struct vtn_type *type = val->type; ++ ++ if (dec->decoration == SpvDecorationArrayStride) { ++ if (type->base_type == vtn_base_type_pointer && ++ type->pointed != NULL && ++ (type->pointed->block || type->pointed->buffer_block)) { ++ vtn_warn("A pointer to a structure decorated with *Block* or " ++ "*BufferBlock* must not have an *ArrayStride* decoration"); ++ /* Ignore the decoration */ ++ } else if (vtn_type_contains_block(b, type)) { ++ vtn_warn("The ArrayStride decoration cannot be applied to an array " ++ "type which contains a structure type decorated Block " ++ "or BufferBlock"); ++ /* Ignore the decoration */ ++ } else { ++ vtn_fail_if(dec->operands[0] == 0, "ArrayStride must be non-zero"); ++ type->stride = dec->operands[0]; ++ } ++ } ++} ++ ++static void ++struct_member_decoration_cb(struct vtn_builder *b, ++ UNUSED struct vtn_value *val, int member, ++ const struct vtn_decoration *dec, void *void_ctx) ++{ ++ struct member_decoration_ctx *ctx = void_ctx; ++ ++ if (member < 0) ++ return; ++ ++ assert(member < ctx->num_fields); ++ ++ switch (dec->decoration) { ++ case SpvDecorationRelaxedPrecision: ++ case SpvDecorationUniform: ++ case SpvDecorationUniformId: ++ break; /* FIXME: Do nothing with this for now. */ ++ case SpvDecorationNonWritable: ++ vtn_handle_access_qualifier(b, ctx->type, member, ACCESS_NON_WRITEABLE); ++ break; ++ case SpvDecorationNonReadable: ++ vtn_handle_access_qualifier(b, ctx->type, member, ACCESS_NON_READABLE); ++ break; ++ case SpvDecorationVolatile: ++ vtn_handle_access_qualifier(b, ctx->type, member, ACCESS_VOLATILE); ++ break; ++ case SpvDecorationCoherent: ++ vtn_handle_access_qualifier(b, ctx->type, member, ACCESS_COHERENT); ++ break; ++ case SpvDecorationNoPerspective: ++ ctx->fields[member].interpolation = INTERP_MODE_NOPERSPECTIVE; ++ break; ++ case SpvDecorationFlat: ++ ctx->fields[member].interpolation = INTERP_MODE_FLAT; ++ break; ++ case SpvDecorationExplicitInterpAMD: ++ ctx->fields[member].interpolation = INTERP_MODE_EXPLICIT; ++ break; ++ case SpvDecorationCentroid: ++ ctx->fields[member].centroid = true; ++ break; ++ case SpvDecorationSample: ++ ctx->fields[member].sample = true; ++ break; ++ case SpvDecorationStream: ++ /* This is handled later by var_decoration_cb in vtn_variables.c */ ++ break; ++ case SpvDecorationLocation: ++ ctx->fields[member].location = dec->operands[0]; ++ break; ++ case SpvDecorationComponent: ++ break; /* FIXME: What should we do with these? */ ++ case SpvDecorationBuiltIn: ++ ctx->type->members[member] = vtn_type_copy(b, ctx->type->members[member]); ++ ctx->type->members[member]->is_builtin = true; ++ ctx->type->members[member]->builtin = dec->operands[0]; ++ ctx->type->builtin_block = true; ++ break; ++ case SpvDecorationOffset: ++ ctx->type->offsets[member] = dec->operands[0]; ++ ctx->fields[member].offset = dec->operands[0]; ++ break; ++ case SpvDecorationMatrixStride: ++ /* Handled as a second pass */ ++ break; ++ case SpvDecorationColMajor: ++ break; /* Nothing to do here. Column-major is the default. */ ++ case SpvDecorationRowMajor: ++ mutable_matrix_member(b, ctx->type, member)->row_major = true; ++ break; ++ ++ case SpvDecorationPatch: ++ case SpvDecorationPerPrimitiveNV: ++ case SpvDecorationPerTaskNV: ++ case SpvDecorationPerViewNV: ++ break; ++ ++ case SpvDecorationSpecId: ++ case SpvDecorationBlock: ++ case SpvDecorationBufferBlock: ++ case SpvDecorationArrayStride: ++ case SpvDecorationGLSLShared: ++ case SpvDecorationGLSLPacked: ++ case SpvDecorationAliased: ++ case SpvDecorationConstant: ++ case SpvDecorationIndex: ++ case SpvDecorationBinding: ++ case SpvDecorationDescriptorSet: ++ case SpvDecorationLinkageAttributes: ++ case SpvDecorationNoContraction: ++ case SpvDecorationInputAttachmentIndex: ++ case SpvDecorationCPacked: ++ vtn_warn("Decoration not allowed on struct members: %s", ++ spirv_decoration_to_string(dec->decoration)); ++ break; ++ ++ case SpvDecorationRestrict: ++ /* While "Restrict" is invalid for struct members, glslang incorrectly ++ * generates it and it ends up hiding actual driver issues in a wall of ++ * spam from deqp-vk. Return it to the above block once the issue is ++ * resolved. https://github.com/KhronosGroup/glslang/issues/703 ++ */ ++ break; ++ ++ case SpvDecorationInvariant: ++ /* Also incorrectly generated by glslang, ignore it. */ ++ break; ++ ++ case SpvDecorationXfbBuffer: ++ case SpvDecorationXfbStride: ++ /* This is handled later by var_decoration_cb in vtn_variables.c */ ++ break; ++ ++ case SpvDecorationSaturatedConversion: ++ case SpvDecorationFuncParamAttr: ++ case SpvDecorationFPRoundingMode: ++ case SpvDecorationAlignment: ++ if (b->shader->info.stage != MESA_SHADER_KERNEL) { ++ vtn_warn("Decoration only allowed for CL-style kernels: %s", ++ spirv_decoration_to_string(dec->decoration)); ++ } ++ break; ++ ++ case SpvDecorationFPFastMathMode: ++ /* See handle_fp_fast_math(). */ ++ break; ++ ++ case SpvDecorationUserSemantic: ++ case SpvDecorationUserTypeGOOGLE: ++ /* User semantic decorations can safely be ignored by the driver. */ ++ break; ++ ++ default: ++ vtn_fail_with_decoration("Unhandled decoration", dec->decoration); ++ } ++} ++ ++/** Chases the array type all the way down to the tail and rewrites the ++ * glsl_types to be based off the tail's glsl_type. ++ */ ++static void ++vtn_array_type_rewrite_glsl_type(struct vtn_type *type) ++{ ++ if (type->base_type != vtn_base_type_array) ++ return; ++ ++ vtn_array_type_rewrite_glsl_type(type->array_element); ++ ++ type->type = glsl_array_type(type->array_element->type, ++ type->length, type->stride); ++} ++ ++/* Matrix strides are handled as a separate pass because we need to know ++ * whether the matrix is row-major or not first. ++ */ ++static void ++struct_member_matrix_stride_cb(struct vtn_builder *b, ++ UNUSED struct vtn_value *val, int member, ++ const struct vtn_decoration *dec, ++ void *void_ctx) ++{ ++ if (dec->decoration != SpvDecorationMatrixStride) ++ return; ++ ++ vtn_fail_if(member < 0, ++ "The MatrixStride decoration is only allowed on members " ++ "of OpTypeStruct"); ++ vtn_fail_if(dec->operands[0] == 0, "MatrixStride must be non-zero"); ++ ++ struct member_decoration_ctx *ctx = void_ctx; ++ ++ struct vtn_type *mat_type = mutable_matrix_member(b, ctx->type, member); ++ if (mat_type->row_major) { ++ mat_type->array_element = vtn_type_copy(b, mat_type->array_element); ++ mat_type->stride = mat_type->array_element->stride; ++ mat_type->array_element->stride = dec->operands[0]; ++ ++ mat_type->type = glsl_explicit_matrix_type(mat_type->type, ++ dec->operands[0], true); ++ mat_type->array_element->type = glsl_get_column_type(mat_type->type); ++ } else { ++ vtn_assert(mat_type->array_element->stride > 0); ++ mat_type->stride = dec->operands[0]; ++ ++ mat_type->type = glsl_explicit_matrix_type(mat_type->type, ++ dec->operands[0], false); ++ } ++ ++ /* Now that we've replaced the glsl_type with a properly strided matrix ++ * type, rewrite the member type so that it's an array of the proper kind ++ * of glsl_type. ++ */ ++ vtn_array_type_rewrite_glsl_type(ctx->type->members[member]); ++ ctx->fields[member].type = ctx->type->members[member]->type; ++} ++ ++static void ++struct_packed_decoration_cb(struct vtn_builder *b, ++ struct vtn_value *val, int member, ++ const struct vtn_decoration *dec, void *void_ctx) ++{ ++ vtn_assert(val->type->base_type == vtn_base_type_struct); ++ if (dec->decoration == SpvDecorationCPacked) { ++ if (b->shader->info.stage != MESA_SHADER_KERNEL) { ++ vtn_warn("Decoration only allowed for CL-style kernels: %s", ++ spirv_decoration_to_string(dec->decoration)); ++ } ++ val->type->packed = true; ++ } ++} ++ ++static void ++struct_block_decoration_cb(struct vtn_builder *b, ++ struct vtn_value *val, int member, ++ const struct vtn_decoration *dec, void *ctx) ++{ ++ if (member != -1) ++ return; ++ ++ struct vtn_type *type = val->type; ++ if (dec->decoration == SpvDecorationBlock) ++ type->block = true; ++ else if (dec->decoration == SpvDecorationBufferBlock) ++ type->buffer_block = true; ++} ++ ++static void ++type_decoration_cb(struct vtn_builder *b, ++ struct vtn_value *val, int member, ++ const struct vtn_decoration *dec, UNUSED void *ctx) ++{ ++ struct vtn_type *type = val->type; ++ ++ if (member != -1) { ++ /* This should have been handled by OpTypeStruct */ ++ assert(val->type->base_type == vtn_base_type_struct); ++ assert(member >= 0 && member < val->type->length); ++ return; ++ } ++ ++ switch (dec->decoration) { ++ case SpvDecorationArrayStride: ++ vtn_assert(type->base_type == vtn_base_type_array || ++ type->base_type == vtn_base_type_pointer); ++ break; ++ case SpvDecorationBlock: ++ vtn_assert(type->base_type == vtn_base_type_struct); ++ vtn_assert(type->block); ++ break; ++ case SpvDecorationBufferBlock: ++ vtn_assert(type->base_type == vtn_base_type_struct); ++ vtn_assert(type->buffer_block); ++ break; ++ case SpvDecorationGLSLShared: ++ case SpvDecorationGLSLPacked: ++ /* Ignore these, since we get explicit offsets anyways */ ++ break; ++ ++ case SpvDecorationRowMajor: ++ case SpvDecorationColMajor: ++ case SpvDecorationMatrixStride: ++ case SpvDecorationBuiltIn: ++ case SpvDecorationNoPerspective: ++ case SpvDecorationFlat: ++ case SpvDecorationPatch: ++ case SpvDecorationCentroid: ++ case SpvDecorationSample: ++ case SpvDecorationExplicitInterpAMD: ++ case SpvDecorationVolatile: ++ case SpvDecorationCoherent: ++ case SpvDecorationNonWritable: ++ case SpvDecorationNonReadable: ++ case SpvDecorationUniform: ++ case SpvDecorationUniformId: ++ case SpvDecorationLocation: ++ case SpvDecorationComponent: ++ case SpvDecorationOffset: ++ case SpvDecorationXfbBuffer: ++ case SpvDecorationXfbStride: ++ case SpvDecorationUserSemantic: ++ vtn_warn("Decoration only allowed for struct members: %s", ++ spirv_decoration_to_string(dec->decoration)); ++ break; ++ ++ case SpvDecorationStream: ++ /* We don't need to do anything here, as stream is filled up when ++ * aplying the decoration to a variable, just check that if it is not a ++ * struct member, it should be a struct. ++ */ ++ vtn_assert(type->base_type == vtn_base_type_struct); ++ break; ++ ++ case SpvDecorationRelaxedPrecision: ++ case SpvDecorationSpecId: ++ case SpvDecorationInvariant: ++ case SpvDecorationRestrict: ++ case SpvDecorationAliased: ++ case SpvDecorationConstant: ++ case SpvDecorationIndex: ++ case SpvDecorationBinding: ++ case SpvDecorationDescriptorSet: ++ case SpvDecorationLinkageAttributes: ++ case SpvDecorationNoContraction: ++ case SpvDecorationInputAttachmentIndex: ++ vtn_warn("Decoration not allowed on types: %s", ++ spirv_decoration_to_string(dec->decoration)); ++ break; ++ ++ case SpvDecorationCPacked: ++ /* Handled when parsing a struct type, nothing to do here. */ ++ break; ++ ++ case SpvDecorationSaturatedConversion: ++ case SpvDecorationFuncParamAttr: ++ case SpvDecorationFPRoundingMode: ++ case SpvDecorationAlignment: ++ vtn_warn("Decoration only allowed for CL-style kernels: %s", ++ spirv_decoration_to_string(dec->decoration)); ++ break; ++ ++ case SpvDecorationFPFastMathMode: ++ /* See handle_fp_fast_math(). */ ++ break; ++ ++ case SpvDecorationUserTypeGOOGLE: ++ /* User semantic decorations can safely be ignored by the driver. */ ++ break; ++ ++ default: ++ vtn_fail_with_decoration("Unhandled decoration", dec->decoration); ++ } ++} ++ ++static unsigned ++translate_image_format(struct vtn_builder *b, SpvImageFormat format) ++{ ++ switch (format) { ++ case SpvImageFormatUnknown: return PIPE_FORMAT_NONE; ++ case SpvImageFormatRgba32f: return PIPE_FORMAT_R32G32B32A32_FLOAT; ++ case SpvImageFormatRgba16f: return PIPE_FORMAT_R16G16B16A16_FLOAT; ++ case SpvImageFormatR32f: return PIPE_FORMAT_R32_FLOAT; ++ case SpvImageFormatRgba8: return PIPE_FORMAT_R8G8B8A8_UNORM; ++ case SpvImageFormatRgba8Snorm: return PIPE_FORMAT_R8G8B8A8_SNORM; ++ case SpvImageFormatRg32f: return PIPE_FORMAT_R32G32_FLOAT; ++ case SpvImageFormatRg16f: return PIPE_FORMAT_R16G16_FLOAT; ++ case SpvImageFormatR11fG11fB10f: return PIPE_FORMAT_R11G11B10_FLOAT; ++ case SpvImageFormatR16f: return PIPE_FORMAT_R16_FLOAT; ++ case SpvImageFormatRgba16: return PIPE_FORMAT_R16G16B16A16_UNORM; ++ case SpvImageFormatRgb10A2: return PIPE_FORMAT_R10G10B10A2_UNORM; ++ case SpvImageFormatRg16: return PIPE_FORMAT_R16G16_UNORM; ++ case SpvImageFormatRg8: return PIPE_FORMAT_R8G8_UNORM; ++ case SpvImageFormatR16: return PIPE_FORMAT_R16_UNORM; ++ case SpvImageFormatR8: return PIPE_FORMAT_R8_UNORM; ++ case SpvImageFormatRgba16Snorm: return PIPE_FORMAT_R16G16B16A16_SNORM; ++ case SpvImageFormatRg16Snorm: return PIPE_FORMAT_R16G16_SNORM; ++ case SpvImageFormatRg8Snorm: return PIPE_FORMAT_R8G8_SNORM; ++ case SpvImageFormatR16Snorm: return PIPE_FORMAT_R16_SNORM; ++ case SpvImageFormatR8Snorm: return PIPE_FORMAT_R8_SNORM; ++ case SpvImageFormatRgba32i: return PIPE_FORMAT_R32G32B32A32_SINT; ++ case SpvImageFormatRgba16i: return PIPE_FORMAT_R16G16B16A16_SINT; ++ case SpvImageFormatRgba8i: return PIPE_FORMAT_R8G8B8A8_SINT; ++ case SpvImageFormatR32i: return PIPE_FORMAT_R32_SINT; ++ case SpvImageFormatRg32i: return PIPE_FORMAT_R32G32_SINT; ++ case SpvImageFormatRg16i: return PIPE_FORMAT_R16G16_SINT; ++ case SpvImageFormatRg8i: return PIPE_FORMAT_R8G8_SINT; ++ case SpvImageFormatR16i: return PIPE_FORMAT_R16_SINT; ++ case SpvImageFormatR8i: return PIPE_FORMAT_R8_SINT; ++ case SpvImageFormatRgba32ui: return PIPE_FORMAT_R32G32B32A32_UINT; ++ case SpvImageFormatRgba16ui: return PIPE_FORMAT_R16G16B16A16_UINT; ++ case SpvImageFormatRgba8ui: return PIPE_FORMAT_R8G8B8A8_UINT; ++ case SpvImageFormatR32ui: return PIPE_FORMAT_R32_UINT; ++ case SpvImageFormatRgb10a2ui: return PIPE_FORMAT_R10G10B10A2_UINT; ++ case SpvImageFormatRg32ui: return PIPE_FORMAT_R32G32_UINT; ++ case SpvImageFormatRg16ui: return PIPE_FORMAT_R16G16_UINT; ++ case SpvImageFormatRg8ui: return PIPE_FORMAT_R8G8_UINT; ++ case SpvImageFormatR16ui: return PIPE_FORMAT_R16_UINT; ++ case SpvImageFormatR8ui: return PIPE_FORMAT_R8_UINT; ++ case SpvImageFormatR64ui: return PIPE_FORMAT_R64_UINT; ++ case SpvImageFormatR64i: return PIPE_FORMAT_R64_SINT; ++ default: ++ vtn_fail("Invalid image format: %s (%u)", ++ spirv_imageformat_to_string(format), format); ++ } ++} ++ ++static void ++validate_image_type_for_sampled_image(struct vtn_builder *b, ++ const struct glsl_type *image_type, ++ const char *operand) ++{ ++ /* From OpTypeSampledImage description in SPIR-V 1.6, revision 1: ++ * ++ * Image Type must be an OpTypeImage. It is the type of the image in the ++ * combined sampler and image type. It must not have a Dim of ++ * SubpassData. Additionally, starting with version 1.6, it must not have ++ * a Dim of Buffer. ++ * ++ * Same also applies to the type of the Image operand in OpSampledImage. ++ */ ++ ++ const enum glsl_sampler_dim dim = glsl_get_sampler_dim(image_type); ++ ++ vtn_fail_if(dim == GLSL_SAMPLER_DIM_SUBPASS || ++ dim == GLSL_SAMPLER_DIM_SUBPASS_MS, ++ "%s must not have a Dim of SubpassData.", operand); ++ ++ vtn_fail_if(dim == GLSL_SAMPLER_DIM_BUF && b->version >= 0x10600, ++ "Starting with SPIR-V 1.6, %s must not have a Dim of Buffer.", ++ operand); ++} ++ ++static void ++vtn_handle_type(struct vtn_builder *b, SpvOp opcode, ++ const uint32_t *w, unsigned count) ++{ ++ struct vtn_value *val = NULL; ++ ++ /* In order to properly handle forward declarations, we have to defer ++ * allocation for pointer types. ++ */ ++ if (opcode != SpvOpTypePointer && opcode != SpvOpTypeForwardPointer) { ++ val = vtn_push_value(b, w[1], vtn_value_type_type); ++ vtn_fail_if(val->type != NULL, ++ "Only pointers can have forward declarations"); ++ val->type = vtn_zalloc(b, struct vtn_type); ++ val->type->id = w[1]; ++ } ++ ++ switch (opcode) { ++ case SpvOpTypeVoid: ++ val->type->base_type = vtn_base_type_void; ++ val->type->type = glsl_void_type(); ++ break; ++ case SpvOpTypeBool: ++ val->type->base_type = vtn_base_type_scalar; ++ val->type->type = glsl_bool_type(); ++ val->type->length = 1; ++ break; ++ case SpvOpTypeInt: { ++ int bit_size = w[2]; ++ const bool signedness = w[3]; ++ vtn_fail_if(bit_size != 8 && bit_size != 16 && ++ bit_size != 32 && bit_size != 64, ++ "Invalid int bit size: %u", bit_size); ++ val->type->base_type = vtn_base_type_scalar; ++ val->type->type = signedness ? glsl_intN_t_type(bit_size) : ++ glsl_uintN_t_type(bit_size); ++ val->type->length = 1; ++ break; ++ } ++ ++ case SpvOpTypeFloat: { ++ int bit_size = w[2]; ++ val->type->base_type = vtn_base_type_scalar; ++ val->type->length = 1; ++ ++ int32_t encoding = count > 3 ? w[3] : -1; ++ switch (encoding) { ++ case -1: ++ /* No encoding specified, it is a regular FP. */ ++ vtn_fail_if(bit_size != 16 && bit_size != 32 && bit_size != 64, ++ "Invalid float bit size: %u", bit_size); ++ val->type->type = glsl_floatN_t_type(bit_size); ++ break; ++ ++ case SpvFPEncodingBFloat16KHR: ++ vtn_fail_if(bit_size != 16, ++ "Invalid Bfloat16 bit size: %u", bit_size); ++ val->type->type = glsl_bfloatN_t_type(bit_size); ++ break; ++ ++ case SpvFPEncodingFloat8E4M3EXT: ++ vtn_fail_if(bit_size != 8, ++ "Invalid E4M3 bit size: %u", bit_size); ++ val->type->type = glsl_e4m3fn_t_type(); ++ break; ++ ++ case SpvFPEncodingFloat8E5M2EXT: ++ vtn_fail_if(bit_size != 8, ++ "Invalid E5M2 bit size: %u", bit_size); ++ val->type->type = glsl_e5m2_t_type(); ++ break; ++ ++ default: ++ vtn_fail("Unsupported OpTypeFloat encoding: %d", encoding); ++ } ++ break; ++ } ++ ++ case SpvOpTypeVector: { ++ struct vtn_type *base = vtn_get_type(b, w[2]); ++ unsigned elems = w[3]; ++ ++ vtn_fail_if(base->base_type != vtn_base_type_scalar, ++ "Base type for OpTypeVector must be a scalar"); ++ vtn_fail_if((elems < 2 || elems > 4) && (elems != 8) && (elems != 16), ++ "Invalid component count for OpTypeVector"); ++ ++ val->type->base_type = vtn_base_type_vector; ++ val->type->type = glsl_vector_type(glsl_get_base_type(base->type), elems); ++ val->type->length = elems; ++ val->type->stride = glsl_type_is_boolean(val->type->type) ++ ? 4 : glsl_get_bit_size(base->type) / 8; ++ val->type->array_element = base; ++ break; ++ } ++ ++ case SpvOpTypeMatrix: { ++ struct vtn_type *base = vtn_get_type(b, w[2]); ++ unsigned columns = w[3]; ++ ++ vtn_fail_if(base->base_type != vtn_base_type_vector, ++ "Base type for OpTypeMatrix must be a vector"); ++ vtn_fail_if(columns < 2 || columns > 4, ++ "Invalid column count for OpTypeMatrix"); ++ ++ val->type->base_type = vtn_base_type_matrix; ++ val->type->type = glsl_matrix_type(glsl_get_base_type(base->type), ++ glsl_get_vector_elements(base->type), ++ columns); ++ vtn_fail_if(glsl_type_is_error(val->type->type), ++ "Unsupported base type for OpTypeMatrix"); ++ assert(!glsl_type_is_error(val->type->type)); ++ val->type->length = columns; ++ val->type->array_element = base; ++ val->type->row_major = false; ++ val->type->stride = 0; ++ break; ++ } ++ ++ case SpvOpTypeRuntimeArray: ++ case SpvOpTypeArray: { ++ struct vtn_type *array_element = vtn_get_type(b, w[2]); ++ ++ if (opcode == SpvOpTypeRuntimeArray) { ++ /* A length of 0 is used to denote unsized arrays */ ++ val->type->length = 0; ++ } else { ++ val->type->length = vtn_constant_uint(b, w[3]); ++ } ++ ++ val->type->base_type = vtn_base_type_array; ++ val->type->array_element = array_element; ++ ++ vtn_foreach_decoration(b, val, array_stride_decoration_cb, NULL); ++ val->type->type = glsl_array_type(array_element->type, val->type->length, ++ val->type->stride); ++ break; ++ } ++ ++ case SpvOpTypeStruct: { ++ unsigned num_fields = count - 2; ++ val->type->base_type = vtn_base_type_struct; ++ val->type->length = num_fields; ++ val->type->members = vtn_alloc_array(b, struct vtn_type *, num_fields); ++ val->type->offsets = vtn_alloc_array(b, unsigned, num_fields); ++ val->type->packed = false; ++ ++ NIR_VLA(struct glsl_struct_field, fields, count); ++ for (unsigned i = 0; i < num_fields; i++) { ++ val->type->members[i] = vtn_get_type(b, w[i + 2]); ++ const char *name = NULL; ++ for (struct vtn_decoration *dec = val->decoration; dec; dec = dec->next) { ++ if (dec->scope == VTN_DEC_STRUCT_MEMBER_NAME0 - i) { ++ name = dec->member_name; ++ break; ++ } ++ } ++ if (!name) ++ name = ralloc_asprintf(b, "field%d", i); ++ ++ fields[i] = (struct glsl_struct_field) { ++ .type = val->type->members[i]->type, ++ .name = name, ++ .location = -1, ++ .offset = -1, ++ }; ++ } ++ ++ vtn_foreach_decoration(b, val, struct_packed_decoration_cb, NULL); ++ ++ struct member_decoration_ctx ctx = { ++ .num_fields = num_fields, ++ .fields = fields, ++ .type = val->type ++ }; ++ ++ vtn_foreach_decoration(b, val, struct_member_decoration_cb, &ctx); ++ ++ /* Propagate access specifiers that are present on all members to the overall type */ ++ enum gl_access_qualifier overall_access = ACCESS_COHERENT | ACCESS_VOLATILE | ++ ACCESS_NON_READABLE | ACCESS_NON_WRITEABLE; ++ for (unsigned i = 0; i < num_fields; ++i) ++ overall_access &= val->type->members[i]->access; ++ val->type->access = overall_access; ++ ++ vtn_foreach_decoration(b, val, struct_member_matrix_stride_cb, &ctx); ++ ++ vtn_foreach_decoration(b, val, struct_block_decoration_cb, NULL); ++ ++ const char *name = val->name; ++ ++ if (val->type->block || val->type->buffer_block) { ++ /* Packing will be ignored since types coming from SPIR-V are ++ * explicitly laid out. ++ */ ++ val->type->type = glsl_interface_type(fields, num_fields, ++ /* packing */ 0, false, ++ name ? name : "block"); ++ } else { ++ val->type->type = glsl_struct_type(fields, num_fields, ++ name ? name : "struct", ++ val->type->packed); ++ } ++ break; ++ } ++ ++ case SpvOpTypeFunction: { ++ val->type->base_type = vtn_base_type_function; ++ val->type->type = NULL; ++ ++ val->type->return_type = vtn_get_type(b, w[2]); ++ ++ const unsigned num_params = count - 3; ++ val->type->length = num_params; ++ val->type->params = vtn_alloc_array(b, struct vtn_type *, num_params); ++ for (unsigned i = 0; i < count - 3; i++) { ++ val->type->params[i] = vtn_get_type(b, w[i + 3]); ++ } ++ break; ++ } ++ ++ case SpvOpTypeUntypedPointerKHR: { ++ SpvStorageClass storage_class = w[2]; ++ val->type->base_type = vtn_base_type_pointer; ++ val->type->storage_class = storage_class; ++ ++ /* For untyped pointers, storage class alone should be sufficient to ++ * identify the right variable_mode (and glsl_type). The special cases ++ * are either handling legacy stuff or classes not used with untyped ++ * pointers. ++ */ ++ enum vtn_variable_mode mode = vtn_storage_class_to_mode( ++ b, storage_class, NULL, NULL); ++ val->type->type = nir_address_format_to_glsl_type( ++ vtn_mode_to_address_format(b, mode)); ++ ++ vtn_foreach_decoration(b, val, array_stride_decoration_cb, NULL); ++ ++ break; ++ } ++ ++ case SpvOpTypePointer: ++ case SpvOpTypeForwardPointer: { ++ /* We can't blindly push the value because it might be a forward ++ * declaration. ++ */ ++ val = vtn_untyped_value(b, w[1]); ++ ++ SpvStorageClass storage_class = w[2]; ++ ++ vtn_fail_if(opcode == SpvOpTypeForwardPointer && ++ b->shader->info.stage != MESA_SHADER_KERNEL && ++ storage_class != SpvStorageClassPhysicalStorageBuffer, ++ "OpTypeForwardPointer is only allowed in Vulkan with " ++ "the PhysicalStorageBuffer storage class"); ++ ++ struct vtn_type *pointed_type = NULL; ++ if (opcode == SpvOpTypePointer) ++ pointed_type = vtn_get_type(b, w[3]); ++ ++ bool has_forward_pointer = false; ++ if (val->value_type == vtn_value_type_invalid) { ++ val->value_type = vtn_value_type_type; ++ val->type = vtn_zalloc(b, struct vtn_type); ++ val->type->id = w[1]; ++ val->type->base_type = vtn_base_type_pointer; ++ val->type->storage_class = storage_class; ++ ++ /* These can actually be stored to nir_variables and used as SSA ++ * values so they need a real glsl_type. ++ */ ++ enum vtn_variable_mode mode = vtn_storage_class_to_mode( ++ b, storage_class, pointed_type, NULL); ++ ++ /* The deref type should only matter for the UniformConstant storage ++ * class. In particular, it should never matter for any storage ++ * classes that are allowed in combination with OpTypeForwardPointer. ++ */ ++ if (storage_class != SpvStorageClassUniform && ++ storage_class != SpvStorageClassUniformConstant) { ++ assert(mode == vtn_storage_class_to_mode(b, storage_class, ++ NULL, NULL)); ++ } ++ ++ val->type->type = nir_address_format_to_glsl_type( ++ vtn_mode_to_address_format(b, mode)); ++ } else { ++ vtn_fail_if(val->type->storage_class != storage_class, ++ "The storage classes of an OpTypePointer and any " ++ "OpTypeForwardPointers that provide forward " ++ "declarations of it must match."); ++ has_forward_pointer = true; ++ } ++ ++ if (opcode == SpvOpTypePointer) { ++ vtn_fail_if(val->type->pointed != NULL, ++ "While OpTypeForwardPointer can be used to provide a " ++ "forward declaration of a pointer, OpTypePointer can " ++ "only be used once for a given id."); ++ ++ vtn_fail_if(has_forward_pointer && ++ pointed_type->base_type != vtn_base_type_struct, ++ "An OpTypePointer instruction must declare " ++ "Pointer Type to be a pointer to an OpTypeStruct."); ++ ++ val->type->pointed = pointed_type; ++ ++ /* Only certain storage classes use ArrayStride. */ ++ switch (storage_class) { ++ case SpvStorageClassWorkgroup: ++ if (!b->supported_capabilities.WorkgroupMemoryExplicitLayoutKHR) ++ break; ++ FALLTHROUGH; ++ ++ case SpvStorageClassUniform: ++ case SpvStorageClassPushConstant: ++ case SpvStorageClassStorageBuffer: ++ case SpvStorageClassPhysicalStorageBuffer: ++ vtn_foreach_decoration(b, val, array_stride_decoration_cb, NULL); ++ break; ++ ++ default: ++ /* Nothing to do. */ ++ break; ++ } ++ } ++ break; ++ } ++ ++ case SpvOpTypeImage: { ++ val->type->base_type = vtn_base_type_image; ++ ++ /* Images are represented in NIR as a scalar SSA value that is the ++ * result of a deref instruction. An OpLoad on an OpTypeImage pointer ++ * from UniformConstant memory just takes the NIR deref from the pointer ++ * and turns it into an SSA value. ++ */ ++ val->type->type = nir_address_format_to_glsl_type( ++ vtn_mode_to_address_format(b, vtn_variable_mode_function)); ++ ++ const struct vtn_type *sampled_type = vtn_get_type(b, w[2]); ++ if (b->shader->info.stage == MESA_SHADER_KERNEL) { ++ vtn_fail_if(sampled_type->base_type != vtn_base_type_void, ++ "Sampled type of OpTypeImage must be void for kernels"); ++ } else { ++ vtn_fail_if(sampled_type->base_type != vtn_base_type_scalar, ++ "Sampled type of OpTypeImage must be a scalar"); ++ if (b->supported_capabilities.Int64ImageEXT) { ++ vtn_fail_if(glsl_get_bit_size(sampled_type->type) != 32 && ++ glsl_get_bit_size(sampled_type->type) != 64, ++ "Sampled type of OpTypeImage must be a 32 or 64-bit " ++ "scalar"); ++ } else { ++ vtn_fail_if(glsl_get_bit_size(sampled_type->type) != 32, ++ "Sampled type of OpTypeImage must be a 32-bit scalar"); ++ } ++ } ++ ++ enum glsl_sampler_dim dim; ++ switch ((SpvDim)w[3]) { ++ case SpvDim1D: dim = GLSL_SAMPLER_DIM_1D; break; ++ case SpvDim2D: dim = GLSL_SAMPLER_DIM_2D; break; ++ case SpvDim3D: dim = GLSL_SAMPLER_DIM_3D; break; ++ case SpvDimCube: dim = GLSL_SAMPLER_DIM_CUBE; break; ++ case SpvDimRect: dim = GLSL_SAMPLER_DIM_RECT; break; ++ case SpvDimBuffer: dim = GLSL_SAMPLER_DIM_BUF; break; ++ case SpvDimSubpassData: dim = GLSL_SAMPLER_DIM_SUBPASS; break; ++ default: ++ vtn_fail("Invalid SPIR-V image dimensionality: %s (%u)", ++ spirv_dim_to_string((SpvDim)w[3]), w[3]); ++ } ++ ++ /* w[4]: as per Vulkan spec "Validation Rules within a Module", ++ * The “Depth” operand of OpTypeImage is ignored. ++ */ ++ bool is_array = w[5]; ++ bool multisampled = w[6]; ++ unsigned sampled = w[7]; ++ SpvImageFormat format = w[8]; ++ ++ if (count > 9) ++ val->type->access_qualifier = w[9]; ++ else if (b->shader->info.stage == MESA_SHADER_KERNEL) ++ /* Per the CL C spec: If no qualifier is provided, read_only is assumed. */ ++ val->type->access_qualifier = SpvAccessQualifierReadOnly; ++ else ++ val->type->access_qualifier = SpvAccessQualifierReadWrite; ++ ++ if (multisampled) { ++ if (dim == GLSL_SAMPLER_DIM_2D) ++ dim = GLSL_SAMPLER_DIM_MS; ++ else if (dim == GLSL_SAMPLER_DIM_SUBPASS) ++ dim = GLSL_SAMPLER_DIM_SUBPASS_MS; ++ else ++ vtn_fail("Unsupported multisampled image type"); ++ } ++ ++ val->type->image_format = translate_image_format(b, format); ++ ++ enum glsl_base_type sampled_base_type = ++ glsl_get_base_type(sampled_type->type); ++ if (sampled == 1) { ++ val->type->glsl_image = glsl_texture_type(dim, is_array, ++ sampled_base_type); ++ } else if (sampled == 2) { ++ val->type->glsl_image = glsl_image_type(dim, is_array, ++ sampled_base_type); ++ } else if (b->shader->info.stage == MESA_SHADER_KERNEL) { ++ val->type->glsl_image = glsl_image_type(dim, is_array, ++ GLSL_TYPE_VOID); ++ } else { ++ vtn_fail("We need to know if the image will be sampled"); ++ } ++ break; ++ } ++ ++ case SpvOpTypeSampledImage: { ++ val->type->base_type = vtn_base_type_sampled_image; ++ val->type->image = vtn_get_type(b, w[2]); ++ ++ validate_image_type_for_sampled_image( ++ b, val->type->image->glsl_image, ++ "Image Type operand of OpTypeSampledImage"); ++ ++ /* Sampled images are represented NIR as a vec2 SSA value where each ++ * component is the result of a deref instruction. The first component ++ * is the image and the second is the sampler. An OpLoad on an ++ * OpTypeSampledImage pointer from UniformConstant memory just takes ++ * the NIR deref from the pointer and duplicates it to both vector ++ * components. ++ */ ++ nir_address_format addr_format = ++ vtn_mode_to_address_format(b, vtn_variable_mode_function); ++ assert(nir_address_format_num_components(addr_format) == 1); ++ unsigned bit_size = nir_address_format_bit_size(addr_format); ++ assert(bit_size == 32 || bit_size == 64); ++ ++ enum glsl_base_type base_type = ++ bit_size == 32 ? GLSL_TYPE_UINT : GLSL_TYPE_UINT64; ++ val->type->type = glsl_vector_type(base_type, 2); ++ break; ++ } ++ ++ case SpvOpTypeSampler: ++ val->type->base_type = vtn_base_type_sampler; ++ ++ /* Samplers are represented in NIR as a scalar SSA value that is the ++ * result of a deref instruction. An OpLoad on an OpTypeSampler pointer ++ * from UniformConstant memory just takes the NIR deref from the pointer ++ * and turns it into an SSA value. ++ */ ++ val->type->type = nir_address_format_to_glsl_type( ++ vtn_mode_to_address_format(b, vtn_variable_mode_function)); ++ break; ++ ++ case SpvOpTypeAccelerationStructureKHR: ++ val->type->base_type = vtn_base_type_accel_struct; ++ val->type->type = glsl_uint64_t_type(); ++ break; ++ ++ ++ case SpvOpTypeOpaque: { ++ val->type->base_type = vtn_base_type_struct; ++ const char *name = vtn_string_literal(b, &w[2], count - 2, NULL); ++ val->type->type = glsl_struct_type(NULL, 0, name, false); ++ break; ++ } ++ ++ case SpvOpTypeRayQueryKHR: { ++ val->type->base_type = vtn_base_type_ray_query; ++ val->type->type = glsl_uint64_t_type(); ++ /* We may need to run queries on helper invocations. Here the parser ++ * doesn't go through a deeper analysis on whether the result of a query ++ * will be used in derivative instructions. ++ * ++ * An implementation willing to optimize this would look through the IR ++ * and check if any derivative instruction uses the result of a query ++ * and drop this flag if not. ++ */ ++ if (b->shader->info.stage == MESA_SHADER_FRAGMENT) ++ val->type->access = ACCESS_INCLUDE_HELPERS; ++ break; ++ } ++ ++ case SpvOpTypeCooperativeMatrixKHR: ++ vtn_handle_cooperative_type(b, val, opcode, w, count); ++ break; ++ ++ case SpvOpTypeEvent: ++ val->type->base_type = vtn_base_type_event; ++ /* ++ * this makes the event type compatible with pointer size due to LLVM 16. ++ * llvm 17 fixes this properly, but with 16 and opaque ptrs it's still wrong. ++ */ ++ val->type->type = b->shader->info.cs.ptr_size == 64 ? glsl_int64_t_type() : glsl_int_type(); ++ break; ++ ++ case SpvOpTypeDeviceEvent: ++ case SpvOpTypeReserveId: ++ case SpvOpTypeQueue: ++ case SpvOpTypePipe: ++ default: ++ vtn_fail_with_opcode("Unhandled opcode", opcode); ++ } ++ ++ vtn_foreach_decoration(b, val, type_decoration_cb, NULL); ++ ++ if (val->type->base_type == vtn_base_type_struct && ++ (val->type->block || val->type->buffer_block)) { ++ for (unsigned i = 0; i < val->type->length; i++) { ++ vtn_fail_if(vtn_type_contains_block(b, val->type->members[i]), ++ "Block and BufferBlock decorations cannot decorate a " ++ "structure type that is nested at any level inside " ++ "another structure type decorated with Block or " ++ "BufferBlock."); ++ } ++ } ++} ++ ++static nir_constant * ++vtn_null_constant(struct vtn_builder *b, struct vtn_type *type) ++{ ++ nir_constant *c = rzalloc(b, nir_constant); ++ ++ switch (type->base_type) { ++ case vtn_base_type_scalar: ++ case vtn_base_type_vector: ++ case vtn_base_type_cooperative_matrix: ++ c->is_null_constant = true; ++ /* Nothing to do here. It's already initialized to zero */ ++ break; ++ ++ case vtn_base_type_pointer: { ++ enum vtn_variable_mode mode = vtn_storage_class_to_mode( ++ b, type->storage_class, type->pointed, NULL); ++ nir_address_format addr_format = vtn_mode_to_address_format(b, mode); ++ ++ const nir_const_value *null_value = nir_address_format_null_value(addr_format); ++ memcpy(c->values, null_value, ++ sizeof(nir_const_value) * nir_address_format_num_components(addr_format)); ++ break; ++ } ++ ++ case vtn_base_type_void: ++ case vtn_base_type_image: ++ case vtn_base_type_sampler: ++ case vtn_base_type_sampled_image: ++ case vtn_base_type_function: ++ case vtn_base_type_event: ++ /* For those we have to return something but it doesn't matter what. */ ++ break; ++ ++ case vtn_base_type_matrix: ++ case vtn_base_type_array: ++ vtn_assert(type->length > 0); ++ c->is_null_constant = true; ++ c->num_elements = type->length; ++ c->elements = ralloc_array(b, nir_constant *, c->num_elements); ++ ++ c->elements[0] = vtn_null_constant(b, type->array_element); ++ for (unsigned i = 1; i < c->num_elements; i++) ++ c->elements[i] = c->elements[0]; ++ break; ++ ++ case vtn_base_type_struct: ++ c->is_null_constant = true; ++ c->num_elements = type->length; ++ if (c->num_elements) { ++ c->elements = ralloc_array(b, nir_constant *, c->num_elements); ++ for (unsigned i = 0; i < c->num_elements; i++) ++ c->elements[i] = vtn_null_constant(b, type->members[i]); ++ } ++ break; ++ ++ default: ++ vtn_fail("Invalid type for null constant"); ++ } ++ ++ return c; ++} ++ ++static void ++spec_constant_decoration_cb(struct vtn_builder *b, UNUSED struct vtn_value *val, ++ ASSERTED int member, ++ const struct vtn_decoration *dec, void *data) ++{ ++ vtn_assert(member == -1); ++ if (dec->decoration != SpvDecorationSpecId) ++ return; ++ ++ nir_const_value *value = data; ++ for (unsigned i = 0; i < b->num_specializations; i++) { ++ if (b->specializations[i].id == dec->operands[0]) { ++ *value = b->specializations[i].value; ++ return; ++ } ++ } ++} ++ ++static void ++handle_workgroup_size_decoration_cb(struct vtn_builder *b, ++ struct vtn_value *val, ++ ASSERTED int member, ++ const struct vtn_decoration *dec, ++ UNUSED void *data) ++{ ++ vtn_assert(member == -1); ++ if (dec->decoration != SpvDecorationBuiltIn || ++ dec->operands[0] != SpvBuiltInWorkgroupSize) ++ return; ++ ++ vtn_assert(val->type->type == glsl_vector_type(GLSL_TYPE_UINT, 3)); ++ b->workgroup_size_builtin = val; ++} ++ ++static void ++vtn_handle_constant(struct vtn_builder *b, SpvOp opcode, ++ const uint32_t *w, unsigned count) ++{ ++ struct vtn_value *val = vtn_push_value(b, w[2], vtn_value_type_constant); ++ val->constant = rzalloc(b, nir_constant); ++ switch (opcode) { ++ case SpvOpConstantTrue: ++ case SpvOpConstantFalse: ++ case SpvOpSpecConstantTrue: ++ case SpvOpSpecConstantFalse: { ++ vtn_fail_if(val->type->type != glsl_bool_type(), ++ "Result type of %s must be OpTypeBool", ++ spirv_op_to_string(opcode)); ++ ++ bool bval = (opcode == SpvOpConstantTrue || ++ opcode == SpvOpSpecConstantTrue); ++ ++ nir_const_value u32val = nir_const_value_for_uint(bval, 32); ++ ++ if (opcode == SpvOpSpecConstantTrue || ++ opcode == SpvOpSpecConstantFalse) ++ vtn_foreach_decoration(b, val, spec_constant_decoration_cb, &u32val); ++ ++ val->constant->values[0].b = u32val.u32 != 0; ++ break; ++ } ++ ++ case SpvOpConstant: ++ case SpvOpSpecConstant: { ++ vtn_fail_if(val->type->base_type != vtn_base_type_scalar, ++ "Result type of %s must be a scalar", ++ spirv_op_to_string(opcode)); ++ int bit_size = glsl_get_bit_size(val->type->type); ++ switch (bit_size) { ++ case 64: ++ val->constant->values[0].u64 = vtn_u64_literal(&w[3]); ++ break; ++ case 32: ++ val->constant->values[0].u32 = w[3]; ++ break; ++ case 16: ++ val->constant->values[0].u16 = w[3]; ++ break; ++ case 8: ++ val->constant->values[0].u8 = w[3]; ++ break; ++ default: ++ vtn_fail("Unsupported SpvOpConstant bit size: %u", bit_size); ++ } ++ ++ if (opcode == SpvOpSpecConstant) ++ vtn_foreach_decoration(b, val, spec_constant_decoration_cb, ++ &val->constant->values[0]); ++ break; ++ } ++ ++ case SpvOpSpecConstantComposite: ++ case SpvOpConstantComposite: ++ case SpvOpConstantCompositeReplicateEXT: ++ case SpvOpSpecConstantCompositeReplicateEXT: { ++ const unsigned elem_count = ++ val->type->base_type == vtn_base_type_cooperative_matrix ? ++ 1 : val->type->length; ++ ++ nir_constant **elems = ralloc_array(b, nir_constant *, elem_count); ++ if (opcode == SpvOpConstantCompositeReplicateEXT || ++ opcode == SpvOpSpecConstantCompositeReplicateEXT) { ++ struct vtn_value *elem_val = vtn_untyped_value(b, w[3]); ++ ++ if (elem_val->value_type == vtn_value_type_constant) { ++ elems[0] = elem_val->constant; ++ val->is_undef_constant = false; ++ } else { ++ vtn_fail_if(elem_val->value_type != vtn_value_type_undef, ++ "only constants or undefs allowed for %s", ++ spirv_op_to_string(opcode)); ++ /* to make it easier, just insert a NULL constant for now */ ++ elems[0] = vtn_null_constant(b, elem_val->type); ++ val->is_undef_constant = true; ++ } ++ ++ for (unsigned i = 1; i < elem_count; i++) ++ elems[i] = elems[0]; ++ } else { ++ vtn_fail_if(elem_count != count - 3, ++ "%s has %u constituents, expected %u", ++ spirv_op_to_string(opcode), count - 3, elem_count); ++ ++ val->is_undef_constant = true; ++ for (unsigned i = 0; i < elem_count; i++) { ++ struct vtn_value *elem_val = vtn_untyped_value(b, w[i + 3]); ++ ++ if (elem_val->value_type == vtn_value_type_constant) { ++ elems[i] = elem_val->constant; ++ val->is_undef_constant = val->is_undef_constant && ++ elem_val->is_undef_constant; ++ } else { ++ vtn_fail_if(elem_val->value_type != vtn_value_type_undef, ++ "only constants or undefs allowed for %s", ++ spirv_op_to_string(opcode)); ++ /* to make it easier, just insert a NULL constant for now */ ++ elems[i] = vtn_null_constant(b, elem_val->type); ++ } ++ } ++ } ++ ++ switch (val->type->base_type) { ++ case vtn_base_type_vector: { ++ assert(glsl_type_is_vector(val->type->type)); ++ for (unsigned i = 0; i < elem_count; i++) ++ val->constant->values[i] = elems[i]->values[0]; ++ break; ++ } ++ ++ case vtn_base_type_matrix: ++ case vtn_base_type_struct: ++ case vtn_base_type_array: ++ ralloc_steal(val->constant, elems); ++ val->constant->num_elements = elem_count; ++ val->constant->elements = elems; ++ break; ++ ++ case vtn_base_type_cooperative_matrix: ++ val->constant->values[0] = elems[0]->values[0]; ++ break; ++ ++ default: ++ vtn_fail("Result type of %s must be a composite type", ++ spirv_op_to_string(opcode)); ++ } ++ break; ++ } ++ ++ case SpvOpSpecConstantOp: { ++ nir_const_value u32op = nir_const_value_for_uint(w[3], 32); ++ vtn_foreach_decoration(b, val, spec_constant_decoration_cb, &u32op); ++ SpvOp opcode = u32op.u32; ++ switch (opcode) { ++ case SpvOpBitcast: { ++ struct vtn_value *src = &b->values[w[4]]; ++ ++ vtn_assert(src->value_type == vtn_value_type_constant || ++ src->value_type == vtn_value_type_undef); ++ ++ unsigned src_len = glsl_get_vector_elements(src->type->type); ++ unsigned dst_len = glsl_get_vector_elements(val->type->type); ++ ++ unsigned src_bit_size = glsl_get_bit_size(src->type->type); ++ unsigned dst_bit_size = glsl_get_bit_size(val->type->type); ++ ++ vtn_assert(src_len * src_bit_size == dst_len * dst_bit_size); ++ ++ /* This will end up being zero */ ++ if (src->value_type == vtn_value_type_undef) ++ break; ++ ++ if (src_bit_size == dst_bit_size) { ++ /* This is just a copy */ ++ for (unsigned i = 0; i < src_len; i++) ++ val->constant->values[i] = src->constant->values[i]; ++ } else { ++ /* You can't non-trivially bitcast booleans */ ++ vtn_assert(src_bit_size >= 8 && dst_bit_size >= 8); ++ const unsigned src_byte_size = src_bit_size / 8; ++ const unsigned dst_byte_size = dst_bit_size / 8; ++ ++ vtn_assert(src_len <= NIR_MAX_VEC_COMPONENTS && ++ dst_len <= NIR_MAX_VEC_COMPONENTS); ++ ++ uint8_t bits[NIR_MAX_VEC_COMPONENTS * sizeof(nir_const_value)]; ++ ++ for (unsigned i = 0; i < src_len; i++) { ++ uint64_t v = nir_const_value_as_int(src->constant->values[i], ++ src_bit_size); ++ memcpy(bits + i * src_byte_size, &v, src_byte_size); ++ } ++ ++ for (unsigned i = 0; i < dst_len; i++) { ++ uint64_t v = 0; ++ memcpy(&v, bits + i * dst_byte_size, dst_byte_size); ++ val->constant->values[i] = ++ nir_const_value_for_uint(v, dst_bit_size); ++ } ++ } ++ break; ++ } ++ case SpvOpVectorShuffle: { ++ struct vtn_value *v0 = &b->values[w[4]]; ++ struct vtn_value *v1 = &b->values[w[5]]; ++ ++ vtn_assert(v0->value_type == vtn_value_type_constant || ++ v0->value_type == vtn_value_type_undef); ++ vtn_assert(v1->value_type == vtn_value_type_constant || ++ v1->value_type == vtn_value_type_undef); ++ ++ unsigned len0 = glsl_get_vector_elements(v0->type->type); ++ unsigned len1 = glsl_get_vector_elements(v1->type->type); ++ ++ vtn_assert(len0 + len1 < 16); ++ ++ unsigned bit_size = glsl_get_bit_size(val->type->type); ++ unsigned bit_size0 = glsl_get_bit_size(v0->type->type); ++ unsigned bit_size1 = glsl_get_bit_size(v1->type->type); ++ ++ vtn_assert(bit_size == bit_size0 && bit_size == bit_size1); ++ (void)bit_size0; (void)bit_size1; ++ ++ nir_const_value undef = { .u64 = 0xdeadbeefdeadbeef }; ++ nir_const_value combined[NIR_MAX_VEC_COMPONENTS * 2]; ++ ++ if (v0->value_type == vtn_value_type_constant) { ++ for (unsigned i = 0; i < len0; i++) ++ combined[i] = v0->constant->values[i]; ++ } ++ if (v1->value_type == vtn_value_type_constant) { ++ for (unsigned i = 0; i < len1; i++) ++ combined[len0 + i] = v1->constant->values[i]; ++ } ++ ++ for (unsigned i = 0, j = 0; i < count - 6; i++, j++) { ++ uint32_t comp = w[i + 6]; ++ if (comp == (uint32_t)-1) { ++ /* If component is not used, set the value to a known constant ++ * to detect if it is wrongly used. ++ */ ++ val->constant->values[j] = undef; ++ } else { ++ vtn_fail_if(comp >= len0 + len1, ++ "All Component literals must either be FFFFFFFF " ++ "or in [0, N - 1] (inclusive)."); ++ val->constant->values[j] = combined[comp]; ++ } ++ } ++ break; ++ } ++ ++ case SpvOpCompositeExtract: ++ case SpvOpCompositeInsert: { ++ struct vtn_value *comp; ++ unsigned deref_start; ++ struct nir_constant **c; ++ if (opcode == SpvOpCompositeExtract) { ++ comp = vtn_value(b, w[4], vtn_value_type_constant); ++ deref_start = 5; ++ c = &comp->constant; ++ } else { ++ comp = vtn_value(b, w[5], vtn_value_type_constant); ++ deref_start = 6; ++ val->constant = nir_constant_clone(comp->constant, b->shader); ++ c = &val->constant; ++ } ++ ++ int elem = -1; ++ const struct vtn_type *type = comp->type; ++ for (unsigned i = deref_start; i < count; i++) { ++ if (type->base_type == vtn_base_type_cooperative_matrix) { ++ /* Cooperative matrices are always scalar constants. We don't ++ * care about the index w[i] because it's always replicated. ++ */ ++ type = type->component_type; ++ } else { ++ vtn_fail_if(w[i] > type->length, ++ "%uth index of %s is %u but the type has only " ++ "%u elements", i - deref_start, ++ spirv_op_to_string(opcode), w[i], type->length); ++ ++ switch (type->base_type) { ++ case vtn_base_type_vector: ++ elem = w[i]; ++ type = type->array_element; ++ break; ++ ++ case vtn_base_type_matrix: ++ case vtn_base_type_array: ++ c = &(*c)->elements[w[i]]; ++ type = type->array_element; ++ break; ++ ++ case vtn_base_type_struct: ++ c = &(*c)->elements[w[i]]; ++ type = type->members[w[i]]; ++ break; ++ ++ default: ++ vtn_fail("%s must only index into composite types", ++ spirv_op_to_string(opcode)); ++ } ++ } ++ } ++ ++ if (opcode == SpvOpCompositeExtract) { ++ if (elem == -1) { ++ val->constant = *c; ++ } else { ++ unsigned num_components = type->length; ++ for (unsigned i = 0; i < num_components; i++) ++ val->constant->values[i] = (*c)->values[elem + i]; ++ } ++ } else { ++ struct vtn_value *insert = ++ vtn_value(b, w[4], vtn_value_type_constant); ++ vtn_assert(insert->type == type); ++ if (elem == -1) { ++ *c = insert->constant; ++ } else { ++ unsigned num_components = type->length; ++ for (unsigned i = 0; i < num_components; i++) ++ (*c)->values[elem + i] = insert->constant->values[i]; ++ } ++ } ++ break; ++ } ++ ++ default: { ++ bool swap; ++ ++ const glsl_type *org_dst_type = val->type->type; ++ const glsl_type *org_src_type = org_dst_type; ++ ++ const bool saturate = vtn_has_decoration(b, val, SpvDecorationSaturatedToLargestFloat8NormalConversionEXT); ++ unsigned num_components = glsl_get_vector_elements(val->type->type); ++ ++ vtn_assert(count <= 7); ++ ++ switch (opcode) { ++ case SpvOpSConvert: ++ case SpvOpFConvert: ++ case SpvOpUConvert: ++ /* We have a different source type in a conversion. */ ++ org_src_type = vtn_get_value_type(b, w[4])->type; ++ break; ++ default: ++ break; ++ }; ++ ++ const glsl_type *dst_type = org_dst_type; ++ if (glsl_type_is_bfloat_16(dst_type) || glsl_type_is_e4m3fn(dst_type) || glsl_type_is_e5m2(dst_type)) ++ dst_type = glsl_float_type(); ++ ++ const glsl_type *src_type = org_src_type; ++ if (glsl_type_is_bfloat_16(src_type) || glsl_type_is_e4m3fn(src_type) || glsl_type_is_e5m2(src_type)) ++ src_type = glsl_float_type(); ++ ++ bool exact; ++ nir_op op = vtn_nir_alu_op_for_spirv_opcode(b, opcode, &swap, &exact, ++ src_type, dst_type); ++ ++ /* No SPIR-V opcodes handled through this path should set exact. ++ * Since it is ignored, assert on it. ++ */ ++ assert(!exact); ++ ++ unsigned bit_size = glsl_get_bit_size(dst_type); ++ nir_const_value src[3][NIR_MAX_VEC_COMPONENTS]; ++ ++ for (unsigned i = 0; i < count - 4; i++) { ++ struct vtn_value *src_val = ++ vtn_value(b, w[4 + i], vtn_value_type_constant); ++ ++ /* If this is an unsized source, pull the bit size from the ++ * source; otherwise, we'll use the bit size from the destination. ++ */ ++ if (!nir_alu_type_get_type_size(nir_op_infos[op].input_types[i])) { ++ if (org_src_type != src_type) { ++ /* Small float conversion. */ ++ assert(i == 0); ++ bit_size = glsl_get_bit_size(src_type); ++ } else { ++ bit_size = glsl_get_bit_size(src_val->type->type); ++ } ++ } ++ ++ unsigned src_comps = nir_op_infos[op].input_sizes[i] ? ++ nir_op_infos[op].input_sizes[i] : ++ num_components; ++ ++ unsigned j = swap ? 1 - i : i; ++ for (unsigned c = 0; c < src_comps; c++) { ++ src[j][c] = src_val->constant->values[c]; ++ if (glsl_type_is_bfloat_16(org_src_type)) ++ src[j][c].f32 = _mesa_bfloat16_bits_to_float(src[j][c].u16); ++ else if (glsl_type_is_e4m3fn(org_src_type)) ++ src[j][c].f32 = _mesa_e4m3fn_to_float(src[j][c].u8); ++ else if (glsl_type_is_e5m2(org_src_type)) ++ src[j][c].f32 = _mesa_e5m2_to_float(src[j][c].u8); ++ } ++ } ++ ++ /* fix up fixed size sources */ ++ switch (op) { ++ case nir_op_ishl: ++ case nir_op_ishr: ++ case nir_op_ushr: { ++ if (bit_size == 32) ++ break; ++ for (unsigned i = 0; i < num_components; ++i) { ++ switch (bit_size) { ++ case 64: src[1][i].u32 = src[1][i].u64; break; ++ case 16: src[1][i].u32 = src[1][i].u16; break; ++ case 8: src[1][i].u32 = src[1][i].u8; break; ++ } ++ } ++ break; ++ } ++ default: ++ break; ++ } ++ ++ nir_const_value *srcs[3] = { ++ src[0], src[1], src[2], ++ }; ++ nir_eval_const_opcode(op, val->constant->values, ++ num_components, bit_size, srcs, ++ b->shader->info.float_controls_execution_mode); ++ ++ for (int i = 0; i < num_components; i++) { ++ uint16_t conv; ++ if (glsl_type_is_bfloat_16(org_dst_type)) { ++ conv = _mesa_float_to_bfloat16_bits_rte(val->constant->values[i].f32); ++ } else if (glsl_type_is_e4m3fn(org_dst_type)) { ++ if (saturate) ++ conv = _mesa_float_to_e4m3fn_sat(val->constant->values[i].f32); ++ else ++ conv = _mesa_float_to_e4m3fn(val->constant->values[i].f32); ++ } else if (glsl_type_is_e5m2(org_dst_type)) { ++ if (saturate) ++ conv = _mesa_float_to_e5m2_sat(val->constant->values[i].f32); ++ else ++ conv = _mesa_float_to_e5m2(val->constant->values[i].f32); ++ } else { ++ continue; ++ } ++ ++ val->constant->values[i] = nir_const_value_for_raw_uint(conv, glsl_get_bit_size(org_dst_type)); ++ } ++ ++ break; ++ } /* default */ ++ } ++ break; ++ } ++ ++ case SpvOpConstantNull: ++ val->constant = vtn_null_constant(b, val->type); ++ val->is_null_constant = true; ++ break; ++ ++ default: ++ vtn_fail_with_opcode("Unhandled opcode", opcode); ++ } ++ ++ /* Now that we have the value, update the workgroup size if needed */ ++ if (mesa_shader_stage_uses_workgroup(b->entry_point_stage)) ++ vtn_foreach_decoration(b, val, handle_workgroup_size_decoration_cb, ++ NULL); ++} ++ ++static void ++vtn_split_barrier_semantics(struct vtn_builder *b, ++ SpvMemorySemanticsMask semantics, ++ SpvMemorySemanticsMask *before, ++ SpvMemorySemanticsMask *after) ++{ ++ /* For memory semantics embedded in operations, we split them into up to ++ * two barriers, to be added before and after the operation. This is less ++ * strict than if we propagated until the final backend stage, but still ++ * result in correct execution. ++ * ++ * A further improvement could be pipe this information (and use!) into the ++ * next compiler layers, at the expense of making the handling of barriers ++ * more complicated. ++ */ ++ ++ *before = SpvMemorySemanticsMaskNone; ++ *after = SpvMemorySemanticsMaskNone; ++ ++ SpvMemorySemanticsMask order_semantics = ++ semantics & (SpvMemorySemanticsAcquireMask | ++ SpvMemorySemanticsReleaseMask | ++ SpvMemorySemanticsAcquireReleaseMask | ++ SpvMemorySemanticsSequentiallyConsistentMask); ++ ++ if (util_bitcount(order_semantics) > 1) { ++ /* Old GLSLang versions incorrectly set all the ordering bits. This was ++ * fixed in c51287d744fb6e7e9ccc09f6f8451e6c64b1dad6 of glslang repo, ++ * and it is in GLSLang since revision "SPIRV99.1321" (from Jul-2016). ++ */ ++ vtn_warn("Multiple memory ordering semantics specified, " ++ "assuming AcquireRelease."); ++ order_semantics = SpvMemorySemanticsAcquireReleaseMask; ++ } ++ ++ const SpvMemorySemanticsMask av_vis_semantics = ++ semantics & (SpvMemorySemanticsMakeAvailableMask | ++ SpvMemorySemanticsMakeVisibleMask); ++ ++ const SpvMemorySemanticsMask storage_semantics = ++ semantics & (SpvMemorySemanticsUniformMemoryMask | ++ SpvMemorySemanticsSubgroupMemoryMask | ++ SpvMemorySemanticsWorkgroupMemoryMask | ++ SpvMemorySemanticsCrossWorkgroupMemoryMask | ++ SpvMemorySemanticsAtomicCounterMemoryMask | ++ SpvMemorySemanticsImageMemoryMask | ++ SpvMemorySemanticsOutputMemoryMask); ++ ++ const SpvMemorySemanticsMask other_semantics = ++ semantics & ~(order_semantics | av_vis_semantics | storage_semantics | ++ SpvMemorySemanticsVolatileMask); ++ ++ if (other_semantics) ++ vtn_warn("Ignoring unhandled memory semantics: %u\n", other_semantics); ++ ++ /* SequentiallyConsistent is treated as AcquireRelease. */ ++ ++ /* The RELEASE barrier happens BEFORE the operation, and it is usually ++ * associated with a Store. All the write operations with a matching ++ * semantics will not be reordered after the Store. ++ */ ++ if (order_semantics & (SpvMemorySemanticsReleaseMask | ++ SpvMemorySemanticsAcquireReleaseMask | ++ SpvMemorySemanticsSequentiallyConsistentMask)) { ++ *before |= SpvMemorySemanticsReleaseMask | storage_semantics; ++ } ++ ++ /* The ACQUIRE barrier happens AFTER the operation, and it is usually ++ * associated with a Load. All the operations with a matching semantics ++ * will not be reordered before the Load. ++ */ ++ if (order_semantics & (SpvMemorySemanticsAcquireMask | ++ SpvMemorySemanticsAcquireReleaseMask | ++ SpvMemorySemanticsSequentiallyConsistentMask)) { ++ *after |= SpvMemorySemanticsAcquireMask | storage_semantics; ++ } ++ ++ if (av_vis_semantics & SpvMemorySemanticsMakeAvailableMask) ++ *before |= SpvMemorySemanticsMakeAvailableMask | storage_semantics; ++ ++ if (av_vis_semantics & SpvMemorySemanticsMakeVisibleMask) ++ *after |= SpvMemorySemanticsMakeVisibleMask | storage_semantics; ++} ++ ++static nir_memory_semantics ++vtn_mem_semantics_to_nir_mem_semantics(struct vtn_builder *b, ++ SpvMemorySemanticsMask semantics) ++{ ++ nir_memory_semantics nir_semantics = 0; ++ ++ SpvMemorySemanticsMask order_semantics = ++ semantics & (SpvMemorySemanticsAcquireMask | ++ SpvMemorySemanticsReleaseMask | ++ SpvMemorySemanticsAcquireReleaseMask | ++ SpvMemorySemanticsSequentiallyConsistentMask); ++ ++ if (util_bitcount(order_semantics) > 1) { ++ /* Old GLSLang versions incorrectly set all the ordering bits. This was ++ * fixed in c51287d744fb6e7e9ccc09f6f8451e6c64b1dad6 of glslang repo, ++ * and it is in GLSLang since revision "SPIRV99.1321" (from Jul-2016). ++ */ ++ vtn_warn("Multiple memory ordering semantics bits specified, " ++ "assuming AcquireRelease."); ++ order_semantics = SpvMemorySemanticsAcquireReleaseMask; ++ } ++ ++ switch (order_semantics) { ++ case 0: ++ /* Not an ordering barrier. */ ++ break; ++ ++ case SpvMemorySemanticsAcquireMask: ++ nir_semantics = NIR_MEMORY_ACQUIRE; ++ break; ++ ++ case SpvMemorySemanticsReleaseMask: ++ nir_semantics = NIR_MEMORY_RELEASE; ++ break; ++ ++ case SpvMemorySemanticsSequentiallyConsistentMask: ++ FALLTHROUGH; /* Treated as AcquireRelease in Vulkan. */ ++ case SpvMemorySemanticsAcquireReleaseMask: ++ nir_semantics = NIR_MEMORY_ACQUIRE | NIR_MEMORY_RELEASE; ++ break; ++ ++ default: ++ UNREACHABLE("Invalid memory order semantics"); ++ } ++ ++ if (semantics & SpvMemorySemanticsMakeAvailableMask) { ++ vtn_fail_if(!b->supported_capabilities.VulkanMemoryModel, ++ "To use MakeAvailable memory semantics the VulkanMemoryModel " ++ "capability must be declared."); ++ nir_semantics |= NIR_MEMORY_MAKE_AVAILABLE; ++ } ++ ++ if (semantics & SpvMemorySemanticsMakeVisibleMask) { ++ vtn_fail_if(!b->supported_capabilities.VulkanMemoryModel, ++ "To use MakeVisible memory semantics the VulkanMemoryModel " ++ "capability must be declared."); ++ nir_semantics |= NIR_MEMORY_MAKE_VISIBLE; ++ } ++ ++ return nir_semantics; ++} ++ ++static nir_variable_mode ++vtn_mem_semantics_to_nir_var_modes(struct vtn_builder *b, ++ SpvMemorySemanticsMask semantics) ++{ ++ /* Vulkan Environment for SPIR-V says "SubgroupMemory, CrossWorkgroupMemory, ++ * and AtomicCounterMemory are ignored". ++ */ ++ if (b->options->environment == NIR_SPIRV_VULKAN) { ++ semantics &= ~(SpvMemorySemanticsSubgroupMemoryMask | ++ SpvMemorySemanticsCrossWorkgroupMemoryMask | ++ SpvMemorySemanticsAtomicCounterMemoryMask); ++ } ++ ++ nir_variable_mode modes = 0; ++ if (semantics & SpvMemorySemanticsUniformMemoryMask) ++ modes |= nir_var_mem_ssbo | nir_var_mem_global; ++ if (semantics & SpvMemorySemanticsImageMemoryMask) ++ modes |= nir_var_image; ++ if (semantics & SpvMemorySemanticsWorkgroupMemoryMask) ++ modes |= nir_var_mem_shared; ++ if (semantics & SpvMemorySemanticsCrossWorkgroupMemoryMask) ++ modes |= nir_var_mem_global; ++ if (semantics & SpvMemorySemanticsOutputMemoryMask) { ++ modes |= nir_var_shader_out; ++ ++ if (b->shader->info.stage == MESA_SHADER_TASK) ++ modes |= nir_var_mem_task_payload; ++ } ++ ++ if (semantics & SpvMemorySemanticsAtomicCounterMemoryMask) { ++ /* There's no nir_var_atomic_counter, but since atomic counters are ++ * lowered to SSBOs, we use nir_var_mem_ssbo instead. ++ */ ++ modes |= nir_var_mem_ssbo; ++ } ++ ++ return modes; ++} ++ ++mesa_scope ++vtn_translate_scope(struct vtn_builder *b, SpvScope scope) ++{ ++ switch (scope) { ++ case SpvScopeDevice: ++ vtn_fail_if(b->supported_capabilities.VulkanMemoryModel && ++ !b->supported_capabilities.VulkanMemoryModelDeviceScope, ++ "If the Vulkan memory model is declared and any instruction " ++ "uses Device scope, the VulkanMemoryModelDeviceScope " ++ "capability must be declared."); ++ return SCOPE_DEVICE; ++ ++ case SpvScopeQueueFamily: ++ vtn_fail_if(!b->supported_capabilities.VulkanMemoryModel, ++ "To use Queue Family scope, the VulkanMemoryModel capability " ++ "must be declared."); ++ return SCOPE_QUEUE_FAMILY; ++ ++ case SpvScopeWorkgroup: ++ return SCOPE_WORKGROUP; ++ ++ case SpvScopeSubgroup: ++ return SCOPE_SUBGROUP; ++ ++ case SpvScopeInvocation: ++ return SCOPE_INVOCATION; ++ ++ case SpvScopeShaderCallKHR: ++ return SCOPE_SHADER_CALL; ++ ++ default: ++ vtn_fail("Invalid memory scope"); ++ } ++} ++ ++static void ++optimize_barrier(nir_memory_semantics *semantics, nir_variable_mode *modes) ++{ ++ nir_memory_semantics vis_avail = NIR_MEMORY_MAKE_AVAILABLE | NIR_MEMORY_MAKE_VISIBLE; ++ ++ /* Shared access is always workgroup coherent in NIR. */ ++ if (*modes == nir_var_mem_shared) ++ *semantics &= ~vis_avail; ++ if ((*semantics & vis_avail) == *semantics) ++ *modes &= ~nir_var_mem_shared; ++} ++ ++static void ++vtn_emit_scoped_control_barrier(struct vtn_builder *b, SpvScope exec_scope, ++ SpvScope mem_scope, ++ SpvMemorySemanticsMask semantics) ++{ ++ nir_memory_semantics nir_semantics = ++ vtn_mem_semantics_to_nir_mem_semantics(b, semantics); ++ nir_variable_mode modes = vtn_mem_semantics_to_nir_var_modes(b, semantics); ++ mesa_scope nir_exec_scope = vtn_translate_scope(b, exec_scope); ++ ++ optimize_barrier(&nir_semantics, &modes); ++ ++ /* Memory semantics is optional for OpControlBarrier. */ ++ mesa_scope nir_mem_scope; ++ if (nir_semantics == 0 || modes == 0) ++ nir_mem_scope = SCOPE_NONE; ++ else ++ nir_mem_scope = vtn_translate_scope(b, mem_scope); ++ ++ if (nir_mem_scope <= SCOPE_INVOCATION && nir_exec_scope <= SCOPE_INVOCATION) ++ return; ++ ++ nir_barrier(&b->nb, .execution_scope=nir_exec_scope, .memory_scope=nir_mem_scope, ++ .memory_semantics=nir_semantics, .memory_modes=modes); ++} ++ ++void ++vtn_emit_memory_barrier(struct vtn_builder *b, SpvScope scope, ++ SpvMemorySemanticsMask semantics) ++{ ++ nir_variable_mode modes = vtn_mem_semantics_to_nir_var_modes(b, semantics); ++ nir_memory_semantics nir_semantics = ++ vtn_mem_semantics_to_nir_mem_semantics(b, semantics); ++ ++ optimize_barrier(&nir_semantics, &modes); ++ ++ /* No barrier to add. */ ++ if (nir_semantics == 0 || modes == 0) ++ return; ++ ++ nir_barrier(&b->nb, .memory_scope=vtn_translate_scope(b, scope), ++ .memory_semantics=nir_semantics, ++ .memory_modes=modes); ++} ++ ++struct vtn_ssa_value * ++vtn_create_ssa_value(struct vtn_builder *b, const struct glsl_type *type) ++{ ++ /* Always use bare types for SSA values for a couple of reasons: ++ * ++ * 1. Code which emits deref chains should never listen to the explicit ++ * layout information on the SSA value if any exists. If we've ++ * accidentally been relying on this, we want to find those bugs. ++ * ++ * 2. We want to be able to quickly check that an SSA value being assigned ++ * to a SPIR-V value has the right type. Using bare types everywhere ++ * ensures that we can pointer-compare. ++ */ ++ struct vtn_ssa_value *val = vtn_zalloc(b, struct vtn_ssa_value); ++ val->type = glsl_get_bare_type(type); ++ ++ ++ if (!glsl_type_is_vector_or_scalar(type)) { ++ unsigned elems = glsl_get_length(val->type); ++ val->elems = vtn_alloc_array(b, struct vtn_ssa_value *, elems); ++ if (glsl_type_is_array_or_matrix(type) || glsl_type_is_cmat(type)) { ++ const struct glsl_type *elem_type = glsl_get_array_element(type); ++ for (unsigned i = 0; i < elems; i++) ++ val->elems[i] = vtn_create_ssa_value(b, elem_type); ++ } else { ++ vtn_assert(glsl_type_is_struct_or_ifc(type)); ++ for (unsigned i = 0; i < elems; i++) { ++ const struct glsl_type *elem_type = glsl_get_struct_field(type, i); ++ val->elems[i] = vtn_create_ssa_value(b, elem_type); ++ } ++ } ++ } ++ ++ return val; ++} ++ ++void ++vtn_set_ssa_value_var(struct vtn_builder *b, struct vtn_ssa_value *ssa, nir_variable *var) ++{ ++ vtn_assert(glsl_type_is_cmat(var->type)); ++ vtn_assert(var->type == ssa->type); ++ ssa->is_variable = true; ++ ssa->var = var; ++} ++ ++static nir_tex_src ++vtn_tex_src(struct vtn_builder *b, unsigned index, nir_tex_src_type type) ++{ ++ return nir_tex_src_for_ssa(type, vtn_get_nir_ssa(b, index)); ++} ++ ++static uint32_t ++image_operand_arg(struct vtn_builder *b, const uint32_t *w, uint32_t count, ++ uint32_t mask_idx, SpvImageOperandsMask op) ++{ ++ static const SpvImageOperandsMask ops_with_arg = ++ SpvImageOperandsBiasMask | ++ SpvImageOperandsLodMask | ++ SpvImageOperandsGradMask | ++ SpvImageOperandsConstOffsetMask | ++ SpvImageOperandsOffsetMask | ++ SpvImageOperandsConstOffsetsMask | ++ SpvImageOperandsSampleMask | ++ SpvImageOperandsMinLodMask | ++ SpvImageOperandsMakeTexelAvailableMask | ++ SpvImageOperandsMakeTexelVisibleMask; ++ ++ assert(util_bitcount(op) == 1); ++ assert(w[mask_idx] & op); ++ assert(op & ops_with_arg); ++ ++ uint32_t idx = util_bitcount(w[mask_idx] & (op - 1) & ops_with_arg) + 1; ++ ++ /* Adjust indices for operands with two arguments. */ ++ static const SpvImageOperandsMask ops_with_two_args = ++ SpvImageOperandsGradMask; ++ idx += util_bitcount(w[mask_idx] & (op - 1) & ops_with_two_args); ++ ++ idx += mask_idx; ++ ++ vtn_fail_if(idx + (op & ops_with_two_args ? 1 : 0) >= count, ++ "Image op claims to have %s but does not enough " ++ "following operands", spirv_imageoperands_to_string(op)); ++ ++ return idx; ++} ++ ++/* Apply SignExtend/ZeroExtend operands to get the actual result type for ++ * image read/sample operations and source type for write operations. ++ */ ++static nir_alu_type ++get_image_type(struct vtn_builder *b, nir_alu_type type, unsigned operands) ++{ ++ unsigned extend_operands = ++ operands & (SpvImageOperandsSignExtendMask | SpvImageOperandsZeroExtendMask); ++ vtn_fail_if(nir_alu_type_get_base_type(type) == nir_type_float && extend_operands, ++ "SignExtend/ZeroExtend used on floating-point texel type"); ++ vtn_fail_if(extend_operands == ++ (SpvImageOperandsSignExtendMask | SpvImageOperandsZeroExtendMask), ++ "SignExtend and ZeroExtend both specified"); ++ ++ if (operands & SpvImageOperandsSignExtendMask) ++ return nir_type_int | nir_alu_type_get_type_size(type); ++ if (operands & SpvImageOperandsZeroExtendMask) ++ return nir_type_uint | nir_alu_type_get_type_size(type); ++ ++ return type; ++} ++ ++static void ++vtn_handle_texture(struct vtn_builder *b, SpvOp opcode, ++ const uint32_t *w, unsigned count) ++{ ++ if (opcode == SpvOpSampledImage) { ++ struct vtn_sampled_image si = { ++ .image = vtn_get_image(b, w[3], NULL), ++ .sampler = vtn_get_sampler(b, w[4]), ++ }; ++ ++ validate_image_type_for_sampled_image( ++ b, si.image->type, ++ "Type of Image operand of OpSampledImage"); ++ ++ enum gl_access_qualifier access = 0; ++ if (vtn_has_decoration(b, vtn_untyped_value(b, w[3]), SpvDecorationNonUniformEXT) || ++ vtn_has_decoration(b, vtn_untyped_value(b, w[4]), SpvDecorationNonUniformEXT)) ++ access |= ACCESS_NON_UNIFORM; ++ ++ vtn_push_sampled_image(b, w[2], si, access & ACCESS_NON_UNIFORM); ++ return; ++ } else if (opcode == SpvOpImage) { ++ struct vtn_sampled_image si = vtn_get_sampled_image(b, w[3]); ++ ++ enum gl_access_qualifier access = 0; ++ if (vtn_has_decoration(b, vtn_untyped_value(b, w[3]), SpvDecorationNonUniformEXT)) ++ access |= ACCESS_NON_UNIFORM; ++ ++ vtn_push_image(b, w[2], si.image, access & ACCESS_NON_UNIFORM); ++ return; ++ } else if (opcode == SpvOpImageSparseTexelsResident) { ++ nir_def *code = vtn_get_nir_ssa(b, w[3]); ++ vtn_push_nir_ssa(b, w[2], nir_is_sparse_texels_resident(&b->nb, 1, code)); ++ return; ++ } ++ ++ nir_deref_instr *image = NULL, *sampler = NULL; ++ struct vtn_value *sampled_val = vtn_untyped_value(b, w[3]); ++ if (sampled_val->type->base_type == vtn_base_type_sampled_image) { ++ struct vtn_sampled_image si = vtn_get_sampled_image(b, w[3]); ++ image = si.image; ++ sampler = si.sampler; ++ } else { ++ image = vtn_get_image(b, w[3], NULL); ++ } ++ ++ const enum glsl_sampler_dim sampler_dim = glsl_get_sampler_dim(image->type); ++ const bool is_array = glsl_sampler_type_is_array(image->type); ++ nir_alu_type dest_type = nir_type_invalid; ++ ++ /* Figure out the base texture operation */ ++ nir_texop texop; ++ switch (opcode) { ++ case SpvOpImageSampleImplicitLod: ++ case SpvOpImageSparseSampleImplicitLod: ++ case SpvOpImageSampleDrefImplicitLod: ++ case SpvOpImageSparseSampleDrefImplicitLod: ++ vtn_assert(sampler_dim != GLSL_SAMPLER_DIM_BUF && ++ sampler_dim != GLSL_SAMPLER_DIM_MS && ++ sampler_dim != GLSL_SAMPLER_DIM_SUBPASS_MS); ++ texop = nir_texop_tex; ++ break; ++ ++ case SpvOpImageSampleProjImplicitLod: ++ case SpvOpImageSampleProjDrefImplicitLod: ++ vtn_assert(sampler_dim == GLSL_SAMPLER_DIM_1D || ++ sampler_dim == GLSL_SAMPLER_DIM_2D || ++ sampler_dim == GLSL_SAMPLER_DIM_3D || ++ sampler_dim == GLSL_SAMPLER_DIM_RECT); ++ vtn_assert(!is_array); ++ texop = nir_texop_tex; ++ break; ++ ++ case SpvOpImageSampleExplicitLod: ++ case SpvOpImageSparseSampleExplicitLod: ++ case SpvOpImageSampleDrefExplicitLod: ++ case SpvOpImageSparseSampleDrefExplicitLod: ++ vtn_assert(sampler_dim != GLSL_SAMPLER_DIM_BUF && ++ sampler_dim != GLSL_SAMPLER_DIM_MS && ++ sampler_dim != GLSL_SAMPLER_DIM_SUBPASS_MS); ++ texop = nir_texop_txl; ++ break; ++ ++ case SpvOpImageSampleProjExplicitLod: ++ case SpvOpImageSampleProjDrefExplicitLod: ++ vtn_assert(sampler_dim == GLSL_SAMPLER_DIM_1D || ++ sampler_dim == GLSL_SAMPLER_DIM_2D || ++ sampler_dim == GLSL_SAMPLER_DIM_3D || ++ sampler_dim == GLSL_SAMPLER_DIM_RECT); ++ vtn_assert(!is_array); ++ texop = nir_texop_txl; ++ break; ++ ++ case SpvOpImageFetch: ++ case SpvOpImageSparseFetch: ++ vtn_assert(sampler_dim != GLSL_SAMPLER_DIM_CUBE); ++ if (sampler_dim == GLSL_SAMPLER_DIM_MS) { ++ texop = nir_texop_txf_ms; ++ } else { ++ texop = nir_texop_txf; ++ } ++ break; ++ ++ case SpvOpImageGather: ++ case SpvOpImageSparseGather: ++ case SpvOpImageDrefGather: ++ case SpvOpImageSparseDrefGather: ++ vtn_assert(sampler_dim == GLSL_SAMPLER_DIM_2D || ++ sampler_dim == GLSL_SAMPLER_DIM_CUBE || ++ sampler_dim == GLSL_SAMPLER_DIM_RECT); ++ texop = nir_texop_tg4; ++ break; ++ ++ case SpvOpImageQuerySizeLod: ++ vtn_assert(sampler_dim == GLSL_SAMPLER_DIM_1D || ++ sampler_dim == GLSL_SAMPLER_DIM_2D || ++ sampler_dim == GLSL_SAMPLER_DIM_3D || ++ sampler_dim == GLSL_SAMPLER_DIM_CUBE); ++ texop = nir_texop_txs; ++ dest_type = nir_type_int32; ++ break; ++ ++ case SpvOpImageQuerySize: ++ vtn_assert(sampler_dim == GLSL_SAMPLER_DIM_1D || ++ sampler_dim == GLSL_SAMPLER_DIM_2D || ++ sampler_dim == GLSL_SAMPLER_DIM_3D || ++ sampler_dim == GLSL_SAMPLER_DIM_CUBE || ++ sampler_dim == GLSL_SAMPLER_DIM_RECT || ++ sampler_dim == GLSL_SAMPLER_DIM_MS || ++ sampler_dim == GLSL_SAMPLER_DIM_BUF); ++ texop = nir_texop_txs; ++ dest_type = nir_type_int32; ++ break; ++ ++ case SpvOpImageQueryLod: ++ vtn_assert(sampler_dim == GLSL_SAMPLER_DIM_1D || ++ sampler_dim == GLSL_SAMPLER_DIM_2D || ++ sampler_dim == GLSL_SAMPLER_DIM_3D || ++ sampler_dim == GLSL_SAMPLER_DIM_CUBE); ++ texop = nir_texop_lod; ++ dest_type = nir_type_float32; ++ break; ++ ++ case SpvOpImageQueryLevels: ++ /* This operation is not valid for a MS image but present in some old ++ * shaders. Just return 1 in those cases. ++ */ ++ if (sampler_dim == GLSL_SAMPLER_DIM_MS) { ++ vtn_warn("OpImageQueryLevels 'Sampled Image' should have an MS of 0, " ++ "but found MS of 1. Replacing query with constant value 1."); ++ vtn_push_nir_ssa(b, w[2], nir_imm_int(&b->nb, 1)); ++ return; ++ } ++ vtn_assert(sampler_dim == GLSL_SAMPLER_DIM_1D || ++ sampler_dim == GLSL_SAMPLER_DIM_2D || ++ sampler_dim == GLSL_SAMPLER_DIM_3D || ++ sampler_dim == GLSL_SAMPLER_DIM_CUBE); ++ texop = nir_texop_query_levels; ++ dest_type = nir_type_int32; ++ break; ++ ++ case SpvOpImageQuerySamples: ++ vtn_assert(sampler_dim == GLSL_SAMPLER_DIM_MS); ++ texop = nir_texop_texture_samples; ++ dest_type = nir_type_int32; ++ break; ++ ++ case SpvOpFragmentFetchAMD: ++ vtn_assert(sampler_dim == GLSL_SAMPLER_DIM_MS || ++ sampler_dim == GLSL_SAMPLER_DIM_SUBPASS_MS); ++ texop = nir_texop_fragment_fetch_amd; ++ break; ++ ++ case SpvOpFragmentMaskFetchAMD: ++ vtn_assert(sampler_dim == GLSL_SAMPLER_DIM_MS || ++ sampler_dim == GLSL_SAMPLER_DIM_SUBPASS_MS); ++ texop = nir_texop_fragment_mask_fetch_amd; ++ dest_type = nir_type_uint32; ++ break; ++ ++ default: ++ vtn_fail_with_opcode("Unhandled opcode", opcode); ++ } ++ ++ nir_tex_src srcs[10]; /* 10 should be enough */ ++ nir_tex_src *p = srcs; ++ ++ p->src = nir_src_for_ssa(&image->def); ++ p->src_type = nir_tex_src_texture_deref; ++ p++; ++ ++ switch (texop) { ++ case nir_texop_tex: ++ case nir_texop_txb: ++ case nir_texop_txl: ++ case nir_texop_txd: ++ case nir_texop_tg4: ++ case nir_texop_lod: ++ vtn_fail_if(sampler == NULL, ++ "%s requires an image of type OpTypeSampledImage", ++ spirv_op_to_string(opcode)); ++ p->src = nir_src_for_ssa(&sampler->def); ++ p->src_type = nir_tex_src_sampler_deref; ++ p++; ++ break; ++ case nir_texop_txf: ++ case nir_texop_txf_ms: ++ case nir_texop_txs: ++ case nir_texop_query_levels: ++ case nir_texop_texture_samples: ++ case nir_texop_samples_identical: ++ case nir_texop_fragment_fetch_amd: ++ case nir_texop_fragment_mask_fetch_amd: ++ /* These don't */ ++ break; ++ case nir_texop_txf_ms_fb: ++ vtn_fail("unexpected nir_texop_txf_ms_fb"); ++ break; ++ case nir_texop_txf_ms_mcs_intel: ++ vtn_fail("unexpected nir_texop_txf_ms_mcs"); ++ break; ++ case nir_texop_tex_prefetch: ++ vtn_fail("unexpected nir_texop_tex_prefetch"); ++ break; ++ case nir_texop_lod_bias: ++ vtn_fail("unexpected nir_texop_lod_bias"); ++ break; ++ case nir_texop_descriptor_amd: ++ case nir_texop_sampler_descriptor_amd: ++ vtn_fail("unexpected nir_texop_*descriptor_amd"); ++ break; ++ case nir_texop_image_min_lod_agx: ++ case nir_texop_custom_border_color_agx: ++ case nir_texop_has_custom_border_color_agx: ++ vtn_fail("unexpected nir_texop_*_agx"); ++ break; ++ case nir_texop_hdr_dim_nv: ++ case nir_texop_tex_type_nv: ++ case nir_texop_sample_pos_nv: ++ vtn_fail("unexpected nir_texop_*_nv"); ++ break; ++ } ++ ++ unsigned idx = 4; ++ ++ struct nir_def *coord; ++ unsigned coord_components; ++ switch (opcode) { ++ case SpvOpImageSampleImplicitLod: ++ case SpvOpImageSparseSampleImplicitLod: ++ case SpvOpImageSampleExplicitLod: ++ case SpvOpImageSparseSampleExplicitLod: ++ case SpvOpImageSampleDrefImplicitLod: ++ case SpvOpImageSparseSampleDrefImplicitLod: ++ case SpvOpImageSampleDrefExplicitLod: ++ case SpvOpImageSparseSampleDrefExplicitLod: ++ case SpvOpImageSampleProjImplicitLod: ++ case SpvOpImageSampleProjExplicitLod: ++ case SpvOpImageSampleProjDrefImplicitLod: ++ case SpvOpImageSampleProjDrefExplicitLod: ++ case SpvOpImageFetch: ++ case SpvOpImageSparseFetch: ++ case SpvOpImageGather: ++ case SpvOpImageSparseGather: ++ case SpvOpImageDrefGather: ++ case SpvOpImageSparseDrefGather: ++ case SpvOpImageQueryLod: ++ case SpvOpFragmentFetchAMD: ++ case SpvOpFragmentMaskFetchAMD: { ++ /* All these types have the coordinate as their first real argument */ ++ coord_components = glsl_get_sampler_dim_coordinate_components(sampler_dim); ++ ++ if (is_array && texop != nir_texop_lod) ++ coord_components++; ++ ++ struct vtn_ssa_value *coord_val = vtn_ssa_value(b, w[idx++]); ++ coord = coord_val->def; ++ /* From the SPIR-V spec verxion 1.5, rev. 5: ++ * ++ * "Coordinate must be a scalar or vector of floating-point type. It ++ * contains (u[, v] ... [, array layer]) as needed by the definition ++ * of Sampled Image. It may be a vector larger than needed, but all ++ * unused components appear after all used components." ++ */ ++ vtn_fail_if(coord->num_components < coord_components, ++ "Coordinate value passed has fewer components than sampler dimensionality."); ++ p->src = nir_src_for_ssa(nir_trim_vector(&b->nb, coord, coord_components)); ++ ++ /* OpenCL allows integer sampling coordinates */ ++ if (glsl_type_is_integer(coord_val->type) && ++ opcode == SpvOpImageSampleExplicitLod) { ++ vtn_fail_if(b->shader->info.stage != MESA_SHADER_KERNEL, ++ "Unless the Kernel capability is being used, the coordinate parameter " ++ "OpImageSampleExplicitLod must be floating point."); ++ ++ nir_def *coords[4]; ++ nir_def *f0_5 = nir_imm_float(&b->nb, 0.5); ++ for (unsigned i = 0; i < coord_components; i++) { ++ coords[i] = nir_i2f32(&b->nb, nir_channel(&b->nb, p->src.ssa, i)); ++ ++ if (!is_array || i != coord_components - 1) ++ coords[i] = nir_fadd(&b->nb, coords[i], f0_5); ++ } ++ ++ p->src = nir_src_for_ssa(nir_vec(&b->nb, coords, coord_components)); ++ } ++ ++ p->src_type = nir_tex_src_coord; ++ p++; ++ break; ++ } ++ ++ default: ++ coord = NULL; ++ coord_components = 0; ++ break; ++ } ++ ++ switch (opcode) { ++ case SpvOpImageSampleProjImplicitLod: ++ case SpvOpImageSampleProjExplicitLod: ++ case SpvOpImageSampleProjDrefImplicitLod: ++ case SpvOpImageSampleProjDrefExplicitLod: ++ /* These have the projector as the last coordinate component */ ++ p->src = nir_src_for_ssa(nir_channel(&b->nb, coord, coord_components)); ++ p->src_type = nir_tex_src_projector; ++ p++; ++ break; ++ ++ default: ++ break; ++ } ++ ++ bool is_shadow = false; ++ unsigned gather_component = 0; ++ switch (opcode) { ++ case SpvOpImageSampleDrefImplicitLod: ++ case SpvOpImageSparseSampleDrefImplicitLod: ++ case SpvOpImageSampleDrefExplicitLod: ++ case SpvOpImageSparseSampleDrefExplicitLod: ++ case SpvOpImageSampleProjDrefImplicitLod: ++ case SpvOpImageSampleProjDrefExplicitLod: ++ case SpvOpImageDrefGather: ++ case SpvOpImageSparseDrefGather: ++ /* These all have an explicit depth value as their next source */ ++ is_shadow = true; ++ (*p++) = vtn_tex_src(b, w[idx++], nir_tex_src_comparator); ++ break; ++ ++ case SpvOpImageGather: ++ case SpvOpImageSparseGather: ++ /* This has a component as its next source */ ++ gather_component = vtn_constant_uint(b, w[idx++]); ++ break; ++ ++ default: ++ break; ++ } ++ ++ bool is_sparse = false; ++ switch (opcode) { ++ case SpvOpImageSparseSampleImplicitLod: ++ case SpvOpImageSparseSampleExplicitLod: ++ case SpvOpImageSparseSampleDrefImplicitLod: ++ case SpvOpImageSparseSampleDrefExplicitLod: ++ case SpvOpImageSparseFetch: ++ case SpvOpImageSparseGather: ++ case SpvOpImageSparseDrefGather: ++ is_sparse = true; ++ break; ++ default: ++ break; ++ } ++ ++ /* For OpImageQuerySizeLod, we always have an LOD */ ++ if (opcode == SpvOpImageQuerySizeLod) ++ (*p++) = vtn_tex_src(b, w[idx++], nir_tex_src_lod); ++ ++ /* For OpFragmentFetchAMD, we always have a multisample index */ ++ if (opcode == SpvOpFragmentFetchAMD) ++ (*p++) = vtn_tex_src(b, w[idx++], nir_tex_src_ms_index); ++ ++ /* Now we need to handle some number of optional arguments */ ++ struct vtn_value *gather_offsets = NULL; ++ uint32_t operands = SpvImageOperandsMaskNone; ++ if (idx < count) { ++ operands = w[idx]; ++ ++ if (operands & SpvImageOperandsBiasMask) { ++ vtn_assert(texop == nir_texop_tex || ++ texop == nir_texop_tg4); ++ if (texop == nir_texop_tex) ++ texop = nir_texop_txb; ++ uint32_t arg = image_operand_arg(b, w, count, idx, ++ SpvImageOperandsBiasMask); ++ (*p++) = vtn_tex_src(b, w[arg], nir_tex_src_bias); ++ } ++ ++ if (operands & SpvImageOperandsLodMask) { ++ vtn_assert(texop == nir_texop_txl || texop == nir_texop_txf || ++ texop == nir_texop_txs || texop == nir_texop_tg4); ++ uint32_t arg = image_operand_arg(b, w, count, idx, ++ SpvImageOperandsLodMask); ++ (*p++) = vtn_tex_src(b, w[arg], nir_tex_src_lod); ++ } ++ ++ if (operands & SpvImageOperandsGradMask) { ++ vtn_assert(texop == nir_texop_txl); ++ texop = nir_texop_txd; ++ uint32_t arg = image_operand_arg(b, w, count, idx, ++ SpvImageOperandsGradMask); ++ (*p++) = vtn_tex_src(b, w[arg], nir_tex_src_ddx); ++ (*p++) = vtn_tex_src(b, w[arg + 1], nir_tex_src_ddy); ++ } ++ ++ vtn_fail_if(util_bitcount(operands & (SpvImageOperandsConstOffsetsMask | ++ SpvImageOperandsOffsetMask | ++ SpvImageOperandsConstOffsetMask)) > 1, ++ "At most one of the ConstOffset, Offset, and ConstOffsets " ++ "image operands can be used on a given instruction."); ++ ++ if (operands & SpvImageOperandsOffsetMask) { ++ uint32_t arg = image_operand_arg(b, w, count, idx, ++ SpvImageOperandsOffsetMask); ++ (*p++) = vtn_tex_src(b, w[arg], nir_tex_src_offset); ++ } ++ ++ if (operands & SpvImageOperandsConstOffsetMask) { ++ uint32_t arg = image_operand_arg(b, w, count, idx, ++ SpvImageOperandsConstOffsetMask); ++ (*p++) = vtn_tex_src(b, w[arg], nir_tex_src_offset); ++ } ++ ++ if (operands & SpvImageOperandsConstOffsetsMask) { ++ vtn_assert(texop == nir_texop_tg4); ++ uint32_t arg = image_operand_arg(b, w, count, idx, ++ SpvImageOperandsConstOffsetsMask); ++ gather_offsets = vtn_value(b, w[arg], vtn_value_type_constant); ++ } ++ ++ if (operands & SpvImageOperandsSampleMask) { ++ vtn_assert(texop == nir_texop_txf_ms); ++ uint32_t arg = image_operand_arg(b, w, count, idx, ++ SpvImageOperandsSampleMask); ++ texop = nir_texop_txf_ms; ++ (*p++) = vtn_tex_src(b, w[arg], nir_tex_src_ms_index); ++ } ++ ++ if (operands & SpvImageOperandsMinLodMask) { ++ vtn_assert(texop == nir_texop_tex || ++ texop == nir_texop_txb || ++ texop == nir_texop_txd); ++ uint32_t arg = image_operand_arg(b, w, count, idx, ++ SpvImageOperandsMinLodMask); ++ (*p++) = vtn_tex_src(b, w[arg], nir_tex_src_min_lod); ++ } ++ } ++ ++ struct vtn_type *ret_type = vtn_get_type(b, w[1]); ++ struct vtn_type *struct_type = NULL; ++ if (is_sparse) { ++ vtn_assert(glsl_type_is_struct_or_ifc(ret_type->type)); ++ struct_type = ret_type; ++ ret_type = struct_type->members[1]; ++ } ++ ++ nir_tex_instr *instr = nir_tex_instr_create(b->shader, p - srcs); ++ instr->op = texop; ++ ++ memcpy(instr->src, srcs, instr->num_srcs * sizeof(*instr->src)); ++ ++ instr->coord_components = coord_components; ++ instr->sampler_dim = sampler_dim; ++ instr->is_array = is_array; ++ instr->is_shadow = is_shadow; ++ instr->is_sparse = is_sparse; ++ instr->is_new_style_shadow = ++ is_shadow && glsl_get_components(ret_type->type) == 1; ++ instr->component = gather_component; ++ /* spirv_to_nir doesn't support OpenGL bindless textures. */ ++ instr->can_speculate = b->options->environment == NIR_SPIRV_OPENGL; ++ ++ /* If SpvCapabilityImageGatherBiasLodAMD is enabled, texture gather without an explicit LOD ++ * has an implicit one (instead of using level 0). ++ */ ++ if (texop == nir_texop_tg4 && ++ b->enabled_capabilities.ImageGatherBiasLodAMD && ++ !(operands & SpvImageOperandsLodMask)) { ++ instr->is_gather_implicit_lod = true; ++ } ++ ++ /* The Vulkan spec says: ++ * ++ * "If an instruction loads from or stores to a resource (including ++ * atomics and image instructions) and the resource descriptor being ++ * accessed is not dynamically uniform, then the operand corresponding ++ * to that resource (e.g. the pointer or sampled image operand) must be ++ * decorated with NonUniform." ++ * ++ * It's very careful to specify that the exact operand must be decorated ++ * NonUniform. The SPIR-V parser is not expected to chase through long ++ * chains to find the NonUniform decoration. It's either right there or we ++ * can assume it doesn't exist. ++ */ ++ enum gl_access_qualifier access = 0; ++ if (vtn_has_decoration(b, sampled_val, SpvDecorationNonUniformEXT)) ++ access |= ACCESS_NON_UNIFORM; ++ ++ if (operands & SpvImageOperandsNontemporalMask) ++ access |= ACCESS_NON_TEMPORAL; ++ ++ if (sampler && b->options->workarounds.force_tex_non_uniform) ++ access |= ACCESS_NON_UNIFORM; ++ ++ if (sampled_val->propagated_non_uniform) ++ access |= ACCESS_NON_UNIFORM; ++ ++ if (image && (access & ACCESS_NON_UNIFORM)) ++ instr->texture_non_uniform = true; ++ ++ if (sampler && (access & ACCESS_NON_UNIFORM)) ++ instr->sampler_non_uniform = true; ++ ++ /* for non-query ops, get dest_type from SPIR-V return type */ ++ if (dest_type == nir_type_invalid) { ++ /* the return type should match the image type, unless the image type is ++ * VOID (CL image), in which case the return type dictates the sampler ++ */ ++ enum glsl_base_type sampler_base = ++ glsl_get_sampler_result_type(image->type); ++ enum glsl_base_type ret_base = glsl_get_base_type(ret_type->type); ++ vtn_fail_if(sampler_base != ret_base && sampler_base != GLSL_TYPE_VOID, ++ "SPIR-V return type mismatches image type. This is only valid " ++ "for untyped images (OpenCL)."); ++ dest_type = nir_get_nir_type_for_glsl_base_type(ret_base); ++ dest_type = get_image_type(b, dest_type, operands); ++ } ++ ++ unsigned dest_bitsize = nir_alu_type_get_type_size(dest_type); ++ ++ /* Not all drivers support smaller tex dest, so if needed promote the dest ++ * type to 32b, and then insert the appropriate conversion. Drivers that ++ * support 16b dest should be using nir_opt_16bit_tex_image to fold the ++ * conversion back into the tex instruction. ++ */ ++ if (dest_bitsize != 32) { ++ instr->dest_type = nir_alu_type_get_base_type(dest_type) | 32; ++ } else { ++ instr->dest_type = dest_type; ++ } ++ ++ nir_def_init(&instr->instr, &instr->def, ++ nir_tex_instr_dest_size(instr), 32); ++ ++ vtn_assert(glsl_get_vector_elements(ret_type->type) == ++ nir_tex_instr_result_size(instr)); ++ ++ if (gather_offsets) { ++ vtn_fail_if(gather_offsets->type->base_type != vtn_base_type_array || ++ gather_offsets->type->length != 4, ++ "ConstOffsets must be an array of size four of vectors " ++ "of two integer components"); ++ ++ struct vtn_type *vec_type = gather_offsets->type->array_element; ++ vtn_fail_if(vec_type->base_type != vtn_base_type_vector || ++ vec_type->length != 2 || ++ !glsl_type_is_integer(vec_type->type), ++ "ConstOffsets must be an array of size four of vectors " ++ "of two integer components"); ++ ++ unsigned bit_size = glsl_get_bit_size(vec_type->type); ++ for (uint32_t i = 0; i < 4; i++) { ++ const nir_const_value *cvec = ++ gather_offsets->constant->elements[i]->values; ++ for (uint32_t j = 0; j < 2; j++) { ++ switch (bit_size) { ++ case 8: instr->tg4_offsets[i][j] = cvec[j].i8; break; ++ case 16: instr->tg4_offsets[i][j] = cvec[j].i16; break; ++ case 32: instr->tg4_offsets[i][j] = cvec[j].i32; break; ++ case 64: instr->tg4_offsets[i][j] = cvec[j].i64; break; ++ default: ++ vtn_fail("Unsupported bit size: %u", bit_size); ++ } ++ } ++ } ++ } ++ ++ nir_builder_instr_insert(&b->nb, &instr->instr); ++ ++ nir_def *def = &instr->def; ++ if (dest_bitsize != 32) { ++ def = nir_type_convert(&b->nb, def, instr->dest_type, dest_type, ++ nir_rounding_mode_undef); ++ } ++ ++ if (is_sparse) { ++ struct vtn_ssa_value *dest = vtn_create_ssa_value(b, struct_type->type); ++ unsigned result_size = glsl_get_vector_elements(ret_type->type); ++ dest->elems[0]->def = nir_channel(&b->nb, def, result_size); ++ dest->elems[1]->def = nir_trim_vector(&b->nb, def, ++ result_size); ++ vtn_push_ssa_value(b, w[2], dest); ++ } else { ++ vtn_push_nir_ssa(b, w[2], def); ++ } ++} ++ ++static nir_atomic_op ++translate_atomic_op(SpvOp opcode) ++{ ++ switch (opcode) { ++ case SpvOpAtomicExchange: return nir_atomic_op_xchg; ++ case SpvOpAtomicCompareExchange: return nir_atomic_op_cmpxchg; ++ case SpvOpAtomicCompareExchangeWeak: return nir_atomic_op_cmpxchg; ++ case SpvOpAtomicIIncrement: return nir_atomic_op_iadd; ++ case SpvOpAtomicIDecrement: return nir_atomic_op_iadd; ++ case SpvOpAtomicIAdd: return nir_atomic_op_iadd; ++ case SpvOpAtomicISub: return nir_atomic_op_iadd; ++ case SpvOpAtomicSMin: return nir_atomic_op_imin; ++ case SpvOpAtomicUMin: return nir_atomic_op_umin; ++ case SpvOpAtomicSMax: return nir_atomic_op_imax; ++ case SpvOpAtomicUMax: return nir_atomic_op_umax; ++ case SpvOpAtomicAnd: return nir_atomic_op_iand; ++ case SpvOpAtomicOr: return nir_atomic_op_ior; ++ case SpvOpAtomicXor: return nir_atomic_op_ixor; ++ case SpvOpAtomicFAddEXT: return nir_atomic_op_fadd; ++ case SpvOpAtomicFMinEXT: return nir_atomic_op_fmin; ++ case SpvOpAtomicFMaxEXT: return nir_atomic_op_fmax; ++ case SpvOpAtomicFlagTestAndSet: return nir_atomic_op_cmpxchg; ++ default: ++ UNREACHABLE("Invalid atomic"); ++ } ++} ++ ++static void ++fill_common_atomic_sources(struct vtn_builder *b, SpvOp opcode, ++ const uint32_t *w, nir_src *src) ++{ ++ const struct glsl_type *type = vtn_get_type(b, w[1])->type; ++ unsigned bit_size = glsl_get_bit_size(type); ++ ++ switch (opcode) { ++ case SpvOpAtomicIIncrement: ++ src[0] = nir_src_for_ssa(nir_imm_intN_t(&b->nb, 1, bit_size)); ++ break; ++ ++ case SpvOpAtomicIDecrement: ++ src[0] = nir_src_for_ssa(nir_imm_intN_t(&b->nb, -1, bit_size)); ++ break; ++ ++ case SpvOpAtomicISub: ++ src[0] = ++ nir_src_for_ssa(nir_ineg(&b->nb, vtn_get_nir_ssa(b, w[6]))); ++ break; ++ ++ case SpvOpAtomicCompareExchange: ++ case SpvOpAtomicCompareExchangeWeak: ++ src[0] = nir_src_for_ssa(vtn_get_nir_ssa(b, w[8])); ++ src[1] = nir_src_for_ssa(vtn_get_nir_ssa(b, w[7])); ++ break; ++ ++ case SpvOpAtomicExchange: ++ case SpvOpAtomicIAdd: ++ case SpvOpAtomicSMin: ++ case SpvOpAtomicUMin: ++ case SpvOpAtomicSMax: ++ case SpvOpAtomicUMax: ++ case SpvOpAtomicAnd: ++ case SpvOpAtomicOr: ++ case SpvOpAtomicXor: ++ case SpvOpAtomicFAddEXT: ++ case SpvOpAtomicFMinEXT: ++ case SpvOpAtomicFMaxEXT: ++ src[0] = nir_src_for_ssa(vtn_get_nir_ssa(b, w[6])); ++ break; ++ ++ default: ++ vtn_fail_with_opcode("Invalid SPIR-V atomic", opcode); ++ } ++} ++ ++static nir_def * ++get_image_coord(struct vtn_builder *b, uint32_t value) ++{ ++ nir_def *coord = vtn_get_nir_ssa(b, value); ++ /* The image_load_store intrinsics assume a 4-dim coordinate */ ++ return nir_pad_vec4(&b->nb, coord); ++} ++ ++static void ++vtn_handle_image(struct vtn_builder *b, SpvOp opcode, ++ const uint32_t *w, unsigned count) ++{ ++ /* Just get this one out of the way */ ++ if (opcode == SpvOpImageTexelPointer) { ++ struct vtn_value *val = ++ vtn_push_value(b, w[2], vtn_value_type_image_pointer); ++ val->image = vtn_alloc(b, struct vtn_image_pointer); ++ ++ val->image->image = vtn_nir_deref(b, w[3]); ++ val->image->coord = get_image_coord(b, w[4]); ++ val->image->sample = vtn_get_nir_ssa(b, w[5]); ++ val->image->lod = nir_imm_int(&b->nb, 0); ++ return; ++ } ++ ++ struct vtn_image_pointer image; ++ SpvScope scope = SpvScopeInvocation; ++ SpvMemorySemanticsMask semantics = 0; ++ SpvImageOperandsMask operands = SpvImageOperandsMaskNone; ++ ++ enum gl_access_qualifier access = 0; ++ ++ struct vtn_value *res_val; ++ switch (opcode) { ++ case SpvOpAtomicExchange: ++ case SpvOpAtomicCompareExchange: ++ case SpvOpAtomicCompareExchangeWeak: ++ case SpvOpAtomicIIncrement: ++ case SpvOpAtomicIDecrement: ++ case SpvOpAtomicIAdd: ++ case SpvOpAtomicISub: ++ case SpvOpAtomicLoad: ++ case SpvOpAtomicSMin: ++ case SpvOpAtomicUMin: ++ case SpvOpAtomicSMax: ++ case SpvOpAtomicUMax: ++ case SpvOpAtomicAnd: ++ case SpvOpAtomicOr: ++ case SpvOpAtomicXor: ++ case SpvOpAtomicFAddEXT: ++ case SpvOpAtomicFMinEXT: ++ case SpvOpAtomicFMaxEXT: ++ res_val = vtn_value(b, w[3], vtn_value_type_image_pointer); ++ image = *res_val->image; ++ scope = vtn_constant_uint(b, w[4]); ++ semantics = vtn_constant_uint(b, w[5]); ++ access |= ACCESS_COHERENT; ++ if (opcode == SpvOpAtomicLoad) ++ access |= ACCESS_ATOMIC; ++ break; ++ ++ case SpvOpAtomicStore: ++ res_val = vtn_value(b, w[1], vtn_value_type_image_pointer); ++ image = *res_val->image; ++ scope = vtn_constant_uint(b, w[2]); ++ semantics = vtn_constant_uint(b, w[3]); ++ access |= ACCESS_COHERENT | ACCESS_ATOMIC; ++ break; ++ ++ case SpvOpImageQuerySizeLod: ++ res_val = vtn_untyped_value(b, w[3]); ++ image.image = vtn_get_image(b, w[3], &access); ++ image.coord = NULL; ++ image.sample = NULL; ++ image.lod = vtn_ssa_value(b, w[4])->def; ++ break; ++ ++ case SpvOpImageQueryFormat: ++ case SpvOpImageQueryLevels: ++ case SpvOpImageQueryOrder: ++ case SpvOpImageQuerySamples: ++ case SpvOpImageQuerySize: ++ res_val = vtn_untyped_value(b, w[3]); ++ image.image = vtn_get_image(b, w[3], &access); ++ image.coord = NULL; ++ image.sample = NULL; ++ image.lod = NULL; ++ break; ++ ++ case SpvOpImageRead: ++ case SpvOpImageSparseRead: { ++ res_val = vtn_untyped_value(b, w[3]); ++ image.image = vtn_get_image(b, w[3], &access); ++ image.coord = get_image_coord(b, w[4]); ++ ++ operands = count > 5 ? w[5] : SpvImageOperandsMaskNone; ++ ++ if (operands & SpvImageOperandsSampleMask) { ++ uint32_t arg = image_operand_arg(b, w, count, 5, ++ SpvImageOperandsSampleMask); ++ image.sample = vtn_get_nir_ssa(b, w[arg]); ++ } else { ++ image.sample = nir_undef(&b->nb, 1, 32); ++ } ++ ++ if (operands & SpvImageOperandsMakeTexelVisibleMask) { ++ vtn_fail_if((operands & SpvImageOperandsNonPrivateTexelMask) == 0, ++ "MakeTexelVisible requires NonPrivateTexel to also be set."); ++ uint32_t arg = image_operand_arg(b, w, count, 5, ++ SpvImageOperandsMakeTexelVisibleMask); ++ semantics = SpvMemorySemanticsMakeVisibleMask; ++ scope = vtn_constant_uint(b, w[arg]); ++ } ++ ++ if (operands & SpvImageOperandsLodMask) { ++ uint32_t arg = image_operand_arg(b, w, count, 5, ++ SpvImageOperandsLodMask); ++ image.lod = vtn_get_nir_ssa(b, w[arg]); ++ } else { ++ image.lod = nir_imm_int(&b->nb, 0); ++ } ++ ++ if (operands & SpvImageOperandsVolatileTexelMask) ++ access |= ACCESS_VOLATILE; ++ if (operands & SpvImageOperandsNontemporalMask) ++ access |= ACCESS_NON_TEMPORAL; ++ ++ break; ++ } ++ ++ case SpvOpImageWrite: { ++ res_val = vtn_untyped_value(b, w[1]); ++ image.image = vtn_get_image(b, w[1], &access); ++ image.coord = get_image_coord(b, w[2]); ++ ++ /* texel = w[3] */ ++ ++ operands = count > 4 ? w[4] : SpvImageOperandsMaskNone; ++ ++ if (operands & SpvImageOperandsSampleMask) { ++ uint32_t arg = image_operand_arg(b, w, count, 4, ++ SpvImageOperandsSampleMask); ++ image.sample = vtn_get_nir_ssa(b, w[arg]); ++ } else { ++ image.sample = nir_undef(&b->nb, 1, 32); ++ } ++ ++ if (operands & SpvImageOperandsMakeTexelAvailableMask) { ++ vtn_fail_if((operands & SpvImageOperandsNonPrivateTexelMask) == 0, ++ "MakeTexelAvailable requires NonPrivateTexel to also be set."); ++ uint32_t arg = image_operand_arg(b, w, count, 4, ++ SpvImageOperandsMakeTexelAvailableMask); ++ semantics = SpvMemorySemanticsMakeAvailableMask; ++ scope = vtn_constant_uint(b, w[arg]); ++ } ++ ++ if (operands & SpvImageOperandsLodMask) { ++ uint32_t arg = image_operand_arg(b, w, count, 4, ++ SpvImageOperandsLodMask); ++ image.lod = vtn_get_nir_ssa(b, w[arg]); ++ } else { ++ image.lod = nir_imm_int(&b->nb, 0); ++ } ++ ++ if (operands & SpvImageOperandsVolatileTexelMask) ++ access |= ACCESS_VOLATILE; ++ if (operands & SpvImageOperandsNontemporalMask) ++ access |= ACCESS_NON_TEMPORAL; ++ ++ break; ++ } ++ ++ default: ++ vtn_fail_with_opcode("Invalid image opcode", opcode); ++ } ++ ++ if (semantics & SpvMemorySemanticsVolatileMask) ++ access |= ACCESS_VOLATILE; ++ ++ nir_intrinsic_op op; ++ switch (opcode) { ++#define OP(S, N) case SpvOp##S: op = nir_intrinsic_image_deref_##N; break; ++ OP(ImageQuerySize, size) ++ OP(ImageQuerySizeLod, size) ++ OP(ImageRead, load) ++ OP(ImageSparseRead, sparse_load) ++ OP(ImageWrite, store) ++ OP(AtomicLoad, load) ++ OP(AtomicStore, store) ++ OP(AtomicExchange, atomic) ++ OP(AtomicCompareExchange, atomic_swap) ++ OP(AtomicCompareExchangeWeak, atomic_swap) ++ OP(AtomicIIncrement, atomic) ++ OP(AtomicIDecrement, atomic) ++ OP(AtomicIAdd, atomic) ++ OP(AtomicISub, atomic) ++ OP(AtomicSMin, atomic) ++ OP(AtomicUMin, atomic) ++ OP(AtomicSMax, atomic) ++ OP(AtomicUMax, atomic) ++ OP(AtomicAnd, atomic) ++ OP(AtomicOr, atomic) ++ OP(AtomicXor, atomic) ++ OP(AtomicFAddEXT, atomic) ++ OP(AtomicFMinEXT, atomic) ++ OP(AtomicFMaxEXT, atomic) ++ OP(ImageQueryFormat, format) ++ OP(ImageQueryLevels, levels) ++ OP(ImageQueryOrder, order) ++ OP(ImageQuerySamples, samples) ++#undef OP ++ default: ++ vtn_fail_with_opcode("Invalid image opcode", opcode); ++ } ++ ++ nir_intrinsic_instr *intrin = nir_intrinsic_instr_create(b->shader, op); ++ if (nir_intrinsic_has_atomic_op(intrin)) ++ nir_intrinsic_set_atomic_op(intrin, translate_atomic_op(opcode)); ++ ++ intrin->src[0] = nir_src_for_ssa(&image.image->def); ++ nir_intrinsic_set_image_dim(intrin, glsl_get_sampler_dim(image.image->type)); ++ nir_intrinsic_set_image_array(intrin, ++ glsl_sampler_type_is_array(image.image->type)); ++ ++ switch (opcode) { ++ case SpvOpImageQueryLevels: ++ case SpvOpImageQuerySamples: ++ case SpvOpImageQuerySize: ++ case SpvOpImageQuerySizeLod: ++ case SpvOpImageQueryFormat: ++ case SpvOpImageQueryOrder: ++ break; ++ default: ++ /* The image coordinate is always 4 components but we may not have that ++ * many. Swizzle to compensate. ++ */ ++ intrin->src[1] = nir_src_for_ssa(nir_pad_vec4(&b->nb, image.coord)); ++ intrin->src[2] = nir_src_for_ssa(image.sample); ++ break; ++ } ++ ++ /* The Vulkan spec says: ++ * ++ * "If an instruction loads from or stores to a resource (including ++ * atomics and image instructions) and the resource descriptor being ++ * accessed is not dynamically uniform, then the operand corresponding ++ * to that resource (e.g. the pointer or sampled image operand) must be ++ * decorated with NonUniform." ++ * ++ * It's very careful to specify that the exact operand must be decorated ++ * NonUniform. The SPIR-V parser is not expected to chase through long ++ * chains to find the NonUniform decoration. It's either right there or we ++ * can assume it doesn't exist. ++ */ ++ if (vtn_has_decoration(b, res_val, SpvDecorationNonUniformEXT)) ++ access |= ACCESS_NON_UNIFORM; ++ nir_intrinsic_set_access(intrin, access); ++ ++ switch (opcode) { ++ case SpvOpImageQueryLevels: ++ case SpvOpImageQuerySamples: ++ case SpvOpImageQueryFormat: ++ case SpvOpImageQueryOrder: ++ /* No additional sources */ ++ break; ++ case SpvOpImageQuerySize: ++ intrin->src[1] = nir_src_for_ssa(nir_imm_int(&b->nb, 0)); ++ break; ++ case SpvOpImageQuerySizeLod: ++ intrin->src[1] = nir_src_for_ssa(image.lod); ++ break; ++ case SpvOpAtomicLoad: ++ case SpvOpImageRead: ++ case SpvOpImageSparseRead: ++ /* Only OpImageRead can support a lod parameter if ++ * SPV_AMD_shader_image_load_store_lod is used but the current NIR ++ * intrinsics definition for atomics requires us to set it for ++ * OpAtomicLoad. ++ */ ++ intrin->src[3] = nir_src_for_ssa(image.lod); ++ break; ++ case SpvOpAtomicStore: ++ case SpvOpImageWrite: { ++ const uint32_t value_id = opcode == SpvOpAtomicStore ? w[4] : w[3]; ++ struct vtn_ssa_value *value = vtn_ssa_value(b, value_id); ++ /* nir_intrinsic_image_deref_store always takes a vec4 value */ ++ assert(op == nir_intrinsic_image_deref_store); ++ intrin->num_components = 4; ++ intrin->src[3] = nir_src_for_ssa(nir_pad_vec4(&b->nb, value->def)); ++ /* Only OpImageWrite can support a lod parameter if ++ * SPV_AMD_shader_image_load_store_lod is used but the current NIR ++ * intrinsics definition for atomics requires us to set it for ++ * OpAtomicStore. ++ */ ++ intrin->src[4] = nir_src_for_ssa(image.lod); ++ ++ nir_alu_type src_type = ++ get_image_type(b, nir_get_nir_type_for_glsl_type(value->type), operands); ++ nir_intrinsic_set_src_type(intrin, src_type); ++ break; ++ } ++ ++ case SpvOpAtomicCompareExchange: ++ case SpvOpAtomicCompareExchangeWeak: ++ case SpvOpAtomicIIncrement: ++ case SpvOpAtomicIDecrement: ++ case SpvOpAtomicExchange: ++ case SpvOpAtomicIAdd: ++ case SpvOpAtomicISub: ++ case SpvOpAtomicSMin: ++ case SpvOpAtomicUMin: ++ case SpvOpAtomicSMax: ++ case SpvOpAtomicUMax: ++ case SpvOpAtomicAnd: ++ case SpvOpAtomicOr: ++ case SpvOpAtomicXor: ++ case SpvOpAtomicFAddEXT: ++ case SpvOpAtomicFMinEXT: ++ case SpvOpAtomicFMaxEXT: ++ fill_common_atomic_sources(b, opcode, w, &intrin->src[3]); ++ break; ++ ++ default: ++ vtn_fail_with_opcode("Invalid image opcode", opcode); ++ } ++ ++ /* Image operations implicitly have the Image storage memory semantics. */ ++ semantics |= SpvMemorySemanticsImageMemoryMask; ++ ++ SpvMemorySemanticsMask before_semantics; ++ SpvMemorySemanticsMask after_semantics; ++ vtn_split_barrier_semantics(b, semantics, &before_semantics, &after_semantics); ++ ++ if (before_semantics) ++ vtn_emit_memory_barrier(b, scope, before_semantics); ++ ++ if (opcode != SpvOpImageWrite && opcode != SpvOpAtomicStore) { ++ struct vtn_type *type = vtn_get_type(b, w[1]); ++ struct vtn_type *struct_type = NULL; ++ if (opcode == SpvOpImageSparseRead) { ++ vtn_assert(glsl_type_is_struct_or_ifc(type->type)); ++ struct_type = type; ++ type = struct_type->members[1]; ++ } ++ ++ unsigned dest_components = glsl_get_vector_elements(type->type); ++ if (opcode == SpvOpImageSparseRead) ++ dest_components++; ++ ++ if (nir_intrinsic_infos[op].dest_components == 0) ++ intrin->num_components = dest_components; ++ ++ unsigned bit_size = glsl_get_bit_size(type->type); ++ if (opcode == SpvOpImageQuerySize || ++ opcode == SpvOpImageQuerySizeLod) ++ bit_size = MIN2(bit_size, 32); ++ ++ nir_def_init(&intrin->instr, &intrin->def, ++ nir_intrinsic_dest_components(intrin), bit_size); ++ ++ nir_builder_instr_insert(&b->nb, &intrin->instr); ++ ++ nir_def *result = nir_trim_vector(&b->nb, &intrin->def, ++ dest_components); ++ ++ if (opcode == SpvOpImageQuerySize || ++ opcode == SpvOpImageQuerySizeLod) ++ result = nir_u2uN(&b->nb, result, glsl_get_bit_size(type->type)); ++ ++ if (opcode == SpvOpImageSparseRead) { ++ struct vtn_ssa_value *dest = vtn_create_ssa_value(b, struct_type->type); ++ unsigned res_type_size = glsl_get_vector_elements(type->type); ++ dest->elems[0]->def = nir_channel(&b->nb, result, res_type_size); ++ if (intrin->def.bit_size != 32) ++ dest->elems[0]->def = nir_u2u32(&b->nb, dest->elems[0]->def); ++ dest->elems[1]->def = nir_trim_vector(&b->nb, result, res_type_size); ++ vtn_push_ssa_value(b, w[2], dest); ++ } else { ++ vtn_push_nir_ssa(b, w[2], result); ++ } ++ ++ if (opcode == SpvOpImageRead || opcode == SpvOpImageSparseRead || ++ opcode == SpvOpAtomicLoad) { ++ nir_alu_type dest_type = ++ get_image_type(b, nir_get_nir_type_for_glsl_type(type->type), operands); ++ nir_intrinsic_set_dest_type(intrin, dest_type); ++ } ++ } else { ++ nir_builder_instr_insert(&b->nb, &intrin->instr); ++ } ++ ++ if (after_semantics) ++ vtn_emit_memory_barrier(b, scope, after_semantics); ++} ++ ++static nir_intrinsic_op ++get_uniform_nir_atomic_op(struct vtn_builder *b, SpvOp opcode) ++{ ++ switch (opcode) { ++#define OP(S, N) case SpvOp##S: return nir_intrinsic_atomic_counter_ ##N; ++ OP(AtomicLoad, read_deref) ++ OP(AtomicExchange, exchange) ++ OP(AtomicCompareExchange, comp_swap) ++ OP(AtomicCompareExchangeWeak, comp_swap) ++ OP(AtomicIIncrement, inc_deref) ++ OP(AtomicIDecrement, post_dec_deref) ++ OP(AtomicIAdd, add_deref) ++ OP(AtomicISub, add_deref) ++ OP(AtomicUMin, min_deref) ++ OP(AtomicUMax, max_deref) ++ OP(AtomicAnd, and_deref) ++ OP(AtomicOr, or_deref) ++ OP(AtomicXor, xor_deref) ++#undef OP ++ default: ++ /* We left the following out: AtomicStore, AtomicSMin and ++ * AtomicSmax. Right now there are not nir intrinsics for them. At this ++ * moment Atomic Counter support is needed for ARB_spirv support, so is ++ * only need to support GLSL Atomic Counters that are uints and don't ++ * allow direct storage. ++ */ ++ vtn_fail("Invalid uniform atomic"); ++ } ++} ++ ++static nir_intrinsic_op ++get_deref_nir_atomic_op(struct vtn_builder *b, SpvOp opcode) ++{ ++ switch (opcode) { ++ case SpvOpAtomicLoad: return nir_intrinsic_load_deref; ++ case SpvOpAtomicFlagClear: ++ case SpvOpAtomicStore: return nir_intrinsic_store_deref; ++#define OP(S, N) case SpvOp##S: return nir_intrinsic_deref_##N; ++ OP(AtomicExchange, atomic) ++ OP(AtomicCompareExchange, atomic_swap) ++ OP(AtomicCompareExchangeWeak, atomic_swap) ++ OP(AtomicIIncrement, atomic) ++ OP(AtomicIDecrement, atomic) ++ OP(AtomicIAdd, atomic) ++ OP(AtomicISub, atomic) ++ OP(AtomicSMin, atomic) ++ OP(AtomicUMin, atomic) ++ OP(AtomicSMax, atomic) ++ OP(AtomicUMax, atomic) ++ OP(AtomicAnd, atomic) ++ OP(AtomicOr, atomic) ++ OP(AtomicXor, atomic) ++ OP(AtomicFAddEXT, atomic) ++ OP(AtomicFMinEXT, atomic) ++ OP(AtomicFMaxEXT, atomic) ++ OP(AtomicFlagTestAndSet, atomic_swap) ++#undef OP ++ default: ++ vtn_fail_with_opcode("Invalid shared atomic", opcode); ++ } ++} ++ ++/* ++ * Handles shared atomics, ssbo atomics and atomic counters. ++ */ ++static void ++vtn_handle_atomics(struct vtn_builder *b, SpvOp opcode, ++ const uint32_t *w, UNUSED unsigned count) ++{ ++ struct vtn_pointer *ptr; ++ nir_intrinsic_instr *atomic; ++ ++ SpvScope scope = SpvScopeInvocation; ++ SpvMemorySemanticsMask semantics = 0; ++ enum gl_access_qualifier access = 0; ++ ++ switch (opcode) { ++ case SpvOpAtomicLoad: ++ case SpvOpAtomicExchange: ++ case SpvOpAtomicCompareExchange: ++ case SpvOpAtomicCompareExchangeWeak: ++ case SpvOpAtomicIIncrement: ++ case SpvOpAtomicIDecrement: ++ case SpvOpAtomicIAdd: ++ case SpvOpAtomicISub: ++ case SpvOpAtomicSMin: ++ case SpvOpAtomicUMin: ++ case SpvOpAtomicSMax: ++ case SpvOpAtomicUMax: ++ case SpvOpAtomicAnd: ++ case SpvOpAtomicOr: ++ case SpvOpAtomicXor: ++ case SpvOpAtomicFAddEXT: ++ case SpvOpAtomicFMinEXT: ++ case SpvOpAtomicFMaxEXT: ++ case SpvOpAtomicFlagTestAndSet: ++ ptr = vtn_pointer(b, w[3]); ++ scope = vtn_constant_uint(b, w[4]); ++ semantics = vtn_constant_uint(b, w[5]); ++ break; ++ case SpvOpAtomicFlagClear: ++ case SpvOpAtomicStore: ++ ptr = vtn_pointer(b, w[1]); ++ scope = vtn_constant_uint(b, w[2]); ++ semantics = vtn_constant_uint(b, w[3]); ++ break; ++ ++ default: ++ vtn_fail_with_opcode("Invalid SPIR-V atomic", opcode); ++ } ++ ++ if (semantics & SpvMemorySemanticsVolatileMask) ++ access |= ACCESS_VOLATILE; ++ ++ /* uniform as "atomic counter uniform" */ ++ if (ptr->mode == vtn_variable_mode_atomic_counter) { ++ nir_deref_instr *deref = vtn_pointer_to_deref(b, ptr); ++ nir_intrinsic_op op = get_uniform_nir_atomic_op(b, opcode); ++ atomic = nir_intrinsic_instr_create(b->nb.shader, op); ++ atomic->src[0] = nir_src_for_ssa(&deref->def); ++ ++ /* SSBO needs to initialize index/offset. In this case we don't need to, ++ * as that info is already stored on the ptr->var->var nir_variable (see ++ * vtn_create_variable) ++ */ ++ ++ switch (opcode) { ++ case SpvOpAtomicLoad: ++ case SpvOpAtomicExchange: ++ case SpvOpAtomicCompareExchange: ++ case SpvOpAtomicCompareExchangeWeak: ++ case SpvOpAtomicIIncrement: ++ case SpvOpAtomicIDecrement: ++ case SpvOpAtomicIAdd: ++ case SpvOpAtomicISub: ++ case SpvOpAtomicSMin: ++ case SpvOpAtomicUMin: ++ case SpvOpAtomicSMax: ++ case SpvOpAtomicUMax: ++ case SpvOpAtomicAnd: ++ case SpvOpAtomicOr: ++ case SpvOpAtomicXor: ++ /* Nothing: we don't need to call fill_common_atomic_sources here, as ++ * atomic counter uniforms doesn't have sources ++ */ ++ break; ++ ++ default: ++ UNREACHABLE("Invalid SPIR-V atomic"); ++ ++ } ++ } else { ++ nir_deref_instr *deref = vtn_pointer_to_deref(b, ptr); ++ const struct glsl_type *deref_type = deref->type; ++ nir_intrinsic_op op = get_deref_nir_atomic_op(b, opcode); ++ atomic = nir_intrinsic_instr_create(b->nb.shader, op); ++ atomic->src[0] = nir_src_for_ssa(&deref->def); ++ ++ if (nir_intrinsic_has_atomic_op(atomic)) ++ nir_intrinsic_set_atomic_op(atomic, translate_atomic_op(opcode)); ++ ++ if (ptr->mode != vtn_variable_mode_workgroup) ++ access |= ACCESS_COHERENT; ++ if (op == nir_intrinsic_load_deref || op == nir_intrinsic_store_deref) ++ access |= ACCESS_ATOMIC; ++ if (ptr->access & ACCESS_NON_UNIFORM) ++ access |= ACCESS_NON_UNIFORM; ++ ++ nir_intrinsic_set_access(atomic, access); ++ ++ switch (opcode) { ++ case SpvOpAtomicLoad: ++ atomic->num_components = glsl_get_vector_elements(deref_type); ++ break; ++ ++ case SpvOpAtomicStore: ++ atomic->num_components = glsl_get_vector_elements(deref_type); ++ nir_intrinsic_set_write_mask(atomic, (1 << atomic->num_components) - 1); ++ atomic->src[1] = nir_src_for_ssa(vtn_get_nir_ssa(b, w[4])); ++ break; ++ ++ case SpvOpAtomicFlagClear: ++ atomic->num_components = 1; ++ nir_intrinsic_set_write_mask(atomic, 1); ++ atomic->src[1] = nir_src_for_ssa(nir_imm_intN_t(&b->nb, 0, 32)); ++ break; ++ case SpvOpAtomicFlagTestAndSet: ++ atomic->src[1] = nir_src_for_ssa(nir_imm_intN_t(&b->nb, 0, 32)); ++ atomic->src[2] = nir_src_for_ssa(nir_imm_intN_t(&b->nb, -1, 32)); ++ break; ++ case SpvOpAtomicExchange: ++ case SpvOpAtomicCompareExchange: ++ case SpvOpAtomicCompareExchangeWeak: ++ case SpvOpAtomicIIncrement: ++ case SpvOpAtomicIDecrement: ++ case SpvOpAtomicIAdd: ++ case SpvOpAtomicISub: ++ case SpvOpAtomicSMin: ++ case SpvOpAtomicUMin: ++ case SpvOpAtomicSMax: ++ case SpvOpAtomicUMax: ++ case SpvOpAtomicAnd: ++ case SpvOpAtomicOr: ++ case SpvOpAtomicXor: ++ case SpvOpAtomicFAddEXT: ++ case SpvOpAtomicFMinEXT: ++ case SpvOpAtomicFMaxEXT: ++ fill_common_atomic_sources(b, opcode, w, &atomic->src[1]); ++ break; ++ ++ default: ++ vtn_fail_with_opcode("Invalid SPIR-V atomic", opcode); ++ } ++ } ++ ++ /* Atomic ordering operations will implicitly apply to the atomic operation ++ * storage class, so include that too. ++ */ ++ semantics |= vtn_mode_to_memory_semantics(ptr->mode); ++ ++ SpvMemorySemanticsMask before_semantics; ++ SpvMemorySemanticsMask after_semantics; ++ vtn_split_barrier_semantics(b, semantics, &before_semantics, &after_semantics); ++ ++ if (before_semantics) ++ vtn_emit_memory_barrier(b, scope, before_semantics); ++ ++ if (opcode != SpvOpAtomicStore && opcode != SpvOpAtomicFlagClear) { ++ struct vtn_type *type = vtn_get_type(b, w[1]); ++ ++ if (opcode == SpvOpAtomicFlagTestAndSet) { ++ /* map atomic flag to a 32-bit atomic integer. */ ++ nir_def_init(&atomic->instr, &atomic->def, 1, 32); ++ } else { ++ nir_def_init(&atomic->instr, &atomic->def, ++ glsl_get_vector_elements(type->type), ++ glsl_get_bit_size(type->type)); ++ ++ vtn_push_nir_ssa(b, w[2], &atomic->def); ++ } ++ } ++ ++ nir_builder_instr_insert(&b->nb, &atomic->instr); ++ ++ if (opcode == SpvOpAtomicFlagTestAndSet) { ++ vtn_push_nir_ssa(b, w[2], nir_i2b(&b->nb, &atomic->def)); ++ } ++ if (after_semantics) ++ vtn_emit_memory_barrier(b, scope, after_semantics); ++} ++ ++static nir_alu_instr * ++create_vec(struct vtn_builder *b, unsigned num_components, unsigned bit_size) ++{ ++ nir_op op = nir_op_vec(num_components); ++ nir_alu_instr *vec = nir_alu_instr_create(b->shader, op); ++ nir_def_init(&vec->instr, &vec->def, num_components, bit_size); ++ ++ return vec; ++} ++ ++struct vtn_ssa_value * ++vtn_ssa_transpose(struct vtn_builder *b, struct vtn_ssa_value *src) ++{ ++ if (src->transposed) ++ return src->transposed; ++ ++ struct vtn_ssa_value *dest = ++ vtn_create_ssa_value(b, glsl_transposed_type(src->type)); ++ ++ for (unsigned i = 0; i < glsl_get_matrix_columns(dest->type); i++) { ++ if (glsl_type_is_vector_or_scalar(src->type)) { ++ dest->elems[i]->def = nir_channel(&b->nb, src->def, i); ++ } else { ++ unsigned cols = glsl_get_matrix_columns(src->type); ++ nir_scalar srcs[NIR_MAX_MATRIX_COLUMNS]; ++ for (unsigned j = 0; j < cols; j++) { ++ srcs[j] = nir_get_scalar(src->elems[j]->def, i); ++ } ++ dest->elems[i]->def = nir_vec_scalars(&b->nb, srcs, cols); ++ } ++ } ++ ++ dest->transposed = src; ++ ++ return dest; ++} ++ ++static nir_def * ++vtn_vector_shuffle(struct vtn_builder *b, unsigned num_components, ++ nir_def *src0, nir_def *src1, ++ const uint32_t *indices) ++{ ++ nir_alu_instr *vec = create_vec(b, num_components, src0->bit_size); ++ ++ for (unsigned i = 0; i < num_components; i++) { ++ uint32_t index = indices[i]; ++ unsigned total_components = src0->num_components + src1->num_components; ++ vtn_fail_if(index != 0xffffffff && index >= total_components, ++ "OpVectorShuffle: All Component literals must either be " ++ "FFFFFFFF or in [0, N - 1] (inclusive)"); ++ ++ if (index == 0xffffffff) { ++ vec->src[i].src = ++ nir_src_for_ssa(nir_undef(&b->nb, 1, src0->bit_size)); ++ } else if (index < src0->num_components) { ++ vec->src[i].src = nir_src_for_ssa(src0); ++ vec->src[i].swizzle[0] = index; ++ } else { ++ vec->src[i].src = nir_src_for_ssa(src1); ++ vec->src[i].swizzle[0] = index - src0->num_components; ++ } ++ } ++ ++ nir_builder_instr_insert(&b->nb, &vec->instr); ++ ++ return &vec->def; ++} ++ ++/* ++ * Concatentates a number of vectors/scalars together to produce a vector ++ */ ++static nir_def * ++vtn_vector_construct(struct vtn_builder *b, unsigned num_components, ++ unsigned num_srcs, nir_def **srcs) ++{ ++ nir_alu_instr *vec = create_vec(b, num_components, srcs[0]->bit_size); ++ ++ /* From the SPIR-V 1.1 spec for OpCompositeConstruct: ++ * ++ * "When constructing a vector, there must be at least two Constituent ++ * operands." ++ */ ++ vtn_assert(num_srcs >= 2); ++ ++ unsigned dest_idx = 0; ++ for (unsigned i = 0; i < num_srcs; i++) { ++ nir_def *src = srcs[i]; ++ vtn_assert(dest_idx + src->num_components <= num_components); ++ for (unsigned j = 0; j < src->num_components; j++) { ++ vec->src[dest_idx].src = nir_src_for_ssa(src); ++ vec->src[dest_idx].swizzle[0] = j; ++ dest_idx++; ++ } ++ } ++ ++ /* From the SPIR-V 1.1 spec for OpCompositeConstruct: ++ * ++ * "When constructing a vector, the total number of components in all ++ * the operands must equal the number of components in Result Type." ++ */ ++ vtn_assert(dest_idx == num_components); ++ ++ nir_builder_instr_insert(&b->nb, &vec->instr); ++ ++ return &vec->def; ++} ++ ++/* ++ * Creates a copy of `src`, reinterpreting it as `dest_type`. ++ */ ++static struct vtn_ssa_value * ++vtn_composite_copy_logical(struct vtn_builder *b, struct vtn_ssa_value *src, struct vtn_type* dest_type) ++{ ++ assert(!src->is_variable); ++ ++ struct vtn_ssa_value *dest = vtn_zalloc(b, struct vtn_ssa_value); ++ dest->type = glsl_get_bare_type(dest_type->type); ++ ++ if (glsl_type_is_vector_or_scalar(dest_type->type)) { ++ dest->def = src->def; ++ } else { ++ unsigned elems = glsl_get_length(dest_type->type); ++ dest->elems = vtn_alloc_array(b, struct vtn_ssa_value *, elems); ++ ++ if (glsl_type_is_struct(dest_type->type) || glsl_type_is_interface(dest_type->type)) { ++ for (unsigned i = 0; i < elems; i++) ++ dest->elems[i] = vtn_composite_copy_logical(b, src->elems[i], dest_type->members[i]); ++ } else { ++ for (unsigned i = 0; i < elems; i++) ++ dest->elems[i] = vtn_composite_copy_logical(b, src->elems[i], dest_type->array_element); ++ } ++ } ++ ++ return dest; ++} ++ ++static struct vtn_ssa_value * ++vtn_composite_insert(struct vtn_builder *b, struct vtn_ssa_value *src, ++ struct vtn_type *src_type, struct vtn_ssa_value *insert, ++ const uint32_t *indices, unsigned num_indices) ++{ ++ if (glsl_type_is_cmat(src->type)) ++ return vtn_cooperative_matrix_insert(b, src, insert, indices, num_indices); ++ ++ /* Straight copy, use the source type as the destination type. */ ++ struct vtn_ssa_value *dest = vtn_composite_copy_logical(b, src, src_type); ++ ++ struct vtn_ssa_value *cur = dest; ++ unsigned i; ++ for (i = 0; i < num_indices - 1; i++) { ++ /* If we got a vector here, that means the next index will be trying to ++ * dereference a scalar. ++ */ ++ vtn_fail_if(glsl_type_is_vector_or_scalar(cur->type), ++ "OpCompositeInsert has too many indices."); ++ vtn_fail_if(indices[i] >= glsl_get_length(cur->type), ++ "All indices in an OpCompositeInsert must be in-bounds"); ++ cur = cur->elems[indices[i]]; ++ } ++ ++ if (glsl_type_is_vector_or_scalar(cur->type)) { ++ vtn_fail_if(indices[i] >= glsl_get_vector_elements(cur->type), ++ "All indices in an OpCompositeInsert must be in-bounds"); ++ ++ /* According to the SPIR-V spec, OpCompositeInsert may work down to ++ * the component granularity. In that case, the last index will be ++ * the index to insert the scalar into the vector. ++ */ ++ ++ cur->def = nir_vector_insert_imm(&b->nb, cur->def, insert->def, indices[i]); ++ } else { ++ vtn_fail_if(indices[i] >= glsl_get_length(cur->type), ++ "All indices in an OpCompositeInsert must be in-bounds"); ++ cur->elems[indices[i]] = insert; ++ } ++ ++ return dest; ++} ++ ++static struct vtn_ssa_value * ++vtn_composite_extract(struct vtn_builder *b, struct vtn_ssa_value *src, ++ const uint32_t *indices, unsigned num_indices) ++{ ++ if (glsl_type_is_cmat(src->type)) ++ return vtn_cooperative_matrix_extract(b, src, indices, num_indices); ++ ++ struct vtn_ssa_value *cur = src; ++ for (unsigned i = 0; i < num_indices; i++) { ++ if (glsl_type_is_vector_or_scalar(cur->type)) { ++ vtn_assert(i == num_indices - 1); ++ vtn_fail_if(indices[i] >= glsl_get_vector_elements(cur->type), ++ "All indices in an OpCompositeExtract must be in-bounds"); ++ ++ /* According to the SPIR-V spec, OpCompositeExtract may work down to ++ * the component granularity. The last index will be the index of the ++ * vector to extract. ++ */ ++ ++ const struct glsl_type *scalar_type = ++ glsl_scalar_type(glsl_get_base_type(cur->type)); ++ struct vtn_ssa_value *ret = vtn_create_ssa_value(b, scalar_type); ++ ret->def = nir_channel(&b->nb, cur->def, indices[i]); ++ return ret; ++ } else { ++ vtn_fail_if(indices[i] >= glsl_get_length(cur->type), ++ "All indices in an OpCompositeExtract must be in-bounds"); ++ cur = cur->elems[indices[i]]; ++ } ++ } ++ ++ return cur; ++} ++ ++static void ++vtn_handle_composite(struct vtn_builder *b, SpvOp opcode, ++ const uint32_t *w, unsigned count) ++{ ++ struct vtn_type *type = vtn_get_type(b, w[1]); ++ struct vtn_ssa_value *ssa = vtn_create_ssa_value(b, type->type); ++ ++ switch (opcode) { ++ case SpvOpVectorExtractDynamic: ++ ssa->def = nir_vector_extract(&b->nb, vtn_get_nir_ssa(b, w[3]), ++ vtn_get_nir_ssa(b, w[4])); ++ break; ++ ++ case SpvOpVectorInsertDynamic: ++ ssa->def = nir_vector_insert(&b->nb, vtn_get_nir_ssa(b, w[3]), ++ vtn_get_nir_ssa(b, w[4]), ++ vtn_get_nir_ssa(b, w[5])); ++ break; ++ ++ case SpvOpVectorShuffle: ++ ssa->def = vtn_vector_shuffle(b, glsl_get_vector_elements(type->type), ++ vtn_get_nir_ssa(b, w[3]), ++ vtn_get_nir_ssa(b, w[4]), ++ w + 5); ++ break; ++ ++ case SpvOpCompositeConstruct: ++ case SpvOpCompositeConstructReplicateEXT: { ++ unsigned elems = count - 3; ++ assume(elems >= 1); ++ if (type->base_type == vtn_base_type_cooperative_matrix) { ++ vtn_assert(elems == 1); ++ nir_deref_instr *mat = vtn_create_cmat_temporary(b, type->type, "cmat_construct"); ++ nir_cmat_construct(&b->nb, &mat->def, vtn_get_nir_ssa(b, w[3])); ++ vtn_set_ssa_value_var(b, ssa, mat->var); ++ } else if (glsl_type_is_vector_or_scalar(type->type)) { ++ if (opcode == SpvOpCompositeConstructReplicateEXT) { ++ nir_def *src = vtn_get_nir_ssa(b, w[3]); ++ vtn_assert(glsl_get_bit_size(type->type) == src->bit_size); ++ unsigned swiz[NIR_MAX_VEC_COMPONENTS] = { 0, }; ++ ssa->def = nir_swizzle(&b->nb, src, swiz, ++ glsl_get_vector_elements(type->type)); ++ } else { ++ nir_def *srcs[NIR_MAX_VEC_COMPONENTS]; ++ for (unsigned i = 0; i < elems; i++) { ++ srcs[i] = vtn_get_nir_ssa(b, w[3 + i]); ++ vtn_assert(glsl_get_bit_size(type->type) == srcs[i]->bit_size); ++ } ++ ssa->def = ++ vtn_vector_construct(b, glsl_get_vector_elements(type->type), ++ elems, srcs); ++ } ++ } else { ++ ssa->elems = vtn_alloc_array(b, struct vtn_ssa_value *, type->length); ++ if (opcode == SpvOpCompositeConstructReplicateEXT) { ++ struct vtn_ssa_value *elem = vtn_ssa_value(b, w[3]); ++ for (unsigned i = 0; i < type->length; i++) ++ ssa->elems[i] = elem; ++ } else { ++ vtn_fail_if(elems != type->length, ++ "%s has %u constituents, expected %u", ++ spirv_op_to_string(opcode), elems, type->length); ++ for (unsigned i = 0; i < elems; i++) ++ ssa->elems[i] = vtn_ssa_value(b, w[3 + i]); ++ } ++ } ++ break; ++ } ++ case SpvOpCompositeExtract: ++ ssa = vtn_composite_extract(b, vtn_ssa_value(b, w[3]), ++ w + 4, count - 4); ++ break; ++ ++ case SpvOpCompositeInsert: ++ ssa = vtn_composite_insert(b, vtn_ssa_value(b, w[4]), ++ vtn_get_value_type(b, w[4]), ++ vtn_ssa_value(b, w[3]), ++ w + 5, count - 5); ++ break; ++ ++ case SpvOpCopyLogical: { ++ struct vtn_type *dest_type = vtn_get_value_type(b, w[2]); ++ vtn_assert(vtn_types_compatible(b, vtn_get_value_type(b, w[3]), dest_type)); ++ ssa = vtn_composite_copy_logical(b, vtn_ssa_value(b, w[3]), dest_type); ++ break; ++ } ++ case SpvOpCopyObject: ++ case SpvOpExpectKHR: ++ vtn_copy_value(b, w[3], w[2]); ++ return; ++ ++ default: ++ vtn_fail_with_opcode("unknown composite operation", opcode); ++ } ++ ++ vtn_push_ssa_value(b, w[2], ssa); ++} ++ ++static void ++vtn_handle_barrier(struct vtn_builder *b, SpvOp opcode, ++ const uint32_t *w, UNUSED unsigned count) ++{ ++ switch (opcode) { ++ case SpvOpEmitVertex: ++ case SpvOpEmitStreamVertex: ++ case SpvOpEndPrimitive: ++ case SpvOpEndStreamPrimitive: { ++ unsigned stream = 0; ++ if (opcode == SpvOpEmitStreamVertex || opcode == SpvOpEndStreamPrimitive) ++ stream = vtn_constant_uint(b, w[1]); ++ ++ switch (opcode) { ++ case SpvOpEmitStreamVertex: ++ case SpvOpEmitVertex: ++ nir_emit_vertex(&b->nb, stream); ++ break; ++ case SpvOpEndPrimitive: ++ case SpvOpEndStreamPrimitive: ++ nir_end_primitive(&b->nb, stream); ++ break; ++ default: ++ UNREACHABLE("Invalid opcode"); ++ } ++ break; ++ } ++ ++ case SpvOpMemoryBarrier: { ++ SpvScope scope = vtn_constant_uint(b, w[1]); ++ SpvMemorySemanticsMask semantics = vtn_constant_uint(b, w[2]); ++ vtn_emit_memory_barrier(b, scope, semantics); ++ return; ++ } ++ ++ case SpvOpControlBarrier: { ++ SpvScope execution_scope = vtn_constant_uint(b, w[1]); ++ SpvScope memory_scope = vtn_constant_uint(b, w[2]); ++ SpvMemorySemanticsMask memory_semantics = vtn_constant_uint(b, w[3]); ++ ++ /* GLSLang, prior to commit 8297936dd6eb3, emitted OpControlBarrier with ++ * memory semantics of None for GLSL barrier(). ++ * And before that, prior to c3f1cdfa, emitted the OpControlBarrier with ++ * Device instead of Workgroup for execution scope. ++ */ ++ if (b->wa_glslang_cs_barrier && ++ b->nb.shader->info.stage == MESA_SHADER_COMPUTE && ++ (execution_scope == SpvScopeWorkgroup || ++ execution_scope == SpvScopeDevice) && ++ memory_semantics == SpvMemorySemanticsMaskNone) { ++ execution_scope = SpvScopeWorkgroup; ++ memory_scope = SpvScopeWorkgroup; ++ memory_semantics = SpvMemorySemanticsAcquireReleaseMask | ++ SpvMemorySemanticsWorkgroupMemoryMask; ++ } ++ ++ /* From the SPIR-V spec: ++ * ++ * "When used with the TessellationControl execution model, it also ++ * implicitly synchronizes the Output Storage Class: Writes to Output ++ * variables performed by any invocation executed prior to a ++ * OpControlBarrier will be visible to any other invocation after ++ * return from that OpControlBarrier." ++ * ++ * The same applies to VK_NV_mesh_shader. ++ */ ++ if (b->nb.shader->info.stage == MESA_SHADER_TESS_CTRL || ++ b->nb.shader->info.stage == MESA_SHADER_TASK || ++ b->nb.shader->info.stage == MESA_SHADER_MESH) { ++ memory_semantics &= ~(SpvMemorySemanticsAcquireMask | ++ SpvMemorySemanticsReleaseMask | ++ SpvMemorySemanticsAcquireReleaseMask | ++ SpvMemorySemanticsSequentiallyConsistentMask); ++ memory_semantics |= SpvMemorySemanticsAcquireReleaseMask | ++ SpvMemorySemanticsOutputMemoryMask; ++ if (memory_scope == SpvScopeSubgroup || memory_scope == SpvScopeInvocation) ++ memory_scope = SpvScopeWorkgroup; ++ } ++ ++ vtn_emit_scoped_control_barrier(b, execution_scope, memory_scope, ++ memory_semantics); ++ break; ++ } ++ ++ default: ++ UNREACHABLE("unknown barrier instruction"); ++ } ++} ++ ++static enum tess_primitive_mode ++tess_primitive_mode_from_spv_execution_mode(struct vtn_builder *b, ++ SpvExecutionMode mode) ++{ ++ switch (mode) { ++ case SpvExecutionModeTriangles: ++ return TESS_PRIMITIVE_TRIANGLES; ++ case SpvExecutionModeQuads: ++ return TESS_PRIMITIVE_QUADS; ++ case SpvExecutionModeIsolines: ++ return TESS_PRIMITIVE_ISOLINES; ++ default: ++ vtn_fail("Invalid tess primitive type: %s (%u)", ++ spirv_executionmode_to_string(mode), mode); ++ } ++} ++ ++static enum mesa_prim ++primitive_from_spv_execution_mode(struct vtn_builder *b, ++ SpvExecutionMode mode) ++{ ++ switch (mode) { ++ case SpvExecutionModeInputPoints: ++ case SpvExecutionModeOutputPoints: ++ return MESA_PRIM_POINTS; ++ case SpvExecutionModeInputLines: ++ case SpvExecutionModeOutputLinesNV: ++ return MESA_PRIM_LINES; ++ case SpvExecutionModeInputLinesAdjacency: ++ return MESA_PRIM_LINES_ADJACENCY; ++ case SpvExecutionModeTriangles: ++ case SpvExecutionModeOutputTrianglesNV: ++ return MESA_PRIM_TRIANGLES; ++ case SpvExecutionModeInputTrianglesAdjacency: ++ return MESA_PRIM_TRIANGLES_ADJACENCY; ++ case SpvExecutionModeQuads: ++ return MESA_PRIM_QUADS; ++ case SpvExecutionModeOutputLineStrip: ++ return MESA_PRIM_LINE_STRIP; ++ case SpvExecutionModeOutputTriangleStrip: ++ return MESA_PRIM_TRIANGLE_STRIP; ++ default: ++ vtn_fail("Invalid primitive type: %s (%u)", ++ spirv_executionmode_to_string(mode), mode); ++ } ++} ++ ++static unsigned ++vertices_in_from_spv_execution_mode(struct vtn_builder *b, ++ SpvExecutionMode mode) ++{ ++ switch (mode) { ++ case SpvExecutionModeInputPoints: ++ return 1; ++ case SpvExecutionModeInputLines: ++ return 2; ++ case SpvExecutionModeInputLinesAdjacency: ++ return 4; ++ case SpvExecutionModeTriangles: ++ return 3; ++ case SpvExecutionModeInputTrianglesAdjacency: ++ return 6; ++ default: ++ vtn_fail("Invalid GS input mode: %s (%u)", ++ spirv_executionmode_to_string(mode), mode); ++ } ++} ++ ++mesa_shader_stage ++vtn_stage_for_execution_model(SpvExecutionModel model) ++{ ++ switch (model) { ++ case SpvExecutionModelVertex: ++ return MESA_SHADER_VERTEX; ++ case SpvExecutionModelTessellationControl: ++ return MESA_SHADER_TESS_CTRL; ++ case SpvExecutionModelTessellationEvaluation: ++ return MESA_SHADER_TESS_EVAL; ++ case SpvExecutionModelGeometry: ++ return MESA_SHADER_GEOMETRY; ++ case SpvExecutionModelFragment: ++ return MESA_SHADER_FRAGMENT; ++ case SpvExecutionModelGLCompute: ++ return MESA_SHADER_COMPUTE; ++ case SpvExecutionModelKernel: ++ return MESA_SHADER_KERNEL; ++ case SpvExecutionModelRayGenerationKHR: ++ return MESA_SHADER_RAYGEN; ++ case SpvExecutionModelAnyHitKHR: ++ return MESA_SHADER_ANY_HIT; ++ case SpvExecutionModelClosestHitKHR: ++ return MESA_SHADER_CLOSEST_HIT; ++ case SpvExecutionModelMissKHR: ++ return MESA_SHADER_MISS; ++ case SpvExecutionModelIntersectionKHR: ++ return MESA_SHADER_INTERSECTION; ++ case SpvExecutionModelCallableKHR: ++ return MESA_SHADER_CALLABLE; ++ case SpvExecutionModelTaskNV: ++ case SpvExecutionModelTaskEXT: ++ return MESA_SHADER_TASK; ++ case SpvExecutionModelMeshNV: ++ case SpvExecutionModelMeshEXT: ++ return MESA_SHADER_MESH; ++ default: ++ return MESA_SHADER_NONE; ++ } ++} ++ ++void ++vtn_handle_entry_point(struct vtn_builder *b, const uint32_t *w, ++ unsigned count) ++{ ++ struct vtn_value *entry_point = &b->values[w[2]]; ++ /* Let this be a name label regardless */ ++ unsigned name_words; ++ entry_point->name = vtn_string_literal(b, &w[3], count - 3, &name_words); ++ entry_point->is_entrypoint = true; ++ ++ mesa_shader_stage stage = vtn_stage_for_execution_model(w[1]); ++ vtn_fail_if(stage == MESA_SHADER_NONE, ++ "Unsupported execution model: %s (%u)", ++ spirv_executionmodel_to_string(w[1]), w[1]); ++ if (strcmp(entry_point->name, b->entry_point_name) != 0 || ++ stage != b->entry_point_stage) ++ return; ++ ++ vtn_assert(b->entry_point == NULL); ++ b->entry_point = entry_point; ++ ++ /* Entry points enumerate which global variables are used. */ ++ size_t start = 3 + name_words; ++ b->interface_ids_count = count - start; ++ b->interface_ids = vtn_alloc_array(b, uint32_t, b->interface_ids_count); ++ memcpy(b->interface_ids, &w[start], b->interface_ids_count * 4); ++ qsort(b->interface_ids, b->interface_ids_count, 4, cmp_uint32_t); ++} ++ ++static bool ++vtn_handle_preamble_instruction(struct vtn_builder *b, SpvOp opcode, ++ const uint32_t *w, unsigned count) ++{ ++ switch (opcode) { ++ case SpvOpString: ++ case SpvOpSource: ++ case SpvOpSourceExtension: ++ case SpvOpSourceContinued: ++ case SpvOpModuleProcessed: ++ vtn_handle_debug_text(b, opcode, w, count); ++ break; ++ ++ case SpvOpExtension: { ++ /* Implementing both NV_mesh_shader and EXT_mesh_shader ++ * is difficult without knowing which we're dealing with. ++ * TODO: remove this when we stop supporting NV_mesh_shader. ++ */ ++ const char *ext_name = (const char *)&w[1]; ++ if (strcmp(ext_name, "SPV_NV_mesh_shader") == 0) ++ b->shader->info.mesh.nv = true; ++ break; ++ } ++ ++ case SpvOpCapability: { ++ SpvCapability cap = w[1]; ++ switch (cap) { ++ case SpvCapabilitySubgroupDispatch: ++ /* Missing : ++ * - SpvOpGetKernelLocalSizeForSubgroupCount ++ * - SpvOpGetKernelMaxNumSubgroups ++ */ ++ vtn_warn("Not fully supported capability: %s", ++ spirv_capability_to_string(cap)); ++ break; ++ ++ case SpvCapabilityOptNoneEXT: ++ /* This is a "strong request" not to optimize a function, usually ++ * because it's a compute shader and the workgroup size etc is ++ * manually tuned and we shouldn't risk undoing it. Someday! ++ */ ++ vtn_info("Not fully supported capability: %s", ++ spirv_capability_to_string(cap)); ++ break; ++ ++ default: ++ vtn_fail_if(!spirv_capabilities_get(&implemented_capabilities, cap), ++ "Unimplemented SPIR-V capability: %s (%u)", ++ spirv_capability_to_string(cap), cap); ++ } ++ ++ if (!spirv_capabilities_get(&b->supported_capabilities, cap)) { ++ vtn_warn("Unsupported SPIR-V capability: %s (%u)", ++ spirv_capability_to_string(cap), cap); ++ } ++ ++ spirv_capabilities_set(&b->enabled_capabilities, cap, true); ++ break; ++ } ++ ++ case SpvOpExtInstImport: ++ vtn_handle_extension(b, opcode, w, count); ++ break; ++ ++ case SpvOpMemoryModel: ++ switch (w[1]) { ++ case SpvAddressingModelPhysical32: ++ vtn_fail_if(b->shader->info.stage != MESA_SHADER_KERNEL, ++ "AddressingModelPhysical32 only supported for kernels"); ++ b->shader->info.cs.ptr_size = 32; ++ b->physical_ptrs = true; ++ assert(nir_address_format_bit_size(b->options->global_addr_format) == 32); ++ assert(nir_address_format_num_components(b->options->global_addr_format) == 1); ++ assert(nir_address_format_bit_size(b->options->shared_addr_format) == 32); ++ assert(nir_address_format_num_components(b->options->shared_addr_format) == 1); ++ assert(nir_address_format_bit_size(b->options->constant_addr_format) == 32); ++ assert(nir_address_format_num_components(b->options->constant_addr_format) == 1); ++ break; ++ case SpvAddressingModelPhysical64: ++ vtn_fail_if(b->shader->info.stage != MESA_SHADER_KERNEL, ++ "AddressingModelPhysical64 only supported for kernels"); ++ b->shader->info.cs.ptr_size = 64; ++ b->physical_ptrs = true; ++ assert(nir_address_format_bit_size(b->options->global_addr_format) == 64); ++ assert(nir_address_format_num_components(b->options->global_addr_format) == 1); ++ assert(nir_address_format_bit_size(b->options->shared_addr_format) == 64); ++ assert(nir_address_format_num_components(b->options->shared_addr_format) == 1); ++ assert(nir_address_format_bit_size(b->options->constant_addr_format) == 64); ++ assert(nir_address_format_num_components(b->options->constant_addr_format) == 1); ++ break; ++ case SpvAddressingModelLogical: ++ vtn_fail_if(b->shader->info.stage == MESA_SHADER_KERNEL, ++ "AddressingModelLogical only supported for shaders"); ++ b->physical_ptrs = false; ++ break; ++ case SpvAddressingModelPhysicalStorageBuffer64: ++ vtn_fail_if(!b->supported_capabilities.PhysicalStorageBufferAddresses, ++ "AddressingModelPhysicalStorageBuffer64 not supported"); ++ break; ++ default: ++ vtn_fail("Unknown addressing model: %s (%u)", ++ spirv_addressingmodel_to_string(w[1]), w[1]); ++ break; ++ } ++ ++ b->mem_model = w[2]; ++ switch (w[2]) { ++ case SpvMemoryModelSimple: ++ case SpvMemoryModelGLSL450: ++ case SpvMemoryModelOpenCL: ++ break; ++ case SpvMemoryModelVulkan: ++ vtn_fail_if(!b->supported_capabilities.VulkanMemoryModel, ++ "Vulkan memory model is unsupported by this driver"); ++ b->shader->info.assume_no_data_races = true; ++ break; ++ default: ++ vtn_fail("Unsupported memory model: %s", ++ spirv_memorymodel_to_string(w[2])); ++ break; ++ } ++ break; ++ ++ case SpvOpEntryPoint: ++ vtn_handle_entry_point(b, w, count); ++ break; ++ ++ case SpvOpName: ++ b->values[w[1]].name = vtn_string_literal(b, &w[2], count - 2, NULL); ++ break; ++ ++ case SpvOpMemberName: ++ case SpvOpExecutionMode: ++ case SpvOpExecutionModeId: ++ case SpvOpDecorationGroup: ++ case SpvOpDecorate: ++ case SpvOpDecorateId: ++ case SpvOpMemberDecorate: ++ case SpvOpGroupDecorate: ++ case SpvOpGroupMemberDecorate: ++ case SpvOpDecorateString: ++ case SpvOpMemberDecorateString: ++ vtn_handle_decoration(b, opcode, w, count); ++ break; ++ ++ case SpvOpExtInst: ++ case SpvOpExtInstWithForwardRefsKHR: { ++ struct vtn_value *val = vtn_value(b, w[3], vtn_value_type_extension); ++ if (val->ext_handler == vtn_handle_non_semantic_instruction) { ++ /* NonSemantic extended instructions are acceptable in preamble. */ ++ vtn_handle_non_semantic_instruction(b, w[4], w, count); ++ return true; ++ } else if (val->ext_handler == vtn_handle_non_semantic_debug_info) { ++ vtn_handle_non_semantic_debug_info(b, w[4], w, count); ++ return true; ++ } else { ++ return false; /* End of preamble. */ ++ } ++ } ++ ++ default: ++ return false; /* End of preamble */ ++ } ++ ++ return true; ++} ++ ++void ++vtn_handle_debug_text(struct vtn_builder *b, SpvOp opcode, ++ const uint32_t *w, unsigned count) ++{ ++ switch (opcode) { ++ case SpvOpString: ++ vtn_push_value(b, w[1], vtn_value_type_string)->str = ++ vtn_string_literal(b, &w[2], count - 2, NULL); ++ break; ++ ++ case SpvOpSource: { ++ const char *lang; ++ switch (w[1]) { ++ default: ++ case SpvSourceLanguageUnknown: lang = "unknown"; break; ++ case SpvSourceLanguageESSL: lang = "ESSL"; break; ++ case SpvSourceLanguageGLSL: lang = "GLSL"; break; ++ case SpvSourceLanguageOpenCL_C: lang = "OpenCL C"; break; ++ case SpvSourceLanguageOpenCL_CPP: lang = "OpenCL C++"; break; ++ case SpvSourceLanguageHLSL: lang = "HLSL"; break; ++ } ++ ++ uint32_t version = w[2]; ++ ++ const char *file = ++ (count > 3) ? vtn_value(b, w[3], vtn_value_type_string)->str : ""; ++ ++ vtn_info("Parsing SPIR-V from %s %u source file %s", lang, version, file); ++ ++ b->source_lang = w[1]; ++ break; ++ } ++ ++ case SpvOpSourceExtension: ++ case SpvOpSourceContinued: ++ case SpvOpModuleProcessed: ++ /* Unhandled, but these are for debug so that's ok. */ ++ break; ++ ++ default: ++ UNREACHABLE("Unhandled opcode"); ++ } ++} ++ ++static void ++vtn_handle_execution_mode(struct vtn_builder *b, struct vtn_value *entry_point, ++ const struct vtn_decoration *mode, UNUSED void *data) ++{ ++ vtn_assert(b->entry_point == entry_point); ++ ++ switch(mode->exec_mode) { ++ case SpvExecutionModeOriginUpperLeft: ++ case SpvExecutionModeOriginLowerLeft: ++ vtn_assert(b->shader->info.stage == MESA_SHADER_FRAGMENT); ++ b->shader->info.fs.origin_upper_left = ++ (mode->exec_mode == SpvExecutionModeOriginUpperLeft); ++ break; ++ ++ case SpvExecutionModeEarlyFragmentTests: ++ vtn_assert(b->shader->info.stage == MESA_SHADER_FRAGMENT); ++ b->shader->info.fs.early_fragment_tests = true; ++ break; ++ ++ case SpvExecutionModePostDepthCoverage: ++ vtn_assert(b->shader->info.stage == MESA_SHADER_FRAGMENT); ++ b->shader->info.fs.post_depth_coverage = true; ++ break; ++ ++ case SpvExecutionModeInvocations: ++ vtn_assert(b->shader->info.stage == MESA_SHADER_GEOMETRY); ++ b->shader->info.gs.invocations = MAX2(1, mode->operands[0]); ++ break; ++ ++ case SpvExecutionModeDepthReplacing: ++ vtn_assert(b->shader->info.stage == MESA_SHADER_FRAGMENT); ++ if (b->shader->info.fs.depth_layout == FRAG_DEPTH_LAYOUT_NONE) ++ b->shader->info.fs.depth_layout = FRAG_DEPTH_LAYOUT_ANY; ++ break; ++ case SpvExecutionModeDepthGreater: ++ vtn_assert(b->shader->info.stage == MESA_SHADER_FRAGMENT); ++ b->shader->info.fs.depth_layout = FRAG_DEPTH_LAYOUT_GREATER; ++ break; ++ case SpvExecutionModeDepthLess: ++ vtn_assert(b->shader->info.stage == MESA_SHADER_FRAGMENT); ++ b->shader->info.fs.depth_layout = FRAG_DEPTH_LAYOUT_LESS; ++ break; ++ case SpvExecutionModeDepthUnchanged: ++ vtn_assert(b->shader->info.stage == MESA_SHADER_FRAGMENT); ++ b->shader->info.fs.depth_layout = FRAG_DEPTH_LAYOUT_UNCHANGED; ++ break; ++ ++ case SpvExecutionModeLocalSizeHint: ++ vtn_assert(b->shader->info.stage == MESA_SHADER_KERNEL); ++ b->shader->info.cs.workgroup_size_hint[0] = mode->operands[0]; ++ b->shader->info.cs.workgroup_size_hint[1] = mode->operands[1]; ++ b->shader->info.cs.workgroup_size_hint[2] = mode->operands[2]; ++ break; ++ ++ case SpvExecutionModeLocalSize: ++ if (mesa_shader_stage_uses_workgroup(b->shader->info.stage)) { ++ b->shader->info.workgroup_size[0] = mode->operands[0]; ++ b->shader->info.workgroup_size[1] = mode->operands[1]; ++ b->shader->info.workgroup_size[2] = mode->operands[2]; ++ } else { ++ vtn_fail("Execution mode LocalSize not supported in stage %s", ++ _mesa_shader_stage_to_string(b->shader->info.stage)); ++ } ++ break; ++ ++ case SpvExecutionModeOutputVertices: ++ switch (b->shader->info.stage) { ++ case MESA_SHADER_TESS_CTRL: ++ case MESA_SHADER_TESS_EVAL: ++ b->shader->info.tess.tcs_vertices_out = mode->operands[0]; ++ break; ++ case MESA_SHADER_GEOMETRY: ++ b->shader->info.gs.vertices_out = mode->operands[0]; ++ break; ++ case MESA_SHADER_MESH: ++ b->shader->info.mesh.max_vertices_out = mode->operands[0]; ++ break; ++ default: ++ vtn_fail("Execution mode OutputVertices not supported in stage %s", ++ _mesa_shader_stage_to_string(b->shader->info.stage)); ++ break; ++ } ++ break; ++ ++ case SpvExecutionModeInputPoints: ++ case SpvExecutionModeInputLines: ++ case SpvExecutionModeInputLinesAdjacency: ++ case SpvExecutionModeTriangles: ++ case SpvExecutionModeInputTrianglesAdjacency: ++ case SpvExecutionModeQuads: ++ case SpvExecutionModeIsolines: ++ if (b->shader->info.stage == MESA_SHADER_TESS_CTRL || ++ b->shader->info.stage == MESA_SHADER_TESS_EVAL) { ++ b->shader->info.tess._primitive_mode = ++ tess_primitive_mode_from_spv_execution_mode(b, mode->exec_mode); ++ } else { ++ vtn_assert(b->shader->info.stage == MESA_SHADER_GEOMETRY); ++ b->shader->info.gs.vertices_in = ++ vertices_in_from_spv_execution_mode(b, mode->exec_mode); ++ b->shader->info.gs.input_primitive = ++ primitive_from_spv_execution_mode(b, mode->exec_mode); ++ } ++ break; ++ ++ case SpvExecutionModeOutputPrimitivesNV: ++ vtn_assert(b->shader->info.stage == MESA_SHADER_MESH); ++ b->shader->info.mesh.max_primitives_out = mode->operands[0]; ++ break; ++ ++ case SpvExecutionModeOutputLinesNV: ++ case SpvExecutionModeOutputTrianglesNV: ++ vtn_assert(b->shader->info.stage == MESA_SHADER_MESH); ++ b->shader->info.mesh.primitive_type = ++ primitive_from_spv_execution_mode(b, mode->exec_mode); ++ break; ++ ++ case SpvExecutionModeOutputPoints: { ++ const unsigned primitive = ++ primitive_from_spv_execution_mode(b, mode->exec_mode); ++ ++ switch (b->shader->info.stage) { ++ case MESA_SHADER_GEOMETRY: ++ b->shader->info.gs.output_primitive = primitive; ++ break; ++ case MESA_SHADER_MESH: ++ b->shader->info.mesh.primitive_type = primitive; ++ break; ++ default: ++ vtn_fail("Execution mode OutputPoints not supported in stage %s", ++ _mesa_shader_stage_to_string(b->shader->info.stage)); ++ break; ++ } ++ break; ++ } ++ ++ case SpvExecutionModeOutputLineStrip: ++ case SpvExecutionModeOutputTriangleStrip: ++ vtn_assert(b->shader->info.stage == MESA_SHADER_GEOMETRY); ++ b->shader->info.gs.output_primitive = ++ primitive_from_spv_execution_mode(b, mode->exec_mode); ++ break; ++ ++ case SpvExecutionModeSpacingEqual: ++ vtn_assert(b->shader->info.stage == MESA_SHADER_TESS_CTRL || ++ b->shader->info.stage == MESA_SHADER_TESS_EVAL); ++ b->shader->info.tess.spacing = TESS_SPACING_EQUAL; ++ break; ++ case SpvExecutionModeSpacingFractionalEven: ++ vtn_assert(b->shader->info.stage == MESA_SHADER_TESS_CTRL || ++ b->shader->info.stage == MESA_SHADER_TESS_EVAL); ++ b->shader->info.tess.spacing = TESS_SPACING_FRACTIONAL_EVEN; ++ break; ++ case SpvExecutionModeSpacingFractionalOdd: ++ vtn_assert(b->shader->info.stage == MESA_SHADER_TESS_CTRL || ++ b->shader->info.stage == MESA_SHADER_TESS_EVAL); ++ b->shader->info.tess.spacing = TESS_SPACING_FRACTIONAL_ODD; ++ break; ++ case SpvExecutionModeVertexOrderCw: ++ vtn_assert(b->shader->info.stage == MESA_SHADER_TESS_CTRL || ++ b->shader->info.stage == MESA_SHADER_TESS_EVAL); ++ b->shader->info.tess.ccw = false; ++ break; ++ case SpvExecutionModeVertexOrderCcw: ++ vtn_assert(b->shader->info.stage == MESA_SHADER_TESS_CTRL || ++ b->shader->info.stage == MESA_SHADER_TESS_EVAL); ++ b->shader->info.tess.ccw = true; ++ break; ++ case SpvExecutionModePointMode: ++ vtn_assert(b->shader->info.stage == MESA_SHADER_TESS_CTRL || ++ b->shader->info.stage == MESA_SHADER_TESS_EVAL); ++ b->shader->info.tess.point_mode = true; ++ break; ++ ++ case SpvExecutionModePixelCenterInteger: ++ vtn_assert(b->shader->info.stage == MESA_SHADER_FRAGMENT); ++ b->shader->info.fs.pixel_center_integer = true; ++ break; ++ ++ case SpvExecutionModeXfb: ++ b->shader->info.has_transform_feedback_varyings = true; ++ break; ++ ++ case SpvExecutionModeVecTypeHint: ++ break; /* OpenCL */ ++ ++ case SpvExecutionModeContractionOff: ++ if (b->shader->info.stage != MESA_SHADER_KERNEL) ++ vtn_warn("ExectionMode only allowed for CL-style kernels: %s", ++ spirv_executionmode_to_string(mode->exec_mode)); ++ else ++ b->exact = true; ++ break; ++ ++ case SpvExecutionModeStencilRefReplacingEXT: ++ vtn_assert(b->shader->info.stage == MESA_SHADER_FRAGMENT); ++ break; ++ ++ case SpvExecutionModeDerivativeGroupQuadsKHR: ++ vtn_assert(mesa_shader_stage_uses_workgroup(b->shader->info.stage)); ++ b->shader->info.derivative_group = DERIVATIVE_GROUP_QUADS; ++ break; ++ ++ case SpvExecutionModeDerivativeGroupLinearKHR: ++ vtn_assert(mesa_shader_stage_uses_workgroup(b->shader->info.stage)); ++ b->shader->info.derivative_group = DERIVATIVE_GROUP_LINEAR; ++ break; ++ ++ case SpvExecutionModePixelInterlockOrderedEXT: ++ vtn_assert(b->shader->info.stage == MESA_SHADER_FRAGMENT); ++ b->shader->info.fs.pixel_interlock_ordered = true; ++ break; ++ ++ case SpvExecutionModePixelInterlockUnorderedEXT: ++ vtn_assert(b->shader->info.stage == MESA_SHADER_FRAGMENT); ++ b->shader->info.fs.pixel_interlock_unordered = true; ++ break; ++ ++ case SpvExecutionModeSampleInterlockOrderedEXT: ++ vtn_assert(b->shader->info.stage == MESA_SHADER_FRAGMENT); ++ b->shader->info.fs.sample_interlock_ordered = true; ++ break; ++ ++ case SpvExecutionModeSampleInterlockUnorderedEXT: ++ vtn_assert(b->shader->info.stage == MESA_SHADER_FRAGMENT); ++ b->shader->info.fs.sample_interlock_unordered = true; ++ break; ++ ++ case SpvExecutionModeDenormPreserve: ++ case SpvExecutionModeDenormFlushToZero: ++ case SpvExecutionModeSignedZeroInfNanPreserve: ++ case SpvExecutionModeRoundingModeRTE: ++ case SpvExecutionModeRoundingModeRTZ: { ++ unsigned execution_mode = 0; ++ switch (mode->exec_mode) { ++ case SpvExecutionModeDenormPreserve: ++ switch (mode->operands[0]) { ++ case 16: execution_mode = FLOAT_CONTROLS_DENORM_PRESERVE_FP16; break; ++ case 32: execution_mode = FLOAT_CONTROLS_DENORM_PRESERVE_FP32; break; ++ case 64: execution_mode = FLOAT_CONTROLS_DENORM_PRESERVE_FP64; break; ++ default: vtn_fail("Floating point type not supported"); ++ } ++ break; ++ case SpvExecutionModeDenormFlushToZero: ++ switch (mode->operands[0]) { ++ case 16: execution_mode = FLOAT_CONTROLS_DENORM_FLUSH_TO_ZERO_FP16; break; ++ case 32: execution_mode = FLOAT_CONTROLS_DENORM_FLUSH_TO_ZERO_FP32; break; ++ case 64: execution_mode = FLOAT_CONTROLS_DENORM_FLUSH_TO_ZERO_FP64; break; ++ default: vtn_fail("Floating point type not supported"); ++ } ++ break; ++ case SpvExecutionModeSignedZeroInfNanPreserve: ++ switch (mode->operands[0]) { ++ case 16: execution_mode = FLOAT_CONTROLS_SIGNED_ZERO_INF_NAN_PRESERVE_FP16; break; ++ case 32: execution_mode = FLOAT_CONTROLS_SIGNED_ZERO_INF_NAN_PRESERVE_FP32; break; ++ case 64: execution_mode = FLOAT_CONTROLS_SIGNED_ZERO_INF_NAN_PRESERVE_FP64; break; ++ default: vtn_fail("Floating point type not supported"); ++ } ++ break; ++ case SpvExecutionModeRoundingModeRTE: ++ switch (mode->operands[0]) { ++ case 16: execution_mode = FLOAT_CONTROLS_ROUNDING_MODE_RTE_FP16; break; ++ case 32: execution_mode = FLOAT_CONTROLS_ROUNDING_MODE_RTE_FP32; break; ++ case 64: execution_mode = FLOAT_CONTROLS_ROUNDING_MODE_RTE_FP64; break; ++ default: vtn_fail("Floating point type not supported"); ++ } ++ break; ++ case SpvExecutionModeRoundingModeRTZ: ++ switch (mode->operands[0]) { ++ case 16: execution_mode = FLOAT_CONTROLS_ROUNDING_MODE_RTZ_FP16; break; ++ case 32: execution_mode = FLOAT_CONTROLS_ROUNDING_MODE_RTZ_FP32; break; ++ case 64: execution_mode = FLOAT_CONTROLS_ROUNDING_MODE_RTZ_FP64; break; ++ default: vtn_fail("Floating point type not supported"); ++ } ++ break; ++ default: ++ break; ++ } ++ ++ b->shader->info.float_controls_execution_mode |= execution_mode; ++ ++ for (unsigned bit_size = 16; bit_size <= 64; bit_size *= 2) { ++ vtn_fail_if(nir_is_denorm_flush_to_zero(b->shader->info.float_controls_execution_mode, bit_size) && ++ nir_is_denorm_preserve(b->shader->info.float_controls_execution_mode, bit_size), ++ "Cannot flush to zero and preserve denorms for the same bit size."); ++ vtn_fail_if(nir_is_rounding_mode_rtne(b->shader->info.float_controls_execution_mode, bit_size) && ++ nir_is_rounding_mode_rtz(b->shader->info.float_controls_execution_mode, bit_size), ++ "Cannot set rounding mode to RTNE and RTZ for the same bit size."); ++ } ++ break; ++ } ++ ++ case SpvExecutionModeMaximallyReconvergesKHR: ++ b->shader->info.maximally_reconverges = true; ++ break; ++ ++ case SpvExecutionModeLocalSizeId: ++ case SpvExecutionModeLocalSizeHintId: ++ case SpvExecutionModeSubgroupsPerWorkgroupId: ++ case SpvExecutionModeFPFastMathDefault: ++ case SpvExecutionModeMaxNodeRecursionAMDX: ++ case SpvExecutionModeStaticNumWorkgroupsAMDX: ++ case SpvExecutionModeMaxNumWorkgroupsAMDX: ++ case SpvExecutionModeShaderIndexAMDX: ++ /* Handled later by vtn_handle_execution_mode_id(). */ ++ break; ++ ++ case SpvExecutionModeSubgroupSize: ++ vtn_assert(b->shader->info.stage == MESA_SHADER_KERNEL); ++ vtn_assert(!b->shader->info.api_subgroup_size); ++ b->shader->info.api_subgroup_size = mode->operands[0]; ++ b->shader->info.max_subgroup_size = mode->operands[0]; ++ b->shader->info.min_subgroup_size = mode->operands[0]; ++ break; ++ ++ case SpvExecutionModeSubgroupsPerWorkgroup: ++ vtn_assert(b->shader->info.stage == MESA_SHADER_KERNEL); ++ b->shader->info.num_subgroups = mode->operands[0]; ++ break; ++ ++ case SpvExecutionModeSubgroupUniformControlFlowKHR: ++ /* Nothing to do here */ ++ break; ++ ++ case SpvExecutionModeEarlyAndLateFragmentTestsAMD: ++ vtn_assert(b->shader->info.stage == MESA_SHADER_FRAGMENT); ++ b->shader->info.fs.early_and_late_fragment_tests = true; ++ break; ++ ++ case SpvExecutionModeStencilRefGreaterFrontAMD: ++ vtn_assert(b->shader->info.stage == MESA_SHADER_FRAGMENT); ++ b->shader->info.fs.stencil_front_layout = FRAG_STENCIL_LAYOUT_GREATER; ++ break; ++ ++ case SpvExecutionModeStencilRefLessFrontAMD: ++ vtn_assert(b->shader->info.stage == MESA_SHADER_FRAGMENT); ++ b->shader->info.fs.stencil_front_layout = FRAG_STENCIL_LAYOUT_LESS; ++ break; ++ ++ case SpvExecutionModeStencilRefUnchangedFrontAMD: ++ vtn_assert(b->shader->info.stage == MESA_SHADER_FRAGMENT); ++ b->shader->info.fs.stencil_front_layout = FRAG_STENCIL_LAYOUT_UNCHANGED; ++ break; ++ ++ case SpvExecutionModeStencilRefGreaterBackAMD: ++ vtn_assert(b->shader->info.stage == MESA_SHADER_FRAGMENT); ++ b->shader->info.fs.stencil_back_layout = FRAG_STENCIL_LAYOUT_GREATER; ++ break; ++ ++ case SpvExecutionModeStencilRefLessBackAMD: ++ vtn_assert(b->shader->info.stage == MESA_SHADER_FRAGMENT); ++ b->shader->info.fs.stencil_back_layout = FRAG_STENCIL_LAYOUT_LESS; ++ break; ++ ++ case SpvExecutionModeStencilRefUnchangedBackAMD: ++ vtn_assert(b->shader->info.stage == MESA_SHADER_FRAGMENT); ++ b->shader->info.fs.stencil_back_layout = FRAG_STENCIL_LAYOUT_UNCHANGED; ++ break; ++ ++ case SpvExecutionModeRequireFullQuadsKHR: ++ vtn_assert(b->shader->info.stage == MESA_SHADER_FRAGMENT); ++ b->shader->info.fs.require_full_quads = true; ++ break; ++ ++ case SpvExecutionModeQuadDerivativesKHR: ++ vtn_assert(b->shader->info.stage == MESA_SHADER_FRAGMENT); ++ b->shader->info.fs.quad_derivatives = true; ++ break; ++ ++ case SpvExecutionModeCoalescingAMDX: ++ vtn_assert(b->shader->info.stage == MESA_SHADER_COMPUTE); ++ b->shader->info.cs.workgroup_count[0] = 1; ++ b->shader->info.cs.workgroup_count[1] = 1; ++ b->shader->info.cs.workgroup_count[2] = 1; ++ break; ++ ++ default: ++ vtn_fail("Unhandled execution mode: %s (%u)", ++ spirv_executionmode_to_string(mode->exec_mode), ++ mode->exec_mode); ++ } ++} ++ ++static void ++vtn_handle_execution_mode_id(struct vtn_builder *b, struct vtn_value *entry_point, ++ const struct vtn_decoration *mode, UNUSED void *data) ++{ ++ ++ vtn_assert(b->entry_point == entry_point); ++ ++ switch (mode->exec_mode) { ++ case SpvExecutionModeLocalSizeId: ++ if (mesa_shader_stage_uses_workgroup(b->shader->info.stage)) { ++ b->shader->info.workgroup_size[0] = vtn_constant_uint(b, mode->operands[0]); ++ b->shader->info.workgroup_size[1] = vtn_constant_uint(b, mode->operands[1]); ++ b->shader->info.workgroup_size[2] = vtn_constant_uint(b, mode->operands[2]); ++ } else { ++ vtn_fail("Execution mode LocalSizeId not supported in stage %s", ++ _mesa_shader_stage_to_string(b->shader->info.stage)); ++ } ++ break; ++ ++ case SpvExecutionModeLocalSizeHintId: ++ vtn_assert(b->shader->info.stage == MESA_SHADER_KERNEL); ++ b->shader->info.cs.workgroup_size_hint[0] = vtn_constant_uint(b, mode->operands[0]); ++ b->shader->info.cs.workgroup_size_hint[1] = vtn_constant_uint(b, mode->operands[1]); ++ b->shader->info.cs.workgroup_size_hint[2] = vtn_constant_uint(b, mode->operands[2]); ++ break; ++ ++ case SpvExecutionModeSubgroupsPerWorkgroupId: ++ vtn_assert(b->shader->info.stage == MESA_SHADER_KERNEL); ++ b->shader->info.num_subgroups = vtn_constant_uint(b, mode->operands[0]); ++ break; ++ ++ case SpvExecutionModeFPFastMathDefault: { ++ struct vtn_type *type = vtn_get_type(b, mode->operands[0]); ++ SpvFPFastMathModeMask flags = vtn_constant_uint(b, mode->operands[1]); ++ ++ SpvFPFastMathModeMask can_fast_math = ++ SpvFPFastMathModeAllowRecipMask | ++ SpvFPFastMathModeAllowContractMask | ++ SpvFPFastMathModeAllowReassocMask | ++ SpvFPFastMathModeAllowTransformMask; ++ if ((flags & can_fast_math) != can_fast_math) ++ b->exact = true; ++ ++ unsigned execution_mode = 0; ++ if (!(flags & SpvFPFastMathModeNotNaNMask)) { ++ switch (glsl_get_bit_size(type->type)) { ++ case 16: execution_mode |= FLOAT_CONTROLS_NAN_PRESERVE_FP16; break; ++ case 32: execution_mode |= FLOAT_CONTROLS_NAN_PRESERVE_FP32; break; ++ case 64: execution_mode |= FLOAT_CONTROLS_NAN_PRESERVE_FP64; break; ++ } ++ } ++ if (!(flags & SpvFPFastMathModeNotInfMask)) { ++ switch (glsl_get_bit_size(type->type)) { ++ case 16: execution_mode |= FLOAT_CONTROLS_INF_PRESERVE_FP16; break; ++ case 32: execution_mode |= FLOAT_CONTROLS_INF_PRESERVE_FP32; break; ++ case 64: execution_mode |= FLOAT_CONTROLS_INF_PRESERVE_FP64; break; ++ } ++ } ++ if (!(flags & SpvFPFastMathModeNSZMask)) { ++ switch (glsl_get_bit_size(type->type)) { ++ case 16: execution_mode |= FLOAT_CONTROLS_SIGNED_ZERO_PRESERVE_FP16; break; ++ case 32: execution_mode |= FLOAT_CONTROLS_SIGNED_ZERO_PRESERVE_FP32; break; ++ case 64: execution_mode |= FLOAT_CONTROLS_SIGNED_ZERO_PRESERVE_FP64; break; ++ } ++ } ++ b->shader->info.float_controls_execution_mode |= execution_mode; ++ break; ++ } ++ ++ case SpvExecutionModeMaxNodeRecursionAMDX: ++ vtn_assert(b->shader->info.stage == MESA_SHADER_COMPUTE); ++ break; ++ ++ case SpvExecutionModeStaticNumWorkgroupsAMDX: ++ vtn_assert(b->shader->info.stage == MESA_SHADER_COMPUTE); ++ b->shader->info.cs.workgroup_count[0] = vtn_constant_uint(b, mode->operands[0]); ++ b->shader->info.cs.workgroup_count[1] = vtn_constant_uint(b, mode->operands[1]); ++ b->shader->info.cs.workgroup_count[2] = vtn_constant_uint(b, mode->operands[2]); ++ assert(b->shader->info.cs.workgroup_count[0]); ++ assert(b->shader->info.cs.workgroup_count[1]); ++ assert(b->shader->info.cs.workgroup_count[2]); ++ break; ++ ++ case SpvExecutionModeMaxNumWorkgroupsAMDX: ++ vtn_assert(b->shader->info.stage == MESA_SHADER_COMPUTE); ++ break; ++ ++ case SpvExecutionModeShaderIndexAMDX: ++ vtn_assert(b->shader->info.stage == MESA_SHADER_COMPUTE); ++ b->shader->info.cs.shader_index = vtn_constant_uint(b, mode->operands[0]); ++ break; ++ ++ default: ++ /* Nothing to do. Literal execution modes already handled by ++ * vtn_handle_execution_mode(). */ ++ break; ++ } ++} ++ ++static bool ++vtn_handle_variable_or_type_instruction(struct vtn_builder *b, SpvOp opcode, ++ const uint32_t *w, unsigned count) ++{ ++ vtn_set_instruction_result_type(b, opcode, w, count); ++ ++ switch (opcode) { ++ case SpvOpSource: ++ case SpvOpSourceContinued: ++ case SpvOpSourceExtension: ++ case SpvOpExtension: ++ case SpvOpCapability: ++ case SpvOpExtInstImport: ++ case SpvOpMemoryModel: ++ case SpvOpEntryPoint: ++ case SpvOpExecutionMode: ++ case SpvOpString: ++ case SpvOpName: ++ case SpvOpMemberName: ++ case SpvOpDecorationGroup: ++ case SpvOpDecorate: ++ case SpvOpDecorateId: ++ case SpvOpMemberDecorate: ++ case SpvOpGroupDecorate: ++ case SpvOpGroupMemberDecorate: ++ case SpvOpDecorateString: ++ case SpvOpMemberDecorateString: ++ vtn_fail("Invalid opcode types and variables section"); ++ break; ++ ++ case SpvOpTypeVoid: ++ case SpvOpTypeBool: ++ case SpvOpTypeInt: ++ case SpvOpTypeFloat: ++ case SpvOpTypeVector: ++ case SpvOpTypeMatrix: ++ case SpvOpTypeImage: ++ case SpvOpTypeSampler: ++ case SpvOpTypeSampledImage: ++ case SpvOpTypeArray: ++ case SpvOpTypeRuntimeArray: ++ case SpvOpTypeStruct: ++ case SpvOpTypeOpaque: ++ case SpvOpTypePointer: ++ case SpvOpTypeForwardPointer: ++ case SpvOpTypeFunction: ++ case SpvOpTypeEvent: ++ case SpvOpTypeDeviceEvent: ++ case SpvOpTypeReserveId: ++ case SpvOpTypeQueue: ++ case SpvOpTypePipe: ++ case SpvOpTypeAccelerationStructureKHR: ++ case SpvOpTypeRayQueryKHR: ++ case SpvOpTypeCooperativeMatrixKHR: ++ case SpvOpTypeUntypedPointerKHR: ++ vtn_handle_type(b, opcode, w, count); ++ break; ++ ++ case SpvOpConstantTrue: ++ case SpvOpConstantFalse: ++ case SpvOpConstant: ++ case SpvOpConstantComposite: ++ case SpvOpConstantCompositeReplicateEXT: ++ case SpvOpConstantNull: ++ case SpvOpSpecConstantTrue: ++ case SpvOpSpecConstantFalse: ++ case SpvOpSpecConstant: ++ case SpvOpSpecConstantComposite: ++ case SpvOpSpecConstantCompositeReplicateEXT: ++ case SpvOpSpecConstantOp: ++ vtn_handle_constant(b, opcode, w, count); ++ break; ++ ++ case SpvOpUndef: ++ case SpvOpVariable: ++ case SpvOpConstantSampler: ++ case SpvOpUntypedVariableKHR: ++ vtn_handle_variables(b, opcode, w, count); ++ break; ++ ++ case SpvOpExtInst: ++ case SpvOpExtInstWithForwardRefsKHR: { ++ struct vtn_value *val = vtn_value(b, w[3], vtn_value_type_extension); ++ ++ if (val->ext_handler == vtn_handle_non_semantic_debug_info) ++ return vtn_handle_non_semantic_debug_info(b, opcode, w, count); ++ ++ /* NonSemantic extended instructions are acceptable in preamble, others ++ * will indicate the end of preamble. ++ */ ++ return val->ext_handler == vtn_handle_non_semantic_instruction; ++ } ++ ++ default: ++ return false; /* End of preamble */ ++ } ++ ++ return true; ++} ++ ++static struct vtn_ssa_value * ++vtn_nir_select(struct vtn_builder *b, struct vtn_ssa_value *src0, ++ struct vtn_ssa_value *src1, struct vtn_ssa_value *src2) ++{ ++ struct vtn_ssa_value *dest = vtn_zalloc(b, struct vtn_ssa_value); ++ dest->type = src1->type; ++ ++ if (src1->is_variable || src2->is_variable) { ++ vtn_assert(src1->is_variable && src2->is_variable); ++ ++ nir_variable *dest_var = ++ nir_local_variable_create(b->nb.impl, dest->type, "var_select"); ++ nir_deref_instr *dest_deref = nir_build_deref_var(&b->nb, dest_var); ++ ++ nir_push_if(&b->nb, src0->def); ++ { ++ nir_deref_instr *src1_deref = vtn_get_deref_for_ssa_value(b, src1); ++ vtn_local_store(b, vtn_local_load(b, src1_deref, 0), dest_deref, 0); ++ } ++ nir_push_else(&b->nb, NULL); ++ { ++ nir_deref_instr *src2_deref = vtn_get_deref_for_ssa_value(b, src2); ++ vtn_local_store(b, vtn_local_load(b, src2_deref, 0), dest_deref, 0); ++ } ++ nir_pop_if(&b->nb, NULL); ++ ++ vtn_set_ssa_value_var(b, dest, dest_var); ++ } else if (glsl_type_is_vector_or_scalar(src1->type)) { ++ dest->def = nir_bcsel(&b->nb, src0->def, src1->def, src2->def); ++ } else { ++ unsigned elems = glsl_get_length(src1->type); ++ ++ dest->elems = vtn_alloc_array(b, struct vtn_ssa_value *, elems); ++ for (unsigned i = 0; i < elems; i++) { ++ dest->elems[i] = vtn_nir_select(b, src0, ++ src1->elems[i], src2->elems[i]); ++ } ++ } ++ ++ return dest; ++} ++ ++static void ++vtn_handle_select(struct vtn_builder *b, SpvOp opcode, ++ const uint32_t *w, unsigned count) ++{ ++ /* Handle OpSelect up-front here because it needs to be able to handle ++ * pointers and not just regular vectors and scalars. ++ */ ++ struct vtn_value *res_val = vtn_untyped_value(b, w[2]); ++ struct vtn_value *cond_val = vtn_untyped_value(b, w[3]); ++ struct vtn_value *obj1_val = vtn_untyped_value(b, w[4]); ++ struct vtn_value *obj2_val = vtn_untyped_value(b, w[5]); ++ ++ vtn_fail_if(obj1_val->type != res_val->type || ++ obj2_val->type != res_val->type, ++ "Object types must match the result type in OpSelect (%%%u = %%%u ? %%%u : %%%u)", w[2], w[3], w[4], w[5]); ++ ++ vtn_fail_if((cond_val->type->base_type != vtn_base_type_scalar && ++ cond_val->type->base_type != vtn_base_type_vector) || ++ !glsl_type_is_boolean(cond_val->type->type), ++ "OpSelect must have either a vector of booleans or " ++ "a boolean as Condition type"); ++ ++ vtn_fail_if(cond_val->type->base_type == vtn_base_type_vector && ++ (res_val->type->base_type != vtn_base_type_vector || ++ res_val->type->length != cond_val->type->length), ++ "When Condition type in OpSelect is a vector, the Result " ++ "type must be a vector of the same length"); ++ ++ switch (res_val->type->base_type) { ++ case vtn_base_type_scalar: ++ case vtn_base_type_vector: ++ case vtn_base_type_matrix: ++ case vtn_base_type_array: ++ case vtn_base_type_struct: ++ /* OK. */ ++ break; ++ case vtn_base_type_pointer: ++ /* We need to have actual storage for pointer types. */ ++ vtn_fail_if(res_val->type->type == NULL, ++ "Invalid pointer result type for OpSelect"); ++ break; ++ default: ++ vtn_fail("Result type of OpSelect must be a scalar, composite, or pointer"); ++ } ++ ++ vtn_push_ssa_value(b, w[2], ++ vtn_nir_select(b, vtn_ssa_value(b, w[3]), ++ vtn_ssa_value(b, w[4]), ++ vtn_ssa_value(b, w[5]))); ++} ++ ++static void ++vtn_handle_ptr(struct vtn_builder *b, SpvOp opcode, ++ const uint32_t *w, unsigned count) ++{ ++ struct vtn_type *type1 = vtn_get_value_type(b, w[3]); ++ struct vtn_type *type2 = vtn_get_value_type(b, w[4]); ++ vtn_fail_if(type1->base_type != vtn_base_type_pointer || ++ type2->base_type != vtn_base_type_pointer, ++ "%s operands must have pointer types", ++ spirv_op_to_string(opcode)); ++ vtn_fail_if(type1->storage_class != type2->storage_class, ++ "%s operands must have the same storage class", ++ spirv_op_to_string(opcode)); ++ ++ struct vtn_type *vtn_type = vtn_get_type(b, w[1]); ++ const struct glsl_type *type = vtn_type->type; ++ ++ nir_address_format addr_format = vtn_mode_to_address_format( ++ b, vtn_storage_class_to_mode(b, type1->storage_class, NULL, NULL)); ++ ++ nir_def *def; ++ ++ switch (opcode) { ++ case SpvOpPtrDiff: { ++ /* OpPtrDiff returns the difference in number of elements (not byte offset). ++ * ++ * SPV_KHR_untyped_pointers extension adds ++ * ++ * "The types of Operand 1 and Operand 2 must be the same ++ * OpTypePointer or OpTypeUntypedPointerKHR." ++ */ ++ unsigned elem_size, elem_align; ++ if (type1->pointed != NULL) { ++ vtn_assert(type2->pointed != NULL); ++ glsl_get_natural_size_align_bytes(type1->pointed->type, ++ &elem_size, &elem_align); ++ } else { ++ vtn_assert(type2->pointed == NULL); ++ /* If 'Operand 1' and 'Operand 2' are OpTypeUntypedPointerKHR, ++ * the array is interpreted as an array of 8-bit integers. ++ */ ++ elem_size = 1; ++ elem_align = 1; ++ } ++ ++ def = nir_build_addr_isub(&b->nb, ++ vtn_get_nir_ssa(b, w[3]), ++ vtn_get_nir_ssa(b, w[4]), ++ addr_format); ++ def = nir_idiv(&b->nb, def, nir_imm_intN_t(&b->nb, elem_size, def->bit_size)); ++ def = nir_i2iN(&b->nb, def, glsl_get_bit_size(type)); ++ break; ++ } ++ ++ case SpvOpPtrEqual: ++ case SpvOpPtrNotEqual: { ++ def = nir_build_addr_ieq(&b->nb, ++ vtn_get_nir_ssa(b, w[3]), ++ vtn_get_nir_ssa(b, w[4]), ++ addr_format); ++ if (opcode == SpvOpPtrNotEqual) ++ def = nir_inot(&b->nb, def); ++ break; ++ } ++ ++ default: ++ UNREACHABLE("Invalid ptr operation"); ++ } ++ ++ vtn_push_nir_ssa(b, w[2], def); ++} ++ ++static void ++vtn_handle_ray_intrinsic(struct vtn_builder *b, SpvOp opcode, ++ const uint32_t *w, unsigned count) ++{ ++ nir_intrinsic_instr *intrin; ++ ++ switch (opcode) { ++ case SpvOpTraceNV: ++ case SpvOpTraceRayKHR: { ++ intrin = nir_intrinsic_instr_create(b->nb.shader, ++ nir_intrinsic_trace_ray); ++ ++ /* The sources are in the same order in the NIR intrinsic */ ++ for (unsigned i = 0; i < 10; i++) ++ intrin->src[i] = nir_src_for_ssa(vtn_ssa_value(b, w[i + 1])->def); ++ ++ nir_deref_instr *payload; ++ if (opcode == SpvOpTraceNV) ++ payload = vtn_get_call_payload_for_location(b, w[11]); ++ else ++ payload = vtn_nir_deref(b, w[11]); ++ intrin->src[10] = nir_src_for_ssa(&payload->def); ++ nir_builder_instr_insert(&b->nb, &intrin->instr); ++ break; ++ } ++ ++ case SpvOpReportIntersectionKHR: { ++ intrin = nir_intrinsic_instr_create(b->nb.shader, ++ nir_intrinsic_report_ray_intersection); ++ intrin->src[0] = nir_src_for_ssa(vtn_ssa_value(b, w[3])->def); ++ intrin->src[1] = nir_src_for_ssa(vtn_ssa_value(b, w[4])->def); ++ nir_def_init(&intrin->instr, &intrin->def, 1, 1); ++ nir_builder_instr_insert(&b->nb, &intrin->instr); ++ vtn_push_nir_ssa(b, w[2], &intrin->def); ++ break; ++ } ++ ++ case SpvOpIgnoreIntersectionNV: ++ intrin = nir_intrinsic_instr_create(b->nb.shader, ++ nir_intrinsic_ignore_ray_intersection); ++ nir_builder_instr_insert(&b->nb, &intrin->instr); ++ break; ++ ++ case SpvOpTerminateRayNV: ++ intrin = nir_intrinsic_instr_create(b->nb.shader, ++ nir_intrinsic_terminate_ray); ++ nir_builder_instr_insert(&b->nb, &intrin->instr); ++ break; ++ ++ case SpvOpExecuteCallableNV: ++ case SpvOpExecuteCallableKHR: { ++ intrin = nir_intrinsic_instr_create(b->nb.shader, ++ nir_intrinsic_execute_callable); ++ intrin->src[0] = nir_src_for_ssa(vtn_ssa_value(b, w[1])->def); ++ nir_deref_instr *payload; ++ if (opcode == SpvOpExecuteCallableNV) ++ payload = vtn_get_call_payload_for_location(b, w[2]); ++ else ++ payload = vtn_nir_deref(b, w[2]); ++ intrin->src[1] = nir_src_for_ssa(&payload->def); ++ nir_builder_instr_insert(&b->nb, &intrin->instr); ++ break; ++ } ++ ++ default: ++ vtn_fail_with_opcode("Unhandled opcode", opcode); ++ } ++} ++ ++static void ++vtn_handle_write_packed_primitive_indices(struct vtn_builder *b, SpvOp opcode, ++ const uint32_t *w, unsigned count) ++{ ++ vtn_assert(opcode == SpvOpWritePackedPrimitiveIndices4x8NV); ++ ++ /* TODO(mesh): Use or create a primitive that allow the unpacking to ++ * happen in the backend. What we have here is functional but too ++ * blunt. ++ */ ++ ++ struct vtn_type *offset_type = vtn_get_value_type(b, w[1]); ++ vtn_fail_if(offset_type->base_type != vtn_base_type_scalar || ++ offset_type->type != glsl_uint_type(), ++ "Index Offset type of OpWritePackedPrimitiveIndices4x8NV " ++ "must be an OpTypeInt with 32-bit Width and 0 Signedness."); ++ ++ struct vtn_type *packed_type = vtn_get_value_type(b, w[2]); ++ vtn_fail_if(packed_type->base_type != vtn_base_type_scalar || ++ packed_type->type != glsl_uint_type(), ++ "Packed Indices type of OpWritePackedPrimitiveIndices4x8NV " ++ "must be an OpTypeInt with 32-bit Width and 0 Signedness."); ++ ++ nir_deref_instr *indices = NULL; ++ nir_foreach_variable_with_modes(var, b->nb.shader, nir_var_shader_out) { ++ if (var->data.location == VARYING_SLOT_PRIMITIVE_INDICES) { ++ indices = nir_build_deref_var(&b->nb, var); ++ break; ++ } ++ } ++ ++ /* It may be the case that the variable is not present in the ++ * entry point interface list. ++ * ++ * See https://github.com/KhronosGroup/SPIRV-Registry/issues/104. ++ */ ++ ++ if (!indices) { ++ unsigned vertices_per_prim = ++ mesa_vertices_per_prim(b->shader->info.mesh.primitive_type); ++ unsigned max_prim_indices = ++ vertices_per_prim * b->shader->info.mesh.max_primitives_out; ++ const struct glsl_type *t = ++ glsl_array_type(glsl_uint_type(), max_prim_indices, 0); ++ nir_variable *var = ++ nir_variable_create(b->shader, nir_var_shader_out, t, ++ "gl_PrimitiveIndicesNV"); ++ ++ var->data.location = VARYING_SLOT_PRIMITIVE_INDICES; ++ var->data.interpolation = INTERP_MODE_NONE; ++ indices = nir_build_deref_var(&b->nb, var); ++ } ++ ++ nir_def *offset = vtn_get_nir_ssa(b, w[1]); ++ nir_def *packed = vtn_get_nir_ssa(b, w[2]); ++ nir_def *unpacked = nir_unpack_bits(&b->nb, packed, 8); ++ for (int i = 0; i < 4; i++) { ++ nir_deref_instr *offset_deref = ++ nir_build_deref_array(&b->nb, indices, ++ nir_iadd_imm(&b->nb, offset, i)); ++ nir_def *val = nir_u2u32(&b->nb, nir_channel(&b->nb, unpacked, i)); ++ ++ nir_store_deref(&b->nb, offset_deref, val, 0x1); ++ } ++} ++ ++struct ray_query_value { ++ nir_ray_query_value nir_value; ++ const struct glsl_type *glsl_type; ++}; ++ ++static struct ray_query_value ++spirv_to_nir_type_ray_query_intrinsic(struct vtn_builder *b, ++ SpvOp opcode) ++{ ++ switch (opcode) { ++#define CASE(_spv, _nir, _type) case SpvOpRayQueryGet##_spv: \ ++ return (struct ray_query_value) { .nir_value = nir_ray_query_value_##_nir, .glsl_type = _type } ++ CASE(RayTMinKHR, tmin, glsl_floatN_t_type(32)); ++ CASE(RayFlagsKHR, flags, glsl_uint_type()); ++ CASE(WorldRayDirectionKHR, world_ray_direction, glsl_vec_type(3)); ++ CASE(WorldRayOriginKHR, world_ray_origin, glsl_vec_type(3)); ++ CASE(IntersectionTypeKHR, intersection_type, glsl_uint_type()); ++ CASE(IntersectionTKHR, intersection_t, glsl_floatN_t_type(32)); ++ CASE(IntersectionInstanceCustomIndexKHR, intersection_instance_custom_index, glsl_int_type()); ++ CASE(IntersectionInstanceIdKHR, intersection_instance_id, glsl_int_type()); ++ CASE(IntersectionInstanceShaderBindingTableRecordOffsetKHR, intersection_instance_sbt_index, glsl_uint_type()); ++ CASE(IntersectionGeometryIndexKHR, intersection_geometry_index, glsl_int_type()); ++ CASE(IntersectionPrimitiveIndexKHR, intersection_primitive_index, glsl_int_type()); ++ CASE(IntersectionBarycentricsKHR, intersection_barycentrics, glsl_vec_type(2)); ++ CASE(IntersectionFrontFaceKHR, intersection_front_face, glsl_bool_type()); ++ CASE(IntersectionCandidateAABBOpaqueKHR, intersection_candidate_aabb_opaque, glsl_bool_type()); ++ CASE(IntersectionObjectToWorldKHR, intersection_object_to_world, glsl_matrix_type(glsl_get_base_type(glsl_float_type()), 3, 4)); ++ CASE(IntersectionWorldToObjectKHR, intersection_world_to_object, glsl_matrix_type(glsl_get_base_type(glsl_float_type()), 3, 4)); ++ CASE(IntersectionObjectRayOriginKHR, intersection_object_ray_origin, glsl_vec_type(3)); ++ CASE(IntersectionObjectRayDirectionKHR, intersection_object_ray_direction, glsl_vec_type(3)); ++ CASE(IntersectionTriangleVertexPositionsKHR, intersection_triangle_vertex_positions, glsl_array_type(glsl_vec_type(3), 3, ++ glsl_get_explicit_stride(glsl_vec_type(3)))); ++#undef CASE ++ default: ++ vtn_fail_with_opcode("Unhandled opcode", opcode); ++ } ++} ++ ++static void ++ray_query_load_intrinsic_create(struct vtn_builder *b, SpvOp opcode, ++ const uint32_t *w, nir_def *src0, ++ bool committed) ++{ ++ struct ray_query_value value = ++ spirv_to_nir_type_ray_query_intrinsic(b, opcode); ++ ++ if (glsl_type_is_array_or_matrix(value.glsl_type)) { ++ const struct glsl_type *elem_type = glsl_get_array_element(value.glsl_type); ++ const unsigned elems = glsl_get_length(value.glsl_type); ++ ++ struct vtn_ssa_value *ssa = vtn_create_ssa_value(b, value.glsl_type); ++ for (unsigned i = 0; i < elems; i++) { ++ ssa->elems[i]->def = ++ nir_rq_load(&b->nb, ++ glsl_get_vector_elements(elem_type), ++ glsl_get_bit_size(elem_type), ++ src0, ++ .ray_query_value = value.nir_value, ++ .committed = committed, ++ .column = i); ++ } ++ ++ vtn_push_ssa_value(b, w[2], ssa); ++ } else { ++ assert(glsl_type_is_vector_or_scalar(value.glsl_type)); ++ ++ vtn_push_nir_ssa(b, w[2], ++ nir_rq_load(&b->nb, ++ glsl_get_vector_elements(value.glsl_type), ++ glsl_get_bit_size(value.glsl_type), ++ src0, ++ .ray_query_value = value.nir_value, ++ .committed = committed)); ++ } ++} ++ ++static void ++vtn_handle_ray_query_intrinsic(struct vtn_builder *b, SpvOp opcode, ++ const uint32_t *w, unsigned count) ++{ ++ switch (opcode) { ++ case SpvOpRayQueryInitializeKHR: { ++ nir_intrinsic_instr *intrin = ++ nir_intrinsic_instr_create(b->nb.shader, ++ nir_intrinsic_rq_initialize); ++ /* The sources are in the same order in the NIR intrinsic */ ++ for (unsigned i = 0; i < 8; i++) ++ intrin->src[i] = nir_src_for_ssa(vtn_ssa_value(b, w[i + 1])->def); ++ nir_builder_instr_insert(&b->nb, &intrin->instr); ++ break; ++ } ++ ++ case SpvOpRayQueryTerminateKHR: ++ nir_rq_terminate(&b->nb, vtn_ssa_value(b, w[1])->def); ++ break; ++ ++ case SpvOpRayQueryProceedKHR: ++ vtn_push_nir_ssa(b, w[2], ++ nir_rq_proceed(&b->nb, 1, vtn_ssa_value(b, w[3])->def)); ++ break; ++ ++ case SpvOpRayQueryGenerateIntersectionKHR: ++ nir_rq_generate_intersection(&b->nb, ++ vtn_ssa_value(b, w[1])->def, ++ vtn_ssa_value(b, w[2])->def); ++ break; ++ ++ case SpvOpRayQueryConfirmIntersectionKHR: ++ nir_rq_confirm_intersection(&b->nb, vtn_ssa_value(b, w[1])->def); ++ break; ++ ++ case SpvOpRayQueryGetIntersectionTKHR: ++ case SpvOpRayQueryGetIntersectionTypeKHR: ++ case SpvOpRayQueryGetIntersectionInstanceCustomIndexKHR: ++ case SpvOpRayQueryGetIntersectionInstanceIdKHR: ++ case SpvOpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR: ++ case SpvOpRayQueryGetIntersectionGeometryIndexKHR: ++ case SpvOpRayQueryGetIntersectionPrimitiveIndexKHR: ++ case SpvOpRayQueryGetIntersectionBarycentricsKHR: ++ case SpvOpRayQueryGetIntersectionFrontFaceKHR: ++ case SpvOpRayQueryGetIntersectionObjectRayDirectionKHR: ++ case SpvOpRayQueryGetIntersectionObjectRayOriginKHR: ++ case SpvOpRayQueryGetIntersectionObjectToWorldKHR: ++ case SpvOpRayQueryGetIntersectionWorldToObjectKHR: ++ case SpvOpRayQueryGetIntersectionTriangleVertexPositionsKHR: ++ ray_query_load_intrinsic_create(b, opcode, w, ++ vtn_ssa_value(b, w[3])->def, ++ vtn_constant_uint(b, w[4])); ++ break; ++ ++ case SpvOpRayQueryGetRayTMinKHR: ++ case SpvOpRayQueryGetRayFlagsKHR: ++ case SpvOpRayQueryGetWorldRayDirectionKHR: ++ case SpvOpRayQueryGetWorldRayOriginKHR: ++ case SpvOpRayQueryGetIntersectionCandidateAABBOpaqueKHR: ++ ray_query_load_intrinsic_create(b, opcode, w, ++ vtn_ssa_value(b, w[3])->def, ++ /* Committed value is ignored for these */ ++ false); ++ break; ++ ++ default: ++ vtn_fail_with_opcode("Unhandled opcode", opcode); ++ } ++} ++ ++static void ++vtn_handle_allocate_node_payloads(struct vtn_builder *b, SpvOp opcode, ++ const uint32_t *w, unsigned count) ++{ ++ vtn_assert(opcode == SpvOpAllocateNodePayloadsAMDX); ++ ++ nir_def *payloads = vtn_ssa_value(b, w[1])->def; ++ mesa_scope scope = vtn_translate_scope(b, vtn_constant_uint(b, w[2])); ++ nir_def *payload_count = vtn_ssa_value(b, w[3])->def; ++ nir_def *node_index = vtn_ssa_value(b, w[4])->def; ++ ++ nir_initialize_node_payloads(&b->nb, payloads, payload_count, node_index, .execution_scope = scope); ++} ++ ++static bool ++vtn_handle_body_instruction(struct vtn_builder *b, SpvOp opcode, ++ const uint32_t *w, unsigned count) ++{ ++ if (b->options->debug_info) { ++ /* Insert a nop to attach debug info to the cursor of the builder. ++ * This should not affect compilation since the nop will be eliminated ++ * in spirv_to_nir. ++ */ ++ nir_intrinsic_instr *nop = nir_nop(&b->nb); ++ ++ nir_instr_debug_info *info = nir_instr_get_debug_info(&nop->instr); ++ info->spirv_offset = b->spirv_offset; ++ ++ if (b->file) { ++ struct hash_entry *he = _mesa_hash_table_search(b->strings, b->file); ++ if (he) { ++ info->filename = he->data; ++ } else { ++ info->filename = ralloc_strdup(b->shader, b->file); ++ _mesa_hash_table_insert(b->strings, b->file, info->filename); ++ } ++ ++ info->line = b->line; ++ info->column = b->col; ++ } ++ } ++ ++ switch (opcode) { ++ case SpvOpLabel: ++ break; ++ ++ case SpvOpLoopMerge: ++ case SpvOpSelectionMerge: ++ /* This is handled by cfg pre-pass and walk_blocks */ ++ break; ++ ++ case SpvOpUndef: { ++ struct vtn_value *val = vtn_push_value(b, w[2], vtn_value_type_undef); ++ val->type = vtn_get_type(b, w[1]); ++ break; ++ } ++ ++ case SpvOpExtInst: ++ case SpvOpExtInstWithForwardRefsKHR: ++ vtn_handle_extension(b, opcode, w, count); ++ break; ++ ++ case SpvOpVariable: ++ case SpvOpLoad: ++ case SpvOpStore: ++ case SpvOpCopyMemory: ++ case SpvOpCopyMemorySized: ++ case SpvOpAccessChain: ++ case SpvOpPtrAccessChain: ++ case SpvOpInBoundsAccessChain: ++ case SpvOpInBoundsPtrAccessChain: ++ case SpvOpArrayLength: ++ case SpvOpConvertPtrToU: ++ case SpvOpConvertUToPtr: ++ case SpvOpGenericCastToPtrExplicit: ++ case SpvOpGenericPtrMemSemantics: ++ case SpvOpSubgroupBlockReadINTEL: ++ case SpvOpSubgroupBlockWriteINTEL: ++ case SpvOpConvertUToAccelerationStructureKHR: ++ case SpvOpUntypedAccessChainKHR: ++ case SpvOpUntypedPtrAccessChainKHR: ++ case SpvOpUntypedInBoundsAccessChainKHR: ++ case SpvOpUntypedInBoundsPtrAccessChainKHR: ++ case SpvOpUntypedArrayLengthKHR: ++ vtn_handle_variables(b, opcode, w, count); ++ break; ++ ++ case SpvOpFunctionCall: ++ vtn_handle_function_call(b, opcode, w, count); ++ break; ++ ++ case SpvOpSampledImage: ++ case SpvOpImage: ++ case SpvOpImageSparseTexelsResident: ++ case SpvOpImageSampleImplicitLod: ++ case SpvOpImageSparseSampleImplicitLod: ++ case SpvOpImageSampleExplicitLod: ++ case SpvOpImageSparseSampleExplicitLod: ++ case SpvOpImageSampleDrefImplicitLod: ++ case SpvOpImageSparseSampleDrefImplicitLod: ++ case SpvOpImageSampleDrefExplicitLod: ++ case SpvOpImageSparseSampleDrefExplicitLod: ++ case SpvOpImageSampleProjImplicitLod: ++ case SpvOpImageSampleProjExplicitLod: ++ case SpvOpImageSampleProjDrefImplicitLod: ++ case SpvOpImageSampleProjDrefExplicitLod: ++ case SpvOpImageFetch: ++ case SpvOpImageSparseFetch: ++ case SpvOpImageGather: ++ case SpvOpImageSparseGather: ++ case SpvOpImageDrefGather: ++ case SpvOpImageSparseDrefGather: ++ case SpvOpImageQueryLod: ++ vtn_handle_texture(b, opcode, w, count); ++ break; ++ ++ case SpvOpImageRead: ++ case SpvOpImageSparseRead: ++ case SpvOpImageWrite: ++ case SpvOpImageTexelPointer: ++ case SpvOpImageQueryFormat: ++ case SpvOpImageQueryOrder: ++ vtn_handle_image(b, opcode, w, count); ++ break; ++ ++ case SpvOpImageQueryLevels: ++ case SpvOpImageQuerySamples: ++ case SpvOpImageQuerySizeLod: ++ case SpvOpImageQuerySize: { ++ struct vtn_type *image_type = vtn_get_value_type(b, w[3]); ++ vtn_assert(image_type->base_type == vtn_base_type_image); ++ if (glsl_type_is_image(image_type->glsl_image)) { ++ vtn_handle_image(b, opcode, w, count); ++ } else { ++ vtn_assert(glsl_type_is_texture(image_type->glsl_image)); ++ vtn_handle_texture(b, opcode, w, count); ++ } ++ break; ++ } ++ ++ case SpvOpFragmentMaskFetchAMD: ++ case SpvOpFragmentFetchAMD: ++ vtn_handle_texture(b, opcode, w, count); ++ break; ++ ++ case SpvOpAtomicLoad: ++ case SpvOpAtomicExchange: ++ case SpvOpAtomicCompareExchange: ++ case SpvOpAtomicCompareExchangeWeak: ++ case SpvOpAtomicIIncrement: ++ case SpvOpAtomicIDecrement: ++ case SpvOpAtomicIAdd: ++ case SpvOpAtomicISub: ++ case SpvOpAtomicSMin: ++ case SpvOpAtomicUMin: ++ case SpvOpAtomicSMax: ++ case SpvOpAtomicUMax: ++ case SpvOpAtomicAnd: ++ case SpvOpAtomicOr: ++ case SpvOpAtomicXor: ++ case SpvOpAtomicFAddEXT: ++ case SpvOpAtomicFMinEXT: ++ case SpvOpAtomicFMaxEXT: ++ case SpvOpAtomicFlagTestAndSet: { ++ struct vtn_value *pointer = vtn_untyped_value(b, w[3]); ++ if (pointer->value_type == vtn_value_type_image_pointer) { ++ vtn_handle_image(b, opcode, w, count); ++ } else { ++ vtn_assert(pointer->value_type == vtn_value_type_pointer); ++ vtn_handle_atomics(b, opcode, w, count); ++ } ++ break; ++ } ++ ++ case SpvOpAtomicStore: ++ case SpvOpAtomicFlagClear: { ++ struct vtn_value *pointer = vtn_untyped_value(b, w[1]); ++ if (pointer->value_type == vtn_value_type_image_pointer) { ++ vtn_handle_image(b, opcode, w, count); ++ } else { ++ vtn_assert(pointer->value_type == vtn_value_type_pointer); ++ vtn_handle_atomics(b, opcode, w, count); ++ } ++ break; ++ } ++ ++ case SpvOpSelect: ++ vtn_handle_select(b, opcode, w, count); ++ break; ++ ++ case SpvOpSNegate: ++ case SpvOpFNegate: ++ case SpvOpNot: ++ case SpvOpAny: ++ case SpvOpAll: ++ case SpvOpConvertFToU: ++ case SpvOpConvertFToS: ++ case SpvOpConvertSToF: ++ case SpvOpConvertUToF: ++ case SpvOpUConvert: ++ case SpvOpSConvert: ++ case SpvOpFConvert: ++ case SpvOpQuantizeToF16: ++ case SpvOpSatConvertSToU: ++ case SpvOpSatConvertUToS: ++ case SpvOpPtrCastToGeneric: ++ case SpvOpGenericCastToPtr: ++ case SpvOpIsNan: ++ case SpvOpIsInf: ++ case SpvOpIsFinite: ++ case SpvOpIsNormal: ++ case SpvOpSignBitSet: ++ case SpvOpLessOrGreater: ++ case SpvOpOrdered: ++ case SpvOpUnordered: ++ case SpvOpIAdd: ++ case SpvOpFAdd: ++ case SpvOpISub: ++ case SpvOpFSub: ++ case SpvOpIMul: ++ case SpvOpFMul: ++ case SpvOpUDiv: ++ case SpvOpSDiv: ++ case SpvOpFDiv: ++ case SpvOpUMod: ++ case SpvOpSRem: ++ case SpvOpSMod: ++ case SpvOpFRem: ++ case SpvOpFMod: ++ case SpvOpVectorTimesScalar: ++ case SpvOpDot: ++ case SpvOpIAddCarry: ++ case SpvOpISubBorrow: ++ case SpvOpUMulExtended: ++ case SpvOpSMulExtended: ++ case SpvOpShiftRightLogical: ++ case SpvOpShiftRightArithmetic: ++ case SpvOpShiftLeftLogical: ++ case SpvOpLogicalEqual: ++ case SpvOpLogicalNotEqual: ++ case SpvOpLogicalOr: ++ case SpvOpLogicalAnd: ++ case SpvOpLogicalNot: ++ case SpvOpBitwiseOr: ++ case SpvOpBitwiseXor: ++ case SpvOpBitwiseAnd: ++ case SpvOpIEqual: ++ case SpvOpFOrdEqual: ++ case SpvOpFUnordEqual: ++ case SpvOpINotEqual: ++ case SpvOpFOrdNotEqual: ++ case SpvOpFUnordNotEqual: ++ case SpvOpULessThan: ++ case SpvOpSLessThan: ++ case SpvOpFOrdLessThan: ++ case SpvOpFUnordLessThan: ++ case SpvOpUGreaterThan: ++ case SpvOpSGreaterThan: ++ case SpvOpFOrdGreaterThan: ++ case SpvOpFUnordGreaterThan: ++ case SpvOpULessThanEqual: ++ case SpvOpSLessThanEqual: ++ case SpvOpFOrdLessThanEqual: ++ case SpvOpFUnordLessThanEqual: ++ case SpvOpUGreaterThanEqual: ++ case SpvOpSGreaterThanEqual: ++ case SpvOpFOrdGreaterThanEqual: ++ case SpvOpFUnordGreaterThanEqual: ++ case SpvOpDPdx: ++ case SpvOpDPdy: ++ case SpvOpFwidth: ++ case SpvOpDPdxFine: ++ case SpvOpDPdyFine: ++ case SpvOpFwidthFine: ++ case SpvOpDPdxCoarse: ++ case SpvOpDPdyCoarse: ++ case SpvOpFwidthCoarse: ++ case SpvOpBitFieldInsert: ++ case SpvOpBitFieldSExtract: ++ case SpvOpBitFieldUExtract: ++ case SpvOpBitReverse: ++ case SpvOpBitCount: ++ case SpvOpTranspose: ++ case SpvOpOuterProduct: ++ case SpvOpMatrixTimesScalar: ++ case SpvOpVectorTimesMatrix: ++ case SpvOpMatrixTimesVector: ++ case SpvOpMatrixTimesMatrix: ++ case SpvOpUCountLeadingZerosINTEL: ++ case SpvOpUCountTrailingZerosINTEL: ++ case SpvOpAbsISubINTEL: ++ case SpvOpAbsUSubINTEL: ++ case SpvOpIAddSatINTEL: ++ case SpvOpUAddSatINTEL: ++ case SpvOpIAverageINTEL: ++ case SpvOpUAverageINTEL: ++ case SpvOpIAverageRoundedINTEL: ++ case SpvOpUAverageRoundedINTEL: ++ case SpvOpISubSatINTEL: ++ case SpvOpUSubSatINTEL: ++ case SpvOpIMul32x16INTEL: ++ case SpvOpUMul32x16INTEL: ++ vtn_handle_alu(b, opcode, w, count); ++ break; ++ ++ case SpvOpSDotKHR: ++ case SpvOpUDotKHR: ++ case SpvOpSUDotKHR: ++ case SpvOpSDotAccSatKHR: ++ case SpvOpUDotAccSatKHR: ++ case SpvOpSUDotAccSatKHR: ++ vtn_handle_integer_dot(b, opcode, w, count); ++ break; ++ ++ case SpvOpBitcast: ++ vtn_handle_bitcast(b, w, count); ++ break; ++ ++ /* TODO: One day, we should probably do something with this information ++ * For now, though, it's safe to implement them as no-ops. ++ * Needed for Rusticl sycl support. ++ */ ++ case SpvOpAssumeTrueKHR: ++ break; ++ ++ case SpvOpExpectKHR: ++ case SpvOpVectorExtractDynamic: ++ case SpvOpVectorInsertDynamic: ++ case SpvOpVectorShuffle: ++ case SpvOpCompositeConstruct: ++ case SpvOpCompositeConstructReplicateEXT: ++ case SpvOpCompositeExtract: ++ case SpvOpCompositeInsert: ++ case SpvOpCopyLogical: ++ case SpvOpCopyObject: ++ vtn_handle_composite(b, opcode, w, count); ++ break; ++ ++ case SpvOpEmitVertex: ++ case SpvOpEndPrimitive: ++ case SpvOpEmitStreamVertex: ++ case SpvOpEndStreamPrimitive: ++ case SpvOpControlBarrier: ++ case SpvOpMemoryBarrier: ++ vtn_handle_barrier(b, opcode, w, count); ++ break; ++ ++ case SpvOpGroupNonUniformElect: ++ case SpvOpGroupNonUniformAll: ++ case SpvOpGroupNonUniformAny: ++ case SpvOpGroupNonUniformAllEqual: ++ case SpvOpGroupNonUniformBroadcast: ++ case SpvOpGroupNonUniformBroadcastFirst: ++ case SpvOpGroupNonUniformBallot: ++ case SpvOpGroupNonUniformInverseBallot: ++ case SpvOpGroupNonUniformBallotBitExtract: ++ case SpvOpGroupNonUniformBallotBitCount: ++ case SpvOpGroupNonUniformBallotFindLSB: ++ case SpvOpGroupNonUniformBallotFindMSB: ++ case SpvOpGroupNonUniformShuffle: ++ case SpvOpGroupNonUniformShuffleXor: ++ case SpvOpGroupNonUniformShuffleUp: ++ case SpvOpGroupNonUniformShuffleDown: ++ case SpvOpGroupNonUniformIAdd: ++ case SpvOpGroupNonUniformFAdd: ++ case SpvOpGroupNonUniformIMul: ++ case SpvOpGroupNonUniformFMul: ++ case SpvOpGroupNonUniformSMin: ++ case SpvOpGroupNonUniformUMin: ++ case SpvOpGroupNonUniformFMin: ++ case SpvOpGroupNonUniformSMax: ++ case SpvOpGroupNonUniformUMax: ++ case SpvOpGroupNonUniformFMax: ++ case SpvOpGroupNonUniformBitwiseAnd: ++ case SpvOpGroupNonUniformBitwiseOr: ++ case SpvOpGroupNonUniformBitwiseXor: ++ case SpvOpGroupNonUniformLogicalAnd: ++ case SpvOpGroupNonUniformLogicalOr: ++ case SpvOpGroupNonUniformLogicalXor: ++ case SpvOpGroupNonUniformQuadBroadcast: ++ case SpvOpGroupNonUniformQuadSwap: ++ case SpvOpGroupNonUniformQuadAllKHR: ++ case SpvOpGroupNonUniformQuadAnyKHR: ++ case SpvOpGroupAll: ++ case SpvOpGroupAny: ++ case SpvOpGroupBroadcast: ++ case SpvOpGroupIAdd: ++ case SpvOpGroupFAdd: ++ case SpvOpGroupFMin: ++ case SpvOpGroupUMin: ++ case SpvOpGroupSMin: ++ case SpvOpGroupFMax: ++ case SpvOpGroupUMax: ++ case SpvOpGroupSMax: ++ case SpvOpGroupIMulKHR: ++ case SpvOpGroupFMulKHR: ++ case SpvOpGroupBitwiseAndKHR: ++ case SpvOpGroupBitwiseOrKHR: ++ case SpvOpGroupBitwiseXorKHR: ++ case SpvOpGroupLogicalAndKHR: ++ case SpvOpGroupLogicalOrKHR: ++ case SpvOpGroupLogicalXorKHR: ++ case SpvOpSubgroupBallotKHR: ++ case SpvOpSubgroupFirstInvocationKHR: ++ case SpvOpSubgroupReadInvocationKHR: ++ case SpvOpSubgroupAllKHR: ++ case SpvOpSubgroupAnyKHR: ++ case SpvOpSubgroupAllEqualKHR: ++ case SpvOpGroupIAddNonUniformAMD: ++ case SpvOpGroupFAddNonUniformAMD: ++ case SpvOpGroupFMinNonUniformAMD: ++ case SpvOpGroupUMinNonUniformAMD: ++ case SpvOpGroupSMinNonUniformAMD: ++ case SpvOpGroupFMaxNonUniformAMD: ++ case SpvOpGroupUMaxNonUniformAMD: ++ case SpvOpGroupSMaxNonUniformAMD: ++ case SpvOpSubgroupShuffleINTEL: ++ case SpvOpSubgroupShuffleDownINTEL: ++ case SpvOpSubgroupShuffleUpINTEL: ++ case SpvOpSubgroupShuffleXorINTEL: ++ case SpvOpGroupNonUniformRotateKHR: ++ vtn_handle_subgroup(b, opcode, w, count); ++ break; ++ ++ case SpvOpPtrDiff: ++ case SpvOpPtrEqual: ++ case SpvOpPtrNotEqual: ++ vtn_handle_ptr(b, opcode, w, count); ++ break; ++ ++ case SpvOpBeginInvocationInterlockEXT: ++ nir_begin_invocation_interlock(&b->nb); ++ nir_scoped_memory_barrier(&b->nb, SCOPE_DEVICE, NIR_MEMORY_ACQUIRE, ++ nir_var_image | nir_var_mem_ssbo | nir_var_mem_global); ++ break; ++ ++ case SpvOpEndInvocationInterlockEXT: ++ nir_scoped_memory_barrier(&b->nb, SCOPE_DEVICE, NIR_MEMORY_RELEASE, ++ nir_var_image | nir_var_mem_ssbo | nir_var_mem_global); ++ nir_end_invocation_interlock(&b->nb); ++ break; ++ ++ case SpvOpDemoteToHelperInvocation: { ++ nir_demote(&b->nb); ++ break; ++ } ++ ++ case SpvOpIsHelperInvocationEXT: { ++ vtn_push_nir_ssa(b, w[2], nir_is_helper_invocation(&b->nb, 1)); ++ break; ++ } ++ ++ case SpvOpReadClockKHR: { ++ SpvScope scope = vtn_constant_uint(b, w[3]); ++ vtn_fail_if(scope != SpvScopeDevice && scope != SpvScopeSubgroup, ++ "OpReadClockKHR Scope must be either " ++ "ScopeDevice or ScopeSubgroup."); ++ ++ /* Operation supports two result types: uvec2 and uint64_t. The NIR ++ * intrinsic gives uvec2, so pack the result for the other case. ++ */ ++ nir_def *result = nir_shader_clock(&b->nb, vtn_translate_scope(b, scope)); ++ ++ struct vtn_type *type = vtn_get_type(b, w[1]); ++ const struct glsl_type *dest_type = type->type; ++ ++ if (glsl_type_is_vector(dest_type)) { ++ assert(dest_type == glsl_vector_type(GLSL_TYPE_UINT, 2)); ++ } else { ++ assert(glsl_type_is_scalar(dest_type)); ++ assert(glsl_get_base_type(dest_type) == GLSL_TYPE_UINT64); ++ result = nir_pack_64_2x32(&b->nb, result); ++ } ++ ++ vtn_push_nir_ssa(b, w[2], result); ++ break; ++ } ++ ++ case SpvOpTraceNV: ++ case SpvOpTraceRayKHR: ++ case SpvOpReportIntersectionKHR: ++ case SpvOpIgnoreIntersectionNV: ++ case SpvOpTerminateRayNV: ++ case SpvOpExecuteCallableNV: ++ case SpvOpExecuteCallableKHR: ++ vtn_handle_ray_intrinsic(b, opcode, w, count); ++ break; ++ ++ case SpvOpRayQueryInitializeKHR: ++ case SpvOpRayQueryTerminateKHR: ++ case SpvOpRayQueryGenerateIntersectionKHR: ++ case SpvOpRayQueryConfirmIntersectionKHR: ++ case SpvOpRayQueryProceedKHR: ++ case SpvOpRayQueryGetIntersectionTypeKHR: ++ case SpvOpRayQueryGetRayTMinKHR: ++ case SpvOpRayQueryGetRayFlagsKHR: ++ case SpvOpRayQueryGetIntersectionTKHR: ++ case SpvOpRayQueryGetIntersectionInstanceCustomIndexKHR: ++ case SpvOpRayQueryGetIntersectionInstanceIdKHR: ++ case SpvOpRayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetKHR: ++ case SpvOpRayQueryGetIntersectionGeometryIndexKHR: ++ case SpvOpRayQueryGetIntersectionPrimitiveIndexKHR: ++ case SpvOpRayQueryGetIntersectionBarycentricsKHR: ++ case SpvOpRayQueryGetIntersectionFrontFaceKHR: ++ case SpvOpRayQueryGetIntersectionCandidateAABBOpaqueKHR: ++ case SpvOpRayQueryGetIntersectionObjectRayDirectionKHR: ++ case SpvOpRayQueryGetIntersectionObjectRayOriginKHR: ++ case SpvOpRayQueryGetWorldRayDirectionKHR: ++ case SpvOpRayQueryGetWorldRayOriginKHR: ++ case SpvOpRayQueryGetIntersectionObjectToWorldKHR: ++ case SpvOpRayQueryGetIntersectionWorldToObjectKHR: ++ case SpvOpRayQueryGetIntersectionTriangleVertexPositionsKHR: ++ vtn_handle_ray_query_intrinsic(b, opcode, w, count); ++ break; ++ ++ case SpvOpLifetimeStart: ++ case SpvOpLifetimeStop: ++ break; ++ ++ case SpvOpGroupAsyncCopy: ++ case SpvOpGroupWaitEvents: ++ vtn_handle_opencl_core_instruction(b, opcode, w, count); ++ break; ++ ++ case SpvOpWritePackedPrimitiveIndices4x8NV: ++ vtn_handle_write_packed_primitive_indices(b, opcode, w, count); ++ break; ++ ++ case SpvOpSetMeshOutputsEXT: ++ nir_set_vertex_and_primitive_count( ++ &b->nb, vtn_get_nir_ssa(b, w[1]), vtn_get_nir_ssa(b, w[2]), ++ nir_undef(&b->nb, 1, 32)); ++ break; ++ ++ case SpvOpAllocateNodePayloadsAMDX: ++ vtn_handle_allocate_node_payloads(b, opcode, w, count); ++ break; ++ ++ case SpvOpFinishWritingNodePayloadAMDX: ++ break; ++ ++ case SpvOpCooperativeMatrixLoadKHR: ++ case SpvOpCooperativeMatrixStoreKHR: ++ case SpvOpCooperativeMatrixLengthKHR: ++ case SpvOpCooperativeMatrixMulAddKHR: ++ case SpvOpCooperativeMatrixConvertNV: ++ case SpvOpCooperativeMatrixTransposeNV: ++ vtn_handle_cooperative_instruction(b, opcode, w, count); ++ break; ++ ++ default: ++ vtn_fail_with_opcode("Unhandled opcode", opcode); ++ } ++ ++ return true; ++} ++ ++static bool ++is_glslang(const struct vtn_builder *b) ++{ ++ return b->generator_id == vtn_generator_glslang_reference_front_end || ++ b->generator_id == vtn_generator_shaderc_over_glslang; ++} ++ ++struct vtn_builder* ++vtn_create_builder(const uint32_t *words, size_t word_count, ++ mesa_shader_stage stage, const char *entry_point_name, ++ const struct spirv_to_nir_options *options) ++{ ++ /* Initialize the vtn_builder object */ ++ struct vtn_builder *b = rzalloc(NULL, struct vtn_builder); ++ ++ b->spirv = words; ++ b->spirv_word_count = word_count; ++ b->file = NULL; ++ b->line = -1; ++ b->col = -1; ++ list_inithead(&b->functions); ++ b->entry_point_stage = stage; ++ b->entry_point_name = entry_point_name; ++ ++ /* ++ * Handle the SPIR-V header (first 5 dwords). ++ * Can't use vtx_assert() as the setjmp(3) target isn't initialized yet. ++ */ ++ if (word_count <= 5) ++ goto fail; ++ ++ if (words[0] != SpvMagicNumber) { ++ vtn_err("words[0] was 0x%x, want 0x%x", words[0], SpvMagicNumber); ++ goto fail; ++ } ++ ++ b->version = words[1]; ++ if (b->version < 0x10000) { ++ vtn_err("version was 0x%x, want >= 0x10000", b->version); ++ goto fail; ++ } ++ ++ b->generator_id = words[2] >> 16; ++ uint16_t generator_version = words[2]; ++ ++ unsigned value_id_bound = words[3]; ++ if (words[4] != 0) { ++ vtn_err("words[4] was %u, want 0", words[4]); ++ goto fail; ++ } ++ ++ b->value_id_bound = value_id_bound; ++ ++ /* Allocate all the data that can be dropped after parsing using ++ * a cheaper allocation strategy. Use the value_id_bound and the ++ * size of the common internal structs to approximate a good ++ * buffer_size. ++ */ ++ const linear_opts lin_opts = { ++ .min_buffer_size = 2 * value_id_bound * (sizeof(struct vtn_value) + ++ sizeof(struct vtn_ssa_value)), ++ }; ++ b->lin_ctx = linear_context_with_opts(b, &lin_opts); ++ ++ struct spirv_to_nir_options *dup_options = ++ vtn_alloc(b, struct spirv_to_nir_options); ++ *dup_options = *options; ++ ++ b->options = dup_options; ++ b->values = vtn_zalloc_array(b, struct vtn_value, value_id_bound); ++ ++ if (b->options->capabilities != NULL) ++ b->supported_capabilities = *b->options->capabilities; ++ else ++ b->supported_capabilities = implemented_capabilities; ++ ++ spirv_capabilities_set(&b->supported_capabilities, SpvCapabilityLinkage, ++ b->options->create_library); ++ ++ /* In GLSLang commit 8297936dd6eb3, their handling of barrier() was fixed ++ * to provide correct memory semantics on compute shader barrier() ++ * commands. Prior to that, we need to fix them up ourselves. This ++ * GLSLang fix caused them to bump to generator version 3. ++ */ ++ b->wa_glslang_cs_barrier = is_glslang(b) && generator_version < 3; ++ ++ /* Identifying the LLVM-SPIRV translator: ++ * ++ * The LLVM-SPIRV translator currently doesn't store any generator ID [1]. ++ * Our use case involving the SPIRV-Tools linker also mean we want to check ++ * for that tool instead. Finally the SPIRV-Tools linker also stores its ++ * generator ID in the wrong location [2]. ++ * ++ * [1] : https://github.com/KhronosGroup/SPIRV-LLVM-Translator/pull/1223 ++ * [2] : https://github.com/KhronosGroup/SPIRV-Tools/pull/4549 ++ */ ++ const bool is_llvm_spirv_translator = ++ (b->generator_id == 0 && ++ generator_version == vtn_generator_spirv_tools_linker) || ++ b->generator_id == vtn_generator_spirv_tools_linker; ++ ++ /* The LLVM-SPIRV translator generates Undef initializers for _local ++ * variables [1]. ++ * ++ * [1] : https://github.com/KhronosGroup/SPIRV-LLVM-Translator/issues/1224 ++ */ ++ b->wa_llvm_spirv_ignore_workgroup_initializer = ++ b->options->environment == NIR_SPIRV_OPENCL && is_llvm_spirv_translator; ++ ++ /* Older versions of GLSLang would incorrectly emit OpReturn after ++ * OpEmitMeshTasksEXT. This is incorrect since the latter is already ++ * a terminator instruction. ++ * ++ * See https://github.com/KhronosGroup/glslang/issues/3020 for details. ++ * ++ * Clay Shader Compiler (used by GravityMark) is also affected. ++ */ ++ b->wa_ignore_return_after_emit_mesh_tasks = ++ (is_glslang(b) && generator_version < 11) || ++ (b->generator_id == vtn_generator_clay_shader_compiler && ++ generator_version < 18); ++ ++ if (b->options->environment == NIR_SPIRV_VULKAN && b->version < 0x10400) ++ b->vars_used_indirectly = _mesa_pointer_set_create(b); ++ ++ if (b->options->debug_info) ++ b->strings = _mesa_pointer_hash_table_create(b); ++ ++ return b; ++ fail: ++ ralloc_free(b); ++ return NULL; ++} ++ ++/* See glsl_type_add_to_function_params and vtn_ssa_value_add_to_call_params */ ++static void ++vtn_emit_kernel_entry_point_wrapper_struct_param(struct nir_builder *b, ++ nir_deref_instr *deref, ++ nir_call_instr *call, ++ unsigned *idx) ++{ ++ if (glsl_type_is_vector_or_scalar(deref->type)) { ++ call->params[(*idx)++] = nir_src_for_ssa(nir_load_deref(b, deref)); ++ } else { ++ unsigned elems = glsl_get_length(deref->type); ++ for (unsigned i = 0; i < elems; i++) { ++ nir_deref_instr *child_deref = glsl_type_is_struct(deref->type) ++ ? nir_build_deref_struct(b, deref, i) ++ : nir_build_deref_array_imm(b, deref, i); ++ vtn_emit_kernel_entry_point_wrapper_struct_param(b, child_deref, call, ++ idx); ++ } ++ } ++} ++ ++static nir_function * ++vtn_emit_kernel_entry_point_wrapper(struct vtn_builder *b, ++ nir_function *entry_point) ++{ ++ vtn_assert(entry_point == b->entry_point->func->nir_func); ++ vtn_fail_if(!entry_point->name, "entry points are required to have a name"); ++ const char *func_name = ++ ralloc_asprintf(b->shader, "__wrapped_%s", entry_point->name); ++ ++ vtn_assert(b->shader->info.stage == MESA_SHADER_KERNEL); ++ ++ nir_function *main_entry_point = nir_function_create(b->shader, func_name); ++ nir_function_impl *impl = nir_function_impl_create(main_entry_point); ++ b->nb = nir_builder_at(nir_after_impl(impl)); ++ b->func_param_idx = 0; ++ ++ nir_call_instr *call = nir_call_instr_create(b->nb.shader, entry_point); ++ ++ unsigned call_idx = 0; ++ for (unsigned i = 0; i < b->entry_point->func->type->length; ++i) { ++ struct vtn_type *param_type = b->entry_point->func->type->params[i]; ++ ++ b->shader->info.cs.has_variable_shared_mem |= ++ param_type->storage_class == SpvStorageClassWorkgroup; ++ ++ /* consider all pointers to function memory to be parameters passed ++ * by value ++ */ ++ bool is_by_val = param_type->base_type == vtn_base_type_pointer && ++ param_type->storage_class == SpvStorageClassFunction; ++ ++ /* input variable */ ++ nir_variable *in_var = nir_variable_create_zeroed(b->nb.shader); ++ ++ if (is_by_val) { ++ in_var->data.mode = nir_var_uniform; ++ in_var->type = param_type->pointed->type; ++ } else if (param_type->base_type == vtn_base_type_image) { ++ in_var->data.mode = nir_var_image; ++ in_var->type = param_type->glsl_image; ++ in_var->data.access = ++ spirv_to_gl_access_qualifier(b, param_type->access_qualifier); ++ } else if (param_type->base_type == vtn_base_type_sampler) { ++ in_var->data.mode = nir_var_uniform; ++ in_var->type = glsl_bare_sampler_type(); ++ } else { ++ in_var->data.mode = nir_var_uniform; ++ in_var->type = param_type->type; ++ } ++ ++ in_var->data.read_only = true; ++ in_var->data.location = i; ++ ++ nir_shader_add_variable(b->nb.shader, in_var); ++ ++ /* we have to copy the entire variable into function memory */ ++ if (is_by_val) { ++ nir_variable *copy_var = ++ nir_local_variable_create(impl, in_var->type, "copy_in"); ++ nir_copy_var(&b->nb, copy_var, in_var); ++ call->params[call_idx++] = ++ nir_src_for_ssa(&nir_build_deref_var(&b->nb, copy_var)->def); ++ } else if (param_type->base_type == vtn_base_type_image || ++ param_type->base_type == vtn_base_type_sampler) { ++ /* Don't load the var, just pass a deref of it */ ++ call->params[call_idx++] = ++ nir_src_for_ssa(&nir_build_deref_var(&b->nb, in_var)->def); ++ } else if (param_type->base_type == vtn_base_type_struct) { ++ /* We decompose struct and array parameters in vtn, so we'll need to ++ * handle it here explicitly. ++ * We have to keep the arguments on the actual entry point intact, ++ * because the runtimes rely on it to match the SPIR-V. ++ */ ++ nir_deref_instr *deref = nir_build_deref_var(&b->nb, in_var); ++ vtn_emit_kernel_entry_point_wrapper_struct_param(&b->nb, deref, call, ++ &call_idx); ++ } else { ++ call->params[call_idx++] = ++ nir_src_for_ssa(nir_load_var(&b->nb, in_var)); ++ } ++ } ++ ++ assert(call_idx == entry_point->num_params); ++ ++ nir_builder_instr_insert(&b->nb, &call->instr); ++ ++ return main_entry_point; ++} ++ ++static bool ++can_remove(nir_variable *var, void *data) ++{ ++ const struct set *vars_used_indirectly = data; ++ return !_mesa_set_search(vars_used_indirectly, var); ++} ++ ++nir_shader * ++spirv_to_nir(const uint32_t *words, size_t word_count, ++ struct nir_spirv_specialization *spec, unsigned num_spec, ++ mesa_shader_stage stage, const char *entry_point_name, ++ const struct spirv_to_nir_options *options, ++ const nir_shader_compiler_options *nir_options) ++ ++{ ++ mesa_spirv_debug_init(); ++ ++ if (MESA_SPIRV_DEBUG(ASM)) ++ spirv_print_asm(stderr, words, word_count); ++ ++ const uint32_t *word_end = words + word_count; ++ ++ struct vtn_builder *b = vtn_create_builder(words, word_count, ++ stage, entry_point_name, ++ options); ++ ++ if (b == NULL) ++ return NULL; ++ ++ /* See also _vtn_fail() */ ++ if (vtn_setjmp(b->fail_jump)) { ++ ralloc_free(b); ++ return NULL; ++ } ++ ++ b->shader = nir_shader_create(b, stage, nir_options); ++ b->shader->info.float_controls_execution_mode = options->float_controls_execution_mode; ++ b->shader->info.cs.shader_index = options->shader_index; ++ b->shader->has_debug_info = options->debug_info; ++ _mesa_blake3_compute(words, word_count * sizeof(uint32_t), b->shader->info.source_blake3); ++ ++ const char *dump_path = secure_getenv("MESA_SPIRV_DUMP_PATH"); ++ if (dump_path) { ++ char blake3_str[BLAKE3_HEX_LEN]; ++ _mesa_blake3_format(blake3_str, b->shader->info.source_blake3); ++ vtn_dump_shader(b, dump_path, blake3_str); ++ } ++ ++ const char *read_path = secure_getenv("MESA_SPIRV_READ_PATH"); ++ if (read_path) { ++ char blake3_str[BLAKE3_HEX_LEN]; ++ _mesa_blake3_format(blake3_str, b->shader->info.source_blake3); ++ ++ char filename[PATH_MAX]; ++ const char *stage_ext = _mesa_shader_stage_to_file_ext(stage); ++ int len = snprintf(filename, sizeof(filename), "%s/0x%s.%s", ++ read_path, blake3_str, stage_ext); ++ ++ if (len < 0 || len >= sizeof(filename)) { ++ vtn_err("Invalid replacement SPIR-V shader file path length: %s/%s.%s", ++ read_path, blake3_str, stage_ext); ++ goto no_shader_replace; ++ } ++ ++ FILE *f = fopen(filename, "rb"); ++ if (f == NULL) { ++ vtn_info("Replacement SPIR-V shader file %s not found.", filename); ++ goto no_shader_replace; ++ } ++ ++ size_t replacement_size = 0; ++ fseek(f, 0, SEEK_END); ++ replacement_size = ftell(f); ++ if (replacement_size == 0) { ++ vtn_info("Replacement SPIR-V shader file %s is empty.", filename); ++ goto no_shader_replace; ++ } ++ ++ uint32_t *replacement_words = malloc(replacement_size); ++ if (replacement_words == NULL) { ++ vtn_err("Failed to allocate memory for replacement SPIR-V shader %s", filename); ++ goto no_shader_replace; ++ } ++ ++ fseek(f, 0, SEEK_SET); ++ if (fread((void *)replacement_words, 1, replacement_size, f) != replacement_size) { ++ vtn_err("Failed to read replacement SPIR-V shader file %s", filename); ++ free((void *)replacement_words); ++ fclose(f); ++ goto no_shader_replace; ++ } ++ ++ fclose(f); ++ ++ vtn_info("Replacing shader 0x%s with contents of %s", blake3_str, filename); ++ ++ // re-generate with the replacement SPIR-V ++ ralloc_free(b->shader); ++ ralloc_free(b); ++ nir_shader* result = spirv_to_nir(replacement_words, replacement_size / sizeof(uint32_t), ++ spec, num_spec, ++ stage, entry_point_name, options, ++ nir_options); ++ ++ free((void *)replacement_words); ++ return result; ++ ++ // default (empty) path if shader replacement fails ++ no_shader_replace: ; ++ } ++ ++ /* Skip the SPIR-V header, handled at vtn_create_builder */ ++ words+= 5; ++ ++ /* Handle all the preamble instructions */ ++ words = vtn_foreach_instruction(b, words, word_end, ++ vtn_handle_preamble_instruction); ++ ++ if (b->enabled_capabilities.GroupNonUniform && options->group_non_uniform_subgroup_size) { ++ b->shader->info.api_subgroup_size = options->group_non_uniform_subgroup_size; ++ b->shader->info.max_subgroup_size = options->group_non_uniform_subgroup_size; ++ } ++ ++ /* DirectXShaderCompiler and glslang/shaderc both create OpKill from HLSL's ++ * discard/clip, which uses demote semantics. DirectXShaderCompiler will use ++ * demote if the extension is enabled, so we disable this workaround in that ++ * case. ++ * ++ * Related glslang issue: https://github.com/KhronosGroup/glslang/issues/2416 ++ */ ++ bool dxsc = b->generator_id == vtn_generator_spiregg; ++ b->convert_discard_to_demote = (nir_options->discard_is_demote || ++ (dxsc && !b->enabled_capabilities.DemoteToHelperInvocation) || ++ (is_glslang(b) && b->source_lang == SpvSourceLanguageHLSL)) && ++ b->supported_capabilities.DemoteToHelperInvocation; ++ ++ if (!options->create_library && b->entry_point == NULL) { ++ vtn_fail("Entry point not found for %s shader \"%s\"", ++ _mesa_shader_stage_to_string(stage), entry_point_name); ++ ralloc_free(b); ++ return NULL; ++ } ++ ++ /* Ensure a sane address mode is being used for function temps */ ++ assert(nir_address_format_bit_size(b->options->temp_addr_format) == nir_get_ptr_bitsize(b->shader)); ++ assert(nir_address_format_num_components(b->options->temp_addr_format) == 1); ++ ++ /* Set shader info defaults */ ++ if (stage == MESA_SHADER_GEOMETRY) ++ b->shader->info.gs.invocations = 1; ++ ++ /* Parse execution modes. */ ++ if (!options->create_library) ++ vtn_foreach_execution_mode(b, b->entry_point, ++ vtn_handle_execution_mode, NULL); ++ ++ b->specializations = spec; ++ b->num_specializations = num_spec; ++ ++ /* Handle all variable, type, and constant instructions */ ++ words = vtn_foreach_instruction(b, words, word_end, ++ vtn_handle_variable_or_type_instruction); ++ ++ /* Parse execution modes that depend on IDs. Must happen after we have ++ * constants parsed. ++ */ ++ if (!options->create_library) ++ vtn_foreach_execution_mode(b, b->entry_point, ++ vtn_handle_execution_mode_id, NULL); ++ ++ if (b->workgroup_size_builtin) { ++ vtn_assert(mesa_shader_stage_uses_workgroup(stage)); ++ vtn_assert(b->workgroup_size_builtin->type->type == ++ glsl_vector_type(GLSL_TYPE_UINT, 3)); ++ ++ nir_const_value *const_size = ++ b->workgroup_size_builtin->constant->values; ++ ++ b->shader->info.workgroup_size[0] = const_size[0].u32; ++ b->shader->info.workgroup_size[1] = const_size[1].u32; ++ b->shader->info.workgroup_size[2] = const_size[2].u32; ++ } ++ ++ /* Set types on all vtn_values */ ++ vtn_foreach_instruction(b, words, word_end, vtn_set_instruction_result_type); ++ ++ vtn_build_cfg(b, words, word_end); ++ ++ if (!options->create_library) { ++ assert(b->entry_point->value_type == vtn_value_type_function); ++ b->entry_point->func->referenced = true; ++ } ++ ++ bool progress; ++ do { ++ progress = false; ++ vtn_foreach_function(func, &b->functions) { ++ if ((options->create_library || func->referenced) && !func->emitted) { ++ _mesa_hash_table_clear(b->strings, NULL); ++ vtn_function_emit(b, func, vtn_handle_body_instruction); ++ progress = true; ++ } ++ } ++ } while (progress); ++ ++ if (!options->create_library) { ++ vtn_assert(b->entry_point->value_type == vtn_value_type_function); ++ nir_function *entry_point = b->entry_point->func->nir_func; ++ vtn_assert(entry_point); ++ ++ entry_point->dont_inline = false; ++ /* post process entry_points with input params */ ++ if (entry_point->num_params && b->shader->info.stage == MESA_SHADER_KERNEL) ++ entry_point = vtn_emit_kernel_entry_point_wrapper(b, entry_point); ++ ++ entry_point->is_entrypoint = true; ++ } ++ ++ if (MESA_SPIRV_DEBUG(VALUES)) { ++ vtn_dump_values(b, stdout); ++ } ++ ++ /* structurize the CFG */ ++ nir_lower_goto_ifs(b->shader); ++ ++ /* Work around validation errors for RT raygen and miss shaders ++ * that define ray hit attribute variables. Per the SPV_KHR_ray_tracing ++ * spec, these variables are invalid for these stages: ++ * ++ * "Variables declared with this storage class are allowed only in ++ * IntersectionKHR, AnyHitKHR and ClosestHitKHR execution models." ++ * ++ * https://gitlab.freedesktop.org/mesa/mesa/-/issues/13677 ++ */ ++ if (b->shader->info.stage == MESA_SHADER_RAYGEN || ++ b->shader->info.stage == MESA_SHADER_MISS) { ++ /* Can't use NIR_PASS macro because it calls `nir_validate_shader` and ++ * the shaders may require other workarounds to pass validation. ++ */ ++ nir_remove_dead_variables(b->shader, nir_var_ray_hit_attrib, NULL); ++ } ++ ++ /* Work around applications that declare shader_call_data variables inside ++ * ray generation shaders or multiple shader_call_data variables in callable ++ * shaders. This needs to happen before validation. ++ * ++ * https://gitlab.freedesktop.org/mesa/mesa/-/issues/5326 ++ * https://gitlab.freedesktop.org/mesa/mesa/-/issues/11585 ++ */ ++ if (mesa_shader_stage_is_rt(b->shader->info.stage)) { ++ NIR_PASS(_, b->shader, nir_remove_dead_variables, nir_var_shader_call_data, ++ NULL); ++ } ++ ++ nir_validate_shader(b->shader, "after spirv cfg"); ++ ++ nir_lower_continue_constructs(b->shader); ++ ++ /* A SPIR-V module can have multiple shaders stages and also multiple ++ * shaders of the same stage. Global variables are declared per-module. ++ * ++ * Starting in SPIR-V 1.4 the list of global variables is part of ++ * OpEntryPoint, so only valid ones will be created. Previous versions ++ * only have Input and Output variables listed, so remove dead variables to ++ * clean up the remaining ones. ++ */ ++ if (!options->create_library && b->version < 0x10400) { ++ const nir_remove_dead_variables_options dead_opts = { ++ .can_remove_var = can_remove, ++ .can_remove_var_data = b->vars_used_indirectly, ++ }; ++ nir_remove_dead_variables(b->shader, ~(nir_var_function_temp | ++ nir_var_shader_out | ++ nir_var_shader_in | ++ nir_var_system_value), ++ b->vars_used_indirectly ? &dead_opts : NULL); ++ } ++ ++ nir_foreach_variable_in_shader(var, b->shader) { ++ switch (var->data.mode) { ++ case nir_var_mem_ubo: ++ b->shader->info.num_ubos++; ++ break; ++ case nir_var_mem_ssbo: ++ b->shader->info.num_ssbos++; ++ break; ++ case nir_var_mem_push_const: ++ vtn_assert(b->shader->num_uniforms == 0); ++ b->shader->num_uniforms = ++ glsl_get_explicit_size(glsl_without_array(var->type), false); ++ break; ++ } ++ } ++ ++ /* We sometimes generate bogus derefs that, while never used, give the ++ * validator a bit of heartburn. Run dead code to get rid of them. ++ */ ++ nir_opt_dce(b->shader); ++ ++ if (stage == MESA_SHADER_FRAGMENT) { ++ /* From the Vulkan 1.2.199 spec: ++ * ++ * "If a fragment shader entry point’s interface includes an input ++ * variable decorated with SamplePosition, Sample Shading is ++ * considered enabled with a minSampleShading value of 1.0." ++ * ++ * Similar text exists for SampleId. Regarding the Sample decoration, ++ * the Vulkan 1.2.199 spec says: ++ * ++ * "If a fragment shader input is decorated with Sample, a separate ++ * value must be assigned to that variable for each covered sample in ++ * the fragment, and that value must be sampled at the location of ++ * the individual sample. When rasterizationSamples is ++ * VK_SAMPLE_COUNT_1_BIT, the fragment center must be used for ++ * Centroid, Sample, and undecorated attribute interpolation." ++ * ++ * Unfortunately, this isn't quite as clear about static use and the ++ * interface but the static use check should be valid. ++ * ++ * For OpenGL, similar language exists but it's all more wishy-washy. ++ * We'll assume the same behavior across APIs. ++ */ ++ nir_foreach_variable_with_modes(var, b->shader, ++ nir_var_shader_in | ++ nir_var_system_value) { ++ struct nir_variable_data *members = ++ var->members ? var->members : &var->data; ++ uint16_t num_members = var->members ? var->num_members : 1; ++ for (uint16_t i = 0; i < num_members; i++) { ++ if (members[i].mode == nir_var_system_value && ++ (members[i].location == SYSTEM_VALUE_SAMPLE_ID || ++ members[i].location == SYSTEM_VALUE_SAMPLE_POS)) ++ b->shader->info.fs.uses_sample_shading = true; ++ ++ if (members[i].mode == nir_var_shader_in && members[i].sample) ++ b->shader->info.fs.uses_sample_shading = true; ++ } ++ } ++ } ++ ++ /* Unparent the shader from the vtn_builder before we delete the builder */ ++ ralloc_steal(NULL, b->shader); ++ ++ nir_shader *shader = b->shader; ++ ralloc_free(b); ++ ++ return shader; ++} ++ ++static unsigned ++vtn_id_for_type(struct vtn_builder *b, struct vtn_type *type) ++{ ++ for (unsigned i = 0; i < b->value_id_bound; i++) { ++ struct vtn_value *v = &b->values[i]; ++ if (v->value_type == vtn_value_type_type && ++ v->type == type) ++ return i; ++ } ++ ++ return 0; ++} ++ ++void ++vtn_print_value(struct vtn_builder *b, struct vtn_value *val, FILE *f) ++{ ++ fprintf(f, "%s", vtn_value_type_to_string(val->value_type)); ++ switch (val->value_type) { ++ case vtn_value_type_ssa: { ++ struct vtn_ssa_value *ssa = val->ssa; ++ fprintf(f, " glsl_type=%s", glsl_get_type_name(ssa->type)); ++ break; ++ } ++ ++ case vtn_value_type_constant: { ++ fprintf(f, " type=%d", vtn_id_for_type(b, val->type)); ++ if (val->is_null_constant) ++ fprintf(f, " null"); ++ else if (val->is_undef_constant) ++ fprintf(f, " undef"); ++ break; ++ } ++ ++ case vtn_value_type_pointer: { ++ struct vtn_pointer *pointer = val->pointer; ++ fprintf(f, " ptr_type=%u", vtn_id_for_type(b, pointer->type)); ++ fprintf(f, " (pointed-)type=%u", vtn_id_for_type(b, val->pointer->type->pointed)); ++ ++ if (pointer->deref) { ++ fprintf(f, "\n NIR: "); ++ nir_print_instr(&pointer->deref->instr, f); ++ } ++ break; ++ } ++ ++ case vtn_value_type_type: { ++ struct vtn_type *type = val->type; ++ fprintf(f, " %s", vtn_base_type_to_string(type->base_type)); ++ switch (type->base_type) { ++ case vtn_base_type_pointer: ++ fprintf(f, " deref=%d", vtn_id_for_type(b, type->pointed)); ++ fprintf(f, " %s", spirv_storageclass_to_string(val->type->storage_class)); ++ break; ++ default: ++ break; ++ } ++ if (type->type) ++ fprintf(f, " glsl_type=%s", glsl_get_type_name(type->type)); ++ break; ++ } ++ ++ default: ++ break; ++ } ++ fprintf(f, "\n"); ++} ++ ++void ++vtn_dump_values(struct vtn_builder *b, FILE *f) ++{ ++ fprintf(f, "=== SPIR-V values\n"); ++ for (unsigned i = 1; i < b->value_id_bound; i++) { ++ struct vtn_value *val = &b->values[i]; ++ fprintf(f, "%8d = ", i); ++ vtn_print_value(b, val, f); ++ } ++ fprintf(f, "===\n"); ++} +diff -Nru mesa-25.3.3/.pc/define-vulkan_manifest_suffix-global.patch/meson.build mesa-25.3.3/.pc/define-vulkan_manifest_suffix-global.patch/meson.build +--- mesa-25.3.3/.pc/define-vulkan_manifest_suffix-global.patch/meson.build 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/.pc/define-vulkan_manifest_suffix-global.patch/meson.build 2026-05-28 22:15:49.000000000 -0500 +@@ -0,0 +1,2419 @@ ++# Copyright © 2017-2020 Intel Corporation ++# SPDX-License-Identifier: MIT ++ ++project( ++ 'mesa', ++ ['c', 'cpp'], ++ version : files('VERSION'), ++ license : 'MIT', ++ meson_version : '>= 1.4.0', ++ default_options : [ ++ 'buildtype=debugoptimized', ++ 'b_ndebug=if-release', ++ 'c_std=c11', ++ 'cpp_std=c++17', ++ 'rust_std=2021', ++ 'build.rust_std=2021', ++ ], ++) ++ ++if host_machine.system() == 'darwin' ++ add_languages('objc', native : false) ++ libname_prefix = 'lib' ++ libname_suffix = 'dylib' ++elif host_machine.system() == 'windows' ++ libname_prefix = '' ++ libname_suffix = 'dll' ++else ++ libname_prefix = 'lib' ++ libname_suffix = 'so' ++endif ++ ++cc = meson.get_compiler('c') ++cpp = meson.get_compiler('cpp') ++fs = import('fs') ++ ++sizeof_pointer = cc.sizeof('void*').to_string() ++ ++null_dep = dependency('', required : false) ++ ++if get_option('layout') != 'mirror' ++ error('`mirror` is the only build directory layout supported') ++endif ++ ++with_llvm = get_option('llvm') ++amd_with_llvm = with_llvm.allowed() and get_option('amd-use-llvm') ++ ++with_mesa_debug = get_option('buildtype') == 'debug' ++ ++# This means the final value of b_ndebug==true ++with_mesa_ndebug = get_option('b_ndebug') == 'true' or (get_option('buildtype') == 'release' and get_option('b_ndebug') == 'if-release') ++ ++# We need to set -fmacro-prefix-map properly for driver CL reproducability. ++relative_dir = fs.relative_to(meson.project_source_root(), meson.project_build_root()) ++ ++cl_args = [ ++ '-fmacro-prefix-map=@0@/='.format(relative_dir), ++ '-fmacro-prefix-map=@0@/='.format(meson.project_source_root()), ++ '-fmacro-prefix-map=@0@/='.format(meson.project_build_root()), ++ ++ # Set the OpenCL standard to CL 2.0, enabling everything at a frontend. ++ # Drivers may not actually support everything but that's ok. ++ '-cl-std=cl2.0', ++ '-D__OPENCL_VERSION__=200', ++ ++ # Declare supported clang builtins since we don't autodetect for OpenCL ++ '-DHAVE___BUILTIN_FFS', ++ '-DHAVE___BUILTIN_CLZ', ++] ++ ++if with_mesa_ndebug ++ cl_args += ['-DNDEBUG'] ++endif ++ ++# Arguments for the preprocessor, put these in a separate array from the C and ++# C++ (cpp in meson terminology) arguments since they need to be added to the ++# default arguments for both C and C++. ++pre_args = [ ++ '-D__STDC_CONSTANT_MACROS', ++ '-D__STDC_FORMAT_MACROS', ++ '-D__STDC_LIMIT_MACROS', ++ '-DPACKAGE_VERSION="@0@"'.format(meson.project_version()), ++ '-DPACKAGE_BUGREPORT="https://gitlab.freedesktop.org/mesa/mesa/-/issues"', ++] ++# Arguments for c or cpp compiler, can be compiler options ++c_cpp_args = [] ++ ++c_args = [] ++cpp_args = [] ++ ++with_moltenvk_dir = get_option('moltenvk-dir') ++with_vulkan_icd_dir = get_option('vulkan-icd-dir') ++with_tests = get_option('build-tests') ++with_glcpp_tests = get_option('enable-glcpp-tests') ++with_radv_tests = get_option('build-radv-tests') ++with_aco_tests = get_option('build-aco-tests') ++with_glx_read_only_text = get_option('glx-read-only-text') ++with_glx_direct = get_option('glx-direct') ++with_vulkan_overlay_layer = get_option('vulkan-layers').contains('overlay') ++with_vulkan_device_select_layer = get_option('vulkan-layers').contains('device-select') ++with_vulkan_screenshot_layer = get_option('vulkan-layers').contains('screenshot') ++with_vulkan_vram_report_limit_layer = get_option('vulkan-layers').contains('vram-report-limit') ++with_vulkan_anti_lag_layer = get_option('vulkan-layers').contains('anti-lag') ++with_tools = get_option('tools') ++if with_tools.contains('all') ++ with_tools = [ ++ 'asahi', ++ 'dlclose-skip', ++ 'drm-shim', ++ 'etnaviv', ++ 'freedreno', ++ 'glsl', ++ 'imagination', ++ 'intel', ++ 'intel-ui', ++ 'lima', ++ 'nir', ++ 'nouveau', ++ 'panfrost', ++ 'zink', ++ ] ++endif ++ ++with_any_vulkan_layers = get_option('vulkan-layers').length() != 0 ++with_intel_tools = with_tools.contains('intel') or with_tools.contains('intel-ui') ++with_imgui = with_intel_tools or with_vulkan_overlay_layer ++ ++dri_drivers_path = get_option('dri-drivers-path') ++if dri_drivers_path == '' ++ dri_drivers_path = join_paths(get_option('prefix'), get_option('libdir'), 'dri') ++endif ++ ++gbm_backends_path = get_option('gbm-backends-path') ++if gbm_backends_path == '' ++ gbm_backends_path = join_paths(get_option('prefix'), get_option('libdir'), 'gbm') ++endif ++ ++with_opengl = get_option('opengl') ++with_gles1 = get_option('gles1').allowed() ++with_gles2 = get_option('gles2').allowed() ++ ++pre_args += '-DHAVE_OPENGL=@0@'.format(with_opengl.to_int()) ++pre_args += '-DHAVE_OPENGL_ES_1=@0@'.format(with_gles1.to_int()) ++pre_args += '-DHAVE_OPENGL_ES_2=@0@'.format(with_gles2.to_int()) ++ ++with_any_opengl = with_opengl or with_gles1 or with_gles2 ++ ++system_has_kms_drm = ['openbsd', 'netbsd', 'freebsd', 'gnu/kfreebsd', 'dragonfly', 'linux', 'sunos', 'android', 'managarm'].contains(host_machine.system()) ++ ++gallium_drivers = get_option('gallium-drivers') ++if gallium_drivers.contains('auto') ++ if system_has_kms_drm ++ # TODO: Sparc ++ # TODO: handle llvm being disabled or auto when setting default_drivers ++ if ['x86', 'x86_64'].contains(host_machine.cpu_family()) ++ gallium_drivers = [ ++ 'r300', 'r600', 'radeonsi', 'nouveau', 'virgl', 'svga', 'llvmpipe', 'softpipe', ++ 'iris', 'crocus', 'i915', 'zink' ++ ] ++ elif ['arm', 'aarch64'].contains(host_machine.cpu_family()) ++ gallium_drivers = [ ++ 'v3d', 'vc4', 'freedreno', 'etnaviv', 'nouveau', 'svga', ++ 'tegra', 'virgl', 'lima', 'panfrost', 'llvmpipe', 'softpipe', 'iris', ++ 'zink' ++ ] ++ elif ['mips', 'mips64', 'ppc', 'ppc64', 'riscv32', 'riscv64'].contains(host_machine.cpu_family()) ++ gallium_drivers = [ ++ 'r300', 'r600', 'radeonsi', 'nouveau', 'virgl', 'llvmpipe', 'softpipe', 'zink' ++ ] ++ elif ['loongarch64'].contains(host_machine.cpu_family()) ++ gallium_drivers = [ ++ 'r300', 'r600', 'radeonsi', 'nouveau', 'virgl', 'etnaviv', 'llvmpipe', 'softpipe', 'zink' ++ ] ++ else ++ error('Unknown architecture @0@. Please pass -Dgallium-drivers to set driver options. Patches gladly accepted to fix this.'.format( ++ host_machine.cpu_family())) ++ endif ++ elif ['windows'].contains(host_machine.system()) ++ gallium_drivers = ['llvmpipe', 'softpipe', 'zink', 'd3d12'] ++ elif ['darwin', 'cygwin', 'haiku'].contains(host_machine.system()) ++ gallium_drivers = ['llvmpipe', 'softpipe'] ++ else ++ error('Unknown OS @0@. Please pass -Dgallium-drivers to set driver options. Patches gladly accepted to fix this.'.format( ++ host_machine.system())) ++ endif ++elif gallium_drivers.contains('all') ++ gallium_drivers = [ ++ 'r300', 'r600', 'radeonsi', 'crocus', 'v3d', 'vc4', 'freedreno', 'etnaviv', 'i915', ++ 'nouveau', 'svga', 'tegra', 'virgl', 'lima', 'panfrost', 'llvmpipe', 'softpipe', 'iris', ++ 'zink', 'd3d12', 'asahi', 'rocket', 'ethosu' ++ ] ++endif ++ ++with_amdgpu_virtio = get_option('amdgpu-virtio') ++ ++with_gallium_radeonsi = gallium_drivers.contains('radeonsi') ++with_gallium_r300 = gallium_drivers.contains('r300') ++with_gallium_r600 = gallium_drivers.contains('r600') ++with_gallium_nouveau = gallium_drivers.contains('nouveau') ++with_gallium_freedreno = gallium_drivers.contains('freedreno') ++with_gallium_softpipe = gallium_drivers.contains('softpipe') ++with_gallium_llvmpipe = gallium_drivers.contains('llvmpipe') ++with_gallium_vc4 = gallium_drivers.contains('vc4') ++with_gallium_v3d = gallium_drivers.contains('v3d') ++with_gallium_panfrost = gallium_drivers.contains('panfrost') ++with_gallium_etnaviv = gallium_drivers.contains('etnaviv') ++with_gallium_tegra = gallium_drivers.contains('tegra') ++with_gallium_crocus = gallium_drivers.contains('crocus') ++with_gallium_iris = gallium_drivers.contains('iris') ++with_gallium_i915 = gallium_drivers.contains('i915') ++with_gallium_svga = gallium_drivers.contains('svga') ++with_gallium_virgl = gallium_drivers.contains('virgl') ++with_gallium_lima = gallium_drivers.contains('lima') ++with_gallium_zink = gallium_drivers.contains('zink') ++with_gallium_d3d12 = gallium_drivers.contains('d3d12') ++with_gallium_asahi = gallium_drivers.contains('asahi') ++with_gallium_rocket = gallium_drivers.contains('rocket') ++with_gallium_ethosu = gallium_drivers.contains('ethosu') ++foreach gallium_driver : gallium_drivers ++ pre_args += '-DHAVE_@0@'.format(gallium_driver.to_upper()) ++endforeach ++draw_with_llvm = with_llvm.allowed() and get_option('draw-use-llvm') ++with_llvm = with_llvm \ ++ .enable_if(with_gallium_i915, error_message : 'i915 Gallium driver requires LLVM for vertex shaders') \ ++ .enable_if(with_gallium_llvmpipe, error_message : 'LLVMPipe Gallium driver requires LLVM') \ ++ .enable_if(with_gallium_r300 and draw_with_llvm, error_message : 'R300 Gallium driver requires LLVM for vertex shaders on IGP parts') \ ++ .enable_if(with_gallium_r600 and amd_with_llvm, error_message : 'R600 Gallium driver configured to require LLVM') \ ++ .enable_if(with_gallium_radeonsi and amd_with_llvm, error_message : 'RadeonSI Gallium driver configured to require LLVM') ++ ++# compatibility for "swrast" as an internal-ish driver name ++with_gallium_swrast = with_gallium_softpipe or with_gallium_llvmpipe ++if with_gallium_swrast ++ pre_args += '-DHAVE_SWRAST' ++endif ++ ++with_gallium = gallium_drivers.length() != 0 ++with_gallium_kmsro = system_has_kms_drm and [ ++ with_gallium_asahi, ++ with_gallium_etnaviv, ++ with_gallium_freedreno, ++ with_gallium_lima, ++ with_gallium_panfrost, ++ with_gallium_v3d, ++ with_gallium_vc4, ++ with_gallium_zink, ++].contains(true) ++ ++_vulkan_drivers = get_option('vulkan-drivers') ++if _vulkan_drivers.contains('auto') ++ # TODO: handle swrat driver if llvm is auto/disabled ++ if system_has_kms_drm ++ if host_machine.cpu_family().startswith('x86') ++ _vulkan_drivers = ['amd', 'intel', 'intel_hasvk', 'nouveau', 'swrast'] ++ elif ['arm', 'aarch64'].contains(host_machine.cpu_family()) ++ _vulkan_drivers = ['swrast', 'intel', 'panfrost', 'freedreno'] ++ elif ['mips', 'mips64', 'ppc', 'ppc64', 'riscv32', 'riscv64'].contains(host_machine.cpu_family()) ++ _vulkan_drivers = ['amd', 'swrast'] ++ elif ['loongarch64'].contains(host_machine.cpu_family()) ++ _vulkan_drivers = ['amd', 'swrast'] ++ else ++ error('Unknown architecture @0@. Please pass -Dvulkan-drivers to set driver options. Patches gladly accepted to fix this.'.format( ++ host_machine.cpu_family())) ++ endif ++ elif ['darwin', 'windows', 'cygwin', 'haiku'].contains(host_machine.system()) ++ # No vulkan driver supports windows or macOS currently ++ _vulkan_drivers = [] ++ else ++ error('Unknown OS @0@. Please pass -Dvulkan-drivers to set driver options. Patches gladly accepted to fix this.'.format( ++ host_machine.system())) ++ endif ++elif _vulkan_drivers.contains('all') ++ # Build every vulkan driver regardless of architecture. ++ _vulkan_drivers = ['amd', 'intel', 'intel_hasvk', 'swrast', ++ 'freedreno', 'panfrost', 'virtio', 'broadcom', ++ 'imagination', 'microsoft-experimental', ++ 'nouveau', 'asahi', 'gfxstream'] ++endif ++ ++with_intel_vk = _vulkan_drivers.contains('intel') ++with_intel_hasvk = _vulkan_drivers.contains('intel_hasvk') ++with_amd_vk = _vulkan_drivers.contains('amd') ++with_freedreno_vk = _vulkan_drivers.contains('freedreno') ++with_panfrost_vk = _vulkan_drivers.contains('panfrost') ++with_swrast_vk = _vulkan_drivers.contains('swrast') ++with_virtio_vk = _vulkan_drivers.contains('virtio') ++with_broadcom_vk = _vulkan_drivers.contains('broadcom') ++with_imagination_vk = _vulkan_drivers.contains('imagination') ++with_imagination_srv = get_option('imagination-srv') ++with_microsoft_vk = _vulkan_drivers.contains('microsoft-experimental') ++with_nouveau_vk = _vulkan_drivers.contains('nouveau') ++with_asahi_vk = _vulkan_drivers.contains('asahi') ++with_gfxstream_vk = _vulkan_drivers.contains('gfxstream') ++with_any_vk = _vulkan_drivers.length() != 0 ++ ++with_llvm = with_llvm \ ++ .enable_if(with_swrast_vk, error_message : 'Lavapipe Vulkan driver requires LLVM') \ ++ .enable_if(with_amd_vk and with_aco_tests, error_message : 'RadV ACO tests require LLVM') ++ ++with_any_llvmpipe = with_gallium_llvmpipe or with_swrast_vk ++with_gallium_or_lvp = with_gallium or with_swrast_vk ++ ++freedreno_kmds = get_option('freedreno-kmds') ++if freedreno_kmds.length() != 0 and freedreno_kmds != [ 'msm' ] and with_freedreno_vk ++ if freedreno_kmds.contains('msm') ++ warning('Turnip with the DRM KMD will require libdrm to always be present at runtime which may not always be the case on platforms such as Android.') ++ elif with_gallium_kmsro ++ warning('As a side-effect, Turnip is forced to link with libdrm when built alongside Gallium DRM drivers which platforms such as Android may not have available at runtime.') ++ elif _vulkan_drivers != [ 'freedreno' ] ++ warning('Turnip is forced to link with libdrm when built alongside other Vulkan drivers which platforms such as Android may not have available at runtime.') ++ else ++ # If DRM support isn't needed, we can get rid of it since linking ++ # to libdrm can be a potential compatibility hazard. ++ system_has_kms_drm = false ++ endif ++endif ++ ++pre_args += ['-DMESA_SYSTEM_HAS_KMS_DRM=@0@'.format(system_has_kms_drm.to_int())] ++if host_machine.cpu_family() == 'x86' and with_glx_read_only_text ++ pre_args += ['-DGLX_X86_READONLY_TEXT'] ++endif ++ ++with_vdrm = [ ++ with_amdgpu_virtio, ++ freedreno_kmds.contains('virtio'), ++ with_gallium_asahi, ++ with_asahi_vk, ++].contains(true) ++ ++with_dri = false ++if with_gallium and system_has_kms_drm ++ _glx = get_option('glx') ++ _egl = get_option('egl') ++ if _glx == 'dri' or _egl.enabled() or (_glx == 'disabled' and _egl.allowed()) ++ with_dri = true ++ endif ++endif ++ ++with_any_broadcom = [ ++ with_gallium_vc4, ++ with_gallium_v3d, ++ with_broadcom_vk, ++].contains(true) ++ ++with_intel_vk_rt = get_option('intel-rt') \ ++ .disable_auto_if(not with_intel_vk) \ ++ .disable_if(sizeof_pointer != '8', \ ++ error_message: 'Intel Ray Tracing requires 64-bit architectures') \ ++ .allowed() ++ ++with_any_intel = [ ++ with_gallium_crocus, ++ with_gallium_i915, ++ with_gallium_iris, ++ with_intel_hasvk, ++ with_intel_tools, ++ with_intel_vk, ++].contains(true) ++with_any_nouveau = with_gallium_nouveau or with_nouveau_vk ++ ++# needed in the loader ++if with_nouveau_vk ++ pre_args += '-DHAVE_NVK' ++endif ++ ++if with_gallium_tegra and not with_gallium_nouveau ++ error('tegra driver requires nouveau driver') ++endif ++if with_aco_tests and not with_amd_vk ++ error('ACO tests require Radv') ++endif ++if with_radv_tests and not with_amd_vk ++ error('RADV tests require RADV') ++endif ++ ++with_microsoft_clc = get_option('microsoft-clc').enabled() ++with_spirv_to_dxil = get_option('spirv-to-dxil') ++ ++if host_machine.system() == 'darwin' ++ with_dri_platform = 'apple' ++ pre_args += '-DBUILDING_MESA' ++elif ['windows', 'cygwin'].contains(host_machine.system()) ++ with_dri_platform = 'windows' ++elif system_has_kms_drm ++ with_dri_platform = 'drm' ++else ++ # FIXME: haiku doesn't use dri, and xlib doesn't use dri, probably should ++ # assert here that one of those cases has been met. ++ # FIXME: illumos ends up here as well ++ with_dri_platform = 'none' ++endif ++ ++with_vulkan_beta = get_option('vulkan-beta') ++if host_machine.system() == 'darwin' ++ #macOS seems to need beta extensions to build for now: ++ with_vulkan_beta = true ++endif ++if with_vulkan_beta ++ pre_args += '-DVK_ENABLE_BETA_EXTENSIONS' ++endif ++ ++_codecs = get_option('video-codecs') ++patent_codecs = ['vc1dec', 'h264dec', 'h264enc', 'h265dec', 'h265enc'] ++free_codecs = ['av1dec', 'av1enc', 'vp9dec'] ++all_codecs = patent_codecs + free_codecs ++ ++if _codecs.contains('all') ++ _codecs = all_codecs ++elif _codecs.contains('all_free') ++ _codecs += free_codecs ++endif ++foreach c : all_codecs ++ pre_args += '-DVIDEO_CODEC_@0@=@1@'.format(c.to_upper(), _codecs.contains(c).to_int()) ++endforeach ++ ++_platforms = get_option('platforms') ++if _platforms.contains('auto') ++ if system_has_kms_drm ++ _platforms = ['x11', 'wayland'] ++ elif host_machine.system() == 'cygwin' ++ _platforms = ['x11'] ++ elif host_machine.system() == 'haiku' ++ _platforms = ['haiku'] ++ elif host_machine.system() == 'windows' ++ _platforms = ['windows'] ++ elif host_machine.system() == 'darwin' ++ _platforms = ['x11', 'macos'] ++ else ++ error('Unknown OS @0@. Please pass -Dplatforms to set platforms. Patches gladly accepted to fix this.'.format( ++ host_machine.system())) ++ endif ++endif ++ ++with_platform_android = _platforms.contains('android') ++with_platform_x11 = _platforms.contains('x11') ++with_platform_xcb = _platforms.contains('xcb') ++with_platform_wayland = _platforms.contains('wayland') ++with_platform_haiku = _platforms.contains('haiku') ++with_platform_windows = _platforms.contains('windows') ++with_platform_macos = _platforms.contains('macos') ++ ++with_glx = get_option('glx') ++if with_glx == 'auto' ++ if not with_opengl ++ with_glx = 'disabled' ++ elif with_platform_android ++ with_glx = 'disabled' ++ elif with_dri ++ with_glx = 'dri' ++ elif with_platform_haiku ++ with_glx = 'disabled' ++ elif host_machine.system() == 'windows' ++ with_glx = 'disabled' ++ elif with_gallium ++ # Even when building just gallium drivers the user probably wants dri ++ with_glx = 'dri' ++ elif with_platform_x11 and with_any_opengl and not with_any_vk ++ # The automatic behavior should not be to turn on xlib based glx when ++ # building only vulkan drivers ++ with_glx = 'xlib' ++ else ++ with_glx = 'disabled' ++ endif ++endif ++if with_glx == 'dri' ++ if with_gallium ++ with_dri = true ++ endif ++endif ++ ++if not with_opengl and with_glx != 'disabled' ++ error('Building GLX without OpenGL is not supported.') ++endif ++ ++if not (with_dri or with_gallium or with_glx != 'disabled') ++ with_gles1 = false ++ with_gles2 = false ++ with_opengl = false ++ with_any_opengl = false ++endif ++ ++with_gbm = get_option('gbm') \ ++ .require(system_has_kms_drm, error_message : 'GBM only supports DRM/KMS platforms') \ ++ .disable_auto_if(not with_dri) \ ++ .allowed() ++ ++with_xlib_lease = get_option('xlib-lease') \ ++ .require(with_platform_x11 and (system_has_kms_drm or with_dri_platform == 'apple'), error_message : 'xlib-lease requires X11 and KMS/DRM support') \ ++ .allowed() ++ ++with_egl = get_option('egl') \ ++ .require(with_platform_windows or with_platform_haiku or with_dri or with_platform_android, error_message : 'EGL requires DRI, Haiku, Windows or Android') \ ++ .require(with_glx != 'xlib', error_message :'EGL requires DRI, but GLX is being built with xlib support') \ ++ .disable_auto_if(with_platform_haiku) \ ++ .allowed() ++ ++if with_egl ++ _platforms += 'surfaceless' ++ if with_gbm and not with_platform_android ++ _platforms += 'drm' ++ endif ++ ++ egl_native_platform = get_option('egl-native-platform') ++ if egl_native_platform.contains('auto') ++ egl_native_platform = _platforms[0] ++ endif ++endif ++ ++if with_egl and not _platforms.contains(egl_native_platform) ++ error('-Degl-native-platform does not specify an enabled platform') ++endif ++ ++if 'x11' in _platforms ++ _platforms += 'xcb' ++endif ++ ++foreach platform : _platforms ++ pre_args += '-DHAVE_@0@_PLATFORM'.format(platform.to_upper()) ++endforeach ++ ++if with_platform_android and get_option('platform-sdk-version') >= 29 ++ # By default the NDK compiler, at least, emits emutls references instead of ++ # ELF TLS, even when building targeting newer API levels. Make it actually do ++ # ELF TLS instead. ++ c_cpp_args += '-fno-emulated-tls' ++ add_project_link_arguments('-Wl,-plugin-opt=-emulated-tls=0', language: ['c', 'cpp']) ++endif ++ ++# -mtls-dialect=gnu2 speeds up non-initial-exec TLS significantly but requires ++# full toolchain (including libc) support. ++have_mtls_dialect = false ++foreach c_arg : get_option('c_args') ++ if c_arg.startswith('-mtls-dialect=') ++ have_mtls_dialect = true ++ break ++ endif ++endforeach ++if not have_mtls_dialect ++ # need .run to check libc support. meson aborts when calling .run when ++ # cross-compiling, but because this is just an optimization we can skip it ++ if meson.is_cross_build() and not meson.can_run_host_binaries() ++ warning('cannot auto-detect -mtls-dialect when cross-compiling, using compiler default') ++ elif host_machine.system() == 'freebsd' ++ warning('cannot use -mtls-dialect for FreeBSD, using compiler default') ++ else ++ # The way to specify the TLSDESC dialect is architecture-specific. ++ # We probe both because there is not a fallback guaranteed to work for all ++ # future architectures. ++ foreach tlsdesc_arg : ['-mtls-dialect=gnu2', '-mtls-dialect=desc'] ++ # -fpic to force dynamic tls, otherwise TLS relaxation defeats check ++ tlsdesc_test = cc.run('int __thread x; int main() { return x; }', ++ args: [tlsdesc_arg, '-fpic'], ++ name: tlsdesc_arg) ++ if tlsdesc_test.returncode() == 0 and ( ++ # check for lld 13 bug: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5665 ++ host_machine.cpu_family() != 'x86_64' or ++ # get_linker_id misses LDFLAGS=-fuse-ld=lld: https://github.com/mesonbuild/meson/issues/6377 ++ #cc.get_linker_id() != 'ld.lld' or ++ cc.links('''int __thread x; int y; int main() { __asm__( ++ "leaq x@TLSDESC(%rip), %rax\n" ++ "movq y@GOTPCREL(%rip), %rdx\n" ++ "call *x@TLSCALL(%rax)\n"); }''', name: 'split TLSDESC') ++ ) ++ c_cpp_args += tlsdesc_arg ++ break ++ endif ++ endforeach ++ endif ++endif ++ ++if with_glx != 'disabled' ++ if not (with_platform_x11 and with_any_opengl) ++ error('Cannot build GLX support without X11 platform support and at least one OpenGL API') ++ elif with_glx == 'xlib' ++ if not with_gallium ++ error('xlib based GLX requires at least one gallium driver') ++ elif not with_gallium_swrast ++ error('xlib based GLX requires softpipe or llvmpipe.') ++ elif with_dri ++ error('xlib conflicts with any dri driver') ++ endif ++ endif ++endif ++ ++_glvnd = get_option('glvnd') \ ++ .require(not with_platform_windows, ++ error_message: 'glvnd cannot be used on Windows') \ ++ .require(with_glx != 'xlib', ++ error_message: 'Cannot build glvnd support for GLX that is not DRI based.') \ ++ .require(with_glx != 'disabled' or with_egl, ++ error_message: 'glvnd requires DRI based GLX and/or EGL') \ ++ .require(get_option('egl-lib-suffix') == '', ++ error_message: '''EGL lib suffix can't be used with libglvnd''') ++dep_glvnd = dependency('libglvnd', version : '>= 1.3.2', required : _glvnd) ++with_glvnd = dep_glvnd.found() ++pre_args += '-DUSE_LIBGLVND=@0@'.format(with_glvnd.to_int()) ++glvnd_vendor_name = get_option('glvnd-vendor-name') ++ ++if with_vulkan_icd_dir == '' ++ with_vulkan_icd_dir = join_paths(get_option('datadir'), 'vulkan/icd.d') ++endif ++ ++with_dri2 = (with_dri or with_any_vk) and (with_dri_platform == 'drm' or with_dri_platform == 'apple') ++ ++if with_dri ++ if with_glx == 'disabled' and not with_egl and not with_gbm ++ error('building dri drivers require at least one windowing system') ++ endif ++endif ++ ++dep_dxheaders = null_dep ++if with_gallium_d3d12 or with_microsoft_clc or with_microsoft_vk or with_gfxstream_vk and host_machine.system() == 'windows' ++ dep_dxheaders = dependency('directx-headers', required : false) ++ if not dep_dxheaders.found() ++ dep_dxheaders = dependency('DirectX-Headers', ++ version : '>= 1.618.1', ++ fallback : ['DirectX-Headers', 'dep_dxheaders'], ++ required : with_gallium_d3d12 or with_microsoft_vk ++ ) ++ endif ++endif ++ ++if dep_dxheaders.found() ++ if (dep_dxheaders.version().version_compare('>= 1.700.0')) ++ pre_args += '-DUSE_D3D12_PREVIEW_HEADERS=1' ++ else ++ pre_args += '-DUSE_D3D12_PREVIEW_HEADERS=0' ++ endif ++endif ++ ++_with_gallium_d3d12_video = get_option('gallium-d3d12-video') ++with_gallium_d3d12_video = false ++if with_gallium_d3d12 and not _with_gallium_d3d12_video.disabled() ++ with_gallium_d3d12_video = true ++ pre_args += '-DHAVE_GALLIUM_D3D12_VIDEO' ++endif ++ ++with_bvh = with_amd_vk or with_intel_vk or with_swrast_vk or with_freedreno_vk ++_glslang_preamble_version = '12.2' ++ ++# GLSL has interesting version output and Meson doesn't parse it correctly as of ++# Meson 1.4.0 ++prog_glslang = find_program( ++ 'glslangValidator', ++ native : true, ++ required : with_vulkan_overlay_layer or with_aco_tests or with_bvh ++) ++ ++if prog_glslang.found() ++ _glslang_version = run_command(prog_glslang, ['--version'], check : false).stdout().split(':')[2] ++ # Check if glslang has depfile support. Support was added in 11.3.0, but ++ # Windows path support was broken until 11.9.0. ++ # ++ # It is intentional to check the build machine, since we need to ensure that ++ # glslang will output valid paths on the build platform ++ _glslang_check = build_machine.system() == 'windows' ? '>= 11.9.0' : '>= 11.3.0' ++ if _glslang_version.version_compare(_glslang_check) ++ glslang_depfile = ['--depfile', '@DEPFILE@'] ++ else ++ glslang_depfile = [] ++ endif ++ if with_bvh and _glslang_version.version_compare('< ' + _glslang_preamble_version) ++ error('glslang >= ' + _glslang_preamble_version + ' is required.') ++ endif ++ if run_command(prog_glslang, [ '--quiet', '--version' ], check : false).returncode() == 0 ++ glslang_quiet = ['--quiet'] ++ else ++ glslang_quiet = [] ++ endif ++endif ++ ++_va_drivers = [ ++ with_gallium_d3d12_video, ++ with_gallium_nouveau, ++ with_gallium_r600, ++ with_gallium_radeonsi, ++ with_gallium_virgl, ++] ++ ++_va = get_option('gallium-va') \ ++ .require(_va_drivers.contains(true), ++ error_message : 'VA state tracker requires at least one of the following gallium drivers: r600, radeonsi, nouveau, d3d12 (with option gallium-d3d12-video), virgl.') ++_dep_va_name = host_machine.system() == 'windows' ? 'libva-win32' : 'libva' ++dep_va = dependency(_dep_va_name, version : '>= 1.8.0', required : _va) ++if dep_va.found() ++ dep_va_headers = dep_va.partial_dependency(compile_args : true) ++ if cc.has_header_symbol('va/va.h', 'VASurfaceAttribDRMFormatModifiers', ++ dependencies: dep_va_headers) ++ pre_args += '-DHAVE_VA_SURFACE_ATTRIB_DRM_FORMAT_MODIFIERS' ++ endif ++endif ++with_gallium_va = dep_va.found() ++ ++va_drivers_path = get_option('va-libs-path') ++if va_drivers_path == '' ++ va_drivers_path = join_paths(get_option('libdir'), 'dri') ++endif ++ ++_mediafoundation_drivers = [ ++ with_gallium_d3d12_video, ++] ++ ++with_gallium_mediafoundation = get_option('gallium-mediafoundation') \ ++ .require(host_machine.system() == 'windows', error_message : 'mediafoundation only supported on Windows') \ ++ .require(_mediafoundation_drivers.contains(true), ++ error_message : 'Media foundation state tracker requires at least one of the following gallium drivers: d3d12 (with option gallium-d3d12-video).') \ ++ .enabled() ++ ++with_gallium_mediafoundation_test = get_option('gallium-mediafoundation-test') ++if with_gallium_mediafoundation_test ++ if not with_gallium_mediafoundation ++ error('The mediafoundation test requires mediafoundation.') ++ endif ++endif ++ ++d3d_drivers_path = get_option('d3d-drivers-path') ++if d3d_drivers_path == '' ++ d3d_drivers_path = join_paths(get_option('prefix'), get_option('libdir'), 'd3d') ++endif ++ ++with_gallium_st_d3d10umd = get_option('gallium-d3d10umd') ++if with_gallium_st_d3d10umd ++ if not with_gallium_swrast ++ error('The d3d10umd state tracker requires gallium softpipe/llvmpipe.') ++ endif ++endif ++ ++if host_machine.cpu_family() == 'ppc64' and host_machine.endian() == 'little' ++ if cc.compiles(''' ++ #include ++ int main() { ++ vector unsigned char r; ++ vector unsigned int v = vec_splat_u32 (1); ++ r = __builtin_vec_vgbbd ((vector unsigned char) v); ++ return 0; ++ }''', ++ name : 'POWER8 intrinsics') ++ pre_args += ['-D_ARCH_PWR8'] ++ endif ++endif ++ ++if get_option('vmware-mks-stats') ++ if not with_gallium_svga ++ error('vmware-mks-stats requires gallium VMware/svga driver.') ++ endif ++ pre_args += '-DVMX86_STATS=1' ++endif ++ ++_rtti = get_option('cpp_rtti') ++ ++with_gallium_rusticl = get_option('gallium-rusticl') ++if with_gallium_rusticl ++ if not with_gallium ++ error('rusticl requires at least one gallium driver.') ++ endif ++endif ++ ++with_virtgpu_kumquat = get_option('virtgpu_kumquat') and with_gfxstream_vk ++if with_gallium_rusticl or with_nouveau_vk or with_tools.contains('etnaviv') or with_virtgpu_kumquat ++ # rust.bindgen() does not pass `--rust-target` to bindgen until 1.7.0. ++ if meson.version().version_compare('< 1.7.0') ++ error('Mesa Rust support requires Meson 1.7.0 or newer') ++ endif ++ ++ add_languages('rust', required: true) ++ rustc = meson.get_compiler('rust') ++ rust = import('rust') ++ ++ # Keep this in sync with the MINIMUM_SUPPORTED_RUST_VERSION in ++ # .gitlab-ci/container/build-rust.sh and the `rustup default` line in ++ # .gitlab-ci/meson/build.sh ++ if rustc.version().version_compare('< 1.82') ++ error('Mesa requires Rust 1.82.0 or newer') ++ endif ++ ++ # bindgen 0.71 is the first version that knows about `editions` ++ bindgen_version = find_program('bindgen').version() ++ # unknown covers buggy 0.69.0, 0.71.0 ++ if bindgen_version == 'unknown' or bindgen_version.version_compare('< 0.71.1') ++ error('Mesa requires bindgen 0.71.1 or newer. ' + ++ 'If your distribution does not ship a recent enough version, ' + ++ 'you can install the latest version for your user with `cargo install bindgen-cli`.') ++ endif ++ ++ bindgen_output_args = [ ++ # This is needed to generate 2024-safe code ++ '--wrap-unsafe-ops', ++ # can't do anything about it anyway ++ '--raw-line', '#![allow(clippy::all)]', ++ '--raw-line', '#![allow(improper_ctypes)]', ++ # Some bindgen versions assume `unsafe_op_in_unsafe_fn` ++ '--raw-line', '#![allow(unused_unsafe)]', ++ '--raw-line', '#![allow(non_camel_case_types)]', ++ '--raw-line', '#![allow(non_snake_case)]', ++ '--raw-line', '#![allow(non_upper_case_globals)]', ++ # This is fixed in 0.72 but we don't have that in CI yet ++ '--raw-line', '#![allow(unsafe_op_in_unsafe_fn)]', ++ ] ++ if rustc.version().version_compare('>= 1.88') ++ bindgen_output_args += ['--raw-line', '#![allow(unnecessary_transmutes)]'] ++ endif ++ ++ rust_2024_lint_args = [ ++ '-Dboxed_slice_into_iter', ++ '-Ddeprecated_safe_2024', ++ '-Dimpl_trait_overcaptures', ++ '-Dkeyword_idents_2024', ++ '-Dmissing_unsafe_on_extern', ++ '-Dnever_type_fallback_flowing_into_unsafe', ++ '-Drust_2024_prelude_collisions', ++ '-Dstatic_mut_refs', ++ '-Dunsafe_op_in_unsafe_fn', ++ ++ # This requires cbindgen >= 0.28 ++ # '-Dunsafe_attr_outside_unsafe', ++ ++ # 1.83+ ++ # '-Dif_let_rescope', ++ # '-Drust_2024_guarded_string_incompatible_syntax', ++ # '-Drust_2024_incompatible_pat', ++ ] ++endif ++ ++if get_option('precomp-compiler') != 'system' ++ with_drivers_clc = get_option('precomp-compiler') == 'enabled' ++else ++ with_drivers_clc = false ++endif ++ ++with_driver_using_cl = [ ++ with_gallium_iris, with_intel_vk, ++ with_gallium_asahi, with_asahi_vk, with_tools.contains('asahi'), ++ with_gallium_panfrost, with_panfrost_vk, ++ with_nouveau_vk, with_imagination_vk, ++].contains(true) ++ ++if get_option('mesa-clc') == 'system' ++ prog_mesa_clc = find_program('mesa_clc', native : true) ++ prog_vtn_bindgen2 = find_program('vtn_bindgen2', native : true) ++ # Even with mesa-clc already built, rusticl still needs clc. ++ with_clc = with_gallium_rusticl ++else ++ with_clc = get_option('mesa-clc') != 'auto' or \ ++ with_microsoft_clc or with_gallium_rusticl or \ ++ with_drivers_clc or with_driver_using_cl ++endif ++ ++with_llvm = with_llvm \ ++ .enable_if(with_clc, error_message : 'CLC requires LLVM') ++ ++dep_clc = null_dep ++if with_clc ++ dep_clc = dependency('libclc') ++endif ++ ++gl_pkgconfig_c_flags = [] ++with_glx_indirect_rendering = false ++if with_platform_x11 ++ if with_glx == 'xlib' ++ pre_args += '-DUSE_XSHM' ++ else ++ with_glx_indirect_rendering = true ++ pre_args += '-DGLX_INDIRECT_RENDERING' ++ if with_glx_direct ++ pre_args += '-DGLX_DIRECT_RENDERING' ++ endif ++ if with_dri_platform == 'drm' ++ pre_args += '-DGLX_USE_DRM' ++ elif with_dri_platform == 'apple' ++ pre_args += '-DGLX_USE_APPLEGL' ++ # Check to see if more than just the default 'swrast' is required ++ if (not with_gallium_softpipe) or 1 < gallium_drivers.length() ++ # Switch the MacOS code from "forwarding to the OpenGL.framework" mode ++ # and into actual Gallium Driver mode ++ pre_args += '-DGLX_USE_APPLE' ++ endif ++ elif with_dri_platform == 'windows' ++ pre_args += '-DGLX_USE_WINDOWSGL' ++ endif ++ endif ++endif ++ ++with_glapi_export_proto_entry_points = false ++if not with_glx_indirect_rendering ++ # Imply !defined(GLX_INDIRECT_RENDERING) ++ with_glapi_export_proto_entry_points = true ++endif ++pre_args += '-DGLAPI_EXPORT_PROTO_ENTRY_POINTS=@0@'.format(with_glapi_export_proto_entry_points.to_int()) ++ ++with_android_stub = get_option('android-stub') ++if with_android_stub and not with_platform_android ++ error('`-D android-stub=true` makes no sense without `-D platforms=android`') ++endif ++ ++with_libbacktrace = get_option('android-libbacktrace') \ ++ .require(with_platform_android, error_message : '`-D android-libbacktrace=enabled` makes no sense without `-D platforms=android`') \ ++ .disable_auto_if(not with_platform_android) \ ++ .allowed() ++ ++if with_platform_android ++ dep_android_ui = null_dep ++ dep_android_mapper4 = null_dep ++ if not with_android_stub ++ dep_android = [ ++ dependency('cutils'), ++ dependency('hardware'), ++ dependency('log'), ++ dependency('sync'), ++ ] ++ if with_libbacktrace and get_option('platform-sdk-version') < 34 ++ cpp_args += '-DWITH_LIBBACKTRACE' ++ dep_android += dependency('backtrace') ++ endif ++ if get_option('platform-sdk-version') >= 26 ++ dep_android += dependency('nativewindow') ++ endif ++ if get_option('platform-sdk-version') >= 30 ++ dep_android_mapper4 = dependency('android.hardware.graphics.mapper', version : '>= 4.0', required : false) ++ endif ++ if get_option('platform-sdk-version') >= 35 ++ dep_android_ui = dependency('ui', required : false) ++ endif ++ endif ++ pre_args += '-DANDROID_API_LEVEL=' + get_option('platform-sdk-version').to_string() ++ if get_option('android-strict') ++ pre_args += '-DANDROID_STRICT' ++ endif ++endif ++ ++# On Android, seccomp kills the process on kernels without ++# CONFIG_KCMP/CONFIG_CHECKPOINT_RESTORE if it attemps to use KCMP. ++# Since we can't detect that, err on the side of caution and disable ++# KCMP by default on Android. ++if get_option('allow-kcmp') \ ++ .disable_auto_if(with_platform_android) \ ++ .allowed() ++ pre_args += '-DALLOW_KCMP' ++endif ++ ++# On Windows, a venv has no versioned aliased to 'python'. ++prog_python = find_program('python3', 'python', version : '>= 3.9') ++ ++has_mako = run_command( ++ prog_python, '-c', ++ ''' ++import sys ++ ++try: ++ try: ++ from packaging.version import Version ++ except: ++ from distutils.version import StrictVersion as Version ++except: ++ sys.exit(2) ++ ++try: ++ import mako ++except: ++ sys.exit(1) ++ ++if Version(mako.__version__) < Version("0.8.0"): ++ sys.exit(1) ++''', check: false) ++ ++if has_mako.returncode() == 1 ++ error('Python (3.x) mako module >= 0.8.0 required to build mesa.') ++elif has_mako.returncode() == 2 ++ error('One of Python (3.x) packaging or distutils module is required.') ++endif ++ ++has_yaml = run_command( ++ prog_python, '-c', ++ ''' ++import yaml ++ ''', check: false) ++if has_yaml.returncode() != 0 ++ error('Python (3.x) yaml module (PyYAML) required to build mesa.') ++endif ++ ++if cc.get_id() == 'gcc' and cc.version().version_compare('< 4.4.6') ++ error('When using GCC, version 4.4.6 or later is required.') ++endif ++ ++# Support systems without ETIME (e.g. FreeBSD) ++if cc.get_define('ETIME', prefix : '#include ') == '' ++ pre_args += '-DETIME=ETIMEDOUT' ++endif ++ ++# Define MESA_DEBUG to 1 for debug builds only (debugoptimized is not included on this one); ++# otherwise define MESA_DEBUG to 0 ++pre_args += '-DMESA_DEBUG=@0@'.format(with_mesa_debug.to_int()) ++ ++with_split_debug = get_option('split-debug') \ ++ .disable_if(not cc.has_argument('-gsplit-dwarf'), ++ error_message : 'split-debug requires compiler -gsplit-dwarf support') \ ++ .disable_if(not cc.has_link_argument('-Wl,--gdb-index'), ++ error_message : 'split-debug requires the linker argument -Wl,--gdb-index') ++ ++if with_split_debug.allowed() and get_option('debug') ++ add_project_arguments('-gsplit-dwarf', language : ['c', 'cpp']) ++ add_project_link_arguments('-Wl,--gdb-index', language : ['c', 'cpp']) ++endif ++ ++with_shader_cache = get_option('shader-cache') \ ++ .require(host_machine.system() != 'windows', error_message : 'Shader Cache does not currently work on Windows') \ ++ .allowed() ++ ++if with_shader_cache ++ pre_args += '-DENABLE_SHADER_CACHE' ++ if not get_option('shader-cache-default') ++ pre_args += '-DSHADER_CACHE_DISABLE_BY_DEFAULT' ++ endif ++ ++ shader_cache_max_size = get_option('shader-cache-max-size') ++ if shader_cache_max_size != '' ++ pre_args += '-DMESA_SHADER_CACHE_MAX_SIZE="@0@"'.format(shader_cache_max_size) ++ endif ++endif ++ ++# Check for GCC style builtins ++foreach b : ['bswap32', 'bswap64', 'clz', 'clzll', 'ctz', 'expect', 'ffs', ++ 'ffsll', 'popcount', 'popcountll', 'unreachable', 'types_compatible_p'] ++ if cc.has_function(b) ++ pre_args += '-DHAVE___BUILTIN_@0@'.format(b.to_upper()) ++ endif ++endforeach ++ ++# Check for GCC overflow intrinsics ++foreach b : ['add_overflow', 'add_overflow_p', 'sub_overflow_p'] ++ if cc.has_function('__builtin_' + b) ++ pre_args += '-DHAVE___BUILTIN_@0@'.format(b.to_upper()) ++ endif ++endforeach ++ ++# check for GCC __attribute__ ++_attributes = [ ++ 'const', 'flatten', 'malloc', 'pure', 'unused', 'warn_unused_result', ++ 'weak', 'format', 'packed', 'returns_nonnull', 'alias', 'noreturn', ++ 'optimize', 'cold', ++] ++foreach a : cc.get_supported_function_attributes(_attributes) ++ pre_args += '-DHAVE_FUNC_ATTRIBUTE_@0@'.format(a.to_upper()) ++endforeach ++if cc.has_function_attribute('visibility:hidden') ++ pre_args += '-DHAVE_FUNC_ATTRIBUTE_VISIBILITY' ++endif ++ ++_no_sanitize_flags = [] ++if get_option('b_sanitize').split(',').contains('address') ++ _no_sanitize_flags += ['address'] ++endif ++if get_option('b_sanitize').split(',').contains('undefined') ++ _no_sanitize_flags += ['vptr'] ++endif ++foreach flag: _no_sanitize_flags ++ if cc.compiles('__attribute__((no_sanitize("@0@"))) int foo(void) { return 0; }'.format(flag), ++ name : 'no_sanitize(@0@)'.format(flag), ++ werror: true) ++ pre_args += '-DHAVE_FUNC_ATTRIBUTE_NO_SANITIZE_@0@'.format(flag.to_upper()) ++ endif ++endforeach ++ ++if cc.compiles('__uint128_t foo(void) { return 0; }', ++ name : '__uint128_t') ++ pre_args += '-DHAVE_UINT128' ++endif ++ ++if cc.has_function('reallocarray') ++ pre_args += '-DHAVE_REALLOCARRAY' ++endif ++if cc.has_function('fmemopen') ++ pre_args += '-DHAVE_FMEMOPEN' ++endif ++ ++# TODO: this is very incomplete ++if ['linux', 'cygwin', 'gnu', 'freebsd', 'gnu/kfreebsd', 'haiku', 'android', 'managarm'].contains(host_machine.system()) ++ pre_args += '-D_GNU_SOURCE' ++elif host_machine.system() == 'sunos' ++ pre_args += '-D__EXTENSIONS__' ++elif host_machine.system() == 'windows' ++ pre_args += [ ++ '-D_WIN32_WINNT=0x0A00', ++ '-DWINVER=0x0A00', ++ ] ++ if cc.get_argument_syntax() == 'msvc' ++ pre_args += [ ++ '-D_USE_MATH_DEFINES', ++ '-D_CRT_NONSTDC_NO_DEPRECATE', ++ '-D_CRT_SECURE_NO_WARNINGS', ++ '-D_CRT_SECURE_NO_DEPRECATE', ++ '-D_SCL_SECURE_NO_WARNINGS', ++ '-D_SCL_SECURE_NO_DEPRECATE', ++ '-D_ALLOW_KEYWORD_MACROS', ++ '-D_HAS_EXCEPTIONS=0', # Tell C++ STL to not use exceptions ++ '-DNOMINMAX', ++ '-D_UCRT_NOISY_NAN', # https://developercommunity.visualstudio.com/t/NAN-is-no-longer-compile-time-constant-i/10688907?viewtype=all ++ ] ++ else ++ # MINGW also accept _GNU_SOURCE ++ pre_args += '-D_GNU_SOURCE' ++ ++ # When the target is not (mingw with ucrt) ++ # NOTE: clang's stddef.h are conflict with mingw or ucrt's stddef.h ++ # So do not include headers that defined in clang for detecting ++ # _UCRT ++ if cc.compiles(''' ++ #include ++ #if defined(__MINGW32__) && defined(_UCRT) ++ #error ++ #endif ++ int main(void) { return 0; }''') ++ pre_args += ['-D__MSVCRT_VERSION__=0x0700'] ++ endif ++ endif ++elif host_machine.system() == 'openbsd' ++ pre_args += '-D_ISOC11_SOURCE' ++endif ++ ++# Check for generic C arguments ++c_msvc_compat_args = [] ++no_override_init_args = [] ++cpp_msvc_compat_args = [] ++ld_args_gc_sections = [] ++if cc.get_argument_syntax() == 'msvc' ++ _trial = [ ++ '/wd4018', # signed/unsigned mismatch ++ '/wd4056', # overflow in floating-point constant arithmetic ++ '/wd4244', # conversion from 'type1' to 'type2', possible loss of data ++ '/wd4267', # 'var' : conversion from 'size_t' to 'type', possible loss of data ++ '/wd4305', # truncation from 'type1' to 'type2' ++ '/wd4351', # new behavior: elements of array 'array' will be default initialized ++ '/wd4756', # overflow in constant arithmetic ++ '/wd4800', # forcing value to bool 'true' or 'false' (performance warning) ++ '/wd4291', # no matching operator delete found ++ '/wd4146', # unary minus operator applied to unsigned type, result still unsigned ++ '/wd4200', # nonstandard extension used: zero-sized array in struct/union ++ '/wd4624', # destructor was implicitly defined as deleted [from LLVM] ++ '/wd4309', # 'initializing': truncation of constant value ++ '/wd4838', # conversion from 'int' to 'const char' requires a narrowing conversion ++ '/wd5105', # macro expansion producing 'defined' has undefined behavior (winbase.h, need Windows SDK upgrade) ++ '/we4020', # Error when passing the wrong number of parameters ++ '/we4024', # Error when passing different type of parameter ++ '/we4189', # 'identifier' : local variable is initialized but not referenced ++ '/Zc:__cplusplus', #Set __cplusplus macro to match the /std:c++ on the command line ++ '/Zc:preprocessor', # Use the standards-conforming preprocessor ++ ] ++ c_args += cc.get_supported_arguments(_trial) ++ cpp_args += cpp.get_supported_arguments(_trial) ++else ++ _trial_c = [ ++ '-Werror=implicit-function-declaration', ++ '-Werror=missing-prototypes', ++ '-Werror=return-type', ++ '-Werror=empty-body', ++ '-Werror=incompatible-pointer-types', ++ '-Werror=int-conversion', ++ '-Wimplicit-fallthrough', ++ '-Wmisleading-indentation', ++ '-Wno-error=maybe-uninitialized', ++ '-Wno-missing-field-initializers', ++ '-Wno-format-truncation', ++ '-Wno-nonnull-compare', ++ '-fno-math-errno', ++ '-fno-trapping-math', ++ '-Qunused-arguments', ++ '-fno-common', ++ '-Wno-unknown-pragmas', ++ # Clang ++ '-Wno-microsoft-enum-value', ++ '-Wno-unused-function', ++ ] ++ _trial_cpp = [ ++ '-Werror=return-type', ++ '-Werror=empty-body', ++ '-Wmisleading-indentation', ++ '-Wno-error=maybe-uninitialized', ++ '-Wno-non-virtual-dtor', ++ '-Wno-missing-field-initializers', ++ '-Wno-format-truncation', ++ '-fno-math-errno', ++ '-fno-trapping-math', ++ '-Qunused-arguments', ++ # Some classes use custom new operator which zeroes memory, however ++ # gcc does aggressive dead-store elimination which threats all writes ++ # to the memory before the constructor as "dead stores". ++ # For now we disable this optimization. ++ '-flifetime-dse=1', ++ '-Wno-unknown-pragmas', ++ # Clang ++ '-Wno-microsoft-enum-value', ++ ] ++ ++ # MinGW chokes on format specifiers and I can't get it all working ++ if not (cc.get_argument_syntax() == 'gcc' and host_machine.system() == 'windows') ++ _trial_c += ['-Werror=format', '-Wformat-security'] ++ _trial_cpp += ['-Werror=format', '-Wformat-security'] ++ endif ++ ++ # FreeBSD annotated but Mesa isn't ready ++ if not (cc.get_id() == 'clang' and host_machine.system() == 'freebsd') ++ _trial_c += ['-Werror=thread-safety'] ++ endif ++ ++ # If the compiler supports it, put function and data symbols in their ++ # own sections and GC the sections after linking. This lets drivers ++ # drop shared code unused by that specific driver (particularly ++ # relevant for Vulkan drivers). ++ if cc.links('static char unused() { return 5; } int main() { return 0; }', ++ args : '-Wl,--gc-sections', name : 'gc-sections') ++ ld_args_gc_sections += '-Wl,--gc-sections' ++ _trial_c += ['-ffunction-sections', '-fdata-sections'] ++ _trial_cpp += ['-ffunction-sections', '-fdata-sections'] ++ endif ++ ++ # Variables that are only used for assertions are considered unused when assertions ++ # are disabled. Don't treat this as an error, since we build with -Werror even if ++ # assertions are disabled. ++ if with_mesa_ndebug ++ _trial_c += ['-Wno-unused-variable', '-Wno-unused-but-set-variable', '/wd4189'] ++ _trial_cpp += ['-Wno-unused-variable', '-Wno-unused-but-set-variable', '/wd4189'] ++ endif ++ ++ c_args += cc.get_supported_arguments(_trial_c) ++ cpp_args += cpp.get_supported_arguments(_trial_cpp) ++ ++ no_override_init_args += cc.get_supported_arguments( ++ ['-Wno-override-init', '-Wno-initializer-overrides'] ++ ) ++ ++ # Check for C and C++ arguments for MSVC compatibility. These are only used ++ # in parts of the mesa code base that need to compile with MSVC, mainly ++ # common code ++ _trial_msvc = ['-Werror=pointer-arith', '-Werror=vla', '-Werror=gnu-empty-initializer'] ++ c_msvc_compat_args += cc.get_supported_arguments(_trial_msvc) ++ cpp_msvc_compat_args += cpp.get_supported_arguments(_trial_msvc) ++endif ++ ++# set linker arguments ++if host_machine.system() == 'windows' ++ if cc.get_argument_syntax() == 'msvc' ++ add_project_link_arguments( ++ '/fixed:no', ++ '/dynamicbase', ++ '/nxcompat', ++ language : ['c', 'cpp'], ++ ) ++ if get_option('buildtype') != 'debug' ++ add_project_link_arguments( ++ '/incremental:no', ++ language : ['c', 'cpp'], ++ ) ++ endif ++ else ++ add_project_link_arguments( ++ cc.get_supported_link_arguments( ++ '-Wl,--nxcompat', ++ '-Wl,--dynamicbase', ++ '-static-libgcc', ++ '-static-libstdc++', ++ ), ++ language : ['c'], ++ ) ++ add_project_link_arguments( ++ cpp.get_supported_link_arguments( ++ '-Wl,--nxcompat', ++ '-Wl,--dynamicbase', ++ '-static-libgcc', ++ '-static-libstdc++', ++ ), ++ language : ['cpp'], ++ ) ++ endif ++endif ++ ++sse2_arg = [] ++sse2_args = [] ++sse41_args = [] ++with_sse41 = false ++if host_machine.cpu_family().startswith('x86') ++ pre_args += '-DUSE_SSE41' ++ with_sse41 = true ++ ++ if cc.get_id() != 'msvc' ++ sse41_args = ['-msse4.1'] ++ ++ if host_machine.cpu_family() == 'x86' ++ # x86_64 have sse2 by default, so sse2 args only for x86 ++ sse2_arg = ['-msse2', '-mfpmath=sse'] ++ sse2_args = [sse2_arg, '-mstackrealign'] ++ if get_option('sse2') ++ # These settings make generated GCC code match MSVC and follow ++ # GCC advice on https://gcc.gnu.org/wiki/FloatingPointMath#x86note ++ # ++ # NOTE: We need to ensure stack is realigned given that we ++ # produce shared objects, and have no control over the stack ++ # alignment policy of the application. Therefore we need ++ # -mstackrealign or -mincoming-stack-boundary=2. ++ # ++ # XXX: We could have SSE without -mstackrealign if we always used ++ # __attribute__((force_align_arg_pointer)), but that's not ++ # always the case. ++ c_cpp_args += sse2_args ++ # sse2_args are adopted into c_cpp_args to avoid duplicated sse2 command line args ++ sse2_arg = [] ++ sse2_args = [] ++ else ++ # GCC on x86 (not x86_64) with -msse* assumes a 16 byte aligned stack, but ++ # that's not guaranteed ++ sse41_args += '-mstackrealign' ++ endif ++ endif ++ endif ++endif ++ ++# Detect __builtin_ia32_clflushopt support ++if cc.has_function('__builtin_ia32_clflushopt', args : '-mclflushopt') ++ pre_args += '-DHAVE___BUILTIN_IA32_CLFLUSHOPT' ++ clflushopt_args = ['-mclflushopt'] ++ with_clflushopt = true ++else ++ clflushopt_args = [] ++ with_clflushopt = false ++endif ++ ++# Check for GCC style atomics ++dep_atomic = null_dep ++ ++if cc.compiles('''#include ++ int main() { ++ struct { ++ uint64_t *v; ++ } x; ++ return (int)__atomic_load_n(x.v, __ATOMIC_ACQUIRE) & ++ (int)__atomic_add_fetch(x.v, (uint64_t)1, __ATOMIC_ACQ_REL); ++ ++ }''', ++ name : 'GCC atomic builtins') ++ pre_args += '-DUSE_GCC_ATOMIC_BUILTINS' ++ ++ # Not all atomic calls can be turned into lock-free instructions, in which ++ # GCC will make calls into the libatomic library. Check whether we need to ++ # link with -latomic. ++ # ++ # This can happen for 64-bit atomic operations on 32-bit architectures such ++ # as ARM. ++ if not cc.links('''#include ++ int main() { ++ struct { ++ uint64_t *v; ++ } x; ++ return (int)__atomic_load_n(x.v, __ATOMIC_ACQUIRE) & ++ (int)__atomic_add_fetch(x.v, (uint64_t)1, __ATOMIC_ACQ_REL); ++ }''', ++ name : 'GCC atomic builtins required -latomic') ++ dep_atomic = cc.find_library('atomic') ++ endif ++endif ++if not cc.links('''#include ++ uint64_t v; ++ int main() { ++ return __sync_add_and_fetch(&v, (uint64_t)1); ++ }''', ++ dependencies : dep_atomic, ++ name : 'GCC 64bit atomics') ++ pre_args += '-DMISSING_64BIT_ATOMICS' ++endif ++ ++dep_ws2_32 = cc.find_library('ws2_32', required : with_platform_windows) ++ ++# Check for standard headers and functions ++if (cc.has_header_symbol('sys/sysmacros.h', 'major') and ++ cc.has_header_symbol('sys/sysmacros.h', 'minor') and ++ cc.has_header_symbol('sys/sysmacros.h', 'makedev')) ++ pre_args += '-DMAJOR_IN_SYSMACROS' ++endif ++if (cc.has_header_symbol('sys/mkdev.h', 'major') and ++ cc.has_header_symbol('sys/mkdev.h', 'minor') and ++ cc.has_header_symbol('sys/mkdev.h', 'makedev')) ++ pre_args += '-DMAJOR_IN_MKDEV' ++endif ++ ++if cc.check_header('sched.h') ++ pre_args += '-DHAS_SCHED_H' ++ if cc.has_function('sched_getaffinity') ++ pre_args += '-DHAS_SCHED_GETAFFINITY' ++ endif ++endif ++ ++if not ['linux'].contains(host_machine.system()) ++ # Deprecated on Linux and requires on FreeBSD and OpenBSD ++ if cc.check_header('sys/sysctl.h', prefix : '#include ') ++ pre_args += '-DHAVE_SYS_SYSCTL_H' ++ endif ++endif ++ ++foreach h : ['xlocale.h', 'linux/futex.h', 'endian.h', 'dlfcn.h', 'sys/shm.h', ++ 'cet.h', 'pthread_np.h', 'sys/inotify.h', 'linux/udmabuf.h'] ++ if cc.check_header(h) ++ pre_args += '-DHAVE_@0@'.format(h.to_upper().underscorify()) ++ endif ++endforeach ++ ++functions_to_detect = { ++ 'strtof': '', ++ 'mkostemp': '', ++ 'memfd_create': '#include ', ++ 'random_r': '', ++ 'flock': '', ++ 'strtok_r': '', ++ 'getrandom': '#include ', ++ 'qsort_s': '', ++ 'posix_fallocate': '', ++ 'secure_getenv': '', ++ 'sysconf': '#include ', ++} ++ ++foreach f, prefix: functions_to_detect ++ if cc.has_function(f, args: pre_args, prefix: prefix) ++ pre_args += '-DHAVE_@0@'.format(f.to_upper()) ++ endif ++endforeach ++ ++if cpp.links(''' ++ #define _GNU_SOURCE ++ #include ++ ++ static int dcomp(const void *l, const void *r, void *t) { return 0; } ++ ++ int main(int ac, char **av) { ++ int arr[] = { 1 }; ++ void *t = NULL; ++ qsort_r((void*)&arr[0], 1, 1, dcomp, t); ++ return (0); ++ }''', ++ args : pre_args, ++ name : 'GNU qsort_r') ++ pre_args += '-DHAVE_GNU_QSORT_R' ++elif cpp.links(''' ++ #include ++ ++ static int dcomp(void *t, const void *l, const void *r) { return 0; } ++ ++ int main(int ac, char **av) { ++ int arr[] = { 1 }; ++ void *t = NULL; ++ qsort_r((void*)&arr[0], 1, 1, t, dcomp); ++ return (0); ++ }''', ++ args : pre_args, ++ name : 'BSD qsort_r') ++ pre_args += '-DHAVE_BSD_QSORT_R' ++endif ++ ++if cc.has_header_symbol('time.h', 'struct timespec') ++ pre_args += '-DHAVE_STRUCT_TIMESPEC' ++endif ++ ++with_c11_threads = false ++if cc.has_function('thrd_create', prefix: '#include ') ++ if with_platform_android ++ # Current only Android's c11 are verified ++ pre_args += '-DHAVE_THRD_CREATE' ++ with_c11_threads = true ++ endif ++endif ++ ++if cc.has_header_symbol('errno.h', 'program_invocation_name', ++ args : '-D_GNU_SOURCE') ++ pre_args += '-DHAVE_PROGRAM_INVOCATION_NAME' ++elif with_tools.contains('intel') ++ error('Intel tools require the program_invocation_name variable') ++endif ++ ++if cc.has_header_symbol('math.h', 'issignaling', ++ args : '-D_GNU_SOURCE') ++ pre_args += '-DHAVE_ISSIGNALING' ++endif ++ ++# MinGW provides a __builtin_posix_memalign function, but not a posix_memalign. ++# This means that this check will succeed, but then compilation will later ++# fail. MSVC doesn't have this function at all, so only check for it on ++# non-windows platforms. ++if host_machine.system() != 'windows' ++ if cc.has_function('posix_memalign') ++ pre_args += '-DHAVE_POSIX_MEMALIGN' ++ endif ++endif ++ ++if cc.has_member('struct dirent', 'd_type', prefix: '''#include ++ #include ''') ++ pre_args += '-DHAVE_DIRENT_D_TYPE' ++endif ++ ++# strtod locale support ++if cc.links(''' ++ #define _GNU_SOURCE ++ #include ++ #include ++ #ifdef HAVE_XLOCALE_H ++ #include ++ #endif ++ int main() { ++ locale_t loc = newlocale(LC_CTYPE_MASK, "C", NULL); ++ const char *s = "1.0"; ++ char *end; ++ double d = strtod_l(s, &end, loc); ++ float f = strtof_l(s, &end, loc); ++ freelocale(loc); ++ return 0; ++ }''', ++ args : pre_args, ++ name : 'strtod has locale support') ++ pre_args += '-DHAVE_STRTOD_L' ++endif ++ ++# Check for some linker flags ++ld_args_bsymbolic = [] ++if cc.links('int main() { return 0; }', args : '-Wl,-Bsymbolic', name : 'Bsymbolic') ++ ld_args_bsymbolic += '-Wl,-Bsymbolic' ++endif ++with_ld_version_script = false ++if host_machine.system() != 'windows' and cc.links('int main() { return 0; }', ++ args : '-Wl,--version-script=@0@'.format( ++ join_paths(meson.current_source_dir(), 'build-support/conftest.map')), ++ name : 'version-script') ++ with_ld_version_script = true ++endif ++with_ld_dynamic_list = false ++if cc.links('int main() { return 0; }', ++ args : '-Wl,--dynamic-list=@0@'.format( ++ join_paths(meson.current_source_dir(), 'build-support/conftest.dyn')), ++ name : 'dynamic-list') ++ with_ld_dynamic_list = true ++endif ++ ++ld_args_build_id = cc.get_supported_link_arguments('-Wl,--build-id=sha1') ++ ++# check for dl support ++dep_dl = null_dep ++if host_machine.system() != 'windows' ++ if not cc.has_function('dlopen') ++ dep_dl = cc.find_library('dl', required : true) ++ endif ++ if cc.has_function('dladdr', dependencies : dep_dl) ++ # This is required for src/util ++ pre_args += '-DHAVE_DLADDR' ++ endif ++endif ++ ++if cc.has_function('dl_iterate_phdr') ++ pre_args += '-DHAVE_DL_ITERATE_PHDR' ++elif with_intel_vk or with_intel_hasvk ++ error('Intel "Anvil" Vulkan driver requires the dl_iterate_phdr function') ++endif ++ ++if with_any_intel and ['x86', 'x86_64'].contains(host_machine.cpu_family()) ++ pre_args += '-DSUPPORT_INTEL_INTEGRATED_GPUS' ++endif ++ ++# Determine whether or not the rt library is needed for time functions ++if host_machine.system() == 'windows' or cc.has_function('clock_gettime') ++ dep_clock = null_dep ++else ++ dep_clock = cc.find_library('rt') ++endif ++ ++# IMPORTANT: We can't upgrade Zlib beyond 1.2.5 because it would break Viewperf. ++dep_zlib = dependency('zlib', version : '>= 1.2.3', ++ allow_fallback: true, ++ required : get_option('zlib')) ++if dep_zlib.found() ++ pre_args += '-DHAVE_ZLIB' ++endif ++ ++if host_machine.system() == 'windows' or with_platform_android ++ dep_display_info = null_dep ++else ++ dep_display_info = dependency('libdisplay-info', version : '>= 0.1.1', ++ required : get_option('display-info')) ++ if dep_display_info.found() ++ pre_args += '-DHAVE_LIBDISPLAY_INFO' ++ endif ++endif ++ ++dep_zstd = dependency('libzstd', required : get_option('zstd')) ++if dep_zstd.found() ++ pre_args += '-DHAVE_ZSTD' ++endif ++ ++with_compression = dep_zlib.found() or dep_zstd.found() ++if with_compression ++ pre_args += '-DHAVE_COMPRESSION' ++elif with_shader_cache ++ error('Shader Cache requires compression') ++endif ++ ++if host_machine.system() == 'windows' ++ # For MSVC and MinGW we aren't using pthreads, and dependency('threads') will add linkage ++ # to pthread for MinGW, so leave the dependency null_dep for Windows. For Windows linking to ++ # kernel32 is enough for c11/threads.h and it's already linked by meson by default ++ dep_thread = null_dep ++else ++ dep_thread = dependency('threads') ++endif ++if dep_thread.found() ++ pre_args += '-DHAVE_PTHREAD' ++ if host_machine.system() != 'netbsd' and cc.has_function( ++ 'pthread_setaffinity_np', ++ dependencies : dep_thread, ++ prefix : '#include ', ++ args : '-D_GNU_SOURCE') ++ pre_args += '-DHAVE_PTHREAD_SETAFFINITY' ++ endif ++endif ++ ++with_expat = get_option('expat') \ ++ .disable_auto_if(with_platform_android or with_platform_windows) \ ++ .enable_if(with_intel_tools, error_message : 'Intel tools require expat') ++ ++if host_machine.system() == 'darwin' ++ dep_expat = meson.get_compiler('c').find_library('expat', required : with_expat) ++else ++ dep_expat = dependency('expat', allow_fallback: true, ++ required : with_expat) ++endif ++ ++# We don't require expat on Android or Windows ++use_xmlconfig = get_option('xmlconfig') \ ++ .require(not (with_platform_android or with_platform_windows), ++ error_message : 'xmlconfig not available on Android or Windows') \ ++ .require(dep_expat.found(), ++ error_message : 'requires expat') \ ++ .allowed() ++ ++# Predefined macros for windows ++if host_machine.system() == 'windows' ++ pre_args += '-DWIN32_LEAN_AND_MEAN' # http://msdn2.microsoft.com/en-us/library/6dwk3a1z.aspx ++endif ++# this only exists on linux so either this is linux and it will be found, or ++# it's not linux and wont ++dep_m = cc.find_library('m', required : false) ++ ++if host_machine.system() == 'windows' ++ dep_regex = meson.get_compiler('c').find_library('regex', required : false) ++ if not dep_regex.found() ++ dep_regex = declare_dependency(compile_args : ['-DNO_REGEX']) ++ endif ++else ++ dep_regex = null_dep ++endif ++ ++if with_platform_haiku ++ dep_network = cc.find_library('network') ++endif ++ ++dep_futex = null_dep ++if host_machine.system() == 'windows' ++ if (get_option('min-windows-version') < 8) ++ pre_args += '-DWINDOWS_NO_FUTEX' ++ else ++ dep_futex = cc.find_library('synchronization', required : true) ++ endif ++endif ++ ++# Check for libdrm. Various drivers have different libdrm version requirements, ++# but we always want to use the same version for all libdrm modules. That means ++# even if driver foo requires 2.4.0 and driver bar requires 2.4.3, if foo and ++# bar are both on use 2.4.3 for both of them ++dep_libdrm_amdgpu = null_dep ++dep_libdrm_intel = null_dep ++ ++_drm_amdgpu_ver = '2.4.121' ++_drm_intel_ver = '2.4.75' ++_drm_ver = '2.4.109' ++ ++_libdrm_checks = [ ++ ['intel', with_gallium_i915], ++ ['amdgpu', (with_amd_vk and not with_platform_windows) or with_gallium_radeonsi], ++] ++ ++# Loop over the enables versions and get the highest libdrm requirement for all ++# active drivers. ++_drm_blame = '' ++foreach d : _libdrm_checks ++ ver = get_variable('_drm_@0@_ver'.format(d[0])) ++ if d[1] and ver.version_compare('>' + _drm_ver) ++ _drm_ver = ver ++ _drm_blame = d[0] ++ endif ++endforeach ++if _drm_blame != '' ++ message('libdrm @0@ needed because @1@ has the highest requirement'.format(_drm_ver, _drm_blame)) ++endif ++ ++allow_fallback_for_libdrm = get_option('allow-fallback-for').contains('libdrm') ++ ++with_gallium_drisw_kms = false ++if system_has_kms_drm ++ dep_libdrm = dependency( ++ 'libdrm', version : '>=' + _drm_ver, ++ required : with_dri2 or with_dri or with_gbm, ++ allow_fallback: allow_fallback_for_libdrm, ++ ) ++else ++ # We should prevent libdrm from being available when the target doesn't have it to avoid transitive ++ # dependencies (such as vk-runtime) linking to it ++ dep_libdrm = null_dep ++endif ++if dep_libdrm.found() ++ pre_args += '-DHAVE_LIBDRM' ++ if with_dri_platform == 'drm' and with_dri ++ with_gallium_drisw_kms = true ++ endif ++endif ++ ++# Then get each libdrm module ++foreach d : _libdrm_checks ++ if d[1] ++ set_variable( ++ 'dep_libdrm_' + d[0], ++ dependency( ++ 'libdrm_' + d[0], ++ version : '>=' + _drm_ver, ++ allow_fallback: allow_fallback_for_libdrm, ++ ) ++ ) ++ endif ++endforeach ++ ++dep_libudev = dependency('libudev', required : false) ++if dep_libudev.found() ++ pre_args += '-DHAVE_LIBUDEV' ++endif ++ ++llvm_modules = ['bitwriter', 'engine', 'mcdisassembler', 'mcjit', 'core', 'executionengine', 'scalaropts', 'transformutils', 'instcombine'] ++llvm_optional_modules = ['coroutines'] ++if with_amd_vk or with_gallium_radeonsi or with_gallium_r600 ++ llvm_modules += ['amdgpu', 'bitreader', 'ipo'] ++ if with_gallium_r600 ++ llvm_modules += 'asmparser' ++ endif ++endif ++if with_clc ++ llvm_modules += ['coverage', 'target', 'linker', 'irreader', 'option', 'libdriver', 'lto'] ++ # all-targets is needed to support static linking LLVM build with multiple targets. ++ # windowsdriver is needded with LLVM>=15 and frontendhlsl is needed with LLVM>=16, ++ # but we don't know what LLVM version we are using yet ++ llvm_optional_modules += ['all-targets', 'windowsdriver', 'frontendhlsl', 'frontenddriver'] ++endif ++if draw_with_llvm ++ llvm_modules += 'native' ++ # lto is needded with LLVM>=15, but we don't know what LLVM verrsion we are using yet ++ llvm_optional_modules += ['lto'] ++endif ++ ++# MCJIT is deprecated in LLVM and will not accept new architecture ports, ++# so any architecture not in the exhaustive list will have to rely on LLVM ++# ORCJIT for llvmpipe functionality. ++llvm_has_mcjit = host_machine.cpu_family() in ['aarch64', 'arm', 'ppc', 'ppc64', 's390x', 'x86', 'x86_64'] ++llvm_with_orcjit = get_option('llvm-orcjit') or not llvm_has_mcjit ++ ++if (with_amd_vk or with_gallium_radeonsi) and amd_with_llvm ++ _llvm_version = '>= 18.0.0' ++elif with_clc or llvm_with_orcjit ++ _llvm_version = '>= 15.0.0' ++else ++ _llvm_version = '>= 8.0.0' ++endif ++ ++_shared_llvm = get_option('shared-llvm') \ ++ .disable_auto_if(host_machine.system() == 'windows') \ ++ .allowed() ++ ++dep_llvm = dependency( ++ 'llvm', ++ method : host_machine.system() == 'windows' ? 'auto' : 'config-tool', ++ version : _llvm_version, ++ modules : llvm_modules, ++ optional_modules : llvm_optional_modules, ++ required : with_llvm, ++ static : not _shared_llvm, ++ fallback : ['llvm', 'dep_llvm'], ++ include_type : 'system', ++) ++if dep_llvm.found() ++ pre_args += '-DMESA_LLVM_VERSION_STRING="@0@"'.format(dep_llvm.version()) ++ pre_args += '-DLLVM_IS_SHARED=@0@'.format(_shared_llvm.to_int()) ++ ++ if (with_swrast_vk or with_gallium_llvmpipe) and not draw_with_llvm ++ error('Lavapipe and llvmpipe require LLVM draw support.') ++ endif ++ ++ if with_gallium_i915 and not draw_with_llvm ++ error('i915 requires LLVM draw support for vertex shaders.') ++ endif ++ ++ if with_gallium_r300 and not draw_with_llvm and host_machine.cpu_family() == 'x86' ++ error('r300 requires LLVM draw support for vertex shaders.') ++ endif ++ ++ if host_machine.system() != 'windows' ++ # LLVM can be built without rtti, turning off rtti changes the ABI of C++ ++ # programs, so we need to build all C++ code in mesa without rtti as well to ++ # ensure that linking works. Note that Win32 compilers does handle mismatching RTTI ++ # without issues, so only apply this for other compilers. ++ if dep_llvm.type_name() == 'internal' ++ _llvm_rtti = subproject('llvm').get_variable('has_rtti', true) ++ else ++ # The CMake finder will return 'ON', the llvm-config will return 'YES' ++ _llvm_rtti = ['ON', 'YES'].contains(dep_llvm.get_variable(cmake : 'LLVM_ENABLE_RTTI', configtool: 'has-rtti')) ++ endif ++ if _rtti != _llvm_rtti ++ if _llvm_rtti ++ error('LLVM was built with RTTI, cannot build Mesa with RTTI disabled. Remove cpp_rtti disable switch or use LLVM built without LLVM_ENABLE_RTTI.') ++ else ++ error('LLVM was built without RTTI, so Mesa must also disable RTTI. Use an LLVM built with LLVM_ENABLE_RTTI or add cpp_rtti=false.') ++ endif ++ endif ++ endif ++ ++ if cc.get_argument_syntax() == 'msvc' ++ # Suppress "/DELAYLOAD:ole32.dll/shell32.dll ignored" warnings that LLVM adds ++ add_project_link_arguments( ++ '/ignore:4199', ++ language : ['c', 'cpp'], ++ ) ++ endif ++else ++ draw_with_llvm = false ++endif ++amd_with_llvm = amd_with_llvm and dep_llvm.found() ++pre_args += '-DDRAW_LLVM_AVAILABLE=@0@'.format(draw_with_llvm.to_int()) ++pre_args += '-DAMD_LLVM_AVAILABLE=@0@'.format(amd_with_llvm.to_int()) ++pre_args += '-DGALLIVM_USE_ORCJIT=@0@'.format((dep_llvm.found() and llvm_with_orcjit).to_int()) ++ ++if with_clc ++ chosen_llvm_version_array = dep_llvm.version().split('.') ++ chosen_llvm_version_major = chosen_llvm_version_array[0].to_int() ++ chosen_llvm_version_minor = chosen_llvm_version_array[1].to_int() ++ ++ # Require an SPIRV-LLVM-Translator version compatible with the chosen LLVM ++ # one. ++ ++ _llvmspirvlib_min_version = '>= 15.0.0.0' ++ ++ _llvmspirvlib_version = [ ++ _llvmspirvlib_min_version, ++ '>= @0@.@1@'.format(chosen_llvm_version_major, chosen_llvm_version_minor), ++ '< @0@.@1@'.format(chosen_llvm_version_major, chosen_llvm_version_minor + 1) ] ++ ++ # LLVMSPIRVLib is available at https://github.com/KhronosGroup/SPIRV-LLVM-Translator ++ dep_llvmspirvlib = dependency('LLVMSPIRVLib', required : true, version : _llvmspirvlib_version) ++else ++ dep_llvmspirvlib = null_dep ++endif ++ ++with_spirv_tools = get_option('spirv-tools') \ ++ .enable_if(with_clc, error_message : 'CLC requires SPIRV-Tools') ++ ++dep_spirv_tools = dependency( ++ 'SPIRV-Tools', ++ required : with_spirv_tools, ++ version : '>= 2024.1', ++ static : host_machine.system() == 'darwin', ++) ++if dep_spirv_tools.found() ++ pre_args += '-DHAVE_SPIRV_TOOLS' ++endif ++ ++dep_clang = null_dep ++if with_clc ++ llvm_libdir = dep_llvm.get_variable(cmake : 'LLVM_LIBRARY_DIR', configtool: 'libdir') ++ ++ dep_clang = cpp.find_library('clang-cpp', dirs : llvm_libdir, required : false) ++ ++ if not dep_clang.found() or not _shared_llvm ++ clang_modules = [ ++ 'clangBasic', 'clangAST', 'clangCodeGen', 'clangLex', ++ 'clangDriver', 'clangFrontend', 'clangFrontendTool', ++ 'clangHandleCXX', 'clangHandleLLVM', 'clangSerialization', ++ 'clangSema', 'clangParse', 'clangEdit', 'clangAnalysis' ++ ] ++ if dep_llvm.version().version_compare('>= 15.0') ++ clang_modules += 'clangSupport' ++ endif ++ if dep_llvm.version().version_compare('>= 16.0') ++ clang_modules += 'clangASTMatchers' ++ endif ++ if dep_llvm.version().version_compare('>= 18.0') ++ clang_modules += 'clangAPINotes' ++ endif ++ ++ dep_clang = [] ++ foreach m : clang_modules ++ dep_clang += cpp.find_library(m, dirs : llvm_libdir, required : true) ++ endforeach ++ endif ++endif ++ ++dep_lua = dependency('lua54', 'lua5.4', 'lua-5.4', ++ 'lua53', 'lua5.3', 'lua-5.3', ++ 'lua', required: false, ++ allow_fallback: with_tools.contains('freedreno'), ++ version: '>=5.3') ++ ++# Be explicit about only using this lib on Windows, to avoid picking ++# up random libs with the generic name 'libversion' ++dep_version = null_dep ++if host_machine.system() == 'windows' ++ dep_version = cpp.find_library('version') ++endif ++ ++dep_elf = dependency('libelf', required : false) ++if not with_platform_windows and not dep_elf.found() ++ dep_elf = cc.find_library('elf', required : false) ++endif ++if dep_elf.found() ++ pre_args += '-DUSE_LIBELF' ++elif with_gallium_radeonsi ++ error('Gallium driver radeonsi requires libelf') ++endif ++ ++dep_valgrind = dependency('valgrind', required : get_option('valgrind')) ++if dep_valgrind.found() ++ pre_args += '-DHAVE_VALGRIND' ++endif ++ ++# AddressSanitizer's leak reports need all the symbols to be present at exit to ++# decode well, which runs afoul of our dlopen()/dlclose()ing of the DRI drivers. ++# Set a flag so we can skip the dlclose for asan builds. ++if get_option('b_sanitize').split(',').contains('address') ++ asan_c_args = ['-DBUILT_WITH_ASAN=1'] ++else ++ asan_c_args = ['-DBUILT_WITH_ASAN=0'] ++endif ++ ++# ThreadSanitizer can't deal with futexes, and reports races for cases we don't care about ++# so add a define to work silence these issues. ++if get_option('b_sanitize').contains('thread') ++ pre_args += '-DTHREAD_SANITIZER=1' ++ tsan_blacklist = '-fsanitize-blacklist=@0@'.format(join_paths(meson.project_source_root(), 'build-support', 'tsan-blacklist.txt')) ++ if cc.has_argument(tsan_blacklist) ++ pre_args += tsan_blacklist ++ else ++ warning('Compiler does not support "-fsanitize-blacklist", expected race conditions will not be surpressed') ++ endif ++else ++ pre_args += '-DTHREAD_SANITIZER=0' ++endif ++ ++yacc_is_bison = true ++needs_flex_bison = with_any_opengl or with_freedreno_vk or with_intel_tools or with_gallium ++ ++if build_machine.system() == 'windows' ++ # Prefer the winflexbison versions, they're much easier to install and have ++ # better windows support. ++ ++ prog_flex = find_program('win_flex', required : false) ++ if prog_flex.found() ++ # windows compatibility (uses instead of and _isatty, ++ # _fileno functions) ++ prog_flex = [prog_flex, '--wincompat'] ++ else ++ prog_flex = [find_program('flex', 'lex', required : needs_flex_bison, disabler : true)] ++ endif ++ # Force flex to use const keyword in prototypes, as relies on __cplusplus or ++ # __STDC__ macro to determine whether it's safe to use const keyword ++ prog_flex += '-DYY_USE_CONST=' ++ ++ prog_flex_cpp = prog_flex ++ # Convince win_flex to use for C++ files ++ # Note that we are using a C99 version here rather than C11, ++ # because using a C11 version can cause the MSVC CRT headers to define ++ # static_assert to _Static_assert, which breaks other parts of the CRT ++ prog_flex_cpp += '-D__STDC_VERSION__=199901' ++ ++ prog_bison = find_program('win_bison', required : false) ++ if not prog_bison.found() ++ prog_bison = find_program('bison', 'yacc', required : needs_flex_bison, disabler : true) ++ endif ++else ++ prog_bison = find_program('bison', required : false) ++ ++ if not prog_bison.found() ++ prog_bison = find_program('byacc', required : needs_flex_bison, disabler : true) ++ yacc_is_bison = false ++ endif ++ ++ # Disable deprecated keyword warnings, since we have to use them for ++ # old-bison compat. See discussion in ++ # https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2161 ++ if find_program('bison', required : false, version : '> 2.3').found() ++ prog_bison = [prog_bison, '-Wno-deprecated'] ++ endif ++ ++ prog_flex = find_program('flex', required : needs_flex_bison, disabler : true) ++ prog_flex_cpp = prog_flex ++endif ++ ++_libunwind = get_option('libunwind') \ ++ .require(not with_platform_android, error_message : 'Android requires the use of the backtrace library, not libunwind') ++if host_machine.system() == 'darwin' ++ dep_unwind = meson.get_compiler('c').find_library('System', required : _libunwind) ++else ++ dep_unwind = dependency('libunwind', required : _libunwind) ++endif ++if dep_unwind.found() ++ pre_args += '-DHAVE_LIBUNWIND' ++endif ++ ++# TODO: symbol mangling ++ ++with_wayland_bind_display = with_platform_wayland and get_option('legacy-wayland').contains('bind-wayland-display') ++if with_platform_wayland ++ dep_wl_protocols = dependency('wayland-protocols', version : '>= 1.41', default_options: [ 'tests=false' ]) ++ dep_wayland_client = dependency('wayland-client', version : '>=1.18') ++ dep_wayland_server = dependency('wayland-server', version : '>=1.18') ++ if with_egl ++ dep_wayland_egl = dependency('wayland-egl-backend', version : '>= 3') ++ dep_wayland_egl_headers = dep_wayland_egl.partial_dependency(compile_args : true) ++ endif ++ pre_args += '-DWL_HIDE_DEPRECATED' ++ if cc.has_function( ++ 'wl_display_dispatch_queue_timeout', ++ prefix : '#include ', ++ dependencies: dep_wayland_client) ++ pre_args += ['-DHAVE_WL_DISPATCH_QUEUE_TIMEOUT'] ++ endif ++ if cc.has_function( ++ 'wl_display_create_queue_with_name', ++ prefix : '#include ', ++ dependencies: dep_wayland_client) ++ pre_args += ['-DHAVE_WL_CREATE_QUEUE_WITH_NAME'] ++ endif ++ # This can be renamed just `wayland` when we require at least 1.8 ++ mod_wl = import('unstable-wayland') ++endif ++ ++# Even if we find OpenMP, Gitlab CI fails to link with gcc/i386 and clang/anyarch. ++dep_openmp = null_dep ++if host_machine.cpu_family() == 'x86_64' and cc.get_id() == 'gcc' ++ dep_openmp = dependency('openmp', required : false) ++ if dep_openmp.found() ++ pre_args += ['-DHAVE_OPENMP'] ++ endif ++endif ++ ++dep_x11 = null_dep ++dep_xext = null_dep ++dep_x11_xcb = null_dep ++dep_xcb = null_dep ++dep_xcb_keysyms = null_dep ++dep_xcb_glx = null_dep ++dep_xcb_dri3 = null_dep ++dep_glproto = null_dep ++dep_xxf86vm = null_dep ++dep_xcb_present = null_dep ++dep_xcb_sync = null_dep ++dep_xcb_xfixes = null_dep ++dep_xshmfence = null_dep ++dep_xcb_xrandr = null_dep ++dep_xcb_shm = null_dep ++dep_xlib_xrandr = null_dep ++ ++dep_glproto_version = '>= 1.4.14' ++dep_xcb_dri3_version = '>= 1.13' ++dep_xcb_glx_version = '>= 1.8.1' ++dep_xcb_present_version = '>= 1.13' ++dep_xlib_version = '>= 1.6' # RHEL8 has 1.6, RHEL9 has 1.7, U22.04 has 1.7 ++dep_xlib_xrandr_version = '>= 1.3' ++dep_xshmfence_version = '>= 1.1' ++ ++with_dri3_explicit_sync = false ++with_xcb_keysyms = false ++if with_platform_x11 ++ dep_xcb = dependency('xcb') ++ dep_xcb_xrandr = dependency('xcb-randr') ++ if with_glx == 'xlib' ++ dep_x11 = dependency('x11', version : dep_xlib_version) ++ dep_xext = dependency('xext') ++ elif with_glx == 'dri' ++ dep_x11 = dependency('x11', version : dep_xlib_version) ++ dep_xext = dependency('xext') ++ dep_xcb_glx = dependency('xcb-glx', version : dep_xcb_glx_version) ++ dep_xcb_shm = dependency('xcb-shm') ++ elif with_gallium_rusticl ++ # needed for GL sharing extension ++ dep_x11 = dependency('x11', version : dep_xlib_version) ++ endif ++ if (with_any_vk or with_glx == 'dri' or with_egl or with_gallium_va) ++ dep_xcb = dependency('xcb') ++ dep_xcb_keysyms = dependency('xcb-keysyms', required : false) ++ with_xcb_keysyms = dep_xcb_keysyms.found() ++ if with_xcb_keysyms ++ pre_args += '-DXCB_KEYSYMS_AVAILABLE' ++ endif ++ dep_x11_xcb = dependency('x11-xcb') ++ if with_dri_platform == 'drm' and not dep_libdrm.found() ++ error('libdrm required for gallium video statetrackers when using x11') ++ endif ++ endif ++ if with_dri_platform == 'drm' ++ dep_xcb_dri3 = dependency('xcb-dri3', version : dep_xcb_dri3_version) ++ dep_xcb_present = dependency('xcb-present', version : dep_xcb_present_version) ++ if (dep_xcb_dri3.version().version_compare('>= 1.17') and ++ dep_xcb_present.version().version_compare('>= 1.17')) ++ with_dri3_explicit_sync = true ++ endif ++ dep_xcb_shm = dependency('xcb-shm') ++ dep_xcb_sync = dependency('xcb-sync') ++ dep_xshmfence = dependency('xshmfence', version : dep_xshmfence_version) ++ pre_args += '-DHAVE_X11_DRM' ++ endif ++ if with_glx == 'dri' or with_glx == 'xlib' ++ dep_glproto = dependency('glproto', version : dep_glproto_version) ++ endif ++ if with_glx == 'dri' ++ if with_dri_platform == 'drm' ++ if with_glx_direct ++ dep_xxf86vm = dependency('xxf86vm') ++ endif ++ endif ++ endif ++ if (with_egl or ++ with_dri or ++ with_any_vk) ++ dep_xcb_xfixes = dependency('xcb-xfixes') ++ endif ++ if with_any_vk ++ dep_xcb_dri3 = dependency('xcb-dri3', version : dep_xcb_dri3_version) ++ dep_xcb_present = dependency('xcb-present', version : dep_xcb_present_version) ++ dep_xcb_shm = dependency('xcb-shm') ++ dep_xshmfence = dependency('xshmfence', version : dep_xshmfence_version) ++ endif ++ if with_xlib_lease or with_any_vk ++ dep_xcb_xrandr = dependency('xcb-randr') ++ endif ++ if with_xlib_lease ++ dep_xlib_xrandr = dependency('xrandr', version : dep_xlib_xrandr_version) ++ endif ++endif ++ ++if with_dri ++ pre_args += '-DHAVE_DRI' ++endif ++if with_dri2 ++ pre_args += '-DHAVE_DRI2' ++endif ++if with_dri3_explicit_sync ++ pre_args += '-DHAVE_DRI3_EXPLICIT_SYNC' ++endif ++if with_gallium_drisw_kms ++ pre_args += '-DHAVE_DRISW_KMS' ++endif ++ ++if get_option('gallium-extra-hud') ++ pre_args += '-DHAVE_GALLIUM_EXTRA_HUD=1' ++endif ++ ++dep_lmsensors = cc.find_library('sensors', required : get_option('lmsensors')) ++if dep_lmsensors.found() ++ pre_args += '-DHAVE_LIBSENSORS=1' ++endif ++ ++_shader_replacement = get_option('custom-shader-replacement') ++if _shader_replacement == '' ++else ++ pre_args += '-DCUSTOM_SHADER_REPLACEMENT' ++endif ++ ++allow_fallback_for_perfetto = get_option('allow-fallback-for').contains('perfetto') ++with_perfetto = get_option('perfetto') ++with_datasources = get_option('datasources') ++with_any_datasource = with_datasources.length() != 0 ++if with_perfetto ++ dep_perfetto = dependency( ++ 'perfetto', ++ fallback: allow_fallback_for_perfetto ? ['perfetto', 'dep_perfetto'] : [], ++ ) ++ pre_args += '-DHAVE_PERFETTO' ++endif ++ ++if get_option('android-libperfetto').enabled() ++ pre_args += '-DANDROID_LIBPERFETTO' ++endif ++ ++with_teflon = get_option('teflon') ++if with_teflon and with_tests ++ dep_flatbuffers = dependency('flatbuffers') ++ prog_flatc = find_program('flatc') ++endif ++ ++with_gpuvis = get_option('gpuvis') ++if with_gpuvis ++ pre_args += '-DHAVE_GPUVIS' ++endif ++ ++with_sysprof = get_option('sysprof') ++if with_sysprof ++ dep_sysprof = dependency('sysprof-capture-4', version: '>= 49.0') ++ pre_args += '-DHAVE_SYSPROF' ++endif ++ ++add_project_arguments(pre_args, language : ['c', 'cpp']) ++add_project_arguments(c_cpp_args, language : ['c', 'cpp']) ++if host_machine.system() == 'darwin' ++ add_project_arguments(pre_args, language : ['objc']) ++endif ++ ++add_project_arguments(c_args, language : ['c']) ++add_project_arguments(cpp_args, language : ['cpp']) ++ ++gl_priv_reqs = [] ++ ++if with_glx == 'xlib' ++ gl_priv_reqs += ['x11', 'xext', 'xcb'] ++elif with_glx == 'dri' ++ gl_priv_reqs += [ ++ 'x11', 'xext', 'xfixes', 'x11-xcb', 'xcb', ++ 'xcb-glx >= 1.8.1'] ++ if with_dri_platform == 'drm' ++ gl_priv_reqs += 'xcb-dri2 >= 1.8' ++ if with_glx_direct ++ gl_priv_reqs += 'xxf86vm' ++ endif ++ endif ++endif ++if dep_libdrm.found() ++ gl_priv_reqs += 'libdrm >= 2.4.75' ++endif ++ ++gl_priv_libs = [] ++if dep_thread.found() ++ gl_priv_libs += ['-lpthread', '-pthread'] ++endif ++if dep_m.found() ++ gl_priv_libs += '-lm' ++endif ++if dep_dl.found() ++ gl_priv_libs += '-ldl' ++endif ++ ++# FIXME: autotools lists this as incomplete ++gbm_priv_libs = [] ++if dep_dl.found() ++ gbm_priv_libs += '-ldl' ++endif ++ ++pkg = import('pkgconfig') ++ ++if host_machine.system() == 'windows' and cc.get_argument_syntax() == 'msvc' ++ prog_dumpbin = find_program('dumpbin', required : false) ++ with_symbols_check = prog_dumpbin.found() and with_tests ++ if with_symbols_check ++ symbols_check_args = ['--dumpbin', prog_dumpbin.full_path()] ++ endif ++elif host_machine.system() == 'windows' and cc.get_argument_syntax() != 'msvc' ++ # mingw ++ prog_gendef = find_program('gendef', required : false) ++ with_symbols_check = prog_gendef.found() and with_tests ++ if with_symbols_check ++ symbols_check_args = ['--gendef', prog_gendef.full_path()] ++ endif ++else ++ prog_nm = find_program('nm') ++ with_symbols_check = prog_nm.found() and with_tests ++ symbols_check_args = ['--nm', prog_nm.full_path()] ++endif ++ ++# This quirk needs to be applied to sources with functions defined in assembly ++# as GCC LTO drops them. See: https://bugs.freedesktop.org/show_bug.cgi?id=109391 ++gcc_lto_quirk = (cc.get_id() == 'gcc') ? ['-fno-lto'] : [] ++ ++devenv = environment() ++ ++dir_compiler_nir = join_paths(meson.current_source_dir(), 'src/compiler/nir/') ++dir_source_root = meson.project_source_root() ++ ++if host_machine.system() == 'windows' ++ vulkan_icd_lib_path = import('fs').relative_to(get_option('bindir'), with_vulkan_icd_dir) ++else ++ vulkan_icd_lib_path = get_option('prefix') / get_option('libdir') ++endif ++ ++ ++subdir('include') ++subdir('bin') ++subdir('src') ++ ++meson.add_devenv(devenv) ++ ++sphinx = find_program('sphinx-build', version : '>= 4.3', ++ required: get_option('html-docs')) ++if sphinx.found() ++ subdir('docs') ++endif ++ ++summary( ++ { ++ 'prefix': get_option('prefix'), ++ 'libdir': get_option('libdir'), ++ 'includedir': get_option('includedir'), ++ }, ++ section: 'Directories' ++) ++ ++summary( ++ { ++ 'c_cpp_args': c_cpp_args, ++ }, ++ section: 'Common C and C++ arguments' ++) ++ ++summary( ++ { ++ 'OpenGL': with_opengl, ++ 'ES1': with_gles1, ++ 'ES2': with_gles2, ++ 'GLVND': with_glvnd, ++ }, ++ section: 'OpenGL', bool_yn: true ++) ++ ++summary( ++ { ++ 'Platform': with_dri_platform, ++ 'Driver dir': dri_drivers_path, ++ }, ++ section: 'DRI', bool_yn: true, list_sep: ' ' ++) ++ ++summary( ++ { ++ 'Enabled': with_glx != 'disabled', ++ 'Provider': with_glx == 'disabled' ? 'None' : with_glx ++ }, ++ section: 'GLX', bool_yn: true, list_sep: ' ' ++) ++ ++egl_summary = {'Enabled': with_egl} ++if with_egl ++ egl_drivers = [] ++ if with_dri ++ egl_drivers += 'builtin:egl_dri2' ++ endif ++ if with_dri_platform == 'drm' ++ egl_drivers += 'builtin:egl_dri3' ++ endif ++ if with_platform_windows ++ egl_drivers += 'builtin:wgl' ++ endif ++ egl_summary += {'Drivers': egl_drivers} ++ egl_summary += {'Platforms': _platforms} ++endif ++summary(egl_summary, section: 'EGL', bool_yn: true, list_sep: ' ') ++ ++gbm_summary = {'Enabled': with_gbm} ++if with_gbm ++ gbm_summary += {'External libgbm': get_option('libgbm-external'), 'Backends path': gbm_backends_path} ++endif ++summary(gbm_summary, section: 'GBM', bool_yn: true, list_sep: ' ') ++ ++vulkan_summary = {'Drivers': _vulkan_drivers.length() != 0 ? _vulkan_drivers : false } ++if with_any_vk ++ vulkan_summary += {'Platforms': _platforms} ++ vulkan_summary += {'ICD dir': with_vulkan_icd_dir} ++ if with_any_vulkan_layers ++ vulkan_summary += {'Layers': get_option('vulkan-layers')} ++ endif ++ vulkan_summary += {'Intel Ray tracing': with_intel_vk_rt} ++endif ++summary(vulkan_summary, section: 'Vulkan', bool_yn: true, list_sep: ' ') ++ ++video_summary = {'Codecs': _codecs.length() != 0 ? _codecs : false} ++video_apis = [] ++if with_gallium_va ++ video_apis += 'va' ++endif ++if with_gallium_mediafoundation ++ video_apis += 'mediafoundation' ++endif ++if with_any_vk ++ video_apis += 'vulkan' ++endif ++video_summary += {'APIs': video_apis.length() != 0 ? video_apis : false} ++summary(video_summary, section: 'Video', bool_yn: true, list_sep: ' ') ++ ++llvm_summary = {'Required': with_llvm} ++if dep_llvm.found() ++ llvm_summary += {'Version': dep_llvm.version()} ++endif ++summary(llvm_summary, section: 'LLVM', bool_yn: true, list_sep: ' ') ++ ++gallium_summary = {'Enabled': with_gallium} ++if with_gallium ++ gallium_summary += {'Drivers': gallium_drivers} ++ gallium_summary += {'Platforms': _platforms} ++ ++ gallium_frontends = ['mesa'] ++ if with_gallium_va ++ gallium_frontends += 'va' ++ endif ++ if with_gallium_mediafoundation ++ gallium_frontends += 'mediafoundation' ++ endif ++ if with_gallium_rusticl ++ gallium_frontends += 'rusticl' ++ endif ++ gallium_summary += {'Frontends': gallium_frontends} ++ gallium_summary += {'HUD lm-sensors': dep_lmsensors.found()} ++endif ++summary(gallium_summary, section: 'Gallium', bool_yn: true, list_sep: ' ') ++ ++perfetto_summary = {'Enabled': with_perfetto} ++if with_perfetto and with_any_datasource ++ perfetto_summary += {'Data source': with_datasources} ++endif ++summary(perfetto_summary, section: 'Perfetto', bool_yn: true, list_sep: ' ') ++ ++teflon_summary = {'Enabled': with_teflon} ++summary(teflon_summary, section: 'Teflon (TensorFlow Lite delegate)', bool_yn: true, list_sep: ' ') +diff -Nru mesa-25.3.3/.pc/.quilt_patches mesa-25.3.3/.pc/.quilt_patches +--- mesa-25.3.3/.pc/.quilt_patches 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/.pc/.quilt_patches 2026-05-26 22:08:05.000000000 -0500 +@@ -0,0 +1 @@ ++debian/patches +diff -Nru mesa-25.3.3/.pc/.quilt_series mesa-25.3.3/.pc/.quilt_series +--- mesa-25.3.3/.pc/.quilt_series 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/.pc/.quilt_series 2026-05-26 22:08:05.000000000 -0500 +@@ -0,0 +1 @@ ++debian/patches/series +diff -Nru mesa-25.3.3/.pc/.version mesa-25.3.3/.pc/.version +--- mesa-25.3.3/.pc/.version 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/.pc/.version 2026-05-26 22:08:05.000000000 -0500 +@@ -0,0 +1 @@ ++2 +diff -Nru mesa-25.3.3/src/compiler/nir/nir_functions.c mesa-25.3.3/src/compiler/nir/nir_functions.c +--- mesa-25.3.3/src/compiler/nir/nir_functions.c 2026-01-01 13:34:04.000000000 -0500 ++++ mesa-25.3.3/src/compiler/nir/nir_functions.c 2026-05-28 22:16:26.000000000 -0500 +@@ -22,10 +22,10 @@ + */ + + #include "util/u_printf.h" ++#include "util/stack_array.h" + #include "nir.h" + #include "nir_builder.h" + #include "nir_control_flow.h" +-#include "nir_vla.h" + + /* + * TODO: write a proper inliner for GPUs. +@@ -240,12 +240,13 @@ + * to an SSA value first. + */ + const unsigned num_params = call->num_params; +- NIR_VLA(nir_def *, params, num_params); ++ STACK_ARRAY(nir_def *, params, num_params); + for (unsigned i = 0; i < num_params; i++) { + params[i] = call->params[i].ssa; + } + + nir_inline_function_impl(b, call->callee->impl, params, NULL); ++ STACK_ARRAY_FINISH(params); + return true; + } + +diff -Nru mesa-25.3.3/src/compiler/spirv/spirv_to_nir.c mesa-25.3.3/src/compiler/spirv/spirv_to_nir.c +--- mesa-25.3.3/src/compiler/spirv/spirv_to_nir.c 2026-01-01 13:34:04.000000000 -0500 ++++ mesa-25.3.3/src/compiler/spirv/spirv_to_nir.c 2026-05-28 22:16:26.000000000 -0500 +@@ -27,7 +27,6 @@ + + #include "glsl_types.h" + #include "vtn_private.h" +-#include "nir/nir_vla.h" + #include "nir/nir_control_flow.h" + #include "nir/nir_constant_expressions.h" + #include "nir/nir_deref.h" +@@ -42,6 +41,7 @@ + #include "util/mesa-blake3.h" + #include "util/bfloat.h" + #include "util/float8.h" ++#include "util/stack_array.h" + + #include + +@@ -1377,7 +1377,7 @@ + case vtn_base_type_struct: { + bool need_new_struct = false; + const uint32_t num_fields = type->length; +- NIR_VLA(struct glsl_struct_field, fields, num_fields); ++ STACK_ARRAY(struct glsl_struct_field, fields, num_fields); + for (unsigned i = 0; i < num_fields; i++) { + fields[i] = *glsl_get_struct_field_data(type->type, i); + const struct glsl_type *field_nir_type = +@@ -1387,20 +1387,25 @@ + need_new_struct = true; + } + } ++ ++ const struct glsl_type *result; + if (need_new_struct) { + if (glsl_type_is_interface(type->type)) { +- return glsl_interface_type(fields, num_fields, +- /* packing */ 0, false, +- glsl_get_type_name(type->type)); ++ result = glsl_interface_type(fields, num_fields, ++ /* packing */ 0, false, ++ glsl_get_type_name(type->type)); + } else { +- return glsl_struct_type(fields, num_fields, +- glsl_get_type_name(type->type), +- glsl_struct_type_is_packed(type->type)); ++ result = glsl_struct_type(fields, num_fields, ++ glsl_get_type_name(type->type), ++ glsl_struct_type_is_packed(type->type)); + } + } else { + /* No changes, just pass it on */ +- return type->type; ++ result = type->type; + } ++ ++ STACK_ARRAY_FINISH(fields); ++ return result; + } + + case vtn_base_type_image: +@@ -2046,7 +2051,7 @@ + val->type->offsets = vtn_alloc_array(b, unsigned, num_fields); + val->type->packed = false; + +- NIR_VLA(struct glsl_struct_field, fields, count); ++ STACK_ARRAY(struct glsl_struct_field, fields, count); + for (unsigned i = 0; i < num_fields; i++) { + val->type->members[i] = vtn_get_type(b, w[i + 2]); + const char *name = NULL; +@@ -2102,6 +2107,8 @@ + name ? name : "struct", + val->type->packed); + } ++ ++ STACK_ARRAY_FINISH(fields); + break; + } + +diff -Nru mesa-25.3.3/src/util/stack_array.h mesa-25.3.3/src/util/stack_array.h +--- mesa-25.3.3/src/util/stack_array.h 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/src/util/stack_array.h 2026-05-29 12:28:11.000000000 -0500 +@@ -0,0 +1,46 @@ ++/* ++ * Copyright © 2025 Intel Corporation ++ * ++ * Permission is hereby granted, free of charge, to any person obtaining a ++ * copy of this software and associated documentation files (the "Software"), ++ * to deal in the Software without restriction, including without limitation ++ * the rights to use, copy, modify, merge, publish, distribute, sublicense, ++ * and/or sell copies of the Software, and to permit persons to whom the ++ * Software is furnished to do so, subject to the following conditions: ++ * ++ * The above copyright notice and this permission notice shall be included in ++ * all copies or substantial portions of the Software. ++ * ++ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ++ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ++ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS ++ * IN THE SOFTWARE. ++ */ ++ ++#ifndef STACK_ARRAY_H ++#define STACK_ARRAY_H ++ ++#include ++ ++#define STACK_ARRAY_SIZE 8 ++ ++/* Allocate an array on the stack if it's small enough, otherwise malloc. ++ * ++ * Sometimes gcc may claim -Wmaybe-uninitialized for the stack array in some ++ * places it can't verify that when size is 0 nobody down the call chain reads ++ * the array. Please don't try to fix it by zero-initializing the array here ++ * since it's used in a lot of different places. An "if (size == 0) return;" ++ * may work for you. ++ */ ++#define STACK_ARRAY(type, name, size) \ ++ type _stack_##name[STACK_ARRAY_SIZE]; \ ++ type *const name = \ ++ ((size) <= STACK_ARRAY_SIZE ? _stack_##name : (type *)malloc((size) * sizeof(type))) ++ ++#define STACK_ARRAY_FINISH(name) \ ++ if (name != _stack_##name) free(name) ++ ++#endif /* STACK_ARRAY_H */ +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/benches/parse.rs mesa-25.3.3/subprojects/bitflags-2.8.0/benches/parse.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/benches/parse.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/benches/parse.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,96 @@ ++#![feature(test)] ++ ++extern crate test; ++ ++use std::{ ++ fmt::{self, Display}, ++ str::FromStr, ++}; ++ ++bitflags::bitflags! { ++ struct Flags10: u32 { ++ const A = 0b0000_0000_0000_0001; ++ const B = 0b0000_0000_0000_0010; ++ const C = 0b0000_0000_0000_0100; ++ const D = 0b0000_0000_0000_1000; ++ const E = 0b0000_0000_0001_0000; ++ const F = 0b0000_0000_0010_0000; ++ const G = 0b0000_0000_0100_0000; ++ const H = 0b0000_0000_1000_0000; ++ const I = 0b0000_0001_0000_0000; ++ const J = 0b0000_0010_0000_0000; ++ } ++} ++ ++impl FromStr for Flags10 { ++ type Err = bitflags::parser::ParseError; ++ ++ fn from_str(flags: &str) -> Result { ++ Ok(Flags10(flags.parse()?)) ++ } ++} ++ ++impl Display for Flags10 { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ Display::fmt(&self.0, f) ++ } ++} ++ ++#[bench] ++fn format_flags_1_present(b: &mut test::Bencher) { ++ b.iter(|| Flags10::J.to_string()) ++} ++ ++#[bench] ++fn format_flags_5_present(b: &mut test::Bencher) { ++ b.iter(|| (Flags10::F | Flags10::G | Flags10::H | Flags10::I | Flags10::J).to_string()) ++} ++ ++#[bench] ++fn format_flags_10_present(b: &mut test::Bencher) { ++ b.iter(|| { ++ (Flags10::A ++ | Flags10::B ++ | Flags10::C ++ | Flags10::D ++ | Flags10::E ++ | Flags10::F ++ | Flags10::G ++ | Flags10::H ++ | Flags10::I ++ | Flags10::J) ++ .to_string() ++ }) ++} ++ ++#[bench] ++fn parse_flags_1_10(b: &mut test::Bencher) { ++ b.iter(|| { ++ let flags: Flags10 = "J".parse().unwrap(); ++ flags ++ }) ++} ++ ++#[bench] ++fn parse_flags_5_10(b: &mut test::Bencher) { ++ b.iter(|| { ++ let flags: Flags10 = "F | G | H | I | J".parse().unwrap(); ++ flags ++ }) ++} ++ ++#[bench] ++fn parse_flags_10_10(b: &mut test::Bencher) { ++ b.iter(|| { ++ let flags: Flags10 = "A | B | C | D | E | F | G | H | I | J".parse().unwrap(); ++ flags ++ }) ++} ++ ++#[bench] ++fn parse_flags_1_10_hex(b: &mut test::Bencher) { ++ b.iter(|| { ++ let flags: Flags10 = "0xFF".parse().unwrap(); ++ flags ++ }) ++} +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/.cargo-checksum.json mesa-25.3.3/subprojects/bitflags-2.8.0/.cargo-checksum.json +--- mesa-25.3.3/subprojects/bitflags-2.8.0/.cargo-checksum.json 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/.cargo-checksum.json 2025-02-06 13:31:16.000000000 -0500 +@@ -0,0 +1 @@ ++{"package":"Could not get crate checksum","files":{}} +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/Cargo.toml mesa-25.3.3/subprojects/bitflags-2.8.0/Cargo.toml +--- mesa-25.3.3/subprojects/bitflags-2.8.0/Cargo.toml 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/Cargo.toml 2025-02-06 13:31:16.000000000 -0500 +@@ -0,0 +1,122 @@ ++# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO ++# ++# When uploading crates to the registry Cargo will automatically ++# "normalize" Cargo.toml files for maximal compatibility ++# with all versions of Cargo and also rewrite `path` dependencies ++# to registry (e.g., crates.io) dependencies. ++# ++# If you are reading this file be aware that the original Cargo.toml ++# will likely look very different (and much more reasonable). ++# See Cargo.toml.orig for the original contents. ++ ++[package] ++edition = "2021" ++rust-version = "1.56.0" ++name = "bitflags" ++version = "2.8.0" ++authors = ["The Rust Project Developers"] ++build = false ++exclude = [ ++ "/tests", ++ "/.github", ++] ++autolib = false ++autobins = false ++autoexamples = false ++autotests = false ++autobenches = false ++description = """ ++A macro to generate structures which behave like bitflags. ++""" ++homepage = "https://github.com/bitflags/bitflags" ++documentation = "https://docs.rs/bitflags" ++readme = "README.md" ++keywords = [ ++ "bit", ++ "bitmask", ++ "bitflags", ++ "flags", ++] ++categories = ["no-std"] ++license = "MIT OR Apache-2.0" ++repository = "https://github.com/bitflags/bitflags" ++ ++[package.metadata.docs.rs] ++features = ["example_generated"] ++ ++[lib] ++name = "bitflags" ++path = "src/lib.rs" ++ ++[[example]] ++name = "custom_bits_type" ++path = "examples/custom_bits_type.rs" ++ ++[[example]] ++name = "fmt" ++path = "examples/fmt.rs" ++ ++[[example]] ++name = "macro_free" ++path = "examples/macro_free.rs" ++ ++[[example]] ++name = "serde" ++path = "examples/serde.rs" ++ ++[[bench]] ++name = "parse" ++path = "benches/parse.rs" ++ ++[dependencies.arbitrary] ++version = "1.0" ++optional = true ++ ++[dependencies.bytemuck] ++version = "1.12" ++optional = true ++ ++[dependencies.compiler_builtins] ++version = "0.1.2" ++optional = true ++ ++[dependencies.core] ++version = "1.0.0" ++optional = true ++package = "rustc-std-workspace-core" ++ ++[dependencies.serde] ++version = "1.0.103" ++optional = true ++default-features = false ++ ++[dev-dependencies.arbitrary] ++version = "1.0" ++features = ["derive"] ++ ++[dev-dependencies.bytemuck] ++version = "1.12.2" ++features = ["derive"] ++ ++[dev-dependencies.rustversion] ++version = "1.0" ++ ++[dev-dependencies.serde_derive] ++version = "1.0.103" ++ ++[dev-dependencies.serde_json] ++version = "1.0" ++ ++[dev-dependencies.serde_test] ++version = "1.0.19" ++ ++[dev-dependencies.trybuild] ++version = "1.0.18" ++ ++[features] ++example_generated = [] ++rustc-dep-of-std = [ ++ "core", ++ "compiler_builtins", ++] ++std = [] +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/.cargo_vcs_info.json mesa-25.3.3/subprojects/bitflags-2.8.0/.cargo_vcs_info.json +--- mesa-25.3.3/subprojects/bitflags-2.8.0/.cargo_vcs_info.json 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/.cargo_vcs_info.json 2025-02-06 13:31:16.000000000 -0500 +@@ -0,0 +1,6 @@ ++{ ++ "git": { ++ "sha1": "e20af8601d31ab6b85ba3ae5867595f47ab3fc55" ++ }, ++ "path_in_vcs": "" ++} +\ No hay ningún carácter de nueva línea al final del archivo +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/CHANGELOG.md mesa-25.3.3/subprojects/bitflags-2.8.0/CHANGELOG.md +--- mesa-25.3.3/subprojects/bitflags-2.8.0/CHANGELOG.md 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/CHANGELOG.md 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,581 @@ ++# 2.8.0 ++ ++## What's Changed ++* feat(core): Add bitflags_match macro for bitflag matching by @YuniqueUnic in https://github.com/bitflags/bitflags/pull/423 ++* Finalize bitflags_match by @KodrAus in https://github.com/bitflags/bitflags/pull/431 ++ ++## New Contributors ++* @YuniqueUnic made their first contribution in https://github.com/bitflags/bitflags/pull/423 ++ ++**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.7.0...2.8.0 ++ ++# 2.7.0 ++ ++## What's Changed ++* Fix `clippy::doc_lazy_continuation` lints by @waywardmonkeys in https://github.com/bitflags/bitflags/pull/414 ++* Run clippy on extra features in CI. by @waywardmonkeys in https://github.com/bitflags/bitflags/pull/415 ++* Fix CI: trybuild refresh, allow some clippy restrictions. by @waywardmonkeys in https://github.com/bitflags/bitflags/pull/417 ++* Update zerocopy version in example by @KodrAus in https://github.com/bitflags/bitflags/pull/422 ++* Add method to check if unknown bits are set by @wysiwys in https://github.com/bitflags/bitflags/pull/426 ++* Update error messages by @KodrAus in https://github.com/bitflags/bitflags/pull/427 ++* Add `truncate(&mut self)` method to unset unknown bits by @wysiwys in https://github.com/bitflags/bitflags/pull/428 ++* Update error messages by @KodrAus in https://github.com/bitflags/bitflags/pull/429 ++ ++## New Contributors ++* @wysiwys made their first contribution in https://github.com/bitflags/bitflags/pull/426 ++ ++**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.6.0...2.7.0 ++ ++# 2.6.0 ++ ++## What's Changed ++* Sync CHANGELOG.md with github release notes by @dextero in https://github.com/bitflags/bitflags/pull/402 ++* Update error messages and zerocopy by @KodrAus in https://github.com/bitflags/bitflags/pull/403 ++* Bump minimum declared versions of dependencies by @dextero in https://github.com/bitflags/bitflags/pull/404 ++* chore(deps): bump serde_derive and bytemuck versions by @joshka in https://github.com/bitflags/bitflags/pull/405 ++* add OSFF Scorecard workflow by @KodrAus in https://github.com/bitflags/bitflags/pull/396 ++* Update stderr messages by @KodrAus in https://github.com/bitflags/bitflags/pull/408 ++* Fix typo by @waywardmonkeys in https://github.com/bitflags/bitflags/pull/410 ++* Allow specifying outer attributes in impl mode by @KodrAus in https://github.com/bitflags/bitflags/pull/411 ++ ++## New Contributors ++* @dextero made their first contribution in https://github.com/bitflags/bitflags/pull/402 ++* @joshka made their first contribution in https://github.com/bitflags/bitflags/pull/405 ++* @waywardmonkeys made their first contribution in https://github.com/bitflags/bitflags/pull/410 ++ ++**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.5.0...2.6.0 ++ ++# 2.5.0 ++ ++## What's Changed ++* Derive `Debug` for `Flag` by @tgross35 in https://github.com/bitflags/bitflags/pull/398 ++* Support truncating or strict-named variants of parsing and formatting by @KodrAus in https://github.com/bitflags/bitflags/pull/400 ++ ++## New Contributors ++* @tgross35 made their first contribution in https://github.com/bitflags/bitflags/pull/398 ++ ++**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.4.2...2.5.0 ++ ++# 2.4.2 ++ ++## What's Changed ++* Cargo.toml: Anchor excludes to root of the package by @jamessan in https://github.com/bitflags/bitflags/pull/387 ++* Update error messages by @KodrAus in https://github.com/bitflags/bitflags/pull/390 ++* Add support for impl mode structs to be repr(packed) by @GnomedDev in https://github.com/bitflags/bitflags/pull/388 ++* Remove old `unused_tuple_struct_fields` lint by @dtolnay in https://github.com/bitflags/bitflags/pull/393 ++* Delete use of `local_inner_macros` by @dtolnay in https://github.com/bitflags/bitflags/pull/392 ++ ++## New Contributors ++* @jamessan made their first contribution in https://github.com/bitflags/bitflags/pull/387 ++* @GnomedDev made their first contribution in https://github.com/bitflags/bitflags/pull/388 ++ ++**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.4.1...2.4.2 ++ ++# 2.4.1 ++ ++## What's Changed ++* Allow some new pedantic clippy lints by @KodrAus in https://github.com/bitflags/bitflags/pull/380 ++ ++**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.4.0...2.4.1 ++ ++# 2.4.0 ++ ++## What's Changed ++* Remove html_root_url by @eldruin in https://github.com/bitflags/bitflags/pull/368 ++* Support unnamed flags by @KodrAus in https://github.com/bitflags/bitflags/pull/371 ++* Update smoke test to verify all Clippy and rustc lints by @MitMaro in https://github.com/bitflags/bitflags/pull/374 ++* Specify the behavior of bitflags by @KodrAus in https://github.com/bitflags/bitflags/pull/369 ++ ++## New Contributors ++* @eldruin made their first contribution in https://github.com/bitflags/bitflags/pull/368 ++* @MitMaro made their first contribution in https://github.com/bitflags/bitflags/pull/374 ++ ++**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.3.3...2.4.0 ++ ++# 2.3.3 ++ ++## Changes to `-=` ++ ++The `-=` operator was incorrectly changed to truncate bits that didn't correspond to valid flags in `2.3.0`. This has ++been fixed up so it once again behaves the same as `-` and `difference`. ++ ++## Changes to `!` ++ ++The `!` operator previously called `Self::from_bits_truncate`, which would truncate any bits that only partially ++overlapped with a valid flag. It will now use `bits & Self::all().bits()`, so any bits that overlap any bits ++specified by any flag will be respected. This is unlikely to have any practical implications, but enables defining ++a flag like `const ALL = !0` as a way to signal that any bit pattern is a known set of flags. ++ ++## Changes to formatting ++ ++Zero-valued flags will never be printed. You'll either get `0x0` for empty flags using debug formatting, or the ++set of flags with zero-valued flags omitted for others. ++ ++Composite flags will no longer be redundantly printed if there are extra bits to print at the end that don't correspond ++to a valid flag. ++ ++## What's Changed ++* Fix up incorrect sub assign behavior and other cleanups by @KodrAus in https://github.com/bitflags/bitflags/pull/366 ++ ++**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.3.2...2.3.3 ++ ++# 2.3.2 ++ ++## What's Changed ++* [doc] [src/lib.rs] delete redundant path prefix by @OccupyMars2025 in https://github.com/bitflags/bitflags/pull/361 ++ ++## New Contributors ++* @OccupyMars2025 made their first contribution in https://github.com/bitflags/bitflags/pull/361 ++ ++**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.3.1...2.3.2 ++ ++# 2.3.1 ++ ++## What's Changed ++* Fix Self in flags value expressions by @KodrAus in https://github.com/bitflags/bitflags/pull/355 ++ ++**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.3.0...2.3.1 ++ ++# 2.3.0 ++ ++## Major changes ++ ++### `BitFlags` trait deprecated in favor of `Flags` trait ++ ++This release introduces the `Flags` trait and deprecates the `BitFlags` trait. These two traits are semver compatible so if you have public API code depending on `BitFlags` you can move to `Flags` without breaking end-users. This is possible because the `BitFlags` trait was never publicly implementable, so it now carries `Flags` as a supertrait. All implementations of `Flags` additionally implement `BitFlags`. ++ ++The `Flags` trait is a publicly implementable version of the old `BitFlags` trait. The original `BitFlags` trait carried some macro baggage that made it difficult to implement, so a new `Flags` trait has been introduced as the _One True Trait_ for interacting with flags types generically. See the the `macro_free` and `custom_derive` examples for more details. ++ ++### `Bits` trait publicly exposed ++ ++The `Bits` trait for the underlying storage of flags values is also now publicly implementable. This lets you define your own exotic backing storage for flags. See the `custom_bits_type` example for more details. ++ ++## What's Changed ++* Use explicit hashes for actions steps by @KodrAus in https://github.com/bitflags/bitflags/pull/350 ++* Support ejecting flags types from the bitflags macro by @KodrAus in https://github.com/bitflags/bitflags/pull/351 ++ ++**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.2.1...2.3.0 ++ ++# 2.2.1 ++ ++## What's Changed ++* Refactor attribute filtering to apply per-flag by @KodrAus in https://github.com/bitflags/bitflags/pull/345 ++ ++**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.2.0...2.2.1 ++ ++# 2.2.0 ++ ++## What's Changed ++* Create SECURITY.md by @KodrAus in https://github.com/bitflags/bitflags/pull/338 ++* add docs to describe the behavior of multi-bit flags by @nicholasbishop in https://github.com/bitflags/bitflags/pull/340 ++* Add support for bytemuck by @KodrAus in https://github.com/bitflags/bitflags/pull/336 ++* Add a top-level macro for filtering attributes by @KodrAus in https://github.com/bitflags/bitflags/pull/341 ++ ++## New Contributors ++* @nicholasbishop made their first contribution in https://github.com/bitflags/bitflags/pull/340 ++ ++**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.1.0...2.2.0 ++ ++# 2.1.0 ++ ++## What's Changed ++* Add docs for the internal Field0 and examples of formatting/parsing by @KodrAus in https://github.com/bitflags/bitflags/pull/328 ++* Add support for arbitrary by @KodrAus in https://github.com/bitflags/bitflags/pull/324 ++* Fix up missing docs for consts within consts by @KodrAus in https://github.com/bitflags/bitflags/pull/330 ++* Ignore clippy lint in generated code by @Jake-Shadle in https://github.com/bitflags/bitflags/pull/331 ++ ++## New Contributors ++* @Jake-Shadle made their first contribution in https://github.com/bitflags/bitflags/pull/331 ++ ++**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.0.2...2.1.0 ++ ++# 2.0.2 ++ ++## What's Changed ++* Fix up missing isize and usize Bits impls by @KodrAus in https://github.com/bitflags/bitflags/pull/321 ++ ++**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.0.1...2.0.2 ++ ++# 2.0.1 ++ ++## What's Changed ++* Fix up some docs issues by @KodrAus in https://github.com/bitflags/bitflags/pull/309 ++* Make empty_flag() const. by @tormeh in https://github.com/bitflags/bitflags/pull/313 ++* Fix formatting of multi-bit flags with partial overlap by @KodrAus in https://github.com/bitflags/bitflags/pull/316 ++ ++## New Contributors ++* @tormeh made their first contribution in https://github.com/bitflags/bitflags/pull/313 ++ ++**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.0.0...2.0.1 ++ ++# 2.0.0 ++ ++## Major changes ++ ++This release includes some major changes over `1.x`. If you use `bitflags!` types in your public API then upgrading this library may cause breakage in your downstream users. ++ ++### ⚠️ Serialization ++ ++You'll need to add the `serde` Cargo feature in order to `#[derive(Serialize, Deserialize)]` on your generated flags types: ++ ++```rust ++bitflags! { ++ #[derive(Serialize, Deserialize)] ++ #[serde(transparent)] ++ pub struct Flags: T { ++ .. ++ } ++} ++``` ++ ++where `T` is the underlying bits type you're using, such as `u32`. ++ ++The default serialization format with `serde` **has changed** if you `#[derive(Serialize, Deserialize)]` on your generated flags types. It will now use a formatted string for human-readable formats and the underlying bits type for compact formats. ++ ++To keep the old format, see the https://github.com/KodrAus/bitflags-serde-legacy library. ++ ++### ⚠️ Traits ++ ++Generated flags types now derive fewer traits. If you need to maintain backwards compatibility, you can derive the following yourself: ++ ++```rust ++#[derive(PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Clone, Copy)] ++``` ++ ++### ⚠️ Methods ++ ++The unsafe `from_bits_unchecked` method is now a safe `from_bits_retain` method. ++ ++You can add the following method to your generated types to keep them compatible: ++ ++```rust ++#[deprecated = "use the safe `from_bits_retain` method instead"] ++pub unsafe fn from_bits_unchecked(bits: T) -> Self { ++ Self::from_bits_retain(bits) ++} ++``` ++ ++where `T` is the underlying bits type you're using, such as `u32`. ++ ++### ⚠️ `.bits` field ++ ++You can now use the `.bits()` method instead of the old `.bits`. ++ ++The representation of generated flags types has changed from a struct with the single field `bits` to a newtype. ++ ++## What's Changed ++* Fix a typo and call out MSRV bump by @KodrAus in https://github.com/bitflags/bitflags/pull/259 ++* BitFlags trait by @arturoc in https://github.com/bitflags/bitflags/pull/220 ++* Add a hidden trait to discourage manual impls of BitFlags by @KodrAus in https://github.com/bitflags/bitflags/pull/261 ++* Sanitize `Ok` by @konsumlamm in https://github.com/bitflags/bitflags/pull/266 ++* Fix bug in `Debug` implementation by @konsumlamm in https://github.com/bitflags/bitflags/pull/268 ++* Fix a typo in the generated documentation by @wackbyte in https://github.com/bitflags/bitflags/pull/271 ++* Use SPDX license format by @atouchet in https://github.com/bitflags/bitflags/pull/272 ++* serde tests fail in CI by @arturoc in https://github.com/bitflags/bitflags/pull/277 ++* Fix beta test output by @KodrAus in https://github.com/bitflags/bitflags/pull/279 ++* Add example to the README.md file by @tiaanl in https://github.com/bitflags/bitflags/pull/270 ++* Iterator over all the enabled options by @arturoc in https://github.com/bitflags/bitflags/pull/278 ++* from_bits_(truncate) fail with composite flags by @arturoc in https://github.com/bitflags/bitflags/pull/276 ++* Add more platform coverage to CI by @KodrAus in https://github.com/bitflags/bitflags/pull/280 ++* rework the way cfgs are handled by @KodrAus in https://github.com/bitflags/bitflags/pull/281 ++* Split generated code into two types by @KodrAus in https://github.com/bitflags/bitflags/pull/282 ++* expose bitflags iters using nameable types by @KodrAus in https://github.com/bitflags/bitflags/pull/286 ++* Support creating flags from their names by @KodrAus in https://github.com/bitflags/bitflags/pull/287 ++* Update README.md by @KodrAus in https://github.com/bitflags/bitflags/pull/288 ++* Prepare for 2.0.0-rc.1 release by @KodrAus in https://github.com/bitflags/bitflags/pull/289 ++* Add missing "if" to contains doc-comment in traits.rs by @rusty-snake in https://github.com/bitflags/bitflags/pull/291 ++* Forbid unsafe_code by @fintelia in https://github.com/bitflags/bitflags/pull/294 ++* serde: enable no-std support by @nim65s in https://github.com/bitflags/bitflags/pull/296 ++* Add a parser for flags formatted as bar-separated-values by @KodrAus in https://github.com/bitflags/bitflags/pull/297 ++* Prepare for 2.0.0-rc.2 release by @KodrAus in https://github.com/bitflags/bitflags/pull/299 ++* Use strip_prefix instead of starts_with + slice by @QuinnPainter in https://github.com/bitflags/bitflags/pull/301 ++* Fix up some clippy lints by @KodrAus in https://github.com/bitflags/bitflags/pull/302 ++* Prepare for 2.0.0-rc.3 release by @KodrAus in https://github.com/bitflags/bitflags/pull/303 ++* feat: Add minimum permissions to rust.yml workflow by @gabibguti in https://github.com/bitflags/bitflags/pull/305 ++ ++## New Contributors ++* @wackbyte made their first contribution in https://github.com/bitflags/bitflags/pull/271 ++* @atouchet made their first contribution in https://github.com/bitflags/bitflags/pull/272 ++* @tiaanl made their first contribution in https://github.com/bitflags/bitflags/pull/270 ++* @rusty-snake made their first contribution in https://github.com/bitflags/bitflags/pull/291 ++* @fintelia made their first contribution in https://github.com/bitflags/bitflags/pull/294 ++* @nim65s made their first contribution in https://github.com/bitflags/bitflags/pull/296 ++* @QuinnPainter made their first contribution in https://github.com/bitflags/bitflags/pull/301 ++* @gabibguti made their first contribution in https://github.com/bitflags/bitflags/pull/305 ++ ++**Full Changelog**: https://github.com/bitflags/bitflags/compare/1.3.2...2.0.0 ++ ++# 2.0.0-rc.3 ++ ++## What's Changed ++* Use strip_prefix instead of starts_with + slice by @QuinnPainter in https://github.com/bitflags/bitflags/pull/301 ++* Fix up some clippy lints by @KodrAus in https://github.com/bitflags/bitflags/pull/302 ++ ++## New Contributors ++* @QuinnPainter made their first contribution in https://github.com/bitflags/bitflags/pull/301 ++ ++**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.0.0-rc.2...2.0.0-rc.3 ++ ++# 2.0.0-rc.2 ++ ++## Changes to `serde` serialization ++ ++**⚠️ NOTE ⚠️** This release changes the default serialization you'll get if you `#[derive(Serialize, Deserialize)]` ++on your generated flags types. It will now use a formatted string for human-readable formats and the underlying bits ++type for compact formats. ++ ++To keep the old behavior, see the [`bitflags-serde-legacy`](https://github.com/KodrAus/bitflags-serde-legacy) library. ++ ++## What's Changed ++ ++* Add missing "if" to contains doc-comment in traits.rs by @rusty-snake in https://github.com/bitflags/bitflags/pull/291 ++* Forbid unsafe_code by @fintelia in https://github.com/bitflags/bitflags/pull/294 ++* serde: enable no-std support by @nim65s in https://github.com/bitflags/bitflags/pull/296 ++* Add a parser for flags formatted as bar-separated-values by @KodrAus in https://github.com/bitflags/bitflags/pull/297 ++ ++## New Contributors ++* @rusty-snake made their first contribution in https://github.com/bitflags/bitflags/pull/291 ++* @fintelia made their first contribution in https://github.com/bitflags/bitflags/pull/294 ++* @nim65s made their first contribution in https://github.com/bitflags/bitflags/pull/296 ++ ++**Full Changelog**: https://github.com/bitflags/bitflags/compare/2.0.0-rc.1...2.0.0-rc.2 ++ ++# 2.0.0-rc.1 ++ ++This is a big release including a few years worth of work on a new `BitFlags` trait, iteration, and better macro organization for future extensibility. ++ ++## What's Changed ++* Fix a typo and call out MSRV bump by @KodrAus in https://github.com/bitflags/bitflags/pull/259 ++* BitFlags trait by @arturoc in https://github.com/bitflags/bitflags/pull/220 ++* Add a hidden trait to discourage manual impls of BitFlags by @KodrAus in https://github.com/bitflags/bitflags/pull/261 ++* Sanitize `Ok` by @konsumlamm in https://github.com/bitflags/bitflags/pull/266 ++* Fix bug in `Debug` implementation by @konsumlamm in https://github.com/bitflags/bitflags/pull/268 ++* Fix a typo in the generated documentation by @wackbyte in https://github.com/bitflags/bitflags/pull/271 ++* Use SPDX license format by @atouchet in https://github.com/bitflags/bitflags/pull/272 ++* serde tests fail in CI by @arturoc in https://github.com/bitflags/bitflags/pull/277 ++* Fix beta test output by @KodrAus in https://github.com/bitflags/bitflags/pull/279 ++* Add example to the README.md file by @tiaanl in https://github.com/bitflags/bitflags/pull/270 ++* Iterator over all the enabled options by @arturoc in https://github.com/bitflags/bitflags/pull/278 ++* from_bits_(truncate) fail with composite flags by @arturoc in https://github.com/bitflags/bitflags/pull/276 ++* Add more platform coverage to CI by @KodrAus in https://github.com/bitflags/bitflags/pull/280 ++* rework the way cfgs are handled by @KodrAus in https://github.com/bitflags/bitflags/pull/281 ++* Split generated code into two types by @KodrAus in https://github.com/bitflags/bitflags/pull/282 ++* expose bitflags iters using nameable types by @KodrAus in https://github.com/bitflags/bitflags/pull/286 ++* Support creating flags from their names by @KodrAus in https://github.com/bitflags/bitflags/pull/287 ++* Update README.md by @KodrAus in https://github.com/bitflags/bitflags/pull/288 ++ ++## New Contributors ++* @wackbyte made their first contribution in https://github.com/bitflags/bitflags/pull/271 ++* @atouchet made their first contribution in https://github.com/bitflags/bitflags/pull/272 ++* @tiaanl made their first contribution in https://github.com/bitflags/bitflags/pull/270 ++ ++**Full Changelog**: https://github.com/bitflags/bitflags/compare/1.3.2...2.0.0-rc.1 ++ ++# 1.3.2 ++ ++- Allow `non_snake_case` in generated flags types ([#256]) ++ ++[#256]: https://github.com/bitflags/bitflags/pull/256 ++ ++# 1.3.1 ++ ++- Revert unconditional `#[repr(transparent)]` ([#252]) ++ ++[#252]: https://github.com/bitflags/bitflags/pull/252 ++ ++# 1.3.0 (yanked) ++ ++**This release bumps the Minimum Supported Rust Version to `1.46.0`** ++ ++- Add `#[repr(transparent)]` ([#187]) ++ ++- End `empty` doc comment with full stop ([#202]) ++ ++- Fix typo in crate root docs ([#206]) ++ ++- Document from_bits_unchecked unsafety ([#207]) ++ ++- Let `is_all` ignore extra bits ([#211]) ++ ++- Allows empty flag definition ([#225]) ++ ++- Making crate accessible from std ([#227]) ++ ++- Make `from_bits` a const fn ([#229]) ++ ++- Allow multiple bitflags structs in one macro invocation ([#235]) ++ ++- Add named functions to perform set operations ([#244]) ++ ++- Fix typos in method docs ([#245]) ++ ++- Modernization of the `bitflags` macro to take advantage of newer features and 2018 idioms ([#246]) ++ ++- Fix regression (in an unreleased feature) and simplify tests ([#247]) ++ ++- Use `Self` and fix bug when overriding `stringify!` ([#249]) ++ ++[#187]: https://github.com/bitflags/bitflags/pull/187 ++[#202]: https://github.com/bitflags/bitflags/pull/202 ++[#206]: https://github.com/bitflags/bitflags/pull/206 ++[#207]: https://github.com/bitflags/bitflags/pull/207 ++[#211]: https://github.com/bitflags/bitflags/pull/211 ++[#225]: https://github.com/bitflags/bitflags/pull/225 ++[#227]: https://github.com/bitflags/bitflags/pull/227 ++[#229]: https://github.com/bitflags/bitflags/pull/229 ++[#235]: https://github.com/bitflags/bitflags/pull/235 ++[#244]: https://github.com/bitflags/bitflags/pull/244 ++[#245]: https://github.com/bitflags/bitflags/pull/245 ++[#246]: https://github.com/bitflags/bitflags/pull/246 ++[#247]: https://github.com/bitflags/bitflags/pull/247 ++[#249]: https://github.com/bitflags/bitflags/pull/249 ++ ++# 1.2.1 ++ ++- Remove extraneous `#[inline]` attributes ([#194]) ++ ++[#194]: https://github.com/bitflags/bitflags/pull/194 ++ ++# 1.2.0 ++ ++- Fix typo: {Lower, Upper}Exp - {Lower, Upper}Hex ([#183]) ++ ++- Add support for "unknown" bits ([#188]) ++ ++[#183]: https://github.com/rust-lang-nursery/bitflags/pull/183 ++[#188]: https://github.com/rust-lang-nursery/bitflags/pull/188 ++ ++# 1.1.0 ++ ++This is a re-release of `1.0.5`, which was yanked due to a bug in the RLS. ++ ++# 1.0.5 ++ ++- Use compiletest_rs flags supported by stable toolchain ([#171]) ++ ++- Put the user provided attributes first ([#173]) ++ ++- Make bitflags methods `const` on newer compilers ([#175]) ++ ++[#171]: https://github.com/rust-lang-nursery/bitflags/pull/171 ++[#173]: https://github.com/rust-lang-nursery/bitflags/pull/173 ++[#175]: https://github.com/rust-lang-nursery/bitflags/pull/175 ++ ++# 1.0.4 ++ ++- Support Rust 2018 style macro imports ([#165]) ++ ++ ```rust ++ use bitflags::bitflags; ++ ``` ++ ++[#165]: https://github.com/rust-lang-nursery/bitflags/pull/165 ++ ++# 1.0.3 ++ ++- Improve zero value flag handling and documentation ([#157]) ++ ++[#157]: https://github.com/rust-lang-nursery/bitflags/pull/157 ++ ++# 1.0.2 ++ ++- 30% improvement in compile time of bitflags crate ([#156]) ++ ++- Documentation improvements ([#153]) ++ ++- Implementation cleanup ([#149]) ++ ++[#156]: https://github.com/rust-lang-nursery/bitflags/pull/156 ++[#153]: https://github.com/rust-lang-nursery/bitflags/pull/153 ++[#149]: https://github.com/rust-lang-nursery/bitflags/pull/149 ++ ++# 1.0.1 ++- Add support for `pub(restricted)` specifier on the bitflags struct ([#135]) ++- Optimize performance of `all()` when called from a separate crate ([#136]) ++ ++[#135]: https://github.com/rust-lang-nursery/bitflags/pull/135 ++[#136]: https://github.com/rust-lang-nursery/bitflags/pull/136 ++ ++# 1.0.0 ++- **[breaking change]** Macro now generates [associated constants](https://doc.rust-lang.org/reference/items.html#associated-constants) ([#24]) ++ ++- **[breaking change]** Minimum supported version is Rust **1.20**, due to usage of associated constants ++ ++- After being broken in 0.9, the `#[deprecated]` attribute is now supported again ([#112]) ++ ++- Other improvements to unit tests and documentation ([#106] and [#115]) ++ ++[#24]: https://github.com/rust-lang-nursery/bitflags/pull/24 ++[#106]: https://github.com/rust-lang-nursery/bitflags/pull/106 ++[#112]: https://github.com/rust-lang-nursery/bitflags/pull/112 ++[#115]: https://github.com/rust-lang-nursery/bitflags/pull/115 ++ ++## How to update your code to use associated constants ++Assuming the following structure definition: ++```rust ++bitflags! { ++ struct Something: u8 { ++ const FOO = 0b01, ++ const BAR = 0b10 ++ } ++} ++``` ++In 0.9 and older you could do: ++```rust ++let x = FOO.bits | BAR.bits; ++``` ++Now you must use: ++```rust ++let x = Something::FOO.bits | Something::BAR.bits; ++``` ++ ++# 0.9.1 ++- Fix the implementation of `Formatting` traits when other formatting traits were present in scope ([#105]) ++ ++[#105]: https://github.com/rust-lang-nursery/bitflags/pull/105 ++ ++# 0.9.0 ++- **[breaking change]** Use struct keyword instead of flags to define bitflag types ([#84]) ++ ++- **[breaking change]** Terminate const items with semicolons instead of commas ([#87]) ++ ++- Implement the `Hex`, `Octal`, and `Binary` formatting traits ([#86]) ++ ++- Printing an empty flag value with the `Debug` trait now prints "(empty)" instead of nothing ([#85]) ++ ++- The `bitflags!` macro can now be used inside of a fn body, to define a type local to that function ([#74]) ++ ++[#74]: https://github.com/rust-lang-nursery/bitflags/pull/74 ++[#84]: https://github.com/rust-lang-nursery/bitflags/pull/84 ++[#85]: https://github.com/rust-lang-nursery/bitflags/pull/85 ++[#86]: https://github.com/rust-lang-nursery/bitflags/pull/86 ++[#87]: https://github.com/rust-lang-nursery/bitflags/pull/87 ++ ++# 0.8.2 ++- Update feature flag used when building bitflags as a dependency of the Rust toolchain ++ ++# 0.8.1 ++- Allow bitflags to be used as a dependency of the Rust toolchain ++ ++# 0.8.0 ++- Add support for the experimental `i128` and `u128` integer types ([#57]) ++- Add set method: `flags.set(SOME_FLAG, true)` or `flags.set(SOME_FLAG, false)` ([#55]) ++ This may break code that defines its own set method ++ ++[#55]: https://github.com/rust-lang-nursery/bitflags/pull/55 ++[#57]: https://github.com/rust-lang-nursery/bitflags/pull/57 ++ ++# 0.7.1 ++*(yanked)* ++ ++# 0.7.0 ++- Implement the Extend trait ([#49]) ++- Allow definitions inside the `bitflags!` macro to refer to items imported from other modules ([#51]) ++ ++[#49]: https://github.com/rust-lang-nursery/bitflags/pull/49 ++[#51]: https://github.com/rust-lang-nursery/bitflags/pull/51 ++ ++# 0.6.0 ++- The `no_std` feature was removed as it is now the default ++- The `assignment_operators` feature was remove as it is now enabled by default ++- Some clippy suggestions have been applied +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/CODE_OF_CONDUCT.md mesa-25.3.3/subprojects/bitflags-2.8.0/CODE_OF_CONDUCT.md +--- mesa-25.3.3/subprojects/bitflags-2.8.0/CODE_OF_CONDUCT.md 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/CODE_OF_CONDUCT.md 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,73 @@ ++# Contributor Covenant Code of Conduct ++ ++## Our Pledge ++ ++In the interest of fostering an open and welcoming environment, we as ++contributors and maintainers pledge to making participation in our project and ++our community a harassment-free experience for everyone, regardless of age, body ++size, disability, ethnicity, gender identity and expression, level of experience, ++education, socio-economic status, nationality, personal appearance, race, ++religion, or sexual identity and orientation. ++ ++## Our Standards ++ ++Examples of behavior that contributes to creating a positive environment ++include: ++ ++* Using welcoming and inclusive language ++* Being respectful of differing viewpoints and experiences ++* Gracefully accepting constructive criticism ++* Focusing on what is best for the community ++* Showing empathy towards other community members ++ ++Examples of unacceptable behavior by participants include: ++ ++* The use of sexualized language or imagery and unwelcome sexual attention or ++ advances ++* Trolling, insulting/derogatory comments, and personal or political attacks ++* Public or private harassment ++* Publishing others' private information, such as a physical or electronic ++ address, without explicit permission ++* Other conduct which could reasonably be considered inappropriate in a ++ professional setting ++ ++## Our Responsibilities ++ ++Project maintainers are responsible for clarifying the standards of acceptable ++behavior and are expected to take appropriate and fair corrective action in ++response to any instances of unacceptable behavior. ++ ++Project maintainers have the right and responsibility to remove, edit, or ++reject comments, commits, code, wiki edits, issues, and other contributions ++that are not aligned to this Code of Conduct, or to ban temporarily or ++permanently any contributor for other behaviors that they deem inappropriate, ++threatening, offensive, or harmful. ++ ++## Scope ++ ++This Code of Conduct applies both within project spaces and in public spaces ++when an individual is representing the project or its community. Examples of ++representing a project or community include using an official project e-mail ++address, posting via an official social media account, or acting as an appointed ++representative at an online or offline event. Representation of a project may be ++further defined and clarified by project maintainers. ++ ++## Enforcement ++ ++Instances of abusive, harassing, or otherwise unacceptable behavior may be ++reported by contacting the project team at coc@senaite.org. All ++complaints will be reviewed and investigated and will result in a response that ++is deemed necessary and appropriate to the circumstances. The project team is ++obligated to maintain confidentiality with regard to the reporter of an incident. ++Further details of specific enforcement policies may be posted separately. ++ ++Project maintainers who do not follow or enforce the Code of Conduct in good ++faith may face temporary or permanent repercussions as determined by other ++members of the project's leadership. ++ ++## Attribution ++ ++This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, ++available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html ++ ++[homepage]: https://www.contributor-covenant.org +\ No hay ningún carácter de nueva línea al final del archivo +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/CONTRIBUTING.md mesa-25.3.3/subprojects/bitflags-2.8.0/CONTRIBUTING.md +--- mesa-25.3.3/subprojects/bitflags-2.8.0/CONTRIBUTING.md 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/CONTRIBUTING.md 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,9 @@ ++# Updating compile-fail test outputs ++ ++`bitflags` uses the `trybuild` crate to integration test its macros. Since Rust error messages change frequently enough that `nightly` builds produce spurious failures, we only check the compiler output in `beta` builds. If you run: ++ ++``` ++TRYBUILD=overwrite cargo +beta test --all ++``` ++ ++it will run the tests and update the `trybuild` output files. +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/debian/patches/disable-zerocopy.patch mesa-25.3.3/subprojects/bitflags-2.8.0/debian/patches/disable-zerocopy.patch +--- mesa-25.3.3/subprojects/bitflags-2.8.0/debian/patches/disable-zerocopy.patch 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/debian/patches/disable-zerocopy.patch 2025-02-06 13:31:16.000000000 -0500 +@@ -0,0 +1,26 @@ ++Index: bitflags/Cargo.toml ++=================================================================== ++--- bitflags.orig/Cargo.toml +++++ bitflags/Cargo.toml ++@@ -53,10 +53,6 @@ name = "custom_bits_type" ++ path = "examples/custom_bits_type.rs" ++ ++ [[example]] ++-name = "custom_derive" ++-path = "examples/custom_derive.rs" ++- ++-[[example]] ++ name = "fmt" ++ path = "examples/fmt.rs" ++ ++@@ -117,10 +113,6 @@ version = "1.0.19" ++ [dev-dependencies.trybuild] ++ version = "1.0.18" ++ ++-[dev-dependencies.zerocopy] ++-version = "0.8" ++-features = ["derive"] ++- ++ [features] ++ example_generated = [] ++ rustc-dep-of-std = [ +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/debian/patches/series mesa-25.3.3/subprojects/bitflags-2.8.0/debian/patches/series +--- mesa-25.3.3/subprojects/bitflags-2.8.0/debian/patches/series 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/debian/patches/series 2025-02-06 13:31:16.000000000 -0500 +@@ -0,0 +1 @@ ++disable-zerocopy.patch +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/examples/custom_bits_type.rs mesa-25.3.3/subprojects/bitflags-2.8.0/examples/custom_bits_type.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/examples/custom_bits_type.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/examples/custom_bits_type.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,97 @@ ++use std::ops::{BitAnd, BitOr, BitXor, Not}; ++ ++use bitflags::{Bits, Flag, Flags}; ++ ++// Define a custom container that can be used in flags types ++// Note custom bits types can't be used in `bitflags!` ++// without making the trait impls `const`. This is currently ++// unstable ++#[derive(Clone, Copy, Debug)] ++pub struct CustomBits([bool; 3]); ++ ++impl Bits for CustomBits { ++ const EMPTY: Self = CustomBits([false; 3]); ++ ++ const ALL: Self = CustomBits([true; 3]); ++} ++ ++impl PartialEq for CustomBits { ++ fn eq(&self, other: &Self) -> bool { ++ self.0 == other.0 ++ } ++} ++ ++impl BitAnd for CustomBits { ++ type Output = Self; ++ ++ fn bitand(self, other: Self) -> Self { ++ CustomBits([ ++ self.0[0] & other.0[0], ++ self.0[1] & other.0[1], ++ self.0[2] & other.0[2], ++ ]) ++ } ++} ++ ++impl BitOr for CustomBits { ++ type Output = Self; ++ ++ fn bitor(self, other: Self) -> Self { ++ CustomBits([ ++ self.0[0] | other.0[0], ++ self.0[1] | other.0[1], ++ self.0[2] | other.0[2], ++ ]) ++ } ++} ++ ++impl BitXor for CustomBits { ++ type Output = Self; ++ ++ fn bitxor(self, other: Self) -> Self { ++ CustomBits([ ++ self.0[0] & other.0[0], ++ self.0[1] & other.0[1], ++ self.0[2] & other.0[2], ++ ]) ++ } ++} ++ ++impl Not for CustomBits { ++ type Output = Self; ++ ++ fn not(self) -> Self { ++ CustomBits([!self.0[0], !self.0[1], !self.0[2]]) ++ } ++} ++ ++#[derive(Clone, Copy, Debug)] ++pub struct CustomFlags(CustomBits); ++ ++impl CustomFlags { ++ pub const A: Self = CustomFlags(CustomBits([true, false, false])); ++ pub const B: Self = CustomFlags(CustomBits([false, true, false])); ++ pub const C: Self = CustomFlags(CustomBits([false, false, true])); ++} ++ ++impl Flags for CustomFlags { ++ const FLAGS: &'static [Flag] = &[ ++ Flag::new("A", Self::A), ++ Flag::new("B", Self::B), ++ Flag::new("C", Self::C), ++ ]; ++ ++ type Bits = CustomBits; ++ ++ fn bits(&self) -> Self::Bits { ++ self.0 ++ } ++ ++ fn from_bits_retain(bits: Self::Bits) -> Self { ++ CustomFlags(bits) ++ } ++} ++ ++fn main() { ++ println!("{:?}", CustomFlags::A.union(CustomFlags::C)); ++} +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/examples/custom_derive.rs mesa-25.3.3/subprojects/bitflags-2.8.0/examples/custom_derive.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/examples/custom_derive.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/examples/custom_derive.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,23 @@ ++//! An example of implementing the `BitFlags` trait manually for a flags type. ++ ++use std::str; ++ ++use bitflags::bitflags; ++ ++// Define a flags type outside of the `bitflags` macro as a newtype ++// It can accept custom derives for libraries `bitflags` doesn't support natively ++#[derive(zerocopy::IntoBytes, zerocopy::FromBytes, zerocopy::KnownLayout, zerocopy::Immutable)] ++#[repr(transparent)] ++pub struct ManualFlags(u32); ++ ++// Next: use `impl Flags` instead of `struct Flags` ++bitflags! { ++ impl ManualFlags: u32 { ++ const A = 0b00000001; ++ const B = 0b00000010; ++ const C = 0b00000100; ++ const ABC = Self::A.bits() | Self::B.bits() | Self::C.bits(); ++ } ++} ++ ++fn main() {} +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/examples/fmt.rs mesa-25.3.3/subprojects/bitflags-2.8.0/examples/fmt.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/examples/fmt.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/examples/fmt.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,49 @@ ++//! An example of implementing Rust's standard formatting and parsing traits for flags types. ++ ++use core::{fmt, str}; ++ ++bitflags::bitflags! { ++ // You can `#[derive]` the `Debug` trait, but implementing it manually ++ // can produce output like `A | B` instead of `Flags(A | B)`. ++ // #[derive(Debug)] ++ #[derive(PartialEq, Eq)] ++ pub struct Flags: u32 { ++ const A = 1; ++ const B = 2; ++ const C = 4; ++ const D = 8; ++ } ++} ++ ++impl fmt::Debug for Flags { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ bitflags::parser::to_writer(self, f) ++ } ++} ++ ++impl fmt::Display for Flags { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ bitflags::parser::to_writer(self, f) ++ } ++} ++ ++impl str::FromStr for Flags { ++ type Err = bitflags::parser::ParseError; ++ ++ fn from_str(flags: &str) -> Result { ++ bitflags::parser::from_str(flags) ++ } ++} ++ ++fn main() -> Result<(), bitflags::parser::ParseError> { ++ let flags = Flags::A | Flags::B; ++ ++ println!("{}", flags); ++ ++ let formatted = flags.to_string(); ++ let parsed: Flags = formatted.parse()?; ++ ++ assert_eq!(flags, parsed); ++ ++ Ok(()) ++} +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/examples/macro_free.rs mesa-25.3.3/subprojects/bitflags-2.8.0/examples/macro_free.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/examples/macro_free.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/examples/macro_free.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,61 @@ ++//! An example of implementing the `BitFlags` trait manually for a flags type. ++//! ++//! This example doesn't use any macros. ++ ++use std::{fmt, str}; ++ ++use bitflags::{Flag, Flags}; ++ ++// First: Define your flags type. It just needs to be `Sized + 'static`. ++pub struct ManualFlags(u32); ++ ++// Not required: Define some constants for valid flags ++impl ManualFlags { ++ pub const A: ManualFlags = ManualFlags(0b00000001); ++ pub const B: ManualFlags = ManualFlags(0b00000010); ++ pub const C: ManualFlags = ManualFlags(0b00000100); ++ pub const ABC: ManualFlags = ManualFlags(0b00000111); ++} ++ ++// Next: Implement the `BitFlags` trait, specifying your set of valid flags ++// and iterators ++impl Flags for ManualFlags { ++ const FLAGS: &'static [Flag] = &[ ++ Flag::new("A", Self::A), ++ Flag::new("B", Self::B), ++ Flag::new("C", Self::C), ++ ]; ++ ++ type Bits = u32; ++ ++ fn bits(&self) -> u32 { ++ self.0 ++ } ++ ++ fn from_bits_retain(bits: u32) -> Self { ++ Self(bits) ++ } ++} ++ ++// Not required: Add parsing support ++impl str::FromStr for ManualFlags { ++ type Err = bitflags::parser::ParseError; ++ ++ fn from_str(input: &str) -> Result { ++ bitflags::parser::from_str(input) ++ } ++} ++ ++// Not required: Add formatting support ++impl fmt::Display for ManualFlags { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ bitflags::parser::to_writer(self, f) ++ } ++} ++ ++fn main() { ++ println!( ++ "{}", ++ ManualFlags::A.union(ManualFlags::B).union(ManualFlags::C) ++ ); ++} +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/examples/serde.rs mesa-25.3.3/subprojects/bitflags-2.8.0/examples/serde.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/examples/serde.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/examples/serde.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,36 @@ ++//! An example of implementing `serde::Serialize` and `serde::Deserialize`. ++//! The `#[serde(transparent)]` attribute is recommended to serialize directly ++//! to the underlying bits type without wrapping it in a `serde` newtype. ++ ++#[cfg(feature = "serde")] ++fn main() { ++ use serde_derive::*; ++ ++ bitflags::bitflags! { ++ #[derive(Serialize, Deserialize, Debug, PartialEq, Eq)] ++ #[serde(transparent)] ++ pub struct Flags: u32 { ++ const A = 1; ++ const B = 2; ++ const C = 4; ++ const D = 8; ++ } ++ } ++ ++ let flags = Flags::A | Flags::B; ++ ++ let serialized = serde_json::to_string(&flags).unwrap(); ++ ++ println!("{:?} -> {}", flags, serialized); ++ ++ assert_eq!(serialized, r#""A | B""#); ++ ++ let deserialized: Flags = serde_json::from_str(&serialized).unwrap(); ++ ++ println!("{} -> {:?}", serialized, flags); ++ ++ assert_eq!(deserialized, flags); ++} ++ ++#[cfg(not(feature = "serde"))] ++fn main() {} +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/.gitignore mesa-25.3.3/subprojects/bitflags-2.8.0/.gitignore +--- mesa-25.3.3/subprojects/bitflags-2.8.0/.gitignore 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/.gitignore 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,5 @@ ++wip ++target ++Cargo.lock ++ ++/.idea/ +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/LICENSE-APACHE mesa-25.3.3/subprojects/bitflags-2.8.0/LICENSE-APACHE +--- mesa-25.3.3/subprojects/bitflags-2.8.0/LICENSE-APACHE 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/LICENSE-APACHE 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,201 @@ ++ Apache License ++ Version 2.0, January 2004 ++ http://www.apache.org/licenses/ ++ ++TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION ++ ++1. Definitions. ++ ++ "License" shall mean the terms and conditions for use, reproduction, ++ and distribution as defined by Sections 1 through 9 of this document. ++ ++ "Licensor" shall mean the copyright owner or entity authorized by ++ the copyright owner that is granting the License. ++ ++ "Legal Entity" shall mean the union of the acting entity and all ++ other entities that control, are controlled by, or are under common ++ control with that entity. For the purposes of this definition, ++ "control" means (i) the power, direct or indirect, to cause the ++ direction or management of such entity, whether by contract or ++ otherwise, or (ii) ownership of fifty percent (50%) or more of the ++ outstanding shares, or (iii) beneficial ownership of such entity. ++ ++ "You" (or "Your") shall mean an individual or Legal Entity ++ exercising permissions granted by this License. ++ ++ "Source" form shall mean the preferred form for making modifications, ++ including but not limited to software source code, documentation ++ source, and configuration files. ++ ++ "Object" form shall mean any form resulting from mechanical ++ transformation or translation of a Source form, including but ++ not limited to compiled object code, generated documentation, ++ and conversions to other media types. ++ ++ "Work" shall mean the work of authorship, whether in Source or ++ Object form, made available under the License, as indicated by a ++ copyright notice that is included in or attached to the work ++ (an example is provided in the Appendix below). ++ ++ "Derivative Works" shall mean any work, whether in Source or Object ++ form, that is based on (or derived from) the Work and for which the ++ editorial revisions, annotations, elaborations, or other modifications ++ represent, as a whole, an original work of authorship. For the purposes ++ of this License, Derivative Works shall not include works that remain ++ separable from, or merely link (or bind by name) to the interfaces of, ++ the Work and Derivative Works thereof. ++ ++ "Contribution" shall mean any work of authorship, including ++ the original version of the Work and any modifications or additions ++ to that Work or Derivative Works thereof, that is intentionally ++ submitted to Licensor for inclusion in the Work by the copyright owner ++ or by an individual or Legal Entity authorized to submit on behalf of ++ the copyright owner. For the purposes of this definition, "submitted" ++ means any form of electronic, verbal, or written communication sent ++ to the Licensor or its representatives, including but not limited to ++ communication on electronic mailing lists, source code control systems, ++ and issue tracking systems that are managed by, or on behalf of, the ++ Licensor for the purpose of discussing and improving the Work, but ++ excluding communication that is conspicuously marked or otherwise ++ designated in writing by the copyright owner as "Not a Contribution." ++ ++ "Contributor" shall mean Licensor and any individual or Legal Entity ++ on behalf of whom a Contribution has been received by Licensor and ++ subsequently incorporated within the Work. ++ ++2. Grant of Copyright License. Subject to the terms and conditions of ++ this License, each Contributor hereby grants to You a perpetual, ++ worldwide, non-exclusive, no-charge, royalty-free, irrevocable ++ copyright license to reproduce, prepare Derivative Works of, ++ publicly display, publicly perform, sublicense, and distribute the ++ Work and such Derivative Works in Source or Object form. ++ ++3. Grant of Patent License. Subject to the terms and conditions of ++ this License, each Contributor hereby grants to You a perpetual, ++ worldwide, non-exclusive, no-charge, royalty-free, irrevocable ++ (except as stated in this section) patent license to make, have made, ++ use, offer to sell, sell, import, and otherwise transfer the Work, ++ where such license applies only to those patent claims licensable ++ by such Contributor that are necessarily infringed by their ++ Contribution(s) alone or by combination of their Contribution(s) ++ with the Work to which such Contribution(s) was submitted. If You ++ institute patent litigation against any entity (including a ++ cross-claim or counterclaim in a lawsuit) alleging that the Work ++ or a Contribution incorporated within the Work constitutes direct ++ or contributory patent infringement, then any patent licenses ++ granted to You under this License for that Work shall terminate ++ as of the date such litigation is filed. ++ ++4. Redistribution. You may reproduce and distribute copies of the ++ Work or Derivative Works thereof in any medium, with or without ++ modifications, and in Source or Object form, provided that You ++ meet the following conditions: ++ ++ (a) You must give any other recipients of the Work or ++ Derivative Works a copy of this License; and ++ ++ (b) You must cause any modified files to carry prominent notices ++ stating that You changed the files; and ++ ++ (c) You must retain, in the Source form of any Derivative Works ++ that You distribute, all copyright, patent, trademark, and ++ attribution notices from the Source form of the Work, ++ excluding those notices that do not pertain to any part of ++ the Derivative Works; and ++ ++ (d) If the Work includes a "NOTICE" text file as part of its ++ distribution, then any Derivative Works that You distribute must ++ include a readable copy of the attribution notices contained ++ within such NOTICE file, excluding those notices that do not ++ pertain to any part of the Derivative Works, in at least one ++ of the following places: within a NOTICE text file distributed ++ as part of the Derivative Works; within the Source form or ++ documentation, if provided along with the Derivative Works; or, ++ within a display generated by the Derivative Works, if and ++ wherever such third-party notices normally appear. The contents ++ of the NOTICE file are for informational purposes only and ++ do not modify the License. You may add Your own attribution ++ notices within Derivative Works that You distribute, alongside ++ or as an addendum to the NOTICE text from the Work, provided ++ that such additional attribution notices cannot be construed ++ as modifying the License. ++ ++ You may add Your own copyright statement to Your modifications and ++ may provide additional or different license terms and conditions ++ for use, reproduction, or distribution of Your modifications, or ++ for any such Derivative Works as a whole, provided Your use, ++ reproduction, and distribution of the Work otherwise complies with ++ the conditions stated in this License. ++ ++5. Submission of Contributions. Unless You explicitly state otherwise, ++ any Contribution intentionally submitted for inclusion in the Work ++ by You to the Licensor shall be under the terms and conditions of ++ this License, without any additional terms or conditions. ++ Notwithstanding the above, nothing herein shall supersede or modify ++ the terms of any separate license agreement you may have executed ++ with Licensor regarding such Contributions. ++ ++6. Trademarks. This License does not grant permission to use the trade ++ names, trademarks, service marks, or product names of the Licensor, ++ except as required for reasonable and customary use in describing the ++ origin of the Work and reproducing the content of the NOTICE file. ++ ++7. Disclaimer of Warranty. Unless required by applicable law or ++ agreed to in writing, Licensor provides the Work (and each ++ Contributor provides its Contributions) on an "AS IS" BASIS, ++ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or ++ implied, including, without limitation, any warranties or conditions ++ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A ++ PARTICULAR PURPOSE. You are solely responsible for determining the ++ appropriateness of using or redistributing the Work and assume any ++ risks associated with Your exercise of permissions under this License. ++ ++8. Limitation of Liability. In no event and under no legal theory, ++ whether in tort (including negligence), contract, or otherwise, ++ unless required by applicable law (such as deliberate and grossly ++ negligent acts) or agreed to in writing, shall any Contributor be ++ liable to You for damages, including any direct, indirect, special, ++ incidental, or consequential damages of any character arising as a ++ result of this License or out of the use or inability to use the ++ Work (including but not limited to damages for loss of goodwill, ++ work stoppage, computer failure or malfunction, or any and all ++ other commercial damages or losses), even if such Contributor ++ has been advised of the possibility of such damages. ++ ++9. Accepting Warranty or Additional Liability. While redistributing ++ the Work or Derivative Works thereof, You may choose to offer, ++ and charge a fee for, acceptance of support, warranty, indemnity, ++ or other liability obligations and/or rights consistent with this ++ License. However, in accepting such obligations, You may act only ++ on Your own behalf and on Your sole responsibility, not on behalf ++ of any other Contributor, and only if You agree to indemnify, ++ defend, and hold each Contributor harmless for any liability ++ incurred by, or claims asserted against, such Contributor by reason ++ of your accepting any such warranty or additional liability. ++ ++END OF TERMS AND CONDITIONS ++ ++APPENDIX: How to apply the Apache License to your work. ++ ++ To apply the Apache License to your work, attach the following ++ boilerplate notice, with the fields enclosed by brackets "[]" ++ replaced with your own identifying information. (Don't include ++ the brackets!) The text should be enclosed in the appropriate ++ comment syntax for the file format. We also recommend that a ++ file or class name and description of purpose be included on the ++ same "printed page" as the copyright notice for easier ++ identification within third-party archives. ++ ++Copyright [yyyy] [name of copyright owner] ++ ++Licensed under the Apache License, Version 2.0 (the "License"); ++you may not use this file except in compliance with the License. ++You may obtain a copy of the License at ++ ++ http://www.apache.org/licenses/LICENSE-2.0 ++ ++Unless required by applicable law or agreed to in writing, software ++distributed under the License is distributed on an "AS IS" BASIS, ++WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++See the License for the specific language governing permissions and ++limitations under the License. +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/LICENSE-MIT mesa-25.3.3/subprojects/bitflags-2.8.0/LICENSE-MIT +--- mesa-25.3.3/subprojects/bitflags-2.8.0/LICENSE-MIT 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/LICENSE-MIT 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,25 @@ ++Copyright (c) 2014 The Rust Project Developers ++ ++Permission is hereby granted, free of charge, to any ++person obtaining a copy of this software and associated ++documentation files (the "Software"), to deal in the ++Software without restriction, including without ++limitation the rights to use, copy, modify, merge, ++publish, distribute, sublicense, and/or sell copies of ++the Software, and to permit persons to whom the Software ++is furnished to do so, subject to the following ++conditions: ++ ++The above copyright notice and this permission notice ++shall be included in all copies or substantial portions ++of the Software. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ++ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED ++TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A ++PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT ++SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ++CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION ++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR ++IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ++DEALINGS IN THE SOFTWARE. +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/meson.build mesa-25.3.3/subprojects/bitflags-2.8.0/meson.build +--- mesa-25.3.3/subprojects/bitflags-2.8.0/meson.build 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/meson.build 2026-05-27 11:35:47.000000000 -0500 +@@ -0,0 +1,16 @@ ++# Copyright © 2024 Google ++# SPDX-License-Identifier: MIT ++ ++project('bitflags', 'rust', version : '2.8.0', license : 'MIT OR Apache-2.0') ++ ++lib = static_library( ++ 'bitflags', ++ 'src/lib.rs', ++ override_options : ['rust_std=2021', 'build.rust_std=2021'], ++ rust_abi : 'rust', ++ native : true, ++) ++ ++dep_bitflags = declare_dependency( ++ link_with : [lib] ++) +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/.meson-subproject-wrap-hash.txt mesa-25.3.3/subprojects/bitflags-2.8.0/.meson-subproject-wrap-hash.txt +--- mesa-25.3.3/subprojects/bitflags-2.8.0/.meson-subproject-wrap-hash.txt 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/.meson-subproject-wrap-hash.txt 2026-05-29 13:40:51.000000000 -0500 +@@ -0,0 +1 @@ ++07a6e11c7bc815d317e6f613f907530df829592404822703c05b8612b72f0250 +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/README.md mesa-25.3.3/subprojects/bitflags-2.8.0/README.md +--- mesa-25.3.3/subprojects/bitflags-2.8.0/README.md 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/README.md 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,77 @@ ++bitflags ++======== ++ ++[![Rust](https://github.com/bitflags/bitflags/workflows/Rust/badge.svg)](https://github.com/bitflags/bitflags/actions) ++[![Latest version](https://img.shields.io/crates/v/bitflags.svg)](https://crates.io/crates/bitflags) ++[![Documentation](https://docs.rs/bitflags/badge.svg)](https://docs.rs/bitflags) ++![License](https://img.shields.io/crates/l/bitflags.svg) ++ ++`bitflags` generates flags enums with well-defined semantics and ergonomic end-user APIs. ++ ++You can use `bitflags` to: ++ ++- provide more user-friendly bindings to C APIs where flags may or may not be fully known in advance. ++- generate efficient options types with string parsing and formatting support. ++ ++You can't use `bitflags` to: ++ ++- guarantee only bits corresponding to defined flags will ever be set. `bitflags` allows access to the underlying bits type so arbitrary bits may be set. ++- define bitfields. `bitflags` only generates types where set bits denote the presence of some combination of flags. ++ ++- [Documentation](https://docs.rs/bitflags) ++- [Specification](https://github.com/bitflags/bitflags/blob/main/spec.md) ++- [Release notes](https://github.com/bitflags/bitflags/releases) ++ ++## Usage ++ ++Add this to your `Cargo.toml`: ++ ++```toml ++[dependencies] ++bitflags = "2.8.0" ++``` ++ ++and this to your source code: ++ ++```rust ++use bitflags::bitflags; ++``` ++ ++## Example ++ ++Generate a flags structure: ++ ++```rust ++use bitflags::bitflags; ++ ++// The `bitflags!` macro generates `struct`s that manage a set of flags. ++bitflags! { ++ /// Represents a set of flags. ++ #[derive(Debug, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] ++ struct Flags: u32 { ++ /// The value `A`, at bit position `0`. ++ const A = 0b00000001; ++ /// The value `B`, at bit position `1`. ++ const B = 0b00000010; ++ /// The value `C`, at bit position `2`. ++ const C = 0b00000100; ++ ++ /// The combination of `A`, `B`, and `C`. ++ const ABC = Self::A.bits() | Self::B.bits() | Self::C.bits(); ++ } ++} ++ ++fn main() { ++ let e1 = Flags::A | Flags::C; ++ let e2 = Flags::B | Flags::C; ++ assert_eq!((e1 | e2), Flags::ABC); // union ++ assert_eq!((e1 & e2), Flags::C); // intersection ++ assert_eq!((e1 - e2), Flags::A); // set difference ++ assert_eq!(!e2, Flags::A); // set complement ++} ++``` ++ ++## Rust Version Support ++ ++The minimum supported Rust version is documented in the `Cargo.toml` file. ++This may be bumped in minor releases as necessary. +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/SECURITY.md mesa-25.3.3/subprojects/bitflags-2.8.0/SECURITY.md +--- mesa-25.3.3/subprojects/bitflags-2.8.0/SECURITY.md 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/SECURITY.md 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,13 @@ ++# Security Policy ++ ++## Supported Versions ++ ++Security updates are applied only to the latest release. ++ ++## Reporting a Vulnerability ++ ++If you have discovered a security vulnerability in this project, please report it privately. **Do not disclose it as a public issue.** This gives us time to work with you to fix the issue before public exposure, reducing the chance that the exploit will be used before a patch is released. ++ ++Please disclose it at [security advisory](https://github.com/bitflags/bitflags/security/advisories/new). ++ ++This project is maintained by a team of volunteers on a reasonable-effort basis. As such, please give us at least 90 days to work on a fix before public exposure. +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/spec.md mesa-25.3.3/subprojects/bitflags-2.8.0/spec.md +--- mesa-25.3.3/subprojects/bitflags-2.8.0/spec.md 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/spec.md 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,552 @@ ++# Bitflags ++ ++`bitflags` generates flags enums with well-defined semantics and ergonomic end-user APIs. ++ ++You can use `bitflags` to: ++ ++- provide more user-friendly bindings to C APIs where flags may or may not be fully known in advance. ++- generate efficient options types with string parsing and formatting support. ++ ++You can't use `bitflags` to: ++ ++- guarantee only bits corresponding to defined flags will ever be set. `bitflags` allows access to the underlying bits type so arbitrary bits may be set. ++- define bitfields. `bitflags` only generates types where set bits denote the presence of some combination of flags. ++ ++## Definitions ++ ++This section formally defines the terminology and semantics of `bitflags`. It's organized so more fundamental concepts are introduced before those that build on them. It may be helpful to start from the bottom of the section and refer back up to concepts defined earlier. ++ ++Examples use `bitflags` syntax with `u8` as the bits type. ++ ++### Bits type ++ ++A type that defines a fixed number of bits at specific locations. ++ ++---- ++ ++Bits types are typically fixed-width unsigned integers. For example, `u8` is a bits type that defines 8 bits; bit-0 through bit-7. ++ ++### Bits value ++ ++An instance of a bits type where each bit may be set (`1`) or unset (`0`). ++ ++---- ++ ++Some examples of bits values for the bits type `u8` are: ++ ++```rust ++0b0000_0000 ++0b1111_1111 ++0b1010_0101 ++``` ++ ++#### Equality ++ ++Two bits values are equal if their bits are in the same configuration; set bits in one are set in the other, and unset bits in one are unset in the other. ++ ++#### Operations ++ ++Bits values define the bitwise operators and (`&`), or (`|`), exclusive-or (`^`), and negation (`!`) that apply to each of their bits. ++ ++### Flag ++ ++A set of bits in a bits type that may have a unique name. ++ ++---- ++ ++Bits are not required to be exclusive to a flag. Bits are not required to be contiguous. ++ ++The following is a flag for `u8` with the name `A` that includes bit-0: ++ ++```rust ++const A = 0b0000_0001; ++``` ++ ++The following is a flag for `u8` with the name `B` that includes bit-0, and bit-5: ++ ++```rust ++const B = 0b0010_0001; ++``` ++ ++#### Named flag ++ ++A flag with a name. ++ ++---- ++ ++The following is a named flag, where the name is `A`: ++ ++```rust ++const A = 0b0000_0001; ++``` ++ ++#### Unnamed flag ++ ++A flag without a name. ++ ++---- ++ ++The following is an unnamed flag: ++ ++```rust ++const _ = 0b0000_0001; ++``` ++ ++#### Zero-bit flag ++ ++A flag with a set of zero bits. ++ ++---- ++ ++The following is a zero-bit flag: ++ ++```rust ++const ZERO = 0b0000_0000; ++``` ++ ++#### Single-bit flag ++ ++A flag with a set of one bit. ++ ++---- ++ ++The following are single-bit flags: ++ ++```rust ++const A = 0b0000_0001; ++const B = 0b0000_0010; ++``` ++ ++#### Multi-bit flag ++ ++A flag with a set of more than one bit. ++ ++---- ++ ++The following are multi-bit flags: ++ ++```rust ++const A = 0b0000_0011; ++const B = 0b1111_1111; ++``` ++ ++### Flags type ++ ++A set of defined flags over a specific bits type. ++ ++#### Known bit ++ ++A bit in any defined flag. ++ ++---- ++ ++In the following flags type: ++ ++```rust ++struct Flags { ++ const A = 0b0000_0001; ++ const B = 0b0000_0010; ++ const C = 0b0000_0100; ++} ++``` ++ ++the known bits are: ++ ++```rust ++0b0000_0111 ++``` ++ ++#### Unknown bit ++ ++A bit not in any defined flag. ++ ++---- ++ ++In the following flags type: ++ ++```rust ++struct Flags { ++ const A = 0b0000_0001; ++ const B = 0b0000_0010; ++ const C = 0b0000_0100; ++} ++``` ++ ++the unknown bits are: ++ ++```rust ++0b1111_1000 ++``` ++ ++### Flags value ++ ++An instance of a flags type using its specific bits value for storage. ++ ++The flags value of a flag is one where each of its bits is set, and all others are unset. ++ ++#### Contains ++ ++Whether all set bits in a source flags value are also set in a target flags value. ++ ++---- ++ ++Given the flags value: ++ ++```rust ++0b0000_0011 ++``` ++ ++the following flags values are contained: ++ ++```rust ++0b0000_0000 ++0b0000_0010 ++0b0000_0001 ++0b0000_0011 ++``` ++ ++but the following flags values are not contained: ++ ++```rust ++0b0000_1000 ++0b0000_0110 ++``` ++ ++#### Intersects ++ ++Whether any set bits in a source flags value are also set in a target flags value. ++ ++---- ++ ++Given the flags value: ++ ++```rust ++0b0000_0011 ++``` ++ ++the following flags intersect: ++ ++```rust ++0b0000_0010 ++0b0000_0001 ++0b1111_1111 ++``` ++ ++but the following flags values do not intersect: ++ ++```rust ++0b0000_0000 ++0b1111_0000 ++``` ++ ++#### Empty ++ ++Whether all bits in a flags value are unset. ++ ++---- ++ ++The following flags value is empty: ++ ++```rust ++0b0000_0000 ++``` ++ ++The following flags values are not empty: ++ ++```rust ++0b0000_0001 ++0b0110_0000 ++``` ++ ++#### All ++ ++Whether all defined flags are contained in a flags value. ++ ++---- ++ ++Given a flags type: ++ ++```rust ++struct Flags { ++ const A = 0b0000_0001; ++ const B = 0b0000_0010; ++} ++``` ++ ++the following flags values all satisfy all: ++ ++```rust ++0b0000_0011 ++0b1000_0011 ++0b1111_1111 ++``` ++ ++### Operations ++ ++Examples in this section all use the given flags type: ++ ++```rust ++struct Flags { ++ const A = 0b0000_0001; ++ const B = 0b0000_0010; ++ const C = 0b0000_1100; ++} ++``` ++ ++#### Truncate ++ ++Unset all unknown bits in a flags value. ++ ++---- ++ ++Given the flags value: ++ ++```rust ++0b1111_1111 ++``` ++ ++the result of truncation will be: ++ ++```rust ++0b0000_1111 ++``` ++ ++---- ++ ++Truncating doesn't guarantee that a non-empty result will contain any defined flags. Given the following flags type: ++ ++```rust ++struct Flags { ++ const A = 0b0000_0101; ++} ++``` ++ ++and the following flags value: ++ ++```rust ++0b0000_1110; ++``` ++ ++The result of truncation will be: ++ ++```rust ++0b0000_0100; ++``` ++ ++which intersects the flag `A`, but doesn't contain it. ++ ++This behavior is possible even when only operating with flags values containing defined flags. Given the following flags type: ++ ++```rust ++struct Flags { ++ const A = 0b0000_0101; ++ const B = 0b0000_0001; ++} ++``` ++ ++The result of `A ^ B` is `0b0000_0100`, which also doesn't contain any defined flag. ++ ++---- ++ ++If all known bits are in the set of at least one defined single-bit flag, then all operations that produce non-empty results will always contain defined flags. ++ ++#### Union ++ ++The bitwise or (`|`) of the bits in two flags values. ++ ++---- ++ ++The following are examples of the result of unioning flags values: ++ ++```rust ++0b0000_0001 | 0b0000_0010 = 0b0000_0011 ++0b0000_0000 | 0b1111_1111 = 0b1111_1111 ++``` ++ ++#### Intersection ++ ++The bitwise and (`&`) of the bits in two flags values. ++ ++---- ++ ++The following are examples of the result of intersecting flags values: ++ ++```rust ++0b0000_0001 & 0b0000_0010 = 0b0000_0000 ++0b1111_1100 & 0b1111_0111 = 0b1111_0100 ++0b1111_1111 & 0b1111_1111 = 0b1111_1111 ++``` ++ ++#### Symmetric difference ++ ++The bitwise exclusive-or (`^`) of the bits in two flags values. ++ ++---- ++ ++The following are examples of the symmetric difference between two flags values: ++ ++```rust ++0b0000_0001 ^ 0b0000_0010 = 0b0000_0011 ++0b0000_1111 ^ 0b0000_0011 = 0b0000_1100 ++0b1100_0000 ^ 0b0011_0000 = 0b1111_0000 ++``` ++ ++#### Complement ++ ++The bitwise negation (`!`) of the bits in a flags value, truncating the result. ++ ++---- ++ ++The following are examples of the complement of a flags value: ++ ++```rust ++!0b0000_0000 = 0b0000_1111 ++!0b0000_1111 = 0b0000_0000 ++!0b1111_1000 = 0b0000_0111 ++``` ++ ++#### Difference ++ ++The bitwise union (`|`) of the bits in one flags value and the bitwise negation (`!`) of the bits in another. ++ ++---- ++ ++This operation is not equivalent to the intersection of one flags value with the complement of another (`&!`). ++The former will truncate the result, where difference will not. ++ ++---- ++ ++The following are examples of the difference between two flags values: ++ ++```rust ++0b0000_0001 & !0b0000_0010 = 0b0000_0001 ++0b0000_1101 & !0b0000_0011 = 0b0000_1100 ++0b1111_1111 & !0b0000_0001 = 0b1111_1110 ++``` ++ ++### Iteration ++ ++Yield the bits of a source flags value in a set of contained flags values. ++ ++---- ++ ++To be most useful, each yielded flags value should set exactly the bits of a defined flag contained in the source. Any known bits that aren't in the set of any contained flag should be yielded together as a final flags value. ++ ++---- ++ ++Given the following flags type: ++ ++```rust ++struct Flags { ++ const A = 0b0000_0001; ++ const B = 0b0000_0010; ++ const AB = 0b0000_0011; ++} ++``` ++ ++and the following flags value: ++ ++```rust ++0b0000_1111 ++``` ++ ++When iterated it may yield a flags value for `A` and `B`, then a final flag with the unknown bits: ++ ++```rust ++0b0000_0001 ++0b0000_0010 ++0b0000_1100 ++``` ++ ++It may also yield a flags value for `AB`, then a final flag with the unknown bits: ++ ++```rust ++0b0000_0011 ++0b0000_1100 ++``` ++ ++---- ++ ++Given the following flags type: ++ ++```rust ++struct Flags { ++ const A = 0b0000_0011; ++} ++``` ++ ++and the following flags value: ++ ++```rust ++0b0000_0001 ++``` ++ ++When iterated it will still yield a flags value for the known bit `0b0000_0001` even though it doesn't contain a flag. ++ ++### Formatting ++ ++Format and parse a flags value as text using the following grammar: ++ ++- _Flags:_ (_Whitespace_ _Flag_ _Whitespace_)`|`* ++- _Flag:_ _Name_ | _Hex Number_ ++- _Name:_ The name of any defined flag ++- _Hex Number_: `0x`([0-9a-fA-F])* ++- _Whitespace_: (\s)* ++ ++Flags values can be formatted as _Flags_ by iterating over them, formatting each yielded flags value as a _Flag_. Any yielded flags value that sets exactly the bits of a defined flag with a name should be formatted as a _Name_. Otherwise it must be formatted as a _Hex Number_. ++ ++Formatting and parsing supports three modes: ++ ++- **Retain**: Formatting and parsing roundtrips exactly the bits of the source flags value. This is the default behavior. ++- **Truncate**: Flags values are truncated before formatting, and truncated after parsing. ++- **Strict**: A _Flag_ may only be formatted and parsed as a _Name_. _Hex numbers_ are not allowed. A consequence of this is that unknown bits and any bits that aren't in a contained named flag will be ignored. This is recommended for flags values serialized across API boundaries, like web services. ++ ++Text that is empty or whitespace is an empty flags value. ++ ++---- ++ ++Given the following flags type: ++ ++```rust ++struct Flags { ++ const A = 0b0000_0001; ++ const B = 0b0000_0010; ++ const AB = 0b0000_0011; ++ const C = 0b0000_1100; ++} ++``` ++ ++The following are examples of how flags values can be formatted using any mode: ++ ++```rust ++0b0000_0000 = "" ++0b0000_0001 = "A" ++0b0000_0010 = "B" ++0b0000_0011 = "A | B" ++0b0000_0011 = "AB" ++0b0000_1111 = "A | B | C" ++``` ++ ++Truncate mode will unset any unknown bits: ++ ++```rust ++0b1000_0000 = "" ++0b1111_1111 = "A | B | C" ++0b0000_1000 = "0x8" ++``` ++ ++Retain mode will include any unknown bits as a final _Flag_: ++ ++```rust ++0b1000_0000 = "0x80" ++0b1111_1111 = "A | B | C | 0xf0" ++0b0000_1000 = "0x8" ++``` ++ ++Strict mode will unset any unknown bits, as well as bits not contained in any defined named flags: ++ ++```rust ++0b1000_0000 = "" ++0b1111_1111 = "A | B | C" ++0b0000_1000 = "" ++``` +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/src/example_generated.rs mesa-25.3.3/subprojects/bitflags-2.8.0/src/example_generated.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/src/example_generated.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/src/example_generated.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,65 @@ ++//! This module shows an example of code generated by the macro. **IT MUST NOT BE USED OUTSIDE THIS ++//! CRATE**. ++//! ++//! Usually, when you call the `bitflags!` macro, only the `Flags` type would be visible. In this ++//! example, the `Field0`, `Iter`, and `IterRaw` types are also exposed so that you can explore ++//! their APIs. The `Field0` type can be accessed as `self.0` on an instance of `Flags`. ++ ++__declare_public_bitflags! { ++ /// This is the same `Flags` struct defined in the [crate level example](../index.html#example). ++ /// Note that this struct is just for documentation purposes only, it must not be used outside ++ /// this crate. ++ pub struct Flags ++} ++ ++__declare_internal_bitflags! { ++ pub struct Field0: u32 ++} ++ ++__impl_internal_bitflags! { ++ Field0: u32, Flags { ++ // Field `A`. ++ /// ++ /// This flag has the value `0b00000001`. ++ const A = 0b00000001; ++ /// Field `B`. ++ /// ++ /// This flag has the value `0b00000010`. ++ const B = 0b00000010; ++ /// Field `C`. ++ /// ++ /// This flag has the value `0b00000100`. ++ const C = 0b00000100; ++ const ABC = Self::A.bits() | Self::B.bits() | Self::C.bits(); ++ } ++} ++ ++__impl_public_bitflags_forward! { ++ Flags: u32, Field0 ++} ++ ++__impl_public_bitflags_ops! { ++ Flags ++} ++ ++__impl_public_bitflags_iter! { ++ Flags: u32, Flags ++} ++ ++__impl_public_bitflags_consts! { ++ Flags: u32 { ++ /// Field `A`. ++ /// ++ /// This flag has the value `0b00000001`. ++ const A = 0b00000001; ++ /// Field `B`. ++ /// ++ /// This flag has the value `0b00000010`. ++ const B = 0b00000010; ++ /// Field `C`. ++ /// ++ /// This flag has the value `0b00000100`. ++ const C = 0b00000100; ++ const ABC = Self::A.bits() | Self::B.bits() | Self::C.bits(); ++ } ++} +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/src/external/arbitrary.rs mesa-25.3.3/subprojects/bitflags-2.8.0/src/external/arbitrary.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/src/external/arbitrary.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/src/external/arbitrary.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,33 @@ ++//! Specialized fuzzing for flags types using `arbitrary`. ++ ++use crate::Flags; ++ ++/** ++Generate some arbitrary flags value with only known bits set. ++*/ ++pub fn arbitrary<'a, B: Flags>(u: &mut arbitrary::Unstructured<'a>) -> arbitrary::Result ++where ++ B::Bits: arbitrary::Arbitrary<'a>, ++{ ++ B::from_bits(u.arbitrary()?).ok_or(arbitrary::Error::IncorrectFormat) ++} ++ ++#[cfg(test)] ++mod tests { ++ use arbitrary::Arbitrary; ++ ++ bitflags! { ++ #[derive(Arbitrary)] ++ struct Color: u32 { ++ const RED = 0x1; ++ const GREEN = 0x2; ++ const BLUE = 0x4; ++ } ++ } ++ ++ #[test] ++ fn test_arbitrary() { ++ let mut unstructured = arbitrary::Unstructured::new(&[0_u8; 256]); ++ let _color = Color::arbitrary(&mut unstructured); ++ } ++} +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/src/external/bytemuck.rs mesa-25.3.3/subprojects/bitflags-2.8.0/src/external/bytemuck.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/src/external/bytemuck.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/src/external/bytemuck.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,19 @@ ++#[cfg(test)] ++mod tests { ++ use bytemuck::{Pod, Zeroable}; ++ ++ bitflags! { ++ #[derive(Pod, Zeroable, Clone, Copy)] ++ #[repr(transparent)] ++ struct Color: u32 { ++ const RED = 0x1; ++ const GREEN = 0x2; ++ const BLUE = 0x4; ++ } ++ } ++ ++ #[test] ++ fn test_bytemuck() { ++ assert_eq!(0x1, bytemuck::cast::(Color::RED)); ++ } ++} +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/src/external/serde.rs mesa-25.3.3/subprojects/bitflags-2.8.0/src/external/serde.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/src/external/serde.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/src/external/serde.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,93 @@ ++//! Specialized serialization for flags types using `serde`. ++ ++use crate::{ ++ parser::{self, ParseHex, WriteHex}, ++ Flags, ++}; ++use core::{fmt, str}; ++use serde::{ ++ de::{Error, Visitor}, ++ Deserialize, Deserializer, Serialize, Serializer, ++}; ++ ++/** ++Serialize a set of flags as a human-readable string or their underlying bits. ++ ++Any unknown bits will be retained. ++*/ ++pub fn serialize(flags: &B, serializer: S) -> Result ++where ++ B::Bits: WriteHex + Serialize, ++{ ++ // Serialize human-readable flags as a string like `"A | B"` ++ if serializer.is_human_readable() { ++ serializer.collect_str(&parser::AsDisplay(flags)) ++ } ++ // Serialize non-human-readable flags directly as the underlying bits ++ else { ++ flags.bits().serialize(serializer) ++ } ++} ++ ++/** ++Deserialize a set of flags from a human-readable string or their underlying bits. ++ ++Any unknown bits will be retained. ++*/ ++pub fn deserialize<'de, B: Flags, D: Deserializer<'de>>(deserializer: D) -> Result ++where ++ B::Bits: ParseHex + Deserialize<'de>, ++{ ++ if deserializer.is_human_readable() { ++ // Deserialize human-readable flags by parsing them from strings like `"A | B"` ++ struct FlagsVisitor(core::marker::PhantomData); ++ ++ impl<'de, B: Flags> Visitor<'de> for FlagsVisitor ++ where ++ B::Bits: ParseHex, ++ { ++ type Value = B; ++ ++ fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { ++ formatter.write_str("a string value of `|` separated flags") ++ } ++ ++ fn visit_str(self, flags: &str) -> Result { ++ parser::from_str(flags).map_err(|e| E::custom(e)) ++ } ++ } ++ ++ deserializer.deserialize_str(FlagsVisitor(Default::default())) ++ } else { ++ // Deserialize non-human-readable flags directly from the underlying bits ++ let bits = B::Bits::deserialize(deserializer)?; ++ ++ Ok(B::from_bits_retain(bits)) ++ } ++} ++ ++#[cfg(test)] ++mod tests { ++ use serde_test::{assert_tokens, Configure, Token::*}; ++ bitflags! { ++ #[derive(serde_derive::Serialize, serde_derive::Deserialize, Debug, PartialEq, Eq)] ++ #[serde(transparent)] ++ struct SerdeFlags: u32 { ++ const A = 1; ++ const B = 2; ++ const C = 4; ++ const D = 8; ++ } ++ } ++ ++ #[test] ++ fn test_serde_bitflags_default() { ++ assert_tokens(&SerdeFlags::empty().readable(), &[Str("")]); ++ ++ assert_tokens(&SerdeFlags::empty().compact(), &[U32(0)]); ++ ++ assert_tokens(&(SerdeFlags::A | SerdeFlags::B).readable(), &[Str("A | B")]); ++ ++ assert_tokens(&(SerdeFlags::A | SerdeFlags::B).compact(), &[U32(1 | 2)]); ++ } ++} +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/src/external.rs mesa-25.3.3/subprojects/bitflags-2.8.0/src/external.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/src/external.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/src/external.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,262 @@ ++//! Conditional trait implementations for external libraries. ++ ++/* ++How do I support a new external library? ++ ++Let's say we want to add support for `my_library`. ++ ++First, we create a module under `external`, like `serde` with any specialized code. ++Ideally, any utilities in here should just work off the `Flags` trait and maybe a ++few other assumed bounds. ++ ++Next, re-export the library from the `__private` module here. ++ ++Next, define a macro like so: ++ ++```rust ++#[macro_export] ++#[doc(hidden)] ++#[cfg(feature = "serde")] ++macro_rules! __impl_external_bitflags_my_library { ++ ( ++ $InternalBitFlags:ident: $T:ty, $PublicBitFlags:ident { ++ $( ++ $(#[$inner:ident $($args:tt)*])* ++ const $Flag:tt; ++ )* ++ } ++ ) => { ++ // Implementation goes here ++ }; ++} ++ ++#[macro_export] ++#[doc(hidden)] ++#[cfg(not(feature = "my_library"))] ++macro_rules! __impl_external_bitflags_my_library { ++ ( ++ $InternalBitFlags:ident: $T:ty, $PublicBitFlags:ident { ++ $( ++ $(#[$inner:ident $($args:tt)*])* ++ const $Flag:tt; ++ )* ++ } ++ ) => {}; ++} ++``` ++ ++Note that the macro is actually defined twice; once for when the `my_library` feature ++is available, and once for when it's not. This is because the `__impl_external_bitflags_my_library` ++macro is called in an end-user's library, not in `bitflags`. In an end-user's library we don't ++know whether or not a particular feature of `bitflags` is enabled, so we unconditionally call ++the macro, where the body of that macro depends on the feature flag. ++ ++Now, we add our macro call to the `__impl_external_bitflags` macro body: ++ ++```rust ++__impl_external_bitflags_my_library! { ++ $InternalBitFlags: $T, $PublicBitFlags { ++ $( ++ $(#[$inner $($args)*])* ++ const $Flag; ++ )* ++ } ++} ++``` ++*/ ++ ++pub(crate) mod __private { ++ #[cfg(feature = "serde")] ++ pub use serde; ++ ++ #[cfg(feature = "arbitrary")] ++ pub use arbitrary; ++ ++ #[cfg(feature = "bytemuck")] ++ pub use bytemuck; ++} ++ ++/// Implements traits from external libraries for the internal bitflags type. ++#[macro_export] ++#[doc(hidden)] ++macro_rules! __impl_external_bitflags { ++ ( ++ $InternalBitFlags:ident: $T:ty, $PublicBitFlags:ident { ++ $( ++ $(#[$inner:ident $($args:tt)*])* ++ const $Flag:tt; ++ )* ++ } ++ ) => { ++ // Any new library traits impls should be added here ++ // Use `serde` as an example: generate code when the feature is available, ++ // and a no-op when it isn't ++ ++ $crate::__impl_external_bitflags_serde! { ++ $InternalBitFlags: $T, $PublicBitFlags { ++ $( ++ $(#[$inner $($args)*])* ++ const $Flag; ++ )* ++ } ++ } ++ ++ $crate::__impl_external_bitflags_arbitrary! { ++ $InternalBitFlags: $T, $PublicBitFlags { ++ $( ++ $(#[$inner $($args)*])* ++ const $Flag; ++ )* ++ } ++ } ++ ++ $crate::__impl_external_bitflags_bytemuck! { ++ $InternalBitFlags: $T, $PublicBitFlags { ++ $( ++ $(#[$inner $($args)*])* ++ const $Flag; ++ )* ++ } ++ } ++ }; ++} ++ ++#[cfg(feature = "serde")] ++pub mod serde; ++ ++/// Implement `Serialize` and `Deserialize` for the internal bitflags type. ++#[macro_export] ++#[doc(hidden)] ++#[cfg(feature = "serde")] ++macro_rules! __impl_external_bitflags_serde { ++ ( ++ $InternalBitFlags:ident: $T:ty, $PublicBitFlags:ident { ++ $( ++ $(#[$inner:ident $($args:tt)*])* ++ const $Flag:tt; ++ )* ++ } ++ ) => { ++ impl $crate::__private::serde::Serialize for $InternalBitFlags { ++ fn serialize( ++ &self, ++ serializer: S, ++ ) -> $crate::__private::core::result::Result { ++ $crate::serde::serialize( ++ &$PublicBitFlags::from_bits_retain(self.bits()), ++ serializer, ++ ) ++ } ++ } ++ ++ impl<'de> $crate::__private::serde::Deserialize<'de> for $InternalBitFlags { ++ fn deserialize>( ++ deserializer: D, ++ ) -> $crate::__private::core::result::Result { ++ let flags: $PublicBitFlags = $crate::serde::deserialize(deserializer)?; ++ ++ Ok(flags.0) ++ } ++ } ++ }; ++} ++ ++#[macro_export] ++#[doc(hidden)] ++#[cfg(not(feature = "serde"))] ++macro_rules! __impl_external_bitflags_serde { ++ ( ++ $InternalBitFlags:ident: $T:ty, $PublicBitFlags:ident { ++ $( ++ $(#[$inner:ident $($args:tt)*])* ++ const $Flag:tt; ++ )* ++ } ++ ) => {}; ++} ++ ++#[cfg(feature = "arbitrary")] ++pub mod arbitrary; ++ ++#[cfg(feature = "bytemuck")] ++mod bytemuck; ++ ++/// Implement `Arbitrary` for the internal bitflags type. ++#[macro_export] ++#[doc(hidden)] ++#[cfg(feature = "arbitrary")] ++macro_rules! __impl_external_bitflags_arbitrary { ++ ( ++ $InternalBitFlags:ident: $T:ty, $PublicBitFlags:ident { ++ $( ++ $(#[$inner:ident $($args:tt)*])* ++ const $Flag:tt; ++ )* ++ } ++ ) => { ++ impl<'a> $crate::__private::arbitrary::Arbitrary<'a> for $InternalBitFlags { ++ fn arbitrary( ++ u: &mut $crate::__private::arbitrary::Unstructured<'a>, ++ ) -> $crate::__private::arbitrary::Result { ++ $crate::arbitrary::arbitrary::<$PublicBitFlags>(u).map(|flags| flags.0) ++ } ++ } ++ }; ++} ++ ++#[macro_export] ++#[doc(hidden)] ++#[cfg(not(feature = "arbitrary"))] ++macro_rules! __impl_external_bitflags_arbitrary { ++ ( ++ $InternalBitFlags:ident: $T:ty, $PublicBitFlags:ident { ++ $( ++ $(#[$inner:ident $($args:tt)*])* ++ const $Flag:tt; ++ )* ++ } ++ ) => {}; ++} ++ ++/// Implement `Pod` and `Zeroable` for the internal bitflags type. ++#[macro_export] ++#[doc(hidden)] ++#[cfg(feature = "bytemuck")] ++macro_rules! __impl_external_bitflags_bytemuck { ++ ( ++ $InternalBitFlags:ident: $T:ty, $PublicBitFlags:ident { ++ $( ++ $(#[$inner:ident $($args:tt)*])* ++ const $Flag:tt; ++ )* ++ } ++ ) => { ++ // SAFETY: $InternalBitFlags is guaranteed to have the same ABI as $T, ++ // and $T implements Pod ++ unsafe impl $crate::__private::bytemuck::Pod for $InternalBitFlags where ++ $T: $crate::__private::bytemuck::Pod ++ { ++ } ++ ++ // SAFETY: $InternalBitFlags is guaranteed to have the same ABI as $T, ++ // and $T implements Zeroable ++ unsafe impl $crate::__private::bytemuck::Zeroable for $InternalBitFlags where ++ $T: $crate::__private::bytemuck::Zeroable ++ { ++ } ++ }; ++} ++ ++#[macro_export] ++#[doc(hidden)] ++#[cfg(not(feature = "bytemuck"))] ++macro_rules! __impl_external_bitflags_bytemuck { ++ ( ++ $InternalBitFlags:ident: $T:ty, $PublicBitFlags:ident { ++ $( ++ $(#[$inner:ident $($args:tt)*])* ++ const $Flag:tt; ++ )* ++ } ++ ) => {}; ++} +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/src/internal.rs mesa-25.3.3/subprojects/bitflags-2.8.0/src/internal.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/src/internal.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/src/internal.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,125 @@ ++//! Generate the internal `bitflags`-facing flags type. ++//! ++//! The code generated here is owned by `bitflags`, but still part of its public API. ++//! Changes to the types generated here need to be considered like any other public API change. ++ ++/// Declare the `bitflags`-facing bitflags struct. ++/// ++/// This type is part of the `bitflags` crate's public API, but not part of the user's. ++#[macro_export] ++#[doc(hidden)] ++macro_rules! __declare_internal_bitflags { ++ ( ++ $vis:vis struct $InternalBitFlags:ident: $T:ty ++ ) => { ++ // NOTE: The ABI of this type is _guaranteed_ to be the same as `T` ++ // This is relied on by some external libraries like `bytemuck` to make ++ // its `unsafe` trait impls sound. ++ #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] ++ #[repr(transparent)] ++ $vis struct $InternalBitFlags($T); ++ }; ++} ++ ++/// Implement functions on the private (bitflags-facing) bitflags type. ++/// ++/// Methods and trait implementations can be freely added here without breaking end-users. ++/// If we want to expose new functionality to `#[derive]`, this is the place to do it. ++#[macro_export] ++#[doc(hidden)] ++macro_rules! __impl_internal_bitflags { ++ ( ++ $InternalBitFlags:ident: $T:ty, $PublicBitFlags:ident { ++ $( ++ $(#[$inner:ident $($args:tt)*])* ++ const $Flag:tt = $value:expr; ++ )* ++ } ++ ) => { ++ // NOTE: This impl is also used to prevent using bits types from non-primitive types ++ // in the `bitflags` macro. If this approach is changed, this guard will need to be ++ // retained somehow ++ impl $crate::__private::PublicFlags for $PublicBitFlags { ++ type Primitive = $T; ++ type Internal = $InternalBitFlags; ++ } ++ ++ impl $crate::__private::core::default::Default for $InternalBitFlags { ++ #[inline] ++ fn default() -> Self { ++ $InternalBitFlags::empty() ++ } ++ } ++ ++ impl $crate::__private::core::fmt::Debug for $InternalBitFlags { ++ fn fmt(&self, f: &mut $crate::__private::core::fmt::Formatter<'_>) -> $crate::__private::core::fmt::Result { ++ if self.is_empty() { ++ // If no flags are set then write an empty hex flag to avoid ++ // writing an empty string. In some contexts, like serialization, ++ // an empty string is preferable, but it may be unexpected in ++ // others for a format not to produce any output. ++ // ++ // We can remove this `0x0` and remain compatible with `FromStr`, ++ // because an empty string will still parse to an empty set of flags, ++ // just like `0x0` does. ++ $crate::__private::core::write!(f, "{:#x}", <$T as $crate::Bits>::EMPTY) ++ } else { ++ $crate::__private::core::fmt::Display::fmt(self, f) ++ } ++ } ++ } ++ ++ impl $crate::__private::core::fmt::Display for $InternalBitFlags { ++ fn fmt(&self, f: &mut $crate::__private::core::fmt::Formatter<'_>) -> $crate::__private::core::fmt::Result { ++ $crate::parser::to_writer(&$PublicBitFlags(*self), f) ++ } ++ } ++ ++ impl $crate::__private::core::str::FromStr for $InternalBitFlags { ++ type Err = $crate::parser::ParseError; ++ ++ fn from_str(s: &str) -> $crate::__private::core::result::Result { ++ $crate::parser::from_str::<$PublicBitFlags>(s).map(|flags| flags.0) ++ } ++ } ++ ++ impl $crate::__private::core::convert::AsRef<$T> for $InternalBitFlags { ++ fn as_ref(&self) -> &$T { ++ &self.0 ++ } ++ } ++ ++ impl $crate::__private::core::convert::From<$T> for $InternalBitFlags { ++ fn from(bits: $T) -> Self { ++ Self::from_bits_retain(bits) ++ } ++ } ++ ++ // The internal flags type offers a similar API to the public one ++ ++ $crate::__impl_public_bitflags! { ++ $InternalBitFlags: $T, $PublicBitFlags { ++ $( ++ $(#[$inner $($args)*])* ++ const $Flag = $value; ++ )* ++ } ++ } ++ ++ $crate::__impl_public_bitflags_ops! { ++ $InternalBitFlags ++ } ++ ++ $crate::__impl_public_bitflags_iter! { ++ $InternalBitFlags: $T, $PublicBitFlags ++ } ++ ++ impl $InternalBitFlags { ++ /// Returns a mutable reference to the raw value of the flags currently stored. ++ #[inline] ++ pub fn bits_mut(&mut self) -> &mut $T { ++ &mut self.0 ++ } ++ } ++ }; ++} +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/src/iter.rs mesa-25.3.3/subprojects/bitflags-2.8.0/src/iter.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/src/iter.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/src/iter.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,145 @@ ++/*! ++Yield the bits of a source flags value in a set of contained flags values. ++*/ ++ ++use crate::{Flag, Flags}; ++ ++/** ++An iterator over flags values. ++ ++This iterator will yield flags values for contained, defined flags first, with any remaining bits yielded ++as a final flags value. ++*/ ++pub struct Iter { ++ inner: IterNames, ++ done: bool, ++} ++ ++impl Iter { ++ pub(crate) fn new(flags: &B) -> Self { ++ Iter { ++ inner: IterNames::new(flags), ++ done: false, ++ } ++ } ++} ++ ++impl Iter { ++ // Used by the `bitflags` macro ++ #[doc(hidden)] ++ pub const fn __private_const_new(flags: &'static [Flag], source: B, remaining: B) -> Self { ++ Iter { ++ inner: IterNames::__private_const_new(flags, source, remaining), ++ done: false, ++ } ++ } ++} ++ ++impl Iterator for Iter { ++ type Item = B; ++ ++ fn next(&mut self) -> Option { ++ match self.inner.next() { ++ Some((_, flag)) => Some(flag), ++ None if !self.done => { ++ self.done = true; ++ ++ // After iterating through valid names, if there are any bits left over ++ // then return one final value that includes them. This makes `into_iter` ++ // and `from_iter` roundtrip ++ if !self.inner.remaining().is_empty() { ++ Some(B::from_bits_retain(self.inner.remaining.bits())) ++ } else { ++ None ++ } ++ } ++ None => None, ++ } ++ } ++} ++ ++/** ++An iterator over flags values. ++ ++This iterator only yields flags values for contained, defined, named flags. Any remaining bits ++won't be yielded, but can be found with the [`IterNames::remaining`] method. ++*/ ++pub struct IterNames { ++ flags: &'static [Flag], ++ idx: usize, ++ source: B, ++ remaining: B, ++} ++ ++impl IterNames { ++ pub(crate) fn new(flags: &B) -> Self { ++ IterNames { ++ flags: B::FLAGS, ++ idx: 0, ++ remaining: B::from_bits_retain(flags.bits()), ++ source: B::from_bits_retain(flags.bits()), ++ } ++ } ++} ++ ++impl IterNames { ++ // Used by the bitflags macro ++ #[doc(hidden)] ++ pub const fn __private_const_new(flags: &'static [Flag], source: B, remaining: B) -> Self { ++ IterNames { ++ flags, ++ idx: 0, ++ remaining, ++ source, ++ } ++ } ++ ++ /// Get a flags value of any remaining bits that haven't been yielded yet. ++ /// ++ /// Once the iterator has finished, this method can be used to ++ /// check whether or not there are any bits that didn't correspond ++ /// to a contained, defined, named flag remaining. ++ pub fn remaining(&self) -> &B { ++ &self.remaining ++ } ++} ++ ++impl Iterator for IterNames { ++ type Item = (&'static str, B); ++ ++ fn next(&mut self) -> Option { ++ while let Some(flag) = self.flags.get(self.idx) { ++ // Short-circuit if our state is empty ++ if self.remaining.is_empty() { ++ return None; ++ } ++ ++ self.idx += 1; ++ ++ // Skip unnamed flags ++ if flag.name().is_empty() { ++ continue; ++ } ++ ++ let bits = flag.value().bits(); ++ ++ // If the flag is set in the original source _and_ it has bits that haven't ++ // been covered by a previous flag yet then yield it. These conditions cover ++ // two cases for multi-bit flags: ++ // ++ // 1. When flags partially overlap, such as `0b00000001` and `0b00000101`, we'll ++ // yield both flags. ++ // 2. When flags fully overlap, such as in convenience flags that are a shorthand for others, ++ // we won't yield both flags. ++ if self.source.contains(B::from_bits_retain(bits)) ++ && self.remaining.intersects(B::from_bits_retain(bits)) ++ { ++ self.remaining.remove(B::from_bits_retain(bits)); ++ ++ return Some((flag.name(), B::from_bits_retain(bits))); ++ } ++ } ++ ++ None ++ } ++} +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/src/lib.rs mesa-25.3.3/subprojects/bitflags-2.8.0/src/lib.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/src/lib.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/src/lib.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,1025 @@ ++// Copyright 2014 The Rust Project Developers. See the COPYRIGHT ++// file at the top-level directory of this distribution and at ++// http://rust-lang.org/COPYRIGHT. ++// ++// Licensed under the Apache License, Version 2.0 or the MIT license ++// , at your ++// option. This file may not be copied, modified, or distributed ++// except according to those terms. ++ ++/*! ++Generate types for C-style flags with ergonomic APIs. ++ ++# Getting started ++ ++Add `bitflags` to your `Cargo.toml`: ++ ++```toml ++[dependencies.bitflags] ++version = "2.8.0" ++``` ++ ++## Generating flags types ++ ++Use the [`bitflags`] macro to generate flags types: ++ ++```rust ++use bitflags::bitflags; ++ ++bitflags! { ++ pub struct Flags: u32 { ++ const A = 0b00000001; ++ const B = 0b00000010; ++ const C = 0b00000100; ++ } ++} ++``` ++ ++See the docs for the `bitflags` macro for the full syntax. ++ ++Also see the [`example_generated`](./example_generated/index.html) module for an example of what the `bitflags` macro generates for a flags type. ++ ++### Externally defined flags ++ ++If you're generating flags types for an external source, such as a C API, you can define ++an extra unnamed flag as a mask of all bits the external source may ever set. Usually this would be all bits (`!0`): ++ ++```rust ++# use bitflags::bitflags; ++bitflags! { ++ pub struct Flags: u32 { ++ const A = 0b00000001; ++ const B = 0b00000010; ++ const C = 0b00000100; ++ ++ // The source may set any bits ++ const _ = !0; ++ } ++} ++``` ++ ++Why should you do this? Generated methods like `all` and truncating operators like `!` only consider ++bits in defined flags. Adding an unnamed flag makes those methods consider additional bits, ++without generating additional constants for them. It helps compatibility when the external source ++may start setting additional bits at any time. The [known and unknown bits](#known-and-unknown-bits) ++section has more details on this behavior. ++ ++### Custom derives ++ ++You can derive some traits on generated flags types if you enable Cargo features. The following ++libraries are currently supported: ++ ++- `serde`: Support `#[derive(Serialize, Deserialize)]`, using text for human-readable formats, ++ and a raw number for binary formats. ++- `arbitrary`: Support `#[derive(Arbitrary)]`, only generating flags values with known bits. ++- `bytemuck`: Support `#[derive(Pod, Zeroable)]`, for casting between flags values and their ++ underlying bits values. ++ ++You can also define your own flags type outside of the [`bitflags`] macro and then use it to generate methods. ++This can be useful if you need a custom `#[derive]` attribute for a library that `bitflags` doesn't ++natively support: ++ ++```rust ++# use std::fmt::Debug as SomeTrait; ++# use bitflags::bitflags; ++#[derive(SomeTrait)] ++pub struct Flags(u32); ++ ++bitflags! { ++ impl Flags: u32 { ++ const A = 0b00000001; ++ const B = 0b00000010; ++ const C = 0b00000100; ++ } ++} ++``` ++ ++### Adding custom methods ++ ++The [`bitflags`] macro supports attributes on generated flags types within the macro itself, while ++`impl` blocks can be added outside of it: ++ ++```rust ++# use bitflags::bitflags; ++bitflags! { ++ // Attributes can be applied to flags types ++ #[repr(transparent)] ++ #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] ++ pub struct Flags: u32 { ++ const A = 0b00000001; ++ const B = 0b00000010; ++ const C = 0b00000100; ++ } ++} ++ ++// Impl blocks can be added to flags types ++impl Flags { ++ pub fn as_u64(&self) -> u64 { ++ self.bits() as u64 ++ } ++} ++``` ++ ++## Working with flags values ++ ++Use generated constants and standard bitwise operators to interact with flags values: ++ ++```rust ++# use bitflags::bitflags; ++# bitflags! { ++# #[derive(Clone, Copy, Debug, PartialEq, Eq, Hash)] ++# pub struct Flags: u32 { ++# const A = 0b00000001; ++# const B = 0b00000010; ++# const C = 0b00000100; ++# } ++# } ++// union ++let ab = Flags::A | Flags::B; ++ ++// intersection ++let a = ab & Flags::A; ++ ++// difference ++let b = ab - Flags::A; ++ ++// complement ++let c = !ab; ++``` ++ ++See the docs for the [`Flags`] trait for more details on operators and how they behave. ++ ++# Formatting and parsing ++ ++`bitflags` defines a text format that can be used to convert any flags value to and from strings. ++ ++See the [`parser`] module for more details. ++ ++# Specification ++ ++The terminology and behavior of generated flags types is ++[specified in the source repository](https://github.com/bitflags/bitflags/blob/main/spec.md). ++Details are repeated in these docs where appropriate, but is exhaustively listed in the spec. Some ++things are worth calling out explicitly here. ++ ++## Flags types, flags values, flags ++ ++The spec and these docs use consistent terminology to refer to things in the bitflags domain: ++ ++- **Bits type**: A type that defines a fixed number of bits at specific locations. ++- **Flag**: A set of bits in a bits type that may have a unique name. ++- **Flags type**: A set of defined flags over a specific bits type. ++- **Flags value**: An instance of a flags type using its specific bits value for storage. ++ ++``` ++# use bitflags::bitflags; ++bitflags! { ++ struct FlagsType: u8 { ++// -- Bits type ++// --------- Flags type ++ const A = 1; ++// ----- Flag ++ } ++} ++ ++let flag = FlagsType::A; ++// ---- Flags value ++``` ++ ++## Known and unknown bits ++ ++Any bits in a flag you define are called _known bits_. Any other bits are _unknown bits_. ++In the following flags type: ++ ++``` ++# use bitflags::bitflags; ++bitflags! { ++ struct Flags: u8 { ++ const A = 1; ++ const B = 1 << 1; ++ const C = 1 << 2; ++ } ++} ++``` ++ ++The known bits are `0b0000_0111` and the unknown bits are `0b1111_1000`. ++ ++`bitflags` doesn't guarantee that a flags value will only ever have known bits set, but some operators ++will unset any unknown bits they encounter. In a future version of `bitflags`, all operators will ++unset unknown bits. ++ ++If you're using `bitflags` for flags types defined externally, such as from C, you probably want all ++bits to be considered known, in case that external source changes. You can do this using an unnamed ++flag, as described in [externally defined flags](#externally-defined-flags). ++ ++## Zero-bit flags ++ ++Flags with no bits set should be avoided because they interact strangely with [`Flags::contains`] ++and [`Flags::intersects`]. A zero-bit flag is always contained, but is never intersected. The ++names of zero-bit flags can be parsed, but are never formatted. ++ ++## Multi-bit flags ++ ++Flags that set multiple bits should be avoided unless each bit is also in a single-bit flag. ++Take the following flags type as an example: ++ ++``` ++# use bitflags::bitflags; ++bitflags! { ++ struct Flags: u8 { ++ const A = 1; ++ const B = 1 | 1 << 1; ++ } ++} ++``` ++ ++The result of `Flags::A ^ Flags::B` is `0b0000_0010`, which doesn't correspond to either ++`Flags::A` or `Flags::B` even though it's still a known bit. ++*/ ++ ++#![cfg_attr(not(any(feature = "std", test)), no_std)] ++#![cfg_attr(not(test), forbid(unsafe_code))] ++#![cfg_attr(test, allow(mixed_script_confusables))] ++ ++#[doc(inline)] ++pub use traits::{Bits, Flag, Flags}; ++ ++pub mod iter; ++pub mod parser; ++ ++mod traits; ++ ++#[doc(hidden)] ++pub mod __private { ++ #[allow(unused_imports)] ++ // Easier than conditionally checking any optional external dependencies ++ pub use crate::{external::__private::*, traits::__private::*}; ++ ++ pub use core; ++} ++ ++#[allow(unused_imports)] ++pub use external::*; ++ ++#[allow(deprecated)] ++pub use traits::BitFlags; ++ ++/* ++How does the bitflags crate work? ++ ++This library generates a `struct` in the end-user's crate with a bunch of constants on it that represent flags. ++The difference between `bitflags` and a lot of other libraries is that we don't actually control the generated `struct` in the end. ++It's part of the end-user's crate, so it belongs to them. That makes it difficult to extend `bitflags` with new functionality ++because we could end up breaking valid code that was already written. ++ ++Our solution is to split the type we generate into two: the public struct owned by the end-user, and an internal struct owned by `bitflags` (us). ++To give you an example, let's say we had a crate that called `bitflags!`: ++ ++```rust ++bitflags! { ++ pub struct MyFlags: u32 { ++ const A = 1; ++ const B = 2; ++ } ++} ++``` ++ ++What they'd end up with looks something like this: ++ ++```rust ++pub struct MyFlags(::InternalBitFlags); ++ ++const _: () = { ++ #[repr(transparent)] ++ #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Hash)] ++ pub struct MyInternalBitFlags { ++ bits: u32, ++ } ++ ++ impl PublicFlags for MyFlags { ++ type Internal = InternalBitFlags; ++ } ++}; ++``` ++ ++If we want to expose something like a new trait impl for generated flags types, we add it to our generated `MyInternalBitFlags`, ++and let `#[derive]` on `MyFlags` pick up that implementation, if an end-user chooses to add one. ++ ++The public API is generated in the `__impl_public_flags!` macro, and the internal API is generated in ++the `__impl_internal_flags!` macro. ++ ++The macros are split into 3 modules: ++ ++- `public`: where the user-facing flags types are generated. ++- `internal`: where the `bitflags`-facing flags types are generated. ++- `external`: where external library traits are implemented conditionally. ++*/ ++ ++/** ++Generate a flags type. ++ ++# `struct` mode ++ ++A declaration that begins with `$vis struct` will generate a `struct` for a flags type, along with ++methods and trait implementations for it. The body of the declaration defines flags as constants, ++where each constant is a flags value of the generated flags type. ++ ++## Examples ++ ++Generate a flags type using `u8` as the bits type: ++ ++``` ++# use bitflags::bitflags; ++bitflags! { ++ struct Flags: u8 { ++ const A = 1; ++ const B = 1 << 1; ++ const C = 0b0000_0100; ++ } ++} ++``` ++ ++Flags types are private by default and accept standard visibility modifiers. Flags themselves ++are always public: ++ ++``` ++# use bitflags::bitflags; ++bitflags! { ++ pub struct Flags: u8 { ++ // Constants are always `pub` ++ const A = 1; ++ } ++} ++``` ++ ++Flags may refer to other flags using their [`Flags::bits`] value: ++ ++``` ++# use bitflags::bitflags; ++bitflags! { ++ struct Flags: u8 { ++ const A = 1; ++ const B = 1 << 1; ++ const AB = Flags::A.bits() | Flags::B.bits(); ++ } ++} ++``` ++ ++A single `bitflags` invocation may include zero or more flags type declarations: ++ ++``` ++# use bitflags::bitflags; ++bitflags! {} ++ ++bitflags! { ++ struct Flags1: u8 { ++ const A = 1; ++ } ++ ++ struct Flags2: u8 { ++ const A = 1; ++ } ++} ++``` ++ ++# `impl` mode ++ ++A declaration that begins with `impl` will only generate methods and trait implementations for the ++`struct` defined outside of the `bitflags` macro. ++ ++The struct itself must be a newtype using the bits type as its field. ++ ++The syntax for `impl` mode is identical to `struct` mode besides the starting token. ++ ++## Examples ++ ++Implement flags methods and traits for a custom flags type using `u8` as its underlying bits type: ++ ++``` ++# use bitflags::bitflags; ++struct Flags(u8); ++ ++bitflags! { ++ impl Flags: u8 { ++ const A = 1; ++ const B = 1 << 1; ++ const C = 0b0000_0100; ++ } ++} ++``` ++ ++# Named and unnamed flags ++ ++Constants in the body of a declaration are flags. The identifier of the constant is the name of ++the flag. If the identifier is `_`, then the flag is unnamed. Unnamed flags don't appear in the ++generated API, but affect how bits are truncated. ++ ++## Examples ++ ++Adding an unnamed flag that makes all bits known: ++ ++``` ++# use bitflags::bitflags; ++bitflags! { ++ struct Flags: u8 { ++ const A = 1; ++ const B = 1 << 1; ++ ++ const _ = !0; ++ } ++} ++``` ++ ++Flags types may define multiple unnamed flags: ++ ++``` ++# use bitflags::bitflags; ++bitflags! { ++ struct Flags: u8 { ++ const _ = 1; ++ const _ = 1 << 1; ++ } ++} ++``` ++*/ ++#[macro_export] ++macro_rules! bitflags { ++ ( ++ $(#[$outer:meta])* ++ $vis:vis struct $BitFlags:ident: $T:ty { ++ $( ++ $(#[$inner:ident $($args:tt)*])* ++ const $Flag:tt = $value:expr; ++ )* ++ } ++ ++ $($t:tt)* ++ ) => { ++ // Declared in the scope of the `bitflags!` call ++ // This type appears in the end-user's API ++ $crate::__declare_public_bitflags! { ++ $(#[$outer])* ++ $vis struct $BitFlags ++ } ++ ++ // Workaround for: https://github.com/bitflags/bitflags/issues/320 ++ $crate::__impl_public_bitflags_consts! { ++ $BitFlags: $T { ++ $( ++ $(#[$inner $($args)*])* ++ const $Flag = $value; ++ )* ++ } ++ } ++ ++ #[allow( ++ dead_code, ++ deprecated, ++ unused_doc_comments, ++ unused_attributes, ++ unused_mut, ++ unused_imports, ++ non_upper_case_globals, ++ clippy::assign_op_pattern, ++ clippy::indexing_slicing, ++ clippy::same_name_method, ++ clippy::iter_without_into_iter, ++ )] ++ const _: () = { ++ // Declared in a "hidden" scope that can't be reached directly ++ // These types don't appear in the end-user's API ++ $crate::__declare_internal_bitflags! { ++ $vis struct InternalBitFlags: $T ++ } ++ ++ $crate::__impl_internal_bitflags! { ++ InternalBitFlags: $T, $BitFlags { ++ $( ++ $(#[$inner $($args)*])* ++ const $Flag = $value; ++ )* ++ } ++ } ++ ++ // This is where new library trait implementations can be added ++ $crate::__impl_external_bitflags! { ++ InternalBitFlags: $T, $BitFlags { ++ $( ++ $(#[$inner $($args)*])* ++ const $Flag; ++ )* ++ } ++ } ++ ++ $crate::__impl_public_bitflags_forward! { ++ $BitFlags: $T, InternalBitFlags ++ } ++ ++ $crate::__impl_public_bitflags_ops! { ++ $BitFlags ++ } ++ ++ $crate::__impl_public_bitflags_iter! { ++ $BitFlags: $T, $BitFlags ++ } ++ }; ++ ++ $crate::bitflags! { ++ $($t)* ++ } ++ }; ++ ( ++ $(#[$outer:meta])* ++ impl $BitFlags:ident: $T:ty { ++ $( ++ $(#[$inner:ident $($args:tt)*])* ++ const $Flag:tt = $value:expr; ++ )* ++ } ++ ++ $($t:tt)* ++ ) => { ++ $crate::__impl_public_bitflags_consts! { ++ $BitFlags: $T { ++ $( ++ $(#[$inner $($args)*])* ++ const $Flag = $value; ++ )* ++ } ++ } ++ ++ #[allow( ++ dead_code, ++ deprecated, ++ unused_doc_comments, ++ unused_attributes, ++ unused_mut, ++ unused_imports, ++ non_upper_case_globals, ++ clippy::assign_op_pattern, ++ clippy::iter_without_into_iter, ++ )] ++ const _: () = { ++ $crate::__impl_public_bitflags! { ++ $(#[$outer])* ++ $BitFlags: $T, $BitFlags { ++ $( ++ $(#[$inner $($args)*])* ++ const $Flag = $value; ++ )* ++ } ++ } ++ ++ $crate::__impl_public_bitflags_ops! { ++ $BitFlags ++ } ++ ++ $crate::__impl_public_bitflags_iter! { ++ $BitFlags: $T, $BitFlags ++ } ++ }; ++ ++ $crate::bitflags! { ++ $($t)* ++ } ++ }; ++ () => {}; ++} ++ ++/// Implement functions on bitflags types. ++/// ++/// We need to be careful about adding new methods and trait implementations here because they ++/// could conflict with items added by the end-user. ++#[macro_export] ++#[doc(hidden)] ++macro_rules! __impl_bitflags { ++ ( ++ $(#[$outer:meta])* ++ $PublicBitFlags:ident: $T:ty { ++ fn empty() $empty:block ++ fn all() $all:block ++ fn bits($bits0:ident) $bits:block ++ fn from_bits($from_bits0:ident) $from_bits:block ++ fn from_bits_truncate($from_bits_truncate0:ident) $from_bits_truncate:block ++ fn from_bits_retain($from_bits_retain0:ident) $from_bits_retain:block ++ fn from_name($from_name0:ident) $from_name:block ++ fn is_empty($is_empty0:ident) $is_empty:block ++ fn is_all($is_all0:ident) $is_all:block ++ fn intersects($intersects0:ident, $intersects1:ident) $intersects:block ++ fn contains($contains0:ident, $contains1:ident) $contains:block ++ fn insert($insert0:ident, $insert1:ident) $insert:block ++ fn remove($remove0:ident, $remove1:ident) $remove:block ++ fn toggle($toggle0:ident, $toggle1:ident) $toggle:block ++ fn set($set0:ident, $set1:ident, $set2:ident) $set:block ++ fn intersection($intersection0:ident, $intersection1:ident) $intersection:block ++ fn union($union0:ident, $union1:ident) $union:block ++ fn difference($difference0:ident, $difference1:ident) $difference:block ++ fn symmetric_difference($symmetric_difference0:ident, $symmetric_difference1:ident) $symmetric_difference:block ++ fn complement($complement0:ident) $complement:block ++ } ++ ) => { ++ #[allow(dead_code, deprecated, unused_attributes)] ++ $(#[$outer])* ++ impl $PublicBitFlags { ++ /// Get a flags value with all bits unset. ++ #[inline] ++ pub const fn empty() -> Self { ++ $empty ++ } ++ ++ /// Get a flags value with all known bits set. ++ #[inline] ++ pub const fn all() -> Self { ++ $all ++ } ++ ++ /// Get the underlying bits value. ++ /// ++ /// The returned value is exactly the bits set in this flags value. ++ #[inline] ++ pub const fn bits(&self) -> $T { ++ let $bits0 = self; ++ $bits ++ } ++ ++ /// Convert from a bits value. ++ /// ++ /// This method will return `None` if any unknown bits are set. ++ #[inline] ++ pub const fn from_bits(bits: $T) -> $crate::__private::core::option::Option { ++ let $from_bits0 = bits; ++ $from_bits ++ } ++ ++ /// Convert from a bits value, unsetting any unknown bits. ++ #[inline] ++ pub const fn from_bits_truncate(bits: $T) -> Self { ++ let $from_bits_truncate0 = bits; ++ $from_bits_truncate ++ } ++ ++ /// Convert from a bits value exactly. ++ #[inline] ++ pub const fn from_bits_retain(bits: $T) -> Self { ++ let $from_bits_retain0 = bits; ++ $from_bits_retain ++ } ++ ++ /// Get a flags value with the bits of a flag with the given name set. ++ /// ++ /// This method will return `None` if `name` is empty or doesn't ++ /// correspond to any named flag. ++ #[inline] ++ pub fn from_name(name: &str) -> $crate::__private::core::option::Option { ++ let $from_name0 = name; ++ $from_name ++ } ++ ++ /// Whether all bits in this flags value are unset. ++ #[inline] ++ pub const fn is_empty(&self) -> bool { ++ let $is_empty0 = self; ++ $is_empty ++ } ++ ++ /// Whether all known bits in this flags value are set. ++ #[inline] ++ pub const fn is_all(&self) -> bool { ++ let $is_all0 = self; ++ $is_all ++ } ++ ++ /// Whether any set bits in a source flags value are also set in a target flags value. ++ #[inline] ++ pub const fn intersects(&self, other: Self) -> bool { ++ let $intersects0 = self; ++ let $intersects1 = other; ++ $intersects ++ } ++ ++ /// Whether all set bits in a source flags value are also set in a target flags value. ++ #[inline] ++ pub const fn contains(&self, other: Self) -> bool { ++ let $contains0 = self; ++ let $contains1 = other; ++ $contains ++ } ++ ++ /// The bitwise or (`|`) of the bits in two flags values. ++ #[inline] ++ pub fn insert(&mut self, other: Self) { ++ let $insert0 = self; ++ let $insert1 = other; ++ $insert ++ } ++ ++ /// The intersection of a source flags value with the complement of a target flags value (`&!`). ++ /// ++ /// This method is not equivalent to `self & !other` when `other` has unknown bits set. ++ /// `remove` won't truncate `other`, but the `!` operator will. ++ #[inline] ++ pub fn remove(&mut self, other: Self) { ++ let $remove0 = self; ++ let $remove1 = other; ++ $remove ++ } ++ ++ /// The bitwise exclusive-or (`^`) of the bits in two flags values. ++ #[inline] ++ pub fn toggle(&mut self, other: Self) { ++ let $toggle0 = self; ++ let $toggle1 = other; ++ $toggle ++ } ++ ++ /// Call `insert` when `value` is `true` or `remove` when `value` is `false`. ++ #[inline] ++ pub fn set(&mut self, other: Self, value: bool) { ++ let $set0 = self; ++ let $set1 = other; ++ let $set2 = value; ++ $set ++ } ++ ++ /// The bitwise and (`&`) of the bits in two flags values. ++ #[inline] ++ #[must_use] ++ pub const fn intersection(self, other: Self) -> Self { ++ let $intersection0 = self; ++ let $intersection1 = other; ++ $intersection ++ } ++ ++ /// The bitwise or (`|`) of the bits in two flags values. ++ #[inline] ++ #[must_use] ++ pub const fn union(self, other: Self) -> Self { ++ let $union0 = self; ++ let $union1 = other; ++ $union ++ } ++ ++ /// The intersection of a source flags value with the complement of a target flags value (`&!`). ++ /// ++ /// This method is not equivalent to `self & !other` when `other` has unknown bits set. ++ /// `difference` won't truncate `other`, but the `!` operator will. ++ #[inline] ++ #[must_use] ++ pub const fn difference(self, other: Self) -> Self { ++ let $difference0 = self; ++ let $difference1 = other; ++ $difference ++ } ++ ++ /// The bitwise exclusive-or (`^`) of the bits in two flags values. ++ #[inline] ++ #[must_use] ++ pub const fn symmetric_difference(self, other: Self) -> Self { ++ let $symmetric_difference0 = self; ++ let $symmetric_difference1 = other; ++ $symmetric_difference ++ } ++ ++ /// The bitwise negation (`!`) of the bits in a flags value, truncating the result. ++ #[inline] ++ #[must_use] ++ pub const fn complement(self) -> Self { ++ let $complement0 = self; ++ $complement ++ } ++ } ++ }; ++} ++ ++/// A macro that matches flags values, similar to Rust's `match` statement. ++/// ++/// In a regular `match` statement, the syntax `Flag::A | Flag::B` is interpreted as an or-pattern, ++/// instead of the bitwise-or of `Flag::A` and `Flag::B`. This can be surprising when combined with flags types ++/// because `Flag::A | Flag::B` won't match the pattern `Flag::A | Flag::B`. This macro is an alternative to ++/// `match` for flags values that doesn't have this issue. ++/// ++/// # Syntax ++/// ++/// ```ignore ++/// bitflags_match!(expression, { ++/// pattern1 => result1, ++/// pattern2 => result2, ++/// .. ++/// _ => default_result, ++/// }) ++/// ``` ++/// ++/// The final `_ => default_result` arm is required, otherwise the macro will fail to compile. ++/// ++/// # Examples ++/// ++/// ```rust ++/// use bitflags::{bitflags, bitflags_match}; ++/// ++/// bitflags! { ++/// #[derive(PartialEq)] ++/// struct Flags: u8 { ++/// const A = 1 << 0; ++/// const B = 1 << 1; ++/// const C = 1 << 2; ++/// } ++/// } ++/// ++/// let flags = Flags::A | Flags::B; ++/// ++/// bitflags_match!(flags, { ++/// Flags::A | Flags::B => println!("A and/or B are set"), ++/// _ => println!("neither A nor B are set"), ++/// }) ++/// ``` ++/// ++/// # How it works ++/// ++/// The macro expands to a series of `if` statements, checking equality between the input expression ++/// and each pattern. This allows for correct matching of bitflag combinations, which is not possible ++/// with a regular match expression due to the way bitflags are implemented. ++/// ++/// Patterns are evaluated in order. ++#[macro_export] ++macro_rules! bitflags_match { ++ ($operation:expr, { ++ $($t:tt)* ++ }) => { ++ // Expand to a closure so we can use `return` ++ // This makes it possible to apply attributes to the "match arms" ++ (|| { ++ $crate::__bitflags_match!($operation, { $($t)* }) ++ })() ++ }; ++} ++ ++/// Expand the `bitflags_match` macro ++#[macro_export] ++#[doc(hidden)] ++macro_rules! __bitflags_match { ++ // Eat an optional `,` following a block match arm ++ ($operation:expr, { $pattern:expr => { $($body:tt)* } , $($t:tt)+ }) => { ++ $crate::__bitflags_match!($operation, { $pattern => { $($body)* } $($t)+ }) ++ }; ++ // Expand a block match arm `A => { .. }` ++ ($operation:expr, { $pattern:expr => { $($body:tt)* } $($t:tt)+ }) => { ++ { ++ if $operation == $pattern { ++ return { ++ $($body)* ++ }; ++ } ++ ++ $crate::__bitflags_match!($operation, { $($t)+ }) ++ } ++ }; ++ // Expand an expression match arm `A => x,` ++ ($operation:expr, { $pattern:expr => $body:expr , $($t:tt)+ }) => { ++ { ++ if $operation == $pattern { ++ return $body; ++ } ++ ++ $crate::__bitflags_match!($operation, { $($t)+ }) ++ } ++ }; ++ // Expand the default case ++ ($operation:expr, { _ => $default:expr $(,)? }) => { ++ $default ++ } ++} ++ ++/// A macro that processed the input to `bitflags!` and shuffles attributes around ++/// based on whether or not they're "expression-safe". ++/// ++/// This macro is a token-tree muncher that works on 2 levels: ++/// ++/// For each attribute, we explicitly match on its identifier, like `cfg` to determine ++/// whether or not it should be considered expression-safe. ++/// ++/// If you find yourself with an attribute that should be considered expression-safe ++/// and isn't, it can be added here. ++#[macro_export] ++#[doc(hidden)] ++macro_rules! __bitflags_expr_safe_attrs { ++ // Entrypoint: Move all flags and all attributes into `unprocessed` lists ++ // where they'll be munched one-at-a-time ++ ( ++ $(#[$inner:ident $($args:tt)*])* ++ { $e:expr } ++ ) => { ++ $crate::__bitflags_expr_safe_attrs! { ++ expr: { $e }, ++ attrs: { ++ // All attributes start here ++ unprocessed: [$(#[$inner $($args)*])*], ++ // Attributes that are safe on expressions go here ++ processed: [], ++ }, ++ } ++ }; ++ // Process the next attribute on the current flag ++ // `cfg`: The next flag should be propagated to expressions ++ // NOTE: You can copy this rules block and replace `cfg` with ++ // your attribute name that should be considered expression-safe ++ ( ++ expr: { $e:expr }, ++ attrs: { ++ unprocessed: [ ++ // cfg matched here ++ #[cfg $($args:tt)*] ++ $($attrs_rest:tt)* ++ ], ++ processed: [$($expr:tt)*], ++ }, ++ ) => { ++ $crate::__bitflags_expr_safe_attrs! { ++ expr: { $e }, ++ attrs: { ++ unprocessed: [ ++ $($attrs_rest)* ++ ], ++ processed: [ ++ $($expr)* ++ // cfg added here ++ #[cfg $($args)*] ++ ], ++ }, ++ } ++ }; ++ // Process the next attribute on the current flag ++ // `$other`: The next flag should not be propagated to expressions ++ ( ++ expr: { $e:expr }, ++ attrs: { ++ unprocessed: [ ++ // $other matched here ++ #[$other:ident $($args:tt)*] ++ $($attrs_rest:tt)* ++ ], ++ processed: [$($expr:tt)*], ++ }, ++ ) => { ++ $crate::__bitflags_expr_safe_attrs! { ++ expr: { $e }, ++ attrs: { ++ unprocessed: [ ++ $($attrs_rest)* ++ ], ++ processed: [ ++ // $other not added here ++ $($expr)* ++ ], ++ }, ++ } ++ }; ++ // Once all attributes on all flags are processed, generate the actual code ++ ( ++ expr: { $e:expr }, ++ attrs: { ++ unprocessed: [], ++ processed: [$(#[$expr:ident $($exprargs:tt)*])*], ++ }, ++ ) => { ++ $(#[$expr $($exprargs)*])* ++ { $e } ++ } ++} ++ ++/// Implement a flag, which may be a wildcard `_`. ++#[macro_export] ++#[doc(hidden)] ++macro_rules! __bitflags_flag { ++ ( ++ { ++ name: _, ++ named: { $($named:tt)* }, ++ unnamed: { $($unnamed:tt)* }, ++ } ++ ) => { ++ $($unnamed)* ++ }; ++ ( ++ { ++ name: $Flag:ident, ++ named: { $($named:tt)* }, ++ unnamed: { $($unnamed:tt)* }, ++ } ++ ) => { ++ $($named)* ++ }; ++} ++ ++#[macro_use] ++mod public; ++#[macro_use] ++mod internal; ++#[macro_use] ++mod external; ++ ++#[cfg(feature = "example_generated")] ++pub mod example_generated; ++ ++#[cfg(test)] ++mod tests; +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/src/parser.rs mesa-25.3.3/subprojects/bitflags-2.8.0/src/parser.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/src/parser.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/src/parser.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,332 @@ ++/*! ++Parsing flags from text. ++ ++Format and parse a flags value as text using the following grammar: ++ ++- _Flags:_ (_Whitespace_ _Flag_ _Whitespace_)`|`* ++- _Flag:_ _Name_ | _Hex Number_ ++- _Name:_ The name of any defined flag ++- _Hex Number_: `0x`([0-9a-fA-F])* ++- _Whitespace_: (\s)* ++ ++As an example, this is how `Flags::A | Flags::B | 0x0c` can be represented as text: ++ ++```text ++A | B | 0x0c ++``` ++ ++Alternatively, it could be represented without whitespace: ++ ++```text ++A|B|0x0C ++``` ++ ++Note that identifiers are *case-sensitive*, so the following is *not equivalent*: ++ ++```text ++a|b|0x0C ++``` ++*/ ++ ++#![allow(clippy::let_unit_value)] ++ ++use core::fmt::{self, Write}; ++ ++use crate::{Bits, Flags}; ++ ++/** ++Write a flags value as text. ++ ++Any bits that aren't part of a contained flag will be formatted as a hex number. ++*/ ++pub fn to_writer(flags: &B, mut writer: impl Write) -> Result<(), fmt::Error> ++where ++ B::Bits: WriteHex, ++{ ++ // A formatter for bitflags that produces text output like: ++ // ++ // A | B | 0xf6 ++ // ++ // The names of set flags are written in a bar-separated-format, ++ // followed by a hex number of any remaining bits that are set ++ // but don't correspond to any flags. ++ ++ // Iterate over known flag values ++ let mut first = true; ++ let mut iter = flags.iter_names(); ++ for (name, _) in &mut iter { ++ if !first { ++ writer.write_str(" | ")?; ++ } ++ ++ first = false; ++ writer.write_str(name)?; ++ } ++ ++ // Append any extra bits that correspond to flags to the end of the format ++ let remaining = iter.remaining().bits(); ++ if remaining != B::Bits::EMPTY { ++ if !first { ++ writer.write_str(" | ")?; ++ } ++ ++ writer.write_str("0x")?; ++ remaining.write_hex(writer)?; ++ } ++ ++ fmt::Result::Ok(()) ++} ++ ++#[cfg(feature = "serde")] ++pub(crate) struct AsDisplay<'a, B>(pub(crate) &'a B); ++ ++#[cfg(feature = "serde")] ++impl<'a, B: Flags> fmt::Display for AsDisplay<'a, B> ++where ++ B::Bits: WriteHex, ++{ ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ to_writer(self.0, f) ++ } ++} ++ ++/** ++Parse a flags value from text. ++ ++This function will fail on any names that don't correspond to defined flags. ++Unknown bits will be retained. ++*/ ++pub fn from_str(input: &str) -> Result ++where ++ B::Bits: ParseHex, ++{ ++ let mut parsed_flags = B::empty(); ++ ++ // If the input is empty then return an empty set of flags ++ if input.trim().is_empty() { ++ return Ok(parsed_flags); ++ } ++ ++ for flag in input.split('|') { ++ let flag = flag.trim(); ++ ++ // If the flag is empty then we've got missing input ++ if flag.is_empty() { ++ return Err(ParseError::empty_flag()); ++ } ++ ++ // If the flag starts with `0x` then it's a hex number ++ // Parse it directly to the underlying bits type ++ let parsed_flag = if let Some(flag) = flag.strip_prefix("0x") { ++ let bits = ++ ::parse_hex(flag).map_err(|_| ParseError::invalid_hex_flag(flag))?; ++ ++ B::from_bits_retain(bits) ++ } ++ // Otherwise the flag is a name ++ // The generated flags type will determine whether ++ // or not it's a valid identifier ++ else { ++ B::from_name(flag).ok_or_else(|| ParseError::invalid_named_flag(flag))? ++ }; ++ ++ parsed_flags.insert(parsed_flag); ++ } ++ ++ Ok(parsed_flags) ++} ++ ++/** ++Write a flags value as text, ignoring any unknown bits. ++*/ ++pub fn to_writer_truncate(flags: &B, writer: impl Write) -> Result<(), fmt::Error> ++where ++ B::Bits: WriteHex, ++{ ++ to_writer(&B::from_bits_truncate(flags.bits()), writer) ++} ++ ++/** ++Parse a flags value from text. ++ ++This function will fail on any names that don't correspond to defined flags. ++Unknown bits will be ignored. ++*/ ++pub fn from_str_truncate(input: &str) -> Result ++where ++ B::Bits: ParseHex, ++{ ++ Ok(B::from_bits_truncate(from_str::(input)?.bits())) ++} ++ ++/** ++Write only the contained, defined, named flags in a flags value as text. ++*/ ++pub fn to_writer_strict(flags: &B, mut writer: impl Write) -> Result<(), fmt::Error> { ++ // This is a simplified version of `to_writer` that ignores ++ // any bits not corresponding to a named flag ++ ++ let mut first = true; ++ let mut iter = flags.iter_names(); ++ for (name, _) in &mut iter { ++ if !first { ++ writer.write_str(" | ")?; ++ } ++ ++ first = false; ++ writer.write_str(name)?; ++ } ++ ++ fmt::Result::Ok(()) ++} ++ ++/** ++Parse a flags value from text. ++ ++This function will fail on any names that don't correspond to defined flags. ++This function will fail to parse hex values. ++*/ ++pub fn from_str_strict(input: &str) -> Result { ++ // This is a simplified version of `from_str` that ignores ++ // any bits not corresponding to a named flag ++ ++ let mut parsed_flags = B::empty(); ++ ++ // If the input is empty then return an empty set of flags ++ if input.trim().is_empty() { ++ return Ok(parsed_flags); ++ } ++ ++ for flag in input.split('|') { ++ let flag = flag.trim(); ++ ++ // If the flag is empty then we've got missing input ++ if flag.is_empty() { ++ return Err(ParseError::empty_flag()); ++ } ++ ++ // If the flag starts with `0x` then it's a hex number ++ // These aren't supported in the strict parser ++ if flag.starts_with("0x") { ++ return Err(ParseError::invalid_hex_flag("unsupported hex flag value")); ++ } ++ ++ let parsed_flag = B::from_name(flag).ok_or_else(|| ParseError::invalid_named_flag(flag))?; ++ ++ parsed_flags.insert(parsed_flag); ++ } ++ ++ Ok(parsed_flags) ++} ++ ++/** ++Encode a value as a hex string. ++ ++Implementors of this trait should not write the `0x` prefix. ++*/ ++pub trait WriteHex { ++ /// Write the value as hex. ++ fn write_hex(&self, writer: W) -> fmt::Result; ++} ++ ++/** ++Parse a value from a hex string. ++*/ ++pub trait ParseHex { ++ /// Parse the value from hex. ++ fn parse_hex(input: &str) -> Result ++ where ++ Self: Sized; ++} ++ ++/// An error encountered while parsing flags from text. ++#[derive(Debug)] ++pub struct ParseError(ParseErrorKind); ++ ++#[derive(Debug)] ++#[allow(clippy::enum_variant_names)] ++enum ParseErrorKind { ++ EmptyFlag, ++ InvalidNamedFlag { ++ #[cfg(not(feature = "std"))] ++ got: (), ++ #[cfg(feature = "std")] ++ got: String, ++ }, ++ InvalidHexFlag { ++ #[cfg(not(feature = "std"))] ++ got: (), ++ #[cfg(feature = "std")] ++ got: String, ++ }, ++} ++ ++impl ParseError { ++ /// An invalid hex flag was encountered. ++ pub fn invalid_hex_flag(flag: impl fmt::Display) -> Self { ++ let _flag = flag; ++ ++ let got = { ++ #[cfg(feature = "std")] ++ { ++ _flag.to_string() ++ } ++ }; ++ ++ ParseError(ParseErrorKind::InvalidHexFlag { got }) ++ } ++ ++ /// A named flag that doesn't correspond to any on the flags type was encountered. ++ pub fn invalid_named_flag(flag: impl fmt::Display) -> Self { ++ let _flag = flag; ++ ++ let got = { ++ #[cfg(feature = "std")] ++ { ++ _flag.to_string() ++ } ++ }; ++ ++ ParseError(ParseErrorKind::InvalidNamedFlag { got }) ++ } ++ ++ /// A hex or named flag wasn't found between separators. ++ pub const fn empty_flag() -> Self { ++ ParseError(ParseErrorKind::EmptyFlag) ++ } ++} ++ ++impl fmt::Display for ParseError { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ match &self.0 { ++ ParseErrorKind::InvalidNamedFlag { got } => { ++ let _got = got; ++ ++ write!(f, "unrecognized named flag")?; ++ ++ #[cfg(feature = "std")] ++ { ++ write!(f, " `{}`", _got)?; ++ } ++ } ++ ParseErrorKind::InvalidHexFlag { got } => { ++ let _got = got; ++ ++ write!(f, "invalid hex flag")?; ++ ++ #[cfg(feature = "std")] ++ { ++ write!(f, " `{}`", _got)?; ++ } ++ } ++ ParseErrorKind::EmptyFlag => { ++ write!(f, "encountered empty flag")?; ++ } ++ } ++ ++ Ok(()) ++ } ++} ++ ++#[cfg(feature = "std")] ++impl std::error::Error for ParseError {} +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/src/public.rs mesa-25.3.3/subprojects/bitflags-2.8.0/src/public.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/src/public.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/src/public.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,578 @@ ++//! Generate the user-facing flags type. ++//! ++//! The code here belongs to the end-user, so new trait implementations and methods can't be ++//! added without potentially breaking users. ++ ++/// Declare the user-facing bitflags struct. ++/// ++/// This type is guaranteed to be a newtype with a `bitflags`-facing type as its single field. ++#[macro_export] ++#[doc(hidden)] ++macro_rules! __declare_public_bitflags { ++ ( ++ $(#[$outer:meta])* ++ $vis:vis struct $PublicBitFlags:ident ++ ) => { ++ $(#[$outer])* ++ $vis struct $PublicBitFlags(<$PublicBitFlags as $crate::__private::PublicFlags>::Internal); ++ }; ++} ++ ++/// Implement functions on the public (user-facing) bitflags type. ++/// ++/// We need to be careful about adding new methods and trait implementations here because they ++/// could conflict with items added by the end-user. ++#[macro_export] ++#[doc(hidden)] ++macro_rules! __impl_public_bitflags_forward { ++ ( ++ $(#[$outer:meta])* ++ $PublicBitFlags:ident: $T:ty, $InternalBitFlags:ident ++ ) => { ++ $crate::__impl_bitflags! { ++ $(#[$outer])* ++ $PublicBitFlags: $T { ++ fn empty() { ++ Self($InternalBitFlags::empty()) ++ } ++ ++ fn all() { ++ Self($InternalBitFlags::all()) ++ } ++ ++ fn bits(f) { ++ f.0.bits() ++ } ++ ++ fn from_bits(bits) { ++ match $InternalBitFlags::from_bits(bits) { ++ $crate::__private::core::option::Option::Some(bits) => $crate::__private::core::option::Option::Some(Self(bits)), ++ $crate::__private::core::option::Option::None => $crate::__private::core::option::Option::None, ++ } ++ } ++ ++ fn from_bits_truncate(bits) { ++ Self($InternalBitFlags::from_bits_truncate(bits)) ++ } ++ ++ fn from_bits_retain(bits) { ++ Self($InternalBitFlags::from_bits_retain(bits)) ++ } ++ ++ fn from_name(name) { ++ match $InternalBitFlags::from_name(name) { ++ $crate::__private::core::option::Option::Some(bits) => $crate::__private::core::option::Option::Some(Self(bits)), ++ $crate::__private::core::option::Option::None => $crate::__private::core::option::Option::None, ++ } ++ } ++ ++ fn is_empty(f) { ++ f.0.is_empty() ++ } ++ ++ fn is_all(f) { ++ f.0.is_all() ++ } ++ ++ fn intersects(f, other) { ++ f.0.intersects(other.0) ++ } ++ ++ fn contains(f, other) { ++ f.0.contains(other.0) ++ } ++ ++ fn insert(f, other) { ++ f.0.insert(other.0) ++ } ++ ++ fn remove(f, other) { ++ f.0.remove(other.0) ++ } ++ ++ fn toggle(f, other) { ++ f.0.toggle(other.0) ++ } ++ ++ fn set(f, other, value) { ++ f.0.set(other.0, value) ++ } ++ ++ fn intersection(f, other) { ++ Self(f.0.intersection(other.0)) ++ } ++ ++ fn union(f, other) { ++ Self(f.0.union(other.0)) ++ } ++ ++ fn difference(f, other) { ++ Self(f.0.difference(other.0)) ++ } ++ ++ fn symmetric_difference(f, other) { ++ Self(f.0.symmetric_difference(other.0)) ++ } ++ ++ fn complement(f) { ++ Self(f.0.complement()) ++ } ++ } ++ } ++ }; ++} ++ ++/// Implement functions on the public (user-facing) bitflags type. ++/// ++/// We need to be careful about adding new methods and trait implementations here because they ++/// could conflict with items added by the end-user. ++#[macro_export] ++#[doc(hidden)] ++macro_rules! __impl_public_bitflags { ++ ( ++ $(#[$outer:meta])* ++ $BitFlags:ident: $T:ty, $PublicBitFlags:ident { ++ $( ++ $(#[$inner:ident $($args:tt)*])* ++ const $Flag:tt = $value:expr; ++ )* ++ } ++ ) => { ++ $crate::__impl_bitflags! { ++ $(#[$outer])* ++ $BitFlags: $T { ++ fn empty() { ++ Self(<$T as $crate::Bits>::EMPTY) ++ } ++ ++ fn all() { ++ let mut truncated = <$T as $crate::Bits>::EMPTY; ++ let mut i = 0; ++ ++ $( ++ $crate::__bitflags_expr_safe_attrs!( ++ $(#[$inner $($args)*])* ++ {{ ++ let flag = <$PublicBitFlags as $crate::Flags>::FLAGS[i].value().bits(); ++ ++ truncated = truncated | flag; ++ i += 1; ++ }} ++ ); ++ )* ++ ++ let _ = i; ++ Self::from_bits_retain(truncated) ++ } ++ ++ fn bits(f) { ++ f.0 ++ } ++ ++ fn from_bits(bits) { ++ let truncated = Self::from_bits_truncate(bits).0; ++ ++ if truncated == bits { ++ $crate::__private::core::option::Option::Some(Self(bits)) ++ } else { ++ $crate::__private::core::option::Option::None ++ } ++ } ++ ++ fn from_bits_truncate(bits) { ++ Self(bits & Self::all().bits()) ++ } ++ ++ fn from_bits_retain(bits) { ++ Self(bits) ++ } ++ ++ fn from_name(name) { ++ $( ++ $crate::__bitflags_flag!({ ++ name: $Flag, ++ named: { ++ $crate::__bitflags_expr_safe_attrs!( ++ $(#[$inner $($args)*])* ++ { ++ if name == $crate::__private::core::stringify!($Flag) { ++ return $crate::__private::core::option::Option::Some(Self($PublicBitFlags::$Flag.bits())); ++ } ++ } ++ ); ++ }, ++ unnamed: {}, ++ }); ++ )* ++ ++ let _ = name; ++ $crate::__private::core::option::Option::None ++ } ++ ++ fn is_empty(f) { ++ f.bits() == <$T as $crate::Bits>::EMPTY ++ } ++ ++ fn is_all(f) { ++ // NOTE: We check against `Self::all` here, not `Self::Bits::ALL` ++ // because the set of all flags may not use all bits ++ Self::all().bits() | f.bits() == f.bits() ++ } ++ ++ fn intersects(f, other) { ++ f.bits() & other.bits() != <$T as $crate::Bits>::EMPTY ++ } ++ ++ fn contains(f, other) { ++ f.bits() & other.bits() == other.bits() ++ } ++ ++ fn insert(f, other) { ++ *f = Self::from_bits_retain(f.bits()).union(other); ++ } ++ ++ fn remove(f, other) { ++ *f = Self::from_bits_retain(f.bits()).difference(other); ++ } ++ ++ fn toggle(f, other) { ++ *f = Self::from_bits_retain(f.bits()).symmetric_difference(other); ++ } ++ ++ fn set(f, other, value) { ++ if value { ++ f.insert(other); ++ } else { ++ f.remove(other); ++ } ++ } ++ ++ fn intersection(f, other) { ++ Self::from_bits_retain(f.bits() & other.bits()) ++ } ++ ++ fn union(f, other) { ++ Self::from_bits_retain(f.bits() | other.bits()) ++ } ++ ++ fn difference(f, other) { ++ Self::from_bits_retain(f.bits() & !other.bits()) ++ } ++ ++ fn symmetric_difference(f, other) { ++ Self::from_bits_retain(f.bits() ^ other.bits()) ++ } ++ ++ fn complement(f) { ++ Self::from_bits_truncate(!f.bits()) ++ } ++ } ++ } ++ }; ++} ++ ++/// Implement iterators on the public (user-facing) bitflags type. ++#[macro_export] ++#[doc(hidden)] ++macro_rules! __impl_public_bitflags_iter { ++ ( ++ $(#[$outer:meta])* ++ $BitFlags:ident: $T:ty, $PublicBitFlags:ident ++ ) => { ++ $(#[$outer])* ++ impl $BitFlags { ++ /// Yield a set of contained flags values. ++ /// ++ /// Each yielded flags value will correspond to a defined named flag. Any unknown bits ++ /// will be yielded together as a final flags value. ++ #[inline] ++ pub const fn iter(&self) -> $crate::iter::Iter<$PublicBitFlags> { ++ $crate::iter::Iter::__private_const_new( ++ <$PublicBitFlags as $crate::Flags>::FLAGS, ++ $PublicBitFlags::from_bits_retain(self.bits()), ++ $PublicBitFlags::from_bits_retain(self.bits()), ++ ) ++ } ++ ++ /// Yield a set of contained named flags values. ++ /// ++ /// This method is like [`iter`](#method.iter), except only yields bits in contained named flags. ++ /// Any unknown bits, or bits not corresponding to a contained flag will not be yielded. ++ #[inline] ++ pub const fn iter_names(&self) -> $crate::iter::IterNames<$PublicBitFlags> { ++ $crate::iter::IterNames::__private_const_new( ++ <$PublicBitFlags as $crate::Flags>::FLAGS, ++ $PublicBitFlags::from_bits_retain(self.bits()), ++ $PublicBitFlags::from_bits_retain(self.bits()), ++ ) ++ } ++ } ++ ++ $(#[$outer:meta])* ++ impl $crate::__private::core::iter::IntoIterator for $BitFlags { ++ type Item = $PublicBitFlags; ++ type IntoIter = $crate::iter::Iter<$PublicBitFlags>; ++ ++ fn into_iter(self) -> Self::IntoIter { ++ self.iter() ++ } ++ } ++ }; ++} ++ ++/// Implement traits on the public (user-facing) bitflags type. ++#[macro_export] ++#[doc(hidden)] ++macro_rules! __impl_public_bitflags_ops { ++ ( ++ $(#[$outer:meta])* ++ $PublicBitFlags:ident ++ ) => { ++ ++ $(#[$outer])* ++ impl $crate::__private::core::fmt::Binary for $PublicBitFlags { ++ fn fmt( ++ &self, ++ f: &mut $crate::__private::core::fmt::Formatter, ++ ) -> $crate::__private::core::fmt::Result { ++ let inner = self.0; ++ $crate::__private::core::fmt::Binary::fmt(&inner, f) ++ } ++ } ++ ++ $(#[$outer])* ++ impl $crate::__private::core::fmt::Octal for $PublicBitFlags { ++ fn fmt( ++ &self, ++ f: &mut $crate::__private::core::fmt::Formatter, ++ ) -> $crate::__private::core::fmt::Result { ++ let inner = self.0; ++ $crate::__private::core::fmt::Octal::fmt(&inner, f) ++ } ++ } ++ ++ $(#[$outer])* ++ impl $crate::__private::core::fmt::LowerHex for $PublicBitFlags { ++ fn fmt( ++ &self, ++ f: &mut $crate::__private::core::fmt::Formatter, ++ ) -> $crate::__private::core::fmt::Result { ++ let inner = self.0; ++ $crate::__private::core::fmt::LowerHex::fmt(&inner, f) ++ } ++ } ++ ++ $(#[$outer])* ++ impl $crate::__private::core::fmt::UpperHex for $PublicBitFlags { ++ fn fmt( ++ &self, ++ f: &mut $crate::__private::core::fmt::Formatter, ++ ) -> $crate::__private::core::fmt::Result { ++ let inner = self.0; ++ $crate::__private::core::fmt::UpperHex::fmt(&inner, f) ++ } ++ } ++ ++ $(#[$outer])* ++ impl $crate::__private::core::ops::BitOr for $PublicBitFlags { ++ type Output = Self; ++ ++ /// The bitwise or (`|`) of the bits in two flags values. ++ #[inline] ++ fn bitor(self, other: $PublicBitFlags) -> Self { ++ self.union(other) ++ } ++ } ++ ++ $(#[$outer])* ++ impl $crate::__private::core::ops::BitOrAssign for $PublicBitFlags { ++ /// The bitwise or (`|`) of the bits in two flags values. ++ #[inline] ++ fn bitor_assign(&mut self, other: Self) { ++ self.insert(other); ++ } ++ } ++ ++ $(#[$outer])* ++ impl $crate::__private::core::ops::BitXor for $PublicBitFlags { ++ type Output = Self; ++ ++ /// The bitwise exclusive-or (`^`) of the bits in two flags values. ++ #[inline] ++ fn bitxor(self, other: Self) -> Self { ++ self.symmetric_difference(other) ++ } ++ } ++ ++ $(#[$outer])* ++ impl $crate::__private::core::ops::BitXorAssign for $PublicBitFlags { ++ /// The bitwise exclusive-or (`^`) of the bits in two flags values. ++ #[inline] ++ fn bitxor_assign(&mut self, other: Self) { ++ self.toggle(other); ++ } ++ } ++ ++ $(#[$outer])* ++ impl $crate::__private::core::ops::BitAnd for $PublicBitFlags { ++ type Output = Self; ++ ++ /// The bitwise and (`&`) of the bits in two flags values. ++ #[inline] ++ fn bitand(self, other: Self) -> Self { ++ self.intersection(other) ++ } ++ } ++ ++ $(#[$outer])* ++ impl $crate::__private::core::ops::BitAndAssign for $PublicBitFlags { ++ /// The bitwise and (`&`) of the bits in two flags values. ++ #[inline] ++ fn bitand_assign(&mut self, other: Self) { ++ *self = Self::from_bits_retain(self.bits()).intersection(other); ++ } ++ } ++ ++ $(#[$outer])* ++ impl $crate::__private::core::ops::Sub for $PublicBitFlags { ++ type Output = Self; ++ ++ /// The intersection of a source flags value with the complement of a target flags value (`&!`). ++ /// ++ /// This method is not equivalent to `self & !other` when `other` has unknown bits set. ++ /// `difference` won't truncate `other`, but the `!` operator will. ++ #[inline] ++ fn sub(self, other: Self) -> Self { ++ self.difference(other) ++ } ++ } ++ ++ $(#[$outer])* ++ impl $crate::__private::core::ops::SubAssign for $PublicBitFlags { ++ /// The intersection of a source flags value with the complement of a target flags value (`&!`). ++ /// ++ /// This method is not equivalent to `self & !other` when `other` has unknown bits set. ++ /// `difference` won't truncate `other`, but the `!` operator will. ++ #[inline] ++ fn sub_assign(&mut self, other: Self) { ++ self.remove(other); ++ } ++ } ++ ++ $(#[$outer])* ++ impl $crate::__private::core::ops::Not for $PublicBitFlags { ++ type Output = Self; ++ ++ /// The bitwise negation (`!`) of the bits in a flags value, truncating the result. ++ #[inline] ++ fn not(self) -> Self { ++ self.complement() ++ } ++ } ++ ++ $(#[$outer])* ++ impl $crate::__private::core::iter::Extend<$PublicBitFlags> for $PublicBitFlags { ++ /// The bitwise or (`|`) of the bits in each flags value. ++ fn extend>( ++ &mut self, ++ iterator: T, ++ ) { ++ for item in iterator { ++ self.insert(item) ++ } ++ } ++ } ++ ++ $(#[$outer])* ++ impl $crate::__private::core::iter::FromIterator<$PublicBitFlags> for $PublicBitFlags { ++ /// The bitwise or (`|`) of the bits in each flags value. ++ fn from_iter>( ++ iterator: T, ++ ) -> Self { ++ use $crate::__private::core::iter::Extend; ++ ++ let mut result = Self::empty(); ++ result.extend(iterator); ++ result ++ } ++ } ++ }; ++} ++ ++/// Implement constants on the public (user-facing) bitflags type. ++#[macro_export] ++#[doc(hidden)] ++macro_rules! __impl_public_bitflags_consts { ++ ( ++ $(#[$outer:meta])* ++ $PublicBitFlags:ident: $T:ty { ++ $( ++ $(#[$inner:ident $($args:tt)*])* ++ const $Flag:tt = $value:expr; ++ )* ++ } ++ ) => { ++ $(#[$outer])* ++ impl $PublicBitFlags { ++ $( ++ $crate::__bitflags_flag!({ ++ name: $Flag, ++ named: { ++ $(#[$inner $($args)*])* ++ #[allow( ++ deprecated, ++ non_upper_case_globals, ++ )] ++ pub const $Flag: Self = Self::from_bits_retain($value); ++ }, ++ unnamed: {}, ++ }); ++ )* ++ } ++ ++ $(#[$outer])* ++ impl $crate::Flags for $PublicBitFlags { ++ const FLAGS: &'static [$crate::Flag<$PublicBitFlags>] = &[ ++ $( ++ $crate::__bitflags_flag!({ ++ name: $Flag, ++ named: { ++ $crate::__bitflags_expr_safe_attrs!( ++ $(#[$inner $($args)*])* ++ { ++ #[allow( ++ deprecated, ++ non_upper_case_globals, ++ )] ++ $crate::Flag::new($crate::__private::core::stringify!($Flag), $PublicBitFlags::$Flag) ++ } ++ ) ++ }, ++ unnamed: { ++ $crate::__bitflags_expr_safe_attrs!( ++ $(#[$inner $($args)*])* ++ { ++ #[allow( ++ deprecated, ++ non_upper_case_globals, ++ )] ++ $crate::Flag::new("", $PublicBitFlags::from_bits_retain($value)) ++ } ++ ) ++ }, ++ }), ++ )* ++ ]; ++ ++ type Bits = $T; ++ ++ fn bits(&self) -> $T { ++ $PublicBitFlags::bits(self) ++ } ++ ++ fn from_bits_retain(bits: $T) -> $PublicBitFlags { ++ $PublicBitFlags::from_bits_retain(bits) ++ } ++ } ++ }; ++} +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/all.rs mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/all.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/all.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/all.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,23 @@ ++use super::*; ++ ++use crate::Flags; ++ ++#[test] ++fn cases() { ++ case(1 | 1 << 1 | 1 << 2, TestFlags::all); ++ ++ case(0, TestZero::all); ++ ++ case(0, TestEmpty::all); ++ ++ case(!0, TestExternal::all); ++} ++ ++#[track_caller] ++fn case(expected: T::Bits, inherent: impl FnOnce() -> T) ++where ++ ::Bits: std::fmt::Debug + PartialEq, ++{ ++ assert_eq!(expected, inherent().bits(), "T::all()"); ++ assert_eq!(expected, T::all().bits(), "Flags::all()"); ++} +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/bitflags_match.rs mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/bitflags_match.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/bitflags_match.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/bitflags_match.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,93 @@ ++bitflags! { ++ #[derive(PartialEq)] ++ struct Flags: u8 { ++ const A = 1 << 0; ++ const B = 1 << 1; ++ const C = 1 << 2; ++ const D = 1 << 3; ++ } ++} ++ ++fn flag_to_string(flag: Flags) -> String { ++ bitflags_match!(flag, { ++ Flags::A => "A".to_string(), ++ Flags::B => { "B".to_string() } ++ Flags::C => "C".to_string(), ++ Flags::D => "D".to_string(), ++ Flags::A | Flags::B => "A or B".to_string(), ++ Flags::A & Flags::B => { "A and B | empty".to_string() }, ++ Flags::A ^ Flags::B => "A xor B".to_string(), ++ Flags::A | Flags::B | Flags::C => "A or B or C".to_string(), ++ Flags::A & Flags::B & Flags::C => "A and B and C".to_string(), ++ Flags::A ^ Flags::B ^ Flags::C => "A xor B xor C".to_string(), ++ Flags::A | Flags::B | Flags::C | Flags::D => "All flags".to_string(), ++ _ => "Unknown combination".to_string() ++ }) ++} ++ ++#[test] ++fn test_single_flags() { ++ assert_eq!(flag_to_string(Flags::A), "A"); ++ assert_eq!(flag_to_string(Flags::B), "B"); ++ assert_eq!(flag_to_string(Flags::C), "C"); ++ assert_eq!(flag_to_string(Flags::D), "D"); ++} ++ ++#[test] ++fn test_or_operations() { ++ assert_eq!(flag_to_string(Flags::A | Flags::B), "A or B"); ++ assert_eq!( ++ flag_to_string(Flags::A | Flags::B | Flags::C), ++ "A or B or C" ++ ); ++ assert_eq!( ++ flag_to_string(Flags::A | Flags::B | Flags::C | Flags::D), ++ "All flags" ++ ); ++} ++ ++#[test] ++fn test_and_operations() { ++ assert_eq!(flag_to_string(Flags::A & Flags::A), "A"); ++ assert_eq!(flag_to_string(Flags::A & Flags::B), "A and B | empty"); ++ assert_eq!( ++ flag_to_string(Flags::A & Flags::B & Flags::C), ++ "A and B | empty" ++ ); // Since A, B, and C are mutually exclusive, the result of A & B & C is 0 ==> A & B & C = 0000 (i.e., empty). ++ // However, in the bitflags_match! statement (actually is if {..} else if {..} .. else {..}), ++ // the "A & B = 0000" condition is listed first, so 0000 will match "A & B" first, ++ // resulting in the output of the "A and B | empty" branch. ++ assert_eq!( ++ flag_to_string(Flags::A & Flags::B & Flags::C & Flags::D), ++ "A and B | empty" ++ ); ++} ++ ++#[test] ++fn test_xor_operations() { ++ assert_eq!(flag_to_string(Flags::A ^ Flags::B), "A or B"); // A | B = A ^ B == 0011 ++ assert_eq!(flag_to_string(Flags::A ^ Flags::A), "A and B | empty"); ++ assert_eq!( ++ flag_to_string(Flags::A ^ Flags::B ^ Flags::C), ++ "A or B or C" ++ ); ++} ++ ++#[test] ++fn test_complex_operations() { ++ assert_eq!(flag_to_string(Flags::A | (Flags::B & Flags::C)), "A"); ++ assert_eq!( ++ flag_to_string((Flags::A | Flags::B) & (Flags::B | Flags::C)), ++ "B" ++ ); ++ assert_eq!( ++ flag_to_string(Flags::A ^ (Flags::B | Flags::C)), ++ "A or B or C" ++ ); ++} ++ ++#[test] ++fn test_empty_and_full_flags() { ++ assert_eq!(flag_to_string(Flags::empty()), "A and B | empty"); ++ assert_eq!(flag_to_string(Flags::all()), "All flags"); ++} +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/bits.rs mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/bits.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/bits.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/bits.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,36 @@ ++use super::*; ++ ++use crate::Flags; ++ ++#[test] ++fn cases() { ++ case(0, TestFlags::empty(), TestFlags::bits); ++ ++ case(1, TestFlags::A, TestFlags::bits); ++ case(1 | 1 << 1 | 1 << 2, TestFlags::ABC, TestFlags::bits); ++ ++ case(!0, TestFlags::from_bits_retain(u8::MAX), TestFlags::bits); ++ case(1 << 3, TestFlags::from_bits_retain(1 << 3), TestFlags::bits); ++ ++ case(1 << 3, TestZero::from_bits_retain(1 << 3), TestZero::bits); ++ ++ case(1 << 3, TestEmpty::from_bits_retain(1 << 3), TestEmpty::bits); ++ ++ case( ++ 1 << 4 | 1 << 6, ++ TestExternal::from_bits_retain(1 << 4 | 1 << 6), ++ TestExternal::bits, ++ ); ++} ++ ++#[track_caller] ++fn case( ++ expected: T::Bits, ++ value: T, ++ inherent: impl FnOnce(&T) -> T::Bits, ++) where ++ T::Bits: std::fmt::Debug + PartialEq, ++{ ++ assert_eq!(expected, inherent(&value), "{:?}.bits()", value); ++ assert_eq!(expected, Flags::bits(&value), "Flags::bits({:?})", value); ++} +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/complement.rs mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/complement.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/complement.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/complement.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,53 @@ ++use super::*; ++ ++use crate::Flags; ++ ++#[test] ++fn cases() { ++ case(0, TestFlags::all(), TestFlags::complement); ++ case(0, TestFlags::from_bits_retain(!0), TestFlags::complement); ++ ++ case(1 | 1 << 1, TestFlags::C, TestFlags::complement); ++ case( ++ 1 | 1 << 1, ++ TestFlags::C | TestFlags::from_bits_retain(1 << 3), ++ TestFlags::complement, ++ ); ++ ++ case( ++ 1 | 1 << 1 | 1 << 2, ++ TestFlags::empty(), ++ TestFlags::complement, ++ ); ++ case( ++ 1 | 1 << 1 | 1 << 2, ++ TestFlags::from_bits_retain(1 << 3), ++ TestFlags::complement, ++ ); ++ ++ case(0, TestZero::empty(), TestZero::complement); ++ ++ case(0, TestEmpty::empty(), TestEmpty::complement); ++ ++ case(1 << 2, TestOverlapping::AB, TestOverlapping::complement); ++ ++ case(!0, TestExternal::empty(), TestExternal::complement); ++} ++ ++#[track_caller] ++fn case + Copy>( ++ expected: T::Bits, ++ value: T, ++ inherent: impl FnOnce(T) -> T, ++) where ++ T::Bits: std::fmt::Debug + PartialEq, ++{ ++ assert_eq!(expected, inherent(value).bits(), "{:?}.complement()", value); ++ assert_eq!( ++ expected, ++ Flags::complement(value).bits(), ++ "Flags::complement({:?})", ++ value ++ ); ++ assert_eq!(expected, (!value).bits(), "!{:?}", value); ++} +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/contains.rs mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/contains.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/contains.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/contains.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,108 @@ ++use super::*; ++ ++use crate::Flags; ++ ++#[test] ++fn cases() { ++ case( ++ TestFlags::empty(), ++ &[ ++ (TestFlags::empty(), true), ++ (TestFlags::A, false), ++ (TestFlags::B, false), ++ (TestFlags::C, false), ++ (TestFlags::from_bits_retain(1 << 3), false), ++ ], ++ TestFlags::contains, ++ ); ++ ++ case( ++ TestFlags::A, ++ &[ ++ (TestFlags::empty(), true), ++ (TestFlags::A, true), ++ (TestFlags::B, false), ++ (TestFlags::C, false), ++ (TestFlags::ABC, false), ++ (TestFlags::from_bits_retain(1 << 3), false), ++ (TestFlags::from_bits_retain(1 | (1 << 3)), false), ++ ], ++ TestFlags::contains, ++ ); ++ ++ case( ++ TestFlags::ABC, ++ &[ ++ (TestFlags::empty(), true), ++ (TestFlags::A, true), ++ (TestFlags::B, true), ++ (TestFlags::C, true), ++ (TestFlags::ABC, true), ++ (TestFlags::from_bits_retain(1 << 3), false), ++ ], ++ TestFlags::contains, ++ ); ++ ++ case( ++ TestFlags::from_bits_retain(1 << 3), ++ &[ ++ (TestFlags::empty(), true), ++ (TestFlags::A, false), ++ (TestFlags::B, false), ++ (TestFlags::C, false), ++ (TestFlags::from_bits_retain(1 << 3), true), ++ ], ++ TestFlags::contains, ++ ); ++ ++ case( ++ TestZero::ZERO, ++ &[(TestZero::ZERO, true)], ++ TestZero::contains, ++ ); ++ ++ case( ++ TestOverlapping::AB, ++ &[ ++ (TestOverlapping::AB, true), ++ (TestOverlapping::BC, false), ++ (TestOverlapping::from_bits_retain(1 << 1), true), ++ ], ++ TestOverlapping::contains, ++ ); ++ ++ case( ++ TestExternal::all(), ++ &[ ++ (TestExternal::A, true), ++ (TestExternal::B, true), ++ (TestExternal::C, true), ++ (TestExternal::from_bits_retain(1 << 5 | 1 << 7), true), ++ ], ++ TestExternal::contains, ++ ); ++} ++ ++#[track_caller] ++fn case( ++ value: T, ++ inputs: &[(T, bool)], ++ mut inherent: impl FnMut(&T, T) -> bool, ++) { ++ for (input, expected) in inputs { ++ assert_eq!( ++ *expected, ++ inherent(&value, *input), ++ "{:?}.contains({:?})", ++ value, ++ input ++ ); ++ assert_eq!( ++ *expected, ++ Flags::contains(&value, *input), ++ "Flags::contains({:?}, {:?})", ++ value, ++ input ++ ); ++ } ++} +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/difference.rs mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/difference.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/difference.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/difference.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,92 @@ ++use super::*; ++ ++use crate::Flags; ++ ++#[test] ++fn cases() { ++ case( ++ TestFlags::A | TestFlags::B, ++ &[ ++ (TestFlags::A, 1 << 1), ++ (TestFlags::B, 1), ++ (TestFlags::from_bits_retain(1 << 3), 1 | 1 << 1), ++ ], ++ TestFlags::difference, ++ ); ++ ++ case( ++ TestFlags::from_bits_retain(1 | 1 << 3), ++ &[ ++ (TestFlags::A, 1 << 3), ++ (TestFlags::from_bits_retain(1 << 3), 1), ++ ], ++ TestFlags::difference, ++ ); ++ ++ case( ++ TestExternal::from_bits_retain(!0), ++ &[(TestExternal::A, 0b1111_1110)], ++ TestExternal::difference, ++ ); ++ ++ assert_eq!( ++ 0b1111_1110, ++ (TestExternal::from_bits_retain(!0) & !TestExternal::A).bits() ++ ); ++ ++ assert_eq!( ++ 0b1111_1110, ++ (TestFlags::from_bits_retain(!0).difference(TestFlags::A)).bits() ++ ); ++ ++ // The `!` operator unsets bits that don't correspond to known flags ++ assert_eq!( ++ 1 << 1 | 1 << 2, ++ (TestFlags::from_bits_retain(!0) & !TestFlags::A).bits() ++ ); ++} ++ ++#[track_caller] ++fn case + std::ops::SubAssign + Copy>( ++ value: T, ++ inputs: &[(T, T::Bits)], ++ mut inherent: impl FnMut(T, T) -> T, ++) where ++ T::Bits: std::fmt::Debug + PartialEq + Copy, ++{ ++ for (input, expected) in inputs { ++ assert_eq!( ++ *expected, ++ inherent(value, *input).bits(), ++ "{:?}.difference({:?})", ++ value, ++ input ++ ); ++ assert_eq!( ++ *expected, ++ Flags::difference(value, *input).bits(), ++ "Flags::difference({:?}, {:?})", ++ value, ++ input ++ ); ++ assert_eq!( ++ *expected, ++ (value - *input).bits(), ++ "{:?} - {:?}", ++ value, ++ input ++ ); ++ assert_eq!( ++ *expected, ++ { ++ let mut value = value; ++ value -= *input; ++ value ++ } ++ .bits(), ++ "{:?} -= {:?}", ++ value, ++ input, ++ ); ++ } ++} +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/empty.rs mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/empty.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/empty.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/empty.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,23 @@ ++use super::*; ++ ++use crate::Flags; ++ ++#[test] ++fn cases() { ++ case(0, TestFlags::empty); ++ ++ case(0, TestZero::empty); ++ ++ case(0, TestEmpty::empty); ++ ++ case(0, TestExternal::empty); ++} ++ ++#[track_caller] ++fn case(expected: T::Bits, inherent: impl FnOnce() -> T) ++where ++ ::Bits: std::fmt::Debug + PartialEq, ++{ ++ assert_eq!(expected, inherent().bits(), "T::empty()"); ++ assert_eq!(expected, T::empty().bits(), "Flags::empty()"); ++} +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/eq.rs mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/eq.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/eq.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/eq.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,10 @@ ++use super::*; ++ ++#[test] ++fn cases() { ++ assert_eq!(TestFlags::empty(), TestFlags::empty()); ++ assert_eq!(TestFlags::all(), TestFlags::all()); ++ ++ assert!(TestFlags::from_bits_retain(1) < TestFlags::from_bits_retain(2)); ++ assert!(TestFlags::from_bits_retain(2) > TestFlags::from_bits_retain(1)); ++} +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/extend.rs mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/extend.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/extend.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/extend.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,42 @@ ++use super::*; ++ ++#[test] ++fn cases() { ++ let mut flags = TestFlags::empty(); ++ ++ flags.extend(TestFlags::A); ++ ++ assert_eq!(TestFlags::A, flags); ++ ++ flags.extend(TestFlags::A | TestFlags::B | TestFlags::C); ++ ++ assert_eq!(TestFlags::ABC, flags); ++ ++ flags.extend(TestFlags::from_bits_retain(1 << 5)); ++ ++ assert_eq!(TestFlags::ABC | TestFlags::from_bits_retain(1 << 5), flags); ++} ++ ++mod external { ++ use super::*; ++ ++ #[test] ++ fn cases() { ++ let mut flags = TestExternal::empty(); ++ ++ flags.extend(TestExternal::A); ++ ++ assert_eq!(TestExternal::A, flags); ++ ++ flags.extend(TestExternal::A | TestExternal::B | TestExternal::C); ++ ++ assert_eq!(TestExternal::ABC, flags); ++ ++ flags.extend(TestExternal::from_bits_retain(1 << 5)); ++ ++ assert_eq!( ++ TestExternal::ABC | TestExternal::from_bits_retain(1 << 5), ++ flags ++ ); ++ } ++} +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/flags.rs mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/flags.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/flags.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/flags.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,46 @@ ++use super::*; ++ ++use crate::Flags; ++ ++#[test] ++fn cases() { ++ let flags = TestFlags::FLAGS ++ .iter() ++ .map(|flag| (flag.name(), flag.value().bits())) ++ .collect::>(); ++ ++ assert_eq!( ++ vec![ ++ ("A", 1u8), ++ ("B", 1 << 1), ++ ("C", 1 << 2), ++ ("ABC", 1 | 1 << 1 | 1 << 2), ++ ], ++ flags, ++ ); ++ ++ assert_eq!(0, TestEmpty::FLAGS.iter().count()); ++} ++ ++mod external { ++ use super::*; ++ ++ #[test] ++ fn cases() { ++ let flags = TestExternal::FLAGS ++ .iter() ++ .map(|flag| (flag.name(), flag.value().bits())) ++ .collect::>(); ++ ++ assert_eq!( ++ vec![ ++ ("A", 1u8), ++ ("B", 1 << 1), ++ ("C", 1 << 2), ++ ("ABC", 1 | 1 << 1 | 1 << 2), ++ ("", !0), ++ ], ++ flags, ++ ); ++ } ++} +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/fmt.rs mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/fmt.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/fmt.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/fmt.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,97 @@ ++use super::*; ++ ++#[test] ++fn cases() { ++ case(TestFlags::empty(), "TestFlags(0x0)", "0", "0", "0", "0"); ++ case(TestFlags::A, "TestFlags(A)", "1", "1", "1", "1"); ++ case( ++ TestFlags::all(), ++ "TestFlags(A | B | C)", ++ "7", ++ "7", ++ "7", ++ "111", ++ ); ++ case( ++ TestFlags::from_bits_retain(1 << 3), ++ "TestFlags(0x8)", ++ "8", ++ "8", ++ "10", ++ "1000", ++ ); ++ case( ++ TestFlags::A | TestFlags::from_bits_retain(1 << 3), ++ "TestFlags(A | 0x8)", ++ "9", ++ "9", ++ "11", ++ "1001", ++ ); ++ ++ case(TestZero::ZERO, "TestZero(0x0)", "0", "0", "0", "0"); ++ case( ++ TestZero::ZERO | TestZero::from_bits_retain(1), ++ "TestZero(0x1)", ++ "1", ++ "1", ++ "1", ++ "1", ++ ); ++ ++ case(TestZeroOne::ONE, "TestZeroOne(ONE)", "1", "1", "1", "1"); ++ ++ case( ++ TestOverlapping::from_bits_retain(1 << 1), ++ "TestOverlapping(0x2)", ++ "2", ++ "2", ++ "2", ++ "10", ++ ); ++ ++ case( ++ TestExternal::from_bits_retain(1 | 1 << 1 | 1 << 3), ++ "TestExternal(A | B | 0x8)", ++ "B", ++ "b", ++ "13", ++ "1011", ++ ); ++ ++ case( ++ TestExternal::all(), ++ "TestExternal(A | B | C | 0xf8)", ++ "FF", ++ "ff", ++ "377", ++ "11111111", ++ ); ++ ++ case( ++ TestExternalFull::all(), ++ "TestExternalFull(0xff)", ++ "FF", ++ "ff", ++ "377", ++ "11111111", ++ ); ++} ++ ++#[track_caller] ++fn case< ++ T: std::fmt::Debug + std::fmt::UpperHex + std::fmt::LowerHex + std::fmt::Octal + std::fmt::Binary, ++>( ++ value: T, ++ debug: &str, ++ uhex: &str, ++ lhex: &str, ++ oct: &str, ++ bin: &str, ++) { ++ assert_eq!(debug, format!("{:?}", value)); ++ assert_eq!(uhex, format!("{:X}", value)); ++ assert_eq!(lhex, format!("{:x}", value)); ++ assert_eq!(oct, format!("{:o}", value)); ++ assert_eq!(bin, format!("{:b}", value)); ++} +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/from_bits_retain.rs mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/from_bits_retain.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/from_bits_retain.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/from_bits_retain.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,38 @@ ++use super::*; ++ ++use crate::Flags; ++ ++#[test] ++fn cases() { ++ case(0, TestFlags::from_bits_retain); ++ case(1, TestFlags::from_bits_retain); ++ case(1 | 1 << 1 | 1 << 2, TestFlags::from_bits_retain); ++ ++ case(1 << 3, TestFlags::from_bits_retain); ++ case(1 | 1 << 3, TestFlags::from_bits_retain); ++ ++ case(1 | 1 << 1, TestOverlapping::from_bits_retain); ++ ++ case(1 << 1, TestOverlapping::from_bits_retain); ++ ++ case(1 << 5, TestExternal::from_bits_retain); ++} ++ ++#[track_caller] ++fn case(input: T::Bits, inherent: impl FnOnce(T::Bits) -> T) ++where ++ ::Bits: std::fmt::Debug + PartialEq, ++{ ++ assert_eq!( ++ input, ++ inherent(input).bits(), ++ "T::from_bits_retain({:?})", ++ input ++ ); ++ assert_eq!( ++ input, ++ T::from_bits_retain(input).bits(), ++ "Flags::from_bits_retain({:?})", ++ input ++ ); ++} +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/from_bits.rs mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/from_bits.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/from_bits.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/from_bits.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,45 @@ ++use super::*; ++ ++use crate::Flags; ++ ++#[test] ++fn cases() { ++ case(Some(0), 0, TestFlags::from_bits); ++ case(Some(1), 1, TestFlags::from_bits); ++ case( ++ Some(1 | 1 << 1 | 1 << 2), ++ 1 | 1 << 1 | 1 << 2, ++ TestFlags::from_bits, ++ ); ++ ++ case(None, 1 << 3, TestFlags::from_bits); ++ case(None, 1 | 1 << 3, TestFlags::from_bits); ++ ++ case(Some(1 | 1 << 1), 1 | 1 << 1, TestOverlapping::from_bits); ++ ++ case(Some(1 << 1), 1 << 1, TestOverlapping::from_bits); ++ ++ case(Some(1 << 5), 1 << 5, TestExternal::from_bits); ++} ++ ++#[track_caller] ++fn case( ++ expected: Option, ++ input: T::Bits, ++ inherent: impl FnOnce(T::Bits) -> Option, ++) where ++ ::Bits: std::fmt::Debug + PartialEq, ++{ ++ assert_eq!( ++ expected, ++ inherent(input).map(|f| f.bits()), ++ "T::from_bits({:?})", ++ input ++ ); ++ assert_eq!( ++ expected, ++ T::from_bits(input).map(|f| f.bits()), ++ "Flags::from_bits({:?})", ++ input ++ ); ++} +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/from_bits_truncate.rs mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/from_bits_truncate.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/from_bits_truncate.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/from_bits_truncate.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,42 @@ ++use super::*; ++ ++use crate::Flags; ++ ++#[test] ++fn cases() { ++ case(0, 0, TestFlags::from_bits_truncate); ++ case(1, 1, TestFlags::from_bits_truncate); ++ case( ++ 1 | 1 << 1 | 1 << 2, ++ 1 | 1 << 1 | 1 << 2, ++ TestFlags::from_bits_truncate, ++ ); ++ ++ case(0, 1 << 3, TestFlags::from_bits_truncate); ++ case(1, 1 | 1 << 3, TestFlags::from_bits_truncate); ++ ++ case(1 | 1 << 1, 1 | 1 << 1, TestOverlapping::from_bits_truncate); ++ ++ case(1 << 1, 1 << 1, TestOverlapping::from_bits_truncate); ++ ++ case(1 << 5, 1 << 5, TestExternal::from_bits_truncate); ++} ++ ++#[track_caller] ++fn case(expected: T::Bits, input: T::Bits, inherent: impl FnOnce(T::Bits) -> T) ++where ++ ::Bits: std::fmt::Debug + PartialEq, ++{ ++ assert_eq!( ++ expected, ++ inherent(input).bits(), ++ "T::from_bits_truncate({:?})", ++ input ++ ); ++ assert_eq!( ++ expected, ++ T::from_bits_truncate(input).bits(), ++ "Flags::from_bits_truncate({:?})", ++ input ++ ); ++} +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/from_name.rs mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/from_name.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/from_name.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/from_name.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,42 @@ ++use super::*; ++ ++use crate::Flags; ++ ++#[test] ++fn cases() { ++ case(Some(1), "A", TestFlags::from_name); ++ case(Some(1 << 1), "B", TestFlags::from_name); ++ case(Some(1 | 1 << 1 | 1 << 2), "ABC", TestFlags::from_name); ++ ++ case(None, "", TestFlags::from_name); ++ case(None, "a", TestFlags::from_name); ++ case(None, "0x1", TestFlags::from_name); ++ case(None, "A | B", TestFlags::from_name); ++ ++ case(Some(0), "ZERO", TestZero::from_name); ++ ++ case(Some(2), "二", TestUnicode::from_name); ++ ++ case(None, "_", TestExternal::from_name); ++ ++ case(None, "", TestExternal::from_name); ++} ++ ++#[track_caller] ++fn case(expected: Option, input: &str, inherent: impl FnOnce(&str) -> Option) ++where ++ ::Bits: std::fmt::Debug + PartialEq, ++{ ++ assert_eq!( ++ expected, ++ inherent(input).map(|f| f.bits()), ++ "T::from_name({:?})", ++ input ++ ); ++ assert_eq!( ++ expected, ++ T::from_name(input).map(|f| f.bits()), ++ "Flags::from_name({:?})", ++ input ++ ); ++} +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/insert.rs mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/insert.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/insert.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/insert.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,91 @@ ++use super::*; ++ ++use crate::Flags; ++ ++#[test] ++fn cases() { ++ case( ++ TestFlags::empty(), ++ &[ ++ (TestFlags::A, 1), ++ (TestFlags::A | TestFlags::B, 1 | 1 << 1), ++ (TestFlags::empty(), 0), ++ (TestFlags::from_bits_retain(1 << 3), 1 << 3), ++ ], ++ TestFlags::insert, ++ TestFlags::set, ++ ); ++ ++ case( ++ TestFlags::A, ++ &[ ++ (TestFlags::A, 1), ++ (TestFlags::empty(), 1), ++ (TestFlags::B, 1 | 1 << 1), ++ ], ++ TestFlags::insert, ++ TestFlags::set, ++ ); ++} ++ ++#[track_caller] ++fn case( ++ value: T, ++ inputs: &[(T, T::Bits)], ++ mut inherent_insert: impl FnMut(&mut T, T), ++ mut inherent_set: impl FnMut(&mut T, T, bool), ++) where ++ T::Bits: std::fmt::Debug + PartialEq + Copy, ++{ ++ for (input, expected) in inputs { ++ assert_eq!( ++ *expected, ++ { ++ let mut value = value; ++ inherent_insert(&mut value, *input); ++ value ++ } ++ .bits(), ++ "{:?}.insert({:?})", ++ value, ++ input ++ ); ++ assert_eq!( ++ *expected, ++ { ++ let mut value = value; ++ Flags::insert(&mut value, *input); ++ value ++ } ++ .bits(), ++ "Flags::insert({:?}, {:?})", ++ value, ++ input ++ ); ++ ++ assert_eq!( ++ *expected, ++ { ++ let mut value = value; ++ inherent_set(&mut value, *input, true); ++ value ++ } ++ .bits(), ++ "{:?}.set({:?}, true)", ++ value, ++ input ++ ); ++ assert_eq!( ++ *expected, ++ { ++ let mut value = value; ++ Flags::set(&mut value, *input, true); ++ value ++ } ++ .bits(), ++ "Flags::set({:?}, {:?}, true)", ++ value, ++ input ++ ); ++ } ++} +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/intersection.rs mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/intersection.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/intersection.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/intersection.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,79 @@ ++use super::*; ++ ++use crate::Flags; ++ ++#[test] ++fn cases() { ++ case( ++ TestFlags::empty(), ++ &[(TestFlags::empty(), 0), (TestFlags::all(), 0)], ++ TestFlags::intersection, ++ ); ++ ++ case( ++ TestFlags::all(), ++ &[ ++ (TestFlags::all(), 1 | 1 << 1 | 1 << 2), ++ (TestFlags::A, 1), ++ (TestFlags::from_bits_retain(1 << 3), 0), ++ ], ++ TestFlags::intersection, ++ ); ++ ++ case( ++ TestFlags::from_bits_retain(1 << 3), ++ &[(TestFlags::from_bits_retain(1 << 3), 1 << 3)], ++ TestFlags::intersection, ++ ); ++ ++ case( ++ TestOverlapping::AB, ++ &[(TestOverlapping::BC, 1 << 1)], ++ TestOverlapping::intersection, ++ ); ++} ++ ++#[track_caller] ++fn case + std::ops::BitAndAssign + Copy>( ++ value: T, ++ inputs: &[(T, T::Bits)], ++ mut inherent: impl FnMut(T, T) -> T, ++) where ++ T::Bits: std::fmt::Debug + PartialEq + Copy, ++{ ++ for (input, expected) in inputs { ++ assert_eq!( ++ *expected, ++ inherent(value, *input).bits(), ++ "{:?}.intersection({:?})", ++ value, ++ input ++ ); ++ assert_eq!( ++ *expected, ++ Flags::intersection(value, *input).bits(), ++ "Flags::intersection({:?}, {:?})", ++ value, ++ input ++ ); ++ assert_eq!( ++ *expected, ++ (value & *input).bits(), ++ "{:?} & {:?}", ++ value, ++ input ++ ); ++ assert_eq!( ++ *expected, ++ { ++ let mut value = value; ++ value &= *input; ++ value ++ } ++ .bits(), ++ "{:?} &= {:?}", ++ value, ++ input, ++ ); ++ } ++} +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/intersects.rs mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/intersects.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/intersects.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/intersects.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,91 @@ ++use super::*; ++ ++use crate::Flags; ++ ++#[test] ++fn cases() { ++ case( ++ TestFlags::empty(), ++ &[ ++ (TestFlags::empty(), false), ++ (TestFlags::A, false), ++ (TestFlags::B, false), ++ (TestFlags::C, false), ++ (TestFlags::from_bits_retain(1 << 3), false), ++ ], ++ TestFlags::intersects, ++ ); ++ ++ case( ++ TestFlags::A, ++ &[ ++ (TestFlags::empty(), false), ++ (TestFlags::A, true), ++ (TestFlags::B, false), ++ (TestFlags::C, false), ++ (TestFlags::ABC, true), ++ (TestFlags::from_bits_retain(1 << 3), false), ++ (TestFlags::from_bits_retain(1 | (1 << 3)), true), ++ ], ++ TestFlags::intersects, ++ ); ++ ++ case( ++ TestFlags::ABC, ++ &[ ++ (TestFlags::empty(), false), ++ (TestFlags::A, true), ++ (TestFlags::B, true), ++ (TestFlags::C, true), ++ (TestFlags::ABC, true), ++ (TestFlags::from_bits_retain(1 << 3), false), ++ ], ++ TestFlags::intersects, ++ ); ++ ++ case( ++ TestFlags::from_bits_retain(1 << 3), ++ &[ ++ (TestFlags::empty(), false), ++ (TestFlags::A, false), ++ (TestFlags::B, false), ++ (TestFlags::C, false), ++ (TestFlags::from_bits_retain(1 << 3), true), ++ ], ++ TestFlags::intersects, ++ ); ++ ++ case( ++ TestOverlapping::AB, ++ &[ ++ (TestOverlapping::AB, true), ++ (TestOverlapping::BC, true), ++ (TestOverlapping::from_bits_retain(1 << 1), true), ++ ], ++ TestOverlapping::intersects, ++ ); ++} ++ ++#[track_caller] ++fn case( ++ value: T, ++ inputs: &[(T, bool)], ++ mut inherent: impl FnMut(&T, T) -> bool, ++) { ++ for (input, expected) in inputs { ++ assert_eq!( ++ *expected, ++ inherent(&value, *input), ++ "{:?}.intersects({:?})", ++ value, ++ input ++ ); ++ assert_eq!( ++ *expected, ++ Flags::intersects(&value, *input), ++ "Flags::intersects({:?}, {:?})", ++ value, ++ input ++ ); ++ } ++} +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/is_all.rs mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/is_all.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/is_all.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/is_all.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,32 @@ ++use super::*; ++ ++use crate::Flags; ++ ++#[test] ++fn cases() { ++ case(false, TestFlags::empty(), TestFlags::is_all); ++ case(false, TestFlags::A, TestFlags::is_all); ++ ++ case(true, TestFlags::ABC, TestFlags::is_all); ++ ++ case( ++ true, ++ TestFlags::ABC | TestFlags::from_bits_retain(1 << 3), ++ TestFlags::is_all, ++ ); ++ ++ case(true, TestZero::empty(), TestZero::is_all); ++ ++ case(true, TestEmpty::empty(), TestEmpty::is_all); ++} ++ ++#[track_caller] ++fn case(expected: bool, value: T, inherent: impl FnOnce(&T) -> bool) { ++ assert_eq!(expected, inherent(&value), "{:?}.is_all()", value); ++ assert_eq!( ++ expected, ++ Flags::is_all(&value), ++ "Flags::is_all({:?})", ++ value ++ ); ++} +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/is_empty.rs mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/is_empty.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/is_empty.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/is_empty.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,31 @@ ++use super::*; ++ ++use crate::Flags; ++ ++#[test] ++fn cases() { ++ case(true, TestFlags::empty(), TestFlags::is_empty); ++ ++ case(false, TestFlags::A, TestFlags::is_empty); ++ case(false, TestFlags::ABC, TestFlags::is_empty); ++ case( ++ false, ++ TestFlags::from_bits_retain(1 << 3), ++ TestFlags::is_empty, ++ ); ++ ++ case(true, TestZero::empty(), TestZero::is_empty); ++ ++ case(true, TestEmpty::empty(), TestEmpty::is_empty); ++} ++ ++#[track_caller] ++fn case(expected: bool, value: T, inherent: impl FnOnce(&T) -> bool) { ++ assert_eq!(expected, inherent(&value), "{:?}.is_empty()", value); ++ assert_eq!( ++ expected, ++ Flags::is_empty(&value), ++ "Flags::is_empty({:?})", ++ value ++ ); ++} +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/iter.rs mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/iter.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/iter.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/iter.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,209 @@ ++use super::*; ++ ++use crate::Flags; ++ ++#[test] ++#[cfg(not(miri))] // Very slow in miri ++fn roundtrip() { ++ for a in 0u8..=255 { ++ for b in 0u8..=255 { ++ let f = TestFlags::from_bits_retain(a | b); ++ ++ assert_eq!(f, f.iter().collect::()); ++ assert_eq!( ++ TestFlags::from_bits_truncate(f.bits()), ++ f.iter_names().map(|(_, f)| f).collect::() ++ ); ++ ++ let f = TestExternal::from_bits_retain(a | b); ++ ++ assert_eq!(f, f.iter().collect::()); ++ } ++ } ++} ++ ++mod collect { ++ use super::*; ++ ++ #[test] ++ fn cases() { ++ assert_eq!(0, [].into_iter().collect::().bits()); ++ ++ assert_eq!(1, [TestFlags::A,].into_iter().collect::().bits()); ++ ++ assert_eq!( ++ 1 | 1 << 1 | 1 << 2, ++ [TestFlags::A, TestFlags::B | TestFlags::C,] ++ .into_iter() ++ .collect::() ++ .bits() ++ ); ++ ++ assert_eq!( ++ 1 | 1 << 3, ++ [ ++ TestFlags::from_bits_retain(1 << 3), ++ TestFlags::empty(), ++ TestFlags::A, ++ ] ++ .into_iter() ++ .collect::() ++ .bits() ++ ); ++ ++ assert_eq!( ++ 1 << 5 | 1 << 7, ++ [ ++ TestExternal::empty(), ++ TestExternal::from_bits_retain(1 << 5), ++ TestExternal::from_bits_retain(1 << 7), ++ ] ++ .into_iter() ++ .collect::() ++ .bits() ++ ); ++ } ++} ++ ++mod iter { ++ use super::*; ++ ++ #[test] ++ fn cases() { ++ case(&[], TestFlags::empty(), TestFlags::iter); ++ ++ case(&[1], TestFlags::A, TestFlags::iter); ++ case(&[1, 1 << 1], TestFlags::A | TestFlags::B, TestFlags::iter); ++ case( ++ &[1, 1 << 1, 1 << 3], ++ TestFlags::A | TestFlags::B | TestFlags::from_bits_retain(1 << 3), ++ TestFlags::iter, ++ ); ++ ++ case(&[1, 1 << 1, 1 << 2], TestFlags::ABC, TestFlags::iter); ++ case( ++ &[1, 1 << 1, 1 << 2, 1 << 3], ++ TestFlags::ABC | TestFlags::from_bits_retain(1 << 3), ++ TestFlags::iter, ++ ); ++ ++ case( ++ &[1 | 1 << 1 | 1 << 2], ++ TestFlagsInvert::ABC, ++ TestFlagsInvert::iter, ++ ); ++ ++ case(&[], TestZero::ZERO, TestZero::iter); ++ ++ case( ++ &[1, 1 << 1, 1 << 2, 0b1111_1000], ++ TestExternal::all(), ++ TestExternal::iter, ++ ); ++ } ++ ++ #[track_caller] ++ fn case + Copy>( ++ expected: &[T::Bits], ++ value: T, ++ inherent: impl FnOnce(&T) -> crate::iter::Iter, ++ ) where ++ T::Bits: std::fmt::Debug + PartialEq, ++ { ++ assert_eq!( ++ expected, ++ inherent(&value).map(|f| f.bits()).collect::>(), ++ "{:?}.iter()", ++ value ++ ); ++ assert_eq!( ++ expected, ++ Flags::iter(&value).map(|f| f.bits()).collect::>(), ++ "Flags::iter({:?})", ++ value ++ ); ++ assert_eq!( ++ expected, ++ value.into_iter().map(|f| f.bits()).collect::>(), ++ "{:?}.into_iter()", ++ value ++ ); ++ } ++} ++ ++mod iter_names { ++ use super::*; ++ ++ #[test] ++ fn cases() { ++ case(&[], TestFlags::empty(), TestFlags::iter_names); ++ ++ case(&[("A", 1)], TestFlags::A, TestFlags::iter_names); ++ case( ++ &[("A", 1), ("B", 1 << 1)], ++ TestFlags::A | TestFlags::B, ++ TestFlags::iter_names, ++ ); ++ case( ++ &[("A", 1), ("B", 1 << 1)], ++ TestFlags::A | TestFlags::B | TestFlags::from_bits_retain(1 << 3), ++ TestFlags::iter_names, ++ ); ++ ++ case( ++ &[("A", 1), ("B", 1 << 1), ("C", 1 << 2)], ++ TestFlags::ABC, ++ TestFlags::iter_names, ++ ); ++ case( ++ &[("A", 1), ("B", 1 << 1), ("C", 1 << 2)], ++ TestFlags::ABC | TestFlags::from_bits_retain(1 << 3), ++ TestFlags::iter_names, ++ ); ++ ++ case( ++ &[("ABC", 1 | 1 << 1 | 1 << 2)], ++ TestFlagsInvert::ABC, ++ TestFlagsInvert::iter_names, ++ ); ++ ++ case(&[], TestZero::ZERO, TestZero::iter_names); ++ ++ case( ++ &[("A", 1)], ++ TestOverlappingFull::A, ++ TestOverlappingFull::iter_names, ++ ); ++ case( ++ &[("A", 1), ("D", 1 << 1)], ++ TestOverlappingFull::A | TestOverlappingFull::D, ++ TestOverlappingFull::iter_names, ++ ); ++ } ++ ++ #[track_caller] ++ fn case( ++ expected: &[(&'static str, T::Bits)], ++ value: T, ++ inherent: impl FnOnce(&T) -> crate::iter::IterNames, ++ ) where ++ T::Bits: std::fmt::Debug + PartialEq, ++ { ++ assert_eq!( ++ expected, ++ inherent(&value) ++ .map(|(n, f)| (n, f.bits())) ++ .collect::>(), ++ "{:?}.iter_names()", ++ value ++ ); ++ assert_eq!( ++ expected, ++ Flags::iter_names(&value) ++ .map(|(n, f)| (n, f.bits())) ++ .collect::>(), ++ "Flags::iter_names({:?})", ++ value ++ ); ++ } ++} +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/parser.rs mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/parser.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/parser.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/parser.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,332 @@ ++use super::*; ++ ++use crate::{parser::*, Flags}; ++ ++#[test] ++#[cfg(not(miri))] // Very slow in miri ++fn roundtrip() { ++ let mut s = String::new(); ++ ++ for a in 0u8..=255 { ++ for b in 0u8..=255 { ++ let f = TestFlags::from_bits_retain(a | b); ++ ++ s.clear(); ++ to_writer(&f, &mut s).unwrap(); ++ ++ assert_eq!(f, from_str::(&s).unwrap()); ++ } ++ } ++} ++ ++#[test] ++#[cfg(not(miri))] // Very slow in miri ++fn roundtrip_truncate() { ++ let mut s = String::new(); ++ ++ for a in 0u8..=255 { ++ for b in 0u8..=255 { ++ let f = TestFlags::from_bits_retain(a | b); ++ ++ s.clear(); ++ to_writer_truncate(&f, &mut s).unwrap(); ++ ++ assert_eq!( ++ TestFlags::from_bits_truncate(f.bits()), ++ from_str_truncate::(&s).unwrap() ++ ); ++ } ++ } ++} ++ ++#[test] ++#[cfg(not(miri))] // Very slow in miri ++fn roundtrip_strict() { ++ let mut s = String::new(); ++ ++ for a in 0u8..=255 { ++ for b in 0u8..=255 { ++ let f = TestFlags::from_bits_retain(a | b); ++ ++ s.clear(); ++ to_writer_strict(&f, &mut s).unwrap(); ++ ++ let mut strict = TestFlags::empty(); ++ for (_, flag) in f.iter_names() { ++ strict |= flag; ++ } ++ let f = strict; ++ ++ if let Ok(s) = from_str_strict::(&s) { ++ assert_eq!(f, s); ++ } ++ } ++ } ++} ++ ++mod from_str { ++ use super::*; ++ ++ #[test] ++ fn valid() { ++ assert_eq!(0, from_str::("").unwrap().bits()); ++ ++ assert_eq!(1, from_str::("A").unwrap().bits()); ++ assert_eq!(1, from_str::(" A ").unwrap().bits()); ++ assert_eq!( ++ 1 | 1 << 1 | 1 << 2, ++ from_str::("A | B | C").unwrap().bits() ++ ); ++ assert_eq!( ++ 1 | 1 << 1 | 1 << 2, ++ from_str::("A\n|\tB\r\n| C ").unwrap().bits() ++ ); ++ assert_eq!( ++ 1 | 1 << 1 | 1 << 2, ++ from_str::("A|B|C").unwrap().bits() ++ ); ++ ++ assert_eq!(1 << 3, from_str::("0x8").unwrap().bits()); ++ assert_eq!(1 | 1 << 3, from_str::("A | 0x8").unwrap().bits()); ++ assert_eq!( ++ 1 | 1 << 1 | 1 << 3, ++ from_str::("0x1 | 0x8 | B").unwrap().bits() ++ ); ++ ++ assert_eq!( ++ 1 | 1 << 1, ++ from_str::("一 | 二").unwrap().bits() ++ ); ++ } ++ ++ #[test] ++ fn invalid() { ++ assert!(from_str::("a") ++ .unwrap_err() ++ .to_string() ++ .starts_with("unrecognized named flag")); ++ assert!(from_str::("A & B") ++ .unwrap_err() ++ .to_string() ++ .starts_with("unrecognized named flag")); ++ ++ assert!(from_str::("0xg") ++ .unwrap_err() ++ .to_string() ++ .starts_with("invalid hex flag")); ++ assert!(from_str::("0xffffffffffff") ++ .unwrap_err() ++ .to_string() ++ .starts_with("invalid hex flag")); ++ } ++} ++ ++mod to_writer { ++ use super::*; ++ ++ #[test] ++ fn cases() { ++ assert_eq!("", write(TestFlags::empty())); ++ assert_eq!("A", write(TestFlags::A)); ++ assert_eq!("A | B | C", write(TestFlags::all())); ++ assert_eq!("0x8", write(TestFlags::from_bits_retain(1 << 3))); ++ assert_eq!( ++ "A | 0x8", ++ write(TestFlags::A | TestFlags::from_bits_retain(1 << 3)) ++ ); ++ ++ assert_eq!("", write(TestZero::ZERO)); ++ ++ assert_eq!("ABC", write(TestFlagsInvert::all())); ++ ++ assert_eq!("0x1", write(TestOverlapping::from_bits_retain(1))); ++ ++ assert_eq!("A", write(TestOverlappingFull::C)); ++ assert_eq!( ++ "A | D", ++ write(TestOverlappingFull::C | TestOverlappingFull::D) ++ ); ++ } ++ ++ fn write(value: F) -> String ++ where ++ F::Bits: crate::parser::WriteHex, ++ { ++ let mut s = String::new(); ++ ++ to_writer(&value, &mut s).unwrap(); ++ s ++ } ++} ++ ++mod from_str_truncate { ++ use super::*; ++ ++ #[test] ++ fn valid() { ++ assert_eq!(0, from_str_truncate::("").unwrap().bits()); ++ ++ assert_eq!(1, from_str_truncate::("A").unwrap().bits()); ++ assert_eq!(1, from_str_truncate::(" A ").unwrap().bits()); ++ assert_eq!( ++ 1 | 1 << 1 | 1 << 2, ++ from_str_truncate::("A | B | C").unwrap().bits() ++ ); ++ assert_eq!( ++ 1 | 1 << 1 | 1 << 2, ++ from_str_truncate::("A\n|\tB\r\n| C ") ++ .unwrap() ++ .bits() ++ ); ++ assert_eq!( ++ 1 | 1 << 1 | 1 << 2, ++ from_str_truncate::("A|B|C").unwrap().bits() ++ ); ++ ++ assert_eq!(0, from_str_truncate::("0x8").unwrap().bits()); ++ assert_eq!(1, from_str_truncate::("A | 0x8").unwrap().bits()); ++ assert_eq!( ++ 1 | 1 << 1, ++ from_str_truncate::("0x1 | 0x8 | B") ++ .unwrap() ++ .bits() ++ ); ++ ++ assert_eq!( ++ 1 | 1 << 1, ++ from_str_truncate::("一 | 二").unwrap().bits() ++ ); ++ } ++} ++ ++mod to_writer_truncate { ++ use super::*; ++ ++ #[test] ++ fn cases() { ++ assert_eq!("", write(TestFlags::empty())); ++ assert_eq!("A", write(TestFlags::A)); ++ assert_eq!("A | B | C", write(TestFlags::all())); ++ assert_eq!("", write(TestFlags::from_bits_retain(1 << 3))); ++ assert_eq!( ++ "A", ++ write(TestFlags::A | TestFlags::from_bits_retain(1 << 3)) ++ ); ++ ++ assert_eq!("", write(TestZero::ZERO)); ++ ++ assert_eq!("ABC", write(TestFlagsInvert::all())); ++ ++ assert_eq!("0x1", write(TestOverlapping::from_bits_retain(1))); ++ ++ assert_eq!("A", write(TestOverlappingFull::C)); ++ assert_eq!( ++ "A | D", ++ write(TestOverlappingFull::C | TestOverlappingFull::D) ++ ); ++ } ++ ++ fn write(value: F) -> String ++ where ++ F::Bits: crate::parser::WriteHex, ++ { ++ let mut s = String::new(); ++ ++ to_writer_truncate(&value, &mut s).unwrap(); ++ s ++ } ++} ++ ++mod from_str_strict { ++ use super::*; ++ ++ #[test] ++ fn valid() { ++ assert_eq!(0, from_str_strict::("").unwrap().bits()); ++ ++ assert_eq!(1, from_str_strict::("A").unwrap().bits()); ++ assert_eq!(1, from_str_strict::(" A ").unwrap().bits()); ++ assert_eq!( ++ 1 | 1 << 1 | 1 << 2, ++ from_str_strict::("A | B | C").unwrap().bits() ++ ); ++ assert_eq!( ++ 1 | 1 << 1 | 1 << 2, ++ from_str_strict::("A\n|\tB\r\n| C ") ++ .unwrap() ++ .bits() ++ ); ++ assert_eq!( ++ 1 | 1 << 1 | 1 << 2, ++ from_str_strict::("A|B|C").unwrap().bits() ++ ); ++ ++ assert_eq!( ++ 1 | 1 << 1, ++ from_str_strict::("一 | 二").unwrap().bits() ++ ); ++ } ++ ++ #[test] ++ fn invalid() { ++ assert!(from_str_strict::("a") ++ .unwrap_err() ++ .to_string() ++ .starts_with("unrecognized named flag")); ++ assert!(from_str_strict::("A & B") ++ .unwrap_err() ++ .to_string() ++ .starts_with("unrecognized named flag")); ++ ++ assert!(from_str_strict::("0x1") ++ .unwrap_err() ++ .to_string() ++ .starts_with("invalid hex flag")); ++ assert!(from_str_strict::("0xg") ++ .unwrap_err() ++ .to_string() ++ .starts_with("invalid hex flag")); ++ assert!(from_str_strict::("0xffffffffffff") ++ .unwrap_err() ++ .to_string() ++ .starts_with("invalid hex flag")); ++ } ++} ++ ++mod to_writer_strict { ++ use super::*; ++ ++ #[test] ++ fn cases() { ++ assert_eq!("", write(TestFlags::empty())); ++ assert_eq!("A", write(TestFlags::A)); ++ assert_eq!("A | B | C", write(TestFlags::all())); ++ assert_eq!("", write(TestFlags::from_bits_retain(1 << 3))); ++ assert_eq!( ++ "A", ++ write(TestFlags::A | TestFlags::from_bits_retain(1 << 3)) ++ ); ++ ++ assert_eq!("", write(TestZero::ZERO)); ++ ++ assert_eq!("ABC", write(TestFlagsInvert::all())); ++ ++ assert_eq!("", write(TestOverlapping::from_bits_retain(1))); ++ ++ assert_eq!("A", write(TestOverlappingFull::C)); ++ assert_eq!( ++ "A | D", ++ write(TestOverlappingFull::C | TestOverlappingFull::D) ++ ); ++ } ++ ++ fn write(value: F) -> String ++ where ++ F::Bits: crate::parser::WriteHex, ++ { ++ let mut s = String::new(); ++ ++ to_writer_strict(&value, &mut s).unwrap(); ++ s ++ } ++} +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/remove.rs mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/remove.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/remove.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/remove.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,100 @@ ++use super::*; ++ ++use crate::Flags; ++ ++#[test] ++fn cases() { ++ case( ++ TestFlags::empty(), ++ &[ ++ (TestFlags::A, 0), ++ (TestFlags::empty(), 0), ++ (TestFlags::from_bits_retain(1 << 3), 0), ++ ], ++ TestFlags::remove, ++ TestFlags::set, ++ ); ++ ++ case( ++ TestFlags::A, ++ &[ ++ (TestFlags::A, 0), ++ (TestFlags::empty(), 1), ++ (TestFlags::B, 1), ++ ], ++ TestFlags::remove, ++ TestFlags::set, ++ ); ++ ++ case( ++ TestFlags::ABC, ++ &[ ++ (TestFlags::A, 1 << 1 | 1 << 2), ++ (TestFlags::A | TestFlags::C, 1 << 1), ++ ], ++ TestFlags::remove, ++ TestFlags::set, ++ ); ++} ++ ++#[track_caller] ++fn case( ++ value: T, ++ inputs: &[(T, T::Bits)], ++ mut inherent_remove: impl FnMut(&mut T, T), ++ mut inherent_set: impl FnMut(&mut T, T, bool), ++) where ++ T::Bits: std::fmt::Debug + PartialEq + Copy, ++{ ++ for (input, expected) in inputs { ++ assert_eq!( ++ *expected, ++ { ++ let mut value = value; ++ inherent_remove(&mut value, *input); ++ value ++ } ++ .bits(), ++ "{:?}.remove({:?})", ++ value, ++ input ++ ); ++ assert_eq!( ++ *expected, ++ { ++ let mut value = value; ++ Flags::remove(&mut value, *input); ++ value ++ } ++ .bits(), ++ "Flags::remove({:?}, {:?})", ++ value, ++ input ++ ); ++ ++ assert_eq!( ++ *expected, ++ { ++ let mut value = value; ++ inherent_set(&mut value, *input, false); ++ value ++ } ++ .bits(), ++ "{:?}.set({:?}, false)", ++ value, ++ input ++ ); ++ assert_eq!( ++ *expected, ++ { ++ let mut value = value; ++ Flags::set(&mut value, *input, false); ++ value ++ } ++ .bits(), ++ "Flags::set({:?}, {:?}, false)", ++ value, ++ input ++ ); ++ } ++} +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/symmetric_difference.rs mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/symmetric_difference.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/symmetric_difference.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/symmetric_difference.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,110 @@ ++use super::*; ++ ++use crate::Flags; ++ ++#[test] ++fn cases() { ++ case( ++ TestFlags::empty(), ++ &[ ++ (TestFlags::empty(), 0), ++ (TestFlags::all(), 1 | 1 << 1 | 1 << 2), ++ (TestFlags::from_bits_retain(1 << 3), 1 << 3), ++ ], ++ TestFlags::symmetric_difference, ++ TestFlags::toggle, ++ ); ++ ++ case( ++ TestFlags::A, ++ &[ ++ (TestFlags::empty(), 1), ++ (TestFlags::A, 0), ++ (TestFlags::all(), 1 << 1 | 1 << 2), ++ ], ++ TestFlags::symmetric_difference, ++ TestFlags::toggle, ++ ); ++ ++ case( ++ TestFlags::A | TestFlags::B | TestFlags::from_bits_retain(1 << 3), ++ &[ ++ (TestFlags::ABC, 1 << 2 | 1 << 3), ++ (TestFlags::from_bits_retain(1 << 3), 1 | 1 << 1), ++ ], ++ TestFlags::symmetric_difference, ++ TestFlags::toggle, ++ ); ++} ++ ++#[track_caller] ++fn case + std::ops::BitXorAssign + Copy>( ++ value: T, ++ inputs: &[(T, T::Bits)], ++ mut inherent_sym_diff: impl FnMut(T, T) -> T, ++ mut inherent_toggle: impl FnMut(&mut T, T), ++) where ++ T::Bits: std::fmt::Debug + PartialEq + Copy, ++{ ++ for (input, expected) in inputs { ++ assert_eq!( ++ *expected, ++ inherent_sym_diff(value, *input).bits(), ++ "{:?}.symmetric_difference({:?})", ++ value, ++ input ++ ); ++ assert_eq!( ++ *expected, ++ Flags::symmetric_difference(value, *input).bits(), ++ "Flags::symmetric_difference({:?}, {:?})", ++ value, ++ input ++ ); ++ assert_eq!( ++ *expected, ++ (value ^ *input).bits(), ++ "{:?} ^ {:?}", ++ value, ++ input ++ ); ++ assert_eq!( ++ *expected, ++ { ++ let mut value = value; ++ value ^= *input; ++ value ++ } ++ .bits(), ++ "{:?} ^= {:?}", ++ value, ++ input, ++ ); ++ ++ assert_eq!( ++ *expected, ++ { ++ let mut value = value; ++ inherent_toggle(&mut value, *input); ++ value ++ } ++ .bits(), ++ "{:?}.toggle({:?})", ++ value, ++ input, ++ ); ++ ++ assert_eq!( ++ *expected, ++ { ++ let mut value = value; ++ Flags::toggle(&mut value, *input); ++ value ++ } ++ .bits(), ++ "{:?}.toggle({:?})", ++ value, ++ input, ++ ); ++ } ++} +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/truncate.rs mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/truncate.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/truncate.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/truncate.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,29 @@ ++use super::*; ++ ++use crate::Flags; ++ ++#[test] ++fn cases() { ++ case( ++ TestFlags::ABC | TestFlags::from_bits_retain(1 << 3), ++ TestFlags::ABC, ++ ); ++ ++ case(TestZero::empty(), TestZero::empty()); ++ ++ case(TestZero::all(), TestZero::all()); ++ ++ case( ++ TestFlags::from_bits_retain(1 << 3) | TestFlags::all(), ++ TestFlags::all(), ++ ); ++} ++ ++#[track_caller] ++fn case(mut before: T, after: T) ++where ++ T: std::fmt::Debug + PartialEq + Copy, ++{ ++ before.truncate(); ++ assert_eq!(before, after, "{:?}.truncate()", before); ++} +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/union.rs mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/union.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/union.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/union.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,71 @@ ++use super::*; ++ ++use crate::Flags; ++ ++#[test] ++fn cases() { ++ case( ++ TestFlags::empty(), ++ &[ ++ (TestFlags::A, 1), ++ (TestFlags::all(), 1 | 1 << 1 | 1 << 2), ++ (TestFlags::empty(), 0), ++ (TestFlags::from_bits_retain(1 << 3), 1 << 3), ++ ], ++ TestFlags::union, ++ ); ++ ++ case( ++ TestFlags::A | TestFlags::C, ++ &[ ++ (TestFlags::A | TestFlags::B, 1 | 1 << 1 | 1 << 2), ++ (TestFlags::A, 1 | 1 << 2), ++ ], ++ TestFlags::union, ++ ); ++} ++ ++#[track_caller] ++fn case + std::ops::BitOrAssign + Copy>( ++ value: T, ++ inputs: &[(T, T::Bits)], ++ mut inherent: impl FnMut(T, T) -> T, ++) where ++ T::Bits: std::fmt::Debug + PartialEq + Copy, ++{ ++ for (input, expected) in inputs { ++ assert_eq!( ++ *expected, ++ inherent(value, *input).bits(), ++ "{:?}.union({:?})", ++ value, ++ input ++ ); ++ assert_eq!( ++ *expected, ++ Flags::union(value, *input).bits(), ++ "Flags::union({:?}, {:?})", ++ value, ++ input ++ ); ++ assert_eq!( ++ *expected, ++ (value | *input).bits(), ++ "{:?} | {:?}", ++ value, ++ input ++ ); ++ assert_eq!( ++ *expected, ++ { ++ let mut value = value; ++ value |= *input; ++ value ++ } ++ .bits(), ++ "{:?} |= {:?}", ++ value, ++ input, ++ ); ++ } ++} +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/unknown.rs mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/unknown.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/unknown.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests/unknown.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,40 @@ ++use super::*; ++ ++use crate::Flags; ++ ++#[test] ++fn cases() { ++ case(false, TestFlags::empty(), TestFlags::contains_unknown_bits); ++ case(false, TestFlags::A, TestFlags::contains_unknown_bits); ++ ++ case( ++ true, ++ TestFlags::ABC | TestFlags::from_bits_retain(1 << 3), ++ TestFlags::contains_unknown_bits, ++ ); ++ ++ case( ++ true, ++ TestFlags::empty() | TestFlags::from_bits_retain(1 << 3), ++ TestFlags::contains_unknown_bits, ++ ); ++ ++ case(false, TestFlags::all(), TestFlags::contains_unknown_bits); ++ ++ case(false, TestZero::empty(), TestZero::contains_unknown_bits); ++} ++#[track_caller] ++fn case(expected: bool, value: T, inherent: impl FnOnce(&T) -> bool) { ++ assert_eq!( ++ expected, ++ inherent(&value), ++ "{:?}.contains_unknown_bits()", ++ value ++ ); ++ assert_eq!( ++ expected, ++ Flags::contains_unknown_bits(&value), ++ "Flags::contains_unknown_bits({:?})", ++ value ++ ); ++} +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests.rs mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/src/tests.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,134 @@ ++mod all; ++mod bitflags_match; ++mod bits; ++mod complement; ++mod contains; ++mod difference; ++mod empty; ++mod eq; ++mod extend; ++mod flags; ++mod fmt; ++mod from_bits; ++mod from_bits_retain; ++mod from_bits_truncate; ++mod from_name; ++mod insert; ++mod intersection; ++mod intersects; ++mod is_all; ++mod is_empty; ++mod iter; ++mod parser; ++mod remove; ++mod symmetric_difference; ++mod truncate; ++mod union; ++mod unknown; ++ ++bitflags! { ++ #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy)] ++ pub struct TestFlags: u8 { ++ /// 1 ++ const A = 1; ++ ++ /// 1 << 1 ++ const B = 1 << 1; ++ ++ /// 1 << 2 ++ const C = 1 << 2; ++ ++ /// 1 | (1 << 1) | (1 << 2) ++ const ABC = Self::A.bits() | Self::B.bits() | Self::C.bits(); ++ } ++ ++ #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy)] ++ pub struct TestFlagsInvert: u8 { ++ /// 1 | (1 << 1) | (1 << 2) ++ const ABC = Self::A.bits() | Self::B.bits() | Self::C.bits(); ++ ++ /// 1 ++ const A = 1; ++ ++ /// 1 << 1 ++ const B = 1 << 1; ++ ++ /// 1 << 2 ++ const C = 1 << 2; ++ } ++ ++ #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy)] ++ pub struct TestZero: u8 { ++ /// 0 ++ const ZERO = 0; ++ } ++ ++ #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy)] ++ pub struct TestZeroOne: u8 { ++ /// 0 ++ const ZERO = 0; ++ ++ /// 1 ++ const ONE = 1; ++ } ++ ++ #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy)] ++ pub struct TestUnicode: u8 { ++ /// 1 ++ const 一 = 1; ++ ++ /// 2 ++ const 二 = 1 << 1; ++ } ++ ++ #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy)] ++ pub struct TestEmpty: u8 {} ++ ++ #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy)] ++ pub struct TestOverlapping: u8 { ++ /// 1 | (1 << 1) ++ const AB = 1 | (1 << 1); ++ ++ /// (1 << 1) | (1 << 2) ++ const BC = (1 << 1) | (1 << 2); ++ } ++ ++ #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy)] ++ pub struct TestOverlappingFull: u8 { ++ /// 1 ++ const A = 1; ++ ++ /// 1 ++ const B = 1; ++ ++ /// 1 ++ const C = 1; ++ ++ /// 2 ++ const D = 1 << 1; ++ } ++ ++ #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy)] ++ pub struct TestExternal: u8 { ++ /// 1 ++ const A = 1; ++ ++ /// 1 << 1 ++ const B = 1 << 1; ++ ++ /// 1 << 2 ++ const C = 1 << 2; ++ ++ /// 1 | (1 << 1) | (1 << 2) ++ const ABC = Self::A.bits() | Self::B.bits() | Self::C.bits(); ++ ++ /// External ++ const _ = !0; ++ } ++ ++ #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy)] ++ pub struct TestExternalFull: u8 { ++ /// External ++ const _ = !0; ++ } ++} +diff -Nru mesa-25.3.3/subprojects/bitflags-2.8.0/src/traits.rs mesa-25.3.3/subprojects/bitflags-2.8.0/src/traits.rs +--- mesa-25.3.3/subprojects/bitflags-2.8.0/src/traits.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2.8.0/src/traits.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,444 @@ ++use core::{ ++ fmt, ++ ops::{BitAnd, BitOr, BitXor, Not}, ++}; ++ ++use crate::{ ++ iter, ++ parser::{ParseError, ParseHex, WriteHex}, ++}; ++ ++/** ++A defined flags value that may be named or unnamed. ++*/ ++#[derive(Debug)] ++pub struct Flag { ++ name: &'static str, ++ value: B, ++} ++ ++impl Flag { ++ /** ++ Define a flag. ++ ++ If `name` is non-empty then the flag is named, otherwise it's unnamed. ++ */ ++ pub const fn new(name: &'static str, value: B) -> Self { ++ Flag { name, value } ++ } ++ ++ /** ++ Get the name of this flag. ++ ++ If the flag is unnamed then the returned string will be empty. ++ */ ++ pub const fn name(&self) -> &'static str { ++ self.name ++ } ++ ++ /** ++ Get the flags value of this flag. ++ */ ++ pub const fn value(&self) -> &B { ++ &self.value ++ } ++ ++ /** ++ Whether the flag is named. ++ ++ If [`Flag::name`] returns a non-empty string then this method will return `true`. ++ */ ++ pub const fn is_named(&self) -> bool { ++ !self.name.is_empty() ++ } ++ ++ /** ++ Whether the flag is unnamed. ++ ++ If [`Flag::name`] returns a non-empty string then this method will return `false`. ++ */ ++ pub const fn is_unnamed(&self) -> bool { ++ self.name.is_empty() ++ } ++} ++ ++/** ++A set of defined flags using a bits type as storage. ++ ++## Implementing `Flags` ++ ++This trait is implemented by the [`bitflags`](macro.bitflags.html) macro: ++ ++``` ++use bitflags::bitflags; ++ ++bitflags! { ++ struct MyFlags: u8 { ++ const A = 1; ++ const B = 1 << 1; ++ } ++} ++``` ++ ++It can also be implemented manually: ++ ++``` ++use bitflags::{Flag, Flags}; ++ ++struct MyFlags(u8); ++ ++impl Flags for MyFlags { ++ const FLAGS: &'static [Flag] = &[ ++ Flag::new("A", MyFlags(1)), ++ Flag::new("B", MyFlags(1 << 1)), ++ ]; ++ ++ type Bits = u8; ++ ++ fn from_bits_retain(bits: Self::Bits) -> Self { ++ MyFlags(bits) ++ } ++ ++ fn bits(&self) -> Self::Bits { ++ self.0 ++ } ++} ++``` ++ ++## Using `Flags` ++ ++The `Flags` trait can be used generically to work with any flags types. In this example, ++we can count the number of defined named flags: ++ ++``` ++# use bitflags::{bitflags, Flags}; ++fn defined_flags() -> usize { ++ F::FLAGS.iter().filter(|f| f.is_named()).count() ++} ++ ++bitflags! { ++ struct MyFlags: u8 { ++ const A = 1; ++ const B = 1 << 1; ++ const C = 1 << 2; ++ ++ const _ = !0; ++ } ++} ++ ++assert_eq!(3, defined_flags::()); ++``` ++*/ ++pub trait Flags: Sized + 'static { ++ /// The set of defined flags. ++ const FLAGS: &'static [Flag]; ++ ++ /// The underlying bits type. ++ type Bits: Bits; ++ ++ /// Get a flags value with all bits unset. ++ fn empty() -> Self { ++ Self::from_bits_retain(Self::Bits::EMPTY) ++ } ++ ++ /// Get a flags value with all known bits set. ++ fn all() -> Self { ++ let mut truncated = Self::Bits::EMPTY; ++ ++ for flag in Self::FLAGS.iter() { ++ truncated = truncated | flag.value().bits(); ++ } ++ ++ Self::from_bits_retain(truncated) ++ } ++ ++ /// This method will return `true` if any unknown bits are set. ++ fn contains_unknown_bits(&self) -> bool { ++ Self::all().bits() & self.bits() != self.bits() ++ } ++ ++ /// Get the underlying bits value. ++ /// ++ /// The returned value is exactly the bits set in this flags value. ++ fn bits(&self) -> Self::Bits; ++ ++ /// Convert from a bits value. ++ /// ++ /// This method will return `None` if any unknown bits are set. ++ fn from_bits(bits: Self::Bits) -> Option { ++ let truncated = Self::from_bits_truncate(bits); ++ ++ if truncated.bits() == bits { ++ Some(truncated) ++ } else { ++ None ++ } ++ } ++ ++ /// Convert from a bits value, unsetting any unknown bits. ++ fn from_bits_truncate(bits: Self::Bits) -> Self { ++ Self::from_bits_retain(bits & Self::all().bits()) ++ } ++ ++ /// Convert from a bits value exactly. ++ fn from_bits_retain(bits: Self::Bits) -> Self; ++ ++ /// Get a flags value with the bits of a flag with the given name set. ++ /// ++ /// This method will return `None` if `name` is empty or doesn't ++ /// correspond to any named flag. ++ fn from_name(name: &str) -> Option { ++ // Don't parse empty names as empty flags ++ if name.is_empty() { ++ return None; ++ } ++ ++ for flag in Self::FLAGS { ++ if flag.name() == name { ++ return Some(Self::from_bits_retain(flag.value().bits())); ++ } ++ } ++ ++ None ++ } ++ ++ /// Yield a set of contained flags values. ++ /// ++ /// Each yielded flags value will correspond to a defined named flag. Any unknown bits ++ /// will be yielded together as a final flags value. ++ fn iter(&self) -> iter::Iter { ++ iter::Iter::new(self) ++ } ++ ++ /// Yield a set of contained named flags values. ++ /// ++ /// This method is like [`Flags::iter`], except only yields bits in contained named flags. ++ /// Any unknown bits, or bits not corresponding to a contained flag will not be yielded. ++ fn iter_names(&self) -> iter::IterNames { ++ iter::IterNames::new(self) ++ } ++ ++ /// Whether all bits in this flags value are unset. ++ fn is_empty(&self) -> bool { ++ self.bits() == Self::Bits::EMPTY ++ } ++ ++ /// Whether all known bits in this flags value are set. ++ fn is_all(&self) -> bool { ++ // NOTE: We check against `Self::all` here, not `Self::Bits::ALL` ++ // because the set of all flags may not use all bits ++ Self::all().bits() | self.bits() == self.bits() ++ } ++ ++ /// Whether any set bits in a source flags value are also set in a target flags value. ++ fn intersects(&self, other: Self) -> bool ++ where ++ Self: Sized, ++ { ++ self.bits() & other.bits() != Self::Bits::EMPTY ++ } ++ ++ /// Whether all set bits in a source flags value are also set in a target flags value. ++ fn contains(&self, other: Self) -> bool ++ where ++ Self: Sized, ++ { ++ self.bits() & other.bits() == other.bits() ++ } ++ ++ /// Remove any unknown bits from the flags. ++ fn truncate(&mut self) ++ where ++ Self: Sized, ++ { ++ *self = Self::from_bits_truncate(self.bits()); ++ } ++ ++ /// The bitwise or (`|`) of the bits in two flags values. ++ fn insert(&mut self, other: Self) ++ where ++ Self: Sized, ++ { ++ *self = Self::from_bits_retain(self.bits()).union(other); ++ } ++ ++ /// The intersection of a source flags value with the complement of a target flags value (`&!`). ++ /// ++ /// This method is not equivalent to `self & !other` when `other` has unknown bits set. ++ /// `remove` won't truncate `other`, but the `!` operator will. ++ fn remove(&mut self, other: Self) ++ where ++ Self: Sized, ++ { ++ *self = Self::from_bits_retain(self.bits()).difference(other); ++ } ++ ++ /// The bitwise exclusive-or (`^`) of the bits in two flags values. ++ fn toggle(&mut self, other: Self) ++ where ++ Self: Sized, ++ { ++ *self = Self::from_bits_retain(self.bits()).symmetric_difference(other); ++ } ++ ++ /// Call [`Flags::insert`] when `value` is `true` or [`Flags::remove`] when `value` is `false`. ++ fn set(&mut self, other: Self, value: bool) ++ where ++ Self: Sized, ++ { ++ if value { ++ self.insert(other); ++ } else { ++ self.remove(other); ++ } ++ } ++ ++ /// The bitwise and (`&`) of the bits in two flags values. ++ #[must_use] ++ fn intersection(self, other: Self) -> Self { ++ Self::from_bits_retain(self.bits() & other.bits()) ++ } ++ ++ /// The bitwise or (`|`) of the bits in two flags values. ++ #[must_use] ++ fn union(self, other: Self) -> Self { ++ Self::from_bits_retain(self.bits() | other.bits()) ++ } ++ ++ /// The intersection of a source flags value with the complement of a target flags value (`&!`). ++ /// ++ /// This method is not equivalent to `self & !other` when `other` has unknown bits set. ++ /// `difference` won't truncate `other`, but the `!` operator will. ++ #[must_use] ++ fn difference(self, other: Self) -> Self { ++ Self::from_bits_retain(self.bits() & !other.bits()) ++ } ++ ++ /// The bitwise exclusive-or (`^`) of the bits in two flags values. ++ #[must_use] ++ fn symmetric_difference(self, other: Self) -> Self { ++ Self::from_bits_retain(self.bits() ^ other.bits()) ++ } ++ ++ /// The bitwise negation (`!`) of the bits in a flags value, truncating the result. ++ #[must_use] ++ fn complement(self) -> Self { ++ Self::from_bits_truncate(!self.bits()) ++ } ++} ++ ++/** ++A bits type that can be used as storage for a flags type. ++*/ ++pub trait Bits: ++ Clone ++ + Copy ++ + PartialEq ++ + BitAnd ++ + BitOr ++ + BitXor ++ + Not ++ + Sized ++ + 'static ++{ ++ /// A value with all bits unset. ++ const EMPTY: Self; ++ ++ /// A value with all bits set. ++ const ALL: Self; ++} ++ ++// Not re-exported: prevent custom `Bits` impls being used in the `bitflags!` macro, ++// or they may fail to compile based on crate features ++pub trait Primitive {} ++ ++macro_rules! impl_bits { ++ ($($u:ty, $i:ty,)*) => { ++ $( ++ impl Bits for $u { ++ const EMPTY: $u = 0; ++ const ALL: $u = <$u>::MAX; ++ } ++ ++ impl Bits for $i { ++ const EMPTY: $i = 0; ++ const ALL: $i = <$u>::MAX as $i; ++ } ++ ++ impl ParseHex for $u { ++ fn parse_hex(input: &str) -> Result { ++ <$u>::from_str_radix(input, 16).map_err(|_| ParseError::invalid_hex_flag(input)) ++ } ++ } ++ ++ impl ParseHex for $i { ++ fn parse_hex(input: &str) -> Result { ++ <$i>::from_str_radix(input, 16).map_err(|_| ParseError::invalid_hex_flag(input)) ++ } ++ } ++ ++ impl WriteHex for $u { ++ fn write_hex(&self, mut writer: W) -> fmt::Result { ++ write!(writer, "{:x}", self) ++ } ++ } ++ ++ impl WriteHex for $i { ++ fn write_hex(&self, mut writer: W) -> fmt::Result { ++ write!(writer, "{:x}", self) ++ } ++ } ++ ++ impl Primitive for $i {} ++ impl Primitive for $u {} ++ )* ++ } ++} ++ ++impl_bits! { ++ u8, i8, ++ u16, i16, ++ u32, i32, ++ u64, i64, ++ u128, i128, ++ usize, isize, ++} ++ ++/// A trait for referencing the `bitflags`-owned internal type ++/// without exposing it publicly. ++pub trait PublicFlags { ++ /// The type of the underlying storage. ++ type Primitive: Primitive; ++ ++ /// The type of the internal field on the generated flags type. ++ type Internal; ++} ++ ++#[doc(hidden)] ++#[deprecated(note = "use the `Flags` trait instead")] ++pub trait BitFlags: ImplementedByBitFlagsMacro + Flags { ++ /// An iterator over enabled flags in an instance of the type. ++ type Iter: Iterator; ++ ++ /// An iterator over the raw names and bits for enabled flags in an instance of the type. ++ type IterNames: Iterator; ++} ++ ++#[allow(deprecated)] ++impl BitFlags for B { ++ type Iter = iter::Iter; ++ type IterNames = iter::IterNames; ++} ++ ++impl ImplementedByBitFlagsMacro for B {} ++ ++/// A marker trait that signals that an implementation of `BitFlags` came from the `bitflags!` macro. ++/// ++/// There's nothing stopping an end-user from implementing this trait, but we don't guarantee their ++/// manual implementations won't break between non-breaking releases. ++#[doc(hidden)] ++pub trait ImplementedByBitFlagsMacro {} ++ ++pub(crate) mod __private { ++ pub use super::{ImplementedByBitFlagsMacro, PublicFlags}; ++} +diff -Nru mesa-25.3.3/subprojects/bitflags-2-rs.wrap mesa-25.3.3/subprojects/bitflags-2-rs.wrap +--- mesa-25.3.3/subprojects/bitflags-2-rs.wrap 2026-01-01 13:34:04.000000000 -0500 ++++ mesa-25.3.3/subprojects/bitflags-2-rs.wrap 2026-05-29 13:40:50.000000000 -0500 +@@ -1,6 +1,4 @@ + [wrap-file] +-directory = bitflags-2.9.1 +-source_url = https://crates.io/api/v1/crates/bitflags/2.9.1/download +-source_filename = bitflags-2.9.1.tar.gz +-source_hash = 1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967 ++directory = bitflags-2.8.0 + patch_directory = bitflags-2-rs ++ +diff -Nru mesa-25.3.3/subprojects/cfg-if-1.0.0/.cargo-checksum.json mesa-25.3.3/subprojects/cfg-if-1.0.0/.cargo-checksum.json +--- mesa-25.3.3/subprojects/cfg-if-1.0.0/.cargo-checksum.json 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/cfg-if-1.0.0/.cargo-checksum.json 2025-01-04 18:50:28.000000000 -0500 +@@ -0,0 +1 @@ ++{"package":"Could not get crate checksum","files":{}} +diff -Nru mesa-25.3.3/subprojects/cfg-if-1.0.0/Cargo.toml mesa-25.3.3/subprojects/cfg-if-1.0.0/Cargo.toml +--- mesa-25.3.3/subprojects/cfg-if-1.0.0/Cargo.toml 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/cfg-if-1.0.0/Cargo.toml 2025-01-04 18:50:28.000000000 -0500 +@@ -0,0 +1,36 @@ ++# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO ++# ++# When uploading crates to the registry Cargo will automatically ++# "normalize" Cargo.toml files for maximal compatibility ++# with all versions of Cargo and also rewrite `path` dependencies ++# to registry (e.g., crates.io) dependencies ++# ++# If you believe there's an error in this file please file an ++# issue against the rust-lang/cargo repository. If you're ++# editing this file be aware that the upstream Cargo.toml ++# will likely look very different (and much more reasonable) ++ ++[package] ++edition = "2018" ++name = "cfg-if" ++version = "1.0.0" ++authors = ["Alex Crichton "] ++description = "A macro to ergonomically define an item depending on a large number of #[cfg]\nparameters. Structured like an if-else chain, the first matching branch is the\nitem that gets emitted.\n" ++homepage = "https://github.com/alexcrichton/cfg-if" ++documentation = "https://docs.rs/cfg-if" ++readme = "README.md" ++license = "MIT/Apache-2.0" ++repository = "https://github.com/alexcrichton/cfg-if" ++#[dependencies.compiler_builtins] ++#version = "0.1.2" ++#optional = true ++ ++[dependencies.core] ++version = "1.0.0" ++optional = true ++package = "rustc-std-workspace-core" ++ ++[features] ++#rustc-dep-of-std = ["core", "compiler_builtins"] ++[badges.travis-ci] ++repository = "alexcrichton/cfg-if" +diff -Nru mesa-25.3.3/subprojects/cfg-if-1.0.0/.cargo_vcs_info.json mesa-25.3.3/subprojects/cfg-if-1.0.0/.cargo_vcs_info.json +--- mesa-25.3.3/subprojects/cfg-if-1.0.0/.cargo_vcs_info.json 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/cfg-if-1.0.0/.cargo_vcs_info.json 2025-01-04 18:50:28.000000000 -0500 +@@ -0,0 +1,5 @@ ++{ ++ "git": { ++ "sha1": "e60fa1efeab0ec6e90c50d93ec526e1410459c23" ++ } ++} +diff -Nru mesa-25.3.3/subprojects/cfg-if-1.0.0/debian/patches/drop-compiler-builtins.patch mesa-25.3.3/subprojects/cfg-if-1.0.0/debian/patches/drop-compiler-builtins.patch +--- mesa-25.3.3/subprojects/cfg-if-1.0.0/debian/patches/drop-compiler-builtins.patch 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/cfg-if-1.0.0/debian/patches/drop-compiler-builtins.patch 2020-11-23 16:36:00.000000000 -0500 +@@ -0,0 +1,23 @@ ++--- a/Cargo.toml +++++ b/Cargo.toml ++@@ -21,9 +21,9 @@ ++ readme = "README.md" ++ license = "MIT/Apache-2.0" ++ repository = "https://github.com/alexcrichton/cfg-if" ++-[dependencies.compiler_builtins] ++-version = "0.1.2" ++-optional = true +++#[dependencies.compiler_builtins] +++#version = "0.1.2" +++#optional = true ++ ++ [dependencies.core] ++ version = "1.0.0" ++@@ -31,6 +31,6 @@ ++ package = "rustc-std-workspace-core" ++ ++ [features] ++-rustc-dep-of-std = ["core", "compiler_builtins"] +++#rustc-dep-of-std = ["core", "compiler_builtins"] ++ [badges.travis-ci] ++ repository = "alexcrichton/cfg-if" +diff -Nru mesa-25.3.3/subprojects/cfg-if-1.0.0/debian/patches/series mesa-25.3.3/subprojects/cfg-if-1.0.0/debian/patches/series +--- mesa-25.3.3/subprojects/cfg-if-1.0.0/debian/patches/series 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/cfg-if-1.0.0/debian/patches/series 2020-11-23 16:36:00.000000000 -0500 +@@ -0,0 +1 @@ ++drop-compiler-builtins.patch +diff -Nru mesa-25.3.3/subprojects/cfg-if-1.0.0/.github/workflows/main.yml mesa-25.3.3/subprojects/cfg-if-1.0.0/.github/workflows/main.yml +--- mesa-25.3.3/subprojects/cfg-if-1.0.0/.github/workflows/main.yml 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/cfg-if-1.0.0/.github/workflows/main.yml 2020-10-06 13:43:06.000000000 -0500 +@@ -0,0 +1,56 @@ ++name: CI ++on: [push, pull_request] ++ ++jobs: ++ test: ++ name: Test ++ runs-on: ubuntu-latest ++ strategy: ++ matrix: ++ rust: [stable, beta, nightly] ++ steps: ++ - uses: actions/checkout@master ++ - name: Install Rust Stable ++ run: | ++ rustup self update ++ rustup update ${{ matrix.rust }} ++ rustup default ${{ matrix.rust }} ++ rustc -vV ++ - name: Run tests ++ run: cargo test ++ ++ rustfmt: ++ name: Rustfmt ++ runs-on: ubuntu-latest ++ steps: ++ - uses: actions/checkout@master ++ - name: Install Rust Stable ++ run: | ++ rustup update stable ++ rustup default stable ++ rustup component add rustfmt ++ - name: Run rustfmt ++ run: cargo fmt -- --check ++ ++ publish_docs: ++ name: Publish Documentation ++ runs-on: ubuntu-latest ++ steps: ++ - uses: actions/checkout@master ++ - name: Install Rust Stable ++ run: | ++ rustup update stable ++ rustup default stable ++ - name: Build documentation ++ run: cargo doc --no-deps ++ - name: Publish documentation ++ run: | ++ cd target/doc ++ git init ++ git remote add origin https://x-access-token:${{ secrets.github_token }}@github.com/${{ github.repository }} ++ git fetch origin ++ git reset --hard "origin/gh-pages^" -- ++ git add . ++ git -c user.name='ci' -c user.email='ci' commit -m init ++ git push -f -q origin HEAD:gh-pages ++ if: github.event_name == 'push' && github.event.ref == 'refs/heads/master' +diff -Nru mesa-25.3.3/subprojects/cfg-if-1.0.0/.gitignore mesa-25.3.3/subprojects/cfg-if-1.0.0/.gitignore +--- mesa-25.3.3/subprojects/cfg-if-1.0.0/.gitignore 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/cfg-if-1.0.0/.gitignore 2020-10-06 13:43:06.000000000 -0500 +@@ -0,0 +1,2 @@ ++target ++Cargo.lock +diff -Nru mesa-25.3.3/subprojects/cfg-if-1.0.0/LICENSE-APACHE mesa-25.3.3/subprojects/cfg-if-1.0.0/LICENSE-APACHE +--- mesa-25.3.3/subprojects/cfg-if-1.0.0/LICENSE-APACHE 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/cfg-if-1.0.0/LICENSE-APACHE 2020-10-06 13:43:06.000000000 -0500 +@@ -0,0 +1,201 @@ ++ Apache License ++ Version 2.0, January 2004 ++ http://www.apache.org/licenses/ ++ ++TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION ++ ++1. Definitions. ++ ++ "License" shall mean the terms and conditions for use, reproduction, ++ and distribution as defined by Sections 1 through 9 of this document. ++ ++ "Licensor" shall mean the copyright owner or entity authorized by ++ the copyright owner that is granting the License. ++ ++ "Legal Entity" shall mean the union of the acting entity and all ++ other entities that control, are controlled by, or are under common ++ control with that entity. For the purposes of this definition, ++ "control" means (i) the power, direct or indirect, to cause the ++ direction or management of such entity, whether by contract or ++ otherwise, or (ii) ownership of fifty percent (50%) or more of the ++ outstanding shares, or (iii) beneficial ownership of such entity. ++ ++ "You" (or "Your") shall mean an individual or Legal Entity ++ exercising permissions granted by this License. ++ ++ "Source" form shall mean the preferred form for making modifications, ++ including but not limited to software source code, documentation ++ source, and configuration files. ++ ++ "Object" form shall mean any form resulting from mechanical ++ transformation or translation of a Source form, including but ++ not limited to compiled object code, generated documentation, ++ and conversions to other media types. ++ ++ "Work" shall mean the work of authorship, whether in Source or ++ Object form, made available under the License, as indicated by a ++ copyright notice that is included in or attached to the work ++ (an example is provided in the Appendix below). ++ ++ "Derivative Works" shall mean any work, whether in Source or Object ++ form, that is based on (or derived from) the Work and for which the ++ editorial revisions, annotations, elaborations, or other modifications ++ represent, as a whole, an original work of authorship. For the purposes ++ of this License, Derivative Works shall not include works that remain ++ separable from, or merely link (or bind by name) to the interfaces of, ++ the Work and Derivative Works thereof. ++ ++ "Contribution" shall mean any work of authorship, including ++ the original version of the Work and any modifications or additions ++ to that Work or Derivative Works thereof, that is intentionally ++ submitted to Licensor for inclusion in the Work by the copyright owner ++ or by an individual or Legal Entity authorized to submit on behalf of ++ the copyright owner. For the purposes of this definition, "submitted" ++ means any form of electronic, verbal, or written communication sent ++ to the Licensor or its representatives, including but not limited to ++ communication on electronic mailing lists, source code control systems, ++ and issue tracking systems that are managed by, or on behalf of, the ++ Licensor for the purpose of discussing and improving the Work, but ++ excluding communication that is conspicuously marked or otherwise ++ designated in writing by the copyright owner as "Not a Contribution." ++ ++ "Contributor" shall mean Licensor and any individual or Legal Entity ++ on behalf of whom a Contribution has been received by Licensor and ++ subsequently incorporated within the Work. ++ ++2. Grant of Copyright License. Subject to the terms and conditions of ++ this License, each Contributor hereby grants to You a perpetual, ++ worldwide, non-exclusive, no-charge, royalty-free, irrevocable ++ copyright license to reproduce, prepare Derivative Works of, ++ publicly display, publicly perform, sublicense, and distribute the ++ Work and such Derivative Works in Source or Object form. ++ ++3. Grant of Patent License. Subject to the terms and conditions of ++ this License, each Contributor hereby grants to You a perpetual, ++ worldwide, non-exclusive, no-charge, royalty-free, irrevocable ++ (except as stated in this section) patent license to make, have made, ++ use, offer to sell, sell, import, and otherwise transfer the Work, ++ where such license applies only to those patent claims licensable ++ by such Contributor that are necessarily infringed by their ++ Contribution(s) alone or by combination of their Contribution(s) ++ with the Work to which such Contribution(s) was submitted. If You ++ institute patent litigation against any entity (including a ++ cross-claim or counterclaim in a lawsuit) alleging that the Work ++ or a Contribution incorporated within the Work constitutes direct ++ or contributory patent infringement, then any patent licenses ++ granted to You under this License for that Work shall terminate ++ as of the date such litigation is filed. ++ ++4. Redistribution. You may reproduce and distribute copies of the ++ Work or Derivative Works thereof in any medium, with or without ++ modifications, and in Source or Object form, provided that You ++ meet the following conditions: ++ ++ (a) You must give any other recipients of the Work or ++ Derivative Works a copy of this License; and ++ ++ (b) You must cause any modified files to carry prominent notices ++ stating that You changed the files; and ++ ++ (c) You must retain, in the Source form of any Derivative Works ++ that You distribute, all copyright, patent, trademark, and ++ attribution notices from the Source form of the Work, ++ excluding those notices that do not pertain to any part of ++ the Derivative Works; and ++ ++ (d) If the Work includes a "NOTICE" text file as part of its ++ distribution, then any Derivative Works that You distribute must ++ include a readable copy of the attribution notices contained ++ within such NOTICE file, excluding those notices that do not ++ pertain to any part of the Derivative Works, in at least one ++ of the following places: within a NOTICE text file distributed ++ as part of the Derivative Works; within the Source form or ++ documentation, if provided along with the Derivative Works; or, ++ within a display generated by the Derivative Works, if and ++ wherever such third-party notices normally appear. The contents ++ of the NOTICE file are for informational purposes only and ++ do not modify the License. You may add Your own attribution ++ notices within Derivative Works that You distribute, alongside ++ or as an addendum to the NOTICE text from the Work, provided ++ that such additional attribution notices cannot be construed ++ as modifying the License. ++ ++ You may add Your own copyright statement to Your modifications and ++ may provide additional or different license terms and conditions ++ for use, reproduction, or distribution of Your modifications, or ++ for any such Derivative Works as a whole, provided Your use, ++ reproduction, and distribution of the Work otherwise complies with ++ the conditions stated in this License. ++ ++5. Submission of Contributions. Unless You explicitly state otherwise, ++ any Contribution intentionally submitted for inclusion in the Work ++ by You to the Licensor shall be under the terms and conditions of ++ this License, without any additional terms or conditions. ++ Notwithstanding the above, nothing herein shall supersede or modify ++ the terms of any separate license agreement you may have executed ++ with Licensor regarding such Contributions. ++ ++6. Trademarks. This License does not grant permission to use the trade ++ names, trademarks, service marks, or product names of the Licensor, ++ except as required for reasonable and customary use in describing the ++ origin of the Work and reproducing the content of the NOTICE file. ++ ++7. Disclaimer of Warranty. Unless required by applicable law or ++ agreed to in writing, Licensor provides the Work (and each ++ Contributor provides its Contributions) on an "AS IS" BASIS, ++ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or ++ implied, including, without limitation, any warranties or conditions ++ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A ++ PARTICULAR PURPOSE. You are solely responsible for determining the ++ appropriateness of using or redistributing the Work and assume any ++ risks associated with Your exercise of permissions under this License. ++ ++8. Limitation of Liability. In no event and under no legal theory, ++ whether in tort (including negligence), contract, or otherwise, ++ unless required by applicable law (such as deliberate and grossly ++ negligent acts) or agreed to in writing, shall any Contributor be ++ liable to You for damages, including any direct, indirect, special, ++ incidental, or consequential damages of any character arising as a ++ result of this License or out of the use or inability to use the ++ Work (including but not limited to damages for loss of goodwill, ++ work stoppage, computer failure or malfunction, or any and all ++ other commercial damages or losses), even if such Contributor ++ has been advised of the possibility of such damages. ++ ++9. Accepting Warranty or Additional Liability. While redistributing ++ the Work or Derivative Works thereof, You may choose to offer, ++ and charge a fee for, acceptance of support, warranty, indemnity, ++ or other liability obligations and/or rights consistent with this ++ License. However, in accepting such obligations, You may act only ++ on Your own behalf and on Your sole responsibility, not on behalf ++ of any other Contributor, and only if You agree to indemnify, ++ defend, and hold each Contributor harmless for any liability ++ incurred by, or claims asserted against, such Contributor by reason ++ of your accepting any such warranty or additional liability. ++ ++END OF TERMS AND CONDITIONS ++ ++APPENDIX: How to apply the Apache License to your work. ++ ++ To apply the Apache License to your work, attach the following ++ boilerplate notice, with the fields enclosed by brackets "[]" ++ replaced with your own identifying information. (Don't include ++ the brackets!) The text should be enclosed in the appropriate ++ comment syntax for the file format. We also recommend that a ++ file or class name and description of purpose be included on the ++ same "printed page" as the copyright notice for easier ++ identification within third-party archives. ++ ++Copyright [yyyy] [name of copyright owner] ++ ++Licensed under the Apache License, Version 2.0 (the "License"); ++you may not use this file except in compliance with the License. ++You may obtain a copy of the License at ++ ++ http://www.apache.org/licenses/LICENSE-2.0 ++ ++Unless required by applicable law or agreed to in writing, software ++distributed under the License is distributed on an "AS IS" BASIS, ++WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++See the License for the specific language governing permissions and ++limitations under the License. +diff -Nru mesa-25.3.3/subprojects/cfg-if-1.0.0/LICENSE-MIT mesa-25.3.3/subprojects/cfg-if-1.0.0/LICENSE-MIT +--- mesa-25.3.3/subprojects/cfg-if-1.0.0/LICENSE-MIT 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/cfg-if-1.0.0/LICENSE-MIT 2020-10-06 13:43:06.000000000 -0500 +@@ -0,0 +1,25 @@ ++Copyright (c) 2014 Alex Crichton ++ ++Permission is hereby granted, free of charge, to any ++person obtaining a copy of this software and associated ++documentation files (the "Software"), to deal in the ++Software without restriction, including without ++limitation the rights to use, copy, modify, merge, ++publish, distribute, sublicense, and/or sell copies of ++the Software, and to permit persons to whom the Software ++is furnished to do so, subject to the following ++conditions: ++ ++The above copyright notice and this permission notice ++shall be included in all copies or substantial portions ++of the Software. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ++ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED ++TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A ++PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT ++SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ++CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION ++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR ++IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ++DEALINGS IN THE SOFTWARE. +diff -Nru mesa-25.3.3/subprojects/cfg-if-1.0.0/meson.build mesa-25.3.3/subprojects/cfg-if-1.0.0/meson.build +--- mesa-25.3.3/subprojects/cfg-if-1.0.0/meson.build 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/cfg-if-1.0.0/meson.build 2026-01-01 13:34:04.000000000 -0500 +@@ -0,0 +1,21 @@ ++# Copyright © 2024 Google ++# SPDX-License-Identifier: MIT ++ ++project( ++ 'cfg-if', ++ 'rust', ++ version : '1.0.0', ++ license : 'MIT OR Apache-2.0', ++) ++ ++lib = static_library( ++ 'cfg_if', ++ 'src/lib.rs', ++ override_options : ['rust_std=2018', 'build.rust_std=2018'], ++ rust_abi : 'rust', ++ native : true, ++) ++ ++dep_cfg_if = declare_dependency( ++ link_with : [lib] ++) +diff -Nru mesa-25.3.3/subprojects/cfg-if-1.0.0/.meson-subproject-wrap-hash.txt mesa-25.3.3/subprojects/cfg-if-1.0.0/.meson-subproject-wrap-hash.txt +--- mesa-25.3.3/subprojects/cfg-if-1.0.0/.meson-subproject-wrap-hash.txt 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/cfg-if-1.0.0/.meson-subproject-wrap-hash.txt 2026-05-29 13:40:51.000000000 -0500 +@@ -0,0 +1 @@ ++4f0b0b5da4c0b8f1ff2d0309058ff5db463ad3cac305bed28823f51c6aac225b +diff -Nru mesa-25.3.3/subprojects/cfg-if-1.0.0/README.md mesa-25.3.3/subprojects/cfg-if-1.0.0/README.md +--- mesa-25.3.3/subprojects/cfg-if-1.0.0/README.md 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/cfg-if-1.0.0/README.md 2020-10-06 13:43:06.000000000 -0500 +@@ -0,0 +1,47 @@ ++# cfg-if ++ ++[Documentation](https://docs.rs/cfg-if) ++ ++A macro to ergonomically define an item depending on a large number of #[cfg] ++parameters. Structured like an if-else chain, the first matching branch is the ++item that gets emitted. ++ ++```toml ++[dependencies] ++cfg-if = "0.1" ++``` ++ ++## Example ++ ++```rust ++cfg_if::cfg_if! { ++ if #[cfg(unix)] { ++ fn foo() { /* unix specific functionality */ } ++ } else if #[cfg(target_pointer_width = "32")] { ++ fn foo() { /* non-unix, 32-bit functionality */ } ++ } else { ++ fn foo() { /* fallback implementation */ } ++ } ++} ++ ++fn main() { ++ foo(); ++} ++``` ++ ++# License ++ ++This project is licensed under either of ++ ++ * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or ++ http://www.apache.org/licenses/LICENSE-2.0) ++ * MIT license ([LICENSE-MIT](LICENSE-MIT) or ++ http://opensource.org/licenses/MIT) ++ ++at your option. ++ ++### Contribution ++ ++Unless you explicitly state otherwise, any contribution intentionally submitted ++for inclusion in `cfg-if` by you, as defined in the Apache-2.0 license, shall be ++dual licensed as above, without any additional terms or conditions. +diff -Nru mesa-25.3.3/subprojects/cfg-if-1.0.0/src/lib.rs mesa-25.3.3/subprojects/cfg-if-1.0.0/src/lib.rs +--- mesa-25.3.3/subprojects/cfg-if-1.0.0/src/lib.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/cfg-if-1.0.0/src/lib.rs 2020-10-06 13:43:44.000000000 -0500 +@@ -0,0 +1,176 @@ ++//! A macro for defining `#[cfg]` if-else statements. ++//! ++//! The macro provided by this crate, `cfg_if`, is similar to the `if/elif` C ++//! preprocessor macro by allowing definition of a cascade of `#[cfg]` cases, ++//! emitting the implementation which matches first. ++//! ++//! This allows you to conveniently provide a long list `#[cfg]`'d blocks of code ++//! without having to rewrite each clause multiple times. ++//! ++//! # Example ++//! ++//! ``` ++//! cfg_if::cfg_if! { ++//! if #[cfg(unix)] { ++//! fn foo() { /* unix specific functionality */ } ++//! } else if #[cfg(target_pointer_width = "32")] { ++//! fn foo() { /* non-unix, 32-bit functionality */ } ++//! } else { ++//! fn foo() { /* fallback implementation */ } ++//! } ++//! } ++//! ++//! # fn main() {} ++//! ``` ++ ++#![no_std] ++#![doc(html_root_url = "https://docs.rs/cfg-if")] ++#![deny(missing_docs)] ++#![cfg_attr(test, deny(warnings))] ++ ++/// The main macro provided by this crate. See crate documentation for more ++/// information. ++#[macro_export] ++macro_rules! cfg_if { ++ // match if/else chains with a final `else` ++ ($( ++ if #[cfg($meta:meta)] { $($tokens:tt)* } ++ ) else * else { ++ $($tokens2:tt)* ++ }) => { ++ $crate::cfg_if! { ++ @__items ++ () ; ++ $( ( ($meta) ($($tokens)*) ), )* ++ ( () ($($tokens2)*) ), ++ } ++ }; ++ ++ // match if/else chains lacking a final `else` ++ ( ++ if #[cfg($i_met:meta)] { $($i_tokens:tt)* } ++ $( ++ else if #[cfg($e_met:meta)] { $($e_tokens:tt)* } ++ )* ++ ) => { ++ $crate::cfg_if! { ++ @__items ++ () ; ++ ( ($i_met) ($($i_tokens)*) ), ++ $( ( ($e_met) ($($e_tokens)*) ), )* ++ ( () () ), ++ } ++ }; ++ ++ // Internal and recursive macro to emit all the items ++ // ++ // Collects all the negated cfgs in a list at the beginning and after the ++ // semicolon is all the remaining items ++ (@__items ($($not:meta,)*) ; ) => {}; ++ (@__items ($($not:meta,)*) ; ( ($($m:meta),*) ($($tokens:tt)*) ), $($rest:tt)*) => { ++ // Emit all items within one block, applying an appropriate #[cfg]. The ++ // #[cfg] will require all `$m` matchers specified and must also negate ++ // all previous matchers. ++ #[cfg(all($($m,)* not(any($($not),*))))] $crate::cfg_if! { @__identity $($tokens)* } ++ ++ // Recurse to emit all other items in `$rest`, and when we do so add all ++ // our `$m` matchers to the list of `$not` matchers as future emissions ++ // will have to negate everything we just matched as well. ++ $crate::cfg_if! { @__items ($($not,)* $($m,)*) ; $($rest)* } ++ }; ++ ++ // Internal macro to make __apply work out right for different match types, ++ // because of how macros matching/expand stuff. ++ (@__identity $($tokens:tt)*) => { ++ $($tokens)* ++ }; ++} ++ ++#[cfg(test)] ++mod tests { ++ cfg_if! { ++ if #[cfg(test)] { ++ use core::option::Option as Option2; ++ fn works1() -> Option2 { Some(1) } ++ } else { ++ fn works1() -> Option { None } ++ } ++ } ++ ++ cfg_if! { ++ if #[cfg(foo)] { ++ fn works2() -> bool { false } ++ } else if #[cfg(test)] { ++ fn works2() -> bool { true } ++ } else { ++ fn works2() -> bool { false } ++ } ++ } ++ ++ cfg_if! { ++ if #[cfg(foo)] { ++ fn works3() -> bool { false } ++ } else { ++ fn works3() -> bool { true } ++ } ++ } ++ ++ cfg_if! { ++ if #[cfg(test)] { ++ use core::option::Option as Option3; ++ fn works4() -> Option3 { Some(1) } ++ } ++ } ++ ++ cfg_if! { ++ if #[cfg(foo)] { ++ fn works5() -> bool { false } ++ } else if #[cfg(test)] { ++ fn works5() -> bool { true } ++ } ++ } ++ ++ #[test] ++ fn it_works() { ++ assert!(works1().is_some()); ++ assert!(works2()); ++ assert!(works3()); ++ assert!(works4().is_some()); ++ assert!(works5()); ++ } ++ ++ #[test] ++ #[allow(clippy::assertions_on_constants)] ++ fn test_usage_within_a_function() { ++ cfg_if! {if #[cfg(debug_assertions)] { ++ // we want to put more than one thing here to make sure that they ++ // all get configured properly. ++ assert!(cfg!(debug_assertions)); ++ assert_eq!(4, 2+2); ++ } else { ++ assert!(works1().is_some()); ++ assert_eq!(10, 5+5); ++ }} ++ } ++ ++ trait Trait { ++ fn blah(&self); ++ } ++ ++ #[allow(dead_code)] ++ struct Struct; ++ ++ impl Trait for Struct { ++ cfg_if! { ++ if #[cfg(feature = "blah")] { ++ fn blah(&self) { ++ unimplemented!(); ++ } ++ } else { ++ fn blah(&self) { ++ unimplemented!(); ++ } ++ } ++ } ++ } ++} +diff -Nru mesa-25.3.3/subprojects/cfg-if-1.0.0/tests/xcrate.rs mesa-25.3.3/subprojects/cfg-if-1.0.0/tests/xcrate.rs +--- mesa-25.3.3/subprojects/cfg-if-1.0.0/tests/xcrate.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/cfg-if-1.0.0/tests/xcrate.rs 2020-10-06 13:43:06.000000000 -0500 +@@ -0,0 +1,14 @@ ++cfg_if::cfg_if! { ++ if #[cfg(foo)] { ++ fn works() -> bool { false } ++ } else if #[cfg(test)] { ++ fn works() -> bool { true } ++ } else { ++ fn works() -> bool { false } ++ } ++} ++ ++#[test] ++fn smoke() { ++ assert!(works()); ++} +diff -Nru mesa-25.3.3/subprojects/cfg-if-1-rs.wrap mesa-25.3.3/subprojects/cfg-if-1-rs.wrap +--- mesa-25.3.3/subprojects/cfg-if-1-rs.wrap 2026-01-01 13:34:04.000000000 -0500 ++++ mesa-25.3.3/subprojects/cfg-if-1-rs.wrap 2026-05-29 13:40:51.000000000 -0500 +@@ -1,6 +1,4 @@ + [wrap-file] + directory = cfg-if-1.0.0 +-source_url = https://crates.io/api/v1/crates/cfg-if/1.0.0/download +-source_filename = cfg-if-1.0.0.tar.gz +-source_hash = baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd + patch_directory = cfg-if-1-rs ++ +diff -Nru mesa-25.3.3/subprojects/equivalent-1.0.1/.cargo-checksum.json mesa-25.3.3/subprojects/equivalent-1.0.1/.cargo-checksum.json +--- mesa-25.3.3/subprojects/equivalent-1.0.1/.cargo-checksum.json 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/equivalent-1.0.1/.cargo-checksum.json 2025-04-07 11:26:49.000000000 -0500 +@@ -0,0 +1 @@ ++{"package":"5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5","files":{}} +diff -Nru mesa-25.3.3/subprojects/equivalent-1.0.1/Cargo.toml mesa-25.3.3/subprojects/equivalent-1.0.1/Cargo.toml +--- mesa-25.3.3/subprojects/equivalent-1.0.1/Cargo.toml 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/equivalent-1.0.1/Cargo.toml 2025-04-07 11:26:49.000000000 -0500 +@@ -0,0 +1,27 @@ ++# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO ++# ++# When uploading crates to the registry Cargo will automatically ++# "normalize" Cargo.toml files for maximal compatibility ++# with all versions of Cargo and also rewrite `path` dependencies ++# to registry (e.g., crates.io) dependencies. ++# ++# If you are reading this file be aware that the original Cargo.toml ++# will likely look very different (and much more reasonable). ++# See Cargo.toml.orig for the original contents. ++ ++[package] ++rust-version = "1.6" ++name = "equivalent" ++version = "1.0.1" ++description = "Traits for key comparison in maps." ++readme = "README.md" ++keywords = [ ++ "hashmap", ++ "no_std", ++] ++categories = [ ++ "data-structures", ++ "no-std", ++] ++license = "Apache-2.0 OR MIT" ++repository = "https://github.com/cuviper/equivalent" +diff -Nru mesa-25.3.3/subprojects/equivalent-1.0.1/.cargo_vcs_info.json mesa-25.3.3/subprojects/equivalent-1.0.1/.cargo_vcs_info.json +--- mesa-25.3.3/subprojects/equivalent-1.0.1/.cargo_vcs_info.json 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/equivalent-1.0.1/.cargo_vcs_info.json 2025-04-07 11:26:49.000000000 -0500 +@@ -0,0 +1,6 @@ ++{ ++ "git": { ++ "sha1": "8a56bf0407d8eecf2165775a95a67cc0e956e50d" ++ }, ++ "path_in_vcs": "" ++} +\ No hay ningún carácter de nueva línea al final del archivo +diff -Nru mesa-25.3.3/subprojects/equivalent-1.0.1/.gitignore mesa-25.3.3/subprojects/equivalent-1.0.1/.gitignore +--- mesa-25.3.3/subprojects/equivalent-1.0.1/.gitignore 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/equivalent-1.0.1/.gitignore 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,2 @@ ++/target ++/Cargo.lock +diff -Nru mesa-25.3.3/subprojects/equivalent-1.0.1/LICENSE-APACHE mesa-25.3.3/subprojects/equivalent-1.0.1/LICENSE-APACHE +--- mesa-25.3.3/subprojects/equivalent-1.0.1/LICENSE-APACHE 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/equivalent-1.0.1/LICENSE-APACHE 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,201 @@ ++ Apache License ++ Version 2.0, January 2004 ++ http://www.apache.org/licenses/ ++ ++TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION ++ ++1. Definitions. ++ ++ "License" shall mean the terms and conditions for use, reproduction, ++ and distribution as defined by Sections 1 through 9 of this document. ++ ++ "Licensor" shall mean the copyright owner or entity authorized by ++ the copyright owner that is granting the License. ++ ++ "Legal Entity" shall mean the union of the acting entity and all ++ other entities that control, are controlled by, or are under common ++ control with that entity. For the purposes of this definition, ++ "control" means (i) the power, direct or indirect, to cause the ++ direction or management of such entity, whether by contract or ++ otherwise, or (ii) ownership of fifty percent (50%) or more of the ++ outstanding shares, or (iii) beneficial ownership of such entity. ++ ++ "You" (or "Your") shall mean an individual or Legal Entity ++ exercising permissions granted by this License. ++ ++ "Source" form shall mean the preferred form for making modifications, ++ including but not limited to software source code, documentation ++ source, and configuration files. ++ ++ "Object" form shall mean any form resulting from mechanical ++ transformation or translation of a Source form, including but ++ not limited to compiled object code, generated documentation, ++ and conversions to other media types. ++ ++ "Work" shall mean the work of authorship, whether in Source or ++ Object form, made available under the License, as indicated by a ++ copyright notice that is included in or attached to the work ++ (an example is provided in the Appendix below). ++ ++ "Derivative Works" shall mean any work, whether in Source or Object ++ form, that is based on (or derived from) the Work and for which the ++ editorial revisions, annotations, elaborations, or other modifications ++ represent, as a whole, an original work of authorship. For the purposes ++ of this License, Derivative Works shall not include works that remain ++ separable from, or merely link (or bind by name) to the interfaces of, ++ the Work and Derivative Works thereof. ++ ++ "Contribution" shall mean any work of authorship, including ++ the original version of the Work and any modifications or additions ++ to that Work or Derivative Works thereof, that is intentionally ++ submitted to Licensor for inclusion in the Work by the copyright owner ++ or by an individual or Legal Entity authorized to submit on behalf of ++ the copyright owner. For the purposes of this definition, "submitted" ++ means any form of electronic, verbal, or written communication sent ++ to the Licensor or its representatives, including but not limited to ++ communication on electronic mailing lists, source code control systems, ++ and issue tracking systems that are managed by, or on behalf of, the ++ Licensor for the purpose of discussing and improving the Work, but ++ excluding communication that is conspicuously marked or otherwise ++ designated in writing by the copyright owner as "Not a Contribution." ++ ++ "Contributor" shall mean Licensor and any individual or Legal Entity ++ on behalf of whom a Contribution has been received by Licensor and ++ subsequently incorporated within the Work. ++ ++2. Grant of Copyright License. Subject to the terms and conditions of ++ this License, each Contributor hereby grants to You a perpetual, ++ worldwide, non-exclusive, no-charge, royalty-free, irrevocable ++ copyright license to reproduce, prepare Derivative Works of, ++ publicly display, publicly perform, sublicense, and distribute the ++ Work and such Derivative Works in Source or Object form. ++ ++3. Grant of Patent License. Subject to the terms and conditions of ++ this License, each Contributor hereby grants to You a perpetual, ++ worldwide, non-exclusive, no-charge, royalty-free, irrevocable ++ (except as stated in this section) patent license to make, have made, ++ use, offer to sell, sell, import, and otherwise transfer the Work, ++ where such license applies only to those patent claims licensable ++ by such Contributor that are necessarily infringed by their ++ Contribution(s) alone or by combination of their Contribution(s) ++ with the Work to which such Contribution(s) was submitted. If You ++ institute patent litigation against any entity (including a ++ cross-claim or counterclaim in a lawsuit) alleging that the Work ++ or a Contribution incorporated within the Work constitutes direct ++ or contributory patent infringement, then any patent licenses ++ granted to You under this License for that Work shall terminate ++ as of the date such litigation is filed. ++ ++4. Redistribution. You may reproduce and distribute copies of the ++ Work or Derivative Works thereof in any medium, with or without ++ modifications, and in Source or Object form, provided that You ++ meet the following conditions: ++ ++ (a) You must give any other recipients of the Work or ++ Derivative Works a copy of this License; and ++ ++ (b) You must cause any modified files to carry prominent notices ++ stating that You changed the files; and ++ ++ (c) You must retain, in the Source form of any Derivative Works ++ that You distribute, all copyright, patent, trademark, and ++ attribution notices from the Source form of the Work, ++ excluding those notices that do not pertain to any part of ++ the Derivative Works; and ++ ++ (d) If the Work includes a "NOTICE" text file as part of its ++ distribution, then any Derivative Works that You distribute must ++ include a readable copy of the attribution notices contained ++ within such NOTICE file, excluding those notices that do not ++ pertain to any part of the Derivative Works, in at least one ++ of the following places: within a NOTICE text file distributed ++ as part of the Derivative Works; within the Source form or ++ documentation, if provided along with the Derivative Works; or, ++ within a display generated by the Derivative Works, if and ++ wherever such third-party notices normally appear. The contents ++ of the NOTICE file are for informational purposes only and ++ do not modify the License. You may add Your own attribution ++ notices within Derivative Works that You distribute, alongside ++ or as an addendum to the NOTICE text from the Work, provided ++ that such additional attribution notices cannot be construed ++ as modifying the License. ++ ++ You may add Your own copyright statement to Your modifications and ++ may provide additional or different license terms and conditions ++ for use, reproduction, or distribution of Your modifications, or ++ for any such Derivative Works as a whole, provided Your use, ++ reproduction, and distribution of the Work otherwise complies with ++ the conditions stated in this License. ++ ++5. Submission of Contributions. Unless You explicitly state otherwise, ++ any Contribution intentionally submitted for inclusion in the Work ++ by You to the Licensor shall be under the terms and conditions of ++ this License, without any additional terms or conditions. ++ Notwithstanding the above, nothing herein shall supersede or modify ++ the terms of any separate license agreement you may have executed ++ with Licensor regarding such Contributions. ++ ++6. Trademarks. This License does not grant permission to use the trade ++ names, trademarks, service marks, or product names of the Licensor, ++ except as required for reasonable and customary use in describing the ++ origin of the Work and reproducing the content of the NOTICE file. ++ ++7. Disclaimer of Warranty. Unless required by applicable law or ++ agreed to in writing, Licensor provides the Work (and each ++ Contributor provides its Contributions) on an "AS IS" BASIS, ++ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or ++ implied, including, without limitation, any warranties or conditions ++ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A ++ PARTICULAR PURPOSE. You are solely responsible for determining the ++ appropriateness of using or redistributing the Work and assume any ++ risks associated with Your exercise of permissions under this License. ++ ++8. Limitation of Liability. In no event and under no legal theory, ++ whether in tort (including negligence), contract, or otherwise, ++ unless required by applicable law (such as deliberate and grossly ++ negligent acts) or agreed to in writing, shall any Contributor be ++ liable to You for damages, including any direct, indirect, special, ++ incidental, or consequential damages of any character arising as a ++ result of this License or out of the use or inability to use the ++ Work (including but not limited to damages for loss of goodwill, ++ work stoppage, computer failure or malfunction, or any and all ++ other commercial damages or losses), even if such Contributor ++ has been advised of the possibility of such damages. ++ ++9. Accepting Warranty or Additional Liability. While redistributing ++ the Work or Derivative Works thereof, You may choose to offer, ++ and charge a fee for, acceptance of support, warranty, indemnity, ++ or other liability obligations and/or rights consistent with this ++ License. However, in accepting such obligations, You may act only ++ on Your own behalf and on Your sole responsibility, not on behalf ++ of any other Contributor, and only if You agree to indemnify, ++ defend, and hold each Contributor harmless for any liability ++ incurred by, or claims asserted against, such Contributor by reason ++ of your accepting any such warranty or additional liability. ++ ++END OF TERMS AND CONDITIONS ++ ++APPENDIX: How to apply the Apache License to your work. ++ ++ To apply the Apache License to your work, attach the following ++ boilerplate notice, with the fields enclosed by brackets "[]" ++ replaced with your own identifying information. (Don't include ++ the brackets!) The text should be enclosed in the appropriate ++ comment syntax for the file format. We also recommend that a ++ file or class name and description of purpose be included on the ++ same "printed page" as the copyright notice for easier ++ identification within third-party archives. ++ ++Copyright [yyyy] [name of copyright owner] ++ ++Licensed under the Apache License, Version 2.0 (the "License"); ++you may not use this file except in compliance with the License. ++You may obtain a copy of the License at ++ ++ http://www.apache.org/licenses/LICENSE-2.0 ++ ++Unless required by applicable law or agreed to in writing, software ++distributed under the License is distributed on an "AS IS" BASIS, ++WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++See the License for the specific language governing permissions and ++limitations under the License. +diff -Nru mesa-25.3.3/subprojects/equivalent-1.0.1/LICENSE-MIT mesa-25.3.3/subprojects/equivalent-1.0.1/LICENSE-MIT +--- mesa-25.3.3/subprojects/equivalent-1.0.1/LICENSE-MIT 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/equivalent-1.0.1/LICENSE-MIT 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,25 @@ ++Copyright (c) 2016--2023 ++ ++Permission is hereby granted, free of charge, to any ++person obtaining a copy of this software and associated ++documentation files (the "Software"), to deal in the ++Software without restriction, including without ++limitation the rights to use, copy, modify, merge, ++publish, distribute, sublicense, and/or sell copies of ++the Software, and to permit persons to whom the Software ++is furnished to do so, subject to the following ++conditions: ++ ++The above copyright notice and this permission notice ++shall be included in all copies or substantial portions ++of the Software. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ++ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED ++TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A ++PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT ++SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ++CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION ++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR ++IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ++DEALINGS IN THE SOFTWARE. +diff -Nru mesa-25.3.3/subprojects/equivalent-1.0.1/meson.build mesa-25.3.3/subprojects/equivalent-1.0.1/meson.build +--- mesa-25.3.3/subprojects/equivalent-1.0.1/meson.build 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/equivalent-1.0.1/meson.build 2026-01-01 13:34:04.000000000 -0500 +@@ -0,0 +1,18 @@ ++project( ++ 'equivalent', ++ 'rust', ++ version : '1.0.1', ++ license : 'MIT OR Apache-2.0', ++) ++ ++lib = static_library( ++ 'equivalent', ++ 'src/lib.rs', ++ override_options : ['rust_std=2015', 'build.rust_std=2015'], ++ rust_abi : 'rust', ++ native : true, ++) ++ ++dep_equivalent = declare_dependency( ++ link_with : [lib], ++) +diff -Nru mesa-25.3.3/subprojects/equivalent-1.0.1/.meson-subproject-wrap-hash.txt mesa-25.3.3/subprojects/equivalent-1.0.1/.meson-subproject-wrap-hash.txt +--- mesa-25.3.3/subprojects/equivalent-1.0.1/.meson-subproject-wrap-hash.txt 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/equivalent-1.0.1/.meson-subproject-wrap-hash.txt 2026-05-29 13:40:52.000000000 -0500 +@@ -0,0 +1 @@ ++9e61fa7c62ad887487adec9822293d66a0a9fbad026e808db0f695d8770bbd41 +diff -Nru mesa-25.3.3/subprojects/equivalent-1.0.1/README.md mesa-25.3.3/subprojects/equivalent-1.0.1/README.md +--- mesa-25.3.3/subprojects/equivalent-1.0.1/README.md 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/equivalent-1.0.1/README.md 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,25 @@ ++# Equivalent ++ ++[![crates.io](https://img.shields.io/crates/v/equivalent.svg)](https://crates.io/crates/equivalent) ++[![docs](https://docs.rs/equivalent/badge.svg)](https://docs.rs/equivalent) ++ ++`Equivalent` and `Comparable` are Rust traits for key comparison in maps. ++ ++These may be used in the implementation of maps where the lookup type `Q` ++may be different than the stored key type `K`. ++ ++* `Q: Equivalent` checks for equality, similar to the `HashMap` ++ constraint `K: Borrow, Q: Eq`. ++* `Q: Comparable` checks the ordering, similar to the `BTreeMap` ++ constraint `K: Borrow, Q: Ord`. ++ ++These traits are not used by the maps in the standard library, but they may ++add more flexibility in third-party map implementations, especially in ++situations where a strict `K: Borrow` relationship is not available. ++ ++## License ++ ++Equivalent is distributed under the terms of both the MIT license and the ++Apache License (Version 2.0). See [LICENSE-APACHE](LICENSE-APACHE) and ++[LICENSE-MIT](LICENSE-MIT) for details. Opening a pull request is ++assumed to signal agreement with these licensing terms. +diff -Nru mesa-25.3.3/subprojects/equivalent-1.0.1/src/lib.rs mesa-25.3.3/subprojects/equivalent-1.0.1/src/lib.rs +--- mesa-25.3.3/subprojects/equivalent-1.0.1/src/lib.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/equivalent-1.0.1/src/lib.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,113 @@ ++//! [`Equivalent`] and [`Comparable`] are traits for key comparison in maps. ++//! ++//! These may be used in the implementation of maps where the lookup type `Q` ++//! may be different than the stored key type `K`. ++//! ++//! * `Q: Equivalent` checks for equality, similar to the `HashMap` ++//! constraint `K: Borrow, Q: Eq`. ++//! * `Q: Comparable` checks the ordering, similar to the `BTreeMap` ++//! constraint `K: Borrow, Q: Ord`. ++//! ++//! These traits are not used by the maps in the standard library, but they may ++//! add more flexibility in third-party map implementations, especially in ++//! situations where a strict `K: Borrow` relationship is not available. ++//! ++//! # Examples ++//! ++//! ``` ++//! use equivalent::*; ++//! use std::cmp::Ordering; ++//! ++//! pub struct Pair(pub A, pub B); ++//! ++//! impl<'a, A: ?Sized, B: ?Sized, C, D> Equivalent<(C, D)> for Pair<&'a A, &'a B> ++//! where ++//! A: Equivalent, ++//! B: Equivalent, ++//! { ++//! fn equivalent(&self, key: &(C, D)) -> bool { ++//! self.0.equivalent(&key.0) && self.1.equivalent(&key.1) ++//! } ++//! } ++//! ++//! impl<'a, A: ?Sized, B: ?Sized, C, D> Comparable<(C, D)> for Pair<&'a A, &'a B> ++//! where ++//! A: Comparable, ++//! B: Comparable, ++//! { ++//! fn compare(&self, key: &(C, D)) -> Ordering { ++//! match self.0.compare(&key.0) { ++//! Ordering::Equal => self.1.compare(&key.1), ++//! not_equal => not_equal, ++//! } ++//! } ++//! } ++//! ++//! fn main() { ++//! let key = (String::from("foo"), String::from("bar")); ++//! let q1 = Pair("foo", "bar"); ++//! let q2 = Pair("boo", "bar"); ++//! let q3 = Pair("foo", "baz"); ++//! ++//! assert!(q1.equivalent(&key)); ++//! assert!(!q2.equivalent(&key)); ++//! assert!(!q3.equivalent(&key)); ++//! ++//! assert_eq!(q1.compare(&key), Ordering::Equal); ++//! assert_eq!(q2.compare(&key), Ordering::Less); ++//! assert_eq!(q3.compare(&key), Ordering::Greater); ++//! } ++//! ``` ++ ++#![no_std] ++ ++use core::borrow::Borrow; ++use core::cmp::Ordering; ++ ++/// Key equivalence trait. ++/// ++/// This trait allows hash table lookup to be customized. It has one blanket ++/// implementation that uses the regular solution with `Borrow` and `Eq`, just ++/// like `HashMap` does, so that you can pass `&str` to lookup into a map with ++/// `String` keys and so on. ++/// ++/// # Contract ++/// ++/// The implementor **must** hash like `K`, if it is hashable. ++pub trait Equivalent { ++ /// Compare self to `key` and return `true` if they are equal. ++ fn equivalent(&self, key: &K) -> bool; ++} ++ ++impl Equivalent for Q ++where ++ Q: Eq, ++ K: Borrow, ++{ ++ #[inline] ++ fn equivalent(&self, key: &K) -> bool { ++ PartialEq::eq(self, key.borrow()) ++ } ++} ++ ++/// Key ordering trait. ++/// ++/// This trait allows ordered map lookup to be customized. It has one blanket ++/// implementation that uses the regular solution with `Borrow` and `Ord`, just ++/// like `BTreeMap` does, so that you can pass `&str` to lookup into a map with ++/// `String` keys and so on. ++pub trait Comparable: Equivalent { ++ /// Compare self to `key` and return their ordering. ++ fn compare(&self, key: &K) -> Ordering; ++} ++ ++impl Comparable for Q ++where ++ Q: Ord, ++ K: Borrow, ++{ ++ #[inline] ++ fn compare(&self, key: &K) -> Ordering { ++ Ord::cmp(self, key.borrow()) ++ } ++} +diff -Nru mesa-25.3.3/subprojects/equivalent-1-rs.wrap mesa-25.3.3/subprojects/equivalent-1-rs.wrap +--- mesa-25.3.3/subprojects/equivalent-1-rs.wrap 2026-01-01 13:34:04.000000000 -0500 ++++ mesa-25.3.3/subprojects/equivalent-1-rs.wrap 2026-05-29 13:40:51.000000000 -0500 +@@ -1,6 +1,4 @@ + [wrap-file] + directory = equivalent-1.0.1 +-source_url = https://crates.io/api/v1/crates/equivalent/1.0.1/download +-source_filename = equivalent-1.0.1.tar.gz +-source_hash = 5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5 + patch_directory = equivalent-1-rs ++ +diff -Nru mesa-25.3.3/subprojects/errno-0.3.8/.cargo-checksum.json mesa-25.3.3/subprojects/errno-0.3.8/.cargo-checksum.json +--- mesa-25.3.3/subprojects/errno-0.3.8/.cargo-checksum.json 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/errno-0.3.8/.cargo-checksum.json 2024-01-14 16:54:23.000000000 -0500 +@@ -0,0 +1 @@ ++{"package":"Could not get crate checksum","files":{}} +diff -Nru mesa-25.3.3/subprojects/errno-0.3.8/Cargo.toml mesa-25.3.3/subprojects/errno-0.3.8/Cargo.toml +--- mesa-25.3.3/subprojects/errno-0.3.8/Cargo.toml 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/errno-0.3.8/Cargo.toml 2024-01-14 16:54:23.000000000 -0500 +@@ -0,0 +1,43 @@ ++# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO ++# ++# When uploading crates to the registry Cargo will automatically ++# "normalize" Cargo.toml files for maximal compatibility ++# with all versions of Cargo and also rewrite `path` dependencies ++# to registry (e.g., crates.io) dependencies. ++# ++# If you are reading this file be aware that the original Cargo.toml ++# will likely look very different (and much more reasonable). ++# See Cargo.toml.orig for the original contents. ++ ++[package] ++edition = "2018" ++rust-version = "1.56" ++name = "errno" ++version = "0.3.8" ++authors = ["Chris Wong "] ++description = "Cross-platform interface to the `errno` variable." ++documentation = "https://docs.rs/errno" ++readme = "README.md" ++categories = [ ++ "no-std", ++ "os", ++] ++license = "MIT OR Apache-2.0" ++repository = "https://github.com/lambda-fairy/rust-errno" ++ ++[features] ++default = ["std"] ++std = ["libc/std"] ++ ++[target."cfg(target_os=\"hermit\")".dependencies.libc] ++version = "0.2" ++default-features = false ++ ++[target."cfg(target_os=\"wasi\")".dependencies.libc] ++version = "0.2" ++default-features = false ++ ++[target."cfg(unix)".dependencies.libc] ++version = "0.2" ++default-features = false ++ +diff -Nru mesa-25.3.3/subprojects/errno-0.3.8/.cargo_vcs_info.json mesa-25.3.3/subprojects/errno-0.3.8/.cargo_vcs_info.json +--- mesa-25.3.3/subprojects/errno-0.3.8/.cargo_vcs_info.json 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/errno-0.3.8/.cargo_vcs_info.json 2024-01-14 16:54:23.000000000 -0500 +@@ -0,0 +1,6 @@ ++{ ++ "git": { ++ "sha1": "529718762b1f752ccc894de5380d3aa10889733d" ++ }, ++ "path_in_vcs": "" ++} +\ No hay ningún carácter de nueva línea al final del archivo +diff -Nru mesa-25.3.3/subprojects/errno-0.3.8/CHANGELOG.md mesa-25.3.3/subprojects/errno-0.3.8/CHANGELOG.md +--- mesa-25.3.3/subprojects/errno-0.3.8/CHANGELOG.md 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/errno-0.3.8/CHANGELOG.md 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,96 @@ ++# [Unreleased] ++ ++# [0.3.8] - 2023-11-27 ++ ++- Update to windows-sys 0.52. ++ [#91](https://github.com/lambda-fairy/rust-errno/pull/91) ++ ++- Update minimum Rust version to 1.56 ++ [#91](https://github.com/lambda-fairy/rust-errno/pull/91) ++ ++# [0.3.7] - 2023-11-15 ++ ++- Fix `to_string()` handling for unknown error codes ++ [#88](https://github.com/lambda-fairy/rust-errno/pull/88) ++ ++# [0.3.6] - 2023-11-07 ++ ++- Add support for tvOS and watchOS ++ [#84](https://github.com/lambda-fairy/rust-errno/pull/84) ++ ++- Added support for vita target ++ [#86](https://github.com/lambda-fairy/rust-errno/pull/86) ++ ++# [0.3.5] - 2023-10-08 ++ ++- Use __errno_location on DragonFly BSD ++ [#82](https://github.com/lambda-fairy/rust-errno/pull/82) ++ ++# [0.3.4] - 2023-10-01 ++ ++- Add GNU/Hurd support ++ [#80](https://github.com/lambda-fairy/rust-errno/pull/80) ++ ++# [0.3.3] - 2023-08-28 ++ ++- Disable "libc/std" in no-std configurations. ++ [#77](https://github.com/lambda-fairy/rust-errno/pull/77) ++ ++- Bump errno-dragonfly to 0.1.2 ++ [#75](https://github.com/lambda-fairy/rust-errno/pull/75) ++ ++- Support for the ESP-IDF framework ++ [#74](https://github.com/lambda-fairy/rust-errno/pull/74) ++ ++# [0.3.2] - 2023-07-30 ++ ++- Fix build on Hermit ++ [#73](https://github.com/lambda-fairy/rust-errno/pull/73) ++ ++- Add support for QNX Neutrino ++ [#72](https://github.com/lambda-fairy/rust-errno/pull/72) ++ ++# [0.3.1] - 2023-04-08 ++ ++- Correct link name on redox ++ [#69](https://github.com/lambda-fairy/rust-errno/pull/69) ++ ++- Update windows-sys requirement from 0.45 to 0.48 ++ [#70](https://github.com/lambda-fairy/rust-errno/pull/70) ++ ++# [0.3.0] - 2023-02-12 ++ ++- Add haiku support ++ [#42](https://github.com/lambda-fairy/rust-errno/pull/42) ++ ++- Add AIX support ++ [#54](https://github.com/lambda-fairy/rust-errno/pull/54) ++ ++- Add formatting with `#![no_std]` ++ [#44](https://github.com/lambda-fairy/rust-errno/pull/44) ++ ++- Switch from `winapi` to `windows-sys` [#55](https://github.com/lambda-fairy/rust-errno/pull/55) ++ ++- Update minimum Rust version to 1.48 ++ [#48](https://github.com/lambda-fairy/rust-errno/pull/48) [#55](https://github.com/lambda-fairy/rust-errno/pull/55) ++ ++- Upgrade to Rust 2018 edition [#59](https://github.com/lambda-fairy/rust-errno/pull/59) ++ ++- wasm32-wasi: Use `__errno_location` instead of `feature(thread_local)`. [#66](https://github.com/lambda-fairy/rust-errno/pull/66) ++ ++# [0.2.8] - 2021-10-27 ++ ++- Optionally support no_std ++ [#31](https://github.com/lambda-fairy/rust-errno/pull/31) ++ ++[Unreleased]: https://github.com/lambda-fairy/rust-errno/compare/v0.3.8...HEAD ++[0.3.8]: https://github.com/lambda-fairy/rust-errno/compare/v0.3.7...v0.3.8 ++[0.3.7]: https://github.com/lambda-fairy/rust-errno/compare/v0.3.6...v0.3.7 ++[0.3.6]: https://github.com/lambda-fairy/rust-errno/compare/v0.3.5...v0.3.6 ++[0.3.5]: https://github.com/lambda-fairy/rust-errno/compare/v0.3.4...v0.3.5 ++[0.3.4]: https://github.com/lambda-fairy/rust-errno/compare/v0.3.3...v0.3.4 ++[0.3.3]: https://github.com/lambda-fairy/rust-errno/compare/v0.3.2...v0.3.3 ++[0.3.2]: https://github.com/lambda-fairy/rust-errno/compare/v0.3.1...v0.3.2 ++[0.3.1]: https://github.com/lambda-fairy/rust-errno/compare/v0.3.0...v0.3.1 ++[0.3.0]: https://github.com/lambda-fairy/rust-errno/compare/v0.2.8...v0.3.0 ++[0.2.8]: https://github.com/lambda-fairy/rust-errno/compare/v0.2.7...v0.2.8 +diff -Nru mesa-25.3.3/subprojects/errno-0.3.8/clippy.toml mesa-25.3.3/subprojects/errno-0.3.8/clippy.toml +--- mesa-25.3.3/subprojects/errno-0.3.8/clippy.toml 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/errno-0.3.8/clippy.toml 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1 @@ ++msrv = "1.56" +diff -Nru mesa-25.3.3/subprojects/errno-0.3.8/debian/patches/no-windows.patch mesa-25.3.3/subprojects/errno-0.3.8/debian/patches/no-windows.patch +--- mesa-25.3.3/subprojects/errno-0.3.8/debian/patches/no-windows.patch 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/errno-0.3.8/debian/patches/no-windows.patch 2024-01-14 16:54:23.000000000 -0500 +@@ -0,0 +1,9 @@ ++--- a/Cargo.toml +++++ b/Cargo.toml ++@@ -45,6 +44,0 @@ ++-[target."cfg(windows)".dependencies.windows-sys] ++-version = "0.52" ++-features = [ ++- "Win32_Foundation", ++- "Win32_System_Diagnostics_Debug", ++-] +diff -Nru mesa-25.3.3/subprojects/errno-0.3.8/debian/patches/series mesa-25.3.3/subprojects/errno-0.3.8/debian/patches/series +--- mesa-25.3.3/subprojects/errno-0.3.8/debian/patches/series 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/errno-0.3.8/debian/patches/series 2024-01-14 16:54:23.000000000 -0500 +@@ -0,0 +1 @@ ++no-windows.patch +diff -Nru mesa-25.3.3/subprojects/errno-0.3.8/.github/dependabot.yml mesa-25.3.3/subprojects/errno-0.3.8/.github/dependabot.yml +--- mesa-25.3.3/subprojects/errno-0.3.8/.github/dependabot.yml 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/errno-0.3.8/.github/dependabot.yml 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,10 @@ ++version: 2 ++updates: ++ - package-ecosystem: "cargo" ++ directory: "/" ++ schedule: ++ interval: "weekly" ++ - package-ecosystem: "github-actions" ++ directory: "/" ++ schedule: ++ interval: "weekly" +diff -Nru mesa-25.3.3/subprojects/errno-0.3.8/.github/workflows/main.yml mesa-25.3.3/subprojects/errno-0.3.8/.github/workflows/main.yml +--- mesa-25.3.3/subprojects/errno-0.3.8/.github/workflows/main.yml 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/errno-0.3.8/.github/workflows/main.yml 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,68 @@ ++on: ++ push: ++ branches: ++ - main ++ pull_request: ++ schedule: ++ - cron: '5 21 * * 5' ++ workflow_dispatch: ++ ++name: CI ++ ++jobs: ++ test: ++ name: Test ++ runs-on: ${{ matrix.os }} ++ strategy: ++ matrix: ++ os: [ubuntu-latest, macos-latest, windows-latest] ++ rust: [stable, nightly, '1.56'] ++ steps: ++ - name: Checkout repository ++ uses: actions/checkout@v4 ++ - name: Install toolchain ++ uses: dtolnay/rust-toolchain@master ++ with: ++ toolchain: ${{ matrix.rust }} ++ - name: Setup cache ++ uses: Swatinem/rust-cache@v2 ++ - name: Test (no features) ++ run: cargo test --no-default-features ++ - name: Test (all features) ++ run: cargo test --all-features ++ ++ ++ wasi: ++ name: Test WASI ++ runs-on: ubuntu-latest ++ steps: ++ - name: Checkout repository ++ uses: actions/checkout@v4 ++ - name: Install toolchain ++ uses: dtolnay/rust-toolchain@nightly ++ with: ++ targets: wasm32-wasi ++ - name: Install wasmtime ++ run: | ++ curl https://wasmtime.dev/install.sh -sSf | bash ++ echo "$HOME/.wasmtime/bin" >> $GITHUB_PATH ++ - name: Test (no features) ++ run: CARGO_TARGET_WASM32_WASI_RUNNER=wasmtime cargo test --target wasm32-wasi --no-default-features ++ - name: Test (all features) ++ run: CARGO_TARGET_WASM32_WASI_RUNNER=wasmtime cargo test --target wasm32-wasi --all-features ++ ++ ++ lints: ++ name: Rustfmt & Clippy ++ runs-on: ubuntu-latest ++ steps: ++ - name: Checkout repository ++ uses: actions/checkout@v4 ++ - name: Install toolchain ++ uses: dtolnay/rust-toolchain@stable ++ with: ++ components: rustfmt, clippy ++ - name: Check formatting ++ run: cargo fmt --check ++ - name: Check clippy ++ run: cargo clippy -- -D warnings +diff -Nru mesa-25.3.3/subprojects/errno-0.3.8/.gitignore mesa-25.3.3/subprojects/errno-0.3.8/.gitignore +--- mesa-25.3.3/subprojects/errno-0.3.8/.gitignore 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/errno-0.3.8/.gitignore 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,2 @@ ++target ++Cargo.lock +diff -Nru mesa-25.3.3/subprojects/errno-0.3.8/LICENSE-APACHE mesa-25.3.3/subprojects/errno-0.3.8/LICENSE-APACHE +--- mesa-25.3.3/subprojects/errno-0.3.8/LICENSE-APACHE 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/errno-0.3.8/LICENSE-APACHE 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,201 @@ ++ Apache License ++ Version 2.0, January 2004 ++ http://www.apache.org/licenses/ ++ ++TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION ++ ++1. Definitions. ++ ++ "License" shall mean the terms and conditions for use, reproduction, ++ and distribution as defined by Sections 1 through 9 of this document. ++ ++ "Licensor" shall mean the copyright owner or entity authorized by ++ the copyright owner that is granting the License. ++ ++ "Legal Entity" shall mean the union of the acting entity and all ++ other entities that control, are controlled by, or are under common ++ control with that entity. For the purposes of this definition, ++ "control" means (i) the power, direct or indirect, to cause the ++ direction or management of such entity, whether by contract or ++ otherwise, or (ii) ownership of fifty percent (50%) or more of the ++ outstanding shares, or (iii) beneficial ownership of such entity. ++ ++ "You" (or "Your") shall mean an individual or Legal Entity ++ exercising permissions granted by this License. ++ ++ "Source" form shall mean the preferred form for making modifications, ++ including but not limited to software source code, documentation ++ source, and configuration files. ++ ++ "Object" form shall mean any form resulting from mechanical ++ transformation or translation of a Source form, including but ++ not limited to compiled object code, generated documentation, ++ and conversions to other media types. ++ ++ "Work" shall mean the work of authorship, whether in Source or ++ Object form, made available under the License, as indicated by a ++ copyright notice that is included in or attached to the work ++ (an example is provided in the Appendix below). ++ ++ "Derivative Works" shall mean any work, whether in Source or Object ++ form, that is based on (or derived from) the Work and for which the ++ editorial revisions, annotations, elaborations, or other modifications ++ represent, as a whole, an original work of authorship. For the purposes ++ of this License, Derivative Works shall not include works that remain ++ separable from, or merely link (or bind by name) to the interfaces of, ++ the Work and Derivative Works thereof. ++ ++ "Contribution" shall mean any work of authorship, including ++ the original version of the Work and any modifications or additions ++ to that Work or Derivative Works thereof, that is intentionally ++ submitted to Licensor for inclusion in the Work by the copyright owner ++ or by an individual or Legal Entity authorized to submit on behalf of ++ the copyright owner. For the purposes of this definition, "submitted" ++ means any form of electronic, verbal, or written communication sent ++ to the Licensor or its representatives, including but not limited to ++ communication on electronic mailing lists, source code control systems, ++ and issue tracking systems that are managed by, or on behalf of, the ++ Licensor for the purpose of discussing and improving the Work, but ++ excluding communication that is conspicuously marked or otherwise ++ designated in writing by the copyright owner as "Not a Contribution." ++ ++ "Contributor" shall mean Licensor and any individual or Legal Entity ++ on behalf of whom a Contribution has been received by Licensor and ++ subsequently incorporated within the Work. ++ ++2. Grant of Copyright License. Subject to the terms and conditions of ++ this License, each Contributor hereby grants to You a perpetual, ++ worldwide, non-exclusive, no-charge, royalty-free, irrevocable ++ copyright license to reproduce, prepare Derivative Works of, ++ publicly display, publicly perform, sublicense, and distribute the ++ Work and such Derivative Works in Source or Object form. ++ ++3. Grant of Patent License. Subject to the terms and conditions of ++ this License, each Contributor hereby grants to You a perpetual, ++ worldwide, non-exclusive, no-charge, royalty-free, irrevocable ++ (except as stated in this section) patent license to make, have made, ++ use, offer to sell, sell, import, and otherwise transfer the Work, ++ where such license applies only to those patent claims licensable ++ by such Contributor that are necessarily infringed by their ++ Contribution(s) alone or by combination of their Contribution(s) ++ with the Work to which such Contribution(s) was submitted. If You ++ institute patent litigation against any entity (including a ++ cross-claim or counterclaim in a lawsuit) alleging that the Work ++ or a Contribution incorporated within the Work constitutes direct ++ or contributory patent infringement, then any patent licenses ++ granted to You under this License for that Work shall terminate ++ as of the date such litigation is filed. ++ ++4. Redistribution. You may reproduce and distribute copies of the ++ Work or Derivative Works thereof in any medium, with or without ++ modifications, and in Source or Object form, provided that You ++ meet the following conditions: ++ ++ (a) You must give any other recipients of the Work or ++ Derivative Works a copy of this License; and ++ ++ (b) You must cause any modified files to carry prominent notices ++ stating that You changed the files; and ++ ++ (c) You must retain, in the Source form of any Derivative Works ++ that You distribute, all copyright, patent, trademark, and ++ attribution notices from the Source form of the Work, ++ excluding those notices that do not pertain to any part of ++ the Derivative Works; and ++ ++ (d) If the Work includes a "NOTICE" text file as part of its ++ distribution, then any Derivative Works that You distribute must ++ include a readable copy of the attribution notices contained ++ within such NOTICE file, excluding those notices that do not ++ pertain to any part of the Derivative Works, in at least one ++ of the following places: within a NOTICE text file distributed ++ as part of the Derivative Works; within the Source form or ++ documentation, if provided along with the Derivative Works; or, ++ within a display generated by the Derivative Works, if and ++ wherever such third-party notices normally appear. The contents ++ of the NOTICE file are for informational purposes only and ++ do not modify the License. You may add Your own attribution ++ notices within Derivative Works that You distribute, alongside ++ or as an addendum to the NOTICE text from the Work, provided ++ that such additional attribution notices cannot be construed ++ as modifying the License. ++ ++ You may add Your own copyright statement to Your modifications and ++ may provide additional or different license terms and conditions ++ for use, reproduction, or distribution of Your modifications, or ++ for any such Derivative Works as a whole, provided Your use, ++ reproduction, and distribution of the Work otherwise complies with ++ the conditions stated in this License. ++ ++5. Submission of Contributions. Unless You explicitly state otherwise, ++ any Contribution intentionally submitted for inclusion in the Work ++ by You to the Licensor shall be under the terms and conditions of ++ this License, without any additional terms or conditions. ++ Notwithstanding the above, nothing herein shall supersede or modify ++ the terms of any separate license agreement you may have executed ++ with Licensor regarding such Contributions. ++ ++6. Trademarks. This License does not grant permission to use the trade ++ names, trademarks, service marks, or product names of the Licensor, ++ except as required for reasonable and customary use in describing the ++ origin of the Work and reproducing the content of the NOTICE file. ++ ++7. Disclaimer of Warranty. Unless required by applicable law or ++ agreed to in writing, Licensor provides the Work (and each ++ Contributor provides its Contributions) on an "AS IS" BASIS, ++ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or ++ implied, including, without limitation, any warranties or conditions ++ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A ++ PARTICULAR PURPOSE. You are solely responsible for determining the ++ appropriateness of using or redistributing the Work and assume any ++ risks associated with Your exercise of permissions under this License. ++ ++8. Limitation of Liability. In no event and under no legal theory, ++ whether in tort (including negligence), contract, or otherwise, ++ unless required by applicable law (such as deliberate and grossly ++ negligent acts) or agreed to in writing, shall any Contributor be ++ liable to You for damages, including any direct, indirect, special, ++ incidental, or consequential damages of any character arising as a ++ result of this License or out of the use or inability to use the ++ Work (including but not limited to damages for loss of goodwill, ++ work stoppage, computer failure or malfunction, or any and all ++ other commercial damages or losses), even if such Contributor ++ has been advised of the possibility of such damages. ++ ++9. Accepting Warranty or Additional Liability. While redistributing ++ the Work or Derivative Works thereof, You may choose to offer, ++ and charge a fee for, acceptance of support, warranty, indemnity, ++ or other liability obligations and/or rights consistent with this ++ License. However, in accepting such obligations, You may act only ++ on Your own behalf and on Your sole responsibility, not on behalf ++ of any other Contributor, and only if You agree to indemnify, ++ defend, and hold each Contributor harmless for any liability ++ incurred by, or claims asserted against, such Contributor by reason ++ of your accepting any such warranty or additional liability. ++ ++END OF TERMS AND CONDITIONS ++ ++APPENDIX: How to apply the Apache License to your work. ++ ++ To apply the Apache License to your work, attach the following ++ boilerplate notice, with the fields enclosed by brackets "[]" ++ replaced with your own identifying information. (Don't include ++ the brackets!) The text should be enclosed in the appropriate ++ comment syntax for the file format. We also recommend that a ++ file or class name and description of purpose be included on the ++ same "printed page" as the copyright notice for easier ++ identification within third-party archives. ++ ++Copyright [yyyy] [name of copyright owner] ++ ++Licensed under the Apache License, Version 2.0 (the "License"); ++you may not use this file except in compliance with the License. ++You may obtain a copy of the License at ++ ++ http://www.apache.org/licenses/LICENSE-2.0 ++ ++Unless required by applicable law or agreed to in writing, software ++distributed under the License is distributed on an "AS IS" BASIS, ++WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++See the License for the specific language governing permissions and ++limitations under the License. +diff -Nru mesa-25.3.3/subprojects/errno-0.3.8/LICENSE-MIT mesa-25.3.3/subprojects/errno-0.3.8/LICENSE-MIT +--- mesa-25.3.3/subprojects/errno-0.3.8/LICENSE-MIT 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/errno-0.3.8/LICENSE-MIT 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,25 @@ ++Copyright (c) 2014 Chris Wong ++ ++Permission is hereby granted, free of charge, to any ++person obtaining a copy of this software and associated ++documentation files (the "Software"), to deal in the ++Software without restriction, including without ++limitation the rights to use, copy, modify, merge, ++publish, distribute, sublicense, and/or sell copies of ++the Software, and to permit persons to whom the Software ++is furnished to do so, subject to the following ++conditions: ++ ++The above copyright notice and this permission notice ++shall be included in all copies or substantial portions ++of the Software. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ++ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED ++TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A ++PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT ++SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ++CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION ++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR ++IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ++DEALINGS IN THE SOFTWARE. +diff -Nru mesa-25.3.3/subprojects/errno-0.3.8/meson.build mesa-25.3.3/subprojects/errno-0.3.8/meson.build +--- mesa-25.3.3/subprojects/errno-0.3.8/meson.build 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/errno-0.3.8/meson.build 2026-05-27 11:35:49.000000000 -0500 +@@ -0,0 +1,19 @@ ++# Copyright © 2025 Google ++# SPDX-License-Identifier: MIT ++ ++project('errno', 'rust', version : '0.3.8', license : 'MIT OR Apache-2.0') ++ ++libc = subproject('libc-0.2-rs').get_variable('lib') ++ ++lib = static_library( ++ 'libc_errno', ++ 'src/lib.rs', ++ override_options : ['rust_std=2018', 'build.rust_std=2018'], ++ link_with: [libc], ++ rust_abi : 'rust', ++ native : true, ++) ++ ++dep_errno = declare_dependency( ++ link_with : [lib] ++) +diff -Nru mesa-25.3.3/subprojects/errno-0.3.8/.meson-subproject-wrap-hash.txt mesa-25.3.3/subprojects/errno-0.3.8/.meson-subproject-wrap-hash.txt +--- mesa-25.3.3/subprojects/errno-0.3.8/.meson-subproject-wrap-hash.txt 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/errno-0.3.8/.meson-subproject-wrap-hash.txt 2026-05-29 13:40:52.000000000 -0500 +@@ -0,0 +1 @@ ++c66ec95a19157f20916809a82379f5cb92af43a698b81f6a8c3d8a470be695b9 +diff -Nru mesa-25.3.3/subprojects/errno-0.3.8/README.md mesa-25.3.3/subprojects/errno-0.3.8/README.md +--- mesa-25.3.3/subprojects/errno-0.3.8/README.md 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/errno-0.3.8/README.md 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,62 @@ ++# errno [![CI](https://github.com/lambda-fairy/rust-errno/actions/workflows/main.yml/badge.svg)](https://github.com/lambda-fairy/rust-errno/actions/workflows/main.yml) [![Cargo](https://img.shields.io/crates/v/errno.svg)](https://crates.io/crates/errno) ++ ++Cross-platform interface to the [`errno`][errno] variable. Works on Rust 1.56 or newer. ++ ++Documentation is available at . ++ ++[errno]: https://en.wikipedia.org/wiki/Errno.h ++ ++ ++## Dependency ++ ++Add to your `Cargo.toml`: ++ ++```toml ++[dependencies] ++errno = "*" ++``` ++ ++ ++## Comparison with `std::io::Error` ++ ++The standard library provides [`Error::last_os_error`][last_os_error] which fetches `errno` in the same way. ++ ++This crate provides these extra features: ++ ++- No heap allocations ++- Optional `#![no_std]` support ++- A `set_errno` function ++ ++[last_os_error]: https://doc.rust-lang.org/std/io/struct.Error.html#method.last_os_error ++ ++ ++## Examples ++ ++```rust ++extern crate errno; ++use errno::{Errno, errno, set_errno}; ++ ++// Get the current value of errno ++let e = errno(); ++ ++// Set the current value of errno ++set_errno(e); ++ ++// Extract the error code as an i32 ++let code = e.0; ++ ++// Display a human-friendly error message ++println!("Error {}: {}", code, e); ++``` ++ ++ ++## `#![no_std]` ++ ++Enable `#![no_std]` support by disabling the default `std` feature: ++ ++```toml ++[dependencies] ++errno = { version = "*", default-features = false } ++``` ++ ++The `Error` impl will be unavailable. +diff -Nru mesa-25.3.3/subprojects/errno-0.3.8/src/hermit.rs mesa-25.3.3/subprojects/errno-0.3.8/src/hermit.rs +--- mesa-25.3.3/subprojects/errno-0.3.8/src/hermit.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/errno-0.3.8/src/hermit.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,32 @@ ++//! Implementation of `errno` functionality for RustyHermit. ++//! ++//! Currently, the error handling in RustyHermit isn't clearly ++//! defined. At the current stage of RustyHermit, only a placeholder ++//! is provided to be compatible to the classical errno interface. ++ ++// Copyright 2015 The Rust Project Developers. See the COPYRIGHT ++// file at the top-level directory of this distribution and at ++// http://rust-lang.org/COPYRIGHT. ++// ++// Licensed under the Apache License, Version 2.0 or the MIT license ++// , at your ++// option. This file may not be copied, modified, or distributed ++// except according to those terms. ++ ++use crate::Errno; ++ ++pub fn with_description(_err: Errno, callback: F) -> T ++where ++ F: FnOnce(Result<&str, Errno>) -> T, ++{ ++ callback(Ok("unknown error")) ++} ++ ++pub const STRERROR_NAME: &str = "strerror_r"; ++ ++pub fn errno() -> Errno { ++ Errno(0) ++} ++ ++pub fn set_errno(_: Errno) {} +diff -Nru mesa-25.3.3/subprojects/errno-0.3.8/src/lib.rs mesa-25.3.3/subprojects/errno-0.3.8/src/lib.rs +--- mesa-25.3.3/subprojects/errno-0.3.8/src/lib.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/errno-0.3.8/src/lib.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,156 @@ ++//! Cross-platform interface to the `errno` variable. ++//! ++//! # Examples ++//! ``` ++//! use errno::{Errno, errno, set_errno}; ++//! ++//! // Get the current value of errno ++//! let e = errno(); ++//! ++//! // Set the current value of errno ++//! set_errno(e); ++//! ++//! // Extract the error code as an i32 ++//! let code = e.0; ++//! ++//! // Display a human-friendly error message ++//! println!("Error {}: {}", code, e); ++//! ``` ++ ++#![cfg_attr(not(feature = "std"), no_std)] ++ ++#[cfg_attr(unix, path = "unix.rs")] ++#[cfg_attr(windows, path = "windows.rs")] ++#[cfg_attr(target_os = "wasi", path = "wasi.rs")] ++#[cfg_attr(target_os = "hermit", path = "hermit.rs")] ++mod sys; ++ ++use core::fmt; ++#[cfg(feature = "std")] ++use std::error::Error; ++#[cfg(feature = "std")] ++use std::io; ++ ++/// Wraps a platform-specific error code. ++/// ++/// The `Display` instance maps the code to a human-readable string. It ++/// calls [`strerror_r`][1] under POSIX, and [`FormatMessageW`][2] on ++/// Windows. ++/// ++/// [1]: http://pubs.opengroup.org/onlinepubs/009695399/functions/strerror.html ++/// [2]: https://msdn.microsoft.com/en-us/library/windows/desktop/ms679351%28v=vs.85%29.aspx ++#[derive(Copy, Clone, Eq, Ord, PartialEq, PartialOrd, Hash)] ++pub struct Errno(pub i32); ++ ++impl fmt::Debug for Errno { ++ fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { ++ sys::with_description(*self, |desc| { ++ fmt.debug_struct("Errno") ++ .field("code", &self.0) ++ .field("description", &desc.ok()) ++ .finish() ++ }) ++ } ++} ++ ++impl fmt::Display for Errno { ++ fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { ++ sys::with_description(*self, |desc| match desc { ++ Ok(desc) => fmt.write_str(desc), ++ Err(fm_err) => write!( ++ fmt, ++ "OS error {} ({} returned error {})", ++ self.0, ++ sys::STRERROR_NAME, ++ fm_err.0 ++ ), ++ }) ++ } ++} ++ ++impl From for i32 { ++ fn from(e: Errno) -> Self { ++ e.0 ++ } ++} ++ ++#[cfg(feature = "std")] ++impl Error for Errno { ++ // TODO: Remove when MSRV >= 1.27 ++ #[allow(deprecated)] ++ fn description(&self) -> &str { ++ "system error" ++ } ++} ++ ++#[cfg(feature = "std")] ++impl From for io::Error { ++ fn from(errno: Errno) -> Self { ++ io::Error::from_raw_os_error(errno.0) ++ } ++} ++ ++/// Returns the platform-specific value of `errno`. ++pub fn errno() -> Errno { ++ sys::errno() ++} ++ ++/// Sets the platform-specific value of `errno`. ++pub fn set_errno(err: Errno) { ++ sys::set_errno(err) ++} ++ ++#[test] ++fn it_works() { ++ let x = errno(); ++ set_errno(x); ++} ++ ++#[cfg(feature = "std")] ++#[test] ++fn it_works_with_to_string() { ++ let x = errno(); ++ let _ = x.to_string(); ++} ++ ++#[cfg(feature = "std")] ++#[test] ++fn check_description() { ++ let expect = if cfg!(windows) { ++ "Incorrect function." ++ } else if cfg!(target_os = "illumos") { ++ "Not owner" ++ } else if cfg!(target_os = "wasi") { ++ "Argument list too long" ++ } else if cfg!(target_os = "haiku") { ++ "Operation not allowed" ++ } else { ++ "Operation not permitted" ++ }; ++ ++ let errno_code = if cfg!(target_os = "haiku") { ++ -2147483633 ++ } else { ++ 1 ++ }; ++ set_errno(Errno(errno_code)); ++ ++ assert_eq!(errno().to_string(), expect); ++ assert_eq!( ++ format!("{:?}", errno()), ++ format!( ++ "Errno {{ code: {}, description: Some({:?}) }}", ++ errno_code, expect ++ ) ++ ); ++} ++ ++#[cfg(feature = "std")] ++#[test] ++fn check_error_into_errno() { ++ const ERROR_CODE: i32 = 1; ++ ++ let error = io::Error::from_raw_os_error(ERROR_CODE); ++ let new_error: io::Error = Errno(ERROR_CODE).into(); ++ assert_eq!(error.kind(), new_error.kind()); ++} +diff -Nru mesa-25.3.3/subprojects/errno-0.3.8/src/unix.rs mesa-25.3.3/subprojects/errno-0.3.8/src/unix.rs +--- mesa-25.3.3/subprojects/errno-0.3.8/src/unix.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/errno-0.3.8/src/unix.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,101 @@ ++//! Implementation of `errno` functionality for Unix systems. ++//! ++//! Adapted from `src/libstd/sys/unix/os.rs` in the Rust distribution. ++ ++// Copyright 2015 The Rust Project Developers. See the COPYRIGHT ++// file at the top-level directory of this distribution and at ++// http://rust-lang.org/COPYRIGHT. ++// ++// Licensed under the Apache License, Version 2.0 or the MIT license ++// , at your ++// option. This file may not be copied, modified, or distributed ++// except according to those terms. ++ ++use core::str; ++use libc::{self, c_int, size_t, strerror_r, strlen}; ++ ++use crate::Errno; ++ ++fn from_utf8_lossy(input: &[u8]) -> &str { ++ match str::from_utf8(input) { ++ Ok(valid) => valid, ++ Err(error) => unsafe { str::from_utf8_unchecked(&input[..error.valid_up_to()]) }, ++ } ++} ++ ++pub fn with_description(err: Errno, callback: F) -> T ++where ++ F: FnOnce(Result<&str, Errno>) -> T, ++{ ++ let mut buf = [0u8; 1024]; ++ let c_str = unsafe { ++ let rc = strerror_r(err.0, buf.as_mut_ptr() as *mut _, buf.len() as size_t); ++ if rc != 0 { ++ // Handle negative return codes for compatibility with glibc < 2.13 ++ let fm_err = match rc < 0 { ++ true => errno(), ++ false => Errno(rc), ++ }; ++ if fm_err != Errno(libc::ERANGE) { ++ return callback(Err(fm_err)); ++ } ++ } ++ let c_str_len = strlen(buf.as_ptr() as *const _); ++ &buf[..c_str_len] ++ }; ++ callback(Ok(from_utf8_lossy(c_str))) ++} ++ ++pub const STRERROR_NAME: &str = "strerror_r"; ++ ++pub fn errno() -> Errno { ++ unsafe { Errno(*errno_location()) } ++} ++ ++pub fn set_errno(Errno(errno): Errno) { ++ unsafe { ++ *errno_location() = errno; ++ } ++} ++ ++extern "C" { ++ #[cfg_attr( ++ any( ++ target_os = "macos", ++ target_os = "ios", ++ target_os = "tvos", ++ target_os = "watchos", ++ target_os = "freebsd" ++ ), ++ link_name = "__error" ++ )] ++ #[cfg_attr( ++ any( ++ target_os = "openbsd", ++ target_os = "netbsd", ++ target_os = "bitrig", ++ target_os = "android", ++ target_os = "espidf", ++ target_env = "newlib" ++ ), ++ link_name = "__errno" ++ )] ++ #[cfg_attr( ++ any(target_os = "solaris", target_os = "illumos"), ++ link_name = "___errno" ++ )] ++ #[cfg_attr(target_os = "haiku", link_name = "_errnop")] ++ #[cfg_attr( ++ any( ++ target_os = "linux", ++ target_os = "hurd", ++ target_os = "redox", ++ target_os = "dragonfly" ++ ), ++ link_name = "__errno_location" ++ )] ++ #[cfg_attr(target_os = "aix", link_name = "_Errno")] ++ #[cfg_attr(target_os = "nto", link_name = "__get_errno_ptr")] ++ fn errno_location() -> *mut c_int; ++} +diff -Nru mesa-25.3.3/subprojects/errno-0.3.8/src/wasi.rs mesa-25.3.3/subprojects/errno-0.3.8/src/wasi.rs +--- mesa-25.3.3/subprojects/errno-0.3.8/src/wasi.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/errno-0.3.8/src/wasi.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,60 @@ ++//! Implementation of `errno` functionality for WASI. ++//! ++//! Adapted from `unix.rs`. ++ ++// Copyright 2015 The Rust Project Developers. See the COPYRIGHT ++// file at the top-level directory of this distribution and at ++// http://rust-lang.org/COPYRIGHT. ++// ++// Licensed under the Apache License, Version 2.0 or the MIT license ++// , at your ++// option. This file may not be copied, modified, or distributed ++// except according to those terms. ++ ++use core::str; ++use libc::{self, c_int, size_t, strerror_r, strlen}; ++ ++use crate::Errno; ++ ++fn from_utf8_lossy(input: &[u8]) -> &str { ++ match str::from_utf8(input) { ++ Ok(valid) => valid, ++ Err(error) => unsafe { str::from_utf8_unchecked(&input[..error.valid_up_to()]) }, ++ } ++} ++ ++pub fn with_description(err: Errno, callback: F) -> T ++where ++ F: FnOnce(Result<&str, Errno>) -> T, ++{ ++ let mut buf = [0u8; 1024]; ++ let c_str = unsafe { ++ let rc = strerror_r(err.0, buf.as_mut_ptr() as *mut _, buf.len() as size_t); ++ if rc != 0 { ++ let fm_err = Errno(rc); ++ if fm_err != Errno(libc::ERANGE) { ++ return callback(Err(fm_err)); ++ } ++ } ++ let c_str_len = strlen(buf.as_ptr() as *const _); ++ &buf[..c_str_len] ++ }; ++ callback(Ok(from_utf8_lossy(c_str))) ++} ++ ++pub const STRERROR_NAME: &str = "strerror_r"; ++ ++pub fn errno() -> Errno { ++ unsafe { Errno(*__errno_location()) } ++} ++ ++pub fn set_errno(Errno(new_errno): Errno) { ++ unsafe { ++ *__errno_location() = new_errno; ++ } ++} ++ ++extern "C" { ++ fn __errno_location() -> *mut c_int; ++} +diff -Nru mesa-25.3.3/subprojects/errno-0.3.8/src/windows.rs mesa-25.3.3/subprojects/errno-0.3.8/src/windows.rs +--- mesa-25.3.3/subprojects/errno-0.3.8/src/windows.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/errno-0.3.8/src/windows.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,81 @@ ++//! Implementation of `errno` functionality for Windows. ++//! ++//! Adapted from `src/libstd/sys/windows/os.rs` in the Rust distribution. ++ ++// Copyright 2014 The Rust Project Developers. See the COPYRIGHT ++// file at the top-level directory of this distribution and at ++// http://rust-lang.org/COPYRIGHT. ++// ++// Licensed under the Apache License, Version 2.0 or the MIT license ++// , at your ++// option. This file may not be copied, modified, or distributed ++// except according to those terms. ++ ++use core::char::{self, REPLACEMENT_CHARACTER}; ++use core::ptr; ++use core::str; ++use windows_sys::Win32::Foundation::{GetLastError, SetLastError, WIN32_ERROR}; ++use windows_sys::Win32::System::Diagnostics::Debug::{ ++ FormatMessageW, FORMAT_MESSAGE_FROM_SYSTEM, FORMAT_MESSAGE_IGNORE_INSERTS, ++}; ++ ++use crate::Errno; ++ ++fn from_utf16_lossy<'a>(input: &[u16], output: &'a mut [u8]) -> &'a str { ++ let mut output_len = 0; ++ for c in char::decode_utf16(input.iter().copied().take_while(|&x| x != 0)) ++ .map(|x| x.unwrap_or(REPLACEMENT_CHARACTER)) ++ { ++ let c_len = c.len_utf8(); ++ if c_len > output.len() - output_len { ++ break; ++ } ++ c.encode_utf8(&mut output[output_len..]); ++ output_len += c_len; ++ } ++ unsafe { str::from_utf8_unchecked(&output[..output_len]) } ++} ++ ++pub fn with_description(err: Errno, callback: F) -> T ++where ++ F: FnOnce(Result<&str, Errno>) -> T, ++{ ++ // This value is calculated from the macro ++ // MAKELANGID(LANG_SYSTEM_DEFAULT, SUBLANG_SYS_DEFAULT) ++ let lang_id = 0x0800_u32; ++ ++ let mut buf = [0u16; 2048]; ++ ++ unsafe { ++ let res = FormatMessageW( ++ FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, ++ ptr::null_mut(), ++ err.0 as u32, ++ lang_id, ++ buf.as_mut_ptr(), ++ buf.len() as u32, ++ ptr::null_mut(), ++ ); ++ if res == 0 { ++ // Sometimes FormatMessageW can fail e.g. system doesn't like lang_id ++ let fm_err = errno(); ++ return callback(Err(fm_err)); ++ } ++ ++ let mut msg = [0u8; 2048]; ++ let msg = from_utf16_lossy(&buf[..res as usize], &mut msg[..]); ++ // Trim trailing CRLF inserted by FormatMessageW ++ callback(Ok(msg.trim_end())) ++ } ++} ++ ++pub const STRERROR_NAME: &str = "FormatMessageW"; ++ ++pub fn errno() -> Errno { ++ unsafe { Errno(GetLastError() as i32) } ++} ++ ++pub fn set_errno(Errno(errno): Errno) { ++ unsafe { SetLastError(errno as WIN32_ERROR) } ++} +diff -Nru mesa-25.3.3/subprojects/errno-0.3-rs.wrap mesa-25.3.3/subprojects/errno-0.3-rs.wrap +--- mesa-25.3.3/subprojects/errno-0.3-rs.wrap 2026-01-01 13:34:04.000000000 -0500 ++++ mesa-25.3.3/subprojects/errno-0.3-rs.wrap 2026-05-29 13:40:52.000000000 -0500 +@@ -1,6 +1,4 @@ + [wrap-file] +-directory = errno-0.3.12 +-source_url = https://crates.io/api/v1/crates/errno/0.3.12/download +-source_filename = errno-0.3.12.tar.gz +-source_hash = cea14ef9355e3beab063703aa9dab15afd25f0667c341310c1e5274bb1d0da18 ++directory = errno-0.3.8 + patch_directory = errno-0.3-rs ++ +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/benches/bench.rs mesa-25.3.3/subprojects/hashbrown-0.14.5/benches/bench.rs +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/benches/bench.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/benches/bench.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,331 @@ ++// This benchmark suite contains some benchmarks along a set of dimensions: ++// Hasher: std default (SipHash) and crate default (AHash). ++// Int key distribution: low bit heavy, top bit heavy, and random. ++// Task: basic functionality: insert, insert_erase, lookup, lookup_fail, iter ++#![feature(test)] ++ ++extern crate test; ++ ++use test::{black_box, Bencher}; ++ ++use hashbrown::hash_map::DefaultHashBuilder; ++use hashbrown::{HashMap, HashSet}; ++use std::{ ++ collections::hash_map::RandomState, ++ sync::atomic::{self, AtomicUsize}, ++}; ++ ++const SIZE: usize = 1000; ++ ++// The default hashmap when using this crate directly. ++type AHashMap = HashMap; ++// This uses the hashmap from this crate with the default hasher of the stdlib. ++type StdHashMap = HashMap; ++ ++// A random key iterator. ++#[derive(Clone, Copy)] ++struct RandomKeys { ++ state: usize, ++} ++ ++impl RandomKeys { ++ fn new() -> Self { ++ RandomKeys { state: 0 } ++ } ++} ++ ++impl Iterator for RandomKeys { ++ type Item = usize; ++ fn next(&mut self) -> Option { ++ // Add 1 then multiply by some 32 bit prime. ++ self.state = self.state.wrapping_add(1).wrapping_mul(3_787_392_781); ++ Some(self.state) ++ } ++} ++ ++// Just an arbitrary side effect to make the maps not shortcircuit to the non-dropping path ++// when dropping maps/entries (most real world usages likely have drop in the key or value) ++lazy_static::lazy_static! { ++ static ref SIDE_EFFECT: AtomicUsize = AtomicUsize::new(0); ++} ++ ++#[derive(Clone)] ++struct DropType(usize); ++impl Drop for DropType { ++ fn drop(&mut self) { ++ SIDE_EFFECT.fetch_add(self.0, atomic::Ordering::SeqCst); ++ } ++} ++ ++macro_rules! bench_suite { ++ ($bench_macro:ident, $bench_ahash_serial:ident, $bench_std_serial:ident, ++ $bench_ahash_highbits:ident, $bench_std_highbits:ident, ++ $bench_ahash_random:ident, $bench_std_random:ident) => { ++ $bench_macro!($bench_ahash_serial, AHashMap, 0..); ++ $bench_macro!($bench_std_serial, StdHashMap, 0..); ++ $bench_macro!( ++ $bench_ahash_highbits, ++ AHashMap, ++ (0..).map(usize::swap_bytes) ++ ); ++ $bench_macro!( ++ $bench_std_highbits, ++ StdHashMap, ++ (0..).map(usize::swap_bytes) ++ ); ++ $bench_macro!($bench_ahash_random, AHashMap, RandomKeys::new()); ++ $bench_macro!($bench_std_random, StdHashMap, RandomKeys::new()); ++ }; ++} ++ ++macro_rules! bench_insert { ++ ($name:ident, $maptype:ident, $keydist:expr) => { ++ #[bench] ++ fn $name(b: &mut Bencher) { ++ let mut m = $maptype::with_capacity_and_hasher(SIZE, Default::default()); ++ b.iter(|| { ++ m.clear(); ++ for i in ($keydist).take(SIZE) { ++ m.insert(i, (DropType(i), [i; 20])); ++ } ++ black_box(&mut m); ++ }); ++ eprintln!("{}", SIDE_EFFECT.load(atomic::Ordering::SeqCst)); ++ } ++ }; ++} ++ ++bench_suite!( ++ bench_insert, ++ insert_ahash_serial, ++ insert_std_serial, ++ insert_ahash_highbits, ++ insert_std_highbits, ++ insert_ahash_random, ++ insert_std_random ++); ++ ++macro_rules! bench_grow_insert { ++ ($name:ident, $maptype:ident, $keydist:expr) => { ++ #[bench] ++ fn $name(b: &mut Bencher) { ++ b.iter(|| { ++ let mut m = $maptype::default(); ++ for i in ($keydist).take(SIZE) { ++ m.insert(i, DropType(i)); ++ } ++ black_box(&mut m); ++ }) ++ } ++ }; ++} ++ ++bench_suite!( ++ bench_grow_insert, ++ grow_insert_ahash_serial, ++ grow_insert_std_serial, ++ grow_insert_ahash_highbits, ++ grow_insert_std_highbits, ++ grow_insert_ahash_random, ++ grow_insert_std_random ++); ++ ++macro_rules! bench_insert_erase { ++ ($name:ident, $maptype:ident, $keydist:expr) => { ++ #[bench] ++ fn $name(b: &mut Bencher) { ++ let mut base = $maptype::default(); ++ for i in ($keydist).take(SIZE) { ++ base.insert(i, DropType(i)); ++ } ++ let skip = $keydist.skip(SIZE); ++ b.iter(|| { ++ let mut m = base.clone(); ++ let mut add_iter = skip.clone(); ++ let mut remove_iter = $keydist; ++ // While keeping the size constant, ++ // replace the first keydist with the second. ++ for (add, remove) in (&mut add_iter).zip(&mut remove_iter).take(SIZE) { ++ m.insert(add, DropType(add)); ++ black_box(m.remove(&remove)); ++ } ++ black_box(m); ++ }); ++ eprintln!("{}", SIDE_EFFECT.load(atomic::Ordering::SeqCst)); ++ } ++ }; ++} ++ ++bench_suite!( ++ bench_insert_erase, ++ insert_erase_ahash_serial, ++ insert_erase_std_serial, ++ insert_erase_ahash_highbits, ++ insert_erase_std_highbits, ++ insert_erase_ahash_random, ++ insert_erase_std_random ++); ++ ++macro_rules! bench_lookup { ++ ($name:ident, $maptype:ident, $keydist:expr) => { ++ #[bench] ++ fn $name(b: &mut Bencher) { ++ let mut m = $maptype::default(); ++ for i in $keydist.take(SIZE) { ++ m.insert(i, DropType(i)); ++ } ++ ++ b.iter(|| { ++ for i in $keydist.take(SIZE) { ++ black_box(m.get(&i)); ++ } ++ }); ++ eprintln!("{}", SIDE_EFFECT.load(atomic::Ordering::SeqCst)); ++ } ++ }; ++} ++ ++bench_suite!( ++ bench_lookup, ++ lookup_ahash_serial, ++ lookup_std_serial, ++ lookup_ahash_highbits, ++ lookup_std_highbits, ++ lookup_ahash_random, ++ lookup_std_random ++); ++ ++macro_rules! bench_lookup_fail { ++ ($name:ident, $maptype:ident, $keydist:expr) => { ++ #[bench] ++ fn $name(b: &mut Bencher) { ++ let mut m = $maptype::default(); ++ let mut iter = $keydist; ++ for i in (&mut iter).take(SIZE) { ++ m.insert(i, DropType(i)); ++ } ++ ++ b.iter(|| { ++ for i in (&mut iter).take(SIZE) { ++ black_box(m.get(&i)); ++ } ++ }) ++ } ++ }; ++} ++ ++bench_suite!( ++ bench_lookup_fail, ++ lookup_fail_ahash_serial, ++ lookup_fail_std_serial, ++ lookup_fail_ahash_highbits, ++ lookup_fail_std_highbits, ++ lookup_fail_ahash_random, ++ lookup_fail_std_random ++); ++ ++macro_rules! bench_iter { ++ ($name:ident, $maptype:ident, $keydist:expr) => { ++ #[bench] ++ fn $name(b: &mut Bencher) { ++ let mut m = $maptype::default(); ++ for i in ($keydist).take(SIZE) { ++ m.insert(i, DropType(i)); ++ } ++ ++ b.iter(|| { ++ for i in &m { ++ black_box(i); ++ } ++ }) ++ } ++ }; ++} ++ ++bench_suite!( ++ bench_iter, ++ iter_ahash_serial, ++ iter_std_serial, ++ iter_ahash_highbits, ++ iter_std_highbits, ++ iter_ahash_random, ++ iter_std_random ++); ++ ++#[bench] ++fn clone_small(b: &mut Bencher) { ++ let mut m = HashMap::new(); ++ for i in 0..10 { ++ m.insert(i, DropType(i)); ++ } ++ ++ b.iter(|| { ++ black_box(m.clone()); ++ }) ++} ++ ++#[bench] ++fn clone_from_small(b: &mut Bencher) { ++ let mut m = HashMap::new(); ++ let mut m2 = HashMap::new(); ++ for i in 0..10 { ++ m.insert(i, DropType(i)); ++ } ++ ++ b.iter(|| { ++ m2.clone_from(&m); ++ black_box(&mut m2); ++ }) ++} ++ ++#[bench] ++fn clone_large(b: &mut Bencher) { ++ let mut m = HashMap::new(); ++ for i in 0..1000 { ++ m.insert(i, DropType(i)); ++ } ++ ++ b.iter(|| { ++ black_box(m.clone()); ++ }) ++} ++ ++#[bench] ++fn clone_from_large(b: &mut Bencher) { ++ let mut m = HashMap::new(); ++ let mut m2 = HashMap::new(); ++ for i in 0..1000 { ++ m.insert(i, DropType(i)); ++ } ++ ++ b.iter(|| { ++ m2.clone_from(&m); ++ black_box(&mut m2); ++ }) ++} ++ ++#[bench] ++fn rehash_in_place(b: &mut Bencher) { ++ b.iter(|| { ++ let mut set = HashSet::new(); ++ ++ // Each loop triggers one rehash ++ for _ in 0..10 { ++ for i in 0..223 { ++ set.insert(i); ++ } ++ ++ assert_eq!( ++ set.capacity(), ++ 224, ++ "The set must be at or close to capacity to trigger a re hashing" ++ ); ++ ++ for i in 100..1400 { ++ set.remove(&(i - 100)); ++ set.insert(i); ++ } ++ set.clear(); ++ } ++ }); ++} +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/benches/insert_unique_unchecked.rs mesa-25.3.3/subprojects/hashbrown-0.14.5/benches/insert_unique_unchecked.rs +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/benches/insert_unique_unchecked.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/benches/insert_unique_unchecked.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,32 @@ ++//! Compare `insert` and `insert_unique_unchecked` operations performance. ++ ++#![feature(test)] ++ ++extern crate test; ++ ++use hashbrown::HashMap; ++use test::Bencher; ++ ++#[bench] ++fn insert(b: &mut Bencher) { ++ let keys: Vec = (0..1000).map(|i| format!("xxxx{}yyyy", i)).collect(); ++ b.iter(|| { ++ let mut m = HashMap::with_capacity(1000); ++ for k in &keys { ++ m.insert(k, k); ++ } ++ m ++ }); ++} ++ ++#[bench] ++fn insert_unique_unchecked(b: &mut Bencher) { ++ let keys: Vec = (0..1000).map(|i| format!("xxxx{}yyyy", i)).collect(); ++ b.iter(|| { ++ let mut m = HashMap::with_capacity(1000); ++ for k in &keys { ++ m.insert_unique_unchecked(k, k); ++ } ++ m ++ }); ++} +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/.cargo-checksum.json mesa-25.3.3/subprojects/hashbrown-0.14.5/.cargo-checksum.json +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/.cargo-checksum.json 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/.cargo-checksum.json 2024-05-23 13:02:57.000000000 -0500 +@@ -0,0 +1 @@ ++{"package":"Could not get crate checksum","files":{}} +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/Cargo.toml mesa-25.3.3/subprojects/hashbrown-0.14.5/Cargo.toml +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/Cargo.toml 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/Cargo.toml 2024-05-23 13:02:57.000000000 -0500 +@@ -0,0 +1,114 @@ ++# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO ++# ++# When uploading crates to the registry Cargo will automatically ++# "normalize" Cargo.toml files for maximal compatibility ++# with all versions of Cargo and also rewrite `path` dependencies ++# to registry (e.g., crates.io) dependencies. ++# ++# If you are reading this file be aware that the original Cargo.toml ++# will likely look very different (and much more reasonable). ++# See Cargo.toml.orig for the original contents. ++ ++[package] ++edition = "2021" ++rust-version = "1.63.0" ++name = "hashbrown" ++version = "0.14.5" ++authors = ["Amanieu d'Antras "] ++exclude = [ ++ ".github", ++ "/ci/*", ++] ++description = "A Rust port of Google's SwissTable hash map" ++readme = "README.md" ++keywords = [ ++ "hash", ++ "no_std", ++ "hashmap", ++ "swisstable", ++] ++categories = [ ++ "data-structures", ++ "no-std", ++] ++license = "MIT OR Apache-2.0" ++repository = "https://github.com/rust-lang/hashbrown" ++ ++[package.metadata.docs.rs] ++features = [ ++ "rayon", ++ "serde", ++ "raw", ++] ++rustdoc-args = ["--generate-link-to-definition"] ++ ++[dependencies.ahash] ++version = "0.8.7" ++optional = true ++default-features = false ++ ++[dependencies.allocator-api2] ++version = "0.2.9" ++features = ["alloc"] ++optional = true ++default-features = false ++ ++[dependencies.compiler_builtins] ++version = "0.1.2" ++optional = true ++ ++[dependencies.core] ++version = "1.0.0" ++optional = true ++package = "rustc-std-workspace-core" ++ ++[dependencies.equivalent] ++version = "1.0" ++optional = true ++default-features = false ++ ++[dependencies.rayon] ++version = "1.0" ++optional = true ++ ++[dependencies.serde] ++version = "1.0.25" ++optional = true ++default-features = false ++ ++[dev-dependencies.bumpalo] ++version = "3.13.0" ++features = ["allocator-api2"] ++ ++[dev-dependencies.doc-comment] ++version = "0.3.1" ++ ++[dev-dependencies.fnv] ++version = "1.0.7" ++ ++[dev-dependencies.lazy_static] ++version = "1.4" ++ ++[dev-dependencies.rand] ++version = "0.8.3" ++features = ["small_rng"] ++ ++[dev-dependencies.rayon] ++version = "1.0" ++ ++[dev-dependencies.rkyv] ++version = "0.7.42" ++features = ["validation"] ++ ++[dev-dependencies.serde_test] ++version = "1.0" ++ ++[features] ++default = [ ++ "ahash", ++ "inline-more", ++ "allocator-api2", ++] ++inline-more = [] ++raw = [] ++rustc-internal-api = [] +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/.cargo_vcs_info.json mesa-25.3.3/subprojects/hashbrown-0.14.5/.cargo_vcs_info.json +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/.cargo_vcs_info.json 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/.cargo_vcs_info.json 2024-05-23 13:02:57.000000000 -0500 +@@ -0,0 +1,6 @@ ++{ ++ "git": { ++ "sha1": "025d0f58b62d074f5fd660a22fe293cdc237d589" ++ }, ++ "path_in_vcs": "" ++} +\ No hay ningún carácter de nueva línea al final del archivo +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/CHANGELOG.md mesa-25.3.3/subprojects/hashbrown-0.14.5/CHANGELOG.md +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/CHANGELOG.md 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/CHANGELOG.md 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,532 @@ ++# Change Log ++ ++All notable changes to this project will be documented in this file. ++ ++The format is based on [Keep a Changelog](https://keepachangelog.com/) ++and this project adheres to [Semantic Versioning](https://semver.org/). ++ ++## [Unreleased] ++ ++### Changed ++ ++- Changed `hash_set::{Entry, VacantEntry}::insert` to return `OccupiedEntry`. (#495) ++ ++## [v0.14.5] - 2024-04-28 ++ ++### Fixed ++ ++- Fixed index calculation in panic guard of `clone_from_impl`. (#511) ++ ++## ~~[v0.14.4] - 2024-03-19~~ ++ ++This release was _yanked_ due to a breaking change. ++ ++## [v0.14.3] - 2023-11-26 ++ ++### Added ++ ++- Specialized `fold` implementation of iterators. (#480) ++ ++### Fixed ++ ++- Avoid using unstable `ptr::invalid_mut` on nightly. (#481) ++ ++## [v0.14.2] - 2023-10-19 ++ ++### Added ++ ++- `HashTable` type which provides a low-level but safe API with explicit hashing. (#466) ++ ++### Fixed ++ ++- Disabled the use of NEON instructions on big-endian ARM. (#475) ++- Disabled the use of NEON instructions on Miri. (#476) ++ ++## [v0.14.1] - 2023-09-28 ++ ++### Added ++ ++- Allow serializing `HashMap`s that use a custom allocator. (#449) ++ ++### Changed ++ ++- Use the `Equivalent` trait from the `equivalent` crate. (#442) ++- Slightly improved performance of table resizing. (#451) ++- Relaxed MSRV to 1.63.0. (#457) ++- Removed `Clone` requirement from custom allocators. (#468) ++ ++### Fixed ++ ++- Fixed custom allocators being leaked in some situations. (#439, #465) ++ ++## [v0.14.0] - 2023-06-01 ++ ++### Added ++ ++- Support for `allocator-api2` crate ++ for interfacing with custom allocators on stable. (#417) ++- Optimized implementation for ARM using NEON instructions. (#430) ++- Support for rkyv serialization. (#432) ++- `Equivalent` trait to look up values without `Borrow`. (#345) ++- `Hash{Map,Set}::raw_table_mut` is added whic returns a mutable reference. (#404) ++- Fast path for `clear` on empty tables. (#428) ++ ++### Changed ++ ++- Optimized insertion to only perform a single lookup. (#277) ++- `DrainFilter` (`drain_filter`) has been renamed to `ExtractIf` and no longer drops remaining ++ elements when the iterator is dropped. #(374) ++- Bumped MSRV to 1.64.0. (#431) ++- `{Map,Set}::raw_table` now returns an immutable reference. (#404) ++- `VacantEntry` and `OccupiedEntry` now use the default hasher if none is ++ specified in generics. (#389) ++- `RawTable::data_start` now returns a `NonNull` to match `RawTable::data_end`. (#387) ++- `RawIter::{reflect_insert, reflect_remove}` are now unsafe. (#429) ++- `RawTable::find_potential` is renamed to `find_or_find_insert_slot` and returns an `InsertSlot`. (#429) ++- `RawTable::remove` now also returns an `InsertSlot`. (#429) ++- `InsertSlot` can be used to insert an element with `RawTable::insert_in_slot`. (#429) ++- `RawIterHash` no longer has a lifetime tied to that of the `RawTable`. (#427) ++- The trait bounds of `HashSet::raw_table` have been relaxed to not require `Eq + Hash`. (#423) ++- `EntryRef::and_replace_entry_with` and `OccupiedEntryRef::replace_entry_with` ++ were changed to give a `&K` instead of a `&Q` to the closure. ++ ++### Removed ++ ++- Support for `bumpalo` as an allocator with custom wrapper. ++ Use `allocator-api2` feature in `bumpalo` to use it as an allocator ++ for `hashbrown` collections. (#417) ++ ++## [v0.13.2] - 2023-01-12 ++ ++### Fixed ++ ++- Added `#[inline(always)]` to `find_inner`. (#375) ++- Fixed `RawTable::allocation_info` for empty tables. (#376) ++ ++## [v0.13.1] - 2022-11-10 ++ ++### Added ++ ++- Added `Equivalent` trait to customize key lookups. (#350) ++- Added support for 16-bit targets. (#368) ++- Added `RawTable::allocation_info` which provides information about the memory ++ usage of a table. (#371) ++ ++### Changed ++ ++- Bumped MSRV to 1.61.0. ++- Upgraded to `ahash` 0.8. (#357) ++- Make `with_hasher_in` const. (#355) ++- The following methods have been removed from the `RawTable` API in favor of ++ safer alternatives: ++ - `RawTable::erase_no_drop` => Use `RawTable::erase` or `RawTable::remove` instead. ++ - `Bucket::read` => Use `RawTable::remove` instead. ++ - `Bucket::drop` => Use `RawTable::erase` instead. ++ - `Bucket::write` => Use `Bucket::as_mut` instead. ++ ++### Fixed ++ ++- Ensure that `HashMap` allocations don't exceed `isize::MAX`. (#362) ++- Fixed issue with field retagging in scopeguard. (#359) ++ ++## [v0.12.3] - 2022-07-17 ++ ++### Fixed ++ ++- Fixed double-drop in `RawTable::clone_from`. (#348) ++ ++## [v0.12.2] - 2022-07-09 ++ ++### Added ++ ++- Added `Entry` API for `HashSet`. (#342) ++- Added `Extend<&'a (K, V)> for HashMap`. (#340) ++- Added length-based short-circuiting for hash table iteration. (#338) ++- Added a function to access the `RawTable` of a `HashMap`. (#335) ++ ++### Changed ++ ++- Edited `do_alloc` to reduce LLVM IR generated. (#341) ++ ++## [v0.12.1] - 2022-05-02 ++ ++### Fixed ++ ++- Fixed underflow in `RawIterRange::size_hint`. (#325) ++- Fixed the implementation of `Debug` for `ValuesMut` and `IntoValues`. (#325) ++ ++## [v0.12.0] - 2022-01-17 ++ ++### Added ++ ++- Added `From<[T; N]>` and `From<[(K, V); N]>` for `HashSet` and `HashMap` respectively. (#297) ++- Added an `allocator()` getter to HashMap and HashSet. (#257) ++- Added `insert_unique_unchecked` to `HashMap` and `HashSet`. (#293) ++- Added `into_keys` and `into_values` to HashMap. (#295) ++- Implement `From` on `HashSet` and `HashMap`. (#298) ++- Added `entry_ref` API to `HashMap`. (#201) ++ ++### Changed ++ ++- Bumped minimum Rust version to 1.56.1 and edition to 2021. ++- Use u64 for the GroupWord on WebAssembly. (#271) ++- Optimized `find`. (#279) ++- Made rehashing and resizing less generic to reduce compilation time. (#282) ++- Inlined small functions. (#283) ++- Use `BuildHasher::hash_one` when `feature = "nightly"` is enabled. (#292) ++- Relaxed the bounds on `Debug` for `HashSet`. (#296) ++- Rename `get_each_mut` to `get_many_mut` and align API with the stdlib. (#291) ++- Don't hash the key when searching in an empty table. (#305) ++ ++### Fixed ++ ++- Guard against allocations exceeding isize::MAX. (#268) ++- Made `RawTable::insert_no_grow` unsafe. (#254) ++- Inline `static_empty`. (#280) ++- Fixed trait bounds on Send/Sync impls. (#303) ++ ++## [v0.11.2] - 2021-03-25 ++ ++### Fixed ++ ++- Added missing allocator type parameter to `HashMap`'s and `HashSet`'s `Clone` impls. (#252) ++ ++## [v0.11.1] - 2021-03-20 ++ ++### Fixed ++ ++- Added missing `pub` modifier to `BumpWrapper`. (#251) ++ ++## [v0.11.0] - 2021-03-14 ++ ++### Added ++- Added safe `try_insert_no_grow` method to `RawTable`. (#229) ++- Added support for `bumpalo` as an allocator without the `nightly` feature. (#231) ++- Implemented `Default` for `RawTable`. (#237) ++- Added new safe methods `RawTable::get_each_mut`, `HashMap::get_each_mut`, and ++ `HashMap::get_each_key_value_mut`. (#239) ++- Added `From>` for `HashSet`. (#235) ++- Added `try_insert` method to `HashMap`. (#247) ++ ++### Changed ++- The minimum Rust version has been bumped to 1.49.0. (#230) ++- Significantly improved compilation times by reducing the amount of generated IR. (#205) ++ ++### Removed ++- We no longer re-export the unstable allocator items from the standard library, nor the stable shims approximating the same. (#227) ++- Removed hasher specialization support from `aHash`, which was resulting in inconsistent hashes being generated for a key. (#248) ++ ++### Fixed ++- Fixed union length comparison. (#228) ++ ++## ~~[v0.10.0] - 2021-01-16~~ ++ ++This release was _yanked_ due to inconsistent hashes being generated with the `nightly` feature. (#248) ++ ++### Changed ++- Parametrized `RawTable`, `HashSet` and `HashMap` over an allocator. (#133) ++- Improved branch prediction hints on stable. (#209) ++- Optimized hashing of primitive types with AHash using specialization. (#207) ++- Only instantiate `RawTable`'s reserve functions once per key-value. (#204) ++ ++## [v0.9.1] - 2020-09-28 ++ ++### Added ++- Added safe methods to `RawTable` (#202): ++ - `get`: `find` and `as_ref` ++ - `get_mut`: `find` and `as_mut` ++ - `insert_entry`: `insert` and `as_mut` ++ - `remove_entry`: `find` and `remove` ++ - `erase_entry`: `find` and `erase` ++ ++### Changed ++- Removed `from_key_hashed_nocheck`'s `Q: Hash`. (#200) ++- Made `RawTable::drain` safe. (#201) ++ ++## [v0.9.0] - 2020-09-03 ++ ++### Fixed ++- `drain_filter` now removes and yields items that do match the predicate, ++ rather than items that don't. This is a **breaking change** to match the ++ behavior of the `drain_filter` methods in `std`. (#187) ++ ++### Added ++- Added `replace_entry_with` to `OccupiedEntry`, and `and_replace_entry_with` to `Entry`. (#190) ++- Implemented `FusedIterator` and `size_hint` for `DrainFilter`. (#188) ++ ++### Changed ++- The minimum Rust version has been bumped to 1.36 (due to `crossbeam` dependency). (#193) ++- Updated `ahash` dependency to 0.4. (#198) ++- `HashMap::with_hasher` and `HashSet::with_hasher` are now `const fn`. (#195) ++- Removed `T: Hash + Eq` and `S: BuildHasher` bounds on `HashSet::new`, ++ `with_capacity`, `with_hasher`, and `with_capacity_and_hasher`. (#185) ++ ++## [v0.8.2] - 2020-08-08 ++ ++### Changed ++- Avoid closures to improve compile times. (#183) ++- Do not iterate to drop if empty. (#182) ++ ++## [v0.8.1] - 2020-07-16 ++ ++### Added ++- Added `erase` and `remove` to `RawTable`. (#171) ++- Added `try_with_capacity` to `RawTable`. (#174) ++- Added methods that allow re-using a `RawIter` for `RawDrain`, ++ `RawIntoIter`, and `RawParIter`. (#175) ++- Added `reflect_remove` and `reflect_insert` to `RawIter`. (#175) ++- Added a `drain_filter` function to `HashSet`. (#179) ++ ++### Changed ++- Deprecated `RawTable::erase_no_drop` in favor of `erase` and `remove`. (#176) ++- `insert_no_grow` is now exposed under the `"raw"` feature. (#180) ++ ++## [v0.8.0] - 2020-06-18 ++ ++### Fixed ++- Marked `RawTable::par_iter` as `unsafe`. (#157) ++ ++### Changed ++- Reduced the size of `HashMap`. (#159) ++- No longer create tables with a capacity of 1 element. (#162) ++- Removed `K: Eq + Hash` bounds on `retain`. (#163) ++- Pulled in `HashMap` changes from rust-lang/rust (#164): ++ - `extend_one` support on nightly. ++ - `CollectionAllocErr` renamed to `TryReserveError`. ++ - Added `HashSet::get_or_insert_owned`. ++ - `Default` for `HashSet` no longer requires `T: Eq + Hash` and `S: BuildHasher`. ++ ++## [v0.7.2] - 2020-04-27 ++ ++### Added ++- Added `or_insert_with_key` to `Entry`. (#152) ++ ++### Fixed ++- Partially reverted `Clone` optimization which was unsound. (#154) ++ ++### Changed ++- Disabled use of `const-random` by default, which prevented reproducible builds. (#155) ++- Optimized `repeat` function. (#150) ++- Use `NonNull` for buckets, which improves codegen for iterators. (#148) ++ ++## [v0.7.1] - 2020-03-16 ++ ++### Added ++- Added `HashMap::get_key_value_mut`. (#145) ++ ++### Changed ++- Optimized `Clone` implementation. (#146) ++ ++## [v0.7.0] - 2020-01-31 ++ ++### Added ++- Added a `drain_filter` function to `HashMap`. (#135) ++ ++### Changed ++- Updated `ahash` dependency to 0.3. (#141) ++- Optimized set union and intersection. (#130) ++- `raw_entry` can now be used without requiring `S: BuildHasher`. (#123) ++- `RawTable::bucket_index` can now be used under the `raw` feature. (#128) ++ ++## [v0.6.3] - 2019-10-31 ++ ++### Added ++- Added an `ahash-compile-time-rng` feature (enabled by default) which allows disabling the ++ `compile-time-rng` feature in `ahash` to work around a Cargo bug. (#125) ++ ++## [v0.6.2] - 2019-10-23 ++ ++### Added ++- Added an `inline-more` feature (enabled by default) which allows choosing a tradeoff between ++ runtime performance and compilation time. (#119) ++ ++## [v0.6.1] - 2019-10-04 ++ ++### Added ++- Added `Entry::insert` and `RawEntryMut::insert`. (#118) ++ ++### Changed ++- `Group::static_empty` was changed from a `const` to a `static` (#116). ++ ++## [v0.6.0] - 2019-08-13 ++ ++### Fixed ++- Fixed AHash accidentally depending on `std`. (#110) ++ ++### Changed ++- The minimum Rust version has been bumped to 1.32 (due to `rand` dependency). ++ ++## ~~[v0.5.1] - 2019-08-04~~ ++ ++This release was _yanked_ due to a breaking change for users of `no-default-features`. ++ ++### Added ++- The experimental and unsafe `RawTable` API is available under the "raw" feature. (#108) ++- Added entry-like methods for `HashSet`. (#98) ++ ++### Changed ++- Changed the default hasher from FxHash to AHash. (#97) ++- `hashbrown` is now fully `no_std` on recent Rust versions (1.36+). (#96) ++ ++### Fixed ++- We now avoid growing the table during insertions when it wasn't necessary. (#106) ++- `RawOccupiedEntryMut` now properly implements `Send` and `Sync`. (#100) ++- Relaxed `lazy_static` version. (#92) ++ ++## [v0.5.0] - 2019-06-12 ++ ++### Fixed ++- Resize with a more conservative amount of space after deletions. (#86) ++ ++### Changed ++- Exposed the Layout of the failed allocation in CollectionAllocErr::AllocErr. (#89) ++ ++## [v0.4.0] - 2019-05-30 ++ ++### Fixed ++- Fixed `Send` trait bounds on `IterMut` not matching the libstd one. (#82) ++ ++## [v0.3.1] - 2019-05-30 ++ ++### Fixed ++- Fixed incorrect use of slice in unsafe code. (#80) ++ ++## [v0.3.0] - 2019-04-23 ++ ++### Changed ++- Changed shrink_to to not panic if min_capacity < capacity. (#67) ++ ++### Fixed ++- Worked around emscripten bug emscripten-core/emscripten-fastcomp#258. (#66) ++ ++## [v0.2.2] - 2019-04-16 ++ ++### Fixed ++- Inlined non-nightly lowest_set_bit_nonzero. (#64) ++- Fixed build on latest nightly. (#65) ++ ++## [v0.2.1] - 2019-04-14 ++ ++### Changed ++- Use for_each in map Extend and FromIterator. (#58) ++- Improved worst-case performance of HashSet.is_subset. (#61) ++ ++### Fixed ++- Removed incorrect debug_assert. (#60) ++ ++## [v0.2.0] - 2019-03-31 ++ ++### Changed ++- The code has been updated to Rust 2018 edition. This means that the minimum ++ Rust version has been bumped to 1.31 (2018 edition). ++ ++### Added ++- Added `insert_with_hasher` to the raw_entry API to allow `K: !(Hash + Eq)`. (#54) ++- Added support for using hashbrown as the hash table implementation in libstd. (#46) ++ ++### Fixed ++- Fixed cargo build with minimal-versions. (#45) ++- Fixed `#[may_dangle]` attributes to match the libstd `HashMap`. (#46) ++- ZST keys and values are now handled properly. (#46) ++ ++## [v0.1.8] - 2019-01-14 ++ ++### Added ++- Rayon parallel iterator support (#37) ++- `raw_entry` support (#31) ++- `#[may_dangle]` on nightly (#31) ++- `try_reserve` support (#31) ++ ++### Fixed ++- Fixed variance on `IterMut`. (#31) ++ ++## [v0.1.7] - 2018-12-05 ++ ++### Fixed ++- Fixed non-SSE version of convert_special_to_empty_and_full_to_deleted. (#32) ++- Fixed overflow in rehash_in_place. (#33) ++ ++## [v0.1.6] - 2018-11-17 ++ ++### Fixed ++- Fixed compile error on nightly. (#29) ++ ++## [v0.1.5] - 2018-11-08 ++ ++### Fixed ++- Fixed subtraction overflow in generic::Group::match_byte. (#28) ++ ++## [v0.1.4] - 2018-11-04 ++ ++### Fixed ++- Fixed a bug in the `erase_no_drop` implementation. (#26) ++ ++## [v0.1.3] - 2018-11-01 ++ ++### Added ++- Serde support. (#14) ++ ++### Fixed ++- Make the compiler inline functions more aggressively. (#20) ++ ++## [v0.1.2] - 2018-10-31 ++ ++### Fixed ++- `clear` segfaults when called on an empty table. (#13) ++ ++## [v0.1.1] - 2018-10-30 ++ ++### Fixed ++- `erase_no_drop` optimization not triggering in the SSE2 implementation. (#3) ++- Missing `Send` and `Sync` for hash map and iterator types. (#7) ++- Bug when inserting into a table smaller than the group width. (#5) ++ ++## v0.1.0 - 2018-10-29 ++ ++- Initial release ++ ++[Unreleased]: https://github.com/rust-lang/hashbrown/compare/v0.14.5...HEAD ++[v0.14.5]: https://github.com/rust-lang/hashbrown/compare/v0.14.4...v0.14.5 ++[v0.14.4]: https://github.com/rust-lang/hashbrown/compare/v0.14.3...v0.14.4 ++[v0.14.3]: https://github.com/rust-lang/hashbrown/compare/v0.14.2...v0.14.3 ++[v0.14.2]: https://github.com/rust-lang/hashbrown/compare/v0.14.1...v0.14.2 ++[v0.14.1]: https://github.com/rust-lang/hashbrown/compare/v0.14.0...v0.14.1 ++[v0.14.0]: https://github.com/rust-lang/hashbrown/compare/v0.13.2...v0.14.0 ++[v0.13.2]: https://github.com/rust-lang/hashbrown/compare/v0.13.1...v0.13.2 ++[v0.13.1]: https://github.com/rust-lang/hashbrown/compare/v0.12.3...v0.13.1 ++[v0.12.3]: https://github.com/rust-lang/hashbrown/compare/v0.12.2...v0.12.3 ++[v0.12.2]: https://github.com/rust-lang/hashbrown/compare/v0.12.1...v0.12.2 ++[v0.12.1]: https://github.com/rust-lang/hashbrown/compare/v0.12.0...v0.12.1 ++[v0.12.0]: https://github.com/rust-lang/hashbrown/compare/v0.11.2...v0.12.0 ++[v0.11.2]: https://github.com/rust-lang/hashbrown/compare/v0.11.1...v0.11.2 ++[v0.11.1]: https://github.com/rust-lang/hashbrown/compare/v0.11.0...v0.11.1 ++[v0.11.0]: https://github.com/rust-lang/hashbrown/compare/v0.10.0...v0.11.0 ++[v0.10.0]: https://github.com/rust-lang/hashbrown/compare/v0.9.1...v0.10.0 ++[v0.9.1]: https://github.com/rust-lang/hashbrown/compare/v0.9.0...v0.9.1 ++[v0.9.0]: https://github.com/rust-lang/hashbrown/compare/v0.8.2...v0.9.0 ++[v0.8.2]: https://github.com/rust-lang/hashbrown/compare/v0.8.1...v0.8.2 ++[v0.8.1]: https://github.com/rust-lang/hashbrown/compare/v0.8.0...v0.8.1 ++[v0.8.0]: https://github.com/rust-lang/hashbrown/compare/v0.7.2...v0.8.0 ++[v0.7.2]: https://github.com/rust-lang/hashbrown/compare/v0.7.1...v0.7.2 ++[v0.7.1]: https://github.com/rust-lang/hashbrown/compare/v0.7.0...v0.7.1 ++[v0.7.0]: https://github.com/rust-lang/hashbrown/compare/v0.6.3...v0.7.0 ++[v0.6.3]: https://github.com/rust-lang/hashbrown/compare/v0.6.2...v0.6.3 ++[v0.6.2]: https://github.com/rust-lang/hashbrown/compare/v0.6.1...v0.6.2 ++[v0.6.1]: https://github.com/rust-lang/hashbrown/compare/v0.6.0...v0.6.1 ++[v0.6.0]: https://github.com/rust-lang/hashbrown/compare/v0.5.1...v0.6.0 ++[v0.5.1]: https://github.com/rust-lang/hashbrown/compare/v0.5.0...v0.5.1 ++[v0.5.0]: https://github.com/rust-lang/hashbrown/compare/v0.4.0...v0.5.0 ++[v0.4.0]: https://github.com/rust-lang/hashbrown/compare/v0.3.1...v0.4.0 ++[v0.3.1]: https://github.com/rust-lang/hashbrown/compare/v0.3.0...v0.3.1 ++[v0.3.0]: https://github.com/rust-lang/hashbrown/compare/v0.2.2...v0.3.0 ++[v0.2.2]: https://github.com/rust-lang/hashbrown/compare/v0.2.1...v0.2.2 ++[v0.2.1]: https://github.com/rust-lang/hashbrown/compare/v0.2.0...v0.2.1 ++[v0.2.0]: https://github.com/rust-lang/hashbrown/compare/v0.1.8...v0.2.0 ++[v0.1.8]: https://github.com/rust-lang/hashbrown/compare/v0.1.7...v0.1.8 ++[v0.1.7]: https://github.com/rust-lang/hashbrown/compare/v0.1.6...v0.1.7 ++[v0.1.6]: https://github.com/rust-lang/hashbrown/compare/v0.1.5...v0.1.6 ++[v0.1.5]: https://github.com/rust-lang/hashbrown/compare/v0.1.4...v0.1.5 ++[v0.1.4]: https://github.com/rust-lang/hashbrown/compare/v0.1.3...v0.1.4 ++[v0.1.3]: https://github.com/rust-lang/hashbrown/compare/v0.1.2...v0.1.3 ++[v0.1.2]: https://github.com/rust-lang/hashbrown/compare/v0.1.1...v0.1.2 ++[v0.1.1]: https://github.com/rust-lang/hashbrown/compare/v0.1.0...v0.1.1 +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/clippy.toml mesa-25.3.3/subprojects/hashbrown-0.14.5/clippy.toml +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/clippy.toml 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/clippy.toml 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1 @@ ++doc-valid-idents = [ "CppCon", "SwissTable", "SipHash", "HashDoS" ] +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/debian/patches/disable-alloc.diff mesa-25.3.3/subprojects/hashbrown-0.14.5/debian/patches/disable-alloc.diff +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/debian/patches/disable-alloc.diff 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/debian/patches/disable-alloc.diff 2024-05-23 13:02:57.000000000 -0500 +@@ -0,0 +1,16 @@ ++--- hashbrown/Cargo.toml +++++ hashbrown/Cargo.toml ++@@ -51,5 +51,0 @@ ++-[dependencies.alloc] ++-version = "1.0.0" ++-optional = true ++-package = "rustc-std-workspace-alloc" ++- ++@@ -107,7 +102,6 @@ ++ "nightly", ++ "core", ++ "compiler_builtins", ++- "alloc", ++ "rustc-internal-api", ++ ] ++ rustc-internal-api = [] +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/debian/patches/disable-nightly.diff mesa-25.3.3/subprojects/hashbrown-0.14.5/debian/patches/disable-nightly.diff +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/debian/patches/disable-nightly.diff 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/debian/patches/disable-nightly.diff 2024-05-23 13:02:57.000000000 -0500 +@@ -0,0 +1,28 @@ ++Index: hashbrown/Cargo.toml ++=================================================================== ++--- hashbrown.orig/Cargo.toml +++++ hashbrown/Cargo.toml ++@@ -36,7 +36,6 @@ repository = "https://github.com/rust-la ++ ++ [package.metadata.docs.rs] ++ features = [ ++- "nightly", ++ "rayon", ++ "serde", ++ "raw", ++@@ -117,15 +116,5 @@ default = [ ++ "allocator-api2", ++ ] ++ inline-more = [] ++-nightly = [ ++- "allocator-api2?/nightly", ++- "bumpalo/allocator_api", ++-] ++ raw = [] ++-rustc-dep-of-std = [ ++- "nightly", ++- "core", ++- "compiler_builtins", ++- "rustc-internal-api", ++-] ++ rustc-internal-api = [] +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/debian/patches/disable-rkyv.diff mesa-25.3.3/subprojects/hashbrown-0.14.5/debian/patches/disable-rkyv.diff +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/debian/patches/disable-rkyv.diff 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/debian/patches/disable-rkyv.diff 2024-05-23 13:02:57.000000000 -0500 +@@ -0,0 +1,17 @@ ++Index: hashbrown/Cargo.toml ++=================================================================== ++--- hashbrown.orig/Cargo.toml +++++ hashbrown/Cargo.toml ++@@ -71,12 +71,6 @@ default-features = false ++ version = "1.0" ++ optional = true ++ ++-[dependencies.rkyv] ++-version = "0.7.42" ++-features = ["alloc"] ++-optional = true ++-default-features = false ++- ++ [dependencies.serde] ++ version = "1.0.25" ++ optional = true +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/debian/patches/fix-tests-no-default-features.patch mesa-25.3.3/subprojects/hashbrown-0.14.5/debian/patches/fix-tests-no-default-features.patch +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/debian/patches/fix-tests-no-default-features.patch 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/debian/patches/fix-tests-no-default-features.patch 2024-05-23 13:02:57.000000000 -0500 +@@ -0,0 +1,94 @@ ++This patch fixes the tests if the allocator-api2 feature is disabled. ++ ++Index: hashbrown/src/map.rs ++=================================================================== ++--- hashbrown.orig/src/map.rs +++++ hashbrown/src/map.rs ++@@ -6711,6 +6711,7 @@ mod test_map { ++ use super::{HashMap, RawEntryMut}; ++ use alloc::string::{String, ToString}; ++ use alloc::sync::Arc; +++ #[cfg(feature="allocator-api2")] ++ use allocator_api2::alloc::{AllocError, Allocator, Global}; ++ use core::alloc::Layout; ++ use core::ptr::NonNull; ++@@ -8590,6 +8656,7 @@ mod test_map { ++ } ++ } ++ +++ #[cfg(feature="allocator-api2")] ++ unsafe impl Allocator for MyAlloc { ++ fn allocate(&self, layout: Layout) -> std::result::Result, AllocError> { ++ let g = Global; ++@@ -8603,6 +8670,7 @@ mod test_map { ++ } ++ ++ #[test] +++ #[cfg(all(feature="allocator-api2", feature="ahash"))] ++ fn test_hashmap_into_iter_bug() { ++ let dropped: Arc = Arc::new(AtomicI8::new(1)); ++ ++@@ -8673,6 +8741,7 @@ mod test_map { ++ /// ++ /// This function does not panic, but returns an error as a `String` ++ /// to distinguish between a test panic and an error in the input data. +++ #[cfg(all(feature="allocator-api2", feature="ahash"))] ++ fn get_test_map( ++ iter: I, ++ mut fun: impl FnMut(u64) -> T, ++@@ -8768,6 +8837,7 @@ mod test_map { ++ ++ #[test] ++ #[should_panic = "panic in clone"] +++ #[cfg(all(feature="allocator-api2", feature="ahash"))] ++ fn test_clone_memory_leaks_and_double_drop_one() { ++ let dropped: Arc = Arc::new(AtomicI8::new(2)); ++ ++@@ -8794,6 +8864,7 @@ mod test_map { ++ ++ #[test] ++ #[should_panic = "panic in drop"] +++ #[cfg(all(feature="allocator-api2", feature="ahash"))] ++ fn test_clone_memory_leaks_and_double_drop_two() { ++ let dropped: Arc = Arc::new(AtomicI8::new(2)); ++ ++@@ -8828,6 +8899,7 @@ mod test_map { ++ /// We check that we have a working table if the clone operation from another ++ /// thread ended in a panic (when buckets of maps are equal to each other). ++ #[test] +++ #[cfg(all(feature="allocator-api2", feature="ahash"))] ++ fn test_catch_panic_clone_from_when_len_is_equal() { ++ use std::thread; ++ ++@@ -8893,6 +8965,7 @@ mod test_map { ++ /// We check that we have a working table if the clone operation from another ++ /// thread ended in a panic (when buckets of maps are not equal to each other). ++ #[test] +++ #[cfg(all(feature="allocator-api2", feature="ahash"))] ++ fn test_catch_panic_clone_from_when_len_is_not_equal() { ++ use std::thread; ++ ++Index: hashbrown/src/raw/mod.rs ++=================================================================== ++--- hashbrown.orig/src/raw/mod.rs +++++ hashbrown/src/raw/mod.rs ++@@ -4671,9 +4673,11 @@ mod test_map { ++ /// CHECKING THAT WE DON'T TRY TO DROP DATA IF THE `ITEMS` ++ /// ARE ZERO, EVEN IF WE HAVE `FULL` CONTROL BYTES. ++ #[test] +++ #[cfg(feature="allocator-api2")] ++ fn test_catch_panic_clone_from() { ++ use ::alloc::sync::Arc; ++ use ::alloc::vec::Vec; +++ #[cfg(feature="allocator-api2")] ++ use allocator_api2::alloc::{AllocError, Allocator, Global}; ++ use core::sync::atomic::{AtomicI8, Ordering}; ++ use std::thread; ++@@ -4694,6 +4698,7 @@ mod test_map { ++ } ++ } ++ +++ #[cfg(feature="allocator-api2")] ++ unsafe impl Allocator for MyAlloc { ++ fn allocate(&self, layout: Layout) -> std::result::Result, AllocError> { ++ let g = Global; +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/debian/patches/series mesa-25.3.3/subprojects/hashbrown-0.14.5/debian/patches/series +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/debian/patches/series 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/debian/patches/series 2024-05-23 13:02:57.000000000 -0500 +@@ -0,0 +1,4 @@ ++disable-alloc.diff ++disable-nightly.diff ++disable-rkyv.diff ++fix-tests-no-default-features.patch +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/.gitignore mesa-25.3.3/subprojects/hashbrown-0.14.5/.gitignore +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/.gitignore 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/.gitignore 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,3 @@ ++/target ++**/*.rs.bk ++Cargo.lock +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/LICENSE-APACHE mesa-25.3.3/subprojects/hashbrown-0.14.5/LICENSE-APACHE +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/LICENSE-APACHE 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/LICENSE-APACHE 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,201 @@ ++ Apache License ++ Version 2.0, January 2004 ++ http://www.apache.org/licenses/ ++ ++TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION ++ ++1. Definitions. ++ ++ "License" shall mean the terms and conditions for use, reproduction, ++ and distribution as defined by Sections 1 through 9 of this document. ++ ++ "Licensor" shall mean the copyright owner or entity authorized by ++ the copyright owner that is granting the License. ++ ++ "Legal Entity" shall mean the union of the acting entity and all ++ other entities that control, are controlled by, or are under common ++ control with that entity. For the purposes of this definition, ++ "control" means (i) the power, direct or indirect, to cause the ++ direction or management of such entity, whether by contract or ++ otherwise, or (ii) ownership of fifty percent (50%) or more of the ++ outstanding shares, or (iii) beneficial ownership of such entity. ++ ++ "You" (or "Your") shall mean an individual or Legal Entity ++ exercising permissions granted by this License. ++ ++ "Source" form shall mean the preferred form for making modifications, ++ including but not limited to software source code, documentation ++ source, and configuration files. ++ ++ "Object" form shall mean any form resulting from mechanical ++ transformation or translation of a Source form, including but ++ not limited to compiled object code, generated documentation, ++ and conversions to other media types. ++ ++ "Work" shall mean the work of authorship, whether in Source or ++ Object form, made available under the License, as indicated by a ++ copyright notice that is included in or attached to the work ++ (an example is provided in the Appendix below). ++ ++ "Derivative Works" shall mean any work, whether in Source or Object ++ form, that is based on (or derived from) the Work and for which the ++ editorial revisions, annotations, elaborations, or other modifications ++ represent, as a whole, an original work of authorship. For the purposes ++ of this License, Derivative Works shall not include works that remain ++ separable from, or merely link (or bind by name) to the interfaces of, ++ the Work and Derivative Works thereof. ++ ++ "Contribution" shall mean any work of authorship, including ++ the original version of the Work and any modifications or additions ++ to that Work or Derivative Works thereof, that is intentionally ++ submitted to Licensor for inclusion in the Work by the copyright owner ++ or by an individual or Legal Entity authorized to submit on behalf of ++ the copyright owner. For the purposes of this definition, "submitted" ++ means any form of electronic, verbal, or written communication sent ++ to the Licensor or its representatives, including but not limited to ++ communication on electronic mailing lists, source code control systems, ++ and issue tracking systems that are managed by, or on behalf of, the ++ Licensor for the purpose of discussing and improving the Work, but ++ excluding communication that is conspicuously marked or otherwise ++ designated in writing by the copyright owner as "Not a Contribution." ++ ++ "Contributor" shall mean Licensor and any individual or Legal Entity ++ on behalf of whom a Contribution has been received by Licensor and ++ subsequently incorporated within the Work. ++ ++2. Grant of Copyright License. Subject to the terms and conditions of ++ this License, each Contributor hereby grants to You a perpetual, ++ worldwide, non-exclusive, no-charge, royalty-free, irrevocable ++ copyright license to reproduce, prepare Derivative Works of, ++ publicly display, publicly perform, sublicense, and distribute the ++ Work and such Derivative Works in Source or Object form. ++ ++3. Grant of Patent License. Subject to the terms and conditions of ++ this License, each Contributor hereby grants to You a perpetual, ++ worldwide, non-exclusive, no-charge, royalty-free, irrevocable ++ (except as stated in this section) patent license to make, have made, ++ use, offer to sell, sell, import, and otherwise transfer the Work, ++ where such license applies only to those patent claims licensable ++ by such Contributor that are necessarily infringed by their ++ Contribution(s) alone or by combination of their Contribution(s) ++ with the Work to which such Contribution(s) was submitted. If You ++ institute patent litigation against any entity (including a ++ cross-claim or counterclaim in a lawsuit) alleging that the Work ++ or a Contribution incorporated within the Work constitutes direct ++ or contributory patent infringement, then any patent licenses ++ granted to You under this License for that Work shall terminate ++ as of the date such litigation is filed. ++ ++4. Redistribution. You may reproduce and distribute copies of the ++ Work or Derivative Works thereof in any medium, with or without ++ modifications, and in Source or Object form, provided that You ++ meet the following conditions: ++ ++ (a) You must give any other recipients of the Work or ++ Derivative Works a copy of this License; and ++ ++ (b) You must cause any modified files to carry prominent notices ++ stating that You changed the files; and ++ ++ (c) You must retain, in the Source form of any Derivative Works ++ that You distribute, all copyright, patent, trademark, and ++ attribution notices from the Source form of the Work, ++ excluding those notices that do not pertain to any part of ++ the Derivative Works; and ++ ++ (d) If the Work includes a "NOTICE" text file as part of its ++ distribution, then any Derivative Works that You distribute must ++ include a readable copy of the attribution notices contained ++ within such NOTICE file, excluding those notices that do not ++ pertain to any part of the Derivative Works, in at least one ++ of the following places: within a NOTICE text file distributed ++ as part of the Derivative Works; within the Source form or ++ documentation, if provided along with the Derivative Works; or, ++ within a display generated by the Derivative Works, if and ++ wherever such third-party notices normally appear. The contents ++ of the NOTICE file are for informational purposes only and ++ do not modify the License. You may add Your own attribution ++ notices within Derivative Works that You distribute, alongside ++ or as an addendum to the NOTICE text from the Work, provided ++ that such additional attribution notices cannot be construed ++ as modifying the License. ++ ++ You may add Your own copyright statement to Your modifications and ++ may provide additional or different license terms and conditions ++ for use, reproduction, or distribution of Your modifications, or ++ for any such Derivative Works as a whole, provided Your use, ++ reproduction, and distribution of the Work otherwise complies with ++ the conditions stated in this License. ++ ++5. Submission of Contributions. Unless You explicitly state otherwise, ++ any Contribution intentionally submitted for inclusion in the Work ++ by You to the Licensor shall be under the terms and conditions of ++ this License, without any additional terms or conditions. ++ Notwithstanding the above, nothing herein shall supersede or modify ++ the terms of any separate license agreement you may have executed ++ with Licensor regarding such Contributions. ++ ++6. Trademarks. This License does not grant permission to use the trade ++ names, trademarks, service marks, or product names of the Licensor, ++ except as required for reasonable and customary use in describing the ++ origin of the Work and reproducing the content of the NOTICE file. ++ ++7. Disclaimer of Warranty. Unless required by applicable law or ++ agreed to in writing, Licensor provides the Work (and each ++ Contributor provides its Contributions) on an "AS IS" BASIS, ++ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or ++ implied, including, without limitation, any warranties or conditions ++ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A ++ PARTICULAR PURPOSE. You are solely responsible for determining the ++ appropriateness of using or redistributing the Work and assume any ++ risks associated with Your exercise of permissions under this License. ++ ++8. Limitation of Liability. In no event and under no legal theory, ++ whether in tort (including negligence), contract, or otherwise, ++ unless required by applicable law (such as deliberate and grossly ++ negligent acts) or agreed to in writing, shall any Contributor be ++ liable to You for damages, including any direct, indirect, special, ++ incidental, or consequential damages of any character arising as a ++ result of this License or out of the use or inability to use the ++ Work (including but not limited to damages for loss of goodwill, ++ work stoppage, computer failure or malfunction, or any and all ++ other commercial damages or losses), even if such Contributor ++ has been advised of the possibility of such damages. ++ ++9. Accepting Warranty or Additional Liability. While redistributing ++ the Work or Derivative Works thereof, You may choose to offer, ++ and charge a fee for, acceptance of support, warranty, indemnity, ++ or other liability obligations and/or rights consistent with this ++ License. However, in accepting such obligations, You may act only ++ on Your own behalf and on Your sole responsibility, not on behalf ++ of any other Contributor, and only if You agree to indemnify, ++ defend, and hold each Contributor harmless for any liability ++ incurred by, or claims asserted against, such Contributor by reason ++ of your accepting any such warranty or additional liability. ++ ++END OF TERMS AND CONDITIONS ++ ++APPENDIX: How to apply the Apache License to your work. ++ ++ To apply the Apache License to your work, attach the following ++ boilerplate notice, with the fields enclosed by brackets "[]" ++ replaced with your own identifying information. (Don't include ++ the brackets!) The text should be enclosed in the appropriate ++ comment syntax for the file format. We also recommend that a ++ file or class name and description of purpose be included on the ++ same "printed page" as the copyright notice for easier ++ identification within third-party archives. ++ ++Copyright [yyyy] [name of copyright owner] ++ ++Licensed under the Apache License, Version 2.0 (the "License"); ++you may not use this file except in compliance with the License. ++You may obtain a copy of the License at ++ ++ http://www.apache.org/licenses/LICENSE-2.0 ++ ++Unless required by applicable law or agreed to in writing, software ++distributed under the License is distributed on an "AS IS" BASIS, ++WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++See the License for the specific language governing permissions and ++limitations under the License. +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/LICENSE-MIT mesa-25.3.3/subprojects/hashbrown-0.14.5/LICENSE-MIT +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/LICENSE-MIT 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/LICENSE-MIT 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,25 @@ ++Copyright (c) 2016 Amanieu d'Antras ++ ++Permission is hereby granted, free of charge, to any ++person obtaining a copy of this software and associated ++documentation files (the "Software"), to deal in the ++Software without restriction, including without ++limitation the rights to use, copy, modify, merge, ++publish, distribute, sublicense, and/or sell copies of ++the Software, and to permit persons to whom the Software ++is furnished to do so, subject to the following ++conditions: ++ ++The above copyright notice and this permission notice ++shall be included in all copies or substantial portions ++of the Software. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ++ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED ++TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A ++PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT ++SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ++CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION ++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR ++IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ++DEALINGS IN THE SOFTWARE. +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/meson.build mesa-25.3.3/subprojects/hashbrown-0.14.5/meson.build +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/meson.build 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/meson.build 2026-05-26 15:46:05.000000000 -0500 +@@ -0,0 +1,18 @@ ++project('hashbrown', 'rust', version : '0.14.5', license : 'MIT OR Apache-2.0') ++ ++rust_args = [ ++ '--cfg', 'feature="raw"' ++] ++ ++lib = static_library( ++ 'hashbrown', ++ 'src/lib.rs', ++ rust_args : rust_args, ++ override_options : ['rust_std=2021', 'build.rust_std=2021'], ++ rust_abi : 'rust', ++ native : true, ++) ++ ++dep_hashbrown = declare_dependency( ++ link_with : [lib], ++) +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/.meson-subproject-wrap-hash.txt mesa-25.3.3/subprojects/hashbrown-0.14.5/.meson-subproject-wrap-hash.txt +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/.meson-subproject-wrap-hash.txt 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/.meson-subproject-wrap-hash.txt 2026-05-29 13:40:53.000000000 -0500 +@@ -0,0 +1 @@ ++aafb84f21154fa5655cf3ff758ff35ef709dc0ad5f9d48870651687f8251f8ca +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/README.md mesa-25.3.3/subprojects/hashbrown-0.14.5/README.md +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/README.md 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/README.md 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,125 @@ ++hashbrown ++========= ++ ++[![Build Status](https://github.com/rust-lang/hashbrown/actions/workflows/rust.yml/badge.svg)](https://github.com/rust-lang/hashbrown/actions) ++[![Crates.io](https://img.shields.io/crates/v/hashbrown.svg)](https://crates.io/crates/hashbrown) ++[![Documentation](https://docs.rs/hashbrown/badge.svg)](https://docs.rs/hashbrown) ++[![Rust](https://img.shields.io/badge/rust-1.63.0%2B-blue.svg?maxAge=3600)](https://github.com/rust-lang/hashbrown) ++ ++This crate is a Rust port of Google's high-performance [SwissTable] hash ++map, adapted to make it a drop-in replacement for Rust's standard `HashMap` ++and `HashSet` types. ++ ++The original C++ version of SwissTable can be found [here], and this ++[CppCon talk] gives an overview of how the algorithm works. ++ ++Since Rust 1.36, this is now the `HashMap` implementation for the Rust standard ++library. However you may still want to use this crate instead since it works ++in environments without `std`, such as embedded systems and kernels. ++ ++[SwissTable]: https://abseil.io/blog/20180927-swisstables ++[here]: https://github.com/abseil/abseil-cpp/blob/master/absl/container/internal/raw_hash_set.h ++[CppCon talk]: https://www.youtube.com/watch?v=ncHmEUmJZf4 ++ ++## [Change log](CHANGELOG.md) ++ ++## Features ++ ++- Drop-in replacement for the standard library `HashMap` and `HashSet` types. ++- Uses [AHash](https://github.com/tkaitchuck/aHash) as the default hasher, which is much faster than SipHash. ++ However, AHash does *not provide the same level of HashDoS resistance* as SipHash, so if that is important to you, you might want to consider using a different hasher. ++- Around 2x faster than the previous standard library `HashMap`. ++- Lower memory usage: only 1 byte of overhead per entry instead of 8. ++- Compatible with `#[no_std]` (but requires a global allocator with the `alloc` crate). ++- Empty hash maps do not allocate any memory. ++- SIMD lookups to scan multiple hash entries in parallel. ++ ++## Performance ++ ++Compared to the previous implementation of `std::collections::HashMap` (Rust 1.35). ++ ++With the hashbrown default AHash hasher: ++ ++| name | oldstdhash ns/iter | hashbrown ns/iter | diff ns/iter | diff % | speedup | ++| :-------------------------- | :----------------: | ----------------: | :----------: | ------: | ------- | ++| insert_ahash_highbits | 18,865 | 8,020 | -10,845 | -57.49% | x 2.35 | ++| insert_ahash_random | 19,711 | 8,019 | -11,692 | -59.32% | x 2.46 | ++| insert_ahash_serial | 19,365 | 6,463 | -12,902 | -66.63% | x 3.00 | ++| insert_erase_ahash_highbits | 51,136 | 17,916 | -33,220 | -64.96% | x 2.85 | ++| insert_erase_ahash_random | 51,157 | 17,688 | -33,469 | -65.42% | x 2.89 | ++| insert_erase_ahash_serial | 45,479 | 14,895 | -30,584 | -67.25% | x 3.05 | ++| iter_ahash_highbits | 1,399 | 1,092 | -307 | -21.94% | x 1.28 | ++| iter_ahash_random | 1,586 | 1,059 | -527 | -33.23% | x 1.50 | ++| iter_ahash_serial | 3,168 | 1,079 | -2,089 | -65.94% | x 2.94 | ++| lookup_ahash_highbits | 32,351 | 4,792 | -27,559 | -85.19% | x 6.75 | ++| lookup_ahash_random | 17,419 | 4,817 | -12,602 | -72.35% | x 3.62 | ++| lookup_ahash_serial | 15,254 | 3,606 | -11,648 | -76.36% | x 4.23 | ++| lookup_fail_ahash_highbits | 21,187 | 4,369 | -16,818 | -79.38% | x 4.85 | ++| lookup_fail_ahash_random | 21,550 | 4,395 | -17,155 | -79.61% | x 4.90 | ++| lookup_fail_ahash_serial | 19,450 | 3,176 | -16,274 | -83.67% | x 6.12 | ++ ++ ++With the libstd default SipHash hasher: ++ ++| name | oldstdhash ns/iter | hashbrown ns/iter | diff ns/iter | diff % | speedup | ++| :------------------------ | :----------------: | ----------------: | :----------: | ------: | ------- | ++| insert_std_highbits | 19,216 | 16,885 | -2,331 | -12.13% | x 1.14 | ++| insert_std_random | 19,179 | 17,034 | -2,145 | -11.18% | x 1.13 | ++| insert_std_serial | 19,462 | 17,493 | -1,969 | -10.12% | x 1.11 | ++| insert_erase_std_highbits | 50,825 | 35,847 | -14,978 | -29.47% | x 1.42 | ++| insert_erase_std_random | 51,448 | 35,392 | -16,056 | -31.21% | x 1.45 | ++| insert_erase_std_serial | 87,711 | 38,091 | -49,620 | -56.57% | x 2.30 | ++| iter_std_highbits | 1,378 | 1,159 | -219 | -15.89% | x 1.19 | ++| iter_std_random | 1,395 | 1,132 | -263 | -18.85% | x 1.23 | ++| iter_std_serial | 1,704 | 1,105 | -599 | -35.15% | x 1.54 | ++| lookup_std_highbits | 17,195 | 13,642 | -3,553 | -20.66% | x 1.26 | ++| lookup_std_random | 17,181 | 13,773 | -3,408 | -19.84% | x 1.25 | ++| lookup_std_serial | 15,483 | 13,651 | -1,832 | -11.83% | x 1.13 | ++| lookup_fail_std_highbits | 20,926 | 13,474 | -7,452 | -35.61% | x 1.55 | ++| lookup_fail_std_random | 21,766 | 13,505 | -8,261 | -37.95% | x 1.61 | ++| lookup_fail_std_serial | 19,336 | 13,519 | -5,817 | -30.08% | x 1.43 | ++ ++## Usage ++ ++Add this to your `Cargo.toml`: ++ ++```toml ++[dependencies] ++hashbrown = "0.14" ++``` ++ ++Then: ++ ++```rust ++use hashbrown::HashMap; ++ ++let mut map = HashMap::new(); ++map.insert(1, "one"); ++``` ++## Flags ++This crate has the following Cargo features: ++ ++- `nightly`: Enables nightly-only features including: `#[may_dangle]`. ++- `serde`: Enables serde serialization support. ++- `rkyv`: Enables rkyv serialization support. ++- `rayon`: Enables rayon parallel iterator support. ++- `raw`: Enables access to the experimental and unsafe `RawTable` API. ++- `inline-more`: Adds inline hints to most functions, improving run-time performance at the cost ++ of compilation time. (enabled by default) ++- `ahash`: Compiles with ahash as default hasher. (enabled by default) ++- `allocator-api2`: Enables support for allocators that support `allocator-api2`. (enabled by default) ++ ++## License ++ ++Licensed under either of: ++ ++ * Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or https://www.apache.org/licenses/LICENSE-2.0) ++ * MIT license ([LICENSE-MIT](LICENSE-MIT) or https://opensource.org/licenses/MIT) ++ ++at your option. ++ ++### Contribution ++ ++Unless you explicitly state otherwise, any contribution intentionally submitted ++for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any ++additional terms or conditions. +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/src/external_trait_impls/mod.rs mesa-25.3.3/subprojects/hashbrown-0.14.5/src/external_trait_impls/mod.rs +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/src/external_trait_impls/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/src/external_trait_impls/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,6 @@ ++#[cfg(feature = "rayon")] ++pub(crate) mod rayon; ++#[cfg(feature = "rkyv")] ++mod rkyv; ++#[cfg(feature = "serde")] ++mod serde; +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/src/external_trait_impls/rayon/helpers.rs mesa-25.3.3/subprojects/hashbrown-0.14.5/src/external_trait_impls/rayon/helpers.rs +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/src/external_trait_impls/rayon/helpers.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/src/external_trait_impls/rayon/helpers.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,27 @@ ++use alloc::collections::LinkedList; ++use alloc::vec::Vec; ++ ++use rayon::iter::{IntoParallelIterator, ParallelIterator}; ++ ++/// Helper for collecting parallel iterators to an intermediary ++#[allow(clippy::linkedlist)] // yes, we need linked list here for efficient appending! ++pub(super) fn collect(iter: I) -> (LinkedList>, usize) { ++ let list = iter ++ .into_par_iter() ++ .fold(Vec::new, |mut vec, elem| { ++ vec.push(elem); ++ vec ++ }) ++ .map(|vec| { ++ let mut list = LinkedList::new(); ++ list.push_back(vec); ++ list ++ }) ++ .reduce(LinkedList::new, |mut list1, mut list2| { ++ list1.append(&mut list2); ++ list1 ++ }); ++ ++ let len = list.iter().map(Vec::len).sum(); ++ (list, len) ++} +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/src/external_trait_impls/rayon/map.rs mesa-25.3.3/subprojects/hashbrown-0.14.5/src/external_trait_impls/rayon/map.rs +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/src/external_trait_impls/rayon/map.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/src/external_trait_impls/rayon/map.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,721 @@ ++//! Rayon extensions for `HashMap`. ++ ++use super::raw::{RawIntoParIter, RawParDrain, RawParIter}; ++use crate::hash_map::HashMap; ++use crate::raw::{Allocator, Global}; ++use core::fmt; ++use core::hash::{BuildHasher, Hash}; ++use core::marker::PhantomData; ++use rayon::iter::plumbing::UnindexedConsumer; ++use rayon::iter::{FromParallelIterator, IntoParallelIterator, ParallelExtend, ParallelIterator}; ++ ++/// Parallel iterator over shared references to entries in a map. ++/// ++/// This iterator is created by the [`par_iter`] method on [`HashMap`] ++/// (provided by the [`IntoParallelRefIterator`] trait). ++/// See its documentation for more. ++/// ++/// [`par_iter`]: /hashbrown/struct.HashMap.html#method.par_iter ++/// [`HashMap`]: /hashbrown/struct.HashMap.html ++/// [`IntoParallelRefIterator`]: https://docs.rs/rayon/1.0/rayon/iter/trait.IntoParallelRefIterator.html ++pub struct ParIter<'a, K, V> { ++ inner: RawParIter<(K, V)>, ++ marker: PhantomData<(&'a K, &'a V)>, ++} ++ ++impl<'a, K: Sync, V: Sync> ParallelIterator for ParIter<'a, K, V> { ++ type Item = (&'a K, &'a V); ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn drive_unindexed(self, consumer: C) -> C::Result ++ where ++ C: UnindexedConsumer, ++ { ++ self.inner ++ .map(|x| unsafe { ++ let r = x.as_ref(); ++ (&r.0, &r.1) ++ }) ++ .drive_unindexed(consumer) ++ } ++} ++ ++impl Clone for ParIter<'_, K, V> { ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn clone(&self) -> Self { ++ Self { ++ inner: self.inner.clone(), ++ marker: PhantomData, ++ } ++ } ++} ++ ++impl fmt::Debug for ParIter<'_, K, V> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ let iter = unsafe { self.inner.iter() }.map(|x| unsafe { ++ let r = x.as_ref(); ++ (&r.0, &r.1) ++ }); ++ f.debug_list().entries(iter).finish() ++ } ++} ++ ++/// Parallel iterator over shared references to keys in a map. ++/// ++/// This iterator is created by the [`par_keys`] method on [`HashMap`]. ++/// See its documentation for more. ++/// ++/// [`par_keys`]: /hashbrown/struct.HashMap.html#method.par_keys ++/// [`HashMap`]: /hashbrown/struct.HashMap.html ++pub struct ParKeys<'a, K, V> { ++ inner: RawParIter<(K, V)>, ++ marker: PhantomData<(&'a K, &'a V)>, ++} ++ ++impl<'a, K: Sync, V: Sync> ParallelIterator for ParKeys<'a, K, V> { ++ type Item = &'a K; ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn drive_unindexed(self, consumer: C) -> C::Result ++ where ++ C: UnindexedConsumer, ++ { ++ self.inner ++ .map(|x| unsafe { &x.as_ref().0 }) ++ .drive_unindexed(consumer) ++ } ++} ++ ++impl Clone for ParKeys<'_, K, V> { ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn clone(&self) -> Self { ++ Self { ++ inner: self.inner.clone(), ++ marker: PhantomData, ++ } ++ } ++} ++ ++impl fmt::Debug for ParKeys<'_, K, V> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ let iter = unsafe { self.inner.iter() }.map(|x| unsafe { &x.as_ref().0 }); ++ f.debug_list().entries(iter).finish() ++ } ++} ++ ++/// Parallel iterator over shared references to values in a map. ++/// ++/// This iterator is created by the [`par_values`] method on [`HashMap`]. ++/// See its documentation for more. ++/// ++/// [`par_values`]: /hashbrown/struct.HashMap.html#method.par_values ++/// [`HashMap`]: /hashbrown/struct.HashMap.html ++pub struct ParValues<'a, K, V> { ++ inner: RawParIter<(K, V)>, ++ marker: PhantomData<(&'a K, &'a V)>, ++} ++ ++impl<'a, K: Sync, V: Sync> ParallelIterator for ParValues<'a, K, V> { ++ type Item = &'a V; ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn drive_unindexed(self, consumer: C) -> C::Result ++ where ++ C: UnindexedConsumer, ++ { ++ self.inner ++ .map(|x| unsafe { &x.as_ref().1 }) ++ .drive_unindexed(consumer) ++ } ++} ++ ++impl Clone for ParValues<'_, K, V> { ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn clone(&self) -> Self { ++ Self { ++ inner: self.inner.clone(), ++ marker: PhantomData, ++ } ++ } ++} ++ ++impl fmt::Debug for ParValues<'_, K, V> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ let iter = unsafe { self.inner.iter() }.map(|x| unsafe { &x.as_ref().1 }); ++ f.debug_list().entries(iter).finish() ++ } ++} ++ ++/// Parallel iterator over mutable references to entries in a map. ++/// ++/// This iterator is created by the [`par_iter_mut`] method on [`HashMap`] ++/// (provided by the [`IntoParallelRefMutIterator`] trait). ++/// See its documentation for more. ++/// ++/// [`par_iter_mut`]: /hashbrown/struct.HashMap.html#method.par_iter_mut ++/// [`HashMap`]: /hashbrown/struct.HashMap.html ++/// [`IntoParallelRefMutIterator`]: https://docs.rs/rayon/1.0/rayon/iter/trait.IntoParallelRefMutIterator.html ++pub struct ParIterMut<'a, K, V> { ++ inner: RawParIter<(K, V)>, ++ marker: PhantomData<(&'a K, &'a mut V)>, ++} ++ ++impl<'a, K: Sync, V: Send> ParallelIterator for ParIterMut<'a, K, V> { ++ type Item = (&'a K, &'a mut V); ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn drive_unindexed(self, consumer: C) -> C::Result ++ where ++ C: UnindexedConsumer, ++ { ++ self.inner ++ .map(|x| unsafe { ++ let r = x.as_mut(); ++ (&r.0, &mut r.1) ++ }) ++ .drive_unindexed(consumer) ++ } ++} ++ ++impl fmt::Debug for ParIterMut<'_, K, V> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ ParIter { ++ inner: self.inner.clone(), ++ marker: PhantomData, ++ } ++ .fmt(f) ++ } ++} ++ ++/// Parallel iterator over mutable references to values in a map. ++/// ++/// This iterator is created by the [`par_values_mut`] method on [`HashMap`]. ++/// See its documentation for more. ++/// ++/// [`par_values_mut`]: /hashbrown/struct.HashMap.html#method.par_values_mut ++/// [`HashMap`]: /hashbrown/struct.HashMap.html ++pub struct ParValuesMut<'a, K, V> { ++ inner: RawParIter<(K, V)>, ++ marker: PhantomData<(&'a K, &'a mut V)>, ++} ++ ++impl<'a, K: Sync, V: Send> ParallelIterator for ParValuesMut<'a, K, V> { ++ type Item = &'a mut V; ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn drive_unindexed(self, consumer: C) -> C::Result ++ where ++ C: UnindexedConsumer, ++ { ++ self.inner ++ .map(|x| unsafe { &mut x.as_mut().1 }) ++ .drive_unindexed(consumer) ++ } ++} ++ ++impl fmt::Debug for ParValuesMut<'_, K, V> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ ParValues { ++ inner: self.inner.clone(), ++ marker: PhantomData, ++ } ++ .fmt(f) ++ } ++} ++ ++/// Parallel iterator over entries of a consumed map. ++/// ++/// This iterator is created by the [`into_par_iter`] method on [`HashMap`] ++/// (provided by the [`IntoParallelIterator`] trait). ++/// See its documentation for more. ++/// ++/// [`into_par_iter`]: /hashbrown/struct.HashMap.html#method.into_par_iter ++/// [`HashMap`]: /hashbrown/struct.HashMap.html ++/// [`IntoParallelIterator`]: https://docs.rs/rayon/1.0/rayon/iter/trait.IntoParallelIterator.html ++pub struct IntoParIter { ++ inner: RawIntoParIter<(K, V), A>, ++} ++ ++impl ParallelIterator for IntoParIter { ++ type Item = (K, V); ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn drive_unindexed(self, consumer: C) -> C::Result ++ where ++ C: UnindexedConsumer, ++ { ++ self.inner.drive_unindexed(consumer) ++ } ++} ++ ++impl fmt::Debug for IntoParIter { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ ParIter { ++ inner: unsafe { self.inner.par_iter() }, ++ marker: PhantomData, ++ } ++ .fmt(f) ++ } ++} ++ ++/// Parallel draining iterator over entries of a map. ++/// ++/// This iterator is created by the [`par_drain`] method on [`HashMap`]. ++/// See its documentation for more. ++/// ++/// [`par_drain`]: /hashbrown/struct.HashMap.html#method.par_drain ++/// [`HashMap`]: /hashbrown/struct.HashMap.html ++pub struct ParDrain<'a, K, V, A: Allocator = Global> { ++ inner: RawParDrain<'a, (K, V), A>, ++} ++ ++impl ParallelIterator for ParDrain<'_, K, V, A> { ++ type Item = (K, V); ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn drive_unindexed(self, consumer: C) -> C::Result ++ where ++ C: UnindexedConsumer, ++ { ++ self.inner.drive_unindexed(consumer) ++ } ++} ++ ++impl fmt::Debug for ParDrain<'_, K, V, A> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ ParIter { ++ inner: unsafe { self.inner.par_iter() }, ++ marker: PhantomData, ++ } ++ .fmt(f) ++ } ++} ++ ++impl HashMap { ++ /// Visits (potentially in parallel) immutably borrowed keys in an arbitrary order. ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn par_keys(&self) -> ParKeys<'_, K, V> { ++ ParKeys { ++ inner: unsafe { self.table.par_iter() }, ++ marker: PhantomData, ++ } ++ } ++ ++ /// Visits (potentially in parallel) immutably borrowed values in an arbitrary order. ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn par_values(&self) -> ParValues<'_, K, V> { ++ ParValues { ++ inner: unsafe { self.table.par_iter() }, ++ marker: PhantomData, ++ } ++ } ++} ++ ++impl HashMap { ++ /// Visits (potentially in parallel) mutably borrowed values in an arbitrary order. ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn par_values_mut(&mut self) -> ParValuesMut<'_, K, V> { ++ ParValuesMut { ++ inner: unsafe { self.table.par_iter() }, ++ marker: PhantomData, ++ } ++ } ++ ++ /// Consumes (potentially in parallel) all values in an arbitrary order, ++ /// while preserving the map's allocated memory for reuse. ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn par_drain(&mut self) -> ParDrain<'_, K, V, A> { ++ ParDrain { ++ inner: self.table.par_drain(), ++ } ++ } ++} ++ ++impl HashMap ++where ++ K: Eq + Hash + Sync, ++ V: PartialEq + Sync, ++ S: BuildHasher + Sync, ++ A: Allocator + Sync, ++{ ++ /// Returns `true` if the map is equal to another, ++ /// i.e. both maps contain the same keys mapped to the same values. ++ /// ++ /// This method runs in a potentially parallel fashion. ++ pub fn par_eq(&self, other: &Self) -> bool { ++ self.len() == other.len() ++ && self ++ .into_par_iter() ++ .all(|(key, value)| other.get(key).map_or(false, |v| *value == *v)) ++ } ++} ++ ++impl IntoParallelIterator for HashMap { ++ type Item = (K, V); ++ type Iter = IntoParIter; ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn into_par_iter(self) -> Self::Iter { ++ IntoParIter { ++ inner: self.table.into_par_iter(), ++ } ++ } ++} ++ ++impl<'a, K: Sync, V: Sync, S, A: Allocator> IntoParallelIterator for &'a HashMap { ++ type Item = (&'a K, &'a V); ++ type Iter = ParIter<'a, K, V>; ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn into_par_iter(self) -> Self::Iter { ++ ParIter { ++ inner: unsafe { self.table.par_iter() }, ++ marker: PhantomData, ++ } ++ } ++} ++ ++impl<'a, K: Sync, V: Send, S, A: Allocator> IntoParallelIterator for &'a mut HashMap { ++ type Item = (&'a K, &'a mut V); ++ type Iter = ParIterMut<'a, K, V>; ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn into_par_iter(self) -> Self::Iter { ++ ParIterMut { ++ inner: unsafe { self.table.par_iter() }, ++ marker: PhantomData, ++ } ++ } ++} ++ ++/// Collect (key, value) pairs from a parallel iterator into a ++/// hashmap. If multiple pairs correspond to the same key, then the ++/// ones produced earlier in the parallel iterator will be ++/// overwritten, just as with a sequential iterator. ++impl FromParallelIterator<(K, V)> for HashMap ++where ++ K: Eq + Hash + Send, ++ V: Send, ++ S: BuildHasher + Default, ++{ ++ fn from_par_iter

(par_iter: P) -> Self ++ where ++ P: IntoParallelIterator, ++ { ++ let mut map = HashMap::default(); ++ map.par_extend(par_iter); ++ map ++ } ++} ++ ++/// Extend a hash map with items from a parallel iterator. ++impl ParallelExtend<(K, V)> for HashMap ++where ++ K: Eq + Hash + Send, ++ V: Send, ++ S: BuildHasher, ++ A: Allocator, ++{ ++ fn par_extend(&mut self, par_iter: I) ++ where ++ I: IntoParallelIterator, ++ { ++ extend(self, par_iter); ++ } ++} ++ ++/// Extend a hash map with copied items from a parallel iterator. ++impl<'a, K, V, S, A> ParallelExtend<(&'a K, &'a V)> for HashMap ++where ++ K: Copy + Eq + Hash + Sync, ++ V: Copy + Sync, ++ S: BuildHasher, ++ A: Allocator, ++{ ++ fn par_extend(&mut self, par_iter: I) ++ where ++ I: IntoParallelIterator, ++ { ++ extend(self, par_iter); ++ } ++} ++ ++// This is equal to the normal `HashMap` -- no custom advantage. ++fn extend(map: &mut HashMap, par_iter: I) ++where ++ K: Eq + Hash, ++ S: BuildHasher, ++ I: IntoParallelIterator, ++ A: Allocator, ++ HashMap: Extend, ++{ ++ let (list, len) = super::helpers::collect(par_iter); ++ ++ // Keys may be already present or show multiple times in the iterator. ++ // Reserve the entire length if the map is empty. ++ // Otherwise reserve half the length (rounded up), so the map ++ // will only resize twice in the worst case. ++ let reserve = if map.is_empty() { len } else { (len + 1) / 2 }; ++ map.reserve(reserve); ++ for vec in list { ++ map.extend(vec); ++ } ++} ++ ++#[cfg(test)] ++mod test_par_map { ++ use alloc::vec::Vec; ++ use core::hash::{Hash, Hasher}; ++ use core::sync::atomic::{AtomicUsize, Ordering}; ++ ++ use rayon::prelude::*; ++ ++ use crate::hash_map::HashMap; ++ ++ struct Dropable<'a> { ++ k: usize, ++ counter: &'a AtomicUsize, ++ } ++ ++ impl Dropable<'_> { ++ fn new(k: usize, counter: &AtomicUsize) -> Dropable<'_> { ++ counter.fetch_add(1, Ordering::Relaxed); ++ ++ Dropable { k, counter } ++ } ++ } ++ ++ impl Drop for Dropable<'_> { ++ fn drop(&mut self) { ++ self.counter.fetch_sub(1, Ordering::Relaxed); ++ } ++ } ++ ++ impl Clone for Dropable<'_> { ++ fn clone(&self) -> Self { ++ Dropable::new(self.k, self.counter) ++ } ++ } ++ ++ impl Hash for Dropable<'_> { ++ fn hash(&self, state: &mut H) ++ where ++ H: Hasher, ++ { ++ self.k.hash(state); ++ } ++ } ++ ++ impl PartialEq for Dropable<'_> { ++ fn eq(&self, other: &Self) -> bool { ++ self.k == other.k ++ } ++ } ++ ++ impl Eq for Dropable<'_> {} ++ ++ #[test] ++ fn test_into_iter_drops() { ++ let key = AtomicUsize::new(0); ++ let value = AtomicUsize::new(0); ++ ++ let hm = { ++ let mut hm = HashMap::new(); ++ ++ assert_eq!(key.load(Ordering::Relaxed), 0); ++ assert_eq!(value.load(Ordering::Relaxed), 0); ++ ++ for i in 0..100 { ++ let d1 = Dropable::new(i, &key); ++ let d2 = Dropable::new(i + 100, &value); ++ hm.insert(d1, d2); ++ } ++ ++ assert_eq!(key.load(Ordering::Relaxed), 100); ++ assert_eq!(value.load(Ordering::Relaxed), 100); ++ ++ hm ++ }; ++ ++ // By the way, ensure that cloning doesn't screw up the dropping. ++ drop(hm.clone()); ++ ++ assert_eq!(key.load(Ordering::Relaxed), 100); ++ assert_eq!(value.load(Ordering::Relaxed), 100); ++ ++ // Ensure that dropping the iterator does not leak anything. ++ drop(hm.clone().into_par_iter()); ++ ++ { ++ assert_eq!(key.load(Ordering::Relaxed), 100); ++ assert_eq!(value.load(Ordering::Relaxed), 100); ++ ++ // retain only half ++ let _v: Vec<_> = hm.into_par_iter().filter(|(key, _)| key.k < 50).collect(); ++ ++ assert_eq!(key.load(Ordering::Relaxed), 50); ++ assert_eq!(value.load(Ordering::Relaxed), 50); ++ }; ++ ++ assert_eq!(key.load(Ordering::Relaxed), 0); ++ assert_eq!(value.load(Ordering::Relaxed), 0); ++ } ++ ++ #[test] ++ fn test_drain_drops() { ++ let key = AtomicUsize::new(0); ++ let value = AtomicUsize::new(0); ++ ++ let mut hm = { ++ let mut hm = HashMap::new(); ++ ++ assert_eq!(key.load(Ordering::Relaxed), 0); ++ assert_eq!(value.load(Ordering::Relaxed), 0); ++ ++ for i in 0..100 { ++ let d1 = Dropable::new(i, &key); ++ let d2 = Dropable::new(i + 100, &value); ++ hm.insert(d1, d2); ++ } ++ ++ assert_eq!(key.load(Ordering::Relaxed), 100); ++ assert_eq!(value.load(Ordering::Relaxed), 100); ++ ++ hm ++ }; ++ ++ // By the way, ensure that cloning doesn't screw up the dropping. ++ drop(hm.clone()); ++ ++ assert_eq!(key.load(Ordering::Relaxed), 100); ++ assert_eq!(value.load(Ordering::Relaxed), 100); ++ ++ // Ensure that dropping the drain iterator does not leak anything. ++ drop(hm.clone().par_drain()); ++ ++ { ++ assert_eq!(key.load(Ordering::Relaxed), 100); ++ assert_eq!(value.load(Ordering::Relaxed), 100); ++ ++ // retain only half ++ let _v: Vec<_> = hm.drain().filter(|(key, _)| key.k < 50).collect(); ++ assert!(hm.is_empty()); ++ ++ assert_eq!(key.load(Ordering::Relaxed), 50); ++ assert_eq!(value.load(Ordering::Relaxed), 50); ++ }; ++ ++ assert_eq!(key.load(Ordering::Relaxed), 0); ++ assert_eq!(value.load(Ordering::Relaxed), 0); ++ } ++ ++ #[test] ++ fn test_empty_iter() { ++ let mut m: HashMap = HashMap::new(); ++ assert_eq!(m.par_drain().count(), 0); ++ assert_eq!(m.par_keys().count(), 0); ++ assert_eq!(m.par_values().count(), 0); ++ assert_eq!(m.par_values_mut().count(), 0); ++ assert_eq!(m.par_iter().count(), 0); ++ assert_eq!(m.par_iter_mut().count(), 0); ++ assert_eq!(m.len(), 0); ++ assert!(m.is_empty()); ++ assert_eq!(m.into_par_iter().count(), 0); ++ } ++ ++ #[test] ++ fn test_iterate() { ++ let mut m = HashMap::with_capacity(4); ++ for i in 0..32 { ++ assert!(m.insert(i, i * 2).is_none()); ++ } ++ assert_eq!(m.len(), 32); ++ ++ let observed = AtomicUsize::new(0); ++ ++ m.par_iter().for_each(|(k, v)| { ++ assert_eq!(*v, *k * 2); ++ observed.fetch_or(1 << *k, Ordering::Relaxed); ++ }); ++ assert_eq!(observed.into_inner(), 0xFFFF_FFFF); ++ } ++ ++ #[test] ++ fn test_keys() { ++ let vec = vec![(1, 'a'), (2, 'b'), (3, 'c')]; ++ let map: HashMap<_, _> = vec.into_par_iter().collect(); ++ let keys: Vec<_> = map.par_keys().cloned().collect(); ++ assert_eq!(keys.len(), 3); ++ assert!(keys.contains(&1)); ++ assert!(keys.contains(&2)); ++ assert!(keys.contains(&3)); ++ } ++ ++ #[test] ++ fn test_values() { ++ let vec = vec![(1, 'a'), (2, 'b'), (3, 'c')]; ++ let map: HashMap<_, _> = vec.into_par_iter().collect(); ++ let values: Vec<_> = map.par_values().cloned().collect(); ++ assert_eq!(values.len(), 3); ++ assert!(values.contains(&'a')); ++ assert!(values.contains(&'b')); ++ assert!(values.contains(&'c')); ++ } ++ ++ #[test] ++ fn test_values_mut() { ++ let vec = vec![(1, 1), (2, 2), (3, 3)]; ++ let mut map: HashMap<_, _> = vec.into_par_iter().collect(); ++ map.par_values_mut().for_each(|value| *value *= 2); ++ let values: Vec<_> = map.par_values().cloned().collect(); ++ assert_eq!(values.len(), 3); ++ assert!(values.contains(&2)); ++ assert!(values.contains(&4)); ++ assert!(values.contains(&6)); ++ } ++ ++ #[test] ++ fn test_eq() { ++ let mut m1 = HashMap::new(); ++ m1.insert(1, 2); ++ m1.insert(2, 3); ++ m1.insert(3, 4); ++ ++ let mut m2 = HashMap::new(); ++ m2.insert(1, 2); ++ m2.insert(2, 3); ++ ++ assert!(!m1.par_eq(&m2)); ++ ++ m2.insert(3, 4); ++ ++ assert!(m1.par_eq(&m2)); ++ } ++ ++ #[test] ++ fn test_from_iter() { ++ let xs = [(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6)]; ++ ++ let map: HashMap<_, _> = xs.par_iter().cloned().collect(); ++ ++ for &(k, v) in &xs { ++ assert_eq!(map.get(&k), Some(&v)); ++ } ++ } ++ ++ #[test] ++ fn test_extend_ref() { ++ let mut a = HashMap::new(); ++ a.insert(1, "one"); ++ let mut b = HashMap::new(); ++ b.insert(2, "two"); ++ b.insert(3, "three"); ++ ++ a.par_extend(&b); ++ ++ assert_eq!(a.len(), 3); ++ assert_eq!(a[&1], "one"); ++ assert_eq!(a[&2], "two"); ++ assert_eq!(a[&3], "three"); ++ } ++} +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/src/external_trait_impls/rayon/mod.rs mesa-25.3.3/subprojects/hashbrown-0.14.5/src/external_trait_impls/rayon/mod.rs +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/src/external_trait_impls/rayon/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/src/external_trait_impls/rayon/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,5 @@ ++mod helpers; ++pub(crate) mod map; ++pub(crate) mod raw; ++pub(crate) mod set; ++pub(crate) mod table; +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/src/external_trait_impls/rayon/raw.rs mesa-25.3.3/subprojects/hashbrown-0.14.5/src/external_trait_impls/rayon/raw.rs +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/src/external_trait_impls/rayon/raw.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/src/external_trait_impls/rayon/raw.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,230 @@ ++use crate::raw::Bucket; ++use crate::raw::{Allocator, Global, RawIter, RawIterRange, RawTable}; ++use crate::scopeguard::guard; ++use core::marker::PhantomData; ++use core::mem; ++use core::ptr::NonNull; ++use rayon::iter::{ ++ plumbing::{self, Folder, UnindexedConsumer, UnindexedProducer}, ++ ParallelIterator, ++}; ++ ++/// Parallel iterator which returns a raw pointer to every full bucket in the table. ++pub struct RawParIter { ++ iter: RawIterRange, ++} ++ ++impl RawParIter { ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub(super) unsafe fn iter(&self) -> RawIterRange { ++ self.iter.clone() ++ } ++} ++ ++impl Clone for RawParIter { ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn clone(&self) -> Self { ++ Self { ++ iter: self.iter.clone(), ++ } ++ } ++} ++ ++impl From> for RawParIter { ++ fn from(it: RawIter) -> Self { ++ RawParIter { iter: it.iter } ++ } ++} ++ ++impl ParallelIterator for RawParIter { ++ type Item = Bucket; ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn drive_unindexed(self, consumer: C) -> C::Result ++ where ++ C: UnindexedConsumer, ++ { ++ let producer = ParIterProducer { iter: self.iter }; ++ plumbing::bridge_unindexed(producer, consumer) ++ } ++} ++ ++/// Producer which returns a `Bucket` for every element. ++struct ParIterProducer { ++ iter: RawIterRange, ++} ++ ++impl UnindexedProducer for ParIterProducer { ++ type Item = Bucket; ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn split(self) -> (Self, Option) { ++ let (left, right) = self.iter.split(); ++ let left = ParIterProducer { iter: left }; ++ let right = right.map(|right| ParIterProducer { iter: right }); ++ (left, right) ++ } ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn fold_with(self, folder: F) -> F ++ where ++ F: Folder, ++ { ++ folder.consume_iter(self.iter) ++ } ++} ++ ++/// Parallel iterator which consumes a table and returns elements. ++pub struct RawIntoParIter { ++ table: RawTable, ++} ++ ++impl RawIntoParIter { ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub(super) unsafe fn par_iter(&self) -> RawParIter { ++ self.table.par_iter() ++ } ++} ++ ++impl ParallelIterator for RawIntoParIter { ++ type Item = T; ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn drive_unindexed(self, consumer: C) -> C::Result ++ where ++ C: UnindexedConsumer, ++ { ++ let iter = unsafe { self.table.iter().iter }; ++ let _guard = guard(self.table.into_allocation(), |alloc| { ++ if let Some((ptr, layout, ref alloc)) = *alloc { ++ unsafe { ++ alloc.deallocate(ptr, layout); ++ } ++ } ++ }); ++ let producer = ParDrainProducer { iter }; ++ plumbing::bridge_unindexed(producer, consumer) ++ } ++} ++ ++/// Parallel iterator which consumes elements without freeing the table storage. ++pub struct RawParDrain<'a, T, A: Allocator = Global> { ++ // We don't use a &'a mut RawTable because we want RawParDrain to be ++ // covariant over T. ++ table: NonNull>, ++ marker: PhantomData<&'a RawTable>, ++} ++ ++unsafe impl Send for RawParDrain<'_, T, A> {} ++ ++impl RawParDrain<'_, T, A> { ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub(super) unsafe fn par_iter(&self) -> RawParIter { ++ self.table.as_ref().par_iter() ++ } ++} ++ ++impl ParallelIterator for RawParDrain<'_, T, A> { ++ type Item = T; ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn drive_unindexed(self, consumer: C) -> C::Result ++ where ++ C: UnindexedConsumer, ++ { ++ let _guard = guard(self.table, |table| unsafe { ++ table.as_mut().clear_no_drop(); ++ }); ++ let iter = unsafe { self.table.as_ref().iter().iter }; ++ mem::forget(self); ++ let producer = ParDrainProducer { iter }; ++ plumbing::bridge_unindexed(producer, consumer) ++ } ++} ++ ++impl Drop for RawParDrain<'_, T, A> { ++ fn drop(&mut self) { ++ // If drive_unindexed is not called then simply clear the table. ++ unsafe { ++ self.table.as_mut().clear(); ++ } ++ } ++} ++ ++/// Producer which will consume all elements in the range, even if it is dropped ++/// halfway through. ++struct ParDrainProducer { ++ iter: RawIterRange, ++} ++ ++impl UnindexedProducer for ParDrainProducer { ++ type Item = T; ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn split(self) -> (Self, Option) { ++ let (left, right) = self.iter.clone().split(); ++ mem::forget(self); ++ let left = ParDrainProducer { iter: left }; ++ let right = right.map(|right| ParDrainProducer { iter: right }); ++ (left, right) ++ } ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn fold_with(mut self, mut folder: F) -> F ++ where ++ F: Folder, ++ { ++ // Make sure to modify the iterator in-place so that any remaining ++ // elements are processed in our Drop impl. ++ for item in &mut self.iter { ++ folder = folder.consume(unsafe { item.read() }); ++ if folder.full() { ++ return folder; ++ } ++ } ++ ++ // If we processed all elements then we don't need to run the drop. ++ mem::forget(self); ++ folder ++ } ++} ++ ++impl Drop for ParDrainProducer { ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn drop(&mut self) { ++ // Drop all remaining elements ++ if mem::needs_drop::() { ++ for item in &mut self.iter { ++ unsafe { ++ item.drop(); ++ } ++ } ++ } ++ } ++} ++ ++impl RawTable { ++ /// Returns a parallel iterator over the elements in a `RawTable`. ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub unsafe fn par_iter(&self) -> RawParIter { ++ RawParIter { ++ iter: self.iter().iter, ++ } ++ } ++ ++ /// Returns a parallel iterator over the elements in a `RawTable`. ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn into_par_iter(self) -> RawIntoParIter { ++ RawIntoParIter { table: self } ++ } ++ ++ /// Returns a parallel iterator which consumes all elements of a `RawTable` ++ /// without freeing its memory allocation. ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn par_drain(&mut self) -> RawParDrain<'_, T, A> { ++ RawParDrain { ++ table: NonNull::from(self), ++ marker: PhantomData, ++ } ++ } ++} +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/src/external_trait_impls/rayon/set.rs mesa-25.3.3/subprojects/hashbrown-0.14.5/src/external_trait_impls/rayon/set.rs +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/src/external_trait_impls/rayon/set.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/src/external_trait_impls/rayon/set.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,659 @@ ++//! Rayon extensions for `HashSet`. ++ ++use super::map; ++use crate::hash_set::HashSet; ++use crate::raw::{Allocator, Global}; ++use core::hash::{BuildHasher, Hash}; ++use rayon::iter::plumbing::UnindexedConsumer; ++use rayon::iter::{FromParallelIterator, IntoParallelIterator, ParallelExtend, ParallelIterator}; ++ ++/// Parallel iterator over elements of a consumed set. ++/// ++/// This iterator is created by the [`into_par_iter`] method on [`HashSet`] ++/// (provided by the [`IntoParallelIterator`] trait). ++/// See its documentation for more. ++/// ++/// [`into_par_iter`]: /hashbrown/struct.HashSet.html#method.into_par_iter ++/// [`HashSet`]: /hashbrown/struct.HashSet.html ++/// [`IntoParallelIterator`]: https://docs.rs/rayon/1.0/rayon/iter/trait.IntoParallelIterator.html ++pub struct IntoParIter { ++ inner: map::IntoParIter, ++} ++ ++impl ParallelIterator for IntoParIter { ++ type Item = T; ++ ++ fn drive_unindexed(self, consumer: C) -> C::Result ++ where ++ C: UnindexedConsumer, ++ { ++ self.inner.map(|(k, _)| k).drive_unindexed(consumer) ++ } ++} ++ ++/// Parallel draining iterator over entries of a set. ++/// ++/// This iterator is created by the [`par_drain`] method on [`HashSet`]. ++/// See its documentation for more. ++/// ++/// [`par_drain`]: /hashbrown/struct.HashSet.html#method.par_drain ++/// [`HashSet`]: /hashbrown/struct.HashSet.html ++pub struct ParDrain<'a, T, A: Allocator = Global> { ++ inner: map::ParDrain<'a, T, (), A>, ++} ++ ++impl ParallelIterator for ParDrain<'_, T, A> { ++ type Item = T; ++ ++ fn drive_unindexed(self, consumer: C) -> C::Result ++ where ++ C: UnindexedConsumer, ++ { ++ self.inner.map(|(k, _)| k).drive_unindexed(consumer) ++ } ++} ++ ++/// Parallel iterator over shared references to elements in a set. ++/// ++/// This iterator is created by the [`par_iter`] method on [`HashSet`] ++/// (provided by the [`IntoParallelRefIterator`] trait). ++/// See its documentation for more. ++/// ++/// [`par_iter`]: /hashbrown/struct.HashSet.html#method.par_iter ++/// [`HashSet`]: /hashbrown/struct.HashSet.html ++/// [`IntoParallelRefIterator`]: https://docs.rs/rayon/1.0/rayon/iter/trait.IntoParallelRefIterator.html ++pub struct ParIter<'a, T> { ++ inner: map::ParKeys<'a, T, ()>, ++} ++ ++impl<'a, T: Sync> ParallelIterator for ParIter<'a, T> { ++ type Item = &'a T; ++ ++ fn drive_unindexed(self, consumer: C) -> C::Result ++ where ++ C: UnindexedConsumer, ++ { ++ self.inner.drive_unindexed(consumer) ++ } ++} ++ ++/// Parallel iterator over shared references to elements in the difference of ++/// sets. ++/// ++/// This iterator is created by the [`par_difference`] method on [`HashSet`]. ++/// See its documentation for more. ++/// ++/// [`par_difference`]: /hashbrown/struct.HashSet.html#method.par_difference ++/// [`HashSet`]: /hashbrown/struct.HashSet.html ++pub struct ParDifference<'a, T, S, A: Allocator = Global> { ++ a: &'a HashSet, ++ b: &'a HashSet, ++} ++ ++impl<'a, T, S, A> ParallelIterator for ParDifference<'a, T, S, A> ++where ++ T: Eq + Hash + Sync, ++ S: BuildHasher + Sync, ++ A: Allocator + Sync, ++{ ++ type Item = &'a T; ++ ++ fn drive_unindexed(self, consumer: C) -> C::Result ++ where ++ C: UnindexedConsumer, ++ { ++ self.a ++ .into_par_iter() ++ .filter(|&x| !self.b.contains(x)) ++ .drive_unindexed(consumer) ++ } ++} ++ ++/// Parallel iterator over shared references to elements in the symmetric ++/// difference of sets. ++/// ++/// This iterator is created by the [`par_symmetric_difference`] method on ++/// [`HashSet`]. ++/// See its documentation for more. ++/// ++/// [`par_symmetric_difference`]: /hashbrown/struct.HashSet.html#method.par_symmetric_difference ++/// [`HashSet`]: /hashbrown/struct.HashSet.html ++pub struct ParSymmetricDifference<'a, T, S, A: Allocator = Global> { ++ a: &'a HashSet, ++ b: &'a HashSet, ++} ++ ++impl<'a, T, S, A> ParallelIterator for ParSymmetricDifference<'a, T, S, A> ++where ++ T: Eq + Hash + Sync, ++ S: BuildHasher + Sync, ++ A: Allocator + Sync, ++{ ++ type Item = &'a T; ++ ++ fn drive_unindexed(self, consumer: C) -> C::Result ++ where ++ C: UnindexedConsumer, ++ { ++ self.a ++ .par_difference(self.b) ++ .chain(self.b.par_difference(self.a)) ++ .drive_unindexed(consumer) ++ } ++} ++ ++/// Parallel iterator over shared references to elements in the intersection of ++/// sets. ++/// ++/// This iterator is created by the [`par_intersection`] method on [`HashSet`]. ++/// See its documentation for more. ++/// ++/// [`par_intersection`]: /hashbrown/struct.HashSet.html#method.par_intersection ++/// [`HashSet`]: /hashbrown/struct.HashSet.html ++pub struct ParIntersection<'a, T, S, A: Allocator = Global> { ++ a: &'a HashSet, ++ b: &'a HashSet, ++} ++ ++impl<'a, T, S, A> ParallelIterator for ParIntersection<'a, T, S, A> ++where ++ T: Eq + Hash + Sync, ++ S: BuildHasher + Sync, ++ A: Allocator + Sync, ++{ ++ type Item = &'a T; ++ ++ fn drive_unindexed(self, consumer: C) -> C::Result ++ where ++ C: UnindexedConsumer, ++ { ++ self.a ++ .into_par_iter() ++ .filter(|&x| self.b.contains(x)) ++ .drive_unindexed(consumer) ++ } ++} ++ ++/// Parallel iterator over shared references to elements in the union of sets. ++/// ++/// This iterator is created by the [`par_union`] method on [`HashSet`]. ++/// See its documentation for more. ++/// ++/// [`par_union`]: /hashbrown/struct.HashSet.html#method.par_union ++/// [`HashSet`]: /hashbrown/struct.HashSet.html ++pub struct ParUnion<'a, T, S, A: Allocator = Global> { ++ a: &'a HashSet, ++ b: &'a HashSet, ++} ++ ++impl<'a, T, S, A> ParallelIterator for ParUnion<'a, T, S, A> ++where ++ T: Eq + Hash + Sync, ++ S: BuildHasher + Sync, ++ A: Allocator + Sync, ++{ ++ type Item = &'a T; ++ ++ fn drive_unindexed(self, consumer: C) -> C::Result ++ where ++ C: UnindexedConsumer, ++ { ++ // We'll iterate one set in full, and only the remaining difference from the other. ++ // Use the smaller set for the difference in order to reduce hash lookups. ++ let (smaller, larger) = if self.a.len() <= self.b.len() { ++ (self.a, self.b) ++ } else { ++ (self.b, self.a) ++ }; ++ larger ++ .into_par_iter() ++ .chain(smaller.par_difference(larger)) ++ .drive_unindexed(consumer) ++ } ++} ++ ++impl HashSet ++where ++ T: Eq + Hash + Sync, ++ S: BuildHasher + Sync, ++ A: Allocator + Sync, ++{ ++ /// Visits (potentially in parallel) the values representing the union, ++ /// i.e. all the values in `self` or `other`, without duplicates. ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn par_union<'a>(&'a self, other: &'a Self) -> ParUnion<'a, T, S, A> { ++ ParUnion { a: self, b: other } ++ } ++ ++ /// Visits (potentially in parallel) the values representing the difference, ++ /// i.e. the values that are in `self` but not in `other`. ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn par_difference<'a>(&'a self, other: &'a Self) -> ParDifference<'a, T, S, A> { ++ ParDifference { a: self, b: other } ++ } ++ ++ /// Visits (potentially in parallel) the values representing the symmetric ++ /// difference, i.e. the values that are in `self` or in `other` but not in both. ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn par_symmetric_difference<'a>( ++ &'a self, ++ other: &'a Self, ++ ) -> ParSymmetricDifference<'a, T, S, A> { ++ ParSymmetricDifference { a: self, b: other } ++ } ++ ++ /// Visits (potentially in parallel) the values representing the ++ /// intersection, i.e. the values that are both in `self` and `other`. ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn par_intersection<'a>(&'a self, other: &'a Self) -> ParIntersection<'a, T, S, A> { ++ ParIntersection { a: self, b: other } ++ } ++ ++ /// Returns `true` if `self` has no elements in common with `other`. ++ /// This is equivalent to checking for an empty intersection. ++ /// ++ /// This method runs in a potentially parallel fashion. ++ pub fn par_is_disjoint(&self, other: &Self) -> bool { ++ self.into_par_iter().all(|x| !other.contains(x)) ++ } ++ ++ /// Returns `true` if the set is a subset of another, ++ /// i.e. `other` contains at least all the values in `self`. ++ /// ++ /// This method runs in a potentially parallel fashion. ++ pub fn par_is_subset(&self, other: &Self) -> bool { ++ if self.len() <= other.len() { ++ self.into_par_iter().all(|x| other.contains(x)) ++ } else { ++ false ++ } ++ } ++ ++ /// Returns `true` if the set is a superset of another, ++ /// i.e. `self` contains at least all the values in `other`. ++ /// ++ /// This method runs in a potentially parallel fashion. ++ pub fn par_is_superset(&self, other: &Self) -> bool { ++ other.par_is_subset(self) ++ } ++ ++ /// Returns `true` if the set is equal to another, ++ /// i.e. both sets contain the same values. ++ /// ++ /// This method runs in a potentially parallel fashion. ++ pub fn par_eq(&self, other: &Self) -> bool { ++ self.len() == other.len() && self.par_is_subset(other) ++ } ++} ++ ++impl HashSet ++where ++ T: Eq + Hash + Send, ++ A: Allocator + Send, ++{ ++ /// Consumes (potentially in parallel) all values in an arbitrary order, ++ /// while preserving the set's allocated memory for reuse. ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn par_drain(&mut self) -> ParDrain<'_, T, A> { ++ ParDrain { ++ inner: self.map.par_drain(), ++ } ++ } ++} ++ ++impl IntoParallelIterator for HashSet { ++ type Item = T; ++ type Iter = IntoParIter; ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn into_par_iter(self) -> Self::Iter { ++ IntoParIter { ++ inner: self.map.into_par_iter(), ++ } ++ } ++} ++ ++impl<'a, T: Sync, S, A: Allocator> IntoParallelIterator for &'a HashSet { ++ type Item = &'a T; ++ type Iter = ParIter<'a, T>; ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn into_par_iter(self) -> Self::Iter { ++ ParIter { ++ inner: self.map.par_keys(), ++ } ++ } ++} ++ ++/// Collect values from a parallel iterator into a hashset. ++impl FromParallelIterator for HashSet ++where ++ T: Eq + Hash + Send, ++ S: BuildHasher + Default, ++{ ++ fn from_par_iter

(par_iter: P) -> Self ++ where ++ P: IntoParallelIterator, ++ { ++ let mut set = HashSet::default(); ++ set.par_extend(par_iter); ++ set ++ } ++} ++ ++/// Extend a hash set with items from a parallel iterator. ++impl ParallelExtend for HashSet ++where ++ T: Eq + Hash + Send, ++ S: BuildHasher, ++{ ++ fn par_extend(&mut self, par_iter: I) ++ where ++ I: IntoParallelIterator, ++ { ++ extend(self, par_iter); ++ } ++} ++ ++/// Extend a hash set with copied items from a parallel iterator. ++impl<'a, T, S> ParallelExtend<&'a T> for HashSet ++where ++ T: 'a + Copy + Eq + Hash + Sync, ++ S: BuildHasher, ++{ ++ fn par_extend(&mut self, par_iter: I) ++ where ++ I: IntoParallelIterator, ++ { ++ extend(self, par_iter); ++ } ++} ++ ++// This is equal to the normal `HashSet` -- no custom advantage. ++fn extend(set: &mut HashSet, par_iter: I) ++where ++ T: Eq + Hash, ++ S: BuildHasher, ++ A: Allocator, ++ I: IntoParallelIterator, ++ HashSet: Extend, ++{ ++ let (list, len) = super::helpers::collect(par_iter); ++ ++ // Values may be already present or show multiple times in the iterator. ++ // Reserve the entire length if the set is empty. ++ // Otherwise reserve half the length (rounded up), so the set ++ // will only resize twice in the worst case. ++ let reserve = if set.is_empty() { len } else { (len + 1) / 2 }; ++ set.reserve(reserve); ++ for vec in list { ++ set.extend(vec); ++ } ++} ++ ++#[cfg(test)] ++mod test_par_set { ++ use alloc::vec::Vec; ++ use core::sync::atomic::{AtomicUsize, Ordering}; ++ ++ use rayon::prelude::*; ++ ++ use crate::hash_set::HashSet; ++ ++ #[test] ++ fn test_disjoint() { ++ let mut xs = HashSet::new(); ++ let mut ys = HashSet::new(); ++ assert!(xs.par_is_disjoint(&ys)); ++ assert!(ys.par_is_disjoint(&xs)); ++ assert!(xs.insert(5)); ++ assert!(ys.insert(11)); ++ assert!(xs.par_is_disjoint(&ys)); ++ assert!(ys.par_is_disjoint(&xs)); ++ assert!(xs.insert(7)); ++ assert!(xs.insert(19)); ++ assert!(xs.insert(4)); ++ assert!(ys.insert(2)); ++ assert!(ys.insert(-11)); ++ assert!(xs.par_is_disjoint(&ys)); ++ assert!(ys.par_is_disjoint(&xs)); ++ assert!(ys.insert(7)); ++ assert!(!xs.par_is_disjoint(&ys)); ++ assert!(!ys.par_is_disjoint(&xs)); ++ } ++ ++ #[test] ++ fn test_subset_and_superset() { ++ let mut a = HashSet::new(); ++ assert!(a.insert(0)); ++ assert!(a.insert(5)); ++ assert!(a.insert(11)); ++ assert!(a.insert(7)); ++ ++ let mut b = HashSet::new(); ++ assert!(b.insert(0)); ++ assert!(b.insert(7)); ++ assert!(b.insert(19)); ++ assert!(b.insert(250)); ++ assert!(b.insert(11)); ++ assert!(b.insert(200)); ++ ++ assert!(!a.par_is_subset(&b)); ++ assert!(!a.par_is_superset(&b)); ++ assert!(!b.par_is_subset(&a)); ++ assert!(!b.par_is_superset(&a)); ++ ++ assert!(b.insert(5)); ++ ++ assert!(a.par_is_subset(&b)); ++ assert!(!a.par_is_superset(&b)); ++ assert!(!b.par_is_subset(&a)); ++ assert!(b.par_is_superset(&a)); ++ } ++ ++ #[test] ++ fn test_iterate() { ++ let mut a = HashSet::new(); ++ for i in 0..32 { ++ assert!(a.insert(i)); ++ } ++ let observed = AtomicUsize::new(0); ++ a.par_iter().for_each(|k| { ++ observed.fetch_or(1 << *k, Ordering::Relaxed); ++ }); ++ assert_eq!(observed.into_inner(), 0xFFFF_FFFF); ++ } ++ ++ #[test] ++ fn test_intersection() { ++ let mut a = HashSet::new(); ++ let mut b = HashSet::new(); ++ ++ assert!(a.insert(11)); ++ assert!(a.insert(1)); ++ assert!(a.insert(3)); ++ assert!(a.insert(77)); ++ assert!(a.insert(103)); ++ assert!(a.insert(5)); ++ assert!(a.insert(-5)); ++ ++ assert!(b.insert(2)); ++ assert!(b.insert(11)); ++ assert!(b.insert(77)); ++ assert!(b.insert(-9)); ++ assert!(b.insert(-42)); ++ assert!(b.insert(5)); ++ assert!(b.insert(3)); ++ ++ let expected = [3, 5, 11, 77]; ++ let i = a ++ .par_intersection(&b) ++ .map(|x| { ++ assert!(expected.contains(x)); ++ 1 ++ }) ++ .sum::(); ++ assert_eq!(i, expected.len()); ++ } ++ ++ #[test] ++ fn test_difference() { ++ let mut a = HashSet::new(); ++ let mut b = HashSet::new(); ++ ++ assert!(a.insert(1)); ++ assert!(a.insert(3)); ++ assert!(a.insert(5)); ++ assert!(a.insert(9)); ++ assert!(a.insert(11)); ++ ++ assert!(b.insert(3)); ++ assert!(b.insert(9)); ++ ++ let expected = [1, 5, 11]; ++ let i = a ++ .par_difference(&b) ++ .map(|x| { ++ assert!(expected.contains(x)); ++ 1 ++ }) ++ .sum::(); ++ assert_eq!(i, expected.len()); ++ } ++ ++ #[test] ++ fn test_symmetric_difference() { ++ let mut a = HashSet::new(); ++ let mut b = HashSet::new(); ++ ++ assert!(a.insert(1)); ++ assert!(a.insert(3)); ++ assert!(a.insert(5)); ++ assert!(a.insert(9)); ++ assert!(a.insert(11)); ++ ++ assert!(b.insert(-2)); ++ assert!(b.insert(3)); ++ assert!(b.insert(9)); ++ assert!(b.insert(14)); ++ assert!(b.insert(22)); ++ ++ let expected = [-2, 1, 5, 11, 14, 22]; ++ let i = a ++ .par_symmetric_difference(&b) ++ .map(|x| { ++ assert!(expected.contains(x)); ++ 1 ++ }) ++ .sum::(); ++ assert_eq!(i, expected.len()); ++ } ++ ++ #[test] ++ fn test_union() { ++ let mut a = HashSet::new(); ++ let mut b = HashSet::new(); ++ ++ assert!(a.insert(1)); ++ assert!(a.insert(3)); ++ assert!(a.insert(5)); ++ assert!(a.insert(9)); ++ assert!(a.insert(11)); ++ assert!(a.insert(16)); ++ assert!(a.insert(19)); ++ assert!(a.insert(24)); ++ ++ assert!(b.insert(-2)); ++ assert!(b.insert(1)); ++ assert!(b.insert(5)); ++ assert!(b.insert(9)); ++ assert!(b.insert(13)); ++ assert!(b.insert(19)); ++ ++ let expected = [-2, 1, 3, 5, 9, 11, 13, 16, 19, 24]; ++ let i = a ++ .par_union(&b) ++ .map(|x| { ++ assert!(expected.contains(x)); ++ 1 ++ }) ++ .sum::(); ++ assert_eq!(i, expected.len()); ++ } ++ ++ #[test] ++ fn test_from_iter() { ++ let xs = [1, 2, 3, 4, 5, 6, 7, 8, 9]; ++ ++ let set: HashSet<_> = xs.par_iter().cloned().collect(); ++ ++ for x in &xs { ++ assert!(set.contains(x)); ++ } ++ } ++ ++ #[test] ++ fn test_move_iter() { ++ let hs = { ++ let mut hs = HashSet::new(); ++ ++ hs.insert('a'); ++ hs.insert('b'); ++ ++ hs ++ }; ++ ++ let v = hs.into_par_iter().collect::>(); ++ assert!(v == ['a', 'b'] || v == ['b', 'a']); ++ } ++ ++ #[test] ++ fn test_eq() { ++ // These constants once happened to expose a bug in insert(). ++ // I'm keeping them around to prevent a regression. ++ let mut s1 = HashSet::new(); ++ ++ s1.insert(1); ++ s1.insert(2); ++ s1.insert(3); ++ ++ let mut s2 = HashSet::new(); ++ ++ s2.insert(1); ++ s2.insert(2); ++ ++ assert!(!s1.par_eq(&s2)); ++ ++ s2.insert(3); ++ ++ assert!(s1.par_eq(&s2)); ++ } ++ ++ #[test] ++ fn test_extend_ref() { ++ let mut a = HashSet::new(); ++ a.insert(1); ++ ++ a.par_extend(&[2, 3, 4][..]); ++ ++ assert_eq!(a.len(), 4); ++ assert!(a.contains(&1)); ++ assert!(a.contains(&2)); ++ assert!(a.contains(&3)); ++ assert!(a.contains(&4)); ++ ++ let mut b = HashSet::new(); ++ b.insert(5); ++ b.insert(6); ++ ++ a.par_extend(&b); ++ ++ assert_eq!(a.len(), 6); ++ assert!(a.contains(&1)); ++ assert!(a.contains(&2)); ++ assert!(a.contains(&3)); ++ assert!(a.contains(&4)); ++ assert!(a.contains(&5)); ++ assert!(a.contains(&6)); ++ } ++} +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/src/external_trait_impls/rayon/table.rs mesa-25.3.3/subprojects/hashbrown-0.14.5/src/external_trait_impls/rayon/table.rs +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/src/external_trait_impls/rayon/table.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/src/external_trait_impls/rayon/table.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,252 @@ ++//! Rayon extensions for `HashTable`. ++ ++use super::raw::{RawIntoParIter, RawParDrain, RawParIter}; ++use crate::hash_table::HashTable; ++use crate::raw::{Allocator, Global}; ++use core::fmt; ++use core::marker::PhantomData; ++use rayon::iter::plumbing::UnindexedConsumer; ++use rayon::iter::{IntoParallelIterator, ParallelIterator}; ++ ++/// Parallel iterator over shared references to entries in a map. ++/// ++/// This iterator is created by the [`par_iter`] method on [`HashTable`] ++/// (provided by the [`IntoParallelRefIterator`] trait). ++/// See its documentation for more. ++/// ++/// [`par_iter`]: /hashbrown/struct.HashTable.html#method.par_iter ++/// [`HashTable`]: /hashbrown/struct.HashTable.html ++/// [`IntoParallelRefIterator`]: https://docs.rs/rayon/1.0/rayon/iter/trait.IntoParallelRefIterator.html ++pub struct ParIter<'a, T> { ++ inner: RawParIter, ++ marker: PhantomData<&'a T>, ++} ++ ++impl<'a, T: Sync> ParallelIterator for ParIter<'a, T> { ++ type Item = &'a T; ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn drive_unindexed(self, consumer: C) -> C::Result ++ where ++ C: UnindexedConsumer, ++ { ++ self.inner ++ .map(|x| unsafe { x.as_ref() }) ++ .drive_unindexed(consumer) ++ } ++} ++ ++impl Clone for ParIter<'_, T> { ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn clone(&self) -> Self { ++ Self { ++ inner: self.inner.clone(), ++ marker: PhantomData, ++ } ++ } ++} ++ ++impl fmt::Debug for ParIter<'_, T> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ let iter = unsafe { self.inner.iter() }.map(|x| unsafe { x.as_ref() }); ++ f.debug_list().entries(iter).finish() ++ } ++} ++ ++/// Parallel iterator over mutable references to entries in a map. ++/// ++/// This iterator is created by the [`par_iter_mut`] method on [`HashTable`] ++/// (provided by the [`IntoParallelRefMutIterator`] trait). ++/// See its documentation for more. ++/// ++/// [`par_iter_mut`]: /hashbrown/struct.HashTable.html#method.par_iter_mut ++/// [`HashTable`]: /hashbrown/struct.HashTable.html ++/// [`IntoParallelRefMutIterator`]: https://docs.rs/rayon/1.0/rayon/iter/trait.IntoParallelRefMutIterator.html ++pub struct ParIterMut<'a, T> { ++ inner: RawParIter, ++ marker: PhantomData<&'a mut T>, ++} ++ ++impl<'a, T: Send> ParallelIterator for ParIterMut<'a, T> { ++ type Item = &'a mut T; ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn drive_unindexed(self, consumer: C) -> C::Result ++ where ++ C: UnindexedConsumer, ++ { ++ self.inner ++ .map(|x| unsafe { x.as_mut() }) ++ .drive_unindexed(consumer) ++ } ++} ++ ++impl fmt::Debug for ParIterMut<'_, T> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ ParIter { ++ inner: self.inner.clone(), ++ marker: PhantomData, ++ } ++ .fmt(f) ++ } ++} ++ ++/// Parallel iterator over entries of a consumed map. ++/// ++/// This iterator is created by the [`into_par_iter`] method on [`HashTable`] ++/// (provided by the [`IntoParallelIterator`] trait). ++/// See its documentation for more. ++/// ++/// [`into_par_iter`]: /hashbrown/struct.HashTable.html#method.into_par_iter ++/// [`HashTable`]: /hashbrown/struct.HashTable.html ++/// [`IntoParallelIterator`]: https://docs.rs/rayon/1.0/rayon/iter/trait.IntoParallelIterator.html ++pub struct IntoParIter { ++ inner: RawIntoParIter, ++} ++ ++impl ParallelIterator for IntoParIter { ++ type Item = T; ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn drive_unindexed(self, consumer: C) -> C::Result ++ where ++ C: UnindexedConsumer, ++ { ++ self.inner.drive_unindexed(consumer) ++ } ++} ++ ++impl fmt::Debug for IntoParIter { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ ParIter { ++ inner: unsafe { self.inner.par_iter() }, ++ marker: PhantomData, ++ } ++ .fmt(f) ++ } ++} ++ ++/// Parallel draining iterator over entries of a map. ++/// ++/// This iterator is created by the [`par_drain`] method on [`HashTable`]. ++/// See its documentation for more. ++/// ++/// [`par_drain`]: /hashbrown/struct.HashTable.html#method.par_drain ++/// [`HashTable`]: /hashbrown/struct.HashTable.html ++pub struct ParDrain<'a, T, A: Allocator = Global> { ++ inner: RawParDrain<'a, T, A>, ++} ++ ++impl ParallelIterator for ParDrain<'_, T, A> { ++ type Item = T; ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn drive_unindexed(self, consumer: C) -> C::Result ++ where ++ C: UnindexedConsumer, ++ { ++ self.inner.drive_unindexed(consumer) ++ } ++} ++ ++impl fmt::Debug for ParDrain<'_, T, A> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ ParIter { ++ inner: unsafe { self.inner.par_iter() }, ++ marker: PhantomData, ++ } ++ .fmt(f) ++ } ++} ++ ++impl HashTable { ++ /// Consumes (potentially in parallel) all values in an arbitrary order, ++ /// while preserving the map's allocated memory for reuse. ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn par_drain(&mut self) -> ParDrain<'_, T, A> { ++ ParDrain { ++ inner: self.raw.par_drain(), ++ } ++ } ++} ++ ++impl IntoParallelIterator for HashTable { ++ type Item = T; ++ type Iter = IntoParIter; ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn into_par_iter(self) -> Self::Iter { ++ IntoParIter { ++ inner: self.raw.into_par_iter(), ++ } ++ } ++} ++ ++impl<'a, T: Sync, A: Allocator> IntoParallelIterator for &'a HashTable { ++ type Item = &'a T; ++ type Iter = ParIter<'a, T>; ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn into_par_iter(self) -> Self::Iter { ++ ParIter { ++ inner: unsafe { self.raw.par_iter() }, ++ marker: PhantomData, ++ } ++ } ++} ++ ++impl<'a, T: Send, A: Allocator> IntoParallelIterator for &'a mut HashTable { ++ type Item = &'a mut T; ++ type Iter = ParIterMut<'a, T>; ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn into_par_iter(self) -> Self::Iter { ++ ParIterMut { ++ inner: unsafe { self.raw.par_iter() }, ++ marker: PhantomData, ++ } ++ } ++} ++ ++#[cfg(test)] ++mod test_par_table { ++ use alloc::vec::Vec; ++ use core::sync::atomic::{AtomicUsize, Ordering}; ++ ++ use rayon::prelude::*; ++ ++ use crate::{ ++ hash_map::{make_hash, DefaultHashBuilder}, ++ hash_table::HashTable, ++ }; ++ ++ #[test] ++ fn test_iterate() { ++ let hasher = DefaultHashBuilder::default(); ++ let mut a = HashTable::new(); ++ for i in 0..32 { ++ a.insert_unique(make_hash(&hasher, &i), i, |x| make_hash(&hasher, x)); ++ } ++ let observed = AtomicUsize::new(0); ++ a.par_iter().for_each(|k| { ++ observed.fetch_or(1 << *k, Ordering::Relaxed); ++ }); ++ assert_eq!(observed.into_inner(), 0xFFFF_FFFF); ++ } ++ ++ #[test] ++ fn test_move_iter() { ++ let hasher = DefaultHashBuilder::default(); ++ let hs = { ++ let mut hs = HashTable::new(); ++ ++ hs.insert_unique(make_hash(&hasher, &'a'), 'a', |x| make_hash(&hasher, x)); ++ hs.insert_unique(make_hash(&hasher, &'b'), 'b', |x| make_hash(&hasher, x)); ++ ++ hs ++ }; ++ ++ let v = hs.into_par_iter().collect::>(); ++ assert!(v == ['a', 'b'] || v == ['b', 'a']); ++ } ++} +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/src/external_trait_impls/rkyv/hash_map.rs mesa-25.3.3/subprojects/hashbrown-0.14.5/src/external_trait_impls/rkyv/hash_map.rs +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/src/external_trait_impls/rkyv/hash_map.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/src/external_trait_impls/rkyv/hash_map.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,125 @@ ++use crate::HashMap; ++use core::{ ++ borrow::Borrow, ++ hash::{BuildHasher, Hash}, ++}; ++use rkyv::{ ++ collections::hash_map::{ArchivedHashMap, HashMapResolver}, ++ ser::{ScratchSpace, Serializer}, ++ Archive, Deserialize, Fallible, Serialize, ++}; ++ ++impl Archive for HashMap ++where ++ K::Archived: Hash + Eq, ++{ ++ type Archived = ArchivedHashMap; ++ type Resolver = HashMapResolver; ++ ++ #[inline] ++ unsafe fn resolve(&self, pos: usize, resolver: Self::Resolver, out: *mut Self::Archived) { ++ ArchivedHashMap::resolve_from_len(self.len(), pos, resolver, out); ++ } ++} ++ ++impl Serialize for HashMap ++where ++ K: Serialize + Hash + Eq, ++ K::Archived: Hash + Eq, ++ V: Serialize, ++ S: Serializer + ScratchSpace + ?Sized, ++{ ++ #[inline] ++ fn serialize(&self, serializer: &mut S) -> Result { ++ unsafe { ArchivedHashMap::serialize_from_iter(self.iter(), serializer) } ++ } ++} ++ ++impl ++ Deserialize, D> for ArchivedHashMap ++where ++ K::Archived: Deserialize + Hash + Eq, ++ V::Archived: Deserialize, ++{ ++ #[inline] ++ fn deserialize(&self, deserializer: &mut D) -> Result, D::Error> { ++ let mut result = HashMap::with_capacity_and_hasher(self.len(), S::default()); ++ for (k, v) in self.iter() { ++ result.insert(k.deserialize(deserializer)?, v.deserialize(deserializer)?); ++ } ++ Ok(result) ++ } ++} ++ ++impl, V, AK: Hash + Eq, AV: PartialEq, S: BuildHasher> ++ PartialEq> for ArchivedHashMap ++{ ++ #[inline] ++ fn eq(&self, other: &HashMap) -> bool { ++ if self.len() != other.len() { ++ false ++ } else { ++ self.iter() ++ .all(|(key, value)| other.get(key).map_or(false, |v| value.eq(v))) ++ } ++ } ++} ++ ++impl, V, AK: Hash + Eq, AV: PartialEq> ++ PartialEq> for HashMap ++{ ++ #[inline] ++ fn eq(&self, other: &ArchivedHashMap) -> bool { ++ other.eq(self) ++ } ++} ++ ++#[cfg(test)] ++mod tests { ++ use crate::HashMap; ++ use alloc::string::String; ++ use rkyv::{ ++ archived_root, check_archived_root, ++ ser::{serializers::AllocSerializer, Serializer}, ++ Deserialize, Infallible, ++ }; ++ ++ #[test] ++ fn index_map() { ++ let mut value = HashMap::new(); ++ value.insert(String::from("foo"), 10); ++ value.insert(String::from("bar"), 20); ++ value.insert(String::from("baz"), 40); ++ value.insert(String::from("bat"), 80); ++ ++ let mut serializer = AllocSerializer::<4096>::default(); ++ serializer.serialize_value(&value).unwrap(); ++ let result = serializer.into_serializer().into_inner(); ++ let archived = unsafe { archived_root::>(result.as_ref()) }; ++ ++ assert_eq!(value.len(), archived.len()); ++ for (k, v) in value.iter() { ++ let (ak, av) = archived.get_key_value(k.as_str()).unwrap(); ++ assert_eq!(k, ak); ++ assert_eq!(v, av); ++ } ++ ++ let deserialized: HashMap = archived.deserialize(&mut Infallible).unwrap(); ++ assert_eq!(value, deserialized); ++ } ++ ++ #[test] ++ fn validate_index_map() { ++ let mut value = HashMap::new(); ++ value.insert(String::from("foo"), 10); ++ value.insert(String::from("bar"), 20); ++ value.insert(String::from("baz"), 40); ++ value.insert(String::from("bat"), 80); ++ ++ let mut serializer = AllocSerializer::<4096>::default(); ++ serializer.serialize_value(&value).unwrap(); ++ let result = serializer.into_serializer().into_inner(); ++ check_archived_root::>(result.as_ref()) ++ .expect("failed to validate archived index map"); ++ } ++} +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/src/external_trait_impls/rkyv/hash_set.rs mesa-25.3.3/subprojects/hashbrown-0.14.5/src/external_trait_impls/rkyv/hash_set.rs +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/src/external_trait_impls/rkyv/hash_set.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/src/external_trait_impls/rkyv/hash_set.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,123 @@ ++use crate::HashSet; ++use core::{ ++ borrow::Borrow, ++ hash::{BuildHasher, Hash}, ++}; ++use rkyv::{ ++ collections::hash_set::{ArchivedHashSet, HashSetResolver}, ++ ser::{ScratchSpace, Serializer}, ++ Archive, Deserialize, Fallible, Serialize, ++}; ++ ++impl Archive for HashSet ++where ++ K::Archived: Hash + Eq, ++{ ++ type Archived = ArchivedHashSet; ++ type Resolver = HashSetResolver; ++ ++ #[inline] ++ unsafe fn resolve(&self, pos: usize, resolver: Self::Resolver, out: *mut Self::Archived) { ++ ArchivedHashSet::::resolve_from_len(self.len(), pos, resolver, out); ++ } ++} ++ ++impl Serialize for HashSet ++where ++ K::Archived: Hash + Eq, ++ K: Serialize + Hash + Eq, ++ S: ScratchSpace + Serializer + ?Sized, ++{ ++ #[inline] ++ fn serialize(&self, serializer: &mut S) -> Result { ++ unsafe { ArchivedHashSet::serialize_from_iter(self.iter(), serializer) } ++ } ++} ++ ++impl Deserialize, D> for ArchivedHashSet ++where ++ K: Archive + Hash + Eq, ++ K::Archived: Deserialize + Hash + Eq, ++ D: Fallible + ?Sized, ++ S: Default + BuildHasher, ++{ ++ #[inline] ++ fn deserialize(&self, deserializer: &mut D) -> Result, D::Error> { ++ let mut result = HashSet::with_hasher(S::default()); ++ for k in self.iter() { ++ result.insert(k.deserialize(deserializer)?); ++ } ++ Ok(result) ++ } ++} ++ ++impl, AK: Hash + Eq, S: BuildHasher> PartialEq> ++ for ArchivedHashSet ++{ ++ #[inline] ++ fn eq(&self, other: &HashSet) -> bool { ++ if self.len() != other.len() { ++ false ++ } else { ++ self.iter().all(|key| other.get(key).is_some()) ++ } ++ } ++} ++ ++impl, AK: Hash + Eq, S: BuildHasher> PartialEq> ++ for HashSet ++{ ++ #[inline] ++ fn eq(&self, other: &ArchivedHashSet) -> bool { ++ other.eq(self) ++ } ++} ++ ++#[cfg(test)] ++mod tests { ++ use crate::HashSet; ++ use alloc::string::String; ++ use rkyv::{ ++ archived_root, check_archived_root, ++ ser::{serializers::AllocSerializer, Serializer}, ++ Deserialize, Infallible, ++ }; ++ ++ #[test] ++ fn index_set() { ++ let mut value = HashSet::new(); ++ value.insert(String::from("foo")); ++ value.insert(String::from("bar")); ++ value.insert(String::from("baz")); ++ value.insert(String::from("bat")); ++ ++ let mut serializer = AllocSerializer::<4096>::default(); ++ serializer.serialize_value(&value).unwrap(); ++ let result = serializer.into_serializer().into_inner(); ++ let archived = unsafe { archived_root::>(result.as_ref()) }; ++ ++ assert_eq!(value.len(), archived.len()); ++ for k in value.iter() { ++ let ak = archived.get(k.as_str()).unwrap(); ++ assert_eq!(k, ak); ++ } ++ ++ let deserialized: HashSet = archived.deserialize(&mut Infallible).unwrap(); ++ assert_eq!(value, deserialized); ++ } ++ ++ #[test] ++ fn validate_index_set() { ++ let mut value = HashSet::new(); ++ value.insert(String::from("foo")); ++ value.insert(String::from("bar")); ++ value.insert(String::from("baz")); ++ value.insert(String::from("bat")); ++ ++ let mut serializer = AllocSerializer::<4096>::default(); ++ serializer.serialize_value(&value).unwrap(); ++ let result = serializer.into_serializer().into_inner(); ++ check_archived_root::>(result.as_ref()) ++ .expect("failed to validate archived index set"); ++ } ++} +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/src/external_trait_impls/rkyv/mod.rs mesa-25.3.3/subprojects/hashbrown-0.14.5/src/external_trait_impls/rkyv/mod.rs +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/src/external_trait_impls/rkyv/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/src/external_trait_impls/rkyv/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,2 @@ ++mod hash_map; ++mod hash_set; +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/src/external_trait_impls/serde.rs mesa-25.3.3/subprojects/hashbrown-0.14.5/src/external_trait_impls/serde.rs +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/src/external_trait_impls/serde.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/src/external_trait_impls/serde.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,220 @@ ++mod size_hint { ++ use core::cmp; ++ ++ /// This presumably exists to prevent denial of service attacks. ++ /// ++ /// Original discussion: https://github.com/serde-rs/serde/issues/1114. ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub(super) fn cautious(hint: Option) -> usize { ++ cmp::min(hint.unwrap_or(0), 4096) ++ } ++} ++ ++mod map { ++ use crate::raw::Allocator; ++ use core::fmt; ++ use core::hash::{BuildHasher, Hash}; ++ use core::marker::PhantomData; ++ use serde::de::{Deserialize, Deserializer, MapAccess, Visitor}; ++ use serde::ser::{Serialize, Serializer}; ++ ++ use crate::hash_map::HashMap; ++ ++ use super::size_hint; ++ ++ impl Serialize for HashMap ++ where ++ K: Serialize + Eq + Hash, ++ V: Serialize, ++ H: BuildHasher, ++ A: Allocator, ++ { ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn serialize(&self, serializer: S) -> Result ++ where ++ S: Serializer, ++ { ++ serializer.collect_map(self) ++ } ++ } ++ ++ impl<'de, K, V, S, A> Deserialize<'de> for HashMap ++ where ++ K: Deserialize<'de> + Eq + Hash, ++ V: Deserialize<'de>, ++ S: BuildHasher + Default, ++ A: Allocator + Default, ++ { ++ fn deserialize(deserializer: D) -> Result ++ where ++ D: Deserializer<'de>, ++ { ++ struct MapVisitor ++ where ++ A: Allocator, ++ { ++ marker: PhantomData>, ++ } ++ ++ impl<'de, K, V, S, A> Visitor<'de> for MapVisitor ++ where ++ K: Deserialize<'de> + Eq + Hash, ++ V: Deserialize<'de>, ++ S: BuildHasher + Default, ++ A: Allocator + Default, ++ { ++ type Value = HashMap; ++ ++ fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { ++ formatter.write_str("a map") ++ } ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn visit_map(self, mut map: M) -> Result ++ where ++ M: MapAccess<'de>, ++ { ++ let mut values = HashMap::with_capacity_and_hasher_in( ++ size_hint::cautious(map.size_hint()), ++ S::default(), ++ A::default(), ++ ); ++ ++ while let Some((key, value)) = map.next_entry()? { ++ values.insert(key, value); ++ } ++ ++ Ok(values) ++ } ++ } ++ ++ let visitor = MapVisitor { ++ marker: PhantomData, ++ }; ++ deserializer.deserialize_map(visitor) ++ } ++ } ++} ++ ++mod set { ++ use crate::raw::Allocator; ++ use core::fmt; ++ use core::hash::{BuildHasher, Hash}; ++ use core::marker::PhantomData; ++ use serde::de::{Deserialize, Deserializer, SeqAccess, Visitor}; ++ use serde::ser::{Serialize, Serializer}; ++ ++ use crate::hash_set::HashSet; ++ ++ use super::size_hint; ++ ++ impl Serialize for HashSet ++ where ++ T: Serialize + Eq + Hash, ++ H: BuildHasher, ++ A: Allocator, ++ { ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn serialize(&self, serializer: S) -> Result ++ where ++ S: Serializer, ++ { ++ serializer.collect_seq(self) ++ } ++ } ++ ++ impl<'de, T, S, A> Deserialize<'de> for HashSet ++ where ++ T: Deserialize<'de> + Eq + Hash, ++ S: BuildHasher + Default, ++ A: Allocator + Default, ++ { ++ fn deserialize(deserializer: D) -> Result ++ where ++ D: Deserializer<'de>, ++ { ++ struct SeqVisitor ++ where ++ A: Allocator, ++ { ++ marker: PhantomData>, ++ } ++ ++ impl<'de, T, S, A> Visitor<'de> for SeqVisitor ++ where ++ T: Deserialize<'de> + Eq + Hash, ++ S: BuildHasher + Default, ++ A: Allocator + Default, ++ { ++ type Value = HashSet; ++ ++ fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { ++ formatter.write_str("a sequence") ++ } ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn visit_seq(self, mut seq: M) -> Result ++ where ++ M: SeqAccess<'de>, ++ { ++ let mut values = HashSet::with_capacity_and_hasher_in( ++ size_hint::cautious(seq.size_hint()), ++ S::default(), ++ A::default(), ++ ); ++ ++ while let Some(value) = seq.next_element()? { ++ values.insert(value); ++ } ++ ++ Ok(values) ++ } ++ } ++ ++ let visitor = SeqVisitor { ++ marker: PhantomData, ++ }; ++ deserializer.deserialize_seq(visitor) ++ } ++ ++ #[allow(clippy::missing_errors_doc)] ++ fn deserialize_in_place(deserializer: D, place: &mut Self) -> Result<(), D::Error> ++ where ++ D: Deserializer<'de>, ++ { ++ struct SeqInPlaceVisitor<'a, T, S, A>(&'a mut HashSet) ++ where ++ A: Allocator; ++ ++ impl<'a, 'de, T, S, A> Visitor<'de> for SeqInPlaceVisitor<'a, T, S, A> ++ where ++ T: Deserialize<'de> + Eq + Hash, ++ S: BuildHasher + Default, ++ A: Allocator, ++ { ++ type Value = (); ++ ++ fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result { ++ formatter.write_str("a sequence") ++ } ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn visit_seq(self, mut seq: M) -> Result ++ where ++ M: SeqAccess<'de>, ++ { ++ self.0.clear(); ++ self.0.reserve(size_hint::cautious(seq.size_hint())); ++ ++ while let Some(value) = seq.next_element()? { ++ self.0.insert(value); ++ } ++ ++ Ok(()) ++ } ++ } ++ ++ deserializer.deserialize_seq(SeqInPlaceVisitor(place)) ++ } ++ } ++} +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/src/lib.rs mesa-25.3.3/subprojects/hashbrown-0.14.5/src/lib.rs +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/src/lib.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/src/lib.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,188 @@ ++//! This crate is a Rust port of Google's high-performance [SwissTable] hash ++//! map, adapted to make it a drop-in replacement for Rust's standard `HashMap` ++//! and `HashSet` types. ++//! ++//! The original C++ version of [SwissTable] can be found [here], and this ++//! [CppCon talk] gives an overview of how the algorithm works. ++//! ++//! [SwissTable]: https://abseil.io/blog/20180927-swisstables ++//! [here]: https://github.com/abseil/abseil-cpp/blob/master/absl/container/internal/raw_hash_set.h ++//! [CppCon talk]: https://www.youtube.com/watch?v=ncHmEUmJZf4 ++ ++#![no_std] ++#![cfg_attr( ++ feature = "nightly", ++ feature( ++ test, ++ core_intrinsics, ++ dropck_eyepatch, ++ min_specialization, ++ extend_one, ++ allocator_api, ++ slice_ptr_get, ++ maybe_uninit_array_assume_init, ++ strict_provenance ++ ) ++)] ++#![allow( ++ clippy::doc_markdown, ++ clippy::module_name_repetitions, ++ clippy::must_use_candidate, ++ clippy::option_if_let_else, ++ clippy::redundant_else, ++ clippy::manual_map, ++ clippy::missing_safety_doc, ++ clippy::missing_errors_doc ++)] ++#![warn(missing_docs)] ++#![warn(rust_2018_idioms)] ++#![cfg_attr(feature = "nightly", warn(fuzzy_provenance_casts))] ++#![cfg_attr(feature = "nightly", allow(internal_features))] ++ ++#[cfg(test)] ++#[macro_use] ++extern crate std; ++ ++#[cfg_attr(test, macro_use)] ++extern crate alloc; ++ ++#[cfg(feature = "nightly")] ++#[cfg(doctest)] ++doc_comment::doctest!("../README.md"); ++ ++#[macro_use] ++mod macros; ++ ++#[cfg(feature = "raw")] ++/// Experimental and unsafe `RawTable` API. This module is only available if the ++/// `raw` feature is enabled. ++pub mod raw { ++ // The RawTable API is still experimental and is not properly documented yet. ++ #[allow(missing_docs)] ++ #[path = "mod.rs"] ++ mod inner; ++ pub use inner::*; ++ ++ #[cfg(feature = "rayon")] ++ /// [rayon]-based parallel iterator types for hash maps. ++ /// You will rarely need to interact with it directly unless you have need ++ /// to name one of the iterator types. ++ /// ++ /// [rayon]: https://docs.rs/rayon/1.0/rayon ++ pub mod rayon { ++ pub use crate::external_trait_impls::rayon::raw::*; ++ } ++} ++#[cfg(not(feature = "raw"))] ++mod raw; ++ ++mod external_trait_impls; ++mod map; ++#[cfg(feature = "rustc-internal-api")] ++mod rustc_entry; ++mod scopeguard; ++mod set; ++mod table; ++ ++pub mod hash_map { ++ //! A hash map implemented with quadratic probing and SIMD lookup. ++ pub use crate::map::*; ++ ++ #[cfg(feature = "rustc-internal-api")] ++ pub use crate::rustc_entry::*; ++ ++ #[cfg(feature = "rayon")] ++ /// [rayon]-based parallel iterator types for hash maps. ++ /// You will rarely need to interact with it directly unless you have need ++ /// to name one of the iterator types. ++ /// ++ /// [rayon]: https://docs.rs/rayon/1.0/rayon ++ pub mod rayon { ++ pub use crate::external_trait_impls::rayon::map::*; ++ } ++} ++pub mod hash_set { ++ //! A hash set implemented as a `HashMap` where the value is `()`. ++ pub use crate::set::*; ++ ++ #[cfg(feature = "rayon")] ++ /// [rayon]-based parallel iterator types for hash sets. ++ /// You will rarely need to interact with it directly unless you have need ++ /// to name one of the iterator types. ++ /// ++ /// [rayon]: https://docs.rs/rayon/1.0/rayon ++ pub mod rayon { ++ pub use crate::external_trait_impls::rayon::set::*; ++ } ++} ++pub mod hash_table { ++ //! A hash table implemented with quadratic probing and SIMD lookup. ++ pub use crate::table::*; ++ ++ #[cfg(feature = "rayon")] ++ /// [rayon]-based parallel iterator types for hash tables. ++ /// You will rarely need to interact with it directly unless you have need ++ /// to name one of the iterator types. ++ /// ++ /// [rayon]: https://docs.rs/rayon/1.0/rayon ++ pub mod rayon { ++ pub use crate::external_trait_impls::rayon::table::*; ++ } ++} ++ ++pub use crate::map::HashMap; ++pub use crate::set::HashSet; ++pub use crate::table::HashTable; ++ ++#[cfg(feature = "equivalent")] ++pub use equivalent::Equivalent; ++ ++// This is only used as a fallback when building as part of `std`. ++#[cfg(not(feature = "equivalent"))] ++/// Key equivalence trait. ++/// ++/// This trait defines the function used to compare the input value with the ++/// map keys (or set values) during a lookup operation such as [`HashMap::get`] ++/// or [`HashSet::contains`]. ++/// It is provided with a blanket implementation based on the ++/// [`Borrow`](core::borrow::Borrow) trait. ++/// ++/// # Correctness ++/// ++/// Equivalent values must hash to the same value. ++pub trait Equivalent { ++ /// Checks if this value is equivalent to the given key. ++ /// ++ /// Returns `true` if both values are equivalent, and `false` otherwise. ++ /// ++ /// # Correctness ++ /// ++ /// When this function returns `true`, both `self` and `key` must hash to ++ /// the same value. ++ fn equivalent(&self, key: &K) -> bool; ++} ++ ++#[cfg(not(feature = "equivalent"))] ++impl Equivalent for Q ++where ++ Q: Eq, ++ K: core::borrow::Borrow, ++{ ++ fn equivalent(&self, key: &K) -> bool { ++ self == key.borrow() ++ } ++} ++ ++/// The error type for `try_reserve` methods. ++#[derive(Clone, PartialEq, Eq, Debug)] ++pub enum TryReserveError { ++ /// Error due to the computed capacity exceeding the collection's maximum ++ /// (usually `isize::MAX` bytes). ++ CapacityOverflow, ++ ++ /// The memory allocator returned an error ++ AllocError { ++ /// The layout of the allocation request that failed. ++ layout: alloc::alloc::Layout, ++ }, ++} +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/src/macros.rs mesa-25.3.3/subprojects/hashbrown-0.14.5/src/macros.rs +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/src/macros.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/src/macros.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,70 @@ ++// See the cfg-if crate. ++#[allow(unused_macro_rules)] ++macro_rules! cfg_if { ++ // match if/else chains with a final `else` ++ ($( ++ if #[cfg($($meta:meta),*)] { $($it:item)* } ++ ) else * else { ++ $($it2:item)* ++ }) => { ++ cfg_if! { ++ @__items ++ () ; ++ $( ( ($($meta),*) ($($it)*) ), )* ++ ( () ($($it2)*) ), ++ } ++ }; ++ ++ // match if/else chains lacking a final `else` ++ ( ++ if #[cfg($($i_met:meta),*)] { $($i_it:item)* } ++ $( ++ else if #[cfg($($e_met:meta),*)] { $($e_it:item)* } ++ )* ++ ) => { ++ cfg_if! { ++ @__items ++ () ; ++ ( ($($i_met),*) ($($i_it)*) ), ++ $( ( ($($e_met),*) ($($e_it)*) ), )* ++ ( () () ), ++ } ++ }; ++ ++ // Internal and recursive macro to emit all the items ++ // ++ // Collects all the negated cfgs in a list at the beginning and after the ++ // semicolon is all the remaining items ++ (@__items ($($not:meta,)*) ; ) => {}; ++ (@__items ($($not:meta,)*) ; ( ($($m:meta),*) ($($it:item)*) ), $($rest:tt)*) => { ++ // Emit all items within one block, applying an appropriate #[cfg]. The ++ // #[cfg] will require all `$m` matchers specified and must also negate ++ // all previous matchers. ++ cfg_if! { @__apply cfg(all($($m,)* not(any($($not),*)))), $($it)* } ++ ++ // Recurse to emit all other items in `$rest`, and when we do so add all ++ // our `$m` matchers to the list of `$not` matchers as future emissions ++ // will have to negate everything we just matched as well. ++ cfg_if! { @__items ($($not,)* $($m,)*) ; $($rest)* } ++ }; ++ ++ // Internal macro to Apply a cfg attribute to a list of items ++ (@__apply $m:meta, $($it:item)*) => { ++ $(#[$m] $it)* ++ }; ++} ++ ++// Helper macro for specialization. This also helps avoid parse errors if the ++// default fn syntax for specialization changes in the future. ++#[cfg(feature = "nightly")] ++macro_rules! default_fn { ++ (#[$($a:tt)*] $($tt:tt)*) => { ++ #[$($a)*] default $($tt)* ++ } ++} ++#[cfg(not(feature = "nightly"))] ++macro_rules! default_fn { ++ ($($tt:tt)*) => { ++ $($tt)* ++ } ++} +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/src/map.rs mesa-25.3.3/subprojects/hashbrown-0.14.5/src/map.rs +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/src/map.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/src/map.rs 2024-05-23 13:02:57.000000000 -0500 +@@ -0,0 +1,8968 @@ ++use crate::raw::{ ++ Allocator, Bucket, Global, RawDrain, RawExtractIf, RawIntoIter, RawIter, RawTable, ++}; ++use crate::{Equivalent, TryReserveError}; ++use core::borrow::Borrow; ++use core::fmt::{self, Debug}; ++use core::hash::{BuildHasher, Hash}; ++use core::iter::FusedIterator; ++use core::marker::PhantomData; ++use core::mem; ++use core::ops::Index; ++ ++/// Default hasher for `HashMap`. ++#[cfg(feature = "ahash")] ++pub type DefaultHashBuilder = core::hash::BuildHasherDefault; ++ ++/// Dummy default hasher for `HashMap`. ++#[cfg(not(feature = "ahash"))] ++pub enum DefaultHashBuilder {} ++ ++/// A hash map implemented with quadratic probing and SIMD lookup. ++/// ++/// The default hashing algorithm is currently [`AHash`], though this is ++/// subject to change at any point in the future. This hash function is very ++/// fast for all types of keys, but this algorithm will typically *not* protect ++/// against attacks such as HashDoS. ++/// ++/// The hashing algorithm can be replaced on a per-`HashMap` basis using the ++/// [`default`], [`with_hasher`], and [`with_capacity_and_hasher`] methods. Many ++/// alternative algorithms are available on crates.io, such as the [`fnv`] crate. ++/// ++/// It is required that the keys implement the [`Eq`] and [`Hash`] traits, although ++/// this can frequently be achieved by using `#[derive(PartialEq, Eq, Hash)]`. ++/// If you implement these yourself, it is important that the following ++/// property holds: ++/// ++/// ```text ++/// k1 == k2 -> hash(k1) == hash(k2) ++/// ``` ++/// ++/// In other words, if two keys are equal, their hashes must be equal. ++/// ++/// It is a logic error for a key to be modified in such a way that the key's ++/// hash, as determined by the [`Hash`] trait, or its equality, as determined by ++/// the [`Eq`] trait, changes while it is in the map. This is normally only ++/// possible through [`Cell`], [`RefCell`], global state, I/O, or unsafe code. ++/// ++/// It is also a logic error for the [`Hash`] implementation of a key to panic. ++/// This is generally only possible if the trait is implemented manually. If a ++/// panic does occur then the contents of the `HashMap` may become corrupted and ++/// some items may be dropped from the table. ++/// ++/// # Examples ++/// ++/// ``` ++/// use hashbrown::HashMap; ++/// ++/// // Type inference lets us omit an explicit type signature (which ++/// // would be `HashMap` in this example). ++/// let mut book_reviews = HashMap::new(); ++/// ++/// // Review some books. ++/// book_reviews.insert( ++/// "Adventures of Huckleberry Finn".to_string(), ++/// "My favorite book.".to_string(), ++/// ); ++/// book_reviews.insert( ++/// "Grimms' Fairy Tales".to_string(), ++/// "Masterpiece.".to_string(), ++/// ); ++/// book_reviews.insert( ++/// "Pride and Prejudice".to_string(), ++/// "Very enjoyable.".to_string(), ++/// ); ++/// book_reviews.insert( ++/// "The Adventures of Sherlock Holmes".to_string(), ++/// "Eye lyked it alot.".to_string(), ++/// ); ++/// ++/// // Check for a specific one. ++/// // When collections store owned values (String), they can still be ++/// // queried using references (&str). ++/// if !book_reviews.contains_key("Les Misérables") { ++/// println!("We've got {} reviews, but Les Misérables ain't one.", ++/// book_reviews.len()); ++/// } ++/// ++/// // oops, this review has a lot of spelling mistakes, let's delete it. ++/// book_reviews.remove("The Adventures of Sherlock Holmes"); ++/// ++/// // Look up the values associated with some keys. ++/// let to_find = ["Pride and Prejudice", "Alice's Adventure in Wonderland"]; ++/// for &book in &to_find { ++/// match book_reviews.get(book) { ++/// Some(review) => println!("{}: {}", book, review), ++/// None => println!("{} is unreviewed.", book) ++/// } ++/// } ++/// ++/// // Look up the value for a key (will panic if the key is not found). ++/// println!("Review for Jane: {}", book_reviews["Pride and Prejudice"]); ++/// ++/// // Iterate over everything. ++/// for (book, review) in &book_reviews { ++/// println!("{}: \"{}\"", book, review); ++/// } ++/// ``` ++/// ++/// `HashMap` also implements an [`Entry API`](#method.entry), which allows ++/// for more complex methods of getting, setting, updating and removing keys and ++/// their values: ++/// ++/// ``` ++/// use hashbrown::HashMap; ++/// ++/// // type inference lets us omit an explicit type signature (which ++/// // would be `HashMap<&str, u8>` in this example). ++/// let mut player_stats = HashMap::new(); ++/// ++/// fn random_stat_buff() -> u8 { ++/// // could actually return some random value here - let's just return ++/// // some fixed value for now ++/// 42 ++/// } ++/// ++/// // insert a key only if it doesn't already exist ++/// player_stats.entry("health").or_insert(100); ++/// ++/// // insert a key using a function that provides a new value only if it ++/// // doesn't already exist ++/// player_stats.entry("defence").or_insert_with(random_stat_buff); ++/// ++/// // update a key, guarding against the key possibly not being set ++/// let stat = player_stats.entry("attack").or_insert(100); ++/// *stat += random_stat_buff(); ++/// ``` ++/// ++/// The easiest way to use `HashMap` with a custom key type is to derive [`Eq`] and [`Hash`]. ++/// We must also derive [`PartialEq`]. ++/// ++/// [`Eq`]: https://doc.rust-lang.org/std/cmp/trait.Eq.html ++/// [`Hash`]: https://doc.rust-lang.org/std/hash/trait.Hash.html ++/// [`PartialEq`]: https://doc.rust-lang.org/std/cmp/trait.PartialEq.html ++/// [`RefCell`]: https://doc.rust-lang.org/std/cell/struct.RefCell.html ++/// [`Cell`]: https://doc.rust-lang.org/std/cell/struct.Cell.html ++/// [`default`]: #method.default ++/// [`with_hasher`]: #method.with_hasher ++/// [`with_capacity_and_hasher`]: #method.with_capacity_and_hasher ++/// [`fnv`]: https://crates.io/crates/fnv ++/// [`AHash`]: https://crates.io/crates/ahash ++/// ++/// ``` ++/// use hashbrown::HashMap; ++/// ++/// #[derive(Hash, Eq, PartialEq, Debug)] ++/// struct Viking { ++/// name: String, ++/// country: String, ++/// } ++/// ++/// impl Viking { ++/// /// Creates a new Viking. ++/// fn new(name: &str, country: &str) -> Viking { ++/// Viking { name: name.to_string(), country: country.to_string() } ++/// } ++/// } ++/// ++/// // Use a HashMap to store the vikings' health points. ++/// let mut vikings = HashMap::new(); ++/// ++/// vikings.insert(Viking::new("Einar", "Norway"), 25); ++/// vikings.insert(Viking::new("Olaf", "Denmark"), 24); ++/// vikings.insert(Viking::new("Harald", "Iceland"), 12); ++/// ++/// // Use derived implementation to print the status of the vikings. ++/// for (viking, health) in &vikings { ++/// println!("{:?} has {} hp", viking, health); ++/// } ++/// ``` ++/// ++/// A `HashMap` with fixed list of elements can be initialized from an array: ++/// ++/// ``` ++/// use hashbrown::HashMap; ++/// ++/// let timber_resources: HashMap<&str, i32> = [("Norway", 100), ("Denmark", 50), ("Iceland", 10)] ++/// .into_iter().collect(); ++/// // use the values stored in map ++/// ``` ++pub struct HashMap { ++ pub(crate) hash_builder: S, ++ pub(crate) table: RawTable<(K, V), A>, ++} ++ ++impl Clone for HashMap { ++ fn clone(&self) -> Self { ++ HashMap { ++ hash_builder: self.hash_builder.clone(), ++ table: self.table.clone(), ++ } ++ } ++ ++ fn clone_from(&mut self, source: &Self) { ++ self.table.clone_from(&source.table); ++ ++ // Update hash_builder only if we successfully cloned all elements. ++ self.hash_builder.clone_from(&source.hash_builder); ++ } ++} ++ ++/// Ensures that a single closure type across uses of this which, in turn prevents multiple ++/// instances of any functions like RawTable::reserve from being generated ++#[cfg_attr(feature = "inline-more", inline)] ++pub(crate) fn make_hasher(hash_builder: &S) -> impl Fn(&(Q, V)) -> u64 + '_ ++where ++ Q: Hash, ++ S: BuildHasher, ++{ ++ move |val| make_hash::(hash_builder, &val.0) ++} ++ ++/// Ensures that a single closure type across uses of this which, in turn prevents multiple ++/// instances of any functions like RawTable::reserve from being generated ++#[cfg_attr(feature = "inline-more", inline)] ++fn equivalent_key(k: &Q) -> impl Fn(&(K, V)) -> bool + '_ ++where ++ Q: ?Sized + Equivalent, ++{ ++ move |x| k.equivalent(&x.0) ++} ++ ++/// Ensures that a single closure type across uses of this which, in turn prevents multiple ++/// instances of any functions like RawTable::reserve from being generated ++#[cfg_attr(feature = "inline-more", inline)] ++fn equivalent(k: &Q) -> impl Fn(&K) -> bool + '_ ++where ++ Q: ?Sized + Equivalent, ++{ ++ move |x| k.equivalent(x) ++} ++ ++#[cfg(not(feature = "nightly"))] ++#[cfg_attr(feature = "inline-more", inline)] ++pub(crate) fn make_hash(hash_builder: &S, val: &Q) -> u64 ++where ++ Q: Hash + ?Sized, ++ S: BuildHasher, ++{ ++ use core::hash::Hasher; ++ let mut state = hash_builder.build_hasher(); ++ val.hash(&mut state); ++ state.finish() ++} ++ ++#[cfg(feature = "nightly")] ++#[cfg_attr(feature = "inline-more", inline)] ++pub(crate) fn make_hash(hash_builder: &S, val: &Q) -> u64 ++where ++ Q: Hash + ?Sized, ++ S: BuildHasher, ++{ ++ hash_builder.hash_one(val) ++} ++ ++#[cfg(feature = "ahash")] ++impl HashMap { ++ /// Creates an empty `HashMap`. ++ /// ++ /// The hash map is initially created with a capacity of 0, so it will not allocate until it ++ /// is first inserted into. ++ /// ++ /// # HashDoS resistance ++ /// ++ /// The `hash_builder` normally use a fixed key by default and that does ++ /// not allow the `HashMap` to be protected against attacks such as [`HashDoS`]. ++ /// Users who require HashDoS resistance should explicitly use ++ /// [`ahash::RandomState`] or [`std::collections::hash_map::RandomState`] ++ /// as the hasher when creating a [`HashMap`], for example with ++ /// [`with_hasher`](HashMap::with_hasher) method. ++ /// ++ /// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack ++ /// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// let mut map: HashMap<&str, i32> = HashMap::new(); ++ /// assert_eq!(map.len(), 0); ++ /// assert_eq!(map.capacity(), 0); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn new() -> Self { ++ Self::default() ++ } ++ ++ /// Creates an empty `HashMap` with the specified capacity. ++ /// ++ /// The hash map will be able to hold at least `capacity` elements without ++ /// reallocating. If `capacity` is 0, the hash map will not allocate. ++ /// ++ /// # HashDoS resistance ++ /// ++ /// The `hash_builder` normally use a fixed key by default and that does ++ /// not allow the `HashMap` to be protected against attacks such as [`HashDoS`]. ++ /// Users who require HashDoS resistance should explicitly use ++ /// [`ahash::RandomState`] or [`std::collections::hash_map::RandomState`] ++ /// as the hasher when creating a [`HashMap`], for example with ++ /// [`with_capacity_and_hasher`](HashMap::with_capacity_and_hasher) method. ++ /// ++ /// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack ++ /// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// let mut map: HashMap<&str, i32> = HashMap::with_capacity(10); ++ /// assert_eq!(map.len(), 0); ++ /// assert!(map.capacity() >= 10); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn with_capacity(capacity: usize) -> Self { ++ Self::with_capacity_and_hasher(capacity, DefaultHashBuilder::default()) ++ } ++} ++ ++#[cfg(feature = "ahash")] ++impl HashMap { ++ /// Creates an empty `HashMap` using the given allocator. ++ /// ++ /// The hash map is initially created with a capacity of 0, so it will not allocate until it ++ /// is first inserted into. ++ /// ++ /// # HashDoS resistance ++ /// ++ /// The `hash_builder` normally use a fixed key by default and that does ++ /// not allow the `HashMap` to be protected against attacks such as [`HashDoS`]. ++ /// Users who require HashDoS resistance should explicitly use ++ /// [`ahash::RandomState`] or [`std::collections::hash_map::RandomState`] ++ /// as the hasher when creating a [`HashMap`], for example with ++ /// [`with_hasher_in`](HashMap::with_hasher_in) method. ++ /// ++ /// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack ++ /// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// use bumpalo::Bump; ++ /// ++ /// let bump = Bump::new(); ++ /// let mut map = HashMap::new_in(&bump); ++ /// ++ /// // The created HashMap holds none elements ++ /// assert_eq!(map.len(), 0); ++ /// ++ /// // The created HashMap also doesn't allocate memory ++ /// assert_eq!(map.capacity(), 0); ++ /// ++ /// // Now we insert element inside created HashMap ++ /// map.insert("One", 1); ++ /// // We can see that the HashMap holds 1 element ++ /// assert_eq!(map.len(), 1); ++ /// // And it also allocates some capacity ++ /// assert!(map.capacity() > 1); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn new_in(alloc: A) -> Self { ++ Self::with_hasher_in(DefaultHashBuilder::default(), alloc) ++ } ++ ++ /// Creates an empty `HashMap` with the specified capacity using the given allocator. ++ /// ++ /// The hash map will be able to hold at least `capacity` elements without ++ /// reallocating. If `capacity` is 0, the hash map will not allocate. ++ /// ++ /// # HashDoS resistance ++ /// ++ /// The `hash_builder` normally use a fixed key by default and that does ++ /// not allow the `HashMap` to be protected against attacks such as [`HashDoS`]. ++ /// Users who require HashDoS resistance should explicitly use ++ /// [`ahash::RandomState`] or [`std::collections::hash_map::RandomState`] ++ /// as the hasher when creating a [`HashMap`], for example with ++ /// [`with_capacity_and_hasher_in`](HashMap::with_capacity_and_hasher_in) method. ++ /// ++ /// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack ++ /// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// use bumpalo::Bump; ++ /// ++ /// let bump = Bump::new(); ++ /// let mut map = HashMap::with_capacity_in(5, &bump); ++ /// ++ /// // The created HashMap holds none elements ++ /// assert_eq!(map.len(), 0); ++ /// // But it can hold at least 5 elements without reallocating ++ /// let empty_map_capacity = map.capacity(); ++ /// assert!(empty_map_capacity >= 5); ++ /// ++ /// // Now we insert some 5 elements inside created HashMap ++ /// map.insert("One", 1); ++ /// map.insert("Two", 2); ++ /// map.insert("Three", 3); ++ /// map.insert("Four", 4); ++ /// map.insert("Five", 5); ++ /// ++ /// // We can see that the HashMap holds 5 elements ++ /// assert_eq!(map.len(), 5); ++ /// // But its capacity isn't changed ++ /// assert_eq!(map.capacity(), empty_map_capacity) ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn with_capacity_in(capacity: usize, alloc: A) -> Self { ++ Self::with_capacity_and_hasher_in(capacity, DefaultHashBuilder::default(), alloc) ++ } ++} ++ ++impl HashMap { ++ /// Creates an empty `HashMap` which will use the given hash builder to hash ++ /// keys. ++ /// ++ /// The hash map is initially created with a capacity of 0, so it will not ++ /// allocate until it is first inserted into. ++ /// ++ /// # HashDoS resistance ++ /// ++ /// The `hash_builder` normally use a fixed key by default and that does ++ /// not allow the `HashMap` to be protected against attacks such as [`HashDoS`]. ++ /// Users who require HashDoS resistance should explicitly use ++ /// [`ahash::RandomState`] or [`std::collections::hash_map::RandomState`] ++ /// as the hasher when creating a [`HashMap`]. ++ /// ++ /// The `hash_builder` passed should implement the [`BuildHasher`] trait for ++ /// the HashMap to be useful, see its documentation for details. ++ /// ++ /// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack ++ /// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html ++ /// [`BuildHasher`]: https://doc.rust-lang.org/std/hash/trait.BuildHasher.html ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// use hashbrown::hash_map::DefaultHashBuilder; ++ /// ++ /// let s = DefaultHashBuilder::default(); ++ /// let mut map = HashMap::with_hasher(s); ++ /// assert_eq!(map.len(), 0); ++ /// assert_eq!(map.capacity(), 0); ++ /// ++ /// map.insert(1, 2); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub const fn with_hasher(hash_builder: S) -> Self { ++ Self { ++ hash_builder, ++ table: RawTable::new(), ++ } ++ } ++ ++ /// Creates an empty `HashMap` with the specified capacity, using `hash_builder` ++ /// to hash the keys. ++ /// ++ /// The hash map will be able to hold at least `capacity` elements without ++ /// reallocating. If `capacity` is 0, the hash map will not allocate. ++ /// ++ /// # HashDoS resistance ++ /// ++ /// The `hash_builder` normally use a fixed key by default and that does ++ /// not allow the `HashMap` to be protected against attacks such as [`HashDoS`]. ++ /// Users who require HashDoS resistance should explicitly use ++ /// [`ahash::RandomState`] or [`std::collections::hash_map::RandomState`] ++ /// as the hasher when creating a [`HashMap`]. ++ /// ++ /// The `hash_builder` passed should implement the [`BuildHasher`] trait for ++ /// the HashMap to be useful, see its documentation for details. ++ /// ++ /// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack ++ /// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html ++ /// [`BuildHasher`]: https://doc.rust-lang.org/std/hash/trait.BuildHasher.html ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// use hashbrown::hash_map::DefaultHashBuilder; ++ /// ++ /// let s = DefaultHashBuilder::default(); ++ /// let mut map = HashMap::with_capacity_and_hasher(10, s); ++ /// assert_eq!(map.len(), 0); ++ /// assert!(map.capacity() >= 10); ++ /// ++ /// map.insert(1, 2); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn with_capacity_and_hasher(capacity: usize, hash_builder: S) -> Self { ++ Self { ++ hash_builder, ++ table: RawTable::with_capacity(capacity), ++ } ++ } ++} ++ ++impl HashMap { ++ /// Returns a reference to the underlying allocator. ++ #[inline] ++ pub fn allocator(&self) -> &A { ++ self.table.allocator() ++ } ++ ++ /// Creates an empty `HashMap` which will use the given hash builder to hash ++ /// keys. It will be allocated with the given allocator. ++ /// ++ /// The hash map is initially created with a capacity of 0, so it will not allocate until it ++ /// is first inserted into. ++ /// ++ /// # HashDoS resistance ++ /// ++ /// The `hash_builder` normally use a fixed key by default and that does ++ /// not allow the `HashMap` to be protected against attacks such as [`HashDoS`]. ++ /// Users who require HashDoS resistance should explicitly use ++ /// [`ahash::RandomState`] or [`std::collections::hash_map::RandomState`] ++ /// as the hasher when creating a [`HashMap`]. ++ /// ++ /// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack ++ /// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// use hashbrown::hash_map::DefaultHashBuilder; ++ /// ++ /// let s = DefaultHashBuilder::default(); ++ /// let mut map = HashMap::with_hasher(s); ++ /// map.insert(1, 2); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub const fn with_hasher_in(hash_builder: S, alloc: A) -> Self { ++ Self { ++ hash_builder, ++ table: RawTable::new_in(alloc), ++ } ++ } ++ ++ /// Creates an empty `HashMap` with the specified capacity, using `hash_builder` ++ /// to hash the keys. It will be allocated with the given allocator. ++ /// ++ /// The hash map will be able to hold at least `capacity` elements without ++ /// reallocating. If `capacity` is 0, the hash map will not allocate. ++ /// ++ /// # HashDoS resistance ++ /// ++ /// The `hash_builder` normally use a fixed key by default and that does ++ /// not allow the `HashMap` to be protected against attacks such as [`HashDoS`]. ++ /// Users who require HashDoS resistance should explicitly use ++ /// [`ahash::RandomState`] or [`std::collections::hash_map::RandomState`] ++ /// as the hasher when creating a [`HashMap`]. ++ /// ++ /// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack ++ /// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// use hashbrown::hash_map::DefaultHashBuilder; ++ /// ++ /// let s = DefaultHashBuilder::default(); ++ /// let mut map = HashMap::with_capacity_and_hasher(10, s); ++ /// map.insert(1, 2); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn with_capacity_and_hasher_in(capacity: usize, hash_builder: S, alloc: A) -> Self { ++ Self { ++ hash_builder, ++ table: RawTable::with_capacity_in(capacity, alloc), ++ } ++ } ++ ++ /// Returns a reference to the map's [`BuildHasher`]. ++ /// ++ /// [`BuildHasher`]: https://doc.rust-lang.org/std/hash/trait.BuildHasher.html ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// use hashbrown::hash_map::DefaultHashBuilder; ++ /// ++ /// let hasher = DefaultHashBuilder::default(); ++ /// let map: HashMap = HashMap::with_hasher(hasher); ++ /// let hasher: &DefaultHashBuilder = map.hasher(); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn hasher(&self) -> &S { ++ &self.hash_builder ++ } ++ ++ /// Returns the number of elements the map can hold without reallocating. ++ /// ++ /// This number is a lower bound; the `HashMap` might be able to hold ++ /// more, but is guaranteed to be able to hold at least this many. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// let map: HashMap = HashMap::with_capacity(100); ++ /// assert_eq!(map.len(), 0); ++ /// assert!(map.capacity() >= 100); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn capacity(&self) -> usize { ++ self.table.capacity() ++ } ++ ++ /// An iterator visiting all keys in arbitrary order. ++ /// The iterator element type is `&'a K`. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map = HashMap::new(); ++ /// map.insert("a", 1); ++ /// map.insert("b", 2); ++ /// map.insert("c", 3); ++ /// assert_eq!(map.len(), 3); ++ /// let mut vec: Vec<&str> = Vec::new(); ++ /// ++ /// for key in map.keys() { ++ /// println!("{}", key); ++ /// vec.push(*key); ++ /// } ++ /// ++ /// // The `Keys` iterator produces keys in arbitrary order, so the ++ /// // keys must be sorted to test them against a sorted array. ++ /// vec.sort_unstable(); ++ /// assert_eq!(vec, ["a", "b", "c"]); ++ /// ++ /// assert_eq!(map.len(), 3); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn keys(&self) -> Keys<'_, K, V> { ++ Keys { inner: self.iter() } ++ } ++ ++ /// An iterator visiting all values in arbitrary order. ++ /// The iterator element type is `&'a V`. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map = HashMap::new(); ++ /// map.insert("a", 1); ++ /// map.insert("b", 2); ++ /// map.insert("c", 3); ++ /// assert_eq!(map.len(), 3); ++ /// let mut vec: Vec = Vec::new(); ++ /// ++ /// for val in map.values() { ++ /// println!("{}", val); ++ /// vec.push(*val); ++ /// } ++ /// ++ /// // The `Values` iterator produces values in arbitrary order, so the ++ /// // values must be sorted to test them against a sorted array. ++ /// vec.sort_unstable(); ++ /// assert_eq!(vec, [1, 2, 3]); ++ /// ++ /// assert_eq!(map.len(), 3); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn values(&self) -> Values<'_, K, V> { ++ Values { inner: self.iter() } ++ } ++ ++ /// An iterator visiting all values mutably in arbitrary order. ++ /// The iterator element type is `&'a mut V`. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map = HashMap::new(); ++ /// ++ /// map.insert("a", 1); ++ /// map.insert("b", 2); ++ /// map.insert("c", 3); ++ /// ++ /// for val in map.values_mut() { ++ /// *val = *val + 10; ++ /// } ++ /// ++ /// assert_eq!(map.len(), 3); ++ /// let mut vec: Vec = Vec::new(); ++ /// ++ /// for val in map.values() { ++ /// println!("{}", val); ++ /// vec.push(*val); ++ /// } ++ /// ++ /// // The `Values` iterator produces values in arbitrary order, so the ++ /// // values must be sorted to test them against a sorted array. ++ /// vec.sort_unstable(); ++ /// assert_eq!(vec, [11, 12, 13]); ++ /// ++ /// assert_eq!(map.len(), 3); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn values_mut(&mut self) -> ValuesMut<'_, K, V> { ++ ValuesMut { ++ inner: self.iter_mut(), ++ } ++ } ++ ++ /// An iterator visiting all key-value pairs in arbitrary order. ++ /// The iterator element type is `(&'a K, &'a V)`. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map = HashMap::new(); ++ /// map.insert("a", 1); ++ /// map.insert("b", 2); ++ /// map.insert("c", 3); ++ /// assert_eq!(map.len(), 3); ++ /// let mut vec: Vec<(&str, i32)> = Vec::new(); ++ /// ++ /// for (key, val) in map.iter() { ++ /// println!("key: {} val: {}", key, val); ++ /// vec.push((*key, *val)); ++ /// } ++ /// ++ /// // The `Iter` iterator produces items in arbitrary order, so the ++ /// // items must be sorted to test them against a sorted array. ++ /// vec.sort_unstable(); ++ /// assert_eq!(vec, [("a", 1), ("b", 2), ("c", 3)]); ++ /// ++ /// assert_eq!(map.len(), 3); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn iter(&self) -> Iter<'_, K, V> { ++ // Here we tie the lifetime of self to the iter. ++ unsafe { ++ Iter { ++ inner: self.table.iter(), ++ marker: PhantomData, ++ } ++ } ++ } ++ ++ /// An iterator visiting all key-value pairs in arbitrary order, ++ /// with mutable references to the values. ++ /// The iterator element type is `(&'a K, &'a mut V)`. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map = HashMap::new(); ++ /// map.insert("a", 1); ++ /// map.insert("b", 2); ++ /// map.insert("c", 3); ++ /// ++ /// // Update all values ++ /// for (_, val) in map.iter_mut() { ++ /// *val *= 2; ++ /// } ++ /// ++ /// assert_eq!(map.len(), 3); ++ /// let mut vec: Vec<(&str, i32)> = Vec::new(); ++ /// ++ /// for (key, val) in &map { ++ /// println!("key: {} val: {}", key, val); ++ /// vec.push((*key, *val)); ++ /// } ++ /// ++ /// // The `Iter` iterator produces items in arbitrary order, so the ++ /// // items must be sorted to test them against a sorted array. ++ /// vec.sort_unstable(); ++ /// assert_eq!(vec, [("a", 2), ("b", 4), ("c", 6)]); ++ /// ++ /// assert_eq!(map.len(), 3); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn iter_mut(&mut self) -> IterMut<'_, K, V> { ++ // Here we tie the lifetime of self to the iter. ++ unsafe { ++ IterMut { ++ inner: self.table.iter(), ++ marker: PhantomData, ++ } ++ } ++ } ++ ++ #[cfg(test)] ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn raw_capacity(&self) -> usize { ++ self.table.buckets() ++ } ++ ++ /// Returns the number of elements in the map. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut a = HashMap::new(); ++ /// assert_eq!(a.len(), 0); ++ /// a.insert(1, "a"); ++ /// assert_eq!(a.len(), 1); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn len(&self) -> usize { ++ self.table.len() ++ } ++ ++ /// Returns `true` if the map contains no elements. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut a = HashMap::new(); ++ /// assert!(a.is_empty()); ++ /// a.insert(1, "a"); ++ /// assert!(!a.is_empty()); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn is_empty(&self) -> bool { ++ self.len() == 0 ++ } ++ ++ /// Clears the map, returning all key-value pairs as an iterator. Keeps the ++ /// allocated memory for reuse. ++ /// ++ /// If the returned iterator is dropped before being fully consumed, it ++ /// drops the remaining key-value pairs. The returned iterator keeps a ++ /// mutable borrow on the vector to optimize its implementation. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut a = HashMap::new(); ++ /// a.insert(1, "a"); ++ /// a.insert(2, "b"); ++ /// let capacity_before_drain = a.capacity(); ++ /// ++ /// for (k, v) in a.drain().take(1) { ++ /// assert!(k == 1 || k == 2); ++ /// assert!(v == "a" || v == "b"); ++ /// } ++ /// ++ /// // As we can see, the map is empty and contains no element. ++ /// assert!(a.is_empty() && a.len() == 0); ++ /// // But map capacity is equal to old one. ++ /// assert_eq!(a.capacity(), capacity_before_drain); ++ /// ++ /// let mut a = HashMap::new(); ++ /// a.insert(1, "a"); ++ /// a.insert(2, "b"); ++ /// ++ /// { // Iterator is dropped without being consumed. ++ /// let d = a.drain(); ++ /// } ++ /// ++ /// // But the map is empty even if we do not use Drain iterator. ++ /// assert!(a.is_empty()); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn drain(&mut self) -> Drain<'_, K, V, A> { ++ Drain { ++ inner: self.table.drain(), ++ } ++ } ++ ++ /// Retains only the elements specified by the predicate. Keeps the ++ /// allocated memory for reuse. ++ /// ++ /// In other words, remove all pairs `(k, v)` such that `f(&k, &mut v)` returns `false`. ++ /// The elements are visited in unsorted (and unspecified) order. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map: HashMap = (0..8).map(|x|(x, x*10)).collect(); ++ /// assert_eq!(map.len(), 8); ++ /// ++ /// map.retain(|&k, _| k % 2 == 0); ++ /// ++ /// // We can see, that the number of elements inside map is changed. ++ /// assert_eq!(map.len(), 4); ++ /// ++ /// let mut vec: Vec<(i32, i32)> = map.iter().map(|(&k, &v)| (k, v)).collect(); ++ /// vec.sort_unstable(); ++ /// assert_eq!(vec, [(0, 0), (2, 20), (4, 40), (6, 60)]); ++ /// ``` ++ pub fn retain(&mut self, mut f: F) ++ where ++ F: FnMut(&K, &mut V) -> bool, ++ { ++ // Here we only use `iter` as a temporary, preventing use-after-free ++ unsafe { ++ for item in self.table.iter() { ++ let &mut (ref key, ref mut value) = item.as_mut(); ++ if !f(key, value) { ++ self.table.erase(item); ++ } ++ } ++ } ++ } ++ ++ /// Drains elements which are true under the given predicate, ++ /// and returns an iterator over the removed items. ++ /// ++ /// In other words, move all pairs `(k, v)` such that `f(&k, &mut v)` returns `true` out ++ /// into another iterator. ++ /// ++ /// Note that `extract_if` lets you mutate every value in the filter closure, regardless of ++ /// whether you choose to keep or remove it. ++ /// ++ /// If the returned `ExtractIf` is not exhausted, e.g. because it is dropped without iterating ++ /// or the iteration short-circuits, then the remaining elements will be retained. ++ /// Use [`retain()`] with a negated predicate if you do not need the returned iterator. ++ /// ++ /// Keeps the allocated memory for reuse. ++ /// ++ /// [`retain()`]: HashMap::retain ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map: HashMap = (0..8).map(|x| (x, x)).collect(); ++ /// ++ /// let drained: HashMap = map.extract_if(|k, _v| k % 2 == 0).collect(); ++ /// ++ /// let mut evens = drained.keys().cloned().collect::>(); ++ /// let mut odds = map.keys().cloned().collect::>(); ++ /// evens.sort(); ++ /// odds.sort(); ++ /// ++ /// assert_eq!(evens, vec![0, 2, 4, 6]); ++ /// assert_eq!(odds, vec![1, 3, 5, 7]); ++ /// ++ /// let mut map: HashMap = (0..8).map(|x| (x, x)).collect(); ++ /// ++ /// { // Iterator is dropped without being consumed. ++ /// let d = map.extract_if(|k, _v| k % 2 != 0); ++ /// } ++ /// ++ /// // ExtractIf was not exhausted, therefore no elements were drained. ++ /// assert_eq!(map.len(), 8); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn extract_if(&mut self, f: F) -> ExtractIf<'_, K, V, F, A> ++ where ++ F: FnMut(&K, &mut V) -> bool, ++ { ++ ExtractIf { ++ f, ++ inner: RawExtractIf { ++ iter: unsafe { self.table.iter() }, ++ table: &mut self.table, ++ }, ++ } ++ } ++ ++ /// Clears the map, removing all key-value pairs. Keeps the allocated memory ++ /// for reuse. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut a = HashMap::new(); ++ /// a.insert(1, "a"); ++ /// let capacity_before_clear = a.capacity(); ++ /// ++ /// a.clear(); ++ /// ++ /// // Map is empty. ++ /// assert!(a.is_empty()); ++ /// // But map capacity is equal to old one. ++ /// assert_eq!(a.capacity(), capacity_before_clear); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn clear(&mut self) { ++ self.table.clear(); ++ } ++ ++ /// Creates a consuming iterator visiting all the keys in arbitrary order. ++ /// The map cannot be used after calling this. ++ /// The iterator element type is `K`. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map = HashMap::new(); ++ /// map.insert("a", 1); ++ /// map.insert("b", 2); ++ /// map.insert("c", 3); ++ /// ++ /// let mut vec: Vec<&str> = map.into_keys().collect(); ++ /// ++ /// // The `IntoKeys` iterator produces keys in arbitrary order, so the ++ /// // keys must be sorted to test them against a sorted array. ++ /// vec.sort_unstable(); ++ /// assert_eq!(vec, ["a", "b", "c"]); ++ /// ``` ++ #[inline] ++ pub fn into_keys(self) -> IntoKeys { ++ IntoKeys { ++ inner: self.into_iter(), ++ } ++ } ++ ++ /// Creates a consuming iterator visiting all the values in arbitrary order. ++ /// The map cannot be used after calling this. ++ /// The iterator element type is `V`. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map = HashMap::new(); ++ /// map.insert("a", 1); ++ /// map.insert("b", 2); ++ /// map.insert("c", 3); ++ /// ++ /// let mut vec: Vec = map.into_values().collect(); ++ /// ++ /// // The `IntoValues` iterator produces values in arbitrary order, so ++ /// // the values must be sorted to test them against a sorted array. ++ /// vec.sort_unstable(); ++ /// assert_eq!(vec, [1, 2, 3]); ++ /// ``` ++ #[inline] ++ pub fn into_values(self) -> IntoValues { ++ IntoValues { ++ inner: self.into_iter(), ++ } ++ } ++} ++ ++impl HashMap ++where ++ K: Eq + Hash, ++ S: BuildHasher, ++ A: Allocator, ++{ ++ /// Reserves capacity for at least `additional` more elements to be inserted ++ /// in the `HashMap`. The collection may reserve more space to avoid ++ /// frequent reallocations. ++ /// ++ /// # Panics ++ /// ++ /// Panics if the new capacity exceeds [`isize::MAX`] bytes and [`abort`] the program ++ /// in case of allocation error. Use [`try_reserve`](HashMap::try_reserve) instead ++ /// if you want to handle memory allocation failure. ++ /// ++ /// [`isize::MAX`]: https://doc.rust-lang.org/std/primitive.isize.html ++ /// [`abort`]: https://doc.rust-lang.org/alloc/alloc/fn.handle_alloc_error.html ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// let mut map: HashMap<&str, i32> = HashMap::new(); ++ /// // Map is empty and doesn't allocate memory ++ /// assert_eq!(map.capacity(), 0); ++ /// ++ /// map.reserve(10); ++ /// ++ /// // And now map can hold at least 10 elements ++ /// assert!(map.capacity() >= 10); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn reserve(&mut self, additional: usize) { ++ self.table ++ .reserve(additional, make_hasher::<_, V, S>(&self.hash_builder)); ++ } ++ ++ /// Tries to reserve capacity for at least `additional` more elements to be inserted ++ /// in the given `HashMap`. The collection may reserve more space to avoid ++ /// frequent reallocations. ++ /// ++ /// # Errors ++ /// ++ /// If the capacity overflows, or the allocator reports a failure, then an error ++ /// is returned. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map: HashMap<&str, isize> = HashMap::new(); ++ /// // Map is empty and doesn't allocate memory ++ /// assert_eq!(map.capacity(), 0); ++ /// ++ /// map.try_reserve(10).expect("why is the test harness OOMing on 10 bytes?"); ++ /// ++ /// // And now map can hold at least 10 elements ++ /// assert!(map.capacity() >= 10); ++ /// ``` ++ /// If the capacity overflows, or the allocator reports a failure, then an error ++ /// is returned: ++ /// ``` ++ /// # fn test() { ++ /// use hashbrown::HashMap; ++ /// use hashbrown::TryReserveError; ++ /// let mut map: HashMap = HashMap::new(); ++ /// ++ /// match map.try_reserve(usize::MAX) { ++ /// Err(error) => match error { ++ /// TryReserveError::CapacityOverflow => {} ++ /// _ => panic!("TryReserveError::AllocError ?"), ++ /// }, ++ /// _ => panic!(), ++ /// } ++ /// # } ++ /// # fn main() { ++ /// # #[cfg(not(miri))] ++ /// # test() ++ /// # } ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> { ++ self.table ++ .try_reserve(additional, make_hasher::<_, V, S>(&self.hash_builder)) ++ } ++ ++ /// Shrinks the capacity of the map as much as possible. It will drop ++ /// down as much as possible while maintaining the internal rules ++ /// and possibly leaving some space in accordance with the resize policy. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map: HashMap = HashMap::with_capacity(100); ++ /// map.insert(1, 2); ++ /// map.insert(3, 4); ++ /// assert!(map.capacity() >= 100); ++ /// map.shrink_to_fit(); ++ /// assert!(map.capacity() >= 2); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn shrink_to_fit(&mut self) { ++ self.table ++ .shrink_to(0, make_hasher::<_, V, S>(&self.hash_builder)); ++ } ++ ++ /// Shrinks the capacity of the map with a lower limit. It will drop ++ /// down no lower than the supplied limit while maintaining the internal rules ++ /// and possibly leaving some space in accordance with the resize policy. ++ /// ++ /// This function does nothing if the current capacity is smaller than the ++ /// supplied minimum capacity. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map: HashMap = HashMap::with_capacity(100); ++ /// map.insert(1, 2); ++ /// map.insert(3, 4); ++ /// assert!(map.capacity() >= 100); ++ /// map.shrink_to(10); ++ /// assert!(map.capacity() >= 10); ++ /// map.shrink_to(0); ++ /// assert!(map.capacity() >= 2); ++ /// map.shrink_to(10); ++ /// assert!(map.capacity() >= 2); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn shrink_to(&mut self, min_capacity: usize) { ++ self.table ++ .shrink_to(min_capacity, make_hasher::<_, V, S>(&self.hash_builder)); ++ } ++ ++ /// Gets the given key's corresponding entry in the map for in-place manipulation. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut letters = HashMap::new(); ++ /// ++ /// for ch in "a short treatise on fungi".chars() { ++ /// let counter = letters.entry(ch).or_insert(0); ++ /// *counter += 1; ++ /// } ++ /// ++ /// assert_eq!(letters[&'s'], 2); ++ /// assert_eq!(letters[&'t'], 3); ++ /// assert_eq!(letters[&'u'], 1); ++ /// assert_eq!(letters.get(&'y'), None); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn entry(&mut self, key: K) -> Entry<'_, K, V, S, A> { ++ let hash = make_hash::(&self.hash_builder, &key); ++ if let Some(elem) = self.table.find(hash, equivalent_key(&key)) { ++ Entry::Occupied(OccupiedEntry { ++ hash, ++ key: Some(key), ++ elem, ++ table: self, ++ }) ++ } else { ++ Entry::Vacant(VacantEntry { ++ hash, ++ key, ++ table: self, ++ }) ++ } ++ } ++ ++ /// Gets the given key's corresponding entry by reference in the map for in-place manipulation. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut words: HashMap = HashMap::new(); ++ /// let source = ["poneyland", "horseyland", "poneyland", "poneyland"]; ++ /// for (i, &s) in source.iter().enumerate() { ++ /// let counter = words.entry_ref(s).or_insert(0); ++ /// *counter += 1; ++ /// } ++ /// ++ /// assert_eq!(words["poneyland"], 3); ++ /// assert_eq!(words["horseyland"], 1); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn entry_ref<'a, 'b, Q: ?Sized>(&'a mut self, key: &'b Q) -> EntryRef<'a, 'b, K, Q, V, S, A> ++ where ++ Q: Hash + Equivalent, ++ { ++ let hash = make_hash::(&self.hash_builder, key); ++ if let Some(elem) = self.table.find(hash, equivalent_key(key)) { ++ EntryRef::Occupied(OccupiedEntryRef { ++ hash, ++ key: Some(KeyOrRef::Borrowed(key)), ++ elem, ++ table: self, ++ }) ++ } else { ++ EntryRef::Vacant(VacantEntryRef { ++ hash, ++ key: KeyOrRef::Borrowed(key), ++ table: self, ++ }) ++ } ++ } ++ ++ /// Returns a reference to the value corresponding to the key. ++ /// ++ /// The key may be any borrowed form of the map's key type, but ++ /// [`Hash`] and [`Eq`] on the borrowed form *must* match those for ++ /// the key type. ++ /// ++ /// [`Eq`]: https://doc.rust-lang.org/std/cmp/trait.Eq.html ++ /// [`Hash`]: https://doc.rust-lang.org/std/hash/trait.Hash.html ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map = HashMap::new(); ++ /// map.insert(1, "a"); ++ /// assert_eq!(map.get(&1), Some(&"a")); ++ /// assert_eq!(map.get(&2), None); ++ /// ``` ++ #[inline] ++ pub fn get(&self, k: &Q) -> Option<&V> ++ where ++ Q: Hash + Equivalent, ++ { ++ // Avoid `Option::map` because it bloats LLVM IR. ++ match self.get_inner(k) { ++ Some((_, v)) => Some(v), ++ None => None, ++ } ++ } ++ ++ /// Returns the key-value pair corresponding to the supplied key. ++ /// ++ /// The supplied key may be any borrowed form of the map's key type, but ++ /// [`Hash`] and [`Eq`] on the borrowed form *must* match those for ++ /// the key type. ++ /// ++ /// [`Eq`]: https://doc.rust-lang.org/std/cmp/trait.Eq.html ++ /// [`Hash`]: https://doc.rust-lang.org/std/hash/trait.Hash.html ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map = HashMap::new(); ++ /// map.insert(1, "a"); ++ /// assert_eq!(map.get_key_value(&1), Some((&1, &"a"))); ++ /// assert_eq!(map.get_key_value(&2), None); ++ /// ``` ++ #[inline] ++ pub fn get_key_value(&self, k: &Q) -> Option<(&K, &V)> ++ where ++ Q: Hash + Equivalent, ++ { ++ // Avoid `Option::map` because it bloats LLVM IR. ++ match self.get_inner(k) { ++ Some((key, value)) => Some((key, value)), ++ None => None, ++ } ++ } ++ ++ #[inline] ++ fn get_inner(&self, k: &Q) -> Option<&(K, V)> ++ where ++ Q: Hash + Equivalent, ++ { ++ if self.table.is_empty() { ++ None ++ } else { ++ let hash = make_hash::(&self.hash_builder, k); ++ self.table.get(hash, equivalent_key(k)) ++ } ++ } ++ ++ /// Returns the key-value pair corresponding to the supplied key, with a mutable reference to value. ++ /// ++ /// The supplied key may be any borrowed form of the map's key type, but ++ /// [`Hash`] and [`Eq`] on the borrowed form *must* match those for ++ /// the key type. ++ /// ++ /// [`Eq`]: https://doc.rust-lang.org/std/cmp/trait.Eq.html ++ /// [`Hash`]: https://doc.rust-lang.org/std/hash/trait.Hash.html ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map = HashMap::new(); ++ /// map.insert(1, "a"); ++ /// let (k, v) = map.get_key_value_mut(&1).unwrap(); ++ /// assert_eq!(k, &1); ++ /// assert_eq!(v, &mut "a"); ++ /// *v = "b"; ++ /// assert_eq!(map.get_key_value_mut(&1), Some((&1, &mut "b"))); ++ /// assert_eq!(map.get_key_value_mut(&2), None); ++ /// ``` ++ #[inline] ++ pub fn get_key_value_mut(&mut self, k: &Q) -> Option<(&K, &mut V)> ++ where ++ Q: Hash + Equivalent, ++ { ++ // Avoid `Option::map` because it bloats LLVM IR. ++ match self.get_inner_mut(k) { ++ Some(&mut (ref key, ref mut value)) => Some((key, value)), ++ None => None, ++ } ++ } ++ ++ /// Returns `true` if the map contains a value for the specified key. ++ /// ++ /// The key may be any borrowed form of the map's key type, but ++ /// [`Hash`] and [`Eq`] on the borrowed form *must* match those for ++ /// the key type. ++ /// ++ /// [`Eq`]: https://doc.rust-lang.org/std/cmp/trait.Eq.html ++ /// [`Hash`]: https://doc.rust-lang.org/std/hash/trait.Hash.html ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map = HashMap::new(); ++ /// map.insert(1, "a"); ++ /// assert_eq!(map.contains_key(&1), true); ++ /// assert_eq!(map.contains_key(&2), false); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn contains_key(&self, k: &Q) -> bool ++ where ++ Q: Hash + Equivalent, ++ { ++ self.get_inner(k).is_some() ++ } ++ ++ /// Returns a mutable reference to the value corresponding to the key. ++ /// ++ /// The key may be any borrowed form of the map's key type, but ++ /// [`Hash`] and [`Eq`] on the borrowed form *must* match those for ++ /// the key type. ++ /// ++ /// [`Eq`]: https://doc.rust-lang.org/std/cmp/trait.Eq.html ++ /// [`Hash`]: https://doc.rust-lang.org/std/hash/trait.Hash.html ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map = HashMap::new(); ++ /// map.insert(1, "a"); ++ /// if let Some(x) = map.get_mut(&1) { ++ /// *x = "b"; ++ /// } ++ /// assert_eq!(map[&1], "b"); ++ /// ++ /// assert_eq!(map.get_mut(&2), None); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn get_mut(&mut self, k: &Q) -> Option<&mut V> ++ where ++ Q: Hash + Equivalent, ++ { ++ // Avoid `Option::map` because it bloats LLVM IR. ++ match self.get_inner_mut(k) { ++ Some(&mut (_, ref mut v)) => Some(v), ++ None => None, ++ } ++ } ++ ++ #[inline] ++ fn get_inner_mut(&mut self, k: &Q) -> Option<&mut (K, V)> ++ where ++ Q: Hash + Equivalent, ++ { ++ if self.table.is_empty() { ++ None ++ } else { ++ let hash = make_hash::(&self.hash_builder, k); ++ self.table.get_mut(hash, equivalent_key(k)) ++ } ++ } ++ ++ /// Attempts to get mutable references to `N` values in the map at once. ++ /// ++ /// Returns an array of length `N` with the results of each query. For soundness, at most one ++ /// mutable reference will be returned to any value. `None` will be returned if any of the ++ /// keys are duplicates or missing. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut libraries = HashMap::new(); ++ /// libraries.insert("Bodleian Library".to_string(), 1602); ++ /// libraries.insert("Athenæum".to_string(), 1807); ++ /// libraries.insert("Herzogin-Anna-Amalia-Bibliothek".to_string(), 1691); ++ /// libraries.insert("Library of Congress".to_string(), 1800); ++ /// ++ /// let got = libraries.get_many_mut([ ++ /// "Athenæum", ++ /// "Library of Congress", ++ /// ]); ++ /// assert_eq!( ++ /// got, ++ /// Some([ ++ /// &mut 1807, ++ /// &mut 1800, ++ /// ]), ++ /// ); ++ /// ++ /// // Missing keys result in None ++ /// let got = libraries.get_many_mut([ ++ /// "Athenæum", ++ /// "New York Public Library", ++ /// ]); ++ /// assert_eq!(got, None); ++ /// ++ /// // Duplicate keys result in None ++ /// let got = libraries.get_many_mut([ ++ /// "Athenæum", ++ /// "Athenæum", ++ /// ]); ++ /// assert_eq!(got, None); ++ /// ``` ++ pub fn get_many_mut(&mut self, ks: [&Q; N]) -> Option<[&'_ mut V; N]> ++ where ++ Q: Hash + Equivalent, ++ { ++ self.get_many_mut_inner(ks).map(|res| res.map(|(_, v)| v)) ++ } ++ ++ /// Attempts to get mutable references to `N` values in the map at once, without validating that ++ /// the values are unique. ++ /// ++ /// Returns an array of length `N` with the results of each query. `None` will be returned if ++ /// any of the keys are missing. ++ /// ++ /// For a safe alternative see [`get_many_mut`](`HashMap::get_many_mut`). ++ /// ++ /// # Safety ++ /// ++ /// Calling this method with overlapping keys is *[undefined behavior]* even if the resulting ++ /// references are not used. ++ /// ++ /// [undefined behavior]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut libraries = HashMap::new(); ++ /// libraries.insert("Bodleian Library".to_string(), 1602); ++ /// libraries.insert("Athenæum".to_string(), 1807); ++ /// libraries.insert("Herzogin-Anna-Amalia-Bibliothek".to_string(), 1691); ++ /// libraries.insert("Library of Congress".to_string(), 1800); ++ /// ++ /// let got = libraries.get_many_mut([ ++ /// "Athenæum", ++ /// "Library of Congress", ++ /// ]); ++ /// assert_eq!( ++ /// got, ++ /// Some([ ++ /// &mut 1807, ++ /// &mut 1800, ++ /// ]), ++ /// ); ++ /// ++ /// // Missing keys result in None ++ /// let got = libraries.get_many_mut([ ++ /// "Athenæum", ++ /// "New York Public Library", ++ /// ]); ++ /// assert_eq!(got, None); ++ /// ``` ++ pub unsafe fn get_many_unchecked_mut( ++ &mut self, ++ ks: [&Q; N], ++ ) -> Option<[&'_ mut V; N]> ++ where ++ Q: Hash + Equivalent, ++ { ++ self.get_many_unchecked_mut_inner(ks) ++ .map(|res| res.map(|(_, v)| v)) ++ } ++ ++ /// Attempts to get mutable references to `N` values in the map at once, with immutable ++ /// references to the corresponding keys. ++ /// ++ /// Returns an array of length `N` with the results of each query. For soundness, at most one ++ /// mutable reference will be returned to any value. `None` will be returned if any of the keys ++ /// are duplicates or missing. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut libraries = HashMap::new(); ++ /// libraries.insert("Bodleian Library".to_string(), 1602); ++ /// libraries.insert("Athenæum".to_string(), 1807); ++ /// libraries.insert("Herzogin-Anna-Amalia-Bibliothek".to_string(), 1691); ++ /// libraries.insert("Library of Congress".to_string(), 1800); ++ /// ++ /// let got = libraries.get_many_key_value_mut([ ++ /// "Bodleian Library", ++ /// "Herzogin-Anna-Amalia-Bibliothek", ++ /// ]); ++ /// assert_eq!( ++ /// got, ++ /// Some([ ++ /// (&"Bodleian Library".to_string(), &mut 1602), ++ /// (&"Herzogin-Anna-Amalia-Bibliothek".to_string(), &mut 1691), ++ /// ]), ++ /// ); ++ /// // Missing keys result in None ++ /// let got = libraries.get_many_key_value_mut([ ++ /// "Bodleian Library", ++ /// "Gewandhaus", ++ /// ]); ++ /// assert_eq!(got, None); ++ /// ++ /// // Duplicate keys result in None ++ /// let got = libraries.get_many_key_value_mut([ ++ /// "Bodleian Library", ++ /// "Herzogin-Anna-Amalia-Bibliothek", ++ /// "Herzogin-Anna-Amalia-Bibliothek", ++ /// ]); ++ /// assert_eq!(got, None); ++ /// ``` ++ pub fn get_many_key_value_mut( ++ &mut self, ++ ks: [&Q; N], ++ ) -> Option<[(&'_ K, &'_ mut V); N]> ++ where ++ Q: Hash + Equivalent, ++ { ++ self.get_many_mut_inner(ks) ++ .map(|res| res.map(|(k, v)| (&*k, v))) ++ } ++ ++ /// Attempts to get mutable references to `N` values in the map at once, with immutable ++ /// references to the corresponding keys, without validating that the values are unique. ++ /// ++ /// Returns an array of length `N` with the results of each query. `None` will be returned if ++ /// any of the keys are missing. ++ /// ++ /// For a safe alternative see [`get_many_key_value_mut`](`HashMap::get_many_key_value_mut`). ++ /// ++ /// # Safety ++ /// ++ /// Calling this method with overlapping keys is *[undefined behavior]* even if the resulting ++ /// references are not used. ++ /// ++ /// [undefined behavior]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut libraries = HashMap::new(); ++ /// libraries.insert("Bodleian Library".to_string(), 1602); ++ /// libraries.insert("Athenæum".to_string(), 1807); ++ /// libraries.insert("Herzogin-Anna-Amalia-Bibliothek".to_string(), 1691); ++ /// libraries.insert("Library of Congress".to_string(), 1800); ++ /// ++ /// let got = libraries.get_many_key_value_mut([ ++ /// "Bodleian Library", ++ /// "Herzogin-Anna-Amalia-Bibliothek", ++ /// ]); ++ /// assert_eq!( ++ /// got, ++ /// Some([ ++ /// (&"Bodleian Library".to_string(), &mut 1602), ++ /// (&"Herzogin-Anna-Amalia-Bibliothek".to_string(), &mut 1691), ++ /// ]), ++ /// ); ++ /// // Missing keys result in None ++ /// let got = libraries.get_many_key_value_mut([ ++ /// "Bodleian Library", ++ /// "Gewandhaus", ++ /// ]); ++ /// assert_eq!(got, None); ++ /// ``` ++ pub unsafe fn get_many_key_value_unchecked_mut( ++ &mut self, ++ ks: [&Q; N], ++ ) -> Option<[(&'_ K, &'_ mut V); N]> ++ where ++ Q: Hash + Equivalent, ++ { ++ self.get_many_unchecked_mut_inner(ks) ++ .map(|res| res.map(|(k, v)| (&*k, v))) ++ } ++ ++ fn get_many_mut_inner( ++ &mut self, ++ ks: [&Q; N], ++ ) -> Option<[&'_ mut (K, V); N]> ++ where ++ Q: Hash + Equivalent, ++ { ++ let hashes = self.build_hashes_inner(ks); ++ self.table ++ .get_many_mut(hashes, |i, (k, _)| ks[i].equivalent(k)) ++ } ++ ++ unsafe fn get_many_unchecked_mut_inner( ++ &mut self, ++ ks: [&Q; N], ++ ) -> Option<[&'_ mut (K, V); N]> ++ where ++ Q: Hash + Equivalent, ++ { ++ let hashes = self.build_hashes_inner(ks); ++ self.table ++ .get_many_unchecked_mut(hashes, |i, (k, _)| ks[i].equivalent(k)) ++ } ++ ++ fn build_hashes_inner(&self, ks: [&Q; N]) -> [u64; N] ++ where ++ Q: Hash + Equivalent, ++ { ++ let mut hashes = [0_u64; N]; ++ for i in 0..N { ++ hashes[i] = make_hash::(&self.hash_builder, ks[i]); ++ } ++ hashes ++ } ++ ++ /// Inserts a key-value pair into the map. ++ /// ++ /// If the map did not have this key present, [`None`] is returned. ++ /// ++ /// If the map did have this key present, the value is updated, and the old ++ /// value is returned. The key is not updated, though; this matters for ++ /// types that can be `==` without being identical. See the [`std::collections`] ++ /// [module-level documentation] for more. ++ /// ++ /// [`None`]: https://doc.rust-lang.org/std/option/enum.Option.html#variant.None ++ /// [`std::collections`]: https://doc.rust-lang.org/std/collections/index.html ++ /// [module-level documentation]: https://doc.rust-lang.org/std/collections/index.html#insert-and-complex-keys ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map = HashMap::new(); ++ /// assert_eq!(map.insert(37, "a"), None); ++ /// assert_eq!(map.is_empty(), false); ++ /// ++ /// map.insert(37, "b"); ++ /// assert_eq!(map.insert(37, "c"), Some("b")); ++ /// assert_eq!(map[&37], "c"); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn insert(&mut self, k: K, v: V) -> Option { ++ let hash = make_hash::(&self.hash_builder, &k); ++ let hasher = make_hasher::<_, V, S>(&self.hash_builder); ++ match self ++ .table ++ .find_or_find_insert_slot(hash, equivalent_key(&k), hasher) ++ { ++ Ok(bucket) => Some(mem::replace(unsafe { &mut bucket.as_mut().1 }, v)), ++ Err(slot) => { ++ unsafe { ++ self.table.insert_in_slot(hash, slot, (k, v)); ++ } ++ None ++ } ++ } ++ } ++ ++ /// Insert a key-value pair into the map without checking ++ /// if the key already exists in the map. ++ /// ++ /// Returns a reference to the key and value just inserted. ++ /// ++ /// This operation is safe if a key does not exist in the map. ++ /// ++ /// However, if a key exists in the map already, the behavior is unspecified: ++ /// this operation may panic, loop forever, or any following operation with the map ++ /// may panic, loop forever or return arbitrary result. ++ /// ++ /// That said, this operation (and following operations) are guaranteed to ++ /// not violate memory safety. ++ /// ++ /// This operation is faster than regular insert, because it does not perform ++ /// lookup before insertion. ++ /// ++ /// This operation is useful during initial population of the map. ++ /// For example, when constructing a map from another map, we know ++ /// that keys are unique. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map1 = HashMap::new(); ++ /// assert_eq!(map1.insert(1, "a"), None); ++ /// assert_eq!(map1.insert(2, "b"), None); ++ /// assert_eq!(map1.insert(3, "c"), None); ++ /// assert_eq!(map1.len(), 3); ++ /// ++ /// let mut map2 = HashMap::new(); ++ /// ++ /// for (key, value) in map1.into_iter() { ++ /// map2.insert_unique_unchecked(key, value); ++ /// } ++ /// ++ /// let (key, value) = map2.insert_unique_unchecked(4, "d"); ++ /// assert_eq!(key, &4); ++ /// assert_eq!(value, &mut "d"); ++ /// *value = "e"; ++ /// ++ /// assert_eq!(map2[&1], "a"); ++ /// assert_eq!(map2[&2], "b"); ++ /// assert_eq!(map2[&3], "c"); ++ /// assert_eq!(map2[&4], "e"); ++ /// assert_eq!(map2.len(), 4); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn insert_unique_unchecked(&mut self, k: K, v: V) -> (&K, &mut V) { ++ let hash = make_hash::(&self.hash_builder, &k); ++ let bucket = self ++ .table ++ .insert(hash, (k, v), make_hasher::<_, V, S>(&self.hash_builder)); ++ let (k_ref, v_ref) = unsafe { bucket.as_mut() }; ++ (k_ref, v_ref) ++ } ++ ++ /// Tries to insert a key-value pair into the map, and returns ++ /// a mutable reference to the value in the entry. ++ /// ++ /// # Errors ++ /// ++ /// If the map already had this key present, nothing is updated, and ++ /// an error containing the occupied entry and the value is returned. ++ /// ++ /// # Examples ++ /// ++ /// Basic usage: ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// use hashbrown::hash_map::OccupiedError; ++ /// ++ /// let mut map = HashMap::new(); ++ /// assert_eq!(map.try_insert(37, "a").unwrap(), &"a"); ++ /// ++ /// match map.try_insert(37, "b") { ++ /// Err(OccupiedError { entry, value }) => { ++ /// assert_eq!(entry.key(), &37); ++ /// assert_eq!(entry.get(), &"a"); ++ /// assert_eq!(value, "b"); ++ /// } ++ /// _ => panic!() ++ /// } ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn try_insert( ++ &mut self, ++ key: K, ++ value: V, ++ ) -> Result<&mut V, OccupiedError<'_, K, V, S, A>> { ++ match self.entry(key) { ++ Entry::Occupied(entry) => Err(OccupiedError { entry, value }), ++ Entry::Vacant(entry) => Ok(entry.insert(value)), ++ } ++ } ++ ++ /// Removes a key from the map, returning the value at the key if the key ++ /// was previously in the map. Keeps the allocated memory for reuse. ++ /// ++ /// The key may be any borrowed form of the map's key type, but ++ /// [`Hash`] and [`Eq`] on the borrowed form *must* match those for ++ /// the key type. ++ /// ++ /// [`Eq`]: https://doc.rust-lang.org/std/cmp/trait.Eq.html ++ /// [`Hash`]: https://doc.rust-lang.org/std/hash/trait.Hash.html ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map = HashMap::new(); ++ /// // The map is empty ++ /// assert!(map.is_empty() && map.capacity() == 0); ++ /// ++ /// map.insert(1, "a"); ++ /// ++ /// assert_eq!(map.remove(&1), Some("a")); ++ /// assert_eq!(map.remove(&1), None); ++ /// ++ /// // Now map holds none elements ++ /// assert!(map.is_empty()); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn remove(&mut self, k: &Q) -> Option ++ where ++ Q: Hash + Equivalent, ++ { ++ // Avoid `Option::map` because it bloats LLVM IR. ++ match self.remove_entry(k) { ++ Some((_, v)) => Some(v), ++ None => None, ++ } ++ } ++ ++ /// Removes a key from the map, returning the stored key and value if the ++ /// key was previously in the map. Keeps the allocated memory for reuse. ++ /// ++ /// The key may be any borrowed form of the map's key type, but ++ /// [`Hash`] and [`Eq`] on the borrowed form *must* match those for ++ /// the key type. ++ /// ++ /// [`Eq`]: https://doc.rust-lang.org/std/cmp/trait.Eq.html ++ /// [`Hash`]: https://doc.rust-lang.org/std/hash/trait.Hash.html ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map = HashMap::new(); ++ /// // The map is empty ++ /// assert!(map.is_empty() && map.capacity() == 0); ++ /// ++ /// map.insert(1, "a"); ++ /// ++ /// assert_eq!(map.remove_entry(&1), Some((1, "a"))); ++ /// assert_eq!(map.remove(&1), None); ++ /// ++ /// // Now map hold none elements ++ /// assert!(map.is_empty()); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn remove_entry(&mut self, k: &Q) -> Option<(K, V)> ++ where ++ Q: Hash + Equivalent, ++ { ++ let hash = make_hash::(&self.hash_builder, k); ++ self.table.remove_entry(hash, equivalent_key(k)) ++ } ++} ++ ++impl HashMap { ++ /// Creates a raw entry builder for the HashMap. ++ /// ++ /// Raw entries provide the lowest level of control for searching and ++ /// manipulating a map. They must be manually initialized with a hash and ++ /// then manually searched. After this, insertions into a vacant entry ++ /// still require an owned key to be provided. ++ /// ++ /// Raw entries are useful for such exotic situations as: ++ /// ++ /// * Hash memoization ++ /// * Deferring the creation of an owned key until it is known to be required ++ /// * Using a search key that doesn't work with the Borrow trait ++ /// * Using custom comparison logic without newtype wrappers ++ /// ++ /// Because raw entries provide much more low-level control, it's much easier ++ /// to put the HashMap into an inconsistent state which, while memory-safe, ++ /// will cause the map to produce seemingly random results. Higher-level and ++ /// more foolproof APIs like `entry` should be preferred when possible. ++ /// ++ /// In particular, the hash used to initialized the raw entry must still be ++ /// consistent with the hash of the key that is ultimately stored in the entry. ++ /// This is because implementations of HashMap may need to recompute hashes ++ /// when resizing, at which point only the keys are available. ++ /// ++ /// Raw entries give mutable access to the keys. This must not be used ++ /// to modify how the key would compare or hash, as the map will not re-evaluate ++ /// where the key should go, meaning the keys may become "lost" if their ++ /// location does not reflect their state. For instance, if you change a key ++ /// so that the map now contains keys which compare equal, search may start ++ /// acting erratically, with two keys randomly masking each other. Implementations ++ /// are free to assume this doesn't happen (within the limits of memory-safety). ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use core::hash::{BuildHasher, Hash}; ++ /// use hashbrown::hash_map::{HashMap, RawEntryMut}; ++ /// ++ /// let mut map = HashMap::new(); ++ /// map.extend([("a", 100), ("b", 200), ("c", 300)]); ++ /// ++ /// fn compute_hash(hash_builder: &S, key: &K) -> u64 { ++ /// use core::hash::Hasher; ++ /// let mut state = hash_builder.build_hasher(); ++ /// key.hash(&mut state); ++ /// state.finish() ++ /// } ++ /// ++ /// // Existing key (insert and update) ++ /// match map.raw_entry_mut().from_key(&"a") { ++ /// RawEntryMut::Vacant(_) => unreachable!(), ++ /// RawEntryMut::Occupied(mut view) => { ++ /// assert_eq!(view.get(), &100); ++ /// let v = view.get_mut(); ++ /// let new_v = (*v) * 10; ++ /// *v = new_v; ++ /// assert_eq!(view.insert(1111), 1000); ++ /// } ++ /// } ++ /// ++ /// assert_eq!(map[&"a"], 1111); ++ /// assert_eq!(map.len(), 3); ++ /// ++ /// // Existing key (take) ++ /// let hash = compute_hash(map.hasher(), &"c"); ++ /// match map.raw_entry_mut().from_key_hashed_nocheck(hash, &"c") { ++ /// RawEntryMut::Vacant(_) => unreachable!(), ++ /// RawEntryMut::Occupied(view) => { ++ /// assert_eq!(view.remove_entry(), ("c", 300)); ++ /// } ++ /// } ++ /// assert_eq!(map.raw_entry().from_key(&"c"), None); ++ /// assert_eq!(map.len(), 2); ++ /// ++ /// // Nonexistent key (insert and update) ++ /// let key = "d"; ++ /// let hash = compute_hash(map.hasher(), &key); ++ /// match map.raw_entry_mut().from_hash(hash, |q| *q == key) { ++ /// RawEntryMut::Occupied(_) => unreachable!(), ++ /// RawEntryMut::Vacant(view) => { ++ /// let (k, value) = view.insert("d", 4000); ++ /// assert_eq!((*k, *value), ("d", 4000)); ++ /// *value = 40000; ++ /// } ++ /// } ++ /// assert_eq!(map[&"d"], 40000); ++ /// assert_eq!(map.len(), 3); ++ /// ++ /// match map.raw_entry_mut().from_hash(hash, |q| *q == key) { ++ /// RawEntryMut::Vacant(_) => unreachable!(), ++ /// RawEntryMut::Occupied(view) => { ++ /// assert_eq!(view.remove_entry(), ("d", 40000)); ++ /// } ++ /// } ++ /// assert_eq!(map.get(&"d"), None); ++ /// assert_eq!(map.len(), 2); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn raw_entry_mut(&mut self) -> RawEntryBuilderMut<'_, K, V, S, A> { ++ RawEntryBuilderMut { map: self } ++ } ++ ++ /// Creates a raw immutable entry builder for the HashMap. ++ /// ++ /// Raw entries provide the lowest level of control for searching and ++ /// manipulating a map. They must be manually initialized with a hash and ++ /// then manually searched. ++ /// ++ /// This is useful for ++ /// * Hash memoization ++ /// * Using a search key that doesn't work with the Borrow trait ++ /// * Using custom comparison logic without newtype wrappers ++ /// ++ /// Unless you are in such a situation, higher-level and more foolproof APIs like ++ /// `get` should be preferred. ++ /// ++ /// Immutable raw entries have very limited use; you might instead want `raw_entry_mut`. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use core::hash::{BuildHasher, Hash}; ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map = HashMap::new(); ++ /// map.extend([("a", 100), ("b", 200), ("c", 300)]); ++ /// ++ /// fn compute_hash(hash_builder: &S, key: &K) -> u64 { ++ /// use core::hash::Hasher; ++ /// let mut state = hash_builder.build_hasher(); ++ /// key.hash(&mut state); ++ /// state.finish() ++ /// } ++ /// ++ /// for k in ["a", "b", "c", "d", "e", "f"] { ++ /// let hash = compute_hash(map.hasher(), k); ++ /// let v = map.get(&k).cloned(); ++ /// let kv = v.as_ref().map(|v| (&k, v)); ++ /// ++ /// println!("Key: {} and value: {:?}", k, v); ++ /// ++ /// assert_eq!(map.raw_entry().from_key(&k), kv); ++ /// assert_eq!(map.raw_entry().from_hash(hash, |q| *q == k), kv); ++ /// assert_eq!(map.raw_entry().from_key_hashed_nocheck(hash, &k), kv); ++ /// } ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn raw_entry(&self) -> RawEntryBuilder<'_, K, V, S, A> { ++ RawEntryBuilder { map: self } ++ } ++ ++ /// Returns a reference to the [`RawTable`] used underneath [`HashMap`]. ++ /// This function is only available if the `raw` feature of the crate is enabled. ++ /// ++ /// See [`raw_table_mut`] for more. ++ /// ++ /// [`raw_table_mut`]: Self::raw_table_mut ++ #[cfg(feature = "raw")] ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn raw_table(&self) -> &RawTable<(K, V), A> { ++ &self.table ++ } ++ ++ /// Returns a mutable reference to the [`RawTable`] used underneath [`HashMap`]. ++ /// This function is only available if the `raw` feature of the crate is enabled. ++ /// ++ /// # Note ++ /// ++ /// Calling this function is safe, but using the raw hash table API may require ++ /// unsafe functions or blocks. ++ /// ++ /// `RawTable` API gives the lowest level of control under the map that can be useful ++ /// for extending the HashMap's API, but may lead to *[undefined behavior]*. ++ /// ++ /// [`HashMap`]: struct.HashMap.html ++ /// [`RawTable`]: crate::raw::RawTable ++ /// [undefined behavior]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use core::hash::{BuildHasher, Hash}; ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map = HashMap::new(); ++ /// map.extend([("a", 10), ("b", 20), ("c", 30)]); ++ /// assert_eq!(map.len(), 3); ++ /// ++ /// // Let's imagine that we have a value and a hash of the key, but not the key itself. ++ /// // However, if you want to remove the value from the map by hash and value, and you ++ /// // know exactly that the value is unique, then you can create a function like this: ++ /// fn remove_by_hash( ++ /// map: &mut HashMap, ++ /// hash: u64, ++ /// is_match: F, ++ /// ) -> Option<(K, V)> ++ /// where ++ /// F: Fn(&(K, V)) -> bool, ++ /// { ++ /// let raw_table = map.raw_table_mut(); ++ /// match raw_table.find(hash, is_match) { ++ /// Some(bucket) => Some(unsafe { raw_table.remove(bucket).0 }), ++ /// None => None, ++ /// } ++ /// } ++ /// ++ /// fn compute_hash(hash_builder: &S, key: &K) -> u64 { ++ /// use core::hash::Hasher; ++ /// let mut state = hash_builder.build_hasher(); ++ /// key.hash(&mut state); ++ /// state.finish() ++ /// } ++ /// ++ /// let hash = compute_hash(map.hasher(), "a"); ++ /// assert_eq!(remove_by_hash(&mut map, hash, |(_, v)| *v == 10), Some(("a", 10))); ++ /// assert_eq!(map.get(&"a"), None); ++ /// assert_eq!(map.len(), 2); ++ /// ``` ++ #[cfg(feature = "raw")] ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn raw_table_mut(&mut self) -> &mut RawTable<(K, V), A> { ++ &mut self.table ++ } ++} ++ ++impl PartialEq for HashMap ++where ++ K: Eq + Hash, ++ V: PartialEq, ++ S: BuildHasher, ++ A: Allocator, ++{ ++ fn eq(&self, other: &Self) -> bool { ++ if self.len() != other.len() { ++ return false; ++ } ++ ++ self.iter() ++ .all(|(key, value)| other.get(key).map_or(false, |v| *value == *v)) ++ } ++} ++ ++impl Eq for HashMap ++where ++ K: Eq + Hash, ++ V: Eq, ++ S: BuildHasher, ++ A: Allocator, ++{ ++} ++ ++impl Debug for HashMap ++where ++ K: Debug, ++ V: Debug, ++ A: Allocator, ++{ ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_map().entries(self.iter()).finish() ++ } ++} ++ ++impl Default for HashMap ++where ++ S: Default, ++ A: Default + Allocator, ++{ ++ /// Creates an empty `HashMap`, with the `Default` value for the hasher and allocator. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// use std::collections::hash_map::RandomState; ++ /// ++ /// // You can specify all types of HashMap, including hasher and allocator. ++ /// // Created map is empty and don't allocate memory ++ /// let map: HashMap = Default::default(); ++ /// assert_eq!(map.capacity(), 0); ++ /// let map: HashMap = HashMap::default(); ++ /// assert_eq!(map.capacity(), 0); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn default() -> Self { ++ Self::with_hasher_in(Default::default(), Default::default()) ++ } ++} ++ ++impl Index<&Q> for HashMap ++where ++ K: Eq + Hash, ++ Q: Hash + Equivalent, ++ S: BuildHasher, ++ A: Allocator, ++{ ++ type Output = V; ++ ++ /// Returns a reference to the value corresponding to the supplied key. ++ /// ++ /// # Panics ++ /// ++ /// Panics if the key is not present in the `HashMap`. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let map: HashMap<_, _> = [("a", "One"), ("b", "Two")].into(); ++ /// ++ /// assert_eq!(map[&"a"], "One"); ++ /// assert_eq!(map[&"b"], "Two"); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn index(&self, key: &Q) -> &V { ++ self.get(key).expect("no entry found for key") ++ } ++} ++ ++// The default hasher is used to match the std implementation signature ++#[cfg(feature = "ahash")] ++impl From<[(K, V); N]> for HashMap ++where ++ K: Eq + Hash, ++ A: Default + Allocator, ++{ ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let map1 = HashMap::from([(1, 2), (3, 4)]); ++ /// let map2: HashMap<_, _> = [(1, 2), (3, 4)].into(); ++ /// assert_eq!(map1, map2); ++ /// ``` ++ fn from(arr: [(K, V); N]) -> Self { ++ arr.into_iter().collect() ++ } ++} ++ ++/// An iterator over the entries of a `HashMap` in arbitrary order. ++/// The iterator element type is `(&'a K, &'a V)`. ++/// ++/// This `struct` is created by the [`iter`] method on [`HashMap`]. See its ++/// documentation for more. ++/// ++/// [`iter`]: struct.HashMap.html#method.iter ++/// [`HashMap`]: struct.HashMap.html ++/// ++/// # Examples ++/// ++/// ``` ++/// use hashbrown::HashMap; ++/// ++/// let map: HashMap<_, _> = [(1, "a"), (2, "b"), (3, "c")].into(); ++/// ++/// let mut iter = map.iter(); ++/// let mut vec = vec![iter.next(), iter.next(), iter.next()]; ++/// ++/// // The `Iter` iterator produces items in arbitrary order, so the ++/// // items must be sorted to test them against a sorted array. ++/// vec.sort_unstable(); ++/// assert_eq!(vec, [Some((&1, &"a")), Some((&2, &"b")), Some((&3, &"c"))]); ++/// ++/// // It is fused iterator ++/// assert_eq!(iter.next(), None); ++/// assert_eq!(iter.next(), None); ++/// ``` ++pub struct Iter<'a, K, V> { ++ inner: RawIter<(K, V)>, ++ marker: PhantomData<(&'a K, &'a V)>, ++} ++ ++// FIXME(#26925) Remove in favor of `#[derive(Clone)]` ++impl Clone for Iter<'_, K, V> { ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn clone(&self) -> Self { ++ Iter { ++ inner: self.inner.clone(), ++ marker: PhantomData, ++ } ++ } ++} ++ ++impl fmt::Debug for Iter<'_, K, V> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_list().entries(self.clone()).finish() ++ } ++} ++ ++/// A mutable iterator over the entries of a `HashMap` in arbitrary order. ++/// The iterator element type is `(&'a K, &'a mut V)`. ++/// ++/// This `struct` is created by the [`iter_mut`] method on [`HashMap`]. See its ++/// documentation for more. ++/// ++/// [`iter_mut`]: struct.HashMap.html#method.iter_mut ++/// [`HashMap`]: struct.HashMap.html ++/// ++/// # Examples ++/// ++/// ``` ++/// use hashbrown::HashMap; ++/// ++/// let mut map: HashMap<_, _> = [(1, "One".to_owned()), (2, "Two".into())].into(); ++/// ++/// let mut iter = map.iter_mut(); ++/// iter.next().map(|(_, v)| v.push_str(" Mississippi")); ++/// iter.next().map(|(_, v)| v.push_str(" Mississippi")); ++/// ++/// // It is fused iterator ++/// assert_eq!(iter.next(), None); ++/// assert_eq!(iter.next(), None); ++/// ++/// assert_eq!(map.get(&1).unwrap(), &"One Mississippi".to_owned()); ++/// assert_eq!(map.get(&2).unwrap(), &"Two Mississippi".to_owned()); ++/// ``` ++pub struct IterMut<'a, K, V> { ++ inner: RawIter<(K, V)>, ++ // To ensure invariance with respect to V ++ marker: PhantomData<(&'a K, &'a mut V)>, ++} ++ ++// We override the default Send impl which has K: Sync instead of K: Send. Both ++// are correct, but this one is more general since it allows keys which ++// implement Send but not Sync. ++unsafe impl Send for IterMut<'_, K, V> {} ++ ++impl IterMut<'_, K, V> { ++ /// Returns a iterator of references over the remaining items. ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub(super) fn iter(&self) -> Iter<'_, K, V> { ++ Iter { ++ inner: self.inner.clone(), ++ marker: PhantomData, ++ } ++ } ++} ++ ++/// An owning iterator over the entries of a `HashMap` in arbitrary order. ++/// The iterator element type is `(K, V)`. ++/// ++/// This `struct` is created by the [`into_iter`] method on [`HashMap`] ++/// (provided by the [`IntoIterator`] trait). See its documentation for more. ++/// The map cannot be used after calling that method. ++/// ++/// [`into_iter`]: struct.HashMap.html#method.into_iter ++/// [`HashMap`]: struct.HashMap.html ++/// [`IntoIterator`]: https://doc.rust-lang.org/core/iter/trait.IntoIterator.html ++/// ++/// # Examples ++/// ++/// ``` ++/// use hashbrown::HashMap; ++/// ++/// let map: HashMap<_, _> = [(1, "a"), (2, "b"), (3, "c")].into(); ++/// ++/// let mut iter = map.into_iter(); ++/// let mut vec = vec![iter.next(), iter.next(), iter.next()]; ++/// ++/// // The `IntoIter` iterator produces items in arbitrary order, so the ++/// // items must be sorted to test them against a sorted array. ++/// vec.sort_unstable(); ++/// assert_eq!(vec, [Some((1, "a")), Some((2, "b")), Some((3, "c"))]); ++/// ++/// // It is fused iterator ++/// assert_eq!(iter.next(), None); ++/// assert_eq!(iter.next(), None); ++/// ``` ++pub struct IntoIter { ++ inner: RawIntoIter<(K, V), A>, ++} ++ ++impl IntoIter { ++ /// Returns a iterator of references over the remaining items. ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub(super) fn iter(&self) -> Iter<'_, K, V> { ++ Iter { ++ inner: self.inner.iter(), ++ marker: PhantomData, ++ } ++ } ++} ++ ++/// An owning iterator over the keys of a `HashMap` in arbitrary order. ++/// The iterator element type is `K`. ++/// ++/// This `struct` is created by the [`into_keys`] method on [`HashMap`]. ++/// See its documentation for more. ++/// The map cannot be used after calling that method. ++/// ++/// [`into_keys`]: struct.HashMap.html#method.into_keys ++/// [`HashMap`]: struct.HashMap.html ++/// ++/// # Examples ++/// ++/// ``` ++/// use hashbrown::HashMap; ++/// ++/// let map: HashMap<_, _> = [(1, "a"), (2, "b"), (3, "c")].into(); ++/// ++/// let mut keys = map.into_keys(); ++/// let mut vec = vec![keys.next(), keys.next(), keys.next()]; ++/// ++/// // The `IntoKeys` iterator produces keys in arbitrary order, so the ++/// // keys must be sorted to test them against a sorted array. ++/// vec.sort_unstable(); ++/// assert_eq!(vec, [Some(1), Some(2), Some(3)]); ++/// ++/// // It is fused iterator ++/// assert_eq!(keys.next(), None); ++/// assert_eq!(keys.next(), None); ++/// ``` ++pub struct IntoKeys { ++ inner: IntoIter, ++} ++ ++impl Iterator for IntoKeys { ++ type Item = K; ++ ++ #[inline] ++ fn next(&mut self) -> Option { ++ self.inner.next().map(|(k, _)| k) ++ } ++ #[inline] ++ fn size_hint(&self) -> (usize, Option) { ++ self.inner.size_hint() ++ } ++ #[inline] ++ fn fold(self, init: B, mut f: F) -> B ++ where ++ Self: Sized, ++ F: FnMut(B, Self::Item) -> B, ++ { ++ self.inner.fold(init, |acc, (k, _)| f(acc, k)) ++ } ++} ++ ++impl ExactSizeIterator for IntoKeys { ++ #[inline] ++ fn len(&self) -> usize { ++ self.inner.len() ++ } ++} ++ ++impl FusedIterator for IntoKeys {} ++ ++impl fmt::Debug for IntoKeys { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_list() ++ .entries(self.inner.iter().map(|(k, _)| k)) ++ .finish() ++ } ++} ++ ++/// An owning iterator over the values of a `HashMap` in arbitrary order. ++/// The iterator element type is `V`. ++/// ++/// This `struct` is created by the [`into_values`] method on [`HashMap`]. ++/// See its documentation for more. The map cannot be used after calling that method. ++/// ++/// [`into_values`]: struct.HashMap.html#method.into_values ++/// [`HashMap`]: struct.HashMap.html ++/// ++/// # Examples ++/// ++/// ``` ++/// use hashbrown::HashMap; ++/// ++/// let map: HashMap<_, _> = [(1, "a"), (2, "b"), (3, "c")].into(); ++/// ++/// let mut values = map.into_values(); ++/// let mut vec = vec![values.next(), values.next(), values.next()]; ++/// ++/// // The `IntoValues` iterator produces values in arbitrary order, so ++/// // the values must be sorted to test them against a sorted array. ++/// vec.sort_unstable(); ++/// assert_eq!(vec, [Some("a"), Some("b"), Some("c")]); ++/// ++/// // It is fused iterator ++/// assert_eq!(values.next(), None); ++/// assert_eq!(values.next(), None); ++/// ``` ++pub struct IntoValues { ++ inner: IntoIter, ++} ++ ++impl Iterator for IntoValues { ++ type Item = V; ++ ++ #[inline] ++ fn next(&mut self) -> Option { ++ self.inner.next().map(|(_, v)| v) ++ } ++ #[inline] ++ fn size_hint(&self) -> (usize, Option) { ++ self.inner.size_hint() ++ } ++ #[inline] ++ fn fold(self, init: B, mut f: F) -> B ++ where ++ Self: Sized, ++ F: FnMut(B, Self::Item) -> B, ++ { ++ self.inner.fold(init, |acc, (_, v)| f(acc, v)) ++ } ++} ++ ++impl ExactSizeIterator for IntoValues { ++ #[inline] ++ fn len(&self) -> usize { ++ self.inner.len() ++ } ++} ++ ++impl FusedIterator for IntoValues {} ++ ++impl fmt::Debug for IntoValues { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_list() ++ .entries(self.inner.iter().map(|(_, v)| v)) ++ .finish() ++ } ++} ++ ++/// An iterator over the keys of a `HashMap` in arbitrary order. ++/// The iterator element type is `&'a K`. ++/// ++/// This `struct` is created by the [`keys`] method on [`HashMap`]. See its ++/// documentation for more. ++/// ++/// [`keys`]: struct.HashMap.html#method.keys ++/// [`HashMap`]: struct.HashMap.html ++/// ++/// # Examples ++/// ++/// ``` ++/// use hashbrown::HashMap; ++/// ++/// let map: HashMap<_, _> = [(1, "a"), (2, "b"), (3, "c")].into(); ++/// ++/// let mut keys = map.keys(); ++/// let mut vec = vec![keys.next(), keys.next(), keys.next()]; ++/// ++/// // The `Keys` iterator produces keys in arbitrary order, so the ++/// // keys must be sorted to test them against a sorted array. ++/// vec.sort_unstable(); ++/// assert_eq!(vec, [Some(&1), Some(&2), Some(&3)]); ++/// ++/// // It is fused iterator ++/// assert_eq!(keys.next(), None); ++/// assert_eq!(keys.next(), None); ++/// ``` ++pub struct Keys<'a, K, V> { ++ inner: Iter<'a, K, V>, ++} ++ ++// FIXME(#26925) Remove in favor of `#[derive(Clone)]` ++impl Clone for Keys<'_, K, V> { ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn clone(&self) -> Self { ++ Keys { ++ inner: self.inner.clone(), ++ } ++ } ++} ++ ++impl fmt::Debug for Keys<'_, K, V> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_list().entries(self.clone()).finish() ++ } ++} ++ ++/// An iterator over the values of a `HashMap` in arbitrary order. ++/// The iterator element type is `&'a V`. ++/// ++/// This `struct` is created by the [`values`] method on [`HashMap`]. See its ++/// documentation for more. ++/// ++/// [`values`]: struct.HashMap.html#method.values ++/// [`HashMap`]: struct.HashMap.html ++/// ++/// # Examples ++/// ++/// ``` ++/// use hashbrown::HashMap; ++/// ++/// let map: HashMap<_, _> = [(1, "a"), (2, "b"), (3, "c")].into(); ++/// ++/// let mut values = map.values(); ++/// let mut vec = vec![values.next(), values.next(), values.next()]; ++/// ++/// // The `Values` iterator produces values in arbitrary order, so the ++/// // values must be sorted to test them against a sorted array. ++/// vec.sort_unstable(); ++/// assert_eq!(vec, [Some(&"a"), Some(&"b"), Some(&"c")]); ++/// ++/// // It is fused iterator ++/// assert_eq!(values.next(), None); ++/// assert_eq!(values.next(), None); ++/// ``` ++pub struct Values<'a, K, V> { ++ inner: Iter<'a, K, V>, ++} ++ ++// FIXME(#26925) Remove in favor of `#[derive(Clone)]` ++impl Clone for Values<'_, K, V> { ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn clone(&self) -> Self { ++ Values { ++ inner: self.inner.clone(), ++ } ++ } ++} ++ ++impl fmt::Debug for Values<'_, K, V> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_list().entries(self.clone()).finish() ++ } ++} ++ ++/// A draining iterator over the entries of a `HashMap` in arbitrary ++/// order. The iterator element type is `(K, V)`. ++/// ++/// This `struct` is created by the [`drain`] method on [`HashMap`]. See its ++/// documentation for more. ++/// ++/// [`drain`]: struct.HashMap.html#method.drain ++/// [`HashMap`]: struct.HashMap.html ++/// ++/// # Examples ++/// ++/// ``` ++/// use hashbrown::HashMap; ++/// ++/// let mut map: HashMap<_, _> = [(1, "a"), (2, "b"), (3, "c")].into(); ++/// ++/// let mut drain_iter = map.drain(); ++/// let mut vec = vec![drain_iter.next(), drain_iter.next(), drain_iter.next()]; ++/// ++/// // The `Drain` iterator produces items in arbitrary order, so the ++/// // items must be sorted to test them against a sorted array. ++/// vec.sort_unstable(); ++/// assert_eq!(vec, [Some((1, "a")), Some((2, "b")), Some((3, "c"))]); ++/// ++/// // It is fused iterator ++/// assert_eq!(drain_iter.next(), None); ++/// assert_eq!(drain_iter.next(), None); ++/// ``` ++pub struct Drain<'a, K, V, A: Allocator = Global> { ++ inner: RawDrain<'a, (K, V), A>, ++} ++ ++impl Drain<'_, K, V, A> { ++ /// Returns a iterator of references over the remaining items. ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub(super) fn iter(&self) -> Iter<'_, K, V> { ++ Iter { ++ inner: self.inner.iter(), ++ marker: PhantomData, ++ } ++ } ++} ++ ++/// A draining iterator over entries of a `HashMap` which don't satisfy the predicate ++/// `f(&k, &mut v)` in arbitrary order. The iterator element type is `(K, V)`. ++/// ++/// This `struct` is created by the [`extract_if`] method on [`HashMap`]. See its ++/// documentation for more. ++/// ++/// [`extract_if`]: struct.HashMap.html#method.extract_if ++/// [`HashMap`]: struct.HashMap.html ++/// ++/// # Examples ++/// ++/// ``` ++/// use hashbrown::HashMap; ++/// ++/// let mut map: HashMap = [(1, "a"), (2, "b"), (3, "c")].into(); ++/// ++/// let mut extract_if = map.extract_if(|k, _v| k % 2 != 0); ++/// let mut vec = vec![extract_if.next(), extract_if.next()]; ++/// ++/// // The `ExtractIf` iterator produces items in arbitrary order, so the ++/// // items must be sorted to test them against a sorted array. ++/// vec.sort_unstable(); ++/// assert_eq!(vec, [Some((1, "a")),Some((3, "c"))]); ++/// ++/// // It is fused iterator ++/// assert_eq!(extract_if.next(), None); ++/// assert_eq!(extract_if.next(), None); ++/// drop(extract_if); ++/// ++/// assert_eq!(map.len(), 1); ++/// ``` ++#[must_use = "Iterators are lazy unless consumed"] ++pub struct ExtractIf<'a, K, V, F, A: Allocator = Global> ++where ++ F: FnMut(&K, &mut V) -> bool, ++{ ++ f: F, ++ inner: RawExtractIf<'a, (K, V), A>, ++} ++ ++impl Iterator for ExtractIf<'_, K, V, F, A> ++where ++ F: FnMut(&K, &mut V) -> bool, ++ A: Allocator, ++{ ++ type Item = (K, V); ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn next(&mut self) -> Option { ++ self.inner.next(|&mut (ref k, ref mut v)| (self.f)(k, v)) ++ } ++ ++ #[inline] ++ fn size_hint(&self) -> (usize, Option) { ++ (0, self.inner.iter.size_hint().1) ++ } ++} ++ ++impl FusedIterator for ExtractIf<'_, K, V, F> where F: FnMut(&K, &mut V) -> bool {} ++ ++/// A mutable iterator over the values of a `HashMap` in arbitrary order. ++/// The iterator element type is `&'a mut V`. ++/// ++/// This `struct` is created by the [`values_mut`] method on [`HashMap`]. See its ++/// documentation for more. ++/// ++/// [`values_mut`]: struct.HashMap.html#method.values_mut ++/// [`HashMap`]: struct.HashMap.html ++/// ++/// # Examples ++/// ++/// ``` ++/// use hashbrown::HashMap; ++/// ++/// let mut map: HashMap<_, _> = [(1, "One".to_owned()), (2, "Two".into())].into(); ++/// ++/// let mut values = map.values_mut(); ++/// values.next().map(|v| v.push_str(" Mississippi")); ++/// values.next().map(|v| v.push_str(" Mississippi")); ++/// ++/// // It is fused iterator ++/// assert_eq!(values.next(), None); ++/// assert_eq!(values.next(), None); ++/// ++/// assert_eq!(map.get(&1).unwrap(), &"One Mississippi".to_owned()); ++/// assert_eq!(map.get(&2).unwrap(), &"Two Mississippi".to_owned()); ++/// ``` ++pub struct ValuesMut<'a, K, V> { ++ inner: IterMut<'a, K, V>, ++} ++ ++/// A builder for computing where in a [`HashMap`] a key-value pair would be stored. ++/// ++/// See the [`HashMap::raw_entry_mut`] docs for usage examples. ++/// ++/// [`HashMap::raw_entry_mut`]: struct.HashMap.html#method.raw_entry_mut ++/// ++/// # Examples ++/// ++/// ``` ++/// use hashbrown::hash_map::{RawEntryBuilderMut, RawEntryMut::Vacant, RawEntryMut::Occupied}; ++/// use hashbrown::HashMap; ++/// use core::hash::{BuildHasher, Hash}; ++/// ++/// let mut map = HashMap::new(); ++/// map.extend([(1, 11), (2, 12), (3, 13), (4, 14), (5, 15), (6, 16)]); ++/// assert_eq!(map.len(), 6); ++/// ++/// fn compute_hash(hash_builder: &S, key: &K) -> u64 { ++/// use core::hash::Hasher; ++/// let mut state = hash_builder.build_hasher(); ++/// key.hash(&mut state); ++/// state.finish() ++/// } ++/// ++/// let builder: RawEntryBuilderMut<_, _, _> = map.raw_entry_mut(); ++/// ++/// // Existing key ++/// match builder.from_key(&6) { ++/// Vacant(_) => unreachable!(), ++/// Occupied(view) => assert_eq!(view.get(), &16), ++/// } ++/// ++/// for key in 0..12 { ++/// let hash = compute_hash(map.hasher(), &key); ++/// let value = map.get(&key).cloned(); ++/// let key_value = value.as_ref().map(|v| (&key, v)); ++/// ++/// println!("Key: {} and value: {:?}", key, value); ++/// ++/// match map.raw_entry_mut().from_key(&key) { ++/// Occupied(mut o) => assert_eq!(Some(o.get_key_value()), key_value), ++/// Vacant(_) => assert_eq!(value, None), ++/// } ++/// match map.raw_entry_mut().from_key_hashed_nocheck(hash, &key) { ++/// Occupied(mut o) => assert_eq!(Some(o.get_key_value()), key_value), ++/// Vacant(_) => assert_eq!(value, None), ++/// } ++/// match map.raw_entry_mut().from_hash(hash, |q| *q == key) { ++/// Occupied(mut o) => assert_eq!(Some(o.get_key_value()), key_value), ++/// Vacant(_) => assert_eq!(value, None), ++/// } ++/// } ++/// ++/// assert_eq!(map.len(), 6); ++/// ``` ++pub struct RawEntryBuilderMut<'a, K, V, S, A: Allocator = Global> { ++ map: &'a mut HashMap, ++} ++ ++/// A view into a single entry in a map, which may either be vacant or occupied. ++/// ++/// This is a lower-level version of [`Entry`]. ++/// ++/// This `enum` is constructed through the [`raw_entry_mut`] method on [`HashMap`], ++/// then calling one of the methods of that [`RawEntryBuilderMut`]. ++/// ++/// [`HashMap`]: struct.HashMap.html ++/// [`Entry`]: enum.Entry.html ++/// [`raw_entry_mut`]: struct.HashMap.html#method.raw_entry_mut ++/// [`RawEntryBuilderMut`]: struct.RawEntryBuilderMut.html ++/// ++/// # Examples ++/// ++/// ``` ++/// use core::hash::{BuildHasher, Hash}; ++/// use hashbrown::hash_map::{HashMap, RawEntryMut, RawOccupiedEntryMut}; ++/// ++/// let mut map = HashMap::new(); ++/// map.extend([('a', 1), ('b', 2), ('c', 3)]); ++/// assert_eq!(map.len(), 3); ++/// ++/// fn compute_hash(hash_builder: &S, key: &K) -> u64 { ++/// use core::hash::Hasher; ++/// let mut state = hash_builder.build_hasher(); ++/// key.hash(&mut state); ++/// state.finish() ++/// } ++/// ++/// // Existing key (insert) ++/// let raw: RawEntryMut<_, _, _> = map.raw_entry_mut().from_key(&'a'); ++/// let _raw_o: RawOccupiedEntryMut<_, _, _> = raw.insert('a', 10); ++/// assert_eq!(map.len(), 3); ++/// ++/// // Nonexistent key (insert) ++/// map.raw_entry_mut().from_key(&'d').insert('d', 40); ++/// assert_eq!(map.len(), 4); ++/// ++/// // Existing key (or_insert) ++/// let hash = compute_hash(map.hasher(), &'b'); ++/// let kv = map ++/// .raw_entry_mut() ++/// .from_key_hashed_nocheck(hash, &'b') ++/// .or_insert('b', 20); ++/// assert_eq!(kv, (&mut 'b', &mut 2)); ++/// *kv.1 = 20; ++/// assert_eq!(map.len(), 4); ++/// ++/// // Nonexistent key (or_insert) ++/// let hash = compute_hash(map.hasher(), &'e'); ++/// let kv = map ++/// .raw_entry_mut() ++/// .from_key_hashed_nocheck(hash, &'e') ++/// .or_insert('e', 50); ++/// assert_eq!(kv, (&mut 'e', &mut 50)); ++/// assert_eq!(map.len(), 5); ++/// ++/// // Existing key (or_insert_with) ++/// let hash = compute_hash(map.hasher(), &'c'); ++/// let kv = map ++/// .raw_entry_mut() ++/// .from_hash(hash, |q| q == &'c') ++/// .or_insert_with(|| ('c', 30)); ++/// assert_eq!(kv, (&mut 'c', &mut 3)); ++/// *kv.1 = 30; ++/// assert_eq!(map.len(), 5); ++/// ++/// // Nonexistent key (or_insert_with) ++/// let hash = compute_hash(map.hasher(), &'f'); ++/// let kv = map ++/// .raw_entry_mut() ++/// .from_hash(hash, |q| q == &'f') ++/// .or_insert_with(|| ('f', 60)); ++/// assert_eq!(kv, (&mut 'f', &mut 60)); ++/// assert_eq!(map.len(), 6); ++/// ++/// println!("Our HashMap: {:?}", map); ++/// ++/// let mut vec: Vec<_> = map.iter().map(|(&k, &v)| (k, v)).collect(); ++/// // The `Iter` iterator produces items in arbitrary order, so the ++/// // items must be sorted to test them against a sorted array. ++/// vec.sort_unstable(); ++/// assert_eq!(vec, [('a', 10), ('b', 20), ('c', 30), ('d', 40), ('e', 50), ('f', 60)]); ++/// ``` ++pub enum RawEntryMut<'a, K, V, S, A: Allocator = Global> { ++ /// An occupied entry. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::{hash_map::RawEntryMut, HashMap}; ++ /// let mut map: HashMap<_, _> = [("a", 100), ("b", 200)].into(); ++ /// ++ /// match map.raw_entry_mut().from_key(&"a") { ++ /// RawEntryMut::Vacant(_) => unreachable!(), ++ /// RawEntryMut::Occupied(_) => { } ++ /// } ++ /// ``` ++ Occupied(RawOccupiedEntryMut<'a, K, V, S, A>), ++ /// A vacant entry. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::{hash_map::RawEntryMut, HashMap}; ++ /// let mut map: HashMap<&str, i32> = HashMap::new(); ++ /// ++ /// match map.raw_entry_mut().from_key("a") { ++ /// RawEntryMut::Occupied(_) => unreachable!(), ++ /// RawEntryMut::Vacant(_) => { } ++ /// } ++ /// ``` ++ Vacant(RawVacantEntryMut<'a, K, V, S, A>), ++} ++ ++/// A view into an occupied entry in a `HashMap`. ++/// It is part of the [`RawEntryMut`] enum. ++/// ++/// [`RawEntryMut`]: enum.RawEntryMut.html ++/// ++/// # Examples ++/// ++/// ``` ++/// use core::hash::{BuildHasher, Hash}; ++/// use hashbrown::hash_map::{HashMap, RawEntryMut, RawOccupiedEntryMut}; ++/// ++/// let mut map = HashMap::new(); ++/// map.extend([("a", 10), ("b", 20), ("c", 30)]); ++/// ++/// fn compute_hash(hash_builder: &S, key: &K) -> u64 { ++/// use core::hash::Hasher; ++/// let mut state = hash_builder.build_hasher(); ++/// key.hash(&mut state); ++/// state.finish() ++/// } ++/// ++/// let _raw_o: RawOccupiedEntryMut<_, _, _> = map.raw_entry_mut().from_key(&"a").insert("a", 100); ++/// assert_eq!(map.len(), 3); ++/// ++/// // Existing key (insert and update) ++/// match map.raw_entry_mut().from_key(&"a") { ++/// RawEntryMut::Vacant(_) => unreachable!(), ++/// RawEntryMut::Occupied(mut view) => { ++/// assert_eq!(view.get(), &100); ++/// let v = view.get_mut(); ++/// let new_v = (*v) * 10; ++/// *v = new_v; ++/// assert_eq!(view.insert(1111), 1000); ++/// } ++/// } ++/// ++/// assert_eq!(map[&"a"], 1111); ++/// assert_eq!(map.len(), 3); ++/// ++/// // Existing key (take) ++/// let hash = compute_hash(map.hasher(), &"c"); ++/// match map.raw_entry_mut().from_key_hashed_nocheck(hash, &"c") { ++/// RawEntryMut::Vacant(_) => unreachable!(), ++/// RawEntryMut::Occupied(view) => { ++/// assert_eq!(view.remove_entry(), ("c", 30)); ++/// } ++/// } ++/// assert_eq!(map.raw_entry().from_key(&"c"), None); ++/// assert_eq!(map.len(), 2); ++/// ++/// let hash = compute_hash(map.hasher(), &"b"); ++/// match map.raw_entry_mut().from_hash(hash, |q| *q == "b") { ++/// RawEntryMut::Vacant(_) => unreachable!(), ++/// RawEntryMut::Occupied(view) => { ++/// assert_eq!(view.remove_entry(), ("b", 20)); ++/// } ++/// } ++/// assert_eq!(map.get(&"b"), None); ++/// assert_eq!(map.len(), 1); ++/// ``` ++pub struct RawOccupiedEntryMut<'a, K, V, S, A: Allocator = Global> { ++ elem: Bucket<(K, V)>, ++ table: &'a mut RawTable<(K, V), A>, ++ hash_builder: &'a S, ++} ++ ++unsafe impl Send for RawOccupiedEntryMut<'_, K, V, S, A> ++where ++ K: Send, ++ V: Send, ++ S: Send, ++ A: Send + Allocator, ++{ ++} ++unsafe impl Sync for RawOccupiedEntryMut<'_, K, V, S, A> ++where ++ K: Sync, ++ V: Sync, ++ S: Sync, ++ A: Sync + Allocator, ++{ ++} ++ ++/// A view into a vacant entry in a `HashMap`. ++/// It is part of the [`RawEntryMut`] enum. ++/// ++/// [`RawEntryMut`]: enum.RawEntryMut.html ++/// ++/// # Examples ++/// ++/// ``` ++/// use core::hash::{BuildHasher, Hash}; ++/// use hashbrown::hash_map::{HashMap, RawEntryMut, RawVacantEntryMut}; ++/// ++/// let mut map = HashMap::<&str, i32>::new(); ++/// ++/// fn compute_hash(hash_builder: &S, key: &K) -> u64 { ++/// use core::hash::Hasher; ++/// let mut state = hash_builder.build_hasher(); ++/// key.hash(&mut state); ++/// state.finish() ++/// } ++/// ++/// let raw_v: RawVacantEntryMut<_, _, _> = match map.raw_entry_mut().from_key(&"a") { ++/// RawEntryMut::Vacant(view) => view, ++/// RawEntryMut::Occupied(_) => unreachable!(), ++/// }; ++/// raw_v.insert("a", 10); ++/// assert!(map[&"a"] == 10 && map.len() == 1); ++/// ++/// // Nonexistent key (insert and update) ++/// let hash = compute_hash(map.hasher(), &"b"); ++/// match map.raw_entry_mut().from_key_hashed_nocheck(hash, &"b") { ++/// RawEntryMut::Occupied(_) => unreachable!(), ++/// RawEntryMut::Vacant(view) => { ++/// let (k, value) = view.insert("b", 2); ++/// assert_eq!((*k, *value), ("b", 2)); ++/// *value = 20; ++/// } ++/// } ++/// assert!(map[&"b"] == 20 && map.len() == 2); ++/// ++/// let hash = compute_hash(map.hasher(), &"c"); ++/// match map.raw_entry_mut().from_hash(hash, |q| *q == "c") { ++/// RawEntryMut::Occupied(_) => unreachable!(), ++/// RawEntryMut::Vacant(view) => { ++/// assert_eq!(view.insert("c", 30), (&mut "c", &mut 30)); ++/// } ++/// } ++/// assert!(map[&"c"] == 30 && map.len() == 3); ++/// ``` ++pub struct RawVacantEntryMut<'a, K, V, S, A: Allocator = Global> { ++ table: &'a mut RawTable<(K, V), A>, ++ hash_builder: &'a S, ++} ++ ++/// A builder for computing where in a [`HashMap`] a key-value pair would be stored. ++/// ++/// See the [`HashMap::raw_entry`] docs for usage examples. ++/// ++/// [`HashMap::raw_entry`]: struct.HashMap.html#method.raw_entry ++/// ++/// # Examples ++/// ++/// ``` ++/// use hashbrown::hash_map::{HashMap, RawEntryBuilder}; ++/// use core::hash::{BuildHasher, Hash}; ++/// ++/// let mut map = HashMap::new(); ++/// map.extend([(1, 10), (2, 20), (3, 30)]); ++/// ++/// fn compute_hash(hash_builder: &S, key: &K) -> u64 { ++/// use core::hash::Hasher; ++/// let mut state = hash_builder.build_hasher(); ++/// key.hash(&mut state); ++/// state.finish() ++/// } ++/// ++/// for k in 0..6 { ++/// let hash = compute_hash(map.hasher(), &k); ++/// let v = map.get(&k).cloned(); ++/// let kv = v.as_ref().map(|v| (&k, v)); ++/// ++/// println!("Key: {} and value: {:?}", k, v); ++/// let builder: RawEntryBuilder<_, _, _> = map.raw_entry(); ++/// assert_eq!(builder.from_key(&k), kv); ++/// assert_eq!(map.raw_entry().from_hash(hash, |q| *q == k), kv); ++/// assert_eq!(map.raw_entry().from_key_hashed_nocheck(hash, &k), kv); ++/// } ++/// ``` ++pub struct RawEntryBuilder<'a, K, V, S, A: Allocator = Global> { ++ map: &'a HashMap, ++} ++ ++impl<'a, K, V, S, A: Allocator> RawEntryBuilderMut<'a, K, V, S, A> { ++ /// Creates a `RawEntryMut` from the given key. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::hash_map::{HashMap, RawEntryMut}; ++ /// ++ /// let mut map: HashMap<&str, u32> = HashMap::new(); ++ /// let key = "a"; ++ /// let entry: RawEntryMut<&str, u32, _> = map.raw_entry_mut().from_key(&key); ++ /// entry.insert(key, 100); ++ /// assert_eq!(map[&"a"], 100); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ #[allow(clippy::wrong_self_convention)] ++ pub fn from_key(self, k: &Q) -> RawEntryMut<'a, K, V, S, A> ++ where ++ S: BuildHasher, ++ Q: Hash + Equivalent, ++ { ++ let hash = make_hash::(&self.map.hash_builder, k); ++ self.from_key_hashed_nocheck(hash, k) ++ } ++ ++ /// Creates a `RawEntryMut` from the given key and its hash. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use core::hash::{BuildHasher, Hash}; ++ /// use hashbrown::hash_map::{HashMap, RawEntryMut}; ++ /// ++ /// fn compute_hash(hash_builder: &S, key: &K) -> u64 { ++ /// use core::hash::Hasher; ++ /// let mut state = hash_builder.build_hasher(); ++ /// key.hash(&mut state); ++ /// state.finish() ++ /// } ++ /// ++ /// let mut map: HashMap<&str, u32> = HashMap::new(); ++ /// let key = "a"; ++ /// let hash = compute_hash(map.hasher(), &key); ++ /// let entry: RawEntryMut<&str, u32, _> = map.raw_entry_mut().from_key_hashed_nocheck(hash, &key); ++ /// entry.insert(key, 100); ++ /// assert_eq!(map[&"a"], 100); ++ /// ``` ++ #[inline] ++ #[allow(clippy::wrong_self_convention)] ++ pub fn from_key_hashed_nocheck(self, hash: u64, k: &Q) -> RawEntryMut<'a, K, V, S, A> ++ where ++ Q: Equivalent, ++ { ++ self.from_hash(hash, equivalent(k)) ++ } ++} ++ ++impl<'a, K, V, S, A: Allocator> RawEntryBuilderMut<'a, K, V, S, A> { ++ /// Creates a `RawEntryMut` from the given hash and matching function. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use core::hash::{BuildHasher, Hash}; ++ /// use hashbrown::hash_map::{HashMap, RawEntryMut}; ++ /// ++ /// fn compute_hash(hash_builder: &S, key: &K) -> u64 { ++ /// use core::hash::Hasher; ++ /// let mut state = hash_builder.build_hasher(); ++ /// key.hash(&mut state); ++ /// state.finish() ++ /// } ++ /// ++ /// let mut map: HashMap<&str, u32> = HashMap::new(); ++ /// let key = "a"; ++ /// let hash = compute_hash(map.hasher(), &key); ++ /// let entry: RawEntryMut<&str, u32, _> = map.raw_entry_mut().from_hash(hash, |k| k == &key); ++ /// entry.insert(key, 100); ++ /// assert_eq!(map[&"a"], 100); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ #[allow(clippy::wrong_self_convention)] ++ pub fn from_hash(self, hash: u64, is_match: F) -> RawEntryMut<'a, K, V, S, A> ++ where ++ for<'b> F: FnMut(&'b K) -> bool, ++ { ++ self.search(hash, is_match) ++ } ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn search(self, hash: u64, mut is_match: F) -> RawEntryMut<'a, K, V, S, A> ++ where ++ for<'b> F: FnMut(&'b K) -> bool, ++ { ++ match self.map.table.find(hash, |(k, _)| is_match(k)) { ++ Some(elem) => RawEntryMut::Occupied(RawOccupiedEntryMut { ++ elem, ++ table: &mut self.map.table, ++ hash_builder: &self.map.hash_builder, ++ }), ++ None => RawEntryMut::Vacant(RawVacantEntryMut { ++ table: &mut self.map.table, ++ hash_builder: &self.map.hash_builder, ++ }), ++ } ++ } ++} ++ ++impl<'a, K, V, S, A: Allocator> RawEntryBuilder<'a, K, V, S, A> { ++ /// Access an immutable entry by key. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let map: HashMap<&str, u32> = [("a", 100), ("b", 200)].into(); ++ /// let key = "a"; ++ /// assert_eq!(map.raw_entry().from_key(&key), Some((&"a", &100))); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ #[allow(clippy::wrong_self_convention)] ++ pub fn from_key(self, k: &Q) -> Option<(&'a K, &'a V)> ++ where ++ S: BuildHasher, ++ Q: Hash + Equivalent, ++ { ++ let hash = make_hash::(&self.map.hash_builder, k); ++ self.from_key_hashed_nocheck(hash, k) ++ } ++ ++ /// Access an immutable entry by a key and its hash. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use core::hash::{BuildHasher, Hash}; ++ /// use hashbrown::HashMap; ++ /// ++ /// fn compute_hash(hash_builder: &S, key: &K) -> u64 { ++ /// use core::hash::Hasher; ++ /// let mut state = hash_builder.build_hasher(); ++ /// key.hash(&mut state); ++ /// state.finish() ++ /// } ++ /// ++ /// let map: HashMap<&str, u32> = [("a", 100), ("b", 200)].into(); ++ /// let key = "a"; ++ /// let hash = compute_hash(map.hasher(), &key); ++ /// assert_eq!(map.raw_entry().from_key_hashed_nocheck(hash, &key), Some((&"a", &100))); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ #[allow(clippy::wrong_self_convention)] ++ pub fn from_key_hashed_nocheck(self, hash: u64, k: &Q) -> Option<(&'a K, &'a V)> ++ where ++ Q: Equivalent, ++ { ++ self.from_hash(hash, equivalent(k)) ++ } ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn search(self, hash: u64, mut is_match: F) -> Option<(&'a K, &'a V)> ++ where ++ F: FnMut(&K) -> bool, ++ { ++ match self.map.table.get(hash, |(k, _)| is_match(k)) { ++ Some((key, value)) => Some((key, value)), ++ None => None, ++ } ++ } ++ ++ /// Access an immutable entry by hash and matching function. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use core::hash::{BuildHasher, Hash}; ++ /// use hashbrown::HashMap; ++ /// ++ /// fn compute_hash(hash_builder: &S, key: &K) -> u64 { ++ /// use core::hash::Hasher; ++ /// let mut state = hash_builder.build_hasher(); ++ /// key.hash(&mut state); ++ /// state.finish() ++ /// } ++ /// ++ /// let map: HashMap<&str, u32> = [("a", 100), ("b", 200)].into(); ++ /// let key = "a"; ++ /// let hash = compute_hash(map.hasher(), &key); ++ /// assert_eq!(map.raw_entry().from_hash(hash, |k| k == &key), Some((&"a", &100))); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ #[allow(clippy::wrong_self_convention)] ++ pub fn from_hash(self, hash: u64, is_match: F) -> Option<(&'a K, &'a V)> ++ where ++ F: FnMut(&K) -> bool, ++ { ++ self.search(hash, is_match) ++ } ++} ++ ++impl<'a, K, V, S, A: Allocator> RawEntryMut<'a, K, V, S, A> { ++ /// Sets the value of the entry, and returns a RawOccupiedEntryMut. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map: HashMap<&str, u32> = HashMap::new(); ++ /// let entry = map.raw_entry_mut().from_key("horseyland").insert("horseyland", 37); ++ /// ++ /// assert_eq!(entry.remove_entry(), ("horseyland", 37)); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn insert(self, key: K, value: V) -> RawOccupiedEntryMut<'a, K, V, S, A> ++ where ++ K: Hash, ++ S: BuildHasher, ++ { ++ match self { ++ RawEntryMut::Occupied(mut entry) => { ++ entry.insert(value); ++ entry ++ } ++ RawEntryMut::Vacant(entry) => entry.insert_entry(key, value), ++ } ++ } ++ ++ /// Ensures a value is in the entry by inserting the default if empty, and returns ++ /// mutable references to the key and value in the entry. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map: HashMap<&str, u32> = HashMap::new(); ++ /// ++ /// map.raw_entry_mut().from_key("poneyland").or_insert("poneyland", 3); ++ /// assert_eq!(map["poneyland"], 3); ++ /// ++ /// *map.raw_entry_mut().from_key("poneyland").or_insert("poneyland", 10).1 *= 2; ++ /// assert_eq!(map["poneyland"], 6); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn or_insert(self, default_key: K, default_val: V) -> (&'a mut K, &'a mut V) ++ where ++ K: Hash, ++ S: BuildHasher, ++ { ++ match self { ++ RawEntryMut::Occupied(entry) => entry.into_key_value(), ++ RawEntryMut::Vacant(entry) => entry.insert(default_key, default_val), ++ } ++ } ++ ++ /// Ensures a value is in the entry by inserting the result of the default function if empty, ++ /// and returns mutable references to the key and value in the entry. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map: HashMap<&str, String> = HashMap::new(); ++ /// ++ /// map.raw_entry_mut().from_key("poneyland").or_insert_with(|| { ++ /// ("poneyland", "hoho".to_string()) ++ /// }); ++ /// ++ /// assert_eq!(map["poneyland"], "hoho".to_string()); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn or_insert_with(self, default: F) -> (&'a mut K, &'a mut V) ++ where ++ F: FnOnce() -> (K, V), ++ K: Hash, ++ S: BuildHasher, ++ { ++ match self { ++ RawEntryMut::Occupied(entry) => entry.into_key_value(), ++ RawEntryMut::Vacant(entry) => { ++ let (k, v) = default(); ++ entry.insert(k, v) ++ } ++ } ++ } ++ ++ /// Provides in-place mutable access to an occupied entry before any ++ /// potential inserts into the map. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map: HashMap<&str, u32> = HashMap::new(); ++ /// ++ /// map.raw_entry_mut() ++ /// .from_key("poneyland") ++ /// .and_modify(|_k, v| { *v += 1 }) ++ /// .or_insert("poneyland", 42); ++ /// assert_eq!(map["poneyland"], 42); ++ /// ++ /// map.raw_entry_mut() ++ /// .from_key("poneyland") ++ /// .and_modify(|_k, v| { *v += 1 }) ++ /// .or_insert("poneyland", 0); ++ /// assert_eq!(map["poneyland"], 43); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn and_modify(self, f: F) -> Self ++ where ++ F: FnOnce(&mut K, &mut V), ++ { ++ match self { ++ RawEntryMut::Occupied(mut entry) => { ++ { ++ let (k, v) = entry.get_key_value_mut(); ++ f(k, v); ++ } ++ RawEntryMut::Occupied(entry) ++ } ++ RawEntryMut::Vacant(entry) => RawEntryMut::Vacant(entry), ++ } ++ } ++ ++ /// Provides shared access to the key and owned access to the value of ++ /// an occupied entry and allows to replace or remove it based on the ++ /// value of the returned option. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// use hashbrown::hash_map::RawEntryMut; ++ /// ++ /// let mut map: HashMap<&str, u32> = HashMap::new(); ++ /// ++ /// let entry = map ++ /// .raw_entry_mut() ++ /// .from_key("poneyland") ++ /// .and_replace_entry_with(|_k, _v| panic!()); ++ /// ++ /// match entry { ++ /// RawEntryMut::Vacant(_) => {}, ++ /// RawEntryMut::Occupied(_) => panic!(), ++ /// } ++ /// ++ /// map.insert("poneyland", 42); ++ /// ++ /// let entry = map ++ /// .raw_entry_mut() ++ /// .from_key("poneyland") ++ /// .and_replace_entry_with(|k, v| { ++ /// assert_eq!(k, &"poneyland"); ++ /// assert_eq!(v, 42); ++ /// Some(v + 1) ++ /// }); ++ /// ++ /// match entry { ++ /// RawEntryMut::Occupied(e) => { ++ /// assert_eq!(e.key(), &"poneyland"); ++ /// assert_eq!(e.get(), &43); ++ /// }, ++ /// RawEntryMut::Vacant(_) => panic!(), ++ /// } ++ /// ++ /// assert_eq!(map["poneyland"], 43); ++ /// ++ /// let entry = map ++ /// .raw_entry_mut() ++ /// .from_key("poneyland") ++ /// .and_replace_entry_with(|_k, _v| None); ++ /// ++ /// match entry { ++ /// RawEntryMut::Vacant(_) => {}, ++ /// RawEntryMut::Occupied(_) => panic!(), ++ /// } ++ /// ++ /// assert!(!map.contains_key("poneyland")); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn and_replace_entry_with(self, f: F) -> Self ++ where ++ F: FnOnce(&K, V) -> Option, ++ { ++ match self { ++ RawEntryMut::Occupied(entry) => entry.replace_entry_with(f), ++ RawEntryMut::Vacant(_) => self, ++ } ++ } ++} ++ ++impl<'a, K, V, S, A: Allocator> RawOccupiedEntryMut<'a, K, V, S, A> { ++ /// Gets a reference to the key in the entry. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::hash_map::{HashMap, RawEntryMut}; ++ /// ++ /// let mut map: HashMap<&str, u32> = [("a", 100), ("b", 200)].into(); ++ /// ++ /// match map.raw_entry_mut().from_key(&"a") { ++ /// RawEntryMut::Vacant(_) => panic!(), ++ /// RawEntryMut::Occupied(o) => assert_eq!(o.key(), &"a") ++ /// } ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn key(&self) -> &K { ++ unsafe { &self.elem.as_ref().0 } ++ } ++ ++ /// Gets a mutable reference to the key in the entry. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::hash_map::{HashMap, RawEntryMut}; ++ /// use std::rc::Rc; ++ /// ++ /// let key_one = Rc::new("a"); ++ /// let key_two = Rc::new("a"); ++ /// ++ /// let mut map: HashMap, u32> = HashMap::new(); ++ /// map.insert(key_one.clone(), 10); ++ /// ++ /// assert_eq!(map[&key_one], 10); ++ /// assert!(Rc::strong_count(&key_one) == 2 && Rc::strong_count(&key_two) == 1); ++ /// ++ /// match map.raw_entry_mut().from_key(&key_one) { ++ /// RawEntryMut::Vacant(_) => panic!(), ++ /// RawEntryMut::Occupied(mut o) => { ++ /// *o.key_mut() = key_two.clone(); ++ /// } ++ /// } ++ /// assert_eq!(map[&key_two], 10); ++ /// assert!(Rc::strong_count(&key_one) == 1 && Rc::strong_count(&key_two) == 2); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn key_mut(&mut self) -> &mut K { ++ unsafe { &mut self.elem.as_mut().0 } ++ } ++ ++ /// Converts the entry into a mutable reference to the key in the entry ++ /// with a lifetime bound to the map itself. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::hash_map::{HashMap, RawEntryMut}; ++ /// use std::rc::Rc; ++ /// ++ /// let key_one = Rc::new("a"); ++ /// let key_two = Rc::new("a"); ++ /// ++ /// let mut map: HashMap, u32> = HashMap::new(); ++ /// map.insert(key_one.clone(), 10); ++ /// ++ /// assert_eq!(map[&key_one], 10); ++ /// assert!(Rc::strong_count(&key_one) == 2 && Rc::strong_count(&key_two) == 1); ++ /// ++ /// let inside_key: &mut Rc<&str>; ++ /// ++ /// match map.raw_entry_mut().from_key(&key_one) { ++ /// RawEntryMut::Vacant(_) => panic!(), ++ /// RawEntryMut::Occupied(o) => inside_key = o.into_key(), ++ /// } ++ /// *inside_key = key_two.clone(); ++ /// ++ /// assert_eq!(map[&key_two], 10); ++ /// assert!(Rc::strong_count(&key_one) == 1 && Rc::strong_count(&key_two) == 2); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn into_key(self) -> &'a mut K { ++ unsafe { &mut self.elem.as_mut().0 } ++ } ++ ++ /// Gets a reference to the value in the entry. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::hash_map::{HashMap, RawEntryMut}; ++ /// ++ /// let mut map: HashMap<&str, u32> = [("a", 100), ("b", 200)].into(); ++ /// ++ /// match map.raw_entry_mut().from_key(&"a") { ++ /// RawEntryMut::Vacant(_) => panic!(), ++ /// RawEntryMut::Occupied(o) => assert_eq!(o.get(), &100), ++ /// } ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn get(&self) -> &V { ++ unsafe { &self.elem.as_ref().1 } ++ } ++ ++ /// Converts the OccupiedEntry into a mutable reference to the value in the entry ++ /// with a lifetime bound to the map itself. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::hash_map::{HashMap, RawEntryMut}; ++ /// ++ /// let mut map: HashMap<&str, u32> = [("a", 100), ("b", 200)].into(); ++ /// ++ /// let value: &mut u32; ++ /// ++ /// match map.raw_entry_mut().from_key(&"a") { ++ /// RawEntryMut::Vacant(_) => panic!(), ++ /// RawEntryMut::Occupied(o) => value = o.into_mut(), ++ /// } ++ /// *value += 900; ++ /// ++ /// assert_eq!(map[&"a"], 1000); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn into_mut(self) -> &'a mut V { ++ unsafe { &mut self.elem.as_mut().1 } ++ } ++ ++ /// Gets a mutable reference to the value in the entry. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::hash_map::{HashMap, RawEntryMut}; ++ /// ++ /// let mut map: HashMap<&str, u32> = [("a", 100), ("b", 200)].into(); ++ /// ++ /// match map.raw_entry_mut().from_key(&"a") { ++ /// RawEntryMut::Vacant(_) => panic!(), ++ /// RawEntryMut::Occupied(mut o) => *o.get_mut() += 900, ++ /// } ++ /// ++ /// assert_eq!(map[&"a"], 1000); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn get_mut(&mut self) -> &mut V { ++ unsafe { &mut self.elem.as_mut().1 } ++ } ++ ++ /// Gets a reference to the key and value in the entry. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::hash_map::{HashMap, RawEntryMut}; ++ /// ++ /// let mut map: HashMap<&str, u32> = [("a", 100), ("b", 200)].into(); ++ /// ++ /// match map.raw_entry_mut().from_key(&"a") { ++ /// RawEntryMut::Vacant(_) => panic!(), ++ /// RawEntryMut::Occupied(o) => assert_eq!(o.get_key_value(), (&"a", &100)), ++ /// } ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn get_key_value(&self) -> (&K, &V) { ++ unsafe { ++ let (key, value) = self.elem.as_ref(); ++ (key, value) ++ } ++ } ++ ++ /// Gets a mutable reference to the key and value in the entry. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::hash_map::{HashMap, RawEntryMut}; ++ /// use std::rc::Rc; ++ /// ++ /// let key_one = Rc::new("a"); ++ /// let key_two = Rc::new("a"); ++ /// ++ /// let mut map: HashMap, u32> = HashMap::new(); ++ /// map.insert(key_one.clone(), 10); ++ /// ++ /// assert_eq!(map[&key_one], 10); ++ /// assert!(Rc::strong_count(&key_one) == 2 && Rc::strong_count(&key_two) == 1); ++ /// ++ /// match map.raw_entry_mut().from_key(&key_one) { ++ /// RawEntryMut::Vacant(_) => panic!(), ++ /// RawEntryMut::Occupied(mut o) => { ++ /// let (inside_key, inside_value) = o.get_key_value_mut(); ++ /// *inside_key = key_two.clone(); ++ /// *inside_value = 100; ++ /// } ++ /// } ++ /// assert_eq!(map[&key_two], 100); ++ /// assert!(Rc::strong_count(&key_one) == 1 && Rc::strong_count(&key_two) == 2); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn get_key_value_mut(&mut self) -> (&mut K, &mut V) { ++ unsafe { ++ let &mut (ref mut key, ref mut value) = self.elem.as_mut(); ++ (key, value) ++ } ++ } ++ ++ /// Converts the OccupiedEntry into a mutable reference to the key and value in the entry ++ /// with a lifetime bound to the map itself. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::hash_map::{HashMap, RawEntryMut}; ++ /// use std::rc::Rc; ++ /// ++ /// let key_one = Rc::new("a"); ++ /// let key_two = Rc::new("a"); ++ /// ++ /// let mut map: HashMap, u32> = HashMap::new(); ++ /// map.insert(key_one.clone(), 10); ++ /// ++ /// assert_eq!(map[&key_one], 10); ++ /// assert!(Rc::strong_count(&key_one) == 2 && Rc::strong_count(&key_two) == 1); ++ /// ++ /// let inside_key: &mut Rc<&str>; ++ /// let inside_value: &mut u32; ++ /// match map.raw_entry_mut().from_key(&key_one) { ++ /// RawEntryMut::Vacant(_) => panic!(), ++ /// RawEntryMut::Occupied(o) => { ++ /// let tuple = o.into_key_value(); ++ /// inside_key = tuple.0; ++ /// inside_value = tuple.1; ++ /// } ++ /// } ++ /// *inside_key = key_two.clone(); ++ /// *inside_value = 100; ++ /// assert_eq!(map[&key_two], 100); ++ /// assert!(Rc::strong_count(&key_one) == 1 && Rc::strong_count(&key_two) == 2); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn into_key_value(self) -> (&'a mut K, &'a mut V) { ++ unsafe { ++ let &mut (ref mut key, ref mut value) = self.elem.as_mut(); ++ (key, value) ++ } ++ } ++ ++ /// Sets the value of the entry, and returns the entry's old value. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::hash_map::{HashMap, RawEntryMut}; ++ /// ++ /// let mut map: HashMap<&str, u32> = [("a", 100), ("b", 200)].into(); ++ /// ++ /// match map.raw_entry_mut().from_key(&"a") { ++ /// RawEntryMut::Vacant(_) => panic!(), ++ /// RawEntryMut::Occupied(mut o) => assert_eq!(o.insert(1000), 100), ++ /// } ++ /// ++ /// assert_eq!(map[&"a"], 1000); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn insert(&mut self, value: V) -> V { ++ mem::replace(self.get_mut(), value) ++ } ++ ++ /// Sets the value of the entry, and returns the entry's old value. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::hash_map::{HashMap, RawEntryMut}; ++ /// use std::rc::Rc; ++ /// ++ /// let key_one = Rc::new("a"); ++ /// let key_two = Rc::new("a"); ++ /// ++ /// let mut map: HashMap, u32> = HashMap::new(); ++ /// map.insert(key_one.clone(), 10); ++ /// ++ /// assert_eq!(map[&key_one], 10); ++ /// assert!(Rc::strong_count(&key_one) == 2 && Rc::strong_count(&key_two) == 1); ++ /// ++ /// match map.raw_entry_mut().from_key(&key_one) { ++ /// RawEntryMut::Vacant(_) => panic!(), ++ /// RawEntryMut::Occupied(mut o) => { ++ /// let old_key = o.insert_key(key_two.clone()); ++ /// assert!(Rc::ptr_eq(&old_key, &key_one)); ++ /// } ++ /// } ++ /// assert_eq!(map[&key_two], 10); ++ /// assert!(Rc::strong_count(&key_one) == 1 && Rc::strong_count(&key_two) == 2); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn insert_key(&mut self, key: K) -> K { ++ mem::replace(self.key_mut(), key) ++ } ++ ++ /// Takes the value out of the entry, and returns it. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::hash_map::{HashMap, RawEntryMut}; ++ /// ++ /// let mut map: HashMap<&str, u32> = [("a", 100), ("b", 200)].into(); ++ /// ++ /// match map.raw_entry_mut().from_key(&"a") { ++ /// RawEntryMut::Vacant(_) => panic!(), ++ /// RawEntryMut::Occupied(o) => assert_eq!(o.remove(), 100), ++ /// } ++ /// assert_eq!(map.get(&"a"), None); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn remove(self) -> V { ++ self.remove_entry().1 ++ } ++ ++ /// Take the ownership of the key and value from the map. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::hash_map::{HashMap, RawEntryMut}; ++ /// ++ /// let mut map: HashMap<&str, u32> = [("a", 100), ("b", 200)].into(); ++ /// ++ /// match map.raw_entry_mut().from_key(&"a") { ++ /// RawEntryMut::Vacant(_) => panic!(), ++ /// RawEntryMut::Occupied(o) => assert_eq!(o.remove_entry(), ("a", 100)), ++ /// } ++ /// assert_eq!(map.get(&"a"), None); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn remove_entry(self) -> (K, V) { ++ unsafe { self.table.remove(self.elem).0 } ++ } ++ ++ /// Provides shared access to the key and owned access to the value of ++ /// the entry and allows to replace or remove it based on the ++ /// value of the returned option. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::hash_map::{HashMap, RawEntryMut}; ++ /// ++ /// let mut map: HashMap<&str, u32> = [("a", 100), ("b", 200)].into(); ++ /// ++ /// let raw_entry = match map.raw_entry_mut().from_key(&"a") { ++ /// RawEntryMut::Vacant(_) => panic!(), ++ /// RawEntryMut::Occupied(o) => o.replace_entry_with(|k, v| { ++ /// assert_eq!(k, &"a"); ++ /// assert_eq!(v, 100); ++ /// Some(v + 900) ++ /// }), ++ /// }; ++ /// let raw_entry = match raw_entry { ++ /// RawEntryMut::Vacant(_) => panic!(), ++ /// RawEntryMut::Occupied(o) => o.replace_entry_with(|k, v| { ++ /// assert_eq!(k, &"a"); ++ /// assert_eq!(v, 1000); ++ /// None ++ /// }), ++ /// }; ++ /// match raw_entry { ++ /// RawEntryMut::Vacant(_) => { }, ++ /// RawEntryMut::Occupied(_) => panic!(), ++ /// }; ++ /// assert_eq!(map.get(&"a"), None); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn replace_entry_with(self, f: F) -> RawEntryMut<'a, K, V, S, A> ++ where ++ F: FnOnce(&K, V) -> Option, ++ { ++ unsafe { ++ let still_occupied = self ++ .table ++ .replace_bucket_with(self.elem.clone(), |(key, value)| { ++ f(&key, value).map(|new_value| (key, new_value)) ++ }); ++ ++ if still_occupied { ++ RawEntryMut::Occupied(self) ++ } else { ++ RawEntryMut::Vacant(RawVacantEntryMut { ++ table: self.table, ++ hash_builder: self.hash_builder, ++ }) ++ } ++ } ++ } ++} ++ ++impl<'a, K, V, S, A: Allocator> RawVacantEntryMut<'a, K, V, S, A> { ++ /// Sets the value of the entry with the VacantEntry's key, ++ /// and returns a mutable reference to it. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::hash_map::{HashMap, RawEntryMut}; ++ /// ++ /// let mut map: HashMap<&str, u32> = [("a", 100), ("b", 200)].into(); ++ /// ++ /// match map.raw_entry_mut().from_key(&"c") { ++ /// RawEntryMut::Occupied(_) => panic!(), ++ /// RawEntryMut::Vacant(v) => assert_eq!(v.insert("c", 300), (&mut "c", &mut 300)), ++ /// } ++ /// ++ /// assert_eq!(map[&"c"], 300); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn insert(self, key: K, value: V) -> (&'a mut K, &'a mut V) ++ where ++ K: Hash, ++ S: BuildHasher, ++ { ++ let hash = make_hash::(self.hash_builder, &key); ++ self.insert_hashed_nocheck(hash, key, value) ++ } ++ ++ /// Sets the value of the entry with the VacantEntry's key, ++ /// and returns a mutable reference to it. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use core::hash::{BuildHasher, Hash}; ++ /// use hashbrown::hash_map::{HashMap, RawEntryMut}; ++ /// ++ /// fn compute_hash(hash_builder: &S, key: &K) -> u64 { ++ /// use core::hash::Hasher; ++ /// let mut state = hash_builder.build_hasher(); ++ /// key.hash(&mut state); ++ /// state.finish() ++ /// } ++ /// ++ /// let mut map: HashMap<&str, u32> = [("a", 100), ("b", 200)].into(); ++ /// let key = "c"; ++ /// let hash = compute_hash(map.hasher(), &key); ++ /// ++ /// match map.raw_entry_mut().from_key_hashed_nocheck(hash, &key) { ++ /// RawEntryMut::Occupied(_) => panic!(), ++ /// RawEntryMut::Vacant(v) => assert_eq!( ++ /// v.insert_hashed_nocheck(hash, key, 300), ++ /// (&mut "c", &mut 300) ++ /// ), ++ /// } ++ /// ++ /// assert_eq!(map[&"c"], 300); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ #[allow(clippy::shadow_unrelated)] ++ pub fn insert_hashed_nocheck(self, hash: u64, key: K, value: V) -> (&'a mut K, &'a mut V) ++ where ++ K: Hash, ++ S: BuildHasher, ++ { ++ let &mut (ref mut k, ref mut v) = self.table.insert_entry( ++ hash, ++ (key, value), ++ make_hasher::<_, V, S>(self.hash_builder), ++ ); ++ (k, v) ++ } ++ ++ /// Set the value of an entry with a custom hasher function. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use core::hash::{BuildHasher, Hash}; ++ /// use hashbrown::hash_map::{HashMap, RawEntryMut}; ++ /// ++ /// fn make_hasher(hash_builder: &S) -> impl Fn(&K) -> u64 + '_ ++ /// where ++ /// K: Hash + ?Sized, ++ /// S: BuildHasher, ++ /// { ++ /// move |key: &K| { ++ /// use core::hash::Hasher; ++ /// let mut state = hash_builder.build_hasher(); ++ /// key.hash(&mut state); ++ /// state.finish() ++ /// } ++ /// } ++ /// ++ /// let mut map: HashMap<&str, u32> = HashMap::new(); ++ /// let key = "a"; ++ /// let hash_builder = map.hasher().clone(); ++ /// let hash = make_hasher(&hash_builder)(&key); ++ /// ++ /// match map.raw_entry_mut().from_hash(hash, |q| q == &key) { ++ /// RawEntryMut::Occupied(_) => panic!(), ++ /// RawEntryMut::Vacant(v) => assert_eq!( ++ /// v.insert_with_hasher(hash, key, 100, make_hasher(&hash_builder)), ++ /// (&mut "a", &mut 100) ++ /// ), ++ /// } ++ /// map.extend([("b", 200), ("c", 300), ("d", 400), ("e", 500), ("f", 600)]); ++ /// assert_eq!(map[&"a"], 100); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn insert_with_hasher( ++ self, ++ hash: u64, ++ key: K, ++ value: V, ++ hasher: H, ++ ) -> (&'a mut K, &'a mut V) ++ where ++ H: Fn(&K) -> u64, ++ { ++ let &mut (ref mut k, ref mut v) = self ++ .table ++ .insert_entry(hash, (key, value), |x| hasher(&x.0)); ++ (k, v) ++ } ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn insert_entry(self, key: K, value: V) -> RawOccupiedEntryMut<'a, K, V, S, A> ++ where ++ K: Hash, ++ S: BuildHasher, ++ { ++ let hash = make_hash::(self.hash_builder, &key); ++ let elem = self.table.insert( ++ hash, ++ (key, value), ++ make_hasher::<_, V, S>(self.hash_builder), ++ ); ++ RawOccupiedEntryMut { ++ elem, ++ table: self.table, ++ hash_builder: self.hash_builder, ++ } ++ } ++} ++ ++impl Debug for RawEntryBuilderMut<'_, K, V, S, A> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_struct("RawEntryBuilder").finish() ++ } ++} ++ ++impl Debug for RawEntryMut<'_, K, V, S, A> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ match *self { ++ RawEntryMut::Vacant(ref v) => f.debug_tuple("RawEntry").field(v).finish(), ++ RawEntryMut::Occupied(ref o) => f.debug_tuple("RawEntry").field(o).finish(), ++ } ++ } ++} ++ ++impl Debug for RawOccupiedEntryMut<'_, K, V, S, A> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_struct("RawOccupiedEntryMut") ++ .field("key", self.key()) ++ .field("value", self.get()) ++ .finish() ++ } ++} ++ ++impl Debug for RawVacantEntryMut<'_, K, V, S, A> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_struct("RawVacantEntryMut").finish() ++ } ++} ++ ++impl Debug for RawEntryBuilder<'_, K, V, S, A> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_struct("RawEntryBuilder").finish() ++ } ++} ++ ++/// A view into a single entry in a map, which may either be vacant or occupied. ++/// ++/// This `enum` is constructed from the [`entry`] method on [`HashMap`]. ++/// ++/// [`HashMap`]: struct.HashMap.html ++/// [`entry`]: struct.HashMap.html#method.entry ++/// ++/// # Examples ++/// ++/// ``` ++/// use hashbrown::hash_map::{Entry, HashMap, OccupiedEntry}; ++/// ++/// let mut map = HashMap::new(); ++/// map.extend([("a", 10), ("b", 20), ("c", 30)]); ++/// assert_eq!(map.len(), 3); ++/// ++/// // Existing key (insert) ++/// let entry: Entry<_, _, _> = map.entry("a"); ++/// let _raw_o: OccupiedEntry<_, _, _> = entry.insert(1); ++/// assert_eq!(map.len(), 3); ++/// // Nonexistent key (insert) ++/// map.entry("d").insert(4); ++/// ++/// // Existing key (or_insert) ++/// let v = map.entry("b").or_insert(2); ++/// assert_eq!(std::mem::replace(v, 2), 20); ++/// // Nonexistent key (or_insert) ++/// map.entry("e").or_insert(5); ++/// ++/// // Existing key (or_insert_with) ++/// let v = map.entry("c").or_insert_with(|| 3); ++/// assert_eq!(std::mem::replace(v, 3), 30); ++/// // Nonexistent key (or_insert_with) ++/// map.entry("f").or_insert_with(|| 6); ++/// ++/// println!("Our HashMap: {:?}", map); ++/// ++/// let mut vec: Vec<_> = map.iter().map(|(&k, &v)| (k, v)).collect(); ++/// // The `Iter` iterator produces items in arbitrary order, so the ++/// // items must be sorted to test them against a sorted array. ++/// vec.sort_unstable(); ++/// assert_eq!(vec, [("a", 1), ("b", 2), ("c", 3), ("d", 4), ("e", 5), ("f", 6)]); ++/// ``` ++pub enum Entry<'a, K, V, S, A = Global> ++where ++ A: Allocator, ++{ ++ /// An occupied entry. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::hash_map::{Entry, HashMap}; ++ /// let mut map: HashMap<_, _> = [("a", 100), ("b", 200)].into(); ++ /// ++ /// match map.entry("a") { ++ /// Entry::Vacant(_) => unreachable!(), ++ /// Entry::Occupied(_) => { } ++ /// } ++ /// ``` ++ Occupied(OccupiedEntry<'a, K, V, S, A>), ++ ++ /// A vacant entry. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::hash_map::{Entry, HashMap}; ++ /// let mut map: HashMap<&str, i32> = HashMap::new(); ++ /// ++ /// match map.entry("a") { ++ /// Entry::Occupied(_) => unreachable!(), ++ /// Entry::Vacant(_) => { } ++ /// } ++ /// ``` ++ Vacant(VacantEntry<'a, K, V, S, A>), ++} ++ ++impl Debug for Entry<'_, K, V, S, A> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ match *self { ++ Entry::Vacant(ref v) => f.debug_tuple("Entry").field(v).finish(), ++ Entry::Occupied(ref o) => f.debug_tuple("Entry").field(o).finish(), ++ } ++ } ++} ++ ++/// A view into an occupied entry in a `HashMap`. ++/// It is part of the [`Entry`] enum. ++/// ++/// [`Entry`]: enum.Entry.html ++/// ++/// # Examples ++/// ++/// ``` ++/// use hashbrown::hash_map::{Entry, HashMap, OccupiedEntry}; ++/// ++/// let mut map = HashMap::new(); ++/// map.extend([("a", 10), ("b", 20), ("c", 30)]); ++/// ++/// let _entry_o: OccupiedEntry<_, _, _> = map.entry("a").insert(100); ++/// assert_eq!(map.len(), 3); ++/// ++/// // Existing key (insert and update) ++/// match map.entry("a") { ++/// Entry::Vacant(_) => unreachable!(), ++/// Entry::Occupied(mut view) => { ++/// assert_eq!(view.get(), &100); ++/// let v = view.get_mut(); ++/// *v *= 10; ++/// assert_eq!(view.insert(1111), 1000); ++/// } ++/// } ++/// ++/// assert_eq!(map[&"a"], 1111); ++/// assert_eq!(map.len(), 3); ++/// ++/// // Existing key (take) ++/// match map.entry("c") { ++/// Entry::Vacant(_) => unreachable!(), ++/// Entry::Occupied(view) => { ++/// assert_eq!(view.remove_entry(), ("c", 30)); ++/// } ++/// } ++/// assert_eq!(map.get(&"c"), None); ++/// assert_eq!(map.len(), 2); ++/// ``` ++pub struct OccupiedEntry<'a, K, V, S = DefaultHashBuilder, A: Allocator = Global> { ++ hash: u64, ++ key: Option, ++ elem: Bucket<(K, V)>, ++ table: &'a mut HashMap, ++} ++ ++unsafe impl Send for OccupiedEntry<'_, K, V, S, A> ++where ++ K: Send, ++ V: Send, ++ S: Send, ++ A: Send + Allocator, ++{ ++} ++unsafe impl Sync for OccupiedEntry<'_, K, V, S, A> ++where ++ K: Sync, ++ V: Sync, ++ S: Sync, ++ A: Sync + Allocator, ++{ ++} ++ ++impl Debug for OccupiedEntry<'_, K, V, S, A> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_struct("OccupiedEntry") ++ .field("key", self.key()) ++ .field("value", self.get()) ++ .finish() ++ } ++} ++ ++/// A view into a vacant entry in a `HashMap`. ++/// It is part of the [`Entry`] enum. ++/// ++/// [`Entry`]: enum.Entry.html ++/// ++/// # Examples ++/// ++/// ``` ++/// use hashbrown::hash_map::{Entry, HashMap, VacantEntry}; ++/// ++/// let mut map = HashMap::<&str, i32>::new(); ++/// ++/// let entry_v: VacantEntry<_, _, _> = match map.entry("a") { ++/// Entry::Vacant(view) => view, ++/// Entry::Occupied(_) => unreachable!(), ++/// }; ++/// entry_v.insert(10); ++/// assert!(map[&"a"] == 10 && map.len() == 1); ++/// ++/// // Nonexistent key (insert and update) ++/// match map.entry("b") { ++/// Entry::Occupied(_) => unreachable!(), ++/// Entry::Vacant(view) => { ++/// let value = view.insert(2); ++/// assert_eq!(*value, 2); ++/// *value = 20; ++/// } ++/// } ++/// assert!(map[&"b"] == 20 && map.len() == 2); ++/// ``` ++pub struct VacantEntry<'a, K, V, S = DefaultHashBuilder, A: Allocator = Global> { ++ hash: u64, ++ key: K, ++ table: &'a mut HashMap, ++} ++ ++impl Debug for VacantEntry<'_, K, V, S, A> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_tuple("VacantEntry").field(self.key()).finish() ++ } ++} ++ ++/// A view into a single entry in a map, which may either be vacant or occupied, ++/// with any borrowed form of the map's key type. ++/// ++/// ++/// This `enum` is constructed from the [`entry_ref`] method on [`HashMap`]. ++/// ++/// [`Hash`] and [`Eq`] on the borrowed form of the map's key type *must* match those ++/// for the key type. It also require that key may be constructed from the borrowed ++/// form through the [`From`] trait. ++/// ++/// [`HashMap`]: struct.HashMap.html ++/// [`entry_ref`]: struct.HashMap.html#method.entry_ref ++/// [`Eq`]: https://doc.rust-lang.org/std/cmp/trait.Eq.html ++/// [`Hash`]: https://doc.rust-lang.org/std/hash/trait.Hash.html ++/// [`From`]: https://doc.rust-lang.org/std/convert/trait.From.html ++/// ++/// # Examples ++/// ++/// ``` ++/// use hashbrown::hash_map::{EntryRef, HashMap, OccupiedEntryRef}; ++/// ++/// let mut map = HashMap::new(); ++/// map.extend([("a".to_owned(), 10), ("b".into(), 20), ("c".into(), 30)]); ++/// assert_eq!(map.len(), 3); ++/// ++/// // Existing key (insert) ++/// let key = String::from("a"); ++/// let entry: EntryRef<_, _, _, _> = map.entry_ref(&key); ++/// let _raw_o: OccupiedEntryRef<_, _, _, _> = entry.insert(1); ++/// assert_eq!(map.len(), 3); ++/// // Nonexistent key (insert) ++/// map.entry_ref("d").insert(4); ++/// ++/// // Existing key (or_insert) ++/// let v = map.entry_ref("b").or_insert(2); ++/// assert_eq!(std::mem::replace(v, 2), 20); ++/// // Nonexistent key (or_insert) ++/// map.entry_ref("e").or_insert(5); ++/// ++/// // Existing key (or_insert_with) ++/// let v = map.entry_ref("c").or_insert_with(|| 3); ++/// assert_eq!(std::mem::replace(v, 3), 30); ++/// // Nonexistent key (or_insert_with) ++/// map.entry_ref("f").or_insert_with(|| 6); ++/// ++/// println!("Our HashMap: {:?}", map); ++/// ++/// for (key, value) in ["a", "b", "c", "d", "e", "f"].into_iter().zip(1..=6) { ++/// assert_eq!(map[key], value) ++/// } ++/// assert_eq!(map.len(), 6); ++/// ``` ++pub enum EntryRef<'a, 'b, K, Q: ?Sized, V, S, A = Global> ++where ++ A: Allocator, ++{ ++ /// An occupied entry. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::hash_map::{EntryRef, HashMap}; ++ /// let mut map: HashMap<_, _> = [("a".to_owned(), 100), ("b".into(), 200)].into(); ++ /// ++ /// match map.entry_ref("a") { ++ /// EntryRef::Vacant(_) => unreachable!(), ++ /// EntryRef::Occupied(_) => { } ++ /// } ++ /// ``` ++ Occupied(OccupiedEntryRef<'a, 'b, K, Q, V, S, A>), ++ ++ /// A vacant entry. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::hash_map::{EntryRef, HashMap}; ++ /// let mut map: HashMap = HashMap::new(); ++ /// ++ /// match map.entry_ref("a") { ++ /// EntryRef::Occupied(_) => unreachable!(), ++ /// EntryRef::Vacant(_) => { } ++ /// } ++ /// ``` ++ Vacant(VacantEntryRef<'a, 'b, K, Q, V, S, A>), ++} ++ ++impl, Q: ?Sized + Debug, V: Debug, S, A: Allocator> Debug ++ for EntryRef<'_, '_, K, Q, V, S, A> ++{ ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ match *self { ++ EntryRef::Vacant(ref v) => f.debug_tuple("EntryRef").field(v).finish(), ++ EntryRef::Occupied(ref o) => f.debug_tuple("EntryRef").field(o).finish(), ++ } ++ } ++} ++ ++enum KeyOrRef<'a, K, Q: ?Sized> { ++ Borrowed(&'a Q), ++ Owned(K), ++} ++ ++impl<'a, K, Q: ?Sized> KeyOrRef<'a, K, Q> { ++ fn into_owned(self) -> K ++ where ++ K: From<&'a Q>, ++ { ++ match self { ++ Self::Borrowed(borrowed) => borrowed.into(), ++ Self::Owned(owned) => owned, ++ } ++ } ++} ++ ++impl<'a, K: Borrow, Q: ?Sized> AsRef for KeyOrRef<'a, K, Q> { ++ fn as_ref(&self) -> &Q { ++ match self { ++ Self::Borrowed(borrowed) => borrowed, ++ Self::Owned(owned) => owned.borrow(), ++ } ++ } ++} ++ ++/// A view into an occupied entry in a `HashMap`. ++/// It is part of the [`EntryRef`] enum. ++/// ++/// [`EntryRef`]: enum.EntryRef.html ++/// ++/// # Examples ++/// ++/// ``` ++/// use hashbrown::hash_map::{EntryRef, HashMap, OccupiedEntryRef}; ++/// ++/// let mut map = HashMap::new(); ++/// map.extend([("a".to_owned(), 10), ("b".into(), 20), ("c".into(), 30)]); ++/// ++/// let key = String::from("a"); ++/// let _entry_o: OccupiedEntryRef<_, _, _, _> = map.entry_ref(&key).insert(100); ++/// assert_eq!(map.len(), 3); ++/// ++/// // Existing key (insert and update) ++/// match map.entry_ref("a") { ++/// EntryRef::Vacant(_) => unreachable!(), ++/// EntryRef::Occupied(mut view) => { ++/// assert_eq!(view.get(), &100); ++/// let v = view.get_mut(); ++/// *v *= 10; ++/// assert_eq!(view.insert(1111), 1000); ++/// } ++/// } ++/// ++/// assert_eq!(map["a"], 1111); ++/// assert_eq!(map.len(), 3); ++/// ++/// // Existing key (take) ++/// match map.entry_ref("c") { ++/// EntryRef::Vacant(_) => unreachable!(), ++/// EntryRef::Occupied(view) => { ++/// assert_eq!(view.remove_entry(), ("c".to_owned(), 30)); ++/// } ++/// } ++/// assert_eq!(map.get("c"), None); ++/// assert_eq!(map.len(), 2); ++/// ``` ++pub struct OccupiedEntryRef<'a, 'b, K, Q: ?Sized, V, S, A: Allocator = Global> { ++ hash: u64, ++ key: Option>, ++ elem: Bucket<(K, V)>, ++ table: &'a mut HashMap, ++} ++ ++unsafe impl<'a, 'b, K, Q, V, S, A> Send for OccupiedEntryRef<'a, 'b, K, Q, V, S, A> ++where ++ K: Send, ++ Q: Sync + ?Sized, ++ V: Send, ++ S: Send, ++ A: Send + Allocator, ++{ ++} ++unsafe impl<'a, 'b, K, Q, V, S, A> Sync for OccupiedEntryRef<'a, 'b, K, Q, V, S, A> ++where ++ K: Sync, ++ Q: Sync + ?Sized, ++ V: Sync, ++ S: Sync, ++ A: Sync + Allocator, ++{ ++} ++ ++impl, Q: ?Sized + Debug, V: Debug, S, A: Allocator> Debug ++ for OccupiedEntryRef<'_, '_, K, Q, V, S, A> ++{ ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_struct("OccupiedEntryRef") ++ .field("key", &self.key().borrow()) ++ .field("value", &self.get()) ++ .finish() ++ } ++} ++ ++/// A view into a vacant entry in a `HashMap`. ++/// It is part of the [`EntryRef`] enum. ++/// ++/// [`EntryRef`]: enum.EntryRef.html ++/// ++/// # Examples ++/// ++/// ``` ++/// use hashbrown::hash_map::{EntryRef, HashMap, VacantEntryRef}; ++/// ++/// let mut map = HashMap::::new(); ++/// ++/// let entry_v: VacantEntryRef<_, _, _, _> = match map.entry_ref("a") { ++/// EntryRef::Vacant(view) => view, ++/// EntryRef::Occupied(_) => unreachable!(), ++/// }; ++/// entry_v.insert(10); ++/// assert!(map["a"] == 10 && map.len() == 1); ++/// ++/// // Nonexistent key (insert and update) ++/// match map.entry_ref("b") { ++/// EntryRef::Occupied(_) => unreachable!(), ++/// EntryRef::Vacant(view) => { ++/// let value = view.insert(2); ++/// assert_eq!(*value, 2); ++/// *value = 20; ++/// } ++/// } ++/// assert!(map["b"] == 20 && map.len() == 2); ++/// ``` ++pub struct VacantEntryRef<'a, 'b, K, Q: ?Sized, V, S, A: Allocator = Global> { ++ hash: u64, ++ key: KeyOrRef<'b, K, Q>, ++ table: &'a mut HashMap, ++} ++ ++impl, Q: ?Sized + Debug, V, S, A: Allocator> Debug ++ for VacantEntryRef<'_, '_, K, Q, V, S, A> ++{ ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_tuple("VacantEntryRef").field(&self.key()).finish() ++ } ++} ++ ++/// The error returned by [`try_insert`](HashMap::try_insert) when the key already exists. ++/// ++/// Contains the occupied entry, and the value that was not inserted. ++/// ++/// # Examples ++/// ++/// ``` ++/// use hashbrown::hash_map::{HashMap, OccupiedError}; ++/// ++/// let mut map: HashMap<_, _> = [("a", 10), ("b", 20)].into(); ++/// ++/// // try_insert method returns mutable reference to the value if keys are vacant, ++/// // but if the map did have key present, nothing is updated, and the provided ++/// // value is returned inside `Err(_)` variant ++/// match map.try_insert("a", 100) { ++/// Err(OccupiedError { mut entry, value }) => { ++/// assert_eq!(entry.key(), &"a"); ++/// assert_eq!(value, 100); ++/// assert_eq!(entry.insert(100), 10) ++/// } ++/// _ => unreachable!(), ++/// } ++/// assert_eq!(map[&"a"], 100); ++/// ``` ++pub struct OccupiedError<'a, K, V, S, A: Allocator = Global> { ++ /// The entry in the map that was already occupied. ++ pub entry: OccupiedEntry<'a, K, V, S, A>, ++ /// The value which was not inserted, because the entry was already occupied. ++ pub value: V, ++} ++ ++impl Debug for OccupiedError<'_, K, V, S, A> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_struct("OccupiedError") ++ .field("key", self.entry.key()) ++ .field("old_value", self.entry.get()) ++ .field("new_value", &self.value) ++ .finish() ++ } ++} ++ ++impl<'a, K: Debug, V: Debug, S, A: Allocator> fmt::Display for OccupiedError<'a, K, V, S, A> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ write!( ++ f, ++ "failed to insert {:?}, key {:?} already exists with value {:?}", ++ self.value, ++ self.entry.key(), ++ self.entry.get(), ++ ) ++ } ++} ++ ++impl<'a, K, V, S, A: Allocator> IntoIterator for &'a HashMap { ++ type Item = (&'a K, &'a V); ++ type IntoIter = Iter<'a, K, V>; ++ ++ /// Creates an iterator over the entries of a `HashMap` in arbitrary order. ++ /// The iterator element type is `(&'a K, &'a V)`. ++ /// ++ /// Return the same `Iter` struct as by the [`iter`] method on [`HashMap`]. ++ /// ++ /// [`iter`]: struct.HashMap.html#method.iter ++ /// [`HashMap`]: struct.HashMap.html ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// let map_one: HashMap<_, _> = [(1, "a"), (2, "b"), (3, "c")].into(); ++ /// let mut map_two = HashMap::new(); ++ /// ++ /// for (key, value) in &map_one { ++ /// println!("Key: {}, Value: {}", key, value); ++ /// map_two.insert_unique_unchecked(*key, *value); ++ /// } ++ /// ++ /// assert_eq!(map_one, map_two); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn into_iter(self) -> Iter<'a, K, V> { ++ self.iter() ++ } ++} ++ ++impl<'a, K, V, S, A: Allocator> IntoIterator for &'a mut HashMap { ++ type Item = (&'a K, &'a mut V); ++ type IntoIter = IterMut<'a, K, V>; ++ ++ /// Creates an iterator over the entries of a `HashMap` in arbitrary order ++ /// with mutable references to the values. The iterator element type is ++ /// `(&'a K, &'a mut V)`. ++ /// ++ /// Return the same `IterMut` struct as by the [`iter_mut`] method on ++ /// [`HashMap`]. ++ /// ++ /// [`iter_mut`]: struct.HashMap.html#method.iter_mut ++ /// [`HashMap`]: struct.HashMap.html ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// let mut map: HashMap<_, _> = [("a", 1), ("b", 2), ("c", 3)].into(); ++ /// ++ /// for (key, value) in &mut map { ++ /// println!("Key: {}, Value: {}", key, value); ++ /// *value *= 2; ++ /// } ++ /// ++ /// let mut vec = map.iter().collect::>(); ++ /// // The `Iter` iterator produces items in arbitrary order, so the ++ /// // items must be sorted to test them against a sorted array. ++ /// vec.sort_unstable(); ++ /// assert_eq!(vec, [(&"a", &2), (&"b", &4), (&"c", &6)]); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn into_iter(self) -> IterMut<'a, K, V> { ++ self.iter_mut() ++ } ++} ++ ++impl IntoIterator for HashMap { ++ type Item = (K, V); ++ type IntoIter = IntoIter; ++ ++ /// Creates a consuming iterator, that is, one that moves each key-value ++ /// pair out of the map in arbitrary order. The map cannot be used after ++ /// calling this. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let map: HashMap<_, _> = [("a", 1), ("b", 2), ("c", 3)].into(); ++ /// ++ /// // Not possible with .iter() ++ /// let mut vec: Vec<(&str, i32)> = map.into_iter().collect(); ++ /// // The `IntoIter` iterator produces items in arbitrary order, so ++ /// // the items must be sorted to test them against a sorted array. ++ /// vec.sort_unstable(); ++ /// assert_eq!(vec, [("a", 1), ("b", 2), ("c", 3)]); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn into_iter(self) -> IntoIter { ++ IntoIter { ++ inner: self.table.into_iter(), ++ } ++ } ++} ++ ++impl<'a, K, V> Iterator for Iter<'a, K, V> { ++ type Item = (&'a K, &'a V); ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn next(&mut self) -> Option<(&'a K, &'a V)> { ++ // Avoid `Option::map` because it bloats LLVM IR. ++ match self.inner.next() { ++ Some(x) => unsafe { ++ let r = x.as_ref(); ++ Some((&r.0, &r.1)) ++ }, ++ None => None, ++ } ++ } ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn size_hint(&self) -> (usize, Option) { ++ self.inner.size_hint() ++ } ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn fold(self, init: B, mut f: F) -> B ++ where ++ Self: Sized, ++ F: FnMut(B, Self::Item) -> B, ++ { ++ self.inner.fold(init, |acc, x| unsafe { ++ let (k, v) = x.as_ref(); ++ f(acc, (k, v)) ++ }) ++ } ++} ++impl ExactSizeIterator for Iter<'_, K, V> { ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn len(&self) -> usize { ++ self.inner.len() ++ } ++} ++ ++impl FusedIterator for Iter<'_, K, V> {} ++ ++impl<'a, K, V> Iterator for IterMut<'a, K, V> { ++ type Item = (&'a K, &'a mut V); ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn next(&mut self) -> Option<(&'a K, &'a mut V)> { ++ // Avoid `Option::map` because it bloats LLVM IR. ++ match self.inner.next() { ++ Some(x) => unsafe { ++ let r = x.as_mut(); ++ Some((&r.0, &mut r.1)) ++ }, ++ None => None, ++ } ++ } ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn size_hint(&self) -> (usize, Option) { ++ self.inner.size_hint() ++ } ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn fold(self, init: B, mut f: F) -> B ++ where ++ Self: Sized, ++ F: FnMut(B, Self::Item) -> B, ++ { ++ self.inner.fold(init, |acc, x| unsafe { ++ let (k, v) = x.as_mut(); ++ f(acc, (k, v)) ++ }) ++ } ++} ++impl ExactSizeIterator for IterMut<'_, K, V> { ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn len(&self) -> usize { ++ self.inner.len() ++ } ++} ++impl FusedIterator for IterMut<'_, K, V> {} ++ ++impl fmt::Debug for IterMut<'_, K, V> ++where ++ K: fmt::Debug, ++ V: fmt::Debug, ++{ ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_list().entries(self.iter()).finish() ++ } ++} ++ ++impl Iterator for IntoIter { ++ type Item = (K, V); ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn next(&mut self) -> Option<(K, V)> { ++ self.inner.next() ++ } ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn size_hint(&self) -> (usize, Option) { ++ self.inner.size_hint() ++ } ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn fold(self, init: B, f: F) -> B ++ where ++ Self: Sized, ++ F: FnMut(B, Self::Item) -> B, ++ { ++ self.inner.fold(init, f) ++ } ++} ++impl ExactSizeIterator for IntoIter { ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn len(&self) -> usize { ++ self.inner.len() ++ } ++} ++impl FusedIterator for IntoIter {} ++ ++impl fmt::Debug for IntoIter { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_list().entries(self.iter()).finish() ++ } ++} ++ ++impl<'a, K, V> Iterator for Keys<'a, K, V> { ++ type Item = &'a K; ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn next(&mut self) -> Option<&'a K> { ++ // Avoid `Option::map` because it bloats LLVM IR. ++ match self.inner.next() { ++ Some((k, _)) => Some(k), ++ None => None, ++ } ++ } ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn size_hint(&self) -> (usize, Option) { ++ self.inner.size_hint() ++ } ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn fold(self, init: B, mut f: F) -> B ++ where ++ Self: Sized, ++ F: FnMut(B, Self::Item) -> B, ++ { ++ self.inner.fold(init, |acc, (k, _)| f(acc, k)) ++ } ++} ++impl ExactSizeIterator for Keys<'_, K, V> { ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn len(&self) -> usize { ++ self.inner.len() ++ } ++} ++impl FusedIterator for Keys<'_, K, V> {} ++ ++impl<'a, K, V> Iterator for Values<'a, K, V> { ++ type Item = &'a V; ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn next(&mut self) -> Option<&'a V> { ++ // Avoid `Option::map` because it bloats LLVM IR. ++ match self.inner.next() { ++ Some((_, v)) => Some(v), ++ None => None, ++ } ++ } ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn size_hint(&self) -> (usize, Option) { ++ self.inner.size_hint() ++ } ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn fold(self, init: B, mut f: F) -> B ++ where ++ Self: Sized, ++ F: FnMut(B, Self::Item) -> B, ++ { ++ self.inner.fold(init, |acc, (_, v)| f(acc, v)) ++ } ++} ++impl ExactSizeIterator for Values<'_, K, V> { ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn len(&self) -> usize { ++ self.inner.len() ++ } ++} ++impl FusedIterator for Values<'_, K, V> {} ++ ++impl<'a, K, V> Iterator for ValuesMut<'a, K, V> { ++ type Item = &'a mut V; ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn next(&mut self) -> Option<&'a mut V> { ++ // Avoid `Option::map` because it bloats LLVM IR. ++ match self.inner.next() { ++ Some((_, v)) => Some(v), ++ None => None, ++ } ++ } ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn size_hint(&self) -> (usize, Option) { ++ self.inner.size_hint() ++ } ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn fold(self, init: B, mut f: F) -> B ++ where ++ Self: Sized, ++ F: FnMut(B, Self::Item) -> B, ++ { ++ self.inner.fold(init, |acc, (_, v)| f(acc, v)) ++ } ++} ++impl ExactSizeIterator for ValuesMut<'_, K, V> { ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn len(&self) -> usize { ++ self.inner.len() ++ } ++} ++impl FusedIterator for ValuesMut<'_, K, V> {} ++ ++impl fmt::Debug for ValuesMut<'_, K, V> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_list() ++ .entries(self.inner.iter().map(|(_, val)| val)) ++ .finish() ++ } ++} ++ ++impl<'a, K, V, A: Allocator> Iterator for Drain<'a, K, V, A> { ++ type Item = (K, V); ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn next(&mut self) -> Option<(K, V)> { ++ self.inner.next() ++ } ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn size_hint(&self) -> (usize, Option) { ++ self.inner.size_hint() ++ } ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn fold(self, init: B, f: F) -> B ++ where ++ Self: Sized, ++ F: FnMut(B, Self::Item) -> B, ++ { ++ self.inner.fold(init, f) ++ } ++} ++impl ExactSizeIterator for Drain<'_, K, V, A> { ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn len(&self) -> usize { ++ self.inner.len() ++ } ++} ++impl FusedIterator for Drain<'_, K, V, A> {} ++ ++impl fmt::Debug for Drain<'_, K, V, A> ++where ++ K: fmt::Debug, ++ V: fmt::Debug, ++ A: Allocator, ++{ ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_list().entries(self.iter()).finish() ++ } ++} ++ ++impl<'a, K, V, S, A: Allocator> Entry<'a, K, V, S, A> { ++ /// Sets the value of the entry, and returns an OccupiedEntry. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map: HashMap<&str, u32> = HashMap::new(); ++ /// let entry = map.entry("horseyland").insert(37); ++ /// ++ /// assert_eq!(entry.key(), &"horseyland"); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn insert(self, value: V) -> OccupiedEntry<'a, K, V, S, A> ++ where ++ K: Hash, ++ S: BuildHasher, ++ { ++ match self { ++ Entry::Occupied(mut entry) => { ++ entry.insert(value); ++ entry ++ } ++ Entry::Vacant(entry) => entry.insert_entry(value), ++ } ++ } ++ ++ /// Ensures a value is in the entry by inserting the default if empty, and returns ++ /// a mutable reference to the value in the entry. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map: HashMap<&str, u32> = HashMap::new(); ++ /// ++ /// // nonexistent key ++ /// map.entry("poneyland").or_insert(3); ++ /// assert_eq!(map["poneyland"], 3); ++ /// ++ /// // existing key ++ /// *map.entry("poneyland").or_insert(10) *= 2; ++ /// assert_eq!(map["poneyland"], 6); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn or_insert(self, default: V) -> &'a mut V ++ where ++ K: Hash, ++ S: BuildHasher, ++ { ++ match self { ++ Entry::Occupied(entry) => entry.into_mut(), ++ Entry::Vacant(entry) => entry.insert(default), ++ } ++ } ++ ++ /// Ensures a value is in the entry by inserting the result of the default function if empty, ++ /// and returns a mutable reference to the value in the entry. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map: HashMap<&str, u32> = HashMap::new(); ++ /// ++ /// // nonexistent key ++ /// map.entry("poneyland").or_insert_with(|| 3); ++ /// assert_eq!(map["poneyland"], 3); ++ /// ++ /// // existing key ++ /// *map.entry("poneyland").or_insert_with(|| 10) *= 2; ++ /// assert_eq!(map["poneyland"], 6); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn or_insert_with V>(self, default: F) -> &'a mut V ++ where ++ K: Hash, ++ S: BuildHasher, ++ { ++ match self { ++ Entry::Occupied(entry) => entry.into_mut(), ++ Entry::Vacant(entry) => entry.insert(default()), ++ } ++ } ++ ++ /// Ensures a value is in the entry by inserting, if empty, the result of the default function. ++ /// This method allows for generating key-derived values for insertion by providing the default ++ /// function a reference to the key that was moved during the `.entry(key)` method call. ++ /// ++ /// The reference to the moved key is provided so that cloning or copying the key is ++ /// unnecessary, unlike with `.or_insert_with(|| ... )`. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map: HashMap<&str, usize> = HashMap::new(); ++ /// ++ /// // nonexistent key ++ /// map.entry("poneyland").or_insert_with_key(|key| key.chars().count()); ++ /// assert_eq!(map["poneyland"], 9); ++ /// ++ /// // existing key ++ /// *map.entry("poneyland").or_insert_with_key(|key| key.chars().count() * 10) *= 2; ++ /// assert_eq!(map["poneyland"], 18); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn or_insert_with_key V>(self, default: F) -> &'a mut V ++ where ++ K: Hash, ++ S: BuildHasher, ++ { ++ match self { ++ Entry::Occupied(entry) => entry.into_mut(), ++ Entry::Vacant(entry) => { ++ let value = default(entry.key()); ++ entry.insert(value) ++ } ++ } ++ } ++ ++ /// Returns a reference to this entry's key. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map: HashMap<&str, u32> = HashMap::new(); ++ /// map.entry("poneyland").or_insert(3); ++ /// // existing key ++ /// assert_eq!(map.entry("poneyland").key(), &"poneyland"); ++ /// // nonexistent key ++ /// assert_eq!(map.entry("horseland").key(), &"horseland"); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn key(&self) -> &K { ++ match *self { ++ Entry::Occupied(ref entry) => entry.key(), ++ Entry::Vacant(ref entry) => entry.key(), ++ } ++ } ++ ++ /// Provides in-place mutable access to an occupied entry before any ++ /// potential inserts into the map. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map: HashMap<&str, u32> = HashMap::new(); ++ /// ++ /// map.entry("poneyland") ++ /// .and_modify(|e| { *e += 1 }) ++ /// .or_insert(42); ++ /// assert_eq!(map["poneyland"], 42); ++ /// ++ /// map.entry("poneyland") ++ /// .and_modify(|e| { *e += 1 }) ++ /// .or_insert(42); ++ /// assert_eq!(map["poneyland"], 43); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn and_modify(self, f: F) -> Self ++ where ++ F: FnOnce(&mut V), ++ { ++ match self { ++ Entry::Occupied(mut entry) => { ++ f(entry.get_mut()); ++ Entry::Occupied(entry) ++ } ++ Entry::Vacant(entry) => Entry::Vacant(entry), ++ } ++ } ++ ++ /// Provides shared access to the key and owned access to the value of ++ /// an occupied entry and allows to replace or remove it based on the ++ /// value of the returned option. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// use hashbrown::hash_map::Entry; ++ /// ++ /// let mut map: HashMap<&str, u32> = HashMap::new(); ++ /// ++ /// let entry = map ++ /// .entry("poneyland") ++ /// .and_replace_entry_with(|_k, _v| panic!()); ++ /// ++ /// match entry { ++ /// Entry::Vacant(e) => { ++ /// assert_eq!(e.key(), &"poneyland"); ++ /// } ++ /// Entry::Occupied(_) => panic!(), ++ /// } ++ /// ++ /// map.insert("poneyland", 42); ++ /// ++ /// let entry = map ++ /// .entry("poneyland") ++ /// .and_replace_entry_with(|k, v| { ++ /// assert_eq!(k, &"poneyland"); ++ /// assert_eq!(v, 42); ++ /// Some(v + 1) ++ /// }); ++ /// ++ /// match entry { ++ /// Entry::Occupied(e) => { ++ /// assert_eq!(e.key(), &"poneyland"); ++ /// assert_eq!(e.get(), &43); ++ /// } ++ /// Entry::Vacant(_) => panic!(), ++ /// } ++ /// ++ /// assert_eq!(map["poneyland"], 43); ++ /// ++ /// let entry = map ++ /// .entry("poneyland") ++ /// .and_replace_entry_with(|_k, _v| None); ++ /// ++ /// match entry { ++ /// Entry::Vacant(e) => assert_eq!(e.key(), &"poneyland"), ++ /// Entry::Occupied(_) => panic!(), ++ /// } ++ /// ++ /// assert!(!map.contains_key("poneyland")); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn and_replace_entry_with(self, f: F) -> Self ++ where ++ F: FnOnce(&K, V) -> Option, ++ { ++ match self { ++ Entry::Occupied(entry) => entry.replace_entry_with(f), ++ Entry::Vacant(_) => self, ++ } ++ } ++} ++ ++impl<'a, K, V: Default, S, A: Allocator> Entry<'a, K, V, S, A> { ++ /// Ensures a value is in the entry by inserting the default value if empty, ++ /// and returns a mutable reference to the value in the entry. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map: HashMap<&str, Option> = HashMap::new(); ++ /// ++ /// // nonexistent key ++ /// map.entry("poneyland").or_default(); ++ /// assert_eq!(map["poneyland"], None); ++ /// ++ /// map.insert("horseland", Some(3)); ++ /// ++ /// // existing key ++ /// assert_eq!(map.entry("horseland").or_default(), &mut Some(3)); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn or_default(self) -> &'a mut V ++ where ++ K: Hash, ++ S: BuildHasher, ++ { ++ match self { ++ Entry::Occupied(entry) => entry.into_mut(), ++ Entry::Vacant(entry) => entry.insert(Default::default()), ++ } ++ } ++} ++ ++impl<'a, K, V, S, A: Allocator> OccupiedEntry<'a, K, V, S, A> { ++ /// Gets a reference to the key in the entry. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::hash_map::{Entry, HashMap}; ++ /// ++ /// let mut map: HashMap<&str, u32> = HashMap::new(); ++ /// map.entry("poneyland").or_insert(12); ++ /// ++ /// match map.entry("poneyland") { ++ /// Entry::Vacant(_) => panic!(), ++ /// Entry::Occupied(entry) => assert_eq!(entry.key(), &"poneyland"), ++ /// } ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn key(&self) -> &K { ++ unsafe { &self.elem.as_ref().0 } ++ } ++ ++ /// Take the ownership of the key and value from the map. ++ /// Keeps the allocated memory for reuse. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// use hashbrown::hash_map::Entry; ++ /// ++ /// let mut map: HashMap<&str, u32> = HashMap::new(); ++ /// // The map is empty ++ /// assert!(map.is_empty() && map.capacity() == 0); ++ /// ++ /// map.entry("poneyland").or_insert(12); ++ /// ++ /// if let Entry::Occupied(o) = map.entry("poneyland") { ++ /// // We delete the entry from the map. ++ /// assert_eq!(o.remove_entry(), ("poneyland", 12)); ++ /// } ++ /// ++ /// assert_eq!(map.contains_key("poneyland"), false); ++ /// // Now map hold none elements ++ /// assert!(map.is_empty()); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn remove_entry(self) -> (K, V) { ++ unsafe { self.table.table.remove(self.elem).0 } ++ } ++ ++ /// Gets a reference to the value in the entry. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// use hashbrown::hash_map::Entry; ++ /// ++ /// let mut map: HashMap<&str, u32> = HashMap::new(); ++ /// map.entry("poneyland").or_insert(12); ++ /// ++ /// match map.entry("poneyland") { ++ /// Entry::Vacant(_) => panic!(), ++ /// Entry::Occupied(entry) => assert_eq!(entry.get(), &12), ++ /// } ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn get(&self) -> &V { ++ unsafe { &self.elem.as_ref().1 } ++ } ++ ++ /// Gets a mutable reference to the value in the entry. ++ /// ++ /// If you need a reference to the `OccupiedEntry` which may outlive the ++ /// destruction of the `Entry` value, see [`into_mut`]. ++ /// ++ /// [`into_mut`]: #method.into_mut ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// use hashbrown::hash_map::Entry; ++ /// ++ /// let mut map: HashMap<&str, u32> = HashMap::new(); ++ /// map.entry("poneyland").or_insert(12); ++ /// ++ /// assert_eq!(map["poneyland"], 12); ++ /// if let Entry::Occupied(mut o) = map.entry("poneyland") { ++ /// *o.get_mut() += 10; ++ /// assert_eq!(*o.get(), 22); ++ /// ++ /// // We can use the same Entry multiple times. ++ /// *o.get_mut() += 2; ++ /// } ++ /// ++ /// assert_eq!(map["poneyland"], 24); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn get_mut(&mut self) -> &mut V { ++ unsafe { &mut self.elem.as_mut().1 } ++ } ++ ++ /// Converts the OccupiedEntry into a mutable reference to the value in the entry ++ /// with a lifetime bound to the map itself. ++ /// ++ /// If you need multiple references to the `OccupiedEntry`, see [`get_mut`]. ++ /// ++ /// [`get_mut`]: #method.get_mut ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::hash_map::{Entry, HashMap}; ++ /// ++ /// let mut map: HashMap<&str, u32> = HashMap::new(); ++ /// map.entry("poneyland").or_insert(12); ++ /// ++ /// assert_eq!(map["poneyland"], 12); ++ /// ++ /// let value: &mut u32; ++ /// match map.entry("poneyland") { ++ /// Entry::Occupied(entry) => value = entry.into_mut(), ++ /// Entry::Vacant(_) => panic!(), ++ /// } ++ /// *value += 10; ++ /// ++ /// assert_eq!(map["poneyland"], 22); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn into_mut(self) -> &'a mut V { ++ unsafe { &mut self.elem.as_mut().1 } ++ } ++ ++ /// Sets the value of the entry, and returns the entry's old value. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// use hashbrown::hash_map::Entry; ++ /// ++ /// let mut map: HashMap<&str, u32> = HashMap::new(); ++ /// map.entry("poneyland").or_insert(12); ++ /// ++ /// if let Entry::Occupied(mut o) = map.entry("poneyland") { ++ /// assert_eq!(o.insert(15), 12); ++ /// } ++ /// ++ /// assert_eq!(map["poneyland"], 15); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn insert(&mut self, value: V) -> V { ++ mem::replace(self.get_mut(), value) ++ } ++ ++ /// Takes the value out of the entry, and returns it. ++ /// Keeps the allocated memory for reuse. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// use hashbrown::hash_map::Entry; ++ /// ++ /// let mut map: HashMap<&str, u32> = HashMap::new(); ++ /// // The map is empty ++ /// assert!(map.is_empty() && map.capacity() == 0); ++ /// ++ /// map.entry("poneyland").or_insert(12); ++ /// ++ /// if let Entry::Occupied(o) = map.entry("poneyland") { ++ /// assert_eq!(o.remove(), 12); ++ /// } ++ /// ++ /// assert_eq!(map.contains_key("poneyland"), false); ++ /// // Now map hold none elements ++ /// assert!(map.is_empty()); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn remove(self) -> V { ++ self.remove_entry().1 ++ } ++ ++ /// Replaces the entry, returning the old key and value. The new key in the hash map will be ++ /// the key used to create this entry. ++ /// ++ /// # Panics ++ /// ++ /// Will panic if this OccupiedEntry was created through [`Entry::insert`]. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::hash_map::{Entry, HashMap}; ++ /// use std::rc::Rc; ++ /// ++ /// let mut map: HashMap, u32> = HashMap::new(); ++ /// let key_one = Rc::new("Stringthing".to_string()); ++ /// let key_two = Rc::new("Stringthing".to_string()); ++ /// ++ /// map.insert(key_one.clone(), 15); ++ /// assert!(Rc::strong_count(&key_one) == 2 && Rc::strong_count(&key_two) == 1); ++ /// ++ /// match map.entry(key_two.clone()) { ++ /// Entry::Occupied(entry) => { ++ /// let (old_key, old_value): (Rc, u32) = entry.replace_entry(16); ++ /// assert!(Rc::ptr_eq(&key_one, &old_key) && old_value == 15); ++ /// } ++ /// Entry::Vacant(_) => panic!(), ++ /// } ++ /// ++ /// assert!(Rc::strong_count(&key_one) == 1 && Rc::strong_count(&key_two) == 2); ++ /// assert_eq!(map[&"Stringthing".to_owned()], 16); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn replace_entry(self, value: V) -> (K, V) { ++ let entry = unsafe { self.elem.as_mut() }; ++ ++ let old_key = mem::replace(&mut entry.0, self.key.unwrap()); ++ let old_value = mem::replace(&mut entry.1, value); ++ ++ (old_key, old_value) ++ } ++ ++ /// Replaces the key in the hash map with the key used to create this entry. ++ /// ++ /// # Panics ++ /// ++ /// Will panic if this OccupiedEntry was created through [`Entry::insert`]. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::hash_map::{Entry, HashMap}; ++ /// use std::rc::Rc; ++ /// ++ /// let mut map: HashMap, usize> = HashMap::with_capacity(6); ++ /// let mut keys_one: Vec> = Vec::with_capacity(6); ++ /// let mut keys_two: Vec> = Vec::with_capacity(6); ++ /// ++ /// for (value, key) in ["a", "b", "c", "d", "e", "f"].into_iter().enumerate() { ++ /// let rc_key = Rc::new(key.to_owned()); ++ /// keys_one.push(rc_key.clone()); ++ /// map.insert(rc_key.clone(), value); ++ /// keys_two.push(Rc::new(key.to_owned())); ++ /// } ++ /// ++ /// assert!( ++ /// keys_one.iter().all(|key| Rc::strong_count(key) == 2) ++ /// && keys_two.iter().all(|key| Rc::strong_count(key) == 1) ++ /// ); ++ /// ++ /// reclaim_memory(&mut map, &keys_two); ++ /// ++ /// assert!( ++ /// keys_one.iter().all(|key| Rc::strong_count(key) == 1) ++ /// && keys_two.iter().all(|key| Rc::strong_count(key) == 2) ++ /// ); ++ /// ++ /// fn reclaim_memory(map: &mut HashMap, usize>, keys: &[Rc]) { ++ /// for key in keys { ++ /// if let Entry::Occupied(entry) = map.entry(key.clone()) { ++ /// // Replaces the entry's key with our version of it in `keys`. ++ /// entry.replace_key(); ++ /// } ++ /// } ++ /// } ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn replace_key(self) -> K { ++ let entry = unsafe { self.elem.as_mut() }; ++ mem::replace(&mut entry.0, self.key.unwrap()) ++ } ++ ++ /// Provides shared access to the key and owned access to the value of ++ /// the entry and allows to replace or remove it based on the ++ /// value of the returned option. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// use hashbrown::hash_map::Entry; ++ /// ++ /// let mut map: HashMap<&str, u32> = HashMap::new(); ++ /// map.insert("poneyland", 42); ++ /// ++ /// let entry = match map.entry("poneyland") { ++ /// Entry::Occupied(e) => { ++ /// e.replace_entry_with(|k, v| { ++ /// assert_eq!(k, &"poneyland"); ++ /// assert_eq!(v, 42); ++ /// Some(v + 1) ++ /// }) ++ /// } ++ /// Entry::Vacant(_) => panic!(), ++ /// }; ++ /// ++ /// match entry { ++ /// Entry::Occupied(e) => { ++ /// assert_eq!(e.key(), &"poneyland"); ++ /// assert_eq!(e.get(), &43); ++ /// } ++ /// Entry::Vacant(_) => panic!(), ++ /// } ++ /// ++ /// assert_eq!(map["poneyland"], 43); ++ /// ++ /// let entry = match map.entry("poneyland") { ++ /// Entry::Occupied(e) => e.replace_entry_with(|_k, _v| None), ++ /// Entry::Vacant(_) => panic!(), ++ /// }; ++ /// ++ /// match entry { ++ /// Entry::Vacant(e) => { ++ /// assert_eq!(e.key(), &"poneyland"); ++ /// } ++ /// Entry::Occupied(_) => panic!(), ++ /// } ++ /// ++ /// assert!(!map.contains_key("poneyland")); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn replace_entry_with(self, f: F) -> Entry<'a, K, V, S, A> ++ where ++ F: FnOnce(&K, V) -> Option, ++ { ++ unsafe { ++ let mut spare_key = None; ++ ++ self.table ++ .table ++ .replace_bucket_with(self.elem.clone(), |(key, value)| { ++ if let Some(new_value) = f(&key, value) { ++ Some((key, new_value)) ++ } else { ++ spare_key = Some(key); ++ None ++ } ++ }); ++ ++ if let Some(key) = spare_key { ++ Entry::Vacant(VacantEntry { ++ hash: self.hash, ++ key, ++ table: self.table, ++ }) ++ } else { ++ Entry::Occupied(self) ++ } ++ } ++ } ++} ++ ++impl<'a, K, V, S, A: Allocator> VacantEntry<'a, K, V, S, A> { ++ /// Gets a reference to the key that would be used when inserting a value ++ /// through the `VacantEntry`. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map: HashMap<&str, u32> = HashMap::new(); ++ /// assert_eq!(map.entry("poneyland").key(), &"poneyland"); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn key(&self) -> &K { ++ &self.key ++ } ++ ++ /// Take ownership of the key. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::hash_map::{Entry, HashMap}; ++ /// ++ /// let mut map: HashMap<&str, u32> = HashMap::new(); ++ /// ++ /// match map.entry("poneyland") { ++ /// Entry::Occupied(_) => panic!(), ++ /// Entry::Vacant(v) => assert_eq!(v.into_key(), "poneyland"), ++ /// } ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn into_key(self) -> K { ++ self.key ++ } ++ ++ /// Sets the value of the entry with the VacantEntry's key, ++ /// and returns a mutable reference to it. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// use hashbrown::hash_map::Entry; ++ /// ++ /// let mut map: HashMap<&str, u32> = HashMap::new(); ++ /// ++ /// if let Entry::Vacant(o) = map.entry("poneyland") { ++ /// o.insert(37); ++ /// } ++ /// assert_eq!(map["poneyland"], 37); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn insert(self, value: V) -> &'a mut V ++ where ++ K: Hash, ++ S: BuildHasher, ++ { ++ let table = &mut self.table.table; ++ let entry = table.insert_entry( ++ self.hash, ++ (self.key, value), ++ make_hasher::<_, V, S>(&self.table.hash_builder), ++ ); ++ &mut entry.1 ++ } ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub(crate) fn insert_entry(self, value: V) -> OccupiedEntry<'a, K, V, S, A> ++ where ++ K: Hash, ++ S: BuildHasher, ++ { ++ let elem = self.table.table.insert( ++ self.hash, ++ (self.key, value), ++ make_hasher::<_, V, S>(&self.table.hash_builder), ++ ); ++ OccupiedEntry { ++ hash: self.hash, ++ key: None, ++ elem, ++ table: self.table, ++ } ++ } ++} ++ ++impl<'a, 'b, K, Q: ?Sized, V, S, A: Allocator> EntryRef<'a, 'b, K, Q, V, S, A> { ++ /// Sets the value of the entry, and returns an OccupiedEntryRef. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map: HashMap = HashMap::new(); ++ /// let entry = map.entry_ref("horseyland").insert(37); ++ /// ++ /// assert_eq!(entry.key(), "horseyland"); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn insert(self, value: V) -> OccupiedEntryRef<'a, 'b, K, Q, V, S, A> ++ where ++ K: Hash + From<&'b Q>, ++ S: BuildHasher, ++ { ++ match self { ++ EntryRef::Occupied(mut entry) => { ++ entry.insert(value); ++ entry ++ } ++ EntryRef::Vacant(entry) => entry.insert_entry(value), ++ } ++ } ++ ++ /// Ensures a value is in the entry by inserting the default if empty, and returns ++ /// a mutable reference to the value in the entry. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map: HashMap = HashMap::new(); ++ /// ++ /// // nonexistent key ++ /// map.entry_ref("poneyland").or_insert(3); ++ /// assert_eq!(map["poneyland"], 3); ++ /// ++ /// // existing key ++ /// *map.entry_ref("poneyland").or_insert(10) *= 2; ++ /// assert_eq!(map["poneyland"], 6); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn or_insert(self, default: V) -> &'a mut V ++ where ++ K: Hash + From<&'b Q>, ++ S: BuildHasher, ++ { ++ match self { ++ EntryRef::Occupied(entry) => entry.into_mut(), ++ EntryRef::Vacant(entry) => entry.insert(default), ++ } ++ } ++ ++ /// Ensures a value is in the entry by inserting the result of the default function if empty, ++ /// and returns a mutable reference to the value in the entry. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map: HashMap = HashMap::new(); ++ /// ++ /// // nonexistent key ++ /// map.entry_ref("poneyland").or_insert_with(|| 3); ++ /// assert_eq!(map["poneyland"], 3); ++ /// ++ /// // existing key ++ /// *map.entry_ref("poneyland").or_insert_with(|| 10) *= 2; ++ /// assert_eq!(map["poneyland"], 6); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn or_insert_with V>(self, default: F) -> &'a mut V ++ where ++ K: Hash + From<&'b Q>, ++ S: BuildHasher, ++ { ++ match self { ++ EntryRef::Occupied(entry) => entry.into_mut(), ++ EntryRef::Vacant(entry) => entry.insert(default()), ++ } ++ } ++ ++ /// Ensures a value is in the entry by inserting, if empty, the result of the default function. ++ /// This method allows for generating key-derived values for insertion by providing the default ++ /// function an access to the borrower form of the key. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map: HashMap = HashMap::new(); ++ /// ++ /// // nonexistent key ++ /// map.entry_ref("poneyland").or_insert_with_key(|key| key.chars().count()); ++ /// assert_eq!(map["poneyland"], 9); ++ /// ++ /// // existing key ++ /// *map.entry_ref("poneyland").or_insert_with_key(|key| key.chars().count() * 10) *= 2; ++ /// assert_eq!(map["poneyland"], 18); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn or_insert_with_key V>(self, default: F) -> &'a mut V ++ where ++ K: Hash + Borrow + From<&'b Q>, ++ S: BuildHasher, ++ { ++ match self { ++ EntryRef::Occupied(entry) => entry.into_mut(), ++ EntryRef::Vacant(entry) => { ++ let value = default(entry.key.as_ref()); ++ entry.insert(value) ++ } ++ } ++ } ++ ++ /// Returns a reference to this entry's key. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map: HashMap = HashMap::new(); ++ /// map.entry_ref("poneyland").or_insert(3); ++ /// // existing key ++ /// assert_eq!(map.entry_ref("poneyland").key(), "poneyland"); ++ /// // nonexistent key ++ /// assert_eq!(map.entry_ref("horseland").key(), "horseland"); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn key(&self) -> &Q ++ where ++ K: Borrow, ++ { ++ match *self { ++ EntryRef::Occupied(ref entry) => entry.key().borrow(), ++ EntryRef::Vacant(ref entry) => entry.key(), ++ } ++ } ++ ++ /// Provides in-place mutable access to an occupied entry before any ++ /// potential inserts into the map. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map: HashMap = HashMap::new(); ++ /// ++ /// map.entry_ref("poneyland") ++ /// .and_modify(|e| { *e += 1 }) ++ /// .or_insert(42); ++ /// assert_eq!(map["poneyland"], 42); ++ /// ++ /// map.entry_ref("poneyland") ++ /// .and_modify(|e| { *e += 1 }) ++ /// .or_insert(42); ++ /// assert_eq!(map["poneyland"], 43); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn and_modify(self, f: F) -> Self ++ where ++ F: FnOnce(&mut V), ++ { ++ match self { ++ EntryRef::Occupied(mut entry) => { ++ f(entry.get_mut()); ++ EntryRef::Occupied(entry) ++ } ++ EntryRef::Vacant(entry) => EntryRef::Vacant(entry), ++ } ++ } ++ ++ /// Provides shared access to the key and owned access to the value of ++ /// an occupied entry and allows to replace or remove it based on the ++ /// value of the returned option. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// use hashbrown::hash_map::EntryRef; ++ /// ++ /// let mut map: HashMap = HashMap::new(); ++ /// ++ /// let entry = map ++ /// .entry_ref("poneyland") ++ /// .and_replace_entry_with(|_k, _v| panic!()); ++ /// ++ /// match entry { ++ /// EntryRef::Vacant(e) => { ++ /// assert_eq!(e.key(), "poneyland"); ++ /// } ++ /// EntryRef::Occupied(_) => panic!(), ++ /// } ++ /// ++ /// map.insert("poneyland".to_string(), 42); ++ /// ++ /// let entry = map ++ /// .entry_ref("poneyland") ++ /// .and_replace_entry_with(|k, v| { ++ /// assert_eq!(k, "poneyland"); ++ /// assert_eq!(v, 42); ++ /// Some(v + 1) ++ /// }); ++ /// ++ /// match entry { ++ /// EntryRef::Occupied(e) => { ++ /// assert_eq!(e.key(), "poneyland"); ++ /// assert_eq!(e.get(), &43); ++ /// } ++ /// EntryRef::Vacant(_) => panic!(), ++ /// } ++ /// ++ /// assert_eq!(map["poneyland"], 43); ++ /// ++ /// let entry = map ++ /// .entry_ref("poneyland") ++ /// .and_replace_entry_with(|_k, _v| None); ++ /// ++ /// match entry { ++ /// EntryRef::Vacant(e) => assert_eq!(e.key(), "poneyland"), ++ /// EntryRef::Occupied(_) => panic!(), ++ /// } ++ /// ++ /// assert!(!map.contains_key("poneyland")); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn and_replace_entry_with(self, f: F) -> Self ++ where ++ F: FnOnce(&K, V) -> Option, ++ { ++ match self { ++ EntryRef::Occupied(entry) => entry.replace_entry_with(f), ++ EntryRef::Vacant(_) => self, ++ } ++ } ++} ++ ++impl<'a, 'b, K, Q: ?Sized, V: Default, S, A: Allocator> EntryRef<'a, 'b, K, Q, V, S, A> { ++ /// Ensures a value is in the entry by inserting the default value if empty, ++ /// and returns a mutable reference to the value in the entry. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map: HashMap> = HashMap::new(); ++ /// ++ /// // nonexistent key ++ /// map.entry_ref("poneyland").or_default(); ++ /// assert_eq!(map["poneyland"], None); ++ /// ++ /// map.insert("horseland".to_string(), Some(3)); ++ /// ++ /// // existing key ++ /// assert_eq!(map.entry_ref("horseland").or_default(), &mut Some(3)); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn or_default(self) -> &'a mut V ++ where ++ K: Hash + From<&'b Q>, ++ S: BuildHasher, ++ { ++ match self { ++ EntryRef::Occupied(entry) => entry.into_mut(), ++ EntryRef::Vacant(entry) => entry.insert(Default::default()), ++ } ++ } ++} ++ ++impl<'a, 'b, K, Q: ?Sized, V, S, A: Allocator> OccupiedEntryRef<'a, 'b, K, Q, V, S, A> { ++ /// Gets a reference to the key in the entry. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::hash_map::{EntryRef, HashMap}; ++ /// ++ /// let mut map: HashMap = HashMap::new(); ++ /// map.entry_ref("poneyland").or_insert(12); ++ /// ++ /// match map.entry_ref("poneyland") { ++ /// EntryRef::Vacant(_) => panic!(), ++ /// EntryRef::Occupied(entry) => assert_eq!(entry.key(), "poneyland"), ++ /// } ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn key(&self) -> &K { ++ unsafe { &self.elem.as_ref().0 } ++ } ++ ++ /// Take the ownership of the key and value from the map. ++ /// Keeps the allocated memory for reuse. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// use hashbrown::hash_map::EntryRef; ++ /// ++ /// let mut map: HashMap = HashMap::new(); ++ /// // The map is empty ++ /// assert!(map.is_empty() && map.capacity() == 0); ++ /// ++ /// map.entry_ref("poneyland").or_insert(12); ++ /// ++ /// if let EntryRef::Occupied(o) = map.entry_ref("poneyland") { ++ /// // We delete the entry from the map. ++ /// assert_eq!(o.remove_entry(), ("poneyland".to_owned(), 12)); ++ /// } ++ /// ++ /// assert_eq!(map.contains_key("poneyland"), false); ++ /// // Now map hold none elements but capacity is equal to the old one ++ /// assert!(map.is_empty()); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn remove_entry(self) -> (K, V) { ++ unsafe { self.table.table.remove(self.elem).0 } ++ } ++ ++ /// Gets a reference to the value in the entry. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// use hashbrown::hash_map::EntryRef; ++ /// ++ /// let mut map: HashMap = HashMap::new(); ++ /// map.entry_ref("poneyland").or_insert(12); ++ /// ++ /// match map.entry_ref("poneyland") { ++ /// EntryRef::Vacant(_) => panic!(), ++ /// EntryRef::Occupied(entry) => assert_eq!(entry.get(), &12), ++ /// } ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn get(&self) -> &V { ++ unsafe { &self.elem.as_ref().1 } ++ } ++ ++ /// Gets a mutable reference to the value in the entry. ++ /// ++ /// If you need a reference to the `OccupiedEntryRef` which may outlive the ++ /// destruction of the `EntryRef` value, see [`into_mut`]. ++ /// ++ /// [`into_mut`]: #method.into_mut ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// use hashbrown::hash_map::EntryRef; ++ /// ++ /// let mut map: HashMap = HashMap::new(); ++ /// map.entry_ref("poneyland").or_insert(12); ++ /// ++ /// assert_eq!(map["poneyland"], 12); ++ /// if let EntryRef::Occupied(mut o) = map.entry_ref("poneyland") { ++ /// *o.get_mut() += 10; ++ /// assert_eq!(*o.get(), 22); ++ /// ++ /// // We can use the same Entry multiple times. ++ /// *o.get_mut() += 2; ++ /// } ++ /// ++ /// assert_eq!(map["poneyland"], 24); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn get_mut(&mut self) -> &mut V { ++ unsafe { &mut self.elem.as_mut().1 } ++ } ++ ++ /// Converts the OccupiedEntryRef into a mutable reference to the value in the entry ++ /// with a lifetime bound to the map itself. ++ /// ++ /// If you need multiple references to the `OccupiedEntryRef`, see [`get_mut`]. ++ /// ++ /// [`get_mut`]: #method.get_mut ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::hash_map::{EntryRef, HashMap}; ++ /// ++ /// let mut map: HashMap = HashMap::new(); ++ /// map.entry_ref("poneyland").or_insert(12); ++ /// ++ /// let value: &mut u32; ++ /// match map.entry_ref("poneyland") { ++ /// EntryRef::Occupied(entry) => value = entry.into_mut(), ++ /// EntryRef::Vacant(_) => panic!(), ++ /// } ++ /// *value += 10; ++ /// ++ /// assert_eq!(map["poneyland"], 22); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn into_mut(self) -> &'a mut V { ++ unsafe { &mut self.elem.as_mut().1 } ++ } ++ ++ /// Sets the value of the entry, and returns the entry's old value. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// use hashbrown::hash_map::EntryRef; ++ /// ++ /// let mut map: HashMap = HashMap::new(); ++ /// map.entry_ref("poneyland").or_insert(12); ++ /// ++ /// if let EntryRef::Occupied(mut o) = map.entry_ref("poneyland") { ++ /// assert_eq!(o.insert(15), 12); ++ /// } ++ /// ++ /// assert_eq!(map["poneyland"], 15); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn insert(&mut self, value: V) -> V { ++ mem::replace(self.get_mut(), value) ++ } ++ ++ /// Takes the value out of the entry, and returns it. ++ /// Keeps the allocated memory for reuse. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// use hashbrown::hash_map::EntryRef; ++ /// ++ /// let mut map: HashMap = HashMap::new(); ++ /// // The map is empty ++ /// assert!(map.is_empty() && map.capacity() == 0); ++ /// ++ /// map.entry_ref("poneyland").or_insert(12); ++ /// ++ /// if let EntryRef::Occupied(o) = map.entry_ref("poneyland") { ++ /// assert_eq!(o.remove(), 12); ++ /// } ++ /// ++ /// assert_eq!(map.contains_key("poneyland"), false); ++ /// // Now map hold none elements but capacity is equal to the old one ++ /// assert!(map.is_empty()); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn remove(self) -> V { ++ self.remove_entry().1 ++ } ++ ++ /// Replaces the entry, returning the old key and value. The new key in the hash map will be ++ /// the key used to create this entry. ++ /// ++ /// # Panics ++ /// ++ /// Will panic if this OccupiedEntryRef was created through [`EntryRef::insert`]. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::hash_map::{EntryRef, HashMap}; ++ /// use std::rc::Rc; ++ /// ++ /// let mut map: HashMap, u32> = HashMap::new(); ++ /// let key: Rc = Rc::from("Stringthing"); ++ /// ++ /// map.insert(key.clone(), 15); ++ /// assert_eq!(Rc::strong_count(&key), 2); ++ /// ++ /// match map.entry_ref("Stringthing") { ++ /// EntryRef::Occupied(entry) => { ++ /// let (old_key, old_value): (Rc, u32) = entry.replace_entry(16); ++ /// assert!(Rc::ptr_eq(&key, &old_key) && old_value == 15); ++ /// } ++ /// EntryRef::Vacant(_) => panic!(), ++ /// } ++ /// ++ /// assert_eq!(Rc::strong_count(&key), 1); ++ /// assert_eq!(map["Stringthing"], 16); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn replace_entry(self, value: V) -> (K, V) ++ where ++ K: From<&'b Q>, ++ { ++ let entry = unsafe { self.elem.as_mut() }; ++ ++ let old_key = mem::replace(&mut entry.0, self.key.unwrap().into_owned()); ++ let old_value = mem::replace(&mut entry.1, value); ++ ++ (old_key, old_value) ++ } ++ ++ /// Replaces the key in the hash map with the key used to create this entry. ++ /// ++ /// # Panics ++ /// ++ /// Will panic if this OccupiedEntryRef was created through [`EntryRef::insert`]. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::hash_map::{EntryRef, HashMap}; ++ /// use std::rc::Rc; ++ /// ++ /// let mut map: HashMap, usize> = HashMap::with_capacity(6); ++ /// let mut keys: Vec> = Vec::with_capacity(6); ++ /// ++ /// for (value, key) in ["a", "b", "c", "d", "e", "f"].into_iter().enumerate() { ++ /// let rc_key: Rc = Rc::from(key); ++ /// keys.push(rc_key.clone()); ++ /// map.insert(rc_key.clone(), value); ++ /// } ++ /// ++ /// assert!(keys.iter().all(|key| Rc::strong_count(key) == 2)); ++ /// ++ /// // It doesn't matter that we kind of use a vector with the same keys, ++ /// // because all keys will be newly created from the references ++ /// reclaim_memory(&mut map, &keys); ++ /// ++ /// assert!(keys.iter().all(|key| Rc::strong_count(key) == 1)); ++ /// ++ /// fn reclaim_memory(map: &mut HashMap, usize>, keys: &[Rc]) { ++ /// for key in keys { ++ /// if let EntryRef::Occupied(entry) = map.entry_ref(key.as_ref()) { ++ /// // Replaces the entry's key with our version of it in `keys`. ++ /// entry.replace_key(); ++ /// } ++ /// } ++ /// } ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn replace_key(self) -> K ++ where ++ K: From<&'b Q>, ++ { ++ let entry = unsafe { self.elem.as_mut() }; ++ mem::replace(&mut entry.0, self.key.unwrap().into_owned()) ++ } ++ ++ /// Provides shared access to the key and owned access to the value of ++ /// the entry and allows to replace or remove it based on the ++ /// value of the returned option. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// use hashbrown::hash_map::EntryRef; ++ /// ++ /// let mut map: HashMap = HashMap::new(); ++ /// map.insert("poneyland".to_string(), 42); ++ /// ++ /// let entry = match map.entry_ref("poneyland") { ++ /// EntryRef::Occupied(e) => { ++ /// e.replace_entry_with(|k, v| { ++ /// assert_eq!(k, "poneyland"); ++ /// assert_eq!(v, 42); ++ /// Some(v + 1) ++ /// }) ++ /// } ++ /// EntryRef::Vacant(_) => panic!(), ++ /// }; ++ /// ++ /// match entry { ++ /// EntryRef::Occupied(e) => { ++ /// assert_eq!(e.key(), "poneyland"); ++ /// assert_eq!(e.get(), &43); ++ /// } ++ /// EntryRef::Vacant(_) => panic!(), ++ /// } ++ /// ++ /// assert_eq!(map["poneyland"], 43); ++ /// ++ /// let entry = match map.entry_ref("poneyland") { ++ /// EntryRef::Occupied(e) => e.replace_entry_with(|_k, _v| None), ++ /// EntryRef::Vacant(_) => panic!(), ++ /// }; ++ /// ++ /// match entry { ++ /// EntryRef::Vacant(e) => { ++ /// assert_eq!(e.key(), "poneyland"); ++ /// } ++ /// EntryRef::Occupied(_) => panic!(), ++ /// } ++ /// ++ /// assert!(!map.contains_key("poneyland")); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn replace_entry_with(self, f: F) -> EntryRef<'a, 'b, K, Q, V, S, A> ++ where ++ F: FnOnce(&K, V) -> Option, ++ { ++ unsafe { ++ let mut spare_key = None; ++ ++ self.table ++ .table ++ .replace_bucket_with(self.elem.clone(), |(key, value)| { ++ if let Some(new_value) = f(&key, value) { ++ Some((key, new_value)) ++ } else { ++ spare_key = Some(KeyOrRef::Owned(key)); ++ None ++ } ++ }); ++ ++ if let Some(key) = spare_key { ++ EntryRef::Vacant(VacantEntryRef { ++ hash: self.hash, ++ key, ++ table: self.table, ++ }) ++ } else { ++ EntryRef::Occupied(self) ++ } ++ } ++ } ++} ++ ++impl<'a, 'b, K, Q: ?Sized, V, S, A: Allocator> VacantEntryRef<'a, 'b, K, Q, V, S, A> { ++ /// Gets a reference to the key that would be used when inserting a value ++ /// through the `VacantEntryRef`. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map: HashMap = HashMap::new(); ++ /// let key: &str = "poneyland"; ++ /// assert_eq!(map.entry_ref(key).key(), "poneyland"); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn key(&self) -> &Q ++ where ++ K: Borrow, ++ { ++ self.key.as_ref() ++ } ++ ++ /// Take ownership of the key. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::hash_map::{EntryRef, HashMap}; ++ /// ++ /// let mut map: HashMap = HashMap::new(); ++ /// let key: &str = "poneyland"; ++ /// ++ /// match map.entry_ref(key) { ++ /// EntryRef::Occupied(_) => panic!(), ++ /// EntryRef::Vacant(v) => assert_eq!(v.into_key(), "poneyland".to_owned()), ++ /// } ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn into_key(self) -> K ++ where ++ K: From<&'b Q>, ++ { ++ self.key.into_owned() ++ } ++ ++ /// Sets the value of the entry with the VacantEntryRef's key, ++ /// and returns a mutable reference to it. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// use hashbrown::hash_map::EntryRef; ++ /// ++ /// let mut map: HashMap = HashMap::new(); ++ /// let key: &str = "poneyland"; ++ /// ++ /// if let EntryRef::Vacant(o) = map.entry_ref(key) { ++ /// o.insert(37); ++ /// } ++ /// assert_eq!(map["poneyland"], 37); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn insert(self, value: V) -> &'a mut V ++ where ++ K: Hash + From<&'b Q>, ++ S: BuildHasher, ++ { ++ let table = &mut self.table.table; ++ let entry = table.insert_entry( ++ self.hash, ++ (self.key.into_owned(), value), ++ make_hasher::<_, V, S>(&self.table.hash_builder), ++ ); ++ &mut entry.1 ++ } ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn insert_entry(self, value: V) -> OccupiedEntryRef<'a, 'b, K, Q, V, S, A> ++ where ++ K: Hash + From<&'b Q>, ++ S: BuildHasher, ++ { ++ let elem = self.table.table.insert( ++ self.hash, ++ (self.key.into_owned(), value), ++ make_hasher::<_, V, S>(&self.table.hash_builder), ++ ); ++ OccupiedEntryRef { ++ hash: self.hash, ++ key: None, ++ elem, ++ table: self.table, ++ } ++ } ++} ++ ++impl FromIterator<(K, V)> for HashMap ++where ++ K: Eq + Hash, ++ S: BuildHasher + Default, ++ A: Default + Allocator, ++{ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn from_iter>(iter: T) -> Self { ++ let iter = iter.into_iter(); ++ let mut map = ++ Self::with_capacity_and_hasher_in(iter.size_hint().0, S::default(), A::default()); ++ iter.for_each(|(k, v)| { ++ map.insert(k, v); ++ }); ++ map ++ } ++} ++ ++/// Inserts all new key-values from the iterator and replaces values with existing ++/// keys with new values returned from the iterator. ++impl Extend<(K, V)> for HashMap ++where ++ K: Eq + Hash, ++ S: BuildHasher, ++ A: Allocator, ++{ ++ /// Inserts all new key-values from the iterator to existing `HashMap`. ++ /// Replace values with existing keys with new values returned from the iterator. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::hash_map::HashMap; ++ /// ++ /// let mut map = HashMap::new(); ++ /// map.insert(1, 100); ++ /// ++ /// let some_iter = [(1, 1), (2, 2)].into_iter(); ++ /// map.extend(some_iter); ++ /// // Replace values with existing keys with new values returned from the iterator. ++ /// // So that the map.get(&1) doesn't return Some(&100). ++ /// assert_eq!(map.get(&1), Some(&1)); ++ /// ++ /// let some_vec: Vec<_> = vec![(3, 3), (4, 4)]; ++ /// map.extend(some_vec); ++ /// ++ /// let some_arr = [(5, 5), (6, 6)]; ++ /// map.extend(some_arr); ++ /// let old_map_len = map.len(); ++ /// ++ /// // You can also extend from another HashMap ++ /// let mut new_map = HashMap::new(); ++ /// new_map.extend(map); ++ /// assert_eq!(new_map.len(), old_map_len); ++ /// ++ /// let mut vec: Vec<_> = new_map.into_iter().collect(); ++ /// // The `IntoIter` iterator produces items in arbitrary order, so the ++ /// // items must be sorted to test them against a sorted array. ++ /// vec.sort_unstable(); ++ /// assert_eq!(vec, [(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6)]); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn extend>(&mut self, iter: T) { ++ // Keys may be already present or show multiple times in the iterator. ++ // Reserve the entire hint lower bound if the map is empty. ++ // Otherwise reserve half the hint (rounded up), so the map ++ // will only resize twice in the worst case. ++ let iter = iter.into_iter(); ++ let reserve = if self.is_empty() { ++ iter.size_hint().0 ++ } else { ++ (iter.size_hint().0 + 1) / 2 ++ }; ++ self.reserve(reserve); ++ iter.for_each(move |(k, v)| { ++ self.insert(k, v); ++ }); ++ } ++ ++ #[inline] ++ #[cfg(feature = "nightly")] ++ fn extend_one(&mut self, (k, v): (K, V)) { ++ self.insert(k, v); ++ } ++ ++ #[inline] ++ #[cfg(feature = "nightly")] ++ fn extend_reserve(&mut self, additional: usize) { ++ // Keys may be already present or show multiple times in the iterator. ++ // Reserve the entire hint lower bound if the map is empty. ++ // Otherwise reserve half the hint (rounded up), so the map ++ // will only resize twice in the worst case. ++ let reserve = if self.is_empty() { ++ additional ++ } else { ++ (additional + 1) / 2 ++ }; ++ self.reserve(reserve); ++ } ++} ++ ++/// Inserts all new key-values from the iterator and replaces values with existing ++/// keys with new values returned from the iterator. ++impl<'a, K, V, S, A> Extend<(&'a K, &'a V)> for HashMap ++where ++ K: Eq + Hash + Copy, ++ V: Copy, ++ S: BuildHasher, ++ A: Allocator, ++{ ++ /// Inserts all new key-values from the iterator to existing `HashMap`. ++ /// Replace values with existing keys with new values returned from the iterator. ++ /// The keys and values must implement [`Copy`] trait. ++ /// ++ /// [`Copy`]: https://doc.rust-lang.org/core/marker/trait.Copy.html ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::hash_map::HashMap; ++ /// ++ /// let mut map = HashMap::new(); ++ /// map.insert(1, 100); ++ /// ++ /// let arr = [(1, 1), (2, 2)]; ++ /// let some_iter = arr.iter().map(|(k, v)| (k, v)); ++ /// map.extend(some_iter); ++ /// // Replace values with existing keys with new values returned from the iterator. ++ /// // So that the map.get(&1) doesn't return Some(&100). ++ /// assert_eq!(map.get(&1), Some(&1)); ++ /// ++ /// let some_vec: Vec<_> = vec![(3, 3), (4, 4)]; ++ /// map.extend(some_vec.iter().map(|(k, v)| (k, v))); ++ /// ++ /// let some_arr = [(5, 5), (6, 6)]; ++ /// map.extend(some_arr.iter().map(|(k, v)| (k, v))); ++ /// ++ /// // You can also extend from another HashMap ++ /// let mut new_map = HashMap::new(); ++ /// new_map.extend(&map); ++ /// assert_eq!(new_map, map); ++ /// ++ /// let mut vec: Vec<_> = new_map.into_iter().collect(); ++ /// // The `IntoIter` iterator produces items in arbitrary order, so the ++ /// // items must be sorted to test them against a sorted array. ++ /// vec.sort_unstable(); ++ /// assert_eq!(vec, [(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6)]); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn extend>(&mut self, iter: T) { ++ self.extend(iter.into_iter().map(|(&key, &value)| (key, value))); ++ } ++ ++ #[inline] ++ #[cfg(feature = "nightly")] ++ fn extend_one(&mut self, (k, v): (&'a K, &'a V)) { ++ self.insert(*k, *v); ++ } ++ ++ #[inline] ++ #[cfg(feature = "nightly")] ++ fn extend_reserve(&mut self, additional: usize) { ++ Extend::<(K, V)>::extend_reserve(self, additional); ++ } ++} ++ ++/// Inserts all new key-values from the iterator and replaces values with existing ++/// keys with new values returned from the iterator. ++impl<'a, K, V, S, A> Extend<&'a (K, V)> for HashMap ++where ++ K: Eq + Hash + Copy, ++ V: Copy, ++ S: BuildHasher, ++ A: Allocator, ++{ ++ /// Inserts all new key-values from the iterator to existing `HashMap`. ++ /// Replace values with existing keys with new values returned from the iterator. ++ /// The keys and values must implement [`Copy`] trait. ++ /// ++ /// [`Copy`]: https://doc.rust-lang.org/core/marker/trait.Copy.html ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::hash_map::HashMap; ++ /// ++ /// let mut map = HashMap::new(); ++ /// map.insert(1, 100); ++ /// ++ /// let arr = [(1, 1), (2, 2)]; ++ /// let some_iter = arr.iter(); ++ /// map.extend(some_iter); ++ /// // Replace values with existing keys with new values returned from the iterator. ++ /// // So that the map.get(&1) doesn't return Some(&100). ++ /// assert_eq!(map.get(&1), Some(&1)); ++ /// ++ /// let some_vec: Vec<_> = vec![(3, 3), (4, 4)]; ++ /// map.extend(&some_vec); ++ /// ++ /// let some_arr = [(5, 5), (6, 6)]; ++ /// map.extend(&some_arr); ++ /// ++ /// let mut vec: Vec<_> = map.into_iter().collect(); ++ /// // The `IntoIter` iterator produces items in arbitrary order, so the ++ /// // items must be sorted to test them against a sorted array. ++ /// vec.sort_unstable(); ++ /// assert_eq!(vec, [(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6)]); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn extend>(&mut self, iter: T) { ++ self.extend(iter.into_iter().map(|&(key, value)| (key, value))); ++ } ++ ++ #[inline] ++ #[cfg(feature = "nightly")] ++ fn extend_one(&mut self, &(k, v): &'a (K, V)) { ++ self.insert(k, v); ++ } ++ ++ #[inline] ++ #[cfg(feature = "nightly")] ++ fn extend_reserve(&mut self, additional: usize) { ++ Extend::<(K, V)>::extend_reserve(self, additional); ++ } ++} ++ ++#[allow(dead_code)] ++fn assert_covariance() { ++ fn map_key<'new>(v: HashMap<&'static str, u8>) -> HashMap<&'new str, u8> { ++ v ++ } ++ fn map_val<'new>(v: HashMap) -> HashMap { ++ v ++ } ++ fn iter_key<'a, 'new>(v: Iter<'a, &'static str, u8>) -> Iter<'a, &'new str, u8> { ++ v ++ } ++ fn iter_val<'a, 'new>(v: Iter<'a, u8, &'static str>) -> Iter<'a, u8, &'new str> { ++ v ++ } ++ fn into_iter_key<'new, A: Allocator>( ++ v: IntoIter<&'static str, u8, A>, ++ ) -> IntoIter<&'new str, u8, A> { ++ v ++ } ++ fn into_iter_val<'new, A: Allocator>( ++ v: IntoIter, ++ ) -> IntoIter { ++ v ++ } ++ fn keys_key<'a, 'new>(v: Keys<'a, &'static str, u8>) -> Keys<'a, &'new str, u8> { ++ v ++ } ++ fn keys_val<'a, 'new>(v: Keys<'a, u8, &'static str>) -> Keys<'a, u8, &'new str> { ++ v ++ } ++ fn values_key<'a, 'new>(v: Values<'a, &'static str, u8>) -> Values<'a, &'new str, u8> { ++ v ++ } ++ fn values_val<'a, 'new>(v: Values<'a, u8, &'static str>) -> Values<'a, u8, &'new str> { ++ v ++ } ++ fn drain<'new>( ++ d: Drain<'static, &'static str, &'static str>, ++ ) -> Drain<'new, &'new str, &'new str> { ++ d ++ } ++} ++ ++#[cfg(test)] ++mod test_map { ++ use super::DefaultHashBuilder; ++ use super::Entry::{Occupied, Vacant}; ++ use super::EntryRef; ++ use super::{HashMap, RawEntryMut}; ++ use alloc::string::{String, ToString}; ++ use alloc::sync::Arc; ++ #[cfg(feature="allocator-api2")] ++ use allocator_api2::alloc::{AllocError, Allocator, Global}; ++ use core::alloc::Layout; ++ use core::ptr::NonNull; ++ use core::sync::atomic::{AtomicI8, Ordering}; ++ use rand::{rngs::SmallRng, Rng, SeedableRng}; ++ use std::borrow::ToOwned; ++ use std::cell::RefCell; ++ use std::usize; ++ use std::vec::Vec; ++ ++ #[test] ++ fn test_zero_capacities() { ++ type HM = HashMap; ++ ++ let m = HM::new(); ++ assert_eq!(m.capacity(), 0); ++ ++ let m = HM::default(); ++ assert_eq!(m.capacity(), 0); ++ ++ let m = HM::with_hasher(DefaultHashBuilder::default()); ++ assert_eq!(m.capacity(), 0); ++ ++ let m = HM::with_capacity(0); ++ assert_eq!(m.capacity(), 0); ++ ++ let m = HM::with_capacity_and_hasher(0, DefaultHashBuilder::default()); ++ assert_eq!(m.capacity(), 0); ++ ++ let mut m = HM::new(); ++ m.insert(1, 1); ++ m.insert(2, 2); ++ m.remove(&1); ++ m.remove(&2); ++ m.shrink_to_fit(); ++ assert_eq!(m.capacity(), 0); ++ ++ let mut m = HM::new(); ++ m.reserve(0); ++ assert_eq!(m.capacity(), 0); ++ } ++ ++ #[test] ++ fn test_create_capacity_zero() { ++ let mut m = HashMap::with_capacity(0); ++ ++ assert!(m.insert(1, 1).is_none()); ++ ++ assert!(m.contains_key(&1)); ++ assert!(!m.contains_key(&0)); ++ } ++ ++ #[test] ++ fn test_insert() { ++ let mut m = HashMap::new(); ++ assert_eq!(m.len(), 0); ++ assert!(m.insert(1, 2).is_none()); ++ assert_eq!(m.len(), 1); ++ assert!(m.insert(2, 4).is_none()); ++ assert_eq!(m.len(), 2); ++ assert_eq!(*m.get(&1).unwrap(), 2); ++ assert_eq!(*m.get(&2).unwrap(), 4); ++ } ++ ++ #[test] ++ fn test_clone() { ++ let mut m = HashMap::new(); ++ assert_eq!(m.len(), 0); ++ assert!(m.insert(1, 2).is_none()); ++ assert_eq!(m.len(), 1); ++ assert!(m.insert(2, 4).is_none()); ++ assert_eq!(m.len(), 2); ++ #[allow(clippy::redundant_clone)] ++ let m2 = m.clone(); ++ assert_eq!(*m2.get(&1).unwrap(), 2); ++ assert_eq!(*m2.get(&2).unwrap(), 4); ++ assert_eq!(m2.len(), 2); ++ } ++ ++ #[test] ++ fn test_clone_from() { ++ let mut m = HashMap::new(); ++ let mut m2 = HashMap::new(); ++ assert_eq!(m.len(), 0); ++ assert!(m.insert(1, 2).is_none()); ++ assert_eq!(m.len(), 1); ++ assert!(m.insert(2, 4).is_none()); ++ assert_eq!(m.len(), 2); ++ m2.clone_from(&m); ++ assert_eq!(*m2.get(&1).unwrap(), 2); ++ assert_eq!(*m2.get(&2).unwrap(), 4); ++ assert_eq!(m2.len(), 2); ++ } ++ ++ thread_local! { static DROP_VECTOR: RefCell> = const { RefCell::new(Vec::new()) } } ++ ++ #[derive(Hash, PartialEq, Eq)] ++ struct Droppable { ++ k: usize, ++ } ++ ++ impl Droppable { ++ fn new(k: usize) -> Droppable { ++ DROP_VECTOR.with(|slot| { ++ slot.borrow_mut()[k] += 1; ++ }); ++ ++ Droppable { k } ++ } ++ } ++ ++ impl Drop for Droppable { ++ fn drop(&mut self) { ++ DROP_VECTOR.with(|slot| { ++ slot.borrow_mut()[self.k] -= 1; ++ }); ++ } ++ } ++ ++ impl Clone for Droppable { ++ fn clone(&self) -> Self { ++ Droppable::new(self.k) ++ } ++ } ++ ++ #[test] ++ fn test_drops() { ++ DROP_VECTOR.with(|slot| { ++ *slot.borrow_mut() = vec![0; 200]; ++ }); ++ ++ { ++ let mut m = HashMap::new(); ++ ++ DROP_VECTOR.with(|v| { ++ for i in 0..200 { ++ assert_eq!(v.borrow()[i], 0); ++ } ++ }); ++ ++ for i in 0..100 { ++ let d1 = Droppable::new(i); ++ let d2 = Droppable::new(i + 100); ++ m.insert(d1, d2); ++ } ++ ++ DROP_VECTOR.with(|v| { ++ for i in 0..200 { ++ assert_eq!(v.borrow()[i], 1); ++ } ++ }); ++ ++ for i in 0..50 { ++ let k = Droppable::new(i); ++ let v = m.remove(&k); ++ ++ assert!(v.is_some()); ++ ++ DROP_VECTOR.with(|v| { ++ assert_eq!(v.borrow()[i], 1); ++ assert_eq!(v.borrow()[i + 100], 1); ++ }); ++ } ++ ++ DROP_VECTOR.with(|v| { ++ for i in 0..50 { ++ assert_eq!(v.borrow()[i], 0); ++ assert_eq!(v.borrow()[i + 100], 0); ++ } ++ ++ for i in 50..100 { ++ assert_eq!(v.borrow()[i], 1); ++ assert_eq!(v.borrow()[i + 100], 1); ++ } ++ }); ++ } ++ ++ DROP_VECTOR.with(|v| { ++ for i in 0..200 { ++ assert_eq!(v.borrow()[i], 0); ++ } ++ }); ++ } ++ ++ #[test] ++ fn test_into_iter_drops() { ++ DROP_VECTOR.with(|v| { ++ *v.borrow_mut() = vec![0; 200]; ++ }); ++ ++ let hm = { ++ let mut hm = HashMap::new(); ++ ++ DROP_VECTOR.with(|v| { ++ for i in 0..200 { ++ assert_eq!(v.borrow()[i], 0); ++ } ++ }); ++ ++ for i in 0..100 { ++ let d1 = Droppable::new(i); ++ let d2 = Droppable::new(i + 100); ++ hm.insert(d1, d2); ++ } ++ ++ DROP_VECTOR.with(|v| { ++ for i in 0..200 { ++ assert_eq!(v.borrow()[i], 1); ++ } ++ }); ++ ++ hm ++ }; ++ ++ // By the way, ensure that cloning doesn't screw up the dropping. ++ drop(hm.clone()); ++ ++ { ++ let mut half = hm.into_iter().take(50); ++ ++ DROP_VECTOR.with(|v| { ++ for i in 0..200 { ++ assert_eq!(v.borrow()[i], 1); ++ } ++ }); ++ ++ for _ in half.by_ref() {} ++ ++ DROP_VECTOR.with(|v| { ++ let nk = (0..100).filter(|&i| v.borrow()[i] == 1).count(); ++ ++ let nv = (0..100).filter(|&i| v.borrow()[i + 100] == 1).count(); ++ ++ assert_eq!(nk, 50); ++ assert_eq!(nv, 50); ++ }); ++ }; ++ ++ DROP_VECTOR.with(|v| { ++ for i in 0..200 { ++ assert_eq!(v.borrow()[i], 0); ++ } ++ }); ++ } ++ ++ #[test] ++ fn test_empty_remove() { ++ let mut m: HashMap = HashMap::new(); ++ assert_eq!(m.remove(&0), None); ++ } ++ ++ #[test] ++ fn test_empty_entry() { ++ let mut m: HashMap = HashMap::new(); ++ match m.entry(0) { ++ Occupied(_) => panic!(), ++ Vacant(_) => {} ++ } ++ assert!(*m.entry(0).or_insert(true)); ++ assert_eq!(m.len(), 1); ++ } ++ ++ #[test] ++ fn test_empty_entry_ref() { ++ let mut m: HashMap = HashMap::new(); ++ match m.entry_ref("poneyland") { ++ EntryRef::Occupied(_) => panic!(), ++ EntryRef::Vacant(_) => {} ++ } ++ assert!(*m.entry_ref("poneyland").or_insert(true)); ++ assert_eq!(m.len(), 1); ++ } ++ ++ #[test] ++ fn test_empty_iter() { ++ let mut m: HashMap = HashMap::new(); ++ assert_eq!(m.drain().next(), None); ++ assert_eq!(m.keys().next(), None); ++ assert_eq!(m.values().next(), None); ++ assert_eq!(m.values_mut().next(), None); ++ assert_eq!(m.iter().next(), None); ++ assert_eq!(m.iter_mut().next(), None); ++ assert_eq!(m.len(), 0); ++ assert!(m.is_empty()); ++ assert_eq!(m.into_iter().next(), None); ++ } ++ ++ #[test] ++ #[cfg_attr(miri, ignore)] // FIXME: takes too long ++ fn test_lots_of_insertions() { ++ let mut m = HashMap::new(); ++ ++ // Try this a few times to make sure we never screw up the hashmap's ++ // internal state. ++ for _ in 0..10 { ++ assert!(m.is_empty()); ++ ++ for i in 1..1001 { ++ assert!(m.insert(i, i).is_none()); ++ ++ for j in 1..=i { ++ let r = m.get(&j); ++ assert_eq!(r, Some(&j)); ++ } ++ ++ for j in i + 1..1001 { ++ let r = m.get(&j); ++ assert_eq!(r, None); ++ } ++ } ++ ++ for i in 1001..2001 { ++ assert!(!m.contains_key(&i)); ++ } ++ ++ // remove forwards ++ for i in 1..1001 { ++ assert!(m.remove(&i).is_some()); ++ ++ for j in 1..=i { ++ assert!(!m.contains_key(&j)); ++ } ++ ++ for j in i + 1..1001 { ++ assert!(m.contains_key(&j)); ++ } ++ } ++ ++ for i in 1..1001 { ++ assert!(!m.contains_key(&i)); ++ } ++ ++ for i in 1..1001 { ++ assert!(m.insert(i, i).is_none()); ++ } ++ ++ // remove backwards ++ for i in (1..1001).rev() { ++ assert!(m.remove(&i).is_some()); ++ ++ for j in i..1001 { ++ assert!(!m.contains_key(&j)); ++ } ++ ++ for j in 1..i { ++ assert!(m.contains_key(&j)); ++ } ++ } ++ } ++ } ++ ++ #[test] ++ fn test_find_mut() { ++ let mut m = HashMap::new(); ++ assert!(m.insert(1, 12).is_none()); ++ assert!(m.insert(2, 8).is_none()); ++ assert!(m.insert(5, 14).is_none()); ++ let new = 100; ++ match m.get_mut(&5) { ++ None => panic!(), ++ Some(x) => *x = new, ++ } ++ assert_eq!(m.get(&5), Some(&new)); ++ } ++ ++ #[test] ++ fn test_insert_overwrite() { ++ let mut m = HashMap::new(); ++ assert!(m.insert(1, 2).is_none()); ++ assert_eq!(*m.get(&1).unwrap(), 2); ++ assert!(m.insert(1, 3).is_some()); ++ assert_eq!(*m.get(&1).unwrap(), 3); ++ } ++ ++ #[test] ++ fn test_insert_conflicts() { ++ let mut m = HashMap::with_capacity(4); ++ assert!(m.insert(1, 2).is_none()); ++ assert!(m.insert(5, 3).is_none()); ++ assert!(m.insert(9, 4).is_none()); ++ assert_eq!(*m.get(&9).unwrap(), 4); ++ assert_eq!(*m.get(&5).unwrap(), 3); ++ assert_eq!(*m.get(&1).unwrap(), 2); ++ } ++ ++ #[test] ++ fn test_conflict_remove() { ++ let mut m = HashMap::with_capacity(4); ++ assert!(m.insert(1, 2).is_none()); ++ assert_eq!(*m.get(&1).unwrap(), 2); ++ assert!(m.insert(5, 3).is_none()); ++ assert_eq!(*m.get(&1).unwrap(), 2); ++ assert_eq!(*m.get(&5).unwrap(), 3); ++ assert!(m.insert(9, 4).is_none()); ++ assert_eq!(*m.get(&1).unwrap(), 2); ++ assert_eq!(*m.get(&5).unwrap(), 3); ++ assert_eq!(*m.get(&9).unwrap(), 4); ++ assert!(m.remove(&1).is_some()); ++ assert_eq!(*m.get(&9).unwrap(), 4); ++ assert_eq!(*m.get(&5).unwrap(), 3); ++ } ++ ++ #[test] ++ fn test_insert_unique_unchecked() { ++ let mut map = HashMap::new(); ++ let (k1, v1) = map.insert_unique_unchecked(10, 11); ++ assert_eq!((&10, &mut 11), (k1, v1)); ++ let (k2, v2) = map.insert_unique_unchecked(20, 21); ++ assert_eq!((&20, &mut 21), (k2, v2)); ++ assert_eq!(Some(&11), map.get(&10)); ++ assert_eq!(Some(&21), map.get(&20)); ++ assert_eq!(None, map.get(&30)); ++ } ++ ++ #[test] ++ fn test_is_empty() { ++ let mut m = HashMap::with_capacity(4); ++ assert!(m.insert(1, 2).is_none()); ++ assert!(!m.is_empty()); ++ assert!(m.remove(&1).is_some()); ++ assert!(m.is_empty()); ++ } ++ ++ #[test] ++ fn test_remove() { ++ let mut m = HashMap::new(); ++ m.insert(1, 2); ++ assert_eq!(m.remove(&1), Some(2)); ++ assert_eq!(m.remove(&1), None); ++ } ++ ++ #[test] ++ fn test_remove_entry() { ++ let mut m = HashMap::new(); ++ m.insert(1, 2); ++ assert_eq!(m.remove_entry(&1), Some((1, 2))); ++ assert_eq!(m.remove(&1), None); ++ } ++ ++ #[test] ++ fn test_iterate() { ++ let mut m = HashMap::with_capacity(4); ++ for i in 0..32 { ++ assert!(m.insert(i, i * 2).is_none()); ++ } ++ assert_eq!(m.len(), 32); ++ ++ let mut observed: u32 = 0; ++ ++ for (k, v) in &m { ++ assert_eq!(*v, *k * 2); ++ observed |= 1 << *k; ++ } ++ assert_eq!(observed, 0xFFFF_FFFF); ++ } ++ ++ #[test] ++ fn test_keys() { ++ let vec = vec![(1, 'a'), (2, 'b'), (3, 'c')]; ++ let map: HashMap<_, _> = vec.into_iter().collect(); ++ let keys: Vec<_> = map.keys().copied().collect(); ++ assert_eq!(keys.len(), 3); ++ assert!(keys.contains(&1)); ++ assert!(keys.contains(&2)); ++ assert!(keys.contains(&3)); ++ } ++ ++ #[test] ++ fn test_values() { ++ let vec = vec![(1, 'a'), (2, 'b'), (3, 'c')]; ++ let map: HashMap<_, _> = vec.into_iter().collect(); ++ let values: Vec<_> = map.values().copied().collect(); ++ assert_eq!(values.len(), 3); ++ assert!(values.contains(&'a')); ++ assert!(values.contains(&'b')); ++ assert!(values.contains(&'c')); ++ } ++ ++ #[test] ++ fn test_values_mut() { ++ let vec = vec![(1, 1), (2, 2), (3, 3)]; ++ let mut map: HashMap<_, _> = vec.into_iter().collect(); ++ for value in map.values_mut() { ++ *value *= 2; ++ } ++ let values: Vec<_> = map.values().copied().collect(); ++ assert_eq!(values.len(), 3); ++ assert!(values.contains(&2)); ++ assert!(values.contains(&4)); ++ assert!(values.contains(&6)); ++ } ++ ++ #[test] ++ fn test_into_keys() { ++ let vec = vec![(1, 'a'), (2, 'b'), (3, 'c')]; ++ let map: HashMap<_, _> = vec.into_iter().collect(); ++ let keys: Vec<_> = map.into_keys().collect(); ++ ++ assert_eq!(keys.len(), 3); ++ assert!(keys.contains(&1)); ++ assert!(keys.contains(&2)); ++ assert!(keys.contains(&3)); ++ } ++ ++ #[test] ++ fn test_into_values() { ++ let vec = vec![(1, 'a'), (2, 'b'), (3, 'c')]; ++ let map: HashMap<_, _> = vec.into_iter().collect(); ++ let values: Vec<_> = map.into_values().collect(); ++ ++ assert_eq!(values.len(), 3); ++ assert!(values.contains(&'a')); ++ assert!(values.contains(&'b')); ++ assert!(values.contains(&'c')); ++ } ++ ++ #[test] ++ fn test_find() { ++ let mut m = HashMap::new(); ++ assert!(m.get(&1).is_none()); ++ m.insert(1, 2); ++ match m.get(&1) { ++ None => panic!(), ++ Some(v) => assert_eq!(*v, 2), ++ } ++ } ++ ++ #[test] ++ fn test_eq() { ++ let mut m1 = HashMap::new(); ++ m1.insert(1, 2); ++ m1.insert(2, 3); ++ m1.insert(3, 4); ++ ++ let mut m2 = HashMap::new(); ++ m2.insert(1, 2); ++ m2.insert(2, 3); ++ ++ assert!(m1 != m2); ++ ++ m2.insert(3, 4); ++ ++ assert_eq!(m1, m2); ++ } ++ ++ #[test] ++ fn test_show() { ++ let mut map = HashMap::new(); ++ let empty: HashMap = HashMap::new(); ++ ++ map.insert(1, 2); ++ map.insert(3, 4); ++ ++ let map_str = format!("{map:?}"); ++ ++ assert!(map_str == "{1: 2, 3: 4}" || map_str == "{3: 4, 1: 2}"); ++ assert_eq!(format!("{empty:?}"), "{}"); ++ } ++ ++ #[test] ++ fn test_expand() { ++ let mut m = HashMap::new(); ++ ++ assert_eq!(m.len(), 0); ++ assert!(m.is_empty()); ++ ++ let mut i = 0; ++ let old_raw_cap = m.raw_capacity(); ++ while old_raw_cap == m.raw_capacity() { ++ m.insert(i, i); ++ i += 1; ++ } ++ ++ assert_eq!(m.len(), i); ++ assert!(!m.is_empty()); ++ } ++ ++ #[test] ++ fn test_behavior_resize_policy() { ++ let mut m = HashMap::new(); ++ ++ assert_eq!(m.len(), 0); ++ assert_eq!(m.raw_capacity(), 1); ++ assert!(m.is_empty()); ++ ++ m.insert(0, 0); ++ m.remove(&0); ++ assert!(m.is_empty()); ++ let initial_raw_cap = m.raw_capacity(); ++ m.reserve(initial_raw_cap); ++ let raw_cap = m.raw_capacity(); ++ ++ assert_eq!(raw_cap, initial_raw_cap * 2); ++ ++ let mut i = 0; ++ for _ in 0..raw_cap * 3 / 4 { ++ m.insert(i, i); ++ i += 1; ++ } ++ // three quarters full ++ ++ assert_eq!(m.len(), i); ++ assert_eq!(m.raw_capacity(), raw_cap); ++ ++ for _ in 0..raw_cap / 4 { ++ m.insert(i, i); ++ i += 1; ++ } ++ // half full ++ ++ let new_raw_cap = m.raw_capacity(); ++ assert_eq!(new_raw_cap, raw_cap * 2); ++ ++ for _ in 0..raw_cap / 2 - 1 { ++ i -= 1; ++ m.remove(&i); ++ assert_eq!(m.raw_capacity(), new_raw_cap); ++ } ++ // A little more than one quarter full. ++ m.shrink_to_fit(); ++ assert_eq!(m.raw_capacity(), raw_cap); ++ // again, a little more than half full ++ for _ in 0..raw_cap / 2 { ++ i -= 1; ++ m.remove(&i); ++ } ++ m.shrink_to_fit(); ++ ++ assert_eq!(m.len(), i); ++ assert!(!m.is_empty()); ++ assert_eq!(m.raw_capacity(), initial_raw_cap); ++ } ++ ++ #[test] ++ fn test_reserve_shrink_to_fit() { ++ let mut m = HashMap::new(); ++ m.insert(0, 0); ++ m.remove(&0); ++ assert!(m.capacity() >= m.len()); ++ for i in 0..128 { ++ m.insert(i, i); ++ } ++ m.reserve(256); ++ ++ let usable_cap = m.capacity(); ++ for i in 128..(128 + 256) { ++ m.insert(i, i); ++ assert_eq!(m.capacity(), usable_cap); ++ } ++ ++ for i in 100..(128 + 256) { ++ assert_eq!(m.remove(&i), Some(i)); ++ } ++ m.shrink_to_fit(); ++ ++ assert_eq!(m.len(), 100); ++ assert!(!m.is_empty()); ++ assert!(m.capacity() >= m.len()); ++ ++ for i in 0..100 { ++ assert_eq!(m.remove(&i), Some(i)); ++ } ++ m.shrink_to_fit(); ++ m.insert(0, 0); ++ ++ assert_eq!(m.len(), 1); ++ assert!(m.capacity() >= m.len()); ++ assert_eq!(m.remove(&0), Some(0)); ++ } ++ ++ #[test] ++ fn test_from_iter() { ++ let xs = [(1, 1), (2, 2), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6)]; ++ ++ let map: HashMap<_, _> = xs.iter().copied().collect(); ++ ++ for &(k, v) in &xs { ++ assert_eq!(map.get(&k), Some(&v)); ++ } ++ ++ assert_eq!(map.iter().len(), xs.len() - 1); ++ } ++ ++ #[test] ++ fn test_size_hint() { ++ let xs = [(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6)]; ++ ++ let map: HashMap<_, _> = xs.iter().copied().collect(); ++ ++ let mut iter = map.iter(); ++ ++ for _ in iter.by_ref().take(3) {} ++ ++ assert_eq!(iter.size_hint(), (3, Some(3))); ++ } ++ ++ #[test] ++ fn test_iter_len() { ++ let xs = [(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6)]; ++ ++ let map: HashMap<_, _> = xs.iter().copied().collect(); ++ ++ let mut iter = map.iter(); ++ ++ for _ in iter.by_ref().take(3) {} ++ ++ assert_eq!(iter.len(), 3); ++ } ++ ++ #[test] ++ fn test_mut_size_hint() { ++ let xs = [(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6)]; ++ ++ let mut map: HashMap<_, _> = xs.iter().copied().collect(); ++ ++ let mut iter = map.iter_mut(); ++ ++ for _ in iter.by_ref().take(3) {} ++ ++ assert_eq!(iter.size_hint(), (3, Some(3))); ++ } ++ ++ #[test] ++ fn test_iter_mut_len() { ++ let xs = [(1, 1), (2, 2), (3, 3), (4, 4), (5, 5), (6, 6)]; ++ ++ let mut map: HashMap<_, _> = xs.iter().copied().collect(); ++ ++ let mut iter = map.iter_mut(); ++ ++ for _ in iter.by_ref().take(3) {} ++ ++ assert_eq!(iter.len(), 3); ++ } ++ ++ #[test] ++ fn test_index() { ++ let mut map = HashMap::new(); ++ ++ map.insert(1, 2); ++ map.insert(2, 1); ++ map.insert(3, 4); ++ ++ assert_eq!(map[&2], 1); ++ } ++ ++ #[test] ++ #[should_panic] ++ fn test_index_nonexistent() { ++ let mut map = HashMap::new(); ++ ++ map.insert(1, 2); ++ map.insert(2, 1); ++ map.insert(3, 4); ++ ++ #[allow(clippy::no_effect)] // false positive lint ++ map[&4]; ++ } ++ ++ #[test] ++ fn test_entry() { ++ let xs = [(1, 10), (2, 20), (3, 30), (4, 40), (5, 50), (6, 60)]; ++ ++ let mut map: HashMap<_, _> = xs.iter().copied().collect(); ++ ++ // Existing key (insert) ++ match map.entry(1) { ++ Vacant(_) => unreachable!(), ++ Occupied(mut view) => { ++ assert_eq!(view.get(), &10); ++ assert_eq!(view.insert(100), 10); ++ } ++ } ++ assert_eq!(map.get(&1).unwrap(), &100); ++ assert_eq!(map.len(), 6); ++ ++ // Existing key (update) ++ match map.entry(2) { ++ Vacant(_) => unreachable!(), ++ Occupied(mut view) => { ++ let v = view.get_mut(); ++ let new_v = (*v) * 10; ++ *v = new_v; ++ } ++ } ++ assert_eq!(map.get(&2).unwrap(), &200); ++ assert_eq!(map.len(), 6); ++ ++ // Existing key (take) ++ match map.entry(3) { ++ Vacant(_) => unreachable!(), ++ Occupied(view) => { ++ assert_eq!(view.remove(), 30); ++ } ++ } ++ assert_eq!(map.get(&3), None); ++ assert_eq!(map.len(), 5); ++ ++ // Inexistent key (insert) ++ match map.entry(10) { ++ Occupied(_) => unreachable!(), ++ Vacant(view) => { ++ assert_eq!(*view.insert(1000), 1000); ++ } ++ } ++ assert_eq!(map.get(&10).unwrap(), &1000); ++ assert_eq!(map.len(), 6); ++ } ++ ++ #[test] ++ fn test_entry_ref() { ++ let xs = [ ++ ("One".to_owned(), 10), ++ ("Two".to_owned(), 20), ++ ("Three".to_owned(), 30), ++ ("Four".to_owned(), 40), ++ ("Five".to_owned(), 50), ++ ("Six".to_owned(), 60), ++ ]; ++ ++ let mut map: HashMap<_, _> = xs.iter().cloned().collect(); ++ ++ // Existing key (insert) ++ match map.entry_ref("One") { ++ EntryRef::Vacant(_) => unreachable!(), ++ EntryRef::Occupied(mut view) => { ++ assert_eq!(view.get(), &10); ++ assert_eq!(view.insert(100), 10); ++ } ++ } ++ assert_eq!(map.get("One").unwrap(), &100); ++ assert_eq!(map.len(), 6); ++ ++ // Existing key (update) ++ match map.entry_ref("Two") { ++ EntryRef::Vacant(_) => unreachable!(), ++ EntryRef::Occupied(mut view) => { ++ let v = view.get_mut(); ++ let new_v = (*v) * 10; ++ *v = new_v; ++ } ++ } ++ assert_eq!(map.get("Two").unwrap(), &200); ++ assert_eq!(map.len(), 6); ++ ++ // Existing key (take) ++ match map.entry_ref("Three") { ++ EntryRef::Vacant(_) => unreachable!(), ++ EntryRef::Occupied(view) => { ++ assert_eq!(view.remove(), 30); ++ } ++ } ++ assert_eq!(map.get("Three"), None); ++ assert_eq!(map.len(), 5); ++ ++ // Inexistent key (insert) ++ match map.entry_ref("Ten") { ++ EntryRef::Occupied(_) => unreachable!(), ++ EntryRef::Vacant(view) => { ++ assert_eq!(*view.insert(1000), 1000); ++ } ++ } ++ assert_eq!(map.get("Ten").unwrap(), &1000); ++ assert_eq!(map.len(), 6); ++ } ++ ++ #[test] ++ fn test_entry_take_doesnt_corrupt() { ++ #![allow(deprecated)] //rand ++ // Test for #19292 ++ fn check(m: &HashMap) { ++ for k in m.keys() { ++ assert!(m.contains_key(k), "{k} is in keys() but not in the map?"); ++ } ++ } ++ ++ let mut m = HashMap::new(); ++ ++ let mut rng = { ++ let seed = u64::from_le_bytes(*b"testseed"); ++ SmallRng::seed_from_u64(seed) ++ }; ++ ++ // Populate the map with some items. ++ for _ in 0..50 { ++ let x = rng.gen_range(-10..10); ++ m.insert(x, ()); ++ } ++ ++ for _ in 0..1000 { ++ let x = rng.gen_range(-10..10); ++ match m.entry(x) { ++ Vacant(_) => {} ++ Occupied(e) => { ++ e.remove(); ++ } ++ } ++ ++ check(&m); ++ } ++ } ++ ++ #[test] ++ fn test_entry_ref_take_doesnt_corrupt() { ++ #![allow(deprecated)] //rand ++ // Test for #19292 ++ fn check(m: &HashMap) { ++ for k in m.keys() { ++ assert!(m.contains_key(k), "{k} is in keys() but not in the map?"); ++ } ++ } ++ ++ let mut m = HashMap::new(); ++ ++ let mut rng = { ++ let seed = u64::from_le_bytes(*b"testseed"); ++ SmallRng::seed_from_u64(seed) ++ }; ++ ++ // Populate the map with some items. ++ for _ in 0..50 { ++ let mut x = std::string::String::with_capacity(1); ++ x.push(rng.gen_range('a'..='z')); ++ m.insert(x, ()); ++ } ++ ++ for _ in 0..1000 { ++ let mut x = std::string::String::with_capacity(1); ++ x.push(rng.gen_range('a'..='z')); ++ match m.entry_ref(x.as_str()) { ++ EntryRef::Vacant(_) => {} ++ EntryRef::Occupied(e) => { ++ e.remove(); ++ } ++ } ++ ++ check(&m); ++ } ++ } ++ ++ #[test] ++ fn test_extend_ref_k_ref_v() { ++ let mut a = HashMap::new(); ++ a.insert(1, "one"); ++ let mut b = HashMap::new(); ++ b.insert(2, "two"); ++ b.insert(3, "three"); ++ ++ a.extend(&b); ++ ++ assert_eq!(a.len(), 3); ++ assert_eq!(a[&1], "one"); ++ assert_eq!(a[&2], "two"); ++ assert_eq!(a[&3], "three"); ++ } ++ ++ #[test] ++ #[allow(clippy::needless_borrow)] ++ fn test_extend_ref_kv_tuple() { ++ use std::ops::AddAssign; ++ let mut a = HashMap::new(); ++ a.insert(0, 0); ++ ++ fn create_arr + Copy, const N: usize>(start: T, step: T) -> [(T, T); N] { ++ let mut outs: [(T, T); N] = [(start, start); N]; ++ let mut element = step; ++ outs.iter_mut().skip(1).for_each(|(k, v)| { ++ *k += element; ++ *v += element; ++ element += step; ++ }); ++ outs ++ } ++ ++ let for_iter: Vec<_> = (0..100).map(|i| (i, i)).collect(); ++ let iter = for_iter.iter(); ++ let vec: Vec<_> = (100..200).map(|i| (i, i)).collect(); ++ a.extend(iter); ++ a.extend(&vec); ++ a.extend(create_arr::(200, 1)); ++ ++ assert_eq!(a.len(), 300); ++ ++ for item in 0..300 { ++ assert_eq!(a[&item], item); ++ } ++ } ++ ++ #[test] ++ fn test_capacity_not_less_than_len() { ++ let mut a = HashMap::new(); ++ let mut item = 0; ++ ++ for _ in 0..116 { ++ a.insert(item, 0); ++ item += 1; ++ } ++ ++ assert!(a.capacity() > a.len()); ++ ++ let free = a.capacity() - a.len(); ++ for _ in 0..free { ++ a.insert(item, 0); ++ item += 1; ++ } ++ ++ assert_eq!(a.len(), a.capacity()); ++ ++ // Insert at capacity should cause allocation. ++ a.insert(item, 0); ++ assert!(a.capacity() > a.len()); ++ } ++ ++ #[test] ++ fn test_occupied_entry_key() { ++ let mut a = HashMap::new(); ++ let key = "hello there"; ++ let value = "value goes here"; ++ assert!(a.is_empty()); ++ a.insert(key, value); ++ assert_eq!(a.len(), 1); ++ assert_eq!(a[key], value); ++ ++ match a.entry(key) { ++ Vacant(_) => panic!(), ++ Occupied(e) => assert_eq!(key, *e.key()), ++ } ++ assert_eq!(a.len(), 1); ++ assert_eq!(a[key], value); ++ } ++ ++ #[test] ++ fn test_occupied_entry_ref_key() { ++ let mut a = HashMap::new(); ++ let key = "hello there"; ++ let value = "value goes here"; ++ assert!(a.is_empty()); ++ a.insert(key.to_owned(), value); ++ assert_eq!(a.len(), 1); ++ assert_eq!(a[key], value); ++ ++ match a.entry_ref(key) { ++ EntryRef::Vacant(_) => panic!(), ++ EntryRef::Occupied(e) => assert_eq!(key, e.key()), ++ } ++ assert_eq!(a.len(), 1); ++ assert_eq!(a[key], value); ++ } ++ ++ #[test] ++ fn test_vacant_entry_key() { ++ let mut a = HashMap::new(); ++ let key = "hello there"; ++ let value = "value goes here"; ++ ++ assert!(a.is_empty()); ++ match a.entry(key) { ++ Occupied(_) => panic!(), ++ Vacant(e) => { ++ assert_eq!(key, *e.key()); ++ e.insert(value); ++ } ++ } ++ assert_eq!(a.len(), 1); ++ assert_eq!(a[key], value); ++ } ++ ++ #[test] ++ fn test_vacant_entry_ref_key() { ++ let mut a: HashMap = HashMap::new(); ++ let key = "hello there"; ++ let value = "value goes here"; ++ ++ assert!(a.is_empty()); ++ match a.entry_ref(key) { ++ EntryRef::Occupied(_) => panic!(), ++ EntryRef::Vacant(e) => { ++ assert_eq!(key, e.key()); ++ e.insert(value); ++ } ++ } ++ assert_eq!(a.len(), 1); ++ assert_eq!(a[key], value); ++ } ++ ++ #[test] ++ fn test_occupied_entry_replace_entry_with() { ++ let mut a = HashMap::new(); ++ ++ let key = "a key"; ++ let value = "an initial value"; ++ let new_value = "a new value"; ++ ++ let entry = a.entry(key).insert(value).replace_entry_with(|k, v| { ++ assert_eq!(k, &key); ++ assert_eq!(v, value); ++ Some(new_value) ++ }); ++ ++ match entry { ++ Occupied(e) => { ++ assert_eq!(e.key(), &key); ++ assert_eq!(e.get(), &new_value); ++ } ++ Vacant(_) => panic!(), ++ } ++ ++ assert_eq!(a[key], new_value); ++ assert_eq!(a.len(), 1); ++ ++ let entry = match a.entry(key) { ++ Occupied(e) => e.replace_entry_with(|k, v| { ++ assert_eq!(k, &key); ++ assert_eq!(v, new_value); ++ None ++ }), ++ Vacant(_) => panic!(), ++ }; ++ ++ match entry { ++ Vacant(e) => assert_eq!(e.key(), &key), ++ Occupied(_) => panic!(), ++ } ++ ++ assert!(!a.contains_key(key)); ++ assert_eq!(a.len(), 0); ++ } ++ ++ #[test] ++ fn test_occupied_entry_ref_replace_entry_with() { ++ let mut a: HashMap = HashMap::new(); ++ ++ let key = "a key"; ++ let value = "an initial value"; ++ let new_value = "a new value"; ++ ++ let entry = a.entry_ref(key).insert(value).replace_entry_with(|k, v| { ++ assert_eq!(k, key); ++ assert_eq!(v, value); ++ Some(new_value) ++ }); ++ ++ match entry { ++ EntryRef::Occupied(e) => { ++ assert_eq!(e.key(), key); ++ assert_eq!(e.get(), &new_value); ++ } ++ EntryRef::Vacant(_) => panic!(), ++ } ++ ++ assert_eq!(a[key], new_value); ++ assert_eq!(a.len(), 1); ++ ++ let entry = match a.entry_ref(key) { ++ EntryRef::Occupied(e) => e.replace_entry_with(|k, v| { ++ assert_eq!(k, key); ++ assert_eq!(v, new_value); ++ None ++ }), ++ EntryRef::Vacant(_) => panic!(), ++ }; ++ ++ match entry { ++ EntryRef::Vacant(e) => assert_eq!(e.key(), key), ++ EntryRef::Occupied(_) => panic!(), ++ } ++ ++ assert!(!a.contains_key(key)); ++ assert_eq!(a.len(), 0); ++ } ++ ++ #[test] ++ fn test_entry_and_replace_entry_with() { ++ let mut a = HashMap::new(); ++ ++ let key = "a key"; ++ let value = "an initial value"; ++ let new_value = "a new value"; ++ ++ let entry = a.entry(key).and_replace_entry_with(|_, _| panic!()); ++ ++ match entry { ++ Vacant(e) => assert_eq!(e.key(), &key), ++ Occupied(_) => panic!(), ++ } ++ ++ a.insert(key, value); ++ ++ let entry = a.entry(key).and_replace_entry_with(|k, v| { ++ assert_eq!(k, &key); ++ assert_eq!(v, value); ++ Some(new_value) ++ }); ++ ++ match entry { ++ Occupied(e) => { ++ assert_eq!(e.key(), &key); ++ assert_eq!(e.get(), &new_value); ++ } ++ Vacant(_) => panic!(), ++ } ++ ++ assert_eq!(a[key], new_value); ++ assert_eq!(a.len(), 1); ++ ++ let entry = a.entry(key).and_replace_entry_with(|k, v| { ++ assert_eq!(k, &key); ++ assert_eq!(v, new_value); ++ None ++ }); ++ ++ match entry { ++ Vacant(e) => assert_eq!(e.key(), &key), ++ Occupied(_) => panic!(), ++ } ++ ++ assert!(!a.contains_key(key)); ++ assert_eq!(a.len(), 0); ++ } ++ ++ #[test] ++ fn test_entry_ref_and_replace_entry_with() { ++ let mut a = HashMap::new(); ++ ++ let key = "a key"; ++ let value = "an initial value"; ++ let new_value = "a new value"; ++ ++ let entry = a.entry_ref(key).and_replace_entry_with(|_, _| panic!()); ++ ++ match entry { ++ EntryRef::Vacant(e) => assert_eq!(e.key(), key), ++ EntryRef::Occupied(_) => panic!(), ++ } ++ ++ a.insert(key.to_owned(), value); ++ ++ let entry = a.entry_ref(key).and_replace_entry_with(|k, v| { ++ assert_eq!(k, key); ++ assert_eq!(v, value); ++ Some(new_value) ++ }); ++ ++ match entry { ++ EntryRef::Occupied(e) => { ++ assert_eq!(e.key(), key); ++ assert_eq!(e.get(), &new_value); ++ } ++ EntryRef::Vacant(_) => panic!(), ++ } ++ ++ assert_eq!(a[key], new_value); ++ assert_eq!(a.len(), 1); ++ ++ let entry = a.entry_ref(key).and_replace_entry_with(|k, v| { ++ assert_eq!(k, key); ++ assert_eq!(v, new_value); ++ None ++ }); ++ ++ match entry { ++ EntryRef::Vacant(e) => assert_eq!(e.key(), key), ++ EntryRef::Occupied(_) => panic!(), ++ } ++ ++ assert!(!a.contains_key(key)); ++ assert_eq!(a.len(), 0); ++ } ++ ++ #[test] ++ fn test_raw_occupied_entry_replace_entry_with() { ++ let mut a = HashMap::new(); ++ ++ let key = "a key"; ++ let value = "an initial value"; ++ let new_value = "a new value"; ++ ++ let entry = a ++ .raw_entry_mut() ++ .from_key(&key) ++ .insert(key, value) ++ .replace_entry_with(|k, v| { ++ assert_eq!(k, &key); ++ assert_eq!(v, value); ++ Some(new_value) ++ }); ++ ++ match entry { ++ RawEntryMut::Occupied(e) => { ++ assert_eq!(e.key(), &key); ++ assert_eq!(e.get(), &new_value); ++ } ++ RawEntryMut::Vacant(_) => panic!(), ++ } ++ ++ assert_eq!(a[key], new_value); ++ assert_eq!(a.len(), 1); ++ ++ let entry = match a.raw_entry_mut().from_key(&key) { ++ RawEntryMut::Occupied(e) => e.replace_entry_with(|k, v| { ++ assert_eq!(k, &key); ++ assert_eq!(v, new_value); ++ None ++ }), ++ RawEntryMut::Vacant(_) => panic!(), ++ }; ++ ++ match entry { ++ RawEntryMut::Vacant(_) => {} ++ RawEntryMut::Occupied(_) => panic!(), ++ } ++ ++ assert!(!a.contains_key(key)); ++ assert_eq!(a.len(), 0); ++ } ++ ++ #[test] ++ fn test_raw_entry_and_replace_entry_with() { ++ let mut a = HashMap::new(); ++ ++ let key = "a key"; ++ let value = "an initial value"; ++ let new_value = "a new value"; ++ ++ let entry = a ++ .raw_entry_mut() ++ .from_key(&key) ++ .and_replace_entry_with(|_, _| panic!()); ++ ++ match entry { ++ RawEntryMut::Vacant(_) => {} ++ RawEntryMut::Occupied(_) => panic!(), ++ } ++ ++ a.insert(key, value); ++ ++ let entry = a ++ .raw_entry_mut() ++ .from_key(&key) ++ .and_replace_entry_with(|k, v| { ++ assert_eq!(k, &key); ++ assert_eq!(v, value); ++ Some(new_value) ++ }); ++ ++ match entry { ++ RawEntryMut::Occupied(e) => { ++ assert_eq!(e.key(), &key); ++ assert_eq!(e.get(), &new_value); ++ } ++ RawEntryMut::Vacant(_) => panic!(), ++ } ++ ++ assert_eq!(a[key], new_value); ++ assert_eq!(a.len(), 1); ++ ++ let entry = a ++ .raw_entry_mut() ++ .from_key(&key) ++ .and_replace_entry_with(|k, v| { ++ assert_eq!(k, &key); ++ assert_eq!(v, new_value); ++ None ++ }); ++ ++ match entry { ++ RawEntryMut::Vacant(_) => {} ++ RawEntryMut::Occupied(_) => panic!(), ++ } ++ ++ assert!(!a.contains_key(key)); ++ assert_eq!(a.len(), 0); ++ } ++ ++ #[test] ++ fn test_replace_entry_with_doesnt_corrupt() { ++ #![allow(deprecated)] //rand ++ // Test for #19292 ++ fn check(m: &HashMap) { ++ for k in m.keys() { ++ assert!(m.contains_key(k), "{k} is in keys() but not in the map?"); ++ } ++ } ++ ++ let mut m = HashMap::new(); ++ ++ let mut rng = { ++ let seed = u64::from_le_bytes(*b"testseed"); ++ SmallRng::seed_from_u64(seed) ++ }; ++ ++ // Populate the map with some items. ++ for _ in 0..50 { ++ let x = rng.gen_range(-10..10); ++ m.insert(x, ()); ++ } ++ ++ for _ in 0..1000 { ++ let x = rng.gen_range(-10..10); ++ m.entry(x).and_replace_entry_with(|_, _| None); ++ check(&m); ++ } ++ } ++ ++ #[test] ++ fn test_replace_entry_ref_with_doesnt_corrupt() { ++ #![allow(deprecated)] //rand ++ // Test for #19292 ++ fn check(m: &HashMap) { ++ for k in m.keys() { ++ assert!(m.contains_key(k), "{k} is in keys() but not in the map?"); ++ } ++ } ++ ++ let mut m = HashMap::new(); ++ ++ let mut rng = { ++ let seed = u64::from_le_bytes(*b"testseed"); ++ SmallRng::seed_from_u64(seed) ++ }; ++ ++ // Populate the map with some items. ++ for _ in 0..50 { ++ let mut x = std::string::String::with_capacity(1); ++ x.push(rng.gen_range('a'..='z')); ++ m.insert(x, ()); ++ } ++ ++ for _ in 0..1000 { ++ let mut x = std::string::String::with_capacity(1); ++ x.push(rng.gen_range('a'..='z')); ++ m.entry_ref(x.as_str()).and_replace_entry_with(|_, _| None); ++ check(&m); ++ } ++ } ++ ++ #[test] ++ fn test_retain() { ++ let mut map: HashMap = (0..100).map(|x| (x, x * 10)).collect(); ++ ++ map.retain(|&k, _| k % 2 == 0); ++ assert_eq!(map.len(), 50); ++ assert_eq!(map[&2], 20); ++ assert_eq!(map[&4], 40); ++ assert_eq!(map[&6], 60); ++ } ++ ++ #[test] ++ fn test_extract_if() { ++ { ++ let mut map: HashMap = (0..8).map(|x| (x, x * 10)).collect(); ++ let drained = map.extract_if(|&k, _| k % 2 == 0); ++ let mut out = drained.collect::>(); ++ out.sort_unstable(); ++ assert_eq!(vec![(0, 0), (2, 20), (4, 40), (6, 60)], out); ++ assert_eq!(map.len(), 4); ++ } ++ { ++ let mut map: HashMap = (0..8).map(|x| (x, x * 10)).collect(); ++ map.extract_if(|&k, _| k % 2 == 0).for_each(drop); ++ assert_eq!(map.len(), 4); ++ } ++ } ++ ++ #[test] ++ #[cfg_attr(miri, ignore)] // FIXME: no OOM signalling (https://github.com/rust-lang/miri/issues/613) ++ fn test_try_reserve() { ++ use crate::TryReserveError::{AllocError, CapacityOverflow}; ++ ++ const MAX_ISIZE: usize = isize::MAX as usize; ++ ++ let mut empty_bytes: HashMap = HashMap::new(); ++ ++ if let Err(CapacityOverflow) = empty_bytes.try_reserve(usize::MAX) { ++ } else { ++ panic!("usize::MAX should trigger an overflow!"); ++ } ++ ++ if let Err(CapacityOverflow) = empty_bytes.try_reserve(MAX_ISIZE) { ++ } else { ++ panic!("isize::MAX should trigger an overflow!"); ++ } ++ ++ if let Err(AllocError { .. }) = empty_bytes.try_reserve(MAX_ISIZE / 5) { ++ } else { ++ // This may succeed if there is enough free memory. Attempt to ++ // allocate a few more hashmaps to ensure the allocation will fail. ++ let mut empty_bytes2: HashMap = HashMap::new(); ++ let _ = empty_bytes2.try_reserve(MAX_ISIZE / 5); ++ let mut empty_bytes3: HashMap = HashMap::new(); ++ let _ = empty_bytes3.try_reserve(MAX_ISIZE / 5); ++ let mut empty_bytes4: HashMap = HashMap::new(); ++ if let Err(AllocError { .. }) = empty_bytes4.try_reserve(MAX_ISIZE / 5) { ++ } else { ++ panic!("isize::MAX / 5 should trigger an OOM!"); ++ } ++ } ++ } ++ ++ #[test] ++ fn test_raw_entry() { ++ use super::RawEntryMut::{Occupied, Vacant}; ++ ++ let xs = [(1_i32, 10_i32), (2, 20), (3, 30), (4, 40), (5, 50), (6, 60)]; ++ ++ let mut map: HashMap<_, _> = xs.iter().copied().collect(); ++ ++ let compute_hash = |map: &HashMap, k: i32| -> u64 { ++ super::make_hash::(map.hasher(), &k) ++ }; ++ ++ // Existing key (insert) ++ match map.raw_entry_mut().from_key(&1) { ++ Vacant(_) => unreachable!(), ++ Occupied(mut view) => { ++ assert_eq!(view.get(), &10); ++ assert_eq!(view.insert(100), 10); ++ } ++ } ++ let hash1 = compute_hash(&map, 1); ++ assert_eq!(map.raw_entry().from_key(&1).unwrap(), (&1, &100)); ++ assert_eq!( ++ map.raw_entry().from_hash(hash1, |k| *k == 1).unwrap(), ++ (&1, &100) ++ ); ++ assert_eq!( ++ map.raw_entry().from_key_hashed_nocheck(hash1, &1).unwrap(), ++ (&1, &100) ++ ); ++ assert_eq!(map.len(), 6); ++ ++ // Existing key (update) ++ match map.raw_entry_mut().from_key(&2) { ++ Vacant(_) => unreachable!(), ++ Occupied(mut view) => { ++ let v = view.get_mut(); ++ let new_v = (*v) * 10; ++ *v = new_v; ++ } ++ } ++ let hash2 = compute_hash(&map, 2); ++ assert_eq!(map.raw_entry().from_key(&2).unwrap(), (&2, &200)); ++ assert_eq!( ++ map.raw_entry().from_hash(hash2, |k| *k == 2).unwrap(), ++ (&2, &200) ++ ); ++ assert_eq!( ++ map.raw_entry().from_key_hashed_nocheck(hash2, &2).unwrap(), ++ (&2, &200) ++ ); ++ assert_eq!(map.len(), 6); ++ ++ // Existing key (take) ++ let hash3 = compute_hash(&map, 3); ++ match map.raw_entry_mut().from_key_hashed_nocheck(hash3, &3) { ++ Vacant(_) => unreachable!(), ++ Occupied(view) => { ++ assert_eq!(view.remove_entry(), (3, 30)); ++ } ++ } ++ assert_eq!(map.raw_entry().from_key(&3), None); ++ assert_eq!(map.raw_entry().from_hash(hash3, |k| *k == 3), None); ++ assert_eq!(map.raw_entry().from_key_hashed_nocheck(hash3, &3), None); ++ assert_eq!(map.len(), 5); ++ ++ // Nonexistent key (insert) ++ match map.raw_entry_mut().from_key(&10) { ++ Occupied(_) => unreachable!(), ++ Vacant(view) => { ++ assert_eq!(view.insert(10, 1000), (&mut 10, &mut 1000)); ++ } ++ } ++ assert_eq!(map.raw_entry().from_key(&10).unwrap(), (&10, &1000)); ++ assert_eq!(map.len(), 6); ++ ++ // Ensure all lookup methods produce equivalent results. ++ for k in 0..12 { ++ let hash = compute_hash(&map, k); ++ let v = map.get(&k).copied(); ++ let kv = v.as_ref().map(|v| (&k, v)); ++ ++ assert_eq!(map.raw_entry().from_key(&k), kv); ++ assert_eq!(map.raw_entry().from_hash(hash, |q| *q == k), kv); ++ assert_eq!(map.raw_entry().from_key_hashed_nocheck(hash, &k), kv); ++ ++ match map.raw_entry_mut().from_key(&k) { ++ Occupied(o) => assert_eq!(Some(o.get_key_value()), kv), ++ Vacant(_) => assert_eq!(v, None), ++ } ++ match map.raw_entry_mut().from_key_hashed_nocheck(hash, &k) { ++ Occupied(o) => assert_eq!(Some(o.get_key_value()), kv), ++ Vacant(_) => assert_eq!(v, None), ++ } ++ match map.raw_entry_mut().from_hash(hash, |q| *q == k) { ++ Occupied(o) => assert_eq!(Some(o.get_key_value()), kv), ++ Vacant(_) => assert_eq!(v, None), ++ } ++ } ++ } ++ ++ #[test] ++ fn test_key_without_hash_impl() { ++ #[derive(Debug)] ++ struct IntWrapper(u64); ++ ++ let mut m: HashMap = HashMap::default(); ++ { ++ assert!(m.raw_entry().from_hash(0, |k| k.0 == 0).is_none()); ++ } ++ { ++ let vacant_entry = match m.raw_entry_mut().from_hash(0, |k| k.0 == 0) { ++ RawEntryMut::Occupied(..) => panic!("Found entry for key 0"), ++ RawEntryMut::Vacant(e) => e, ++ }; ++ vacant_entry.insert_with_hasher(0, IntWrapper(0), (), |k| k.0); ++ } ++ { ++ assert!(m.raw_entry().from_hash(0, |k| k.0 == 0).is_some()); ++ assert!(m.raw_entry().from_hash(1, |k| k.0 == 1).is_none()); ++ assert!(m.raw_entry().from_hash(2, |k| k.0 == 2).is_none()); ++ } ++ { ++ let vacant_entry = match m.raw_entry_mut().from_hash(1, |k| k.0 == 1) { ++ RawEntryMut::Occupied(..) => panic!("Found entry for key 1"), ++ RawEntryMut::Vacant(e) => e, ++ }; ++ vacant_entry.insert_with_hasher(1, IntWrapper(1), (), |k| k.0); ++ } ++ { ++ assert!(m.raw_entry().from_hash(0, |k| k.0 == 0).is_some()); ++ assert!(m.raw_entry().from_hash(1, |k| k.0 == 1).is_some()); ++ assert!(m.raw_entry().from_hash(2, |k| k.0 == 2).is_none()); ++ } ++ { ++ let occupied_entry = match m.raw_entry_mut().from_hash(0, |k| k.0 == 0) { ++ RawEntryMut::Occupied(e) => e, ++ RawEntryMut::Vacant(..) => panic!("Couldn't find entry for key 0"), ++ }; ++ occupied_entry.remove(); ++ } ++ assert!(m.raw_entry().from_hash(0, |k| k.0 == 0).is_none()); ++ assert!(m.raw_entry().from_hash(1, |k| k.0 == 1).is_some()); ++ assert!(m.raw_entry().from_hash(2, |k| k.0 == 2).is_none()); ++ } ++ ++ #[test] ++ #[cfg(feature = "raw")] ++ fn test_into_iter_refresh() { ++ #[cfg(miri)] ++ const N: usize = 32; ++ #[cfg(not(miri))] ++ const N: usize = 128; ++ ++ let mut rng = rand::thread_rng(); ++ for n in 0..N { ++ let mut map = HashMap::new(); ++ for i in 0..n { ++ assert!(map.insert(i, 2 * i).is_none()); ++ } ++ let hash_builder = map.hasher().clone(); ++ ++ let mut it = unsafe { map.table.iter() }; ++ assert_eq!(it.len(), n); ++ ++ let mut i = 0; ++ let mut left = n; ++ let mut removed = Vec::new(); ++ loop { ++ // occasionally remove some elements ++ if i < n && rng.gen_bool(0.1) { ++ let hash_value = super::make_hash(&hash_builder, &i); ++ ++ unsafe { ++ let e = map.table.find(hash_value, |q| q.0.eq(&i)); ++ if let Some(e) = e { ++ it.reflect_remove(&e); ++ let t = map.table.remove(e).0; ++ removed.push(t); ++ left -= 1; ++ } else { ++ assert!(removed.contains(&(i, 2 * i)), "{i} not in {removed:?}"); ++ let e = map.table.insert( ++ hash_value, ++ (i, 2 * i), ++ super::make_hasher::<_, usize, _>(&hash_builder), ++ ); ++ it.reflect_insert(&e); ++ if let Some(p) = removed.iter().position(|e| e == &(i, 2 * i)) { ++ removed.swap_remove(p); ++ } ++ left += 1; ++ } ++ } ++ } ++ ++ let e = it.next(); ++ if e.is_none() { ++ break; ++ } ++ assert!(i < n); ++ let t = unsafe { e.unwrap().as_ref() }; ++ assert!(!removed.contains(t)); ++ let (key, value) = t; ++ assert_eq!(*value, 2 * key); ++ i += 1; ++ } ++ assert!(i <= n); ++ ++ // just for safety: ++ assert_eq!(map.table.len(), left); ++ } ++ } ++ ++ #[test] ++ fn test_const_with_hasher() { ++ use core::hash::BuildHasher; ++ use std::collections::hash_map::DefaultHasher; ++ ++ #[derive(Clone)] ++ struct MyHasher; ++ impl BuildHasher for MyHasher { ++ type Hasher = DefaultHasher; ++ ++ fn build_hasher(&self) -> DefaultHasher { ++ DefaultHasher::new() ++ } ++ } ++ ++ const EMPTY_MAP: HashMap = ++ HashMap::with_hasher(MyHasher); ++ ++ let mut map = EMPTY_MAP; ++ map.insert(17, "seventeen".to_owned()); ++ assert_eq!("seventeen", map[&17]); ++ } ++ ++ #[test] ++ fn test_get_each_mut() { ++ let mut map = HashMap::new(); ++ map.insert("foo".to_owned(), 0); ++ map.insert("bar".to_owned(), 10); ++ map.insert("baz".to_owned(), 20); ++ map.insert("qux".to_owned(), 30); ++ ++ let xs = map.get_many_mut(["foo", "qux"]); ++ assert_eq!(xs, Some([&mut 0, &mut 30])); ++ ++ let xs = map.get_many_mut(["foo", "dud"]); ++ assert_eq!(xs, None); ++ ++ let xs = map.get_many_mut(["foo", "foo"]); ++ assert_eq!(xs, None); ++ ++ let ys = map.get_many_key_value_mut(["bar", "baz"]); ++ assert_eq!( ++ ys, ++ Some([(&"bar".to_owned(), &mut 10), (&"baz".to_owned(), &mut 20),]), ++ ); ++ ++ let ys = map.get_many_key_value_mut(["bar", "dip"]); ++ assert_eq!(ys, None); ++ ++ let ys = map.get_many_key_value_mut(["baz", "baz"]); ++ assert_eq!(ys, None); ++ } ++ ++ #[test] ++ #[should_panic = "panic in drop"] ++ fn test_clone_from_double_drop() { ++ #[derive(Clone)] ++ struct CheckedDrop { ++ panic_in_drop: bool, ++ dropped: bool, ++ } ++ impl Drop for CheckedDrop { ++ fn drop(&mut self) { ++ if self.panic_in_drop { ++ self.dropped = true; ++ panic!("panic in drop"); ++ } ++ if self.dropped { ++ panic!("double drop"); ++ } ++ self.dropped = true; ++ } ++ } ++ const DISARMED: CheckedDrop = CheckedDrop { ++ panic_in_drop: false, ++ dropped: false, ++ }; ++ const ARMED: CheckedDrop = CheckedDrop { ++ panic_in_drop: true, ++ dropped: false, ++ }; ++ ++ let mut map1 = HashMap::new(); ++ map1.insert(1, DISARMED); ++ map1.insert(2, DISARMED); ++ map1.insert(3, DISARMED); ++ map1.insert(4, DISARMED); ++ ++ let mut map2 = HashMap::new(); ++ map2.insert(1, DISARMED); ++ map2.insert(2, ARMED); ++ map2.insert(3, DISARMED); ++ map2.insert(4, DISARMED); ++ ++ map2.clone_from(&map1); ++ } ++ ++ #[test] ++ #[should_panic = "panic in clone"] ++ fn test_clone_from_memory_leaks() { ++ use alloc::vec::Vec; ++ ++ struct CheckedClone { ++ panic_in_clone: bool, ++ need_drop: Vec, ++ } ++ impl Clone for CheckedClone { ++ fn clone(&self) -> Self { ++ if self.panic_in_clone { ++ panic!("panic in clone") ++ } ++ Self { ++ panic_in_clone: self.panic_in_clone, ++ need_drop: self.need_drop.clone(), ++ } ++ } ++ } ++ let mut map1 = HashMap::new(); ++ map1.insert( ++ 1, ++ CheckedClone { ++ panic_in_clone: false, ++ need_drop: vec![0, 1, 2], ++ }, ++ ); ++ map1.insert( ++ 2, ++ CheckedClone { ++ panic_in_clone: false, ++ need_drop: vec![3, 4, 5], ++ }, ++ ); ++ map1.insert( ++ 3, ++ CheckedClone { ++ panic_in_clone: true, ++ need_drop: vec![6, 7, 8], ++ }, ++ ); ++ let _map2 = map1.clone(); ++ } ++ ++ struct MyAllocInner { ++ drop_count: Arc, ++ } ++ ++ #[derive(Clone)] ++ struct MyAlloc { ++ _inner: Arc, ++ } ++ ++ impl MyAlloc { ++ fn new(drop_count: Arc) -> Self { ++ MyAlloc { ++ _inner: Arc::new(MyAllocInner { drop_count }), ++ } ++ } ++ } ++ ++ impl Drop for MyAllocInner { ++ fn drop(&mut self) { ++ println!("MyAlloc freed."); ++ self.drop_count.fetch_sub(1, Ordering::SeqCst); ++ } ++ } ++ ++ #[cfg(feature="allocator-api2")] ++ unsafe impl Allocator for MyAlloc { ++ fn allocate(&self, layout: Layout) -> std::result::Result, AllocError> { ++ let g = Global; ++ g.allocate(layout) ++ } ++ ++ unsafe fn deallocate(&self, ptr: NonNull, layout: Layout) { ++ let g = Global; ++ g.deallocate(ptr, layout) ++ } ++ } ++ ++ #[test] ++ #[cfg(all(feature="allocator-api2", feature="ahash"))] ++ fn test_hashmap_into_iter_bug() { ++ let dropped: Arc = Arc::new(AtomicI8::new(1)); ++ ++ { ++ let mut map = HashMap::with_capacity_in(10, MyAlloc::new(dropped.clone())); ++ for i in 0..10 { ++ map.entry(i).or_insert_with(|| "i".to_string()); ++ } ++ ++ for (k, v) in map { ++ println!("{}, {}", k, v); ++ } ++ } ++ ++ // All allocator clones should already be dropped. ++ assert_eq!(dropped.load(Ordering::SeqCst), 0); ++ } ++ ++ #[derive(Debug)] ++ struct CheckedCloneDrop { ++ panic_in_clone: bool, ++ panic_in_drop: bool, ++ dropped: bool, ++ data: T, ++ } ++ ++ impl CheckedCloneDrop { ++ fn new(panic_in_clone: bool, panic_in_drop: bool, data: T) -> Self { ++ CheckedCloneDrop { ++ panic_in_clone, ++ panic_in_drop, ++ dropped: false, ++ data, ++ } ++ } ++ } ++ ++ impl Clone for CheckedCloneDrop { ++ fn clone(&self) -> Self { ++ if self.panic_in_clone { ++ panic!("panic in clone") ++ } ++ Self { ++ panic_in_clone: self.panic_in_clone, ++ panic_in_drop: self.panic_in_drop, ++ dropped: self.dropped, ++ data: self.data.clone(), ++ } ++ } ++ } ++ ++ impl Drop for CheckedCloneDrop { ++ fn drop(&mut self) { ++ if self.panic_in_drop { ++ self.dropped = true; ++ panic!("panic in drop"); ++ } ++ if self.dropped { ++ panic!("double drop"); ++ } ++ self.dropped = true; ++ } ++ } ++ ++ /// Return hashmap with predefined distribution of elements. ++ /// All elements will be located in the same order as elements ++ /// returned by iterator. ++ /// ++ /// This function does not panic, but returns an error as a `String` ++ /// to distinguish between a test panic and an error in the input data. ++ #[cfg(all(feature="allocator-api2", feature="ahash"))] ++ fn get_test_map( ++ iter: I, ++ mut fun: impl FnMut(u64) -> T, ++ alloc: A, ++ ) -> Result, DefaultHashBuilder, A>, String> ++ where ++ I: Iterator + Clone + ExactSizeIterator, ++ A: Allocator, ++ T: PartialEq + core::fmt::Debug, ++ { ++ use crate::scopeguard::guard; ++ ++ let mut map: HashMap, _, A> = ++ HashMap::with_capacity_in(iter.size_hint().0, alloc); ++ { ++ let mut guard = guard(&mut map, |map| { ++ for (_, value) in map.iter_mut() { ++ value.panic_in_drop = false ++ } ++ }); ++ ++ let mut count = 0; ++ // Hash and Key must be equal to each other for controlling the elements placement. ++ for (panic_in_clone, panic_in_drop) in iter.clone() { ++ if core::mem::needs_drop::() && panic_in_drop { ++ return Err(String::from( ++ "panic_in_drop can be set with a type that doesn't need to be dropped", ++ )); ++ } ++ guard.table.insert( ++ count, ++ ( ++ count, ++ CheckedCloneDrop::new(panic_in_clone, panic_in_drop, fun(count)), ++ ), ++ |(k, _)| *k, ++ ); ++ count += 1; ++ } ++ ++ // Let's check that all elements are located as we wanted ++ let mut check_count = 0; ++ for ((key, value), (panic_in_clone, panic_in_drop)) in guard.iter().zip(iter) { ++ if *key != check_count { ++ return Err(format!( ++ "key != check_count,\nkey: `{}`,\ncheck_count: `{}`", ++ key, check_count ++ )); ++ } ++ if value.dropped ++ || value.panic_in_clone != panic_in_clone ++ || value.panic_in_drop != panic_in_drop ++ || value.data != fun(check_count) ++ { ++ return Err(format!( ++ "Value is not equal to expected,\nvalue: `{:?}`,\nexpected: \ ++ `CheckedCloneDrop {{ panic_in_clone: {}, panic_in_drop: {}, dropped: {}, data: {:?} }}`", ++ value, panic_in_clone, panic_in_drop, false, fun(check_count) ++ )); ++ } ++ check_count += 1; ++ } ++ ++ if guard.len() != check_count as usize { ++ return Err(format!( ++ "map.len() != check_count,\nmap.len(): `{}`,\ncheck_count: `{}`", ++ guard.len(), ++ check_count ++ )); ++ } ++ ++ if count != check_count { ++ return Err(format!( ++ "count != check_count,\ncount: `{}`,\ncheck_count: `{}`", ++ count, check_count ++ )); ++ } ++ core::mem::forget(guard); ++ } ++ Ok(map) ++ } ++ ++ const DISARMED: bool = false; ++ const ARMED: bool = true; ++ ++ const ARMED_FLAGS: [bool; 8] = [ ++ DISARMED, DISARMED, DISARMED, ARMED, DISARMED, DISARMED, DISARMED, DISARMED, ++ ]; ++ ++ const DISARMED_FLAGS: [bool; 8] = [ ++ DISARMED, DISARMED, DISARMED, DISARMED, DISARMED, DISARMED, DISARMED, DISARMED, ++ ]; ++ ++ #[test] ++ #[should_panic = "panic in clone"] ++ #[cfg(all(feature="allocator-api2", feature="ahash"))] ++ fn test_clone_memory_leaks_and_double_drop_one() { ++ let dropped: Arc = Arc::new(AtomicI8::new(2)); ++ ++ { ++ assert_eq!(ARMED_FLAGS.len(), DISARMED_FLAGS.len()); ++ ++ let map: HashMap>, DefaultHashBuilder, MyAlloc> = ++ match get_test_map( ++ ARMED_FLAGS.into_iter().zip(DISARMED_FLAGS), ++ |n| vec![n], ++ MyAlloc::new(dropped.clone()), ++ ) { ++ Ok(map) => map, ++ Err(msg) => panic!("{msg}"), ++ }; ++ ++ // Clone should normally clone a few elements, and then (when the ++ // clone function panics), deallocate both its own memory, memory ++ // of `dropped: Arc` and the memory of already cloned ++ // elements (Vec memory inside CheckedCloneDrop). ++ let _map2 = map.clone(); ++ } ++ } ++ ++ #[test] ++ #[should_panic = "panic in drop"] ++ #[cfg(all(feature="allocator-api2", feature="ahash"))] ++ fn test_clone_memory_leaks_and_double_drop_two() { ++ let dropped: Arc = Arc::new(AtomicI8::new(2)); ++ ++ { ++ assert_eq!(ARMED_FLAGS.len(), DISARMED_FLAGS.len()); ++ ++ let map: HashMap, DefaultHashBuilder, _> = match get_test_map( ++ DISARMED_FLAGS.into_iter().zip(DISARMED_FLAGS), ++ |n| n, ++ MyAlloc::new(dropped.clone()), ++ ) { ++ Ok(map) => map, ++ Err(msg) => panic!("{msg}"), ++ }; ++ ++ let mut map2 = match get_test_map( ++ DISARMED_FLAGS.into_iter().zip(ARMED_FLAGS), ++ |n| n, ++ MyAlloc::new(dropped.clone()), ++ ) { ++ Ok(map) => map, ++ Err(msg) => panic!("{msg}"), ++ }; ++ ++ // The `clone_from` should try to drop the elements of `map2` without ++ // double drop and leaking the allocator. Elements that have not been ++ // dropped leak their memory. ++ map2.clone_from(&map); ++ } ++ } ++ ++ /// We check that we have a working table if the clone operation from another ++ /// thread ended in a panic (when buckets of maps are equal to each other). ++ #[test] ++ #[cfg(all(feature="allocator-api2", feature="ahash"))] ++ fn test_catch_panic_clone_from_when_len_is_equal() { ++ use std::thread; ++ ++ let dropped: Arc = Arc::new(AtomicI8::new(2)); ++ ++ { ++ assert_eq!(ARMED_FLAGS.len(), DISARMED_FLAGS.len()); ++ ++ let mut map = match get_test_map( ++ DISARMED_FLAGS.into_iter().zip(DISARMED_FLAGS), ++ |n| vec![n], ++ MyAlloc::new(dropped.clone()), ++ ) { ++ Ok(map) => map, ++ Err(msg) => panic!("{msg}"), ++ }; ++ ++ thread::scope(|s| { ++ let result: thread::ScopedJoinHandle<'_, String> = s.spawn(|| { ++ let scope_map = ++ match get_test_map(ARMED_FLAGS.into_iter().zip(DISARMED_FLAGS), |n| vec![n * 2], MyAlloc::new(dropped.clone())) { ++ Ok(map) => map, ++ Err(msg) => return msg, ++ }; ++ if map.table.buckets() != scope_map.table.buckets() { ++ return format!( ++ "map.table.buckets() != scope_map.table.buckets(),\nleft: `{}`,\nright: `{}`", ++ map.table.buckets(), scope_map.table.buckets() ++ ); ++ } ++ map.clone_from(&scope_map); ++ "We must fail the cloning!!!".to_owned() ++ }); ++ if let Ok(msg) = result.join() { ++ panic!("{msg}") ++ } ++ }); ++ ++ // Let's check that all iterators work fine and do not return elements ++ // (especially `RawIterRange`, which does not depend on the number of ++ // elements in the table, but looks directly at the control bytes) ++ // ++ // SAFETY: We know for sure that `RawTable` will outlive ++ // the returned `RawIter / RawIterRange` iterator. ++ assert_eq!(map.len(), 0); ++ assert_eq!(map.iter().count(), 0); ++ assert_eq!(unsafe { map.table.iter().count() }, 0); ++ assert_eq!(unsafe { map.table.iter().iter.count() }, 0); ++ ++ for idx in 0..map.table.buckets() { ++ let idx = idx as u64; ++ assert!( ++ map.table.find(idx, |(k, _)| *k == idx).is_none(), ++ "Index: {idx}" ++ ); ++ } ++ } ++ ++ // All allocator clones should already be dropped. ++ assert_eq!(dropped.load(Ordering::SeqCst), 0); ++ } ++ ++ /// We check that we have a working table if the clone operation from another ++ /// thread ended in a panic (when buckets of maps are not equal to each other). ++ #[test] ++ #[cfg(all(feature="allocator-api2", feature="ahash"))] ++ fn test_catch_panic_clone_from_when_len_is_not_equal() { ++ use std::thread; ++ ++ let dropped: Arc = Arc::new(AtomicI8::new(2)); ++ ++ { ++ assert_eq!(ARMED_FLAGS.len(), DISARMED_FLAGS.len()); ++ ++ let mut map = match get_test_map( ++ [DISARMED].into_iter().zip([DISARMED]), ++ |n| vec![n], ++ MyAlloc::new(dropped.clone()), ++ ) { ++ Ok(map) => map, ++ Err(msg) => panic!("{msg}"), ++ }; ++ ++ thread::scope(|s| { ++ let result: thread::ScopedJoinHandle<'_, String> = s.spawn(|| { ++ let scope_map = match get_test_map( ++ ARMED_FLAGS.into_iter().zip(DISARMED_FLAGS), ++ |n| vec![n * 2], ++ MyAlloc::new(dropped.clone()), ++ ) { ++ Ok(map) => map, ++ Err(msg) => return msg, ++ }; ++ if map.table.buckets() == scope_map.table.buckets() { ++ return format!( ++ "map.table.buckets() == scope_map.table.buckets(): `{}`", ++ map.table.buckets() ++ ); ++ } ++ map.clone_from(&scope_map); ++ "We must fail the cloning!!!".to_owned() ++ }); ++ if let Ok(msg) = result.join() { ++ panic!("{msg}") ++ } ++ }); ++ ++ // Let's check that all iterators work fine and do not return elements ++ // (especially `RawIterRange`, which does not depend on the number of ++ // elements in the table, but looks directly at the control bytes) ++ // ++ // SAFETY: We know for sure that `RawTable` will outlive ++ // the returned `RawIter / RawIterRange` iterator. ++ assert_eq!(map.len(), 0); ++ assert_eq!(map.iter().count(), 0); ++ assert_eq!(unsafe { map.table.iter().count() }, 0); ++ assert_eq!(unsafe { map.table.iter().iter.count() }, 0); ++ ++ for idx in 0..map.table.buckets() { ++ let idx = idx as u64; ++ assert!( ++ map.table.find(idx, |(k, _)| *k == idx).is_none(), ++ "Index: {idx}" ++ ); ++ } ++ } ++ ++ // All allocator clones should already be dropped. ++ assert_eq!(dropped.load(Ordering::SeqCst), 0); ++ } ++} +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/src/raw/alloc.rs mesa-25.3.3/subprojects/hashbrown-0.14.5/src/raw/alloc.rs +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/src/raw/alloc.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/src/raw/alloc.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,86 @@ ++pub(crate) use self::inner::{do_alloc, Allocator, Global}; ++ ++// Nightly-case. ++// Use unstable `allocator_api` feature. ++// This is compatible with `allocator-api2` which can be enabled or not. ++// This is used when building for `std`. ++#[cfg(feature = "nightly")] ++mod inner { ++ use crate::alloc::alloc::Layout; ++ pub use crate::alloc::alloc::{Allocator, Global}; ++ use core::ptr::NonNull; ++ ++ #[allow(clippy::map_err_ignore)] ++ pub(crate) fn do_alloc(alloc: &A, layout: Layout) -> Result, ()> { ++ match alloc.allocate(layout) { ++ Ok(ptr) => Ok(ptr.as_non_null_ptr()), ++ Err(_) => Err(()), ++ } ++ } ++} ++ ++// Basic non-nightly case. ++// This uses `allocator-api2` enabled by default. ++// If any crate enables "nightly" in `allocator-api2`, ++// this will be equivalent to the nightly case, ++// since `allocator_api2::alloc::Allocator` would be re-export of ++// `core::alloc::Allocator`. ++#[cfg(all(not(feature = "nightly"), feature = "allocator-api2"))] ++mod inner { ++ use crate::alloc::alloc::Layout; ++ pub use allocator_api2::alloc::{Allocator, Global}; ++ use core::ptr::NonNull; ++ ++ #[allow(clippy::map_err_ignore)] ++ pub(crate) fn do_alloc(alloc: &A, layout: Layout) -> Result, ()> { ++ match alloc.allocate(layout) { ++ Ok(ptr) => Ok(ptr.cast()), ++ Err(_) => Err(()), ++ } ++ } ++} ++ ++// No-defaults case. ++// When building with default-features turned off and ++// neither `nightly` nor `allocator-api2` is enabled, ++// this will be used. ++// Making it impossible to use any custom allocator with collections defined ++// in this crate. ++// Any crate in build-tree can enable `allocator-api2`, ++// or `nightly` without disturbing users that don't want to use it. ++#[cfg(not(any(feature = "nightly", feature = "allocator-api2")))] ++mod inner { ++ use crate::alloc::alloc::{alloc, dealloc, Layout}; ++ use core::ptr::NonNull; ++ ++ #[allow(clippy::missing_safety_doc)] // not exposed outside of this crate ++ pub unsafe trait Allocator { ++ fn allocate(&self, layout: Layout) -> Result, ()>; ++ unsafe fn deallocate(&self, ptr: NonNull, layout: Layout); ++ } ++ ++ #[derive(Copy, Clone)] ++ pub struct Global; ++ ++ unsafe impl Allocator for Global { ++ #[inline] ++ fn allocate(&self, layout: Layout) -> Result, ()> { ++ unsafe { NonNull::new(alloc(layout)).ok_or(()) } ++ } ++ #[inline] ++ unsafe fn deallocate(&self, ptr: NonNull, layout: Layout) { ++ dealloc(ptr.as_ptr(), layout); ++ } ++ } ++ ++ impl Default for Global { ++ #[inline] ++ fn default() -> Self { ++ Global ++ } ++ } ++ ++ pub(crate) fn do_alloc(alloc: &A, layout: Layout) -> Result, ()> { ++ alloc.allocate(layout) ++ } ++} +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/src/raw/bitmask.rs mesa-25.3.3/subprojects/hashbrown-0.14.5/src/raw/bitmask.rs +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/src/raw/bitmask.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/src/raw/bitmask.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,133 @@ ++use super::imp::{ ++ BitMaskWord, NonZeroBitMaskWord, BITMASK_ITER_MASK, BITMASK_MASK, BITMASK_STRIDE, ++}; ++ ++/// A bit mask which contains the result of a `Match` operation on a `Group` and ++/// allows iterating through them. ++/// ++/// The bit mask is arranged so that low-order bits represent lower memory ++/// addresses for group match results. ++/// ++/// For implementation reasons, the bits in the set may be sparsely packed with ++/// groups of 8 bits representing one element. If any of these bits are non-zero ++/// then this element is considered to true in the mask. If this is the ++/// case, `BITMASK_STRIDE` will be 8 to indicate a divide-by-8 should be ++/// performed on counts/indices to normalize this difference. `BITMASK_MASK` is ++/// similarly a mask of all the actually-used bits. ++/// ++/// To iterate over a bit mask, it must be converted to a form where only 1 bit ++/// is set per element. This is done by applying `BITMASK_ITER_MASK` on the ++/// mask bits. ++#[derive(Copy, Clone)] ++pub(crate) struct BitMask(pub(crate) BitMaskWord); ++ ++#[allow(clippy::use_self)] ++impl BitMask { ++ /// Returns a new `BitMask` with all bits inverted. ++ #[inline] ++ #[must_use] ++ #[allow(dead_code)] ++ pub(crate) fn invert(self) -> Self { ++ BitMask(self.0 ^ BITMASK_MASK) ++ } ++ ++ /// Returns a new `BitMask` with the lowest bit removed. ++ #[inline] ++ #[must_use] ++ fn remove_lowest_bit(self) -> Self { ++ BitMask(self.0 & (self.0 - 1)) ++ } ++ ++ /// Returns whether the `BitMask` has at least one set bit. ++ #[inline] ++ pub(crate) fn any_bit_set(self) -> bool { ++ self.0 != 0 ++ } ++ ++ /// Returns the first set bit in the `BitMask`, if there is one. ++ #[inline] ++ pub(crate) fn lowest_set_bit(self) -> Option { ++ if let Some(nonzero) = NonZeroBitMaskWord::new(self.0) { ++ Some(Self::nonzero_trailing_zeros(nonzero)) ++ } else { ++ None ++ } ++ } ++ ++ /// Returns the number of trailing zeroes in the `BitMask`. ++ #[inline] ++ pub(crate) fn trailing_zeros(self) -> usize { ++ // ARM doesn't have a trailing_zeroes instruction, and instead uses ++ // reverse_bits (RBIT) + leading_zeroes (CLZ). However older ARM ++ // versions (pre-ARMv7) don't have RBIT and need to emulate it ++ // instead. Since we only have 1 bit set in each byte on ARM, we can ++ // use swap_bytes (REV) + leading_zeroes instead. ++ if cfg!(target_arch = "arm") && BITMASK_STRIDE % 8 == 0 { ++ self.0.swap_bytes().leading_zeros() as usize / BITMASK_STRIDE ++ } else { ++ self.0.trailing_zeros() as usize / BITMASK_STRIDE ++ } ++ } ++ ++ /// Same as above but takes a `NonZeroBitMaskWord`. ++ #[inline] ++ fn nonzero_trailing_zeros(nonzero: NonZeroBitMaskWord) -> usize { ++ if cfg!(target_arch = "arm") && BITMASK_STRIDE % 8 == 0 { ++ // SAFETY: A byte-swapped non-zero value is still non-zero. ++ let swapped = unsafe { NonZeroBitMaskWord::new_unchecked(nonzero.get().swap_bytes()) }; ++ swapped.leading_zeros() as usize / BITMASK_STRIDE ++ } else { ++ nonzero.trailing_zeros() as usize / BITMASK_STRIDE ++ } ++ } ++ ++ /// Returns the number of leading zeroes in the `BitMask`. ++ #[inline] ++ pub(crate) fn leading_zeros(self) -> usize { ++ self.0.leading_zeros() as usize / BITMASK_STRIDE ++ } ++} ++ ++impl IntoIterator for BitMask { ++ type Item = usize; ++ type IntoIter = BitMaskIter; ++ ++ #[inline] ++ fn into_iter(self) -> BitMaskIter { ++ // A BitMask only requires each element (group of bits) to be non-zero. ++ // However for iteration we need each element to only contain 1 bit. ++ BitMaskIter(BitMask(self.0 & BITMASK_ITER_MASK)) ++ } ++} ++ ++/// Iterator over the contents of a `BitMask`, returning the indices of set ++/// bits. ++#[derive(Copy, Clone)] ++pub(crate) struct BitMaskIter(pub(crate) BitMask); ++ ++impl BitMaskIter { ++ /// Flip the bit in the mask for the entry at the given index. ++ /// ++ /// Returns the bit's previous state. ++ #[inline] ++ #[allow(clippy::cast_ptr_alignment)] ++ #[cfg(feature = "raw")] ++ pub(crate) unsafe fn flip(&mut self, index: usize) -> bool { ++ // NOTE: The + BITMASK_STRIDE - 1 is to set the high bit. ++ let mask = 1 << (index * BITMASK_STRIDE + BITMASK_STRIDE - 1); ++ self.0 .0 ^= mask; ++ // The bit was set if the bit is now 0. ++ self.0 .0 & mask == 0 ++ } ++} ++ ++impl Iterator for BitMaskIter { ++ type Item = usize; ++ ++ #[inline] ++ fn next(&mut self) -> Option { ++ let bit = self.0.lowest_set_bit()?; ++ self.0 = self.0.remove_lowest_bit(); ++ Some(bit) ++ } ++} +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/src/raw/generic.rs mesa-25.3.3/subprojects/hashbrown-0.14.5/src/raw/generic.rs +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/src/raw/generic.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/src/raw/generic.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,157 @@ ++use super::bitmask::BitMask; ++use super::EMPTY; ++use core::{mem, ptr}; ++ ++// Use the native word size as the group size. Using a 64-bit group size on ++// a 32-bit architecture will just end up being more expensive because ++// shifts and multiplies will need to be emulated. ++ ++cfg_if! { ++ if #[cfg(any( ++ target_pointer_width = "64", ++ target_arch = "aarch64", ++ target_arch = "x86_64", ++ target_arch = "wasm32", ++ ))] { ++ type GroupWord = u64; ++ type NonZeroGroupWord = core::num::NonZeroU64; ++ } else { ++ type GroupWord = u32; ++ type NonZeroGroupWord = core::num::NonZeroU32; ++ } ++} ++ ++pub(crate) type BitMaskWord = GroupWord; ++pub(crate) type NonZeroBitMaskWord = NonZeroGroupWord; ++pub(crate) const BITMASK_STRIDE: usize = 8; ++// We only care about the highest bit of each byte for the mask. ++#[allow(clippy::cast_possible_truncation, clippy::unnecessary_cast)] ++pub(crate) const BITMASK_MASK: BitMaskWord = 0x8080_8080_8080_8080_u64 as GroupWord; ++pub(crate) const BITMASK_ITER_MASK: BitMaskWord = !0; ++ ++/// Helper function to replicate a byte across a `GroupWord`. ++#[inline] ++fn repeat(byte: u8) -> GroupWord { ++ GroupWord::from_ne_bytes([byte; Group::WIDTH]) ++} ++ ++/// Abstraction over a group of control bytes which can be scanned in ++/// parallel. ++/// ++/// This implementation uses a word-sized integer. ++#[derive(Copy, Clone)] ++pub(crate) struct Group(GroupWord); ++ ++// We perform all operations in the native endianness, and convert to ++// little-endian just before creating a BitMask. The can potentially ++// enable the compiler to eliminate unnecessary byte swaps if we are ++// only checking whether a BitMask is empty. ++#[allow(clippy::use_self)] ++impl Group { ++ /// Number of bytes in the group. ++ pub(crate) const WIDTH: usize = mem::size_of::(); ++ ++ /// Returns a full group of empty bytes, suitable for use as the initial ++ /// value for an empty hash table. ++ /// ++ /// This is guaranteed to be aligned to the group size. ++ #[inline] ++ pub(crate) const fn static_empty() -> &'static [u8; Group::WIDTH] { ++ #[repr(C)] ++ struct AlignedBytes { ++ _align: [Group; 0], ++ bytes: [u8; Group::WIDTH], ++ } ++ const ALIGNED_BYTES: AlignedBytes = AlignedBytes { ++ _align: [], ++ bytes: [EMPTY; Group::WIDTH], ++ }; ++ &ALIGNED_BYTES.bytes ++ } ++ ++ /// Loads a group of bytes starting at the given address. ++ #[inline] ++ #[allow(clippy::cast_ptr_alignment)] // unaligned load ++ pub(crate) unsafe fn load(ptr: *const u8) -> Self { ++ Group(ptr::read_unaligned(ptr.cast())) ++ } ++ ++ /// Loads a group of bytes starting at the given address, which must be ++ /// aligned to `mem::align_of::()`. ++ #[inline] ++ #[allow(clippy::cast_ptr_alignment)] ++ pub(crate) unsafe fn load_aligned(ptr: *const u8) -> Self { ++ // FIXME: use align_offset once it stabilizes ++ debug_assert_eq!(ptr as usize & (mem::align_of::() - 1), 0); ++ Group(ptr::read(ptr.cast())) ++ } ++ ++ /// Stores the group of bytes to the given address, which must be ++ /// aligned to `mem::align_of::()`. ++ #[inline] ++ #[allow(clippy::cast_ptr_alignment)] ++ pub(crate) unsafe fn store_aligned(self, ptr: *mut u8) { ++ // FIXME: use align_offset once it stabilizes ++ debug_assert_eq!(ptr as usize & (mem::align_of::() - 1), 0); ++ ptr::write(ptr.cast(), self.0); ++ } ++ ++ /// Returns a `BitMask` indicating all bytes in the group which *may* ++ /// have the given value. ++ /// ++ /// This function may return a false positive in certain cases where ++ /// the byte in the group differs from the searched value only in its ++ /// lowest bit. This is fine because: ++ /// - This never happens for `EMPTY` and `DELETED`, only full entries. ++ /// - The check for key equality will catch these. ++ /// - This only happens if there is at least 1 true match. ++ /// - The chance of this happening is very low (< 1% chance per byte). ++ #[inline] ++ pub(crate) fn match_byte(self, byte: u8) -> BitMask { ++ // This algorithm is derived from ++ // https://graphics.stanford.edu/~seander/bithacks.html##ValueInWord ++ let cmp = self.0 ^ repeat(byte); ++ BitMask((cmp.wrapping_sub(repeat(0x01)) & !cmp & repeat(0x80)).to_le()) ++ } ++ ++ /// Returns a `BitMask` indicating all bytes in the group which are ++ /// `EMPTY`. ++ #[inline] ++ pub(crate) fn match_empty(self) -> BitMask { ++ // If the high bit is set, then the byte must be either: ++ // 1111_1111 (EMPTY) or 1000_0000 (DELETED). ++ // So we can just check if the top two bits are 1 by ANDing them. ++ BitMask((self.0 & (self.0 << 1) & repeat(0x80)).to_le()) ++ } ++ ++ /// Returns a `BitMask` indicating all bytes in the group which are ++ /// `EMPTY` or `DELETED`. ++ #[inline] ++ pub(crate) fn match_empty_or_deleted(self) -> BitMask { ++ // A byte is EMPTY or DELETED iff the high bit is set ++ BitMask((self.0 & repeat(0x80)).to_le()) ++ } ++ ++ /// Returns a `BitMask` indicating all bytes in the group which are full. ++ #[inline] ++ pub(crate) fn match_full(self) -> BitMask { ++ self.match_empty_or_deleted().invert() ++ } ++ ++ /// Performs the following transformation on all bytes in the group: ++ /// - `EMPTY => EMPTY` ++ /// - `DELETED => EMPTY` ++ /// - `FULL => DELETED` ++ #[inline] ++ pub(crate) fn convert_special_to_empty_and_full_to_deleted(self) -> Self { ++ // Map high_bit = 1 (EMPTY or DELETED) to 1111_1111 ++ // and high_bit = 0 (FULL) to 1000_0000 ++ // ++ // Here's this logic expanded to concrete values: ++ // let full = 1000_0000 (true) or 0000_0000 (false) ++ // !1000_0000 + 1 = 0111_1111 + 1 = 1000_0000 (no carry) ++ // !0000_0000 + 0 = 1111_1111 + 0 = 1111_1111 (no carry) ++ let full = !self.0 & repeat(0x80); ++ Group(!full + (full >> 7)) ++ } ++} +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/src/raw/mod.rs mesa-25.3.3/subprojects/hashbrown-0.14.5/src/raw/mod.rs +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/src/raw/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/src/raw/mod.rs 2024-05-23 13:02:57.000000000 -0500 +@@ -0,0 +1,4820 @@ ++use crate::alloc::alloc::{handle_alloc_error, Layout}; ++use crate::scopeguard::{guard, ScopeGuard}; ++use crate::TryReserveError; ++use core::iter::FusedIterator; ++use core::marker::PhantomData; ++use core::mem; ++use core::mem::MaybeUninit; ++use core::ptr::NonNull; ++use core::{hint, ptr}; ++ ++cfg_if! { ++ // Use the SSE2 implementation if possible: it allows us to scan 16 buckets ++ // at once instead of 8. We don't bother with AVX since it would require ++ // runtime dispatch and wouldn't gain us much anyways: the probability of ++ // finding a match drops off drastically after the first few buckets. ++ // ++ // I attempted an implementation on ARM using NEON instructions, but it ++ // turns out that most NEON instructions have multi-cycle latency, which in ++ // the end outweighs any gains over the generic implementation. ++ if #[cfg(all( ++ target_feature = "sse2", ++ any(target_arch = "x86", target_arch = "x86_64"), ++ not(miri), ++ ))] { ++ mod sse2; ++ use sse2 as imp; ++ } else if #[cfg(all( ++ target_arch = "aarch64", ++ target_feature = "neon", ++ // NEON intrinsics are currently broken on big-endian targets. ++ // See https://github.com/rust-lang/stdarch/issues/1484. ++ target_endian = "little", ++ not(miri), ++ ))] { ++ mod neon; ++ use neon as imp; ++ } else { ++ mod generic; ++ use generic as imp; ++ } ++} ++ ++mod alloc; ++pub(crate) use self::alloc::{do_alloc, Allocator, Global}; ++ ++mod bitmask; ++ ++use self::bitmask::BitMaskIter; ++use self::imp::Group; ++ ++// Branch prediction hint. This is currently only available on nightly but it ++// consistently improves performance by 10-15%. ++#[cfg(not(feature = "nightly"))] ++use core::convert::identity as likely; ++#[cfg(not(feature = "nightly"))] ++use core::convert::identity as unlikely; ++#[cfg(feature = "nightly")] ++use core::intrinsics::{likely, unlikely}; ++ ++// FIXME: use strict provenance functions once they are stable. ++// Implement it with a transmute for now. ++#[inline(always)] ++#[allow(clippy::useless_transmute)] // clippy is wrong, cast and transmute are different here ++fn invalid_mut(addr: usize) -> *mut T { ++ unsafe { core::mem::transmute(addr) } ++} ++ ++#[inline] ++unsafe fn offset_from(to: *const T, from: *const T) -> usize { ++ to.offset_from(from) as usize ++} ++ ++/// Whether memory allocation errors should return an error or abort. ++#[derive(Copy, Clone)] ++enum Fallibility { ++ Fallible, ++ Infallible, ++} ++ ++impl Fallibility { ++ /// Error to return on capacity overflow. ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn capacity_overflow(self) -> TryReserveError { ++ match self { ++ Fallibility::Fallible => TryReserveError::CapacityOverflow, ++ Fallibility::Infallible => panic!("Hash table capacity overflow"), ++ } ++ } ++ ++ /// Error to return on allocation error. ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn alloc_err(self, layout: Layout) -> TryReserveError { ++ match self { ++ Fallibility::Fallible => TryReserveError::AllocError { layout }, ++ Fallibility::Infallible => handle_alloc_error(layout), ++ } ++ } ++} ++ ++trait SizedTypeProperties: Sized { ++ const IS_ZERO_SIZED: bool = mem::size_of::() == 0; ++ const NEEDS_DROP: bool = mem::needs_drop::(); ++} ++ ++impl SizedTypeProperties for T {} ++ ++/// Control byte value for an empty bucket. ++const EMPTY: u8 = 0b1111_1111; ++ ++/// Control byte value for a deleted bucket. ++const DELETED: u8 = 0b1000_0000; ++ ++/// Checks whether a control byte represents a full bucket (top bit is clear). ++#[inline] ++fn is_full(ctrl: u8) -> bool { ++ ctrl & 0x80 == 0 ++} ++ ++/// Checks whether a control byte represents a special value (top bit is set). ++#[inline] ++fn is_special(ctrl: u8) -> bool { ++ ctrl & 0x80 != 0 ++} ++ ++/// Checks whether a special control value is EMPTY (just check 1 bit). ++#[inline] ++fn special_is_empty(ctrl: u8) -> bool { ++ debug_assert!(is_special(ctrl)); ++ ctrl & 0x01 != 0 ++} ++ ++/// Primary hash function, used to select the initial bucket to probe from. ++#[inline] ++#[allow(clippy::cast_possible_truncation)] ++fn h1(hash: u64) -> usize { ++ // On 32-bit platforms we simply ignore the higher hash bits. ++ hash as usize ++} ++ ++// Constant for h2 function that grabing the top 7 bits of the hash. ++const MIN_HASH_LEN: usize = if mem::size_of::() < mem::size_of::() { ++ mem::size_of::() ++} else { ++ mem::size_of::() ++}; ++ ++/// Secondary hash function, saved in the low 7 bits of the control byte. ++#[inline] ++#[allow(clippy::cast_possible_truncation)] ++fn h2(hash: u64) -> u8 { ++ // Grab the top 7 bits of the hash. While the hash is normally a full 64-bit ++ // value, some hash functions (such as FxHash) produce a usize result ++ // instead, which means that the top 32 bits are 0 on 32-bit platforms. ++ // So we use MIN_HASH_LEN constant to handle this. ++ let top7 = hash >> (MIN_HASH_LEN * 8 - 7); ++ (top7 & 0x7f) as u8 // truncation ++} ++ ++/// Probe sequence based on triangular numbers, which is guaranteed (since our ++/// table size is a power of two) to visit every group of elements exactly once. ++/// ++/// A triangular probe has us jump by 1 more group every time. So first we ++/// jump by 1 group (meaning we just continue our linear scan), then 2 groups ++/// (skipping over 1 group), then 3 groups (skipping over 2 groups), and so on. ++/// ++/// Proof that the probe will visit every group in the table: ++/// ++struct ProbeSeq { ++ pos: usize, ++ stride: usize, ++} ++ ++impl ProbeSeq { ++ #[inline] ++ fn move_next(&mut self, bucket_mask: usize) { ++ // We should have found an empty bucket by now and ended the probe. ++ debug_assert!( ++ self.stride <= bucket_mask, ++ "Went past end of probe sequence" ++ ); ++ ++ self.stride += Group::WIDTH; ++ self.pos += self.stride; ++ self.pos &= bucket_mask; ++ } ++} ++ ++/// Returns the number of buckets needed to hold the given number of items, ++/// taking the maximum load factor into account. ++/// ++/// Returns `None` if an overflow occurs. ++// Workaround for emscripten bug emscripten-core/emscripten-fastcomp#258 ++#[cfg_attr(target_os = "emscripten", inline(never))] ++#[cfg_attr(not(target_os = "emscripten"), inline)] ++fn capacity_to_buckets(cap: usize) -> Option { ++ debug_assert_ne!(cap, 0); ++ ++ // For small tables we require at least 1 empty bucket so that lookups are ++ // guaranteed to terminate if an element doesn't exist in the table. ++ if cap < 8 { ++ // We don't bother with a table size of 2 buckets since that can only ++ // hold a single element. Instead we skip directly to a 4 bucket table ++ // which can hold 3 elements. ++ return Some(if cap < 4 { 4 } else { 8 }); ++ } ++ ++ // Otherwise require 1/8 buckets to be empty (87.5% load) ++ // ++ // Be careful when modifying this, calculate_layout relies on the ++ // overflow check here. ++ let adjusted_cap = cap.checked_mul(8)? / 7; ++ ++ // Any overflows will have been caught by the checked_mul. Also, any ++ // rounding errors from the division above will be cleaned up by ++ // next_power_of_two (which can't overflow because of the previous division). ++ Some(adjusted_cap.next_power_of_two()) ++} ++ ++/// Returns the maximum effective capacity for the given bucket mask, taking ++/// the maximum load factor into account. ++#[inline] ++fn bucket_mask_to_capacity(bucket_mask: usize) -> usize { ++ if bucket_mask < 8 { ++ // For tables with 1/2/4/8 buckets, we always reserve one empty slot. ++ // Keep in mind that the bucket mask is one less than the bucket count. ++ bucket_mask ++ } else { ++ // For larger tables we reserve 12.5% of the slots as empty. ++ ((bucket_mask + 1) / 8) * 7 ++ } ++} ++ ++/// Helper which allows the max calculation for ctrl_align to be statically computed for each T ++/// while keeping the rest of `calculate_layout_for` independent of `T` ++#[derive(Copy, Clone)] ++struct TableLayout { ++ size: usize, ++ ctrl_align: usize, ++} ++ ++impl TableLayout { ++ #[inline] ++ const fn new() -> Self { ++ let layout = Layout::new::(); ++ Self { ++ size: layout.size(), ++ ctrl_align: if layout.align() > Group::WIDTH { ++ layout.align() ++ } else { ++ Group::WIDTH ++ }, ++ } ++ } ++ ++ #[inline] ++ fn calculate_layout_for(self, buckets: usize) -> Option<(Layout, usize)> { ++ debug_assert!(buckets.is_power_of_two()); ++ ++ let TableLayout { size, ctrl_align } = self; ++ // Manual layout calculation since Layout methods are not yet stable. ++ let ctrl_offset = ++ size.checked_mul(buckets)?.checked_add(ctrl_align - 1)? & !(ctrl_align - 1); ++ let len = ctrl_offset.checked_add(buckets + Group::WIDTH)?; ++ ++ // We need an additional check to ensure that the allocation doesn't ++ // exceed `isize::MAX` (https://github.com/rust-lang/rust/pull/95295). ++ if len > isize::MAX as usize - (ctrl_align - 1) { ++ return None; ++ } ++ ++ Some(( ++ unsafe { Layout::from_size_align_unchecked(len, ctrl_align) }, ++ ctrl_offset, ++ )) ++ } ++} ++ ++/// A reference to an empty bucket into which an can be inserted. ++pub struct InsertSlot { ++ index: usize, ++} ++ ++/// A reference to a hash table bucket containing a `T`. ++/// ++/// This is usually just a pointer to the element itself. However if the element ++/// is a ZST, then we instead track the index of the element in the table so ++/// that `erase` works properly. ++pub struct Bucket { ++ // Actually it is pointer to next element than element itself ++ // this is needed to maintain pointer arithmetic invariants ++ // keeping direct pointer to element introduces difficulty. ++ // Using `NonNull` for variance and niche layout ++ ptr: NonNull, ++} ++ ++// This Send impl is needed for rayon support. This is safe since Bucket is ++// never exposed in a public API. ++unsafe impl Send for Bucket {} ++ ++impl Clone for Bucket { ++ #[inline] ++ fn clone(&self) -> Self { ++ Self { ptr: self.ptr } ++ } ++} ++ ++impl Bucket { ++ /// Creates a [`Bucket`] that contain pointer to the data. ++ /// The pointer calculation is performed by calculating the ++ /// offset from given `base` pointer (convenience for ++ /// `base.as_ptr().sub(index)`). ++ /// ++ /// `index` is in units of `T`; e.g., an `index` of 3 represents a pointer ++ /// offset of `3 * size_of::()` bytes. ++ /// ++ /// If the `T` is a ZST, then we instead track the index of the element ++ /// in the table so that `erase` works properly (return ++ /// `NonNull::new_unchecked((index + 1) as *mut T)`) ++ /// ++ /// # Safety ++ /// ++ /// If `mem::size_of::() != 0`, then the safety rules are directly derived ++ /// from the safety rules for [`<*mut T>::sub`] method of `*mut T` and the safety ++ /// rules of [`NonNull::new_unchecked`] function. ++ /// ++ /// Thus, in order to uphold the safety contracts for the [`<*mut T>::sub`] method ++ /// and [`NonNull::new_unchecked`] function, as well as for the correct ++ /// logic of the work of this crate, the following rules are necessary and ++ /// sufficient: ++ /// ++ /// * the `base` pointer must not be `dangling` and must points to the ++ /// end of the first `value element` from the `data part` of the table, i.e. ++ /// must be the pointer that returned by [`RawTable::data_end`] or by ++ /// [`RawTableInner::data_end`]; ++ /// ++ /// * `index` must not be greater than `RawTableInner.bucket_mask`, i.e. ++ /// `index <= RawTableInner.bucket_mask` or, in other words, `(index + 1)` ++ /// must be no greater than the number returned by the function ++ /// [`RawTable::buckets`] or [`RawTableInner::buckets`]. ++ /// ++ /// If `mem::size_of::() == 0`, then the only requirement is that the ++ /// `index` must not be greater than `RawTableInner.bucket_mask`, i.e. ++ /// `index <= RawTableInner.bucket_mask` or, in other words, `(index + 1)` ++ /// must be no greater than the number returned by the function ++ /// [`RawTable::buckets`] or [`RawTableInner::buckets`]. ++ /// ++ /// [`Bucket`]: crate::raw::Bucket ++ /// [`<*mut T>::sub`]: https://doc.rust-lang.org/core/primitive.pointer.html#method.sub-1 ++ /// [`NonNull::new_unchecked`]: https://doc.rust-lang.org/stable/std/ptr/struct.NonNull.html#method.new_unchecked ++ /// [`RawTable::data_end`]: crate::raw::RawTable::data_end ++ /// [`RawTableInner::data_end`]: RawTableInner::data_end ++ /// [`RawTable::buckets`]: crate::raw::RawTable::buckets ++ /// [`RawTableInner::buckets`]: RawTableInner::buckets ++ #[inline] ++ unsafe fn from_base_index(base: NonNull, index: usize) -> Self { ++ // If mem::size_of::() != 0 then return a pointer to an `element` in ++ // the data part of the table (we start counting from "0", so that ++ // in the expression T[last], the "last" index actually one less than the ++ // "buckets" number in the table, i.e. "last = RawTableInner.bucket_mask"): ++ // ++ // `from_base_index(base, 1).as_ptr()` returns a pointer that ++ // points here in the data part of the table ++ // (to the start of T1) ++ // | ++ // | `base: NonNull` must point here ++ // | (to the end of T0 or to the start of C0) ++ // v v ++ // [Padding], Tlast, ..., |T1|, T0, |C0, C1, ..., Clast ++ // ^ ++ // `from_base_index(base, 1)` returns a pointer ++ // that points here in the data part of the table ++ // (to the end of T1) ++ // ++ // where: T0...Tlast - our stored data; C0...Clast - control bytes ++ // or metadata for data. ++ let ptr = if T::IS_ZERO_SIZED { ++ // won't overflow because index must be less than length (bucket_mask) ++ // and bucket_mask is guaranteed to be less than `isize::MAX` ++ // (see TableLayout::calculate_layout_for method) ++ invalid_mut(index + 1) ++ } else { ++ base.as_ptr().sub(index) ++ }; ++ Self { ++ ptr: NonNull::new_unchecked(ptr), ++ } ++ } ++ ++ /// Calculates the index of a [`Bucket`] as distance between two pointers ++ /// (convenience for `base.as_ptr().offset_from(self.ptr.as_ptr()) as usize`). ++ /// The returned value is in units of T: the distance in bytes divided by ++ /// [`core::mem::size_of::()`]. ++ /// ++ /// If the `T` is a ZST, then we return the index of the element in ++ /// the table so that `erase` works properly (return `self.ptr.as_ptr() as usize - 1`). ++ /// ++ /// This function is the inverse of [`from_base_index`]. ++ /// ++ /// # Safety ++ /// ++ /// If `mem::size_of::() != 0`, then the safety rules are directly derived ++ /// from the safety rules for [`<*const T>::offset_from`] method of `*const T`. ++ /// ++ /// Thus, in order to uphold the safety contracts for [`<*const T>::offset_from`] ++ /// method, as well as for the correct logic of the work of this crate, the ++ /// following rules are necessary and sufficient: ++ /// ++ /// * `base` contained pointer must not be `dangling` and must point to the ++ /// end of the first `element` from the `data part` of the table, i.e. ++ /// must be a pointer that returns by [`RawTable::data_end`] or by ++ /// [`RawTableInner::data_end`]; ++ /// ++ /// * `self` also must not contain dangling pointer; ++ /// ++ /// * both `self` and `base` must be created from the same [`RawTable`] ++ /// (or [`RawTableInner`]). ++ /// ++ /// If `mem::size_of::() == 0`, this function is always safe. ++ /// ++ /// [`Bucket`]: crate::raw::Bucket ++ /// [`from_base_index`]: crate::raw::Bucket::from_base_index ++ /// [`RawTable::data_end`]: crate::raw::RawTable::data_end ++ /// [`RawTableInner::data_end`]: RawTableInner::data_end ++ /// [`RawTable`]: crate::raw::RawTable ++ /// [`RawTableInner`]: RawTableInner ++ /// [`<*const T>::offset_from`]: https://doc.rust-lang.org/nightly/core/primitive.pointer.html#method.offset_from ++ #[inline] ++ unsafe fn to_base_index(&self, base: NonNull) -> usize { ++ // If mem::size_of::() != 0 then return an index under which we used to store the ++ // `element` in the data part of the table (we start counting from "0", so ++ // that in the expression T[last], the "last" index actually is one less than the ++ // "buckets" number in the table, i.e. "last = RawTableInner.bucket_mask"). ++ // For example for 5th element in table calculation is performed like this: ++ // ++ // mem::size_of::() ++ // | ++ // | `self = from_base_index(base, 5)` that returns pointer ++ // | that points here in tha data part of the table ++ // | (to the end of T5) ++ // | | `base: NonNull` must point here ++ // v | (to the end of T0 or to the start of C0) ++ // /???\ v v ++ // [Padding], Tlast, ..., |T10|, ..., T5|, T4, T3, T2, T1, T0, |C0, C1, C2, C3, C4, C5, ..., C10, ..., Clast ++ // \__________ __________/ ++ // \/ ++ // `bucket.to_base_index(base)` = 5 ++ // (base.as_ptr() as usize - self.ptr.as_ptr() as usize) / mem::size_of::() ++ // ++ // where: T0...Tlast - our stored data; C0...Clast - control bytes or metadata for data. ++ if T::IS_ZERO_SIZED { ++ // this can not be UB ++ self.ptr.as_ptr() as usize - 1 ++ } else { ++ offset_from(base.as_ptr(), self.ptr.as_ptr()) ++ } ++ } ++ ++ /// Acquires the underlying raw pointer `*mut T` to `data`. ++ /// ++ /// # Note ++ /// ++ /// If `T` is not [`Copy`], do not use `*mut T` methods that can cause calling the ++ /// destructor of `T` (for example the [`<*mut T>::drop_in_place`] method), because ++ /// for properly dropping the data we also need to clear `data` control bytes. If we ++ /// drop data, but do not clear `data control byte` it leads to double drop when ++ /// [`RawTable`] goes out of scope. ++ /// ++ /// If you modify an already initialized `value`, so [`Hash`] and [`Eq`] on the new ++ /// `T` value and its borrowed form *must* match those for the old `T` value, as the map ++ /// will not re-evaluate where the new value should go, meaning the value may become ++ /// "lost" if their location does not reflect their state. ++ /// ++ /// [`RawTable`]: crate::raw::RawTable ++ /// [`<*mut T>::drop_in_place`]: https://doc.rust-lang.org/core/primitive.pointer.html#method.drop_in_place ++ /// [`Hash`]: https://doc.rust-lang.org/core/hash/trait.Hash.html ++ /// [`Eq`]: https://doc.rust-lang.org/core/cmp/trait.Eq.html ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// # #[cfg(feature = "raw")] ++ /// # fn test() { ++ /// use core::hash::{BuildHasher, Hash}; ++ /// use hashbrown::raw::{Bucket, RawTable}; ++ /// ++ /// type NewHashBuilder = core::hash::BuildHasherDefault; ++ /// ++ /// fn make_hash(hash_builder: &S, key: &K) -> u64 { ++ /// use core::hash::Hasher; ++ /// let mut state = hash_builder.build_hasher(); ++ /// key.hash(&mut state); ++ /// state.finish() ++ /// } ++ /// ++ /// let hash_builder = NewHashBuilder::default(); ++ /// let mut table = RawTable::new(); ++ /// ++ /// let value = ("a", 100); ++ /// let hash = make_hash(&hash_builder, &value.0); ++ /// ++ /// table.insert(hash, value.clone(), |val| make_hash(&hash_builder, &val.0)); ++ /// ++ /// let bucket: Bucket<(&str, i32)> = table.find(hash, |(k1, _)| k1 == &value.0).unwrap(); ++ /// ++ /// assert_eq!(unsafe { &*bucket.as_ptr() }, &("a", 100)); ++ /// # } ++ /// # fn main() { ++ /// # #[cfg(feature = "raw")] ++ /// # test() ++ /// # } ++ /// ``` ++ #[inline] ++ pub fn as_ptr(&self) -> *mut T { ++ if T::IS_ZERO_SIZED { ++ // Just return an arbitrary ZST pointer which is properly aligned ++ // invalid pointer is good enough for ZST ++ invalid_mut(mem::align_of::()) ++ } else { ++ unsafe { self.ptr.as_ptr().sub(1) } ++ } ++ } ++ ++ /// Create a new [`Bucket`] that is offset from the `self` by the given ++ /// `offset`. The pointer calculation is performed by calculating the ++ /// offset from `self` pointer (convenience for `self.ptr.as_ptr().sub(offset)`). ++ /// This function is used for iterators. ++ /// ++ /// `offset` is in units of `T`; e.g., a `offset` of 3 represents a pointer ++ /// offset of `3 * size_of::()` bytes. ++ /// ++ /// # Safety ++ /// ++ /// If `mem::size_of::() != 0`, then the safety rules are directly derived ++ /// from the safety rules for [`<*mut T>::sub`] method of `*mut T` and safety ++ /// rules of [`NonNull::new_unchecked`] function. ++ /// ++ /// Thus, in order to uphold the safety contracts for [`<*mut T>::sub`] method ++ /// and [`NonNull::new_unchecked`] function, as well as for the correct ++ /// logic of the work of this crate, the following rules are necessary and ++ /// sufficient: ++ /// ++ /// * `self` contained pointer must not be `dangling`; ++ /// ++ /// * `self.to_base_index() + ofset` must not be greater than `RawTableInner.bucket_mask`, ++ /// i.e. `(self.to_base_index() + ofset) <= RawTableInner.bucket_mask` or, in other ++ /// words, `self.to_base_index() + ofset + 1` must be no greater than the number returned ++ /// by the function [`RawTable::buckets`] or [`RawTableInner::buckets`]. ++ /// ++ /// If `mem::size_of::() == 0`, then the only requirement is that the ++ /// `self.to_base_index() + ofset` must not be greater than `RawTableInner.bucket_mask`, ++ /// i.e. `(self.to_base_index() + ofset) <= RawTableInner.bucket_mask` or, in other words, ++ /// `self.to_base_index() + ofset + 1` must be no greater than the number returned by the ++ /// function [`RawTable::buckets`] or [`RawTableInner::buckets`]. ++ /// ++ /// [`Bucket`]: crate::raw::Bucket ++ /// [`<*mut T>::sub`]: https://doc.rust-lang.org/core/primitive.pointer.html#method.sub-1 ++ /// [`NonNull::new_unchecked`]: https://doc.rust-lang.org/stable/std/ptr/struct.NonNull.html#method.new_unchecked ++ /// [`RawTable::buckets`]: crate::raw::RawTable::buckets ++ /// [`RawTableInner::buckets`]: RawTableInner::buckets ++ #[inline] ++ unsafe fn next_n(&self, offset: usize) -> Self { ++ let ptr = if T::IS_ZERO_SIZED { ++ // invalid pointer is good enough for ZST ++ invalid_mut(self.ptr.as_ptr() as usize + offset) ++ } else { ++ self.ptr.as_ptr().sub(offset) ++ }; ++ Self { ++ ptr: NonNull::new_unchecked(ptr), ++ } ++ } ++ ++ /// Executes the destructor (if any) of the pointed-to `data`. ++ /// ++ /// # Safety ++ /// ++ /// See [`ptr::drop_in_place`] for safety concerns. ++ /// ++ /// You should use [`RawTable::erase`] instead of this function, ++ /// or be careful with calling this function directly, because for ++ /// properly dropping the data we need also clear `data` control bytes. ++ /// If we drop data, but do not erase `data control byte` it leads to ++ /// double drop when [`RawTable`] goes out of scope. ++ /// ++ /// [`ptr::drop_in_place`]: https://doc.rust-lang.org/core/ptr/fn.drop_in_place.html ++ /// [`RawTable`]: crate::raw::RawTable ++ /// [`RawTable::erase`]: crate::raw::RawTable::erase ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub(crate) unsafe fn drop(&self) { ++ self.as_ptr().drop_in_place(); ++ } ++ ++ /// Reads the `value` from `self` without moving it. This leaves the ++ /// memory in `self` unchanged. ++ /// ++ /// # Safety ++ /// ++ /// See [`ptr::read`] for safety concerns. ++ /// ++ /// You should use [`RawTable::remove`] instead of this function, ++ /// or be careful with calling this function directly, because compiler ++ /// calls its destructor when readed `value` goes out of scope. It ++ /// can cause double dropping when [`RawTable`] goes out of scope, ++ /// because of not erased `data control byte`. ++ /// ++ /// [`ptr::read`]: https://doc.rust-lang.org/core/ptr/fn.read.html ++ /// [`RawTable`]: crate::raw::RawTable ++ /// [`RawTable::remove`]: crate::raw::RawTable::remove ++ #[inline] ++ pub(crate) unsafe fn read(&self) -> T { ++ self.as_ptr().read() ++ } ++ ++ /// Overwrites a memory location with the given `value` without reading ++ /// or dropping the old value (like [`ptr::write`] function). ++ /// ++ /// # Safety ++ /// ++ /// See [`ptr::write`] for safety concerns. ++ /// ++ /// # Note ++ /// ++ /// [`Hash`] and [`Eq`] on the new `T` value and its borrowed form *must* match ++ /// those for the old `T` value, as the map will not re-evaluate where the new ++ /// value should go, meaning the value may become "lost" if their location ++ /// does not reflect their state. ++ /// ++ /// [`ptr::write`]: https://doc.rust-lang.org/core/ptr/fn.write.html ++ /// [`Hash`]: https://doc.rust-lang.org/core/hash/trait.Hash.html ++ /// [`Eq`]: https://doc.rust-lang.org/core/cmp/trait.Eq.html ++ #[inline] ++ pub(crate) unsafe fn write(&self, val: T) { ++ self.as_ptr().write(val); ++ } ++ ++ /// Returns a shared immutable reference to the `value`. ++ /// ++ /// # Safety ++ /// ++ /// See [`NonNull::as_ref`] for safety concerns. ++ /// ++ /// [`NonNull::as_ref`]: https://doc.rust-lang.org/core/ptr/struct.NonNull.html#method.as_ref ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// # #[cfg(feature = "raw")] ++ /// # fn test() { ++ /// use core::hash::{BuildHasher, Hash}; ++ /// use hashbrown::raw::{Bucket, RawTable}; ++ /// ++ /// type NewHashBuilder = core::hash::BuildHasherDefault; ++ /// ++ /// fn make_hash(hash_builder: &S, key: &K) -> u64 { ++ /// use core::hash::Hasher; ++ /// let mut state = hash_builder.build_hasher(); ++ /// key.hash(&mut state); ++ /// state.finish() ++ /// } ++ /// ++ /// let hash_builder = NewHashBuilder::default(); ++ /// let mut table = RawTable::new(); ++ /// ++ /// let value: (&str, String) = ("A pony", "is a small horse".to_owned()); ++ /// let hash = make_hash(&hash_builder, &value.0); ++ /// ++ /// table.insert(hash, value.clone(), |val| make_hash(&hash_builder, &val.0)); ++ /// ++ /// let bucket: Bucket<(&str, String)> = table.find(hash, |(k, _)| k == &value.0).unwrap(); ++ /// ++ /// assert_eq!( ++ /// unsafe { bucket.as_ref() }, ++ /// &("A pony", "is a small horse".to_owned()) ++ /// ); ++ /// # } ++ /// # fn main() { ++ /// # #[cfg(feature = "raw")] ++ /// # test() ++ /// # } ++ /// ``` ++ #[inline] ++ pub unsafe fn as_ref<'a>(&self) -> &'a T { ++ &*self.as_ptr() ++ } ++ ++ /// Returns a unique mutable reference to the `value`. ++ /// ++ /// # Safety ++ /// ++ /// See [`NonNull::as_mut`] for safety concerns. ++ /// ++ /// # Note ++ /// ++ /// [`Hash`] and [`Eq`] on the new `T` value and its borrowed form *must* match ++ /// those for the old `T` value, as the map will not re-evaluate where the new ++ /// value should go, meaning the value may become "lost" if their location ++ /// does not reflect their state. ++ /// ++ /// [`NonNull::as_mut`]: https://doc.rust-lang.org/core/ptr/struct.NonNull.html#method.as_mut ++ /// [`Hash`]: https://doc.rust-lang.org/core/hash/trait.Hash.html ++ /// [`Eq`]: https://doc.rust-lang.org/core/cmp/trait.Eq.html ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// # #[cfg(feature = "raw")] ++ /// # fn test() { ++ /// use core::hash::{BuildHasher, Hash}; ++ /// use hashbrown::raw::{Bucket, RawTable}; ++ /// ++ /// type NewHashBuilder = core::hash::BuildHasherDefault; ++ /// ++ /// fn make_hash(hash_builder: &S, key: &K) -> u64 { ++ /// use core::hash::Hasher; ++ /// let mut state = hash_builder.build_hasher(); ++ /// key.hash(&mut state); ++ /// state.finish() ++ /// } ++ /// ++ /// let hash_builder = NewHashBuilder::default(); ++ /// let mut table = RawTable::new(); ++ /// ++ /// let value: (&str, String) = ("A pony", "is a small horse".to_owned()); ++ /// let hash = make_hash(&hash_builder, &value.0); ++ /// ++ /// table.insert(hash, value.clone(), |val| make_hash(&hash_builder, &val.0)); ++ /// ++ /// let bucket: Bucket<(&str, String)> = table.find(hash, |(k, _)| k == &value.0).unwrap(); ++ /// ++ /// unsafe { ++ /// bucket ++ /// .as_mut() ++ /// .1 ++ /// .push_str(" less than 147 cm at the withers") ++ /// }; ++ /// assert_eq!( ++ /// unsafe { bucket.as_ref() }, ++ /// &( ++ /// "A pony", ++ /// "is a small horse less than 147 cm at the withers".to_owned() ++ /// ) ++ /// ); ++ /// # } ++ /// # fn main() { ++ /// # #[cfg(feature = "raw")] ++ /// # test() ++ /// # } ++ /// ``` ++ #[inline] ++ pub unsafe fn as_mut<'a>(&self) -> &'a mut T { ++ &mut *self.as_ptr() ++ } ++ ++ /// Copies `size_of` bytes from `other` to `self`. The source ++ /// and destination may *not* overlap. ++ /// ++ /// # Safety ++ /// ++ /// See [`ptr::copy_nonoverlapping`] for safety concerns. ++ /// ++ /// Like [`read`], `copy_nonoverlapping` creates a bitwise copy of `T`, regardless of ++ /// whether `T` is [`Copy`]. If `T` is not [`Copy`], using *both* the values ++ /// in the region beginning at `*self` and the region beginning at `*other` can ++ /// [violate memory safety]. ++ /// ++ /// # Note ++ /// ++ /// [`Hash`] and [`Eq`] on the new `T` value and its borrowed form *must* match ++ /// those for the old `T` value, as the map will not re-evaluate where the new ++ /// value should go, meaning the value may become "lost" if their location ++ /// does not reflect their state. ++ /// ++ /// [`ptr::copy_nonoverlapping`]: https://doc.rust-lang.org/core/ptr/fn.copy_nonoverlapping.html ++ /// [`read`]: https://doc.rust-lang.org/core/ptr/fn.read.html ++ /// [violate memory safety]: https://doc.rust-lang.org/std/ptr/fn.read.html#ownership-of-the-returned-value ++ /// [`Hash`]: https://doc.rust-lang.org/core/hash/trait.Hash.html ++ /// [`Eq`]: https://doc.rust-lang.org/core/cmp/trait.Eq.html ++ #[cfg(feature = "raw")] ++ #[inline] ++ pub unsafe fn copy_from_nonoverlapping(&self, other: &Self) { ++ self.as_ptr().copy_from_nonoverlapping(other.as_ptr(), 1); ++ } ++} ++ ++/// A raw hash table with an unsafe API. ++pub struct RawTable { ++ table: RawTableInner, ++ alloc: A, ++ // Tell dropck that we own instances of T. ++ marker: PhantomData, ++} ++ ++/// Non-generic part of `RawTable` which allows functions to be instantiated only once regardless ++/// of how many different key-value types are used. ++struct RawTableInner { ++ // Mask to get an index from a hash value. The value is one less than the ++ // number of buckets in the table. ++ bucket_mask: usize, ++ ++ // [Padding], T1, T2, ..., Tlast, C1, C2, ... ++ // ^ points here ++ ctrl: NonNull, ++ ++ // Number of elements that can be inserted before we need to grow the table ++ growth_left: usize, ++ ++ // Number of elements in the table, only really used by len() ++ items: usize, ++} ++ ++impl RawTable { ++ /// Creates a new empty hash table without allocating any memory. ++ /// ++ /// In effect this returns a table with exactly 1 bucket. However we can ++ /// leave the data pointer dangling since that bucket is never written to ++ /// due to our load factor forcing us to always have at least 1 free bucket. ++ #[inline] ++ pub const fn new() -> Self { ++ Self { ++ table: RawTableInner::NEW, ++ alloc: Global, ++ marker: PhantomData, ++ } ++ } ++ ++ /// Attempts to allocate a new hash table with at least enough capacity ++ /// for inserting the given number of elements without reallocating. ++ #[cfg(feature = "raw")] ++ pub fn try_with_capacity(capacity: usize) -> Result { ++ Self::try_with_capacity_in(capacity, Global) ++ } ++ ++ /// Allocates a new hash table with at least enough capacity for inserting ++ /// the given number of elements without reallocating. ++ pub fn with_capacity(capacity: usize) -> Self { ++ Self::with_capacity_in(capacity, Global) ++ } ++} ++ ++impl RawTable { ++ const TABLE_LAYOUT: TableLayout = TableLayout::new::(); ++ ++ /// Creates a new empty hash table without allocating any memory, using the ++ /// given allocator. ++ /// ++ /// In effect this returns a table with exactly 1 bucket. However we can ++ /// leave the data pointer dangling since that bucket is never written to ++ /// due to our load factor forcing us to always have at least 1 free bucket. ++ #[inline] ++ pub const fn new_in(alloc: A) -> Self { ++ Self { ++ table: RawTableInner::NEW, ++ alloc, ++ marker: PhantomData, ++ } ++ } ++ ++ /// Allocates a new hash table with the given number of buckets. ++ /// ++ /// The control bytes are left uninitialized. ++ #[cfg_attr(feature = "inline-more", inline)] ++ unsafe fn new_uninitialized( ++ alloc: A, ++ buckets: usize, ++ fallibility: Fallibility, ++ ) -> Result { ++ debug_assert!(buckets.is_power_of_two()); ++ ++ Ok(Self { ++ table: RawTableInner::new_uninitialized( ++ &alloc, ++ Self::TABLE_LAYOUT, ++ buckets, ++ fallibility, ++ )?, ++ alloc, ++ marker: PhantomData, ++ }) ++ } ++ ++ /// Attempts to allocate a new hash table using the given allocator, with at least enough ++ /// capacity for inserting the given number of elements without reallocating. ++ #[cfg(feature = "raw")] ++ pub fn try_with_capacity_in(capacity: usize, alloc: A) -> Result { ++ Ok(Self { ++ table: RawTableInner::fallible_with_capacity( ++ &alloc, ++ Self::TABLE_LAYOUT, ++ capacity, ++ Fallibility::Fallible, ++ )?, ++ alloc, ++ marker: PhantomData, ++ }) ++ } ++ ++ /// Allocates a new hash table using the given allocator, with at least enough capacity for ++ /// inserting the given number of elements without reallocating. ++ pub fn with_capacity_in(capacity: usize, alloc: A) -> Self { ++ Self { ++ table: RawTableInner::with_capacity(&alloc, Self::TABLE_LAYOUT, capacity), ++ alloc, ++ marker: PhantomData, ++ } ++ } ++ ++ /// Returns a reference to the underlying allocator. ++ #[inline] ++ pub fn allocator(&self) -> &A { ++ &self.alloc ++ } ++ ++ /// Returns pointer to one past last `data` element in the table as viewed from ++ /// the start point of the allocation. ++ /// ++ /// The caller must ensure that the `RawTable` outlives the returned [`NonNull`], ++ /// otherwise using it may result in [`undefined behavior`]. ++ /// ++ /// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html ++ #[inline] ++ pub fn data_end(&self) -> NonNull { ++ // `self.table.ctrl.cast()` returns pointer that ++ // points here (to the end of `T0`) ++ // ∨ ++ // [Pad], T_n, ..., T1, T0, |CT0, CT1, ..., CT_n|, CTa_0, CTa_1, ..., CTa_m ++ // \________ ________/ ++ // \/ ++ // `n = buckets - 1`, i.e. `RawTable::buckets() - 1` ++ // ++ // where: T0...T_n - our stored data; ++ // CT0...CT_n - control bytes or metadata for `data`. ++ // CTa_0...CTa_m - additional control bytes, where `m = Group::WIDTH - 1` (so that the search ++ // with loading `Group` bytes from the heap works properly, even if the result ++ // of `h1(hash) & self.bucket_mask` is equal to `self.bucket_mask`). See also ++ // `RawTableInner::set_ctrl` function. ++ // ++ // P.S. `h1(hash) & self.bucket_mask` is the same as `hash as usize % self.buckets()` because the number ++ // of buckets is a power of two, and `self.bucket_mask = self.buckets() - 1`. ++ self.table.ctrl.cast() ++ } ++ ++ /// Returns pointer to start of data table. ++ #[inline] ++ #[cfg(any(feature = "raw", feature = "nightly"))] ++ pub unsafe fn data_start(&self) -> NonNull { ++ NonNull::new_unchecked(self.data_end().as_ptr().wrapping_sub(self.buckets())) ++ } ++ ++ /// Return the information about memory allocated by the table. ++ /// ++ /// `RawTable` allocates single memory block to store both data and metadata. ++ /// This function returns allocation size and alignment and the beginning of the area. ++ /// These are the arguments which will be passed to `dealloc` when the table is dropped. ++ /// ++ /// This function might be useful for memory profiling. ++ #[inline] ++ #[cfg(feature = "raw")] ++ pub fn allocation_info(&self) -> (NonNull, Layout) { ++ // SAFETY: We use the same `table_layout` that was used to allocate ++ // this table. ++ unsafe { self.table.allocation_info_or_zero(Self::TABLE_LAYOUT) } ++ } ++ ++ /// Returns the index of a bucket from a `Bucket`. ++ #[inline] ++ pub unsafe fn bucket_index(&self, bucket: &Bucket) -> usize { ++ bucket.to_base_index(self.data_end()) ++ } ++ ++ /// Returns a pointer to an element in the table. ++ /// ++ /// The caller must ensure that the `RawTable` outlives the returned [`Bucket`], ++ /// otherwise using it may result in [`undefined behavior`]. ++ /// ++ /// # Safety ++ /// ++ /// If `mem::size_of::() != 0`, then the caller of this function must observe the ++ /// following safety rules: ++ /// ++ /// * The table must already be allocated; ++ /// ++ /// * The `index` must not be greater than the number returned by the [`RawTable::buckets`] ++ /// function, i.e. `(index + 1) <= self.buckets()`. ++ /// ++ /// It is safe to call this function with index of zero (`index == 0`) on a table that has ++ /// not been allocated, but using the returned [`Bucket`] results in [`undefined behavior`]. ++ /// ++ /// If `mem::size_of::() == 0`, then the only requirement is that the `index` must ++ /// not be greater than the number returned by the [`RawTable::buckets`] function, i.e. ++ /// `(index + 1) <= self.buckets()`. ++ /// ++ /// [`RawTable::buckets`]: RawTable::buckets ++ /// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html ++ #[inline] ++ pub unsafe fn bucket(&self, index: usize) -> Bucket { ++ // If mem::size_of::() != 0 then return a pointer to the `element` in the `data part` of the table ++ // (we start counting from "0", so that in the expression T[n], the "n" index actually one less than ++ // the "buckets" number of our `RawTable`, i.e. "n = RawTable::buckets() - 1"): ++ // ++ // `table.bucket(3).as_ptr()` returns a pointer that points here in the `data` ++ // part of the `RawTable`, i.e. to the start of T3 (see `Bucket::as_ptr`) ++ // | ++ // | `base = self.data_end()` points here ++ // | (to the start of CT0 or to the end of T0) ++ // v v ++ // [Pad], T_n, ..., |T3|, T2, T1, T0, |CT0, CT1, CT2, CT3, ..., CT_n, CTa_0, CTa_1, ..., CTa_m ++ // ^ \__________ __________/ ++ // `table.bucket(3)` returns a pointer that points \/ ++ // here in the `data` part of the `RawTable` (to additional control bytes ++ // the end of T3) `m = Group::WIDTH - 1` ++ // ++ // where: T0...T_n - our stored data; ++ // CT0...CT_n - control bytes or metadata for `data`; ++ // CTa_0...CTa_m - additional control bytes (so that the search with loading `Group` bytes from ++ // the heap works properly, even if the result of `h1(hash) & self.table.bucket_mask` ++ // is equal to `self.table.bucket_mask`). See also `RawTableInner::set_ctrl` function. ++ // ++ // P.S. `h1(hash) & self.table.bucket_mask` is the same as `hash as usize % self.buckets()` because the number ++ // of buckets is a power of two, and `self.table.bucket_mask = self.buckets() - 1`. ++ debug_assert_ne!(self.table.bucket_mask, 0); ++ debug_assert!(index < self.buckets()); ++ Bucket::from_base_index(self.data_end(), index) ++ } ++ ++ /// Erases an element from the table without dropping it. ++ #[cfg_attr(feature = "inline-more", inline)] ++ unsafe fn erase_no_drop(&mut self, item: &Bucket) { ++ let index = self.bucket_index(item); ++ self.table.erase(index); ++ } ++ ++ /// Erases an element from the table, dropping it in place. ++ #[cfg_attr(feature = "inline-more", inline)] ++ #[allow(clippy::needless_pass_by_value)] ++ pub unsafe fn erase(&mut self, item: Bucket) { ++ // Erase the element from the table first since drop might panic. ++ self.erase_no_drop(&item); ++ item.drop(); ++ } ++ ++ /// Finds and erases an element from the table, dropping it in place. ++ /// Returns true if an element was found. ++ #[cfg(feature = "raw")] ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn erase_entry(&mut self, hash: u64, eq: impl FnMut(&T) -> bool) -> bool { ++ // Avoid `Option::map` because it bloats LLVM IR. ++ if let Some(bucket) = self.find(hash, eq) { ++ unsafe { ++ self.erase(bucket); ++ } ++ true ++ } else { ++ false ++ } ++ } ++ ++ /// Removes an element from the table, returning it. ++ /// ++ /// This also returns an `InsertSlot` pointing to the newly free bucket. ++ #[cfg_attr(feature = "inline-more", inline)] ++ #[allow(clippy::needless_pass_by_value)] ++ pub unsafe fn remove(&mut self, item: Bucket) -> (T, InsertSlot) { ++ self.erase_no_drop(&item); ++ ( ++ item.read(), ++ InsertSlot { ++ index: self.bucket_index(&item), ++ }, ++ ) ++ } ++ ++ /// Finds and removes an element from the table, returning it. ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn remove_entry(&mut self, hash: u64, eq: impl FnMut(&T) -> bool) -> Option { ++ // Avoid `Option::map` because it bloats LLVM IR. ++ match self.find(hash, eq) { ++ Some(bucket) => Some(unsafe { self.remove(bucket).0 }), ++ None => None, ++ } ++ } ++ ++ /// Marks all table buckets as empty without dropping their contents. ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn clear_no_drop(&mut self) { ++ self.table.clear_no_drop(); ++ } ++ ++ /// Removes all elements from the table without freeing the backing memory. ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn clear(&mut self) { ++ if self.is_empty() { ++ // Special case empty table to avoid surprising O(capacity) time. ++ return; ++ } ++ // Ensure that the table is reset even if one of the drops panic ++ let mut self_ = guard(self, |self_| self_.clear_no_drop()); ++ unsafe { ++ // SAFETY: ScopeGuard sets to zero the `items` field of the table ++ // even in case of panic during the dropping of the elements so ++ // that there will be no double drop of the elements. ++ self_.table.drop_elements::(); ++ } ++ } ++ ++ /// Shrinks the table to fit `max(self.len(), min_size)` elements. ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn shrink_to(&mut self, min_size: usize, hasher: impl Fn(&T) -> u64) { ++ // Calculate the minimal number of elements that we need to reserve ++ // space for. ++ let min_size = usize::max(self.table.items, min_size); ++ if min_size == 0 { ++ let mut old_inner = mem::replace(&mut self.table, RawTableInner::NEW); ++ unsafe { ++ // SAFETY: ++ // 1. We call the function only once; ++ // 2. We know for sure that `alloc` and `table_layout` matches the [`Allocator`] ++ // and [`TableLayout`] that were used to allocate this table. ++ // 3. If any elements' drop function panics, then there will only be a memory leak, ++ // because we have replaced the inner table with a new one. ++ old_inner.drop_inner_table::(&self.alloc, Self::TABLE_LAYOUT); ++ } ++ return; ++ } ++ ++ // Calculate the number of buckets that we need for this number of ++ // elements. If the calculation overflows then the requested bucket ++ // count must be larger than what we have right and nothing needs to be ++ // done. ++ let min_buckets = match capacity_to_buckets(min_size) { ++ Some(buckets) => buckets, ++ None => return, ++ }; ++ ++ // If we have more buckets than we need, shrink the table. ++ if min_buckets < self.buckets() { ++ // Fast path if the table is empty ++ if self.table.items == 0 { ++ let new_inner = ++ RawTableInner::with_capacity(&self.alloc, Self::TABLE_LAYOUT, min_size); ++ let mut old_inner = mem::replace(&mut self.table, new_inner); ++ unsafe { ++ // SAFETY: ++ // 1. We call the function only once; ++ // 2. We know for sure that `alloc` and `table_layout` matches the [`Allocator`] ++ // and [`TableLayout`] that were used to allocate this table. ++ // 3. If any elements' drop function panics, then there will only be a memory leak, ++ // because we have replaced the inner table with a new one. ++ old_inner.drop_inner_table::(&self.alloc, Self::TABLE_LAYOUT); ++ } ++ } else { ++ // Avoid `Result::unwrap_or_else` because it bloats LLVM IR. ++ unsafe { ++ // SAFETY: ++ // 1. We know for sure that `min_size >= self.table.items`. ++ // 2. The [`RawTableInner`] must already have properly initialized control bytes since ++ // we will never expose RawTable::new_uninitialized in a public API. ++ if self ++ .resize(min_size, hasher, Fallibility::Infallible) ++ .is_err() ++ { ++ // SAFETY: The result of calling the `resize` function cannot be an error ++ // because `fallibility == Fallibility::Infallible. ++ hint::unreachable_unchecked() ++ } ++ } ++ } ++ } ++ } ++ ++ /// Ensures that at least `additional` items can be inserted into the table ++ /// without reallocation. ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn reserve(&mut self, additional: usize, hasher: impl Fn(&T) -> u64) { ++ if unlikely(additional > self.table.growth_left) { ++ // Avoid `Result::unwrap_or_else` because it bloats LLVM IR. ++ unsafe { ++ // SAFETY: The [`RawTableInner`] must already have properly initialized control ++ // bytes since we will never expose RawTable::new_uninitialized in a public API. ++ if self ++ .reserve_rehash(additional, hasher, Fallibility::Infallible) ++ .is_err() ++ { ++ // SAFETY: All allocation errors will be caught inside `RawTableInner::reserve_rehash`. ++ hint::unreachable_unchecked() ++ } ++ } ++ } ++ } ++ ++ /// Tries to ensure that at least `additional` items can be inserted into ++ /// the table without reallocation. ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn try_reserve( ++ &mut self, ++ additional: usize, ++ hasher: impl Fn(&T) -> u64, ++ ) -> Result<(), TryReserveError> { ++ if additional > self.table.growth_left { ++ // SAFETY: The [`RawTableInner`] must already have properly initialized control ++ // bytes since we will never expose RawTable::new_uninitialized in a public API. ++ unsafe { self.reserve_rehash(additional, hasher, Fallibility::Fallible) } ++ } else { ++ Ok(()) ++ } ++ } ++ ++ /// Out-of-line slow path for `reserve` and `try_reserve`. ++ /// ++ /// # Safety ++ /// ++ /// The [`RawTableInner`] must have properly initialized control bytes, ++ /// otherwise calling this function results in [`undefined behavior`] ++ /// ++ /// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html ++ #[cold] ++ #[inline(never)] ++ unsafe fn reserve_rehash( ++ &mut self, ++ additional: usize, ++ hasher: impl Fn(&T) -> u64, ++ fallibility: Fallibility, ++ ) -> Result<(), TryReserveError> { ++ unsafe { ++ // SAFETY: ++ // 1. We know for sure that `alloc` and `layout` matches the [`Allocator`] and ++ // [`TableLayout`] that were used to allocate this table. ++ // 2. The `drop` function is the actual drop function of the elements stored in ++ // the table. ++ // 3. The caller ensures that the control bytes of the `RawTableInner` ++ // are already initialized. ++ self.table.reserve_rehash_inner( ++ &self.alloc, ++ additional, ++ &|table, index| hasher(table.bucket::(index).as_ref()), ++ fallibility, ++ Self::TABLE_LAYOUT, ++ if T::NEEDS_DROP { ++ Some(mem::transmute(ptr::drop_in_place:: as unsafe fn(*mut T))) ++ } else { ++ None ++ }, ++ ) ++ } ++ } ++ ++ /// Allocates a new table of a different size and moves the contents of the ++ /// current table into it. ++ /// ++ /// # Safety ++ /// ++ /// The [`RawTableInner`] must have properly initialized control bytes, ++ /// otherwise calling this function results in [`undefined behavior`] ++ /// ++ /// The caller of this function must ensure that `capacity >= self.table.items` ++ /// otherwise: ++ /// ++ /// * If `self.table.items != 0`, calling of this function with `capacity` ++ /// equal to 0 (`capacity == 0`) results in [`undefined behavior`]. ++ /// ++ /// * If `capacity_to_buckets(capacity) < Group::WIDTH` and ++ /// `self.table.items > capacity_to_buckets(capacity)` ++ /// calling this function results in [`undefined behavior`]. ++ /// ++ /// * If `capacity_to_buckets(capacity) >= Group::WIDTH` and ++ /// `self.table.items > capacity_to_buckets(capacity)` ++ /// calling this function are never return (will go into an ++ /// infinite loop). ++ /// ++ /// See [`RawTableInner::find_insert_slot`] for more information. ++ /// ++ /// [`RawTableInner::find_insert_slot`]: RawTableInner::find_insert_slot ++ /// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html ++ unsafe fn resize( ++ &mut self, ++ capacity: usize, ++ hasher: impl Fn(&T) -> u64, ++ fallibility: Fallibility, ++ ) -> Result<(), TryReserveError> { ++ // SAFETY: ++ // 1. The caller of this function guarantees that `capacity >= self.table.items`. ++ // 2. We know for sure that `alloc` and `layout` matches the [`Allocator`] and ++ // [`TableLayout`] that were used to allocate this table. ++ // 3. The caller ensures that the control bytes of the `RawTableInner` ++ // are already initialized. ++ self.table.resize_inner( ++ &self.alloc, ++ capacity, ++ &|table, index| hasher(table.bucket::(index).as_ref()), ++ fallibility, ++ Self::TABLE_LAYOUT, ++ ) ++ } ++ ++ /// Inserts a new element into the table, and returns its raw bucket. ++ /// ++ /// This does not check if the given element already exists in the table. ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn insert(&mut self, hash: u64, value: T, hasher: impl Fn(&T) -> u64) -> Bucket { ++ unsafe { ++ // SAFETY: ++ // 1. The [`RawTableInner`] must already have properly initialized control bytes since ++ // we will never expose `RawTable::new_uninitialized` in a public API. ++ // ++ // 2. We reserve additional space (if necessary) right after calling this function. ++ let mut slot = self.table.find_insert_slot(hash); ++ ++ // We can avoid growing the table once we have reached our load factor if we are replacing ++ // a tombstone. This works since the number of EMPTY slots does not change in this case. ++ // ++ // SAFETY: The function is guaranteed to return [`InsertSlot`] that contains an index ++ // in the range `0..=self.buckets()`. ++ let old_ctrl = *self.table.ctrl(slot.index); ++ if unlikely(self.table.growth_left == 0 && special_is_empty(old_ctrl)) { ++ self.reserve(1, hasher); ++ // SAFETY: We know for sure that `RawTableInner` has control bytes ++ // initialized and that there is extra space in the table. ++ slot = self.table.find_insert_slot(hash); ++ } ++ ++ self.insert_in_slot(hash, slot, value) ++ } ++ } ++ ++ /// Attempts to insert a new element without growing the table and return its raw bucket. ++ /// ++ /// Returns an `Err` containing the given element if inserting it would require growing the ++ /// table. ++ /// ++ /// This does not check if the given element already exists in the table. ++ #[cfg(feature = "raw")] ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn try_insert_no_grow(&mut self, hash: u64, value: T) -> Result, T> { ++ unsafe { ++ match self.table.prepare_insert_no_grow(hash) { ++ Ok(index) => { ++ let bucket = self.bucket(index); ++ bucket.write(value); ++ Ok(bucket) ++ } ++ Err(()) => Err(value), ++ } ++ } ++ } ++ ++ /// Inserts a new element into the table, and returns a mutable reference to it. ++ /// ++ /// This does not check if the given element already exists in the table. ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn insert_entry(&mut self, hash: u64, value: T, hasher: impl Fn(&T) -> u64) -> &mut T { ++ unsafe { self.insert(hash, value, hasher).as_mut() } ++ } ++ ++ /// Inserts a new element into the table, without growing the table. ++ /// ++ /// There must be enough space in the table to insert the new element. ++ /// ++ /// This does not check if the given element already exists in the table. ++ #[cfg_attr(feature = "inline-more", inline)] ++ #[cfg(any(feature = "raw", feature = "rustc-internal-api"))] ++ pub unsafe fn insert_no_grow(&mut self, hash: u64, value: T) -> Bucket { ++ let (index, old_ctrl) = self.table.prepare_insert_slot(hash); ++ let bucket = self.table.bucket(index); ++ ++ // If we are replacing a DELETED entry then we don't need to update ++ // the load counter. ++ self.table.growth_left -= special_is_empty(old_ctrl) as usize; ++ ++ bucket.write(value); ++ self.table.items += 1; ++ bucket ++ } ++ ++ /// Temporary removes a bucket, applying the given function to the removed ++ /// element and optionally put back the returned value in the same bucket. ++ /// ++ /// Returns `true` if the bucket still contains an element ++ /// ++ /// This does not check if the given bucket is actually occupied. ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub unsafe fn replace_bucket_with(&mut self, bucket: Bucket, f: F) -> bool ++ where ++ F: FnOnce(T) -> Option, ++ { ++ let index = self.bucket_index(&bucket); ++ let old_ctrl = *self.table.ctrl(index); ++ debug_assert!(self.is_bucket_full(index)); ++ let old_growth_left = self.table.growth_left; ++ let item = self.remove(bucket).0; ++ if let Some(new_item) = f(item) { ++ self.table.growth_left = old_growth_left; ++ self.table.set_ctrl(index, old_ctrl); ++ self.table.items += 1; ++ self.bucket(index).write(new_item); ++ true ++ } else { ++ false ++ } ++ } ++ ++ /// Searches for an element in the table. If the element is not found, ++ /// returns `Err` with the position of a slot where an element with the ++ /// same hash could be inserted. ++ /// ++ /// This function may resize the table if additional space is required for ++ /// inserting an element. ++ #[inline] ++ pub fn find_or_find_insert_slot( ++ &mut self, ++ hash: u64, ++ mut eq: impl FnMut(&T) -> bool, ++ hasher: impl Fn(&T) -> u64, ++ ) -> Result, InsertSlot> { ++ self.reserve(1, hasher); ++ ++ unsafe { ++ // SAFETY: ++ // 1. We know for sure that there is at least one empty `bucket` in the table. ++ // 2. The [`RawTableInner`] must already have properly initialized control bytes since we will ++ // never expose `RawTable::new_uninitialized` in a public API. ++ // 3. The `find_or_find_insert_slot_inner` function returns the `index` of only the full bucket, ++ // which is in the range `0..self.buckets()` (since there is at least one empty `bucket` in ++ // the table), so calling `self.bucket(index)` and `Bucket::as_ref` is safe. ++ match self ++ .table ++ .find_or_find_insert_slot_inner(hash, &mut |index| eq(self.bucket(index).as_ref())) ++ { ++ // SAFETY: See explanation above. ++ Ok(index) => Ok(self.bucket(index)), ++ Err(slot) => Err(slot), ++ } ++ } ++ } ++ ++ /// Inserts a new element into the table in the given slot, and returns its ++ /// raw bucket. ++ /// ++ /// # Safety ++ /// ++ /// `slot` must point to a slot previously returned by ++ /// `find_or_find_insert_slot`, and no mutation of the table must have ++ /// occurred since that call. ++ #[inline] ++ pub unsafe fn insert_in_slot(&mut self, hash: u64, slot: InsertSlot, value: T) -> Bucket { ++ let old_ctrl = *self.table.ctrl(slot.index); ++ self.table.record_item_insert_at(slot.index, old_ctrl, hash); ++ ++ let bucket = self.bucket(slot.index); ++ bucket.write(value); ++ bucket ++ } ++ ++ /// Searches for an element in the table. ++ #[inline] ++ pub fn find(&self, hash: u64, mut eq: impl FnMut(&T) -> bool) -> Option> { ++ unsafe { ++ // SAFETY: ++ // 1. The [`RawTableInner`] must already have properly initialized control bytes since we ++ // will never expose `RawTable::new_uninitialized` in a public API. ++ // 1. The `find_inner` function returns the `index` of only the full bucket, which is in ++ // the range `0..self.buckets()`, so calling `self.bucket(index)` and `Bucket::as_ref` ++ // is safe. ++ let result = self ++ .table ++ .find_inner(hash, &mut |index| eq(self.bucket(index).as_ref())); ++ ++ // Avoid `Option::map` because it bloats LLVM IR. ++ match result { ++ // SAFETY: See explanation above. ++ Some(index) => Some(self.bucket(index)), ++ None => None, ++ } ++ } ++ } ++ ++ /// Gets a reference to an element in the table. ++ #[inline] ++ pub fn get(&self, hash: u64, eq: impl FnMut(&T) -> bool) -> Option<&T> { ++ // Avoid `Option::map` because it bloats LLVM IR. ++ match self.find(hash, eq) { ++ Some(bucket) => Some(unsafe { bucket.as_ref() }), ++ None => None, ++ } ++ } ++ ++ /// Gets a mutable reference to an element in the table. ++ #[inline] ++ pub fn get_mut(&mut self, hash: u64, eq: impl FnMut(&T) -> bool) -> Option<&mut T> { ++ // Avoid `Option::map` because it bloats LLVM IR. ++ match self.find(hash, eq) { ++ Some(bucket) => Some(unsafe { bucket.as_mut() }), ++ None => None, ++ } ++ } ++ ++ /// Attempts to get mutable references to `N` entries in the table at once. ++ /// ++ /// Returns an array of length `N` with the results of each query. ++ /// ++ /// At most one mutable reference will be returned to any entry. `None` will be returned if any ++ /// of the hashes are duplicates. `None` will be returned if the hash is not found. ++ /// ++ /// The `eq` argument should be a closure such that `eq(i, k)` returns true if `k` is equal to ++ /// the `i`th key to be looked up. ++ pub fn get_many_mut( ++ &mut self, ++ hashes: [u64; N], ++ eq: impl FnMut(usize, &T) -> bool, ++ ) -> Option<[&'_ mut T; N]> { ++ unsafe { ++ let ptrs = self.get_many_mut_pointers(hashes, eq)?; ++ ++ for (i, &cur) in ptrs.iter().enumerate() { ++ if ptrs[..i].iter().any(|&prev| ptr::eq::(prev, cur)) { ++ return None; ++ } ++ } ++ // All bucket are distinct from all previous buckets so we're clear to return the result ++ // of the lookup. ++ ++ // TODO use `MaybeUninit::array_assume_init` here instead once that's stable. ++ Some(mem::transmute_copy(&ptrs)) ++ } ++ } ++ ++ pub unsafe fn get_many_unchecked_mut( ++ &mut self, ++ hashes: [u64; N], ++ eq: impl FnMut(usize, &T) -> bool, ++ ) -> Option<[&'_ mut T; N]> { ++ let ptrs = self.get_many_mut_pointers(hashes, eq)?; ++ Some(mem::transmute_copy(&ptrs)) ++ } ++ ++ unsafe fn get_many_mut_pointers( ++ &mut self, ++ hashes: [u64; N], ++ mut eq: impl FnMut(usize, &T) -> bool, ++ ) -> Option<[*mut T; N]> { ++ // TODO use `MaybeUninit::uninit_array` here instead once that's stable. ++ let mut outs: MaybeUninit<[*mut T; N]> = MaybeUninit::uninit(); ++ let outs_ptr = outs.as_mut_ptr(); ++ ++ for (i, &hash) in hashes.iter().enumerate() { ++ let cur = self.find(hash, |k| eq(i, k))?; ++ *(*outs_ptr).get_unchecked_mut(i) = cur.as_mut(); ++ } ++ ++ // TODO use `MaybeUninit::array_assume_init` here instead once that's stable. ++ Some(outs.assume_init()) ++ } ++ ++ /// Returns the number of elements the map can hold without reallocating. ++ /// ++ /// This number is a lower bound; the table might be able to hold ++ /// more, but is guaranteed to be able to hold at least this many. ++ #[inline] ++ pub fn capacity(&self) -> usize { ++ self.table.items + self.table.growth_left ++ } ++ ++ /// Returns the number of elements in the table. ++ #[inline] ++ pub fn len(&self) -> usize { ++ self.table.items ++ } ++ ++ /// Returns `true` if the table contains no elements. ++ #[inline] ++ pub fn is_empty(&self) -> bool { ++ self.len() == 0 ++ } ++ ++ /// Returns the number of buckets in the table. ++ #[inline] ++ pub fn buckets(&self) -> usize { ++ self.table.bucket_mask + 1 ++ } ++ ++ /// Checks whether the bucket at `index` is full. ++ /// ++ /// # Safety ++ /// ++ /// The caller must ensure `index` is less than the number of buckets. ++ #[inline] ++ pub unsafe fn is_bucket_full(&self, index: usize) -> bool { ++ self.table.is_bucket_full(index) ++ } ++ ++ /// Returns an iterator over every element in the table. It is up to ++ /// the caller to ensure that the `RawTable` outlives the `RawIter`. ++ /// Because we cannot make the `next` method unsafe on the `RawIter` ++ /// struct, we have to make the `iter` method unsafe. ++ #[inline] ++ pub unsafe fn iter(&self) -> RawIter { ++ // SAFETY: ++ // 1. The caller must uphold the safety contract for `iter` method. ++ // 2. The [`RawTableInner`] must already have properly initialized control bytes since ++ // we will never expose RawTable::new_uninitialized in a public API. ++ self.table.iter() ++ } ++ ++ /// Returns an iterator over occupied buckets that could match a given hash. ++ /// ++ /// `RawTable` only stores 7 bits of the hash value, so this iterator may ++ /// return items that have a hash value different than the one provided. You ++ /// should always validate the returned values before using them. ++ /// ++ /// It is up to the caller to ensure that the `RawTable` outlives the ++ /// `RawIterHash`. Because we cannot make the `next` method unsafe on the ++ /// `RawIterHash` struct, we have to make the `iter_hash` method unsafe. ++ #[cfg_attr(feature = "inline-more", inline)] ++ #[cfg(feature = "raw")] ++ pub unsafe fn iter_hash(&self, hash: u64) -> RawIterHash { ++ RawIterHash::new(self, hash) ++ } ++ ++ /// Returns an iterator which removes all elements from the table without ++ /// freeing the memory. ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn drain(&mut self) -> RawDrain<'_, T, A> { ++ unsafe { ++ let iter = self.iter(); ++ self.drain_iter_from(iter) ++ } ++ } ++ ++ /// Returns an iterator which removes all elements from the table without ++ /// freeing the memory. ++ /// ++ /// Iteration starts at the provided iterator's current location. ++ /// ++ /// It is up to the caller to ensure that the iterator is valid for this ++ /// `RawTable` and covers all items that remain in the table. ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub unsafe fn drain_iter_from(&mut self, iter: RawIter) -> RawDrain<'_, T, A> { ++ debug_assert_eq!(iter.len(), self.len()); ++ RawDrain { ++ iter, ++ table: mem::replace(&mut self.table, RawTableInner::NEW), ++ orig_table: NonNull::from(&mut self.table), ++ marker: PhantomData, ++ } ++ } ++ ++ /// Returns an iterator which consumes all elements from the table. ++ /// ++ /// Iteration starts at the provided iterator's current location. ++ /// ++ /// It is up to the caller to ensure that the iterator is valid for this ++ /// `RawTable` and covers all items that remain in the table. ++ pub unsafe fn into_iter_from(self, iter: RawIter) -> RawIntoIter { ++ debug_assert_eq!(iter.len(), self.len()); ++ ++ let allocation = self.into_allocation(); ++ RawIntoIter { ++ iter, ++ allocation, ++ marker: PhantomData, ++ } ++ } ++ ++ /// Converts the table into a raw allocation. The contents of the table ++ /// should be dropped using a `RawIter` before freeing the allocation. ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub(crate) fn into_allocation(self) -> Option<(NonNull, Layout, A)> { ++ let alloc = if self.table.is_empty_singleton() { ++ None ++ } else { ++ // Avoid `Option::unwrap_or_else` because it bloats LLVM IR. ++ let (layout, ctrl_offset) = ++ match Self::TABLE_LAYOUT.calculate_layout_for(self.table.buckets()) { ++ Some(lco) => lco, ++ None => unsafe { hint::unreachable_unchecked() }, ++ }; ++ Some(( ++ unsafe { NonNull::new_unchecked(self.table.ctrl.as_ptr().sub(ctrl_offset)) }, ++ layout, ++ unsafe { ptr::read(&self.alloc) }, ++ )) ++ }; ++ mem::forget(self); ++ alloc ++ } ++} ++ ++unsafe impl Send for RawTable ++where ++ T: Send, ++ A: Send, ++{ ++} ++unsafe impl Sync for RawTable ++where ++ T: Sync, ++ A: Sync, ++{ ++} ++ ++impl RawTableInner { ++ const NEW: Self = RawTableInner::new(); ++ ++ /// Creates a new empty hash table without allocating any memory. ++ /// ++ /// In effect this returns a table with exactly 1 bucket. However we can ++ /// leave the data pointer dangling since that bucket is never accessed ++ /// due to our load factor forcing us to always have at least 1 free bucket. ++ #[inline] ++ const fn new() -> Self { ++ Self { ++ // Be careful to cast the entire slice to a raw pointer. ++ ctrl: unsafe { NonNull::new_unchecked(Group::static_empty() as *const _ as *mut u8) }, ++ bucket_mask: 0, ++ items: 0, ++ growth_left: 0, ++ } ++ } ++} ++ ++impl RawTableInner { ++ /// Allocates a new [`RawTableInner`] with the given number of buckets. ++ /// The control bytes and buckets are left uninitialized. ++ /// ++ /// # Safety ++ /// ++ /// The caller of this function must ensure that the `buckets` is power of two ++ /// and also initialize all control bytes of the length `self.bucket_mask + 1 + ++ /// Group::WIDTH` with the [`EMPTY`] bytes. ++ /// ++ /// See also [`Allocator`] API for other safety concerns. ++ /// ++ /// [`Allocator`]: https://doc.rust-lang.org/alloc/alloc/trait.Allocator.html ++ #[cfg_attr(feature = "inline-more", inline)] ++ unsafe fn new_uninitialized( ++ alloc: &A, ++ table_layout: TableLayout, ++ buckets: usize, ++ fallibility: Fallibility, ++ ) -> Result ++ where ++ A: Allocator, ++ { ++ debug_assert!(buckets.is_power_of_two()); ++ ++ // Avoid `Option::ok_or_else` because it bloats LLVM IR. ++ let (layout, ctrl_offset) = match table_layout.calculate_layout_for(buckets) { ++ Some(lco) => lco, ++ None => return Err(fallibility.capacity_overflow()), ++ }; ++ ++ let ptr: NonNull = match do_alloc(alloc, layout) { ++ Ok(block) => block.cast(), ++ Err(_) => return Err(fallibility.alloc_err(layout)), ++ }; ++ ++ // SAFETY: null pointer will be caught in above check ++ let ctrl = NonNull::new_unchecked(ptr.as_ptr().add(ctrl_offset)); ++ Ok(Self { ++ ctrl, ++ bucket_mask: buckets - 1, ++ items: 0, ++ growth_left: bucket_mask_to_capacity(buckets - 1), ++ }) ++ } ++ ++ /// Attempts to allocate a new [`RawTableInner`] with at least enough ++ /// capacity for inserting the given number of elements without reallocating. ++ /// ++ /// All the control bytes are initialized with the [`EMPTY`] bytes. ++ #[inline] ++ fn fallible_with_capacity( ++ alloc: &A, ++ table_layout: TableLayout, ++ capacity: usize, ++ fallibility: Fallibility, ++ ) -> Result ++ where ++ A: Allocator, ++ { ++ if capacity == 0 { ++ Ok(Self::NEW) ++ } else { ++ // SAFETY: We checked that we could successfully allocate the new table, and then ++ // initialized all control bytes with the constant `EMPTY` byte. ++ unsafe { ++ let buckets = ++ capacity_to_buckets(capacity).ok_or_else(|| fallibility.capacity_overflow())?; ++ ++ let result = Self::new_uninitialized(alloc, table_layout, buckets, fallibility)?; ++ // SAFETY: We checked that the table is allocated and therefore the table already has ++ // `self.bucket_mask + 1 + Group::WIDTH` number of control bytes (see TableLayout::calculate_layout_for) ++ // so writing `self.num_ctrl_bytes() == bucket_mask + 1 + Group::WIDTH` bytes is safe. ++ result.ctrl(0).write_bytes(EMPTY, result.num_ctrl_bytes()); ++ ++ Ok(result) ++ } ++ } ++ } ++ ++ /// Allocates a new [`RawTableInner`] with at least enough capacity for inserting ++ /// the given number of elements without reallocating. ++ /// ++ /// Panics if the new capacity exceeds [`isize::MAX`] bytes and [`abort`] the program ++ /// in case of allocation error. Use [`fallible_with_capacity`] instead if you want to ++ /// handle memory allocation failure. ++ /// ++ /// All the control bytes are initialized with the [`EMPTY`] bytes. ++ /// ++ /// [`fallible_with_capacity`]: RawTableInner::fallible_with_capacity ++ /// [`abort`]: https://doc.rust-lang.org/alloc/alloc/fn.handle_alloc_error.html ++ fn with_capacity(alloc: &A, table_layout: TableLayout, capacity: usize) -> Self ++ where ++ A: Allocator, ++ { ++ // Avoid `Result::unwrap_or_else` because it bloats LLVM IR. ++ match Self::fallible_with_capacity(alloc, table_layout, capacity, Fallibility::Infallible) { ++ Ok(table_inner) => table_inner, ++ // SAFETY: All allocation errors will be caught inside `RawTableInner::new_uninitialized`. ++ Err(_) => unsafe { hint::unreachable_unchecked() }, ++ } ++ } ++ ++ /// Fixes up an insertion slot returned by the [`RawTableInner::find_insert_slot_in_group`] method. ++ /// ++ /// In tables smaller than the group width (`self.buckets() < Group::WIDTH`), trailing control ++ /// bytes outside the range of the table are filled with [`EMPTY`] entries. These will unfortunately ++ /// trigger a match of [`RawTableInner::find_insert_slot_in_group`] function. This is because ++ /// the `Some(bit)` returned by `group.match_empty_or_deleted().lowest_set_bit()` after masking ++ /// (`(probe_seq.pos + bit) & self.bucket_mask`) may point to a full bucket that is already occupied. ++ /// We detect this situation here and perform a second scan starting at the beginning of the table. ++ /// This second scan is guaranteed to find an empty slot (due to the load factor) before hitting the ++ /// trailing control bytes (containing [`EMPTY`] bytes). ++ /// ++ /// If this function is called correctly, it is guaranteed to return [`InsertSlot`] with an ++ /// index of an empty or deleted bucket in the range `0..self.buckets()` (see `Warning` and ++ /// `Safety`). ++ /// ++ /// # Warning ++ /// ++ /// The table must have at least 1 empty or deleted `bucket`, otherwise if the table is less than ++ /// the group width (`self.buckets() < Group::WIDTH`) this function returns an index outside of the ++ /// table indices range `0..self.buckets()` (`0..=self.bucket_mask`). Attempt to write data at that ++ /// index will cause immediate [`undefined behavior`]. ++ /// ++ /// # Safety ++ /// ++ /// The safety rules are directly derived from the safety rules for [`RawTableInner::ctrl`] method. ++ /// Thus, in order to uphold those safety contracts, as well as for the correct logic of the work ++ /// of this crate, the following rules are necessary and sufficient: ++ /// ++ /// * The [`RawTableInner`] must have properly initialized control bytes otherwise calling this ++ /// function results in [`undefined behavior`]. ++ /// ++ /// * This function must only be used on insertion slots found by [`RawTableInner::find_insert_slot_in_group`] ++ /// (after the `find_insert_slot_in_group` function, but before insertion into the table). ++ /// ++ /// * The `index` must not be greater than the `self.bucket_mask`, i.e. `(index + 1) <= self.buckets()` ++ /// (this one is provided by the [`RawTableInner::find_insert_slot_in_group`] function). ++ /// ++ /// Calling this function with an index not provided by [`RawTableInner::find_insert_slot_in_group`] ++ /// may result in [`undefined behavior`] even if the index satisfies the safety rules of the ++ /// [`RawTableInner::ctrl`] function (`index < self.bucket_mask + 1 + Group::WIDTH`). ++ /// ++ /// [`RawTableInner::ctrl`]: RawTableInner::ctrl ++ /// [`RawTableInner::find_insert_slot_in_group`]: RawTableInner::find_insert_slot_in_group ++ /// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html ++ #[inline] ++ unsafe fn fix_insert_slot(&self, mut index: usize) -> InsertSlot { ++ // SAFETY: The caller of this function ensures that `index` is in the range `0..=self.bucket_mask`. ++ if unlikely(self.is_bucket_full(index)) { ++ debug_assert!(self.bucket_mask < Group::WIDTH); ++ // SAFETY: ++ // ++ // * Since the caller of this function ensures that the control bytes are properly ++ // initialized and `ptr = self.ctrl(0)` points to the start of the array of control ++ // bytes, therefore: `ctrl` is valid for reads, properly aligned to `Group::WIDTH` ++ // and points to the properly initialized control bytes (see also ++ // `TableLayout::calculate_layout_for` and `ptr::read`); ++ // ++ // * Because the caller of this function ensures that the index was provided by the ++ // `self.find_insert_slot_in_group()` function, so for for tables larger than the ++ // group width (self.buckets() >= Group::WIDTH), we will never end up in the given ++ // branch, since `(probe_seq.pos + bit) & self.bucket_mask` in `find_insert_slot_in_group` ++ // cannot return a full bucket index. For tables smaller than the group width, calling ++ // the `unwrap_unchecked` function is also safe, as the trailing control bytes outside ++ // the range of the table are filled with EMPTY bytes (and we know for sure that there ++ // is at least one FULL bucket), so this second scan either finds an empty slot (due to ++ // the load factor) or hits the trailing control bytes (containing EMPTY). ++ index = Group::load_aligned(self.ctrl(0)) ++ .match_empty_or_deleted() ++ .lowest_set_bit() ++ .unwrap_unchecked(); ++ } ++ InsertSlot { index } ++ } ++ ++ /// Finds the position to insert something in a group. ++ /// ++ /// **This may have false positives and must be fixed up with `fix_insert_slot` ++ /// before it's used.** ++ /// ++ /// The function is guaranteed to return the index of an empty or deleted [`Bucket`] ++ /// in the range `0..self.buckets()` (`0..=self.bucket_mask`). ++ #[inline] ++ fn find_insert_slot_in_group(&self, group: &Group, probe_seq: &ProbeSeq) -> Option { ++ let bit = group.match_empty_or_deleted().lowest_set_bit(); ++ ++ if likely(bit.is_some()) { ++ // This is the same as `(probe_seq.pos + bit) % self.buckets()` because the number ++ // of buckets is a power of two, and `self.bucket_mask = self.buckets() - 1`. ++ Some((probe_seq.pos + bit.unwrap()) & self.bucket_mask) ++ } else { ++ None ++ } ++ } ++ ++ /// Searches for an element in the table, or a potential slot where that element could ++ /// be inserted (an empty or deleted [`Bucket`] index). ++ /// ++ /// This uses dynamic dispatch to reduce the amount of code generated, but that is ++ /// eliminated by LLVM optimizations. ++ /// ++ /// This function does not make any changes to the `data` part of the table, or any ++ /// changes to the `items` or `growth_left` field of the table. ++ /// ++ /// The table must have at least 1 empty or deleted `bucket`, otherwise, if the ++ /// `eq: &mut dyn FnMut(usize) -> bool` function does not return `true`, this function ++ /// will never return (will go into an infinite loop) for tables larger than the group ++ /// width, or return an index outside of the table indices range if the table is less ++ /// than the group width. ++ /// ++ /// This function is guaranteed to provide the `eq: &mut dyn FnMut(usize) -> bool` ++ /// function with only `FULL` buckets' indices and return the `index` of the found ++ /// element (as `Ok(index)`). If the element is not found and there is at least 1 ++ /// empty or deleted [`Bucket`] in the table, the function is guaranteed to return ++ /// [InsertSlot] with an index in the range `0..self.buckets()`, but in any case, ++ /// if this function returns [`InsertSlot`], it will contain an index in the range ++ /// `0..=self.buckets()`. ++ /// ++ /// # Safety ++ /// ++ /// The [`RawTableInner`] must have properly initialized control bytes otherwise calling ++ /// this function results in [`undefined behavior`]. ++ /// ++ /// Attempt to write data at the [`InsertSlot`] returned by this function when the table is ++ /// less than the group width and if there was not at least one empty or deleted bucket in ++ /// the table will cause immediate [`undefined behavior`]. This is because in this case the ++ /// function will return `self.bucket_mask + 1` as an index due to the trailing [`EMPTY] ++ /// control bytes outside the table range. ++ /// ++ /// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html ++ #[inline] ++ unsafe fn find_or_find_insert_slot_inner( ++ &self, ++ hash: u64, ++ eq: &mut dyn FnMut(usize) -> bool, ++ ) -> Result { ++ let mut insert_slot = None; ++ ++ let h2_hash = h2(hash); ++ let mut probe_seq = self.probe_seq(hash); ++ ++ loop { ++ // SAFETY: ++ // * Caller of this function ensures that the control bytes are properly initialized. ++ // ++ // * `ProbeSeq.pos` cannot be greater than `self.bucket_mask = self.buckets() - 1` ++ // of the table due to masking with `self.bucket_mask` and also because mumber of ++ // buckets is a power of two (see `self.probe_seq` function). ++ // ++ // * Even if `ProbeSeq.pos` returns `position == self.bucket_mask`, it is safe to ++ // call `Group::load` due to the extended control bytes range, which is ++ // `self.bucket_mask + 1 + Group::WIDTH` (in fact, this means that the last control ++ // byte will never be read for the allocated table); ++ // ++ // * Also, even if `RawTableInner` is not already allocated, `ProbeSeq.pos` will ++ // always return "0" (zero), so Group::load will read unaligned `Group::static_empty()` ++ // bytes, which is safe (see RawTableInner::new). ++ let group = unsafe { Group::load(self.ctrl(probe_seq.pos)) }; ++ ++ for bit in group.match_byte(h2_hash) { ++ let index = (probe_seq.pos + bit) & self.bucket_mask; ++ ++ if likely(eq(index)) { ++ return Ok(index); ++ } ++ } ++ ++ // We didn't find the element we were looking for in the group, try to get an ++ // insertion slot from the group if we don't have one yet. ++ if likely(insert_slot.is_none()) { ++ insert_slot = self.find_insert_slot_in_group(&group, &probe_seq); ++ } ++ ++ // Only stop the search if the group contains at least one empty element. ++ // Otherwise, the element that we are looking for might be in a following group. ++ if likely(group.match_empty().any_bit_set()) { ++ // We must have found a insert slot by now, since the current group contains at ++ // least one. For tables smaller than the group width, there will still be an ++ // empty element in the current (and only) group due to the load factor. ++ unsafe { ++ // SAFETY: ++ // * Caller of this function ensures that the control bytes are properly initialized. ++ // ++ // * We use this function with the slot / index found by `self.find_insert_slot_in_group` ++ return Err(self.fix_insert_slot(insert_slot.unwrap_unchecked())); ++ } ++ } ++ ++ probe_seq.move_next(self.bucket_mask); ++ } ++ } ++ ++ /// Searches for an empty or deleted bucket which is suitable for inserting a new ++ /// element and sets the hash for that slot. Returns an index of that slot and the ++ /// old control byte stored in the found index. ++ /// ++ /// This function does not check if the given element exists in the table. Also, ++ /// this function does not check if there is enough space in the table to insert ++ /// a new element. Caller of the funtion must make ensure that the table has at ++ /// least 1 empty or deleted `bucket`, otherwise this function will never return ++ /// (will go into an infinite loop) for tables larger than the group width, or ++ /// return an index outside of the table indices range if the table is less than ++ /// the group width. ++ /// ++ /// If there is at least 1 empty or deleted `bucket` in the table, the function is ++ /// guaranteed to return an `index` in the range `0..self.buckets()`, but in any case, ++ /// if this function returns an `index` it will be in the range `0..=self.buckets()`. ++ /// ++ /// This function does not make any changes to the `data` parts of the table, ++ /// or any changes to the `items` or `growth_left` field of the table. ++ /// ++ /// # Safety ++ /// ++ /// The safety rules are directly derived from the safety rules for the ++ /// [`RawTableInner::set_ctrl_h2`] and [`RawTableInner::find_insert_slot`] methods. ++ /// Thus, in order to uphold the safety contracts for that methods, as well as for ++ /// the correct logic of the work of this crate, you must observe the following rules ++ /// when calling this function: ++ /// ++ /// * The [`RawTableInner`] has already been allocated and has properly initialized ++ /// control bytes otherwise calling this function results in [`undefined behavior`]. ++ /// ++ /// * The caller of this function must ensure that the "data" parts of the table ++ /// will have an entry in the returned index (matching the given hash) right ++ /// after calling this function. ++ /// ++ /// Attempt to write data at the `index` returned by this function when the table is ++ /// less than the group width and if there was not at least one empty or deleted bucket in ++ /// the table will cause immediate [`undefined behavior`]. This is because in this case the ++ /// function will return `self.bucket_mask + 1` as an index due to the trailing [`EMPTY] ++ /// control bytes outside the table range. ++ /// ++ /// The caller must independently increase the `items` field of the table, and also, ++ /// if the old control byte was [`EMPTY`], then decrease the table's `growth_left` ++ /// field, and do not change it if the old control byte was [`DELETED`]. ++ /// ++ /// See also [`Bucket::as_ptr`] method, for more information about of properly removing ++ /// or saving `element` from / into the [`RawTable`] / [`RawTableInner`]. ++ /// ++ /// [`Bucket::as_ptr`]: Bucket::as_ptr ++ /// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html ++ /// [`RawTableInner::ctrl`]: RawTableInner::ctrl ++ /// [`RawTableInner::set_ctrl_h2`]: RawTableInner::set_ctrl_h2 ++ /// [`RawTableInner::find_insert_slot`]: RawTableInner::find_insert_slot ++ #[inline] ++ unsafe fn prepare_insert_slot(&mut self, hash: u64) -> (usize, u8) { ++ // SAFETY: Caller of this function ensures that the control bytes are properly initialized. ++ let index: usize = self.find_insert_slot(hash).index; ++ // SAFETY: ++ // 1. The `find_insert_slot` function either returns an `index` less than or ++ // equal to `self.buckets() = self.bucket_mask + 1` of the table, or never ++ // returns if it cannot find an empty or deleted slot. ++ // 2. The caller of this function guarantees that the table has already been ++ // allocated ++ let old_ctrl = *self.ctrl(index); ++ self.set_ctrl_h2(index, hash); ++ (index, old_ctrl) ++ } ++ ++ /// Searches for an empty or deleted bucket which is suitable for inserting ++ /// a new element, returning the `index` for the new [`Bucket`]. ++ /// ++ /// This function does not make any changes to the `data` part of the table, or any ++ /// changes to the `items` or `growth_left` field of the table. ++ /// ++ /// The table must have at least 1 empty or deleted `bucket`, otherwise this function ++ /// will never return (will go into an infinite loop) for tables larger than the group ++ /// width, or return an index outside of the table indices range if the table is less ++ /// than the group width. ++ /// ++ /// If there is at least 1 empty or deleted `bucket` in the table, the function is ++ /// guaranteed to return [`InsertSlot`] with an index in the range `0..self.buckets()`, ++ /// but in any case, if this function returns [`InsertSlot`], it will contain an index ++ /// in the range `0..=self.buckets()`. ++ /// ++ /// # Safety ++ /// ++ /// The [`RawTableInner`] must have properly initialized control bytes otherwise calling ++ /// this function results in [`undefined behavior`]. ++ /// ++ /// Attempt to write data at the [`InsertSlot`] returned by this function when the table is ++ /// less than the group width and if there was not at least one empty or deleted bucket in ++ /// the table will cause immediate [`undefined behavior`]. This is because in this case the ++ /// function will return `self.bucket_mask + 1` as an index due to the trailing [`EMPTY] ++ /// control bytes outside the table range. ++ /// ++ /// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html ++ #[inline] ++ unsafe fn find_insert_slot(&self, hash: u64) -> InsertSlot { ++ let mut probe_seq = self.probe_seq(hash); ++ loop { ++ // SAFETY: ++ // * Caller of this function ensures that the control bytes are properly initialized. ++ // ++ // * `ProbeSeq.pos` cannot be greater than `self.bucket_mask = self.buckets() - 1` ++ // of the table due to masking with `self.bucket_mask` and also because mumber of ++ // buckets is a power of two (see `self.probe_seq` function). ++ // ++ // * Even if `ProbeSeq.pos` returns `position == self.bucket_mask`, it is safe to ++ // call `Group::load` due to the extended control bytes range, which is ++ // `self.bucket_mask + 1 + Group::WIDTH` (in fact, this means that the last control ++ // byte will never be read for the allocated table); ++ // ++ // * Also, even if `RawTableInner` is not already allocated, `ProbeSeq.pos` will ++ // always return "0" (zero), so Group::load will read unaligned `Group::static_empty()` ++ // bytes, which is safe (see RawTableInner::new). ++ let group = unsafe { Group::load(self.ctrl(probe_seq.pos)) }; ++ ++ let index = self.find_insert_slot_in_group(&group, &probe_seq); ++ if likely(index.is_some()) { ++ // SAFETY: ++ // * Caller of this function ensures that the control bytes are properly initialized. ++ // ++ // * We use this function with the slot / index found by `self.find_insert_slot_in_group` ++ unsafe { ++ return self.fix_insert_slot(index.unwrap_unchecked()); ++ } ++ } ++ probe_seq.move_next(self.bucket_mask); ++ } ++ } ++ ++ /// Searches for an element in a table, returning the `index` of the found element. ++ /// This uses dynamic dispatch to reduce the amount of code generated, but it is ++ /// eliminated by LLVM optimizations. ++ /// ++ /// This function does not make any changes to the `data` part of the table, or any ++ /// changes to the `items` or `growth_left` field of the table. ++ /// ++ /// The table must have at least 1 empty `bucket`, otherwise, if the ++ /// `eq: &mut dyn FnMut(usize) -> bool` function does not return `true`, ++ /// this function will also never return (will go into an infinite loop). ++ /// ++ /// This function is guaranteed to provide the `eq: &mut dyn FnMut(usize) -> bool` ++ /// function with only `FULL` buckets' indices and return the `index` of the found ++ /// element as `Some(index)`, so the index will always be in the range ++ /// `0..self.buckets()`. ++ /// ++ /// # Safety ++ /// ++ /// The [`RawTableInner`] must have properly initialized control bytes otherwise calling ++ /// this function results in [`undefined behavior`]. ++ /// ++ /// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html ++ #[inline(always)] ++ unsafe fn find_inner(&self, hash: u64, eq: &mut dyn FnMut(usize) -> bool) -> Option { ++ let h2_hash = h2(hash); ++ let mut probe_seq = self.probe_seq(hash); ++ ++ loop { ++ // SAFETY: ++ // * Caller of this function ensures that the control bytes are properly initialized. ++ // ++ // * `ProbeSeq.pos` cannot be greater than `self.bucket_mask = self.buckets() - 1` ++ // of the table due to masking with `self.bucket_mask`. ++ // ++ // * Even if `ProbeSeq.pos` returns `position == self.bucket_mask`, it is safe to ++ // call `Group::load` due to the extended control bytes range, which is ++ // `self.bucket_mask + 1 + Group::WIDTH` (in fact, this means that the last control ++ // byte will never be read for the allocated table); ++ // ++ // * Also, even if `RawTableInner` is not already allocated, `ProbeSeq.pos` will ++ // always return "0" (zero), so Group::load will read unaligned `Group::static_empty()` ++ // bytes, which is safe (see RawTableInner::new_in). ++ let group = unsafe { Group::load(self.ctrl(probe_seq.pos)) }; ++ ++ for bit in group.match_byte(h2_hash) { ++ // This is the same as `(probe_seq.pos + bit) % self.buckets()` because the number ++ // of buckets is a power of two, and `self.bucket_mask = self.buckets() - 1`. ++ let index = (probe_seq.pos + bit) & self.bucket_mask; ++ ++ if likely(eq(index)) { ++ return Some(index); ++ } ++ } ++ ++ if likely(group.match_empty().any_bit_set()) { ++ return None; ++ } ++ ++ probe_seq.move_next(self.bucket_mask); ++ } ++ } ++ ++ /// Prepares for rehashing data in place (that is, without allocating new memory). ++ /// Converts all full index `control bytes` to `DELETED` and all `DELETED` control ++ /// bytes to `EMPTY`, i.e. performs the following conversion: ++ /// ++ /// - `EMPTY` control bytes -> `EMPTY`; ++ /// - `DELETED` control bytes -> `EMPTY`; ++ /// - `FULL` control bytes -> `DELETED`. ++ /// ++ /// This function does not make any changes to the `data` parts of the table, ++ /// or any changes to the `items` or `growth_left` field of the table. ++ /// ++ /// # Safety ++ /// ++ /// You must observe the following safety rules when calling this function: ++ /// ++ /// * The [`RawTableInner`] has already been allocated; ++ /// ++ /// * The caller of this function must convert the `DELETED` bytes back to `FULL` ++ /// bytes when re-inserting them into their ideal position (which was impossible ++ /// to do during the first insert due to tombstones). If the caller does not do ++ /// this, then calling this function may result in a memory leak. ++ /// ++ /// * The [`RawTableInner`] must have properly initialized control bytes otherwise ++ /// calling this function results in [`undefined behavior`]. ++ /// ++ /// Calling this function on a table that has not been allocated results in ++ /// [`undefined behavior`]. ++ /// ++ /// See also [`Bucket::as_ptr`] method, for more information about of properly removing ++ /// or saving `data element` from / into the [`RawTable`] / [`RawTableInner`]. ++ /// ++ /// [`Bucket::as_ptr`]: Bucket::as_ptr ++ /// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html ++ #[allow(clippy::mut_mut)] ++ #[inline] ++ unsafe fn prepare_rehash_in_place(&mut self) { ++ // Bulk convert all full control bytes to DELETED, and all DELETED control bytes to EMPTY. ++ // This effectively frees up all buckets containing a DELETED entry. ++ // ++ // SAFETY: ++ // 1. `i` is guaranteed to be within bounds since we are iterating from zero to `buckets - 1`; ++ // 2. Even if `i` will be `i == self.bucket_mask`, it is safe to call `Group::load_aligned` ++ // due to the extended control bytes range, which is `self.bucket_mask + 1 + Group::WIDTH`; ++ // 3. The caller of this function guarantees that [`RawTableInner`] has already been allocated; ++ // 4. We can use `Group::load_aligned` and `Group::store_aligned` here since we start from 0 ++ // and go to the end with a step equal to `Group::WIDTH` (see TableLayout::calculate_layout_for). ++ for i in (0..self.buckets()).step_by(Group::WIDTH) { ++ let group = Group::load_aligned(self.ctrl(i)); ++ let group = group.convert_special_to_empty_and_full_to_deleted(); ++ group.store_aligned(self.ctrl(i)); ++ } ++ ++ // Fix up the trailing control bytes. See the comments in set_ctrl ++ // for the handling of tables smaller than the group width. ++ // ++ // SAFETY: The caller of this function guarantees that [`RawTableInner`] ++ // has already been allocated ++ if unlikely(self.buckets() < Group::WIDTH) { ++ // SAFETY: We have `self.bucket_mask + 1 + Group::WIDTH` number of control bytes, ++ // so copying `self.buckets() == self.bucket_mask + 1` bytes with offset equal to ++ // `Group::WIDTH` is safe ++ self.ctrl(0) ++ .copy_to(self.ctrl(Group::WIDTH), self.buckets()); ++ } else { ++ // SAFETY: We have `self.bucket_mask + 1 + Group::WIDTH` number of ++ // control bytes,so copying `Group::WIDTH` bytes with offset equal ++ // to `self.buckets() == self.bucket_mask + 1` is safe ++ self.ctrl(0) ++ .copy_to(self.ctrl(self.buckets()), Group::WIDTH); ++ } ++ } ++ ++ /// Returns an iterator over every element in the table. ++ /// ++ /// # Safety ++ /// ++ /// If any of the following conditions are violated, the result ++ /// is [`undefined behavior`]: ++ /// ++ /// * The caller has to ensure that the `RawTableInner` outlives the ++ /// `RawIter`. Because we cannot make the `next` method unsafe on ++ /// the `RawIter` struct, we have to make the `iter` method unsafe. ++ /// ++ /// * The [`RawTableInner`] must have properly initialized control bytes. ++ /// ++ /// The type `T` must be the actual type of the elements stored in the table, ++ /// otherwise using the returned [`RawIter`] results in [`undefined behavior`]. ++ /// ++ /// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html ++ #[inline] ++ unsafe fn iter(&self) -> RawIter { ++ // SAFETY: ++ // 1. Since the caller of this function ensures that the control bytes ++ // are properly initialized and `self.data_end()` points to the start ++ // of the array of control bytes, therefore: `ctrl` is valid for reads, ++ // properly aligned to `Group::WIDTH` and points to the properly initialized ++ // control bytes. ++ // 2. `data` bucket index in the table is equal to the `ctrl` index (i.e. ++ // equal to zero). ++ // 3. We pass the exact value of buckets of the table to the function. ++ // ++ // `ctrl` points here (to the start ++ // of the first control byte `CT0`) ++ // ∨ ++ // [Pad], T_n, ..., T1, T0, |CT0, CT1, ..., CT_n|, CTa_0, CTa_1, ..., CTa_m ++ // \________ ________/ ++ // \/ ++ // `n = buckets - 1`, i.e. `RawTableInner::buckets() - 1` ++ // ++ // where: T0...T_n - our stored data; ++ // CT0...CT_n - control bytes or metadata for `data`. ++ // CTa_0...CTa_m - additional control bytes, where `m = Group::WIDTH - 1` (so that the search ++ // with loading `Group` bytes from the heap works properly, even if the result ++ // of `h1(hash) & self.bucket_mask` is equal to `self.bucket_mask`). See also ++ // `RawTableInner::set_ctrl` function. ++ // ++ // P.S. `h1(hash) & self.bucket_mask` is the same as `hash as usize % self.buckets()` because the number ++ // of buckets is a power of two, and `self.bucket_mask = self.buckets() - 1`. ++ let data = Bucket::from_base_index(self.data_end(), 0); ++ RawIter { ++ // SAFETY: See explanation above ++ iter: RawIterRange::new(self.ctrl.as_ptr(), data, self.buckets()), ++ items: self.items, ++ } ++ } ++ ++ /// Executes the destructors (if any) of the values stored in the table. ++ /// ++ /// # Note ++ /// ++ /// This function does not erase the control bytes of the table and does ++ /// not make any changes to the `items` or `growth_left` fields of the ++ /// table. If necessary, the caller of this function must manually set ++ /// up these table fields, for example using the [`clear_no_drop`] function. ++ /// ++ /// Be careful during calling this function, because drop function of ++ /// the elements can panic, and this can leave table in an inconsistent ++ /// state. ++ /// ++ /// # Safety ++ /// ++ /// The type `T` must be the actual type of the elements stored in the table, ++ /// otherwise calling this function may result in [`undefined behavior`]. ++ /// ++ /// If `T` is a type that should be dropped and **the table is not empty**, ++ /// calling this function more than once results in [`undefined behavior`]. ++ /// ++ /// If `T` is not [`Copy`], attempting to use values stored in the table after ++ /// calling this function may result in [`undefined behavior`]. ++ /// ++ /// It is safe to call this function on a table that has not been allocated, ++ /// on a table with uninitialized control bytes, and on a table with no actual ++ /// data but with `Full` control bytes if `self.items == 0`. ++ /// ++ /// See also [`Bucket::drop`] / [`Bucket::as_ptr`] methods, for more information ++ /// about of properly removing or saving `element` from / into the [`RawTable`] / ++ /// [`RawTableInner`]. ++ /// ++ /// [`Bucket::drop`]: Bucket::drop ++ /// [`Bucket::as_ptr`]: Bucket::as_ptr ++ /// [`clear_no_drop`]: RawTableInner::clear_no_drop ++ /// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html ++ unsafe fn drop_elements(&mut self) { ++ // Check that `self.items != 0`. Protects against the possibility ++ // of creating an iterator on an table with uninitialized control bytes. ++ if T::NEEDS_DROP && self.items != 0 { ++ // SAFETY: We know for sure that RawTableInner will outlive the ++ // returned `RawIter` iterator, and the caller of this function ++ // must uphold the safety contract for `drop_elements` method. ++ for item in self.iter::() { ++ // SAFETY: The caller must uphold the safety contract for ++ // `drop_elements` method. ++ item.drop(); ++ } ++ } ++ } ++ ++ /// Executes the destructors (if any) of the values stored in the table and than ++ /// deallocates the table. ++ /// ++ /// # Note ++ /// ++ /// Calling this function automatically makes invalid (dangling) all instances of ++ /// buckets ([`Bucket`]) and makes invalid (dangling) the `ctrl` field of the table. ++ /// ++ /// This function does not make any changes to the `bucket_mask`, `items` or `growth_left` ++ /// fields of the table. If necessary, the caller of this function must manually set ++ /// up these table fields. ++ /// ++ /// # Safety ++ /// ++ /// If any of the following conditions are violated, the result is [`undefined behavior`]: ++ /// ++ /// * Calling this function more than once; ++ /// ++ /// * The type `T` must be the actual type of the elements stored in the table. ++ /// ++ /// * The `alloc` must be the same [`Allocator`] as the `Allocator` that was used ++ /// to allocate this table. ++ /// ++ /// * The `table_layout` must be the same [`TableLayout`] as the `TableLayout` that ++ /// was used to allocate this table. ++ /// ++ /// The caller of this function should pay attention to the possibility of the ++ /// elements' drop function panicking, because this: ++ /// ++ /// * May leave the table in an inconsistent state; ++ /// ++ /// * Memory is never deallocated, so a memory leak may occur. ++ /// ++ /// Attempt to use the `ctrl` field of the table (dereference) after calling this ++ /// function results in [`undefined behavior`]. ++ /// ++ /// It is safe to call this function on a table that has not been allocated, ++ /// on a table with uninitialized control bytes, and on a table with no actual ++ /// data but with `Full` control bytes if `self.items == 0`. ++ /// ++ /// See also [`RawTableInner::drop_elements`] or [`RawTableInner::free_buckets`] ++ /// for more information. ++ /// ++ /// [`RawTableInner::drop_elements`]: RawTableInner::drop_elements ++ /// [`RawTableInner::free_buckets`]: RawTableInner::free_buckets ++ /// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html ++ unsafe fn drop_inner_table(&mut self, alloc: &A, table_layout: TableLayout) { ++ if !self.is_empty_singleton() { ++ unsafe { ++ // SAFETY: The caller must uphold the safety contract for `drop_inner_table` method. ++ self.drop_elements::(); ++ // SAFETY: ++ // 1. We have checked that our table is allocated. ++ // 2. The caller must uphold the safety contract for `drop_inner_table` method. ++ self.free_buckets(alloc, table_layout); ++ } ++ } ++ } ++ ++ /// Returns a pointer to an element in the table (convenience for ++ /// `Bucket::from_base_index(self.data_end::(), index)`). ++ /// ++ /// The caller must ensure that the `RawTableInner` outlives the returned [`Bucket`], ++ /// otherwise using it may result in [`undefined behavior`]. ++ /// ++ /// # Safety ++ /// ++ /// If `mem::size_of::() != 0`, then the safety rules are directly derived from the ++ /// safety rules of the [`Bucket::from_base_index`] function. Therefore, when calling ++ /// this function, the following safety rules must be observed: ++ /// ++ /// * The table must already be allocated; ++ /// ++ /// * The `index` must not be greater than the number returned by the [`RawTableInner::buckets`] ++ /// function, i.e. `(index + 1) <= self.buckets()`. ++ /// ++ /// * The type `T` must be the actual type of the elements stored in the table, otherwise ++ /// using the returned [`Bucket`] may result in [`undefined behavior`]. ++ /// ++ /// It is safe to call this function with index of zero (`index == 0`) on a table that has ++ /// not been allocated, but using the returned [`Bucket`] results in [`undefined behavior`]. ++ /// ++ /// If `mem::size_of::() == 0`, then the only requirement is that the `index` must ++ /// not be greater than the number returned by the [`RawTable::buckets`] function, i.e. ++ /// `(index + 1) <= self.buckets()`. ++ /// ++ /// ```none ++ /// If mem::size_of::() != 0 then return a pointer to the `element` in the `data part` of the table ++ /// (we start counting from "0", so that in the expression T[n], the "n" index actually one less than ++ /// the "buckets" number of our `RawTableInner`, i.e. "n = RawTableInner::buckets() - 1"): ++ /// ++ /// `table.bucket(3).as_ptr()` returns a pointer that points here in the `data` ++ /// part of the `RawTableInner`, i.e. to the start of T3 (see [`Bucket::as_ptr`]) ++ /// | ++ /// | `base = table.data_end::()` points here ++ /// | (to the start of CT0 or to the end of T0) ++ /// v v ++ /// [Pad], T_n, ..., |T3|, T2, T1, T0, |CT0, CT1, CT2, CT3, ..., CT_n, CTa_0, CTa_1, ..., CTa_m ++ /// ^ \__________ __________/ ++ /// `table.bucket(3)` returns a pointer that points \/ ++ /// here in the `data` part of the `RawTableInner` additional control bytes ++ /// (to the end of T3) `m = Group::WIDTH - 1` ++ /// ++ /// where: T0...T_n - our stored data; ++ /// CT0...CT_n - control bytes or metadata for `data`; ++ /// CTa_0...CTa_m - additional control bytes (so that the search with loading `Group` bytes from ++ /// the heap works properly, even if the result of `h1(hash) & self.bucket_mask` ++ /// is equal to `self.bucket_mask`). See also `RawTableInner::set_ctrl` function. ++ /// ++ /// P.S. `h1(hash) & self.bucket_mask` is the same as `hash as usize % self.buckets()` because the number ++ /// of buckets is a power of two, and `self.bucket_mask = self.buckets() - 1`. ++ /// ``` ++ /// ++ /// [`Bucket::from_base_index`]: Bucket::from_base_index ++ /// [`RawTableInner::buckets`]: RawTableInner::buckets ++ /// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html ++ #[inline] ++ unsafe fn bucket(&self, index: usize) -> Bucket { ++ debug_assert_ne!(self.bucket_mask, 0); ++ debug_assert!(index < self.buckets()); ++ Bucket::from_base_index(self.data_end(), index) ++ } ++ ++ /// Returns a raw `*mut u8` pointer to the start of the `data` element in the table ++ /// (convenience for `self.data_end::().as_ptr().sub((index + 1) * size_of)`). ++ /// ++ /// The caller must ensure that the `RawTableInner` outlives the returned `*mut u8`, ++ /// otherwise using it may result in [`undefined behavior`]. ++ /// ++ /// # Safety ++ /// ++ /// If any of the following conditions are violated, the result is [`undefined behavior`]: ++ /// ++ /// * The table must already be allocated; ++ /// ++ /// * The `index` must not be greater than the number returned by the [`RawTableInner::buckets`] ++ /// function, i.e. `(index + 1) <= self.buckets()`; ++ /// ++ /// * The `size_of` must be equal to the size of the elements stored in the table; ++ /// ++ /// ```none ++ /// If mem::size_of::() != 0 then return a pointer to the `element` in the `data part` of the table ++ /// (we start counting from "0", so that in the expression T[n], the "n" index actually one less than ++ /// the "buckets" number of our `RawTableInner`, i.e. "n = RawTableInner::buckets() - 1"): ++ /// ++ /// `table.bucket_ptr(3, mem::size_of::())` returns a pointer that points here in the ++ /// `data` part of the `RawTableInner`, i.e. to the start of T3 ++ /// | ++ /// | `base = table.data_end::()` points here ++ /// | (to the start of CT0 or to the end of T0) ++ /// v v ++ /// [Pad], T_n, ..., |T3|, T2, T1, T0, |CT0, CT1, CT2, CT3, ..., CT_n, CTa_0, CTa_1, ..., CTa_m ++ /// \__________ __________/ ++ /// \/ ++ /// additional control bytes ++ /// `m = Group::WIDTH - 1` ++ /// ++ /// where: T0...T_n - our stored data; ++ /// CT0...CT_n - control bytes or metadata for `data`; ++ /// CTa_0...CTa_m - additional control bytes (so that the search with loading `Group` bytes from ++ /// the heap works properly, even if the result of `h1(hash) & self.bucket_mask` ++ /// is equal to `self.bucket_mask`). See also `RawTableInner::set_ctrl` function. ++ /// ++ /// P.S. `h1(hash) & self.bucket_mask` is the same as `hash as usize % self.buckets()` because the number ++ /// of buckets is a power of two, and `self.bucket_mask = self.buckets() - 1`. ++ /// ``` ++ /// ++ /// [`RawTableInner::buckets`]: RawTableInner::buckets ++ /// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html ++ #[inline] ++ unsafe fn bucket_ptr(&self, index: usize, size_of: usize) -> *mut u8 { ++ debug_assert_ne!(self.bucket_mask, 0); ++ debug_assert!(index < self.buckets()); ++ let base: *mut u8 = self.data_end().as_ptr(); ++ base.sub((index + 1) * size_of) ++ } ++ ++ /// Returns pointer to one past last `data` element in the table as viewed from ++ /// the start point of the allocation (convenience for `self.ctrl.cast()`). ++ /// ++ /// This function actually returns a pointer to the end of the `data element` at ++ /// index "0" (zero). ++ /// ++ /// The caller must ensure that the `RawTableInner` outlives the returned [`NonNull`], ++ /// otherwise using it may result in [`undefined behavior`]. ++ /// ++ /// # Note ++ /// ++ /// The type `T` must be the actual type of the elements stored in the table, otherwise ++ /// using the returned [`NonNull`] may result in [`undefined behavior`]. ++ /// ++ /// ```none ++ /// `table.data_end::()` returns pointer that points here ++ /// (to the end of `T0`) ++ /// ∨ ++ /// [Pad], T_n, ..., T1, T0, |CT0, CT1, ..., CT_n|, CTa_0, CTa_1, ..., CTa_m ++ /// \________ ________/ ++ /// \/ ++ /// `n = buckets - 1`, i.e. `RawTableInner::buckets() - 1` ++ /// ++ /// where: T0...T_n - our stored data; ++ /// CT0...CT_n - control bytes or metadata for `data`. ++ /// CTa_0...CTa_m - additional control bytes, where `m = Group::WIDTH - 1` (so that the search ++ /// with loading `Group` bytes from the heap works properly, even if the result ++ /// of `h1(hash) & self.bucket_mask` is equal to `self.bucket_mask`). See also ++ /// `RawTableInner::set_ctrl` function. ++ /// ++ /// P.S. `h1(hash) & self.bucket_mask` is the same as `hash as usize % self.buckets()` because the number ++ /// of buckets is a power of two, and `self.bucket_mask = self.buckets() - 1`. ++ /// ``` ++ /// ++ /// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html ++ #[inline] ++ fn data_end(&self) -> NonNull { ++ self.ctrl.cast() ++ } ++ ++ /// Returns an iterator-like object for a probe sequence on the table. ++ /// ++ /// This iterator never terminates, but is guaranteed to visit each bucket ++ /// group exactly once. The loop using `probe_seq` must terminate upon ++ /// reaching a group containing an empty bucket. ++ #[inline] ++ fn probe_seq(&self, hash: u64) -> ProbeSeq { ++ ProbeSeq { ++ // This is the same as `hash as usize % self.buckets()` because the number ++ // of buckets is a power of two, and `self.bucket_mask = self.buckets() - 1`. ++ pos: h1(hash) & self.bucket_mask, ++ stride: 0, ++ } ++ } ++ ++ /// Returns the index of a bucket for which a value must be inserted if there is enough rooom ++ /// in the table, otherwise returns error ++ #[cfg(feature = "raw")] ++ #[inline] ++ unsafe fn prepare_insert_no_grow(&mut self, hash: u64) -> Result { ++ let index = self.find_insert_slot(hash).index; ++ let old_ctrl = *self.ctrl(index); ++ if unlikely(self.growth_left == 0 && special_is_empty(old_ctrl)) { ++ Err(()) ++ } else { ++ self.record_item_insert_at(index, old_ctrl, hash); ++ Ok(index) ++ } ++ } ++ ++ #[inline] ++ unsafe fn record_item_insert_at(&mut self, index: usize, old_ctrl: u8, hash: u64) { ++ self.growth_left -= usize::from(special_is_empty(old_ctrl)); ++ self.set_ctrl_h2(index, hash); ++ self.items += 1; ++ } ++ ++ #[inline] ++ fn is_in_same_group(&self, i: usize, new_i: usize, hash: u64) -> bool { ++ let probe_seq_pos = self.probe_seq(hash).pos; ++ let probe_index = ++ |pos: usize| (pos.wrapping_sub(probe_seq_pos) & self.bucket_mask) / Group::WIDTH; ++ probe_index(i) == probe_index(new_i) ++ } ++ ++ /// Sets a control byte to the hash, and possibly also the replicated control byte at ++ /// the end of the array. ++ /// ++ /// This function does not make any changes to the `data` parts of the table, ++ /// or any changes to the `items` or `growth_left` field of the table. ++ /// ++ /// # Safety ++ /// ++ /// The safety rules are directly derived from the safety rules for [`RawTableInner::set_ctrl`] ++ /// method. Thus, in order to uphold the safety contracts for the method, you must observe the ++ /// following rules when calling this function: ++ /// ++ /// * The [`RawTableInner`] has already been allocated; ++ /// ++ /// * The `index` must not be greater than the `RawTableInner.bucket_mask`, i.e. ++ /// `index <= RawTableInner.bucket_mask` or, in other words, `(index + 1)` must ++ /// be no greater than the number returned by the function [`RawTableInner::buckets`]. ++ /// ++ /// Calling this function on a table that has not been allocated results in [`undefined behavior`]. ++ /// ++ /// See also [`Bucket::as_ptr`] method, for more information about of properly removing ++ /// or saving `data element` from / into the [`RawTable`] / [`RawTableInner`]. ++ /// ++ /// [`RawTableInner::set_ctrl`]: RawTableInner::set_ctrl ++ /// [`RawTableInner::buckets`]: RawTableInner::buckets ++ /// [`Bucket::as_ptr`]: Bucket::as_ptr ++ /// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html ++ #[inline] ++ unsafe fn set_ctrl_h2(&mut self, index: usize, hash: u64) { ++ // SAFETY: The caller must uphold the safety rules for the [`RawTableInner::set_ctrl_h2`] ++ self.set_ctrl(index, h2(hash)); ++ } ++ ++ /// Replaces the hash in the control byte at the given index with the provided one, ++ /// and possibly also replicates the new control byte at the end of the array of control ++ /// bytes, returning the old control byte. ++ /// ++ /// This function does not make any changes to the `data` parts of the table, ++ /// or any changes to the `items` or `growth_left` field of the table. ++ /// ++ /// # Safety ++ /// ++ /// The safety rules are directly derived from the safety rules for [`RawTableInner::set_ctrl_h2`] ++ /// and [`RawTableInner::ctrl`] methods. Thus, in order to uphold the safety contracts for both ++ /// methods, you must observe the following rules when calling this function: ++ /// ++ /// * The [`RawTableInner`] has already been allocated; ++ /// ++ /// * The `index` must not be greater than the `RawTableInner.bucket_mask`, i.e. ++ /// `index <= RawTableInner.bucket_mask` or, in other words, `(index + 1)` must ++ /// be no greater than the number returned by the function [`RawTableInner::buckets`]. ++ /// ++ /// Calling this function on a table that has not been allocated results in [`undefined behavior`]. ++ /// ++ /// See also [`Bucket::as_ptr`] method, for more information about of properly removing ++ /// or saving `data element` from / into the [`RawTable`] / [`RawTableInner`]. ++ /// ++ /// [`RawTableInner::set_ctrl_h2`]: RawTableInner::set_ctrl_h2 ++ /// [`RawTableInner::buckets`]: RawTableInner::buckets ++ /// [`Bucket::as_ptr`]: Bucket::as_ptr ++ /// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html ++ #[inline] ++ unsafe fn replace_ctrl_h2(&mut self, index: usize, hash: u64) -> u8 { ++ // SAFETY: The caller must uphold the safety rules for the [`RawTableInner::replace_ctrl_h2`] ++ let prev_ctrl = *self.ctrl(index); ++ self.set_ctrl_h2(index, hash); ++ prev_ctrl ++ } ++ ++ /// Sets a control byte, and possibly also the replicated control byte at ++ /// the end of the array. ++ /// ++ /// This function does not make any changes to the `data` parts of the table, ++ /// or any changes to the `items` or `growth_left` field of the table. ++ /// ++ /// # Safety ++ /// ++ /// You must observe the following safety rules when calling this function: ++ /// ++ /// * The [`RawTableInner`] has already been allocated; ++ /// ++ /// * The `index` must not be greater than the `RawTableInner.bucket_mask`, i.e. ++ /// `index <= RawTableInner.bucket_mask` or, in other words, `(index + 1)` must ++ /// be no greater than the number returned by the function [`RawTableInner::buckets`]. ++ /// ++ /// Calling this function on a table that has not been allocated results in [`undefined behavior`]. ++ /// ++ /// See also [`Bucket::as_ptr`] method, for more information about of properly removing ++ /// or saving `data element` from / into the [`RawTable`] / [`RawTableInner`]. ++ /// ++ /// [`RawTableInner::buckets`]: RawTableInner::buckets ++ /// [`Bucket::as_ptr`]: Bucket::as_ptr ++ /// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html ++ #[inline] ++ unsafe fn set_ctrl(&mut self, index: usize, ctrl: u8) { ++ // Replicate the first Group::WIDTH control bytes at the end of ++ // the array without using a branch. If the tables smaller than ++ // the group width (self.buckets() < Group::WIDTH), ++ // `index2 = Group::WIDTH + index`, otherwise `index2` is: ++ // ++ // - If index >= Group::WIDTH then index == index2. ++ // - Otherwise index2 == self.bucket_mask + 1 + index. ++ // ++ // The very last replicated control byte is never actually read because ++ // we mask the initial index for unaligned loads, but we write it ++ // anyways because it makes the set_ctrl implementation simpler. ++ // ++ // If there are fewer buckets than Group::WIDTH then this code will ++ // replicate the buckets at the end of the trailing group. For example ++ // with 2 buckets and a group size of 4, the control bytes will look ++ // like this: ++ // ++ // Real | Replicated ++ // --------------------------------------------- ++ // | [A] | [B] | [EMPTY] | [EMPTY] | [A] | [B] | ++ // --------------------------------------------- ++ ++ // This is the same as `(index.wrapping_sub(Group::WIDTH)) % self.buckets() + Group::WIDTH` ++ // because the number of buckets is a power of two, and `self.bucket_mask = self.buckets() - 1`. ++ let index2 = ((index.wrapping_sub(Group::WIDTH)) & self.bucket_mask) + Group::WIDTH; ++ ++ // SAFETY: The caller must uphold the safety rules for the [`RawTableInner::set_ctrl`] ++ *self.ctrl(index) = ctrl; ++ *self.ctrl(index2) = ctrl; ++ } ++ ++ /// Returns a pointer to a control byte. ++ /// ++ /// # Safety ++ /// ++ /// For the allocated [`RawTableInner`], the result is [`Undefined Behavior`], ++ /// if the `index` is greater than the `self.bucket_mask + 1 + Group::WIDTH`. ++ /// In that case, calling this function with `index == self.bucket_mask + 1 + Group::WIDTH` ++ /// will return a pointer to the end of the allocated table and it is useless on its own. ++ /// ++ /// Calling this function with `index >= self.bucket_mask + 1 + Group::WIDTH` on a ++ /// table that has not been allocated results in [`Undefined Behavior`]. ++ /// ++ /// So to satisfy both requirements you should always follow the rule that ++ /// `index < self.bucket_mask + 1 + Group::WIDTH` ++ /// ++ /// Calling this function on [`RawTableInner`] that are not already allocated is safe ++ /// for read-only purpose. ++ /// ++ /// See also [`Bucket::as_ptr()`] method, for more information about of properly removing ++ /// or saving `data element` from / into the [`RawTable`] / [`RawTableInner`]. ++ /// ++ /// [`Bucket::as_ptr()`]: Bucket::as_ptr() ++ /// [`Undefined Behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html ++ #[inline] ++ unsafe fn ctrl(&self, index: usize) -> *mut u8 { ++ debug_assert!(index < self.num_ctrl_bytes()); ++ // SAFETY: The caller must uphold the safety rules for the [`RawTableInner::ctrl`] ++ self.ctrl.as_ptr().add(index) ++ } ++ ++ #[inline] ++ fn buckets(&self) -> usize { ++ self.bucket_mask + 1 ++ } ++ ++ /// Checks whether the bucket at `index` is full. ++ /// ++ /// # Safety ++ /// ++ /// The caller must ensure `index` is less than the number of buckets. ++ #[inline] ++ unsafe fn is_bucket_full(&self, index: usize) -> bool { ++ debug_assert!(index < self.buckets()); ++ is_full(*self.ctrl(index)) ++ } ++ ++ #[inline] ++ fn num_ctrl_bytes(&self) -> usize { ++ self.bucket_mask + 1 + Group::WIDTH ++ } ++ ++ #[inline] ++ fn is_empty_singleton(&self) -> bool { ++ self.bucket_mask == 0 ++ } ++ ++ /// Attempts to allocate a new hash table with at least enough capacity ++ /// for inserting the given number of elements without reallocating, ++ /// and return it inside ScopeGuard to protect against panic in the hash ++ /// function. ++ /// ++ /// # Note ++ /// ++ /// It is recommended (but not required): ++ /// ++ /// * That the new table's `capacity` be greater than or equal to `self.items`. ++ /// ++ /// * The `alloc` is the same [`Allocator`] as the `Allocator` used ++ /// to allocate this table. ++ /// ++ /// * The `table_layout` is the same [`TableLayout`] as the `TableLayout` used ++ /// to allocate this table. ++ /// ++ /// If `table_layout` does not match the `TableLayout` that was used to allocate ++ /// this table, then using `mem::swap` with the `self` and the new table returned ++ /// by this function results in [`undefined behavior`]. ++ /// ++ /// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html ++ #[allow(clippy::mut_mut)] ++ #[inline] ++ fn prepare_resize<'a, A>( ++ &self, ++ alloc: &'a A, ++ table_layout: TableLayout, ++ capacity: usize, ++ fallibility: Fallibility, ++ ) -> Result, TryReserveError> ++ where ++ A: Allocator, ++ { ++ debug_assert!(self.items <= capacity); ++ ++ // Allocate and initialize the new table. ++ let new_table = ++ RawTableInner::fallible_with_capacity(alloc, table_layout, capacity, fallibility)?; ++ ++ // The hash function may panic, in which case we simply free the new ++ // table without dropping any elements that may have been copied into ++ // it. ++ // ++ // This guard is also used to free the old table on success, see ++ // the comment at the bottom of this function. ++ Ok(guard(new_table, move |self_| { ++ if !self_.is_empty_singleton() { ++ // SAFETY: ++ // 1. We have checked that our table is allocated. ++ // 2. We know for sure that the `alloc` and `table_layout` matches the ++ // [`Allocator`] and [`TableLayout`] used to allocate this table. ++ unsafe { self_.free_buckets(alloc, table_layout) }; ++ } ++ })) ++ } ++ ++ /// Reserves or rehashes to make room for `additional` more elements. ++ /// ++ /// This uses dynamic dispatch to reduce the amount of ++ /// code generated, but it is eliminated by LLVM optimizations when inlined. ++ /// ++ /// # Safety ++ /// ++ /// If any of the following conditions are violated, the result is ++ /// [`undefined behavior`]: ++ /// ++ /// * The `alloc` must be the same [`Allocator`] as the `Allocator` used ++ /// to allocate this table. ++ /// ++ /// * The `layout` must be the same [`TableLayout`] as the `TableLayout` ++ /// used to allocate this table. ++ /// ++ /// * The `drop` function (`fn(*mut u8)`) must be the actual drop function of ++ /// the elements stored in the table. ++ /// ++ /// * The [`RawTableInner`] must have properly initialized control bytes. ++ /// ++ /// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html ++ #[allow(clippy::inline_always)] ++ #[inline(always)] ++ unsafe fn reserve_rehash_inner( ++ &mut self, ++ alloc: &A, ++ additional: usize, ++ hasher: &dyn Fn(&mut Self, usize) -> u64, ++ fallibility: Fallibility, ++ layout: TableLayout, ++ drop: Option, ++ ) -> Result<(), TryReserveError> ++ where ++ A: Allocator, ++ { ++ // Avoid `Option::ok_or_else` because it bloats LLVM IR. ++ let new_items = match self.items.checked_add(additional) { ++ Some(new_items) => new_items, ++ None => return Err(fallibility.capacity_overflow()), ++ }; ++ let full_capacity = bucket_mask_to_capacity(self.bucket_mask); ++ if new_items <= full_capacity / 2 { ++ // Rehash in-place without re-allocating if we have plenty of spare ++ // capacity that is locked up due to DELETED entries. ++ ++ // SAFETY: ++ // 1. We know for sure that `[`RawTableInner`]` has already been allocated ++ // (since new_items <= full_capacity / 2); ++ // 2. The caller ensures that `drop` function is the actual drop function of ++ // the elements stored in the table. ++ // 3. The caller ensures that `layout` matches the [`TableLayout`] that was ++ // used to allocate this table. ++ // 4. The caller ensures that the control bytes of the `RawTableInner` ++ // are already initialized. ++ self.rehash_in_place(hasher, layout.size, drop); ++ Ok(()) ++ } else { ++ // Otherwise, conservatively resize to at least the next size up ++ // to avoid churning deletes into frequent rehashes. ++ // ++ // SAFETY: ++ // 1. We know for sure that `capacity >= self.items`. ++ // 2. The caller ensures that `alloc` and `layout` matches the [`Allocator`] and ++ // [`TableLayout`] that were used to allocate this table. ++ // 3. The caller ensures that the control bytes of the `RawTableInner` ++ // are already initialized. ++ self.resize_inner( ++ alloc, ++ usize::max(new_items, full_capacity + 1), ++ hasher, ++ fallibility, ++ layout, ++ ) ++ } ++ } ++ ++ /// Returns an iterator over full buckets indices in the table. ++ /// ++ /// # Safety ++ /// ++ /// Behavior is undefined if any of the following conditions are violated: ++ /// ++ /// * The caller has to ensure that the `RawTableInner` outlives the ++ /// `FullBucketsIndices`. Because we cannot make the `next` method ++ /// unsafe on the `FullBucketsIndices` struct, we have to make the ++ /// `full_buckets_indices` method unsafe. ++ /// ++ /// * The [`RawTableInner`] must have properly initialized control bytes. ++ #[inline(always)] ++ unsafe fn full_buckets_indices(&self) -> FullBucketsIndices { ++ // SAFETY: ++ // 1. Since the caller of this function ensures that the control bytes ++ // are properly initialized and `self.ctrl(0)` points to the start ++ // of the array of control bytes, therefore: `ctrl` is valid for reads, ++ // properly aligned to `Group::WIDTH` and points to the properly initialized ++ // control bytes. ++ // 2. The value of `items` is equal to the amount of data (values) added ++ // to the table. ++ // ++ // `ctrl` points here (to the start ++ // of the first control byte `CT0`) ++ // ∨ ++ // [Pad], T_n, ..., T1, T0, |CT0, CT1, ..., CT_n|, Group::WIDTH ++ // \________ ________/ ++ // \/ ++ // `n = buckets - 1`, i.e. `RawTableInner::buckets() - 1` ++ // ++ // where: T0...T_n - our stored data; ++ // CT0...CT_n - control bytes or metadata for `data`. ++ let ctrl = NonNull::new_unchecked(self.ctrl(0)); ++ ++ FullBucketsIndices { ++ // Load the first group ++ // SAFETY: See explanation above. ++ current_group: Group::load_aligned(ctrl.as_ptr()).match_full().into_iter(), ++ group_first_index: 0, ++ ctrl, ++ items: self.items, ++ } ++ } ++ ++ /// Allocates a new table of a different size and moves the contents of the ++ /// current table into it. ++ /// ++ /// This uses dynamic dispatch to reduce the amount of ++ /// code generated, but it is eliminated by LLVM optimizations when inlined. ++ /// ++ /// # Safety ++ /// ++ /// If any of the following conditions are violated, the result is ++ /// [`undefined behavior`]: ++ /// ++ /// * The `alloc` must be the same [`Allocator`] as the `Allocator` used ++ /// to allocate this table; ++ /// ++ /// * The `layout` must be the same [`TableLayout`] as the `TableLayout` ++ /// used to allocate this table; ++ /// ++ /// * The [`RawTableInner`] must have properly initialized control bytes. ++ /// ++ /// The caller of this function must ensure that `capacity >= self.items` ++ /// otherwise: ++ /// ++ /// * If `self.items != 0`, calling of this function with `capacity == 0` ++ /// results in [`undefined behavior`]. ++ /// ++ /// * If `capacity_to_buckets(capacity) < Group::WIDTH` and ++ /// `self.items > capacity_to_buckets(capacity)` calling this function ++ /// results in [`undefined behavior`]. ++ /// ++ /// * If `capacity_to_buckets(capacity) >= Group::WIDTH` and ++ /// `self.items > capacity_to_buckets(capacity)` calling this function ++ /// are never return (will go into an infinite loop). ++ /// ++ /// Note: It is recommended (but not required) that the new table's `capacity` ++ /// be greater than or equal to `self.items`. In case if `capacity <= self.items` ++ /// this function can never return. See [`RawTableInner::find_insert_slot`] for ++ /// more information. ++ /// ++ /// [`RawTableInner::find_insert_slot`]: RawTableInner::find_insert_slot ++ /// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html ++ #[allow(clippy::inline_always)] ++ #[inline(always)] ++ unsafe fn resize_inner( ++ &mut self, ++ alloc: &A, ++ capacity: usize, ++ hasher: &dyn Fn(&mut Self, usize) -> u64, ++ fallibility: Fallibility, ++ layout: TableLayout, ++ ) -> Result<(), TryReserveError> ++ where ++ A: Allocator, ++ { ++ // SAFETY: We know for sure that `alloc` and `layout` matches the [`Allocator`] and [`TableLayout`] ++ // that were used to allocate this table. ++ let mut new_table = self.prepare_resize(alloc, layout, capacity, fallibility)?; ++ ++ // SAFETY: We know for sure that RawTableInner will outlive the ++ // returned `FullBucketsIndices` iterator, and the caller of this ++ // function ensures that the control bytes are properly initialized. ++ for full_byte_index in self.full_buckets_indices() { ++ // This may panic. ++ let hash = hasher(self, full_byte_index); ++ ++ // SAFETY: ++ // We can use a simpler version of insert() here since: ++ // 1. There are no DELETED entries. ++ // 2. We know there is enough space in the table. ++ // 3. All elements are unique. ++ // 4. The caller of this function guarantees that `capacity > 0` ++ // so `new_table` must already have some allocated memory. ++ // 5. We set `growth_left` and `items` fields of the new table ++ // after the loop. ++ // 6. We insert into the table, at the returned index, the data ++ // matching the given hash immediately after calling this function. ++ let (new_index, _) = new_table.prepare_insert_slot(hash); ++ ++ // SAFETY: ++ // ++ // * `src` is valid for reads of `layout.size` bytes, since the ++ // table is alive and the `full_byte_index` is guaranteed to be ++ // within bounds (see `FullBucketsIndices::next_impl`); ++ // ++ // * `dst` is valid for writes of `layout.size` bytes, since the ++ // caller ensures that `table_layout` matches the [`TableLayout`] ++ // that was used to allocate old table and we have the `new_index` ++ // returned by `prepare_insert_slot`. ++ // ++ // * Both `src` and `dst` are properly aligned. ++ // ++ // * Both `src` and `dst` point to different region of memory. ++ ptr::copy_nonoverlapping( ++ self.bucket_ptr(full_byte_index, layout.size), ++ new_table.bucket_ptr(new_index, layout.size), ++ layout.size, ++ ); ++ } ++ ++ // The hash function didn't panic, so we can safely set the ++ // `growth_left` and `items` fields of the new table. ++ new_table.growth_left -= self.items; ++ new_table.items = self.items; ++ ++ // We successfully copied all elements without panicking. Now replace ++ // self with the new table. The old table will have its memory freed but ++ // the items will not be dropped (since they have been moved into the ++ // new table). ++ // SAFETY: The caller ensures that `table_layout` matches the [`TableLayout`] ++ // that was used to allocate this table. ++ mem::swap(self, &mut new_table); ++ ++ Ok(()) ++ } ++ ++ /// Rehashes the contents of the table in place (i.e. without changing the ++ /// allocation). ++ /// ++ /// If `hasher` panics then some the table's contents may be lost. ++ /// ++ /// This uses dynamic dispatch to reduce the amount of ++ /// code generated, but it is eliminated by LLVM optimizations when inlined. ++ /// ++ /// # Safety ++ /// ++ /// If any of the following conditions are violated, the result is [`undefined behavior`]: ++ /// ++ /// * The `size_of` must be equal to the size of the elements stored in the table; ++ /// ++ /// * The `drop` function (`fn(*mut u8)`) must be the actual drop function of ++ /// the elements stored in the table. ++ /// ++ /// * The [`RawTableInner`] has already been allocated; ++ /// ++ /// * The [`RawTableInner`] must have properly initialized control bytes. ++ /// ++ /// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html ++ #[allow(clippy::inline_always)] ++ #[cfg_attr(feature = "inline-more", inline(always))] ++ #[cfg_attr(not(feature = "inline-more"), inline)] ++ unsafe fn rehash_in_place( ++ &mut self, ++ hasher: &dyn Fn(&mut Self, usize) -> u64, ++ size_of: usize, ++ drop: Option, ++ ) { ++ // If the hash function panics then properly clean up any elements ++ // that we haven't rehashed yet. We unfortunately can't preserve the ++ // element since we lost their hash and have no way of recovering it ++ // without risking another panic. ++ self.prepare_rehash_in_place(); ++ ++ let mut guard = guard(self, move |self_| { ++ if let Some(drop) = drop { ++ for i in 0..self_.buckets() { ++ if *self_.ctrl(i) == DELETED { ++ self_.set_ctrl(i, EMPTY); ++ drop(self_.bucket_ptr(i, size_of)); ++ self_.items -= 1; ++ } ++ } ++ } ++ self_.growth_left = bucket_mask_to_capacity(self_.bucket_mask) - self_.items; ++ }); ++ ++ // At this point, DELETED elements are elements that we haven't ++ // rehashed yet. Find them and re-insert them at their ideal ++ // position. ++ 'outer: for i in 0..guard.buckets() { ++ if *guard.ctrl(i) != DELETED { ++ continue; ++ } ++ ++ let i_p = guard.bucket_ptr(i, size_of); ++ ++ 'inner: loop { ++ // Hash the current item ++ let hash = hasher(*guard, i); ++ ++ // Search for a suitable place to put it ++ // ++ // SAFETY: Caller of this function ensures that the control bytes ++ // are properly initialized. ++ let new_i = guard.find_insert_slot(hash).index; ++ ++ // Probing works by scanning through all of the control ++ // bytes in groups, which may not be aligned to the group ++ // size. If both the new and old position fall within the ++ // same unaligned group, then there is no benefit in moving ++ // it and we can just continue to the next item. ++ if likely(guard.is_in_same_group(i, new_i, hash)) { ++ guard.set_ctrl_h2(i, hash); ++ continue 'outer; ++ } ++ ++ let new_i_p = guard.bucket_ptr(new_i, size_of); ++ ++ // We are moving the current item to a new position. Write ++ // our H2 to the control byte of the new position. ++ let prev_ctrl = guard.replace_ctrl_h2(new_i, hash); ++ if prev_ctrl == EMPTY { ++ guard.set_ctrl(i, EMPTY); ++ // If the target slot is empty, simply move the current ++ // element into the new slot and clear the old control ++ // byte. ++ ptr::copy_nonoverlapping(i_p, new_i_p, size_of); ++ continue 'outer; ++ } else { ++ // If the target slot is occupied, swap the two elements ++ // and then continue processing the element that we just ++ // swapped into the old slot. ++ debug_assert_eq!(prev_ctrl, DELETED); ++ ptr::swap_nonoverlapping(i_p, new_i_p, size_of); ++ continue 'inner; ++ } ++ } ++ } ++ ++ guard.growth_left = bucket_mask_to_capacity(guard.bucket_mask) - guard.items; ++ ++ mem::forget(guard); ++ } ++ ++ /// Deallocates the table without dropping any entries. ++ /// ++ /// # Note ++ /// ++ /// This function must be called only after [`drop_elements`](RawTableInner::drop_elements), ++ /// else it can lead to leaking of memory. Also calling this function automatically ++ /// makes invalid (dangling) all instances of buckets ([`Bucket`]) and makes invalid ++ /// (dangling) the `ctrl` field of the table. ++ /// ++ /// # Safety ++ /// ++ /// If any of the following conditions are violated, the result is [`Undefined Behavior`]: ++ /// ++ /// * The [`RawTableInner`] has already been allocated; ++ /// ++ /// * The `alloc` must be the same [`Allocator`] as the `Allocator` that was used ++ /// to allocate this table. ++ /// ++ /// * The `table_layout` must be the same [`TableLayout`] as the `TableLayout` that was used ++ /// to allocate this table. ++ /// ++ /// See also [`GlobalAlloc::dealloc`] or [`Allocator::deallocate`] for more information. ++ /// ++ /// [`Undefined Behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html ++ /// [`GlobalAlloc::dealloc`]: https://doc.rust-lang.org/alloc/alloc/trait.GlobalAlloc.html#tymethod.dealloc ++ /// [`Allocator::deallocate`]: https://doc.rust-lang.org/alloc/alloc/trait.Allocator.html#tymethod.deallocate ++ #[inline] ++ unsafe fn free_buckets(&mut self, alloc: &A, table_layout: TableLayout) ++ where ++ A: Allocator, ++ { ++ // SAFETY: The caller must uphold the safety contract for `free_buckets` ++ // method. ++ let (ptr, layout) = self.allocation_info(table_layout); ++ alloc.deallocate(ptr, layout); ++ } ++ ++ /// Returns a pointer to the allocated memory and the layout that was used to ++ /// allocate the table. ++ /// ++ /// # Safety ++ /// ++ /// Caller of this function must observe the following safety rules: ++ /// ++ /// * The [`RawTableInner`] has already been allocated, otherwise ++ /// calling this function results in [`undefined behavior`] ++ /// ++ /// * The `table_layout` must be the same [`TableLayout`] as the `TableLayout` ++ /// that was used to allocate this table. Failure to comply with this condition ++ /// may result in [`undefined behavior`]. ++ /// ++ /// See also [`GlobalAlloc::dealloc`] or [`Allocator::deallocate`] for more information. ++ /// ++ /// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html ++ /// [`GlobalAlloc::dealloc`]: https://doc.rust-lang.org/alloc/alloc/trait.GlobalAlloc.html#tymethod.dealloc ++ /// [`Allocator::deallocate`]: https://doc.rust-lang.org/alloc/alloc/trait.Allocator.html#tymethod.deallocate ++ #[inline] ++ unsafe fn allocation_info(&self, table_layout: TableLayout) -> (NonNull, Layout) { ++ debug_assert!( ++ !self.is_empty_singleton(), ++ "this function can only be called on non-empty tables" ++ ); ++ ++ // Avoid `Option::unwrap_or_else` because it bloats LLVM IR. ++ let (layout, ctrl_offset) = match table_layout.calculate_layout_for(self.buckets()) { ++ Some(lco) => lco, ++ None => unsafe { hint::unreachable_unchecked() }, ++ }; ++ ( ++ // SAFETY: The caller must uphold the safety contract for `allocation_info` method. ++ unsafe { NonNull::new_unchecked(self.ctrl.as_ptr().sub(ctrl_offset)) }, ++ layout, ++ ) ++ } ++ ++ /// Returns a pointer to the allocated memory and the layout that was used to ++ /// allocate the table. If [`RawTableInner`] has not been allocated, this ++ /// function return `dangling` pointer and `()` (unit) layout. ++ /// ++ /// # Safety ++ /// ++ /// The `table_layout` must be the same [`TableLayout`] as the `TableLayout` ++ /// that was used to allocate this table. Failure to comply with this condition ++ /// may result in [`undefined behavior`]. ++ /// ++ /// See also [`GlobalAlloc::dealloc`] or [`Allocator::deallocate`] for more information. ++ /// ++ /// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html ++ /// [`GlobalAlloc::dealloc`]: https://doc.rust-lang.org/alloc/alloc/trait.GlobalAlloc.html#tymethod.dealloc ++ /// [`Allocator::deallocate`]: https://doc.rust-lang.org/alloc/alloc/trait.Allocator.html#tymethod.deallocate ++ #[cfg(feature = "raw")] ++ unsafe fn allocation_info_or_zero(&self, table_layout: TableLayout) -> (NonNull, Layout) { ++ if self.is_empty_singleton() { ++ (NonNull::dangling(), Layout::new::<()>()) ++ } else { ++ // SAFETY: ++ // 1. We have checked that our table is allocated. ++ // 2. The caller ensures that `table_layout` matches the [`TableLayout`] ++ // that was used to allocate this table. ++ unsafe { self.allocation_info(table_layout) } ++ } ++ } ++ ++ /// Marks all table buckets as empty without dropping their contents. ++ #[inline] ++ fn clear_no_drop(&mut self) { ++ if !self.is_empty_singleton() { ++ unsafe { ++ self.ctrl(0).write_bytes(EMPTY, self.num_ctrl_bytes()); ++ } ++ } ++ self.items = 0; ++ self.growth_left = bucket_mask_to_capacity(self.bucket_mask); ++ } ++ ++ /// Erases the [`Bucket`]'s control byte at the given index so that it does not ++ /// triggered as full, decreases the `items` of the table and, if it can be done, ++ /// increases `self.growth_left`. ++ /// ++ /// This function does not actually erase / drop the [`Bucket`] itself, i.e. it ++ /// does not make any changes to the `data` parts of the table. The caller of this ++ /// function must take care to properly drop the `data`, otherwise calling this ++ /// function may result in a memory leak. ++ /// ++ /// # Safety ++ /// ++ /// You must observe the following safety rules when calling this function: ++ /// ++ /// * The [`RawTableInner`] has already been allocated; ++ /// ++ /// * It must be the full control byte at the given position; ++ /// ++ /// * The `index` must not be greater than the `RawTableInner.bucket_mask`, i.e. ++ /// `index <= RawTableInner.bucket_mask` or, in other words, `(index + 1)` must ++ /// be no greater than the number returned by the function [`RawTableInner::buckets`]. ++ /// ++ /// Calling this function on a table that has not been allocated results in [`undefined behavior`]. ++ /// ++ /// Calling this function on a table with no elements is unspecified, but calling subsequent ++ /// functions is likely to result in [`undefined behavior`] due to overflow subtraction ++ /// (`self.items -= 1 cause overflow when self.items == 0`). ++ /// ++ /// See also [`Bucket::as_ptr`] method, for more information about of properly removing ++ /// or saving `data element` from / into the [`RawTable`] / [`RawTableInner`]. ++ /// ++ /// [`RawTableInner::buckets`]: RawTableInner::buckets ++ /// [`Bucket::as_ptr`]: Bucket::as_ptr ++ /// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html ++ #[inline] ++ unsafe fn erase(&mut self, index: usize) { ++ debug_assert!(self.is_bucket_full(index)); ++ ++ // This is the same as `index.wrapping_sub(Group::WIDTH) % self.buckets()` because ++ // the number of buckets is a power of two, and `self.bucket_mask = self.buckets() - 1`. ++ let index_before = index.wrapping_sub(Group::WIDTH) & self.bucket_mask; ++ // SAFETY: ++ // - The caller must uphold the safety contract for `erase` method; ++ // - `index_before` is guaranteed to be in range due to masking with `self.bucket_mask` ++ let empty_before = Group::load(self.ctrl(index_before)).match_empty(); ++ let empty_after = Group::load(self.ctrl(index)).match_empty(); ++ ++ // Inserting and searching in the map is performed by two key functions: ++ // ++ // - The `find_insert_slot` function that looks up the index of any `EMPTY` or `DELETED` ++ // slot in a group to be able to insert. If it doesn't find an `EMPTY` or `DELETED` ++ // slot immediately in the first group, it jumps to the next `Group` looking for it, ++ // and so on until it has gone through all the groups in the control bytes. ++ // ++ // - The `find_inner` function that looks for the index of the desired element by looking ++ // at all the `FULL` bytes in the group. If it did not find the element right away, and ++ // there is no `EMPTY` byte in the group, then this means that the `find_insert_slot` ++ // function may have found a suitable slot in the next group. Therefore, `find_inner` ++ // jumps further, and if it does not find the desired element and again there is no `EMPTY` ++ // byte, then it jumps further, and so on. The search stops only if `find_inner` function ++ // finds the desired element or hits an `EMPTY` slot/byte. ++ // ++ // Accordingly, this leads to two consequences: ++ // ++ // - The map must have `EMPTY` slots (bytes); ++ // ++ // - You can't just mark the byte to be erased as `EMPTY`, because otherwise the `find_inner` ++ // function may stumble upon an `EMPTY` byte before finding the desired element and stop ++ // searching. ++ // ++ // Thus it is necessary to check all bytes after and before the erased element. If we are in ++ // a contiguous `Group` of `FULL` or `DELETED` bytes (the number of `FULL` or `DELETED` bytes ++ // before and after is greater than or equal to `Group::WIDTH`), then we must mark our byte as ++ // `DELETED` in order for the `find_inner` function to go further. On the other hand, if there ++ // is at least one `EMPTY` slot in the `Group`, then the `find_inner` function will still stumble ++ // upon an `EMPTY` byte, so we can safely mark our erased byte as `EMPTY` as well. ++ // ++ // Finally, since `index_before == (index.wrapping_sub(Group::WIDTH) & self.bucket_mask) == index` ++ // and given all of the above, tables smaller than the group width (self.buckets() < Group::WIDTH) ++ // cannot have `DELETED` bytes. ++ // ++ // Note that in this context `leading_zeros` refers to the bytes at the end of a group, while ++ // `trailing_zeros` refers to the bytes at the beginning of a group. ++ let ctrl = if empty_before.leading_zeros() + empty_after.trailing_zeros() >= Group::WIDTH { ++ DELETED ++ } else { ++ self.growth_left += 1; ++ EMPTY ++ }; ++ // SAFETY: the caller must uphold the safety contract for `erase` method. ++ self.set_ctrl(index, ctrl); ++ self.items -= 1; ++ } ++} ++ ++impl Clone for RawTable { ++ fn clone(&self) -> Self { ++ if self.table.is_empty_singleton() { ++ Self::new_in(self.alloc.clone()) ++ } else { ++ unsafe { ++ // Avoid `Result::ok_or_else` because it bloats LLVM IR. ++ // ++ // SAFETY: This is safe as we are taking the size of an already allocated table ++ // and therefore сapacity overflow cannot occur, `self.table.buckets()` is power ++ // of two and all allocator errors will be caught inside `RawTableInner::new_uninitialized`. ++ let mut new_table = match Self::new_uninitialized( ++ self.alloc.clone(), ++ self.table.buckets(), ++ Fallibility::Infallible, ++ ) { ++ Ok(table) => table, ++ Err(_) => hint::unreachable_unchecked(), ++ }; ++ ++ // Cloning elements may fail (the clone function may panic). But we don't ++ // need to worry about uninitialized control bits, since: ++ // 1. The number of items (elements) in the table is zero, which means that ++ // the control bits will not be readed by Drop function. ++ // 2. The `clone_from_spec` method will first copy all control bits from ++ // `self` (thus initializing them). But this will not affect the `Drop` ++ // function, since the `clone_from_spec` function sets `items` only after ++ // successfully clonning all elements. ++ new_table.clone_from_spec(self); ++ new_table ++ } ++ } ++ } ++ ++ fn clone_from(&mut self, source: &Self) { ++ if source.table.is_empty_singleton() { ++ let mut old_inner = mem::replace(&mut self.table, RawTableInner::NEW); ++ unsafe { ++ // SAFETY: ++ // 1. We call the function only once; ++ // 2. We know for sure that `alloc` and `table_layout` matches the [`Allocator`] ++ // and [`TableLayout`] that were used to allocate this table. ++ // 3. If any elements' drop function panics, then there will only be a memory leak, ++ // because we have replaced the inner table with a new one. ++ old_inner.drop_inner_table::(&self.alloc, Self::TABLE_LAYOUT); ++ } ++ } else { ++ unsafe { ++ // Make sure that if any panics occurs, we clear the table and ++ // leave it in an empty state. ++ let mut self_ = guard(self, |self_| { ++ self_.clear_no_drop(); ++ }); ++ ++ // First, drop all our elements without clearing the control ++ // bytes. If this panics then the scope guard will clear the ++ // table, leaking any elements that were not dropped yet. ++ // ++ // This leak is unavoidable: we can't try dropping more elements ++ // since this could lead to another panic and abort the process. ++ // ++ // SAFETY: If something gets wrong we clear our table right after ++ // dropping the elements, so there is no double drop, since `items` ++ // will be equal to zero. ++ self_.table.drop_elements::(); ++ ++ // If necessary, resize our table to match the source. ++ if self_.buckets() != source.buckets() { ++ let new_inner = match RawTableInner::new_uninitialized( ++ &self_.alloc, ++ Self::TABLE_LAYOUT, ++ source.buckets(), ++ Fallibility::Infallible, ++ ) { ++ Ok(table) => table, ++ Err(_) => hint::unreachable_unchecked(), ++ }; ++ // Replace the old inner with new uninitialized one. It's ok, since if something gets ++ // wrong `ScopeGuard` will initialize all control bytes and leave empty table. ++ let mut old_inner = mem::replace(&mut self_.table, new_inner); ++ if !old_inner.is_empty_singleton() { ++ // SAFETY: ++ // 1. We have checked that our table is allocated. ++ // 2. We know for sure that `alloc` and `table_layout` matches ++ // the [`Allocator`] and [`TableLayout`] that were used to allocate this table. ++ old_inner.free_buckets(&self_.alloc, Self::TABLE_LAYOUT); ++ } ++ } ++ ++ // Cloning elements may fail (the clone function may panic), but the `ScopeGuard` ++ // inside the `clone_from_impl` function will take care of that, dropping all ++ // cloned elements if necessary. Our `ScopeGuard` will clear the table. ++ self_.clone_from_spec(source); ++ ++ // Disarm the scope guard if cloning was successful. ++ ScopeGuard::into_inner(self_); ++ } ++ } ++ } ++} ++ ++/// Specialization of `clone_from` for `Copy` types ++trait RawTableClone { ++ unsafe fn clone_from_spec(&mut self, source: &Self); ++} ++impl RawTableClone for RawTable { ++ default_fn! { ++ #[cfg_attr(feature = "inline-more", inline)] ++ unsafe fn clone_from_spec(&mut self, source: &Self) { ++ self.clone_from_impl(source); ++ } ++ } ++} ++#[cfg(feature = "nightly")] ++impl RawTableClone for RawTable { ++ #[cfg_attr(feature = "inline-more", inline)] ++ unsafe fn clone_from_spec(&mut self, source: &Self) { ++ source ++ .table ++ .ctrl(0) ++ .copy_to_nonoverlapping(self.table.ctrl(0), self.table.num_ctrl_bytes()); ++ source ++ .data_start() ++ .as_ptr() ++ .copy_to_nonoverlapping(self.data_start().as_ptr(), self.table.buckets()); ++ ++ self.table.items = source.table.items; ++ self.table.growth_left = source.table.growth_left; ++ } ++} ++ ++impl RawTable { ++ /// Common code for clone and clone_from. Assumes: ++ /// - `self.buckets() == source.buckets()`. ++ /// - Any existing elements have been dropped. ++ /// - The control bytes are not initialized yet. ++ #[cfg_attr(feature = "inline-more", inline)] ++ unsafe fn clone_from_impl(&mut self, source: &Self) { ++ // Copy the control bytes unchanged. We do this in a single pass ++ source ++ .table ++ .ctrl(0) ++ .copy_to_nonoverlapping(self.table.ctrl(0), self.table.num_ctrl_bytes()); ++ ++ // The cloning of elements may panic, in which case we need ++ // to make sure we drop only the elements that have been ++ // cloned so far. ++ let mut guard = guard((0, &mut *self), |(index, self_)| { ++ if T::NEEDS_DROP { ++ for i in 0..*index { ++ if self_.is_bucket_full(i) { ++ self_.bucket(i).drop(); ++ } ++ } ++ } ++ }); ++ ++ for from in source.iter() { ++ let index = source.bucket_index(&from); ++ let to = guard.1.bucket(index); ++ to.write(from.as_ref().clone()); ++ ++ // Update the index in case we need to unwind. ++ guard.0 = index + 1; ++ } ++ ++ // Successfully cloned all items, no need to clean up. ++ mem::forget(guard); ++ ++ self.table.items = source.table.items; ++ self.table.growth_left = source.table.growth_left; ++ } ++ ++ /// Variant of `clone_from` to use when a hasher is available. ++ #[cfg(feature = "raw")] ++ pub fn clone_from_with_hasher(&mut self, source: &Self, hasher: impl Fn(&T) -> u64) { ++ // If we have enough capacity in the table, just clear it and insert ++ // elements one by one. We don't do this if we have the same number of ++ // buckets as the source since we can just copy the contents directly ++ // in that case. ++ if self.table.buckets() != source.table.buckets() ++ && bucket_mask_to_capacity(self.table.bucket_mask) >= source.len() ++ { ++ self.clear(); ++ ++ let mut guard_self = guard(&mut *self, |self_| { ++ // Clear the partially copied table if a panic occurs, otherwise ++ // items and growth_left will be out of sync with the contents ++ // of the table. ++ self_.clear(); ++ }); ++ ++ unsafe { ++ for item in source.iter() { ++ // This may panic. ++ let item = item.as_ref().clone(); ++ let hash = hasher(&item); ++ ++ // We can use a simpler version of insert() here since: ++ // - there are no DELETED entries. ++ // - we know there is enough space in the table. ++ // - all elements are unique. ++ let (index, _) = guard_self.table.prepare_insert_slot(hash); ++ guard_self.bucket(index).write(item); ++ } ++ } ++ ++ // Successfully cloned all items, no need to clean up. ++ mem::forget(guard_self); ++ ++ self.table.items = source.table.items; ++ self.table.growth_left -= source.table.items; ++ } else { ++ self.clone_from(source); ++ } ++ } ++} ++ ++impl Default for RawTable { ++ #[inline] ++ fn default() -> Self { ++ Self::new_in(Default::default()) ++ } ++} ++ ++#[cfg(feature = "nightly")] ++unsafe impl<#[may_dangle] T, A: Allocator> Drop for RawTable { ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn drop(&mut self) { ++ unsafe { ++ // SAFETY: ++ // 1. We call the function only once; ++ // 2. We know for sure that `alloc` and `table_layout` matches the [`Allocator`] ++ // and [`TableLayout`] that were used to allocate this table. ++ // 3. If the drop function of any elements fails, then only a memory leak will occur, ++ // and we don't care because we are inside the `Drop` function of the `RawTable`, ++ // so there won't be any table left in an inconsistent state. ++ self.table ++ .drop_inner_table::(&self.alloc, Self::TABLE_LAYOUT); ++ } ++ } ++} ++#[cfg(not(feature = "nightly"))] ++impl Drop for RawTable { ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn drop(&mut self) { ++ unsafe { ++ // SAFETY: ++ // 1. We call the function only once; ++ // 2. We know for sure that `alloc` and `table_layout` matches the [`Allocator`] ++ // and [`TableLayout`] that were used to allocate this table. ++ // 3. If the drop function of any elements fails, then only a memory leak will occur, ++ // and we don't care because we are inside the `Drop` function of the `RawTable`, ++ // so there won't be any table left in an inconsistent state. ++ self.table ++ .drop_inner_table::(&self.alloc, Self::TABLE_LAYOUT); ++ } ++ } ++} ++ ++impl IntoIterator for RawTable { ++ type Item = T; ++ type IntoIter = RawIntoIter; ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn into_iter(self) -> RawIntoIter { ++ unsafe { ++ let iter = self.iter(); ++ self.into_iter_from(iter) ++ } ++ } ++} ++ ++/// Iterator over a sub-range of a table. Unlike `RawIter` this iterator does ++/// not track an item count. ++pub(crate) struct RawIterRange { ++ // Mask of full buckets in the current group. Bits are cleared from this ++ // mask as each element is processed. ++ current_group: BitMaskIter, ++ ++ // Pointer to the buckets for the current group. ++ data: Bucket, ++ ++ // Pointer to the next group of control bytes, ++ // Must be aligned to the group size. ++ next_ctrl: *const u8, ++ ++ // Pointer one past the last control byte of this range. ++ end: *const u8, ++} ++ ++impl RawIterRange { ++ /// Returns a `RawIterRange` covering a subset of a table. ++ /// ++ /// # Safety ++ /// ++ /// If any of the following conditions are violated, the result is ++ /// [`undefined behavior`]: ++ /// ++ /// * `ctrl` must be [valid] for reads, i.e. table outlives the `RawIterRange`; ++ /// ++ /// * `ctrl` must be properly aligned to the group size (Group::WIDTH); ++ /// ++ /// * `ctrl` must point to the array of properly initialized control bytes; ++ /// ++ /// * `data` must be the [`Bucket`] at the `ctrl` index in the table; ++ /// ++ /// * the value of `len` must be less than or equal to the number of table buckets, ++ /// and the returned value of `ctrl.as_ptr().add(len).offset_from(ctrl.as_ptr())` ++ /// must be positive. ++ /// ++ /// * The `ctrl.add(len)` pointer must be either in bounds or one ++ /// byte past the end of the same [allocated table]. ++ /// ++ /// * The `len` must be a power of two. ++ /// ++ /// [valid]: https://doc.rust-lang.org/std/ptr/index.html#safety ++ /// [`undefined behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html ++ #[cfg_attr(feature = "inline-more", inline)] ++ unsafe fn new(ctrl: *const u8, data: Bucket, len: usize) -> Self { ++ debug_assert_ne!(len, 0); ++ debug_assert_eq!(ctrl as usize % Group::WIDTH, 0); ++ // SAFETY: The caller must uphold the safety rules for the [`RawIterRange::new`] ++ let end = ctrl.add(len); ++ ++ // Load the first group and advance ctrl to point to the next group ++ // SAFETY: The caller must uphold the safety rules for the [`RawIterRange::new`] ++ let current_group = Group::load_aligned(ctrl).match_full(); ++ let next_ctrl = ctrl.add(Group::WIDTH); ++ ++ Self { ++ current_group: current_group.into_iter(), ++ data, ++ next_ctrl, ++ end, ++ } ++ } ++ ++ /// Splits a `RawIterRange` into two halves. ++ /// ++ /// Returns `None` if the remaining range is smaller than or equal to the ++ /// group width. ++ #[cfg_attr(feature = "inline-more", inline)] ++ #[cfg(feature = "rayon")] ++ pub(crate) fn split(mut self) -> (Self, Option>) { ++ unsafe { ++ if self.end <= self.next_ctrl { ++ // Nothing to split if the group that we are current processing ++ // is the last one. ++ (self, None) ++ } else { ++ // len is the remaining number of elements after the group that ++ // we are currently processing. It must be a multiple of the ++ // group size (small tables are caught by the check above). ++ let len = offset_from(self.end, self.next_ctrl); ++ debug_assert_eq!(len % Group::WIDTH, 0); ++ ++ // Split the remaining elements into two halves, but round the ++ // midpoint down in case there is an odd number of groups ++ // remaining. This ensures that: ++ // - The tail is at least 1 group long. ++ // - The split is roughly even considering we still have the ++ // current group to process. ++ let mid = (len / 2) & !(Group::WIDTH - 1); ++ ++ let tail = Self::new( ++ self.next_ctrl.add(mid), ++ self.data.next_n(Group::WIDTH).next_n(mid), ++ len - mid, ++ ); ++ debug_assert_eq!( ++ self.data.next_n(Group::WIDTH).next_n(mid).ptr, ++ tail.data.ptr ++ ); ++ debug_assert_eq!(self.end, tail.end); ++ self.end = self.next_ctrl.add(mid); ++ debug_assert_eq!(self.end.add(Group::WIDTH), tail.next_ctrl); ++ (self, Some(tail)) ++ } ++ } ++ } ++ ++ /// # Safety ++ /// If DO_CHECK_PTR_RANGE is false, caller must ensure that we never try to iterate ++ /// after yielding all elements. ++ #[cfg_attr(feature = "inline-more", inline)] ++ unsafe fn next_impl(&mut self) -> Option> { ++ loop { ++ if let Some(index) = self.current_group.next() { ++ return Some(self.data.next_n(index)); ++ } ++ ++ if DO_CHECK_PTR_RANGE && self.next_ctrl >= self.end { ++ return None; ++ } ++ ++ // We might read past self.end up to the next group boundary, ++ // but this is fine because it only occurs on tables smaller ++ // than the group size where the trailing control bytes are all ++ // EMPTY. On larger tables self.end is guaranteed to be aligned ++ // to the group size (since tables are power-of-two sized). ++ self.current_group = Group::load_aligned(self.next_ctrl).match_full().into_iter(); ++ self.data = self.data.next_n(Group::WIDTH); ++ self.next_ctrl = self.next_ctrl.add(Group::WIDTH); ++ } ++ } ++ ++ /// Folds every element into an accumulator by applying an operation, ++ /// returning the final result. ++ /// ++ /// `fold_impl()` takes three arguments: the number of items remaining in ++ /// the iterator, an initial value, and a closure with two arguments: an ++ /// 'accumulator', and an element. The closure returns the value that the ++ /// accumulator should have for the next iteration. ++ /// ++ /// The initial value is the value the accumulator will have on the first call. ++ /// ++ /// After applying this closure to every element of the iterator, `fold_impl()` ++ /// returns the accumulator. ++ /// ++ /// # Safety ++ /// ++ /// If any of the following conditions are violated, the result is ++ /// [`Undefined Behavior`]: ++ /// ++ /// * The [`RawTableInner`] / [`RawTable`] must be alive and not moved, ++ /// i.e. table outlives the `RawIterRange`; ++ /// ++ /// * The provided `n` value must match the actual number of items ++ /// in the table. ++ /// ++ /// [`Undefined Behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html ++ #[allow(clippy::while_let_on_iterator)] ++ #[cfg_attr(feature = "inline-more", inline)] ++ unsafe fn fold_impl(mut self, mut n: usize, mut acc: B, mut f: F) -> B ++ where ++ F: FnMut(B, Bucket) -> B, ++ { ++ loop { ++ while let Some(index) = self.current_group.next() { ++ // The returned `index` will always be in the range `0..Group::WIDTH`, ++ // so that calling `self.data.next_n(index)` is safe (see detailed explanation below). ++ debug_assert!(n != 0); ++ let bucket = self.data.next_n(index); ++ acc = f(acc, bucket); ++ n -= 1; ++ } ++ ++ if n == 0 { ++ return acc; ++ } ++ ++ // SAFETY: The caller of this function ensures that: ++ // ++ // 1. The provided `n` value matches the actual number of items in the table; ++ // 2. The table is alive and did not moved. ++ // ++ // Taking the above into account, we always stay within the bounds, because: ++ // ++ // 1. For tables smaller than the group width (self.buckets() <= Group::WIDTH), ++ // we will never end up in the given branch, since we should have already ++ // yielded all the elements of the table. ++ // ++ // 2. For tables larger than the group width. The number of buckets is a ++ // power of two (2 ^ n), Group::WIDTH is also power of two (2 ^ k). Since ++ // `(2 ^ n) > (2 ^ k)`, than `(2 ^ n) % (2 ^ k) = 0`. As we start from the ++ // start of the array of control bytes, and never try to iterate after ++ // getting all the elements, the last `self.current_group` will read bytes ++ // from the `self.buckets() - Group::WIDTH` index. We know also that ++ // `self.current_group.next()` will always retun indices within the range ++ // `0..Group::WIDTH`. ++ // ++ // Knowing all of the above and taking into account that we are synchronizing ++ // the `self.data` index with the index we used to read the `self.current_group`, ++ // the subsequent `self.data.next_n(index)` will always return a bucket with ++ // an index number less than `self.buckets()`. ++ // ++ // The last `self.next_ctrl`, whose index would be `self.buckets()`, will never ++ // actually be read, since we should have already yielded all the elements of ++ // the table. ++ self.current_group = Group::load_aligned(self.next_ctrl).match_full().into_iter(); ++ self.data = self.data.next_n(Group::WIDTH); ++ self.next_ctrl = self.next_ctrl.add(Group::WIDTH); ++ } ++ } ++} ++ ++// We make raw iterators unconditionally Send and Sync, and let the PhantomData ++// in the actual iterator implementations determine the real Send/Sync bounds. ++unsafe impl Send for RawIterRange {} ++unsafe impl Sync for RawIterRange {} ++ ++impl Clone for RawIterRange { ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn clone(&self) -> Self { ++ Self { ++ data: self.data.clone(), ++ next_ctrl: self.next_ctrl, ++ current_group: self.current_group, ++ end: self.end, ++ } ++ } ++} ++ ++impl Iterator for RawIterRange { ++ type Item = Bucket; ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn next(&mut self) -> Option> { ++ unsafe { ++ // SAFETY: We set checker flag to true. ++ self.next_impl::() ++ } ++ } ++ ++ #[inline] ++ fn size_hint(&self) -> (usize, Option) { ++ // We don't have an item count, so just guess based on the range size. ++ let remaining_buckets = if self.end > self.next_ctrl { ++ unsafe { offset_from(self.end, self.next_ctrl) } ++ } else { ++ 0 ++ }; ++ ++ // Add a group width to include the group we are currently processing. ++ (0, Some(Group::WIDTH + remaining_buckets)) ++ } ++} ++ ++impl FusedIterator for RawIterRange {} ++ ++/// Iterator which returns a raw pointer to every full bucket in the table. ++/// ++/// For maximum flexibility this iterator is not bound by a lifetime, but you ++/// must observe several rules when using it: ++/// - You must not free the hash table while iterating (including via growing/shrinking). ++/// - It is fine to erase a bucket that has been yielded by the iterator. ++/// - Erasing a bucket that has not yet been yielded by the iterator may still ++/// result in the iterator yielding that bucket (unless `reflect_remove` is called). ++/// - It is unspecified whether an element inserted after the iterator was ++/// created will be yielded by that iterator (unless `reflect_insert` is called). ++/// - The order in which the iterator yields bucket is unspecified and may ++/// change in the future. ++pub struct RawIter { ++ pub(crate) iter: RawIterRange, ++ items: usize, ++} ++ ++impl RawIter { ++ /// Refresh the iterator so that it reflects a removal from the given bucket. ++ /// ++ /// For the iterator to remain valid, this method must be called once ++ /// for each removed bucket before `next` is called again. ++ /// ++ /// This method should be called _before_ the removal is made. It is not necessary to call this ++ /// method if you are removing an item that this iterator yielded in the past. ++ #[cfg(feature = "raw")] ++ pub unsafe fn reflect_remove(&mut self, b: &Bucket) { ++ self.reflect_toggle_full(b, false); ++ } ++ ++ /// Refresh the iterator so that it reflects an insertion into the given bucket. ++ /// ++ /// For the iterator to remain valid, this method must be called once ++ /// for each insert before `next` is called again. ++ /// ++ /// This method does not guarantee that an insertion of a bucket with a greater ++ /// index than the last one yielded will be reflected in the iterator. ++ /// ++ /// This method should be called _after_ the given insert is made. ++ #[cfg(feature = "raw")] ++ pub unsafe fn reflect_insert(&mut self, b: &Bucket) { ++ self.reflect_toggle_full(b, true); ++ } ++ ++ /// Refresh the iterator so that it reflects a change to the state of the given bucket. ++ #[cfg(feature = "raw")] ++ unsafe fn reflect_toggle_full(&mut self, b: &Bucket, is_insert: bool) { ++ if b.as_ptr() > self.iter.data.as_ptr() { ++ // The iterator has already passed the bucket's group. ++ // So the toggle isn't relevant to this iterator. ++ return; ++ } ++ ++ if self.iter.next_ctrl < self.iter.end ++ && b.as_ptr() <= self.iter.data.next_n(Group::WIDTH).as_ptr() ++ { ++ // The iterator has not yet reached the bucket's group. ++ // We don't need to reload anything, but we do need to adjust the item count. ++ ++ if cfg!(debug_assertions) { ++ // Double-check that the user isn't lying to us by checking the bucket state. ++ // To do that, we need to find its control byte. We know that self.iter.data is ++ // at self.iter.next_ctrl - Group::WIDTH, so we work from there: ++ let offset = offset_from(self.iter.data.as_ptr(), b.as_ptr()); ++ let ctrl = self.iter.next_ctrl.sub(Group::WIDTH).add(offset); ++ // This method should be called _before_ a removal, or _after_ an insert, ++ // so in both cases the ctrl byte should indicate that the bucket is full. ++ assert!(is_full(*ctrl)); ++ } ++ ++ if is_insert { ++ self.items += 1; ++ } else { ++ self.items -= 1; ++ } ++ ++ return; ++ } ++ ++ // The iterator is at the bucket group that the toggled bucket is in. ++ // We need to do two things: ++ // ++ // - Determine if the iterator already yielded the toggled bucket. ++ // If it did, we're done. ++ // - Otherwise, update the iterator cached group so that it won't ++ // yield a to-be-removed bucket, or _will_ yield a to-be-added bucket. ++ // We'll also need to update the item count accordingly. ++ if let Some(index) = self.iter.current_group.0.lowest_set_bit() { ++ let next_bucket = self.iter.data.next_n(index); ++ if b.as_ptr() > next_bucket.as_ptr() { ++ // The toggled bucket is "before" the bucket the iterator would yield next. We ++ // therefore don't need to do anything --- the iterator has already passed the ++ // bucket in question. ++ // ++ // The item count must already be correct, since a removal or insert "prior" to ++ // the iterator's position wouldn't affect the item count. ++ } else { ++ // The removed bucket is an upcoming bucket. We need to make sure it does _not_ ++ // get yielded, and also that it's no longer included in the item count. ++ // ++ // NOTE: We can't just reload the group here, both since that might reflect ++ // inserts we've already passed, and because that might inadvertently unset the ++ // bits for _other_ removals. If we do that, we'd have to also decrement the ++ // item count for those other bits that we unset. But the presumably subsequent ++ // call to reflect for those buckets might _also_ decrement the item count. ++ // Instead, we _just_ flip the bit for the particular bucket the caller asked ++ // us to reflect. ++ let our_bit = offset_from(self.iter.data.as_ptr(), b.as_ptr()); ++ let was_full = self.iter.current_group.flip(our_bit); ++ debug_assert_ne!(was_full, is_insert); ++ ++ if is_insert { ++ self.items += 1; ++ } else { ++ self.items -= 1; ++ } ++ ++ if cfg!(debug_assertions) { ++ if b.as_ptr() == next_bucket.as_ptr() { ++ // The removed bucket should no longer be next ++ debug_assert_ne!(self.iter.current_group.0.lowest_set_bit(), Some(index)); ++ } else { ++ // We should not have changed what bucket comes next. ++ debug_assert_eq!(self.iter.current_group.0.lowest_set_bit(), Some(index)); ++ } ++ } ++ } ++ } else { ++ // We must have already iterated past the removed item. ++ } ++ } ++ ++ unsafe fn drop_elements(&mut self) { ++ if T::NEEDS_DROP && self.items != 0 { ++ for item in self { ++ item.drop(); ++ } ++ } ++ } ++} ++ ++impl Clone for RawIter { ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn clone(&self) -> Self { ++ Self { ++ iter: self.iter.clone(), ++ items: self.items, ++ } ++ } ++} ++ ++impl Iterator for RawIter { ++ type Item = Bucket; ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn next(&mut self) -> Option> { ++ // Inner iterator iterates over buckets ++ // so it can do unnecessary work if we already yielded all items. ++ if self.items == 0 { ++ return None; ++ } ++ ++ let nxt = unsafe { ++ // SAFETY: We check number of items to yield using `items` field. ++ self.iter.next_impl::() ++ }; ++ ++ debug_assert!(nxt.is_some()); ++ self.items -= 1; ++ ++ nxt ++ } ++ ++ #[inline] ++ fn size_hint(&self) -> (usize, Option) { ++ (self.items, Some(self.items)) ++ } ++ ++ #[inline] ++ fn fold(self, init: B, f: F) -> B ++ where ++ Self: Sized, ++ F: FnMut(B, Self::Item) -> B, ++ { ++ unsafe { self.iter.fold_impl(self.items, init, f) } ++ } ++} ++ ++impl ExactSizeIterator for RawIter {} ++impl FusedIterator for RawIter {} ++ ++/// Iterator which returns an index of every full bucket in the table. ++/// ++/// For maximum flexibility this iterator is not bound by a lifetime, but you ++/// must observe several rules when using it: ++/// - You must not free the hash table while iterating (including via growing/shrinking). ++/// - It is fine to erase a bucket that has been yielded by the iterator. ++/// - Erasing a bucket that has not yet been yielded by the iterator may still ++/// result in the iterator yielding index of that bucket. ++/// - It is unspecified whether an element inserted after the iterator was ++/// created will be yielded by that iterator. ++/// - The order in which the iterator yields indices of the buckets is unspecified ++/// and may change in the future. ++pub(crate) struct FullBucketsIndices { ++ // Mask of full buckets in the current group. Bits are cleared from this ++ // mask as each element is processed. ++ current_group: BitMaskIter, ++ ++ // Initial value of the bytes' indices of the current group (relative ++ // to the start of the control bytes). ++ group_first_index: usize, ++ ++ // Pointer to the current group of control bytes, ++ // Must be aligned to the group size (Group::WIDTH). ++ ctrl: NonNull, ++ ++ // Number of elements in the table. ++ items: usize, ++} ++ ++impl FullBucketsIndices { ++ /// Advances the iterator and returns the next value. ++ /// ++ /// # Safety ++ /// ++ /// If any of the following conditions are violated, the result is ++ /// [`Undefined Behavior`]: ++ /// ++ /// * The [`RawTableInner`] / [`RawTable`] must be alive and not moved, ++ /// i.e. table outlives the `FullBucketsIndices`; ++ /// ++ /// * It never tries to iterate after getting all elements. ++ /// ++ /// [`Undefined Behavior`]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html ++ #[inline(always)] ++ unsafe fn next_impl(&mut self) -> Option { ++ loop { ++ if let Some(index) = self.current_group.next() { ++ // The returned `self.group_first_index + index` will always ++ // be in the range `0..self.buckets()`. See explanation below. ++ return Some(self.group_first_index + index); ++ } ++ ++ // SAFETY: The caller of this function ensures that: ++ // ++ // 1. It never tries to iterate after getting all the elements; ++ // 2. The table is alive and did not moved; ++ // 3. The first `self.ctrl` pointed to the start of the array of control bytes. ++ // ++ // Taking the above into account, we always stay within the bounds, because: ++ // ++ // 1. For tables smaller than the group width (self.buckets() <= Group::WIDTH), ++ // we will never end up in the given branch, since we should have already ++ // yielded all the elements of the table. ++ // ++ // 2. For tables larger than the group width. The number of buckets is a ++ // power of two (2 ^ n), Group::WIDTH is also power of two (2 ^ k). Since ++ // `(2 ^ n) > (2 ^ k)`, than `(2 ^ n) % (2 ^ k) = 0`. As we start from the ++ // the start of the array of control bytes, and never try to iterate after ++ // getting all the elements, the last `self.ctrl` will be equal to ++ // the `self.buckets() - Group::WIDTH`, so `self.current_group.next()` ++ // will always contains indices within the range `0..Group::WIDTH`, ++ // and subsequent `self.group_first_index + index` will always return a ++ // number less than `self.buckets()`. ++ self.ctrl = NonNull::new_unchecked(self.ctrl.as_ptr().add(Group::WIDTH)); ++ ++ // SAFETY: See explanation above. ++ self.current_group = Group::load_aligned(self.ctrl.as_ptr()) ++ .match_full() ++ .into_iter(); ++ self.group_first_index += Group::WIDTH; ++ } ++ } ++} ++ ++impl Iterator for FullBucketsIndices { ++ type Item = usize; ++ ++ /// Advances the iterator and returns the next value. It is up to ++ /// the caller to ensure that the `RawTable` outlives the `FullBucketsIndices`, ++ /// because we cannot make the `next` method unsafe. ++ #[inline(always)] ++ fn next(&mut self) -> Option { ++ // Return if we already yielded all items. ++ if self.items == 0 { ++ return None; ++ } ++ ++ let nxt = unsafe { ++ // SAFETY: ++ // 1. We check number of items to yield using `items` field. ++ // 2. The caller ensures that the table is alive and has not moved. ++ self.next_impl() ++ }; ++ ++ debug_assert!(nxt.is_some()); ++ self.items -= 1; ++ ++ nxt ++ } ++ ++ #[inline(always)] ++ fn size_hint(&self) -> (usize, Option) { ++ (self.items, Some(self.items)) ++ } ++} ++ ++impl ExactSizeIterator for FullBucketsIndices {} ++impl FusedIterator for FullBucketsIndices {} ++ ++/// Iterator which consumes a table and returns elements. ++pub struct RawIntoIter { ++ iter: RawIter, ++ allocation: Option<(NonNull, Layout, A)>, ++ marker: PhantomData, ++} ++ ++impl RawIntoIter { ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn iter(&self) -> RawIter { ++ self.iter.clone() ++ } ++} ++ ++unsafe impl Send for RawIntoIter ++where ++ T: Send, ++ A: Send, ++{ ++} ++unsafe impl Sync for RawIntoIter ++where ++ T: Sync, ++ A: Sync, ++{ ++} ++ ++#[cfg(feature = "nightly")] ++unsafe impl<#[may_dangle] T, A: Allocator> Drop for RawIntoIter { ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn drop(&mut self) { ++ unsafe { ++ // Drop all remaining elements ++ self.iter.drop_elements(); ++ ++ // Free the table ++ if let Some((ptr, layout, ref alloc)) = self.allocation { ++ alloc.deallocate(ptr, layout); ++ } ++ } ++ } ++} ++#[cfg(not(feature = "nightly"))] ++impl Drop for RawIntoIter { ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn drop(&mut self) { ++ unsafe { ++ // Drop all remaining elements ++ self.iter.drop_elements(); ++ ++ // Free the table ++ if let Some((ptr, layout, ref alloc)) = self.allocation { ++ alloc.deallocate(ptr, layout); ++ } ++ } ++ } ++} ++ ++impl Iterator for RawIntoIter { ++ type Item = T; ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn next(&mut self) -> Option { ++ unsafe { Some(self.iter.next()?.read()) } ++ } ++ ++ #[inline] ++ fn size_hint(&self) -> (usize, Option) { ++ self.iter.size_hint() ++ } ++} ++ ++impl ExactSizeIterator for RawIntoIter {} ++impl FusedIterator for RawIntoIter {} ++ ++/// Iterator which consumes elements without freeing the table storage. ++pub struct RawDrain<'a, T, A: Allocator = Global> { ++ iter: RawIter, ++ ++ // The table is moved into the iterator for the duration of the drain. This ++ // ensures that an empty table is left if the drain iterator is leaked ++ // without dropping. ++ table: RawTableInner, ++ orig_table: NonNull, ++ ++ // We don't use a &'a mut RawTable because we want RawDrain to be ++ // covariant over T. ++ marker: PhantomData<&'a RawTable>, ++} ++ ++impl RawDrain<'_, T, A> { ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn iter(&self) -> RawIter { ++ self.iter.clone() ++ } ++} ++ ++unsafe impl Send for RawDrain<'_, T, A> ++where ++ T: Send, ++ A: Send, ++{ ++} ++unsafe impl Sync for RawDrain<'_, T, A> ++where ++ T: Sync, ++ A: Sync, ++{ ++} ++ ++impl Drop for RawDrain<'_, T, A> { ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn drop(&mut self) { ++ unsafe { ++ // Drop all remaining elements. Note that this may panic. ++ self.iter.drop_elements(); ++ ++ // Reset the contents of the table now that all elements have been ++ // dropped. ++ self.table.clear_no_drop(); ++ ++ // Move the now empty table back to its original location. ++ self.orig_table ++ .as_ptr() ++ .copy_from_nonoverlapping(&self.table, 1); ++ } ++ } ++} ++ ++impl Iterator for RawDrain<'_, T, A> { ++ type Item = T; ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn next(&mut self) -> Option { ++ unsafe { ++ let item = self.iter.next()?; ++ Some(item.read()) ++ } ++ } ++ ++ #[inline] ++ fn size_hint(&self) -> (usize, Option) { ++ self.iter.size_hint() ++ } ++} ++ ++impl ExactSizeIterator for RawDrain<'_, T, A> {} ++impl FusedIterator for RawDrain<'_, T, A> {} ++ ++/// Iterator over occupied buckets that could match a given hash. ++/// ++/// `RawTable` only stores 7 bits of the hash value, so this iterator may return ++/// items that have a hash value different than the one provided. You should ++/// always validate the returned values before using them. ++/// ++/// For maximum flexibility this iterator is not bound by a lifetime, but you ++/// must observe several rules when using it: ++/// - You must not free the hash table while iterating (including via growing/shrinking). ++/// - It is fine to erase a bucket that has been yielded by the iterator. ++/// - Erasing a bucket that has not yet been yielded by the iterator may still ++/// result in the iterator yielding that bucket. ++/// - It is unspecified whether an element inserted after the iterator was ++/// created will be yielded by that iterator. ++/// - The order in which the iterator yields buckets is unspecified and may ++/// change in the future. ++pub struct RawIterHash { ++ inner: RawIterHashInner, ++ _marker: PhantomData, ++} ++ ++struct RawIterHashInner { ++ // See `RawTableInner`'s corresponding fields for details. ++ // We can't store a `*const RawTableInner` as it would get ++ // invalidated by the user calling `&mut` methods on `RawTable`. ++ bucket_mask: usize, ++ ctrl: NonNull, ++ ++ // The top 7 bits of the hash. ++ h2_hash: u8, ++ ++ // The sequence of groups to probe in the search. ++ probe_seq: ProbeSeq, ++ ++ group: Group, ++ ++ // The elements within the group with a matching h2-hash. ++ bitmask: BitMaskIter, ++} ++ ++impl RawIterHash { ++ #[cfg_attr(feature = "inline-more", inline)] ++ #[cfg(feature = "raw")] ++ unsafe fn new(table: &RawTable, hash: u64) -> Self { ++ RawIterHash { ++ inner: RawIterHashInner::new(&table.table, hash), ++ _marker: PhantomData, ++ } ++ } ++} ++impl RawIterHashInner { ++ #[cfg_attr(feature = "inline-more", inline)] ++ #[cfg(feature = "raw")] ++ unsafe fn new(table: &RawTableInner, hash: u64) -> Self { ++ let h2_hash = h2(hash); ++ let probe_seq = table.probe_seq(hash); ++ let group = Group::load(table.ctrl(probe_seq.pos)); ++ let bitmask = group.match_byte(h2_hash).into_iter(); ++ ++ RawIterHashInner { ++ bucket_mask: table.bucket_mask, ++ ctrl: table.ctrl, ++ h2_hash, ++ probe_seq, ++ group, ++ bitmask, ++ } ++ } ++} ++ ++impl Iterator for RawIterHash { ++ type Item = Bucket; ++ ++ fn next(&mut self) -> Option> { ++ unsafe { ++ match self.inner.next() { ++ Some(index) => { ++ // Can't use `RawTable::bucket` here as we don't have ++ // an actual `RawTable` reference to use. ++ debug_assert!(index <= self.inner.bucket_mask); ++ let bucket = Bucket::from_base_index(self.inner.ctrl.cast(), index); ++ Some(bucket) ++ } ++ None => None, ++ } ++ } ++ } ++} ++ ++impl Iterator for RawIterHashInner { ++ type Item = usize; ++ ++ fn next(&mut self) -> Option { ++ unsafe { ++ loop { ++ if let Some(bit) = self.bitmask.next() { ++ let index = (self.probe_seq.pos + bit) & self.bucket_mask; ++ return Some(index); ++ } ++ if likely(self.group.match_empty().any_bit_set()) { ++ return None; ++ } ++ self.probe_seq.move_next(self.bucket_mask); ++ ++ // Can't use `RawTableInner::ctrl` here as we don't have ++ // an actual `RawTableInner` reference to use. ++ let index = self.probe_seq.pos; ++ debug_assert!(index < self.bucket_mask + 1 + Group::WIDTH); ++ let group_ctrl = self.ctrl.as_ptr().add(index); ++ ++ self.group = Group::load(group_ctrl); ++ self.bitmask = self.group.match_byte(self.h2_hash).into_iter(); ++ } ++ } ++ } ++} ++ ++pub(crate) struct RawExtractIf<'a, T, A: Allocator> { ++ pub iter: RawIter, ++ pub table: &'a mut RawTable, ++} ++ ++impl RawExtractIf<'_, T, A> { ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub(crate) fn next(&mut self, mut f: F) -> Option ++ where ++ F: FnMut(&mut T) -> bool, ++ { ++ unsafe { ++ for item in &mut self.iter { ++ if f(item.as_mut()) { ++ return Some(self.table.remove(item).0); ++ } ++ } ++ } ++ None ++ } ++} ++ ++#[cfg(test)] ++mod test_map { ++ use super::*; ++ ++ fn rehash_in_place(table: &mut RawTable, hasher: impl Fn(&T) -> u64) { ++ unsafe { ++ table.table.rehash_in_place( ++ &|table, index| hasher(table.bucket::(index).as_ref()), ++ mem::size_of::(), ++ if mem::needs_drop::() { ++ Some(mem::transmute(ptr::drop_in_place:: as unsafe fn(*mut T))) ++ } else { ++ None ++ }, ++ ); ++ } ++ } ++ ++ #[test] ++ fn rehash() { ++ let mut table = RawTable::new(); ++ let hasher = |i: &u64| *i; ++ for i in 0..100 { ++ table.insert(i, i, hasher); ++ } ++ ++ for i in 0..100 { ++ unsafe { ++ assert_eq!(table.find(i, |x| *x == i).map(|b| b.read()), Some(i)); ++ } ++ assert!(table.find(i + 100, |x| *x == i + 100).is_none()); ++ } ++ ++ rehash_in_place(&mut table, hasher); ++ ++ for i in 0..100 { ++ unsafe { ++ assert_eq!(table.find(i, |x| *x == i).map(|b| b.read()), Some(i)); ++ } ++ assert!(table.find(i + 100, |x| *x == i + 100).is_none()); ++ } ++ } ++ ++ /// CHECKING THAT WE ARE NOT TRYING TO READ THE MEMORY OF ++ /// AN UNINITIALIZED TABLE DURING THE DROP ++ #[test] ++ fn test_drop_uninitialized() { ++ use ::alloc::vec::Vec; ++ ++ let table = unsafe { ++ // SAFETY: The `buckets` is power of two and we're not ++ // trying to actually use the returned RawTable. ++ RawTable::<(u64, Vec)>::new_uninitialized(Global, 8, Fallibility::Infallible) ++ .unwrap() ++ }; ++ drop(table); ++ } ++ ++ /// CHECKING THAT WE DON'T TRY TO DROP DATA IF THE `ITEMS` ++ /// ARE ZERO, EVEN IF WE HAVE `FULL` CONTROL BYTES. ++ #[test] ++ fn test_drop_zero_items() { ++ use ::alloc::vec::Vec; ++ unsafe { ++ // SAFETY: The `buckets` is power of two and we're not ++ // trying to actually use the returned RawTable. ++ let table = ++ RawTable::<(u64, Vec)>::new_uninitialized(Global, 8, Fallibility::Infallible) ++ .unwrap(); ++ ++ // WE SIMULATE, AS IT WERE, A FULL TABLE. ++ ++ // SAFETY: We checked that the table is allocated and therefore the table already has ++ // `self.bucket_mask + 1 + Group::WIDTH` number of control bytes (see TableLayout::calculate_layout_for) ++ // so writing `table.table.num_ctrl_bytes() == bucket_mask + 1 + Group::WIDTH` bytes is safe. ++ table ++ .table ++ .ctrl(0) ++ .write_bytes(EMPTY, table.table.num_ctrl_bytes()); ++ ++ // SAFETY: table.capacity() is guaranteed to be smaller than table.buckets() ++ table.table.ctrl(0).write_bytes(0, table.capacity()); ++ ++ // Fix up the trailing control bytes. See the comments in set_ctrl ++ // for the handling of tables smaller than the group width. ++ if table.buckets() < Group::WIDTH { ++ // SAFETY: We have `self.bucket_mask + 1 + Group::WIDTH` number of control bytes, ++ // so copying `self.buckets() == self.bucket_mask + 1` bytes with offset equal to ++ // `Group::WIDTH` is safe ++ table ++ .table ++ .ctrl(0) ++ .copy_to(table.table.ctrl(Group::WIDTH), table.table.buckets()); ++ } else { ++ // SAFETY: We have `self.bucket_mask + 1 + Group::WIDTH` number of ++ // control bytes,so copying `Group::WIDTH` bytes with offset equal ++ // to `self.buckets() == self.bucket_mask + 1` is safe ++ table ++ .table ++ .ctrl(0) ++ .copy_to(table.table.ctrl(table.table.buckets()), Group::WIDTH); ++ } ++ drop(table); ++ } ++ } ++ ++ /// CHECKING THAT WE DON'T TRY TO DROP DATA IF THE `ITEMS` ++ /// ARE ZERO, EVEN IF WE HAVE `FULL` CONTROL BYTES. ++ #[test] ++ #[cfg(feature="allocator-api2")] ++ fn test_catch_panic_clone_from() { ++ use ::alloc::sync::Arc; ++ use ::alloc::vec::Vec; ++ #[cfg(feature="allocator-api2")] ++ use allocator_api2::alloc::{AllocError, Allocator, Global}; ++ use core::sync::atomic::{AtomicI8, Ordering}; ++ use std::thread; ++ ++ struct MyAllocInner { ++ drop_count: Arc, ++ } ++ ++ #[derive(Clone)] ++ struct MyAlloc { ++ _inner: Arc, ++ } ++ ++ impl Drop for MyAllocInner { ++ fn drop(&mut self) { ++ println!("MyAlloc freed."); ++ self.drop_count.fetch_sub(1, Ordering::SeqCst); ++ } ++ } ++ ++ #[cfg(feature="allocator-api2")] ++ unsafe impl Allocator for MyAlloc { ++ fn allocate(&self, layout: Layout) -> std::result::Result, AllocError> { ++ let g = Global; ++ g.allocate(layout) ++ } ++ ++ unsafe fn deallocate(&self, ptr: NonNull, layout: Layout) { ++ let g = Global; ++ g.deallocate(ptr, layout) ++ } ++ } ++ ++ const DISARMED: bool = false; ++ const ARMED: bool = true; ++ ++ struct CheckedCloneDrop { ++ panic_in_clone: bool, ++ dropped: bool, ++ need_drop: Vec, ++ } ++ ++ impl Clone for CheckedCloneDrop { ++ fn clone(&self) -> Self { ++ if self.panic_in_clone { ++ panic!("panic in clone") ++ } ++ Self { ++ panic_in_clone: self.panic_in_clone, ++ dropped: self.dropped, ++ need_drop: self.need_drop.clone(), ++ } ++ } ++ } ++ ++ impl Drop for CheckedCloneDrop { ++ fn drop(&mut self) { ++ if self.dropped { ++ panic!("double drop"); ++ } ++ self.dropped = true; ++ } ++ } ++ ++ let dropped: Arc = Arc::new(AtomicI8::new(2)); ++ ++ let mut table = RawTable::new_in(MyAlloc { ++ _inner: Arc::new(MyAllocInner { ++ drop_count: dropped.clone(), ++ }), ++ }); ++ ++ for (idx, panic_in_clone) in core::iter::repeat(DISARMED).take(7).enumerate() { ++ let idx = idx as u64; ++ table.insert( ++ idx, ++ ( ++ idx, ++ CheckedCloneDrop { ++ panic_in_clone, ++ dropped: false, ++ need_drop: vec![idx], ++ }, ++ ), ++ |(k, _)| *k, ++ ); ++ } ++ ++ assert_eq!(table.len(), 7); ++ ++ thread::scope(|s| { ++ let result = s.spawn(|| { ++ let armed_flags = [ ++ DISARMED, DISARMED, ARMED, DISARMED, DISARMED, DISARMED, DISARMED, ++ ]; ++ let mut scope_table = RawTable::new_in(MyAlloc { ++ _inner: Arc::new(MyAllocInner { ++ drop_count: dropped.clone(), ++ }), ++ }); ++ for (idx, &panic_in_clone) in armed_flags.iter().enumerate() { ++ let idx = idx as u64; ++ scope_table.insert( ++ idx, ++ ( ++ idx, ++ CheckedCloneDrop { ++ panic_in_clone, ++ dropped: false, ++ need_drop: vec![idx + 100], ++ }, ++ ), ++ |(k, _)| *k, ++ ); ++ } ++ table.clone_from(&scope_table); ++ }); ++ assert!(result.join().is_err()); ++ }); ++ ++ // Let's check that all iterators work fine and do not return elements ++ // (especially `RawIterRange`, which does not depend on the number of ++ // elements in the table, but looks directly at the control bytes) ++ // ++ // SAFETY: We know for sure that `RawTable` will outlive ++ // the returned `RawIter / RawIterRange` iterator. ++ assert_eq!(table.len(), 0); ++ assert_eq!(unsafe { table.iter().count() }, 0); ++ assert_eq!(unsafe { table.iter().iter.count() }, 0); ++ ++ for idx in 0..table.buckets() { ++ let idx = idx as u64; ++ assert!( ++ table.find(idx, |(k, _)| *k == idx).is_none(), ++ "Index: {idx}" ++ ); ++ } ++ ++ // All allocator clones should already be dropped. ++ assert_eq!(dropped.load(Ordering::SeqCst), 1); ++ } ++} +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/src/raw/neon.rs mesa-25.3.3/subprojects/hashbrown-0.14.5/src/raw/neon.rs +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/src/raw/neon.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/src/raw/neon.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,124 @@ ++use super::bitmask::BitMask; ++use super::EMPTY; ++use core::arch::aarch64 as neon; ++use core::mem; ++use core::num::NonZeroU64; ++ ++pub(crate) type BitMaskWord = u64; ++pub(crate) type NonZeroBitMaskWord = NonZeroU64; ++pub(crate) const BITMASK_STRIDE: usize = 8; ++pub(crate) const BITMASK_MASK: BitMaskWord = !0; ++pub(crate) const BITMASK_ITER_MASK: BitMaskWord = 0x8080_8080_8080_8080; ++ ++/// Abstraction over a group of control bytes which can be scanned in ++/// parallel. ++/// ++/// This implementation uses a 64-bit NEON value. ++#[derive(Copy, Clone)] ++pub(crate) struct Group(neon::uint8x8_t); ++ ++#[allow(clippy::use_self)] ++impl Group { ++ /// Number of bytes in the group. ++ pub(crate) const WIDTH: usize = mem::size_of::(); ++ ++ /// Returns a full group of empty bytes, suitable for use as the initial ++ /// value for an empty hash table. ++ /// ++ /// This is guaranteed to be aligned to the group size. ++ #[inline] ++ pub(crate) const fn static_empty() -> &'static [u8; Group::WIDTH] { ++ #[repr(C)] ++ struct AlignedBytes { ++ _align: [Group; 0], ++ bytes: [u8; Group::WIDTH], ++ } ++ const ALIGNED_BYTES: AlignedBytes = AlignedBytes { ++ _align: [], ++ bytes: [EMPTY; Group::WIDTH], ++ }; ++ &ALIGNED_BYTES.bytes ++ } ++ ++ /// Loads a group of bytes starting at the given address. ++ #[inline] ++ #[allow(clippy::cast_ptr_alignment)] // unaligned load ++ pub(crate) unsafe fn load(ptr: *const u8) -> Self { ++ Group(neon::vld1_u8(ptr)) ++ } ++ ++ /// Loads a group of bytes starting at the given address, which must be ++ /// aligned to `mem::align_of::()`. ++ #[inline] ++ #[allow(clippy::cast_ptr_alignment)] ++ pub(crate) unsafe fn load_aligned(ptr: *const u8) -> Self { ++ // FIXME: use align_offset once it stabilizes ++ debug_assert_eq!(ptr as usize & (mem::align_of::() - 1), 0); ++ Group(neon::vld1_u8(ptr)) ++ } ++ ++ /// Stores the group of bytes to the given address, which must be ++ /// aligned to `mem::align_of::()`. ++ #[inline] ++ #[allow(clippy::cast_ptr_alignment)] ++ pub(crate) unsafe fn store_aligned(self, ptr: *mut u8) { ++ // FIXME: use align_offset once it stabilizes ++ debug_assert_eq!(ptr as usize & (mem::align_of::() - 1), 0); ++ neon::vst1_u8(ptr, self.0); ++ } ++ ++ /// Returns a `BitMask` indicating all bytes in the group which *may* ++ /// have the given value. ++ #[inline] ++ pub(crate) fn match_byte(self, byte: u8) -> BitMask { ++ unsafe { ++ let cmp = neon::vceq_u8(self.0, neon::vdup_n_u8(byte)); ++ BitMask(neon::vget_lane_u64(neon::vreinterpret_u64_u8(cmp), 0)) ++ } ++ } ++ ++ /// Returns a `BitMask` indicating all bytes in the group which are ++ /// `EMPTY`. ++ #[inline] ++ pub(crate) fn match_empty(self) -> BitMask { ++ self.match_byte(EMPTY) ++ } ++ ++ /// Returns a `BitMask` indicating all bytes in the group which are ++ /// `EMPTY` or `DELETED`. ++ #[inline] ++ pub(crate) fn match_empty_or_deleted(self) -> BitMask { ++ unsafe { ++ let cmp = neon::vcltz_s8(neon::vreinterpret_s8_u8(self.0)); ++ BitMask(neon::vget_lane_u64(neon::vreinterpret_u64_u8(cmp), 0)) ++ } ++ } ++ ++ /// Returns a `BitMask` indicating all bytes in the group which are full. ++ #[inline] ++ pub(crate) fn match_full(self) -> BitMask { ++ unsafe { ++ let cmp = neon::vcgez_s8(neon::vreinterpret_s8_u8(self.0)); ++ BitMask(neon::vget_lane_u64(neon::vreinterpret_u64_u8(cmp), 0)) ++ } ++ } ++ ++ /// Performs the following transformation on all bytes in the group: ++ /// - `EMPTY => EMPTY` ++ /// - `DELETED => EMPTY` ++ /// - `FULL => DELETED` ++ #[inline] ++ pub(crate) fn convert_special_to_empty_and_full_to_deleted(self) -> Self { ++ // Map high_bit = 1 (EMPTY or DELETED) to 1111_1111 ++ // and high_bit = 0 (FULL) to 1000_0000 ++ // ++ // Here's this logic expanded to concrete values: ++ // let special = 0 > byte = 1111_1111 (true) or 0000_0000 (false) ++ // 1111_1111 | 1000_0000 = 1111_1111 ++ // 0000_0000 | 1000_0000 = 1000_0000 ++ unsafe { ++ let special = neon::vcltz_s8(neon::vreinterpret_s8_u8(self.0)); ++ Group(neon::vorr_u8(special, neon::vdup_n_u8(0x80))) ++ } ++ } ++} +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/src/raw/sse2.rs mesa-25.3.3/subprojects/hashbrown-0.14.5/src/raw/sse2.rs +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/src/raw/sse2.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/src/raw/sse2.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,149 @@ ++use super::bitmask::BitMask; ++use super::EMPTY; ++use core::mem; ++use core::num::NonZeroU16; ++ ++#[cfg(target_arch = "x86")] ++use core::arch::x86; ++#[cfg(target_arch = "x86_64")] ++use core::arch::x86_64 as x86; ++ ++pub(crate) type BitMaskWord = u16; ++pub(crate) type NonZeroBitMaskWord = NonZeroU16; ++pub(crate) const BITMASK_STRIDE: usize = 1; ++pub(crate) const BITMASK_MASK: BitMaskWord = 0xffff; ++pub(crate) const BITMASK_ITER_MASK: BitMaskWord = !0; ++ ++/// Abstraction over a group of control bytes which can be scanned in ++/// parallel. ++/// ++/// This implementation uses a 128-bit SSE value. ++#[derive(Copy, Clone)] ++pub(crate) struct Group(x86::__m128i); ++ ++// FIXME: https://github.com/rust-lang/rust-clippy/issues/3859 ++#[allow(clippy::use_self)] ++impl Group { ++ /// Number of bytes in the group. ++ pub(crate) const WIDTH: usize = mem::size_of::(); ++ ++ /// Returns a full group of empty bytes, suitable for use as the initial ++ /// value for an empty hash table. ++ /// ++ /// This is guaranteed to be aligned to the group size. ++ #[inline] ++ #[allow(clippy::items_after_statements)] ++ pub(crate) const fn static_empty() -> &'static [u8; Group::WIDTH] { ++ #[repr(C)] ++ struct AlignedBytes { ++ _align: [Group; 0], ++ bytes: [u8; Group::WIDTH], ++ } ++ const ALIGNED_BYTES: AlignedBytes = AlignedBytes { ++ _align: [], ++ bytes: [EMPTY; Group::WIDTH], ++ }; ++ &ALIGNED_BYTES.bytes ++ } ++ ++ /// Loads a group of bytes starting at the given address. ++ #[inline] ++ #[allow(clippy::cast_ptr_alignment)] // unaligned load ++ pub(crate) unsafe fn load(ptr: *const u8) -> Self { ++ Group(x86::_mm_loadu_si128(ptr.cast())) ++ } ++ ++ /// Loads a group of bytes starting at the given address, which must be ++ /// aligned to `mem::align_of::()`. ++ #[inline] ++ #[allow(clippy::cast_ptr_alignment)] ++ pub(crate) unsafe fn load_aligned(ptr: *const u8) -> Self { ++ // FIXME: use align_offset once it stabilizes ++ debug_assert_eq!(ptr as usize & (mem::align_of::() - 1), 0); ++ Group(x86::_mm_load_si128(ptr.cast())) ++ } ++ ++ /// Stores the group of bytes to the given address, which must be ++ /// aligned to `mem::align_of::()`. ++ #[inline] ++ #[allow(clippy::cast_ptr_alignment)] ++ pub(crate) unsafe fn store_aligned(self, ptr: *mut u8) { ++ // FIXME: use align_offset once it stabilizes ++ debug_assert_eq!(ptr as usize & (mem::align_of::() - 1), 0); ++ x86::_mm_store_si128(ptr.cast(), self.0); ++ } ++ ++ /// Returns a `BitMask` indicating all bytes in the group which have ++ /// the given value. ++ #[inline] ++ pub(crate) fn match_byte(self, byte: u8) -> BitMask { ++ #[allow( ++ clippy::cast_possible_wrap, // byte: u8 as i8 ++ // byte: i32 as u16 ++ // note: _mm_movemask_epi8 returns a 16-bit mask in a i32, the ++ // upper 16-bits of the i32 are zeroed: ++ clippy::cast_sign_loss, ++ clippy::cast_possible_truncation ++ )] ++ unsafe { ++ let cmp = x86::_mm_cmpeq_epi8(self.0, x86::_mm_set1_epi8(byte as i8)); ++ BitMask(x86::_mm_movemask_epi8(cmp) as u16) ++ } ++ } ++ ++ /// Returns a `BitMask` indicating all bytes in the group which are ++ /// `EMPTY`. ++ #[inline] ++ pub(crate) fn match_empty(self) -> BitMask { ++ self.match_byte(EMPTY) ++ } ++ ++ /// Returns a `BitMask` indicating all bytes in the group which are ++ /// `EMPTY` or `DELETED`. ++ #[inline] ++ pub(crate) fn match_empty_or_deleted(self) -> BitMask { ++ #[allow( ++ // byte: i32 as u16 ++ // note: _mm_movemask_epi8 returns a 16-bit mask in a i32, the ++ // upper 16-bits of the i32 are zeroed: ++ clippy::cast_sign_loss, ++ clippy::cast_possible_truncation ++ )] ++ unsafe { ++ // A byte is EMPTY or DELETED iff the high bit is set ++ BitMask(x86::_mm_movemask_epi8(self.0) as u16) ++ } ++ } ++ ++ /// Returns a `BitMask` indicating all bytes in the group which are full. ++ #[inline] ++ pub(crate) fn match_full(&self) -> BitMask { ++ self.match_empty_or_deleted().invert() ++ } ++ ++ /// Performs the following transformation on all bytes in the group: ++ /// - `EMPTY => EMPTY` ++ /// - `DELETED => EMPTY` ++ /// - `FULL => DELETED` ++ #[inline] ++ pub(crate) fn convert_special_to_empty_and_full_to_deleted(self) -> Self { ++ // Map high_bit = 1 (EMPTY or DELETED) to 1111_1111 ++ // and high_bit = 0 (FULL) to 1000_0000 ++ // ++ // Here's this logic expanded to concrete values: ++ // let special = 0 > byte = 1111_1111 (true) or 0000_0000 (false) ++ // 1111_1111 | 1000_0000 = 1111_1111 ++ // 0000_0000 | 1000_0000 = 1000_0000 ++ #[allow( ++ clippy::cast_possible_wrap, // byte: 0x80_u8 as i8 ++ )] ++ unsafe { ++ let zero = x86::_mm_setzero_si128(); ++ let special = x86::_mm_cmpgt_epi8(zero, self.0); ++ Group(x86::_mm_or_si128( ++ special, ++ x86::_mm_set1_epi8(0x80_u8 as i8), ++ )) ++ } ++ } ++} +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/src/rustc_entry.rs mesa-25.3.3/subprojects/hashbrown-0.14.5/src/rustc_entry.rs +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/src/rustc_entry.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/src/rustc_entry.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,630 @@ ++use self::RustcEntry::*; ++use crate::map::{make_hash, Drain, HashMap, IntoIter, Iter, IterMut}; ++use crate::raw::{Allocator, Bucket, Global, RawTable}; ++use core::fmt::{self, Debug}; ++use core::hash::{BuildHasher, Hash}; ++use core::mem; ++ ++impl HashMap ++where ++ K: Eq + Hash, ++ S: BuildHasher, ++ A: Allocator, ++{ ++ /// Gets the given key's corresponding entry in the map for in-place manipulation. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut letters = HashMap::new(); ++ /// ++ /// for ch in "a short treatise on fungi".chars() { ++ /// let counter = letters.rustc_entry(ch).or_insert(0); ++ /// *counter += 1; ++ /// } ++ /// ++ /// assert_eq!(letters[&'s'], 2); ++ /// assert_eq!(letters[&'t'], 3); ++ /// assert_eq!(letters[&'u'], 1); ++ /// assert_eq!(letters.get(&'y'), None); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn rustc_entry(&mut self, key: K) -> RustcEntry<'_, K, V, A> { ++ let hash = make_hash(&self.hash_builder, &key); ++ if let Some(elem) = self.table.find(hash, |q| q.0.eq(&key)) { ++ RustcEntry::Occupied(RustcOccupiedEntry { ++ key: Some(key), ++ elem, ++ table: &mut self.table, ++ }) ++ } else { ++ // Ideally we would put this in VacantEntry::insert, but Entry is not ++ // generic over the BuildHasher and adding a generic parameter would be ++ // a breaking change. ++ self.reserve(1); ++ ++ RustcEntry::Vacant(RustcVacantEntry { ++ hash, ++ key, ++ table: &mut self.table, ++ }) ++ } ++ } ++} ++ ++/// A view into a single entry in a map, which may either be vacant or occupied. ++/// ++/// This `enum` is constructed from the [`rustc_entry`] method on [`HashMap`]. ++/// ++/// [`HashMap`]: struct.HashMap.html ++/// [`rustc_entry`]: struct.HashMap.html#method.rustc_entry ++pub enum RustcEntry<'a, K, V, A = Global> ++where ++ A: Allocator, ++{ ++ /// An occupied entry. ++ Occupied(RustcOccupiedEntry<'a, K, V, A>), ++ ++ /// A vacant entry. ++ Vacant(RustcVacantEntry<'a, K, V, A>), ++} ++ ++impl Debug for RustcEntry<'_, K, V, A> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ match *self { ++ Vacant(ref v) => f.debug_tuple("Entry").field(v).finish(), ++ Occupied(ref o) => f.debug_tuple("Entry").field(o).finish(), ++ } ++ } ++} ++ ++/// A view into an occupied entry in a `HashMap`. ++/// It is part of the [`RustcEntry`] enum. ++/// ++/// [`RustcEntry`]: enum.RustcEntry.html ++pub struct RustcOccupiedEntry<'a, K, V, A = Global> ++where ++ A: Allocator, ++{ ++ key: Option, ++ elem: Bucket<(K, V)>, ++ table: &'a mut RawTable<(K, V), A>, ++} ++ ++unsafe impl Send for RustcOccupiedEntry<'_, K, V, A> ++where ++ K: Send, ++ V: Send, ++ A: Allocator + Send, ++{ ++} ++unsafe impl Sync for RustcOccupiedEntry<'_, K, V, A> ++where ++ K: Sync, ++ V: Sync, ++ A: Allocator + Sync, ++{ ++} ++ ++impl Debug for RustcOccupiedEntry<'_, K, V, A> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_struct("OccupiedEntry") ++ .field("key", self.key()) ++ .field("value", self.get()) ++ .finish() ++ } ++} ++ ++/// A view into a vacant entry in a `HashMap`. ++/// It is part of the [`RustcEntry`] enum. ++/// ++/// [`RustcEntry`]: enum.RustcEntry.html ++pub struct RustcVacantEntry<'a, K, V, A = Global> ++where ++ A: Allocator, ++{ ++ hash: u64, ++ key: K, ++ table: &'a mut RawTable<(K, V), A>, ++} ++ ++impl Debug for RustcVacantEntry<'_, K, V, A> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_tuple("VacantEntry").field(self.key()).finish() ++ } ++} ++ ++impl<'a, K, V, A: Allocator> RustcEntry<'a, K, V, A> { ++ /// Sets the value of the entry, and returns a RustcOccupiedEntry. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map: HashMap<&str, u32> = HashMap::new(); ++ /// let entry = map.rustc_entry("horseyland").insert(37); ++ /// ++ /// assert_eq!(entry.key(), &"horseyland"); ++ /// ``` ++ pub fn insert(self, value: V) -> RustcOccupiedEntry<'a, K, V, A> { ++ match self { ++ Vacant(entry) => entry.insert_entry(value), ++ Occupied(mut entry) => { ++ entry.insert(value); ++ entry ++ } ++ } ++ } ++ ++ /// Ensures a value is in the entry by inserting the default if empty, and returns ++ /// a mutable reference to the value in the entry. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map: HashMap<&str, u32> = HashMap::new(); ++ /// ++ /// map.rustc_entry("poneyland").or_insert(3); ++ /// assert_eq!(map["poneyland"], 3); ++ /// ++ /// *map.rustc_entry("poneyland").or_insert(10) *= 2; ++ /// assert_eq!(map["poneyland"], 6); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn or_insert(self, default: V) -> &'a mut V ++ where ++ K: Hash, ++ { ++ match self { ++ Occupied(entry) => entry.into_mut(), ++ Vacant(entry) => entry.insert(default), ++ } ++ } ++ ++ /// Ensures a value is in the entry by inserting the result of the default function if empty, ++ /// and returns a mutable reference to the value in the entry. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map: HashMap<&str, String> = HashMap::new(); ++ /// let s = "hoho".to_string(); ++ /// ++ /// map.rustc_entry("poneyland").or_insert_with(|| s); ++ /// ++ /// assert_eq!(map["poneyland"], "hoho".to_string()); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn or_insert_with V>(self, default: F) -> &'a mut V ++ where ++ K: Hash, ++ { ++ match self { ++ Occupied(entry) => entry.into_mut(), ++ Vacant(entry) => entry.insert(default()), ++ } ++ } ++ ++ /// Returns a reference to this entry's key. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map: HashMap<&str, u32> = HashMap::new(); ++ /// assert_eq!(map.rustc_entry("poneyland").key(), &"poneyland"); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn key(&self) -> &K { ++ match *self { ++ Occupied(ref entry) => entry.key(), ++ Vacant(ref entry) => entry.key(), ++ } ++ } ++ ++ /// Provides in-place mutable access to an occupied entry before any ++ /// potential inserts into the map. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map: HashMap<&str, u32> = HashMap::new(); ++ /// ++ /// map.rustc_entry("poneyland") ++ /// .and_modify(|e| { *e += 1 }) ++ /// .or_insert(42); ++ /// assert_eq!(map["poneyland"], 42); ++ /// ++ /// map.rustc_entry("poneyland") ++ /// .and_modify(|e| { *e += 1 }) ++ /// .or_insert(42); ++ /// assert_eq!(map["poneyland"], 43); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn and_modify(self, f: F) -> Self ++ where ++ F: FnOnce(&mut V), ++ { ++ match self { ++ Occupied(mut entry) => { ++ f(entry.get_mut()); ++ Occupied(entry) ++ } ++ Vacant(entry) => Vacant(entry), ++ } ++ } ++} ++ ++impl<'a, K, V: Default, A: Allocator> RustcEntry<'a, K, V, A> { ++ /// Ensures a value is in the entry by inserting the default value if empty, ++ /// and returns a mutable reference to the value in the entry. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// # fn main() { ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map: HashMap<&str, Option> = HashMap::new(); ++ /// map.rustc_entry("poneyland").or_default(); ++ /// ++ /// assert_eq!(map["poneyland"], None); ++ /// # } ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn or_default(self) -> &'a mut V ++ where ++ K: Hash, ++ { ++ match self { ++ Occupied(entry) => entry.into_mut(), ++ Vacant(entry) => entry.insert(Default::default()), ++ } ++ } ++} ++ ++impl<'a, K, V, A: Allocator> RustcOccupiedEntry<'a, K, V, A> { ++ /// Gets a reference to the key in the entry. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map: HashMap<&str, u32> = HashMap::new(); ++ /// map.rustc_entry("poneyland").or_insert(12); ++ /// assert_eq!(map.rustc_entry("poneyland").key(), &"poneyland"); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn key(&self) -> &K { ++ unsafe { &self.elem.as_ref().0 } ++ } ++ ++ /// Take the ownership of the key and value from the map. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// use hashbrown::hash_map::RustcEntry; ++ /// ++ /// let mut map: HashMap<&str, u32> = HashMap::new(); ++ /// map.rustc_entry("poneyland").or_insert(12); ++ /// ++ /// if let RustcEntry::Occupied(o) = map.rustc_entry("poneyland") { ++ /// // We delete the entry from the map. ++ /// o.remove_entry(); ++ /// } ++ /// ++ /// assert_eq!(map.contains_key("poneyland"), false); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn remove_entry(self) -> (K, V) { ++ unsafe { self.table.remove(self.elem).0 } ++ } ++ ++ /// Gets a reference to the value in the entry. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// use hashbrown::hash_map::RustcEntry; ++ /// ++ /// let mut map: HashMap<&str, u32> = HashMap::new(); ++ /// map.rustc_entry("poneyland").or_insert(12); ++ /// ++ /// if let RustcEntry::Occupied(o) = map.rustc_entry("poneyland") { ++ /// assert_eq!(o.get(), &12); ++ /// } ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn get(&self) -> &V { ++ unsafe { &self.elem.as_ref().1 } ++ } ++ ++ /// Gets a mutable reference to the value in the entry. ++ /// ++ /// If you need a reference to the `RustcOccupiedEntry` which may outlive the ++ /// destruction of the `RustcEntry` value, see [`into_mut`]. ++ /// ++ /// [`into_mut`]: #method.into_mut ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// use hashbrown::hash_map::RustcEntry; ++ /// ++ /// let mut map: HashMap<&str, u32> = HashMap::new(); ++ /// map.rustc_entry("poneyland").or_insert(12); ++ /// ++ /// assert_eq!(map["poneyland"], 12); ++ /// if let RustcEntry::Occupied(mut o) = map.rustc_entry("poneyland") { ++ /// *o.get_mut() += 10; ++ /// assert_eq!(*o.get(), 22); ++ /// ++ /// // We can use the same RustcEntry multiple times. ++ /// *o.get_mut() += 2; ++ /// } ++ /// ++ /// assert_eq!(map["poneyland"], 24); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn get_mut(&mut self) -> &mut V { ++ unsafe { &mut self.elem.as_mut().1 } ++ } ++ ++ /// Converts the RustcOccupiedEntry into a mutable reference to the value in the entry ++ /// with a lifetime bound to the map itself. ++ /// ++ /// If you need multiple references to the `RustcOccupiedEntry`, see [`get_mut`]. ++ /// ++ /// [`get_mut`]: #method.get_mut ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// use hashbrown::hash_map::RustcEntry; ++ /// ++ /// let mut map: HashMap<&str, u32> = HashMap::new(); ++ /// map.rustc_entry("poneyland").or_insert(12); ++ /// ++ /// assert_eq!(map["poneyland"], 12); ++ /// if let RustcEntry::Occupied(o) = map.rustc_entry("poneyland") { ++ /// *o.into_mut() += 10; ++ /// } ++ /// ++ /// assert_eq!(map["poneyland"], 22); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn into_mut(self) -> &'a mut V { ++ unsafe { &mut self.elem.as_mut().1 } ++ } ++ ++ /// Sets the value of the entry, and returns the entry's old value. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// use hashbrown::hash_map::RustcEntry; ++ /// ++ /// let mut map: HashMap<&str, u32> = HashMap::new(); ++ /// map.rustc_entry("poneyland").or_insert(12); ++ /// ++ /// if let RustcEntry::Occupied(mut o) = map.rustc_entry("poneyland") { ++ /// assert_eq!(o.insert(15), 12); ++ /// } ++ /// ++ /// assert_eq!(map["poneyland"], 15); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn insert(&mut self, value: V) -> V { ++ mem::replace(self.get_mut(), value) ++ } ++ ++ /// Takes the value out of the entry, and returns it. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// use hashbrown::hash_map::RustcEntry; ++ /// ++ /// let mut map: HashMap<&str, u32> = HashMap::new(); ++ /// map.rustc_entry("poneyland").or_insert(12); ++ /// ++ /// if let RustcEntry::Occupied(o) = map.rustc_entry("poneyland") { ++ /// assert_eq!(o.remove(), 12); ++ /// } ++ /// ++ /// assert_eq!(map.contains_key("poneyland"), false); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn remove(self) -> V { ++ self.remove_entry().1 ++ } ++ ++ /// Replaces the entry, returning the old key and value. The new key in the hash map will be ++ /// the key used to create this entry. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::hash_map::{RustcEntry, HashMap}; ++ /// use std::rc::Rc; ++ /// ++ /// let mut map: HashMap, u32> = HashMap::new(); ++ /// map.insert(Rc::new("Stringthing".to_string()), 15); ++ /// ++ /// let my_key = Rc::new("Stringthing".to_string()); ++ /// ++ /// if let RustcEntry::Occupied(entry) = map.rustc_entry(my_key) { ++ /// // Also replace the key with a handle to our other key. ++ /// let (old_key, old_value): (Rc, u32) = entry.replace_entry(16); ++ /// } ++ /// ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn replace_entry(self, value: V) -> (K, V) { ++ let entry = unsafe { self.elem.as_mut() }; ++ ++ let old_key = mem::replace(&mut entry.0, self.key.unwrap()); ++ let old_value = mem::replace(&mut entry.1, value); ++ ++ (old_key, old_value) ++ } ++ ++ /// Replaces the key in the hash map with the key used to create this entry. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::hash_map::{RustcEntry, HashMap}; ++ /// use std::rc::Rc; ++ /// ++ /// let mut map: HashMap, u32> = HashMap::new(); ++ /// let mut known_strings: Vec> = Vec::new(); ++ /// ++ /// // Initialise known strings, run program, etc. ++ /// ++ /// reclaim_memory(&mut map, &known_strings); ++ /// ++ /// fn reclaim_memory(map: &mut HashMap, u32>, known_strings: &[Rc] ) { ++ /// for s in known_strings { ++ /// if let RustcEntry::Occupied(entry) = map.rustc_entry(s.clone()) { ++ /// // Replaces the entry's key with our version of it in `known_strings`. ++ /// entry.replace_key(); ++ /// } ++ /// } ++ /// } ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn replace_key(self) -> K { ++ let entry = unsafe { self.elem.as_mut() }; ++ mem::replace(&mut entry.0, self.key.unwrap()) ++ } ++} ++ ++impl<'a, K, V, A: Allocator> RustcVacantEntry<'a, K, V, A> { ++ /// Gets a reference to the key that would be used when inserting a value ++ /// through the `RustcVacantEntry`. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// ++ /// let mut map: HashMap<&str, u32> = HashMap::new(); ++ /// assert_eq!(map.rustc_entry("poneyland").key(), &"poneyland"); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn key(&self) -> &K { ++ &self.key ++ } ++ ++ /// Take ownership of the key. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// use hashbrown::hash_map::RustcEntry; ++ /// ++ /// let mut map: HashMap<&str, u32> = HashMap::new(); ++ /// ++ /// if let RustcEntry::Vacant(v) = map.rustc_entry("poneyland") { ++ /// v.into_key(); ++ /// } ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn into_key(self) -> K { ++ self.key ++ } ++ ++ /// Sets the value of the entry with the RustcVacantEntry's key, ++ /// and returns a mutable reference to it. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// use hashbrown::hash_map::RustcEntry; ++ /// ++ /// let mut map: HashMap<&str, u32> = HashMap::new(); ++ /// ++ /// if let RustcEntry::Vacant(o) = map.rustc_entry("poneyland") { ++ /// o.insert(37); ++ /// } ++ /// assert_eq!(map["poneyland"], 37); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn insert(self, value: V) -> &'a mut V { ++ unsafe { ++ let bucket = self.table.insert_no_grow(self.hash, (self.key, value)); ++ &mut bucket.as_mut().1 ++ } ++ } ++ ++ /// Sets the value of the entry with the RustcVacantEntry's key, ++ /// and returns a RustcOccupiedEntry. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashMap; ++ /// use hashbrown::hash_map::RustcEntry; ++ /// ++ /// let mut map: HashMap<&str, u32> = HashMap::new(); ++ /// ++ /// if let RustcEntry::Vacant(v) = map.rustc_entry("poneyland") { ++ /// let o = v.insert_entry(37); ++ /// assert_eq!(o.get(), &37); ++ /// } ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn insert_entry(self, value: V) -> RustcOccupiedEntry<'a, K, V, A> { ++ let bucket = unsafe { self.table.insert_no_grow(self.hash, (self.key, value)) }; ++ RustcOccupiedEntry { ++ key: None, ++ elem: bucket, ++ table: self.table, ++ } ++ } ++} ++ ++impl IterMut<'_, K, V> { ++ /// Returns a iterator of references over the remaining items. ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn rustc_iter(&self) -> Iter<'_, K, V> { ++ self.iter() ++ } ++} ++ ++impl IntoIter { ++ /// Returns a iterator of references over the remaining items. ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn rustc_iter(&self) -> Iter<'_, K, V> { ++ self.iter() ++ } ++} ++ ++impl Drain<'_, K, V> { ++ /// Returns a iterator of references over the remaining items. ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn rustc_iter(&self) -> Iter<'_, K, V> { ++ self.iter() ++ } ++} +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/src/scopeguard.rs mesa-25.3.3/subprojects/hashbrown-0.14.5/src/scopeguard.rs +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/src/scopeguard.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/src/scopeguard.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,72 @@ ++// Extracted from the scopeguard crate ++use core::{ ++ mem::ManuallyDrop, ++ ops::{Deref, DerefMut}, ++ ptr, ++}; ++ ++pub struct ScopeGuard ++where ++ F: FnMut(&mut T), ++{ ++ dropfn: F, ++ value: T, ++} ++ ++#[inline] ++pub fn guard(value: T, dropfn: F) -> ScopeGuard ++where ++ F: FnMut(&mut T), ++{ ++ ScopeGuard { dropfn, value } ++} ++ ++impl ScopeGuard ++where ++ F: FnMut(&mut T), ++{ ++ #[inline] ++ pub fn into_inner(guard: Self) -> T { ++ // Cannot move out of Drop-implementing types, so ++ // ptr::read the value out of a ManuallyDrop ++ // Don't use mem::forget as that might invalidate value ++ let guard = ManuallyDrop::new(guard); ++ unsafe { ++ let value = ptr::read(&guard.value); ++ // read the closure so that it is dropped ++ let _ = ptr::read(&guard.dropfn); ++ value ++ } ++ } ++} ++ ++impl Deref for ScopeGuard ++where ++ F: FnMut(&mut T), ++{ ++ type Target = T; ++ #[inline] ++ fn deref(&self) -> &T { ++ &self.value ++ } ++} ++ ++impl DerefMut for ScopeGuard ++where ++ F: FnMut(&mut T), ++{ ++ #[inline] ++ fn deref_mut(&mut self) -> &mut T { ++ &mut self.value ++ } ++} ++ ++impl Drop for ScopeGuard ++where ++ F: FnMut(&mut T), ++{ ++ #[inline] ++ fn drop(&mut self) { ++ (self.dropfn)(&mut self.value); ++ } ++} +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/src/set.rs mesa-25.3.3/subprojects/hashbrown-0.14.5/src/set.rs +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/src/set.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/src/set.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,2970 @@ ++#[cfg(feature = "raw")] ++use crate::raw::RawTable; ++use crate::{Equivalent, TryReserveError}; ++use alloc::borrow::ToOwned; ++use core::fmt; ++use core::hash::{BuildHasher, Hash}; ++use core::iter::{Chain, FusedIterator}; ++use core::ops::{BitAnd, BitOr, BitXor, Sub}; ++ ++use super::map::{self, DefaultHashBuilder, HashMap, Keys}; ++use crate::raw::{Allocator, Global, RawExtractIf}; ++ ++// Future Optimization (FIXME!) ++// ============================= ++// ++// Iteration over zero sized values is a noop. There is no need ++// for `bucket.val` in the case of HashSet. I suppose we would need HKT ++// to get rid of it properly. ++ ++/// A hash set implemented as a `HashMap` where the value is `()`. ++/// ++/// As with the [`HashMap`] type, a `HashSet` requires that the elements ++/// implement the [`Eq`] and [`Hash`] traits. This can frequently be achieved by ++/// using `#[derive(PartialEq, Eq, Hash)]`. If you implement these yourself, ++/// it is important that the following property holds: ++/// ++/// ```text ++/// k1 == k2 -> hash(k1) == hash(k2) ++/// ``` ++/// ++/// In other words, if two keys are equal, their hashes must be equal. ++/// ++/// ++/// It is a logic error for an item to be modified in such a way that the ++/// item's hash, as determined by the [`Hash`] trait, or its equality, as ++/// determined by the [`Eq`] trait, changes while it is in the set. This is ++/// normally only possible through [`Cell`], [`RefCell`], global state, I/O, or ++/// unsafe code. ++/// ++/// It is also a logic error for the [`Hash`] implementation of a key to panic. ++/// This is generally only possible if the trait is implemented manually. If a ++/// panic does occur then the contents of the `HashSet` may become corrupted and ++/// some items may be dropped from the table. ++/// ++/// # Examples ++/// ++/// ``` ++/// use hashbrown::HashSet; ++/// // Type inference lets us omit an explicit type signature (which ++/// // would be `HashSet` in this example). ++/// let mut books = HashSet::new(); ++/// ++/// // Add some books. ++/// books.insert("A Dance With Dragons".to_string()); ++/// books.insert("To Kill a Mockingbird".to_string()); ++/// books.insert("The Odyssey".to_string()); ++/// books.insert("The Great Gatsby".to_string()); ++/// ++/// // Check for a specific one. ++/// if !books.contains("The Winds of Winter") { ++/// println!("We have {} books, but The Winds of Winter ain't one.", ++/// books.len()); ++/// } ++/// ++/// // Remove a book. ++/// books.remove("The Odyssey"); ++/// ++/// // Iterate over everything. ++/// for book in &books { ++/// println!("{}", book); ++/// } ++/// ``` ++/// ++/// The easiest way to use `HashSet` with a custom type is to derive ++/// [`Eq`] and [`Hash`]. We must also derive [`PartialEq`]. This will in the ++/// future be implied by [`Eq`]. ++/// ++/// ``` ++/// use hashbrown::HashSet; ++/// #[derive(Hash, Eq, PartialEq, Debug)] ++/// struct Viking { ++/// name: String, ++/// power: usize, ++/// } ++/// ++/// let mut vikings = HashSet::new(); ++/// ++/// vikings.insert(Viking { name: "Einar".to_string(), power: 9 }); ++/// vikings.insert(Viking { name: "Einar".to_string(), power: 9 }); ++/// vikings.insert(Viking { name: "Olaf".to_string(), power: 4 }); ++/// vikings.insert(Viking { name: "Harald".to_string(), power: 8 }); ++/// ++/// // Use derived implementation to print the vikings. ++/// for x in &vikings { ++/// println!("{:?}", x); ++/// } ++/// ``` ++/// ++/// A `HashSet` with fixed list of elements can be initialized from an array: ++/// ++/// ``` ++/// use hashbrown::HashSet; ++/// ++/// let viking_names: HashSet<&'static str> = ++/// [ "Einar", "Olaf", "Harald" ].into_iter().collect(); ++/// // use the values stored in the set ++/// ``` ++/// ++/// [`Cell`]: https://doc.rust-lang.org/std/cell/struct.Cell.html ++/// [`Eq`]: https://doc.rust-lang.org/std/cmp/trait.Eq.html ++/// [`Hash`]: https://doc.rust-lang.org/std/hash/trait.Hash.html ++/// [`HashMap`]: struct.HashMap.html ++/// [`PartialEq`]: https://doc.rust-lang.org/std/cmp/trait.PartialEq.html ++/// [`RefCell`]: https://doc.rust-lang.org/std/cell/struct.RefCell.html ++pub struct HashSet { ++ pub(crate) map: HashMap, ++} ++ ++impl Clone for HashSet { ++ fn clone(&self) -> Self { ++ HashSet { ++ map: self.map.clone(), ++ } ++ } ++ ++ fn clone_from(&mut self, source: &Self) { ++ self.map.clone_from(&source.map); ++ } ++} ++ ++#[cfg(feature = "ahash")] ++impl HashSet { ++ /// Creates an empty `HashSet`. ++ /// ++ /// The hash set is initially created with a capacity of 0, so it will not allocate until it ++ /// is first inserted into. ++ /// ++ /// # HashDoS resistance ++ /// ++ /// The `hash_builder` normally use a fixed key by default and that does ++ /// not allow the `HashSet` to be protected against attacks such as [`HashDoS`]. ++ /// Users who require HashDoS resistance should explicitly use ++ /// [`ahash::RandomState`] or [`std::collections::hash_map::RandomState`] ++ /// as the hasher when creating a [`HashSet`], for example with ++ /// [`with_hasher`](HashSet::with_hasher) method. ++ /// ++ /// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack ++ /// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// let set: HashSet = HashSet::new(); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn new() -> Self { ++ Self { ++ map: HashMap::new(), ++ } ++ } ++ ++ /// Creates an empty `HashSet` with the specified capacity. ++ /// ++ /// The hash set will be able to hold at least `capacity` elements without ++ /// reallocating. If `capacity` is 0, the hash set will not allocate. ++ /// ++ /// # HashDoS resistance ++ /// ++ /// The `hash_builder` normally use a fixed key by default and that does ++ /// not allow the `HashSet` to be protected against attacks such as [`HashDoS`]. ++ /// Users who require HashDoS resistance should explicitly use ++ /// [`ahash::RandomState`] or [`std::collections::hash_map::RandomState`] ++ /// as the hasher when creating a [`HashSet`], for example with ++ /// [`with_capacity_and_hasher`](HashSet::with_capacity_and_hasher) method. ++ /// ++ /// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack ++ /// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// let set: HashSet = HashSet::with_capacity(10); ++ /// assert!(set.capacity() >= 10); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn with_capacity(capacity: usize) -> Self { ++ Self { ++ map: HashMap::with_capacity(capacity), ++ } ++ } ++} ++ ++#[cfg(feature = "ahash")] ++impl HashSet { ++ /// Creates an empty `HashSet`. ++ /// ++ /// The hash set is initially created with a capacity of 0, so it will not allocate until it ++ /// is first inserted into. ++ /// ++ /// # HashDoS resistance ++ /// ++ /// The `hash_builder` normally use a fixed key by default and that does ++ /// not allow the `HashSet` to be protected against attacks such as [`HashDoS`]. ++ /// Users who require HashDoS resistance should explicitly use ++ /// [`ahash::RandomState`] or [`std::collections::hash_map::RandomState`] ++ /// as the hasher when creating a [`HashSet`], for example with ++ /// [`with_hasher_in`](HashSet::with_hasher_in) method. ++ /// ++ /// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack ++ /// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// let set: HashSet = HashSet::new(); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn new_in(alloc: A) -> Self { ++ Self { ++ map: HashMap::new_in(alloc), ++ } ++ } ++ ++ /// Creates an empty `HashSet` with the specified capacity. ++ /// ++ /// The hash set will be able to hold at least `capacity` elements without ++ /// reallocating. If `capacity` is 0, the hash set will not allocate. ++ /// ++ /// # HashDoS resistance ++ /// ++ /// The `hash_builder` normally use a fixed key by default and that does ++ /// not allow the `HashSet` to be protected against attacks such as [`HashDoS`]. ++ /// Users who require HashDoS resistance should explicitly use ++ /// [`ahash::RandomState`] or [`std::collections::hash_map::RandomState`] ++ /// as the hasher when creating a [`HashSet`], for example with ++ /// [`with_capacity_and_hasher_in`](HashSet::with_capacity_and_hasher_in) method. ++ /// ++ /// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack ++ /// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// let set: HashSet = HashSet::with_capacity(10); ++ /// assert!(set.capacity() >= 10); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn with_capacity_in(capacity: usize, alloc: A) -> Self { ++ Self { ++ map: HashMap::with_capacity_in(capacity, alloc), ++ } ++ } ++} ++ ++impl HashSet { ++ /// Returns the number of elements the set can hold without reallocating. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// let set: HashSet = HashSet::with_capacity(100); ++ /// assert!(set.capacity() >= 100); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn capacity(&self) -> usize { ++ self.map.capacity() ++ } ++ ++ /// An iterator visiting all elements in arbitrary order. ++ /// The iterator element type is `&'a T`. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// let mut set = HashSet::new(); ++ /// set.insert("a"); ++ /// set.insert("b"); ++ /// ++ /// // Will print in an arbitrary order. ++ /// for x in set.iter() { ++ /// println!("{}", x); ++ /// } ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn iter(&self) -> Iter<'_, T> { ++ Iter { ++ iter: self.map.keys(), ++ } ++ } ++ ++ /// Returns the number of elements in the set. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// ++ /// let mut v = HashSet::new(); ++ /// assert_eq!(v.len(), 0); ++ /// v.insert(1); ++ /// assert_eq!(v.len(), 1); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn len(&self) -> usize { ++ self.map.len() ++ } ++ ++ /// Returns `true` if the set contains no elements. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// ++ /// let mut v = HashSet::new(); ++ /// assert!(v.is_empty()); ++ /// v.insert(1); ++ /// assert!(!v.is_empty()); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn is_empty(&self) -> bool { ++ self.map.is_empty() ++ } ++ ++ /// Clears the set, returning all elements in an iterator. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// ++ /// let mut set: HashSet<_> = [1, 2, 3].into_iter().collect(); ++ /// assert!(!set.is_empty()); ++ /// ++ /// // print 1, 2, 3 in an arbitrary order ++ /// for i in set.drain() { ++ /// println!("{}", i); ++ /// } ++ /// ++ /// assert!(set.is_empty()); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn drain(&mut self) -> Drain<'_, T, A> { ++ Drain { ++ iter: self.map.drain(), ++ } ++ } ++ ++ /// Retains only the elements specified by the predicate. ++ /// ++ /// In other words, remove all elements `e` such that `f(&e)` returns `false`. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// ++ /// let xs = [1,2,3,4,5,6]; ++ /// let mut set: HashSet = xs.into_iter().collect(); ++ /// set.retain(|&k| k % 2 == 0); ++ /// assert_eq!(set.len(), 3); ++ /// ``` ++ pub fn retain(&mut self, mut f: F) ++ where ++ F: FnMut(&T) -> bool, ++ { ++ self.map.retain(|k, _| f(k)); ++ } ++ ++ /// Drains elements which are true under the given predicate, ++ /// and returns an iterator over the removed items. ++ /// ++ /// In other words, move all elements `e` such that `f(&e)` returns `true` out ++ /// into another iterator. ++ /// ++ /// If the returned `ExtractIf` is not exhausted, e.g. because it is dropped without iterating ++ /// or the iteration short-circuits, then the remaining elements will be retained. ++ /// Use [`retain()`] with a negated predicate if you do not need the returned iterator. ++ /// ++ /// [`retain()`]: HashSet::retain ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// ++ /// let mut set: HashSet = (0..8).collect(); ++ /// let drained: HashSet = set.extract_if(|v| v % 2 == 0).collect(); ++ /// ++ /// let mut evens = drained.into_iter().collect::>(); ++ /// let mut odds = set.into_iter().collect::>(); ++ /// evens.sort(); ++ /// odds.sort(); ++ /// ++ /// assert_eq!(evens, vec![0, 2, 4, 6]); ++ /// assert_eq!(odds, vec![1, 3, 5, 7]); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn extract_if(&mut self, f: F) -> ExtractIf<'_, T, F, A> ++ where ++ F: FnMut(&T) -> bool, ++ { ++ ExtractIf { ++ f, ++ inner: RawExtractIf { ++ iter: unsafe { self.map.table.iter() }, ++ table: &mut self.map.table, ++ }, ++ } ++ } ++ ++ /// Clears the set, removing all values. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// ++ /// let mut v = HashSet::new(); ++ /// v.insert(1); ++ /// v.clear(); ++ /// assert!(v.is_empty()); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn clear(&mut self) { ++ self.map.clear(); ++ } ++} ++ ++impl HashSet { ++ /// Creates a new empty hash set which will use the given hasher to hash ++ /// keys. ++ /// ++ /// The hash set is initially created with a capacity of 0, so it will not ++ /// allocate until it is first inserted into. ++ /// ++ /// # HashDoS resistance ++ /// ++ /// The `hash_builder` normally use a fixed key by default and that does ++ /// not allow the `HashSet` to be protected against attacks such as [`HashDoS`]. ++ /// Users who require HashDoS resistance should explicitly use ++ /// [`ahash::RandomState`] or [`std::collections::hash_map::RandomState`] ++ /// as the hasher when creating a [`HashSet`]. ++ /// ++ /// The `hash_builder` passed should implement the [`BuildHasher`] trait for ++ /// the HashSet to be useful, see its documentation for details. ++ /// ++ /// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack ++ /// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html ++ /// [`BuildHasher`]: https://doc.rust-lang.org/std/hash/trait.BuildHasher.html ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// use hashbrown::hash_map::DefaultHashBuilder; ++ /// ++ /// let s = DefaultHashBuilder::default(); ++ /// let mut set = HashSet::with_hasher(s); ++ /// set.insert(2); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub const fn with_hasher(hasher: S) -> Self { ++ Self { ++ map: HashMap::with_hasher(hasher), ++ } ++ } ++ ++ /// Creates an empty `HashSet` with the specified capacity, using ++ /// `hasher` to hash the keys. ++ /// ++ /// The hash set will be able to hold at least `capacity` elements without ++ /// reallocating. If `capacity` is 0, the hash set will not allocate. ++ /// ++ /// # HashDoS resistance ++ /// ++ /// The `hash_builder` normally use a fixed key by default and that does ++ /// not allow the `HashSet` to be protected against attacks such as [`HashDoS`]. ++ /// Users who require HashDoS resistance should explicitly use ++ /// [`ahash::RandomState`] or [`std::collections::hash_map::RandomState`] ++ /// as the hasher when creating a [`HashSet`]. ++ /// ++ /// The `hash_builder` passed should implement the [`BuildHasher`] trait for ++ /// the HashSet to be useful, see its documentation for details. ++ /// ++ /// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack ++ /// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html ++ /// [`BuildHasher`]: https://doc.rust-lang.org/std/hash/trait.BuildHasher.html ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// use hashbrown::hash_map::DefaultHashBuilder; ++ /// ++ /// let s = DefaultHashBuilder::default(); ++ /// let mut set = HashSet::with_capacity_and_hasher(10, s); ++ /// set.insert(1); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn with_capacity_and_hasher(capacity: usize, hasher: S) -> Self { ++ Self { ++ map: HashMap::with_capacity_and_hasher(capacity, hasher), ++ } ++ } ++} ++ ++impl HashSet ++where ++ A: Allocator, ++{ ++ /// Returns a reference to the underlying allocator. ++ #[inline] ++ pub fn allocator(&self) -> &A { ++ self.map.allocator() ++ } ++ ++ /// Creates a new empty hash set which will use the given hasher to hash ++ /// keys. ++ /// ++ /// The hash set is initially created with a capacity of 0, so it will not ++ /// allocate until it is first inserted into. ++ /// ++ /// # HashDoS resistance ++ /// ++ /// The `hash_builder` normally use a fixed key by default and that does ++ /// not allow the `HashSet` to be protected against attacks such as [`HashDoS`]. ++ /// Users who require HashDoS resistance should explicitly use ++ /// [`ahash::RandomState`] or [`std::collections::hash_map::RandomState`] ++ /// as the hasher when creating a [`HashSet`]. ++ /// ++ /// The `hash_builder` passed should implement the [`BuildHasher`] trait for ++ /// the HashSet to be useful, see its documentation for details. ++ /// ++ /// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack ++ /// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html ++ /// [`BuildHasher`]: https://doc.rust-lang.org/std/hash/trait.BuildHasher.html ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// use hashbrown::hash_map::DefaultHashBuilder; ++ /// ++ /// let s = DefaultHashBuilder::default(); ++ /// let mut set = HashSet::with_hasher(s); ++ /// set.insert(2); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub const fn with_hasher_in(hasher: S, alloc: A) -> Self { ++ Self { ++ map: HashMap::with_hasher_in(hasher, alloc), ++ } ++ } ++ ++ /// Creates an empty `HashSet` with the specified capacity, using ++ /// `hasher` to hash the keys. ++ /// ++ /// The hash set will be able to hold at least `capacity` elements without ++ /// reallocating. If `capacity` is 0, the hash set will not allocate. ++ /// ++ /// # HashDoS resistance ++ /// ++ /// The `hash_builder` normally use a fixed key by default and that does ++ /// not allow the `HashSet` to be protected against attacks such as [`HashDoS`]. ++ /// Users who require HashDoS resistance should explicitly use ++ /// [`ahash::RandomState`] or [`std::collections::hash_map::RandomState`] ++ /// as the hasher when creating a [`HashSet`]. ++ /// ++ /// The `hash_builder` passed should implement the [`BuildHasher`] trait for ++ /// the HashSet to be useful, see its documentation for details. ++ /// ++ /// [`HashDoS`]: https://en.wikipedia.org/wiki/Collision_attack ++ /// [`std::collections::hash_map::RandomState`]: https://doc.rust-lang.org/std/collections/hash_map/struct.RandomState.html ++ /// [`BuildHasher`]: https://doc.rust-lang.org/std/hash/trait.BuildHasher.html ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// use hashbrown::hash_map::DefaultHashBuilder; ++ /// ++ /// let s = DefaultHashBuilder::default(); ++ /// let mut set = HashSet::with_capacity_and_hasher(10, s); ++ /// set.insert(1); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn with_capacity_and_hasher_in(capacity: usize, hasher: S, alloc: A) -> Self { ++ Self { ++ map: HashMap::with_capacity_and_hasher_in(capacity, hasher, alloc), ++ } ++ } ++ ++ /// Returns a reference to the set's [`BuildHasher`]. ++ /// ++ /// [`BuildHasher`]: https://doc.rust-lang.org/std/hash/trait.BuildHasher.html ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// use hashbrown::hash_map::DefaultHashBuilder; ++ /// ++ /// let hasher = DefaultHashBuilder::default(); ++ /// let set: HashSet = HashSet::with_hasher(hasher); ++ /// let hasher: &DefaultHashBuilder = set.hasher(); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn hasher(&self) -> &S { ++ self.map.hasher() ++ } ++} ++ ++impl HashSet ++where ++ T: Eq + Hash, ++ S: BuildHasher, ++ A: Allocator, ++{ ++ /// Reserves capacity for at least `additional` more elements to be inserted ++ /// in the `HashSet`. The collection may reserve more space to avoid ++ /// frequent reallocations. ++ /// ++ /// # Panics ++ /// ++ /// Panics if the new capacity exceeds [`isize::MAX`] bytes and [`abort`] the program ++ /// in case of allocation error. Use [`try_reserve`](HashSet::try_reserve) instead ++ /// if you want to handle memory allocation failure. ++ /// ++ /// [`isize::MAX`]: https://doc.rust-lang.org/std/primitive.isize.html ++ /// [`abort`]: https://doc.rust-lang.org/alloc/alloc/fn.handle_alloc_error.html ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// let mut set: HashSet = HashSet::new(); ++ /// set.reserve(10); ++ /// assert!(set.capacity() >= 10); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn reserve(&mut self, additional: usize) { ++ self.map.reserve(additional); ++ } ++ ++ /// Tries to reserve capacity for at least `additional` more elements to be inserted ++ /// in the given `HashSet`. The collection may reserve more space to avoid ++ /// frequent reallocations. ++ /// ++ /// # Errors ++ /// ++ /// If the capacity overflows, or the allocator reports a failure, then an error ++ /// is returned. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// let mut set: HashSet = HashSet::new(); ++ /// set.try_reserve(10).expect("why is the test harness OOMing on 10 bytes?"); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> { ++ self.map.try_reserve(additional) ++ } ++ ++ /// Shrinks the capacity of the set as much as possible. It will drop ++ /// down as much as possible while maintaining the internal rules ++ /// and possibly leaving some space in accordance with the resize policy. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// ++ /// let mut set = HashSet::with_capacity(100); ++ /// set.insert(1); ++ /// set.insert(2); ++ /// assert!(set.capacity() >= 100); ++ /// set.shrink_to_fit(); ++ /// assert!(set.capacity() >= 2); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn shrink_to_fit(&mut self) { ++ self.map.shrink_to_fit(); ++ } ++ ++ /// Shrinks the capacity of the set with a lower limit. It will drop ++ /// down no lower than the supplied limit while maintaining the internal rules ++ /// and possibly leaving some space in accordance with the resize policy. ++ /// ++ /// Panics if the current capacity is smaller than the supplied ++ /// minimum capacity. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// ++ /// let mut set = HashSet::with_capacity(100); ++ /// set.insert(1); ++ /// set.insert(2); ++ /// assert!(set.capacity() >= 100); ++ /// set.shrink_to(10); ++ /// assert!(set.capacity() >= 10); ++ /// set.shrink_to(0); ++ /// assert!(set.capacity() >= 2); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn shrink_to(&mut self, min_capacity: usize) { ++ self.map.shrink_to(min_capacity); ++ } ++ ++ /// Visits the values representing the difference, ++ /// i.e., the values that are in `self` but not in `other`. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// let a: HashSet<_> = [1, 2, 3].into_iter().collect(); ++ /// let b: HashSet<_> = [4, 2, 3, 4].into_iter().collect(); ++ /// ++ /// // Can be seen as `a - b`. ++ /// for x in a.difference(&b) { ++ /// println!("{}", x); // Print 1 ++ /// } ++ /// ++ /// let diff: HashSet<_> = a.difference(&b).collect(); ++ /// assert_eq!(diff, [1].iter().collect()); ++ /// ++ /// // Note that difference is not symmetric, ++ /// // and `b - a` means something else: ++ /// let diff: HashSet<_> = b.difference(&a).collect(); ++ /// assert_eq!(diff, [4].iter().collect()); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn difference<'a>(&'a self, other: &'a Self) -> Difference<'a, T, S, A> { ++ Difference { ++ iter: self.iter(), ++ other, ++ } ++ } ++ ++ /// Visits the values representing the symmetric difference, ++ /// i.e., the values that are in `self` or in `other` but not in both. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// let a: HashSet<_> = [1, 2, 3].into_iter().collect(); ++ /// let b: HashSet<_> = [4, 2, 3, 4].into_iter().collect(); ++ /// ++ /// // Print 1, 4 in arbitrary order. ++ /// for x in a.symmetric_difference(&b) { ++ /// println!("{}", x); ++ /// } ++ /// ++ /// let diff1: HashSet<_> = a.symmetric_difference(&b).collect(); ++ /// let diff2: HashSet<_> = b.symmetric_difference(&a).collect(); ++ /// ++ /// assert_eq!(diff1, diff2); ++ /// assert_eq!(diff1, [1, 4].iter().collect()); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn symmetric_difference<'a>(&'a self, other: &'a Self) -> SymmetricDifference<'a, T, S, A> { ++ SymmetricDifference { ++ iter: self.difference(other).chain(other.difference(self)), ++ } ++ } ++ ++ /// Visits the values representing the intersection, ++ /// i.e., the values that are both in `self` and `other`. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// let a: HashSet<_> = [1, 2, 3].into_iter().collect(); ++ /// let b: HashSet<_> = [4, 2, 3, 4].into_iter().collect(); ++ /// ++ /// // Print 2, 3 in arbitrary order. ++ /// for x in a.intersection(&b) { ++ /// println!("{}", x); ++ /// } ++ /// ++ /// let intersection: HashSet<_> = a.intersection(&b).collect(); ++ /// assert_eq!(intersection, [2, 3].iter().collect()); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn intersection<'a>(&'a self, other: &'a Self) -> Intersection<'a, T, S, A> { ++ let (smaller, larger) = if self.len() <= other.len() { ++ (self, other) ++ } else { ++ (other, self) ++ }; ++ Intersection { ++ iter: smaller.iter(), ++ other: larger, ++ } ++ } ++ ++ /// Visits the values representing the union, ++ /// i.e., all the values in `self` or `other`, without duplicates. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// let a: HashSet<_> = [1, 2, 3].into_iter().collect(); ++ /// let b: HashSet<_> = [4, 2, 3, 4].into_iter().collect(); ++ /// ++ /// // Print 1, 2, 3, 4 in arbitrary order. ++ /// for x in a.union(&b) { ++ /// println!("{}", x); ++ /// } ++ /// ++ /// let union: HashSet<_> = a.union(&b).collect(); ++ /// assert_eq!(union, [1, 2, 3, 4].iter().collect()); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn union<'a>(&'a self, other: &'a Self) -> Union<'a, T, S, A> { ++ // We'll iterate one set in full, and only the remaining difference from the other. ++ // Use the smaller set for the difference in order to reduce hash lookups. ++ let (smaller, larger) = if self.len() <= other.len() { ++ (self, other) ++ } else { ++ (other, self) ++ }; ++ Union { ++ iter: larger.iter().chain(smaller.difference(larger)), ++ } ++ } ++ ++ /// Returns `true` if the set contains a value. ++ /// ++ /// The value may be any borrowed form of the set's value type, but ++ /// [`Hash`] and [`Eq`] on the borrowed form *must* match those for ++ /// the value type. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// ++ /// let set: HashSet<_> = [1, 2, 3].into_iter().collect(); ++ /// assert_eq!(set.contains(&1), true); ++ /// assert_eq!(set.contains(&4), false); ++ /// ``` ++ /// ++ /// [`Eq`]: https://doc.rust-lang.org/std/cmp/trait.Eq.html ++ /// [`Hash`]: https://doc.rust-lang.org/std/hash/trait.Hash.html ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn contains(&self, value: &Q) -> bool ++ where ++ Q: Hash + Equivalent, ++ { ++ self.map.contains_key(value) ++ } ++ ++ /// Returns a reference to the value in the set, if any, that is equal to the given value. ++ /// ++ /// The value may be any borrowed form of the set's value type, but ++ /// [`Hash`] and [`Eq`] on the borrowed form *must* match those for ++ /// the value type. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// ++ /// let set: HashSet<_> = [1, 2, 3].into_iter().collect(); ++ /// assert_eq!(set.get(&2), Some(&2)); ++ /// assert_eq!(set.get(&4), None); ++ /// ``` ++ /// ++ /// [`Eq`]: https://doc.rust-lang.org/std/cmp/trait.Eq.html ++ /// [`Hash`]: https://doc.rust-lang.org/std/hash/trait.Hash.html ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn get(&self, value: &Q) -> Option<&T> ++ where ++ Q: Hash + Equivalent, ++ { ++ // Avoid `Option::map` because it bloats LLVM IR. ++ match self.map.get_key_value(value) { ++ Some((k, _)) => Some(k), ++ None => None, ++ } ++ } ++ ++ /// Inserts the given `value` into the set if it is not present, then ++ /// returns a reference to the value in the set. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// ++ /// let mut set: HashSet<_> = [1, 2, 3].into_iter().collect(); ++ /// assert_eq!(set.len(), 3); ++ /// assert_eq!(set.get_or_insert(2), &2); ++ /// assert_eq!(set.get_or_insert(100), &100); ++ /// assert_eq!(set.len(), 4); // 100 was inserted ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn get_or_insert(&mut self, value: T) -> &T { ++ // Although the raw entry gives us `&mut T`, we only return `&T` to be consistent with ++ // `get`. Key mutation is "raw" because you're not supposed to affect `Eq` or `Hash`. ++ self.map ++ .raw_entry_mut() ++ .from_key(&value) ++ .or_insert(value, ()) ++ .0 ++ } ++ ++ /// Inserts an owned copy of the given `value` into the set if it is not ++ /// present, then returns a reference to the value in the set. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// ++ /// let mut set: HashSet = ["cat", "dog", "horse"] ++ /// .iter().map(|&pet| pet.to_owned()).collect(); ++ /// ++ /// assert_eq!(set.len(), 3); ++ /// for &pet in &["cat", "dog", "fish"] { ++ /// let value = set.get_or_insert_owned(pet); ++ /// assert_eq!(value, pet); ++ /// } ++ /// assert_eq!(set.len(), 4); // a new "fish" was inserted ++ /// ``` ++ #[inline] ++ pub fn get_or_insert_owned(&mut self, value: &Q) -> &T ++ where ++ Q: Hash + Equivalent + ToOwned, ++ { ++ // Although the raw entry gives us `&mut T`, we only return `&T` to be consistent with ++ // `get`. Key mutation is "raw" because you're not supposed to affect `Eq` or `Hash`. ++ self.map ++ .raw_entry_mut() ++ .from_key(value) ++ .or_insert_with(|| (value.to_owned(), ())) ++ .0 ++ } ++ ++ /// Inserts a value computed from `f` into the set if the given `value` is ++ /// not present, then returns a reference to the value in the set. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// ++ /// let mut set: HashSet = ["cat", "dog", "horse"] ++ /// .iter().map(|&pet| pet.to_owned()).collect(); ++ /// ++ /// assert_eq!(set.len(), 3); ++ /// for &pet in &["cat", "dog", "fish"] { ++ /// let value = set.get_or_insert_with(pet, str::to_owned); ++ /// assert_eq!(value, pet); ++ /// } ++ /// assert_eq!(set.len(), 4); // a new "fish" was inserted ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn get_or_insert_with(&mut self, value: &Q, f: F) -> &T ++ where ++ Q: Hash + Equivalent, ++ F: FnOnce(&Q) -> T, ++ { ++ // Although the raw entry gives us `&mut T`, we only return `&T` to be consistent with ++ // `get`. Key mutation is "raw" because you're not supposed to affect `Eq` or `Hash`. ++ self.map ++ .raw_entry_mut() ++ .from_key(value) ++ .or_insert_with(|| (f(value), ())) ++ .0 ++ } ++ ++ /// Gets the given value's corresponding entry in the set for in-place manipulation. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// use hashbrown::hash_set::Entry::*; ++ /// ++ /// let mut singles = HashSet::new(); ++ /// let mut dupes = HashSet::new(); ++ /// ++ /// for ch in "a short treatise on fungi".chars() { ++ /// if let Vacant(dupe_entry) = dupes.entry(ch) { ++ /// // We haven't already seen a duplicate, so ++ /// // check if we've at least seen it once. ++ /// match singles.entry(ch) { ++ /// Vacant(single_entry) => { ++ /// // We found a new character for the first time. ++ /// single_entry.insert() ++ /// } ++ /// Occupied(single_entry) => { ++ /// // We've already seen this once, "move" it to dupes. ++ /// single_entry.remove(); ++ /// dupe_entry.insert(); ++ /// } ++ /// } ++ /// } ++ /// } ++ /// ++ /// assert!(!singles.contains(&'t') && dupes.contains(&'t')); ++ /// assert!(singles.contains(&'u') && !dupes.contains(&'u')); ++ /// assert!(!singles.contains(&'v') && !dupes.contains(&'v')); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn entry(&mut self, value: T) -> Entry<'_, T, S, A> { ++ match self.map.entry(value) { ++ map::Entry::Occupied(entry) => Entry::Occupied(OccupiedEntry { inner: entry }), ++ map::Entry::Vacant(entry) => Entry::Vacant(VacantEntry { inner: entry }), ++ } ++ } ++ ++ /// Returns `true` if `self` has no elements in common with `other`. ++ /// This is equivalent to checking for an empty intersection. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// ++ /// let a: HashSet<_> = [1, 2, 3].into_iter().collect(); ++ /// let mut b = HashSet::new(); ++ /// ++ /// assert_eq!(a.is_disjoint(&b), true); ++ /// b.insert(4); ++ /// assert_eq!(a.is_disjoint(&b), true); ++ /// b.insert(1); ++ /// assert_eq!(a.is_disjoint(&b), false); ++ /// ``` ++ pub fn is_disjoint(&self, other: &Self) -> bool { ++ self.iter().all(|v| !other.contains(v)) ++ } ++ ++ /// Returns `true` if the set is a subset of another, ++ /// i.e., `other` contains at least all the values in `self`. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// ++ /// let sup: HashSet<_> = [1, 2, 3].into_iter().collect(); ++ /// let mut set = HashSet::new(); ++ /// ++ /// assert_eq!(set.is_subset(&sup), true); ++ /// set.insert(2); ++ /// assert_eq!(set.is_subset(&sup), true); ++ /// set.insert(4); ++ /// assert_eq!(set.is_subset(&sup), false); ++ /// ``` ++ pub fn is_subset(&self, other: &Self) -> bool { ++ self.len() <= other.len() && self.iter().all(|v| other.contains(v)) ++ } ++ ++ /// Returns `true` if the set is a superset of another, ++ /// i.e., `self` contains at least all the values in `other`. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// ++ /// let sub: HashSet<_> = [1, 2].into_iter().collect(); ++ /// let mut set = HashSet::new(); ++ /// ++ /// assert_eq!(set.is_superset(&sub), false); ++ /// ++ /// set.insert(0); ++ /// set.insert(1); ++ /// assert_eq!(set.is_superset(&sub), false); ++ /// ++ /// set.insert(2); ++ /// assert_eq!(set.is_superset(&sub), true); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn is_superset(&self, other: &Self) -> bool { ++ other.is_subset(self) ++ } ++ ++ /// Adds a value to the set. ++ /// ++ /// If the set did not have this value present, `true` is returned. ++ /// ++ /// If the set did have this value present, `false` is returned. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// ++ /// let mut set = HashSet::new(); ++ /// ++ /// assert_eq!(set.insert(2), true); ++ /// assert_eq!(set.insert(2), false); ++ /// assert_eq!(set.len(), 1); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn insert(&mut self, value: T) -> bool { ++ self.map.insert(value, ()).is_none() ++ } ++ ++ /// Insert a value the set without checking if the value already exists in the set. ++ /// ++ /// Returns a reference to the value just inserted. ++ /// ++ /// This operation is safe if a value does not exist in the set. ++ /// ++ /// However, if a value exists in the set already, the behavior is unspecified: ++ /// this operation may panic, loop forever, or any following operation with the set ++ /// may panic, loop forever or return arbitrary result. ++ /// ++ /// That said, this operation (and following operations) are guaranteed to ++ /// not violate memory safety. ++ /// ++ /// This operation is faster than regular insert, because it does not perform ++ /// lookup before insertion. ++ /// ++ /// This operation is useful during initial population of the set. ++ /// For example, when constructing a set from another set, we know ++ /// that values are unique. ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn insert_unique_unchecked(&mut self, value: T) -> &T { ++ self.map.insert_unique_unchecked(value, ()).0 ++ } ++ ++ /// Adds a value to the set, replacing the existing value, if any, that is equal to the given ++ /// one. Returns the replaced value. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// ++ /// let mut set = HashSet::new(); ++ /// set.insert(Vec::::new()); ++ /// ++ /// assert_eq!(set.get(&[][..]).unwrap().capacity(), 0); ++ /// set.replace(Vec::with_capacity(10)); ++ /// assert_eq!(set.get(&[][..]).unwrap().capacity(), 10); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn replace(&mut self, value: T) -> Option { ++ match self.map.entry(value) { ++ map::Entry::Occupied(occupied) => Some(occupied.replace_key()), ++ map::Entry::Vacant(vacant) => { ++ vacant.insert(()); ++ None ++ } ++ } ++ } ++ ++ /// Removes a value from the set. Returns whether the value was ++ /// present in the set. ++ /// ++ /// The value may be any borrowed form of the set's value type, but ++ /// [`Hash`] and [`Eq`] on the borrowed form *must* match those for ++ /// the value type. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// ++ /// let mut set = HashSet::new(); ++ /// ++ /// set.insert(2); ++ /// assert_eq!(set.remove(&2), true); ++ /// assert_eq!(set.remove(&2), false); ++ /// ``` ++ /// ++ /// [`Eq`]: https://doc.rust-lang.org/std/cmp/trait.Eq.html ++ /// [`Hash`]: https://doc.rust-lang.org/std/hash/trait.Hash.html ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn remove(&mut self, value: &Q) -> bool ++ where ++ Q: Hash + Equivalent, ++ { ++ self.map.remove(value).is_some() ++ } ++ ++ /// Removes and returns the value in the set, if any, that is equal to the given one. ++ /// ++ /// The value may be any borrowed form of the set's value type, but ++ /// [`Hash`] and [`Eq`] on the borrowed form *must* match those for ++ /// the value type. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// ++ /// let mut set: HashSet<_> = [1, 2, 3].into_iter().collect(); ++ /// assert_eq!(set.take(&2), Some(2)); ++ /// assert_eq!(set.take(&2), None); ++ /// ``` ++ /// ++ /// [`Eq`]: https://doc.rust-lang.org/std/cmp/trait.Eq.html ++ /// [`Hash`]: https://doc.rust-lang.org/std/hash/trait.Hash.html ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn take(&mut self, value: &Q) -> Option ++ where ++ Q: Hash + Equivalent, ++ { ++ // Avoid `Option::map` because it bloats LLVM IR. ++ match self.map.remove_entry(value) { ++ Some((k, _)) => Some(k), ++ None => None, ++ } ++ } ++} ++ ++impl HashSet { ++ /// Returns a reference to the [`RawTable`] used underneath [`HashSet`]. ++ /// This function is only available if the `raw` feature of the crate is enabled. ++ /// ++ /// # Note ++ /// ++ /// Calling this function is safe, but using the raw hash table API may require ++ /// unsafe functions or blocks. ++ /// ++ /// `RawTable` API gives the lowest level of control under the set that can be useful ++ /// for extending the HashSet's API, but may lead to *[undefined behavior]*. ++ /// ++ /// [`HashSet`]: struct.HashSet.html ++ /// [`RawTable`]: crate::raw::RawTable ++ /// [undefined behavior]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html ++ #[cfg(feature = "raw")] ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn raw_table(&self) -> &RawTable<(T, ()), A> { ++ self.map.raw_table() ++ } ++ ++ /// Returns a mutable reference to the [`RawTable`] used underneath [`HashSet`]. ++ /// This function is only available if the `raw` feature of the crate is enabled. ++ /// ++ /// # Note ++ /// ++ /// Calling this function is safe, but using the raw hash table API may require ++ /// unsafe functions or blocks. ++ /// ++ /// `RawTable` API gives the lowest level of control under the set that can be useful ++ /// for extending the HashSet's API, but may lead to *[undefined behavior]*. ++ /// ++ /// [`HashSet`]: struct.HashSet.html ++ /// [`RawTable`]: crate::raw::RawTable ++ /// [undefined behavior]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html ++ #[cfg(feature = "raw")] ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn raw_table_mut(&mut self) -> &mut RawTable<(T, ()), A> { ++ self.map.raw_table_mut() ++ } ++} ++ ++impl PartialEq for HashSet ++where ++ T: Eq + Hash, ++ S: BuildHasher, ++ A: Allocator, ++{ ++ fn eq(&self, other: &Self) -> bool { ++ if self.len() != other.len() { ++ return false; ++ } ++ ++ self.iter().all(|key| other.contains(key)) ++ } ++} ++ ++impl Eq for HashSet ++where ++ T: Eq + Hash, ++ S: BuildHasher, ++ A: Allocator, ++{ ++} ++ ++impl fmt::Debug for HashSet ++where ++ T: fmt::Debug, ++ A: Allocator, ++{ ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_set().entries(self.iter()).finish() ++ } ++} ++ ++impl From> for HashSet ++where ++ A: Allocator, ++{ ++ fn from(map: HashMap) -> Self { ++ Self { map } ++ } ++} ++ ++impl FromIterator for HashSet ++where ++ T: Eq + Hash, ++ S: BuildHasher + Default, ++ A: Default + Allocator, ++{ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn from_iter>(iter: I) -> Self { ++ let mut set = Self::with_hasher_in(Default::default(), Default::default()); ++ set.extend(iter); ++ set ++ } ++} ++ ++// The default hasher is used to match the std implementation signature ++#[cfg(feature = "ahash")] ++impl From<[T; N]> for HashSet ++where ++ T: Eq + Hash, ++ A: Default + Allocator, ++{ ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// ++ /// let set1 = HashSet::from([1, 2, 3, 4]); ++ /// let set2: HashSet<_> = [1, 2, 3, 4].into(); ++ /// assert_eq!(set1, set2); ++ /// ``` ++ fn from(arr: [T; N]) -> Self { ++ arr.into_iter().collect() ++ } ++} ++ ++impl Extend for HashSet ++where ++ T: Eq + Hash, ++ S: BuildHasher, ++ A: Allocator, ++{ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn extend>(&mut self, iter: I) { ++ self.map.extend(iter.into_iter().map(|k| (k, ()))); ++ } ++ ++ #[inline] ++ #[cfg(feature = "nightly")] ++ fn extend_one(&mut self, k: T) { ++ self.map.insert(k, ()); ++ } ++ ++ #[inline] ++ #[cfg(feature = "nightly")] ++ fn extend_reserve(&mut self, additional: usize) { ++ Extend::<(T, ())>::extend_reserve(&mut self.map, additional); ++ } ++} ++ ++impl<'a, T, S, A> Extend<&'a T> for HashSet ++where ++ T: 'a + Eq + Hash + Copy, ++ S: BuildHasher, ++ A: Allocator, ++{ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn extend>(&mut self, iter: I) { ++ self.extend(iter.into_iter().copied()); ++ } ++ ++ #[inline] ++ #[cfg(feature = "nightly")] ++ fn extend_one(&mut self, k: &'a T) { ++ self.map.insert(*k, ()); ++ } ++ ++ #[inline] ++ #[cfg(feature = "nightly")] ++ fn extend_reserve(&mut self, additional: usize) { ++ Extend::<(T, ())>::extend_reserve(&mut self.map, additional); ++ } ++} ++ ++impl Default for HashSet ++where ++ S: Default, ++ A: Default + Allocator, ++{ ++ /// Creates an empty `HashSet` with the `Default` value for the hasher. ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn default() -> Self { ++ Self { ++ map: HashMap::default(), ++ } ++ } ++} ++ ++impl BitOr<&HashSet> for &HashSet ++where ++ T: Eq + Hash + Clone, ++ S: BuildHasher + Default, ++ A: Allocator, ++{ ++ type Output = HashSet; ++ ++ /// Returns the union of `self` and `rhs` as a new `HashSet`. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// ++ /// let a: HashSet<_> = vec![1, 2, 3].into_iter().collect(); ++ /// let b: HashSet<_> = vec![3, 4, 5].into_iter().collect(); ++ /// ++ /// let set = &a | &b; ++ /// ++ /// let mut i = 0; ++ /// let expected = [1, 2, 3, 4, 5]; ++ /// for x in &set { ++ /// assert!(expected.contains(x)); ++ /// i += 1; ++ /// } ++ /// assert_eq!(i, expected.len()); ++ /// ``` ++ fn bitor(self, rhs: &HashSet) -> HashSet { ++ self.union(rhs).cloned().collect() ++ } ++} ++ ++impl BitAnd<&HashSet> for &HashSet ++where ++ T: Eq + Hash + Clone, ++ S: BuildHasher + Default, ++ A: Allocator, ++{ ++ type Output = HashSet; ++ ++ /// Returns the intersection of `self` and `rhs` as a new `HashSet`. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// ++ /// let a: HashSet<_> = vec![1, 2, 3].into_iter().collect(); ++ /// let b: HashSet<_> = vec![2, 3, 4].into_iter().collect(); ++ /// ++ /// let set = &a & &b; ++ /// ++ /// let mut i = 0; ++ /// let expected = [2, 3]; ++ /// for x in &set { ++ /// assert!(expected.contains(x)); ++ /// i += 1; ++ /// } ++ /// assert_eq!(i, expected.len()); ++ /// ``` ++ fn bitand(self, rhs: &HashSet) -> HashSet { ++ self.intersection(rhs).cloned().collect() ++ } ++} ++ ++impl BitXor<&HashSet> for &HashSet ++where ++ T: Eq + Hash + Clone, ++ S: BuildHasher + Default, ++{ ++ type Output = HashSet; ++ ++ /// Returns the symmetric difference of `self` and `rhs` as a new `HashSet`. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// ++ /// let a: HashSet<_> = vec![1, 2, 3].into_iter().collect(); ++ /// let b: HashSet<_> = vec![3, 4, 5].into_iter().collect(); ++ /// ++ /// let set = &a ^ &b; ++ /// ++ /// let mut i = 0; ++ /// let expected = [1, 2, 4, 5]; ++ /// for x in &set { ++ /// assert!(expected.contains(x)); ++ /// i += 1; ++ /// } ++ /// assert_eq!(i, expected.len()); ++ /// ``` ++ fn bitxor(self, rhs: &HashSet) -> HashSet { ++ self.symmetric_difference(rhs).cloned().collect() ++ } ++} ++ ++impl Sub<&HashSet> for &HashSet ++where ++ T: Eq + Hash + Clone, ++ S: BuildHasher + Default, ++{ ++ type Output = HashSet; ++ ++ /// Returns the difference of `self` and `rhs` as a new `HashSet`. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// ++ /// let a: HashSet<_> = vec![1, 2, 3].into_iter().collect(); ++ /// let b: HashSet<_> = vec![3, 4, 5].into_iter().collect(); ++ /// ++ /// let set = &a - &b; ++ /// ++ /// let mut i = 0; ++ /// let expected = [1, 2]; ++ /// for x in &set { ++ /// assert!(expected.contains(x)); ++ /// i += 1; ++ /// } ++ /// assert_eq!(i, expected.len()); ++ /// ``` ++ fn sub(self, rhs: &HashSet) -> HashSet { ++ self.difference(rhs).cloned().collect() ++ } ++} ++ ++/// An iterator over the items of a `HashSet`. ++/// ++/// This `struct` is created by the [`iter`] method on [`HashSet`]. ++/// See its documentation for more. ++/// ++/// [`HashSet`]: struct.HashSet.html ++/// [`iter`]: struct.HashSet.html#method.iter ++pub struct Iter<'a, K> { ++ iter: Keys<'a, K, ()>, ++} ++ ++/// An owning iterator over the items of a `HashSet`. ++/// ++/// This `struct` is created by the [`into_iter`] method on [`HashSet`] ++/// (provided by the `IntoIterator` trait). See its documentation for more. ++/// ++/// [`HashSet`]: struct.HashSet.html ++/// [`into_iter`]: struct.HashSet.html#method.into_iter ++pub struct IntoIter { ++ iter: map::IntoIter, ++} ++ ++/// A draining iterator over the items of a `HashSet`. ++/// ++/// This `struct` is created by the [`drain`] method on [`HashSet`]. ++/// See its documentation for more. ++/// ++/// [`HashSet`]: struct.HashSet.html ++/// [`drain`]: struct.HashSet.html#method.drain ++pub struct Drain<'a, K, A: Allocator = Global> { ++ iter: map::Drain<'a, K, (), A>, ++} ++ ++/// A draining iterator over entries of a `HashSet` which don't satisfy the predicate `f`. ++/// ++/// This `struct` is created by the [`extract_if`] method on [`HashSet`]. See its ++/// documentation for more. ++/// ++/// [`extract_if`]: struct.HashSet.html#method.extract_if ++/// [`HashSet`]: struct.HashSet.html ++#[must_use = "Iterators are lazy unless consumed"] ++pub struct ExtractIf<'a, K, F, A: Allocator = Global> ++where ++ F: FnMut(&K) -> bool, ++{ ++ f: F, ++ inner: RawExtractIf<'a, (K, ()), A>, ++} ++ ++/// A lazy iterator producing elements in the intersection of `HashSet`s. ++/// ++/// This `struct` is created by the [`intersection`] method on [`HashSet`]. ++/// See its documentation for more. ++/// ++/// [`HashSet`]: struct.HashSet.html ++/// [`intersection`]: struct.HashSet.html#method.intersection ++pub struct Intersection<'a, T, S, A: Allocator = Global> { ++ // iterator of the first set ++ iter: Iter<'a, T>, ++ // the second set ++ other: &'a HashSet, ++} ++ ++/// A lazy iterator producing elements in the difference of `HashSet`s. ++/// ++/// This `struct` is created by the [`difference`] method on [`HashSet`]. ++/// See its documentation for more. ++/// ++/// [`HashSet`]: struct.HashSet.html ++/// [`difference`]: struct.HashSet.html#method.difference ++pub struct Difference<'a, T, S, A: Allocator = Global> { ++ // iterator of the first set ++ iter: Iter<'a, T>, ++ // the second set ++ other: &'a HashSet, ++} ++ ++/// A lazy iterator producing elements in the symmetric difference of `HashSet`s. ++/// ++/// This `struct` is created by the [`symmetric_difference`] method on ++/// [`HashSet`]. See its documentation for more. ++/// ++/// [`HashSet`]: struct.HashSet.html ++/// [`symmetric_difference`]: struct.HashSet.html#method.symmetric_difference ++pub struct SymmetricDifference<'a, T, S, A: Allocator = Global> { ++ iter: Chain, Difference<'a, T, S, A>>, ++} ++ ++/// A lazy iterator producing elements in the union of `HashSet`s. ++/// ++/// This `struct` is created by the [`union`] method on [`HashSet`]. ++/// See its documentation for more. ++/// ++/// [`HashSet`]: struct.HashSet.html ++/// [`union`]: struct.HashSet.html#method.union ++pub struct Union<'a, T, S, A: Allocator = Global> { ++ iter: Chain, Difference<'a, T, S, A>>, ++} ++ ++impl<'a, T, S, A: Allocator> IntoIterator for &'a HashSet { ++ type Item = &'a T; ++ type IntoIter = Iter<'a, T>; ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn into_iter(self) -> Iter<'a, T> { ++ self.iter() ++ } ++} ++ ++impl IntoIterator for HashSet { ++ type Item = T; ++ type IntoIter = IntoIter; ++ ++ /// Creates a consuming iterator, that is, one that moves each value out ++ /// of the set in arbitrary order. The set cannot be used after calling ++ /// this. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// let mut set = HashSet::new(); ++ /// set.insert("a".to_string()); ++ /// set.insert("b".to_string()); ++ /// ++ /// // Not possible to collect to a Vec with a regular `.iter()`. ++ /// let v: Vec = set.into_iter().collect(); ++ /// ++ /// // Will print in an arbitrary order. ++ /// for x in &v { ++ /// println!("{}", x); ++ /// } ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn into_iter(self) -> IntoIter { ++ IntoIter { ++ iter: self.map.into_iter(), ++ } ++ } ++} ++ ++impl Clone for Iter<'_, K> { ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn clone(&self) -> Self { ++ Iter { ++ iter: self.iter.clone(), ++ } ++ } ++} ++impl<'a, K> Iterator for Iter<'a, K> { ++ type Item = &'a K; ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn next(&mut self) -> Option<&'a K> { ++ self.iter.next() ++ } ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn size_hint(&self) -> (usize, Option) { ++ self.iter.size_hint() ++ } ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn fold(self, init: B, f: F) -> B ++ where ++ Self: Sized, ++ F: FnMut(B, Self::Item) -> B, ++ { ++ self.iter.fold(init, f) ++ } ++} ++impl<'a, K> ExactSizeIterator for Iter<'a, K> { ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn len(&self) -> usize { ++ self.iter.len() ++ } ++} ++impl FusedIterator for Iter<'_, K> {} ++ ++impl fmt::Debug for Iter<'_, K> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_list().entries(self.clone()).finish() ++ } ++} ++ ++impl Iterator for IntoIter { ++ type Item = K; ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn next(&mut self) -> Option { ++ // Avoid `Option::map` because it bloats LLVM IR. ++ match self.iter.next() { ++ Some((k, _)) => Some(k), ++ None => None, ++ } ++ } ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn size_hint(&self) -> (usize, Option) { ++ self.iter.size_hint() ++ } ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn fold(self, init: B, mut f: F) -> B ++ where ++ Self: Sized, ++ F: FnMut(B, Self::Item) -> B, ++ { ++ self.iter.fold(init, |acc, (k, ())| f(acc, k)) ++ } ++} ++impl ExactSizeIterator for IntoIter { ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn len(&self) -> usize { ++ self.iter.len() ++ } ++} ++impl FusedIterator for IntoIter {} ++ ++impl fmt::Debug for IntoIter { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ let entries_iter = self.iter.iter().map(|(k, _)| k); ++ f.debug_list().entries(entries_iter).finish() ++ } ++} ++ ++impl Iterator for Drain<'_, K, A> { ++ type Item = K; ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn next(&mut self) -> Option { ++ // Avoid `Option::map` because it bloats LLVM IR. ++ match self.iter.next() { ++ Some((k, _)) => Some(k), ++ None => None, ++ } ++ } ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn size_hint(&self) -> (usize, Option) { ++ self.iter.size_hint() ++ } ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn fold(self, init: B, mut f: F) -> B ++ where ++ Self: Sized, ++ F: FnMut(B, Self::Item) -> B, ++ { ++ self.iter.fold(init, |acc, (k, ())| f(acc, k)) ++ } ++} ++impl ExactSizeIterator for Drain<'_, K, A> { ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn len(&self) -> usize { ++ self.iter.len() ++ } ++} ++impl FusedIterator for Drain<'_, K, A> {} ++ ++impl fmt::Debug for Drain<'_, K, A> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ let entries_iter = self.iter.iter().map(|(k, _)| k); ++ f.debug_list().entries(entries_iter).finish() ++ } ++} ++ ++impl Iterator for ExtractIf<'_, K, F, A> ++where ++ F: FnMut(&K) -> bool, ++{ ++ type Item = K; ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn next(&mut self) -> Option { ++ self.inner ++ .next(|&mut (ref k, ())| (self.f)(k)) ++ .map(|(k, ())| k) ++ } ++ ++ #[inline] ++ fn size_hint(&self) -> (usize, Option) { ++ (0, self.inner.iter.size_hint().1) ++ } ++} ++ ++impl FusedIterator for ExtractIf<'_, K, F, A> where F: FnMut(&K) -> bool {} ++ ++impl Clone for Intersection<'_, T, S, A> { ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn clone(&self) -> Self { ++ Intersection { ++ iter: self.iter.clone(), ++ ..*self ++ } ++ } ++} ++ ++impl<'a, T, S, A> Iterator for Intersection<'a, T, S, A> ++where ++ T: Eq + Hash, ++ S: BuildHasher, ++ A: Allocator, ++{ ++ type Item = &'a T; ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn next(&mut self) -> Option<&'a T> { ++ loop { ++ let elt = self.iter.next()?; ++ if self.other.contains(elt) { ++ return Some(elt); ++ } ++ } ++ } ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn size_hint(&self) -> (usize, Option) { ++ let (_, upper) = self.iter.size_hint(); ++ (0, upper) ++ } ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn fold(self, init: B, mut f: F) -> B ++ where ++ Self: Sized, ++ F: FnMut(B, Self::Item) -> B, ++ { ++ self.iter.fold(init, |acc, elt| { ++ if self.other.contains(elt) { ++ f(acc, elt) ++ } else { ++ acc ++ } ++ }) ++ } ++} ++ ++impl fmt::Debug for Intersection<'_, T, S, A> ++where ++ T: fmt::Debug + Eq + Hash, ++ S: BuildHasher, ++ A: Allocator, ++{ ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_list().entries(self.clone()).finish() ++ } ++} ++ ++impl FusedIterator for Intersection<'_, T, S, A> ++where ++ T: Eq + Hash, ++ S: BuildHasher, ++ A: Allocator, ++{ ++} ++ ++impl Clone for Difference<'_, T, S, A> { ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn clone(&self) -> Self { ++ Difference { ++ iter: self.iter.clone(), ++ ..*self ++ } ++ } ++} ++ ++impl<'a, T, S, A> Iterator for Difference<'a, T, S, A> ++where ++ T: Eq + Hash, ++ S: BuildHasher, ++ A: Allocator, ++{ ++ type Item = &'a T; ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn next(&mut self) -> Option<&'a T> { ++ loop { ++ let elt = self.iter.next()?; ++ if !self.other.contains(elt) { ++ return Some(elt); ++ } ++ } ++ } ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn size_hint(&self) -> (usize, Option) { ++ let (_, upper) = self.iter.size_hint(); ++ (0, upper) ++ } ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn fold(self, init: B, mut f: F) -> B ++ where ++ Self: Sized, ++ F: FnMut(B, Self::Item) -> B, ++ { ++ self.iter.fold(init, |acc, elt| { ++ if self.other.contains(elt) { ++ acc ++ } else { ++ f(acc, elt) ++ } ++ }) ++ } ++} ++ ++impl FusedIterator for Difference<'_, T, S, A> ++where ++ T: Eq + Hash, ++ S: BuildHasher, ++ A: Allocator, ++{ ++} ++ ++impl fmt::Debug for Difference<'_, T, S, A> ++where ++ T: fmt::Debug + Eq + Hash, ++ S: BuildHasher, ++ A: Allocator, ++{ ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_list().entries(self.clone()).finish() ++ } ++} ++ ++impl Clone for SymmetricDifference<'_, T, S, A> { ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn clone(&self) -> Self { ++ SymmetricDifference { ++ iter: self.iter.clone(), ++ } ++ } ++} ++ ++impl<'a, T, S, A> Iterator for SymmetricDifference<'a, T, S, A> ++where ++ T: Eq + Hash, ++ S: BuildHasher, ++ A: Allocator, ++{ ++ type Item = &'a T; ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn next(&mut self) -> Option<&'a T> { ++ self.iter.next() ++ } ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn size_hint(&self) -> (usize, Option) { ++ self.iter.size_hint() ++ } ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn fold(self, init: B, f: F) -> B ++ where ++ Self: Sized, ++ F: FnMut(B, Self::Item) -> B, ++ { ++ self.iter.fold(init, f) ++ } ++} ++ ++impl FusedIterator for SymmetricDifference<'_, T, S, A> ++where ++ T: Eq + Hash, ++ S: BuildHasher, ++ A: Allocator, ++{ ++} ++ ++impl fmt::Debug for SymmetricDifference<'_, T, S, A> ++where ++ T: fmt::Debug + Eq + Hash, ++ S: BuildHasher, ++ A: Allocator, ++{ ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_list().entries(self.clone()).finish() ++ } ++} ++ ++impl Clone for Union<'_, T, S, A> { ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn clone(&self) -> Self { ++ Union { ++ iter: self.iter.clone(), ++ } ++ } ++} ++ ++impl FusedIterator for Union<'_, T, S, A> ++where ++ T: Eq + Hash, ++ S: BuildHasher, ++ A: Allocator, ++{ ++} ++ ++impl fmt::Debug for Union<'_, T, S, A> ++where ++ T: fmt::Debug + Eq + Hash, ++ S: BuildHasher, ++ A: Allocator, ++{ ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_list().entries(self.clone()).finish() ++ } ++} ++ ++impl<'a, T, S, A> Iterator for Union<'a, T, S, A> ++where ++ T: Eq + Hash, ++ S: BuildHasher, ++ A: Allocator, ++{ ++ type Item = &'a T; ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn next(&mut self) -> Option<&'a T> { ++ self.iter.next() ++ } ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn size_hint(&self) -> (usize, Option) { ++ self.iter.size_hint() ++ } ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn fold(self, init: B, f: F) -> B ++ where ++ Self: Sized, ++ F: FnMut(B, Self::Item) -> B, ++ { ++ self.iter.fold(init, f) ++ } ++} ++ ++/// A view into a single entry in a set, which may either be vacant or occupied. ++/// ++/// This `enum` is constructed from the [`entry`] method on [`HashSet`]. ++/// ++/// [`HashSet`]: struct.HashSet.html ++/// [`entry`]: struct.HashSet.html#method.entry ++/// ++/// # Examples ++/// ++/// ``` ++/// use hashbrown::hash_set::{Entry, HashSet, OccupiedEntry}; ++/// ++/// let mut set = HashSet::new(); ++/// set.extend(["a", "b", "c"]); ++/// assert_eq!(set.len(), 3); ++/// ++/// // Existing value (insert) ++/// let entry: Entry<_, _> = set.entry("a"); ++/// let _raw_o: OccupiedEntry<_, _> = entry.insert(); ++/// assert_eq!(set.len(), 3); ++/// // Nonexistent value (insert) ++/// set.entry("d").insert(); ++/// ++/// // Existing value (or_insert) ++/// set.entry("b").or_insert(); ++/// // Nonexistent value (or_insert) ++/// set.entry("e").or_insert(); ++/// ++/// println!("Our HashSet: {:?}", set); ++/// ++/// let mut vec: Vec<_> = set.iter().copied().collect(); ++/// // The `Iter` iterator produces items in arbitrary order, so the ++/// // items must be sorted to test them against a sorted array. ++/// vec.sort_unstable(); ++/// assert_eq!(vec, ["a", "b", "c", "d", "e"]); ++/// ``` ++pub enum Entry<'a, T, S, A = Global> ++where ++ A: Allocator, ++{ ++ /// An occupied entry. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::hash_set::{Entry, HashSet}; ++ /// let mut set: HashSet<_> = ["a", "b"].into(); ++ /// ++ /// match set.entry("a") { ++ /// Entry::Vacant(_) => unreachable!(), ++ /// Entry::Occupied(_) => { } ++ /// } ++ /// ``` ++ Occupied(OccupiedEntry<'a, T, S, A>), ++ ++ /// A vacant entry. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::hash_set::{Entry, HashSet}; ++ /// let mut set: HashSet<&str> = HashSet::new(); ++ /// ++ /// match set.entry("a") { ++ /// Entry::Occupied(_) => unreachable!(), ++ /// Entry::Vacant(_) => { } ++ /// } ++ /// ``` ++ Vacant(VacantEntry<'a, T, S, A>), ++} ++ ++impl fmt::Debug for Entry<'_, T, S, A> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ match *self { ++ Entry::Vacant(ref v) => f.debug_tuple("Entry").field(v).finish(), ++ Entry::Occupied(ref o) => f.debug_tuple("Entry").field(o).finish(), ++ } ++ } ++} ++ ++/// A view into an occupied entry in a `HashSet`. ++/// It is part of the [`Entry`] enum. ++/// ++/// [`Entry`]: enum.Entry.html ++/// ++/// # Examples ++/// ++/// ``` ++/// use hashbrown::hash_set::{Entry, HashSet, OccupiedEntry}; ++/// ++/// let mut set = HashSet::new(); ++/// set.extend(["a", "b", "c"]); ++/// ++/// let _entry_o: OccupiedEntry<_, _> = set.entry("a").insert(); ++/// assert_eq!(set.len(), 3); ++/// ++/// // Existing key ++/// match set.entry("a") { ++/// Entry::Vacant(_) => unreachable!(), ++/// Entry::Occupied(view) => { ++/// assert_eq!(view.get(), &"a"); ++/// } ++/// } ++/// ++/// assert_eq!(set.len(), 3); ++/// ++/// // Existing key (take) ++/// match set.entry("c") { ++/// Entry::Vacant(_) => unreachable!(), ++/// Entry::Occupied(view) => { ++/// assert_eq!(view.remove(), "c"); ++/// } ++/// } ++/// assert_eq!(set.get(&"c"), None); ++/// assert_eq!(set.len(), 2); ++/// ``` ++pub struct OccupiedEntry<'a, T, S, A: Allocator = Global> { ++ inner: map::OccupiedEntry<'a, T, (), S, A>, ++} ++ ++impl fmt::Debug for OccupiedEntry<'_, T, S, A> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_struct("OccupiedEntry") ++ .field("value", self.get()) ++ .finish() ++ } ++} ++ ++/// A view into a vacant entry in a `HashSet`. ++/// It is part of the [`Entry`] enum. ++/// ++/// [`Entry`]: enum.Entry.html ++/// ++/// # Examples ++/// ++/// ``` ++/// use hashbrown::hash_set::{Entry, HashSet, VacantEntry}; ++/// ++/// let mut set = HashSet::<&str>::new(); ++/// ++/// let entry_v: VacantEntry<_, _> = match set.entry("a") { ++/// Entry::Vacant(view) => view, ++/// Entry::Occupied(_) => unreachable!(), ++/// }; ++/// entry_v.insert(); ++/// assert!(set.contains("a") && set.len() == 1); ++/// ++/// // Nonexistent key (insert) ++/// match set.entry("b") { ++/// Entry::Vacant(view) => view.insert(), ++/// Entry::Occupied(_) => unreachable!(), ++/// } ++/// assert!(set.contains("b") && set.len() == 2); ++/// ``` ++pub struct VacantEntry<'a, T, S, A: Allocator = Global> { ++ inner: map::VacantEntry<'a, T, (), S, A>, ++} ++ ++impl fmt::Debug for VacantEntry<'_, T, S, A> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_tuple("VacantEntry").field(self.get()).finish() ++ } ++} ++ ++impl<'a, T, S, A: Allocator> Entry<'a, T, S, A> { ++ /// Sets the value of the entry, and returns an OccupiedEntry. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// ++ /// let mut set: HashSet<&str> = HashSet::new(); ++ /// let entry = set.entry("horseyland").insert(); ++ /// ++ /// assert_eq!(entry.get(), &"horseyland"); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn insert(self) -> OccupiedEntry<'a, T, S, A> ++ where ++ T: Hash, ++ S: BuildHasher, ++ { ++ match self { ++ Entry::Occupied(entry) => entry, ++ Entry::Vacant(entry) => entry.insert_entry(), ++ } ++ } ++ ++ /// Ensures a value is in the entry by inserting if it was vacant. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// ++ /// let mut set: HashSet<&str> = HashSet::new(); ++ /// ++ /// // nonexistent key ++ /// set.entry("poneyland").or_insert(); ++ /// assert!(set.contains("poneyland")); ++ /// ++ /// // existing key ++ /// set.entry("poneyland").or_insert(); ++ /// assert!(set.contains("poneyland")); ++ /// assert_eq!(set.len(), 1); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn or_insert(self) ++ where ++ T: Hash, ++ S: BuildHasher, ++ { ++ if let Entry::Vacant(entry) = self { ++ entry.insert(); ++ } ++ } ++ ++ /// Returns a reference to this entry's value. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// ++ /// let mut set: HashSet<&str> = HashSet::new(); ++ /// set.entry("poneyland").or_insert(); ++ /// // existing key ++ /// assert_eq!(set.entry("poneyland").get(), &"poneyland"); ++ /// // nonexistent key ++ /// assert_eq!(set.entry("horseland").get(), &"horseland"); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn get(&self) -> &T { ++ match *self { ++ Entry::Occupied(ref entry) => entry.get(), ++ Entry::Vacant(ref entry) => entry.get(), ++ } ++ } ++} ++ ++impl OccupiedEntry<'_, T, S, A> { ++ /// Gets a reference to the value in the entry. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::hash_set::{Entry, HashSet}; ++ /// ++ /// let mut set: HashSet<&str> = HashSet::new(); ++ /// set.entry("poneyland").or_insert(); ++ /// ++ /// match set.entry("poneyland") { ++ /// Entry::Vacant(_) => panic!(), ++ /// Entry::Occupied(entry) => assert_eq!(entry.get(), &"poneyland"), ++ /// } ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn get(&self) -> &T { ++ self.inner.key() ++ } ++ ++ /// Takes the value out of the entry, and returns it. ++ /// Keeps the allocated memory for reuse. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// use hashbrown::hash_set::Entry; ++ /// ++ /// let mut set: HashSet<&str> = HashSet::new(); ++ /// // The set is empty ++ /// assert!(set.is_empty() && set.capacity() == 0); ++ /// ++ /// set.entry("poneyland").or_insert(); ++ /// let capacity_before_remove = set.capacity(); ++ /// ++ /// if let Entry::Occupied(o) = set.entry("poneyland") { ++ /// assert_eq!(o.remove(), "poneyland"); ++ /// } ++ /// ++ /// assert_eq!(set.contains("poneyland"), false); ++ /// // Now set hold none elements but capacity is equal to the old one ++ /// assert!(set.len() == 0 && set.capacity() == capacity_before_remove); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn remove(self) -> T { ++ self.inner.remove_entry().0 ++ } ++ ++ /// Replaces the entry, returning the old value. The new value in the hash map will be ++ /// the value used to create this entry. ++ /// ++ /// # Panics ++ /// ++ /// Will panic if this OccupiedEntry was created through [`Entry::insert`]. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::hash_set::{Entry, HashSet}; ++ /// use std::rc::Rc; ++ /// ++ /// let mut set: HashSet> = HashSet::new(); ++ /// let key_one = Rc::new("Stringthing".to_string()); ++ /// let key_two = Rc::new("Stringthing".to_string()); ++ /// ++ /// set.insert(key_one.clone()); ++ /// assert!(Rc::strong_count(&key_one) == 2 && Rc::strong_count(&key_two) == 1); ++ /// ++ /// match set.entry(key_two.clone()) { ++ /// Entry::Occupied(entry) => { ++ /// let old_key: Rc = entry.replace(); ++ /// assert!(Rc::ptr_eq(&key_one, &old_key)); ++ /// } ++ /// Entry::Vacant(_) => panic!(), ++ /// } ++ /// ++ /// assert!(Rc::strong_count(&key_one) == 1 && Rc::strong_count(&key_two) == 2); ++ /// assert!(set.contains(&"Stringthing".to_owned())); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn replace(self) -> T { ++ self.inner.replace_key() ++ } ++} ++ ++impl<'a, T, S, A: Allocator> VacantEntry<'a, T, S, A> { ++ /// Gets a reference to the value that would be used when inserting ++ /// through the `VacantEntry`. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// ++ /// let mut set: HashSet<&str> = HashSet::new(); ++ /// assert_eq!(set.entry("poneyland").get(), &"poneyland"); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn get(&self) -> &T { ++ self.inner.key() ++ } ++ ++ /// Take ownership of the value. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::hash_set::{Entry, HashSet}; ++ /// ++ /// let mut set: HashSet<&str> = HashSet::new(); ++ /// ++ /// match set.entry("poneyland") { ++ /// Entry::Occupied(_) => panic!(), ++ /// Entry::Vacant(v) => assert_eq!(v.into_value(), "poneyland"), ++ /// } ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn into_value(self) -> T { ++ self.inner.into_key() ++ } ++ ++ /// Sets the value of the entry with the VacantEntry's value. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashSet; ++ /// use hashbrown::hash_set::Entry; ++ /// ++ /// let mut set: HashSet<&str> = HashSet::new(); ++ /// ++ /// if let Entry::Vacant(o) = set.entry("poneyland") { ++ /// o.insert(); ++ /// } ++ /// assert!(set.contains("poneyland")); ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn insert(self) ++ where ++ T: Hash, ++ S: BuildHasher, ++ { ++ self.inner.insert(()); ++ } ++ ++ #[cfg_attr(feature = "inline-more", inline)] ++ fn insert_entry(self) -> OccupiedEntry<'a, T, S, A> ++ where ++ T: Hash, ++ S: BuildHasher, ++ { ++ OccupiedEntry { ++ inner: self.inner.insert_entry(()), ++ } ++ } ++} ++ ++#[allow(dead_code)] ++fn assert_covariance() { ++ fn set<'new>(v: HashSet<&'static str>) -> HashSet<&'new str> { ++ v ++ } ++ fn iter<'a, 'new>(v: Iter<'a, &'static str>) -> Iter<'a, &'new str> { ++ v ++ } ++ fn into_iter<'new, A: Allocator>(v: IntoIter<&'static str, A>) -> IntoIter<&'new str, A> { ++ v ++ } ++ fn difference<'a, 'new, A: Allocator>( ++ v: Difference<'a, &'static str, DefaultHashBuilder, A>, ++ ) -> Difference<'a, &'new str, DefaultHashBuilder, A> { ++ v ++ } ++ fn symmetric_difference<'a, 'new, A: Allocator>( ++ v: SymmetricDifference<'a, &'static str, DefaultHashBuilder, A>, ++ ) -> SymmetricDifference<'a, &'new str, DefaultHashBuilder, A> { ++ v ++ } ++ fn intersection<'a, 'new, A: Allocator>( ++ v: Intersection<'a, &'static str, DefaultHashBuilder, A>, ++ ) -> Intersection<'a, &'new str, DefaultHashBuilder, A> { ++ v ++ } ++ fn union<'a, 'new, A: Allocator>( ++ v: Union<'a, &'static str, DefaultHashBuilder, A>, ++ ) -> Union<'a, &'new str, DefaultHashBuilder, A> { ++ v ++ } ++ fn drain<'new, A: Allocator>(d: Drain<'static, &'static str, A>) -> Drain<'new, &'new str, A> { ++ d ++ } ++} ++ ++#[cfg(test)] ++mod test_set { ++ use super::super::map::DefaultHashBuilder; ++ use super::HashSet; ++ use std::vec::Vec; ++ ++ #[test] ++ fn test_zero_capacities() { ++ type HS = HashSet; ++ ++ let s = HS::new(); ++ assert_eq!(s.capacity(), 0); ++ ++ let s = HS::default(); ++ assert_eq!(s.capacity(), 0); ++ ++ let s = HS::with_hasher(DefaultHashBuilder::default()); ++ assert_eq!(s.capacity(), 0); ++ ++ let s = HS::with_capacity(0); ++ assert_eq!(s.capacity(), 0); ++ ++ let s = HS::with_capacity_and_hasher(0, DefaultHashBuilder::default()); ++ assert_eq!(s.capacity(), 0); ++ ++ let mut s = HS::new(); ++ s.insert(1); ++ s.insert(2); ++ s.remove(&1); ++ s.remove(&2); ++ s.shrink_to_fit(); ++ assert_eq!(s.capacity(), 0); ++ ++ let mut s = HS::new(); ++ s.reserve(0); ++ assert_eq!(s.capacity(), 0); ++ } ++ ++ #[test] ++ fn test_disjoint() { ++ let mut xs = HashSet::new(); ++ let mut ys = HashSet::new(); ++ assert!(xs.is_disjoint(&ys)); ++ assert!(ys.is_disjoint(&xs)); ++ assert!(xs.insert(5)); ++ assert!(ys.insert(11)); ++ assert!(xs.is_disjoint(&ys)); ++ assert!(ys.is_disjoint(&xs)); ++ assert!(xs.insert(7)); ++ assert!(xs.insert(19)); ++ assert!(xs.insert(4)); ++ assert!(ys.insert(2)); ++ assert!(ys.insert(-11)); ++ assert!(xs.is_disjoint(&ys)); ++ assert!(ys.is_disjoint(&xs)); ++ assert!(ys.insert(7)); ++ assert!(!xs.is_disjoint(&ys)); ++ assert!(!ys.is_disjoint(&xs)); ++ } ++ ++ #[test] ++ fn test_subset_and_superset() { ++ let mut a = HashSet::new(); ++ assert!(a.insert(0)); ++ assert!(a.insert(5)); ++ assert!(a.insert(11)); ++ assert!(a.insert(7)); ++ ++ let mut b = HashSet::new(); ++ assert!(b.insert(0)); ++ assert!(b.insert(7)); ++ assert!(b.insert(19)); ++ assert!(b.insert(250)); ++ assert!(b.insert(11)); ++ assert!(b.insert(200)); ++ ++ assert!(!a.is_subset(&b)); ++ assert!(!a.is_superset(&b)); ++ assert!(!b.is_subset(&a)); ++ assert!(!b.is_superset(&a)); ++ ++ assert!(b.insert(5)); ++ ++ assert!(a.is_subset(&b)); ++ assert!(!a.is_superset(&b)); ++ assert!(!b.is_subset(&a)); ++ assert!(b.is_superset(&a)); ++ } ++ ++ #[test] ++ fn test_iterate() { ++ let mut a = HashSet::new(); ++ for i in 0..32 { ++ assert!(a.insert(i)); ++ } ++ let mut observed: u32 = 0; ++ for k in &a { ++ observed |= 1 << *k; ++ } ++ assert_eq!(observed, 0xFFFF_FFFF); ++ } ++ ++ #[test] ++ fn test_intersection() { ++ let mut a = HashSet::new(); ++ let mut b = HashSet::new(); ++ ++ assert!(a.insert(11)); ++ assert!(a.insert(1)); ++ assert!(a.insert(3)); ++ assert!(a.insert(77)); ++ assert!(a.insert(103)); ++ assert!(a.insert(5)); ++ assert!(a.insert(-5)); ++ ++ assert!(b.insert(2)); ++ assert!(b.insert(11)); ++ assert!(b.insert(77)); ++ assert!(b.insert(-9)); ++ assert!(b.insert(-42)); ++ assert!(b.insert(5)); ++ assert!(b.insert(3)); ++ ++ let mut i = 0; ++ let expected = [3, 5, 11, 77]; ++ for x in a.intersection(&b) { ++ assert!(expected.contains(x)); ++ i += 1; ++ } ++ assert_eq!(i, expected.len()); ++ } ++ ++ #[test] ++ fn test_difference() { ++ let mut a = HashSet::new(); ++ let mut b = HashSet::new(); ++ ++ assert!(a.insert(1)); ++ assert!(a.insert(3)); ++ assert!(a.insert(5)); ++ assert!(a.insert(9)); ++ assert!(a.insert(11)); ++ ++ assert!(b.insert(3)); ++ assert!(b.insert(9)); ++ ++ let mut i = 0; ++ let expected = [1, 5, 11]; ++ for x in a.difference(&b) { ++ assert!(expected.contains(x)); ++ i += 1; ++ } ++ assert_eq!(i, expected.len()); ++ } ++ ++ #[test] ++ fn test_symmetric_difference() { ++ let mut a = HashSet::new(); ++ let mut b = HashSet::new(); ++ ++ assert!(a.insert(1)); ++ assert!(a.insert(3)); ++ assert!(a.insert(5)); ++ assert!(a.insert(9)); ++ assert!(a.insert(11)); ++ ++ assert!(b.insert(-2)); ++ assert!(b.insert(3)); ++ assert!(b.insert(9)); ++ assert!(b.insert(14)); ++ assert!(b.insert(22)); ++ ++ let mut i = 0; ++ let expected = [-2, 1, 5, 11, 14, 22]; ++ for x in a.symmetric_difference(&b) { ++ assert!(expected.contains(x)); ++ i += 1; ++ } ++ assert_eq!(i, expected.len()); ++ } ++ ++ #[test] ++ fn test_union() { ++ let mut a = HashSet::new(); ++ let mut b = HashSet::new(); ++ ++ assert!(a.insert(1)); ++ assert!(a.insert(3)); ++ assert!(a.insert(5)); ++ assert!(a.insert(9)); ++ assert!(a.insert(11)); ++ assert!(a.insert(16)); ++ assert!(a.insert(19)); ++ assert!(a.insert(24)); ++ ++ assert!(b.insert(-2)); ++ assert!(b.insert(1)); ++ assert!(b.insert(5)); ++ assert!(b.insert(9)); ++ assert!(b.insert(13)); ++ assert!(b.insert(19)); ++ ++ let mut i = 0; ++ let expected = [-2, 1, 3, 5, 9, 11, 13, 16, 19, 24]; ++ for x in a.union(&b) { ++ assert!(expected.contains(x)); ++ i += 1; ++ } ++ assert_eq!(i, expected.len()); ++ } ++ ++ #[test] ++ fn test_from_map() { ++ let mut a = crate::HashMap::new(); ++ a.insert(1, ()); ++ a.insert(2, ()); ++ a.insert(3, ()); ++ a.insert(4, ()); ++ ++ let a: HashSet<_> = a.into(); ++ ++ assert_eq!(a.len(), 4); ++ assert!(a.contains(&1)); ++ assert!(a.contains(&2)); ++ assert!(a.contains(&3)); ++ assert!(a.contains(&4)); ++ } ++ ++ #[test] ++ fn test_from_iter() { ++ let xs = [1, 2, 2, 3, 4, 5, 6, 7, 8, 9]; ++ ++ let set: HashSet<_> = xs.iter().copied().collect(); ++ ++ for x in &xs { ++ assert!(set.contains(x)); ++ } ++ ++ assert_eq!(set.iter().len(), xs.len() - 1); ++ } ++ ++ #[test] ++ fn test_move_iter() { ++ let hs = { ++ let mut hs = HashSet::new(); ++ ++ hs.insert('a'); ++ hs.insert('b'); ++ ++ hs ++ }; ++ ++ let v = hs.into_iter().collect::>(); ++ assert!(v == ['a', 'b'] || v == ['b', 'a']); ++ } ++ ++ #[test] ++ fn test_eq() { ++ // These constants once happened to expose a bug in insert(). ++ // I'm keeping them around to prevent a regression. ++ let mut s1 = HashSet::new(); ++ ++ s1.insert(1); ++ s1.insert(2); ++ s1.insert(3); ++ ++ let mut s2 = HashSet::new(); ++ ++ s2.insert(1); ++ s2.insert(2); ++ ++ assert!(s1 != s2); ++ ++ s2.insert(3); ++ ++ assert_eq!(s1, s2); ++ } ++ ++ #[test] ++ fn test_show() { ++ let mut set = HashSet::new(); ++ let empty = HashSet::::new(); ++ ++ set.insert(1); ++ set.insert(2); ++ ++ let set_str = format!("{set:?}"); ++ ++ assert!(set_str == "{1, 2}" || set_str == "{2, 1}"); ++ assert_eq!(format!("{empty:?}"), "{}"); ++ } ++ ++ #[test] ++ fn test_trivial_drain() { ++ let mut s = HashSet::::new(); ++ for _ in s.drain() {} ++ assert!(s.is_empty()); ++ drop(s); ++ ++ let mut s = HashSet::::new(); ++ drop(s.drain()); ++ assert!(s.is_empty()); ++ } ++ ++ #[test] ++ fn test_drain() { ++ let mut s: HashSet<_> = (1..100).collect(); ++ ++ // try this a bunch of times to make sure we don't screw up internal state. ++ for _ in 0..20 { ++ assert_eq!(s.len(), 99); ++ ++ { ++ let mut last_i = 0; ++ let mut d = s.drain(); ++ for (i, x) in d.by_ref().take(50).enumerate() { ++ last_i = i; ++ assert!(x != 0); ++ } ++ assert_eq!(last_i, 49); ++ } ++ ++ if !s.is_empty() { ++ panic!("s should be empty!"); ++ } ++ ++ // reset to try again. ++ s.extend(1..100); ++ } ++ } ++ ++ #[test] ++ fn test_replace() { ++ use core::hash; ++ ++ #[derive(Debug)] ++ #[allow(dead_code)] ++ struct Foo(&'static str, i32); ++ ++ impl PartialEq for Foo { ++ fn eq(&self, other: &Self) -> bool { ++ self.0 == other.0 ++ } ++ } ++ ++ impl Eq for Foo {} ++ ++ impl hash::Hash for Foo { ++ fn hash(&self, h: &mut H) { ++ self.0.hash(h); ++ } ++ } ++ ++ let mut s = HashSet::new(); ++ assert_eq!(s.replace(Foo("a", 1)), None); ++ assert_eq!(s.len(), 1); ++ assert_eq!(s.replace(Foo("a", 2)), Some(Foo("a", 1))); ++ assert_eq!(s.len(), 1); ++ ++ let mut it = s.iter(); ++ assert_eq!(it.next(), Some(&Foo("a", 2))); ++ assert_eq!(it.next(), None); ++ } ++ ++ #[test] ++ #[allow(clippy::needless_borrow)] ++ fn test_extend_ref() { ++ let mut a = HashSet::new(); ++ a.insert(1); ++ ++ a.extend([2, 3, 4]); ++ ++ assert_eq!(a.len(), 4); ++ assert!(a.contains(&1)); ++ assert!(a.contains(&2)); ++ assert!(a.contains(&3)); ++ assert!(a.contains(&4)); ++ ++ let mut b = HashSet::new(); ++ b.insert(5); ++ b.insert(6); ++ ++ a.extend(&b); ++ ++ assert_eq!(a.len(), 6); ++ assert!(a.contains(&1)); ++ assert!(a.contains(&2)); ++ assert!(a.contains(&3)); ++ assert!(a.contains(&4)); ++ assert!(a.contains(&5)); ++ assert!(a.contains(&6)); ++ } ++ ++ #[test] ++ fn test_retain() { ++ let xs = [1, 2, 3, 4, 5, 6]; ++ let mut set: HashSet = xs.iter().copied().collect(); ++ set.retain(|&k| k % 2 == 0); ++ assert_eq!(set.len(), 3); ++ assert!(set.contains(&2)); ++ assert!(set.contains(&4)); ++ assert!(set.contains(&6)); ++ } ++ ++ #[test] ++ fn test_extract_if() { ++ { ++ let mut set: HashSet = (0..8).collect(); ++ let drained = set.extract_if(|&k| k % 2 == 0); ++ let mut out = drained.collect::>(); ++ out.sort_unstable(); ++ assert_eq!(vec![0, 2, 4, 6], out); ++ assert_eq!(set.len(), 4); ++ } ++ { ++ let mut set: HashSet = (0..8).collect(); ++ set.extract_if(|&k| k % 2 == 0).for_each(drop); ++ assert_eq!(set.len(), 4, "Removes non-matching items on drop"); ++ } ++ } ++ ++ #[test] ++ fn test_const_with_hasher() { ++ use core::hash::BuildHasher; ++ use std::collections::hash_map::DefaultHasher; ++ ++ #[derive(Clone)] ++ struct MyHasher; ++ impl BuildHasher for MyHasher { ++ type Hasher = DefaultHasher; ++ ++ fn build_hasher(&self) -> DefaultHasher { ++ DefaultHasher::new() ++ } ++ } ++ ++ const EMPTY_SET: HashSet = HashSet::with_hasher(MyHasher); ++ ++ let mut set = EMPTY_SET; ++ set.insert(19); ++ assert!(set.contains(&19)); ++ } ++ ++ #[test] ++ fn rehash_in_place() { ++ let mut set = HashSet::new(); ++ ++ for i in 0..224 { ++ set.insert(i); ++ } ++ ++ assert_eq!( ++ set.capacity(), ++ 224, ++ "The set must be at or close to capacity to trigger a re hashing" ++ ); ++ ++ for i in 100..1400 { ++ set.remove(&(i - 100)); ++ set.insert(i); ++ } ++ } ++ ++ #[test] ++ fn collect() { ++ // At the time of writing, this hits the ZST case in from_base_index ++ // (and without the `map`, it does not). ++ let mut _set: HashSet<_> = (0..3).map(|_| ()).collect(); ++ } ++} +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/src/table.rs mesa-25.3.3/subprojects/hashbrown-0.14.5/src/table.rs +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/src/table.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/src/table.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,2070 @@ ++use core::{fmt, iter::FusedIterator, marker::PhantomData}; ++ ++use crate::{ ++ raw::{ ++ Allocator, Bucket, Global, InsertSlot, RawDrain, RawExtractIf, RawIntoIter, RawIter, ++ RawTable, ++ }, ++ TryReserveError, ++}; ++ ++/// Low-level hash table with explicit hashing. ++/// ++/// The primary use case for this type over [`HashMap`] or [`HashSet`] is to ++/// support types that do not implement the [`Hash`] and [`Eq`] traits, but ++/// instead require additional data not contained in the key itself to compute a ++/// hash and compare two elements for equality. ++/// ++/// Examples of when this can be useful include: ++/// - An `IndexMap` implementation where indices into a `Vec` are stored as ++/// elements in a `HashTable`. Hashing and comparing the elements ++/// requires indexing the associated `Vec` to get the actual value referred to ++/// by the index. ++/// - Avoiding re-computing a hash when it is already known. ++/// - Mutating the key of an element in a way that doesn't affect its hash. ++/// ++/// To achieve this, `HashTable` methods that search for an element in the table ++/// require a hash value and equality function to be explicitly passed in as ++/// arguments. The method will then iterate over the elements with the given ++/// hash and call the equality function on each of them, until a match is found. ++/// ++/// In most cases, a `HashTable` will not be exposed directly in an API. It will ++/// instead be wrapped in a helper type which handles the work of calculating ++/// hash values and comparing elements. ++/// ++/// Due to its low-level nature, this type provides fewer guarantees than ++/// [`HashMap`] and [`HashSet`]. Specifically, the API allows you to shoot ++/// yourself in the foot by having multiple elements with identical keys in the ++/// table. The table itself will still function correctly and lookups will ++/// arbitrarily return one of the matching elements. However you should avoid ++/// doing this because it changes the runtime of hash table operations from ++/// `O(1)` to `O(k)` where `k` is the number of duplicate entries. ++/// ++/// [`HashMap`]: super::HashMap ++/// [`HashSet`]: super::HashSet ++pub struct HashTable ++where ++ A: Allocator, ++{ ++ pub(crate) raw: RawTable, ++} ++ ++impl HashTable { ++ /// Creates an empty `HashTable`. ++ /// ++ /// The hash table is initially created with a capacity of 0, so it will not allocate until it ++ /// is first inserted into. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashTable; ++ /// let mut table: HashTable<&str> = HashTable::new(); ++ /// assert_eq!(table.len(), 0); ++ /// assert_eq!(table.capacity(), 0); ++ /// ``` ++ pub const fn new() -> Self { ++ Self { ++ raw: RawTable::new(), ++ } ++ } ++ ++ /// Creates an empty `HashTable` with the specified capacity. ++ /// ++ /// The hash table will be able to hold at least `capacity` elements without ++ /// reallocating. If `capacity` is 0, the hash table will not allocate. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashTable; ++ /// let mut table: HashTable<&str> = HashTable::with_capacity(10); ++ /// assert_eq!(table.len(), 0); ++ /// assert!(table.capacity() >= 10); ++ /// ``` ++ pub fn with_capacity(capacity: usize) -> Self { ++ Self { ++ raw: RawTable::with_capacity(capacity), ++ } ++ } ++} ++ ++impl HashTable ++where ++ A: Allocator, ++{ ++ /// Creates an empty `HashTable` using the given allocator. ++ /// ++ /// The hash table is initially created with a capacity of 0, so it will not allocate until it ++ /// is first inserted into. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// # #[cfg(feature = "nightly")] ++ /// # fn test() { ++ /// use ahash::AHasher; ++ /// use bumpalo::Bump; ++ /// use hashbrown::HashTable; ++ /// use std::hash::{BuildHasher, BuildHasherDefault}; ++ /// ++ /// let bump = Bump::new(); ++ /// let mut table = HashTable::new_in(&bump); ++ /// let hasher = BuildHasherDefault::::default(); ++ /// let hasher = |val: &_| hasher.hash_one(val); ++ /// ++ /// // The created HashTable holds none elements ++ /// assert_eq!(table.len(), 0); ++ /// ++ /// // The created HashTable also doesn't allocate memory ++ /// assert_eq!(table.capacity(), 0); ++ /// ++ /// // Now we insert element inside created HashTable ++ /// table.insert_unique(hasher(&"One"), "One", hasher); ++ /// // We can see that the HashTable holds 1 element ++ /// assert_eq!(table.len(), 1); ++ /// // And it also allocates some capacity ++ /// assert!(table.capacity() > 1); ++ /// # } ++ /// # fn main() { ++ /// # #[cfg(feature = "nightly")] ++ /// # test() ++ /// # } ++ /// ``` ++ pub const fn new_in(alloc: A) -> Self { ++ Self { ++ raw: RawTable::new_in(alloc), ++ } ++ } ++ ++ /// Creates an empty `HashTable` with the specified capacity using the given allocator. ++ /// ++ /// The hash table will be able to hold at least `capacity` elements without ++ /// reallocating. If `capacity` is 0, the hash table will not allocate. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// # #[cfg(feature = "nightly")] ++ /// # fn test() { ++ /// use ahash::AHasher; ++ /// use bumpalo::Bump; ++ /// use hashbrown::HashTable; ++ /// use std::hash::{BuildHasher, BuildHasherDefault}; ++ /// ++ /// let bump = Bump::new(); ++ /// let mut table = HashTable::with_capacity_in(5, &bump); ++ /// let hasher = BuildHasherDefault::::default(); ++ /// let hasher = |val: &_| hasher.hash_one(val); ++ /// ++ /// // The created HashTable holds none elements ++ /// assert_eq!(table.len(), 0); ++ /// // But it can hold at least 5 elements without reallocating ++ /// let empty_map_capacity = table.capacity(); ++ /// assert!(empty_map_capacity >= 5); ++ /// ++ /// // Now we insert some 5 elements inside created HashTable ++ /// table.insert_unique(hasher(&"One"), "One", hasher); ++ /// table.insert_unique(hasher(&"Two"), "Two", hasher); ++ /// table.insert_unique(hasher(&"Three"), "Three", hasher); ++ /// table.insert_unique(hasher(&"Four"), "Four", hasher); ++ /// table.insert_unique(hasher(&"Five"), "Five", hasher); ++ /// ++ /// // We can see that the HashTable holds 5 elements ++ /// assert_eq!(table.len(), 5); ++ /// // But its capacity isn't changed ++ /// assert_eq!(table.capacity(), empty_map_capacity) ++ /// # } ++ /// # fn main() { ++ /// # #[cfg(feature = "nightly")] ++ /// # test() ++ /// # } ++ /// ``` ++ pub fn with_capacity_in(capacity: usize, alloc: A) -> Self { ++ Self { ++ raw: RawTable::with_capacity_in(capacity, alloc), ++ } ++ } ++ ++ /// Returns a reference to the underlying allocator. ++ pub fn allocator(&self) -> &A { ++ self.raw.allocator() ++ } ++ ++ /// Returns a reference to an entry in the table with the given hash and ++ /// which satisfies the equality function passed. ++ /// ++ /// This method will call `eq` for all entries with the given hash, but may ++ /// also call it for entries with a different hash. `eq` should only return ++ /// true for the desired entry, at which point the search is stopped. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// # #[cfg(feature = "nightly")] ++ /// # fn test() { ++ /// use ahash::AHasher; ++ /// use hashbrown::HashTable; ++ /// use std::hash::{BuildHasher, BuildHasherDefault}; ++ /// ++ /// let mut table = HashTable::new(); ++ /// let hasher = BuildHasherDefault::::default(); ++ /// let hasher = |val: &_| hasher.hash_one(val); ++ /// table.insert_unique(hasher(&1), 1, hasher); ++ /// table.insert_unique(hasher(&2), 2, hasher); ++ /// table.insert_unique(hasher(&3), 3, hasher); ++ /// assert_eq!(table.find(hasher(&2), |&val| val == 2), Some(&2)); ++ /// assert_eq!(table.find(hasher(&4), |&val| val == 4), None); ++ /// # } ++ /// # fn main() { ++ /// # #[cfg(feature = "nightly")] ++ /// # test() ++ /// # } ++ /// ``` ++ pub fn find(&self, hash: u64, eq: impl FnMut(&T) -> bool) -> Option<&T> { ++ self.raw.get(hash, eq) ++ } ++ ++ /// Returns a mutable reference to an entry in the table with the given hash ++ /// and which satisfies the equality function passed. ++ /// ++ /// This method will call `eq` for all entries with the given hash, but may ++ /// also call it for entries with a different hash. `eq` should only return ++ /// true for the desired entry, at which point the search is stopped. ++ /// ++ /// When mutating an entry, you should ensure that it still retains the same ++ /// hash value as when it was inserted, otherwise lookups of that entry may ++ /// fail to find it. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// # #[cfg(feature = "nightly")] ++ /// # fn test() { ++ /// use ahash::AHasher; ++ /// use hashbrown::HashTable; ++ /// use std::hash::{BuildHasher, BuildHasherDefault}; ++ /// ++ /// let mut table = HashTable::new(); ++ /// let hasher = BuildHasherDefault::::default(); ++ /// let hasher = |val: &_| hasher.hash_one(val); ++ /// table.insert_unique(hasher(&1), (1, "a"), |val| hasher(&val.0)); ++ /// if let Some(val) = table.find_mut(hasher(&1), |val| val.0 == 1) { ++ /// val.1 = "b"; ++ /// } ++ /// assert_eq!(table.find(hasher(&1), |val| val.0 == 1), Some(&(1, "b"))); ++ /// assert_eq!(table.find(hasher(&2), |val| val.0 == 2), None); ++ /// # } ++ /// # fn main() { ++ /// # #[cfg(feature = "nightly")] ++ /// # test() ++ /// # } ++ /// ``` ++ pub fn find_mut(&mut self, hash: u64, eq: impl FnMut(&T) -> bool) -> Option<&mut T> { ++ self.raw.get_mut(hash, eq) ++ } ++ ++ /// Returns an `OccupiedEntry` for an entry in the table with the given hash ++ /// and which satisfies the equality function passed. ++ /// ++ /// This can be used to remove the entry from the table. Call ++ /// [`HashTable::entry`] instead if you wish to insert an entry if the ++ /// lookup fails. ++ /// ++ /// This method will call `eq` for all entries with the given hash, but may ++ /// also call it for entries with a different hash. `eq` should only return ++ /// true for the desired entry, at which point the search is stopped. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// # #[cfg(feature = "nightly")] ++ /// # fn test() { ++ /// use ahash::AHasher; ++ /// use hashbrown::HashTable; ++ /// use std::hash::{BuildHasher, BuildHasherDefault}; ++ /// ++ /// let mut table = HashTable::new(); ++ /// let hasher = BuildHasherDefault::::default(); ++ /// let hasher = |val: &_| hasher.hash_one(val); ++ /// table.insert_unique(hasher(&1), (1, "a"), |val| hasher(&val.0)); ++ /// if let Ok(entry) = table.find_entry(hasher(&1), |val| val.0 == 1) { ++ /// entry.remove(); ++ /// } ++ /// assert_eq!(table.find(hasher(&1), |val| val.0 == 1), None); ++ /// # } ++ /// # fn main() { ++ /// # #[cfg(feature = "nightly")] ++ /// # test() ++ /// # } ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn find_entry( ++ &mut self, ++ hash: u64, ++ eq: impl FnMut(&T) -> bool, ++ ) -> Result, AbsentEntry<'_, T, A>> { ++ match self.raw.find(hash, eq) { ++ Some(bucket) => Ok(OccupiedEntry { ++ hash, ++ bucket, ++ table: self, ++ }), ++ None => Err(AbsentEntry { table: self }), ++ } ++ } ++ ++ /// Returns an `Entry` for an entry in the table with the given hash ++ /// and which satisfies the equality function passed. ++ /// ++ /// This can be used to remove the entry from the table, or insert a new ++ /// entry with the given hash if one doesn't already exist. ++ /// ++ /// This method will call `eq` for all entries with the given hash, but may ++ /// also call it for entries with a different hash. `eq` should only return ++ /// true for the desired entry, at which point the search is stopped. ++ /// ++ /// This method may grow the table in preparation for an insertion. Call ++ /// [`HashTable::find_entry`] if this is undesirable. ++ /// ++ /// `hasher` is called if entries need to be moved or copied to a new table. ++ /// This must return the same hash value that each entry was inserted with. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// # #[cfg(feature = "nightly")] ++ /// # fn test() { ++ /// use ahash::AHasher; ++ /// use hashbrown::hash_table::Entry; ++ /// use hashbrown::HashTable; ++ /// use std::hash::{BuildHasher, BuildHasherDefault}; ++ /// ++ /// let mut table = HashTable::new(); ++ /// let hasher = BuildHasherDefault::::default(); ++ /// let hasher = |val: &_| hasher.hash_one(val); ++ /// table.insert_unique(hasher(&1), (1, "a"), |val| hasher(&val.0)); ++ /// if let Entry::Occupied(entry) = table.entry(hasher(&1), |val| val.0 == 1, |val| hasher(&val.0)) ++ /// { ++ /// entry.remove(); ++ /// } ++ /// if let Entry::Vacant(entry) = table.entry(hasher(&2), |val| val.0 == 2, |val| hasher(&val.0)) { ++ /// entry.insert((2, "b")); ++ /// } ++ /// assert_eq!(table.find(hasher(&1), |val| val.0 == 1), None); ++ /// assert_eq!(table.find(hasher(&2), |val| val.0 == 2), Some(&(2, "b"))); ++ /// # } ++ /// # fn main() { ++ /// # #[cfg(feature = "nightly")] ++ /// # test() ++ /// # } ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn entry( ++ &mut self, ++ hash: u64, ++ eq: impl FnMut(&T) -> bool, ++ hasher: impl Fn(&T) -> u64, ++ ) -> Entry<'_, T, A> { ++ match self.raw.find_or_find_insert_slot(hash, eq, hasher) { ++ Ok(bucket) => Entry::Occupied(OccupiedEntry { ++ hash, ++ bucket, ++ table: self, ++ }), ++ Err(insert_slot) => Entry::Vacant(VacantEntry { ++ hash, ++ insert_slot, ++ table: self, ++ }), ++ } ++ } ++ ++ /// Inserts an element into the `HashTable` with the given hash value, but ++ /// without checking whether an equivalent element already exists within the ++ /// table. ++ /// ++ /// `hasher` is called if entries need to be moved or copied to a new table. ++ /// This must return the same hash value that each entry was inserted with. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// # #[cfg(feature = "nightly")] ++ /// # fn test() { ++ /// use ahash::AHasher; ++ /// use hashbrown::HashTable; ++ /// use std::hash::{BuildHasher, BuildHasherDefault}; ++ /// ++ /// let mut v = HashTable::new(); ++ /// let hasher = BuildHasherDefault::::default(); ++ /// let hasher = |val: &_| hasher.hash_one(val); ++ /// v.insert_unique(hasher(&1), 1, hasher); ++ /// # } ++ /// # fn main() { ++ /// # #[cfg(feature = "nightly")] ++ /// # test() ++ /// # } ++ /// ``` ++ pub fn insert_unique( ++ &mut self, ++ hash: u64, ++ value: T, ++ hasher: impl Fn(&T) -> u64, ++ ) -> OccupiedEntry<'_, T, A> { ++ let bucket = self.raw.insert(hash, value, hasher); ++ OccupiedEntry { ++ hash, ++ bucket, ++ table: self, ++ } ++ } ++ ++ /// Clears the table, removing all values. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// # #[cfg(feature = "nightly")] ++ /// # fn test() { ++ /// use ahash::AHasher; ++ /// use hashbrown::HashTable; ++ /// use std::hash::{BuildHasher, BuildHasherDefault}; ++ /// ++ /// let mut v = HashTable::new(); ++ /// let hasher = BuildHasherDefault::::default(); ++ /// let hasher = |val: &_| hasher.hash_one(val); ++ /// v.insert_unique(hasher(&1), 1, hasher); ++ /// v.clear(); ++ /// assert!(v.is_empty()); ++ /// # } ++ /// # fn main() { ++ /// # #[cfg(feature = "nightly")] ++ /// # test() ++ /// # } ++ /// ``` ++ pub fn clear(&mut self) { ++ self.raw.clear(); ++ } ++ ++ /// Shrinks the capacity of the table as much as possible. It will drop ++ /// down as much as possible while maintaining the internal rules ++ /// and possibly leaving some space in accordance with the resize policy. ++ /// ++ /// `hasher` is called if entries need to be moved or copied to a new table. ++ /// This must return the same hash value that each entry was inserted with. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// # #[cfg(feature = "nightly")] ++ /// # fn test() { ++ /// use ahash::AHasher; ++ /// use hashbrown::HashTable; ++ /// use std::hash::{BuildHasher, BuildHasherDefault}; ++ /// ++ /// let mut table = HashTable::with_capacity(100); ++ /// let hasher = BuildHasherDefault::::default(); ++ /// let hasher = |val: &_| hasher.hash_one(val); ++ /// table.insert_unique(hasher(&1), 1, hasher); ++ /// table.insert_unique(hasher(&2), 2, hasher); ++ /// assert!(table.capacity() >= 100); ++ /// table.shrink_to_fit(hasher); ++ /// assert!(table.capacity() >= 2); ++ /// # } ++ /// # fn main() { ++ /// # #[cfg(feature = "nightly")] ++ /// # test() ++ /// # } ++ /// ``` ++ pub fn shrink_to_fit(&mut self, hasher: impl Fn(&T) -> u64) { ++ self.raw.shrink_to(self.len(), hasher) ++ } ++ ++ /// Shrinks the capacity of the table with a lower limit. It will drop ++ /// down no lower than the supplied limit while maintaining the internal rules ++ /// and possibly leaving some space in accordance with the resize policy. ++ /// ++ /// `hasher` is called if entries need to be moved or copied to a new table. ++ /// This must return the same hash value that each entry was inserted with. ++ /// ++ /// Panics if the current capacity is smaller than the supplied ++ /// minimum capacity. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// # #[cfg(feature = "nightly")] ++ /// # fn test() { ++ /// use ahash::AHasher; ++ /// use hashbrown::HashTable; ++ /// use std::hash::{BuildHasher, BuildHasherDefault}; ++ /// ++ /// let mut table = HashTable::with_capacity(100); ++ /// let hasher = BuildHasherDefault::::default(); ++ /// let hasher = |val: &_| hasher.hash_one(val); ++ /// table.insert_unique(hasher(&1), 1, hasher); ++ /// table.insert_unique(hasher(&2), 2, hasher); ++ /// assert!(table.capacity() >= 100); ++ /// table.shrink_to(10, hasher); ++ /// assert!(table.capacity() >= 10); ++ /// table.shrink_to(0, hasher); ++ /// assert!(table.capacity() >= 2); ++ /// # } ++ /// # fn main() { ++ /// # #[cfg(feature = "nightly")] ++ /// # test() ++ /// # } ++ /// ``` ++ pub fn shrink_to(&mut self, min_capacity: usize, hasher: impl Fn(&T) -> u64) { ++ self.raw.shrink_to(min_capacity, hasher); ++ } ++ ++ /// Reserves capacity for at least `additional` more elements to be inserted ++ /// in the `HashTable`. The collection may reserve more space to avoid ++ /// frequent reallocations. ++ /// ++ /// `hasher` is called if entries need to be moved or copied to a new table. ++ /// This must return the same hash value that each entry was inserted with. ++ /// ++ /// # Panics ++ /// ++ /// Panics if the new capacity exceeds [`isize::MAX`] bytes and [`abort`] the program ++ /// in case of allocation error. Use [`try_reserve`](HashTable::try_reserve) instead ++ /// if you want to handle memory allocation failure. ++ /// ++ /// [`isize::MAX`]: https://doc.rust-lang.org/std/primitive.isize.html ++ /// [`abort`]: https://doc.rust-lang.org/alloc/alloc/fn.handle_alloc_error.html ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// # #[cfg(feature = "nightly")] ++ /// # fn test() { ++ /// use ahash::AHasher; ++ /// use hashbrown::HashTable; ++ /// use std::hash::{BuildHasher, BuildHasherDefault}; ++ /// ++ /// let mut table: HashTable = HashTable::new(); ++ /// let hasher = BuildHasherDefault::::default(); ++ /// let hasher = |val: &_| hasher.hash_one(val); ++ /// table.reserve(10, hasher); ++ /// assert!(table.capacity() >= 10); ++ /// # } ++ /// # fn main() { ++ /// # #[cfg(feature = "nightly")] ++ /// # test() ++ /// # } ++ /// ``` ++ pub fn reserve(&mut self, additional: usize, hasher: impl Fn(&T) -> u64) { ++ self.raw.reserve(additional, hasher) ++ } ++ ++ /// Tries to reserve capacity for at least `additional` more elements to be inserted ++ /// in the given `HashTable`. The collection may reserve more space to avoid ++ /// frequent reallocations. ++ /// ++ /// `hasher` is called if entries need to be moved or copied to a new table. ++ /// This must return the same hash value that each entry was inserted with. ++ /// ++ /// # Errors ++ /// ++ /// If the capacity overflows, or the allocator reports a failure, then an error ++ /// is returned. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// # #[cfg(feature = "nightly")] ++ /// # fn test() { ++ /// use ahash::AHasher; ++ /// use hashbrown::HashTable; ++ /// use std::hash::{BuildHasher, BuildHasherDefault}; ++ /// ++ /// let mut table: HashTable = HashTable::new(); ++ /// let hasher = BuildHasherDefault::::default(); ++ /// let hasher = |val: &_| hasher.hash_one(val); ++ /// table ++ /// .try_reserve(10, hasher) ++ /// .expect("why is the test harness OOMing on 10 bytes?"); ++ /// # } ++ /// # fn main() { ++ /// # #[cfg(feature = "nightly")] ++ /// # test() ++ /// # } ++ /// ``` ++ pub fn try_reserve( ++ &mut self, ++ additional: usize, ++ hasher: impl Fn(&T) -> u64, ++ ) -> Result<(), TryReserveError> { ++ self.raw.try_reserve(additional, hasher) ++ } ++ ++ /// Returns the number of elements the table can hold without reallocating. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use hashbrown::HashTable; ++ /// let table: HashTable = HashTable::with_capacity(100); ++ /// assert!(table.capacity() >= 100); ++ /// ``` ++ pub fn capacity(&self) -> usize { ++ self.raw.capacity() ++ } ++ ++ /// Returns the number of elements in the table. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// # #[cfg(feature = "nightly")] ++ /// # fn test() { ++ /// use ahash::AHasher; ++ /// use hashbrown::HashTable; ++ /// use std::hash::{BuildHasher, BuildHasherDefault}; ++ /// ++ /// let hasher = BuildHasherDefault::::default(); ++ /// let hasher = |val: &_| hasher.hash_one(val); ++ /// let mut v = HashTable::new(); ++ /// assert_eq!(v.len(), 0); ++ /// v.insert_unique(hasher(&1), 1, hasher); ++ /// assert_eq!(v.len(), 1); ++ /// # } ++ /// # fn main() { ++ /// # #[cfg(feature = "nightly")] ++ /// # test() ++ /// # } ++ /// ``` ++ pub fn len(&self) -> usize { ++ self.raw.len() ++ } ++ ++ /// Returns `true` if the set contains no elements. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// # #[cfg(feature = "nightly")] ++ /// # fn test() { ++ /// use ahash::AHasher; ++ /// use hashbrown::HashTable; ++ /// use std::hash::{BuildHasher, BuildHasherDefault}; ++ /// ++ /// let hasher = BuildHasherDefault::::default(); ++ /// let hasher = |val: &_| hasher.hash_one(val); ++ /// let mut v = HashTable::new(); ++ /// assert!(v.is_empty()); ++ /// v.insert_unique(hasher(&1), 1, hasher); ++ /// assert!(!v.is_empty()); ++ /// # } ++ /// # fn main() { ++ /// # #[cfg(feature = "nightly")] ++ /// # test() ++ /// # } ++ /// ``` ++ pub fn is_empty(&self) -> bool { ++ self.raw.is_empty() ++ } ++ ++ /// An iterator visiting all elements in arbitrary order. ++ /// The iterator element type is `&'a T`. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// # #[cfg(feature = "nightly")] ++ /// # fn test() { ++ /// use ahash::AHasher; ++ /// use hashbrown::HashTable; ++ /// use std::hash::{BuildHasher, BuildHasherDefault}; ++ /// ++ /// let mut table = HashTable::new(); ++ /// let hasher = BuildHasherDefault::::default(); ++ /// let hasher = |val: &_| hasher.hash_one(val); ++ /// table.insert_unique(hasher(&"a"), "b", hasher); ++ /// table.insert_unique(hasher(&"b"), "b", hasher); ++ /// ++ /// // Will print in an arbitrary order. ++ /// for x in table.iter() { ++ /// println!("{}", x); ++ /// } ++ /// # } ++ /// # fn main() { ++ /// # #[cfg(feature = "nightly")] ++ /// # test() ++ /// # } ++ /// ``` ++ pub fn iter(&self) -> Iter<'_, T> { ++ Iter { ++ inner: unsafe { self.raw.iter() }, ++ marker: PhantomData, ++ } ++ } ++ ++ /// An iterator visiting all elements in arbitrary order, ++ /// with mutable references to the elements. ++ /// The iterator element type is `&'a mut T`. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// # #[cfg(feature = "nightly")] ++ /// # fn test() { ++ /// use ahash::AHasher; ++ /// use hashbrown::HashTable; ++ /// use std::hash::{BuildHasher, BuildHasherDefault}; ++ /// ++ /// let mut table = HashTable::new(); ++ /// let hasher = BuildHasherDefault::::default(); ++ /// let hasher = |val: &_| hasher.hash_one(val); ++ /// table.insert_unique(hasher(&1), 1, hasher); ++ /// table.insert_unique(hasher(&2), 2, hasher); ++ /// table.insert_unique(hasher(&3), 3, hasher); ++ /// ++ /// // Update all values ++ /// for val in table.iter_mut() { ++ /// *val *= 2; ++ /// } ++ /// ++ /// assert_eq!(table.len(), 3); ++ /// let mut vec: Vec = Vec::new(); ++ /// ++ /// for val in &table { ++ /// println!("val: {}", val); ++ /// vec.push(*val); ++ /// } ++ /// ++ /// // The `Iter` iterator produces items in arbitrary order, so the ++ /// // items must be sorted to test them against a sorted array. ++ /// vec.sort_unstable(); ++ /// assert_eq!(vec, [2, 4, 6]); ++ /// ++ /// assert_eq!(table.len(), 3); ++ /// # } ++ /// # fn main() { ++ /// # #[cfg(feature = "nightly")] ++ /// # test() ++ /// # } ++ /// ``` ++ pub fn iter_mut(&mut self) -> IterMut<'_, T> { ++ IterMut { ++ inner: unsafe { self.raw.iter() }, ++ marker: PhantomData, ++ } ++ } ++ ++ /// Retains only the elements specified by the predicate. ++ /// ++ /// In other words, remove all elements `e` such that `f(&e)` returns `false`. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// # #[cfg(feature = "nightly")] ++ /// # fn test() { ++ /// use ahash::AHasher; ++ /// use hashbrown::HashTable; ++ /// use std::hash::{BuildHasher, BuildHasherDefault}; ++ /// ++ /// let mut table = HashTable::new(); ++ /// let hasher = BuildHasherDefault::::default(); ++ /// let hasher = |val: &_| hasher.hash_one(val); ++ /// for x in 1..=6 { ++ /// table.insert_unique(hasher(&x), x, hasher); ++ /// } ++ /// table.retain(|&mut x| x % 2 == 0); ++ /// assert_eq!(table.len(), 3); ++ /// # } ++ /// # fn main() { ++ /// # #[cfg(feature = "nightly")] ++ /// # test() ++ /// # } ++ /// ``` ++ pub fn retain(&mut self, mut f: impl FnMut(&mut T) -> bool) { ++ // Here we only use `iter` as a temporary, preventing use-after-free ++ unsafe { ++ for item in self.raw.iter() { ++ if !f(item.as_mut()) { ++ self.raw.erase(item); ++ } ++ } ++ } ++ } ++ ++ /// Clears the set, returning all elements in an iterator. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// # #[cfg(feature = "nightly")] ++ /// # fn test() { ++ /// use ahash::AHasher; ++ /// use hashbrown::HashTable; ++ /// use std::hash::{BuildHasher, BuildHasherDefault}; ++ /// ++ /// let mut table = HashTable::new(); ++ /// let hasher = BuildHasherDefault::::default(); ++ /// let hasher = |val: &_| hasher.hash_one(val); ++ /// for x in 1..=3 { ++ /// table.insert_unique(hasher(&x), x, hasher); ++ /// } ++ /// assert!(!table.is_empty()); ++ /// ++ /// // print 1, 2, 3 in an arbitrary order ++ /// for i in table.drain() { ++ /// println!("{}", i); ++ /// } ++ /// ++ /// assert!(table.is_empty()); ++ /// # } ++ /// # fn main() { ++ /// # #[cfg(feature = "nightly")] ++ /// # test() ++ /// # } ++ /// ``` ++ pub fn drain(&mut self) -> Drain<'_, T, A> { ++ Drain { ++ inner: self.raw.drain(), ++ } ++ } ++ ++ /// Drains elements which are true under the given predicate, ++ /// and returns an iterator over the removed items. ++ /// ++ /// In other words, move all elements `e` such that `f(&e)` returns `true` out ++ /// into another iterator. ++ /// ++ /// If the returned `ExtractIf` is not exhausted, e.g. because it is dropped without iterating ++ /// or the iteration short-circuits, then the remaining elements will be retained. ++ /// Use [`retain()`] with a negated predicate if you do not need the returned iterator. ++ /// ++ /// [`retain()`]: HashTable::retain ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// # #[cfg(feature = "nightly")] ++ /// # fn test() { ++ /// use ahash::AHasher; ++ /// use hashbrown::HashTable; ++ /// use std::hash::{BuildHasher, BuildHasherDefault}; ++ /// ++ /// let mut table = HashTable::new(); ++ /// let hasher = BuildHasherDefault::::default(); ++ /// let hasher = |val: &_| hasher.hash_one(val); ++ /// for x in 0..8 { ++ /// table.insert_unique(hasher(&x), x, hasher); ++ /// } ++ /// let drained: Vec = table.extract_if(|&mut v| v % 2 == 0).collect(); ++ /// ++ /// let mut evens = drained.into_iter().collect::>(); ++ /// let mut odds = table.into_iter().collect::>(); ++ /// evens.sort(); ++ /// odds.sort(); ++ /// ++ /// assert_eq!(evens, vec![0, 2, 4, 6]); ++ /// assert_eq!(odds, vec![1, 3, 5, 7]); ++ /// # } ++ /// # fn main() { ++ /// # #[cfg(feature = "nightly")] ++ /// # test() ++ /// # } ++ /// ``` ++ pub fn extract_if(&mut self, f: F) -> ExtractIf<'_, T, F, A> ++ where ++ F: FnMut(&mut T) -> bool, ++ { ++ ExtractIf { ++ f, ++ inner: RawExtractIf { ++ iter: unsafe { self.raw.iter() }, ++ table: &mut self.raw, ++ }, ++ } ++ } ++ ++ /// Attempts to get mutable references to `N` values in the map at once. ++ /// ++ /// The `eq` argument should be a closure such that `eq(i, k)` returns true if `k` is equal to ++ /// the `i`th key to be looked up. ++ /// ++ /// Returns an array of length `N` with the results of each query. For soundness, at most one ++ /// mutable reference will be returned to any value. `None` will be returned if any of the ++ /// keys are duplicates or missing. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// # #[cfg(feature = "nightly")] ++ /// # fn test() { ++ /// use ahash::AHasher; ++ /// use hashbrown::hash_table::Entry; ++ /// use hashbrown::HashTable; ++ /// use std::hash::{BuildHasher, BuildHasherDefault}; ++ /// ++ /// let mut libraries: HashTable<(&str, u32)> = HashTable::new(); ++ /// let hasher = BuildHasherDefault::::default(); ++ /// let hasher = |val: &_| hasher.hash_one(val); ++ /// for (k, v) in [ ++ /// ("Bodleian Library", 1602), ++ /// ("Athenæum", 1807), ++ /// ("Herzogin-Anna-Amalia-Bibliothek", 1691), ++ /// ("Library of Congress", 1800), ++ /// ] { ++ /// libraries.insert_unique(hasher(&k), (k, v), |(k, _)| hasher(&k)); ++ /// } ++ /// ++ /// let keys = ["Athenæum", "Library of Congress"]; ++ /// let got = libraries.get_many_mut(keys.map(|k| hasher(&k)), |i, val| keys[i] == val.0); ++ /// assert_eq!( ++ /// got, ++ /// Some([&mut ("Athenæum", 1807), &mut ("Library of Congress", 1800),]), ++ /// ); ++ /// ++ /// // Missing keys result in None ++ /// let keys = ["Athenæum", "New York Public Library"]; ++ /// let got = libraries.get_many_mut(keys.map(|k| hasher(&k)), |i, val| keys[i] == val.0); ++ /// assert_eq!(got, None); ++ /// ++ /// // Duplicate keys result in None ++ /// let keys = ["Athenæum", "Athenæum"]; ++ /// let got = libraries.get_many_mut(keys.map(|k| hasher(&k)), |i, val| keys[i] == val.0); ++ /// assert_eq!(got, None); ++ /// # } ++ /// # fn main() { ++ /// # #[cfg(feature = "nightly")] ++ /// # test() ++ /// # } ++ /// ``` ++ pub fn get_many_mut( ++ &mut self, ++ hashes: [u64; N], ++ eq: impl FnMut(usize, &T) -> bool, ++ ) -> Option<[&'_ mut T; N]> { ++ self.raw.get_many_mut(hashes, eq) ++ } ++ ++ /// Attempts to get mutable references to `N` values in the map at once, without validating that ++ /// the values are unique. ++ /// ++ /// The `eq` argument should be a closure such that `eq(i, k)` returns true if `k` is equal to ++ /// the `i`th key to be looked up. ++ /// ++ /// Returns an array of length `N` with the results of each query. `None` will be returned if ++ /// any of the keys are missing. ++ /// ++ /// For a safe alternative see [`get_many_mut`](`HashTable::get_many_mut`). ++ /// ++ /// # Safety ++ /// ++ /// Calling this method with overlapping keys is *[undefined behavior]* even if the resulting ++ /// references are not used. ++ /// ++ /// [undefined behavior]: https://doc.rust-lang.org/reference/behavior-considered-undefined.html ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// # #[cfg(feature = "nightly")] ++ /// # fn test() { ++ /// use ahash::AHasher; ++ /// use hashbrown::hash_table::Entry; ++ /// use hashbrown::HashTable; ++ /// use std::hash::{BuildHasher, BuildHasherDefault}; ++ /// ++ /// let mut libraries: HashTable<(&str, u32)> = HashTable::new(); ++ /// let hasher = BuildHasherDefault::::default(); ++ /// let hasher = |val: &_| hasher.hash_one(val); ++ /// for (k, v) in [ ++ /// ("Bodleian Library", 1602), ++ /// ("Athenæum", 1807), ++ /// ("Herzogin-Anna-Amalia-Bibliothek", 1691), ++ /// ("Library of Congress", 1800), ++ /// ] { ++ /// libraries.insert_unique(hasher(&k), (k, v), |(k, _)| hasher(&k)); ++ /// } ++ /// ++ /// let keys = ["Athenæum", "Library of Congress"]; ++ /// let got = libraries.get_many_mut(keys.map(|k| hasher(&k)), |i, val| keys[i] == val.0); ++ /// assert_eq!( ++ /// got, ++ /// Some([&mut ("Athenæum", 1807), &mut ("Library of Congress", 1800),]), ++ /// ); ++ /// ++ /// // Missing keys result in None ++ /// let keys = ["Athenæum", "New York Public Library"]; ++ /// let got = libraries.get_many_mut(keys.map(|k| hasher(&k)), |i, val| keys[i] == val.0); ++ /// assert_eq!(got, None); ++ /// ++ /// // Duplicate keys result in None ++ /// let keys = ["Athenæum", "Athenæum"]; ++ /// let got = libraries.get_many_mut(keys.map(|k| hasher(&k)), |i, val| keys[i] == val.0); ++ /// assert_eq!(got, None); ++ /// # } ++ /// # fn main() { ++ /// # #[cfg(feature = "nightly")] ++ /// # test() ++ /// # } ++ /// ``` ++ pub unsafe fn get_many_unchecked_mut( ++ &mut self, ++ hashes: [u64; N], ++ eq: impl FnMut(usize, &T) -> bool, ++ ) -> Option<[&'_ mut T; N]> { ++ self.raw.get_many_unchecked_mut(hashes, eq) ++ } ++} ++ ++impl IntoIterator for HashTable ++where ++ A: Allocator, ++{ ++ type Item = T; ++ type IntoIter = IntoIter; ++ ++ fn into_iter(self) -> IntoIter { ++ IntoIter { ++ inner: self.raw.into_iter(), ++ } ++ } ++} ++ ++impl<'a, T, A> IntoIterator for &'a HashTable ++where ++ A: Allocator, ++{ ++ type Item = &'a T; ++ type IntoIter = Iter<'a, T>; ++ ++ fn into_iter(self) -> Iter<'a, T> { ++ self.iter() ++ } ++} ++ ++impl<'a, T, A> IntoIterator for &'a mut HashTable ++where ++ A: Allocator, ++{ ++ type Item = &'a mut T; ++ type IntoIter = IterMut<'a, T>; ++ ++ fn into_iter(self) -> IterMut<'a, T> { ++ self.iter_mut() ++ } ++} ++ ++impl Default for HashTable ++where ++ A: Allocator + Default, ++{ ++ fn default() -> Self { ++ Self { ++ raw: Default::default(), ++ } ++ } ++} ++ ++impl Clone for HashTable ++where ++ T: Clone, ++ A: Allocator + Clone, ++{ ++ fn clone(&self) -> Self { ++ Self { ++ raw: self.raw.clone(), ++ } ++ } ++} ++ ++impl fmt::Debug for HashTable ++where ++ T: fmt::Debug, ++ A: Allocator, ++{ ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_set().entries(self.iter()).finish() ++ } ++} ++ ++/// A view into a single entry in a table, which may either be vacant or occupied. ++/// ++/// This `enum` is constructed from the [`entry`] method on [`HashTable`]. ++/// ++/// [`HashTable`]: struct.HashTable.html ++/// [`entry`]: struct.HashTable.html#method.entry ++/// ++/// # Examples ++/// ++/// ``` ++/// # #[cfg(feature = "nightly")] ++/// # fn test() { ++/// use ahash::AHasher; ++/// use hashbrown::hash_table::{Entry, HashTable, OccupiedEntry}; ++/// use std::hash::{BuildHasher, BuildHasherDefault}; ++/// ++/// let mut table = HashTable::new(); ++/// let hasher = BuildHasherDefault::::default(); ++/// let hasher = |val: &_| hasher.hash_one(val); ++/// for x in ["a", "b", "c"] { ++/// table.insert_unique(hasher(&x), x, hasher); ++/// } ++/// assert_eq!(table.len(), 3); ++/// ++/// // Existing value (insert) ++/// let entry: Entry<_> = table.entry(hasher(&"a"), |&x| x == "a", hasher); ++/// let _raw_o: OccupiedEntry<_, _> = entry.insert("a"); ++/// assert_eq!(table.len(), 3); ++/// // Nonexistent value (insert) ++/// table.entry(hasher(&"d"), |&x| x == "d", hasher).insert("d"); ++/// ++/// // Existing value (or_insert) ++/// table ++/// .entry(hasher(&"b"), |&x| x == "b", hasher) ++/// .or_insert("b"); ++/// // Nonexistent value (or_insert) ++/// table ++/// .entry(hasher(&"e"), |&x| x == "e", hasher) ++/// .or_insert("e"); ++/// ++/// println!("Our HashTable: {:?}", table); ++/// ++/// let mut vec: Vec<_> = table.iter().copied().collect(); ++/// // The `Iter` iterator produces items in arbitrary order, so the ++/// // items must be sorted to test them against a sorted array. ++/// vec.sort_unstable(); ++/// assert_eq!(vec, ["a", "b", "c", "d", "e"]); ++/// # } ++/// # fn main() { ++/// # #[cfg(feature = "nightly")] ++/// # test() ++/// # } ++/// ``` ++pub enum Entry<'a, T, A = Global> ++where ++ A: Allocator, ++{ ++ /// An occupied entry. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// # #[cfg(feature = "nightly")] ++ /// # fn test() { ++ /// use ahash::AHasher; ++ /// use hashbrown::hash_table::{Entry, HashTable, OccupiedEntry}; ++ /// use std::hash::{BuildHasher, BuildHasherDefault}; ++ /// ++ /// let mut table = HashTable::new(); ++ /// let hasher = BuildHasherDefault::::default(); ++ /// let hasher = |val: &_| hasher.hash_one(val); ++ /// for x in ["a", "b"] { ++ /// table.insert_unique(hasher(&x), x, hasher); ++ /// } ++ /// ++ /// match table.entry(hasher(&"a"), |&x| x == "a", hasher) { ++ /// Entry::Vacant(_) => unreachable!(), ++ /// Entry::Occupied(_) => {} ++ /// } ++ /// # } ++ /// # fn main() { ++ /// # #[cfg(feature = "nightly")] ++ /// # test() ++ /// # } ++ /// ``` ++ Occupied(OccupiedEntry<'a, T, A>), ++ ++ /// A vacant entry. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// # #[cfg(feature = "nightly")] ++ /// # fn test() { ++ /// use ahash::AHasher; ++ /// use hashbrown::hash_table::{Entry, HashTable, OccupiedEntry}; ++ /// use std::hash::{BuildHasher, BuildHasherDefault}; ++ /// ++ /// let mut table = HashTable::<&str>::new(); ++ /// let hasher = BuildHasherDefault::::default(); ++ /// let hasher = |val: &_| hasher.hash_one(val); ++ /// ++ /// match table.entry(hasher(&"a"), |&x| x == "a", hasher) { ++ /// Entry::Vacant(_) => {} ++ /// Entry::Occupied(_) => unreachable!(), ++ /// } ++ /// # } ++ /// # fn main() { ++ /// # #[cfg(feature = "nightly")] ++ /// # test() ++ /// # } ++ /// ``` ++ Vacant(VacantEntry<'a, T, A>), ++} ++ ++impl fmt::Debug for Entry<'_, T, A> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ match *self { ++ Entry::Vacant(ref v) => f.debug_tuple("Entry").field(v).finish(), ++ Entry::Occupied(ref o) => f.debug_tuple("Entry").field(o).finish(), ++ } ++ } ++} ++ ++impl<'a, T, A> Entry<'a, T, A> ++where ++ A: Allocator, ++{ ++ /// Sets the value of the entry, replacing any existing value if there is ++ /// one, and returns an [`OccupiedEntry`]. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// # #[cfg(feature = "nightly")] ++ /// # fn test() { ++ /// use ahash::AHasher; ++ /// use hashbrown::HashTable; ++ /// use std::hash::{BuildHasher, BuildHasherDefault}; ++ /// ++ /// let mut table: HashTable<&str> = HashTable::new(); ++ /// let hasher = BuildHasherDefault::::default(); ++ /// let hasher = |val: &_| hasher.hash_one(val); ++ /// ++ /// let entry = table ++ /// .entry(hasher(&"horseyland"), |&x| x == "horseyland", hasher) ++ /// .insert("horseyland"); ++ /// ++ /// assert_eq!(entry.get(), &"horseyland"); ++ /// # } ++ /// # fn main() { ++ /// # #[cfg(feature = "nightly")] ++ /// # test() ++ /// # } ++ /// ``` ++ pub fn insert(self, value: T) -> OccupiedEntry<'a, T, A> { ++ match self { ++ Entry::Occupied(mut entry) => { ++ *entry.get_mut() = value; ++ entry ++ } ++ Entry::Vacant(entry) => entry.insert(value), ++ } ++ } ++ ++ /// Ensures a value is in the entry by inserting if it was vacant. ++ /// ++ /// Returns an [`OccupiedEntry`] pointing to the now-occupied entry. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// # #[cfg(feature = "nightly")] ++ /// # fn test() { ++ /// use ahash::AHasher; ++ /// use hashbrown::HashTable; ++ /// use std::hash::{BuildHasher, BuildHasherDefault}; ++ /// ++ /// let mut table: HashTable<&str> = HashTable::new(); ++ /// let hasher = BuildHasherDefault::::default(); ++ /// let hasher = |val: &_| hasher.hash_one(val); ++ /// ++ /// // nonexistent key ++ /// table ++ /// .entry(hasher(&"poneyland"), |&x| x == "poneyland", hasher) ++ /// .or_insert("poneyland"); ++ /// assert!(table ++ /// .find(hasher(&"poneyland"), |&x| x == "poneyland") ++ /// .is_some()); ++ /// ++ /// // existing key ++ /// table ++ /// .entry(hasher(&"poneyland"), |&x| x == "poneyland", hasher) ++ /// .or_insert("poneyland"); ++ /// assert!(table ++ /// .find(hasher(&"poneyland"), |&x| x == "poneyland") ++ /// .is_some()); ++ /// assert_eq!(table.len(), 1); ++ /// # } ++ /// # fn main() { ++ /// # #[cfg(feature = "nightly")] ++ /// # test() ++ /// # } ++ /// ``` ++ pub fn or_insert(self, default: T) -> OccupiedEntry<'a, T, A> { ++ match self { ++ Entry::Occupied(entry) => entry, ++ Entry::Vacant(entry) => entry.insert(default), ++ } ++ } ++ ++ /// Ensures a value is in the entry by inserting the result of the default function if empty.. ++ /// ++ /// Returns an [`OccupiedEntry`] pointing to the now-occupied entry. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// # #[cfg(feature = "nightly")] ++ /// # fn test() { ++ /// use ahash::AHasher; ++ /// use hashbrown::HashTable; ++ /// use std::hash::{BuildHasher, BuildHasherDefault}; ++ /// ++ /// let mut table: HashTable = HashTable::new(); ++ /// let hasher = BuildHasherDefault::::default(); ++ /// let hasher = |val: &_| hasher.hash_one(val); ++ /// ++ /// table ++ /// .entry(hasher("poneyland"), |x| x == "poneyland", |val| hasher(val)) ++ /// .or_insert_with(|| "poneyland".to_string()); ++ /// ++ /// assert!(table ++ /// .find(hasher(&"poneyland"), |x| x == "poneyland") ++ /// .is_some()); ++ /// # } ++ /// # fn main() { ++ /// # #[cfg(feature = "nightly")] ++ /// # test() ++ /// # } ++ /// ``` ++ pub fn or_insert_with(self, default: impl FnOnce() -> T) -> OccupiedEntry<'a, T, A> { ++ match self { ++ Entry::Occupied(entry) => entry, ++ Entry::Vacant(entry) => entry.insert(default()), ++ } ++ } ++ ++ /// Provides in-place mutable access to an occupied entry before any ++ /// potential inserts into the table. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// # #[cfg(feature = "nightly")] ++ /// # fn test() { ++ /// use ahash::AHasher; ++ /// use hashbrown::HashTable; ++ /// use std::hash::{BuildHasher, BuildHasherDefault}; ++ /// ++ /// let mut table: HashTable<(&str, u32)> = HashTable::new(); ++ /// let hasher = BuildHasherDefault::::default(); ++ /// let hasher = |val: &_| hasher.hash_one(val); ++ /// ++ /// table ++ /// .entry( ++ /// hasher(&"poneyland"), ++ /// |&(x, _)| x == "poneyland", ++ /// |(k, _)| hasher(&k), ++ /// ) ++ /// .and_modify(|(_, v)| *v += 1) ++ /// .or_insert(("poneyland", 42)); ++ /// assert_eq!( ++ /// table.find(hasher(&"poneyland"), |&(k, _)| k == "poneyland"), ++ /// Some(&("poneyland", 42)) ++ /// ); ++ /// ++ /// table ++ /// .entry( ++ /// hasher(&"poneyland"), ++ /// |&(x, _)| x == "poneyland", ++ /// |(k, _)| hasher(&k), ++ /// ) ++ /// .and_modify(|(_, v)| *v += 1) ++ /// .or_insert(("poneyland", 42)); ++ /// assert_eq!( ++ /// table.find(hasher(&"poneyland"), |&(k, _)| k == "poneyland"), ++ /// Some(&("poneyland", 43)) ++ /// ); ++ /// # } ++ /// # fn main() { ++ /// # #[cfg(feature = "nightly")] ++ /// # test() ++ /// # } ++ /// ``` ++ pub fn and_modify(self, f: impl FnOnce(&mut T)) -> Self { ++ match self { ++ Entry::Occupied(mut entry) => { ++ f(entry.get_mut()); ++ Entry::Occupied(entry) ++ } ++ Entry::Vacant(entry) => Entry::Vacant(entry), ++ } ++ } ++} ++ ++/// A view into an occupied entry in a `HashTable`. ++/// It is part of the [`Entry`] enum. ++/// ++/// [`Entry`]: enum.Entry.html ++/// ++/// # Examples ++/// ++/// ``` ++/// # #[cfg(feature = "nightly")] ++/// # fn test() { ++/// use ahash::AHasher; ++/// use hashbrown::hash_table::{Entry, HashTable, OccupiedEntry}; ++/// use std::hash::{BuildHasher, BuildHasherDefault}; ++/// ++/// let mut table = HashTable::new(); ++/// let hasher = BuildHasherDefault::::default(); ++/// let hasher = |val: &_| hasher.hash_one(val); ++/// for x in ["a", "b", "c"] { ++/// table.insert_unique(hasher(&x), x, hasher); ++/// } ++/// assert_eq!(table.len(), 3); ++/// ++/// let _entry_o: OccupiedEntry<_, _> = table.find_entry(hasher(&"a"), |&x| x == "a").unwrap(); ++/// assert_eq!(table.len(), 3); ++/// ++/// // Existing key ++/// match table.entry(hasher(&"a"), |&x| x == "a", hasher) { ++/// Entry::Vacant(_) => unreachable!(), ++/// Entry::Occupied(view) => { ++/// assert_eq!(view.get(), &"a"); ++/// } ++/// } ++/// ++/// assert_eq!(table.len(), 3); ++/// ++/// // Existing key (take) ++/// match table.entry(hasher(&"c"), |&x| x == "c", hasher) { ++/// Entry::Vacant(_) => unreachable!(), ++/// Entry::Occupied(view) => { ++/// assert_eq!(view.remove().0, "c"); ++/// } ++/// } ++/// assert_eq!(table.find(hasher(&"c"), |&x| x == "c"), None); ++/// assert_eq!(table.len(), 2); ++/// # } ++/// # fn main() { ++/// # #[cfg(feature = "nightly")] ++/// # test() ++/// # } ++/// ``` ++pub struct OccupiedEntry<'a, T, A = Global> ++where ++ A: Allocator, ++{ ++ hash: u64, ++ bucket: Bucket, ++ table: &'a mut HashTable, ++} ++ ++unsafe impl Send for OccupiedEntry<'_, T, A> ++where ++ T: Send, ++ A: Send + Allocator, ++{ ++} ++unsafe impl Sync for OccupiedEntry<'_, T, A> ++where ++ T: Sync, ++ A: Sync + Allocator, ++{ ++} ++ ++impl fmt::Debug for OccupiedEntry<'_, T, A> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_struct("OccupiedEntry") ++ .field("value", self.get()) ++ .finish() ++ } ++} ++ ++impl<'a, T, A> OccupiedEntry<'a, T, A> ++where ++ A: Allocator, ++{ ++ /// Takes the value out of the entry, and returns it along with a ++ /// `VacantEntry` that can be used to insert another value with the same ++ /// hash as the one that was just removed. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// # #[cfg(feature = "nightly")] ++ /// # fn test() { ++ /// use ahash::AHasher; ++ /// use hashbrown::hash_table::Entry; ++ /// use hashbrown::HashTable; ++ /// use std::hash::{BuildHasher, BuildHasherDefault}; ++ /// ++ /// let mut table: HashTable<&str> = HashTable::new(); ++ /// let hasher = BuildHasherDefault::::default(); ++ /// let hasher = |val: &_| hasher.hash_one(val); ++ /// // The table is empty ++ /// assert!(table.is_empty() && table.capacity() == 0); ++ /// ++ /// table.insert_unique(hasher(&"poneyland"), "poneyland", hasher); ++ /// let capacity_before_remove = table.capacity(); ++ /// ++ /// if let Entry::Occupied(o) = table.entry(hasher(&"poneyland"), |&x| x == "poneyland", hasher) { ++ /// assert_eq!(o.remove().0, "poneyland"); ++ /// } ++ /// ++ /// assert!(table ++ /// .find(hasher(&"poneyland"), |&x| x == "poneyland") ++ /// .is_none()); ++ /// // Now table hold none elements but capacity is equal to the old one ++ /// assert!(table.len() == 0 && table.capacity() == capacity_before_remove); ++ /// # } ++ /// # fn main() { ++ /// # #[cfg(feature = "nightly")] ++ /// # test() ++ /// # } ++ /// ``` ++ #[cfg_attr(feature = "inline-more", inline)] ++ pub fn remove(self) -> (T, VacantEntry<'a, T, A>) { ++ let (val, slot) = unsafe { self.table.raw.remove(self.bucket) }; ++ ( ++ val, ++ VacantEntry { ++ hash: self.hash, ++ insert_slot: slot, ++ table: self.table, ++ }, ++ ) ++ } ++ ++ /// Gets a reference to the value in the entry. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// # #[cfg(feature = "nightly")] ++ /// # fn test() { ++ /// use ahash::AHasher; ++ /// use hashbrown::hash_table::Entry; ++ /// use hashbrown::HashTable; ++ /// use std::hash::{BuildHasher, BuildHasherDefault}; ++ /// ++ /// let mut table: HashTable<&str> = HashTable::new(); ++ /// let hasher = BuildHasherDefault::::default(); ++ /// let hasher = |val: &_| hasher.hash_one(val); ++ /// table.insert_unique(hasher(&"poneyland"), "poneyland", hasher); ++ /// ++ /// match table.entry(hasher(&"poneyland"), |&x| x == "poneyland", hasher) { ++ /// Entry::Vacant(_) => panic!(), ++ /// Entry::Occupied(entry) => assert_eq!(entry.get(), &"poneyland"), ++ /// } ++ /// # } ++ /// # fn main() { ++ /// # #[cfg(feature = "nightly")] ++ /// # test() ++ /// # } ++ /// ``` ++ #[inline] ++ pub fn get(&self) -> &T { ++ unsafe { self.bucket.as_ref() } ++ } ++ ++ /// Gets a mutable reference to the value in the entry. ++ /// ++ /// If you need a reference to the `OccupiedEntry` which may outlive the ++ /// destruction of the `Entry` value, see [`into_mut`]. ++ /// ++ /// [`into_mut`]: #method.into_mut ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// # #[cfg(feature = "nightly")] ++ /// # fn test() { ++ /// use ahash::AHasher; ++ /// use hashbrown::hash_table::Entry; ++ /// use hashbrown::HashTable; ++ /// use std::hash::{BuildHasher, BuildHasherDefault}; ++ /// ++ /// let mut table: HashTable<(&str, u32)> = HashTable::new(); ++ /// let hasher = BuildHasherDefault::::default(); ++ /// let hasher = |val: &_| hasher.hash_one(val); ++ /// table.insert_unique(hasher(&"poneyland"), ("poneyland", 12), |(k, _)| hasher(&k)); ++ /// ++ /// assert_eq!( ++ /// table.find(hasher(&"poneyland"), |&(x, _)| x == "poneyland",), ++ /// Some(&("poneyland", 12)) ++ /// ); ++ /// ++ /// if let Entry::Occupied(mut o) = table.entry( ++ /// hasher(&"poneyland"), ++ /// |&(x, _)| x == "poneyland", ++ /// |(k, _)| hasher(&k), ++ /// ) { ++ /// o.get_mut().1 += 10; ++ /// assert_eq!(o.get().1, 22); ++ /// ++ /// // We can use the same Entry multiple times. ++ /// o.get_mut().1 += 2; ++ /// } ++ /// ++ /// assert_eq!( ++ /// table.find(hasher(&"poneyland"), |&(x, _)| x == "poneyland",), ++ /// Some(&("poneyland", 24)) ++ /// ); ++ /// # } ++ /// # fn main() { ++ /// # #[cfg(feature = "nightly")] ++ /// # test() ++ /// # } ++ /// ``` ++ #[inline] ++ pub fn get_mut(&mut self) -> &mut T { ++ unsafe { self.bucket.as_mut() } ++ } ++ ++ /// Converts the OccupiedEntry into a mutable reference to the value in the entry ++ /// with a lifetime bound to the table itself. ++ /// ++ /// If you need multiple references to the `OccupiedEntry`, see [`get_mut`]. ++ /// ++ /// [`get_mut`]: #method.get_mut ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// # #[cfg(feature = "nightly")] ++ /// # fn test() { ++ /// use ahash::AHasher; ++ /// use hashbrown::hash_table::Entry; ++ /// use hashbrown::HashTable; ++ /// use std::hash::{BuildHasher, BuildHasherDefault}; ++ /// ++ /// let mut table: HashTable<(&str, u32)> = HashTable::new(); ++ /// let hasher = BuildHasherDefault::::default(); ++ /// let hasher = |val: &_| hasher.hash_one(val); ++ /// table.insert_unique(hasher(&"poneyland"), ("poneyland", 12), |(k, _)| hasher(&k)); ++ /// ++ /// assert_eq!( ++ /// table.find(hasher(&"poneyland"), |&(x, _)| x == "poneyland",), ++ /// Some(&("poneyland", 12)) ++ /// ); ++ /// ++ /// let value: &mut (&str, u32); ++ /// match table.entry( ++ /// hasher(&"poneyland"), ++ /// |&(x, _)| x == "poneyland", ++ /// |(k, _)| hasher(&k), ++ /// ) { ++ /// Entry::Occupied(entry) => value = entry.into_mut(), ++ /// Entry::Vacant(_) => panic!(), ++ /// } ++ /// value.1 += 10; ++ /// ++ /// assert_eq!( ++ /// table.find(hasher(&"poneyland"), |&(x, _)| x == "poneyland",), ++ /// Some(&("poneyland", 22)) ++ /// ); ++ /// # } ++ /// # fn main() { ++ /// # #[cfg(feature = "nightly")] ++ /// # test() ++ /// # } ++ /// ``` ++ pub fn into_mut(self) -> &'a mut T { ++ unsafe { self.bucket.as_mut() } ++ } ++ ++ /// Converts the OccupiedEntry into a mutable reference to the underlying ++ /// table. ++ pub fn into_table(self) -> &'a mut HashTable { ++ self.table ++ } ++} ++ ++/// A view into a vacant entry in a `HashTable`. ++/// It is part of the [`Entry`] enum. ++/// ++/// [`Entry`]: enum.Entry.html ++/// ++/// # Examples ++/// ++/// ``` ++/// # #[cfg(feature = "nightly")] ++/// # fn test() { ++/// use ahash::AHasher; ++/// use hashbrown::hash_table::{Entry, HashTable, VacantEntry}; ++/// use std::hash::{BuildHasher, BuildHasherDefault}; ++/// ++/// let mut table: HashTable<&str> = HashTable::new(); ++/// let hasher = BuildHasherDefault::::default(); ++/// let hasher = |val: &_| hasher.hash_one(val); ++/// ++/// let entry_v: VacantEntry<_, _> = match table.entry(hasher(&"a"), |&x| x == "a", hasher) { ++/// Entry::Vacant(view) => view, ++/// Entry::Occupied(_) => unreachable!(), ++/// }; ++/// entry_v.insert("a"); ++/// assert!(table.find(hasher(&"a"), |&x| x == "a").is_some() && table.len() == 1); ++/// ++/// // Nonexistent key (insert) ++/// match table.entry(hasher(&"b"), |&x| x == "b", hasher) { ++/// Entry::Vacant(view) => { ++/// view.insert("b"); ++/// } ++/// Entry::Occupied(_) => unreachable!(), ++/// } ++/// assert!(table.find(hasher(&"b"), |&x| x == "b").is_some() && table.len() == 2); ++/// # } ++/// # fn main() { ++/// # #[cfg(feature = "nightly")] ++/// # test() ++/// # } ++/// ``` ++pub struct VacantEntry<'a, T, A = Global> ++where ++ A: Allocator, ++{ ++ hash: u64, ++ insert_slot: InsertSlot, ++ table: &'a mut HashTable, ++} ++ ++impl fmt::Debug for VacantEntry<'_, T, A> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.write_str("VacantEntry") ++ } ++} ++ ++impl<'a, T, A> VacantEntry<'a, T, A> ++where ++ A: Allocator, ++{ ++ /// Inserts a new element into the table with the hash that was used to ++ /// obtain the `VacantEntry`. ++ /// ++ /// An `OccupiedEntry` is returned for the newly inserted element. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// # #[cfg(feature = "nightly")] ++ /// # fn test() { ++ /// use ahash::AHasher; ++ /// use hashbrown::hash_table::Entry; ++ /// use hashbrown::HashTable; ++ /// use std::hash::{BuildHasher, BuildHasherDefault}; ++ /// ++ /// let mut table: HashTable<&str> = HashTable::new(); ++ /// let hasher = BuildHasherDefault::::default(); ++ /// let hasher = |val: &_| hasher.hash_one(val); ++ /// ++ /// if let Entry::Vacant(o) = table.entry(hasher(&"poneyland"), |&x| x == "poneyland", hasher) { ++ /// o.insert("poneyland"); ++ /// } ++ /// assert_eq!( ++ /// table.find(hasher(&"poneyland"), |&x| x == "poneyland"), ++ /// Some(&"poneyland") ++ /// ); ++ /// # } ++ /// # fn main() { ++ /// # #[cfg(feature = "nightly")] ++ /// # test() ++ /// # } ++ /// ``` ++ #[inline] ++ pub fn insert(self, value: T) -> OccupiedEntry<'a, T, A> { ++ let bucket = unsafe { ++ self.table ++ .raw ++ .insert_in_slot(self.hash, self.insert_slot, value) ++ }; ++ OccupiedEntry { ++ hash: self.hash, ++ bucket, ++ table: self.table, ++ } ++ } ++ ++ /// Converts the VacantEntry into a mutable reference to the underlying ++ /// table. ++ pub fn into_table(self) -> &'a mut HashTable { ++ self.table ++ } ++} ++ ++/// Type representing the absence of an entry, as returned by [`HashTable::find_entry`]. ++/// ++/// This type only exists due to [limitations] in Rust's NLL borrow checker. In ++/// the future, `find_entry` will return an `Option` and this ++/// type will be removed. ++/// ++/// [limitations]: https://smallcultfollowing.com/babysteps/blog/2018/06/15/mir-based-borrow-check-nll-status-update/#polonius ++/// ++/// # Examples ++/// ++/// ``` ++/// # #[cfg(feature = "nightly")] ++/// # fn test() { ++/// use ahash::AHasher; ++/// use hashbrown::hash_table::{AbsentEntry, Entry, HashTable}; ++/// use std::hash::{BuildHasher, BuildHasherDefault}; ++/// ++/// let mut table: HashTable<&str> = HashTable::new(); ++/// let hasher = BuildHasherDefault::::default(); ++/// let hasher = |val: &_| hasher.hash_one(val); ++/// ++/// let entry_v: AbsentEntry<_, _> = table.find_entry(hasher(&"a"), |&x| x == "a").unwrap_err(); ++/// entry_v ++/// .into_table() ++/// .insert_unique(hasher(&"a"), "a", hasher); ++/// assert!(table.find(hasher(&"a"), |&x| x == "a").is_some() && table.len() == 1); ++/// ++/// // Nonexistent key (insert) ++/// match table.entry(hasher(&"b"), |&x| x == "b", hasher) { ++/// Entry::Vacant(view) => { ++/// view.insert("b"); ++/// } ++/// Entry::Occupied(_) => unreachable!(), ++/// } ++/// assert!(table.find(hasher(&"b"), |&x| x == "b").is_some() && table.len() == 2); ++/// # } ++/// # fn main() { ++/// # #[cfg(feature = "nightly")] ++/// # test() ++/// # } ++/// ``` ++pub struct AbsentEntry<'a, T, A = Global> ++where ++ A: Allocator, ++{ ++ table: &'a mut HashTable, ++} ++ ++impl fmt::Debug for AbsentEntry<'_, T, A> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.write_str("AbsentEntry") ++ } ++} ++ ++impl<'a, T, A> AbsentEntry<'a, T, A> ++where ++ A: Allocator, ++{ ++ /// Converts the AbsentEntry into a mutable reference to the underlying ++ /// table. ++ pub fn into_table(self) -> &'a mut HashTable { ++ self.table ++ } ++} ++ ++/// An iterator over the entries of a `HashTable` in arbitrary order. ++/// The iterator element type is `&'a T`. ++/// ++/// This `struct` is created by the [`iter`] method on [`HashTable`]. See its ++/// documentation for more. ++/// ++/// [`iter`]: struct.HashTable.html#method.iter ++/// [`HashTable`]: struct.HashTable.html ++pub struct Iter<'a, T> { ++ inner: RawIter, ++ marker: PhantomData<&'a T>, ++} ++ ++impl<'a, T> Iterator for Iter<'a, T> { ++ type Item = &'a T; ++ ++ fn next(&mut self) -> Option { ++ // Avoid `Option::map` because it bloats LLVM IR. ++ match self.inner.next() { ++ Some(bucket) => Some(unsafe { bucket.as_ref() }), ++ None => None, ++ } ++ } ++ ++ fn size_hint(&self) -> (usize, Option) { ++ self.inner.size_hint() ++ } ++ ++ fn fold(self, init: B, mut f: F) -> B ++ where ++ Self: Sized, ++ F: FnMut(B, Self::Item) -> B, ++ { ++ self.inner ++ .fold(init, |acc, bucket| unsafe { f(acc, bucket.as_ref()) }) ++ } ++} ++ ++impl ExactSizeIterator for Iter<'_, T> { ++ fn len(&self) -> usize { ++ self.inner.len() ++ } ++} ++ ++impl FusedIterator for Iter<'_, T> {} ++ ++/// A mutable iterator over the entries of a `HashTable` in arbitrary order. ++/// The iterator element type is `&'a mut T`. ++/// ++/// This `struct` is created by the [`iter_mut`] method on [`HashTable`]. See its ++/// documentation for more. ++/// ++/// [`iter_mut`]: struct.HashTable.html#method.iter_mut ++/// [`HashTable`]: struct.HashTable.html ++pub struct IterMut<'a, T> { ++ inner: RawIter, ++ marker: PhantomData<&'a mut T>, ++} ++ ++impl<'a, T> Iterator for IterMut<'a, T> { ++ type Item = &'a mut T; ++ ++ fn next(&mut self) -> Option { ++ // Avoid `Option::map` because it bloats LLVM IR. ++ match self.inner.next() { ++ Some(bucket) => Some(unsafe { bucket.as_mut() }), ++ None => None, ++ } ++ } ++ ++ fn size_hint(&self) -> (usize, Option) { ++ self.inner.size_hint() ++ } ++ ++ fn fold(self, init: B, mut f: F) -> B ++ where ++ Self: Sized, ++ F: FnMut(B, Self::Item) -> B, ++ { ++ self.inner ++ .fold(init, |acc, bucket| unsafe { f(acc, bucket.as_mut()) }) ++ } ++} ++ ++impl ExactSizeIterator for IterMut<'_, T> { ++ fn len(&self) -> usize { ++ self.inner.len() ++ } ++} ++ ++impl FusedIterator for IterMut<'_, T> {} ++ ++/// An owning iterator over the entries of a `HashTable` in arbitrary order. ++/// The iterator element type is `T`. ++/// ++/// This `struct` is created by the [`into_iter`] method on [`HashTable`] ++/// (provided by the [`IntoIterator`] trait). See its documentation for more. ++/// The table cannot be used after calling that method. ++/// ++/// [`into_iter`]: struct.HashTable.html#method.into_iter ++/// [`HashTable`]: struct.HashTable.html ++/// [`IntoIterator`]: https://doc.rust-lang.org/core/iter/trait.IntoIterator.html ++pub struct IntoIter ++where ++ A: Allocator, ++{ ++ inner: RawIntoIter, ++} ++ ++impl Iterator for IntoIter ++where ++ A: Allocator, ++{ ++ type Item = T; ++ ++ fn next(&mut self) -> Option { ++ self.inner.next() ++ } ++ ++ fn size_hint(&self) -> (usize, Option) { ++ self.inner.size_hint() ++ } ++ ++ fn fold(self, init: B, f: F) -> B ++ where ++ Self: Sized, ++ F: FnMut(B, Self::Item) -> B, ++ { ++ self.inner.fold(init, f) ++ } ++} ++ ++impl ExactSizeIterator for IntoIter ++where ++ A: Allocator, ++{ ++ fn len(&self) -> usize { ++ self.inner.len() ++ } ++} ++ ++impl FusedIterator for IntoIter where A: Allocator {} ++ ++/// A draining iterator over the items of a `HashTable`. ++/// ++/// This `struct` is created by the [`drain`] method on [`HashTable`]. ++/// See its documentation for more. ++/// ++/// [`HashTable`]: struct.HashTable.html ++/// [`drain`]: struct.HashTable.html#method.drain ++pub struct Drain<'a, T, A: Allocator = Global> { ++ inner: RawDrain<'a, T, A>, ++} ++ ++impl Drain<'_, T, A> { ++ /// Returns a iterator of references over the remaining items. ++ fn iter(&self) -> Iter<'_, T> { ++ Iter { ++ inner: self.inner.iter(), ++ marker: PhantomData, ++ } ++ } ++} ++ ++impl Iterator for Drain<'_, T, A> { ++ type Item = T; ++ ++ fn next(&mut self) -> Option { ++ self.inner.next() ++ } ++ fn size_hint(&self) -> (usize, Option) { ++ self.inner.size_hint() ++ } ++} ++impl ExactSizeIterator for Drain<'_, T, A> { ++ fn len(&self) -> usize { ++ self.inner.len() ++ } ++} ++impl FusedIterator for Drain<'_, T, A> {} ++ ++impl fmt::Debug for Drain<'_, T, A> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_list().entries(self.iter()).finish() ++ } ++} ++ ++/// A draining iterator over entries of a `HashTable` which don't satisfy the predicate `f`. ++/// ++/// This `struct` is created by [`HashTable::extract_if`]. See its ++/// documentation for more. ++#[must_use = "Iterators are lazy unless consumed"] ++pub struct ExtractIf<'a, T, F, A: Allocator = Global> ++where ++ F: FnMut(&mut T) -> bool, ++{ ++ f: F, ++ inner: RawExtractIf<'a, T, A>, ++} ++ ++impl Iterator for ExtractIf<'_, T, F, A> ++where ++ F: FnMut(&mut T) -> bool, ++{ ++ type Item = T; ++ ++ #[inline] ++ fn next(&mut self) -> Option { ++ self.inner.next(|val| (self.f)(val)) ++ } ++ ++ #[inline] ++ fn size_hint(&self) -> (usize, Option) { ++ (0, self.inner.iter.size_hint().1) ++ } ++} ++ ++impl FusedIterator for ExtractIf<'_, T, F, A> where F: FnMut(&mut T) -> bool {} +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/tests/equivalent_trait.rs mesa-25.3.3/subprojects/hashbrown-0.14.5/tests/equivalent_trait.rs +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/tests/equivalent_trait.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/tests/equivalent_trait.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,53 @@ ++use hashbrown::Equivalent; ++use hashbrown::HashMap; ++ ++use std::hash::Hash; ++ ++#[derive(Debug, Hash)] ++pub struct Pair(pub A, pub B); ++ ++impl PartialEq<(A, B)> for Pair ++where ++ C: PartialEq, ++ D: PartialEq, ++{ ++ fn eq(&self, rhs: &(A, B)) -> bool { ++ self.0 == rhs.0 && self.1 == rhs.1 ++ } ++} ++ ++impl Equivalent for Pair ++where ++ Pair: PartialEq, ++ A: Hash + Eq, ++ B: Hash + Eq, ++{ ++ fn equivalent(&self, other: &X) -> bool { ++ *self == *other ++ } ++} ++ ++#[test] ++fn test_lookup() { ++ let s = String::from; ++ let mut map = HashMap::new(); ++ map.insert((s("a"), s("b")), 1); ++ map.insert((s("a"), s("x")), 2); ++ ++ assert!(map.contains_key(&Pair("a", "b"))); ++ assert!(!map.contains_key(&Pair("b", "a"))); ++} ++ ++#[test] ++fn test_string_str() { ++ let s = String::from; ++ let mut map = HashMap::new(); ++ map.insert(s("a"), 1); ++ map.insert(s("b"), 2); ++ map.insert(s("x"), 3); ++ map.insert(s("y"), 4); ++ ++ assert!(map.contains_key("a")); ++ assert!(!map.contains_key("z")); ++ assert_eq!(map.remove("b"), Some(2)); ++} +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/tests/hasher.rs mesa-25.3.3/subprojects/hashbrown-0.14.5/tests/hasher.rs +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/tests/hasher.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/tests/hasher.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,65 @@ ++//! Sanity check that alternate hashers work correctly. ++ ++#![cfg(not(miri))] // FIXME: takes too long ++ ++use hashbrown::HashSet; ++use std::hash::{BuildHasher, BuildHasherDefault, Hasher}; ++ ++fn check() { ++ let range = 0..1_000; ++ ++ let mut set = HashSet::::default(); ++ set.extend(range.clone()); ++ ++ assert!(!set.contains(&i32::min_value())); ++ assert!(!set.contains(&(range.start - 1))); ++ for i in range.clone() { ++ assert!(set.contains(&i)); ++ } ++ assert!(!set.contains(&range.end)); ++ assert!(!set.contains(&i32::max_value())); ++} ++ ++/// Use hashbrown's default hasher. ++#[test] ++fn default() { ++ check::(); ++} ++ ++/// Use std's default hasher. ++#[test] ++fn random_state() { ++ check::(); ++} ++ ++/// Use a constant 0 hash. ++#[test] ++fn zero() { ++ #[derive(Default)] ++ struct ZeroHasher; ++ ++ impl Hasher for ZeroHasher { ++ fn finish(&self) -> u64 { ++ 0 ++ } ++ fn write(&mut self, _: &[u8]) {} ++ } ++ ++ check::>(); ++} ++ ++/// Use a constant maximum hash. ++#[test] ++fn max() { ++ #[derive(Default)] ++ struct MaxHasher; ++ ++ impl Hasher for MaxHasher { ++ fn finish(&self) -> u64 { ++ u64::max_value() ++ } ++ fn write(&mut self, _: &[u8]) {} ++ } ++ ++ check::>(); ++} +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/tests/raw.rs mesa-25.3.3/subprojects/hashbrown-0.14.5/tests/raw.rs +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/tests/raw.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/tests/raw.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,11 @@ ++#![cfg(feature = "raw")] ++ ++use hashbrown::raw::RawTable; ++use std::mem; ++ ++#[test] ++fn test_allocation_info() { ++ assert_eq!(RawTable::<()>::new().allocation_info().1.size(), 0); ++ assert_eq!(RawTable::::new().allocation_info().1.size(), 0); ++ assert!(RawTable::::with_capacity(1).allocation_info().1.size() > mem::size_of::()); ++} +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/tests/rayon.rs mesa-25.3.3/subprojects/hashbrown-0.14.5/tests/rayon.rs +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/tests/rayon.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/tests/rayon.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,535 @@ ++#![cfg(feature = "rayon")] ++ ++#[macro_use] ++extern crate lazy_static; ++ ++use hashbrown::{HashMap, HashSet}; ++use rayon::iter::{ ++ IntoParallelIterator, IntoParallelRefIterator, IntoParallelRefMutIterator, ParallelExtend, ++ ParallelIterator, ++}; ++ ++macro_rules! assert_eq3 { ++ ($e1:expr, $e2:expr, $e3:expr) => {{ ++ assert_eq!($e1, $e2); ++ assert_eq!($e1, $e3); ++ assert_eq!($e2, $e3); ++ }}; ++} ++ ++lazy_static! { ++ static ref MAP_EMPTY: HashMap = HashMap::new(); ++ static ref MAP: HashMap = { ++ let mut m = HashMap::new(); ++ m.insert('b', 20); ++ m.insert('a', 10); ++ m.insert('c', 30); ++ m.insert('e', 50); ++ m.insert('f', 60); ++ m.insert('d', 40); ++ m ++ }; ++} ++ ++#[test] ++fn map_seq_par_equivalence_iter_empty() { ++ let vec_seq = MAP_EMPTY.iter().collect::>(); ++ let vec_par = MAP_EMPTY.par_iter().collect::>(); ++ ++ assert_eq3!(vec_seq, vec_par, []); ++} ++ ++#[test] ++fn map_seq_par_equivalence_iter() { ++ let mut vec_seq = MAP.iter().collect::>(); ++ let mut vec_par = MAP.par_iter().collect::>(); ++ ++ assert_eq!(vec_seq, vec_par); ++ ++ // Do not depend on the exact order of values ++ let expected_sorted = [ ++ (&'a', &10), ++ (&'b', &20), ++ (&'c', &30), ++ (&'d', &40), ++ (&'e', &50), ++ (&'f', &60), ++ ]; ++ ++ vec_seq.sort_unstable(); ++ vec_par.sort_unstable(); ++ ++ assert_eq3!(vec_seq, vec_par, expected_sorted); ++} ++ ++#[test] ++fn map_seq_par_equivalence_keys_empty() { ++ let vec_seq = MAP_EMPTY.keys().collect::>(); ++ let vec_par = MAP_EMPTY.par_keys().collect::>(); ++ ++ let expected: [&char; 0] = []; ++ ++ assert_eq3!(vec_seq, vec_par, expected); ++} ++ ++#[test] ++fn map_seq_par_equivalence_keys() { ++ let mut vec_seq = MAP.keys().collect::>(); ++ let mut vec_par = MAP.par_keys().collect::>(); ++ ++ assert_eq!(vec_seq, vec_par); ++ ++ // Do not depend on the exact order of values ++ let expected_sorted = [&'a', &'b', &'c', &'d', &'e', &'f']; ++ ++ vec_seq.sort_unstable(); ++ vec_par.sort_unstable(); ++ ++ assert_eq3!(vec_seq, vec_par, expected_sorted); ++} ++ ++#[test] ++fn map_seq_par_equivalence_values_empty() { ++ let vec_seq = MAP_EMPTY.values().collect::>(); ++ let vec_par = MAP_EMPTY.par_values().collect::>(); ++ ++ let expected: [&u32; 0] = []; ++ ++ assert_eq3!(vec_seq, vec_par, expected); ++} ++ ++#[test] ++fn map_seq_par_equivalence_values() { ++ let mut vec_seq = MAP.values().collect::>(); ++ let mut vec_par = MAP.par_values().collect::>(); ++ ++ assert_eq!(vec_seq, vec_par); ++ ++ // Do not depend on the exact order of values ++ let expected_sorted = [&10, &20, &30, &40, &50, &60]; ++ ++ vec_seq.sort_unstable(); ++ vec_par.sort_unstable(); ++ ++ assert_eq3!(vec_seq, vec_par, expected_sorted); ++} ++ ++#[test] ++fn map_seq_par_equivalence_iter_mut_empty() { ++ let mut map1 = MAP_EMPTY.clone(); ++ let mut map2 = MAP_EMPTY.clone(); ++ ++ let vec_seq = map1.iter_mut().collect::>(); ++ let vec_par = map2.par_iter_mut().collect::>(); ++ ++ assert_eq3!(vec_seq, vec_par, []); ++} ++ ++#[test] ++fn map_seq_par_equivalence_iter_mut() { ++ let mut map1 = MAP.clone(); ++ let mut map2 = MAP.clone(); ++ ++ let mut vec_seq = map1.iter_mut().collect::>(); ++ let mut vec_par = map2.par_iter_mut().collect::>(); ++ ++ assert_eq!(vec_seq, vec_par); ++ ++ // Do not depend on the exact order of values ++ let expected_sorted = [ ++ (&'a', &mut 10), ++ (&'b', &mut 20), ++ (&'c', &mut 30), ++ (&'d', &mut 40), ++ (&'e', &mut 50), ++ (&'f', &mut 60), ++ ]; ++ ++ vec_seq.sort_unstable(); ++ vec_par.sort_unstable(); ++ ++ assert_eq3!(vec_seq, vec_par, expected_sorted); ++} ++ ++#[test] ++fn map_seq_par_equivalence_values_mut_empty() { ++ let mut map1 = MAP_EMPTY.clone(); ++ let mut map2 = MAP_EMPTY.clone(); ++ ++ let vec_seq = map1.values_mut().collect::>(); ++ let vec_par = map2.par_values_mut().collect::>(); ++ ++ let expected: [&u32; 0] = []; ++ ++ assert_eq3!(vec_seq, vec_par, expected); ++} ++ ++#[test] ++fn map_seq_par_equivalence_values_mut() { ++ let mut map1 = MAP.clone(); ++ let mut map2 = MAP.clone(); ++ ++ let mut vec_seq = map1.values_mut().collect::>(); ++ let mut vec_par = map2.par_values_mut().collect::>(); ++ ++ assert_eq!(vec_seq, vec_par); ++ ++ // Do not depend on the exact order of values ++ let expected_sorted = [&mut 10, &mut 20, &mut 30, &mut 40, &mut 50, &mut 60]; ++ ++ vec_seq.sort_unstable(); ++ vec_par.sort_unstable(); ++ ++ assert_eq3!(vec_seq, vec_par, expected_sorted); ++} ++ ++#[test] ++fn map_seq_par_equivalence_into_iter_empty() { ++ let vec_seq = MAP_EMPTY.clone().into_iter().collect::>(); ++ let vec_par = MAP_EMPTY.clone().into_par_iter().collect::>(); ++ ++ assert_eq3!(vec_seq, vec_par, []); ++} ++ ++#[test] ++fn map_seq_par_equivalence_into_iter() { ++ let mut vec_seq = MAP.clone().into_iter().collect::>(); ++ let mut vec_par = MAP.clone().into_par_iter().collect::>(); ++ ++ assert_eq!(vec_seq, vec_par); ++ ++ // Do not depend on the exact order of values ++ let expected_sorted = [ ++ ('a', 10), ++ ('b', 20), ++ ('c', 30), ++ ('d', 40), ++ ('e', 50), ++ ('f', 60), ++ ]; ++ ++ vec_seq.sort_unstable(); ++ vec_par.sort_unstable(); ++ ++ assert_eq3!(vec_seq, vec_par, expected_sorted); ++} ++ ++lazy_static! { ++ static ref MAP_VEC_EMPTY: Vec<(char, u32)> = vec![]; ++ static ref MAP_VEC: Vec<(char, u32)> = vec![ ++ ('b', 20), ++ ('a', 10), ++ ('c', 30), ++ ('e', 50), ++ ('f', 60), ++ ('d', 40), ++ ]; ++} ++ ++#[test] ++fn map_seq_par_equivalence_collect_empty() { ++ let map_expected = MAP_EMPTY.clone(); ++ let map_seq = MAP_VEC_EMPTY.clone().into_iter().collect::>(); ++ let map_par = MAP_VEC_EMPTY ++ .clone() ++ .into_par_iter() ++ .collect::>(); ++ ++ assert_eq!(map_seq, map_par); ++ assert_eq!(map_seq, map_expected); ++ assert_eq!(map_par, map_expected); ++} ++ ++#[test] ++fn map_seq_par_equivalence_collect() { ++ let map_expected = MAP.clone(); ++ let map_seq = MAP_VEC.clone().into_iter().collect::>(); ++ let map_par = MAP_VEC.clone().into_par_iter().collect::>(); ++ ++ assert_eq!(map_seq, map_par); ++ assert_eq!(map_seq, map_expected); ++ assert_eq!(map_par, map_expected); ++} ++ ++lazy_static! { ++ static ref MAP_EXISTING_EMPTY: HashMap = HashMap::new(); ++ static ref MAP_EXISTING: HashMap = { ++ let mut m = HashMap::new(); ++ m.insert('b', 20); ++ m.insert('a', 10); ++ m ++ }; ++ static ref MAP_EXTENSION_EMPTY: Vec<(char, u32)> = vec![]; ++ static ref MAP_EXTENSION: Vec<(char, u32)> = vec![('c', 30), ('e', 50), ('f', 60), ('d', 40),]; ++} ++ ++#[test] ++fn map_seq_par_equivalence_existing_empty_extend_empty() { ++ let expected = HashMap::new(); ++ let mut map_seq = MAP_EXISTING_EMPTY.clone(); ++ let mut map_par = MAP_EXISTING_EMPTY.clone(); ++ ++ map_seq.extend(MAP_EXTENSION_EMPTY.iter().copied()); ++ map_par.par_extend(MAP_EXTENSION_EMPTY.par_iter().copied()); ++ ++ assert_eq3!(map_seq, map_par, expected); ++} ++ ++#[test] ++fn map_seq_par_equivalence_existing_empty_extend() { ++ let expected = MAP_EXTENSION.iter().copied().collect::>(); ++ let mut map_seq = MAP_EXISTING_EMPTY.clone(); ++ let mut map_par = MAP_EXISTING_EMPTY.clone(); ++ ++ map_seq.extend(MAP_EXTENSION.iter().copied()); ++ map_par.par_extend(MAP_EXTENSION.par_iter().copied()); ++ ++ assert_eq3!(map_seq, map_par, expected); ++} ++ ++#[test] ++fn map_seq_par_equivalence_existing_extend_empty() { ++ let expected = MAP_EXISTING.clone(); ++ let mut map_seq = MAP_EXISTING.clone(); ++ let mut map_par = MAP_EXISTING.clone(); ++ ++ map_seq.extend(MAP_EXTENSION_EMPTY.iter().copied()); ++ map_par.par_extend(MAP_EXTENSION_EMPTY.par_iter().copied()); ++ ++ assert_eq3!(map_seq, map_par, expected); ++} ++ ++#[test] ++fn map_seq_par_equivalence_existing_extend() { ++ let expected = MAP.clone(); ++ let mut map_seq = MAP_EXISTING.clone(); ++ let mut map_par = MAP_EXISTING.clone(); ++ ++ map_seq.extend(MAP_EXTENSION.iter().copied()); ++ map_par.par_extend(MAP_EXTENSION.par_iter().copied()); ++ ++ assert_eq3!(map_seq, map_par, expected); ++} ++ ++lazy_static! { ++ static ref SET_EMPTY: HashSet = HashSet::new(); ++ static ref SET: HashSet = { ++ let mut s = HashSet::new(); ++ s.insert('b'); ++ s.insert('a'); ++ s.insert('c'); ++ s.insert('e'); ++ s.insert('f'); ++ s.insert('d'); ++ s ++ }; ++} ++ ++#[test] ++fn set_seq_par_equivalence_iter_empty() { ++ let vec_seq = SET_EMPTY.iter().collect::>(); ++ let vec_par = SET_EMPTY.par_iter().collect::>(); ++ ++ let expected: [&char; 0] = []; ++ ++ assert_eq3!(vec_seq, vec_par, expected); ++} ++ ++#[test] ++fn set_seq_par_equivalence_iter() { ++ let mut vec_seq = SET.iter().collect::>(); ++ let mut vec_par = SET.par_iter().collect::>(); ++ ++ assert_eq!(vec_seq, vec_par); ++ ++ // Do not depend on the exact order of values ++ let expected_sorted = [&'a', &'b', &'c', &'d', &'e', &'f']; ++ ++ vec_seq.sort_unstable(); ++ vec_par.sort_unstable(); ++ ++ assert_eq3!(vec_seq, vec_par, expected_sorted); ++} ++ ++#[test] ++fn set_seq_par_equivalence_into_iter_empty() { ++ let vec_seq = SET_EMPTY.clone().into_iter().collect::>(); ++ let vec_par = SET_EMPTY.clone().into_par_iter().collect::>(); ++ ++ // Work around type inference failure introduced by rend dev-dependency. ++ let empty: [char; 0] = []; ++ assert_eq3!(vec_seq, vec_par, empty); ++} ++ ++#[test] ++fn set_seq_par_equivalence_into_iter() { ++ let mut vec_seq = SET.clone().into_iter().collect::>(); ++ let mut vec_par = SET.clone().into_par_iter().collect::>(); ++ ++ assert_eq!(vec_seq, vec_par); ++ ++ // Do not depend on the exact order of values ++ let expected_sorted = ['a', 'b', 'c', 'd', 'e', 'f']; ++ ++ vec_seq.sort_unstable(); ++ vec_par.sort_unstable(); ++ ++ assert_eq3!(vec_seq, vec_par, expected_sorted); ++} ++ ++lazy_static! { ++ static ref SET_VEC_EMPTY: Vec = vec![]; ++ static ref SET_VEC: Vec = vec!['b', 'a', 'c', 'e', 'f', 'd',]; ++} ++ ++#[test] ++fn set_seq_par_equivalence_collect_empty() { ++ let set_expected = SET_EMPTY.clone(); ++ let set_seq = SET_VEC_EMPTY.clone().into_iter().collect::>(); ++ let set_par = SET_VEC_EMPTY ++ .clone() ++ .into_par_iter() ++ .collect::>(); ++ ++ assert_eq!(set_seq, set_par); ++ assert_eq!(set_seq, set_expected); ++ assert_eq!(set_par, set_expected); ++} ++ ++#[test] ++fn set_seq_par_equivalence_collect() { ++ let set_expected = SET.clone(); ++ let set_seq = SET_VEC.clone().into_iter().collect::>(); ++ let set_par = SET_VEC.clone().into_par_iter().collect::>(); ++ ++ assert_eq!(set_seq, set_par); ++ assert_eq!(set_seq, set_expected); ++ assert_eq!(set_par, set_expected); ++} ++ ++lazy_static! { ++ static ref SET_EXISTING_EMPTY: HashSet = HashSet::new(); ++ static ref SET_EXISTING: HashSet = { ++ let mut s = HashSet::new(); ++ s.insert('b'); ++ s.insert('a'); ++ s ++ }; ++ static ref SET_EXTENSION_EMPTY: Vec = vec![]; ++ static ref SET_EXTENSION: Vec = vec!['c', 'e', 'f', 'd',]; ++} ++ ++#[test] ++fn set_seq_par_equivalence_existing_empty_extend_empty() { ++ let expected = HashSet::new(); ++ let mut set_seq = SET_EXISTING_EMPTY.clone(); ++ let mut set_par = SET_EXISTING_EMPTY.clone(); ++ ++ set_seq.extend(SET_EXTENSION_EMPTY.iter().copied()); ++ set_par.par_extend(SET_EXTENSION_EMPTY.par_iter().copied()); ++ ++ assert_eq3!(set_seq, set_par, expected); ++} ++ ++#[test] ++fn set_seq_par_equivalence_existing_empty_extend() { ++ let expected = SET_EXTENSION.iter().copied().collect::>(); ++ let mut set_seq = SET_EXISTING_EMPTY.clone(); ++ let mut set_par = SET_EXISTING_EMPTY.clone(); ++ ++ set_seq.extend(SET_EXTENSION.iter().copied()); ++ set_par.par_extend(SET_EXTENSION.par_iter().copied()); ++ ++ assert_eq3!(set_seq, set_par, expected); ++} ++ ++#[test] ++fn set_seq_par_equivalence_existing_extend_empty() { ++ let expected = SET_EXISTING.clone(); ++ let mut set_seq = SET_EXISTING.clone(); ++ let mut set_par = SET_EXISTING.clone(); ++ ++ set_seq.extend(SET_EXTENSION_EMPTY.iter().copied()); ++ set_par.par_extend(SET_EXTENSION_EMPTY.par_iter().copied()); ++ ++ assert_eq3!(set_seq, set_par, expected); ++} ++ ++#[test] ++fn set_seq_par_equivalence_existing_extend() { ++ let expected = SET.clone(); ++ let mut set_seq = SET_EXISTING.clone(); ++ let mut set_par = SET_EXISTING.clone(); ++ ++ set_seq.extend(SET_EXTENSION.iter().copied()); ++ set_par.par_extend(SET_EXTENSION.par_iter().copied()); ++ ++ assert_eq3!(set_seq, set_par, expected); ++} ++ ++lazy_static! { ++ static ref SET_A: HashSet = ['a', 'b', 'c', 'd'].iter().copied().collect(); ++ static ref SET_B: HashSet = ['a', 'b', 'e', 'f'].iter().copied().collect(); ++ static ref SET_DIFF_AB: HashSet = ['c', 'd'].iter().copied().collect(); ++ static ref SET_DIFF_BA: HashSet = ['e', 'f'].iter().copied().collect(); ++ static ref SET_SYMM_DIFF_AB: HashSet = ['c', 'd', 'e', 'f'].iter().copied().collect(); ++ static ref SET_INTERSECTION_AB: HashSet = ['a', 'b'].iter().copied().collect(); ++ static ref SET_UNION_AB: HashSet = ++ ['a', 'b', 'c', 'd', 'e', 'f'].iter().copied().collect(); ++} ++ ++#[test] ++fn set_seq_par_equivalence_difference() { ++ let diff_ab_seq = SET_A.difference(&*SET_B).copied().collect::>(); ++ let diff_ab_par = SET_A ++ .par_difference(&*SET_B) ++ .copied() ++ .collect::>(); ++ ++ assert_eq3!(diff_ab_seq, diff_ab_par, *SET_DIFF_AB); ++ ++ let diff_ba_seq = SET_B.difference(&*SET_A).copied().collect::>(); ++ let diff_ba_par = SET_B ++ .par_difference(&*SET_A) ++ .copied() ++ .collect::>(); ++ ++ assert_eq3!(diff_ba_seq, diff_ba_par, *SET_DIFF_BA); ++} ++ ++#[test] ++fn set_seq_par_equivalence_symmetric_difference() { ++ let symm_diff_ab_seq = SET_A ++ .symmetric_difference(&*SET_B) ++ .copied() ++ .collect::>(); ++ let symm_diff_ab_par = SET_A ++ .par_symmetric_difference(&*SET_B) ++ .copied() ++ .collect::>(); ++ ++ assert_eq3!(symm_diff_ab_seq, symm_diff_ab_par, *SET_SYMM_DIFF_AB); ++} ++ ++#[test] ++fn set_seq_par_equivalence_intersection() { ++ let intersection_ab_seq = SET_A.intersection(&*SET_B).copied().collect::>(); ++ let intersection_ab_par = SET_A ++ .par_intersection(&*SET_B) ++ .copied() ++ .collect::>(); ++ ++ assert_eq3!( ++ intersection_ab_seq, ++ intersection_ab_par, ++ *SET_INTERSECTION_AB ++ ); ++} ++ ++#[test] ++fn set_seq_par_equivalence_union() { ++ let union_ab_seq = SET_A.union(&*SET_B).copied().collect::>(); ++ let union_ab_par = SET_A.par_union(&*SET_B).copied().collect::>(); ++ ++ assert_eq3!(union_ab_seq, union_ab_par, *SET_UNION_AB); ++} +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/tests/serde.rs mesa-25.3.3/subprojects/hashbrown-0.14.5/tests/serde.rs +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/tests/serde.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/tests/serde.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,65 @@ ++#![cfg(feature = "serde")] ++ ++use core::hash::BuildHasherDefault; ++use fnv::FnvHasher; ++use hashbrown::{HashMap, HashSet}; ++use serde_test::{assert_tokens, Token}; ++ ++// We use FnvHash for this test because we rely on the ordering ++type FnvHashMap = HashMap>; ++type FnvHashSet = HashSet>; ++ ++#[test] ++fn map_serde_tokens_empty() { ++ let map = FnvHashMap::::default(); ++ ++ assert_tokens(&map, &[Token::Map { len: Some(0) }, Token::MapEnd]); ++} ++ ++#[test] ++fn map_serde_tokens() { ++ let mut map = FnvHashMap::default(); ++ map.insert('b', 20); ++ map.insert('a', 10); ++ map.insert('c', 30); ++ ++ assert_tokens( ++ &map, ++ &[ ++ Token::Map { len: Some(3) }, ++ Token::Char('a'), ++ Token::I32(10), ++ Token::Char('c'), ++ Token::I32(30), ++ Token::Char('b'), ++ Token::I32(20), ++ Token::MapEnd, ++ ], ++ ); ++} ++ ++#[test] ++fn set_serde_tokens_empty() { ++ let set = FnvHashSet::::default(); ++ ++ assert_tokens(&set, &[Token::Seq { len: Some(0) }, Token::SeqEnd]); ++} ++ ++#[test] ++fn set_serde_tokens() { ++ let mut set = FnvHashSet::default(); ++ set.insert(20); ++ set.insert(10); ++ set.insert(30); ++ ++ assert_tokens( ++ &set, ++ &[ ++ Token::Seq { len: Some(3) }, ++ Token::I32(30), ++ Token::I32(20), ++ Token::I32(10), ++ Token::SeqEnd, ++ ], ++ ); ++} +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14.5/tests/set.rs mesa-25.3.3/subprojects/hashbrown-0.14.5/tests/set.rs +--- mesa-25.3.3/subprojects/hashbrown-0.14.5/tests/set.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14.5/tests/set.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,34 @@ ++#![cfg(not(miri))] // FIXME: takes too long ++ ++use hashbrown::HashSet; ++use rand::{distributions::Alphanumeric, rngs::SmallRng, Rng, SeedableRng}; ++use std::iter; ++ ++#[test] ++fn test_hashset_insert_remove() { ++ let mut m: HashSet> = HashSet::new(); ++ let seed = u64::from_le_bytes(*b"testseed"); ++ ++ let rng = &mut SmallRng::seed_from_u64(seed); ++ let tx: Vec> = iter::repeat_with(|| { ++ rng.sample_iter(&Alphanumeric) ++ .take(32) ++ .map(char::from) ++ .collect() ++ }) ++ .take(4096) ++ .collect(); ++ ++ // more readable with explicit `true` / `false` ++ #[allow(clippy::bool_assert_comparison)] ++ for _ in 0..32 { ++ for x in &tx { ++ assert_eq!(m.contains(x), false); ++ assert_eq!(m.insert(x.clone()), true); ++ } ++ for (i, x) in tx.iter().enumerate() { ++ println!("removing {i} {x:?}"); ++ assert_eq!(m.remove(x), true); ++ } ++ } ++} +diff -Nru mesa-25.3.3/subprojects/hashbrown-0.14-rs.wrap mesa-25.3.3/subprojects/hashbrown-0.14-rs.wrap +--- mesa-25.3.3/subprojects/hashbrown-0.14-rs.wrap 2026-01-01 13:34:04.000000000 -0500 ++++ mesa-25.3.3/subprojects/hashbrown-0.14-rs.wrap 2026-05-29 13:40:52.000000000 -0500 +@@ -1,6 +1,4 @@ + [wrap-file] +-directory = hashbrown-0.14.1 +-source_url = https://crates.io/api/v1/crates/hashbrown/0.14.1/download +-source_filename = hashbrown-0.14.1.tar.gz +-source_hash = 7dfda62a12f55daeae5015f81b0baea145391cb4520f86c248fc615d72640d12 ++directory = hashbrown-0.14.5 + patch_directory = hashbrown-0.14-rs ++ +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/benches/bench.rs mesa-25.3.3/subprojects/indexmap-2.7.0/benches/bench.rs +--- mesa-25.3.3/subprojects/indexmap-2.7.0/benches/bench.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/benches/bench.rs 2025-01-11 13:48:35.000000000 -0500 +@@ -0,0 +1,764 @@ ++#![cfg(feature = "std")] ++#![feature(test)] ++ ++extern crate test; ++#[macro_use] ++extern crate lazy_static; ++ ++use fnv::FnvHasher; ++use std::hash::BuildHasherDefault; ++use std::hash::Hash; ++type FnvBuilder = BuildHasherDefault; ++ ++use test::black_box; ++use test::Bencher; ++ ++use indexmap::IndexMap; ++ ++use std::collections::HashMap; ++ ++use rand::rngs::SmallRng; ++use rand::seq::SliceRandom; ++use rand::SeedableRng; ++ ++/// Use a consistently seeded Rng for benchmark stability ++fn small_rng() -> SmallRng { ++ let seed = u64::from_le_bytes(*b"indexmap"); ++ SmallRng::seed_from_u64(seed) ++} ++ ++#[bench] ++fn new_hashmap(b: &mut Bencher) { ++ b.iter(|| HashMap::::new()); ++} ++ ++#[bench] ++fn new_indexmap(b: &mut Bencher) { ++ b.iter(|| IndexMap::::new()); ++} ++ ++#[bench] ++fn with_capacity_10e5_hashmap(b: &mut Bencher) { ++ b.iter(|| HashMap::::with_capacity(10_000)); ++} ++ ++#[bench] ++fn with_capacity_10e5_indexmap(b: &mut Bencher) { ++ b.iter(|| IndexMap::::with_capacity(10_000)); ++} ++ ++#[bench] ++fn insert_hashmap_10_000(b: &mut Bencher) { ++ let c = 10_000; ++ b.iter(|| { ++ let mut map = HashMap::with_capacity(c); ++ for x in 0..c { ++ map.insert(x, ()); ++ } ++ map ++ }); ++} ++ ++#[bench] ++fn insert_indexmap_10_000(b: &mut Bencher) { ++ let c = 10_000; ++ b.iter(|| { ++ let mut map = IndexMap::with_capacity(c); ++ for x in 0..c { ++ map.insert(x, ()); ++ } ++ map ++ }); ++} ++ ++#[bench] ++fn insert_hashmap_string_10_000(b: &mut Bencher) { ++ let c = 10_000; ++ b.iter(|| { ++ let mut map = HashMap::with_capacity(c); ++ for x in 0..c { ++ map.insert(x.to_string(), ()); ++ } ++ map ++ }); ++} ++ ++#[bench] ++fn insert_indexmap_string_10_000(b: &mut Bencher) { ++ let c = 10_000; ++ b.iter(|| { ++ let mut map = IndexMap::with_capacity(c); ++ for x in 0..c { ++ map.insert(x.to_string(), ()); ++ } ++ map ++ }); ++} ++ ++#[bench] ++fn insert_hashmap_str_10_000(b: &mut Bencher) { ++ let c = 10_000; ++ let ss = Vec::from_iter((0..c).map(|x| x.to_string())); ++ b.iter(|| { ++ let mut map = HashMap::with_capacity(c); ++ for key in &ss { ++ map.insert(&key[..], ()); ++ } ++ map ++ }); ++} ++ ++#[bench] ++fn insert_indexmap_str_10_000(b: &mut Bencher) { ++ let c = 10_000; ++ let ss = Vec::from_iter((0..c).map(|x| x.to_string())); ++ b.iter(|| { ++ let mut map = IndexMap::with_capacity(c); ++ for key in &ss { ++ map.insert(&key[..], ()); ++ } ++ map ++ }); ++} ++ ++#[bench] ++fn insert_hashmap_int_bigvalue_10_000(b: &mut Bencher) { ++ let c = 10_000; ++ let value = [0u64; 10]; ++ b.iter(|| { ++ let mut map = HashMap::with_capacity(c); ++ for i in 0..c { ++ map.insert(i, value); ++ } ++ map ++ }); ++} ++ ++#[bench] ++fn insert_indexmap_int_bigvalue_10_000(b: &mut Bencher) { ++ let c = 10_000; ++ let value = [0u64; 10]; ++ b.iter(|| { ++ let mut map = IndexMap::with_capacity(c); ++ for i in 0..c { ++ map.insert(i, value); ++ } ++ map ++ }); ++} ++ ++#[bench] ++fn insert_hashmap_100_000(b: &mut Bencher) { ++ let c = 100_000; ++ b.iter(|| { ++ let mut map = HashMap::with_capacity(c); ++ for x in 0..c { ++ map.insert(x, ()); ++ } ++ map ++ }); ++} ++ ++#[bench] ++fn insert_indexmap_100_000(b: &mut Bencher) { ++ let c = 100_000; ++ b.iter(|| { ++ let mut map = IndexMap::with_capacity(c); ++ for x in 0..c { ++ map.insert(x, ()); ++ } ++ map ++ }); ++} ++ ++#[bench] ++fn insert_hashmap_150(b: &mut Bencher) { ++ let c = 150; ++ b.iter(|| { ++ let mut map = HashMap::with_capacity(c); ++ for x in 0..c { ++ map.insert(x, ()); ++ } ++ map ++ }); ++} ++ ++#[bench] ++fn insert_indexmap_150(b: &mut Bencher) { ++ let c = 150; ++ b.iter(|| { ++ let mut map = IndexMap::with_capacity(c); ++ for x in 0..c { ++ map.insert(x, ()); ++ } ++ map ++ }); ++} ++ ++#[bench] ++fn entry_hashmap_150(b: &mut Bencher) { ++ let c = 150; ++ b.iter(|| { ++ let mut map = HashMap::with_capacity(c); ++ for x in 0..c { ++ map.entry(x).or_insert(()); ++ } ++ map ++ }); ++} ++ ++#[bench] ++fn entry_indexmap_150(b: &mut Bencher) { ++ let c = 150; ++ b.iter(|| { ++ let mut map = IndexMap::with_capacity(c); ++ for x in 0..c { ++ map.entry(x).or_insert(()); ++ } ++ map ++ }); ++} ++ ++#[bench] ++fn iter_sum_hashmap_10_000(b: &mut Bencher) { ++ let c = 10_000; ++ let mut map = HashMap::with_capacity(c); ++ let len = c - c / 10; ++ for x in 0..len { ++ map.insert(x, ()); ++ } ++ assert_eq!(map.len(), len); ++ b.iter(|| map.keys().sum::()); ++} ++ ++#[bench] ++fn iter_sum_indexmap_10_000(b: &mut Bencher) { ++ let c = 10_000; ++ let mut map = IndexMap::with_capacity(c); ++ let len = c - c / 10; ++ for x in 0..len { ++ map.insert(x, ()); ++ } ++ assert_eq!(map.len(), len); ++ b.iter(|| map.keys().sum::()); ++} ++ ++#[bench] ++fn iter_black_box_hashmap_10_000(b: &mut Bencher) { ++ let c = 10_000; ++ let mut map = HashMap::with_capacity(c); ++ let len = c - c / 10; ++ for x in 0..len { ++ map.insert(x, ()); ++ } ++ assert_eq!(map.len(), len); ++ b.iter(|| { ++ for &key in map.keys() { ++ black_box(key); ++ } ++ }); ++} ++ ++#[bench] ++fn iter_black_box_indexmap_10_000(b: &mut Bencher) { ++ let c = 10_000; ++ let mut map = IndexMap::with_capacity(c); ++ let len = c - c / 10; ++ for x in 0..len { ++ map.insert(x, ()); ++ } ++ assert_eq!(map.len(), len); ++ b.iter(|| { ++ for &key in map.keys() { ++ black_box(key); ++ } ++ }); ++} ++ ++fn shuffled_keys(iter: I) -> Vec ++where ++ I: IntoIterator, ++{ ++ let mut v = Vec::from_iter(iter); ++ let mut rng = small_rng(); ++ v.shuffle(&mut rng); ++ v ++} ++ ++#[bench] ++fn lookup_hashmap_10_000_exist(b: &mut Bencher) { ++ let c = 10_000; ++ let mut map = HashMap::with_capacity(c); ++ let keys = shuffled_keys(0..c); ++ for &key in &keys { ++ map.insert(key, 1); ++ } ++ b.iter(|| { ++ let mut found = 0; ++ for key in 5000..c { ++ found += map.get(&key).is_some() as i32; ++ } ++ found ++ }); ++} ++ ++#[bench] ++fn lookup_hashmap_10_000_noexist(b: &mut Bencher) { ++ let c = 10_000; ++ let mut map = HashMap::with_capacity(c); ++ let keys = shuffled_keys(0..c); ++ for &key in &keys { ++ map.insert(key, 1); ++ } ++ b.iter(|| { ++ let mut found = 0; ++ for key in c..15000 { ++ found += map.get(&key).is_some() as i32; ++ } ++ found ++ }); ++} ++ ++#[bench] ++fn lookup_indexmap_10_000_exist(b: &mut Bencher) { ++ let c = 10_000; ++ let mut map = IndexMap::with_capacity(c); ++ let keys = shuffled_keys(0..c); ++ for &key in &keys { ++ map.insert(key, 1); ++ } ++ b.iter(|| { ++ let mut found = 0; ++ for key in 5000..c { ++ found += map.get(&key).is_some() as i32; ++ } ++ found ++ }); ++} ++ ++#[bench] ++fn lookup_indexmap_10_000_noexist(b: &mut Bencher) { ++ let c = 10_000; ++ let mut map = IndexMap::with_capacity(c); ++ let keys = shuffled_keys(0..c); ++ for &key in &keys { ++ map.insert(key, 1); ++ } ++ b.iter(|| { ++ let mut found = 0; ++ for key in c..15000 { ++ found += map.get(&key).is_some() as i32; ++ } ++ found ++ }); ++} ++ ++// number of items to look up ++const LOOKUP_MAP_SIZE: u32 = 100_000_u32; ++const LOOKUP_SAMPLE_SIZE: u32 = 5000; ++const SORT_MAP_SIZE: usize = 10_000; ++ ++// use lazy_static so that comparison benchmarks use the exact same inputs ++lazy_static! { ++ static ref KEYS: Vec = shuffled_keys(0..LOOKUP_MAP_SIZE); ++} ++ ++lazy_static! { ++ static ref HMAP_100K: HashMap = { ++ let c = LOOKUP_MAP_SIZE; ++ let mut map = HashMap::with_capacity(c as usize); ++ let keys = &*KEYS; ++ for &key in keys { ++ map.insert(key, key); ++ } ++ map ++ }; ++} ++ ++lazy_static! { ++ static ref IMAP_100K: IndexMap = { ++ let c = LOOKUP_MAP_SIZE; ++ let mut map = IndexMap::with_capacity(c as usize); ++ let keys = &*KEYS; ++ for &key in keys { ++ map.insert(key, key); ++ } ++ map ++ }; ++} ++ ++lazy_static! { ++ static ref IMAP_SORT_U32: IndexMap = { ++ let mut map = IndexMap::with_capacity(SORT_MAP_SIZE); ++ for &key in &KEYS[..SORT_MAP_SIZE] { ++ map.insert(key, key); ++ } ++ map ++ }; ++} ++lazy_static! { ++ static ref IMAP_SORT_S: IndexMap = { ++ let mut map = IndexMap::with_capacity(SORT_MAP_SIZE); ++ for &key in &KEYS[..SORT_MAP_SIZE] { ++ map.insert(format!("{:^16x}", &key), String::new()); ++ } ++ map ++ }; ++} ++ ++#[bench] ++fn lookup_hashmap_100_000_multi(b: &mut Bencher) { ++ let map = &*HMAP_100K; ++ b.iter(|| { ++ let mut found = 0; ++ for key in 0..LOOKUP_SAMPLE_SIZE { ++ found += map.get(&key).is_some() as u32; ++ } ++ found ++ }); ++} ++ ++#[bench] ++fn lookup_indexmap_100_000_multi(b: &mut Bencher) { ++ let map = &*IMAP_100K; ++ b.iter(|| { ++ let mut found = 0; ++ for key in 0..LOOKUP_SAMPLE_SIZE { ++ found += map.get(&key).is_some() as u32; ++ } ++ found ++ }); ++} ++ ++// inorder: Test looking up keys in the same order as they were inserted ++#[bench] ++fn lookup_hashmap_100_000_inorder_multi(b: &mut Bencher) { ++ let map = &*HMAP_100K; ++ let keys = &*KEYS; ++ b.iter(|| { ++ let mut found = 0; ++ for key in &keys[0..LOOKUP_SAMPLE_SIZE as usize] { ++ found += map.get(key).is_some() as u32; ++ } ++ found ++ }); ++} ++ ++#[bench] ++fn lookup_indexmap_100_000_inorder_multi(b: &mut Bencher) { ++ let map = &*IMAP_100K; ++ let keys = &*KEYS; ++ b.iter(|| { ++ let mut found = 0; ++ for key in &keys[0..LOOKUP_SAMPLE_SIZE as usize] { ++ found += map.get(key).is_some() as u32; ++ } ++ found ++ }); ++} ++ ++#[bench] ++fn lookup_hashmap_100_000_single(b: &mut Bencher) { ++ let map = &*HMAP_100K; ++ let mut iter = (0..LOOKUP_MAP_SIZE + LOOKUP_SAMPLE_SIZE).cycle(); ++ b.iter(|| { ++ let key = iter.next().unwrap(); ++ map.get(&key).is_some() ++ }); ++} ++ ++#[bench] ++fn lookup_indexmap_100_000_single(b: &mut Bencher) { ++ let map = &*IMAP_100K; ++ let mut iter = (0..LOOKUP_MAP_SIZE + LOOKUP_SAMPLE_SIZE).cycle(); ++ b.iter(|| { ++ let key = iter.next().unwrap(); ++ map.get(&key).is_some() ++ }); ++} ++ ++const GROW_SIZE: usize = 100_000; ++type GrowKey = u32; ++ ++// Test grow/resize without preallocation ++#[bench] ++fn grow_fnv_hashmap_100_000(b: &mut Bencher) { ++ b.iter(|| { ++ let mut map: HashMap<_, _, FnvBuilder> = HashMap::default(); ++ for x in 0..GROW_SIZE { ++ map.insert(x as GrowKey, x as GrowKey); ++ } ++ map ++ }); ++} ++ ++#[bench] ++fn grow_fnv_indexmap_100_000(b: &mut Bencher) { ++ b.iter(|| { ++ let mut map: IndexMap<_, _, FnvBuilder> = IndexMap::default(); ++ for x in 0..GROW_SIZE { ++ map.insert(x as GrowKey, x as GrowKey); ++ } ++ map ++ }); ++} ++ ++const MERGE: u64 = 10_000; ++#[bench] ++fn hashmap_merge_simple(b: &mut Bencher) { ++ let first_map: HashMap = (0..MERGE).map(|i| (i, ())).collect(); ++ let second_map: HashMap = (MERGE..MERGE * 2).map(|i| (i, ())).collect(); ++ b.iter(|| { ++ let mut merged = first_map.clone(); ++ merged.extend(second_map.iter().map(|(&k, &v)| (k, v))); ++ merged ++ }); ++} ++ ++#[bench] ++fn hashmap_merge_shuffle(b: &mut Bencher) { ++ let first_map: HashMap = (0..MERGE).map(|i| (i, ())).collect(); ++ let second_map: HashMap = (MERGE..MERGE * 2).map(|i| (i, ())).collect(); ++ let mut v = Vec::new(); ++ let mut rng = small_rng(); ++ b.iter(|| { ++ let mut merged = first_map.clone(); ++ v.extend(second_map.iter().map(|(&k, &v)| (k, v))); ++ v.shuffle(&mut rng); ++ merged.extend(v.drain(..)); ++ ++ merged ++ }); ++} ++ ++#[bench] ++fn indexmap_merge_simple(b: &mut Bencher) { ++ let first_map: IndexMap = (0..MERGE).map(|i| (i, ())).collect(); ++ let second_map: IndexMap = (MERGE..MERGE * 2).map(|i| (i, ())).collect(); ++ b.iter(|| { ++ let mut merged = first_map.clone(); ++ merged.extend(second_map.iter().map(|(&k, &v)| (k, v))); ++ merged ++ }); ++} ++ ++#[bench] ++fn indexmap_merge_shuffle(b: &mut Bencher) { ++ let first_map: IndexMap = (0..MERGE).map(|i| (i, ())).collect(); ++ let second_map: IndexMap = (MERGE..MERGE * 2).map(|i| (i, ())).collect(); ++ let mut v = Vec::new(); ++ let mut rng = small_rng(); ++ b.iter(|| { ++ let mut merged = first_map.clone(); ++ v.extend(second_map.iter().map(|(&k, &v)| (k, v))); ++ v.shuffle(&mut rng); ++ merged.extend(v.drain(..)); ++ ++ merged ++ }); ++} ++ ++#[bench] ++fn swap_remove_indexmap_100_000(b: &mut Bencher) { ++ let map = IMAP_100K.clone(); ++ let mut keys = Vec::from_iter(map.keys().copied()); ++ let mut rng = small_rng(); ++ keys.shuffle(&mut rng); ++ ++ b.iter(|| { ++ let mut map = map.clone(); ++ for key in &keys { ++ map.swap_remove(key); ++ } ++ assert_eq!(map.len(), 0); ++ map ++ }); ++} ++ ++#[bench] ++fn shift_remove_indexmap_100_000_few(b: &mut Bencher) { ++ let map = IMAP_100K.clone(); ++ let mut keys = Vec::from_iter(map.keys().copied()); ++ let mut rng = small_rng(); ++ keys.shuffle(&mut rng); ++ keys.truncate(50); ++ ++ b.iter(|| { ++ let mut map = map.clone(); ++ for key in &keys { ++ map.shift_remove(key); ++ } ++ assert_eq!(map.len(), IMAP_100K.len() - keys.len()); ++ map ++ }); ++} ++ ++#[bench] ++fn shift_remove_indexmap_2_000_full(b: &mut Bencher) { ++ let mut keys = KEYS[..2_000].to_vec(); ++ let mut map = IndexMap::with_capacity(keys.len()); ++ for &key in &keys { ++ map.insert(key, key); ++ } ++ let mut rng = small_rng(); ++ keys.shuffle(&mut rng); ++ ++ b.iter(|| { ++ let mut map = map.clone(); ++ for key in &keys { ++ map.shift_remove(key); ++ } ++ assert_eq!(map.len(), 0); ++ map ++ }); ++} ++ ++#[bench] ++fn pop_indexmap_100_000(b: &mut Bencher) { ++ let map = IMAP_100K.clone(); ++ ++ b.iter(|| { ++ let mut map = map.clone(); ++ while !map.is_empty() { ++ map.pop(); ++ } ++ assert_eq!(map.len(), 0); ++ map ++ }); ++} ++ ++#[bench] ++fn few_retain_indexmap_100_000(b: &mut Bencher) { ++ let map = IMAP_100K.clone(); ++ ++ b.iter(|| { ++ let mut map = map.clone(); ++ map.retain(|k, _| *k % 7 == 0); ++ map ++ }); ++} ++ ++#[bench] ++fn few_retain_hashmap_100_000(b: &mut Bencher) { ++ let map = HMAP_100K.clone(); ++ ++ b.iter(|| { ++ let mut map = map.clone(); ++ map.retain(|k, _| *k % 7 == 0); ++ map ++ }); ++} ++ ++#[bench] ++fn half_retain_indexmap_100_000(b: &mut Bencher) { ++ let map = IMAP_100K.clone(); ++ ++ b.iter(|| { ++ let mut map = map.clone(); ++ map.retain(|k, _| *k % 2 == 0); ++ map ++ }); ++} ++ ++#[bench] ++fn half_retain_hashmap_100_000(b: &mut Bencher) { ++ let map = HMAP_100K.clone(); ++ ++ b.iter(|| { ++ let mut map = map.clone(); ++ map.retain(|k, _| *k % 2 == 0); ++ map ++ }); ++} ++ ++#[bench] ++fn many_retain_indexmap_100_000(b: &mut Bencher) { ++ let map = IMAP_100K.clone(); ++ ++ b.iter(|| { ++ let mut map = map.clone(); ++ map.retain(|k, _| *k % 100 != 0); ++ map ++ }); ++} ++ ++#[bench] ++fn many_retain_hashmap_100_000(b: &mut Bencher) { ++ let map = HMAP_100K.clone(); ++ ++ b.iter(|| { ++ let mut map = map.clone(); ++ map.retain(|k, _| *k % 100 != 0); ++ map ++ }); ++} ++ ++// simple sort impl for comparison ++pub fn simple_sort(m: &mut IndexMap) { ++ let mut ordered: Vec<_> = m.drain(..).collect(); ++ ordered.sort_by(|left, right| left.0.cmp(&right.0)); ++ m.extend(ordered); ++} ++ ++#[bench] ++fn indexmap_sort_s(b: &mut Bencher) { ++ let map = IMAP_SORT_S.clone(); ++ ++ // there's a map clone there, but it's still useful to profile this ++ b.iter(|| { ++ let mut map = map.clone(); ++ map.sort_keys(); ++ map ++ }); ++} ++ ++#[bench] ++fn indexmap_simple_sort_s(b: &mut Bencher) { ++ let map = IMAP_SORT_S.clone(); ++ ++ // there's a map clone there, but it's still useful to profile this ++ b.iter(|| { ++ let mut map = map.clone(); ++ simple_sort(&mut map); ++ map ++ }); ++} ++ ++#[bench] ++fn indexmap_sort_u32(b: &mut Bencher) { ++ let map = IMAP_SORT_U32.clone(); ++ ++ // there's a map clone there, but it's still useful to profile this ++ b.iter(|| { ++ let mut map = map.clone(); ++ map.sort_keys(); ++ map ++ }); ++} ++ ++#[bench] ++fn indexmap_simple_sort_u32(b: &mut Bencher) { ++ let map = IMAP_SORT_U32.clone(); ++ ++ // there's a map clone there, but it's still useful to profile this ++ b.iter(|| { ++ let mut map = map.clone(); ++ simple_sort(&mut map); ++ map ++ }); ++} ++ ++// measure the fixed overhead of cloning in sort benchmarks ++#[bench] ++fn indexmap_clone_for_sort_s(b: &mut Bencher) { ++ let map = IMAP_SORT_S.clone(); ++ ++ b.iter(|| map.clone()); ++} ++ ++#[bench] ++fn indexmap_clone_for_sort_u32(b: &mut Bencher) { ++ let map = IMAP_SORT_U32.clone(); ++ ++ b.iter(|| map.clone()); ++} +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/benches/faststring.rs mesa-25.3.3/subprojects/indexmap-2.7.0/benches/faststring.rs +--- mesa-25.3.3/subprojects/indexmap-2.7.0/benches/faststring.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/benches/faststring.rs 2025-01-11 13:48:35.000000000 -0500 +@@ -0,0 +1,186 @@ ++#![cfg(feature = "std")] ++#![feature(test)] ++ ++extern crate test; ++ ++use test::Bencher; ++ ++use indexmap::IndexMap; ++ ++use std::collections::HashMap; ++ ++use rand::rngs::SmallRng; ++use rand::seq::SliceRandom; ++use rand::SeedableRng; ++ ++use std::hash::{Hash, Hasher}; ++ ++use std::borrow::Borrow; ++use std::ops::Deref; ++ ++/// Use a consistently seeded Rng for benchmark stability ++fn small_rng() -> SmallRng { ++ let seed = u64::from_le_bytes(*b"indexmap"); ++ SmallRng::seed_from_u64(seed) ++} ++ ++#[derive(PartialEq, Eq, Copy, Clone)] ++#[repr(transparent)] ++pub struct OneShot(pub T); ++ ++impl Hash for OneShot { ++ fn hash(&self, h: &mut H) { ++ h.write(self.0.as_bytes()) ++ } ++} ++ ++impl<'a, S> From<&'a S> for &'a OneShot ++where ++ S: AsRef, ++{ ++ fn from(s: &'a S) -> Self { ++ let s: &str = s.as_ref(); ++ unsafe { &*(s as *const str as *const OneShot) } ++ } ++} ++ ++impl Hash for OneShot { ++ fn hash(&self, h: &mut H) { ++ h.write(self.0.as_bytes()) ++ } ++} ++ ++impl Borrow> for OneShot { ++ fn borrow(&self) -> &OneShot { ++ <&OneShot>::from(&self.0) ++ } ++} ++ ++impl Deref for OneShot { ++ type Target = T; ++ fn deref(&self) -> &T { ++ &self.0 ++ } ++} ++ ++fn shuffled_keys(iter: I) -> Vec ++where ++ I: IntoIterator, ++{ ++ let mut v = Vec::from_iter(iter); ++ let mut rng = small_rng(); ++ v.shuffle(&mut rng); ++ v ++} ++ ++#[bench] ++fn insert_hashmap_string_10_000(b: &mut Bencher) { ++ let c = 10_000; ++ b.iter(|| { ++ let mut map = HashMap::with_capacity(c); ++ for x in 0..c { ++ map.insert(x.to_string(), ()); ++ } ++ map ++ }); ++} ++ ++#[bench] ++fn insert_hashmap_string_oneshot_10_000(b: &mut Bencher) { ++ let c = 10_000; ++ b.iter(|| { ++ let mut map = HashMap::with_capacity(c); ++ for x in 0..c { ++ map.insert(OneShot(x.to_string()), ()); ++ } ++ map ++ }); ++} ++ ++#[bench] ++fn insert_indexmap_string_10_000(b: &mut Bencher) { ++ let c = 10_000; ++ b.iter(|| { ++ let mut map = IndexMap::with_capacity(c); ++ for x in 0..c { ++ map.insert(x.to_string(), ()); ++ } ++ map ++ }); ++} ++ ++#[bench] ++fn lookup_hashmap_10_000_exist_string(b: &mut Bencher) { ++ let c = 10_000; ++ let mut map = HashMap::with_capacity(c); ++ let keys = shuffled_keys(0..c); ++ for &key in &keys { ++ map.insert(key.to_string(), 1); ++ } ++ let lookups = (5000..c).map(|x| x.to_string()).collect::>(); ++ b.iter(|| { ++ let mut found = 0; ++ for key in &lookups { ++ found += map.get(key).is_some() as i32; ++ } ++ found ++ }); ++} ++ ++#[bench] ++fn lookup_hashmap_10_000_exist_string_oneshot(b: &mut Bencher) { ++ let c = 10_000; ++ let mut map = HashMap::with_capacity(c); ++ let keys = shuffled_keys(0..c); ++ for &key in &keys { ++ map.insert(OneShot(key.to_string()), 1); ++ } ++ let lookups = (5000..c) ++ .map(|x| OneShot(x.to_string())) ++ .collect::>(); ++ b.iter(|| { ++ let mut found = 0; ++ for key in &lookups { ++ found += map.get(key).is_some() as i32; ++ } ++ found ++ }); ++} ++ ++#[bench] ++fn lookup_indexmap_10_000_exist_string(b: &mut Bencher) { ++ let c = 10_000; ++ let mut map = IndexMap::with_capacity(c); ++ let keys = shuffled_keys(0..c); ++ for &key in &keys { ++ map.insert(key.to_string(), 1); ++ } ++ let lookups = (5000..c).map(|x| x.to_string()).collect::>(); ++ b.iter(|| { ++ let mut found = 0; ++ for key in &lookups { ++ found += map.get(key).is_some() as i32; ++ } ++ found ++ }); ++} ++ ++#[bench] ++fn lookup_indexmap_10_000_exist_string_oneshot(b: &mut Bencher) { ++ let c = 10_000; ++ let mut map = IndexMap::with_capacity(c); ++ let keys = shuffled_keys(0..c); ++ for &key in &keys { ++ map.insert(OneShot(key.to_string()), 1); ++ } ++ let lookups = (5000..c) ++ .map(|x| OneShot(x.to_string())) ++ .collect::>(); ++ b.iter(|| { ++ let mut found = 0; ++ for key in &lookups { ++ found += map.get(key).is_some() as i32; ++ } ++ found ++ }); ++} +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/.cargo-checksum.json mesa-25.3.3/subprojects/indexmap-2.7.0/.cargo-checksum.json +--- mesa-25.3.3/subprojects/indexmap-2.7.0/.cargo-checksum.json 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/.cargo-checksum.json 2025-01-11 13:48:35.000000000 -0500 +@@ -0,0 +1 @@ ++{"package":"Could not get crate checksum","files":{}} +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/Cargo.toml mesa-25.3.3/subprojects/indexmap-2.7.0/Cargo.toml +--- mesa-25.3.3/subprojects/indexmap-2.7.0/Cargo.toml 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/Cargo.toml 2025-01-11 13:48:35.000000000 -0500 +@@ -0,0 +1,153 @@ ++# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO ++# ++# When uploading crates to the registry Cargo will automatically ++# "normalize" Cargo.toml files for maximal compatibility ++# with all versions of Cargo and also rewrite `path` dependencies ++# to registry (e.g., crates.io) dependencies. ++# ++# If you are reading this file be aware that the original Cargo.toml ++# will likely look very different (and much more reasonable). ++# See Cargo.toml.orig for the original contents. ++ ++[package] ++edition = "2021" ++rust-version = "1.63" ++name = "indexmap" ++version = "2.7.0" ++build = false ++autolib = false ++autobins = false ++autoexamples = false ++autotests = false ++autobenches = false ++description = "A hash table with consistent order and fast iteration." ++documentation = "https://docs.rs/indexmap/" ++readme = "README.md" ++keywords = [ ++ "hashmap", ++ "no_std", ++] ++categories = [ ++ "data-structures", ++ "no-std", ++] ++license = "Apache-2.0 OR MIT" ++repository = "https://github.com/indexmap-rs/indexmap" ++ ++[package.metadata.docs.rs] ++features = [ ++ "arbitrary", ++ "quickcheck", ++ "serde", ++ "borsh", ++ "rayon", ++] ++rustdoc-args = [ ++ "--cfg", ++ "docsrs", ++] ++ ++[package.metadata.release] ++allow-branch = ["master"] ++sign-tag = true ++tag-name = "{{version}}" ++ ++[profile.bench] ++debug = 2 ++ ++[lib] ++name = "indexmap" ++path = "src/lib.rs" ++bench = false ++ ++[[test]] ++name = "equivalent_trait" ++path = "tests/equivalent_trait.rs" ++ ++[[test]] ++name = "macros_full_path" ++path = "tests/macros_full_path.rs" ++ ++[[test]] ++name = "quick" ++path = "tests/quick.rs" ++ ++[[test]] ++name = "tests" ++path = "tests/tests.rs" ++ ++[[disabled.bench]] ++name = "bench" ++path = "benches/bench.rs" ++ ++[[disabled.bench]] ++name = "faststring" ++path = "benches/faststring.rs" ++ ++[dependencies.arbitrary] ++version = "1.0" ++optional = true ++default-features = false ++ ++[disabled.dependencies.borsh] ++version = "1.2" ++optional = true ++default-features = false ++ ++[dependencies.equivalent] ++version = "1.0" ++default-features = false ++ ++[dependencies.hashbrown] ++version = "0.14" ++default-features = false ++ ++[disabled.dependencies.quickcheck] ++version = "1.0" ++optional = true ++default-features = false ++ ++[dependencies.rayon] ++version = "1.9" ++optional = true ++ ++[disabled.dependencies.rustc-rayon] ++version = "0.5" ++optional = true ++package = "rustc-rayon" ++ ++[dependencies.serde] ++version = "1.0" ++optional = true ++default-features = false ++ ++[dev-dependencies.fnv] ++version = "1.0" ++ ++[dev-dependencies.fxhash] ++version = "0.2.1" ++ ++[dev-dependencies.itertools] ++version = "0.13" ++ ++[dev-dependencies.lazy_static] ++version = "1.3" ++ ++[dev-dependencies.quickcheck] ++version = "1.0" ++default-features = false ++ ++[dev-dependencies.rand] ++version = "0.8" ++features = ["small_rng"] ++ ++[dev-dependencies.serde_derive] ++version = "1.0" ++ ++[features] ++default = ["std"] ++std = [] ++test_debug = [] ++ ++[lints.clippy] ++style = "allow" +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/.cargo_vcs_info.json mesa-25.3.3/subprojects/indexmap-2.7.0/.cargo_vcs_info.json +--- mesa-25.3.3/subprojects/indexmap-2.7.0/.cargo_vcs_info.json 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/.cargo_vcs_info.json 2025-01-11 13:48:35.000000000 -0500 +@@ -0,0 +1,6 @@ ++{ ++ "git": { ++ "sha1": "539b40115139a0394a3b84386c133810655051d2" ++ }, ++ "path_in_vcs": "" ++} +\ No hay ningún carácter de nueva línea al final del archivo +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/debian/patches/disable-optional-deps.patch mesa-25.3.3/subprojects/indexmap-2.7.0/debian/patches/disable-optional-deps.patch +--- mesa-25.3.3/subprojects/indexmap-2.7.0/debian/patches/disable-optional-deps.patch 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/debian/patches/disable-optional-deps.patch 2025-01-11 13:48:35.000000000 -0500 +@@ -0,0 +1,11 @@ ++--- a/Cargo.toml +++++ b/Cargo.toml ++@@ -92 +92 @@ ++-[dependencies.borsh] +++[disabled.dependencies.borsh] ++@@ -105 +105 @@ ++-[dependencies.quickcheck] +++[disabled.dependencies.quickcheck] ++@@ -114 +114 @@ ++-[dependencies.rustc-rayon] +++[disabled.dependencies.rustc-rayon] +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/debian/patches/fix-tests-no-default-features.patch mesa-25.3.3/subprojects/indexmap-2.7.0/debian/patches/fix-tests-no-default-features.patch +--- mesa-25.3.3/subprojects/indexmap-2.7.0/debian/patches/fix-tests-no-default-features.patch 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/debian/patches/fix-tests-no-default-features.patch 2025-01-11 13:48:35.000000000 -0500 +@@ -0,0 +1,66 @@ ++--- indexmap.orig/src/map.rs +++++ indexmap/src/map.rs ++@@ -11,3 +11,3 @@ ++ ++-#[cfg(test)] +++#[cfg(all(test, feature = "std"))] ++ mod tests; ++--- indexmap.orig/src/map/slice.rs +++++ indexmap/src/map/slice.rs ++@@ -425,3 +425,3 @@ ++ ++-#[cfg(test)] +++#[cfg(all(test, feature = "std"))] ++ mod tests { ++--- indexmap.orig/src/set.rs +++++ indexmap/src/set.rs ++@@ -5,3 +5,3 @@ ++ ++-#[cfg(test)] +++#[cfg(all(test, feature = "std"))] ++ mod tests; ++--- indexmap.orig/src/set/slice.rs +++++ indexmap/src/set/slice.rs ++@@ -292,3 +292,3 @@ ++ ++-#[cfg(test)] +++#[cfg(all(test, feature = "std"))] ++ mod tests { ++--- indexmap.orig/benches/bench.rs +++++ indexmap/benches/bench.rs ++@@ -0,0 +1 @@ +++#![cfg(feature = "std")] ++--- indexmap.orig/benches/faststring.rs +++++ indexmap/benches/faststring.rs ++@@ -0,0 +1 @@ +++#![cfg(feature = "std")] ++--- indexmap.orig/tests/equivalent_trait.rs +++++ indexmap/tests/equivalent_trait.rs ++@@ -0,0 +1 @@ +++#![cfg(feature = "std")] ++--- indexmap.orig/tests/macros_full_path.rs +++++ indexmap/tests/macros_full_path.rs ++@@ -0,0 +1 @@ +++#![cfg(feature = "std")] ++--- indexmap.orig/tests/quick.rs +++++ indexmap/tests/quick.rs ++@@ -0,0 +1 @@ +++#![cfg(feature = "std")] ++--- indexmap.orig/tests/tests.rs +++++ indexmap/tests/tests.rs ++@@ -0,0 +1 @@ +++#![cfg(feature = "std")] ++--- indexmap.orig/src/rayon/map.rs +++++ indexmap/src/rayon/map.rs ++@@ -573,3 +573,3 @@ ++ ++-#[cfg(test)] +++#[cfg(all(test, feature = "std"))] ++ mod tests { ++--- indexmap.orig/src/rayon/set.rs +++++ indexmap/src/rayon/set.rs ++@@ -611,3 +611,3 @@ ++ ++-#[cfg(test)] +++#[cfg(all(test, feature = "std"))] ++ mod tests { +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/debian/patches/no-benches.patch mesa-25.3.3/subprojects/indexmap-2.7.0/debian/patches/no-benches.patch +--- mesa-25.3.3/subprojects/indexmap-2.7.0/debian/patches/no-benches.patch 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/debian/patches/no-benches.patch 2025-01-11 13:48:35.000000000 -0500 +@@ -0,0 +1,12 @@ ++--- a/Cargo.toml +++++ b/Cargo.toml ++@@ -78,3 +78,3 @@ ++ ++-[[bench]] +++[[disabled.bench]] ++ name = "bench" ++@@ -82,3 +82,3 @@ ++ ++-[[bench]] +++[[disabled.bench]] ++ name = "faststring" +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/debian/patches/relax-deps.patch mesa-25.3.3/subprojects/indexmap-2.7.0/debian/patches/relax-deps.patch +--- mesa-25.3.3/subprojects/indexmap-2.7.0/debian/patches/relax-deps.patch 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/debian/patches/relax-deps.patch 2025-01-11 13:48:35.000000000 -0500 +@@ -0,0 +1,14 @@ ++--- a/Cargo.toml +++++ b/Cargo.toml ++@@ -101,3 +101,3 @@ ++ [dependencies.hashbrown] ++-version = "0.15.0" +++version = "0.14" ++ default-features = false ++--- a/src/map/core.rs +++++ b/src/map/core.rs ++@@ -705,3 +705,3 @@ ++ ) { ++- [Some(ref_a), Some(ref_b)] => { +++ Some([ref_a, ref_b]) => { ++ mem::swap(ref_a, ref_b); +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/debian/patches/series mesa-25.3.3/subprojects/indexmap-2.7.0/debian/patches/series +--- mesa-25.3.3/subprojects/indexmap-2.7.0/debian/patches/series 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/debian/patches/series 2025-01-11 13:48:35.000000000 -0500 +@@ -0,0 +1,4 @@ ++relax-deps.patch ++disable-optional-deps.patch ++no-benches.patch ++fix-tests-no-default-features.patch +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/.github/workflows/ci.yml mesa-25.3.3/subprojects/indexmap-2.7.0/.github/workflows/ci.yml +--- mesa-25.3.3/subprojects/indexmap-2.7.0/.github/workflows/ci.yml 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/.github/workflows/ci.yml 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,152 @@ ++on: ++ push: ++ branches: [ master ] ++ pull_request: ++ branches: [ master ] ++ merge_group: ++ ++name: CI ++ ++env: ++ CARGO_TERM_COLOR: always ++ CARGO_INCREMENTAL: 0 ++ ++jobs: ++ tests: ++ runs-on: ubuntu-latest ++ strategy: ++ matrix: ++ include: ++ - rust: 1.63.0 # MSRV ++ features: ++ - rust: stable ++ features: arbitrary ++ - rust: stable ++ features: quickcheck ++ - rust: stable ++ features: rayon ++ - rust: stable ++ features: rustc-rayon ++ - rust: stable ++ features: serde ++ - rust: stable ++ features: borsh ++ - rust: stable ++ features: std ++ - rust: beta ++ features: ++ - rust: nightly ++ bench: test build benchmarks ++ ++ steps: ++ - uses: actions/checkout@v4 ++ - uses: actions/cache@v4 ++ if: matrix.rust == '1.63.0' ++ with: ++ path: ~/.cargo/registry/index ++ key: cargo-git-index ++ - uses: dtolnay/rust-toolchain@master ++ with: ++ toolchain: ${{ matrix.rust }} ++ - name: Downgrade dependencies ++ if: matrix.rust == '1.63.0' ++ run: | ++ cargo generate-lockfile ++ cargo update -p hashbrown --precise 0.15.0 ++ - name: Tests ++ run: | ++ cargo build --verbose --features "${{ matrix.features }}" ++ cargo doc --verbose --features "${{ matrix.features }}" ++ cargo test --verbose --features "${{ matrix.features }}" ++ cargo test --release --verbose --features "${{ matrix.features }}" ++ - name: Tests (serde) ++ if: matrix.features == 'serde' ++ run: | ++ cargo test --verbose -p test-serde ++ - name: Test run benchmarks ++ if: matrix.bench != '' ++ run: cargo test -v --benches ++ ++ nostd_build: ++ runs-on: ubuntu-latest ++ strategy: ++ matrix: ++ include: ++ - rust: 1.63.0 ++ target: thumbv6m-none-eabi ++ - rust: stable ++ target: thumbv6m-none-eabi ++ ++ steps: ++ - uses: actions/checkout@v4 ++ - uses: actions/cache@v4 ++ if: matrix.rust == '1.63.0' ++ with: ++ path: ~/.cargo/registry/index ++ key: cargo-git-index ++ - uses: dtolnay/rust-toolchain@master ++ with: ++ toolchain: ${{ matrix.rust }} ++ target: ${{ matrix.target }} ++ - name: Downgrade dependencies ++ if: matrix.rust == '1.63.0' ++ run: | ++ cargo generate-lockfile ++ cargo update -p hashbrown --precise 0.15.0 ++ - name: Tests ++ run: | ++ cargo build -vv --target=${{ matrix.target }} --no-default-features ++ cargo build -v -p test-nostd --target=${{ matrix.target }} ++ ++ clippy: ++ runs-on: ubuntu-latest ++ steps: ++ - uses: actions/checkout@v4 ++ - uses: dtolnay/rust-toolchain@beta ++ with: ++ components: clippy ++ - run: cargo clippy --all-features ++ ++ miri: ++ runs-on: ubuntu-latest ++ steps: ++ - uses: actions/checkout@v4 ++ - uses: dtolnay/rust-toolchain@nightly ++ with: ++ components: miri ++ - run: cargo miri test ++ ++ minimal-versions: ++ name: Check MSRV and minimal-versions ++ runs-on: ubuntu-latest ++ steps: ++ - uses: actions/checkout@v4 ++ - uses: actions/cache@v4 ++ with: ++ path: ~/.cargo/registry/index ++ key: cargo-git-index ++ - uses: dtolnay/rust-toolchain@nightly ++ - uses: dtolnay/rust-toolchain@1.63.0 # MSRV ++ - uses: taiki-e/install-action@v2 ++ with: ++ tool: cargo-hack ++ - run: cargo +nightly hack generate-lockfile --remove-dev-deps -Z direct-minimal-versions ++ - name: Build (nightly) ++ run: cargo +nightly build --verbose --all-features ++ - name: Build (MSRV) ++ run: cargo build --verbose --features arbitrary,quickcheck,serde,rayon ++ ++ # One job that "summarizes" the success state of this pipeline. This can then be added to branch ++ # protection, rather than having to add each job separately. ++ success: ++ name: Success ++ runs-on: ubuntu-latest ++ needs: [tests, nostd_build, clippy, miri, minimal-versions] ++ # Github branch protection is exceedingly silly and treats "jobs skipped because a dependency ++ # failed" as success. So we have to do some contortions to ensure the job fails if any of its ++ # dependencies fails. ++ if: always() # make sure this is never "skipped" ++ steps: ++ # Manually check the status of all dependencies. `if: failure()` does not work. ++ - name: check if any dependency failed ++ run: jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}' +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/.gitignore mesa-25.3.3/subprojects/indexmap-2.7.0/.gitignore +--- mesa-25.3.3/subprojects/indexmap-2.7.0/.gitignore 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/.gitignore 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,2 @@ ++target ++Cargo.lock +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/LICENSE-APACHE mesa-25.3.3/subprojects/indexmap-2.7.0/LICENSE-APACHE +--- mesa-25.3.3/subprojects/indexmap-2.7.0/LICENSE-APACHE 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/LICENSE-APACHE 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,201 @@ ++ Apache License ++ Version 2.0, January 2004 ++ http://www.apache.org/licenses/ ++ ++TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION ++ ++1. Definitions. ++ ++ "License" shall mean the terms and conditions for use, reproduction, ++ and distribution as defined by Sections 1 through 9 of this document. ++ ++ "Licensor" shall mean the copyright owner or entity authorized by ++ the copyright owner that is granting the License. ++ ++ "Legal Entity" shall mean the union of the acting entity and all ++ other entities that control, are controlled by, or are under common ++ control with that entity. For the purposes of this definition, ++ "control" means (i) the power, direct or indirect, to cause the ++ direction or management of such entity, whether by contract or ++ otherwise, or (ii) ownership of fifty percent (50%) or more of the ++ outstanding shares, or (iii) beneficial ownership of such entity. ++ ++ "You" (or "Your") shall mean an individual or Legal Entity ++ exercising permissions granted by this License. ++ ++ "Source" form shall mean the preferred form for making modifications, ++ including but not limited to software source code, documentation ++ source, and configuration files. ++ ++ "Object" form shall mean any form resulting from mechanical ++ transformation or translation of a Source form, including but ++ not limited to compiled object code, generated documentation, ++ and conversions to other media types. ++ ++ "Work" shall mean the work of authorship, whether in Source or ++ Object form, made available under the License, as indicated by a ++ copyright notice that is included in or attached to the work ++ (an example is provided in the Appendix below). ++ ++ "Derivative Works" shall mean any work, whether in Source or Object ++ form, that is based on (or derived from) the Work and for which the ++ editorial revisions, annotations, elaborations, or other modifications ++ represent, as a whole, an original work of authorship. For the purposes ++ of this License, Derivative Works shall not include works that remain ++ separable from, or merely link (or bind by name) to the interfaces of, ++ the Work and Derivative Works thereof. ++ ++ "Contribution" shall mean any work of authorship, including ++ the original version of the Work and any modifications or additions ++ to that Work or Derivative Works thereof, that is intentionally ++ submitted to Licensor for inclusion in the Work by the copyright owner ++ or by an individual or Legal Entity authorized to submit on behalf of ++ the copyright owner. For the purposes of this definition, "submitted" ++ means any form of electronic, verbal, or written communication sent ++ to the Licensor or its representatives, including but not limited to ++ communication on electronic mailing lists, source code control systems, ++ and issue tracking systems that are managed by, or on behalf of, the ++ Licensor for the purpose of discussing and improving the Work, but ++ excluding communication that is conspicuously marked or otherwise ++ designated in writing by the copyright owner as "Not a Contribution." ++ ++ "Contributor" shall mean Licensor and any individual or Legal Entity ++ on behalf of whom a Contribution has been received by Licensor and ++ subsequently incorporated within the Work. ++ ++2. Grant of Copyright License. Subject to the terms and conditions of ++ this License, each Contributor hereby grants to You a perpetual, ++ worldwide, non-exclusive, no-charge, royalty-free, irrevocable ++ copyright license to reproduce, prepare Derivative Works of, ++ publicly display, publicly perform, sublicense, and distribute the ++ Work and such Derivative Works in Source or Object form. ++ ++3. Grant of Patent License. Subject to the terms and conditions of ++ this License, each Contributor hereby grants to You a perpetual, ++ worldwide, non-exclusive, no-charge, royalty-free, irrevocable ++ (except as stated in this section) patent license to make, have made, ++ use, offer to sell, sell, import, and otherwise transfer the Work, ++ where such license applies only to those patent claims licensable ++ by such Contributor that are necessarily infringed by their ++ Contribution(s) alone or by combination of their Contribution(s) ++ with the Work to which such Contribution(s) was submitted. If You ++ institute patent litigation against any entity (including a ++ cross-claim or counterclaim in a lawsuit) alleging that the Work ++ or a Contribution incorporated within the Work constitutes direct ++ or contributory patent infringement, then any patent licenses ++ granted to You under this License for that Work shall terminate ++ as of the date such litigation is filed. ++ ++4. Redistribution. You may reproduce and distribute copies of the ++ Work or Derivative Works thereof in any medium, with or without ++ modifications, and in Source or Object form, provided that You ++ meet the following conditions: ++ ++ (a) You must give any other recipients of the Work or ++ Derivative Works a copy of this License; and ++ ++ (b) You must cause any modified files to carry prominent notices ++ stating that You changed the files; and ++ ++ (c) You must retain, in the Source form of any Derivative Works ++ that You distribute, all copyright, patent, trademark, and ++ attribution notices from the Source form of the Work, ++ excluding those notices that do not pertain to any part of ++ the Derivative Works; and ++ ++ (d) If the Work includes a "NOTICE" text file as part of its ++ distribution, then any Derivative Works that You distribute must ++ include a readable copy of the attribution notices contained ++ within such NOTICE file, excluding those notices that do not ++ pertain to any part of the Derivative Works, in at least one ++ of the following places: within a NOTICE text file distributed ++ as part of the Derivative Works; within the Source form or ++ documentation, if provided along with the Derivative Works; or, ++ within a display generated by the Derivative Works, if and ++ wherever such third-party notices normally appear. The contents ++ of the NOTICE file are for informational purposes only and ++ do not modify the License. You may add Your own attribution ++ notices within Derivative Works that You distribute, alongside ++ or as an addendum to the NOTICE text from the Work, provided ++ that such additional attribution notices cannot be construed ++ as modifying the License. ++ ++ You may add Your own copyright statement to Your modifications and ++ may provide additional or different license terms and conditions ++ for use, reproduction, or distribution of Your modifications, or ++ for any such Derivative Works as a whole, provided Your use, ++ reproduction, and distribution of the Work otherwise complies with ++ the conditions stated in this License. ++ ++5. Submission of Contributions. Unless You explicitly state otherwise, ++ any Contribution intentionally submitted for inclusion in the Work ++ by You to the Licensor shall be under the terms and conditions of ++ this License, without any additional terms or conditions. ++ Notwithstanding the above, nothing herein shall supersede or modify ++ the terms of any separate license agreement you may have executed ++ with Licensor regarding such Contributions. ++ ++6. Trademarks. This License does not grant permission to use the trade ++ names, trademarks, service marks, or product names of the Licensor, ++ except as required for reasonable and customary use in describing the ++ origin of the Work and reproducing the content of the NOTICE file. ++ ++7. Disclaimer of Warranty. Unless required by applicable law or ++ agreed to in writing, Licensor provides the Work (and each ++ Contributor provides its Contributions) on an "AS IS" BASIS, ++ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or ++ implied, including, without limitation, any warranties or conditions ++ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A ++ PARTICULAR PURPOSE. You are solely responsible for determining the ++ appropriateness of using or redistributing the Work and assume any ++ risks associated with Your exercise of permissions under this License. ++ ++8. Limitation of Liability. In no event and under no legal theory, ++ whether in tort (including negligence), contract, or otherwise, ++ unless required by applicable law (such as deliberate and grossly ++ negligent acts) or agreed to in writing, shall any Contributor be ++ liable to You for damages, including any direct, indirect, special, ++ incidental, or consequential damages of any character arising as a ++ result of this License or out of the use or inability to use the ++ Work (including but not limited to damages for loss of goodwill, ++ work stoppage, computer failure or malfunction, or any and all ++ other commercial damages or losses), even if such Contributor ++ has been advised of the possibility of such damages. ++ ++9. Accepting Warranty or Additional Liability. While redistributing ++ the Work or Derivative Works thereof, You may choose to offer, ++ and charge a fee for, acceptance of support, warranty, indemnity, ++ or other liability obligations and/or rights consistent with this ++ License. However, in accepting such obligations, You may act only ++ on Your own behalf and on Your sole responsibility, not on behalf ++ of any other Contributor, and only if You agree to indemnify, ++ defend, and hold each Contributor harmless for any liability ++ incurred by, or claims asserted against, such Contributor by reason ++ of your accepting any such warranty or additional liability. ++ ++END OF TERMS AND CONDITIONS ++ ++APPENDIX: How to apply the Apache License to your work. ++ ++ To apply the Apache License to your work, attach the following ++ boilerplate notice, with the fields enclosed by brackets "[]" ++ replaced with your own identifying information. (Don't include ++ the brackets!) The text should be enclosed in the appropriate ++ comment syntax for the file format. We also recommend that a ++ file or class name and description of purpose be included on the ++ same "printed page" as the copyright notice for easier ++ identification within third-party archives. ++ ++Copyright [yyyy] [name of copyright owner] ++ ++Licensed under the Apache License, Version 2.0 (the "License"); ++you may not use this file except in compliance with the License. ++You may obtain a copy of the License at ++ ++ http://www.apache.org/licenses/LICENSE-2.0 ++ ++Unless required by applicable law or agreed to in writing, software ++distributed under the License is distributed on an "AS IS" BASIS, ++WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++See the License for the specific language governing permissions and ++limitations under the License. +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/LICENSE-MIT mesa-25.3.3/subprojects/indexmap-2.7.0/LICENSE-MIT +--- mesa-25.3.3/subprojects/indexmap-2.7.0/LICENSE-MIT 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/LICENSE-MIT 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,25 @@ ++Copyright (c) 2016--2017 ++ ++Permission is hereby granted, free of charge, to any ++person obtaining a copy of this software and associated ++documentation files (the "Software"), to deal in the ++Software without restriction, including without ++limitation the rights to use, copy, modify, merge, ++publish, distribute, sublicense, and/or sell copies of ++the Software, and to permit persons to whom the Software ++is furnished to do so, subject to the following ++conditions: ++ ++The above copyright notice and this permission notice ++shall be included in all copies or substantial portions ++of the Software. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ++ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED ++TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A ++PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT ++SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ++CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION ++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR ++IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ++DEALINGS IN THE SOFTWARE. +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/meson.build mesa-25.3.3/subprojects/indexmap-2.7.0/meson.build +--- mesa-25.3.3/subprojects/indexmap-2.7.0/meson.build 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/meson.build 2026-05-26 15:46:06.000000000 -0500 +@@ -0,0 +1,22 @@ ++project('indexmap', 'rust', version : '2.7.0', license : 'MIT OR Apache-2.0') ++ ++dep_equivalent = subproject('equivalent-1-rs').get_variable('dep_equivalent') ++dep_hashbrown = subproject('hashbrown-0.14-rs').get_variable('dep_hashbrown') ++ ++rust_args = [ ++ '--cfg', 'feature="std"' ++] ++ ++lib = static_library( ++ 'indexmap', ++ 'src/lib.rs', ++ rust_args : rust_args, ++ override_options : ['rust_std=2021', 'build.rust_std=2021'], ++ rust_abi : 'rust', ++ native : true, ++ dependencies : [dep_equivalent, dep_hashbrown] ++) ++ ++dep_indexmap = declare_dependency( ++ link_with : [lib], ++) +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/.meson-subproject-wrap-hash.txt mesa-25.3.3/subprojects/indexmap-2.7.0/.meson-subproject-wrap-hash.txt +--- mesa-25.3.3/subprojects/indexmap-2.7.0/.meson-subproject-wrap-hash.txt 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/.meson-subproject-wrap-hash.txt 2026-05-29 13:40:53.000000000 -0500 +@@ -0,0 +1 @@ ++491c5744035ac41b8c0406a5501940857fce67b80537594bad3e17cb52d6b1a4 +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/README.md mesa-25.3.3/subprojects/indexmap-2.7.0/README.md +--- mesa-25.3.3/subprojects/indexmap-2.7.0/README.md 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/README.md 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,59 @@ ++# indexmap ++ ++[![build status](https://github.com/indexmap-rs/indexmap/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/indexmap-rs/indexmap/actions) ++[![crates.io](https://img.shields.io/crates/v/indexmap.svg)](https://crates.io/crates/indexmap) ++[![docs](https://docs.rs/indexmap/badge.svg)](https://docs.rs/indexmap) ++[![rustc](https://img.shields.io/badge/rust-1.63%2B-orange.svg)](https://img.shields.io/badge/rust-1.63%2B-orange.svg) ++ ++A pure-Rust hash table which preserves (in a limited sense) insertion order. ++ ++This crate implements compact map and set data-structures, ++where the iteration order of the keys is independent from their hash or ++value. It preserves insertion order (except after removals), and it ++allows lookup of entries by either hash table key or numerical index. ++ ++Note: this crate was originally released under the name `ordermap`, ++but it was renamed to `indexmap` to better reflect its features. ++The [`ordermap`](https://crates.io/crates/ordermap) crate now exists ++as a wrapper over `indexmap` with stronger ordering properties. ++ ++# Background ++ ++This was inspired by Python 3.6's new dict implementation (which remembers ++the insertion order and is fast to iterate, and is compact in memory). ++ ++Some of those features were translated to Rust, and some were not. The result ++was indexmap, a hash table that has following properties: ++ ++- Order is **independent of hash function** and hash values of keys. ++- Fast to iterate. ++- Indexed in compact space. ++- Preserves insertion order **as long** as you don't call `.remove()`, ++ `.swap_remove()`, or other methods that explicitly change order. ++ The alternate `.shift_remove()` does preserve relative order. ++- Uses hashbrown for the inner table, just like Rust's libstd `HashMap` does. ++ ++## Performance ++ ++`IndexMap` derives a couple of performance facts directly from how it is constructed, ++which is roughly: ++ ++> A raw hash table of key-value indices, and a vector of key-value pairs. ++ ++- Iteration is very fast since it is on the dense key-values. ++- Removal is fast since it moves memory areas only in the table, ++ and uses a single swap in the vector. ++- Lookup is fast-ish because the initial 7-bit hash lookup uses SIMD, and indices are ++ densely stored. Lookup also is slow-ish since the actual key-value pairs are stored ++ separately. (Visible when cpu caches size is limiting.) ++ ++- In practice, `IndexMap` has been tested out as the hashmap in rustc in [PR45282] and ++ the performance was roughly on par across the whole workload. ++- If you want the properties of `IndexMap`, or its strongest performance points ++ fits your workload, it might be the best hash table implementation. ++ ++[PR45282]: https://github.com/rust-lang/rust/pull/45282 ++ ++# Recent Changes ++ ++See [RELEASES.md](https://github.com/indexmap-rs/indexmap/blob/master/RELEASES.md). +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/RELEASES.md mesa-25.3.3/subprojects/indexmap-2.7.0/RELEASES.md +--- mesa-25.3.3/subprojects/indexmap-2.7.0/RELEASES.md 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/RELEASES.md 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,536 @@ ++# Releases ++ ++## 2.7.0 (2024-11-30) ++ ++- Added methods `Entry::insert_entry` and `VacantEntry::insert_entry`, returning ++ an `OccupiedEntry` after insertion. ++ ++## 2.6.0 (2024-10-01) ++ ++- Implemented `Clone` for `map::IntoIter` and `set::IntoIter`. ++- Updated the `hashbrown` dependency to version 0.15. ++ ++## 2.5.0 (2024-08-30) ++ ++- Added an `insert_before` method to `IndexMap` and `IndexSet`, as an ++ alternative to `shift_insert` with different behavior on existing entries. ++- Added `first_entry` and `last_entry` methods to `IndexMap`. ++- Added `From` implementations between `IndexedEntry` and `OccupiedEntry`. ++ ++## 2.4.0 (2024-08-13) ++ ++- Added methods `IndexMap::append` and `IndexSet::append`, moving all items from ++ one map or set into another, and leaving the original capacity for reuse. ++ ++## 2.3.0 (2024-07-31) ++ ++- Added trait `MutableEntryKey` for opt-in mutable access to map entry keys. ++- Added method `MutableKeys::iter_mut2` for opt-in mutable iteration of map ++ keys and values. ++ ++## 2.2.6 (2024-03-22) ++ ++- Added trait `MutableValues` for opt-in mutable access to set values. ++ ++## 2.2.5 (2024-02-29) ++ ++- Added optional `borsh` serialization support. ++ ++## 2.2.4 (2024-02-28) ++ ++- Added an `insert_sorted` method on `IndexMap`, `IndexSet`, and `VacantEntry`. ++- Avoid hashing for lookups in single-entry maps. ++- Limit preallocated memory in `serde` deserializers. ++ ++## 2.2.3 (2024-02-11) ++ ++- Added `move_index` and `swap_indices` methods to `IndexedEntry`, ++ `OccupiedEntry`, and `RawOccupiedEntryMut`, functioning like the existing ++ methods on `IndexMap`. ++- Added `shift_insert` methods on `VacantEntry` and `RawVacantEntryMut`, as ++ well as `shift_insert_hashed_nocheck` on the latter, to insert the new entry ++ at a particular index. ++- Added `shift_insert` methods on `IndexMap` and `IndexSet` to insert a new ++ entry at a particular index, or else move an existing entry there. ++ ++## 2.2.2 (2024-01-31) ++ ++- Added indexing methods to raw entries: `RawEntryBuilder::from_hash_full`, ++ `RawEntryBuilder::index_from_hash`, and `RawEntryMut::index`. ++ ++## 2.2.1 (2024-01-28) ++ ++- Corrected the signature of `RawOccupiedEntryMut::into_key(self) -> &'a mut K`, ++ This a breaking change from 2.2.0, but that version was published for less ++ than a day and has now been yanked. ++ ++## 2.2.0 (2024-01-28) ++ ++- The new `IndexMap::get_index_entry` method finds an entry by its index for ++ in-place manipulation. ++ ++- The `Keys` iterator now implements `Index` for quick access to the ++ entry's key, compared to indexing the map to get the value. ++ ++- The new `IndexMap::splice` and `IndexSet::splice` methods will drain the ++ given range as an iterator, and then replace that range with entries from ++ an input iterator. ++ ++- The new trait `RawEntryApiV1` offers opt-in access to a raw entry API for ++ `IndexMap`, corresponding to the unstable API on `HashSet` as of Rust 1.75. ++ ++- Many `IndexMap` and `IndexSet` methods have relaxed their type constraints, ++ e.g. removing `K: Hash` on methods that don't actually need to hash. ++ ++- Removal methods `remove`, `remove_entry`, and `take` are now deprecated ++ in favor of their `shift_` or `swap_` prefixed variants, which are more ++ explicit about their effect on the index and order of remaining items. ++ The deprecated methods will remain to guide drop-in replacements from ++ `HashMap` and `HashSet` toward the prefixed methods. ++ ++## 2.1.0 (2023-10-31) ++ ++- Empty slices can now be created with `map::Slice::{new, new_mut}` and ++ `set::Slice::new`. In addition, `Slice::new`, `len`, and `is_empty` are ++ now `const` functions on both types. ++ ++- `IndexMap`, `IndexSet`, and their respective `Slice`s all have binary ++ search methods for sorted data: map `binary_search_keys` and set ++ `binary_search` for plain comparison, `binary_search_by` for custom ++ comparators, `binary_search_by_key` for key extraction, and ++ `partition_point` for boolean conditions. ++ ++## 2.0.2 (2023-09-29) ++ ++- The `hashbrown` dependency has been updated to version 0.14.1 to ++ complete the support for Rust 1.63. ++ ++## 2.0.1 (2023-09-27) ++ ++- **MSRV**: Rust 1.63.0 is now supported as well, pending publication of ++ `hashbrown`'s relaxed MSRV (or use cargo `--ignore-rust-version`). ++ ++## 2.0.0 (2023-06-23) ++ ++- **MSRV**: Rust 1.64.0 or later is now required. ++ ++- The `"std"` feature is no longer auto-detected. It is included in the ++ default feature set, or else can be enabled like any other Cargo feature. ++ ++- The `"serde-1"` feature has been removed, leaving just the optional ++ `"serde"` dependency to be enabled like a feature itself. ++ ++- `IndexMap::get_index_mut` now returns `Option<(&K, &mut V)>`, changing ++ the key part from `&mut K` to `&K`. There is also a new alternative ++ `MutableKeys::get_index_mut2` to access the former behavior. ++ ++- The new `map::Slice` and `set::Slice` offer a linear view of maps ++ and sets, behaving a lot like normal `[(K, V)]` and `[T]` slices. Notably, ++ comparison traits like `Eq` only consider items in order, rather than hash ++ lookups, and slices even implement `Hash`. ++ ++- `IndexMap` and `IndexSet` now have `sort_by_cached_key` and ++ `par_sort_by_cached_key` methods which perform stable sorts in place ++ using a key extraction function. ++ ++- `IndexMap` and `IndexSet` now have `reserve_exact`, `try_reserve`, and ++ `try_reserve_exact` methods that correspond to the same methods on `Vec`. ++ However, exactness only applies to the direct capacity for items, while the ++ raw hash table still follows its own rules for capacity and load factor. ++ ++- The `Equivalent` trait is now re-exported from the `equivalent` crate, ++ intended as a common base to allow types to work with multiple map types. ++ ++- The `hashbrown` dependency has been updated to version 0.14. ++ ++- The `serde_seq` module has been moved from the crate root to below the ++ `map` module. ++ ++## 1.9.3 (2023-03-24) ++ ++- Bump the `rustc-rayon` dependency, for compiler use only. ++ ++## 1.9.2 (2022-11-17) ++ ++- `IndexMap` and `IndexSet` both implement `arbitrary::Arbitrary<'_>` and ++ `quickcheck::Arbitrary` if those optional dependency features are enabled. ++ ++## 1.9.1 (2022-06-21) ++ ++- The MSRV now allows Rust 1.56.0 as well. However, currently `hashbrown` ++ 0.12.1 requires 1.56.1, so users on 1.56.0 should downgrade that to 0.12.0 ++ until there is a later published version relaxing its requirement. ++ ++## 1.9.0 (2022-06-16) ++ ++- **MSRV**: Rust 1.56.1 or later is now required. ++ ++- The `hashbrown` dependency has been updated to version 0.12. ++ ++- `IterMut` and `ValuesMut` now implement `Debug`. ++ ++- The new `IndexMap::shrink_to` and `IndexSet::shrink_to` methods shrink ++ the capacity with a lower bound. ++ ++- The new `IndexMap::move_index` and `IndexSet::move_index` methods change ++ the position of an item from one index to another, shifting the items ++ between to accommodate the move. ++ ++## 1.8.2 (2022-05-27) ++ ++- Bump the `rustc-rayon` dependency, for compiler use only. ++ ++## 1.8.1 (2022-03-29) ++ ++- The new `IndexSet::replace_full` will return the index of the item along ++ with the replaced value, if any, by @zakcutner in PR [222]. ++ ++[222]: https://github.com/indexmap-rs/indexmap/pull/222 ++ ++## 1.8.0 (2022-01-07) ++ ++- The new `IndexMap::into_keys` and `IndexMap::into_values` will consume ++ the map into keys or values, respectively, matching Rust 1.54's `HashMap` ++ methods, by @taiki-e in PR [195]. ++ ++- More of the iterator types implement `Debug`, `ExactSizeIterator`, and ++ `FusedIterator`, by @cuviper in PR [196]. ++ ++- `IndexMap` and `IndexSet` now implement rayon's `ParallelDrainRange`, ++ by @cuviper in PR [197]. ++ ++- `IndexMap::with_hasher` and `IndexSet::with_hasher` are now `const` ++ functions, allowing static maps and sets, by @mwillsey in PR [203]. ++ ++- `IndexMap` and `IndexSet` now implement `From` for arrays, matching ++ Rust 1.56's implementation for `HashMap`, by @rouge8 in PR [205]. ++ ++- `IndexMap` and `IndexSet` now have methods `sort_unstable_keys`, ++ `sort_unstable_by`, `sorted_unstable_by`, and `par_*` equivalents, ++ which sort in-place without preserving the order of equal items, by ++ @bhgomes in PR [211]. ++ ++[195]: https://github.com/indexmap-rs/indexmap/pull/195 ++[196]: https://github.com/indexmap-rs/indexmap/pull/196 ++[197]: https://github.com/indexmap-rs/indexmap/pull/197 ++[203]: https://github.com/indexmap-rs/indexmap/pull/203 ++[205]: https://github.com/indexmap-rs/indexmap/pull/205 ++[211]: https://github.com/indexmap-rs/indexmap/pull/211 ++ ++## 1.7.0 (2021-06-29) ++ ++- **MSRV**: Rust 1.49 or later is now required. ++ ++- The `hashbrown` dependency has been updated to version 0.11. ++ ++## 1.6.2 (2021-03-05) ++ ++- Fixed to match `std` behavior, `OccupiedEntry::key` now references the ++ existing key in the map instead of the lookup key, by @cuviper in PR [170]. ++ ++- The new `Entry::or_insert_with_key` matches Rust 1.50's `Entry` method, ++ passing `&K` to the callback to create a value, by @cuviper in PR [175]. ++ ++[170]: https://github.com/indexmap-rs/indexmap/pull/170 ++[175]: https://github.com/indexmap-rs/indexmap/pull/175 ++ ++## 1.6.1 (2020-12-14) ++ ++- The new `serde_seq` module implements `IndexMap` serialization as a ++ sequence to ensure order is preserved, by @cuviper in PR [158]. ++ ++- New methods on maps and sets work like the `Vec`/slice methods by the same name: ++ `truncate`, `split_off`, `first`, `first_mut`, `last`, `last_mut`, and ++ `swap_indices`, by @cuviper in PR [160]. ++ ++[158]: https://github.com/indexmap-rs/indexmap/pull/158 ++[160]: https://github.com/indexmap-rs/indexmap/pull/160 ++ ++## 1.6.0 (2020-09-05) ++ ++- **MSRV**: Rust 1.36 or later is now required. ++ ++- The `hashbrown` dependency has been updated to version 0.9. ++ ++## 1.5.2 (2020-09-01) ++ ++- The new "std" feature will force the use of `std` for users that explicitly ++ want the default `S = RandomState`, bypassing the autodetection added in 1.3.0, ++ by @cuviper in PR [145]. ++ ++[145]: https://github.com/indexmap-rs/indexmap/pull/145 ++ ++## 1.5.1 (2020-08-07) ++ ++- Values can now be indexed by their `usize` position by @cuviper in PR [132]. ++ ++- Some of the generic bounds have been relaxed to match `std` by @cuviper in PR [141]. ++ ++- `drain` now accepts any `R: RangeBounds` by @cuviper in PR [142]. ++ ++[132]: https://github.com/indexmap-rs/indexmap/pull/132 ++[141]: https://github.com/indexmap-rs/indexmap/pull/141 ++[142]: https://github.com/indexmap-rs/indexmap/pull/142 ++ ++## 1.5.0 (2020-07-17) ++ ++- **MSRV**: Rust 1.32 or later is now required. ++ ++- The inner hash table is now based on `hashbrown` by @cuviper in PR [131]. ++ This also completes the method `reserve` and adds `shrink_to_fit`. ++ ++- Add new methods `get_key_value`, `remove_entry`, `swap_remove_entry`, ++ and `shift_remove_entry`, by @cuviper in PR [136] ++ ++- `Clone::clone_from` reuses allocations by @cuviper in PR [125] ++ ++- Add new method `reverse` by @linclelinkpart5 in PR [128] ++ ++[125]: https://github.com/indexmap-rs/indexmap/pull/125 ++[128]: https://github.com/indexmap-rs/indexmap/pull/128 ++[131]: https://github.com/indexmap-rs/indexmap/pull/131 ++[136]: https://github.com/indexmap-rs/indexmap/pull/136 ++ ++## 1.4.0 (2020-06-01) ++ ++- Add new method `get_index_of` by @Thermatrix in PR [115] and [120] ++ ++- Fix build script rebuild-if-changed configuration to use "build.rs"; ++ fixes issue [123]. Fix by @cuviper. ++ ++- Dev-dependencies (rand and quickcheck) have been updated. The crate's tests ++ now run using Rust 1.32 or later (MSRV for building the crate has not changed). ++ by @kjeremy and @bluss ++ ++[123]: https://github.com/indexmap-rs/indexmap/issues/123 ++[115]: https://github.com/indexmap-rs/indexmap/pull/115 ++[120]: https://github.com/indexmap-rs/indexmap/pull/120 ++ ++## 1.3.2 (2020-02-05) ++ ++- Maintenance update to regenerate the published `Cargo.toml`. ++ ++## 1.3.1 (2020-01-15) ++ ++- Maintenance update for formatting and `autocfg` 1.0. ++ ++## 1.3.0 (2019-10-18) ++ ++- The deprecation messages in the previous version have been removed. ++ (The methods have not otherwise changed.) Docs for removal methods have been ++ improved. ++- From Rust 1.36, this crate supports being built **without std**, requiring ++ `alloc` instead. This is enabled automatically when it is detected that ++ `std` is not available. There is no crate feature to enable/disable to ++ trigger this. The new build-dep `autocfg` enables this. ++ ++## 1.2.0 (2019-09-08) ++ ++- Plain `.remove()` now has a deprecation message, it informs the user ++ about picking one of the removal functions `swap_remove` and `shift_remove` ++ which have different performance and order semantics. ++ Plain `.remove()` will not be removed, the warning message and method ++ will remain until further. ++ ++- Add new method `shift_remove` for order preserving removal on the map, ++ and `shift_take` for the corresponding operation on the set. ++ ++- Add methods `swap_remove`, `swap_remove_entry` to `Entry`. ++ ++- Fix indexset/indexmap to support full paths, like `indexmap::indexmap!()` ++ ++- Internal improvements: fix warnings, deprecations and style lints ++ ++## 1.1.0 (2019-08-20) ++ ++- Added optional feature `"rayon"` that adds parallel iterator support ++ to `IndexMap` and `IndexSet` using Rayon. This includes all the regular ++ iterators in parallel versions, and parallel sort. ++ ++- Implemented `Clone` for `map::{Iter, Keys, Values}` and ++ `set::{Difference, Intersection, Iter, SymmetricDifference, Union}` ++ ++- Implemented `Debug` for `map::{Entry, IntoIter, Iter, Keys, Values}` and ++ `set::{Difference, Intersection, IntoIter, Iter, SymmetricDifference, Union}` ++ ++- Serde trait `IntoDeserializer` are implemented for `IndexMap` and `IndexSet`. ++ ++- Minimum Rust version requirement increased to Rust 1.30 for development builds. ++ ++## 1.0.2 (2018-10-22) ++ ++- The new methods `IndexMap::insert_full` and `IndexSet::insert_full` are ++ both like `insert` with the index included in the return value. ++ ++- The new method `Entry::and_modify` can be used to modify occupied ++ entries, matching the new methods of `std` maps in Rust 1.26. ++ ++- The new method `Entry::or_default` inserts a default value in unoccupied ++ entries, matching the new methods of `std` maps in Rust 1.28. ++ ++## 1.0.1 (2018-03-24) ++ ++- Document Rust version policy for the crate (see rustdoc) ++ ++## 1.0.0 (2018-03-11) ++ ++- This is the 1.0 release for `indexmap`! (the crate and datastructure ++ formerly known as “ordermap”) ++- `OccupiedEntry::insert` changed its signature, to use `&mut self` for ++ the method receiver, matching the equivalent method for a standard ++ `HashMap`. Thanks to @dtolnay for finding this bug. ++- The deprecated old names from ordermap were removed: `OrderMap`, ++ `OrderSet`, `ordermap!{}`, `orderset!{}`. Use the new `IndexMap` ++ etc names instead. ++ ++## 0.4.1 (2018-02-14) ++ ++- Renamed crate to `indexmap`; the `ordermap` crate is now deprecated ++ and the types `OrderMap/Set` now have a deprecation notice. ++ ++## 0.4.0 (2018-02-02) ++ ++- This is the last release series for this `ordermap` under that name, ++ because the crate is **going to be renamed** to `indexmap` (with types ++ `IndexMap`, `IndexSet`) and no change in functionality! ++- The map and its associated structs moved into the `map` submodule of the ++ crate, so that the map and set are symmetric ++ ++ + The iterators, `Entry` and other structs are now under `ordermap::map::` ++ ++- Internally refactored `OrderMap` so that all the main algorithms ++ (insertion, lookup, removal etc) that don't use the `S` parameter (the ++ hasher) are compiled without depending on `S`, which reduces generics bloat. ++ ++- `Entry` no longer has a type parameter `S`, which is just like ++ the standard `HashMap`'s entry. ++ ++- Minimum Rust version requirement increased to Rust 1.18 ++ ++## 0.3.5 (2018-01-14) ++ ++- Documentation improvements ++ ++## 0.3.4 (2018-01-04) ++ ++- The `.retain()` methods for `OrderMap` and `OrderSet` now ++ traverse the elements in order, and the retained elements **keep their order** ++- Added new methods `.sort_by()`, `.sort_keys()` to `OrderMap` and ++ `.sort_by()`, `.sort()` to `OrderSet`. These methods allow you to ++ sort the maps in place efficiently. ++ ++## 0.3.3 (2017-12-28) ++ ++- Document insertion behaviour better by @lucab ++- Updated dependences (no feature changes) by @ignatenkobrain ++ ++## 0.3.2 (2017-11-25) ++ ++- Add `OrderSet` by @cuviper! ++- `OrderMap::drain` is now (too) a double ended iterator. ++ ++## 0.3.1 (2017-11-19) ++ ++- In all ordermap iterators, forward the `collect` method to the underlying ++ iterator as well. ++- Add crates.io categories. ++ ++## 0.3.0 (2017-10-07) ++ ++- The methods `get_pair`, `get_pair_index` were both replaced by ++ `get_full` (and the same for the mutable case). ++- Method `swap_remove_pair` replaced by `swap_remove_full`. ++- Add trait `MutableKeys` for opt-in mutable key access. Mutable key access ++ is only possible through the methods of this extension trait. ++- Add new trait `Equivalent` for key equivalence. This extends the ++ `Borrow` trait mechanism for `OrderMap::get` in a backwards compatible ++ way, just some minor type inference related issues may become apparent. ++ See [#10] for more information. ++- Implement `Extend<(&K, &V)>` by @xfix. ++ ++[#10]: https://github.com/indexmap-rs/indexmap/pull/10 ++ ++## 0.2.13 (2017-09-30) ++ ++- Fix deserialization to support custom hashers by @Techcable. ++- Add methods `.index()` on the entry types by @garro95. ++ ++## 0.2.12 (2017-09-11) ++ ++- Add methods `.with_hasher()`, `.hasher()`. ++ ++## 0.2.11 (2017-08-29) ++ ++- Support `ExactSizeIterator` for the iterators. By @Binero. ++- Use `Box<[Pos]>` internally, saving a word in the `OrderMap` struct. ++- Serde support, with crate feature `"serde-1"`. By @xfix. ++ ++## 0.2.10 (2017-04-29) ++ ++- Add iterator `.drain(..)` by @stevej. ++ ++## 0.2.9 (2017-03-26) ++ ++- Add method `.is_empty()` by @overvenus. ++- Implement `PartialEq, Eq` by @overvenus. ++- Add method `.sorted_by()`. ++ ++## 0.2.8 (2017-03-01) ++ ++- Add iterators `.values()` and `.values_mut()`. ++- Fix compatibility with 32-bit platforms. ++ ++## 0.2.7 (2016-11-02) ++ ++- Add `.retain()`. ++ ++## 0.2.6 (2016-11-02) ++ ++- Add `OccupiedEntry::remove_entry` and other minor entry methods, ++ so that it now has all the features of `HashMap`'s entries. ++ ++## 0.2.5 (2016-10-31) ++ ++- Improved `.pop()` slightly. ++ ++## 0.2.4 (2016-10-22) ++ ++- Improved performance of `.insert()` ([#3]) by @pczarn. ++ ++[#3]: https://github.com/indexmap-rs/indexmap/pull/3 ++ ++## 0.2.3 (2016-10-11) ++ ++- Generalize `Entry` for now, so that it works on hashmaps with non-default ++ hasher. However, there's a lingering compat issue since libstd `HashMap` ++ does not parameterize its entries by the hasher (`S` typarm). ++- Special case some iterator methods like `.nth()`. ++ ++## 0.2.2 (2016-10-02) ++ ++- Disable the verbose `Debug` impl by default. ++ ++## 0.2.1 (2016-10-02) ++ ++- Fix doc links and clarify docs. ++ ++## 0.2.0 (2016-10-01) ++ ++- Add more `HashMap` methods & compat with its API. ++- Experimental support for `.entry()` (the simplest parts of the API). ++- Add `.reserve()` (placeholder impl). ++- Add `.remove()` as synonym for `.swap_remove()`. ++- Changed `.insert()` to swap value if the entry already exists, and ++ return `Option`. ++- Experimental support as an *indexed* hash map! Added methods ++ `.get_index()`, `.get_index_mut()`, `.swap_remove_index()`, ++ `.get_pair_index()`, `.get_pair_index_mut()`. ++ ++## 0.1.2 (2016-09-19) ++ ++- Implement the 32/32 split idea for `Pos` which improves cache utilization ++ and lookup performance. ++ ++## 0.1.1 (2016-09-16) ++ ++- Initial release. +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/.rustfmt.toml mesa-25.3.3/subprojects/indexmap-2.7.0/.rustfmt.toml +--- mesa-25.3.3/subprojects/indexmap-2.7.0/.rustfmt.toml 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/.rustfmt.toml 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1 @@ ++edition = "2021" +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/src/arbitrary.rs mesa-25.3.3/subprojects/indexmap-2.7.0/src/arbitrary.rs +--- mesa-25.3.3/subprojects/indexmap-2.7.0/src/arbitrary.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/src/arbitrary.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,77 @@ ++#[cfg(feature = "arbitrary")] ++#[cfg_attr(docsrs, doc(cfg(feature = "arbitrary")))] ++mod impl_arbitrary { ++ use crate::{IndexMap, IndexSet}; ++ use arbitrary::{Arbitrary, Result, Unstructured}; ++ use core::hash::{BuildHasher, Hash}; ++ ++ impl<'a, K, V, S> Arbitrary<'a> for IndexMap ++ where ++ K: Arbitrary<'a> + Hash + Eq, ++ V: Arbitrary<'a>, ++ S: BuildHasher + Default, ++ { ++ fn arbitrary(u: &mut Unstructured<'a>) -> Result { ++ u.arbitrary_iter()?.collect() ++ } ++ ++ fn arbitrary_take_rest(u: Unstructured<'a>) -> Result { ++ u.arbitrary_take_rest_iter()?.collect() ++ } ++ } ++ ++ impl<'a, T, S> Arbitrary<'a> for IndexSet ++ where ++ T: Arbitrary<'a> + Hash + Eq, ++ S: BuildHasher + Default, ++ { ++ fn arbitrary(u: &mut Unstructured<'a>) -> Result { ++ u.arbitrary_iter()?.collect() ++ } ++ ++ fn arbitrary_take_rest(u: Unstructured<'a>) -> Result { ++ u.arbitrary_take_rest_iter()?.collect() ++ } ++ } ++} ++ ++#[cfg(feature = "quickcheck")] ++#[cfg_attr(docsrs, doc(cfg(feature = "quickcheck")))] ++mod impl_quickcheck { ++ use crate::{IndexMap, IndexSet}; ++ use alloc::boxed::Box; ++ use alloc::vec::Vec; ++ use core::hash::{BuildHasher, Hash}; ++ use quickcheck::{Arbitrary, Gen}; ++ ++ impl Arbitrary for IndexMap ++ where ++ K: Arbitrary + Hash + Eq, ++ V: Arbitrary, ++ S: BuildHasher + Default + Clone + 'static, ++ { ++ fn arbitrary(g: &mut Gen) -> Self { ++ Self::from_iter(Vec::arbitrary(g)) ++ } ++ ++ fn shrink(&self) -> Box> { ++ let vec = Vec::from_iter(self.clone()); ++ Box::new(vec.shrink().map(Self::from_iter)) ++ } ++ } ++ ++ impl Arbitrary for IndexSet ++ where ++ T: Arbitrary + Hash + Eq, ++ S: BuildHasher + Default + Clone + 'static, ++ { ++ fn arbitrary(g: &mut Gen) -> Self { ++ Self::from_iter(Vec::arbitrary(g)) ++ } ++ ++ fn shrink(&self) -> Box> { ++ let vec = Vec::from_iter(self.clone()); ++ Box::new(vec.shrink().map(Self::from_iter)) ++ } ++ } ++} +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/src/borsh.rs mesa-25.3.3/subprojects/indexmap-2.7.0/src/borsh.rs +--- mesa-25.3.3/subprojects/indexmap-2.7.0/src/borsh.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/src/borsh.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,122 @@ ++#![cfg_attr(docsrs, doc(cfg(feature = "borsh")))] ++ ++use alloc::vec::Vec; ++use core::hash::BuildHasher; ++use core::hash::Hash; ++use core::mem::size_of; ++ ++use borsh::error::ERROR_ZST_FORBIDDEN; ++use borsh::io::{Error, ErrorKind, Read, Result, Write}; ++use borsh::{BorshDeserialize, BorshSerialize}; ++ ++use crate::map::IndexMap; ++use crate::set::IndexSet; ++ ++impl BorshSerialize for IndexMap ++where ++ K: BorshSerialize, ++ V: BorshSerialize, ++{ ++ #[inline] ++ fn serialize(&self, writer: &mut W) -> Result<()> { ++ check_zst::()?; ++ ++ let iterator = self.iter(); ++ ++ u32::try_from(iterator.len()) ++ .map_err(|_| ErrorKind::InvalidData)? ++ .serialize(writer)?; ++ ++ for (key, value) in iterator { ++ key.serialize(writer)?; ++ value.serialize(writer)?; ++ } ++ ++ Ok(()) ++ } ++} ++ ++impl BorshDeserialize for IndexMap ++where ++ K: BorshDeserialize + Eq + Hash, ++ V: BorshDeserialize, ++ S: BuildHasher + Default, ++{ ++ #[inline] ++ fn deserialize_reader(reader: &mut R) -> Result { ++ check_zst::()?; ++ let vec = >::deserialize_reader(reader)?; ++ Ok(vec.into_iter().collect::>()) ++ } ++} ++ ++impl BorshSerialize for IndexSet ++where ++ T: BorshSerialize, ++{ ++ #[inline] ++ fn serialize(&self, writer: &mut W) -> Result<()> { ++ check_zst::()?; ++ ++ let iterator = self.iter(); ++ ++ u32::try_from(iterator.len()) ++ .map_err(|_| ErrorKind::InvalidData)? ++ .serialize(writer)?; ++ ++ for item in iterator { ++ item.serialize(writer)?; ++ } ++ ++ Ok(()) ++ } ++} ++ ++impl BorshDeserialize for IndexSet ++where ++ T: BorshDeserialize + Eq + Hash, ++ S: BuildHasher + Default, ++{ ++ #[inline] ++ fn deserialize_reader(reader: &mut R) -> Result { ++ check_zst::()?; ++ let vec = >::deserialize_reader(reader)?; ++ Ok(vec.into_iter().collect::>()) ++ } ++} ++ ++fn check_zst() -> Result<()> { ++ if size_of::() == 0 { ++ return Err(Error::new(ErrorKind::InvalidData, ERROR_ZST_FORBIDDEN)); ++ } ++ Ok(()) ++} ++ ++#[cfg(test)] ++mod borsh_tests { ++ use super::*; ++ ++ #[test] ++ fn map_borsh_roundtrip() { ++ let original_map: IndexMap = { ++ let mut map = IndexMap::new(); ++ map.insert(1, 2); ++ map.insert(3, 4); ++ map.insert(5, 6); ++ map ++ }; ++ let serialized_map = borsh::to_vec(&original_map).unwrap(); ++ let deserialized_map: IndexMap = ++ BorshDeserialize::try_from_slice(&serialized_map).unwrap(); ++ assert_eq!(original_map, deserialized_map); ++ } ++ ++ #[test] ++ fn set_borsh_roundtrip() { ++ let original_map: IndexSet = [1, 2, 3, 4, 5, 6].into_iter().collect(); ++ let serialized_map = borsh::to_vec(&original_map).unwrap(); ++ let deserialized_map: IndexSet = ++ BorshDeserialize::try_from_slice(&serialized_map).unwrap(); ++ assert_eq!(original_map, deserialized_map); ++ } ++} +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/src/lib.rs mesa-25.3.3/subprojects/indexmap-2.7.0/src/lib.rs +--- mesa-25.3.3/subprojects/indexmap-2.7.0/src/lib.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/src/lib.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,274 @@ ++// We *mostly* avoid unsafe code, but `Slice` allows it for DST casting. ++#![deny(unsafe_code)] ++#![warn(rust_2018_idioms)] ++#![no_std] ++ ++//! [`IndexMap`] is a hash table where the iteration order of the key-value ++//! pairs is independent of the hash values of the keys. ++//! ++//! [`IndexSet`] is a corresponding hash set using the same implementation and ++//! with similar properties. ++//! ++//! ### Highlights ++//! ++//! [`IndexMap`] and [`IndexSet`] are drop-in compatible with the std `HashMap` ++//! and `HashSet`, but they also have some features of note: ++//! ++//! - The ordering semantics (see their documentation for details) ++//! - Sorting methods and the [`.pop()`][IndexMap::pop] methods. ++//! - The [`Equivalent`] trait, which offers more flexible equality definitions ++//! between borrowed and owned versions of keys. ++//! - The [`MutableKeys`][map::MutableKeys] trait, which gives opt-in mutable ++//! access to map keys, and [`MutableValues`][set::MutableValues] for sets. ++//! ++//! ### Feature Flags ++//! ++//! To reduce the amount of compiled code in the crate by default, certain ++//! features are gated behind [feature flags]. These allow you to opt in to (or ++//! out of) functionality. Below is a list of the features available in this ++//! crate. ++//! ++//! * `std`: Enables features which require the Rust standard library. For more ++//! information see the section on [`no_std`]. ++//! * `rayon`: Enables parallel iteration and other parallel methods. ++//! * `serde`: Adds implementations for [`Serialize`] and [`Deserialize`] ++//! to [`IndexMap`] and [`IndexSet`]. Alternative implementations for ++//! (de)serializing [`IndexMap`] as an ordered sequence are available in the ++//! [`map::serde_seq`] module. ++//! * `borsh`: Adds implementations for [`BorshSerialize`] and [`BorshDeserialize`] ++//! to [`IndexMap`] and [`IndexSet`]. ++//! * `arbitrary`: Adds implementations for the [`arbitrary::Arbitrary`] trait ++//! to [`IndexMap`] and [`IndexSet`]. ++//! * `quickcheck`: Adds implementations for the [`quickcheck::Arbitrary`] trait ++//! to [`IndexMap`] and [`IndexSet`]. ++//! ++//! _Note: only the `std` feature is enabled by default._ ++//! ++//! [feature flags]: https://doc.rust-lang.org/cargo/reference/manifest.html#the-features-section ++//! [`no_std`]: #no-standard-library-targets ++//! [`Serialize`]: `::serde::Serialize` ++//! [`Deserialize`]: `::serde::Deserialize` ++//! [`BorshSerialize`]: `::borsh::BorshSerialize` ++//! [`BorshDeserialize`]: `::borsh::BorshDeserialize` ++//! [`arbitrary::Arbitrary`]: `::arbitrary::Arbitrary` ++//! [`quickcheck::Arbitrary`]: `::quickcheck::Arbitrary` ++//! ++//! ### Alternate Hashers ++//! ++//! [`IndexMap`] and [`IndexSet`] have a default hasher type ++//! [`S = RandomState`][std::collections::hash_map::RandomState], ++//! just like the standard `HashMap` and `HashSet`, which is resistant to ++//! HashDoS attacks but not the most performant. Type aliases can make it easier ++//! to use alternate hashers: ++//! ++//! ``` ++//! use fnv::FnvBuildHasher; ++//! use fxhash::FxBuildHasher; ++//! use indexmap::{IndexMap, IndexSet}; ++//! ++//! type FnvIndexMap = IndexMap; ++//! type FnvIndexSet = IndexSet; ++//! ++//! type FxIndexMap = IndexMap; ++//! type FxIndexSet = IndexSet; ++//! ++//! let std: IndexSet = (0..100).collect(); ++//! let fnv: FnvIndexSet = (0..100).collect(); ++//! let fx: FxIndexSet = (0..100).collect(); ++//! assert_eq!(std, fnv); ++//! assert_eq!(std, fx); ++//! ``` ++//! ++//! ### Rust Version ++//! ++//! This version of indexmap requires Rust 1.63 or later. ++//! ++//! The indexmap 2.x release series will use a carefully considered version ++//! upgrade policy, where in a later 2.x version, we will raise the minimum ++//! required Rust version. ++//! ++//! ## No Standard Library Targets ++//! ++//! This crate supports being built without `std`, requiring `alloc` instead. ++//! This is chosen by disabling the default "std" cargo feature, by adding ++//! `default-features = false` to your dependency specification. ++//! ++//! - Creating maps and sets using [`new`][IndexMap::new] and ++//! [`with_capacity`][IndexMap::with_capacity] is unavailable without `std`. ++//! Use methods [`IndexMap::default`], [`with_hasher`][IndexMap::with_hasher], ++//! [`with_capacity_and_hasher`][IndexMap::with_capacity_and_hasher] instead. ++//! A no-std compatible hasher will be needed as well, for example ++//! from the crate `twox-hash`. ++//! - Macros [`indexmap!`] and [`indexset!`] are unavailable without `std`. ++ ++#![cfg_attr(docsrs, feature(doc_cfg))] ++ ++extern crate alloc; ++ ++#[cfg(feature = "std")] ++#[macro_use] ++extern crate std; ++ ++use alloc::vec::{self, Vec}; ++ ++mod arbitrary; ++#[macro_use] ++mod macros; ++#[cfg(feature = "borsh")] ++mod borsh; ++#[cfg(feature = "serde")] ++mod serde; ++mod util; ++ ++pub mod map; ++pub mod set; ++ ++// Placed after `map` and `set` so new `rayon` methods on the types ++// are documented after the "normal" methods. ++#[cfg(feature = "rayon")] ++mod rayon; ++ ++#[cfg(feature = "rustc-rayon")] ++mod rustc; ++ ++pub use crate::map::IndexMap; ++pub use crate::set::IndexSet; ++pub use equivalent::Equivalent; ++ ++// shared private items ++ ++/// Hash value newtype. Not larger than usize, since anything larger ++/// isn't used for selecting position anyway. ++#[derive(Clone, Copy, Debug, PartialEq)] ++struct HashValue(usize); ++ ++impl HashValue { ++ #[inline(always)] ++ fn get(self) -> u64 { ++ self.0 as u64 ++ } ++} ++ ++#[derive(Copy, Debug)] ++struct Bucket { ++ hash: HashValue, ++ key: K, ++ value: V, ++} ++ ++impl Clone for Bucket ++where ++ K: Clone, ++ V: Clone, ++{ ++ fn clone(&self) -> Self { ++ Bucket { ++ hash: self.hash, ++ key: self.key.clone(), ++ value: self.value.clone(), ++ } ++ } ++ ++ fn clone_from(&mut self, other: &Self) { ++ self.hash = other.hash; ++ self.key.clone_from(&other.key); ++ self.value.clone_from(&other.value); ++ } ++} ++ ++impl Bucket { ++ // field accessors -- used for `f` instead of closures in `.map(f)` ++ fn key_ref(&self) -> &K { ++ &self.key ++ } ++ fn value_ref(&self) -> &V { ++ &self.value ++ } ++ fn value_mut(&mut self) -> &mut V { ++ &mut self.value ++ } ++ fn key(self) -> K { ++ self.key ++ } ++ fn value(self) -> V { ++ self.value ++ } ++ fn key_value(self) -> (K, V) { ++ (self.key, self.value) ++ } ++ fn refs(&self) -> (&K, &V) { ++ (&self.key, &self.value) ++ } ++ fn ref_mut(&mut self) -> (&K, &mut V) { ++ (&self.key, &mut self.value) ++ } ++ fn muts(&mut self) -> (&mut K, &mut V) { ++ (&mut self.key, &mut self.value) ++ } ++} ++ ++trait Entries { ++ type Entry; ++ fn into_entries(self) -> Vec; ++ fn as_entries(&self) -> &[Self::Entry]; ++ fn as_entries_mut(&mut self) -> &mut [Self::Entry]; ++ fn with_entries(&mut self, f: F) ++ where ++ F: FnOnce(&mut [Self::Entry]); ++} ++ ++/// The error type for [`try_reserve`][IndexMap::try_reserve] methods. ++#[derive(Clone, PartialEq, Eq, Debug)] ++pub struct TryReserveError { ++ kind: TryReserveErrorKind, ++} ++ ++#[derive(Clone, PartialEq, Eq, Debug)] ++enum TryReserveErrorKind { ++ // The standard library's kind is currently opaque to us, otherwise we could unify this. ++ Std(alloc::collections::TryReserveError), ++ CapacityOverflow, ++ AllocError { layout: alloc::alloc::Layout }, ++} ++ ++// These are not `From` so we don't expose them in our public API. ++impl TryReserveError { ++ fn from_alloc(error: alloc::collections::TryReserveError) -> Self { ++ Self { ++ kind: TryReserveErrorKind::Std(error), ++ } ++ } ++ ++ fn from_hashbrown(error: hashbrown::TryReserveError) -> Self { ++ Self { ++ kind: match error { ++ hashbrown::TryReserveError::CapacityOverflow => { ++ TryReserveErrorKind::CapacityOverflow ++ } ++ hashbrown::TryReserveError::AllocError { layout } => { ++ TryReserveErrorKind::AllocError { layout } ++ } ++ }, ++ } ++ } ++} ++ ++impl core::fmt::Display for TryReserveError { ++ fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { ++ let reason = match &self.kind { ++ TryReserveErrorKind::Std(e) => return core::fmt::Display::fmt(e, f), ++ TryReserveErrorKind::CapacityOverflow => { ++ " because the computed capacity exceeded the collection's maximum" ++ } ++ TryReserveErrorKind::AllocError { .. } => { ++ " because the memory allocator returned an error" ++ } ++ }; ++ f.write_str("memory allocation failed")?; ++ f.write_str(reason) ++ } ++} ++ ++#[cfg(feature = "std")] ++#[cfg_attr(docsrs, doc(cfg(feature = "std")))] ++impl std::error::Error for TryReserveError {} +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/src/macros.rs mesa-25.3.3/subprojects/indexmap-2.7.0/src/macros.rs +--- mesa-25.3.3/subprojects/indexmap-2.7.0/src/macros.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/src/macros.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,178 @@ ++#[cfg(feature = "std")] ++#[cfg_attr(docsrs, doc(cfg(feature = "std")))] ++#[macro_export] ++/// Create an [`IndexMap`][crate::IndexMap] from a list of key-value pairs ++/// ++/// ## Example ++/// ++/// ``` ++/// use indexmap::indexmap; ++/// ++/// let map = indexmap!{ ++/// "a" => 1, ++/// "b" => 2, ++/// }; ++/// assert_eq!(map["a"], 1); ++/// assert_eq!(map["b"], 2); ++/// assert_eq!(map.get("c"), None); ++/// ++/// // "a" is the first key ++/// assert_eq!(map.keys().next(), Some(&"a")); ++/// ``` ++macro_rules! indexmap { ++ ($($key:expr => $value:expr,)+) => { $crate::indexmap!($($key => $value),+) }; ++ ($($key:expr => $value:expr),*) => { ++ { ++ // Note: `stringify!($key)` is just here to consume the repetition, ++ // but we throw away that string literal during constant evaluation. ++ const CAP: usize = <[()]>::len(&[$({ stringify!($key); }),*]); ++ let mut map = $crate::IndexMap::with_capacity(CAP); ++ $( ++ map.insert($key, $value); ++ )* ++ map ++ } ++ }; ++} ++ ++#[cfg(feature = "std")] ++#[cfg_attr(docsrs, doc(cfg(feature = "std")))] ++#[macro_export] ++/// Create an [`IndexSet`][crate::IndexSet] from a list of values ++/// ++/// ## Example ++/// ++/// ``` ++/// use indexmap::indexset; ++/// ++/// let set = indexset!{ ++/// "a", ++/// "b", ++/// }; ++/// assert!(set.contains("a")); ++/// assert!(set.contains("b")); ++/// assert!(!set.contains("c")); ++/// ++/// // "a" is the first value ++/// assert_eq!(set.iter().next(), Some(&"a")); ++/// ``` ++macro_rules! indexset { ++ ($($value:expr,)+) => { $crate::indexset!($($value),+) }; ++ ($($value:expr),*) => { ++ { ++ // Note: `stringify!($value)` is just here to consume the repetition, ++ // but we throw away that string literal during constant evaluation. ++ const CAP: usize = <[()]>::len(&[$({ stringify!($value); }),*]); ++ let mut set = $crate::IndexSet::with_capacity(CAP); ++ $( ++ set.insert($value); ++ )* ++ set ++ } ++ }; ++} ++ ++// generate all the Iterator methods by just forwarding to the underlying ++// self.iter and mapping its element. ++macro_rules! iterator_methods { ++ // $map_elt is the mapping function from the underlying iterator's element ++ // same mapping function for both options and iterators ++ ($map_elt:expr) => { ++ fn next(&mut self) -> Option { ++ self.iter.next().map($map_elt) ++ } ++ ++ fn size_hint(&self) -> (usize, Option) { ++ self.iter.size_hint() ++ } ++ ++ fn count(self) -> usize { ++ self.iter.len() ++ } ++ ++ fn nth(&mut self, n: usize) -> Option { ++ self.iter.nth(n).map($map_elt) ++ } ++ ++ fn last(mut self) -> Option { ++ self.next_back() ++ } ++ ++ fn collect(self) -> C ++ where ++ C: FromIterator, ++ { ++ // NB: forwarding this directly to standard iterators will ++ // allow it to leverage unstable traits like `TrustedLen`. ++ self.iter.map($map_elt).collect() ++ } ++ }; ++} ++ ++macro_rules! double_ended_iterator_methods { ++ // $map_elt is the mapping function from the underlying iterator's element ++ // same mapping function for both options and iterators ++ ($map_elt:expr) => { ++ fn next_back(&mut self) -> Option { ++ self.iter.next_back().map($map_elt) ++ } ++ ++ fn nth_back(&mut self, n: usize) -> Option { ++ self.iter.nth_back(n).map($map_elt) ++ } ++ }; ++} ++ ++// generate `ParallelIterator` methods by just forwarding to the underlying ++// self.entries and mapping its elements. ++#[cfg(any(feature = "rayon", feature = "rustc-rayon"))] ++macro_rules! parallel_iterator_methods { ++ // $map_elt is the mapping function from the underlying iterator's element ++ ($map_elt:expr) => { ++ fn drive_unindexed(self, consumer: C) -> C::Result ++ where ++ C: UnindexedConsumer, ++ { ++ self.entries ++ .into_par_iter() ++ .map($map_elt) ++ .drive_unindexed(consumer) ++ } ++ ++ // NB: This allows indexed collection, e.g. directly into a `Vec`, but the ++ // underlying iterator must really be indexed. We should remove this if we ++ // start having tombstones that must be filtered out. ++ fn opt_len(&self) -> Option { ++ Some(self.entries.len()) ++ } ++ }; ++} ++ ++// generate `IndexedParallelIterator` methods by just forwarding to the underlying ++// self.entries and mapping its elements. ++#[cfg(any(feature = "rayon", feature = "rustc-rayon"))] ++macro_rules! indexed_parallel_iterator_methods { ++ // $map_elt is the mapping function from the underlying iterator's element ++ ($map_elt:expr) => { ++ fn drive(self, consumer: C) -> C::Result ++ where ++ C: Consumer, ++ { ++ self.entries.into_par_iter().map($map_elt).drive(consumer) ++ } ++ ++ fn len(&self) -> usize { ++ self.entries.len() ++ } ++ ++ fn with_producer(self, callback: CB) -> CB::Output ++ where ++ CB: ProducerCallback, ++ { ++ self.entries ++ .into_par_iter() ++ .map($map_elt) ++ .with_producer(callback) ++ } ++ }; ++} +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/src/map/core/entry.rs mesa-25.3.3/subprojects/indexmap-2.7.0/src/map/core/entry.rs +--- mesa-25.3.3/subprojects/indexmap-2.7.0/src/map/core/entry.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/src/map/core/entry.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,569 @@ ++use super::{equivalent, Entries, IndexMapCore, RefMut}; ++use crate::HashValue; ++use core::{fmt, mem}; ++use hashbrown::hash_table; ++ ++impl IndexMapCore { ++ pub(crate) fn entry(&mut self, hash: HashValue, key: K) -> Entry<'_, K, V> ++ where ++ K: Eq, ++ { ++ let entries = &mut self.entries; ++ let eq = equivalent(&key, entries); ++ match self.indices.find_entry(hash.get(), eq) { ++ Ok(index) => Entry::Occupied(OccupiedEntry { entries, index }), ++ Err(absent) => Entry::Vacant(VacantEntry { ++ map: RefMut::new(absent.into_table(), entries), ++ hash, ++ key, ++ }), ++ } ++ } ++} ++ ++/// Entry for an existing key-value pair in an [`IndexMap`][crate::IndexMap] ++/// or a vacant location to insert one. ++pub enum Entry<'a, K, V> { ++ /// Existing slot with equivalent key. ++ Occupied(OccupiedEntry<'a, K, V>), ++ /// Vacant slot (no equivalent key in the map). ++ Vacant(VacantEntry<'a, K, V>), ++} ++ ++impl<'a, K, V> Entry<'a, K, V> { ++ /// Return the index where the key-value pair exists or will be inserted. ++ pub fn index(&self) -> usize { ++ match *self { ++ Entry::Occupied(ref entry) => entry.index(), ++ Entry::Vacant(ref entry) => entry.index(), ++ } ++ } ++ ++ /// Sets the value of the entry (after inserting if vacant), and returns an `OccupiedEntry`. ++ /// ++ /// Computes in **O(1)** time (amortized average). ++ pub fn insert_entry(self, value: V) -> OccupiedEntry<'a, K, V> { ++ match self { ++ Entry::Occupied(mut entry) => { ++ entry.insert(value); ++ entry ++ } ++ Entry::Vacant(entry) => entry.insert_entry(value), ++ } ++ } ++ ++ /// Inserts the given default value in the entry if it is vacant and returns a mutable ++ /// reference to it. Otherwise a mutable reference to an already existent value is returned. ++ /// ++ /// Computes in **O(1)** time (amortized average). ++ pub fn or_insert(self, default: V) -> &'a mut V { ++ match self { ++ Entry::Occupied(entry) => entry.into_mut(), ++ Entry::Vacant(entry) => entry.insert(default), ++ } ++ } ++ ++ /// Inserts the result of the `call` function in the entry if it is vacant and returns a mutable ++ /// reference to it. Otherwise a mutable reference to an already existent value is returned. ++ /// ++ /// Computes in **O(1)** time (amortized average). ++ pub fn or_insert_with(self, call: F) -> &'a mut V ++ where ++ F: FnOnce() -> V, ++ { ++ match self { ++ Entry::Occupied(entry) => entry.into_mut(), ++ Entry::Vacant(entry) => entry.insert(call()), ++ } ++ } ++ ++ /// Inserts the result of the `call` function with a reference to the entry's key if it is ++ /// vacant, and returns a mutable reference to the new value. Otherwise a mutable reference to ++ /// an already existent value is returned. ++ /// ++ /// Computes in **O(1)** time (amortized average). ++ pub fn or_insert_with_key(self, call: F) -> &'a mut V ++ where ++ F: FnOnce(&K) -> V, ++ { ++ match self { ++ Entry::Occupied(entry) => entry.into_mut(), ++ Entry::Vacant(entry) => { ++ let value = call(&entry.key); ++ entry.insert(value) ++ } ++ } ++ } ++ ++ /// Gets a reference to the entry's key, either within the map if occupied, ++ /// or else the new key that was used to find the entry. ++ pub fn key(&self) -> &K { ++ match *self { ++ Entry::Occupied(ref entry) => entry.key(), ++ Entry::Vacant(ref entry) => entry.key(), ++ } ++ } ++ ++ /// Modifies the entry if it is occupied. ++ pub fn and_modify(mut self, f: F) -> Self ++ where ++ F: FnOnce(&mut V), ++ { ++ if let Entry::Occupied(entry) = &mut self { ++ f(entry.get_mut()); ++ } ++ self ++ } ++ ++ /// Inserts a default-constructed value in the entry if it is vacant and returns a mutable ++ /// reference to it. Otherwise a mutable reference to an already existent value is returned. ++ /// ++ /// Computes in **O(1)** time (amortized average). ++ pub fn or_default(self) -> &'a mut V ++ where ++ V: Default, ++ { ++ match self { ++ Entry::Occupied(entry) => entry.into_mut(), ++ Entry::Vacant(entry) => entry.insert(V::default()), ++ } ++ } ++} ++ ++impl fmt::Debug for Entry<'_, K, V> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ let mut tuple = f.debug_tuple("Entry"); ++ match self { ++ Entry::Vacant(v) => tuple.field(v), ++ Entry::Occupied(o) => tuple.field(o), ++ }; ++ tuple.finish() ++ } ++} ++ ++/// A view into an occupied entry in an [`IndexMap`][crate::IndexMap]. ++/// It is part of the [`Entry`] enum. ++pub struct OccupiedEntry<'a, K, V> { ++ entries: &'a mut Entries, ++ index: hash_table::OccupiedEntry<'a, usize>, ++} ++ ++impl<'a, K, V> OccupiedEntry<'a, K, V> { ++ pub(crate) fn new( ++ entries: &'a mut Entries, ++ index: hash_table::OccupiedEntry<'a, usize>, ++ ) -> Self { ++ Self { entries, index } ++ } ++ ++ /// Return the index of the key-value pair ++ #[inline] ++ pub fn index(&self) -> usize { ++ *self.index.get() ++ } ++ ++ #[inline] ++ fn into_ref_mut(self) -> RefMut<'a, K, V> { ++ RefMut::new(self.index.into_table(), self.entries) ++ } ++ ++ /// Gets a reference to the entry's key in the map. ++ /// ++ /// Note that this is not the key that was used to find the entry. There may be an observable ++ /// difference if the key type has any distinguishing features outside of `Hash` and `Eq`, like ++ /// extra fields or the memory address of an allocation. ++ pub fn key(&self) -> &K { ++ &self.entries[self.index()].key ++ } ++ ++ pub(crate) fn key_mut(&mut self) -> &mut K { ++ let index = self.index(); ++ &mut self.entries[index].key ++ } ++ ++ /// Gets a reference to the entry's value in the map. ++ pub fn get(&self) -> &V { ++ &self.entries[self.index()].value ++ } ++ ++ /// Gets a mutable reference to the entry's value in the map. ++ /// ++ /// If you need a reference which may outlive the destruction of the ++ /// [`Entry`] value, see [`into_mut`][Self::into_mut]. ++ pub fn get_mut(&mut self) -> &mut V { ++ let index = self.index(); ++ &mut self.entries[index].value ++ } ++ ++ /// Converts into a mutable reference to the entry's value in the map, ++ /// with a lifetime bound to the map itself. ++ pub fn into_mut(self) -> &'a mut V { ++ let index = self.index(); ++ &mut self.entries[index].value ++ } ++ ++ pub(super) fn into_muts(self) -> (&'a mut K, &'a mut V) { ++ let index = self.index(); ++ self.entries[index].muts() ++ } ++ ++ /// Sets the value of the entry to `value`, and returns the entry's old value. ++ pub fn insert(&mut self, value: V) -> V { ++ mem::replace(self.get_mut(), value) ++ } ++ ++ /// Remove the key, value pair stored in the map for this entry, and return the value. ++ /// ++ /// **NOTE:** This is equivalent to [`.swap_remove()`][Self::swap_remove], replacing this ++ /// entry's position with the last element, and it is deprecated in favor of calling that ++ /// explicitly. If you need to preserve the relative order of the keys in the map, use ++ /// [`.shift_remove()`][Self::shift_remove] instead. ++ #[deprecated(note = "`remove` disrupts the map order -- \ ++ use `swap_remove` or `shift_remove` for explicit behavior.")] ++ pub fn remove(self) -> V { ++ self.swap_remove() ++ } ++ ++ /// Remove the key, value pair stored in the map for this entry, and return the value. ++ /// ++ /// Like [`Vec::swap_remove`][crate::Vec::swap_remove], the pair is removed by swapping it with ++ /// the last element of the map and popping it off. ++ /// **This perturbs the position of what used to be the last element!** ++ /// ++ /// Computes in **O(1)** time (average). ++ pub fn swap_remove(self) -> V { ++ self.swap_remove_entry().1 ++ } ++ ++ /// Remove the key, value pair stored in the map for this entry, and return the value. ++ /// ++ /// Like [`Vec::remove`][crate::Vec::remove], the pair is removed by shifting all of the ++ /// elements that follow it, preserving their relative order. ++ /// **This perturbs the index of all of those elements!** ++ /// ++ /// Computes in **O(n)** time (average). ++ pub fn shift_remove(self) -> V { ++ self.shift_remove_entry().1 ++ } ++ ++ /// Remove and return the key, value pair stored in the map for this entry ++ /// ++ /// **NOTE:** This is equivalent to [`.swap_remove_entry()`][Self::swap_remove_entry], ++ /// replacing this entry's position with the last element, and it is deprecated in favor of ++ /// calling that explicitly. If you need to preserve the relative order of the keys in the map, ++ /// use [`.shift_remove_entry()`][Self::shift_remove_entry] instead. ++ #[deprecated(note = "`remove_entry` disrupts the map order -- \ ++ use `swap_remove_entry` or `shift_remove_entry` for explicit behavior.")] ++ pub fn remove_entry(self) -> (K, V) { ++ self.swap_remove_entry() ++ } ++ ++ /// Remove and return the key, value pair stored in the map for this entry ++ /// ++ /// Like [`Vec::swap_remove`][crate::Vec::swap_remove], the pair is removed by swapping it with ++ /// the last element of the map and popping it off. ++ /// **This perturbs the position of what used to be the last element!** ++ /// ++ /// Computes in **O(1)** time (average). ++ pub fn swap_remove_entry(self) -> (K, V) { ++ let (index, entry) = self.index.remove(); ++ RefMut::new(entry.into_table(), self.entries).swap_remove_finish(index) ++ } ++ ++ /// Remove and return the key, value pair stored in the map for this entry ++ /// ++ /// Like [`Vec::remove`][crate::Vec::remove], the pair is removed by shifting all of the ++ /// elements that follow it, preserving their relative order. ++ /// **This perturbs the index of all of those elements!** ++ /// ++ /// Computes in **O(n)** time (average). ++ pub fn shift_remove_entry(self) -> (K, V) { ++ let (index, entry) = self.index.remove(); ++ RefMut::new(entry.into_table(), self.entries).shift_remove_finish(index) ++ } ++ ++ /// Moves the position of the entry to a new index ++ /// by shifting all other entries in-between. ++ /// ++ /// This is equivalent to [`IndexMap::move_index`][`crate::IndexMap::move_index`] ++ /// coming `from` the current [`.index()`][Self::index]. ++ /// ++ /// * If `self.index() < to`, the other pairs will shift down while the targeted pair moves up. ++ /// * If `self.index() > to`, the other pairs will shift up while the targeted pair moves down. ++ /// ++ /// ***Panics*** if `to` is out of bounds. ++ /// ++ /// Computes in **O(n)** time (average). ++ pub fn move_index(self, to: usize) { ++ let index = self.index(); ++ self.into_ref_mut().move_index(index, to); ++ } ++ ++ /// Swaps the position of entry with another. ++ /// ++ /// This is equivalent to [`IndexMap::swap_indices`][`crate::IndexMap::swap_indices`] ++ /// with the current [`.index()`][Self::index] as one of the two being swapped. ++ /// ++ /// ***Panics*** if the `other` index is out of bounds. ++ /// ++ /// Computes in **O(1)** time (average). ++ pub fn swap_indices(self, other: usize) { ++ let index = self.index(); ++ self.into_ref_mut().swap_indices(index, other); ++ } ++} ++ ++impl fmt::Debug for OccupiedEntry<'_, K, V> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_struct("OccupiedEntry") ++ .field("key", self.key()) ++ .field("value", self.get()) ++ .finish() ++ } ++} ++ ++impl<'a, K, V> From> for OccupiedEntry<'a, K, V> { ++ fn from(other: IndexedEntry<'a, K, V>) -> Self { ++ let IndexedEntry { ++ map: RefMut { indices, entries }, ++ index, ++ } = other; ++ let hash = entries[index].hash; ++ Self { ++ entries, ++ index: indices ++ .find_entry(hash.get(), move |&i| i == index) ++ .expect("index not found"), ++ } ++ } ++} ++ ++/// A view into a vacant entry in an [`IndexMap`][crate::IndexMap]. ++/// It is part of the [`Entry`] enum. ++pub struct VacantEntry<'a, K, V> { ++ map: RefMut<'a, K, V>, ++ hash: HashValue, ++ key: K, ++} ++ ++impl<'a, K, V> VacantEntry<'a, K, V> { ++ /// Return the index where a key-value pair may be inserted. ++ pub fn index(&self) -> usize { ++ self.map.indices.len() ++ } ++ ++ /// Gets a reference to the key that was used to find the entry. ++ pub fn key(&self) -> &K { ++ &self.key ++ } ++ ++ pub(crate) fn key_mut(&mut self) -> &mut K { ++ &mut self.key ++ } ++ ++ /// Takes ownership of the key, leaving the entry vacant. ++ pub fn into_key(self) -> K { ++ self.key ++ } ++ ++ /// Inserts the entry's key and the given value into the map, and returns a mutable reference ++ /// to the value. ++ /// ++ /// Computes in **O(1)** time (amortized average). ++ pub fn insert(self, value: V) -> &'a mut V { ++ self.insert_entry(value).into_mut() ++ } ++ ++ /// Inserts the entry's key and the given value into the map, and returns an `OccupiedEntry`. ++ /// ++ /// Computes in **O(1)** time (amortized average). ++ pub fn insert_entry(self, value: V) -> OccupiedEntry<'a, K, V> { ++ let Self { map, hash, key } = self; ++ map.insert_unique(hash, key, value) ++ } ++ ++ /// Inserts the entry's key and the given value into the map at its ordered ++ /// position among sorted keys, and returns the new index and a mutable ++ /// reference to the value. ++ /// ++ /// If the existing keys are **not** already sorted, then the insertion ++ /// index is unspecified (like [`slice::binary_search`]), but the key-value ++ /// pair is inserted at that position regardless. ++ /// ++ /// Computes in **O(n)** time (average). ++ pub fn insert_sorted(self, value: V) -> (usize, &'a mut V) ++ where ++ K: Ord, ++ { ++ let slice = crate::map::Slice::from_slice(self.map.entries); ++ let i = slice.binary_search_keys(&self.key).unwrap_err(); ++ (i, self.shift_insert(i, value)) ++ } ++ ++ /// Inserts the entry's key and the given value into the map at the given index, ++ /// shifting others to the right, and returns a mutable reference to the value. ++ /// ++ /// ***Panics*** if `index` is out of bounds. ++ /// ++ /// Computes in **O(n)** time (average). ++ pub fn shift_insert(mut self, index: usize, value: V) -> &'a mut V { ++ self.map ++ .shift_insert_unique(index, self.hash, self.key, value); ++ &mut self.map.entries[index].value ++ } ++} ++ ++impl fmt::Debug for VacantEntry<'_, K, V> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_tuple("VacantEntry").field(self.key()).finish() ++ } ++} ++ ++/// A view into an occupied entry in an [`IndexMap`][crate::IndexMap] obtained by index. ++/// ++/// This `struct` is created from the [`get_index_entry`][crate::IndexMap::get_index_entry] method. ++pub struct IndexedEntry<'a, K, V> { ++ map: RefMut<'a, K, V>, ++ // We have a mutable reference to the map, which keeps the index ++ // valid and pointing to the correct entry. ++ index: usize, ++} ++ ++impl<'a, K, V> IndexedEntry<'a, K, V> { ++ pub(crate) fn new(map: &'a mut IndexMapCore, index: usize) -> Self { ++ Self { ++ map: map.borrow_mut(), ++ index, ++ } ++ } ++ ++ /// Return the index of the key-value pair ++ #[inline] ++ pub fn index(&self) -> usize { ++ self.index ++ } ++ ++ /// Gets a reference to the entry's key in the map. ++ pub fn key(&self) -> &K { ++ &self.map.entries[self.index].key ++ } ++ ++ pub(crate) fn key_mut(&mut self) -> &mut K { ++ &mut self.map.entries[self.index].key ++ } ++ ++ /// Gets a reference to the entry's value in the map. ++ pub fn get(&self) -> &V { ++ &self.map.entries[self.index].value ++ } ++ ++ /// Gets a mutable reference to the entry's value in the map. ++ /// ++ /// If you need a reference which may outlive the destruction of the ++ /// `IndexedEntry` value, see [`into_mut`][Self::into_mut]. ++ pub fn get_mut(&mut self) -> &mut V { ++ &mut self.map.entries[self.index].value ++ } ++ ++ /// Sets the value of the entry to `value`, and returns the entry's old value. ++ pub fn insert(&mut self, value: V) -> V { ++ mem::replace(self.get_mut(), value) ++ } ++ ++ /// Converts into a mutable reference to the entry's value in the map, ++ /// with a lifetime bound to the map itself. ++ pub fn into_mut(self) -> &'a mut V { ++ &mut self.map.entries[self.index].value ++ } ++ ++ /// Remove and return the key, value pair stored in the map for this entry ++ /// ++ /// Like [`Vec::swap_remove`][crate::Vec::swap_remove], the pair is removed by swapping it with ++ /// the last element of the map and popping it off. ++ /// **This perturbs the position of what used to be the last element!** ++ /// ++ /// Computes in **O(1)** time (average). ++ pub fn swap_remove_entry(mut self) -> (K, V) { ++ self.map.swap_remove_index(self.index).unwrap() ++ } ++ ++ /// Remove and return the key, value pair stored in the map for this entry ++ /// ++ /// Like [`Vec::remove`][crate::Vec::remove], the pair is removed by shifting all of the ++ /// elements that follow it, preserving their relative order. ++ /// **This perturbs the index of all of those elements!** ++ /// ++ /// Computes in **O(n)** time (average). ++ pub fn shift_remove_entry(mut self) -> (K, V) { ++ self.map.shift_remove_index(self.index).unwrap() ++ } ++ ++ /// Remove the key, value pair stored in the map for this entry, and return the value. ++ /// ++ /// Like [`Vec::swap_remove`][crate::Vec::swap_remove], the pair is removed by swapping it with ++ /// the last element of the map and popping it off. ++ /// **This perturbs the position of what used to be the last element!** ++ /// ++ /// Computes in **O(1)** time (average). ++ pub fn swap_remove(self) -> V { ++ self.swap_remove_entry().1 ++ } ++ ++ /// Remove the key, value pair stored in the map for this entry, and return the value. ++ /// ++ /// Like [`Vec::remove`][crate::Vec::remove], the pair is removed by shifting all of the ++ /// elements that follow it, preserving their relative order. ++ /// **This perturbs the index of all of those elements!** ++ /// ++ /// Computes in **O(n)** time (average). ++ pub fn shift_remove(self) -> V { ++ self.shift_remove_entry().1 ++ } ++ ++ /// Moves the position of the entry to a new index ++ /// by shifting all other entries in-between. ++ /// ++ /// This is equivalent to [`IndexMap::move_index`][`crate::IndexMap::move_index`] ++ /// coming `from` the current [`.index()`][Self::index]. ++ /// ++ /// * If `self.index() < to`, the other pairs will shift down while the targeted pair moves up. ++ /// * If `self.index() > to`, the other pairs will shift up while the targeted pair moves down. ++ /// ++ /// ***Panics*** if `to` is out of bounds. ++ /// ++ /// Computes in **O(n)** time (average). ++ pub fn move_index(mut self, to: usize) { ++ self.map.move_index(self.index, to); ++ } ++ ++ /// Swaps the position of entry with another. ++ /// ++ /// This is equivalent to [`IndexMap::swap_indices`][`crate::IndexMap::swap_indices`] ++ /// with the current [`.index()`][Self::index] as one of the two being swapped. ++ /// ++ /// ***Panics*** if the `other` index is out of bounds. ++ /// ++ /// Computes in **O(1)** time (average). ++ pub fn swap_indices(mut self, other: usize) { ++ self.map.swap_indices(self.index, other); ++ } ++} ++ ++impl fmt::Debug for IndexedEntry<'_, K, V> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_struct("IndexedEntry") ++ .field("index", &self.index) ++ .field("key", self.key()) ++ .field("value", self.get()) ++ .finish() ++ } ++} ++ ++impl<'a, K, V> From> for IndexedEntry<'a, K, V> { ++ fn from(other: OccupiedEntry<'a, K, V>) -> Self { ++ Self { ++ index: other.index(), ++ map: other.into_ref_mut(), ++ } ++ } ++} +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/src/map/core/raw_entry_v1.rs mesa-25.3.3/subprojects/indexmap-2.7.0/src/map/core/raw_entry_v1.rs +--- mesa-25.3.3/subprojects/indexmap-2.7.0/src/map/core/raw_entry_v1.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/src/map/core/raw_entry_v1.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,665 @@ ++//! Opt-in access to the experimental raw entry API. ++//! ++//! This module is designed to mimic the raw entry API of [`HashMap`][std::collections::hash_map], ++//! matching its unstable state as of Rust 1.75. See the tracking issue ++//! [rust#56167](https://github.com/rust-lang/rust/issues/56167) for more details. ++//! ++//! The trait [`RawEntryApiV1`] and the `_v1` suffix on its methods are meant to insulate this for ++//! the future, in case later breaking changes are needed. If the standard library stabilizes its ++//! `hash_raw_entry` feature (or some replacement), matching *inherent* methods will be added to ++//! `IndexMap` without such an opt-in trait. ++ ++use super::{Entries, RefMut}; ++use crate::{Equivalent, HashValue, IndexMap}; ++use core::fmt; ++use core::hash::{BuildHasher, Hash, Hasher}; ++use core::marker::PhantomData; ++use core::mem; ++use hashbrown::hash_table; ++ ++/// Opt-in access to the experimental raw entry API. ++/// ++/// See the [`raw_entry_v1`][self] module documentation for more information. ++pub trait RawEntryApiV1: private::Sealed { ++ /// Creates a raw immutable entry builder for the [`IndexMap`]. ++ /// ++ /// Raw entries provide the lowest level of control for searching and ++ /// manipulating a map. They must be manually initialized with a hash and ++ /// then manually searched. ++ /// ++ /// This is useful for ++ /// * Hash memoization ++ /// * Using a search key that doesn't work with the [`Equivalent`] trait ++ /// * Using custom comparison logic without newtype wrappers ++ /// ++ /// Unless you are in such a situation, higher-level and more foolproof APIs like ++ /// [`get`][IndexMap::get] should be preferred. ++ /// ++ /// Immutable raw entries have very limited use; you might instead want ++ /// [`raw_entry_mut_v1`][Self::raw_entry_mut_v1]. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use core::hash::{BuildHasher, Hash}; ++ /// use indexmap::map::{IndexMap, RawEntryApiV1}; ++ /// ++ /// let mut map = IndexMap::new(); ++ /// map.extend([("a", 100), ("b", 200), ("c", 300)]); ++ /// ++ /// fn compute_hash(hash_builder: &S, key: &K) -> u64 { ++ /// use core::hash::Hasher; ++ /// let mut state = hash_builder.build_hasher(); ++ /// key.hash(&mut state); ++ /// state.finish() ++ /// } ++ /// ++ /// for k in ["a", "b", "c", "d", "e", "f"] { ++ /// let hash = compute_hash(map.hasher(), k); ++ /// let i = map.get_index_of(k); ++ /// let v = map.get(k); ++ /// let kv = map.get_key_value(k); ++ /// let ikv = map.get_full(k); ++ /// ++ /// println!("Key: {} and value: {:?}", k, v); ++ /// ++ /// assert_eq!(map.raw_entry_v1().from_key(k), kv); ++ /// assert_eq!(map.raw_entry_v1().from_hash(hash, |q| *q == k), kv); ++ /// assert_eq!(map.raw_entry_v1().from_key_hashed_nocheck(hash, k), kv); ++ /// assert_eq!(map.raw_entry_v1().from_hash_full(hash, |q| *q == k), ikv); ++ /// assert_eq!(map.raw_entry_v1().index_from_hash(hash, |q| *q == k), i); ++ /// } ++ /// ``` ++ fn raw_entry_v1(&self) -> RawEntryBuilder<'_, K, V, S>; ++ ++ /// Creates a raw entry builder for the [`IndexMap`]. ++ /// ++ /// Raw entries provide the lowest level of control for searching and ++ /// manipulating a map. They must be manually initialized with a hash and ++ /// then manually searched. After this, insertions into a vacant entry ++ /// still require an owned key to be provided. ++ /// ++ /// Raw entries are useful for such exotic situations as: ++ /// ++ /// * Hash memoization ++ /// * Deferring the creation of an owned key until it is known to be required ++ /// * Using a search key that doesn't work with the [`Equivalent`] trait ++ /// * Using custom comparison logic without newtype wrappers ++ /// ++ /// Because raw entries provide much more low-level control, it's much easier ++ /// to put the `IndexMap` into an inconsistent state which, while memory-safe, ++ /// will cause the map to produce seemingly random results. Higher-level and more ++ /// foolproof APIs like [`entry`][IndexMap::entry] should be preferred when possible. ++ /// ++ /// Raw entries give mutable access to the keys. This must not be used ++ /// to modify how the key would compare or hash, as the map will not re-evaluate ++ /// where the key should go, meaning the keys may become "lost" if their ++ /// location does not reflect their state. For instance, if you change a key ++ /// so that the map now contains keys which compare equal, search may start ++ /// acting erratically, with two keys randomly masking each other. Implementations ++ /// are free to assume this doesn't happen (within the limits of memory-safety). ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use core::hash::{BuildHasher, Hash}; ++ /// use indexmap::map::{IndexMap, RawEntryApiV1}; ++ /// use indexmap::map::raw_entry_v1::RawEntryMut; ++ /// ++ /// let mut map = IndexMap::new(); ++ /// map.extend([("a", 100), ("b", 200), ("c", 300)]); ++ /// ++ /// fn compute_hash(hash_builder: &S, key: &K) -> u64 { ++ /// use core::hash::Hasher; ++ /// let mut state = hash_builder.build_hasher(); ++ /// key.hash(&mut state); ++ /// state.finish() ++ /// } ++ /// ++ /// // Existing key (insert and update) ++ /// match map.raw_entry_mut_v1().from_key("a") { ++ /// RawEntryMut::Vacant(_) => unreachable!(), ++ /// RawEntryMut::Occupied(mut view) => { ++ /// assert_eq!(view.index(), 0); ++ /// assert_eq!(view.get(), &100); ++ /// let v = view.get_mut(); ++ /// let new_v = (*v) * 10; ++ /// *v = new_v; ++ /// assert_eq!(view.insert(1111), 1000); ++ /// } ++ /// } ++ /// ++ /// assert_eq!(map["a"], 1111); ++ /// assert_eq!(map.len(), 3); ++ /// ++ /// // Existing key (take) ++ /// let hash = compute_hash(map.hasher(), "c"); ++ /// match map.raw_entry_mut_v1().from_key_hashed_nocheck(hash, "c") { ++ /// RawEntryMut::Vacant(_) => unreachable!(), ++ /// RawEntryMut::Occupied(view) => { ++ /// assert_eq!(view.index(), 2); ++ /// assert_eq!(view.shift_remove_entry(), ("c", 300)); ++ /// } ++ /// } ++ /// assert_eq!(map.raw_entry_v1().from_key("c"), None); ++ /// assert_eq!(map.len(), 2); ++ /// ++ /// // Nonexistent key (insert and update) ++ /// let key = "d"; ++ /// let hash = compute_hash(map.hasher(), key); ++ /// match map.raw_entry_mut_v1().from_hash(hash, |q| *q == key) { ++ /// RawEntryMut::Occupied(_) => unreachable!(), ++ /// RawEntryMut::Vacant(view) => { ++ /// assert_eq!(view.index(), 2); ++ /// let (k, value) = view.insert("d", 4000); ++ /// assert_eq!((*k, *value), ("d", 4000)); ++ /// *value = 40000; ++ /// } ++ /// } ++ /// assert_eq!(map["d"], 40000); ++ /// assert_eq!(map.len(), 3); ++ /// ++ /// match map.raw_entry_mut_v1().from_hash(hash, |q| *q == key) { ++ /// RawEntryMut::Vacant(_) => unreachable!(), ++ /// RawEntryMut::Occupied(view) => { ++ /// assert_eq!(view.index(), 2); ++ /// assert_eq!(view.swap_remove_entry(), ("d", 40000)); ++ /// } ++ /// } ++ /// assert_eq!(map.get("d"), None); ++ /// assert_eq!(map.len(), 2); ++ /// ``` ++ fn raw_entry_mut_v1(&mut self) -> RawEntryBuilderMut<'_, K, V, S>; ++} ++ ++impl RawEntryApiV1 for IndexMap { ++ fn raw_entry_v1(&self) -> RawEntryBuilder<'_, K, V, S> { ++ RawEntryBuilder { map: self } ++ } ++ ++ fn raw_entry_mut_v1(&mut self) -> RawEntryBuilderMut<'_, K, V, S> { ++ RawEntryBuilderMut { map: self } ++ } ++} ++ ++/// A builder for computing where in an [`IndexMap`] a key-value pair would be stored. ++/// ++/// This `struct` is created by the [`IndexMap::raw_entry_v1`] method, provided by the ++/// [`RawEntryApiV1`] trait. See its documentation for more. ++pub struct RawEntryBuilder<'a, K, V, S> { ++ map: &'a IndexMap, ++} ++ ++impl fmt::Debug for RawEntryBuilder<'_, K, V, S> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_struct("RawEntryBuilder").finish_non_exhaustive() ++ } ++} ++ ++impl<'a, K, V, S> RawEntryBuilder<'a, K, V, S> { ++ /// Access an entry by key. ++ pub fn from_key(self, key: &Q) -> Option<(&'a K, &'a V)> ++ where ++ S: BuildHasher, ++ Q: ?Sized + Hash + Equivalent, ++ { ++ self.map.get_key_value(key) ++ } ++ ++ /// Access an entry by a key and its hash. ++ pub fn from_key_hashed_nocheck(self, hash: u64, key: &Q) -> Option<(&'a K, &'a V)> ++ where ++ Q: ?Sized + Equivalent, ++ { ++ let hash = HashValue(hash as usize); ++ let i = self.map.core.get_index_of(hash, key)?; ++ self.map.get_index(i) ++ } ++ ++ /// Access an entry by hash. ++ pub fn from_hash(self, hash: u64, is_match: F) -> Option<(&'a K, &'a V)> ++ where ++ F: FnMut(&K) -> bool, ++ { ++ let map = self.map; ++ let i = self.index_from_hash(hash, is_match)?; ++ map.get_index(i) ++ } ++ ++ /// Access an entry by hash, including its index. ++ pub fn from_hash_full(self, hash: u64, is_match: F) -> Option<(usize, &'a K, &'a V)> ++ where ++ F: FnMut(&K) -> bool, ++ { ++ let map = self.map; ++ let i = self.index_from_hash(hash, is_match)?; ++ let (key, value) = map.get_index(i)?; ++ Some((i, key, value)) ++ } ++ ++ /// Access the index of an entry by hash. ++ pub fn index_from_hash(self, hash: u64, mut is_match: F) -> Option ++ where ++ F: FnMut(&K) -> bool, ++ { ++ let hash = HashValue(hash as usize); ++ let entries = &*self.map.core.entries; ++ let eq = move |&i: &usize| is_match(&entries[i].key); ++ self.map.core.indices.find(hash.get(), eq).copied() ++ } ++} ++ ++/// A builder for computing where in an [`IndexMap`] a key-value pair would be stored. ++/// ++/// This `struct` is created by the [`IndexMap::raw_entry_mut_v1`] method, provided by the ++/// [`RawEntryApiV1`] trait. See its documentation for more. ++pub struct RawEntryBuilderMut<'a, K, V, S> { ++ map: &'a mut IndexMap, ++} ++ ++impl fmt::Debug for RawEntryBuilderMut<'_, K, V, S> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_struct("RawEntryBuilderMut").finish_non_exhaustive() ++ } ++} ++ ++impl<'a, K, V, S> RawEntryBuilderMut<'a, K, V, S> { ++ /// Access an entry by key. ++ pub fn from_key(self, key: &Q) -> RawEntryMut<'a, K, V, S> ++ where ++ S: BuildHasher, ++ Q: ?Sized + Hash + Equivalent, ++ { ++ let hash = self.map.hash(key); ++ self.from_key_hashed_nocheck(hash.get(), key) ++ } ++ ++ /// Access an entry by a key and its hash. ++ pub fn from_key_hashed_nocheck(self, hash: u64, key: &Q) -> RawEntryMut<'a, K, V, S> ++ where ++ Q: ?Sized + Equivalent, ++ { ++ self.from_hash(hash, |k| Q::equivalent(key, k)) ++ } ++ ++ /// Access an entry by hash. ++ pub fn from_hash(self, hash: u64, mut is_match: F) -> RawEntryMut<'a, K, V, S> ++ where ++ F: FnMut(&K) -> bool, ++ { ++ let ref_entries = &*self.map.core.entries; ++ let eq = move |&i: &usize| is_match(&ref_entries[i].key); ++ match self.map.core.indices.find_entry(hash, eq) { ++ Ok(index) => RawEntryMut::Occupied(RawOccupiedEntryMut { ++ entries: &mut self.map.core.entries, ++ index, ++ hash_builder: PhantomData, ++ }), ++ Err(absent) => RawEntryMut::Vacant(RawVacantEntryMut { ++ map: RefMut::new(absent.into_table(), &mut self.map.core.entries), ++ hash_builder: &self.map.hash_builder, ++ }), ++ } ++ } ++} ++ ++/// Raw entry for an existing key-value pair or a vacant location to ++/// insert one. ++pub enum RawEntryMut<'a, K, V, S> { ++ /// Existing slot with equivalent key. ++ Occupied(RawOccupiedEntryMut<'a, K, V, S>), ++ /// Vacant slot (no equivalent key in the map). ++ Vacant(RawVacantEntryMut<'a, K, V, S>), ++} ++ ++impl fmt::Debug for RawEntryMut<'_, K, V, S> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ let mut tuple = f.debug_tuple("RawEntryMut"); ++ match self { ++ Self::Vacant(v) => tuple.field(v), ++ Self::Occupied(o) => tuple.field(o), ++ }; ++ tuple.finish() ++ } ++} ++ ++impl<'a, K, V, S> RawEntryMut<'a, K, V, S> { ++ /// Return the index where the key-value pair exists or may be inserted. ++ #[inline] ++ pub fn index(&self) -> usize { ++ match self { ++ Self::Occupied(entry) => entry.index(), ++ Self::Vacant(entry) => entry.index(), ++ } ++ } ++ ++ /// Inserts the given default key and value in the entry if it is vacant and returns mutable ++ /// references to them. Otherwise mutable references to an already existent pair are returned. ++ pub fn or_insert(self, default_key: K, default_value: V) -> (&'a mut K, &'a mut V) ++ where ++ K: Hash, ++ S: BuildHasher, ++ { ++ match self { ++ Self::Occupied(entry) => entry.into_key_value_mut(), ++ Self::Vacant(entry) => entry.insert(default_key, default_value), ++ } ++ } ++ ++ /// Inserts the result of the `call` function in the entry if it is vacant and returns mutable ++ /// references to them. Otherwise mutable references to an already existent pair are returned. ++ pub fn or_insert_with(self, call: F) -> (&'a mut K, &'a mut V) ++ where ++ F: FnOnce() -> (K, V), ++ K: Hash, ++ S: BuildHasher, ++ { ++ match self { ++ Self::Occupied(entry) => entry.into_key_value_mut(), ++ Self::Vacant(entry) => { ++ let (key, value) = call(); ++ entry.insert(key, value) ++ } ++ } ++ } ++ ++ /// Modifies the entry if it is occupied. ++ pub fn and_modify(mut self, f: F) -> Self ++ where ++ F: FnOnce(&mut K, &mut V), ++ { ++ if let Self::Occupied(entry) = &mut self { ++ let (k, v) = entry.get_key_value_mut(); ++ f(k, v); ++ } ++ self ++ } ++} ++ ++/// A raw view into an occupied entry in an [`IndexMap`]. ++/// It is part of the [`RawEntryMut`] enum. ++pub struct RawOccupiedEntryMut<'a, K, V, S> { ++ entries: &'a mut Entries, ++ index: hash_table::OccupiedEntry<'a, usize>, ++ hash_builder: PhantomData<&'a S>, ++} ++ ++impl fmt::Debug for RawOccupiedEntryMut<'_, K, V, S> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_struct("RawOccupiedEntryMut") ++ .field("key", self.key()) ++ .field("value", self.get()) ++ .finish_non_exhaustive() ++ } ++} ++ ++impl<'a, K, V, S> RawOccupiedEntryMut<'a, K, V, S> { ++ /// Return the index of the key-value pair ++ #[inline] ++ pub fn index(&self) -> usize { ++ *self.index.get() ++ } ++ ++ #[inline] ++ fn into_ref_mut(self) -> RefMut<'a, K, V> { ++ RefMut::new(self.index.into_table(), self.entries) ++ } ++ ++ /// Gets a reference to the entry's key in the map. ++ /// ++ /// Note that this is not the key that was used to find the entry. There may be an observable ++ /// difference if the key type has any distinguishing features outside of `Hash` and `Eq`, like ++ /// extra fields or the memory address of an allocation. ++ pub fn key(&self) -> &K { ++ &self.entries[self.index()].key ++ } ++ ++ /// Gets a mutable reference to the entry's key in the map. ++ /// ++ /// Note that this is not the key that was used to find the entry. There may be an observable ++ /// difference if the key type has any distinguishing features outside of `Hash` and `Eq`, like ++ /// extra fields or the memory address of an allocation. ++ pub fn key_mut(&mut self) -> &mut K { ++ let index = self.index(); ++ &mut self.entries[index].key ++ } ++ ++ /// Converts into a mutable reference to the entry's key in the map, ++ /// with a lifetime bound to the map itself. ++ /// ++ /// Note that this is not the key that was used to find the entry. There may be an observable ++ /// difference if the key type has any distinguishing features outside of `Hash` and `Eq`, like ++ /// extra fields or the memory address of an allocation. ++ pub fn into_key(self) -> &'a mut K { ++ let index = self.index(); ++ &mut self.entries[index].key ++ } ++ ++ /// Gets a reference to the entry's value in the map. ++ pub fn get(&self) -> &V { ++ &self.entries[self.index()].value ++ } ++ ++ /// Gets a mutable reference to the entry's value in the map. ++ /// ++ /// If you need a reference which may outlive the destruction of the ++ /// [`RawEntryMut`] value, see [`into_mut`][Self::into_mut]. ++ pub fn get_mut(&mut self) -> &mut V { ++ let index = self.index(); ++ &mut self.entries[index].value ++ } ++ ++ /// Converts into a mutable reference to the entry's value in the map, ++ /// with a lifetime bound to the map itself. ++ pub fn into_mut(self) -> &'a mut V { ++ let index = self.index(); ++ &mut self.entries[index].value ++ } ++ ++ /// Gets a reference to the entry's key and value in the map. ++ pub fn get_key_value(&self) -> (&K, &V) { ++ self.entries[self.index()].refs() ++ } ++ ++ /// Gets a reference to the entry's key and value in the map. ++ pub fn get_key_value_mut(&mut self) -> (&mut K, &mut V) { ++ let index = self.index(); ++ self.entries[index].muts() ++ } ++ ++ /// Converts into a mutable reference to the entry's key and value in the map, ++ /// with a lifetime bound to the map itself. ++ pub fn into_key_value_mut(self) -> (&'a mut K, &'a mut V) { ++ let index = self.index(); ++ self.entries[index].muts() ++ } ++ ++ /// Sets the value of the entry, and returns the entry's old value. ++ pub fn insert(&mut self, value: V) -> V { ++ mem::replace(self.get_mut(), value) ++ } ++ ++ /// Sets the key of the entry, and returns the entry's old key. ++ pub fn insert_key(&mut self, key: K) -> K { ++ mem::replace(self.key_mut(), key) ++ } ++ ++ /// Remove the key, value pair stored in the map for this entry, and return the value. ++ /// ++ /// **NOTE:** This is equivalent to [`.swap_remove()`][Self::swap_remove], replacing this ++ /// entry's position with the last element, and it is deprecated in favor of calling that ++ /// explicitly. If you need to preserve the relative order of the keys in the map, use ++ /// [`.shift_remove()`][Self::shift_remove] instead. ++ #[deprecated(note = "`remove` disrupts the map order -- \ ++ use `swap_remove` or `shift_remove` for explicit behavior.")] ++ pub fn remove(self) -> V { ++ self.swap_remove() ++ } ++ ++ /// Remove the key, value pair stored in the map for this entry, and return the value. ++ /// ++ /// Like [`Vec::swap_remove`][crate::Vec::swap_remove], the pair is removed by swapping it with ++ /// the last element of the map and popping it off. ++ /// **This perturbs the position of what used to be the last element!** ++ /// ++ /// Computes in **O(1)** time (average). ++ pub fn swap_remove(self) -> V { ++ self.swap_remove_entry().1 ++ } ++ ++ /// Remove the key, value pair stored in the map for this entry, and return the value. ++ /// ++ /// Like [`Vec::remove`][crate::Vec::remove], the pair is removed by shifting all of the ++ /// elements that follow it, preserving their relative order. ++ /// **This perturbs the index of all of those elements!** ++ /// ++ /// Computes in **O(n)** time (average). ++ pub fn shift_remove(self) -> V { ++ self.shift_remove_entry().1 ++ } ++ ++ /// Remove and return the key, value pair stored in the map for this entry ++ /// ++ /// **NOTE:** This is equivalent to [`.swap_remove_entry()`][Self::swap_remove_entry], ++ /// replacing this entry's position with the last element, and it is deprecated in favor of ++ /// calling that explicitly. If you need to preserve the relative order of the keys in the map, ++ /// use [`.shift_remove_entry()`][Self::shift_remove_entry] instead. ++ #[deprecated(note = "`remove_entry` disrupts the map order -- \ ++ use `swap_remove_entry` or `shift_remove_entry` for explicit behavior.")] ++ pub fn remove_entry(self) -> (K, V) { ++ self.swap_remove_entry() ++ } ++ ++ /// Remove and return the key, value pair stored in the map for this entry ++ /// ++ /// Like [`Vec::swap_remove`][crate::Vec::swap_remove], the pair is removed by swapping it with ++ /// the last element of the map and popping it off. ++ /// **This perturbs the position of what used to be the last element!** ++ /// ++ /// Computes in **O(1)** time (average). ++ pub fn swap_remove_entry(self) -> (K, V) { ++ let (index, entry) = self.index.remove(); ++ RefMut::new(entry.into_table(), self.entries).swap_remove_finish(index) ++ } ++ ++ /// Remove and return the key, value pair stored in the map for this entry ++ /// ++ /// Like [`Vec::remove`][crate::Vec::remove], the pair is removed by shifting all of the ++ /// elements that follow it, preserving their relative order. ++ /// **This perturbs the index of all of those elements!** ++ /// ++ /// Computes in **O(n)** time (average). ++ pub fn shift_remove_entry(self) -> (K, V) { ++ let (index, entry) = self.index.remove(); ++ RefMut::new(entry.into_table(), self.entries).shift_remove_finish(index) ++ } ++ ++ /// Moves the position of the entry to a new index ++ /// by shifting all other entries in-between. ++ /// ++ /// This is equivalent to [`IndexMap::move_index`] ++ /// coming `from` the current [`.index()`][Self::index]. ++ /// ++ /// * If `self.index() < to`, the other pairs will shift down while the targeted pair moves up. ++ /// * If `self.index() > to`, the other pairs will shift up while the targeted pair moves down. ++ /// ++ /// ***Panics*** if `to` is out of bounds. ++ /// ++ /// Computes in **O(n)** time (average). ++ pub fn move_index(self, to: usize) { ++ let index = self.index(); ++ self.into_ref_mut().move_index(index, to); ++ } ++ ++ /// Swaps the position of entry with another. ++ /// ++ /// This is equivalent to [`IndexMap::swap_indices`] ++ /// with the current [`.index()`][Self::index] as one of the two being swapped. ++ /// ++ /// ***Panics*** if the `other` index is out of bounds. ++ /// ++ /// Computes in **O(1)** time (average). ++ pub fn swap_indices(self, other: usize) { ++ let index = self.index(); ++ self.into_ref_mut().swap_indices(index, other); ++ } ++} ++ ++/// A view into a vacant raw entry in an [`IndexMap`]. ++/// It is part of the [`RawEntryMut`] enum. ++pub struct RawVacantEntryMut<'a, K, V, S> { ++ map: RefMut<'a, K, V>, ++ hash_builder: &'a S, ++} ++ ++impl fmt::Debug for RawVacantEntryMut<'_, K, V, S> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_struct("RawVacantEntryMut").finish_non_exhaustive() ++ } ++} ++ ++impl<'a, K, V, S> RawVacantEntryMut<'a, K, V, S> { ++ /// Return the index where a key-value pair may be inserted. ++ pub fn index(&self) -> usize { ++ self.map.indices.len() ++ } ++ ++ /// Inserts the given key and value into the map, ++ /// and returns mutable references to them. ++ pub fn insert(self, key: K, value: V) -> (&'a mut K, &'a mut V) ++ where ++ K: Hash, ++ S: BuildHasher, ++ { ++ let mut h = self.hash_builder.build_hasher(); ++ key.hash(&mut h); ++ self.insert_hashed_nocheck(h.finish(), key, value) ++ } ++ ++ /// Inserts the given key and value into the map with the provided hash, ++ /// and returns mutable references to them. ++ pub fn insert_hashed_nocheck(self, hash: u64, key: K, value: V) -> (&'a mut K, &'a mut V) { ++ let hash = HashValue(hash as usize); ++ self.map.insert_unique(hash, key, value).into_muts() ++ } ++ ++ /// Inserts the given key and value into the map at the given index, ++ /// shifting others to the right, and returns mutable references to them. ++ /// ++ /// ***Panics*** if `index` is out of bounds. ++ /// ++ /// Computes in **O(n)** time (average). ++ pub fn shift_insert(self, index: usize, key: K, value: V) -> (&'a mut K, &'a mut V) ++ where ++ K: Hash, ++ S: BuildHasher, ++ { ++ let mut h = self.hash_builder.build_hasher(); ++ key.hash(&mut h); ++ self.shift_insert_hashed_nocheck(index, h.finish(), key, value) ++ } ++ ++ /// Inserts the given key and value into the map with the provided hash ++ /// at the given index, and returns mutable references to them. ++ /// ++ /// ***Panics*** if `index` is out of bounds. ++ /// ++ /// Computes in **O(n)** time (average). ++ pub fn shift_insert_hashed_nocheck( ++ mut self, ++ index: usize, ++ hash: u64, ++ key: K, ++ value: V, ++ ) -> (&'a mut K, &'a mut V) { ++ let hash = HashValue(hash as usize); ++ self.map.shift_insert_unique(index, hash, key, value); ++ self.map.entries[index].muts() ++ } ++} ++ ++mod private { ++ pub trait Sealed {} ++ ++ impl Sealed for super::IndexMap {} ++} +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/src/map/core.rs mesa-25.3.3/subprojects/indexmap-2.7.0/src/map/core.rs +--- mesa-25.3.3/subprojects/indexmap-2.7.0/src/map/core.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/src/map/core.rs 2025-01-11 13:48:35.000000000 -0500 +@@ -0,0 +1,722 @@ ++//! This is the core implementation that doesn't depend on the hasher at all. ++//! ++//! The methods of `IndexMapCore` don't use any Hash properties of K. ++//! ++//! It's cleaner to separate them out, then the compiler checks that we are not ++//! using Hash at all in these methods. ++//! ++//! However, we should probably not let this show in the public API or docs. ++ ++mod entry; ++ ++pub mod raw_entry_v1; ++ ++use hashbrown::hash_table; ++ ++use crate::vec::{self, Vec}; ++use crate::TryReserveError; ++use core::mem; ++use core::ops::RangeBounds; ++ ++use crate::util::simplify_range; ++use crate::{Bucket, Equivalent, HashValue}; ++ ++type Indices = hash_table::HashTable; ++type Entries = Vec>; ++ ++pub use entry::{Entry, IndexedEntry, OccupiedEntry, VacantEntry}; ++ ++/// Core of the map that does not depend on S ++#[derive(Debug)] ++pub(crate) struct IndexMapCore { ++ /// indices mapping from the entry hash to its index. ++ indices: Indices, ++ /// entries is a dense vec maintaining entry order. ++ entries: Entries, ++} ++ ++/// Mutable references to the parts of an `IndexMapCore`. ++/// ++/// When using `HashTable::find_entry`, that takes hold of `&mut indices`, so we have to borrow our ++/// `&mut entries` separately, and there's no way to go back to a `&mut IndexMapCore`. So this type ++/// is used to implement methods on the split references, and `IndexMapCore` can also call those to ++/// avoid duplication. ++struct RefMut<'a, K, V> { ++ indices: &'a mut Indices, ++ entries: &'a mut Entries, ++} ++ ++#[inline(always)] ++fn get_hash(entries: &[Bucket]) -> impl Fn(&usize) -> u64 + '_ { ++ move |&i| entries[i].hash.get() ++} ++ ++#[inline] ++fn equivalent<'a, K, V, Q: ?Sized + Equivalent>( ++ key: &'a Q, ++ entries: &'a [Bucket], ++) -> impl Fn(&usize) -> bool + 'a { ++ move |&i| Q::equivalent(key, &entries[i].key) ++} ++ ++#[inline] ++fn erase_index(table: &mut Indices, hash: HashValue, index: usize) { ++ if let Ok(entry) = table.find_entry(hash.get(), move |&i| i == index) { ++ entry.remove(); ++ } else if cfg!(debug_assertions) { ++ panic!("index not found"); ++ } ++} ++ ++#[inline] ++fn update_index(table: &mut Indices, hash: HashValue, old: usize, new: usize) { ++ let index = table ++ .find_mut(hash.get(), move |&i| i == old) ++ .expect("index not found"); ++ *index = new; ++} ++ ++/// Inserts many entries into the indices table without reallocating, ++/// and without regard for duplication. ++/// ++/// ***Panics*** if there is not sufficient capacity already. ++fn insert_bulk_no_grow(indices: &mut Indices, entries: &[Bucket]) { ++ assert!(indices.capacity() - indices.len() >= entries.len()); ++ for entry in entries { ++ indices.insert_unique(entry.hash.get(), indices.len(), |_| unreachable!()); ++ } ++} ++ ++impl Clone for IndexMapCore ++where ++ K: Clone, ++ V: Clone, ++{ ++ fn clone(&self) -> Self { ++ let mut new = Self::new(); ++ new.clone_from(self); ++ new ++ } ++ ++ fn clone_from(&mut self, other: &Self) { ++ self.indices.clone_from(&other.indices); ++ if self.entries.capacity() < other.entries.len() { ++ // If we must resize, match the indices capacity. ++ let additional = other.entries.len() - self.entries.len(); ++ self.borrow_mut().reserve_entries(additional); ++ } ++ self.entries.clone_from(&other.entries); ++ } ++} ++ ++impl crate::Entries for IndexMapCore { ++ type Entry = Bucket; ++ ++ #[inline] ++ fn into_entries(self) -> Vec { ++ self.entries ++ } ++ ++ #[inline] ++ fn as_entries(&self) -> &[Self::Entry] { ++ &self.entries ++ } ++ ++ #[inline] ++ fn as_entries_mut(&mut self) -> &mut [Self::Entry] { ++ &mut self.entries ++ } ++ ++ fn with_entries(&mut self, f: F) ++ where ++ F: FnOnce(&mut [Self::Entry]), ++ { ++ f(&mut self.entries); ++ self.rebuild_hash_table(); ++ } ++} ++ ++impl IndexMapCore { ++ /// The maximum capacity before the `entries` allocation would exceed `isize::MAX`. ++ const MAX_ENTRIES_CAPACITY: usize = (isize::MAX as usize) / mem::size_of::>(); ++ ++ #[inline] ++ pub(crate) const fn new() -> Self { ++ IndexMapCore { ++ indices: Indices::new(), ++ entries: Vec::new(), ++ } ++ } ++ ++ #[inline] ++ fn borrow_mut(&mut self) -> RefMut<'_, K, V> { ++ RefMut::new(&mut self.indices, &mut self.entries) ++ } ++ ++ #[inline] ++ pub(crate) fn with_capacity(n: usize) -> Self { ++ IndexMapCore { ++ indices: Indices::with_capacity(n), ++ entries: Vec::with_capacity(n), ++ } ++ } ++ ++ #[inline] ++ pub(crate) fn len(&self) -> usize { ++ self.indices.len() ++ } ++ ++ #[inline] ++ pub(crate) fn capacity(&self) -> usize { ++ Ord::min(self.indices.capacity(), self.entries.capacity()) ++ } ++ ++ pub(crate) fn clear(&mut self) { ++ self.indices.clear(); ++ self.entries.clear(); ++ } ++ ++ pub(crate) fn truncate(&mut self, len: usize) { ++ if len < self.len() { ++ self.erase_indices(len, self.entries.len()); ++ self.entries.truncate(len); ++ } ++ } ++ ++ pub(crate) fn drain(&mut self, range: R) -> vec::Drain<'_, Bucket> ++ where ++ R: RangeBounds, ++ { ++ let range = simplify_range(range, self.entries.len()); ++ self.erase_indices(range.start, range.end); ++ self.entries.drain(range) ++ } ++ ++ #[cfg(feature = "rayon")] ++ pub(crate) fn par_drain(&mut self, range: R) -> rayon::vec::Drain<'_, Bucket> ++ where ++ K: Send, ++ V: Send, ++ R: RangeBounds, ++ { ++ use rayon::iter::ParallelDrainRange; ++ let range = simplify_range(range, self.entries.len()); ++ self.erase_indices(range.start, range.end); ++ self.entries.par_drain(range) ++ } ++ ++ pub(crate) fn split_off(&mut self, at: usize) -> Self { ++ assert!(at <= self.entries.len()); ++ self.erase_indices(at, self.entries.len()); ++ let entries = self.entries.split_off(at); ++ ++ let mut indices = Indices::with_capacity(entries.len()); ++ insert_bulk_no_grow(&mut indices, &entries); ++ Self { indices, entries } ++ } ++ ++ pub(crate) fn split_splice(&mut self, range: R) -> (Self, vec::IntoIter>) ++ where ++ R: RangeBounds, ++ { ++ let range = simplify_range(range, self.len()); ++ self.erase_indices(range.start, self.entries.len()); ++ let entries = self.entries.split_off(range.end); ++ let drained = self.entries.split_off(range.start); ++ ++ let mut indices = Indices::with_capacity(entries.len()); ++ insert_bulk_no_grow(&mut indices, &entries); ++ (Self { indices, entries }, drained.into_iter()) ++ } ++ ++ /// Append from another map without checking whether items already exist. ++ pub(crate) fn append_unchecked(&mut self, other: &mut Self) { ++ self.reserve(other.len()); ++ insert_bulk_no_grow(&mut self.indices, &other.entries); ++ self.entries.append(&mut other.entries); ++ other.indices.clear(); ++ } ++ ++ /// Reserve capacity for `additional` more key-value pairs. ++ pub(crate) fn reserve(&mut self, additional: usize) { ++ self.indices.reserve(additional, get_hash(&self.entries)); ++ // Only grow entries if necessary, since we also round up capacity. ++ if additional > self.entries.capacity() - self.entries.len() { ++ self.borrow_mut().reserve_entries(additional); ++ } ++ } ++ ++ /// Reserve capacity for `additional` more key-value pairs, without over-allocating. ++ pub(crate) fn reserve_exact(&mut self, additional: usize) { ++ self.indices.reserve(additional, get_hash(&self.entries)); ++ self.entries.reserve_exact(additional); ++ } ++ ++ /// Try to reserve capacity for `additional` more key-value pairs. ++ pub(crate) fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> { ++ self.indices ++ .try_reserve(additional, get_hash(&self.entries)) ++ .map_err(TryReserveError::from_hashbrown)?; ++ // Only grow entries if necessary, since we also round up capacity. ++ if additional > self.entries.capacity() - self.entries.len() { ++ self.try_reserve_entries(additional) ++ } else { ++ Ok(()) ++ } ++ } ++ ++ /// Try to reserve entries capacity, rounded up to match the indices ++ fn try_reserve_entries(&mut self, additional: usize) -> Result<(), TryReserveError> { ++ // Use a soft-limit on the maximum capacity, but if the caller explicitly ++ // requested more, do it and let them have the resulting error. ++ let new_capacity = Ord::min(self.indices.capacity(), Self::MAX_ENTRIES_CAPACITY); ++ let try_add = new_capacity - self.entries.len(); ++ if try_add > additional && self.entries.try_reserve_exact(try_add).is_ok() { ++ return Ok(()); ++ } ++ self.entries ++ .try_reserve_exact(additional) ++ .map_err(TryReserveError::from_alloc) ++ } ++ ++ /// Try to reserve capacity for `additional` more key-value pairs, without over-allocating. ++ pub(crate) fn try_reserve_exact(&mut self, additional: usize) -> Result<(), TryReserveError> { ++ self.indices ++ .try_reserve(additional, get_hash(&self.entries)) ++ .map_err(TryReserveError::from_hashbrown)?; ++ self.entries ++ .try_reserve_exact(additional) ++ .map_err(TryReserveError::from_alloc) ++ } ++ ++ /// Shrink the capacity of the map with a lower bound ++ pub(crate) fn shrink_to(&mut self, min_capacity: usize) { ++ self.indices ++ .shrink_to(min_capacity, get_hash(&self.entries)); ++ self.entries.shrink_to(min_capacity); ++ } ++ ++ /// Remove the last key-value pair ++ pub(crate) fn pop(&mut self) -> Option<(K, V)> { ++ if let Some(entry) = self.entries.pop() { ++ let last = self.entries.len(); ++ erase_index(&mut self.indices, entry.hash, last); ++ Some((entry.key, entry.value)) ++ } else { ++ None ++ } ++ } ++ ++ /// Return the index in `entries` where an equivalent key can be found ++ pub(crate) fn get_index_of(&self, hash: HashValue, key: &Q) -> Option ++ where ++ Q: ?Sized + Equivalent, ++ { ++ let eq = equivalent(key, &self.entries); ++ self.indices.find(hash.get(), eq).copied() ++ } ++ ++ /// Append a key-value pair to `entries`, ++ /// *without* checking whether it already exists. ++ fn push_entry(&mut self, hash: HashValue, key: K, value: V) { ++ if self.entries.len() == self.entries.capacity() { ++ // Reserve our own capacity synced to the indices, ++ // rather than letting `Vec::push` just double it. ++ self.borrow_mut().reserve_entries(1); ++ } ++ self.entries.push(Bucket { hash, key, value }); ++ } ++ ++ pub(crate) fn insert_full(&mut self, hash: HashValue, key: K, value: V) -> (usize, Option) ++ where ++ K: Eq, ++ { ++ let eq = equivalent(&key, &self.entries); ++ let hasher = get_hash(&self.entries); ++ match self.indices.entry(hash.get(), eq, hasher) { ++ hash_table::Entry::Occupied(entry) => { ++ let i = *entry.get(); ++ (i, Some(mem::replace(&mut self.entries[i].value, value))) ++ } ++ hash_table::Entry::Vacant(entry) => { ++ let i = self.entries.len(); ++ entry.insert(i); ++ self.push_entry(hash, key, value); ++ debug_assert_eq!(self.indices.len(), self.entries.len()); ++ (i, None) ++ } ++ } ++ } ++ ++ /// Same as `insert_full`, except it also replaces the key ++ pub(crate) fn replace_full( ++ &mut self, ++ hash: HashValue, ++ key: K, ++ value: V, ++ ) -> (usize, Option<(K, V)>) ++ where ++ K: Eq, ++ { ++ let eq = equivalent(&key, &self.entries); ++ let hasher = get_hash(&self.entries); ++ match self.indices.entry(hash.get(), eq, hasher) { ++ hash_table::Entry::Occupied(entry) => { ++ let i = *entry.get(); ++ let entry = &mut self.entries[i]; ++ let kv = ( ++ mem::replace(&mut entry.key, key), ++ mem::replace(&mut entry.value, value), ++ ); ++ (i, Some(kv)) ++ } ++ hash_table::Entry::Vacant(entry) => { ++ let i = self.entries.len(); ++ entry.insert(i); ++ self.push_entry(hash, key, value); ++ debug_assert_eq!(self.indices.len(), self.entries.len()); ++ (i, None) ++ } ++ } ++ } ++ ++ /// Remove an entry by shifting all entries that follow it ++ pub(crate) fn shift_remove_full(&mut self, hash: HashValue, key: &Q) -> Option<(usize, K, V)> ++ where ++ Q: ?Sized + Equivalent, ++ { ++ let eq = equivalent(key, &self.entries); ++ match self.indices.find_entry(hash.get(), eq) { ++ Ok(entry) => { ++ let (index, _) = entry.remove(); ++ let (key, value) = self.borrow_mut().shift_remove_finish(index); ++ Some((index, key, value)) ++ } ++ Err(_) => None, ++ } ++ } ++ ++ /// Remove an entry by shifting all entries that follow it ++ #[inline] ++ pub(crate) fn shift_remove_index(&mut self, index: usize) -> Option<(K, V)> { ++ self.borrow_mut().shift_remove_index(index) ++ } ++ ++ #[inline] ++ pub(super) fn move_index(&mut self, from: usize, to: usize) { ++ self.borrow_mut().move_index(from, to); ++ } ++ ++ #[inline] ++ pub(crate) fn swap_indices(&mut self, a: usize, b: usize) { ++ self.borrow_mut().swap_indices(a, b); ++ } ++ ++ /// Remove an entry by swapping it with the last ++ pub(crate) fn swap_remove_full(&mut self, hash: HashValue, key: &Q) -> Option<(usize, K, V)> ++ where ++ Q: ?Sized + Equivalent, ++ { ++ let eq = equivalent(key, &self.entries); ++ match self.indices.find_entry(hash.get(), eq) { ++ Ok(entry) => { ++ let (index, _) = entry.remove(); ++ let (key, value) = self.borrow_mut().swap_remove_finish(index); ++ Some((index, key, value)) ++ } ++ Err(_) => None, ++ } ++ } ++ ++ /// Remove an entry by swapping it with the last ++ #[inline] ++ pub(crate) fn swap_remove_index(&mut self, index: usize) -> Option<(K, V)> { ++ self.borrow_mut().swap_remove_index(index) ++ } ++ ++ /// Erase `start..end` from `indices`, and shift `end..` indices down to `start..` ++ /// ++ /// All of these items should still be at their original location in `entries`. ++ /// This is used by `drain`, which will let `Vec::drain` do the work on `entries`. ++ fn erase_indices(&mut self, start: usize, end: usize) { ++ let (init, shifted_entries) = self.entries.split_at(end); ++ let (start_entries, erased_entries) = init.split_at(start); ++ ++ let erased = erased_entries.len(); ++ let shifted = shifted_entries.len(); ++ let half_capacity = self.indices.capacity() / 2; ++ ++ // Use a heuristic between different strategies ++ if erased == 0 { ++ // Degenerate case, nothing to do ++ } else if start + shifted < half_capacity && start < erased { ++ // Reinsert everything, as there are few kept indices ++ self.indices.clear(); ++ ++ // Reinsert stable indices, then shifted indices ++ insert_bulk_no_grow(&mut self.indices, start_entries); ++ insert_bulk_no_grow(&mut self.indices, shifted_entries); ++ } else if erased + shifted < half_capacity { ++ // Find each affected index, as there are few to adjust ++ ++ // Find erased indices ++ for (i, entry) in (start..).zip(erased_entries) { ++ erase_index(&mut self.indices, entry.hash, i); ++ } ++ ++ // Find shifted indices ++ for ((new, old), entry) in (start..).zip(end..).zip(shifted_entries) { ++ update_index(&mut self.indices, entry.hash, old, new); ++ } ++ } else { ++ // Sweep the whole table for adjustments ++ let offset = end - start; ++ self.indices.retain(move |i| { ++ if *i >= end { ++ *i -= offset; ++ true ++ } else { ++ *i < start ++ } ++ }); ++ } ++ ++ debug_assert_eq!(self.indices.len(), start + shifted); ++ } ++ ++ pub(crate) fn retain_in_order(&mut self, mut keep: F) ++ where ++ F: FnMut(&mut K, &mut V) -> bool, ++ { ++ self.entries ++ .retain_mut(|entry| keep(&mut entry.key, &mut entry.value)); ++ if self.entries.len() < self.indices.len() { ++ self.rebuild_hash_table(); ++ } ++ } ++ ++ fn rebuild_hash_table(&mut self) { ++ self.indices.clear(); ++ insert_bulk_no_grow(&mut self.indices, &self.entries); ++ } ++ ++ pub(crate) fn reverse(&mut self) { ++ self.entries.reverse(); ++ ++ // No need to save hash indices, can easily calculate what they should ++ // be, given that this is an in-place reversal. ++ let len = self.entries.len(); ++ for i in &mut self.indices { ++ *i = len - *i - 1; ++ } ++ } ++} ++ ++impl<'a, K, V> RefMut<'a, K, V> { ++ #[inline] ++ fn new(indices: &'a mut Indices, entries: &'a mut Entries) -> Self { ++ Self { indices, entries } ++ } ++ ++ /// Reserve entries capacity, rounded up to match the indices ++ fn reserve_entries(&mut self, additional: usize) { ++ // Use a soft-limit on the maximum capacity, but if the caller explicitly ++ // requested more, do it and let them have the resulting panic. ++ let new_capacity = Ord::min( ++ self.indices.capacity(), ++ IndexMapCore::::MAX_ENTRIES_CAPACITY, ++ ); ++ let try_add = new_capacity - self.entries.len(); ++ if try_add > additional && self.entries.try_reserve_exact(try_add).is_ok() { ++ return; ++ } ++ self.entries.reserve_exact(additional); ++ } ++ ++ /// Insert a key-value pair in `entries`, ++ /// *without* checking whether it already exists. ++ fn insert_unique(mut self, hash: HashValue, key: K, value: V) -> OccupiedEntry<'a, K, V> { ++ if self.entries.len() == self.entries.capacity() { ++ // Reserve our own capacity synced to the indices, ++ // rather than letting `Vec::push` just double it. ++ self.reserve_entries(1); ++ } ++ let i = self.indices.len(); ++ let entry = self ++ .indices ++ .insert_unique(hash.get(), i, get_hash(self.entries)); ++ debug_assert_eq!(i, self.entries.len()); ++ self.entries.push(Bucket { hash, key, value }); ++ OccupiedEntry::new(self.entries, entry) ++ } ++ ++ /// Insert a key-value pair in `entries` at a particular index, ++ /// *without* checking whether it already exists. ++ fn shift_insert_unique(&mut self, index: usize, hash: HashValue, key: K, value: V) { ++ let end = self.indices.len(); ++ assert!(index <= end); ++ // Increment others first so we don't have duplicate indices. ++ self.increment_indices(index, end); ++ let entries = &*self.entries; ++ self.indices.insert_unique(hash.get(), index, move |&i| { ++ // Adjust for the incremented indices to find hashes. ++ debug_assert_ne!(i, index); ++ let i = if i < index { i } else { i - 1 }; ++ entries[i].hash.get() ++ }); ++ if self.entries.len() == self.entries.capacity() { ++ // Reserve our own capacity synced to the indices, ++ // rather than letting `Vec::insert` just double it. ++ self.reserve_entries(1); ++ } ++ self.entries.insert(index, Bucket { hash, key, value }); ++ } ++ ++ /// Remove an entry by shifting all entries that follow it ++ fn shift_remove_index(&mut self, index: usize) -> Option<(K, V)> { ++ match self.entries.get(index) { ++ Some(entry) => { ++ erase_index(self.indices, entry.hash, index); ++ Some(self.shift_remove_finish(index)) ++ } ++ None => None, ++ } ++ } ++ ++ /// Remove an entry by shifting all entries that follow it ++ /// ++ /// The index should already be removed from `self.indices`. ++ fn shift_remove_finish(&mut self, index: usize) -> (K, V) { ++ // Correct indices that point to the entries that followed the removed entry. ++ self.decrement_indices(index + 1, self.entries.len()); ++ ++ // Use Vec::remove to actually remove the entry. ++ let entry = self.entries.remove(index); ++ (entry.key, entry.value) ++ } ++ ++ /// Remove an entry by swapping it with the last ++ fn swap_remove_index(&mut self, index: usize) -> Option<(K, V)> { ++ match self.entries.get(index) { ++ Some(entry) => { ++ erase_index(self.indices, entry.hash, index); ++ Some(self.swap_remove_finish(index)) ++ } ++ None => None, ++ } ++ } ++ ++ /// Finish removing an entry by swapping it with the last ++ /// ++ /// The index should already be removed from `self.indices`. ++ fn swap_remove_finish(&mut self, index: usize) -> (K, V) { ++ // use swap_remove, but then we need to update the index that points ++ // to the other entry that has to move ++ let entry = self.entries.swap_remove(index); ++ ++ // correct index that points to the entry that had to swap places ++ if let Some(entry) = self.entries.get(index) { ++ // was not last element ++ // examine new element in `index` and find it in indices ++ let last = self.entries.len(); ++ update_index(self.indices, entry.hash, last, index); ++ } ++ ++ (entry.key, entry.value) ++ } ++ ++ /// Decrement all indices in the range `start..end`. ++ /// ++ /// The index `start - 1` should not exist in `self.indices`. ++ /// All entries should still be in their original positions. ++ fn decrement_indices(&mut self, start: usize, end: usize) { ++ // Use a heuristic between a full sweep vs. a `find()` for every shifted item. ++ let shifted_entries = &self.entries[start..end]; ++ if shifted_entries.len() > self.indices.capacity() / 2 { ++ // Shift all indices in range. ++ for i in &mut *self.indices { ++ if start <= *i && *i < end { ++ *i -= 1; ++ } ++ } ++ } else { ++ // Find each entry in range to shift its index. ++ for (i, entry) in (start..end).zip(shifted_entries) { ++ update_index(self.indices, entry.hash, i, i - 1); ++ } ++ } ++ } ++ ++ /// Increment all indices in the range `start..end`. ++ /// ++ /// The index `end` should not exist in `self.indices`. ++ /// All entries should still be in their original positions. ++ fn increment_indices(&mut self, start: usize, end: usize) { ++ // Use a heuristic between a full sweep vs. a `find()` for every shifted item. ++ let shifted_entries = &self.entries[start..end]; ++ if shifted_entries.len() > self.indices.capacity() / 2 { ++ // Shift all indices in range. ++ for i in &mut *self.indices { ++ if start <= *i && *i < end { ++ *i += 1; ++ } ++ } ++ } else { ++ // Find each entry in range to shift its index, updated in reverse so ++ // we never have duplicated indices that might have a hash collision. ++ for (i, entry) in (start..end).zip(shifted_entries).rev() { ++ update_index(self.indices, entry.hash, i, i + 1); ++ } ++ } ++ } ++ ++ fn move_index(&mut self, from: usize, to: usize) { ++ let from_hash = self.entries[from].hash; ++ let _ = self.entries[to]; // explicit bounds check ++ if from != to { ++ // Use a sentinel index so other indices don't collide. ++ update_index(self.indices, from_hash, from, usize::MAX); ++ ++ // Update all other indices and rotate the entry positions. ++ if from < to { ++ self.decrement_indices(from + 1, to + 1); ++ self.entries[from..=to].rotate_left(1); ++ } else if to < from { ++ self.increment_indices(to, from); ++ self.entries[to..=from].rotate_right(1); ++ } ++ ++ // Change the sentinel index to its final position. ++ update_index(self.indices, from_hash, usize::MAX, to); ++ } ++ } ++ ++ fn swap_indices(&mut self, a: usize, b: usize) { ++ // If they're equal and in-bounds, there's nothing to do. ++ if a == b && a < self.entries.len() { ++ return; ++ } ++ ++ // We'll get a "nice" bounds-check from indexing `entries`, ++ // and then we expect to find it in the table as well. ++ match self.indices.get_many_mut( ++ [self.entries[a].hash.get(), self.entries[b].hash.get()], ++ move |i, &x| if i == 0 { x == a } else { x == b }, ++ ) { ++ Some([ref_a, ref_b]) => { ++ mem::swap(ref_a, ref_b); ++ self.entries.swap(a, b); ++ } ++ _ => panic!("indices not found"), ++ } ++ } ++} ++ ++#[test] ++fn assert_send_sync() { ++ fn assert_send_sync() {} ++ assert_send_sync::>(); ++ assert_send_sync::>(); ++ assert_send_sync::>(); ++ assert_send_sync::>(); ++} +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/src/map/iter.rs mesa-25.3.3/subprojects/indexmap-2.7.0/src/map/iter.rs +--- mesa-25.3.3/subprojects/indexmap-2.7.0/src/map/iter.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/src/map/iter.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,775 @@ ++use super::core::IndexMapCore; ++use super::{Bucket, Entries, IndexMap, Slice}; ++ ++use alloc::vec::{self, Vec}; ++use core::fmt; ++use core::hash::{BuildHasher, Hash}; ++use core::iter::FusedIterator; ++use core::ops::{Index, RangeBounds}; ++use core::slice; ++ ++impl<'a, K, V, S> IntoIterator for &'a IndexMap { ++ type Item = (&'a K, &'a V); ++ type IntoIter = Iter<'a, K, V>; ++ ++ fn into_iter(self) -> Self::IntoIter { ++ self.iter() ++ } ++} ++ ++impl<'a, K, V, S> IntoIterator for &'a mut IndexMap { ++ type Item = (&'a K, &'a mut V); ++ type IntoIter = IterMut<'a, K, V>; ++ ++ fn into_iter(self) -> Self::IntoIter { ++ self.iter_mut() ++ } ++} ++ ++impl IntoIterator for IndexMap { ++ type Item = (K, V); ++ type IntoIter = IntoIter; ++ ++ fn into_iter(self) -> Self::IntoIter { ++ IntoIter::new(self.into_entries()) ++ } ++} ++ ++/// An iterator over the entries of an [`IndexMap`]. ++/// ++/// This `struct` is created by the [`IndexMap::iter`] method. ++/// See its documentation for more. ++pub struct Iter<'a, K, V> { ++ iter: slice::Iter<'a, Bucket>, ++} ++ ++impl<'a, K, V> Iter<'a, K, V> { ++ pub(super) fn new(entries: &'a [Bucket]) -> Self { ++ Self { ++ iter: entries.iter(), ++ } ++ } ++ ++ /// Returns a slice of the remaining entries in the iterator. ++ pub fn as_slice(&self) -> &'a Slice { ++ Slice::from_slice(self.iter.as_slice()) ++ } ++} ++ ++impl<'a, K, V> Iterator for Iter<'a, K, V> { ++ type Item = (&'a K, &'a V); ++ ++ iterator_methods!(Bucket::refs); ++} ++ ++impl DoubleEndedIterator for Iter<'_, K, V> { ++ double_ended_iterator_methods!(Bucket::refs); ++} ++ ++impl ExactSizeIterator for Iter<'_, K, V> { ++ fn len(&self) -> usize { ++ self.iter.len() ++ } ++} ++ ++impl FusedIterator for Iter<'_, K, V> {} ++ ++// FIXME(#26925) Remove in favor of `#[derive(Clone)]` ++impl Clone for Iter<'_, K, V> { ++ fn clone(&self) -> Self { ++ Iter { ++ iter: self.iter.clone(), ++ } ++ } ++} ++ ++impl fmt::Debug for Iter<'_, K, V> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_list().entries(self.clone()).finish() ++ } ++} ++ ++impl Default for Iter<'_, K, V> { ++ fn default() -> Self { ++ Self { iter: [].iter() } ++ } ++} ++ ++/// A mutable iterator over the entries of an [`IndexMap`]. ++/// ++/// This `struct` is created by the [`IndexMap::iter_mut`] method. ++/// See its documentation for more. ++pub struct IterMut<'a, K, V> { ++ iter: slice::IterMut<'a, Bucket>, ++} ++ ++impl<'a, K, V> IterMut<'a, K, V> { ++ pub(super) fn new(entries: &'a mut [Bucket]) -> Self { ++ Self { ++ iter: entries.iter_mut(), ++ } ++ } ++ ++ /// Returns a slice of the remaining entries in the iterator. ++ pub fn as_slice(&self) -> &Slice { ++ Slice::from_slice(self.iter.as_slice()) ++ } ++ ++ /// Returns a mutable slice of the remaining entries in the iterator. ++ /// ++ /// To avoid creating `&mut` references that alias, this is forced to consume the iterator. ++ pub fn into_slice(self) -> &'a mut Slice { ++ Slice::from_mut_slice(self.iter.into_slice()) ++ } ++} ++ ++impl<'a, K, V> Iterator for IterMut<'a, K, V> { ++ type Item = (&'a K, &'a mut V); ++ ++ iterator_methods!(Bucket::ref_mut); ++} ++ ++impl DoubleEndedIterator for IterMut<'_, K, V> { ++ double_ended_iterator_methods!(Bucket::ref_mut); ++} ++ ++impl ExactSizeIterator for IterMut<'_, K, V> { ++ fn len(&self) -> usize { ++ self.iter.len() ++ } ++} ++ ++impl FusedIterator for IterMut<'_, K, V> {} ++ ++impl fmt::Debug for IterMut<'_, K, V> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ let iter = self.iter.as_slice().iter().map(Bucket::refs); ++ f.debug_list().entries(iter).finish() ++ } ++} ++ ++impl Default for IterMut<'_, K, V> { ++ fn default() -> Self { ++ Self { ++ iter: [].iter_mut(), ++ } ++ } ++} ++ ++/// A mutable iterator over the entries of an [`IndexMap`]. ++/// ++/// This `struct` is created by the [`MutableKeys::iter_mut2`][super::MutableKeys::iter_mut2] method. ++/// See its documentation for more. ++pub struct IterMut2<'a, K, V> { ++ iter: slice::IterMut<'a, Bucket>, ++} ++ ++impl<'a, K, V> IterMut2<'a, K, V> { ++ pub(super) fn new(entries: &'a mut [Bucket]) -> Self { ++ Self { ++ iter: entries.iter_mut(), ++ } ++ } ++ ++ /// Returns a slice of the remaining entries in the iterator. ++ pub fn as_slice(&self) -> &Slice { ++ Slice::from_slice(self.iter.as_slice()) ++ } ++ ++ /// Returns a mutable slice of the remaining entries in the iterator. ++ /// ++ /// To avoid creating `&mut` references that alias, this is forced to consume the iterator. ++ pub fn into_slice(self) -> &'a mut Slice { ++ Slice::from_mut_slice(self.iter.into_slice()) ++ } ++} ++ ++impl<'a, K, V> Iterator for IterMut2<'a, K, V> { ++ type Item = (&'a mut K, &'a mut V); ++ ++ iterator_methods!(Bucket::muts); ++} ++ ++impl DoubleEndedIterator for IterMut2<'_, K, V> { ++ double_ended_iterator_methods!(Bucket::muts); ++} ++ ++impl ExactSizeIterator for IterMut2<'_, K, V> { ++ fn len(&self) -> usize { ++ self.iter.len() ++ } ++} ++ ++impl FusedIterator for IterMut2<'_, K, V> {} ++ ++impl fmt::Debug for IterMut2<'_, K, V> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ let iter = self.iter.as_slice().iter().map(Bucket::refs); ++ f.debug_list().entries(iter).finish() ++ } ++} ++ ++impl Default for IterMut2<'_, K, V> { ++ fn default() -> Self { ++ Self { ++ iter: [].iter_mut(), ++ } ++ } ++} ++ ++/// An owning iterator over the entries of an [`IndexMap`]. ++/// ++/// This `struct` is created by the [`IndexMap::into_iter`] method ++/// (provided by the [`IntoIterator`] trait). See its documentation for more. ++#[derive(Clone)] ++pub struct IntoIter { ++ iter: vec::IntoIter>, ++} ++ ++impl IntoIter { ++ pub(super) fn new(entries: Vec>) -> Self { ++ Self { ++ iter: entries.into_iter(), ++ } ++ } ++ ++ /// Returns a slice of the remaining entries in the iterator. ++ pub fn as_slice(&self) -> &Slice { ++ Slice::from_slice(self.iter.as_slice()) ++ } ++ ++ /// Returns a mutable slice of the remaining entries in the iterator. ++ pub fn as_mut_slice(&mut self) -> &mut Slice { ++ Slice::from_mut_slice(self.iter.as_mut_slice()) ++ } ++} ++ ++impl Iterator for IntoIter { ++ type Item = (K, V); ++ ++ iterator_methods!(Bucket::key_value); ++} ++ ++impl DoubleEndedIterator for IntoIter { ++ double_ended_iterator_methods!(Bucket::key_value); ++} ++ ++impl ExactSizeIterator for IntoIter { ++ fn len(&self) -> usize { ++ self.iter.len() ++ } ++} ++ ++impl FusedIterator for IntoIter {} ++ ++impl fmt::Debug for IntoIter { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ let iter = self.iter.as_slice().iter().map(Bucket::refs); ++ f.debug_list().entries(iter).finish() ++ } ++} ++ ++impl Default for IntoIter { ++ fn default() -> Self { ++ Self { ++ iter: Vec::new().into_iter(), ++ } ++ } ++} ++ ++/// A draining iterator over the entries of an [`IndexMap`]. ++/// ++/// This `struct` is created by the [`IndexMap::drain`] method. ++/// See its documentation for more. ++pub struct Drain<'a, K, V> { ++ iter: vec::Drain<'a, Bucket>, ++} ++ ++impl<'a, K, V> Drain<'a, K, V> { ++ pub(super) fn new(iter: vec::Drain<'a, Bucket>) -> Self { ++ Self { iter } ++ } ++ ++ /// Returns a slice of the remaining entries in the iterator. ++ pub fn as_slice(&self) -> &Slice { ++ Slice::from_slice(self.iter.as_slice()) ++ } ++} ++ ++impl Iterator for Drain<'_, K, V> { ++ type Item = (K, V); ++ ++ iterator_methods!(Bucket::key_value); ++} ++ ++impl DoubleEndedIterator for Drain<'_, K, V> { ++ double_ended_iterator_methods!(Bucket::key_value); ++} ++ ++impl ExactSizeIterator for Drain<'_, K, V> { ++ fn len(&self) -> usize { ++ self.iter.len() ++ } ++} ++ ++impl FusedIterator for Drain<'_, K, V> {} ++ ++impl fmt::Debug for Drain<'_, K, V> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ let iter = self.iter.as_slice().iter().map(Bucket::refs); ++ f.debug_list().entries(iter).finish() ++ } ++} ++ ++/// An iterator over the keys of an [`IndexMap`]. ++/// ++/// This `struct` is created by the [`IndexMap::keys`] method. ++/// See its documentation for more. ++pub struct Keys<'a, K, V> { ++ iter: slice::Iter<'a, Bucket>, ++} ++ ++impl<'a, K, V> Keys<'a, K, V> { ++ pub(super) fn new(entries: &'a [Bucket]) -> Self { ++ Self { ++ iter: entries.iter(), ++ } ++ } ++} ++ ++impl<'a, K, V> Iterator for Keys<'a, K, V> { ++ type Item = &'a K; ++ ++ iterator_methods!(Bucket::key_ref); ++} ++ ++impl DoubleEndedIterator for Keys<'_, K, V> { ++ double_ended_iterator_methods!(Bucket::key_ref); ++} ++ ++impl ExactSizeIterator for Keys<'_, K, V> { ++ fn len(&self) -> usize { ++ self.iter.len() ++ } ++} ++ ++impl FusedIterator for Keys<'_, K, V> {} ++ ++// FIXME(#26925) Remove in favor of `#[derive(Clone)]` ++impl Clone for Keys<'_, K, V> { ++ fn clone(&self) -> Self { ++ Keys { ++ iter: self.iter.clone(), ++ } ++ } ++} ++ ++impl fmt::Debug for Keys<'_, K, V> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_list().entries(self.clone()).finish() ++ } ++} ++ ++impl Default for Keys<'_, K, V> { ++ fn default() -> Self { ++ Self { iter: [].iter() } ++ } ++} ++ ++/// Access [`IndexMap`] keys at indexed positions. ++/// ++/// While [`Index for IndexMap`][values] accesses a map's values, ++/// indexing through [`IndexMap::keys`] offers an alternative to access a map's ++/// keys instead. ++/// ++/// [values]: IndexMap#impl-Index-for-IndexMap ++/// ++/// Since `Keys` is also an iterator, consuming items from the iterator will ++/// offset the effective indexes. Similarly, if `Keys` is obtained from ++/// [`Slice::keys`], indexes will be interpreted relative to the position of ++/// that slice. ++/// ++/// # Examples ++/// ++/// ``` ++/// use indexmap::IndexMap; ++/// ++/// let mut map = IndexMap::new(); ++/// for word in "Lorem ipsum dolor sit amet".split_whitespace() { ++/// map.insert(word.to_lowercase(), word.to_uppercase()); ++/// } ++/// ++/// assert_eq!(map[0], "LOREM"); ++/// assert_eq!(map.keys()[0], "lorem"); ++/// assert_eq!(map[1], "IPSUM"); ++/// assert_eq!(map.keys()[1], "ipsum"); ++/// ++/// map.reverse(); ++/// assert_eq!(map.keys()[0], "amet"); ++/// assert_eq!(map.keys()[1], "sit"); ++/// ++/// map.sort_keys(); ++/// assert_eq!(map.keys()[0], "amet"); ++/// assert_eq!(map.keys()[1], "dolor"); ++/// ++/// // Advancing the iterator will offset the indexing ++/// let mut keys = map.keys(); ++/// assert_eq!(keys[0], "amet"); ++/// assert_eq!(keys.next().map(|s| &**s), Some("amet")); ++/// assert_eq!(keys[0], "dolor"); ++/// assert_eq!(keys[1], "ipsum"); ++/// ++/// // Slices may have an offset as well ++/// let slice = &map[2..]; ++/// assert_eq!(slice[0], "IPSUM"); ++/// assert_eq!(slice.keys()[0], "ipsum"); ++/// ``` ++/// ++/// ```should_panic ++/// use indexmap::IndexMap; ++/// ++/// let mut map = IndexMap::new(); ++/// map.insert("foo", 1); ++/// println!("{:?}", map.keys()[10]); // panics! ++/// ``` ++impl<'a, K, V> Index for Keys<'a, K, V> { ++ type Output = K; ++ ++ /// Returns a reference to the key at the supplied `index`. ++ /// ++ /// ***Panics*** if `index` is out of bounds. ++ fn index(&self, index: usize) -> &K { ++ &self.iter.as_slice()[index].key ++ } ++} ++ ++/// An owning iterator over the keys of an [`IndexMap`]. ++/// ++/// This `struct` is created by the [`IndexMap::into_keys`] method. ++/// See its documentation for more. ++pub struct IntoKeys { ++ iter: vec::IntoIter>, ++} ++ ++impl IntoKeys { ++ pub(super) fn new(entries: Vec>) -> Self { ++ Self { ++ iter: entries.into_iter(), ++ } ++ } ++} ++ ++impl Iterator for IntoKeys { ++ type Item = K; ++ ++ iterator_methods!(Bucket::key); ++} ++ ++impl DoubleEndedIterator for IntoKeys { ++ double_ended_iterator_methods!(Bucket::key); ++} ++ ++impl ExactSizeIterator for IntoKeys { ++ fn len(&self) -> usize { ++ self.iter.len() ++ } ++} ++ ++impl FusedIterator for IntoKeys {} ++ ++impl fmt::Debug for IntoKeys { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ let iter = self.iter.as_slice().iter().map(Bucket::key_ref); ++ f.debug_list().entries(iter).finish() ++ } ++} ++ ++impl Default for IntoKeys { ++ fn default() -> Self { ++ Self { ++ iter: Vec::new().into_iter(), ++ } ++ } ++} ++ ++/// An iterator over the values of an [`IndexMap`]. ++/// ++/// This `struct` is created by the [`IndexMap::values`] method. ++/// See its documentation for more. ++pub struct Values<'a, K, V> { ++ iter: slice::Iter<'a, Bucket>, ++} ++ ++impl<'a, K, V> Values<'a, K, V> { ++ pub(super) fn new(entries: &'a [Bucket]) -> Self { ++ Self { ++ iter: entries.iter(), ++ } ++ } ++} ++ ++impl<'a, K, V> Iterator for Values<'a, K, V> { ++ type Item = &'a V; ++ ++ iterator_methods!(Bucket::value_ref); ++} ++ ++impl DoubleEndedIterator for Values<'_, K, V> { ++ double_ended_iterator_methods!(Bucket::value_ref); ++} ++ ++impl ExactSizeIterator for Values<'_, K, V> { ++ fn len(&self) -> usize { ++ self.iter.len() ++ } ++} ++ ++impl FusedIterator for Values<'_, K, V> {} ++ ++// FIXME(#26925) Remove in favor of `#[derive(Clone)]` ++impl Clone for Values<'_, K, V> { ++ fn clone(&self) -> Self { ++ Values { ++ iter: self.iter.clone(), ++ } ++ } ++} ++ ++impl fmt::Debug for Values<'_, K, V> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_list().entries(self.clone()).finish() ++ } ++} ++ ++impl Default for Values<'_, K, V> { ++ fn default() -> Self { ++ Self { iter: [].iter() } ++ } ++} ++ ++/// A mutable iterator over the values of an [`IndexMap`]. ++/// ++/// This `struct` is created by the [`IndexMap::values_mut`] method. ++/// See its documentation for more. ++pub struct ValuesMut<'a, K, V> { ++ iter: slice::IterMut<'a, Bucket>, ++} ++ ++impl<'a, K, V> ValuesMut<'a, K, V> { ++ pub(super) fn new(entries: &'a mut [Bucket]) -> Self { ++ Self { ++ iter: entries.iter_mut(), ++ } ++ } ++} ++ ++impl<'a, K, V> Iterator for ValuesMut<'a, K, V> { ++ type Item = &'a mut V; ++ ++ iterator_methods!(Bucket::value_mut); ++} ++ ++impl DoubleEndedIterator for ValuesMut<'_, K, V> { ++ double_ended_iterator_methods!(Bucket::value_mut); ++} ++ ++impl ExactSizeIterator for ValuesMut<'_, K, V> { ++ fn len(&self) -> usize { ++ self.iter.len() ++ } ++} ++ ++impl FusedIterator for ValuesMut<'_, K, V> {} ++ ++impl fmt::Debug for ValuesMut<'_, K, V> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ let iter = self.iter.as_slice().iter().map(Bucket::value_ref); ++ f.debug_list().entries(iter).finish() ++ } ++} ++ ++impl Default for ValuesMut<'_, K, V> { ++ fn default() -> Self { ++ Self { ++ iter: [].iter_mut(), ++ } ++ } ++} ++ ++/// An owning iterator over the values of an [`IndexMap`]. ++/// ++/// This `struct` is created by the [`IndexMap::into_values`] method. ++/// See its documentation for more. ++pub struct IntoValues { ++ iter: vec::IntoIter>, ++} ++ ++impl IntoValues { ++ pub(super) fn new(entries: Vec>) -> Self { ++ Self { ++ iter: entries.into_iter(), ++ } ++ } ++} ++ ++impl Iterator for IntoValues { ++ type Item = V; ++ ++ iterator_methods!(Bucket::value); ++} ++ ++impl DoubleEndedIterator for IntoValues { ++ double_ended_iterator_methods!(Bucket::value); ++} ++ ++impl ExactSizeIterator for IntoValues { ++ fn len(&self) -> usize { ++ self.iter.len() ++ } ++} ++ ++impl FusedIterator for IntoValues {} ++ ++impl fmt::Debug for IntoValues { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ let iter = self.iter.as_slice().iter().map(Bucket::value_ref); ++ f.debug_list().entries(iter).finish() ++ } ++} ++ ++impl Default for IntoValues { ++ fn default() -> Self { ++ Self { ++ iter: Vec::new().into_iter(), ++ } ++ } ++} ++ ++/// A splicing iterator for `IndexMap`. ++/// ++/// This `struct` is created by [`IndexMap::splice()`]. ++/// See its documentation for more. ++pub struct Splice<'a, I, K, V, S> ++where ++ I: Iterator, ++ K: Hash + Eq, ++ S: BuildHasher, ++{ ++ map: &'a mut IndexMap, ++ tail: IndexMapCore, ++ drain: vec::IntoIter>, ++ replace_with: I, ++} ++ ++impl<'a, I, K, V, S> Splice<'a, I, K, V, S> ++where ++ I: Iterator, ++ K: Hash + Eq, ++ S: BuildHasher, ++{ ++ pub(super) fn new(map: &'a mut IndexMap, range: R, replace_with: I) -> Self ++ where ++ R: RangeBounds, ++ { ++ let (tail, drain) = map.core.split_splice(range); ++ Self { ++ map, ++ tail, ++ drain, ++ replace_with, ++ } ++ } ++} ++ ++impl Drop for Splice<'_, I, K, V, S> ++where ++ I: Iterator, ++ K: Hash + Eq, ++ S: BuildHasher, ++{ ++ fn drop(&mut self) { ++ // Finish draining unconsumed items. We don't strictly *have* to do this ++ // manually, since we already split it into separate memory, but it will ++ // match the drop order of `vec::Splice` items this way. ++ let _ = self.drain.nth(usize::MAX); ++ ++ // Now insert all the new items. If a key matches an existing entry, it ++ // keeps the original position and only replaces the value, like `insert`. ++ while let Some((key, value)) = self.replace_with.next() { ++ // Since the tail is disjoint, we can try to update it first, ++ // or else insert (update or append) the primary map. ++ let hash = self.map.hash(&key); ++ if let Some(i) = self.tail.get_index_of(hash, &key) { ++ self.tail.as_entries_mut()[i].value = value; ++ } else { ++ self.map.core.insert_full(hash, key, value); ++ } ++ } ++ ++ // Finally, re-append the tail ++ self.map.core.append_unchecked(&mut self.tail); ++ } ++} ++ ++impl Iterator for Splice<'_, I, K, V, S> ++where ++ I: Iterator, ++ K: Hash + Eq, ++ S: BuildHasher, ++{ ++ type Item = (K, V); ++ ++ fn next(&mut self) -> Option { ++ self.drain.next().map(Bucket::key_value) ++ } ++ ++ fn size_hint(&self) -> (usize, Option) { ++ self.drain.size_hint() ++ } ++} ++ ++impl DoubleEndedIterator for Splice<'_, I, K, V, S> ++where ++ I: Iterator, ++ K: Hash + Eq, ++ S: BuildHasher, ++{ ++ fn next_back(&mut self) -> Option { ++ self.drain.next_back().map(Bucket::key_value) ++ } ++} ++ ++impl ExactSizeIterator for Splice<'_, I, K, V, S> ++where ++ I: Iterator, ++ K: Hash + Eq, ++ S: BuildHasher, ++{ ++ fn len(&self) -> usize { ++ self.drain.len() ++ } ++} ++ ++impl FusedIterator for Splice<'_, I, K, V, S> ++where ++ I: Iterator, ++ K: Hash + Eq, ++ S: BuildHasher, ++{ ++} ++ ++impl<'a, I, K, V, S> fmt::Debug for Splice<'a, I, K, V, S> ++where ++ I: fmt::Debug + Iterator, ++ K: fmt::Debug + Hash + Eq, ++ V: fmt::Debug, ++ S: BuildHasher, ++{ ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ // Follow `vec::Splice` in only printing the drain and replacement ++ f.debug_struct("Splice") ++ .field("drain", &self.drain) ++ .field("replace_with", &self.replace_with) ++ .finish() ++ } ++} +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/src/map/mutable.rs mesa-25.3.3/subprojects/indexmap-2.7.0/src/map/mutable.rs +--- mesa-25.3.3/subprojects/indexmap-2.7.0/src/map/mutable.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/src/map/mutable.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,166 @@ ++use core::hash::{BuildHasher, Hash}; ++ ++use super::{ ++ Bucket, Entries, Entry, Equivalent, IndexMap, IndexedEntry, IterMut2, OccupiedEntry, ++ VacantEntry, ++}; ++ ++/// Opt-in mutable access to [`IndexMap`] keys. ++/// ++/// These methods expose `&mut K`, mutable references to the key as it is stored ++/// in the map. ++/// You are allowed to modify the keys in the map **if the modification ++/// does not change the key’s hash and equality**. ++/// ++/// If keys are modified erroneously, you can no longer look them up. ++/// This is sound (memory safe) but a logical error hazard (just like ++/// implementing `PartialEq`, `Eq`, or `Hash` incorrectly would be). ++/// ++/// `use` this trait to enable its methods for `IndexMap`. ++/// ++/// This trait is sealed and cannot be implemented for types outside this crate. ++pub trait MutableKeys: private::Sealed { ++ type Key; ++ type Value; ++ ++ /// Return item index, mutable reference to key and value ++ /// ++ /// Computes in **O(1)** time (average). ++ fn get_full_mut2(&mut self, key: &Q) -> Option<(usize, &mut Self::Key, &mut Self::Value)> ++ where ++ Q: ?Sized + Hash + Equivalent; ++ ++ /// Return mutable reference to key and value at an index. ++ /// ++ /// Valid indices are `0 <= index < self.len()`. ++ /// ++ /// Computes in **O(1)** time. ++ fn get_index_mut2(&mut self, index: usize) -> Option<(&mut Self::Key, &mut Self::Value)>; ++ ++ /// Return an iterator over the key-value pairs of the map, in their order ++ fn iter_mut2(&mut self) -> IterMut2<'_, Self::Key, Self::Value>; ++ ++ /// Scan through each key-value pair in the map and keep those where the ++ /// closure `keep` returns `true`. ++ /// ++ /// The elements are visited in order, and remaining elements keep their ++ /// order. ++ /// ++ /// Computes in **O(n)** time (average). ++ fn retain2(&mut self, keep: F) ++ where ++ F: FnMut(&mut Self::Key, &mut Self::Value) -> bool; ++} ++ ++/// Opt-in mutable access to [`IndexMap`] keys. ++/// ++/// See [`MutableKeys`] for more information. ++impl MutableKeys for IndexMap ++where ++ S: BuildHasher, ++{ ++ type Key = K; ++ type Value = V; ++ ++ fn get_full_mut2(&mut self, key: &Q) -> Option<(usize, &mut K, &mut V)> ++ where ++ Q: ?Sized + Hash + Equivalent, ++ { ++ if let Some(i) = self.get_index_of(key) { ++ let entry = &mut self.as_entries_mut()[i]; ++ Some((i, &mut entry.key, &mut entry.value)) ++ } else { ++ None ++ } ++ } ++ ++ fn get_index_mut2(&mut self, index: usize) -> Option<(&mut K, &mut V)> { ++ self.as_entries_mut().get_mut(index).map(Bucket::muts) ++ } ++ ++ fn iter_mut2(&mut self) -> IterMut2<'_, Self::Key, Self::Value> { ++ IterMut2::new(self.as_entries_mut()) ++ } ++ ++ fn retain2(&mut self, keep: F) ++ where ++ F: FnMut(&mut K, &mut V) -> bool, ++ { ++ self.core.retain_in_order(keep); ++ } ++} ++ ++/// Opt-in mutable access to [`Entry`] keys. ++/// ++/// These methods expose `&mut K`, mutable references to the key as it is stored ++/// in the map. ++/// You are allowed to modify the keys in the map **if the modification ++/// does not change the key’s hash and equality**. ++/// ++/// If keys are modified erroneously, you can no longer look them up. ++/// This is sound (memory safe) but a logical error hazard (just like ++/// implementing `PartialEq`, `Eq`, or `Hash` incorrectly would be). ++/// ++/// `use` this trait to enable its methods for `Entry`. ++/// ++/// This trait is sealed and cannot be implemented for types outside this crate. ++pub trait MutableEntryKey: private::Sealed { ++ type Key; ++ ++ /// Gets a mutable reference to the entry's key, either within the map if occupied, ++ /// or else the new key that was used to find the entry. ++ fn key_mut(&mut self) -> &mut Self::Key; ++} ++ ++/// Opt-in mutable access to [`Entry`] keys. ++/// ++/// See [`MutableEntryKey`] for more information. ++impl MutableEntryKey for Entry<'_, K, V> { ++ type Key = K; ++ fn key_mut(&mut self) -> &mut Self::Key { ++ match self { ++ Entry::Occupied(e) => e.key_mut(), ++ Entry::Vacant(e) => e.key_mut(), ++ } ++ } ++} ++ ++/// Opt-in mutable access to [`OccupiedEntry`] keys. ++/// ++/// See [`MutableEntryKey`] for more information. ++impl MutableEntryKey for OccupiedEntry<'_, K, V> { ++ type Key = K; ++ fn key_mut(&mut self) -> &mut Self::Key { ++ self.key_mut() ++ } ++} ++ ++/// Opt-in mutable access to [`VacantEntry`] keys. ++/// ++/// See [`MutableEntryKey`] for more information. ++impl MutableEntryKey for VacantEntry<'_, K, V> { ++ type Key = K; ++ fn key_mut(&mut self) -> &mut Self::Key { ++ self.key_mut() ++ } ++} ++ ++/// Opt-in mutable access to [`IndexedEntry`] keys. ++/// ++/// See [`MutableEntryKey`] for more information. ++impl MutableEntryKey for IndexedEntry<'_, K, V> { ++ type Key = K; ++ fn key_mut(&mut self) -> &mut Self::Key { ++ self.key_mut() ++ } ++} ++ ++mod private { ++ pub trait Sealed {} ++ ++ impl Sealed for super::IndexMap {} ++ impl Sealed for super::Entry<'_, K, V> {} ++ impl Sealed for super::OccupiedEntry<'_, K, V> {} ++ impl Sealed for super::VacantEntry<'_, K, V> {} ++ impl Sealed for super::IndexedEntry<'_, K, V> {} ++} +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/src/map/serde_seq.rs mesa-25.3.3/subprojects/indexmap-2.7.0/src/map/serde_seq.rs +--- mesa-25.3.3/subprojects/indexmap-2.7.0/src/map/serde_seq.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/src/map/serde_seq.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,138 @@ ++//! Functions to serialize and deserialize an [`IndexMap`] as an ordered sequence. ++//! ++//! The default `serde` implementation serializes `IndexMap` as a normal map, ++//! but there is no guarantee that serialization formats will preserve the order ++//! of the key-value pairs. This module serializes `IndexMap` as a sequence of ++//! `(key, value)` elements instead, in order. ++//! ++//! This module may be used in a field attribute for derived implementations: ++//! ++//! ``` ++//! # use indexmap::IndexMap; ++//! # use serde_derive::{Deserialize, Serialize}; ++//! #[derive(Deserialize, Serialize)] ++//! struct Data { ++//! #[serde(with = "indexmap::map::serde_seq")] ++//! map: IndexMap, ++//! // ... ++//! } ++//! ``` ++ ++use serde::de::{Deserialize, Deserializer, SeqAccess, Visitor}; ++use serde::ser::{Serialize, Serializer}; ++ ++use core::fmt::{self, Formatter}; ++use core::hash::{BuildHasher, Hash}; ++use core::marker::PhantomData; ++ ++use crate::map::Slice as MapSlice; ++use crate::serde::cautious_capacity; ++use crate::set::Slice as SetSlice; ++use crate::IndexMap; ++ ++/// Serializes a [`map::Slice`][MapSlice] as an ordered sequence. ++/// ++/// This behaves like [`crate::map::serde_seq`] for `IndexMap`, serializing a sequence ++/// of `(key, value)` pairs, rather than as a map that might not preserve order. ++impl Serialize for MapSlice ++where ++ K: Serialize, ++ V: Serialize, ++{ ++ fn serialize(&self, serializer: T) -> Result ++ where ++ T: Serializer, ++ { ++ serializer.collect_seq(self) ++ } ++} ++ ++/// Serializes a [`set::Slice`][SetSlice] as an ordered sequence. ++impl Serialize for SetSlice ++where ++ T: Serialize, ++{ ++ fn serialize(&self, serializer: Se) -> Result ++ where ++ Se: Serializer, ++ { ++ serializer.collect_seq(self) ++ } ++} ++ ++/// Serializes an [`IndexMap`] as an ordered sequence. ++/// ++/// This function may be used in a field attribute for deriving [`Serialize`]: ++/// ++/// ``` ++/// # use indexmap::IndexMap; ++/// # use serde_derive::Serialize; ++/// #[derive(Serialize)] ++/// struct Data { ++/// #[serde(serialize_with = "indexmap::map::serde_seq::serialize")] ++/// map: IndexMap, ++/// // ... ++/// } ++/// ``` ++pub fn serialize(map: &IndexMap, serializer: T) -> Result ++where ++ K: Serialize, ++ V: Serialize, ++ T: Serializer, ++{ ++ serializer.collect_seq(map) ++} ++ ++/// Visitor to deserialize a *sequenced* `IndexMap` ++struct SeqVisitor(PhantomData<(K, V, S)>); ++ ++impl<'de, K, V, S> Visitor<'de> for SeqVisitor ++where ++ K: Deserialize<'de> + Eq + Hash, ++ V: Deserialize<'de>, ++ S: Default + BuildHasher, ++{ ++ type Value = IndexMap; ++ ++ fn expecting(&self, formatter: &mut Formatter<'_>) -> fmt::Result { ++ write!(formatter, "a sequenced map") ++ } ++ ++ fn visit_seq(self, mut seq: A) -> Result ++ where ++ A: SeqAccess<'de>, ++ { ++ let capacity = cautious_capacity::(seq.size_hint()); ++ let mut map = IndexMap::with_capacity_and_hasher(capacity, S::default()); ++ ++ while let Some((key, value)) = seq.next_element()? { ++ map.insert(key, value); ++ } ++ ++ Ok(map) ++ } ++} ++ ++/// Deserializes an [`IndexMap`] from an ordered sequence. ++/// ++/// This function may be used in a field attribute for deriving [`Deserialize`]: ++/// ++/// ``` ++/// # use indexmap::IndexMap; ++/// # use serde_derive::Deserialize; ++/// #[derive(Deserialize)] ++/// struct Data { ++/// #[serde(deserialize_with = "indexmap::map::serde_seq::deserialize")] ++/// map: IndexMap, ++/// // ... ++/// } ++/// ``` ++pub fn deserialize<'de, D, K, V, S>(deserializer: D) -> Result, D::Error> ++where ++ D: Deserializer<'de>, ++ K: Deserialize<'de> + Eq + Hash, ++ V: Deserialize<'de>, ++ S: Default + BuildHasher, ++{ ++ deserializer.deserialize_seq(SeqVisitor(PhantomData)) ++} +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/src/map/slice.rs mesa-25.3.3/subprojects/indexmap-2.7.0/src/map/slice.rs +--- mesa-25.3.3/subprojects/indexmap-2.7.0/src/map/slice.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/src/map/slice.rs 2025-01-11 13:48:35.000000000 -0500 +@@ -0,0 +1,539 @@ ++use super::{ ++ Bucket, Entries, IndexMap, IntoIter, IntoKeys, IntoValues, Iter, IterMut, Keys, Values, ++ ValuesMut, ++}; ++use crate::util::try_simplify_range; ++ ++use alloc::boxed::Box; ++use alloc::vec::Vec; ++use core::cmp::Ordering; ++use core::fmt; ++use core::hash::{Hash, Hasher}; ++use core::ops::{self, Bound, Index, IndexMut, RangeBounds}; ++ ++/// A dynamically-sized slice of key-value pairs in an [`IndexMap`]. ++/// ++/// This supports indexed operations much like a `[(K, V)]` slice, ++/// but not any hashed operations on the map keys. ++/// ++/// Unlike `IndexMap`, `Slice` does consider the order for [`PartialEq`] ++/// and [`Eq`], and it also implements [`PartialOrd`], [`Ord`], and [`Hash`]. ++#[repr(transparent)] ++pub struct Slice { ++ pub(crate) entries: [Bucket], ++} ++ ++// SAFETY: `Slice` is a transparent wrapper around `[Bucket]`, ++// and reference lifetimes are bound together in function signatures. ++#[allow(unsafe_code)] ++impl Slice { ++ pub(super) const fn from_slice(entries: &[Bucket]) -> &Self { ++ unsafe { &*(entries as *const [Bucket] as *const Self) } ++ } ++ ++ pub(super) fn from_mut_slice(entries: &mut [Bucket]) -> &mut Self { ++ unsafe { &mut *(entries as *mut [Bucket] as *mut Self) } ++ } ++ ++ pub(super) fn from_boxed(entries: Box<[Bucket]>) -> Box { ++ unsafe { Box::from_raw(Box::into_raw(entries) as *mut Self) } ++ } ++ ++ fn into_boxed(self: Box) -> Box<[Bucket]> { ++ unsafe { Box::from_raw(Box::into_raw(self) as *mut [Bucket]) } ++ } ++} ++ ++impl Slice { ++ pub(crate) fn into_entries(self: Box) -> Vec> { ++ self.into_boxed().into_vec() ++ } ++ ++ /// Returns an empty slice. ++ pub const fn new<'a>() -> &'a Self { ++ Self::from_slice(&[]) ++ } ++ ++ /// Returns an empty mutable slice. ++ pub fn new_mut<'a>() -> &'a mut Self { ++ Self::from_mut_slice(&mut []) ++ } ++ ++ /// Return the number of key-value pairs in the map slice. ++ #[inline] ++ pub const fn len(&self) -> usize { ++ self.entries.len() ++ } ++ ++ /// Returns true if the map slice contains no elements. ++ #[inline] ++ pub const fn is_empty(&self) -> bool { ++ self.entries.is_empty() ++ } ++ ++ /// Get a key-value pair by index. ++ /// ++ /// Valid indices are `0 <= index < self.len()`. ++ pub fn get_index(&self, index: usize) -> Option<(&K, &V)> { ++ self.entries.get(index).map(Bucket::refs) ++ } ++ ++ /// Get a key-value pair by index, with mutable access to the value. ++ /// ++ /// Valid indices are `0 <= index < self.len()`. ++ pub fn get_index_mut(&mut self, index: usize) -> Option<(&K, &mut V)> { ++ self.entries.get_mut(index).map(Bucket::ref_mut) ++ } ++ ++ /// Returns a slice of key-value pairs in the given range of indices. ++ /// ++ /// Valid indices are `0 <= index < self.len()`. ++ pub fn get_range>(&self, range: R) -> Option<&Self> { ++ let range = try_simplify_range(range, self.entries.len())?; ++ self.entries.get(range).map(Slice::from_slice) ++ } ++ ++ /// Returns a mutable slice of key-value pairs in the given range of indices. ++ /// ++ /// Valid indices are `0 <= index < self.len()`. ++ pub fn get_range_mut>(&mut self, range: R) -> Option<&mut Self> { ++ let range = try_simplify_range(range, self.entries.len())?; ++ self.entries.get_mut(range).map(Slice::from_mut_slice) ++ } ++ ++ /// Get the first key-value pair. ++ pub fn first(&self) -> Option<(&K, &V)> { ++ self.entries.first().map(Bucket::refs) ++ } ++ ++ /// Get the first key-value pair, with mutable access to the value. ++ pub fn first_mut(&mut self) -> Option<(&K, &mut V)> { ++ self.entries.first_mut().map(Bucket::ref_mut) ++ } ++ ++ /// Get the last key-value pair. ++ pub fn last(&self) -> Option<(&K, &V)> { ++ self.entries.last().map(Bucket::refs) ++ } ++ ++ /// Get the last key-value pair, with mutable access to the value. ++ pub fn last_mut(&mut self) -> Option<(&K, &mut V)> { ++ self.entries.last_mut().map(Bucket::ref_mut) ++ } ++ ++ /// Divides one slice into two at an index. ++ /// ++ /// ***Panics*** if `index > len`. ++ pub fn split_at(&self, index: usize) -> (&Self, &Self) { ++ let (first, second) = self.entries.split_at(index); ++ (Self::from_slice(first), Self::from_slice(second)) ++ } ++ ++ /// Divides one mutable slice into two at an index. ++ /// ++ /// ***Panics*** if `index > len`. ++ pub fn split_at_mut(&mut self, index: usize) -> (&mut Self, &mut Self) { ++ let (first, second) = self.entries.split_at_mut(index); ++ (Self::from_mut_slice(first), Self::from_mut_slice(second)) ++ } ++ ++ /// Returns the first key-value pair and the rest of the slice, ++ /// or `None` if it is empty. ++ pub fn split_first(&self) -> Option<((&K, &V), &Self)> { ++ if let [first, rest @ ..] = &self.entries { ++ Some((first.refs(), Self::from_slice(rest))) ++ } else { ++ None ++ } ++ } ++ ++ /// Returns the first key-value pair and the rest of the slice, ++ /// with mutable access to the value, or `None` if it is empty. ++ pub fn split_first_mut(&mut self) -> Option<((&K, &mut V), &mut Self)> { ++ if let [first, rest @ ..] = &mut self.entries { ++ Some((first.ref_mut(), Self::from_mut_slice(rest))) ++ } else { ++ None ++ } ++ } ++ ++ /// Returns the last key-value pair and the rest of the slice, ++ /// or `None` if it is empty. ++ pub fn split_last(&self) -> Option<((&K, &V), &Self)> { ++ if let [rest @ .., last] = &self.entries { ++ Some((last.refs(), Self::from_slice(rest))) ++ } else { ++ None ++ } ++ } ++ ++ /// Returns the last key-value pair and the rest of the slice, ++ /// with mutable access to the value, or `None` if it is empty. ++ pub fn split_last_mut(&mut self) -> Option<((&K, &mut V), &mut Self)> { ++ if let [rest @ .., last] = &mut self.entries { ++ Some((last.ref_mut(), Self::from_mut_slice(rest))) ++ } else { ++ None ++ } ++ } ++ ++ /// Return an iterator over the key-value pairs of the map slice. ++ pub fn iter(&self) -> Iter<'_, K, V> { ++ Iter::new(&self.entries) ++ } ++ ++ /// Return an iterator over the key-value pairs of the map slice. ++ pub fn iter_mut(&mut self) -> IterMut<'_, K, V> { ++ IterMut::new(&mut self.entries) ++ } ++ ++ /// Return an iterator over the keys of the map slice. ++ pub fn keys(&self) -> Keys<'_, K, V> { ++ Keys::new(&self.entries) ++ } ++ ++ /// Return an owning iterator over the keys of the map slice. ++ pub fn into_keys(self: Box) -> IntoKeys { ++ IntoKeys::new(self.into_entries()) ++ } ++ ++ /// Return an iterator over the values of the map slice. ++ pub fn values(&self) -> Values<'_, K, V> { ++ Values::new(&self.entries) ++ } ++ ++ /// Return an iterator over mutable references to the the values of the map slice. ++ pub fn values_mut(&mut self) -> ValuesMut<'_, K, V> { ++ ValuesMut::new(&mut self.entries) ++ } ++ ++ /// Return an owning iterator over the values of the map slice. ++ pub fn into_values(self: Box) -> IntoValues { ++ IntoValues::new(self.into_entries()) ++ } ++ ++ /// Search over a sorted map for a key. ++ /// ++ /// Returns the position where that key is present, or the position where it can be inserted to ++ /// maintain the sort. See [`slice::binary_search`] for more details. ++ /// ++ /// Computes in **O(log(n))** time, which is notably less scalable than looking the key up in ++ /// the map this is a slice from using [`IndexMap::get_index_of`], but this can also position ++ /// missing keys. ++ pub fn binary_search_keys(&self, x: &K) -> Result ++ where ++ K: Ord, ++ { ++ self.binary_search_by(|p, _| p.cmp(x)) ++ } ++ ++ /// Search over a sorted map with a comparator function. ++ /// ++ /// Returns the position where that value is present, or the position where it can be inserted ++ /// to maintain the sort. See [`slice::binary_search_by`] for more details. ++ /// ++ /// Computes in **O(log(n))** time. ++ #[inline] ++ pub fn binary_search_by<'a, F>(&'a self, mut f: F) -> Result ++ where ++ F: FnMut(&'a K, &'a V) -> Ordering, ++ { ++ self.entries.binary_search_by(move |a| f(&a.key, &a.value)) ++ } ++ ++ /// Search over a sorted map with an extraction function. ++ /// ++ /// Returns the position where that value is present, or the position where it can be inserted ++ /// to maintain the sort. See [`slice::binary_search_by_key`] for more details. ++ /// ++ /// Computes in **O(log(n))** time. ++ #[inline] ++ pub fn binary_search_by_key<'a, B, F>(&'a self, b: &B, mut f: F) -> Result ++ where ++ F: FnMut(&'a K, &'a V) -> B, ++ B: Ord, ++ { ++ self.binary_search_by(|k, v| f(k, v).cmp(b)) ++ } ++ ++ /// Returns the index of the partition point of a sorted map according to the given predicate ++ /// (the index of the first element of the second partition). ++ /// ++ /// See [`slice::partition_point`] for more details. ++ /// ++ /// Computes in **O(log(n))** time. ++ #[must_use] ++ pub fn partition_point

(&self, mut pred: P) -> usize ++ where ++ P: FnMut(&K, &V) -> bool, ++ { ++ self.entries ++ .partition_point(move |a| pred(&a.key, &a.value)) ++ } ++} ++ ++impl<'a, K, V> IntoIterator for &'a Slice { ++ type IntoIter = Iter<'a, K, V>; ++ type Item = (&'a K, &'a V); ++ ++ fn into_iter(self) -> Self::IntoIter { ++ self.iter() ++ } ++} ++ ++impl<'a, K, V> IntoIterator for &'a mut Slice { ++ type IntoIter = IterMut<'a, K, V>; ++ type Item = (&'a K, &'a mut V); ++ ++ fn into_iter(self) -> Self::IntoIter { ++ self.iter_mut() ++ } ++} ++ ++impl IntoIterator for Box> { ++ type IntoIter = IntoIter; ++ type Item = (K, V); ++ ++ fn into_iter(self) -> Self::IntoIter { ++ IntoIter::new(self.into_entries()) ++ } ++} ++ ++impl Default for &'_ Slice { ++ fn default() -> Self { ++ Slice::from_slice(&[]) ++ } ++} ++ ++impl Default for &'_ mut Slice { ++ fn default() -> Self { ++ Slice::from_mut_slice(&mut []) ++ } ++} ++ ++impl Default for Box> { ++ fn default() -> Self { ++ Slice::from_boxed(Box::default()) ++ } ++} ++ ++impl Clone for Box> { ++ fn clone(&self) -> Self { ++ Slice::from_boxed(self.entries.to_vec().into_boxed_slice()) ++ } ++} ++ ++impl From<&Slice> for Box> { ++ fn from(slice: &Slice) -> Self { ++ Slice::from_boxed(Box::from(&slice.entries)) ++ } ++} ++ ++impl fmt::Debug for Slice { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_list().entries(self).finish() ++ } ++} ++ ++impl PartialEq for Slice { ++ fn eq(&self, other: &Self) -> bool { ++ self.len() == other.len() && self.iter().eq(other) ++ } ++} ++ ++impl Eq for Slice {} ++ ++impl PartialOrd for Slice { ++ fn partial_cmp(&self, other: &Self) -> Option { ++ self.iter().partial_cmp(other) ++ } ++} ++ ++impl Ord for Slice { ++ fn cmp(&self, other: &Self) -> Ordering { ++ self.iter().cmp(other) ++ } ++} ++ ++impl Hash for Slice { ++ fn hash(&self, state: &mut H) { ++ self.len().hash(state); ++ for (key, value) in self { ++ key.hash(state); ++ value.hash(state); ++ } ++ } ++} ++ ++impl Index for Slice { ++ type Output = V; ++ ++ fn index(&self, index: usize) -> &V { ++ &self.entries[index].value ++ } ++} ++ ++impl IndexMut for Slice { ++ fn index_mut(&mut self, index: usize) -> &mut V { ++ &mut self.entries[index].value ++ } ++} ++ ++// We can't have `impl> Index` because that conflicts ++// both upstream with `Index` and downstream with `Index<&Q>`. ++// Instead, we repeat the implementations for all the core range types. ++macro_rules! impl_index { ++ ($($range:ty),*) => {$( ++ impl Index<$range> for IndexMap { ++ type Output = Slice; ++ ++ fn index(&self, range: $range) -> &Self::Output { ++ Slice::from_slice(&self.as_entries()[range]) ++ } ++ } ++ ++ impl IndexMut<$range> for IndexMap { ++ fn index_mut(&mut self, range: $range) -> &mut Self::Output { ++ Slice::from_mut_slice(&mut self.as_entries_mut()[range]) ++ } ++ } ++ ++ impl Index<$range> for Slice { ++ type Output = Slice; ++ ++ fn index(&self, range: $range) -> &Self { ++ Self::from_slice(&self.entries[range]) ++ } ++ } ++ ++ impl IndexMut<$range> for Slice { ++ fn index_mut(&mut self, range: $range) -> &mut Self { ++ Self::from_mut_slice(&mut self.entries[range]) ++ } ++ } ++ )*} ++} ++impl_index!( ++ ops::Range, ++ ops::RangeFrom, ++ ops::RangeFull, ++ ops::RangeInclusive, ++ ops::RangeTo, ++ ops::RangeToInclusive, ++ (Bound, Bound) ++); ++ ++#[cfg(all(test, feature = "std"))] ++mod tests { ++ use super::*; ++ ++ #[test] ++ fn slice_index() { ++ fn check( ++ vec_slice: &[(i32, i32)], ++ map_slice: &Slice, ++ sub_slice: &Slice, ++ ) { ++ assert_eq!(map_slice as *const _, sub_slice as *const _); ++ itertools::assert_equal( ++ vec_slice.iter().copied(), ++ map_slice.iter().map(|(&k, &v)| (k, v)), ++ ); ++ itertools::assert_equal(vec_slice.iter().map(|(k, _)| k), map_slice.keys()); ++ itertools::assert_equal(vec_slice.iter().map(|(_, v)| v), map_slice.values()); ++ } ++ ++ let vec: Vec<(i32, i32)> = (0..10).map(|i| (i, i * i)).collect(); ++ let map: IndexMap = vec.iter().cloned().collect(); ++ let slice = map.as_slice(); ++ ++ // RangeFull ++ check(&vec[..], &map[..], &slice[..]); ++ ++ for i in 0usize..10 { ++ // Index ++ assert_eq!(vec[i].1, map[i]); ++ assert_eq!(vec[i].1, slice[i]); ++ assert_eq!(map[&(i as i32)], map[i]); ++ assert_eq!(map[&(i as i32)], slice[i]); ++ ++ // RangeFrom ++ check(&vec[i..], &map[i..], &slice[i..]); ++ ++ // RangeTo ++ check(&vec[..i], &map[..i], &slice[..i]); ++ ++ // RangeToInclusive ++ check(&vec[..=i], &map[..=i], &slice[..=i]); ++ ++ // (Bound, Bound) ++ let bounds = (Bound::Excluded(i), Bound::Unbounded); ++ check(&vec[i + 1..], &map[bounds], &slice[bounds]); ++ ++ for j in i..=10 { ++ // Range ++ check(&vec[i..j], &map[i..j], &slice[i..j]); ++ } ++ ++ for j in i..10 { ++ // RangeInclusive ++ check(&vec[i..=j], &map[i..=j], &slice[i..=j]); ++ } ++ } ++ } ++ ++ #[test] ++ fn slice_index_mut() { ++ fn check_mut( ++ vec_slice: &[(i32, i32)], ++ map_slice: &mut Slice, ++ sub_slice: &mut Slice, ++ ) { ++ assert_eq!(map_slice, sub_slice); ++ itertools::assert_equal( ++ vec_slice.iter().copied(), ++ map_slice.iter_mut().map(|(&k, &mut v)| (k, v)), ++ ); ++ itertools::assert_equal( ++ vec_slice.iter().map(|&(_, v)| v), ++ map_slice.values_mut().map(|&mut v| v), ++ ); ++ } ++ ++ let vec: Vec<(i32, i32)> = (0..10).map(|i| (i, i * i)).collect(); ++ let mut map: IndexMap = vec.iter().cloned().collect(); ++ let mut map2 = map.clone(); ++ let slice = map2.as_mut_slice(); ++ ++ // RangeFull ++ check_mut(&vec[..], &mut map[..], &mut slice[..]); ++ ++ for i in 0usize..10 { ++ // IndexMut ++ assert_eq!(&mut map[i], &mut slice[i]); ++ ++ // RangeFrom ++ check_mut(&vec[i..], &mut map[i..], &mut slice[i..]); ++ ++ // RangeTo ++ check_mut(&vec[..i], &mut map[..i], &mut slice[..i]); ++ ++ // RangeToInclusive ++ check_mut(&vec[..=i], &mut map[..=i], &mut slice[..=i]); ++ ++ // (Bound, Bound) ++ let bounds = (Bound::Excluded(i), Bound::Unbounded); ++ check_mut(&vec[i + 1..], &mut map[bounds], &mut slice[bounds]); ++ ++ for j in i..=10 { ++ // Range ++ check_mut(&vec[i..j], &mut map[i..j], &mut slice[i..j]); ++ } ++ ++ for j in i..10 { ++ // RangeInclusive ++ check_mut(&vec[i..=j], &mut map[i..=j], &mut slice[i..=j]); ++ } ++ } ++ } ++} +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/src/map/tests.rs mesa-25.3.3/subprojects/indexmap-2.7.0/src/map/tests.rs +--- mesa-25.3.3/subprojects/indexmap-2.7.0/src/map/tests.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/src/map/tests.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,830 @@ ++use super::*; ++use std::string::String; ++ ++#[test] ++fn it_works() { ++ let mut map = IndexMap::new(); ++ assert_eq!(map.is_empty(), true); ++ map.insert(1, ()); ++ map.insert(1, ()); ++ assert_eq!(map.len(), 1); ++ assert!(map.get(&1).is_some()); ++ assert_eq!(map.is_empty(), false); ++} ++ ++#[test] ++fn new() { ++ let map = IndexMap::::new(); ++ println!("{:?}", map); ++ assert_eq!(map.capacity(), 0); ++ assert_eq!(map.len(), 0); ++ assert_eq!(map.is_empty(), true); ++} ++ ++#[test] ++fn insert() { ++ let insert = [0, 4, 2, 12, 8, 7, 11, 5]; ++ let not_present = [1, 3, 6, 9, 10]; ++ let mut map = IndexMap::with_capacity(insert.len()); ++ ++ for (i, &elt) in insert.iter().enumerate() { ++ assert_eq!(map.len(), i); ++ map.insert(elt, elt); ++ assert_eq!(map.len(), i + 1); ++ assert_eq!(map.get(&elt), Some(&elt)); ++ assert_eq!(map[&elt], elt); ++ } ++ println!("{:?}", map); ++ ++ for &elt in ¬_present { ++ assert!(map.get(&elt).is_none()); ++ } ++} ++ ++#[test] ++fn insert_full() { ++ let insert = vec![9, 2, 7, 1, 4, 6, 13]; ++ let present = vec![1, 6, 2]; ++ let mut map = IndexMap::with_capacity(insert.len()); ++ ++ for (i, &elt) in insert.iter().enumerate() { ++ assert_eq!(map.len(), i); ++ let (index, existing) = map.insert_full(elt, elt); ++ assert_eq!(existing, None); ++ assert_eq!(Some(index), map.get_full(&elt).map(|x| x.0)); ++ assert_eq!(map.len(), i + 1); ++ } ++ ++ let len = map.len(); ++ for &elt in &present { ++ let (index, existing) = map.insert_full(elt, elt); ++ assert_eq!(existing, Some(elt)); ++ assert_eq!(Some(index), map.get_full(&elt).map(|x| x.0)); ++ assert_eq!(map.len(), len); ++ } ++} ++ ++#[test] ++fn insert_2() { ++ let mut map = IndexMap::with_capacity(16); ++ ++ let mut keys = vec![]; ++ keys.extend(0..16); ++ keys.extend(if cfg!(miri) { 32..64 } else { 128..267 }); ++ ++ for &i in &keys { ++ let old_map = map.clone(); ++ map.insert(i, ()); ++ for key in old_map.keys() { ++ if map.get(key).is_none() { ++ println!("old_map: {:?}", old_map); ++ println!("map: {:?}", map); ++ panic!("did not find {} in map", key); ++ } ++ } ++ } ++ ++ for &i in &keys { ++ assert!(map.get(&i).is_some(), "did not find {}", i); ++ } ++} ++ ++#[test] ++fn insert_order() { ++ let insert = [0, 4, 2, 12, 8, 7, 11, 5, 3, 17, 19, 22, 23]; ++ let mut map = IndexMap::new(); ++ ++ for &elt in &insert { ++ map.insert(elt, ()); ++ } ++ ++ assert_eq!(map.keys().count(), map.len()); ++ assert_eq!(map.keys().count(), insert.len()); ++ for (a, b) in insert.iter().zip(map.keys()) { ++ assert_eq!(a, b); ++ } ++ for (i, k) in (0..insert.len()).zip(map.keys()) { ++ assert_eq!(map.get_index(i).unwrap().0, k); ++ } ++} ++ ++#[test] ++fn shift_insert() { ++ let insert = [0, 4, 2, 12, 8, 7, 11, 5, 3, 17, 19, 22, 23]; ++ let mut map = IndexMap::new(); ++ ++ for &elt in &insert { ++ map.shift_insert(0, elt, ()); ++ } ++ ++ assert_eq!(map.keys().count(), map.len()); ++ assert_eq!(map.keys().count(), insert.len()); ++ for (a, b) in insert.iter().rev().zip(map.keys()) { ++ assert_eq!(a, b); ++ } ++ for (i, k) in (0..insert.len()).zip(map.keys()) { ++ assert_eq!(map.get_index(i).unwrap().0, k); ++ } ++ ++ // "insert" that moves an existing entry ++ map.shift_insert(0, insert[0], ()); ++ assert_eq!(map.keys().count(), insert.len()); ++ assert_eq!(insert[0], map.keys()[0]); ++ for (a, b) in insert[1..].iter().rev().zip(map.keys().skip(1)) { ++ assert_eq!(a, b); ++ } ++} ++ ++#[test] ++fn insert_sorted_bad() { ++ let mut map = IndexMap::new(); ++ map.insert(10, ()); ++ for i in 0..10 { ++ map.insert(i, ()); ++ } ++ ++ // The binary search will want to insert this at the end (index == len()), ++ // but that's only possible for *new* inserts. It should still be handled ++ // without panicking though, and in this case it's simple enough that we ++ // know the exact result. (But don't read this as an API guarantee!) ++ assert_eq!(map.first(), Some((&10, &()))); ++ map.insert_sorted(10, ()); ++ assert_eq!(map.last(), Some((&10, &()))); ++ assert!(map.keys().copied().eq(0..=10)); ++ ++ // Other out-of-order entries can also "insert" to a binary-searched ++ // position, moving in either direction. ++ map.move_index(5, 0); ++ map.move_index(6, 10); ++ assert_eq!(map.first(), Some((&5, &()))); ++ assert_eq!(map.last(), Some((&6, &()))); ++ map.insert_sorted(5, ()); // moves back up ++ map.insert_sorted(6, ()); // moves back down ++ assert!(map.keys().copied().eq(0..=10)); ++} ++ ++#[test] ++fn grow() { ++ let insert = [0, 4, 2, 12, 8, 7, 11]; ++ let not_present = [1, 3, 6, 9, 10]; ++ let mut map = IndexMap::with_capacity(insert.len()); ++ ++ for (i, &elt) in insert.iter().enumerate() { ++ assert_eq!(map.len(), i); ++ map.insert(elt, elt); ++ assert_eq!(map.len(), i + 1); ++ assert_eq!(map.get(&elt), Some(&elt)); ++ assert_eq!(map[&elt], elt); ++ } ++ ++ println!("{:?}", map); ++ for &elt in &insert { ++ map.insert(elt * 10, elt); ++ } ++ for &elt in &insert { ++ map.insert(elt * 100, elt); ++ } ++ for (i, &elt) in insert.iter().cycle().enumerate().take(100) { ++ map.insert(elt * 100 + i as i32, elt); ++ } ++ println!("{:?}", map); ++ for &elt in ¬_present { ++ assert!(map.get(&elt).is_none()); ++ } ++} ++ ++#[test] ++fn reserve() { ++ let mut map = IndexMap::::new(); ++ assert_eq!(map.capacity(), 0); ++ map.reserve(100); ++ let capacity = map.capacity(); ++ assert!(capacity >= 100); ++ for i in 0..capacity { ++ assert_eq!(map.len(), i); ++ map.insert(i, i * i); ++ assert_eq!(map.len(), i + 1); ++ assert_eq!(map.capacity(), capacity); ++ assert_eq!(map.get(&i), Some(&(i * i))); ++ } ++ map.insert(capacity, std::usize::MAX); ++ assert_eq!(map.len(), capacity + 1); ++ assert!(map.capacity() > capacity); ++ assert_eq!(map.get(&capacity), Some(&std::usize::MAX)); ++} ++ ++#[test] ++fn try_reserve() { ++ let mut map = IndexMap::::new(); ++ assert_eq!(map.capacity(), 0); ++ assert_eq!(map.try_reserve(100), Ok(())); ++ assert!(map.capacity() >= 100); ++ assert!(map.try_reserve(usize::MAX).is_err()); ++} ++ ++#[test] ++fn shrink_to_fit() { ++ let mut map = IndexMap::::new(); ++ assert_eq!(map.capacity(), 0); ++ for i in 0..100 { ++ assert_eq!(map.len(), i); ++ map.insert(i, i * i); ++ assert_eq!(map.len(), i + 1); ++ assert!(map.capacity() >= i + 1); ++ assert_eq!(map.get(&i), Some(&(i * i))); ++ map.shrink_to_fit(); ++ assert_eq!(map.len(), i + 1); ++ assert_eq!(map.capacity(), i + 1); ++ assert_eq!(map.get(&i), Some(&(i * i))); ++ } ++} ++ ++#[test] ++fn remove() { ++ let insert = [0, 4, 2, 12, 8, 7, 11, 5, 3, 17, 19, 22, 23]; ++ let mut map = IndexMap::new(); ++ ++ for &elt in &insert { ++ map.insert(elt, elt); ++ } ++ ++ assert_eq!(map.keys().count(), map.len()); ++ assert_eq!(map.keys().count(), insert.len()); ++ for (a, b) in insert.iter().zip(map.keys()) { ++ assert_eq!(a, b); ++ } ++ ++ let remove_fail = [99, 77]; ++ let remove = [4, 12, 8, 7]; ++ ++ for &key in &remove_fail { ++ assert!(map.swap_remove_full(&key).is_none()); ++ } ++ println!("{:?}", map); ++ for &key in &remove { ++ //println!("{:?}", map); ++ let index = map.get_full(&key).unwrap().0; ++ assert_eq!(map.swap_remove_full(&key), Some((index, key, key))); ++ } ++ println!("{:?}", map); ++ ++ for key in &insert { ++ assert_eq!(map.get(key).is_some(), !remove.contains(key)); ++ } ++ assert_eq!(map.len(), insert.len() - remove.len()); ++ assert_eq!(map.keys().count(), insert.len() - remove.len()); ++} ++ ++#[test] ++fn remove_to_empty() { ++ let mut map = indexmap! { 0 => 0, 4 => 4, 5 => 5 }; ++ map.swap_remove(&5).unwrap(); ++ map.swap_remove(&4).unwrap(); ++ map.swap_remove(&0).unwrap(); ++ assert!(map.is_empty()); ++} ++ ++#[test] ++fn swap_remove_index() { ++ let insert = [0, 4, 2, 12, 8, 7, 11, 5, 3, 17, 19, 22, 23]; ++ let mut map = IndexMap::new(); ++ ++ for &elt in &insert { ++ map.insert(elt, elt * 2); ++ } ++ ++ let mut vector = insert.to_vec(); ++ let remove_sequence = &[3, 3, 10, 4, 5, 4, 3, 0, 1]; ++ ++ // check that the same swap remove sequence on vec and map ++ // have the same result. ++ for &rm in remove_sequence { ++ let out_vec = vector.swap_remove(rm); ++ let (out_map, _) = map.swap_remove_index(rm).unwrap(); ++ assert_eq!(out_vec, out_map); ++ } ++ assert_eq!(vector.len(), map.len()); ++ for (a, b) in vector.iter().zip(map.keys()) { ++ assert_eq!(a, b); ++ } ++} ++ ++#[test] ++fn partial_eq_and_eq() { ++ let mut map_a = IndexMap::new(); ++ map_a.insert(1, "1"); ++ map_a.insert(2, "2"); ++ let mut map_b = map_a.clone(); ++ assert_eq!(map_a, map_b); ++ map_b.swap_remove(&1); ++ assert_ne!(map_a, map_b); ++ ++ let map_c: IndexMap<_, String> = map_b.into_iter().map(|(k, v)| (k, v.into())).collect(); ++ assert_ne!(map_a, map_c); ++ assert_ne!(map_c, map_a); ++} ++ ++#[test] ++fn extend() { ++ let mut map = IndexMap::new(); ++ map.extend(vec![(&1, &2), (&3, &4)]); ++ map.extend(vec![(5, 6)]); ++ assert_eq!( ++ map.into_iter().collect::>(), ++ vec![(1, 2), (3, 4), (5, 6)] ++ ); ++} ++ ++#[test] ++fn entry() { ++ let mut map = IndexMap::new(); ++ ++ map.insert(1, "1"); ++ map.insert(2, "2"); ++ { ++ let e = map.entry(3); ++ assert_eq!(e.index(), 2); ++ let e = e.or_insert("3"); ++ assert_eq!(e, &"3"); ++ } ++ ++ let e = map.entry(2); ++ assert_eq!(e.index(), 1); ++ assert_eq!(e.key(), &2); ++ match e { ++ Entry::Occupied(ref e) => assert_eq!(e.get(), &"2"), ++ Entry::Vacant(_) => panic!(), ++ } ++ assert_eq!(e.or_insert("4"), &"2"); ++} ++ ++#[test] ++fn entry_and_modify() { ++ let mut map = IndexMap::new(); ++ ++ map.insert(1, "1"); ++ map.entry(1).and_modify(|x| *x = "2"); ++ assert_eq!(Some(&"2"), map.get(&1)); ++ ++ map.entry(2).and_modify(|x| *x = "doesn't exist"); ++ assert_eq!(None, map.get(&2)); ++} ++ ++#[test] ++fn entry_or_default() { ++ let mut map = IndexMap::new(); ++ ++ #[derive(Debug, PartialEq)] ++ enum TestEnum { ++ DefaultValue, ++ NonDefaultValue, ++ } ++ ++ impl Default for TestEnum { ++ fn default() -> Self { ++ TestEnum::DefaultValue ++ } ++ } ++ ++ map.insert(1, TestEnum::NonDefaultValue); ++ assert_eq!(&mut TestEnum::NonDefaultValue, map.entry(1).or_default()); ++ ++ assert_eq!(&mut TestEnum::DefaultValue, map.entry(2).or_default()); ++} ++ ++#[test] ++fn occupied_entry_key() { ++ // These keys match hash and equality, but their addresses are distinct. ++ let (k1, k2) = (&mut 1, &mut 1); ++ let k1_ptr = k1 as *const i32; ++ let k2_ptr = k2 as *const i32; ++ assert_ne!(k1_ptr, k2_ptr); ++ ++ let mut map = IndexMap::new(); ++ map.insert(k1, "value"); ++ match map.entry(k2) { ++ Entry::Occupied(ref e) => { ++ // `OccupiedEntry::key` should reference the key in the map, ++ // not the key that was used to find the entry. ++ let ptr = *e.key() as *const i32; ++ assert_eq!(ptr, k1_ptr); ++ assert_ne!(ptr, k2_ptr); ++ } ++ Entry::Vacant(_) => panic!(), ++ } ++} ++ ++#[test] ++fn get_index_entry() { ++ let mut map = IndexMap::new(); ++ ++ assert!(map.get_index_entry(0).is_none()); ++ assert!(map.first_entry().is_none()); ++ assert!(map.last_entry().is_none()); ++ ++ map.insert(0, "0"); ++ map.insert(1, "1"); ++ map.insert(2, "2"); ++ map.insert(3, "3"); ++ ++ assert!(map.get_index_entry(4).is_none()); ++ ++ { ++ let e = map.get_index_entry(1).unwrap(); ++ assert_eq!(*e.key(), 1); ++ assert_eq!(*e.get(), "1"); ++ assert_eq!(e.swap_remove(), "1"); ++ } ++ ++ { ++ let mut e = map.get_index_entry(1).unwrap(); ++ assert_eq!(*e.key(), 3); ++ assert_eq!(*e.get(), "3"); ++ assert_eq!(e.insert("4"), "3"); ++ } ++ ++ assert_eq!(*map.get(&3).unwrap(), "4"); ++ ++ { ++ let e = map.first_entry().unwrap(); ++ assert_eq!(*e.key(), 0); ++ assert_eq!(*e.get(), "0"); ++ } ++ ++ { ++ let e = map.last_entry().unwrap(); ++ assert_eq!(*e.key(), 2); ++ assert_eq!(*e.get(), "2"); ++ } ++} ++ ++#[test] ++fn from_entries() { ++ let mut map = IndexMap::from([(1, "1"), (2, "2"), (3, "3")]); ++ ++ { ++ let e = match map.entry(1) { ++ Entry::Occupied(e) => IndexedEntry::from(e), ++ Entry::Vacant(_) => panic!(), ++ }; ++ assert_eq!(e.index(), 0); ++ assert_eq!(*e.key(), 1); ++ assert_eq!(*e.get(), "1"); ++ } ++ ++ { ++ let e = match map.get_index_entry(1) { ++ Some(e) => OccupiedEntry::from(e), ++ None => panic!(), ++ }; ++ assert_eq!(e.index(), 1); ++ assert_eq!(*e.key(), 2); ++ assert_eq!(*e.get(), "2"); ++ } ++} ++ ++#[test] ++fn keys() { ++ let vec = vec![(1, 'a'), (2, 'b'), (3, 'c')]; ++ let map: IndexMap<_, _> = vec.into_iter().collect(); ++ let keys: Vec<_> = map.keys().copied().collect(); ++ assert_eq!(keys.len(), 3); ++ assert!(keys.contains(&1)); ++ assert!(keys.contains(&2)); ++ assert!(keys.contains(&3)); ++} ++ ++#[test] ++fn into_keys() { ++ let vec = vec![(1, 'a'), (2, 'b'), (3, 'c')]; ++ let map: IndexMap<_, _> = vec.into_iter().collect(); ++ let keys: Vec = map.into_keys().collect(); ++ assert_eq!(keys.len(), 3); ++ assert!(keys.contains(&1)); ++ assert!(keys.contains(&2)); ++ assert!(keys.contains(&3)); ++} ++ ++#[test] ++fn values() { ++ let vec = vec![(1, 'a'), (2, 'b'), (3, 'c')]; ++ let map: IndexMap<_, _> = vec.into_iter().collect(); ++ let values: Vec<_> = map.values().copied().collect(); ++ assert_eq!(values.len(), 3); ++ assert!(values.contains(&'a')); ++ assert!(values.contains(&'b')); ++ assert!(values.contains(&'c')); ++} ++ ++#[test] ++fn values_mut() { ++ let vec = vec![(1, 1), (2, 2), (3, 3)]; ++ let mut map: IndexMap<_, _> = vec.into_iter().collect(); ++ for value in map.values_mut() { ++ *value *= 2 ++ } ++ let values: Vec<_> = map.values().copied().collect(); ++ assert_eq!(values.len(), 3); ++ assert!(values.contains(&2)); ++ assert!(values.contains(&4)); ++ assert!(values.contains(&6)); ++} ++ ++#[test] ++fn into_values() { ++ let vec = vec![(1, 'a'), (2, 'b'), (3, 'c')]; ++ let map: IndexMap<_, _> = vec.into_iter().collect(); ++ let values: Vec = map.into_values().collect(); ++ assert_eq!(values.len(), 3); ++ assert!(values.contains(&'a')); ++ assert!(values.contains(&'b')); ++ assert!(values.contains(&'c')); ++} ++ ++#[test] ++fn drain_range() { ++ // Test the various heuristics of `erase_indices` ++ for range in [ ++ 0..0, // nothing erased ++ 10..90, // reinsert the few kept (..10 and 90..) ++ 80..90, // update the few to adjust (80..) ++ 20..30, // sweep everything ++ ] { ++ let mut vec = Vec::from_iter(0..100); ++ let mut map: IndexMap = (0..100).map(|i| (i, ())).collect(); ++ drop(vec.drain(range.clone())); ++ drop(map.drain(range)); ++ assert!(vec.iter().eq(map.keys())); ++ for (i, x) in vec.iter().enumerate() { ++ assert_eq!(map.get_index_of(x), Some(i)); ++ } ++ } ++} ++ ++#[test] ++#[cfg(feature = "std")] ++fn from_array() { ++ let map = IndexMap::from([(1, 2), (3, 4)]); ++ let mut expected = IndexMap::new(); ++ expected.insert(1, 2); ++ expected.insert(3, 4); ++ ++ assert_eq!(map, expected) ++} ++ ++#[test] ++fn iter_default() { ++ struct K; ++ struct V; ++ fn assert_default() ++ where ++ T: Default + Iterator, ++ { ++ assert!(T::default().next().is_none()); ++ } ++ assert_default::>(); ++ assert_default::>(); ++ assert_default::>(); ++ assert_default::>(); ++ assert_default::>(); ++ assert_default::>(); ++ assert_default::>(); ++ assert_default::>(); ++ assert_default::>(); ++} ++ ++#[test] ++fn test_binary_search_by() { ++ // adapted from std's test for binary_search ++ let b: IndexMap<_, i32> = [] ++ .into_iter() ++ .enumerate() ++ .map(|(i, x)| (i + 100, x)) ++ .collect(); ++ assert_eq!(b.binary_search_by(|_, x| x.cmp(&5)), Err(0)); ++ ++ let b: IndexMap<_, i32> = [4] ++ .into_iter() ++ .enumerate() ++ .map(|(i, x)| (i + 100, x)) ++ .collect(); ++ assert_eq!(b.binary_search_by(|_, x| x.cmp(&3)), Err(0)); ++ assert_eq!(b.binary_search_by(|_, x| x.cmp(&4)), Ok(0)); ++ assert_eq!(b.binary_search_by(|_, x| x.cmp(&5)), Err(1)); ++ ++ let b: IndexMap<_, i32> = [1, 2, 4, 6, 8, 9] ++ .into_iter() ++ .enumerate() ++ .map(|(i, x)| (i + 100, x)) ++ .collect(); ++ assert_eq!(b.binary_search_by(|_, x| x.cmp(&5)), Err(3)); ++ assert_eq!(b.binary_search_by(|_, x| x.cmp(&6)), Ok(3)); ++ assert_eq!(b.binary_search_by(|_, x| x.cmp(&7)), Err(4)); ++ assert_eq!(b.binary_search_by(|_, x| x.cmp(&8)), Ok(4)); ++ ++ let b: IndexMap<_, i32> = [1, 2, 4, 5, 6, 8] ++ .into_iter() ++ .enumerate() ++ .map(|(i, x)| (i + 100, x)) ++ .collect(); ++ assert_eq!(b.binary_search_by(|_, x| x.cmp(&9)), Err(6)); ++ ++ let b: IndexMap<_, i32> = [1, 2, 4, 6, 7, 8, 9] ++ .into_iter() ++ .enumerate() ++ .map(|(i, x)| (i + 100, x)) ++ .collect(); ++ assert_eq!(b.binary_search_by(|_, x| x.cmp(&6)), Ok(3)); ++ assert_eq!(b.binary_search_by(|_, x| x.cmp(&5)), Err(3)); ++ assert_eq!(b.binary_search_by(|_, x| x.cmp(&8)), Ok(5)); ++ ++ let b: IndexMap<_, i32> = [1, 2, 4, 5, 6, 8, 9] ++ .into_iter() ++ .enumerate() ++ .map(|(i, x)| (i + 100, x)) ++ .collect(); ++ assert_eq!(b.binary_search_by(|_, x| x.cmp(&7)), Err(5)); ++ assert_eq!(b.binary_search_by(|_, x| x.cmp(&0)), Err(0)); ++ ++ let b: IndexMap<_, i32> = [1, 3, 3, 3, 7] ++ .into_iter() ++ .enumerate() ++ .map(|(i, x)| (i + 100, x)) ++ .collect(); ++ assert_eq!(b.binary_search_by(|_, x| x.cmp(&0)), Err(0)); ++ assert_eq!(b.binary_search_by(|_, x| x.cmp(&1)), Ok(0)); ++ assert_eq!(b.binary_search_by(|_, x| x.cmp(&2)), Err(1)); ++ assert!(match b.binary_search_by(|_, x| x.cmp(&3)) { ++ Ok(1..=3) => true, ++ _ => false, ++ }); ++ assert!(match b.binary_search_by(|_, x| x.cmp(&3)) { ++ Ok(1..=3) => true, ++ _ => false, ++ }); ++ assert_eq!(b.binary_search_by(|_, x| x.cmp(&4)), Err(4)); ++ assert_eq!(b.binary_search_by(|_, x| x.cmp(&5)), Err(4)); ++ assert_eq!(b.binary_search_by(|_, x| x.cmp(&6)), Err(4)); ++ assert_eq!(b.binary_search_by(|_, x| x.cmp(&7)), Ok(4)); ++ assert_eq!(b.binary_search_by(|_, x| x.cmp(&8)), Err(5)); ++} ++ ++#[test] ++fn test_binary_search_by_key() { ++ // adapted from std's test for binary_search ++ let b: IndexMap<_, i32> = [] ++ .into_iter() ++ .enumerate() ++ .map(|(i, x)| (i + 100, x)) ++ .collect(); ++ assert_eq!(b.binary_search_by_key(&5, |_, &x| x), Err(0)); ++ ++ let b: IndexMap<_, i32> = [4] ++ .into_iter() ++ .enumerate() ++ .map(|(i, x)| (i + 100, x)) ++ .collect(); ++ assert_eq!(b.binary_search_by_key(&3, |_, &x| x), Err(0)); ++ assert_eq!(b.binary_search_by_key(&4, |_, &x| x), Ok(0)); ++ assert_eq!(b.binary_search_by_key(&5, |_, &x| x), Err(1)); ++ ++ let b: IndexMap<_, i32> = [1, 2, 4, 6, 8, 9] ++ .into_iter() ++ .enumerate() ++ .map(|(i, x)| (i + 100, x)) ++ .collect(); ++ assert_eq!(b.binary_search_by_key(&5, |_, &x| x), Err(3)); ++ assert_eq!(b.binary_search_by_key(&6, |_, &x| x), Ok(3)); ++ assert_eq!(b.binary_search_by_key(&7, |_, &x| x), Err(4)); ++ assert_eq!(b.binary_search_by_key(&8, |_, &x| x), Ok(4)); ++ ++ let b: IndexMap<_, i32> = [1, 2, 4, 5, 6, 8] ++ .into_iter() ++ .enumerate() ++ .map(|(i, x)| (i + 100, x)) ++ .collect(); ++ assert_eq!(b.binary_search_by_key(&9, |_, &x| x), Err(6)); ++ ++ let b: IndexMap<_, i32> = [1, 2, 4, 6, 7, 8, 9] ++ .into_iter() ++ .enumerate() ++ .map(|(i, x)| (i + 100, x)) ++ .collect(); ++ assert_eq!(b.binary_search_by_key(&6, |_, &x| x), Ok(3)); ++ assert_eq!(b.binary_search_by_key(&5, |_, &x| x), Err(3)); ++ assert_eq!(b.binary_search_by_key(&8, |_, &x| x), Ok(5)); ++ ++ let b: IndexMap<_, i32> = [1, 2, 4, 5, 6, 8, 9] ++ .into_iter() ++ .enumerate() ++ .map(|(i, x)| (i + 100, x)) ++ .collect(); ++ assert_eq!(b.binary_search_by_key(&7, |_, &x| x), Err(5)); ++ assert_eq!(b.binary_search_by_key(&0, |_, &x| x), Err(0)); ++ ++ let b: IndexMap<_, i32> = [1, 3, 3, 3, 7] ++ .into_iter() ++ .enumerate() ++ .map(|(i, x)| (i + 100, x)) ++ .collect(); ++ assert_eq!(b.binary_search_by_key(&0, |_, &x| x), Err(0)); ++ assert_eq!(b.binary_search_by_key(&1, |_, &x| x), Ok(0)); ++ assert_eq!(b.binary_search_by_key(&2, |_, &x| x), Err(1)); ++ assert!(match b.binary_search_by_key(&3, |_, &x| x) { ++ Ok(1..=3) => true, ++ _ => false, ++ }); ++ assert!(match b.binary_search_by_key(&3, |_, &x| x) { ++ Ok(1..=3) => true, ++ _ => false, ++ }); ++ assert_eq!(b.binary_search_by_key(&4, |_, &x| x), Err(4)); ++ assert_eq!(b.binary_search_by_key(&5, |_, &x| x), Err(4)); ++ assert_eq!(b.binary_search_by_key(&6, |_, &x| x), Err(4)); ++ assert_eq!(b.binary_search_by_key(&7, |_, &x| x), Ok(4)); ++ assert_eq!(b.binary_search_by_key(&8, |_, &x| x), Err(5)); ++} ++ ++#[test] ++fn test_partition_point() { ++ // adapted from std's test for partition_point ++ let b: IndexMap<_, i32> = [] ++ .into_iter() ++ .enumerate() ++ .map(|(i, x)| (i + 100, x)) ++ .collect(); ++ assert_eq!(b.partition_point(|_, &x| x < 5), 0); ++ ++ let b: IndexMap<_, i32> = [4] ++ .into_iter() ++ .enumerate() ++ .map(|(i, x)| (i + 100, x)) ++ .collect(); ++ assert_eq!(b.partition_point(|_, &x| x < 3), 0); ++ assert_eq!(b.partition_point(|_, &x| x < 4), 0); ++ assert_eq!(b.partition_point(|_, &x| x < 5), 1); ++ ++ let b: IndexMap<_, i32> = [1, 2, 4, 6, 8, 9] ++ .into_iter() ++ .enumerate() ++ .map(|(i, x)| (i + 100, x)) ++ .collect(); ++ assert_eq!(b.partition_point(|_, &x| x < 5), 3); ++ assert_eq!(b.partition_point(|_, &x| x < 6), 3); ++ assert_eq!(b.partition_point(|_, &x| x < 7), 4); ++ assert_eq!(b.partition_point(|_, &x| x < 8), 4); ++ ++ let b: IndexMap<_, i32> = [1, 2, 4, 5, 6, 8] ++ .into_iter() ++ .enumerate() ++ .map(|(i, x)| (i + 100, x)) ++ .collect(); ++ assert_eq!(b.partition_point(|_, &x| x < 9), 6); ++ ++ let b: IndexMap<_, i32> = [1, 2, 4, 6, 7, 8, 9] ++ .into_iter() ++ .enumerate() ++ .map(|(i, x)| (i + 100, x)) ++ .collect(); ++ assert_eq!(b.partition_point(|_, &x| x < 6), 3); ++ assert_eq!(b.partition_point(|_, &x| x < 5), 3); ++ assert_eq!(b.partition_point(|_, &x| x < 8), 5); ++ ++ let b: IndexMap<_, i32> = [1, 2, 4, 5, 6, 8, 9] ++ .into_iter() ++ .enumerate() ++ .map(|(i, x)| (i + 100, x)) ++ .collect(); ++ assert_eq!(b.partition_point(|_, &x| x < 7), 5); ++ assert_eq!(b.partition_point(|_, &x| x < 0), 0); ++ ++ let b: IndexMap<_, i32> = [1, 3, 3, 3, 7] ++ .into_iter() ++ .enumerate() ++ .map(|(i, x)| (i + 100, x)) ++ .collect(); ++ assert_eq!(b.partition_point(|_, &x| x < 0), 0); ++ assert_eq!(b.partition_point(|_, &x| x < 1), 0); ++ assert_eq!(b.partition_point(|_, &x| x < 2), 1); ++ assert_eq!(b.partition_point(|_, &x| x < 3), 1); ++ assert_eq!(b.partition_point(|_, &x| x < 4), 4); ++ assert_eq!(b.partition_point(|_, &x| x < 5), 4); ++ assert_eq!(b.partition_point(|_, &x| x < 6), 4); ++ assert_eq!(b.partition_point(|_, &x| x < 7), 4); ++ assert_eq!(b.partition_point(|_, &x| x < 8), 5); ++} ++ ++macro_rules! move_index_oob { ++ ($test:ident, $from:expr, $to:expr) => { ++ #[test] ++ #[should_panic(expected = "index out of bounds")] ++ fn $test() { ++ let mut map: IndexMap = (0..10).map(|k| (k, ())).collect(); ++ map.move_index($from, $to); ++ } ++ }; ++} ++move_index_oob!(test_move_index_out_of_bounds_0_10, 0, 10); ++move_index_oob!(test_move_index_out_of_bounds_0_max, 0, usize::MAX); ++move_index_oob!(test_move_index_out_of_bounds_10_0, 10, 0); ++move_index_oob!(test_move_index_out_of_bounds_max_0, usize::MAX, 0); +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/src/map.rs mesa-25.3.3/subprojects/indexmap-2.7.0/src/map.rs +--- mesa-25.3.3/subprojects/indexmap-2.7.0/src/map.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/src/map.rs 2025-01-11 13:48:35.000000000 -0500 +@@ -0,0 +1,1578 @@ ++//! [`IndexMap`] is a hash table where the iteration order of the key-value ++//! pairs is independent of the hash values of the keys. ++ ++mod core; ++mod iter; ++mod mutable; ++mod slice; ++ ++#[cfg(feature = "serde")] ++#[cfg_attr(docsrs, doc(cfg(feature = "serde")))] ++pub mod serde_seq; ++ ++#[cfg(all(test, feature = "std"))] ++mod tests; ++ ++pub use self::core::raw_entry_v1::{self, RawEntryApiV1}; ++pub use self::core::{Entry, IndexedEntry, OccupiedEntry, VacantEntry}; ++pub use self::iter::{ ++ Drain, IntoIter, IntoKeys, IntoValues, Iter, IterMut, IterMut2, Keys, Splice, Values, ValuesMut, ++}; ++pub use self::mutable::MutableEntryKey; ++pub use self::mutable::MutableKeys; ++pub use self::slice::Slice; ++ ++#[cfg(feature = "rayon")] ++pub use crate::rayon::map as rayon; ++ ++use ::core::cmp::Ordering; ++use ::core::fmt; ++use ::core::hash::{BuildHasher, Hash, Hasher}; ++use ::core::mem; ++use ::core::ops::{Index, IndexMut, RangeBounds}; ++use alloc::boxed::Box; ++use alloc::vec::Vec; ++ ++#[cfg(feature = "std")] ++use std::collections::hash_map::RandomState; ++ ++use self::core::IndexMapCore; ++use crate::util::{third, try_simplify_range}; ++use crate::{Bucket, Entries, Equivalent, HashValue, TryReserveError}; ++ ++/// A hash table where the iteration order of the key-value pairs is independent ++/// of the hash values of the keys. ++/// ++/// The interface is closely compatible with the standard ++/// [`HashMap`][std::collections::HashMap], ++/// but also has additional features. ++/// ++/// # Order ++/// ++/// The key-value pairs have a consistent order that is determined by ++/// the sequence of insertion and removal calls on the map. The order does ++/// not depend on the keys or the hash function at all. ++/// ++/// All iterators traverse the map in *the order*. ++/// ++/// The insertion order is preserved, with **notable exceptions** like the ++/// [`.remove()`][Self::remove] or [`.swap_remove()`][Self::swap_remove] methods. ++/// Methods such as [`.sort_by()`][Self::sort_by] of ++/// course result in a new order, depending on the sorting order. ++/// ++/// # Indices ++/// ++/// The key-value pairs are indexed in a compact range without holes in the ++/// range `0..self.len()`. For example, the method `.get_full` looks up the ++/// index for a key, and the method `.get_index` looks up the key-value pair by ++/// index. ++/// ++/// # Examples ++/// ++/// ``` ++/// use indexmap::IndexMap; ++/// ++/// // count the frequency of each letter in a sentence. ++/// let mut letters = IndexMap::new(); ++/// for ch in "a short treatise on fungi".chars() { ++/// *letters.entry(ch).or_insert(0) += 1; ++/// } ++/// ++/// assert_eq!(letters[&'s'], 2); ++/// assert_eq!(letters[&'t'], 3); ++/// assert_eq!(letters[&'u'], 1); ++/// assert_eq!(letters.get(&'y'), None); ++/// ``` ++#[cfg(feature = "std")] ++pub struct IndexMap { ++ pub(crate) core: IndexMapCore, ++ hash_builder: S, ++} ++#[cfg(not(feature = "std"))] ++pub struct IndexMap { ++ pub(crate) core: IndexMapCore, ++ hash_builder: S, ++} ++ ++impl Clone for IndexMap ++where ++ K: Clone, ++ V: Clone, ++ S: Clone, ++{ ++ fn clone(&self) -> Self { ++ IndexMap { ++ core: self.core.clone(), ++ hash_builder: self.hash_builder.clone(), ++ } ++ } ++ ++ fn clone_from(&mut self, other: &Self) { ++ self.core.clone_from(&other.core); ++ self.hash_builder.clone_from(&other.hash_builder); ++ } ++} ++ ++impl Entries for IndexMap { ++ type Entry = Bucket; ++ ++ #[inline] ++ fn into_entries(self) -> Vec { ++ self.core.into_entries() ++ } ++ ++ #[inline] ++ fn as_entries(&self) -> &[Self::Entry] { ++ self.core.as_entries() ++ } ++ ++ #[inline] ++ fn as_entries_mut(&mut self) -> &mut [Self::Entry] { ++ self.core.as_entries_mut() ++ } ++ ++ fn with_entries(&mut self, f: F) ++ where ++ F: FnOnce(&mut [Self::Entry]), ++ { ++ self.core.with_entries(f); ++ } ++} ++ ++impl fmt::Debug for IndexMap ++where ++ K: fmt::Debug, ++ V: fmt::Debug, ++{ ++ #[cfg(not(feature = "test_debug"))] ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_map().entries(self.iter()).finish() ++ } ++ ++ #[cfg(feature = "test_debug")] ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ // Let the inner `IndexMapCore` print all of its details ++ f.debug_struct("IndexMap") ++ .field("core", &self.core) ++ .finish() ++ } ++} ++ ++#[cfg(feature = "std")] ++#[cfg_attr(docsrs, doc(cfg(feature = "std")))] ++impl IndexMap { ++ /// Create a new map. (Does not allocate.) ++ #[inline] ++ pub fn new() -> Self { ++ Self::with_capacity(0) ++ } ++ ++ /// Create a new map with capacity for `n` key-value pairs. (Does not ++ /// allocate if `n` is zero.) ++ /// ++ /// Computes in **O(n)** time. ++ #[inline] ++ pub fn with_capacity(n: usize) -> Self { ++ Self::with_capacity_and_hasher(n, <_>::default()) ++ } ++} ++ ++impl IndexMap { ++ /// Create a new map with capacity for `n` key-value pairs. (Does not ++ /// allocate if `n` is zero.) ++ /// ++ /// Computes in **O(n)** time. ++ #[inline] ++ pub fn with_capacity_and_hasher(n: usize, hash_builder: S) -> Self { ++ if n == 0 { ++ Self::with_hasher(hash_builder) ++ } else { ++ IndexMap { ++ core: IndexMapCore::with_capacity(n), ++ hash_builder, ++ } ++ } ++ } ++ ++ /// Create a new map with `hash_builder`. ++ /// ++ /// This function is `const`, so it ++ /// can be called in `static` contexts. ++ pub const fn with_hasher(hash_builder: S) -> Self { ++ IndexMap { ++ core: IndexMapCore::new(), ++ hash_builder, ++ } ++ } ++ ++ /// Return the number of elements the map can hold without reallocating. ++ /// ++ /// This number is a lower bound; the map might be able to hold more, ++ /// but is guaranteed to be able to hold at least this many. ++ /// ++ /// Computes in **O(1)** time. ++ pub fn capacity(&self) -> usize { ++ self.core.capacity() ++ } ++ ++ /// Return a reference to the map's `BuildHasher`. ++ pub fn hasher(&self) -> &S { ++ &self.hash_builder ++ } ++ ++ /// Return the number of key-value pairs in the map. ++ /// ++ /// Computes in **O(1)** time. ++ #[inline] ++ pub fn len(&self) -> usize { ++ self.core.len() ++ } ++ ++ /// Returns true if the map contains no elements. ++ /// ++ /// Computes in **O(1)** time. ++ #[inline] ++ pub fn is_empty(&self) -> bool { ++ self.len() == 0 ++ } ++ ++ /// Return an iterator over the key-value pairs of the map, in their order ++ pub fn iter(&self) -> Iter<'_, K, V> { ++ Iter::new(self.as_entries()) ++ } ++ ++ /// Return an iterator over the key-value pairs of the map, in their order ++ pub fn iter_mut(&mut self) -> IterMut<'_, K, V> { ++ IterMut::new(self.as_entries_mut()) ++ } ++ ++ /// Return an iterator over the keys of the map, in their order ++ pub fn keys(&self) -> Keys<'_, K, V> { ++ Keys::new(self.as_entries()) ++ } ++ ++ /// Return an owning iterator over the keys of the map, in their order ++ pub fn into_keys(self) -> IntoKeys { ++ IntoKeys::new(self.into_entries()) ++ } ++ ++ /// Return an iterator over the values of the map, in their order ++ pub fn values(&self) -> Values<'_, K, V> { ++ Values::new(self.as_entries()) ++ } ++ ++ /// Return an iterator over mutable references to the values of the map, ++ /// in their order ++ pub fn values_mut(&mut self) -> ValuesMut<'_, K, V> { ++ ValuesMut::new(self.as_entries_mut()) ++ } ++ ++ /// Return an owning iterator over the values of the map, in their order ++ pub fn into_values(self) -> IntoValues { ++ IntoValues::new(self.into_entries()) ++ } ++ ++ /// Remove all key-value pairs in the map, while preserving its capacity. ++ /// ++ /// Computes in **O(n)** time. ++ pub fn clear(&mut self) { ++ self.core.clear(); ++ } ++ ++ /// Shortens the map, keeping the first `len` elements and dropping the rest. ++ /// ++ /// If `len` is greater than the map's current length, this has no effect. ++ pub fn truncate(&mut self, len: usize) { ++ self.core.truncate(len); ++ } ++ ++ /// Clears the `IndexMap` in the given index range, returning those ++ /// key-value pairs as a drain iterator. ++ /// ++ /// The range may be any type that implements [`RangeBounds`], ++ /// including all of the `std::ops::Range*` types, or even a tuple pair of ++ /// `Bound` start and end values. To drain the map entirely, use `RangeFull` ++ /// like `map.drain(..)`. ++ /// ++ /// This shifts down all entries following the drained range to fill the ++ /// gap, and keeps the allocated memory for reuse. ++ /// ++ /// ***Panics*** if the starting point is greater than the end point or if ++ /// the end point is greater than the length of the map. ++ pub fn drain(&mut self, range: R) -> Drain<'_, K, V> ++ where ++ R: RangeBounds, ++ { ++ Drain::new(self.core.drain(range)) ++ } ++ ++ /// Splits the collection into two at the given index. ++ /// ++ /// Returns a newly allocated map containing the elements in the range ++ /// `[at, len)`. After the call, the original map will be left containing ++ /// the elements `[0, at)` with its previous capacity unchanged. ++ /// ++ /// ***Panics*** if `at > len`. ++ pub fn split_off(&mut self, at: usize) -> Self ++ where ++ S: Clone, ++ { ++ Self { ++ core: self.core.split_off(at), ++ hash_builder: self.hash_builder.clone(), ++ } ++ } ++ ++ /// Reserve capacity for `additional` more key-value pairs. ++ /// ++ /// Computes in **O(n)** time. ++ pub fn reserve(&mut self, additional: usize) { ++ self.core.reserve(additional); ++ } ++ ++ /// Reserve capacity for `additional` more key-value pairs, without over-allocating. ++ /// ++ /// Unlike `reserve`, this does not deliberately over-allocate the entry capacity to avoid ++ /// frequent re-allocations. However, the underlying data structures may still have internal ++ /// capacity requirements, and the allocator itself may give more space than requested, so this ++ /// cannot be relied upon to be precisely minimal. ++ /// ++ /// Computes in **O(n)** time. ++ pub fn reserve_exact(&mut self, additional: usize) { ++ self.core.reserve_exact(additional); ++ } ++ ++ /// Try to reserve capacity for `additional` more key-value pairs. ++ /// ++ /// Computes in **O(n)** time. ++ pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> { ++ self.core.try_reserve(additional) ++ } ++ ++ /// Try to reserve capacity for `additional` more key-value pairs, without over-allocating. ++ /// ++ /// Unlike `try_reserve`, this does not deliberately over-allocate the entry capacity to avoid ++ /// frequent re-allocations. However, the underlying data structures may still have internal ++ /// capacity requirements, and the allocator itself may give more space than requested, so this ++ /// cannot be relied upon to be precisely minimal. ++ /// ++ /// Computes in **O(n)** time. ++ pub fn try_reserve_exact(&mut self, additional: usize) -> Result<(), TryReserveError> { ++ self.core.try_reserve_exact(additional) ++ } ++ ++ /// Shrink the capacity of the map as much as possible. ++ /// ++ /// Computes in **O(n)** time. ++ pub fn shrink_to_fit(&mut self) { ++ self.core.shrink_to(0); ++ } ++ ++ /// Shrink the capacity of the map with a lower limit. ++ /// ++ /// Computes in **O(n)** time. ++ pub fn shrink_to(&mut self, min_capacity: usize) { ++ self.core.shrink_to(min_capacity); ++ } ++} ++ ++impl IndexMap ++where ++ K: Hash + Eq, ++ S: BuildHasher, ++{ ++ /// Insert a key-value pair in the map. ++ /// ++ /// If an equivalent key already exists in the map: the key remains and ++ /// retains in its place in the order, its corresponding value is updated ++ /// with `value`, and the older value is returned inside `Some(_)`. ++ /// ++ /// If no equivalent key existed in the map: the new key-value pair is ++ /// inserted, last in order, and `None` is returned. ++ /// ++ /// Computes in **O(1)** time (amortized average). ++ /// ++ /// See also [`entry`][Self::entry] if you want to insert *or* modify, ++ /// or [`insert_full`][Self::insert_full] if you need to get the index of ++ /// the corresponding key-value pair. ++ pub fn insert(&mut self, key: K, value: V) -> Option { ++ self.insert_full(key, value).1 ++ } ++ ++ /// Insert a key-value pair in the map, and get their index. ++ /// ++ /// If an equivalent key already exists in the map: the key remains and ++ /// retains in its place in the order, its corresponding value is updated ++ /// with `value`, and the older value is returned inside `(index, Some(_))`. ++ /// ++ /// If no equivalent key existed in the map: the new key-value pair is ++ /// inserted, last in order, and `(index, None)` is returned. ++ /// ++ /// Computes in **O(1)** time (amortized average). ++ /// ++ /// See also [`entry`][Self::entry] if you want to insert *or* modify. ++ pub fn insert_full(&mut self, key: K, value: V) -> (usize, Option) { ++ let hash = self.hash(&key); ++ self.core.insert_full(hash, key, value) ++ } ++ ++ /// Insert a key-value pair in the map at its ordered position among sorted keys. ++ /// ++ /// This is equivalent to finding the position with ++ /// [`binary_search_keys`][Self::binary_search_keys], then either updating ++ /// it or calling [`insert_before`][Self::insert_before] for a new key. ++ /// ++ /// If the sorted key is found in the map, its corresponding value is ++ /// updated with `value`, and the older value is returned inside ++ /// `(index, Some(_))`. Otherwise, the new key-value pair is inserted at ++ /// the sorted position, and `(index, None)` is returned. ++ /// ++ /// If the existing keys are **not** already sorted, then the insertion ++ /// index is unspecified (like [`slice::binary_search`]), but the key-value ++ /// pair is moved to or inserted at that position regardless. ++ /// ++ /// Computes in **O(n)** time (average). Instead of repeating calls to ++ /// `insert_sorted`, it may be faster to call batched [`insert`][Self::insert] ++ /// or [`extend`][Self::extend] and only call [`sort_keys`][Self::sort_keys] ++ /// or [`sort_unstable_keys`][Self::sort_unstable_keys] once. ++ pub fn insert_sorted(&mut self, key: K, value: V) -> (usize, Option) ++ where ++ K: Ord, ++ { ++ match self.binary_search_keys(&key) { ++ Ok(i) => (i, Some(mem::replace(&mut self[i], value))), ++ Err(i) => self.insert_before(i, key, value), ++ } ++ } ++ ++ /// Insert a key-value pair in the map before the entry at the given index, or at the end. ++ /// ++ /// If an equivalent key already exists in the map: the key remains and ++ /// is moved to the new position in the map, its corresponding value is updated ++ /// with `value`, and the older value is returned inside `Some(_)`. The returned index ++ /// will either be the given index or one less, depending on how the entry moved. ++ /// (See [`shift_insert`](Self::shift_insert) for different behavior here.) ++ /// ++ /// If no equivalent key existed in the map: the new key-value pair is ++ /// inserted exactly at the given index, and `None` is returned. ++ /// ++ /// ***Panics*** if `index` is out of bounds. ++ /// Valid indices are `0..=map.len()` (inclusive). ++ /// ++ /// Computes in **O(n)** time (average). ++ /// ++ /// See also [`entry`][Self::entry] if you want to insert *or* modify, ++ /// perhaps only using the index for new entries with [`VacantEntry::shift_insert`]. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use indexmap::IndexMap; ++ /// let mut map: IndexMap = ('a'..='z').map(|c| (c, ())).collect(); ++ /// ++ /// // The new key '*' goes exactly at the given index. ++ /// assert_eq!(map.get_index_of(&'*'), None); ++ /// assert_eq!(map.insert_before(10, '*', ()), (10, None)); ++ /// assert_eq!(map.get_index_of(&'*'), Some(10)); ++ /// ++ /// // Moving the key 'a' up will shift others down, so this moves *before* 10 to index 9. ++ /// assert_eq!(map.insert_before(10, 'a', ()), (9, Some(()))); ++ /// assert_eq!(map.get_index_of(&'a'), Some(9)); ++ /// assert_eq!(map.get_index_of(&'*'), Some(10)); ++ /// ++ /// // Moving the key 'z' down will shift others up, so this moves to exactly 10. ++ /// assert_eq!(map.insert_before(10, 'z', ()), (10, Some(()))); ++ /// assert_eq!(map.get_index_of(&'z'), Some(10)); ++ /// assert_eq!(map.get_index_of(&'*'), Some(11)); ++ /// ++ /// // Moving or inserting before the endpoint is also valid. ++ /// assert_eq!(map.len(), 27); ++ /// assert_eq!(map.insert_before(map.len(), '*', ()), (26, Some(()))); ++ /// assert_eq!(map.get_index_of(&'*'), Some(26)); ++ /// assert_eq!(map.insert_before(map.len(), '+', ()), (27, None)); ++ /// assert_eq!(map.get_index_of(&'+'), Some(27)); ++ /// assert_eq!(map.len(), 28); ++ /// ``` ++ pub fn insert_before(&mut self, mut index: usize, key: K, value: V) -> (usize, Option) { ++ assert!(index <= self.len(), "index out of bounds"); ++ match self.entry(key) { ++ Entry::Occupied(mut entry) => { ++ if index > entry.index() { ++ // Some entries will shift down when this one moves up, ++ // so "insert before index" becomes "move to index - 1", ++ // keeping the entry at the original index unmoved. ++ index -= 1; ++ } ++ let old = mem::replace(entry.get_mut(), value); ++ entry.move_index(index); ++ (index, Some(old)) ++ } ++ Entry::Vacant(entry) => { ++ entry.shift_insert(index, value); ++ (index, None) ++ } ++ } ++ } ++ ++ /// Insert a key-value pair in the map at the given index. ++ /// ++ /// If an equivalent key already exists in the map: the key remains and ++ /// is moved to the given index in the map, its corresponding value is updated ++ /// with `value`, and the older value is returned inside `Some(_)`. ++ /// Note that existing entries **cannot** be moved to `index == map.len()`! ++ /// (See [`insert_before`](Self::insert_before) for different behavior here.) ++ /// ++ /// If no equivalent key existed in the map: the new key-value pair is ++ /// inserted at the given index, and `None` is returned. ++ /// ++ /// ***Panics*** if `index` is out of bounds. ++ /// Valid indices are `0..map.len()` (exclusive) when moving an existing entry, or ++ /// `0..=map.len()` (inclusive) when inserting a new key. ++ /// ++ /// Computes in **O(n)** time (average). ++ /// ++ /// See also [`entry`][Self::entry] if you want to insert *or* modify, ++ /// perhaps only using the index for new entries with [`VacantEntry::shift_insert`]. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use indexmap::IndexMap; ++ /// let mut map: IndexMap = ('a'..='z').map(|c| (c, ())).collect(); ++ /// ++ /// // The new key '*' goes exactly at the given index. ++ /// assert_eq!(map.get_index_of(&'*'), None); ++ /// assert_eq!(map.shift_insert(10, '*', ()), None); ++ /// assert_eq!(map.get_index_of(&'*'), Some(10)); ++ /// ++ /// // Moving the key 'a' up to 10 will shift others down, including the '*' that was at 10. ++ /// assert_eq!(map.shift_insert(10, 'a', ()), Some(())); ++ /// assert_eq!(map.get_index_of(&'a'), Some(10)); ++ /// assert_eq!(map.get_index_of(&'*'), Some(9)); ++ /// ++ /// // Moving the key 'z' down to 9 will shift others up, including the '*' that was at 9. ++ /// assert_eq!(map.shift_insert(9, 'z', ()), Some(())); ++ /// assert_eq!(map.get_index_of(&'z'), Some(9)); ++ /// assert_eq!(map.get_index_of(&'*'), Some(10)); ++ /// ++ /// // Existing keys can move to len-1 at most, but new keys can insert at the endpoint. ++ /// assert_eq!(map.len(), 27); ++ /// assert_eq!(map.shift_insert(map.len() - 1, '*', ()), Some(())); ++ /// assert_eq!(map.get_index_of(&'*'), Some(26)); ++ /// assert_eq!(map.shift_insert(map.len(), '+', ()), None); ++ /// assert_eq!(map.get_index_of(&'+'), Some(27)); ++ /// assert_eq!(map.len(), 28); ++ /// ``` ++ /// ++ /// ```should_panic ++ /// use indexmap::IndexMap; ++ /// let mut map: IndexMap = ('a'..='z').map(|c| (c, ())).collect(); ++ /// ++ /// // This is an invalid index for moving an existing key! ++ /// map.shift_insert(map.len(), 'a', ()); ++ /// ``` ++ pub fn shift_insert(&mut self, index: usize, key: K, value: V) -> Option { ++ let len = self.len(); ++ match self.entry(key) { ++ Entry::Occupied(mut entry) => { ++ assert!(index < len, "index out of bounds"); ++ let old = mem::replace(entry.get_mut(), value); ++ entry.move_index(index); ++ Some(old) ++ } ++ Entry::Vacant(entry) => { ++ assert!(index <= len, "index out of bounds"); ++ entry.shift_insert(index, value); ++ None ++ } ++ } ++ } ++ ++ /// Get the given key’s corresponding entry in the map for insertion and/or ++ /// in-place manipulation. ++ /// ++ /// Computes in **O(1)** time (amortized average). ++ pub fn entry(&mut self, key: K) -> Entry<'_, K, V> { ++ let hash = self.hash(&key); ++ self.core.entry(hash, key) ++ } ++ ++ /// Creates a splicing iterator that replaces the specified range in the map ++ /// with the given `replace_with` key-value iterator and yields the removed ++ /// items. `replace_with` does not need to be the same length as `range`. ++ /// ++ /// The `range` is removed even if the iterator is not consumed until the ++ /// end. It is unspecified how many elements are removed from the map if the ++ /// `Splice` value is leaked. ++ /// ++ /// The input iterator `replace_with` is only consumed when the `Splice` ++ /// value is dropped. If a key from the iterator matches an existing entry ++ /// in the map (outside of `range`), then the value will be updated in that ++ /// position. Otherwise, the new key-value pair will be inserted in the ++ /// replaced `range`. ++ /// ++ /// ***Panics*** if the starting point is greater than the end point or if ++ /// the end point is greater than the length of the map. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use indexmap::IndexMap; ++ /// ++ /// let mut map = IndexMap::from([(0, '_'), (1, 'a'), (2, 'b'), (3, 'c'), (4, 'd')]); ++ /// let new = [(5, 'E'), (4, 'D'), (3, 'C'), (2, 'B'), (1, 'A')]; ++ /// let removed: Vec<_> = map.splice(2..4, new).collect(); ++ /// ++ /// // 1 and 4 got new values, while 5, 3, and 2 were newly inserted. ++ /// assert!(map.into_iter().eq([(0, '_'), (1, 'A'), (5, 'E'), (3, 'C'), (2, 'B'), (4, 'D')])); ++ /// assert_eq!(removed, &[(2, 'b'), (3, 'c')]); ++ /// ``` ++ pub fn splice(&mut self, range: R, replace_with: I) -> Splice<'_, I::IntoIter, K, V, S> ++ where ++ R: RangeBounds, ++ I: IntoIterator, ++ { ++ Splice::new(self, range, replace_with.into_iter()) ++ } ++ ++ /// Moves all key-value pairs from `other` into `self`, leaving `other` empty. ++ /// ++ /// This is equivalent to calling [`insert`][Self::insert] for each ++ /// key-value pair from `other` in order, which means that for keys that ++ /// already exist in `self`, their value is updated in the current position. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use indexmap::IndexMap; ++ /// ++ /// // Note: Key (3) is present in both maps. ++ /// let mut a = IndexMap::from([(3, "c"), (2, "b"), (1, "a")]); ++ /// let mut b = IndexMap::from([(3, "d"), (4, "e"), (5, "f")]); ++ /// let old_capacity = b.capacity(); ++ /// ++ /// a.append(&mut b); ++ /// ++ /// assert_eq!(a.len(), 5); ++ /// assert_eq!(b.len(), 0); ++ /// assert_eq!(b.capacity(), old_capacity); ++ /// ++ /// assert!(a.keys().eq(&[3, 2, 1, 4, 5])); ++ /// assert_eq!(a[&3], "d"); // "c" was overwritten. ++ /// ``` ++ pub fn append(&mut self, other: &mut IndexMap) { ++ self.extend(other.drain(..)); ++ } ++} ++ ++impl IndexMap ++where ++ S: BuildHasher, ++{ ++ pub(crate) fn hash(&self, key: &Q) -> HashValue { ++ let mut h = self.hash_builder.build_hasher(); ++ key.hash(&mut h); ++ HashValue(h.finish() as usize) ++ } ++ ++ /// Return `true` if an equivalent to `key` exists in the map. ++ /// ++ /// Computes in **O(1)** time (average). ++ pub fn contains_key(&self, key: &Q) -> bool ++ where ++ Q: ?Sized + Hash + Equivalent, ++ { ++ self.get_index_of(key).is_some() ++ } ++ ++ /// Return a reference to the value stored for `key`, if it is present, ++ /// else `None`. ++ /// ++ /// Computes in **O(1)** time (average). ++ pub fn get(&self, key: &Q) -> Option<&V> ++ where ++ Q: ?Sized + Hash + Equivalent, ++ { ++ if let Some(i) = self.get_index_of(key) { ++ let entry = &self.as_entries()[i]; ++ Some(&entry.value) ++ } else { ++ None ++ } ++ } ++ ++ /// Return references to the key-value pair stored for `key`, ++ /// if it is present, else `None`. ++ /// ++ /// Computes in **O(1)** time (average). ++ pub fn get_key_value(&self, key: &Q) -> Option<(&K, &V)> ++ where ++ Q: ?Sized + Hash + Equivalent, ++ { ++ if let Some(i) = self.get_index_of(key) { ++ let entry = &self.as_entries()[i]; ++ Some((&entry.key, &entry.value)) ++ } else { ++ None ++ } ++ } ++ ++ /// Return item index, key and value ++ pub fn get_full(&self, key: &Q) -> Option<(usize, &K, &V)> ++ where ++ Q: ?Sized + Hash + Equivalent, ++ { ++ if let Some(i) = self.get_index_of(key) { ++ let entry = &self.as_entries()[i]; ++ Some((i, &entry.key, &entry.value)) ++ } else { ++ None ++ } ++ } ++ ++ /// Return item index, if it exists in the map ++ /// ++ /// Computes in **O(1)** time (average). ++ pub fn get_index_of(&self, key: &Q) -> Option ++ where ++ Q: ?Sized + Hash + Equivalent, ++ { ++ match self.as_entries() { ++ [] => None, ++ [x] => key.equivalent(&x.key).then_some(0), ++ _ => { ++ let hash = self.hash(key); ++ self.core.get_index_of(hash, key) ++ } ++ } ++ } ++ ++ pub fn get_mut(&mut self, key: &Q) -> Option<&mut V> ++ where ++ Q: ?Sized + Hash + Equivalent, ++ { ++ if let Some(i) = self.get_index_of(key) { ++ let entry = &mut self.as_entries_mut()[i]; ++ Some(&mut entry.value) ++ } else { ++ None ++ } ++ } ++ ++ pub fn get_full_mut(&mut self, key: &Q) -> Option<(usize, &K, &mut V)> ++ where ++ Q: ?Sized + Hash + Equivalent, ++ { ++ if let Some(i) = self.get_index_of(key) { ++ let entry = &mut self.as_entries_mut()[i]; ++ Some((i, &entry.key, &mut entry.value)) ++ } else { ++ None ++ } ++ } ++ ++ /// Remove the key-value pair equivalent to `key` and return ++ /// its value. ++ /// ++ /// **NOTE:** This is equivalent to [`.swap_remove(key)`][Self::swap_remove], replacing this ++ /// entry's position with the last element, and it is deprecated in favor of calling that ++ /// explicitly. If you need to preserve the relative order of the keys in the map, use ++ /// [`.shift_remove(key)`][Self::shift_remove] instead. ++ #[deprecated(note = "`remove` disrupts the map order -- \ ++ use `swap_remove` or `shift_remove` for explicit behavior.")] ++ pub fn remove(&mut self, key: &Q) -> Option ++ where ++ Q: ?Sized + Hash + Equivalent, ++ { ++ self.swap_remove(key) ++ } ++ ++ /// Remove and return the key-value pair equivalent to `key`. ++ /// ++ /// **NOTE:** This is equivalent to [`.swap_remove_entry(key)`][Self::swap_remove_entry], ++ /// replacing this entry's position with the last element, and it is deprecated in favor of ++ /// calling that explicitly. If you need to preserve the relative order of the keys in the map, ++ /// use [`.shift_remove_entry(key)`][Self::shift_remove_entry] instead. ++ #[deprecated(note = "`remove_entry` disrupts the map order -- \ ++ use `swap_remove_entry` or `shift_remove_entry` for explicit behavior.")] ++ pub fn remove_entry(&mut self, key: &Q) -> Option<(K, V)> ++ where ++ Q: ?Sized + Hash + Equivalent, ++ { ++ self.swap_remove_entry(key) ++ } ++ ++ /// Remove the key-value pair equivalent to `key` and return ++ /// its value. ++ /// ++ /// Like [`Vec::swap_remove`], the pair is removed by swapping it with the ++ /// last element of the map and popping it off. **This perturbs ++ /// the position of what used to be the last element!** ++ /// ++ /// Return `None` if `key` is not in map. ++ /// ++ /// Computes in **O(1)** time (average). ++ pub fn swap_remove(&mut self, key: &Q) -> Option ++ where ++ Q: ?Sized + Hash + Equivalent, ++ { ++ self.swap_remove_full(key).map(third) ++ } ++ ++ /// Remove and return the key-value pair equivalent to `key`. ++ /// ++ /// Like [`Vec::swap_remove`], the pair is removed by swapping it with the ++ /// last element of the map and popping it off. **This perturbs ++ /// the position of what used to be the last element!** ++ /// ++ /// Return `None` if `key` is not in map. ++ /// ++ /// Computes in **O(1)** time (average). ++ pub fn swap_remove_entry(&mut self, key: &Q) -> Option<(K, V)> ++ where ++ Q: ?Sized + Hash + Equivalent, ++ { ++ match self.swap_remove_full(key) { ++ Some((_, key, value)) => Some((key, value)), ++ None => None, ++ } ++ } ++ ++ /// Remove the key-value pair equivalent to `key` and return it and ++ /// the index it had. ++ /// ++ /// Like [`Vec::swap_remove`], the pair is removed by swapping it with the ++ /// last element of the map and popping it off. **This perturbs ++ /// the position of what used to be the last element!** ++ /// ++ /// Return `None` if `key` is not in map. ++ /// ++ /// Computes in **O(1)** time (average). ++ pub fn swap_remove_full(&mut self, key: &Q) -> Option<(usize, K, V)> ++ where ++ Q: ?Sized + Hash + Equivalent, ++ { ++ match self.as_entries() { ++ [x] if key.equivalent(&x.key) => { ++ let (k, v) = self.core.pop()?; ++ Some((0, k, v)) ++ } ++ [_] | [] => None, ++ _ => { ++ let hash = self.hash(key); ++ self.core.swap_remove_full(hash, key) ++ } ++ } ++ } ++ ++ /// Remove the key-value pair equivalent to `key` and return ++ /// its value. ++ /// ++ /// Like [`Vec::remove`], the pair is removed by shifting all of the ++ /// elements that follow it, preserving their relative order. ++ /// **This perturbs the index of all of those elements!** ++ /// ++ /// Return `None` if `key` is not in map. ++ /// ++ /// Computes in **O(n)** time (average). ++ pub fn shift_remove(&mut self, key: &Q) -> Option ++ where ++ Q: ?Sized + Hash + Equivalent, ++ { ++ self.shift_remove_full(key).map(third) ++ } ++ ++ /// Remove and return the key-value pair equivalent to `key`. ++ /// ++ /// Like [`Vec::remove`], the pair is removed by shifting all of the ++ /// elements that follow it, preserving their relative order. ++ /// **This perturbs the index of all of those elements!** ++ /// ++ /// Return `None` if `key` is not in map. ++ /// ++ /// Computes in **O(n)** time (average). ++ pub fn shift_remove_entry(&mut self, key: &Q) -> Option<(K, V)> ++ where ++ Q: ?Sized + Hash + Equivalent, ++ { ++ match self.shift_remove_full(key) { ++ Some((_, key, value)) => Some((key, value)), ++ None => None, ++ } ++ } ++ ++ /// Remove the key-value pair equivalent to `key` and return it and ++ /// the index it had. ++ /// ++ /// Like [`Vec::remove`], the pair is removed by shifting all of the ++ /// elements that follow it, preserving their relative order. ++ /// **This perturbs the index of all of those elements!** ++ /// ++ /// Return `None` if `key` is not in map. ++ /// ++ /// Computes in **O(n)** time (average). ++ pub fn shift_remove_full(&mut self, key: &Q) -> Option<(usize, K, V)> ++ where ++ Q: ?Sized + Hash + Equivalent, ++ { ++ match self.as_entries() { ++ [x] if key.equivalent(&x.key) => { ++ let (k, v) = self.core.pop()?; ++ Some((0, k, v)) ++ } ++ [_] | [] => None, ++ _ => { ++ let hash = self.hash(key); ++ self.core.shift_remove_full(hash, key) ++ } ++ } ++ } ++} ++ ++impl IndexMap { ++ /// Remove the last key-value pair ++ /// ++ /// This preserves the order of the remaining elements. ++ /// ++ /// Computes in **O(1)** time (average). ++ #[doc(alias = "pop_last")] // like `BTreeMap` ++ pub fn pop(&mut self) -> Option<(K, V)> { ++ self.core.pop() ++ } ++ ++ /// Scan through each key-value pair in the map and keep those where the ++ /// closure `keep` returns `true`. ++ /// ++ /// The elements are visited in order, and remaining elements keep their ++ /// order. ++ /// ++ /// Computes in **O(n)** time (average). ++ pub fn retain(&mut self, mut keep: F) ++ where ++ F: FnMut(&K, &mut V) -> bool, ++ { ++ self.core.retain_in_order(move |k, v| keep(k, v)); ++ } ++ ++ /// Sort the map’s key-value pairs by the default ordering of the keys. ++ /// ++ /// This is a stable sort -- but equivalent keys should not normally coexist in ++ /// a map at all, so [`sort_unstable_keys`][Self::sort_unstable_keys] is preferred ++ /// because it is generally faster and doesn't allocate auxiliary memory. ++ /// ++ /// See [`sort_by`](Self::sort_by) for details. ++ pub fn sort_keys(&mut self) ++ where ++ K: Ord, ++ { ++ self.with_entries(move |entries| { ++ entries.sort_by(move |a, b| K::cmp(&a.key, &b.key)); ++ }); ++ } ++ ++ /// Sort the map’s key-value pairs in place using the comparison ++ /// function `cmp`. ++ /// ++ /// The comparison function receives two key and value pairs to compare (you ++ /// can sort by keys or values or their combination as needed). ++ /// ++ /// Computes in **O(n log n + c)** time and **O(n)** space where *n* is ++ /// the length of the map and *c* the capacity. The sort is stable. ++ pub fn sort_by(&mut self, mut cmp: F) ++ where ++ F: FnMut(&K, &V, &K, &V) -> Ordering, ++ { ++ self.with_entries(move |entries| { ++ entries.sort_by(move |a, b| cmp(&a.key, &a.value, &b.key, &b.value)); ++ }); ++ } ++ ++ /// Sort the key-value pairs of the map and return a by-value iterator of ++ /// the key-value pairs with the result. ++ /// ++ /// The sort is stable. ++ pub fn sorted_by(self, mut cmp: F) -> IntoIter ++ where ++ F: FnMut(&K, &V, &K, &V) -> Ordering, ++ { ++ let mut entries = self.into_entries(); ++ entries.sort_by(move |a, b| cmp(&a.key, &a.value, &b.key, &b.value)); ++ IntoIter::new(entries) ++ } ++ ++ /// Sort the map's key-value pairs by the default ordering of the keys, but ++ /// may not preserve the order of equal elements. ++ /// ++ /// See [`sort_unstable_by`](Self::sort_unstable_by) for details. ++ pub fn sort_unstable_keys(&mut self) ++ where ++ K: Ord, ++ { ++ self.with_entries(move |entries| { ++ entries.sort_unstable_by(move |a, b| K::cmp(&a.key, &b.key)); ++ }); ++ } ++ ++ /// Sort the map's key-value pairs in place using the comparison function `cmp`, but ++ /// may not preserve the order of equal elements. ++ /// ++ /// The comparison function receives two key and value pairs to compare (you ++ /// can sort by keys or values or their combination as needed). ++ /// ++ /// Computes in **O(n log n + c)** time where *n* is ++ /// the length of the map and *c* is the capacity. The sort is unstable. ++ pub fn sort_unstable_by(&mut self, mut cmp: F) ++ where ++ F: FnMut(&K, &V, &K, &V) -> Ordering, ++ { ++ self.with_entries(move |entries| { ++ entries.sort_unstable_by(move |a, b| cmp(&a.key, &a.value, &b.key, &b.value)); ++ }); ++ } ++ ++ /// Sort the key-value pairs of the map and return a by-value iterator of ++ /// the key-value pairs with the result. ++ /// ++ /// The sort is unstable. ++ #[inline] ++ pub fn sorted_unstable_by(self, mut cmp: F) -> IntoIter ++ where ++ F: FnMut(&K, &V, &K, &V) -> Ordering, ++ { ++ let mut entries = self.into_entries(); ++ entries.sort_unstable_by(move |a, b| cmp(&a.key, &a.value, &b.key, &b.value)); ++ IntoIter::new(entries) ++ } ++ ++ /// Sort the map’s key-value pairs in place using a sort-key extraction function. ++ /// ++ /// During sorting, the function is called at most once per entry, by using temporary storage ++ /// to remember the results of its evaluation. The order of calls to the function is ++ /// unspecified and may change between versions of `indexmap` or the standard library. ++ /// ++ /// Computes in **O(m n + n log n + c)** time () and **O(n)** space, where the function is ++ /// **O(m)**, *n* is the length of the map, and *c* the capacity. The sort is stable. ++ pub fn sort_by_cached_key(&mut self, mut sort_key: F) ++ where ++ T: Ord, ++ F: FnMut(&K, &V) -> T, ++ { ++ self.with_entries(move |entries| { ++ entries.sort_by_cached_key(move |a| sort_key(&a.key, &a.value)); ++ }); ++ } ++ ++ /// Search over a sorted map for a key. ++ /// ++ /// Returns the position where that key is present, or the position where it can be inserted to ++ /// maintain the sort. See [`slice::binary_search`] for more details. ++ /// ++ /// Computes in **O(log(n))** time, which is notably less scalable than looking the key up ++ /// using [`get_index_of`][IndexMap::get_index_of], but this can also position missing keys. ++ pub fn binary_search_keys(&self, x: &K) -> Result ++ where ++ K: Ord, ++ { ++ self.as_slice().binary_search_keys(x) ++ } ++ ++ /// Search over a sorted map with a comparator function. ++ /// ++ /// Returns the position where that value is present, or the position where it can be inserted ++ /// to maintain the sort. See [`slice::binary_search_by`] for more details. ++ /// ++ /// Computes in **O(log(n))** time. ++ #[inline] ++ pub fn binary_search_by<'a, F>(&'a self, f: F) -> Result ++ where ++ F: FnMut(&'a K, &'a V) -> Ordering, ++ { ++ self.as_slice().binary_search_by(f) ++ } ++ ++ /// Search over a sorted map with an extraction function. ++ /// ++ /// Returns the position where that value is present, or the position where it can be inserted ++ /// to maintain the sort. See [`slice::binary_search_by_key`] for more details. ++ /// ++ /// Computes in **O(log(n))** time. ++ #[inline] ++ pub fn binary_search_by_key<'a, B, F>(&'a self, b: &B, f: F) -> Result ++ where ++ F: FnMut(&'a K, &'a V) -> B, ++ B: Ord, ++ { ++ self.as_slice().binary_search_by_key(b, f) ++ } ++ ++ /// Returns the index of the partition point of a sorted map according to the given predicate ++ /// (the index of the first element of the second partition). ++ /// ++ /// See [`slice::partition_point`] for more details. ++ /// ++ /// Computes in **O(log(n))** time. ++ #[must_use] ++ pub fn partition_point

(&self, pred: P) -> usize ++ where ++ P: FnMut(&K, &V) -> bool, ++ { ++ self.as_slice().partition_point(pred) ++ } ++ ++ /// Reverses the order of the map’s key-value pairs in place. ++ /// ++ /// Computes in **O(n)** time and **O(1)** space. ++ pub fn reverse(&mut self) { ++ self.core.reverse() ++ } ++ ++ /// Returns a slice of all the key-value pairs in the map. ++ /// ++ /// Computes in **O(1)** time. ++ pub fn as_slice(&self) -> &Slice { ++ Slice::from_slice(self.as_entries()) ++ } ++ ++ /// Returns a mutable slice of all the key-value pairs in the map. ++ /// ++ /// Computes in **O(1)** time. ++ pub fn as_mut_slice(&mut self) -> &mut Slice { ++ Slice::from_mut_slice(self.as_entries_mut()) ++ } ++ ++ /// Converts into a boxed slice of all the key-value pairs in the map. ++ /// ++ /// Note that this will drop the inner hash table and any excess capacity. ++ pub fn into_boxed_slice(self) -> Box> { ++ Slice::from_boxed(self.into_entries().into_boxed_slice()) ++ } ++ ++ /// Get a key-value pair by index ++ /// ++ /// Valid indices are `0 <= index < self.len()`. ++ /// ++ /// Computes in **O(1)** time. ++ pub fn get_index(&self, index: usize) -> Option<(&K, &V)> { ++ self.as_entries().get(index).map(Bucket::refs) ++ } ++ ++ /// Get a key-value pair by index ++ /// ++ /// Valid indices are `0 <= index < self.len()`. ++ /// ++ /// Computes in **O(1)** time. ++ pub fn get_index_mut(&mut self, index: usize) -> Option<(&K, &mut V)> { ++ self.as_entries_mut().get_mut(index).map(Bucket::ref_mut) ++ } ++ ++ /// Get an entry in the map by index for in-place manipulation. ++ /// ++ /// Valid indices are `0 <= index < self.len()`. ++ /// ++ /// Computes in **O(1)** time. ++ pub fn get_index_entry(&mut self, index: usize) -> Option> { ++ if index >= self.len() { ++ return None; ++ } ++ Some(IndexedEntry::new(&mut self.core, index)) ++ } ++ ++ /// Returns a slice of key-value pairs in the given range of indices. ++ /// ++ /// Valid indices are `0 <= index < self.len()`. ++ /// ++ /// Computes in **O(1)** time. ++ pub fn get_range>(&self, range: R) -> Option<&Slice> { ++ let entries = self.as_entries(); ++ let range = try_simplify_range(range, entries.len())?; ++ entries.get(range).map(Slice::from_slice) ++ } ++ ++ /// Returns a mutable slice of key-value pairs in the given range of indices. ++ /// ++ /// Valid indices are `0 <= index < self.len()`. ++ /// ++ /// Computes in **O(1)** time. ++ pub fn get_range_mut>(&mut self, range: R) -> Option<&mut Slice> { ++ let entries = self.as_entries_mut(); ++ let range = try_simplify_range(range, entries.len())?; ++ entries.get_mut(range).map(Slice::from_mut_slice) ++ } ++ ++ /// Get the first key-value pair ++ /// ++ /// Computes in **O(1)** time. ++ #[doc(alias = "first_key_value")] // like `BTreeMap` ++ pub fn first(&self) -> Option<(&K, &V)> { ++ self.as_entries().first().map(Bucket::refs) ++ } ++ ++ /// Get the first key-value pair, with mutable access to the value ++ /// ++ /// Computes in **O(1)** time. ++ pub fn first_mut(&mut self) -> Option<(&K, &mut V)> { ++ self.as_entries_mut().first_mut().map(Bucket::ref_mut) ++ } ++ ++ /// Get the first entry in the map for in-place manipulation. ++ /// ++ /// Computes in **O(1)** time. ++ pub fn first_entry(&mut self) -> Option> { ++ self.get_index_entry(0) ++ } ++ ++ /// Get the last key-value pair ++ /// ++ /// Computes in **O(1)** time. ++ #[doc(alias = "last_key_value")] // like `BTreeMap` ++ pub fn last(&self) -> Option<(&K, &V)> { ++ self.as_entries().last().map(Bucket::refs) ++ } ++ ++ /// Get the last key-value pair, with mutable access to the value ++ /// ++ /// Computes in **O(1)** time. ++ pub fn last_mut(&mut self) -> Option<(&K, &mut V)> { ++ self.as_entries_mut().last_mut().map(Bucket::ref_mut) ++ } ++ ++ /// Get the last entry in the map for in-place manipulation. ++ /// ++ /// Computes in **O(1)** time. ++ pub fn last_entry(&mut self) -> Option> { ++ self.get_index_entry(self.len().checked_sub(1)?) ++ } ++ ++ /// Remove the key-value pair by index ++ /// ++ /// Valid indices are `0 <= index < self.len()`. ++ /// ++ /// Like [`Vec::swap_remove`], the pair is removed by swapping it with the ++ /// last element of the map and popping it off. **This perturbs ++ /// the position of what used to be the last element!** ++ /// ++ /// Computes in **O(1)** time (average). ++ pub fn swap_remove_index(&mut self, index: usize) -> Option<(K, V)> { ++ self.core.swap_remove_index(index) ++ } ++ ++ /// Remove the key-value pair by index ++ /// ++ /// Valid indices are `0 <= index < self.len()`. ++ /// ++ /// Like [`Vec::remove`], the pair is removed by shifting all of the ++ /// elements that follow it, preserving their relative order. ++ /// **This perturbs the index of all of those elements!** ++ /// ++ /// Computes in **O(n)** time (average). ++ pub fn shift_remove_index(&mut self, index: usize) -> Option<(K, V)> { ++ self.core.shift_remove_index(index) ++ } ++ ++ /// Moves the position of a key-value pair from one index to another ++ /// by shifting all other pairs in-between. ++ /// ++ /// * If `from < to`, the other pairs will shift down while the targeted pair moves up. ++ /// * If `from > to`, the other pairs will shift up while the targeted pair moves down. ++ /// ++ /// ***Panics*** if `from` or `to` are out of bounds. ++ /// ++ /// Computes in **O(n)** time (average). ++ pub fn move_index(&mut self, from: usize, to: usize) { ++ self.core.move_index(from, to) ++ } ++ ++ /// Swaps the position of two key-value pairs in the map. ++ /// ++ /// ***Panics*** if `a` or `b` are out of bounds. ++ /// ++ /// Computes in **O(1)** time (average). ++ pub fn swap_indices(&mut self, a: usize, b: usize) { ++ self.core.swap_indices(a, b) ++ } ++} ++ ++/// Access [`IndexMap`] values corresponding to a key. ++/// ++/// # Examples ++/// ++/// ``` ++/// use indexmap::IndexMap; ++/// ++/// let mut map = IndexMap::new(); ++/// for word in "Lorem ipsum dolor sit amet".split_whitespace() { ++/// map.insert(word.to_lowercase(), word.to_uppercase()); ++/// } ++/// assert_eq!(map["lorem"], "LOREM"); ++/// assert_eq!(map["ipsum"], "IPSUM"); ++/// ``` ++/// ++/// ```should_panic ++/// use indexmap::IndexMap; ++/// ++/// let mut map = IndexMap::new(); ++/// map.insert("foo", 1); ++/// println!("{:?}", map["bar"]); // panics! ++/// ``` ++impl Index<&Q> for IndexMap ++where ++ Q: Hash + Equivalent, ++ S: BuildHasher, ++{ ++ type Output = V; ++ ++ /// Returns a reference to the value corresponding to the supplied `key`. ++ /// ++ /// ***Panics*** if `key` is not present in the map. ++ fn index(&self, key: &Q) -> &V { ++ self.get(key).expect("IndexMap: key not found") ++ } ++} ++ ++/// Access [`IndexMap`] values corresponding to a key. ++/// ++/// Mutable indexing allows changing / updating values of key-value ++/// pairs that are already present. ++/// ++/// You can **not** insert new pairs with index syntax, use `.insert()`. ++/// ++/// # Examples ++/// ++/// ``` ++/// use indexmap::IndexMap; ++/// ++/// let mut map = IndexMap::new(); ++/// for word in "Lorem ipsum dolor sit amet".split_whitespace() { ++/// map.insert(word.to_lowercase(), word.to_string()); ++/// } ++/// let lorem = &mut map["lorem"]; ++/// assert_eq!(lorem, "Lorem"); ++/// lorem.retain(char::is_lowercase); ++/// assert_eq!(map["lorem"], "orem"); ++/// ``` ++/// ++/// ```should_panic ++/// use indexmap::IndexMap; ++/// ++/// let mut map = IndexMap::new(); ++/// map.insert("foo", 1); ++/// map["bar"] = 1; // panics! ++/// ``` ++impl IndexMut<&Q> for IndexMap ++where ++ Q: Hash + Equivalent, ++ S: BuildHasher, ++{ ++ /// Returns a mutable reference to the value corresponding to the supplied `key`. ++ /// ++ /// ***Panics*** if `key` is not present in the map. ++ fn index_mut(&mut self, key: &Q) -> &mut V { ++ self.get_mut(key).expect("IndexMap: key not found") ++ } ++} ++ ++/// Access [`IndexMap`] values at indexed positions. ++/// ++/// See [`Index for Keys`][keys] to access a map's keys instead. ++/// ++/// [keys]: Keys#impl-Index-for-Keys<'a,+K,+V> ++/// ++/// # Examples ++/// ++/// ``` ++/// use indexmap::IndexMap; ++/// ++/// let mut map = IndexMap::new(); ++/// for word in "Lorem ipsum dolor sit amet".split_whitespace() { ++/// map.insert(word.to_lowercase(), word.to_uppercase()); ++/// } ++/// assert_eq!(map[0], "LOREM"); ++/// assert_eq!(map[1], "IPSUM"); ++/// map.reverse(); ++/// assert_eq!(map[0], "AMET"); ++/// assert_eq!(map[1], "SIT"); ++/// map.sort_keys(); ++/// assert_eq!(map[0], "AMET"); ++/// assert_eq!(map[1], "DOLOR"); ++/// ``` ++/// ++/// ```should_panic ++/// use indexmap::IndexMap; ++/// ++/// let mut map = IndexMap::new(); ++/// map.insert("foo", 1); ++/// println!("{:?}", map[10]); // panics! ++/// ``` ++impl Index for IndexMap { ++ type Output = V; ++ ++ /// Returns a reference to the value at the supplied `index`. ++ /// ++ /// ***Panics*** if `index` is out of bounds. ++ fn index(&self, index: usize) -> &V { ++ self.get_index(index) ++ .expect("IndexMap: index out of bounds") ++ .1 ++ } ++} ++ ++/// Access [`IndexMap`] values at indexed positions. ++/// ++/// Mutable indexing allows changing / updating indexed values ++/// that are already present. ++/// ++/// You can **not** insert new values with index syntax -- use [`.insert()`][IndexMap::insert]. ++/// ++/// # Examples ++/// ++/// ``` ++/// use indexmap::IndexMap; ++/// ++/// let mut map = IndexMap::new(); ++/// for word in "Lorem ipsum dolor sit amet".split_whitespace() { ++/// map.insert(word.to_lowercase(), word.to_string()); ++/// } ++/// let lorem = &mut map[0]; ++/// assert_eq!(lorem, "Lorem"); ++/// lorem.retain(char::is_lowercase); ++/// assert_eq!(map["lorem"], "orem"); ++/// ``` ++/// ++/// ```should_panic ++/// use indexmap::IndexMap; ++/// ++/// let mut map = IndexMap::new(); ++/// map.insert("foo", 1); ++/// map[10] = 1; // panics! ++/// ``` ++impl IndexMut for IndexMap { ++ /// Returns a mutable reference to the value at the supplied `index`. ++ /// ++ /// ***Panics*** if `index` is out of bounds. ++ fn index_mut(&mut self, index: usize) -> &mut V { ++ self.get_index_mut(index) ++ .expect("IndexMap: index out of bounds") ++ .1 ++ } ++} ++ ++impl FromIterator<(K, V)> for IndexMap ++where ++ K: Hash + Eq, ++ S: BuildHasher + Default, ++{ ++ /// Create an `IndexMap` from the sequence of key-value pairs in the ++ /// iterable. ++ /// ++ /// `from_iter` uses the same logic as `extend`. See ++ /// [`extend`][IndexMap::extend] for more details. ++ fn from_iter>(iterable: I) -> Self { ++ let iter = iterable.into_iter(); ++ let (low, _) = iter.size_hint(); ++ let mut map = Self::with_capacity_and_hasher(low, <_>::default()); ++ map.extend(iter); ++ map ++ } ++} ++ ++#[cfg(feature = "std")] ++#[cfg_attr(docsrs, doc(cfg(feature = "std")))] ++impl From<[(K, V); N]> for IndexMap ++where ++ K: Hash + Eq, ++{ ++ /// # Examples ++ /// ++ /// ``` ++ /// use indexmap::IndexMap; ++ /// ++ /// let map1 = IndexMap::from([(1, 2), (3, 4)]); ++ /// let map2: IndexMap<_, _> = [(1, 2), (3, 4)].into(); ++ /// assert_eq!(map1, map2); ++ /// ``` ++ fn from(arr: [(K, V); N]) -> Self { ++ Self::from_iter(arr) ++ } ++} ++ ++impl Extend<(K, V)> for IndexMap ++where ++ K: Hash + Eq, ++ S: BuildHasher, ++{ ++ /// Extend the map with all key-value pairs in the iterable. ++ /// ++ /// This is equivalent to calling [`insert`][IndexMap::insert] for each of ++ /// them in order, which means that for keys that already existed ++ /// in the map, their value is updated but it keeps the existing order. ++ /// ++ /// New keys are inserted in the order they appear in the sequence. If ++ /// equivalents of a key occur more than once, the last corresponding value ++ /// prevails. ++ fn extend>(&mut self, iterable: I) { ++ // (Note: this is a copy of `std`/`hashbrown`'s reservation logic.) ++ // Keys may be already present or show multiple times in the iterator. ++ // Reserve the entire hint lower bound if the map is empty. ++ // Otherwise reserve half the hint (rounded up), so the map ++ // will only resize twice in the worst case. ++ let iter = iterable.into_iter(); ++ let reserve = if self.is_empty() { ++ iter.size_hint().0 ++ } else { ++ (iter.size_hint().0 + 1) / 2 ++ }; ++ self.reserve(reserve); ++ iter.for_each(move |(k, v)| { ++ self.insert(k, v); ++ }); ++ } ++} ++ ++impl<'a, K, V, S> Extend<(&'a K, &'a V)> for IndexMap ++where ++ K: Hash + Eq + Copy, ++ V: Copy, ++ S: BuildHasher, ++{ ++ /// Extend the map with all key-value pairs in the iterable. ++ /// ++ /// See the first extend method for more details. ++ fn extend>(&mut self, iterable: I) { ++ self.extend(iterable.into_iter().map(|(&key, &value)| (key, value))); ++ } ++} ++ ++impl Default for IndexMap ++where ++ S: Default, ++{ ++ /// Return an empty [`IndexMap`] ++ fn default() -> Self { ++ Self::with_capacity_and_hasher(0, S::default()) ++ } ++} ++ ++impl PartialEq> for IndexMap ++where ++ K: Hash + Eq, ++ V1: PartialEq, ++ S1: BuildHasher, ++ S2: BuildHasher, ++{ ++ fn eq(&self, other: &IndexMap) -> bool { ++ if self.len() != other.len() { ++ return false; ++ } ++ ++ self.iter() ++ .all(|(key, value)| other.get(key).map_or(false, |v| *value == *v)) ++ } ++} ++ ++impl Eq for IndexMap ++where ++ K: Eq + Hash, ++ V: Eq, ++ S: BuildHasher, ++{ ++} +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/src/rayon/map.rs mesa-25.3.3/subprojects/indexmap-2.7.0/src/rayon/map.rs +--- mesa-25.3.3/subprojects/indexmap-2.7.0/src/rayon/map.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/src/rayon/map.rs 2025-01-11 13:48:35.000000000 -0500 +@@ -0,0 +1,663 @@ ++//! Parallel iterator types for [`IndexMap`] with [`rayon`][::rayon]. ++//! ++//! You will rarely need to interact with this module directly unless you need to name one of the ++//! iterator types. ++ ++use super::collect; ++use rayon::iter::plumbing::{Consumer, ProducerCallback, UnindexedConsumer}; ++use rayon::prelude::*; ++ ++use crate::vec::Vec; ++use alloc::boxed::Box; ++use core::cmp::Ordering; ++use core::fmt; ++use core::hash::{BuildHasher, Hash}; ++use core::ops::RangeBounds; ++ ++use crate::map::Slice; ++use crate::Bucket; ++use crate::Entries; ++use crate::IndexMap; ++ ++impl IntoParallelIterator for IndexMap ++where ++ K: Send, ++ V: Send, ++{ ++ type Item = (K, V); ++ type Iter = IntoParIter; ++ ++ fn into_par_iter(self) -> Self::Iter { ++ IntoParIter { ++ entries: self.into_entries(), ++ } ++ } ++} ++ ++impl IntoParallelIterator for Box> ++where ++ K: Send, ++ V: Send, ++{ ++ type Item = (K, V); ++ type Iter = IntoParIter; ++ ++ fn into_par_iter(self) -> Self::Iter { ++ IntoParIter { ++ entries: self.into_entries(), ++ } ++ } ++} ++ ++/// A parallel owning iterator over the entries of an [`IndexMap`]. ++/// ++/// This `struct` is created by the [`IndexMap::into_par_iter`] method ++/// (provided by rayon's [`IntoParallelIterator`] trait). See its documentation for more. ++pub struct IntoParIter { ++ entries: Vec>, ++} ++ ++impl fmt::Debug for IntoParIter { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ let iter = self.entries.iter().map(Bucket::refs); ++ f.debug_list().entries(iter).finish() ++ } ++} ++ ++impl ParallelIterator for IntoParIter { ++ type Item = (K, V); ++ ++ parallel_iterator_methods!(Bucket::key_value); ++} ++ ++impl IndexedParallelIterator for IntoParIter { ++ indexed_parallel_iterator_methods!(Bucket::key_value); ++} ++ ++impl<'a, K, V, S> IntoParallelIterator for &'a IndexMap ++where ++ K: Sync, ++ V: Sync, ++{ ++ type Item = (&'a K, &'a V); ++ type Iter = ParIter<'a, K, V>; ++ ++ fn into_par_iter(self) -> Self::Iter { ++ ParIter { ++ entries: self.as_entries(), ++ } ++ } ++} ++ ++impl<'a, K, V> IntoParallelIterator for &'a Slice ++where ++ K: Sync, ++ V: Sync, ++{ ++ type Item = (&'a K, &'a V); ++ type Iter = ParIter<'a, K, V>; ++ ++ fn into_par_iter(self) -> Self::Iter { ++ ParIter { ++ entries: &self.entries, ++ } ++ } ++} ++ ++/// A parallel iterator over the entries of an [`IndexMap`]. ++/// ++/// This `struct` is created by the [`IndexMap::par_iter`] method ++/// (provided by rayon's [`IntoParallelRefIterator`] trait). See its documentation for more. ++/// ++/// [`IndexMap::par_iter`]: ../struct.IndexMap.html#method.par_iter ++pub struct ParIter<'a, K, V> { ++ entries: &'a [Bucket], ++} ++ ++impl Clone for ParIter<'_, K, V> { ++ fn clone(&self) -> Self { ++ ParIter { ..*self } ++ } ++} ++ ++impl fmt::Debug for ParIter<'_, K, V> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ let iter = self.entries.iter().map(Bucket::refs); ++ f.debug_list().entries(iter).finish() ++ } ++} ++ ++impl<'a, K: Sync, V: Sync> ParallelIterator for ParIter<'a, K, V> { ++ type Item = (&'a K, &'a V); ++ ++ parallel_iterator_methods!(Bucket::refs); ++} ++ ++impl IndexedParallelIterator for ParIter<'_, K, V> { ++ indexed_parallel_iterator_methods!(Bucket::refs); ++} ++ ++impl<'a, K, V, S> IntoParallelIterator for &'a mut IndexMap ++where ++ K: Sync + Send, ++ V: Send, ++{ ++ type Item = (&'a K, &'a mut V); ++ type Iter = ParIterMut<'a, K, V>; ++ ++ fn into_par_iter(self) -> Self::Iter { ++ ParIterMut { ++ entries: self.as_entries_mut(), ++ } ++ } ++} ++ ++impl<'a, K, V> IntoParallelIterator for &'a mut Slice ++where ++ K: Sync + Send, ++ V: Send, ++{ ++ type Item = (&'a K, &'a mut V); ++ type Iter = ParIterMut<'a, K, V>; ++ ++ fn into_par_iter(self) -> Self::Iter { ++ ParIterMut { ++ entries: &mut self.entries, ++ } ++ } ++} ++ ++/// A parallel mutable iterator over the entries of an [`IndexMap`]. ++/// ++/// This `struct` is created by the [`IndexMap::par_iter_mut`] method ++/// (provided by rayon's [`IntoParallelRefMutIterator`] trait). See its documentation for more. ++/// ++/// [`IndexMap::par_iter_mut`]: ../struct.IndexMap.html#method.par_iter_mut ++pub struct ParIterMut<'a, K, V> { ++ entries: &'a mut [Bucket], ++} ++ ++impl fmt::Debug for ParIterMut<'_, K, V> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ let iter = self.entries.iter().map(Bucket::refs); ++ f.debug_list().entries(iter).finish() ++ } ++} ++ ++impl<'a, K: Sync + Send, V: Send> ParallelIterator for ParIterMut<'a, K, V> { ++ type Item = (&'a K, &'a mut V); ++ ++ parallel_iterator_methods!(Bucket::ref_mut); ++} ++ ++impl IndexedParallelIterator for ParIterMut<'_, K, V> { ++ indexed_parallel_iterator_methods!(Bucket::ref_mut); ++} ++ ++impl<'a, K, V, S> ParallelDrainRange for &'a mut IndexMap ++where ++ K: Send, ++ V: Send, ++{ ++ type Item = (K, V); ++ type Iter = ParDrain<'a, K, V>; ++ ++ fn par_drain>(self, range: R) -> Self::Iter { ++ ParDrain { ++ entries: self.core.par_drain(range), ++ } ++ } ++} ++ ++/// A parallel draining iterator over the entries of an [`IndexMap`]. ++/// ++/// This `struct` is created by the [`IndexMap::par_drain`] method ++/// (provided by rayon's [`ParallelDrainRange`] trait). See its documentation for more. ++/// ++/// [`IndexMap::par_drain`]: ../struct.IndexMap.html#method.par_drain ++pub struct ParDrain<'a, K: Send, V: Send> { ++ entries: rayon::vec::Drain<'a, Bucket>, ++} ++ ++impl ParallelIterator for ParDrain<'_, K, V> { ++ type Item = (K, V); ++ ++ parallel_iterator_methods!(Bucket::key_value); ++} ++ ++impl IndexedParallelIterator for ParDrain<'_, K, V> { ++ indexed_parallel_iterator_methods!(Bucket::key_value); ++} ++ ++/// Parallel iterator methods and other parallel methods. ++/// ++/// The following methods **require crate feature `"rayon"`**. ++/// ++/// See also the `IntoParallelIterator` implementations. ++impl IndexMap ++where ++ K: Sync, ++ V: Sync, ++{ ++ /// Return a parallel iterator over the keys of the map. ++ /// ++ /// While parallel iterators can process items in any order, their relative order ++ /// in the map is still preserved for operations like `reduce` and `collect`. ++ pub fn par_keys(&self) -> ParKeys<'_, K, V> { ++ ParKeys { ++ entries: self.as_entries(), ++ } ++ } ++ ++ /// Return a parallel iterator over the values of the map. ++ /// ++ /// While parallel iterators can process items in any order, their relative order ++ /// in the map is still preserved for operations like `reduce` and `collect`. ++ pub fn par_values(&self) -> ParValues<'_, K, V> { ++ ParValues { ++ entries: self.as_entries(), ++ } ++ } ++} ++ ++/// Parallel iterator methods and other parallel methods. ++/// ++/// The following methods **require crate feature `"rayon"`**. ++/// ++/// See also the `IntoParallelIterator` implementations. ++impl Slice ++where ++ K: Sync, ++ V: Sync, ++{ ++ /// Return a parallel iterator over the keys of the map slice. ++ /// ++ /// While parallel iterators can process items in any order, their relative order ++ /// in the slice is still preserved for operations like `reduce` and `collect`. ++ pub fn par_keys(&self) -> ParKeys<'_, K, V> { ++ ParKeys { ++ entries: &self.entries, ++ } ++ } ++ ++ /// Return a parallel iterator over the values of the map slice. ++ /// ++ /// While parallel iterators can process items in any order, their relative order ++ /// in the slice is still preserved for operations like `reduce` and `collect`. ++ pub fn par_values(&self) -> ParValues<'_, K, V> { ++ ParValues { ++ entries: &self.entries, ++ } ++ } ++} ++ ++impl IndexMap ++where ++ K: Hash + Eq + Sync, ++ V: Sync, ++ S: BuildHasher, ++{ ++ /// Returns `true` if `self` contains all of the same key-value pairs as `other`, ++ /// regardless of each map's indexed order, determined in parallel. ++ pub fn par_eq(&self, other: &IndexMap) -> bool ++ where ++ V: PartialEq, ++ V2: Sync, ++ S2: BuildHasher + Sync, ++ { ++ self.len() == other.len() ++ && self ++ .par_iter() ++ .all(move |(key, value)| other.get(key).map_or(false, |v| *value == *v)) ++ } ++} ++ ++/// A parallel iterator over the keys of an [`IndexMap`]. ++/// ++/// This `struct` is created by the [`IndexMap::par_keys`] method. ++/// See its documentation for more. ++pub struct ParKeys<'a, K, V> { ++ entries: &'a [Bucket], ++} ++ ++impl Clone for ParKeys<'_, K, V> { ++ fn clone(&self) -> Self { ++ ParKeys { ..*self } ++ } ++} ++ ++impl fmt::Debug for ParKeys<'_, K, V> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ let iter = self.entries.iter().map(Bucket::key_ref); ++ f.debug_list().entries(iter).finish() ++ } ++} ++ ++impl<'a, K: Sync, V: Sync> ParallelIterator for ParKeys<'a, K, V> { ++ type Item = &'a K; ++ ++ parallel_iterator_methods!(Bucket::key_ref); ++} ++ ++impl IndexedParallelIterator for ParKeys<'_, K, V> { ++ indexed_parallel_iterator_methods!(Bucket::key_ref); ++} ++ ++/// A parallel iterator over the values of an [`IndexMap`]. ++/// ++/// This `struct` is created by the [`IndexMap::par_values`] method. ++/// See its documentation for more. ++pub struct ParValues<'a, K, V> { ++ entries: &'a [Bucket], ++} ++ ++impl Clone for ParValues<'_, K, V> { ++ fn clone(&self) -> Self { ++ ParValues { ..*self } ++ } ++} ++ ++impl fmt::Debug for ParValues<'_, K, V> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ let iter = self.entries.iter().map(Bucket::value_ref); ++ f.debug_list().entries(iter).finish() ++ } ++} ++ ++impl<'a, K: Sync, V: Sync> ParallelIterator for ParValues<'a, K, V> { ++ type Item = &'a V; ++ ++ parallel_iterator_methods!(Bucket::value_ref); ++} ++ ++impl IndexedParallelIterator for ParValues<'_, K, V> { ++ indexed_parallel_iterator_methods!(Bucket::value_ref); ++} ++ ++impl IndexMap ++where ++ K: Send, ++ V: Send, ++{ ++ /// Return a parallel iterator over mutable references to the values of the map ++ /// ++ /// While parallel iterators can process items in any order, their relative order ++ /// in the map is still preserved for operations like `reduce` and `collect`. ++ pub fn par_values_mut(&mut self) -> ParValuesMut<'_, K, V> { ++ ParValuesMut { ++ entries: self.as_entries_mut(), ++ } ++ } ++} ++ ++impl Slice ++where ++ K: Send, ++ V: Send, ++{ ++ /// Return a parallel iterator over mutable references to the the values of the map slice. ++ /// ++ /// While parallel iterators can process items in any order, their relative order ++ /// in the slice is still preserved for operations like `reduce` and `collect`. ++ pub fn par_values_mut(&mut self) -> ParValuesMut<'_, K, V> { ++ ParValuesMut { ++ entries: &mut self.entries, ++ } ++ } ++} ++ ++impl IndexMap ++where ++ K: Send, ++ V: Send, ++{ ++ /// Sort the map’s key-value pairs in parallel, by the default ordering of the keys. ++ pub fn par_sort_keys(&mut self) ++ where ++ K: Ord, ++ { ++ self.with_entries(|entries| { ++ entries.par_sort_by(|a, b| K::cmp(&a.key, &b.key)); ++ }); ++ } ++ ++ /// Sort the map’s key-value pairs in place and in parallel, using the comparison ++ /// function `cmp`. ++ /// ++ /// The comparison function receives two key and value pairs to compare (you ++ /// can sort by keys or values or their combination as needed). ++ pub fn par_sort_by(&mut self, cmp: F) ++ where ++ F: Fn(&K, &V, &K, &V) -> Ordering + Sync, ++ { ++ self.with_entries(|entries| { ++ entries.par_sort_by(move |a, b| cmp(&a.key, &a.value, &b.key, &b.value)); ++ }); ++ } ++ ++ /// Sort the key-value pairs of the map in parallel and return a by-value parallel ++ /// iterator of the key-value pairs with the result. ++ pub fn par_sorted_by(self, cmp: F) -> IntoParIter ++ where ++ F: Fn(&K, &V, &K, &V) -> Ordering + Sync, ++ { ++ let mut entries = self.into_entries(); ++ entries.par_sort_by(move |a, b| cmp(&a.key, &a.value, &b.key, &b.value)); ++ IntoParIter { entries } ++ } ++ ++ /// Sort the map's key-value pairs in parallel, by the default ordering of the keys. ++ pub fn par_sort_unstable_keys(&mut self) ++ where ++ K: Ord, ++ { ++ self.with_entries(|entries| { ++ entries.par_sort_unstable_by(|a, b| K::cmp(&a.key, &b.key)); ++ }); ++ } ++ ++ /// Sort the map's key-value pairs in place and in parallel, using the comparison ++ /// function `cmp`. ++ /// ++ /// The comparison function receives two key and value pairs to compare (you ++ /// can sort by keys or values or their combination as needed). ++ pub fn par_sort_unstable_by(&mut self, cmp: F) ++ where ++ F: Fn(&K, &V, &K, &V) -> Ordering + Sync, ++ { ++ self.with_entries(|entries| { ++ entries.par_sort_unstable_by(move |a, b| cmp(&a.key, &a.value, &b.key, &b.value)); ++ }); ++ } ++ ++ /// Sort the key-value pairs of the map in parallel and return a by-value parallel ++ /// iterator of the key-value pairs with the result. ++ pub fn par_sorted_unstable_by(self, cmp: F) -> IntoParIter ++ where ++ F: Fn(&K, &V, &K, &V) -> Ordering + Sync, ++ { ++ let mut entries = self.into_entries(); ++ entries.par_sort_unstable_by(move |a, b| cmp(&a.key, &a.value, &b.key, &b.value)); ++ IntoParIter { entries } ++ } ++ ++ /// Sort the map’s key-value pairs in place and in parallel, using a sort-key extraction ++ /// function. ++ pub fn par_sort_by_cached_key(&mut self, sort_key: F) ++ where ++ T: Ord + Send, ++ F: Fn(&K, &V) -> T + Sync, ++ { ++ self.with_entries(move |entries| { ++ entries.par_sort_by_cached_key(move |a| sort_key(&a.key, &a.value)); ++ }); ++ } ++} ++ ++/// A parallel mutable iterator over the values of an [`IndexMap`]. ++/// ++/// This `struct` is created by the [`IndexMap::par_values_mut`] method. ++/// See its documentation for more. ++pub struct ParValuesMut<'a, K, V> { ++ entries: &'a mut [Bucket], ++} ++ ++impl fmt::Debug for ParValuesMut<'_, K, V> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ let iter = self.entries.iter().map(Bucket::value_ref); ++ f.debug_list().entries(iter).finish() ++ } ++} ++ ++impl<'a, K: Send, V: Send> ParallelIterator for ParValuesMut<'a, K, V> { ++ type Item = &'a mut V; ++ ++ parallel_iterator_methods!(Bucket::value_mut); ++} ++ ++impl IndexedParallelIterator for ParValuesMut<'_, K, V> { ++ indexed_parallel_iterator_methods!(Bucket::value_mut); ++} ++ ++impl FromParallelIterator<(K, V)> for IndexMap ++where ++ K: Eq + Hash + Send, ++ V: Send, ++ S: BuildHasher + Default + Send, ++{ ++ fn from_par_iter(iter: I) -> Self ++ where ++ I: IntoParallelIterator, ++ { ++ let list = collect(iter); ++ let len = list.iter().map(Vec::len).sum(); ++ let mut map = Self::with_capacity_and_hasher(len, S::default()); ++ for vec in list { ++ map.extend(vec); ++ } ++ map ++ } ++} ++ ++impl ParallelExtend<(K, V)> for IndexMap ++where ++ K: Eq + Hash + Send, ++ V: Send, ++ S: BuildHasher + Send, ++{ ++ fn par_extend(&mut self, iter: I) ++ where ++ I: IntoParallelIterator, ++ { ++ for vec in collect(iter) { ++ self.extend(vec); ++ } ++ } ++} ++ ++impl<'a, K: 'a, V: 'a, S> ParallelExtend<(&'a K, &'a V)> for IndexMap ++where ++ K: Copy + Eq + Hash + Send + Sync, ++ V: Copy + Send + Sync, ++ S: BuildHasher + Send, ++{ ++ fn par_extend(&mut self, iter: I) ++ where ++ I: IntoParallelIterator, ++ { ++ for vec in collect(iter) { ++ self.extend(vec); ++ } ++ } ++} ++ ++#[cfg(all(test, feature = "std"))] ++mod tests { ++ use super::*; ++ use std::string::String; ++ ++ #[test] ++ fn insert_order() { ++ let insert = [0, 4, 2, 12, 8, 7, 11, 5, 3, 17, 19, 22, 23]; ++ let mut map = IndexMap::new(); ++ ++ for &elt in &insert { ++ map.insert(elt, ()); ++ } ++ ++ assert_eq!(map.par_keys().count(), map.len()); ++ assert_eq!(map.par_keys().count(), insert.len()); ++ insert.par_iter().zip(map.par_keys()).for_each(|(a, b)| { ++ assert_eq!(a, b); ++ }); ++ (0..insert.len()) ++ .into_par_iter() ++ .zip(map.par_keys()) ++ .for_each(|(i, k)| { ++ assert_eq!(map.get_index(i).unwrap().0, k); ++ }); ++ } ++ ++ #[test] ++ fn partial_eq_and_eq() { ++ let mut map_a = IndexMap::new(); ++ map_a.insert(1, "1"); ++ map_a.insert(2, "2"); ++ let mut map_b = map_a.clone(); ++ assert!(map_a.par_eq(&map_b)); ++ map_b.swap_remove(&1); ++ assert!(!map_a.par_eq(&map_b)); ++ map_b.insert(3, "3"); ++ assert!(!map_a.par_eq(&map_b)); ++ ++ let map_c: IndexMap<_, String> = ++ map_b.into_par_iter().map(|(k, v)| (k, v.into())).collect(); ++ assert!(!map_a.par_eq(&map_c)); ++ assert!(!map_c.par_eq(&map_a)); ++ } ++ ++ #[test] ++ fn extend() { ++ let mut map = IndexMap::new(); ++ map.par_extend(vec![(&1, &2), (&3, &4)]); ++ map.par_extend(vec![(5, 6)]); ++ assert_eq!( ++ map.into_par_iter().collect::>(), ++ vec![(1, 2), (3, 4), (5, 6)] ++ ); ++ } ++ ++ #[test] ++ fn keys() { ++ let vec = vec![(1, 'a'), (2, 'b'), (3, 'c')]; ++ let map: IndexMap<_, _> = vec.into_par_iter().collect(); ++ let keys: Vec<_> = map.par_keys().copied().collect(); ++ assert_eq!(keys.len(), 3); ++ assert!(keys.contains(&1)); ++ assert!(keys.contains(&2)); ++ assert!(keys.contains(&3)); ++ } ++ ++ #[test] ++ fn values() { ++ let vec = vec![(1, 'a'), (2, 'b'), (3, 'c')]; ++ let map: IndexMap<_, _> = vec.into_par_iter().collect(); ++ let values: Vec<_> = map.par_values().copied().collect(); ++ assert_eq!(values.len(), 3); ++ assert!(values.contains(&'a')); ++ assert!(values.contains(&'b')); ++ assert!(values.contains(&'c')); ++ } ++ ++ #[test] ++ fn values_mut() { ++ let vec = vec![(1, 1), (2, 2), (3, 3)]; ++ let mut map: IndexMap<_, _> = vec.into_par_iter().collect(); ++ map.par_values_mut().for_each(|value| *value *= 2); ++ let values: Vec<_> = map.par_values().copied().collect(); ++ assert_eq!(values.len(), 3); ++ assert!(values.contains(&2)); ++ assert!(values.contains(&4)); ++ assert!(values.contains(&6)); ++ } ++} +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/src/rayon/mod.rs mesa-25.3.3/subprojects/indexmap-2.7.0/src/rayon/mod.rs +--- mesa-25.3.3/subprojects/indexmap-2.7.0/src/rayon/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/src/rayon/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,16 @@ ++#![cfg_attr(docsrs, doc(cfg(feature = "rayon")))] ++ ++use rayon::prelude::*; ++ ++use alloc::collections::LinkedList; ++ ++use crate::vec::Vec; ++ ++pub mod map; ++pub mod set; ++ ++// This form of intermediate collection is also how Rayon collects `HashMap`. ++// Note that the order will also be preserved! ++fn collect(iter: I) -> LinkedList> { ++ iter.into_par_iter().collect_vec_list() ++} +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/src/rayon/set.rs mesa-25.3.3/subprojects/indexmap-2.7.0/src/rayon/set.rs +--- mesa-25.3.3/subprojects/indexmap-2.7.0/src/rayon/set.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/src/rayon/set.rs 2025-01-11 13:48:35.000000000 -0500 +@@ -0,0 +1,756 @@ ++//! Parallel iterator types for [`IndexSet`] with [rayon][::rayon]. ++//! ++//! You will rarely need to interact with this module directly unless you need to name one of the ++//! iterator types. ++ ++use super::collect; ++use rayon::iter::plumbing::{Consumer, ProducerCallback, UnindexedConsumer}; ++use rayon::prelude::*; ++ ++use crate::vec::Vec; ++use alloc::boxed::Box; ++use core::cmp::Ordering; ++use core::fmt; ++use core::hash::{BuildHasher, Hash}; ++use core::ops::RangeBounds; ++ ++use crate::set::Slice; ++use crate::Entries; ++use crate::IndexSet; ++ ++type Bucket = crate::Bucket; ++ ++impl IntoParallelIterator for IndexSet ++where ++ T: Send, ++{ ++ type Item = T; ++ type Iter = IntoParIter; ++ ++ fn into_par_iter(self) -> Self::Iter { ++ IntoParIter { ++ entries: self.into_entries(), ++ } ++ } ++} ++ ++impl IntoParallelIterator for Box> ++where ++ T: Send, ++{ ++ type Item = T; ++ type Iter = IntoParIter; ++ ++ fn into_par_iter(self) -> Self::Iter { ++ IntoParIter { ++ entries: self.into_entries(), ++ } ++ } ++} ++ ++/// A parallel owning iterator over the items of an [`IndexSet`]. ++/// ++/// This `struct` is created by the [`IndexSet::into_par_iter`] method ++/// (provided by rayon's [`IntoParallelIterator`] trait). See its documentation for more. ++pub struct IntoParIter { ++ entries: Vec>, ++} ++ ++impl fmt::Debug for IntoParIter { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ let iter = self.entries.iter().map(Bucket::key_ref); ++ f.debug_list().entries(iter).finish() ++ } ++} ++ ++impl ParallelIterator for IntoParIter { ++ type Item = T; ++ ++ parallel_iterator_methods!(Bucket::key); ++} ++ ++impl IndexedParallelIterator for IntoParIter { ++ indexed_parallel_iterator_methods!(Bucket::key); ++} ++ ++impl<'a, T, S> IntoParallelIterator for &'a IndexSet ++where ++ T: Sync, ++{ ++ type Item = &'a T; ++ type Iter = ParIter<'a, T>; ++ ++ fn into_par_iter(self) -> Self::Iter { ++ ParIter { ++ entries: self.as_entries(), ++ } ++ } ++} ++ ++impl<'a, T> IntoParallelIterator for &'a Slice ++where ++ T: Sync, ++{ ++ type Item = &'a T; ++ type Iter = ParIter<'a, T>; ++ ++ fn into_par_iter(self) -> Self::Iter { ++ ParIter { ++ entries: &self.entries, ++ } ++ } ++} ++ ++/// A parallel iterator over the items of an [`IndexSet`]. ++/// ++/// This `struct` is created by the [`IndexSet::par_iter`] method ++/// (provided by rayon's [`IntoParallelRefIterator`] trait). See its documentation for more. ++/// ++/// [`IndexSet::par_iter`]: ../struct.IndexSet.html#method.par_iter ++pub struct ParIter<'a, T> { ++ entries: &'a [Bucket], ++} ++ ++impl Clone for ParIter<'_, T> { ++ fn clone(&self) -> Self { ++ ParIter { ..*self } ++ } ++} ++ ++impl fmt::Debug for ParIter<'_, T> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ let iter = self.entries.iter().map(Bucket::key_ref); ++ f.debug_list().entries(iter).finish() ++ } ++} ++ ++impl<'a, T: Sync> ParallelIterator for ParIter<'a, T> { ++ type Item = &'a T; ++ ++ parallel_iterator_methods!(Bucket::key_ref); ++} ++ ++impl IndexedParallelIterator for ParIter<'_, T> { ++ indexed_parallel_iterator_methods!(Bucket::key_ref); ++} ++ ++impl<'a, T, S> ParallelDrainRange for &'a mut IndexSet ++where ++ T: Send, ++{ ++ type Item = T; ++ type Iter = ParDrain<'a, T>; ++ ++ fn par_drain>(self, range: R) -> Self::Iter { ++ ParDrain { ++ entries: self.map.core.par_drain(range), ++ } ++ } ++} ++ ++/// A parallel draining iterator over the items of an [`IndexSet`]. ++/// ++/// This `struct` is created by the [`IndexSet::par_drain`] method ++/// (provided by rayon's [`ParallelDrainRange`] trait). See its documentation for more. ++/// ++/// [`IndexSet::par_drain`]: ../struct.IndexSet.html#method.par_drain ++pub struct ParDrain<'a, T: Send> { ++ entries: rayon::vec::Drain<'a, Bucket>, ++} ++ ++impl ParallelIterator for ParDrain<'_, T> { ++ type Item = T; ++ ++ parallel_iterator_methods!(Bucket::key); ++} ++ ++impl IndexedParallelIterator for ParDrain<'_, T> { ++ indexed_parallel_iterator_methods!(Bucket::key); ++} ++ ++/// Parallel iterator methods and other parallel methods. ++/// ++/// The following methods **require crate feature `"rayon"`**. ++/// ++/// See also the `IntoParallelIterator` implementations. ++impl IndexSet ++where ++ T: Hash + Eq + Sync, ++ S: BuildHasher + Sync, ++{ ++ /// Return a parallel iterator over the values that are in `self` but not `other`. ++ /// ++ /// While parallel iterators can process items in any order, their relative order ++ /// in the `self` set is still preserved for operations like `reduce` and `collect`. ++ pub fn par_difference<'a, S2>( ++ &'a self, ++ other: &'a IndexSet, ++ ) -> ParDifference<'a, T, S, S2> ++ where ++ S2: BuildHasher + Sync, ++ { ++ ParDifference { ++ set1: self, ++ set2: other, ++ } ++ } ++ ++ /// Return a parallel iterator over the values that are in `self` or `other`, ++ /// but not in both. ++ /// ++ /// While parallel iterators can process items in any order, their relative order ++ /// in the sets is still preserved for operations like `reduce` and `collect`. ++ /// Values from `self` are produced in their original order, followed by ++ /// values from `other` in their original order. ++ pub fn par_symmetric_difference<'a, S2>( ++ &'a self, ++ other: &'a IndexSet, ++ ) -> ParSymmetricDifference<'a, T, S, S2> ++ where ++ S2: BuildHasher + Sync, ++ { ++ ParSymmetricDifference { ++ set1: self, ++ set2: other, ++ } ++ } ++ ++ /// Return a parallel iterator over the values that are in both `self` and `other`. ++ /// ++ /// While parallel iterators can process items in any order, their relative order ++ /// in the `self` set is still preserved for operations like `reduce` and `collect`. ++ pub fn par_intersection<'a, S2>( ++ &'a self, ++ other: &'a IndexSet, ++ ) -> ParIntersection<'a, T, S, S2> ++ where ++ S2: BuildHasher + Sync, ++ { ++ ParIntersection { ++ set1: self, ++ set2: other, ++ } ++ } ++ ++ /// Return a parallel iterator over all values that are in `self` or `other`. ++ /// ++ /// While parallel iterators can process items in any order, their relative order ++ /// in the sets is still preserved for operations like `reduce` and `collect`. ++ /// Values from `self` are produced in their original order, followed by ++ /// values that are unique to `other` in their original order. ++ pub fn par_union<'a, S2>(&'a self, other: &'a IndexSet) -> ParUnion<'a, T, S, S2> ++ where ++ S2: BuildHasher + Sync, ++ { ++ ParUnion { ++ set1: self, ++ set2: other, ++ } ++ } ++ ++ /// Returns `true` if `self` contains all of the same values as `other`, ++ /// regardless of each set's indexed order, determined in parallel. ++ pub fn par_eq(&self, other: &IndexSet) -> bool ++ where ++ S2: BuildHasher + Sync, ++ { ++ self.len() == other.len() && self.par_is_subset(other) ++ } ++ ++ /// Returns `true` if `self` has no elements in common with `other`, ++ /// determined in parallel. ++ pub fn par_is_disjoint(&self, other: &IndexSet) -> bool ++ where ++ S2: BuildHasher + Sync, ++ { ++ if self.len() <= other.len() { ++ self.par_iter().all(move |value| !other.contains(value)) ++ } else { ++ other.par_iter().all(move |value| !self.contains(value)) ++ } ++ } ++ ++ /// Returns `true` if all elements of `other` are contained in `self`, ++ /// determined in parallel. ++ pub fn par_is_superset(&self, other: &IndexSet) -> bool ++ where ++ S2: BuildHasher + Sync, ++ { ++ other.par_is_subset(self) ++ } ++ ++ /// Returns `true` if all elements of `self` are contained in `other`, ++ /// determined in parallel. ++ pub fn par_is_subset(&self, other: &IndexSet) -> bool ++ where ++ S2: BuildHasher + Sync, ++ { ++ self.len() <= other.len() && self.par_iter().all(move |value| other.contains(value)) ++ } ++} ++ ++/// A parallel iterator producing elements in the difference of [`IndexSet`]s. ++/// ++/// This `struct` is created by the [`IndexSet::par_difference`] method. ++/// See its documentation for more. ++pub struct ParDifference<'a, T, S1, S2> { ++ set1: &'a IndexSet, ++ set2: &'a IndexSet, ++} ++ ++impl Clone for ParDifference<'_, T, S1, S2> { ++ fn clone(&self) -> Self { ++ ParDifference { ..*self } ++ } ++} ++ ++impl fmt::Debug for ParDifference<'_, T, S1, S2> ++where ++ T: fmt::Debug + Eq + Hash, ++ S1: BuildHasher, ++ S2: BuildHasher, ++{ ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_list() ++ .entries(self.set1.difference(self.set2)) ++ .finish() ++ } ++} ++ ++impl<'a, T, S1, S2> ParallelIterator for ParDifference<'a, T, S1, S2> ++where ++ T: Hash + Eq + Sync, ++ S1: BuildHasher + Sync, ++ S2: BuildHasher + Sync, ++{ ++ type Item = &'a T; ++ ++ fn drive_unindexed(self, consumer: C) -> C::Result ++ where ++ C: UnindexedConsumer, ++ { ++ let Self { set1, set2 } = self; ++ ++ set1.par_iter() ++ .filter(move |&item| !set2.contains(item)) ++ .drive_unindexed(consumer) ++ } ++} ++ ++/// A parallel iterator producing elements in the intersection of [`IndexSet`]s. ++/// ++/// This `struct` is created by the [`IndexSet::par_intersection`] method. ++/// See its documentation for more. ++pub struct ParIntersection<'a, T, S1, S2> { ++ set1: &'a IndexSet, ++ set2: &'a IndexSet, ++} ++ ++impl Clone for ParIntersection<'_, T, S1, S2> { ++ fn clone(&self) -> Self { ++ ParIntersection { ..*self } ++ } ++} ++ ++impl fmt::Debug for ParIntersection<'_, T, S1, S2> ++where ++ T: fmt::Debug + Eq + Hash, ++ S1: BuildHasher, ++ S2: BuildHasher, ++{ ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_list() ++ .entries(self.set1.intersection(self.set2)) ++ .finish() ++ } ++} ++ ++impl<'a, T, S1, S2> ParallelIterator for ParIntersection<'a, T, S1, S2> ++where ++ T: Hash + Eq + Sync, ++ S1: BuildHasher + Sync, ++ S2: BuildHasher + Sync, ++{ ++ type Item = &'a T; ++ ++ fn drive_unindexed(self, consumer: C) -> C::Result ++ where ++ C: UnindexedConsumer, ++ { ++ let Self { set1, set2 } = self; ++ ++ set1.par_iter() ++ .filter(move |&item| set2.contains(item)) ++ .drive_unindexed(consumer) ++ } ++} ++ ++/// A parallel iterator producing elements in the symmetric difference of [`IndexSet`]s. ++/// ++/// This `struct` is created by the [`IndexSet::par_symmetric_difference`] method. ++/// See its documentation for more. ++pub struct ParSymmetricDifference<'a, T, S1, S2> { ++ set1: &'a IndexSet, ++ set2: &'a IndexSet, ++} ++ ++impl Clone for ParSymmetricDifference<'_, T, S1, S2> { ++ fn clone(&self) -> Self { ++ ParSymmetricDifference { ..*self } ++ } ++} ++ ++impl fmt::Debug for ParSymmetricDifference<'_, T, S1, S2> ++where ++ T: fmt::Debug + Eq + Hash, ++ S1: BuildHasher, ++ S2: BuildHasher, ++{ ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_list() ++ .entries(self.set1.symmetric_difference(self.set2)) ++ .finish() ++ } ++} ++ ++impl<'a, T, S1, S2> ParallelIterator for ParSymmetricDifference<'a, T, S1, S2> ++where ++ T: Hash + Eq + Sync, ++ S1: BuildHasher + Sync, ++ S2: BuildHasher + Sync, ++{ ++ type Item = &'a T; ++ ++ fn drive_unindexed(self, consumer: C) -> C::Result ++ where ++ C: UnindexedConsumer, ++ { ++ let Self { set1, set2 } = self; ++ ++ set1.par_difference(set2) ++ .chain(set2.par_difference(set1)) ++ .drive_unindexed(consumer) ++ } ++} ++ ++/// A parallel iterator producing elements in the union of [`IndexSet`]s. ++/// ++/// This `struct` is created by the [`IndexSet::par_union`] method. ++/// See its documentation for more. ++pub struct ParUnion<'a, T, S1, S2> { ++ set1: &'a IndexSet, ++ set2: &'a IndexSet, ++} ++ ++impl Clone for ParUnion<'_, T, S1, S2> { ++ fn clone(&self) -> Self { ++ ParUnion { ..*self } ++ } ++} ++ ++impl fmt::Debug for ParUnion<'_, T, S1, S2> ++where ++ T: fmt::Debug + Eq + Hash, ++ S1: BuildHasher, ++ S2: BuildHasher, ++{ ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_list().entries(self.set1.union(self.set2)).finish() ++ } ++} ++ ++impl<'a, T, S1, S2> ParallelIterator for ParUnion<'a, T, S1, S2> ++where ++ T: Hash + Eq + Sync, ++ S1: BuildHasher + Sync, ++ S2: BuildHasher + Sync, ++{ ++ type Item = &'a T; ++ ++ fn drive_unindexed(self, consumer: C) -> C::Result ++ where ++ C: UnindexedConsumer, ++ { ++ let Self { set1, set2 } = self; ++ ++ set1.par_iter() ++ .chain(set2.par_difference(set1)) ++ .drive_unindexed(consumer) ++ } ++} ++ ++/// Parallel sorting methods. ++/// ++/// The following methods **require crate feature `"rayon"`**. ++impl IndexSet ++where ++ T: Send, ++{ ++ /// Sort the set’s values in parallel by their default ordering. ++ pub fn par_sort(&mut self) ++ where ++ T: Ord, ++ { ++ self.with_entries(|entries| { ++ entries.par_sort_by(|a, b| T::cmp(&a.key, &b.key)); ++ }); ++ } ++ ++ /// Sort the set’s values in place and in parallel, using the comparison function `cmp`. ++ pub fn par_sort_by(&mut self, cmp: F) ++ where ++ F: Fn(&T, &T) -> Ordering + Sync, ++ { ++ self.with_entries(|entries| { ++ entries.par_sort_by(move |a, b| cmp(&a.key, &b.key)); ++ }); ++ } ++ ++ /// Sort the values of the set in parallel and return a by-value parallel iterator of ++ /// the values with the result. ++ pub fn par_sorted_by(self, cmp: F) -> IntoParIter ++ where ++ F: Fn(&T, &T) -> Ordering + Sync, ++ { ++ let mut entries = self.into_entries(); ++ entries.par_sort_by(move |a, b| cmp(&a.key, &b.key)); ++ IntoParIter { entries } ++ } ++ ++ /// Sort the set's values in parallel by their default ordering. ++ pub fn par_sort_unstable(&mut self) ++ where ++ T: Ord, ++ { ++ self.with_entries(|entries| { ++ entries.par_sort_unstable_by(|a, b| T::cmp(&a.key, &b.key)); ++ }); ++ } ++ ++ /// Sort the set’s values in place and in parallel, using the comparison function `cmp`. ++ pub fn par_sort_unstable_by(&mut self, cmp: F) ++ where ++ F: Fn(&T, &T) -> Ordering + Sync, ++ { ++ self.with_entries(|entries| { ++ entries.par_sort_unstable_by(move |a, b| cmp(&a.key, &b.key)); ++ }); ++ } ++ ++ /// Sort the values of the set in parallel and return a by-value parallel iterator of ++ /// the values with the result. ++ pub fn par_sorted_unstable_by(self, cmp: F) -> IntoParIter ++ where ++ F: Fn(&T, &T) -> Ordering + Sync, ++ { ++ let mut entries = self.into_entries(); ++ entries.par_sort_unstable_by(move |a, b| cmp(&a.key, &b.key)); ++ IntoParIter { entries } ++ } ++ ++ /// Sort the set’s values in place and in parallel, using a key extraction function. ++ pub fn par_sort_by_cached_key(&mut self, sort_key: F) ++ where ++ K: Ord + Send, ++ F: Fn(&T) -> K + Sync, ++ { ++ self.with_entries(move |entries| { ++ entries.par_sort_by_cached_key(move |a| sort_key(&a.key)); ++ }); ++ } ++} ++ ++impl FromParallelIterator for IndexSet ++where ++ T: Eq + Hash + Send, ++ S: BuildHasher + Default + Send, ++{ ++ fn from_par_iter(iter: I) -> Self ++ where ++ I: IntoParallelIterator, ++ { ++ let list = collect(iter); ++ let len = list.iter().map(Vec::len).sum(); ++ let mut set = Self::with_capacity_and_hasher(len, S::default()); ++ for vec in list { ++ set.extend(vec); ++ } ++ set ++ } ++} ++ ++impl ParallelExtend for IndexSet ++where ++ T: Eq + Hash + Send, ++ S: BuildHasher + Send, ++{ ++ fn par_extend(&mut self, iter: I) ++ where ++ I: IntoParallelIterator, ++ { ++ for vec in collect(iter) { ++ self.extend(vec); ++ } ++ } ++} ++ ++impl<'a, T: 'a, S> ParallelExtend<&'a T> for IndexSet ++where ++ T: Copy + Eq + Hash + Send + Sync, ++ S: BuildHasher + Send, ++{ ++ fn par_extend(&mut self, iter: I) ++ where ++ I: IntoParallelIterator, ++ { ++ for vec in collect(iter) { ++ self.extend(vec); ++ } ++ } ++} ++ ++#[cfg(all(test, feature = "std"))] ++mod tests { ++ use super::*; ++ ++ #[test] ++ fn insert_order() { ++ let insert = [0, 4, 2, 12, 8, 7, 11, 5, 3, 17, 19, 22, 23]; ++ let mut set = IndexSet::new(); ++ ++ for &elt in &insert { ++ set.insert(elt); ++ } ++ ++ assert_eq!(set.par_iter().count(), set.len()); ++ assert_eq!(set.par_iter().count(), insert.len()); ++ insert.par_iter().zip(&set).for_each(|(a, b)| { ++ assert_eq!(a, b); ++ }); ++ (0..insert.len()) ++ .into_par_iter() ++ .zip(&set) ++ .for_each(|(i, v)| { ++ assert_eq!(set.get_index(i).unwrap(), v); ++ }); ++ } ++ ++ #[test] ++ fn partial_eq_and_eq() { ++ let mut set_a = IndexSet::new(); ++ set_a.insert(1); ++ set_a.insert(2); ++ let mut set_b = set_a.clone(); ++ assert!(set_a.par_eq(&set_b)); ++ set_b.swap_remove(&1); ++ assert!(!set_a.par_eq(&set_b)); ++ set_b.insert(3); ++ assert!(!set_a.par_eq(&set_b)); ++ ++ let set_c: IndexSet<_> = set_b.into_par_iter().collect(); ++ assert!(!set_a.par_eq(&set_c)); ++ assert!(!set_c.par_eq(&set_a)); ++ } ++ ++ #[test] ++ fn extend() { ++ let mut set = IndexSet::new(); ++ set.par_extend(vec![&1, &2, &3, &4]); ++ set.par_extend(vec![5, 6]); ++ assert_eq!( ++ set.into_par_iter().collect::>(), ++ vec![1, 2, 3, 4, 5, 6] ++ ); ++ } ++ ++ #[test] ++ fn comparisons() { ++ let set_a: IndexSet<_> = (0..3).collect(); ++ let set_b: IndexSet<_> = (3..6).collect(); ++ let set_c: IndexSet<_> = (0..6).collect(); ++ let set_d: IndexSet<_> = (3..9).collect(); ++ ++ assert!(!set_a.par_is_disjoint(&set_a)); ++ assert!(set_a.par_is_subset(&set_a)); ++ assert!(set_a.par_is_superset(&set_a)); ++ ++ assert!(set_a.par_is_disjoint(&set_b)); ++ assert!(set_b.par_is_disjoint(&set_a)); ++ assert!(!set_a.par_is_subset(&set_b)); ++ assert!(!set_b.par_is_subset(&set_a)); ++ assert!(!set_a.par_is_superset(&set_b)); ++ assert!(!set_b.par_is_superset(&set_a)); ++ ++ assert!(!set_a.par_is_disjoint(&set_c)); ++ assert!(!set_c.par_is_disjoint(&set_a)); ++ assert!(set_a.par_is_subset(&set_c)); ++ assert!(!set_c.par_is_subset(&set_a)); ++ assert!(!set_a.par_is_superset(&set_c)); ++ assert!(set_c.par_is_superset(&set_a)); ++ ++ assert!(!set_c.par_is_disjoint(&set_d)); ++ assert!(!set_d.par_is_disjoint(&set_c)); ++ assert!(!set_c.par_is_subset(&set_d)); ++ assert!(!set_d.par_is_subset(&set_c)); ++ assert!(!set_c.par_is_superset(&set_d)); ++ assert!(!set_d.par_is_superset(&set_c)); ++ } ++ ++ #[test] ++ fn iter_comparisons() { ++ use std::iter::empty; ++ ++ fn check<'a, I1, I2>(iter1: I1, iter2: I2) ++ where ++ I1: ParallelIterator, ++ I2: Iterator, ++ { ++ let v1: Vec<_> = iter1.copied().collect(); ++ let v2: Vec<_> = iter2.collect(); ++ assert_eq!(v1, v2); ++ } ++ ++ let set_a: IndexSet<_> = (0..3).collect(); ++ let set_b: IndexSet<_> = (3..6).collect(); ++ let set_c: IndexSet<_> = (0..6).collect(); ++ let set_d: IndexSet<_> = (3..9).rev().collect(); ++ ++ check(set_a.par_difference(&set_a), empty()); ++ check(set_a.par_symmetric_difference(&set_a), empty()); ++ check(set_a.par_intersection(&set_a), 0..3); ++ check(set_a.par_union(&set_a), 0..3); ++ ++ check(set_a.par_difference(&set_b), 0..3); ++ check(set_b.par_difference(&set_a), 3..6); ++ check(set_a.par_symmetric_difference(&set_b), 0..6); ++ check(set_b.par_symmetric_difference(&set_a), (3..6).chain(0..3)); ++ check(set_a.par_intersection(&set_b), empty()); ++ check(set_b.par_intersection(&set_a), empty()); ++ check(set_a.par_union(&set_b), 0..6); ++ check(set_b.par_union(&set_a), (3..6).chain(0..3)); ++ ++ check(set_a.par_difference(&set_c), empty()); ++ check(set_c.par_difference(&set_a), 3..6); ++ check(set_a.par_symmetric_difference(&set_c), 3..6); ++ check(set_c.par_symmetric_difference(&set_a), 3..6); ++ check(set_a.par_intersection(&set_c), 0..3); ++ check(set_c.par_intersection(&set_a), 0..3); ++ check(set_a.par_union(&set_c), 0..6); ++ check(set_c.par_union(&set_a), 0..6); ++ ++ check(set_c.par_difference(&set_d), 0..3); ++ check(set_d.par_difference(&set_c), (6..9).rev()); ++ check( ++ set_c.par_symmetric_difference(&set_d), ++ (0..3).chain((6..9).rev()), ++ ); ++ check( ++ set_d.par_symmetric_difference(&set_c), ++ (6..9).rev().chain(0..3), ++ ); ++ check(set_c.par_intersection(&set_d), 3..6); ++ check(set_d.par_intersection(&set_c), (3..6).rev()); ++ check(set_c.par_union(&set_d), (0..6).chain((6..9).rev())); ++ check(set_d.par_union(&set_c), (3..9).rev().chain(0..3)); ++ } ++} +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/src/rustc.rs mesa-25.3.3/subprojects/indexmap-2.7.0/src/rustc.rs +--- mesa-25.3.3/subprojects/indexmap-2.7.0/src/rustc.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/src/rustc.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,158 @@ ++//! Minimal support for `rustc-rayon`, not intended for general use. ++ ++use crate::vec::Vec; ++use crate::{Bucket, Entries, IndexMap, IndexSet}; ++ ++use rustc_rayon::iter::plumbing::{Consumer, ProducerCallback, UnindexedConsumer}; ++use rustc_rayon::iter::{IndexedParallelIterator, IntoParallelIterator, ParallelIterator}; ++ ++mod map { ++ use super::*; ++ ++ impl IntoParallelIterator for IndexMap ++ where ++ K: Send, ++ V: Send, ++ { ++ type Item = (K, V); ++ type Iter = IntoParIter; ++ ++ fn into_par_iter(self) -> Self::Iter { ++ IntoParIter { ++ entries: self.into_entries(), ++ } ++ } ++ } ++ ++ pub struct IntoParIter { ++ entries: Vec>, ++ } ++ ++ impl ParallelIterator for IntoParIter { ++ type Item = (K, V); ++ ++ parallel_iterator_methods!(Bucket::key_value); ++ } ++ ++ impl IndexedParallelIterator for IntoParIter { ++ indexed_parallel_iterator_methods!(Bucket::key_value); ++ } ++ ++ impl<'a, K, V, S> IntoParallelIterator for &'a IndexMap ++ where ++ K: Sync, ++ V: Sync, ++ { ++ type Item = (&'a K, &'a V); ++ type Iter = ParIter<'a, K, V>; ++ ++ fn into_par_iter(self) -> Self::Iter { ++ ParIter { ++ entries: self.as_entries(), ++ } ++ } ++ } ++ ++ pub struct ParIter<'a, K, V> { ++ entries: &'a [Bucket], ++ } ++ ++ impl<'a, K: Sync, V: Sync> ParallelIterator for ParIter<'a, K, V> { ++ type Item = (&'a K, &'a V); ++ ++ parallel_iterator_methods!(Bucket::refs); ++ } ++ ++ impl IndexedParallelIterator for ParIter<'_, K, V> { ++ indexed_parallel_iterator_methods!(Bucket::refs); ++ } ++ ++ impl<'a, K, V, S> IntoParallelIterator for &'a mut IndexMap ++ where ++ K: Sync + Send, ++ V: Send, ++ { ++ type Item = (&'a K, &'a mut V); ++ type Iter = ParIterMut<'a, K, V>; ++ ++ fn into_par_iter(self) -> Self::Iter { ++ ParIterMut { ++ entries: self.as_entries_mut(), ++ } ++ } ++ } ++ ++ pub struct ParIterMut<'a, K, V> { ++ entries: &'a mut [Bucket], ++ } ++ ++ impl<'a, K: Sync + Send, V: Send> ParallelIterator for ParIterMut<'a, K, V> { ++ type Item = (&'a K, &'a mut V); ++ ++ parallel_iterator_methods!(Bucket::ref_mut); ++ } ++ ++ impl IndexedParallelIterator for ParIterMut<'_, K, V> { ++ indexed_parallel_iterator_methods!(Bucket::ref_mut); ++ } ++} ++ ++mod set { ++ use super::*; ++ ++ impl IntoParallelIterator for IndexSet ++ where ++ T: Send, ++ { ++ type Item = T; ++ type Iter = IntoParIter; ++ ++ fn into_par_iter(self) -> Self::Iter { ++ IntoParIter { ++ entries: self.into_entries(), ++ } ++ } ++ } ++ ++ pub struct IntoParIter { ++ entries: Vec>, ++ } ++ ++ impl ParallelIterator for IntoParIter { ++ type Item = T; ++ ++ parallel_iterator_methods!(Bucket::key); ++ } ++ ++ impl IndexedParallelIterator for IntoParIter { ++ indexed_parallel_iterator_methods!(Bucket::key); ++ } ++ ++ impl<'a, T, S> IntoParallelIterator for &'a IndexSet ++ where ++ T: Sync, ++ { ++ type Item = &'a T; ++ type Iter = ParIter<'a, T>; ++ ++ fn into_par_iter(self) -> Self::Iter { ++ ParIter { ++ entries: self.as_entries(), ++ } ++ } ++ } ++ ++ pub struct ParIter<'a, T> { ++ entries: &'a [Bucket], ++ } ++ ++ impl<'a, T: Sync> ParallelIterator for ParIter<'a, T> { ++ type Item = &'a T; ++ ++ parallel_iterator_methods!(Bucket::key_ref); ++ } ++ ++ impl IndexedParallelIterator for ParIter<'_, T> { ++ indexed_parallel_iterator_methods!(Bucket::key_ref); ++ } ++} +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/src/serde.rs mesa-25.3.3/subprojects/indexmap-2.7.0/src/serde.rs +--- mesa-25.3.3/subprojects/indexmap-2.7.0/src/serde.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/src/serde.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,166 @@ ++#![cfg_attr(docsrs, doc(cfg(feature = "serde")))] ++ ++use serde::de::value::{MapDeserializer, SeqDeserializer}; ++use serde::de::{ ++ Deserialize, Deserializer, Error, IntoDeserializer, MapAccess, SeqAccess, Visitor, ++}; ++use serde::ser::{Serialize, Serializer}; ++ ++use core::fmt::{self, Formatter}; ++use core::hash::{BuildHasher, Hash}; ++use core::marker::PhantomData; ++use core::{cmp, mem}; ++ ++use crate::{Bucket, IndexMap, IndexSet}; ++ ++/// Limit our preallocated capacity from a deserializer `size_hint()`. ++/// ++/// We do account for the `Bucket` overhead from its saved `hash` field, but we don't count the ++/// `RawTable` allocation or the fact that its raw capacity will be rounded up to a power of two. ++/// The "max" is an arbitrary choice anyway, not something that needs precise adherence. ++/// ++/// This is based on the internal `serde::de::size_hint::cautious(hint)` function. ++pub(crate) fn cautious_capacity(hint: Option) -> usize { ++ const MAX_PREALLOC_BYTES: usize = 1024 * 1024; ++ ++ cmp::min( ++ hint.unwrap_or(0), ++ MAX_PREALLOC_BYTES / mem::size_of::>(), ++ ) ++} ++ ++impl Serialize for IndexMap ++where ++ K: Serialize, ++ V: Serialize, ++{ ++ fn serialize(&self, serializer: T) -> Result ++ where ++ T: Serializer, ++ { ++ serializer.collect_map(self) ++ } ++} ++ ++struct IndexMapVisitor(PhantomData<(K, V, S)>); ++ ++impl<'de, K, V, S> Visitor<'de> for IndexMapVisitor ++where ++ K: Deserialize<'de> + Eq + Hash, ++ V: Deserialize<'de>, ++ S: Default + BuildHasher, ++{ ++ type Value = IndexMap; ++ ++ fn expecting(&self, formatter: &mut Formatter<'_>) -> fmt::Result { ++ write!(formatter, "a map") ++ } ++ ++ fn visit_map(self, mut map: A) -> Result ++ where ++ A: MapAccess<'de>, ++ { ++ let capacity = cautious_capacity::(map.size_hint()); ++ let mut values = IndexMap::with_capacity_and_hasher(capacity, S::default()); ++ ++ while let Some((key, value)) = map.next_entry()? { ++ values.insert(key, value); ++ } ++ ++ Ok(values) ++ } ++} ++ ++impl<'de, K, V, S> Deserialize<'de> for IndexMap ++where ++ K: Deserialize<'de> + Eq + Hash, ++ V: Deserialize<'de>, ++ S: Default + BuildHasher, ++{ ++ fn deserialize(deserializer: D) -> Result ++ where ++ D: Deserializer<'de>, ++ { ++ deserializer.deserialize_map(IndexMapVisitor(PhantomData)) ++ } ++} ++ ++impl<'de, K, V, S, E> IntoDeserializer<'de, E> for IndexMap ++where ++ K: IntoDeserializer<'de, E> + Eq + Hash, ++ V: IntoDeserializer<'de, E>, ++ S: BuildHasher, ++ E: Error, ++{ ++ type Deserializer = MapDeserializer<'de, ::IntoIter, E>; ++ ++ fn into_deserializer(self) -> Self::Deserializer { ++ MapDeserializer::new(self.into_iter()) ++ } ++} ++ ++impl Serialize for IndexSet ++where ++ T: Serialize, ++{ ++ fn serialize(&self, serializer: Se) -> Result ++ where ++ Se: Serializer, ++ { ++ serializer.collect_seq(self) ++ } ++} ++ ++struct IndexSetVisitor(PhantomData<(T, S)>); ++ ++impl<'de, T, S> Visitor<'de> for IndexSetVisitor ++where ++ T: Deserialize<'de> + Eq + Hash, ++ S: Default + BuildHasher, ++{ ++ type Value = IndexSet; ++ ++ fn expecting(&self, formatter: &mut Formatter<'_>) -> fmt::Result { ++ write!(formatter, "a set") ++ } ++ ++ fn visit_seq(self, mut seq: A) -> Result ++ where ++ A: SeqAccess<'de>, ++ { ++ let capacity = cautious_capacity::(seq.size_hint()); ++ let mut values = IndexSet::with_capacity_and_hasher(capacity, S::default()); ++ ++ while let Some(value) = seq.next_element()? { ++ values.insert(value); ++ } ++ ++ Ok(values) ++ } ++} ++ ++impl<'de, T, S> Deserialize<'de> for IndexSet ++where ++ T: Deserialize<'de> + Eq + Hash, ++ S: Default + BuildHasher, ++{ ++ fn deserialize(deserializer: D) -> Result ++ where ++ D: Deserializer<'de>, ++ { ++ deserializer.deserialize_seq(IndexSetVisitor(PhantomData)) ++ } ++} ++ ++impl<'de, T, S, E> IntoDeserializer<'de, E> for IndexSet ++where ++ T: IntoDeserializer<'de, E> + Eq + Hash, ++ S: BuildHasher, ++ E: Error, ++{ ++ type Deserializer = SeqDeserializer<::IntoIter, E>; ++ ++ fn into_deserializer(self) -> Self::Deserializer { ++ SeqDeserializer::new(self.into_iter()) ++ } ++} +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/src/set/iter.rs mesa-25.3.3/subprojects/indexmap-2.7.0/src/set/iter.rs +--- mesa-25.3.3/subprojects/indexmap-2.7.0/src/set/iter.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/src/set/iter.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,627 @@ ++use super::{Bucket, Entries, IndexSet, Slice}; ++ ++use alloc::vec::{self, Vec}; ++use core::fmt; ++use core::hash::{BuildHasher, Hash}; ++use core::iter::{Chain, FusedIterator}; ++use core::ops::RangeBounds; ++use core::slice::Iter as SliceIter; ++ ++impl<'a, T, S> IntoIterator for &'a IndexSet { ++ type Item = &'a T; ++ type IntoIter = Iter<'a, T>; ++ ++ fn into_iter(self) -> Self::IntoIter { ++ self.iter() ++ } ++} ++ ++impl IntoIterator for IndexSet { ++ type Item = T; ++ type IntoIter = IntoIter; ++ ++ fn into_iter(self) -> Self::IntoIter { ++ IntoIter::new(self.into_entries()) ++ } ++} ++ ++/// An iterator over the items of an [`IndexSet`]. ++/// ++/// This `struct` is created by the [`IndexSet::iter`] method. ++/// See its documentation for more. ++pub struct Iter<'a, T> { ++ iter: SliceIter<'a, Bucket>, ++} ++ ++impl<'a, T> Iter<'a, T> { ++ pub(super) fn new(entries: &'a [Bucket]) -> Self { ++ Self { ++ iter: entries.iter(), ++ } ++ } ++ ++ /// Returns a slice of the remaining entries in the iterator. ++ pub fn as_slice(&self) -> &'a Slice { ++ Slice::from_slice(self.iter.as_slice()) ++ } ++} ++ ++impl<'a, T> Iterator for Iter<'a, T> { ++ type Item = &'a T; ++ ++ iterator_methods!(Bucket::key_ref); ++} ++ ++impl DoubleEndedIterator for Iter<'_, T> { ++ double_ended_iterator_methods!(Bucket::key_ref); ++} ++ ++impl ExactSizeIterator for Iter<'_, T> { ++ fn len(&self) -> usize { ++ self.iter.len() ++ } ++} ++ ++impl FusedIterator for Iter<'_, T> {} ++ ++impl Clone for Iter<'_, T> { ++ fn clone(&self) -> Self { ++ Iter { ++ iter: self.iter.clone(), ++ } ++ } ++} ++ ++impl fmt::Debug for Iter<'_, T> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_list().entries(self.clone()).finish() ++ } ++} ++ ++impl Default for Iter<'_, T> { ++ fn default() -> Self { ++ Self { iter: [].iter() } ++ } ++} ++ ++/// An owning iterator over the items of an [`IndexSet`]. ++/// ++/// This `struct` is created by the [`IndexSet::into_iter`] method ++/// (provided by the [`IntoIterator`] trait). See its documentation for more. ++#[derive(Clone)] ++pub struct IntoIter { ++ iter: vec::IntoIter>, ++} ++ ++impl IntoIter { ++ pub(super) fn new(entries: Vec>) -> Self { ++ Self { ++ iter: entries.into_iter(), ++ } ++ } ++ ++ /// Returns a slice of the remaining entries in the iterator. ++ pub fn as_slice(&self) -> &Slice { ++ Slice::from_slice(self.iter.as_slice()) ++ } ++} ++ ++impl Iterator for IntoIter { ++ type Item = T; ++ ++ iterator_methods!(Bucket::key); ++} ++ ++impl DoubleEndedIterator for IntoIter { ++ double_ended_iterator_methods!(Bucket::key); ++} ++ ++impl ExactSizeIterator for IntoIter { ++ fn len(&self) -> usize { ++ self.iter.len() ++ } ++} ++ ++impl FusedIterator for IntoIter {} ++ ++impl fmt::Debug for IntoIter { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ let iter = self.iter.as_slice().iter().map(Bucket::key_ref); ++ f.debug_list().entries(iter).finish() ++ } ++} ++ ++impl Default for IntoIter { ++ fn default() -> Self { ++ Self { ++ iter: Vec::new().into_iter(), ++ } ++ } ++} ++ ++/// A draining iterator over the items of an [`IndexSet`]. ++/// ++/// This `struct` is created by the [`IndexSet::drain`] method. ++/// See its documentation for more. ++pub struct Drain<'a, T> { ++ iter: vec::Drain<'a, Bucket>, ++} ++ ++impl<'a, T> Drain<'a, T> { ++ pub(super) fn new(iter: vec::Drain<'a, Bucket>) -> Self { ++ Self { iter } ++ } ++ ++ /// Returns a slice of the remaining entries in the iterator. ++ pub fn as_slice(&self) -> &Slice { ++ Slice::from_slice(self.iter.as_slice()) ++ } ++} ++ ++impl Iterator for Drain<'_, T> { ++ type Item = T; ++ ++ iterator_methods!(Bucket::key); ++} ++ ++impl DoubleEndedIterator for Drain<'_, T> { ++ double_ended_iterator_methods!(Bucket::key); ++} ++ ++impl ExactSizeIterator for Drain<'_, T> { ++ fn len(&self) -> usize { ++ self.iter.len() ++ } ++} ++ ++impl FusedIterator for Drain<'_, T> {} ++ ++impl fmt::Debug for Drain<'_, T> { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ let iter = self.iter.as_slice().iter().map(Bucket::key_ref); ++ f.debug_list().entries(iter).finish() ++ } ++} ++ ++/// A lazy iterator producing elements in the difference of [`IndexSet`]s. ++/// ++/// This `struct` is created by the [`IndexSet::difference`] method. ++/// See its documentation for more. ++pub struct Difference<'a, T, S> { ++ iter: Iter<'a, T>, ++ other: &'a IndexSet, ++} ++ ++impl<'a, T, S> Difference<'a, T, S> { ++ pub(super) fn new(set: &'a IndexSet, other: &'a IndexSet) -> Self { ++ Self { ++ iter: set.iter(), ++ other, ++ } ++ } ++} ++ ++impl<'a, T, S> Iterator for Difference<'a, T, S> ++where ++ T: Eq + Hash, ++ S: BuildHasher, ++{ ++ type Item = &'a T; ++ ++ fn next(&mut self) -> Option { ++ while let Some(item) = self.iter.next() { ++ if !self.other.contains(item) { ++ return Some(item); ++ } ++ } ++ None ++ } ++ ++ fn size_hint(&self) -> (usize, Option) { ++ (0, self.iter.size_hint().1) ++ } ++} ++ ++impl DoubleEndedIterator for Difference<'_, T, S> ++where ++ T: Eq + Hash, ++ S: BuildHasher, ++{ ++ fn next_back(&mut self) -> Option { ++ while let Some(item) = self.iter.next_back() { ++ if !self.other.contains(item) { ++ return Some(item); ++ } ++ } ++ None ++ } ++} ++ ++impl FusedIterator for Difference<'_, T, S> ++where ++ T: Eq + Hash, ++ S: BuildHasher, ++{ ++} ++ ++impl Clone for Difference<'_, T, S> { ++ fn clone(&self) -> Self { ++ Difference { ++ iter: self.iter.clone(), ++ ..*self ++ } ++ } ++} ++ ++impl fmt::Debug for Difference<'_, T, S> ++where ++ T: fmt::Debug + Eq + Hash, ++ S: BuildHasher, ++{ ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_list().entries(self.clone()).finish() ++ } ++} ++ ++/// A lazy iterator producing elements in the intersection of [`IndexSet`]s. ++/// ++/// This `struct` is created by the [`IndexSet::intersection`] method. ++/// See its documentation for more. ++pub struct Intersection<'a, T, S> { ++ iter: Iter<'a, T>, ++ other: &'a IndexSet, ++} ++ ++impl<'a, T, S> Intersection<'a, T, S> { ++ pub(super) fn new(set: &'a IndexSet, other: &'a IndexSet) -> Self { ++ Self { ++ iter: set.iter(), ++ other, ++ } ++ } ++} ++ ++impl<'a, T, S> Iterator for Intersection<'a, T, S> ++where ++ T: Eq + Hash, ++ S: BuildHasher, ++{ ++ type Item = &'a T; ++ ++ fn next(&mut self) -> Option { ++ while let Some(item) = self.iter.next() { ++ if self.other.contains(item) { ++ return Some(item); ++ } ++ } ++ None ++ } ++ ++ fn size_hint(&self) -> (usize, Option) { ++ (0, self.iter.size_hint().1) ++ } ++} ++ ++impl DoubleEndedIterator for Intersection<'_, T, S> ++where ++ T: Eq + Hash, ++ S: BuildHasher, ++{ ++ fn next_back(&mut self) -> Option { ++ while let Some(item) = self.iter.next_back() { ++ if self.other.contains(item) { ++ return Some(item); ++ } ++ } ++ None ++ } ++} ++ ++impl FusedIterator for Intersection<'_, T, S> ++where ++ T: Eq + Hash, ++ S: BuildHasher, ++{ ++} ++ ++impl Clone for Intersection<'_, T, S> { ++ fn clone(&self) -> Self { ++ Intersection { ++ iter: self.iter.clone(), ++ ..*self ++ } ++ } ++} ++ ++impl fmt::Debug for Intersection<'_, T, S> ++where ++ T: fmt::Debug + Eq + Hash, ++ S: BuildHasher, ++{ ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_list().entries(self.clone()).finish() ++ } ++} ++ ++/// A lazy iterator producing elements in the symmetric difference of [`IndexSet`]s. ++/// ++/// This `struct` is created by the [`IndexSet::symmetric_difference`] method. ++/// See its documentation for more. ++pub struct SymmetricDifference<'a, T, S1, S2> { ++ iter: Chain, Difference<'a, T, S1>>, ++} ++ ++impl<'a, T, S1, S2> SymmetricDifference<'a, T, S1, S2> ++where ++ T: Eq + Hash, ++ S1: BuildHasher, ++ S2: BuildHasher, ++{ ++ pub(super) fn new(set1: &'a IndexSet, set2: &'a IndexSet) -> Self { ++ let diff1 = set1.difference(set2); ++ let diff2 = set2.difference(set1); ++ Self { ++ iter: diff1.chain(diff2), ++ } ++ } ++} ++ ++impl<'a, T, S1, S2> Iterator for SymmetricDifference<'a, T, S1, S2> ++where ++ T: Eq + Hash, ++ S1: BuildHasher, ++ S2: BuildHasher, ++{ ++ type Item = &'a T; ++ ++ fn next(&mut self) -> Option { ++ self.iter.next() ++ } ++ ++ fn size_hint(&self) -> (usize, Option) { ++ self.iter.size_hint() ++ } ++ ++ fn fold(self, init: B, f: F) -> B ++ where ++ F: FnMut(B, Self::Item) -> B, ++ { ++ self.iter.fold(init, f) ++ } ++} ++ ++impl DoubleEndedIterator for SymmetricDifference<'_, T, S1, S2> ++where ++ T: Eq + Hash, ++ S1: BuildHasher, ++ S2: BuildHasher, ++{ ++ fn next_back(&mut self) -> Option { ++ self.iter.next_back() ++ } ++ ++ fn rfold(self, init: B, f: F) -> B ++ where ++ F: FnMut(B, Self::Item) -> B, ++ { ++ self.iter.rfold(init, f) ++ } ++} ++ ++impl FusedIterator for SymmetricDifference<'_, T, S1, S2> ++where ++ T: Eq + Hash, ++ S1: BuildHasher, ++ S2: BuildHasher, ++{ ++} ++ ++impl Clone for SymmetricDifference<'_, T, S1, S2> { ++ fn clone(&self) -> Self { ++ SymmetricDifference { ++ iter: self.iter.clone(), ++ } ++ } ++} ++ ++impl fmt::Debug for SymmetricDifference<'_, T, S1, S2> ++where ++ T: fmt::Debug + Eq + Hash, ++ S1: BuildHasher, ++ S2: BuildHasher, ++{ ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_list().entries(self.clone()).finish() ++ } ++} ++ ++/// A lazy iterator producing elements in the union of [`IndexSet`]s. ++/// ++/// This `struct` is created by the [`IndexSet::union`] method. ++/// See its documentation for more. ++pub struct Union<'a, T, S> { ++ iter: Chain, Difference<'a, T, S>>, ++} ++ ++impl<'a, T, S> Union<'a, T, S> ++where ++ T: Eq + Hash, ++ S: BuildHasher, ++{ ++ pub(super) fn new(set1: &'a IndexSet, set2: &'a IndexSet) -> Self ++ where ++ S2: BuildHasher, ++ { ++ Self { ++ iter: set1.iter().chain(set2.difference(set1)), ++ } ++ } ++} ++ ++impl<'a, T, S> Iterator for Union<'a, T, S> ++where ++ T: Eq + Hash, ++ S: BuildHasher, ++{ ++ type Item = &'a T; ++ ++ fn next(&mut self) -> Option { ++ self.iter.next() ++ } ++ ++ fn size_hint(&self) -> (usize, Option) { ++ self.iter.size_hint() ++ } ++ ++ fn fold(self, init: B, f: F) -> B ++ where ++ F: FnMut(B, Self::Item) -> B, ++ { ++ self.iter.fold(init, f) ++ } ++} ++ ++impl DoubleEndedIterator for Union<'_, T, S> ++where ++ T: Eq + Hash, ++ S: BuildHasher, ++{ ++ fn next_back(&mut self) -> Option { ++ self.iter.next_back() ++ } ++ ++ fn rfold(self, init: B, f: F) -> B ++ where ++ F: FnMut(B, Self::Item) -> B, ++ { ++ self.iter.rfold(init, f) ++ } ++} ++ ++impl FusedIterator for Union<'_, T, S> ++where ++ T: Eq + Hash, ++ S: BuildHasher, ++{ ++} ++ ++impl Clone for Union<'_, T, S> { ++ fn clone(&self) -> Self { ++ Union { ++ iter: self.iter.clone(), ++ } ++ } ++} ++ ++impl fmt::Debug for Union<'_, T, S> ++where ++ T: fmt::Debug + Eq + Hash, ++ S: BuildHasher, ++{ ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_list().entries(self.clone()).finish() ++ } ++} ++ ++/// A splicing iterator for `IndexSet`. ++/// ++/// This `struct` is created by [`IndexSet::splice()`]. ++/// See its documentation for more. ++pub struct Splice<'a, I, T, S> ++where ++ I: Iterator, ++ T: Hash + Eq, ++ S: BuildHasher, ++{ ++ iter: crate::map::Splice<'a, UnitValue, T, (), S>, ++} ++ ++impl<'a, I, T, S> Splice<'a, I, T, S> ++where ++ I: Iterator, ++ T: Hash + Eq, ++ S: BuildHasher, ++{ ++ pub(super) fn new(set: &'a mut IndexSet, range: R, replace_with: I) -> Self ++ where ++ R: RangeBounds, ++ { ++ Self { ++ iter: set.map.splice(range, UnitValue(replace_with)), ++ } ++ } ++} ++ ++impl Iterator for Splice<'_, I, T, S> ++where ++ I: Iterator, ++ T: Hash + Eq, ++ S: BuildHasher, ++{ ++ type Item = T; ++ ++ fn next(&mut self) -> Option { ++ Some(self.iter.next()?.0) ++ } ++ ++ fn size_hint(&self) -> (usize, Option) { ++ self.iter.size_hint() ++ } ++} ++ ++impl DoubleEndedIterator for Splice<'_, I, T, S> ++where ++ I: Iterator, ++ T: Hash + Eq, ++ S: BuildHasher, ++{ ++ fn next_back(&mut self) -> Option { ++ Some(self.iter.next_back()?.0) ++ } ++} ++ ++impl ExactSizeIterator for Splice<'_, I, T, S> ++where ++ I: Iterator, ++ T: Hash + Eq, ++ S: BuildHasher, ++{ ++ fn len(&self) -> usize { ++ self.iter.len() ++ } ++} ++ ++impl FusedIterator for Splice<'_, I, T, S> ++where ++ I: Iterator, ++ T: Hash + Eq, ++ S: BuildHasher, ++{ ++} ++ ++struct UnitValue(I); ++ ++impl Iterator for UnitValue { ++ type Item = (I::Item, ()); ++ ++ fn next(&mut self) -> Option { ++ self.0.next().map(|x| (x, ())) ++ } ++} ++ ++impl<'a, I, T, S> fmt::Debug for Splice<'a, I, T, S> ++where ++ I: fmt::Debug + Iterator, ++ T: fmt::Debug + Hash + Eq, ++ S: BuildHasher, ++{ ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ fmt::Debug::fmt(&self.iter, f) ++ } ++} ++ ++impl fmt::Debug for UnitValue { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ fmt::Debug::fmt(&self.0, f) ++ } ++} +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/src/set/mutable.rs mesa-25.3.3/subprojects/indexmap-2.7.0/src/set/mutable.rs +--- mesa-25.3.3/subprojects/indexmap-2.7.0/src/set/mutable.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/src/set/mutable.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,86 @@ ++use core::hash::{BuildHasher, Hash}; ++ ++use super::{Equivalent, IndexSet}; ++use crate::map::MutableKeys; ++ ++/// Opt-in mutable access to [`IndexSet`] values. ++/// ++/// These methods expose `&mut T`, mutable references to the value as it is stored ++/// in the set. ++/// You are allowed to modify the values in the set **if the modification ++/// does not change the value’s hash and equality**. ++/// ++/// If values are modified erroneously, you can no longer look them up. ++/// This is sound (memory safe) but a logical error hazard (just like ++/// implementing `PartialEq`, `Eq`, or `Hash` incorrectly would be). ++/// ++/// `use` this trait to enable its methods for `IndexSet`. ++/// ++/// This trait is sealed and cannot be implemented for types outside this crate. ++pub trait MutableValues: private::Sealed { ++ type Value; ++ ++ /// Return item index and mutable reference to the value ++ /// ++ /// Computes in **O(1)** time (average). ++ fn get_full_mut2(&mut self, value: &Q) -> Option<(usize, &mut Self::Value)> ++ where ++ Q: ?Sized + Hash + Equivalent; ++ ++ /// Return mutable reference to the value at an index. ++ /// ++ /// Valid indices are `0 <= index < self.len()`. ++ /// ++ /// Computes in **O(1)** time. ++ fn get_index_mut2(&mut self, index: usize) -> Option<&mut Self::Value>; ++ ++ /// Scan through each value in the set and keep those where the ++ /// closure `keep` returns `true`. ++ /// ++ /// The values are visited in order, and remaining values keep their order. ++ /// ++ /// Computes in **O(n)** time (average). ++ fn retain2(&mut self, keep: F) ++ where ++ F: FnMut(&mut Self::Value) -> bool; ++} ++ ++/// Opt-in mutable access to [`IndexSet`] values. ++/// ++/// See [`MutableValues`] for more information. ++impl MutableValues for IndexSet ++where ++ S: BuildHasher, ++{ ++ type Value = T; ++ ++ fn get_full_mut2(&mut self, value: &Q) -> Option<(usize, &mut T)> ++ where ++ Q: ?Sized + Hash + Equivalent, ++ { ++ match self.map.get_full_mut2(value) { ++ Some((index, value, ())) => Some((index, value)), ++ None => None, ++ } ++ } ++ ++ fn get_index_mut2(&mut self, index: usize) -> Option<&mut T> { ++ match self.map.get_index_mut2(index) { ++ Some((value, ())) => Some(value), ++ None => None, ++ } ++ } ++ ++ fn retain2(&mut self, mut keep: F) ++ where ++ F: FnMut(&mut T) -> bool, ++ { ++ self.map.retain2(move |value, ()| keep(value)); ++ } ++} ++ ++mod private { ++ pub trait Sealed {} ++ ++ impl Sealed for super::IndexSet {} ++} +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/src/set/slice.rs mesa-25.3.3/subprojects/indexmap-2.7.0/src/set/slice.rs +--- mesa-25.3.3/subprojects/indexmap-2.7.0/src/set/slice.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/src/set/slice.rs 2025-01-11 13:48:35.000000000 -0500 +@@ -0,0 +1,340 @@ ++use super::{Bucket, Entries, IndexSet, IntoIter, Iter}; ++use crate::util::try_simplify_range; ++ ++use alloc::boxed::Box; ++use alloc::vec::Vec; ++use core::cmp::Ordering; ++use core::fmt; ++use core::hash::{Hash, Hasher}; ++use core::ops::{self, Bound, Index, RangeBounds}; ++ ++/// A dynamically-sized slice of values in an [`IndexSet`]. ++/// ++/// This supports indexed operations much like a `[T]` slice, ++/// but not any hashed operations on the values. ++/// ++/// Unlike `IndexSet`, `Slice` does consider the order for [`PartialEq`] ++/// and [`Eq`], and it also implements [`PartialOrd`], [`Ord`], and [`Hash`]. ++#[repr(transparent)] ++pub struct Slice { ++ pub(crate) entries: [Bucket], ++} ++ ++// SAFETY: `Slice` is a transparent wrapper around `[Bucket]`, ++// and reference lifetimes are bound together in function signatures. ++#[allow(unsafe_code)] ++impl Slice { ++ pub(super) const fn from_slice(entries: &[Bucket]) -> &Self { ++ unsafe { &*(entries as *const [Bucket] as *const Self) } ++ } ++ ++ pub(super) fn from_boxed(entries: Box<[Bucket]>) -> Box { ++ unsafe { Box::from_raw(Box::into_raw(entries) as *mut Self) } ++ } ++ ++ fn into_boxed(self: Box) -> Box<[Bucket]> { ++ unsafe { Box::from_raw(Box::into_raw(self) as *mut [Bucket]) } ++ } ++} ++ ++impl Slice { ++ pub(crate) fn into_entries(self: Box) -> Vec> { ++ self.into_boxed().into_vec() ++ } ++ ++ /// Returns an empty slice. ++ pub const fn new<'a>() -> &'a Self { ++ Self::from_slice(&[]) ++ } ++ ++ /// Return the number of elements in the set slice. ++ pub const fn len(&self) -> usize { ++ self.entries.len() ++ } ++ ++ /// Returns true if the set slice contains no elements. ++ pub const fn is_empty(&self) -> bool { ++ self.entries.is_empty() ++ } ++ ++ /// Get a value by index. ++ /// ++ /// Valid indices are `0 <= index < self.len()`. ++ pub fn get_index(&self, index: usize) -> Option<&T> { ++ self.entries.get(index).map(Bucket::key_ref) ++ } ++ ++ /// Returns a slice of values in the given range of indices. ++ /// ++ /// Valid indices are `0 <= index < self.len()`. ++ pub fn get_range>(&self, range: R) -> Option<&Self> { ++ let range = try_simplify_range(range, self.entries.len())?; ++ self.entries.get(range).map(Self::from_slice) ++ } ++ ++ /// Get the first value. ++ pub fn first(&self) -> Option<&T> { ++ self.entries.first().map(Bucket::key_ref) ++ } ++ ++ /// Get the last value. ++ pub fn last(&self) -> Option<&T> { ++ self.entries.last().map(Bucket::key_ref) ++ } ++ ++ /// Divides one slice into two at an index. ++ /// ++ /// ***Panics*** if `index > len`. ++ pub fn split_at(&self, index: usize) -> (&Self, &Self) { ++ let (first, second) = self.entries.split_at(index); ++ (Self::from_slice(first), Self::from_slice(second)) ++ } ++ ++ /// Returns the first value and the rest of the slice, ++ /// or `None` if it is empty. ++ pub fn split_first(&self) -> Option<(&T, &Self)> { ++ if let [first, rest @ ..] = &self.entries { ++ Some((&first.key, Self::from_slice(rest))) ++ } else { ++ None ++ } ++ } ++ ++ /// Returns the last value and the rest of the slice, ++ /// or `None` if it is empty. ++ pub fn split_last(&self) -> Option<(&T, &Self)> { ++ if let [rest @ .., last] = &self.entries { ++ Some((&last.key, Self::from_slice(rest))) ++ } else { ++ None ++ } ++ } ++ ++ /// Return an iterator over the values of the set slice. ++ pub fn iter(&self) -> Iter<'_, T> { ++ Iter::new(&self.entries) ++ } ++ ++ /// Search over a sorted set for a value. ++ /// ++ /// Returns the position where that value is present, or the position where it can be inserted ++ /// to maintain the sort. See [`slice::binary_search`] for more details. ++ /// ++ /// Computes in **O(log(n))** time, which is notably less scalable than looking the value up in ++ /// the set this is a slice from using [`IndexSet::get_index_of`], but this can also position ++ /// missing values. ++ pub fn binary_search(&self, x: &T) -> Result ++ where ++ T: Ord, ++ { ++ self.binary_search_by(|p| p.cmp(x)) ++ } ++ ++ /// Search over a sorted set with a comparator function. ++ /// ++ /// Returns the position where that value is present, or the position where it can be inserted ++ /// to maintain the sort. See [`slice::binary_search_by`] for more details. ++ /// ++ /// Computes in **O(log(n))** time. ++ #[inline] ++ pub fn binary_search_by<'a, F>(&'a self, mut f: F) -> Result ++ where ++ F: FnMut(&'a T) -> Ordering, ++ { ++ self.entries.binary_search_by(move |a| f(&a.key)) ++ } ++ ++ /// Search over a sorted set with an extraction function. ++ /// ++ /// Returns the position where that value is present, or the position where it can be inserted ++ /// to maintain the sort. See [`slice::binary_search_by_key`] for more details. ++ /// ++ /// Computes in **O(log(n))** time. ++ #[inline] ++ pub fn binary_search_by_key<'a, B, F>(&'a self, b: &B, mut f: F) -> Result ++ where ++ F: FnMut(&'a T) -> B, ++ B: Ord, ++ { ++ self.binary_search_by(|k| f(k).cmp(b)) ++ } ++ ++ /// Returns the index of the partition point of a sorted set according to the given predicate ++ /// (the index of the first element of the second partition). ++ /// ++ /// See [`slice::partition_point`] for more details. ++ /// ++ /// Computes in **O(log(n))** time. ++ #[must_use] ++ pub fn partition_point

(&self, mut pred: P) -> usize ++ where ++ P: FnMut(&T) -> bool, ++ { ++ self.entries.partition_point(move |a| pred(&a.key)) ++ } ++} ++ ++impl<'a, T> IntoIterator for &'a Slice { ++ type IntoIter = Iter<'a, T>; ++ type Item = &'a T; ++ ++ fn into_iter(self) -> Self::IntoIter { ++ self.iter() ++ } ++} ++ ++impl IntoIterator for Box> { ++ type IntoIter = IntoIter; ++ type Item = T; ++ ++ fn into_iter(self) -> Self::IntoIter { ++ IntoIter::new(self.into_entries()) ++ } ++} ++ ++impl Default for &'_ Slice { ++ fn default() -> Self { ++ Slice::from_slice(&[]) ++ } ++} ++ ++impl Default for Box> { ++ fn default() -> Self { ++ Slice::from_boxed(Box::default()) ++ } ++} ++ ++impl Clone for Box> { ++ fn clone(&self) -> Self { ++ Slice::from_boxed(self.entries.to_vec().into_boxed_slice()) ++ } ++} ++ ++impl From<&Slice> for Box> { ++ fn from(slice: &Slice) -> Self { ++ Slice::from_boxed(Box::from(&slice.entries)) ++ } ++} ++ ++impl fmt::Debug for Slice { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_list().entries(self).finish() ++ } ++} ++ ++impl PartialEq for Slice { ++ fn eq(&self, other: &Self) -> bool { ++ self.len() == other.len() && self.iter().eq(other) ++ } ++} ++ ++impl Eq for Slice {} ++ ++impl PartialOrd for Slice { ++ fn partial_cmp(&self, other: &Self) -> Option { ++ self.iter().partial_cmp(other) ++ } ++} ++ ++impl Ord for Slice { ++ fn cmp(&self, other: &Self) -> Ordering { ++ self.iter().cmp(other) ++ } ++} ++ ++impl Hash for Slice { ++ fn hash(&self, state: &mut H) { ++ self.len().hash(state); ++ for value in self { ++ value.hash(state); ++ } ++ } ++} ++ ++impl Index for Slice { ++ type Output = T; ++ ++ fn index(&self, index: usize) -> &Self::Output { ++ &self.entries[index].key ++ } ++} ++ ++// We can't have `impl> Index` because that conflicts with `Index`. ++// Instead, we repeat the implementations for all the core range types. ++macro_rules! impl_index { ++ ($($range:ty),*) => {$( ++ impl Index<$range> for IndexSet { ++ type Output = Slice; ++ ++ fn index(&self, range: $range) -> &Self::Output { ++ Slice::from_slice(&self.as_entries()[range]) ++ } ++ } ++ ++ impl Index<$range> for Slice { ++ type Output = Self; ++ ++ fn index(&self, range: $range) -> &Self::Output { ++ Slice::from_slice(&self.entries[range]) ++ } ++ } ++ )*} ++} ++impl_index!( ++ ops::Range, ++ ops::RangeFrom, ++ ops::RangeFull, ++ ops::RangeInclusive, ++ ops::RangeTo, ++ ops::RangeToInclusive, ++ (Bound, Bound) ++); ++ ++#[cfg(all(test, feature = "std"))] ++mod tests { ++ use super::*; ++ ++ #[test] ++ fn slice_index() { ++ fn check(vec_slice: &[i32], set_slice: &Slice, sub_slice: &Slice) { ++ assert_eq!(set_slice as *const _, sub_slice as *const _); ++ itertools::assert_equal(vec_slice, set_slice); ++ } ++ ++ let vec: Vec = (0..10).map(|i| i * i).collect(); ++ let set: IndexSet = vec.iter().cloned().collect(); ++ let slice = set.as_slice(); ++ ++ // RangeFull ++ check(&vec[..], &set[..], &slice[..]); ++ ++ for i in 0usize..10 { ++ // Index ++ assert_eq!(vec[i], set[i]); ++ assert_eq!(vec[i], slice[i]); ++ ++ // RangeFrom ++ check(&vec[i..], &set[i..], &slice[i..]); ++ ++ // RangeTo ++ check(&vec[..i], &set[..i], &slice[..i]); ++ ++ // RangeToInclusive ++ check(&vec[..=i], &set[..=i], &slice[..=i]); ++ ++ // (Bound, Bound) ++ let bounds = (Bound::Excluded(i), Bound::Unbounded); ++ check(&vec[i + 1..], &set[bounds], &slice[bounds]); ++ ++ for j in i..=10 { ++ // Range ++ check(&vec[i..j], &set[i..j], &slice[i..j]); ++ } ++ ++ for j in i..10 { ++ // RangeInclusive ++ check(&vec[i..=j], &set[i..=j], &slice[i..=j]); ++ } ++ } ++ } ++} +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/src/set/tests.rs mesa-25.3.3/subprojects/indexmap-2.7.0/src/set/tests.rs +--- mesa-25.3.3/subprojects/indexmap-2.7.0/src/set/tests.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/src/set/tests.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,723 @@ ++use super::*; ++use std::string::String; ++ ++#[test] ++fn it_works() { ++ let mut set = IndexSet::new(); ++ assert_eq!(set.is_empty(), true); ++ set.insert(1); ++ set.insert(1); ++ assert_eq!(set.len(), 1); ++ assert!(set.get(&1).is_some()); ++ assert_eq!(set.is_empty(), false); ++} ++ ++#[test] ++fn new() { ++ let set = IndexSet::::new(); ++ println!("{:?}", set); ++ assert_eq!(set.capacity(), 0); ++ assert_eq!(set.len(), 0); ++ assert_eq!(set.is_empty(), true); ++} ++ ++#[test] ++fn insert() { ++ let insert = [0, 4, 2, 12, 8, 7, 11, 5]; ++ let not_present = [1, 3, 6, 9, 10]; ++ let mut set = IndexSet::with_capacity(insert.len()); ++ ++ for (i, &elt) in insert.iter().enumerate() { ++ assert_eq!(set.len(), i); ++ set.insert(elt); ++ assert_eq!(set.len(), i + 1); ++ assert_eq!(set.get(&elt), Some(&elt)); ++ } ++ println!("{:?}", set); ++ ++ for &elt in ¬_present { ++ assert!(set.get(&elt).is_none()); ++ } ++} ++ ++#[test] ++fn insert_full() { ++ let insert = vec![9, 2, 7, 1, 4, 6, 13]; ++ let present = vec![1, 6, 2]; ++ let mut set = IndexSet::with_capacity(insert.len()); ++ ++ for (i, &elt) in insert.iter().enumerate() { ++ assert_eq!(set.len(), i); ++ let (index, success) = set.insert_full(elt); ++ assert!(success); ++ assert_eq!(Some(index), set.get_full(&elt).map(|x| x.0)); ++ assert_eq!(set.len(), i + 1); ++ } ++ ++ let len = set.len(); ++ for &elt in &present { ++ let (index, success) = set.insert_full(elt); ++ assert!(!success); ++ assert_eq!(Some(index), set.get_full(&elt).map(|x| x.0)); ++ assert_eq!(set.len(), len); ++ } ++} ++ ++#[test] ++fn insert_2() { ++ let mut set = IndexSet::with_capacity(16); ++ ++ let mut values = vec![]; ++ values.extend(0..16); ++ values.extend(if cfg!(miri) { 32..64 } else { 128..267 }); ++ ++ for &i in &values { ++ let old_set = set.clone(); ++ set.insert(i); ++ for value in old_set.iter() { ++ if set.get(value).is_none() { ++ println!("old_set: {:?}", old_set); ++ println!("set: {:?}", set); ++ panic!("did not find {} in set", value); ++ } ++ } ++ } ++ ++ for &i in &values { ++ assert!(set.get(&i).is_some(), "did not find {}", i); ++ } ++} ++ ++#[test] ++fn insert_dup() { ++ let mut elements = vec![0, 2, 4, 6, 8]; ++ let mut set: IndexSet = elements.drain(..).collect(); ++ { ++ let (i, v) = set.get_full(&0).unwrap(); ++ assert_eq!(set.len(), 5); ++ assert_eq!(i, 0); ++ assert_eq!(*v, 0); ++ } ++ { ++ let inserted = set.insert(0); ++ let (i, v) = set.get_full(&0).unwrap(); ++ assert_eq!(set.len(), 5); ++ assert_eq!(inserted, false); ++ assert_eq!(i, 0); ++ assert_eq!(*v, 0); ++ } ++} ++ ++#[test] ++fn insert_order() { ++ let insert = [0, 4, 2, 12, 8, 7, 11, 5, 3, 17, 19, 22, 23]; ++ let mut set = IndexSet::new(); ++ ++ for &elt in &insert { ++ set.insert(elt); ++ } ++ ++ assert_eq!(set.iter().count(), set.len()); ++ assert_eq!(set.iter().count(), insert.len()); ++ for (a, b) in insert.iter().zip(set.iter()) { ++ assert_eq!(a, b); ++ } ++ for (i, v) in (0..insert.len()).zip(set.iter()) { ++ assert_eq!(set.get_index(i).unwrap(), v); ++ } ++} ++ ++#[test] ++fn shift_insert() { ++ let insert = [0, 4, 2, 12, 8, 7, 11, 5, 3, 17, 19, 22, 23]; ++ let mut set = IndexSet::new(); ++ ++ for &elt in &insert { ++ set.shift_insert(0, elt); ++ } ++ ++ assert_eq!(set.iter().count(), set.len()); ++ assert_eq!(set.iter().count(), insert.len()); ++ for (a, b) in insert.iter().rev().zip(set.iter()) { ++ assert_eq!(a, b); ++ } ++ for (i, v) in (0..insert.len()).zip(set.iter()) { ++ assert_eq!(set.get_index(i).unwrap(), v); ++ } ++ ++ // "insert" that moves an existing entry ++ set.shift_insert(0, insert[0]); ++ assert_eq!(set.iter().count(), insert.len()); ++ assert_eq!(insert[0], set[0]); ++ for (a, b) in insert[1..].iter().rev().zip(set.iter().skip(1)) { ++ assert_eq!(a, b); ++ } ++} ++ ++#[test] ++fn replace() { ++ let replace = [0, 4, 2, 12, 8, 7, 11, 5]; ++ let not_present = [1, 3, 6, 9, 10]; ++ let mut set = IndexSet::with_capacity(replace.len()); ++ ++ for (i, &elt) in replace.iter().enumerate() { ++ assert_eq!(set.len(), i); ++ set.replace(elt); ++ assert_eq!(set.len(), i + 1); ++ assert_eq!(set.get(&elt), Some(&elt)); ++ } ++ println!("{:?}", set); ++ ++ for &elt in ¬_present { ++ assert!(set.get(&elt).is_none()); ++ } ++} ++ ++#[test] ++fn replace_full() { ++ let replace = vec![9, 2, 7, 1, 4, 6, 13]; ++ let present = vec![1, 6, 2]; ++ let mut set = IndexSet::with_capacity(replace.len()); ++ ++ for (i, &elt) in replace.iter().enumerate() { ++ assert_eq!(set.len(), i); ++ let (index, replaced) = set.replace_full(elt); ++ assert!(replaced.is_none()); ++ assert_eq!(Some(index), set.get_full(&elt).map(|x| x.0)); ++ assert_eq!(set.len(), i + 1); ++ } ++ ++ let len = set.len(); ++ for &elt in &present { ++ let (index, replaced) = set.replace_full(elt); ++ assert_eq!(Some(elt), replaced); ++ assert_eq!(Some(index), set.get_full(&elt).map(|x| x.0)); ++ assert_eq!(set.len(), len); ++ } ++} ++ ++#[test] ++fn replace_2() { ++ let mut set = IndexSet::with_capacity(16); ++ ++ let mut values = vec![]; ++ values.extend(0..16); ++ values.extend(if cfg!(miri) { 32..64 } else { 128..267 }); ++ ++ for &i in &values { ++ let old_set = set.clone(); ++ set.replace(i); ++ for value in old_set.iter() { ++ if set.get(value).is_none() { ++ println!("old_set: {:?}", old_set); ++ println!("set: {:?}", set); ++ panic!("did not find {} in set", value); ++ } ++ } ++ } ++ ++ for &i in &values { ++ assert!(set.get(&i).is_some(), "did not find {}", i); ++ } ++} ++ ++#[test] ++fn replace_dup() { ++ let mut elements = vec![0, 2, 4, 6, 8]; ++ let mut set: IndexSet = elements.drain(..).collect(); ++ { ++ let (i, v) = set.get_full(&0).unwrap(); ++ assert_eq!(set.len(), 5); ++ assert_eq!(i, 0); ++ assert_eq!(*v, 0); ++ } ++ { ++ let replaced = set.replace(0); ++ let (i, v) = set.get_full(&0).unwrap(); ++ assert_eq!(set.len(), 5); ++ assert_eq!(replaced, Some(0)); ++ assert_eq!(i, 0); ++ assert_eq!(*v, 0); ++ } ++} ++ ++#[test] ++fn replace_order() { ++ let replace = [0, 4, 2, 12, 8, 7, 11, 5, 3, 17, 19, 22, 23]; ++ let mut set = IndexSet::new(); ++ ++ for &elt in &replace { ++ set.replace(elt); ++ } ++ ++ assert_eq!(set.iter().count(), set.len()); ++ assert_eq!(set.iter().count(), replace.len()); ++ for (a, b) in replace.iter().zip(set.iter()) { ++ assert_eq!(a, b); ++ } ++ for (i, v) in (0..replace.len()).zip(set.iter()) { ++ assert_eq!(set.get_index(i).unwrap(), v); ++ } ++} ++ ++#[test] ++fn replace_change() { ++ // Check pointers to make sure it really changes ++ let mut set = indexset!(vec![42]); ++ let old_ptr = set[0].as_ptr(); ++ let new = set[0].clone(); ++ let new_ptr = new.as_ptr(); ++ assert_ne!(old_ptr, new_ptr); ++ let replaced = set.replace(new).unwrap(); ++ assert_eq!(replaced.as_ptr(), old_ptr); ++} ++ ++#[test] ++fn grow() { ++ let insert = [0, 4, 2, 12, 8, 7, 11]; ++ let not_present = [1, 3, 6, 9, 10]; ++ let mut set = IndexSet::with_capacity(insert.len()); ++ ++ for (i, &elt) in insert.iter().enumerate() { ++ assert_eq!(set.len(), i); ++ set.insert(elt); ++ assert_eq!(set.len(), i + 1); ++ assert_eq!(set.get(&elt), Some(&elt)); ++ } ++ ++ println!("{:?}", set); ++ for &elt in &insert { ++ set.insert(elt * 10); ++ } ++ for &elt in &insert { ++ set.insert(elt * 100); ++ } ++ for (i, &elt) in insert.iter().cycle().enumerate().take(100) { ++ set.insert(elt * 100 + i as i32); ++ } ++ println!("{:?}", set); ++ for &elt in ¬_present { ++ assert!(set.get(&elt).is_none()); ++ } ++} ++ ++#[test] ++fn reserve() { ++ let mut set = IndexSet::::new(); ++ assert_eq!(set.capacity(), 0); ++ set.reserve(100); ++ let capacity = set.capacity(); ++ assert!(capacity >= 100); ++ for i in 0..capacity { ++ assert_eq!(set.len(), i); ++ set.insert(i); ++ assert_eq!(set.len(), i + 1); ++ assert_eq!(set.capacity(), capacity); ++ assert_eq!(set.get(&i), Some(&i)); ++ } ++ set.insert(capacity); ++ assert_eq!(set.len(), capacity + 1); ++ assert!(set.capacity() > capacity); ++ assert_eq!(set.get(&capacity), Some(&capacity)); ++} ++ ++#[test] ++fn try_reserve() { ++ let mut set = IndexSet::::new(); ++ assert_eq!(set.capacity(), 0); ++ assert_eq!(set.try_reserve(100), Ok(())); ++ assert!(set.capacity() >= 100); ++ assert!(set.try_reserve(usize::MAX).is_err()); ++} ++ ++#[test] ++fn shrink_to_fit() { ++ let mut set = IndexSet::::new(); ++ assert_eq!(set.capacity(), 0); ++ for i in 0..100 { ++ assert_eq!(set.len(), i); ++ set.insert(i); ++ assert_eq!(set.len(), i + 1); ++ assert!(set.capacity() >= i + 1); ++ assert_eq!(set.get(&i), Some(&i)); ++ set.shrink_to_fit(); ++ assert_eq!(set.len(), i + 1); ++ assert_eq!(set.capacity(), i + 1); ++ assert_eq!(set.get(&i), Some(&i)); ++ } ++} ++ ++#[test] ++fn remove() { ++ let insert = [0, 4, 2, 12, 8, 7, 11, 5, 3, 17, 19, 22, 23]; ++ let mut set = IndexSet::new(); ++ ++ for &elt in &insert { ++ set.insert(elt); ++ } ++ ++ assert_eq!(set.iter().count(), set.len()); ++ assert_eq!(set.iter().count(), insert.len()); ++ for (a, b) in insert.iter().zip(set.iter()) { ++ assert_eq!(a, b); ++ } ++ ++ let remove_fail = [99, 77]; ++ let remove = [4, 12, 8, 7]; ++ ++ for &value in &remove_fail { ++ assert!(set.swap_remove_full(&value).is_none()); ++ } ++ println!("{:?}", set); ++ for &value in &remove { ++ //println!("{:?}", set); ++ let index = set.get_full(&value).unwrap().0; ++ assert_eq!(set.swap_remove_full(&value), Some((index, value))); ++ } ++ println!("{:?}", set); ++ ++ for value in &insert { ++ assert_eq!(set.get(value).is_some(), !remove.contains(value)); ++ } ++ assert_eq!(set.len(), insert.len() - remove.len()); ++ assert_eq!(set.iter().count(), insert.len() - remove.len()); ++} ++ ++#[test] ++fn swap_remove_index() { ++ let insert = [0, 4, 2, 12, 8, 7, 11, 5, 3, 17, 19, 22, 23]; ++ let mut set = IndexSet::new(); ++ ++ for &elt in &insert { ++ set.insert(elt); ++ } ++ ++ let mut vector = insert.to_vec(); ++ let remove_sequence = &[3, 3, 10, 4, 5, 4, 3, 0, 1]; ++ ++ // check that the same swap remove sequence on vec and set ++ // have the same result. ++ for &rm in remove_sequence { ++ let out_vec = vector.swap_remove(rm); ++ let out_set = set.swap_remove_index(rm).unwrap(); ++ assert_eq!(out_vec, out_set); ++ } ++ assert_eq!(vector.len(), set.len()); ++ for (a, b) in vector.iter().zip(set.iter()) { ++ assert_eq!(a, b); ++ } ++} ++ ++#[test] ++fn partial_eq_and_eq() { ++ let mut set_a = IndexSet::new(); ++ set_a.insert(1); ++ set_a.insert(2); ++ let mut set_b = set_a.clone(); ++ assert_eq!(set_a, set_b); ++ set_b.swap_remove(&1); ++ assert_ne!(set_a, set_b); ++ ++ let set_c: IndexSet<_> = set_b.into_iter().collect(); ++ assert_ne!(set_a, set_c); ++ assert_ne!(set_c, set_a); ++} ++ ++#[test] ++fn extend() { ++ let mut set = IndexSet::new(); ++ set.extend(vec![&1, &2, &3, &4]); ++ set.extend(vec![5, 6]); ++ assert_eq!(set.into_iter().collect::>(), vec![1, 2, 3, 4, 5, 6]); ++} ++ ++#[test] ++fn comparisons() { ++ let set_a: IndexSet<_> = (0..3).collect(); ++ let set_b: IndexSet<_> = (3..6).collect(); ++ let set_c: IndexSet<_> = (0..6).collect(); ++ let set_d: IndexSet<_> = (3..9).collect(); ++ ++ assert!(!set_a.is_disjoint(&set_a)); ++ assert!(set_a.is_subset(&set_a)); ++ assert!(set_a.is_superset(&set_a)); ++ ++ assert!(set_a.is_disjoint(&set_b)); ++ assert!(set_b.is_disjoint(&set_a)); ++ assert!(!set_a.is_subset(&set_b)); ++ assert!(!set_b.is_subset(&set_a)); ++ assert!(!set_a.is_superset(&set_b)); ++ assert!(!set_b.is_superset(&set_a)); ++ ++ assert!(!set_a.is_disjoint(&set_c)); ++ assert!(!set_c.is_disjoint(&set_a)); ++ assert!(set_a.is_subset(&set_c)); ++ assert!(!set_c.is_subset(&set_a)); ++ assert!(!set_a.is_superset(&set_c)); ++ assert!(set_c.is_superset(&set_a)); ++ ++ assert!(!set_c.is_disjoint(&set_d)); ++ assert!(!set_d.is_disjoint(&set_c)); ++ assert!(!set_c.is_subset(&set_d)); ++ assert!(!set_d.is_subset(&set_c)); ++ assert!(!set_c.is_superset(&set_d)); ++ assert!(!set_d.is_superset(&set_c)); ++} ++ ++#[test] ++fn iter_comparisons() { ++ use std::iter::empty; ++ ++ fn check<'a, I1, I2>(iter1: I1, iter2: I2) ++ where ++ I1: Iterator, ++ I2: Iterator, ++ { ++ assert!(iter1.copied().eq(iter2)); ++ } ++ ++ let set_a: IndexSet<_> = (0..3).collect(); ++ let set_b: IndexSet<_> = (3..6).collect(); ++ let set_c: IndexSet<_> = (0..6).collect(); ++ let set_d: IndexSet<_> = (3..9).rev().collect(); ++ ++ check(set_a.difference(&set_a), empty()); ++ check(set_a.symmetric_difference(&set_a), empty()); ++ check(set_a.intersection(&set_a), 0..3); ++ check(set_a.union(&set_a), 0..3); ++ ++ check(set_a.difference(&set_b), 0..3); ++ check(set_b.difference(&set_a), 3..6); ++ check(set_a.symmetric_difference(&set_b), 0..6); ++ check(set_b.symmetric_difference(&set_a), (3..6).chain(0..3)); ++ check(set_a.intersection(&set_b), empty()); ++ check(set_b.intersection(&set_a), empty()); ++ check(set_a.union(&set_b), 0..6); ++ check(set_b.union(&set_a), (3..6).chain(0..3)); ++ ++ check(set_a.difference(&set_c), empty()); ++ check(set_c.difference(&set_a), 3..6); ++ check(set_a.symmetric_difference(&set_c), 3..6); ++ check(set_c.symmetric_difference(&set_a), 3..6); ++ check(set_a.intersection(&set_c), 0..3); ++ check(set_c.intersection(&set_a), 0..3); ++ check(set_a.union(&set_c), 0..6); ++ check(set_c.union(&set_a), 0..6); ++ ++ check(set_c.difference(&set_d), 0..3); ++ check(set_d.difference(&set_c), (6..9).rev()); ++ check( ++ set_c.symmetric_difference(&set_d), ++ (0..3).chain((6..9).rev()), ++ ); ++ check(set_d.symmetric_difference(&set_c), (6..9).rev().chain(0..3)); ++ check(set_c.intersection(&set_d), 3..6); ++ check(set_d.intersection(&set_c), (3..6).rev()); ++ check(set_c.union(&set_d), (0..6).chain((6..9).rev())); ++ check(set_d.union(&set_c), (3..9).rev().chain(0..3)); ++} ++ ++#[test] ++fn ops() { ++ let empty = IndexSet::::new(); ++ let set_a: IndexSet<_> = (0..3).collect(); ++ let set_b: IndexSet<_> = (3..6).collect(); ++ let set_c: IndexSet<_> = (0..6).collect(); ++ let set_d: IndexSet<_> = (3..9).rev().collect(); ++ ++ #[allow(clippy::eq_op)] ++ { ++ assert_eq!(&set_a & &set_a, set_a); ++ assert_eq!(&set_a | &set_a, set_a); ++ assert_eq!(&set_a ^ &set_a, empty); ++ assert_eq!(&set_a - &set_a, empty); ++ } ++ ++ assert_eq!(&set_a & &set_b, empty); ++ assert_eq!(&set_b & &set_a, empty); ++ assert_eq!(&set_a | &set_b, set_c); ++ assert_eq!(&set_b | &set_a, set_c); ++ assert_eq!(&set_a ^ &set_b, set_c); ++ assert_eq!(&set_b ^ &set_a, set_c); ++ assert_eq!(&set_a - &set_b, set_a); ++ assert_eq!(&set_b - &set_a, set_b); ++ ++ assert_eq!(&set_a & &set_c, set_a); ++ assert_eq!(&set_c & &set_a, set_a); ++ assert_eq!(&set_a | &set_c, set_c); ++ assert_eq!(&set_c | &set_a, set_c); ++ assert_eq!(&set_a ^ &set_c, set_b); ++ assert_eq!(&set_c ^ &set_a, set_b); ++ assert_eq!(&set_a - &set_c, empty); ++ assert_eq!(&set_c - &set_a, set_b); ++ ++ assert_eq!(&set_c & &set_d, set_b); ++ assert_eq!(&set_d & &set_c, set_b); ++ assert_eq!(&set_c | &set_d, &set_a | &set_d); ++ assert_eq!(&set_d | &set_c, &set_a | &set_d); ++ assert_eq!(&set_c ^ &set_d, &set_a | &(&set_d - &set_b)); ++ assert_eq!(&set_d ^ &set_c, &set_a | &(&set_d - &set_b)); ++ assert_eq!(&set_c - &set_d, set_a); ++ assert_eq!(&set_d - &set_c, &set_d - &set_b); ++} ++ ++#[test] ++#[cfg(feature = "std")] ++fn from_array() { ++ let set1 = IndexSet::from([1, 2, 3, 4]); ++ let set2: IndexSet<_> = [1, 2, 3, 4].into(); ++ ++ assert_eq!(set1, set2); ++} ++ ++#[test] ++fn iter_default() { ++ struct Item; ++ fn assert_default() ++ where ++ T: Default + Iterator, ++ { ++ assert!(T::default().next().is_none()); ++ } ++ assert_default::>(); ++ assert_default::>(); ++} ++ ++#[test] ++fn test_binary_search_by() { ++ // adapted from std's test for binary_search ++ let b: IndexSet = [].into(); ++ assert_eq!(b.binary_search_by(|x| x.cmp(&5)), Err(0)); ++ ++ let b: IndexSet = [4].into(); ++ assert_eq!(b.binary_search_by(|x| x.cmp(&3)), Err(0)); ++ assert_eq!(b.binary_search_by(|x| x.cmp(&4)), Ok(0)); ++ assert_eq!(b.binary_search_by(|x| x.cmp(&5)), Err(1)); ++ ++ let b: IndexSet = [1, 2, 4, 6, 8, 9].into(); ++ assert_eq!(b.binary_search_by(|x| x.cmp(&5)), Err(3)); ++ assert_eq!(b.binary_search_by(|x| x.cmp(&6)), Ok(3)); ++ assert_eq!(b.binary_search_by(|x| x.cmp(&7)), Err(4)); ++ assert_eq!(b.binary_search_by(|x| x.cmp(&8)), Ok(4)); ++ ++ let b: IndexSet = [1, 2, 4, 5, 6, 8].into(); ++ assert_eq!(b.binary_search_by(|x| x.cmp(&9)), Err(6)); ++ ++ let b: IndexSet = [1, 2, 4, 6, 7, 8, 9].into(); ++ assert_eq!(b.binary_search_by(|x| x.cmp(&6)), Ok(3)); ++ assert_eq!(b.binary_search_by(|x| x.cmp(&5)), Err(3)); ++ assert_eq!(b.binary_search_by(|x| x.cmp(&8)), Ok(5)); ++ ++ let b: IndexSet = [1, 2, 4, 5, 6, 8, 9].into(); ++ assert_eq!(b.binary_search_by(|x| x.cmp(&7)), Err(5)); ++ assert_eq!(b.binary_search_by(|x| x.cmp(&0)), Err(0)); ++ ++ let b: IndexSet = [1, 3, 3, 3, 7].into(); ++ assert_eq!(b.binary_search_by(|x| x.cmp(&0)), Err(0)); ++ assert_eq!(b.binary_search_by(|x| x.cmp(&1)), Ok(0)); ++ assert_eq!(b.binary_search_by(|x| x.cmp(&2)), Err(1)); ++ // diff from std as set merges the duplicate keys ++ assert!(match b.binary_search_by(|x| x.cmp(&3)) { ++ Ok(1..=2) => true, ++ _ => false, ++ }); ++ assert!(match b.binary_search_by(|x| x.cmp(&3)) { ++ Ok(1..=2) => true, ++ _ => false, ++ }); ++ assert_eq!(b.binary_search_by(|x| x.cmp(&4)), Err(2)); ++ assert_eq!(b.binary_search_by(|x| x.cmp(&5)), Err(2)); ++ assert_eq!(b.binary_search_by(|x| x.cmp(&6)), Err(2)); ++ assert_eq!(b.binary_search_by(|x| x.cmp(&7)), Ok(2)); ++ assert_eq!(b.binary_search_by(|x| x.cmp(&8)), Err(3)); ++} ++ ++#[test] ++fn test_binary_search_by_key() { ++ // adapted from std's test for binary_search ++ let b: IndexSet = [].into(); ++ assert_eq!(b.binary_search_by_key(&5, |&x| x), Err(0)); ++ ++ let b: IndexSet = [4].into(); ++ assert_eq!(b.binary_search_by_key(&3, |&x| x), Err(0)); ++ assert_eq!(b.binary_search_by_key(&4, |&x| x), Ok(0)); ++ assert_eq!(b.binary_search_by_key(&5, |&x| x), Err(1)); ++ ++ let b: IndexSet = [1, 2, 4, 6, 8, 9].into(); ++ assert_eq!(b.binary_search_by_key(&5, |&x| x), Err(3)); ++ assert_eq!(b.binary_search_by_key(&6, |&x| x), Ok(3)); ++ assert_eq!(b.binary_search_by_key(&7, |&x| x), Err(4)); ++ assert_eq!(b.binary_search_by_key(&8, |&x| x), Ok(4)); ++ ++ let b: IndexSet = [1, 2, 4, 5, 6, 8].into(); ++ assert_eq!(b.binary_search_by_key(&9, |&x| x), Err(6)); ++ ++ let b: IndexSet = [1, 2, 4, 6, 7, 8, 9].into(); ++ assert_eq!(b.binary_search_by_key(&6, |&x| x), Ok(3)); ++ assert_eq!(b.binary_search_by_key(&5, |&x| x), Err(3)); ++ assert_eq!(b.binary_search_by_key(&8, |&x| x), Ok(5)); ++ ++ let b: IndexSet = [1, 2, 4, 5, 6, 8, 9].into(); ++ assert_eq!(b.binary_search_by_key(&7, |&x| x), Err(5)); ++ assert_eq!(b.binary_search_by_key(&0, |&x| x), Err(0)); ++ ++ let b: IndexSet = [1, 3, 3, 3, 7].into(); ++ assert_eq!(b.binary_search_by_key(&0, |&x| x), Err(0)); ++ assert_eq!(b.binary_search_by_key(&1, |&x| x), Ok(0)); ++ assert_eq!(b.binary_search_by_key(&2, |&x| x), Err(1)); ++ // diff from std as set merges the duplicate keys ++ assert!(match b.binary_search_by_key(&3, |&x| x) { ++ Ok(1..=2) => true, ++ _ => false, ++ }); ++ assert!(match b.binary_search_by_key(&3, |&x| x) { ++ Ok(1..=2) => true, ++ _ => false, ++ }); ++ assert_eq!(b.binary_search_by_key(&4, |&x| x), Err(2)); ++ assert_eq!(b.binary_search_by_key(&5, |&x| x), Err(2)); ++ assert_eq!(b.binary_search_by_key(&6, |&x| x), Err(2)); ++ assert_eq!(b.binary_search_by_key(&7, |&x| x), Ok(2)); ++ assert_eq!(b.binary_search_by_key(&8, |&x| x), Err(3)); ++} ++ ++#[test] ++fn test_partition_point() { ++ // adapted from std's test for partition_point ++ let b: IndexSet = [].into(); ++ assert_eq!(b.partition_point(|&x| x < 5), 0); ++ ++ let b: IndexSet<_> = [4].into(); ++ assert_eq!(b.partition_point(|&x| x < 3), 0); ++ assert_eq!(b.partition_point(|&x| x < 4), 0); ++ assert_eq!(b.partition_point(|&x| x < 5), 1); ++ ++ let b: IndexSet<_> = [1, 2, 4, 6, 8, 9].into(); ++ assert_eq!(b.partition_point(|&x| x < 5), 3); ++ assert_eq!(b.partition_point(|&x| x < 6), 3); ++ assert_eq!(b.partition_point(|&x| x < 7), 4); ++ assert_eq!(b.partition_point(|&x| x < 8), 4); ++ ++ let b: IndexSet<_> = [1, 2, 4, 5, 6, 8].into(); ++ assert_eq!(b.partition_point(|&x| x < 9), 6); ++ ++ let b: IndexSet<_> = [1, 2, 4, 6, 7, 8, 9].into(); ++ assert_eq!(b.partition_point(|&x| x < 6), 3); ++ assert_eq!(b.partition_point(|&x| x < 5), 3); ++ assert_eq!(b.partition_point(|&x| x < 8), 5); ++ ++ let b: IndexSet<_> = [1, 2, 4, 5, 6, 8, 9].into(); ++ assert_eq!(b.partition_point(|&x| x < 7), 5); ++ assert_eq!(b.partition_point(|&x| x < 0), 0); ++ ++ let b: IndexSet<_> = [1, 3, 3, 3, 7].into(); ++ assert_eq!(b.partition_point(|&x| x < 0), 0); ++ assert_eq!(b.partition_point(|&x| x < 1), 0); ++ assert_eq!(b.partition_point(|&x| x < 2), 1); ++ assert_eq!(b.partition_point(|&x| x < 3), 1); ++ assert_eq!(b.partition_point(|&x| x < 4), 2); // diff from std as set merges the duplicate keys ++ assert_eq!(b.partition_point(|&x| x < 5), 2); ++ assert_eq!(b.partition_point(|&x| x < 6), 2); ++ assert_eq!(b.partition_point(|&x| x < 7), 2); ++ assert_eq!(b.partition_point(|&x| x < 8), 3); ++} +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/src/set.rs mesa-25.3.3/subprojects/indexmap-2.7.0/src/set.rs +--- mesa-25.3.3/subprojects/indexmap-2.7.0/src/set.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/src/set.rs 2025-01-11 13:48:35.000000000 -0500 +@@ -0,0 +1,1290 @@ ++//! A hash set implemented using [`IndexMap`] ++ ++mod iter; ++mod mutable; ++mod slice; ++ ++#[cfg(all(test, feature = "std"))] ++mod tests; ++ ++pub use self::iter::{ ++ Difference, Drain, Intersection, IntoIter, Iter, Splice, SymmetricDifference, Union, ++}; ++pub use self::mutable::MutableValues; ++pub use self::slice::Slice; ++ ++#[cfg(feature = "rayon")] ++pub use crate::rayon::set as rayon; ++use crate::TryReserveError; ++ ++#[cfg(feature = "std")] ++use std::collections::hash_map::RandomState; ++ ++use crate::util::try_simplify_range; ++use alloc::boxed::Box; ++use alloc::vec::Vec; ++use core::cmp::Ordering; ++use core::fmt; ++use core::hash::{BuildHasher, Hash}; ++use core::ops::{BitAnd, BitOr, BitXor, Index, RangeBounds, Sub}; ++ ++use super::{Entries, Equivalent, IndexMap}; ++ ++type Bucket = super::Bucket; ++ ++/// A hash set where the iteration order of the values is independent of their ++/// hash values. ++/// ++/// The interface is closely compatible with the standard ++/// [`HashSet`][std::collections::HashSet], ++/// but also has additional features. ++/// ++/// # Order ++/// ++/// The values have a consistent order that is determined by the sequence of ++/// insertion and removal calls on the set. The order does not depend on the ++/// values or the hash function at all. Note that insertion order and value ++/// are not affected if a re-insertion is attempted once an element is ++/// already present. ++/// ++/// All iterators traverse the set *in order*. Set operation iterators like ++/// [`IndexSet::union`] produce a concatenated order, as do their matching "bitwise" ++/// operators. See their documentation for specifics. ++/// ++/// The insertion order is preserved, with **notable exceptions** like the ++/// [`.remove()`][Self::remove] or [`.swap_remove()`][Self::swap_remove] methods. ++/// Methods such as [`.sort_by()`][Self::sort_by] of ++/// course result in a new order, depending on the sorting order. ++/// ++/// # Indices ++/// ++/// The values are indexed in a compact range without holes in the range ++/// `0..self.len()`. For example, the method `.get_full` looks up the index for ++/// a value, and the method `.get_index` looks up the value by index. ++/// ++/// # Complexity ++/// ++/// Internally, `IndexSet` just holds an [`IndexMap`](IndexMap). Thus the complexity ++/// of the two are the same for most methods. ++/// ++/// # Examples ++/// ++/// ``` ++/// use indexmap::IndexSet; ++/// ++/// // Collects which letters appear in a sentence. ++/// let letters: IndexSet<_> = "a short treatise on fungi".chars().collect(); ++/// ++/// assert!(letters.contains(&'s')); ++/// assert!(letters.contains(&'t')); ++/// assert!(letters.contains(&'u')); ++/// assert!(!letters.contains(&'y')); ++/// ``` ++#[cfg(feature = "std")] ++pub struct IndexSet { ++ pub(crate) map: IndexMap, ++} ++#[cfg(not(feature = "std"))] ++pub struct IndexSet { ++ pub(crate) map: IndexMap, ++} ++ ++impl Clone for IndexSet ++where ++ T: Clone, ++ S: Clone, ++{ ++ fn clone(&self) -> Self { ++ IndexSet { ++ map: self.map.clone(), ++ } ++ } ++ ++ fn clone_from(&mut self, other: &Self) { ++ self.map.clone_from(&other.map); ++ } ++} ++ ++impl Entries for IndexSet { ++ type Entry = Bucket; ++ ++ #[inline] ++ fn into_entries(self) -> Vec { ++ self.map.into_entries() ++ } ++ ++ #[inline] ++ fn as_entries(&self) -> &[Self::Entry] { ++ self.map.as_entries() ++ } ++ ++ #[inline] ++ fn as_entries_mut(&mut self) -> &mut [Self::Entry] { ++ self.map.as_entries_mut() ++ } ++ ++ fn with_entries(&mut self, f: F) ++ where ++ F: FnOnce(&mut [Self::Entry]), ++ { ++ self.map.with_entries(f); ++ } ++} ++ ++impl fmt::Debug for IndexSet ++where ++ T: fmt::Debug, ++{ ++ #[cfg(not(feature = "test_debug"))] ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_set().entries(self.iter()).finish() ++ } ++ ++ #[cfg(feature = "test_debug")] ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ // Let the inner `IndexMap` print all of its details ++ f.debug_struct("IndexSet").field("map", &self.map).finish() ++ } ++} ++ ++#[cfg(feature = "std")] ++#[cfg_attr(docsrs, doc(cfg(feature = "std")))] ++impl IndexSet { ++ /// Create a new set. (Does not allocate.) ++ pub fn new() -> Self { ++ IndexSet { ++ map: IndexMap::new(), ++ } ++ } ++ ++ /// Create a new set with capacity for `n` elements. ++ /// (Does not allocate if `n` is zero.) ++ /// ++ /// Computes in **O(n)** time. ++ pub fn with_capacity(n: usize) -> Self { ++ IndexSet { ++ map: IndexMap::with_capacity(n), ++ } ++ } ++} ++ ++impl IndexSet { ++ /// Create a new set with capacity for `n` elements. ++ /// (Does not allocate if `n` is zero.) ++ /// ++ /// Computes in **O(n)** time. ++ pub fn with_capacity_and_hasher(n: usize, hash_builder: S) -> Self { ++ IndexSet { ++ map: IndexMap::with_capacity_and_hasher(n, hash_builder), ++ } ++ } ++ ++ /// Create a new set with `hash_builder`. ++ /// ++ /// This function is `const`, so it ++ /// can be called in `static` contexts. ++ pub const fn with_hasher(hash_builder: S) -> Self { ++ IndexSet { ++ map: IndexMap::with_hasher(hash_builder), ++ } ++ } ++ ++ /// Return the number of elements the set can hold without reallocating. ++ /// ++ /// This number is a lower bound; the set might be able to hold more, ++ /// but is guaranteed to be able to hold at least this many. ++ /// ++ /// Computes in **O(1)** time. ++ pub fn capacity(&self) -> usize { ++ self.map.capacity() ++ } ++ ++ /// Return a reference to the set's `BuildHasher`. ++ pub fn hasher(&self) -> &S { ++ self.map.hasher() ++ } ++ ++ /// Return the number of elements in the set. ++ /// ++ /// Computes in **O(1)** time. ++ pub fn len(&self) -> usize { ++ self.map.len() ++ } ++ ++ /// Returns true if the set contains no elements. ++ /// ++ /// Computes in **O(1)** time. ++ pub fn is_empty(&self) -> bool { ++ self.map.is_empty() ++ } ++ ++ /// Return an iterator over the values of the set, in their order ++ pub fn iter(&self) -> Iter<'_, T> { ++ Iter::new(self.as_entries()) ++ } ++ ++ /// Remove all elements in the set, while preserving its capacity. ++ /// ++ /// Computes in **O(n)** time. ++ pub fn clear(&mut self) { ++ self.map.clear(); ++ } ++ ++ /// Shortens the set, keeping the first `len` elements and dropping the rest. ++ /// ++ /// If `len` is greater than the set's current length, this has no effect. ++ pub fn truncate(&mut self, len: usize) { ++ self.map.truncate(len); ++ } ++ ++ /// Clears the `IndexSet` in the given index range, returning those values ++ /// as a drain iterator. ++ /// ++ /// The range may be any type that implements [`RangeBounds`], ++ /// including all of the `std::ops::Range*` types, or even a tuple pair of ++ /// `Bound` start and end values. To drain the set entirely, use `RangeFull` ++ /// like `set.drain(..)`. ++ /// ++ /// This shifts down all entries following the drained range to fill the ++ /// gap, and keeps the allocated memory for reuse. ++ /// ++ /// ***Panics*** if the starting point is greater than the end point or if ++ /// the end point is greater than the length of the set. ++ pub fn drain(&mut self, range: R) -> Drain<'_, T> ++ where ++ R: RangeBounds, ++ { ++ Drain::new(self.map.core.drain(range)) ++ } ++ ++ /// Splits the collection into two at the given index. ++ /// ++ /// Returns a newly allocated set containing the elements in the range ++ /// `[at, len)`. After the call, the original set will be left containing ++ /// the elements `[0, at)` with its previous capacity unchanged. ++ /// ++ /// ***Panics*** if `at > len`. ++ pub fn split_off(&mut self, at: usize) -> Self ++ where ++ S: Clone, ++ { ++ Self { ++ map: self.map.split_off(at), ++ } ++ } ++ ++ /// Reserve capacity for `additional` more values. ++ /// ++ /// Computes in **O(n)** time. ++ pub fn reserve(&mut self, additional: usize) { ++ self.map.reserve(additional); ++ } ++ ++ /// Reserve capacity for `additional` more values, without over-allocating. ++ /// ++ /// Unlike `reserve`, this does not deliberately over-allocate the entry capacity to avoid ++ /// frequent re-allocations. However, the underlying data structures may still have internal ++ /// capacity requirements, and the allocator itself may give more space than requested, so this ++ /// cannot be relied upon to be precisely minimal. ++ /// ++ /// Computes in **O(n)** time. ++ pub fn reserve_exact(&mut self, additional: usize) { ++ self.map.reserve_exact(additional); ++ } ++ ++ /// Try to reserve capacity for `additional` more values. ++ /// ++ /// Computes in **O(n)** time. ++ pub fn try_reserve(&mut self, additional: usize) -> Result<(), TryReserveError> { ++ self.map.try_reserve(additional) ++ } ++ ++ /// Try to reserve capacity for `additional` more values, without over-allocating. ++ /// ++ /// Unlike `try_reserve`, this does not deliberately over-allocate the entry capacity to avoid ++ /// frequent re-allocations. However, the underlying data structures may still have internal ++ /// capacity requirements, and the allocator itself may give more space than requested, so this ++ /// cannot be relied upon to be precisely minimal. ++ /// ++ /// Computes in **O(n)** time. ++ pub fn try_reserve_exact(&mut self, additional: usize) -> Result<(), TryReserveError> { ++ self.map.try_reserve_exact(additional) ++ } ++ ++ /// Shrink the capacity of the set as much as possible. ++ /// ++ /// Computes in **O(n)** time. ++ pub fn shrink_to_fit(&mut self) { ++ self.map.shrink_to_fit(); ++ } ++ ++ /// Shrink the capacity of the set with a lower limit. ++ /// ++ /// Computes in **O(n)** time. ++ pub fn shrink_to(&mut self, min_capacity: usize) { ++ self.map.shrink_to(min_capacity); ++ } ++} ++ ++impl IndexSet ++where ++ T: Hash + Eq, ++ S: BuildHasher, ++{ ++ /// Insert the value into the set. ++ /// ++ /// If an equivalent item already exists in the set, it returns ++ /// `false` leaving the original value in the set and without ++ /// altering its insertion order. Otherwise, it inserts the new ++ /// item and returns `true`. ++ /// ++ /// Computes in **O(1)** time (amortized average). ++ pub fn insert(&mut self, value: T) -> bool { ++ self.map.insert(value, ()).is_none() ++ } ++ ++ /// Insert the value into the set, and get its index. ++ /// ++ /// If an equivalent item already exists in the set, it returns ++ /// the index of the existing item and `false`, leaving the ++ /// original value in the set and without altering its insertion ++ /// order. Otherwise, it inserts the new item and returns the index ++ /// of the inserted item and `true`. ++ /// ++ /// Computes in **O(1)** time (amortized average). ++ pub fn insert_full(&mut self, value: T) -> (usize, bool) { ++ let (index, existing) = self.map.insert_full(value, ()); ++ (index, existing.is_none()) ++ } ++ ++ /// Insert the value into the set at its ordered position among sorted values. ++ /// ++ /// This is equivalent to finding the position with ++ /// [`binary_search`][Self::binary_search], and if needed calling ++ /// [`insert_before`][Self::insert_before] for a new value. ++ /// ++ /// If the sorted item is found in the set, it returns the index of that ++ /// existing item and `false`, without any change. Otherwise, it inserts the ++ /// new item and returns its sorted index and `true`. ++ /// ++ /// If the existing items are **not** already sorted, then the insertion ++ /// index is unspecified (like [`slice::binary_search`]), but the value ++ /// is moved to or inserted at that position regardless. ++ /// ++ /// Computes in **O(n)** time (average). Instead of repeating calls to ++ /// `insert_sorted`, it may be faster to call batched [`insert`][Self::insert] ++ /// or [`extend`][Self::extend] and only call [`sort`][Self::sort] or ++ /// [`sort_unstable`][Self::sort_unstable] once. ++ pub fn insert_sorted(&mut self, value: T) -> (usize, bool) ++ where ++ T: Ord, ++ { ++ let (index, existing) = self.map.insert_sorted(value, ()); ++ (index, existing.is_none()) ++ } ++ ++ /// Insert the value into the set before the value at the given index, or at the end. ++ /// ++ /// If an equivalent item already exists in the set, it returns `false` leaving the ++ /// original value in the set, but moved to the new position. The returned index ++ /// will either be the given index or one less, depending on how the value moved. ++ /// (See [`shift_insert`](Self::shift_insert) for different behavior here.) ++ /// ++ /// Otherwise, it inserts the new value exactly at the given index and returns `true`. ++ /// ++ /// ***Panics*** if `index` is out of bounds. ++ /// Valid indices are `0..=set.len()` (inclusive). ++ /// ++ /// Computes in **O(n)** time (average). ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use indexmap::IndexSet; ++ /// let mut set: IndexSet = ('a'..='z').collect(); ++ /// ++ /// // The new value '*' goes exactly at the given index. ++ /// assert_eq!(set.get_index_of(&'*'), None); ++ /// assert_eq!(set.insert_before(10, '*'), (10, true)); ++ /// assert_eq!(set.get_index_of(&'*'), Some(10)); ++ /// ++ /// // Moving the value 'a' up will shift others down, so this moves *before* 10 to index 9. ++ /// assert_eq!(set.insert_before(10, 'a'), (9, false)); ++ /// assert_eq!(set.get_index_of(&'a'), Some(9)); ++ /// assert_eq!(set.get_index_of(&'*'), Some(10)); ++ /// ++ /// // Moving the value 'z' down will shift others up, so this moves to exactly 10. ++ /// assert_eq!(set.insert_before(10, 'z'), (10, false)); ++ /// assert_eq!(set.get_index_of(&'z'), Some(10)); ++ /// assert_eq!(set.get_index_of(&'*'), Some(11)); ++ /// ++ /// // Moving or inserting before the endpoint is also valid. ++ /// assert_eq!(set.len(), 27); ++ /// assert_eq!(set.insert_before(set.len(), '*'), (26, false)); ++ /// assert_eq!(set.get_index_of(&'*'), Some(26)); ++ /// assert_eq!(set.insert_before(set.len(), '+'), (27, true)); ++ /// assert_eq!(set.get_index_of(&'+'), Some(27)); ++ /// assert_eq!(set.len(), 28); ++ /// ``` ++ pub fn insert_before(&mut self, index: usize, value: T) -> (usize, bool) { ++ let (index, existing) = self.map.insert_before(index, value, ()); ++ (index, existing.is_none()) ++ } ++ ++ /// Insert the value into the set at the given index. ++ /// ++ /// If an equivalent item already exists in the set, it returns `false` leaving ++ /// the original value in the set, but moved to the given index. ++ /// Note that existing values **cannot** be moved to `index == set.len()`! ++ /// (See [`insert_before`](Self::insert_before) for different behavior here.) ++ /// ++ /// Otherwise, it inserts the new value at the given index and returns `true`. ++ /// ++ /// ***Panics*** if `index` is out of bounds. ++ /// Valid indices are `0..set.len()` (exclusive) when moving an existing value, or ++ /// `0..=set.len()` (inclusive) when inserting a new value. ++ /// ++ /// Computes in **O(n)** time (average). ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use indexmap::IndexSet; ++ /// let mut set: IndexSet = ('a'..='z').collect(); ++ /// ++ /// // The new value '*' goes exactly at the given index. ++ /// assert_eq!(set.get_index_of(&'*'), None); ++ /// assert_eq!(set.shift_insert(10, '*'), true); ++ /// assert_eq!(set.get_index_of(&'*'), Some(10)); ++ /// ++ /// // Moving the value 'a' up to 10 will shift others down, including the '*' that was at 10. ++ /// assert_eq!(set.shift_insert(10, 'a'), false); ++ /// assert_eq!(set.get_index_of(&'a'), Some(10)); ++ /// assert_eq!(set.get_index_of(&'*'), Some(9)); ++ /// ++ /// // Moving the value 'z' down to 9 will shift others up, including the '*' that was at 9. ++ /// assert_eq!(set.shift_insert(9, 'z'), false); ++ /// assert_eq!(set.get_index_of(&'z'), Some(9)); ++ /// assert_eq!(set.get_index_of(&'*'), Some(10)); ++ /// ++ /// // Existing values can move to len-1 at most, but new values can insert at the endpoint. ++ /// assert_eq!(set.len(), 27); ++ /// assert_eq!(set.shift_insert(set.len() - 1, '*'), false); ++ /// assert_eq!(set.get_index_of(&'*'), Some(26)); ++ /// assert_eq!(set.shift_insert(set.len(), '+'), true); ++ /// assert_eq!(set.get_index_of(&'+'), Some(27)); ++ /// assert_eq!(set.len(), 28); ++ /// ``` ++ /// ++ /// ```should_panic ++ /// use indexmap::IndexSet; ++ /// let mut set: IndexSet = ('a'..='z').collect(); ++ /// ++ /// // This is an invalid index for moving an existing value! ++ /// set.shift_insert(set.len(), 'a'); ++ /// ``` ++ pub fn shift_insert(&mut self, index: usize, value: T) -> bool { ++ self.map.shift_insert(index, value, ()).is_none() ++ } ++ ++ /// Adds a value to the set, replacing the existing value, if any, that is ++ /// equal to the given one, without altering its insertion order. Returns ++ /// the replaced value. ++ /// ++ /// Computes in **O(1)** time (average). ++ pub fn replace(&mut self, value: T) -> Option { ++ self.replace_full(value).1 ++ } ++ ++ /// Adds a value to the set, replacing the existing value, if any, that is ++ /// equal to the given one, without altering its insertion order. Returns ++ /// the index of the item and its replaced value. ++ /// ++ /// Computes in **O(1)** time (average). ++ pub fn replace_full(&mut self, value: T) -> (usize, Option) { ++ let hash = self.map.hash(&value); ++ match self.map.core.replace_full(hash, value, ()) { ++ (i, Some((replaced, ()))) => (i, Some(replaced)), ++ (i, None) => (i, None), ++ } ++ } ++ ++ /// Return an iterator over the values that are in `self` but not `other`. ++ /// ++ /// Values are produced in the same order that they appear in `self`. ++ pub fn difference<'a, S2>(&'a self, other: &'a IndexSet) -> Difference<'a, T, S2> ++ where ++ S2: BuildHasher, ++ { ++ Difference::new(self, other) ++ } ++ ++ /// Return an iterator over the values that are in `self` or `other`, ++ /// but not in both. ++ /// ++ /// Values from `self` are produced in their original order, followed by ++ /// values from `other` in their original order. ++ pub fn symmetric_difference<'a, S2>( ++ &'a self, ++ other: &'a IndexSet, ++ ) -> SymmetricDifference<'a, T, S, S2> ++ where ++ S2: BuildHasher, ++ { ++ SymmetricDifference::new(self, other) ++ } ++ ++ /// Return an iterator over the values that are in both `self` and `other`. ++ /// ++ /// Values are produced in the same order that they appear in `self`. ++ pub fn intersection<'a, S2>(&'a self, other: &'a IndexSet) -> Intersection<'a, T, S2> ++ where ++ S2: BuildHasher, ++ { ++ Intersection::new(self, other) ++ } ++ ++ /// Return an iterator over all values that are in `self` or `other`. ++ /// ++ /// Values from `self` are produced in their original order, followed by ++ /// values that are unique to `other` in their original order. ++ pub fn union<'a, S2>(&'a self, other: &'a IndexSet) -> Union<'a, T, S> ++ where ++ S2: BuildHasher, ++ { ++ Union::new(self, other) ++ } ++ ++ /// Creates a splicing iterator that replaces the specified range in the set ++ /// with the given `replace_with` iterator and yields the removed items. ++ /// `replace_with` does not need to be the same length as `range`. ++ /// ++ /// The `range` is removed even if the iterator is not consumed until the ++ /// end. It is unspecified how many elements are removed from the set if the ++ /// `Splice` value is leaked. ++ /// ++ /// The input iterator `replace_with` is only consumed when the `Splice` ++ /// value is dropped. If a value from the iterator matches an existing entry ++ /// in the set (outside of `range`), then the original will be unchanged. ++ /// Otherwise, the new value will be inserted in the replaced `range`. ++ /// ++ /// ***Panics*** if the starting point is greater than the end point or if ++ /// the end point is greater than the length of the set. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use indexmap::IndexSet; ++ /// ++ /// let mut set = IndexSet::from([0, 1, 2, 3, 4]); ++ /// let new = [5, 4, 3, 2, 1]; ++ /// let removed: Vec<_> = set.splice(2..4, new).collect(); ++ /// ++ /// // 1 and 4 kept their positions, while 5, 3, and 2 were newly inserted. ++ /// assert!(set.into_iter().eq([0, 1, 5, 3, 2, 4])); ++ /// assert_eq!(removed, &[2, 3]); ++ /// ``` ++ pub fn splice(&mut self, range: R, replace_with: I) -> Splice<'_, I::IntoIter, T, S> ++ where ++ R: RangeBounds, ++ I: IntoIterator, ++ { ++ Splice::new(self, range, replace_with.into_iter()) ++ } ++ ++ /// Moves all values from `other` into `self`, leaving `other` empty. ++ /// ++ /// This is equivalent to calling [`insert`][Self::insert] for each value ++ /// from `other` in order, which means that values that already exist ++ /// in `self` are unchanged in their current position. ++ /// ++ /// See also [`union`][Self::union] to iterate the combined values by ++ /// reference, without modifying `self` or `other`. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use indexmap::IndexSet; ++ /// ++ /// let mut a = IndexSet::from([3, 2, 1]); ++ /// let mut b = IndexSet::from([3, 4, 5]); ++ /// let old_capacity = b.capacity(); ++ /// ++ /// a.append(&mut b); ++ /// ++ /// assert_eq!(a.len(), 5); ++ /// assert_eq!(b.len(), 0); ++ /// assert_eq!(b.capacity(), old_capacity); ++ /// ++ /// assert!(a.iter().eq(&[3, 2, 1, 4, 5])); ++ /// ``` ++ pub fn append(&mut self, other: &mut IndexSet) { ++ self.map.append(&mut other.map); ++ } ++} ++ ++impl IndexSet ++where ++ S: BuildHasher, ++{ ++ /// Return `true` if an equivalent to `value` exists in the set. ++ /// ++ /// Computes in **O(1)** time (average). ++ pub fn contains(&self, value: &Q) -> bool ++ where ++ Q: ?Sized + Hash + Equivalent, ++ { ++ self.map.contains_key(value) ++ } ++ ++ /// Return a reference to the value stored in the set, if it is present, ++ /// else `None`. ++ /// ++ /// Computes in **O(1)** time (average). ++ pub fn get(&self, value: &Q) -> Option<&T> ++ where ++ Q: ?Sized + Hash + Equivalent, ++ { ++ self.map.get_key_value(value).map(|(x, &())| x) ++ } ++ ++ /// Return item index and value ++ pub fn get_full(&self, value: &Q) -> Option<(usize, &T)> ++ where ++ Q: ?Sized + Hash + Equivalent, ++ { ++ self.map.get_full(value).map(|(i, x, &())| (i, x)) ++ } ++ ++ /// Return item index, if it exists in the set ++ /// ++ /// Computes in **O(1)** time (average). ++ pub fn get_index_of(&self, value: &Q) -> Option ++ where ++ Q: ?Sized + Hash + Equivalent, ++ { ++ self.map.get_index_of(value) ++ } ++ ++ /// Remove the value from the set, and return `true` if it was present. ++ /// ++ /// **NOTE:** This is equivalent to [`.swap_remove(value)`][Self::swap_remove], replacing this ++ /// value's position with the last element, and it is deprecated in favor of calling that ++ /// explicitly. If you need to preserve the relative order of the values in the set, use ++ /// [`.shift_remove(value)`][Self::shift_remove] instead. ++ #[deprecated(note = "`remove` disrupts the set order -- \ ++ use `swap_remove` or `shift_remove` for explicit behavior.")] ++ pub fn remove(&mut self, value: &Q) -> bool ++ where ++ Q: ?Sized + Hash + Equivalent, ++ { ++ self.swap_remove(value) ++ } ++ ++ /// Remove the value from the set, and return `true` if it was present. ++ /// ++ /// Like [`Vec::swap_remove`], the value is removed by swapping it with the ++ /// last element of the set and popping it off. **This perturbs ++ /// the position of what used to be the last element!** ++ /// ++ /// Return `false` if `value` was not in the set. ++ /// ++ /// Computes in **O(1)** time (average). ++ pub fn swap_remove(&mut self, value: &Q) -> bool ++ where ++ Q: ?Sized + Hash + Equivalent, ++ { ++ self.map.swap_remove(value).is_some() ++ } ++ ++ /// Remove the value from the set, and return `true` if it was present. ++ /// ++ /// Like [`Vec::remove`], the value is removed by shifting all of the ++ /// elements that follow it, preserving their relative order. ++ /// **This perturbs the index of all of those elements!** ++ /// ++ /// Return `false` if `value` was not in the set. ++ /// ++ /// Computes in **O(n)** time (average). ++ pub fn shift_remove(&mut self, value: &Q) -> bool ++ where ++ Q: ?Sized + Hash + Equivalent, ++ { ++ self.map.shift_remove(value).is_some() ++ } ++ ++ /// Removes and returns the value in the set, if any, that is equal to the ++ /// given one. ++ /// ++ /// **NOTE:** This is equivalent to [`.swap_take(value)`][Self::swap_take], replacing this ++ /// value's position with the last element, and it is deprecated in favor of calling that ++ /// explicitly. If you need to preserve the relative order of the values in the set, use ++ /// [`.shift_take(value)`][Self::shift_take] instead. ++ #[deprecated(note = "`take` disrupts the set order -- \ ++ use `swap_take` or `shift_take` for explicit behavior.")] ++ pub fn take(&mut self, value: &Q) -> Option ++ where ++ Q: ?Sized + Hash + Equivalent, ++ { ++ self.swap_take(value) ++ } ++ ++ /// Removes and returns the value in the set, if any, that is equal to the ++ /// given one. ++ /// ++ /// Like [`Vec::swap_remove`], the value is removed by swapping it with the ++ /// last element of the set and popping it off. **This perturbs ++ /// the position of what used to be the last element!** ++ /// ++ /// Return `None` if `value` was not in the set. ++ /// ++ /// Computes in **O(1)** time (average). ++ pub fn swap_take(&mut self, value: &Q) -> Option ++ where ++ Q: ?Sized + Hash + Equivalent, ++ { ++ self.map.swap_remove_entry(value).map(|(x, ())| x) ++ } ++ ++ /// Removes and returns the value in the set, if any, that is equal to the ++ /// given one. ++ /// ++ /// Like [`Vec::remove`], the value is removed by shifting all of the ++ /// elements that follow it, preserving their relative order. ++ /// **This perturbs the index of all of those elements!** ++ /// ++ /// Return `None` if `value` was not in the set. ++ /// ++ /// Computes in **O(n)** time (average). ++ pub fn shift_take(&mut self, value: &Q) -> Option ++ where ++ Q: ?Sized + Hash + Equivalent, ++ { ++ self.map.shift_remove_entry(value).map(|(x, ())| x) ++ } ++ ++ /// Remove the value from the set return it and the index it had. ++ /// ++ /// Like [`Vec::swap_remove`], the value is removed by swapping it with the ++ /// last element of the set and popping it off. **This perturbs ++ /// the position of what used to be the last element!** ++ /// ++ /// Return `None` if `value` was not in the set. ++ pub fn swap_remove_full(&mut self, value: &Q) -> Option<(usize, T)> ++ where ++ Q: ?Sized + Hash + Equivalent, ++ { ++ self.map.swap_remove_full(value).map(|(i, x, ())| (i, x)) ++ } ++ ++ /// Remove the value from the set return it and the index it had. ++ /// ++ /// Like [`Vec::remove`], the value is removed by shifting all of the ++ /// elements that follow it, preserving their relative order. ++ /// **This perturbs the index of all of those elements!** ++ /// ++ /// Return `None` if `value` was not in the set. ++ pub fn shift_remove_full(&mut self, value: &Q) -> Option<(usize, T)> ++ where ++ Q: ?Sized + Hash + Equivalent, ++ { ++ self.map.shift_remove_full(value).map(|(i, x, ())| (i, x)) ++ } ++} ++ ++impl IndexSet { ++ /// Remove the last value ++ /// ++ /// This preserves the order of the remaining elements. ++ /// ++ /// Computes in **O(1)** time (average). ++ #[doc(alias = "pop_last")] // like `BTreeSet` ++ pub fn pop(&mut self) -> Option { ++ self.map.pop().map(|(x, ())| x) ++ } ++ ++ /// Scan through each value in the set and keep those where the ++ /// closure `keep` returns `true`. ++ /// ++ /// The elements are visited in order, and remaining elements keep their ++ /// order. ++ /// ++ /// Computes in **O(n)** time (average). ++ pub fn retain(&mut self, mut keep: F) ++ where ++ F: FnMut(&T) -> bool, ++ { ++ self.map.retain(move |x, &mut ()| keep(x)) ++ } ++ ++ /// Sort the set’s values by their default ordering. ++ /// ++ /// This is a stable sort -- but equivalent values should not normally coexist in ++ /// a set at all, so [`sort_unstable`][Self::sort_unstable] is preferred ++ /// because it is generally faster and doesn't allocate auxiliary memory. ++ /// ++ /// See [`sort_by`](Self::sort_by) for details. ++ pub fn sort(&mut self) ++ where ++ T: Ord, ++ { ++ self.map.sort_keys() ++ } ++ ++ /// Sort the set’s values in place using the comparison function `cmp`. ++ /// ++ /// Computes in **O(n log n)** time and **O(n)** space. The sort is stable. ++ pub fn sort_by(&mut self, mut cmp: F) ++ where ++ F: FnMut(&T, &T) -> Ordering, ++ { ++ self.map.sort_by(move |a, _, b, _| cmp(a, b)); ++ } ++ ++ /// Sort the values of the set and return a by-value iterator of ++ /// the values with the result. ++ /// ++ /// The sort is stable. ++ pub fn sorted_by(self, mut cmp: F) -> IntoIter ++ where ++ F: FnMut(&T, &T) -> Ordering, ++ { ++ let mut entries = self.into_entries(); ++ entries.sort_by(move |a, b| cmp(&a.key, &b.key)); ++ IntoIter::new(entries) ++ } ++ ++ /// Sort the set's values by their default ordering. ++ /// ++ /// See [`sort_unstable_by`](Self::sort_unstable_by) for details. ++ pub fn sort_unstable(&mut self) ++ where ++ T: Ord, ++ { ++ self.map.sort_unstable_keys() ++ } ++ ++ /// Sort the set's values in place using the comparison function `cmp`. ++ /// ++ /// Computes in **O(n log n)** time. The sort is unstable. ++ pub fn sort_unstable_by(&mut self, mut cmp: F) ++ where ++ F: FnMut(&T, &T) -> Ordering, ++ { ++ self.map.sort_unstable_by(move |a, _, b, _| cmp(a, b)) ++ } ++ ++ /// Sort the values of the set and return a by-value iterator of ++ /// the values with the result. ++ pub fn sorted_unstable_by(self, mut cmp: F) -> IntoIter ++ where ++ F: FnMut(&T, &T) -> Ordering, ++ { ++ let mut entries = self.into_entries(); ++ entries.sort_unstable_by(move |a, b| cmp(&a.key, &b.key)); ++ IntoIter::new(entries) ++ } ++ ++ /// Sort the set’s values in place using a key extraction function. ++ /// ++ /// During sorting, the function is called at most once per entry, by using temporary storage ++ /// to remember the results of its evaluation. The order of calls to the function is ++ /// unspecified and may change between versions of `indexmap` or the standard library. ++ /// ++ /// Computes in **O(m n + n log n + c)** time () and **O(n)** space, where the function is ++ /// **O(m)**, *n* is the length of the map, and *c* the capacity. The sort is stable. ++ pub fn sort_by_cached_key(&mut self, mut sort_key: F) ++ where ++ K: Ord, ++ F: FnMut(&T) -> K, ++ { ++ self.with_entries(move |entries| { ++ entries.sort_by_cached_key(move |a| sort_key(&a.key)); ++ }); ++ } ++ ++ /// Search over a sorted set for a value. ++ /// ++ /// Returns the position where that value is present, or the position where it can be inserted ++ /// to maintain the sort. See [`slice::binary_search`] for more details. ++ /// ++ /// Computes in **O(log(n))** time, which is notably less scalable than looking the value up ++ /// using [`get_index_of`][IndexSet::get_index_of], but this can also position missing values. ++ pub fn binary_search(&self, x: &T) -> Result ++ where ++ T: Ord, ++ { ++ self.as_slice().binary_search(x) ++ } ++ ++ /// Search over a sorted set with a comparator function. ++ /// ++ /// Returns the position where that value is present, or the position where it can be inserted ++ /// to maintain the sort. See [`slice::binary_search_by`] for more details. ++ /// ++ /// Computes in **O(log(n))** time. ++ #[inline] ++ pub fn binary_search_by<'a, F>(&'a self, f: F) -> Result ++ where ++ F: FnMut(&'a T) -> Ordering, ++ { ++ self.as_slice().binary_search_by(f) ++ } ++ ++ /// Search over a sorted set with an extraction function. ++ /// ++ /// Returns the position where that value is present, or the position where it can be inserted ++ /// to maintain the sort. See [`slice::binary_search_by_key`] for more details. ++ /// ++ /// Computes in **O(log(n))** time. ++ #[inline] ++ pub fn binary_search_by_key<'a, B, F>(&'a self, b: &B, f: F) -> Result ++ where ++ F: FnMut(&'a T) -> B, ++ B: Ord, ++ { ++ self.as_slice().binary_search_by_key(b, f) ++ } ++ ++ /// Returns the index of the partition point of a sorted set according to the given predicate ++ /// (the index of the first element of the second partition). ++ /// ++ /// See [`slice::partition_point`] for more details. ++ /// ++ /// Computes in **O(log(n))** time. ++ #[must_use] ++ pub fn partition_point

(&self, pred: P) -> usize ++ where ++ P: FnMut(&T) -> bool, ++ { ++ self.as_slice().partition_point(pred) ++ } ++ ++ /// Reverses the order of the set’s values in place. ++ /// ++ /// Computes in **O(n)** time and **O(1)** space. ++ pub fn reverse(&mut self) { ++ self.map.reverse() ++ } ++ ++ /// Returns a slice of all the values in the set. ++ /// ++ /// Computes in **O(1)** time. ++ pub fn as_slice(&self) -> &Slice { ++ Slice::from_slice(self.as_entries()) ++ } ++ ++ /// Converts into a boxed slice of all the values in the set. ++ /// ++ /// Note that this will drop the inner hash table and any excess capacity. ++ pub fn into_boxed_slice(self) -> Box> { ++ Slice::from_boxed(self.into_entries().into_boxed_slice()) ++ } ++ ++ /// Get a value by index ++ /// ++ /// Valid indices are `0 <= index < self.len()`. ++ /// ++ /// Computes in **O(1)** time. ++ pub fn get_index(&self, index: usize) -> Option<&T> { ++ self.as_entries().get(index).map(Bucket::key_ref) ++ } ++ ++ /// Returns a slice of values in the given range of indices. ++ /// ++ /// Valid indices are `0 <= index < self.len()`. ++ /// ++ /// Computes in **O(1)** time. ++ pub fn get_range>(&self, range: R) -> Option<&Slice> { ++ let entries = self.as_entries(); ++ let range = try_simplify_range(range, entries.len())?; ++ entries.get(range).map(Slice::from_slice) ++ } ++ ++ /// Get the first value ++ /// ++ /// Computes in **O(1)** time. ++ pub fn first(&self) -> Option<&T> { ++ self.as_entries().first().map(Bucket::key_ref) ++ } ++ ++ /// Get the last value ++ /// ++ /// Computes in **O(1)** time. ++ pub fn last(&self) -> Option<&T> { ++ self.as_entries().last().map(Bucket::key_ref) ++ } ++ ++ /// Remove the value by index ++ /// ++ /// Valid indices are `0 <= index < self.len()`. ++ /// ++ /// Like [`Vec::swap_remove`], the value is removed by swapping it with the ++ /// last element of the set and popping it off. **This perturbs ++ /// the position of what used to be the last element!** ++ /// ++ /// Computes in **O(1)** time (average). ++ pub fn swap_remove_index(&mut self, index: usize) -> Option { ++ self.map.swap_remove_index(index).map(|(x, ())| x) ++ } ++ ++ /// Remove the value by index ++ /// ++ /// Valid indices are `0 <= index < self.len()`. ++ /// ++ /// Like [`Vec::remove`], the value is removed by shifting all of the ++ /// elements that follow it, preserving their relative order. ++ /// **This perturbs the index of all of those elements!** ++ /// ++ /// Computes in **O(n)** time (average). ++ pub fn shift_remove_index(&mut self, index: usize) -> Option { ++ self.map.shift_remove_index(index).map(|(x, ())| x) ++ } ++ ++ /// Moves the position of a value from one index to another ++ /// by shifting all other values in-between. ++ /// ++ /// * If `from < to`, the other values will shift down while the targeted value moves up. ++ /// * If `from > to`, the other values will shift up while the targeted value moves down. ++ /// ++ /// ***Panics*** if `from` or `to` are out of bounds. ++ /// ++ /// Computes in **O(n)** time (average). ++ pub fn move_index(&mut self, from: usize, to: usize) { ++ self.map.move_index(from, to) ++ } ++ ++ /// Swaps the position of two values in the set. ++ /// ++ /// ***Panics*** if `a` or `b` are out of bounds. ++ /// ++ /// Computes in **O(1)** time (average). ++ pub fn swap_indices(&mut self, a: usize, b: usize) { ++ self.map.swap_indices(a, b) ++ } ++} ++ ++/// Access [`IndexSet`] values at indexed positions. ++/// ++/// # Examples ++/// ++/// ``` ++/// use indexmap::IndexSet; ++/// ++/// let mut set = IndexSet::new(); ++/// for word in "Lorem ipsum dolor sit amet".split_whitespace() { ++/// set.insert(word.to_string()); ++/// } ++/// assert_eq!(set[0], "Lorem"); ++/// assert_eq!(set[1], "ipsum"); ++/// set.reverse(); ++/// assert_eq!(set[0], "amet"); ++/// assert_eq!(set[1], "sit"); ++/// set.sort(); ++/// assert_eq!(set[0], "Lorem"); ++/// assert_eq!(set[1], "amet"); ++/// ``` ++/// ++/// ```should_panic ++/// use indexmap::IndexSet; ++/// ++/// let mut set = IndexSet::new(); ++/// set.insert("foo"); ++/// println!("{:?}", set[10]); // panics! ++/// ``` ++impl Index for IndexSet { ++ type Output = T; ++ ++ /// Returns a reference to the value at the supplied `index`. ++ /// ++ /// ***Panics*** if `index` is out of bounds. ++ fn index(&self, index: usize) -> &T { ++ self.get_index(index) ++ .expect("IndexSet: index out of bounds") ++ } ++} ++ ++impl FromIterator for IndexSet ++where ++ T: Hash + Eq, ++ S: BuildHasher + Default, ++{ ++ fn from_iter>(iterable: I) -> Self { ++ let iter = iterable.into_iter().map(|x| (x, ())); ++ IndexSet { ++ map: IndexMap::from_iter(iter), ++ } ++ } ++} ++ ++#[cfg(feature = "std")] ++#[cfg_attr(docsrs, doc(cfg(feature = "std")))] ++impl From<[T; N]> for IndexSet ++where ++ T: Eq + Hash, ++{ ++ /// # Examples ++ /// ++ /// ``` ++ /// use indexmap::IndexSet; ++ /// ++ /// let set1 = IndexSet::from([1, 2, 3, 4]); ++ /// let set2: IndexSet<_> = [1, 2, 3, 4].into(); ++ /// assert_eq!(set1, set2); ++ /// ``` ++ fn from(arr: [T; N]) -> Self { ++ Self::from_iter(arr) ++ } ++} ++ ++impl Extend for IndexSet ++where ++ T: Hash + Eq, ++ S: BuildHasher, ++{ ++ fn extend>(&mut self, iterable: I) { ++ let iter = iterable.into_iter().map(|x| (x, ())); ++ self.map.extend(iter); ++ } ++} ++ ++impl<'a, T, S> Extend<&'a T> for IndexSet ++where ++ T: Hash + Eq + Copy + 'a, ++ S: BuildHasher, ++{ ++ fn extend>(&mut self, iterable: I) { ++ let iter = iterable.into_iter().copied(); ++ self.extend(iter); ++ } ++} ++ ++impl Default for IndexSet ++where ++ S: Default, ++{ ++ /// Return an empty [`IndexSet`] ++ fn default() -> Self { ++ IndexSet { ++ map: IndexMap::default(), ++ } ++ } ++} ++ ++impl PartialEq> for IndexSet ++where ++ T: Hash + Eq, ++ S1: BuildHasher, ++ S2: BuildHasher, ++{ ++ fn eq(&self, other: &IndexSet) -> bool { ++ self.len() == other.len() && self.is_subset(other) ++ } ++} ++ ++impl Eq for IndexSet ++where ++ T: Eq + Hash, ++ S: BuildHasher, ++{ ++} ++ ++impl IndexSet ++where ++ T: Eq + Hash, ++ S: BuildHasher, ++{ ++ /// Returns `true` if `self` has no elements in common with `other`. ++ pub fn is_disjoint(&self, other: &IndexSet) -> bool ++ where ++ S2: BuildHasher, ++ { ++ if self.len() <= other.len() { ++ self.iter().all(move |value| !other.contains(value)) ++ } else { ++ other.iter().all(move |value| !self.contains(value)) ++ } ++ } ++ ++ /// Returns `true` if all elements of `self` are contained in `other`. ++ pub fn is_subset(&self, other: &IndexSet) -> bool ++ where ++ S2: BuildHasher, ++ { ++ self.len() <= other.len() && self.iter().all(move |value| other.contains(value)) ++ } ++ ++ /// Returns `true` if all elements of `other` are contained in `self`. ++ pub fn is_superset(&self, other: &IndexSet) -> bool ++ where ++ S2: BuildHasher, ++ { ++ other.is_subset(self) ++ } ++} ++ ++impl BitAnd<&IndexSet> for &IndexSet ++where ++ T: Eq + Hash + Clone, ++ S1: BuildHasher + Default, ++ S2: BuildHasher, ++{ ++ type Output = IndexSet; ++ ++ /// Returns the set intersection, cloned into a new set. ++ /// ++ /// Values are collected in the same order that they appear in `self`. ++ fn bitand(self, other: &IndexSet) -> Self::Output { ++ self.intersection(other).cloned().collect() ++ } ++} ++ ++impl BitOr<&IndexSet> for &IndexSet ++where ++ T: Eq + Hash + Clone, ++ S1: BuildHasher + Default, ++ S2: BuildHasher, ++{ ++ type Output = IndexSet; ++ ++ /// Returns the set union, cloned into a new set. ++ /// ++ /// Values from `self` are collected in their original order, followed by ++ /// values that are unique to `other` in their original order. ++ fn bitor(self, other: &IndexSet) -> Self::Output { ++ self.union(other).cloned().collect() ++ } ++} ++ ++impl BitXor<&IndexSet> for &IndexSet ++where ++ T: Eq + Hash + Clone, ++ S1: BuildHasher + Default, ++ S2: BuildHasher, ++{ ++ type Output = IndexSet; ++ ++ /// Returns the set symmetric-difference, cloned into a new set. ++ /// ++ /// Values from `self` are collected in their original order, followed by ++ /// values from `other` in their original order. ++ fn bitxor(self, other: &IndexSet) -> Self::Output { ++ self.symmetric_difference(other).cloned().collect() ++ } ++} ++ ++impl Sub<&IndexSet> for &IndexSet ++where ++ T: Eq + Hash + Clone, ++ S1: BuildHasher + Default, ++ S2: BuildHasher, ++{ ++ type Output = IndexSet; ++ ++ /// Returns the set difference, cloned into a new set. ++ /// ++ /// Values are collected in the same order that they appear in `self`. ++ fn sub(self, other: &IndexSet) -> Self::Output { ++ self.difference(other).cloned().collect() ++ } ++} +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/src/util.rs mesa-25.3.3/subprojects/indexmap-2.7.0/src/util.rs +--- mesa-25.3.3/subprojects/indexmap-2.7.0/src/util.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/src/util.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,53 @@ ++use core::ops::{Bound, Range, RangeBounds}; ++ ++pub(crate) fn third(t: (A, B, C)) -> C { ++ t.2 ++} ++ ++pub(crate) fn simplify_range(range: R, len: usize) -> Range ++where ++ R: RangeBounds, ++{ ++ let start = match range.start_bound() { ++ Bound::Unbounded => 0, ++ Bound::Included(&i) if i <= len => i, ++ Bound::Excluded(&i) if i < len => i + 1, ++ bound => panic!("range start {:?} should be <= length {}", bound, len), ++ }; ++ let end = match range.end_bound() { ++ Bound::Unbounded => len, ++ Bound::Excluded(&i) if i <= len => i, ++ Bound::Included(&i) if i < len => i + 1, ++ bound => panic!("range end {:?} should be <= length {}", bound, len), ++ }; ++ if start > end { ++ panic!( ++ "range start {:?} should be <= range end {:?}", ++ range.start_bound(), ++ range.end_bound() ++ ); ++ } ++ start..end ++} ++ ++pub(crate) fn try_simplify_range(range: R, len: usize) -> Option> ++where ++ R: RangeBounds, ++{ ++ let start = match range.start_bound() { ++ Bound::Unbounded => 0, ++ Bound::Included(&i) if i <= len => i, ++ Bound::Excluded(&i) if i < len => i + 1, ++ _ => return None, ++ }; ++ let end = match range.end_bound() { ++ Bound::Unbounded => len, ++ Bound::Excluded(&i) if i <= len => i, ++ Bound::Included(&i) if i < len => i + 1, ++ _ => return None, ++ }; ++ if start > end { ++ return None; ++ } ++ Some(start..end) ++} +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/tests/equivalent_trait.rs mesa-25.3.3/subprojects/indexmap-2.7.0/tests/equivalent_trait.rs +--- mesa-25.3.3/subprojects/indexmap-2.7.0/tests/equivalent_trait.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/tests/equivalent_trait.rs 2025-01-11 13:48:35.000000000 -0500 +@@ -0,0 +1,54 @@ ++#![cfg(feature = "std")] ++use indexmap::indexmap; ++use indexmap::Equivalent; ++ ++use std::hash::Hash; ++ ++#[derive(Debug, Hash)] ++pub struct Pair(pub A, pub B); ++ ++impl PartialEq<(A, B)> for Pair ++where ++ C: PartialEq, ++ D: PartialEq, ++{ ++ fn eq(&self, rhs: &(A, B)) -> bool { ++ self.0 == rhs.0 && self.1 == rhs.1 ++ } ++} ++ ++impl Equivalent for Pair ++where ++ Pair: PartialEq, ++ A: Hash + Eq, ++ B: Hash + Eq, ++{ ++ fn equivalent(&self, other: &X) -> bool { ++ *self == *other ++ } ++} ++ ++#[test] ++fn test_lookup() { ++ let s = String::from; ++ let map = indexmap! { ++ (s("a"), s("b")) => 1, ++ (s("a"), s("x")) => 2, ++ }; ++ ++ assert!(map.contains_key(&Pair("a", "b"))); ++ assert!(!map.contains_key(&Pair("b", "a"))); ++} ++ ++#[test] ++fn test_string_str() { ++ let s = String::from; ++ let mut map = indexmap! { ++ s("a") => 1, s("b") => 2, ++ s("x") => 3, s("y") => 4, ++ }; ++ ++ assert!(map.contains_key("a")); ++ assert!(!map.contains_key("z")); ++ assert_eq!(map.swap_remove("b"), Some(2)); ++} +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/tests/macros_full_path.rs mesa-25.3.3/subprojects/indexmap-2.7.0/tests/macros_full_path.rs +--- mesa-25.3.3/subprojects/indexmap-2.7.0/tests/macros_full_path.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/tests/macros_full_path.rs 2025-01-11 13:48:35.000000000 -0500 +@@ -0,0 +1,20 @@ ++#![cfg(feature = "std")] ++#[test] ++fn test_create_map() { ++ let _m = indexmap::indexmap! { ++ 1 => 2, ++ 7 => 1, ++ 2 => 2, ++ 3 => 3, ++ }; ++} ++ ++#[test] ++fn test_create_set() { ++ let _s = indexmap::indexset! { ++ 1, ++ 7, ++ 2, ++ 3, ++ }; ++} +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/tests/quick.rs mesa-25.3.3/subprojects/indexmap-2.7.0/tests/quick.rs +--- mesa-25.3.3/subprojects/indexmap-2.7.0/tests/quick.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/tests/quick.rs 2025-01-11 13:48:35.000000000 -0500 +@@ -0,0 +1,760 @@ ++#![cfg(feature = "std")] ++use indexmap::{IndexMap, IndexSet}; ++use itertools::Itertools; ++ ++use quickcheck::Arbitrary; ++use quickcheck::Gen; ++use quickcheck::QuickCheck; ++use quickcheck::TestResult; ++ ++use fnv::FnvHasher; ++use std::hash::{BuildHasher, BuildHasherDefault}; ++type FnvBuilder = BuildHasherDefault; ++type IndexMapFnv = IndexMap; ++ ++use std::cmp::min; ++use std::collections::HashMap; ++use std::collections::HashSet; ++use std::fmt::Debug; ++use std::hash::Hash; ++use std::ops::Bound; ++use std::ops::Deref; ++ ++use indexmap::map::Entry; ++use std::collections::hash_map::Entry as StdEntry; ++ ++fn set<'a, T: 'a, I>(iter: I) -> HashSet ++where ++ I: IntoIterator, ++ T: Copy + Hash + Eq, ++{ ++ iter.into_iter().copied().collect() ++} ++ ++fn indexmap<'a, T: 'a, I>(iter: I) -> IndexMap ++where ++ I: IntoIterator, ++ T: Copy + Hash + Eq, ++{ ++ IndexMap::from_iter(iter.into_iter().copied().map(|k| (k, ()))) ++} ++ ++// Helper macro to allow us to use smaller quickcheck limits under miri. ++macro_rules! quickcheck_limit { ++ (@as_items $($i:item)*) => ($($i)*); ++ { ++ $( ++ $(#[$m:meta])* ++ fn $fn_name:ident($($arg_name:ident : $arg_ty:ty),*) -> $ret:ty { ++ $($code:tt)* ++ } ++ )* ++ } => ( ++ quickcheck::quickcheck! { ++ @as_items ++ $( ++ #[test] ++ $(#[$m])* ++ fn $fn_name() { ++ fn prop($($arg_name: $arg_ty),*) -> $ret { ++ $($code)* ++ } ++ let mut quickcheck = QuickCheck::new(); ++ if cfg!(miri) { ++ quickcheck = quickcheck ++ .gen(Gen::new(10)) ++ .tests(10) ++ .max_tests(100); ++ } ++ ++ quickcheck.quickcheck(prop as fn($($arg_ty),*) -> $ret); ++ } ++ )* ++ } ++ ) ++} ++ ++quickcheck_limit! { ++ fn contains(insert: Vec) -> bool { ++ let mut map = IndexMap::new(); ++ for &key in &insert { ++ map.insert(key, ()); ++ } ++ insert.iter().all(|&key| map.get(&key).is_some()) ++ } ++ ++ fn contains_not(insert: Vec, not: Vec) -> bool { ++ let mut map = IndexMap::new(); ++ for &key in &insert { ++ map.insert(key, ()); ++ } ++ let nots = &set(¬) - &set(&insert); ++ nots.iter().all(|&key| map.get(&key).is_none()) ++ } ++ ++ fn insert_remove(insert: Vec, remove: Vec) -> bool { ++ let mut map = IndexMap::new(); ++ for &key in &insert { ++ map.insert(key, ()); ++ } ++ for &key in &remove { ++ map.swap_remove(&key); ++ } ++ let elements = &set(&insert) - &set(&remove); ++ map.len() == elements.len() && map.iter().count() == elements.len() && ++ elements.iter().all(|k| map.get(k).is_some()) ++ } ++ ++ fn insertion_order(insert: Vec) -> bool { ++ let mut map = IndexMap::new(); ++ for &key in &insert { ++ map.insert(key, ()); ++ } ++ itertools::assert_equal(insert.iter().unique(), map.keys()); ++ true ++ } ++ ++ fn insert_sorted(insert: Vec<(u32, u32)>) -> bool { ++ let mut hmap = HashMap::new(); ++ let mut map = IndexMap::new(); ++ let mut map2 = IndexMap::new(); ++ for &(key, value) in &insert { ++ hmap.insert(key, value); ++ map.insert_sorted(key, value); ++ match map2.entry(key) { ++ Entry::Occupied(e) => *e.into_mut() = value, ++ Entry::Vacant(e) => { e.insert_sorted(value); } ++ } ++ } ++ itertools::assert_equal(hmap.iter().sorted(), &map); ++ itertools::assert_equal(&map, &map2); ++ true ++ } ++ ++ fn pop(insert: Vec) -> bool { ++ let mut map = IndexMap::new(); ++ for &key in &insert { ++ map.insert(key, ()); ++ } ++ let mut pops = Vec::new(); ++ while let Some((key, _v)) = map.pop() { ++ pops.push(key); ++ } ++ pops.reverse(); ++ ++ itertools::assert_equal(insert.iter().unique(), &pops); ++ true ++ } ++ ++ fn with_cap(template: Vec<()>) -> bool { ++ let cap = template.len(); ++ let map: IndexMap = IndexMap::with_capacity(cap); ++ println!("wish: {}, got: {} (diff: {})", cap, map.capacity(), map.capacity() as isize - cap as isize); ++ map.capacity() >= cap ++ } ++ ++ fn drain_full(insert: Vec) -> bool { ++ let mut map = IndexMap::new(); ++ for &key in &insert { ++ map.insert(key, ()); ++ } ++ let mut clone = map.clone(); ++ let drained = clone.drain(..); ++ for (key, _) in drained { ++ map.swap_remove(&key); ++ } ++ map.is_empty() ++ } ++ ++ fn drain_bounds(insert: Vec, range: (Bound, Bound)) -> TestResult { ++ let mut map = IndexMap::new(); ++ for &key in &insert { ++ map.insert(key, ()); ++ } ++ ++ // First see if `Vec::drain` is happy with this range. ++ let result = std::panic::catch_unwind(|| { ++ let mut keys: Vec = map.keys().copied().collect(); ++ keys.drain(range); ++ keys ++ }); ++ ++ if let Ok(keys) = result { ++ map.drain(range); ++ // Check that our `drain` matches the same key order. ++ assert!(map.keys().eq(&keys)); ++ // Check that hash lookups all work too. ++ assert!(keys.iter().all(|key| map.contains_key(key))); ++ TestResult::passed() ++ } else { ++ // If `Vec::drain` panicked, so should we. ++ TestResult::must_fail(move || { map.drain(range); }) ++ } ++ } ++ ++ fn shift_remove(insert: Vec, remove: Vec) -> bool { ++ let mut map = IndexMap::new(); ++ for &key in &insert { ++ map.insert(key, ()); ++ } ++ for &key in &remove { ++ map.shift_remove(&key); ++ } ++ let elements = &set(&insert) - &set(&remove); ++ ++ // Check that order is preserved after removals ++ let mut iter = map.keys(); ++ for &key in insert.iter().unique() { ++ if elements.contains(&key) { ++ assert_eq!(Some(&key), iter.next()); ++ } ++ } ++ ++ map.len() == elements.len() && map.iter().count() == elements.len() && ++ elements.iter().all(|k| map.get(k).is_some()) ++ } ++ ++ fn indexing(insert: Vec) -> bool { ++ let mut map: IndexMap<_, _> = insert.into_iter().map(|x| (x, x)).collect(); ++ let set: IndexSet<_> = map.keys().copied().collect(); ++ assert_eq!(map.len(), set.len()); ++ ++ for (i, &key) in set.iter().enumerate() { ++ assert_eq!(map.get_index(i), Some((&key, &key))); ++ assert_eq!(set.get_index(i), Some(&key)); ++ assert_eq!(map[i], key); ++ assert_eq!(set[i], key); ++ ++ *map.get_index_mut(i).unwrap().1 >>= 1; ++ map[i] <<= 1; ++ } ++ ++ set.iter().enumerate().all(|(i, &key)| { ++ let value = key & !1; ++ map[&key] == value && map[i] == value ++ }) ++ } ++ ++ // Use `u8` test indices so quickcheck is less likely to go out of bounds. ++ fn set_swap_indices(vec: Vec, a: u8, b: u8) -> TestResult { ++ let mut set = IndexSet::::from_iter(vec); ++ let a = usize::from(a); ++ let b = usize::from(b); ++ ++ if a >= set.len() || b >= set.len() { ++ return TestResult::discard(); ++ } ++ ++ let mut vec = Vec::from_iter(set.iter().cloned()); ++ vec.swap(a, b); ++ ++ set.swap_indices(a, b); ++ ++ // Check both iteration order and hash lookups ++ assert!(set.iter().eq(vec.iter())); ++ assert!(vec.iter().enumerate().all(|(i, x)| { ++ set.get_index_of(x) == Some(i) ++ })); ++ TestResult::passed() ++ } ++ ++ fn map_swap_indices(vec: Vec, from: u8, to: u8) -> TestResult { ++ test_map_swap_indices(vec, from, to, IndexMap::swap_indices) ++ } ++ ++ fn occupied_entry_swap_indices(vec: Vec, from: u8, to: u8) -> TestResult { ++ test_map_swap_indices(vec, from, to, |map, from, to| { ++ let key = map.keys()[from]; ++ match map.entry(key) { ++ Entry::Occupied(entry) => entry.swap_indices(to), ++ _ => unreachable!(), ++ } ++ }) ++ } ++ ++ fn indexed_entry_swap_indices(vec: Vec, from: u8, to: u8) -> TestResult { ++ test_map_swap_indices(vec, from, to, |map, from, to| { ++ map.get_index_entry(from).unwrap().swap_indices(to); ++ }) ++ } ++ ++ fn raw_occupied_entry_swap_indices(vec: Vec, from: u8, to: u8) -> TestResult { ++ use indexmap::map::raw_entry_v1::{RawEntryApiV1, RawEntryMut}; ++ test_map_swap_indices(vec, from, to, |map, from, to| { ++ let key = map.keys()[from]; ++ match map.raw_entry_mut_v1().from_key(&key) { ++ RawEntryMut::Occupied(entry) => entry.swap_indices(to), ++ _ => unreachable!(), ++ } ++ }) ++ } ++ ++ // Use `u8` test indices so quickcheck is less likely to go out of bounds. ++ fn set_move_index(vec: Vec, from: u8, to: u8) -> TestResult { ++ let mut set = IndexSet::::from_iter(vec); ++ let from = usize::from(from); ++ let to = usize::from(to); ++ ++ if from >= set.len() || to >= set.len() { ++ return TestResult::discard(); ++ } ++ ++ let mut vec = Vec::from_iter(set.iter().cloned()); ++ let x = vec.remove(from); ++ vec.insert(to, x); ++ ++ set.move_index(from, to); ++ ++ // Check both iteration order and hash lookups ++ assert!(set.iter().eq(vec.iter())); ++ assert!(vec.iter().enumerate().all(|(i, x)| { ++ set.get_index_of(x) == Some(i) ++ })); ++ TestResult::passed() ++ } ++ ++ fn map_move_index(vec: Vec, from: u8, to: u8) -> TestResult { ++ test_map_move_index(vec, from, to, IndexMap::move_index) ++ } ++ ++ fn occupied_entry_move_index(vec: Vec, from: u8, to: u8) -> TestResult { ++ test_map_move_index(vec, from, to, |map, from, to| { ++ let key = map.keys()[from]; ++ match map.entry(key) { ++ Entry::Occupied(entry) => entry.move_index(to), ++ _ => unreachable!(), ++ } ++ }) ++ } ++ ++ fn indexed_entry_move_index(vec: Vec, from: u8, to: u8) -> TestResult { ++ test_map_move_index(vec, from, to, |map, from, to| { ++ map.get_index_entry(from).unwrap().move_index(to); ++ }) ++ } ++ ++ fn raw_occupied_entry_move_index(vec: Vec, from: u8, to: u8) -> TestResult { ++ use indexmap::map::raw_entry_v1::{RawEntryApiV1, RawEntryMut}; ++ test_map_move_index(vec, from, to, |map, from, to| { ++ let key = map.keys()[from]; ++ match map.raw_entry_mut_v1().from_key(&key) { ++ RawEntryMut::Occupied(entry) => entry.move_index(to), ++ _ => unreachable!(), ++ } ++ }) ++ } ++ ++ fn occupied_entry_shift_insert(vec: Vec, i: u8) -> TestResult { ++ test_map_shift_insert(vec, i, |map, i, key| { ++ match map.entry(key) { ++ Entry::Vacant(entry) => entry.shift_insert(i, ()), ++ _ => unreachable!(), ++ }; ++ }) ++ } ++ ++ fn raw_occupied_entry_shift_insert(vec: Vec, i: u8) -> TestResult { ++ use indexmap::map::raw_entry_v1::{RawEntryApiV1, RawEntryMut}; ++ test_map_shift_insert(vec, i, |map, i, key| { ++ match map.raw_entry_mut_v1().from_key(&key) { ++ RawEntryMut::Vacant(entry) => entry.shift_insert(i, key, ()), ++ _ => unreachable!(), ++ }; ++ }) ++ } ++} ++ ++fn test_map_swap_indices(vec: Vec, a: u8, b: u8, swap_indices: F) -> TestResult ++where ++ F: FnOnce(&mut IndexMap, usize, usize), ++{ ++ let mut map = IndexMap::::from_iter(vec.into_iter().map(|k| (k, ()))); ++ let a = usize::from(a); ++ let b = usize::from(b); ++ ++ if a >= map.len() || b >= map.len() { ++ return TestResult::discard(); ++ } ++ ++ let mut vec = Vec::from_iter(map.keys().copied()); ++ vec.swap(a, b); ++ ++ swap_indices(&mut map, a, b); ++ ++ // Check both iteration order and hash lookups ++ assert!(map.keys().eq(vec.iter())); ++ assert!(vec ++ .iter() ++ .enumerate() ++ .all(|(i, x)| { map.get_index_of(x) == Some(i) })); ++ TestResult::passed() ++} ++ ++fn test_map_move_index(vec: Vec, from: u8, to: u8, move_index: F) -> TestResult ++where ++ F: FnOnce(&mut IndexMap, usize, usize), ++{ ++ let mut map = IndexMap::::from_iter(vec.into_iter().map(|k| (k, ()))); ++ let from = usize::from(from); ++ let to = usize::from(to); ++ ++ if from >= map.len() || to >= map.len() { ++ return TestResult::discard(); ++ } ++ ++ let mut vec = Vec::from_iter(map.keys().copied()); ++ let x = vec.remove(from); ++ vec.insert(to, x); ++ ++ move_index(&mut map, from, to); ++ ++ // Check both iteration order and hash lookups ++ assert!(map.keys().eq(vec.iter())); ++ assert!(vec ++ .iter() ++ .enumerate() ++ .all(|(i, x)| { map.get_index_of(x) == Some(i) })); ++ TestResult::passed() ++} ++ ++fn test_map_shift_insert(vec: Vec, i: u8, shift_insert: F) -> TestResult ++where ++ F: FnOnce(&mut IndexMap, usize, u8), ++{ ++ let mut map = IndexMap::::from_iter(vec.into_iter().map(|k| (k, ()))); ++ let i = usize::from(i); ++ if i >= map.len() { ++ return TestResult::discard(); ++ } ++ ++ let mut vec = Vec::from_iter(map.keys().copied()); ++ let x = vec.pop().unwrap(); ++ vec.insert(i, x); ++ ++ let (last, ()) = map.pop().unwrap(); ++ assert_eq!(x, last); ++ map.shrink_to_fit(); // so we might have to grow and rehash the table ++ ++ shift_insert(&mut map, i, last); ++ ++ // Check both iteration order and hash lookups ++ assert!(map.keys().eq(vec.iter())); ++ assert!(vec ++ .iter() ++ .enumerate() ++ .all(|(i, x)| { map.get_index_of(x) == Some(i) })); ++ TestResult::passed() ++} ++ ++use crate::Op::*; ++#[derive(Copy, Clone, Debug)] ++enum Op { ++ Add(K, V), ++ Remove(K), ++ AddEntry(K, V), ++ RemoveEntry(K), ++} ++ ++impl Arbitrary for Op ++where ++ K: Arbitrary, ++ V: Arbitrary, ++{ ++ fn arbitrary(g: &mut Gen) -> Self { ++ match u32::arbitrary(g) % 4 { ++ 0 => Add(K::arbitrary(g), V::arbitrary(g)), ++ 1 => AddEntry(K::arbitrary(g), V::arbitrary(g)), ++ 2 => Remove(K::arbitrary(g)), ++ _ => RemoveEntry(K::arbitrary(g)), ++ } ++ } ++} ++ ++fn do_ops(ops: &[Op], a: &mut IndexMap, b: &mut HashMap) ++where ++ K: Hash + Eq + Clone, ++ V: Clone, ++ S: BuildHasher, ++{ ++ for op in ops { ++ match *op { ++ Add(ref k, ref v) => { ++ a.insert(k.clone(), v.clone()); ++ b.insert(k.clone(), v.clone()); ++ } ++ AddEntry(ref k, ref v) => { ++ a.entry(k.clone()).or_insert_with(|| v.clone()); ++ b.entry(k.clone()).or_insert_with(|| v.clone()); ++ } ++ Remove(ref k) => { ++ a.swap_remove(k); ++ b.remove(k); ++ } ++ RemoveEntry(ref k) => { ++ if let Entry::Occupied(ent) = a.entry(k.clone()) { ++ ent.swap_remove_entry(); ++ } ++ if let StdEntry::Occupied(ent) = b.entry(k.clone()) { ++ ent.remove_entry(); ++ } ++ } ++ } ++ //println!("{:?}", a); ++ } ++} ++ ++fn assert_maps_equivalent(a: &IndexMap, b: &HashMap) -> bool ++where ++ K: Hash + Eq + Debug, ++ V: Eq + Debug, ++{ ++ assert_eq!(a.len(), b.len()); ++ assert_eq!(a.iter().next().is_some(), b.iter().next().is_some()); ++ for key in a.keys() { ++ assert!(b.contains_key(key), "b does not contain {:?}", key); ++ } ++ for key in b.keys() { ++ assert!(a.get(key).is_some(), "a does not contain {:?}", key); ++ } ++ for key in a.keys() { ++ assert_eq!(a[key], b[key]); ++ } ++ true ++} ++ ++quickcheck_limit! { ++ fn operations_i8(ops: Large>>) -> bool { ++ let mut map = IndexMap::new(); ++ let mut reference = HashMap::new(); ++ do_ops(&ops, &mut map, &mut reference); ++ assert_maps_equivalent(&map, &reference) ++ } ++ ++ fn operations_string(ops: Vec>) -> bool { ++ let mut map = IndexMap::new(); ++ let mut reference = HashMap::new(); ++ do_ops(&ops, &mut map, &mut reference); ++ assert_maps_equivalent(&map, &reference) ++ } ++ ++ fn keys_values(ops: Large>>) -> bool { ++ let mut map = IndexMap::new(); ++ let mut reference = HashMap::new(); ++ do_ops(&ops, &mut map, &mut reference); ++ let mut visit = IndexMap::new(); ++ for (k, v) in map.keys().zip(map.values()) { ++ assert_eq!(&map[k], v); ++ assert!(!visit.contains_key(k)); ++ visit.insert(*k, *v); ++ } ++ assert_eq!(visit.len(), reference.len()); ++ true ++ } ++ ++ fn keys_values_mut(ops: Large>>) -> bool { ++ let mut map = IndexMap::new(); ++ let mut reference = HashMap::new(); ++ do_ops(&ops, &mut map, &mut reference); ++ let mut visit = IndexMap::new(); ++ let keys = Vec::from_iter(map.keys().copied()); ++ for (k, v) in keys.iter().zip(map.values_mut()) { ++ assert_eq!(&reference[k], v); ++ assert!(!visit.contains_key(k)); ++ visit.insert(*k, *v); ++ } ++ assert_eq!(visit.len(), reference.len()); ++ true ++ } ++ ++ fn equality(ops1: Vec>, removes: Vec) -> bool { ++ let mut map = IndexMap::new(); ++ let mut reference = HashMap::new(); ++ do_ops(&ops1, &mut map, &mut reference); ++ let mut ops2 = ops1.clone(); ++ for &r in &removes { ++ if !ops2.is_empty() { ++ let i = r % ops2.len(); ++ ops2.remove(i); ++ } ++ } ++ let mut map2 = IndexMapFnv::default(); ++ let mut reference2 = HashMap::new(); ++ do_ops(&ops2, &mut map2, &mut reference2); ++ assert_eq!(map == map2, reference == reference2); ++ true ++ } ++ ++ fn retain_ordered(keys: Large>, remove: Large>) -> () { ++ let mut map = indexmap(keys.iter()); ++ let initial_map = map.clone(); // deduplicated in-order input ++ let remove_map = indexmap(remove.iter()); ++ let keys_s = set(keys.iter()); ++ let remove_s = set(remove.iter()); ++ let answer = &keys_s - &remove_s; ++ map.retain(|k, _| !remove_map.contains_key(k)); ++ ++ // check the values ++ assert_eq!(map.len(), answer.len()); ++ for key in &answer { ++ assert!(map.contains_key(key)); ++ } ++ // check the order ++ itertools::assert_equal(map.keys(), initial_map.keys().filter(|&k| !remove_map.contains_key(k))); ++ } ++ ++ fn sort_1(keyvals: Large>) -> () { ++ let mut map: IndexMap<_, _> = IndexMap::from_iter(keyvals.to_vec()); ++ let mut answer = keyvals.0; ++ answer.sort_by_key(|t| t.0); ++ ++ // reverse dedup: Because IndexMap::from_iter keeps the last value for ++ // identical keys ++ answer.reverse(); ++ answer.dedup_by_key(|t| t.0); ++ answer.reverse(); ++ ++ map.sort_by(|k1, _, k2, _| Ord::cmp(k1, k2)); ++ ++ // check it contains all the values it should ++ for &(key, val) in &answer { ++ assert_eq!(map[&key], val); ++ } ++ ++ // check the order ++ ++ let mapv = Vec::from_iter(map); ++ assert_eq!(answer, mapv); ++ ++ } ++ ++ fn sort_2(keyvals: Large>) -> () { ++ let mut map: IndexMap<_, _> = IndexMap::from_iter(keyvals.to_vec()); ++ map.sort_by(|_, v1, _, v2| Ord::cmp(v1, v2)); ++ assert_sorted_by_key(map, |t| t.1); ++ } ++ ++ fn sort_3(keyvals: Large>) -> () { ++ let mut map: IndexMap<_, _> = IndexMap::from_iter(keyvals.to_vec()); ++ map.sort_by_cached_key(|&k, _| std::cmp::Reverse(k)); ++ assert_sorted_by_key(map, |t| std::cmp::Reverse(t.0)); ++ } ++ ++ fn reverse(keyvals: Large>) -> () { ++ let mut map: IndexMap<_, _> = IndexMap::from_iter(keyvals.to_vec()); ++ ++ fn generate_answer(input: &Vec<(i8, i8)>) -> Vec<(i8, i8)> { ++ // to mimic what `IndexMap::from_iter` does: ++ // need to get (A) the unique keys in forward order, and (B) the ++ // last value of each of those keys. ++ ++ // create (A): an iterable that yields the unique keys in ltr order ++ let mut seen_keys = HashSet::new(); ++ let unique_keys_forward = input.iter().filter_map(move |(k, _)| { ++ if seen_keys.contains(k) { None } ++ else { seen_keys.insert(*k); Some(*k) } ++ }); ++ ++ // create (B): a mapping of keys to the last value seen for that key ++ // this is the same as reversing the input and taking the first ++ // value seen for that key! ++ let mut last_val_per_key = HashMap::new(); ++ for &(k, v) in input.iter().rev() { ++ if !last_val_per_key.contains_key(&k) { ++ last_val_per_key.insert(k, v); ++ } ++ } ++ ++ // iterate over the keys in (A) in order, and match each one with ++ // the corresponding last value from (B) ++ let mut ans: Vec<_> = unique_keys_forward ++ .map(|k| (k, *last_val_per_key.get(&k).unwrap())) ++ .collect(); ++ ++ // finally, since this test is testing `.reverse()`, reverse the ++ // answer in-place ++ ans.reverse(); ++ ++ ans ++ } ++ ++ let answer = generate_answer(&keyvals.0); ++ ++ // perform the work ++ map.reverse(); ++ ++ // check it contains all the values it should ++ for &(key, val) in &answer { ++ assert_eq!(map[&key], val); ++ } ++ ++ // check the order ++ let mapv = Vec::from_iter(map); ++ assert_eq!(answer, mapv); ++ } ++} ++ ++fn assert_sorted_by_key(iterable: I, key: Key) ++where ++ I: IntoIterator, ++ I::Item: Ord + Clone + Debug, ++ Key: Fn(&I::Item) -> X, ++ X: Ord, ++{ ++ let input = Vec::from_iter(iterable); ++ let mut sorted = input.clone(); ++ sorted.sort_by_key(key); ++ assert_eq!(input, sorted); ++} ++ ++#[derive(Clone, Debug, Hash, PartialEq, Eq)] ++struct Alpha(String); ++ ++impl Deref for Alpha { ++ type Target = String; ++ fn deref(&self) -> &String { ++ &self.0 ++ } ++} ++ ++const ALPHABET: &[u8] = b"abcdefghijklmnopqrstuvwxyz"; ++ ++impl Arbitrary for Alpha { ++ fn arbitrary(g: &mut Gen) -> Self { ++ let len = usize::arbitrary(g) % g.size(); ++ let len = min(len, 16); ++ Alpha( ++ (0..len) ++ .map(|_| ALPHABET[usize::arbitrary(g) % ALPHABET.len()] as char) ++ .collect(), ++ ) ++ } ++ ++ fn shrink(&self) -> Box> { ++ Box::new((**self).shrink().map(Alpha)) ++ } ++} ++ ++/// quickcheck Arbitrary adaptor -- make a larger vec ++#[derive(Clone, Debug)] ++struct Large(T); ++ ++impl Deref for Large { ++ type Target = T; ++ fn deref(&self) -> &T { ++ &self.0 ++ } ++} ++ ++impl Arbitrary for Large> ++where ++ T: Arbitrary, ++{ ++ fn arbitrary(g: &mut Gen) -> Self { ++ let len = usize::arbitrary(g) % (g.size() * 10); ++ Large((0..len).map(|_| T::arbitrary(g)).collect()) ++ } ++ ++ fn shrink(&self) -> Box> { ++ Box::new((**self).shrink().map(Large)) ++ } ++} +diff -Nru mesa-25.3.3/subprojects/indexmap-2.7.0/tests/tests.rs mesa-25.3.3/subprojects/indexmap-2.7.0/tests/tests.rs +--- mesa-25.3.3/subprojects/indexmap-2.7.0/tests/tests.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2.7.0/tests/tests.rs 2025-01-11 13:48:35.000000000 -0500 +@@ -0,0 +1,29 @@ ++#![cfg(feature = "std")] ++use indexmap::{indexmap, indexset}; ++ ++#[test] ++fn test_sort() { ++ let m = indexmap! { ++ 1 => 2, ++ 7 => 1, ++ 2 => 2, ++ 3 => 3, ++ }; ++ ++ itertools::assert_equal( ++ m.sorted_by(|_k1, v1, _k2, v2| v1.cmp(v2)), ++ vec![(7, 1), (1, 2), (2, 2), (3, 3)], ++ ); ++} ++ ++#[test] ++fn test_sort_set() { ++ let s = indexset! { ++ 1, ++ 7, ++ 2, ++ 3, ++ }; ++ ++ itertools::assert_equal(s.sorted_by(|v1, v2| v1.cmp(v2)), vec![1, 2, 3, 7]); ++} +diff -Nru mesa-25.3.3/subprojects/indexmap-2-rs.wrap mesa-25.3.3/subprojects/indexmap-2-rs.wrap +--- mesa-25.3.3/subprojects/indexmap-2-rs.wrap 2026-01-01 13:34:04.000000000 -0500 ++++ mesa-25.3.3/subprojects/indexmap-2-rs.wrap 2026-05-29 13:40:53.000000000 -0500 +@@ -1,6 +1,4 @@ + [wrap-file] +-directory = indexmap-2.2.6 +-source_url = https://crates.io/api/v1/crates/indexmap/2.2.6/download +-source_filename = indexmap-2.2.6.tar.gz +-source_hash = 168fb715dda47215e360912c096649d23d58bf392ac62f73919e831745e40f26 ++directory = indexmap-2.7.0 + patch_directory = indexmap-2-rs ++ +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/build.rs mesa-25.3.3/subprojects/libc-0.2.169/build.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/build.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/build.rs 2024-12-28 15:35:00.000000000 -0500 +@@ -0,0 +1,291 @@ ++use std::process::{Command, Output}; ++use std::{env, str}; ++ ++// List of cfgs this build script is allowed to set. The list is needed to support check-cfg, as we ++// need to know all the possible cfgs that this script will set. If you need to set another cfg ++// make sure to add it to this list as well. ++const ALLOWED_CFGS: &'static [&'static str] = &[ ++ "emscripten_new_stat_abi", ++ "espidf_time32", ++ "freebsd10", ++ "freebsd11", ++ "freebsd12", ++ "freebsd13", ++ "freebsd14", ++ "freebsd15", ++ "gnu_time64_abi", ++ // FIXME(ctest): this config shouldn't be needed but ctest can't parse `const extern fn` ++ "libc_const_extern_fn", ++ "libc_deny_warnings", ++ "libc_thread_local", ++ "libc_ctest", ++]; ++ ++// Extra values to allow for check-cfg. ++const CHECK_CFG_EXTRA: &'static [(&'static str, &'static [&'static str])] = &[ ++ ( ++ "target_os", ++ &[ ++ "switch", "aix", "ohos", "hurd", "rtems", "visionos", "nuttx", ++ ], ++ ), ++ ("target_env", &["illumos", "wasi", "aix", "ohos"]), ++ ( ++ "target_arch", ++ &["loongarch64", "mips32r6", "mips64r6", "csky"], ++ ), ++]; ++ ++fn main() { ++ // Avoid unnecessary re-building. ++ println!("cargo:rerun-if-changed=build.rs"); ++ ++ let (rustc_minor_ver, _is_nightly) = rustc_minor_nightly(); ++ let rustc_dep_of_std = env::var("CARGO_FEATURE_RUSTC_DEP_OF_STD").is_ok(); ++ let libc_ci = env::var("LIBC_CI").is_ok(); ++ let libc_check_cfg = env::var("LIBC_CHECK_CFG").is_ok() || rustc_minor_ver >= 80; ++ ++ // The ABI of libc used by std is backward compatible with FreeBSD 12. ++ // The ABI of libc from crates.io is backward compatible with FreeBSD 11. ++ // ++ // On CI, we detect the actual FreeBSD version and match its ABI exactly, ++ // running tests to ensure that the ABI is correct. ++ println!("cargo:rerun-if-env-changed=RUST_LIBC_UNSTABLE_FREEBSD_VERSION"); ++ // Allow overriding the default version for testing ++ let which_freebsd = if let Ok(version) = env::var("RUST_LIBC_UNSTABLE_FREEBSD_VERSION") { ++ let vers = version.parse().unwrap(); ++ println!("cargo:warning=setting FreeBSD version to {vers}"); ++ vers ++ } else if libc_ci { ++ which_freebsd().unwrap_or(11) ++ } else if rustc_dep_of_std { ++ 12 ++ } else { ++ 11 ++ }; ++ ++ match which_freebsd { ++ x if x < 10 => panic!("FreeBSD older than 10 is not supported"), ++ 10 => set_cfg("freebsd10"), ++ 11 => set_cfg("freebsd11"), ++ 12 => set_cfg("freebsd12"), ++ 13 => set_cfg("freebsd13"), ++ 14 => set_cfg("freebsd14"), ++ _ => set_cfg("freebsd15"), ++ } ++ ++ match emcc_version_code() { ++ Some(v) if (v >= 30142) => set_cfg("emscripten_new_stat_abi"), ++ // Non-Emscripten or version < 3.1.42. ++ Some(_) | None => (), ++ } ++ ++ // Some ABIs need to redirect time related symbols to their time64 equivalents. ++ if is_gnu_time64_abi() { ++ set_cfg("gnu_time64_abi"); ++ } ++ ++ // On CI: deny all warnings ++ if libc_ci { ++ set_cfg("libc_deny_warnings"); ++ } ++ ++ // #[thread_local] is currently unstable ++ if rustc_dep_of_std { ++ set_cfg("libc_thread_local"); ++ } ++ ++ // Set unconditionally when ctest is not being invoked. ++ set_cfg("libc_const_extern_fn"); ++ ++ // check-cfg is a nightly cargo/rustc feature to warn when unknown cfgs are used across the ++ // codebase. libc can configure it if the appropriate environment variable is passed. Since ++ // rust-lang/rust enforces it, this is useful when using a custom libc fork there. ++ // ++ // https://doc.rust-lang.org/nightly/cargo/reference/unstable.html#check-cfg ++ if libc_check_cfg { ++ for cfg in ALLOWED_CFGS { ++ if rustc_minor_ver >= 75 { ++ println!("cargo:rustc-check-cfg=cfg({})", cfg); ++ } else { ++ println!("cargo:rustc-check-cfg=values({})", cfg); ++ } ++ } ++ for &(name, values) in CHECK_CFG_EXTRA { ++ let values = values.join("\",\""); ++ if rustc_minor_ver >= 75 { ++ println!("cargo:rustc-check-cfg=cfg({},values(\"{}\"))", name, values); ++ } else { ++ println!("cargo:rustc-check-cfg=values({},\"{}\")", name, values); ++ } ++ } ++ } ++} ++ ++/// Run `rustc --version` and capture the output, adjusting arguments as needed if `clippy-driver` ++/// is used instead. ++fn rustc_version_cmd(is_clippy_driver: bool) -> Output { ++ let rustc = env::var_os("RUSTC").expect("Failed to get rustc version: missing RUSTC env"); ++ ++ let mut cmd = match env::var_os("RUSTC_WRAPPER") { ++ Some(ref wrapper) if wrapper.is_empty() => Command::new(rustc), ++ Some(wrapper) => { ++ let mut cmd = Command::new(wrapper); ++ cmd.arg(rustc); ++ if is_clippy_driver { ++ cmd.arg("--rustc"); ++ } ++ ++ cmd ++ } ++ None => Command::new(rustc), ++ }; ++ ++ cmd.arg("--version"); ++ ++ let output = cmd.output().expect("Failed to get rustc version"); ++ ++ if !output.status.success() { ++ panic!( ++ "failed to run rustc: {}", ++ String::from_utf8_lossy(output.stderr.as_slice()) ++ ); ++ } ++ ++ output ++} ++ ++/// Return the minor version of `rustc`, as well as a bool indicating whether or not the version ++/// is a nightly. ++fn rustc_minor_nightly() -> (u32, bool) { ++ macro_rules! otry { ++ ($e:expr) => { ++ match $e { ++ Some(e) => e, ++ None => panic!("Failed to get rustc version"), ++ } ++ }; ++ } ++ ++ let mut output = rustc_version_cmd(false); ++ ++ if otry!(str::from_utf8(&output.stdout).ok()).starts_with("clippy") { ++ output = rustc_version_cmd(true); ++ } ++ ++ let version = otry!(str::from_utf8(&output.stdout).ok()); ++ ++ let mut pieces = version.split('.'); ++ ++ if pieces.next() != Some("rustc 1") { ++ panic!("Failed to get rustc version"); ++ } ++ ++ let minor = pieces.next(); ++ ++ // If `rustc` was built from a tarball, its version string ++ // will have neither a git hash nor a commit date ++ // (e.g. "rustc 1.39.0"). Treat this case as non-nightly, ++ // since a nightly build should either come from CI ++ // or a git checkout ++ let nightly_raw = otry!(pieces.next()).split('-').nth(1); ++ let nightly = nightly_raw ++ .map(|raw| raw.starts_with("dev") || raw.starts_with("nightly")) ++ .unwrap_or(false); ++ let minor = otry!(otry!(minor).parse().ok()); ++ ++ (minor, nightly) ++} ++ ++fn which_freebsd() -> Option { ++ let output = Command::new("freebsd-version").output().ok()?; ++ if !output.status.success() { ++ return None; ++ } ++ ++ let stdout = String::from_utf8(output.stdout).ok()?; ++ ++ match &stdout { ++ s if s.starts_with("10") => Some(10), ++ s if s.starts_with("11") => Some(11), ++ s if s.starts_with("12") => Some(12), ++ s if s.starts_with("13") => Some(13), ++ s if s.starts_with("14") => Some(14), ++ s if s.starts_with("15") => Some(15), ++ _ => None, ++ } ++} ++ ++fn emcc_version_code() -> Option { ++ let output = Command::new("emcc").arg("-dumpversion").output().ok()?; ++ if !output.status.success() { ++ return None; ++ } ++ ++ let version = String::from_utf8(output.stdout).ok()?; ++ ++ // Some Emscripten versions come with `-git` attached, so split the ++ // version string also on the `-` char. ++ let mut pieces = version.trim().split(['.', '-']); ++ ++ let major = pieces.next().and_then(|x| x.parse().ok()).unwrap_or(0); ++ let minor = pieces.next().and_then(|x| x.parse().ok()).unwrap_or(0); ++ let patch = pieces.next().and_then(|x| x.parse().ok()).unwrap_or(0); ++ ++ Some(major * 10000 + minor * 100 + patch) ++} ++ ++fn set_cfg(cfg: &str) { ++ if !ALLOWED_CFGS.contains(&cfg) { ++ panic!("trying to set cfg {}, but it is not in ALLOWED_CFGS", cfg); ++ } ++ println!("cargo:rustc-cfg={}", cfg); ++} ++ ++fn is_gnu_time64_abi() -> bool { ++ match env::var("CARGO_CFG_TARGET_ARCH") { ++ Ok(target_arch) => { ++ if target_arch == "x86" { ++ return false; ++ } ++ } ++ Err(_) => panic!("CARGO_CFG_TARGET_ARCH not set"), ++ } ++ match env::var("CARGO_CFG_TARGET_ENV") { ++ Ok(target_env) => { ++ if target_env != "gnu" { ++ return false; ++ } ++ } ++ Err(_) => panic!("CARGO_CFG_TARGET_ENV not set"), ++ } ++ match env::var("CARGO_CFG_TARGET_OS") { ++ Ok(target_os) => { ++ if target_os != "linux" { ++ return false; ++ } ++ } ++ Err(_) => panic!("CARGO_CFG_TARGET_OS not set"), ++ } ++ match env::var("CARGO_CFG_TARGET_POINTER_WIDTH") { ++ Ok(bits) => { ++ if bits == "64" { ++ return false; ++ } ++ bits ++ } ++ Err(_) => panic!("CARGO_CFG_TARGET_POINTER_WIDTH not set"), ++ }; ++ // At this point, we _know_ it is *-*-linux-gnu* with 32 bit ++ // pointers. Some 64 bit arch still have 32 bit pointers though. ++ match env::var("TARGET") { ++ Ok(target) => { ++ // x86_64-unknown-linux-gnux32 and similar ++ if target.contains("x86_64") && target.contains("x32") { ++ return false; ++ } ++ } ++ Err(_) => panic!("TARGET not set"), ++ } ++ return true; ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/.cargo-checksum.json mesa-25.3.3/subprojects/libc-0.2.169/.cargo-checksum.json +--- mesa-25.3.3/subprojects/libc-0.2.169/.cargo-checksum.json 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/.cargo-checksum.json 2024-12-28 15:35:00.000000000 -0500 +@@ -0,0 +1 @@ ++{"package":"Could not get crate checksum","files":{}} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/Cargo.toml mesa-25.3.3/subprojects/libc-0.2.169/Cargo.toml +--- mesa-25.3.3/subprojects/libc-0.2.169/Cargo.toml 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/Cargo.toml 2024-12-28 15:35:00.000000000 -0500 +@@ -0,0 +1,187 @@ ++# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO ++# ++# When uploading crates to the registry Cargo will automatically ++# "normalize" Cargo.toml files for maximal compatibility ++# with all versions of Cargo and also rewrite `path` dependencies ++# to registry (e.g., crates.io) dependencies. ++# ++# If you are reading this file be aware that the original Cargo.toml ++# will likely look very different (and much more reasonable). ++# See Cargo.toml.orig for the original contents. ++ ++[package] ++edition = "2021" ++rust-version = "1.63" ++name = "libc" ++version = "0.2.169" ++authors = ["The Rust Project Developers"] ++build = "build.rs" ++exclude = [ ++ "/ci/*", ++ "/.github/*", ++ "/.cirrus.yml", ++ "/triagebot.toml", ++] ++autolib = false ++autobins = false ++autoexamples = false ++autotests = false ++autobenches = false ++description = """ ++Raw FFI bindings to platform libraries like libc. ++""" ++homepage = "https://github.com/rust-lang/libc" ++documentation = "https://docs.rs/libc/" ++readme = "README.md" ++keywords = [ ++ "libc", ++ "ffi", ++ "bindings", ++ "operating", ++ "system", ++] ++categories = [ ++ "external-ffi-bindings", ++ "no-std", ++ "os", ++] ++license = "MIT OR Apache-2.0" ++repository = "https://github.com/rust-lang/libc" ++ ++[package.metadata.docs.rs] ++cargo-args = ["-Zbuild-std=core"] ++default-target = "x86_64-unknown-linux-gnu" ++features = ["extra_traits"] ++targets = [ ++ "aarch64-apple-darwin", ++ "aarch64-apple-ios", ++ "aarch64-linux-android", ++ "aarch64-pc-windows-msvc", ++ "aarch64-unknown-freebsd", ++ "aarch64-unknown-fuchsia", ++ "aarch64-unknown-hermit", ++ "aarch64-unknown-linux-gnu", ++ "aarch64-unknown-linux-musl", ++ "aarch64-unknown-netbsd", ++ "aarch64-unknown-openbsd", ++ "aarch64-wrs-vxworks", ++ "arm-linux-androideabi", ++ "arm-unknown-linux-gnueabi", ++ "arm-unknown-linux-gnueabihf", ++ "arm-unknown-linux-musleabi", ++ "arm-unknown-linux-musleabihf", ++ "armebv7r-none-eabi", ++ "armebv7r-none-eabihf", ++ "armv5te-unknown-linux-gnueabi", ++ "armv5te-unknown-linux-musleabi", ++ "armv7-linux-androideabi", ++ "armv7-unknown-linux-gnueabihf", ++ "armv7-unknown-linux-musleabihf", ++ "armv7-wrs-vxworks-eabihf", ++ "armv7r-none-eabi", ++ "armv7r-none-eabihf", ++ "i586-pc-windows-msvc", ++ "i586-unknown-linux-gnu", ++ "i586-unknown-linux-musl", ++ "i686-linux-android", ++ "i686-pc-windows-gnu", ++ "i686-pc-windows-msvc", ++ "i686-pc-windows-msvc", ++ "i686-unknown-freebsd", ++ "i686-unknown-haiku", ++ "i686-unknown-linux-gnu", ++ "i686-unknown-linux-musl", ++ "i686-unknown-netbsd", ++ "i686-unknown-openbsd", ++ "i686-wrs-vxworks", ++ "mips-unknown-linux-gnu", ++ "mips-unknown-linux-musl", ++ "mips64-unknown-linux-gnuabi64", ++ "mips64-unknown-linux-muslabi64", ++ "mips64el-unknown-linux-gnuabi64", ++ "mips64el-unknown-linux-muslabi64", ++ "mipsel-sony-psp", ++ "mipsel-unknown-linux-gnu", ++ "mipsel-unknown-linux-musl", ++ "nvptx64-nvidia-cuda", ++ "powerpc-unknown-linux-gnu", ++ "powerpc-unknown-linux-gnuspe", ++ "powerpc-unknown-netbsd", ++ "powerpc-wrs-vxworks", ++ "powerpc-wrs-vxworks-spe", ++ "powerpc64-unknown-freebsd", ++ "powerpc64-unknown-linux-gnu", ++ "powerpc64-wrs-vxworks", ++ "powerpc64le-unknown-linux-gnu", ++ "riscv32gc-unknown-linux-gnu", ++ "riscv32i-unknown-none-elf", ++ "riscv32imac-unknown-none-elf", ++ "riscv32imc-unknown-none-elf", ++ "riscv32-wrs-vxworks", ++ "riscv64gc-unknown-freebsd", ++ "riscv64gc-unknown-hermit", ++ "riscv64gc-unknown-linux-gnu", ++ "riscv64gc-unknown-linux-musl", ++ "riscv64gc-unknown-none-elf", ++ "riscv64imac-unknown-none-elf", ++ "riscv64-wrs-vxworks", ++ "s390x-unknown-linux-gnu", ++ "s390x-unknown-linux-musl", ++ "sparc-unknown-linux-gnu", ++ "sparc64-unknown-linux-gnu", ++ "sparc64-unknown-netbsd", ++ "sparcv9-sun-solaris", ++ "thumbv6m-none-eabi", ++ "thumbv7em-none-eabi", ++ "thumbv7em-none-eabihf", ++ "thumbv7m-none-eabi", ++ "thumbv7neon-linux-androideabi", ++ "thumbv7neon-unknown-linux-gnueabihf", ++ "wasm32-unknown-emscripten", ++ "wasm32-unknown-unknown", ++ "x86_64-apple-darwin", ++ "x86_64-apple-ios", ++ "x86_64-fortanix-unknown-sgx", ++ "x86_64-linux-android", ++ "x86_64-pc-solaris", ++ "x86_64-pc-windows-gnu", ++ "x86_64-pc-windows-msvc", ++ "x86_64-unknown-dragonfly", ++ "x86_64-unknown-freebsd", ++ "x86_64-unknown-fuchsia", ++ "x86_64-unknown-haiku", ++ "x86_64-unknown-hermit", ++ "x86_64-unknown-illumos", ++ "x86_64-unknown-l4re-uclibc", ++ "x86_64-unknown-linux-gnu", ++ "x86_64-unknown-linux-gnux32", ++ "x86_64-unknown-linux-musl", ++ "x86_64-unknown-netbsd", ++ "x86_64-unknown-openbsd", ++ "x86_64-unknown-redox", ++ "x86_64-wrs-vxworks", ++] ++ ++[lib] ++name = "libc" ++path = "src/lib.rs" ++ ++[[test]] ++name = "const_fn" ++path = "tests/const_fn.rs" ++ ++[dependencies.rustc-std-workspace-core] ++version = "1.0.0" ++optional = true ++ ++[features] ++align = [] ++const-extern-fn = [] ++default = ["std"] ++extra_traits = [] ++rustc-dep-of-std = [ ++ "align", ++ "rustc-std-workspace-core", ++] ++std = [] ++use_std = ["std"] +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/.cargo_vcs_info.json mesa-25.3.3/subprojects/libc-0.2.169/.cargo_vcs_info.json +--- mesa-25.3.3/subprojects/libc-0.2.169/.cargo_vcs_info.json 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/.cargo_vcs_info.json 2024-12-28 15:35:00.000000000 -0500 +@@ -0,0 +1,6 @@ ++{ ++ "git": { ++ "sha1": "bb5944c67d6f7f3ead944120ec30561731b427de" ++ }, ++ "path_in_vcs": "" ++} +\ No hay ningún carácter de nueva línea al final del archivo +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/CHANGELOG.md mesa-25.3.3/subprojects/libc-0.2.169/CHANGELOG.md +--- mesa-25.3.3/subprojects/libc-0.2.169/CHANGELOG.md 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/CHANGELOG.md 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,406 @@ ++# Changelog ++ ++## [Unreleased] ++## [0.2.169](https://github.com/rust-lang/libc/compare/0.2.168...0.2.169) - 2024-12-18 ++ ++### Added ++ ++- FreeBSD: add more socket TCP stack constants ++- Fuchsia: add a `sockaddr_vm` definition ++ ++### Fixed ++ ++**Breaking**: [rust-lang/rust#132975](https://github.com/rust-lang/rust/pull/132975) corrected the signedness of `core::ffi::c_char` on various Tier 2 and Tier 3 platforms (mostly Arm and RISC-V) to match Clang. This release contains the corresponding changes to `libc`, including the following specific pull requests: ++ ++- ESP-IDF: Replace arch-conditional `c_char` with a reexport ++- Fix `c_char` on various targets ++- Mirror `c_char` configuration from `rust-lang/rust` ++ ++### Cleanup ++ ++- Do not re-export `c_void` in target-specific code ++ ++## [0.2.168](https://github.com/rust-lang/libc/compare/0.2.167...0.2.168) - 2024-12-09 ++ ++### Added ++ ++- Linux: Add new process flags ([#4174](https://github.com/rust-lang/libc/pull/4174)) ++- Linux: Make `IFA_*` constants available on all Linux targets ++- Linux: add `MAP_DROPPABLE` ++- Solaris, Illumos: add `SIGRTMIN` and `SIGRTMAX` ++- Unix, Linux: adding POSIX `memccpy` and `mempcpy` GNU extension ++- CI: Upload artifacts created by libc-test ++- CI: Use workflow commands to group output by target ++- CI: add caching ++ ++## [0.2.167](https://github.com/rust-lang/libc/compare/0.2.166...0.2.167) - 2024-11-28 ++ ++### Added ++ ++- Solarish: add `st_fstype` to `stat` ++- Trusty: Add `intptr_t` and `uintptr_t` ([#4161](https://github.com/rust-lang/libc/pull/4161)) ++ ++### Fixed ++ ++- Fix the build with `rustc-dep-of-std` ++- Wasi: Add back unsafe block for `clockid_t` static variables ([#4157](https://github.com/rust-lang/libc/pull/4157)) ++ ++### Cleanup ++ ++- Create an internal prelude ++- Fix `unused_qualifications` ++ ++### Other ++ ++- CI: Check various FreeBSD versions ([#4159](https://github.com/rust-lang/libc/pull/4159)) ++- CI: add a timeout for all jobs ++- CI: verify MSRV for `wasm32-wasi` ++- Migrate to the 2021 edition ++ ++### Removed ++ ++- Remove one unused import after the edition 2021 bump ++ ++## [0.2.166](https://github.com/rust-lang/libc/compare/0.2.165...0.2.166) - 2024-11-26 ++ ++### Fixed ++ ++This release resolves two cases of unintentional breakage from the previous release: ++ ++- Revert removal of array size hacks [#4150](https://github.com/rust-lang/libc/pull/4150) ++- Ensure `const extern` functions are always enabled [#4151](https://github.com/rust-lang/libc/pull/4151) ++ ++## [0.2.165](https://github.com/rust-lang/libc/compare/0.2.164...0.2.165) - 2024-11-25 ++ ++### Added ++ ++- Android: add `mkostemp`, `mkostemps` ++- Android: add a few API 30 calls ++- Android: add missing syscall constants ++- Apple: add `in6_ifreq` ++- Apple: add missing `sysctl` net types (before release: remove `if_family_id` ([#4137](https://github.com/rust-lang/libc/pulls/4137))) ++- Freebsd: add `kcmp` call support ++- Hurd: add `MAP_32BIT` and `MAP_EXCL` ++- Hurd: add `domainname` field to `utsname` ([#4089](https://github.com/rust-lang/libc/pulls/4089)) ++- Linux GNU: add `f_flags` to struct `statfs` for arm, mips, powerpc and x86 ++- Linux GNU: add `malloc_stats` ++- Linux: add ELF relocation-related structs ++- Linux: add `ptp_*` structs ++- Linux: add `ptp_clock_caps` ++- Linux: add `ptp_pin_function` and most `PTP_` constants ++- Linux: add missing AF_XDP structs & constants ++- Linux: add missing netfilter consts ([#3734](https://github.com/rust-lang/libc/pulls/3734)) ++- Linux: add struct and constants for the `mount_setattr` syscall ++- Linux: add wireless API ++- Linux: expose the `len8_dlc` field of `can_frame` ++- Musl: add `utmpx` API ++- Musl: add missing syscall constants ++- NetBSD: add `mcontext`-related data for RISCV64 ++- Redox: add new `netinet` constants ) ++- Solarish: add `_POSIX_VDISABLE` ([#4103](https://github.com/rust-lang/libc/pulls/4103)) ++- Tests: Add a test that the `const extern fn` macro works ++- Tests: Add test of primitive types against `std` ++- Unix: Add `htonl`, `htons`, `ntohl`, `ntohs` ++- Unix: add `aligned_alloc` ++- Windows: add `aligned_realloc` ++ ++### Fixed ++ ++- **breaking** Hurd: fix `MAP_HASSEMAPHORE` name ([#4127](https://github.com/rust-lang/libc/pulls/4127)) ++- **breaking** ulibc Mips: fix `SA_*` mismatched types ([#3211](https://github.com/rust-lang/libc/pulls/3211)) ++- Aix: fix an enum FFI safety warning ++- Haiku: fix some typos ([#3664](https://github.com/rust-lang/libc/pulls/3664)) ++- Tests: fix `Elf{32,64}_Relr`-related tests ++- Tests: fix libc-tests for `loongarch64-linux-musl` ++- Tests: fix some clippy warnings ++- Tests: fix tests on `riscv64gc-unknown-freebsd` ++ ++### Deprecated ++ ++- Apple: deprecate `iconv_open` ++- Apple: deprecate `mach_task_self` ++- Apple: update `mach` deprecation notices for things that were removed in `main` ++ ++### Cleanup ++ ++- Adjust the `f!` macro to be more flexible ++- Aix: remove duplicate constants ++- CI: make scripts more uniform ++- Drop the `libc_align` conditional ++- Drop the `libc_cfg_target_vendor` conditional ++- Drop the `libc_const_size_of` conditional ++- Drop the `libc_core_cvoid` conditional ++- Drop the `libc_int128` conditional ++- Drop the `libc_non_exhaustive` conditional ++- Drop the `libc_packedN` conditional ++- Drop the `libc_priv_mod_use` conditional ++- Drop the `libc_union` conditional ++- Drop the `long_array` conditional ++- Drop the `ptr_addr_of` conditional ++- Drop warnings about deprecated cargo features ++- Eliminate uses of `struct_formatter` ++- Fix a few other array size hacks ++- Glibc: remove redundant definitions ([#3261](https://github.com/rust-lang/libc/pulls/3261)) ++- Musl: remove redundant definitions ([#3261](https://github.com/rust-lang/libc/pulls/3261)) ++- Musl: unify definitions of `siginfo_t` ([#3261](https://github.com/rust-lang/libc/pulls/3261)) ++- Musl: unify definitions of statfs and statfs64 ([#3261](https://github.com/rust-lang/libc/pulls/3261)) ++- Musl: unify definitions of statvfs and statvfs64 ([#3261](https://github.com/rust-lang/libc/pulls/3261)) ++- Musl: unify statx definitions ([#3978](https://github.com/rust-lang/libc/pulls/3978)) ++- Remove array size hacks for Rust < 1.47 ++- Remove repetitive words ++- Use #[derive] for Copy/Clone in s! and friends ++- Use some tricks to format macro bodies ++ ++### Other ++ ++- Apply formatting to macro bodies ++- Bump libc-test to Rust 2021 Edition ++- CI: Add a check that semver files don't contain duplicate entries ++- CI: Add `fanotify_event_info_fid` to FAM-exempt types ++- CI: Allow rustfmt to organize imports ([#4136](https://github.com/rust-lang/libc/pulls/4136)) ++- CI: Always run rustfmt ++- CI: Change 32-bit Docker images to use EOL repos ++- CI: Change 64-bit Docker images to ubuntu:24.10 ++- CI: Disable the check for >1 s! invocation ++- CI: Ensure build channels get run even if FILTER is unset ++- CI: Ensure there is a fallback for no_std ++- CI: Fix cases where unset variables cause errors ++- CI: Naming adjustments and cleanup ++- CI: Only invoke rustup if running in CI ++- CI: Remove the logic to handle old rust versions ++- CI: Set -u (error on unset) in all script files ++- CI: add support for `loongarch64-unknown-linux-musl` ++- CI: make `aarch64-apple-darwin` not a nightly-only target ++- CI: run shellcheck on all scripts ++- CI: update musl headers to Linux 6.6 ++- CI: use qemu-sparc64 to run sparc64 tests ++- Drop the `libc_const_extern_fn` conditional ++- Drop the `libc_underscore_const_names` conditional ++- Explicitly set the edition to 2015 ++- Introduce a `git-blame-ignore-revs` file ++- Tests: Ignore fields as required on Ubuntu 24.10 ++- Tests: skip `ATF_*` constants for OpenBSD ++- Triagebot: Add an autolabel for CI ++ ++## [0.2.164](https://github.com/rust-lang/libc/compare/0.2.163...0.2.164) - 2024-11-16 ++ ++### MSRV ++ ++This release increases the MSRV of `libc` to 1.63. ++ ++### Other ++ ++- CI: remove tests with rust < 1.63 ++- MSRV: document the MSRV of the stable channel to be 1.63 ++- MacOS: move ifconf to s_no_extra_traits ++ ++## [0.2.163](https://github.com/rust-lang/libc/compare/0.2.162...0.2.163) - 2024-11-16 ++ ++### Added ++ ++- Aix: add more `dlopen` flags ++- Android: add group calls ++- FreeBSD: add `TCP_FUNCTION_BLK` and `TCP_FUNCTION_ALIAS` ++- Linux: add `confstr` ++- Solarish: add `aio` ++- Solarish: add `arc4random*` ++ ++### Changed ++ ++- Emscripten: upgrade emsdk to 3.1.68 ++- Hurd: use more standard types ++- Hurd: use the standard `ssize_t = isize` ++- Solaris: fix `confstr` and `ucontext_t` ++ ++### Other ++ ++- CI: add Solaris ++- CI: add `i686-unknown-freebsd` ++- CI: ensure that calls to `sort` do not depend on locale ++- Specify `rust-version` in `Cargo.toml` ++ ++## [0.2.162](https://github.com/rust-lang/libc/compare/0.2.161...0.2.162) - 2024-11-07 ++ ++### Added ++ ++- Android: fix the alignment of `uc_mcontext` on arm64 ++- Apple: add `host_cpu_load_info` ++- ESP-IDF: add a time flag ++- FreeBSD: add the `CLOSE_RANGE_CLOEXEC` flag ++- FreeBSD: fix test errors regarding `__gregset_t` ++- FreeBSD: fix tests on x86 FreeBSD 15 ++- FreeBSD: make `ucontext_t` and `mcontext_t` available on all architectures ++- Haiku: add `getentropy` ++- Illumos: add `syncfs` ++- Illumos: add some recently-added constants ++- Linux: add `ioctl` flags ++- Linux: add epoll busy polling parameters ++- NuttX: add `pthread_[get/set]name_np` ++- RTEMS: add `arc4random_buf` ++- Trusty OS: add initial support ++- WASIp2: expand socket support ++ ++### Fixed ++ ++- Emscripten: don't pass `-lc` ++- Hurd: change `st_fsid` field to `st_dev` ++- Hurd: fix the definition of `utsname` ++- Illumos/Solaris: fix `FNM_CASEFOLD` definition ++- Solaris: fix all tests ++ ++### Other ++ ++- CI: Add loongarch64 ++- CI: Check that semver files are sorted ++- CI: Re-enable the FreeBSD 15 job ++- Clean up imports and `extern crate` usage ++- Convert `mode_t` constants to octal ++- Remove the `wasm32-wasi` target that has been deleted upstream ++ ++## [0.2.161](https://github.com/rust-lang/libc/compare/0.2.160...0.2.161) - 2024-10-17 ++ ++### Fixed ++ ++- OpenBSD: fix `FNM_PATHNAME` and `FNM_NOESCAPE` values ++ ++## [0.2.160](https://github.com/rust-lang/libc/compare/0.2.159...0.2.160) - 2024-10-17 ++ ++### Added ++ ++- Android: add `PR_GET_NAME` and `PR_SET_NAME` ++- Apple: add `F_TRANSFEREXTENTS` ++- Apple: add `mach_error_string` ++- Apple: add additional `pthread` APIs ++- Apple: add the `LOCAL_PEERTOKEN` socket option ++- BSD: add `RTF_*`, `RTA_*`, `RTAX_*`, and `RTM_*` definitions ++- Emscripten: add `AT_EACCESS` ++- Emscripten: add `getgrgid`, `getgrnam`, `getgrnam_r` and `getgrgid_r` ++- Emscripten: add `getpwnam_r` and `getpwuid_r` ++- FreeBSD: add `POLLRDHUP` ++- Haiku: add `arc4random` ++- Illumos: add `ptsname_r` ++- Linux: add `fanotify` interfaces ++- Linux: add `tcp_info` ++- Linux: add additional AF_PACKET options ++- Linux: make Elf constants always available ++- Musl x86: add `iopl` and `ioperm` ++- Musl: add `posix_spawn` chdir functions ++- Musl: add `utmpx.h` constants ++- NetBSD: add `sysctlnametomib`, `CLOCK_THREAD_CPUTIME_ID` and `CLOCK_PROCESS_CPUTIME_ID` ++- Nuttx: initial support ++- RTEMS: add `getentropy` ++- RTEMS: initial support ++- Solarish: add `POLLRDHUP`, `POSIX_FADV_*`, `O_RSYNC`, and `posix_fallocate` ++- Unix: add `fnmatch.h` ++- VxWorks: add riscv64 support ++- VxWorks: update constants related to the scheduler ++ ++### Changed ++ ++- Redox: change `ino_t` to be `c_ulonglong` ++ ++### Fixed ++ ++- ESP-IDF: fix mismatched constants and structs ++- FreeBSD: fix `struct stat` on FreeBSD 12+ ++ ++### Other ++ ++- CI: Fix CI for FreeBSD 15 ++- Docs: link to `windows-sys` ++ ++## [0.2.159](https://github.com/rust-lang/libc/compare/0.2.158...0.2.159) - 2024-09-24 ++ ++### Added ++ ++- Android: add more `AT_*` constants in ++- Apple: add missing `NOTE_*` constants in ++- Hermit: add missing error numbers in ++- Hurd: add `__timeval` for 64-bit support in ++- Linux: add `epoll_pwait2` in ++- Linux: add `mq_notify` in ++- Linux: add missing `NFT_CT_*` constants in ++- Linux: add the `fchmodat2` syscall in ++- Linux: add the `mseal` syscall in ++- OpenBSD: add `sendmmsg` and `recvmmsg` in ++- Unix: add `IN6ADDR_ANY_INIT` and `IN6ADDR_LOOPBACK_INIT` in ++- VxWorks: add `S_ISVTX` in ++- VxWorks: add `vxCpuLib` and `taskLib` functions ++- WASIp2: add definitions for `std::net` support in ++ ++### Fixed ++ ++- Correctly handle version checks when `clippy-driver` is used ++ ++### Changed ++ ++- EspIdf: change signal constants to c_int in ++- HorizonOS: update network definitions in ++- Linux: combine `ioctl` APIs in ++- WASI: enable CI testing in ++- WASIp2: enable CI testing in ++ ++## [0.2.158](https://github.com/rust-lang/libc/compare/0.2.157...0.2.158) - 2024-08-19 ++ ++### Other ++- WASI: fix missing `Iterator` with `rustc-dep-of-std` in ++ ++## [0.2.157](https://github.com/rust-lang/libc/compare/0.2.156...0.2.157) - 2024-08-17 ++ ++### Added ++ ++- Apple: add `_NSGetArgv`, `_NSGetArgc` and `_NSGetProgname` in ++- Build: add `RUSTC_WRAPPER` support in ++- FreeBSD: add `execvpe` support from 14.1 release in ++- Fuchsia: add `SO_BINDTOIFINDEX` ++- Linux: add `klogctl` in ++- MacOS: add `fcntl` OFD commands in ++- NetBSD: add `_lwp_park` in ++- Solaris: add missing networking support in ++- Unix: add `pthread_equal` in ++- WASI: add `select`, `FD_SET`, `FD_ZERO`, `FD_ISSET ` in ++ ++### Fixed ++- TEEOS: fix octal notation for `O_*` constants in ++ ++### Changed ++- FreeBSD: always use freebsd12 when `rustc_dep_of_std` is set in ++ ++## [0.2.156](https://github.com/rust-lang/libc/compare/v0.2.155...v0.2.156) - 2024-08-15 ++ ++### Added ++- Apple: add `F_ALLOCATEPERSIST` in ++- Apple: add `os_sync_wait_on_address` and related definitions in ++- BSD: generalise `IPV6_DONTFRAG` to all BSD targets in ++- FreeBSD/DragonFly: add `IP_RECVTTL`/`IPV6_RECVHOPLIMIT` in ++- Hurd: add `XATTR_CREATE`, `XATTR_REPLACE` in ++- Linux GNU: `confstr` API and `_CS_*` in ++- Linux musl: add `preadv2` and `pwritev2` (1.2.5 min.) in ++- VxWorks: add the constant `SOMAXCONN` in ++- VxWorks: add a few errnoLib related constants in ++ ++### Fixed ++- Solaris/illumos: Change `ifa_flags` type to u64 in ++- QNX 7.0: Disable `libregex` in ++ ++### Changed ++- QNX NTO: update platform support in ++- `addr_of!(EXTERN_STATIC)` is now considered safe in ++ ++### Removed ++- Apple: remove `rmx_state` in ++ ++### Other ++- Update or remove CI tests that have been failing +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/CONTRIBUTING.md mesa-25.3.3/subprojects/libc-0.2.169/CONTRIBUTING.md +--- mesa-25.3.3/subprojects/libc-0.2.169/CONTRIBUTING.md 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/CONTRIBUTING.md 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,126 @@ ++# Contributing to `libc` ++ ++Welcome! If you are reading this document, it means you are interested in ++contributing to the `libc` crate. ++ ++## v1.0 Roadmap ++ ++`libc` has two active branches: `main` and `libc-0.2`. `main` is for active ++development of the upcoming v1.0 release, and should be the target of all pull ++requests. `libc-0.2` is for updates to the currently released version. ++ ++If a pull request to `main` is a good candidate for inclusion in an `0.2.x` ++release, include `@rustbot label stable-nominated` in a comment to propose this. ++Good candidates will usually meet the following: ++ ++1. The included changes are non-breaking. ++2. The change applies cleanly to both branches. ++3. There is a usecase that justifies inclusion in a stable release (all ++ additions should always have a usecase, hopefully). ++ ++Once a `stable-nominated` PR targeting `main` has merged, it can be cherry ++picked to the `libc-0.2` branch. A maintainer will likely do these cherry picks ++in a batch. ++ ++Alternatively, you can start this process yourself by creating a new branch ++based on `libc-0.2` and running `git cherry-pick -xe commit-sha-on-main` ++(`git ++cherry-pick -xe start-sha^..end-sha` if a range of commits is needed). ++`git` will automatically add the "cherry picked from commit" note, but try to ++add a backport note so the original PR gets crosslinked: ++ ++``` ++# ... original commit message ... ++ ++(backport ) # add manually ++(cherry picked from commit 104b6a4ae31c726814c36318dc718470cc96e167) # added by git ++``` ++ ++Once the cherry-pick is complete, open a PR targeting `libc-0.2`. ++ ++See the [tracking issue](https://github.com/rust-lang/libc/issues/3248) for ++details. ++ ++## Adding an API ++ ++Want to use an API which currently isn't bound in `libc`? It's quite easy to add ++one! ++ ++The internal structure of this crate is designed to minimize the number of ++`#[cfg]` attributes in order to easily be able to add new items which apply to ++all platforms in the future. As a result, the crate is organized hierarchically ++based on platform. Each module has a number of `#[cfg]`'d children, but only one ++is ever actually compiled. Each module then reexports all the contents of its ++children. ++ ++This means that for each platform that libc supports, the path from a leaf ++module to the root will contain all bindings for the platform in question. ++Consequently, this indicates where an API should be added! Adding an API at a ++particular level in the hierarchy means that it is supported on all the child ++platforms of that level. For example, when adding a Unix API it should be added ++to `src/unix/mod.rs`, but when adding a Linux-only API it should be added to ++`src/unix/linux_like/linux/mod.rs`. ++ ++If you're not 100% sure at what level of the hierarchy an API should be added ++at, fear not! This crate has CI support which tests any binding against all ++platforms supported, so you'll see failures if an API is added at the wrong ++level or has different signatures across platforms. ++ ++New symbol(s) (i.e. functions, constants etc.) should also be added to the ++symbols list(s) found in the `libc-test/semver` directory. These lists keep ++track of what symbols are public in the libc crate and ensures they remain ++available between changes to the crate. If the new symbol(s) are available on ++all supported Unixes it should be added to `unix.txt` list1, ++otherwise they should be added to the OS specific list(s). ++ ++With that in mind, the steps for adding a new API are: ++ ++1. Determine where in the module hierarchy your API should be added. ++2. Add the API, including adding new symbol(s) to the semver lists. ++3. Send a PR to this repo. ++4. Wait for CI to pass, fixing errors. ++5. Wait for a merge! ++ ++1: Note that this list has nothing to do with any Unix or Posix ++standard, it's just a list shared among all OSs that declare `#[cfg(unix)]`. ++ ++## Test before you commit ++ ++We have two automated tests running on ++[GitHub Actions](https://github.com/rust-lang/libc/actions): ++ ++1. [`libc-test`](https://github.com/gnzlbg/ctest) ++ - `cd libc-test && cargo test` ++ - Use the `skip_*()` functions in `build.rs` if you really need a workaround. ++2. Style checker ++ - [`./ci/style.sh`](https://github.com/rust-lang/libc/blob/main/ci/style.sh) ++ ++## Breaking change policy ++ ++Sometimes an upstream adds a breaking change to their API e.g. removing outdated ++items, changing the type signature, etc. And we probably should follow that ++change to build the `libc` crate successfully. It's annoying to do the ++equivalent of semver-major versioning for each such change. Instead, we mark the ++item as deprecated and do the actual change after a certain period. The steps ++are: ++ ++1. Add `#[deprecated(since = "", note="")]` attribute to the item. ++ - The `since` field should have a next version of `libc` (e.g., if the current ++ version is `0.2.1`, it should be `0.2.2`). ++ - The `note` field should have a reason to deprecate and a tracking issue to ++ call for comments (e.g., "We consider removing this as the upstream removed ++ it. 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 at any time. ++ ++## Releasing your change to crates.io ++ ++This repository uses [release-plz] to handle releases. Once your pull request ++has been merged, a maintainer just needs to verify the generated changelog, then ++merge the bot's release PR. This will automatically publish to crates.io! ++ ++[release-plz]: https://github.com/MarcoIeni/release-plz +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/series mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/series +--- mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/series 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/series 2024-12-28 15:35:00.000000000 -0500 +@@ -0,0 +1,20 @@ ++time64-010-add-cfg-option.patch ++time64-020-exclude-x32.patch ++time64-025-exclude-i386.patch ++time64-030-basic-file-and-time.patch ++time64-035-timex_t.patch ++time64-040-use-time64-symbols.patch ++time64-050-update-struct-input_event.patch ++time64-060-handle-tv_usec.patch ++time64-080-socket-options.patch ++time64-090-mips-rlim.patch ++time64-100-shmid.patch ++time64-105-stat.patch ++time64-108-fix-stat-i386.patch ++time64-110-msquid.patch ++time64-120-semid.patch ++time64-130-getlk.patch ++time64-140-setlk.patch ++time64-150-aiocb.patch ++time64-160-timespec.patch ++time64-190-fix-clock-nanosleep-i386.patch +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-010-add-cfg-option.patch mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-010-add-cfg-option.patch +--- mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-010-add-cfg-option.patch 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-010-add-cfg-option.patch 2024-12-28 15:35:00.000000000 -0500 +@@ -0,0 +1,67 @@ ++This patch is based on the commit described below, taken from upstream pull ++request 3175, it was adapted for use in the Debian package by Peter Michael ++Green. ++ ++commit d0c905b147ad46c7e81a62199ba3c57935d66723 ++Author: Ola x Nilsson ++Date: Thu Sep 7 15:14:34 2023 +0200 ++ ++ Add cfg option gnu_time64_abi ++ ++Index: libc/build.rs ++=================================================================== ++--- libc.orig/build.rs +++++ libc/build.rs ++@@ -13,6 +13,7 @@ const ALLOWED_CFGS: &'static [&'static s ++ "freebsd13", ++ "freebsd14", ++ "freebsd15", +++ "gnu_time64_abi", ++ // FIXME(ctest): this config shouldn't be needed but ctest can't parse `const extern fn` ++ "libc_const_extern_fn", ++ "libc_deny_warnings", ++@@ -79,6 +80,11 @@ fn main() { ++ Some(_) | None => (), ++ } ++ +++ // Some ABIs need to redirect time related symbols to their time64 equivalents. +++ if is_gnu_time64_abi() { +++ set_cfg("gnu_time64_abi"); +++ } +++ ++ // On CI: deny all warnings ++ if libc_ci { ++ set_cfg("libc_deny_warnings"); ++@@ -235,3 +241,32 @@ fn set_cfg(cfg: &str) { ++ } ++ println!("cargo:rustc-cfg={}", cfg); ++ } +++ +++fn is_gnu_time64_abi() -> bool { +++ match env::var("CARGO_CFG_TARGET_ENV") { +++ Ok(target_env) => { +++ if target_env != "gnu" { +++ return false; +++ } +++ } +++ Err(_) => panic!("CARGO_CFG_TARGET_ENV not set"), +++ } +++ match env::var("CARGO_CFG_TARGET_OS") { +++ Ok(target_os) => { +++ if target_os != "linux" { +++ return false; +++ } +++ } +++ Err(_) => panic!("CARGO_CFG_TARGET_OS not set"), +++ } +++ match env::var("CARGO_CFG_TARGET_POINTER_WIDTH") { +++ Ok(bits) => { +++ if bits == "64" { +++ return false; +++ } +++ bits +++ } +++ Err(_) => panic!("CARGO_CFG_TARGET_POINTER_WIDTH not set"), +++ }; +++ return true; +++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-020-exclude-x32.patch mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-020-exclude-x32.patch +--- mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-020-exclude-x32.patch 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-020-exclude-x32.patch 2024-12-28 15:35:00.000000000 -0500 +@@ -0,0 +1,27 @@ ++commit 271d07eaca5f05324a9965f94e67287c31c3bc0d ++Author: Ola x Nilsson ++Date: Tue Sep 12 14:06:10 2023 +0200 ++ ++ x86_64_x32 have 64 bit time_t ++ ++diff --git a/build.rs b/build.rs ++index 787c25cdd6..f5aff2024e 100644 ++--- a/build.rs +++++ b/build.rs ++@@ -236,5 +236,16 @@ fn is_gnu_time64_abi() -> bool { ++ } ++ Err(_) => panic!("CARGO_CFG_TARGET_POINTER_WIDTH not set"), ++ }; +++ // At this point, we _know_ it is *-*-linux-gnu* with 32 bit +++ // pointers. Some 64 bit arch still have 32 bit pointers though. +++ match env::var("TARGET") { +++ Ok(target) => { +++ // x86_64-unknown-linux-gnux32 and similar +++ if target.contains("x86_64") && target.contains("x32") { +++ return false; +++ } +++ } +++ Err(_) => panic!("TARGET not set"), +++ } ++ return true; ++ } +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-025-exclude-i386.patch mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-025-exclude-i386.patch +--- mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-025-exclude-i386.patch 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-025-exclude-i386.patch 2024-12-28 15:35:00.000000000 -0500 +@@ -0,0 +1,19 @@ ++Index: libc/build.rs ++=================================================================== ++--- libc.orig/build.rs +++++ libc/build.rs ++@@ -303,6 +303,14 @@ fn set_cfg(cfg: &str) { ++ } ++ ++ fn is_gnu_time64_abi() -> bool { +++ match env::var("CARGO_CFG_TARGET_ARCH") { +++ Ok(target_arch) => { +++ if target_arch == "x86" { +++ return false; +++ } +++ } +++ Err(_) => panic!("CARGO_CFG_TARGET_ARCH not set"), +++ } ++ match env::var("CARGO_CFG_TARGET_ENV") { ++ Ok(target_env) => { ++ if target_env != "gnu" { +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-030-basic-file-and-time.patch mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-030-basic-file-and-time.patch +--- mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-030-basic-file-and-time.patch 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-030-basic-file-and-time.patch 2024-12-28 15:35:00.000000000 -0500 +@@ -0,0 +1,29 @@ ++commit 91f04dfe1d93b8d2d383999ff5faf6411961caa1 ++Author: Ola x Nilsson ++Date: Fri Mar 17 09:54:34 2023 +0100 ++ ++ gnu: Handle basic file and time types for 32bit systems with time64 ++ ++ 32bit gnu types when _TIME_BITS=64 and _FILE_OFFSET_BITS=64 ++ ++diff --git a/src/unix/linux_like/linux/gnu/b32/mod.rs b/src/unix/linux_like/linux/gnu/b32/mod.rs ++index 54c84fa617..7cc9fb08e7 100644 ++--- a/src/unix/linux_like/linux/gnu/b32/mod.rs +++++ b/src/unix/linux_like/linux/gnu/b32/mod.rs ++@@ -28,6 +28,16 @@ cfg_if! { ++ pub type fsfilcnt_t = u64; ++ pub type rlim_t = u64; ++ pub type blksize_t = i64; +++ } else if #[cfg(gnu_time64_abi)] { +++ pub type time_t = i64; +++ pub type suseconds_t = i32; +++ pub type ino_t = u64; +++ pub type off_t = i64; +++ pub type blkcnt_t = i64; +++ pub type fsblkcnt_t = u64; +++ pub type fsfilcnt_t = u64; +++ pub type rlim_t = u64; +++ pub type blksize_t = i32; ++ } else { ++ pub type time_t = i32; ++ pub type suseconds_t = i32; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-035-timex_t.patch mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-035-timex_t.patch +--- mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-035-timex_t.patch 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-035-timex_t.patch 2024-12-28 15:35:00.000000000 -0500 +@@ -0,0 +1,295 @@ ++This patch is based on the commit described below, taken from the upstream ++time64 pull request, adapted for use in the Debian package by Peter Michael ++Green. ++ ++commit fc5c42dd8d00acd651a53950d44b6284a00979b0 ++Author: Ola x Nilsson ++Date: Fri Mar 17 15:20:29 2023 +0100 ++ ++ gnu: Move struct timex_t to gnu/b* and support _TIME_BITS=64 ++ ++Index: libc/src/unix/linux_like/linux/gnu/b32/mod.rs ++=================================================================== ++--- libc.orig/src/unix/linux_like/linux/gnu/b32/mod.rs +++++ libc/src/unix/linux_like/linux/gnu/b32/mod.rs ++@@ -1,6 +1,7 @@ ++ //! 32-bit specific definitions for linux-like values ++ ++ use crate::prelude::*; +++use crate::ntptimeval; ++ use crate::pthread_mutex_t; ++ ++ pub type c_long = i32; ++@@ -18,6 +19,7 @@ pub type fsblkcnt64_t = u64; ++ pub type fsfilcnt64_t = u64; ++ pub type __syscall_ulong_t = c_ulong; ++ +++pub type __syscall_slong_t = c_long; ++ cfg_if! { ++ if #[cfg(target_arch = "riscv32")] { ++ pub type time_t = i64; ++@@ -170,6 +172,92 @@ s! { ++ __glibc_reserved3: crate::__syscall_ulong_t, ++ __glibc_reserved4: crate::__syscall_ulong_t, ++ } +++ +++ pub struct timex { +++ pub modes: c_uint, +++ +++ #[cfg(not(gnu_time64_abi))] +++ pub offset: crate::__syscall_slong_t, +++ #[cfg(gnu_time64_abi)] +++ pub __unused_pad1: i32, +++ #[cfg(gnu_time64_abi)] +++ pub offset: c_longlong, +++ #[cfg(not(gnu_time64_abi))] +++ pub freq: crate::__syscall_slong_t, +++ #[cfg(gnu_time64_abi)] +++ pub freq: c_longlong, +++ #[cfg(not(gnu_time64_abi))] +++ pub maxerror: crate::__syscall_slong_t, +++ #[cfg(gnu_time64_abi)] +++ pub maxerror: c_longlong, +++ #[cfg(not(gnu_time64_abi))] +++ pub esterror: crate::__syscall_slong_t, +++ #[cfg(gnu_time64_abi)] +++ pub esterror: c_longlong, +++ pub status: c_int, +++ #[cfg(not(gnu_time64_abi))] +++ pub constant: crate::__syscall_slong_t, +++ #[cfg(gnu_time64_abi)] +++ pub __unused_pad2: i32, +++ #[cfg(gnu_time64_abi)] +++ pub constant: c_longlong, +++ #[cfg(not(gnu_time64_abi))] +++ pub precision: crate::__syscall_slong_t, +++ #[cfg(gnu_time64_abi)] +++ pub precision: c_longlong, +++ #[cfg(not(gnu_time64_abi))] +++ pub tolerance: crate::__syscall_slong_t, +++ #[cfg(gnu_time64_abi)] +++ pub tolerance: c_longlong, +++ pub time: crate::timeval, +++ #[cfg(not(gnu_time64_abi))] +++ pub tick: crate::__syscall_slong_t, +++ #[cfg(gnu_time64_abi)] +++ pub tick: c_longlong, +++ #[cfg(not(gnu_time64_abi))] +++ pub ppsfreq: crate::__syscall_slong_t, +++ #[cfg(gnu_time64_abi)] +++ pub ppsfreq: c_longlong, +++ #[cfg(not(gnu_time64_abi))] +++ pub jitter: crate::__syscall_slong_t, +++ #[cfg(gnu_time64_abi)] +++ pub jitter: c_longlong, +++ pub shift: c_int, +++ #[cfg(not(gnu_time64_abi))] +++ pub stabil: crate::__syscall_slong_t, +++ #[cfg(gnu_time64_abi)] +++ pub __unused_pad3: i32, +++ #[cfg(gnu_time64_abi)] +++ pub stabil: c_longlong, +++ #[cfg(not(gnu_time64_abi))] +++ pub jitcnt: crate::__syscall_slong_t, +++ #[cfg(gnu_time64_abi)] +++ pub jitcnt: c_longlong, +++ #[cfg(not(gnu_time64_abi))] +++ pub calcnt: crate::__syscall_slong_t, +++ #[cfg(gnu_time64_abi)] +++ pub calcnt: c_longlong, +++ #[cfg(not(gnu_time64_abi))] +++ pub errcnt: crate::__syscall_slong_t, +++ #[cfg(gnu_time64_abi)] +++ pub errcnt: c_longlong, +++ #[cfg(not(gnu_time64_abi))] +++ pub stbcnt: crate::__syscall_slong_t, +++ #[cfg(gnu_time64_abi)] +++ pub stbcnt: c_longlong, +++ pub tai: c_int, +++ pub __unused1: i32, +++ pub __unused2: i32, +++ pub __unused3: i32, +++ pub __unused4: i32, +++ pub __unused5: i32, +++ pub __unused6: i32, +++ pub __unused7: i32, +++ pub __unused8: i32, +++ pub __unused9: i32, +++ pub __unused10: i32, +++ pub __unused11: i32, +++ } ++ } ++ ++ pub const POSIX_FADV_DONTNEED: c_int = 4; ++Index: libc/src/unix/linux_like/linux/gnu/b64/mod.rs ++=================================================================== ++--- libc.orig/src/unix/linux_like/linux/gnu/b64/mod.rs +++++ libc/src/unix/linux_like/linux/gnu/b64/mod.rs ++@@ -2,6 +2,8 @@ ++ ++ use crate::prelude::*; ++ +++use crate::ntptimeval; +++ ++ pub type ino_t = u64; ++ pub type off_t = i64; ++ pub type blkcnt_t = i64; ++@@ -11,12 +13,17 @@ pub type msglen_t = u64; ++ pub type fsblkcnt_t = u64; ++ pub type fsfilcnt_t = u64; ++ pub type rlim_t = u64; ++-#[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++-pub type __syscall_ulong_t = c_ulonglong; ++-#[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] ++-pub type __syscall_ulong_t = c_ulong; ++ ++ cfg_if! { +++ if #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] { +++ pub type __syscall_ulong_t = c_ulonglong; +++ pub type __syscall_slong_t = c_longlong; +++ } else { +++ pub type __syscall_ulong_t = c_ulong; +++ pub type __syscall_slong_t = c_long; +++ } +++} +++cfg_if! { ++ if #[cfg(all(target_arch = "aarch64", target_pointer_width = "32"))] { ++ pub type clock_t = i32; ++ pub type time_t = i32; ++@@ -95,6 +102,46 @@ s! { ++ __glibc_reserved3: crate::__syscall_ulong_t, ++ __glibc_reserved4: crate::__syscall_ulong_t, ++ } +++ +++ pub struct timex { +++ pub modes: c_uint, +++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] +++ pub __unused_pad1: i32, +++ pub offset: crate::__syscall_slong_t, +++ pub freq: crate::__syscall_slong_t, +++ pub maxerror: crate::__syscall_slong_t, +++ pub esterror: crate::__syscall_slong_t, +++ pub status: c_int, +++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] +++ pub __unused_pad2: i32, +++ pub constant: crate::__syscall_slong_t, +++ pub precision: crate::__syscall_slong_t, +++ pub tolerance: crate::__syscall_slong_t, +++ pub time: crate::timeval, +++ pub tick: crate::__syscall_slong_t, +++ pub ppsfreq: crate::__syscall_slong_t, +++ pub jitter: crate::__syscall_slong_t, +++ pub shift: c_int, +++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] +++ pub __unused_pad3: i32, +++ pub stabil: crate::__syscall_slong_t, +++ pub jitcnt: crate::__syscall_slong_t, +++ pub calcnt: crate::__syscall_slong_t, +++ pub errcnt: crate::__syscall_slong_t, +++ pub stbcnt: crate::__syscall_slong_t, +++ pub tai: c_int, +++ pub __unused1: i32, +++ pub __unused2: i32, +++ pub __unused3: i32, +++ pub __unused4: i32, +++ pub __unused5: i32, +++ pub __unused6: i32, +++ pub __unused7: i32, +++ pub __unused8: i32, +++ pub __unused9: i32, +++ pub __unused10: i32, +++ pub __unused11: i32, +++ } ++ } ++ ++ pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8; ++Index: libc/src/unix/linux_like/linux/gnu/mod.rs ++=================================================================== ++--- libc.orig/src/unix/linux_like/linux/gnu/mod.rs +++++ libc/src/unix/linux_like/linux/gnu/mod.rs ++@@ -170,85 +170,6 @@ s! { ++ pub rt_irtt: c_ushort, ++ } ++ ++- pub struct timex { ++- pub modes: c_uint, ++- #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++- pub offset: i64, ++- #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] ++- pub offset: c_long, ++- #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++- pub freq: i64, ++- #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] ++- pub freq: c_long, ++- #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++- pub maxerror: i64, ++- #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] ++- pub maxerror: c_long, ++- #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++- pub esterror: i64, ++- #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] ++- pub esterror: c_long, ++- pub status: c_int, ++- #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++- pub constant: i64, ++- #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] ++- pub constant: c_long, ++- #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++- pub precision: i64, ++- #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] ++- pub precision: c_long, ++- #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++- pub tolerance: i64, ++- #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] ++- pub tolerance: c_long, ++- pub time: crate::timeval, ++- #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++- pub tick: i64, ++- #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] ++- pub tick: c_long, ++- #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++- pub ppsfreq: i64, ++- #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] ++- pub ppsfreq: c_long, ++- #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++- pub jitter: i64, ++- #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] ++- pub jitter: c_long, ++- pub shift: c_int, ++- #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++- pub stabil: i64, ++- #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] ++- pub stabil: c_long, ++- #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++- pub jitcnt: i64, ++- #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] ++- pub jitcnt: c_long, ++- #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++- pub calcnt: i64, ++- #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] ++- pub calcnt: c_long, ++- #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++- pub errcnt: i64, ++- #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] ++- pub errcnt: c_long, ++- #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++- pub stbcnt: i64, ++- #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] ++- pub stbcnt: c_long, ++- pub tai: c_int, ++- pub __unused1: i32, ++- pub __unused2: i32, ++- pub __unused3: i32, ++- pub __unused4: i32, ++- pub __unused5: i32, ++- pub __unused6: i32, ++- pub __unused7: i32, ++- pub __unused8: i32, ++- pub __unused9: i32, ++- pub __unused10: i32, ++- pub __unused11: i32, ++- } ++- ++ pub struct ntptimeval { ++ pub time: crate::timeval, ++ pub maxerror: c_long, +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-040-use-time64-symbols.patch mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-040-use-time64-symbols.patch +--- mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-040-use-time64-symbols.patch 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-040-use-time64-symbols.patch 2024-12-28 15:35:00.000000000 -0500 +@@ -0,0 +1,440 @@ ++commit 3c3c01f9e5da55f8843e5d111a430bc75af4c600 ++Author: Ola x Nilsson ++Date: Fri Mar 17 08:44:44 2023 +0100 ++ ++ gnu: Use _TIME_BITS and _FILE_OFFSET_BITS=64 versions of glibc symbols ++ ++ Set the link names of relevant symbols to use be the same as when a C ++ program is built against GNU libc with -D_TIME_BITS=64 and ++ -D_FILE_OFFSET_BITS=64. ++ ++--- a/src/unix/linux_like/linux/gnu/b32/mod.rs +++++ b/src/unix/linux_like/linux/gnu/b32/mod.rs ++@@ -340,2 +340,4 @@ ++ ) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "__ntp_gettime64")] +++ pub fn ntp_gettime(buf: *mut ntptimeval) -> c_int; ++ } ++--- a/src/unix/linux_like/linux/gnu/b64/mod.rs +++++ b/src/unix/linux_like/linux/gnu/b64/mod.rs ++@@ -103,2 +103,7 @@ ++ +++extern "C" { +++ #[link_name = "ntp_gettimex"] +++ pub fn ntp_gettime(buf: *mut crate::ntptimeval) -> c_int; +++} +++ ++ cfg_if! { ++--- a/src/unix/linux_like/linux/gnu/mod.rs +++++ b/src/unix/linux_like/linux/gnu/mod.rs ++@@ -1295,2 +1295,3 @@ ++ ); +++ #[cfg_attr(gnu_time64_abi, link_name = "__sendmmsg64")] ++ pub fn sendmmsg( ++@@ -1301,2 +1302,3 @@ ++ ) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "__recvmmsg64")] ++ pub fn recvmmsg( ++@@ -1312,4 +1314,7 @@ ++ -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "getrlimit64")] ++ pub fn getrlimit(resource: crate::__rlimit_resource_t, rlim: *mut crate::rlimit) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "setrlimit64")] ++ pub fn setrlimit(resource: crate::__rlimit_resource_t, rlim: *const crate::rlimit) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "prlimit64")] ++ pub fn prlimit( ++@@ -1336,2 +1341,3 @@ ++ pub fn mallopt(param: c_int, value: c_int) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "__gettimeofday64")] ++ pub fn gettimeofday(tp: *mut crate::timeval, tz: *mut crate::timezone) -> c_int; ++@@ -1341,6 +1347,7 @@ ++ +++ #[cfg_attr(gnu_time64_abi, link_name = "___adjtimex64")] ++ pub fn adjtimex(buf: *mut timex) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "___adjtimex64")] ++ pub fn ntp_adjtime(buf: *mut timex) -> c_int; ++- #[link_name = "ntp_gettimex"] ++- pub fn ntp_gettime(buf: *mut ntptimeval) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "__clock_adjtime64")] ++ pub fn clock_adjtime(clk_id: crate::clockid_t, buf: *mut crate::timex) -> c_int; ++@@ -1354,2 +1361,3 @@ ++ ) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "preadv64v2")] ++ pub fn preadv2( ++@@ -1361,2 +1369,3 @@ ++ ) -> ssize_t; +++ #[cfg_attr(gnu_time64_abi, link_name = "pwritev64v2")] ++ pub fn pwritev2( ++@@ -1397,2 +1406,3 @@ ++ pub fn backtrace(buf: *mut *mut c_void, sz: c_int) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "__glob64_time64")] ++ pub fn glob64( ++@@ -1403,2 +1413,3 @@ ++ ) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "__globfree64_time64")] ++ pub fn globfree64(pglob: *mut glob64_t); ++@@ -1469,2 +1480,3 @@ ++ pub fn asctime_r(tm: *const crate::tm, buf: *mut c_char) -> *mut c_char; +++ #[cfg_attr(gnu_time64_abi, link_name = "__ctime64_r")] ++ pub fn ctime_r(timep: *const time_t, buf: *mut c_char) -> *mut c_char; ++--- a/src/unix/linux_like/linux/mod.rs +++++ b/src/unix/linux_like/linux/mod.rs ++@@ -6007,7 +6007,12 @@ ++ extern "C" { +++ #[cfg_attr(gnu_time64_abi, link_name = "aio_read64")] ++ pub fn aio_read(aiocbp: *mut aiocb) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "aio_write64")] ++ pub fn aio_write(aiocbp: *mut aiocb) -> c_int; ++ pub fn aio_fsync(op: c_int, aiocbp: *mut aiocb) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "aio_error64")] ++ pub fn aio_error(aiocbp: *const aiocb) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "aio_return64")] ++ pub fn aio_return(aiocbp: *mut aiocb) -> ssize_t; +++ #[cfg_attr(gnu_time64_abi, link_name = "__aio_suspend_time64")] ++ pub fn aio_suspend( ++@@ -6017,3 +6022,5 @@ ++ ) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "aio_cancel64")] ++ pub fn aio_cancel(fd: c_int, aiocbp: *mut aiocb) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "lio_listio64")] ++ pub fn lio_listio( ++@@ -6031,2 +6038,3 @@ ++ extern "C" { +++ #[cfg_attr(gnu_time64_abi, link_name = "pwritev64")] ++ pub fn pwritev( ++@@ -6037,2 +6045,3 @@ ++ ) -> ssize_t; +++ #[cfg_attr(gnu_time64_abi, link_name = "preadv64")] ++ pub fn preadv( ++@@ -6072,2 +6081,3 @@ ++ ) -> isize; +++ #[cfg_attr(gnu_time64_abi, link_name = "__futimes64")] ++ pub fn futimes(fd: c_int, times: *const crate::timeval) -> c_int; ++@@ -6104,2 +6114,3 @@ ++ ) -> ssize_t; +++ #[cfg_attr(gnu_time64_abi, link_name = "__mq_timedreceive_time64")] ++ pub fn mq_timedreceive( ++@@ -6111,2 +6122,3 @@ ++ ) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "__mq_timedsend_time64")] ++ pub fn mq_timedsend( ++@@ -6161,2 +6173,3 @@ ++ +++ #[cfg_attr(gnu_time64_abi, link_name = "__lutimes64")] ++ pub fn lutimes(file: *const c_char, times: *const crate::timeval) -> c_int; ++@@ -6182,2 +6195,3 @@ ++ pub fn shmdt(shmaddr: *const c_void) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "__shmctl64")] ++ pub fn shmctl(shmid: c_int, cmd: c_int, buf: *mut crate::shmid_ds) -> c_int; ++@@ -6186,3 +6200,5 @@ ++ pub fn semop(semid: c_int, sops: *mut crate::sembuf, nsops: size_t) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "__semctl64")] ++ pub fn semctl(semid: c_int, semnum: c_int, cmd: c_int, ...) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "__msgctl64")] ++ pub fn msgctl(msqid: c_int, cmd: c_int, buf: *mut msqid_ds) -> c_int; ++@@ -6201,3 +6217,5 @@ ++ +++ #[cfg_attr(gnu_time64_abi, link_name = "fallocate64")] ++ pub fn fallocate(fd: c_int, mode: c_int, offset: off_t, len: off_t) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "posix_fallocate64")] ++ pub fn posix_fallocate(fd: c_int, offset: off_t, len: off_t) -> c_int; ++@@ -6251,3 +6269,5 @@ ++ pub fn timerfd_create(clockid: crate::clockid_t, flags: c_int) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "__timerfd_gettime64")] ++ pub fn timerfd_gettime(fd: c_int, curr_value: *mut itimerspec) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "__timerfd_settime64")] ++ pub fn timerfd_settime( ++@@ -6308,2 +6328,3 @@ ++ +++ #[cfg_attr(gnu_time64_abi, link_name = "__glob64_time64")] ++ pub fn glob( ++@@ -6314,2 +6335,3 @@ ++ ) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "__globfree64_time64")] ++ pub fn globfree(pglob: *mut crate::glob_t); ++@@ -6339,2 +6361,3 @@ ++ ) -> ssize_t; +++ #[cfg_attr(gnu_time64_abi, link_name = "mkstemps64")] ++ pub fn mkstemps(template: *mut c_char, suffixlen: c_int) -> c_int; ++@@ -6375,2 +6398,3 @@ ++ pub fn tee(fd_in: c_int, fd_out: c_int, len: size_t, flags: c_uint) -> ssize_t; +++ #[cfg_attr(gnu_time64_abi, link_name = "__settimeofday64")] ++ pub fn settimeofday(tv: *const crate::timeval, tz: *const crate::timezone) -> c_int; ++@@ -6390,3 +6414,5 @@ ++ +++ #[cfg_attr(gnu_time64_abi, link_name = "__sched_rr_get_interval64")] ++ pub fn sched_rr_get_interval(pid: crate::pid_t, tp: *mut crate::timespec) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "__sem_timedwait64")] ++ pub fn sem_timedwait(sem: *mut sem_t, abstime: *const crate::timespec) -> c_int; ++@@ -6406,4 +6432,6 @@ ++ pub fn personality(persona: c_ulong) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "__prctl_time64")] ++ pub fn prctl(option: c_int, ...) -> c_int; ++ pub fn sched_getparam(pid: crate::pid_t, param: *mut crate::sched_param) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "__ppoll64")] ++ pub fn ppoll( ++@@ -6420,2 +6448,3 @@ ++ +++ #[cfg_attr(gnu_time64_abi, link_name = "__pthread_mutex_timedlock64")] ++ pub fn pthread_mutex_timedlock( ++@@ -6454,2 +6483,10 @@ ++ pub fn sched_getscheduler(pid: crate::pid_t) -> c_int; +++ #[cfg_attr( +++ all( +++ target_env = "gnu", +++ target_pointer_width = "32", +++ not(target_arch = "x86_64") +++ ), +++ link_name = "__clock_nanosleep_time64" +++ )] ++ pub fn clock_nanosleep( ++@@ -6505,2 +6542,3 @@ ++ ) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "sendfile64")] ++ pub fn sendfile(out_fd: c_int, in_fd: c_int, offset: *mut off_t, count: size_t) -> ssize_t; ++@@ -6710,3 +6748,5 @@ ++ pub fn timer_getoverrun(timerid: crate::timer_t) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "__timer_gettime64")] ++ pub fn timer_gettime(timerid: crate::timer_t, curr_value: *mut crate::itimerspec) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "__timer_settime64")] ++ pub fn timer_settime( ++@@ -6752,2 +6792,3 @@ ++ +++ #[cfg_attr(gnu_time64_abi, link_name = "__ioctl_time64")] ++ pub fn ioctl(fd: c_int, request: Ioctl, ...) -> c_int; ++--- a/src/unix/linux_like/mod.rs +++++ b/src/unix/linux_like/mod.rs ++@@ -1751,4 +1751,7 @@ ++ +++ #[cfg_attr(gnu_time64_abi, link_name = "__clock_getres64")] ++ pub fn clock_getres(clk_id: crate::clockid_t, tp: *mut crate::timespec) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "__clock_gettime64")] ++ pub fn clock_gettime(clk_id: crate::clockid_t, tp: *mut crate::timespec) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "__clock_settime64")] ++ pub fn clock_settime(clk_id: crate::clockid_t, tp: *const crate::timespec) -> c_int; ++@@ -1767,7 +1770,12 @@ ++ pub fn pipe2(fds: *mut c_int, flags: c_int) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "statfs64")] ++ pub fn statfs(path: *const c_char, buf: *mut statfs) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "fstatfs64")] ++ pub fn fstatfs(fd: c_int, buf: *mut statfs) -> c_int; ++ pub fn memrchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void; +++ #[cfg_attr(gnu_time64_abi, link_name = "posix_fadvise64")] ++ pub fn posix_fadvise(fd: c_int, offset: off_t, len: off_t, advise: c_int) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "__futimens64")] ++ pub fn futimens(fd: c_int, times: *const crate::timespec) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "__utimensat64")] ++ pub fn utimensat( ++@@ -1822,2 +1830,3 @@ ++ pub fn setresuid(ruid: crate::uid_t, euid: crate::uid_t, suid: crate::uid_t) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "__wait4_time64")] ++ pub fn wait4( ++@@ -1854,3 +1863,5 @@ ++ +++ #[cfg_attr(gnu_time64_abi, link_name = "__sendmsg64")] ++ pub fn sendmsg(fd: c_int, msg: *const crate::msghdr, flags: c_int) -> ssize_t; +++ #[cfg_attr(gnu_time64_abi, link_name = "__recvmsg64")] ++ pub fn recvmsg(fd: c_int, msg: *mut crate::msghdr, flags: c_int) -> ssize_t; ++@@ -1875,3 +1886,5 @@ ++ +++ #[cfg_attr(gnu_time64_abi, link_name = "mkostemp64")] ++ pub fn mkostemp(template: *mut c_char, flags: c_int) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "mkostemps64")] ++ pub fn mkostemps(template: *mut c_char, suffixlen: c_int, flags: c_int) -> c_int; ++--- a/src/unix/linux_like/linux/mod.rs +++++ b/src/unix/linux_like/linux/mod.rs ++@@ -1875,2 +1886,3 @@ ++ pub fn dup3(oldfd: c_int, newfd: c_int, flags: c_int) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "__sigtimedwait64")] ++ pub fn sigtimedwait( ++--- a/src/unix/linux_like/mod.rs +++++ b/src/unix/linux_like/mod.rs ++@@ -1891,3 +1905,5 @@ ++ pub fn creat64(path: *const c_char, mode: mode_t) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "__fstat64_time64")] ++ pub fn fstat64(fildes: c_int, buf: *mut stat64) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "__fstatat64_time64")] ++ pub fn fstatat64( ++@@ -1900,2 +1916,3 @@ ++ pub fn lseek64(fd: c_int, offset: off64_t, whence: c_int) -> off64_t; +++ #[cfg_attr(gnu_time64_abi, link_name = "__lstat64_time64")] ++ pub fn lstat64(path: *const c_char, buf: *mut stat64) -> c_int; ++@@ -1930,2 +1947,3 @@ ++ ) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "__stat64_time64")] ++ pub fn stat64(path: *const c_char, buf: *mut stat64) -> c_int; ++--- a/src/unix/mod.rs +++++ b/src/unix/mod.rs ++@@ -574,2 +574,3 @@ ++ )] +++ #[cfg_attr(gnu_time64_abi, link_name = "fopen64")] ++ pub fn fopen(filename: *const c_char, mode: *const c_char) -> *mut FILE; ++@@ -579,2 +580,3 @@ ++ )] +++ #[cfg_attr(gnu_time64_abi, link_name = "freopen64")] ++ pub fn freopen(filename: *const c_char, mode: *const c_char, file: *mut FILE) -> *mut FILE; ++@@ -585,2 +587,3 @@ ++ pub fn rename(oldname: *const c_char, newname: *const c_char) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "tmpfile64")] ++ pub fn tmpfile() -> *mut FILE; ++@@ -610,4 +613,6 @@ ++ #[cfg_attr(target_os = "netbsd", link_name = "__fgetpos50")] +++ #[cfg_attr(gnu_time64_abi, link_name = "fgetpos64")] ++ pub fn fgetpos(stream: *mut FILE, ptr: *mut fpos_t) -> c_int; ++ #[cfg_attr(target_os = "netbsd", link_name = "__fsetpos50")] +++ #[cfg_attr(gnu_time64_abi, link_name = "fsetpos64")] ++ pub fn fsetpos(stream: *mut FILE, ptr: *const fpos_t) -> c_int; ++@@ -761,2 +766,3 @@ ++ #[cfg_attr(target_os = "espidf", link_name = "lwip_setsockopt")] +++ #[cfg_attr(gnu_time64_abi, link_name = "__setsockopt64")] ++ pub fn setsockopt( ++@@ -823,2 +829,3 @@ ++ )] +++ #[cfg_attr(gnu_time64_abi, link_name = "__fstat64_time64")] ++ pub fn fstat(fildes: c_int, buf: *mut stat) -> c_int; ++@@ -836,2 +843,3 @@ ++ )] +++ #[cfg_attr(gnu_time64_abi, link_name = "__stat64_time64")] ++ pub fn stat(path: *const c_char, buf: *mut stat) -> c_int; ++@@ -850,2 +858,3 @@ ++ )] +++ #[cfg_attr(gnu_time64_abi, link_name = "open64")] ++ pub fn open(path: *const c_char, oflag: c_int, ...) -> c_int; ++@@ -855,2 +864,3 @@ ++ )] +++ #[cfg_attr(gnu_time64_abi, link_name = "creat64")] ++ pub fn creat(path: *const c_char, mode: mode_t) -> c_int; ++@@ -860,2 +870,3 @@ ++ )] +++ #[cfg_attr(gnu_time64_abi, link_name = "__fcntl_time64")] ++ pub fn fcntl(fd: c_int, cmd: c_int, ...) -> c_int; ++@@ -882,2 +893,3 @@ ++ )] +++ #[cfg_attr(gnu_time64_abi, link_name = "readdir64")] ++ pub fn readdir(dirp: *mut crate::DIR) -> *mut crate::dirent; ++@@ -920,2 +932,3 @@ ++ )] +++ #[cfg_attr(gnu_time64_abi, link_name = "__fstatat64_time64")] ++ pub fn fstatat(dirfd: c_int, pathname: *const c_char, buf: *mut stat, flags: c_int) -> c_int; ++@@ -994,2 +1007,3 @@ ++ pub fn link(src: *const c_char, dst: *const c_char) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "lseek64")] ++ pub fn lseek(fd: c_int, offset: off_t, whence: c_int) -> off_t; ++@@ -1023,2 +1037,3 @@ ++ #[cfg_attr(target_os = "netbsd", link_name = "__nanosleep50")] +++ #[cfg_attr(gnu_time64_abi, link_name = "__nanosleep64")] ++ pub fn nanosleep(rqtp: *const timespec, rmtp: *mut timespec) -> c_int; ++@@ -1053,2 +1068,3 @@ ++ )] +++ #[cfg_attr(gnu_time64_abi, link_name = "pread64")] ++ pub fn pread(fd: c_int, buf: *mut c_void, count: size_t, offset: off_t) -> ssize_t; ++@@ -1058,2 +1074,3 @@ ++ )] +++ #[cfg_attr(gnu_time64_abi, link_name = "pwrite64")] ++ pub fn pwrite(fd: c_int, buf: *const c_void, count: size_t, offset: off_t) -> ssize_t; ++@@ -1065,2 +1082,3 @@ ++ #[cfg_attr(target_os = "netbsd", link_name = "__utime50")] +++ #[cfg_attr(gnu_time64_abi, link_name = "__utime64")] ++ pub fn utime(file: *const c_char, buf: *const utimbuf) -> c_int; ++@@ -1087,2 +1105,3 @@ ++ )] +++ #[cfg_attr(gnu_time64_abi, link_name = "mmap64")] ++ pub fn mmap( ++@@ -1113,2 +1132,3 @@ ++ )] +++ #[cfg_attr(gnu_time64_abi, link_name = "__lstat64_time64")] ++ pub fn lstat(path: *const c_char, buf: *mut stat) -> c_int; ++@@ -1135,3 +1155,5 @@ ++ +++ #[cfg_attr(gnu_time64_abi, link_name = "truncate64")] ++ pub fn truncate(path: *const c_char, length: off_t) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "ftruncate64")] ++ pub fn ftruncate(fd: c_int, length: off_t) -> c_int; ++@@ -1141,2 +1163,3 @@ ++ #[cfg_attr(target_os = "netbsd", link_name = "__getrusage50")] +++ #[cfg_attr(gnu_time64_abi, link_name = "__getrusage64")] ++ pub fn getrusage(resource: c_int, usage: *mut rusage) -> c_int; ++@@ -1216,2 +1239,3 @@ ++ )] +++ #[cfg_attr(gnu_time64_abi, link_name = "__pthread_cond_timedwait64")] ++ pub fn pthread_cond_timedwait( ++@@ -1272,2 +1296,3 @@ ++ #[cfg_attr(target_os = "espidf", link_name = "lwip_getsockopt")] +++ #[cfg_attr(gnu_time64_abi, link_name = "__getsockopt64")] ++ pub fn getsockopt( ++@@ -1282,2 +1307,3 @@ ++ #[cfg_attr(target_os = "netbsd", link_name = "__utimes50")] +++ #[cfg_attr(gnu_time64_abi, link_name = "__utimes64")] ++ pub fn utimes(filename: *const c_char, times: *const crate::timeval) -> c_int; ++@@ -1332,2 +1358,3 @@ ++ // FIXME: for `time_t` +++ #[cfg_attr(gnu_time64_abi, link_name = "__gmtime64_r")] ++ pub fn gmtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm; ++@@ -1336,2 +1363,3 @@ ++ // FIXME: for `time_t` +++ #[cfg_attr(gnu_time64_abi, link_name = "__localtime64_r")] ++ pub fn localtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm; ++@@ -1344,2 +1372,3 @@ ++ // FIXME: for `time_t` +++ #[cfg_attr(gnu_time64_abi, link_name = "__mktime64")] ++ pub fn mktime(tm: *mut tm) -> time_t; ++@@ -1348,2 +1377,3 @@ ++ // FIXME: for `time_t` +++ #[cfg_attr(gnu_time64_abi, link_name = "__time64")] ++ pub fn time(time: *mut time_t) -> time_t; ++@@ -1352,2 +1382,3 @@ ++ // FIXME: for `time_t` +++ #[cfg_attr(gnu_time64_abi, link_name = "__gmtime64")] ++ pub fn gmtime(time_p: *const time_t) -> *mut tm; ++@@ -1356,2 +1387,3 @@ ++ // FIXME: for `time_t` +++ #[cfg_attr(gnu_time64_abi, link_name = "__localtime64")] ++ pub fn localtime(time_p: *const time_t) -> *mut tm; ++@@ -1360,2 +1392,3 @@ ++ // FIXME: for `time_t` +++ #[cfg_attr(gnu_time64_abi, link_name = "__difftime64")] ++ pub fn difftime(time1: time_t, time0: time_t) -> c_double; ++@@ -1364,2 +1397,3 @@ ++ // FIXME: for `time_t` +++ #[cfg_attr(gnu_time64_abi, link_name = "__timegm64")] ++ pub fn timegm(tm: *mut crate::tm) -> time_t; ++@@ -1418,2 +1452,3 @@ ++ #[cfg_attr(target_os = "netbsd", link_name = "__select50")] +++ #[cfg_attr(gnu_time64_abi, link_name = "__select64")] ++ pub fn select( ++@@ -1436,3 +1471,5 @@ ++ pub fn sem_post(sem: *mut sem_t) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "statvfs64")] ++ pub fn statvfs(path: *const c_char, buf: *mut statvfs) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "fstatvfs64")] ++ pub fn fstatvfs(fd: c_int, buf: *mut statvfs) -> c_int; ++@@ -1460,3 +1497,5 @@ ++ +++ #[cfg_attr(gnu_time64_abi, link_name = "fseeko64")] ++ pub fn fseeko(stream: *mut crate::FILE, offset: off_t, whence: c_int) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "ftello64")] ++ pub fn ftello(stream: *mut crate::FILE) -> off_t; ++@@ -1477,2 +1516,3 @@ ++ pub fn tcsendbreak(fd: c_int, duration: c_int) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "mkstemp64")] ++ pub fn mkstemp(template: *mut c_char) -> c_int; ++@@ -1501,2 +1541,3 @@ ++ +++ #[cfg_attr(gnu_time64_abi, link_name = "lockf64")] ++ pub fn lockf(fd: c_int, cmd: c_int, len: off_t) -> c_int; ++@@ -1531,2 +1572,3 @@ ++ extern "C" { +++ #[cfg_attr(gnu_time64_abi, link_name = "__adjtime64")] ++ pub fn adjtime(delta: *const timeval, olddelta: *mut timeval) -> c_int; ++@@ -1575,2 +1617,3 @@ ++ pub fn mkdirat(dirfd: c_int, pathname: *const c_char, mode: crate::mode_t) -> c_int; +++ #[cfg_attr(gnu_time64_abi, link_name = "openat64")] ++ pub fn openat(dirfd: c_int, pathname: *const c_char, flags: c_int, ...) -> c_int; ++@@ -1598,2 +1641,3 @@ ++ /// https://www.unix.com/man-page/opensolaris/3LIB/libc/ +++ #[cfg_attr(gnu_time64_abi, link_name = "readdir64_r")] ++ pub fn readdir_r( ++@@ -1682,2 +1726,3 @@ ++ #[cfg_attr(target_os = "netbsd", link_name = "__pselect50")] +++ #[cfg_attr(gnu_time64_abi, link_name = "__pselect64")] ++ pub fn pselect( +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-050-update-struct-input_event.patch mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-050-update-struct-input_event.patch +--- mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-050-update-struct-input_event.patch 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-050-update-struct-input_event.patch 2024-12-28 15:35:00.000000000 -0500 +@@ -0,0 +1,27 @@ ++This patch is based on the commit described below from the upstream ++time64 pull request, adapted for use in the Debian package by ++Peter Michael Green. ++ ++commit 7bb47139eda82d37a43cdd3ff60572e5d224a2e4 ++Author: Ola x Nilsson ++Date: Fri Mar 17 15:21:05 2023 +0100 ++ ++ linux: Update struct input_event for glibc _TIME_BITS=64 ++ ++diff --git a/src/unix/linux_like/linux/mod.rs b/src/unix/linux_like/linux/mod.rs ++index 2ff9a7e264..e280488620 100644 ++--- a/src/unix/linux_like/linux/mod.rs +++++ b/src/unix/linux_like/linux/mod.rs ++@@ -322,7 +322,12 @@ s! { ++ } ++ ++ pub struct input_event { +++ #[cfg(not(gnu_time64_abi))] ++ pub time: crate::timeval, +++ #[cfg(gnu_time64_abi)] +++ pub __sec: c_ulong, +++ #[cfg(gnu_time64_abi)] +++ pub __usec: c_ulong, ++ pub type_: __u16, ++ pub code: __u16, ++ pub value: __s32, +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-060-handle-tv_usec.patch mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-060-handle-tv_usec.patch +--- mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-060-handle-tv_usec.patch 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-060-handle-tv_usec.patch 2024-12-28 15:35:00.000000000 -0500 +@@ -0,0 +1,26 @@ ++commit b24da0142bd3babba1935866b266845ed2ece4c6 ++Author: Ola x Nilsson ++Date: Fri Mar 17 15:30:46 2023 +0100 ++ ++ gnu: Handle timeval.tv_usec for glibc 64-bit time_t ++ ++ For 64 bit time on 32 bit linux glibc timeval.tv_usec is actually ++ __suseconds64_t (64 bits) while suseconds_t is still 32 bits. ++ ++diff --git a/src/unix/mod.rs b/src/unix/mod.rs ++index a380bf1ef8..42a293e9b0 100644 ++--- a/src/unix/mod.rs +++++ b/src/unix/mod.rs ++@@ -62,7 +62,12 @@ s! { ++ ++ pub struct timeval { ++ pub tv_sec: time_t, +++ #[cfg(not(gnu_time64_abi))] ++ pub tv_usec: suseconds_t, +++ // For 64 bit time on 32 bit linux glibc, suseconds_t is still +++ // a 32 bit type. Using suseconds_t here will break the tests, use i64 instead +++ #[cfg(gnu_time64_abi)] +++ pub tv_usec: i64 ++ } ++ ++ // linux x32 compatibility +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-080-socket-options.patch mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-080-socket-options.patch +--- mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-080-socket-options.patch 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-080-socket-options.patch 2024-12-28 15:35:00.000000000 -0500 +@@ -0,0 +1,165 @@ ++This patch is based on the commit described below from the upstream time64 ++pull request, adapted for use in the Debian package by Peter Michael Green. ++ ++commit 17ad6e6394956e535887900ed8ff5949fa4c37fc ++Author: Ola x Nilsson ++Date: Mon Mar 20 14:21:04 2023 +0100 ++ ++ linux: Set SO_TIMESTAMP* and SO_RCVTIMEO and SO_SNDTIMEO ++ ++ The actual values may be different on 32bit archs and glibc with ++ 64-bit time. ++ ++diff --git a/src/unix/linux_like/linux/arch/generic/mod.rs b/src/unix/linux_like/linux/arch/generic/mod.rs ++index 2f437e16db..2e319f5823 100644 ++--- a/src/unix/linux_like/linux/arch/generic/mod.rs +++++ b/src/unix/linux_like/linux/arch/generic/mod.rs ++@@ -37,10 +37,6 @@ pub const SO_PASSCRED: c_int = 16; ++ pub const SO_PEERCRED: c_int = 17; ++ pub const SO_RCVLOWAT: c_int = 18; ++ pub const SO_SNDLOWAT: c_int = 19; ++-pub const SO_RCVTIMEO: c_int = 20; ++-pub const SO_SNDTIMEO: c_int = 21; ++-// pub const SO_RCVTIMEO_OLD: c_int = 20; ++-// pub const SO_SNDTIMEO_OLD: c_int = 21; ++ pub const SO_SECURITY_AUTHENTICATION: c_int = 22; ++ pub const SO_SECURITY_ENCRYPTION_TRANSPORT: c_int = 23; ++ pub const SO_SECURITY_ENCRYPTION_NETWORK: c_int = 24; ++@@ -49,18 +45,35 @@ pub const SO_ATTACH_FILTER: c_int = 26; ++ pub const SO_DETACH_FILTER: c_int = 27; ++ pub const SO_GET_FILTER: c_int = SO_ATTACH_FILTER; ++ pub const SO_PEERNAME: c_int = 28; ++-pub const SO_TIMESTAMP: c_int = 29; +++ +++cfg_if! { +++ if #[cfg(all(gnu_time64_abi, +++ any(target_arch = "arm", target_arch = "x86")))] { +++ pub const SO_TIMESTAMP: c_int = 63; +++ pub const SO_TIMESTAMPNS: c_int = 64; +++ pub const SO_TIMESTAMPING: c_int = 65; +++ pub const SO_RCVTIMEO: c_int = 66; +++ pub const SO_SNDTIMEO: c_int = 67; +++ } else { +++ pub const SO_TIMESTAMP: c_int = 29; +++ pub const SO_TIMESTAMPNS: c_int = 35; +++ pub const SO_TIMESTAMPING: c_int = 37; +++ pub const SO_RCVTIMEO: c_int = 20; +++ pub const SO_SNDTIMEO: c_int = 21; +++ } +++} ++ // pub const SO_TIMESTAMP_OLD: c_int = 29; +++// pub const SO_TIMESTAMPNS_OLD: c_int = 35; +++// pub const SO_TIMESTAMPING_OLD: c_int = 37; +++// pub const SO_RCVTIMEO_OLD: c_int = 20; +++// pub const SO_SNDTIMEO_OLD: c_int = 21; +++ ++ pub const SO_ACCEPTCONN: c_int = 30; ++ pub const SO_PEERSEC: c_int = 31; ++ pub const SO_SNDBUFFORCE: c_int = 32; ++ pub const SO_RCVBUFFORCE: c_int = 33; ++ pub const SO_PASSSEC: c_int = 34; ++-pub const SO_TIMESTAMPNS: c_int = 35; ++-// pub const SO_TIMESTAMPNS_OLD: c_int = 35; ++ pub const SO_MARK: c_int = 36; ++-pub const SO_TIMESTAMPING: c_int = 37; ++-// pub const SO_TIMESTAMPING_OLD: c_int = 37; ++ pub const SO_PROTOCOL: c_int = 38; ++ pub const SO_DOMAIN: c_int = 39; ++ pub const SO_RXQ_OVFL: c_int = 40; ++diff --git a/src/unix/linux_like/linux/arch/mips/mod.rs b/src/unix/linux_like/linux/arch/mips/mod.rs ++index 7699677026..82e091f4e9 100644 ++--- a/src/unix/linux_like/linux/arch/mips/mod.rs +++++ b/src/unix/linux_like/linux/arch/mips/mod.rs ++@@ -33,8 +33,15 @@ pub const SO_RCVLOWAT: c_int = 0x1004; ++ // NOTE: These definitions are now being renamed with _OLD postfix, ++ // but CI haven't support them yet. ++ // Some related consts could be found in b32.rs and b64.rs ++-pub const SO_SNDTIMEO: c_int = 0x1005; ++-pub const SO_RCVTIMEO: c_int = 0x1006; +++cfg_if! { +++ if #[cfg(gnu_time64_abi)] { +++ pub const SO_SNDTIMEO: c_int = 67; +++ pub const SO_RCVTIMEO: c_int = 66; +++ } else { +++ pub const SO_SNDTIMEO: c_int = 0x1005; +++ pub const SO_RCVTIMEO: c_int = 0x1006; +++ } +++} ++ // pub const SO_SNDTIMEO_OLD: c_int = 0x1005; ++ // pub const SO_RCVTIMEO_OLD: c_int = 0x1006; ++ pub const SO_ACCEPTCONN: c_int = 0x1009; ++@@ -88,9 +95,17 @@ pub const SO_BINDTOIFINDEX: c_int = 62; ++ // NOTE: These definitions are now being renamed with _OLD postfix, ++ // but CI haven't support them yet. ++ // Some related consts could be found in b32.rs and b64.rs ++-pub const SO_TIMESTAMP: c_int = 29; ++-pub const SO_TIMESTAMPNS: c_int = 35; ++-pub const SO_TIMESTAMPING: c_int = 37; +++cfg_if! { +++ if #[cfg(gnu_time64_abi)] { +++ pub const SO_TIMESTAMP: c_int = 63; +++ pub const SO_TIMESTAMPNS: c_int = 64; +++ pub const SO_TIMESTAMPING: c_int = 65; +++ } else { +++ pub const SO_TIMESTAMP: c_int = 29; +++ pub const SO_TIMESTAMPNS: c_int = 35; +++ pub const SO_TIMESTAMPING: c_int = 37; +++ } +++} ++ // pub const SO_TIMESTAMP_OLD: c_int = 29; ++ // pub const SO_TIMESTAMPNS_OLD: c_int = 35; ++ // pub const SO_TIMESTAMPING_OLD: c_int = 37; ++diff --git a/src/unix/linux_like/linux/arch/powerpc/mod.rs b/src/unix/linux_like/linux/arch/powerpc/mod.rs ++index 27834dbfea..039839995c 100644 ++--- a/src/unix/linux_like/linux/arch/powerpc/mod.rs +++++ b/src/unix/linux_like/linux/arch/powerpc/mod.rs ++@@ -21,8 +21,15 @@ pub const SO_REUSEPORT: c_int = 15; ++ // powerpc only differs in these ++ pub const SO_RCVLOWAT: c_int = 16; ++ pub const SO_SNDLOWAT: c_int = 17; ++-pub const SO_RCVTIMEO: c_int = 18; ++-pub const SO_SNDTIMEO: c_int = 19; +++cfg_if! { +++ if #[cfg(gnu_time64_abi)] { +++ pub const SO_SNDTIMEO: c_int = 67; +++ pub const SO_RCVTIMEO: c_int = 66; +++ } else { +++ pub const SO_SNDTIMEO: c_int = 19; +++ pub const SO_RCVTIMEO: c_int = 18; +++ } +++} ++ // pub const SO_RCVTIMEO_OLD: c_int = 18; ++ // pub const SO_SNDTIMEO_OLD: c_int = 19; ++ pub const SO_PASSCRED: c_int = 20; ++@@ -36,18 +43,26 @@ pub const SO_ATTACH_FILTER: c_int = 26; ++ pub const SO_DETACH_FILTER: c_int = 27; ++ pub const SO_GET_FILTER: c_int = SO_ATTACH_FILTER; ++ pub const SO_PEERNAME: c_int = 28; ++-pub const SO_TIMESTAMP: c_int = 29; +++cfg_if! { +++ if #[cfg(gnu_time64_abi)] { +++ pub const SO_TIMESTAMP: c_int = 63; +++ pub const SO_TIMESTAMPNS: c_int = 64; +++ pub const SO_TIMESTAMPING: c_int = 65; +++ } else { +++ pub const SO_TIMESTAMP: c_int = 29; +++ pub const SO_TIMESTAMPNS: c_int = 35; +++ pub const SO_TIMESTAMPING: c_int = 37; +++ } +++} ++ // pub const SO_TIMESTAMP_OLD: c_int = 29; +++// pub const SO_TIMESTAMPNS_OLD: c_int = 35; +++// pub const SO_TIMESTAMPING_OLD: c_int = 37; ++ pub const SO_ACCEPTCONN: c_int = 30; ++ pub const SO_PEERSEC: c_int = 31; ++ pub const SO_SNDBUFFORCE: c_int = 32; ++ pub const SO_RCVBUFFORCE: c_int = 33; ++ pub const SO_PASSSEC: c_int = 34; ++-pub const SO_TIMESTAMPNS: c_int = 35; ++-// pub const SO_TIMESTAMPNS_OLD: c_int = 35; ++ pub const SO_MARK: c_int = 36; ++-pub const SO_TIMESTAMPING: c_int = 37; ++-// pub const SO_TIMESTAMPING_OLD: c_int = 37; ++ pub const SO_PROTOCOL: c_int = 38; ++ pub const SO_DOMAIN: c_int = 39; ++ pub const SO_RXQ_OVFL: c_int = 40; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-090-mips-rlim.patch mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-090-mips-rlim.patch +--- mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-090-mips-rlim.patch 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-090-mips-rlim.patch 2024-12-28 15:35:00.000000000 -0500 +@@ -0,0 +1,29 @@ ++This patch is based on the commit described below, taken from the upstream time64 ++pull request and adapted for use in the Debian package by Peter Michael Green. ++ ++commit d8a1d16f489c0b2d7064eb2863378f7e45a696c3 ++Author: Ola x Nilsson ++Date: Mon Mar 27 14:30:10 2023 +0200 ++ ++ linux: Set RLIM_INFINITY for mips GNU libc with _FILE_OFFSET_BITS=64 ++ ++Index: libc/src/unix/linux_like/linux/arch/mips/mod.rs ++=================================================================== ++--- libc.orig/src/unix/linux_like/linux/arch/mips/mod.rs +++++ libc/src/unix/linux_like/linux/arch/mips/mod.rs ++@@ -364,10 +364,12 @@ cfg_if! { ++ } ++ ++ cfg_if! { ++- if #[cfg( +++ if #[cfg(all(gnu_time64_abi, any(target_arch = "mips", target_arch = "mips32r6")))] { +++ pub const RLIM_INFINITY: ::rlim_t = !0; +++ } else if #[cfg(all( ++ any(target_arch = "mips", target_arch = "mips32r6"), ++- any(target_env = "gnu", target_env = "uclibc") ++- )] { +++ target_env = "uclibc" +++ ))] { ++ pub const RLIM_INFINITY: crate::rlim_t = 0x7fffffff; ++ } ++ } +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-100-shmid.patch mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-100-shmid.patch +--- mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-100-shmid.patch 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-100-shmid.patch 2024-12-28 15:35:00.000000000 -0500 +@@ -0,0 +1,64 @@ ++This patch is based on the commit described below, taken from the upstream ++time64 pull request and adapted for use in the Debian package by ++Peter Michael Green. ++ ++commit c2f9db639c38f34bda0d999d557f5cec0fb80915 ++Author: Ola x Nilsson ++Date: Mon Mar 20 14:22:31 2023 +0100 ++ ++ gnu: Update struct shmid_ds for 64-bit time ++ ++Index: b/src/unix/linux_like/linux/gnu/b32/arm/mod.rs ++=================================================================== ++--- a/src/unix/linux_like/linux/gnu/b32/arm/mod.rs +++++ b/src/unix/linux_like/linux/gnu/b32/arm/mod.rs ++@@ -116,10 +116,13 @@ s! { ++ pub shm_perm: crate::ipc_perm, ++ pub shm_segsz: size_t, ++ pub shm_atime: crate::time_t, +++ #[cfg(not(gnu_time64_abi))] ++ __unused1: c_ulong, ++ pub shm_dtime: crate::time_t, +++ #[cfg(not(gnu_time64_abi))] ++ __unused2: c_ulong, ++ pub shm_ctime: crate::time_t, +++ #[cfg(not(gnu_time64_abi))] ++ __unused3: c_ulong, ++ pub shm_cpid: crate::pid_t, ++ pub shm_lpid: crate::pid_t, ++Index: b/src/unix/linux_like/linux/gnu/b32/powerpc.rs ++=================================================================== ++--- a/src/unix/linux_like/linux/gnu/b32/powerpc.rs +++++ b/src/unix/linux_like/linux/gnu/b32/powerpc.rs ++@@ -113,14 +113,10 @@ s! { ++ ++ pub struct shmid_ds { ++ pub shm_perm: crate::ipc_perm, ++- __glibc_reserved1: c_uint, +++ pub shm_segsz: crate::size_t, ++ pub shm_atime: crate::time_t, ++- __glibc_reserved2: c_uint, ++ pub shm_dtime: crate::time_t, ++- __glibc_reserved3: c_uint, ++ pub shm_ctime: crate::time_t, ++- __glibc_reserved4: c_uint, ++- pub shm_segsz: size_t, ++ pub shm_cpid: crate::pid_t, ++ pub shm_lpid: crate::pid_t, ++ pub shm_nattch: crate::shmatt_t, ++Index: b/src/unix/linux_like/linux/gnu/b32/x86/mod.rs ++=================================================================== ++--- a/src/unix/linux_like/linux/gnu/b32/x86/mod.rs +++++ b/src/unix/linux_like/linux/gnu/b32/x86/mod.rs ++@@ -190,11 +190,8 @@ s! { ++ pub shm_perm: crate::ipc_perm, ++ pub shm_segsz: size_t, ++ pub shm_atime: crate::time_t, ++- __unused1: c_ulong, ++ pub shm_dtime: crate::time_t, ++- __unused2: c_ulong, ++ pub shm_ctime: crate::time_t, ++- __unused3: c_ulong, ++ pub shm_cpid: crate::pid_t, ++ pub shm_lpid: crate::pid_t, ++ pub shm_nattch: crate::shmatt_t, +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-105-stat.patch mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-105-stat.patch +--- mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-105-stat.patch 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-105-stat.patch 2024-12-28 15:35:00.000000000 -0500 +@@ -0,0 +1,605 @@ ++This patch is based on the commit described below, taken from upstream pull ++request 3175, it was adapted for use in the Debian package by Peter Michael ++Green. ++ ++commit 3e37f1b0ca3ca56f8a18a0d46075a12f89838dc6 ++Author: Ola x Nilsson ++Date: Mon Mar 4 11:13:49 2024 +0100 ++ ++ gnu: Adapt stat, statfs, statvfs for _TIME_BITS=64 ++ ++ Adapt the 32-bit versions of the various stat and stat*64 structs to ++ support 64 bit time and file offset. ++ ++ Move the default stat struct from b32/mod.rs to a new file ++ fnu/b32/generic.rs as it now only supports _most_ platforms. ++ Some archs still need their own version. ++ ++ stat64, statfs64 and statvfs64 becomes aliases to stat, statfs and ++ statfcf respectively for arm, riscv32 and sparc. ++ ++ statfs64 becomes an alias for statfs on mips and powerpc. ++ ++Index: libc/src/unix/linux_like/linux/gnu/b32/arm/mod.rs ++=================================================================== ++--- libc.orig/src/unix/linux_like/linux/gnu/b32/arm/mod.rs +++++ libc/src/unix/linux_like/linux/gnu/b32/arm/mod.rs ++@@ -59,58 +59,8 @@ s! { ++ __unused2: c_ulong, ++ } ++ ++- pub struct stat64 { ++- pub st_dev: crate::dev_t, ++- __pad1: c_uint, ++- __st_ino: crate::ino_t, ++- pub st_mode: crate::mode_t, ++- pub st_nlink: crate::nlink_t, ++- pub st_uid: crate::uid_t, ++- pub st_gid: crate::gid_t, ++- pub st_rdev: crate::dev_t, ++- __pad2: c_uint, ++- pub st_size: off64_t, ++- pub st_blksize: crate::blksize_t, ++- pub st_blocks: crate::blkcnt64_t, ++- pub st_atime: crate::time_t, ++- pub st_atime_nsec: c_long, ++- pub st_mtime: crate::time_t, ++- pub st_mtime_nsec: c_long, ++- pub st_ctime: crate::time_t, ++- pub st_ctime_nsec: c_long, ++- pub st_ino: crate::ino64_t, ++- } ++ ++- pub struct statfs64 { ++- pub f_type: crate::__fsword_t, ++- pub f_bsize: crate::__fsword_t, ++- pub f_blocks: u64, ++- pub f_bfree: u64, ++- pub f_bavail: u64, ++- pub f_files: u64, ++- pub f_ffree: u64, ++- pub f_fsid: crate::fsid_t, ++- pub f_namelen: crate::__fsword_t, ++- pub f_frsize: crate::__fsword_t, ++- pub f_flags: crate::__fsword_t, ++- pub f_spare: [crate::__fsword_t; 4], ++- } ++ ++- pub struct statvfs64 { ++- pub f_bsize: c_ulong, ++- pub f_frsize: c_ulong, ++- pub f_blocks: u64, ++- pub f_bfree: u64, ++- pub f_bavail: u64, ++- pub f_files: u64, ++- pub f_ffree: u64, ++- pub f_favail: u64, ++- pub f_fsid: c_ulong, ++- __f_unused: c_int, ++- pub f_flag: c_ulong, ++- pub f_namemax: c_ulong, ++- __f_spare: [c_int; 6], ++- } ++ ++ pub struct shmid_ds { ++ pub shm_perm: crate::ipc_perm, ++Index: libc/src/unix/linux_like/linux/gnu/b32/generic.rs ++=================================================================== ++--- /dev/null +++++ libc/src/unix/linux_like/linux/gnu/b32/generic.rs ++@@ -0,0 +1,30 @@ +++s! { +++ pub struct stat { +++ pub st_dev: crate::dev_t, +++ #[cfg(not(gnu_time64_abi))] +++ _pad1: i32, +++ pub st_ino: crate::ino_t, +++ pub st_mode: crate::mode_t, +++ pub st_nlink: crate::nlink_t, +++ pub st_uid: crate::uid_t, +++ pub st_gid: crate::gid_t, +++ pub st_rdev: crate::dev_t, +++ #[cfg(not(gnu_time64_abi))] +++ __pad2: i32, +++ pub st_size: crate::off_t, +++ pub st_blksize: crate::blksize_t, +++ pub st_blocks: crate::blkcnt_t, +++ pub st_atime: crate::time_t, +++ pub st_atime_nsec: crate::c_long, +++ #[cfg(gnu_time64_abi)] +++ __pad3: i32, +++ pub st_mtime: crate::time_t, +++ pub st_mtime_nsec: crate::c_long, +++ #[cfg(gnu_time64_abi)] +++ __pad4: i32, +++ pub st_ctime: crate::time_t, +++ pub st_ctime_nsec: crate::c_long, +++ #[cfg(gnu_time64_abi)] +++ __pad5: i32, +++ } +++} ++Index: libc/src/unix/linux_like/linux/gnu/b32/mips/mod.rs ++=================================================================== ++--- libc.orig/src/unix/linux_like/linux/gnu/b32/mips/mod.rs +++++ libc/src/unix/linux_like/linux/gnu/b32/mips/mod.rs ++@@ -4,30 +4,90 @@ use crate::{off64_t, off_t}; ++ pub type c_char = i8; ++ pub type wchar_t = i32; ++ +++pub type statfs64 = statfs; ++ s! { ++- pub struct stat64 { +++ pub struct stat { +++ #[cfg(gnu_time64_abi)] +++ pub st_dev: crate::dev_t, +++ #[cfg(not(gnu_time64_abi))] ++ pub st_dev: c_ulong, +++ #[cfg(not(gnu_time64_abi))] ++ st_pad1: [c_long; 3], ++- pub st_ino: crate::ino64_t, +++ +++ pub st_ino: crate::ino_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, +++ #[cfg(gnu_time64_abi)] +++ pub st_rdev: crate::dev_t, +++ #[cfg(not(gnu_time64_abi))] ++ pub st_rdev: c_ulong, +++ +++ #[cfg(not(gnu_time64_abi))] ++ st_pad2: [c_long; 2], ++- pub st_size: off64_t, +++ +++ +++ pub st_size: crate::off_t, +++ +++ #[cfg(not(gnu_time64_abi))] +++ st_pad3: c_long, +++ +++ #[cfg(gnu_time64_abi)] +++ pub st_blksize: crate::blksize_t, +++ #[cfg(gnu_time64_abi)] +++ pub st_blocks: crate::blkcnt_t, +++ ++ pub st_atime: crate::time_t, +++ #[cfg(gnu_time64_abi)] +++ __pad1: i32, ++ pub st_atime_nsec: c_long, +++ #[cfg(not(gnu_time64_abi))] +++ __pad1: i32, ++ pub st_mtime: crate::time_t, +++ #[cfg(gnu_time64_abi)] +++ __pad2: i32, ++ pub st_mtime_nsec: c_long, +++ #[cfg(not(gnu_time64_abi))] +++ __pad2: i32, ++ pub st_ctime: crate::time_t, +++ #[cfg(gnu_time64_abi)] +++ __pad3: i32, ++ pub st_ctime_nsec: c_long, +++ #[cfg(not(gnu_time64_abi))] +++ __pad3: i32, +++ +++ +++ #[cfg(not(gnu_time64_abi))] ++ pub st_blksize: crate::blksize_t, ++- st_pad3: c_long, ++- pub st_blocks: crate::blkcnt64_t, +++ #[cfg(not(gnu_time64_abi))] +++ pub st_blocks: crate::blkcnt_t, +++ #[cfg(not(gnu_time64_abi))] ++ st_pad5: [c_long; 14], ++ } ++ +++ pub struct stat64 { +++ pub st_dev: crate::dev_t, +++ pub st_ino: crate::ino64_t, +++ pub st_mode: crate::mode_t, +++ pub st_nlink: crate::nlink_t, +++ pub st_uid: crate::uid_t, +++ pub st_gid: crate::gid_t, +++ pub st_rdev: crate::dev_t, +++ pub st_size: off64_t, +++ pub st_blksize: crate::blksize_t, +++ pub st_blocks: crate::blkcnt64_t, +++ pub st_atime: crate::time_t, +++ __pad1: i32, +++ pub st_atime_nsec: c_long, +++ pub st_mtime: crate::time_t, +++ __pad2: i32, +++ pub st_mtime_nsec: c_long, +++ pub st_ctime: crate::time_t, +++ __pad3: i32, +++ pub st_ctime_nsec: c_long, +++ } +++ ++ pub struct statfs { ++ pub f_type: c_long, ++ pub f_bsize: c_long, ++@@ -44,21 +104,6 @@ s! { ++ f_spare: [c_long; 5], ++ } ++ ++- pub struct statfs64 { ++- pub f_type: c_long, ++- pub f_bsize: c_long, ++- pub f_frsize: c_long, ++- pub f_blocks: u64, ++- pub f_bfree: u64, ++- pub f_files: u64, ++- pub f_ffree: u64, ++- pub f_bavail: u64, ++- pub f_fsid: crate::fsid_t, ++- pub f_namelen: c_long, ++- pub f_flags: c_long, ++- pub f_spare: [c_long; 5], ++- } ++- ++ pub struct statvfs64 { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++Index: libc/src/unix/linux_like/linux/gnu/b32/mod.rs ++=================================================================== ++--- libc.orig/src/unix/linux_like/linux/gnu/b32/mod.rs +++++ libc/src/unix/linux_like/linux/gnu/b32/mod.rs ++@@ -53,56 +53,15 @@ cfg_if! { ++ pub type blksize_t = i32; ++ } ++ } ++- ++-s! { ++- pub struct stat { ++- #[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))] ++- pub st_dev: crate::dev_t, ++- #[cfg(any(target_arch = "mips", target_arch = "mips32r6"))] ++- pub st_dev: c_ulong, ++- ++- #[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))] ++- __pad1: c_short, ++- #[cfg(any(target_arch = "mips", target_arch = "mips32r6"))] ++- st_pad1: [c_long; 3], ++- pub st_ino: crate::ino_t, ++- pub st_mode: crate::mode_t, ++- pub st_nlink: crate::nlink_t, ++- pub st_uid: crate::uid_t, ++- pub st_gid: crate::gid_t, ++- #[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))] ++- pub st_rdev: crate::dev_t, ++- #[cfg(any(target_arch = "mips", target_arch = "mips32r6"))] ++- pub st_rdev: c_ulong, ++- #[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))] ++- __pad2: c_short, ++- #[cfg(any(target_arch = "mips", target_arch = "mips32r6"))] ++- st_pad2: [c_long; 2], ++- pub st_size: off_t, ++- #[cfg(any(target_arch = "mips", target_arch = "mips32r6"))] ++- st_pad3: c_long, ++- #[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))] ++- pub st_blksize: crate::blksize_t, ++- #[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))] ++- pub st_blocks: crate::blkcnt_t, ++- pub st_atime: crate::time_t, ++- pub st_atime_nsec: c_long, ++- pub st_mtime: crate::time_t, ++- pub st_mtime_nsec: c_long, ++- pub st_ctime: crate::time_t, ++- pub st_ctime_nsec: c_long, ++- #[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))] ++- __unused4: c_long, ++- #[cfg(not(any(target_arch = "mips", target_arch = "mips32r6")))] ++- __unused5: c_long, ++- #[cfg(any(target_arch = "mips", target_arch = "mips32r6"))] ++- pub st_blksize: crate::blksize_t, ++- #[cfg(any(target_arch = "mips", target_arch = "mips32r6"))] ++- pub st_blocks: crate::blkcnt_t, ++- #[cfg(any(target_arch = "mips", target_arch = "mips32r6"))] ++- st_pad5: [c_long; 14], +++cfg_if! { +++ if #[cfg(any(target_arch = "arm", target_arch="riscv32", target_arch="sparc"))] { +++ pub type stat64 = stat; +++ pub type statfs64 = statfs; +++ pub type statvfs64 = statvfs; ++ } +++} ++ +++s! { ++ pub struct statvfs { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++@@ -454,3 +413,16 @@ cfg_if! { ++ // Unknown target_arch ++ } ++ } +++ +++cfg_if! { +++ if #[cfg(not(any( +++ target_arch = "mips", +++ target_arch = "mips32r6", +++ target_arch = "powerpc", +++ target_arch = "riscv32", +++ target_arch = "sparc", +++ )))] { +++ mod generic; +++ pub use self::generic::*; +++ } +++} ++Index: libc/src/unix/linux_like/linux/gnu/b32/powerpc.rs ++=================================================================== ++--- libc.orig/src/unix/linux_like/linux/gnu/b32/powerpc.rs +++++ libc/src/unix/linux_like/linux/gnu/b32/powerpc.rs ++@@ -4,6 +4,8 @@ use crate::{off64_t, off_t}; ++ pub type c_char = u8; ++ pub type wchar_t = i32; ++ +++pub type statfs64 = statfs; +++ ++ s! { ++ pub struct sigaction { ++ pub sa_sigaction: crate::sighandler_t, ++@@ -12,6 +14,38 @@ s! { ++ pub sa_restorer: Option, ++ } ++ +++ pub struct stat { +++ pub st_dev: crate::dev_t, +++ pub st_ino: crate::ino_t, +++ pub st_mode: crate::mode_t, +++ pub st_nlink: crate::nlink_t, +++ pub st_uid: crate::uid_t, +++ pub st_gid: crate::gid_t, +++ pub st_rdev: crate::dev_t, +++ pub st_size: off_t, +++ pub st_blksize: crate::blksize_t, +++ pub st_blocks: crate::blkcnt_t, +++ pub st_atime: crate::time_t, +++ #[cfg(gnu_time64_abi)] +++ __pad1: i32, +++ pub st_atime_nsec: c_long, +++ #[cfg(not(gnu_time64_abi))] +++ __pad1: i32, +++ pub st_mtime: crate::time_t, +++ #[cfg(gnu_time64_abi)] +++ __pad2: i32, +++ pub st_mtime_nsec: c_long, +++ #[cfg(not(gnu_time64_abi))] +++ __pad2: i32, +++ pub st_ctime: crate::time_t, +++ #[cfg(gnu_time64_abi)] +++ __pad3: i32, +++ pub st_ctime_nsec: c_long, +++ #[cfg(not(gnu_time64_abi))] +++ __pad3: i32, +++ } +++ +++ ++ pub struct statfs { ++ pub f_type: crate::__fsword_t, ++ pub f_bsize: crate::__fsword_t, ++@@ -66,33 +100,18 @@ s! { ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++- __pad2: c_ushort, ++ pub st_size: off64_t, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt64_t, ++ pub st_atime: crate::time_t, ++- pub st_atime_nsec: c_long, +++ __pad1: i32, +++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, +++ __pad2: i32, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, +++ __pad3: i32, ++ pub st_ctime_nsec: c_long, ++- __glibc_reserved4: c_ulong, ++- __glibc_reserved5: c_ulong, ++- } ++- ++- pub struct statfs64 { ++- pub f_type: crate::__fsword_t, ++- pub f_bsize: crate::__fsword_t, ++- pub f_blocks: u64, ++- pub f_bfree: u64, ++- pub f_bavail: u64, ++- pub f_files: u64, ++- pub f_ffree: u64, ++- pub f_fsid: crate::fsid_t, ++- pub f_namelen: crate::__fsword_t, ++- pub f_frsize: crate::__fsword_t, ++- pub f_flags: crate::__fsword_t, ++- pub f_spare: [crate::__fsword_t; 4], ++ } ++ ++ pub struct statvfs64 { ++Index: libc/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs ++=================================================================== ++--- libc.orig/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs +++++ libc/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs ++@@ -21,28 +21,6 @@ s! { ++ __glibc_reserved5: c_ulong, ++ } ++ ++- pub struct stat64 { ++- pub st_dev: crate::dev_t, ++- pub st_ino: crate::ino64_t, ++- pub st_mode: crate::mode_t, ++- pub st_nlink: crate::nlink_t, ++- pub st_uid: crate::uid_t, ++- pub st_gid: crate::gid_t, ++- pub st_rdev: crate::dev_t, ++- pub __pad1: crate::dev_t, ++- pub st_size: off64_t, ++- pub st_blksize: crate::blksize_t, ++- pub __pad2: c_int, ++- pub st_blocks: crate::blkcnt64_t, ++- pub st_atime: crate::time_t, ++- pub st_atime_nsec: c_long, ++- pub st_mtime: crate::time_t, ++- pub st_mtime_nsec: c_long, ++- pub st_ctime: crate::time_t, ++- pub st_ctime_nsec: c_long, ++- __unused: [c_int; 2], ++- } ++- ++ pub struct statfs { ++ pub f_type: c_long, ++ pub f_bsize: c_long, ++@@ -58,36 +36,6 @@ s! { ++ pub f_spare: [c_long; 4], ++ } ++ ++- pub struct statfs64 { ++- pub f_type: c_long, ++- pub f_bsize: c_long, ++- pub f_blocks: crate::fsblkcnt64_t, ++- pub f_bfree: crate::fsblkcnt64_t, ++- pub f_bavail: crate::fsblkcnt64_t, ++- pub f_files: crate::fsfilcnt64_t, ++- pub f_ffree: crate::fsfilcnt64_t, ++- pub f_fsid: crate::fsid_t, ++- pub f_namelen: c_long, ++- pub f_frsize: c_long, ++- pub f_flags: c_long, ++- pub f_spare: [c_long; 4], ++- } ++- ++- pub struct statvfs64 { ++- pub f_bsize: c_ulong, ++- pub f_frsize: c_ulong, ++- pub f_blocks: crate::fsblkcnt64_t, ++- pub f_bfree: crate::fsblkcnt64_t, ++- pub f_bavail: crate::fsblkcnt64_t, ++- pub f_files: crate::fsfilcnt64_t, ++- pub f_ffree: crate::fsfilcnt64_t, ++- pub f_favail: crate::fsfilcnt64_t, ++- pub f_fsid: c_ulong, ++- pub f_flag: c_ulong, ++- pub f_namemax: c_ulong, ++- pub __f_spare: [c_int; 6], ++- } ++- ++ pub struct siginfo_t { ++ pub si_signo: c_int, ++ pub si_errno: c_int, ++Index: libc/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs ++=================================================================== ++--- libc.orig/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs +++++ libc/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs ++@@ -61,56 +61,7 @@ s! { ++ pub ss_size: size_t, ++ } ++ ++- pub struct stat64 { ++- pub st_dev: crate::dev_t, ++- pub st_ino: crate::ino64_t, ++- pub st_mode: crate::mode_t, ++- pub st_nlink: crate::nlink_t, ++- pub st_uid: crate::uid_t, ++- pub st_gid: crate::gid_t, ++- pub st_rdev: crate::dev_t, ++- __pad2: c_ushort, ++- pub st_size: off64_t, ++- pub st_blksize: crate::blksize_t, ++- pub st_blocks: crate::blkcnt64_t, ++- pub st_atime: crate::time_t, ++- pub st_atime_nsec: c_long, ++- pub st_mtime: crate::time_t, ++- pub st_mtime_nsec: c_long, ++- pub st_ctime: crate::time_t, ++- pub st_ctime_nsec: c_long, ++- __reserved: [c_long; 2], ++- } ++- ++- pub struct statfs64 { ++- pub f_type: crate::__fsword_t, ++- pub f_bsize: crate::__fsword_t, ++- pub f_blocks: u64, ++- pub f_bfree: u64, ++- pub f_bavail: u64, ++- pub f_files: u64, ++- pub f_ffree: u64, ++- pub f_fsid: crate::fsid_t, ++- pub f_namelen: crate::__fsword_t, ++- pub f_frsize: crate::__fsword_t, ++- pub f_flags: crate::__fsword_t, ++- pub f_spare: [crate::__fsword_t; 4], ++- } ++ ++- pub struct statvfs64 { ++- pub f_bsize: c_ulong, ++- pub f_frsize: c_ulong, ++- pub f_blocks: u64, ++- pub f_bfree: u64, ++- pub f_bavail: u64, ++- pub f_files: u64, ++- pub f_ffree: u64, ++- pub f_favail: u64, ++- pub f_fsid: c_ulong, ++- pub f_flag: c_ulong, ++- pub f_namemax: c_ulong, ++- __f_spare: [c_int; 6], ++- } ++ ++ pub struct ipc_perm { ++ pub __key: crate::key_t, ++Index: libc/src/unix/linux_like/linux/gnu/b32/x86/mod.rs ++=================================================================== ++--- libc.orig/src/unix/linux_like/linux/gnu/b32/x86/mod.rs +++++ libc/src/unix/linux_like/linux/gnu/b32/x86/mod.rs ++@@ -5,6 +5,8 @@ pub type c_char = i8; ++ pub type wchar_t = i32; ++ pub type greg_t = i32; ++ +++pub type statfs64 = statfs; +++ ++ s! { ++ pub struct sigaction { ++ pub sa_sigaction: crate::sighandler_t, ++@@ -135,39 +137,24 @@ s! { ++ ++ pub struct stat64 { ++ pub st_dev: crate::dev_t, ++- __pad1: c_uint, ++- __st_ino: crate::ino_t, +++ pub st_ino: crate::ino_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++- __pad2: c_uint, ++ pub st_size: off64_t, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt64_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, +++ __pad1: i32, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, +++ __pad2: i32, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++- pub st_ino: crate::ino64_t, ++- } ++- ++- pub struct statfs64 { ++- pub f_type: crate::__fsword_t, ++- pub f_bsize: crate::__fsword_t, ++- pub f_blocks: u64, ++- pub f_bfree: u64, ++- pub f_bavail: u64, ++- pub f_files: u64, ++- pub f_ffree: u64, ++- pub f_fsid: crate::fsid_t, ++- pub f_namelen: crate::__fsword_t, ++- pub f_frsize: crate::__fsword_t, ++- pub f_flags: crate::__fsword_t, ++- pub f_spare: [crate::__fsword_t; 4], +++ __pad3: i32, ++ } ++ ++ pub struct statvfs64 { +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-108-fix-stat-i386.patch mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-108-fix-stat-i386.patch +--- mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-108-fix-stat-i386.patch 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-108-fix-stat-i386.patch 2024-12-28 15:35:00.000000000 -0500 +@@ -0,0 +1,92 @@ ++The patch series taken from upstream unconditionally changes the stat definitions ++in src/unix/linux_like/linux/gnu/b32/x86/mod.rs, since we don't enable time64 ++on i386 this causes us problems. This patch puts back the old definitions and ++adds conditionals. ++ ++Index: libc-0.2.168/src/unix/linux_like/linux/gnu/b32/x86/mod.rs ++=================================================================== ++--- libc-0.2.168.orig/src/unix/linux_like/linux/gnu/b32/x86/mod.rs +++++ libc-0.2.168/src/unix/linux_like/linux/gnu/b32/x86/mod.rs ++@@ -5,6 +5,7 @@ pub type c_char = i8; ++ pub type wchar_t = i32; ++ pub type greg_t = i32; ++ +++#[cfg(gnu_time64_abi)] ++ pub type statfs64 = statfs; ++ ++ s! { ++@@ -134,7 +135,50 @@ s! { ++ __unused1: c_ulong, ++ __unused2: c_ulong, ++ } +++} ++ +++#[cfg(not(gnu_time64_abi))] +++s! { +++ pub struct stat64 { +++ pub st_dev: crate::dev_t, +++ __pad1: c_uint, +++ __st_ino: crate::ino_t, +++ pub st_mode: crate::mode_t, +++ pub st_nlink: crate::nlink_t, +++ pub st_uid: crate::uid_t, +++ pub st_gid: crate::gid_t, +++ pub st_rdev: crate::dev_t, +++ __pad2: c_uint, +++ pub st_size: crate::off64_t, +++ pub st_blksize: crate::blksize_t, +++ pub st_blocks: crate::blkcnt64_t, +++ pub st_atime: crate::time_t, +++ pub st_atime_nsec: c_long, +++ pub st_mtime: crate::time_t, +++ pub st_mtime_nsec: c_long, +++ pub st_ctime: crate::time_t, +++ pub st_ctime_nsec: c_long, +++ pub st_ino: crate::ino64_t, +++ } +++ +++ pub struct statfs64 { +++ pub f_type: crate::__fsword_t, +++ pub f_bsize: crate::__fsword_t, +++ pub f_blocks: u64, +++ pub f_bfree: u64, +++ pub f_bavail: u64, +++ pub f_files: u64, +++ pub f_ffree: u64, +++ pub f_fsid: crate::fsid_t, +++ pub f_namelen: crate::__fsword_t, +++ pub f_frsize: crate::__fsword_t, +++ pub f_flags: crate::__fsword_t, +++ pub f_spare: [crate::__fsword_t; 4], +++ } +++} +++ +++#[cfg(gnu_time64_abi)] +++s! { ++ pub struct stat64 { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino_t, ++@@ -156,7 +200,9 @@ s! { ++ pub st_ctime_nsec: c_long, ++ __pad3: i32, ++ } +++} ++ +++s! { ++ pub struct statvfs64 { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++Index: libc-0.2.168/src/unix/linux_like/linux/gnu/b32/generic.rs ++=================================================================== ++--- libc-0.2.168.orig/src/unix/linux_like/linux/gnu/b32/generic.rs +++++ libc-0.2.168/src/unix/linux_like/linux/gnu/b32/generic.rs ++@@ -26,5 +26,9 @@ s! { ++ pub st_ctime_nsec: crate::c_long, ++ #[cfg(gnu_time64_abi)] ++ __pad5: i32, +++ #[cfg(not(gnu_time64_abi))] +++ __unused4: crate::c_long, +++ #[cfg(not(gnu_time64_abi))] +++ __unused5: crate::c_long, ++ } ++ } +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-110-msquid.patch mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-110-msquid.patch +--- mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-110-msquid.patch 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-110-msquid.patch 2024-12-28 15:35:00.000000000 -0500 +@@ -0,0 +1,86 @@ ++This patch is based on the commit described below, taken from the upstream ++time64 pull request and modified for use in the Debian package by Peter ++Michael Green. ++ ++commit eebc18690dc2a2173737251f09c874ef39424395 ++Author: Ola x Nilsson ++Date: Mon Mar 27 14:15:18 2023 +0200 ++ ++ gnu: Update struct msqid_ds for 64-bit time ++ ++Index: libc/src/unix/linux_like/linux/gnu/b32/arm/mod.rs ++=================================================================== ++--- libc.orig/src/unix/linux_like/linux/gnu/b32/arm/mod.rs +++++ libc/src/unix/linux_like/linux/gnu/b32/arm/mod.rs ++@@ -84,10 +84,13 @@ s! { ++ pub struct msqid_ds { ++ pub msg_perm: crate::ipc_perm, ++ pub msg_stime: crate::time_t, +++ #[cfg(not(gnu_time64_abi))] ++ __glibc_reserved1: c_ulong, ++ pub msg_rtime: crate::time_t, +++ #[cfg(not(gnu_time64_abi))] ++ __glibc_reserved2: c_ulong, ++ pub msg_ctime: crate::time_t, +++ #[cfg(not(gnu_time64_abi))] ++ __glibc_reserved3: c_ulong, ++ __msg_cbytes: c_ulong, ++ pub msg_qnum: crate::msgqnum_t, ++Index: libc/src/unix/linux_like/linux/gnu/b32/mips/mod.rs ++=================================================================== ++--- libc.orig/src/unix/linux_like/linux/gnu/b32/mips/mod.rs +++++ libc/src/unix/linux_like/linux/gnu/b32/mips/mod.rs ++@@ -169,21 +169,9 @@ s! { ++ ++ pub struct msqid_ds { ++ pub msg_perm: crate::ipc_perm, ++- #[cfg(target_endian = "big")] ++- __glibc_reserved1: c_ulong, ++ pub msg_stime: crate::time_t, ++- #[cfg(target_endian = "little")] ++- __glibc_reserved1: c_ulong, ++- #[cfg(target_endian = "big")] ++- __glibc_reserved2: c_ulong, ++ pub msg_rtime: crate::time_t, ++- #[cfg(target_endian = "little")] ++- __glibc_reserved2: c_ulong, ++- #[cfg(target_endian = "big")] ++- __glibc_reserved3: c_ulong, ++ pub msg_ctime: crate::time_t, ++- #[cfg(target_endian = "little")] ++- __glibc_reserved3: c_ulong, ++ __msg_cbytes: c_ulong, ++ pub msg_qnum: crate::msgqnum_t, ++ pub msg_qbytes: crate::msglen_t, ++Index: libc/src/unix/linux_like/linux/gnu/b32/powerpc.rs ++=================================================================== ++--- libc.orig/src/unix/linux_like/linux/gnu/b32/powerpc.rs +++++ libc/src/unix/linux_like/linux/gnu/b32/powerpc.rs ++@@ -145,11 +145,8 @@ s! { ++ ++ pub struct msqid_ds { ++ pub msg_perm: crate::ipc_perm, ++- __glibc_reserved1: c_uint, ++ pub msg_stime: crate::time_t, ++- __glibc_reserved2: c_uint, ++ pub msg_rtime: crate::time_t, ++- __glibc_reserved3: c_uint, ++ pub msg_ctime: crate::time_t, ++ __msg_cbytes: c_ulong, ++ pub msg_qnum: crate::msgqnum_t, ++Index: libc/src/unix/linux_like/linux/gnu/b32/x86/mod.rs ++=================================================================== ++--- libc.orig/src/unix/linux_like/linux/gnu/b32/x86/mod.rs +++++ libc/src/unix/linux_like/linux/gnu/b32/x86/mod.rs ++@@ -189,11 +189,8 @@ s! { ++ pub struct msqid_ds { ++ pub msg_perm: crate::ipc_perm, ++ pub msg_stime: crate::time_t, ++- __glibc_reserved1: c_ulong, ++ pub msg_rtime: crate::time_t, ++- __glibc_reserved2: c_ulong, ++ pub msg_ctime: crate::time_t, ++- __glibc_reserved3: c_ulong, ++ __msg_cbytes: c_ulong, ++ pub msg_qnum: crate::msgqnum_t, ++ pub msg_qbytes: crate::msglen_t, +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-120-semid.patch mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-120-semid.patch +--- mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-120-semid.patch 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-120-semid.patch 2024-12-28 15:35:00.000000000 -0500 +@@ -0,0 +1,53 @@ ++This patch is based on the commit described below, taken from the upstream ++time64 pull request and modified for use in the Debian package by Peter ++Michael Green. ++ ++commit 4385156cfbdfd908881a606e9db5d68a0555847c ++Author: Ola x Nilsson ++Date: Mon Mar 20 14:29:55 2023 +0100 ++ ++ gnu: Update struct semid_ds for 64-bit time ++ ++Index: libc/src/unix/linux_like/linux/gnu/b32/mod.rs ++=================================================================== ++--- libc.orig/src/unix/linux_like/linux/gnu/b32/mod.rs +++++ libc/src/unix/linux_like/linux/gnu/b32/mod.rs ++@@ -109,25 +109,36 @@ s! { ++ ++ pub struct semid_ds { ++ pub sem_perm: ipc_perm, ++- #[cfg(target_arch = "powerpc")] +++ #[cfg(all(not(gnu_time64_abi), target_arch = "powerpc"))] ++ __reserved: crate::__syscall_ulong_t, ++ pub sem_otime: crate::time_t, ++ #[cfg(not(any( +++ gnu_time64_abi, ++ target_arch = "mips", ++ target_arch = "mips32r6", ++ target_arch = "powerpc" ++ )))] ++ __reserved: crate::__syscall_ulong_t, ++- #[cfg(target_arch = "powerpc")] +++ #[cfg(all(not(gnu_time64_abi), target_arch = "powerpc"))] ++ __reserved2: crate::__syscall_ulong_t, ++ pub sem_ctime: crate::time_t, ++ #[cfg(not(any( +++ gnu_time64_abi, ++ target_arch = "mips", ++ target_arch = "mips32r6", ++ target_arch = "powerpc" ++ )))] ++ __reserved2: crate::__syscall_ulong_t, ++ pub sem_nsems: crate::__syscall_ulong_t, +++ #[cfg(all(gnu_time64_abi, +++ not(any( +++ target_arch = "mips", +++ target_arch = "mips32r6", +++ target_arch = "powerpc", +++ target_arch = "arm", +++ target_arch = "x86" +++ ))))] +++ __reserved2: crate::__syscall_ulong_t, ++ __glibc_reserved3: crate::__syscall_ulong_t, ++ __glibc_reserved4: crate::__syscall_ulong_t, ++ } +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-130-getlk.patch mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-130-getlk.patch +--- mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-130-getlk.patch 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-130-getlk.patch 2024-12-28 15:35:00.000000000 -0500 +@@ -0,0 +1,86 @@ ++This patch is based on the commit described below, taken from the upstream ++time64 pull request and modified for use in the Debian package by Peter ++Michael Green. ++ ++commit dee82c3532ce9503e19377a880cc1978c0eb50b0 ++Author: Ola x Nilsson ++Date: Mon Mar 20 14:31:28 2023 +0100 ++ ++ gnu: Update F_GETLK and F_GETLK64 for 64-bit time ++ ++diff --git a/src/unix/linux_like/linux/gnu/b32/arm/mod.rs b/src/unix/linux_like/linux/gnu/b32/arm/mod.rs ++index 80d8d3b11d..aa7e60d5ad 100644 ++--- a/src/unix/linux_like/linux/gnu/b32/arm/mod.rs +++++ b/src/unix/linux_like/linux/gnu/b32/arm/mod.rs ++@@ -293,7 +293,13 @@ pub const MCL_ONFAULT: c_int = 0x0004; ++ pub const POLLWRNORM: c_short = 0x100; ++ pub const POLLWRBAND: c_short = 0x200; ++ ++-pub const F_GETLK: c_int = 5; +++cfg_if! { +++ if #[cfg(gnu_time64_abi)] { +++ pub const F_GETLK: c_int = 12; +++ } else { +++ pub const F_GETLK: c_int = 5; +++ } +++} ++ pub const F_GETOWN: c_int = 9; ++ pub const F_SETOWN: c_int = 8; ++ ++diff --git a/src/unix/linux_like/linux/gnu/b32/mips/mod.rs b/src/unix/linux_like/linux/gnu/b32/mips/mod.rs ++index edd26c3f01..471c93f98e 100644 ++--- a/src/unix/linux_like/linux/gnu/b32/mips/mod.rs +++++ b/src/unix/linux_like/linux/gnu/b32/mips/mod.rs ++@@ -740,7 +740,13 @@ pub const MAP_HUGETLB: c_int = 0x080000; ++ ++ pub const EFD_NONBLOCK: c_int = 0x80; ++ ++-pub const F_GETLK: c_int = 14; +++cfg_if! { +++ if #[cfg(gnu_time64_abi)] { +++ pub const F_GETLK: c_int = 33; +++ } else { +++ pub const F_GETLK: c_int = 14; +++ } +++} ++ pub const F_GETOWN: c_int = 23; ++ pub const F_SETOWN: c_int = 24; ++ ++diff --git a/src/unix/linux_like/linux/gnu/b32/powerpc.rs b/src/unix/linux_like/linux/gnu/b32/powerpc.rs ++index 79a26cd613..8fe5f10c95 100644 ++--- a/src/unix/linux_like/linux/gnu/b32/powerpc.rs +++++ b/src/unix/linux_like/linux/gnu/b32/powerpc.rs ++@@ -310,7 +310,13 @@ pub const MCL_ONFAULT: c_int = 0x8000; ++ pub const POLLWRNORM: c_short = 0x100; ++ pub const POLLWRBAND: c_short = 0x200; ++ ++-pub const F_GETLK: c_int = 5; +++cfg_if! { +++ if #[cfg(gnu_time64_abi)] { +++ pub const F_GETLK: c_int = 12; +++ } else { +++ pub const F_GETLK: c_int = 5; +++ } +++} ++ pub const F_GETOWN: c_int = 9; ++ pub const F_SETOWN: c_int = 8; ++ ++diff --git a/src/unix/linux_like/linux/gnu/b32/x86/mod.rs b/src/unix/linux_like/linux/gnu/b32/x86/mod.rs ++index e5a1a2afb7..da99b5dd7c 100644 ++--- a/src/unix/linux_like/linux/gnu/b32/x86/mod.rs +++++ b/src/unix/linux_like/linux/gnu/b32/x86/mod.rs ++@@ -472,7 +472,13 @@ pub const SA_NOCLDWAIT: c_int = 0x00000002; ++ pub const SOCK_STREAM: c_int = 1; ++ pub const SOCK_DGRAM: c_int = 2; ++ ++-pub const F_GETLK: c_int = 5; +++cfg_if! { +++ if #[cfg(gnu_time64_abi)] { +++ pub const F_GETLK: c_int = 12; +++ } else { +++ pub const F_GETLK: c_int = 5; +++ } +++} ++ pub const F_GETOWN: c_int = 9; ++ pub const F_SETOWN: c_int = 8; ++ +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-140-setlk.patch mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-140-setlk.patch +--- mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-140-setlk.patch 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-140-setlk.patch 2024-12-28 15:35:00.000000000 -0500 +@@ -0,0 +1,58 @@ ++This patch is based on the commit described below, taken from upstream pull ++request 3175, it was adapted for use in the Debian package by Peter Michael ++Green. ++ ++commit 4446ec06aa33813c732e2e473742cd5f410e1906 ++Author: Ola x Nilsson ++Date: Mon Mar 20 14:32:07 2023 +0100 ++ ++ gnu: Update F_SETLK and F_SETLKW for 64-bit time ++ ++ Also add the F_[SG]ET*64 constants. ++ ++Index: libc/src/unix/linux_like/linux/gnu/b32/mod.rs ++=================================================================== ++--- libc.orig/src/unix/linux_like/linux/gnu/b32/mod.rs +++++ libc/src/unix/linux_like/linux/gnu/b32/mod.rs ++@@ -255,9 +255,6 @@ cfg_if! { ++ ++ pub const PTRACE_DETACH: c_uint = 11; ++ ++- pub const F_SETLK: c_int = 8; ++- pub const F_SETLKW: c_int = 9; ++- ++ pub const F_RDLCK: c_int = 1; ++ pub const F_WRLCK: c_int = 2; ++ pub const F_UNLCK: c_int = 3; ++@@ -301,9 +298,6 @@ cfg_if! { ++ ++ pub const PTRACE_DETACH: c_uint = 17; ++ ++- pub const F_SETLK: c_int = 6; ++- pub const F_SETLKW: c_int = 7; ++- ++ pub const F_RDLCK: c_int = 0; ++ pub const F_WRLCK: c_int = 1; ++ pub const F_UNLCK: c_int = 2; ++@@ -339,6 +333,21 @@ cfg_if! { ++ pub const EFD_CLOEXEC: c_int = 0x80000; ++ } ++ } +++cfg_if! { +++ if #[cfg(target_arch = "sparc")] { +++ pub const F_SETLK: c_int = 8; +++ pub const F_SETLKW: c_int = 9; +++ } else if #[cfg(all(gnu_time64_abi, target_arch = "mips"))] { +++ pub const F_SETLK: c_int = 34; +++ pub const F_SETLKW: c_int = 35; +++ } else if #[cfg(gnu_time64_abi)] { +++ pub const F_SETLK: c_int = 13; +++ pub const F_SETLKW: c_int = 14; +++ } else { +++ pub const F_SETLK: c_int = 6; +++ pub const F_SETLKW: c_int = 7; +++ } +++} ++ ++ #[cfg(target_endian = "little")] ++ pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-150-aiocb.patch mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-150-aiocb.patch +--- mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-150-aiocb.patch 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-150-aiocb.patch 2024-12-28 15:35:00.000000000 -0500 +@@ -0,0 +1,23 @@ ++This patch is based on the commit described below, taken from upstream pull ++request 3175, it was adapted for use in the Debian package by Peter Michael ++Green. ++ ++commit 9fe31f90a01d5c5c49eef81676f5968b917f5e62 ++Author: Ola x Nilsson ++Date: Mon Mar 20 14:33:33 2023 +0100 ++ ++ gnu: Update struct aiocb for _TIME_BITS=64 ++ ++Index: libc/src/unix/linux_like/linux/gnu/mod.rs ++=================================================================== ++--- libc.orig/src/unix/linux_like/linux/gnu/mod.rs +++++ libc/src/unix/linux_like/linux/gnu/mod.rs ++@@ -32,7 +32,7 @@ s! { ++ __error_code: c_int, ++ __return_value: ssize_t, ++ pub aio_offset: off_t, ++- #[cfg(all(not(target_arch = "x86_64"), target_pointer_width = "32"))] +++ #[cfg(all(not(gnu_time64_abi), not(target_arch = "x86_64"), target_pointer_width = "32"))] ++ __unused1: [c_char; 4], ++ __glibc_reserved: [c_char; 32], ++ } +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-160-timespec.patch mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-160-timespec.patch +--- mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-160-timespec.patch 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-160-timespec.patch 2024-12-28 15:35:00.000000000 -0500 +@@ -0,0 +1,34 @@ ++This patch is based on the commit described below, taken from upstream pull ++request 3175. ++ ++It was adjusted by Peter Michael Green to use target_endian instead of hard ++coding big and little endian architectures. ++ ++commit 7f3a1e7727377045d73daca272711c548fe0f394 ++Author: Ola x Nilsson ++Date: Mon Mar 27 14:17:19 2023 +0200 ++ ++ Update struct timespec for _TIME_BITS=64 ++ ++ powerpc and mips wants 32 bits of padding before tv_nsec. ++ arm and x86 wants 32bits of padding after tv_nsec. ++ ++diff --git a/src/unix/mod.rs b/src/unix/mod.rs ++index 42a293e9b0..f120933db6 100644 ++--- a/src/unix/mod.rs +++++ b/src/unix/mod.rs ++@@ -74,10 +74,14 @@ s! { ++ // See https://sourceware.org/bugzilla/show_bug.cgi?id=16437 ++ pub struct timespec { ++ pub tv_sec: time_t, +++ #[cfg(all(gnu_time64_abi, target_endian = "big"))] +++ __pad: i32, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ pub tv_nsec: i64, ++ #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] ++ pub tv_nsec: c_long, +++ #[cfg(all(gnu_time64_abi, target_endian = "little"))] +++ __pad: i32, ++ } ++ ++ pub struct rlimit { +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-190-fix-clock-nanosleep-i386.patch mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-190-fix-clock-nanosleep-i386.patch +--- mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-190-fix-clock-nanosleep-i386.patch 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/debian/patches/time64-190-fix-clock-nanosleep-i386.patch 2024-12-28 15:35:00.000000000 -0500 +@@ -0,0 +1,14 @@ ++Index: libc/src/unix/linux_like/linux/mod.rs ++=================================================================== ++--- libc.orig/src/unix/linux_like/linux/mod.rs +++++ libc/src/unix/linux_like/linux/mod.rs ++@@ -5628,7 +5628,8 @@ extern "C" { ++ all( ++ target_env = "gnu", ++ target_pointer_width = "32", ++- not(target_arch = "x86_64") +++ not(target_arch = "x86_64"), +++ gnu_time64_abi ++ ), ++ link_name = "__clock_nanosleep_time64" ++ )] +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/.git-blame-ignore-revs mesa-25.3.3/subprojects/libc-0.2.169/.git-blame-ignore-revs +--- mesa-25.3.3/subprojects/libc-0.2.169/.git-blame-ignore-revs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/.git-blame-ignore-revs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,6 @@ ++# Format macro bodies ++50f26e08e146b7e9c7d1af9614486eba327d1e31 ++ ++# Automated changes related to the 2021 edition upgrade ++643182f7da26cedb09349b8bb3735c2e58ba24e6 ++108310db03e7db35ef48a902d9ce9a88ab8f9b77 +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/.gitignore mesa-25.3.3/subprojects/libc-0.2.169/.gitignore +--- mesa-25.3.3/subprojects/libc-0.2.169/.gitignore 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/.gitignore 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,4 @@ ++target ++Cargo.lock ++*~ ++style +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/LICENSE-APACHE mesa-25.3.3/subprojects/libc-0.2.169/LICENSE-APACHE +--- mesa-25.3.3/subprojects/libc-0.2.169/LICENSE-APACHE 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/LICENSE-APACHE 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,176 @@ ++ Apache License ++ Version 2.0, January 2004 ++ http://www.apache.org/licenses/ ++ ++TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION ++ ++1. Definitions. ++ ++ "License" shall mean the terms and conditions for use, reproduction, ++ and distribution as defined by Sections 1 through 9 of this document. ++ ++ "Licensor" shall mean the copyright owner or entity authorized by ++ the copyright owner that is granting the License. ++ ++ "Legal Entity" shall mean the union of the acting entity and all ++ other entities that control, are controlled by, or are under common ++ control with that entity. For the purposes of this definition, ++ "control" means (i) the power, direct or indirect, to cause the ++ direction or management of such entity, whether by contract or ++ otherwise, or (ii) ownership of fifty percent (50%) or more of the ++ outstanding shares, or (iii) beneficial ownership of such entity. ++ ++ "You" (or "Your") shall mean an individual or Legal Entity ++ exercising permissions granted by this License. ++ ++ "Source" form shall mean the preferred form for making modifications, ++ including but not limited to software source code, documentation ++ source, and configuration files. ++ ++ "Object" form shall mean any form resulting from mechanical ++ transformation or translation of a Source form, including but ++ not limited to compiled object code, generated documentation, ++ and conversions to other media types. ++ ++ "Work" shall mean the work of authorship, whether in Source or ++ Object form, made available under the License, as indicated by a ++ copyright notice that is included in or attached to the work ++ (an example is provided in the Appendix below). ++ ++ "Derivative Works" shall mean any work, whether in Source or Object ++ form, that is based on (or derived from) the Work and for which the ++ editorial revisions, annotations, elaborations, or other modifications ++ represent, as a whole, an original work of authorship. For the purposes ++ of this License, Derivative Works shall not include works that remain ++ separable from, or merely link (or bind by name) to the interfaces of, ++ the Work and Derivative Works thereof. ++ ++ "Contribution" shall mean any work of authorship, including ++ the original version of the Work and any modifications or additions ++ to that Work or Derivative Works thereof, that is intentionally ++ submitted to Licensor for inclusion in the Work by the copyright owner ++ or by an individual or Legal Entity authorized to submit on behalf of ++ the copyright owner. For the purposes of this definition, "submitted" ++ means any form of electronic, verbal, or written communication sent ++ to the Licensor or its representatives, including but not limited to ++ communication on electronic mailing lists, source code control systems, ++ and issue tracking systems that are managed by, or on behalf of, the ++ Licensor for the purpose of discussing and improving the Work, but ++ excluding communication that is conspicuously marked or otherwise ++ designated in writing by the copyright owner as "Not a Contribution." ++ ++ "Contributor" shall mean Licensor and any individual or Legal Entity ++ on behalf of whom a Contribution has been received by Licensor and ++ subsequently incorporated within the Work. ++ ++2. Grant of Copyright License. Subject to the terms and conditions of ++ this License, each Contributor hereby grants to You a perpetual, ++ worldwide, non-exclusive, no-charge, royalty-free, irrevocable ++ copyright license to reproduce, prepare Derivative Works of, ++ publicly display, publicly perform, sublicense, and distribute the ++ Work and such Derivative Works in Source or Object form. ++ ++3. Grant of Patent License. Subject to the terms and conditions of ++ this License, each Contributor hereby grants to You a perpetual, ++ worldwide, non-exclusive, no-charge, royalty-free, irrevocable ++ (except as stated in this section) patent license to make, have made, ++ use, offer to sell, sell, import, and otherwise transfer the Work, ++ where such license applies only to those patent claims licensable ++ by such Contributor that are necessarily infringed by their ++ Contribution(s) alone or by combination of their Contribution(s) ++ with the Work to which such Contribution(s) was submitted. If You ++ institute patent litigation against any entity (including a ++ cross-claim or counterclaim in a lawsuit) alleging that the Work ++ or a Contribution incorporated within the Work constitutes direct ++ or contributory patent infringement, then any patent licenses ++ granted to You under this License for that Work shall terminate ++ as of the date such litigation is filed. ++ ++4. Redistribution. You may reproduce and distribute copies of the ++ Work or Derivative Works thereof in any medium, with or without ++ modifications, and in Source or Object form, provided that You ++ meet the following conditions: ++ ++ (a) You must give any other recipients of the Work or ++ Derivative Works a copy of this License; and ++ ++ (b) You must cause any modified files to carry prominent notices ++ stating that You changed the files; and ++ ++ (c) You must retain, in the Source form of any Derivative Works ++ that You distribute, all copyright, patent, trademark, and ++ attribution notices from the Source form of the Work, ++ excluding those notices that do not pertain to any part of ++ the Derivative Works; and ++ ++ (d) If the Work includes a "NOTICE" text file as part of its ++ distribution, then any Derivative Works that You distribute must ++ include a readable copy of the attribution notices contained ++ within such NOTICE file, excluding those notices that do not ++ pertain to any part of the Derivative Works, in at least one ++ of the following places: within a NOTICE text file distributed ++ as part of the Derivative Works; within the Source form or ++ documentation, if provided along with the Derivative Works; or, ++ within a display generated by the Derivative Works, if and ++ wherever such third-party notices normally appear. The contents ++ of the NOTICE file are for informational purposes only and ++ do not modify the License. You may add Your own attribution ++ notices within Derivative Works that You distribute, alongside ++ or as an addendum to the NOTICE text from the Work, provided ++ that such additional attribution notices cannot be construed ++ as modifying the License. ++ ++ You may add Your own copyright statement to Your modifications and ++ may provide additional or different license terms and conditions ++ for use, reproduction, or distribution of Your modifications, or ++ for any such Derivative Works as a whole, provided Your use, ++ reproduction, and distribution of the Work otherwise complies with ++ the conditions stated in this License. ++ ++5. Submission of Contributions. Unless You explicitly state otherwise, ++ any Contribution intentionally submitted for inclusion in the Work ++ by You to the Licensor shall be under the terms and conditions of ++ this License, without any additional terms or conditions. ++ Notwithstanding the above, nothing herein shall supersede or modify ++ the terms of any separate license agreement you may have executed ++ with Licensor regarding such Contributions. ++ ++6. Trademarks. This License does not grant permission to use the trade ++ names, trademarks, service marks, or product names of the Licensor, ++ except as required for reasonable and customary use in describing the ++ origin of the Work and reproducing the content of the NOTICE file. ++ ++7. Disclaimer of Warranty. Unless required by applicable law or ++ agreed to in writing, Licensor provides the Work (and each ++ Contributor provides its Contributions) on an "AS IS" BASIS, ++ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or ++ implied, including, without limitation, any warranties or conditions ++ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A ++ PARTICULAR PURPOSE. You are solely responsible for determining the ++ appropriateness of using or redistributing the Work and assume any ++ risks associated with Your exercise of permissions under this License. ++ ++8. Limitation of Liability. In no event and under no legal theory, ++ whether in tort (including negligence), contract, or otherwise, ++ unless required by applicable law (such as deliberate and grossly ++ negligent acts) or agreed to in writing, shall any Contributor be ++ liable to You for damages, including any direct, indirect, special, ++ incidental, or consequential damages of any character arising as a ++ result of this License or out of the use or inability to use the ++ Work (including but not limited to damages for loss of goodwill, ++ work stoppage, computer failure or malfunction, or any and all ++ other commercial damages or losses), even if such Contributor ++ has been advised of the possibility of such damages. ++ ++9. Accepting Warranty or Additional Liability. While redistributing ++ the Work or Derivative Works thereof, You may choose to offer, ++ and charge a fee for, acceptance of support, warranty, indemnity, ++ or other liability obligations and/or rights consistent with this ++ License. However, in accepting such obligations, You may act only ++ on Your own behalf and on Your sole responsibility, not on behalf ++ of any other Contributor, and only if You agree to indemnify, ++ defend, and hold each Contributor harmless for any liability ++ incurred by, or claims asserted against, such Contributor by reason ++ of your accepting any such warranty or additional liability. ++ ++END OF TERMS AND CONDITIONS +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/LICENSE-MIT mesa-25.3.3/subprojects/libc-0.2.169/LICENSE-MIT +--- mesa-25.3.3/subprojects/libc-0.2.169/LICENSE-MIT 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/LICENSE-MIT 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,25 @@ ++Copyright (c) 2014-2020 The Rust Project Developers ++ ++Permission is hereby granted, free of charge, to any ++person obtaining a copy of this software and associated ++documentation files (the "Software"), to deal in the ++Software without restriction, including without ++limitation the rights to use, copy, modify, merge, ++publish, distribute, sublicense, and/or sell copies of ++the Software, and to permit persons to whom the Software ++is furnished to do so, subject to the following ++conditions: ++ ++The above copyright notice and this permission notice ++shall be included in all copies or substantial portions ++of the Software. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ++ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED ++TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A ++PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT ++SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ++CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION ++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR ++IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ++DEALINGS IN THE SOFTWARE. +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/meson.build mesa-25.3.3/subprojects/libc-0.2.169/meson.build +--- mesa-25.3.3/subprojects/libc-0.2.169/meson.build 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/meson.build 2026-05-26 15:46:06.000000000 -0500 +@@ -0,0 +1,39 @@ ++# Copyright © 2024 Google ++# SPDX-License-Identifier: MIT ++ ++project('libc', 'rust', version : '0.2.169', license : 'MIT OR Apache-2.0') ++ ++libc_args = [ ++ '--cfg', 'feature="default"', ++ '--cfg', 'feature="extra_traits"', ++ '--cfg', 'feature="std"', ++ '--cfg', 'freebsd11', ++ '--cfg', 'freebsd11', ++ '--cfg', 'freebsd11', ++ '--cfg', 'libc_align', ++ '--cfg', 'libc_cfg_target_vendor', ++ '--cfg', 'libc_const_extern_fn', ++ '--cfg', 'libc_const_size_of', ++ '--cfg', 'libc_core_cvoid', ++ '--cfg', 'libc_int128', ++ '--cfg', 'libc_long_array', ++ '--cfg', 'libc_non_exhaustive', ++ '--cfg', 'libc_packedN', ++ '--cfg', 'libc_priv_mod_use', ++ '--cfg', 'libc_ptr_addr_of', ++ '--cfg', 'libc_underscore_const_names', ++ '--cfg', 'libc_union', ++] ++ ++lib = static_library( ++ 'libc', ++ 'src/lib.rs', ++ rust_abi : 'rust', ++ override_options : ['rust_std=2021', 'build.rust_std=2021'], ++ native : true, ++ rust_args: libc_args, ++) ++ ++dep_libc = declare_dependency( ++ link_with : [lib] ++) +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/.meson-subproject-wrap-hash.txt mesa-25.3.3/subprojects/libc-0.2.169/.meson-subproject-wrap-hash.txt +--- mesa-25.3.3/subprojects/libc-0.2.169/.meson-subproject-wrap-hash.txt 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/.meson-subproject-wrap-hash.txt 2026-05-29 13:40:54.000000000 -0500 +@@ -0,0 +1 @@ ++7a015b536c5896c7331de2253ce698f2d310420115be3cb2f00266545ac48737 +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/README.md mesa-25.3.3/subprojects/libc-0.2.169/README.md +--- mesa-25.3.3/subprojects/libc-0.2.169/README.md 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/README.md 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,117 @@ ++# libc - Raw FFI bindings to platforms' system libraries ++ ++[![GHA Status]][GitHub Actions] [![Cirrus CI Status]][Cirrus CI] [![Latest Version]][crates.io] [![Documentation]][docs.rs] ![License] ++ ++`libc` provides all of the definitions necessary to easily interoperate with C ++code (or "C-like" code) on each of the platforms that Rust supports. This ++includes type definitions (e.g. `c_int`), constants (e.g. `EINVAL`) as well as ++function headers (e.g. `malloc`). ++ ++This crate exports all underlying platform types, functions, and constants under ++the crate root, so all items are accessible as `libc::foo`. The types and values ++of all the exported APIs match the platform that libc is compiled for. ++ ++Windows API bindings are not included in this crate. If you are looking for ++WinAPI bindings, consider using crates like [windows-sys]. ++ ++More detailed information about the design of this library can be found in its ++[associated RFC][rfc]. ++ ++[rfc]: https://github.com/rust-lang/rfcs/blob/HEAD/text/1291-promote-libc.md ++[windows-sys]: https://docs.rs/windows-sys ++ ++## v1.0 Roadmap ++ ++Currently, `libc` has two active branches: `main` for the upcoming v1.0 release, ++and `libc-0.2` for the currently published version. By default all pull requests ++should target `main`; once reviewed, they can be cherry picked to the `libc-0.2` ++branch if needed. ++ ++We will stop making new v0.2 releases once v1.0 is released. ++ ++See the section in [CONTRIBUTING.md](CONTRIBUTING.md#v10-roadmap) for more ++details. ++ ++## Usage ++ ++Add the following to your `Cargo.toml`: ++ ++```toml ++[dependencies] ++libc = "0.2" ++``` ++ ++## Features ++ ++* `std`: by default `libc` links to the standard library. Disable this feature ++ to remove this dependency and be able to use `libc` in `#![no_std]` crates. ++ ++* `extra_traits`: all `struct`s implemented in `libc` are `Copy` and `Clone`. ++ This feature derives `Debug`, `Eq`, `Hash`, and `PartialEq`. ++ ++The following features are deprecated: ++ ++* `use_std`: this is equivalent to `std` ++* `const-extern-fn`: this is now enabled by default ++* `align`: this is now enabled by default ++ ++## Rust version support ++ ++The minimum supported Rust toolchain version is currently **Rust 1.63**. ++ ++Increases to the MSRV are allowed to change without a major (i.e. semver- ++breaking) release in order to avoid a ripple effect in the ecosystem. A policy ++for when this may change is a work in progress. ++ ++`libc` may continue to compile with Rust versions older than the current MSRV ++but this is not guaranteed. ++ ++## Platform support ++ ++You can see the platform(target)-specific docs on [docs.rs], select a platform ++you want to see. ++ ++See [`ci/build.sh`](https://github.com/rust-lang/libc/blob/HEAD/ci/build.sh) for ++the platforms on which `libc` is guaranteed to build for each Rust toolchain. ++The test-matrix at [GitHub Actions] and [Cirrus CI] show the platforms in which ++`libc` tests are run. ++ ++

++ ++## License ++ ++This project is licensed under either of ++ ++* [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0) ++ ([LICENSE-APACHE](https://github.com/rust-lang/libc/blob/HEAD/LICENSE-APACHE)) ++ ++* [MIT License](https://opensource.org/licenses/MIT) ++ ([LICENSE-MIT](https://github.com/rust-lang/libc/blob/HEAD/LICENSE-MIT)) ++ ++at your option. ++ ++## Contributing ++ ++We welcome all people who want to contribute. Please see the ++[contributing instructions] for more information. ++ ++[contributing instructions]: https://github.com/rust-lang/libc/blob/HEAD/CONTRIBUTING.md ++ ++Contributions in any form (issues, pull requests, etc.) to this project must ++adhere to Rust's [Code of Conduct]. ++ ++[Code of Conduct]: https://www.rust-lang.org/policies/code-of-conduct ++ ++Unless you explicitly state otherwise, any contribution intentionally submitted ++for inclusion in `libc` by you, as defined in the Apache-2.0 license, shall be ++dual licensed as above, without any additional terms or conditions. ++ ++[GitHub Actions]: https://github.com/rust-lang/libc/actions ++[GHA Status]: https://github.com/rust-lang/libc/workflows/CI/badge.svg ++[Cirrus CI]: https://cirrus-ci.com/github/rust-lang/libc ++[Cirrus CI Status]: https://api.cirrus-ci.com/github/rust-lang/libc.svg ++[crates.io]: https://crates.io/crates/libc ++[Latest Version]: https://img.shields.io/crates/v/libc.svg ++[Documentation]: https://docs.rs/libc/badge.svg ++[docs.rs]: https://docs.rs/libc ++[License]: https://img.shields.io/crates/l/libc.svg +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/.release-plz.toml mesa-25.3.3/subprojects/libc-0.2.169/.release-plz.toml +--- mesa-25.3.3/subprojects/libc-0.2.169/.release-plz.toml 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/.release-plz.toml 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,49 @@ ++[workspace] ++git_release_name = "{{ version }}" ++git_tag_name = "{{ version }}" ++ ++[changelog] ++body = """ ++## [{{ version | trim_start_matches(pat="v") }}]\ ++ {%- if release_link -%}\ ++ ({{ release_link }})\ ++ {% endif %} \ ++ - {{ timestamp | date(format="%Y-%m-%d") }} ++{% for group, commits in commits | group_by(attribute="group") %} ++### {{ group | upper_first }} ++ {% for commit in commits %} ++ - {% if commit.scope -%}{{ commit.scope | upper_first }}: {% endif %} ++ {%- if commit.breaking %}[**breaking**] {% endif %} ++ {{- commit.message }} ++ {%- if commit.links %} ([{{ commit.links.1.text }}]({{ commit.links.1.href }})){% endif -%} ++ {% endfor %} ++{% endfor %} ++{%- if github -%} ++{% if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %} ++ ## New Contributors ❤️ ++{% endif %}\ ++{% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %} ++ * @{{ contributor.username }} made their first contribution ++ {%- if contributor.pr_number %} in \ ++ [#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \ ++ {%- endif %} ++{%- endfor -%} ++{%- endif %} ++""" ++ ++commit_parsers = [ ++ { message = '(?i)^(\w+: )?feat', group = "added" }, ++ { message = '(?i)^(\w+: )?add', group = "added" }, ++ { message = '(?i)^(\w+: )?change', group = "changed" }, ++ { message = '(?i)^(\w+: )?cleanup', group = "cleanup" }, ++ { message = '(?i)^(\w+: )?deprecate', group = "deprecated" }, ++ { message = '(?i)^(\w+: )?remove', group = "removed" }, ++ { message = '(?i)^(\w+: )?fix', group = "fixed" }, ++ { message = '(?i)^(\w+: )?fix', group = "fixed" }, ++ { message = '^.*', group = "other" }, ++] ++ ++link_parsers = [ ++ # Extract backport patterns ++ { pattern = '\(backport <.*/(\d+)>\)', text = "#$1", href = "https://github.com/rust-lang/libc/pull/$1"} ++] +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/rustfmt.toml mesa-25.3.3/subprojects/libc-0.2.169/rustfmt.toml +--- mesa-25.3.3/subprojects/libc-0.2.169/rustfmt.toml 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/rustfmt.toml 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,4 @@ ++edition = "2021" ++error_on_line_overflow = true ++group_imports = "StdExternalCrate" ++imports_granularity = "Module" +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/fixed_width_ints.rs mesa-25.3.3/subprojects/libc-0.2.169/src/fixed_width_ints.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/fixed_width_ints.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/fixed_width_ints.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,97 @@ ++//! This module contains type aliases for C's fixed-width integer types . ++//! ++//! These aliases are deprecated: use the Rust types instead. ++ ++#[deprecated(since = "0.2.55", note = "Use i8 instead.")] ++pub type int8_t = i8; ++#[deprecated(since = "0.2.55", note = "Use i16 instead.")] ++pub type int16_t = i16; ++#[deprecated(since = "0.2.55", note = "Use i32 instead.")] ++pub type int32_t = i32; ++#[deprecated(since = "0.2.55", note = "Use i64 instead.")] ++pub type int64_t = i64; ++#[deprecated(since = "0.2.55", note = "Use u8 instead.")] ++pub type uint8_t = u8; ++#[deprecated(since = "0.2.55", note = "Use u16 instead.")] ++pub type uint16_t = u16; ++#[deprecated(since = "0.2.55", note = "Use u32 instead.")] ++pub type uint32_t = u32; ++#[deprecated(since = "0.2.55", note = "Use u64 instead.")] ++pub type uint64_t = u64; ++ ++cfg_if! { ++ if #[cfg(all(target_arch = "aarch64", not(target_os = "windows")))] { ++ // This introduces partial support for FFI with __int128 and ++ // equivalent types on platforms where Rust's definition is validated ++ // to match the standard C ABI of that platform. ++ // ++ // Rust does not guarantee u128/i128 are sound for FFI, and its ++ // definitions are in fact known to be incompatible. [0] ++ // ++ // However these problems aren't fundamental, and are just platform ++ // inconsistencies. Specifically at the time of this writing: ++ // ++ // * For x64 SysV ABIs (everything but Windows), the types are underaligned. ++ // * For all Windows ABIs, Microsoft doesn't actually officially define __int128, ++ // and as a result different implementations don't actually agree on its ABI. ++ // ++ // But on the other major aarch64 platforms (android, linux, ios, macos) we have ++ // validated that rustc has the right ABI for these types. This is important because ++ // aarch64 uses these types in some fundamental OS types like user_fpsimd_struct, ++ // which represents saved simd registers. ++ // ++ // Any API which uses these types will need to `#[ignore(improper_ctypes)]` ++ // until the upstream rust issue is resolved, but this at least lets us make ++ // progress on platforms where this type is important. ++ // ++ // The list of supported architectures and OSes is intentionally very restricted, ++ // as careful work needs to be done to verify that a particular platform ++ // has a conformant ABI. ++ // ++ // [0]: https://github.com/rust-lang/rust/issues/54341 ++ ++ /// C `__int128` (a GCC extension that's part of many ABIs) ++ pub type __int128 = i128; ++ /// C `unsigned __int128` (a GCC extension that's part of many ABIs) ++ pub type __uint128 = u128; ++ /// C __int128_t (alternate name for [__int128][]) ++ pub type __int128_t = i128; ++ /// C __uint128_t (alternate name for [__uint128][]) ++ pub type __uint128_t = u128; ++ ++ // NOTE: if you add more platforms to here, you may need to cfg ++ // these consts. They should always match the platform's values ++ // for `sizeof(__int128)` and `_Alignof(__int128)`. ++ const _SIZE_128: usize = 16; ++ const _ALIGN_128: usize = 16; ++ ++ // FIXME(ctest): ctest doesn't handle `_` as an identifier so these tests are temporarily ++ // disabled. ++ // macro_rules! static_assert_eq { ++ // ($a:expr, $b:expr) => { ++ // const _: [(); $a] = [(); $b]; ++ // }; ++ // } ++ // ++ // // Since Rust doesn't officially guarantee that these types ++ // // have compatible ABIs, we const assert that these values have the ++ // // known size/align of the target platform's libc. If rustc ever ++ // // tries to regress things, it will cause a compilation error. ++ // // ++ // // This isn't a bullet-proof solution because e.g. it doesn't ++ // // catch the fact that llvm and gcc disagree on how x64 __int128 ++ // // is actually *passed* on the stack (clang underaligns it for ++ // // the same reason that rustc *never* properly aligns it). ++ // static_assert_eq!(core::mem::size_of::<__int128>(), _SIZE_128); ++ // static_assert_eq!(core::mem::align_of::<__int128>(), _ALIGN_128); ++ ++ // static_assert_eq!(core::mem::size_of::<__uint128>(), _SIZE_128); ++ // static_assert_eq!(core::mem::align_of::<__uint128>(), _ALIGN_128); ++ ++ // static_assert_eq!(core::mem::size_of::<__int128_t>(), _SIZE_128); ++ // static_assert_eq!(core::mem::align_of::<__int128_t>(), _ALIGN_128); ++ ++ // static_assert_eq!(core::mem::size_of::<__uint128_t>(), _SIZE_128); ++ // static_assert_eq!(core::mem::align_of::<__uint128_t>(), _ALIGN_128); ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/fuchsia/aarch64.rs mesa-25.3.3/subprojects/libc-0.2.169/src/fuchsia/aarch64.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/fuchsia/aarch64.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/fuchsia/aarch64.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,70 @@ ++use crate::off_t; ++use crate::prelude::*; ++ ++pub type c_char = u8; ++pub type __u64 = c_ulonglong; ++pub type wchar_t = u32; ++pub type nlink_t = c_ulong; ++pub type blksize_t = c_long; ++ ++s! { ++ pub struct stat { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ __pad0: c_ulong, ++ pub st_size: off_t, ++ pub st_blksize: crate::blksize_t, ++ __pad1: c_int, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ __unused: [c_uint; 2], ++ } ++ ++ pub struct stat64 { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ __pad0: c_ulong, ++ pub st_size: off_t, ++ pub st_blksize: crate::blksize_t, ++ __pad1: c_int, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ __unused: [c_uint; 2], ++ } ++ ++ pub struct ipc_perm { ++ pub __ipc_perm_key: crate::key_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub cuid: crate::uid_t, ++ pub cgid: crate::gid_t, ++ pub mode: crate::mode_t, ++ pub __seq: c_ushort, ++ __unused1: c_ulong, ++ __unused2: c_ulong, ++ } ++} ++ ++// From https://cs.opensource.google/fuchsia/fuchsia/+/main:zircon/third_party/ulib/musl/include/bits/signal.h;l=20-21;drc=0827b18ab9540c46f8037f407d17ea15a79e9ba7 ++pub const MINSIGSTKSZ: size_t = 6144; ++pub const SIGSTKSZ: size_t = 12288; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/fuchsia/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/fuchsia/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/fuchsia/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/fuchsia/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,4460 @@ ++//! Definitions found commonly among almost all Unix derivatives ++//! ++//! More functions and definitions can be found in the more specific modules ++//! according to the platform in question. ++ ++use crate::prelude::*; ++ ++// PUB_TYPE ++ ++pub type c_schar = i8; ++pub type c_uchar = u8; ++pub type c_short = i16; ++pub type c_ushort = u16; ++pub type c_int = i32; ++pub type c_uint = u32; ++pub type c_float = f32; ++pub type c_double = f64; ++pub type c_longlong = i64; ++pub type c_ulonglong = u64; ++pub type intmax_t = i64; ++pub type uintmax_t = u64; ++ ++pub type locale_t = *mut c_void; ++ ++pub type size_t = usize; ++pub type ptrdiff_t = isize; ++pub type intptr_t = isize; ++pub type uintptr_t = usize; ++pub type ssize_t = isize; ++ ++pub type pid_t = i32; ++pub type uid_t = u32; ++pub type gid_t = u32; ++pub type in_addr_t = u32; ++pub type in_port_t = u16; ++pub type sighandler_t = size_t; ++pub type cc_t = c_uchar; ++pub type sa_family_t = u16; ++pub type pthread_key_t = c_uint; ++pub type speed_t = c_uint; ++pub type tcflag_t = c_uint; ++pub type clockid_t = c_int; ++pub type key_t = c_int; ++pub type id_t = c_uint; ++pub type useconds_t = u32; ++pub type dev_t = u64; ++pub type socklen_t = u32; ++pub type pthread_t = c_ulong; ++pub type mode_t = u32; ++pub type ino64_t = u64; ++pub type off64_t = i64; ++pub type blkcnt64_t = i64; ++pub type rlim64_t = u64; ++pub type mqd_t = c_int; ++pub type nfds_t = c_ulong; ++pub type nl_item = c_int; ++pub type idtype_t = c_uint; ++pub type loff_t = c_longlong; ++ ++pub type __u8 = c_uchar; ++pub type __u16 = c_ushort; ++pub type __s16 = c_short; ++pub type __u32 = c_uint; ++pub type __s32 = c_int; ++ ++pub type Elf32_Half = u16; ++pub type Elf32_Word = u32; ++pub type Elf32_Off = u32; ++pub type Elf32_Addr = u32; ++ ++pub type Elf64_Half = u16; ++pub type Elf64_Word = u32; ++pub type Elf64_Off = u64; ++pub type Elf64_Addr = u64; ++pub type Elf64_Xword = u64; ++ ++pub type clock_t = c_long; ++pub type time_t = c_long; ++pub type suseconds_t = c_long; ++pub type ino_t = u64; ++pub type off_t = i64; ++pub type blkcnt_t = i64; ++ ++pub type shmatt_t = c_ulong; ++pub type msgqnum_t = c_ulong; ++pub type msglen_t = c_ulong; ++pub type fsblkcnt_t = c_ulonglong; ++pub type fsfilcnt_t = c_ulonglong; ++pub type rlim_t = c_ulonglong; ++ ++pub type c_long = i64; ++pub type c_ulong = u64; ++ ++// FIXME: why are these uninhabited types? that seems... wrong? ++// Presumably these should be `()` or an `extern type` (when that stabilizes). ++#[cfg_attr(feature = "extra_traits", derive(Debug))] ++pub enum timezone {} ++impl Copy for timezone {} ++impl Clone for timezone { ++ fn clone(&self) -> timezone { ++ *self ++ } ++} ++#[cfg_attr(feature = "extra_traits", derive(Debug))] ++pub enum DIR {} ++impl Copy for DIR {} ++impl Clone for DIR { ++ fn clone(&self) -> DIR { ++ *self ++ } ++} ++ ++#[cfg_attr(feature = "extra_traits", derive(Debug))] ++pub enum fpos64_t {} // FIXME: fill this out with a struct ++impl Copy for fpos64_t {} ++impl Clone for fpos64_t { ++ fn clone(&self) -> fpos64_t { ++ *self ++ } ++} ++ ++// PUB_STRUCT ++ ++s! { ++ pub struct group { ++ pub gr_name: *mut c_char, ++ pub gr_passwd: *mut c_char, ++ pub gr_gid: crate::gid_t, ++ pub gr_mem: *mut *mut c_char, ++ } ++ ++ pub struct utimbuf { ++ pub actime: time_t, ++ pub modtime: time_t, ++ } ++ ++ pub struct timeval { ++ pub tv_sec: time_t, ++ pub tv_usec: suseconds_t, ++ } ++ ++ pub struct timespec { ++ pub tv_sec: time_t, ++ pub tv_nsec: c_long, ++ } ++ ++ // FIXME: the rlimit and rusage related functions and types don't exist ++ // within zircon. Are there reasons for keeping them around? ++ pub struct rlimit { ++ pub rlim_cur: rlim_t, ++ pub rlim_max: rlim_t, ++ } ++ ++ pub struct rusage { ++ pub ru_utime: timeval, ++ pub ru_stime: timeval, ++ pub ru_maxrss: c_long, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ __pad1: u32, ++ pub ru_ixrss: c_long, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ __pad2: u32, ++ pub ru_idrss: c_long, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ __pad3: u32, ++ pub ru_isrss: c_long, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ __pad4: u32, ++ pub ru_minflt: c_long, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ __pad5: u32, ++ pub ru_majflt: c_long, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ __pad6: u32, ++ pub ru_nswap: c_long, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ __pad7: u32, ++ pub ru_inblock: c_long, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ __pad8: u32, ++ pub ru_oublock: c_long, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ __pad9: u32, ++ pub ru_msgsnd: c_long, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ __pad10: u32, ++ pub ru_msgrcv: c_long, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ __pad11: u32, ++ pub ru_nsignals: c_long, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ __pad12: u32, ++ pub ru_nvcsw: c_long, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ __pad13: u32, ++ pub ru_nivcsw: c_long, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ __pad14: u32, ++ } ++ ++ pub struct in_addr { ++ pub s_addr: in_addr_t, ++ } ++ ++ pub struct in6_addr { ++ pub s6_addr: [u8; 16], ++ } ++ ++ pub struct ip_mreq { ++ pub imr_multiaddr: in_addr, ++ pub imr_interface: in_addr, ++ } ++ ++ pub struct ip_mreqn { ++ pub imr_multiaddr: in_addr, ++ pub imr_address: in_addr, ++ pub imr_ifindex: c_int, ++ } ++ ++ pub struct ipv6_mreq { ++ pub ipv6mr_multiaddr: in6_addr, ++ pub ipv6mr_interface: c_uint, ++ } ++ ++ pub struct hostent { ++ pub h_name: *mut c_char, ++ pub h_aliases: *mut *mut c_char, ++ pub h_addrtype: c_int, ++ pub h_length: c_int, ++ pub h_addr_list: *mut *mut c_char, ++ } ++ ++ pub struct iovec { ++ pub iov_base: *mut c_void, ++ pub iov_len: size_t, ++ } ++ ++ pub struct pollfd { ++ pub fd: c_int, ++ pub events: c_short, ++ pub revents: c_short, ++ } ++ ++ pub struct winsize { ++ pub ws_row: c_ushort, ++ pub ws_col: c_ushort, ++ pub ws_xpixel: c_ushort, ++ pub ws_ypixel: c_ushort, ++ } ++ ++ pub struct linger { ++ pub l_onoff: c_int, ++ pub l_linger: c_int, ++ } ++ ++ pub struct sigval { ++ // Actually a union of an int and a void* ++ pub sival_ptr: *mut c_void, ++ } ++ ++ // ++ pub struct itimerval { ++ pub it_interval: crate::timeval, ++ pub it_value: crate::timeval, ++ } ++ ++ // ++ pub struct tms { ++ pub tms_utime: crate::clock_t, ++ pub tms_stime: crate::clock_t, ++ pub tms_cutime: crate::clock_t, ++ pub tms_cstime: crate::clock_t, ++ } ++ ++ pub struct servent { ++ pub s_name: *mut c_char, ++ pub s_aliases: *mut *mut c_char, ++ pub s_port: c_int, ++ pub s_proto: *mut c_char, ++ } ++ ++ pub struct protoent { ++ pub p_name: *mut c_char, ++ pub p_aliases: *mut *mut c_char, ++ pub p_proto: c_int, ++ } ++ ++ pub struct aiocb { ++ pub aio_fildes: c_int, ++ pub aio_lio_opcode: c_int, ++ pub aio_reqprio: c_int, ++ pub aio_buf: *mut c_void, ++ pub aio_nbytes: size_t, ++ pub aio_sigevent: crate::sigevent, ++ __td: *mut c_void, ++ __lock: [c_int; 2], ++ __err: c_int, ++ __ret: ssize_t, ++ pub aio_offset: off_t, ++ __next: *mut c_void, ++ __prev: *mut c_void, ++ #[cfg(target_pointer_width = "32")] ++ __dummy4: [c_char; 24], ++ #[cfg(target_pointer_width = "64")] ++ __dummy4: [c_char; 16], ++ } ++ ++ pub struct sigaction { ++ pub sa_sigaction: crate::sighandler_t, ++ pub sa_mask: crate::sigset_t, ++ pub sa_flags: c_int, ++ pub sa_restorer: Option, ++ } ++ ++ pub struct termios { ++ pub c_iflag: crate::tcflag_t, ++ pub c_oflag: crate::tcflag_t, ++ pub c_cflag: crate::tcflag_t, ++ pub c_lflag: crate::tcflag_t, ++ pub c_line: crate::cc_t, ++ pub c_cc: [crate::cc_t; crate::NCCS], ++ pub __c_ispeed: crate::speed_t, ++ pub __c_ospeed: crate::speed_t, ++ } ++ ++ pub struct flock { ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ pub l_start: off_t, ++ pub l_len: off_t, ++ pub l_pid: crate::pid_t, ++ } ++ ++ pub struct ucred { ++ pub pid: crate::pid_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ } ++ ++ pub struct sockaddr { ++ pub sa_family: sa_family_t, ++ pub sa_data: [c_char; 14], ++ } ++ ++ pub struct sockaddr_in { ++ pub sin_family: sa_family_t, ++ pub sin_port: crate::in_port_t, ++ pub sin_addr: crate::in_addr, ++ pub sin_zero: [u8; 8], ++ } ++ ++ pub struct sockaddr_in6 { ++ pub sin6_family: sa_family_t, ++ pub sin6_port: crate::in_port_t, ++ pub sin6_flowinfo: u32, ++ pub sin6_addr: crate::in6_addr, ++ pub sin6_scope_id: u32, ++ } ++ ++ pub struct sockaddr_vm { ++ pub svm_family: sa_family_t, ++ pub svm_reserved1: c_ushort, ++ pub svm_port: crate::in_port_t, ++ pub svm_cid: c_uint, ++ pub svm_zero: [u8; 4], ++ } ++ ++ pub struct addrinfo { ++ pub ai_flags: c_int, ++ pub ai_family: c_int, ++ pub ai_socktype: c_int, ++ pub ai_protocol: c_int, ++ pub ai_addrlen: socklen_t, ++ ++ pub ai_addr: *mut crate::sockaddr, ++ ++ pub ai_canonname: *mut c_char, ++ ++ pub ai_next: *mut addrinfo, ++ } ++ ++ pub struct sockaddr_ll { ++ pub sll_family: c_ushort, ++ pub sll_protocol: c_ushort, ++ pub sll_ifindex: c_int, ++ pub sll_hatype: c_ushort, ++ pub sll_pkttype: c_uchar, ++ pub sll_halen: c_uchar, ++ pub sll_addr: [c_uchar; 8], ++ } ++ ++ pub struct fd_set { ++ fds_bits: [c_ulong; FD_SETSIZE as usize / ULONG_SIZE], ++ } ++ ++ pub struct tm { ++ pub tm_sec: c_int, ++ pub tm_min: c_int, ++ pub tm_hour: c_int, ++ pub tm_mday: c_int, ++ pub tm_mon: c_int, ++ pub tm_year: c_int, ++ pub tm_wday: c_int, ++ pub tm_yday: c_int, ++ pub tm_isdst: c_int, ++ pub tm_gmtoff: c_long, ++ pub tm_zone: *const c_char, ++ } ++ ++ pub struct sched_param { ++ pub sched_priority: c_int, ++ pub sched_ss_low_priority: c_int, ++ pub sched_ss_repl_period: crate::timespec, ++ pub sched_ss_init_budget: crate::timespec, ++ pub sched_ss_max_repl: c_int, ++ } ++ ++ pub struct Dl_info { ++ pub dli_fname: *const c_char, ++ pub dli_fbase: *mut c_void, ++ pub dli_sname: *const c_char, ++ pub dli_saddr: *mut c_void, ++ } ++ ++ pub struct epoll_event { ++ pub events: u32, ++ pub u64: u64, ++ } ++ ++ pub struct lconv { ++ pub decimal_point: *mut c_char, ++ pub thousands_sep: *mut c_char, ++ pub grouping: *mut c_char, ++ pub int_curr_symbol: *mut c_char, ++ pub currency_symbol: *mut c_char, ++ pub mon_decimal_point: *mut c_char, ++ pub mon_thousands_sep: *mut c_char, ++ pub mon_grouping: *mut c_char, ++ pub positive_sign: *mut c_char, ++ pub negative_sign: *mut c_char, ++ pub int_frac_digits: c_char, ++ pub frac_digits: c_char, ++ pub p_cs_precedes: c_char, ++ pub p_sep_by_space: c_char, ++ pub n_cs_precedes: c_char, ++ pub n_sep_by_space: c_char, ++ pub p_sign_posn: c_char, ++ pub n_sign_posn: c_char, ++ pub int_p_cs_precedes: c_char, ++ pub int_p_sep_by_space: c_char, ++ pub int_n_cs_precedes: c_char, ++ pub int_n_sep_by_space: c_char, ++ pub int_p_sign_posn: c_char, ++ pub int_n_sign_posn: c_char, ++ } ++ ++ pub struct rlimit64 { ++ pub rlim_cur: rlim64_t, ++ pub rlim_max: rlim64_t, ++ } ++ ++ pub struct glob_t { ++ pub gl_pathc: size_t, ++ pub gl_pathv: *mut *mut c_char, ++ pub gl_offs: size_t, ++ pub gl_flags: c_int, ++ ++ __unused1: *mut c_void, ++ __unused2: *mut c_void, ++ __unused3: *mut c_void, ++ __unused4: *mut c_void, ++ __unused5: *mut c_void, ++ } ++ ++ pub struct ifaddrs { ++ pub ifa_next: *mut ifaddrs, ++ pub ifa_name: *mut c_char, ++ pub ifa_flags: c_uint, ++ pub ifa_addr: *mut crate::sockaddr, ++ pub ifa_netmask: *mut crate::sockaddr, ++ pub ifa_ifu: *mut crate::sockaddr, // FIXME This should be a union ++ pub ifa_data: *mut c_void, ++ } ++ ++ pub struct passwd { ++ pub pw_name: *mut c_char, ++ pub pw_passwd: *mut c_char, ++ pub pw_uid: crate::uid_t, ++ pub pw_gid: crate::gid_t, ++ pub pw_gecos: *mut c_char, ++ pub pw_dir: *mut c_char, ++ pub pw_shell: *mut c_char, ++ } ++ ++ pub struct spwd { ++ pub sp_namp: *mut c_char, ++ pub sp_pwdp: *mut c_char, ++ pub sp_lstchg: c_long, ++ pub sp_min: c_long, ++ pub sp_max: c_long, ++ pub sp_warn: c_long, ++ pub sp_inact: c_long, ++ pub sp_expire: c_long, ++ pub sp_flag: c_ulong, ++ } ++ ++ pub struct statvfs { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_favail: crate::fsfilcnt_t, ++ #[cfg(target_endian = "little")] ++ pub f_fsid: c_ulong, ++ #[cfg(all(target_pointer_width = "32", not(target_arch = "x86_64")))] ++ __f_unused: c_int, ++ #[cfg(target_endian = "big")] ++ pub f_fsid: c_ulong, ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ __f_spare: [c_int; 6], ++ } ++ ++ pub struct dqblk { ++ pub dqb_bhardlimit: u64, ++ pub dqb_bsoftlimit: u64, ++ pub dqb_curspace: u64, ++ pub dqb_ihardlimit: u64, ++ pub dqb_isoftlimit: u64, ++ pub dqb_curinodes: u64, ++ pub dqb_btime: u64, ++ pub dqb_itime: u64, ++ pub dqb_valid: u32, ++ } ++ ++ pub struct signalfd_siginfo { ++ pub ssi_signo: u32, ++ pub ssi_errno: i32, ++ pub ssi_code: i32, ++ pub ssi_pid: u32, ++ pub ssi_uid: u32, ++ pub ssi_fd: i32, ++ pub ssi_tid: u32, ++ pub ssi_band: u32, ++ pub ssi_overrun: u32, ++ pub ssi_trapno: u32, ++ pub ssi_status: i32, ++ pub ssi_int: i32, ++ pub ssi_ptr: u64, ++ pub ssi_utime: u64, ++ pub ssi_stime: u64, ++ pub ssi_addr: u64, ++ pub ssi_addr_lsb: u16, ++ _pad2: u16, ++ pub ssi_syscall: i32, ++ pub ssi_call_addr: u64, ++ pub ssi_arch: u32, ++ _pad: [u8; 28], ++ } ++ ++ pub struct itimerspec { ++ pub it_interval: crate::timespec, ++ pub it_value: crate::timespec, ++ } ++ ++ pub struct fsid_t { ++ __val: [c_int; 2], ++ } ++ ++ pub struct cpu_set_t { ++ #[cfg(all(target_pointer_width = "32", not(target_arch = "x86_64")))] ++ bits: [u32; 32], ++ #[cfg(not(all(target_pointer_width = "32", not(target_arch = "x86_64"))))] ++ bits: [u64; 16], ++ } ++ ++ pub struct if_nameindex { ++ pub if_index: c_uint, ++ pub if_name: *mut c_char, ++ } ++ ++ // System V IPC ++ pub struct msginfo { ++ pub msgpool: c_int, ++ pub msgmap: c_int, ++ pub msgmax: c_int, ++ pub msgmnb: c_int, ++ pub msgmni: c_int, ++ pub msgssz: c_int, ++ pub msgtql: c_int, ++ pub msgseg: c_ushort, ++ } ++ ++ pub struct mmsghdr { ++ pub msg_hdr: crate::msghdr, ++ pub msg_len: c_uint, ++ } ++ ++ pub struct sembuf { ++ pub sem_num: c_ushort, ++ pub sem_op: c_short, ++ pub sem_flg: c_short, ++ } ++ ++ pub struct input_event { ++ pub time: crate::timeval, ++ pub type_: crate::__u16, ++ pub code: crate::__u16, ++ pub value: crate::__s32, ++ } ++ ++ pub struct input_id { ++ pub bustype: crate::__u16, ++ pub vendor: crate::__u16, ++ pub product: crate::__u16, ++ pub version: crate::__u16, ++ } ++ ++ pub struct input_absinfo { ++ pub value: crate::__s32, ++ pub minimum: crate::__s32, ++ pub maximum: crate::__s32, ++ pub fuzz: crate::__s32, ++ pub flat: crate::__s32, ++ pub resolution: crate::__s32, ++ } ++ ++ pub struct input_keymap_entry { ++ pub flags: crate::__u8, ++ pub len: crate::__u8, ++ pub index: crate::__u16, ++ pub keycode: crate::__u32, ++ pub scancode: [crate::__u8; 32], ++ } ++ ++ pub struct input_mask { ++ pub type_: crate::__u32, ++ pub codes_size: crate::__u32, ++ pub codes_ptr: crate::__u64, ++ } ++ ++ pub struct ff_replay { ++ pub length: crate::__u16, ++ pub delay: crate::__u16, ++ } ++ ++ pub struct ff_trigger { ++ pub button: crate::__u16, ++ pub interval: crate::__u16, ++ } ++ ++ pub struct ff_envelope { ++ pub attack_length: crate::__u16, ++ pub attack_level: crate::__u16, ++ pub fade_length: crate::__u16, ++ pub fade_level: crate::__u16, ++ } ++ ++ pub struct ff_constant_effect { ++ pub level: crate::__s16, ++ pub envelope: ff_envelope, ++ } ++ ++ pub struct ff_ramp_effect { ++ pub start_level: crate::__s16, ++ pub end_level: crate::__s16, ++ pub envelope: ff_envelope, ++ } ++ ++ pub struct ff_condition_effect { ++ pub right_saturation: crate::__u16, ++ pub left_saturation: crate::__u16, ++ ++ pub right_coeff: crate::__s16, ++ pub left_coeff: crate::__s16, ++ ++ pub deadband: crate::__u16, ++ pub center: crate::__s16, ++ } ++ ++ pub struct ff_periodic_effect { ++ pub waveform: crate::__u16, ++ pub period: crate::__u16, ++ pub magnitude: crate::__s16, ++ pub offset: crate::__s16, ++ pub phase: crate::__u16, ++ ++ pub envelope: ff_envelope, ++ ++ pub custom_len: crate::__u32, ++ pub custom_data: *mut crate::__s16, ++ } ++ ++ pub struct ff_rumble_effect { ++ pub strong_magnitude: crate::__u16, ++ pub weak_magnitude: crate::__u16, ++ } ++ ++ pub struct ff_effect { ++ pub type_: crate::__u16, ++ pub id: crate::__s16, ++ pub direction: crate::__u16, ++ pub trigger: ff_trigger, ++ pub replay: ff_replay, ++ // FIXME(1.0): this is actually a union ++ #[cfg(target_pointer_width = "64")] ++ pub u: [u64; 4], ++ #[cfg(target_pointer_width = "32")] ++ pub u: [u32; 7], ++ } ++ ++ pub struct dl_phdr_info { ++ #[cfg(target_pointer_width = "64")] ++ pub dlpi_addr: Elf64_Addr, ++ #[cfg(target_pointer_width = "32")] ++ pub dlpi_addr: Elf32_Addr, ++ ++ pub dlpi_name: *const c_char, ++ ++ #[cfg(target_pointer_width = "64")] ++ pub dlpi_phdr: *const Elf64_Phdr, ++ #[cfg(target_pointer_width = "32")] ++ pub dlpi_phdr: *const Elf32_Phdr, ++ ++ #[cfg(target_pointer_width = "64")] ++ pub dlpi_phnum: Elf64_Half, ++ #[cfg(target_pointer_width = "32")] ++ pub dlpi_phnum: Elf32_Half, ++ ++ pub dlpi_adds: c_ulonglong, ++ pub dlpi_subs: c_ulonglong, ++ pub dlpi_tls_modid: size_t, ++ pub dlpi_tls_data: *mut c_void, ++ } ++ ++ pub struct Elf32_Phdr { ++ pub p_type: Elf32_Word, ++ pub p_offset: Elf32_Off, ++ pub p_vaddr: Elf32_Addr, ++ pub p_paddr: Elf32_Addr, ++ pub p_filesz: Elf32_Word, ++ pub p_memsz: Elf32_Word, ++ pub p_flags: Elf32_Word, ++ pub p_align: Elf32_Word, ++ } ++ ++ pub struct Elf64_Phdr { ++ pub p_type: Elf64_Word, ++ pub p_flags: Elf64_Word, ++ pub p_offset: Elf64_Off, ++ pub p_vaddr: Elf64_Addr, ++ pub p_paddr: Elf64_Addr, ++ pub p_filesz: Elf64_Xword, ++ pub p_memsz: Elf64_Xword, ++ pub p_align: Elf64_Xword, ++ } ++ ++ pub struct statfs64 { ++ pub f_type: c_ulong, ++ pub f_bsize: c_ulong, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_fsid: crate::fsid_t, ++ pub f_namelen: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_flags: c_ulong, ++ pub f_spare: [c_ulong; 4], ++ } ++ ++ pub struct statvfs64 { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: u64, ++ pub f_bfree: u64, ++ pub f_bavail: u64, ++ pub f_files: u64, ++ pub f_ffree: u64, ++ pub f_favail: u64, ++ pub f_fsid: c_ulong, ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ __f_spare: [c_int; 6], ++ } ++ ++ pub struct stack_t { ++ pub ss_sp: *mut c_void, ++ pub ss_flags: c_int, ++ pub ss_size: size_t, ++ } ++ ++ pub struct pthread_attr_t { ++ __size: [u64; 7], ++ } ++ ++ pub struct sigset_t { ++ __val: [c_ulong; 16], ++ } ++ ++ pub struct shmid_ds { ++ pub shm_perm: crate::ipc_perm, ++ pub shm_segsz: size_t, ++ pub shm_atime: crate::time_t, ++ pub shm_dtime: crate::time_t, ++ pub shm_ctime: crate::time_t, ++ pub shm_cpid: crate::pid_t, ++ pub shm_lpid: crate::pid_t, ++ pub shm_nattch: c_ulong, ++ __pad1: c_ulong, ++ __pad2: c_ulong, ++ } ++ ++ pub struct msqid_ds { ++ pub msg_perm: crate::ipc_perm, ++ pub msg_stime: crate::time_t, ++ pub msg_rtime: crate::time_t, ++ pub msg_ctime: crate::time_t, ++ __msg_cbytes: c_ulong, ++ pub msg_qnum: crate::msgqnum_t, ++ pub msg_qbytes: crate::msglen_t, ++ pub msg_lspid: crate::pid_t, ++ pub msg_lrpid: crate::pid_t, ++ __pad1: c_ulong, ++ __pad2: c_ulong, ++ } ++ ++ pub struct statfs { ++ pub f_type: c_ulong, ++ pub f_bsize: c_ulong, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_fsid: crate::fsid_t, ++ pub f_namelen: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_flags: c_ulong, ++ pub f_spare: [c_ulong; 4], ++ } ++ ++ pub struct msghdr { ++ pub msg_name: *mut c_void, ++ pub msg_namelen: crate::socklen_t, ++ pub msg_iov: *mut crate::iovec, ++ pub msg_iovlen: c_int, ++ __pad1: c_int, ++ pub msg_control: *mut c_void, ++ pub msg_controllen: crate::socklen_t, ++ __pad2: crate::socklen_t, ++ pub msg_flags: c_int, ++ } ++ ++ pub struct cmsghdr { ++ pub cmsg_len: crate::socklen_t, ++ pub __pad1: c_int, ++ pub cmsg_level: c_int, ++ pub cmsg_type: c_int, ++ } ++ ++ pub struct sem_t { ++ __val: [c_int; 8], ++ } ++ ++ pub struct siginfo_t { ++ pub si_signo: c_int, ++ pub si_errno: c_int, ++ pub si_code: c_int, ++ pub _pad: [c_int; 29], ++ _align: [usize; 0], ++ } ++ ++ pub struct termios2 { ++ pub c_iflag: crate::tcflag_t, ++ pub c_oflag: crate::tcflag_t, ++ pub c_cflag: crate::tcflag_t, ++ pub c_lflag: crate::tcflag_t, ++ pub c_line: crate::cc_t, ++ pub c_cc: [crate::cc_t; 19], ++ pub c_ispeed: crate::speed_t, ++ pub c_ospeed: crate::speed_t, ++ } ++ ++ pub struct in6_pktinfo { ++ pub ipi6_addr: crate::in6_addr, ++ pub ipi6_ifindex: c_uint, ++ } ++ ++ #[cfg_attr( ++ any(target_pointer_width = "32", target_arch = "x86_64"), ++ repr(align(4)) ++ )] ++ #[cfg_attr( ++ not(any(target_pointer_width = "32", target_arch = "x86_64")), ++ repr(align(8)) ++ )] ++ pub struct pthread_mutexattr_t { ++ size: [u8; crate::__SIZEOF_PTHREAD_MUTEXATTR_T], ++ } ++ ++ #[cfg_attr(target_pointer_width = "32", repr(align(4)))] ++ #[cfg_attr(target_pointer_width = "64", repr(align(8)))] ++ pub struct pthread_rwlockattr_t { ++ size: [u8; crate::__SIZEOF_PTHREAD_RWLOCKATTR_T], ++ } ++ ++ #[repr(align(4))] ++ pub struct pthread_condattr_t { ++ size: [u8; crate::__SIZEOF_PTHREAD_CONDATTR_T], ++ } ++} ++ ++s_no_extra_traits! { ++ pub struct sysinfo { ++ pub uptime: c_ulong, ++ pub loads: [c_ulong; 3], ++ pub totalram: c_ulong, ++ pub freeram: c_ulong, ++ pub sharedram: c_ulong, ++ pub bufferram: c_ulong, ++ pub totalswap: c_ulong, ++ pub freeswap: c_ulong, ++ pub procs: c_ushort, ++ pub pad: c_ushort, ++ pub totalhigh: c_ulong, ++ pub freehigh: c_ulong, ++ pub mem_unit: c_uint, ++ pub __reserved: [c_char; 256], ++ } ++ ++ pub struct sockaddr_un { ++ pub sun_family: sa_family_t, ++ pub sun_path: [c_char; 108], ++ } ++ ++ pub struct sockaddr_storage { ++ pub ss_family: sa_family_t, ++ __ss_pad2: [u8; 128 - 2 - 8], ++ __ss_align: size_t, ++ } ++ ++ pub struct utsname { ++ pub sysname: [c_char; 65], ++ pub nodename: [c_char; 65], ++ pub release: [c_char; 65], ++ pub version: [c_char; 65], ++ pub machine: [c_char; 65], ++ pub domainname: [c_char; 65], ++ } ++ ++ pub struct dirent { ++ pub d_ino: crate::ino_t, ++ pub d_off: off_t, ++ pub d_reclen: c_ushort, ++ pub d_type: c_uchar, ++ pub d_name: [c_char; 256], ++ } ++ ++ pub struct dirent64 { ++ pub d_ino: crate::ino64_t, ++ pub d_off: off64_t, ++ pub d_reclen: c_ushort, ++ pub d_type: c_uchar, ++ pub d_name: [c_char; 256], ++ } ++ ++ // x32 compatibility ++ // See https://sourceware.org/bugzilla/show_bug.cgi?id=21279 ++ pub struct mq_attr { ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ pub mq_flags: i64, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ pub mq_maxmsg: i64, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ pub mq_msgsize: i64, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ pub mq_curmsgs: i64, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ pad: [i64; 4], ++ ++ #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] ++ pub mq_flags: c_long, ++ #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] ++ pub mq_maxmsg: c_long, ++ #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] ++ pub mq_msgsize: c_long, ++ #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] ++ pub mq_curmsgs: c_long, ++ #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] ++ pad: [c_long; 4], ++ } ++ ++ pub struct sockaddr_nl { ++ pub nl_family: crate::sa_family_t, ++ nl_pad: c_ushort, ++ pub nl_pid: u32, ++ pub nl_groups: u32, ++ } ++ ++ pub struct sigevent { ++ pub sigev_value: crate::sigval, ++ pub sigev_signo: c_int, ++ pub sigev_notify: c_int, ++ pub sigev_notify_function: fn(crate::sigval), ++ pub sigev_notify_attributes: *mut pthread_attr_t, ++ pub __pad: [c_char; 56 - 3 * 8], ++ } ++ ++ #[cfg_attr( ++ all( ++ target_pointer_width = "32", ++ any(target_arch = "arm", target_arch = "x86_64") ++ ), ++ repr(align(4)) ++ )] ++ #[cfg_attr( ++ any( ++ target_pointer_width = "64", ++ not(any(target_arch = "arm", target_arch = "x86_64")) ++ ), ++ repr(align(8)) ++ )] ++ pub struct pthread_mutex_t { ++ size: [u8; crate::__SIZEOF_PTHREAD_MUTEX_T], ++ } ++ ++ #[cfg_attr( ++ all( ++ target_pointer_width = "32", ++ any(target_arch = "arm", target_arch = "x86_64") ++ ), ++ repr(align(4)) ++ )] ++ #[cfg_attr( ++ any( ++ target_pointer_width = "64", ++ not(any(target_arch = "arm", target_arch = "x86_64")) ++ ), ++ repr(align(8)) ++ )] ++ pub struct pthread_rwlock_t { ++ size: [u8; crate::__SIZEOF_PTHREAD_RWLOCK_T], ++ } ++ ++ #[cfg_attr(target_pointer_width = "32", repr(align(4)))] ++ #[cfg_attr(target_pointer_width = "64", repr(align(8)))] ++ #[cfg_attr(target_arch = "x86", repr(align(4)))] ++ #[cfg_attr(not(target_arch = "x86"), repr(align(8)))] ++ pub struct pthread_cond_t { ++ size: [u8; crate::__SIZEOF_PTHREAD_COND_T], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for sysinfo { ++ fn eq(&self, other: &sysinfo) -> bool { ++ self.uptime == other.uptime ++ && self.loads == other.loads ++ && self.totalram == other.totalram ++ && self.freeram == other.freeram ++ && self.sharedram == other.sharedram ++ && self.bufferram == other.bufferram ++ && self.totalswap == other.totalswap ++ && self.freeswap == other.freeswap ++ && self.procs == other.procs ++ && self.pad == other.pad ++ && self.totalhigh == other.totalhigh ++ && self.freehigh == other.freehigh ++ && self.mem_unit == other.mem_unit ++ && self ++ .__reserved ++ .iter() ++ .zip(other.__reserved.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for sysinfo {} ++ impl fmt::Debug for sysinfo { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sysinfo") ++ .field("uptime", &self.uptime) ++ .field("loads", &self.loads) ++ .field("totalram", &self.totalram) ++ .field("freeram", &self.freeram) ++ .field("sharedram", &self.sharedram) ++ .field("bufferram", &self.bufferram) ++ .field("totalswap", &self.totalswap) ++ .field("freeswap", &self.freeswap) ++ .field("procs", &self.procs) ++ .field("pad", &self.pad) ++ .field("totalhigh", &self.totalhigh) ++ .field("freehigh", &self.freehigh) ++ .field("mem_unit", &self.mem_unit) ++ // FIXME: .field("__reserved", &self.__reserved) ++ .finish() ++ } ++ } ++ impl hash::Hash for sysinfo { ++ fn hash(&self, state: &mut H) { ++ self.uptime.hash(state); ++ self.loads.hash(state); ++ self.totalram.hash(state); ++ self.freeram.hash(state); ++ self.sharedram.hash(state); ++ self.bufferram.hash(state); ++ self.totalswap.hash(state); ++ self.freeswap.hash(state); ++ self.procs.hash(state); ++ self.pad.hash(state); ++ self.totalhigh.hash(state); ++ self.freehigh.hash(state); ++ self.mem_unit.hash(state); ++ self.__reserved.hash(state); ++ } ++ } ++ ++ impl PartialEq for sockaddr_un { ++ fn eq(&self, other: &sockaddr_un) -> bool { ++ self.sun_family == other.sun_family ++ && self ++ .sun_path ++ .iter() ++ .zip(other.sun_path.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for sockaddr_un {} ++ impl fmt::Debug for sockaddr_un { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sockaddr_un") ++ .field("sun_family", &self.sun_family) ++ // FIXME: .field("sun_path", &self.sun_path) ++ .finish() ++ } ++ } ++ impl hash::Hash for sockaddr_un { ++ fn hash(&self, state: &mut H) { ++ self.sun_family.hash(state); ++ self.sun_path.hash(state); ++ } ++ } ++ ++ impl PartialEq for sockaddr_storage { ++ fn eq(&self, other: &sockaddr_storage) -> bool { ++ self.ss_family == other.ss_family ++ && self.__ss_align == other.__ss_align ++ && self ++ .__ss_pad2 ++ .iter() ++ .zip(other.__ss_pad2.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for sockaddr_storage {} ++ impl fmt::Debug for sockaddr_storage { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sockaddr_storage") ++ .field("ss_family", &self.ss_family) ++ .field("__ss_align", &self.__ss_align) ++ // FIXME: .field("__ss_pad2", &self.__ss_pad2) ++ .finish() ++ } ++ } ++ impl hash::Hash for sockaddr_storage { ++ fn hash(&self, state: &mut H) { ++ self.ss_family.hash(state); ++ self.__ss_align.hash(state); ++ self.__ss_pad2.hash(state); ++ } ++ } ++ ++ impl PartialEq for utsname { ++ fn eq(&self, other: &utsname) -> bool { ++ self.sysname ++ .iter() ++ .zip(other.sysname.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .nodename ++ .iter() ++ .zip(other.nodename.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .release ++ .iter() ++ .zip(other.release.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .version ++ .iter() ++ .zip(other.version.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .machine ++ .iter() ++ .zip(other.machine.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for utsname {} ++ impl fmt::Debug for utsname { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("utsname") ++ // FIXME: .field("sysname", &self.sysname) ++ // FIXME: .field("nodename", &self.nodename) ++ // FIXME: .field("release", &self.release) ++ // FIXME: .field("version", &self.version) ++ // FIXME: .field("machine", &self.machine) ++ .finish() ++ } ++ } ++ impl hash::Hash for utsname { ++ fn hash(&self, state: &mut H) { ++ self.sysname.hash(state); ++ self.nodename.hash(state); ++ self.release.hash(state); ++ self.version.hash(state); ++ self.machine.hash(state); ++ } ++ } ++ ++ impl PartialEq for dirent { ++ fn eq(&self, other: &dirent) -> bool { ++ self.d_ino == other.d_ino ++ && self.d_off == other.d_off ++ && self.d_reclen == other.d_reclen ++ && self.d_type == other.d_type ++ && self ++ .d_name ++ .iter() ++ .zip(other.d_name.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for dirent {} ++ impl fmt::Debug for dirent { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("dirent") ++ .field("d_ino", &self.d_ino) ++ .field("d_off", &self.d_off) ++ .field("d_reclen", &self.d_reclen) ++ .field("d_type", &self.d_type) ++ // FIXME: .field("d_name", &self.d_name) ++ .finish() ++ } ++ } ++ impl hash::Hash for dirent { ++ fn hash(&self, state: &mut H) { ++ self.d_ino.hash(state); ++ self.d_off.hash(state); ++ self.d_reclen.hash(state); ++ self.d_type.hash(state); ++ self.d_name.hash(state); ++ } ++ } ++ ++ impl PartialEq for dirent64 { ++ fn eq(&self, other: &dirent64) -> bool { ++ self.d_ino == other.d_ino ++ && self.d_off == other.d_off ++ && self.d_reclen == other.d_reclen ++ && self.d_type == other.d_type ++ && self ++ .d_name ++ .iter() ++ .zip(other.d_name.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for dirent64 {} ++ impl fmt::Debug for dirent64 { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("dirent64") ++ .field("d_ino", &self.d_ino) ++ .field("d_off", &self.d_off) ++ .field("d_reclen", &self.d_reclen) ++ .field("d_type", &self.d_type) ++ // FIXME: .field("d_name", &self.d_name) ++ .finish() ++ } ++ } ++ impl hash::Hash for dirent64 { ++ fn hash(&self, state: &mut H) { ++ self.d_ino.hash(state); ++ self.d_off.hash(state); ++ self.d_reclen.hash(state); ++ self.d_type.hash(state); ++ self.d_name.hash(state); ++ } ++ } ++ ++ impl PartialEq for mq_attr { ++ fn eq(&self, other: &mq_attr) -> bool { ++ self.mq_flags == other.mq_flags ++ && self.mq_maxmsg == other.mq_maxmsg ++ && self.mq_msgsize == other.mq_msgsize ++ && self.mq_curmsgs == other.mq_curmsgs ++ } ++ } ++ impl Eq for mq_attr {} ++ impl fmt::Debug for mq_attr { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("mq_attr") ++ .field("mq_flags", &self.mq_flags) ++ .field("mq_maxmsg", &self.mq_maxmsg) ++ .field("mq_msgsize", &self.mq_msgsize) ++ .field("mq_curmsgs", &self.mq_curmsgs) ++ .finish() ++ } ++ } ++ impl hash::Hash for mq_attr { ++ fn hash(&self, state: &mut H) { ++ self.mq_flags.hash(state); ++ self.mq_maxmsg.hash(state); ++ self.mq_msgsize.hash(state); ++ self.mq_curmsgs.hash(state); ++ } ++ } ++ ++ impl PartialEq for sockaddr_nl { ++ fn eq(&self, other: &sockaddr_nl) -> bool { ++ self.nl_family == other.nl_family ++ && self.nl_pid == other.nl_pid ++ && self.nl_groups == other.nl_groups ++ } ++ } ++ impl Eq for sockaddr_nl {} ++ impl fmt::Debug for sockaddr_nl { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sockaddr_nl") ++ .field("nl_family", &self.nl_family) ++ .field("nl_pid", &self.nl_pid) ++ .field("nl_groups", &self.nl_groups) ++ .finish() ++ } ++ } ++ impl hash::Hash for sockaddr_nl { ++ fn hash(&self, state: &mut H) { ++ self.nl_family.hash(state); ++ self.nl_pid.hash(state); ++ self.nl_groups.hash(state); ++ } ++ } ++ ++ // FIXME(msrv): suggested method was added in 1.85 ++ #[allow(unpredictable_function_pointer_comparisons)] ++ impl PartialEq for sigevent { ++ fn eq(&self, other: &sigevent) -> bool { ++ self.sigev_value == other.sigev_value ++ && self.sigev_signo == other.sigev_signo ++ && self.sigev_notify == other.sigev_notify ++ && self.sigev_notify_function == other.sigev_notify_function ++ && self.sigev_notify_attributes == other.sigev_notify_attributes ++ } ++ } ++ impl Eq for sigevent {} ++ impl fmt::Debug for sigevent { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sigevent") ++ .field("sigev_value", &self.sigev_value) ++ .field("sigev_signo", &self.sigev_signo) ++ .field("sigev_notify", &self.sigev_notify) ++ .field("sigev_notify_function", &self.sigev_notify_function) ++ .field("sigev_notify_attributes", &self.sigev_notify_attributes) ++ .finish() ++ } ++ } ++ impl hash::Hash for sigevent { ++ fn hash(&self, state: &mut H) { ++ self.sigev_value.hash(state); ++ self.sigev_signo.hash(state); ++ self.sigev_notify.hash(state); ++ self.sigev_notify_function.hash(state); ++ self.sigev_notify_attributes.hash(state); ++ } ++ } ++ ++ impl PartialEq for pthread_cond_t { ++ fn eq(&self, other: &pthread_cond_t) -> bool { ++ self.size.iter().zip(other.size.iter()).all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for pthread_cond_t {} ++ impl fmt::Debug for pthread_cond_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("pthread_cond_t") ++ // FIXME: .field("size", &self.size) ++ .finish() ++ } ++ } ++ impl hash::Hash for pthread_cond_t { ++ fn hash(&self, state: &mut H) { ++ self.size.hash(state); ++ } ++ } ++ ++ impl PartialEq for pthread_mutex_t { ++ fn eq(&self, other: &pthread_mutex_t) -> bool { ++ self.size.iter().zip(other.size.iter()).all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for pthread_mutex_t {} ++ impl fmt::Debug for pthread_mutex_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("pthread_mutex_t") ++ // FIXME: .field("size", &self.size) ++ .finish() ++ } ++ } ++ impl hash::Hash for pthread_mutex_t { ++ fn hash(&self, state: &mut H) { ++ self.size.hash(state); ++ } ++ } ++ ++ impl PartialEq for pthread_rwlock_t { ++ fn eq(&self, other: &pthread_rwlock_t) -> bool { ++ self.size.iter().zip(other.size.iter()).all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for pthread_rwlock_t {} ++ impl fmt::Debug for pthread_rwlock_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("pthread_rwlock_t") ++ // FIXME: .field("size", &self.size) ++ .finish() ++ } ++ } ++ impl hash::Hash for pthread_rwlock_t { ++ fn hash(&self, state: &mut H) { ++ self.size.hash(state); ++ } ++ } ++ } ++} ++ ++// PUB_CONST ++ ++pub const INT_MIN: c_int = -2147483648; ++pub const INT_MAX: c_int = 2147483647; ++ ++pub const SIG_DFL: sighandler_t = 0 as sighandler_t; ++pub const SIG_IGN: sighandler_t = 1 as sighandler_t; ++pub const SIG_ERR: sighandler_t = !0 as sighandler_t; ++ ++pub const DT_UNKNOWN: u8 = 0; ++pub const DT_FIFO: u8 = 1; ++pub const DT_CHR: u8 = 2; ++pub const DT_DIR: u8 = 4; ++pub const DT_BLK: u8 = 6; ++pub const DT_REG: u8 = 8; ++pub const DT_LNK: u8 = 10; ++pub const DT_SOCK: u8 = 12; ++ ++pub const FD_CLOEXEC: c_int = 0x1; ++ ++pub const USRQUOTA: c_int = 0; ++pub const GRPQUOTA: c_int = 1; ++ ++pub const SIGIOT: c_int = 6; ++ ++pub const S_ISUID: crate::mode_t = 0o4000; ++pub const S_ISGID: crate::mode_t = 0o2000; ++pub const S_ISVTX: crate::mode_t = 0o1000; ++ ++pub const IF_NAMESIZE: size_t = 16; ++pub const IFNAMSIZ: size_t = IF_NAMESIZE; ++ ++pub const LOG_EMERG: c_int = 0; ++pub const LOG_ALERT: c_int = 1; ++pub const LOG_CRIT: c_int = 2; ++pub const LOG_ERR: c_int = 3; ++pub const LOG_WARNING: c_int = 4; ++pub const LOG_NOTICE: c_int = 5; ++pub const LOG_INFO: c_int = 6; ++pub const LOG_DEBUG: c_int = 7; ++ ++pub const LOG_KERN: c_int = 0; ++pub const LOG_USER: c_int = 1 << 3; ++pub const LOG_MAIL: c_int = 2 << 3; ++pub const LOG_DAEMON: c_int = 3 << 3; ++pub const LOG_AUTH: c_int = 4 << 3; ++pub const LOG_SYSLOG: c_int = 5 << 3; ++pub const LOG_LPR: c_int = 6 << 3; ++pub const LOG_NEWS: c_int = 7 << 3; ++pub const LOG_UUCP: c_int = 8 << 3; ++pub const LOG_LOCAL0: c_int = 16 << 3; ++pub const LOG_LOCAL1: c_int = 17 << 3; ++pub const LOG_LOCAL2: c_int = 18 << 3; ++pub const LOG_LOCAL3: c_int = 19 << 3; ++pub const LOG_LOCAL4: c_int = 20 << 3; ++pub const LOG_LOCAL5: c_int = 21 << 3; ++pub const LOG_LOCAL6: c_int = 22 << 3; ++pub const LOG_LOCAL7: c_int = 23 << 3; ++ ++pub const LOG_PID: c_int = 0x01; ++pub const LOG_CONS: c_int = 0x02; ++pub const LOG_ODELAY: c_int = 0x04; ++pub const LOG_NDELAY: c_int = 0x08; ++pub const LOG_NOWAIT: c_int = 0x10; ++ ++pub const LOG_PRIMASK: c_int = 7; ++pub const LOG_FACMASK: c_int = 0x3f8; ++ ++pub const PRIO_PROCESS: c_int = 0; ++pub const PRIO_PGRP: c_int = 1; ++pub const PRIO_USER: c_int = 2; ++ ++pub const PRIO_MIN: c_int = -20; ++pub const PRIO_MAX: c_int = 20; ++ ++pub const IPPROTO_ICMP: c_int = 1; ++pub const IPPROTO_ICMPV6: c_int = 58; ++pub const IPPROTO_TCP: c_int = 6; ++pub const IPPROTO_UDP: c_int = 17; ++pub const IPPROTO_IP: c_int = 0; ++pub const IPPROTO_IPV6: c_int = 41; ++ ++pub const INADDR_LOOPBACK: in_addr_t = 2130706433; ++pub const INADDR_ANY: in_addr_t = 0; ++pub const INADDR_BROADCAST: in_addr_t = 4294967295; ++pub const INADDR_NONE: in_addr_t = 4294967295; ++ ++pub const EXIT_FAILURE: c_int = 1; ++pub const EXIT_SUCCESS: c_int = 0; ++pub const RAND_MAX: c_int = 2147483647; ++pub const EOF: c_int = -1; ++pub const SEEK_SET: c_int = 0; ++pub const SEEK_CUR: c_int = 1; ++pub const SEEK_END: c_int = 2; ++pub const _IOFBF: c_int = 0; ++pub const _IONBF: c_int = 2; ++pub const _IOLBF: c_int = 1; ++ ++pub const F_DUPFD: c_int = 0; ++pub const F_GETFD: c_int = 1; ++pub const F_SETFD: c_int = 2; ++pub const F_GETFL: c_int = 3; ++pub const F_SETFL: c_int = 4; ++ ++// Linux-specific fcntls ++pub const F_SETLEASE: c_int = 1024; ++pub const F_GETLEASE: c_int = 1025; ++pub const F_NOTIFY: c_int = 1026; ++pub const F_CANCELLK: c_int = 1029; ++pub const F_DUPFD_CLOEXEC: c_int = 1030; ++pub const F_SETPIPE_SZ: c_int = 1031; ++pub const F_GETPIPE_SZ: c_int = 1032; ++pub const F_ADD_SEALS: c_int = 1033; ++pub const F_GET_SEALS: c_int = 1034; ++ ++pub const F_SEAL_SEAL: c_int = 0x0001; ++pub const F_SEAL_SHRINK: c_int = 0x0002; ++pub const F_SEAL_GROW: c_int = 0x0004; ++pub const F_SEAL_WRITE: c_int = 0x0008; ++ ++// FIXME(#235): Include file sealing fcntls once we have a way to verify them. ++ ++pub const SIGTRAP: c_int = 5; ++ ++pub const PTHREAD_CREATE_JOINABLE: c_int = 0; ++pub const PTHREAD_CREATE_DETACHED: c_int = 1; ++ ++pub const CLOCK_REALTIME: crate::clockid_t = 0; ++pub const CLOCK_MONOTONIC: crate::clockid_t = 1; ++pub const CLOCK_PROCESS_CPUTIME_ID: crate::clockid_t = 2; ++pub const CLOCK_THREAD_CPUTIME_ID: crate::clockid_t = 3; ++pub const CLOCK_MONOTONIC_RAW: crate::clockid_t = 4; ++pub const CLOCK_REALTIME_COARSE: crate::clockid_t = 5; ++pub const CLOCK_MONOTONIC_COARSE: crate::clockid_t = 6; ++pub const CLOCK_BOOTTIME: crate::clockid_t = 7; ++pub const CLOCK_REALTIME_ALARM: crate::clockid_t = 8; ++pub const CLOCK_BOOTTIME_ALARM: crate::clockid_t = 9; ++pub const CLOCK_SGI_CYCLE: crate::clockid_t = 10; ++pub const CLOCK_TAI: crate::clockid_t = 11; ++pub const TIMER_ABSTIME: c_int = 1; ++ ++pub const RLIMIT_CPU: c_int = 0; ++pub const RLIMIT_FSIZE: c_int = 1; ++pub const RLIMIT_DATA: c_int = 2; ++pub const RLIMIT_STACK: c_int = 3; ++pub const RLIMIT_CORE: c_int = 4; ++pub const RLIMIT_LOCKS: c_int = 10; ++pub const RLIMIT_SIGPENDING: c_int = 11; ++pub const RLIMIT_MSGQUEUE: c_int = 12; ++pub const RLIMIT_NICE: c_int = 13; ++pub const RLIMIT_RTPRIO: c_int = 14; ++ ++pub const RUSAGE_SELF: c_int = 0; ++ ++pub const O_RDONLY: c_int = 0; ++pub const O_WRONLY: c_int = 1; ++pub const O_RDWR: c_int = 2; ++ ++pub const S_IFIFO: crate::mode_t = 0o1_0000; ++pub const S_IFCHR: crate::mode_t = 0o2_0000; ++pub const S_IFBLK: crate::mode_t = 0o6_0000; ++pub const S_IFDIR: crate::mode_t = 0o4_0000; ++pub const S_IFREG: crate::mode_t = 0o10_0000; ++pub const S_IFLNK: crate::mode_t = 0o12_0000; ++pub const S_IFSOCK: crate::mode_t = 0o14_0000; ++pub const S_IFMT: crate::mode_t = 0o17_0000; ++pub const S_IRWXU: crate::mode_t = 0o0700; ++pub const S_IXUSR: crate::mode_t = 0o0100; ++pub const S_IWUSR: crate::mode_t = 0o0200; ++pub const S_IRUSR: crate::mode_t = 0o0400; ++pub const S_IRWXG: crate::mode_t = 0o0070; ++pub const S_IXGRP: crate::mode_t = 0o0010; ++pub const S_IWGRP: crate::mode_t = 0o0020; ++pub const S_IRGRP: crate::mode_t = 0o0040; ++pub const S_IRWXO: crate::mode_t = 0o0007; ++pub const S_IXOTH: crate::mode_t = 0o0001; ++pub const S_IWOTH: crate::mode_t = 0o0002; ++pub const S_IROTH: crate::mode_t = 0o0004; ++pub const F_OK: c_int = 0; ++pub const R_OK: c_int = 4; ++pub const W_OK: c_int = 2; ++pub const X_OK: c_int = 1; ++pub const STDIN_FILENO: c_int = 0; ++pub const STDOUT_FILENO: c_int = 1; ++pub const STDERR_FILENO: c_int = 2; ++pub const SIGHUP: c_int = 1; ++pub const SIGINT: c_int = 2; ++pub const SIGQUIT: c_int = 3; ++pub const SIGILL: c_int = 4; ++pub const SIGABRT: c_int = 6; ++pub const SIGFPE: c_int = 8; ++pub const SIGKILL: c_int = 9; ++pub const SIGSEGV: c_int = 11; ++pub const SIGPIPE: c_int = 13; ++pub const SIGALRM: c_int = 14; ++pub const SIGTERM: c_int = 15; ++ ++pub const PROT_NONE: c_int = 0; ++pub const PROT_READ: c_int = 1; ++pub const PROT_WRITE: c_int = 2; ++pub const PROT_EXEC: c_int = 4; ++ ++pub const LC_CTYPE: c_int = 0; ++pub const LC_NUMERIC: c_int = 1; ++pub const LC_TIME: c_int = 2; ++pub const LC_COLLATE: c_int = 3; ++pub const LC_MONETARY: c_int = 4; ++pub const LC_MESSAGES: c_int = 5; ++pub const LC_ALL: c_int = 6; ++pub const LC_CTYPE_MASK: c_int = 1 << LC_CTYPE; ++pub const LC_NUMERIC_MASK: c_int = 1 << LC_NUMERIC; ++pub const LC_TIME_MASK: c_int = 1 << LC_TIME; ++pub const LC_COLLATE_MASK: c_int = 1 << LC_COLLATE; ++pub const LC_MONETARY_MASK: c_int = 1 << LC_MONETARY; ++pub const LC_MESSAGES_MASK: c_int = 1 << LC_MESSAGES; ++// LC_ALL_MASK defined per platform ++ ++pub const MAP_FILE: c_int = 0x0000; ++pub const MAP_SHARED: c_int = 0x0001; ++pub const MAP_PRIVATE: c_int = 0x0002; ++pub const MAP_FIXED: c_int = 0x0010; ++ ++pub const MAP_FAILED: *mut c_void = !0 as *mut c_void; ++ ++// MS_ flags for msync(2) ++pub const MS_ASYNC: c_int = 0x0001; ++pub const MS_INVALIDATE: c_int = 0x0002; ++pub const MS_SYNC: c_int = 0x0004; ++ ++// MS_ flags for mount(2) ++pub const MS_RDONLY: c_ulong = 0x01; ++pub const MS_NOSUID: c_ulong = 0x02; ++pub const MS_NODEV: c_ulong = 0x04; ++pub const MS_NOEXEC: c_ulong = 0x08; ++pub const MS_SYNCHRONOUS: c_ulong = 0x10; ++pub const MS_REMOUNT: c_ulong = 0x20; ++pub const MS_MANDLOCK: c_ulong = 0x40; ++pub const MS_DIRSYNC: c_ulong = 0x80; ++pub const MS_NOATIME: c_ulong = 0x0400; ++pub const MS_NODIRATIME: c_ulong = 0x0800; ++pub const MS_BIND: c_ulong = 0x1000; ++pub const MS_MOVE: c_ulong = 0x2000; ++pub const MS_REC: c_ulong = 0x4000; ++pub const MS_SILENT: c_ulong = 0x8000; ++pub const MS_POSIXACL: c_ulong = 0x010000; ++pub const MS_UNBINDABLE: c_ulong = 0x020000; ++pub const MS_PRIVATE: c_ulong = 0x040000; ++pub const MS_SLAVE: c_ulong = 0x080000; ++pub const MS_SHARED: c_ulong = 0x100000; ++pub const MS_RELATIME: c_ulong = 0x200000; ++pub const MS_KERNMOUNT: c_ulong = 0x400000; ++pub const MS_I_VERSION: c_ulong = 0x800000; ++pub const MS_STRICTATIME: c_ulong = 0x1000000; ++pub const MS_ACTIVE: c_ulong = 0x40000000; ++pub const MS_NOUSER: c_ulong = 0x80000000; ++pub const MS_MGC_VAL: c_ulong = 0xc0ed0000; ++pub const MS_MGC_MSK: c_ulong = 0xffff0000; ++pub const MS_RMT_MASK: c_ulong = 0x800051; ++ ++pub const EPERM: c_int = 1; ++pub const ENOENT: c_int = 2; ++pub const ESRCH: c_int = 3; ++pub const EINTR: c_int = 4; ++pub const EIO: c_int = 5; ++pub const ENXIO: c_int = 6; ++pub const E2BIG: c_int = 7; ++pub const ENOEXEC: c_int = 8; ++pub const EBADF: c_int = 9; ++pub const ECHILD: c_int = 10; ++pub const EAGAIN: c_int = 11; ++pub const ENOMEM: c_int = 12; ++pub const EACCES: c_int = 13; ++pub const EFAULT: c_int = 14; ++pub const ENOTBLK: c_int = 15; ++pub const EBUSY: c_int = 16; ++pub const EEXIST: c_int = 17; ++pub const EXDEV: c_int = 18; ++pub const ENODEV: c_int = 19; ++pub const ENOTDIR: c_int = 20; ++pub const EISDIR: c_int = 21; ++pub const EINVAL: c_int = 22; ++pub const ENFILE: c_int = 23; ++pub const EMFILE: c_int = 24; ++pub const ENOTTY: c_int = 25; ++pub const ETXTBSY: c_int = 26; ++pub const EFBIG: c_int = 27; ++pub const ENOSPC: c_int = 28; ++pub const ESPIPE: c_int = 29; ++pub const EROFS: c_int = 30; ++pub const EMLINK: c_int = 31; ++pub const EPIPE: c_int = 32; ++pub const EDOM: c_int = 33; ++pub const ERANGE: c_int = 34; ++pub const EWOULDBLOCK: c_int = EAGAIN; ++ ++pub const SCM_RIGHTS: c_int = 0x01; ++pub const SCM_CREDENTIALS: c_int = 0x02; ++ ++pub const PROT_GROWSDOWN: c_int = 0x1000000; ++pub const PROT_GROWSUP: c_int = 0x2000000; ++ ++pub const MAP_TYPE: c_int = 0x000f; ++ ++pub const MADV_NORMAL: c_int = 0; ++pub const MADV_RANDOM: c_int = 1; ++pub const MADV_SEQUENTIAL: c_int = 2; ++pub const MADV_WILLNEED: c_int = 3; ++pub const MADV_DONTNEED: c_int = 4; ++pub const MADV_FREE: c_int = 8; ++pub const MADV_REMOVE: c_int = 9; ++pub const MADV_DONTFORK: c_int = 10; ++pub const MADV_DOFORK: c_int = 11; ++pub const MADV_MERGEABLE: c_int = 12; ++pub const MADV_UNMERGEABLE: c_int = 13; ++pub const MADV_HUGEPAGE: c_int = 14; ++pub const MADV_NOHUGEPAGE: c_int = 15; ++pub const MADV_DONTDUMP: c_int = 16; ++pub const MADV_DODUMP: c_int = 17; ++pub const MADV_HWPOISON: c_int = 100; ++pub const MADV_SOFT_OFFLINE: c_int = 101; ++ ++pub const IFF_UP: c_int = 0x1; ++pub const IFF_BROADCAST: c_int = 0x2; ++pub const IFF_DEBUG: c_int = 0x4; ++pub const IFF_LOOPBACK: c_int = 0x8; ++pub const IFF_POINTOPOINT: c_int = 0x10; ++pub const IFF_NOTRAILERS: c_int = 0x20; ++pub const IFF_RUNNING: c_int = 0x40; ++pub const IFF_NOARP: c_int = 0x80; ++pub const IFF_PROMISC: c_int = 0x100; ++pub const IFF_ALLMULTI: c_int = 0x200; ++pub const IFF_MASTER: c_int = 0x400; ++pub const IFF_SLAVE: c_int = 0x800; ++pub const IFF_MULTICAST: c_int = 0x1000; ++pub const IFF_PORTSEL: c_int = 0x2000; ++pub const IFF_AUTOMEDIA: c_int = 0x4000; ++pub const IFF_DYNAMIC: c_int = 0x8000; ++pub const IFF_TUN: c_int = 0x0001; ++pub const IFF_TAP: c_int = 0x0002; ++pub const IFF_NO_PI: c_int = 0x1000; ++ ++pub const SOL_IP: c_int = 0; ++pub const SOL_TCP: c_int = 6; ++pub const SOL_UDP: c_int = 17; ++pub const SOL_IPV6: c_int = 41; ++pub const SOL_ICMPV6: c_int = 58; ++pub const SOL_RAW: c_int = 255; ++pub const SOL_DECNET: c_int = 261; ++pub const SOL_X25: c_int = 262; ++pub const SOL_PACKET: c_int = 263; ++pub const SOL_ATM: c_int = 264; ++pub const SOL_AAL: c_int = 265; ++pub const SOL_IRDA: c_int = 266; ++pub const SOL_NETBEUI: c_int = 267; ++pub const SOL_LLC: c_int = 268; ++pub const SOL_DCCP: c_int = 269; ++pub const SOL_NETLINK: c_int = 270; ++pub const SOL_TIPC: c_int = 271; ++ ++pub const AF_UNSPEC: c_int = 0; ++pub const AF_UNIX: c_int = 1; ++pub const AF_LOCAL: c_int = 1; ++pub const AF_INET: c_int = 2; ++pub const AF_AX25: c_int = 3; ++pub const AF_IPX: c_int = 4; ++pub const AF_APPLETALK: c_int = 5; ++pub const AF_NETROM: c_int = 6; ++pub const AF_BRIDGE: c_int = 7; ++pub const AF_ATMPVC: c_int = 8; ++pub const AF_X25: c_int = 9; ++pub const AF_INET6: c_int = 10; ++pub const AF_ROSE: c_int = 11; ++pub const AF_DECnet: c_int = 12; ++pub const AF_NETBEUI: c_int = 13; ++pub const AF_SECURITY: c_int = 14; ++pub const AF_KEY: c_int = 15; ++pub const AF_NETLINK: c_int = 16; ++pub const AF_ROUTE: c_int = AF_NETLINK; ++pub const AF_PACKET: c_int = 17; ++pub const AF_ASH: c_int = 18; ++pub const AF_ECONET: c_int = 19; ++pub const AF_ATMSVC: c_int = 20; ++pub const AF_RDS: c_int = 21; ++pub const AF_SNA: c_int = 22; ++pub const AF_IRDA: c_int = 23; ++pub const AF_PPPOX: c_int = 24; ++pub const AF_WANPIPE: c_int = 25; ++pub const AF_LLC: c_int = 26; ++pub const AF_CAN: c_int = 29; ++pub const AF_TIPC: c_int = 30; ++pub const AF_BLUETOOTH: c_int = 31; ++pub const AF_IUCV: c_int = 32; ++pub const AF_RXRPC: c_int = 33; ++pub const AF_ISDN: c_int = 34; ++pub const AF_PHONET: c_int = 35; ++pub const AF_IEEE802154: c_int = 36; ++pub const AF_CAIF: c_int = 37; ++pub const AF_ALG: c_int = 38; ++ ++pub const PF_UNSPEC: c_int = AF_UNSPEC; ++pub const PF_UNIX: c_int = AF_UNIX; ++pub const PF_LOCAL: c_int = AF_LOCAL; ++pub const PF_INET: c_int = AF_INET; ++pub const PF_AX25: c_int = AF_AX25; ++pub const PF_IPX: c_int = AF_IPX; ++pub const PF_APPLETALK: c_int = AF_APPLETALK; ++pub const PF_NETROM: c_int = AF_NETROM; ++pub const PF_BRIDGE: c_int = AF_BRIDGE; ++pub const PF_ATMPVC: c_int = AF_ATMPVC; ++pub const PF_X25: c_int = AF_X25; ++pub const PF_INET6: c_int = AF_INET6; ++pub const PF_ROSE: c_int = AF_ROSE; ++pub const PF_DECnet: c_int = AF_DECnet; ++pub const PF_NETBEUI: c_int = AF_NETBEUI; ++pub const PF_SECURITY: c_int = AF_SECURITY; ++pub const PF_KEY: c_int = AF_KEY; ++pub const PF_NETLINK: c_int = AF_NETLINK; ++pub const PF_ROUTE: c_int = AF_ROUTE; ++pub const PF_PACKET: c_int = AF_PACKET; ++pub const PF_ASH: c_int = AF_ASH; ++pub const PF_ECONET: c_int = AF_ECONET; ++pub const PF_ATMSVC: c_int = AF_ATMSVC; ++pub const PF_RDS: c_int = AF_RDS; ++pub const PF_SNA: c_int = AF_SNA; ++pub const PF_IRDA: c_int = AF_IRDA; ++pub const PF_PPPOX: c_int = AF_PPPOX; ++pub const PF_WANPIPE: c_int = AF_WANPIPE; ++pub const PF_LLC: c_int = AF_LLC; ++pub const PF_CAN: c_int = AF_CAN; ++pub const PF_TIPC: c_int = AF_TIPC; ++pub const PF_BLUETOOTH: c_int = AF_BLUETOOTH; ++pub const PF_IUCV: c_int = AF_IUCV; ++pub const PF_RXRPC: c_int = AF_RXRPC; ++pub const PF_ISDN: c_int = AF_ISDN; ++pub const PF_PHONET: c_int = AF_PHONET; ++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; ++pub const MSG_CTRUNC: c_int = 8; ++pub const MSG_TRUNC: c_int = 0x20; ++pub const MSG_DONTWAIT: c_int = 0x40; ++pub const MSG_EOR: c_int = 0x80; ++pub const MSG_WAITALL: c_int = 0x100; ++pub const MSG_FIN: c_int = 0x200; ++pub const MSG_SYN: c_int = 0x400; ++pub const MSG_CONFIRM: c_int = 0x800; ++pub const MSG_RST: c_int = 0x1000; ++pub const MSG_ERRQUEUE: c_int = 0x2000; ++pub const MSG_NOSIGNAL: c_int = 0x4000; ++pub const MSG_MORE: c_int = 0x8000; ++pub const MSG_WAITFORONE: c_int = 0x10000; ++pub const MSG_FASTOPEN: c_int = 0x20000000; ++pub const MSG_CMSG_CLOEXEC: c_int = 0x40000000; ++ ++pub const SCM_TIMESTAMP: c_int = SO_TIMESTAMP; ++ ++pub const SOCK_RAW: c_int = 3; ++pub const SOCK_RDM: c_int = 4; ++ ++pub const IP_TOS: c_int = 1; ++pub const IP_TTL: c_int = 2; ++pub const IP_HDRINCL: c_int = 3; ++pub const IP_RECVTOS: c_int = 13; ++pub const IP_FREEBIND: c_int = 15; ++pub const IP_TRANSPARENT: c_int = 19; ++pub const IP_MULTICAST_IF: c_int = 32; ++pub const IP_MULTICAST_TTL: c_int = 33; ++pub const IP_MULTICAST_LOOP: c_int = 34; ++pub const IP_ADD_MEMBERSHIP: c_int = 35; ++pub const IP_DROP_MEMBERSHIP: c_int = 36; ++ ++pub const IPV6_UNICAST_HOPS: c_int = 16; ++pub const IPV6_MULTICAST_IF: c_int = 17; ++pub const IPV6_MULTICAST_HOPS: c_int = 18; ++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; ++pub const TCP_CORK: c_int = 3; ++pub const TCP_KEEPIDLE: c_int = 4; ++pub const TCP_KEEPINTVL: c_int = 5; ++pub const TCP_KEEPCNT: c_int = 6; ++pub const TCP_SYNCNT: c_int = 7; ++pub const TCP_LINGER2: c_int = 8; ++pub const TCP_DEFER_ACCEPT: c_int = 9; ++pub const TCP_WINDOW_CLAMP: c_int = 10; ++pub const TCP_INFO: c_int = 11; ++pub const TCP_QUICKACK: c_int = 12; ++pub const TCP_CONGESTION: c_int = 13; ++ ++pub const SO_DEBUG: c_int = 1; ++ ++pub const SHUT_RD: c_int = 0; ++pub const SHUT_WR: c_int = 1; ++pub const SHUT_RDWR: c_int = 2; ++ ++pub const LOCK_SH: c_int = 1; ++pub const LOCK_EX: c_int = 2; ++pub const LOCK_NB: c_int = 4; ++pub const LOCK_UN: c_int = 8; ++ ++pub const SS_ONSTACK: c_int = 1; ++pub const SS_DISABLE: c_int = 2; ++ ++pub const PATH_MAX: c_int = 4096; ++ ++pub const FD_SETSIZE: usize = 1024; ++ ++pub const EPOLLIN: c_int = 0x1; ++pub const EPOLLPRI: c_int = 0x2; ++pub const EPOLLOUT: c_int = 0x4; ++pub const EPOLLRDNORM: c_int = 0x40; ++pub const EPOLLRDBAND: c_int = 0x80; ++pub const EPOLLWRNORM: c_int = 0x100; ++pub const EPOLLWRBAND: c_int = 0x200; ++pub const EPOLLMSG: c_int = 0x400; ++pub const EPOLLERR: c_int = 0x8; ++pub const EPOLLHUP: c_int = 0x10; ++pub const EPOLLET: c_int = 0x80000000; ++ ++pub const EPOLL_CTL_ADD: c_int = 1; ++pub const EPOLL_CTL_MOD: c_int = 3; ++pub const EPOLL_CTL_DEL: c_int = 2; ++ ++pub const MNT_DETACH: c_int = 0x2; ++pub const MNT_EXPIRE: c_int = 0x4; ++ ++pub const Q_GETFMT: c_int = 0x800004; ++pub const Q_GETINFO: c_int = 0x800005; ++pub const Q_SETINFO: c_int = 0x800006; ++pub const QIF_BLIMITS: u32 = 1; ++pub const QIF_SPACE: u32 = 2; ++pub const QIF_ILIMITS: u32 = 4; ++pub const QIF_INODES: u32 = 8; ++pub const QIF_BTIME: u32 = 16; ++pub const QIF_ITIME: u32 = 32; ++pub const QIF_LIMITS: u32 = 5; ++pub const QIF_USAGE: u32 = 10; ++pub const QIF_TIMES: u32 = 48; ++pub const QIF_ALL: u32 = 63; ++ ++pub const MNT_FORCE: c_int = 0x1; ++ ++pub const Q_SYNC: c_int = 0x800001; ++pub const Q_QUOTAON: c_int = 0x800002; ++pub const Q_QUOTAOFF: c_int = 0x800003; ++pub const Q_GETQUOTA: c_int = 0x800007; ++pub const Q_SETQUOTA: c_int = 0x800008; ++ ++pub const TCIOFF: c_int = 2; ++pub const TCION: c_int = 3; ++pub const TCOOFF: c_int = 0; ++pub const TCOON: c_int = 1; ++pub const TCIFLUSH: c_int = 0; ++pub const TCOFLUSH: c_int = 1; ++pub const TCIOFLUSH: c_int = 2; ++pub const NL0: c_int = 0x00000000; ++pub const NL1: c_int = 0x00000100; ++pub const TAB0: c_int = 0x00000000; ++pub const CR0: c_int = 0x00000000; ++pub const FF0: c_int = 0x00000000; ++pub const BS0: c_int = 0x00000000; ++pub const VT0: c_int = 0x00000000; ++pub const VERASE: usize = 2; ++pub const VKILL: usize = 3; ++pub const VINTR: usize = 0; ++pub const VQUIT: usize = 1; ++pub const VLNEXT: usize = 15; ++pub const IGNBRK: crate::tcflag_t = 0x00000001; ++pub const BRKINT: crate::tcflag_t = 0x00000002; ++pub const IGNPAR: crate::tcflag_t = 0x00000004; ++pub const PARMRK: crate::tcflag_t = 0x00000008; ++pub const INPCK: crate::tcflag_t = 0x00000010; ++pub const ISTRIP: crate::tcflag_t = 0x00000020; ++pub const INLCR: crate::tcflag_t = 0x00000040; ++pub const IGNCR: crate::tcflag_t = 0x00000080; ++pub const ICRNL: crate::tcflag_t = 0x00000100; ++pub const IXANY: crate::tcflag_t = 0x00000800; ++pub const IMAXBEL: crate::tcflag_t = 0x00002000; ++pub const OPOST: crate::tcflag_t = 0x1; ++pub const CS5: crate::tcflag_t = 0x00000000; ++pub const CRTSCTS: crate::tcflag_t = 0x80000000; ++pub const ECHO: crate::tcflag_t = 0x00000008; ++pub const OCRNL: crate::tcflag_t = 0o000010; ++pub const ONOCR: crate::tcflag_t = 0o000020; ++pub const ONLRET: crate::tcflag_t = 0o000040; ++pub const OFILL: crate::tcflag_t = 0o000100; ++pub const OFDEL: crate::tcflag_t = 0o000200; ++ ++pub const CLONE_VM: c_int = 0x100; ++pub const CLONE_FS: c_int = 0x200; ++pub const CLONE_FILES: c_int = 0x400; ++pub const CLONE_SIGHAND: c_int = 0x800; ++pub const CLONE_PTRACE: c_int = 0x2000; ++pub const CLONE_VFORK: c_int = 0x4000; ++pub const CLONE_PARENT: c_int = 0x8000; ++pub const CLONE_THREAD: c_int = 0x10000; ++pub const CLONE_NEWNS: c_int = 0x20000; ++pub const CLONE_SYSVSEM: c_int = 0x40000; ++pub const CLONE_SETTLS: c_int = 0x80000; ++pub const CLONE_PARENT_SETTID: c_int = 0x100000; ++pub const CLONE_CHILD_CLEARTID: c_int = 0x200000; ++pub const CLONE_DETACHED: c_int = 0x400000; ++pub const CLONE_UNTRACED: c_int = 0x800000; ++pub const CLONE_CHILD_SETTID: c_int = 0x01000000; ++pub const CLONE_NEWUTS: c_int = 0x04000000; ++pub const CLONE_NEWIPC: c_int = 0x08000000; ++pub const CLONE_NEWUSER: c_int = 0x10000000; ++pub const CLONE_NEWPID: c_int = 0x20000000; ++pub const CLONE_NEWNET: c_int = 0x40000000; ++pub const CLONE_IO: c_int = 0x80000000; ++pub const CLONE_NEWCGROUP: c_int = 0x02000000; ++ ++pub const WNOHANG: c_int = 0x00000001; ++pub const WUNTRACED: c_int = 0x00000002; ++pub const WSTOPPED: c_int = WUNTRACED; ++pub const WEXITED: c_int = 0x00000004; ++pub const WCONTINUED: c_int = 0x00000008; ++pub const WNOWAIT: c_int = 0x01000000; ++ ++// Options set using PTRACE_SETOPTIONS. ++pub const PTRACE_O_TRACESYSGOOD: c_int = 0x00000001; ++pub const PTRACE_O_TRACEFORK: c_int = 0x00000002; ++pub const PTRACE_O_TRACEVFORK: c_int = 0x00000004; ++pub const PTRACE_O_TRACECLONE: c_int = 0x00000008; ++pub const PTRACE_O_TRACEEXEC: c_int = 0x00000010; ++pub const PTRACE_O_TRACEVFORKDONE: c_int = 0x00000020; ++pub const PTRACE_O_TRACEEXIT: c_int = 0x00000040; ++pub const PTRACE_O_TRACESECCOMP: c_int = 0x00000080; ++pub const PTRACE_O_EXITKILL: c_int = 0x00100000; ++pub const PTRACE_O_SUSPEND_SECCOMP: c_int = 0x00200000; ++pub const PTRACE_O_MASK: c_int = 0x003000ff; ++ ++// Wait extended result codes for the above trace options. ++pub const PTRACE_EVENT_FORK: c_int = 1; ++pub const PTRACE_EVENT_VFORK: c_int = 2; ++pub const PTRACE_EVENT_CLONE: c_int = 3; ++pub const PTRACE_EVENT_EXEC: c_int = 4; ++pub const PTRACE_EVENT_VFORK_DONE: c_int = 5; ++pub const PTRACE_EVENT_EXIT: c_int = 6; ++pub const PTRACE_EVENT_SECCOMP: c_int = 7; ++// PTRACE_EVENT_STOP was added to glibc in 2.26 ++// pub const PTRACE_EVENT_STOP: c_int = 128; ++ ++pub const __WNOTHREAD: c_int = 0x20000000; ++pub const __WALL: c_int = 0x40000000; ++pub const __WCLONE: c_int = 0x80000000; ++ ++pub const SPLICE_F_MOVE: c_uint = 0x01; ++pub const SPLICE_F_NONBLOCK: c_uint = 0x02; ++pub const SPLICE_F_MORE: c_uint = 0x04; ++pub const SPLICE_F_GIFT: c_uint = 0x08; ++ ++pub const RTLD_LOCAL: c_int = 0; ++pub const RTLD_LAZY: c_int = 1; ++ ++pub const POSIX_FADV_NORMAL: c_int = 0; ++pub const POSIX_FADV_RANDOM: c_int = 1; ++pub const POSIX_FADV_SEQUENTIAL: c_int = 2; ++pub const POSIX_FADV_WILLNEED: c_int = 3; ++ ++pub const AT_FDCWD: c_int = -100; ++pub const AT_SYMLINK_NOFOLLOW: c_int = 0x100; ++pub const AT_REMOVEDIR: c_int = 0x200; ++pub const AT_EACCESS: c_int = 0x200; ++pub const AT_SYMLINK_FOLLOW: c_int = 0x400; ++pub const AT_NO_AUTOMOUNT: c_int = 0x800; ++pub const AT_EMPTY_PATH: c_int = 0x1000; ++ ++pub const LOG_CRON: c_int = 9 << 3; ++pub const LOG_AUTHPRIV: c_int = 10 << 3; ++pub const LOG_FTP: c_int = 11 << 3; ++pub const LOG_PERROR: c_int = 0x20; ++ ++pub const PIPE_BUF: usize = 4096; ++ ++pub const SI_LOAD_SHIFT: c_uint = 16; ++ ++pub const CLD_EXITED: c_int = 1; ++pub const CLD_KILLED: c_int = 2; ++pub const CLD_DUMPED: c_int = 3; ++pub const CLD_TRAPPED: c_int = 4; ++pub const CLD_STOPPED: c_int = 5; ++pub const CLD_CONTINUED: c_int = 6; ++ ++pub const SIGEV_SIGNAL: c_int = 0; ++pub const SIGEV_NONE: c_int = 1; ++pub const SIGEV_THREAD: c_int = 2; ++ ++pub const P_ALL: idtype_t = 0; ++pub const P_PID: idtype_t = 1; ++pub const P_PGID: idtype_t = 2; ++ ++pub const UTIME_OMIT: c_long = 1073741822; ++pub const UTIME_NOW: c_long = 1073741823; ++ ++pub const POLLIN: c_short = 0x1; ++pub const POLLPRI: c_short = 0x2; ++pub const POLLOUT: c_short = 0x4; ++pub const POLLERR: c_short = 0x8; ++pub const POLLHUP: c_short = 0x10; ++pub const POLLNVAL: c_short = 0x20; ++pub const POLLRDNORM: c_short = 0x040; ++pub const POLLRDBAND: c_short = 0x080; ++ ++pub const ABDAY_1: crate::nl_item = 0x20000; ++pub const ABDAY_2: crate::nl_item = 0x20001; ++pub const ABDAY_3: crate::nl_item = 0x20002; ++pub const ABDAY_4: crate::nl_item = 0x20003; ++pub const ABDAY_5: crate::nl_item = 0x20004; ++pub const ABDAY_6: crate::nl_item = 0x20005; ++pub const ABDAY_7: crate::nl_item = 0x20006; ++ ++pub const DAY_1: crate::nl_item = 0x20007; ++pub const DAY_2: crate::nl_item = 0x20008; ++pub const DAY_3: crate::nl_item = 0x20009; ++pub const DAY_4: crate::nl_item = 0x2000A; ++pub const DAY_5: crate::nl_item = 0x2000B; ++pub const DAY_6: crate::nl_item = 0x2000C; ++pub const DAY_7: crate::nl_item = 0x2000D; ++ ++pub const ABMON_1: crate::nl_item = 0x2000E; ++pub const ABMON_2: crate::nl_item = 0x2000F; ++pub const ABMON_3: crate::nl_item = 0x20010; ++pub const ABMON_4: crate::nl_item = 0x20011; ++pub const ABMON_5: crate::nl_item = 0x20012; ++pub const ABMON_6: crate::nl_item = 0x20013; ++pub const ABMON_7: crate::nl_item = 0x20014; ++pub const ABMON_8: crate::nl_item = 0x20015; ++pub const ABMON_9: crate::nl_item = 0x20016; ++pub const ABMON_10: crate::nl_item = 0x20017; ++pub const ABMON_11: crate::nl_item = 0x20018; ++pub const ABMON_12: crate::nl_item = 0x20019; ++ ++pub const MON_1: crate::nl_item = 0x2001A; ++pub const MON_2: crate::nl_item = 0x2001B; ++pub const MON_3: crate::nl_item = 0x2001C; ++pub const MON_4: crate::nl_item = 0x2001D; ++pub const MON_5: crate::nl_item = 0x2001E; ++pub const MON_6: crate::nl_item = 0x2001F; ++pub const MON_7: crate::nl_item = 0x20020; ++pub const MON_8: crate::nl_item = 0x20021; ++pub const MON_9: crate::nl_item = 0x20022; ++pub const MON_10: crate::nl_item = 0x20023; ++pub const MON_11: crate::nl_item = 0x20024; ++pub const MON_12: crate::nl_item = 0x20025; ++ ++pub const AM_STR: crate::nl_item = 0x20026; ++pub const PM_STR: crate::nl_item = 0x20027; ++ ++pub const D_T_FMT: crate::nl_item = 0x20028; ++pub const D_FMT: crate::nl_item = 0x20029; ++pub const T_FMT: crate::nl_item = 0x2002A; ++pub const T_FMT_AMPM: crate::nl_item = 0x2002B; ++ ++pub const ERA: crate::nl_item = 0x2002C; ++pub const ERA_D_FMT: crate::nl_item = 0x2002E; ++pub const ALT_DIGITS: crate::nl_item = 0x2002F; ++pub const ERA_D_T_FMT: crate::nl_item = 0x20030; ++pub const ERA_T_FMT: crate::nl_item = 0x20031; ++ ++pub const CODESET: crate::nl_item = 14; ++ ++pub const CRNCYSTR: crate::nl_item = 0x4000F; ++ ++pub const RUSAGE_THREAD: c_int = 1; ++pub const RUSAGE_CHILDREN: c_int = -1; ++ ++pub const RADIXCHAR: crate::nl_item = 0x10000; ++pub const THOUSEP: crate::nl_item = 0x10001; ++ ++pub const YESEXPR: crate::nl_item = 0x50000; ++pub const NOEXPR: crate::nl_item = 0x50001; ++pub const YESSTR: crate::nl_item = 0x50002; ++pub const NOSTR: crate::nl_item = 0x50003; ++ ++pub const FILENAME_MAX: c_uint = 4096; ++pub const L_tmpnam: c_uint = 20; ++pub const _PC_LINK_MAX: c_int = 0; ++pub const _PC_MAX_CANON: c_int = 1; ++pub const _PC_MAX_INPUT: c_int = 2; ++pub const _PC_NAME_MAX: c_int = 3; ++pub const _PC_PATH_MAX: c_int = 4; ++pub const _PC_PIPE_BUF: c_int = 5; ++pub const _PC_CHOWN_RESTRICTED: c_int = 6; ++pub const _PC_NO_TRUNC: c_int = 7; ++pub const _PC_VDISABLE: c_int = 8; ++pub const _PC_SYNC_IO: c_int = 9; ++pub const _PC_ASYNC_IO: c_int = 10; ++pub const _PC_PRIO_IO: c_int = 11; ++pub const _PC_SOCK_MAXBUF: c_int = 12; ++pub const _PC_FILESIZEBITS: c_int = 13; ++pub const _PC_REC_INCR_XFER_SIZE: c_int = 14; ++pub const _PC_REC_MAX_XFER_SIZE: c_int = 15; ++pub const _PC_REC_MIN_XFER_SIZE: c_int = 16; ++pub const _PC_REC_XFER_ALIGN: c_int = 17; ++pub const _PC_ALLOC_SIZE_MIN: c_int = 18; ++pub const _PC_SYMLINK_MAX: c_int = 19; ++pub const _PC_2_SYMLINKS: c_int = 20; ++ ++pub const _SC_ARG_MAX: c_int = 0; ++pub const _SC_CHILD_MAX: c_int = 1; ++pub const _SC_CLK_TCK: c_int = 2; ++pub const _SC_NGROUPS_MAX: c_int = 3; ++pub const _SC_OPEN_MAX: c_int = 4; ++pub const _SC_STREAM_MAX: c_int = 5; ++pub const _SC_TZNAME_MAX: c_int = 6; ++pub const _SC_JOB_CONTROL: c_int = 7; ++pub const _SC_SAVED_IDS: c_int = 8; ++pub const _SC_REALTIME_SIGNALS: c_int = 9; ++pub const _SC_PRIORITY_SCHEDULING: c_int = 10; ++pub const _SC_TIMERS: c_int = 11; ++pub const _SC_ASYNCHRONOUS_IO: c_int = 12; ++pub const _SC_PRIORITIZED_IO: c_int = 13; ++pub const _SC_SYNCHRONIZED_IO: c_int = 14; ++pub const _SC_FSYNC: c_int = 15; ++pub const _SC_MAPPED_FILES: c_int = 16; ++pub const _SC_MEMLOCK: c_int = 17; ++pub const _SC_MEMLOCK_RANGE: c_int = 18; ++pub const _SC_MEMORY_PROTECTION: c_int = 19; ++pub const _SC_MESSAGE_PASSING: c_int = 20; ++pub const _SC_SEMAPHORES: c_int = 21; ++pub const _SC_SHARED_MEMORY_OBJECTS: c_int = 22; ++pub const _SC_AIO_LISTIO_MAX: c_int = 23; ++pub const _SC_AIO_MAX: c_int = 24; ++pub const _SC_AIO_PRIO_DELTA_MAX: c_int = 25; ++pub const _SC_DELAYTIMER_MAX: c_int = 26; ++pub const _SC_MQ_OPEN_MAX: c_int = 27; ++pub const _SC_MQ_PRIO_MAX: c_int = 28; ++pub const _SC_VERSION: c_int = 29; ++pub const _SC_PAGESIZE: c_int = 30; ++pub const _SC_PAGE_SIZE: c_int = _SC_PAGESIZE; ++pub const _SC_RTSIG_MAX: c_int = 31; ++pub const _SC_SEM_NSEMS_MAX: c_int = 32; ++pub const _SC_SEM_VALUE_MAX: c_int = 33; ++pub const _SC_SIGQUEUE_MAX: c_int = 34; ++pub const _SC_TIMER_MAX: c_int = 35; ++pub const _SC_BC_BASE_MAX: c_int = 36; ++pub const _SC_BC_DIM_MAX: c_int = 37; ++pub const _SC_BC_SCALE_MAX: c_int = 38; ++pub const _SC_BC_STRING_MAX: c_int = 39; ++pub const _SC_COLL_WEIGHTS_MAX: c_int = 40; ++pub const _SC_EXPR_NEST_MAX: c_int = 42; ++pub const _SC_LINE_MAX: c_int = 43; ++pub const _SC_RE_DUP_MAX: c_int = 44; ++pub const _SC_2_VERSION: c_int = 46; ++pub const _SC_2_C_BIND: c_int = 47; ++pub const _SC_2_C_DEV: c_int = 48; ++pub const _SC_2_FORT_DEV: c_int = 49; ++pub const _SC_2_FORT_RUN: c_int = 50; ++pub const _SC_2_SW_DEV: c_int = 51; ++pub const _SC_2_LOCALEDEF: c_int = 52; ++pub const _SC_UIO_MAXIOV: c_int = 60; ++pub const _SC_IOV_MAX: c_int = 60; ++pub const _SC_THREADS: c_int = 67; ++pub const _SC_THREAD_SAFE_FUNCTIONS: c_int = 68; ++pub const _SC_GETGR_R_SIZE_MAX: c_int = 69; ++pub const _SC_GETPW_R_SIZE_MAX: c_int = 70; ++pub const _SC_LOGIN_NAME_MAX: c_int = 71; ++pub const _SC_TTY_NAME_MAX: c_int = 72; ++pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: c_int = 73; ++pub const _SC_THREAD_KEYS_MAX: c_int = 74; ++pub const _SC_THREAD_STACK_MIN: c_int = 75; ++pub const _SC_THREAD_THREADS_MAX: c_int = 76; ++pub const _SC_THREAD_ATTR_STACKADDR: c_int = 77; ++pub const _SC_THREAD_ATTR_STACKSIZE: c_int = 78; ++pub const _SC_THREAD_PRIORITY_SCHEDULING: c_int = 79; ++pub const _SC_THREAD_PRIO_INHERIT: c_int = 80; ++pub const _SC_THREAD_PRIO_PROTECT: c_int = 81; ++pub const _SC_THREAD_PROCESS_SHARED: c_int = 82; ++pub const _SC_NPROCESSORS_CONF: c_int = 83; ++pub const _SC_NPROCESSORS_ONLN: c_int = 84; ++pub const _SC_PHYS_PAGES: c_int = 85; ++pub const _SC_AVPHYS_PAGES: c_int = 86; ++pub const _SC_ATEXIT_MAX: c_int = 87; ++pub const _SC_PASS_MAX: c_int = 88; ++pub const _SC_XOPEN_VERSION: c_int = 89; ++pub const _SC_XOPEN_XCU_VERSION: c_int = 90; ++pub const _SC_XOPEN_UNIX: c_int = 91; ++pub const _SC_XOPEN_CRYPT: c_int = 92; ++pub const _SC_XOPEN_ENH_I18N: c_int = 93; ++pub const _SC_XOPEN_SHM: c_int = 94; ++pub const _SC_2_CHAR_TERM: c_int = 95; ++pub const _SC_2_UPE: c_int = 97; ++pub const _SC_XOPEN_XPG2: c_int = 98; ++pub const _SC_XOPEN_XPG3: c_int = 99; ++pub const _SC_XOPEN_XPG4: c_int = 100; ++pub const _SC_NZERO: c_int = 109; ++pub const _SC_XBS5_ILP32_OFF32: c_int = 125; ++pub const _SC_XBS5_ILP32_OFFBIG: c_int = 126; ++pub const _SC_XBS5_LP64_OFF64: c_int = 127; ++pub const _SC_XBS5_LPBIG_OFFBIG: c_int = 128; ++pub const _SC_XOPEN_LEGACY: c_int = 129; ++pub const _SC_XOPEN_REALTIME: c_int = 130; ++pub const _SC_XOPEN_REALTIME_THREADS: c_int = 131; ++pub const _SC_ADVISORY_INFO: c_int = 132; ++pub const _SC_BARRIERS: c_int = 133; ++pub const _SC_CLOCK_SELECTION: c_int = 137; ++pub const _SC_CPUTIME: c_int = 138; ++pub const _SC_THREAD_CPUTIME: c_int = 139; ++pub const _SC_MONOTONIC_CLOCK: c_int = 149; ++pub const _SC_READER_WRITER_LOCKS: c_int = 153; ++pub const _SC_SPIN_LOCKS: c_int = 154; ++pub const _SC_REGEXP: c_int = 155; ++pub const _SC_SHELL: c_int = 157; ++pub const _SC_SPAWN: c_int = 159; ++pub const _SC_SPORADIC_SERVER: c_int = 160; ++pub const _SC_THREAD_SPORADIC_SERVER: c_int = 161; ++pub const _SC_TIMEOUTS: c_int = 164; ++pub const _SC_TYPED_MEMORY_OBJECTS: c_int = 165; ++pub const _SC_2_PBS: c_int = 168; ++pub const _SC_2_PBS_ACCOUNTING: c_int = 169; ++pub const _SC_2_PBS_LOCATE: c_int = 170; ++pub const _SC_2_PBS_MESSAGE: c_int = 171; ++pub const _SC_2_PBS_TRACK: c_int = 172; ++pub const _SC_SYMLOOP_MAX: c_int = 173; ++pub const _SC_STREAMS: c_int = 174; ++pub const _SC_2_PBS_CHECKPOINT: c_int = 175; ++pub const _SC_V6_ILP32_OFF32: c_int = 176; ++pub const _SC_V6_ILP32_OFFBIG: c_int = 177; ++pub const _SC_V6_LP64_OFF64: c_int = 178; ++pub const _SC_V6_LPBIG_OFFBIG: c_int = 179; ++pub const _SC_HOST_NAME_MAX: c_int = 180; ++pub const _SC_TRACE: c_int = 181; ++pub const _SC_TRACE_EVENT_FILTER: c_int = 182; ++pub const _SC_TRACE_INHERIT: c_int = 183; ++pub const _SC_TRACE_LOG: c_int = 184; ++pub const _SC_IPV6: c_int = 235; ++pub const _SC_RAW_SOCKETS: c_int = 236; ++pub const _SC_V7_ILP32_OFF32: c_int = 237; ++pub const _SC_V7_ILP32_OFFBIG: c_int = 238; ++pub const _SC_V7_LP64_OFF64: c_int = 239; ++pub const _SC_V7_LPBIG_OFFBIG: c_int = 240; ++pub const _SC_SS_REPL_MAX: c_int = 241; ++pub const _SC_TRACE_EVENT_NAME_MAX: c_int = 242; ++pub const _SC_TRACE_NAME_MAX: c_int = 243; ++pub const _SC_TRACE_SYS_MAX: c_int = 244; ++pub const _SC_TRACE_USER_EVENT_MAX: c_int = 245; ++pub const _SC_XOPEN_STREAMS: c_int = 246; ++pub const _SC_THREAD_ROBUST_PRIO_INHERIT: c_int = 247; ++pub const _SC_THREAD_ROBUST_PRIO_PROTECT: c_int = 248; ++ ++pub const RLIM_SAVED_MAX: crate::rlim_t = RLIM_INFINITY; ++pub const RLIM_SAVED_CUR: crate::rlim_t = RLIM_INFINITY; ++ ++pub const GLOB_ERR: c_int = 1 << 0; ++pub const GLOB_MARK: c_int = 1 << 1; ++pub const GLOB_NOSORT: c_int = 1 << 2; ++pub const GLOB_DOOFFS: c_int = 1 << 3; ++pub const GLOB_NOCHECK: c_int = 1 << 4; ++pub const GLOB_APPEND: c_int = 1 << 5; ++pub const GLOB_NOESCAPE: c_int = 1 << 6; ++ ++pub const GLOB_NOSPACE: c_int = 1; ++pub const GLOB_ABORTED: c_int = 2; ++pub const GLOB_NOMATCH: c_int = 3; ++ ++pub const POSIX_MADV_NORMAL: c_int = 0; ++pub const POSIX_MADV_RANDOM: c_int = 1; ++pub const POSIX_MADV_SEQUENTIAL: c_int = 2; ++pub const POSIX_MADV_WILLNEED: c_int = 3; ++ ++pub const S_IEXEC: mode_t = 0o0100; ++pub const S_IWRITE: mode_t = 0o0200; ++pub const S_IREAD: mode_t = 0o0400; ++ ++pub const F_LOCK: c_int = 1; ++pub const F_TEST: c_int = 3; ++pub const F_TLOCK: c_int = 2; ++pub const F_ULOCK: c_int = 0; ++ ++pub const IFF_LOWER_UP: c_int = 0x10000; ++pub const IFF_DORMANT: c_int = 0x20000; ++pub const IFF_ECHO: c_int = 0x40000; ++ ++pub const ST_RDONLY: c_ulong = 1; ++pub const ST_NOSUID: c_ulong = 2; ++pub const ST_NODEV: c_ulong = 4; ++pub const ST_NOEXEC: c_ulong = 8; ++pub const ST_SYNCHRONOUS: c_ulong = 16; ++pub const ST_MANDLOCK: c_ulong = 64; ++pub const ST_WRITE: c_ulong = 128; ++pub const ST_APPEND: c_ulong = 256; ++pub const ST_IMMUTABLE: c_ulong = 512; ++pub const ST_NOATIME: c_ulong = 1024; ++pub const ST_NODIRATIME: c_ulong = 2048; ++ ++pub const RTLD_NEXT: *mut c_void = -1i64 as *mut c_void; ++pub const RTLD_DEFAULT: *mut c_void = 0i64 as *mut c_void; ++pub const RTLD_NODELETE: c_int = 0x1000; ++pub const RTLD_NOW: c_int = 0x2; ++ ++pub const TCP_MD5SIG: c_int = 14; ++ ++pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { ++ size: [0; __SIZEOF_PTHREAD_MUTEX_T], ++}; ++pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { ++ size: [0; __SIZEOF_PTHREAD_COND_T], ++}; ++pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { ++ size: [0; __SIZEOF_PTHREAD_RWLOCK_T], ++}; ++pub const PTHREAD_MUTEX_NORMAL: c_int = 0; ++pub const PTHREAD_MUTEX_RECURSIVE: c_int = 1; ++pub const PTHREAD_MUTEX_ERRORCHECK: c_int = 2; ++pub const PTHREAD_MUTEX_DEFAULT: c_int = PTHREAD_MUTEX_NORMAL; ++pub const PTHREAD_PROCESS_PRIVATE: c_int = 0; ++pub const PTHREAD_PROCESS_SHARED: c_int = 1; ++pub const __SIZEOF_PTHREAD_COND_T: usize = 48; ++ ++pub const RENAME_NOREPLACE: c_int = 1; ++pub const RENAME_EXCHANGE: c_int = 2; ++pub const RENAME_WHITEOUT: c_int = 4; ++ ++pub const SCHED_OTHER: c_int = 0; ++pub const SCHED_FIFO: c_int = 1; ++pub const SCHED_RR: c_int = 2; ++pub const SCHED_BATCH: c_int = 3; ++pub const SCHED_IDLE: c_int = 5; ++ ++// netinet/in.h ++// NOTE: These are in addition to the constants defined in src/unix/mod.rs ++ ++// IPPROTO_IP defined in src/unix/mod.rs ++/// Hop-by-hop option header ++pub const IPPROTO_HOPOPTS: c_int = 0; ++// IPPROTO_ICMP defined in src/unix/mod.rs ++/// group mgmt protocol ++pub const IPPROTO_IGMP: c_int = 2; ++/// for compatibility ++pub const IPPROTO_IPIP: c_int = 4; ++// IPPROTO_TCP defined in src/unix/mod.rs ++/// exterior gateway protocol ++pub const IPPROTO_EGP: c_int = 8; ++/// pup ++pub const IPPROTO_PUP: c_int = 12; ++// IPPROTO_UDP defined in src/unix/mod.rs ++/// xns idp ++pub const IPPROTO_IDP: c_int = 22; ++/// tp-4 w/ class negotiation ++pub const IPPROTO_TP: c_int = 29; ++/// DCCP ++pub const IPPROTO_DCCP: c_int = 33; ++// IPPROTO_IPV6 defined in src/unix/mod.rs ++/// IP6 routing header ++pub const IPPROTO_ROUTING: c_int = 43; ++/// IP6 fragmentation header ++pub const IPPROTO_FRAGMENT: c_int = 44; ++/// resource reservation ++pub const IPPROTO_RSVP: c_int = 46; ++/// General Routing Encap. ++pub const IPPROTO_GRE: c_int = 47; ++/// IP6 Encap Sec. Payload ++pub const IPPROTO_ESP: c_int = 50; ++/// IP6 Auth Header ++pub const IPPROTO_AH: c_int = 51; ++// IPPROTO_ICMPV6 defined in src/unix/mod.rs ++/// IP6 no next header ++pub const IPPROTO_NONE: c_int = 59; ++/// IP6 destination option ++pub const IPPROTO_DSTOPTS: c_int = 60; ++pub const IPPROTO_MTP: c_int = 92; ++pub const IPPROTO_BEETPH: c_int = 94; ++/// encapsulation header ++pub const IPPROTO_ENCAP: c_int = 98; ++/// Protocol indep. multicast ++pub const IPPROTO_PIM: c_int = 103; ++/// IP Payload Comp. Protocol ++pub const IPPROTO_COMP: c_int = 108; ++/// SCTP ++pub const IPPROTO_SCTP: c_int = 132; ++pub const IPPROTO_MH: c_int = 135; ++pub const IPPROTO_UDPLITE: c_int = 136; ++pub const IPPROTO_MPLS: c_int = 137; ++/// raw IP packet ++pub const IPPROTO_RAW: c_int = 255; ++pub const IPPROTO_MAX: c_int = 256; ++ ++pub const AF_IB: c_int = 27; ++pub const AF_MPLS: c_int = 28; ++pub const AF_NFC: c_int = 39; ++pub const AF_VSOCK: c_int = 40; ++pub const PF_IB: c_int = AF_IB; ++pub const PF_MPLS: c_int = AF_MPLS; ++pub const PF_NFC: c_int = AF_NFC; ++pub const PF_VSOCK: c_int = AF_VSOCK; ++ ++// System V IPC ++pub const IPC_PRIVATE: crate::key_t = 0; ++ ++pub const IPC_CREAT: c_int = 0o1000; ++pub const IPC_EXCL: c_int = 0o2000; ++pub const IPC_NOWAIT: c_int = 0o4000; ++ ++pub const IPC_RMID: c_int = 0; ++pub const IPC_SET: c_int = 1; ++pub const IPC_STAT: c_int = 2; ++pub const IPC_INFO: c_int = 3; ++pub const MSG_STAT: c_int = 11; ++pub const MSG_INFO: c_int = 12; ++ ++pub const MSG_NOERROR: c_int = 0o10000; ++pub const MSG_EXCEPT: c_int = 0o20000; ++pub const MSG_COPY: c_int = 0o40000; ++ ++pub const SHM_R: c_int = 0o400; ++pub const SHM_W: c_int = 0o200; ++ ++pub const SHM_RDONLY: c_int = 0o10000; ++pub const SHM_RND: c_int = 0o20000; ++pub const SHM_REMAP: c_int = 0o40000; ++pub const SHM_EXEC: c_int = 0o100000; ++ ++pub const SHM_LOCK: c_int = 11; ++pub const SHM_UNLOCK: c_int = 12; ++ ++pub const SHM_HUGETLB: c_int = 0o4000; ++pub const SHM_NORESERVE: c_int = 0o10000; ++ ++pub const EPOLLRDHUP: c_int = 0x2000; ++pub const EPOLLEXCLUSIVE: c_int = 0x10000000; ++pub const EPOLLONESHOT: c_int = 0x40000000; ++ ++pub const QFMT_VFS_OLD: c_int = 1; ++pub const QFMT_VFS_V0: c_int = 2; ++pub const QFMT_VFS_V1: c_int = 4; ++ ++pub const EFD_SEMAPHORE: c_int = 0x1; ++ ++pub const LOG_NFACILITIES: c_int = 24; ++ ++pub const SEM_FAILED: *mut crate::sem_t = 0 as *mut sem_t; ++ ++pub const RB_AUTOBOOT: c_int = 0x01234567u32 as i32; ++pub const RB_HALT_SYSTEM: c_int = 0xcdef0123u32 as i32; ++pub const RB_ENABLE_CAD: c_int = 0x89abcdefu32 as i32; ++pub const RB_DISABLE_CAD: c_int = 0x00000000u32 as i32; ++pub const RB_POWER_OFF: c_int = 0x4321fedcu32 as i32; ++pub const RB_SW_SUSPEND: c_int = 0xd000fce2u32 as i32; ++pub const RB_KEXEC: c_int = 0x45584543u32 as i32; ++ ++pub const AI_PASSIVE: c_int = 0x0001; ++pub const AI_CANONNAME: c_int = 0x0002; ++pub const AI_NUMERICHOST: c_int = 0x0004; ++pub const AI_V4MAPPED: c_int = 0x0008; ++pub const AI_ALL: c_int = 0x0010; ++pub const AI_ADDRCONFIG: c_int = 0x0020; ++ ++pub const AI_NUMERICSERV: c_int = 0x0400; ++ ++pub const EAI_BADFLAGS: c_int = -1; ++pub const EAI_NONAME: c_int = -2; ++pub const EAI_AGAIN: c_int = -3; ++pub const EAI_FAIL: c_int = -4; ++pub const EAI_FAMILY: c_int = -6; ++pub const EAI_SOCKTYPE: c_int = -7; ++pub const EAI_SERVICE: c_int = -8; ++pub const EAI_MEMORY: c_int = -10; ++pub const EAI_OVERFLOW: c_int = -12; ++ ++pub const NI_NUMERICHOST: c_int = 1; ++pub const NI_NUMERICSERV: c_int = 2; ++pub const NI_NOFQDN: c_int = 4; ++pub const NI_NAMEREQD: c_int = 8; ++pub const NI_DGRAM: c_int = 16; ++ ++pub const SYNC_FILE_RANGE_WAIT_BEFORE: c_uint = 1; ++pub const SYNC_FILE_RANGE_WRITE: c_uint = 2; ++pub const SYNC_FILE_RANGE_WAIT_AFTER: c_uint = 4; ++ ++pub const EAI_SYSTEM: c_int = -11; ++ ++pub const AIO_CANCELED: c_int = 0; ++pub const AIO_NOTCANCELED: c_int = 1; ++pub const AIO_ALLDONE: c_int = 2; ++pub const LIO_READ: c_int = 0; ++pub const LIO_WRITE: c_int = 1; ++pub const LIO_NOP: c_int = 2; ++pub const LIO_WAIT: c_int = 0; ++pub const LIO_NOWAIT: c_int = 1; ++ ++pub const MREMAP_MAYMOVE: c_int = 1; ++pub const MREMAP_FIXED: c_int = 2; ++ ++pub const PR_SET_PDEATHSIG: c_int = 1; ++pub const PR_GET_PDEATHSIG: c_int = 2; ++ ++pub const PR_GET_DUMPABLE: c_int = 3; ++pub const PR_SET_DUMPABLE: c_int = 4; ++ ++pub const PR_GET_UNALIGN: c_int = 5; ++pub const PR_SET_UNALIGN: c_int = 6; ++pub const PR_UNALIGN_NOPRINT: c_int = 1; ++pub const PR_UNALIGN_SIGBUS: c_int = 2; ++ ++pub const PR_GET_KEEPCAPS: c_int = 7; ++pub const PR_SET_KEEPCAPS: c_int = 8; ++ ++pub const PR_GET_FPEMU: c_int = 9; ++pub const PR_SET_FPEMU: c_int = 10; ++pub const PR_FPEMU_NOPRINT: c_int = 1; ++pub const PR_FPEMU_SIGFPE: c_int = 2; ++ ++pub const PR_GET_FPEXC: c_int = 11; ++pub const PR_SET_FPEXC: c_int = 12; ++pub const PR_FP_EXC_SW_ENABLE: c_int = 0x80; ++pub const PR_FP_EXC_DIV: c_int = 0x010000; ++pub const PR_FP_EXC_OVF: c_int = 0x020000; ++pub const PR_FP_EXC_UND: c_int = 0x040000; ++pub const PR_FP_EXC_RES: c_int = 0x080000; ++pub const PR_FP_EXC_INV: c_int = 0x100000; ++pub const PR_FP_EXC_DISABLED: c_int = 0; ++pub const PR_FP_EXC_NONRECOV: c_int = 1; ++pub const PR_FP_EXC_ASYNC: c_int = 2; ++pub const PR_FP_EXC_PRECISE: c_int = 3; ++ ++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; ++ ++pub const PR_SET_NAME: c_int = 15; ++pub const PR_GET_NAME: c_int = 16; ++ ++pub const PR_GET_ENDIAN: c_int = 19; ++pub const PR_SET_ENDIAN: c_int = 20; ++pub const PR_ENDIAN_BIG: c_int = 0; ++pub const PR_ENDIAN_LITTLE: c_int = 1; ++pub const PR_ENDIAN_PPC_LITTLE: c_int = 2; ++ ++pub const PR_GET_SECCOMP: c_int = 21; ++pub const PR_SET_SECCOMP: c_int = 22; ++ ++pub const PR_CAPBSET_READ: c_int = 23; ++pub const PR_CAPBSET_DROP: c_int = 24; ++ ++pub const PR_GET_TSC: c_int = 25; ++pub const PR_SET_TSC: c_int = 26; ++pub const PR_TSC_ENABLE: c_int = 1; ++pub const PR_TSC_SIGSEGV: c_int = 2; ++ ++pub const PR_GET_SECUREBITS: c_int = 27; ++pub const PR_SET_SECUREBITS: c_int = 28; ++ ++pub const PR_SET_TIMERSLACK: c_int = 29; ++pub const PR_GET_TIMERSLACK: c_int = 30; ++ ++pub const PR_TASK_PERF_EVENTS_DISABLE: c_int = 31; ++pub const PR_TASK_PERF_EVENTS_ENABLE: c_int = 32; ++ ++pub const PR_MCE_KILL: c_int = 33; ++pub const PR_MCE_KILL_CLEAR: c_int = 0; ++pub const PR_MCE_KILL_SET: c_int = 1; ++ ++pub const PR_MCE_KILL_LATE: c_int = 0; ++pub const PR_MCE_KILL_EARLY: c_int = 1; ++pub const PR_MCE_KILL_DEFAULT: c_int = 2; ++ ++pub const PR_MCE_KILL_GET: c_int = 34; ++ ++pub const PR_SET_MM: c_int = 35; ++pub const PR_SET_MM_START_CODE: c_int = 1; ++pub const PR_SET_MM_END_CODE: c_int = 2; ++pub const PR_SET_MM_START_DATA: c_int = 3; ++pub const PR_SET_MM_END_DATA: c_int = 4; ++pub const PR_SET_MM_START_STACK: c_int = 5; ++pub const PR_SET_MM_START_BRK: c_int = 6; ++pub const PR_SET_MM_BRK: c_int = 7; ++pub const PR_SET_MM_ARG_START: c_int = 8; ++pub const PR_SET_MM_ARG_END: c_int = 9; ++pub const PR_SET_MM_ENV_START: c_int = 10; ++pub const PR_SET_MM_ENV_END: c_int = 11; ++pub const PR_SET_MM_AUXV: c_int = 12; ++pub const PR_SET_MM_EXE_FILE: c_int = 13; ++pub const PR_SET_MM_MAP: c_int = 14; ++pub const PR_SET_MM_MAP_SIZE: c_int = 15; ++ ++pub const PR_SET_PTRACER: c_int = 0x59616d61; ++pub const PR_SET_PTRACER_ANY: c_ulong = 0xffffffffffffffff; ++ ++pub const PR_SET_CHILD_SUBREAPER: c_int = 36; ++pub const PR_GET_CHILD_SUBREAPER: c_int = 37; ++ ++pub const PR_SET_NO_NEW_PRIVS: c_int = 38; ++pub const PR_GET_NO_NEW_PRIVS: c_int = 39; ++ ++pub const PR_GET_TID_ADDRESS: c_int = 40; ++ ++pub const PR_SET_THP_DISABLE: c_int = 41; ++pub const PR_GET_THP_DISABLE: c_int = 42; ++ ++pub const PR_MPX_ENABLE_MANAGEMENT: c_int = 43; ++pub const PR_MPX_DISABLE_MANAGEMENT: c_int = 44; ++ ++pub const PR_SET_FP_MODE: c_int = 45; ++pub const PR_GET_FP_MODE: c_int = 46; ++pub const PR_FP_MODE_FR: c_int = 1 << 0; ++pub const PR_FP_MODE_FRE: c_int = 1 << 1; ++ ++pub const PR_CAP_AMBIENT: c_int = 47; ++pub const PR_CAP_AMBIENT_IS_SET: c_int = 1; ++pub const PR_CAP_AMBIENT_RAISE: c_int = 2; ++pub const PR_CAP_AMBIENT_LOWER: c_int = 3; ++pub const PR_CAP_AMBIENT_CLEAR_ALL: c_int = 4; ++ ++pub const ITIMER_REAL: c_int = 0; ++pub const ITIMER_VIRTUAL: c_int = 1; ++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 XATTR_CREATE: c_int = 0x1; ++pub const XATTR_REPLACE: c_int = 0x2; ++ ++pub const _POSIX_VDISABLE: crate::cc_t = 0; ++ ++pub const FALLOC_FL_KEEP_SIZE: c_int = 0x01; ++pub const FALLOC_FL_PUNCH_HOLE: c_int = 0x02; ++pub const FALLOC_FL_COLLAPSE_RANGE: c_int = 0x08; ++pub const FALLOC_FL_ZERO_RANGE: c_int = 0x10; ++pub const FALLOC_FL_INSERT_RANGE: c_int = 0x20; ++pub const FALLOC_FL_UNSHARE_RANGE: c_int = 0x40; ++ ++// On Linux, libc doesn't define this constant, libattr does instead. ++// We still define it for Linux as it's defined by libc on other platforms, ++// and it's mentioned in the man pages for getxattr and setxattr. ++pub const ENOATTR: c_int = crate::ENODATA; ++ ++pub const SO_ORIGINAL_DST: c_int = 80; ++pub const IUTF8: crate::tcflag_t = 0x00004000; ++pub const CMSPAR: crate::tcflag_t = 0o10000000000; ++ ++pub const MFD_CLOEXEC: c_uint = 0x0001; ++pub const MFD_ALLOW_SEALING: c_uint = 0x0002; ++ ++// these are used in the p_type field of Elf32_Phdr and Elf64_Phdr, which has ++// the type Elf32Word and Elf64Word respectively. Luckily, both of those are u32 ++// so we can use that type here to avoid having to cast. ++pub const PT_NULL: u32 = 0; ++pub const PT_LOAD: u32 = 1; ++pub const PT_DYNAMIC: u32 = 2; ++pub const PT_INTERP: u32 = 3; ++pub const PT_NOTE: u32 = 4; ++pub const PT_SHLIB: u32 = 5; ++pub const PT_PHDR: u32 = 6; ++pub const PT_TLS: u32 = 7; ++pub const PT_NUM: u32 = 8; ++pub const PT_LOOS: u32 = 0x60000000; ++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_LOOP: c_int = 0x0060; ++pub const ETH_P_PUP: c_int = 0x0200; ++pub const ETH_P_PUPAT: c_int = 0x0201; ++pub const ETH_P_IP: c_int = 0x0800; ++pub const ETH_P_X25: c_int = 0x0805; ++pub const ETH_P_ARP: c_int = 0x0806; ++pub const ETH_P_BPQ: c_int = 0x08FF; ++pub const ETH_P_IEEEPUP: c_int = 0x0a00; ++pub const ETH_P_IEEEPUPAT: c_int = 0x0a01; ++pub const ETH_P_BATMAN: c_int = 0x4305; ++pub const ETH_P_DEC: c_int = 0x6000; ++pub const ETH_P_DNA_DL: c_int = 0x6001; ++pub const ETH_P_DNA_RC: c_int = 0x6002; ++pub const ETH_P_DNA_RT: c_int = 0x6003; ++pub const ETH_P_LAT: c_int = 0x6004; ++pub const ETH_P_DIAG: c_int = 0x6005; ++pub const ETH_P_CUST: c_int = 0x6006; ++pub const ETH_P_SCA: c_int = 0x6007; ++pub const ETH_P_TEB: c_int = 0x6558; ++pub const ETH_P_RARP: c_int = 0x8035; ++pub const ETH_P_ATALK: c_int = 0x809B; ++pub const ETH_P_AARP: c_int = 0x80F3; ++pub const ETH_P_8021Q: c_int = 0x8100; ++pub const ETH_P_IPX: c_int = 0x8137; ++pub const ETH_P_IPV6: c_int = 0x86DD; ++pub const ETH_P_PAUSE: c_int = 0x8808; ++pub const ETH_P_SLOW: c_int = 0x8809; ++pub const ETH_P_WCCP: c_int = 0x883E; ++pub const ETH_P_MPLS_UC: c_int = 0x8847; ++pub const ETH_P_MPLS_MC: c_int = 0x8848; ++pub const ETH_P_ATMMPOA: c_int = 0x884c; ++pub const ETH_P_PPP_DISC: c_int = 0x8863; ++pub const ETH_P_PPP_SES: c_int = 0x8864; ++pub const ETH_P_LINK_CTL: c_int = 0x886c; ++pub const ETH_P_ATMFATE: c_int = 0x8884; ++pub const ETH_P_PAE: c_int = 0x888E; ++pub const ETH_P_AOE: c_int = 0x88A2; ++pub const ETH_P_8021AD: c_int = 0x88A8; ++pub const ETH_P_802_EX1: c_int = 0x88B5; ++pub const ETH_P_TIPC: c_int = 0x88CA; ++pub const ETH_P_8021AH: c_int = 0x88E7; ++pub const ETH_P_MVRP: c_int = 0x88F5; ++pub const ETH_P_1588: c_int = 0x88F7; ++pub const ETH_P_PRP: c_int = 0x88FB; ++pub const ETH_P_FCOE: c_int = 0x8906; ++pub const ETH_P_TDLS: c_int = 0x890D; ++pub const ETH_P_FIP: c_int = 0x8914; ++pub const ETH_P_80221: c_int = 0x8917; ++pub const ETH_P_LOOPBACK: c_int = 0x9000; ++pub const ETH_P_QINQ1: c_int = 0x9100; ++pub const ETH_P_QINQ2: c_int = 0x9200; ++pub const ETH_P_QINQ3: c_int = 0x9300; ++pub const ETH_P_EDSA: c_int = 0xDADA; ++pub const ETH_P_AF_IUCV: c_int = 0xFBFB; ++ ++pub const ETH_P_802_3_MIN: c_int = 0x0600; ++ ++pub const ETH_P_802_3: c_int = 0x0001; ++pub const ETH_P_AX25: c_int = 0x0002; ++pub const ETH_P_ALL: c_int = 0x0003; ++pub const ETH_P_802_2: c_int = 0x0004; ++pub const ETH_P_SNAP: c_int = 0x0005; ++pub const ETH_P_DDCMP: c_int = 0x0006; ++pub const ETH_P_WAN_PPP: c_int = 0x0007; ++pub const ETH_P_PPP_MP: c_int = 0x0008; ++pub const ETH_P_LOCALTALK: c_int = 0x0009; ++pub const ETH_P_CAN: c_int = 0x000C; ++pub const ETH_P_CANFD: c_int = 0x000D; ++pub const ETH_P_PPPTALK: c_int = 0x0010; ++pub const ETH_P_TR_802_2: c_int = 0x0011; ++pub const ETH_P_MOBITEX: c_int = 0x0015; ++pub const ETH_P_CONTROL: c_int = 0x0016; ++pub const ETH_P_IRDA: c_int = 0x0017; ++pub const ETH_P_ECONET: c_int = 0x0018; ++pub const ETH_P_HDLC: c_int = 0x0019; ++pub const ETH_P_ARCNET: c_int = 0x001A; ++pub const ETH_P_DSA: c_int = 0x001B; ++pub const ETH_P_TRAILER: c_int = 0x001C; ++pub const ETH_P_PHONET: c_int = 0x00F5; ++pub const ETH_P_IEEE802154: c_int = 0x00F6; ++pub const ETH_P_CAIF: c_int = 0x00F7; ++ ++pub const SFD_CLOEXEC: c_int = 0x080000; ++ ++pub const NCCS: usize = 32; ++ ++pub const O_TRUNC: c_int = 0x00040000; ++pub const O_NOATIME: c_int = 0x00002000; ++pub const O_CLOEXEC: c_int = 0x00000100; ++pub const O_TMPFILE: c_int = 0x00004000; ++ ++pub const EBFONT: c_int = 59; ++pub const ENOSTR: c_int = 60; ++pub const ENODATA: c_int = 61; ++pub const ETIME: c_int = 62; ++pub const ENOSR: c_int = 63; ++pub const ENONET: c_int = 64; ++pub const ENOPKG: c_int = 65; ++pub const EREMOTE: c_int = 66; ++pub const ENOLINK: c_int = 67; ++pub const EADV: c_int = 68; ++pub const ESRMNT: c_int = 69; ++pub const ECOMM: c_int = 70; ++pub const EPROTO: c_int = 71; ++pub const EDOTDOT: c_int = 73; ++ ++pub const SA_NODEFER: c_int = 0x40000000; ++pub const SA_RESETHAND: c_int = 0x80000000; ++pub const SA_RESTART: c_int = 0x10000000; ++pub const SA_NOCLDSTOP: c_int = 0x00000001; ++ ++pub const EPOLL_CLOEXEC: c_int = 0x80000; ++ ++pub const EFD_CLOEXEC: c_int = 0x80000; ++ ++pub const BUFSIZ: c_uint = 1024; ++pub const TMP_MAX: c_uint = 10000; ++pub const FOPEN_MAX: c_uint = 1000; ++pub const O_PATH: c_int = 0x00400000; ++pub const O_EXEC: c_int = O_PATH; ++pub const O_SEARCH: c_int = O_PATH; ++pub const O_ACCMODE: c_int = 03 | O_SEARCH; ++pub const O_NDELAY: c_int = O_NONBLOCK; ++pub const NI_MAXHOST: crate::socklen_t = 255; ++pub const PTHREAD_STACK_MIN: size_t = 2048; ++pub const POSIX_FADV_DONTNEED: c_int = 4; ++pub const POSIX_FADV_NOREUSE: c_int = 5; ++ ++pub const POSIX_MADV_DONTNEED: c_int = 4; ++ ++pub const RLIM_INFINITY: crate::rlim_t = !0; ++pub const RLIMIT_RTTIME: c_int = 15; ++#[deprecated(since = "0.2.64", note = "Not stable across OS versions")] ++pub const RLIMIT_NLIMITS: c_int = 16; ++#[allow(deprecated)] ++#[deprecated(since = "0.2.64", note = "Not stable across OS versions")] ++pub const RLIM_NLIMITS: c_int = RLIMIT_NLIMITS; ++ ++pub const MAP_ANONYMOUS: c_int = MAP_ANON; ++ ++pub const SOCK_DCCP: c_int = 6; ++pub const SOCK_PACKET: c_int = 10; ++ ++pub const TCP_COOKIE_TRANSACTIONS: c_int = 15; ++pub const TCP_THIN_LINEAR_TIMEOUTS: c_int = 16; ++pub const TCP_THIN_DUPACK: c_int = 17; ++pub const TCP_USER_TIMEOUT: c_int = 18; ++pub const TCP_REPAIR: c_int = 19; ++pub const TCP_REPAIR_QUEUE: c_int = 20; ++pub const TCP_QUEUE_SEQ: c_int = 21; ++pub const TCP_REPAIR_OPTIONS: c_int = 22; ++pub const TCP_FASTOPEN: c_int = 23; ++pub const TCP_TIMESTAMP: c_int = 24; ++ ++pub const SIGUNUSED: c_int = crate::SIGSYS; ++ ++pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; ++pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; ++pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8; ++ ++pub const CPU_SETSIZE: c_int = 128; ++ ++pub const PTRACE_TRACEME: c_int = 0; ++pub const PTRACE_PEEKTEXT: c_int = 1; ++pub const PTRACE_PEEKDATA: c_int = 2; ++pub const PTRACE_PEEKUSER: c_int = 3; ++pub const PTRACE_POKETEXT: c_int = 4; ++pub const PTRACE_POKEDATA: c_int = 5; ++pub const PTRACE_POKEUSER: c_int = 6; ++pub const PTRACE_CONT: c_int = 7; ++pub const PTRACE_KILL: c_int = 8; ++pub const PTRACE_SINGLESTEP: c_int = 9; ++pub const PTRACE_GETREGS: c_int = 12; ++pub const PTRACE_SETREGS: c_int = 13; ++pub const PTRACE_GETFPREGS: c_int = 14; ++pub const PTRACE_SETFPREGS: c_int = 15; ++pub const PTRACE_ATTACH: c_int = 16; ++pub const PTRACE_DETACH: c_int = 17; ++pub const PTRACE_GETFPXREGS: c_int = 18; ++pub const PTRACE_SETFPXREGS: c_int = 19; ++pub const PTRACE_SYSCALL: c_int = 24; ++pub const PTRACE_SETOPTIONS: c_int = 0x4200; ++pub const PTRACE_GETEVENTMSG: c_int = 0x4201; ++pub const PTRACE_GETSIGINFO: c_int = 0x4202; ++pub const PTRACE_SETSIGINFO: c_int = 0x4203; ++pub const PTRACE_GETREGSET: c_int = 0x4204; ++pub const PTRACE_SETREGSET: c_int = 0x4205; ++pub const PTRACE_SEIZE: c_int = 0x4206; ++pub const PTRACE_INTERRUPT: c_int = 0x4207; ++pub const PTRACE_LISTEN: c_int = 0x4208; ++pub const PTRACE_PEEKSIGINFO: c_int = 0x4209; ++ ++pub const EPOLLWAKEUP: c_int = 0x20000000; ++ ++pub const EFD_NONBLOCK: c_int = crate::O_NONBLOCK; ++ ++pub const SFD_NONBLOCK: c_int = crate::O_NONBLOCK; ++ ++pub const TCSANOW: c_int = 0; ++pub const TCSADRAIN: c_int = 1; ++pub const TCSAFLUSH: c_int = 2; ++ ++pub const TIOCINQ: c_int = crate::FIONREAD; ++ ++pub const RTLD_GLOBAL: c_int = 0x100; ++pub const RTLD_NOLOAD: c_int = 0x4; ++ ++pub const MCL_CURRENT: c_int = 0x0001; ++pub const MCL_FUTURE: c_int = 0x0002; ++ ++pub const CBAUD: crate::tcflag_t = 0o0010017; ++pub const TAB1: c_int = 0x00000800; ++pub const TAB2: c_int = 0x00001000; ++pub const TAB3: c_int = 0x00001800; ++pub const CR1: c_int = 0x00000200; ++pub const CR2: c_int = 0x00000400; ++pub const CR3: c_int = 0x00000600; ++pub const FF1: c_int = 0x00008000; ++pub const BS1: c_int = 0x00002000; ++pub const VT1: c_int = 0x00004000; ++pub const VWERASE: usize = 14; ++pub const VREPRINT: usize = 12; ++pub const VSUSP: usize = 10; ++pub const VSTART: usize = 8; ++pub const VSTOP: usize = 9; ++pub const VDISCARD: usize = 13; ++pub const VTIME: usize = 5; ++pub const IXON: crate::tcflag_t = 0x00000400; ++pub const IXOFF: crate::tcflag_t = 0x00001000; ++pub const ONLCR: crate::tcflag_t = 0x4; ++pub const CSIZE: crate::tcflag_t = 0x00000030; ++pub const CS6: crate::tcflag_t = 0x00000010; ++pub const CS7: crate::tcflag_t = 0x00000020; ++pub const CS8: crate::tcflag_t = 0x00000030; ++pub const CSTOPB: crate::tcflag_t = 0x00000040; ++pub const CREAD: crate::tcflag_t = 0x00000080; ++pub const PARENB: crate::tcflag_t = 0x00000100; ++pub const PARODD: crate::tcflag_t = 0x00000200; ++pub const HUPCL: crate::tcflag_t = 0x00000400; ++pub const CLOCAL: crate::tcflag_t = 0x00000800; ++pub const ECHOKE: crate::tcflag_t = 0x00000800; ++pub const ECHOE: crate::tcflag_t = 0x00000010; ++pub const ECHOK: crate::tcflag_t = 0x00000020; ++pub const ECHONL: crate::tcflag_t = 0x00000040; ++pub const ECHOPRT: crate::tcflag_t = 0x00000400; ++pub const ECHOCTL: crate::tcflag_t = 0x00000200; ++pub const ISIG: crate::tcflag_t = 0x00000001; ++pub const ICANON: crate::tcflag_t = 0x00000002; ++pub const PENDIN: crate::tcflag_t = 0x00004000; ++pub const NOFLSH: crate::tcflag_t = 0x00000080; ++pub const CIBAUD: crate::tcflag_t = 0o02003600000; ++pub const CBAUDEX: crate::tcflag_t = 0o010000; ++pub const VSWTC: usize = 7; ++pub const OLCUC: crate::tcflag_t = 0o000002; ++pub const NLDLY: crate::tcflag_t = 0o000400; ++pub const CRDLY: crate::tcflag_t = 0o003000; ++pub const TABDLY: crate::tcflag_t = 0o014000; ++pub const BSDLY: crate::tcflag_t = 0o020000; ++pub const FFDLY: crate::tcflag_t = 0o100000; ++pub const VTDLY: crate::tcflag_t = 0o040000; ++pub const XTABS: crate::tcflag_t = 0o014000; ++ ++pub const B0: crate::speed_t = 0o000000; ++pub const B50: crate::speed_t = 0o000001; ++pub const B75: crate::speed_t = 0o000002; ++pub const B110: crate::speed_t = 0o000003; ++pub const B134: crate::speed_t = 0o000004; ++pub const B150: crate::speed_t = 0o000005; ++pub const B200: crate::speed_t = 0o000006; ++pub const B300: crate::speed_t = 0o000007; ++pub const B600: crate::speed_t = 0o000010; ++pub const B1200: crate::speed_t = 0o000011; ++pub const B1800: crate::speed_t = 0o000012; ++pub const B2400: crate::speed_t = 0o000013; ++pub const B4800: crate::speed_t = 0o000014; ++pub const B9600: crate::speed_t = 0o000015; ++pub const B19200: crate::speed_t = 0o000016; ++pub const B38400: crate::speed_t = 0o000017; ++pub const EXTA: crate::speed_t = B19200; ++pub const EXTB: crate::speed_t = B38400; ++pub const B57600: crate::speed_t = 0o010001; ++pub const B115200: crate::speed_t = 0o010002; ++pub const B230400: crate::speed_t = 0o010003; ++pub const B460800: crate::speed_t = 0o010004; ++pub const B500000: crate::speed_t = 0o010005; ++pub const B576000: crate::speed_t = 0o010006; ++pub const B921600: crate::speed_t = 0o010007; ++pub const B1000000: crate::speed_t = 0o010010; ++pub const B1152000: crate::speed_t = 0o010011; ++pub const B1500000: crate::speed_t = 0o010012; ++pub const B2000000: crate::speed_t = 0o010013; ++pub const B2500000: crate::speed_t = 0o010014; ++pub const B3000000: crate::speed_t = 0o010015; ++pub const B3500000: crate::speed_t = 0o010016; ++pub const B4000000: crate::speed_t = 0o010017; ++ ++pub const SO_BINDTODEVICE: c_int = 25; ++pub const SO_TIMESTAMP: c_int = 29; ++pub const SO_MARK: c_int = 36; ++pub const SO_RXQ_OVFL: c_int = 40; ++pub const SO_PEEK_OFF: c_int = 42; ++pub const SO_BUSY_POLL: c_int = 46; ++pub const SO_BINDTOIFINDEX: c_int = 62; ++ ++pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; ++pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; ++ ++pub const O_ASYNC: c_int = 0x00000400; ++ ++pub const FIOCLEX: c_int = 0x5451; ++pub const FIONBIO: c_int = 0x5421; ++ ++pub const RLIMIT_RSS: c_int = 5; ++pub const RLIMIT_NOFILE: c_int = 7; ++pub const RLIMIT_AS: c_int = 9; ++pub const RLIMIT_NPROC: c_int = 6; ++pub const RLIMIT_MEMLOCK: c_int = 8; ++ ++pub const O_APPEND: c_int = 0x00100000; ++pub const O_CREAT: c_int = 0x00010000; ++pub const O_EXCL: c_int = 0x00020000; ++pub const O_NOCTTY: c_int = 0x00000200; ++pub const O_NONBLOCK: c_int = 0x00000010; ++pub const O_SYNC: c_int = 0x00000040 | O_DSYNC; ++pub const O_RSYNC: c_int = O_SYNC; ++pub const O_DSYNC: c_int = 0x00000020; ++ ++pub const SOCK_CLOEXEC: c_int = 0o2000000; ++pub const SOCK_NONBLOCK: c_int = 0o4000; ++ ++pub const MAP_ANON: c_int = 0x0020; ++pub const MAP_GROWSDOWN: c_int = 0x0100; ++pub const MAP_DENYWRITE: c_int = 0x0800; ++pub const MAP_EXECUTABLE: c_int = 0x01000; ++pub const MAP_LOCKED: c_int = 0x02000; ++pub const MAP_NORESERVE: c_int = 0x04000; ++pub const MAP_POPULATE: c_int = 0x08000; ++pub const MAP_NONBLOCK: c_int = 0x010000; ++pub const MAP_STACK: c_int = 0x020000; ++ ++pub const SOCK_STREAM: c_int = 1; ++pub const SOCK_DGRAM: c_int = 2; ++pub const SOCK_SEQPACKET: c_int = 5; ++ ++pub const SOL_SOCKET: c_int = 1; ++ ++pub const EDEADLK: c_int = 35; ++pub const ENAMETOOLONG: c_int = 36; ++pub const ENOLCK: c_int = 37; ++pub const ENOSYS: c_int = 38; ++pub const ENOTEMPTY: c_int = 39; ++pub const ELOOP: c_int = 40; ++pub const ENOMSG: c_int = 42; ++pub const EIDRM: c_int = 43; ++pub const ECHRNG: c_int = 44; ++pub const EL2NSYNC: c_int = 45; ++pub const EL3HLT: c_int = 46; ++pub const EL3RST: c_int = 47; ++pub const ELNRNG: c_int = 48; ++pub const EUNATCH: c_int = 49; ++pub const ENOCSI: c_int = 50; ++pub const EL2HLT: c_int = 51; ++pub const EBADE: c_int = 52; ++pub const EBADR: c_int = 53; ++pub const EXFULL: c_int = 54; ++pub const ENOANO: c_int = 55; ++pub const EBADRQC: c_int = 56; ++pub const EBADSLT: c_int = 57; ++pub const EDEADLOCK: c_int = EDEADLK; ++pub const EMULTIHOP: c_int = 72; ++pub const EBADMSG: c_int = 74; ++pub const EOVERFLOW: c_int = 75; ++pub const ENOTUNIQ: c_int = 76; ++pub const EBADFD: c_int = 77; ++pub const EREMCHG: c_int = 78; ++pub const ELIBACC: c_int = 79; ++pub const ELIBBAD: c_int = 80; ++pub const ELIBSCN: c_int = 81; ++pub const ELIBMAX: c_int = 82; ++pub const ELIBEXEC: c_int = 83; ++pub const EILSEQ: c_int = 84; ++pub const ERESTART: c_int = 85; ++pub const ESTRPIPE: c_int = 86; ++pub const EUSERS: c_int = 87; ++pub const ENOTSOCK: c_int = 88; ++pub const EDESTADDRREQ: c_int = 89; ++pub const EMSGSIZE: c_int = 90; ++pub const EPROTOTYPE: c_int = 91; ++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 EADDRINUSE: c_int = 98; ++pub const EADDRNOTAVAIL: c_int = 99; ++pub const ENETDOWN: c_int = 100; ++pub const ENETUNREACH: c_int = 101; ++pub const ENETRESET: c_int = 102; ++pub const ECONNABORTED: c_int = 103; ++pub const ECONNRESET: c_int = 104; ++pub const ENOBUFS: c_int = 105; ++pub const EISCONN: c_int = 106; ++pub const ENOTCONN: c_int = 107; ++pub const ESHUTDOWN: c_int = 108; ++pub const ETOOMANYREFS: c_int = 109; ++pub const ETIMEDOUT: c_int = 110; ++pub const ECONNREFUSED: c_int = 111; ++pub const EHOSTDOWN: c_int = 112; ++pub const EHOSTUNREACH: c_int = 113; ++pub const EALREADY: c_int = 114; ++pub const EINPROGRESS: c_int = 115; ++pub const ESTALE: c_int = 116; ++pub const EUCLEAN: c_int = 117; ++pub const ENOTNAM: c_int = 118; ++pub const ENAVAIL: c_int = 119; ++pub const EISNAM: c_int = 120; ++pub const EREMOTEIO: c_int = 121; ++pub const EDQUOT: c_int = 122; ++pub const ENOMEDIUM: c_int = 123; ++pub const EMEDIUMTYPE: c_int = 124; ++pub const ECANCELED: c_int = 125; ++pub const ENOKEY: c_int = 126; ++pub const EKEYEXPIRED: c_int = 127; ++pub const EKEYREVOKED: c_int = 128; ++pub const EKEYREJECTED: c_int = 129; ++pub const EOWNERDEAD: c_int = 130; ++pub const ENOTRECOVERABLE: c_int = 131; ++pub const ERFKILL: c_int = 132; ++pub const EHWPOISON: c_int = 133; ++ ++pub const SO_REUSEADDR: c_int = 2; ++pub const SO_TYPE: c_int = 3; ++pub const SO_ERROR: c_int = 4; ++pub const SO_DONTROUTE: c_int = 5; ++pub const SO_BROADCAST: c_int = 6; ++pub const SO_SNDBUF: c_int = 7; ++pub const SO_RCVBUF: c_int = 8; ++pub const SO_KEEPALIVE: c_int = 9; ++pub const SO_OOBINLINE: c_int = 10; ++pub const SO_NO_CHECK: c_int = 11; ++pub const SO_PRIORITY: c_int = 12; ++pub const SO_LINGER: c_int = 13; ++pub const SO_BSDCOMPAT: c_int = 14; ++pub const SO_REUSEPORT: c_int = 15; ++pub const SO_PASSCRED: c_int = 16; ++pub const SO_PEERCRED: c_int = 17; ++pub const SO_RCVLOWAT: c_int = 18; ++pub const SO_SNDLOWAT: c_int = 19; ++pub const SO_RCVTIMEO: c_int = 20; ++pub const SO_SNDTIMEO: c_int = 21; ++pub const SO_ACCEPTCONN: c_int = 30; ++pub const SO_SNDBUFFORCE: c_int = 32; ++pub const SO_RCVBUFFORCE: c_int = 33; ++pub const SO_PROTOCOL: c_int = 38; ++pub const SO_DOMAIN: c_int = 39; ++ ++pub const SA_ONSTACK: c_int = 0x08000000; ++pub const SA_SIGINFO: c_int = 0x00000004; ++pub const SA_NOCLDWAIT: c_int = 0x00000002; ++ ++pub const SIGCHLD: c_int = 17; ++pub const SIGBUS: c_int = 7; ++pub const SIGTTIN: c_int = 21; ++pub const SIGTTOU: c_int = 22; ++pub const SIGXCPU: c_int = 24; ++pub const SIGXFSZ: c_int = 25; ++pub const SIGVTALRM: c_int = 26; ++pub const SIGPROF: c_int = 27; ++pub const SIGWINCH: c_int = 28; ++pub const SIGUSR1: c_int = 10; ++pub const SIGUSR2: c_int = 12; ++pub const SIGCONT: c_int = 18; ++pub const SIGSTOP: c_int = 19; ++pub const SIGTSTP: c_int = 20; ++pub const SIGURG: c_int = 23; ++pub const SIGIO: c_int = 29; ++pub const SIGSYS: c_int = 31; ++pub const SIGSTKFLT: c_int = 16; ++pub const SIGPOLL: c_int = 29; ++pub const SIGPWR: c_int = 30; ++pub const SIG_SETMASK: c_int = 2; ++pub const SIG_BLOCK: c_int = 0x000000; ++pub const SIG_UNBLOCK: c_int = 0x01; ++ ++pub const EXTPROC: crate::tcflag_t = 0x00010000; ++ ++pub const MAP_HUGETLB: c_int = 0x040000; ++ ++pub const F_GETLK: c_int = 5; ++pub const F_GETOWN: c_int = 9; ++pub const F_SETLK: c_int = 6; ++pub const F_SETLKW: c_int = 7; ++pub const F_SETOWN: c_int = 8; ++ ++pub const VEOF: usize = 4; ++pub const VEOL: usize = 11; ++pub const VEOL2: usize = 16; ++pub const VMIN: usize = 6; ++pub const IEXTEN: crate::tcflag_t = 0x00008000; ++pub const TOSTOP: crate::tcflag_t = 0x00000100; ++pub const FLUSHO: crate::tcflag_t = 0x00001000; ++ ++pub const TCGETS: c_int = 0x5401; ++pub const TCSETS: c_int = 0x5402; ++pub const TCSETSW: c_int = 0x5403; ++pub const TCSETSF: c_int = 0x5404; ++pub const TCGETA: c_int = 0x5405; ++pub const TCSETA: c_int = 0x5406; ++pub const TCSETAW: c_int = 0x5407; ++pub const TCSETAF: c_int = 0x5408; ++pub const TCSBRK: c_int = 0x5409; ++pub const TCXONC: c_int = 0x540A; ++pub const TCFLSH: c_int = 0x540B; ++pub const TIOCGSOFTCAR: c_int = 0x5419; ++pub const TIOCSSOFTCAR: c_int = 0x541A; ++pub const TIOCLINUX: c_int = 0x541C; ++pub const TIOCGSERIAL: c_int = 0x541E; ++pub const TIOCEXCL: c_int = 0x540C; ++pub const TIOCNXCL: c_int = 0x540D; ++pub const TIOCSCTTY: c_int = 0x540E; ++pub const TIOCGPGRP: c_int = 0x540F; ++pub const TIOCSPGRP: c_int = 0x5410; ++pub const TIOCOUTQ: c_int = 0x5411; ++pub const TIOCSTI: c_int = 0x5412; ++pub const TIOCGWINSZ: c_int = 0x5413; ++pub const TIOCSWINSZ: c_int = 0x5414; ++pub const TIOCMGET: c_int = 0x5415; ++pub const TIOCMBIS: c_int = 0x5416; ++pub const TIOCMBIC: c_int = 0x5417; ++pub const TIOCMSET: c_int = 0x5418; ++pub const FIONREAD: c_int = 0x541B; ++pub const TIOCCONS: c_int = 0x541D; ++ ++pub const POLLWRNORM: c_short = 0x100; ++pub const POLLWRBAND: c_short = 0x200; ++ ++pub const TIOCM_LE: c_int = 0x001; ++pub const TIOCM_DTR: c_int = 0x002; ++pub const TIOCM_RTS: c_int = 0x004; ++pub const TIOCM_ST: c_int = 0x008; ++pub const TIOCM_SR: c_int = 0x010; ++pub const TIOCM_CTS: c_int = 0x020; ++pub const TIOCM_CAR: c_int = 0x040; ++pub const TIOCM_RNG: c_int = 0x080; ++pub const TIOCM_DSR: c_int = 0x100; ++pub const TIOCM_CD: c_int = TIOCM_CAR; ++pub const TIOCM_RI: c_int = TIOCM_RNG; ++ ++pub const O_DIRECTORY: c_int = 0x00080000; ++pub const O_DIRECT: c_int = 0x00000800; ++pub const O_LARGEFILE: c_int = 0x00001000; ++pub const O_NOFOLLOW: c_int = 0x00000080; ++ ++pub const HUGETLB_FLAG_ENCODE_SHIFT: u32 = 26; ++pub const MAP_HUGE_SHIFT: u32 = 26; ++ ++// intentionally not public, only used for fd_set ++cfg_if! { ++ if #[cfg(target_pointer_width = "32")] { ++ const ULONG_SIZE: usize = 32; ++ } else if #[cfg(target_pointer_width = "64")] { ++ const ULONG_SIZE: usize = 64; ++ } else { ++ // Unknown target_pointer_width ++ } ++} ++ ++// END_PUB_CONST ++ ++f! { ++ pub fn FD_CLR(fd: c_int, set: *mut fd_set) -> () { ++ let fd = fd as usize; ++ let size = mem::size_of_val(&(*set).fds_bits[0]) * 8; ++ (*set).fds_bits[fd / size] &= !(1 << (fd % size)); ++ return; ++ } ++ ++ pub fn FD_ISSET(fd: c_int, set: *const fd_set) -> bool { ++ let fd = fd as usize; ++ let size = mem::size_of_val(&(*set).fds_bits[0]) * 8; ++ return ((*set).fds_bits[fd / size] & (1 << (fd % size))) != 0; ++ } ++ ++ pub fn FD_SET(fd: c_int, set: *mut fd_set) -> () { ++ let fd = fd as usize; ++ let size = mem::size_of_val(&(*set).fds_bits[0]) * 8; ++ (*set).fds_bits[fd / size] |= 1 << (fd % size); ++ return; ++ } ++ ++ pub fn FD_ZERO(set: *mut fd_set) -> () { ++ for slot in (*set).fds_bits.iter_mut() { ++ *slot = 0; ++ } ++ } ++ ++ pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () { ++ for slot in cpuset.bits.iter_mut() { ++ *slot = 0; ++ } ++ } ++ ++ pub fn CPU_SET(cpu: usize, cpuset: &mut cpu_set_t) -> () { ++ let size_in_bits = 8 * mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc ++ let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits); ++ cpuset.bits[idx] |= 1 << offset; ++ () ++ } ++ ++ pub fn CPU_CLR(cpu: usize, cpuset: &mut cpu_set_t) -> () { ++ let size_in_bits = 8 * mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc ++ let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits); ++ cpuset.bits[idx] &= !(1 << offset); ++ () ++ } ++ ++ pub fn CPU_ISSET(cpu: usize, cpuset: &cpu_set_t) -> bool { ++ let size_in_bits = 8 * mem::size_of_val(&cpuset.bits[0]); ++ let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits); ++ 0 != (cpuset.bits[idx] & (1 << offset)) ++ } ++ ++ pub fn CPU_EQUAL(set1: &cpu_set_t, set2: &cpu_set_t) -> bool { ++ set1.bits == set2.bits ++ } ++ ++ pub fn major(dev: crate::dev_t) -> c_uint { ++ let mut major = 0; ++ major |= (dev & 0x00000000000fff00) >> 8; ++ major |= (dev & 0xfffff00000000000) >> 32; ++ major as c_uint ++ } ++ ++ pub fn minor(dev: crate::dev_t) -> c_uint { ++ let mut minor = 0; ++ minor |= (dev & 0x00000000000000ff) >> 0; ++ minor |= (dev & 0x00000ffffff00000) >> 12; ++ minor as c_uint ++ } ++ ++ pub fn CMSG_DATA(cmsg: *const cmsghdr) -> *mut c_uchar { ++ cmsg.offset(1) as *mut c_uchar ++ } ++ ++ pub fn CMSG_NXTHDR(mhdr: *const msghdr, cmsg: *const cmsghdr) -> *mut cmsghdr { ++ if ((*cmsg).cmsg_len as size_t) < mem::size_of::() { ++ 0 as *mut cmsghdr ++ } else if __CMSG_NEXT(cmsg).add(mem::size_of::()) >= __MHDR_END(mhdr) { ++ 0 as *mut cmsghdr ++ } else { ++ __CMSG_NEXT(cmsg).cast() ++ } ++ } ++ ++ pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr { ++ if (*mhdr).msg_controllen as size_t >= mem::size_of::() { ++ (*mhdr).msg_control.cast() ++ } else { ++ 0 as *mut cmsghdr ++ } ++ } ++ ++ pub {const} fn CMSG_ALIGN(len: size_t) -> size_t { ++ (len + mem::size_of::() - 1) & !(mem::size_of::() - 1) ++ } ++ ++ pub {const} fn CMSG_SPACE(len: c_uint) -> c_uint { ++ (CMSG_ALIGN(len as size_t) + CMSG_ALIGN(mem::size_of::())) as c_uint ++ } ++ ++ pub {const} fn CMSG_LEN(len: c_uint) -> c_uint { ++ (CMSG_ALIGN(mem::size_of::()) + len as size_t) as c_uint ++ } ++} ++ ++safe_f! { ++ pub {const} fn WIFSTOPPED(status: c_int) -> bool { ++ (status & 0xff) == 0x7f ++ } ++ ++ pub {const} fn WSTOPSIG(status: c_int) -> c_int { ++ (status >> 8) & 0xff ++ } ++ ++ pub {const} fn WIFCONTINUED(status: c_int) -> bool { ++ status == 0xffff ++ } ++ ++ pub {const} fn WIFSIGNALED(status: c_int) -> bool { ++ ((status & 0x7f) + 1) as i8 >= 2 ++ } ++ ++ pub {const} fn WTERMSIG(status: c_int) -> c_int { ++ status & 0x7f ++ } ++ ++ pub {const} fn WIFEXITED(status: c_int) -> bool { ++ (status & 0x7f) == 0 ++ } ++ ++ pub {const} fn WEXITSTATUS(status: c_int) -> c_int { ++ (status >> 8) & 0xff ++ } ++ ++ pub {const} fn WCOREDUMP(status: c_int) -> bool { ++ (status & 0x80) != 0 ++ } ++ ++ pub {const} fn QCMD(cmd: c_int, type_: c_int) -> c_int { ++ (cmd << 8) | (type_ & 0x00ff) ++ } ++ ++ pub {const} fn makedev(major: c_uint, minor: c_uint) -> crate::dev_t { ++ let major = major as crate::dev_t; ++ let minor = minor as crate::dev_t; ++ let mut dev = 0; ++ dev |= (major & 0x00000fff) << 8; ++ dev |= (major & 0xfffff000) << 32; ++ dev |= (minor & 0x000000ff) << 0; ++ dev |= (minor & 0xffffff00) << 12; ++ dev ++ } ++} ++ ++fn __CMSG_LEN(cmsg: *const cmsghdr) -> ssize_t { ++ ((unsafe { (*cmsg).cmsg_len as size_t } + mem::size_of::() - 1) ++ & !(mem::size_of::() - 1)) as ssize_t ++} ++ ++fn __CMSG_NEXT(cmsg: *const cmsghdr) -> *mut c_uchar { ++ (unsafe { cmsg.offset(__CMSG_LEN(cmsg)) }) as *mut c_uchar ++} ++ ++fn __MHDR_END(mhdr: *const msghdr) -> *mut c_uchar { ++ unsafe { (*mhdr).msg_control.offset((*mhdr).msg_controllen as isize) }.cast() ++} ++ ++// EXTERN_FN ++ ++#[link(name = "c")] ++#[link(name = "fdio")] ++extern "C" {} ++ ++#[cfg_attr(feature = "extra_traits", derive(Debug))] ++pub enum FILE {} ++impl Copy for FILE {} ++impl Clone for FILE { ++ fn clone(&self) -> FILE { ++ *self ++ } ++} ++#[cfg_attr(feature = "extra_traits", derive(Debug))] ++pub enum fpos_t {} // FIXME: fill this out with a struct ++impl Copy for fpos_t {} ++impl Clone for fpos_t { ++ fn clone(&self) -> fpos_t { ++ *self ++ } ++} ++ ++extern "C" { ++ pub fn isalnum(c: c_int) -> c_int; ++ pub fn isalpha(c: c_int) -> c_int; ++ pub fn iscntrl(c: c_int) -> c_int; ++ pub fn isdigit(c: c_int) -> c_int; ++ pub fn isgraph(c: c_int) -> c_int; ++ pub fn islower(c: c_int) -> c_int; ++ pub fn isprint(c: c_int) -> c_int; ++ pub fn ispunct(c: c_int) -> c_int; ++ pub fn isspace(c: c_int) -> c_int; ++ pub fn isupper(c: c_int) -> c_int; ++ pub fn isxdigit(c: c_int) -> c_int; ++ pub fn isblank(c: c_int) -> c_int; ++ pub fn tolower(c: c_int) -> c_int; ++ pub fn toupper(c: c_int) -> c_int; ++ pub fn fopen(filename: *const c_char, mode: *const c_char) -> *mut FILE; ++ pub fn freopen(filename: *const c_char, mode: *const c_char, file: *mut FILE) -> *mut FILE; ++ pub fn fflush(file: *mut FILE) -> c_int; ++ pub fn fclose(file: *mut FILE) -> c_int; ++ pub fn remove(filename: *const c_char) -> c_int; ++ pub fn rename(oldname: *const c_char, newname: *const c_char) -> c_int; ++ pub fn tmpfile() -> *mut FILE; ++ pub fn setvbuf(stream: *mut FILE, buffer: *mut c_char, mode: c_int, size: size_t) -> c_int; ++ pub fn setbuf(stream: *mut FILE, buf: *mut c_char); ++ pub fn getchar() -> c_int; ++ pub fn putchar(c: c_int) -> c_int; ++ pub fn fgetc(stream: *mut FILE) -> c_int; ++ pub fn fgets(buf: *mut c_char, n: c_int, stream: *mut FILE) -> *mut c_char; ++ pub fn fputc(c: c_int, stream: *mut FILE) -> c_int; ++ pub fn fputs(s: *const c_char, stream: *mut FILE) -> c_int; ++ pub fn puts(s: *const c_char) -> c_int; ++ pub fn ungetc(c: c_int, stream: *mut FILE) -> c_int; ++ pub fn fread(ptr: *mut c_void, size: size_t, nobj: size_t, stream: *mut FILE) -> size_t; ++ pub fn fwrite(ptr: *const c_void, size: size_t, nobj: size_t, stream: *mut FILE) -> size_t; ++ pub fn fseek(stream: *mut FILE, offset: c_long, whence: c_int) -> c_int; ++ pub fn ftell(stream: *mut FILE) -> c_long; ++ pub fn rewind(stream: *mut FILE); ++ pub fn fgetpos(stream: *mut FILE, ptr: *mut fpos_t) -> c_int; ++ pub fn fsetpos(stream: *mut FILE, ptr: *const fpos_t) -> c_int; ++ 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 atof(s: *const c_char) -> c_double; ++ pub fn atoi(s: *const c_char) -> c_int; ++ pub fn atol(s: *const c_char) -> c_long; ++ pub fn atoll(s: *const c_char) -> c_longlong; ++ 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; ++ pub fn strtol(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_long; ++ pub fn strtoll(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_longlong; ++ pub fn strtoul(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulong; ++ pub fn strtoull(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulonglong; ++ pub fn calloc(nobj: size_t, size: size_t) -> *mut c_void; ++ pub fn malloc(size: size_t) -> *mut c_void; ++ pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void; ++ pub fn free(p: *mut c_void); ++ pub fn abort() -> !; ++ pub fn exit(status: c_int) -> !; ++ pub fn _exit(status: c_int) -> !; ++ pub fn atexit(cb: extern "C" fn()) -> c_int; ++ pub fn system(s: *const c_char) -> c_int; ++ pub fn getenv(s: *const c_char) -> *mut c_char; ++ ++ pub fn strcpy(dst: *mut c_char, src: *const c_char) -> *mut c_char; ++ pub fn strncpy(dst: *mut c_char, src: *const c_char, n: size_t) -> *mut c_char; ++ pub fn strcat(s: *mut c_char, ct: *const c_char) -> *mut c_char; ++ pub fn strncat(s: *mut c_char, ct: *const c_char, n: size_t) -> *mut c_char; ++ pub fn strcmp(cs: *const c_char, ct: *const c_char) -> c_int; ++ pub fn strncmp(cs: *const c_char, ct: *const c_char, n: size_t) -> c_int; ++ pub fn strcoll(cs: *const c_char, ct: *const c_char) -> c_int; ++ pub fn strchr(cs: *const c_char, c: c_int) -> *mut c_char; ++ pub fn strrchr(cs: *const c_char, c: c_int) -> *mut c_char; ++ pub fn strspn(cs: *const c_char, ct: *const c_char) -> size_t; ++ pub fn strcspn(cs: *const c_char, ct: *const c_char) -> size_t; ++ pub fn strdup(cs: *const c_char) -> *mut c_char; ++ pub fn strpbrk(cs: *const c_char, ct: *const c_char) -> *mut c_char; ++ pub fn strstr(cs: *const c_char, ct: *const c_char) -> *mut c_char; ++ pub fn strlen(cs: *const c_char) -> size_t; ++ pub fn strnlen(cs: *const c_char, maxlen: size_t) -> size_t; ++ pub fn strerror(n: c_int) -> *mut c_char; ++ pub fn strtok(s: *mut c_char, t: *const c_char) -> *mut c_char; ++ pub fn strxfrm(s: *mut c_char, ct: *const c_char, n: size_t) -> size_t; ++ pub fn wcslen(buf: *const wchar_t) -> size_t; ++ pub fn wcstombs(dest: *mut c_char, src: *const wchar_t, n: size_t) -> size_t; ++ ++ pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void; ++ pub fn wmemchr(cx: *const wchar_t, c: wchar_t, n: size_t) -> *mut wchar_t; ++ pub fn memcmp(cx: *const c_void, ct: *const c_void, n: size_t) -> c_int; ++ pub fn memcpy(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void; ++ pub fn memmove(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void; ++ pub fn memset(dest: *mut c_void, c: c_int, n: size_t) -> *mut c_void; ++ ++ pub fn abs(i: c_int) -> c_int; ++ pub fn labs(i: c_long) -> c_long; ++ pub fn rand() -> c_int; ++ pub fn srand(seed: c_uint); ++ ++ pub fn getpwnam(name: *const c_char) -> *mut passwd; ++ pub fn getpwuid(uid: crate::uid_t) -> *mut passwd; ++ ++ pub fn fprintf(stream: *mut crate::FILE, format: *const c_char, ...) -> c_int; ++ pub fn printf(format: *const c_char, ...) -> c_int; ++ pub fn snprintf(s: *mut c_char, n: size_t, format: *const c_char, ...) -> c_int; ++ pub fn sprintf(s: *mut c_char, format: *const c_char, ...) -> c_int; ++ pub fn fscanf(stream: *mut crate::FILE, format: *const c_char, ...) -> c_int; ++ pub fn scanf(format: *const c_char, ...) -> c_int; ++ pub fn sscanf(s: *const c_char, format: *const c_char, ...) -> c_int; ++ pub fn getchar_unlocked() -> c_int; ++ pub fn putchar_unlocked(c: c_int) -> c_int; ++ ++ pub fn socket(domain: c_int, ty: c_int, protocol: c_int) -> c_int; ++ pub fn connect(socket: c_int, address: *const sockaddr, len: socklen_t) -> c_int; ++ pub fn listen(socket: c_int, backlog: c_int) -> c_int; ++ pub fn accept(socket: c_int, address: *mut sockaddr, address_len: *mut socklen_t) -> c_int; ++ pub fn getpeername(socket: c_int, address: *mut sockaddr, address_len: *mut socklen_t) ++ -> c_int; ++ pub fn getsockname(socket: c_int, address: *mut sockaddr, address_len: *mut socklen_t) ++ -> c_int; ++ pub fn setsockopt( ++ socket: c_int, ++ level: c_int, ++ name: c_int, ++ value: *const c_void, ++ option_len: socklen_t, ++ ) -> c_int; ++ pub fn socketpair( ++ domain: c_int, ++ type_: c_int, ++ protocol: c_int, ++ socket_vector: *mut c_int, ++ ) -> c_int; ++ pub fn sendto( ++ socket: c_int, ++ buf: *const c_void, ++ len: size_t, ++ flags: c_int, ++ addr: *const sockaddr, ++ addrlen: socklen_t, ++ ) -> ssize_t; ++ pub fn shutdown(socket: c_int, how: c_int) -> c_int; ++ ++ pub fn chmod(path: *const c_char, mode: mode_t) -> c_int; ++ pub fn fchmod(fd: c_int, mode: mode_t) -> c_int; ++ ++ pub fn fstat(fildes: c_int, buf: *mut stat) -> c_int; ++ ++ pub fn mkdir(path: *const c_char, mode: mode_t) -> c_int; ++ ++ pub fn stat(path: *const c_char, buf: *mut stat) -> c_int; ++ ++ pub fn pclose(stream: *mut crate::FILE) -> c_int; ++ pub fn fdopen(fd: c_int, mode: *const c_char) -> *mut crate::FILE; ++ pub fn fileno(stream: *mut crate::FILE) -> c_int; ++ ++ pub fn open(path: *const c_char, oflag: c_int, ...) -> c_int; ++ pub fn creat(path: *const c_char, mode: mode_t) -> c_int; ++ pub fn fcntl(fd: c_int, cmd: c_int, ...) -> c_int; ++ ++ pub fn opendir(dirname: *const c_char) -> *mut crate::DIR; ++ pub fn readdir(dirp: *mut crate::DIR) -> *mut crate::dirent; ++ pub fn readdir_r( ++ dirp: *mut crate::DIR, ++ entry: *mut crate::dirent, ++ result: *mut *mut crate::dirent, ++ ) -> c_int; ++ pub fn closedir(dirp: *mut crate::DIR) -> c_int; ++ pub fn rewinddir(dirp: *mut crate::DIR); ++ ++ pub fn openat(dirfd: c_int, pathname: *const c_char, flags: c_int, ...) -> c_int; ++ pub fn fchmodat( ++ dirfd: c_int, ++ pathname: *const c_char, ++ mode: crate::mode_t, ++ flags: c_int, ++ ) -> c_int; ++ pub fn fchown(fd: c_int, owner: crate::uid_t, group: crate::gid_t) -> c_int; ++ pub fn fchownat( ++ dirfd: c_int, ++ pathname: *const c_char, ++ owner: crate::uid_t, ++ group: crate::gid_t, ++ flags: c_int, ++ ) -> c_int; ++ pub fn fstatat(dirfd: c_int, pathname: *const c_char, buf: *mut stat, flags: c_int) -> c_int; ++ pub fn linkat( ++ olddirfd: c_int, ++ oldpath: *const c_char, ++ newdirfd: c_int, ++ newpath: *const c_char, ++ flags: c_int, ++ ) -> c_int; ++ pub fn mkdirat(dirfd: c_int, pathname: *const c_char, mode: crate::mode_t) -> c_int; ++ pub fn readlinkat( ++ dirfd: c_int, ++ pathname: *const c_char, ++ buf: *mut c_char, ++ bufsiz: size_t, ++ ) -> ssize_t; ++ pub fn renameat( ++ olddirfd: c_int, ++ oldpath: *const c_char, ++ newdirfd: c_int, ++ newpath: *const c_char, ++ ) -> c_int; ++ pub fn symlinkat(target: *const c_char, newdirfd: c_int, linkpath: *const c_char) -> c_int; ++ pub fn unlinkat(dirfd: c_int, pathname: *const c_char, flags: c_int) -> c_int; ++ ++ pub fn access(path: *const c_char, amode: c_int) -> c_int; ++ pub fn alarm(seconds: c_uint) -> c_uint; ++ pub fn chdir(dir: *const c_char) -> c_int; ++ pub fn chown(path: *const c_char, uid: uid_t, gid: gid_t) -> c_int; ++ pub fn lchown(path: *const c_char, uid: uid_t, gid: gid_t) -> c_int; ++ pub fn close(fd: c_int) -> c_int; ++ pub fn dup(fd: c_int) -> c_int; ++ pub fn dup2(src: c_int, dst: c_int) -> c_int; ++ ++ pub fn execl(path: *const c_char, arg0: *const c_char, ...) -> c_int; ++ pub fn execle(path: *const c_char, arg0: *const c_char, ...) -> c_int; ++ pub fn execlp(file: *const c_char, arg0: *const c_char, ...) -> c_int; ++ ++ // DIFF(main): changed to `*const *mut` in e77f551de9 ++ pub fn execv(prog: *const c_char, argv: *const *const c_char) -> c_int; ++ pub fn execve( ++ prog: *const c_char, ++ argv: *const *const c_char, ++ envp: *const *const c_char, ++ ) -> c_int; ++ pub fn execvp(c: *const c_char, argv: *const *const c_char) -> c_int; ++ ++ pub fn fork() -> pid_t; ++ pub fn fpathconf(filedes: c_int, name: c_int) -> c_long; ++ pub fn getcwd(buf: *mut c_char, size: size_t) -> *mut c_char; ++ pub fn getegid() -> gid_t; ++ pub fn geteuid() -> uid_t; ++ pub fn getgid() -> gid_t; ++ pub fn getgroups(ngroups_max: c_int, groups: *mut gid_t) -> c_int; ++ pub fn getlogin() -> *mut c_char; ++ pub fn getopt(argc: c_int, argv: *const *mut c_char, optstr: *const c_char) -> c_int; ++ pub fn getpgid(pid: pid_t) -> pid_t; ++ pub fn getpgrp() -> pid_t; ++ pub fn getpid() -> pid_t; ++ pub fn getppid() -> pid_t; ++ pub fn getuid() -> uid_t; ++ pub fn isatty(fd: c_int) -> c_int; ++ pub fn link(src: *const c_char, dst: *const c_char) -> c_int; ++ pub fn lseek(fd: c_int, offset: off_t, whence: c_int) -> off_t; ++ pub fn pathconf(path: *const c_char, name: c_int) -> c_long; ++ pub fn pause() -> c_int; ++ pub fn pipe(fds: *mut c_int) -> c_int; ++ pub fn posix_memalign(memptr: *mut *mut c_void, align: size_t, size: size_t) -> c_int; ++ pub fn read(fd: c_int, buf: *mut c_void, count: size_t) -> ssize_t; ++ pub fn rmdir(path: *const c_char) -> c_int; ++ pub fn seteuid(uid: uid_t) -> c_int; ++ pub fn setegid(gid: gid_t) -> c_int; ++ pub fn setgid(gid: gid_t) -> c_int; ++ 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 sleep(secs: c_uint) -> c_uint; ++ pub fn nanosleep(rqtp: *const timespec, rmtp: *mut timespec) -> c_int; ++ pub fn tcgetpgrp(fd: c_int) -> pid_t; ++ pub fn tcsetpgrp(fd: c_int, pgrp: crate::pid_t) -> c_int; ++ pub fn ttyname(fd: c_int) -> *mut c_char; ++ pub fn unlink(c: *const c_char) -> c_int; ++ pub fn wait(status: *mut c_int) -> pid_t; ++ pub fn waitpid(pid: pid_t, status: *mut c_int, options: c_int) -> pid_t; ++ pub fn write(fd: c_int, buf: *const c_void, count: size_t) -> ssize_t; ++ pub fn pread(fd: c_int, buf: *mut c_void, count: size_t, offset: off_t) -> ssize_t; ++ pub fn pwrite(fd: c_int, buf: *const c_void, count: size_t, offset: off_t) -> ssize_t; ++ pub fn umask(mask: mode_t) -> mode_t; ++ ++ pub fn utime(file: *const c_char, buf: *const utimbuf) -> c_int; ++ ++ pub fn kill(pid: pid_t, sig: c_int) -> c_int; ++ ++ pub fn mlock(addr: *const c_void, len: size_t) -> c_int; ++ pub fn munlock(addr: *const c_void, len: size_t) -> c_int; ++ pub fn mlockall(flags: c_int) -> c_int; ++ pub fn munlockall() -> c_int; ++ ++ pub fn mmap( ++ addr: *mut c_void, ++ len: size_t, ++ prot: c_int, ++ flags: c_int, ++ fd: c_int, ++ offset: off_t, ++ ) -> *mut c_void; ++ pub fn munmap(addr: *mut c_void, len: size_t) -> c_int; ++ ++ pub fn if_nametoindex(ifname: *const c_char) -> c_uint; ++ pub fn if_indextoname(ifindex: c_uint, ifname: *mut c_char) -> *mut c_char; ++ ++ pub fn lstat(path: *const c_char, buf: *mut stat) -> c_int; ++ ++ pub fn fsync(fd: c_int) -> c_int; ++ ++ pub fn setenv(name: *const c_char, val: *const c_char, overwrite: c_int) -> c_int; ++ pub fn unsetenv(name: *const c_char) -> c_int; ++ ++ pub fn symlink(path1: *const c_char, path2: *const c_char) -> c_int; ++ ++ pub fn ftruncate(fd: c_int, length: off_t) -> c_int; ++ ++ pub fn signal(signum: c_int, handler: sighandler_t) -> sighandler_t; ++ ++ pub fn realpath(pathname: *const c_char, resolved: *mut c_char) -> *mut c_char; ++ ++ pub fn flock(fd: c_int, operation: c_int) -> c_int; ++ ++ pub fn gettimeofday(tp: *mut crate::timeval, tz: *mut c_void) -> c_int; ++ pub fn times(buf: *mut crate::tms) -> crate::clock_t; ++ ++ pub fn pthread_self() -> crate::pthread_t; ++ pub fn pthread_join(native: crate::pthread_t, value: *mut *mut c_void) -> c_int; ++ pub fn pthread_exit(value: *mut c_void) -> !; ++ pub fn pthread_attr_init(attr: *mut crate::pthread_attr_t) -> c_int; ++ pub fn pthread_attr_destroy(attr: *mut crate::pthread_attr_t) -> c_int; ++ pub fn pthread_attr_getstacksize( ++ attr: *const crate::pthread_attr_t, ++ stacksize: *mut size_t, ++ ) -> c_int; ++ pub fn pthread_attr_setstacksize(attr: *mut crate::pthread_attr_t, stack_size: size_t) ++ -> c_int; ++ pub fn pthread_attr_setdetachstate(attr: *mut crate::pthread_attr_t, state: c_int) -> c_int; ++ pub fn pthread_detach(thread: crate::pthread_t) -> c_int; ++ pub fn sched_yield() -> c_int; ++ pub fn pthread_key_create( ++ key: *mut pthread_key_t, ++ dtor: Option, ++ ) -> c_int; ++ pub fn pthread_key_delete(key: pthread_key_t) -> c_int; ++ pub fn pthread_getspecific(key: pthread_key_t) -> *mut c_void; ++ pub fn pthread_setspecific(key: pthread_key_t, value: *const c_void) -> c_int; ++ pub fn pthread_mutex_init( ++ lock: *mut pthread_mutex_t, ++ attr: *const pthread_mutexattr_t, ++ ) -> c_int; ++ pub fn pthread_mutex_destroy(lock: *mut pthread_mutex_t) -> c_int; ++ pub fn pthread_mutex_lock(lock: *mut pthread_mutex_t) -> c_int; ++ pub fn pthread_mutex_trylock(lock: *mut pthread_mutex_t) -> c_int; ++ pub fn pthread_mutex_unlock(lock: *mut pthread_mutex_t) -> c_int; ++ ++ pub fn pthread_mutexattr_init(attr: *mut pthread_mutexattr_t) -> c_int; ++ pub fn pthread_mutexattr_destroy(attr: *mut pthread_mutexattr_t) -> c_int; ++ pub fn pthread_mutexattr_settype(attr: *mut pthread_mutexattr_t, _type: c_int) -> c_int; ++ ++ pub fn pthread_cond_init(cond: *mut pthread_cond_t, attr: *const pthread_condattr_t) -> c_int; ++ pub fn pthread_cond_wait(cond: *mut pthread_cond_t, lock: *mut pthread_mutex_t) -> c_int; ++ pub fn pthread_cond_timedwait( ++ cond: *mut pthread_cond_t, ++ lock: *mut pthread_mutex_t, ++ abstime: *const crate::timespec, ++ ) -> c_int; ++ pub fn pthread_cond_signal(cond: *mut pthread_cond_t) -> c_int; ++ pub fn pthread_cond_broadcast(cond: *mut pthread_cond_t) -> c_int; ++ pub fn pthread_cond_destroy(cond: *mut pthread_cond_t) -> c_int; ++ pub fn pthread_condattr_init(attr: *mut pthread_condattr_t) -> c_int; ++ pub fn pthread_condattr_destroy(attr: *mut pthread_condattr_t) -> c_int; ++ pub fn pthread_rwlock_init( ++ lock: *mut pthread_rwlock_t, ++ attr: *const pthread_rwlockattr_t, ++ ) -> c_int; ++ pub fn pthread_rwlock_destroy(lock: *mut pthread_rwlock_t) -> c_int; ++ pub fn pthread_rwlock_rdlock(lock: *mut pthread_rwlock_t) -> c_int; ++ pub fn pthread_rwlock_tryrdlock(lock: *mut pthread_rwlock_t) -> c_int; ++ pub fn pthread_rwlock_wrlock(lock: *mut pthread_rwlock_t) -> c_int; ++ pub fn pthread_rwlock_trywrlock(lock: *mut pthread_rwlock_t) -> c_int; ++ pub fn pthread_rwlock_unlock(lock: *mut pthread_rwlock_t) -> c_int; ++ pub fn pthread_rwlockattr_init(attr: *mut pthread_rwlockattr_t) -> c_int; ++ pub fn pthread_rwlockattr_destroy(attr: *mut pthread_rwlockattr_t) -> c_int; ++ pub fn pthread_getname_np(thread: crate::pthread_t, name: *mut c_char, len: size_t) -> c_int; ++ pub fn pthread_setname_np(thread: crate::pthread_t, name: *const c_char) -> c_int; ++ pub fn strerror_r(errnum: c_int, buf: *mut c_char, buflen: size_t) -> c_int; ++ ++ pub fn getsockopt( ++ sockfd: c_int, ++ level: c_int, ++ optname: c_int, ++ optval: *mut c_void, ++ optlen: *mut crate::socklen_t, ++ ) -> c_int; ++ pub fn raise(signum: c_int) -> c_int; ++ pub fn sigaction(signum: c_int, act: *const sigaction, oldact: *mut sigaction) -> c_int; ++ ++ pub fn utimes(filename: *const c_char, times: *const crate::timeval) -> c_int; ++ pub fn dlopen(filename: *const c_char, flag: c_int) -> *mut c_void; ++ pub fn dlerror() -> *mut c_char; ++ pub fn dlsym(handle: *mut c_void, symbol: *const c_char) -> *mut c_void; ++ pub fn dlclose(handle: *mut c_void) -> c_int; ++ pub fn dladdr(addr: *const c_void, info: *mut Dl_info) -> c_int; ++ ++ pub fn getaddrinfo( ++ node: *const c_char, ++ service: *const c_char, ++ hints: *const addrinfo, ++ res: *mut *mut addrinfo, ++ ) -> c_int; ++ pub fn freeaddrinfo(res: *mut addrinfo); ++ pub fn gai_strerror(errcode: c_int) -> *const c_char; ++ pub fn res_init() -> c_int; ++ ++ pub fn gmtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm; ++ pub fn localtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm; ++ pub fn mktime(tm: *mut tm) -> time_t; ++ pub fn time(time: *mut time_t) -> time_t; ++ pub fn gmtime(time_p: *const time_t) -> *mut tm; ++ pub fn localtime(time_p: *const time_t) -> *mut tm; ++ ++ pub fn mknod(pathname: *const c_char, mode: crate::mode_t, dev: crate::dev_t) -> c_int; ++ pub fn uname(buf: *mut crate::utsname) -> c_int; ++ pub fn gethostname(name: *mut c_char, len: size_t) -> c_int; ++ pub fn getservbyname(name: *const c_char, proto: *const c_char) -> *mut servent; ++ pub fn getprotobyname(name: *const c_char) -> *mut protoent; ++ pub fn getprotobynumber(proto: c_int) -> *mut protoent; ++ pub fn usleep(secs: c_uint) -> c_int; ++ pub fn send(socket: c_int, buf: *const c_void, len: size_t, flags: c_int) -> ssize_t; ++ pub fn recv(socket: c_int, buf: *mut c_void, len: size_t, flags: c_int) -> ssize_t; ++ pub fn putenv(string: *mut c_char) -> c_int; ++ pub fn poll(fds: *mut pollfd, nfds: nfds_t, timeout: c_int) -> c_int; ++ pub fn select( ++ nfds: c_int, ++ readfds: *mut fd_set, ++ writefds: *mut fd_set, ++ errorfds: *mut fd_set, ++ timeout: *mut timeval, ++ ) -> c_int; ++ pub fn setlocale(category: c_int, locale: *const c_char) -> *mut c_char; ++ pub fn localeconv() -> *mut lconv; ++ ++ pub fn sem_destroy(sem: *mut sem_t) -> c_int; ++ pub fn sem_wait(sem: *mut sem_t) -> c_int; ++ pub fn sem_trywait(sem: *mut sem_t) -> c_int; ++ pub fn sem_post(sem: *mut sem_t) -> c_int; ++ pub fn sem_init(sem: *mut sem_t, pshared: c_int, value: c_uint) -> c_int; ++ pub fn statvfs(path: *const c_char, buf: *mut statvfs) -> c_int; ++ pub fn fstatvfs(fd: c_int, buf: *mut statvfs) -> c_int; ++ ++ pub fn readlink(path: *const c_char, buf: *mut c_char, bufsz: size_t) -> ssize_t; ++ ++ pub fn sigemptyset(set: *mut sigset_t) -> c_int; ++ pub fn sigaddset(set: *mut sigset_t, signum: c_int) -> c_int; ++ pub fn sigfillset(set: *mut sigset_t) -> c_int; ++ pub fn sigdelset(set: *mut sigset_t, signum: c_int) -> c_int; ++ pub fn sigismember(set: *const sigset_t, signum: c_int) -> c_int; ++ ++ pub fn sigprocmask(how: c_int, set: *const sigset_t, oldset: *mut sigset_t) -> c_int; ++ pub fn sigpending(set: *mut sigset_t) -> c_int; ++ ++ pub fn timegm(tm: *mut crate::tm) -> time_t; ++ ++ pub fn getsid(pid: pid_t) -> pid_t; ++ ++ pub fn sysconf(name: c_int) -> c_long; ++ ++ pub fn mkfifo(path: *const c_char, mode: mode_t) -> c_int; ++ ++ pub fn pselect( ++ nfds: c_int, ++ readfds: *mut fd_set, ++ writefds: *mut fd_set, ++ errorfds: *mut fd_set, ++ timeout: *const timespec, ++ sigmask: *const sigset_t, ++ ) -> c_int; ++ pub fn fseeko(stream: *mut crate::FILE, offset: off_t, whence: c_int) -> c_int; ++ pub fn ftello(stream: *mut crate::FILE) -> off_t; ++ pub fn tcdrain(fd: c_int) -> c_int; ++ pub fn cfgetispeed(termios: *const crate::termios) -> crate::speed_t; ++ pub fn cfgetospeed(termios: *const crate::termios) -> crate::speed_t; ++ pub fn cfmakeraw(termios: *mut crate::termios); ++ pub fn cfsetispeed(termios: *mut crate::termios, speed: crate::speed_t) -> c_int; ++ pub fn cfsetospeed(termios: *mut crate::termios, speed: crate::speed_t) -> c_int; ++ pub fn cfsetspeed(termios: *mut crate::termios, speed: crate::speed_t) -> c_int; ++ pub fn tcgetattr(fd: c_int, termios: *mut crate::termios) -> c_int; ++ pub fn tcsetattr(fd: c_int, optional_actions: c_int, termios: *const crate::termios) -> c_int; ++ pub fn tcflow(fd: c_int, action: c_int) -> c_int; ++ pub fn tcflush(fd: c_int, action: c_int) -> c_int; ++ pub fn tcgetsid(fd: c_int) -> crate::pid_t; ++ pub fn tcsendbreak(fd: c_int, duration: c_int) -> c_int; ++ pub fn mkstemp(template: *mut c_char) -> c_int; ++ pub fn mkdtemp(template: *mut c_char) -> *mut c_char; ++ ++ pub fn tmpnam(ptr: *mut c_char) -> *mut c_char; ++ ++ pub fn openlog(ident: *const c_char, logopt: c_int, facility: c_int); ++ pub fn closelog(); ++ pub fn setlogmask(maskpri: c_int) -> c_int; ++ pub fn syslog(priority: c_int, message: *const c_char, ...); ++ ++ pub fn grantpt(fd: c_int) -> c_int; ++ pub fn posix_openpt(flags: c_int) -> c_int; ++ pub fn ptsname(fd: c_int) -> *mut c_char; ++ pub fn unlockpt(fd: c_int) -> c_int; ++ ++ pub fn fdatasync(fd: c_int) -> c_int; ++ pub fn clock_getres(clk_id: crate::clockid_t, tp: *mut crate::timespec) -> c_int; ++ pub fn clock_gettime(clk_id: crate::clockid_t, tp: *mut crate::timespec) -> c_int; ++ pub fn clock_settime(clk_id: crate::clockid_t, tp: *const crate::timespec) -> c_int; ++ pub fn dirfd(dirp: *mut crate::DIR) -> c_int; ++ ++ pub fn pthread_getattr_np(native: crate::pthread_t, attr: *mut crate::pthread_attr_t) -> c_int; ++ pub fn pthread_attr_getstack( ++ attr: *const crate::pthread_attr_t, ++ stackaddr: *mut *mut c_void, ++ stacksize: *mut size_t, ++ ) -> c_int; ++ pub fn memalign(align: size_t, size: size_t) -> *mut c_void; ++ pub fn setgroups(ngroups: size_t, ptr: *const crate::gid_t) -> c_int; ++ pub fn pipe2(fds: *mut c_int, flags: c_int) -> c_int; ++ pub fn statfs(path: *const c_char, buf: *mut statfs) -> c_int; ++ pub fn fstatfs(fd: c_int, buf: *mut statfs) -> c_int; ++ pub fn memrchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void; ++ ++ pub fn posix_fadvise(fd: c_int, offset: off_t, len: off_t, advise: c_int) -> c_int; ++ pub fn futimens(fd: c_int, times: *const crate::timespec) -> c_int; ++ pub fn utimensat( ++ dirfd: c_int, ++ path: *const c_char, ++ times: *const crate::timespec, ++ flag: c_int, ++ ) -> c_int; ++ pub fn duplocale(base: crate::locale_t) -> crate::locale_t; ++ pub fn freelocale(loc: crate::locale_t); ++ pub fn newlocale(mask: c_int, locale: *const c_char, base: crate::locale_t) -> crate::locale_t; ++ pub fn uselocale(loc: crate::locale_t) -> crate::locale_t; ++ ++ pub fn fdopendir(fd: c_int) -> *mut crate::DIR; ++ ++ pub fn mknodat(dirfd: c_int, pathname: *const c_char, mode: crate::mode_t, dev: dev_t) ++ -> c_int; ++ pub fn pthread_condattr_getclock( ++ attr: *const pthread_condattr_t, ++ clock_id: *mut clockid_t, ++ ) -> c_int; ++ pub fn pthread_condattr_setclock( ++ attr: *mut pthread_condattr_t, ++ clock_id: crate::clockid_t, ++ ) -> c_int; ++ pub fn accept4( ++ fd: c_int, ++ addr: *mut crate::sockaddr, ++ len: *mut crate::socklen_t, ++ flg: c_int, ++ ) -> c_int; ++ pub fn ptsname_r(fd: c_int, buf: *mut c_char, buflen: size_t) -> c_int; ++ pub fn clearenv() -> c_int; ++ pub fn waitid( ++ idtype: idtype_t, ++ id: id_t, ++ infop: *mut crate::siginfo_t, ++ options: c_int, ++ ) -> c_int; ++ pub fn setreuid(ruid: crate::uid_t, euid: crate::uid_t) -> c_int; ++ pub fn setregid(rgid: crate::gid_t, egid: crate::gid_t) -> c_int; ++ pub fn getresuid( ++ ruid: *mut crate::uid_t, ++ euid: *mut crate::uid_t, ++ suid: *mut crate::uid_t, ++ ) -> c_int; ++ pub fn getresgid( ++ rgid: *mut crate::gid_t, ++ egid: *mut crate::gid_t, ++ sgid: *mut crate::gid_t, ++ ) -> c_int; ++ pub fn acct(filename: *const c_char) -> c_int; ++ pub fn brk(addr: *mut c_void) -> c_int; ++ pub fn setresgid(rgid: crate::gid_t, egid: crate::gid_t, sgid: crate::gid_t) -> c_int; ++ pub fn setresuid(ruid: crate::uid_t, euid: crate::uid_t, suid: crate::uid_t) -> c_int; ++ pub fn openpty( ++ amaster: *mut c_int, ++ aslave: *mut c_int, ++ name: *mut c_char, ++ termp: *const termios, ++ winp: *const crate::winsize, ++ ) -> c_int; ++ ++ // DIFF(main): changed to `*const *mut` in e77f551de9 ++ pub fn execvpe( ++ file: *const c_char, ++ argv: *const *const c_char, ++ envp: *const *const c_char, ++ ) -> c_int; ++ pub fn fexecve(fd: c_int, argv: *const *const c_char, envp: *const *const c_char) -> c_int; ++ ++ pub fn ioctl(fd: c_int, request: c_int, ...) -> c_int; ++ ++ pub fn lutimes(file: *const c_char, times: *const crate::timeval) -> c_int; ++ ++ pub fn setpwent(); ++ pub fn endpwent(); ++ pub fn getpwent() -> *mut passwd; ++ ++ pub fn shm_open(name: *const c_char, oflag: c_int, mode: mode_t) -> c_int; ++ ++ // System V IPC ++ pub fn shmget(key: crate::key_t, size: size_t, shmflg: c_int) -> c_int; ++ pub fn shmat(shmid: c_int, shmaddr: *const c_void, shmflg: c_int) -> *mut c_void; ++ pub fn shmdt(shmaddr: *const c_void) -> c_int; ++ pub fn shmctl(shmid: c_int, cmd: c_int, buf: *mut crate::shmid_ds) -> c_int; ++ pub fn ftok(pathname: *const c_char, proj_id: c_int) -> crate::key_t; ++ pub fn semget(key: crate::key_t, nsems: c_int, semflag: c_int) -> c_int; ++ pub fn semop(semid: c_int, sops: *mut crate::sembuf, nsops: size_t) -> c_int; ++ pub fn semctl(semid: c_int, semnum: c_int, cmd: c_int, ...) -> c_int; ++ pub fn msgctl(msqid: c_int, cmd: c_int, buf: *mut msqid_ds) -> c_int; ++ pub fn msgget(key: crate::key_t, msgflg: c_int) -> c_int; ++ pub fn msgrcv( ++ msqid: c_int, ++ msgp: *mut c_void, ++ msgsz: size_t, ++ msgtyp: c_long, ++ msgflg: c_int, ++ ) -> ssize_t; ++ pub fn msgsnd(msqid: c_int, msgp: *const c_void, msgsz: size_t, msgflg: c_int) -> c_int; ++ ++ pub fn mprotect(addr: *mut c_void, len: size_t, prot: c_int) -> c_int; ++ pub fn __errno_location() -> *mut c_int; ++ ++ pub fn fallocate(fd: c_int, mode: c_int, offset: off_t, len: off_t) -> c_int; ++ pub fn posix_fallocate(fd: c_int, offset: off_t, len: off_t) -> c_int; ++ pub fn readahead(fd: c_int, offset: off64_t, count: size_t) -> ssize_t; ++ pub fn signalfd(fd: c_int, mask: *const crate::sigset_t, flags: c_int) -> c_int; ++ pub fn timerfd_create(clockid: c_int, flags: c_int) -> c_int; ++ pub fn timerfd_gettime(fd: c_int, curr_value: *mut itimerspec) -> c_int; ++ pub fn timerfd_settime( ++ fd: c_int, ++ flags: c_int, ++ new_value: *const itimerspec, ++ old_value: *mut itimerspec, ++ ) -> c_int; ++ pub fn pwritev(fd: c_int, iov: *const crate::iovec, iovcnt: c_int, offset: off_t) -> ssize_t; ++ pub fn preadv(fd: c_int, iov: *const crate::iovec, iovcnt: c_int, offset: off_t) -> ssize_t; ++ pub fn quotactl(cmd: c_int, special: *const c_char, id: c_int, data: *mut c_char) -> c_int; ++ pub fn dup3(oldfd: c_int, newfd: c_int, flags: c_int) -> c_int; ++ pub fn mkostemp(template: *mut c_char, flags: c_int) -> c_int; ++ pub fn mkostemps(template: *mut c_char, suffixlen: c_int, flags: c_int) -> c_int; ++ pub fn sigtimedwait( ++ set: *const sigset_t, ++ info: *mut siginfo_t, ++ timeout: *const crate::timespec, ++ ) -> c_int; ++ pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> c_int; ++ pub fn nl_langinfo_l(item: crate::nl_item, locale: crate::locale_t) -> *mut c_char; ++ pub fn getnameinfo( ++ sa: *const crate::sockaddr, ++ salen: crate::socklen_t, ++ host: *mut c_char, ++ hostlen: crate::socklen_t, ++ serv: *mut c_char, ++ servlen: crate::socklen_t, ++ flags: c_int, ++ ) -> c_int; ++ pub fn reboot(how_to: c_int) -> c_int; ++ pub fn setfsgid(gid: crate::gid_t) -> c_int; ++ pub fn setfsuid(uid: crate::uid_t) -> c_int; ++ ++ // Not available now on Android ++ pub fn mkfifoat(dirfd: c_int, pathname: *const c_char, mode: crate::mode_t) -> c_int; ++ pub fn if_nameindex() -> *mut if_nameindex; ++ pub fn if_freenameindex(ptr: *mut if_nameindex); ++ pub fn sync_file_range(fd: c_int, offset: off64_t, nbytes: off64_t, flags: c_uint) -> c_int; ++ pub fn getifaddrs(ifap: *mut *mut crate::ifaddrs) -> c_int; ++ pub fn freeifaddrs(ifa: *mut crate::ifaddrs); ++ ++ pub fn glob( ++ pattern: *const c_char, ++ flags: c_int, ++ errfunc: Option c_int>, ++ pglob: *mut crate::glob_t, ++ ) -> c_int; ++ pub fn globfree(pglob: *mut crate::glob_t); ++ ++ pub fn posix_madvise(addr: *mut c_void, len: size_t, advice: c_int) -> c_int; ++ ++ pub fn shm_unlink(name: *const c_char) -> c_int; ++ ++ pub fn seekdir(dirp: *mut crate::DIR, loc: c_long); ++ ++ pub fn telldir(dirp: *mut crate::DIR) -> c_long; ++ pub fn madvise(addr: *mut c_void, len: size_t, advice: c_int) -> c_int; ++ ++ pub fn msync(addr: *mut c_void, len: size_t, flags: c_int) -> c_int; ++ ++ pub fn recvfrom( ++ socket: c_int, ++ buf: *mut c_void, ++ len: size_t, ++ flags: c_int, ++ addr: *mut crate::sockaddr, ++ addrlen: *mut crate::socklen_t, ++ ) -> ssize_t; ++ pub fn mkstemps(template: *mut c_char, suffixlen: c_int) -> c_int; ++ pub fn futimes(fd: c_int, times: *const crate::timeval) -> c_int; ++ pub fn nl_langinfo(item: crate::nl_item) -> *mut c_char; ++ ++ pub fn bind( ++ socket: c_int, ++ address: *const crate::sockaddr, ++ address_len: crate::socklen_t, ++ ) -> c_int; ++ ++ pub fn writev(fd: c_int, iov: *const crate::iovec, iovcnt: c_int) -> ssize_t; ++ pub fn readv(fd: c_int, iov: *const crate::iovec, iovcnt: c_int) -> ssize_t; ++ ++ pub fn sendmsg(fd: c_int, msg: *const crate::msghdr, flags: c_int) -> ssize_t; ++ pub fn recvmsg(fd: c_int, msg: *mut crate::msghdr, flags: c_int) -> ssize_t; ++ pub fn getdomainname(name: *mut c_char, len: size_t) -> c_int; ++ pub fn setdomainname(name: *const c_char, len: size_t) -> c_int; ++ pub fn vhangup() -> c_int; ++ pub fn sendmmsg(sockfd: c_int, msgvec: *mut mmsghdr, vlen: c_uint, flags: c_int) -> c_int; ++ pub fn recvmmsg( ++ sockfd: c_int, ++ msgvec: *mut mmsghdr, ++ vlen: c_uint, ++ flags: c_int, ++ timeout: *mut crate::timespec, ++ ) -> c_int; ++ pub fn sync(); ++ pub fn syscall(num: c_long, ...) -> c_long; ++ pub fn sched_getaffinity( ++ pid: crate::pid_t, ++ cpusetsize: size_t, ++ cpuset: *mut cpu_set_t, ++ ) -> c_int; ++ pub fn sched_setaffinity( ++ pid: crate::pid_t, ++ cpusetsize: size_t, ++ cpuset: *const cpu_set_t, ++ ) -> c_int; ++ pub fn umount(target: *const c_char) -> c_int; ++ pub fn sched_get_priority_max(policy: c_int) -> c_int; ++ pub fn tee(fd_in: c_int, fd_out: c_int, len: size_t, flags: c_uint) -> ssize_t; ++ pub fn settimeofday(tv: *const crate::timeval, tz: *const crate::timezone) -> c_int; ++ pub fn splice( ++ fd_in: c_int, ++ off_in: *mut crate::loff_t, ++ fd_out: c_int, ++ off_out: *mut crate::loff_t, ++ len: size_t, ++ flags: c_uint, ++ ) -> ssize_t; ++ pub fn eventfd(init: c_uint, flags: c_int) -> c_int; ++ pub fn sched_rr_get_interval(pid: crate::pid_t, tp: *mut crate::timespec) -> c_int; ++ pub fn sem_timedwait(sem: *mut sem_t, abstime: *const crate::timespec) -> c_int; ++ pub fn sem_getvalue(sem: *mut sem_t, sval: *mut c_int) -> c_int; ++ pub fn sched_setparam(pid: crate::pid_t, param: *const crate::sched_param) -> c_int; ++ pub fn swapoff(puath: *const c_char) -> c_int; ++ pub fn vmsplice(fd: c_int, iov: *const crate::iovec, nr_segs: size_t, flags: c_uint) ++ -> ssize_t; ++ pub fn mount( ++ src: *const c_char, ++ target: *const c_char, ++ fstype: *const c_char, ++ flags: c_ulong, ++ data: *const c_void, ++ ) -> c_int; ++ pub fn personality(persona: c_ulong) -> c_int; ++ pub fn sched_getparam(pid: crate::pid_t, param: *mut crate::sched_param) -> c_int; ++ pub fn ppoll( ++ fds: *mut crate::pollfd, ++ nfds: nfds_t, ++ timeout: *const crate::timespec, ++ sigmask: *const sigset_t, ++ ) -> c_int; ++ pub fn pthread_mutex_timedlock( ++ lock: *mut pthread_mutex_t, ++ abstime: *const crate::timespec, ++ ) -> c_int; ++ pub fn clone( ++ cb: extern "C" fn(*mut c_void) -> c_int, ++ child_stack: *mut c_void, ++ flags: c_int, ++ arg: *mut c_void, ++ ... ++ ) -> c_int; ++ pub fn sched_getscheduler(pid: crate::pid_t) -> c_int; ++ pub fn clock_nanosleep( ++ clk_id: crate::clockid_t, ++ flags: c_int, ++ rqtp: *const crate::timespec, ++ rmtp: *mut crate::timespec, ++ ) -> c_int; ++ pub fn pthread_attr_getguardsize( ++ attr: *const crate::pthread_attr_t, ++ guardsize: *mut size_t, ++ ) -> c_int; ++ pub fn pthread_attr_setguardsize(attr: *mut crate::pthread_attr_t, guardsize: size_t) -> c_int; ++ pub fn sethostname(name: *const c_char, len: size_t) -> c_int; ++ pub fn sched_get_priority_min(policy: c_int) -> c_int; ++ pub fn umount2(target: *const c_char, flags: c_int) -> c_int; ++ pub fn swapon(path: *const c_char, swapflags: c_int) -> c_int; ++ pub fn sched_setscheduler( ++ pid: crate::pid_t, ++ policy: c_int, ++ param: *const crate::sched_param, ++ ) -> c_int; ++ pub fn sigsuspend(mask: *const crate::sigset_t) -> c_int; ++ pub fn getgrgid_r( ++ gid: crate::gid_t, ++ grp: *mut crate::group, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut crate::group, ++ ) -> c_int; ++ pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> c_int; ++ pub fn sem_close(sem: *mut sem_t) -> c_int; ++ pub fn getdtablesize() -> c_int; ++ pub fn getgrnam_r( ++ name: *const c_char, ++ grp: *mut crate::group, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut crate::group, ++ ) -> c_int; ++ pub fn initgroups(user: *const c_char, group: crate::gid_t) -> c_int; ++ pub fn pthread_sigmask(how: c_int, set: *const sigset_t, oldset: *mut sigset_t) -> c_int; ++ pub fn sem_open(name: *const c_char, oflag: c_int, ...) -> *mut sem_t; ++ pub fn getgrnam(name: *const c_char) -> *mut crate::group; ++ pub fn pthread_cancel(thread: crate::pthread_t) -> c_int; ++ pub fn pthread_kill(thread: crate::pthread_t, sig: c_int) -> c_int; ++ pub fn sem_unlink(name: *const c_char) -> c_int; ++ pub fn daemon(nochdir: c_int, noclose: c_int) -> c_int; ++ pub fn getpwnam_r( ++ name: *const c_char, ++ pwd: *mut passwd, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut passwd, ++ ) -> c_int; ++ pub fn getpwuid_r( ++ uid: crate::uid_t, ++ pwd: *mut passwd, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut passwd, ++ ) -> c_int; ++ pub fn sigwait(set: *const sigset_t, sig: *mut c_int) -> c_int; ++ pub fn pthread_atfork( ++ prepare: Option, ++ parent: Option, ++ child: Option, ++ ) -> c_int; ++ pub fn getgrgid(gid: crate::gid_t) -> *mut crate::group; ++ ++ pub fn setgrent(); ++ pub fn endgrent(); ++ pub fn getgrent() -> *mut crate::group; ++ ++ pub fn getgrouplist( ++ user: *const c_char, ++ group: crate::gid_t, ++ groups: *mut crate::gid_t, ++ ngroups: *mut c_int, ++ ) -> c_int; ++ pub fn popen(command: *const c_char, mode: *const c_char) -> *mut crate::FILE; ++ pub fn faccessat(dirfd: c_int, pathname: *const c_char, mode: c_int, flags: c_int) -> c_int; ++ pub fn pthread_create( ++ native: *mut crate::pthread_t, ++ attr: *const crate::pthread_attr_t, ++ f: extern "C" fn(*mut c_void) -> *mut c_void, ++ value: *mut c_void, ++ ) -> c_int; ++ pub fn dl_iterate_phdr( ++ callback: Option< ++ unsafe extern "C" fn( ++ info: *mut crate::dl_phdr_info, ++ size: size_t, ++ data: *mut c_void, ++ ) -> c_int, ++ >, ++ data: *mut c_void, ++ ) -> c_int; ++} ++ ++cfg_if! { ++ if #[cfg(target_arch = "aarch64")] { ++ mod aarch64; ++ pub use self::aarch64::*; ++ } else if #[cfg(any(target_arch = "x86_64"))] { ++ mod x86_64; ++ pub use self::x86_64::*; ++ } else if #[cfg(any(target_arch = "riscv64"))] { ++ mod riscv64; ++ pub use self::riscv64::*; ++ } else { ++ // Unknown target_arch ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/fuchsia/riscv64.rs mesa-25.3.3/subprojects/libc-0.2.169/src/fuchsia/riscv64.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/fuchsia/riscv64.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/fuchsia/riscv64.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,47 @@ ++use crate::off_t; ++use crate::prelude::*; ++ ++// From psABI Calling Convention for RV64 ++pub type c_char = u8; ++pub type __u64 = c_ulonglong; ++pub type wchar_t = i32; ++ ++pub type nlink_t = c_ulong; ++pub type blksize_t = c_long; ++ ++pub type stat64 = stat; ++s! { ++ pub struct stat { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_mode: crate::mode_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ __pad0: c_int, ++ pub st_rdev: crate::dev_t, ++ pub st_size: off_t, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ __unused: [c_long; 3], ++ } ++ ++ // Not actually used, IPC calls just return ENOSYS ++ pub struct ipc_perm { ++ pub __ipc_perm_key: crate::key_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub cuid: crate::uid_t, ++ pub cgid: crate::gid_t, ++ pub mode: crate::mode_t, ++ pub __seq: c_ushort, ++ __unused1: c_ulong, ++ __unused2: c_ulong, ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/fuchsia/x86_64.rs mesa-25.3.3/subprojects/libc-0.2.169/src/fuchsia/x86_64.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/fuchsia/x86_64.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/fuchsia/x86_64.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,155 @@ ++use crate::off_t; ++use crate::prelude::*; ++ ++pub type c_char = i8; ++pub type wchar_t = i32; ++pub type nlink_t = u64; ++pub type blksize_t = c_long; ++pub type __u64 = c_ulonglong; ++ ++s! { ++ pub struct stat { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_mode: crate::mode_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ __pad0: c_int, ++ pub st_rdev: crate::dev_t, ++ pub st_size: off_t, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ __unused: [c_long; 3], ++ } ++ ++ pub struct stat64 { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino64_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_mode: crate::mode_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ __pad0: c_int, ++ pub st_rdev: crate::dev_t, ++ pub st_size: off_t, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt64_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ __reserved: [c_long; 3], ++ } ++ ++ pub struct mcontext_t { ++ __private: [u64; 32], ++ } ++ ++ pub struct ipc_perm { ++ pub __ipc_perm_key: crate::key_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub cuid: crate::uid_t, ++ pub cgid: crate::gid_t, ++ pub mode: crate::mode_t, ++ pub __seq: c_int, ++ __unused1: c_long, ++ __unused2: c_long, ++ } ++} ++ ++s_no_extra_traits! { ++ pub struct ucontext_t { ++ pub uc_flags: c_ulong, ++ pub uc_link: *mut ucontext_t, ++ pub uc_stack: crate::stack_t, ++ pub uc_mcontext: mcontext_t, ++ pub uc_sigmask: crate::sigset_t, ++ __private: [u8; 512], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for ucontext_t { ++ fn eq(&self, other: &ucontext_t) -> bool { ++ self.uc_flags == other.uc_flags ++ && self.uc_link == other.uc_link ++ && self.uc_stack == other.uc_stack ++ && self.uc_mcontext == other.uc_mcontext ++ && self.uc_sigmask == other.uc_sigmask ++ && self ++ .__private ++ .iter() ++ .zip(other.__private.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for ucontext_t {} ++ impl fmt::Debug for ucontext_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("ucontext_t") ++ .field("uc_flags", &self.uc_flags) ++ .field("uc_link", &self.uc_link) ++ .field("uc_stack", &self.uc_stack) ++ .field("uc_mcontext", &self.uc_mcontext) ++ .field("uc_sigmask", &self.uc_sigmask) ++ // FIXME: .field("__private", &self.__private) ++ .finish() ++ } ++ } ++ impl hash::Hash for ucontext_t { ++ fn hash(&self, state: &mut H) { ++ self.uc_flags.hash(state); ++ self.uc_link.hash(state); ++ self.uc_stack.hash(state); ++ self.uc_mcontext.hash(state); ++ self.uc_sigmask.hash(state); ++ self.__private.hash(state); ++ } ++ } ++ } ++} ++ ++// offsets in user_regs_structs, from sys/reg.h ++pub const R15: c_int = 0; ++pub const R14: c_int = 1; ++pub const R13: c_int = 2; ++pub const R12: c_int = 3; ++pub const RBP: c_int = 4; ++pub const RBX: c_int = 5; ++pub const R11: c_int = 6; ++pub const R10: c_int = 7; ++pub const R9: c_int = 8; ++pub const R8: c_int = 9; ++pub const RAX: c_int = 10; ++pub const RCX: c_int = 11; ++pub const RDX: c_int = 12; ++pub const RSI: c_int = 13; ++pub const RDI: c_int = 14; ++pub const ORIG_RAX: c_int = 15; ++pub const RIP: c_int = 16; ++pub const CS: c_int = 17; ++pub const EFLAGS: c_int = 18; ++pub const RSP: c_int = 19; ++pub const SS: c_int = 20; ++pub const FS_BASE: c_int = 21; ++pub const GS_BASE: c_int = 22; ++pub const DS: c_int = 23; ++pub const ES: c_int = 24; ++pub const FS: c_int = 25; ++pub const GS: c_int = 26; ++ ++pub const MAP_32BIT: c_int = 0x0040; ++ ++pub const SIGSTKSZ: size_t = 8192; ++pub const MINSIGSTKSZ: size_t = 2048; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/hermit.rs mesa-25.3.3/subprojects/libc-0.2.169/src/hermit.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/hermit.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/hermit.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,573 @@ ++//! Hermit C type definitions ++ ++pub use crate::arch::c_char_def as c_char; ++use crate::prelude::*; ++ ++pub type c_schar = i8; ++pub type c_uchar = u8; ++pub type c_short = i16; ++pub type c_ushort = u16; ++pub type c_int = i32; ++pub type c_uint = u32; ++pub type c_long = i64; ++pub type c_ulong = u64; ++pub type c_longlong = i64; ++pub type c_ulonglong = u64; ++pub type intmax_t = i64; ++pub type uintmax_t = u64; ++pub type intptr_t = isize; ++pub type uintptr_t = usize; ++ ++pub type c_float = f32; ++pub type c_double = f64; ++ ++pub type size_t = usize; ++pub type ssize_t = isize; ++pub type ptrdiff_t = isize; ++ ++pub type clockid_t = i32; ++pub type in_addr_t = u32; ++pub type in_port_t = u16; ++pub type mode_t = u32; ++pub type nfds_t = usize; ++pub type pid_t = i32; ++pub type sa_family_t = u8; ++pub type socklen_t = u32; ++pub type time_t = i64; ++ ++s! { ++ pub struct addrinfo { ++ pub ai_flags: i32, ++ pub ai_family: i32, ++ pub ai_socktype: i32, ++ pub ai_protocol: i32, ++ pub ai_addrlen: socklen_t, ++ pub ai_canonname: *mut c_char, ++ pub ai_addr: *mut sockaddr, ++ pub ai_next: *mut addrinfo, ++ } ++ ++ pub struct dirent64 { ++ pub d_ino: u64, ++ pub d_off: i64, ++ pub d_reclen: u16, ++ pub d_type: u8, ++ pub d_name: [c_char; 256], ++ } ++ ++ #[repr(align(4))] ++ pub struct in6_addr { ++ pub s6_addr: [u8; 16], ++ } ++ ++ pub struct in_addr { ++ pub s_addr: in_addr_t, ++ } ++ ++ pub struct iovec { ++ iov_base: *mut c_void, ++ iov_len: usize, ++ } ++ ++ pub struct pollfd { ++ pub fd: i32, ++ pub events: i16, ++ pub revents: i16, ++ } ++ ++ pub struct sockaddr { ++ pub sa_len: u8, ++ pub sa_family: sa_family_t, ++ pub sa_data: [c_char; 14], ++ } ++ ++ pub struct sockaddr_in { ++ pub sin_len: u8, ++ pub sin_family: sa_family_t, ++ pub sin_port: in_port_t, ++ pub sin_addr: in_addr, ++ pub sin_zero: [c_char; 8], ++ } ++ ++ pub struct sockaddr_in6 { ++ pub sin6_len: u8, ++ pub sin6_family: sa_family_t, ++ pub sin6_port: in_port_t, ++ pub sin6_flowinfo: u32, ++ pub sin6_addr: in6_addr, ++ pub sin6_scope_id: u32, ++ } ++ ++ pub struct sockaddr_storage { ++ pub ss_len: u8, ++ pub ss_family: sa_family_t, ++ __ss_pad1: [u8; 6], ++ __ss_align: i64, ++ __ss_pad2: [u8; 112], ++ } ++ ++ pub struct stat { ++ pub st_dev: u64, ++ pub st_ino: u64, ++ pub st_nlink: u64, ++ pub st_mode: mode_t, ++ pub st_uid: u32, ++ pub st_gid: u32, ++ pub st_rdev: u64, ++ pub st_size: u64, ++ pub st_blksize: i64, ++ pub st_blocks: i64, ++ pub st_atim: timespec, ++ pub st_mtim: timespec, ++ pub st_ctim: timespec, ++ } ++ ++ pub struct timespec { ++ pub tv_sec: time_t, ++ pub tv_nsec: i32, ++ } ++} ++ ++pub const AF_INET: i32 = 0; ++pub const AF_INET6: i32 = 1; ++ ++pub const CLOCK_REALTIME: clockid_t = 1; ++pub const CLOCK_MONOTONIC: clockid_t = 4; ++ ++pub const DT_UNKNOWN: u8 = 0; ++pub const DT_FIFO: u8 = 1; ++pub const DT_CHR: u8 = 2; ++pub const DT_DIR: u8 = 4; ++pub const DT_BLK: u8 = 6; ++pub const DT_REG: u8 = 8; ++pub const DT_LNK: u8 = 10; ++pub const DT_SOCK: u8 = 12; ++pub const DT_WHT: u8 = 14; ++ ++pub const EAI_AGAIN: i32 = 2; ++pub const EAI_BADFLAGS: i32 = 3; ++pub const EAI_FAIL: i32 = 4; ++pub const EAI_FAMILY: i32 = 5; ++pub const EAI_MEMORY: i32 = 6; ++pub const EAI_NODATA: i32 = 7; ++pub const EAI_NONAME: i32 = 8; ++pub const EAI_SERVICE: i32 = 9; ++pub const EAI_SOCKTYPE: i32 = 10; ++pub const EAI_SYSTEM: i32 = 11; ++pub const EAI_OVERFLOW: i32 = 14; ++ ++pub const EFD_SEMAPHORE: i16 = 0o1; ++pub const EFD_NONBLOCK: i16 = 0o4000; ++pub const EFD_CLOEXEC: i16 = 0o40000; ++ ++pub const F_DUPFD: i32 = 0; ++pub const F_GETFD: i32 = 1; ++pub const F_SETFD: i32 = 2; ++pub const F_GETFL: i32 = 3; ++pub const F_SETFL: i32 = 4; ++ ++pub const FD_CLOEXEC: i32 = 1; ++ ++pub const FIONBIO: i32 = 0x8008667e; ++ ++pub const FUTEX_RELATIVE_TIMEOUT: u32 = 1; ++ ++pub const IP_TOS: i32 = 1; ++pub const IP_TTL: i32 = 2; ++pub const IP_ADD_MEMBERSHIP: i32 = 3; ++pub const IP_DROP_MEMBERSHIP: i32 = 4; ++pub const IP_MULTICAST_TTL: i32 = 5; ++pub const IP_MULTICAST_LOOP: i32 = 7; ++ ++pub const IPPROTO_IP: i32 = 0; ++pub const IPPROTO_TCP: i32 = 6; ++pub const IPPROTO_UDP: i32 = 17; ++pub const IPPROTO_IPV6: i32 = 41; ++ ++pub const IPV6_ADD_MEMBERSHIP: i32 = 12; ++pub const IPV6_DROP_MEMBERSHIP: i32 = 13; ++pub const IPV6_MULTICAST_LOOP: i32 = 19; ++pub const IPV6_V6ONLY: i32 = 27; ++ ++pub const MSG_PEEK: i32 = 1; ++ ++pub const O_RDONLY: i32 = 0o0; ++pub const O_WRONLY: i32 = 0o1; ++pub const O_RDWR: i32 = 0o2; ++pub const O_CREAT: i32 = 0o100; ++pub const O_EXCL: i32 = 0o200; ++pub const O_TRUNC: i32 = 0o1000; ++pub const O_APPEND: i32 = 0o2000; ++pub const O_NONBLOCK: i32 = 0o4000; ++pub const O_DIRECTORY: i32 = 0o200000; ++ ++pub const POLLIN: i16 = 0x1; ++pub const POLLPRI: i16 = 0x2; ++pub const POLLOUT: i16 = 0x4; ++pub const POLLERR: i16 = 0x8; ++pub const POLLHUP: i16 = 0x10; ++pub const POLLNVAL: i16 = 0x20; ++pub const POLLRDNORM: i16 = 0x040; ++pub const POLLRDBAND: i16 = 0x080; ++pub const POLLWRNORM: i16 = 0x0100; ++pub const POLLWRBAND: i16 = 0x0200; ++pub const POLLRDHUP: i16 = 0x2000; ++ ++pub const S_IRWXU: mode_t = 0o0700; ++pub const S_IRUSR: mode_t = 0o0400; ++pub const S_IWUSR: mode_t = 0o0200; ++pub const S_IXUSR: mode_t = 0o0100; ++pub const S_IRWXG: mode_t = 0o0070; ++pub const S_IRGRP: mode_t = 0o0040; ++pub const S_IWGRP: mode_t = 0o0020; ++pub const S_IXGRP: mode_t = 0o0010; ++pub const S_IRWXO: mode_t = 0o0007; ++pub const S_IROTH: mode_t = 0o0004; ++pub const S_IWOTH: mode_t = 0o0002; ++pub const S_IXOTH: mode_t = 0o0001; ++ ++pub const S_IFMT: mode_t = 0o17_0000; ++pub const S_IFSOCK: mode_t = 0o14_0000; ++pub const S_IFLNK: mode_t = 0o12_0000; ++pub const S_IFREG: mode_t = 0o10_0000; ++pub const S_IFBLK: mode_t = 0o6_0000; ++pub const S_IFDIR: mode_t = 0o4_0000; ++pub const S_IFCHR: mode_t = 0o2_0000; ++pub const S_IFIFO: mode_t = 0o1_0000; ++ ++pub const SHUT_RD: i32 = 0; ++pub const SHUT_WR: i32 = 1; ++pub const SHUT_RDWR: i32 = 2; ++ ++pub const SO_REUSEADDR: i32 = 0x0004; ++pub const SO_KEEPALIVE: i32 = 0x0008; ++pub const SO_BROADCAST: i32 = 0x0020; ++pub const SO_LINGER: i32 = 0x0080; ++pub const SO_SNDBUF: i32 = 0x1001; ++pub const SO_RCVBUF: i32 = 0x1002; ++pub const SO_SNDTIMEO: i32 = 0x1005; ++pub const SO_RCVTIMEO: i32 = 0x1006; ++pub const SO_ERROR: i32 = 0x1007; ++ ++pub const SOCK_STREAM: i32 = 1; ++pub const SOCK_DGRAM: i32 = 2; ++pub const SOCK_NONBLOCK: i32 = 0o4000; ++pub const SOCK_CLOEXEC: i32 = 0o40000; ++ ++pub const SOL_SOCKET: i32 = 4095; ++ ++pub const STDIN_FILENO: c_int = 0; ++pub const STDOUT_FILENO: c_int = 1; ++pub const STDERR_FILENO: c_int = 2; ++ ++pub const TCP_NODELAY: i32 = 1; ++ ++pub const EPERM: i32 = 1; ++pub const ENOENT: i32 = 2; ++pub const ESRCH: i32 = 3; ++pub const EINTR: i32 = 4; ++pub const EIO: i32 = 5; ++pub const ENXIO: i32 = 6; ++pub const E2BIG: i32 = 7; ++pub const ENOEXEC: i32 = 8; ++pub const EBADF: i32 = 9; ++pub const ECHILD: i32 = 10; ++pub const EAGAIN: i32 = 11; ++pub const ENOMEM: i32 = 12; ++pub const EACCES: i32 = 13; ++pub const EFAULT: i32 = 14; ++pub const ENOTBLK: i32 = 15; ++pub const EBUSY: i32 = 16; ++pub const EEXIST: i32 = 17; ++pub const EXDEV: i32 = 18; ++pub const ENODEV: i32 = 19; ++pub const ENOTDIR: i32 = 20; ++pub const EISDIR: i32 = 21; ++pub const EINVAL: i32 = 22; ++pub const ENFILE: i32 = 23; ++pub const EMFILE: i32 = 24; ++pub const ENOTTY: i32 = 25; ++pub const ETXTBSY: i32 = 26; ++pub const EFBIG: i32 = 27; ++pub const ENOSPC: i32 = 28; ++pub const ESPIPE: i32 = 29; ++pub const EROFS: i32 = 30; ++pub const EMLINK: i32 = 31; ++pub const EPIPE: i32 = 32; ++pub const EDOM: i32 = 33; ++pub const ERANGE: i32 = 34; ++pub const EDEADLK: i32 = 35; ++pub const ENAMETOOLONG: i32 = 36; ++pub const ENOLCK: i32 = 37; ++pub const ENOSYS: i32 = 38; ++pub const ENOTEMPTY: i32 = 39; ++pub const ELOOP: i32 = 40; ++pub const EWOULDBLOCK: i32 = EAGAIN; ++pub const ENOMSG: i32 = 42; ++pub const EIDRM: i32 = 43; ++pub const ECHRNG: i32 = 44; ++pub const EL2NSYNC: i32 = 45; ++pub const EL3HLT: i32 = 46; ++pub const EL3RST: i32 = 47; ++pub const ELNRNG: i32 = 48; ++pub const EUNATCH: i32 = 49; ++pub const ENOCSI: i32 = 50; ++pub const EL2HLT: i32 = 51; ++pub const EBADE: i32 = 52; ++pub const EBADR: i32 = 53; ++pub const EXFULL: i32 = 54; ++pub const ENOANO: i32 = 55; ++pub const EBADRQC: i32 = 56; ++pub const EBADSLT: i32 = 57; ++pub const EDEADLOCK: i32 = EDEADLK; ++pub const EBFONT: i32 = 59; ++pub const ENOSTR: i32 = 60; ++pub const ENODATA: i32 = 61; ++pub const ETIME: i32 = 62; ++pub const ENOSR: i32 = 63; ++pub const ENONET: i32 = 64; ++pub const ENOPKG: i32 = 65; ++pub const EREMOTE: i32 = 66; ++pub const ENOLINK: i32 = 67; ++pub const EADV: i32 = 68; ++pub const ESRMNT: i32 = 69; ++pub const ECOMM: i32 = 70; ++pub const EPROTO: i32 = 71; ++pub const EMULTIHOP: i32 = 72; ++pub const EDOTDOT: i32 = 73; ++pub const EBADMSG: i32 = 74; ++pub const EOVERFLOW: i32 = 75; ++pub const ENOTUNIQ: i32 = 76; ++pub const EBADFD: i32 = 77; ++pub const EREMCHG: i32 = 78; ++pub const ELIBACC: i32 = 79; ++pub const ELIBBAD: i32 = 80; ++pub const ELIBSCN: i32 = 81; ++pub const ELIBMAX: i32 = 82; ++pub const ELIBEXEC: i32 = 83; ++pub const EILSEQ: i32 = 84; ++pub const ERESTART: i32 = 85; ++pub const ESTRPIPE: i32 = 86; ++pub const EUSERS: i32 = 87; ++pub const ENOTSOCK: i32 = 88; ++pub const EDESTADDRREQ: i32 = 89; ++pub const EMSGSIZE: i32 = 90; ++pub const EPROTOTYPE: i32 = 91; ++pub const ENOPROTOOPT: i32 = 92; ++pub const EPROTONOSUPPORT: i32 = 93; ++pub const ESOCKTNOSUPPORT: i32 = 94; ++pub const EOPNOTSUPP: i32 = 95; ++pub const EPFNOSUPPORT: i32 = 96; ++pub const EAFNOSUPPORT: i32 = 97; ++pub const EADDRINUSE: i32 = 98; ++pub const EADDRNOTAVAIL: i32 = 99; ++pub const ENETDOWN: i32 = 100; ++pub const ENETUNREACH: i32 = 101; ++pub const ENETRESET: i32 = 102; ++pub const ECONNABORTED: i32 = 103; ++pub const ECONNRESET: i32 = 104; ++pub const ENOBUFS: i32 = 105; ++pub const EISCONN: i32 = 106; ++pub const ENOTCONN: i32 = 107; ++pub const ESHUTDOWN: i32 = 108; ++pub const ETOOMANYREFS: i32 = 109; ++pub const ETIMEDOUT: i32 = 110; ++pub const ECONNREFUSED: i32 = 111; ++pub const EHOSTDOWN: i32 = 112; ++pub const EHOSTUNREACH: i32 = 113; ++pub const EALREADY: i32 = 114; ++pub const EINPROGRESS: i32 = 115; ++pub const ESTALE: i32 = 116; ++pub const EUCLEAN: i32 = 117; ++pub const ENOTNAM: i32 = 118; ++pub const ENAVAIL: i32 = 119; ++pub const EISNAM: i32 = 120; ++pub const EREMOTEIO: i32 = 121; ++pub const EDQUOT: i32 = 122; ++pub const ENOMEDIUM: i32 = 123; ++pub const EMEDIUMTYPE: i32 = 124; ++pub const ECANCELED: i32 = 125; ++pub const ENOKEY: i32 = 126; ++pub const EKEYEXPIRED: i32 = 127; ++pub const EKEYREVOKED: i32 = 128; ++pub const EKEYREJECTED: i32 = 129; ++pub const EOWNERDEAD: i32 = 130; ++pub const ENOTRECOVERABLE: i32 = 131; ++pub const ERFKILL: i32 = 132; ++pub const EHWPOISON: i32 = 133; ++ ++extern "C" { ++ #[link_name = "sys_alloc"] ++ pub fn alloc(size: usize, align: usize) -> *mut u8; ++ ++ #[link_name = "sys_alloc_zeroed"] ++ pub fn alloc_zeroed(size: usize, align: usize) -> *mut u8; ++ ++ #[link_name = "sys_realloc"] ++ pub fn realloc(ptr: *mut u8, size: usize, align: usize, new_size: usize) -> *mut u8; ++ ++ #[link_name = "sys_dealloc"] ++ pub fn dealloc(ptr: *mut u8, size: usize, align: usize); ++ ++ #[link_name = "sys_exit"] ++ pub fn exit(status: i32) -> !; ++ ++ #[link_name = "sys_abort"] ++ pub fn abort() -> !; ++ ++ #[link_name = "sys_errno"] ++ pub fn errno() -> i32; ++ ++ #[link_name = "sys_clock_gettime"] ++ pub fn clock_gettime(clockid: clockid_t, tp: *mut timespec) -> i32; ++ ++ #[link_name = "sys_nanosleep"] ++ pub fn nanosleep(req: *const timespec) -> i32; ++ ++ #[link_name = "sys_available_parallelism"] ++ pub fn available_parallelism() -> usize; ++ ++ #[link_name = "sys_futex_wait"] ++ pub fn futex_wait( ++ address: *mut u32, ++ expected: u32, ++ timeout: *const timespec, ++ flags: u32, ++ ) -> i32; ++ ++ #[link_name = "sys_futex_wake"] ++ pub fn futex_wake(address: *mut u32, count: i32) -> i32; ++ ++ #[link_name = "sys_stat"] ++ pub fn stat(path: *const c_char, stat: *mut stat) -> i32; ++ ++ #[link_name = "sys_fstat"] ++ pub fn fstat(fd: i32, stat: *mut stat) -> i32; ++ ++ #[link_name = "sys_lstat"] ++ pub fn lstat(path: *const c_char, stat: *mut stat) -> i32; ++ ++ #[link_name = "sys_open"] ++ pub fn open(path: *const c_char, flags: i32, mode: mode_t) -> i32; ++ ++ #[link_name = "sys_unlink"] ++ pub fn unlink(path: *const c_char) -> i32; ++ ++ #[link_name = "sys_mkdir"] ++ pub fn mkdir(path: *const c_char, mode: mode_t) -> i32; ++ ++ #[link_name = "sys_rmdir"] ++ pub fn rmdir(path: *const c_char) -> i32; ++ ++ #[link_name = "sys_read"] ++ pub fn read(fd: i32, buf: *mut u8, len: usize) -> isize; ++ ++ #[link_name = "sys_write"] ++ pub fn write(fd: i32, buf: *const u8, len: usize) -> isize; ++ ++ #[link_name = "sys_readv"] ++ pub fn readv(fd: i32, iov: *const iovec, iovcnt: usize) -> isize; ++ ++ #[link_name = "sys_writev"] ++ pub fn writev(fd: i32, iov: *const iovec, iovcnt: usize) -> isize; ++ ++ #[link_name = "sys_close"] ++ pub fn close(fd: i32) -> i32; ++ ++ #[link_name = "sys_dup"] ++ pub fn dup(fd: i32) -> i32; ++ ++ #[link_name = "sys_fcntl"] ++ pub fn fcntl(fd: i32, cmd: i32, arg: i32) -> i32; ++ ++ #[link_name = "sys_getdents64"] ++ pub fn getdents64(fd: i32, dirp: *mut dirent64, count: usize) -> isize; ++ ++ #[link_name = "sys_getaddrinfo"] ++ pub fn getaddrinfo( ++ nodename: *const c_char, ++ servname: *const c_char, ++ hints: *const addrinfo, ++ res: *mut *mut addrinfo, ++ ) -> i32; ++ ++ #[link_name = "sys_freeaddrinfo"] ++ pub fn freeaddrinfo(ai: *mut addrinfo); ++ ++ #[link_name = "sys_socket"] ++ pub fn socket(domain: i32, ty: i32, protocol: i32) -> i32; ++ ++ #[link_name = "sys_bind"] ++ pub fn bind(sockfd: i32, addr: *const sockaddr, addrlen: socklen_t) -> i32; ++ ++ #[link_name = "sys_listen"] ++ pub fn listen(sockfd: i32, backlog: i32) -> i32; ++ ++ #[link_name = "sys_accept"] ++ pub fn accept(sockfd: i32, addr: *mut sockaddr, addrlen: *mut socklen_t) -> i32; ++ ++ #[link_name = "sys_connect"] ++ pub fn connect(sockfd: i32, addr: *const sockaddr, addrlen: socklen_t) -> i32; ++ ++ #[link_name = "sys_recv"] ++ pub fn recv(sockfd: i32, buf: *mut u8, len: usize, flags: i32) -> isize; ++ ++ #[link_name = "sys_recvfrom"] ++ pub fn recvfrom( ++ sockfd: i32, ++ buf: *mut c_void, ++ len: usize, ++ flags: i32, ++ addr: *mut sockaddr, ++ addrlen: *mut socklen_t, ++ ) -> isize; ++ ++ #[link_name = "sys_send"] ++ pub fn send(sockfd: i32, buf: *const c_void, len: usize, flags: i32) -> isize; ++ ++ #[link_name = "sys_sendto"] ++ pub fn sendto( ++ sockfd: i32, ++ buf: *const c_void, ++ len: usize, ++ flags: i32, ++ to: *const sockaddr, ++ tolen: socklen_t, ++ ) -> isize; ++ ++ #[link_name = "sys_getpeername"] ++ pub fn getpeername(sockfd: i32, addr: *mut sockaddr, addrlen: *mut socklen_t) -> i32; ++ ++ #[link_name = "sys_getsockname"] ++ pub fn getsockname(sockfd: i32, addr: *mut sockaddr, addrlen: *mut socklen_t) -> i32; ++ ++ #[link_name = "sys_getsockopt"] ++ pub fn getsockopt( ++ sockfd: i32, ++ level: i32, ++ optname: i32, ++ optval: *mut c_void, ++ optlen: *mut socklen_t, ++ ) -> i32; ++ ++ #[link_name = "sys_setsockopt"] ++ pub fn setsockopt( ++ sockfd: i32, ++ level: i32, ++ optname: i32, ++ optval: *const c_void, ++ optlen: socklen_t, ++ ) -> i32; ++ ++ #[link_name = "sys_ioctl"] ++ pub fn ioctl(sockfd: i32, cmd: i32, argp: *mut c_void) -> i32; ++ ++ #[link_name = "sys_shutdown"] ++ pub fn shutdown(sockfd: i32, how: i32) -> i32; ++ ++ #[link_name = "sys_eventfd"] ++ pub fn eventfd(initval: u64, flags: i16) -> i32; ++ ++ #[link_name = "sys_poll"] ++ pub fn poll(fds: *mut pollfd, nfds: nfds_t, timeout: i32) -> i32; ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/lib.rs mesa-25.3.3/subprojects/libc-0.2.169/src/lib.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/lib.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/lib.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,190 @@ ++//! libc - Raw FFI bindings to platforms' system libraries ++#![crate_name = "libc"] ++#![crate_type = "rlib"] ++#![allow( ++ renamed_and_removed_lints, // Keep this order. ++ unknown_lints, // Keep this order. ++ bad_style, ++ overflowing_literals, ++ 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, ++ // FIXME: temporarily allow dead_code to fix CI: ++ // - https://github.com/rust-lang/libc/issues/3740 ++ // - https://github.com/rust-lang/rust/pull/126456 ++ dead_code, ++)] ++#![cfg_attr(libc_deny_warnings, deny(warnings))] ++// Attributes needed when building as part of the standard library ++#![cfg_attr(feature = "rustc-dep-of-std", feature(link_cfg, no_core))] ++#![cfg_attr(libc_thread_local, feature(thread_local))] ++#![cfg_attr(feature = "rustc-dep-of-std", allow(internal_features))] ++// DIFF(1.0): The thread local references that raise this lint were removed in 1.0 ++#![cfg_attr(feature = "rustc-dep-of-std", allow(static_mut_refs))] ++// Enable extra lints: ++#![cfg_attr(feature = "extra_traits", deny(missing_debug_implementations))] ++#![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)] ++ ++#[macro_use] ++mod macros; ++ ++cfg_if! { ++ if #[cfg(feature = "rustc-dep-of-std")] { ++ extern crate rustc_std_workspace_core as core; ++ } ++} ++ ++pub use core::ffi::c_void; ++ ++/// Type definitions that are coupled tighter to architecture than OS. ++mod arch { ++ cfg_if! { ++ // This configuration comes from `rust-lang/rust` in `library/core/src/ffi/mod.rs`. ++ if #[cfg(all( ++ not(windows), ++ // FIXME(ctest): just use `target_vendor` = "apple"` once `ctest` supports it ++ not(any( ++ target_os = "macos", ++ target_os = "ios", ++ target_os = "tvos", ++ target_os = "watchos", ++ target_os = "visionos", ++ )), ++ any( ++ target_arch = "aarch64", ++ target_arch = "arm", ++ target_arch = "csky", ++ target_arch = "hexagon", ++ target_arch = "msp430", ++ target_arch = "powerpc", ++ target_arch = "powerpc64", ++ target_arch = "riscv64", ++ target_arch = "riscv32", ++ target_arch = "s390x", ++ target_arch = "xtensa", ++ ) ++ ))] { ++ // To be reexported as `c_char` ++ // FIXME(ctest): just name these `c_char` once `ctest` learns that these don't get ++ // exported. ++ pub type c_char_def = u8; ++ } else { ++ pub type c_char_def = i8; ++ } ++ } ++} ++ ++cfg_if! { ++ if #[cfg(windows)] { ++ mod fixed_width_ints; ++ pub use crate::fixed_width_ints::*; ++ ++ mod windows; ++ pub use crate::windows::*; ++ ++ prelude!(); ++ } else if #[cfg(target_os = "fuchsia")] { ++ mod fixed_width_ints; ++ pub use crate::fixed_width_ints::*; ++ ++ mod fuchsia; ++ pub use crate::fuchsia::*; ++ ++ prelude!(); ++ } else if #[cfg(target_os = "switch")] { ++ mod fixed_width_ints; ++ pub use fixed_width_ints::*; ++ ++ mod switch; ++ pub use switch::*; ++ ++ prelude!(); ++ } else if #[cfg(target_os = "psp")] { ++ mod fixed_width_ints; ++ pub use crate::fixed_width_ints::*; ++ ++ mod psp; ++ pub use crate::psp::*; ++ ++ prelude!(); ++ } else if #[cfg(target_os = "vxworks")] { ++ mod fixed_width_ints; ++ pub use crate::fixed_width_ints::*; ++ ++ mod vxworks; ++ pub use crate::vxworks::*; ++ ++ prelude!(); ++ } else if #[cfg(target_os = "solid_asp3")] { ++ mod fixed_width_ints; ++ pub use crate::fixed_width_ints::*; ++ ++ mod solid; ++ pub use crate::solid::*; ++ ++ prelude!(); ++ } else if #[cfg(unix)] { ++ mod fixed_width_ints; ++ pub use crate::fixed_width_ints::*; ++ ++ mod unix; ++ pub use crate::unix::*; ++ ++ prelude!(); ++ } else if #[cfg(target_os = "hermit")] { ++ mod fixed_width_ints; ++ pub use crate::fixed_width_ints::*; ++ ++ mod hermit; ++ pub use crate::hermit::*; ++ ++ prelude!(); ++ } else if #[cfg(target_os = "teeos")] { ++ mod fixed_width_ints; ++ pub use fixed_width_ints::*; ++ ++ mod teeos; ++ pub use teeos::*; ++ ++ prelude!(); ++ } else if #[cfg(target_os = "trusty")] { ++ mod fixed_width_ints; ++ pub use crate::fixed_width_ints::*; ++ ++ mod trusty; ++ pub use crate::trusty::*; ++ ++ prelude!(); ++ } else if #[cfg(all(target_env = "sgx", target_vendor = "fortanix"))] { ++ mod fixed_width_ints; ++ pub use crate::fixed_width_ints::*; ++ ++ mod sgx; ++ pub use crate::sgx::*; ++ ++ prelude!(); ++ } else if #[cfg(any(target_env = "wasi", target_os = "wasi"))] { ++ mod fixed_width_ints; ++ pub use crate::fixed_width_ints::*; ++ ++ mod wasi; ++ pub use crate::wasi::*; ++ ++ prelude!(); ++ } else if #[cfg(target_os = "xous")] { ++ mod fixed_width_ints; ++ pub use crate::fixed_width_ints::*; ++ ++ mod xous; ++ pub use crate::xous::*; ++ ++ prelude!(); ++ } else { ++ // non-supported targets: empty... ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/macros.rs mesa-25.3.3/subprojects/libc-0.2.169/src/macros.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/macros.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/macros.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,361 @@ ++/// A macro for defining #[cfg] if-else statements. ++/// ++/// This is similar to the `if/elif` C preprocessor macro by allowing definition ++/// of a cascade of `#[cfg]` cases, emitting the implementation which matches ++/// first. ++/// ++/// This allows you to conveniently provide a long list #[cfg]'d blocks of code ++/// without having to rewrite each clause multiple times. ++macro_rules! cfg_if { ++ // match if/else chains with a final `else` ++ ($( ++ if #[cfg($($meta:meta),*)] { $($it:item)* } ++ ) else * else { ++ $($it2:item)* ++ }) => { ++ cfg_if! { ++ @__items ++ () ; ++ $( ( ($($meta),*) ($($it)*) ), )* ++ ( () ($($it2)*) ), ++ } ++ }; ++ ++ // match if/else chains lacking a final `else` ++ ( ++ if #[cfg($($i_met:meta),*)] { $($i_it:item)* } ++ $( ++ else if #[cfg($($e_met:meta),*)] { $($e_it:item)* } ++ )* ++ ) => { ++ cfg_if! { ++ @__items ++ () ; ++ ( ($($i_met),*) ($($i_it)*) ), ++ $( ( ($($e_met),*) ($($e_it)*) ), )* ++ ( () () ), ++ } ++ }; ++ ++ // Internal and recursive macro to emit all the items ++ // ++ // Collects all the negated `cfg`s in a list at the beginning and after the ++ // semicolon is all the remaining items ++ (@__items ($($not:meta,)*) ; ) => {}; ++ (@__items ($($not:meta,)*) ; ( ($($m:meta),*) ($($it:item)*) ), ++ $($rest:tt)*) => { ++ // Emit all items within one block, applying an appropriate #[cfg]. The ++ // #[cfg] will require all `$m` matchers specified and must also negate ++ // all previous matchers. ++ cfg_if! { @__apply cfg(all($($m,)* not(any($($not),*)))), $($it)* } ++ ++ // Recurse to emit all other items in `$rest`, and when we do so add all ++ // our `$m` matchers to the list of `$not` matchers as future emissions ++ // will have to negate everything we just matched as well. ++ cfg_if! { @__items ($($not,)* $($m,)*) ; $($rest)* } ++ }; ++ ++ // Internal macro to Apply a cfg attribute to a list of items ++ (@__apply $m:meta, $($it:item)*) => { ++ $(#[$m] $it)* ++ }; ++} ++ ++/// Create an internal crate prelude with `core` reexports and common types. ++macro_rules! prelude { ++ () => { ++ /// Frequently-used types that are available on all platforms ++ /// ++ /// We need to reexport the core types so this works with `rust-dep-of-std`. ++ mod prelude { ++ // Exports from `core` ++ #[allow(unused_imports)] ++ pub(crate) use ::core::clone::Clone; ++ #[allow(unused_imports)] ++ pub(crate) use ::core::marker::{Copy, Send, Sync}; ++ #[allow(unused_imports)] ++ pub(crate) use ::core::option::Option; ++ #[allow(unused_imports)] ++ pub(crate) use ::core::{fmt, hash, iter, mem}; ++ ++ // Commonly used types defined in this crate ++ #[allow(unused_imports)] ++ pub(crate) use crate::{ ++ c_char, c_double, c_float, c_int, c_long, c_longlong, c_short, c_uchar, c_uint, ++ c_ulong, c_ulonglong, c_ushort, c_void, intptr_t, size_t, ssize_t, uintptr_t, ++ }; ++ } ++ }; ++} ++ ++/// Implement `Clone` and `Copy` for a struct, as well as `Debug`, `Eq`, `Hash`, and ++/// `PartialEq` if the `extra_traits` feature is enabled. ++/// ++/// Use [`s_no_extra_traits`] for structs where the `extra_traits` feature does not ++/// make sense, and for unions. ++macro_rules! s { ++ ($( ++ $(#[$attr:meta])* ++ pub $t:ident $i:ident { $($field:tt)* } ++ )*) => ($( ++ s!(it: $(#[$attr])* pub $t $i { $($field)* }); ++ )*); ++ ++ (it: $(#[$attr:meta])* pub union $i:ident { $($field:tt)* }) => ( ++ compile_error!("unions cannot derive extra traits, use s_no_extra_traits instead"); ++ ); ++ ++ (it: $(#[$attr:meta])* pub struct $i:ident { $($field:tt)* }) => ( ++ __item! { ++ #[repr(C)] ++ #[cfg_attr( ++ feature = "extra_traits", ++ ::core::prelude::v1::derive(Debug, Eq, Hash, PartialEq) ++ )] ++ #[::core::prelude::v1::derive(::core::clone::Clone, ::core::marker::Copy)] ++ #[allow(deprecated)] ++ $(#[$attr])* ++ pub struct $i { $($field)* } ++ } ++ ); ++} ++ ++/// Implement `Clone` and `Copy` for a tuple struct, as well as `Debug`, `Eq`, `Hash`, ++/// and `PartialEq` if the `extra_traits` feature is enabled. ++/// ++/// This is the same as [`s`] but works for tuple structs. ++macro_rules! s_paren { ++ ($( ++ $(#[$attr:meta])* ++ pub struct $i:ident ( $($field:tt)* ); ++ )*) => ($( ++ __item! { ++ #[cfg_attr( ++ feature = "extra_traits", ++ ::core::prelude::v1::derive(Debug, Eq, Hash, PartialEq) ++ )] ++ #[::core::prelude::v1::derive(::core::clone::Clone, ::core::marker::Copy)] ++ $(#[$attr])* ++ pub struct $i ( $($field)* ); ++ } ++ )*); ++} ++ ++/// Implement `Clone` and `Copy` for a struct with no `extra_traits` feature. ++/// ++/// Most items will prefer to use [`s`]. ++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)* }); ++ )*); ++ ++ (it: $(#[$attr:meta])* pub union $i:ident { $($field:tt)* }) => ( ++ __item! { ++ #[repr(C)] ++ #[::core::prelude::v1::derive(::core::clone::Clone, ::core::marker::Copy)] ++ $(#[$attr])* ++ pub union $i { $($field)* } ++ } ++ ++ #[cfg(feature = "extra_traits")] ++ impl ::core::fmt::Debug for $i { ++ fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { ++ f.debug_struct(::core::stringify!($i)).finish_non_exhaustive() ++ } ++ } ++ ); ++ ++ (it: $(#[$attr:meta])* pub struct $i:ident { $($field:tt)* }) => ( ++ __item! { ++ #[repr(C)] ++ #[::core::prelude::v1::derive(::core::clone::Clone, ::core::marker::Copy)] ++ $(#[$attr])* ++ pub struct $i { $($field)* } ++ } ++ ); ++} ++ ++/// Specify that an enum should have no traits that aren't specified in the macro ++/// invocation, i.e. no `Clone` or `Copy`. ++macro_rules! missing { ++ ($( ++ $(#[$attr:meta])* ++ pub enum $i:ident {} ++ )*) => ($( ++ $(#[$attr])* ++ #[allow(missing_copy_implementations)] ++ pub enum $i { } ++ )*); ++} ++ ++/// Implement `Clone` and `Copy` for an enum, as well as `Debug`, `Eq`, `Hash`, and ++/// `PartialEq` if the `extra_traits` feature is enabled. ++macro_rules! e { ++ ($( ++ $(#[$attr:meta])* ++ pub enum $i:ident { $($field:tt)* } ++ )*) => ($( ++ __item! { ++ #[cfg_attr( ++ feature = "extra_traits", ++ ::core::prelude::v1::derive(Debug, Eq, Hash, PartialEq) ++ )] ++ #[::core::prelude::v1::derive(::core::clone::Clone, ::core::marker::Copy)] ++ $(#[$attr])* ++ pub enum $i { $($field)* } ++ } ++ )*); ++} ++ ++// This is a pretty horrible hack to allow us to conditionally mark some functions as 'const', ++// without requiring users of this macro to care "libc_const_extern_fn". ++// ++// When 'libc_const_extern_fn' is enabled, we emit the captured 'const' keyword in the expanded ++// function. ++// ++// When 'libc_const_extern_fn' is disabled, we always emit a plain 'pub unsafe extern fn'. ++// Note that the expression matched by the macro is exactly the same - this allows ++// users of this macro to work whether or not 'libc_const_extern_fn' is enabled ++// ++// Unfortunately, we need to duplicate most of this macro between the 'cfg_if' blocks. ++// This is because 'const unsafe extern fn' won't even parse on older compilers, ++// so we need to avoid emitting it at all of 'libc_const_extern_fn'. ++// ++// Specifically, moving the 'cfg_if' into the macro body will *not* work. Doing so would cause the ++// '#[cfg(libc_const_extern_fn)]' to be emitted into user code. The 'cfg' gate will not stop Rust ++// from trying to parse the 'pub const unsafe extern fn', so users would get a compiler error even ++// when the 'libc_const_extern_fn' feature is disabled. ++ ++// FIXME(ctest): ctest can't handle `const extern` functions, we should be able to remove this ++// cfg completely. ++// FIXME(ctest): ctest can't handle `$(,)?` so we use `$(,)*` which isn't quite correct. ++cfg_if! { ++ if #[cfg(libc_const_extern_fn)] { ++ /// Define an `unsafe` function that is const as long as `libc_const_extern_fn` is enabled. ++ macro_rules! f { ++ ($( ++ $(#[$attr:meta])* ++ pub $({$constness:ident})* fn $i:ident($($arg:ident: $argty:ty),* $(,)*) -> $ret:ty ++ $body:block ++ )*) => ($( ++ #[inline] ++ $(#[$attr])* ++ pub $($constness)* unsafe extern fn $i($($arg: $argty),*) -> $ret ++ $body ++ )*) ++ } ++ ++ /// Define a safe function that is const as long as `libc_const_extern_fn` is enabled. ++ macro_rules! safe_f { ++ ($( ++ $(#[$attr:meta])* ++ pub $({$constness:ident})* fn $i:ident($($arg:ident: $argty:ty),* $(,)*) -> $ret:ty ++ $body:block ++ )*) => ($( ++ #[inline] ++ $(#[$attr])* ++ pub $($constness)* extern fn $i($($arg: $argty),*) -> $ret ++ $body ++ )*) ++ } ++ ++ /// A nonpublic function that is const as long as `libc_const_extern_fn` is enabled. ++ macro_rules! const_fn { ++ ($( ++ $(#[$attr:meta])* ++ $({$constness:ident})* fn $i:ident($($arg:ident: $argty:ty),* $(,)*) -> $ret:ty ++ $body:block ++ )*) => ($( ++ #[inline] ++ $(#[$attr])* ++ $($constness)* fn $i($($arg: $argty),*) -> $ret ++ $body ++ )*) ++ } ++ } else { ++ /// Define an `unsafe` function that is const as long as `libc_const_extern_fn` is enabled. ++ macro_rules! f { ++ ($( ++ $(#[$attr:meta])* ++ pub $({$constness:ident})* fn $i:ident($($arg:ident: $argty:ty),* $(,)*) -> $ret:ty ++ $body:block ++ )*) => ($( ++ #[inline] ++ $(#[$attr])* ++ pub unsafe extern fn $i($($arg: $argty),*) -> $ret ++ $body ++ )*) ++ } ++ ++ /// Define a safe function that is const as long as `libc_const_extern_fn` is enabled. ++ macro_rules! safe_f { ++ ($( ++ $(#[$attr:meta])* ++ pub $({$constness:ident})* fn $i:ident($($arg:ident: $argty:ty),* $(,)*) -> $ret:ty ++ $body:block ++ )*) => ($( ++ #[inline] ++ $(#[$attr])* ++ pub extern fn $i($($arg: $argty),*) -> $ret ++ $body ++ )*) ++ } ++ ++ /// A nonpublic function that is const as long as `libc_const_extern_fn` is enabled. ++ macro_rules! const_fn { ++ ($( ++ $(#[$attr:meta])* ++ $({$constness:ident})* fn $i:ident($($arg:ident: $argty:ty),* $(,)*) -> $ret:ty ++ $body:block ++ )*) => ($( ++ #[inline] ++ $(#[$attr])* ++ fn $i($($arg: $argty),*) -> $ret ++ $body ++ )*) ++ } ++ } ++} ++ ++macro_rules! __item { ++ ($i:item) => { ++ $i ++ }; ++} ++ ++// This macro is used to deprecate items that should be accessed via the mach2 crate ++macro_rules! deprecated_mach { ++ (pub const $id:ident: $ty:ty = $expr:expr;) => { ++ #[deprecated( ++ since = "0.2.55", ++ note = "Use the `mach2` crate instead", ++ )] ++ #[allow(deprecated)] ++ pub const $id: $ty = $expr; ++ }; ++ ($(pub const $id:ident: $ty:ty = $expr:expr;)*) => { ++ $( ++ deprecated_mach!( ++ pub const $id: $ty = $expr; ++ ); ++ )* ++ }; ++ (pub type $id:ident = $ty:ty;) => { ++ #[deprecated( ++ since = "0.2.55", ++ note = "Use the `mach2` crate instead", ++ )] ++ #[allow(deprecated)] ++ pub type $id = $ty; ++ }; ++ ($(pub type $id:ident = $ty:ty;)*) => { ++ $( ++ deprecated_mach!( ++ pub type $id = $ty; ++ ); ++ )* ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/psp.rs mesa-25.3.3/subprojects/libc-0.2.169/src/psp.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/psp.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/psp.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,4159 @@ ++//! PSP C type definitions ++//! ++//! These type declarations are not enough, as they must be ultimately resolved ++//! by the linker. Crates that use these definitions must, somewhere in the ++//! crate graph, include a stub provider crate such as the `psp` crate. ++ ++use crate::prelude::*; ++ ++pub type c_schar = i8; ++pub type c_uchar = u8; ++pub type c_short = i16; ++pub type c_ushort = u16; ++pub type c_int = i32; ++pub type c_uint = u32; ++pub type c_float = f32; ++pub type c_double = f64; ++pub type c_longlong = i64; ++pub type c_ulonglong = u64; ++pub type intmax_t = i64; ++pub type uintmax_t = u64; ++ ++pub type size_t = usize; ++pub type ptrdiff_t = isize; ++pub type intptr_t = isize; ++pub type uintptr_t = usize; ++pub type ssize_t = isize; ++ ++pub type c_char = u8; ++pub type c_long = i64; ++pub type c_ulong = u64; ++ ++pub type SceKernelVTimerHandler = unsafe extern "C" fn( ++ uid: SceUid, ++ arg1: *mut SceKernelSysClock, ++ arg2: *mut SceKernelSysClock, ++ arg3: *mut c_void, ++) -> u32; ++ ++pub type SceKernelVTimerHandlerWide = ++ unsafe extern "C" fn(uid: SceUid, arg1: i64, arg2: i64, arg3: *mut c_void) -> u32; ++ ++pub type SceKernelThreadEventHandler = ++ unsafe extern "C" fn(mask: i32, thid: SceUid, common: *mut c_void) -> i32; ++ ++pub type SceKernelAlarmHandler = unsafe extern "C" fn(common: *mut c_void) -> u32; ++ ++pub type SceKernelCallbackFunction = ++ unsafe extern "C" fn(arg1: i32, arg2: i32, arg: *mut c_void) -> i32; ++ ++pub type SceKernelThreadEntry = unsafe extern "C" fn(args: usize, argp: *mut c_void) -> i32; ++ ++pub type PowerCallback = extern "C" fn(unknown: i32, power_info: i32); ++ ++pub type IoPermissions = i32; ++ ++pub type UmdCallback = fn(unknown: i32, event: i32) -> i32; ++ ++pub type SceMpegRingbufferCb = ++ Option i32>; ++ ++pub type GuCallback = Option; ++pub type GuSwapBuffersCallback = ++ Option; ++ ++pub type SceNetAdhocctlHandler = ++ Option; ++ ++pub type AdhocMatchingCallback = Option< ++ unsafe extern "C" fn( ++ matching_id: i32, ++ event: i32, ++ mac: *mut u8, ++ opt_len: i32, ++ opt_data: *mut c_void, ++ ), ++>; ++ ++pub type SceNetApctlHandler = Option< ++ unsafe extern "C" fn(oldState: i32, newState: i32, event: i32, error: i32, pArg: *mut c_void), ++>; ++ ++pub type HttpMallocFunction = Option *mut c_void>; ++pub type HttpReallocFunction = ++ Option *mut c_void>; ++pub type HttpFreeFunction = Option; ++pub type HttpPasswordCB = Option< ++ unsafe extern "C" fn( ++ request: i32, ++ auth_type: HttpAuthType, ++ realm: *const u8, ++ username: *mut u8, ++ password: *mut u8, ++ need_entity: i32, ++ entity_body: *mut *mut u8, ++ entity_size: *mut usize, ++ save: *mut i32, ++ ) -> i32, ++>; ++ ++pub type socklen_t = u32; ++ ++e! { ++ #[repr(u32)] ++ pub enum AudioFormat { ++ Stereo = 0, ++ Mono = 0x10, ++ } ++ ++ #[repr(u32)] ++ pub enum DisplayMode { ++ Lcd = 0, ++ } ++ ++ #[repr(u32)] ++ pub enum DisplayPixelFormat { ++ Psm5650 = 0, ++ Psm5551 = 1, ++ Psm4444 = 2, ++ Psm8888 = 3, ++ } ++ ++ #[repr(u32)] ++ pub enum DisplaySetBufSync { ++ Immediate = 0, ++ NextFrame = 1, ++ } ++ ++ #[repr(i32)] ++ pub enum AudioOutputFrequency { ++ Khz48 = 48000, ++ Khz44_1 = 44100, ++ Khz32 = 32000, ++ Khz24 = 24000, ++ Khz22_05 = 22050, ++ Khz16 = 16000, ++ Khz12 = 12000, ++ Khz11_025 = 11025, ++ Khz8 = 8000, ++ } ++ ++ #[repr(i32)] ++ pub enum AudioInputFrequency { ++ Khz44_1 = 44100, ++ Khz22_05 = 22050, ++ Khz11_025 = 11025, ++ } ++ ++ #[repr(u32)] ++ pub enum CtrlMode { ++ Digital = 0, ++ Analog, ++ } ++ ++ #[repr(i32)] ++ pub enum GeMatrixType { ++ Bone0 = 0, ++ Bone1, ++ Bone2, ++ Bone3, ++ Bone4, ++ Bone5, ++ Bone6, ++ Bone7, ++ World, ++ View, ++ Projection, ++ TexGen, ++ } ++ ++ #[repr(i32)] ++ pub enum GeListState { ++ Done = 0, ++ Queued, ++ DrawingDone, ++ StallReached, ++ CancelDone, ++ } ++ ++ #[repr(u8)] ++ pub enum GeCommand { ++ Nop = 0, ++ Vaddr = 0x1, ++ Iaddr = 0x2, ++ Prim = 0x4, ++ Bezier = 0x5, ++ Spline = 0x6, ++ BoundingBox = 0x7, ++ Jump = 0x8, ++ BJump = 0x9, ++ Call = 0xa, ++ Ret = 0xb, ++ End = 0xc, ++ Signal = 0xe, ++ Finish = 0xf, ++ Base = 0x10, ++ VertexType = 0x12, ++ OffsetAddr = 0x13, ++ Origin = 0x14, ++ Region1 = 0x15, ++ Region2 = 0x16, ++ LightingEnable = 0x17, ++ LightEnable0 = 0x18, ++ LightEnable1 = 0x19, ++ LightEnable2 = 0x1a, ++ LightEnable3 = 0x1b, ++ DepthClampEnable = 0x1c, ++ CullFaceEnable = 0x1d, ++ TextureMapEnable = 0x1e, ++ FogEnable = 0x1f, ++ DitherEnable = 0x20, ++ AlphaBlendEnable = 0x21, ++ AlphaTestEnable = 0x22, ++ ZTestEnable = 0x23, ++ StencilTestEnable = 0x24, ++ AntiAliasEnable = 0x25, ++ PatchCullEnable = 0x26, ++ ColorTestEnable = 0x27, ++ LogicOpEnable = 0x28, ++ BoneMatrixNumber = 0x2a, ++ BoneMatrixData = 0x2b, ++ MorphWeight0 = 0x2c, ++ MorphWeight1 = 0x2d, ++ MorphWeight2 = 0x2e, ++ MorphWeight3 = 0x2f, ++ MorphWeight4 = 0x30, ++ MorphWeight5 = 0x31, ++ MorphWeight6 = 0x32, ++ MorphWeight7 = 0x33, ++ PatchDivision = 0x36, ++ PatchPrimitive = 0x37, ++ PatchFacing = 0x38, ++ WorldMatrixNumber = 0x3a, ++ WorldMatrixData = 0x3b, ++ ViewMatrixNumber = 0x3c, ++ ViewMatrixData = 0x3d, ++ ProjMatrixNumber = 0x3e, ++ ProjMatrixData = 0x3f, ++ TGenMatrixNumber = 0x40, ++ TGenMatrixData = 0x41, ++ ViewportXScale = 0x42, ++ ViewportYScale = 0x43, ++ ViewportZScale = 0x44, ++ ViewportXCenter = 0x45, ++ ViewportYCenter = 0x46, ++ ViewportZCenter = 0x47, ++ TexScaleU = 0x48, ++ TexScaleV = 0x49, ++ TexOffsetU = 0x4a, ++ TexOffsetV = 0x4b, ++ OffsetX = 0x4c, ++ OffsetY = 0x4d, ++ ShadeMode = 0x50, ++ ReverseNormal = 0x51, ++ MaterialUpdate = 0x53, ++ MaterialEmissive = 0x54, ++ MaterialAmbient = 0x55, ++ MaterialDiffuse = 0x56, ++ MaterialSpecular = 0x57, ++ MaterialAlpha = 0x58, ++ MaterialSpecularCoef = 0x5b, ++ AmbientColor = 0x5c, ++ AmbientAlpha = 0x5d, ++ LightMode = 0x5e, ++ LightType0 = 0x5f, ++ LightType1 = 0x60, ++ LightType2 = 0x61, ++ LightType3 = 0x62, ++ Light0X = 0x63, ++ Light0Y, ++ Light0Z, ++ Light1X, ++ Light1Y, ++ Light1Z, ++ Light2X, ++ Light2Y, ++ Light2Z, ++ Light3X, ++ Light3Y, ++ Light3Z, ++ Light0DirectionX = 0x6f, ++ Light0DirectionY, ++ Light0DirectionZ, ++ Light1DirectionX, ++ Light1DirectionY, ++ Light1DirectionZ, ++ Light2DirectionX, ++ Light2DirectionY, ++ Light2DirectionZ, ++ Light3DirectionX, ++ Light3DirectionY, ++ Light3DirectionZ, ++ Light0ConstantAtten = 0x7b, ++ Light0LinearAtten, ++ Light0QuadtraticAtten, ++ Light1ConstantAtten, ++ Light1LinearAtten, ++ Light1QuadtraticAtten, ++ Light2ConstantAtten, ++ Light2LinearAtten, ++ Light2QuadtraticAtten, ++ Light3ConstantAtten, ++ Light3LinearAtten, ++ Light3QuadtraticAtten, ++ Light0ExponentAtten = 0x87, ++ Light1ExponentAtten, ++ Light2ExponentAtten, ++ Light3ExponentAtten, ++ Light0CutoffAtten = 0x8b, ++ Light1CutoffAtten, ++ Light2CutoffAtten, ++ Light3CutoffAtten, ++ Light0Ambient = 0x8f, ++ Light0Diffuse, ++ Light0Specular, ++ Light1Ambient, ++ Light1Diffuse, ++ Light1Specular, ++ Light2Ambient, ++ Light2Diffuse, ++ Light2Specular, ++ Light3Ambient, ++ Light3Diffuse, ++ Light3Specular, ++ Cull = 0x9b, ++ FrameBufPtr = 0x9c, ++ FrameBufWidth = 0x9d, ++ ZBufPtr = 0x9e, ++ ZBufWidth = 0x9f, ++ TexAddr0 = 0xa0, ++ TexAddr1, ++ TexAddr2, ++ TexAddr3, ++ TexAddr4, ++ TexAddr5, ++ TexAddr6, ++ TexAddr7, ++ TexBufWidth0 = 0xa8, ++ TexBufWidth1, ++ TexBufWidth2, ++ TexBufWidth3, ++ TexBufWidth4, ++ TexBufWidth5, ++ TexBufWidth6, ++ TexBufWidth7, ++ ClutAddr = 0xb0, ++ ClutAddrUpper = 0xb1, ++ TransferSrc, ++ TransferSrcW, ++ TransferDst, ++ TransferDstW, ++ TexSize0 = 0xb8, ++ TexSize1, ++ TexSize2, ++ TexSize3, ++ TexSize4, ++ TexSize5, ++ TexSize6, ++ TexSize7, ++ TexMapMode = 0xc0, ++ TexShadeLs = 0xc1, ++ TexMode = 0xc2, ++ TexFormat = 0xc3, ++ LoadClut = 0xc4, ++ ClutFormat = 0xc5, ++ TexFilter = 0xc6, ++ TexWrap = 0xc7, ++ TexLevel = 0xc8, ++ TexFunc = 0xc9, ++ TexEnvColor = 0xca, ++ TexFlush = 0xcb, ++ TexSync = 0xcc, ++ Fog1 = 0xcd, ++ Fog2 = 0xce, ++ FogColor = 0xcf, ++ TexLodSlope = 0xd0, ++ FramebufPixFormat = 0xd2, ++ ClearMode = 0xd3, ++ Scissor1 = 0xd4, ++ Scissor2 = 0xd5, ++ MinZ = 0xd6, ++ MaxZ = 0xd7, ++ ColorTest = 0xd8, ++ ColorRef = 0xd9, ++ ColorTestmask = 0xda, ++ AlphaTest = 0xdb, ++ StencilTest = 0xdc, ++ StencilOp = 0xdd, ++ ZTest = 0xde, ++ BlendMode = 0xdf, ++ BlendFixedA = 0xe0, ++ BlendFixedB = 0xe1, ++ Dith0 = 0xe2, ++ Dith1, ++ Dith2, ++ Dith3, ++ LogicOp = 0xe6, ++ ZWriteDisable = 0xe7, ++ MaskRgb = 0xe8, ++ MaskAlpha = 0xe9, ++ TransferStart = 0xea, ++ TransferSrcPos = 0xeb, ++ TransferDstPos = 0xec, ++ TransferSize = 0xee, ++ Vscx = 0xf0, ++ Vscy = 0xf1, ++ Vscz = 0xf2, ++ Vtcs = 0xf3, ++ Vtct = 0xf4, ++ Vtcq = 0xf5, ++ Vcv = 0xf6, ++ Vap = 0xf7, ++ Vfc = 0xf8, ++ Vscv = 0xf9, ++ ++ Unknown03 = 0x03, ++ Unknown0D = 0x0d, ++ Unknown11 = 0x11, ++ Unknown29 = 0x29, ++ Unknown34 = 0x34, ++ Unknown35 = 0x35, ++ Unknown39 = 0x39, ++ Unknown4E = 0x4e, ++ Unknown4F = 0x4f, ++ Unknown52 = 0x52, ++ Unknown59 = 0x59, ++ Unknown5A = 0x5a, ++ UnknownB6 = 0xb6, ++ UnknownB7 = 0xb7, ++ UnknownD1 = 0xd1, ++ UnknownED = 0xed, ++ UnknownEF = 0xef, ++ UnknownFA = 0xfa, ++ UnknownFB = 0xfb, ++ UnknownFC = 0xfc, ++ UnknownFD = 0xfd, ++ UnknownFE = 0xfe, ++ NopFF = 0xff, ++ } ++ ++ #[repr(i32)] ++ pub enum SceSysMemPartitionId { ++ SceKernelUnknownPartition = 0, ++ SceKernelPrimaryKernelPartition = 1, ++ SceKernelPrimaryUserPartition = 2, ++ SceKernelOtherKernelPartition1 = 3, ++ SceKernelOtherKernelPartition2 = 4, ++ SceKernelVshellPARTITION = 5, ++ SceKernelScUserPartition = 6, ++ SceKernelMeUserPartition = 7, ++ SceKernelExtendedScKernelPartition = 8, ++ SceKernelExtendedSc2KernelPartition = 9, ++ SceKernelExtendedMeKernelPartition = 10, ++ SceKernelVshellKernelPartition = 11, ++ SceKernelExtendedKernelPartition = 12, ++ } ++ ++ #[repr(i32)] ++ pub enum SceSysMemBlockTypes { ++ Low = 0, ++ High, ++ Addr, ++ } ++ ++ #[repr(u32)] ++ pub enum Interrupt { ++ Gpio = 4, ++ Ata = 5, ++ Umd = 6, ++ Mscm0 = 7, ++ Wlan = 8, ++ Audio = 10, ++ I2c = 12, ++ Sircs = 14, ++ Systimer0 = 15, ++ Systimer1 = 16, ++ Systimer2 = 17, ++ Systimer3 = 18, ++ Thread0 = 19, ++ Nand = 20, ++ Dmacplus = 21, ++ Dma0 = 22, ++ Dma1 = 23, ++ Memlmd = 24, ++ Ge = 25, ++ Vblank = 30, ++ Mecodec = 31, ++ Hpremote = 36, ++ Mscm1 = 60, ++ Mscm2 = 61, ++ Thread1 = 65, ++ Interrupt = 66, ++ } ++ ++ #[repr(u32)] ++ pub enum SubInterrupt { ++ Gpio = Interrupt::Gpio as u32, ++ Ata = Interrupt::Ata as u32, ++ Umd = Interrupt::Umd as u32, ++ Dmacplus = Interrupt::Dmacplus as u32, ++ Ge = Interrupt::Ge as u32, ++ Display = Interrupt::Vblank as u32, ++ } ++ ++ #[repr(u32)] ++ pub enum SceKernelIdListType { ++ Thread = 1, ++ Semaphore = 2, ++ EventFlag = 3, ++ Mbox = 4, ++ Vpl = 5, ++ Fpl = 6, ++ Mpipe = 7, ++ Callback = 8, ++ ThreadEventHandler = 9, ++ Alarm = 10, ++ VTimer = 11, ++ SleepThread = 64, ++ DelayThread = 65, ++ SuspendThread = 66, ++ DormantThread = 67, ++ } ++ ++ #[repr(i32)] ++ pub enum UsbCamResolution { ++ Px160_120 = 0, ++ Px176_144 = 1, ++ Px320_240 = 2, ++ Px352_288 = 3, ++ Px640_480 = 4, ++ Px1024_768 = 5, ++ Px1280_960 = 6, ++ Px480_272 = 7, ++ Px360_272 = 8, ++ } ++ ++ #[repr(i32)] ++ pub enum UsbCamResolutionEx { ++ Px160_120 = 0, ++ Px176_144 = 1, ++ Px320_240 = 2, ++ Px352_288 = 3, ++ Px360_272 = 4, ++ Px480_272 = 5, ++ Px640_480 = 6, ++ Px1024_768 = 7, ++ Px1280_960 = 8, ++ } ++ ++ #[repr(i32)] ++ pub enum UsbCamDelay { ++ NoDelay = 0, ++ Delay10Sec = 1, ++ Delay20Sec = 2, ++ Delay30Sec = 3, ++ } ++ ++ #[repr(i32)] ++ pub enum UsbCamFrameRate { ++ Fps3_75 = 0, ++ Fps5 = 1, ++ Fps7_5 = 2, ++ Fps10 = 3, ++ Fps15 = 4, ++ Fps20 = 5, ++ Fps30 = 6, ++ Fps60 = 7, ++ } ++ ++ #[repr(i32)] ++ pub enum UsbCamWb { ++ Auto = 0, ++ Daylight = 1, ++ Fluorescent = 2, ++ Incadescent = 3, ++ } ++ ++ #[repr(i32)] ++ pub enum UsbCamEffectMode { ++ Normal = 0, ++ Negative = 1, ++ Blackwhite = 2, ++ Sepia = 3, ++ Blue = 4, ++ Red = 5, ++ Green = 6, ++ } ++ ++ #[repr(i32)] ++ pub enum UsbCamEvLevel { ++ Pos2_0 = 0, ++ Pos1_7 = 1, ++ Pos1_5 = 2, ++ Pos1_3 = 3, ++ Pos1_0 = 4, ++ Pos0_7 = 5, ++ Pos0_5 = 6, ++ Pos0_3 = 7, ++ Zero = 8, ++ Neg0_3, ++ Neg0_5, ++ Neg0_7, ++ Neg1_0, ++ Neg1_3, ++ Neg1_5, ++ Neg1_7, ++ Neg2_0, ++ } ++ ++ #[repr(i32)] ++ pub enum RtcCheckValidError { ++ InvalidYear = -1, ++ InvalidMonth = -2, ++ InvalidDay = -3, ++ InvalidHour = -4, ++ InvalidMinutes = -5, ++ InvalidSeconds = -6, ++ InvalidMicroseconds = -7, ++ } ++ ++ #[repr(u32)] ++ pub enum PowerTick { ++ All = 0, ++ Suspend = 1, ++ Display = 6, ++ } ++ ++ #[repr(u32)] ++ pub enum IoAssignPerms { ++ RdWr = 0, ++ RdOnly = 1, ++ } ++ ++ #[repr(u32)] ++ pub enum IoWhence { ++ Set = 0, ++ Cur = 1, ++ End = 2, ++ } ++ ++ #[repr(u32)] ++ pub enum UmdType { ++ Game = 0x10, ++ Video = 0x20, ++ Audio = 0x40, ++ } ++ ++ #[repr(u32)] ++ pub enum GuPrimitive { ++ Points = 0, ++ Lines = 1, ++ LineStrip = 2, ++ Triangles = 3, ++ TriangleStrip = 4, ++ TriangleFan = 5, ++ Sprites = 6, ++ } ++ ++ #[repr(u32)] ++ pub enum PatchPrimitive { ++ Points = 0, ++ LineStrip = 2, ++ TriangleStrip = 4, ++ } ++ ++ #[repr(u32)] ++ pub enum GuState { ++ AlphaTest = 0, ++ DepthTest = 1, ++ ScissorTest = 2, ++ StencilTest = 3, ++ Blend = 4, ++ CullFace = 5, ++ Dither = 6, ++ Fog = 7, ++ ClipPlanes = 8, ++ Texture2D = 9, ++ Lighting = 10, ++ Light0 = 11, ++ Light1 = 12, ++ Light2 = 13, ++ Light3 = 14, ++ LineSmooth = 15, ++ PatchCullFace = 16, ++ ColorTest = 17, ++ ColorLogicOp = 18, ++ FaceNormalReverse = 19, ++ PatchFace = 20, ++ Fragment2X = 21, ++ } ++ ++ #[repr(u32)] ++ pub enum MatrixMode { ++ Projection = 0, ++ View = 1, ++ Model = 2, ++ Texture = 3, ++ } ++ ++ #[repr(u32)] ++ pub enum TexturePixelFormat { ++ Psm5650 = 0, ++ Psm5551 = 1, ++ Psm4444 = 2, ++ Psm8888 = 3, ++ PsmT4 = 4, ++ PsmT8 = 5, ++ PsmT16 = 6, ++ PsmT32 = 7, ++ PsmDxt1 = 8, ++ PsmDxt3 = 9, ++ PsmDxt5 = 10, ++ } ++ ++ #[repr(u32)] ++ pub enum SplineMode { ++ FillFill = 0, ++ OpenFill = 1, ++ FillOpen = 2, ++ OpenOpen = 3, ++ } ++ ++ #[repr(u32)] ++ pub enum ShadingModel { ++ Flat = 0, ++ Smooth = 1, ++ } ++ ++ #[repr(u32)] ++ pub enum LogicalOperation { ++ Clear = 0, ++ And = 1, ++ AndReverse = 2, ++ Copy = 3, ++ AndInverted = 4, ++ Noop = 5, ++ Xor = 6, ++ Or = 7, ++ Nor = 8, ++ Equiv = 9, ++ Inverted = 10, ++ OrReverse = 11, ++ CopyInverted = 12, ++ OrInverted = 13, ++ Nand = 14, ++ Set = 15, ++ } ++ ++ #[repr(u32)] ++ pub enum TextureFilter { ++ Nearest = 0, ++ Linear = 1, ++ NearestMipmapNearest = 4, ++ LinearMipmapNearest = 5, ++ NearestMipmapLinear = 6, ++ LinearMipmapLinear = 7, ++ } ++ ++ #[repr(u32)] ++ pub enum TextureMapMode { ++ TextureCoords = 0, ++ TextureMatrix = 1, ++ EnvironmentMap = 2, ++ } ++ ++ #[repr(u32)] ++ pub enum TextureLevelMode { ++ Auto = 0, ++ Const = 1, ++ Slope = 2, ++ } ++ ++ #[repr(u32)] ++ pub enum TextureProjectionMapMode { ++ Position = 0, ++ Uv = 1, ++ NormalizedNormal = 2, ++ Normal = 3, ++ } ++ ++ #[repr(u32)] ++ pub enum GuTexWrapMode { ++ Repeat = 0, ++ Clamp = 1, ++ } ++ ++ #[repr(u32)] ++ pub enum FrontFaceDirection { ++ Clockwise = 0, ++ CounterClockwise = 1, ++ } ++ ++ #[repr(u32)] ++ pub enum AlphaFunc { ++ Never = 0, ++ Always, ++ Equal, ++ NotEqual, ++ Less, ++ LessOrEqual, ++ Greater, ++ GreaterOrEqual, ++ } ++ ++ #[repr(u32)] ++ pub enum StencilFunc { ++ Never = 0, ++ Always, ++ Equal, ++ NotEqual, ++ Less, ++ LessOrEqual, ++ Greater, ++ GreaterOrEqual, ++ } ++ ++ #[repr(u32)] ++ pub enum ColorFunc { ++ Never = 0, ++ Always, ++ Equal, ++ NotEqual, ++ } ++ ++ #[repr(u32)] ++ pub enum DepthFunc { ++ Never = 0, ++ Always, ++ Equal, ++ NotEqual, ++ Less, ++ LessOrEqual, ++ Greater, ++ GreaterOrEqual, ++ } ++ ++ #[repr(u32)] ++ pub enum TextureEffect { ++ Modulate = 0, ++ Decal = 1, ++ Blend = 2, ++ Replace = 3, ++ Add = 4, ++ } ++ ++ #[repr(u32)] ++ pub enum TextureColorComponent { ++ Rgb = 0, ++ Rgba = 1, ++ } ++ ++ #[repr(u32)] ++ pub enum MipmapLevel { ++ None = 0, ++ Level1, ++ Level2, ++ Level3, ++ Level4, ++ Level5, ++ Level6, ++ Level7, ++ } ++ ++ #[repr(u32)] ++ pub enum BlendOp { ++ Add = 0, ++ Subtract = 1, ++ ReverseSubtract = 2, ++ Min = 3, ++ Max = 4, ++ Abs = 5, ++ } ++ ++ #[repr(u32)] ++ pub enum BlendSrc { ++ SrcColor = 0, ++ OneMinusSrcColor = 1, ++ SrcAlpha = 2, ++ OneMinusSrcAlpha = 3, ++ Fix = 10, ++ } ++ ++ #[repr(u32)] ++ pub enum BlendDst { ++ DstColor = 0, ++ OneMinusDstColor = 1, ++ DstAlpha = 4, ++ OneMinusDstAlpha = 5, ++ Fix = 10, ++ } ++ ++ #[repr(u32)] ++ pub enum StencilOperation { ++ Keep = 0, ++ Zero = 1, ++ Replace = 2, ++ Invert = 3, ++ Incr = 4, ++ Decr = 5, ++ } ++ ++ #[repr(u32)] ++ pub enum LightMode { ++ SingleColor = 0, ++ SeparateSpecularColor = 1, ++ } ++ ++ #[repr(u32)] ++ pub enum LightType { ++ Directional = 0, ++ Pointlight = 1, ++ Spotlight = 2, ++ } ++ ++ #[repr(u32)] ++ pub enum GuContextType { ++ Direct = 0, ++ Call = 1, ++ Send = 2, ++ } ++ ++ #[repr(u32)] ++ pub enum GuQueueMode { ++ Tail = 0, ++ Head = 1, ++ } ++ ++ #[repr(u32)] ++ pub enum GuSyncMode { ++ Finish = 0, ++ Signal = 1, ++ Done = 2, ++ List = 3, ++ Send = 4, ++ } ++ ++ #[repr(u32)] ++ pub enum GuSyncBehavior { ++ Wait = 0, ++ NoWait = 1, ++ } ++ ++ #[repr(u32)] ++ pub enum GuCallbackId { ++ Signal = 1, ++ Finish = 4, ++ } ++ ++ #[repr(u32)] ++ pub enum SignalBehavior { ++ Suspend = 1, ++ Continue = 2, ++ } ++ ++ #[repr(u32)] ++ pub enum ClutPixelFormat { ++ Psm5650 = 0, ++ Psm5551 = 1, ++ Psm4444 = 2, ++ Psm8888 = 3, ++ } ++ ++ #[repr(C)] ++ pub enum KeyType { ++ Directory = 1, ++ Integer = 2, ++ String = 3, ++ Bytes = 4, ++ } ++ ++ #[repr(u32)] ++ pub enum UtilityMsgDialogMode { ++ Error, ++ Text, ++ } ++ ++ #[repr(u32)] ++ pub enum UtilityMsgDialogPressed { ++ Unknown1, ++ Yes, ++ No, ++ Back, ++ } ++ ++ #[repr(u32)] ++ pub enum UtilityDialogButtonAccept { ++ Circle, ++ Cross, ++ } ++ ++ #[repr(u32)] ++ pub enum SceUtilityOskInputLanguage { ++ Default, ++ Japanese, ++ English, ++ French, ++ Spanish, ++ German, ++ Italian, ++ Dutch, ++ Portugese, ++ Russian, ++ Korean, ++ } ++ ++ #[repr(u32)] ++ pub enum SceUtilityOskInputType { ++ All, ++ LatinDigit, ++ LatinSymbol, ++ LatinLowercase = 4, ++ LatinUppercase = 8, ++ JapaneseDigit = 0x100, ++ JapaneseSymbol = 0x200, ++ JapaneseLowercase = 0x400, ++ JapaneseUppercase = 0x800, ++ JapaneseHiragana = 0x1000, ++ JapaneseHalfWidthKatakana = 0x2000, ++ JapaneseKatakana = 0x4000, ++ JapaneseKanji = 0x8000, ++ RussianLowercase = 0x10000, ++ RussianUppercase = 0x20000, ++ Korean = 0x40000, ++ Url = 0x80000, ++ } ++ ++ #[repr(u32)] ++ pub enum SceUtilityOskState { ++ None, ++ Initializing, ++ Initialized, ++ Visible, ++ Quit, ++ Finished, ++ } ++ ++ #[repr(u32)] ++ pub enum SceUtilityOskResult { ++ Unchanged, ++ Cancelled, ++ Changed, ++ } ++ ++ #[repr(u32)] ++ pub enum SystemParamLanguage { ++ Japanese, ++ English, ++ French, ++ Spanish, ++ German, ++ Italian, ++ Dutch, ++ Portugese, ++ Russian, ++ Korean, ++ ChineseTraditional, ++ ChineseSimplified, ++ } ++ ++ #[repr(u32)] ++ pub enum SystemParamId { ++ StringNickname = 1, ++ AdhocChannel, ++ WlanPowerSave, ++ DateFormat, ++ TimeFormat, ++ Timezone, ++ DaylightSavings, ++ Language, ++ Unknown, ++ } ++ ++ #[repr(u32)] ++ pub enum SystemParamAdhocChannel { ++ ChannelAutomatic = 0, ++ Channel1 = 1, ++ Channel6 = 6, ++ Channel11 = 11, ++ } ++ ++ #[repr(u32)] ++ pub enum SystemParamWlanPowerSaveState { ++ Off, ++ On, ++ } ++ ++ #[repr(u32)] ++ pub enum SystemParamDateFormat { ++ YYYYMMDD, ++ MMDDYYYY, ++ DDMMYYYY, ++ } ++ ++ #[repr(u32)] ++ pub enum SystemParamTimeFormat { ++ Hour24, ++ Hour12, ++ } ++ ++ #[repr(u32)] ++ pub enum SystemParamDaylightSavings { ++ Std, ++ Dst, ++ } ++ ++ #[repr(u32)] ++ pub enum AvModule { ++ AvCodec, ++ SasCore, ++ Atrac3Plus, ++ MpegBase, ++ Mp3, ++ Vaudio, ++ Aac, ++ G729, ++ } ++ ++ #[repr(u32)] ++ pub enum Module { ++ NetCommon = 0x100, ++ NetAdhoc, ++ NetInet, ++ NetParseUri, ++ NetHttp, ++ NetSsl, ++ ++ UsbPspCm = 0x200, ++ UsbMic, ++ UsbCam, ++ UsbGps, ++ ++ AvCodec = 0x300, ++ AvSascore, ++ AvAtrac3Plus, ++ AvMpegBase, ++ AvMp3, ++ AvVaudio, ++ AvAac, ++ AvG729, ++ ++ NpCommon = 0x400, ++ NpService, ++ NpMatching2, ++ NpDrm = 0x500, ++ ++ Irda = 0x600, ++ } ++ ++ #[repr(u32)] ++ pub enum NetModule { ++ NetCommon = 1, ++ NetAdhoc, ++ NetInet, ++ NetParseUri, ++ NetHttp, ++ NetSsl, ++ } ++ ++ #[repr(u32)] ++ pub enum UsbModule { ++ UsbPspCm = 1, ++ UsbAcc, ++ UsbMic, ++ UsbCam, ++ UsbGps, ++ } ++ ++ #[repr(u32)] ++ pub enum NetParam { ++ Name, ++ Ssid, ++ Secure, ++ WepKey, ++ IsStaticIp, ++ Ip, ++ NetMask, ++ Route, ++ ManualDns, ++ PrimaryDns, ++ SecondaryDns, ++ ProxyUser, ++ ProxyPass, ++ UseProxy, ++ ProxyServer, ++ ProxyPort, ++ Unknown1, ++ Unknown2, ++ } ++ ++ #[repr(u32)] ++ pub enum UtilityNetconfAction { ++ ConnectAP, ++ DisplayStatus, ++ ConnectAdhoc, ++ } ++ ++ #[repr(u32)] ++ pub enum UtilitySavedataMode { ++ AutoLoad, ++ AutoSave, ++ Load, ++ Save, ++ ListLoad, ++ ListSave, ++ ListDelete, ++ Delete, ++ } ++ ++ #[repr(u32)] ++ pub enum UtilitySavedataFocus { ++ Unknown1, ++ FirstList, ++ LastList, ++ Latest, ++ Oldest, ++ Unknown2, ++ Unknown3, ++ FirstEmpty, ++ LastEmpty, ++ } ++ ++ #[repr(u32)] ++ pub enum UtilityGameSharingMode { ++ Single = 1, ++ Multiple, ++ } ++ ++ #[repr(u32)] ++ pub enum UtilityGameSharingDataType { ++ File = 1, ++ Memory, ++ } ++ ++ #[repr(u32)] ++ pub enum UtilityHtmlViewerInterfaceMode { ++ Full, ++ Limited, ++ None, ++ } ++ ++ #[repr(u32)] ++ pub enum UtilityHtmlViewerCookieMode { ++ Disabled = 0, ++ Enabled, ++ Confirm, ++ Default, ++ } ++ ++ #[repr(u32)] ++ pub enum UtilityHtmlViewerTextSize { ++ Large, ++ Normal, ++ Small, ++ } ++ ++ #[repr(u32)] ++ pub enum UtilityHtmlViewerDisplayMode { ++ Normal, ++ Fit, ++ SmartFit, ++ } ++ ++ #[repr(u32)] ++ pub enum UtilityHtmlViewerConnectMode { ++ Last, ++ ManualOnce, ++ ManualAll, ++ } ++ ++ #[repr(u32)] ++ pub enum UtilityHtmlViewerDisconnectMode { ++ Enable, ++ Disable, ++ Confirm, ++ } ++ ++ #[repr(u32)] ++ pub enum ScePspnetAdhocPtpState { ++ Closed, ++ Listen, ++ SynSent, ++ SynReceived, ++ Established, ++ } ++ ++ #[repr(u32)] ++ pub enum AdhocMatchingMode { ++ Host = 1, ++ Client, ++ Ptp, ++ } ++ ++ #[repr(u32)] ++ pub enum ApctlState { ++ Disconnected, ++ Scanning, ++ Joining, ++ GettingIp, ++ GotIp, ++ EapAuth, ++ KeyExchange, ++ } ++ ++ #[repr(u32)] ++ pub enum ApctlEvent { ++ ConnectRequest, ++ ScanRequest, ++ ScanComplete, ++ Established, ++ GetIp, ++ DisconnectRequest, ++ Error, ++ Info, ++ EapAuth, ++ KeyExchange, ++ Reconnect, ++ } ++ ++ #[repr(u32)] ++ pub enum ApctlInfo { ++ ProfileName, ++ Bssid, ++ Ssid, ++ SsidLength, ++ SecurityType, ++ Strength, ++ Channel, ++ PowerSave, ++ Ip, ++ SubnetMask, ++ Gateway, ++ PrimaryDns, ++ SecondaryDns, ++ UseProxy, ++ ProxyUrl, ++ ProxyPort, ++ EapType, ++ StartBrowser, ++ Wifisp, ++ } ++ ++ #[repr(u32)] ++ pub enum ApctlInfoSecurityType { ++ None, ++ Wep, ++ Wpa, ++ } ++ ++ #[repr(u32)] ++ pub enum HttpMethod { ++ Get, ++ Post, ++ Head, ++ } ++ ++ #[repr(u32)] ++ pub enum HttpAuthType { ++ Basic, ++ Digest, ++ } ++} ++ ++s_paren! { ++ #[repr(transparent)] ++ pub struct SceUid(pub i32); ++ ++ #[repr(transparent)] ++ #[allow(dead_code)] ++ pub struct SceMpeg(*mut *mut c_void); ++ ++ #[repr(transparent)] ++ #[allow(dead_code)] ++ pub struct SceMpegStream(*mut c_void); ++ ++ #[repr(transparent)] ++ pub struct Mp3Handle(pub i32); ++ ++ #[repr(transparent)] ++ #[allow(dead_code)] ++ pub struct RegHandle(u32); ++} ++ ++s! { ++ pub struct sockaddr { ++ pub sa_len: u8, ++ pub sa_family: u8, ++ pub sa_data: [u8; 14], ++ } ++ ++ pub struct in_addr { ++ pub s_addr: u32, ++ } ++ ++ pub struct AudioInputParams { ++ pub unknown1: i32, ++ pub gain: i32, ++ pub unknown2: i32, ++ pub unknown3: i32, ++ pub unknown4: i32, ++ pub unknown5: i32, ++ } ++ ++ pub struct Atrac3BufferInfo { ++ pub puc_write_position_first_buf: *mut u8, ++ pub ui_writable_byte_first_buf: u32, ++ pub ui_min_write_byte_first_buf: u32, ++ pub ui_read_position_first_buf: u32, ++ pub puc_write_position_second_buf: *mut u8, ++ pub ui_writable_byte_second_buf: u32, ++ pub ui_min_write_byte_second_buf: u32, ++ pub ui_read_position_second_buf: u32, ++ } ++ ++ pub struct SceCtrlData { ++ pub timestamp: u32, ++ pub buttons: i32, ++ pub lx: u8, ++ pub ly: u8, ++ pub rsrv: [u8; 6], ++ } ++ ++ pub struct SceCtrlLatch { ++ pub ui_make: u32, ++ pub ui_break: u32, ++ pub ui_press: u32, ++ pub ui_release: u32, ++ } ++ ++ pub struct GeStack { ++ pub stack: [u32; 8], ++ } ++ ++ pub struct GeCallbackData { ++ pub signal_func: Option, ++ pub signal_arg: *mut c_void, ++ pub finish_func: Option, ++ pub finish_arg: *mut c_void, ++ } ++ ++ pub struct GeListArgs { ++ pub size: u32, ++ pub context: *mut GeContext, ++ pub num_stacks: u32, ++ pub stacks: *mut GeStack, ++ } ++ ++ pub struct GeBreakParam { ++ pub buf: [u32; 4], ++ } ++ ++ pub struct SceKernelLoadExecParam { ++ pub size: usize, ++ pub args: usize, ++ pub argp: *mut c_void, ++ pub key: *const u8, ++ } ++ ++ pub struct timeval { ++ pub tv_sec: i32, ++ pub tv_usec: i32, ++ } ++ ++ pub struct timezone { ++ pub tz_minutes_west: i32, ++ pub tz_dst_time: i32, ++ } ++ ++ pub struct IntrHandlerOptionParam { ++ size: i32, ++ entry: u32, ++ common: u32, ++ gp: u32, ++ intr_code: u16, ++ sub_count: u16, ++ intr_level: u16, ++ enabled: u16, ++ calls: u32, ++ field_1c: u32, ++ total_clock_lo: u32, ++ total_clock_hi: u32, ++ min_clock_lo: u32, ++ min_clock_hi: u32, ++ max_clock_lo: u32, ++ max_clock_hi: u32, ++ } ++ ++ pub struct SceKernelLMOption { ++ pub size: usize, ++ pub m_pid_text: SceUid, ++ pub m_pid_data: SceUid, ++ pub flags: u32, ++ pub position: u8, ++ pub access: u8, ++ pub c_reserved: [u8; 2usize], ++ } ++ ++ pub struct SceKernelSMOption { ++ pub size: usize, ++ pub m_pid_stack: SceUid, ++ pub stack_size: usize, ++ pub priority: i32, ++ pub attribute: u32, ++ } ++ ++ pub struct SceKernelModuleInfo { ++ pub size: usize, ++ pub n_segment: u8, ++ pub reserved: [u8; 3usize], ++ pub segment_addr: [i32; 4usize], ++ pub segment_size: [i32; 4usize], ++ pub entry_addr: u32, ++ pub gp_value: u32, ++ pub text_addr: u32, ++ pub text_size: u32, ++ pub data_size: u32, ++ pub bss_size: u32, ++ pub attribute: u16, ++ pub version: [u8; 2usize], ++ pub name: [u8; 28usize], ++ } ++ ++ pub struct DebugProfilerRegs { ++ pub enable: u32, ++ pub systemck: u32, ++ pub cpuck: u32, ++ pub internal: u32, ++ pub memory: u32, ++ pub copz: u32, ++ pub vfpu: u32, ++ pub sleep: u32, ++ pub bus_access: u32, ++ pub uncached_load: u32, ++ pub uncached_store: u32, ++ pub cached_load: u32, ++ pub cached_store: u32, ++ pub i_miss: u32, ++ pub d_miss: u32, ++ pub d_writeback: u32, ++ pub cop0_inst: u32, ++ pub fpu_inst: u32, ++ pub vfpu_inst: u32, ++ pub local_bus: u32, ++ } ++ ++ pub struct SceKernelSysClock { ++ pub low: u32, ++ pub hi: u32, ++ } ++ ++ pub struct SceKernelThreadOptParam { ++ pub size: usize, ++ pub stack_mpid: SceUid, ++ } ++ ++ pub struct SceKernelThreadInfo { ++ pub size: usize, ++ pub name: [u8; 32], ++ pub attr: u32, ++ pub status: i32, ++ pub entry: SceKernelThreadEntry, ++ pub stack: *mut c_void, ++ pub stack_size: i32, ++ pub gp_reg: *mut c_void, ++ pub init_priority: i32, ++ pub current_priority: i32, ++ pub wait_type: i32, ++ pub wait_id: SceUid, ++ pub wakeup_count: i32, ++ pub exit_status: i32, ++ pub run_clocks: SceKernelSysClock, ++ pub intr_preempt_count: u32, ++ pub thread_preempt_count: u32, ++ pub release_count: u32, ++ } ++ ++ pub struct SceKernelThreadRunStatus { ++ pub size: usize, ++ pub status: i32, ++ pub current_priority: i32, ++ pub wait_type: i32, ++ pub wait_id: i32, ++ pub wakeup_count: i32, ++ pub run_clocks: SceKernelSysClock, ++ pub intr_preempt_count: u32, ++ pub thread_preempt_count: u32, ++ pub release_count: u32, ++ } ++ ++ pub struct SceKernelSemaOptParam { ++ pub size: usize, ++ } ++ ++ pub struct SceKernelSemaInfo { ++ pub size: usize, ++ pub name: [u8; 32], ++ pub attr: u32, ++ pub init_count: i32, ++ pub current_count: i32, ++ pub max_count: i32, ++ pub num_wait_threads: i32, ++ } ++ ++ pub struct SceKernelEventFlagInfo { ++ pub size: usize, ++ pub name: [u8; 32], ++ pub attr: u32, ++ pub init_pattern: u32, ++ pub current_pattern: u32, ++ pub num_wait_threads: i32, ++ } ++ ++ pub struct SceKernelEventFlagOptParam { ++ pub size: usize, ++ } ++ ++ pub struct SceKernelMbxOptParam { ++ pub size: usize, ++ } ++ ++ pub struct SceKernelMbxInfo { ++ pub size: usize, ++ pub name: [u8; 32usize], ++ pub attr: u32, ++ pub num_wait_threads: i32, ++ pub num_messages: i32, ++ pub first_message: *mut c_void, ++ } ++ ++ pub struct SceKernelVTimerInfo { ++ pub size: usize, ++ pub name: [u8; 32], ++ pub active: i32, ++ pub base: SceKernelSysClock, ++ pub current: SceKernelSysClock, ++ pub schedule: SceKernelSysClock, ++ pub handler: SceKernelVTimerHandler, ++ pub common: *mut c_void, ++ } ++ ++ pub struct SceKernelThreadEventHandlerInfo { ++ pub size: usize, ++ pub name: [u8; 32], ++ pub thread_id: SceUid, ++ pub mask: i32, ++ pub handler: SceKernelThreadEventHandler, ++ pub common: *mut c_void, ++ } ++ ++ pub struct SceKernelAlarmInfo { ++ pub size: usize, ++ pub schedule: SceKernelSysClock, ++ pub handler: SceKernelAlarmHandler, ++ pub common: *mut c_void, ++ } ++ ++ pub struct SceKernelSystemStatus { ++ pub size: usize, ++ pub status: u32, ++ pub idle_clocks: SceKernelSysClock, ++ pub comes_out_of_idle_count: u32, ++ pub thread_switch_count: u32, ++ pub vfpu_switch_count: u32, ++ } ++ ++ pub struct SceKernelMppInfo { ++ pub size: usize, ++ pub name: [u8; 32], ++ pub attr: u32, ++ pub buf_size: i32, ++ pub free_size: i32, ++ pub num_send_wait_threads: i32, ++ pub num_receive_wait_threads: i32, ++ } ++ ++ pub struct SceKernelVplOptParam { ++ pub size: usize, ++ } ++ ++ pub struct SceKernelVplInfo { ++ pub size: usize, ++ pub name: [u8; 32], ++ pub attr: u32, ++ pub pool_size: i32, ++ pub free_size: i32, ++ pub num_wait_threads: i32, ++ } ++ ++ pub struct SceKernelFplOptParam { ++ pub size: usize, ++ } ++ ++ pub struct SceKernelFplInfo { ++ pub size: usize, ++ pub name: [u8; 32usize], ++ pub attr: u32, ++ pub block_size: i32, ++ pub num_blocks: i32, ++ pub free_blocks: i32, ++ pub num_wait_threads: i32, ++ } ++ ++ pub struct SceKernelVTimerOptParam { ++ pub size: usize, ++ } ++ ++ pub struct SceKernelCallbackInfo { ++ pub size: usize, ++ pub name: [u8; 32usize], ++ pub thread_id: SceUid, ++ pub callback: SceKernelCallbackFunction, ++ pub common: *mut c_void, ++ pub notify_count: i32, ++ pub notify_arg: i32, ++ } ++ ++ pub struct UsbCamSetupStillParam { ++ pub size: i32, ++ pub resolution: UsbCamResolution, ++ pub jpeg_size: i32, ++ pub reverse_flags: i32, ++ pub delay: UsbCamDelay, ++ pub comp_level: i32, ++ } ++ ++ pub struct UsbCamSetupStillExParam { ++ pub size: i32, ++ pub unk: u32, ++ pub resolution: UsbCamResolutionEx, ++ pub jpeg_size: i32, ++ pub comp_level: i32, ++ pub unk2: u32, ++ pub unk3: u32, ++ pub flip: i32, ++ pub mirror: i32, ++ pub delay: UsbCamDelay, ++ pub unk4: [u32; 5usize], ++ } ++ ++ pub struct UsbCamSetupVideoParam { ++ pub size: i32, ++ pub resolution: UsbCamResolution, ++ pub framerate: UsbCamFrameRate, ++ pub white_balance: UsbCamWb, ++ pub saturation: i32, ++ pub brightness: i32, ++ pub contrast: i32, ++ pub sharpness: i32, ++ pub effect_mode: UsbCamEffectMode, ++ pub frame_size: i32, ++ pub unk: u32, ++ pub evl_evel: UsbCamEvLevel, ++ } ++ ++ pub struct UsbCamSetupVideoExParam { ++ pub size: i32, ++ pub unk: u32, ++ pub resolution: UsbCamResolutionEx, ++ pub framerate: UsbCamFrameRate, ++ pub unk2: u32, ++ pub unk3: u32, ++ pub white_balance: UsbCamWb, ++ pub saturation: i32, ++ pub brightness: i32, ++ pub contrast: i32, ++ pub sharpness: i32, ++ pub unk4: u32, ++ pub unk5: u32, ++ pub unk6: [u32; 3usize], ++ pub effect_mode: UsbCamEffectMode, ++ pub unk7: u32, ++ pub unk8: u32, ++ pub unk9: u32, ++ pub unk10: u32, ++ pub unk11: u32, ++ pub frame_size: i32, ++ pub unk12: u32, ++ pub ev_level: UsbCamEvLevel, ++ } ++ ++ pub struct ScePspDateTime { ++ pub year: u16, ++ pub month: u16, ++ pub day: u16, ++ pub hour: u16, ++ pub minutes: u16, ++ pub seconds: u16, ++ pub microseconds: u32, ++ } ++ ++ pub struct SceIoStat { ++ pub st_mode: i32, ++ pub st_attr: i32, ++ pub st_size: i64, ++ pub st_ctime: ScePspDateTime, ++ pub st_atime: ScePspDateTime, ++ pub st_mtime: ScePspDateTime, ++ pub st_private: [u32; 6usize], ++ } ++ ++ pub struct UmdInfo { ++ pub size: u32, ++ pub type_: UmdType, ++ } ++ ++ pub struct SceMpegRingbuffer { ++ pub packets: i32, ++ pub unk0: u32, ++ pub unk1: u32, ++ pub unk2: u32, ++ pub unk3: u32, ++ pub data: *mut c_void, ++ pub callback: SceMpegRingbufferCb, ++ pub cb_param: *mut c_void, ++ pub unk4: u32, ++ pub unk5: u32, ++ pub sce_mpeg: *mut c_void, ++ } ++ ++ pub struct SceMpegAu { ++ pub pts_msb: u32, ++ pub pts: u32, ++ pub dts_msb: u32, ++ pub dts: u32, ++ pub es_buffer: u32, ++ pub au_size: u32, ++ } ++ ++ pub struct SceMpegAvcMode { ++ pub unk0: i32, ++ pub pixel_format: super::DisplayPixelFormat, ++ } ++ ++ #[repr(align(64))] ++ pub struct SceMpegLLI { ++ pub src: *mut c_void, ++ pub dst: *mut c_void, ++ pub next: *mut c_void, ++ pub size: i32, ++ } ++ ++ #[repr(align(64))] ++ pub struct SceMpegYCrCbBuffer { ++ pub frame_buffer_height16: i32, ++ pub frame_buffer_width16: i32, ++ pub unknown: i32, ++ pub unknown2: i32, ++ pub y_buffer: *mut c_void, ++ pub y_buffer2: *mut c_void, ++ pub cr_buffer: *mut c_void, ++ pub cb_buffer: *mut c_void, ++ pub cr_buffer2: *mut c_void, ++ pub cb_buffer2: *mut c_void, ++ ++ pub frame_height: i32, ++ pub frame_width: i32, ++ pub frame_buffer_width: i32, ++ pub unknown3: [i32; 11usize], ++ } ++ ++ pub struct ScePspSRect { ++ pub x: i16, ++ pub y: i16, ++ pub w: i16, ++ pub h: i16, ++ } ++ ++ pub struct ScePspIRect { ++ pub x: i32, ++ pub y: i32, ++ pub w: i32, ++ pub h: i32, ++ } ++ ++ pub struct ScePspL64Rect { ++ pub x: u64, ++ pub y: u64, ++ pub w: u64, ++ pub h: u64, ++ } ++ ++ pub struct ScePspSVector2 { ++ pub x: i16, ++ pub y: i16, ++ } ++ ++ pub struct ScePspIVector2 { ++ pub x: i32, ++ pub y: i32, ++ } ++ ++ pub struct ScePspL64Vector2 { ++ pub x: u64, ++ pub y: u64, ++ } ++ ++ pub struct ScePspSVector3 { ++ pub x: i16, ++ pub y: i16, ++ pub z: i16, ++ } ++ ++ pub struct ScePspIVector3 { ++ pub x: i32, ++ pub y: i32, ++ pub z: i32, ++ } ++ ++ pub struct ScePspL64Vector3 { ++ pub x: u64, ++ pub y: u64, ++ pub z: u64, ++ } ++ ++ pub struct ScePspSVector4 { ++ pub x: i16, ++ pub y: i16, ++ pub z: i16, ++ pub w: i16, ++ } ++ ++ pub struct ScePspIVector4 { ++ pub x: i32, ++ pub y: i32, ++ pub z: i32, ++ pub w: i32, ++ } ++ ++ pub struct ScePspL64Vector4 { ++ pub x: u64, ++ pub y: u64, ++ pub z: u64, ++ pub w: u64, ++ } ++ ++ pub struct ScePspIMatrix2 { ++ pub x: ScePspIVector2, ++ pub y: ScePspIVector2, ++ } ++ ++ pub struct ScePspIMatrix3 { ++ pub x: ScePspIVector3, ++ pub y: ScePspIVector3, ++ pub z: ScePspIVector3, ++ } ++ ++ #[repr(align(16))] ++ pub struct ScePspIMatrix4 { ++ pub x: ScePspIVector4, ++ pub y: ScePspIVector4, ++ pub z: ScePspIVector4, ++ pub w: ScePspIVector4, ++ } ++ ++ pub struct ScePspIMatrix4Unaligned { ++ pub x: ScePspIVector4, ++ pub y: ScePspIVector4, ++ pub z: ScePspIVector4, ++ pub w: ScePspIVector4, ++ } ++ ++ pub struct SceMp3InitArg { ++ pub mp3_stream_start: u32, ++ pub unk1: u32, ++ pub mp3_stream_end: u32, ++ pub unk2: u32, ++ pub mp3_buf: *mut c_void, ++ pub mp3_buf_size: i32, ++ pub pcm_buf: *mut c_void, ++ pub pcm_buf_size: i32, ++ } ++ ++ pub struct OpenPSID { ++ pub data: [u8; 16usize], ++ } ++ ++ pub struct UtilityDialogCommon { ++ pub size: u32, ++ pub language: SystemParamLanguage, ++ pub button_accept: UtilityDialogButtonAccept, ++ pub graphics_thread: i32, ++ pub access_thread: i32, ++ pub font_thread: i32, ++ pub sound_thread: i32, ++ pub result: i32, ++ pub reserved: [i32; 4usize], ++ } ++ ++ pub struct UtilityNetconfAdhoc { ++ pub name: [u8; 8usize], ++ pub timeout: u32, ++ } ++ ++ pub struct UtilityNetconfData { ++ pub base: UtilityDialogCommon, ++ pub action: UtilityNetconfAction, ++ pub adhocparam: *mut UtilityNetconfAdhoc, ++ pub hotspot: i32, ++ pub hotspot_connected: i32, ++ pub wifisp: i32, ++ } ++ ++ pub struct UtilitySavedataFileData { ++ pub buf: *mut c_void, ++ pub buf_size: usize, ++ pub size: usize, ++ pub unknown: i32, ++ } ++ ++ pub struct UtilitySavedataListSaveNewData { ++ pub icon0: UtilitySavedataFileData, ++ pub title: *mut u8, ++ } ++ ++ pub struct UtilityGameSharingParams { ++ pub base: UtilityDialogCommon, ++ pub unknown1: i32, ++ pub unknown2: i32, ++ pub name: [u8; 8usize], ++ pub unknown3: i32, ++ pub unknown4: i32, ++ pub unknown5: i32, ++ pub result: i32, ++ pub filepath: *mut u8, ++ pub mode: UtilityGameSharingMode, ++ pub datatype: UtilityGameSharingDataType, ++ pub data: *mut c_void, ++ pub datasize: u32, ++ } ++ ++ pub struct UtilityHtmlViewerParam { ++ pub base: UtilityDialogCommon, ++ pub memaddr: *mut c_void, ++ pub memsize: u32, ++ pub unknown1: i32, ++ pub unknown2: i32, ++ pub initialurl: *mut u8, ++ pub numtabs: u32, ++ pub interfacemode: UtilityHtmlViewerInterfaceMode, ++ pub options: i32, ++ pub dldirname: *mut u8, ++ pub dlfilename: *mut u8, ++ pub uldirname: *mut u8, ++ pub ulfilename: *mut u8, ++ pub cookiemode: UtilityHtmlViewerCookieMode, ++ pub unknown3: u32, ++ pub homeurl: *mut u8, ++ pub textsize: UtilityHtmlViewerTextSize, ++ pub displaymode: UtilityHtmlViewerDisplayMode, ++ pub connectmode: UtilityHtmlViewerConnectMode, ++ pub disconnectmode: UtilityHtmlViewerDisconnectMode, ++ pub memused: u32, ++ pub unknown4: [i32; 10usize], ++ } ++ ++ pub struct SceUtilityOskData { ++ pub unk_00: i32, ++ pub unk_04: i32, ++ pub language: SceUtilityOskInputLanguage, ++ pub unk_12: i32, ++ pub inputtype: SceUtilityOskInputType, ++ pub lines: i32, ++ pub unk_24: i32, ++ pub desc: *mut u16, ++ pub intext: *mut u16, ++ pub outtextlength: i32, ++ pub outtext: *mut u16, ++ pub result: SceUtilityOskResult, ++ pub outtextlimit: i32, ++ } ++ ++ pub struct SceUtilityOskParams { ++ pub base: UtilityDialogCommon, ++ pub datacount: i32, ++ pub data: *mut SceUtilityOskData, ++ pub state: SceUtilityOskState, ++ pub unk_60: i32, ++ } ++ ++ pub struct SceNetMallocStat { ++ pub pool: i32, ++ pub maximum: i32, ++ pub free: i32, ++ } ++ ++ pub struct SceNetAdhocctlAdhocId { ++ pub unknown: i32, ++ pub adhoc_id: [u8; 9usize], ++ pub unk: [u8; 3usize], ++ } ++ ++ pub struct SceNetAdhocctlScanInfo { ++ pub next: *mut SceNetAdhocctlScanInfo, ++ pub channel: i32, ++ pub name: [u8; 8usize], ++ pub bssid: [u8; 6usize], ++ pub unknown: [u8; 2usize], ++ pub unknown2: i32, ++ } ++ ++ pub struct SceNetAdhocctlGameModeInfo { ++ pub count: i32, ++ pub macs: [[u8; 6usize]; 16usize], ++ } ++ ++ pub struct SceNetAdhocPtpStat { ++ pub next: *mut SceNetAdhocPtpStat, ++ pub ptp_id: i32, ++ pub mac: [u8; 6usize], ++ pub peermac: [u8; 6usize], ++ pub port: u16, ++ pub peerport: u16, ++ pub sent_data: u32, ++ pub rcvd_data: u32, ++ pub state: ScePspnetAdhocPtpState, ++ } ++ ++ pub struct SceNetAdhocPdpStat { ++ pub next: *mut SceNetAdhocPdpStat, ++ pub pdp_id: i32, ++ pub mac: [u8; 6usize], ++ pub port: u16, ++ pub rcvd_data: u32, ++ } ++ ++ pub struct AdhocPoolStat { ++ pub size: i32, ++ pub maxsize: i32, ++ pub freesize: i32, ++ } ++} ++ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ pub struct GeContext { ++ pub context: [u32; 512], ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub struct SceKernelUtilsSha1Context { ++ pub h: [u32; 5usize], ++ pub us_remains: u16, ++ pub us_computed: u16, ++ pub ull_total_len: u64, ++ pub buf: [u8; 64usize], ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub struct SceKernelUtilsMt19937Context { ++ pub count: u32, ++ pub state: [u32; 624usize], ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub struct SceKernelUtilsMd5Context { ++ pub h: [u32; 4usize], ++ pub pad: u32, ++ pub us_remains: u16, ++ pub us_computed: u16, ++ pub ull_total_len: u64, ++ pub buf: [u8; 64usize], ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub struct SceIoDirent { ++ pub d_stat: SceIoStat, ++ pub d_name: [u8; 256usize], ++ pub d_private: *mut c_void, ++ pub dummy: i32, ++ } ++ ++ #[cfg_attr(feature = "extra_traits", derive(Debug))] ++ pub struct ScePspFRect { ++ pub x: f32, ++ pub y: f32, ++ pub w: f32, ++ pub h: f32, ++ } ++ ++ #[repr(align(16))] ++ #[cfg_attr(feature = "extra_traits", derive(Debug))] ++ pub struct ScePspFVector3 { ++ pub x: f32, ++ pub y: f32, ++ pub z: f32, ++ } ++ ++ #[repr(align(16))] ++ #[cfg_attr(feature = "extra_traits", derive(Debug))] ++ pub struct ScePspFVector4 { ++ pub x: f32, ++ pub y: f32, ++ pub z: f32, ++ pub w: f32, ++ } ++ ++ #[cfg_attr(feature = "extra_traits", derive(Debug))] ++ pub struct ScePspFVector4Unaligned { ++ pub x: f32, ++ pub y: f32, ++ pub z: f32, ++ pub w: f32, ++ } ++ ++ #[cfg_attr(feature = "extra_traits", derive(Debug))] ++ pub struct ScePspFVector2 { ++ pub x: f32, ++ pub y: f32, ++ } ++ ++ #[cfg_attr(feature = "extra_traits", derive(Debug))] ++ pub struct ScePspFMatrix2 { ++ pub x: ScePspFVector2, ++ pub y: ScePspFVector2, ++ } ++ ++ #[cfg_attr(feature = "extra_traits", derive(Debug))] ++ pub struct ScePspFMatrix3 { ++ pub x: ScePspFVector3, ++ pub y: ScePspFVector3, ++ pub z: ScePspFVector3, ++ } ++ ++ #[cfg_attr(feature = "extra_traits", derive(Debug))] ++ #[repr(align(16))] ++ pub struct ScePspFMatrix4 { ++ pub x: ScePspFVector4, ++ pub y: ScePspFVector4, ++ pub z: ScePspFVector4, ++ pub w: ScePspFVector4, ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub struct ScePspFMatrix4Unaligned { ++ pub x: ScePspFVector4, ++ pub y: ScePspFVector4, ++ pub z: ScePspFVector4, ++ pub w: ScePspFVector4, ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub union ScePspVector3 { ++ pub fv: ScePspFVector3, ++ pub iv: ScePspIVector3, ++ pub f: [f32; 3usize], ++ pub i: [i32; 3usize], ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub union ScePspVector4 { ++ pub fv: ScePspFVector4, ++ pub iv: ScePspIVector4, ++ pub qw: u128, ++ pub f: [f32; 4usize], ++ pub i: [i32; 4usize], ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub union ScePspMatrix2 { ++ pub fm: ScePspFMatrix2, ++ pub im: ScePspIMatrix2, ++ pub fv: [ScePspFVector2; 2usize], ++ pub iv: [ScePspIVector2; 2usize], ++ pub v: [ScePspVector2; 2usize], ++ pub f: [[f32; 2usize]; 2usize], ++ pub i: [[i32; 2usize]; 2usize], ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub union ScePspMatrix3 { ++ pub fm: ScePspFMatrix3, ++ pub im: ScePspIMatrix3, ++ pub fv: [ScePspFVector3; 3usize], ++ pub iv: [ScePspIVector3; 3usize], ++ pub v: [ScePspVector3; 3usize], ++ pub f: [[f32; 3usize]; 3usize], ++ pub i: [[i32; 3usize]; 3usize], ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub union ScePspVector2 { ++ pub fv: ScePspFVector2, ++ pub iv: ScePspIVector2, ++ pub f: [f32; 2usize], ++ pub i: [i32; 2usize], ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub union ScePspMatrix4 { ++ pub fm: ScePspFMatrix4, ++ pub im: ScePspIMatrix4, ++ pub fv: [ScePspFVector4; 4usize], ++ pub iv: [ScePspIVector4; 4usize], ++ pub v: [ScePspVector4; 4usize], ++ pub f: [[f32; 4usize]; 4usize], ++ pub i: [[i32; 4usize]; 4usize], ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub struct Key { ++ pub key_type: KeyType, ++ pub name: [u8; 256usize], ++ pub name_len: u32, ++ pub unk2: u32, ++ pub unk3: u32, ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub struct UtilityMsgDialogParams { ++ pub base: UtilityDialogCommon, ++ pub unknown: i32, ++ pub mode: UtilityMsgDialogMode, ++ pub error_value: u32, ++ pub message: [u8; 512usize], ++ pub options: i32, ++ pub button_pressed: UtilityMsgDialogPressed, ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub union UtilityNetData { ++ pub as_uint: u32, ++ pub as_string: [u8; 128usize], ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub struct UtilitySavedataSFOParam { ++ pub title: [u8; 128usize], ++ pub savedata_title: [u8; 128usize], ++ pub detail: [u8; 1024usize], ++ pub parental_level: u8, ++ pub unknown: [u8; 3usize], ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub struct SceUtilitySavedataParam { ++ pub base: UtilityDialogCommon, ++ pub mode: UtilitySavedataMode, ++ pub unknown1: i32, ++ pub overwrite: i32, ++ pub game_name: [u8; 13usize], ++ pub reserved: [u8; 3usize], ++ pub save_name: [u8; 20usize], ++ pub save_name_list: *mut [u8; 20usize], ++ pub file_name: [u8; 13usize], ++ pub reserved1: [u8; 3usize], ++ pub data_buf: *mut c_void, ++ pub data_buf_size: usize, ++ pub data_size: usize, ++ pub sfo_param: UtilitySavedataSFOParam, ++ pub icon0_file_data: UtilitySavedataFileData, ++ pub icon1_file_data: UtilitySavedataFileData, ++ pub pic1_file_data: UtilitySavedataFileData, ++ pub snd0_file_data: UtilitySavedataFileData, ++ pub new_data: *mut UtilitySavedataListSaveNewData, ++ pub focus: UtilitySavedataFocus, ++ pub unknown2: [i32; 4usize], ++ pub key: [u8; 16], ++ pub unknown3: [u8; 20], ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub struct SceNetAdhocctlPeerInfo { ++ pub next: *mut SceNetAdhocctlPeerInfo, ++ pub nickname: [u8; 128usize], ++ pub mac: [u8; 6usize], ++ pub unknown: [u8; 6usize], ++ pub timestamp: u32, ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub struct SceNetAdhocctlParams { ++ pub channel: i32, ++ pub name: [u8; 8usize], ++ pub bssid: [u8; 6usize], ++ pub nickname: [u8; 128usize], ++ } ++ ++ #[cfg_attr(feature = "extra_traits", allow(missing_debug_implementations))] ++ pub union SceNetApctlInfo { ++ pub name: [u8; 64usize], ++ pub bssid: [u8; 6usize], ++ pub ssid: [u8; 32usize], ++ pub ssid_length: u32, ++ pub security_type: u32, ++ pub strength: u8, ++ pub channel: u8, ++ pub power_save: u8, ++ pub ip: [u8; 16usize], ++ pub sub_net_mask: [u8; 16usize], ++ pub gateway: [u8; 16usize], ++ pub primary_dns: [u8; 16usize], ++ pub secondary_dns: [u8; 16usize], ++ pub use_proxy: u32, ++ pub proxy_url: [u8; 128usize], ++ pub proxy_port: u16, ++ pub eap_type: u32, ++ pub start_browser: u32, ++ pub wifisp: u32, ++ } ++} ++ ++pub const INT_MIN: c_int = -2147483648; ++pub const INT_MAX: c_int = 2147483647; ++ ++pub const AUDIO_VOLUME_MAX: u32 = 0x8000; ++pub const AUDIO_CHANNEL_MAX: u32 = 8; ++pub const AUDIO_NEXT_CHANNEL: i32 = -1; ++pub const AUDIO_SAMPLE_MIN: u32 = 64; ++pub const AUDIO_SAMPLE_MAX: u32 = 65472; ++ ++pub const PSP_CTRL_SELECT: i32 = 0x000001; ++pub const PSP_CTRL_START: i32 = 0x000008; ++pub const PSP_CTRL_UP: i32 = 0x000010; ++pub const PSP_CTRL_RIGHT: i32 = 0x000020; ++pub const PSP_CTRL_DOWN: i32 = 0x000040; ++pub const PSP_CTRL_LEFT: i32 = 0x000080; ++pub const PSP_CTRL_LTRIGGER: i32 = 0x000100; ++pub const PSP_CTRL_RTRIGGER: i32 = 0x000200; ++pub const PSP_CTRL_TRIANGLE: i32 = 0x001000; ++pub const PSP_CTRL_CIRCLE: i32 = 0x002000; ++pub const PSP_CTRL_CROSS: i32 = 0x004000; ++pub const PSP_CTRL_SQUARE: i32 = 0x008000; ++pub const PSP_CTRL_HOME: i32 = 0x010000; ++pub const PSP_CTRL_HOLD: i32 = 0x020000; ++pub const PSP_CTRL_NOTE: i32 = 0x800000; ++pub const PSP_CTRL_SCREEN: i32 = 0x400000; ++pub const PSP_CTRL_VOLUP: i32 = 0x100000; ++pub const PSP_CTRL_VOLDOWN: i32 = 0x200000; ++pub const PSP_CTRL_WLAN_UP: i32 = 0x040000; ++pub const PSP_CTRL_REMOTE: i32 = 0x080000; ++pub const PSP_CTRL_DISC: i32 = 0x1000000; ++pub const PSP_CTRL_MS: i32 = 0x2000000; ++ ++pub const USB_CAM_PID: i32 = 0x282; ++pub const USB_BUS_DRIVER_NAME: &str = "USBBusDriver"; ++pub const USB_CAM_DRIVER_NAME: &str = "USBCamDriver"; ++pub const USB_CAM_MIC_DRIVER_NAME: &str = "USBCamMicDriver"; ++pub const USB_STOR_DRIVER_NAME: &str = "USBStor_Driver"; ++ ++pub const ACTIVATED: i32 = 0x200; ++pub const CONNECTED: i32 = 0x020; ++pub const ESTABLISHED: i32 = 0x002; ++ ++pub const USB_CAM_FLIP: i32 = 1; ++pub const USB_CAM_MIRROR: i32 = 0x100; ++ ++pub const THREAD_ATTR_VFPU: i32 = 0x00004000; ++pub const THREAD_ATTR_USER: i32 = 0x80000000; ++pub const THREAD_ATTR_USBWLAN: i32 = 0xa0000000; ++pub const THREAD_ATTR_VSH: i32 = 0xc0000000; ++pub const THREAD_ATTR_SCRATCH_SRAM: i32 = 0x00008000; ++pub const THREAD_ATTR_NO_FILLSTACK: i32 = 0x00100000; ++pub const THREAD_ATTR_CLEAR_STACK: i32 = 0x00200000; ++ ++pub const EVENT_WAIT_MULTIPLE: i32 = 0x200; ++ ++pub const EVENT_WAIT_AND: i32 = 0; ++pub const EVENT_WAIT_OR: i32 = 1; ++pub const EVENT_WAIT_CLEAR: i32 = 0x20; ++ ++pub const POWER_INFO_POWER_SWITCH: i32 = 0x80000000; ++pub const POWER_INFO_HOLD_SWITCH: i32 = 0x40000000; ++pub const POWER_INFO_STANDBY: i32 = 0x00080000; ++pub const POWER_INFO_RESUME_COMPLETE: i32 = 0x00040000; ++pub const POWER_INFO_RESUMING: i32 = 0x00020000; ++pub const POWER_INFO_SUSPENDING: i32 = 0x00010000; ++pub const POWER_INFO_AC_POWER: i32 = 0x00001000; ++pub const POWER_INFO_BATTERY_LOW: i32 = 0x00000100; ++pub const POWER_INFO_BATTERY_EXIST: i32 = 0x00000080; ++pub const POWER_INFO_BATTERY_POWER: i32 = 0x0000007; ++ ++pub const FIO_S_IFLNK: i32 = 0x4000; ++pub const FIO_S_IFDIR: i32 = 0x1000; ++pub const FIO_S_IFREG: i32 = 0x2000; ++pub const FIO_S_ISUID: i32 = 0x0800; ++pub const FIO_S_ISGID: i32 = 0x0400; ++pub const FIO_S_ISVTX: i32 = 0x0200; ++pub const FIO_S_IRUSR: i32 = 0x0100; ++pub const FIO_S_IWUSR: i32 = 0x0080; ++pub const FIO_S_IXUSR: i32 = 0x0040; ++pub const FIO_S_IRGRP: i32 = 0x0020; ++pub const FIO_S_IWGRP: i32 = 0x0010; ++pub const FIO_S_IXGRP: i32 = 0x0008; ++pub const FIO_S_IROTH: i32 = 0x0004; ++pub const FIO_S_IWOTH: i32 = 0x0002; ++pub const FIO_S_IXOTH: i32 = 0x0001; ++ ++pub const FIO_SO_IFLNK: i32 = 0x0008; ++pub const FIO_SO_IFDIR: i32 = 0x0010; ++pub const FIO_SO_IFREG: i32 = 0x0020; ++pub const FIO_SO_IROTH: i32 = 0x0004; ++pub const FIO_SO_IWOTH: i32 = 0x0002; ++pub const FIO_SO_IXOTH: i32 = 0x0001; ++ ++pub const PSP_O_RD_ONLY: i32 = 0x0001; ++pub const PSP_O_WR_ONLY: i32 = 0x0002; ++pub const PSP_O_RD_WR: i32 = 0x0003; ++pub const PSP_O_NBLOCK: i32 = 0x0004; ++pub const PSP_O_DIR: i32 = 0x0008; ++pub const PSP_O_APPEND: i32 = 0x0100; ++pub const PSP_O_CREAT: i32 = 0x0200; ++pub const PSP_O_TRUNC: i32 = 0x0400; ++pub const PSP_O_EXCL: i32 = 0x0800; ++pub const PSP_O_NO_WAIT: i32 = 0x8000; ++ ++pub const UMD_NOT_PRESENT: i32 = 0x01; ++pub const UMD_PRESENT: i32 = 0x02; ++pub const UMD_CHANGED: i32 = 0x04; ++pub const UMD_INITING: i32 = 0x08; ++pub const UMD_INITED: i32 = 0x10; ++pub const UMD_READY: i32 = 0x20; ++ ++pub const PLAY_PAUSE: i32 = 0x1; ++pub const FORWARD: i32 = 0x4; ++pub const BACK: i32 = 0x8; ++pub const VOL_UP: i32 = 0x10; ++pub const VOL_DOWN: i32 = 0x20; ++pub const HOLD: i32 = 0x80; ++ ++pub const GU_PI: f32 = 3.141593; ++ ++pub const GU_TEXTURE_8BIT: i32 = 1; ++pub const GU_TEXTURE_16BIT: i32 = 2; ++pub const GU_TEXTURE_32BITF: i32 = 3; ++pub const GU_COLOR_5650: i32 = 4 << 2; ++pub const GU_COLOR_5551: i32 = 5 << 2; ++pub const GU_COLOR_4444: i32 = 6 << 2; ++pub const GU_COLOR_8888: i32 = 7 << 2; ++pub const GU_NORMAL_8BIT: i32 = 1 << 5; ++pub const GU_NORMAL_16BIT: i32 = 2 << 5; ++pub const GU_NORMAL_32BITF: i32 = 3 << 5; ++pub const GU_VERTEX_8BIT: i32 = 1 << 7; ++pub const GU_VERTEX_16BIT: i32 = 2 << 7; ++pub const GU_VERTEX_32BITF: i32 = 3 << 7; ++pub const GU_WEIGHT_8BIT: i32 = 1 << 9; ++pub const GU_WEIGHT_16BIT: i32 = 2 << 9; ++pub const GU_WEIGHT_32BITF: i32 = 3 << 9; ++pub const GU_INDEX_8BIT: i32 = 1 << 11; ++pub const GU_INDEX_16BIT: i32 = 2 << 11; ++pub const GU_WEIGHTS1: i32 = (((1 - 1) & 7) << 14) as i32; ++pub const GU_WEIGHTS2: i32 = (((2 - 1) & 7) << 14) as i32; ++pub const GU_WEIGHTS3: i32 = (((3 - 1) & 7) << 14) as i32; ++pub const GU_WEIGHTS4: i32 = (((4 - 1) & 7) << 14) as i32; ++pub const GU_WEIGHTS5: i32 = (((5 - 1) & 7) << 14) as i32; ++pub const GU_WEIGHTS6: i32 = (((6 - 1) & 7) << 14) as i32; ++pub const GU_WEIGHTS7: i32 = (((7 - 1) & 7) << 14) as i32; ++pub const GU_WEIGHTS8: i32 = (((8 - 1) & 7) << 14) as i32; ++pub const GU_VERTICES1: i32 = (((1 - 1) & 7) << 18) as i32; ++pub const GU_VERTICES2: i32 = (((2 - 1) & 7) << 18) as i32; ++pub const GU_VERTICES3: i32 = (((3 - 1) & 7) << 18) as i32; ++pub const GU_VERTICES4: i32 = (((4 - 1) & 7) << 18) as i32; ++pub const GU_VERTICES5: i32 = (((5 - 1) & 7) << 18) as i32; ++pub const GU_VERTICES6: i32 = (((6 - 1) & 7) << 18) as i32; ++pub const GU_VERTICES7: i32 = (((7 - 1) & 7) << 18) as i32; ++pub const GU_VERTICES8: i32 = (((8 - 1) & 7) << 18) as i32; ++pub const GU_TRANSFORM_2D: i32 = 1 << 23; ++pub const GU_TRANSFORM_3D: i32 = 0; ++ ++pub const GU_COLOR_BUFFER_BIT: i32 = 1; ++pub const GU_STENCIL_BUFFER_BIT: i32 = 2; ++pub const GU_DEPTH_BUFFER_BIT: i32 = 4; ++pub const GU_FAST_CLEAR_BIT: i32 = 16; ++ ++pub const GU_AMBIENT: i32 = 1; ++pub const GU_DIFFUSE: i32 = 2; ++pub const GU_SPECULAR: i32 = 4; ++pub const GU_UNKNOWN_LIGHT_COMPONENT: i32 = 8; ++ ++pub const SYSTEM_REGISTRY: [u8; 7] = *b"/system"; ++pub const REG_KEYNAME_SIZE: u32 = 27; ++ ++pub const UTILITY_MSGDIALOG_ERROR: i32 = 0; ++pub const UTILITY_MSGDIALOG_TEXT: i32 = 1; ++pub const UTILITY_MSGDIALOG_YES_NO_BUTTONS: i32 = 0x10; ++pub const UTILITY_MSGDIALOG_DEFAULT_NO: i32 = 0x100; ++ ++pub const UTILITY_HTMLVIEWER_OPEN_SCE_START_PAGE: i32 = 0x000001; ++pub const UTILITY_HTMLVIEWER_DISABLE_STARTUP_LIMITS: i32 = 0x000002; ++pub const UTILITY_HTMLVIEWER_DISABLE_EXIT_DIALOG: i32 = 0x000004; ++pub const UTILITY_HTMLVIEWER_DISABLE_CURSOR: i32 = 0x000008; ++pub const UTILITY_HTMLVIEWER_DISABLE_DOWNLOAD_COMPLETE_DIALOG: i32 = 0x000010; ++pub const UTILITY_HTMLVIEWER_DISABLE_DOWNLOAD_START_DIALOG: i32 = 0x000020; ++pub const UTILITY_HTMLVIEWER_DISABLE_DOWNLOAD_DESTINATION_DIALOG: i32 = 0x000040; ++pub const UTILITY_HTMLVIEWER_LOCK_DOWNLOAD_DESTINATION_DIALOG: i32 = 0x000080; ++pub const UTILITY_HTMLVIEWER_DISABLE_TAB_DISPLAY: i32 = 0x000100; ++pub const UTILITY_HTMLVIEWER_ENABLE_ANALOG_HOLD: i32 = 0x000200; ++pub const UTILITY_HTMLVIEWER_ENABLE_FLASH: i32 = 0x000400; ++pub const UTILITY_HTMLVIEWER_DISABLE_LRTRIGGER: i32 = 0x000800; ++ ++extern "C" { ++ pub fn sceAudioChReserve(channel: i32, sample_count: i32, format: AudioFormat) -> i32; ++ pub fn sceAudioChRelease(channel: i32) -> i32; ++ pub fn sceAudioOutput(channel: i32, vol: i32, buf: *mut c_void) -> i32; ++ pub fn sceAudioOutputBlocking(channel: i32, vol: i32, buf: *mut c_void) -> i32; ++ pub fn sceAudioOutputPanned( ++ channel: i32, ++ left_vol: i32, ++ right_vol: i32, ++ buf: *mut c_void, ++ ) -> i32; ++ pub fn sceAudioOutputPannedBlocking( ++ channel: i32, ++ left_vol: i32, ++ right_vol: i32, ++ buf: *mut c_void, ++ ) -> i32; ++ pub fn sceAudioGetChannelRestLen(channel: i32) -> i32; ++ pub fn sceAudioGetChannelRestLength(channel: i32) -> i32; ++ pub fn sceAudioSetChannelDataLen(channel: i32, sample_count: i32) -> i32; ++ pub fn sceAudioChangeChannelConfig(channel: i32, format: AudioFormat) -> i32; ++ pub fn sceAudioChangeChannelVolume(channel: i32, left_vol: i32, right_vol: i32) -> i32; ++ pub fn sceAudioOutput2Reserve(sample_count: i32) -> i32; ++ pub fn sceAudioOutput2Release() -> i32; ++ pub fn sceAudioOutput2ChangeLength(sample_count: i32) -> i32; ++ pub fn sceAudioOutput2OutputBlocking(vol: i32, buf: *mut c_void) -> i32; ++ pub fn sceAudioOutput2GetRestSample() -> i32; ++ pub fn sceAudioSRCChReserve( ++ sample_count: i32, ++ freq: AudioOutputFrequency, ++ channels: i32, ++ ) -> i32; ++ pub fn sceAudioSRCChRelease() -> i32; ++ pub fn sceAudioSRCOutputBlocking(vol: i32, buf: *mut c_void) -> i32; ++ pub fn sceAudioInputInit(unknown1: i32, gain: i32, unknown2: i32) -> i32; ++ pub fn sceAudioInputInitEx(params: *mut AudioInputParams) -> i32; ++ pub fn sceAudioInputBlocking(sample_count: i32, freq: AudioInputFrequency, buf: *mut c_void); ++ pub fn sceAudioInput(sample_count: i32, freq: AudioInputFrequency, buf: *mut c_void); ++ pub fn sceAudioGetInputLength() -> i32; ++ pub fn sceAudioWaitInputEnd() -> i32; ++ pub fn sceAudioPollInputEnd() -> i32; ++ ++ pub fn sceAtracGetAtracID(ui_codec_type: u32) -> i32; ++ pub fn sceAtracSetDataAndGetID(buf: *mut c_void, bufsize: usize) -> i32; ++ pub fn sceAtracDecodeData( ++ atrac_id: i32, ++ out_samples: *mut u16, ++ out_n: *mut i32, ++ out_end: *mut i32, ++ out_remain_frame: *mut i32, ++ ) -> i32; ++ pub fn sceAtracGetRemainFrame(atrac_id: i32, out_remain_frame: *mut i32) -> i32; ++ pub fn sceAtracGetStreamDataInfo( ++ atrac_id: i32, ++ write_pointer: *mut *mut u8, ++ available_bytes: *mut u32, ++ read_offset: *mut u32, ++ ) -> i32; ++ pub fn sceAtracAddStreamData(atrac_id: i32, bytes_to_add: u32) -> i32; ++ pub fn sceAtracGetBitrate(atrac_id: i32, out_bitrate: *mut i32) -> i32; ++ pub fn sceAtracSetLoopNum(atrac_id: i32, nloops: i32) -> i32; ++ pub fn sceAtracReleaseAtracID(atrac_id: i32) -> i32; ++ pub fn sceAtracGetNextSample(atrac_id: i32, out_n: *mut i32) -> i32; ++ pub fn sceAtracGetMaxSample(atrac_id: i32, out_max: *mut i32) -> i32; ++ pub fn sceAtracGetBufferInfoForReseting( ++ atrac_id: i32, ++ ui_sample: u32, ++ pbuffer_info: *mut Atrac3BufferInfo, ++ ) -> i32; ++ pub fn sceAtracGetChannel(atrac_id: i32, pui_channel: *mut u32) -> i32; ++ pub fn sceAtracGetInternalErrorInfo(atrac_id: i32, pi_result: *mut i32) -> i32; ++ pub fn sceAtracGetLoopStatus( ++ atrac_id: i32, ++ pi_loop_num: *mut i32, ++ pui_loop_status: *mut u32, ++ ) -> i32; ++ pub fn sceAtracGetNextDecodePosition(atrac_id: i32, pui_sample_position: *mut u32) -> i32; ++ pub fn sceAtracGetSecondBufferInfo( ++ atrac_id: i32, ++ pui_position: *mut u32, ++ pui_data_byte: *mut u32, ++ ) -> i32; ++ pub fn sceAtracGetSoundSample( ++ atrac_id: i32, ++ pi_end_sample: *mut i32, ++ pi_loop_start_sample: *mut i32, ++ pi_loop_end_sample: *mut i32, ++ ) -> i32; ++ pub fn sceAtracResetPlayPosition( ++ atrac_id: i32, ++ ui_sample: u32, ++ ui_write_byte_first_buf: u32, ++ ui_write_byte_second_buf: u32, ++ ) -> i32; ++ pub fn sceAtracSetData(atrac_id: i32, puc_buffer_addr: *mut u8, ui_buffer_byte: u32) -> i32; ++ pub fn sceAtracSetHalfwayBuffer( ++ atrac_id: i32, ++ puc_buffer_addr: *mut u8, ++ ui_read_byte: u32, ++ ui_buffer_byte: u32, ++ ) -> i32; ++ pub fn sceAtracSetHalfwayBufferAndGetID( ++ puc_buffer_addr: *mut u8, ++ ui_read_byte: u32, ++ ui_buffer_byte: u32, ++ ) -> i32; ++ pub fn sceAtracSetSecondBuffer( ++ atrac_id: i32, ++ puc_second_buffer_addr: *mut u8, ++ ui_second_buffer_byte: u32, ++ ) -> i32; ++ ++ pub fn sceCtrlSetSamplingCycle(cycle: i32) -> i32; ++ pub fn sceCtrlGetSamplingCycle(pcycle: *mut i32) -> i32; ++ pub fn sceCtrlSetSamplingMode(mode: CtrlMode) -> i32; ++ pub fn sceCtrlGetSamplingMode(pmode: *mut i32) -> i32; ++ pub fn sceCtrlPeekBufferPositive(pad_data: *mut SceCtrlData, count: i32) -> i32; ++ pub fn sceCtrlPeekBufferNegative(pad_data: *mut SceCtrlData, count: i32) -> i32; ++ pub fn sceCtrlReadBufferPositive(pad_data: *mut SceCtrlData, count: i32) -> i32; ++ pub fn sceCtrlReadBufferNegative(pad_data: *mut SceCtrlData, count: i32) -> i32; ++ pub fn sceCtrlPeekLatch(latch_data: *mut SceCtrlLatch) -> i32; ++ pub fn sceCtrlReadLatch(latch_data: *mut SceCtrlLatch) -> i32; ++ pub fn sceCtrlSetIdleCancelThreshold(idlereset: i32, idleback: i32) -> i32; ++ pub fn sceCtrlGetIdleCancelThreshold(idlereset: *mut i32, idleback: *mut i32) -> i32; ++ ++ pub fn sceDisplaySetMode(mode: DisplayMode, width: usize, height: usize) -> u32; ++ pub fn sceDisplayGetMode(pmode: *mut i32, pwidth: *mut i32, pheight: *mut i32) -> i32; ++ pub fn sceDisplaySetFrameBuf( ++ top_addr: *const u8, ++ buffer_width: usize, ++ pixel_format: DisplayPixelFormat, ++ sync: DisplaySetBufSync, ++ ) -> u32; ++ pub fn sceDisplayGetFrameBuf( ++ top_addr: *mut *mut c_void, ++ buffer_width: *mut usize, ++ pixel_format: *mut DisplayPixelFormat, ++ sync: DisplaySetBufSync, ++ ) -> i32; ++ pub fn sceDisplayGetVcount() -> u32; ++ pub fn sceDisplayWaitVblank() -> i32; ++ pub fn sceDisplayWaitVblankCB() -> i32; ++ pub fn sceDisplayWaitVblankStart() -> i32; ++ pub fn sceDisplayWaitVblankStartCB() -> i32; ++ pub fn sceDisplayGetAccumulatedHcount() -> i32; ++ pub fn sceDisplayGetCurrentHcount() -> i32; ++ pub fn sceDisplayGetFramePerSec() -> f32; ++ pub fn sceDisplayIsForeground() -> i32; ++ pub fn sceDisplayIsVblank() -> i32; ++ ++ pub fn sceGeEdramGetSize() -> u32; ++ pub fn sceGeEdramGetAddr() -> *mut u8; ++ pub fn sceGeEdramSetAddrTranslation(width: i32) -> i32; ++ pub fn sceGeGetCmd(cmd: i32) -> u32; ++ pub fn sceGeGetMtx(type_: GeMatrixType, matrix: *mut c_void) -> i32; ++ pub fn sceGeGetStack(stack_id: i32, stack: *mut GeStack) -> i32; ++ pub fn sceGeSaveContext(context: *mut GeContext) -> i32; ++ pub fn sceGeRestoreContext(context: *const GeContext) -> i32; ++ pub fn sceGeListEnQueue( ++ list: *const c_void, ++ stall: *mut c_void, ++ cbid: i32, ++ arg: *mut GeListArgs, ++ ) -> i32; ++ pub fn sceGeListEnQueueHead( ++ list: *const c_void, ++ stall: *mut c_void, ++ cbid: i32, ++ arg: *mut GeListArgs, ++ ) -> i32; ++ pub fn sceGeListDeQueue(qid: i32) -> i32; ++ pub fn sceGeListUpdateStallAddr(qid: i32, stall: *mut c_void) -> i32; ++ pub fn sceGeListSync(qid: i32, sync_type: i32) -> GeListState; ++ pub fn sceGeDrawSync(sync_type: i32) -> GeListState; ++ pub fn sceGeBreak(mode: i32, p_param: *mut GeBreakParam) -> i32; ++ pub fn sceGeContinue() -> i32; ++ pub fn sceGeSetCallback(cb: *mut GeCallbackData) -> i32; ++ pub fn sceGeUnsetCallback(cbid: i32) -> i32; ++ ++ pub fn sceKernelExitGame(); ++ pub fn sceKernelRegisterExitCallback(id: SceUid) -> i32; ++ pub fn sceKernelLoadExec(file: *const u8, param: *mut SceKernelLoadExecParam) -> i32; ++ ++ pub fn sceKernelAllocPartitionMemory( ++ partition: SceSysMemPartitionId, ++ name: *const u8, ++ type_: SceSysMemBlockTypes, ++ size: u32, ++ addr: *mut c_void, ++ ) -> SceUid; ++ pub fn sceKernelGetBlockHeadAddr(blockid: SceUid) -> *mut c_void; ++ pub fn sceKernelFreePartitionMemory(blockid: SceUid) -> i32; ++ pub fn sceKernelTotalFreeMemSize() -> usize; ++ pub fn sceKernelMaxFreeMemSize() -> usize; ++ pub fn sceKernelDevkitVersion() -> u32; ++ pub fn sceKernelSetCompiledSdkVersion(version: u32) -> i32; ++ pub fn sceKernelGetCompiledSdkVersion() -> u32; ++ ++ pub fn sceKernelLibcTime(t: *mut i32) -> i32; ++ pub fn sceKernelLibcClock() -> u32; ++ pub fn sceKernelLibcGettimeofday(tp: *mut timeval, tzp: *mut timezone) -> i32; ++ pub fn sceKernelDcacheWritebackAll(); ++ pub fn sceKernelDcacheWritebackInvalidateAll(); ++ pub fn sceKernelDcacheWritebackRange(p: *const c_void, size: u32); ++ pub fn sceKernelDcacheWritebackInvalidateRange(p: *const c_void, size: u32); ++ pub fn sceKernelDcacheInvalidateRange(p: *const c_void, size: u32); ++ pub fn sceKernelIcacheInvalidateAll(); ++ pub fn sceKernelIcacheInvalidateRange(p: *const c_void, size: u32); ++ pub fn sceKernelUtilsMt19937Init(ctx: *mut SceKernelUtilsMt19937Context, seed: u32) -> i32; ++ pub fn sceKernelUtilsMt19937UInt(ctx: *mut SceKernelUtilsMt19937Context) -> u32; ++ pub fn sceKernelUtilsMd5Digest(data: *mut u8, size: u32, digest: *mut u8) -> i32; ++ pub fn sceKernelUtilsMd5BlockInit(ctx: *mut SceKernelUtilsMd5Context) -> i32; ++ pub fn sceKernelUtilsMd5BlockUpdate( ++ ctx: *mut SceKernelUtilsMd5Context, ++ data: *mut u8, ++ size: u32, ++ ) -> i32; ++ pub fn sceKernelUtilsMd5BlockResult(ctx: *mut SceKernelUtilsMd5Context, digest: *mut u8) ++ -> i32; ++ pub fn sceKernelUtilsSha1Digest(data: *mut u8, size: u32, digest: *mut u8) -> i32; ++ pub fn sceKernelUtilsSha1BlockInit(ctx: *mut SceKernelUtilsSha1Context) -> i32; ++ pub fn sceKernelUtilsSha1BlockUpdate( ++ ctx: *mut SceKernelUtilsSha1Context, ++ data: *mut u8, ++ size: u32, ++ ) -> i32; ++ pub fn sceKernelUtilsSha1BlockResult( ++ ctx: *mut SceKernelUtilsSha1Context, ++ digest: *mut u8, ++ ) -> i32; ++ ++ pub fn sceKernelRegisterSubIntrHandler( ++ int_no: i32, ++ no: i32, ++ handler: *mut c_void, ++ arg: *mut c_void, ++ ) -> i32; ++ pub fn sceKernelReleaseSubIntrHandler(int_no: i32, no: i32) -> i32; ++ pub fn sceKernelEnableSubIntr(int_no: i32, no: i32) -> i32; ++ pub fn sceKernelDisableSubIntr(int_no: i32, no: i32) -> i32; ++ pub fn QueryIntrHandlerInfo( ++ intr_code: SceUid, ++ sub_intr_code: SceUid, ++ data: *mut IntrHandlerOptionParam, ++ ) -> i32; ++ ++ pub fn sceKernelCpuSuspendIntr() -> u32; ++ pub fn sceKernelCpuResumeIntr(flags: u32); ++ pub fn sceKernelCpuResumeIntrWithSync(flags: u32); ++ pub fn sceKernelIsCpuIntrSuspended(flags: u32) -> i32; ++ pub fn sceKernelIsCpuIntrEnable() -> i32; ++ ++ pub fn sceKernelLoadModule( ++ path: *const u8, ++ flags: i32, ++ option: *mut SceKernelLMOption, ++ ) -> SceUid; ++ pub fn sceKernelLoadModuleMs( ++ path: *const u8, ++ flags: i32, ++ option: *mut SceKernelLMOption, ++ ) -> SceUid; ++ pub fn sceKernelLoadModuleByID( ++ fid: SceUid, ++ flags: i32, ++ option: *mut SceKernelLMOption, ++ ) -> SceUid; ++ pub fn sceKernelLoadModuleBufferUsbWlan( ++ buf_size: usize, ++ buf: *mut c_void, ++ flags: i32, ++ option: *mut SceKernelLMOption, ++ ) -> SceUid; ++ pub fn sceKernelStartModule( ++ mod_id: SceUid, ++ arg_size: usize, ++ argp: *mut c_void, ++ status: *mut i32, ++ option: *mut SceKernelSMOption, ++ ) -> i32; ++ pub fn sceKernelStopModule( ++ mod_id: SceUid, ++ arg_size: usize, ++ argp: *mut c_void, ++ status: *mut i32, ++ option: *mut SceKernelSMOption, ++ ) -> i32; ++ pub fn sceKernelUnloadModule(mod_id: SceUid) -> i32; ++ pub fn sceKernelSelfStopUnloadModule(unknown: i32, arg_size: usize, argp: *mut c_void) -> i32; ++ pub fn sceKernelStopUnloadSelfModule( ++ arg_size: usize, ++ argp: *mut c_void, ++ status: *mut i32, ++ option: *mut SceKernelSMOption, ++ ) -> i32; ++ pub fn sceKernelQueryModuleInfo(mod_id: SceUid, info: *mut SceKernelModuleInfo) -> i32; ++ pub fn sceKernelGetModuleIdList( ++ read_buf: *mut SceUid, ++ read_buf_size: i32, ++ id_count: *mut i32, ++ ) -> i32; ++ ++ pub fn sceKernelVolatileMemLock(unk: i32, ptr: *mut *mut c_void, size: *mut i32) -> i32; ++ pub fn sceKernelVolatileMemTryLock(unk: i32, ptr: *mut *mut c_void, size: *mut i32) -> i32; ++ pub fn sceKernelVolatileMemUnlock(unk: i32) -> i32; ++ ++ pub fn sceKernelStdin() -> SceUid; ++ pub fn sceKernelStdout() -> SceUid; ++ pub fn sceKernelStderr() -> SceUid; ++ ++ pub fn sceKernelGetThreadmanIdType(uid: SceUid) -> SceKernelIdListType; ++ pub fn sceKernelCreateThread( ++ name: *const u8, ++ entry: SceKernelThreadEntry, ++ init_priority: i32, ++ stack_size: i32, ++ attr: i32, ++ option: *mut SceKernelThreadOptParam, ++ ) -> SceUid; ++ pub fn sceKernelDeleteThread(thid: SceUid) -> i32; ++ pub fn sceKernelStartThread(id: SceUid, arg_len: usize, arg_p: *mut c_void) -> i32; ++ pub fn sceKernelExitThread(status: i32) -> i32; ++ pub fn sceKernelExitDeleteThread(status: i32) -> i32; ++ pub fn sceKernelTerminateThread(thid: SceUid) -> i32; ++ pub fn sceKernelTerminateDeleteThread(thid: SceUid) -> i32; ++ pub fn sceKernelSuspendDispatchThread() -> i32; ++ pub fn sceKernelResumeDispatchThread(state: i32) -> i32; ++ pub fn sceKernelSleepThread() -> i32; ++ pub fn sceKernelSleepThreadCB() -> i32; ++ pub fn sceKernelWakeupThread(thid: SceUid) -> i32; ++ pub fn sceKernelCancelWakeupThread(thid: SceUid) -> i32; ++ pub fn sceKernelSuspendThread(thid: SceUid) -> i32; ++ pub fn sceKernelResumeThread(thid: SceUid) -> i32; ++ pub fn sceKernelWaitThreadEnd(thid: SceUid, timeout: *mut u32) -> i32; ++ pub fn sceKernelWaitThreadEndCB(thid: SceUid, timeout: *mut u32) -> i32; ++ pub fn sceKernelDelayThread(delay: u32) -> i32; ++ pub fn sceKernelDelayThreadCB(delay: u32) -> i32; ++ pub fn sceKernelDelaySysClockThread(delay: *mut SceKernelSysClock) -> i32; ++ pub fn sceKernelDelaySysClockThreadCB(delay: *mut SceKernelSysClock) -> i32; ++ pub fn sceKernelChangeCurrentThreadAttr(unknown: i32, attr: i32) -> i32; ++ pub fn sceKernelChangeThreadPriority(thid: SceUid, priority: i32) -> i32; ++ pub fn sceKernelRotateThreadReadyQueue(priority: i32) -> i32; ++ pub fn sceKernelReleaseWaitThread(thid: SceUid) -> i32; ++ pub fn sceKernelGetThreadId() -> i32; ++ pub fn sceKernelGetThreadCurrentPriority() -> i32; ++ pub fn sceKernelGetThreadExitStatus(thid: SceUid) -> i32; ++ pub fn sceKernelCheckThreadStack() -> i32; ++ pub fn sceKernelGetThreadStackFreeSize(thid: SceUid) -> i32; ++ pub fn sceKernelReferThreadStatus(thid: SceUid, info: *mut SceKernelThreadInfo) -> i32; ++ pub fn sceKernelReferThreadRunStatus( ++ thid: SceUid, ++ status: *mut SceKernelThreadRunStatus, ++ ) -> i32; ++ pub fn sceKernelCreateSema( ++ name: *const u8, ++ attr: u32, ++ init_val: i32, ++ max_val: i32, ++ option: *mut SceKernelSemaOptParam, ++ ) -> SceUid; ++ pub fn sceKernelDeleteSema(sema_id: SceUid) -> i32; ++ pub fn sceKernelSignalSema(sema_id: SceUid, signal: i32) -> i32; ++ pub fn sceKernelWaitSema(sema_id: SceUid, signal: i32, timeout: *mut u32) -> i32; ++ pub fn sceKernelWaitSemaCB(sema_id: SceUid, signal: i32, timeout: *mut u32) -> i32; ++ pub fn sceKernelPollSema(sema_id: SceUid, signal: i32) -> i32; ++ pub fn sceKernelReferSemaStatus(sema_id: SceUid, info: *mut SceKernelSemaInfo) -> i32; ++ pub fn sceKernelCreateEventFlag( ++ name: *const u8, ++ attr: i32, ++ bits: i32, ++ opt: *mut SceKernelEventFlagOptParam, ++ ) -> SceUid; ++ pub fn sceKernelSetEventFlag(ev_id: SceUid, bits: u32) -> i32; ++ pub fn sceKernelClearEventFlag(ev_id: SceUid, bits: u32) -> i32; ++ pub fn sceKernelPollEventFlag(ev_id: SceUid, bits: u32, wait: i32, out_bits: *mut u32) -> i32; ++ pub fn sceKernelWaitEventFlag( ++ ev_id: SceUid, ++ bits: u32, ++ wait: i32, ++ out_bits: *mut u32, ++ timeout: *mut u32, ++ ) -> i32; ++ pub fn sceKernelWaitEventFlagCB( ++ ev_id: SceUid, ++ bits: u32, ++ wait: i32, ++ out_bits: *mut u32, ++ timeout: *mut u32, ++ ) -> i32; ++ pub fn sceKernelDeleteEventFlag(ev_id: SceUid) -> i32; ++ pub fn sceKernelReferEventFlagStatus(event: SceUid, status: *mut SceKernelEventFlagInfo) ++ -> i32; ++ pub fn sceKernelCreateMbx( ++ name: *const u8, ++ attr: u32, ++ option: *mut SceKernelMbxOptParam, ++ ) -> SceUid; ++ pub fn sceKernelDeleteMbx(mbx_id: SceUid) -> i32; ++ pub fn sceKernelSendMbx(mbx_id: SceUid, message: *mut c_void) -> i32; ++ pub fn sceKernelReceiveMbx(mbx_id: SceUid, message: *mut *mut c_void, timeout: *mut u32) ++ -> i32; ++ pub fn sceKernelReceiveMbxCB( ++ mbx_id: SceUid, ++ message: *mut *mut c_void, ++ timeout: *mut u32, ++ ) -> i32; ++ pub fn sceKernelPollMbx(mbx_id: SceUid, pmessage: *mut *mut c_void) -> i32; ++ pub fn sceKernelCancelReceiveMbx(mbx_id: SceUid, num: *mut i32) -> i32; ++ pub fn sceKernelReferMbxStatus(mbx_id: SceUid, info: *mut SceKernelMbxInfo) -> i32; ++ pub fn sceKernelSetAlarm( ++ clock: u32, ++ handler: SceKernelAlarmHandler, ++ common: *mut c_void, ++ ) -> SceUid; ++ pub fn sceKernelSetSysClockAlarm( ++ clock: *mut SceKernelSysClock, ++ handler: *mut SceKernelAlarmHandler, ++ common: *mut c_void, ++ ) -> SceUid; ++ pub fn sceKernelCancelAlarm(alarm_id: SceUid) -> i32; ++ pub fn sceKernelReferAlarmStatus(alarm_id: SceUid, info: *mut SceKernelAlarmInfo) -> i32; ++ pub fn sceKernelCreateCallback( ++ name: *const u8, ++ func: SceKernelCallbackFunction, ++ arg: *mut c_void, ++ ) -> SceUid; ++ pub fn sceKernelReferCallbackStatus(cb: SceUid, status: *mut SceKernelCallbackInfo) -> i32; ++ pub fn sceKernelDeleteCallback(cb: SceUid) -> i32; ++ pub fn sceKernelNotifyCallback(cb: SceUid, arg2: i32) -> i32; ++ pub fn sceKernelCancelCallback(cb: SceUid) -> i32; ++ pub fn sceKernelGetCallbackCount(cb: SceUid) -> i32; ++ pub fn sceKernelCheckCallback() -> i32; ++ pub fn sceKernelGetThreadmanIdList( ++ type_: SceKernelIdListType, ++ read_buf: *mut SceUid, ++ read_buf_size: i32, ++ id_count: *mut i32, ++ ) -> i32; ++ pub fn sceKernelReferSystemStatus(status: *mut SceKernelSystemStatus) -> i32; ++ pub fn sceKernelCreateMsgPipe( ++ name: *const u8, ++ part: i32, ++ attr: i32, ++ unk1: *mut c_void, ++ opt: *mut c_void, ++ ) -> SceUid; ++ pub fn sceKernelDeleteMsgPipe(uid: SceUid) -> i32; ++ pub fn sceKernelSendMsgPipe( ++ uid: SceUid, ++ message: *mut c_void, ++ size: u32, ++ unk1: i32, ++ unk2: *mut c_void, ++ timeout: *mut u32, ++ ) -> i32; ++ pub fn sceKernelSendMsgPipeCB( ++ uid: SceUid, ++ message: *mut c_void, ++ size: u32, ++ unk1: i32, ++ unk2: *mut c_void, ++ timeout: *mut u32, ++ ) -> i32; ++ pub fn sceKernelTrySendMsgPipe( ++ uid: SceUid, ++ message: *mut c_void, ++ size: u32, ++ unk1: i32, ++ unk2: *mut c_void, ++ ) -> i32; ++ pub fn sceKernelReceiveMsgPipe( ++ uid: SceUid, ++ message: *mut c_void, ++ size: u32, ++ unk1: i32, ++ unk2: *mut c_void, ++ timeout: *mut u32, ++ ) -> i32; ++ pub fn sceKernelReceiveMsgPipeCB( ++ uid: SceUid, ++ message: *mut c_void, ++ size: u32, ++ unk1: i32, ++ unk2: *mut c_void, ++ timeout: *mut u32, ++ ) -> i32; ++ pub fn sceKernelTryReceiveMsgPipe( ++ uid: SceUid, ++ message: *mut c_void, ++ size: u32, ++ unk1: i32, ++ unk2: *mut c_void, ++ ) -> i32; ++ pub fn sceKernelCancelMsgPipe(uid: SceUid, send: *mut i32, recv: *mut i32) -> i32; ++ pub fn sceKernelReferMsgPipeStatus(uid: SceUid, info: *mut SceKernelMppInfo) -> i32; ++ pub fn sceKernelCreateVpl( ++ name: *const u8, ++ part: i32, ++ attr: i32, ++ size: u32, ++ opt: *mut SceKernelVplOptParam, ++ ) -> SceUid; ++ pub fn sceKernelDeleteVpl(uid: SceUid) -> i32; ++ pub fn sceKernelAllocateVpl( ++ uid: SceUid, ++ size: u32, ++ data: *mut *mut c_void, ++ timeout: *mut u32, ++ ) -> i32; ++ pub fn sceKernelAllocateVplCB( ++ uid: SceUid, ++ size: u32, ++ data: *mut *mut c_void, ++ timeout: *mut u32, ++ ) -> i32; ++ pub fn sceKernelTryAllocateVpl(uid: SceUid, size: u32, data: *mut *mut c_void) -> i32; ++ pub fn sceKernelFreeVpl(uid: SceUid, data: *mut c_void) -> i32; ++ pub fn sceKernelCancelVpl(uid: SceUid, num: *mut i32) -> i32; ++ pub fn sceKernelReferVplStatus(uid: SceUid, info: *mut SceKernelVplInfo) -> i32; ++ pub fn sceKernelCreateFpl( ++ name: *const u8, ++ part: i32, ++ attr: i32, ++ size: u32, ++ blocks: u32, ++ opt: *mut SceKernelFplOptParam, ++ ) -> i32; ++ pub fn sceKernelDeleteFpl(uid: SceUid) -> i32; ++ pub fn sceKernelAllocateFpl(uid: SceUid, data: *mut *mut c_void, timeout: *mut u32) -> i32; ++ pub fn sceKernelAllocateFplCB(uid: SceUid, data: *mut *mut c_void, timeout: *mut u32) -> i32; ++ pub fn sceKernelTryAllocateFpl(uid: SceUid, data: *mut *mut c_void) -> i32; ++ pub fn sceKernelFreeFpl(uid: SceUid, data: *mut c_void) -> i32; ++ pub fn sceKernelCancelFpl(uid: SceUid, pnum: *mut i32) -> i32; ++ pub fn sceKernelReferFplStatus(uid: SceUid, info: *mut SceKernelFplInfo) -> i32; ++ pub fn sceKernelUSec2SysClock(usec: u32, clock: *mut SceKernelSysClock) -> i32; ++ pub fn sceKernelUSec2SysClockWide(usec: u32) -> i64; ++ pub fn sceKernelSysClock2USec( ++ clock: *mut SceKernelSysClock, ++ low: *mut u32, ++ high: *mut u32, ++ ) -> i32; ++ pub fn sceKernelSysClock2USecWide(clock: i64, low: *mut u32, high: *mut u32) -> i32; ++ pub fn sceKernelGetSystemTime(time: *mut SceKernelSysClock) -> i32; ++ pub fn sceKernelGetSystemTimeWide() -> i64; ++ pub fn sceKernelGetSystemTimeLow() -> u32; ++ pub fn sceKernelCreateVTimer(name: *const u8, opt: *mut SceKernelVTimerOptParam) -> SceUid; ++ pub fn sceKernelDeleteVTimer(uid: SceUid) -> i32; ++ pub fn sceKernelGetVTimerBase(uid: SceUid, base: *mut SceKernelSysClock) -> i32; ++ pub fn sceKernelGetVTimerBaseWide(uid: SceUid) -> i64; ++ pub fn sceKernelGetVTimerTime(uid: SceUid, time: *mut SceKernelSysClock) -> i32; ++ pub fn sceKernelGetVTimerTimeWide(uid: SceUid) -> i64; ++ pub fn sceKernelSetVTimerTime(uid: SceUid, time: *mut SceKernelSysClock) -> i32; ++ pub fn sceKernelSetVTimerTimeWide(uid: SceUid, time: i64) -> i64; ++ pub fn sceKernelStartVTimer(uid: SceUid) -> i32; ++ pub fn sceKernelStopVTimer(uid: SceUid) -> i32; ++ pub fn sceKernelSetVTimerHandler( ++ uid: SceUid, ++ time: *mut SceKernelSysClock, ++ handler: SceKernelVTimerHandler, ++ common: *mut c_void, ++ ) -> i32; ++ pub fn sceKernelSetVTimerHandlerWide( ++ uid: SceUid, ++ time: i64, ++ handler: SceKernelVTimerHandlerWide, ++ common: *mut c_void, ++ ) -> i32; ++ pub fn sceKernelCancelVTimerHandler(uid: SceUid) -> i32; ++ pub fn sceKernelReferVTimerStatus(uid: SceUid, info: *mut SceKernelVTimerInfo) -> i32; ++ pub fn sceKernelRegisterThreadEventHandler( ++ name: *const u8, ++ thread_id: SceUid, ++ mask: i32, ++ handler: SceKernelThreadEventHandler, ++ common: *mut c_void, ++ ) -> SceUid; ++ pub fn sceKernelReleaseThreadEventHandler(uid: SceUid) -> i32; ++ pub fn sceKernelReferThreadEventHandlerStatus( ++ uid: SceUid, ++ info: *mut SceKernelThreadEventHandlerInfo, ++ ) -> i32; ++ pub fn sceKernelReferThreadProfiler() -> *mut DebugProfilerRegs; ++ pub fn sceKernelReferGlobalProfiler() -> *mut DebugProfilerRegs; ++ ++ pub fn sceUsbStart(driver_name: *const u8, size: i32, args: *mut c_void) -> i32; ++ pub fn sceUsbStop(driver_name: *const u8, size: i32, args: *mut c_void) -> i32; ++ pub fn sceUsbActivate(pid: u32) -> i32; ++ pub fn sceUsbDeactivate(pid: u32) -> i32; ++ pub fn sceUsbGetState() -> i32; ++ pub fn sceUsbGetDrvState(driver_name: *const u8) -> i32; ++} ++ ++extern "C" { ++ pub fn sceUsbCamSetupStill(param: *mut UsbCamSetupStillParam) -> i32; ++ pub fn sceUsbCamSetupStillEx(param: *mut UsbCamSetupStillExParam) -> i32; ++ pub fn sceUsbCamStillInputBlocking(buf: *mut u8, size: usize) -> i32; ++ pub fn sceUsbCamStillInput(buf: *mut u8, size: usize) -> i32; ++ pub fn sceUsbCamStillWaitInputEnd() -> i32; ++ pub fn sceUsbCamStillPollInputEnd() -> i32; ++ pub fn sceUsbCamStillCancelInput() -> i32; ++ pub fn sceUsbCamStillGetInputLength() -> i32; ++ pub fn sceUsbCamSetupVideo( ++ param: *mut UsbCamSetupVideoParam, ++ work_area: *mut c_void, ++ work_area_size: i32, ++ ) -> i32; ++ pub fn sceUsbCamSetupVideoEx( ++ param: *mut UsbCamSetupVideoExParam, ++ work_area: *mut c_void, ++ work_area_size: i32, ++ ) -> i32; ++ pub fn sceUsbCamStartVideo() -> i32; ++ pub fn sceUsbCamStopVideo() -> i32; ++ pub fn sceUsbCamReadVideoFrameBlocking(buf: *mut u8, size: usize) -> i32; ++ pub fn sceUsbCamReadVideoFrame(buf: *mut u8, size: usize) -> i32; ++ pub fn sceUsbCamWaitReadVideoFrameEnd() -> i32; ++ pub fn sceUsbCamPollReadVideoFrameEnd() -> i32; ++ pub fn sceUsbCamGetReadVideoFrameSize() -> i32; ++ pub fn sceUsbCamSetSaturation(saturation: i32) -> i32; ++ pub fn sceUsbCamSetBrightness(brightness: i32) -> i32; ++ pub fn sceUsbCamSetContrast(contrast: i32) -> i32; ++ pub fn sceUsbCamSetSharpness(sharpness: i32) -> i32; ++ pub fn sceUsbCamSetImageEffectMode(effect_mode: UsbCamEffectMode) -> i32; ++ pub fn sceUsbCamSetEvLevel(exposure_level: UsbCamEvLevel) -> i32; ++ pub fn sceUsbCamSetReverseMode(reverse_flags: i32) -> i32; ++ pub fn sceUsbCamSetZoom(zoom: i32) -> i32; ++ pub fn sceUsbCamGetSaturation(saturation: *mut i32) -> i32; ++ pub fn sceUsbCamGetBrightness(brightness: *mut i32) -> i32; ++ pub fn sceUsbCamGetContrast(contrast: *mut i32) -> i32; ++ pub fn sceUsbCamGetSharpness(sharpness: *mut i32) -> i32; ++ pub fn sceUsbCamGetImageEffectMode(effect_mode: *mut UsbCamEffectMode) -> i32; ++ pub fn sceUsbCamGetEvLevel(exposure_level: *mut UsbCamEvLevel) -> i32; ++ pub fn sceUsbCamGetReverseMode(reverse_flags: *mut i32) -> i32; ++ pub fn sceUsbCamGetZoom(zoom: *mut i32) -> i32; ++ pub fn sceUsbCamAutoImageReverseSW(on: i32) -> i32; ++ pub fn sceUsbCamGetAutoImageReverseState() -> i32; ++ pub fn sceUsbCamGetLensDirection() -> i32; ++ ++ pub fn sceUsbstorBootRegisterNotify(event_flag: SceUid) -> i32; ++ pub fn sceUsbstorBootUnregisterNotify(event_flag: u32) -> i32; ++ pub fn sceUsbstorBootSetCapacity(size: u32) -> i32; ++ ++ pub fn scePowerRegisterCallback(slot: i32, cbid: SceUid) -> i32; ++ pub fn scePowerUnregisterCallback(slot: i32) -> i32; ++ pub fn scePowerIsPowerOnline() -> i32; ++ pub fn scePowerIsBatteryExist() -> i32; ++ pub fn scePowerIsBatteryCharging() -> i32; ++ pub fn scePowerGetBatteryChargingStatus() -> i32; ++ pub fn scePowerIsLowBattery() -> i32; ++ pub fn scePowerGetBatteryLifePercent() -> i32; ++ pub fn scePowerGetBatteryLifeTime() -> i32; ++ pub fn scePowerGetBatteryTemp() -> i32; ++ pub fn scePowerGetBatteryElec() -> i32; ++ pub fn scePowerGetBatteryVolt() -> i32; ++ pub fn scePowerSetCpuClockFrequency(cpufreq: i32) -> i32; ++ pub fn scePowerSetBusClockFrequency(busfreq: i32) -> i32; ++ pub fn scePowerGetCpuClockFrequency() -> i32; ++ pub fn scePowerGetCpuClockFrequencyInt() -> i32; ++ pub fn scePowerGetCpuClockFrequencyFloat() -> f32; ++ pub fn scePowerGetBusClockFrequency() -> i32; ++ pub fn scePowerGetBusClockFrequencyInt() -> i32; ++ pub fn scePowerGetBusClockFrequencyFloat() -> f32; ++ pub fn scePowerSetClockFrequency(pllfreq: i32, cpufreq: i32, busfreq: i32) -> i32; ++ pub fn scePowerLock(unknown: i32) -> i32; ++ pub fn scePowerUnlock(unknown: i32) -> i32; ++ pub fn scePowerTick(t: PowerTick) -> i32; ++ pub fn scePowerGetIdleTimer() -> i32; ++ pub fn scePowerIdleTimerEnable(unknown: i32) -> i32; ++ pub fn scePowerIdleTimerDisable(unknown: i32) -> i32; ++ pub fn scePowerRequestStandby() -> i32; ++ pub fn scePowerRequestSuspend() -> i32; ++ ++ pub fn sceWlanDevIsPowerOn() -> i32; ++ pub fn sceWlanGetSwitchState() -> i32; ++ pub fn sceWlanGetEtherAddr(ether_addr: *mut u8) -> i32; ++ ++ pub fn sceWlanDevAttach() -> i32; ++ pub fn sceWlanDevDetach() -> i32; ++ ++ pub fn sceRtcGetTickResolution() -> u32; ++ pub fn sceRtcGetCurrentTick(tick: *mut u64) -> i32; ++ pub fn sceRtcGetCurrentClock(tm: *mut ScePspDateTime, tz: i32) -> i32; ++ pub fn sceRtcGetCurrentClockLocalTime(tm: *mut ScePspDateTime) -> i32; ++ pub fn sceRtcConvertUtcToLocalTime(tick_utc: *const u64, tick_local: *mut u64) -> i32; ++ pub fn sceRtcConvertLocalTimeToUTC(tick_local: *const u64, tick_utc: *mut u64) -> i32; ++ pub fn sceRtcIsLeapYear(year: i32) -> i32; ++ pub fn sceRtcGetDaysInMonth(year: i32, month: i32) -> i32; ++ pub fn sceRtcGetDayOfWeek(year: i32, month: i32, day: i32) -> i32; ++ pub fn sceRtcCheckValid(date: *const ScePspDateTime) -> i32; ++ pub fn sceRtcSetTick(date: *mut ScePspDateTime, tick: *const u64) -> i32; ++ pub fn sceRtcGetTick(date: *const ScePspDateTime, tick: *mut u64) -> i32; ++ pub fn sceRtcCompareTick(tick1: *const u64, tick2: *const u64) -> i32; ++ pub fn sceRtcTickAddTicks(dest_tick: *mut u64, src_tick: *const u64, num_ticks: u64) -> i32; ++ pub fn sceRtcTickAddMicroseconds(dest_tick: *mut u64, src_tick: *const u64, num_ms: u64) ++ -> i32; ++ pub fn sceRtcTickAddSeconds(dest_tick: *mut u64, src_tick: *const u64, num_seconds: u64) ++ -> i32; ++ pub fn sceRtcTickAddMinutes(dest_tick: *mut u64, src_tick: *const u64, num_minutes: u64) ++ -> i32; ++ pub fn sceRtcTickAddHours(dest_tick: *mut u64, src_tick: *const u64, num_hours: u64) -> i32; ++ pub fn sceRtcTickAddDays(dest_tick: *mut u64, src_tick: *const u64, num_days: u64) -> i32; ++ pub fn sceRtcTickAddWeeks(dest_tick: *mut u64, src_tick: *const u64, num_weeks: u64) -> i32; ++ pub fn sceRtcTickAddMonths(dest_tick: *mut u64, src_tick: *const u64, num_months: u64) -> i32; ++ pub fn sceRtcTickAddYears(dest_tick: *mut u64, src_tick: *const u64, num_years: u64) -> i32; ++ pub fn sceRtcSetTime_t(date: *mut ScePspDateTime, time: u32) -> i32; ++ pub fn sceRtcGetTime_t(date: *const ScePspDateTime, time: *mut u32) -> i32; ++ pub fn sceRtcSetTime64_t(date: *mut ScePspDateTime, time: u64) -> i32; ++ pub fn sceRtcGetTime64_t(date: *const ScePspDateTime, time: *mut u64) -> i32; ++ pub fn sceRtcSetDosTime(date: *mut ScePspDateTime, dos_time: u32) -> i32; ++ pub fn sceRtcGetDosTime(date: *mut ScePspDateTime, dos_time: u32) -> i32; ++ pub fn sceRtcSetWin32FileTime(date: *mut ScePspDateTime, time: *mut u64) -> i32; ++ pub fn sceRtcGetWin32FileTime(date: *mut ScePspDateTime, time: *mut u64) -> i32; ++ pub fn sceRtcParseDateTime(dest_tick: *mut u64, date_string: *const u8) -> i32; ++ pub fn sceRtcFormatRFC3339( ++ psz_date_time: *mut char, ++ p_utc: *const u64, ++ time_zone_minutes: i32, ++ ) -> i32; ++ pub fn sceRtcFormatRFC3339LocalTime(psz_date_time: *mut char, p_utc: *const u64) -> i32; ++ pub fn sceRtcParseRFC3339(p_utc: *mut u64, psz_date_time: *const u8) -> i32; ++ pub fn sceRtcFormatRFC2822( ++ psz_date_time: *mut char, ++ p_utc: *const u64, ++ time_zone_minutes: i32, ++ ) -> i32; ++ pub fn sceRtcFormatRFC2822LocalTime(psz_date_time: *mut char, p_utc: *const u64) -> i32; ++ ++ pub fn sceIoOpen(file: *const u8, flags: i32, permissions: IoPermissions) -> SceUid; ++ pub fn sceIoOpenAsync(file: *const u8, flags: i32, permissions: IoPermissions) -> SceUid; ++ pub fn sceIoClose(fd: SceUid) -> i32; ++ pub fn sceIoCloseAsync(fd: SceUid) -> i32; ++ pub fn sceIoRead(fd: SceUid, data: *mut c_void, size: u32) -> i32; ++ pub fn sceIoReadAsync(fd: SceUid, data: *mut c_void, size: u32) -> i32; ++ pub fn sceIoWrite(fd: SceUid, data: *const c_void, size: usize) -> i32; ++ pub fn sceIoWriteAsync(fd: SceUid, data: *const c_void, size: u32) -> i32; ++ pub fn sceIoLseek(fd: SceUid, offset: i64, whence: IoWhence) -> i64; ++ pub fn sceIoLseekAsync(fd: SceUid, offset: i64, whence: IoWhence) -> i32; ++ pub fn sceIoLseek32(fd: SceUid, offset: i32, whence: IoWhence) -> i32; ++ pub fn sceIoLseek32Async(fd: SceUid, offset: i32, whence: IoWhence) -> i32; ++ pub fn sceIoRemove(file: *const u8) -> i32; ++ pub fn sceIoMkdir(dir: *const u8, mode: IoPermissions) -> i32; ++ pub fn sceIoRmdir(path: *const u8) -> i32; ++ pub fn sceIoChdir(path: *const u8) -> i32; ++ pub fn sceIoRename(oldname: *const u8, newname: *const u8) -> i32; ++ pub fn sceIoDopen(dirname: *const u8) -> SceUid; ++ pub fn sceIoDread(fd: SceUid, dir: *mut SceIoDirent) -> i32; ++ pub fn sceIoDclose(fd: SceUid) -> i32; ++ pub fn sceIoDevctl( ++ dev: *const u8, ++ cmd: u32, ++ indata: *mut c_void, ++ inlen: i32, ++ outdata: *mut c_void, ++ outlen: i32, ++ ) -> i32; ++ pub fn sceIoAssign( ++ dev1: *const u8, ++ dev2: *const u8, ++ dev3: *const u8, ++ mode: IoAssignPerms, ++ unk1: *mut c_void, ++ unk2: i32, ++ ) -> i32; ++ pub fn sceIoUnassign(dev: *const u8) -> i32; ++ pub fn sceIoGetstat(file: *const u8, stat: *mut SceIoStat) -> i32; ++ pub fn sceIoChstat(file: *const u8, stat: *mut SceIoStat, bits: i32) -> i32; ++ pub fn sceIoIoctl( ++ fd: SceUid, ++ cmd: u32, ++ indata: *mut c_void, ++ inlen: i32, ++ outdata: *mut c_void, ++ outlen: i32, ++ ) -> i32; ++ pub fn sceIoIoctlAsync( ++ fd: SceUid, ++ cmd: u32, ++ indata: *mut c_void, ++ inlen: i32, ++ outdata: *mut c_void, ++ outlen: i32, ++ ) -> i32; ++ pub fn sceIoSync(device: *const u8, unk: u32) -> i32; ++ pub fn sceIoWaitAsync(fd: SceUid, res: *mut i64) -> i32; ++ pub fn sceIoWaitAsyncCB(fd: SceUid, res: *mut i64) -> i32; ++ pub fn sceIoPollAsync(fd: SceUid, res: *mut i64) -> i32; ++ pub fn sceIoGetAsyncStat(fd: SceUid, poll: i32, res: *mut i64) -> i32; ++ pub fn sceIoCancel(fd: SceUid) -> i32; ++ pub fn sceIoGetDevType(fd: SceUid) -> i32; ++ pub fn sceIoChangeAsyncPriority(fd: SceUid, pri: i32) -> i32; ++ pub fn sceIoSetAsyncCallback(fd: SceUid, cb: SceUid, argp: *mut c_void) -> i32; ++ ++ pub fn sceJpegInitMJpeg() -> i32; ++ pub fn sceJpegFinishMJpeg() -> i32; ++ pub fn sceJpegCreateMJpeg(width: i32, height: i32) -> i32; ++ pub fn sceJpegDeleteMJpeg() -> i32; ++ pub fn sceJpegDecodeMJpeg(jpeg_buf: *mut u8, size: usize, rgba: *mut c_void, unk: u32) -> i32; ++ ++ pub fn sceUmdCheckMedium() -> i32; ++ pub fn sceUmdGetDiscInfo(info: *mut UmdInfo) -> i32; ++ pub fn sceUmdActivate(unit: i32, drive: *const u8) -> i32; ++ pub fn sceUmdDeactivate(unit: i32, drive: *const u8) -> i32; ++ pub fn sceUmdWaitDriveStat(state: i32) -> i32; ++ pub fn sceUmdWaitDriveStatWithTimer(state: i32, timeout: u32) -> i32; ++ pub fn sceUmdWaitDriveStatCB(state: i32, timeout: u32) -> i32; ++ pub fn sceUmdCancelWaitDriveStat() -> i32; ++ pub fn sceUmdGetDriveStat() -> i32; ++ pub fn sceUmdGetErrorStat() -> i32; ++ pub fn sceUmdRegisterUMDCallBack(cbid: i32) -> i32; ++ pub fn sceUmdUnRegisterUMDCallBack(cbid: i32) -> i32; ++ pub fn sceUmdReplacePermit() -> i32; ++ pub fn sceUmdReplaceProhibit() -> i32; ++ ++ pub fn sceMpegInit() -> i32; ++ pub fn sceMpegFinish(); ++ pub fn sceMpegRingbufferQueryMemSize(packets: i32) -> i32; ++ pub fn sceMpegRingbufferConstruct( ++ ringbuffer: *mut SceMpegRingbuffer, ++ packets: i32, ++ data: *mut c_void, ++ size: i32, ++ callback: SceMpegRingbufferCb, ++ cb_param: *mut c_void, ++ ) -> i32; ++ pub fn sceMpegRingbufferDestruct(ringbuffer: *mut SceMpegRingbuffer); ++ pub fn sceMpegRingbufferAvailableSize(ringbuffer: *mut SceMpegRingbuffer) -> i32; ++ pub fn sceMpegRingbufferPut( ++ ringbuffer: *mut SceMpegRingbuffer, ++ num_packets: i32, ++ available: i32, ++ ) -> i32; ++ pub fn sceMpegQueryMemSize(unk: i32) -> i32; ++ pub fn sceMpegCreate( ++ handle: SceMpeg, ++ data: *mut c_void, ++ size: i32, ++ ringbuffer: *mut SceMpegRingbuffer, ++ frame_width: i32, ++ unk1: i32, ++ unk2: i32, ++ ) -> i32; ++ pub fn sceMpegDelete(handle: SceMpeg); ++ pub fn sceMpegQueryStreamOffset(handle: SceMpeg, buffer: *mut c_void, offset: *mut i32) -> i32; ++ pub fn sceMpegQueryStreamSize(buffer: *mut c_void, size: *mut i32) -> i32; ++ pub fn sceMpegRegistStream(handle: SceMpeg, stream_id: i32, unk: i32) -> SceMpegStream; ++ pub fn sceMpegUnRegistStream(handle: SceMpeg, stream: SceMpegStream); ++ pub fn sceMpegFlushAllStream(handle: SceMpeg) -> i32; ++ pub fn sceMpegMallocAvcEsBuf(handle: SceMpeg) -> *mut c_void; ++ pub fn sceMpegFreeAvcEsBuf(handle: SceMpeg, buf: *mut c_void); ++ pub fn sceMpegQueryAtracEsSize(handle: SceMpeg, es_size: *mut i32, out_size: *mut i32) -> i32; ++ pub fn sceMpegInitAu(handle: SceMpeg, es_buffer: *mut c_void, au: *mut SceMpegAu) -> i32; ++ pub fn sceMpegGetAvcAu( ++ handle: SceMpeg, ++ stream: SceMpegStream, ++ au: *mut SceMpegAu, ++ unk: *mut i32, ++ ) -> i32; ++ pub fn sceMpegAvcDecodeMode(handle: SceMpeg, mode: *mut SceMpegAvcMode) -> i32; ++ pub fn sceMpegAvcDecode( ++ handle: SceMpeg, ++ au: *mut SceMpegAu, ++ iframe_width: i32, ++ buffer: *mut c_void, ++ init: *mut i32, ++ ) -> i32; ++ pub fn sceMpegAvcDecodeStop( ++ handle: SceMpeg, ++ frame_width: i32, ++ buffer: *mut c_void, ++ status: *mut i32, ++ ) -> i32; ++ pub fn sceMpegGetAtracAu( ++ handle: SceMpeg, ++ stream: SceMpegStream, ++ au: *mut SceMpegAu, ++ unk: *mut c_void, ++ ) -> i32; ++ pub fn sceMpegAtracDecode( ++ handle: SceMpeg, ++ au: *mut SceMpegAu, ++ buffer: *mut c_void, ++ init: i32, ++ ) -> i32; ++ ++ pub fn sceMpegBaseYCrCbCopyVme(yuv_buffer: *mut c_void, buffer: *mut i32, type_: i32) -> i32; ++ pub fn sceMpegBaseCscInit(width: i32) -> i32; ++ pub fn sceMpegBaseCscVme( ++ rgb_buffer: *mut c_void, ++ rgb_buffer2: *mut c_void, ++ width: i32, ++ y_cr_cb_buffer: *mut SceMpegYCrCbBuffer, ++ ) -> i32; ++ pub fn sceMpegbase_BEA18F91(lli: *mut SceMpegLLI) -> i32; ++ ++ pub fn sceHprmPeekCurrentKey(key: *mut i32) -> i32; ++ pub fn sceHprmPeekLatch(latch: *mut [u32; 4]) -> i32; ++ pub fn sceHprmReadLatch(latch: *mut [u32; 4]) -> i32; ++ pub fn sceHprmIsHeadphoneExist() -> i32; ++ pub fn sceHprmIsRemoteExist() -> i32; ++ pub fn sceHprmIsMicrophoneExist() -> i32; ++ ++ pub fn sceGuDepthBuffer(zbp: *mut c_void, zbw: i32); ++ pub fn sceGuDispBuffer(width: i32, height: i32, dispbp: *mut c_void, dispbw: i32); ++ pub fn sceGuDrawBuffer(psm: DisplayPixelFormat, fbp: *mut c_void, fbw: i32); ++ pub fn sceGuDrawBufferList(psm: DisplayPixelFormat, fbp: *mut c_void, fbw: i32); ++ pub fn sceGuDisplay(state: bool) -> bool; ++ pub fn sceGuDepthFunc(function: DepthFunc); ++ pub fn sceGuDepthMask(mask: i32); ++ pub fn sceGuDepthOffset(offset: i32); ++ pub fn sceGuDepthRange(near: i32, far: i32); ++ pub fn sceGuFog(near: f32, far: f32, color: u32); ++ pub fn sceGuInit(); ++ pub fn sceGuTerm(); ++ pub fn sceGuBreak(mode: i32); ++ pub fn sceGuContinue(); ++ pub fn sceGuSetCallback(signal: GuCallbackId, callback: GuCallback) -> GuCallback; ++ pub fn sceGuSignal(behavior: SignalBehavior, signal: i32); ++ pub fn sceGuSendCommandf(cmd: GeCommand, argument: f32); ++ pub fn sceGuSendCommandi(cmd: GeCommand, argument: i32); ++ pub fn sceGuGetMemory(size: i32) -> *mut c_void; ++ pub fn sceGuStart(context_type: GuContextType, list: *mut c_void); ++ pub fn sceGuFinish() -> i32; ++ pub fn sceGuFinishId(id: u32) -> i32; ++ pub fn sceGuCallList(list: *const c_void); ++ pub fn sceGuCallMode(mode: i32); ++ pub fn sceGuCheckList() -> i32; ++ pub fn sceGuSendList(mode: GuQueueMode, list: *const c_void, context: *mut GeContext); ++ pub fn sceGuSwapBuffers() -> *mut c_void; ++ pub fn sceGuSync(mode: GuSyncMode, behavior: GuSyncBehavior) -> GeListState; ++ pub fn sceGuDrawArray( ++ prim: GuPrimitive, ++ vtype: i32, ++ count: i32, ++ indices: *const c_void, ++ vertices: *const c_void, ++ ); ++ pub fn sceGuBeginObject( ++ vtype: i32, ++ count: i32, ++ indices: *const c_void, ++ vertices: *const c_void, ++ ); ++ pub fn sceGuEndObject(); ++ pub fn sceGuSetStatus(state: GuState, status: i32); ++ pub fn sceGuGetStatus(state: GuState) -> bool; ++ pub fn sceGuSetAllStatus(status: i32); ++ pub fn sceGuGetAllStatus() -> i32; ++ pub fn sceGuEnable(state: GuState); ++ pub fn sceGuDisable(state: GuState); ++ pub fn sceGuLight(light: i32, type_: LightType, components: i32, position: &ScePspFVector3); ++ pub fn sceGuLightAtt(light: i32, atten0: f32, atten1: f32, atten2: f32); ++ pub fn sceGuLightColor(light: i32, component: i32, color: u32); ++ pub fn sceGuLightMode(mode: LightMode); ++ pub fn sceGuLightSpot(light: i32, direction: &ScePspFVector3, exponent: f32, cutoff: f32); ++ pub fn sceGuClear(flags: i32); ++ pub fn sceGuClearColor(color: u32); ++ pub fn sceGuClearDepth(depth: u32); ++ pub fn sceGuClearStencil(stencil: u32); ++ pub fn sceGuPixelMask(mask: u32); ++ pub fn sceGuColor(color: u32); ++ pub fn sceGuColorFunc(func: ColorFunc, color: u32, mask: u32); ++ pub fn sceGuColorMaterial(components: i32); ++ pub fn sceGuAlphaFunc(func: AlphaFunc, value: i32, mask: i32); ++ pub fn sceGuAmbient(color: u32); ++ pub fn sceGuAmbientColor(color: u32); ++ pub fn sceGuBlendFunc(op: BlendOp, src: BlendSrc, dest: BlendDst, src_fix: u32, dest_fix: u32); ++ pub fn sceGuMaterial(components: i32, color: u32); ++ pub fn sceGuModelColor(emissive: u32, ambient: u32, diffuse: u32, specular: u32); ++ pub fn sceGuStencilFunc(func: StencilFunc, ref_: i32, mask: i32); ++ pub fn sceGuStencilOp(fail: StencilOperation, zfail: StencilOperation, zpass: StencilOperation); ++ pub fn sceGuSpecular(power: f32); ++ pub fn sceGuFrontFace(order: FrontFaceDirection); ++ pub fn sceGuLogicalOp(op: LogicalOperation); ++ pub fn sceGuSetDither(matrix: &ScePspIMatrix4); ++ pub fn sceGuShadeModel(mode: ShadingModel); ++ pub fn sceGuCopyImage( ++ psm: DisplayPixelFormat, ++ sx: i32, ++ sy: i32, ++ width: i32, ++ height: i32, ++ srcw: i32, ++ src: *mut c_void, ++ dx: i32, ++ dy: i32, ++ destw: i32, ++ dest: *mut c_void, ++ ); ++ pub fn sceGuTexEnvColor(color: u32); ++ pub fn sceGuTexFilter(min: TextureFilter, mag: TextureFilter); ++ pub fn sceGuTexFlush(); ++ pub fn sceGuTexFunc(tfx: TextureEffect, tcc: TextureColorComponent); ++ pub fn sceGuTexImage( ++ mipmap: MipmapLevel, ++ width: i32, ++ height: i32, ++ tbw: i32, ++ tbp: *const c_void, ++ ); ++ pub fn sceGuTexLevelMode(mode: TextureLevelMode, bias: f32); ++ pub fn sceGuTexMapMode(mode: TextureMapMode, a1: u32, a2: u32); ++ pub fn sceGuTexMode(tpsm: TexturePixelFormat, maxmips: i32, a2: i32, swizzle: i32); ++ pub fn sceGuTexOffset(u: f32, v: f32); ++ pub fn sceGuTexProjMapMode(mode: TextureProjectionMapMode); ++ pub fn sceGuTexScale(u: f32, v: f32); ++ pub fn sceGuTexSlope(slope: f32); ++ pub fn sceGuTexSync(); ++ pub fn sceGuTexWrap(u: GuTexWrapMode, v: GuTexWrapMode); ++ pub fn sceGuClutLoad(num_blocks: i32, cbp: *const c_void); ++ pub fn sceGuClutMode(cpsm: ClutPixelFormat, shift: u32, mask: u32, a3: u32); ++ pub fn sceGuOffset(x: u32, y: u32); ++ pub fn sceGuScissor(x: i32, y: i32, w: i32, h: i32); ++ pub fn sceGuViewport(cx: i32, cy: i32, width: i32, height: i32); ++ pub fn sceGuDrawBezier( ++ v_type: i32, ++ u_count: i32, ++ v_count: i32, ++ indices: *const c_void, ++ vertices: *const c_void, ++ ); ++ pub fn sceGuPatchDivide(ulevel: u32, vlevel: u32); ++ pub fn sceGuPatchFrontFace(a0: u32); ++ pub fn sceGuPatchPrim(prim: PatchPrimitive); ++ pub fn sceGuDrawSpline( ++ v_type: i32, ++ u_count: i32, ++ v_count: i32, ++ u_edge: i32, ++ v_edge: i32, ++ indices: *const c_void, ++ vertices: *const c_void, ++ ); ++ pub fn sceGuSetMatrix(type_: MatrixMode, matrix: &ScePspFMatrix4); ++ pub fn sceGuBoneMatrix(index: u32, matrix: &ScePspFMatrix4); ++ pub fn sceGuMorphWeight(index: i32, weight: f32); ++ pub fn sceGuDrawArrayN( ++ primitive_type: GuPrimitive, ++ v_type: i32, ++ count: i32, ++ a3: i32, ++ indices: *const c_void, ++ vertices: *const c_void, ++ ); ++ ++ pub fn sceGumDrawArray( ++ prim: GuPrimitive, ++ v_type: i32, ++ count: i32, ++ indices: *const c_void, ++ vertices: *const c_void, ++ ); ++ pub fn sceGumDrawArrayN( ++ prim: GuPrimitive, ++ v_type: i32, ++ count: i32, ++ a3: i32, ++ indices: *const c_void, ++ vertices: *const c_void, ++ ); ++ pub fn sceGumDrawBezier( ++ v_type: i32, ++ u_count: i32, ++ v_count: i32, ++ indices: *const c_void, ++ vertices: *const c_void, ++ ); ++ pub fn sceGumDrawSpline( ++ v_type: i32, ++ u_count: i32, ++ v_count: i32, ++ u_edge: i32, ++ v_edge: i32, ++ indices: *const c_void, ++ vertices: *const c_void, ++ ); ++ pub fn sceGumFastInverse(); ++ pub fn sceGumFullInverse(); ++ pub fn sceGumLoadIdentity(); ++ pub fn sceGumLoadMatrix(m: &ScePspFMatrix4); ++ pub fn sceGumLookAt(eye: &ScePspFVector3, center: &ScePspFVector3, up: &ScePspFVector3); ++ pub fn sceGumMatrixMode(mode: MatrixMode); ++ pub fn sceGumMultMatrix(m: &ScePspFMatrix4); ++ pub fn sceGumOrtho(left: f32, right: f32, bottom: f32, top: f32, near: f32, far: f32); ++ pub fn sceGumPerspective(fovy: f32, aspect: f32, near: f32, far: f32); ++ pub fn sceGumPopMatrix(); ++ pub fn sceGumPushMatrix(); ++ pub fn sceGumRotateX(angle: f32); ++ pub fn sceGumRotateY(angle: f32); ++ pub fn sceGumRotateZ(angle: f32); ++ pub fn sceGumRotateXYZ(v: &ScePspFVector3); ++ pub fn sceGumRotateZYX(v: &ScePspFVector3); ++ pub fn sceGumScale(v: &ScePspFVector3); ++ pub fn sceGumStoreMatrix(m: &mut ScePspFMatrix4); ++ pub fn sceGumTranslate(v: &ScePspFVector3); ++ pub fn sceGumUpdateMatrix(); ++ ++ pub fn sceMp3ReserveMp3Handle(args: *mut SceMp3InitArg) -> i32; ++ pub fn sceMp3ReleaseMp3Handle(handle: Mp3Handle) -> i32; ++ pub fn sceMp3InitResource() -> i32; ++ pub fn sceMp3TermResource() -> i32; ++ pub fn sceMp3Init(handle: Mp3Handle) -> i32; ++ pub fn sceMp3Decode(handle: Mp3Handle, dst: *mut *mut i16) -> i32; ++ pub fn sceMp3GetInfoToAddStreamData( ++ handle: Mp3Handle, ++ dst: *mut *mut u8, ++ to_write: *mut i32, ++ src_pos: *mut i32, ++ ) -> i32; ++ pub fn sceMp3NotifyAddStreamData(handle: Mp3Handle, size: i32) -> i32; ++ pub fn sceMp3CheckStreamDataNeeded(handle: Mp3Handle) -> i32; ++ pub fn sceMp3SetLoopNum(handle: Mp3Handle, loop_: i32) -> i32; ++ pub fn sceMp3GetLoopNum(handle: Mp3Handle) -> i32; ++ pub fn sceMp3GetSumDecodedSample(handle: Mp3Handle) -> i32; ++ pub fn sceMp3GetMaxOutputSample(handle: Mp3Handle) -> i32; ++ pub fn sceMp3GetSamplingRate(handle: Mp3Handle) -> i32; ++ pub fn sceMp3GetBitRate(handle: Mp3Handle) -> i32; ++ pub fn sceMp3GetMp3ChannelNum(handle: Mp3Handle) -> i32; ++ pub fn sceMp3ResetPlayPosition(handle: Mp3Handle) -> i32; ++ ++ pub fn sceRegOpenRegistry(reg: *mut Key, mode: i32, handle: *mut RegHandle) -> i32; ++ pub fn sceRegFlushRegistry(handle: RegHandle) -> i32; ++ pub fn sceRegCloseRegistry(handle: RegHandle) -> i32; ++ pub fn sceRegOpenCategory( ++ handle: RegHandle, ++ name: *const u8, ++ mode: i32, ++ dir_handle: *mut RegHandle, ++ ) -> i32; ++ pub fn sceRegRemoveCategory(handle: RegHandle, name: *const u8) -> i32; ++ pub fn sceRegCloseCategory(dir_handle: RegHandle) -> i32; ++ pub fn sceRegFlushCategory(dir_handle: RegHandle) -> i32; ++ pub fn sceRegGetKeyInfo( ++ dir_handle: RegHandle, ++ name: *const u8, ++ key_handle: *mut RegHandle, ++ type_: *mut KeyType, ++ size: *mut usize, ++ ) -> i32; ++ pub fn sceRegGetKeyInfoByName( ++ dir_handle: RegHandle, ++ name: *const u8, ++ type_: *mut KeyType, ++ size: *mut usize, ++ ) -> i32; ++ pub fn sceRegGetKeyValue( ++ dir_handle: RegHandle, ++ key_handle: RegHandle, ++ buf: *mut c_void, ++ size: usize, ++ ) -> i32; ++ pub fn sceRegGetKeyValueByName( ++ dir_handle: RegHandle, ++ name: *const u8, ++ buf: *mut c_void, ++ size: usize, ++ ) -> i32; ++ pub fn sceRegSetKeyValue( ++ dir_handle: RegHandle, ++ name: *const u8, ++ buf: *const c_void, ++ size: usize, ++ ) -> i32; ++ pub fn sceRegGetKeysNum(dir_handle: RegHandle, num: *mut i32) -> i32; ++ pub fn sceRegGetKeys(dir_handle: RegHandle, buf: *mut u8, num: i32) -> i32; ++ pub fn sceRegCreateKey(dir_handle: RegHandle, name: *const u8, type_: i32, size: usize) -> i32; ++ pub fn sceRegRemoveRegistry(key: *mut Key) -> i32; ++ ++ pub fn sceOpenPSIDGetOpenPSID(openpsid: *mut OpenPSID) -> i32; ++ ++ pub fn sceUtilityMsgDialogInitStart(params: *mut UtilityMsgDialogParams) -> i32; ++ pub fn sceUtilityMsgDialogShutdownStart(); ++ pub fn sceUtilityMsgDialogGetStatus() -> i32; ++ pub fn sceUtilityMsgDialogUpdate(n: i32); ++ pub fn sceUtilityMsgDialogAbort() -> i32; ++ pub fn sceUtilityNetconfInitStart(data: *mut UtilityNetconfData) -> i32; ++ pub fn sceUtilityNetconfShutdownStart() -> i32; ++ pub fn sceUtilityNetconfUpdate(unknown: i32) -> i32; ++ pub fn sceUtilityNetconfGetStatus() -> i32; ++ pub fn sceUtilityCheckNetParam(id: i32) -> i32; ++ pub fn sceUtilityGetNetParam(conf: i32, param: NetParam, data: *mut UtilityNetData) -> i32; ++ pub fn sceUtilitySavedataInitStart(params: *mut SceUtilitySavedataParam) -> i32; ++ pub fn sceUtilitySavedataGetStatus() -> i32; ++ pub fn sceUtilitySavedataShutdownStart() -> i32; ++ pub fn sceUtilitySavedataUpdate(unknown: i32); ++ pub fn sceUtilityGameSharingInitStart(params: *mut UtilityGameSharingParams) -> i32; ++ pub fn sceUtilityGameSharingShutdownStart(); ++ pub fn sceUtilityGameSharingGetStatus() -> i32; ++ pub fn sceUtilityGameSharingUpdate(n: i32); ++ pub fn sceUtilityHtmlViewerInitStart(params: *mut UtilityHtmlViewerParam) -> i32; ++ pub fn sceUtilityHtmlViewerShutdownStart() -> i32; ++ pub fn sceUtilityHtmlViewerUpdate(n: i32) -> i32; ++ pub fn sceUtilityHtmlViewerGetStatus() -> i32; ++ pub fn sceUtilitySetSystemParamInt(id: SystemParamId, value: i32) -> i32; ++ pub fn sceUtilitySetSystemParamString(id: SystemParamId, str: *const u8) -> i32; ++ pub fn sceUtilityGetSystemParamInt(id: SystemParamId, value: *mut i32) -> i32; ++ pub fn sceUtilityGetSystemParamString(id: SystemParamId, str: *mut u8, len: i32) -> i32; ++ pub fn sceUtilityOskInitStart(params: *mut SceUtilityOskParams) -> i32; ++ pub fn sceUtilityOskShutdownStart() -> i32; ++ pub fn sceUtilityOskUpdate(n: i32) -> i32; ++ pub fn sceUtilityOskGetStatus() -> i32; ++ pub fn sceUtilityLoadNetModule(module: NetModule) -> i32; ++ pub fn sceUtilityUnloadNetModule(module: NetModule) -> i32; ++ pub fn sceUtilityLoadAvModule(module: AvModule) -> i32; ++ pub fn sceUtilityUnloadAvModule(module: AvModule) -> i32; ++ pub fn sceUtilityLoadUsbModule(module: UsbModule) -> i32; ++ pub fn sceUtilityUnloadUsbModule(module: UsbModule) -> i32; ++ pub fn sceUtilityLoadModule(module: Module) -> i32; ++ pub fn sceUtilityUnloadModule(module: Module) -> i32; ++ pub fn sceUtilityCreateNetParam(conf: i32) -> i32; ++ pub fn sceUtilitySetNetParam(param: NetParam, val: *const c_void) -> i32; ++ pub fn sceUtilityCopyNetParam(src: i32, dest: i32) -> i32; ++ pub fn sceUtilityDeleteNetParam(conf: i32) -> i32; ++ ++ pub fn sceNetInit( ++ poolsize: i32, ++ calloutprio: i32, ++ calloutstack: i32, ++ netintrprio: i32, ++ netintrstack: i32, ++ ) -> i32; ++ pub fn sceNetTerm() -> i32; ++ pub fn sceNetFreeThreadinfo(thid: i32) -> i32; ++ pub fn sceNetThreadAbort(thid: i32) -> i32; ++ pub fn sceNetEtherStrton(name: *mut u8, mac: *mut u8); ++ pub fn sceNetEtherNtostr(mac: *mut u8, name: *mut u8); ++ pub fn sceNetGetLocalEtherAddr(mac: *mut u8) -> i32; ++ pub fn sceNetGetMallocStat(stat: *mut SceNetMallocStat) -> i32; ++ ++ pub fn sceNetAdhocctlInit( ++ stacksize: i32, ++ priority: i32, ++ adhoc_id: *mut SceNetAdhocctlAdhocId, ++ ) -> i32; ++ pub fn sceNetAdhocctlTerm() -> i32; ++ pub fn sceNetAdhocctlConnect(name: *const u8) -> i32; ++ pub fn sceNetAdhocctlDisconnect() -> i32; ++ pub fn sceNetAdhocctlGetState(event: *mut i32) -> i32; ++ pub fn sceNetAdhocctlCreate(name: *const u8) -> i32; ++ pub fn sceNetAdhocctlJoin(scaninfo: *mut SceNetAdhocctlScanInfo) -> i32; ++ pub fn sceNetAdhocctlGetAdhocId(id: *mut SceNetAdhocctlAdhocId) -> i32; ++ pub fn sceNetAdhocctlCreateEnterGameMode( ++ name: *const u8, ++ unknown: i32, ++ num: i32, ++ macs: *mut u8, ++ timeout: u32, ++ unknown2: i32, ++ ) -> i32; ++ pub fn sceNetAdhocctlJoinEnterGameMode( ++ name: *const u8, ++ hostmac: *mut u8, ++ timeout: u32, ++ unknown: i32, ++ ) -> i32; ++ pub fn sceNetAdhocctlGetGameModeInfo(gamemodeinfo: *mut SceNetAdhocctlGameModeInfo) -> i32; ++ pub fn sceNetAdhocctlExitGameMode() -> i32; ++ pub fn sceNetAdhocctlGetPeerList(length: *mut i32, buf: *mut c_void) -> i32; ++ pub fn sceNetAdhocctlGetPeerInfo( ++ mac: *mut u8, ++ size: i32, ++ peerinfo: *mut SceNetAdhocctlPeerInfo, ++ ) -> i32; ++ pub fn sceNetAdhocctlScan() -> i32; ++ pub fn sceNetAdhocctlGetScanInfo(length: *mut i32, buf: *mut c_void) -> i32; ++ pub fn sceNetAdhocctlAddHandler(handler: SceNetAdhocctlHandler, unknown: *mut c_void) -> i32; ++ pub fn sceNetAdhocctlDelHandler(id: i32) -> i32; ++ pub fn sceNetAdhocctlGetNameByAddr(mac: *mut u8, nickname: *mut u8) -> i32; ++ pub fn sceNetAdhocctlGetAddrByName( ++ nickname: *mut u8, ++ length: *mut i32, ++ buf: *mut c_void, ++ ) -> i32; ++ pub fn sceNetAdhocctlGetParameter(params: *mut SceNetAdhocctlParams) -> i32; ++ ++ pub fn sceNetAdhocInit() -> i32; ++ pub fn sceNetAdhocTerm() -> i32; ++ pub fn sceNetAdhocPdpCreate(mac: *mut u8, port: u16, buf_size: u32, unk1: i32) -> i32; ++ pub fn sceNetAdhocPdpDelete(id: i32, unk1: i32) -> i32; ++ pub fn sceNetAdhocPdpSend( ++ id: i32, ++ dest_mac_addr: *mut u8, ++ port: u16, ++ data: *mut c_void, ++ len: u32, ++ timeout: u32, ++ nonblock: i32, ++ ) -> i32; ++ pub fn sceNetAdhocPdpRecv( ++ id: i32, ++ src_mac_addr: *mut u8, ++ port: *mut u16, ++ data: *mut c_void, ++ data_length: *mut c_void, ++ timeout: u32, ++ nonblock: i32, ++ ) -> i32; ++ pub fn sceNetAdhocGetPdpStat(size: *mut i32, stat: *mut SceNetAdhocPdpStat) -> i32; ++ pub fn sceNetAdhocGameModeCreateMaster(data: *mut c_void, size: i32) -> i32; ++ pub fn sceNetAdhocGameModeCreateReplica(mac: *mut u8, data: *mut c_void, size: i32) -> i32; ++ pub fn sceNetAdhocGameModeUpdateMaster() -> i32; ++ pub fn sceNetAdhocGameModeUpdateReplica(id: i32, unk1: i32) -> i32; ++ pub fn sceNetAdhocGameModeDeleteMaster() -> i32; ++ pub fn sceNetAdhocGameModeDeleteReplica(id: i32) -> i32; ++ pub fn sceNetAdhocPtpOpen( ++ srcmac: *mut u8, ++ srcport: u16, ++ destmac: *mut u8, ++ destport: u16, ++ buf_size: u32, ++ delay: u32, ++ count: i32, ++ unk1: i32, ++ ) -> i32; ++ pub fn sceNetAdhocPtpConnect(id: i32, timeout: u32, nonblock: i32) -> i32; ++ pub fn sceNetAdhocPtpListen( ++ srcmac: *mut u8, ++ srcport: u16, ++ buf_size: u32, ++ delay: u32, ++ count: i32, ++ queue: i32, ++ unk1: i32, ++ ) -> i32; ++ pub fn sceNetAdhocPtpAccept( ++ id: i32, ++ mac: *mut u8, ++ port: *mut u16, ++ timeout: u32, ++ nonblock: i32, ++ ) -> i32; ++ pub fn sceNetAdhocPtpSend( ++ id: i32, ++ data: *mut c_void, ++ data_size: *mut i32, ++ timeout: u32, ++ nonblock: i32, ++ ) -> i32; ++ pub fn sceNetAdhocPtpRecv( ++ id: i32, ++ data: *mut c_void, ++ data_size: *mut i32, ++ timeout: u32, ++ nonblock: i32, ++ ) -> i32; ++ pub fn sceNetAdhocPtpFlush(id: i32, timeout: u32, nonblock: i32) -> i32; ++ pub fn sceNetAdhocPtpClose(id: i32, unk1: i32) -> i32; ++ pub fn sceNetAdhocGetPtpStat(size: *mut i32, stat: *mut SceNetAdhocPtpStat) -> i32; ++} ++ ++extern "C" { ++ pub fn sceNetAdhocMatchingInit(memsize: i32) -> i32; ++ pub fn sceNetAdhocMatchingTerm() -> i32; ++ pub fn sceNetAdhocMatchingCreate( ++ mode: AdhocMatchingMode, ++ max_peers: i32, ++ port: u16, ++ buf_size: i32, ++ hello_delay: u32, ++ ping_delay: u32, ++ init_count: i32, ++ msg_delay: u32, ++ callback: AdhocMatchingCallback, ++ ) -> i32; ++ pub fn sceNetAdhocMatchingDelete(matching_id: i32) -> i32; ++ pub fn sceNetAdhocMatchingStart( ++ matching_id: i32, ++ evth_pri: i32, ++ evth_stack: i32, ++ inth_pri: i32, ++ inth_stack: i32, ++ opt_len: i32, ++ opt_data: *mut c_void, ++ ) -> i32; ++ pub fn sceNetAdhocMatchingStop(matching_id: i32) -> i32; ++ pub fn sceNetAdhocMatchingSelectTarget( ++ matching_id: i32, ++ mac: *mut u8, ++ opt_len: i32, ++ opt_data: *mut c_void, ++ ) -> i32; ++ pub fn sceNetAdhocMatchingCancelTarget(matching_id: i32, mac: *mut u8) -> i32; ++ pub fn sceNetAdhocMatchingCancelTargetWithOpt( ++ matching_id: i32, ++ mac: *mut u8, ++ opt_len: i32, ++ opt_data: *mut c_void, ++ ) -> i32; ++ pub fn sceNetAdhocMatchingSendData( ++ matching_id: i32, ++ mac: *mut u8, ++ data_len: i32, ++ data: *mut c_void, ++ ) -> i32; ++ pub fn sceNetAdhocMatchingAbortSendData(matching_id: i32, mac: *mut u8) -> i32; ++ pub fn sceNetAdhocMatchingSetHelloOpt( ++ matching_id: i32, ++ opt_len: i32, ++ opt_data: *mut c_void, ++ ) -> i32; ++ pub fn sceNetAdhocMatchingGetHelloOpt( ++ matching_id: i32, ++ opt_len: *mut i32, ++ opt_data: *mut c_void, ++ ) -> i32; ++ pub fn sceNetAdhocMatchingGetMembers( ++ matching_id: i32, ++ length: *mut i32, ++ buf: *mut c_void, ++ ) -> i32; ++ pub fn sceNetAdhocMatchingGetPoolMaxAlloc() -> i32; ++ pub fn sceNetAdhocMatchingGetPoolStat(poolstat: *mut AdhocPoolStat) -> i32; ++} ++ ++extern "C" { ++ pub fn sceNetApctlInit(stack_size: i32, init_priority: i32) -> i32; ++ pub fn sceNetApctlTerm() -> i32; ++ pub fn sceNetApctlGetInfo(code: ApctlInfo, pinfo: *mut SceNetApctlInfo) -> i32; ++ pub fn sceNetApctlAddHandler(handler: SceNetApctlHandler, parg: *mut c_void) -> i32; ++ pub fn sceNetApctlDelHandler(handler_id: i32) -> i32; ++ pub fn sceNetApctlConnect(conn_index: i32) -> i32; ++ pub fn sceNetApctlDisconnect() -> i32; ++ pub fn sceNetApctlGetState(pstate: *mut ApctlState) -> i32; ++ ++ pub fn sceNetInetInit() -> i32; ++ pub fn sceNetInetTerm() -> i32; ++ pub fn sceNetInetAccept(s: i32, addr: *mut sockaddr, addr_len: *mut socklen_t) -> i32; ++ pub fn sceNetInetBind(s: i32, my_addr: *const sockaddr, addr_len: socklen_t) -> i32; ++ pub fn sceNetInetConnect(s: i32, serv_addr: *const sockaddr, addr_len: socklen_t) -> i32; ++ pub fn sceNetInetGetsockopt( ++ s: i32, ++ level: i32, ++ opt_name: i32, ++ opt_val: *mut c_void, ++ optl_en: *mut socklen_t, ++ ) -> i32; ++ pub fn sceNetInetListen(s: i32, backlog: i32) -> i32; ++ pub fn sceNetInetRecv(s: i32, buf: *mut c_void, len: usize, flags: i32) -> usize; ++ pub fn sceNetInetRecvfrom( ++ s: i32, ++ buf: *mut c_void, ++ flags: usize, ++ arg1: i32, ++ from: *mut sockaddr, ++ from_len: *mut socklen_t, ++ ) -> usize; ++ pub fn sceNetInetSend(s: i32, buf: *const c_void, len: usize, flags: i32) -> usize; ++ pub fn sceNetInetSendto( ++ s: i32, ++ buf: *const c_void, ++ len: usize, ++ flags: i32, ++ to: *const sockaddr, ++ to_len: socklen_t, ++ ) -> usize; ++ pub fn sceNetInetSetsockopt( ++ s: i32, ++ level: i32, ++ opt_name: i32, ++ opt_val: *const c_void, ++ opt_len: socklen_t, ++ ) -> i32; ++ pub fn sceNetInetShutdown(s: i32, how: i32) -> i32; ++ pub fn sceNetInetSocket(domain: i32, type_: i32, protocol: i32) -> i32; ++ pub fn sceNetInetClose(s: i32) -> i32; ++ pub fn sceNetInetGetErrno() -> i32; ++ ++ pub fn sceSslInit(unknown1: i32) -> i32; ++ pub fn sceSslEnd() -> i32; ++ pub fn sceSslGetUsedMemoryMax(memory: *mut u32) -> i32; ++ pub fn sceSslGetUsedMemoryCurrent(memory: *mut u32) -> i32; ++ ++ pub fn sceHttpInit(unknown1: u32) -> i32; ++ pub fn sceHttpEnd() -> i32; ++ pub fn sceHttpCreateTemplate(agent: *mut u8, unknown1: i32, unknown2: i32) -> i32; ++ pub fn sceHttpDeleteTemplate(templateid: i32) -> i32; ++ pub fn sceHttpCreateConnection( ++ templateid: i32, ++ host: *mut u8, ++ unknown1: *mut u8, ++ port: u16, ++ unknown2: i32, ++ ) -> i32; ++ pub fn sceHttpCreateConnectionWithURL(templateid: i32, url: *const u8, unknown1: i32) -> i32; ++ pub fn sceHttpDeleteConnection(connection_id: i32) -> i32; ++ pub fn sceHttpCreateRequest( ++ connection_id: i32, ++ method: HttpMethod, ++ path: *mut u8, ++ content_length: u64, ++ ) -> i32; ++ pub fn sceHttpCreateRequestWithURL( ++ connection_id: i32, ++ method: HttpMethod, ++ url: *mut u8, ++ content_length: u64, ++ ) -> i32; ++ pub fn sceHttpDeleteRequest(request_id: i32) -> i32; ++ pub fn sceHttpSendRequest(request_id: i32, data: *mut c_void, data_size: u32) -> i32; ++ pub fn sceHttpAbortRequest(request_id: i32) -> i32; ++ pub fn sceHttpReadData(request_id: i32, data: *mut c_void, data_size: u32) -> i32; ++ pub fn sceHttpGetContentLength(request_id: i32, content_length: *mut u64) -> i32; ++ pub fn sceHttpGetStatusCode(request_id: i32, status_code: *mut i32) -> i32; ++ pub fn sceHttpSetResolveTimeOut(id: i32, timeout: u32) -> i32; ++ pub fn sceHttpSetResolveRetry(id: i32, count: i32) -> i32; ++ pub fn sceHttpSetConnectTimeOut(id: i32, timeout: u32) -> i32; ++ pub fn sceHttpSetSendTimeOut(id: i32, timeout: u32) -> i32; ++ pub fn sceHttpSetRecvTimeOut(id: i32, timeout: u32) -> i32; ++ pub fn sceHttpEnableKeepAlive(id: i32) -> i32; ++ pub fn sceHttpDisableKeepAlive(id: i32) -> i32; ++ pub fn sceHttpEnableRedirect(id: i32) -> i32; ++ pub fn sceHttpDisableRedirect(id: i32) -> i32; ++ pub fn sceHttpEnableCookie(id: i32) -> i32; ++ pub fn sceHttpDisableCookie(id: i32) -> i32; ++ pub fn sceHttpSaveSystemCookie() -> i32; ++ pub fn sceHttpLoadSystemCookie() -> i32; ++ pub fn sceHttpAddExtraHeader(id: i32, name: *mut u8, value: *mut u8, unknown1: i32) -> i32; ++ pub fn sceHttpDeleteHeader(id: i32, name: *const u8) -> i32; ++ pub fn sceHttpsInit(unknown1: i32, unknown2: i32, unknown3: i32, unknown4: i32) -> i32; ++ pub fn sceHttpsEnd() -> i32; ++ pub fn sceHttpsLoadDefaultCert(unknown1: i32, unknown2: i32) -> i32; ++ pub fn sceHttpDisableAuth(id: i32) -> i32; ++ pub fn sceHttpDisableCache(id: i32) -> i32; ++ pub fn sceHttpEnableAuth(id: i32) -> i32; ++ pub fn sceHttpEnableCache(id: i32) -> i32; ++ pub fn sceHttpEndCache() -> i32; ++ pub fn sceHttpGetAllHeader(request: i32, header: *mut *mut u8, header_size: *mut u32) -> i32; ++ pub fn sceHttpGetNetworkErrno(request: i32, err_num: *mut i32) -> i32; ++ pub fn sceHttpGetProxy( ++ id: i32, ++ activate_flag: *mut i32, ++ mode: *mut i32, ++ proxy_host: *mut u8, ++ len: usize, ++ proxy_port: *mut u16, ++ ) -> i32; ++ pub fn sceHttpInitCache(max_size: usize) -> i32; ++ pub fn sceHttpSetAuthInfoCB(id: i32, cbfunc: HttpPasswordCB) -> i32; ++ pub fn sceHttpSetProxy( ++ id: i32, ++ activate_flag: i32, ++ mode: i32, ++ new_proxy_host: *const u8, ++ new_proxy_port: u16, ++ ) -> i32; ++ pub fn sceHttpSetResHeaderMaxSize(id: i32, header_size: u32) -> i32; ++ pub fn sceHttpSetMallocFunction( ++ malloc_func: HttpMallocFunction, ++ free_func: HttpFreeFunction, ++ realloc_func: HttpReallocFunction, ++ ) -> i32; ++ ++ pub fn sceNetResolverInit() -> i32; ++ pub fn sceNetResolverCreate(rid: *mut i32, buf: *mut c_void, buf_length: u32) -> i32; ++ pub fn sceNetResolverDelete(rid: i32) -> i32; ++ pub fn sceNetResolverStartNtoA( ++ rid: i32, ++ hostname: *const u8, ++ addr: *mut in_addr, ++ timeout: u32, ++ retry: i32, ++ ) -> i32; ++ pub fn sceNetResolverStartAtoN( ++ rid: i32, ++ addr: *const in_addr, ++ hostname: *mut u8, ++ hostname_len: u32, ++ timeout: u32, ++ retry: i32, ++ ) -> i32; ++ pub fn sceNetResolverStop(rid: i32) -> i32; ++ pub fn sceNetResolverTerm() -> i32; ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/sgx.rs mesa-25.3.3/subprojects/libc-0.2.169/src/sgx.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/sgx.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/sgx.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,27 @@ ++//! SGX C types definition ++ ++pub type c_schar = i8; ++pub type c_uchar = u8; ++pub type c_short = i16; ++pub type c_ushort = u16; ++pub type c_int = i32; ++pub type c_uint = u32; ++pub type c_float = f32; ++pub type c_double = f64; ++pub type c_longlong = i64; ++pub type c_ulonglong = u64; ++pub type intmax_t = i64; ++pub type uintmax_t = u64; ++ ++pub type size_t = usize; ++pub type ptrdiff_t = isize; ++pub type intptr_t = isize; ++pub type uintptr_t = usize; ++pub type ssize_t = isize; ++ ++pub type c_char = i8; ++pub type c_long = i64; ++pub type c_ulong = u64; ++ ++pub const INT_MIN: c_int = -2147483648; ++pub const INT_MAX: c_int = 2147483647; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/solid/aarch64.rs mesa-25.3.3/subprojects/libc-0.2.169/src/solid/aarch64.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/solid/aarch64.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/solid/aarch64.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,4 @@ ++pub type c_char = u8; ++pub type wchar_t = u32; ++pub type c_long = i64; ++pub type c_ulong = u64; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/solid/arm.rs mesa-25.3.3/subprojects/libc-0.2.169/src/solid/arm.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/solid/arm.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/solid/arm.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,4 @@ ++pub type c_char = u8; ++pub type wchar_t = u32; ++pub type c_long = i32; ++pub type c_ulong = u32; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/solid/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/solid/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/solid/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/solid/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,886 @@ ++//! Interface to the [SOLID] C library ++//! ++//! [SOLID]: https://solid.kmckk.com/ ++ ++use crate::prelude::*; ++ ++pub type c_schar = i8; ++pub type c_uchar = u8; ++pub type c_short = i16; ++pub type c_ushort = u16; ++pub type c_int = i32; ++pub type c_uint = u32; ++pub type c_float = f32; ++pub type c_double = f64; ++pub type c_longlong = i64; ++pub type c_ulonglong = u64; ++pub type intmax_t = i64; ++pub type uintmax_t = u64; ++ ++pub type uintptr_t = usize; ++pub type intptr_t = isize; ++pub type ptrdiff_t = isize; ++pub type size_t = crate::uintptr_t; ++pub type ssize_t = intptr_t; ++ ++pub type clock_t = c_uint; ++pub type time_t = i64; ++pub type clockid_t = c_int; ++pub type timer_t = c_int; ++pub type suseconds_t = c_int; ++pub type useconds_t = c_uint; ++ ++pub type sighandler_t = size_t; ++ ++// sys/ansi.h ++pub type __caddr_t = *mut c_char; ++pub type __gid_t = u32; ++pub type __in_addr_t = u32; ++pub type __in_port_t = u16; ++pub type __mode_t = u32; ++pub type __off_t = i64; ++pub type __pid_t = i32; ++pub type __sa_family_t = u8; ++pub type __socklen_t = c_uint; ++pub type __uid_t = u32; ++pub type __fsblkcnt_t = u64; ++pub type __fsfilcnt_t = u64; ++ ++// locale.h ++pub type locale_t = usize; ++ ++// nl_types.h ++pub type nl_item = c_long; ++ ++// sys/types.h ++pub type __va_list = *mut c_char; ++pub type u_int8_t = u8; ++pub type u_int16_t = u16; ++pub type u_int32_t = u32; ++pub type u_int64_t = u64; ++pub type u_char = c_uchar; ++pub type u_short = c_ushort; ++pub type u_int = c_uint; ++pub type u_long = c_ulong; ++pub type unchar = c_uchar; ++pub type ushort = c_ushort; ++pub type uint = c_uint; ++pub type ulong = c_ulong; ++pub type u_quad_t = u64; ++pub type quad_t = i64; ++pub type qaddr_t = *mut quad_t; ++pub type longlong_t = i64; ++pub type u_longlong_t = u64; ++pub type blkcnt_t = i64; ++pub type blksize_t = i32; ++pub type fsblkcnt_t = __fsblkcnt_t; ++pub type fsfilcnt_t = __fsfilcnt_t; ++pub type caddr_t = __caddr_t; ++pub type daddr_t = i64; ++pub type dev_t = u64; ++pub type fixpt_t = u32; ++pub type gid_t = __gid_t; ++pub type idtype_t = c_int; ++pub type id_t = u32; ++pub type ino_t = u64; ++pub type key_t = c_long; ++pub type mode_t = __mode_t; ++pub type nlink_t = u32; ++pub type off_t = __off_t; ++pub type pid_t = __pid_t; ++pub type lwpid_t = i32; ++pub type rlim_t = u64; ++pub type segsz_t = i32; ++pub type swblk_t = i32; ++pub type mqd_t = c_int; ++pub type cpuid_t = c_ulong; ++pub type psetid_t = c_int; ++ ++s! { ++ // stat.h ++ pub struct stat { ++ pub st_dev: dev_t, ++ pub st_ino: ino_t, ++ pub st_mode: c_short, ++ pub st_nlink: c_short, ++ pub st_uid: c_short, ++ pub st_gid: c_short, ++ pub st_rdev: dev_t, ++ pub st_size: off_t, ++ pub st_atime: time_t, ++ pub st_mtime: time_t, ++ pub st_ctime: time_t, ++ pub st_blksize: blksize_t, ++ } ++ ++ // time.h ++ pub struct tm { ++ pub tm_sec: c_int, ++ pub tm_min: c_int, ++ pub tm_hour: c_int, ++ pub tm_mday: c_int, ++ pub tm_mon: c_int, ++ pub tm_year: c_int, ++ pub tm_wday: c_int, ++ pub tm_yday: c_int, ++ pub tm_isdst: c_int, ++ pub tm_gmtoff: c_long, ++ pub tm_zone: *mut c_char, ++ } ++ ++ // stdlib.h ++ pub struct qdiv_t { ++ pub quot: quad_t, ++ pub rem: quad_t, ++ } ++ pub struct lldiv_t { ++ pub quot: c_longlong, ++ pub rem: c_longlong, ++ } ++ pub struct div_t { ++ pub quot: c_int, ++ pub rem: c_int, ++ } ++ pub struct ldiv_t { ++ pub quot: c_long, ++ pub rem: c_long, ++ } ++ ++ // locale.h ++ pub struct lconv { ++ pub decimal_point: *mut c_char, ++ pub thousands_sep: *mut c_char, ++ pub grouping: *mut c_char, ++ pub int_curr_symbol: *mut c_char, ++ pub currency_symbol: *mut c_char, ++ pub mon_decimal_point: *mut c_char, ++ pub mon_thousands_sep: *mut c_char, ++ pub mon_grouping: *mut c_char, ++ pub positive_sign: *mut c_char, ++ pub negative_sign: *mut c_char, ++ pub int_frac_digits: c_char, ++ pub frac_digits: c_char, ++ pub p_cs_precedes: c_char, ++ pub p_sep_by_space: c_char, ++ pub n_cs_precedes: c_char, ++ pub n_sep_by_space: c_char, ++ pub p_sign_posn: c_char, ++ pub n_sign_posn: c_char, ++ pub int_p_cs_precedes: c_char, ++ pub int_n_cs_precedes: c_char, ++ pub int_p_sep_by_space: c_char, ++ pub int_n_sep_by_space: c_char, ++ pub int_p_sign_posn: c_char, ++ pub int_n_sign_posn: c_char, ++ } ++ ++ pub struct iovec { ++ pub iov_base: *mut c_void, ++ pub iov_len: size_t, ++ } ++ ++ pub struct timeval { ++ pub tv_sec: c_long, ++ pub tv_usec: c_long, ++ } ++} ++ ++pub const INT_MIN: c_int = -2147483648; ++pub const INT_MAX: c_int = 2147483647; ++ ++pub const EXIT_FAILURE: c_int = 1; ++pub const EXIT_SUCCESS: c_int = 0; ++pub const RAND_MAX: c_int = 0x7fffffff; ++pub const EOF: c_int = -1; ++pub const SEEK_SET: c_int = 0; ++pub const SEEK_CUR: c_int = 1; ++pub const SEEK_END: c_int = 2; ++pub const _IOFBF: c_int = 0; ++pub const _IONBF: c_int = 2; ++pub const _IOLBF: c_int = 1; ++pub const BUFSIZ: c_uint = 1024; ++pub const FOPEN_MAX: c_uint = 20; ++pub const FILENAME_MAX: c_uint = 1024; ++ ++pub const O_RDONLY: c_int = 1; ++pub const O_WRONLY: c_int = 2; ++pub const O_RDWR: c_int = 4; ++pub const O_APPEND: c_int = 8; ++pub const O_CREAT: c_int = 0x10; ++pub const O_EXCL: c_int = 0x400; ++pub const O_TEXT: c_int = 0x100; ++pub const O_BINARY: c_int = 0x200; ++pub const O_TRUNC: c_int = 0x20; ++pub const S_IEXEC: c_short = 0o0100; ++pub const S_IWRITE: c_short = 0o0200; ++pub const S_IREAD: c_short = 0o0400; ++pub const S_IFCHR: c_short = 0o2_0000; ++pub const S_IFDIR: c_short = 0o4_0000; ++pub const S_IFMT: c_short = 0o16_0000; ++pub const S_IFIFO: c_short = 0o1_0000; ++pub const S_IFBLK: c_short = 0o6_0000; ++pub const S_IFREG: c_short = 0o10_0000; ++ ++pub const LC_ALL: c_int = 0; ++pub const LC_COLLATE: c_int = 1; ++pub const LC_CTYPE: c_int = 2; ++pub const LC_MONETARY: c_int = 3; ++pub const LC_NUMERIC: c_int = 4; ++pub const LC_TIME: c_int = 5; ++pub const LC_MESSAGES: c_int = 6; ++pub const _LC_LAST: c_int = 7; ++ ++pub const EPERM: c_int = 1; ++pub const ENOENT: c_int = 2; ++pub const ESRCH: c_int = 3; ++pub const EINTR: c_int = 4; ++pub const EIO: c_int = 5; ++pub const ENXIO: c_int = 6; ++pub const E2BIG: c_int = 7; ++pub const ENOEXEC: c_int = 8; ++pub const EBADF: c_int = 9; ++pub const ECHILD: c_int = 10; ++pub const EAGAIN: c_int = 11; ++pub const ENOMEM: c_int = 12; ++pub const EACCES: c_int = 13; ++pub const EFAULT: c_int = 14; ++pub const ENOTBLK: c_int = 15; ++pub const EBUSY: c_int = 16; ++pub const EEXIST: c_int = 17; ++pub const EXDEV: c_int = 18; ++pub const ENODEV: c_int = 19; ++pub const ENOTDIR: c_int = 20; ++pub const EISDIR: c_int = 21; ++pub const EINVAL: c_int = 22; ++pub const ENFILE: c_int = 23; ++pub const EMFILE: c_int = 24; ++pub const ENOTTY: c_int = 25; ++pub const ETXTBSY: c_int = 26; ++pub const EFBIG: c_int = 27; ++pub const ENOSPC: c_int = 28; ++pub const ESPIPE: c_int = 29; ++pub const EROFS: c_int = 30; ++pub const EMLINK: c_int = 31; ++pub const EPIPE: c_int = 32; ++pub const EDOM: c_int = 33; ++pub const ERANGE: c_int = 34; ++ ++pub const EDEADLK: c_int = 35; ++pub const ENAMETOOLONG: c_int = 36; ++pub const ENOLCK: c_int = 37; ++pub const ENOSYS: c_int = 38; ++pub const ENOTEMPTY: c_int = 39; ++pub const ELOOP: c_int = 40; ++pub const EWOULDBLOCK: c_int = EAGAIN; ++pub const ENOMSG: c_int = 42; ++pub const EIDRM: c_int = 43; ++pub const ECHRNG: c_int = 44; ++pub const EL2NSYNC: c_int = 45; ++pub const EL3HLT: c_int = 46; ++pub const EL3RST: c_int = 47; ++pub const ELNRNG: c_int = 48; ++pub const EUNATCH: c_int = 49; ++pub const ENOCSI: c_int = 50; ++pub const EL2HLT: c_int = 51; ++pub const EBADE: c_int = 52; ++pub const EBADR: c_int = 53; ++pub const EXFULL: c_int = 54; ++pub const ENOANO: c_int = 55; ++pub const EBADRQC: c_int = 56; ++pub const EBADSLT: c_int = 57; ++ ++pub const EDEADLOCK: c_int = EDEADLK; ++ ++pub const EBFONT: c_int = 59; ++pub const ENOSTR: c_int = 60; ++pub const ENODATA: c_int = 61; ++pub const ETIME: c_int = 62; ++pub const ENOSR: c_int = 63; ++pub const ENONET: c_int = 64; ++pub const ENOPKG: c_int = 65; ++pub const EREMOTE: c_int = 66; ++pub const ENOLINK: c_int = 67; ++pub const EADV: c_int = 68; ++pub const ESRMNT: c_int = 69; ++pub const ECOMM: c_int = 70; ++pub const EPROTO: c_int = 71; ++pub const EMULTIHOP: c_int = 72; ++pub const EDOTDOT: c_int = 73; ++pub const EBADMSG: c_int = 74; ++pub const EOVERFLOW: c_int = 75; ++pub const ENOTUNIQ: c_int = 76; ++pub const EBADFD: c_int = 77; ++pub const EREMCHG: c_int = 78; ++pub const ELIBACC: c_int = 79; ++pub const ELIBBAD: c_int = 80; ++pub const ELIBSCN: c_int = 81; ++pub const ELIBMAX: c_int = 82; ++pub const ELIBEXEC: c_int = 83; ++pub const EILSEQ: c_int = 84; ++pub const ERESTART: c_int = 85; ++pub const ESTRPIPE: c_int = 86; ++pub const EUSERS: c_int = 87; ++pub const ENOTSOCK: c_int = 88; ++pub const EDESTADDRREQ: c_int = 89; ++pub const EMSGSIZE: c_int = 90; ++pub const EPROTOTYPE: c_int = 91; ++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 EPFNOSUPPORT: c_int = 96; ++pub const EAFNOSUPPORT: c_int = 97; ++pub const EADDRINUSE: c_int = 98; ++pub const EADDRNOTAVAIL: c_int = 99; ++pub const ENETDOWN: c_int = 100; ++pub const ENETUNREACH: c_int = 101; ++pub const ENETRESET: c_int = 102; ++pub const ECONNABORTED: c_int = 103; ++pub const ECONNRESET: c_int = 104; ++pub const ENOBUFS: c_int = 105; ++pub const EISCONN: c_int = 106; ++pub const ENOTCONN: c_int = 107; ++pub const ESHUTDOWN: c_int = 108; ++pub const ETOOMANYREFS: c_int = 109; ++pub const ETIMEDOUT: c_int = 110; ++pub const ECONNREFUSED: c_int = 111; ++pub const EHOSTDOWN: c_int = 112; ++pub const EHOSTUNREACH: c_int = 113; ++pub const EALREADY: c_int = 114; ++pub const EINPROGRESS: c_int = 115; ++pub const ESTALE: c_int = 116; ++pub const EUCLEAN: c_int = 117; ++pub const ENOTNAM: c_int = 118; ++pub const ENAVAIL: c_int = 119; ++pub const EISNAM: c_int = 120; ++pub const EREMOTEIO: c_int = 121; ++pub const EDQUOT: c_int = 122; ++ ++pub const ENOMEDIUM: c_int = 123; ++pub const EMEDIUMTYPE: c_int = 124; ++pub const ECANCELED: c_int = 125; ++pub const ENOKEY: c_int = 126; ++pub const EKEYEXPIRED: c_int = 127; ++pub const EKEYREVOKED: c_int = 128; ++pub const EKEYREJECTED: c_int = 129; ++ ++pub const EOWNERDEAD: c_int = 130; ++pub const ENOTRECOVERABLE: c_int = 131; ++ ++pub const ENOTSUP: c_int = 132; ++pub const EFTYPE: c_int = 133; ++ ++// signal codes ++pub const SIGHUP: c_int = 1; ++pub const SIGINT: c_int = 2; ++pub const SIGQUIT: c_int = 3; ++pub const SIGILL: c_int = 4; ++pub const SIGTRAP: c_int = 5; ++pub const SIGABRT: c_int = 6; ++pub const SIGIOT: c_int = SIGABRT; ++pub const SIGEMT: c_int = 7; ++pub const SIGFPE: c_int = 8; ++pub const SIGKILL: c_int = 9; ++pub const SIGBUS: c_int = 10; ++pub const SIGSEGV: c_int = 11; ++pub const SIGSYS: c_int = 12; ++pub const SIGPIPE: c_int = 13; ++pub const SIGALRM: c_int = 14; ++pub const SIGTERM: c_int = 15; ++pub const SIGURG: c_int = 16; ++pub const SIGSTOP: c_int = 17; ++pub const SIGTSTP: c_int = 18; ++pub const SIGCONT: c_int = 19; ++pub const SIGCHLD: c_int = 20; ++pub const SIGTTIN: c_int = 21; ++pub const SIGTTOU: c_int = 22; ++pub const SIGIO: c_int = 23; ++pub const SIGXCPU: c_int = 24; ++pub const SIGXFSZ: c_int = 25; ++pub const SIGVTALRM: c_int = 26; ++pub const SIGPROF: c_int = 27; ++pub const SIGWINCH: c_int = 28; ++pub const SIGINFO: c_int = 29; ++pub const SIGUSR1: c_int = 30; ++pub const SIGUSR2: c_int = 31; ++pub const SIGPWR: c_int = 32; ++ ++#[cfg_attr(feature = "extra_traits", derive(Debug))] ++pub enum FILE {} ++impl Copy for FILE {} ++impl Clone for FILE { ++ fn clone(&self) -> FILE { ++ *self ++ } ++} ++#[cfg_attr(feature = "extra_traits", derive(Debug))] ++pub enum fpos_t {} ++impl Copy for fpos_t {} ++impl Clone for fpos_t { ++ fn clone(&self) -> fpos_t { ++ *self ++ } ++} ++ ++extern "C" { ++ // ctype.h ++ pub fn isalnum(c: c_int) -> c_int; ++ pub fn isalpha(c: c_int) -> c_int; ++ pub fn iscntrl(c: c_int) -> c_int; ++ pub fn isdigit(c: c_int) -> c_int; ++ pub fn isgraph(c: c_int) -> c_int; ++ pub fn islower(c: c_int) -> c_int; ++ pub fn isprint(c: c_int) -> c_int; ++ pub fn ispunct(c: c_int) -> c_int; ++ pub fn isspace(c: c_int) -> c_int; ++ pub fn isupper(c: c_int) -> c_int; ++ pub fn isxdigit(c: c_int) -> c_int; ++ pub fn isblank(c: c_int) -> c_int; ++ pub fn tolower(c: c_int) -> c_int; ++ pub fn toupper(c: c_int) -> c_int; ++ ++ // stdio.h ++ pub fn __get_stdio_file(fileno: c_int) -> *mut FILE; ++ pub fn clearerr(arg1: *mut FILE); ++ pub fn fclose(arg1: *mut FILE) -> c_int; ++ pub fn feof(arg1: *mut FILE) -> c_int; ++ pub fn ferror(arg1: *mut FILE) -> c_int; ++ pub fn fflush(arg1: *mut FILE) -> c_int; ++ pub fn fgetc(arg1: *mut FILE) -> c_int; ++ pub fn fgets(arg1: *mut c_char, arg2: c_int, arg3: *mut FILE) -> *mut c_char; ++ pub fn fopen(arg1: *const c_char, arg2: *const c_char) -> *mut FILE; ++ pub fn fprintf(arg1: *mut FILE, arg2: *const c_char, ...) -> c_int; ++ pub fn fputc(arg1: c_int, arg2: *mut FILE) -> c_int; ++ pub fn fputs(arg1: *const c_char, arg2: *mut FILE) -> c_int; ++ pub fn fread(arg1: *mut c_void, arg2: size_t, arg3: size_t, arg4: *mut FILE) -> size_t; ++ pub fn freopen(arg1: *const c_char, arg2: *const c_char, arg3: *mut FILE) -> *mut FILE; ++ pub fn fscanf(arg1: *mut FILE, arg2: *const c_char, ...) -> c_int; ++ pub fn fseek(arg1: *mut FILE, arg2: c_long, arg3: c_int) -> c_int; ++ pub fn ftell(arg1: *mut FILE) -> c_long; ++ pub fn fwrite(arg1: *const c_void, arg2: size_t, arg3: size_t, arg4: *mut FILE) -> size_t; ++ pub fn getc(arg1: *mut FILE) -> c_int; ++ pub fn getchar() -> c_int; ++ pub fn perror(arg1: *const c_char); ++ pub fn printf(arg1: *const c_char, ...) -> c_int; ++ pub fn putc(arg1: c_int, arg2: *mut FILE) -> c_int; ++ pub fn putchar(arg1: c_int) -> c_int; ++ pub fn puts(arg1: *const c_char) -> c_int; ++ pub fn remove(arg1: *const c_char) -> c_int; ++ pub fn rewind(arg1: *mut FILE); ++ pub fn scanf(arg1: *const c_char, ...) -> c_int; ++ pub fn setbuf(arg1: *mut FILE, arg2: *mut c_char); ++ pub fn setvbuf(arg1: *mut FILE, arg2: *mut c_char, arg3: c_int, arg4: size_t) -> c_int; ++ pub fn sscanf(arg1: *const c_char, arg2: *const c_char, ...) -> c_int; ++ pub fn tmpfile() -> *mut FILE; ++ pub fn ungetc(arg1: c_int, arg2: *mut FILE) -> c_int; ++ pub fn vfprintf(arg1: *mut FILE, arg2: *const c_char, arg3: __va_list) -> c_int; ++ pub fn vprintf(arg1: *const c_char, arg2: __va_list) -> c_int; ++ pub fn gets(arg1: *mut c_char) -> *mut c_char; ++ pub fn sprintf(arg1: *mut c_char, arg2: *const c_char, ...) -> c_int; ++ pub fn tmpnam(arg1: *const c_char) -> *mut c_char; ++ pub fn vsprintf(arg1: *mut c_char, arg2: *const c_char, arg3: __va_list) -> c_int; ++ pub fn rename(arg1: *const c_char, arg2: *const c_char) -> c_int; ++ pub fn asiprintf(arg1: *mut *mut c_char, arg2: *const c_char, ...) -> c_int; ++ pub fn fiprintf(arg1: *mut FILE, arg2: *const c_char, ...) -> c_int; ++ pub fn fiscanf(arg1: *mut FILE, arg2: *const c_char, ...) -> c_int; ++ pub fn iprintf(arg1: *const c_char, ...) -> c_int; ++ pub fn iscanf(arg1: *const c_char, ...) -> c_int; ++ pub fn siprintf(arg1: *mut c_char, arg2: *const c_char, ...) -> c_int; ++ pub fn siscanf(arg1: *mut c_char, arg2: *const c_char, ...) -> c_int; ++ pub fn sniprintf(arg1: *mut c_char, arg2: size_t, arg3: *const c_char, ...) -> c_int; ++ pub fn vasiprintf(arg1: *mut *mut c_char, arg2: *const c_char, arg3: __va_list) -> c_int; ++ pub fn vfiprintf(arg1: *mut FILE, arg2: *const c_char, arg3: __va_list) -> c_int; ++ pub fn vfiscanf(arg1: *mut FILE, arg2: *const c_char, arg3: __va_list) -> c_int; ++ pub fn viprintf(arg1: *const c_char, arg2: __va_list) -> c_int; ++ pub fn viscanf(arg1: *const c_char, arg2: __va_list) -> c_int; ++ pub fn vsiprintf(arg1: *mut c_char, arg2: *const c_char, arg3: __va_list) -> c_int; ++ pub fn vsiscanf(arg1: *const c_char, arg2: *const c_char, arg3: __va_list) -> c_int; ++ pub fn vsniprintf( ++ arg1: *mut c_char, ++ arg2: size_t, ++ arg3: *const c_char, ++ arg4: __va_list, ++ ) -> c_int; ++ pub fn vdiprintf(arg1: c_int, arg2: *const c_char, arg3: __va_list) -> c_int; ++ pub fn diprintf(arg1: c_int, arg2: *const c_char, ...) -> c_int; ++ pub fn fgetpos(arg1: *mut FILE, arg2: *mut fpos_t) -> c_int; ++ pub fn fsetpos(arg1: *mut FILE, arg2: *const fpos_t) -> c_int; ++ pub fn fdopen(arg1: c_int, arg2: *const c_char) -> *mut FILE; ++ pub fn fileno(arg1: *mut FILE) -> c_int; ++ pub fn flockfile(arg1: *mut FILE); ++ pub fn ftrylockfile(arg1: *mut FILE) -> c_int; ++ pub fn funlockfile(arg1: *mut FILE); ++ pub fn getc_unlocked(arg1: *mut FILE) -> c_int; ++ pub fn getchar_unlocked() -> c_int; ++ pub fn putc_unlocked(arg1: c_int, arg2: *mut FILE) -> c_int; ++ pub fn putchar_unlocked(arg1: c_int) -> c_int; ++ pub fn snprintf(arg1: *mut c_char, arg2: size_t, arg3: *const c_char, ...) -> c_int; ++ pub fn vsnprintf( ++ arg1: *mut c_char, ++ arg2: size_t, ++ arg3: *const c_char, ++ arg4: __va_list, ++ ) -> c_int; ++ pub fn getw(arg1: *mut FILE) -> c_int; ++ pub fn putw(arg1: c_int, arg2: *mut FILE) -> c_int; ++ pub fn tempnam(arg1: *const c_char, arg2: *const c_char) -> *mut c_char; ++ pub fn fseeko(stream: *mut FILE, offset: off_t, whence: c_int) -> c_int; ++ pub fn ftello(stream: *mut FILE) -> off_t; ++ ++ // stdlib.h ++ pub fn atof(arg1: *const c_char) -> f64; ++ pub fn strtod(arg1: *const c_char, arg2: *mut *mut c_char) -> f64; ++ pub fn drand48() -> f64; ++ pub fn erand48(arg1: *mut c_ushort) -> f64; ++ pub fn strtof(arg1: *const c_char, arg2: *mut *mut c_char) -> f32; ++ pub fn strtold(arg1: *const c_char, arg2: *mut *mut c_char) -> f64; ++ pub fn strtod_l(arg1: *const c_char, arg2: *mut *mut c_char, arg3: locale_t) -> f64; ++ pub fn strtof_l(arg1: *const c_char, arg2: *mut *mut c_char, arg3: locale_t) -> f32; ++ pub fn strtold_l(arg1: *const c_char, arg2: *mut *mut c_char, arg3: locale_t) -> f64; ++ pub fn _Exit(arg1: c_int) -> !; ++ pub fn abort() -> !; ++ pub fn abs(arg1: c_int) -> c_int; ++ pub fn atexit(arg1: Option) -> c_int; ++ pub fn atoi(arg1: *const c_char) -> c_int; ++ pub fn atol(arg1: *const c_char) -> c_long; ++ pub fn itoa(arg1: c_int, arg2: *mut c_char, arg3: c_int) -> *mut c_char; ++ pub fn ltoa(arg1: c_long, arg2: *mut c_char, arg3: c_int) -> *mut c_char; ++ pub fn ultoa(arg1: c_ulong, arg2: *mut c_char, arg3: c_int) -> *mut c_char; ++ pub fn bsearch( ++ arg1: *const c_void, ++ arg2: *const c_void, ++ arg3: size_t, ++ arg4: size_t, ++ arg5: Option c_int>, ++ ) -> *mut c_void; ++ pub fn calloc(arg1: size_t, arg2: size_t) -> *mut c_void; ++ pub fn div(arg1: c_int, arg2: c_int) -> div_t; ++ pub fn exit(arg1: c_int) -> !; ++ pub fn free(arg1: *mut c_void); ++ pub fn getenv(arg1: *const c_char) -> *mut c_char; ++ pub fn labs(arg1: c_long) -> c_long; ++ pub fn ldiv(arg1: c_long, arg2: c_long) -> ldiv_t; ++ pub fn malloc(arg1: size_t) -> *mut c_void; ++ pub fn qsort( ++ arg1: *mut c_void, ++ arg2: size_t, ++ arg3: size_t, ++ arg4: Option c_int>, ++ ); ++ pub fn rand() -> c_int; ++ pub fn realloc(arg1: *mut c_void, arg2: size_t) -> *mut c_void; ++ pub fn srand(arg1: c_uint); ++ pub fn strtol(arg1: *const c_char, arg2: *mut *mut c_char, arg3: c_int) -> c_long; ++ pub fn strtoul(arg1: *const c_char, arg2: *mut *mut c_char, arg3: c_int) -> c_ulong; ++ pub fn mblen(arg1: *const c_char, arg2: size_t) -> c_int; ++ pub fn mbstowcs(arg1: *mut wchar_t, arg2: *const c_char, arg3: size_t) -> size_t; ++ pub fn wctomb(arg1: *mut c_char, arg2: wchar_t) -> c_int; ++ pub fn mbtowc(arg1: *mut wchar_t, arg2: *const c_char, arg3: size_t) -> c_int; ++ pub fn wcstombs(arg1: *mut c_char, arg2: *const wchar_t, arg3: size_t) -> size_t; ++ pub fn rand_r(arg1: *mut c_uint) -> c_int; ++ pub fn jrand48(arg1: *mut c_ushort) -> c_long; ++ pub fn lcong48(arg1: *mut c_ushort); ++ pub fn lrand48() -> c_long; ++ pub fn mrand48() -> c_long; ++ pub fn nrand48(arg1: *mut c_ushort) -> c_long; ++ pub fn seed48(arg1: *mut c_ushort) -> *mut c_ushort; ++ pub fn srand48(arg1: c_long); ++ pub fn putenv(arg1: *mut c_char) -> c_int; ++ pub fn a64l(arg1: *const c_char) -> c_long; ++ pub fn l64a(arg1: c_long) -> *mut c_char; ++ pub fn random() -> c_long; ++ pub fn setstate(arg1: *mut c_char) -> *mut c_char; ++ pub fn initstate(arg1: c_uint, arg2: *mut c_char, arg3: size_t) -> *mut c_char; ++ pub fn srandom(arg1: c_uint); ++ pub fn mkostemp(arg1: *mut c_char, arg2: c_int) -> c_int; ++ pub fn mkostemps(arg1: *mut c_char, arg2: c_int, arg3: c_int) -> c_int; ++ pub fn mkdtemp(arg1: *mut c_char) -> *mut c_char; ++ pub fn mkstemp(arg1: *mut c_char) -> c_int; ++ pub fn mktemp(arg1: *mut c_char) -> *mut c_char; ++ pub fn atoll(arg1: *const c_char) -> c_longlong; ++ pub fn llabs(arg1: c_longlong) -> c_longlong; ++ pub fn lldiv(arg1: c_longlong, arg2: c_longlong) -> lldiv_t; ++ pub fn strtoll(arg1: *const c_char, arg2: *mut *mut c_char, arg3: c_int) -> c_longlong; ++ pub fn strtoull(arg1: *const c_char, arg2: *mut *mut c_char, arg3: c_int) -> c_ulonglong; ++ pub fn aligned_alloc(arg1: size_t, arg2: size_t) -> *mut c_void; ++ pub fn at_quick_exit(arg1: Option) -> c_int; ++ pub fn quick_exit(arg1: c_int); ++ pub fn setenv(arg1: *const c_char, arg2: *const c_char, arg3: c_int) -> c_int; ++ pub fn unsetenv(arg1: *const c_char) -> c_int; ++ pub fn humanize_number( ++ arg1: *mut c_char, ++ arg2: size_t, ++ arg3: i64, ++ arg4: *const c_char, ++ arg5: c_int, ++ arg6: c_int, ++ ) -> c_int; ++ pub fn dehumanize_number(arg1: *const c_char, arg2: *mut i64) -> c_int; ++ pub fn getenv_r(arg1: *const c_char, arg2: *mut c_char, arg3: size_t) -> c_int; ++ pub fn heapsort( ++ arg1: *mut c_void, ++ arg2: size_t, ++ arg3: size_t, ++ arg4: Option c_int>, ++ ) -> c_int; ++ pub fn mergesort( ++ arg1: *mut c_void, ++ arg2: size_t, ++ arg3: size_t, ++ arg4: Option c_int>, ++ ) -> c_int; ++ pub fn radixsort( ++ arg1: *mut *const c_uchar, ++ arg2: c_int, ++ arg3: *const c_uchar, ++ arg4: c_uint, ++ ) -> c_int; ++ pub fn sradixsort( ++ arg1: *mut *const c_uchar, ++ arg2: c_int, ++ arg3: *const c_uchar, ++ arg4: c_uint, ++ ) -> c_int; ++ pub fn getprogname() -> *const c_char; ++ pub fn setprogname(arg1: *const c_char); ++ pub fn qabs(arg1: quad_t) -> quad_t; ++ pub fn strtoq(arg1: *const c_char, arg2: *mut *mut c_char, arg3: c_int) -> quad_t; ++ pub fn strtouq(arg1: *const c_char, arg2: *mut *mut c_char, arg3: c_int) -> u_quad_t; ++ pub fn strsuftoll( ++ arg1: *const c_char, ++ arg2: *const c_char, ++ arg3: c_longlong, ++ arg4: c_longlong, ++ ) -> c_longlong; ++ pub fn strsuftollx( ++ arg1: *const c_char, ++ arg2: *const c_char, ++ arg3: c_longlong, ++ arg4: c_longlong, ++ arg5: *mut c_char, ++ arg6: size_t, ++ ) -> c_longlong; ++ pub fn l64a_r(arg1: c_long, arg2: *mut c_char, arg3: c_int) -> c_int; ++ pub fn qdiv(arg1: quad_t, arg2: quad_t) -> qdiv_t; ++ pub fn strtol_l( ++ arg1: *const c_char, ++ arg2: *mut *mut c_char, ++ arg3: c_int, ++ arg4: locale_t, ++ ) -> c_long; ++ pub fn strtoul_l( ++ arg1: *const c_char, ++ arg2: *mut *mut c_char, ++ arg3: c_int, ++ arg4: locale_t, ++ ) -> c_ulong; ++ pub fn strtoll_l( ++ arg1: *const c_char, ++ arg2: *mut *mut c_char, ++ arg3: c_int, ++ arg4: locale_t, ++ ) -> c_longlong; ++ pub fn strtoull_l( ++ arg1: *const c_char, ++ arg2: *mut *mut c_char, ++ arg3: c_int, ++ arg4: locale_t, ++ ) -> c_ulonglong; ++ pub fn strtoq_l( ++ arg1: *const c_char, ++ arg2: *mut *mut c_char, ++ arg3: c_int, ++ arg4: locale_t, ++ ) -> quad_t; ++ pub fn strtouq_l( ++ arg1: *const c_char, ++ arg2: *mut *mut c_char, ++ arg3: c_int, ++ arg4: locale_t, ++ ) -> u_quad_t; ++ pub fn _mb_cur_max_l(arg1: locale_t) -> size_t; ++ pub fn mblen_l(arg1: *const c_char, arg2: size_t, arg3: locale_t) -> c_int; ++ pub fn mbstowcs_l( ++ arg1: *mut wchar_t, ++ arg2: *const c_char, ++ arg3: size_t, ++ arg4: locale_t, ++ ) -> size_t; ++ pub fn wctomb_l(arg1: *mut c_char, arg2: wchar_t, arg3: locale_t) -> c_int; ++ pub fn mbtowc_l(arg1: *mut wchar_t, arg2: *const c_char, arg3: size_t, arg4: locale_t) ++ -> c_int; ++ pub fn wcstombs_l( ++ arg1: *mut c_char, ++ arg2: *const wchar_t, ++ arg3: size_t, ++ arg4: locale_t, ++ ) -> size_t; ++ ++ // string.h ++ pub fn memchr(arg1: *const c_void, arg2: c_int, arg3: size_t) -> *mut c_void; ++ pub fn memcmp(arg1: *const c_void, arg2: *const c_void, arg3: size_t) -> c_int; ++ pub fn memcpy(arg1: *mut c_void, arg2: *const c_void, arg3: size_t) -> *mut c_void; ++ pub fn memmove(arg1: *mut c_void, arg2: *const c_void, arg3: size_t) -> *mut c_void; ++ pub fn memset(arg1: *mut c_void, arg2: c_int, arg3: size_t) -> *mut c_void; ++ pub fn strcat(arg1: *mut c_char, arg2: *const c_char) -> *mut c_char; ++ pub fn strchr(arg1: *const c_char, arg2: c_int) -> *mut c_char; ++ pub fn strcmp(arg1: *const c_char, arg2: *const c_char) -> c_int; ++ pub fn strcoll(arg1: *const c_char, arg2: *const c_char) -> c_int; ++ pub fn strcpy(arg1: *mut c_char, arg2: *const c_char) -> *mut c_char; ++ pub fn strcspn(arg1: *const c_char, arg2: *const c_char) -> size_t; ++ pub fn strerror(arg1: c_int) -> *mut c_char; ++ pub fn strlen(arg1: *const c_char) -> size_t; ++ pub fn strncat(arg1: *mut c_char, arg2: *const c_char, arg3: size_t) -> *mut c_char; ++ pub fn strncmp(arg1: *const c_char, arg2: *const c_char, arg3: size_t) -> c_int; ++ pub fn strncpy(arg1: *mut c_char, arg2: *const c_char, arg3: size_t) -> *mut c_char; ++ pub fn strpbrk(arg1: *const c_char, arg2: *const c_char) -> *mut c_char; ++ pub fn strrchr(arg1: *const c_char, arg2: c_int) -> *mut c_char; ++ pub fn strspn(arg1: *const c_char, arg2: *const c_char) -> size_t; ++ pub fn strstr(arg1: *const c_char, arg2: *const c_char) -> *mut c_char; ++ pub fn strtok(arg1: *mut c_char, arg2: *const c_char) -> *mut c_char; ++ pub fn strtok_r(arg1: *mut c_char, arg2: *const c_char, arg3: *mut *mut c_char) -> *mut c_char; ++ pub fn strerror_r(arg1: c_int, arg2: *mut c_char, arg3: size_t) -> c_int; ++ pub fn strxfrm(arg1: *mut c_char, arg2: *const c_char, arg3: size_t) -> size_t; ++ pub fn memccpy( ++ arg1: *mut c_void, ++ arg2: *const c_void, ++ arg3: c_int, ++ arg4: size_t, ++ ) -> *mut c_void; ++ pub fn strdup(arg1: *const c_char) -> *mut c_char; ++ pub fn stpcpy(arg1: *mut c_char, arg2: *const c_char) -> *mut c_char; ++ pub fn stpncpy(arg1: *mut c_char, arg2: *const c_char, arg3: size_t) -> *mut c_char; ++ pub fn strnlen(arg1: *const c_char, arg2: size_t) -> size_t; ++ pub fn memmem( ++ arg1: *const c_void, ++ arg2: size_t, ++ arg3: *const c_void, ++ arg4: size_t, ++ ) -> *mut c_void; ++ pub fn strcasestr(arg1: *const c_char, arg2: *const c_char) -> *mut c_char; ++ pub fn strlcat(arg1: *mut c_char, arg2: *const c_char, arg3: size_t) -> size_t; ++ pub fn strlcpy(arg1: *mut c_char, arg2: *const c_char, arg3: size_t) -> size_t; ++ pub fn strsep(arg1: *mut *mut c_char, arg2: *const c_char) -> *mut c_char; ++ pub fn stresep(arg1: *mut *mut c_char, arg2: *const c_char, arg3: c_int) -> *mut c_char; ++ pub fn strndup(arg1: *const c_char, arg2: size_t) -> *mut c_char; ++ pub fn memrchr(arg1: *const c_void, arg2: c_int, arg3: size_t) -> *mut c_void; ++ pub fn explicit_memset(arg1: *mut c_void, arg2: c_int, arg3: size_t) -> *mut c_void; ++ pub fn consttime_memequal(arg1: *const c_void, arg2: *const c_void, arg3: size_t) -> c_int; ++ pub fn strcoll_l(arg1: *const c_char, arg2: *const c_char, arg3: locale_t) -> c_int; ++ pub fn strxfrm_l( ++ arg1: *mut c_char, ++ arg2: *const c_char, ++ arg3: size_t, ++ arg4: locale_t, ++ ) -> size_t; ++ pub fn strerror_l(arg1: c_int, arg2: locale_t) -> *mut c_char; ++ ++ // strings.h ++ pub fn bcmp(arg1: *const c_void, arg2: *const c_void, arg3: size_t) -> c_int; ++ pub fn bcopy(arg1: *const c_void, arg2: *mut c_void, arg3: size_t); ++ pub fn bzero(arg1: *mut c_void, arg2: size_t); ++ pub fn ffs(arg1: c_int) -> c_int; ++ pub fn popcount(arg1: c_uint) -> c_uint; ++ pub fn popcountl(arg1: c_ulong) -> c_uint; ++ pub fn popcountll(arg1: c_ulonglong) -> c_uint; ++ pub fn popcount32(arg1: u32) -> c_uint; ++ pub fn popcount64(arg1: u64) -> c_uint; ++ pub fn rindex(arg1: *const c_char, arg2: c_int) -> *mut c_char; ++ pub fn strcasecmp(arg1: *const c_char, arg2: *const c_char) -> c_int; ++ pub fn strncasecmp(arg1: *const c_char, arg2: *const c_char, arg3: size_t) -> c_int; ++ ++ // signal.h ++ pub fn signal(arg1: c_int, arg2: sighandler_t) -> sighandler_t; ++ pub fn raise(arg1: c_int) -> c_int; ++ ++ // time.h ++ pub fn asctime(arg1: *const tm) -> *mut c_char; ++ pub fn clock() -> clock_t; ++ pub fn ctime(arg1: *const time_t) -> *mut c_char; ++ pub fn difftime(arg1: time_t, arg2: time_t) -> f64; ++ pub fn gmtime(arg1: *const time_t) -> *mut tm; ++ pub fn localtime(arg1: *const time_t) -> *mut tm; ++ pub fn time(arg1: *mut time_t) -> time_t; ++ pub fn mktime(arg1: *mut tm) -> time_t; ++ pub fn strftime( ++ arg1: *mut c_char, ++ arg2: size_t, ++ arg3: *const c_char, ++ arg4: *const tm, ++ ) -> size_t; ++ pub fn utime(arg1: *const c_char, arg2: *mut time_t) -> c_int; ++ pub fn asctime_r(arg1: *const tm, arg2: *mut c_char) -> *mut c_char; ++ pub fn ctime_r(arg1: *const time_t, arg2: *mut c_char) -> *mut c_char; ++ pub fn gmtime_r(arg1: *const time_t, arg2: *mut tm) -> *mut tm; ++ pub fn localtime_r(arg1: *const time_t, arg2: *mut tm) -> *mut tm; ++ ++ // sys/stat.h ++ pub fn stat(arg1: *const c_char, arg2: *mut stat) -> c_int; ++ pub fn lstat(arg1: *const c_char, arg2: *mut stat) -> c_int; ++ pub fn fstat(arg1: c_int, arg2: *mut stat) -> c_int; ++ pub fn chmod(arg1: *const c_char, arg2: __mode_t) -> c_int; ++ pub fn mkdir(arg1: *const c_char, arg2: __mode_t) -> c_int; ++ ++ // fcntl.h ++ pub fn open(arg1: *const c_char, arg2: c_int, ...) -> c_int; ++ pub fn creat(arg1: *const c_char, arg2: c_int) -> c_int; ++ pub fn close(arg1: c_int) -> c_int; ++ pub fn read(arg1: c_int, arg2: *mut c_void, arg3: c_int) -> c_int; ++ pub fn write(arg1: c_int, arg2: *const c_void, arg3: c_int) -> c_int; ++ pub fn unlink(arg1: *const c_char) -> c_int; ++ pub fn tell(arg1: c_int) -> c_long; ++ pub fn dup(arg1: c_int) -> c_int; ++ pub fn dup2(arg1: c_int, arg2: c_int) -> c_int; ++ pub fn access(arg1: *const c_char, arg2: c_int) -> c_int; ++ pub fn rmdir(arg1: *const c_char) -> c_int; ++ pub fn chdir(arg1: *const c_char) -> c_int; ++ pub fn _exit(arg1: c_int); ++ pub fn getwd(arg1: *mut c_char) -> *mut c_char; ++ pub fn getcwd(arg1: *mut c_char, arg2: size_t) -> *mut c_char; ++ pub static mut optarg: *mut c_char; ++ pub static mut opterr: c_int; ++ pub static mut optind: c_int; ++ pub static mut optopt: c_int; ++ pub static mut optreset: c_int; ++ pub fn getopt(arg1: c_int, arg2: *mut *mut c_char, arg3: *const c_char) -> c_int; ++ pub static mut suboptarg: *mut c_char; ++ pub fn getsubopt( ++ arg1: *mut *mut c_char, ++ arg2: *const *mut c_char, ++ arg3: *mut *mut c_char, ++ ) -> c_int; ++ pub fn fcntl(arg1: c_int, arg2: c_int, ...) -> c_int; ++ pub fn getpid() -> pid_t; ++ pub fn sleep(arg1: c_uint) -> c_uint; ++ pub fn usleep(arg1: useconds_t) -> c_int; ++ ++ // locale.h ++ pub fn localeconv() -> *mut lconv; ++ pub fn setlocale(arg1: c_int, arg2: *const c_char) -> *mut c_char; ++ pub fn duplocale(arg1: locale_t) -> locale_t; ++ pub fn freelocale(arg1: locale_t); ++ pub fn localeconv_l(arg1: locale_t) -> *mut lconv; ++ pub fn newlocale(arg1: c_int, arg2: *const c_char, arg3: locale_t) -> locale_t; ++ ++ // langinfo.h ++ pub fn nl_langinfo(item: crate::nl_item) -> *mut c_char; ++ pub fn nl_langinfo_l(item: crate::nl_item, locale: locale_t) -> *mut c_char; ++ ++ // malloc.h ++ pub fn memalign(align: size_t, size: size_t) -> *mut c_void; ++ ++ // sys/types.h ++ pub fn lseek(arg1: c_int, arg2: __off_t, arg3: c_int) -> __off_t; ++} ++ ++cfg_if! { ++ if #[cfg(target_arch = "aarch64")] { ++ mod aarch64; ++ pub use self::aarch64::*; ++ } else if #[cfg(any(target_arch = "arm"))] { ++ mod arm; ++ pub use self::arm::*; ++ } else { ++ // Unknown target_arch ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/switch.rs mesa-25.3.3/subprojects/libc-0.2.169/src/switch.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/switch.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/switch.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,29 @@ ++//! Switch C type definitions ++ ++pub type c_schar = i8; ++pub type c_uchar = u8; ++pub type c_short = i16; ++pub type c_ushort = u16; ++pub type c_int = i32; ++pub type c_uint = u32; ++pub type c_float = f32; ++pub type c_double = f64; ++pub type c_longlong = i64; ++pub type c_ulonglong = u64; ++pub type intmax_t = i64; ++pub type uintmax_t = u64; ++ ++pub type size_t = usize; ++pub type ptrdiff_t = isize; ++pub type intptr_t = isize; ++pub type uintptr_t = usize; ++pub type ssize_t = isize; ++ ++pub type off_t = i64; ++pub type c_char = u8; ++pub type c_long = i64; ++pub type c_ulong = u64; ++pub type wchar_t = u32; ++ ++pub const INT_MIN: c_int = -2147483648; ++pub const INT_MAX: c_int = 2147483647; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/teeos/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/teeos/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/teeos/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/teeos/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,1382 @@ ++//! Libc bindings for teeos ++//! ++//! Apparently the loader just dynamically links it anyway, but fails ++//! when linking is explicitly requested. ++#![allow(non_camel_case_types)] ++#![allow(non_snake_case)] ++ ++use crate::prelude::*; ++ ++pub type c_schar = i8; ++ ++pub type c_uchar = u8; ++ ++pub type c_short = i16; ++ ++pub type c_ushort = u16; ++ ++pub type c_int = i32; ++ ++pub type c_uint = u32; ++ ++pub type c_bool = i32; ++ ++pub type c_float = f32; ++ ++pub type c_double = f64; ++ ++pub type c_longlong = i64; ++ ++pub type c_ulonglong = u64; ++ ++pub type intmax_t = i64; ++ ++pub type uintmax_t = u64; ++ ++pub type size_t = usize; ++ ++pub type ptrdiff_t = isize; ++ ++pub type intptr_t = isize; ++ ++pub type uintptr_t = usize; ++ ++pub type ssize_t = isize; ++ ++pub type pid_t = c_int; ++ ++// aarch64 specific ++pub type c_char = u8; ++ ++pub type wchar_t = u32; ++ ++pub type c_long = i64; ++ ++pub type c_ulong = u64; ++ ++#[repr(align(16))] ++pub struct _CLongDouble(pub u128); ++ ++// long double in C means A float point value, which has 128bit length. ++// but some bit maybe not used, so the real length of long double could be 80(x86) or 128(power pc/IEEE) ++// this is different from f128(not stable and not included default) in Rust, so we use u128 for FFI(Rust to C). ++// this is unstable and will cause to memfault/data abort. ++pub type c_longdouble = _CLongDouble; ++ ++pub type pthread_t = c_ulong; ++ ++pub type pthread_key_t = c_uint; ++ ++pub type pthread_spinlock_t = c_int; ++ ++pub type off_t = i64; ++ ++pub type time_t = c_long; ++ ++pub type clock_t = c_long; ++ ++pub type clockid_t = c_int; ++ ++pub type suseconds_t = c_long; ++ ++pub type once_fn = extern "C" fn() -> c_void; ++ ++pub type pthread_once_t = c_int; ++ ++pub type va_list = *mut c_char; ++ ++pub type wint_t = c_uint; ++ ++pub type wctype_t = c_ulong; ++ ++pub type cmpfunc = extern "C" fn(x: *const c_void, y: *const c_void) -> c_int; ++ ++#[repr(align(8))] ++#[repr(C)] ++pub struct pthread_cond_t { ++ #[doc(hidden)] ++ size: [u8; __SIZEOF_PTHREAD_COND_T], ++} ++ ++#[repr(align(8))] ++#[repr(C)] ++pub struct pthread_mutex_t { ++ #[doc(hidden)] ++ size: [u8; __SIZEOF_PTHREAD_MUTEX_T], ++} ++ ++#[repr(align(4))] ++#[repr(C)] ++pub struct pthread_mutexattr_t { ++ #[doc(hidden)] ++ size: [u8; __SIZEOF_PTHREAD_MUTEXATTR_T], ++} ++ ++#[repr(align(4))] ++#[repr(C)] ++pub struct pthread_condattr_t { ++ #[doc(hidden)] ++ size: [u8; __SIZEOF_PTHREAD_CONDATTR_T], ++} ++ ++#[repr(C)] ++pub struct pthread_attr_t { ++ __size: [u64; 7], ++} ++ ++#[repr(C)] ++pub struct cpu_set_t { ++ bits: [c_ulong; 128 / core::mem::size_of::()], ++} ++ ++#[repr(C)] ++pub struct timespec { ++ pub tv_sec: time_t, ++ pub tv_nsec: c_long, ++} ++ ++#[repr(C)] ++pub struct timeval { ++ pub tv_sec: time_t, ++ pub tv_usec: suseconds_t, ++} ++ ++#[repr(C)] ++pub struct tm { ++ pub tm_sec: c_int, ++ pub tm_min: c_int, ++ pub tm_hour: c_int, ++ pub tm_mday: c_int, ++ pub tm_mon: c_int, ++ pub tm_year: c_int, ++ pub tm_wday: c_int, ++ pub tm_yday: c_int, ++ pub tm_isdst: c_int, ++ pub __tm_gmtoff: c_long, ++ pub __tm_zone: *const c_char, ++} ++ ++#[repr(C)] ++pub struct mbstate_t { ++ pub __opaque1: c_uint, ++ pub __opaque2: c_uint, ++} ++ ++#[repr(C)] ++pub struct sem_t { ++ pub __val: [c_int; 4 * core::mem::size_of::() / core::mem::size_of::()], ++} ++ ++#[repr(C)] ++pub struct div_t { ++ pub quot: c_int, ++ pub rem: c_int, ++} ++ ++// fcntl ++pub const O_CREAT: u32 = 0o100; ++ ++pub const O_EXCL: u32 = 0o200; ++ ++pub const O_NOCTTY: u32 = 0o400; ++ ++pub const O_TRUNC: u32 = 0o1000; ++ ++pub const O_APPEND: u32 = 0o2000; ++ ++pub const O_NONBLOCK: u32 = 0o4000; ++ ++pub const O_DSYNC: u32 = 0o10000; ++ ++pub const O_SYNC: u32 = 0o4010000; ++ ++pub const O_RSYNC: u32 = 0o4010000; ++ ++pub const O_DIRECTORY: u32 = 0o200000; ++ ++pub const O_NOFOLLOW: u32 = 0o400000; ++ ++pub const O_CLOEXEC: u32 = 0o2000000; ++ ++pub const O_ASYNC: u32 = 0o20000; ++ ++pub const O_DIRECT: u32 = 0o40000; ++ ++pub const O_LARGEFILE: u32 = 0o100000; ++ ++pub const O_NOATIME: u32 = 0o1000000; ++ ++pub const O_PATH: u32 = 0o10000000; ++ ++pub const O_TMPFILE: u32 = 0o20200000; ++ ++pub const O_NDELAY: u32 = O_NONBLOCK; ++ ++pub const F_DUPFD: u32 = 0; ++ ++pub const F_GETFD: u32 = 1; ++ ++pub const F_SETFD: u32 = 2; ++ ++pub const F_GETFL: u32 = 3; ++ ++pub const F_SETFL: u32 = 4; ++ ++pub const F_SETOWN: u32 = 8; ++ ++pub const F_GETOWN: u32 = 9; ++ ++pub const F_SETSIG: u32 = 10; ++ ++pub const F_GETSIG: u32 = 11; ++ ++pub const F_GETLK: u32 = 12; ++ ++pub const F_SETLK: u32 = 13; ++ ++pub const F_SETLKW: u32 = 14; ++ ++pub const F_SETOWN_EX: u32 = 15; ++ ++pub const F_GETOWN_EX: u32 = 16; ++ ++pub const F_GETOWNER_UIDS: u32 = 17; ++ ++// mman ++pub const MAP_FAILED: u64 = 0xffffffffffffffff; ++ ++pub const MAP_FIXED_NOREPLACE: u32 = 0x100000; ++ ++pub const MAP_SHARED_VALIDATE: u32 = 0x03; ++ ++pub const MAP_SHARED: u32 = 0x01; ++ ++pub const MAP_PRIVATE: u32 = 0x02; ++ ++pub const MAP_TYPE: u32 = 0x0f; ++ ++pub const MAP_FIXED: u32 = 0x10; ++ ++pub const MAP_ANON: u32 = 0x20; ++ ++pub const MAP_ANONYMOUS: u32 = MAP_ANON; ++ ++pub const MAP_NORESERVE: u32 = 0x4000; ++ ++pub const MAP_GROWSDOWN: u32 = 0x0100; ++ ++pub const MAP_DENYWRITE: u32 = 0x0800; ++ ++pub const MAP_EXECUTABLE: u32 = 0x1000; ++ ++pub const MAP_LOCKED: u32 = 0x2000; ++ ++pub const MAP_POPULATE: u32 = 0x8000; ++ ++pub const MAP_NONBLOCK: u32 = 0x10000; ++ ++pub const MAP_STACK: u32 = 0x20000; ++ ++pub const MAP_HUGETLB: u32 = 0x40000; ++ ++pub const MAP_SYNC: u32 = 0x80000; ++ ++pub const MAP_FILE: u32 = 0; ++ ++pub const MAP_HUGE_SHIFT: u32 = 26; ++ ++pub const MAP_HUGE_MASK: u32 = 0x3f; ++ ++pub const MAP_HUGE_16KB: u32 = 14 << 26; ++ ++pub const MAP_HUGE_64KB: u32 = 16 << 26; ++ ++pub const MAP_HUGE_512KB: u32 = 19 << 26; ++ ++pub const MAP_HUGE_1MB: u32 = 20 << 26; ++ ++pub const MAP_HUGE_2MB: u32 = 21 << 26; ++ ++pub const MAP_HUGE_8MB: u32 = 23 << 26; ++ ++pub const MAP_HUGE_16MB: u32 = 24 << 26; ++ ++pub const MAP_HUGE_32MB: u32 = 25 << 26; ++ ++pub const MAP_HUGE_256MB: u32 = 28 << 26; ++ ++pub const MAP_HUGE_512MB: u32 = 29 << 26; ++ ++pub const MAP_HUGE_1GB: u32 = 30 << 26; ++ ++pub const MAP_HUGE_2GB: u32 = 31 << 26; ++ ++pub const MAP_HUGE_16GB: u32 = 34u32 << 26; ++ ++pub const PROT_NONE: u32 = 0; ++ ++pub const PROT_READ: u32 = 1; ++ ++pub const PROT_WRITE: u32 = 2; ++ ++pub const PROT_EXEC: u32 = 4; ++ ++pub const PROT_GROWSDOWN: u32 = 0x01000000; ++ ++pub const PROT_GROWSUP: u32 = 0x02000000; ++ ++pub const MS_ASYNC: u32 = 1; ++ ++pub const MS_INVALIDATE: u32 = 2; ++ ++pub const MS_SYNC: u32 = 4; ++ ++pub const MCL_CURRENT: u32 = 1; ++ ++pub const MCL_FUTURE: u32 = 2; ++ ++pub const MCL_ONFAULT: u32 = 4; ++ ++pub const POSIX_MADV_NORMAL: u32 = 0; ++ ++pub const POSIX_MADV_RANDOM: u32 = 1; ++ ++pub const POSIX_MADV_SEQUENTIAL: u32 = 2; ++ ++pub const POSIX_MADV_WILLNEED: u32 = 3; ++ ++pub const POSIX_MADV_DONTNEED: u32 = 4; ++ ++// wctype ++pub const WCTYPE_ALNUM: u64 = 1; ++ ++pub const WCTYPE_ALPHA: u64 = 2; ++ ++pub const WCTYPE_BLANK: u64 = 3; ++ ++pub const WCTYPE_CNTRL: u64 = 4; ++ ++pub const WCTYPE_DIGIT: u64 = 5; ++ ++pub const WCTYPE_GRAPH: u64 = 6; ++ ++pub const WCTYPE_LOWER: u64 = 7; ++ ++pub const WCTYPE_PRINT: u64 = 8; ++ ++pub const WCTYPE_PUNCT: u64 = 9; ++ ++pub const WCTYPE_SPACE: u64 = 10; ++ ++pub const WCTYPE_UPPER: u64 = 11; ++ ++pub const WCTYPE_XDIGIT: u64 = 12; ++ ++// locale ++pub const LC_CTYPE: i32 = 0; ++ ++pub const LC_NUMERIC: i32 = 1; ++ ++pub const LC_TIME: i32 = 2; ++ ++pub const LC_COLLATE: i32 = 3; ++ ++pub const LC_MONETARY: i32 = 4; ++ ++pub const LC_MESSAGES: i32 = 5; ++ ++pub const LC_ALL: i32 = 6; ++ ++// pthread ++pub const __SIZEOF_PTHREAD_COND_T: usize = 48; ++ ++pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; ++ ++pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; ++ ++pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; ++ ++// errno.h ++pub const EPERM: c_int = 1; ++ ++pub const ENOENT: c_int = 2; ++ ++pub const ESRCH: c_int = 3; ++ ++pub const EINTR: c_int = 4; ++ ++pub const EIO: c_int = 5; ++ ++pub const ENXIO: c_int = 6; ++ ++pub const E2BIG: c_int = 7; ++ ++pub const ENOEXEC: c_int = 8; ++ ++pub const EBADF: c_int = 9; ++ ++pub const ECHILD: c_int = 10; ++ ++pub const EAGAIN: c_int = 11; ++ ++pub const ENOMEM: c_int = 12; ++ ++pub const EACCES: c_int = 13; ++ ++pub const EFAULT: c_int = 14; ++ ++pub const ENOTBLK: c_int = 15; ++ ++pub const EBUSY: c_int = 16; ++ ++pub const EEXIST: c_int = 17; ++ ++pub const EXDEV: c_int = 18; ++ ++pub const ENODEV: c_int = 19; ++ ++pub const ENOTDIR: c_int = 20; ++ ++pub const EISDIR: c_int = 21; ++ ++pub const EINVAL: c_int = 22; ++ ++pub const ENFILE: c_int = 23; ++ ++pub const EMFILE: c_int = 24; ++ ++pub const ENOTTY: c_int = 25; ++ ++pub const ETXTBSY: c_int = 26; ++ ++pub const EFBIG: c_int = 27; ++ ++pub const ENOSPC: c_int = 28; ++ ++pub const ESPIPE: c_int = 29; ++ ++pub const EROFS: c_int = 30; ++ ++pub const EMLINK: c_int = 31; ++ ++pub const EPIPE: c_int = 32; ++ ++pub const EDOM: c_int = 33; ++ ++pub const ERANGE: c_int = 34; ++ ++pub const EDEADLK: c_int = 35; ++ ++pub const ENAMETOOLONG: c_int = 36; ++ ++pub const ENOLCK: c_int = 37; ++ ++pub const ENOSYS: c_int = 38; ++ ++pub const ENOTEMPTY: c_int = 39; ++ ++pub const ELOOP: c_int = 40; ++ ++pub const EWOULDBLOCK: c_int = EAGAIN; ++ ++pub const ENOMSG: c_int = 42; ++ ++pub const EIDRM: c_int = 43; ++ ++pub const ECHRNG: c_int = 44; ++ ++pub const EL2NSYNC: c_int = 45; ++ ++pub const EL3HLT: c_int = 46; ++ ++pub const EL3RST: c_int = 47; ++ ++pub const ELNRNG: c_int = 48; ++ ++pub const EUNATCH: c_int = 49; ++ ++pub const ENOCSI: c_int = 50; ++ ++pub const EL2HLT: c_int = 51; ++ ++pub const EBADE: c_int = 52; ++ ++pub const EBADR: c_int = 53; ++ ++pub const EXFULL: c_int = 54; ++ ++pub const ENOANO: c_int = 55; ++ ++pub const EBADRQC: c_int = 56; ++ ++pub const EBADSLT: c_int = 57; ++ ++pub const EDEADLOCK: c_int = EDEADLK; ++ ++pub const EBFONT: c_int = 59; ++ ++pub const ENOSTR: c_int = 60; ++ ++pub const ENODATA: c_int = 61; ++ ++pub const ETIME: c_int = 62; ++ ++pub const ENOSR: c_int = 63; ++ ++pub const ENONET: c_int = 64; ++ ++pub const ENOPKG: c_int = 65; ++ ++pub const EREMOTE: c_int = 66; ++ ++pub const ENOLINK: c_int = 67; ++ ++pub const EADV: c_int = 68; ++ ++pub const ESRMNT: c_int = 69; ++ ++pub const ECOMM: c_int = 70; ++ ++pub const EPROTO: c_int = 71; ++ ++pub const EMULTIHOP: c_int = 72; ++ ++pub const EDOTDOT: c_int = 73; ++ ++pub const EBADMSG: c_int = 74; ++ ++pub const EOVERFLOW: c_int = 75; ++ ++pub const ENOTUNIQ: c_int = 76; ++ ++pub const EBADFD: c_int = 77; ++ ++pub const EREMCHG: c_int = 78; ++ ++pub const ELIBACC: c_int = 79; ++ ++pub const ELIBBAD: c_int = 80; ++ ++pub const ELIBSCN: c_int = 81; ++ ++pub const ELIBMAX: c_int = 82; ++ ++pub const ELIBEXEC: c_int = 83; ++ ++pub const EILSEQ: c_int = 84; ++ ++pub const ERESTART: c_int = 85; ++ ++pub const ESTRPIPE: c_int = 86; ++ ++pub const EUSERS: c_int = 87; ++ ++pub const ENOTSOCK: c_int = 88; ++ ++pub const EDESTADDRREQ: c_int = 89; ++ ++pub const EMSGSIZE: c_int = 90; ++ ++pub const EPROTOTYPE: c_int = 91; ++ ++pub const ENOPROTOOPT: c_int = 92; ++ ++pub const EPROTONOSUPPOR: c_int = 93; ++ ++pub const ESOCKTNOSUPPOR: 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 EADDRINUSE: c_int = 98; ++ ++pub const EADDRNOTAVAIL: c_int = 99; ++ ++pub const ENETDOWN: c_int = 100; ++ ++pub const ENETUNREACH: c_int = 101; ++ ++pub const ENETRESET: c_int = 102; ++ ++pub const ECONNABORTED: c_int = 103; ++ ++pub const ECONNRESET: c_int = 104; ++ ++pub const ENOBUFS: c_int = 105; ++ ++pub const EISCONN: c_int = 106; ++ ++pub const ENOTCONN: c_int = 107; ++ ++pub const ESHUTDOWN: c_int = 108; ++ ++pub const ETOOMANYREFS: c_int = 109; ++ ++pub const ETIMEDOUT: c_int = 110; ++ ++pub const ECONNREFUSED: c_int = 111; ++ ++pub const EHOSTDOWN: c_int = 112; ++ ++pub const EHOSTUNREACH: c_int = 113; ++ ++pub const EALREADY: c_int = 114; ++ ++pub const EINPROGRESS: c_int = 115; ++ ++pub const ESTALE: c_int = 116; ++ ++pub const EUCLEAN: c_int = 117; ++ ++pub const ENOTNAM: c_int = 118; ++ ++pub const ENAVAIL: c_int = 119; ++ ++pub const EISNAM: c_int = 120; ++ ++pub const EREMOTEIO: c_int = 121; ++ ++pub const EDQUOT: c_int = 122; ++ ++pub const ENOMEDIUM: c_int = 123; ++ ++pub const EMEDIUMTYPE: c_int = 124; ++ ++pub const ECANCELED: c_int = 125; ++ ++pub const ENOKEY: c_int = 126; ++ ++pub const EKEYEXPIRED: c_int = 127; ++ ++pub const EKEYREVOKED: c_int = 128; ++ ++pub const EKEYREJECTED: c_int = 129; ++ ++pub const EOWNERDEAD: c_int = 130; ++ ++pub const ENOTRECOVERABLE: c_int = 131; ++ ++pub const ERFKILL: c_int = 132; ++ ++pub const EHWPOISON: c_int = 133; ++ ++// pthread_attr.h ++pub const TEESMP_THREAD_ATTR_CA_WILDCARD: c_int = 0; ++ ++pub const TEESMP_THREAD_ATTR_CA_INHERIT: c_int = -1; ++ ++pub const TEESMP_THREAD_ATTR_TASK_ID_INHERIT: c_int = -1; ++ ++pub const TEESMP_THREAD_ATTR_HAS_SHADOW: c_int = 0x1; ++ ++pub const TEESMP_THREAD_ATTR_NO_SHADOW: c_int = 0x0; ++ ++// unistd.h ++pub const _SC_ARG_MAX: c_int = 0; ++ ++pub const _SC_CHILD_MAX: c_int = 1; ++ ++pub const _SC_CLK_TCK: c_int = 2; ++ ++pub const _SC_NGROUPS_MAX: c_int = 3; ++ ++pub const _SC_OPEN_MAX: c_int = 4; ++ ++pub const _SC_STREAM_MAX: c_int = 5; ++ ++pub const _SC_TZNAME_MAX: c_int = 6; ++ ++pub const _SC_JOB_CONTROL: c_int = 7; ++ ++pub const _SC_SAVED_IDS: c_int = 8; ++ ++pub const _SC_REALTIME_SIGNALS: c_int = 9; ++ ++pub const _SC_PRIORITY_SCHEDULING: c_int = 10; ++ ++pub const _SC_TIMERS: c_int = 11; ++ ++pub const _SC_ASYNCHRONOUS_IO: c_int = 12; ++ ++pub const _SC_PRIORITIZED_IO: c_int = 13; ++ ++pub const _SC_SYNCHRONIZED_IO: c_int = 14; ++ ++pub const _SC_FSYNC: c_int = 15; ++ ++pub const _SC_MAPPED_FILES: c_int = 16; ++ ++pub const _SC_MEMLOCK: c_int = 17; ++ ++pub const _SC_MEMLOCK_RANGE: c_int = 18; ++ ++pub const _SC_MEMORY_PROTECTION: c_int = 19; ++ ++pub const _SC_MESSAGE_PASSING: c_int = 20; ++ ++pub const _SC_SEMAPHORES: c_int = 21; ++ ++pub const _SC_SHARED_MEMORY_OBJECTS: c_int = 22; ++ ++pub const _SC_AIO_LISTIO_MAX: c_int = 23; ++ ++pub const _SC_AIO_MAX: c_int = 24; ++ ++pub const _SC_AIO_PRIO_DELTA_MAX: c_int = 25; ++ ++pub const _SC_DELAYTIMER_MAX: c_int = 26; ++ ++pub const _SC_MQ_OPEN_MAX: c_int = 27; ++ ++pub const _SC_MQ_PRIO_MAX: c_int = 28; ++ ++pub const _SC_VERSION: c_int = 29; ++ ++pub const _SC_PAGE_SIZE: c_int = 30; ++ ++pub const _SC_PAGESIZE: c_int = 30; /* !! */ ++ ++pub const _SC_RTSIG_MAX: c_int = 31; ++ ++pub const _SC_SEM_NSEMS_MAX: c_int = 32; ++ ++pub const _SC_SEM_VALUE_MAX: c_int = 33; ++ ++pub const _SC_SIGQUEUE_MAX: c_int = 34; ++ ++pub const _SC_TIMER_MAX: c_int = 35; ++ ++pub const _SC_BC_BASE_MAX: c_int = 36; ++ ++pub const _SC_BC_DIM_MAX: c_int = 37; ++ ++pub const _SC_BC_SCALE_MAX: c_int = 38; ++ ++pub const _SC_BC_STRING_MAX: c_int = 39; ++ ++pub const _SC_COLL_WEIGHTS_MAX: c_int = 40; ++ ++pub const _SC_EXPR_NEST_MAX: c_int = 42; ++ ++pub const _SC_LINE_MAX: c_int = 43; ++ ++pub const _SC_RE_DUP_MAX: c_int = 44; ++ ++pub const _SC_2_VERSION: c_int = 46; ++ ++pub const _SC_2_C_BIND: c_int = 47; ++ ++pub const _SC_2_C_DEV: c_int = 48; ++ ++pub const _SC_2_FORT_DEV: c_int = 49; ++ ++pub const _SC_2_FORT_RUN: c_int = 50; ++ ++pub const _SC_2_SW_DEV: c_int = 51; ++ ++pub const _SC_2_LOCALEDEF: c_int = 52; ++ ++pub const _SC_UIO_MAXIOV: c_int = 60; /* !! */ ++ ++pub const _SC_IOV_MAX: c_int = 60; ++ ++pub const _SC_THREADS: c_int = 67; ++ ++pub const _SC_THREAD_SAFE_FUNCTIONS: c_int = 68; ++ ++pub const _SC_GETGR_R_SIZE_MAX: c_int = 69; ++ ++pub const _SC_GETPW_R_SIZE_MAX: c_int = 70; ++ ++pub const _SC_LOGIN_NAME_MAX: c_int = 71; ++ ++pub const _SC_TTY_NAME_MAX: c_int = 72; ++ ++pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: c_int = 73; ++ ++pub const _SC_THREAD_KEYS_MAX: c_int = 74; ++ ++pub const _SC_THREAD_STACK_MIN: c_int = 75; ++ ++pub const _SC_THREAD_THREADS_MAX: c_int = 76; ++ ++pub const _SC_THREAD_ATTR_STACKADDR: c_int = 77; ++ ++pub const _SC_THREAD_ATTR_STACKSIZE: c_int = 78; ++ ++pub const _SC_THREAD_PRIORITY_SCHEDULING: c_int = 79; ++ ++pub const _SC_THREAD_PRIO_INHERIT: c_int = 80; ++ ++pub const _SC_THREAD_PRIO_PROTECT: c_int = 81; ++ ++pub const _SC_THREAD_PROCESS_SHARED: c_int = 82; ++ ++pub const _SC_NPROCESSORS_CONF: c_int = 83; ++ ++pub const _SC_NPROCESSORS_ONLN: c_int = 84; ++ ++pub const _SC_PHYS_PAGES: c_int = 85; ++ ++pub const _SC_AVPHYS_PAGES: c_int = 86; ++ ++pub const _SC_ATEXIT_MAX: c_int = 87; ++ ++pub const _SC_PASS_MAX: c_int = 88; ++ ++pub const _SC_XOPEN_VERSION: c_int = 89; ++ ++pub const _SC_XOPEN_XCU_VERSION: c_int = 90; ++ ++pub const _SC_XOPEN_UNIX: c_int = 91; ++ ++pub const _SC_XOPEN_CRYPT: c_int = 92; ++ ++pub const _SC_XOPEN_ENH_I18N: c_int = 93; ++ ++pub const _SC_XOPEN_SHM: c_int = 94; ++ ++pub const _SC_2_CHAR_TERM: c_int = 95; ++ ++pub const _SC_2_UPE: c_int = 97; ++ ++pub const _SC_XOPEN_XPG2: c_int = 98; ++ ++pub const _SC_XOPEN_XPG3: c_int = 99; ++ ++pub const _SC_XOPEN_XPG4: c_int = 100; ++ ++pub const _SC_NZERO: c_int = 109; ++ ++pub const _SC_XBS5_ILP32_OFF32: c_int = 125; ++ ++pub const _SC_XBS5_ILP32_OFFBIG: c_int = 126; ++ ++pub const _SC_XBS5_LP64_OFF64: c_int = 127; ++ ++pub const _SC_XBS5_LPBIG_OFFBIG: c_int = 128; ++ ++pub const _SC_XOPEN_LEGACY: c_int = 129; ++ ++pub const _SC_XOPEN_REALTIME: c_int = 130; ++ ++pub const _SC_XOPEN_REALTIME_THREADS: c_int = 131; ++ ++pub const _SC_ADVISORY_INFO: c_int = 132; ++ ++pub const _SC_BARRIERS: c_int = 133; ++ ++pub const _SC_CLOCK_SELECTION: c_int = 137; ++ ++pub const _SC_CPUTIME: c_int = 138; ++ ++pub const _SC_THREAD_CPUTIME: c_int = 139; ++ ++pub const _SC_MONOTONIC_CLOCK: c_int = 149; ++ ++pub const _SC_READER_WRITER_LOCKS: c_int = 153; ++ ++pub const _SC_SPIN_LOCKS: c_int = 154; ++ ++pub const _SC_REGEXP: c_int = 155; ++ ++pub const _SC_SHELL: c_int = 157; ++ ++pub const _SC_SPAWN: c_int = 159; ++ ++pub const _SC_SPORADIC_SERVER: c_int = 160; ++ ++pub const _SC_THREAD_SPORADIC_SERVER: c_int = 161; ++ ++pub const _SC_TIMEOUTS: c_int = 164; ++ ++pub const _SC_TYPED_MEMORY_OBJECTS: c_int = 165; ++ ++pub const _SC_2_PBS: c_int = 168; ++ ++pub const _SC_2_PBS_ACCOUNTING: c_int = 169; ++ ++pub const _SC_2_PBS_LOCATE: c_int = 170; ++ ++pub const _SC_2_PBS_MESSAGE: c_int = 171; ++ ++pub const _SC_2_PBS_TRACK: c_int = 172; ++ ++pub const _SC_SYMLOOP_MAX: c_int = 173; ++ ++pub const _SC_STREAMS: c_int = 174; ++ ++pub const _SC_2_PBS_CHECKPOINT: c_int = 175; ++ ++pub const _SC_V6_ILP32_OFF32: c_int = 176; ++ ++pub const _SC_V6_ILP32_OFFBIG: c_int = 177; ++ ++pub const _SC_V6_LP64_OFF64: c_int = 178; ++ ++pub const _SC_V6_LPBIG_OFFBIG: c_int = 179; ++ ++pub const _SC_HOST_NAME_MAX: c_int = 180; ++ ++pub const _SC_TRACE: c_int = 181; ++ ++pub const _SC_TRACE_EVENT_FILTER: c_int = 182; ++ ++pub const _SC_TRACE_INHERIT: c_int = 183; ++ ++pub const _SC_TRACE_LOG: c_int = 184; ++ ++pub const _SC_IPV6: c_int = 235; ++ ++pub const _SC_RAW_SOCKETS: c_int = 236; ++ ++pub const _SC_V7_ILP32_OFF32: c_int = 237; ++ ++pub const _SC_V7_ILP32_OFFBIG: c_int = 238; ++ ++pub const _SC_V7_LP64_OFF64: c_int = 239; ++ ++pub const _SC_V7_LPBIG_OFFBIG: c_int = 240; ++ ++pub const _SC_SS_REPL_MAX: c_int = 241; ++ ++pub const _SC_TRACE_EVENT_NAME_MAX: c_int = 242; ++ ++pub const _SC_TRACE_NAME_MAX: c_int = 243; ++ ++pub const _SC_TRACE_SYS_MAX: c_int = 244; ++ ++pub const _SC_TRACE_USER_EVENT_MAX: c_int = 245; ++ ++pub const _SC_XOPEN_STREAMS: c_int = 246; ++ ++pub const _SC_THREAD_ROBUST_PRIO_INHERIT: c_int = 247; ++ ++pub const _SC_THREAD_ROBUST_PRIO_PROTECT: c_int = 248; ++ ++// limits.h ++pub const PTHREAD_KEYS_MAX: c_int = 128; ++ ++pub const PTHREAD_STACK_MIN: c_int = 2048; ++ ++pub const PTHREAD_DESTRUCTOR_ITERATIONS: c_int = 4; ++ ++pub const SEM_VALUE_MAX: c_int = 0x7fffffff; ++ ++pub const SEM_NSEMS_MAX: c_int = 256; ++ ++pub const DELAYTIMER_MAX: c_int = 0x7fffffff; ++ ++pub const MQ_PRIO_MAX: c_int = 32768; ++ ++pub const LOGIN_NAME_MAX: c_int = 256; ++ ++// time.h ++pub const CLOCK_REALTIME: clockid_t = 0; ++ ++pub const CLOCK_MONOTONIC: clockid_t = 1; ++ ++pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { ++ size: [0; __SIZEOF_PTHREAD_MUTEX_T], ++}; ++ ++pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { ++ size: [0; __SIZEOF_PTHREAD_COND_T], ++}; ++ ++pub const PTHREAD_MUTEX_NORMAL: c_int = 0; ++ ++pub const PTHREAD_MUTEX_RECURSIVE: c_int = 1; ++ ++pub const PTHREAD_MUTEX_ERRORCHECK: c_int = 2; ++ ++pub const PTHREAD_MUTEX_DEFAULT: c_int = PTHREAD_MUTEX_NORMAL; ++ ++pub const PTHREAD_MUTEX_STALLED: c_int = 0; ++ ++pub const PTHREAD_MUTEX_ROBUST: c_int = 1; ++ ++extern "C" { ++ // ---- ALLOC ----------------------------------------------------------------------------- ++ pub fn calloc(nobj: size_t, size: size_t) -> *mut c_void; ++ ++ pub fn malloc(size: size_t) -> *mut c_void; ++ ++ pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void; ++ ++ pub fn aligned_alloc(align: size_t, len: size_t) -> *mut c_void; ++ ++ pub fn free(p: *mut c_void); ++ ++ pub fn posix_memalign(memptr: *mut *mut c_void, align: size_t, size: size_t) -> c_int; ++ ++ pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void; ++ ++ pub fn wmemchr(cx: *const wchar_t, c: wchar_t, n: size_t) -> *mut wchar_t; ++ ++ pub fn memcmp(cx: *const c_void, ct: *const c_void, n: size_t) -> c_int; ++ ++ pub fn memcpy(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void; ++ ++ pub fn memmove(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void; ++ ++ pub fn memset(dest: *mut c_void, c: c_int, n: size_t) -> *mut c_void; ++ ++ // ----- PTHREAD --------------------------------------------------------------------------- ++ pub fn pthread_self() -> pthread_t; ++ ++ pub fn pthread_join(native: pthread_t, value: *mut *mut c_void) -> c_int; ++ ++ // detach or pthread_attr_setdetachstate must not be called! ++ //pub fn pthread_detach(thread: pthread_t) -> c_int; ++ ++ pub fn pthread_exit(value: *mut c_void) -> !; ++ ++ pub fn pthread_attr_init(attr: *mut pthread_attr_t) -> c_int; ++ ++ pub fn pthread_attr_destroy(attr: *mut pthread_attr_t) -> c_int; ++ ++ pub fn pthread_attr_getstack( ++ attr: *const pthread_attr_t, ++ stackaddr: *mut *mut c_void, ++ stacksize: *mut size_t, ++ ) -> c_int; ++ ++ pub fn pthread_attr_setstacksize(attr: *mut pthread_attr_t, stack_size: size_t) -> c_int; ++ ++ pub fn pthread_attr_getstacksize(attr: *const pthread_attr_t, size: *mut size_t) -> c_int; ++ ++ pub fn pthread_attr_settee( ++ attr: *mut pthread_attr_t, ++ ca: c_int, ++ task_id: c_int, ++ shadow: c_int, ++ ) -> c_int; ++ ++ // C-TA API do not include this interface, but TA can use. ++ pub fn sched_yield() -> c_int; ++ ++ pub fn pthread_key_create( ++ key: *mut pthread_key_t, ++ dtor: Option, ++ ) -> c_int; ++ ++ pub fn pthread_key_delete(key: pthread_key_t) -> c_int; ++ ++ pub fn pthread_getspecific(key: pthread_key_t) -> *mut c_void; ++ ++ pub fn pthread_setspecific(key: pthread_key_t, value: *const c_void) -> c_int; ++ ++ pub fn pthread_mutex_destroy(lock: *mut pthread_mutex_t) -> c_int; ++ ++ pub fn pthread_mutex_init( ++ lock: *mut pthread_mutex_t, ++ attr: *const pthread_mutexattr_t, ++ ) -> c_int; ++ ++ pub fn pthread_mutex_lock(lock: *mut pthread_mutex_t) -> c_int; ++ ++ pub fn pthread_mutex_trylock(lock: *mut pthread_mutex_t) -> c_int; ++ ++ pub fn pthread_mutex_unlock(lock: *mut pthread_mutex_t) -> c_int; ++ ++ pub fn pthread_mutexattr_destroy(attr: *mut pthread_mutexattr_t) -> c_int; ++ ++ pub fn pthread_mutexattr_init(attr: *mut pthread_mutexattr_t) -> c_int; ++ ++ pub fn pthread_mutexattr_settype(attr: *mut pthread_mutexattr_t, _type: c_int) -> c_int; ++ ++ pub fn pthread_mutexattr_setpshared(attr: *mut pthread_mutexattr_t, pshared: c_int) -> c_int; ++ ++ pub fn pthread_cond_broadcast(cond: *mut pthread_cond_t) -> c_int; ++ ++ pub fn pthread_cond_destroy(cond: *mut pthread_cond_t) -> c_int; ++ ++ pub fn pthread_cond_init(cond: *mut pthread_cond_t, attr: *const pthread_condattr_t) -> c_int; ++ ++ pub fn pthread_cond_signal(cond: *mut pthread_cond_t) -> c_int; ++ ++ pub fn pthread_cond_wait(cond: *mut pthread_cond_t, lock: *mut pthread_mutex_t) -> c_int; ++ ++ pub fn pthread_cond_timedwait( ++ cond: *mut pthread_cond_t, ++ lock: *mut pthread_mutex_t, ++ abstime: *const timespec, ++ ) -> c_int; ++ ++ pub fn pthread_mutexattr_setrobust(attr: *mut pthread_mutexattr_t, robustness: c_int) -> c_int; ++ ++ pub fn pthread_create( ++ native: *mut pthread_t, ++ attr: *const pthread_attr_t, ++ f: extern "C" fn(*mut c_void) -> *mut c_void, ++ value: *mut c_void, ++ ) -> c_int; ++ ++ pub fn pthread_spin_init(lock: *mut pthread_spinlock_t, pshared: c_int) -> c_int; ++ ++ pub fn pthread_spin_destroy(lock: *mut pthread_spinlock_t) -> c_int; ++ ++ pub fn pthread_spin_lock(lock: *mut pthread_spinlock_t) -> c_int; ++ ++ pub fn pthread_spin_trylock(lock: *mut pthread_spinlock_t) -> c_int; ++ ++ pub fn pthread_spin_unlock(lock: *mut pthread_spinlock_t) -> c_int; ++ ++ pub fn pthread_setschedprio(native: pthread_t, priority: c_int) -> c_int; ++ ++ pub fn pthread_once(pot: *mut pthread_once_t, f: Option) -> c_int; ++ ++ pub fn pthread_equal(p1: pthread_t, p2: pthread_t) -> c_int; ++ ++ pub fn pthread_mutexattr_setprotocol(a: *mut pthread_mutexattr_t, protocol: c_int) -> c_int; ++ ++ pub fn pthread_attr_setstack( ++ attr: *mut pthread_attr_t, ++ stack: *mut c_void, ++ size: size_t, ++ ) -> c_int; ++ ++ pub fn pthread_setaffinity_np(td: pthread_t, size: size_t, set: *const cpu_set_t) -> c_int; ++ ++ pub fn pthread_getaffinity_np(td: pthread_t, size: size_t, set: *mut cpu_set_t) -> c_int; ++ ++ // stdio.h ++ pub fn printf(fmt: *const c_char, ...) -> c_int; ++ ++ pub fn scanf(fmt: *const c_char, ...) -> c_int; ++ ++ pub fn snprintf(s: *mut c_char, n: size_t, fmt: *const c_char, ...) -> c_int; ++ ++ pub fn sprintf(s: *mut c_char, fmt: *const c_char, ...) -> c_int; ++ ++ pub fn vsnprintf(s: *mut c_char, n: size_t, fmt: *const c_char, ap: va_list) -> c_int; ++ ++ pub fn vsprintf(s: *mut c_char, fmt: *const c_char, ap: va_list) -> c_int; ++ ++ // Not available. ++ //pub fn pthread_setname_np(thread: pthread_t, name: *const c_char) -> c_int; ++ ++ pub fn abort() -> !; ++ ++ // Not available. ++ //pub fn prctl(op: c_int, ...) -> c_int; ++ ++ pub fn sched_getaffinity(pid: pid_t, cpusetsize: size_t, cpuset: *mut cpu_set_t) -> c_int; ++ ++ pub fn sched_setaffinity(pid: pid_t, cpusetsize: size_t, cpuset: *const cpu_set_t) -> c_int; ++ ++ // sysconf is currently only implemented as a stub. ++ pub fn sysconf(name: c_int) -> c_long; ++ ++ // mman.h ++ pub fn mmap( ++ addr: *mut c_void, ++ len: size_t, ++ prot: c_int, ++ flags: c_int, ++ fd: c_int, ++ offset: off_t, ++ ) -> *mut c_void; ++ pub fn munmap(addr: *mut c_void, len: size_t) -> c_int; ++ ++ // errno.h ++ pub fn __errno_location() -> *mut c_int; ++ ++ pub fn strerror(e: c_int) -> *mut c_char; ++ ++ // time.h ++ pub fn clock_gettime(clock_id: clockid_t, tp: *mut timespec) -> c_int; ++ ++ // unistd ++ pub fn getpid() -> pid_t; ++ ++ // time ++ pub fn gettimeofday(tv: *mut timeval, tz: *mut c_void) -> c_int; ++ ++ pub fn strftime( ++ restrict: *mut c_char, ++ sz: size_t, ++ _restrict: *const c_char, ++ __restrict: *const tm, ++ ) -> size_t; ++ ++ pub fn time(t: *mut time_t) -> time_t; ++ ++ // sem ++ pub fn sem_close(sem: *mut sem_t) -> c_int; ++ ++ pub fn sem_destroy(sem: *mut sem_t) -> c_int; ++ ++ pub fn sem_getvalue(sem: *mut sem_t, valp: *mut c_int) -> c_int; ++ ++ pub fn sem_init(sem: *mut sem_t, pshared: c_int, value: c_uint) -> c_int; ++ ++ pub fn sem_open(name: *const c_char, flags: c_int, ...) -> *mut sem_t; ++ ++ pub fn sem_post(sem: *mut sem_t) -> c_int; ++ ++ pub fn sem_unlink(name: *const c_char) -> c_int; ++ ++ pub fn sem_wait(sem: *mut sem_t) -> c_int; ++ ++ // locale ++ pub fn setlocale(cat: c_int, name: *const c_char) -> *mut c_char; ++ ++ pub fn strcoll(l: *const c_char, r: *const c_char) -> c_int; ++ ++ pub fn strxfrm(dest: *mut c_char, src: *const c_char, n: size_t) -> size_t; ++ ++ pub fn strtod(s: *const c_char, p: *mut *mut c_char) -> c_double; ++ ++ // multibyte ++ pub fn mbrtowc(wc: *mut wchar_t, src: *const c_char, n: size_t, st: *mut mbstate_t) -> size_t; ++ ++ pub fn wcrtomb(s: *mut c_char, wc: wchar_t, st: *mut mbstate_t) -> size_t; ++ ++ pub fn wctob(c: wint_t) -> c_int; ++ ++ // prng ++ pub fn srandom(seed: c_uint); ++ ++ pub fn initstate(seed: c_uint, state: *mut c_char, size: size_t) -> *mut c_char; ++ ++ pub fn setstate(state: *mut c_char) -> *mut c_char; ++ ++ pub fn random() -> c_long; ++ ++ // string ++ pub fn strchr(s: *const c_char, c: c_int) -> *mut c_char; ++ ++ pub fn strlen(cs: *const c_char) -> size_t; ++ ++ pub fn strcmp(l: *const c_char, r: *const c_char) -> c_int; ++ ++ pub fn strcpy(dest: *mut c_char, src: *const c_char) -> *mut c_char; ++ ++ pub fn strncmp(_l: *const c_char, r: *const c_char, n: size_t) -> c_int; ++ ++ pub fn strncpy(dest: *mut c_char, src: *const c_char, n: size_t) -> *mut c_char; ++ ++ pub fn strnlen(cs: *const c_char, n: size_t) -> size_t; ++ ++ pub fn strrchr(s: *const c_char, c: c_int) -> *mut c_char; ++ ++ pub fn strstr(h: *const c_char, n: *const c_char) -> *mut c_char; ++ ++ pub fn wcschr(s: *const wchar_t, c: wchar_t) -> *mut wchar_t; ++ ++ pub fn wcslen(s: *const wchar_t) -> size_t; ++ ++ // ctype ++ pub fn isalpha(c: c_int) -> c_int; ++ ++ pub fn isascii(c: c_int) -> c_int; ++ ++ pub fn isdigit(c: c_int) -> c_int; ++ ++ pub fn islower(c: c_int) -> c_int; ++ ++ pub fn isprint(c: c_int) -> c_int; ++ ++ pub fn isspace(c: c_int) -> c_int; ++ ++ pub fn iswctype(wc: wint_t, ttype: wctype_t) -> c_int; ++ ++ pub fn iswdigit(wc: wint_t) -> c_int; ++ ++ pub fn iswlower(wc: wint_t) -> c_int; ++ ++ pub fn iswspace(wc: wint_t) -> c_int; ++ ++ pub fn iswupper(wc: wint_t) -> c_int; ++ ++ pub fn towupper(wc: wint_t) -> wint_t; ++ ++ pub fn towlower(wc: wint_t) -> wint_t; ++ ++ // cmath ++ pub fn atan(x: c_double) -> c_double; ++ ++ pub fn ceil(x: c_double) -> c_double; ++ ++ pub fn ceilf(x: c_float) -> c_float; ++ ++ pub fn exp(x: c_double) -> c_double; ++ ++ pub fn fabs(x: c_double) -> c_double; ++ ++ pub fn floor(x: c_double) -> c_double; ++ ++ pub fn frexp(x: c_double, e: *mut c_int) -> c_double; ++ ++ pub fn log(x: c_double) -> c_double; ++ ++ pub fn log2(x: c_double) -> c_double; ++ ++ pub fn pow(x: c_double, y: c_double) -> c_double; ++ ++ pub fn roundf(x: c_float) -> c_float; ++ ++ pub fn scalbn(x: c_double, n: c_int) -> c_double; ++ ++ pub fn sqrt(x: c_double) -> c_double; ++ ++ // stdlib ++ pub fn abs(x: c_int) -> c_int; ++ ++ pub fn atof(s: *const c_char) -> c_double; ++ ++ pub fn atoi(s: *const c_char) -> c_int; ++ ++ pub fn atol(s: *const c_char) -> c_long; ++ ++ pub fn atoll(s: *const c_char) -> c_longlong; ++ ++ pub fn bsearch( ++ key: *const c_void, ++ base: *const c_void, ++ nel: size_t, ++ width: size_t, ++ cmp: cmpfunc, ++ ) -> *mut c_void; ++ ++ pub fn div(num: c_int, den: c_int) -> div_t; ++ ++ pub fn ecvt(x: c_double, n: c_int, dp: *mut c_int, sign: *mut c_int) -> *mut c_char; ++ ++ pub fn imaxabs(a: intmax_t) -> intmax_t; ++ ++ pub fn llabs(a: c_longlong) -> c_longlong; ++ ++ pub fn qsort(base: *mut c_void, nel: size_t, width: size_t, cmp: cmpfunc); ++ ++ pub fn strtoul(s: *const c_char, p: *mut *mut c_char, base: c_int) -> c_ulong; ++ ++ pub fn strtol(s: *const c_char, p: *mut *mut c_char, base: c_int) -> c_long; ++ ++ pub fn wcstod(s: *const wchar_t, p: *mut *mut wchar_t) -> c_double; ++} ++ ++pub fn errno() -> c_int { ++ unsafe { *__errno_location() } ++} ++ ++pub fn CPU_COUNT_S(size: usize, cpuset: &cpu_set_t) -> c_int { ++ let mut s: u32 = 0; ++ let size_of_mask = core::mem::size_of_val(&cpuset.bits[0]); ++ ++ for i in cpuset.bits[..(size / size_of_mask)].iter() { ++ s += i.count_ones(); ++ } ++ s as c_int ++} ++ ++pub fn CPU_COUNT(cpuset: &cpu_set_t) -> c_int { ++ CPU_COUNT_S(core::mem::size_of::(), cpuset) ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/trusty.rs mesa-25.3.3/subprojects/libc-0.2.169/src/trusty.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/trusty.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/trusty.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,96 @@ ++pub use crate::arch::c_char_def as c_char; ++use crate::prelude::*; ++pub type size_t = usize; ++pub type ssize_t = isize; ++ ++pub type off_t = i64; ++ ++pub type c_schar = i8; ++pub type c_uchar = u8; ++pub type c_short = i16; ++pub type c_ushort = u16; ++pub type c_int = i32; ++pub type c_uint = u32; ++ ++cfg_if! { ++ if #[cfg(target_pointer_width = "32")] { ++ pub type c_long = i32; ++ pub type c_ulong = u32; ++ } else if #[cfg(target_pointer_width = "64")] { ++ pub type c_long = i64; ++ pub type c_ulong = u64; ++ } ++} ++ ++pub type c_longlong = i64; ++pub type c_ulonglong = u64; ++ ++pub type c_uint8_t = u8; ++pub type c_uint16_t = u16; ++pub type c_uint32_t = u32; ++pub type c_uint64_t = u64; ++ ++pub type c_int8_t = i8; ++pub type c_int16_t = i16; ++pub type c_int32_t = i32; ++pub type c_int64_t = i64; ++ ++pub type intptr_t = isize; ++pub type uintptr_t = usize; ++ ++pub type c_float = f32; ++pub type c_double = f64; ++ ++pub type time_t = c_long; ++ ++pub type clockid_t = c_int; ++ ++s! { ++ pub struct iovec { ++ pub iov_base: *mut c_void, ++ pub iov_len: size_t, ++ } ++ ++ pub struct timespec { ++ pub tv_sec: time_t, ++ pub tv_nsec: c_long, ++ } ++} ++ ++pub const PROT_READ: i32 = 1; ++pub const PROT_WRITE: i32 = 2; ++ ++// Trusty only supports `CLOCK_BOOTTIME`. ++pub const CLOCK_BOOTTIME: clockid_t = 7; ++ ++pub const STDOUT_FILENO: c_int = 1; ++pub const STDERR_FILENO: c_int = 2; ++ ++pub const AT_PAGESZ: c_ulong = 6; ++ ++pub const MAP_FAILED: *mut c_void = !0 as *mut c_void; ++ ++extern "C" { ++ pub fn calloc(nobj: size_t, size: size_t) -> *mut c_void; ++ pub fn malloc(size: size_t) -> *mut c_void; ++ pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void; ++ pub fn free(p: *mut c_void); ++ pub fn memalign(align: size_t, size: size_t) -> *mut c_void; ++ pub fn posix_memalign(memptr: *mut *mut c_void, align: size_t, size: size_t) -> c_int; ++ pub fn write(fd: c_int, buf: *const c_void, count: size_t) -> ssize_t; ++ pub fn writev(fd: c_int, iov: *const crate::iovec, iovcnt: c_int) -> ssize_t; ++ pub fn close(fd: c_int) -> c_int; ++ pub fn strlen(cs: *const c_char) -> size_t; ++ pub fn getauxval(type_: c_ulong) -> c_ulong; ++ pub fn mmap( ++ addr: *mut c_void, ++ len: size_t, ++ prot: c_int, ++ flags: c_int, ++ fd: c_int, ++ offset: off_t, ++ ) -> *mut c_void; ++ pub fn munmap(addr: *mut c_void, len: size_t) -> c_int; ++ pub fn clock_gettime(clk_id: crate::clockid_t, tp: *mut crate::timespec) -> c_int; ++ pub fn nanosleep(rqtp: *const crate::timespec, rmtp: *mut crate::timespec) -> c_int; ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/aix/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/aix/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/aix/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/aix/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,3278 @@ ++use crate::prelude::*; ++ ++pub type c_char = u8; ++pub type caddr_t = *mut c_char; ++pub type clockid_t = c_longlong; ++pub type blkcnt_t = c_long; ++pub type clock_t = c_int; ++pub type daddr_t = c_long; ++pub type dev_t = c_ulong; ++pub type fpos64_t = c_longlong; ++pub type fsblkcnt_t = c_ulong; ++pub type fsfilcnt_t = c_ulong; ++pub type idtype_t = c_int; ++pub type ino_t = c_ulong; ++pub type key_t = c_int; ++pub type mode_t = c_uint; ++pub type nlink_t = c_short; ++pub type rlim_t = c_ulong; ++pub type speed_t = c_uint; ++pub type tcflag_t = c_uint; ++pub type time_t = c_long; ++pub type time64_t = crate::int64_t; ++pub type timer_t = c_long; ++pub type wchar_t = c_uint; ++pub type nfds_t = c_int; ++pub type projid_t = c_int; ++pub type id_t = c_uint; ++pub type blksize64_t = c_ulonglong; ++pub type blkcnt64_t = c_ulonglong; ++pub type sctp_assoc_t = crate::uint32_t; ++ ++pub type suseconds_t = c_int; ++pub type useconds_t = c_uint; ++pub type off_t = c_long; ++pub type off64_t = c_longlong; ++ ++pub type socklen_t = c_uint; ++pub type sa_family_t = c_uchar; ++pub type in_port_t = c_ushort; ++pub type in_addr_t = c_uint; ++ ++pub type signal_t = c_int; ++pub type pthread_t = c_uint; ++pub type pthread_key_t = c_uint; ++pub type thread_t = pthread_t; ++pub type blksize_t = c_long; ++pub type nl_item = c_int; ++pub type mqd_t = c_int; ++pub type shmatt_t = c_ulong; ++pub type regoff_t = c_long; ++pub type rlim64_t = c_ulonglong; ++ ++pub type sem_t = c_int; ++pub type pollset_t = c_int; ++ ++pub type pthread_rwlockattr_t = *mut c_void; ++pub type pthread_condattr_t = *mut c_void; ++pub type pthread_mutexattr_t = *mut c_void; ++pub type pthread_attr_t = *mut c_void; ++pub type pthread_barrierattr_t = *mut c_void; ++pub type posix_spawn_file_actions_t = *mut c_char; ++pub type iconv_t = *mut c_void; ++ ++e! { ++ #[repr(u32)] ++ pub enum uio_rw { ++ UIO_READ = 0, ++ UIO_WRITE, ++ UIO_READ_NO_MOVE, ++ UIO_WRITE_NO_MOVE, ++ UIO_PWRITE, ++ } ++} ++ ++s! { ++ pub struct fsid_t { ++ pub val: [c_uint; 2], ++ } ++ ++ pub struct fsid64_t { ++ pub val: [crate::uint64_t; 2], ++ } ++ ++ pub struct timezone { ++ pub tz_minuteswest: c_int, ++ pub tz_dsttime: c_int, ++ } ++ ++ pub struct ip_mreq { ++ pub imr_multiaddr: in_addr, ++ pub imr_interface: in_addr, ++ } ++ ++ pub struct dirent { ++ pub d_offset: c_ulong, ++ pub d_ino: crate::ino_t, ++ pub d_reclen: c_ushort, ++ pub d_namlen: c_ushort, ++ pub d_name: [c_char; 256], ++ } ++ ++ pub struct termios { ++ pub c_iflag: crate::tcflag_t, ++ pub c_oflag: crate::tcflag_t, ++ pub c_cflag: crate::tcflag_t, ++ pub c_lflag: crate::tcflag_t, ++ pub c_cc: [crate::cc_t; crate::NCCS], ++ } ++ ++ pub struct flock64 { ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ pub l_sysid: c_uint, ++ pub l_pid: crate::pid_t, ++ pub l_vfs: c_int, ++ pub l_start: off64_t, ++ pub l_len: off64_t, ++ } ++ ++ pub struct msghdr { ++ pub msg_name: *mut c_void, ++ pub msg_namelen: crate::socklen_t, ++ pub msg_iov: *mut crate::iovec, ++ pub msg_iovlen: c_int, ++ pub msg_control: *mut c_void, ++ pub msg_controllen: socklen_t, ++ pub msg_flags: c_int, ++ } ++ ++ pub struct statvfs64 { ++ pub f_bsize: crate::blksize64_t, ++ pub f_frsize: crate::blksize64_t, ++ pub f_blocks: crate::blkcnt64_t, ++ pub f_bfree: crate::blkcnt64_t, ++ pub f_bavail: crate::blkcnt64_t, ++ pub f_files: crate::blkcnt64_t, ++ pub f_ffree: crate::blkcnt64_t, ++ pub f_favail: crate::blkcnt64_t, ++ pub f_fsid: fsid64_t, ++ pub f_basetype: [c_char; 16], ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ pub f_fstr: [c_char; 32], ++ pub f_filler: [c_ulong; 16], ++ } ++ ++ pub struct lconv { ++ pub decimal_point: *mut c_char, ++ pub thousands_sep: *mut c_char, ++ pub grouping: *mut c_char, ++ pub int_curr_symbol: *mut c_char, ++ pub currency_symbol: *mut c_char, ++ pub mon_decimal_point: *mut c_char, ++ pub mon_thousands_sep: *mut c_char, ++ pub mon_grouping: *mut c_char, ++ pub positive_sign: *mut c_char, ++ pub negative_sign: *mut c_char, ++ pub int_frac_digits: c_char, ++ pub frac_digits: c_char, ++ pub p_cs_precedes: c_char, ++ pub p_sep_by_space: c_char, ++ pub n_cs_precedes: c_char, ++ pub n_sep_by_space: c_char, ++ pub p_sign_posn: c_char, ++ pub n_sign_posn: c_char, ++ pub left_parenthesis: *mut c_char, ++ pub right_parenthesis: *mut c_char, ++ pub int_p_cs_precedes: c_char, ++ pub int_p_sep_by_space: c_char, ++ pub int_n_cs_precedes: c_char, ++ pub int_n_sep_by_space: c_char, ++ pub int_p_sign_posn: c_char, ++ pub int_n_sign_posn: c_char, ++ } ++ ++ pub struct tm { ++ pub tm_sec: c_int, ++ pub tm_min: c_int, ++ pub tm_hour: c_int, ++ pub tm_mday: c_int, ++ pub tm_mon: c_int, ++ pub tm_year: c_int, ++ pub tm_wday: c_int, ++ pub tm_yday: c_int, ++ pub tm_isdst: c_int, ++ } ++ ++ pub struct addrinfo { ++ pub ai_flags: c_int, ++ pub ai_family: c_int, ++ pub ai_socktype: c_int, ++ pub ai_protocol: c_int, ++ pub ai_addrlen: c_ulong, ++ pub ai_canonname: *mut c_char, ++ pub ai_addr: *mut crate::sockaddr, ++ pub ai_next: *mut addrinfo, ++ pub ai_eflags: c_int, ++ } ++ ++ pub struct in_addr { ++ pub s_addr: in_addr_t, ++ } ++ ++ pub struct ip_mreq_source { ++ pub imr_multiaddr: in_addr, ++ pub imr_sourceaddr: in_addr, ++ pub imr_interface: in_addr, ++ } ++ ++ pub struct sockaddr { ++ pub sa_len: c_uchar, ++ pub sa_family: sa_family_t, ++ pub sa_data: [c_char; 14], ++ } ++ ++ pub struct sockaddr_dl { ++ pub sdl_len: c_uchar, ++ pub sdl_family: c_uchar, ++ pub sdl_index: c_ushort, ++ pub sdl_type: c_uchar, ++ pub sdl_nlen: c_uchar, ++ pub sdl_alen: c_uchar, ++ pub sdl_slen: c_uchar, ++ pub sdl_data: [c_char; 120], ++ } ++ ++ pub struct sockaddr_in { ++ pub sin_len: c_uchar, ++ pub sin_family: sa_family_t, ++ pub sin_port: in_port_t, ++ pub sin_addr: in_addr, ++ pub sin_zero: [c_char; 8], ++ } ++ ++ pub struct sockaddr_in6 { ++ pub sin6_len: c_uchar, ++ pub sin6_family: c_uchar, ++ pub sin6_port: crate::uint16_t, ++ pub sin6_flowinfo: crate::uint32_t, ++ pub sin6_addr: crate::in6_addr, ++ pub sin6_scope_id: crate::uint32_t, ++ } ++ ++ pub struct sockaddr_storage { ++ pub __ss_len: c_uchar, ++ pub ss_family: sa_family_t, ++ __ss_pad1: [c_char; 6], ++ __ss_align: crate::int64_t, ++ __ss_pad2: [c_char; 1265], ++ } ++ ++ pub struct sockaddr_un { ++ pub sun_len: c_uchar, ++ pub sun_family: sa_family_t, ++ pub sun_path: [c_char; 1023], ++ } ++ ++ pub struct st_timespec { ++ pub tv_sec: crate::time_t, ++ pub tv_nsec: c_int, ++ } ++ ++ pub struct statfs64 { ++ pub f_version: c_int, ++ pub f_type: c_int, ++ pub f_bsize: blksize64_t, ++ pub f_blocks: blkcnt64_t, ++ pub f_bfree: blkcnt64_t, ++ pub f_bavail: blkcnt64_t, ++ pub f_files: crate::uint64_t, ++ pub f_ffree: crate::uint64_t, ++ pub f_fsid: fsid64_t, ++ pub f_vfstype: c_int, ++ pub f_fsize: blksize64_t, ++ pub f_vfsnumber: c_int, ++ pub f_vfsoff: c_int, ++ pub f_vfslen: c_int, ++ pub f_vfsvers: c_int, ++ pub f_fname: [c_char; 32], ++ pub f_fpack: [c_char; 32], ++ pub f_name_max: c_int, ++ } ++ ++ pub struct passwd { ++ pub pw_name: *mut c_char, ++ pub pw_passwd: *mut c_char, ++ pub pw_uid: crate::uid_t, ++ pub pw_gid: crate::gid_t, ++ pub pw_gecos: *mut c_char, ++ pub pw_dir: *mut c_char, ++ pub pw_shell: *mut c_char, ++ } ++ ++ pub struct utsname { ++ pub sysname: [c_char; 32], ++ pub nodename: [c_char; 32], ++ pub release: [c_char; 32], ++ pub version: [c_char; 32], ++ pub machine: [c_char; 32], ++ } ++ ++ pub struct xutsname { ++ pub nid: c_uint, ++ pub reserved: c_int, ++ pub longnid: c_ulonglong, ++ } ++ ++ pub struct cmsghdr { ++ pub cmsg_len: crate::socklen_t, ++ pub cmsg_level: c_int, ++ pub cmsg_type: c_int, ++ } ++ ++ pub struct sigevent { ++ pub sigev_value: crate::sigval, ++ pub sigev_signo: c_int, ++ pub sigev_notify: c_int, ++ pub sigev_notify_function: extern "C" fn(val: crate::sigval), ++ pub sigev_notify_attributes: *mut pthread_attr_t, ++ } ++ ++ // Should be union with another 'sival_int' ++ pub struct sigval64 { ++ pub sival_ptr: c_ulonglong, ++ } ++ ++ pub struct sigevent64 { ++ pub sigev_value: sigval64, ++ pub sigev_signo: c_int, ++ pub sigev_notify: c_int, ++ pub sigev_notify_function: c_ulonglong, ++ pub sigev_notify_attributes: c_ulonglong, ++ } ++ ++ pub struct osigevent { ++ pub sevt_value: *mut c_void, ++ pub sevt_signo: signal_t, ++ } ++ ++ pub struct poll_ctl { ++ pub cmd: c_short, ++ pub events: c_short, ++ pub fd: c_int, ++ } ++ ++ pub struct sf_parms { ++ pub header_data: *mut c_void, ++ pub header_length: c_uint, ++ pub file_descriptor: c_int, ++ pub file_size: crate::uint64_t, ++ pub file_offset: crate::uint64_t, ++ pub file_bytes: crate::int64_t, ++ pub trailer_data: *mut c_void, ++ pub trailer_length: c_uint, ++ pub bytes_sent: crate::uint64_t, ++ } ++ ++ pub struct mmsghdr { ++ pub msg_hdr: crate::msghdr, ++ pub msg_len: c_uint, ++ } ++ ++ pub struct sched_param { ++ pub sched_priority: c_int, ++ pub sched_policy: c_int, ++ pub sched_reserved: [c_int; 6], ++ } ++ ++ pub struct stack_t { ++ pub ss_sp: *mut c_void, ++ pub ss_size: size_t, ++ pub ss_flags: c_int, ++ pub __pad: [c_int; 4], ++ } ++ ++ pub struct posix_spawnattr_t { ++ pub posix_attr_flags: c_short, ++ pub posix_attr_pgroup: crate::pid_t, ++ pub posix_attr_sigmask: crate::sigset_t, ++ pub posix_attr_sigdefault: crate::sigset_t, ++ pub posix_attr_schedpolicy: c_int, ++ pub posix_attr_schedparam: sched_param, ++ } ++ ++ pub struct glob_t { ++ pub gl_pathc: size_t, ++ pub gl_pathv: *mut *mut c_char, ++ pub gl_offs: size_t, ++ pub gl_padr: *mut c_void, ++ pub gl_ptx: *mut c_void, ++ } ++ ++ pub struct mallinfo { ++ pub arena: c_ulong, ++ pub ordblks: c_int, ++ pub smblks: c_int, ++ pub hblks: c_int, ++ pub hblkhd: c_int, ++ pub usmblks: c_ulong, ++ pub fsmblks: c_ulong, ++ pub uordblks: c_ulong, ++ pub fordblks: c_ulong, ++ pub keepcost: c_int, ++ } ++ ++ pub struct utmp_exit_status { ++ pub e_termination: c_short, ++ pub e_exit: c_short, ++ } ++ ++ pub struct utmp { ++ pub ut_user: [c_char; 256], ++ pub ut_id: [c_char; 14], ++ pub ut_line: [c_char; 64], ++ pub ut_pid: crate::pid_t, ++ pub ut_type: c_short, ++ pub ut_time: time64_t, ++ pub ut_exit: utmp_exit_status, ++ pub ut_host: [c_char; 256], ++ pub __dbl_word_pad: c_int, ++ pub __reservedA: [c_int; 2], ++ pub __reservedV: [c_int; 6], ++ } ++ ++ pub struct regmatch_t { ++ pub rm_so: regoff_t, ++ pub rm_eo: regoff_t, ++ } ++ ++ pub struct regex_t { ++ pub re_nsub: size_t, ++ pub re_comp: *mut c_void, ++ pub re_cflags: c_int, ++ pub re_erroff: size_t, ++ pub re_len: size_t, ++ pub re_ucoll: [crate::wchar_t; 2], ++ pub re_lsub: [*mut c_void; 24], ++ pub re_esub: [*mut c_void; 24], ++ pub re_map: *mut c_uchar, ++ pub __maxsub: c_int, ++ pub __unused: [*mut c_void; 34], ++ } ++ ++ pub struct rlimit64 { ++ pub rlim_cur: rlim64_t, ++ pub rlim_max: rlim64_t, ++ } ++ ++ pub struct shmid_ds { ++ pub shm_perm: ipc_perm, ++ pub shm_segsz: size_t, ++ pub shm_lpid: crate::pid_t, ++ pub shm_cpid: crate::pid_t, ++ pub shm_nattch: shmatt_t, ++ pub shm_cnattch: shmatt_t, ++ pub shm_atime: time_t, ++ pub shm_dtime: time_t, ++ pub shm_ctime: time_t, ++ pub shm_handle: crate::uint32_t, ++ pub shm_extshm: c_int, ++ pub shm_pagesize: crate::int64_t, ++ pub shm_lba: crate::uint64_t, ++ pub shm_reserved: crate::int64_t, ++ pub shm_reserved1: crate::int64_t, ++ } ++ ++ pub struct stat64 { ++ pub st_dev: dev_t, ++ pub st_ino: ino_t, ++ pub st_mode: mode_t, ++ pub st_nlink: nlink_t, ++ pub st_flag: c_ushort, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: dev_t, ++ pub st_ssize: c_int, ++ pub st_atim: st_timespec, ++ pub st_mtim: st_timespec, ++ pub st_ctim: st_timespec, ++ pub st_blksize: blksize_t, ++ pub st_blocks: blkcnt_t, ++ pub st_vfstype: c_int, ++ pub st_vfs: c_uint, ++ pub st_type: c_uint, ++ pub st_gen: c_uint, ++ pub st_reserved: [c_uint; 10], ++ pub st_size: off64_t, ++ } ++ ++ pub struct mntent { ++ pub mnt_fsname: *mut c_char, ++ pub mnt_dir: *mut c_char, ++ pub mnt_type: *mut c_char, ++ pub mnt_opts: *mut c_char, ++ pub mnt_freq: c_int, ++ pub mnt_passno: c_int, ++ } ++ ++ pub struct ipc_perm { ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub cuid: crate::uid_t, ++ pub cgid: crate::gid_t, ++ pub mode: mode_t, ++ pub seq: c_ushort, ++ pub __reserved: c_ushort, ++ pub key: key_t, ++ } ++ ++ pub struct entry { ++ pub key: *mut c_char, ++ pub data: *mut c_void, ++ } ++ ++ pub struct mq_attr { ++ pub mq_flags: c_long, ++ pub mq_maxmsg: c_long, ++ pub mq_msgsize: c_long, ++ pub mq_curmsgs: c_long, ++ } ++ ++ pub struct sembuf { ++ pub sem_num: c_ushort, ++ pub sem_op: c_short, ++ pub sem_flg: c_short, ++ } ++ ++ pub struct if_nameindex { ++ pub if_index: c_uint, ++ pub if_name: *mut c_char, ++ } ++ ++ pub struct itimerspec { ++ pub it_interval: crate::timespec, ++ pub it_value: crate::timespec, ++ } ++} ++ ++s_no_extra_traits! { ++ pub union __sigaction_sa_union { ++ pub __su_handler: extern "C" fn(c: c_int), ++ pub __su_sigaction: extern "C" fn(c: c_int, info: *mut siginfo_t, ptr: *mut c_void), ++ } ++ ++ pub struct sigaction { ++ pub sa_union: __sigaction_sa_union, ++ pub sa_mask: sigset_t, ++ pub sa_flags: c_int, ++ } ++ ++ pub union __poll_ctl_ext_u { ++ pub addr: *mut c_void, ++ pub data32: u32, ++ pub data: u64, ++ } ++ ++ pub struct poll_ctl_ext { ++ pub version: u8, ++ pub command: u8, ++ pub events: c_short, ++ pub fd: c_int, ++ pub u: __poll_ctl_ext_u, ++ pub reversed64: [u64; 6], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for __sigaction_sa_union { ++ fn eq(&self, other: &__sigaction_sa_union) -> bool { ++ unsafe { ++ self.__su_handler == other.__su_handler ++ && self.__su_sigaction == other.__su_sigaction ++ } ++ } ++ } ++ impl Eq for __sigaction_sa_union {} ++ impl hash::Hash for __sigaction_sa_union { ++ fn hash(&self, state: &mut H) { ++ unsafe { ++ self.__su_handler.hash(state); ++ self.__su_sigaction.hash(state); ++ } ++ } ++ } ++ ++ impl PartialEq for sigaction { ++ fn eq(&self, other: &sigaction) -> bool { ++ self.sa_mask == other.sa_mask ++ && self.sa_flags == other.sa_flags ++ && self.sa_union == other.sa_union ++ } ++ } ++ impl Eq for sigaction {} ++ impl fmt::Debug for sigaction { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_struct("sigaction") ++ .field("sa_union", &self.sa_union) ++ .field("sa_mask", &self.sa_mask) ++ .field("sa_flags", &self.sa_flags) ++ .finish() ++ } ++ } ++ impl hash::Hash for sigaction { ++ fn hash(&self, state: &mut H) { ++ self.sa_union.hash(state); ++ self.sa_mask.hash(state); ++ self.sa_flags.hash(state); ++ } ++ } ++ ++ impl PartialEq for __poll_ctl_ext_u { ++ fn eq(&self, other: &__poll_ctl_ext_u) -> bool { ++ unsafe { ++ self.addr == other.addr ++ && self.data32 == other.data32 ++ && self.data == other.data ++ } ++ } ++ } ++ impl Eq for __poll_ctl_ext_u {} ++ impl hash::Hash for __poll_ctl_ext_u { ++ fn hash(&self, state: &mut H) { ++ unsafe { ++ self.addr.hash(state); ++ self.data32.hash(state); ++ self.data.hash(state); ++ } ++ } ++ } ++ ++ impl PartialEq for poll_ctl_ext { ++ fn eq(&self, other: &poll_ctl_ext) -> bool { ++ self.version == other.version ++ && self.command == other.command ++ && self.events == other.events ++ && self.fd == other.fd ++ && self.reversed64 == other.reversed64 ++ && self.u == other.u ++ } ++ } ++ impl Eq for poll_ctl_ext {} ++ impl fmt::Debug for poll_ctl_ext { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_struct("poll_ctl_ext") ++ .field("version", &self.version) ++ .field("command", &self.command) ++ .field("events", &self.events) ++ .field("fd", &self.fd) ++ .field("u", &self.u) ++ .field("reversed64", &self.reversed64) ++ .finish() ++ } ++ } ++ impl hash::Hash for poll_ctl_ext { ++ fn hash(&self, state: &mut H) { ++ self.version.hash(state); ++ self.command.hash(state); ++ self.events.hash(state); ++ self.fd.hash(state); ++ self.u.hash(state); ++ self.reversed64.hash(state); ++ } ++ } ++ } ++} ++ ++// dlfcn.h ++pub const RTLD_LAZY: c_int = 0x4; ++pub const RTLD_NOW: c_int = 0x2; ++pub const RTLD_GLOBAL: c_int = 0x10000; ++pub const RTLD_LOCAL: c_int = 0x80000; ++pub const RTLD_MEMBER: c_int = 0x40000; ++pub const RTLD_NOAUTODEFER: c_int = 0x20000; ++pub const RTLD_DEFAULT: *mut c_void = -1isize as *mut c_void; ++pub const RTLD_MYSELF: *mut c_void = -2isize as *mut c_void; ++pub const RTLD_NEXT: *mut c_void = -3isize as *mut c_void; ++ ++// fcntl.h ++pub const O_RDONLY: c_int = 0x0; ++pub const O_WRONLY: c_int = 0x1; ++pub const O_RDWR: c_int = 0x2; ++pub const O_NDELAY: c_int = 0x8000; ++pub const O_APPEND: c_int = 0x8; ++pub const O_DSYNC: c_int = 0x400000; ++pub const O_CREAT: c_int = 0x100; ++pub const O_EXCL: c_int = 0x400; ++pub const O_NOCTTY: c_int = 0x800; ++pub const O_TRUNC: c_int = 0x200; ++pub const O_NOFOLLOW: c_int = 0x1000000; ++pub const O_DIRECTORY: c_int = 0x80000; ++pub const O_SEARCH: c_int = 0x20; ++pub const O_EXEC: c_int = 0x20; ++pub const O_CLOEXEC: c_int = 0x800000; ++pub const O_ACCMODE: c_int = O_RDONLY | O_WRONLY | O_RDWR; ++pub const O_DIRECT: c_int = 0x8000000; ++pub const O_TTY_INIT: c_int = 0; ++pub const O_RSYNC: c_int = 0x200000; ++pub const O_LARGEFILE: c_int = 0x4000000; ++pub const F_CLOSEM: c_int = 10; ++pub const F_DUPFD_CLOEXEC: c_int = 16; ++pub const F_GETLK64: c_int = 11; ++pub const F_SETLK64: c_int = 12; ++pub const F_SETLKW64: c_int = 13; ++pub const F_DUP2FD: c_int = 14; ++pub const F_TSTLK: c_int = 15; ++pub const F_GETLK: c_int = F_GETLK64; ++pub const F_SETLK: c_int = F_SETLK64; ++pub const F_SETLKW: c_int = F_SETLKW64; ++pub const F_GETOWN: c_int = 8; ++pub const F_SETOWN: c_int = 9; ++pub const AT_FDCWD: c_int = -2; ++pub const AT_SYMLINK_NOFOLLOW: c_int = 1; ++pub const AT_SYMLINK_FOLLOW: c_int = 2; ++pub const AT_REMOVEDIR: c_int = 1; ++pub const AT_EACCESS: c_int = 1; ++pub const F_DUPFD: c_int = 0; ++pub const F_GETFD: c_int = 1; ++pub const F_SETFD: c_int = 2; ++pub const F_GETFL: c_int = 3; ++pub const F_SETFL: c_int = 4; ++pub const O_SYNC: c_int = 16; ++pub const O_NONBLOCK: c_int = 4; ++pub const FASYNC: c_int = 0x20000; ++pub const POSIX_FADV_NORMAL: c_int = 1; ++pub const POSIX_FADV_SEQUENTIAL: c_int = 2; ++pub const POSIX_FADV_RANDOM: c_int = 3; ++pub const POSIX_FADV_WILLNEED: c_int = 4; ++pub const POSIX_FADV_DONTNEED: c_int = 5; ++pub const POSIX_FADV_NOREUSE: c_int = 6; ++ ++// glob.h ++pub const GLOB_APPEND: c_int = 0x1; ++pub const GLOB_DOOFFS: c_int = 0x2; ++pub const GLOB_ERR: c_int = 0x4; ++pub const GLOB_MARK: c_int = 0x8; ++pub const GLOB_NOCHECK: c_int = 0x10; ++pub const GLOB_NOSORT: c_int = 0x20; ++pub const GLOB_NOESCAPE: c_int = 0x80; ++pub const GLOB_NOSPACE: c_int = 0x2000; ++pub const GLOB_ABORTED: c_int = 0x1000; ++pub const GLOB_NOMATCH: c_int = 0x4000; ++pub const GLOB_NOSYS: c_int = 0x8000; ++ ++// langinfo.h ++pub const DAY_1: crate::nl_item = 13; ++pub const DAY_2: crate::nl_item = 14; ++pub const DAY_3: crate::nl_item = 15; ++pub const DAY_4: crate::nl_item = 16; ++pub const DAY_5: crate::nl_item = 17; ++pub const DAY_6: crate::nl_item = 18; ++pub const DAY_7: crate::nl_item = 19; ++pub const ABDAY_1: crate::nl_item = 6; ++pub const ABDAY_2: crate::nl_item = 7; ++pub const ABDAY_3: crate::nl_item = 8; ++pub const ABDAY_4: crate::nl_item = 9; ++pub const ABDAY_5: crate::nl_item = 10; ++pub const ABDAY_6: crate::nl_item = 11; ++pub const ABDAY_7: crate::nl_item = 12; ++pub const MON_1: crate::nl_item = 32; ++pub const MON_2: crate::nl_item = 33; ++pub const MON_3: crate::nl_item = 34; ++pub const MON_4: crate::nl_item = 35; ++pub const MON_5: crate::nl_item = 36; ++pub const MON_6: crate::nl_item = 37; ++pub const MON_7: crate::nl_item = 38; ++pub const MON_8: crate::nl_item = 39; ++pub const MON_9: crate::nl_item = 40; ++pub const MON_10: crate::nl_item = 41; ++pub const MON_11: crate::nl_item = 42; ++pub const MON_12: crate::nl_item = 43; ++pub const ABMON_1: crate::nl_item = 20; ++pub const ABMON_2: crate::nl_item = 21; ++pub const ABMON_3: crate::nl_item = 22; ++pub const ABMON_4: crate::nl_item = 23; ++pub const ABMON_5: crate::nl_item = 24; ++pub const ABMON_6: crate::nl_item = 25; ++pub const ABMON_7: crate::nl_item = 26; ++pub const ABMON_8: crate::nl_item = 27; ++pub const ABMON_9: crate::nl_item = 28; ++pub const ABMON_10: crate::nl_item = 29; ++pub const ABMON_11: crate::nl_item = 30; ++pub const ABMON_12: crate::nl_item = 31; ++pub const RADIXCHAR: crate::nl_item = 44; ++pub const THOUSEP: crate::nl_item = 45; ++pub const YESSTR: crate::nl_item = 46; ++pub const NOSTR: crate::nl_item = 47; ++pub const CRNCYSTR: crate::nl_item = 48; ++pub const D_T_FMT: crate::nl_item = 1; ++pub const D_FMT: crate::nl_item = 2; ++pub const T_FMT: crate::nl_item = 3; ++pub const AM_STR: crate::nl_item = 4; ++pub const PM_STR: crate::nl_item = 5; ++pub const CODESET: crate::nl_item = 49; ++pub const T_FMT_AMPM: crate::nl_item = 55; ++pub const ERA: crate::nl_item = 56; ++pub const ERA_D_FMT: crate::nl_item = 57; ++pub const ERA_D_T_FMT: crate::nl_item = 58; ++pub const ERA_T_FMT: crate::nl_item = 59; ++pub const ALT_DIGITS: crate::nl_item = 60; ++pub const YESEXPR: crate::nl_item = 61; ++pub const NOEXPR: crate::nl_item = 62; ++ ++// locale.h ++pub const LC_GLOBAL_LOCALE: crate::locale_t = -1isize as crate::locale_t; ++pub const LC_CTYPE: c_int = 1; ++pub const LC_NUMERIC: c_int = 3; ++pub const LC_TIME: c_int = 4; ++pub const LC_COLLATE: c_int = 0; ++pub const LC_MONETARY: c_int = 2; ++pub const LC_MESSAGES: c_int = 4; ++pub const LC_ALL: c_int = -1; ++pub const LC_CTYPE_MASK: c_int = 2; ++pub const LC_NUMERIC_MASK: c_int = 16; ++pub const LC_TIME_MASK: c_int = 32; ++pub const LC_COLLATE_MASK: c_int = 1; ++pub const LC_MONETARY_MASK: c_int = 8; ++pub const LC_MESSAGES_MASK: c_int = 4; ++pub const LC_ALL_MASK: c_int = LC_CTYPE_MASK ++ | LC_NUMERIC_MASK ++ | LC_TIME_MASK ++ | LC_COLLATE_MASK ++ | LC_MONETARY_MASK ++ | LC_MESSAGES_MASK; ++ ++// netdb.h ++pub const NI_MAXHOST: crate::socklen_t = 1025; ++pub const NI_MAXSERV: crate::socklen_t = 32; ++pub const NI_NOFQDN: crate::socklen_t = 0x1; ++pub const NI_NUMERICHOST: crate::socklen_t = 0x2; ++pub const NI_NAMEREQD: crate::socklen_t = 0x4; ++pub const NI_NUMERICSERV: crate::socklen_t = 0x8; ++pub const NI_DGRAM: crate::socklen_t = 0x10; ++pub const NI_NUMERICSCOPE: crate::socklen_t = 0x40; ++pub const EAI_AGAIN: c_int = 2; ++pub const EAI_BADFLAGS: c_int = 3; ++pub const EAI_FAIL: c_int = 4; ++pub const EAI_FAMILY: c_int = 5; ++pub const EAI_MEMORY: c_int = 6; ++pub const EAI_NODATA: c_int = 7; ++pub const EAI_NONAME: c_int = 8; ++pub const EAI_SERVICE: c_int = 9; ++pub const EAI_SOCKTYPE: c_int = 10; ++pub const EAI_SYSTEM: c_int = 11; ++pub const EAI_OVERFLOW: c_int = 13; ++pub const AI_CANONNAME: c_int = 0x01; ++pub const AI_PASSIVE: c_int = 0x02; ++pub const AI_NUMERICHOST: c_int = 0x04; ++pub const AI_ADDRCONFIG: c_int = 0x08; ++pub const AI_V4MAPPED: c_int = 0x10; ++pub const AI_ALL: c_int = 0x20; ++pub const AI_NUMERICSERV: c_int = 0x40; ++pub const AI_EXTFLAGS: c_int = 0x80; ++pub const AI_DEFAULT: c_int = AI_V4MAPPED | AI_ADDRCONFIG; ++pub const IPV6_ADDRFORM: c_int = 22; ++pub const IPV6_ADDR_PREFERENCES: c_int = 74; ++pub const IPV6_CHECKSUM: c_int = 39; ++pub const IPV6_DONTFRAG: c_int = 45; ++pub const IPV6_DSTOPTS: c_int = 54; ++pub const IPV6_FLOWINFO_FLOWLABEL: c_int = 16777215; ++pub const IPV6_FLOWINFO_PRIORITY: c_int = 251658240; ++pub const IPV6_HOPLIMIT: c_int = 40; ++pub const IPV6_HOPOPTS: c_int = 52; ++pub const IPV6_NEXTHOP: c_int = 48; ++pub const IPV6_PATHMTU: c_int = 46; ++pub const IPV6_PKTINFO: c_int = 33; ++pub const IPV6_PREFER_SRC_CGA: c_int = 16; ++pub const IPV6_PREFER_SRC_COA: c_int = 2; ++pub const IPV6_PREFER_SRC_HOME: c_int = 1; ++pub const IPV6_PREFER_SRC_NONCGA: c_int = 32; ++pub const IPV6_PREFER_SRC_PUBLIC: c_int = 4; ++pub const IPV6_PREFER_SRC_TMP: c_int = 8; ++pub const IPV6_RECVDSTOPTS: c_int = 56; ++pub const IPV6_RECVHOPLIMIT: c_int = 41; ++pub const IPV6_RECVHOPOPTS: c_int = 53; ++pub const IPV6_RECVPATHMTU: c_int = 47; ++pub const IPV6_RECVRTHDR: c_int = 51; ++pub const IPV6_RECVTCLASS: c_int = 42; ++pub const IPV6_RTHDR: c_int = 50; ++pub const IPV6_RTHDRDSTOPTS: c_int = 55; ++pub const IPV6_TCLASS: c_int = 43; ++ ++// net/bpf.h ++pub const DLT_NULL: c_int = 0x18; ++pub const DLT_EN10MB: c_int = 0x6; ++pub const DLT_EN3MB: c_int = 0x1a; ++pub const DLT_AX25: c_int = 0x5; ++pub const DLT_PRONET: c_int = 0xd; ++pub const DLT_IEEE802: c_int = 0x7; ++pub const DLT_ARCNET: c_int = 0x23; ++pub const DLT_SLIP: c_int = 0x1c; ++pub const DLT_PPP: c_int = 0x17; ++pub const DLT_FDDI: c_int = 0xf; ++pub const DLT_ATM: c_int = 0x25; ++pub const DLT_IPOIB: c_int = 0xc7; ++pub const BIOCSETF: c_ulong = 0x80104267; ++pub const BIOCGRTIMEOUT: c_ulong = 0x4010426e; ++pub const BIOCGBLEN: c_int = 0x40044266; ++pub const BIOCSBLEN: c_int = 0xc0044266; ++pub const BIOCFLUSH: c_int = 0x20004268; ++pub const BIOCPROMISC: c_int = 0x20004269; ++pub const BIOCGDLT: c_int = 0x4004426a; ++pub const BIOCSRTIMEOUT: c_int = 0x8010426d; ++pub const BIOCGSTATS: c_int = 0x4008426f; ++pub const BIOCIMMEDIATE: c_int = 0x80044270; ++pub const BIOCVERSION: c_int = 0x40044271; ++pub const BIOCSDEVNO: c_int = 0x20004272; ++pub const BIOCGETIF: c_ulong = 0x4020426b; ++pub const BIOCSETIF: c_ulong = 0xffffffff8020426c; ++pub const BPF_ABS: c_int = 32; ++pub const BPF_ADD: c_int = 0; ++pub const BPF_ALIGNMENT: c_ulong = 4; ++pub const BPF_ALU: c_int = 4; ++pub const BPF_AND: c_int = 80; ++pub const BPF_B: c_int = 16; ++pub const BPF_DIV: c_int = 48; ++pub const BPF_H: c_int = 8; ++pub const BPF_IMM: c_int = 0; ++pub const BPF_IND: c_int = 64; ++pub const BPF_JA: c_int = 0; ++pub const BPF_JEQ: c_int = 16; ++pub const BPF_JGE: c_int = 48; ++pub const BPF_JGT: c_int = 32; ++pub const BPF_JMP: c_int = 5; ++pub const BPF_JSET: c_int = 64; ++pub const BPF_K: c_int = 0; ++pub const BPF_LD: c_int = 0; ++pub const BPF_LDX: c_int = 1; ++pub const BPF_LEN: c_int = 128; ++pub const BPF_LSH: c_int = 96; ++pub const BPF_MAXINSNS: c_int = 512; ++pub const BPF_MEM: c_int = 96; ++pub const BPF_MEMWORDS: c_int = 16; ++pub const BPF_MISC: c_int = 7; ++pub const BPF_MSH: c_int = 160; ++pub const BPF_MUL: c_int = 32; ++pub const BPF_NEG: c_int = 128; ++pub const BPF_OR: c_int = 64; ++pub const BPF_RET: c_int = 6; ++pub const BPF_RSH: c_int = 112; ++pub const BPF_ST: c_int = 2; ++pub const BPF_STX: c_int = 3; ++pub const BPF_SUB: c_int = 16; ++pub const BPF_W: c_int = 0; ++pub const BPF_X: c_int = 8; ++ ++// net/if.h ++pub const IFNET_SLOWHZ: c_int = 1; ++pub const IFQ_MAXLEN: c_int = 50; ++pub const IFF_UP: c_int = 0x1; ++pub const IFF_BROADCAST: c_int = 0x2; ++pub const IFF_DEBUG: c_int = 0x4; ++pub const IFF_LOOPBACK: c_int = 0x8; ++pub const IFF_POINTOPOINT: c_int = 0x10; ++pub const IFF_NOTRAILERS: c_int = 0x20; ++pub const IFF_RUNNING: c_int = 0x40; ++pub const IFF_NOARP: c_int = 0x80; ++pub const IFF_PROMISC: c_int = 0x100; ++pub const IFF_ALLMULTI: c_int = 0x200; ++pub const IFF_MULTICAST: c_int = 0x80000; ++pub const IFF_LINK0: c_int = 0x100000; ++pub const IFF_LINK1: c_int = 0x200000; ++pub const IFF_LINK2: c_int = 0x400000; ++pub const IFF_OACTIVE: c_int = 0x400; ++pub const IFF_SIMPLEX: c_int = 0x800; ++ ++// net/if_arp.h ++pub const ARPHRD_ETHER: c_int = 1; ++pub const ARPHRD_802_5: c_int = 6; ++pub const ARPHRD_802_3: c_int = 6; ++pub const ARPHRD_FDDI: c_int = 1; ++ ++// net/route.h ++pub const RTM_ADD: c_int = 0x1; ++pub const RTM_DELETE: c_int = 0x2; ++pub const RTM_CHANGE: c_int = 0x3; ++pub const RTM_GET: c_int = 0x4; ++pub const RTM_LOSING: c_int = 0x5; ++pub const RTM_REDIRECT: c_int = 0x6; ++pub const RTM_MISS: c_int = 0x7; ++pub const RTM_LOCK: c_int = 0x8; ++pub const RTM_OLDADD: c_int = 0x9; ++pub const RTM_OLDDEL: c_int = 0xa; ++pub const RTM_RESOLVE: c_int = 0xb; ++pub const RTM_NEWADDR: c_int = 0xc; ++pub const RTM_DELADDR: c_int = 0xd; ++pub const RTM_IFINFO: c_int = 0xe; ++pub const RTM_EXPIRE: c_int = 0xf; ++pub const RTM_RTLOST: c_int = 0x10; ++pub const RTM_GETNEXT: c_int = 0x11; ++pub const RTM_SAMEADDR: c_int = 0x12; ++pub const RTM_SET: c_int = 0x13; ++pub const RTV_MTU: c_int = 0x1; ++pub const RTV_HOPCOUNT: c_int = 0x2; ++pub const RTV_EXPIRE: c_int = 0x4; ++pub const RTV_RPIPE: c_int = 0x8; ++pub const RTV_SPIPE: c_int = 0x10; ++pub const RTV_SSTHRESH: c_int = 0x20; ++pub const RTV_RTT: c_int = 0x40; ++pub const RTV_RTTVAR: c_int = 0x80; ++pub const RTA_DST: c_int = 0x1; ++pub const RTA_GATEWAY: c_int = 0x2; ++pub const RTA_NETMASK: c_int = 0x4; ++pub const RTA_GENMASK: c_int = 0x8; ++pub const RTA_IFP: c_int = 0x10; ++pub const RTA_IFA: c_int = 0x20; ++pub const RTA_AUTHOR: c_int = 0x40; ++pub const RTA_BRD: c_int = 0x80; ++pub const RTA_DOWNSTREAM: c_int = 0x100; ++pub const RTAX_DST: c_int = 0; ++pub const RTAX_GATEWAY: c_int = 1; ++pub const RTAX_NETMASK: c_int = 2; ++pub const RTAX_GENMASK: c_int = 3; ++pub const RTAX_IFP: c_int = 4; ++pub const RTAX_IFA: c_int = 5; ++pub const RTAX_AUTHOR: c_int = 6; ++pub const RTAX_BRD: c_int = 7; ++pub const RTAX_MAX: c_int = 8; ++pub const RTF_UP: c_int = 0x1; ++pub const RTF_GATEWAY: c_int = 0x2; ++pub const RTF_HOST: c_int = 0x4; ++pub const RTF_REJECT: c_int = 0x8; ++pub const RTF_DYNAMIC: c_int = 0x10; ++pub const RTF_MODIFIED: c_int = 0x20; ++pub const RTF_DONE: c_int = 0x40; ++pub const RTF_MASK: c_int = 0x80; ++pub const RTF_CLONING: c_int = 0x100; ++pub const RTF_XRESOLVE: c_int = 0x200; ++pub const RTF_LLINFO: c_int = 0x400; ++pub const RTF_STATIC: c_int = 0x800; ++pub const RTF_BLACKHOLE: c_int = 0x1000; ++pub const RTF_BUL: c_int = 0x2000; ++pub const RTF_PROTO2: c_int = 0x4000; ++pub const RTF_PROTO1: c_int = 0x8000; ++pub const RTF_CLONE: c_int = 0x10000; ++pub const RTF_CLONED: c_int = 0x20000; ++pub const RTF_PROTO3: c_int = 0x40000; ++pub const RTF_BCE: c_int = 0x80000; ++pub const RTF_PINNED: c_int = 0x100000; ++pub const RTF_LOCAL: c_int = 0x200000; ++pub const RTF_BROADCAST: c_int = 0x400000; ++pub const RTF_MULTICAST: c_int = 0x800000; ++pub const RTF_ACTIVE_DGD: c_int = 0x1000000; ++pub const RTF_STOPSRCH: c_int = 0x2000000; ++pub const RTF_FREE_IN_PROG: c_int = 0x4000000; ++pub const RTF_PERMANENT6: c_int = 0x8000000; ++pub const RTF_UNREACHABLE: c_int = 0x10000000; ++pub const RTF_CACHED: c_int = 0x20000000; ++pub const RTF_SMALLMTU: c_int = 0x40000; ++ ++// netinet/in.h ++pub const IPPROTO_HOPOPTS: c_int = 0; ++pub const IPPROTO_IGMP: c_int = 2; ++pub const IPPROTO_GGP: c_int = 3; ++pub const IPPROTO_IPIP: c_int = 4; ++pub const IPPROTO_EGP: c_int = 8; ++pub const IPPROTO_PUP: c_int = 12; ++pub const IPPROTO_IDP: c_int = 22; ++pub const IPPROTO_TP: c_int = 29; ++pub const IPPROTO_ROUTING: c_int = 43; ++pub const IPPROTO_FRAGMENT: c_int = 44; ++pub const IPPROTO_QOS: c_int = 45; ++pub const IPPROTO_RSVP: c_int = 46; ++pub const IPPROTO_GRE: c_int = 47; ++pub const IPPROTO_ESP: c_int = 50; ++pub const IPPROTO_AH: c_int = 51; ++pub const IPPROTO_NONE: c_int = 59; ++pub const IPPROTO_DSTOPTS: c_int = 60; ++pub const IPPROTO_LOCAL: c_int = 63; ++pub const IPPROTO_EON: c_int = 80; ++pub const IPPROTO_BIP: c_int = 0x53; ++pub const IPPROTO_SCTP: c_int = 132; ++pub const IPPROTO_MH: c_int = 135; ++pub const IPPROTO_GIF: c_int = 140; ++pub const IPPROTO_RAW: c_int = 255; ++pub const IPPROTO_MAX: c_int = 256; ++pub const IP_OPTIONS: c_int = 1; ++pub const IP_HDRINCL: c_int = 2; ++pub const IP_TOS: c_int = 3; ++pub const IP_TTL: c_int = 4; ++pub const IP_UNICAST_HOPS: c_int = 4; ++pub const IP_RECVOPTS: c_int = 5; ++pub const IP_RECVRETOPTS: c_int = 6; ++pub const IP_RECVDSTADDR: c_int = 7; ++pub const IP_RETOPTS: c_int = 8; ++pub const IP_MULTICAST_IF: c_int = 9; ++pub const IP_MULTICAST_TTL: c_int = 10; ++pub const IP_MULTICAST_HOPS: c_int = 10; ++pub const IP_MULTICAST_LOOP: c_int = 11; ++pub const IP_ADD_MEMBERSHIP: c_int = 12; ++pub const IP_DROP_MEMBERSHIP: c_int = 13; ++pub const IP_RECVMACHDR: c_int = 14; ++pub const IP_RECVIFINFO: c_int = 15; ++pub const IP_BROADCAST_IF: c_int = 16; ++pub const IP_DHCPMODE: c_int = 17; ++pub const IP_RECVIF: c_int = 20; ++pub const IP_ADDRFORM: c_int = 22; ++pub const IP_DONTFRAG: c_int = 25; ++pub const IP_FINDPMTU: c_int = 26; ++pub const IP_PMTUAGE: c_int = 27; ++pub const IP_RECVINTERFACE: c_int = 32; ++pub const IP_RECVTTL: c_int = 34; ++pub const IP_BLOCK_SOURCE: c_int = 58; ++pub const IP_UNBLOCK_SOURCE: c_int = 59; ++pub const IP_ADD_SOURCE_MEMBERSHIP: c_int = 60; ++pub const IP_DROP_SOURCE_MEMBERSHIP: c_int = 61; ++pub const IP_DEFAULT_MULTICAST_TTL: c_int = 1; ++pub const IP_DEFAULT_MULTICAST_LOOP: c_int = 1; ++pub const IP_INC_MEMBERSHIPS: c_int = 20; ++pub const IP_INIT_MEMBERSHIP: c_int = 20; ++pub const IPV6_UNICAST_HOPS: c_int = IP_TTL; ++pub const IPV6_MULTICAST_IF: c_int = IP_MULTICAST_IF; ++pub const IPV6_MULTICAST_HOPS: c_int = IP_MULTICAST_TTL; ++pub const IPV6_MULTICAST_LOOP: c_int = IP_MULTICAST_LOOP; ++pub const IPV6_RECVPKTINFO: c_int = 35; ++pub const IPV6_V6ONLY: c_int = 37; ++pub const IPV6_ADD_MEMBERSHIP: c_int = IP_ADD_MEMBERSHIP; ++pub const IPV6_DROP_MEMBERSHIP: c_int = IP_DROP_MEMBERSHIP; ++pub const IPV6_JOIN_GROUP: c_int = IP_ADD_MEMBERSHIP; ++pub const IPV6_LEAVE_GROUP: c_int = IP_DROP_MEMBERSHIP; ++pub const MCAST_BLOCK_SOURCE: c_int = 64; ++pub const MCAST_EXCLUDE: c_int = 2; ++pub const MCAST_INCLUDE: c_int = 1; ++pub const MCAST_JOIN_GROUP: c_int = 62; ++pub const MCAST_JOIN_SOURCE_GROUP: c_int = 66; ++pub const MCAST_LEAVE_GROUP: c_int = 63; ++pub const MCAST_LEAVE_SOURCE_GROUP: c_int = 67; ++pub const MCAST_UNBLOCK_SOURCE: c_int = 65; ++ ++// netinet/ip.h ++pub const MAXTTL: c_int = 255; ++pub const IPDEFTTL: c_int = 64; ++pub const IPOPT_CONTROL: c_int = 0; ++pub const IPOPT_EOL: c_int = 0; ++pub const IPOPT_LSRR: c_int = 131; ++pub const IPOPT_MINOFF: c_int = 4; ++pub const IPOPT_NOP: c_int = 1; ++pub const IPOPT_OFFSET: c_int = 2; ++pub const IPOPT_OLEN: c_int = 1; ++pub const IPOPT_OPTVAL: c_int = 0; ++pub const IPOPT_RESERVED1: c_int = 0x20; ++pub const IPOPT_RESERVED2: c_int = 0x60; ++pub const IPOPT_RR: c_int = 7; ++pub const IPOPT_SSRR: c_int = 137; ++pub const IPOPT_TS: c_int = 68; ++pub const IPOPT_TS_PRESPEC: c_int = 3; ++pub const IPOPT_TS_TSANDADDR: c_int = 1; ++pub const IPOPT_TS_TSONLY: c_int = 0; ++pub const IPTOS_LOWDELAY: c_int = 16; ++pub const IPTOS_PREC_CRITIC_ECP: c_int = 160; ++pub const IPTOS_PREC_FLASH: c_int = 96; ++pub const IPTOS_PREC_FLASHOVERRIDE: c_int = 128; ++pub const IPTOS_PREC_IMMEDIATE: c_int = 64; ++pub const IPTOS_PREC_INTERNETCONTROL: c_int = 192; ++pub const IPTOS_PREC_NETCONTROL: c_int = 224; ++pub const IPTOS_PREC_PRIORITY: c_int = 32; ++pub const IPTOS_PREC_ROUTINE: c_int = 16; ++pub const IPTOS_RELIABILITY: c_int = 4; ++pub const IPTOS_THROUGHPUT: c_int = 8; ++pub const IPVERSION: c_int = 4; ++ ++// netinet/tcp.h ++pub const TCP_NODELAY: c_int = 0x1; ++pub const TCP_MAXSEG: c_int = 0x2; ++pub const TCP_RFC1323: c_int = 0x4; ++pub const TCP_KEEPALIVE: c_int = 0x8; ++pub const TCP_KEEPIDLE: c_int = 0x11; ++pub const TCP_KEEPINTVL: c_int = 0x12; ++pub const TCP_KEEPCNT: c_int = 0x13; ++pub const TCP_NODELAYACK: c_int = 0x14; ++ ++// pthread.h ++pub const PTHREAD_BARRIER_SERIAL_THREAD: c_int = -1; ++pub const PTHREAD_CREATE_JOINABLE: c_int = 0; ++pub const PTHREAD_CREATE_DETACHED: c_int = 1; ++pub const PTHREAD_PROCESS_SHARED: c_int = 0; ++pub const PTHREAD_PROCESS_PRIVATE: c_ushort = 1; ++pub const PTHREAD_STACK_MIN: size_t = PAGESIZE as size_t * 4; ++pub const PTHREAD_MUTEX_NORMAL: c_int = 5; ++pub const PTHREAD_MUTEX_ERRORCHECK: c_int = 3; ++pub const PTHREAD_MUTEX_RECURSIVE: c_int = 4; ++pub const PTHREAD_MUTEX_DEFAULT: c_int = PTHREAD_MUTEX_NORMAL; ++pub const PTHREAD_MUTEX_ROBUST: c_int = 1; ++pub const PTHREAD_MUTEX_STALLED: c_int = 0; ++pub const PTHREAD_PRIO_INHERIT: c_int = 3; ++pub const PTHREAD_PRIO_NONE: c_int = 1; ++pub const PTHREAD_PRIO_PROTECT: c_int = 2; ++ ++// regex.h ++pub const REG_EXTENDED: c_int = 1; ++pub const REG_ICASE: c_int = 2; ++pub const REG_NEWLINE: c_int = 4; ++pub const REG_NOSUB: c_int = 8; ++pub const REG_NOTBOL: c_int = 0x100; ++pub const REG_NOTEOL: c_int = 0x200; ++pub const REG_NOMATCH: c_int = 1; ++pub const REG_BADPAT: c_int = 2; ++pub const REG_ECOLLATE: c_int = 3; ++pub const REG_ECTYPE: c_int = 4; ++pub const REG_EESCAPE: c_int = 5; ++pub const REG_ESUBREG: c_int = 6; ++pub const REG_EBRACK: c_int = 7; ++pub const REG_EPAREN: c_int = 8; ++pub const REG_EBRACE: c_int = 9; ++pub const REG_BADBR: c_int = 10; ++pub const REG_ERANGE: c_int = 11; ++pub const REG_ESPACE: c_int = 12; ++pub const REG_BADRPT: c_int = 13; ++pub const REG_ECHAR: c_int = 14; ++pub const REG_EBOL: c_int = 15; ++pub const REG_EEOL: c_int = 16; ++pub const REG_ENOSYS: c_int = 17; ++ ++// rpcsvc/mount.h ++pub const NFSMNT_ACDIRMAX: c_int = 2048; ++pub const NFSMNT_ACDIRMIN: c_int = 1024; ++pub const NFSMNT_ACREGMAX: c_int = 512; ++pub const NFSMNT_ACREGMIN: c_int = 256; ++pub const NFSMNT_INT: c_int = 64; ++pub const NFSMNT_NOAC: c_int = 128; ++pub const NFSMNT_RETRANS: c_int = 16; ++pub const NFSMNT_RSIZE: c_int = 4; ++pub const NFSMNT_SOFT: c_int = 1; ++pub const NFSMNT_TIMEO: c_int = 8; ++pub const NFSMNT_WSIZE: c_int = 2; ++ ++// rpcsvc/rstat.h ++pub const CPUSTATES: c_int = 4; ++ ++// search.h ++pub const FIND: c_int = 0; ++pub const ENTER: c_int = 1; ++ ++// semaphore.h ++pub const SEM_FAILED: *mut sem_t = -1isize as *mut crate::sem_t; ++ ++// spawn.h ++// DIFF(main): changed to `c_short` in f62eb023ab ++pub const POSIX_SPAWN_SETPGROUP: c_int = 0x1; ++pub const POSIX_SPAWN_SETSIGMASK: c_int = 0x2; ++pub const POSIX_SPAWN_SETSIGDEF: c_int = 0x4; ++pub const POSIX_SPAWN_SETSCHEDULER: c_int = 0x8; ++pub const POSIX_SPAWN_SETSCHEDPARAM: c_int = 0x10; ++pub const POSIX_SPAWN_RESETIDS: c_int = 0x20; ++pub const POSIX_SPAWN_FORK_HANDLERS: c_int = 0x1000; ++ ++// stdio.h ++pub const EOF: c_int = -1; ++pub const SEEK_SET: c_int = 0; ++pub const SEEK_CUR: c_int = 1; ++pub const SEEK_END: c_int = 2; ++pub const _IOFBF: c_int = 0o000; ++pub const _IONBF: c_int = 0o004; ++pub const _IOLBF: c_int = 0o100; ++pub const BUFSIZ: c_uint = 4096; ++pub const FOPEN_MAX: c_uint = 32767; ++pub const FILENAME_MAX: c_uint = 255; ++pub const L_tmpnam: c_uint = 21; ++pub const TMP_MAX: c_uint = 16384; ++ ++// stdlib.h ++pub const EXIT_FAILURE: c_int = 1; ++pub const EXIT_SUCCESS: c_int = 0; ++pub const RAND_MAX: c_int = 32767; ++ ++// sys/access.h ++pub const F_OK: c_int = 0; ++pub const R_OK: c_int = 4; ++pub const W_OK: c_int = 2; ++pub const X_OK: c_int = 1; ++ ++// sys/aio.h ++pub const LIO_NOP: c_int = 0; ++pub const LIO_READ: c_int = 1; ++pub const LIO_WRITE: c_int = 2; ++pub const LIO_NOWAIT: c_int = 0; ++pub const LIO_WAIT: c_int = 1; ++pub const AIO_ALLDONE: c_int = 2; ++pub const AIO_CANCELED: c_int = 0; ++pub const AIO_NOTCANCELED: c_int = 1; ++ ++// sys/errno.h ++pub const EPERM: c_int = 1; ++pub const ENOENT: c_int = 2; ++pub const ESRCH: c_int = 3; ++pub const EINTR: c_int = 4; ++pub const EIO: c_int = 5; ++pub const ENXIO: c_int = 6; ++pub const E2BIG: c_int = 7; ++pub const ENOEXEC: c_int = 8; ++pub const EBADF: c_int = 9; ++pub const ECHILD: c_int = 10; ++pub const EAGAIN: c_int = 11; ++pub const ENOMEM: c_int = 12; ++pub const EACCES: c_int = 13; ++pub const EFAULT: c_int = 14; ++pub const ENOTBLK: c_int = 15; ++pub const EBUSY: c_int = 16; ++pub const EEXIST: c_int = 17; ++pub const EXDEV: c_int = 18; ++pub const ENODEV: c_int = 19; ++pub const ENOTDIR: c_int = 20; ++pub const EISDIR: c_int = 21; ++pub const EINVAL: c_int = 22; ++pub const ENFILE: c_int = 23; ++pub const EMFILE: c_int = 24; ++pub const ENOTTY: c_int = 25; ++pub const ETXTBSY: c_int = 26; ++pub const EFBIG: c_int = 27; ++pub const ENOSPC: c_int = 28; ++pub const ESPIPE: c_int = 29; ++pub const EROFS: c_int = 30; ++pub const EMLINK: c_int = 31; ++pub const EPIPE: c_int = 32; ++pub const EDOM: c_int = 33; ++pub const ERANGE: c_int = 34; ++pub const ENOMSG: c_int = 35; ++pub const EIDRM: c_int = 36; ++pub const ECHRNG: c_int = 37; ++pub const EL2NSYNC: c_int = 38; ++pub const EL3HLT: c_int = 39; ++pub const EL3RST: c_int = 40; ++pub const ELNRNG: c_int = 41; ++pub const EUNATCH: c_int = 42; ++pub const ENOCSI: c_int = 43; ++pub const EL2HLT: c_int = 44; ++pub const EDEADLK: c_int = 45; ++pub const ENOLCK: c_int = 49; ++pub const ECANCELED: c_int = 117; ++pub const ENOTSUP: c_int = 124; ++pub const EPROCLIM: c_int = 83; ++pub const EDQUOT: c_int = 88; ++pub const EOWNERDEAD: c_int = 95; ++pub const ENOTRECOVERABLE: c_int = 94; ++pub const ENOSTR: c_int = 123; ++pub const ENODATA: c_int = 122; ++pub const ETIME: c_int = 119; ++pub const ENOSR: c_int = 118; ++pub const EREMOTE: c_int = 93; ++pub const ENOATTR: c_int = 112; ++pub const ESAD: c_int = 113; ++pub const ENOTRUST: c_int = 114; ++pub const ENOLINK: c_int = 126; ++pub const EPROTO: c_int = 121; ++pub const EMULTIHOP: c_int = 125; ++pub const EBADMSG: c_int = 120; ++pub const ENAMETOOLONG: c_int = 86; ++pub const EOVERFLOW: c_int = 127; ++pub const EILSEQ: c_int = 116; ++pub const ENOSYS: c_int = 109; ++pub const ELOOP: c_int = 85; ++pub const ERESTART: c_int = 82; ++pub const ENOTEMPTY: c_int = 87; ++pub const EUSERS: c_int = 84; ++pub const ENOTSOCK: c_int = 57; ++pub const EDESTADDRREQ: c_int = 58; ++pub const EMSGSIZE: c_int = 59; ++pub const EPROTOTYPE: c_int = 60; ++pub const ENOPROTOOPT: c_int = 61; ++pub const EPROTONOSUPPORT: c_int = 62; ++pub const ESOCKTNOSUPPORT: c_int = 63; ++pub const EOPNOTSUPP: c_int = 64; ++pub const EPFNOSUPPORT: c_int = 65; ++pub const EAFNOSUPPORT: c_int = 66; ++pub const EADDRINUSE: c_int = 67; ++pub const EADDRNOTAVAIL: c_int = 68; ++pub const ENETDOWN: c_int = 69; ++pub const ENETUNREACH: c_int = 70; ++pub const ENETRESET: c_int = 71; ++pub const ECONNABORTED: c_int = 72; ++pub const ECONNRESET: c_int = 73; ++pub const ENOBUFS: c_int = 74; ++pub const EISCONN: c_int = 75; ++pub const ENOTCONN: c_int = 76; ++pub const ESHUTDOWN: c_int = 77; ++pub const ETOOMANYREFS: c_int = 115; ++pub const ETIMEDOUT: c_int = 78; ++pub const ECONNREFUSED: c_int = 79; ++pub const EHOSTDOWN: c_int = 80; ++pub const EHOSTUNREACH: c_int = 81; ++pub const EWOULDBLOCK: c_int = EAGAIN; ++pub const EALREADY: c_int = 56; ++pub const EINPROGRESS: c_int = 55; ++pub const ESTALE: c_int = 52; ++ ++// sys/dr.h ++pub const LPAR_INFO_FORMAT1: c_int = 1; ++pub const LPAR_INFO_FORMAT2: c_int = 2; ++pub const WPAR_INFO_FORMAT: c_int = 3; ++pub const PROC_MODULE_INFO: c_int = 4; ++pub const NUM_PROC_MODULE_TYPES: c_int = 5; ++pub const LPAR_INFO_VRME_NUM_POOLS: c_int = 6; ++pub const LPAR_INFO_VRME_POOLS: c_int = 7; ++pub const LPAR_INFO_VRME_LPAR: c_int = 8; ++pub const LPAR_INFO_VRME_RESET_HWMARKS: c_int = 9; ++pub const LPAR_INFO_VRME_ALLOW_DESIRED: c_int = 10; ++pub const EMTP_INFO_FORMAT: c_int = 11; ++pub const LPAR_INFO_LPM_CAPABILITY: c_int = 12; ++pub const ENERGYSCALE_INFO: c_int = 13; ++ ++// sys/file.h ++pub const LOCK_SH: c_int = 1; ++pub const LOCK_EX: c_int = 2; ++pub const LOCK_NB: c_int = 4; ++pub const LOCK_UN: c_int = 8; ++ ++// sys/flock.h ++pub const F_RDLCK: c_short = 0o01; ++pub const F_WRLCK: c_short = 0o02; ++pub const F_UNLCK: c_short = 0o03; ++ ++// sys/fs/quota_common.h ++pub const Q_QUOTAON: c_int = 0x100; ++pub const Q_QUOTAOFF: c_int = 0x200; ++pub const Q_SETUSE: c_int = 0x500; ++pub const Q_SYNC: c_int = 0x600; ++pub const Q_GETQUOTA: c_int = 0x300; ++pub const Q_SETQLIM: c_int = 0x400; ++pub const Q_SETQUOTA: c_int = 0x400; ++ ++// sys/ioctl.h ++pub const IOCPARM_MASK: c_int = 0x7f; ++pub const IOC_VOID: c_int = 0x20000000; ++pub const IOC_OUT: c_int = 0x40000000; ++pub const IOC_IN: c_int = 0x40000000 << 1; ++pub const IOC_INOUT: c_int = IOC_IN | IOC_OUT; ++pub const FIOCLEX: c_int = 536897025; ++pub const FIONCLEX: c_int = 536897026; ++pub const FIONREAD: c_int = 1074030207; ++pub const FIONBIO: c_int = -2147195266; ++pub const FIOASYNC: c_int = -2147195267; ++pub const FIOSETOWN: c_int = -2147195268; ++pub const FIOGETOWN: c_int = 1074030203; ++pub const TIOCGETD: c_int = 0x40047400; ++pub const TIOCSETD: c_int = 0x80047401; ++pub const TIOCHPCL: c_int = 0x20007402; ++pub const TIOCMODG: c_int = 0x40047403; ++pub const TIOCMODS: c_int = 0x80047404; ++pub const TIOCM_LE: c_int = 0x1; ++pub const TIOCM_DTR: c_int = 0x2; ++pub const TIOCM_RTS: c_int = 0x4; ++pub const TIOCM_ST: c_int = 0x8; ++pub const TIOCM_SR: c_int = 0x10; ++pub const TIOCM_CTS: c_int = 0x20; ++pub const TIOCM_CAR: c_int = 0x40; ++pub const TIOCM_CD: c_int = 0x40; ++pub const TIOCM_RNG: c_int = 0x80; ++pub const TIOCM_RI: c_int = 0x80; ++pub const TIOCM_DSR: c_int = 0x100; ++pub const TIOCGETP: c_int = 0x40067408; ++pub const TIOCSETP: c_int = 0x80067409; ++pub const TIOCSETN: c_int = 0x8006740a; ++pub const TIOCEXCL: c_int = 0x2000740d; ++pub const TIOCNXCL: c_int = 0x2000740e; ++pub const TIOCFLUSH: c_int = 0x80047410; ++pub const TIOCSETC: c_int = 0x80067411; ++pub const TIOCGETC: c_int = 0x40067412; ++pub const TANDEM: c_int = 0x1; ++pub const CBREAK: c_int = 0x2; ++pub const LCASE: c_int = 0x4; ++pub const MDMBUF: c_int = 0x800000; ++pub const XTABS: c_int = 0xc00; ++pub const SIOCADDMULTI: c_int = -2145359567; ++pub const SIOCADDRT: c_int = -2143784438; ++pub const SIOCDARP: c_int = -2142476000; ++pub const SIOCDELMULTI: c_int = -2145359566; ++pub const SIOCDELRT: c_int = -2143784437; ++pub const SIOCDIFADDR: c_int = -2144835303; ++pub const SIOCGARP: c_int = -1068734170; ++pub const SIOCGIFADDR: c_int = -1071093471; ++pub const SIOCGIFBRDADDR: c_int = -1071093469; ++pub const SIOCGIFCONF: c_int = -1072666299; ++pub const SIOCGIFDSTADDR: c_int = -1071093470; ++pub const SIOCGIFFLAGS: c_int = -1071093487; ++pub const SIOCGIFHWADDR: c_int = -1068209771; ++pub const SIOCGIFMETRIC: c_int = -1071093481; ++pub const SIOCGIFMTU: c_int = -1071093418; ++pub const SIOCGIFNETMASK: c_int = -1071093467; ++pub const SIOCSARP: c_int = -2142476002; ++pub const SIOCSIFADDR: c_int = -2144835316; ++pub const SIOCSIFBRDADDR: c_int = -2144835309; ++pub const SIOCSIFDSTADDR: c_int = -2144835314; ++pub const SIOCSIFFLAGS: c_int = -2144835312; ++pub const SIOCSIFMETRIC: c_int = -2144835304; ++pub const SIOCSIFMTU: c_int = -2144835240; ++pub const SIOCSIFNETMASK: c_int = -2144835306; ++pub const TIOCUCNTL: c_int = -2147191706; ++pub const TIOCCONS: c_int = -2147191710; ++pub const TIOCPKT: c_int = -2147191696; ++pub const TIOCPKT_DATA: c_int = 0; ++pub const TIOCPKT_FLUSHREAD: c_int = 1; ++pub const TIOCPKT_FLUSHWRITE: c_int = 2; ++pub const TIOCPKT_NOSTOP: c_int = 0x10; ++pub const TIOCPKT_DOSTOP: c_int = 0x20; ++pub const TIOCPKT_START: c_int = 8; ++pub const TIOCPKT_STOP: c_int = 4; ++ ++// sys/ipc.h ++pub const IPC_ALLOC: c_int = 0o100000; ++pub const IPC_CREAT: c_int = 0o020000; ++pub const IPC_EXCL: c_int = 0o002000; ++pub const IPC_NOWAIT: c_int = 0o004000; ++pub const IPC_RMID: c_int = 0; ++pub const IPC_SET: c_int = 101; ++pub const IPC_R: c_int = 0o0400; ++pub const IPC_W: c_int = 0o0200; ++pub const IPC_O: c_int = 0o1000; ++pub const IPC_NOERROR: c_int = 0o10000; ++pub const IPC_STAT: c_int = 102; ++pub const IPC_PRIVATE: crate::key_t = -1; ++pub const SHM_LOCK: c_int = 201; ++pub const SHM_UNLOCK: c_int = 202; ++ ++// sys/ldr.h ++pub const L_GETINFO: c_int = 2; ++pub const L_GETMESSAGE: c_int = 1; ++pub const L_GETLIBPATH: c_int = 3; ++pub const L_GETXINFO: c_int = 8; ++ ++// sys/limits.h ++pub const PATH_MAX: c_int = 1023; ++pub const PAGESIZE: c_int = 4096; ++pub const IOV_MAX: c_int = 16; ++pub const AIO_LISTIO_MAX: c_int = 4096; ++pub const PIPE_BUF: usize = 32768; ++pub const OPEN_MAX: c_int = 65534; ++pub const MAX_INPUT: c_int = 512; ++pub const MAX_CANON: c_int = 256; ++pub const ARG_MAX: c_int = 1048576; ++pub const BC_BASE_MAX: c_int = 99; ++pub const BC_DIM_MAX: c_int = 0x800; ++pub const BC_SCALE_MAX: c_int = 99; ++pub const BC_STRING_MAX: c_int = 0x800; ++pub const CHARCLASS_NAME_MAX: c_int = 14; ++pub const CHILD_MAX: c_int = 128; ++pub const COLL_WEIGHTS_MAX: c_int = 4; ++pub const EXPR_NEST_MAX: c_int = 32; ++pub const NZERO: c_int = 20; ++ ++// sys/lockf.h ++pub const F_LOCK: c_int = 1; ++pub const F_TEST: c_int = 3; ++pub const F_TLOCK: c_int = 2; ++pub const F_ULOCK: c_int = 0; ++ ++// sys/machine.h ++pub const BIG_ENDIAN: c_int = 4321; ++pub const LITTLE_ENDIAN: c_int = 1234; ++pub const PDP_ENDIAN: c_int = 3412; ++ ++// sys/mman.h ++pub const PROT_NONE: c_int = 0; ++pub const PROT_READ: c_int = 1; ++pub const PROT_WRITE: c_int = 2; ++pub const PROT_EXEC: c_int = 4; ++pub const MAP_FILE: c_int = 0; ++pub const MAP_SHARED: c_int = 1; ++pub const MAP_PRIVATE: c_int = 2; ++pub const MAP_FIXED: c_int = 0x100; ++pub const MAP_ANON: c_int = 0x10; ++pub const MAP_ANONYMOUS: c_int = 0x10; ++pub const MAP_FAILED: *mut c_void = !0 as *mut c_void; ++pub const MAP_TYPE: c_int = 0xf0; ++pub const MCL_CURRENT: c_int = 0x100; ++pub const MCL_FUTURE: c_int = 0x200; ++pub const MS_SYNC: c_int = 0x20; ++pub const MS_ASYNC: c_int = 0x10; ++pub const MS_INVALIDATE: c_int = 0x40; ++pub const POSIX_MADV_NORMAL: c_int = 1; ++pub const POSIX_MADV_RANDOM: c_int = 3; ++pub const POSIX_MADV_SEQUENTIAL: c_int = 2; ++pub const POSIX_MADV_WILLNEED: c_int = 4; ++pub const POSIX_MADV_DONTNEED: c_int = 5; ++pub const MADV_NORMAL: c_int = 0; ++pub const MADV_RANDOM: c_int = 1; ++pub const MADV_SEQUENTIAL: c_int = 2; ++pub const MADV_WILLNEED: c_int = 3; ++pub const MADV_DONTNEED: c_int = 4; ++ ++// sys/mode.h ++pub const S_IFMT: mode_t = 0o17_0000; ++pub const S_IFREG: mode_t = 0o10_0000; ++pub const S_IFDIR: mode_t = 0o4_0000; ++pub const S_IFBLK: mode_t = 0o6_0000; ++pub const S_IFCHR: mode_t = 0o2_0000; ++pub const S_IFIFO: mode_t = 0o1_0000; ++pub const S_IRWXU: mode_t = 0o0700; ++pub const S_IRUSR: mode_t = 0o0400; ++pub const S_IWUSR: mode_t = 0o0200; ++pub const S_IXUSR: mode_t = 0o0100; ++pub const S_IRWXG: mode_t = 0o0070; ++pub const S_IRGRP: mode_t = 0o0040; ++pub const S_IWGRP: mode_t = 0o0020; ++pub const S_IXGRP: mode_t = 0o0010; ++pub const S_IRWXO: mode_t = 0o0007; ++pub const S_IROTH: mode_t = 0o0004; ++pub const S_IWOTH: mode_t = 0o0002; ++pub const S_IXOTH: mode_t = 0o0001; ++pub const S_IFLNK: mode_t = 0o12_0000; ++pub const S_IFSOCK: mode_t = 0o14_0000; ++pub const S_IEXEC: mode_t = 0o0100; ++pub const S_IWRITE: mode_t = 0o0200; ++pub const S_IREAD: mode_t = 0o0400; ++ ++// sys/msg.h ++pub const MSG_NOERROR: c_int = 0o10000; ++ ++// sys/m_signal.h ++pub const SIGSTKSZ: size_t = 4096; ++pub const MINSIGSTKSZ: size_t = 1200; ++ ++// sys/params.h ++pub const MAXPATHLEN: c_int = PATH_MAX + 1; ++pub const MAXSYMLINKS: c_int = 20; ++pub const MAXHOSTNAMELEN: c_int = 256; ++pub const MAXUPRC: c_int = 128; ++pub const NGROUPS_MAX: c_ulong = 2048; ++pub const NGROUPS: c_ulong = NGROUPS_MAX; ++pub const NOFILE: c_int = OPEN_MAX; ++ ++// sys/poll.h ++pub const POLLIN: c_short = 0x0001; ++pub const POLLPRI: c_short = 0x0004; ++pub const POLLOUT: c_short = 0x0002; ++pub const POLLERR: c_short = 0x4000; ++pub const POLLHUP: c_short = 0x2000; ++pub const POLLMSG: c_short = 0x0080; ++pub const POLLSYNC: c_short = 0x8000; ++pub const POLLNVAL: c_short = POLLSYNC; ++pub const POLLNORM: c_short = POLLIN; ++pub const POLLRDNORM: c_short = 0x0010; ++pub const POLLWRNORM: c_short = POLLOUT; ++pub const POLLRDBAND: c_short = 0x0020; ++pub const POLLWRBAND: c_short = 0x0040; ++ ++// sys/pollset.h ++pub const PS_ADD: c_uchar = 0; ++pub const PS_MOD: c_uchar = 1; ++pub const PS_DELETE: c_uchar = 2; ++pub const PS_REPLACE: c_uchar = 3; ++ ++// sys/ptrace.h ++pub const PT_TRACE_ME: c_int = 0; ++pub const PT_READ_I: c_int = 1; ++pub const PT_READ_D: c_int = 2; ++pub const PT_WRITE_I: c_int = 4; ++pub const PT_WRITE_D: c_int = 5; ++pub const PT_CONTINUE: c_int = 7; ++pub const PT_KILL: c_int = 8; ++pub const PT_STEP: c_int = 9; ++pub const PT_READ_GPR: c_int = 11; ++pub const PT_READ_FPR: c_int = 12; ++pub const PT_WRITE_GPR: c_int = 14; ++pub const PT_WRITE_FPR: c_int = 15; ++pub const PT_READ_BLOCK: c_int = 17; ++pub const PT_WRITE_BLOCK: c_int = 19; ++pub const PT_ATTACH: c_int = 30; ++pub const PT_DETACH: c_int = 31; ++pub const PT_REGSET: c_int = 32; ++pub const PT_REATT: c_int = 33; ++pub const PT_LDINFO: c_int = 34; ++pub const PT_MULTI: c_int = 35; ++pub const PT_NEXT: c_int = 36; ++pub const PT_SET: c_int = 37; ++pub const PT_CLEAR: c_int = 38; ++pub const PT_LDXINFO: c_int = 39; ++pub const PT_QUERY: c_int = 40; ++pub const PT_WATCH: c_int = 41; ++pub const PTT_CONTINUE: c_int = 50; ++pub const PTT_STEP: c_int = 51; ++pub const PTT_READ_SPRS: c_int = 52; ++pub const PTT_WRITE_SPRS: c_int = 53; ++pub const PTT_READ_GPRS: c_int = 54; ++pub const PTT_WRITE_GPRS: c_int = 55; ++pub const PTT_READ_FPRS: c_int = 56; ++pub const PTT_WRITE_FPRS: c_int = 57; ++pub const PTT_READ_VEC: c_int = 58; ++pub const PTT_WRITE_VEC: c_int = 59; ++pub const PTT_WATCH: c_int = 60; ++pub const PTT_SET_TRAP: c_int = 61; ++pub const PTT_CLEAR_TRAP: c_int = 62; ++pub const PTT_READ_UKEYSET: c_int = 63; ++pub const PT_GET_UKEY: c_int = 64; ++pub const PTT_READ_FPSCR_HI: c_int = 65; ++pub const PTT_WRITE_FPSCR_HI: c_int = 66; ++pub const PTT_READ_VSX: c_int = 67; ++pub const PTT_WRITE_VSX: c_int = 68; ++pub const PTT_READ_TM: c_int = 69; ++pub const PTRACE_ATTACH: c_int = 14; ++pub const PTRACE_CONT: c_int = 7; ++pub const PTRACE_DETACH: c_int = 15; ++pub const PTRACE_GETFPREGS: c_int = 12; ++pub const PTRACE_GETREGS: c_int = 10; ++pub const PTRACE_KILL: c_int = 8; ++pub const PTRACE_PEEKDATA: c_int = 2; ++pub const PTRACE_PEEKTEXT: c_int = 1; ++pub const PTRACE_PEEKUSER: c_int = 3; ++pub const PTRACE_POKEDATA: c_int = 5; ++pub const PTRACE_POKETEXT: c_int = 4; ++pub const PTRACE_POKEUSER: c_int = 6; ++pub const PTRACE_SETFPREGS: c_int = 13; ++pub const PTRACE_SETREGS: c_int = 11; ++pub const PTRACE_SINGLESTEP: c_int = 9; ++pub const PTRACE_SYSCALL: c_int = 16; ++pub const PTRACE_TRACEME: c_int = 0; ++ ++// sys/resource.h ++pub const RLIMIT_CPU: c_int = 0; ++pub const RLIMIT_FSIZE: c_int = 1; ++pub const RLIMIT_DATA: c_int = 2; ++pub const RLIMIT_STACK: c_int = 3; ++pub const RLIMIT_CORE: c_int = 4; ++pub const RLIMIT_RSS: c_int = 5; ++pub const RLIMIT_AS: c_int = 6; ++pub const RLIMIT_NOFILE: c_int = 7; ++pub const RLIMIT_THREADS: c_int = 8; ++pub const RLIMIT_NPROC: c_int = 9; ++pub const RUSAGE_SELF: c_int = 0; ++pub const RUSAGE_CHILDREN: c_int = -1; ++pub const PRIO_PROCESS: c_int = 0; ++pub const PRIO_PGRP: c_int = 1; ++pub const PRIO_USER: c_int = 2; ++pub const RUSAGE_THREAD: c_int = 1; ++pub const RLIM_SAVED_MAX: c_ulong = RLIM_INFINITY - 1; ++pub const RLIM_SAVED_CUR: c_ulong = RLIM_INFINITY - 2; ++#[deprecated(since = "0.2.64", note = "Not stable across OS versions")] ++pub const RLIM_NLIMITS: c_int = 10; ++ ++// sys/sched.h ++pub const SCHED_OTHER: c_int = 0; ++pub const SCHED_FIFO: c_int = 1; ++pub const SCHED_RR: c_int = 2; ++pub const SCHED_LOCAL: c_int = 3; ++pub const SCHED_GLOBAL: c_int = 4; ++pub const SCHED_FIFO2: c_int = 5; ++pub const SCHED_FIFO3: c_int = 6; ++pub const SCHED_FIFO4: c_int = 7; ++ ++// sys/sem.h ++pub const SEM_UNDO: c_int = 0o10000; ++pub const GETNCNT: c_int = 3; ++pub const GETPID: c_int = 4; ++pub const GETVAL: c_int = 5; ++pub const GETALL: c_int = 6; ++pub const GETZCNT: c_int = 7; ++pub const SETVAL: c_int = 8; ++pub const SETALL: c_int = 9; ++ ++// sys/shm.h ++pub const SHMLBA: c_int = 0x10000000; ++pub const SHMLBA_EXTSHM: c_int = 0x1000; ++pub const SHM_SHMAT: c_int = 0x80000000; ++pub const SHM_RDONLY: c_int = 0o10000; ++pub const SHM_RND: c_int = 0o20000; ++pub const SHM_PIN: c_int = 0o4000; ++pub const SHM_LGPAGE: c_int = 0o20000000000; ++pub const SHM_MAP: c_int = 0o4000; ++pub const SHM_FMAP: c_int = 0o2000; ++pub const SHM_COPY: c_int = 0o40000; ++pub const SHM_CLEAR: c_int = 0; ++pub const SHM_HGSEG: c_int = 0o10000000000; ++pub const SHM_R: c_int = IPC_R; ++pub const SHM_W: c_int = IPC_W; ++pub const SHM_DEST: c_int = 0o2000; ++ ++// sys/signal.h ++pub const SA_ONSTACK: c_int = 0x00000001; ++pub const SA_RESETHAND: c_int = 0x00000002; ++pub const SA_RESTART: c_int = 0x00000008; ++pub const SA_SIGINFO: c_int = 0x00000100; ++pub const SA_NODEFER: c_int = 0x00000200; ++pub const SA_NOCLDWAIT: c_int = 0x00000400; ++pub const SA_NOCLDSTOP: c_int = 0x00000004; ++pub const SS_ONSTACK: c_int = 0x00000001; ++pub const SS_DISABLE: c_int = 0x00000002; ++pub const SIGCHLD: c_int = 20; ++pub const SIGBUS: c_int = 10; ++pub const SIG_BLOCK: c_int = 0; ++pub const SIG_UNBLOCK: c_int = 1; ++pub const SIG_SETMASK: c_int = 2; ++pub const SIGEV_NONE: c_int = 1; ++pub const SIGEV_SIGNAL: c_int = 2; ++pub const SIGEV_THREAD: c_int = 3; ++pub const SIGHUP: c_int = 1; ++pub const SIGINT: c_int = 2; ++pub const SIGQUIT: c_int = 3; ++pub const SIGILL: c_int = 4; ++pub const SIGABRT: c_int = 6; ++pub const SIGEMT: c_int = 7; ++pub const SIGFPE: c_int = 8; ++pub const SIGKILL: c_int = 9; ++pub const SIGSEGV: c_int = 11; ++pub const SIGSYS: c_int = 12; ++pub const SIGPIPE: c_int = 13; ++pub const SIGALRM: c_int = 14; ++pub const SIGTERM: c_int = 15; ++pub const SIGUSR1: c_int = 30; ++pub const SIGUSR2: c_int = 31; ++pub const SIGPWR: c_int = 29; ++pub const SIGWINCH: c_int = 28; ++pub const SIGURG: c_int = 16; ++pub const SIGPOLL: c_int = SIGIO; ++pub const SIGIO: c_int = 23; ++pub const SIGSTOP: c_int = 17; ++pub const SIGTSTP: c_int = 18; ++pub const SIGCONT: c_int = 19; ++pub const SIGTTIN: c_int = 21; ++pub const SIGTTOU: c_int = 22; ++pub const SIGVTALRM: c_int = 34; ++pub const SIGPROF: c_int = 32; ++pub const SIGXCPU: c_int = 24; ++pub const SIGXFSZ: c_int = 25; ++pub const SIGTRAP: c_int = 5; ++pub const SIGCLD: c_int = 20; ++pub const SIGRTMAX: c_int = 57; ++pub const SIGRTMIN: c_int = 50; ++pub const SI_USER: c_int = 0; ++pub const SI_UNDEFINED: c_int = 8; ++pub const SI_EMPTY: c_int = 9; ++pub const BUS_ADRALN: c_int = 1; ++pub const BUS_ADRERR: c_int = 2; ++pub const BUS_OBJERR: c_int = 3; ++pub const BUS_UEGARD: c_int = 4; ++pub const CLD_EXITED: c_int = 10; ++pub const CLD_KILLED: c_int = 11; ++pub const CLD_DUMPED: c_int = 12; ++pub const CLD_TRAPPED: c_int = 13; ++pub const CLD_STOPPED: c_int = 14; ++pub const CLD_CONTINUED: c_int = 15; ++pub const FPE_INTDIV: c_int = 20; ++pub const FPE_INTOVF: c_int = 21; ++pub const FPE_FLTDIV: c_int = 22; ++pub const FPE_FLTOVF: c_int = 23; ++pub const FPE_FLTUND: c_int = 24; ++pub const FPE_FLTRES: c_int = 25; ++pub const FPE_FLTINV: c_int = 26; ++pub const FPE_FLTSUB: c_int = 27; ++pub const ILL_ILLOPC: c_int = 30; ++pub const ILL_ILLOPN: c_int = 31; ++pub const ILL_ILLADR: c_int = 32; ++pub const ILL_ILLTRP: c_int = 33; ++pub const ILL_PRVOPC: c_int = 34; ++pub const ILL_PRVREG: c_int = 35; ++pub const ILL_COPROC: c_int = 36; ++pub const ILL_BADSTK: c_int = 37; ++pub const ILL_TMBADTHING: c_int = 38; ++pub const POLL_IN: c_int = 40; ++pub const POLL_OUT: c_int = 41; ++pub const POLL_MSG: c_int = -3; ++pub const POLL_ERR: c_int = 43; ++pub const POLL_PRI: c_int = 44; ++pub const POLL_HUP: c_int = 45; ++pub const SEGV_MAPERR: c_int = 50; ++pub const SEGV_ACCERR: c_int = 51; ++pub const SEGV_KEYERR: c_int = 52; ++pub const TRAP_BRKPT: c_int = 60; ++pub const TRAP_TRACE: c_int = 61; ++pub const SI_QUEUE: c_int = 71; ++pub const SI_TIMER: c_int = 72; ++pub const SI_ASYNCIO: c_int = 73; ++pub const SI_MESGQ: c_int = 74; ++ ++// sys/socket.h ++pub const AF_UNSPEC: c_int = 0; ++pub const AF_UNIX: c_int = 1; ++pub const AF_INET: c_int = 2; ++pub const AF_IMPLINK: c_int = 3; ++pub const AF_PUP: c_int = 4; ++pub const AF_CHAOS: c_int = 5; ++pub const AF_NS: c_int = 6; ++pub const AF_ECMA: c_int = 8; ++pub const AF_DATAKIT: c_int = 9; ++pub const AF_CCITT: c_int = 10; ++pub const AF_SNA: c_int = 11; ++pub const AF_DECnet: c_int = 12; ++pub const AF_DLI: c_int = 13; ++pub const AF_LAT: c_int = 14; ++pub const SO_TIMESTAMPNS: c_int = 0x100a; ++pub const SOMAXCONN: c_int = 1024; ++pub const AF_LOCAL: c_int = AF_UNIX; ++pub const UIO_MAXIOV: c_int = 1024; ++pub const pseudo_AF_XTP: c_int = 19; ++pub const AF_HYLINK: c_int = 15; ++pub const AF_APPLETALK: c_int = 16; ++pub const AF_ISO: c_int = 7; ++pub const AF_OSI: c_int = AF_ISO; ++pub const AF_ROUTE: c_int = 17; ++pub const AF_LINK: c_int = 18; ++pub const AF_INET6: c_int = 24; ++pub const AF_INTF: c_int = 20; ++pub const AF_RIF: c_int = 21; ++pub const AF_NDD: c_int = 23; ++pub const AF_MAX: c_int = 30; ++pub const PF_UNSPEC: c_int = AF_UNSPEC; ++pub const PF_UNIX: c_int = AF_UNIX; ++pub const PF_INET: c_int = AF_INET; ++pub const PF_IMPLINK: c_int = AF_IMPLINK; ++pub const PF_PUP: c_int = AF_PUP; ++pub const PF_CHAOS: c_int = AF_CHAOS; ++pub const PF_NS: c_int = AF_NS; ++pub const PF_ISO: c_int = AF_ISO; ++pub const PF_OSI: c_int = AF_ISO; ++pub const PF_ECMA: c_int = AF_ECMA; ++pub const PF_DATAKIT: c_int = AF_DATAKIT; ++pub const PF_CCITT: c_int = AF_CCITT; ++pub const PF_SNA: c_int = AF_SNA; ++pub const PF_DECnet: c_int = AF_DECnet; ++pub const PF_DLI: c_int = AF_DLI; ++pub const PF_LAT: c_int = AF_LAT; ++pub const PF_HYLINK: c_int = AF_HYLINK; ++pub const PF_APPLETALK: c_int = AF_APPLETALK; ++pub const PF_ROUTE: c_int = AF_ROUTE; ++pub const PF_LINK: c_int = AF_LINK; ++pub const PF_XTP: c_int = 19; ++pub const PF_RIF: c_int = AF_RIF; ++pub const PF_INTF: c_int = AF_INTF; ++pub const PF_NDD: c_int = AF_NDD; ++pub const PF_INET6: c_int = AF_INET6; ++pub const PF_MAX: c_int = AF_MAX; ++pub const SF_CLOSE: c_int = 1; ++pub const SF_REUSE: c_int = 2; ++pub const SF_DONT_CACHE: c_int = 4; ++pub const SF_SYNC_CACHE: c_int = 8; ++pub const SOCK_DGRAM: c_int = 2; ++pub const SOCK_STREAM: c_int = 1; ++pub const SOCK_RAW: c_int = 3; ++pub const SOCK_RDM: c_int = 4; ++pub const SOCK_SEQPACKET: c_int = 5; ++pub const SOL_SOCKET: c_int = 0xffff; ++pub const SO_DEBUG: c_int = 0x0001; ++pub const SO_ACCEPTCONN: c_int = 0x0002; ++pub const SO_REUSEADDR: c_int = 0x0004; ++pub const SO_KEEPALIVE: c_int = 0x0008; ++pub const SO_DONTROUTE: c_int = 0x0010; ++pub const SO_BROADCAST: c_int = 0x0020; ++pub const SO_USELOOPBACK: c_int = 0x0040; ++pub const SO_LINGER: c_int = 0x0080; ++pub const SO_OOBINLINE: c_int = 0x0100; ++pub const SO_REUSEPORT: c_int = 0x0200; ++pub const SO_USE_IFBUFS: c_int = 0x0400; ++pub const SO_CKSUMRECV: c_int = 0x0800; ++pub const SO_NOREUSEADDR: c_int = 0x1000; ++pub const SO_KERNACCEPT: c_int = 0x2000; ++pub const SO_NOMULTIPATH: c_int = 0x4000; ++pub const SO_AUDIT: c_int = 0x8000; ++pub const SO_SNDBUF: c_int = 0x1001; ++pub const SO_RCVBUF: c_int = 0x1002; ++pub const SO_SNDLOWAT: c_int = 0x1003; ++pub const SO_RCVLOWAT: c_int = 0x1004; ++pub const SO_SNDTIMEO: c_int = 0x1005; ++pub const SO_RCVTIMEO: c_int = 0x1006; ++pub const SO_ERROR: c_int = 0x1007; ++pub const SO_TYPE: c_int = 0x1008; ++pub const SCM_RIGHTS: c_int = 0x01; ++pub const MSG_OOB: c_int = 0x1; ++pub const MSG_PEEK: c_int = 0x2; ++pub const MSG_DONTROUTE: c_int = 0x4; ++pub const MSG_EOR: c_int = 0x8; ++pub const MSG_TRUNC: c_int = 0x10; ++pub const MSG_CTRUNC: c_int = 0x20; ++pub const MSG_WAITALL: c_int = 0x40; ++pub const MSG_MPEG2: c_int = 0x80; ++pub const MSG_NOSIGNAL: c_int = 0x100; ++pub const MSG_WAITFORONE: c_int = 0x200; ++pub const MSG_ARGEXT: c_int = 0x400; ++pub const MSG_NONBLOCK: c_int = 0x4000; ++pub const MSG_COMPAT: c_int = 0x8000; ++pub const MSG_MAXIOVLEN: c_int = 16; ++pub const SHUT_RD: c_int = 0; ++pub const SHUT_WR: c_int = 1; ++pub const SHUT_RDWR: c_int = 2; ++ ++// sys/stat.h ++pub const UTIME_NOW: c_int = -2; ++pub const UTIME_OMIT: c_int = -3; ++ ++// sys/statvfs.h ++pub const ST_RDONLY: c_ulong = 0x0001; ++pub const ST_NOSUID: c_ulong = 0x0040; ++pub const ST_NODEV: c_ulong = 0x0080; ++ ++// sys/stropts.h ++pub const I_NREAD: c_int = 0x20005301; ++pub const I_PUSH: c_int = 0x20005302; ++pub const I_POP: c_int = 0x20005303; ++pub const I_LOOK: c_int = 0x20005304; ++pub const I_FLUSH: c_int = 0x20005305; ++pub const I_SRDOPT: c_int = 0x20005306; ++pub const I_GRDOPT: c_int = 0x20005307; ++pub const I_STR: c_int = 0x20005308; ++pub const I_SETSIG: c_int = 0x20005309; ++pub const I_GETSIG: c_int = 0x2000530a; ++pub const I_FIND: c_int = 0x2000530b; ++pub const I_LINK: c_int = 0x2000530c; ++pub const I_UNLINK: c_int = 0x2000530d; ++pub const I_PEEK: c_int = 0x2000530f; ++pub const I_FDINSERT: c_int = 0x20005310; ++pub const I_SENDFD: c_int = 0x20005311; ++pub const I_RECVFD: c_int = 0x20005312; ++pub const I_SWROPT: c_int = 0x20005314; ++pub const I_GWROPT: c_int = 0x20005315; ++pub const I_LIST: c_int = 0x20005316; ++pub const I_PLINK: c_int = 0x2000531d; ++pub const I_PUNLINK: c_int = 0x2000531e; ++pub const I_FLUSHBAND: c_int = 0x20005313; ++pub const I_CKBAND: c_int = 0x20005318; ++pub const I_GETBAND: c_int = 0x20005319; ++pub const I_ATMARK: c_int = 0x20005317; ++pub const I_SETCLTIME: c_int = 0x2000531b; ++pub const I_GETCLTIME: c_int = 0x2000531c; ++pub const I_CANPUT: c_int = 0x2000531a; ++ ++// sys/syslog.h ++pub const LOG_CRON: c_int = 9 << 3; ++pub const LOG_AUTHPRIV: c_int = 10 << 3; ++pub const LOG_NFACILITIES: c_int = 24; ++pub const LOG_PERROR: c_int = 0x20; ++ ++// sys/systemcfg.h ++pub const SC_ARCH: c_int = 1; ++pub const SC_IMPL: c_int = 2; ++pub const SC_VERS: c_int = 3; ++pub const SC_WIDTH: c_int = 4; ++pub const SC_NCPUS: c_int = 5; ++pub const SC_L1C_ATTR: c_int = 6; ++pub const SC_L1C_ISZ: c_int = 7; ++pub const SC_L1C_DSZ: c_int = 8; ++pub const SC_L1C_ICA: c_int = 9; ++pub const SC_L1C_DCA: c_int = 10; ++pub const SC_L1C_IBS: c_int = 11; ++pub const SC_L1C_DBS: c_int = 12; ++pub const SC_L1C_ILS: c_int = 13; ++pub const SC_L1C_DLS: c_int = 14; ++pub const SC_L2C_SZ: c_int = 15; ++pub const SC_L2C_AS: c_int = 16; ++pub const SC_TLB_ATTR: c_int = 17; ++pub const SC_ITLB_SZ: c_int = 18; ++pub const SC_DTLB_SZ: c_int = 19; ++pub const SC_ITLB_ATT: c_int = 20; ++pub const SC_DTLB_ATT: c_int = 21; ++pub const SC_RESRV_SZ: c_int = 22; ++pub const SC_PRI_LC: c_int = 23; ++pub const SC_PRO_LC: c_int = 24; ++pub const SC_RTC_TYPE: c_int = 25; ++pub const SC_VIRT_AL: c_int = 26; ++pub const SC_CAC_CONG: c_int = 27; ++pub const SC_MOD_ARCH: c_int = 28; ++pub const SC_MOD_IMPL: c_int = 29; ++pub const SC_XINT: c_int = 30; ++pub const SC_XFRAC: c_int = 31; ++pub const SC_KRN_ATTR: c_int = 32; ++pub const SC_PHYSMEM: c_int = 33; ++pub const SC_SLB_ATTR: c_int = 34; ++pub const SC_SLB_SZ: c_int = 35; ++pub const SC_MAX_NCPUS: c_int = 37; ++pub const SC_MAX_REALADDR: c_int = 38; ++pub const SC_ORIG_ENT_CAP: c_int = 39; ++pub const SC_ENT_CAP: c_int = 40; ++pub const SC_DISP_WHE: c_int = 41; ++pub const SC_CAPINC: c_int = 42; ++pub const SC_VCAPW: c_int = 43; ++pub const SC_SPLP_STAT: c_int = 44; ++pub const SC_SMT_STAT: c_int = 45; ++pub const SC_SMT_TC: c_int = 46; ++pub const SC_VMX_VER: c_int = 47; ++pub const SC_LMB_SZ: c_int = 48; ++pub const SC_MAX_XCPU: c_int = 49; ++pub const SC_EC_LVL: c_int = 50; ++pub const SC_AME_STAT: c_int = 51; ++pub const SC_ECO_STAT: c_int = 52; ++pub const SC_DFP_VER: c_int = 53; ++pub const SC_VRM_STAT: c_int = 54; ++pub const SC_PHYS_IMP: c_int = 55; ++pub const SC_PHYS_VER: c_int = 56; ++pub const SC_SPCM_STATUS: c_int = 57; ++pub const SC_SPCM_MAX: c_int = 58; ++pub const SC_TM_VER: c_int = 59; ++pub const SC_NX_CAP: c_int = 60; ++pub const SC_PKS_STATE: c_int = 61; ++pub const SC_MMA_VER: c_int = 62; ++pub const POWER_RS: c_int = 1; ++pub const POWER_PC: c_int = 2; ++pub const IA64: c_int = 3; ++pub const POWER_RS1: c_int = 0x1; ++pub const POWER_RSC: c_int = 0x2; ++pub const POWER_RS2: c_int = 0x4; ++pub const POWER_601: c_int = 0x8; ++pub const POWER_604: c_int = 0x10; ++pub const POWER_603: c_int = 0x20; ++pub const POWER_620: c_int = 0x40; ++pub const POWER_630: c_int = 0x80; ++pub const POWER_A35: c_int = 0x100; ++pub const POWER_RS64II: c_int = 0x200; ++pub const POWER_RS64III: c_int = 0x400; ++pub const POWER_4: c_int = 0x800; ++pub const POWER_RS64IV: c_int = POWER_4; ++pub const POWER_MPC7450: c_int = 0x1000; ++pub const POWER_5: c_int = 0x2000; ++pub const POWER_6: c_int = 0x4000; ++pub const POWER_7: c_int = 0x8000; ++pub const POWER_8: c_int = 0x10000; ++pub const POWER_9: c_int = 0x20000; ++ ++// sys/time.h ++pub const FD_SETSIZE: usize = 65534; ++pub const TIMEOFDAY: c_int = 9; ++pub const CLOCK_REALTIME: crate::clockid_t = TIMEOFDAY as clockid_t; ++pub const CLOCK_MONOTONIC: crate::clockid_t = 10; ++pub const TIMER_ABSTIME: c_int = 999; ++pub const ITIMER_REAL: c_int = 0; ++pub const ITIMER_VIRTUAL: c_int = 1; ++pub const ITIMER_PROF: c_int = 2; ++pub const ITIMER_VIRT: c_int = 3; ++pub const ITIMER_REAL1: c_int = 20; ++pub const ITIMER_REAL_TH: c_int = ITIMER_REAL1; ++pub const DST_AUST: c_int = 2; ++pub const DST_CAN: c_int = 6; ++pub const DST_EET: c_int = 5; ++pub const DST_MET: c_int = 4; ++pub const DST_NONE: c_int = 0; ++pub const DST_USA: c_int = 1; ++pub const DST_WET: c_int = 3; ++ ++// sys/termio.h ++pub const CSTART: crate::tcflag_t = 0o21; ++pub const CSTOP: crate::tcflag_t = 0o23; ++pub const TCGETA: c_int = TIOC | 5; ++pub const TCSETA: c_int = TIOC | 6; ++pub const TCSETAW: c_int = TIOC | 7; ++pub const TCSETAF: c_int = TIOC | 8; ++pub const TCSBRK: c_int = TIOC | 9; ++pub const TCXONC: c_int = TIOC | 11; ++pub const TCFLSH: c_int = TIOC | 12; ++pub const TCGETS: c_int = TIOC | 1; ++pub const TCSETS: c_int = TIOC | 2; ++pub const TCSANOW: c_int = 0; ++pub const TCSETSW: c_int = TIOC | 3; ++pub const TCSADRAIN: c_int = 1; ++pub const TCSETSF: c_int = TIOC | 4; ++pub const TCSAFLUSH: c_int = 2; ++pub const TCIFLUSH: c_int = 0; ++pub const TCOFLUSH: c_int = 1; ++pub const TCIOFLUSH: c_int = 2; ++pub const TCOOFF: c_int = 0; ++pub const TCOON: c_int = 1; ++pub const TCIOFF: c_int = 2; ++pub const TCION: c_int = 3; ++pub const TIOC: c_int = 0x5400; ++pub const TIOCGWINSZ: c_int = 0x40087468; ++pub const TIOCSWINSZ: c_int = 0x80087467; ++pub const TIOCLBIS: c_int = 0x8004747f; ++pub const TIOCLBIC: c_int = 0x8004747e; ++pub const TIOCLSET: c_int = 0x8004747d; ++pub const TIOCLGET: c_int = 0x4004747c; ++pub const TIOCSBRK: c_int = 0x2000747b; ++pub const TIOCCBRK: c_int = 0x2000747a; ++pub const TIOCSDTR: c_int = 0x20007479; ++pub const TIOCCDTR: c_int = 0x20007478; ++pub const TIOCSLTC: c_int = 0x80067475; ++pub const TIOCGLTC: c_int = 0x40067474; ++pub const TIOCOUTQ: c_int = 0x40047473; ++pub const TIOCNOTTY: c_int = 0x20007471; ++pub const TIOCSTOP: c_int = 0x2000746f; ++pub const TIOCSTART: c_int = 0x2000746e; ++pub const TIOCGPGRP: c_int = 0x40047477; ++pub const TIOCSPGRP: c_int = 0x80047476; ++pub const TIOCGSID: c_int = 0x40047448; ++pub const TIOCSTI: c_int = 0x80017472; ++pub const TIOCMSET: c_int = 0x8004746d; ++pub const TIOCMBIS: c_int = 0x8004746c; ++pub const TIOCMBIC: c_int = 0x8004746b; ++pub const TIOCMGET: c_int = 0x4004746a; ++pub const TIOCREMOTE: c_int = 0x80047469; ++ ++// sys/user.h ++pub const MAXCOMLEN: c_int = 32; ++pub const UF_SYSTEM: c_int = 0x1000; ++ ++// sys/vattr.h ++pub const AT_FLAGS: c_int = 0x80; ++pub const AT_GID: c_int = 8; ++pub const AT_UID: c_int = 4; ++ ++// sys/wait.h ++pub const P_ALL: c_int = 0; ++pub const P_PID: c_int = 1; ++pub const P_PGID: c_int = 2; ++pub const WNOHANG: c_int = 0x1; ++pub const WUNTRACED: c_int = 0x2; ++pub const WEXITED: c_int = 0x04; ++pub const WCONTINUED: c_int = 0x01000000; ++pub const WNOWAIT: c_int = 0x10; ++pub const WSTOPPED: c_int = _W_STOPPED; ++pub const _W_STOPPED: c_int = 0x00000040; ++pub const _W_SLWTED: c_int = 0x0000007c; ++pub const _W_SEWTED: c_int = 0x0000007d; ++pub const _W_SFWTED: c_int = 0x0000007e; ++pub const _W_STRC: c_int = 0x0000007f; ++ ++// termios.h ++pub const NCCS: usize = 16; ++pub const OLCUC: crate::tcflag_t = 2; ++pub const CSIZE: crate::tcflag_t = 0x00000030; ++pub const CS5: crate::tcflag_t = 0x00000000; ++pub const CS6: crate::tcflag_t = 0x00000010; ++pub const CS7: crate::tcflag_t = 0x00000020; ++pub const CS8: crate::tcflag_t = 0x00000030; ++pub const CSTOPB: crate::tcflag_t = 0x00000040; ++pub const ECHO: crate::tcflag_t = 0x20000; ++pub const ECHOE: crate::tcflag_t = 0x00000010; ++pub const ECHOK: crate::tcflag_t = 0x00000020; ++pub const ECHONL: crate::tcflag_t = 0x00000040; ++pub const ECHOCTL: crate::tcflag_t = 0x00020000; ++pub const ECHOPRT: crate::tcflag_t = 0x00040000; ++pub const ECHOKE: crate::tcflag_t = 0x00080000; ++pub const IGNBRK: crate::tcflag_t = 0x00000001; ++pub const BRKINT: crate::tcflag_t = 0x00000002; ++pub const IGNPAR: crate::tcflag_t = 0x00000004; ++pub const PARMRK: crate::tcflag_t = 0x00000008; ++pub const INPCK: crate::tcflag_t = 0x00000010; ++pub const ISTRIP: crate::tcflag_t = 0x00000020; ++pub const INLCR: crate::tcflag_t = 0x00000040; ++pub const IGNCR: crate::tcflag_t = 0x00000080; ++pub const ICRNL: crate::tcflag_t = 0x00000100; ++pub const IXON: crate::tcflag_t = 0x0001; ++pub const IXOFF: crate::tcflag_t = 0x00000400; ++pub const IXANY: crate::tcflag_t = 0x00001000; ++pub const IMAXBEL: crate::tcflag_t = 0x00010000; ++pub const OPOST: crate::tcflag_t = 0x00000001; ++pub const ONLCR: crate::tcflag_t = 0x00000004; ++pub const OCRNL: crate::tcflag_t = 0x00000008; ++pub const ONOCR: crate::tcflag_t = 0x00000010; ++pub const ONLRET: crate::tcflag_t = 0x00000020; ++pub const CREAD: crate::tcflag_t = 0x00000080; ++pub const IEXTEN: crate::tcflag_t = 0x00200000; ++pub const TOSTOP: crate::tcflag_t = 0x00010000; ++pub const FLUSHO: crate::tcflag_t = 0x00100000; ++pub const PENDIN: crate::tcflag_t = 0x20000000; ++pub const NOFLSH: crate::tcflag_t = 0x00000080; ++pub const VINTR: usize = 0; ++pub const VQUIT: usize = 1; ++pub const VERASE: usize = 2; ++pub const VKILL: usize = 3; ++pub const VEOF: usize = 4; ++pub const VEOL: usize = 5; ++pub const VSTART: usize = 7; ++pub const VSTOP: usize = 8; ++pub const VSUSP: usize = 9; ++pub const VMIN: usize = 4; ++pub const VTIME: usize = 5; ++pub const VEOL2: usize = 6; ++pub const VDSUSP: usize = 10; ++pub const VREPRINT: usize = 11; ++pub const VDISCRD: usize = 12; ++pub const VWERSE: usize = 13; ++pub const VLNEXT: usize = 14; ++pub const B0: crate::speed_t = 0x0; ++pub const B50: crate::speed_t = 0x1; ++pub const B75: crate::speed_t = 0x2; ++pub const B110: crate::speed_t = 0x3; ++pub const B134: crate::speed_t = 0x4; ++pub const B150: crate::speed_t = 0x5; ++pub const B200: crate::speed_t = 0x6; ++pub const B300: crate::speed_t = 0x7; ++pub const B600: crate::speed_t = 0x8; ++pub const B1200: crate::speed_t = 0x9; ++pub const B1800: crate::speed_t = 0xa; ++pub const B2400: crate::speed_t = 0xb; ++pub const B4800: crate::speed_t = 0xc; ++pub const B9600: crate::speed_t = 0xd; ++pub const B19200: crate::speed_t = 0xe; ++pub const B38400: crate::speed_t = 0xf; ++pub const EXTA: crate::speed_t = B19200; ++pub const EXTB: crate::speed_t = B38400; ++pub const IUCLC: crate::tcflag_t = 0x00000800; ++pub const OFILL: crate::tcflag_t = 0x00000040; ++pub const OFDEL: crate::tcflag_t = 0x00000080; ++pub const CRDLY: crate::tcflag_t = 0x00000300; ++pub const CR0: crate::tcflag_t = 0x00000000; ++pub const CR1: crate::tcflag_t = 0x00000100; ++pub const CR2: crate::tcflag_t = 0x00000200; ++pub const CR3: crate::tcflag_t = 0x00000300; ++pub const TABDLY: crate::tcflag_t = 0x00000c00; ++pub const TAB0: crate::tcflag_t = 0x00000000; ++pub const TAB1: crate::tcflag_t = 0x00000400; ++pub const TAB2: crate::tcflag_t = 0x00000800; ++pub const TAB3: crate::tcflag_t = 0x00000c00; ++pub const BSDLY: crate::tcflag_t = 0x00001000; ++pub const BS0: crate::tcflag_t = 0x00000000; ++pub const BS1: crate::tcflag_t = 0x00001000; ++pub const FFDLY: crate::tcflag_t = 0x00002000; ++pub const FF0: crate::tcflag_t = 0x00000000; ++pub const FF1: crate::tcflag_t = 0x00002000; ++pub const NLDLY: crate::tcflag_t = 0x00004000; ++pub const NL0: crate::tcflag_t = 0x00000000; ++pub const NL1: crate::tcflag_t = 0x00004000; ++pub const VTDLY: crate::tcflag_t = 0x00008000; ++pub const VT0: crate::tcflag_t = 0x00000000; ++pub const VT1: crate::tcflag_t = 0x00008000; ++pub const OXTABS: crate::tcflag_t = 0x00040000; ++pub const ONOEOT: crate::tcflag_t = 0x00080000; ++pub const CBAUD: crate::tcflag_t = 0x0000000f; ++pub const PARENB: crate::tcflag_t = 0x00000100; ++pub const PARODD: crate::tcflag_t = 0x00000200; ++pub const HUPCL: crate::tcflag_t = 0x00000400; ++pub const CLOCAL: crate::tcflag_t = 0x00000800; ++pub const CIBAUD: crate::tcflag_t = 0x000f0000; ++pub const IBSHIFT: crate::tcflag_t = 16; ++pub const PAREXT: crate::tcflag_t = 0x00100000; ++pub const ISIG: crate::tcflag_t = 0x00000001; ++pub const ICANON: crate::tcflag_t = 0x00000002; ++pub const XCASE: crate::tcflag_t = 0x00000004; ++pub const ALTWERASE: crate::tcflag_t = 0x00400000; ++ ++// time.h ++pub const CLOCK_PROCESS_CPUTIME_ID: crate::clockid_t = 11; ++pub const CLOCK_THREAD_CPUTIME_ID: crate::clockid_t = 12; ++ ++// unistd.h ++pub const STDIN_FILENO: c_int = 0; ++pub const STDOUT_FILENO: c_int = 1; ++pub const STDERR_FILENO: c_int = 2; ++pub const _POSIX_VDISABLE: c_int = 0xff; ++pub const _PC_LINK_MAX: c_int = 11; ++pub const _PC_MAX_CANON: c_int = 12; ++pub const _PC_MAX_INPUT: c_int = 13; ++pub const _PC_NAME_MAX: c_int = 14; ++pub const _PC_PATH_MAX: c_int = 16; ++pub const _PC_PIPE_BUF: c_int = 17; ++pub const _PC_NO_TRUNC: c_int = 15; ++pub const _PC_VDISABLE: c_int = 18; ++pub const _PC_CHOWN_RESTRICTED: c_int = 10; ++pub const _PC_ASYNC_IO: c_int = 19; ++pub const _PC_PRIO_IO: c_int = 21; ++pub const _PC_SYNC_IO: c_int = 20; ++pub const _PC_ALLOC_SIZE_MIN: c_int = 26; ++pub const _PC_REC_INCR_XFER_SIZE: c_int = 27; ++pub const _PC_REC_MAX_XFER_SIZE: c_int = 28; ++pub const _PC_REC_MIN_XFER_SIZE: c_int = 29; ++pub const _PC_REC_XFER_ALIGN: c_int = 30; ++pub const _PC_SYMLINK_MAX: c_int = 25; ++pub const _PC_2_SYMLINKS: c_int = 31; ++pub const _PC_TIMESTAMP_RESOLUTION: c_int = 32; ++pub const _PC_FILESIZEBITS: c_int = 22; ++pub const _SC_ARG_MAX: c_int = 0; ++pub const _SC_CHILD_MAX: c_int = 1; ++pub const _SC_CLK_TCK: c_int = 2; ++pub const _SC_NGROUPS_MAX: c_int = 3; ++pub const _SC_OPEN_MAX: c_int = 4; ++pub const _SC_JOB_CONTROL: c_int = 7; ++pub const _SC_SAVED_IDS: c_int = 8; ++pub const _SC_VERSION: c_int = 9; ++pub const _SC_PASS_MAX: c_int = 45; ++pub const _SC_PAGESIZE: c_int = _SC_PAGE_SIZE; ++pub const _SC_PAGE_SIZE: c_int = 48; ++pub const _SC_XOPEN_VERSION: c_int = 46; ++pub const _SC_NPROCESSORS_CONF: c_int = 71; ++pub const _SC_NPROCESSORS_ONLN: c_int = 72; ++pub const _SC_STREAM_MAX: c_int = 5; ++pub const _SC_TZNAME_MAX: c_int = 6; ++pub const _SC_AIO_LISTIO_MAX: c_int = 75; ++pub const _SC_AIO_MAX: c_int = 76; ++pub const _SC_AIO_PRIO_DELTA_MAX: c_int = 77; ++pub const _SC_ASYNCHRONOUS_IO: c_int = 78; ++pub const _SC_DELAYTIMER_MAX: c_int = 79; ++pub const _SC_FSYNC: c_int = 80; ++pub const _SC_MAPPED_FILES: c_int = 84; ++pub const _SC_MEMLOCK: c_int = 85; ++pub const _SC_MEMLOCK_RANGE: c_int = 86; ++pub const _SC_MEMORY_PROTECTION: c_int = 87; ++pub const _SC_MESSAGE_PASSING: c_int = 88; ++pub const _SC_MQ_OPEN_MAX: c_int = 89; ++pub const _SC_MQ_PRIO_MAX: c_int = 90; ++pub const _SC_PRIORITIZED_IO: c_int = 91; ++pub const _SC_PRIORITY_SCHEDULING: c_int = 92; ++pub const _SC_REALTIME_SIGNALS: c_int = 93; ++pub const _SC_RTSIG_MAX: c_int = 94; ++pub const _SC_SEMAPHORES: c_int = 95; ++pub const _SC_SEM_NSEMS_MAX: c_int = 96; ++pub const _SC_SEM_VALUE_MAX: c_int = 97; ++pub const _SC_SHARED_MEMORY_OBJECTS: c_int = 98; ++pub const _SC_SIGQUEUE_MAX: c_int = 99; ++pub const _SC_SYNCHRONIZED_IO: c_int = 100; ++pub const _SC_TIMERS: c_int = 102; ++pub const _SC_TIMER_MAX: c_int = 103; ++pub const _SC_2_C_BIND: c_int = 51; ++pub const _SC_2_C_DEV: c_int = 32; ++pub const _SC_2_C_VERSION: c_int = 52; ++pub const _SC_2_FORT_DEV: c_int = 33; ++pub const _SC_2_FORT_RUN: c_int = 34; ++pub const _SC_2_LOCALEDEF: c_int = 35; ++pub const _SC_2_SW_DEV: c_int = 36; ++pub const _SC_2_UPE: c_int = 53; ++pub const _SC_2_VERSION: c_int = 31; ++pub const _SC_BC_BASE_MAX: c_int = 23; ++pub const _SC_BC_DIM_MAX: c_int = 24; ++pub const _SC_BC_SCALE_MAX: c_int = 25; ++pub const _SC_BC_STRING_MAX: c_int = 26; ++pub const _SC_COLL_WEIGHTS_MAX: c_int = 50; ++pub const _SC_EXPR_NEST_MAX: c_int = 28; ++pub const _SC_LINE_MAX: c_int = 29; ++pub const _SC_RE_DUP_MAX: c_int = 30; ++pub const _SC_XOPEN_CRYPT: c_int = 56; ++pub const _SC_XOPEN_ENH_I18N: c_int = 57; ++pub const _SC_XOPEN_SHM: c_int = 55; ++pub const _SC_2_CHAR_TERM: c_int = 54; ++pub const _SC_XOPEN_XCU_VERSION: c_int = 109; ++pub const _SC_ATEXIT_MAX: c_int = 47; ++pub const _SC_IOV_MAX: c_int = 58; ++pub const _SC_XOPEN_UNIX: c_int = 73; ++pub const _SC_T_IOV_MAX: c_int = 0; ++pub const _SC_PHYS_PAGES: c_int = 113; ++pub const _SC_AVPHYS_PAGES: c_int = 114; ++pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: c_int = 101; ++pub const _SC_GETGR_R_SIZE_MAX: c_int = 81; ++pub const _SC_GETPW_R_SIZE_MAX: c_int = 82; ++pub const _SC_LOGIN_NAME_MAX: c_int = 83; ++pub const _SC_THREAD_KEYS_MAX: c_int = 68; ++pub const _SC_THREAD_STACK_MIN: c_int = 69; ++pub const _SC_THREAD_THREADS_MAX: c_int = 70; ++pub const _SC_TTY_NAME_MAX: c_int = 104; ++pub const _SC_THREADS: c_int = 60; ++pub const _SC_THREAD_ATTR_STACKADDR: c_int = 61; ++pub const _SC_THREAD_ATTR_STACKSIZE: c_int = 62; ++pub const _SC_THREAD_PRIORITY_SCHEDULING: c_int = 64; ++pub const _SC_THREAD_PRIO_INHERIT: c_int = 65; ++pub const _SC_THREAD_PRIO_PROTECT: c_int = 66; ++pub const _SC_THREAD_PROCESS_SHARED: c_int = 67; ++pub const _SC_THREAD_SAFE_FUNCTIONS: c_int = 59; ++pub const _SC_XOPEN_LEGACY: c_int = 112; ++pub const _SC_XOPEN_REALTIME: c_int = 110; ++pub const _SC_XOPEN_REALTIME_THREADS: c_int = 111; ++pub const _SC_XBS5_ILP32_OFF32: c_int = 105; ++pub const _SC_XBS5_ILP32_OFFBIG: c_int = 106; ++pub const _SC_XBS5_LP64_OFF64: c_int = 107; ++pub const _SC_XBS5_LPBIG_OFFBIG: c_int = 108; ++pub const _SC_2_PBS: c_int = 132; ++pub const _SC_2_PBS_ACCOUNTING: c_int = 133; ++pub const _SC_2_PBS_CHECKPOINT: c_int = 134; ++pub const _SC_2_PBS_LOCATE: c_int = 135; ++pub const _SC_2_PBS_MESSAGE: c_int = 136; ++pub const _SC_2_PBS_TRACK: c_int = 137; ++pub const _SC_ADVISORY_INFO: c_int = 130; ++pub const _SC_BARRIERS: c_int = 138; ++pub const _SC_CLOCK_SELECTION: c_int = 139; ++pub const _SC_CPUTIME: c_int = 140; ++pub const _SC_HOST_NAME_MAX: c_int = 126; ++pub const _SC_MONOTONIC_CLOCK: c_int = 141; ++pub const _SC_READER_WRITER_LOCKS: c_int = 142; ++pub const _SC_REGEXP: c_int = 127; ++pub const _SC_SHELL: c_int = 128; ++pub const _SC_SPAWN: c_int = 143; ++pub const _SC_SPIN_LOCKS: c_int = 144; ++pub const _SC_SPORADIC_SERVER: c_int = 145; ++pub const _SC_SS_REPL_MAX: c_int = 156; ++pub const _SC_SYMLOOP_MAX: c_int = 129; ++pub const _SC_THREAD_CPUTIME: c_int = 146; ++pub const _SC_THREAD_SPORADIC_SERVER: c_int = 147; ++pub const _SC_TIMEOUTS: c_int = 148; ++pub const _SC_TRACE: c_int = 149; ++pub const _SC_TRACE_EVENT_FILTER: c_int = 150; ++pub const _SC_TRACE_EVENT_NAME_MAX: c_int = 157; ++pub const _SC_TRACE_INHERIT: c_int = 151; ++pub const _SC_TRACE_LOG: c_int = 152; ++pub const _SC_TRACE_NAME_MAX: c_int = 158; ++pub const _SC_TRACE_SYS_MAX: c_int = 159; ++pub const _SC_TRACE_USER_EVENT_MAX: c_int = 160; ++pub const _SC_TYPED_MEMORY_OBJECTS: c_int = 153; ++pub const _SC_V6_ILP32_OFF32: c_int = 121; ++pub const _SC_V6_ILP32_OFFBIG: c_int = 122; ++pub const _SC_V6_LP64_OFF64: c_int = 123; ++pub const _SC_V6_LPBIG_OFFBIG: c_int = 124; ++pub const _SC_XOPEN_STREAMS: c_int = 125; ++pub const _SC_IPV6: c_int = 154; ++pub const _SC_RAW_SOCKETS: c_int = 155; ++ ++// utmp.h ++pub const EMPTY: c_short = -1; ++pub const RUN_LVL: c_short = 1; ++pub const BOOT_TIME: c_short = 2; ++pub const OLD_TIME: c_short = 3; ++pub const NEW_TIME: c_short = 4; ++pub const INIT_PROCESS: c_short = 5; ++pub const LOGIN_PROCESS: c_short = 6; ++pub const USER_PROCESS: c_short = 7; ++pub const DEAD_PROCESS: c_short = 8; ++pub const ACCOUNTING: c_short = 9; ++ ++f! { ++ pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr { ++ if (*mhdr).msg_controllen as usize >= mem::size_of::() { ++ (*mhdr).msg_control as *mut cmsghdr ++ } else { ++ 0 as *mut cmsghdr ++ } ++ } ++ ++ pub fn CMSG_NXTHDR(mhdr: *const msghdr, cmsg: *const cmsghdr) -> *mut cmsghdr { ++ if cmsg.is_null() { ++ CMSG_FIRSTHDR(mhdr) ++ } else { ++ if (cmsg as usize + (*cmsg).cmsg_len as usize + mem::size_of::()) ++ > ((*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize) ++ { ++ 0 as *mut cmsghdr ++ } else { ++ // AIX does not have any alignment/padding for ancillary data, so we don't need _CMSG_ALIGN here. ++ (cmsg as usize + (*cmsg).cmsg_len as usize) as *mut cmsghdr ++ } ++ } ++ } ++ ++ pub fn CMSG_DATA(cmsg: *const cmsghdr) -> *mut c_uchar { ++ (cmsg as *mut c_uchar).offset(mem::size_of::() as isize) ++ } ++ ++ pub {const} fn CMSG_LEN(length: c_uint) -> c_uint { ++ mem::size_of::() as c_uint + length ++ } ++ ++ pub {const} fn CMSG_SPACE(length: c_uint) -> c_uint { ++ mem::size_of::() as c_uint + length ++ } ++ ++ pub fn FD_ZERO(set: *mut fd_set) -> () { ++ for slot in (*set).fds_bits.iter_mut() { ++ *slot = 0; ++ } ++ } ++ ++ pub fn FD_SET(fd: c_int, set: *mut fd_set) -> () { ++ let bits = mem::size_of::() * 8; ++ let fd = fd as usize; ++ (*set).fds_bits[fd / bits] |= 1 << (fd % bits); ++ return; ++ } ++ ++ pub fn FD_CLR(fd: c_int, set: *mut fd_set) -> () { ++ let bits = mem::size_of::() * 8; ++ let fd = fd as usize; ++ (*set).fds_bits[fd / bits] &= !(1 << (fd % bits)); ++ return; ++ } ++ ++ pub fn FD_ISSET(fd: c_int, set: *const fd_set) -> bool { ++ let bits = mem::size_of::() * 8; ++ let fd = fd as usize; ++ return ((*set).fds_bits[fd / bits] & (1 << (fd % bits))) != 0; ++ } ++ ++ pub fn major(dev: crate::dev_t) -> c_uint { ++ let x = dev >> 16; ++ x as c_uint ++ } ++ ++ pub fn minor(dev: crate::dev_t) -> c_uint { ++ let y = dev & 0xFFFF; ++ y as c_uint ++ } ++ ++ pub fn makedev(major: c_uint, minor: c_uint) -> crate::dev_t { ++ let major = major as crate::dev_t; ++ let minor = minor as crate::dev_t; ++ let mut dev = 0; ++ dev |= major << 16; ++ dev |= minor; ++ dev ++ } ++} ++ ++safe_f! { ++ pub {const} fn WIFSTOPPED(status: c_int) -> bool { ++ (status & _W_STOPPED) != 0 ++ } ++ ++ pub {const} fn WSTOPSIG(status: c_int) -> c_int { ++ if WIFSTOPPED(status) { ++ (((status as c_uint) >> 8) & 0xff) as c_int ++ } else { ++ -1 ++ } ++ } ++ ++ pub {const} fn WIFEXITED(status: c_int) -> bool { ++ (status & 0xFF) == 0 ++ } ++ ++ pub {const} fn WEXITSTATUS(status: c_int) -> c_int { ++ if WIFEXITED(status) { ++ (((status as c_uint) >> 8) & 0xff) as c_int ++ } else { ++ -1 ++ } ++ } ++ ++ pub {const} fn WIFSIGNALED(status: c_int) -> bool { ++ !WIFEXITED(status) && !WIFSTOPPED(status) ++ } ++ ++ pub {const} fn WTERMSIG(status: c_int) -> c_int { ++ if WIFSIGNALED(status) { ++ (((status as c_uint) >> 16) & 0xff) as c_int ++ } else { ++ -1 ++ } ++ } ++ ++ pub {const} fn WIFCONTINUED(status: c_int) -> bool { ++ (status & WCONTINUED) != 0 ++ } ++ ++ // AIX doesn't have native WCOREDUMP. ++ pub {const} fn WCOREDUMP(_status: c_int) -> bool { ++ false ++ } ++} ++ ++#[link(name = "thread")] ++extern "C" { ++ pub fn thr_kill(id: thread_t, sig: c_int) -> c_int; ++ pub fn thr_self() -> thread_t; ++} ++ ++#[link(name = "pthread")] ++extern "C" { ++ pub fn pthread_atfork( ++ prepare: Option, ++ parent: Option, ++ child: Option, ++ ) -> c_int; ++ pub fn pthread_attr_getguardsize( ++ attr: *const crate::pthread_attr_t, ++ guardsize: *mut size_t, ++ ) -> c_int; ++ pub fn pthread_attr_setguardsize(attr: *mut crate::pthread_attr_t, guardsize: size_t) -> c_int; ++ pub fn pthread_attr_getschedparam( ++ attr: *const crate::pthread_attr_t, ++ param: *mut sched_param, ++ ) -> c_int; ++ pub fn pthread_attr_getstack( ++ attr: *const crate::pthread_attr_t, ++ stackaddr: *mut *mut c_void, ++ stacksize: *mut size_t, ++ ) -> c_int; ++ pub fn pthread_attr_setschedparam( ++ attr: *mut crate::pthread_attr_t, ++ param: *const sched_param, ++ ) -> c_int; ++ pub fn pthread_barrier_destroy(barrier: *mut pthread_barrier_t) -> c_int; ++ pub fn pthread_barrier_init( ++ barrier: *mut pthread_barrier_t, ++ attr: *const crate::pthread_barrierattr_t, ++ count: c_uint, ++ ) -> c_int; ++ pub fn pthread_barrier_wait(barrier: *mut pthread_barrier_t) -> c_int; ++ pub fn pthread_barrierattr_destroy(attr: *mut crate::pthread_barrierattr_t) -> c_int; ++ pub fn pthread_barrierattr_getpshared( ++ attr: *const crate::pthread_barrierattr_t, ++ shared: *mut c_int, ++ ) -> c_int; ++ pub fn pthread_barrierattr_init(attr: *mut crate::pthread_barrierattr_t) -> c_int; ++ pub fn pthread_barrierattr_setpshared( ++ attr: *mut crate::pthread_barrierattr_t, ++ shared: c_int, ++ ) -> c_int; ++ pub fn pthread_cancel(thread: crate::pthread_t) -> c_int; ++ pub fn pthread_condattr_getclock( ++ attr: *const pthread_condattr_t, ++ clock_id: *mut clockid_t, ++ ) -> c_int; ++ pub fn pthread_condattr_getpshared( ++ attr: *const pthread_condattr_t, ++ pshared: *mut c_int, ++ ) -> c_int; ++ pub fn pthread_condattr_setclock( ++ attr: *mut pthread_condattr_t, ++ clock_id: crate::clockid_t, ++ ) -> c_int; ++ pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t, pshared: c_int) -> c_int; ++ pub fn pthread_create( ++ native: *mut crate::pthread_t, ++ attr: *const crate::pthread_attr_t, ++ f: extern "C" fn(*mut c_void) -> *mut c_void, ++ value: *mut c_void, ++ ) -> c_int; ++ pub fn pthread_getattr_np(native: crate::pthread_t, attr: *mut crate::pthread_attr_t) -> c_int; ++ pub fn pthread_getcpuclockid(thread: crate::pthread_t, clk_id: *mut crate::clockid_t) -> c_int; ++ pub fn pthread_getschedparam( ++ thread: crate::pthread_t, ++ policy: *mut c_int, ++ param: *mut sched_param, ++ ) -> c_int; ++ pub fn pthread_kill(thread: crate::pthread_t, signal: c_int) -> c_int; ++ pub fn pthread_mutex_consistent(mutex: *mut crate::pthread_mutex_t) -> c_int; ++ pub fn pthread_mutex_timedlock( ++ lock: *mut pthread_mutex_t, ++ abstime: *const crate::timespec, ++ ) -> c_int; ++ pub fn pthread_mutexattr_getprotocol( ++ attr: *const pthread_mutexattr_t, ++ protocol: *mut c_int, ++ ) -> c_int; ++ pub fn pthread_mutexattr_getpshared( ++ attr: *const pthread_mutexattr_t, ++ pshared: *mut c_int, ++ ) -> c_int; ++ pub fn pthread_mutexattr_getrobust( ++ attr: *mut crate::pthread_mutexattr_t, ++ robust: *mut c_int, ++ ) -> c_int; ++ pub fn pthread_mutexattr_setprotocol(attr: *mut pthread_mutexattr_t, protocol: c_int) -> c_int; ++ pub fn pthread_mutexattr_setpshared(attr: *mut pthread_mutexattr_t, pshared: c_int) -> c_int; ++ pub fn pthread_mutexattr_setrobust( ++ attr: *mut crate::pthread_mutexattr_t, ++ robust: c_int, ++ ) -> c_int; ++ pub fn pthread_rwlockattr_getpshared( ++ attr: *const pthread_rwlockattr_t, ++ val: *mut c_int, ++ ) -> c_int; ++ pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, val: c_int) -> c_int; ++ pub fn pthread_setschedparam( ++ thread: crate::pthread_t, ++ policy: c_int, ++ param: *const sched_param, ++ ) -> c_int; ++ pub fn pthread_setschedprio(native: crate::pthread_t, priority: c_int) -> c_int; ++ pub fn pthread_sigmask(how: c_int, set: *const sigset_t, oldset: *mut sigset_t) -> c_int; ++ pub fn pthread_spin_destroy(lock: *mut pthread_spinlock_t) -> c_int; ++ pub fn pthread_spin_init(lock: *mut pthread_spinlock_t, pshared: c_int) -> c_int; ++ pub fn pthread_spin_lock(lock: *mut pthread_spinlock_t) -> c_int; ++ pub fn pthread_spin_trylock(lock: *mut pthread_spinlock_t) -> c_int; ++ pub fn pthread_spin_unlock(lock: *mut pthread_spinlock_t) -> c_int; ++} ++ ++#[link(name = "iconv")] ++extern "C" { ++ pub fn iconv( ++ cd: iconv_t, ++ inbuf: *mut *mut c_char, ++ inbytesleft: *mut size_t, ++ outbuf: *mut *mut c_char, ++ outbytesleft: *mut size_t, ++ ) -> size_t; ++ pub fn iconv_close(cd: iconv_t) -> c_int; ++ pub fn iconv_open(tocode: *const c_char, fromcode: *const c_char) -> iconv_t; ++} ++ ++extern "C" { ++ pub fn acct(filename: *const c_char) -> c_int; ++ pub fn aio_cancel(fildes: c_int, aiocbp: *mut crate::aiocb) -> c_int; ++ pub fn aio_error(aiocbp: *mut crate::aiocb) -> c_int; ++ #[link_name = "_posix_aio_fsync"] ++ pub fn aio_fsync(op: c_int, aiocbp: *mut crate::aiocb) -> c_int; ++ pub fn aio_read(aiocbp: *mut crate::aiocb) -> c_int; ++ // pub fn aio_suspend ++ // pub fn aio_write ++ pub fn basename(path: *mut c_char) -> *mut c_char; ++ pub fn bind( ++ socket: c_int, ++ address: *const crate::sockaddr, ++ address_len: crate::socklen_t, ++ ) -> c_int; ++ pub fn brk(addr: *mut c_void) -> c_int; ++ pub fn clearenv() -> c_int; ++ pub fn clock_getcpuclockid(pid: crate::pid_t, clk_id: *mut crate::clockid_t) -> c_int; ++ pub fn clock_getres(clk_id: crate::clockid_t, tp: *mut crate::timespec) -> c_int; ++ pub fn clock_gettime(clk_id: crate::clockid_t, tp: *mut crate::timespec) -> c_int; ++ pub fn clock_nanosleep( ++ clk_id: crate::clockid_t, ++ flags: c_int, ++ rqtp: *const crate::timespec, ++ rmtp: *mut crate::timespec, ++ ) -> c_int; ++ pub fn clock_settime(clock_id: crate::clockid_t, tp: *const crate::timespec) -> c_int; ++ pub fn creat64(path: *const c_char, mode: mode_t) -> c_int; ++ pub fn ctermid(s: *mut c_char) -> *mut c_char; ++ pub fn dirfd(dirp: *mut crate::DIR) -> c_int; ++ pub fn dirname(path: *mut c_char) -> *mut c_char; ++ pub fn drand48() -> c_double; ++ pub fn duplocale(arg1: crate::locale_t) -> crate::locale_t; ++ pub fn endgrent(); ++ pub fn endmntent(streamp: *mut crate::FILE) -> c_int; ++ pub fn endpwent(); ++ pub fn endutent(); ++ pub fn endutxent(); ++ pub fn erand48(xseed: *mut c_ushort) -> c_double; ++ pub fn faccessat(dirfd: c_int, pathname: *const c_char, mode: c_int, flags: c_int) -> c_int; ++ pub fn fattach(fildes: c_int, path: *const c_char) -> c_int; ++ pub fn fdatasync(fd: c_int) -> c_int; ++ ++ // DIFF(main): changed to `*const *mut` in e77f551de9 ++ pub fn fexecve(fd: c_int, argv: *const *const c_char, envp: *const *const c_char) -> c_int; ++ ++ pub fn ffs(value: c_int) -> c_int; ++ pub fn ffsl(value: c_long) -> c_int; ++ pub fn ffsll(value: c_longlong) -> c_int; ++ pub fn fgetgrent(file: *mut crate::FILE) -> *mut crate::group; ++ pub fn fgetpos64(stream: *mut crate::FILE, ptr: *mut fpos64_t) -> c_int; ++ pub fn fgetpwent(file: *mut crate::FILE) -> *mut crate::passwd; ++ pub fn fopen64(filename: *const c_char, mode: *const c_char) -> *mut crate::FILE; ++ pub fn freelocale(loc: crate::locale_t); ++ pub fn freopen64( ++ filename: *const c_char, ++ mode: *const c_char, ++ file: *mut crate::FILE, ++ ) -> *mut crate::FILE; ++ pub fn fseeko64(stream: *mut crate::FILE, offset: off64_t, whence: c_int) -> c_int; ++ pub fn fsetpos64(stream: *mut crate::FILE, ptr: *const fpos64_t) -> c_int; ++ pub fn fstat64(fildes: c_int, buf: *mut stat64) -> c_int; ++ pub fn fstatfs(fd: c_int, buf: *mut statfs) -> c_int; ++ pub fn fstatfs64(fd: c_int, buf: *mut statfs64) -> c_int; ++ pub fn fstatvfs64(fd: c_int, buf: *mut statvfs64) -> c_int; ++ pub fn ftello64(stream: *mut crate::FILE) -> off64_t; ++ pub fn ftok(path: *const c_char, id: c_int) -> crate::key_t; ++ pub fn ftruncate64(fd: c_int, length: off64_t) -> c_int; ++ pub fn futimens(fd: c_int, times: *const crate::timespec) -> c_int; ++ pub fn getcontext(ucp: *mut ucontext_t) -> c_int; ++ pub fn getdomainname(name: *mut c_char, len: c_int) -> c_int; ++ pub fn getdtablesize() -> c_int; ++ pub fn getgrent() -> *mut crate::group; ++ pub fn getgrgid(gid: crate::gid_t) -> *mut crate::group; ++ pub fn getgrgid_r( ++ gid: crate::gid_t, ++ grp: *mut crate::group, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut crate::group, ++ ) -> c_int; ++ pub fn getgrnam(name: *const c_char) -> *mut crate::group; ++ pub fn getgrnam_r( ++ name: *const c_char, ++ grp: *mut crate::group, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut crate::group, ++ ) -> c_int; ++ pub fn getgrset(user: *mut c_char) -> *mut c_char; ++ pub fn gethostid() -> c_long; ++ pub fn getmntent(stream: *mut crate::FILE) -> *mut crate::mntent; ++ pub fn getnameinfo( ++ sa: *const crate::sockaddr, ++ salen: size_t, ++ host: *mut c_char, ++ hostlen: size_t, ++ serv: *mut c_char, ++ servlen: size_t, ++ flags: c_int, ++ ) -> c_int; ++ pub fn getpagesize() -> c_int; ++ pub fn getpeereid(socket: c_int, euid: *mut crate::uid_t, egid: *mut crate::gid_t) -> c_int; ++ pub fn getpriority(which: c_int, who: crate::id_t) -> c_int; ++ pub fn getpwent() -> *mut crate::passwd; ++ pub fn getpwnam_r( ++ name: *const c_char, ++ pwd: *mut passwd, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut passwd, ++ ) -> c_int; ++ pub fn getpwuid_r( ++ uid: crate::uid_t, ++ pwd: *mut passwd, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut passwd, ++ ) -> c_int; ++ pub fn getrlimit(resource: c_int, rlim: *mut crate::rlimit) -> c_int; ++ pub fn getrlimit64(resource: c_int, rlim: *mut rlimit64) -> c_int; ++ pub fn gettimeofday(tp: *mut crate::timeval, tz: *mut c_void) -> c_int; ++ pub fn getitimer(which: c_int, curr_value: *mut crate::itimerval) -> c_int; ++ pub fn getutent() -> *mut utmp; ++ pub fn getutid(u: *const utmp) -> *mut utmp; ++ pub fn getutline(u: *const utmp) -> *mut utmp; ++ pub fn getutxent() -> *mut utmpx; ++ pub fn getutxid(ut: *const utmpx) -> *mut utmpx; ++ pub fn getutxline(ut: *const utmpx) -> *mut utmpx; ++ pub fn glob( ++ pattern: *const c_char, ++ flags: c_int, ++ errfunc: Option c_int>, ++ pglob: *mut crate::glob_t, ++ ) -> c_int; ++ pub fn globfree(pglob: *mut crate::glob_t); ++ pub fn hasmntopt(mnt: *const crate::mntent, opt: *const c_char) -> *mut c_char; ++ pub fn hcreate(nelt: size_t) -> c_int; ++ pub fn hdestroy(); ++ pub fn hsearch(entry: entry, action: c_int) -> *mut entry; ++ pub fn if_freenameindex(ptr: *mut if_nameindex); ++ pub fn if_nameindex() -> *mut if_nameindex; ++ pub fn initgroups(name: *const c_char, basegid: crate::gid_t) -> c_int; ++ pub fn ioctl(fildes: c_int, request: c_int, ...) -> c_int; ++ pub fn jrand48(xseed: *mut c_ushort) -> c_long; ++ pub fn lcong48(p: *mut c_ushort); ++ pub fn lfind( ++ key: *const c_void, ++ base: *const c_void, ++ nelp: *mut size_t, ++ width: size_t, ++ compar: Option c_int>, ++ ) -> *mut c_void; ++ pub fn lio_listio( ++ mode: c_int, ++ aiocb_list: *const *mut aiocb, ++ nitems: c_int, ++ sevp: *mut sigevent, ++ ) -> c_int; ++ pub fn loadquery(flags: c_int, buf: *mut c_char, buflen: c_uint) -> c_int; ++ pub fn lpar_get_info(command: c_int, buf: *mut c_void, bufsize: size_t) -> c_int; ++ pub fn lpar_set_resources(id: c_int, resource: *mut c_void) -> c_int; ++ pub fn lrand48() -> c_long; ++ pub fn lsearch( ++ key: *const c_void, ++ base: *mut c_void, ++ nelp: *mut size_t, ++ width: size_t, ++ compar: Option c_int>, ++ ) -> *mut c_void; ++ pub fn lseek64(fd: c_int, offset: off64_t, whence: c_int) -> off64_t; ++ pub fn lstat64(path: *const c_char, buf: *mut stat64) -> c_int; ++ pub fn madvise(addr: *mut c_void, len: size_t, advice: c_int) -> c_int; ++ pub fn makecontext(ucp: *mut crate::ucontext_t, func: extern "C" fn(), argc: c_int, ...); ++ pub fn mallinfo() -> crate::mallinfo; ++ pub fn mallopt(param: c_int, value: c_int) -> c_int; ++ pub fn memmem( ++ haystack: *const c_void, ++ haystacklen: size_t, ++ needle: *const c_void, ++ needlelen: size_t, ++ ) -> *mut c_void; ++ pub fn memset_s(s: *mut c_void, smax: size_t, c: c_int, n: size_t) -> c_int; ++ pub fn mincore(addr: *const c_void, len: size_t, vec: *mut c_char) -> c_int; ++ pub fn mkfifoat(dirfd: c_int, pathname: *const c_char, mode: crate::mode_t) -> c_int; ++ pub fn mknodat(dirfd: c_int, pathname: *const c_char, mode: crate::mode_t, dev: dev_t) ++ -> c_int; ++ pub fn mount(device: *const c_char, path: *const c_char, flags: c_int) -> c_int; ++ pub fn mprotect(addr: *mut c_void, len: size_t, prot: c_int) -> c_int; ++ pub fn mq_close(mqd: crate::mqd_t) -> c_int; ++ pub fn mq_getattr(mqd: crate::mqd_t, attr: *mut crate::mq_attr) -> c_int; ++ pub fn mq_notify(mqd: crate::mqd_t, notification: *const crate::sigevent) -> c_int; ++ pub fn mq_open(name: *const c_char, oflag: c_int, ...) -> crate::mqd_t; ++ pub fn mq_receive( ++ mqd: crate::mqd_t, ++ msg_ptr: *mut c_char, ++ msg_len: size_t, ++ msg_prio: *mut c_uint, ++ ) -> ssize_t; ++ pub fn mq_send( ++ mqd: crate::mqd_t, ++ msg_ptr: *const c_char, ++ msg_len: size_t, ++ msg_prio: c_uint, ++ ) -> c_int; ++ pub fn mq_setattr( ++ mqd: crate::mqd_t, ++ newattr: *const crate::mq_attr, ++ oldattr: *mut crate::mq_attr, ++ ) -> c_int; ++ pub fn mq_timedreceive( ++ mqd: crate::mqd_t, ++ msg_ptr: *mut c_char, ++ msg_len: size_t, ++ msg_prio: *mut c_uint, ++ abs_timeout: *const crate::timespec, ++ ) -> ssize_t; ++ pub fn mq_timedsend( ++ mqd: crate::mqd_t, ++ msg_ptr: *const c_char, ++ msg_len: size_t, ++ msg_prio: c_uint, ++ abs_timeout: *const crate::timespec, ++ ) -> c_int; ++ pub fn mq_unlink(name: *const c_char) -> c_int; ++ pub fn mrand48() -> c_long; ++ pub fn msgctl(msqid: c_int, cmd: c_int, buf: *mut msqid_ds) -> c_int; ++ pub fn msgget(key: crate::key_t, msgflg: c_int) -> c_int; ++ pub fn msgrcv( ++ msqid: c_int, ++ msgp: *mut c_void, ++ msgsz: size_t, ++ msgtyp: c_long, ++ msgflg: c_int, ++ ) -> ssize_t; ++ pub fn msgsnd(msqid: c_int, msgp: *const c_void, msgsz: size_t, msgflg: c_int) -> c_int; ++ pub fn msync(addr: *mut c_void, len: size_t, flags: c_int) -> c_int; ++ pub fn newlocale(mask: c_int, locale: *const c_char, base: crate::locale_t) -> crate::locale_t; ++ pub fn nl_langinfo(item: crate::nl_item) -> *mut c_char; ++ pub fn nl_langinfo_l(item: crate::nl_item, loc: crate::locale_t) -> *mut c_char; ++ pub fn nrand48(xseed: *mut c_ushort) -> c_long; ++ pub fn open64(path: *const c_char, oflag: c_int, ...) -> c_int; ++ pub fn pollset_create(maxfd: c_int) -> pollset_t; ++ pub fn pollset_ctl(ps: pollset_t, pollctl_array: *mut poll_ctl, array_length: c_int) -> c_int; ++ pub fn pollset_destroy(ps: pollset_t) -> c_int; ++ pub fn pollset_poll( ++ ps: pollset_t, ++ polldata_array: *mut crate::pollfd, ++ array_length: c_int, ++ timeout: c_int, ++ ) -> c_int; ++ pub fn pollset_query(ps: pollset_t, pollfd_query: *mut crate::pollfd) -> c_int; ++ pub fn popen(command: *const c_char, mode: *const c_char) -> *mut crate::FILE; ++ pub fn posix_fadvise(fd: c_int, offset: off_t, len: off_t, advise: c_int) -> c_int; ++ pub fn posix_fadvise64(fd: c_int, offset: off64_t, len: off64_t, advise: c_int) -> c_int; ++ pub fn posix_fallocate(fd: c_int, offset: off_t, len: off_t) -> c_int; ++ pub fn posix_fallocate64(fd: c_int, offset: off64_t, len: off64_t) -> c_int; ++ pub fn posix_madvise(addr: *mut c_void, len: size_t, advice: c_int) -> c_int; ++ pub fn posix_spawn( ++ pid: *mut crate::pid_t, ++ path: *const c_char, ++ file_actions: *const crate::posix_spawn_file_actions_t, ++ attrp: *const crate::posix_spawnattr_t, ++ argv: *const *mut c_char, ++ envp: *const *mut c_char, ++ ) -> c_int; ++ pub fn posix_spawn_file_actions_addclose( ++ actions: *mut posix_spawn_file_actions_t, ++ fd: c_int, ++ ) -> c_int; ++ pub fn posix_spawn_file_actions_adddup2( ++ actions: *mut posix_spawn_file_actions_t, ++ fd: c_int, ++ newfd: c_int, ++ ) -> c_int; ++ pub fn posix_spawn_file_actions_addopen( ++ actions: *mut posix_spawn_file_actions_t, ++ fd: c_int, ++ path: *const c_char, ++ oflag: c_int, ++ mode: crate::mode_t, ++ ) -> c_int; ++ pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> c_int; ++ pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_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_getpgroup( ++ attr: *const posix_spawnattr_t, ++ flags: *mut crate::pid_t, ++ ) -> c_int; ++ pub fn posix_spawnattr_getschedparam( ++ attr: *const posix_spawnattr_t, ++ param: *mut crate::sched_param, ++ ) -> c_int; ++ pub fn posix_spawnattr_getschedpolicy( ++ attr: *const posix_spawnattr_t, ++ flags: *mut c_int, ++ ) -> c_int; ++ pub fn posix_spawnattr_getsigdefault( ++ attr: *const posix_spawnattr_t, ++ default: *mut sigset_t, ++ ) -> c_int; ++ pub fn posix_spawnattr_getsigmask( ++ attr: *const posix_spawnattr_t, ++ default: *mut sigset_t, ++ ) -> c_int; ++ pub fn posix_spawnattr_init(attr: *mut posix_spawnattr_t) -> c_int; ++ pub fn posix_spawnattr_setflags(attr: *mut posix_spawnattr_t, flags: c_short) -> c_int; ++ pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: crate::pid_t) -> c_int; ++ pub fn posix_spawnattr_setschedparam( ++ attr: *mut posix_spawnattr_t, ++ param: *const crate::sched_param, ++ ) -> c_int; ++ pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: c_int) -> c_int; ++ pub fn posix_spawnattr_setsigdefault( ++ attr: *mut posix_spawnattr_t, ++ default: *const crate::sigset_t, ++ ) -> c_int; ++ pub fn posix_spawnattr_setsigmask( ++ attr: *mut posix_spawnattr_t, ++ default: *const crate::sigset_t, ++ ) -> c_int; ++ pub fn posix_spawnp( ++ pid: *mut crate::pid_t, ++ file: *const c_char, ++ file_actions: *const crate::posix_spawn_file_actions_t, ++ attrp: *const crate::posix_spawnattr_t, ++ argv: *const *mut c_char, ++ envp: *const *mut c_char, ++ ) -> c_int; ++ pub fn pread64(fd: c_int, buf: *mut c_void, count: size_t, offset: off64_t) -> ssize_t; ++ pub fn preadv(fd: c_int, iov: *const crate::iovec, iovcnt: c_int, offset: off_t) -> ssize_t; ++ pub fn ptrace64( ++ request: c_int, ++ id: c_longlong, ++ addr: c_longlong, ++ data: c_int, ++ buff: *mut c_int, ++ ) -> c_int; ++ pub fn pututline(u: *const utmp) -> *mut utmp; ++ pub fn pututxline(ut: *const utmpx) -> *mut utmpx; ++ pub fn pwrite64(fd: c_int, buf: *const c_void, count: size_t, offset: off64_t) -> ssize_t; ++ pub fn pwritev(fd: c_int, iov: *const crate::iovec, iovcnt: c_int, offset: off_t) -> ssize_t; ++ #[link_name = "__linux_quotactl"] ++ pub fn quotactl(cmd: c_int, special: *const c_char, id: c_int, data: *mut c_char) -> c_int; ++ pub fn rand() -> c_int; ++ pub fn readv(fd: c_int, iov: *const crate::iovec, iovcnt: c_int) -> ssize_t; ++ pub fn recvfrom( ++ socket: c_int, ++ buf: *mut c_void, ++ len: size_t, ++ flags: c_int, ++ addr: *mut crate::sockaddr, ++ addrlen: *mut crate::socklen_t, ++ ) -> ssize_t; ++ pub fn recvmmsg( ++ sockfd: c_int, ++ msgvec: *mut crate::mmsghdr, ++ vlen: c_uint, ++ flags: c_int, ++ timeout: *mut crate::timespec, ++ ) -> c_int; ++ pub fn recvmsg(sockfd: c_int, msg: *mut msghdr, flags: c_int) -> ssize_t; ++ pub fn regcomp(preg: *mut regex_t, pattern: *const c_char, cflags: c_int) -> c_int; ++ pub fn regerror( ++ errcode: c_int, ++ preg: *const crate::regex_t, ++ errbuf: *mut c_char, ++ errbuf_size: size_t, ++ ) -> size_t; ++ pub fn regexec( ++ preg: *const regex_t, ++ input: *const c_char, ++ nmatch: size_t, ++ pmatch: *mut regmatch_t, ++ eflags: c_int, ++ ) -> c_int; ++ pub fn regfree(preg: *mut regex_t); ++ pub fn sbrk(increment: intptr_t) -> *mut c_void; ++ pub fn sched_getparam(pid: crate::pid_t, param: *mut sched_param) -> c_int; ++ pub fn sched_getscheduler(pid: crate::pid_t) -> c_int; ++ pub fn sched_get_priority_max(policy: c_int) -> c_int; ++ pub fn sched_get_priority_min(policy: c_int) -> c_int; ++ pub fn sched_rr_get_interval(pid: crate::pid_t, tp: *mut crate::timespec) -> c_int; ++ pub fn sched_setparam(pid: crate::pid_t, param: *const crate::sched_param) -> c_int; ++ pub fn sched_setscheduler( ++ pid: crate::pid_t, ++ policy: c_int, ++ param: *const crate::sched_param, ++ ) -> c_int; ++ pub fn sctp_opt_info( ++ sd: c_int, ++ id: crate::sctp_assoc_t, ++ opt: c_int, ++ arg_size: *mut c_void, ++ size: *mut size_t, ++ ) -> c_int; ++ pub fn sctp_peeloff(s: c_int, id: crate::sctp_assoc_t) -> c_int; ++ pub fn seed48(xseed: *mut c_ushort) -> *mut c_ushort; ++ pub fn seekdir(dirp: *mut crate::DIR, loc: c_long); ++ pub fn sem_close(sem: *mut sem_t) -> c_int; ++ pub fn sem_destroy(sem: *mut sem_t) -> c_int; ++ pub fn sem_getvalue(sem: *mut sem_t, sval: *mut c_int) -> c_int; ++ pub fn sem_init(sem: *mut sem_t, pshared: c_int, value: c_uint) -> c_int; ++ pub fn sem_open(name: *const c_char, oflag: c_int, ...) -> *mut sem_t; ++ pub fn sem_timedwait(sem: *mut sem_t, abstime: *const crate::timespec) -> c_int; ++ pub fn sem_unlink(name: *const c_char) -> c_int; ++ pub fn semctl(semid: c_int, semnum: c_int, cmd: c_int, ...) -> c_int; ++ pub fn semget(key: crate::key_t, nsems: c_int, semflag: c_int) -> c_int; ++ pub fn semop(semid: c_int, sops: *mut sembuf, nsops: size_t) -> c_int; ++ pub fn send_file(socket: *mut c_int, iobuf: *mut sf_parms, flags: c_uint) -> ssize_t; ++ pub fn sendmmsg(sockfd: c_int, msgvec: *mut mmsghdr, vlen: c_uint, flags: c_int) -> c_int; ++ pub fn sendmsg(sockfd: c_int, msg: *const msghdr, flags: c_int) -> ssize_t; ++ pub fn setcontext(ucp: *const ucontext_t) -> c_int; ++ pub fn setdomainname(name: *const c_char, len: c_int) -> c_int; ++ pub fn setgroups(ngroups: c_int, ptr: *const crate::gid_t) -> c_int; ++ pub fn setgrent(); ++ pub fn sethostid(hostid: c_int) -> c_int; ++ pub fn sethostname(name: *const c_char, len: c_int) -> c_int; ++ pub fn setmntent(filename: *const c_char, ty: *const c_char) -> *mut crate::FILE; ++ pub fn setpriority(which: c_int, who: id_t, priority: c_int) -> c_int; ++ pub fn setpwent(); ++ pub fn setrlimit(resource: c_int, rlim: *const crate::rlimit) -> c_int; ++ pub fn setrlimit64(resource: c_int, rlim: *const rlimit64) -> c_int; ++ pub fn settimeofday(tv: *const crate::timeval, tz: *const crate::timezone) -> c_int; ++ pub fn setitimer( ++ which: c_int, ++ new_value: *const crate::itimerval, ++ old_value: *mut crate::itimerval, ++ ) -> c_int; ++ pub fn setutent(); ++ pub fn setutxent(); ++ pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> c_int; ++ pub fn sigsuspend(mask: *const crate::sigset_t) -> c_int; ++ pub fn sigtimedwait( ++ set: *const sigset_t, ++ info: *mut siginfo_t, ++ timeout: *const crate::timespec, ++ ) -> c_int; ++ pub fn sigwait(set: *const sigset_t, sig: *mut c_int) -> c_int; ++ pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> c_int; ++ pub fn shmat(shmid: c_int, shmaddr: *const c_void, shmflg: c_int) -> *mut c_void; ++ pub fn shmdt(shmaddr: *const c_void) -> c_int; ++ pub fn shmctl(shmid: c_int, cmd: c_int, buf: *mut crate::shmid_ds) -> c_int; ++ pub fn shmget(key: key_t, size: size_t, shmflg: c_int) -> c_int; ++ pub fn shm_open(name: *const c_char, oflag: c_int, mode: crate::mode_t) -> c_int; ++ pub fn shm_unlink(name: *const c_char) -> c_int; ++ pub fn splice(socket1: c_int, socket2: c_int, flags: c_int) -> c_int; ++ pub fn srand(seed: c_uint); ++ pub fn srand48(seed: c_long); ++ pub fn stat64(path: *const c_char, buf: *mut stat64) -> c_int; ++ pub fn stat64at(dirfd: c_int, path: *const c_char, buf: *mut stat64, flags: c_int) -> c_int; ++ pub fn statfs(path: *const c_char, buf: *mut statfs) -> c_int; ++ pub fn statfs64(path: *const c_char, buf: *mut statfs64) -> c_int; ++ pub fn statvfs64(path: *const c_char, buf: *mut statvfs64) -> c_int; ++ pub fn statx(path: *const c_char, buf: *mut stat, length: c_int, command: c_int) -> c_int; ++ pub fn strcasecmp_l( ++ string1: *const c_char, ++ string2: *const c_char, ++ locale: crate::locale_t, ++ ) -> c_int; ++ pub fn strerror_r(errnum: c_int, buf: *mut c_char, buflen: size_t) -> c_int; ++ pub fn strftime( ++ arg1: *mut c_char, ++ arg2: size_t, ++ arg3: *const c_char, ++ arg4: *const tm, ++ ) -> size_t; ++ pub fn strncasecmp_l( ++ string1: *const c_char, ++ string2: *const c_char, ++ length: size_t, ++ locale: crate::locale_t, ++ ) -> c_int; ++ pub fn strptime(s: *const c_char, format: *const c_char, tm: *mut crate::tm) -> *mut c_char; ++ pub fn strsep(string: *mut *mut c_char, delim: *const c_char) -> *mut c_char; ++ pub fn swapcontext(uocp: *mut ucontext_t, ucp: *const ucontext_t) -> c_int; ++ pub fn swapoff(puath: *const c_char) -> c_int; ++ pub fn swapon(path: *const c_char) -> c_int; ++ pub fn sync(); ++ pub fn telldir(dirp: *mut crate::DIR) -> c_long; ++ pub fn timer_create( ++ clockid: crate::clockid_t, ++ sevp: *mut crate::sigevent, ++ timerid: *mut crate::timer_t, ++ ) -> c_int; ++ pub fn timer_delete(timerid: timer_t) -> c_int; ++ pub fn timer_getoverrun(timerid: timer_t) -> c_int; ++ pub fn timer_gettime(timerid: timer_t, value: *mut itimerspec) -> c_int; ++ pub fn timer_settime( ++ timerid: crate::timer_t, ++ flags: c_int, ++ new_value: *const crate::itimerspec, ++ old_value: *mut crate::itimerspec, ++ ) -> c_int; ++ pub fn truncate64(path: *const c_char, length: off64_t) -> c_int; ++ pub fn uname(buf: *mut crate::utsname) -> c_int; ++ pub fn updwtmp(file: *const c_char, u: *mut utmp); ++ pub fn uselocale(loc: crate::locale_t) -> crate::locale_t; ++ pub fn utmpname(file: *const c_char) -> c_int; ++ pub fn utimensat( ++ dirfd: c_int, ++ path: *const c_char, ++ times: *const crate::timespec, ++ flag: c_int, ++ ) -> c_int; ++ pub fn wait4( ++ pid: crate::pid_t, ++ status: *mut c_int, ++ options: c_int, ++ rusage: *mut crate::rusage, ++ ) -> crate::pid_t; ++ pub fn waitid( ++ idtype: idtype_t, ++ id: id_t, ++ infop: *mut crate::siginfo_t, ++ options: c_int, ++ ) -> c_int; ++ pub fn writev(fd: c_int, iov: *const crate::iovec, iovcnt: c_int) -> ssize_t; ++ ++ // Use AIX thread-safe version errno. ++ pub fn _Errno() -> *mut c_int; ++} ++ ++cfg_if! { ++ if #[cfg(target_arch = "powerpc64")] { ++ mod powerpc64; ++ pub use self::powerpc64::*; ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/aix/powerpc64.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/aix/powerpc64.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/aix/powerpc64.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/aix/powerpc64.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,583 @@ ++use crate::off_t; ++use crate::prelude::*; ++ ++pub type c_long = i64; ++pub type c_ulong = u64; ++ ++s! { ++ pub struct sigset_t { ++ pub ss_set: [c_ulong; 4], ++ } ++ ++ pub struct fd_set { ++ pub fds_bits: [c_long; 1024], ++ } ++ ++ pub struct flock { ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ pub l_sysid: c_uint, ++ pub l_pid: crate::pid_t, ++ pub l_vfs: c_int, ++ pub l_start: off_t, ++ pub l_len: off_t, ++ } ++ ++ pub struct statvfs { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_favail: crate::fsfilcnt_t, ++ pub f_fsid: c_ulong, ++ pub f_basetype: [c_char; 16], ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ pub f_fstr: [c_char; 32], ++ pub f_filler: [c_ulong; 16], ++ } ++ ++ pub struct pthread_rwlock_t { ++ __rw_word: [c_long; 10], ++ } ++ ++ pub struct pthread_cond_t { ++ __cv_word: [c_long; 6], ++ } ++ ++ pub struct pthread_mutex_t { ++ __mt_word: [c_long; 8], ++ } ++ ++ pub struct stat { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_flag: c_ushort, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ pub st_ssize: c_int, ++ pub st_atime: crate::st_timespec, ++ pub st_mtime: crate::st_timespec, ++ pub st_ctime: crate::st_timespec, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_vfstype: c_int, ++ pub st_vfs: c_uint, ++ pub st_type: c_uint, ++ pub st_gen: c_uint, ++ pub st_reserved: [c_uint; 9], ++ pub st_padto_ll: c_uint, ++ pub st_size: off_t, ++ } ++ ++ pub struct statfs { ++ pub f_version: c_int, ++ pub f_type: c_int, ++ pub f_bsize: c_ulong, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ pub f_files: crate::fsblkcnt_t, ++ pub f_ffree: crate::fsblkcnt_t, ++ pub f_fsid: crate::fsid64_t, ++ pub f_vfstype: c_int, ++ pub f_fsize: c_ulong, ++ pub f_vfsnumber: c_int, ++ pub f_vfsoff: c_int, ++ pub f_vfslen: c_int, ++ pub f_vfsvers: c_int, ++ pub f_fname: [c_char; 32], ++ pub f_fpack: [c_char; 32], ++ pub f_name_max: c_int, ++ } ++ ++ pub struct aiocb { ++ pub aio_lio_opcode: c_int, ++ pub aio_fildes: c_int, ++ pub aio_word1: c_int, ++ pub aio_offset: off_t, ++ pub aio_buf: *mut c_void, ++ pub aio_return: ssize_t, ++ pub aio_errno: c_int, ++ pub aio_nbytes: size_t, ++ pub aio_reqprio: c_int, ++ pub aio_sigevent: crate::sigevent, ++ pub aio_word2: c_int, ++ pub aio_fp: c_int, ++ pub aio_handle: *mut aiocb, ++ pub aio_reserved: [c_uint; 2], ++ pub aio_sigev_tid: c_long, ++ } ++ ++ pub struct ucontext_t { ++ pub __sc_onstack: c_int, ++ pub uc_sigmask: crate::sigset_t, ++ pub __sc_uerror: c_int, ++ pub uc_mcontext: crate::mcontext_t, ++ pub uc_link: *mut ucontext_t, ++ pub uc_stack: crate::stack_t, ++ // Should be pointer to __extctx_t ++ pub __extctx: *mut c_void, ++ pub __extctx_magic: c_int, ++ pub __pad: [c_int; 1], ++ } ++ ++ pub struct mcontext_t { ++ pub gpr: [c_ulonglong; 32], ++ pub msr: c_ulonglong, ++ pub iar: c_ulonglong, ++ pub lr: c_ulonglong, ++ pub ctr: c_ulonglong, ++ pub cr: c_uint, ++ pub xer: c_uint, ++ pub fpscr: c_uint, ++ pub fpscrx: c_uint, ++ pub except: [c_ulonglong; 1], ++ // Should be array of double type ++ pub fpr: [crate::uint64_t; 32], ++ pub fpeu: c_char, ++ pub fpinfo: c_char, ++ pub fpscr24_31: c_char, ++ pub pad: [c_char; 1], ++ pub excp_type: c_int, ++ } ++ ++ pub struct utmpx { ++ pub ut_user: [c_char; 256], ++ pub ut_id: [c_char; 14], ++ pub ut_line: [c_char; 64], ++ pub ut_pid: crate::pid_t, ++ pub ut_type: c_short, ++ pub ut_tv: crate::timeval, ++ pub ut_host: [c_char; 256], ++ pub __dbl_word_pad: c_int, ++ pub __reservedA: [c_int; 2], ++ pub __reservedV: [c_int; 6], ++ } ++ ++ pub struct pthread_spinlock_t { ++ pub __sp_word: [c_long; 3], ++ } ++ ++ pub struct pthread_barrier_t { ++ pub __br_word: [c_long; 5], ++ } ++ ++ pub struct msqid_ds { ++ pub msg_perm: crate::ipc_perm, ++ pub msg_first: c_uint, ++ pub msg_last: c_uint, ++ pub msg_cbytes: c_uint, ++ pub msg_qnum: c_uint, ++ pub msg_qbytes: c_ulong, ++ pub msg_lspid: crate::pid_t, ++ pub msg_lrpid: crate::pid_t, ++ pub msg_stime: crate::time_t, ++ pub msg_rtime: crate::time_t, ++ pub msg_ctime: crate::time_t, ++ pub msg_rwait: c_int, ++ pub msg_wwait: c_int, ++ pub msg_reqevents: c_ushort, ++ } ++} ++ ++s_no_extra_traits! { ++ pub struct siginfo_t { ++ pub si_signo: c_int, ++ pub si_errno: c_int, ++ pub si_code: c_int, ++ pub si_pid: crate::pid_t, ++ pub si_uid: crate::uid_t, ++ pub si_status: c_int, ++ pub si_addr: *mut c_void, ++ pub si_band: c_long, ++ pub si_value: crate::sigval, ++ pub __si_flags: c_int, ++ pub __pad: [c_int; 3], ++ } ++ ++ pub union _kernel_simple_lock { ++ pub _slock: c_long, ++ // Should be pointer to 'lock_data_instrumented' ++ pub _slockp: *mut c_void, ++ } ++ ++ pub struct fileops_t { ++ pub fo_rw: extern "C" fn( ++ file: *mut file, ++ rw: crate::uio_rw, ++ io: *mut c_void, ++ ext: c_long, ++ secattr: *mut c_void, ++ ) -> c_int, ++ pub fo_ioctl: extern "C" fn( ++ file: *mut file, ++ a: c_long, ++ b: crate::caddr_t, ++ c: c_long, ++ d: c_long, ++ ) -> c_int, ++ pub fo_select: ++ extern "C" fn(file: *mut file, a: c_int, b: *mut c_ushort, c: extern "C" fn()) -> c_int, ++ pub fo_close: extern "C" fn(file: *mut file) -> c_int, ++ pub fo_fstat: extern "C" fn(file: *mut file, sstat: *mut crate::stat) -> c_int, ++ } ++ ++ pub struct file { ++ pub f_flag: c_long, ++ pub f_count: c_int, ++ pub f_options: c_short, ++ pub f_type: c_short, ++ // Should be pointer to 'vnode' ++ pub f_data: *mut c_void, ++ pub f_offset: c_longlong, ++ pub f_dir_off: c_long, ++ // Should be pointer to 'cred' ++ pub f_cred: *mut c_void, ++ pub f_lock: _kernel_simple_lock, ++ pub f_offset_lock: _kernel_simple_lock, ++ pub f_vinfo: crate::caddr_t, ++ pub f_ops: *mut fileops_t, ++ pub f_parentp: crate::caddr_t, ++ pub f_fnamep: crate::caddr_t, ++ pub f_fdata: [c_char; 160], ++ } ++ ++ pub union __ld_info_file { ++ pub _ldinfo_fd: c_int, ++ pub _ldinfo_fp: *mut file, ++ pub _core_offset: c_long, ++ } ++ ++ pub struct ld_info { ++ pub ldinfo_next: c_uint, ++ pub ldinfo_flags: c_uint, ++ pub _file: __ld_info_file, ++ pub ldinfo_textorg: *mut c_void, ++ pub ldinfo_textsize: c_ulong, ++ pub ldinfo_dataorg: *mut c_void, ++ pub ldinfo_datasize: c_ulong, ++ pub ldinfo_filename: [c_char; 2], ++ } ++ ++ pub union __pollfd_ext_u { ++ pub addr: *mut c_void, ++ pub data32: u32, ++ pub data: u64, ++ } ++ ++ pub struct pollfd_ext { ++ pub fd: c_int, ++ pub events: c_ushort, ++ pub revents: c_ushort, ++ pub data: __pollfd_ext_u, ++ } ++} ++ ++impl siginfo_t { ++ pub unsafe fn si_addr(&self) -> *mut c_void { ++ self.si_addr ++ } ++ ++ pub unsafe fn si_value(&self) -> crate::sigval { ++ self.si_value ++ } ++ ++ pub unsafe fn si_pid(&self) -> crate::pid_t { ++ self.si_pid ++ } ++ ++ pub unsafe fn si_uid(&self) -> crate::uid_t { ++ self.si_uid ++ } ++ ++ pub unsafe fn si_status(&self) -> c_int { ++ self.si_status ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for siginfo_t { ++ fn eq(&self, other: &siginfo_t) -> bool { ++ self.si_signo == other.si_signo ++ && self.si_errno == other.si_errno ++ && self.si_code == other.si_code ++ && self.si_pid == other.si_pid ++ && self.si_uid == other.si_uid ++ && self.si_status == other.si_status ++ && self.si_addr == other.si_addr ++ && self.si_band == other.si_band ++ && self.__si_flags == other.__si_flags ++ && self.si_value == other.si_value ++ } ++ } ++ impl Eq for siginfo_t {} ++ impl fmt::Debug for siginfo_t { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_struct("siginfo_t") ++ .field("si_signo", &self.si_signo) ++ .field("si_errno", &self.si_errno) ++ .field("si_code", &self.si_code) ++ .field("si_pid", &self.si_pid) ++ .field("si_uid", &self.si_uid) ++ .field("si_status", &self.si_status) ++ .field("si_addr", &self.si_addr) ++ .field("si_band", &self.si_band) ++ .field("si_value", &self.si_value) ++ .field("__si_flags", &self.__si_flags) ++ .finish() ++ } ++ } ++ impl hash::Hash for siginfo_t { ++ fn hash(&self, state: &mut H) { ++ self.si_signo.hash(state); ++ self.si_errno.hash(state); ++ self.si_code.hash(state); ++ self.si_pid.hash(state); ++ self.si_uid.hash(state); ++ self.si_status.hash(state); ++ self.si_addr.hash(state); ++ self.si_band.hash(state); ++ self.si_value.hash(state); ++ self.__si_flags.hash(state); ++ } ++ } ++ ++ impl PartialEq for _kernel_simple_lock { ++ fn eq(&self, other: &_kernel_simple_lock) -> bool { ++ unsafe { self._slock == other._slock && self._slockp == other._slockp } ++ } ++ } ++ impl Eq for _kernel_simple_lock {} ++ impl hash::Hash for _kernel_simple_lock { ++ fn hash(&self, state: &mut H) { ++ unsafe { ++ self._slock.hash(state); ++ self._slockp.hash(state); ++ } ++ } ++ } ++ ++ impl PartialEq for fileops_t { ++ fn eq(&self, other: &fileops_t) -> bool { ++ self.fo_rw == other.fo_rw ++ && self.fo_ioctl == other.fo_ioctl ++ && self.fo_select == other.fo_select ++ && self.fo_close == other.fo_close ++ && self.fo_fstat == other.fo_fstat ++ } ++ } ++ impl Eq for fileops_t {} ++ impl fmt::Debug for fileops_t { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_struct("fileops_t") ++ .field("fo_rw", &self.fo_rw) ++ .field("fo_ioctl", &self.fo_ioctl) ++ .field("fo_select", &self.fo_select) ++ .field("fo_close", &self.fo_close) ++ .field("fo_fstat", &self.fo_fstat) ++ .finish() ++ } ++ } ++ impl hash::Hash for fileops_t { ++ fn hash(&self, state: &mut H) { ++ self.fo_rw.hash(state); ++ self.fo_ioctl.hash(state); ++ self.fo_select.hash(state); ++ self.fo_close.hash(state); ++ self.fo_fstat.hash(state); ++ } ++ } ++ ++ impl PartialEq for file { ++ fn eq(&self, other: &file) -> bool { ++ self.f_flag == other.f_flag ++ && self.f_count == other.f_count ++ && self.f_options == other.f_options ++ && self.f_type == other.f_type ++ && self.f_data == other.f_data ++ && self.f_offset == other.f_offset ++ && self.f_dir_off == other.f_dir_off ++ && self.f_cred == other.f_cred ++ && self.f_vinfo == other.f_vinfo ++ && self.f_ops == other.f_ops ++ && self.f_parentp == other.f_parentp ++ && self.f_fnamep == other.f_fnamep ++ && self.f_fdata == other.f_fdata ++ && self.f_lock == other.f_lock ++ && self.f_offset_lock == other.f_offset_lock ++ } ++ } ++ impl Eq for file {} ++ impl fmt::Debug for file { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_struct("file") ++ .field("f_flag", &self.f_flag) ++ .field("f_count", &self.f_count) ++ .field("f_options", &self.f_options) ++ .field("f_type", &self.f_type) ++ .field("f_data", &self.f_data) ++ .field("f_offset", &self.f_offset) ++ .field("f_dir_off", &self.f_dir_off) ++ .field("f_cred", &self.f_cred) ++ .field("f_lock", &self.f_lock) ++ .field("f_offset_lock", &self.f_offset_lock) ++ .field("f_vinfo", &self.f_vinfo) ++ .field("f_ops", &self.f_ops) ++ .field("f_parentp", &self.f_parentp) ++ .field("f_fnamep", &self.f_fnamep) ++ .field("f_fdata", &self.f_fdata) ++ .finish() ++ } ++ } ++ impl hash::Hash for file { ++ fn hash(&self, state: &mut H) { ++ self.f_flag.hash(state); ++ self.f_count.hash(state); ++ self.f_options.hash(state); ++ self.f_type.hash(state); ++ self.f_data.hash(state); ++ self.f_offset.hash(state); ++ self.f_dir_off.hash(state); ++ self.f_cred.hash(state); ++ self.f_lock.hash(state); ++ self.f_offset_lock.hash(state); ++ self.f_vinfo.hash(state); ++ self.f_ops.hash(state); ++ self.f_parentp.hash(state); ++ self.f_fnamep.hash(state); ++ self.f_fdata.hash(state); ++ } ++ } ++ ++ impl PartialEq for __ld_info_file { ++ fn eq(&self, other: &__ld_info_file) -> bool { ++ unsafe { ++ self._ldinfo_fd == other._ldinfo_fd ++ && self._ldinfo_fp == other._ldinfo_fp ++ && self._core_offset == other._core_offset ++ } ++ } ++ } ++ impl Eq for __ld_info_file {} ++ impl hash::Hash for __ld_info_file { ++ fn hash(&self, state: &mut H) { ++ unsafe { ++ self._ldinfo_fd.hash(state); ++ self._ldinfo_fp.hash(state); ++ self._core_offset.hash(state); ++ } ++ } ++ } ++ ++ impl PartialEq for ld_info { ++ fn eq(&self, other: &ld_info) -> bool { ++ self.ldinfo_next == other.ldinfo_next ++ && self.ldinfo_flags == other.ldinfo_flags ++ && self.ldinfo_textorg == other.ldinfo_textorg ++ && self.ldinfo_textsize == other.ldinfo_textsize ++ && self.ldinfo_dataorg == other.ldinfo_dataorg ++ && self.ldinfo_datasize == other.ldinfo_datasize ++ && self.ldinfo_filename == other.ldinfo_filename ++ && self._file == other._file ++ } ++ } ++ impl Eq for ld_info {} ++ impl fmt::Debug for ld_info { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_struct("ld_info") ++ .field("ldinfo_next", &self.ldinfo_next) ++ .field("ldinfo_flags", &self.ldinfo_flags) ++ .field("ldinfo_textorg", &self.ldinfo_textorg) ++ .field("ldinfo_textsize", &self.ldinfo_textsize) ++ .field("ldinfo_dataorg", &self.ldinfo_dataorg) ++ .field("ldinfo_datasize", &self.ldinfo_datasize) ++ .field("ldinfo_filename", &self.ldinfo_filename) ++ .field("_file", &self._file) ++ .finish() ++ } ++ } ++ impl hash::Hash for ld_info { ++ fn hash(&self, state: &mut H) { ++ self.ldinfo_next.hash(state); ++ self.ldinfo_flags.hash(state); ++ self.ldinfo_textorg.hash(state); ++ self.ldinfo_textsize.hash(state); ++ self.ldinfo_dataorg.hash(state); ++ self.ldinfo_datasize.hash(state); ++ self.ldinfo_filename.hash(state); ++ self._file.hash(state); ++ } ++ } ++ ++ impl PartialEq for __pollfd_ext_u { ++ fn eq(&self, other: &__pollfd_ext_u) -> bool { ++ unsafe { ++ self.addr == other.addr ++ && self.data32 == other.data32 ++ && self.data == other.data ++ } ++ } ++ } ++ impl Eq for __pollfd_ext_u {} ++ impl hash::Hash for __pollfd_ext_u { ++ fn hash(&self, state: &mut H) { ++ unsafe { ++ self.addr.hash(state); ++ self.data.hash(state); ++ self.data32.hash(state); ++ } ++ } ++ } ++ ++ impl PartialEq for pollfd_ext { ++ fn eq(&self, other: &pollfd_ext) -> bool { ++ self.fd == other.fd ++ && self.events == other.events ++ && self.revents == other.revents ++ && self.data == other.data ++ } ++ } ++ impl Eq for pollfd_ext {} ++ impl fmt::Debug for pollfd_ext { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_struct("pollfd_ext") ++ .field("fd", &self.fd) ++ .field("events", &self.events) ++ .field("revents", &self.revents) ++ .field("data", &self.data) ++ .finish() ++ } ++ } ++ impl hash::Hash for pollfd_ext { ++ fn hash(&self, state: &mut H) { ++ self.fd.hash(state); ++ self.events.hash(state); ++ self.revents.hash(state); ++ self.data.hash(state); ++ } ++ } ++ } ++} ++ ++pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { ++ __mt_word: [0, 2, 0, 0, 0, 0, 0, 0], ++}; ++pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { ++ __cv_word: [0, 0, 0, 0, 2, 0], ++}; ++pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { ++ __rw_word: [2, 0, 0, 0, 0, 0, 0, 0, 0, 0], ++}; ++pub const RLIM_INFINITY: c_ulong = 0x7fffffffffffffff; ++ ++extern "C" { ++ pub fn getsystemcfg(label: c_int) -> c_ulong; ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/apple/b32/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/apple/b32/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/apple/b32/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/apple/b32/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,153 @@ ++//! 32-bit specific Apple (ios/darwin) definitions ++ ++use crate::prelude::*; ++ ++pub type c_long = i32; ++pub type c_ulong = u32; ++pub type boolean_t = c_int; ++ ++s! { ++ pub struct if_data { ++ pub ifi_type: c_uchar, ++ pub ifi_typelen: c_uchar, ++ pub ifi_physical: c_uchar, ++ pub ifi_addrlen: c_uchar, ++ pub ifi_hdrlen: c_uchar, ++ pub ifi_recvquota: c_uchar, ++ pub ifi_xmitquota: c_uchar, ++ pub ifi_unused1: c_uchar, ++ pub ifi_mtu: u32, ++ pub ifi_metric: u32, ++ pub ifi_baudrate: u32, ++ pub ifi_ipackets: u32, ++ pub ifi_ierrors: u32, ++ pub ifi_opackets: u32, ++ pub ifi_oerrors: u32, ++ pub ifi_collisions: u32, ++ pub ifi_ibytes: u32, ++ pub ifi_obytes: u32, ++ pub ifi_imcasts: u32, ++ pub ifi_omcasts: u32, ++ pub ifi_iqdrops: u32, ++ pub ifi_noproto: u32, ++ pub ifi_recvtiming: u32, ++ pub ifi_xmittiming: u32, ++ pub ifi_lastchange: crate::timeval, ++ pub ifi_unused2: u32, ++ pub ifi_hwassist: u32, ++ pub ifi_reserved1: u32, ++ pub ifi_reserved2: u32, ++ } ++ ++ pub struct bpf_hdr { ++ pub bh_tstamp: crate::timeval, ++ pub bh_caplen: u32, ++ pub bh_datalen: u32, ++ pub bh_hdrlen: c_ushort, ++ } ++ ++ pub struct malloc_zone_t { ++ __private: [crate::uintptr_t; 18], // FIXME: keeping private for now ++ } ++} ++ ++s_no_extra_traits! { ++ pub struct pthread_attr_t { ++ __sig: c_long, ++ __opaque: [c_char; 36], ++ } ++ ++ pub struct pthread_once_t { ++ __sig: c_long, ++ __opaque: [c_char; crate::__PTHREAD_ONCE_SIZE__], ++ } ++ ++ #[allow(missing_debug_implementations)] ++ #[repr(align(16))] ++ pub struct max_align_t { ++ priv_: [f64; 2], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for pthread_attr_t { ++ fn eq(&self, other: &pthread_attr_t) -> bool { ++ self.__sig == other.__sig ++ && self ++ .__opaque ++ .iter() ++ .zip(other.__opaque.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for pthread_attr_t {} ++ impl fmt::Debug for pthread_attr_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("pthread_attr_t") ++ .field("__sig", &self.__sig) ++ // FIXME: .field("__opaque", &self.__opaque) ++ .finish() ++ } ++ } ++ impl hash::Hash for pthread_attr_t { ++ fn hash(&self, state: &mut H) { ++ self.__sig.hash(state); ++ self.__opaque.hash(state); ++ } ++ } ++ impl PartialEq for pthread_once_t { ++ fn eq(&self, other: &pthread_once_t) -> bool { ++ self.__sig == other.__sig ++ && self ++ .__opaque ++ .iter() ++ .zip(other.__opaque.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for pthread_once_t {} ++ impl fmt::Debug for pthread_once_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("pthread_once_t") ++ .field("__sig", &self.__sig) ++ .finish() ++ } ++ } ++ impl hash::Hash for pthread_once_t { ++ fn hash(&self, state: &mut H) { ++ self.__sig.hash(state); ++ self.__opaque.hash(state); ++ } ++ } ++ } ++} ++ ++#[doc(hidden)] ++#[deprecated(since = "0.2.55")] ++pub const NET_RT_MAXID: c_int = 10; ++ ++pub const __PTHREAD_MUTEX_SIZE__: usize = 40; ++pub const __PTHREAD_COND_SIZE__: usize = 24; ++pub const __PTHREAD_CONDATTR_SIZE__: usize = 4; ++pub const __PTHREAD_ONCE_SIZE__: usize = 4; ++pub const __PTHREAD_RWLOCK_SIZE__: usize = 124; ++pub const __PTHREAD_RWLOCKATTR_SIZE__: usize = 12; ++ ++pub const TIOCTIMESTAMP: c_ulong = 0x40087459; ++pub const TIOCDCDTIMESTAMP: c_ulong = 0x40087458; ++ ++pub const BIOCSETF: c_ulong = 0x80084267; ++pub const BIOCSRTIMEOUT: c_ulong = 0x8008426d; ++pub const BIOCGRTIMEOUT: c_ulong = 0x4008426e; ++pub const BIOCSETFNR: c_ulong = 0x8008427e; ++ ++const _PTHREAD_ONCE_SIG_INIT: c_long = 0x30B1BCBA; ++pub const PTHREAD_ONCE_INIT: crate::pthread_once_t = crate::pthread_once_t { ++ __sig: _PTHREAD_ONCE_SIG_INIT, ++ __opaque: [0; 4], ++}; ++ ++extern "C" { ++ pub fn exchangedata(path1: *const c_char, path2: *const c_char, options: c_ulong) -> c_int; ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/apple/b64/aarch64/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/apple/b64/aarch64/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/apple/b64/aarch64/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/apple/b64/aarch64/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,54 @@ ++use crate::prelude::*; ++ ++pub type boolean_t = c_int; ++pub type mcontext_t = *mut __darwin_mcontext64; ++ ++s! { ++ pub struct malloc_zone_t { ++ __private: [crate::uintptr_t; 18], // FIXME: needs arm64 auth pointers support ++ } ++ ++ pub struct ucontext_t { ++ pub uc_onstack: c_int, ++ pub uc_sigmask: crate::sigset_t, ++ pub uc_stack: crate::stack_t, ++ pub uc_link: *mut crate::ucontext_t, ++ pub uc_mcsize: usize, ++ pub uc_mcontext: mcontext_t, ++ } ++ ++ pub struct __darwin_mcontext64 { ++ pub __es: __darwin_arm_exception_state64, ++ pub __ss: __darwin_arm_thread_state64, ++ pub __ns: __darwin_arm_neon_state64, ++ } ++ ++ pub struct __darwin_arm_exception_state64 { ++ pub __far: u64, ++ pub __esr: u32, ++ pub __exception: u32, ++ } ++ ++ pub struct __darwin_arm_thread_state64 { ++ pub __x: [u64; 29], ++ pub __fp: u64, ++ pub __lr: u64, ++ pub __sp: u64, ++ pub __pc: u64, ++ pub __cpsr: u32, ++ pub __pad: u32, ++ } ++ ++ pub struct __darwin_arm_neon_state64 { ++ pub __v: [crate::__uint128_t; 32], ++ pub __fpsr: u32, ++ pub __fpcr: u32, ++ } ++} ++ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ pub struct max_align_t { ++ priv_: f64, ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/apple/b64/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/apple/b64/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/apple/b64/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/apple/b64/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,159 @@ ++//! 64-bit specific Apple (ios/darwin) definitions ++ ++use crate::prelude::*; ++ ++pub type c_long = i64; ++pub type c_ulong = u64; ++ ++s! { ++ pub struct timeval32 { ++ pub tv_sec: i32, ++ pub tv_usec: i32, ++ } ++ ++ pub struct if_data { ++ pub ifi_type: c_uchar, ++ pub ifi_typelen: c_uchar, ++ pub ifi_physical: c_uchar, ++ pub ifi_addrlen: c_uchar, ++ pub ifi_hdrlen: c_uchar, ++ pub ifi_recvquota: c_uchar, ++ pub ifi_xmitquota: c_uchar, ++ pub ifi_unused1: c_uchar, ++ pub ifi_mtu: u32, ++ pub ifi_metric: u32, ++ pub ifi_baudrate: u32, ++ pub ifi_ipackets: u32, ++ pub ifi_ierrors: u32, ++ pub ifi_opackets: u32, ++ pub ifi_oerrors: u32, ++ pub ifi_collisions: u32, ++ pub ifi_ibytes: u32, ++ pub ifi_obytes: u32, ++ pub ifi_imcasts: u32, ++ pub ifi_omcasts: u32, ++ pub ifi_iqdrops: u32, ++ pub ifi_noproto: u32, ++ pub ifi_recvtiming: u32, ++ pub ifi_xmittiming: u32, ++ pub ifi_lastchange: timeval32, ++ pub ifi_unused2: u32, ++ pub ifi_hwassist: u32, ++ pub ifi_reserved1: u32, ++ pub ifi_reserved2: u32, ++ } ++ ++ pub struct bpf_hdr { ++ pub bh_tstamp: crate::timeval32, ++ pub bh_caplen: u32, ++ pub bh_datalen: u32, ++ pub bh_hdrlen: c_ushort, ++ } ++} ++ ++s_no_extra_traits! { ++ pub struct pthread_attr_t { ++ __sig: c_long, ++ __opaque: [c_char; 56], ++ } ++ ++ pub struct pthread_once_t { ++ __sig: c_long, ++ __opaque: [c_char; __PTHREAD_ONCE_SIZE__], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for pthread_attr_t { ++ fn eq(&self, other: &pthread_attr_t) -> bool { ++ self.__sig == other.__sig ++ && self ++ .__opaque ++ .iter() ++ .zip(other.__opaque.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for pthread_attr_t {} ++ impl fmt::Debug for pthread_attr_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("pthread_attr_t") ++ .field("__sig", &self.__sig) ++ // FIXME: .field("__opaque", &self.__opaque) ++ .finish() ++ } ++ } ++ impl hash::Hash for pthread_attr_t { ++ fn hash(&self, state: &mut H) { ++ self.__sig.hash(state); ++ self.__opaque.hash(state); ++ } ++ } ++ impl PartialEq for pthread_once_t { ++ fn eq(&self, other: &pthread_once_t) -> bool { ++ self.__sig == other.__sig ++ && self ++ .__opaque ++ .iter() ++ .zip(other.__opaque.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for pthread_once_t {} ++ impl fmt::Debug for pthread_once_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("pthread_once_t") ++ .field("__sig", &self.__sig) ++ .finish() ++ } ++ } ++ impl hash::Hash for pthread_once_t { ++ fn hash(&self, state: &mut H) { ++ self.__sig.hash(state); ++ self.__opaque.hash(state); ++ } ++ } ++ } ++} ++ ++#[doc(hidden)] ++#[deprecated(since = "0.2.55")] ++pub const NET_RT_MAXID: c_int = 11; ++ ++pub const __PTHREAD_MUTEX_SIZE__: usize = 56; ++pub const __PTHREAD_COND_SIZE__: usize = 40; ++pub const __PTHREAD_CONDATTR_SIZE__: usize = 8; ++pub const __PTHREAD_ONCE_SIZE__: usize = 8; ++pub const __PTHREAD_RWLOCK_SIZE__: usize = 192; ++pub const __PTHREAD_RWLOCKATTR_SIZE__: usize = 16; ++ ++pub const TIOCTIMESTAMP: c_ulong = 0x40107459; ++pub const TIOCDCDTIMESTAMP: c_ulong = 0x40107458; ++ ++pub const BIOCSETF: c_ulong = 0x80104267; ++pub const BIOCSRTIMEOUT: c_ulong = 0x8010426d; ++pub const BIOCGRTIMEOUT: c_ulong = 0x4010426e; ++pub const BIOCSETFNR: c_ulong = 0x8010427e; ++ ++const _PTHREAD_ONCE_SIG_INIT: c_long = 0x30B1BCBA; ++pub const PTHREAD_ONCE_INIT: crate::pthread_once_t = crate::pthread_once_t { ++ __sig: _PTHREAD_ONCE_SIG_INIT, ++ __opaque: [0; 8], ++}; ++ ++extern "C" { ++ pub fn exchangedata(path1: *const c_char, path2: *const c_char, options: c_uint) -> c_int; ++} ++ ++cfg_if! { ++ if #[cfg(target_arch = "x86_64")] { ++ mod x86_64; ++ pub use self::x86_64::*; ++ } else if #[cfg(target_arch = "aarch64")] { ++ mod aarch64; ++ pub use self::aarch64::*; ++ } else { ++ // Unknown target_arch ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/apple/b64/x86_64/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/apple/b64/x86_64/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/apple/b64/x86_64/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/apple/b64/x86_64/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,178 @@ ++use crate::prelude::*; ++ ++pub type boolean_t = c_uint; ++pub type mcontext_t = *mut __darwin_mcontext64; ++ ++s! { ++ pub struct ucontext_t { ++ pub uc_onstack: c_int, ++ pub uc_sigmask: crate::sigset_t, ++ pub uc_stack: crate::stack_t, ++ pub uc_link: *mut crate::ucontext_t, ++ pub uc_mcsize: usize, ++ pub uc_mcontext: mcontext_t, ++ } ++ ++ pub struct __darwin_mcontext64 { ++ pub __es: __darwin_x86_exception_state64, ++ pub __ss: __darwin_x86_thread_state64, ++ pub __fs: __darwin_x86_float_state64, ++ } ++ ++ pub struct __darwin_x86_exception_state64 { ++ pub __trapno: u16, ++ pub __cpu: u16, ++ pub __err: u32, ++ pub __faultvaddr: u64, ++ } ++ ++ pub struct __darwin_x86_thread_state64 { ++ pub __rax: u64, ++ pub __rbx: u64, ++ pub __rcx: u64, ++ pub __rdx: u64, ++ pub __rdi: u64, ++ pub __rsi: u64, ++ pub __rbp: u64, ++ pub __rsp: u64, ++ pub __r8: u64, ++ pub __r9: u64, ++ pub __r10: u64, ++ pub __r11: u64, ++ pub __r12: u64, ++ pub __r13: u64, ++ pub __r14: u64, ++ pub __r15: u64, ++ pub __rip: u64, ++ pub __rflags: u64, ++ pub __cs: u64, ++ pub __fs: u64, ++ pub __gs: u64, ++ } ++ ++ pub struct __darwin_x86_float_state64 { ++ pub __fpu_reserved: [c_int; 2], ++ __fpu_fcw: c_short, ++ __fpu_fsw: c_short, ++ pub __fpu_ftw: u8, ++ pub __fpu_rsrv1: u8, ++ pub __fpu_fop: u16, ++ pub __fpu_ip: u32, ++ pub __fpu_cs: u16, ++ pub __fpu_rsrv2: u16, ++ pub __fpu_dp: u32, ++ pub __fpu_ds: u16, ++ pub __fpu_rsrv3: u16, ++ pub __fpu_mxcsr: u32, ++ pub __fpu_mxcsrmask: u32, ++ pub __fpu_stmm0: __darwin_mmst_reg, ++ pub __fpu_stmm1: __darwin_mmst_reg, ++ pub __fpu_stmm2: __darwin_mmst_reg, ++ pub __fpu_stmm3: __darwin_mmst_reg, ++ pub __fpu_stmm4: __darwin_mmst_reg, ++ pub __fpu_stmm5: __darwin_mmst_reg, ++ pub __fpu_stmm6: __darwin_mmst_reg, ++ pub __fpu_stmm7: __darwin_mmst_reg, ++ pub __fpu_xmm0: __darwin_xmm_reg, ++ pub __fpu_xmm1: __darwin_xmm_reg, ++ pub __fpu_xmm2: __darwin_xmm_reg, ++ pub __fpu_xmm3: __darwin_xmm_reg, ++ pub __fpu_xmm4: __darwin_xmm_reg, ++ pub __fpu_xmm5: __darwin_xmm_reg, ++ pub __fpu_xmm6: __darwin_xmm_reg, ++ pub __fpu_xmm7: __darwin_xmm_reg, ++ pub __fpu_xmm8: __darwin_xmm_reg, ++ pub __fpu_xmm9: __darwin_xmm_reg, ++ pub __fpu_xmm10: __darwin_xmm_reg, ++ pub __fpu_xmm11: __darwin_xmm_reg, ++ pub __fpu_xmm12: __darwin_xmm_reg, ++ pub __fpu_xmm13: __darwin_xmm_reg, ++ pub __fpu_xmm14: __darwin_xmm_reg, ++ pub __fpu_xmm15: __darwin_xmm_reg, ++ // this field is actually [u8; 96], but defining it with a bigger type ++ // allows us to auto-implement traits for it since the length of the ++ // array is less than 32 ++ __fpu_rsrv4: [u32; 24], ++ pub __fpu_reserved1: c_int, ++ } ++ ++ pub struct __darwin_mmst_reg { ++ pub __mmst_reg: [c_char; 10], ++ pub __mmst_rsrv: [c_char; 6], ++ } ++ ++ pub struct __darwin_xmm_reg { ++ pub __xmm_reg: [c_char; 16], ++ } ++ ++ pub struct malloc_introspection_t { ++ _private: [crate::uintptr_t; 16], // FIXME: keeping private for now ++ } ++ ++ pub struct malloc_zone_t { ++ _reserved1: *mut c_void, ++ _reserved2: *mut c_void, ++ pub size: ++ Option size_t>, ++ pub malloc: ++ Option *mut c_void>, ++ pub calloc: Option< ++ unsafe extern "C" fn( ++ zone: *mut malloc_zone_t, ++ num_items: size_t, ++ size: size_t, ++ ) -> *mut c_void, ++ >, ++ pub valloc: ++ Option *mut c_void>, ++ pub free: Option, ++ pub realloc: Option< ++ unsafe extern "C" fn( ++ zone: *mut malloc_zone_t, ++ ptr: *mut c_void, ++ size: size_t, ++ ) -> *mut c_void, ++ >, ++ pub destroy: Option, ++ pub zone_name: *const c_char, ++ pub batch_malloc: Option< ++ unsafe extern "C" fn( ++ zone: *mut malloc_zone_t, ++ size: size_t, ++ results: *mut *mut c_void, ++ num_requested: c_uint, ++ ) -> c_uint, ++ >, ++ pub batch_free: Option< ++ unsafe extern "C" fn( ++ zone: *mut malloc_zone_t, ++ to_be_freed: *mut *mut c_void, ++ num_to_be_freed: c_uint, ++ ), ++ >, ++ pub introspect: *mut malloc_introspection_t, ++ pub version: c_uint, ++ pub memalign: Option< ++ unsafe extern "C" fn( ++ zone: *mut malloc_zone_t, ++ alignment: size_t, ++ size: size_t, ++ ) -> *mut c_void, ++ >, ++ pub free_definite_size: ++ Option, ++ pub pressure_relief: ++ Option size_t>, ++ pub claimed_address: Option< ++ unsafe extern "C" fn(zone: *mut malloc_zone_t, ptr: *mut c_void) -> crate::boolean_t, ++ >, ++ } ++} ++ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ #[repr(align(16))] ++ pub struct max_align_t { ++ priv_: [f64; 2], ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/apple/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/apple/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/apple/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/apple/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,6718 @@ ++//! Apple (ios/darwin)-specific definitions ++//! ++//! This covers *-apple-* triples currently ++ ++use crate::prelude::*; ++use crate::{cmsghdr, off_t}; ++ ++pub type c_char = i8; ++pub type wchar_t = i32; ++pub type clock_t = c_ulong; ++pub type time_t = c_long; ++pub type suseconds_t = i32; ++pub type dev_t = i32; ++pub type ino_t = u64; ++pub type mode_t = u16; ++pub type nlink_t = u16; ++pub type blksize_t = i32; ++pub type rlim_t = u64; ++pub type pthread_key_t = c_ulong; ++pub type sigset_t = u32; ++pub type clockid_t = c_uint; ++pub type fsblkcnt_t = c_uint; ++pub type fsfilcnt_t = c_uint; ++pub type speed_t = c_ulong; ++pub type tcflag_t = c_ulong; ++pub type nl_item = c_int; ++pub type id_t = c_uint; ++pub type sem_t = c_int; ++pub type idtype_t = c_uint; ++pub type integer_t = c_int; ++pub type cpu_type_t = integer_t; ++pub type cpu_subtype_t = integer_t; ++pub type natural_t = u32; ++pub type mach_msg_type_number_t = natural_t; ++pub type kern_return_t = c_int; ++pub type uuid_t = [u8; 16]; ++pub type task_info_t = *mut integer_t; ++pub type host_info_t = *mut integer_t; ++pub type task_flavor_t = natural_t; ++pub type rusage_info_t = *mut c_void; ++pub type vm_offset_t = crate::uintptr_t; ++pub type vm_size_t = crate::uintptr_t; ++pub type vm_address_t = vm_offset_t; ++pub type quad_t = i64; ++pub type u_quad_t = u64; ++ ++pub type posix_spawnattr_t = *mut c_void; ++pub type posix_spawn_file_actions_t = *mut c_void; ++pub type key_t = c_int; ++pub type shmatt_t = c_ushort; ++ ++pub type sae_associd_t = u32; ++pub type sae_connid_t = u32; ++ ++pub type mach_port_t = c_uint; ++pub type host_t = c_uint; ++pub type host_flavor_t = integer_t; ++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 = crate::mach_port_t; ++pub type thread_act_t = crate::mach_port_t; ++pub type thread_act_array_t = *mut crate::thread_act_t; ++pub type policy_t = c_int; ++pub type mach_error_t = crate::kern_return_t; ++pub type mach_vm_address_t = u64; ++pub type mach_vm_offset_t = u64; ++pub type mach_vm_size_t = u64; ++pub type vm_map_t = crate::mach_port_t; ++pub type mem_entry_name_port_t = crate::mach_port_t; ++pub type memory_object_t = crate::mach_port_t; ++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 = crate::mach_port_t; ++pub type ledger_array_t = *mut crate::ledger_t; ++ ++pub type iconv_t = *mut c_void; ++ ++// mach/host_info.h ++pub type host_cpu_load_info_t = *mut host_cpu_load_info; ++pub type host_cpu_load_info_data_t = host_cpu_load_info; ++ ++// mach/processor_info.h ++pub type processor_cpu_load_info_t = *mut processor_cpu_load_info; ++pub type processor_cpu_load_info_data_t = processor_cpu_load_info; ++pub type processor_basic_info_t = *mut processor_basic_info; ++pub type processor_basic_info_data_t = processor_basic_info; ++pub type processor_set_basic_info_data_t = processor_set_basic_info; ++pub type processor_set_basic_info_t = *mut processor_set_basic_info; ++pub type processor_set_load_info_data_t = processor_set_load_info; ++pub type processor_set_load_info_t = *mut processor_set_load_info; ++pub type processor_info_t = *mut integer_t; ++pub type processor_info_array_t = *mut integer_t; ++ ++pub type mach_task_basic_info_data_t = mach_task_basic_info; ++pub type mach_task_basic_info_t = *mut mach_task_basic_info; ++pub type task_thread_times_info_data_t = task_thread_times_info; ++pub type task_thread_times_info_t = *mut task_thread_times_info; ++ ++pub type thread_info_t = *mut integer_t; ++pub type thread_basic_info_t = *mut thread_basic_info; ++pub type thread_basic_info_data_t = thread_basic_info; ++pub type thread_identifier_info_t = *mut thread_identifier_info; ++pub type thread_identifier_info_data_t = thread_identifier_info; ++pub type thread_extended_info_t = *mut thread_extended_info; ++pub type thread_extended_info_data_t = thread_extended_info; ++ ++pub type thread_t = crate::mach_port_t; ++pub type thread_policy_flavor_t = natural_t; ++pub type thread_policy_t = *mut integer_t; ++pub type thread_latency_qos_t = integer_t; ++pub type thread_throughput_qos_t = integer_t; ++pub type thread_standard_policy_data_t = thread_standard_policy; ++pub type thread_standard_policy_t = *mut thread_standard_policy; ++pub type thread_extended_policy_data_t = thread_extended_policy; ++pub type thread_extended_policy_t = *mut thread_extended_policy; ++pub type thread_time_constraint_policy_data_t = thread_time_constraint_policy; ++pub type thread_time_constraint_policy_t = *mut thread_time_constraint_policy; ++pub type thread_precedence_policy_data_t = thread_precedence_policy; ++pub type thread_precedence_policy_t = *mut thread_precedence_policy; ++pub type thread_affinity_policy_data_t = thread_affinity_policy; ++pub type thread_affinity_policy_t = *mut thread_affinity_policy; ++pub type thread_background_policy_data_t = thread_background_policy; ++pub type thread_background_policy_t = *mut thread_background_policy; ++pub type thread_latency_qos_policy_data_t = thread_latency_qos_policy; ++pub type thread_latency_qos_policy_t = *mut thread_latency_qos_policy; ++pub type thread_throughput_qos_policy_data_t = thread_throughput_qos_policy; ++pub type thread_throughput_qos_policy_t = *mut thread_throughput_qos_policy; ++ ++pub type pthread_introspection_hook_t = ++ extern "C" fn(event: c_uint, thread: crate::pthread_t, addr: *mut c_void, size: size_t); ++pub type pthread_jit_write_callback_t = Option c_int>; ++ ++pub type os_clockid_t = u32; ++ ++pub type os_sync_wait_on_address_flags_t = u32; ++pub type os_sync_wake_by_address_flags_t = u32; ++ ++pub type os_unfair_lock = os_unfair_lock_s; ++pub type os_unfair_lock_t = *mut os_unfair_lock; ++ ++pub type os_log_t = *mut c_void; ++pub type os_log_type_t = u8; ++pub type os_signpost_id_t = u64; ++pub type os_signpost_type_t = u8; ++ ++pub type vm_statistics_t = *mut vm_statistics; ++pub type vm_statistics_data_t = vm_statistics; ++pub type vm_statistics64_t = *mut vm_statistics64; ++pub type vm_statistics64_data_t = vm_statistics64; ++ ++pub type task_t = crate::mach_port_t; ++pub type task_inspect_t = crate::mach_port_t; ++ ++pub type sysdir_search_path_enumeration_state = c_uint; ++ ++pub type CCStatus = i32; ++pub type CCCryptorStatus = i32; ++pub type CCRNGStatus = crate::CCCryptorStatus; ++ ++pub type copyfile_state_t = *mut c_void; ++pub type copyfile_flags_t = u32; ++pub type copyfile_callback_t = Option< ++ extern "C" fn( ++ c_int, ++ c_int, ++ copyfile_state_t, ++ *const c_char, ++ *const c_char, ++ *mut c_void, ++ ) -> c_int, ++>; ++ ++pub type attrgroup_t = u32; ++pub type vol_capabilities_set_t = [u32; 4]; ++ ++deprecated_mach! { ++ pub type mach_timebase_info_data_t = mach_timebase_info; ++} ++ ++#[cfg_attr(feature = "extra_traits", derive(Debug))] ++pub enum timezone {} ++impl Copy for timezone {} ++impl Clone for timezone { ++ fn clone(&self) -> timezone { ++ *self ++ } ++} ++ ++#[cfg_attr(feature = "extra_traits", derive(Debug))] ++#[repr(u32)] ++pub enum qos_class_t { ++ QOS_CLASS_USER_INTERACTIVE = 0x21, ++ QOS_CLASS_USER_INITIATED = 0x19, ++ QOS_CLASS_DEFAULT = 0x15, ++ QOS_CLASS_UTILITY = 0x11, ++ QOS_CLASS_BACKGROUND = 0x09, ++ QOS_CLASS_UNSPECIFIED = 0x00, ++} ++impl Copy for qos_class_t {} ++impl Clone for qos_class_t { ++ fn clone(&self) -> qos_class_t { ++ *self ++ } ++} ++ ++#[cfg_attr(feature = "extra_traits", derive(Debug))] ++#[repr(u32)] ++pub enum sysdir_search_path_directory_t { ++ SYSDIR_DIRECTORY_APPLICATION = 1, ++ SYSDIR_DIRECTORY_DEMO_APPLICATION = 2, ++ SYSDIR_DIRECTORY_DEVELOPER_APPLICATION = 3, ++ SYSDIR_DIRECTORY_ADMIN_APPLICATION = 4, ++ SYSDIR_DIRECTORY_LIBRARY = 5, ++ SYSDIR_DIRECTORY_DEVELOPER = 6, ++ SYSDIR_DIRECTORY_USER = 7, ++ SYSDIR_DIRECTORY_DOCUMENTATION = 8, ++ SYSDIR_DIRECTORY_DOCUMENT = 9, ++ SYSDIR_DIRECTORY_CORESERVICE = 10, ++ SYSDIR_DIRECTORY_AUTOSAVED_INFORMATION = 11, ++ SYSDIR_DIRECTORY_DESKTOP = 12, ++ SYSDIR_DIRECTORY_CACHES = 13, ++ SYSDIR_DIRECTORY_APPLICATION_SUPPORT = 14, ++ SYSDIR_DIRECTORY_DOWNLOADS = 15, ++ SYSDIR_DIRECTORY_INPUT_METHODS = 16, ++ SYSDIR_DIRECTORY_MOVIES = 17, ++ SYSDIR_DIRECTORY_MUSIC = 18, ++ SYSDIR_DIRECTORY_PICTURES = 19, ++ SYSDIR_DIRECTORY_PRINTER_DESCRIPTION = 20, ++ SYSDIR_DIRECTORY_SHARED_PUBLIC = 21, ++ SYSDIR_DIRECTORY_PREFERENCE_PANES = 22, ++ SYSDIR_DIRECTORY_ALL_APPLICATIONS = 100, ++ SYSDIR_DIRECTORY_ALL_LIBRARIES = 101, ++} ++impl Copy for sysdir_search_path_directory_t {} ++impl Clone for sysdir_search_path_directory_t { ++ fn clone(&self) -> sysdir_search_path_directory_t { ++ *self ++ } ++} ++ ++#[cfg_attr(feature = "extra_traits", derive(Debug))] ++#[repr(u32)] ++pub enum sysdir_search_path_domain_mask_t { ++ SYSDIR_DOMAIN_MASK_USER = (1 << 0), ++ SYSDIR_DOMAIN_MASK_LOCAL = (1 << 1), ++ SYSDIR_DOMAIN_MASK_NETWORK = (1 << 2), ++ SYSDIR_DOMAIN_MASK_SYSTEM = (1 << 3), ++ SYSDIR_DOMAIN_MASK_ALL = 0x0ffff, ++} ++impl Copy for sysdir_search_path_domain_mask_t {} ++impl Clone for sysdir_search_path_domain_mask_t { ++ fn clone(&self) -> sysdir_search_path_domain_mask_t { ++ *self ++ } ++} ++ ++s! { ++ pub struct ip_mreq { ++ pub imr_multiaddr: in_addr, ++ pub imr_interface: in_addr, ++ } ++ ++ pub struct ip_mreqn { ++ pub imr_multiaddr: in_addr, ++ pub imr_address: in_addr, ++ pub imr_ifindex: c_int, ++ } ++ ++ pub struct ip_mreq_source { ++ pub imr_multiaddr: in_addr, ++ pub imr_sourceaddr: in_addr, ++ pub imr_interface: in_addr, ++ } ++ ++ pub struct aiocb { ++ pub aio_fildes: c_int, ++ pub aio_offset: off_t, ++ pub aio_buf: *mut c_void, ++ pub aio_nbytes: size_t, ++ pub aio_reqprio: c_int, ++ pub aio_sigevent: sigevent, ++ pub aio_lio_opcode: c_int, ++ } ++ ++ pub struct glob_t { ++ pub gl_pathc: size_t, ++ __unused1: c_int, ++ pub gl_offs: size_t, ++ __unused2: c_int, ++ pub gl_pathv: *mut *mut c_char, ++ ++ __unused3: *mut c_void, ++ ++ __unused4: *mut c_void, ++ __unused5: *mut c_void, ++ __unused6: *mut c_void, ++ __unused7: *mut c_void, ++ __unused8: *mut c_void, ++ } ++ ++ pub struct addrinfo { ++ pub ai_flags: c_int, ++ pub ai_family: c_int, ++ pub ai_socktype: c_int, ++ pub ai_protocol: c_int, ++ pub ai_addrlen: crate::socklen_t, ++ pub ai_canonname: *mut c_char, ++ pub ai_addr: *mut crate::sockaddr, ++ pub ai_next: *mut addrinfo, ++ } ++ ++ #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")] ++ pub struct mach_timebase_info { ++ pub numer: u32, ++ pub denom: u32, ++ } ++ ++ pub struct stat { ++ pub st_dev: dev_t, ++ pub st_mode: mode_t, ++ pub st_nlink: nlink_t, ++ pub st_ino: ino_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: dev_t, ++ pub st_atime: time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: time_t, ++ pub st_ctime_nsec: c_long, ++ pub st_birthtime: time_t, ++ pub st_birthtime_nsec: c_long, ++ pub st_size: off_t, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_blksize: blksize_t, ++ pub st_flags: u32, ++ pub st_gen: u32, ++ pub st_lspare: i32, ++ pub st_qspare: [i64; 2], ++ } ++ ++ pub struct pthread_mutexattr_t { ++ __sig: c_long, ++ __opaque: [u8; 8], ++ } ++ ++ pub struct pthread_condattr_t { ++ __sig: c_long, ++ __opaque: [u8; __PTHREAD_CONDATTR_SIZE__], ++ } ++ ++ pub struct pthread_rwlockattr_t { ++ __sig: c_long, ++ __opaque: [u8; __PTHREAD_RWLOCKATTR_SIZE__], ++ } ++ ++ pub struct siginfo_t { ++ pub si_signo: c_int, ++ pub si_errno: c_int, ++ pub si_code: c_int, ++ pub si_pid: crate::pid_t, ++ pub si_uid: crate::uid_t, ++ pub si_status: c_int, ++ pub si_addr: *mut c_void, ++ //Requires it to be union for tests ++ //pub si_value: crate::sigval, ++ _pad: [usize; 9], ++ } ++ ++ pub struct sigaction { ++ // FIXME: this field is actually a union ++ pub sa_sigaction: crate::sighandler_t, ++ pub sa_mask: sigset_t, ++ pub sa_flags: c_int, ++ } ++ ++ pub struct stack_t { ++ pub ss_sp: *mut c_void, ++ pub ss_size: size_t, ++ pub ss_flags: c_int, ++ } ++ ++ pub struct fstore_t { ++ pub fst_flags: c_uint, ++ pub fst_posmode: c_int, ++ pub fst_offset: off_t, ++ pub fst_length: off_t, ++ pub fst_bytesalloc: off_t, ++ } ++ ++ pub struct fpunchhole_t { ++ pub fp_flags: c_uint, /* unused */ ++ pub reserved: c_uint, /* (to maintain 8-byte alignment) */ ++ pub fp_offset: off_t, /* IN: start of the region */ ++ pub fp_length: off_t, /* IN: size of the region */ ++ } ++ ++ pub struct ftrimactivefile_t { ++ pub fta_offset: off_t, ++ pub fta_length: off_t, ++ } ++ ++ pub struct fspecread_t { ++ pub fsr_flags: c_uint, ++ pub reserved: c_uint, ++ pub fsr_offset: off_t, ++ pub fsr_length: off_t, ++ } ++ ++ pub struct radvisory { ++ pub ra_offset: off_t, ++ pub ra_count: c_int, ++ } ++ ++ pub struct statvfs { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_favail: crate::fsfilcnt_t, ++ pub f_fsid: c_ulong, ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ } ++ ++ pub struct Dl_info { ++ pub dli_fname: *const c_char, ++ pub dli_fbase: *mut c_void, ++ pub dli_sname: *const c_char, ++ pub dli_saddr: *mut c_void, ++ } ++ ++ pub struct sockaddr_in { ++ pub sin_len: u8, ++ pub sin_family: crate::sa_family_t, ++ pub sin_port: crate::in_port_t, ++ pub sin_addr: crate::in_addr, ++ pub sin_zero: [c_char; 8], ++ } ++ ++ pub struct kevent64_s { ++ pub ident: u64, ++ pub filter: i16, ++ pub flags: u16, ++ pub fflags: u32, ++ pub data: i64, ++ pub udata: u64, ++ pub ext: [u64; 2], ++ } ++ ++ pub struct dqblk { ++ pub dqb_bhardlimit: u64, ++ pub dqb_bsoftlimit: u64, ++ pub dqb_curbytes: u64, ++ pub dqb_ihardlimit: u32, ++ pub dqb_isoftlimit: u32, ++ pub dqb_curinodes: u32, ++ pub dqb_btime: u32, ++ pub dqb_itime: u32, ++ pub dqb_id: u32, ++ pub dqb_spare: [u32; 4], ++ } ++ ++ pub struct if_msghdr { ++ pub ifm_msglen: c_ushort, ++ pub ifm_version: c_uchar, ++ pub ifm_type: c_uchar, ++ pub ifm_addrs: c_int, ++ pub ifm_flags: c_int, ++ pub ifm_index: c_ushort, ++ pub ifm_data: if_data, ++ } ++ ++ pub struct ifa_msghdr { ++ pub ifam_msglen: c_ushort, ++ pub ifam_version: c_uchar, ++ pub ifam_type: c_uchar, ++ pub ifam_addrs: c_int, ++ pub ifam_flags: c_int, ++ pub ifam_index: c_ushort, ++ pub ifam_metric: c_int, ++ } ++ ++ pub struct ifma_msghdr { ++ pub ifmam_msglen: c_ushort, ++ pub ifmam_version: c_uchar, ++ pub ifmam_type: c_uchar, ++ pub ifmam_addrs: c_int, ++ pub ifmam_flags: c_int, ++ pub ifmam_index: c_ushort, ++ } ++ ++ pub struct ifma_msghdr2 { ++ pub ifmam_msglen: c_ushort, ++ pub ifmam_version: c_uchar, ++ pub ifmam_type: c_uchar, ++ pub ifmam_addrs: c_int, ++ pub ifmam_flags: c_int, ++ pub ifmam_index: c_ushort, ++ pub ifmam_refcount: i32, ++ } ++ ++ pub struct rt_metrics { ++ pub rmx_locks: u32, ++ pub rmx_mtu: u32, ++ pub rmx_hopcount: u32, ++ pub rmx_expire: i32, ++ pub rmx_recvpipe: u32, ++ pub rmx_sendpipe: u32, ++ pub rmx_ssthresh: u32, ++ pub rmx_rtt: u32, ++ pub rmx_rttvar: u32, ++ pub rmx_pksent: u32, ++ /// This field does not exist anymore, the u32 is now part of a resized ++ /// `rmx_filler` array. ++ pub rmx_state: u32, ++ pub rmx_filler: [u32; 3], ++ } ++ ++ pub struct rt_msghdr { ++ pub rtm_msglen: c_ushort, ++ pub rtm_version: c_uchar, ++ pub rtm_type: c_uchar, ++ pub rtm_index: c_ushort, ++ pub rtm_flags: c_int, ++ pub rtm_addrs: c_int, ++ pub rtm_pid: crate::pid_t, ++ pub rtm_seq: c_int, ++ pub rtm_errno: c_int, ++ pub rtm_use: c_int, ++ pub rtm_inits: u32, ++ pub rtm_rmx: rt_metrics, ++ } ++ ++ pub struct rt_msghdr2 { ++ pub rtm_msglen: c_ushort, ++ pub rtm_version: c_uchar, ++ pub rtm_type: c_uchar, ++ pub rtm_index: c_ushort, ++ pub rtm_flags: c_int, ++ pub rtm_addrs: c_int, ++ pub rtm_refcnt: i32, ++ pub rtm_parentflags: c_int, ++ pub rtm_reserved: c_int, ++ pub rtm_use: c_int, ++ pub rtm_inits: u32, ++ pub rtm_rmx: rt_metrics, ++ } ++ ++ pub struct termios { ++ pub c_iflag: crate::tcflag_t, ++ pub c_oflag: crate::tcflag_t, ++ pub c_cflag: crate::tcflag_t, ++ pub c_lflag: crate::tcflag_t, ++ pub c_cc: [crate::cc_t; crate::NCCS], ++ pub c_ispeed: crate::speed_t, ++ pub c_ospeed: crate::speed_t, ++ } ++ ++ pub struct flock { ++ pub l_start: off_t, ++ pub l_len: off_t, ++ pub l_pid: crate::pid_t, ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ } ++ ++ pub struct sf_hdtr { ++ pub headers: *mut crate::iovec, ++ pub hdr_cnt: c_int, ++ pub trailers: *mut crate::iovec, ++ pub trl_cnt: c_int, ++ } ++ ++ pub struct lconv { ++ pub decimal_point: *mut c_char, ++ pub thousands_sep: *mut c_char, ++ pub grouping: *mut c_char, ++ pub int_curr_symbol: *mut c_char, ++ pub currency_symbol: *mut c_char, ++ pub mon_decimal_point: *mut c_char, ++ pub mon_thousands_sep: *mut c_char, ++ pub mon_grouping: *mut c_char, ++ pub positive_sign: *mut c_char, ++ pub negative_sign: *mut c_char, ++ pub int_frac_digits: c_char, ++ pub frac_digits: c_char, ++ pub p_cs_precedes: c_char, ++ pub p_sep_by_space: c_char, ++ pub n_cs_precedes: c_char, ++ pub n_sep_by_space: c_char, ++ pub p_sign_posn: c_char, ++ pub n_sign_posn: c_char, ++ pub int_p_cs_precedes: c_char, ++ pub int_n_cs_precedes: c_char, ++ pub int_p_sep_by_space: c_char, ++ pub int_n_sep_by_space: c_char, ++ pub int_p_sign_posn: c_char, ++ pub int_n_sign_posn: c_char, ++ } ++ ++ pub struct proc_taskinfo { ++ pub pti_virtual_size: u64, ++ pub pti_resident_size: u64, ++ pub pti_total_user: u64, ++ pub pti_total_system: u64, ++ pub pti_threads_user: u64, ++ pub pti_threads_system: u64, ++ pub pti_policy: i32, ++ pub pti_faults: i32, ++ pub pti_pageins: i32, ++ pub pti_cow_faults: i32, ++ pub pti_messages_sent: i32, ++ pub pti_messages_received: i32, ++ pub pti_syscalls_mach: i32, ++ pub pti_syscalls_unix: i32, ++ pub pti_csw: i32, ++ pub pti_threadnum: i32, ++ pub pti_numrunning: i32, ++ pub pti_priority: i32, ++ } ++ ++ pub struct proc_bsdinfo { ++ pub pbi_flags: u32, ++ pub pbi_status: u32, ++ pub pbi_xstatus: u32, ++ pub pbi_pid: u32, ++ pub pbi_ppid: u32, ++ pub pbi_uid: crate::uid_t, ++ pub pbi_gid: crate::gid_t, ++ pub pbi_ruid: crate::uid_t, ++ pub pbi_rgid: crate::gid_t, ++ pub pbi_svuid: crate::uid_t, ++ pub pbi_svgid: crate::gid_t, ++ pub rfu_1: u32, ++ pub pbi_comm: [c_char; MAXCOMLEN], ++ pub pbi_name: [c_char; 32], // MAXCOMLEN * 2, but macro isn't happy... ++ pub pbi_nfiles: u32, ++ pub pbi_pgid: u32, ++ pub pbi_pjobc: u32, ++ pub e_tdev: u32, ++ pub e_tpgid: u32, ++ pub pbi_nice: i32, ++ pub pbi_start_tvsec: u64, ++ pub pbi_start_tvusec: u64, ++ } ++ ++ pub struct proc_taskallinfo { ++ pub pbsd: proc_bsdinfo, ++ pub ptinfo: proc_taskinfo, ++ } ++ ++ pub struct xsw_usage { ++ pub xsu_total: u64, ++ pub xsu_avail: u64, ++ pub xsu_used: u64, ++ pub xsu_pagesize: u32, ++ pub xsu_encrypted: crate::boolean_t, ++ } ++ ++ pub struct xucred { ++ pub cr_version: c_uint, ++ pub cr_uid: crate::uid_t, ++ pub cr_ngroups: c_short, ++ pub cr_groups: [crate::gid_t; 16], ++ } ++ ++ #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")] ++ pub struct mach_header { ++ pub magic: u32, ++ pub cputype: cpu_type_t, ++ pub cpusubtype: cpu_subtype_t, ++ pub filetype: u32, ++ pub ncmds: u32, ++ pub sizeofcmds: u32, ++ pub flags: u32, ++ } ++ ++ #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")] ++ pub struct mach_header_64 { ++ pub magic: u32, ++ pub cputype: cpu_type_t, ++ pub cpusubtype: cpu_subtype_t, ++ pub filetype: u32, ++ pub ncmds: u32, ++ pub sizeofcmds: u32, ++ pub flags: u32, ++ pub reserved: u32, ++ } ++ ++ pub struct segment_command { ++ pub cmd: u32, ++ pub cmdsize: u32, ++ pub segname: [c_char; 16], ++ pub vmaddr: u32, ++ pub vmsize: u32, ++ pub fileoff: u32, ++ pub filesize: u32, ++ pub maxprot: vm_prot_t, ++ pub initprot: vm_prot_t, ++ pub nsects: u32, ++ pub flags: u32, ++ } ++ ++ pub struct segment_command_64 { ++ pub cmd: u32, ++ pub cmdsize: u32, ++ pub segname: [c_char; 16], ++ pub vmaddr: u64, ++ pub vmsize: u64, ++ pub fileoff: u64, ++ pub filesize: u64, ++ pub maxprot: vm_prot_t, ++ pub initprot: vm_prot_t, ++ pub nsects: u32, ++ pub flags: u32, ++ } ++ ++ pub struct load_command { ++ pub cmd: u32, ++ pub cmdsize: u32, ++ } ++ ++ pub struct sockaddr_dl { ++ pub sdl_len: c_uchar, ++ pub sdl_family: c_uchar, ++ pub sdl_index: c_ushort, ++ pub sdl_type: c_uchar, ++ pub sdl_nlen: c_uchar, ++ pub sdl_alen: c_uchar, ++ pub sdl_slen: c_uchar, ++ pub sdl_data: [c_char; 12], ++ } ++ ++ pub struct sockaddr_inarp { ++ pub sin_len: c_uchar, ++ pub sin_family: c_uchar, ++ pub sin_port: c_ushort, ++ pub sin_addr: crate::in_addr, ++ pub sin_srcaddr: crate::in_addr, ++ pub sin_tos: c_ushort, ++ pub sin_other: c_ushort, ++ } ++ ++ pub struct sockaddr_ctl { ++ pub sc_len: c_uchar, ++ pub sc_family: c_uchar, ++ pub ss_sysaddr: u16, ++ pub sc_id: u32, ++ pub sc_unit: u32, ++ pub sc_reserved: [u32; 5], ++ } ++ ++ pub struct in_pktinfo { ++ pub ipi_ifindex: c_uint, ++ pub ipi_spec_dst: crate::in_addr, ++ pub ipi_addr: crate::in_addr, ++ } ++ ++ pub struct in6_pktinfo { ++ pub ipi6_addr: crate::in6_addr, ++ pub ipi6_ifindex: c_uint, ++ } ++ ++ // sys/ipc.h: ++ ++ pub struct ipc_perm { ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub cuid: crate::uid_t, ++ pub cgid: crate::gid_t, ++ pub mode: crate::mode_t, ++ pub _seq: c_ushort, ++ pub _key: crate::key_t, ++ } ++ ++ // sys/sem.h ++ ++ pub struct sembuf { ++ pub sem_num: c_ushort, ++ pub sem_op: c_short, ++ pub sem_flg: c_short, ++ } ++ ++ // sys/shm.h ++ ++ pub struct arphdr { ++ pub ar_hrd: u16, ++ pub ar_pro: u16, ++ pub ar_hln: u8, ++ pub ar_pln: u8, ++ pub ar_op: u16, ++ } ++ ++ pub struct in_addr { ++ pub s_addr: crate::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; crate::IFNAMSIZ], ++ } ++ ++ // sys/socket.h ++ ++ pub struct sa_endpoints_t { ++ pub sae_srcif: c_uint, // optional source interface ++ pub sae_srcaddr: *const crate::sockaddr, // optional source address ++ pub sae_srcaddrlen: crate::socklen_t, // size of source address ++ pub sae_dstaddr: *const crate::sockaddr, // destination address ++ pub sae_dstaddrlen: crate::socklen_t, // size of destination address ++ } ++ ++ pub struct timex { ++ pub modes: c_uint, ++ pub offset: c_long, ++ pub freq: c_long, ++ pub maxerror: c_long, ++ pub esterror: c_long, ++ pub status: c_int, ++ pub constant: c_long, ++ pub precision: c_long, ++ pub tolerance: c_long, ++ pub ppsfreq: c_long, ++ pub jitter: c_long, ++ pub shift: c_int, ++ pub stabil: c_long, ++ pub jitcnt: c_long, ++ pub calcnt: c_long, ++ pub errcnt: c_long, ++ pub stbcnt: c_long, ++ } ++ ++ pub struct ntptimeval { ++ pub time: crate::timespec, ++ pub maxerror: c_long, ++ pub esterror: c_long, ++ pub tai: c_long, ++ pub time_state: c_int, ++ } ++ ++ pub struct thread_standard_policy { ++ pub no_data: natural_t, ++ } ++ ++ pub struct thread_extended_policy { ++ pub timeshare: boolean_t, ++ } ++ ++ pub struct thread_time_constraint_policy { ++ pub period: u32, ++ pub computation: u32, ++ pub constraint: u32, ++ pub preemptible: boolean_t, ++ } ++ ++ pub struct thread_precedence_policy { ++ pub importance: integer_t, ++ } ++ ++ pub struct thread_affinity_policy { ++ pub affinity_tag: integer_t, ++ } ++ ++ pub struct thread_background_policy { ++ pub priority: integer_t, ++ } ++ ++ pub struct thread_latency_qos_policy { ++ pub thread_latency_qos_tier: thread_latency_qos_t, ++ } ++ ++ pub struct thread_throughput_qos_policy { ++ pub thread_throughput_qos_tier: thread_throughput_qos_t, ++ } ++ ++ // malloc/malloc.h ++ pub struct malloc_statistics_t { ++ pub blocks_in_use: c_uint, ++ pub size_in_use: size_t, ++ pub max_size_in_use: size_t, ++ pub size_allocated: size_t, ++ } ++ ++ pub struct mstats { ++ pub bytes_total: size_t, ++ pub chunks_used: size_t, ++ pub bytes_used: size_t, ++ pub chunks_free: size_t, ++ pub bytes_free: size_t, ++ } ++ ++ pub struct vm_range_t { ++ pub address: crate::vm_address_t, ++ pub size: crate::vm_size_t, ++ } ++ ++ // sched.h ++ pub struct sched_param { ++ pub sched_priority: c_int, ++ __opaque: [c_char; 4], ++ } ++ ++ pub struct vinfo_stat { ++ pub vst_dev: u32, ++ pub vst_mode: u16, ++ pub vst_nlink: u16, ++ pub vst_ino: u64, ++ pub vst_uid: crate::uid_t, ++ pub vst_gid: crate::gid_t, ++ pub vst_atime: i64, ++ pub vst_atimensec: i64, ++ pub vst_mtime: i64, ++ pub vst_mtimensec: i64, ++ pub vst_ctime: i64, ++ pub vst_ctimensec: i64, ++ pub vst_birthtime: i64, ++ pub vst_birthtimensec: i64, ++ pub vst_size: off_t, ++ pub vst_blocks: i64, ++ pub vst_blksize: i32, ++ pub vst_flags: u32, ++ pub vst_gen: u32, ++ pub vst_rdev: u32, ++ pub vst_qspare: [i64; 2], ++ } ++ ++ pub struct vnode_info { ++ pub vi_stat: vinfo_stat, ++ pub vi_type: c_int, ++ pub vi_pad: c_int, ++ pub vi_fsid: crate::fsid_t, ++ } ++ ++ pub struct vnode_info_path { ++ pub vip_vi: vnode_info, ++ // Normally it's `vip_path: [c_char; MAXPATHLEN]` but because libc supports an old rustc ++ // version, we go around this limitation like this. ++ pub vip_path: [[c_char; 32]; 32], ++ } ++ ++ pub struct proc_vnodepathinfo { ++ pub pvi_cdir: vnode_info_path, ++ pub pvi_rdir: vnode_info_path, ++ } ++ ++ pub struct vm_statistics { ++ pub free_count: natural_t, ++ pub active_count: natural_t, ++ pub inactive_count: natural_t, ++ pub wire_count: natural_t, ++ pub zero_fill_count: natural_t, ++ pub reactivations: natural_t, ++ pub pageins: natural_t, ++ pub pageouts: natural_t, ++ pub faults: natural_t, ++ pub cow_faults: natural_t, ++ pub lookups: natural_t, ++ pub hits: natural_t, ++ pub purgeable_count: natural_t, ++ pub purges: natural_t, ++ pub speculative_count: natural_t, ++ } ++ ++ pub struct task_thread_times_info { ++ pub user_time: time_value_t, ++ pub system_time: time_value_t, ++ } ++ ++ pub struct rusage_info_v0 { ++ pub ri_uuid: [u8; 16], ++ pub ri_user_time: u64, ++ pub ri_system_time: u64, ++ pub ri_pkg_idle_wkups: u64, ++ pub ri_interrupt_wkups: u64, ++ pub ri_pageins: u64, ++ pub ri_wired_size: u64, ++ pub ri_resident_size: u64, ++ pub ri_phys_footprint: u64, ++ pub ri_proc_start_abstime: u64, ++ pub ri_proc_exit_abstime: u64, ++ } ++ ++ pub struct rusage_info_v1 { ++ pub ri_uuid: [u8; 16], ++ pub ri_user_time: u64, ++ pub ri_system_time: u64, ++ pub ri_pkg_idle_wkups: u64, ++ pub ri_interrupt_wkups: u64, ++ pub ri_pageins: u64, ++ pub ri_wired_size: u64, ++ pub ri_resident_size: u64, ++ pub ri_phys_footprint: u64, ++ pub ri_proc_start_abstime: u64, ++ pub ri_proc_exit_abstime: u64, ++ pub ri_child_user_time: u64, ++ pub ri_child_system_time: u64, ++ pub ri_child_pkg_idle_wkups: u64, ++ pub ri_child_interrupt_wkups: u64, ++ pub ri_child_pageins: u64, ++ pub ri_child_elapsed_abstime: u64, ++ } ++ ++ pub struct rusage_info_v2 { ++ pub ri_uuid: [u8; 16], ++ pub ri_user_time: u64, ++ pub ri_system_time: u64, ++ pub ri_pkg_idle_wkups: u64, ++ pub ri_interrupt_wkups: u64, ++ pub ri_pageins: u64, ++ pub ri_wired_size: u64, ++ pub ri_resident_size: u64, ++ pub ri_phys_footprint: u64, ++ pub ri_proc_start_abstime: u64, ++ pub ri_proc_exit_abstime: u64, ++ pub ri_child_user_time: u64, ++ pub ri_child_system_time: u64, ++ pub ri_child_pkg_idle_wkups: u64, ++ pub ri_child_interrupt_wkups: u64, ++ pub ri_child_pageins: u64, ++ pub ri_child_elapsed_abstime: u64, ++ pub ri_diskio_bytesread: u64, ++ pub ri_diskio_byteswritten: u64, ++ } ++ ++ pub struct rusage_info_v3 { ++ pub ri_uuid: [u8; 16], ++ pub ri_user_time: u64, ++ pub ri_system_time: u64, ++ pub ri_pkg_idle_wkups: u64, ++ pub ri_interrupt_wkups: u64, ++ pub ri_pageins: u64, ++ pub ri_wired_size: u64, ++ pub ri_resident_size: u64, ++ pub ri_phys_footprint: u64, ++ pub ri_proc_start_abstime: u64, ++ pub ri_proc_exit_abstime: u64, ++ pub ri_child_user_time: u64, ++ pub ri_child_system_time: u64, ++ pub ri_child_pkg_idle_wkups: u64, ++ pub ri_child_interrupt_wkups: u64, ++ pub ri_child_pageins: u64, ++ pub ri_child_elapsed_abstime: u64, ++ pub ri_diskio_bytesread: u64, ++ pub ri_diskio_byteswritten: u64, ++ pub ri_cpu_time_qos_default: u64, ++ pub ri_cpu_time_qos_maintenance: u64, ++ pub ri_cpu_time_qos_background: u64, ++ pub ri_cpu_time_qos_utility: u64, ++ pub ri_cpu_time_qos_legacy: u64, ++ pub ri_cpu_time_qos_user_initiated: u64, ++ pub ri_cpu_time_qos_user_interactive: u64, ++ pub ri_billed_system_time: u64, ++ pub ri_serviced_system_time: u64, ++ } ++ ++ pub struct rusage_info_v4 { ++ pub ri_uuid: [u8; 16], ++ pub ri_user_time: u64, ++ pub ri_system_time: u64, ++ pub ri_pkg_idle_wkups: u64, ++ pub ri_interrupt_wkups: u64, ++ pub ri_pageins: u64, ++ pub ri_wired_size: u64, ++ pub ri_resident_size: u64, ++ pub ri_phys_footprint: u64, ++ pub ri_proc_start_abstime: u64, ++ pub ri_proc_exit_abstime: u64, ++ pub ri_child_user_time: u64, ++ pub ri_child_system_time: u64, ++ pub ri_child_pkg_idle_wkups: u64, ++ pub ri_child_interrupt_wkups: u64, ++ pub ri_child_pageins: u64, ++ pub ri_child_elapsed_abstime: u64, ++ pub ri_diskio_bytesread: u64, ++ pub ri_diskio_byteswritten: u64, ++ pub ri_cpu_time_qos_default: u64, ++ pub ri_cpu_time_qos_maintenance: u64, ++ pub ri_cpu_time_qos_background: u64, ++ pub ri_cpu_time_qos_utility: u64, ++ pub ri_cpu_time_qos_legacy: u64, ++ pub ri_cpu_time_qos_user_initiated: u64, ++ pub ri_cpu_time_qos_user_interactive: u64, ++ pub ri_billed_system_time: u64, ++ pub ri_serviced_system_time: u64, ++ pub ri_logical_writes: u64, ++ pub ri_lifetime_max_phys_footprint: u64, ++ pub ri_instructions: u64, ++ pub ri_cycles: u64, ++ pub ri_billed_energy: u64, ++ pub ri_serviced_energy: u64, ++ pub ri_interval_max_phys_footprint: u64, ++ pub ri_runnable_time: u64, ++ } ++ ++ pub struct image_offset { ++ pub uuid: crate::uuid_t, ++ pub offset: u32, ++ } ++ ++ pub struct attrlist { ++ pub bitmapcount: c_ushort, ++ pub reserved: u16, ++ pub commonattr: attrgroup_t, ++ pub volattr: attrgroup_t, ++ pub dirattr: attrgroup_t, ++ pub fileattr: attrgroup_t, ++ pub forkattr: attrgroup_t, ++ } ++ ++ pub struct attrreference_t { ++ pub attr_dataoffset: i32, ++ pub attr_length: u32, ++ } ++ ++ pub struct vol_capabilities_attr_t { ++ pub capabilities: vol_capabilities_set_t, ++ pub valid: vol_capabilities_set_t, ++ } ++ ++ pub struct attribute_set_t { ++ pub commonattr: attrgroup_t, ++ pub volattr: attrgroup_t, ++ pub dirattr: attrgroup_t, ++ pub fileattr: attrgroup_t, ++ pub forkattr: attrgroup_t, ++ } ++ ++ pub struct vol_attributes_attr_t { ++ pub validattr: attribute_set_t, ++ pub nativeattr: attribute_set_t, ++ } ++ ++ #[repr(align(8))] ++ pub struct tcp_connection_info { ++ pub tcpi_state: u8, ++ pub tcpi_snd_wscale: u8, ++ pub tcpi_rcv_wscale: u8, ++ __pad1: u8, ++ pub tcpi_options: u32, ++ pub tcpi_flags: u32, ++ pub tcpi_rto: u32, ++ pub tcpi_maxseg: u32, ++ pub tcpi_snd_ssthresh: u32, ++ pub tcpi_snd_cwnd: u32, ++ pub tcpi_snd_wnd: u32, ++ pub tcpi_snd_sbbytes: u32, ++ pub tcpi_rcv_wnd: u32, ++ pub tcpi_rttcur: u32, ++ pub tcpi_srtt: u32, ++ pub tcpi_rttvar: u32, ++ pub tcpi_tfo_cookie_req: u32, ++ pub tcpi_tfo_cookie_rcv: u32, ++ pub tcpi_tfo_syn_loss: u32, ++ pub tcpi_tfo_syn_data_sent: u32, ++ pub tcpi_tfo_syn_data_acked: u32, ++ pub tcpi_tfo_syn_data_rcv: u32, ++ pub tcpi_tfo_cookie_req_rcv: u32, ++ pub tcpi_tfo_cookie_sent: u32, ++ pub tcpi_tfo_cookie_invalid: u32, ++ pub tcpi_tfo_cookie_wrong: u32, ++ pub tcpi_tfo_no_cookie_rcv: u32, ++ pub tcpi_tfo_heuristics_disable: u32, ++ pub tcpi_tfo_send_blackhole: u32, ++ pub tcpi_tfo_recv_blackhole: u32, ++ pub tcpi_tfo_onebyte_proxy: u32, ++ __pad2: u32, ++ pub tcpi_txpackets: u64, ++ pub tcpi_txbytes: u64, ++ pub tcpi_txretransmitbytes: u64, ++ pub tcpi_rxpackets: u64, ++ pub tcpi_rxbytes: u64, ++ pub tcpi_rxoutoforderbytes: u64, ++ pub tcpi_rxretransmitpackets: u64, ++ } ++ ++ pub struct in6_addrlifetime { ++ pub ia6t_expire: time_t, ++ pub ia6t_preferred: time_t, ++ pub ia6t_vltime: u32, ++ pub ia6t_pltime: u32, ++ } ++ ++ pub struct in6_ifstat { ++ pub ifs6_in_receive: crate::u_quad_t, ++ pub ifs6_in_hdrerr: crate::u_quad_t, ++ pub ifs6_in_toobig: crate::u_quad_t, ++ pub ifs6_in_noroute: crate::u_quad_t, ++ pub ifs6_in_addrerr: crate::u_quad_t, ++ pub ifs6_in_protounknown: crate::u_quad_t, ++ pub ifs6_in_truncated: crate::u_quad_t, ++ pub ifs6_in_discard: crate::u_quad_t, ++ pub ifs6_in_deliver: crate::u_quad_t, ++ pub ifs6_out_forward: crate::u_quad_t, ++ pub ifs6_out_request: crate::u_quad_t, ++ pub ifs6_out_discard: crate::u_quad_t, ++ pub ifs6_out_fragok: crate::u_quad_t, ++ pub ifs6_out_fragfail: crate::u_quad_t, ++ pub ifs6_out_fragcreat: crate::u_quad_t, ++ pub ifs6_reass_reqd: crate::u_quad_t, ++ pub ifs6_reass_ok: crate::u_quad_t, ++ pub ifs6_atmfrag_rcvd: crate::u_quad_t, ++ pub ifs6_reass_fail: crate::u_quad_t, ++ pub ifs6_in_mcast: crate::u_quad_t, ++ pub ifs6_out_mcast: crate::u_quad_t, ++ pub ifs6_cantfoward_icmp6: crate::u_quad_t, ++ pub ifs6_addr_expiry_cnt: crate::u_quad_t, ++ pub ifs6_pfx_expiry_cnt: crate::u_quad_t, ++ pub ifs6_defrtr_expiry_cnt: crate::u_quad_t, ++ } ++ ++ pub struct icmp6_ifstat { ++ pub ifs6_in_msg: crate::u_quad_t, ++ pub ifs6_in_error: crate::u_quad_t, ++ pub ifs6_in_dstunreach: crate::u_quad_t, ++ pub ifs6_in_adminprohib: crate::u_quad_t, ++ pub ifs6_in_timeexceed: crate::u_quad_t, ++ pub ifs6_in_paramprob: crate::u_quad_t, ++ pub ifs6_in_pkttoobig: crate::u_quad_t, ++ pub ifs6_in_echo: crate::u_quad_t, ++ pub ifs6_in_echoreply: crate::u_quad_t, ++ pub ifs6_in_routersolicit: crate::u_quad_t, ++ pub ifs6_in_routeradvert: crate::u_quad_t, ++ pub ifs6_in_neighborsolicit: crate::u_quad_t, ++ pub ifs6_in_neighboradvert: crate::u_quad_t, ++ pub ifs6_in_redirect: crate::u_quad_t, ++ pub ifs6_in_mldquery: crate::u_quad_t, ++ pub ifs6_in_mldreport: crate::u_quad_t, ++ pub ifs6_in_mlddone: crate::u_quad_t, ++ pub ifs6_out_msg: crate::u_quad_t, ++ pub ifs6_out_error: crate::u_quad_t, ++ pub ifs6_out_dstunreach: crate::u_quad_t, ++ pub ifs6_out_adminprohib: crate::u_quad_t, ++ pub ifs6_out_timeexceed: crate::u_quad_t, ++ pub ifs6_out_paramprob: crate::u_quad_t, ++ pub ifs6_out_pkttoobig: crate::u_quad_t, ++ pub ifs6_out_echo: crate::u_quad_t, ++ pub ifs6_out_echoreply: crate::u_quad_t, ++ pub ifs6_out_routersolicit: crate::u_quad_t, ++ pub ifs6_out_routeradvert: crate::u_quad_t, ++ pub ifs6_out_neighborsolicit: crate::u_quad_t, ++ pub ifs6_out_neighboradvert: crate::u_quad_t, ++ pub ifs6_out_redirect: crate::u_quad_t, ++ pub ifs6_out_mldquery: crate::u_quad_t, ++ pub ifs6_out_mldreport: crate::u_quad_t, ++ pub ifs6_out_mlddone: crate::u_quad_t, ++ } ++ ++ // mach/host_info.h ++ pub struct host_cpu_load_info { ++ pub cpu_ticks: [crate::natural_t; CPU_STATE_MAX as usize], ++ } ++ ++ // net/if_mib.h ++ pub struct ifmibdata { ++ /// Name of interface ++ pub ifmd_name: [c_char; crate::IFNAMSIZ], ++ /// Number of promiscuous listeners ++ pub ifmd_pcount: c_uint, ++ /// Interface flags ++ pub ifmd_flags: c_uint, ++ /// Instantaneous length of send queue ++ pub ifmd_snd_len: c_uint, ++ /// Maximum length of send queue ++ pub ifmd_snd_maxlen: c_uint, ++ /// Number of drops in send queue ++ pub ifmd_snd_drops: c_uint, ++ /// For future expansion ++ pub ifmd_filler: [c_uint; 4], ++ /// Generic information and statistics ++ pub ifmd_data: if_data64, ++ } ++ ++ pub struct ifs_iso_8802_3 { ++ pub dot3StatsAlignmentErrors: u32, ++ pub dot3StatsFCSErrors: u32, ++ pub dot3StatsSingleCollisionFrames: u32, ++ pub dot3StatsMultipleCollisionFrames: u32, ++ pub dot3StatsSQETestErrors: u32, ++ pub dot3StatsDeferredTransmissions: u32, ++ pub dot3StatsLateCollisions: u32, ++ pub dot3StatsExcessiveCollisions: u32, ++ pub dot3StatsInternalMacTransmitErrors: u32, ++ pub dot3StatsCarrierSenseErrors: u32, ++ pub dot3StatsFrameTooLongs: u32, ++ pub dot3StatsInternalMacReceiveErrors: u32, ++ pub dot3StatsEtherChipSet: u32, ++ pub dot3StatsMissedFrames: u32, ++ pub dot3StatsCollFrequencies: [u32; 16], ++ pub dot3Compliance: u32, ++ } ++ ++ // kern_control.h ++ pub struct ctl_info { ++ pub ctl_id: u32, ++ pub ctl_name: [c_char; MAX_KCTL_NAME], ++ } ++} ++ ++s_no_extra_traits! { ++ #[repr(packed(4))] ++ pub struct ifconf { ++ pub ifc_len: c_int, ++ pub ifc_ifcu: __c_anonymous_ifc_ifcu, ++ } ++ ++ #[repr(packed(4))] ++ pub struct kevent { ++ pub ident: crate::uintptr_t, ++ pub filter: i16, ++ pub flags: u16, ++ pub fflags: u32, ++ pub data: intptr_t, ++ pub udata: *mut c_void, ++ } ++ ++ #[repr(packed(4))] ++ pub struct semid_ds { ++ // Note the manpage shows different types than the system header. ++ pub sem_perm: ipc_perm, ++ pub sem_base: i32, ++ pub sem_nsems: c_ushort, ++ pub sem_otime: crate::time_t, ++ pub sem_pad1: i32, ++ pub sem_ctime: crate::time_t, ++ pub sem_pad2: i32, ++ pub sem_pad3: [i32; 4], ++ } ++ ++ #[repr(packed(4))] ++ pub struct shmid_ds { ++ pub shm_perm: ipc_perm, ++ pub shm_segsz: size_t, ++ pub shm_lpid: crate::pid_t, ++ pub shm_cpid: crate::pid_t, ++ pub shm_nattch: crate::shmatt_t, ++ pub shm_atime: crate::time_t, // FIXME: 64-bit wrong align => wrong offset ++ pub shm_dtime: crate::time_t, // FIXME: 64-bit wrong align => wrong offset ++ pub shm_ctime: crate::time_t, // FIXME: 64-bit wrong align => wrong offset ++ // FIXME: 64-bit wrong align => wrong offset: ++ pub shm_internal: *mut c_void, ++ } ++ ++ pub struct proc_threadinfo { ++ pub pth_user_time: u64, ++ pub pth_system_time: u64, ++ pub pth_cpu_usage: i32, ++ pub pth_policy: i32, ++ pub pth_run_state: i32, ++ pub pth_flags: i32, ++ pub pth_sleep_time: i32, ++ pub pth_curpri: i32, ++ pub pth_priority: i32, ++ pub pth_maxpriority: i32, ++ pub pth_name: [c_char; MAXTHREADNAMESIZE], ++ } ++ ++ pub struct statfs { ++ pub f_bsize: u32, ++ pub f_iosize: i32, ++ pub f_blocks: u64, ++ pub f_bfree: u64, ++ pub f_bavail: u64, ++ pub f_files: u64, ++ pub f_ffree: u64, ++ pub f_fsid: crate::fsid_t, ++ pub f_owner: crate::uid_t, ++ pub f_type: u32, ++ pub f_flags: u32, ++ pub f_fssubtype: u32, ++ 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 struct dirent { ++ pub d_ino: u64, ++ pub d_seekoff: u64, ++ pub d_reclen: u16, ++ pub d_namlen: u16, ++ pub d_type: u8, ++ pub d_name: [c_char; 1024], ++ } ++ ++ pub struct pthread_rwlock_t { ++ __sig: c_long, ++ __opaque: [u8; __PTHREAD_RWLOCK_SIZE__], ++ } ++ ++ pub struct pthread_mutex_t { ++ __sig: c_long, ++ __opaque: [u8; __PTHREAD_MUTEX_SIZE__], ++ } ++ ++ pub struct pthread_cond_t { ++ __sig: c_long, ++ __opaque: [u8; __PTHREAD_COND_SIZE__], ++ } ++ ++ pub struct sockaddr_storage { ++ pub ss_len: u8, ++ pub ss_family: crate::sa_family_t, ++ __ss_pad1: [u8; 6], ++ __ss_align: i64, ++ __ss_pad2: [u8; 112], ++ } ++ ++ pub struct utmpx { ++ pub ut_user: [c_char; _UTX_USERSIZE], ++ pub ut_id: [c_char; _UTX_IDSIZE], ++ pub ut_line: [c_char; _UTX_LINESIZE], ++ pub ut_pid: crate::pid_t, ++ pub ut_type: c_short, ++ pub ut_tv: crate::timeval, ++ pub ut_host: [c_char; _UTX_HOSTSIZE], ++ ut_pad: [u32; 16], ++ } ++ ++ pub struct sigevent { ++ pub sigev_notify: c_int, ++ pub sigev_signo: c_int, ++ pub sigev_value: crate::sigval, ++ __unused1: *mut c_void, //actually a function pointer ++ pub sigev_notify_attributes: *mut crate::pthread_attr_t, ++ } ++ ++ pub struct processor_cpu_load_info { ++ pub cpu_ticks: [c_uint; CPU_STATE_MAX as usize], ++ } ++ ++ pub struct processor_basic_info { ++ pub cpu_type: cpu_type_t, ++ pub cpu_subtype: cpu_subtype_t, ++ pub running: crate::boolean_t, ++ pub slot_num: c_int, ++ pub is_master: crate::boolean_t, ++ } ++ ++ pub struct processor_set_basic_info { ++ pub processor_count: c_int, ++ pub default_policy: c_int, ++ } ++ ++ pub struct processor_set_load_info { ++ pub task_count: c_int, ++ pub thread_count: c_int, ++ pub load_average: integer_t, ++ pub mach_factor: integer_t, ++ } ++ ++ pub struct time_value_t { ++ pub seconds: integer_t, ++ pub microseconds: integer_t, ++ } ++ ++ pub struct thread_basic_info { ++ pub user_time: time_value_t, ++ pub system_time: time_value_t, ++ pub cpu_usage: crate::integer_t, ++ pub policy: crate::policy_t, ++ pub run_state: crate::integer_t, ++ pub flags: crate::integer_t, ++ pub suspend_count: crate::integer_t, ++ pub sleep_time: crate::integer_t, ++ } ++ ++ pub struct thread_identifier_info { ++ pub thread_id: u64, ++ pub thread_handle: u64, ++ pub dispatch_qaddr: u64, ++ } ++ ++ pub struct thread_extended_info { ++ pub pth_user_time: u64, ++ pub pth_system_time: u64, ++ pub pth_cpu_usage: i32, ++ pub pth_policy: i32, ++ pub pth_run_state: i32, ++ pub pth_flags: i32, ++ pub pth_sleep_time: i32, ++ pub pth_curpri: i32, ++ pub pth_priority: i32, ++ pub pth_maxpriority: i32, ++ pub pth_name: [c_char; MAXTHREADNAMESIZE], ++ } ++ ++ #[repr(packed(4))] ++ pub struct if_data64 { ++ pub ifi_type: c_uchar, ++ pub ifi_typelen: c_uchar, ++ pub ifi_physical: c_uchar, ++ pub ifi_addrlen: c_uchar, ++ pub ifi_hdrlen: c_uchar, ++ pub ifi_recvquota: c_uchar, ++ pub ifi_xmitquota: c_uchar, ++ pub ifi_unused1: c_uchar, ++ pub ifi_mtu: u32, ++ pub ifi_metric: u32, ++ pub ifi_baudrate: u64, ++ pub ifi_ipackets: u64, ++ pub ifi_ierrors: u64, ++ pub ifi_opackets: u64, ++ pub ifi_oerrors: u64, ++ pub ifi_collisions: u64, ++ pub ifi_ibytes: u64, ++ pub ifi_obytes: u64, ++ pub ifi_imcasts: u64, ++ pub ifi_omcasts: u64, ++ pub ifi_iqdrops: u64, ++ pub ifi_noproto: u64, ++ pub ifi_recvtiming: u32, ++ pub ifi_xmittiming: u32, ++ #[cfg(target_pointer_width = "32")] ++ pub ifi_lastchange: crate::timeval, ++ #[cfg(not(target_pointer_width = "32"))] ++ pub ifi_lastchange: timeval32, ++ } ++ ++ #[repr(packed(4))] ++ pub struct if_msghdr2 { ++ pub ifm_msglen: c_ushort, ++ pub ifm_version: c_uchar, ++ pub ifm_type: c_uchar, ++ pub ifm_addrs: c_int, ++ pub ifm_flags: c_int, ++ pub ifm_index: c_ushort, ++ pub ifm_snd_len: c_int, ++ pub ifm_snd_maxlen: c_int, ++ pub ifm_snd_drops: c_int, ++ pub ifm_timer: c_int, ++ pub ifm_data: if_data64, ++ } ++ ++ #[repr(packed(8))] ++ pub struct vm_statistics64 { ++ pub free_count: natural_t, ++ pub active_count: natural_t, ++ pub inactive_count: natural_t, ++ pub wire_count: natural_t, ++ pub zero_fill_count: u64, ++ pub reactivations: u64, ++ pub pageins: u64, ++ pub pageouts: u64, ++ pub faults: u64, ++ pub cow_faults: u64, ++ pub lookups: u64, ++ pub hits: u64, ++ pub purges: u64, ++ pub purgeable_count: natural_t, ++ pub speculative_count: natural_t, ++ pub decompressions: u64, ++ pub compressions: u64, ++ pub swapins: u64, ++ pub swapouts: u64, ++ pub compressor_page_count: natural_t, ++ pub throttled_count: natural_t, ++ pub external_page_count: natural_t, ++ pub internal_page_count: natural_t, ++ pub total_uncompressed_pages_in_compressor: u64, ++ } ++ ++ #[repr(packed(4))] ++ pub struct mach_task_basic_info { ++ pub virtual_size: mach_vm_size_t, ++ pub resident_size: mach_vm_size_t, ++ pub resident_size_max: mach_vm_size_t, ++ pub user_time: time_value_t, ++ pub system_time: time_value_t, ++ pub policy: crate::policy_t, ++ pub suspend_count: integer_t, ++ } ++ ++ #[repr(packed(4))] ++ pub struct log2phys { ++ pub l2p_flags: c_uint, ++ pub l2p_contigbytes: off_t, ++ pub l2p_devoffset: off_t, ++ } ++ ++ pub struct os_unfair_lock_s { ++ _os_unfair_lock_opaque: u32, ++ } ++ ++ #[repr(packed(1))] ++ pub struct sockaddr_vm { ++ pub svm_len: c_uchar, ++ pub svm_family: crate::sa_family_t, ++ pub svm_reserved1: c_ushort, ++ pub svm_port: c_uint, ++ pub svm_cid: c_uint, ++ } ++ ++ pub struct ifdevmtu { ++ pub ifdm_current: c_int, ++ pub ifdm_min: c_int, ++ pub ifdm_max: c_int, ++ } ++ ++ pub union __c_anonymous_ifk_data { ++ pub ifk_ptr: *mut c_void, ++ pub ifk_value: c_int, ++ } ++ ++ #[repr(packed(4))] ++ pub struct ifkpi { ++ pub ifk_module_id: c_uint, ++ pub ifk_type: c_uint, ++ pub ifk_data: __c_anonymous_ifk_data, ++ } ++ ++ pub union __c_anonymous_ifr_ifru { ++ pub ifru_addr: crate::sockaddr, ++ pub ifru_dstaddr: crate::sockaddr, ++ pub ifru_broadaddr: crate::sockaddr, ++ pub ifru_flags: c_short, ++ pub ifru_metrics: c_int, ++ pub ifru_mtu: c_int, ++ pub ifru_phys: c_int, ++ pub ifru_media: c_int, ++ pub ifru_intval: c_int, ++ pub ifru_data: *mut c_char, ++ pub ifru_devmtu: ifdevmtu, ++ pub ifru_kpi: ifkpi, ++ pub ifru_wake_flags: u32, ++ pub ifru_route_refcnt: u32, ++ pub ifru_cap: [c_int; 2], ++ pub ifru_functional_type: u32, ++ } ++ ++ pub struct ifreq { ++ pub ifr_name: [c_char; crate::IFNAMSIZ], ++ pub ifr_ifru: __c_anonymous_ifr_ifru, ++ } ++ ++ pub union __c_anonymous_ifc_ifcu { ++ pub ifcu_buf: *mut c_char, ++ pub ifcu_req: *mut ifreq, ++ } ++ ++ pub union __c_anonymous_ifr_ifru6 { ++ pub ifru_addr: crate::sockaddr_in6, ++ pub ifru_dstaddr: crate::sockaddr_in6, ++ pub ifru_flags: c_int, ++ pub ifru_flags6: c_int, ++ pub ifru_metrics: c_int, ++ pub ifru_intval: c_int, ++ pub ifru_data: *mut c_char, ++ pub ifru_lifetime: in6_addrlifetime, ++ pub ifru_stat: in6_ifstat, ++ pub ifru_icmp6stat: icmp6_ifstat, ++ pub ifru_scope_id: [u32; SCOPE6_ID_MAX], ++ } ++ ++ pub struct in6_ifreq { ++ pub ifr_name: [c_char; crate::IFNAMSIZ], ++ pub ifr_ifru: __c_anonymous_ifr_ifru6, ++ } ++} ++ ++impl siginfo_t { ++ pub unsafe fn si_addr(&self) -> *mut c_void { ++ self.si_addr ++ } ++ ++ pub unsafe fn si_value(&self) -> crate::sigval { ++ #[repr(C)] ++ struct siginfo_timer { ++ _si_signo: c_int, ++ _si_errno: c_int, ++ _si_code: c_int, ++ _si_pid: crate::pid_t, ++ _si_uid: crate::uid_t, ++ _si_status: c_int, ++ _si_addr: *mut c_void, ++ si_value: crate::sigval, ++ } ++ ++ (*(self as *const siginfo_t as *const siginfo_timer)).si_value ++ } ++ ++ pub unsafe fn si_pid(&self) -> crate::pid_t { ++ self.si_pid ++ } ++ ++ pub unsafe fn si_uid(&self) -> crate::uid_t { ++ self.si_uid ++ } ++ ++ pub unsafe fn si_status(&self) -> c_int { ++ self.si_status ++ } ++} ++ ++s_no_extra_traits! { ++ pub union semun { ++ pub val: c_int, ++ pub buf: *mut semid_ds, ++ pub array: *mut c_ushort, ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for semun { ++ fn eq(&self, other: &semun) -> bool { ++ unsafe { self.val == other.val } ++ } ++ } ++ impl Eq for semun {} ++ impl hash::Hash for semun { ++ fn hash(&self, state: &mut H) { ++ unsafe { self.val.hash(state) }; ++ } ++ } ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for ifconf ++ where ++ Self: Copy, ++ { ++ fn eq(&self, other: &Self) -> bool { ++ let len_ptr1 = core::ptr::addr_of!(self.ifc_len); ++ let len_ptr2 = core::ptr::addr_of!(other.ifc_len); ++ let ifcu_ptr1 = core::ptr::addr_of!(self.ifc_ifcu); ++ let ifcu_ptr2 = core::ptr::addr_of!(other.ifc_ifcu); ++ ++ // SAFETY: `ifconf` implements `Copy` so the reads are valid ++ let len1 = unsafe { len_ptr1.read_unaligned() }; ++ let len2 = unsafe { len_ptr2.read_unaligned() }; ++ let ifcu1 = unsafe { ifcu_ptr1.read_unaligned() }; ++ let ifcu2 = unsafe { ifcu_ptr2.read_unaligned() }; ++ ++ len1 == len2 && ifcu1 == ifcu2 ++ } ++ } ++ impl Eq for ifconf {} ++ impl fmt::Debug for ifconf { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("ifconf").finish_non_exhaustive() ++ } ++ } ++ ++ impl PartialEq for kevent { ++ fn eq(&self, other: &kevent) -> bool { ++ self.ident == other.ident ++ && self.filter == other.filter ++ && self.flags == other.flags ++ && self.fflags == other.fflags ++ && self.data == other.data ++ && self.udata == other.udata ++ } ++ } ++ impl Eq for kevent {} ++ impl fmt::Debug for kevent { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ let ident = self.ident; ++ let filter = self.filter; ++ let flags = self.flags; ++ let fflags = self.fflags; ++ let data = self.data; ++ let udata = self.udata; ++ f.debug_struct("kevent") ++ .field("ident", &ident) ++ .field("filter", &filter) ++ .field("flags", &flags) ++ .field("fflags", &fflags) ++ .field("data", &data) ++ .field("udata", &udata) ++ .finish() ++ } ++ } ++ impl hash::Hash for kevent { ++ fn hash(&self, state: &mut H) { ++ let ident = self.ident; ++ let filter = self.filter; ++ let flags = self.flags; ++ let fflags = self.fflags; ++ let data = self.data; ++ let udata = self.udata; ++ ident.hash(state); ++ filter.hash(state); ++ flags.hash(state); ++ fflags.hash(state); ++ data.hash(state); ++ udata.hash(state); ++ } ++ } ++ ++ impl PartialEq for semid_ds { ++ fn eq(&self, other: &semid_ds) -> bool { ++ let sem_perm = self.sem_perm; ++ let sem_pad3 = self.sem_pad3; ++ let other_sem_perm = other.sem_perm; ++ let other_sem_pad3 = other.sem_pad3; ++ sem_perm == other_sem_perm ++ && self.sem_base == other.sem_base ++ && self.sem_nsems == other.sem_nsems ++ && self.sem_otime == other.sem_otime ++ && self.sem_pad1 == other.sem_pad1 ++ && self.sem_ctime == other.sem_ctime ++ && self.sem_pad2 == other.sem_pad2 ++ && sem_pad3 == other_sem_pad3 ++ } ++ } ++ impl Eq for semid_ds {} ++ impl fmt::Debug for semid_ds { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ let sem_perm = self.sem_perm; ++ let sem_base = self.sem_base; ++ let sem_nsems = self.sem_nsems; ++ let sem_otime = self.sem_otime; ++ let sem_pad1 = self.sem_pad1; ++ let sem_ctime = self.sem_ctime; ++ let sem_pad2 = self.sem_pad2; ++ let sem_pad3 = self.sem_pad3; ++ f.debug_struct("semid_ds") ++ .field("sem_perm", &sem_perm) ++ .field("sem_base", &sem_base) ++ .field("sem_nsems", &sem_nsems) ++ .field("sem_otime", &sem_otime) ++ .field("sem_pad1", &sem_pad1) ++ .field("sem_ctime", &sem_ctime) ++ .field("sem_pad2", &sem_pad2) ++ .field("sem_pad3", &sem_pad3) ++ .finish() ++ } ++ } ++ impl hash::Hash for semid_ds { ++ fn hash(&self, state: &mut H) { ++ let sem_perm = self.sem_perm; ++ let sem_base = self.sem_base; ++ let sem_nsems = self.sem_nsems; ++ let sem_otime = self.sem_otime; ++ let sem_pad1 = self.sem_pad1; ++ let sem_ctime = self.sem_ctime; ++ let sem_pad2 = self.sem_pad2; ++ let sem_pad3 = self.sem_pad3; ++ sem_perm.hash(state); ++ sem_base.hash(state); ++ sem_nsems.hash(state); ++ sem_otime.hash(state); ++ sem_pad1.hash(state); ++ sem_ctime.hash(state); ++ sem_pad2.hash(state); ++ sem_pad3.hash(state); ++ } ++ } ++ ++ impl PartialEq for shmid_ds { ++ fn eq(&self, other: &shmid_ds) -> bool { ++ let shm_perm = self.shm_perm; ++ let other_shm_perm = other.shm_perm; ++ shm_perm == other_shm_perm ++ && self.shm_segsz == other.shm_segsz ++ && self.shm_lpid == other.shm_lpid ++ && self.shm_cpid == other.shm_cpid ++ && self.shm_nattch == other.shm_nattch ++ && self.shm_atime == other.shm_atime ++ && self.shm_dtime == other.shm_dtime ++ && self.shm_ctime == other.shm_ctime ++ && self.shm_internal == other.shm_internal ++ } ++ } ++ impl Eq for shmid_ds {} ++ impl fmt::Debug for shmid_ds { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ let shm_perm = self.shm_perm; ++ let shm_segsz = self.shm_segsz; ++ let shm_lpid = self.shm_lpid; ++ let shm_cpid = self.shm_cpid; ++ let shm_nattch = self.shm_nattch; ++ let shm_atime = self.shm_atime; ++ let shm_dtime = self.shm_dtime; ++ let shm_ctime = self.shm_ctime; ++ let shm_internal = self.shm_internal; ++ f.debug_struct("shmid_ds") ++ .field("shm_perm", &shm_perm) ++ .field("shm_segsz", &shm_segsz) ++ .field("shm_lpid", &shm_lpid) ++ .field("shm_cpid", &shm_cpid) ++ .field("shm_nattch", &shm_nattch) ++ .field("shm_atime", &shm_atime) ++ .field("shm_dtime", &shm_dtime) ++ .field("shm_ctime", &shm_ctime) ++ .field("shm_internal", &shm_internal) ++ .finish() ++ } ++ } ++ impl hash::Hash for shmid_ds { ++ fn hash(&self, state: &mut H) { ++ let shm_perm = self.shm_perm; ++ let shm_segsz = self.shm_segsz; ++ let shm_lpid = self.shm_lpid; ++ let shm_cpid = self.shm_cpid; ++ let shm_nattch = self.shm_nattch; ++ let shm_atime = self.shm_atime; ++ let shm_dtime = self.shm_dtime; ++ let shm_ctime = self.shm_ctime; ++ let shm_internal = self.shm_internal; ++ shm_perm.hash(state); ++ shm_segsz.hash(state); ++ shm_lpid.hash(state); ++ shm_cpid.hash(state); ++ shm_nattch.hash(state); ++ shm_atime.hash(state); ++ shm_dtime.hash(state); ++ shm_ctime.hash(state); ++ shm_internal.hash(state); ++ } ++ } ++ ++ impl PartialEq for proc_threadinfo { ++ fn eq(&self, other: &proc_threadinfo) -> bool { ++ self.pth_user_time == other.pth_user_time ++ && self.pth_system_time == other.pth_system_time ++ && self.pth_cpu_usage == other.pth_cpu_usage ++ && self.pth_policy == other.pth_policy ++ && self.pth_run_state == other.pth_run_state ++ && self.pth_flags == other.pth_flags ++ && self.pth_sleep_time == other.pth_sleep_time ++ && self.pth_curpri == other.pth_curpri ++ && self.pth_priority == other.pth_priority ++ && self.pth_maxpriority == other.pth_maxpriority ++ && self ++ .pth_name ++ .iter() ++ .zip(other.pth_name.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for proc_threadinfo {} ++ impl fmt::Debug for proc_threadinfo { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("proc_threadinfo") ++ .field("pth_user_time", &self.pth_user_time) ++ .field("pth_system_time", &self.pth_system_time) ++ .field("pth_cpu_usage", &self.pth_cpu_usage) ++ .field("pth_policy", &self.pth_policy) ++ .field("pth_run_state", &self.pth_run_state) ++ .field("pth_flags", &self.pth_flags) ++ .field("pth_sleep_time", &self.pth_sleep_time) ++ .field("pth_curpri", &self.pth_curpri) ++ .field("pth_priority", &self.pth_priority) ++ .field("pth_maxpriority", &self.pth_maxpriority) ++ // FIXME: .field("pth_name", &self.pth_name) ++ .finish() ++ } ++ } ++ impl hash::Hash for proc_threadinfo { ++ fn hash(&self, state: &mut H) { ++ self.pth_user_time.hash(state); ++ self.pth_system_time.hash(state); ++ self.pth_cpu_usage.hash(state); ++ self.pth_policy.hash(state); ++ self.pth_run_state.hash(state); ++ self.pth_flags.hash(state); ++ self.pth_sleep_time.hash(state); ++ self.pth_curpri.hash(state); ++ self.pth_priority.hash(state); ++ self.pth_maxpriority.hash(state); ++ self.pth_name.hash(state); ++ } ++ } ++ ++ impl PartialEq for statfs { ++ fn eq(&self, other: &statfs) -> bool { ++ self.f_bsize == other.f_bsize ++ && self.f_iosize == other.f_iosize ++ && self.f_blocks == other.f_blocks ++ && self.f_bfree == other.f_bfree ++ && self.f_bavail == other.f_bavail ++ && self.f_files == other.f_files ++ && self.f_ffree == other.f_ffree ++ && self.f_fsid == other.f_fsid ++ && self.f_owner == other.f_owner ++ && self.f_flags == other.f_flags ++ && self.f_fssubtype == other.f_fssubtype ++ && self.f_fstypename == other.f_fstypename ++ && self.f_type == other.f_type ++ && self ++ .f_mntonname ++ .iter() ++ .zip(other.f_mntonname.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .f_mntfromname ++ .iter() ++ .zip(other.f_mntfromname.iter()) ++ .all(|(a, b)| a == b) ++ && self.f_reserved == other.f_reserved ++ } ++ } ++ ++ impl Eq for statfs {} ++ impl fmt::Debug for statfs { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("statfs") ++ .field("f_bsize", &self.f_bsize) ++ .field("f_iosize", &self.f_iosize) ++ .field("f_blocks", &self.f_blocks) ++ .field("f_bfree", &self.f_bfree) ++ .field("f_bavail", &self.f_bavail) ++ .field("f_files", &self.f_files) ++ .field("f_ffree", &self.f_ffree) ++ .field("f_fsid", &self.f_fsid) ++ .field("f_owner", &self.f_owner) ++ .field("f_flags", &self.f_flags) ++ .field("f_fssubtype", &self.f_fssubtype) ++ .field("f_fstypename", &self.f_fstypename) ++ .field("f_type", &self.f_type) ++ // FIXME: .field("f_mntonname", &self.f_mntonname) ++ // FIXME: .field("f_mntfromname", &self.f_mntfromname) ++ .field("f_reserved", &self.f_reserved) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for statfs { ++ fn hash(&self, state: &mut H) { ++ self.f_bsize.hash(state); ++ self.f_iosize.hash(state); ++ self.f_blocks.hash(state); ++ self.f_bfree.hash(state); ++ self.f_bavail.hash(state); ++ self.f_files.hash(state); ++ self.f_ffree.hash(state); ++ self.f_fsid.hash(state); ++ self.f_owner.hash(state); ++ self.f_flags.hash(state); ++ self.f_fssubtype.hash(state); ++ self.f_fstypename.hash(state); ++ self.f_type.hash(state); ++ self.f_mntonname.hash(state); ++ self.f_mntfromname.hash(state); ++ self.f_reserved.hash(state); ++ } ++ } ++ ++ impl PartialEq for dirent { ++ fn eq(&self, other: &dirent) -> bool { ++ self.d_ino == other.d_ino ++ && self.d_seekoff == other.d_seekoff ++ && self.d_reclen == other.d_reclen ++ && self.d_namlen == other.d_namlen ++ && self.d_type == other.d_type ++ && self ++ .d_name ++ .iter() ++ .zip(other.d_name.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for dirent {} ++ impl fmt::Debug for dirent { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("dirent") ++ .field("d_ino", &self.d_ino) ++ .field("d_seekoff", &self.d_seekoff) ++ .field("d_reclen", &self.d_reclen) ++ .field("d_namlen", &self.d_namlen) ++ .field("d_type", &self.d_type) ++ // FIXME: .field("d_name", &self.d_name) ++ .finish() ++ } ++ } ++ impl hash::Hash for dirent { ++ fn hash(&self, state: &mut H) { ++ self.d_ino.hash(state); ++ self.d_seekoff.hash(state); ++ self.d_reclen.hash(state); ++ self.d_namlen.hash(state); ++ self.d_type.hash(state); ++ self.d_name.hash(state); ++ } ++ } ++ impl PartialEq for pthread_rwlock_t { ++ fn eq(&self, other: &pthread_rwlock_t) -> bool { ++ self.__sig == other.__sig ++ && self ++ .__opaque ++ .iter() ++ .zip(other.__opaque.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for pthread_rwlock_t {} ++ impl fmt::Debug for pthread_rwlock_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("pthread_rwlock_t") ++ .field("__sig", &self.__sig) ++ // FIXME: .field("__opaque", &self.__opaque) ++ .finish() ++ } ++ } ++ impl hash::Hash for pthread_rwlock_t { ++ fn hash(&self, state: &mut H) { ++ self.__sig.hash(state); ++ self.__opaque.hash(state); ++ } ++ } ++ ++ impl PartialEq for pthread_mutex_t { ++ fn eq(&self, other: &pthread_mutex_t) -> bool { ++ self.__sig == other.__sig ++ && self ++ .__opaque ++ .iter() ++ .zip(other.__opaque.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ ++ impl Eq for pthread_mutex_t {} ++ ++ impl fmt::Debug for pthread_mutex_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("pthread_mutex_t") ++ .field("__sig", &self.__sig) ++ // FIXME: .field("__opaque", &self.__opaque) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for pthread_mutex_t { ++ fn hash(&self, state: &mut H) { ++ self.__sig.hash(state); ++ self.__opaque.hash(state); ++ } ++ } ++ ++ impl PartialEq for pthread_cond_t { ++ fn eq(&self, other: &pthread_cond_t) -> bool { ++ self.__sig == other.__sig ++ && self ++ .__opaque ++ .iter() ++ .zip(other.__opaque.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ ++ impl Eq for pthread_cond_t {} ++ ++ impl fmt::Debug for pthread_cond_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("pthread_cond_t") ++ .field("__sig", &self.__sig) ++ // FIXME: .field("__opaque", &self.__opaque) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for pthread_cond_t { ++ fn hash(&self, state: &mut H) { ++ self.__sig.hash(state); ++ self.__opaque.hash(state); ++ } ++ } ++ ++ impl PartialEq for sockaddr_storage { ++ fn eq(&self, other: &sockaddr_storage) -> bool { ++ self.ss_len == other.ss_len ++ && self.ss_family == other.ss_family ++ && self ++ .__ss_pad1 ++ .iter() ++ .zip(other.__ss_pad1.iter()) ++ .all(|(a, b)| a == b) ++ && self.__ss_align == other.__ss_align ++ && self ++ .__ss_pad2 ++ .iter() ++ .zip(other.__ss_pad2.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ ++ impl Eq for sockaddr_storage {} ++ ++ impl fmt::Debug for sockaddr_storage { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sockaddr_storage") ++ .field("ss_len", &self.ss_len) ++ .field("ss_family", &self.ss_family) ++ .field("__ss_pad1", &self.__ss_pad1) ++ .field("__ss_align", &self.__ss_align) ++ // FIXME: .field("__ss_pad2", &self.__ss_pad2) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for sockaddr_storage { ++ fn hash(&self, state: &mut H) { ++ self.ss_len.hash(state); ++ self.ss_family.hash(state); ++ self.__ss_pad1.hash(state); ++ self.__ss_align.hash(state); ++ self.__ss_pad2.hash(state); ++ } ++ } ++ ++ impl PartialEq for utmpx { ++ fn eq(&self, other: &utmpx) -> bool { ++ self.ut_user ++ .iter() ++ .zip(other.ut_user.iter()) ++ .all(|(a, b)| a == b) ++ && self.ut_id == other.ut_id ++ && self.ut_line == other.ut_line ++ && self.ut_pid == other.ut_pid ++ && self.ut_type == other.ut_type ++ && self.ut_tv == other.ut_tv ++ && self ++ .ut_host ++ .iter() ++ .zip(other.ut_host.iter()) ++ .all(|(a, b)| a == b) ++ && self.ut_pad == other.ut_pad ++ } ++ } ++ ++ impl Eq for utmpx {} ++ ++ impl fmt::Debug for utmpx { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("utmpx") ++ // FIXME: .field("ut_user", &self.ut_user) ++ .field("ut_id", &self.ut_id) ++ .field("ut_line", &self.ut_line) ++ .field("ut_pid", &self.ut_pid) ++ .field("ut_type", &self.ut_type) ++ .field("ut_tv", &self.ut_tv) ++ // FIXME: .field("ut_host", &self.ut_host) ++ .field("ut_pad", &self.ut_pad) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for utmpx { ++ fn hash(&self, state: &mut H) { ++ self.ut_user.hash(state); ++ self.ut_id.hash(state); ++ self.ut_line.hash(state); ++ self.ut_pid.hash(state); ++ self.ut_type.hash(state); ++ self.ut_tv.hash(state); ++ self.ut_host.hash(state); ++ self.ut_pad.hash(state); ++ } ++ } ++ ++ impl PartialEq for sigevent { ++ fn eq(&self, other: &sigevent) -> bool { ++ self.sigev_notify == other.sigev_notify ++ && self.sigev_signo == other.sigev_signo ++ && self.sigev_value == other.sigev_value ++ && self.sigev_notify_attributes == other.sigev_notify_attributes ++ } ++ } ++ ++ impl Eq for sigevent {} ++ ++ impl fmt::Debug for sigevent { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sigevent") ++ .field("sigev_notify", &self.sigev_notify) ++ .field("sigev_signo", &self.sigev_signo) ++ .field("sigev_value", &self.sigev_value) ++ .field("sigev_notify_attributes", &self.sigev_notify_attributes) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for sigevent { ++ fn hash(&self, state: &mut H) { ++ self.sigev_notify.hash(state); ++ self.sigev_signo.hash(state); ++ self.sigev_value.hash(state); ++ self.sigev_notify_attributes.hash(state); ++ } ++ } ++ ++ impl PartialEq for processor_cpu_load_info { ++ fn eq(&self, other: &processor_cpu_load_info) -> bool { ++ self.cpu_ticks == other.cpu_ticks ++ } ++ } ++ impl Eq for processor_cpu_load_info {} ++ impl fmt::Debug for processor_cpu_load_info { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("processor_cpu_load_info") ++ .field("cpu_ticks", &self.cpu_ticks) ++ .finish() ++ } ++ } ++ impl hash::Hash for processor_cpu_load_info { ++ fn hash(&self, state: &mut H) { ++ self.cpu_ticks.hash(state); ++ } ++ } ++ ++ impl PartialEq for processor_basic_info { ++ fn eq(&self, other: &processor_basic_info) -> bool { ++ self.cpu_type == other.cpu_type ++ && self.cpu_subtype == other.cpu_subtype ++ && self.running == other.running ++ && self.slot_num == other.slot_num ++ && self.is_master == other.is_master ++ } ++ } ++ impl Eq for processor_basic_info {} ++ impl fmt::Debug for processor_basic_info { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("processor_basic_info") ++ .field("cpu_type", &self.cpu_type) ++ .field("cpu_subtype", &self.cpu_subtype) ++ .field("running", &self.running) ++ .field("slot_num", &self.slot_num) ++ .field("is_master", &self.is_master) ++ .finish() ++ } ++ } ++ impl hash::Hash for processor_basic_info { ++ fn hash(&self, state: &mut H) { ++ self.cpu_type.hash(state); ++ self.cpu_subtype.hash(state); ++ self.running.hash(state); ++ self.slot_num.hash(state); ++ self.is_master.hash(state); ++ } ++ } ++ ++ impl PartialEq for processor_set_basic_info { ++ fn eq(&self, other: &processor_set_basic_info) -> bool { ++ self.processor_count == other.processor_count ++ && self.default_policy == other.default_policy ++ } ++ } ++ impl Eq for processor_set_basic_info {} ++ impl fmt::Debug for processor_set_basic_info { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("processor_set_basic_info") ++ .field("processor_count", &self.processor_count) ++ .field("default_policy", &self.default_policy) ++ .finish() ++ } ++ } ++ impl hash::Hash for processor_set_basic_info { ++ fn hash(&self, state: &mut H) { ++ self.processor_count.hash(state); ++ self.default_policy.hash(state); ++ } ++ } ++ ++ impl PartialEq for processor_set_load_info { ++ fn eq(&self, other: &processor_set_load_info) -> bool { ++ self.task_count == other.task_count ++ && self.thread_count == other.thread_count ++ && self.load_average == other.load_average ++ && self.mach_factor == other.mach_factor ++ } ++ } ++ impl Eq for processor_set_load_info {} ++ impl fmt::Debug for processor_set_load_info { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("processor_set_load_info") ++ .field("task_count", &self.task_count) ++ .field("thread_count", &self.thread_count) ++ .field("load_average", &self.load_average) ++ .field("mach_factor", &self.mach_factor) ++ .finish() ++ } ++ } ++ impl hash::Hash for processor_set_load_info { ++ fn hash(&self, state: &mut H) { ++ self.task_count.hash(state); ++ self.thread_count.hash(state); ++ self.load_average.hash(state); ++ self.mach_factor.hash(state); ++ } ++ } ++ ++ impl PartialEq for time_value_t { ++ fn eq(&self, other: &time_value_t) -> bool { ++ self.seconds == other.seconds && self.microseconds == other.microseconds ++ } ++ } ++ impl Eq for time_value_t {} ++ impl fmt::Debug for time_value_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("time_value_t") ++ .field("seconds", &self.seconds) ++ .field("microseconds", &self.microseconds) ++ .finish() ++ } ++ } ++ impl hash::Hash for time_value_t { ++ fn hash(&self, state: &mut H) { ++ self.seconds.hash(state); ++ self.microseconds.hash(state); ++ } ++ } ++ impl PartialEq for thread_basic_info { ++ fn eq(&self, other: &thread_basic_info) -> bool { ++ self.user_time == other.user_time ++ && self.system_time == other.system_time ++ && self.cpu_usage == other.cpu_usage ++ && self.policy == other.policy ++ && self.run_state == other.run_state ++ && self.flags == other.flags ++ && self.suspend_count == other.suspend_count ++ && self.sleep_time == other.sleep_time ++ } ++ } ++ impl Eq for thread_basic_info {} ++ impl fmt::Debug for thread_basic_info { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("thread_basic_info") ++ .field("user_time", &self.user_time) ++ .field("system_time", &self.system_time) ++ .field("cpu_usage", &self.cpu_usage) ++ .field("policy", &self.policy) ++ .field("run_state", &self.run_state) ++ .field("flags", &self.flags) ++ .field("suspend_count", &self.suspend_count) ++ .field("sleep_time", &self.sleep_time) ++ .finish() ++ } ++ } ++ impl hash::Hash for thread_basic_info { ++ fn hash(&self, state: &mut H) { ++ self.user_time.hash(state); ++ self.system_time.hash(state); ++ self.cpu_usage.hash(state); ++ self.policy.hash(state); ++ self.run_state.hash(state); ++ self.flags.hash(state); ++ self.suspend_count.hash(state); ++ self.sleep_time.hash(state); ++ } ++ } ++ impl PartialEq for thread_extended_info { ++ fn eq(&self, other: &thread_extended_info) -> bool { ++ self.pth_user_time == other.pth_user_time ++ && self.pth_system_time == other.pth_system_time ++ && self.pth_cpu_usage == other.pth_cpu_usage ++ && self.pth_policy == other.pth_policy ++ && self.pth_run_state == other.pth_run_state ++ && self.pth_flags == other.pth_flags ++ && self.pth_sleep_time == other.pth_sleep_time ++ && self.pth_curpri == other.pth_curpri ++ && self.pth_priority == other.pth_priority ++ && self.pth_maxpriority == other.pth_maxpriority ++ && self ++ .pth_name ++ .iter() ++ .zip(other.pth_name.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for thread_extended_info {} ++ impl fmt::Debug for thread_extended_info { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("proc_threadinfo") ++ .field("pth_user_time", &self.pth_user_time) ++ .field("pth_system_time", &self.pth_system_time) ++ .field("pth_cpu_usage", &self.pth_cpu_usage) ++ .field("pth_policy", &self.pth_policy) ++ .field("pth_run_state", &self.pth_run_state) ++ .field("pth_flags", &self.pth_flags) ++ .field("pth_sleep_time", &self.pth_sleep_time) ++ .field("pth_curpri", &self.pth_curpri) ++ .field("pth_priority", &self.pth_priority) ++ .field("pth_maxpriority", &self.pth_maxpriority) ++ // FIXME: .field("pth_name", &self.pth_name) ++ .finish() ++ } ++ } ++ impl hash::Hash for thread_extended_info { ++ fn hash(&self, state: &mut H) { ++ self.pth_user_time.hash(state); ++ self.pth_system_time.hash(state); ++ self.pth_cpu_usage.hash(state); ++ self.pth_policy.hash(state); ++ self.pth_run_state.hash(state); ++ self.pth_flags.hash(state); ++ self.pth_sleep_time.hash(state); ++ self.pth_curpri.hash(state); ++ self.pth_priority.hash(state); ++ self.pth_maxpriority.hash(state); ++ self.pth_name.hash(state); ++ } ++ } ++ impl PartialEq for thread_identifier_info { ++ fn eq(&self, other: &thread_identifier_info) -> bool { ++ self.thread_id == other.thread_id ++ && self.thread_handle == other.thread_handle ++ && self.dispatch_qaddr == other.dispatch_qaddr ++ } ++ } ++ impl Eq for thread_identifier_info {} ++ impl fmt::Debug for thread_identifier_info { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("thread_identifier_info") ++ .field("thread_id", &self.thread_id) ++ .field("thread_handle", &self.thread_handle) ++ .field("dispatch_qaddr", &self.dispatch_qaddr) ++ .finish() ++ } ++ } ++ impl hash::Hash for thread_identifier_info { ++ fn hash(&self, state: &mut H) { ++ self.thread_id.hash(state); ++ self.thread_handle.hash(state); ++ self.dispatch_qaddr.hash(state); ++ } ++ } ++ impl PartialEq for if_data64 { ++ fn eq(&self, other: &if_data64) -> bool { ++ self.ifi_type == other.ifi_type ++ && self.ifi_typelen == other.ifi_typelen ++ && self.ifi_physical == other.ifi_physical ++ && self.ifi_addrlen == other.ifi_addrlen ++ && self.ifi_hdrlen == other.ifi_hdrlen ++ && self.ifi_recvquota == other.ifi_recvquota ++ && self.ifi_xmitquota == other.ifi_xmitquota ++ && self.ifi_unused1 == other.ifi_unused1 ++ && self.ifi_mtu == other.ifi_mtu ++ && self.ifi_metric == other.ifi_metric ++ && self.ifi_baudrate == other.ifi_baudrate ++ && self.ifi_ipackets == other.ifi_ipackets ++ && self.ifi_ierrors == other.ifi_ierrors ++ && self.ifi_opackets == other.ifi_opackets ++ && self.ifi_oerrors == other.ifi_oerrors ++ && self.ifi_collisions == other.ifi_collisions ++ && self.ifi_ibytes == other.ifi_ibytes ++ && self.ifi_obytes == other.ifi_obytes ++ && self.ifi_imcasts == other.ifi_imcasts ++ && self.ifi_omcasts == other.ifi_omcasts ++ && self.ifi_iqdrops == other.ifi_iqdrops ++ && self.ifi_noproto == other.ifi_noproto ++ && self.ifi_recvtiming == other.ifi_recvtiming ++ && self.ifi_xmittiming == other.ifi_xmittiming ++ && self.ifi_lastchange == other.ifi_lastchange ++ } ++ } ++ impl Eq for if_data64 {} ++ impl fmt::Debug for if_data64 { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ let ifi_type = self.ifi_type; ++ let ifi_typelen = self.ifi_typelen; ++ let ifi_physical = self.ifi_physical; ++ let ifi_addrlen = self.ifi_addrlen; ++ let ifi_hdrlen = self.ifi_hdrlen; ++ let ifi_recvquota = self.ifi_recvquota; ++ let ifi_xmitquota = self.ifi_xmitquota; ++ let ifi_unused1 = self.ifi_unused1; ++ let ifi_mtu = self.ifi_mtu; ++ let ifi_metric = self.ifi_metric; ++ let ifi_baudrate = self.ifi_baudrate; ++ let ifi_ipackets = self.ifi_ipackets; ++ let ifi_ierrors = self.ifi_ierrors; ++ let ifi_opackets = self.ifi_opackets; ++ let ifi_oerrors = self.ifi_oerrors; ++ let ifi_collisions = self.ifi_collisions; ++ let ifi_ibytes = self.ifi_ibytes; ++ let ifi_obytes = self.ifi_obytes; ++ let ifi_imcasts = self.ifi_imcasts; ++ let ifi_omcasts = self.ifi_omcasts; ++ let ifi_iqdrops = self.ifi_iqdrops; ++ let ifi_noproto = self.ifi_noproto; ++ let ifi_recvtiming = self.ifi_recvtiming; ++ let ifi_xmittiming = self.ifi_xmittiming; ++ let ifi_lastchange = self.ifi_lastchange; ++ f.debug_struct("if_data64") ++ .field("ifi_type", &ifi_type) ++ .field("ifi_typelen", &ifi_typelen) ++ .field("ifi_physical", &ifi_physical) ++ .field("ifi_addrlen", &ifi_addrlen) ++ .field("ifi_hdrlen", &ifi_hdrlen) ++ .field("ifi_recvquota", &ifi_recvquota) ++ .field("ifi_xmitquota", &ifi_xmitquota) ++ .field("ifi_unused1", &ifi_unused1) ++ .field("ifi_mtu", &ifi_mtu) ++ .field("ifi_metric", &ifi_metric) ++ .field("ifi_baudrate", &ifi_baudrate) ++ .field("ifi_ipackets", &ifi_ipackets) ++ .field("ifi_ierrors", &ifi_ierrors) ++ .field("ifi_opackets", &ifi_opackets) ++ .field("ifi_oerrors", &ifi_oerrors) ++ .field("ifi_collisions", &ifi_collisions) ++ .field("ifi_ibytes", &ifi_ibytes) ++ .field("ifi_obytes", &ifi_obytes) ++ .field("ifi_imcasts", &ifi_imcasts) ++ .field("ifi_omcasts", &ifi_omcasts) ++ .field("ifi_iqdrops", &ifi_iqdrops) ++ .field("ifi_noproto", &ifi_noproto) ++ .field("ifi_recvtiming", &ifi_recvtiming) ++ .field("ifi_xmittiming", &ifi_xmittiming) ++ .field("ifi_lastchange", &ifi_lastchange) ++ .finish() ++ } ++ } ++ impl hash::Hash for if_data64 { ++ fn hash(&self, state: &mut H) { ++ let ifi_type = self.ifi_type; ++ let ifi_typelen = self.ifi_typelen; ++ let ifi_physical = self.ifi_physical; ++ let ifi_addrlen = self.ifi_addrlen; ++ let ifi_hdrlen = self.ifi_hdrlen; ++ let ifi_recvquota = self.ifi_recvquota; ++ let ifi_xmitquota = self.ifi_xmitquota; ++ let ifi_unused1 = self.ifi_unused1; ++ let ifi_mtu = self.ifi_mtu; ++ let ifi_metric = self.ifi_metric; ++ let ifi_baudrate = self.ifi_baudrate; ++ let ifi_ipackets = self.ifi_ipackets; ++ let ifi_ierrors = self.ifi_ierrors; ++ let ifi_opackets = self.ifi_opackets; ++ let ifi_oerrors = self.ifi_oerrors; ++ let ifi_collisions = self.ifi_collisions; ++ let ifi_ibytes = self.ifi_ibytes; ++ let ifi_obytes = self.ifi_obytes; ++ let ifi_imcasts = self.ifi_imcasts; ++ let ifi_omcasts = self.ifi_omcasts; ++ let ifi_iqdrops = self.ifi_iqdrops; ++ let ifi_noproto = self.ifi_noproto; ++ let ifi_recvtiming = self.ifi_recvtiming; ++ let ifi_xmittiming = self.ifi_xmittiming; ++ let ifi_lastchange = self.ifi_lastchange; ++ ifi_type.hash(state); ++ ifi_typelen.hash(state); ++ ifi_physical.hash(state); ++ ifi_addrlen.hash(state); ++ ifi_hdrlen.hash(state); ++ ifi_recvquota.hash(state); ++ ifi_xmitquota.hash(state); ++ ifi_unused1.hash(state); ++ ifi_mtu.hash(state); ++ ifi_metric.hash(state); ++ ifi_baudrate.hash(state); ++ ifi_ipackets.hash(state); ++ ifi_ierrors.hash(state); ++ ifi_opackets.hash(state); ++ ifi_oerrors.hash(state); ++ ifi_collisions.hash(state); ++ ifi_ibytes.hash(state); ++ ifi_obytes.hash(state); ++ ifi_imcasts.hash(state); ++ ifi_omcasts.hash(state); ++ ifi_iqdrops.hash(state); ++ ifi_noproto.hash(state); ++ ifi_recvtiming.hash(state); ++ ifi_xmittiming.hash(state); ++ ifi_lastchange.hash(state); ++ } ++ } ++ impl PartialEq for if_msghdr2 { ++ fn eq(&self, other: &if_msghdr2) -> bool { ++ self.ifm_msglen == other.ifm_msglen ++ && self.ifm_version == other.ifm_version ++ && self.ifm_type == other.ifm_type ++ && self.ifm_addrs == other.ifm_addrs ++ && self.ifm_flags == other.ifm_flags ++ && self.ifm_index == other.ifm_index ++ && self.ifm_snd_len == other.ifm_snd_len ++ && self.ifm_snd_maxlen == other.ifm_snd_maxlen ++ && self.ifm_snd_drops == other.ifm_snd_drops ++ && self.ifm_timer == other.ifm_timer ++ && self.ifm_data == other.ifm_data ++ } ++ } ++ impl Eq for if_msghdr2 {} ++ impl fmt::Debug for if_msghdr2 { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ let ifm_msglen = self.ifm_msglen; ++ let ifm_version = self.ifm_version; ++ let ifm_type = self.ifm_type; ++ let ifm_addrs = self.ifm_addrs; ++ let ifm_flags = self.ifm_flags; ++ let ifm_index = self.ifm_index; ++ let ifm_snd_len = self.ifm_snd_len; ++ let ifm_snd_maxlen = self.ifm_snd_maxlen; ++ let ifm_snd_drops = self.ifm_snd_drops; ++ let ifm_timer = self.ifm_timer; ++ let ifm_data = self.ifm_data; ++ f.debug_struct("if_msghdr2") ++ .field("ifm_msglen", &ifm_msglen) ++ .field("ifm_version", &ifm_version) ++ .field("ifm_type", &ifm_type) ++ .field("ifm_addrs", &ifm_addrs) ++ .field("ifm_flags", &ifm_flags) ++ .field("ifm_index", &ifm_index) ++ .field("ifm_snd_len", &ifm_snd_len) ++ .field("ifm_snd_maxlen", &ifm_snd_maxlen) ++ .field("ifm_snd_drops", &ifm_snd_drops) ++ .field("ifm_timer", &ifm_timer) ++ .field("ifm_data", &ifm_data) ++ .finish() ++ } ++ } ++ impl hash::Hash for if_msghdr2 { ++ fn hash(&self, state: &mut H) { ++ let ifm_msglen = self.ifm_msglen; ++ let ifm_version = self.ifm_version; ++ let ifm_type = self.ifm_type; ++ let ifm_addrs = self.ifm_addrs; ++ let ifm_flags = self.ifm_flags; ++ let ifm_index = self.ifm_index; ++ let ifm_snd_len = self.ifm_snd_len; ++ let ifm_snd_maxlen = self.ifm_snd_maxlen; ++ let ifm_snd_drops = self.ifm_snd_drops; ++ let ifm_timer = self.ifm_timer; ++ let ifm_data = self.ifm_data; ++ ifm_msglen.hash(state); ++ ifm_version.hash(state); ++ ifm_type.hash(state); ++ ifm_addrs.hash(state); ++ ifm_flags.hash(state); ++ ifm_index.hash(state); ++ ifm_snd_len.hash(state); ++ ifm_snd_maxlen.hash(state); ++ ifm_snd_drops.hash(state); ++ ifm_timer.hash(state); ++ ifm_data.hash(state); ++ } ++ } ++ impl PartialEq for vm_statistics64 { ++ fn eq(&self, other: &vm_statistics64) -> bool { ++ // Otherwise rustfmt crashes... ++ let total_uncompressed = self.total_uncompressed_pages_in_compressor; ++ self.free_count == other.free_count ++ && self.active_count == other.active_count ++ && self.inactive_count == other.inactive_count ++ && self.wire_count == other.wire_count ++ && self.zero_fill_count == other.zero_fill_count ++ && self.reactivations == other.reactivations ++ && self.pageins == other.pageins ++ && self.pageouts == other.pageouts ++ && self.faults == other.faults ++ && self.cow_faults == other.cow_faults ++ && self.lookups == other.lookups ++ && self.hits == other.hits ++ && self.purges == other.purges ++ && self.purgeable_count == other.purgeable_count ++ && self.speculative_count == other.speculative_count ++ && self.decompressions == other.decompressions ++ && self.compressions == other.compressions ++ && self.swapins == other.swapins ++ && self.swapouts == other.swapouts ++ && self.compressor_page_count == other.compressor_page_count ++ && self.throttled_count == other.throttled_count ++ && self.external_page_count == other.external_page_count ++ && self.internal_page_count == other.internal_page_count ++ && total_uncompressed == other.total_uncompressed_pages_in_compressor ++ } ++ } ++ impl Eq for vm_statistics64 {} ++ impl fmt::Debug for vm_statistics64 { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ let free_count = self.free_count; ++ let active_count = self.active_count; ++ let inactive_count = self.inactive_count; ++ let wire_count = self.wire_count; ++ let zero_fill_count = self.zero_fill_count; ++ let reactivations = self.reactivations; ++ let pageins = self.pageins; ++ let pageouts = self.pageouts; ++ let faults = self.faults; ++ let cow_faults = self.cow_faults; ++ let lookups = self.lookups; ++ let hits = self.hits; ++ let purges = self.purges; ++ let purgeable_count = self.purgeable_count; ++ let speculative_count = self.speculative_count; ++ let decompressions = self.decompressions; ++ let compressions = self.compressions; ++ let swapins = self.swapins; ++ let swapouts = self.swapouts; ++ let compressor_page_count = self.compressor_page_count; ++ let throttled_count = self.throttled_count; ++ let external_page_count = self.external_page_count; ++ let internal_page_count = self.internal_page_count; ++ // Otherwise rustfmt crashes... ++ let total_uncompressed = self.total_uncompressed_pages_in_compressor; ++ f.debug_struct("vm_statistics64") ++ .field("free_count", &free_count) ++ .field("active_count", &active_count) ++ .field("inactive_count", &inactive_count) ++ .field("wire_count", &wire_count) ++ .field("zero_fill_count", &zero_fill_count) ++ .field("reactivations", &reactivations) ++ .field("pageins", &pageins) ++ .field("pageouts", &pageouts) ++ .field("faults", &faults) ++ .field("cow_faults", &cow_faults) ++ .field("lookups", &lookups) ++ .field("hits", &hits) ++ .field("purges", &purges) ++ .field("purgeable_count", &purgeable_count) ++ .field("speculative_count", &speculative_count) ++ .field("decompressions", &decompressions) ++ .field("compressions", &compressions) ++ .field("swapins", &swapins) ++ .field("swapouts", &swapouts) ++ .field("compressor_page_count", &compressor_page_count) ++ .field("throttled_count", &throttled_count) ++ .field("external_page_count", &external_page_count) ++ .field("internal_page_count", &internal_page_count) ++ .field( ++ "total_uncompressed_pages_in_compressor", ++ &total_uncompressed, ++ ) ++ .finish() ++ } ++ } ++ impl hash::Hash for vm_statistics64 { ++ fn hash(&self, state: &mut H) { ++ let free_count = self.free_count; ++ let active_count = self.active_count; ++ let inactive_count = self.inactive_count; ++ let wire_count = self.wire_count; ++ let zero_fill_count = self.zero_fill_count; ++ let reactivations = self.reactivations; ++ let pageins = self.pageins; ++ let pageouts = self.pageouts; ++ let faults = self.faults; ++ let cow_faults = self.cow_faults; ++ let lookups = self.lookups; ++ let hits = self.hits; ++ let purges = self.purges; ++ let purgeable_count = self.purgeable_count; ++ let speculative_count = self.speculative_count; ++ let decompressions = self.decompressions; ++ let compressions = self.compressions; ++ let swapins = self.swapins; ++ let swapouts = self.swapouts; ++ let compressor_page_count = self.compressor_page_count; ++ let throttled_count = self.throttled_count; ++ let external_page_count = self.external_page_count; ++ let internal_page_count = self.internal_page_count; ++ // Otherwise rustfmt crashes... ++ let total_uncompressed = self.total_uncompressed_pages_in_compressor; ++ free_count.hash(state); ++ active_count.hash(state); ++ inactive_count.hash(state); ++ wire_count.hash(state); ++ zero_fill_count.hash(state); ++ reactivations.hash(state); ++ pageins.hash(state); ++ pageouts.hash(state); ++ faults.hash(state); ++ cow_faults.hash(state); ++ lookups.hash(state); ++ hits.hash(state); ++ purges.hash(state); ++ purgeable_count.hash(state); ++ speculative_count.hash(state); ++ decompressions.hash(state); ++ compressions.hash(state); ++ swapins.hash(state); ++ swapouts.hash(state); ++ compressor_page_count.hash(state); ++ throttled_count.hash(state); ++ external_page_count.hash(state); ++ internal_page_count.hash(state); ++ total_uncompressed.hash(state); ++ } ++ } ++ ++ impl PartialEq for mach_task_basic_info { ++ fn eq(&self, other: &mach_task_basic_info) -> bool { ++ self.virtual_size == other.virtual_size ++ && self.resident_size == other.resident_size ++ && self.resident_size_max == other.resident_size_max ++ && self.user_time == other.user_time ++ && self.system_time == other.system_time ++ && self.policy == other.policy ++ && self.suspend_count == other.suspend_count ++ } ++ } ++ impl Eq for mach_task_basic_info {} ++ impl fmt::Debug for mach_task_basic_info { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ let virtual_size = self.virtual_size; ++ let resident_size = self.resident_size; ++ let resident_size_max = self.resident_size_max; ++ let user_time = self.user_time; ++ let system_time = self.system_time; ++ let policy = self.policy; ++ let suspend_count = self.suspend_count; ++ f.debug_struct("mach_task_basic_info") ++ .field("virtual_size", &virtual_size) ++ .field("resident_size", &resident_size) ++ .field("resident_size_max", &resident_size_max) ++ .field("user_time", &user_time) ++ .field("system_time", &system_time) ++ .field("policy", &policy) ++ .field("suspend_count", &suspend_count) ++ .finish() ++ } ++ } ++ impl hash::Hash for mach_task_basic_info { ++ fn hash(&self, state: &mut H) { ++ let virtual_size = self.virtual_size; ++ let resident_size = self.resident_size; ++ let resident_size_max = self.resident_size_max; ++ let user_time = self.user_time; ++ let system_time = self.system_time; ++ let policy = self.policy; ++ let suspend_count = self.suspend_count; ++ virtual_size.hash(state); ++ resident_size.hash(state); ++ resident_size_max.hash(state); ++ user_time.hash(state); ++ system_time.hash(state); ++ policy.hash(state); ++ suspend_count.hash(state); ++ } ++ } ++ ++ impl PartialEq for log2phys { ++ fn eq(&self, other: &log2phys) -> bool { ++ self.l2p_flags == other.l2p_flags ++ && self.l2p_contigbytes == other.l2p_contigbytes ++ && self.l2p_devoffset == other.l2p_devoffset ++ } ++ } ++ impl Eq for log2phys {} ++ impl fmt::Debug for log2phys { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ let l2p_flags = self.l2p_flags; ++ let l2p_contigbytes = self.l2p_contigbytes; ++ let l2p_devoffset = self.l2p_devoffset; ++ f.debug_struct("log2phys") ++ .field("l2p_flags", &l2p_flags) ++ .field("l2p_contigbytes", &l2p_contigbytes) ++ .field("l2p_devoffset", &l2p_devoffset) ++ .finish() ++ } ++ } ++ impl hash::Hash for log2phys { ++ fn hash(&self, state: &mut H) { ++ let l2p_flags = self.l2p_flags; ++ let l2p_contigbytes = self.l2p_contigbytes; ++ let l2p_devoffset = self.l2p_devoffset; ++ l2p_flags.hash(state); ++ l2p_contigbytes.hash(state); ++ l2p_devoffset.hash(state); ++ } ++ } ++ impl PartialEq for os_unfair_lock { ++ fn eq(&self, other: &os_unfair_lock) -> bool { ++ self._os_unfair_lock_opaque == other._os_unfair_lock_opaque ++ } ++ } ++ ++ impl Eq for os_unfair_lock {} ++ ++ impl fmt::Debug for os_unfair_lock { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("os_unfair_lock") ++ .field("_os_unfair_lock_opaque", &self._os_unfair_lock_opaque) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for os_unfair_lock { ++ fn hash(&self, state: &mut H) { ++ self._os_unfair_lock_opaque.hash(state); ++ } ++ } ++ ++ impl PartialEq for sockaddr_vm { ++ fn eq(&self, other: &sockaddr_vm) -> bool { ++ self.svm_len == other.svm_len ++ && self.svm_family == other.svm_family ++ && self.svm_reserved1 == other.svm_reserved1 ++ && self.svm_port == other.svm_port ++ && self.svm_cid == other.svm_cid ++ } ++ } ++ ++ impl Eq for sockaddr_vm {} ++ ++ impl fmt::Debug for sockaddr_vm { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ let svm_len = self.svm_len; ++ let svm_family = self.svm_family; ++ let svm_reserved1 = self.svm_reserved1; ++ let svm_port = self.svm_port; ++ let svm_cid = self.svm_cid; ++ ++ f.debug_struct("sockaddr_vm") ++ .field("svm_len", &svm_len) ++ .field("svm_family", &svm_family) ++ .field("svm_reserved1", &svm_reserved1) ++ .field("svm_port", &svm_port) ++ .field("svm_cid", &svm_cid) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for sockaddr_vm { ++ fn hash(&self, state: &mut H) { ++ let svm_len = self.svm_len; ++ let svm_family = self.svm_family; ++ let svm_reserved1 = self.svm_reserved1; ++ let svm_port = self.svm_port; ++ let svm_cid = self.svm_cid; ++ ++ svm_len.hash(state); ++ svm_family.hash(state); ++ svm_reserved1.hash(state); ++ svm_port.hash(state); ++ svm_cid.hash(state); ++ } ++ } ++ ++ impl PartialEq for ifdevmtu { ++ fn eq(&self, other: &ifdevmtu) -> bool { ++ self.ifdm_current == other.ifdm_current ++ && self.ifdm_min == other.ifdm_min ++ && self.ifdm_max == other.ifdm_max ++ } ++ } ++ ++ impl Eq for ifdevmtu {} ++ ++ impl fmt::Debug for ifdevmtu { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("ifdevmtu") ++ .field("ifdm_current", &self.ifdm_current) ++ .field("ifdm_min", &self.ifdm_min) ++ .field("ifdm_max", &self.ifdm_max) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for ifdevmtu { ++ fn hash(&self, state: &mut H) { ++ self.ifdm_current.hash(state); ++ self.ifdm_min.hash(state); ++ self.ifdm_max.hash(state); ++ } ++ } ++ ++ impl PartialEq for __c_anonymous_ifk_data { ++ fn eq(&self, other: &__c_anonymous_ifk_data) -> bool { ++ unsafe { self.ifk_ptr == other.ifk_ptr && self.ifk_value == other.ifk_value } ++ } ++ } ++ ++ impl Eq for __c_anonymous_ifk_data {} ++ impl hash::Hash for __c_anonymous_ifk_data { ++ fn hash(&self, state: &mut H) { ++ unsafe { ++ self.ifk_ptr.hash(state); ++ self.ifk_value.hash(state); ++ } ++ } ++ } ++ ++ impl PartialEq for ifkpi { ++ fn eq(&self, other: &ifkpi) -> bool { ++ self.ifk_module_id == other.ifk_module_id && self.ifk_type == other.ifk_type ++ } ++ } ++ ++ impl Eq for ifkpi {} ++ ++ impl fmt::Debug for ifkpi { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("ifkpi") ++ .field("ifk_module_id", &self.ifk_module_id) ++ .field("ifk_type", &self.ifk_type) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for ifkpi { ++ fn hash(&self, state: &mut H) { ++ self.ifk_module_id.hash(state); ++ self.ifk_type.hash(state); ++ } ++ } ++ ++ impl PartialEq for __c_anonymous_ifr_ifru { ++ fn eq(&self, other: &__c_anonymous_ifr_ifru) -> bool { ++ unsafe { ++ self.ifru_addr == other.ifru_addr ++ && self.ifru_dstaddr == other.ifru_dstaddr ++ && self.ifru_broadaddr == other.ifru_broadaddr ++ && self.ifru_flags == other.ifru_flags ++ && self.ifru_metrics == other.ifru_metrics ++ && self.ifru_mtu == other.ifru_mtu ++ && self.ifru_phys == other.ifru_phys ++ && self.ifru_media == other.ifru_media ++ && self.ifru_intval == other.ifru_intval ++ && self.ifru_data == other.ifru_data ++ && self.ifru_devmtu == other.ifru_devmtu ++ && self.ifru_kpi == other.ifru_kpi ++ && self.ifru_wake_flags == other.ifru_wake_flags ++ && self.ifru_route_refcnt == other.ifru_route_refcnt ++ && self ++ .ifru_cap ++ .iter() ++ .zip(other.ifru_cap.iter()) ++ .all(|(a, b)| a == b) ++ && self.ifru_functional_type == other.ifru_functional_type ++ } ++ } ++ } ++ ++ impl Eq for __c_anonymous_ifr_ifru {} ++ ++ impl hash::Hash for __c_anonymous_ifr_ifru { ++ fn hash(&self, state: &mut H) { ++ unsafe { ++ self.ifru_addr.hash(state); ++ self.ifru_dstaddr.hash(state); ++ self.ifru_broadaddr.hash(state); ++ self.ifru_flags.hash(state); ++ self.ifru_metrics.hash(state); ++ self.ifru_mtu.hash(state); ++ self.ifru_phys.hash(state); ++ self.ifru_media.hash(state); ++ self.ifru_intval.hash(state); ++ self.ifru_data.hash(state); ++ self.ifru_devmtu.hash(state); ++ self.ifru_kpi.hash(state); ++ self.ifru_wake_flags.hash(state); ++ self.ifru_route_refcnt.hash(state); ++ self.ifru_cap.hash(state); ++ self.ifru_functional_type.hash(state); ++ } ++ } ++ } ++ ++ impl PartialEq for ifreq { ++ fn eq(&self, other: &ifreq) -> bool { ++ self.ifr_name == other.ifr_name && self.ifr_ifru == other.ifr_ifru ++ } ++ } ++ ++ impl Eq for ifreq {} ++ ++ impl fmt::Debug for ifreq { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("ifreq") ++ .field("ifr_name", &self.ifr_name) ++ .field("ifr_ifru", &self.ifr_ifru) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for ifreq { ++ fn hash(&self, state: &mut H) { ++ self.ifr_name.hash(state); ++ self.ifr_ifru.hash(state); ++ } ++ } ++ ++ impl Eq for __c_anonymous_ifc_ifcu {} ++ ++ impl PartialEq for __c_anonymous_ifc_ifcu { ++ fn eq(&self, other: &__c_anonymous_ifc_ifcu) -> bool { ++ unsafe { self.ifcu_buf == other.ifcu_buf && self.ifcu_req == other.ifcu_req } ++ } ++ } ++ ++ impl hash::Hash for __c_anonymous_ifc_ifcu { ++ fn hash(&self, state: &mut H) { ++ unsafe { self.ifcu_buf.hash(state) }; ++ unsafe { self.ifcu_req.hash(state) }; ++ } ++ } ++ ++ impl PartialEq for __c_anonymous_ifr_ifru6 { ++ fn eq(&self, other: &__c_anonymous_ifr_ifru6) -> bool { ++ unsafe { ++ self.ifru_addr == other.ifru_addr ++ && self.ifru_dstaddr == other.ifru_dstaddr ++ && self.ifru_flags == other.ifru_flags ++ && self.ifru_flags6 == other.ifru_flags6 ++ && self.ifru_metrics == other.ifru_metrics ++ && self.ifru_intval == other.ifru_intval ++ && self.ifru_data == other.ifru_data ++ && self ++ .ifru_scope_id ++ .iter() ++ .zip(other.ifru_scope_id.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ } ++ ++ impl Eq for __c_anonymous_ifr_ifru6 {} ++ ++ impl hash::Hash for __c_anonymous_ifr_ifru6 { ++ fn hash(&self, state: &mut H) { ++ unsafe { ++ self.ifru_addr.hash(state); ++ self.ifru_dstaddr.hash(state); ++ self.ifru_flags.hash(state); ++ self.ifru_flags6.hash(state); ++ self.ifru_metrics.hash(state); ++ self.ifru_intval.hash(state); ++ self.ifru_data.hash(state); ++ self.ifru_scope_id.hash(state); ++ } ++ } ++ } ++ ++ impl PartialEq for in6_ifreq { ++ fn eq(&self, other: &in6_ifreq) -> bool { ++ self.ifr_name == other.ifr_name && self.ifr_ifru == other.ifr_ifru ++ } ++ } ++ ++ impl Eq for in6_ifreq {} ++ ++ impl fmt::Debug for in6_ifreq { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("in6_ifreq") ++ .field("ifr_name", &self.ifr_name) ++ .field("ifr_ifru", &self.ifr_ifru) ++ .finish() ++ } ++ } ++ } ++} ++ ++pub const _UTX_USERSIZE: usize = 256; ++pub const _UTX_LINESIZE: usize = 32; ++pub const _UTX_IDSIZE: usize = 4; ++pub const _UTX_HOSTSIZE: usize = 256; ++ ++pub const EMPTY: c_short = 0; ++pub const RUN_LVL: c_short = 1; ++pub const BOOT_TIME: c_short = 2; ++pub const OLD_TIME: c_short = 3; ++pub const NEW_TIME: c_short = 4; ++pub const INIT_PROCESS: c_short = 5; ++pub const LOGIN_PROCESS: c_short = 6; ++pub const USER_PROCESS: c_short = 7; ++pub const DEAD_PROCESS: c_short = 8; ++pub const ACCOUNTING: c_short = 9; ++pub const SIGNATURE: c_short = 10; ++pub const SHUTDOWN_TIME: c_short = 11; ++ ++pub const LC_COLLATE_MASK: c_int = 1 << 0; ++pub const LC_CTYPE_MASK: c_int = 1 << 1; ++pub const LC_MESSAGES_MASK: c_int = 1 << 2; ++pub const LC_MONETARY_MASK: c_int = 1 << 3; ++pub const LC_NUMERIC_MASK: c_int = 1 << 4; ++pub const LC_TIME_MASK: c_int = 1 << 5; ++pub const LC_ALL_MASK: c_int = LC_COLLATE_MASK ++ | LC_CTYPE_MASK ++ | LC_MESSAGES_MASK ++ | LC_MONETARY_MASK ++ | LC_NUMERIC_MASK ++ | LC_TIME_MASK; ++ ++pub const CODESET: crate::nl_item = 0; ++pub const D_T_FMT: crate::nl_item = 1; ++pub const D_FMT: crate::nl_item = 2; ++pub const T_FMT: crate::nl_item = 3; ++pub const T_FMT_AMPM: crate::nl_item = 4; ++pub const AM_STR: crate::nl_item = 5; ++pub const PM_STR: crate::nl_item = 6; ++ ++pub const DAY_1: crate::nl_item = 7; ++pub const DAY_2: crate::nl_item = 8; ++pub const DAY_3: crate::nl_item = 9; ++pub const DAY_4: crate::nl_item = 10; ++pub const DAY_5: crate::nl_item = 11; ++pub const DAY_6: crate::nl_item = 12; ++pub const DAY_7: crate::nl_item = 13; ++ ++pub const ABDAY_1: crate::nl_item = 14; ++pub const ABDAY_2: crate::nl_item = 15; ++pub const ABDAY_3: crate::nl_item = 16; ++pub const ABDAY_4: crate::nl_item = 17; ++pub const ABDAY_5: crate::nl_item = 18; ++pub const ABDAY_6: crate::nl_item = 19; ++pub const ABDAY_7: crate::nl_item = 20; ++ ++pub const MON_1: crate::nl_item = 21; ++pub const MON_2: crate::nl_item = 22; ++pub const MON_3: crate::nl_item = 23; ++pub const MON_4: crate::nl_item = 24; ++pub const MON_5: crate::nl_item = 25; ++pub const MON_6: crate::nl_item = 26; ++pub const MON_7: crate::nl_item = 27; ++pub const MON_8: crate::nl_item = 28; ++pub const MON_9: crate::nl_item = 29; ++pub const MON_10: crate::nl_item = 30; ++pub const MON_11: crate::nl_item = 31; ++pub const MON_12: crate::nl_item = 32; ++ ++pub const ABMON_1: crate::nl_item = 33; ++pub const ABMON_2: crate::nl_item = 34; ++pub const ABMON_3: crate::nl_item = 35; ++pub const ABMON_4: crate::nl_item = 36; ++pub const ABMON_5: crate::nl_item = 37; ++pub const ABMON_6: crate::nl_item = 38; ++pub const ABMON_7: crate::nl_item = 39; ++pub const ABMON_8: crate::nl_item = 40; ++pub const ABMON_9: crate::nl_item = 41; ++pub const ABMON_10: crate::nl_item = 42; ++pub const ABMON_11: crate::nl_item = 43; ++pub const ABMON_12: crate::nl_item = 44; ++ ++pub const CLOCK_REALTIME: crate::clockid_t = 0; ++pub const CLOCK_MONOTONIC_RAW: crate::clockid_t = 4; ++pub const CLOCK_MONOTONIC_RAW_APPROX: crate::clockid_t = 5; ++pub const CLOCK_MONOTONIC: crate::clockid_t = 6; ++pub const CLOCK_UPTIME_RAW: crate::clockid_t = 8; ++pub const CLOCK_UPTIME_RAW_APPROX: crate::clockid_t = 9; ++pub const CLOCK_PROCESS_CPUTIME_ID: crate::clockid_t = 12; ++pub const CLOCK_THREAD_CPUTIME_ID: crate::clockid_t = 16; ++ ++pub const ERA: crate::nl_item = 45; ++pub const ERA_D_FMT: crate::nl_item = 46; ++pub const ERA_D_T_FMT: crate::nl_item = 47; ++pub const ERA_T_FMT: crate::nl_item = 48; ++pub const ALT_DIGITS: crate::nl_item = 49; ++ ++pub const RADIXCHAR: crate::nl_item = 50; ++pub const THOUSEP: crate::nl_item = 51; ++ ++pub const YESEXPR: crate::nl_item = 52; ++pub const NOEXPR: crate::nl_item = 53; ++ ++pub const YESSTR: crate::nl_item = 54; ++pub const NOSTR: crate::nl_item = 55; ++ ++pub const CRNCYSTR: crate::nl_item = 56; ++ ++pub const D_MD_ORDER: crate::nl_item = 57; ++ ++pub const EXIT_FAILURE: c_int = 1; ++pub const EXIT_SUCCESS: c_int = 0; ++pub const RAND_MAX: c_int = 2147483647; ++pub const EOF: c_int = -1; ++pub const SEEK_SET: c_int = 0; ++pub const SEEK_CUR: c_int = 1; ++pub const SEEK_END: c_int = 2; ++pub const SEEK_HOLE: c_int = 3; ++pub const SEEK_DATA: c_int = 4; ++pub const _IOFBF: c_int = 0; ++pub const _IONBF: c_int = 2; ++pub const _IOLBF: c_int = 1; ++pub const BUFSIZ: c_uint = 1024; ++pub const FOPEN_MAX: c_uint = 20; ++pub const FILENAME_MAX: c_uint = 1024; ++pub const L_tmpnam: c_uint = 1024; ++pub const TMP_MAX: c_uint = 308915776; ++pub const _PC_LINK_MAX: c_int = 1; ++pub const _PC_MAX_CANON: c_int = 2; ++pub const _PC_MAX_INPUT: c_int = 3; ++pub const _PC_NAME_MAX: c_int = 4; ++pub const _PC_PATH_MAX: c_int = 5; ++pub const _PC_PIPE_BUF: c_int = 6; ++pub const _PC_CHOWN_RESTRICTED: c_int = 7; ++pub const _PC_NO_TRUNC: c_int = 8; ++pub const _PC_VDISABLE: c_int = 9; ++pub const _PC_NAME_CHARS_MAX: c_int = 10; ++pub const _PC_CASE_SENSITIVE: c_int = 11; ++pub const _PC_CASE_PRESERVING: c_int = 12; ++pub const _PC_EXTENDED_SECURITY_NP: c_int = 13; ++pub const _PC_AUTH_OPAQUE_NP: c_int = 14; ++pub const _PC_2_SYMLINKS: c_int = 15; ++pub const _PC_ALLOC_SIZE_MIN: c_int = 16; ++pub const _PC_ASYNC_IO: c_int = 17; ++pub const _PC_FILESIZEBITS: c_int = 18; ++pub const _PC_PRIO_IO: c_int = 19; ++pub const _PC_REC_INCR_XFER_SIZE: c_int = 20; ++pub const _PC_REC_MAX_XFER_SIZE: c_int = 21; ++pub const _PC_REC_MIN_XFER_SIZE: c_int = 22; ++pub const _PC_REC_XFER_ALIGN: c_int = 23; ++pub const _PC_SYMLINK_MAX: c_int = 24; ++pub const _PC_SYNC_IO: c_int = 25; ++pub const _PC_XATTR_SIZE_BITS: c_int = 26; ++pub const _PC_MIN_HOLE_SIZE: c_int = 27; ++pub const O_EVTONLY: c_int = 0x00008000; ++pub const O_NOCTTY: c_int = 0x00020000; ++pub const O_DIRECTORY: c_int = 0x00100000; ++pub const O_SYMLINK: c_int = 0x00200000; ++pub const O_DSYNC: c_int = 0x00400000; ++pub const O_CLOEXEC: c_int = 0x01000000; ++pub const O_NOFOLLOW_ANY: c_int = 0x20000000; ++pub const O_EXEC: c_int = 0x40000000; ++pub const O_SEARCH: c_int = O_EXEC | O_DIRECTORY; ++pub const S_IFIFO: mode_t = 0o1_0000; ++pub const S_IFCHR: mode_t = 0o2_0000; ++pub const S_IFBLK: mode_t = 0o6_0000; ++pub const S_IFDIR: mode_t = 0o4_0000; ++pub const S_IFREG: mode_t = 0o10_0000; ++pub const S_IFLNK: mode_t = 0o12_0000; ++pub const S_IFSOCK: mode_t = 0o14_0000; ++pub const S_IFMT: mode_t = 0o17_0000; ++pub const S_IEXEC: mode_t = 0o0100; ++pub const S_IWRITE: mode_t = 0o0200; ++pub const S_IREAD: mode_t = 0o0400; ++pub const S_IRWXU: mode_t = 0o0700; ++pub const S_IXUSR: mode_t = 0o0100; ++pub const S_IWUSR: mode_t = 0o0200; ++pub const S_IRUSR: mode_t = 0o0400; ++pub const S_IRWXG: mode_t = 0o0070; ++pub const S_IXGRP: mode_t = 0o0010; ++pub const S_IWGRP: mode_t = 0o0020; ++pub const S_IRGRP: mode_t = 0o0040; ++pub const S_IRWXO: mode_t = 0o0007; ++pub const S_IXOTH: mode_t = 0o0001; ++pub const S_IWOTH: mode_t = 0o0002; ++pub const S_IROTH: mode_t = 0o0004; ++pub const F_OK: c_int = 0; ++pub const R_OK: c_int = 4; ++pub const W_OK: c_int = 2; ++pub const X_OK: c_int = 1; ++pub const STDIN_FILENO: c_int = 0; ++pub const STDOUT_FILENO: c_int = 1; ++pub const STDERR_FILENO: c_int = 2; ++pub const F_LOCK: c_int = 1; ++pub const F_TEST: c_int = 3; ++pub const F_TLOCK: c_int = 2; ++pub const F_ULOCK: c_int = 0; ++pub const F_GETLK: c_int = 7; ++pub const F_SETLK: c_int = 8; ++pub const F_SETLKW: c_int = 9; ++pub const SIGHUP: c_int = 1; ++pub const SIGINT: c_int = 2; ++pub const SIGQUIT: c_int = 3; ++pub const SIGILL: c_int = 4; ++pub const SIGABRT: c_int = 6; ++pub const SIGEMT: c_int = 7; ++pub const SIGFPE: c_int = 8; ++pub const SIGKILL: c_int = 9; ++pub const SIGSEGV: c_int = 11; ++pub const SIGPIPE: c_int = 13; ++pub const SIGALRM: c_int = 14; ++pub const SIGTERM: c_int = 15; ++ ++pub const PROT_NONE: c_int = 0; ++pub const PROT_READ: c_int = 1; ++pub const PROT_WRITE: c_int = 2; ++pub const PROT_EXEC: c_int = 4; ++ ++pub const PT_TRACE_ME: c_int = 0; ++pub const PT_READ_I: c_int = 1; ++pub const PT_READ_D: c_int = 2; ++pub const PT_READ_U: c_int = 3; ++pub const PT_WRITE_I: c_int = 4; ++pub const PT_WRITE_D: c_int = 5; ++pub const PT_WRITE_U: c_int = 6; ++pub const PT_CONTINUE: c_int = 7; ++pub const PT_KILL: c_int = 8; ++pub const PT_STEP: c_int = 9; ++pub const PT_ATTACH: c_int = 10; ++pub const PT_DETACH: c_int = 11; ++pub const PT_SIGEXC: c_int = 12; ++pub const PT_THUPDATE: c_int = 13; ++pub const PT_ATTACHEXC: c_int = 14; ++ ++pub const PT_FORCEQUOTA: c_int = 30; ++pub const PT_DENY_ATTACH: c_int = 31; ++pub const PT_FIRSTMACH: c_int = 32; ++ ++pub const MAP_FILE: c_int = 0x0000; ++pub const MAP_SHARED: c_int = 0x0001; ++pub const MAP_PRIVATE: c_int = 0x0002; ++pub const MAP_FIXED: c_int = 0x0010; ++pub const MAP_ANON: c_int = 0x1000; ++pub const MAP_ANONYMOUS: c_int = MAP_ANON; ++ ++pub const CPU_STATE_USER: c_int = 0; ++pub const CPU_STATE_SYSTEM: c_int = 1; ++pub const CPU_STATE_IDLE: c_int = 2; ++pub const CPU_STATE_NICE: c_int = 3; ++pub const CPU_STATE_MAX: c_int = 4; ++ ++pub const PROCESSOR_BASIC_INFO: c_int = 1; ++pub const PROCESSOR_CPU_LOAD_INFO: c_int = 2; ++pub const PROCESSOR_PM_REGS_INFO: c_int = 0x10000001; ++pub const PROCESSOR_TEMPERATURE: c_int = 0x10000002; ++pub const PROCESSOR_SET_LOAD_INFO: c_int = 4; ++pub const PROCESSOR_SET_BASIC_INFO: c_int = 5; ++ ++deprecated_mach! { ++ pub const VM_FLAGS_FIXED: c_int = 0x0000; ++ pub const VM_FLAGS_ANYWHERE: c_int = 0x0001; ++ pub const VM_FLAGS_PURGABLE: c_int = 0x0002; ++ pub const VM_FLAGS_RANDOM_ADDR: c_int = 0x0008; ++ pub const VM_FLAGS_NO_CACHE: c_int = 0x0010; ++ pub const VM_FLAGS_RESILIENT_CODESIGN: c_int = 0x0020; ++ pub const VM_FLAGS_RESILIENT_MEDIA: c_int = 0x0040; ++ pub const VM_FLAGS_OVERWRITE: c_int = 0x4000; ++ pub const VM_FLAGS_SUPERPAGE_MASK: c_int = 0x70000; ++ pub const VM_FLAGS_RETURN_DATA_ADDR: c_int = 0x100000; ++ pub const VM_FLAGS_RETURN_4K_DATA_ADDR: c_int = 0x800000; ++ pub const VM_FLAGS_ALIAS_MASK: c_int = 0xFF000000; ++ pub const VM_FLAGS_USER_ALLOCATE: c_int = 0xff07401f; ++ pub const VM_FLAGS_USER_MAP: c_int = 0xff97401f; ++ pub const VM_FLAGS_USER_REMAP: c_int = VM_FLAGS_FIXED ++ | VM_FLAGS_ANYWHERE ++ | VM_FLAGS_RANDOM_ADDR ++ | VM_FLAGS_OVERWRITE ++ | VM_FLAGS_RETURN_DATA_ADDR ++ | VM_FLAGS_RESILIENT_CODESIGN; ++ ++ pub const VM_FLAGS_SUPERPAGE_SHIFT: c_int = 16; ++ pub const SUPERPAGE_NONE: c_int = 0; ++ pub const SUPERPAGE_SIZE_ANY: c_int = 1; ++ pub const VM_FLAGS_SUPERPAGE_NONE: c_int = SUPERPAGE_NONE << VM_FLAGS_SUPERPAGE_SHIFT; ++ pub const VM_FLAGS_SUPERPAGE_SIZE_ANY: c_int = SUPERPAGE_SIZE_ANY << VM_FLAGS_SUPERPAGE_SHIFT; ++ pub const SUPERPAGE_SIZE_2MB: c_int = 2; ++ pub const VM_FLAGS_SUPERPAGE_SIZE_2MB: c_int = SUPERPAGE_SIZE_2MB << VM_FLAGS_SUPERPAGE_SHIFT; ++ ++ pub const VM_MEMORY_MALLOC: c_int = 1; ++ pub const VM_MEMORY_MALLOC_SMALL: c_int = 2; ++ pub const VM_MEMORY_MALLOC_LARGE: c_int = 3; ++ pub const VM_MEMORY_MALLOC_HUGE: c_int = 4; ++ pub const VM_MEMORY_SBRK: c_int = 5; ++ pub const VM_MEMORY_REALLOC: c_int = 6; ++ pub const VM_MEMORY_MALLOC_TINY: c_int = 7; ++ pub const VM_MEMORY_MALLOC_LARGE_REUSABLE: c_int = 8; ++ pub const VM_MEMORY_MALLOC_LARGE_REUSED: c_int = 9; ++ pub const VM_MEMORY_ANALYSIS_TOOL: c_int = 10; ++ pub const VM_MEMORY_MALLOC_NANO: c_int = 11; ++ pub const VM_MEMORY_MACH_MSG: c_int = 20; ++ pub const VM_MEMORY_IOKIT: c_int = 21; ++ pub const VM_MEMORY_STACK: c_int = 30; ++ pub const VM_MEMORY_GUARD: c_int = 31; ++ pub const VM_MEMORY_SHARED_PMAP: c_int = 32; ++ pub const VM_MEMORY_DYLIB: c_int = 33; ++ pub const VM_MEMORY_OBJC_DISPATCHERS: c_int = 34; ++ pub const VM_MEMORY_UNSHARED_PMAP: c_int = 35; ++ pub const VM_MEMORY_APPKIT: c_int = 40; ++ pub const VM_MEMORY_FOUNDATION: c_int = 41; ++ pub const VM_MEMORY_COREGRAPHICS: c_int = 42; ++ pub const VM_MEMORY_CORESERVICES: c_int = 43; ++ pub const VM_MEMORY_CARBON: c_int = VM_MEMORY_CORESERVICES; ++ pub const VM_MEMORY_JAVA: c_int = 44; ++ pub const VM_MEMORY_COREDATA: c_int = 45; ++ pub const VM_MEMORY_COREDATA_OBJECTIDS: c_int = 46; ++ pub const VM_MEMORY_ATS: c_int = 50; ++ pub const VM_MEMORY_LAYERKIT: c_int = 51; ++ pub const VM_MEMORY_CGIMAGE: c_int = 52; ++ pub const VM_MEMORY_TCMALLOC: c_int = 53; ++ pub const VM_MEMORY_COREGRAPHICS_DATA: c_int = 54; ++ pub const VM_MEMORY_COREGRAPHICS_SHARED: c_int = 55; ++ pub const VM_MEMORY_COREGRAPHICS_FRAMEBUFFERS: c_int = 56; ++ pub const VM_MEMORY_COREGRAPHICS_BACKINGSTORES: c_int = 57; ++ pub const VM_MEMORY_COREGRAPHICS_XALLOC: c_int = 58; ++ pub const VM_MEMORY_COREGRAPHICS_MISC: c_int = VM_MEMORY_COREGRAPHICS; ++ pub const VM_MEMORY_DYLD: c_int = 60; ++ pub const VM_MEMORY_DYLD_MALLOC: c_int = 61; ++ pub const VM_MEMORY_SQLITE: c_int = 62; ++ pub const VM_MEMORY_JAVASCRIPT_CORE: c_int = 63; ++ pub const VM_MEMORY_JAVASCRIPT_JIT_EXECUTABLE_ALLOCATOR: c_int = 64; ++ pub const VM_MEMORY_JAVASCRIPT_JIT_REGISTER_FILE: c_int = 65; ++ pub const VM_MEMORY_GLSL: c_int = 66; ++ pub const VM_MEMORY_OPENCL: c_int = 67; ++ pub const VM_MEMORY_COREIMAGE: c_int = 68; ++ pub const VM_MEMORY_WEBCORE_PURGEABLE_BUFFERS: c_int = 69; ++ pub const VM_MEMORY_IMAGEIO: c_int = 70; ++ pub const VM_MEMORY_COREPROFILE: c_int = 71; ++ pub const VM_MEMORY_ASSETSD: c_int = 72; ++ pub const VM_MEMORY_OS_ALLOC_ONCE: c_int = 73; ++ pub const VM_MEMORY_LIBDISPATCH: c_int = 74; ++ pub const VM_MEMORY_ACCELERATE: c_int = 75; ++ pub const VM_MEMORY_COREUI: c_int = 76; ++ pub const VM_MEMORY_COREUIFILE: c_int = 77; ++ pub const VM_MEMORY_GENEALOGY: c_int = 78; ++ pub const VM_MEMORY_RAWCAMERA: c_int = 79; ++ pub const VM_MEMORY_CORPSEINFO: c_int = 80; ++ pub const VM_MEMORY_ASL: c_int = 81; ++ pub const VM_MEMORY_SWIFT_RUNTIME: c_int = 82; ++ pub const VM_MEMORY_SWIFT_METADATA: c_int = 83; ++ pub const VM_MEMORY_DHMM: c_int = 84; ++ pub const VM_MEMORY_SCENEKIT: c_int = 86; ++ pub const VM_MEMORY_SKYWALK: c_int = 87; ++ pub const VM_MEMORY_APPLICATION_SPECIFIC_1: c_int = 240; ++ pub const VM_MEMORY_APPLICATION_SPECIFIC_16: c_int = 255; ++} ++ ++pub const MAP_FAILED: *mut c_void = !0 as *mut c_void; ++ ++pub const MCL_CURRENT: c_int = 0x0001; ++pub const MCL_FUTURE: c_int = 0x0002; ++ ++pub const MS_ASYNC: c_int = 0x0001; ++pub const MS_INVALIDATE: c_int = 0x0002; ++pub const MS_SYNC: c_int = 0x0010; ++ ++pub const MS_KILLPAGES: c_int = 0x0004; ++pub const MS_DEACTIVATE: c_int = 0x0008; ++ ++pub const EPERM: c_int = 1; ++pub const ENOENT: c_int = 2; ++pub const ESRCH: c_int = 3; ++pub const EINTR: c_int = 4; ++pub const EIO: c_int = 5; ++pub const ENXIO: c_int = 6; ++pub const E2BIG: c_int = 7; ++pub const ENOEXEC: c_int = 8; ++pub const EBADF: c_int = 9; ++pub const ECHILD: c_int = 10; ++pub const EDEADLK: c_int = 11; ++pub const ENOMEM: c_int = 12; ++pub const EACCES: c_int = 13; ++pub const EFAULT: c_int = 14; ++pub const ENOTBLK: c_int = 15; ++pub const EBUSY: c_int = 16; ++pub const EEXIST: c_int = 17; ++pub const EXDEV: c_int = 18; ++pub const ENODEV: c_int = 19; ++pub const ENOTDIR: c_int = 20; ++pub const EISDIR: c_int = 21; ++pub const EINVAL: c_int = 22; ++pub const ENFILE: c_int = 23; ++pub const EMFILE: c_int = 24; ++pub const ENOTTY: c_int = 25; ++pub const ETXTBSY: c_int = 26; ++pub const EFBIG: c_int = 27; ++pub const ENOSPC: c_int = 28; ++pub const ESPIPE: c_int = 29; ++pub const EROFS: c_int = 30; ++pub const EMLINK: c_int = 31; ++pub const EPIPE: c_int = 32; ++pub const EDOM: c_int = 33; ++pub const ERANGE: c_int = 34; ++pub const EAGAIN: c_int = 35; ++pub const EWOULDBLOCK: c_int = EAGAIN; ++pub const EINPROGRESS: c_int = 36; ++pub const EALREADY: c_int = 37; ++pub const ENOTSOCK: c_int = 38; ++pub const EDESTADDRREQ: c_int = 39; ++pub const EMSGSIZE: c_int = 40; ++pub const EPROTOTYPE: c_int = 41; ++pub const ENOPROTOOPT: c_int = 42; ++pub const EPROTONOSUPPORT: c_int = 43; ++pub const ESOCKTNOSUPPORT: c_int = 44; ++pub const ENOTSUP: c_int = 45; ++pub const EPFNOSUPPORT: c_int = 46; ++pub const EAFNOSUPPORT: c_int = 47; ++pub const EADDRINUSE: c_int = 48; ++pub const EADDRNOTAVAIL: c_int = 49; ++pub const ENETDOWN: c_int = 50; ++pub const ENETUNREACH: c_int = 51; ++pub const ENETRESET: c_int = 52; ++pub const ECONNABORTED: c_int = 53; ++pub const ECONNRESET: c_int = 54; ++pub const ENOBUFS: c_int = 55; ++pub const EISCONN: c_int = 56; ++pub const ENOTCONN: c_int = 57; ++pub const ESHUTDOWN: c_int = 58; ++pub const ETOOMANYREFS: c_int = 59; ++pub const ETIMEDOUT: c_int = 60; ++pub const ECONNREFUSED: c_int = 61; ++pub const ELOOP: c_int = 62; ++pub const ENAMETOOLONG: c_int = 63; ++pub const EHOSTDOWN: c_int = 64; ++pub const EHOSTUNREACH: c_int = 65; ++pub const ENOTEMPTY: c_int = 66; ++pub const EPROCLIM: c_int = 67; ++pub const EUSERS: c_int = 68; ++pub const EDQUOT: c_int = 69; ++pub const ESTALE: c_int = 70; ++pub const EREMOTE: c_int = 71; ++pub const EBADRPC: c_int = 72; ++pub const ERPCMISMATCH: c_int = 73; ++pub const EPROGUNAVAIL: c_int = 74; ++pub const EPROGMISMATCH: c_int = 75; ++pub const EPROCUNAVAIL: c_int = 76; ++pub const ENOLCK: c_int = 77; ++pub const ENOSYS: c_int = 78; ++pub const EFTYPE: c_int = 79; ++pub const EAUTH: c_int = 80; ++pub const ENEEDAUTH: c_int = 81; ++pub const EPWROFF: c_int = 82; ++pub const EDEVERR: c_int = 83; ++pub const EOVERFLOW: c_int = 84; ++pub const EBADEXEC: c_int = 85; ++pub const EBADARCH: c_int = 86; ++pub const ESHLIBVERS: c_int = 87; ++pub const EBADMACHO: c_int = 88; ++pub const ECANCELED: c_int = 89; ++pub const EIDRM: c_int = 90; ++pub const ENOMSG: c_int = 91; ++pub const EILSEQ: c_int = 92; ++pub const ENOATTR: c_int = 93; ++pub const EBADMSG: c_int = 94; ++pub const EMULTIHOP: c_int = 95; ++pub const ENODATA: c_int = 96; ++pub const ENOLINK: c_int = 97; ++pub const ENOSR: c_int = 98; ++pub const ENOSTR: c_int = 99; ++pub const EPROTO: c_int = 100; ++pub const ETIME: c_int = 101; ++pub const EOPNOTSUPP: c_int = 102; ++pub const ENOPOLICY: c_int = 103; ++pub const ENOTRECOVERABLE: c_int = 104; ++pub const EOWNERDEAD: c_int = 105; ++pub const EQFULL: c_int = 106; ++pub const ELAST: c_int = 106; ++ ++pub const EAI_AGAIN: c_int = 2; ++pub const EAI_BADFLAGS: c_int = 3; ++pub const EAI_FAIL: c_int = 4; ++pub const EAI_FAMILY: c_int = 5; ++pub const EAI_MEMORY: c_int = 6; ++pub const EAI_NODATA: c_int = 7; ++pub const EAI_NONAME: c_int = 8; ++pub const EAI_SERVICE: c_int = 9; ++pub const EAI_SOCKTYPE: c_int = 10; ++pub const EAI_SYSTEM: c_int = 11; ++pub const EAI_OVERFLOW: c_int = 14; ++ ++pub const F_DUPFD: c_int = 0; ++pub const F_DUPFD_CLOEXEC: c_int = 67; ++pub const F_GETFD: c_int = 1; ++pub const F_SETFD: c_int = 2; ++pub const F_GETFL: c_int = 3; ++pub const F_SETFL: c_int = 4; ++pub const F_PREALLOCATE: c_int = 42; ++pub const F_RDADVISE: c_int = 44; ++pub const F_RDAHEAD: c_int = 45; ++pub const F_NOCACHE: c_int = 48; ++pub const F_LOG2PHYS: c_int = 49; ++pub const F_GETPATH: c_int = 50; ++pub const F_FULLFSYNC: c_int = 51; ++pub const F_FREEZE_FS: c_int = 53; ++pub const F_THAW_FS: c_int = 54; ++pub const F_GLOBAL_NOCACHE: c_int = 55; ++pub const F_NODIRECT: c_int = 62; ++pub const F_LOG2PHYS_EXT: c_int = 65; ++pub const F_BARRIERFSYNC: c_int = 85; ++// See https://github.com/apple/darwin-xnu/blob/main/bsd/sys/fcntl.h ++pub const F_OFD_SETLK: c_int = 90; /* Acquire or release open file description lock */ ++pub const F_OFD_SETLKW: c_int = 91; /* (as F_OFD_SETLK but blocking if conflicting lock) */ ++pub const F_OFD_GETLK: c_int = 92; /* Examine OFD lock */ ++pub const F_PUNCHHOLE: c_int = 99; ++pub const F_TRIM_ACTIVE_FILE: c_int = 100; ++pub const F_SPECULATIVE_READ: c_int = 101; ++pub const F_GETPATH_NOFIRMLINK: c_int = 102; ++pub const F_TRANSFEREXTENTS: c_int = 110; ++ ++pub const F_ALLOCATECONTIG: c_uint = 0x02; ++pub const F_ALLOCATEALL: c_uint = 0x04; ++pub const F_ALLOCATEPERSIST: c_uint = 0x08; ++ ++pub const F_PEOFPOSMODE: c_int = 3; ++pub const F_VOLPOSMODE: c_int = 4; ++ ++pub const AT_FDCWD: c_int = -2; ++pub const AT_EACCESS: c_int = 0x0010; ++pub const AT_SYMLINK_NOFOLLOW: c_int = 0x0020; ++pub const AT_SYMLINK_FOLLOW: c_int = 0x0040; ++pub const AT_REMOVEDIR: c_int = 0x0080; ++ ++pub const PTHREAD_INTROSPECTION_THREAD_CREATE: c_uint = 1; ++pub const PTHREAD_INTROSPECTION_THREAD_START: c_uint = 2; ++pub const PTHREAD_INTROSPECTION_THREAD_TERMINATE: c_uint = 3; ++pub const PTHREAD_INTROSPECTION_THREAD_DESTROY: c_uint = 4; ++ ++pub const TIOCMODG: c_ulong = 0x40047403; ++pub const TIOCMODS: c_ulong = 0x80047404; ++pub const TIOCM_LE: c_int = 0x1; ++pub const TIOCM_DTR: c_int = 0x2; ++pub const TIOCM_RTS: c_int = 0x4; ++pub const TIOCM_ST: c_int = 0x8; ++pub const TIOCM_SR: c_int = 0x10; ++pub const TIOCM_CTS: c_int = 0x20; ++pub const TIOCM_CAR: c_int = 0x40; ++pub const TIOCM_CD: c_int = 0x40; ++pub const TIOCM_RNG: c_int = 0x80; ++pub const TIOCM_RI: c_int = 0x80; ++pub const TIOCM_DSR: c_int = 0x100; ++pub const TIOCEXCL: c_int = 0x2000740d; ++pub const TIOCNXCL: c_int = 0x2000740e; ++pub const TIOCFLUSH: c_ulong = 0x80047410; ++pub const TIOCGETD: c_ulong = 0x4004741a; ++pub const TIOCSETD: c_ulong = 0x8004741b; ++pub const TIOCIXON: c_uint = 0x20007481; ++pub const TIOCIXOFF: c_uint = 0x20007480; ++pub const TIOCSDTR: c_uint = 0x20007479; ++pub const TIOCCDTR: c_uint = 0x20007478; ++pub const TIOCGPGRP: c_ulong = 0x40047477; ++pub const TIOCSPGRP: c_ulong = 0x80047476; ++pub const TIOCOUTQ: c_ulong = 0x40047473; ++pub const TIOCSTI: c_ulong = 0x80017472; ++pub const TIOCNOTTY: c_uint = 0x20007471; ++pub const TIOCPKT: c_ulong = 0x80047470; ++pub const TIOCPKT_DATA: c_int = 0x0; ++pub const TIOCPKT_FLUSHREAD: c_int = 0x1; ++pub const TIOCPKT_FLUSHWRITE: c_int = 0x2; ++pub const TIOCPKT_STOP: c_int = 0x4; ++pub const TIOCPKT_START: c_int = 0x8; ++pub const TIOCPKT_NOSTOP: c_int = 0x10; ++pub const TIOCPKT_DOSTOP: c_int = 0x20; ++pub const TIOCPKT_IOCTL: c_int = 0x40; ++pub const TIOCSTOP: c_uint = 0x2000746f; ++pub const TIOCSTART: c_uint = 0x2000746e; ++pub const TIOCMSET: c_ulong = 0x8004746d; ++pub const TIOCMBIS: c_ulong = 0x8004746c; ++pub const TIOCMBIC: c_ulong = 0x8004746b; ++pub const TIOCMGET: c_ulong = 0x4004746a; ++pub const TIOCREMOTE: c_ulong = 0x80047469; ++pub const TIOCGWINSZ: c_ulong = 0x40087468; ++pub const TIOCSWINSZ: c_ulong = 0x80087467; ++pub const TIOCUCNTL: c_ulong = 0x80047466; ++pub const TIOCSTAT: c_uint = 0x20007465; ++pub const TIOCSCONS: c_uint = 0x20007463; ++pub const TIOCCONS: c_ulong = 0x80047462; ++pub const TIOCSCTTY: c_uint = 0x20007461; ++pub const TIOCEXT: c_ulong = 0x80047460; ++pub const TIOCSIG: c_uint = 0x2000745f; ++pub const TIOCDRAIN: c_uint = 0x2000745e; ++pub const TIOCMSDTRWAIT: c_ulong = 0x8004745b; ++pub const TIOCMGDTRWAIT: c_ulong = 0x4004745a; ++pub const TIOCSDRAINWAIT: c_ulong = 0x80047457; ++pub const TIOCGDRAINWAIT: c_ulong = 0x40047456; ++pub const TIOCDSIMICROCODE: c_uint = 0x20007455; ++pub const TIOCPTYGRANT: c_uint = 0x20007454; ++pub const TIOCPTYGNAME: c_uint = 0x40807453; ++pub const TIOCPTYUNLK: c_uint = 0x20007452; ++ ++pub const BIOCGRSIG: c_ulong = 0x40044272; ++pub const BIOCSRSIG: c_ulong = 0x80044273; ++pub const BIOCSDLT: c_ulong = 0x80044278; ++pub const BIOCGSEESENT: c_ulong = 0x40044276; ++pub const BIOCSSEESENT: c_ulong = 0x80044277; ++pub const BIOCGDLTLIST: c_ulong = 0xc00c4279; ++ ++pub const FIODTYPE: c_ulong = 0x4004667a; ++ ++pub const B0: speed_t = 0; ++pub const B50: speed_t = 50; ++pub const B75: speed_t = 75; ++pub const B110: speed_t = 110; ++pub const B134: speed_t = 134; ++pub const B150: speed_t = 150; ++pub const B200: speed_t = 200; ++pub const B300: speed_t = 300; ++pub const B600: speed_t = 600; ++pub const B1200: speed_t = 1200; ++pub const B1800: speed_t = 1800; ++pub const B2400: speed_t = 2400; ++pub const B4800: speed_t = 4800; ++pub const B9600: speed_t = 9600; ++pub const B19200: speed_t = 19200; ++pub const B38400: speed_t = 38400; ++pub const B7200: speed_t = 7200; ++pub const B14400: speed_t = 14400; ++pub const B28800: speed_t = 28800; ++pub const B57600: speed_t = 57600; ++pub const B76800: speed_t = 76800; ++pub const B115200: speed_t = 115200; ++pub const B230400: speed_t = 230400; ++pub const EXTA: speed_t = 19200; ++pub const EXTB: speed_t = 38400; ++ ++pub const SIGTRAP: c_int = 5; ++ ++pub const GLOB_APPEND: c_int = 0x0001; ++pub const GLOB_DOOFFS: c_int = 0x0002; ++pub const GLOB_ERR: c_int = 0x0004; ++pub const GLOB_MARK: c_int = 0x0008; ++pub const GLOB_NOCHECK: c_int = 0x0010; ++pub const GLOB_NOSORT: c_int = 0x0020; ++pub const GLOB_NOESCAPE: c_int = 0x2000; ++ ++pub const GLOB_NOSPACE: c_int = -1; ++pub const GLOB_ABORTED: c_int = -2; ++pub const GLOB_NOMATCH: c_int = -3; ++ ++pub const POSIX_MADV_NORMAL: c_int = 0; ++pub const POSIX_MADV_RANDOM: c_int = 1; ++pub const POSIX_MADV_SEQUENTIAL: c_int = 2; ++pub const POSIX_MADV_WILLNEED: c_int = 3; ++pub const POSIX_MADV_DONTNEED: c_int = 4; ++ ++pub const _SC_IOV_MAX: c_int = 56; ++pub const _SC_GETGR_R_SIZE_MAX: c_int = 70; ++pub const _SC_GETPW_R_SIZE_MAX: c_int = 71; ++pub const _SC_LOGIN_NAME_MAX: c_int = 73; ++pub const _SC_MQ_PRIO_MAX: c_int = 75; ++pub const _SC_THREAD_ATTR_STACKADDR: c_int = 82; ++pub const _SC_THREAD_ATTR_STACKSIZE: c_int = 83; ++pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: c_int = 85; ++pub const _SC_THREAD_KEYS_MAX: c_int = 86; ++pub const _SC_THREAD_PRIO_INHERIT: c_int = 87; ++pub const _SC_THREAD_PRIO_PROTECT: c_int = 88; ++pub const _SC_THREAD_PRIORITY_SCHEDULING: c_int = 89; ++pub const _SC_THREAD_PROCESS_SHARED: c_int = 90; ++pub const _SC_THREAD_SAFE_FUNCTIONS: c_int = 91; ++pub const _SC_THREAD_STACK_MIN: c_int = 93; ++pub const _SC_THREAD_THREADS_MAX: c_int = 94; ++pub const _SC_THREADS: c_int = 96; ++pub const _SC_TTY_NAME_MAX: c_int = 101; ++pub const _SC_ATEXIT_MAX: c_int = 107; ++pub const _SC_XOPEN_CRYPT: c_int = 108; ++pub const _SC_XOPEN_ENH_I18N: c_int = 109; ++pub const _SC_XOPEN_LEGACY: c_int = 110; ++pub const _SC_XOPEN_REALTIME: c_int = 111; ++pub const _SC_XOPEN_REALTIME_THREADS: c_int = 112; ++pub const _SC_XOPEN_SHM: c_int = 113; ++pub const _SC_XOPEN_UNIX: c_int = 115; ++pub const _SC_XOPEN_VERSION: c_int = 116; ++pub const _SC_XOPEN_XCU_VERSION: c_int = 121; ++pub const _SC_PHYS_PAGES: c_int = 200; ++ ++pub const PTHREAD_PROCESS_PRIVATE: c_int = 2; ++pub const PTHREAD_PROCESS_SHARED: c_int = 1; ++pub const PTHREAD_CREATE_JOINABLE: c_int = 1; ++pub const PTHREAD_CREATE_DETACHED: c_int = 2; ++pub const PTHREAD_INHERIT_SCHED: c_int = 1; ++pub const PTHREAD_EXPLICIT_SCHED: c_int = 2; ++pub const PTHREAD_CANCEL_ENABLE: c_int = 0x01; ++pub const PTHREAD_CANCEL_DISABLE: c_int = 0x00; ++pub const PTHREAD_CANCEL_DEFERRED: c_int = 0x02; ++pub const PTHREAD_CANCEL_ASYNCHRONOUS: c_int = 0x00; ++pub const PTHREAD_CANCELED: *mut c_void = 1 as *mut c_void; ++pub const PTHREAD_SCOPE_SYSTEM: c_int = 1; ++pub const PTHREAD_SCOPE_PROCESS: c_int = 2; ++pub const PTHREAD_PRIO_NONE: c_int = 0; ++pub const PTHREAD_PRIO_INHERIT: c_int = 1; ++pub const PTHREAD_PRIO_PROTECT: c_int = 2; ++ ++#[cfg(target_arch = "aarch64")] ++pub const PTHREAD_STACK_MIN: size_t = 16384; ++#[cfg(not(target_arch = "aarch64"))] ++pub const PTHREAD_STACK_MIN: size_t = 8192; ++ ++pub const RLIMIT_CPU: c_int = 0; ++pub const RLIMIT_FSIZE: c_int = 1; ++pub const RLIMIT_DATA: c_int = 2; ++pub const RLIMIT_STACK: c_int = 3; ++pub const RLIMIT_CORE: c_int = 4; ++pub const RLIMIT_AS: c_int = 5; ++pub const RLIMIT_RSS: c_int = RLIMIT_AS; ++pub const RLIMIT_MEMLOCK: c_int = 6; ++pub const RLIMIT_NPROC: c_int = 7; ++pub const RLIMIT_NOFILE: c_int = 8; ++#[deprecated(since = "0.2.64", note = "Not stable across OS versions")] ++pub const RLIM_NLIMITS: c_int = 9; ++pub const _RLIMIT_POSIX_FLAG: c_int = 0x1000; ++ ++pub const RLIM_INFINITY: rlim_t = 0x7fff_ffff_ffff_ffff; ++ ++pub const RUSAGE_SELF: c_int = 0; ++pub const RUSAGE_CHILDREN: c_int = -1; ++ ++pub const MADV_NORMAL: c_int = 0; ++pub const MADV_RANDOM: c_int = 1; ++pub const MADV_SEQUENTIAL: c_int = 2; ++pub const MADV_WILLNEED: c_int = 3; ++pub const MADV_DONTNEED: c_int = 4; ++pub const MADV_FREE: c_int = 5; ++pub const MADV_ZERO_WIRED_PAGES: c_int = 6; ++pub const MADV_FREE_REUSABLE: c_int = 7; ++pub const MADV_FREE_REUSE: c_int = 8; ++pub const MADV_CAN_REUSE: c_int = 9; ++ ++pub const MINCORE_INCORE: c_int = 0x1; ++pub const MINCORE_REFERENCED: c_int = 0x2; ++pub const MINCORE_MODIFIED: c_int = 0x4; ++pub const MINCORE_REFERENCED_OTHER: c_int = 0x8; ++pub const MINCORE_MODIFIED_OTHER: c_int = 0x10; ++ ++pub const CTLIOCGINFO: c_ulong = 0xc0644e03; ++ ++// ++// sys/netinet/in.h ++// Protocols (RFC 1700) ++// NOTE: These are in addition to the constants defined in src/unix/mod.rs ++ ++// IPPROTO_IP defined in src/unix/mod.rs ++/// IP6 hop-by-hop options ++pub const IPPROTO_HOPOPTS: c_int = 0; ++// IPPROTO_ICMP defined in src/unix/mod.rs ++/// group mgmt protocol ++pub const IPPROTO_IGMP: c_int = 2; ++/// gateway2 (deprecated) ++pub const IPPROTO_GGP: c_int = 3; ++/// for compatibility ++pub const IPPROTO_IPIP: c_int = 4; ++// IPPROTO_TCP defined in src/unix/mod.rs ++/// Stream protocol II. ++pub const IPPROTO_ST: c_int = 7; ++/// exterior gateway protocol ++pub const IPPROTO_EGP: c_int = 8; ++/// private interior gateway ++pub const IPPROTO_PIGP: c_int = 9; ++/// BBN RCC Monitoring ++pub const IPPROTO_RCCMON: c_int = 10; ++/// network voice protocol ++pub const IPPROTO_NVPII: c_int = 11; ++/// pup ++pub const IPPROTO_PUP: c_int = 12; ++/// Argus ++pub const IPPROTO_ARGUS: c_int = 13; ++/// EMCON ++pub const IPPROTO_EMCON: c_int = 14; ++/// Cross Net Debugger ++pub const IPPROTO_XNET: c_int = 15; ++/// Chaos ++pub const IPPROTO_CHAOS: c_int = 16; ++// IPPROTO_UDP defined in src/unix/mod.rs ++/// Multiplexing ++pub const IPPROTO_MUX: c_int = 18; ++/// DCN Measurement Subsystems ++pub const IPPROTO_MEAS: c_int = 19; ++/// Host Monitoring ++pub const IPPROTO_HMP: c_int = 20; ++/// Packet Radio Measurement ++pub const IPPROTO_PRM: c_int = 21; ++/// xns idp ++pub const IPPROTO_IDP: c_int = 22; ++/// Trunk-1 ++pub const IPPROTO_TRUNK1: c_int = 23; ++/// Trunk-2 ++pub const IPPROTO_TRUNK2: c_int = 24; ++/// Leaf-1 ++pub const IPPROTO_LEAF1: c_int = 25; ++/// Leaf-2 ++pub const IPPROTO_LEAF2: c_int = 26; ++/// Reliable Data ++pub const IPPROTO_RDP: c_int = 27; ++/// Reliable Transaction ++pub const IPPROTO_IRTP: c_int = 28; ++/// tp-4 w/ class negotiation ++pub const IPPROTO_TP: c_int = 29; ++/// Bulk Data Transfer ++pub const IPPROTO_BLT: c_int = 30; ++/// Network Services ++pub const IPPROTO_NSP: c_int = 31; ++/// Merit Internodal ++pub const IPPROTO_INP: c_int = 32; ++/// Sequential Exchange ++pub const IPPROTO_SEP: c_int = 33; ++/// Third Party Connect ++pub const IPPROTO_3PC: c_int = 34; ++/// InterDomain Policy Routing ++pub const IPPROTO_IDPR: c_int = 35; ++/// XTP ++pub const IPPROTO_XTP: c_int = 36; ++/// Datagram Delivery ++pub const IPPROTO_DDP: c_int = 37; ++/// Control Message Transport ++pub const IPPROTO_CMTP: c_int = 38; ++/// TP++ Transport ++pub const IPPROTO_TPXX: c_int = 39; ++/// IL transport protocol ++pub const IPPROTO_IL: c_int = 40; ++// IPPROTO_IPV6 defined in src/unix/mod.rs ++/// Source Demand Routing ++pub const IPPROTO_SDRP: c_int = 42; ++/// IP6 routing header ++pub const IPPROTO_ROUTING: c_int = 43; ++/// IP6 fragmentation header ++pub const IPPROTO_FRAGMENT: c_int = 44; ++/// InterDomain Routing ++pub const IPPROTO_IDRP: c_int = 45; ++/// resource reservation ++pub const IPPROTO_RSVP: c_int = 46; ++/// General Routing Encap. ++pub const IPPROTO_GRE: c_int = 47; ++/// Mobile Host Routing ++pub const IPPROTO_MHRP: c_int = 48; ++/// BHA ++pub const IPPROTO_BHA: c_int = 49; ++/// IP6 Encap Sec. Payload ++pub const IPPROTO_ESP: c_int = 50; ++/// IP6 Auth Header ++pub const IPPROTO_AH: c_int = 51; ++/// Integ. Net Layer Security ++pub const IPPROTO_INLSP: c_int = 52; ++/// IP with encryption ++pub const IPPROTO_SWIPE: c_int = 53; ++/// Next Hop Resolution ++pub const IPPROTO_NHRP: c_int = 54; ++/* 55-57: Unassigned */ ++// IPPROTO_ICMPV6 defined in src/unix/mod.rs ++/// IP6 no next header ++pub const IPPROTO_NONE: c_int = 59; ++/// IP6 destination option ++pub const IPPROTO_DSTOPTS: c_int = 60; ++/// any host internal protocol ++pub const IPPROTO_AHIP: c_int = 61; ++/// CFTP ++pub const IPPROTO_CFTP: c_int = 62; ++/// "hello" routing protocol ++pub const IPPROTO_HELLO: c_int = 63; ++/// SATNET/Backroom EXPAK ++pub const IPPROTO_SATEXPAK: c_int = 64; ++/// Kryptolan ++pub const IPPROTO_KRYPTOLAN: c_int = 65; ++/// Remote Virtual Disk ++pub const IPPROTO_RVD: c_int = 66; ++/// Pluribus Packet Core ++pub const IPPROTO_IPPC: c_int = 67; ++/// Any distributed FS ++pub const IPPROTO_ADFS: c_int = 68; ++/// Satnet Monitoring ++pub const IPPROTO_SATMON: c_int = 69; ++/// VISA Protocol ++pub const IPPROTO_VISA: c_int = 70; ++/// Packet Core Utility ++pub const IPPROTO_IPCV: c_int = 71; ++/// Comp. Prot. Net. Executive ++pub const IPPROTO_CPNX: c_int = 72; ++/// Comp. Prot. HeartBeat ++pub const IPPROTO_CPHB: c_int = 73; ++/// Wang Span Network ++pub const IPPROTO_WSN: c_int = 74; ++/// Packet Video Protocol ++pub const IPPROTO_PVP: c_int = 75; ++/// BackRoom SATNET Monitoring ++pub const IPPROTO_BRSATMON: c_int = 76; ++/// Sun net disk proto (temp.) ++pub const IPPROTO_ND: c_int = 77; ++/// WIDEBAND Monitoring ++pub const IPPROTO_WBMON: c_int = 78; ++/// WIDEBAND EXPAK ++pub const IPPROTO_WBEXPAK: c_int = 79; ++/// ISO cnlp ++pub const IPPROTO_EON: c_int = 80; ++/// VMTP ++pub const IPPROTO_VMTP: c_int = 81; ++/// Secure VMTP ++pub const IPPROTO_SVMTP: c_int = 82; ++/// Banyon VINES ++pub const IPPROTO_VINES: c_int = 83; ++/// TTP ++pub const IPPROTO_TTP: c_int = 84; ++/// NSFNET-IGP ++pub const IPPROTO_IGP: c_int = 85; ++/// dissimilar gateway prot. ++pub const IPPROTO_DGP: c_int = 86; ++/// TCF ++pub const IPPROTO_TCF: c_int = 87; ++/// Cisco/GXS IGRP ++pub const IPPROTO_IGRP: c_int = 88; ++/// OSPFIGP ++pub const IPPROTO_OSPFIGP: c_int = 89; ++/// Strite RPC protocol ++pub const IPPROTO_SRPC: c_int = 90; ++/// Locus Address Resoloution ++pub const IPPROTO_LARP: c_int = 91; ++/// Multicast Transport ++pub const IPPROTO_MTP: c_int = 92; ++/// AX.25 Frames ++pub const IPPROTO_AX25: c_int = 93; ++/// IP encapsulated in IP ++pub const IPPROTO_IPEIP: c_int = 94; ++/// Mobile Int.ing control ++pub const IPPROTO_MICP: c_int = 95; ++/// Semaphore Comm. security ++pub const IPPROTO_SCCSP: c_int = 96; ++/// Ethernet IP encapsulation ++pub const IPPROTO_ETHERIP: c_int = 97; ++/// encapsulation header ++pub const IPPROTO_ENCAP: c_int = 98; ++/// any private encr. scheme ++pub const IPPROTO_APES: c_int = 99; ++/// GMTP ++pub const IPPROTO_GMTP: c_int = 100; ++ ++/* 101-254: Partly Unassigned */ ++/// Protocol Independent Mcast ++pub const IPPROTO_PIM: c_int = 103; ++/// payload compression (IPComp) ++pub const IPPROTO_IPCOMP: c_int = 108; ++/// PGM ++pub const IPPROTO_PGM: c_int = 113; ++/// SCTP ++pub const IPPROTO_SCTP: c_int = 132; ++ ++/* 255: Reserved */ ++/* BSD Private, local use, namespace incursion */ ++/// divert pseudo-protocol ++pub const IPPROTO_DIVERT: c_int = 254; ++/// raw IP packet ++pub const IPPROTO_RAW: c_int = 255; ++pub const IPPROTO_MAX: c_int = 256; ++/// last return value of *_input(), meaning "all job for this pkt is done". ++pub const IPPROTO_DONE: c_int = 257; ++ ++pub const AF_UNSPEC: c_int = 0; ++pub const AF_LOCAL: c_int = 1; ++pub const AF_UNIX: c_int = AF_LOCAL; ++pub const AF_INET: c_int = 2; ++pub const AF_IMPLINK: c_int = 3; ++pub const AF_PUP: c_int = 4; ++pub const AF_CHAOS: c_int = 5; ++pub const AF_NS: c_int = 6; ++pub const AF_ISO: c_int = 7; ++pub const AF_OSI: c_int = AF_ISO; ++pub const AF_ECMA: c_int = 8; ++pub const AF_DATAKIT: c_int = 9; ++pub const AF_CCITT: c_int = 10; ++pub const AF_SNA: c_int = 11; ++pub const AF_DECnet: c_int = 12; ++pub const AF_DLI: c_int = 13; ++pub const AF_LAT: c_int = 14; ++pub const AF_HYLINK: c_int = 15; ++pub const AF_APPLETALK: c_int = 16; ++pub const AF_ROUTE: c_int = 17; ++pub const AF_LINK: c_int = 18; ++pub const pseudo_AF_XTP: c_int = 19; ++pub const AF_COIP: c_int = 20; ++pub const AF_CNT: c_int = 21; ++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; ++pub const AF_INET6: c_int = 30; ++pub const AF_NATM: c_int = 31; ++pub const AF_SYSTEM: c_int = 32; ++pub const AF_NETBIOS: c_int = 33; ++pub const AF_PPP: c_int = 34; ++pub const pseudo_AF_HDRCMPLT: c_int = 35; ++pub const AF_IEEE80211: c_int = 37; ++pub const AF_UTUN: c_int = 38; ++pub const AF_VSOCK: c_int = 40; ++pub const AF_SYS_CONTROL: c_int = 2; ++ ++pub const SYSPROTO_EVENT: c_int = 1; ++pub const SYSPROTO_CONTROL: c_int = 2; ++ ++pub const PF_UNSPEC: c_int = AF_UNSPEC; ++pub const PF_LOCAL: c_int = AF_LOCAL; ++pub const PF_UNIX: c_int = PF_LOCAL; ++pub const PF_INET: c_int = AF_INET; ++pub const PF_IMPLINK: c_int = AF_IMPLINK; ++pub const PF_PUP: c_int = AF_PUP; ++pub const PF_CHAOS: c_int = AF_CHAOS; ++pub const PF_NS: c_int = AF_NS; ++pub const PF_ISO: c_int = AF_ISO; ++pub const PF_OSI: c_int = AF_ISO; ++pub const PF_ECMA: c_int = AF_ECMA; ++pub const PF_DATAKIT: c_int = AF_DATAKIT; ++pub const PF_CCITT: c_int = AF_CCITT; ++pub const PF_SNA: c_int = AF_SNA; ++pub const PF_DECnet: c_int = AF_DECnet; ++pub const PF_DLI: c_int = AF_DLI; ++pub const PF_LAT: c_int = AF_LAT; ++pub const PF_HYLINK: c_int = AF_HYLINK; ++pub const PF_APPLETALK: c_int = AF_APPLETALK; ++pub const PF_ROUTE: c_int = AF_ROUTE; ++pub const PF_LINK: c_int = AF_LINK; ++pub const PF_XTP: c_int = pseudo_AF_XTP; ++pub const PF_COIP: c_int = AF_COIP; ++pub const PF_CNT: c_int = AF_CNT; ++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; ++pub const PF_NATM: c_int = AF_NATM; ++pub const PF_SYSTEM: c_int = AF_SYSTEM; ++pub const PF_NETBIOS: c_int = AF_NETBIOS; ++pub const PF_PPP: c_int = AF_PPP; ++pub const PF_VSOCK: c_int = AF_VSOCK; ++ ++pub const NET_RT_DUMP: c_int = 1; ++pub const NET_RT_FLAGS: c_int = 2; ++pub const NET_RT_IFLIST: c_int = 3; ++ ++pub const SOMAXCONN: c_int = 128; ++ ++pub const SOCK_MAXADDRLEN: c_int = 255; ++ ++pub const SOCK_STREAM: c_int = 1; ++pub const SOCK_DGRAM: c_int = 2; ++pub const SOCK_RAW: c_int = 3; ++pub const SOCK_RDM: c_int = 4; ++pub const SOCK_SEQPACKET: c_int = 5; ++pub const IP_TTL: c_int = 4; ++pub const IP_HDRINCL: c_int = 2; ++pub const IP_RECVDSTADDR: c_int = 7; ++pub const IP_ADD_MEMBERSHIP: c_int = 12; ++pub const IP_DROP_MEMBERSHIP: c_int = 13; ++pub const IP_RECVIF: c_int = 20; ++pub const IP_RECVTTL: c_int = 24; ++pub const IP_BOUND_IF: c_int = 25; ++pub const IP_PKTINFO: c_int = 26; ++pub const IP_RECVTOS: c_int = 27; ++pub const IP_DONTFRAG: c_int = 28; ++pub const IPV6_JOIN_GROUP: c_int = 12; ++pub const IPV6_LEAVE_GROUP: c_int = 13; ++pub const IPV6_CHECKSUM: c_int = 26; ++pub const IPV6_RECVTCLASS: c_int = 35; ++pub const IPV6_TCLASS: c_int = 36; ++pub const IPV6_RECVHOPLIMIT: c_int = 37; ++pub const IPV6_PKTINFO: c_int = 46; ++pub const IPV6_HOPLIMIT: c_int = 47; ++pub const IPV6_RECVPKTINFO: c_int = 61; ++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; ++pub const TCP_KEEPALIVE: c_int = 0x10; ++pub const TCP_KEEPINTVL: c_int = 0x101; ++pub const TCP_KEEPCNT: c_int = 0x102; ++/// Enable/Disable TCP Fastopen on this socket ++pub const TCP_FASTOPEN: c_int = 0x105; ++pub const TCP_CONNECTION_INFO: c_int = 0x106; ++ ++pub const SOL_LOCAL: c_int = 0; ++ ++/// Retrieve peer credentials. ++pub const LOCAL_PEERCRED: c_int = 0x001; ++/// Retrieve peer PID. ++pub const LOCAL_PEERPID: c_int = 0x002; ++/// Retrieve effective peer PID. ++pub const LOCAL_PEEREPID: c_int = 0x003; ++/// Retrieve peer UUID. ++pub const LOCAL_PEERUUID: c_int = 0x004; ++/// Retrieve effective peer UUID. ++pub const LOCAL_PEEREUUID: c_int = 0x005; ++/// Retrieve peer audit token. ++pub const LOCAL_PEERTOKEN: c_int = 0x006; ++ ++pub const SOL_SOCKET: c_int = 0xffff; ++ ++pub const SO_DEBUG: c_int = 0x01; ++pub const SO_ACCEPTCONN: c_int = 0x0002; ++pub const SO_REUSEADDR: c_int = 0x0004; ++pub const SO_KEEPALIVE: c_int = 0x0008; ++pub const SO_DONTROUTE: c_int = 0x0010; ++pub const SO_BROADCAST: c_int = 0x0020; ++pub const SO_USELOOPBACK: c_int = 0x0040; ++pub const SO_LINGER: c_int = 0x0080; ++pub const SO_OOBINLINE: c_int = 0x0100; ++pub const SO_REUSEPORT: c_int = 0x0200; ++pub const SO_TIMESTAMP: c_int = 0x0400; ++pub const SO_TIMESTAMP_MONOTONIC: c_int = 0x0800; ++pub const SO_DONTTRUNC: c_int = 0x2000; ++pub const SO_WANTMORE: c_int = 0x4000; ++pub const SO_WANTOOBFLAG: c_int = 0x8000; ++pub const SO_SNDBUF: c_int = 0x1001; ++pub const SO_RCVBUF: c_int = 0x1002; ++pub const SO_SNDLOWAT: c_int = 0x1003; ++pub const SO_RCVLOWAT: c_int = 0x1004; ++pub const SO_SNDTIMEO: c_int = 0x1005; ++pub const SO_RCVTIMEO: c_int = 0x1006; ++pub const SO_ERROR: c_int = 0x1007; ++pub const SO_TYPE: c_int = 0x1008; ++pub const SO_LABEL: c_int = 0x1010; ++pub const SO_PEERLABEL: c_int = 0x1011; ++pub const SO_NREAD: c_int = 0x1020; ++pub const SO_NKE: c_int = 0x1021; ++pub const SO_NOSIGPIPE: c_int = 0x1022; ++pub const SO_NOADDRERR: c_int = 0x1023; ++pub const SO_NWRITE: c_int = 0x1024; ++pub const SO_REUSESHAREUID: c_int = 0x1025; ++pub const SO_NOTIFYCONFLICT: c_int = 0x1026; ++pub const SO_LINGER_SEC: c_int = 0x1080; ++pub const SO_RANDOMPORT: c_int = 0x1082; ++pub const SO_NP_EXTENSIONS: c_int = 0x1083; ++ ++pub const MSG_OOB: c_int = 0x1; ++pub const MSG_PEEK: c_int = 0x2; ++pub const MSG_DONTROUTE: c_int = 0x4; ++pub const MSG_EOR: c_int = 0x8; ++pub const MSG_TRUNC: c_int = 0x10; ++pub const MSG_CTRUNC: c_int = 0x20; ++pub const MSG_WAITALL: c_int = 0x40; ++pub const MSG_DONTWAIT: c_int = 0x80; ++pub const MSG_EOF: c_int = 0x100; ++pub const MSG_FLUSH: c_int = 0x400; ++pub const MSG_HOLD: c_int = 0x800; ++pub const MSG_SEND: c_int = 0x1000; ++pub const MSG_HAVEMORE: c_int = 0x2000; ++pub const MSG_RCVMORE: c_int = 0x4000; ++pub const MSG_NEEDSA: c_int = 0x10000; ++pub const MSG_NOSIGNAL: c_int = 0x80000; ++ ++pub const SCM_TIMESTAMP: c_int = 0x02; ++pub const SCM_CREDS: c_int = 0x03; ++ ++// https://github.com/aosm/xnu/blob/HEAD/bsd/net/if.h#L140-L156 ++pub const IFF_UP: c_int = 0x1; // interface is up ++pub const IFF_BROADCAST: c_int = 0x2; // broadcast address valid ++pub const IFF_DEBUG: c_int = 0x4; // turn on debugging ++pub const IFF_LOOPBACK: c_int = 0x8; // is a loopback net ++pub const IFF_POINTOPOINT: c_int = 0x10; // interface is point-to-point link ++pub const IFF_NOTRAILERS: c_int = 0x20; // obsolete: avoid use of trailers ++pub const IFF_RUNNING: c_int = 0x40; // resources allocated ++pub const IFF_NOARP: c_int = 0x80; // no address resolution protocol ++pub const IFF_PROMISC: c_int = 0x100; // receive all packets ++pub const IFF_ALLMULTI: c_int = 0x200; // receive all multicast packets ++pub const IFF_OACTIVE: c_int = 0x400; // transmission in progress ++pub const IFF_SIMPLEX: c_int = 0x800; // can't hear own transmissions ++pub const IFF_LINK0: c_int = 0x1000; // per link layer defined bit ++pub const IFF_LINK1: c_int = 0x2000; // per link layer defined bit ++pub const IFF_LINK2: c_int = 0x4000; // per link layer defined bit ++pub const IFF_ALTPHYS: c_int = IFF_LINK2; // use alternate physical connection ++pub const IFF_MULTICAST: c_int = 0x8000; // supports multicast ++ ++pub const SCOPE6_ID_MAX: size_t = 16; ++ ++pub const SHUT_RD: c_int = 0; ++pub const SHUT_WR: c_int = 1; ++pub const SHUT_RDWR: c_int = 2; ++ ++pub const SAE_ASSOCID_ANY: crate::sae_associd_t = 0; ++/// ((sae_associd_t)(-1ULL)) ++pub const SAE_ASSOCID_ALL: crate::sae_associd_t = 0xffffffff; ++ ++pub const SAE_CONNID_ANY: crate::sae_connid_t = 0; ++/// ((sae_connid_t)(-1ULL)) ++pub const SAE_CONNID_ALL: crate::sae_connid_t = 0xffffffff; ++ ++// connectx() flag parameters ++ ++/// resume connect() on read/write ++pub const CONNECT_RESUME_ON_READ_WRITE: c_uint = 0x1; ++/// data is idempotent ++pub const CONNECT_DATA_IDEMPOTENT: c_uint = 0x2; ++/// data includes security that replaces the TFO-cookie ++pub const CONNECT_DATA_AUTHENTICATED: c_uint = 0x4; ++ ++pub const LOCK_SH: c_int = 1; ++pub const LOCK_EX: c_int = 2; ++pub const LOCK_NB: c_int = 4; ++pub const LOCK_UN: c_int = 8; ++ ++pub const MAP_COPY: c_int = 0x0002; ++pub const MAP_RENAME: c_int = 0x0020; ++pub const MAP_NORESERVE: c_int = 0x0040; ++pub const MAP_NOEXTEND: c_int = 0x0100; ++pub const MAP_HASSEMAPHORE: c_int = 0x0200; ++pub const MAP_NOCACHE: c_int = 0x0400; ++pub const MAP_JIT: c_int = 0x0800; ++ ++pub const _SC_ARG_MAX: c_int = 1; ++pub const _SC_CHILD_MAX: c_int = 2; ++pub const _SC_CLK_TCK: c_int = 3; ++pub const _SC_NGROUPS_MAX: c_int = 4; ++pub const _SC_OPEN_MAX: c_int = 5; ++pub const _SC_JOB_CONTROL: c_int = 6; ++pub const _SC_SAVED_IDS: c_int = 7; ++pub const _SC_VERSION: c_int = 8; ++pub const _SC_BC_BASE_MAX: c_int = 9; ++pub const _SC_BC_DIM_MAX: c_int = 10; ++pub const _SC_BC_SCALE_MAX: c_int = 11; ++pub const _SC_BC_STRING_MAX: c_int = 12; ++pub const _SC_COLL_WEIGHTS_MAX: c_int = 13; ++pub const _SC_EXPR_NEST_MAX: c_int = 14; ++pub const _SC_LINE_MAX: c_int = 15; ++pub const _SC_RE_DUP_MAX: c_int = 16; ++pub const _SC_2_VERSION: c_int = 17; ++pub const _SC_2_C_BIND: c_int = 18; ++pub const _SC_2_C_DEV: c_int = 19; ++pub const _SC_2_CHAR_TERM: c_int = 20; ++pub const _SC_2_FORT_DEV: c_int = 21; ++pub const _SC_2_FORT_RUN: c_int = 22; ++pub const _SC_2_LOCALEDEF: c_int = 23; ++pub const _SC_2_SW_DEV: c_int = 24; ++pub const _SC_2_UPE: c_int = 25; ++pub const _SC_STREAM_MAX: c_int = 26; ++pub const _SC_TZNAME_MAX: c_int = 27; ++pub const _SC_ASYNCHRONOUS_IO: c_int = 28; ++pub const _SC_PAGESIZE: c_int = 29; ++pub const _SC_MEMLOCK: c_int = 30; ++pub const _SC_MEMLOCK_RANGE: c_int = 31; ++pub const _SC_MEMORY_PROTECTION: c_int = 32; ++pub const _SC_MESSAGE_PASSING: c_int = 33; ++pub const _SC_PRIORITIZED_IO: c_int = 34; ++pub const _SC_PRIORITY_SCHEDULING: c_int = 35; ++pub const _SC_REALTIME_SIGNALS: c_int = 36; ++pub const _SC_SEMAPHORES: c_int = 37; ++pub const _SC_FSYNC: c_int = 38; ++pub const _SC_SHARED_MEMORY_OBJECTS: c_int = 39; ++pub const _SC_SYNCHRONIZED_IO: c_int = 40; ++pub const _SC_TIMERS: c_int = 41; ++pub const _SC_AIO_LISTIO_MAX: c_int = 42; ++pub const _SC_AIO_MAX: c_int = 43; ++pub const _SC_AIO_PRIO_DELTA_MAX: c_int = 44; ++pub const _SC_DELAYTIMER_MAX: c_int = 45; ++pub const _SC_MQ_OPEN_MAX: c_int = 46; ++pub const _SC_MAPPED_FILES: c_int = 47; ++pub const _SC_RTSIG_MAX: c_int = 48; ++pub const _SC_SEM_NSEMS_MAX: c_int = 49; ++pub const _SC_SEM_VALUE_MAX: c_int = 50; ++pub const _SC_SIGQUEUE_MAX: c_int = 51; ++pub const _SC_TIMER_MAX: c_int = 52; ++pub const _SC_NPROCESSORS_CONF: c_int = 57; ++pub const _SC_NPROCESSORS_ONLN: c_int = 58; ++pub const _SC_2_PBS: c_int = 59; ++pub const _SC_2_PBS_ACCOUNTING: c_int = 60; ++pub const _SC_2_PBS_CHECKPOINT: c_int = 61; ++pub const _SC_2_PBS_LOCATE: c_int = 62; ++pub const _SC_2_PBS_MESSAGE: c_int = 63; ++pub const _SC_2_PBS_TRACK: c_int = 64; ++pub const _SC_ADVISORY_INFO: c_int = 65; ++pub const _SC_BARRIERS: c_int = 66; ++pub const _SC_CLOCK_SELECTION: c_int = 67; ++pub const _SC_CPUTIME: c_int = 68; ++pub const _SC_FILE_LOCKING: c_int = 69; ++pub const _SC_HOST_NAME_MAX: c_int = 72; ++pub const _SC_MONOTONIC_CLOCK: c_int = 74; ++pub const _SC_READER_WRITER_LOCKS: c_int = 76; ++pub const _SC_REGEXP: c_int = 77; ++pub const _SC_SHELL: c_int = 78; ++pub const _SC_SPAWN: c_int = 79; ++pub const _SC_SPIN_LOCKS: c_int = 80; ++pub const _SC_SPORADIC_SERVER: c_int = 81; ++pub const _SC_THREAD_CPUTIME: c_int = 84; ++pub const _SC_THREAD_SPORADIC_SERVER: c_int = 92; ++pub const _SC_TIMEOUTS: c_int = 95; ++pub const _SC_TRACE: c_int = 97; ++pub const _SC_TRACE_EVENT_FILTER: c_int = 98; ++pub const _SC_TRACE_INHERIT: c_int = 99; ++pub const _SC_TRACE_LOG: c_int = 100; ++pub const _SC_TYPED_MEMORY_OBJECTS: c_int = 102; ++pub const _SC_V6_ILP32_OFF32: c_int = 103; ++pub const _SC_V6_ILP32_OFFBIG: c_int = 104; ++pub const _SC_V6_LP64_OFF64: c_int = 105; ++pub const _SC_V6_LPBIG_OFFBIG: c_int = 106; ++pub const _SC_IPV6: c_int = 118; ++pub const _SC_RAW_SOCKETS: c_int = 119; ++pub const _SC_SYMLOOP_MAX: c_int = 120; ++pub const _SC_PAGE_SIZE: c_int = _SC_PAGESIZE; ++pub const _SC_XOPEN_STREAMS: c_int = 114; ++pub const _SC_XBS5_ILP32_OFF32: c_int = 122; ++pub const _SC_XBS5_ILP32_OFFBIG: c_int = 123; ++pub const _SC_XBS5_LP64_OFF64: c_int = 124; ++pub const _SC_XBS5_LPBIG_OFFBIG: c_int = 125; ++pub const _SC_SS_REPL_MAX: c_int = 126; ++pub const _SC_TRACE_EVENT_NAME_MAX: c_int = 127; ++pub const _SC_TRACE_NAME_MAX: c_int = 128; ++pub const _SC_TRACE_SYS_MAX: c_int = 129; ++pub const _SC_TRACE_USER_EVENT_MAX: c_int = 130; ++pub const _SC_PASS_MAX: c_int = 131; ++// `confstr` keys (only the values guaranteed by `man confstr`). ++pub const _CS_PATH: c_int = 1; ++pub const _CS_DARWIN_USER_DIR: c_int = 65536; ++pub const _CS_DARWIN_USER_TEMP_DIR: c_int = 65537; ++pub const _CS_DARWIN_USER_CACHE_DIR: c_int = 65538; ++ ++pub const PTHREAD_MUTEX_NORMAL: c_int = 0; ++pub const PTHREAD_MUTEX_ERRORCHECK: c_int = 1; ++pub const PTHREAD_MUTEX_RECURSIVE: c_int = 2; ++pub const PTHREAD_MUTEX_DEFAULT: c_int = PTHREAD_MUTEX_NORMAL; ++pub const _PTHREAD_MUTEX_SIG_init: c_long = 0x32AAABA7; ++pub const _PTHREAD_COND_SIG_init: c_long = 0x3CB0B1BB; ++pub const _PTHREAD_RWLOCK_SIG_init: c_long = 0x2DA8B3B4; ++pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { ++ __sig: _PTHREAD_MUTEX_SIG_init, ++ __opaque: [0; __PTHREAD_MUTEX_SIZE__], ++}; ++pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { ++ __sig: _PTHREAD_COND_SIG_init, ++ __opaque: [0; __PTHREAD_COND_SIZE__], ++}; ++pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { ++ __sig: _PTHREAD_RWLOCK_SIG_init, ++ __opaque: [0; __PTHREAD_RWLOCK_SIZE__], ++}; ++ ++pub const OS_UNFAIR_LOCK_INIT: os_unfair_lock = os_unfair_lock { ++ _os_unfair_lock_opaque: 0, ++}; ++ ++pub const OS_LOG_TYPE_DEFAULT: crate::os_log_type_t = 0x00; ++pub const OS_LOG_TYPE_INFO: crate::os_log_type_t = 0x01; ++pub const OS_LOG_TYPE_DEBUG: crate::os_log_type_t = 0x02; ++pub const OS_LOG_TYPE_ERROR: crate::os_log_type_t = 0x10; ++pub const OS_LOG_TYPE_FAULT: crate::os_log_type_t = 0x11; ++ ++pub const OS_SIGNPOST_EVENT: crate::os_signpost_type_t = 0x00; ++pub const OS_SIGNPOST_INTERVAL_BEGIN: crate::os_signpost_type_t = 0x01; ++pub const OS_SIGNPOST_INTERVAL_END: crate::os_signpost_type_t = 0x02; ++ ++pub const MINSIGSTKSZ: size_t = 32768; ++pub const SIGSTKSZ: size_t = 131072; ++ ++pub const FD_SETSIZE: usize = 1024; ++ ++pub const ST_NOSUID: c_ulong = 2; ++ ++pub const SCHED_OTHER: c_int = 1; ++pub const SCHED_FIFO: c_int = 4; ++pub const SCHED_RR: c_int = 2; ++ ++pub const EVFILT_READ: i16 = -1; ++pub const EVFILT_WRITE: i16 = -2; ++pub const EVFILT_AIO: i16 = -3; ++pub const EVFILT_VNODE: i16 = -4; ++pub const EVFILT_PROC: i16 = -5; ++pub const EVFILT_SIGNAL: i16 = -6; ++pub const EVFILT_TIMER: i16 = -7; ++pub const EVFILT_MACHPORT: i16 = -8; ++pub const EVFILT_FS: i16 = -9; ++pub const EVFILT_USER: i16 = -10; ++pub const EVFILT_VM: i16 = -12; ++ ++pub const EV_ADD: u16 = 0x1; ++pub const EV_DELETE: u16 = 0x2; ++pub const EV_ENABLE: u16 = 0x4; ++pub const EV_DISABLE: u16 = 0x8; ++pub const EV_ONESHOT: u16 = 0x10; ++pub const EV_CLEAR: u16 = 0x20; ++pub const EV_RECEIPT: u16 = 0x40; ++pub const EV_DISPATCH: u16 = 0x80; ++pub const EV_FLAG0: u16 = 0x1000; ++pub const EV_POLL: u16 = 0x1000; ++pub const EV_FLAG1: u16 = 0x2000; ++pub const EV_OOBAND: u16 = 0x2000; ++pub const EV_ERROR: u16 = 0x4000; ++pub const EV_EOF: u16 = 0x8000; ++pub const EV_SYSFLAGS: u16 = 0xf000; ++ ++pub const NOTE_TRIGGER: u32 = 0x01000000; ++pub const NOTE_FFNOP: u32 = 0x00000000; ++pub const NOTE_FFAND: u32 = 0x40000000; ++pub const NOTE_FFOR: u32 = 0x80000000; ++pub const NOTE_FFCOPY: u32 = 0xc0000000; ++pub const NOTE_FFCTRLMASK: u32 = 0xc0000000; ++pub const NOTE_FFLAGSMASK: u32 = 0x00ffffff; ++pub const NOTE_LOWAT: u32 = 0x00000001; ++pub const NOTE_DELETE: u32 = 0x00000001; ++pub const NOTE_WRITE: u32 = 0x00000002; ++pub const NOTE_EXTEND: u32 = 0x00000004; ++pub const NOTE_ATTRIB: u32 = 0x00000008; ++pub const NOTE_LINK: u32 = 0x00000010; ++pub const NOTE_RENAME: u32 = 0x00000020; ++pub const NOTE_REVOKE: u32 = 0x00000040; ++pub const NOTE_NONE: u32 = 0x00000080; ++pub const NOTE_EXIT: u32 = 0x80000000; ++pub const NOTE_FORK: u32 = 0x40000000; ++pub const NOTE_EXEC: u32 = 0x20000000; ++#[doc(hidden)] ++#[deprecated(since = "0.2.49", note = "Deprecated since MacOSX 10.9")] ++pub const NOTE_REAP: u32 = 0x10000000; ++pub const NOTE_SIGNAL: u32 = 0x08000000; ++pub const NOTE_EXITSTATUS: u32 = 0x04000000; ++pub const NOTE_EXIT_DETAIL: u32 = 0x02000000; ++pub const NOTE_PDATAMASK: u32 = 0x000fffff; ++pub const NOTE_PCTRLMASK: u32 = 0xfff00000; ++#[doc(hidden)] ++#[deprecated(since = "0.2.49", note = "Deprecated since MacOSX 10.9")] ++pub const NOTE_EXIT_REPARENTED: u32 = 0x00080000; ++pub const NOTE_EXIT_DETAIL_MASK: u32 = 0x00070000; ++pub const NOTE_EXIT_DECRYPTFAIL: u32 = 0x00010000; ++pub const NOTE_EXIT_MEMORY: u32 = 0x00020000; ++pub const NOTE_EXIT_CSERROR: u32 = 0x00040000; ++pub const NOTE_VM_PRESSURE: u32 = 0x80000000; ++pub const NOTE_VM_PRESSURE_TERMINATE: u32 = 0x40000000; ++pub const NOTE_VM_PRESSURE_SUDDEN_TERMINATE: u32 = 0x20000000; ++pub const NOTE_VM_ERROR: u32 = 0x10000000; ++pub const NOTE_SECONDS: u32 = 0x00000001; ++pub const NOTE_USECONDS: u32 = 0x00000002; ++pub const NOTE_NSECONDS: u32 = 0x00000004; ++pub const NOTE_ABSOLUTE: u32 = 0x00000008; ++pub const NOTE_LEEWAY: u32 = 0x00000010; ++pub const NOTE_CRITICAL: u32 = 0x00000020; ++pub const NOTE_BACKGROUND: u32 = 0x00000040; ++pub const NOTE_MACH_CONTINUOUS_TIME: u32 = 0x00000080; ++pub const NOTE_MACHTIME: u32 = 0x00000100; ++pub const NOTE_TRACK: u32 = 0x00000001; ++pub const NOTE_TRACKERR: u32 = 0x00000002; ++pub const NOTE_CHILD: u32 = 0x00000004; ++ ++pub const OCRNL: crate::tcflag_t = 0x00000010; ++pub const ONOCR: crate::tcflag_t = 0x00000020; ++pub const ONLRET: crate::tcflag_t = 0x00000040; ++pub const OFILL: crate::tcflag_t = 0x00000080; ++pub const NLDLY: crate::tcflag_t = 0x00000300; ++pub const TABDLY: crate::tcflag_t = 0x00000c04; ++pub const CRDLY: crate::tcflag_t = 0x00003000; ++pub const FFDLY: crate::tcflag_t = 0x00004000; ++pub const BSDLY: crate::tcflag_t = 0x00008000; ++pub const VTDLY: crate::tcflag_t = 0x00010000; ++pub const OFDEL: crate::tcflag_t = 0x00020000; ++ ++pub const NL0: crate::tcflag_t = 0x00000000; ++pub const NL1: crate::tcflag_t = 0x00000100; ++pub const TAB0: crate::tcflag_t = 0x00000000; ++pub const TAB1: crate::tcflag_t = 0x00000400; ++pub const TAB2: crate::tcflag_t = 0x00000800; ++pub const CR0: crate::tcflag_t = 0x00000000; ++pub const CR1: crate::tcflag_t = 0x00001000; ++pub const CR2: crate::tcflag_t = 0x00002000; ++pub const CR3: crate::tcflag_t = 0x00003000; ++pub const FF0: crate::tcflag_t = 0x00000000; ++pub const FF1: crate::tcflag_t = 0x00004000; ++pub const BS0: crate::tcflag_t = 0x00000000; ++pub const BS1: crate::tcflag_t = 0x00008000; ++pub const TAB3: crate::tcflag_t = 0x00000004; ++pub const VT0: crate::tcflag_t = 0x00000000; ++pub const VT1: crate::tcflag_t = 0x00010000; ++pub const IUTF8: crate::tcflag_t = 0x00004000; ++pub const CRTSCTS: crate::tcflag_t = 0x00030000; ++ ++pub const NI_MAXHOST: crate::socklen_t = 1025; ++pub const NI_MAXSERV: crate::socklen_t = 32; ++pub const NI_NOFQDN: c_int = 0x00000001; ++pub const NI_NUMERICHOST: c_int = 0x00000002; ++pub const NI_NAMEREQD: c_int = 0x00000004; ++pub const NI_NUMERICSERV: c_int = 0x00000008; ++pub const NI_NUMERICSCOPE: c_int = 0x00000100; ++pub const NI_DGRAM: c_int = 0x00000010; ++ ++pub const Q_GETQUOTA: c_int = 0x300; ++pub const Q_SETQUOTA: c_int = 0x400; ++ ++pub const RENAME_SWAP: c_uint = 0x00000002; ++pub const RENAME_EXCL: c_uint = 0x00000004; ++ ++pub const RTLD_LOCAL: c_int = 0x4; ++pub const RTLD_FIRST: c_int = 0x100; ++pub const RTLD_NODELETE: c_int = 0x80; ++pub const RTLD_NOLOAD: c_int = 0x10; ++pub const RTLD_GLOBAL: c_int = 0x8; ++pub const RTLD_MAIN_ONLY: *mut c_void = -5isize as *mut c_void; ++ ++pub const _WSTOPPED: c_int = 0o177; ++ ++pub const LOG_NETINFO: c_int = 12 << 3; ++pub const LOG_REMOTEAUTH: c_int = 13 << 3; ++pub const LOG_INSTALL: c_int = 14 << 3; ++pub const LOG_RAS: c_int = 15 << 3; ++pub const LOG_LAUNCHD: c_int = 24 << 3; ++pub const LOG_NFACILITIES: c_int = 25; ++ ++pub const CTLTYPE: c_int = 0xf; ++pub const CTLTYPE_NODE: c_int = 1; ++pub const CTLTYPE_INT: c_int = 2; ++pub const CTLTYPE_STRING: c_int = 3; ++pub const CTLTYPE_QUAD: c_int = 4; ++pub const CTLTYPE_OPAQUE: c_int = 5; ++pub const CTLTYPE_STRUCT: c_int = CTLTYPE_OPAQUE; ++pub const CTLFLAG_RD: c_int = 0x80000000; ++pub const CTLFLAG_WR: c_int = 0x40000000; ++pub const CTLFLAG_RW: c_int = CTLFLAG_RD | CTLFLAG_WR; ++pub const CTLFLAG_NOLOCK: c_int = 0x20000000; ++pub const CTLFLAG_ANYBODY: c_int = 0x10000000; ++pub const CTLFLAG_SECURE: c_int = 0x08000000; ++pub const CTLFLAG_MASKED: c_int = 0x04000000; ++pub const CTLFLAG_NOAUTO: c_int = 0x02000000; ++pub const CTLFLAG_KERN: c_int = 0x01000000; ++pub const CTLFLAG_LOCKED: c_int = 0x00800000; ++pub const CTLFLAG_OID2: c_int = 0x00400000; ++pub const CTL_UNSPEC: c_int = 0; ++pub const CTL_KERN: c_int = 1; ++pub const CTL_VM: c_int = 2; ++pub const CTL_VFS: c_int = 3; ++pub const CTL_NET: c_int = 4; ++pub const CTL_DEBUG: c_int = 5; ++pub const CTL_HW: c_int = 6; ++pub const CTL_MACHDEP: c_int = 7; ++pub const CTL_USER: c_int = 8; ++pub const CTL_MAXID: c_int = 9; ++pub const KERN_OSTYPE: c_int = 1; ++pub const KERN_OSRELEASE: c_int = 2; ++pub const KERN_OSREV: c_int = 3; ++pub const KERN_VERSION: c_int = 4; ++pub const KERN_MAXVNODES: c_int = 5; ++pub const KERN_MAXPROC: c_int = 6; ++pub const KERN_MAXFILES: c_int = 7; ++pub const KERN_ARGMAX: c_int = 8; ++pub const KERN_SECURELVL: c_int = 9; ++pub const KERN_HOSTNAME: c_int = 10; ++pub const KERN_HOSTID: c_int = 11; ++pub const KERN_CLOCKRATE: c_int = 12; ++pub const KERN_VNODE: c_int = 13; ++pub const KERN_PROC: c_int = 14; ++pub const KERN_FILE: c_int = 15; ++pub const KERN_PROF: c_int = 16; ++pub const KERN_POSIX1: c_int = 17; ++pub const KERN_NGROUPS: c_int = 18; ++pub const KERN_JOB_CONTROL: c_int = 19; ++pub const KERN_SAVED_IDS: c_int = 20; ++pub const KERN_BOOTTIME: c_int = 21; ++pub const KERN_NISDOMAINNAME: c_int = 22; ++pub const KERN_DOMAINNAME: c_int = KERN_NISDOMAINNAME; ++pub const KERN_MAXPARTITIONS: c_int = 23; ++pub const KERN_KDEBUG: c_int = 24; ++pub const KERN_UPDATEINTERVAL: c_int = 25; ++pub const KERN_OSRELDATE: c_int = 26; ++pub const KERN_NTP_PLL: c_int = 27; ++pub const KERN_BOOTFILE: c_int = 28; ++pub const KERN_MAXFILESPERPROC: c_int = 29; ++pub const KERN_MAXPROCPERUID: c_int = 30; ++pub const KERN_DUMPDEV: c_int = 31; ++pub const KERN_IPC: c_int = 32; ++pub const KERN_DUMMY: c_int = 33; ++pub const KERN_PS_STRINGS: c_int = 34; ++pub const KERN_USRSTACK32: c_int = 35; ++pub const KERN_LOGSIGEXIT: c_int = 36; ++pub const KERN_SYMFILE: c_int = 37; ++pub const KERN_PROCARGS: c_int = 38; ++pub const KERN_NETBOOT: c_int = 40; ++pub const KERN_SYSV: c_int = 42; ++pub const KERN_AFFINITY: c_int = 43; ++pub const KERN_TRANSLATE: c_int = 44; ++pub const KERN_CLASSIC: c_int = KERN_TRANSLATE; ++pub const KERN_EXEC: c_int = 45; ++pub const KERN_CLASSICHANDLER: c_int = KERN_EXEC; ++pub const KERN_AIOMAX: c_int = 46; ++pub const KERN_AIOPROCMAX: c_int = 47; ++pub const KERN_AIOTHREADS: c_int = 48; ++pub const KERN_COREFILE: c_int = 50; ++pub const KERN_COREDUMP: c_int = 51; ++pub const KERN_SUGID_COREDUMP: c_int = 52; ++pub const KERN_PROCDELAYTERM: c_int = 53; ++pub const KERN_SHREG_PRIVATIZABLE: c_int = 54; ++pub const KERN_LOW_PRI_WINDOW: c_int = 56; ++pub const KERN_LOW_PRI_DELAY: c_int = 57; ++pub const KERN_POSIX: c_int = 58; ++pub const KERN_USRSTACK64: c_int = 59; ++pub const KERN_NX_PROTECTION: c_int = 60; ++pub const KERN_TFP: c_int = 61; ++pub const KERN_PROCNAME: c_int = 62; ++pub const KERN_THALTSTACK: c_int = 63; ++pub const KERN_SPECULATIVE_READS: c_int = 64; ++pub const KERN_OSVERSION: c_int = 65; ++pub const KERN_SAFEBOOT: c_int = 66; ++pub const KERN_RAGEVNODE: c_int = 68; ++pub const KERN_TTY: c_int = 69; ++pub const KERN_CHECKOPENEVT: c_int = 70; ++pub const KERN_THREADNAME: c_int = 71; ++pub const KERN_MAXID: c_int = 72; ++pub const KERN_RAGE_PROC: c_int = 1; ++pub const KERN_RAGE_THREAD: c_int = 2; ++pub const KERN_UNRAGE_PROC: c_int = 3; ++pub const KERN_UNRAGE_THREAD: c_int = 4; ++pub const KERN_OPENEVT_PROC: c_int = 1; ++pub const KERN_UNOPENEVT_PROC: c_int = 2; ++pub const KERN_TFP_POLICY: c_int = 1; ++pub const KERN_TFP_POLICY_DENY: c_int = 0; ++pub const KERN_TFP_POLICY_DEFAULT: c_int = 2; ++pub const KERN_KDEFLAGS: c_int = 1; ++pub const KERN_KDDFLAGS: c_int = 2; ++pub const KERN_KDENABLE: c_int = 3; ++pub const KERN_KDSETBUF: c_int = 4; ++pub const KERN_KDGETBUF: c_int = 5; ++pub const KERN_KDSETUP: c_int = 6; ++pub const KERN_KDREMOVE: c_int = 7; ++pub const KERN_KDSETREG: c_int = 8; ++pub const KERN_KDGETREG: c_int = 9; ++pub const KERN_KDREADTR: c_int = 10; ++pub const KERN_KDPIDTR: c_int = 11; ++pub const KERN_KDTHRMAP: c_int = 12; ++pub const KERN_KDPIDEX: c_int = 14; ++pub const KERN_KDSETRTCDEC: c_int = 15; ++pub const KERN_KDGETENTROPY: c_int = 16; ++pub const KERN_KDWRITETR: c_int = 17; ++pub const KERN_KDWRITEMAP: c_int = 18; ++#[doc(hidden)] ++#[deprecated(since = "0.2.49", note = "Removed in MacOSX 10.12")] ++pub const KERN_KDENABLE_BG_TRACE: c_int = 19; ++#[doc(hidden)] ++#[deprecated(since = "0.2.49", note = "Removed in MacOSX 10.12")] ++pub const KERN_KDDISABLE_BG_TRACE: c_int = 20; ++pub const KERN_KDREADCURTHRMAP: c_int = 21; ++pub const KERN_KDSET_TYPEFILTER: c_int = 22; ++pub const KERN_KDBUFWAIT: c_int = 23; ++pub const KERN_KDCPUMAP: c_int = 24; ++pub const KERN_PROC_ALL: c_int = 0; ++pub const KERN_PROC_PID: c_int = 1; ++pub const KERN_PROC_PGRP: c_int = 2; ++pub const KERN_PROC_SESSION: c_int = 3; ++pub const KERN_PROC_TTY: c_int = 4; ++pub const KERN_PROC_UID: c_int = 5; ++pub const KERN_PROC_RUID: c_int = 6; ++pub const KERN_PROC_LCID: c_int = 7; ++pub const KERN_SUCCESS: c_int = 0; ++pub const KERN_INVALID_ADDRESS: c_int = 1; ++pub const KERN_PROTECTION_FAILURE: c_int = 2; ++pub const KERN_NO_SPACE: c_int = 3; ++pub const KERN_INVALID_ARGUMENT: c_int = 4; ++pub const KERN_FAILURE: c_int = 5; ++pub const KERN_RESOURCE_SHORTAGE: c_int = 6; ++pub const KERN_NOT_RECEIVER: c_int = 7; ++pub const KERN_NO_ACCESS: c_int = 8; ++pub const KERN_MEMORY_FAILURE: c_int = 9; ++pub const KERN_MEMORY_ERROR: c_int = 10; ++pub const KERN_ALREADY_IN_SET: c_int = 11; ++pub const KERN_NOT_IN_SET: c_int = 12; ++pub const KERN_NAME_EXISTS: c_int = 13; ++pub const KERN_ABORTED: c_int = 14; ++pub const KERN_INVALID_NAME: c_int = 15; ++pub const KERN_INVALID_TASK: c_int = 16; ++pub const KERN_INVALID_RIGHT: c_int = 17; ++pub const KERN_INVALID_VALUE: c_int = 18; ++pub const KERN_UREFS_OVERFLOW: c_int = 19; ++pub const KERN_INVALID_CAPABILITY: c_int = 20; ++pub const KERN_RIGHT_EXISTS: c_int = 21; ++pub const KERN_INVALID_HOST: c_int = 22; ++pub const KERN_MEMORY_PRESENT: c_int = 23; ++pub const KERN_MEMORY_DATA_MOVED: c_int = 24; ++pub const KERN_MEMORY_RESTART_COPY: c_int = 25; ++pub const KERN_INVALID_PROCESSOR_SET: c_int = 26; ++pub const KERN_POLICY_LIMIT: c_int = 27; ++pub const KERN_INVALID_POLICY: c_int = 28; ++pub const KERN_INVALID_OBJECT: c_int = 29; ++pub const KERN_ALREADY_WAITING: c_int = 30; ++pub const KERN_DEFAULT_SET: c_int = 31; ++pub const KERN_EXCEPTION_PROTECTED: c_int = 32; ++pub const KERN_INVALID_LEDGER: c_int = 33; ++pub const KERN_INVALID_MEMORY_CONTROL: c_int = 34; ++pub const KERN_INVALID_SECURITY: c_int = 35; ++pub const KERN_NOT_DEPRESSED: c_int = 36; ++pub const KERN_TERMINATED: c_int = 37; ++pub const KERN_LOCK_SET_DESTROYED: c_int = 38; ++pub const KERN_LOCK_UNSTABLE: c_int = 39; ++pub const KERN_LOCK_OWNED: c_int = 40; ++pub const KERN_LOCK_OWNED_SELF: c_int = 41; ++pub const KERN_SEMAPHORE_DESTROYED: c_int = 42; ++pub const KERN_RPC_SERVER_TERMINATED: c_int = 43; ++pub const KERN_RPC_TERMINATE_ORPHAN: c_int = 44; ++pub const KERN_RPC_CONTINUE_ORPHAN: c_int = 45; ++pub const KERN_NOT_SUPPORTED: c_int = 46; ++pub const KERN_NODE_DOWN: c_int = 47; ++pub const KERN_NOT_WAITING: c_int = 48; ++pub const KERN_OPERATION_TIMED_OUT: c_int = 49; ++pub const KERN_CODESIGN_ERROR: c_int = 50; ++pub const KERN_POLICY_STATIC: c_int = 51; ++pub const KERN_INSUFFICIENT_BUFFER_SIZE: c_int = 52; ++pub const KIPC_MAXSOCKBUF: c_int = 1; ++pub const KIPC_SOCKBUF_WASTE: c_int = 2; ++pub const KIPC_SOMAXCONN: c_int = 3; ++pub const KIPC_MAX_LINKHDR: c_int = 4; ++pub const KIPC_MAX_PROTOHDR: c_int = 5; ++pub const KIPC_MAX_HDR: c_int = 6; ++pub const KIPC_MAX_DATALEN: c_int = 7; ++pub const KIPC_MBSTAT: c_int = 8; ++pub const KIPC_NMBCLUSTERS: c_int = 9; ++pub const KIPC_SOQLIMITCOMPAT: c_int = 10; ++pub const VM_METER: c_int = 1; ++pub const VM_LOADAVG: c_int = 2; ++pub const VM_MACHFACTOR: c_int = 4; ++pub const VM_SWAPUSAGE: c_int = 5; ++pub const VM_MAXID: c_int = 6; ++pub const VM_PROT_NONE: crate::vm_prot_t = 0x00; ++pub const VM_PROT_READ: crate::vm_prot_t = 0x01; ++pub const VM_PROT_WRITE: crate::vm_prot_t = 0x02; ++pub const VM_PROT_EXECUTE: crate::vm_prot_t = 0x04; ++pub const MEMORY_OBJECT_NULL: crate::memory_object_t = 0; ++pub const HW_MACHINE: c_int = 1; ++pub const HW_MODEL: c_int = 2; ++pub const HW_NCPU: c_int = 3; ++pub const HW_BYTEORDER: c_int = 4; ++pub const HW_PHYSMEM: c_int = 5; ++pub const HW_USERMEM: c_int = 6; ++pub const HW_PAGESIZE: c_int = 7; ++pub const HW_DISKNAMES: c_int = 8; ++pub const HW_DISKSTATS: c_int = 9; ++pub const HW_EPOCH: c_int = 10; ++pub const HW_FLOATINGPT: c_int = 11; ++pub const HW_MACHINE_ARCH: c_int = 12; ++pub const HW_VECTORUNIT: c_int = 13; ++pub const HW_BUS_FREQ: c_int = 14; ++pub const HW_CPU_FREQ: c_int = 15; ++pub const HW_CACHELINE: c_int = 16; ++pub const HW_L1ICACHESIZE: c_int = 17; ++pub const HW_L1DCACHESIZE: c_int = 18; ++pub const HW_L2SETTINGS: c_int = 19; ++pub const HW_L2CACHESIZE: c_int = 20; ++pub const HW_L3SETTINGS: c_int = 21; ++pub const HW_L3CACHESIZE: c_int = 22; ++pub const HW_TB_FREQ: c_int = 23; ++pub const HW_MEMSIZE: c_int = 24; ++pub const HW_AVAILCPU: c_int = 25; ++pub const HW_TARGET: c_int = 26; ++pub const HW_PRODUCT: c_int = 27; ++pub const HW_MAXID: c_int = 28; ++pub const USER_CS_PATH: c_int = 1; ++pub const USER_BC_BASE_MAX: c_int = 2; ++pub const USER_BC_DIM_MAX: c_int = 3; ++pub const USER_BC_SCALE_MAX: c_int = 4; ++pub const USER_BC_STRING_MAX: c_int = 5; ++pub const USER_COLL_WEIGHTS_MAX: c_int = 6; ++pub const USER_EXPR_NEST_MAX: c_int = 7; ++pub const USER_LINE_MAX: c_int = 8; ++pub const USER_RE_DUP_MAX: c_int = 9; ++pub const USER_POSIX2_VERSION: c_int = 10; ++pub const USER_POSIX2_C_BIND: c_int = 11; ++pub const USER_POSIX2_C_DEV: c_int = 12; ++pub const USER_POSIX2_CHAR_TERM: c_int = 13; ++pub const USER_POSIX2_FORT_DEV: c_int = 14; ++pub const USER_POSIX2_FORT_RUN: c_int = 15; ++pub const USER_POSIX2_LOCALEDEF: c_int = 16; ++pub const USER_POSIX2_SW_DEV: c_int = 17; ++pub const USER_POSIX2_UPE: c_int = 18; ++pub const USER_STREAM_MAX: c_int = 19; ++pub const USER_TZNAME_MAX: c_int = 20; ++pub const USER_MAXID: c_int = 21; ++pub const CTL_DEBUG_NAME: c_int = 0; ++pub const CTL_DEBUG_VALUE: c_int = 1; ++pub const CTL_DEBUG_MAXID: c_int = 20; ++ ++pub const PRIO_DARWIN_THREAD: c_int = 3; ++pub const PRIO_DARWIN_PROCESS: c_int = 4; ++pub const PRIO_DARWIN_BG: c_int = 0x1000; ++pub const PRIO_DARWIN_NONUI: c_int = 0x1001; ++ ++pub const SEM_FAILED: *mut sem_t = -1isize as *mut crate::sem_t; ++ ++pub const AI_PASSIVE: c_int = 0x00000001; ++pub const AI_CANONNAME: c_int = 0x00000002; ++pub const AI_NUMERICHOST: c_int = 0x00000004; ++pub const AI_NUMERICSERV: c_int = 0x00001000; ++pub const AI_MASK: c_int = ++ AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV | AI_ADDRCONFIG; ++pub const AI_ALL: c_int = 0x00000100; ++pub const AI_V4MAPPED_CFG: c_int = 0x00000200; ++pub const AI_ADDRCONFIG: c_int = 0x00000400; ++pub const AI_V4MAPPED: c_int = 0x00000800; ++pub const AI_DEFAULT: c_int = AI_V4MAPPED_CFG | AI_ADDRCONFIG; ++pub const AI_UNUSABLE: c_int = 0x10000000; ++ ++pub const SIGEV_NONE: c_int = 0; ++pub const SIGEV_SIGNAL: c_int = 1; ++pub const SIGEV_THREAD: c_int = 3; ++ ++pub const AIO_CANCELED: c_int = 2; ++pub const AIO_NOTCANCELED: c_int = 4; ++pub const AIO_ALLDONE: c_int = 1; ++#[deprecated( ++ since = "0.2.64", ++ note = "Can vary at runtime. Use sysconf(3) instead" ++)] ++pub const AIO_LISTIO_MAX: c_int = 16; ++pub const LIO_NOP: c_int = 0; ++pub const LIO_WRITE: c_int = 2; ++pub const LIO_READ: c_int = 1; ++pub const LIO_WAIT: c_int = 2; ++pub const LIO_NOWAIT: c_int = 1; ++ ++pub const WEXITED: c_int = 0x00000004; ++pub const WSTOPPED: c_int = 0x00000008; ++pub const WCONTINUED: c_int = 0x00000010; ++pub const WNOWAIT: c_int = 0x00000020; ++ ++pub const P_ALL: idtype_t = 0; ++pub const P_PID: idtype_t = 1; ++pub const P_PGID: idtype_t = 2; ++ ++pub const UTIME_OMIT: c_long = -2; ++pub const UTIME_NOW: c_long = -1; ++ ++pub const XATTR_NOFOLLOW: c_int = 0x0001; ++pub const XATTR_CREATE: c_int = 0x0002; ++pub const XATTR_REPLACE: c_int = 0x0004; ++pub const XATTR_NOSECURITY: c_int = 0x0008; ++pub const XATTR_NODEFAULT: c_int = 0x0010; ++pub const XATTR_SHOWCOMPRESSION: c_int = 0x0020; ++ ++pub const NET_RT_IFLIST2: c_int = 0x0006; ++ ++// net/route.h ++pub const RTF_DELCLONE: c_int = 0x80; ++pub const RTF_CLONING: c_int = 0x100; ++pub const RTF_XRESOLVE: c_int = 0x200; ++pub const RTF_LLINFO: c_int = 0x400; ++pub const RTF_NOIFREF: c_int = 0x2000; ++pub const RTF_PRCLONING: c_int = 0x10000; ++pub const RTF_WASCLONED: c_int = 0x20000; ++pub const RTF_PROTO3: c_int = 0x40000; ++pub const RTF_PINNED: c_int = 0x100000; ++pub const RTF_LOCAL: c_int = 0x200000; ++pub const RTF_BROADCAST: c_int = 0x400000; ++pub const RTF_MULTICAST: c_int = 0x800000; ++pub const RTF_IFSCOPE: c_int = 0x1000000; ++pub const RTF_CONDEMNED: c_int = 0x2000000; ++pub const RTF_IFREF: c_int = 0x4000000; ++pub const RTF_PROXY: c_int = 0x8000000; ++pub const RTF_ROUTER: c_int = 0x10000000; ++pub const RTF_DEAD: c_int = 0x20000000; ++pub const RTF_GLOBAL: c_int = 0x40000000; ++ ++pub const RTM_VERSION: c_int = 5; ++ ++// Message types ++pub const RTM_LOCK: c_int = 0x8; ++pub const RTM_OLDADD: c_int = 0x9; ++pub const RTM_OLDDEL: c_int = 0xa; ++pub const RTM_RESOLVE: c_int = 0xb; ++pub const RTM_NEWADDR: c_int = 0xc; ++pub const RTM_DELADDR: c_int = 0xd; ++pub const RTM_IFINFO: c_int = 0xe; ++pub const RTM_NEWMADDR: c_int = 0xf; ++pub const RTM_DELMADDR: c_int = 0x10; ++pub const RTM_IFINFO2: c_int = 0x12; ++pub const RTM_NEWMADDR2: c_int = 0x13; ++pub const RTM_GET2: c_int = 0x14; ++ ++// Bitmask values for rtm_inits and rmx_locks. ++pub const RTV_MTU: c_int = 0x1; ++pub const RTV_HOPCOUNT: c_int = 0x2; ++pub const RTV_EXPIRE: c_int = 0x4; ++pub const RTV_RPIPE: c_int = 0x8; ++pub const RTV_SPIPE: c_int = 0x10; ++pub const RTV_SSTHRESH: c_int = 0x20; ++pub const RTV_RTT: c_int = 0x40; ++pub const RTV_RTTVAR: c_int = 0x80; ++ ++pub const RTAX_MAX: c_int = 8; ++ ++pub const KERN_PROCARGS2: c_int = 49; ++ ++pub const PROC_PIDTASKALLINFO: c_int = 2; ++pub const PROC_PIDTBSDINFO: c_int = 3; ++pub const PROC_PIDTASKINFO: c_int = 4; ++pub const PROC_PIDTHREADINFO: c_int = 5; ++pub const PROC_PIDVNODEPATHINFO: c_int = 9; ++pub const PROC_PIDPATHINFO_MAXSIZE: c_int = 4096; ++pub const PROC_CSM_ALL: c_uint = 0x0001; ++pub const PROC_CSM_NOSMT: c_uint = 0x0002; ++pub const PROC_CSM_TECS: c_uint = 0x0004; ++pub const MAXCOMLEN: usize = 16; ++pub const MAXTHREADNAMESIZE: usize = 64; ++ ++pub const XUCRED_VERSION: c_uint = 0; ++ ++pub const LC_SEGMENT: u32 = 0x1; ++pub const LC_SEGMENT_64: u32 = 0x19; ++ ++pub const MH_MAGIC: u32 = 0xfeedface; ++pub const MH_MAGIC_64: u32 = 0xfeedfacf; ++ ++// net/if_utun.h ++pub const UTUN_OPT_FLAGS: c_int = 1; ++pub const UTUN_OPT_IFNAME: c_int = 2; ++ ++// net/bpf.h ++pub const DLT_NULL: c_uint = 0; // no link-layer encapsulation ++pub const DLT_EN10MB: c_uint = 1; // Ethernet (10Mb) ++pub const DLT_EN3MB: c_uint = 2; // Experimental Ethernet (3Mb) ++pub const DLT_AX25: c_uint = 3; // Amateur Radio AX.25 ++pub const DLT_PRONET: c_uint = 4; // Proteon ProNET Token Ring ++pub const DLT_CHAOS: c_uint = 5; // Chaos ++pub const DLT_IEEE802: c_uint = 6; // IEEE 802 Networks ++pub const DLT_ARCNET: c_uint = 7; // ARCNET ++pub const DLT_SLIP: c_uint = 8; // Serial Line IP ++pub const DLT_PPP: c_uint = 9; // Point-to-point Protocol ++pub const DLT_FDDI: c_uint = 10; // FDDI ++pub const DLT_ATM_RFC1483: c_uint = 11; // LLC/SNAP encapsulated atm ++pub const DLT_RAW: c_uint = 12; // raw IP ++pub const DLT_LOOP: c_uint = 108; ++ ++// https://github.com/apple/darwin-xnu/blob/HEAD/bsd/net/bpf.h#L100 ++// sizeof(i32) ++pub const BPF_ALIGNMENT: c_int = 4; ++ ++// sys/mount.h ++pub const MNT_NODEV: c_int = 0x00000010; ++pub const MNT_UNION: c_int = 0x00000020; ++pub const MNT_CPROTECT: c_int = 0x00000080; ++ ++// MAC labeled / "quarantined" flag ++pub const MNT_QUARANTINE: c_int = 0x00000400; ++ ++// Flags set by internal operations. ++pub const MNT_LOCAL: c_int = 0x00001000; ++pub const MNT_QUOTA: c_int = 0x00002000; ++pub const MNT_ROOTFS: c_int = 0x00004000; ++pub const MNT_DOVOLFS: c_int = 0x00008000; ++ ++pub const MNT_DONTBROWSE: c_int = 0x00100000; ++pub const MNT_IGNORE_OWNERSHIP: c_int = 0x00200000; ++pub const MNT_AUTOMOUNTED: c_int = 0x00400000; ++pub const MNT_JOURNALED: c_int = 0x00800000; ++pub const MNT_NOUSERXATTR: c_int = 0x01000000; ++pub const MNT_DEFWRITE: c_int = 0x02000000; ++pub const MNT_MULTILABEL: c_int = 0x04000000; ++pub const MNT_NOATIME: c_int = 0x10000000; ++pub const MNT_SNAPSHOT: c_int = 0x40000000; ++ ++// External filesystem command modifier flags. ++pub const MNT_NOBLOCK: c_int = 0x00020000; ++ ++// sys/spawn.h: ++// DIFF(main): changed to `c_short` in f62eb023ab ++pub const POSIX_SPAWN_RESETIDS: c_int = 0x0001; ++pub const POSIX_SPAWN_SETPGROUP: c_int = 0x0002; ++pub const POSIX_SPAWN_SETSIGDEF: c_int = 0x0004; ++pub const POSIX_SPAWN_SETSIGMASK: c_int = 0x0008; ++pub const POSIX_SPAWN_SETEXEC: c_int = 0x0040; ++pub const POSIX_SPAWN_START_SUSPENDED: c_int = 0x0080; ++pub const POSIX_SPAWN_CLOEXEC_DEFAULT: c_int = 0x4000; ++ ++// sys/ipc.h: ++pub const IPC_CREAT: c_int = 0x200; ++pub const IPC_EXCL: c_int = 0x400; ++pub const IPC_NOWAIT: c_int = 0x800; ++pub const IPC_PRIVATE: key_t = 0; ++ ++pub const IPC_RMID: c_int = 0; ++pub const IPC_SET: c_int = 1; ++pub const IPC_STAT: c_int = 2; ++ ++pub const IPC_R: c_int = 0x100; ++pub const IPC_W: c_int = 0x80; ++pub const IPC_M: c_int = 0x1000; ++ ++// sys/sem.h ++pub const SEM_UNDO: c_int = 0o10000; ++ ++pub const GETNCNT: c_int = 3; ++pub const GETPID: c_int = 4; ++pub const GETVAL: c_int = 5; ++pub const GETALL: c_int = 6; ++pub const GETZCNT: c_int = 7; ++pub const SETVAL: c_int = 8; ++pub const SETALL: c_int = 9; ++ ++// sys/shm.h ++pub const SHM_RDONLY: c_int = 0x1000; ++pub const SHM_RND: c_int = 0x2000; ++#[cfg(target_arch = "aarch64")] ++pub const SHMLBA: c_int = 16 * 1024; ++#[cfg(not(target_arch = "aarch64"))] ++pub const SHMLBA: c_int = 4096; ++pub const SHM_R: c_int = IPC_R; ++pub const SHM_W: c_int = IPC_W; ++ ++// 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 UF_COMPRESSED: c_uint = 0x00000020; ++pub const UF_TRACKED: c_uint = 0x00000040; ++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; ++pub const UF_HIDDEN: c_uint = 0x00008000; ++ ++// ++pub const NTP_API: c_int = 4; ++pub const MAXPHASE: c_long = 500000000; ++pub const MAXFREQ: c_long = 500000; ++pub const MINSEC: c_int = 256; ++pub const MAXSEC: c_int = 2048; ++pub const NANOSECOND: c_long = 1000000000; ++pub const SCALE_PPM: c_int = 65; ++pub const MAXTC: c_int = 10; ++pub const MOD_OFFSET: c_uint = 0x0001; ++pub const MOD_FREQUENCY: c_uint = 0x0002; ++pub const MOD_MAXERROR: c_uint = 0x0004; ++pub const MOD_ESTERROR: c_uint = 0x0008; ++pub const MOD_STATUS: c_uint = 0x0010; ++pub const MOD_TIMECONST: c_uint = 0x0020; ++pub const MOD_PPSMAX: c_uint = 0x0040; ++pub const MOD_TAI: c_uint = 0x0080; ++pub const MOD_MICRO: c_uint = 0x1000; ++pub const MOD_NANO: c_uint = 0x2000; ++pub const MOD_CLKB: c_uint = 0x4000; ++pub const MOD_CLKA: c_uint = 0x8000; ++pub const STA_PLL: c_int = 0x0001; ++pub const STA_PPSFREQ: c_int = 0x0002; ++pub const STA_PPSTIME: c_int = 0x0004; ++pub const STA_FLL: c_int = 0x0008; ++pub const STA_INS: c_int = 0x0010; ++pub const STA_DEL: c_int = 0x0020; ++pub const STA_UNSYNC: c_int = 0x0040; ++pub const STA_FREQHOLD: c_int = 0x0080; ++pub const STA_PPSSIGNAL: c_int = 0x0100; ++pub const STA_PPSJITTER: c_int = 0x0200; ++pub const STA_PPSWANDER: c_int = 0x0400; ++pub const STA_PPSERROR: c_int = 0x0800; ++pub const STA_CLOCKERR: c_int = 0x1000; ++pub const STA_NANO: c_int = 0x2000; ++pub const STA_MODE: c_int = 0x4000; ++pub const STA_CLK: c_int = 0x8000; ++pub const STA_RONLY: c_int = STA_PPSSIGNAL ++ | STA_PPSJITTER ++ | STA_PPSWANDER ++ | STA_PPSERROR ++ | STA_CLOCKERR ++ | STA_NANO ++ | STA_MODE ++ | STA_CLK; ++pub const TIME_OK: c_int = 0; ++pub const TIME_INS: c_int = 1; ++pub const TIME_DEL: c_int = 2; ++pub const TIME_OOP: c_int = 3; ++pub const TIME_WAIT: c_int = 4; ++pub const TIME_ERROR: c_int = 5; ++ ++// ++pub const MNT_WAIT: c_int = 1; ++pub const MNT_NOWAIT: c_int = 2; ++ ++// ++pub const THREAD_STANDARD_POLICY: c_int = 1; ++pub const THREAD_STANDARD_POLICY_COUNT: c_int = 0; ++pub const THREAD_EXTENDED_POLICY: c_int = 1; ++pub const THREAD_TIME_CONSTRAINT_POLICY: c_int = 2; ++pub const THREAD_PRECEDENCE_POLICY: c_int = 3; ++pub const THREAD_AFFINITY_POLICY: c_int = 4; ++pub const THREAD_AFFINITY_TAG_NULL: c_int = 0; ++pub const THREAD_BACKGROUND_POLICY: c_int = 5; ++pub const THREAD_BACKGROUND_POLICY_DARWIN_BG: c_int = 0x1000; ++pub const THREAD_LATENCY_QOS_POLICY: c_int = 7; ++pub const THREAD_THROUGHPUT_QOS_POLICY: c_int = 8; ++ ++// ++pub const TH_STATE_RUNNING: c_int = 1; ++pub const TH_STATE_STOPPED: c_int = 2; ++pub const TH_STATE_WAITING: c_int = 3; ++pub const TH_STATE_UNINTERRUPTIBLE: c_int = 4; ++pub const TH_STATE_HALTED: c_int = 5; ++pub const TH_FLAGS_SWAPPED: c_int = 0x1; ++pub const TH_FLAGS_IDLE: c_int = 0x2; ++pub const TH_FLAGS_GLOBAL_FORCED_IDLE: c_int = 0x4; ++pub const THREAD_BASIC_INFO: c_int = 3; ++pub const THREAD_IDENTIFIER_INFO: c_int = 4; ++pub const THREAD_EXTENDED_INFO: c_int = 5; ++ ++// CommonCrypto/CommonCryptoError.h ++pub const kCCSuccess: i32 = 0; ++pub const kCCParamError: i32 = -4300; ++pub const kCCBufferTooSmall: i32 = -4301; ++pub const kCCMemoryFailure: i32 = -4302; ++pub const kCCAlignmentError: i32 = -4303; ++pub const kCCDecodeError: i32 = -4304; ++pub const kCCUnimplemented: i32 = -4305; ++pub const kCCOverflow: i32 = -4306; ++pub const kCCRNGFailure: i32 = -4307; ++pub const kCCUnspecifiedError: i32 = -4308; ++pub const kCCCallSequenceError: i32 = -4309; ++pub const kCCKeySizeError: i32 = -4310; ++pub const kCCInvalidKey: i32 = -4311; ++ ++// mach/host_info.h ++pub const HOST_LOAD_INFO: i32 = 1; ++pub const HOST_VM_INFO: i32 = 2; ++pub const HOST_CPU_LOAD_INFO: i32 = 3; ++pub const HOST_VM_INFO64: i32 = 4; ++pub const HOST_EXTMOD_INFO64: i32 = 5; ++pub const HOST_EXPIRED_TASK_INFO: i32 = 6; ++ ++// mach/vm_statistics.h ++pub const VM_PAGE_QUERY_PAGE_PRESENT: i32 = 0x1; ++pub const VM_PAGE_QUERY_PAGE_FICTITIOUS: i32 = 0x2; ++pub const VM_PAGE_QUERY_PAGE_REF: i32 = 0x4; ++pub const VM_PAGE_QUERY_PAGE_DIRTY: i32 = 0x8; ++pub const VM_PAGE_QUERY_PAGE_PAGED_OUT: i32 = 0x10; ++pub const VM_PAGE_QUERY_PAGE_COPIED: i32 = 0x20; ++pub const VM_PAGE_QUERY_PAGE_SPECULATIVE: i32 = 0x40; ++pub const VM_PAGE_QUERY_PAGE_EXTERNAL: i32 = 0x80; ++pub const VM_PAGE_QUERY_PAGE_CS_VALIDATED: i32 = 0x100; ++pub const VM_PAGE_QUERY_PAGE_CS_TAINTED: i32 = 0x200; ++pub const VM_PAGE_QUERY_PAGE_CS_NX: i32 = 0x400; ++ ++// mach/task_info.h ++pub const TASK_THREAD_TIMES_INFO: u32 = 3; ++pub const HOST_CPU_LOAD_INFO_COUNT: u32 = 4; ++pub const MACH_TASK_BASIC_INFO: u32 = 20; ++ ++pub const MACH_PORT_NULL: i32 = 0; ++ ++pub const RUSAGE_INFO_V0: c_int = 0; ++pub const RUSAGE_INFO_V1: c_int = 1; ++pub const RUSAGE_INFO_V2: c_int = 2; ++pub const RUSAGE_INFO_V3: c_int = 3; ++pub const RUSAGE_INFO_V4: c_int = 4; ++ ++// copyfile.h ++pub const COPYFILE_ACL: crate::copyfile_flags_t = 1 << 0; ++pub const COPYFILE_STAT: crate::copyfile_flags_t = 1 << 1; ++pub const COPYFILE_XATTR: crate::copyfile_flags_t = 1 << 2; ++pub const COPYFILE_DATA: crate::copyfile_flags_t = 1 << 3; ++pub const COPYFILE_SECURITY: crate::copyfile_flags_t = COPYFILE_STAT | COPYFILE_ACL; ++pub const COPYFILE_METADATA: crate::copyfile_flags_t = COPYFILE_SECURITY | COPYFILE_XATTR; ++pub const COPYFILE_RECURSIVE: crate::copyfile_flags_t = 1 << 15; ++pub const COPYFILE_CHECK: crate::copyfile_flags_t = 1 << 16; ++pub const COPYFILE_EXCL: crate::copyfile_flags_t = 1 << 17; ++pub const COPYFILE_NOFOLLOW_SRC: crate::copyfile_flags_t = 1 << 18; ++pub const COPYFILE_NOFOLLOW_DST: crate::copyfile_flags_t = 1 << 19; ++pub const COPYFILE_MOVE: crate::copyfile_flags_t = 1 << 20; ++pub const COPYFILE_UNLINK: crate::copyfile_flags_t = 1 << 21; ++pub const COPYFILE_NOFOLLOW: crate::copyfile_flags_t = ++ COPYFILE_NOFOLLOW_SRC | COPYFILE_NOFOLLOW_DST; ++pub const COPYFILE_PACK: crate::copyfile_flags_t = 1 << 22; ++pub const COPYFILE_UNPACK: crate::copyfile_flags_t = 1 << 23; ++pub const COPYFILE_CLONE: crate::copyfile_flags_t = 1 << 24; ++pub const COPYFILE_CLONE_FORCE: crate::copyfile_flags_t = 1 << 25; ++pub const COPYFILE_RUN_IN_PLACE: crate::copyfile_flags_t = 1 << 26; ++pub const COPYFILE_DATA_SPARSE: crate::copyfile_flags_t = 1 << 27; ++pub const COPYFILE_PRESERVE_DST_TRACKED: crate::copyfile_flags_t = 1 << 28; ++pub const COPYFILE_VERBOSE: crate::copyfile_flags_t = 1 << 30; ++pub const COPYFILE_RECURSE_ERROR: c_int = 0; ++pub const COPYFILE_RECURSE_FILE: c_int = 1; ++pub const COPYFILE_RECURSE_DIR: c_int = 2; ++pub const COPYFILE_RECURSE_DIR_CLEANUP: c_int = 3; ++pub const COPYFILE_COPY_DATA: c_int = 4; ++pub const COPYFILE_COPY_XATTR: c_int = 5; ++pub const COPYFILE_START: c_int = 1; ++pub const COPYFILE_FINISH: c_int = 2; ++pub const COPYFILE_ERR: c_int = 3; ++pub const COPYFILE_PROGRESS: c_int = 4; ++pub const COPYFILE_CONTINUE: c_int = 0; ++pub const COPYFILE_SKIP: c_int = 1; ++pub const COPYFILE_QUIT: c_int = 2; ++pub const COPYFILE_STATE_SRC_FD: c_int = 1; ++pub const COPYFILE_STATE_SRC_FILENAME: c_int = 2; ++pub const COPYFILE_STATE_DST_FD: c_int = 3; ++pub const COPYFILE_STATE_DST_FILENAME: c_int = 4; ++pub const COPYFILE_STATE_QUARANTINE: c_int = 5; ++pub const COPYFILE_STATE_STATUS_CB: c_int = 6; ++pub const COPYFILE_STATE_STATUS_CTX: c_int = 7; ++pub const COPYFILE_STATE_COPIED: c_int = 8; ++pub const COPYFILE_STATE_XATTRNAME: c_int = 9; ++pub const COPYFILE_STATE_WAS_CLONED: c_int = 10; ++pub const COPYFILE_STATE_SRC_BSIZE: c_int = 11; ++pub const COPYFILE_STATE_DST_BSIZE: c_int = 12; ++pub const COPYFILE_STATE_BSIZE: c_int = 13; ++ ++// ++pub const ATTR_BIT_MAP_COUNT: c_ushort = 5; ++pub const FSOPT_NOFOLLOW: u32 = 0x1; ++pub const FSOPT_NOFOLLOW_ANY: u32 = 0x800; ++pub const FSOPT_REPORT_FULLSIZE: u32 = 0x4; ++pub const FSOPT_PACK_INVAL_ATTRS: u32 = 0x8; ++pub const FSOPT_ATTR_CMN_EXTENDED: u32 = 0x20; ++pub const FSOPT_RETURN_REALDEV: u32 = 0x200; ++pub const ATTR_CMN_NAME: attrgroup_t = 0x00000001; ++pub const ATTR_CMN_DEVID: attrgroup_t = 0x00000002; ++pub const ATTR_CMN_FSID: attrgroup_t = 0x00000004; ++pub const ATTR_CMN_OBJTYPE: attrgroup_t = 0x00000008; ++pub const ATTR_CMN_OBJTAG: attrgroup_t = 0x00000010; ++pub const ATTR_CMN_OBJID: attrgroup_t = 0x00000020; ++pub const ATTR_CMN_OBJPERMANENTID: attrgroup_t = 0x00000040; ++pub const ATTR_CMN_PAROBJID: attrgroup_t = 0x00000080; ++pub const ATTR_CMN_SCRIPT: attrgroup_t = 0x00000100; ++pub const ATTR_CMN_CRTIME: attrgroup_t = 0x00000200; ++pub const ATTR_CMN_MODTIME: attrgroup_t = 0x00000400; ++pub const ATTR_CMN_CHGTIME: attrgroup_t = 0x00000800; ++pub const ATTR_CMN_ACCTIME: attrgroup_t = 0x00001000; ++pub const ATTR_CMN_BKUPTIME: attrgroup_t = 0x00002000; ++pub const ATTR_CMN_FNDRINFO: attrgroup_t = 0x00004000; ++pub const ATTR_CMN_OWNERID: attrgroup_t = 0x00008000; ++pub const ATTR_CMN_GRPID: attrgroup_t = 0x00010000; ++pub const ATTR_CMN_ACCESSMASK: attrgroup_t = 0x00020000; ++pub const ATTR_CMN_FLAGS: attrgroup_t = 0x00040000; ++pub const ATTR_CMN_GEN_COUNT: attrgroup_t = 0x00080000; ++pub const ATTR_CMN_DOCUMENT_ID: attrgroup_t = 0x00100000; ++pub const ATTR_CMN_USERACCESS: attrgroup_t = 0x00200000; ++pub const ATTR_CMN_EXTENDED_SECURITY: attrgroup_t = 0x00400000; ++pub const ATTR_CMN_UUID: attrgroup_t = 0x00800000; ++pub const ATTR_CMN_GRPUUID: attrgroup_t = 0x01000000; ++pub const ATTR_CMN_FILEID: attrgroup_t = 0x02000000; ++pub const ATTR_CMN_PARENTID: attrgroup_t = 0x04000000; ++pub const ATTR_CMN_FULLPATH: attrgroup_t = 0x08000000; ++pub const ATTR_CMN_ADDEDTIME: attrgroup_t = 0x10000000; ++pub const ATTR_CMN_DATA_PROTECT_FLAGS: attrgroup_t = 0x40000000; ++pub const ATTR_CMN_RETURNED_ATTRS: attrgroup_t = 0x80000000; ++pub const ATTR_VOL_FSTYPE: attrgroup_t = 0x00000001; ++pub const ATTR_VOL_SIGNATURE: attrgroup_t = 0x00000002; ++pub const ATTR_VOL_SIZE: attrgroup_t = 0x00000004; ++pub const ATTR_VOL_SPACEFREE: attrgroup_t = 0x00000008; ++pub const ATTR_VOL_SPACEAVAIL: attrgroup_t = 0x00000010; ++pub const ATTR_VOL_MINALLOCATION: attrgroup_t = 0x00000020; ++pub const ATTR_VOL_ALLOCATIONCLUMP: attrgroup_t = 0x00000040; ++pub const ATTR_VOL_IOBLOCKSIZE: attrgroup_t = 0x00000080; ++pub const ATTR_VOL_OBJCOUNT: attrgroup_t = 0x00000100; ++pub const ATTR_VOL_FILECOUNT: attrgroup_t = 0x00000200; ++pub const ATTR_VOL_DIRCOUNT: attrgroup_t = 0x00000400; ++pub const ATTR_VOL_MAXOBJCOUNT: attrgroup_t = 0x00000800; ++pub const ATTR_VOL_MOUNTPOINT: attrgroup_t = 0x00001000; ++pub const ATTR_VOL_NAME: attrgroup_t = 0x00002000; ++pub const ATTR_VOL_MOUNTFLAGS: attrgroup_t = 0x00004000; ++pub const ATTR_VOL_MOUNTEDDEVICE: attrgroup_t = 0x00008000; ++pub const ATTR_VOL_ENCODINGSUSED: attrgroup_t = 0x00010000; ++pub const ATTR_VOL_CAPABILITIES: attrgroup_t = 0x00020000; ++pub const ATTR_VOL_UUID: attrgroup_t = 0x00040000; ++pub const ATTR_VOL_SPACEUSED: attrgroup_t = 0x00800000; ++pub const ATTR_VOL_QUOTA_SIZE: attrgroup_t = 0x10000000; ++pub const ATTR_VOL_RESERVED_SIZE: attrgroup_t = 0x20000000; ++pub const ATTR_VOL_ATTRIBUTES: attrgroup_t = 0x40000000; ++pub const ATTR_VOL_INFO: attrgroup_t = 0x80000000; ++pub const ATTR_DIR_LINKCOUNT: attrgroup_t = 0x00000001; ++pub const ATTR_DIR_ENTRYCOUNT: attrgroup_t = 0x00000002; ++pub const ATTR_DIR_MOUNTSTATUS: attrgroup_t = 0x00000004; ++pub const ATTR_DIR_ALLOCSIZE: attrgroup_t = 0x00000008; ++pub const ATTR_DIR_IOBLOCKSIZE: attrgroup_t = 0x00000010; ++pub const ATTR_DIR_DATALENGTH: attrgroup_t = 0x00000020; ++pub const ATTR_FILE_LINKCOUNT: attrgroup_t = 0x00000001; ++pub const ATTR_FILE_TOTALSIZE: attrgroup_t = 0x00000002; ++pub const ATTR_FILE_ALLOCSIZE: attrgroup_t = 0x00000004; ++pub const ATTR_FILE_IOBLOCKSIZE: attrgroup_t = 0x00000008; ++pub const ATTR_FILE_DEVTYPE: attrgroup_t = 0x00000020; ++pub const ATTR_FILE_FORKCOUNT: attrgroup_t = 0x00000080; ++pub const ATTR_FILE_FORKLIST: attrgroup_t = 0x00000100; ++pub const ATTR_FILE_DATALENGTH: attrgroup_t = 0x00000200; ++pub const ATTR_FILE_DATAALLOCSIZE: attrgroup_t = 0x00000400; ++pub const ATTR_FILE_RSRCLENGTH: attrgroup_t = 0x00001000; ++pub const ATTR_FILE_RSRCALLOCSIZE: attrgroup_t = 0x00002000; ++pub const ATTR_CMNEXT_RELPATH: attrgroup_t = 0x00000004; ++pub const ATTR_CMNEXT_PRIVATESIZE: attrgroup_t = 0x00000008; ++pub const ATTR_CMNEXT_LINKID: attrgroup_t = 0x00000010; ++pub const ATTR_CMNEXT_NOFIRMLINKPATH: attrgroup_t = 0x00000020; ++pub const ATTR_CMNEXT_REALDEVID: attrgroup_t = 0x00000040; ++pub const ATTR_CMNEXT_REALFSID: attrgroup_t = 0x00000080; ++pub const ATTR_CMNEXT_CLONEID: attrgroup_t = 0x00000100; ++pub const ATTR_CMNEXT_EXT_FLAGS: attrgroup_t = 0x00000200; ++pub const ATTR_CMNEXT_RECURSIVE_GENCOUNT: attrgroup_t = 0x00000400; ++pub const DIR_MNTSTATUS_MNTPOINT: u32 = 0x1; ++pub const VOL_CAPABILITIES_FORMAT: usize = 0; ++pub const VOL_CAPABILITIES_INTERFACES: usize = 1; ++pub const VOL_CAP_FMT_PERSISTENTOBJECTIDS: attrgroup_t = 0x00000001; ++pub const VOL_CAP_FMT_SYMBOLICLINKS: attrgroup_t = 0x00000002; ++pub const VOL_CAP_FMT_HARDLINKS: attrgroup_t = 0x00000004; ++pub const VOL_CAP_FMT_JOURNAL: attrgroup_t = 0x00000008; ++pub const VOL_CAP_FMT_JOURNAL_ACTIVE: attrgroup_t = 0x00000010; ++pub const VOL_CAP_FMT_NO_ROOT_TIMES: attrgroup_t = 0x00000020; ++pub const VOL_CAP_FMT_SPARSE_FILES: attrgroup_t = 0x00000040; ++pub const VOL_CAP_FMT_ZERO_RUNS: attrgroup_t = 0x00000080; ++pub const VOL_CAP_FMT_CASE_SENSITIVE: attrgroup_t = 0x00000100; ++pub const VOL_CAP_FMT_CASE_PRESERVING: attrgroup_t = 0x00000200; ++pub const VOL_CAP_FMT_FAST_STATFS: attrgroup_t = 0x00000400; ++pub const VOL_CAP_FMT_2TB_FILESIZE: attrgroup_t = 0x00000800; ++pub const VOL_CAP_FMT_OPENDENYMODES: attrgroup_t = 0x00001000; ++pub const VOL_CAP_FMT_HIDDEN_FILES: attrgroup_t = 0x00002000; ++pub const VOL_CAP_FMT_PATH_FROM_ID: attrgroup_t = 0x00004000; ++pub const VOL_CAP_FMT_NO_VOLUME_SIZES: attrgroup_t = 0x00008000; ++pub const VOL_CAP_FMT_DECMPFS_COMPRESSION: attrgroup_t = 0x00010000; ++pub const VOL_CAP_FMT_64BIT_OBJECT_IDS: attrgroup_t = 0x00020000; ++pub const VOL_CAP_FMT_DIR_HARDLINKS: attrgroup_t = 0x00040000; ++pub const VOL_CAP_FMT_DOCUMENT_ID: attrgroup_t = 0x00080000; ++pub const VOL_CAP_FMT_WRITE_GENERATION_COUNT: attrgroup_t = 0x00100000; ++pub const VOL_CAP_FMT_NO_IMMUTABLE_FILES: attrgroup_t = 0x00200000; ++pub const VOL_CAP_FMT_NO_PERMISSIONS: attrgroup_t = 0x00400000; ++pub const VOL_CAP_FMT_SHARED_SPACE: attrgroup_t = 0x00800000; ++pub const VOL_CAP_FMT_VOL_GROUPS: attrgroup_t = 0x01000000; ++pub const VOL_CAP_FMT_SEALED: attrgroup_t = 0x02000000; ++pub const VOL_CAP_INT_SEARCHFS: attrgroup_t = 0x00000001; ++pub const VOL_CAP_INT_ATTRLIST: attrgroup_t = 0x00000002; ++pub const VOL_CAP_INT_NFSEXPORT: attrgroup_t = 0x00000004; ++pub const VOL_CAP_INT_READDIRATTR: attrgroup_t = 0x00000008; ++pub const VOL_CAP_INT_EXCHANGEDATA: attrgroup_t = 0x00000010; ++pub const VOL_CAP_INT_COPYFILE: attrgroup_t = 0x00000020; ++pub const VOL_CAP_INT_ALLOCATE: attrgroup_t = 0x00000040; ++pub const VOL_CAP_INT_VOL_RENAME: attrgroup_t = 0x00000080; ++pub const VOL_CAP_INT_ADVLOCK: attrgroup_t = 0x00000100; ++pub const VOL_CAP_INT_FLOCK: attrgroup_t = 0x00000200; ++pub const VOL_CAP_INT_EXTENDED_SECURITY: attrgroup_t = 0x00000400; ++pub const VOL_CAP_INT_USERACCESS: attrgroup_t = 0x00000800; ++pub const VOL_CAP_INT_MANLOCK: attrgroup_t = 0x00001000; ++pub const VOL_CAP_INT_NAMEDSTREAMS: attrgroup_t = 0x00002000; ++pub const VOL_CAP_INT_EXTENDED_ATTR: attrgroup_t = 0x00004000; ++pub const VOL_CAP_INT_CLONE: attrgroup_t = 0x00010000; ++pub const VOL_CAP_INT_SNAPSHOT: attrgroup_t = 0x00020000; ++pub const VOL_CAP_INT_RENAME_SWAP: attrgroup_t = 0x00040000; ++pub const VOL_CAP_INT_RENAME_EXCL: attrgroup_t = 0x00080000; ++pub const VOL_CAP_INT_RENAME_OPENFAIL: attrgroup_t = 0x00100000; ++ ++// os/clock.h ++pub const OS_CLOCK_MACH_ABSOLUTE_TIME: os_clockid_t = 32; ++ ++// os/os_sync_wait_on_address.h ++pub const OS_SYNC_WAIT_ON_ADDRESS_NONE: os_sync_wait_on_address_flags_t = 0x00000000; ++pub const OS_SYNC_WAIT_ON_ADDRESS_SHARED: os_sync_wait_on_address_flags_t = 0x00000001; ++pub const OS_SYNC_WAKE_BY_ADDRESS_NONE: os_sync_wake_by_address_flags_t = 0x00000000; ++pub const OS_SYNC_WAKE_BY_ADDRESS_SHARED: os_sync_wake_by_address_flags_t = 0x00000001; ++ ++// ++/// Process being created by fork. ++pub const SIDL: u32 = 1; ++/// Currently runnable. ++pub const SRUN: u32 = 2; ++/// Sleeping on an address. ++pub const SSLEEP: u32 = 3; ++/// Process debugging or suspension. ++pub const SSTOP: u32 = 4; ++/// Awaiting collection by parent. ++pub const SZOMB: u32 = 5; ++ ++// sys/vsock.h ++pub const VMADDR_CID_ANY: c_uint = 0xFFFFFFFF; ++pub const VMADDR_CID_HYPERVISOR: c_uint = 0; ++pub const VMADDR_CID_RESERVED: c_uint = 1; ++pub const VMADDR_CID_HOST: c_uint = 2; ++pub const VMADDR_PORT_ANY: c_uint = 0xFFFFFFFF; ++ ++const fn __DARWIN_ALIGN32(p: usize) -> usize { ++ const __DARWIN_ALIGNBYTES32: usize = mem::size_of::() - 1; ++ p + __DARWIN_ALIGNBYTES32 & !__DARWIN_ALIGNBYTES32 ++} ++ ++pub const THREAD_EXTENDED_POLICY_COUNT: mach_msg_type_number_t = ++ (mem::size_of::() / mem::size_of::()) ++ as mach_msg_type_number_t; ++pub const THREAD_TIME_CONSTRAINT_POLICY_COUNT: mach_msg_type_number_t = ++ (mem::size_of::() / mem::size_of::()) ++ as mach_msg_type_number_t; ++pub const THREAD_PRECEDENCE_POLICY_COUNT: mach_msg_type_number_t = ++ (mem::size_of::() / mem::size_of::()) ++ as mach_msg_type_number_t; ++pub const THREAD_AFFINITY_POLICY_COUNT: mach_msg_type_number_t = ++ (mem::size_of::() / mem::size_of::()) ++ as mach_msg_type_number_t; ++pub const THREAD_BACKGROUND_POLICY_COUNT: mach_msg_type_number_t = ++ (mem::size_of::() / mem::size_of::()) ++ as mach_msg_type_number_t; ++pub const THREAD_LATENCY_QOS_POLICY_COUNT: mach_msg_type_number_t = ++ (mem::size_of::() / mem::size_of::()) ++ as mach_msg_type_number_t; ++pub const THREAD_THROUGHPUT_QOS_POLICY_COUNT: mach_msg_type_number_t = ++ (mem::size_of::() / mem::size_of::()) ++ as mach_msg_type_number_t; ++pub const THREAD_BASIC_INFO_COUNT: mach_msg_type_number_t = ++ (mem::size_of::() / mem::size_of::()) ++ as mach_msg_type_number_t; ++pub const THREAD_IDENTIFIER_INFO_COUNT: mach_msg_type_number_t = ++ (mem::size_of::() / mem::size_of::()) ++ as mach_msg_type_number_t; ++pub const THREAD_EXTENDED_INFO_COUNT: mach_msg_type_number_t = ++ (mem::size_of::() / mem::size_of::()) ++ as mach_msg_type_number_t; ++ ++pub const TASK_THREAD_TIMES_INFO_COUNT: u32 = ++ (mem::size_of::() / mem::size_of::()) as u32; ++pub const MACH_TASK_BASIC_INFO_COUNT: u32 = ++ (mem::size_of::() / mem::size_of::()) as u32; ++pub const HOST_VM_INFO64_COUNT: mach_msg_type_number_t = (mem::size_of::() ++ / mem::size_of::()) ++ as mach_msg_type_number_t; ++ ++// bsd/net/if_mib.h ++/// Non-interface-specific ++pub const IFMIB_SYSTEM: c_int = 1; ++/// Per-interface data table ++pub const IFMIB_IFDATA: c_int = 2; ++/// All interfaces data at once ++pub const IFMIB_IFALLDATA: c_int = 3; ++ ++/// Generic stats for all kinds of ifaces ++pub const IFDATA_GENERAL: c_int = 1; ++/// Specific to the type of interface ++pub const IFDATA_LINKSPECIFIC: c_int = 2; ++/// Addresses assigned to interface ++pub const IFDATA_ADDRS: c_int = 3; ++/// Multicast addresses assigned to interface ++pub const IFDATA_MULTIADDRS: c_int = 4; ++ ++/// Number of interfaces configured ++pub const IFMIB_IFCOUNT: c_int = 1; ++ ++/// Functions not specific to a type of iface ++pub const NETLINK_GENERIC: c_int = 0; ++ ++pub const DOT3COMPLIANCE_STATS: c_int = 1; ++pub const DOT3COMPLIANCE_COLLS: c_int = 2; ++ ++// kern_control.h ++pub const MAX_KCTL_NAME: usize = 96; ++ ++f! { ++ pub fn CMSG_NXTHDR(mhdr: *const crate::msghdr, cmsg: *const cmsghdr) -> *mut cmsghdr { ++ if cmsg.is_null() { ++ return crate::CMSG_FIRSTHDR(mhdr); ++ }; ++ let cmsg_len = (*cmsg).cmsg_len as usize; ++ let next = cmsg as usize + __DARWIN_ALIGN32(cmsg_len); ++ let max = (*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize; ++ if next + __DARWIN_ALIGN32(mem::size_of::()) > max { ++ core::ptr::null_mut() ++ } else { ++ next as *mut cmsghdr ++ } ++ } ++ ++ pub fn CMSG_DATA(cmsg: *const cmsghdr) -> *mut c_uchar { ++ (cmsg as *mut c_uchar).add(__DARWIN_ALIGN32(mem::size_of::())) ++ } ++ ++ pub {const} fn CMSG_SPACE(length: c_uint) -> c_uint { ++ (__DARWIN_ALIGN32(mem::size_of::()) + __DARWIN_ALIGN32(length as usize)) as c_uint ++ } ++ ++ pub {const} fn CMSG_LEN(length: c_uint) -> c_uint { ++ (__DARWIN_ALIGN32(mem::size_of::()) + length as usize) as c_uint ++ } ++ ++ pub {const} fn VM_MAKE_TAG(id: u8) -> u32 { ++ (id as u32) << 24u32 ++ } ++ ++ pub fn major(dev: dev_t) -> i32 { ++ (dev >> 24) & 0xff ++ } ++ ++ pub fn minor(dev: dev_t) -> i32 { ++ dev & 0xffffff ++ } ++ ++ pub fn makedev(major: i32, minor: i32) -> dev_t { ++ (major << 24) | minor ++ } ++} ++ ++safe_f! { ++ pub {const} fn WSTOPSIG(status: c_int) -> c_int { ++ status >> 8 ++ } ++ ++ pub {const} fn _WSTATUS(status: c_int) -> c_int { ++ status & 0x7f ++ } ++ ++ pub {const} fn WIFCONTINUED(status: c_int) -> bool { ++ _WSTATUS(status) == _WSTOPPED && WSTOPSIG(status) == 0x13 ++ } ++ ++ pub {const} fn WIFSIGNALED(status: c_int) -> bool { ++ _WSTATUS(status) != _WSTOPPED && _WSTATUS(status) != 0 ++ } ++ ++ pub {const} fn WIFSTOPPED(status: c_int) -> bool { ++ _WSTATUS(status) == _WSTOPPED && WSTOPSIG(status) != 0x13 ++ } ++} ++ ++extern "C" { ++ pub fn setgrent(); ++ #[doc(hidden)] ++ #[deprecated(since = "0.2.49", note = "Deprecated in MacOSX 10.5")] ++ #[cfg_attr(not(target_arch = "aarch64"), link_name = "daemon$1050")] ++ pub fn daemon(nochdir: c_int, noclose: c_int) -> c_int; ++ #[doc(hidden)] ++ #[deprecated(since = "0.2.49", note = "Deprecated in MacOSX 10.10")] ++ pub fn sem_destroy(sem: *mut sem_t) -> c_int; ++ #[doc(hidden)] ++ #[deprecated(since = "0.2.49", note = "Deprecated in MacOSX 10.10")] ++ pub fn sem_init(sem: *mut sem_t, pshared: c_int, value: c_uint) -> c_int; ++ pub fn aio_read(aiocbp: *mut aiocb) -> c_int; ++ pub fn aio_write(aiocbp: *mut aiocb) -> c_int; ++ pub fn aio_fsync(op: c_int, aiocbp: *mut aiocb) -> c_int; ++ pub fn aio_error(aiocbp: *const aiocb) -> c_int; ++ pub fn aio_return(aiocbp: *mut aiocb) -> ssize_t; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "aio_suspend$UNIX2003" ++ )] ++ pub fn aio_suspend( ++ aiocb_list: *const *const aiocb, ++ nitems: c_int, ++ timeout: *const crate::timespec, ++ ) -> c_int; ++ pub fn aio_cancel(fd: c_int, aiocbp: *mut aiocb) -> c_int; ++ pub fn chflags(path: *const c_char, flags: c_uint) -> c_int; ++ pub fn fchflags(fd: c_int, flags: c_uint) -> c_int; ++ pub fn clock_getres(clk_id: crate::clockid_t, tp: *mut crate::timespec) -> c_int; ++ pub fn clock_gettime(clk_id: crate::clockid_t, tp: *mut crate::timespec) -> c_int; ++ pub fn lio_listio( ++ mode: c_int, ++ aiocb_list: *const *mut aiocb, ++ nitems: c_int, ++ sevp: *mut sigevent, ++ ) -> c_int; ++ ++ pub fn dirfd(dirp: *mut crate::DIR) -> c_int; ++ ++ pub fn lutimes(file: *const c_char, times: *const crate::timeval) -> c_int; ++ ++ pub fn gettimeofday(tp: *mut crate::timeval, tz: *mut c_void) -> c_int; ++ pub fn getutxent() -> *mut utmpx; ++ pub fn getutxid(ut: *const utmpx) -> *mut utmpx; ++ pub fn getutxline(ut: *const utmpx) -> *mut utmpx; ++ pub fn pututxline(ut: *const utmpx) -> *mut utmpx; ++ pub fn setutxent(); ++ pub fn endutxent(); ++ pub fn utmpxname(file: *const c_char) -> c_int; ++ ++ pub fn asctime(tm: *const crate::tm) -> *mut c_char; ++ pub fn ctime(clock: *const time_t) -> *mut c_char; ++ pub fn getdate(datestr: *const c_char) -> *mut crate::tm; ++ pub fn strptime( ++ buf: *const c_char, ++ format: *const c_char, ++ timeptr: *mut crate::tm, ++ ) -> *mut c_char; ++ pub fn asctime_r(tm: *const crate::tm, result: *mut c_char) -> *mut c_char; ++ pub fn ctime_r(clock: *const time_t, result: *mut c_char) -> *mut c_char; ++ ++ pub fn getnameinfo( ++ sa: *const crate::sockaddr, ++ salen: crate::socklen_t, ++ host: *mut c_char, ++ hostlen: crate::socklen_t, ++ serv: *mut c_char, ++ servlen: crate::socklen_t, ++ flags: c_int, ++ ) -> c_int; ++ pub fn mincore(addr: *const c_void, len: size_t, vec: *mut c_char) -> c_int; ++ pub fn sysctlnametomib(name: *const c_char, mibp: *mut c_int, sizep: *mut size_t) -> c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "mprotect$UNIX2003" ++ )] ++ pub fn mprotect(addr: *mut c_void, len: size_t, prot: c_int) -> c_int; ++ pub fn semget(key: key_t, nsems: c_int, semflg: c_int) -> c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "semctl$UNIX2003" ++ )] ++ pub fn semctl(semid: c_int, semnum: c_int, cmd: c_int, ...) -> c_int; ++ pub fn semop(semid: c_int, sops: *mut sembuf, nsops: size_t) -> c_int; ++ pub fn shm_open(name: *const c_char, oflag: c_int, ...) -> c_int; ++ pub fn ftok(pathname: *const c_char, proj_id: c_int) -> key_t; ++ pub fn shmat(shmid: c_int, shmaddr: *const c_void, shmflg: c_int) -> *mut c_void; ++ pub fn shmdt(shmaddr: *const c_void) -> c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "shmctl$UNIX2003" ++ )] ++ pub fn shmctl(shmid: c_int, cmd: c_int, buf: *mut crate::shmid_ds) -> c_int; ++ pub fn shmget(key: key_t, size: size_t, shmflg: c_int) -> c_int; ++ pub fn sysctl( ++ name: *mut c_int, ++ namelen: c_uint, ++ oldp: *mut c_void, ++ oldlenp: *mut size_t, ++ newp: *mut c_void, ++ newlen: size_t, ++ ) -> c_int; ++ pub fn sysctlbyname( ++ name: *const c_char, ++ oldp: *mut c_void, ++ oldlenp: *mut size_t, ++ newp: *mut c_void, ++ newlen: size_t, ++ ) -> c_int; ++ #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")] ++ pub fn mach_absolute_time() -> u64; ++ #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")] ++ #[allow(deprecated)] ++ pub fn mach_timebase_info(info: *mut crate::mach_timebase_info) -> c_int; ++ #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")] ++ pub fn mach_host_self() -> mach_port_t; ++ #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")] ++ pub fn mach_thread_self() -> mach_port_t; ++ pub fn pthread_once( ++ once_control: *mut crate::pthread_once_t, ++ init_routine: Option, ++ ) -> c_int; ++ pub fn pthread_attr_getinheritsched( ++ attr: *const crate::pthread_attr_t, ++ inheritsched: *mut c_int, ++ ) -> c_int; ++ pub fn pthread_attr_getschedpolicy( ++ attr: *const crate::pthread_attr_t, ++ policy: *mut c_int, ++ ) -> c_int; ++ pub fn pthread_attr_getscope( ++ attr: *const crate::pthread_attr_t, ++ contentionscope: *mut c_int, ++ ) -> c_int; ++ pub fn pthread_attr_getstackaddr( ++ attr: *const crate::pthread_attr_t, ++ stackaddr: *mut *mut c_void, ++ ) -> c_int; ++ pub fn pthread_attr_getdetachstate( ++ attr: *const crate::pthread_attr_t, ++ detachstate: *mut c_int, ++ ) -> c_int; ++ pub fn pthread_attr_setinheritsched( ++ attr: *mut crate::pthread_attr_t, ++ inheritsched: c_int, ++ ) -> c_int; ++ pub fn pthread_attr_setschedpolicy(attr: *mut crate::pthread_attr_t, policy: c_int) -> c_int; ++ pub fn pthread_attr_setscope(attr: *mut crate::pthread_attr_t, contentionscope: c_int) ++ -> c_int; ++ pub fn pthread_attr_setstackaddr( ++ attr: *mut crate::pthread_attr_t, ++ stackaddr: *mut c_void, ++ ) -> c_int; ++ pub fn pthread_setname_np(name: *const c_char) -> c_int; ++ pub fn pthread_getname_np(thread: crate::pthread_t, name: *mut c_char, len: size_t) -> c_int; ++ pub fn pthread_mach_thread_np(thread: crate::pthread_t) -> crate::mach_port_t; ++ pub fn pthread_from_mach_thread_np(port: crate::mach_port_t) -> crate::pthread_t; ++ pub fn pthread_create_from_mach_thread( ++ thread: *mut crate::pthread_t, ++ attr: *const crate::pthread_attr_t, ++ f: extern "C" fn(*mut c_void) -> *mut c_void, ++ value: *mut c_void, ++ ) -> c_int; ++ pub fn pthread_stack_frame_decode_np( ++ frame_addr: crate::uintptr_t, ++ return_addr: *mut crate::uintptr_t, ++ ) -> crate::uintptr_t; ++ pub fn pthread_get_stackaddr_np(thread: crate::pthread_t) -> *mut c_void; ++ pub fn pthread_get_stacksize_np(thread: crate::pthread_t) -> size_t; ++ pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t, pshared: c_int) -> c_int; ++ pub fn pthread_condattr_getpshared( ++ attr: *const pthread_condattr_t, ++ pshared: *mut c_int, ++ ) -> c_int; ++ pub fn pthread_main_np() -> c_int; ++ pub fn pthread_mutexattr_setpshared(attr: *mut pthread_mutexattr_t, pshared: c_int) -> c_int; ++ pub fn pthread_mutexattr_getpshared( ++ attr: *const pthread_mutexattr_t, ++ pshared: *mut c_int, ++ ) -> c_int; ++ pub fn pthread_rwlockattr_getpshared( ++ attr: *const pthread_rwlockattr_t, ++ val: *mut c_int, ++ ) -> c_int; ++ pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, val: c_int) -> c_int; ++ pub fn pthread_threadid_np(thread: crate::pthread_t, thread_id: *mut u64) -> c_int; ++ pub fn pthread_attr_set_qos_class_np( ++ attr: *mut pthread_attr_t, ++ class: qos_class_t, ++ priority: c_int, ++ ) -> c_int; ++ pub fn pthread_attr_get_qos_class_np( ++ attr: *mut pthread_attr_t, ++ class: *mut qos_class_t, ++ priority: *mut c_int, ++ ) -> c_int; ++ pub fn pthread_set_qos_class_self_np(class: qos_class_t, priority: c_int) -> c_int; ++ pub fn pthread_get_qos_class_np( ++ thread: crate::pthread_t, ++ class: *mut qos_class_t, ++ priority: *mut c_int, ++ ) -> c_int; ++ pub fn pthread_attr_getschedparam( ++ attr: *const crate::pthread_attr_t, ++ param: *mut sched_param, ++ ) -> c_int; ++ pub fn pthread_attr_setschedparam( ++ attr: *mut crate::pthread_attr_t, ++ param: *const sched_param, ++ ) -> c_int; ++ pub fn pthread_getschedparam( ++ thread: crate::pthread_t, ++ policy: *mut c_int, ++ param: *mut sched_param, ++ ) -> c_int; ++ pub fn pthread_setschedparam( ++ thread: crate::pthread_t, ++ policy: c_int, ++ param: *const sched_param, ++ ) -> c_int; ++ ++ // Available from Big Sur ++ pub fn pthread_introspection_hook_install( ++ hook: crate::pthread_introspection_hook_t, ++ ) -> crate::pthread_introspection_hook_t; ++ pub fn pthread_introspection_setspecific_np( ++ thread: crate::pthread_t, ++ key: crate::pthread_key_t, ++ value: *const c_void, ++ ) -> c_int; ++ pub fn pthread_introspection_getspecific_np( ++ thread: crate::pthread_t, ++ key: crate::pthread_key_t, ++ ) -> *mut c_void; ++ pub fn pthread_jit_write_protect_np(enabled: c_int); ++ pub fn pthread_jit_write_protect_supported_np() -> c_int; ++ // An array of pthread_jit_write_with_callback_np must declare ++ // the list of callbacks e.g. ++ // #[link_section = "__DATA_CONST,__pth_jit_func"] ++ // static callbacks: [libc::pthread_jit_write_callback_t; 2] = [native_jit_write_cb, ++ // std::mem::transmute::(std::ptr::null())]; ++ // (a handy PTHREAD_JIT_WRITE_CALLBACK_NP macro for other languages). ++ pub fn pthread_jit_write_with_callback_np( ++ callback: crate::pthread_jit_write_callback_t, ++ ctx: *mut c_void, ++ ) -> c_int; ++ pub fn pthread_jit_write_freeze_callbacks_np(); ++ pub fn pthread_cpu_number_np(cpu_number_out: *mut size_t) -> c_int; ++ ++ // Available starting with macOS 14.4. ++ pub fn os_sync_wait_on_address( ++ addr: *mut c_void, ++ value: u64, ++ size: size_t, ++ flags: os_sync_wait_on_address_flags_t, ++ ) -> c_int; ++ pub fn os_sync_wait_on_address_with_deadline( ++ addr: *mut c_void, ++ value: u64, ++ size: size_t, ++ flags: os_sync_wait_on_address_flags_t, ++ clockid: os_clockid_t, ++ deadline: u64, ++ ) -> c_int; ++ pub fn os_sync_wait_on_address_with_timeout( ++ addr: *mut c_void, ++ value: u64, ++ size: size_t, ++ flags: os_sync_wait_on_address_flags_t, ++ clockid: os_clockid_t, ++ timeout_ns: u64, ++ ) -> c_int; ++ pub fn os_sync_wake_by_address_any( ++ addr: *mut c_void, ++ size: size_t, ++ flags: os_sync_wake_by_address_flags_t, ++ ) -> c_int; ++ pub fn os_sync_wake_by_address_all( ++ addr: *mut c_void, ++ size: size_t, ++ flags: os_sync_wake_by_address_flags_t, ++ ) -> c_int; ++ ++ pub fn os_unfair_lock_lock(lock: os_unfair_lock_t); ++ pub fn os_unfair_lock_trylock(lock: os_unfair_lock_t) -> bool; ++ pub fn os_unfair_lock_unlock(lock: os_unfair_lock_t); ++ pub fn os_unfair_lock_assert_owner(lock: os_unfair_lock_t); ++ pub fn os_unfair_lock_assert_not_owner(lock: os_unfair_lock_t); ++ ++ pub fn os_log_create(subsystem: *const c_char, category: *const c_char) -> crate::os_log_t; ++ pub fn os_log_type_enabled(oslog: crate::os_log_t, tpe: crate::os_log_type_t) -> bool; ++ pub fn os_signpost_id_make_with_pointer( ++ log: crate::os_log_t, ++ ptr: *const c_void, ++ ) -> crate::os_signpost_id_t; ++ pub fn os_signpost_id_generate(log: crate::os_log_t) -> crate::os_signpost_id_t; ++ pub fn os_signpost_enabled(log: crate::os_log_t) -> bool; ++ ++ pub fn thread_policy_set( ++ thread: thread_t, ++ flavor: thread_policy_flavor_t, ++ policy_info: thread_policy_t, ++ count: mach_msg_type_number_t, ++ ) -> kern_return_t; ++ pub fn thread_policy_get( ++ thread: thread_t, ++ flavor: thread_policy_flavor_t, ++ policy_info: thread_policy_t, ++ count: *mut mach_msg_type_number_t, ++ get_default: *mut boolean_t, ++ ) -> kern_return_t; ++ pub fn thread_info( ++ target_act: thread_inspect_t, ++ flavor: thread_flavor_t, ++ 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; ++ pub fn backtrace_symbols_fd(addrs: *const *mut c_void, sz: c_int, fd: c_int); ++ pub fn backtrace_from_fp(startfp: *mut c_void, array: *mut *mut c_void, size: c_int) -> c_int; ++ pub fn backtrace_image_offsets( ++ array: *const *mut c_void, ++ image_offsets: *mut image_offset, ++ size: c_int, ++ ); ++ pub fn backtrace_async(array: *mut *mut c_void, length: size_t, task_id: *mut u32) -> size_t; ++ #[cfg_attr( ++ all(target_os = "macos", not(target_arch = "aarch64")), ++ link_name = "statfs$INODE64" ++ )] ++ pub fn statfs(path: *const c_char, buf: *mut statfs) -> c_int; ++ #[cfg_attr( ++ all(target_os = "macos", not(target_arch = "aarch64")), ++ link_name = "fstatfs$INODE64" ++ )] ++ pub fn fstatfs(fd: c_int, buf: *mut statfs) -> c_int; ++ pub fn kevent( ++ kq: c_int, ++ changelist: *const crate::kevent, ++ nchanges: c_int, ++ eventlist: *mut crate::kevent, ++ nevents: c_int, ++ timeout: *const crate::timespec, ++ ) -> c_int; ++ pub fn kevent64( ++ kq: c_int, ++ changelist: *const crate::kevent64_s, ++ nchanges: c_int, ++ eventlist: *mut crate::kevent64_s, ++ nevents: c_int, ++ flags: c_uint, ++ timeout: *const crate::timespec, ++ ) -> c_int; ++ pub fn mount( ++ src: *const c_char, ++ target: *const c_char, ++ flags: c_int, ++ data: *mut c_void, ++ ) -> c_int; ++ pub fn fmount(src: *const c_char, fd: c_int, flags: c_int, data: *mut c_void) -> c_int; ++ pub fn ptrace(request: c_int, pid: crate::pid_t, addr: *mut c_char, data: c_int) -> c_int; ++ pub fn quotactl(special: *const c_char, cmd: c_int, id: c_int, data: *mut c_char) -> c_int; ++ pub fn sethostname(name: *const c_char, len: c_int) -> c_int; ++ pub fn sendfile( ++ fd: c_int, ++ s: c_int, ++ offset: off_t, ++ len: *mut off_t, ++ hdtr: *mut crate::sf_hdtr, ++ flags: c_int, ++ ) -> c_int; ++ pub fn futimens(fd: c_int, times: *const crate::timespec) -> c_int; ++ pub fn utimensat( ++ dirfd: c_int, ++ path: *const c_char, ++ times: *const crate::timespec, ++ flag: c_int, ++ ) -> c_int; ++ pub fn openpty( ++ amaster: *mut c_int, ++ aslave: *mut c_int, ++ name: *mut c_char, ++ termp: *mut termios, ++ winp: *mut crate::winsize, ++ ) -> c_int; ++ pub fn forkpty( ++ amaster: *mut c_int, ++ name: *mut c_char, ++ termp: *mut termios, ++ winp: *mut crate::winsize, ++ ) -> crate::pid_t; ++ pub fn login_tty(fd: c_int) -> c_int; ++ pub fn duplocale(base: crate::locale_t) -> crate::locale_t; ++ pub fn freelocale(loc: crate::locale_t) -> c_int; ++ pub fn localeconv_l(loc: crate::locale_t) -> *mut lconv; ++ pub fn newlocale(mask: c_int, locale: *const c_char, base: crate::locale_t) -> crate::locale_t; ++ pub fn uselocale(loc: crate::locale_t) -> crate::locale_t; ++ pub fn querylocale(mask: c_int, loc: crate::locale_t) -> *const c_char; ++ pub fn getpriority(which: c_int, who: crate::id_t) -> c_int; ++ pub fn setpriority(which: c_int, who: crate::id_t, prio: c_int) -> c_int; ++ pub fn getdomainname(name: *mut c_char, len: c_int) -> c_int; ++ pub fn setdomainname(name: *const c_char, len: c_int) -> c_int; ++ pub fn preadv(fd: c_int, iov: *const crate::iovec, iovcnt: c_int, offset: off_t) -> ssize_t; ++ pub fn pwritev(fd: c_int, iov: *const crate::iovec, iovcnt: c_int, offset: off_t) -> ssize_t; ++ pub fn getxattr( ++ path: *const c_char, ++ name: *const c_char, ++ value: *mut c_void, ++ size: size_t, ++ position: u32, ++ flags: c_int, ++ ) -> ssize_t; ++ pub fn fgetxattr( ++ filedes: c_int, ++ name: *const c_char, ++ value: *mut c_void, ++ size: size_t, ++ position: u32, ++ flags: c_int, ++ ) -> ssize_t; ++ pub fn setxattr( ++ path: *const c_char, ++ name: *const c_char, ++ value: *const c_void, ++ size: size_t, ++ position: u32, ++ flags: c_int, ++ ) -> c_int; ++ pub fn fsetxattr( ++ filedes: c_int, ++ name: *const c_char, ++ value: *const c_void, ++ size: size_t, ++ position: u32, ++ flags: c_int, ++ ) -> c_int; ++ pub fn listxattr(path: *const c_char, list: *mut c_char, size: size_t, flags: c_int) ++ -> ssize_t; ++ pub fn flistxattr(filedes: c_int, list: *mut c_char, size: size_t, flags: c_int) -> ssize_t; ++ pub fn removexattr(path: *const c_char, name: *const c_char, flags: c_int) -> c_int; ++ pub fn renamex_np(from: *const c_char, to: *const c_char, flags: c_uint) -> c_int; ++ pub fn renameatx_np( ++ fromfd: c_int, ++ from: *const c_char, ++ tofd: c_int, ++ to: *const c_char, ++ flags: c_uint, ++ ) -> c_int; ++ pub fn fremovexattr(filedes: c_int, name: *const c_char, flags: c_int) -> c_int; ++ ++ pub fn getgrouplist( ++ name: *const c_char, ++ basegid: c_int, ++ groups: *mut c_int, ++ ngroups: *mut c_int, ++ ) -> c_int; ++ pub fn initgroups(user: *const c_char, basegroup: c_int) -> c_int; ++ ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "waitid$UNIX2003" ++ )] ++ pub fn waitid( ++ idtype: idtype_t, ++ id: id_t, ++ infop: *mut crate::siginfo_t, ++ options: c_int, ++ ) -> c_int; ++ pub fn brk(addr: *const c_void) -> *mut c_void; ++ pub fn sbrk(increment: c_int) -> *mut c_void; ++ pub fn settimeofday(tv: *const crate::timeval, tz: *const crate::timezone) -> c_int; ++ #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")] ++ pub fn _dyld_image_count() -> u32; ++ #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")] ++ #[allow(deprecated)] ++ pub fn _dyld_get_image_header(image_index: u32) -> *const mach_header; ++ #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")] ++ pub fn _dyld_get_image_vmaddr_slide(image_index: u32) -> intptr_t; ++ #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")] ++ pub fn _dyld_get_image_name(image_index: u32) -> *const c_char; ++ ++ pub fn posix_spawn( ++ pid: *mut crate::pid_t, ++ path: *const c_char, ++ file_actions: *const crate::posix_spawn_file_actions_t, ++ attrp: *const crate::posix_spawnattr_t, ++ argv: *const *mut c_char, ++ envp: *const *mut c_char, ++ ) -> c_int; ++ pub fn posix_spawnp( ++ pid: *mut crate::pid_t, ++ file: *const c_char, ++ file_actions: *const crate::posix_spawn_file_actions_t, ++ attrp: *const crate::posix_spawnattr_t, ++ argv: *const *mut c_char, ++ envp: *const *mut c_char, ++ ) -> 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_getsigdefault( ++ attr: *const posix_spawnattr_t, ++ default: *mut crate::sigset_t, ++ ) -> c_int; ++ pub fn posix_spawnattr_setsigdefault( ++ attr: *mut posix_spawnattr_t, ++ default: *const crate::sigset_t, ++ ) -> c_int; ++ pub fn posix_spawnattr_getsigmask( ++ attr: *const posix_spawnattr_t, ++ default: *mut crate::sigset_t, ++ ) -> c_int; ++ pub fn posix_spawnattr_setsigmask( ++ attr: *mut posix_spawnattr_t, ++ default: *const crate::sigset_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, ++ flags: *mut crate::pid_t, ++ ) -> c_int; ++ pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: crate::pid_t) -> c_int; ++ pub fn posix_spawnattr_setarchpref_np( ++ attr: *mut posix_spawnattr_t, ++ count: size_t, ++ pref: *mut crate::cpu_type_t, ++ subpref: *mut crate::cpu_subtype_t, ++ ocount: *mut size_t, ++ ) -> c_int; ++ pub fn posix_spawnattr_getarchpref_np( ++ attr: *const posix_spawnattr_t, ++ count: size_t, ++ pref: *mut crate::cpu_type_t, ++ subpref: *mut crate::cpu_subtype_t, ++ ocount: *mut size_t, ++ ) -> c_int; ++ pub fn posix_spawnattr_getbinpref_np( ++ attr: *const posix_spawnattr_t, ++ count: size_t, ++ pref: *mut crate::cpu_type_t, ++ ocount: *mut size_t, ++ ) -> c_int; ++ pub fn posix_spawnattr_setbinpref_np( ++ attr: *mut posix_spawnattr_t, ++ count: size_t, ++ pref: *mut crate::cpu_type_t, ++ ocount: *mut size_t, ++ ) -> c_int; ++ pub fn posix_spawnattr_set_qos_class_np( ++ attr: *mut posix_spawnattr_t, ++ qos_class: crate::qos_class_t, ++ ) -> c_int; ++ pub fn posix_spawnattr_get_qos_class_np( ++ attr: *const posix_spawnattr_t, ++ qos_class: *mut crate::qos_class_t, ++ ) -> c_int; ++ ++ pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> c_int; ++ pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> c_int; ++ pub fn posix_spawn_file_actions_addopen( ++ actions: *mut posix_spawn_file_actions_t, ++ fd: c_int, ++ path: *const c_char, ++ oflag: c_int, ++ mode: crate::mode_t, ++ ) -> c_int; ++ pub fn posix_spawn_file_actions_addclose( ++ actions: *mut posix_spawn_file_actions_t, ++ fd: c_int, ++ ) -> c_int; ++ pub fn posix_spawn_file_actions_adddup2( ++ actions: *mut posix_spawn_file_actions_t, ++ fd: c_int, ++ newfd: c_int, ++ ) -> c_int; ++ pub fn uname(buf: *mut crate::utsname) -> c_int; ++ ++ pub fn connectx( ++ socket: c_int, ++ endpoints: *const sa_endpoints_t, ++ associd: sae_associd_t, ++ flags: c_uint, ++ iov: *const crate::iovec, ++ iovcnt: c_uint, ++ len: *mut size_t, ++ connid: *mut sae_connid_t, ++ ) -> c_int; ++ pub fn disconnectx(socket: c_int, associd: sae_associd_t, connid: sae_connid_t) -> c_int; ++ ++ pub fn ntp_adjtime(buf: *mut timex) -> c_int; ++ pub fn ntp_gettime(buf: *mut ntptimeval) -> c_int; ++ ++ #[cfg_attr( ++ all(target_os = "macos", not(target_arch = "aarch64")), ++ link_name = "getmntinfo$INODE64" ++ )] ++ pub fn getmntinfo(mntbufp: *mut *mut statfs, flags: c_int) -> c_int; ++ #[cfg_attr( ++ all(target_os = "macos", not(target_arch = "aarch64")), ++ link_name = "getfsstat$INODE64" ++ )] ++ pub fn getfsstat(mntbufp: *mut statfs, bufsize: c_int, flags: c_int) -> c_int; ++ ++ // Copy-on-write functions. ++ // According to the man page `flags` is an `int` but in the header ++ // this is a `uint32_t`. ++ pub fn clonefile(src: *const c_char, dst: *const c_char, flags: u32) -> c_int; ++ pub fn clonefileat( ++ src_dirfd: c_int, ++ src: *const c_char, ++ dst_dirfd: c_int, ++ dst: *const c_char, ++ flags: u32, ++ ) -> c_int; ++ pub fn fclonefileat(srcfd: c_int, dst_dirfd: c_int, dst: *const c_char, flags: u32) -> c_int; ++ ++ pub fn copyfile( ++ from: *const c_char, ++ to: *const c_char, ++ state: copyfile_state_t, ++ flags: copyfile_flags_t, ++ ) -> c_int; ++ pub fn fcopyfile( ++ from: c_int, ++ to: c_int, ++ state: copyfile_state_t, ++ flags: copyfile_flags_t, ++ ) -> c_int; ++ pub fn copyfile_state_free(s: copyfile_state_t) -> c_int; ++ pub fn copyfile_state_alloc() -> copyfile_state_t; ++ pub fn copyfile_state_get(s: copyfile_state_t, flags: u32, dst: *mut c_void) -> c_int; ++ pub fn copyfile_state_set(s: copyfile_state_t, flags: u32, src: *const c_void) -> c_int; ++ ++ pub fn mach_error_string(error_value: crate::mach_error_t) -> *mut c_char; ++ ++ // Added in macOS 10.13 ++ // ISO/IEC 9899:2011 ("ISO C11") K.3.7.4.1 ++ pub fn memset_s(s: *mut c_void, smax: size_t, c: c_int, n: size_t) -> c_int; ++ // Added in macOS 10.5 ++ pub fn memset_pattern4(b: *mut c_void, pattern4: *const c_void, len: size_t); ++ pub fn memset_pattern8(b: *mut c_void, pattern8: *const c_void, len: size_t); ++ pub fn memset_pattern16(b: *mut c_void, pattern16: *const c_void, len: size_t); ++ ++ // Inherited from BSD but available from Big Sur only ++ pub fn strtonum( ++ __numstr: *const c_char, ++ __minval: c_longlong, ++ __maxval: c_longlong, ++ errstrp: *mut *const c_char, ++ ) -> c_longlong; ++ ++ pub fn mstats() -> mstats; ++ pub fn malloc_printf(format: *const c_char, ...); ++ pub fn malloc_zone_check(zone: *mut crate::malloc_zone_t) -> crate::boolean_t; ++ pub fn malloc_zone_print(zone: *mut crate::malloc_zone_t, verbose: crate::boolean_t); ++ pub fn malloc_zone_statistics(zone: *mut crate::malloc_zone_t, stats: *mut malloc_statistics_t); ++ pub fn malloc_zone_log(zone: *mut crate::malloc_zone_t, address: *mut c_void); ++ pub fn malloc_zone_print_ptr_info(ptr: *mut c_void); ++ pub fn malloc_default_zone() -> *mut crate::malloc_zone_t; ++ pub fn malloc_zone_from_ptr(ptr: *const c_void) -> *mut crate::malloc_zone_t; ++ pub fn malloc_zone_malloc(zone: *mut crate::malloc_zone_t, size: size_t) -> *mut c_void; ++ pub fn malloc_zone_valloc(zone: *mut crate::malloc_zone_t, size: size_t) -> *mut c_void; ++ pub fn malloc_zone_calloc( ++ zone: *mut crate::malloc_zone_t, ++ num_items: size_t, ++ size: size_t, ++ ) -> *mut c_void; ++ pub fn malloc_zone_realloc( ++ zone: *mut crate::malloc_zone_t, ++ ptr: *mut c_void, ++ size: size_t, ++ ) -> *mut c_void; ++ pub fn malloc_zone_free(zone: *mut crate::malloc_zone_t, ptr: *mut c_void); ++ ++ pub fn proc_listpids(t: u32, typeinfo: u32, buffer: *mut c_void, buffersize: c_int) -> c_int; ++ pub fn proc_listallpids(buffer: *mut c_void, buffersize: c_int) -> c_int; ++ pub fn proc_listpgrppids(pgrpid: crate::pid_t, buffer: *mut c_void, buffersize: c_int) ++ -> c_int; ++ pub fn proc_listchildpids(ppid: crate::pid_t, buffer: *mut c_void, buffersize: c_int) -> c_int; ++ pub fn proc_pidinfo( ++ pid: c_int, ++ flavor: c_int, ++ arg: u64, ++ buffer: *mut c_void, ++ buffersize: c_int, ++ ) -> c_int; ++ pub fn proc_pidfdinfo( ++ pid: c_int, ++ fd: c_int, ++ flavor: c_int, ++ buffer: *mut c_void, ++ buffersize: c_int, ++ ) -> c_int; ++ pub fn proc_pidfileportinfo( ++ pid: c_int, ++ fileport: u32, ++ flavor: c_int, ++ buffer: *mut c_void, ++ buffersize: c_int, ++ ) -> c_int; ++ pub fn proc_pidpath(pid: c_int, buffer: *mut c_void, buffersize: u32) -> c_int; ++ pub fn proc_name(pid: c_int, buffer: *mut c_void, buffersize: u32) -> c_int; ++ pub fn proc_regionfilename( ++ pid: c_int, ++ address: u64, ++ buffer: *mut c_void, ++ buffersize: u32, ++ ) -> c_int; ++ pub fn proc_kmsgbuf(buffer: *mut c_void, buffersize: u32) -> c_int; ++ pub fn proc_libversion(major: *mut c_int, minor: *mut c_int) -> c_int; ++ pub fn proc_pid_rusage(pid: c_int, flavor: c_int, buffer: *mut rusage_info_t) -> c_int; ++ ++ // Available from Big Sur ++ pub fn proc_set_no_smt() -> c_int; ++ pub fn proc_setthread_no_smt() -> c_int; ++ pub fn proc_set_csm(flags: u32) -> c_int; ++ pub fn proc_setthread_csm(flags: u32) -> c_int; ++ /// # Notes ++ /// ++ /// `id` is of type [`uuid_t`]. ++ pub fn gethostuuid(id: *mut u8, timeout: *const crate::timespec) -> c_int; ++ ++ pub fn gethostid() -> c_long; ++ pub fn sethostid(hostid: c_long); ++ ++ pub fn CCRandomGenerateBytes(bytes: *mut c_void, size: size_t) -> crate::CCRNGStatus; ++ pub fn getentropy(buf: *mut c_void, buflen: size_t) -> c_int; ++ ++ // FIXME(1.0): should this actually be deprecated? ++ #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")] ++ pub fn _NSGetExecutablePath(buf: *mut c_char, bufsize: *mut u32) -> c_int; ++ ++ // crt_externs.h ++ pub fn _NSGetArgv() -> *mut *mut *mut c_char; ++ pub fn _NSGetArgc() -> *mut c_int; ++ pub fn _NSGetEnviron() -> *mut *mut *mut c_char; ++ pub fn _NSGetProgname() -> *mut *mut c_char; ++ ++ #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")] ++ pub fn mach_vm_map( ++ target_task: crate::vm_map_t, ++ address: *mut crate::mach_vm_address_t, ++ size: crate::mach_vm_size_t, ++ mask: crate::mach_vm_offset_t, ++ flags: c_int, ++ object: crate::mem_entry_name_port_t, ++ offset: crate::memory_object_offset_t, ++ copy: crate::boolean_t, ++ cur_protection: crate::vm_prot_t, ++ max_protection: crate::vm_prot_t, ++ inheritance: crate::vm_inherit_t, ++ ) -> crate::kern_return_t; ++ ++ pub fn vm_allocate( ++ target_task: vm_map_t, ++ address: *mut vm_address_t, ++ size: vm_size_t, ++ flags: c_int, ++ ) -> crate::kern_return_t; ++ ++ pub fn vm_deallocate( ++ target_task: vm_map_t, ++ address: vm_address_t, ++ size: vm_size_t, ++ ) -> crate::kern_return_t; ++ ++ pub fn host_statistics64( ++ host_priv: host_t, ++ flavor: host_flavor_t, ++ host_info64_out: host_info64_t, ++ host_info64_outCnt: *mut mach_msg_type_number_t, ++ ) -> crate::kern_return_t; ++ pub fn host_processor_info( ++ host: host_t, ++ flavor: processor_flavor_t, ++ out_processor_count: *mut natural_t, ++ out_processor_info: *mut processor_info_array_t, ++ out_processor_infoCnt: *mut mach_msg_type_number_t, ++ ) -> crate::kern_return_t; ++ ++ #[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")] ++ pub static mut mach_task_self_: crate::mach_port_t; ++ pub fn task_for_pid( ++ host: crate::mach_port_t, ++ pid: crate::pid_t, ++ task: *mut crate::mach_port_t, ++ ) -> crate::kern_return_t; ++ pub fn task_info( ++ host: crate::mach_port_t, ++ flavor: task_flavor_t, ++ task_info_out: task_info_t, ++ task_info_count: *mut mach_msg_type_number_t, ++ ) -> crate::kern_return_t; ++ pub fn task_create( ++ target_task: crate::task_t, ++ ledgers: crate::ledger_array_t, ++ ledgersCnt: crate::mach_msg_type_number_t, ++ inherit_memory: crate::boolean_t, ++ child_task: *mut crate::task_t, ++ ) -> crate::kern_return_t; ++ pub fn task_terminate(target_task: crate::task_t) -> crate::kern_return_t; ++ pub fn task_threads( ++ target_task: crate::task_inspect_t, ++ act_list: *mut crate::thread_act_array_t, ++ act_listCnt: *mut crate::mach_msg_type_number_t, ++ ) -> crate::kern_return_t; ++ pub fn host_statistics( ++ host_priv: host_t, ++ flavor: host_flavor_t, ++ host_info_out: host_info_t, ++ host_info_outCnt: *mut mach_msg_type_number_t, ++ ) -> crate::kern_return_t; ++ ++ // sysdir.h ++ pub fn sysdir_start_search_path_enumeration( ++ dir: sysdir_search_path_directory_t, ++ domainMask: sysdir_search_path_domain_mask_t, ++ ) -> crate::sysdir_search_path_enumeration_state; ++ pub fn sysdir_get_next_search_path_enumeration( ++ state: crate::sysdir_search_path_enumeration_state, ++ path: *mut c_char, ++ ) -> crate::sysdir_search_path_enumeration_state; ++ ++ pub static vm_page_size: vm_size_t; ++ ++ pub fn getattrlist( ++ path: *const c_char, ++ attrList: *mut c_void, ++ attrBuf: *mut c_void, ++ attrBufSize: size_t, ++ options: u32, ++ ) -> c_int; ++ pub fn fgetattrlist( ++ fd: c_int, ++ attrList: *mut c_void, ++ attrBuf: *mut c_void, ++ attrBufSize: size_t, ++ options: u32, ++ ) -> c_int; ++ pub fn getattrlistat( ++ fd: c_int, ++ path: *const c_char, ++ attrList: *mut c_void, ++ attrBuf: *mut c_void, ++ attrBufSize: size_t, ++ options: c_ulong, ++ ) -> c_int; ++ pub fn setattrlist( ++ path: *const c_char, ++ attrList: *mut c_void, ++ attrBuf: *mut c_void, ++ attrBufSize: size_t, ++ options: u32, ++ ) -> c_int; ++ pub fn fsetattrlist( ++ fd: c_int, ++ attrList: *mut c_void, ++ attrBuf: *mut c_void, ++ attrBufSize: size_t, ++ options: u32, ++ ) -> c_int; ++ pub fn setattrlistat( ++ dir_fd: c_int, ++ path: *const c_char, ++ attrList: *mut c_void, ++ attrBuf: *mut c_void, ++ attrBufSize: size_t, ++ options: u32, ++ ) -> c_int; ++ pub fn getattrlistbulk( ++ dirfd: c_int, ++ attrList: *mut c_void, ++ attrBuf: *mut c_void, ++ attrBufSize: size_t, ++ options: u64, ++ ) -> c_int; ++ ++ pub fn malloc_size(ptr: *const c_void) -> size_t; ++ pub fn malloc_good_size(size: size_t) -> size_t; ++ ++ pub fn dirname(path: *mut c_char) -> *mut c_char; ++ pub fn basename(path: *mut c_char) -> *mut c_char; ++ ++ pub fn mkfifoat(dirfd: c_int, pathname: *const c_char, mode: crate::mode_t) -> c_int; ++ pub fn mknodat(dirfd: c_int, pathname: *const c_char, mode: crate::mode_t, dev: dev_t) ++ -> c_int; ++ pub fn freadlink(fd: c_int, buf: *mut c_char, size: size_t) -> c_int; ++ pub fn execvP( ++ file: *const c_char, ++ search_path: *const c_char, ++ argv: *const *mut c_char, ++ ) -> c_int; ++} ++ ++#[allow(deprecated)] ++#[deprecated(since = "0.2.55", note = "Use the `mach2` crate instead")] ++pub unsafe fn mach_task_self() -> crate::mach_port_t { ++ mach_task_self_ ++} ++ ++cfg_if! { ++ if #[cfg(target_os = "macos")] { ++ extern "C" { ++ pub fn clock_settime(clock_id: crate::clockid_t, tp: *const crate::timespec) -> c_int; ++ } ++ } ++} ++cfg_if! { ++ if #[cfg(any( ++ target_os = "macos", ++ target_os = "ios", ++ target_os = "tvos", ++ target_os = "visionos" ++ ))] { ++ 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: crate::task_t, ++ flavor: crate::task_flavor_t, ++ task_info_in: crate::task_info_t, ++ task_info_inCnt: crate::mach_msg_type_number_t, ++ ) -> crate::kern_return_t; ++ } ++ } ++} ++ ++// These require a dependency on `libiconv`, and including this when built as ++// part of `std` means every Rust program gets it. Ideally we would have a link ++// modifier to only include these if they are used, but we do not. ++#[deprecated(note = "Will be removed in 1.0 to avoid the `iconv` dependency")] ++#[cfg_attr(not(feature = "rustc-dep-of-std"), link(name = "iconv"))] ++extern "C" { ++ pub fn iconv_open(tocode: *const c_char, fromcode: *const c_char) -> iconv_t; ++ pub fn iconv( ++ cd: iconv_t, ++ inbuf: *mut *mut c_char, ++ inbytesleft: *mut size_t, ++ outbuf: *mut *mut c_char, ++ outbytesleft: *mut size_t, ++ ) -> size_t; ++ pub fn iconv_close(cd: iconv_t) -> c_int; ++} ++ ++cfg_if! { ++ if #[cfg(target_pointer_width = "32")] { ++ mod b32; ++ pub use self::b32::*; ++ } else if #[cfg(target_pointer_width = "64")] { ++ mod b64; ++ pub use self::b64::*; ++ } else { ++ // Unknown target_arch ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/dragonfly/errno.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/dragonfly/errno.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/dragonfly/errno.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/dragonfly/errno.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,17 @@ ++use crate::prelude::*; ++ ++/* DIFF(main): module removed in de76fee6 */ ++ ++// DragonFlyBSD's __error function is declared with "static inline", so it must ++// be implemented in the libc crate, as a pointer to a static thread_local. ++f! { ++ #[deprecated(since = "0.2.77", note = "Use `__errno_location()` instead")] ++ pub fn __error() -> *mut c_int { ++ &mut errno ++ } ++} ++ ++extern "C" { ++ #[thread_local] ++ pub static mut errno: c_int; ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/dragonfly/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/dragonfly/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/dragonfly/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/dragonfly/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,1752 @@ ++use crate::prelude::*; ++use crate::{cmsghdr, off_t}; ++ ++pub type dev_t = u32; ++pub type c_char = i8; ++pub type wchar_t = i32; ++pub type clock_t = u64; ++pub type ino_t = u64; ++pub type lwpid_t = i32; ++pub type nlink_t = u32; ++pub type blksize_t = i64; ++pub type clockid_t = c_ulong; ++ ++pub type c_long = i64; ++pub type c_ulong = u64; ++pub type time_t = i64; ++pub type suseconds_t = i64; ++ ++pub type uuid_t = crate::uuid; ++ ++pub type fsblkcnt_t = u64; ++pub type fsfilcnt_t = u64; ++pub type idtype_t = c_uint; ++pub type shmatt_t = c_uint; ++ ++pub type mqd_t = c_int; ++pub type sem_t = *mut sem; ++ ++pub type cpuset_t = cpumask_t; ++pub type cpu_set_t = cpumask_t; ++ ++pub type register_t = c_long; ++pub type umtx_t = c_int; ++pub type pthread_barrierattr_t = c_int; ++pub type pthread_barrier_t = crate::uintptr_t; ++pub type pthread_spinlock_t = crate::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 {} ++impl Clone for sem { ++ fn clone(&self) -> sem { ++ *self ++ } ++} ++ ++e! { ++ #[repr(u32)] ++ pub enum lwpstat { ++ LSRUN = 1, ++ LSSTOP = 2, ++ LSSLEEP = 3, ++ } ++ ++ #[repr(u32)] ++ pub enum procstat { ++ SIDL = 1, ++ SACTIVE = 2, ++ SSTOP = 3, ++ SZOMB = 4, ++ SCORE = 5, ++ } ++} ++ ++s! { ++ pub struct kevent { ++ pub ident: crate::uintptr_t, ++ pub filter: c_short, ++ pub flags: c_ushort, ++ pub fflags: c_uint, ++ pub data: intptr_t, ++ pub udata: *mut c_void, ++ } ++ ++ pub struct exit_status { ++ pub e_termination: u16, ++ pub e_exit: u16, ++ } ++ ++ pub struct aiocb { ++ pub aio_fildes: c_int, ++ pub aio_offset: off_t, ++ pub aio_buf: *mut c_void, ++ pub aio_nbytes: size_t, ++ pub aio_sigevent: sigevent, ++ pub aio_lio_opcode: c_int, ++ pub aio_reqprio: c_int, ++ _aio_val: c_int, ++ _aio_err: c_int, ++ } ++ ++ pub struct uuid { ++ pub time_low: u32, ++ pub time_mid: u16, ++ pub time_hi_and_version: u16, ++ pub clock_seq_hi_and_reserved: u8, ++ pub clock_seq_low: u8, ++ pub node: [u8; 6], ++ } ++ ++ pub struct mq_attr { ++ pub mq_flags: c_long, ++ pub mq_maxmsg: c_long, ++ pub mq_msgsize: c_long, ++ pub mq_curmsgs: c_long, ++ } ++ ++ pub struct statvfs { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_favail: crate::fsfilcnt_t, ++ pub f_fsid: c_ulong, ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ pub f_owner: crate::uid_t, ++ pub f_type: c_uint, ++ pub f_syncreads: u64, ++ pub f_syncwrites: u64, ++ pub f_asyncreads: u64, ++ pub f_asyncwrites: u64, ++ pub f_fsid_uuid: crate::uuid_t, ++ pub f_uid_uuid: crate::uuid_t, ++ } ++ ++ pub struct stat { ++ pub st_ino: crate::ino_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_dev: crate::dev_t, ++ pub st_mode: crate::mode_t, ++ pub st_padding1: u16, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ pub st_size: off_t, ++ pub st_blocks: i64, ++ pub __old_st_blksize: u32, ++ pub st_flags: u32, ++ pub st_gen: u32, ++ pub st_lspare: i32, ++ pub st_blksize: i64, ++ pub st_qspare2: i64, ++ } ++ ++ pub struct if_data { ++ pub ifi_type: c_uchar, ++ pub ifi_physical: c_uchar, ++ pub ifi_addrlen: c_uchar, ++ pub ifi_hdrlen: c_uchar, ++ pub ifi_recvquota: c_uchar, ++ pub ifi_xmitquota: c_uchar, ++ pub ifi_mtu: c_ulong, ++ pub ifi_metric: c_ulong, ++ pub ifi_link_state: c_ulong, ++ pub ifi_baudrate: u64, ++ pub ifi_ipackets: c_ulong, ++ pub ifi_ierrors: c_ulong, ++ pub ifi_opackets: c_ulong, ++ pub ifi_oerrors: c_ulong, ++ pub ifi_collisions: c_ulong, ++ pub ifi_ibytes: c_ulong, ++ pub ifi_obytes: c_ulong, ++ pub ifi_imcasts: c_ulong, ++ pub ifi_omcasts: c_ulong, ++ pub ifi_iqdrops: c_ulong, ++ pub ifi_noproto: c_ulong, ++ pub ifi_hwassist: c_ulong, ++ pub ifi_oqdrops: c_ulong, ++ pub ifi_lastchange: crate::timeval, ++ } ++ ++ pub struct if_msghdr { ++ pub ifm_msglen: c_ushort, ++ pub ifm_version: c_uchar, ++ pub ifm_type: c_uchar, ++ pub ifm_addrs: c_int, ++ pub ifm_flags: c_int, ++ pub ifm_index: c_ushort, ++ pub ifm_data: if_data, ++ } ++ ++ pub struct sockaddr_dl { ++ pub sdl_len: c_uchar, ++ pub sdl_family: c_uchar, ++ pub sdl_index: c_ushort, ++ pub sdl_type: c_uchar, ++ pub sdl_nlen: c_uchar, ++ pub sdl_alen: c_uchar, ++ pub sdl_slen: c_uchar, ++ pub sdl_data: [c_char; 12], ++ pub sdl_rcf: c_ushort, ++ pub sdl_route: [c_ushort; 16], ++ } ++ ++ pub struct xucred { ++ pub cr_version: c_uint, ++ pub cr_uid: crate::uid_t, ++ pub cr_ngroups: c_short, ++ pub cr_groups: [crate::gid_t; 16], ++ __cr_unused1: *mut c_void, ++ } ++ ++ pub struct stack_t { ++ pub ss_sp: *mut c_void, ++ pub ss_size: size_t, ++ pub ss_flags: c_int, ++ } ++ ++ pub struct cpumask_t { ++ ary: [u64; 4], ++ } ++ ++ pub struct shmid_ds { ++ pub shm_perm: crate::ipc_perm, ++ pub shm_segsz: size_t, ++ pub shm_lpid: crate::pid_t, ++ pub shm_cpid: crate::pid_t, ++ pub shm_nattch: crate::shmatt_t, ++ pub shm_atime: crate::time_t, ++ pub shm_dtime: crate::time_t, ++ pub shm_ctime: crate::time_t, ++ shm_internal: *mut c_void, ++ } ++ ++ pub struct kinfo_file { ++ pub f_size: size_t, ++ pub f_pid: crate::pid_t, ++ pub f_uid: crate::uid_t, ++ pub f_fd: c_int, ++ pub f_file: *mut c_void, ++ pub f_type: c_short, ++ pub f_count: c_int, ++ pub f_msgcount: c_int, ++ pub f_offset: off_t, ++ pub f_data: *mut c_void, ++ pub f_flag: c_uint, ++ } ++ ++ pub struct kinfo_cputime { ++ pub cp_user: u64, ++ pub cp_nice: u64, ++ pub cp_sys: u64, ++ pub cp_intr: u64, ++ pub cp_idel: u64, ++ cp_unused01: u64, ++ cp_unused02: u64, ++ pub cp_sample_pc: u64, ++ pub cp_sample_sp: u64, ++ pub cp_msg: [c_char; 32], ++ } ++ ++ pub struct kinfo_lwp { ++ pub kl_pid: crate::pid_t, ++ pub kl_tid: crate::lwpid_t, ++ pub kl_flags: c_int, ++ pub kl_stat: crate::lwpstat, ++ pub kl_lock: c_int, ++ pub kl_tdflags: c_int, ++ pub kl_mpcount: c_int, ++ pub kl_prio: c_int, ++ pub kl_tdprio: c_int, ++ pub kl_rtprio: crate::rtprio, ++ pub kl_uticks: u64, ++ pub kl_sticks: u64, ++ pub kl_iticks: u64, ++ pub kl_cpticks: u64, ++ pub kl_pctcpu: c_uint, ++ pub kl_slptime: c_uint, ++ pub kl_origcpu: c_int, ++ pub kl_estcpu: c_int, ++ pub kl_cpuid: c_int, ++ pub kl_ru: crate::rusage, ++ pub kl_siglist: crate::sigset_t, ++ pub kl_sigmask: crate::sigset_t, ++ pub kl_wchan: crate::uintptr_t, ++ pub kl_wmesg: [c_char; 9], ++ pub kl_comm: [c_char; MAXCOMLEN + 1], ++ } ++ ++ pub struct kinfo_proc { ++ pub kp_paddr: crate::uintptr_t, ++ pub kp_flags: c_int, ++ pub kp_stat: crate::procstat, ++ pub kp_lock: c_int, ++ pub kp_acflag: c_int, ++ pub kp_traceflag: c_int, ++ pub kp_fd: crate::uintptr_t, ++ pub kp_siglist: crate::sigset_t, ++ pub kp_sigignore: crate::sigset_t, ++ pub kp_sigcatch: crate::sigset_t, ++ pub kp_sigflag: c_int, ++ pub kp_start: crate::timeval, ++ pub kp_comm: [c_char; MAXCOMLEN + 1], ++ pub kp_uid: crate::uid_t, ++ pub kp_ngroups: c_short, ++ pub kp_groups: [crate::gid_t; NGROUPS], ++ pub kp_ruid: crate::uid_t, ++ pub kp_svuid: crate::uid_t, ++ pub kp_rgid: crate::gid_t, ++ pub kp_svgid: crate::gid_t, ++ pub kp_pid: crate::pid_t, ++ pub kp_ppid: crate::pid_t, ++ pub kp_pgid: crate::pid_t, ++ pub kp_jobc: c_int, ++ pub kp_sid: crate::pid_t, ++ pub kp_login: [c_char; 40], // MAXNAMELEN rounded up to the nearest sizeof(long) ++ pub kp_tdev: crate::dev_t, ++ pub kp_tpgid: crate::pid_t, ++ pub kp_tsid: crate::pid_t, ++ pub kp_exitstat: c_ushort, ++ pub kp_nthreads: c_int, ++ pub kp_nice: c_int, ++ pub kp_swtime: c_uint, ++ pub kp_vm_map_size: size_t, ++ pub kp_vm_rssize: crate::segsz_t, ++ pub kp_vm_swrss: crate::segsz_t, ++ pub kp_vm_tsize: crate::segsz_t, ++ pub kp_vm_dsize: crate::segsz_t, ++ pub kp_vm_ssize: crate::segsz_t, ++ pub kp_vm_prssize: c_uint, ++ pub kp_jailid: c_int, ++ pub kp_ru: crate::rusage, ++ pub kp_cru: crate::rusage, ++ pub kp_auxflags: c_int, ++ pub kp_lwp: crate::kinfo_lwp, ++ pub kp_ktaddr: crate::uintptr_t, ++ kp_spare: [c_int; 2], ++ } ++ ++ pub struct __c_anonymous_vm_map { ++ _priv: [crate::uintptr_t; 36], ++ } ++ ++ pub struct vm_map_entry { ++ _priv: [crate::uintptr_t; 15], ++ pub eflags: crate::vm_eflags_t, ++ pub maptype: crate::vm_maptype_t, ++ pub protection: crate::vm_prot_t, ++ pub max_protection: crate::vm_prot_t, ++ pub inheritance: crate::vm_inherit_t, ++ pub wired_count: c_int, ++ pub id: crate::vm_subsys_t, ++ } ++ ++ pub struct __c_anonymous_pmap { ++ _priv1: [crate::uintptr_t; 32], ++ _priv2: [crate::uintptr_t; 32], ++ _priv3: [crate::uintptr_t; 32], ++ _priv4: [crate::uintptr_t; 32], ++ _priv5: [crate::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: crate::segsz_t, ++ pub vm_swrss: crate::segsz_t, ++ pub vm_tsize: crate::segsz_t, ++ pub vm_dsize: crate::segsz_t, ++ pub vm_ssize: crate::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, ++ } ++ ++ pub struct cpuctl_cpuid_args_t { ++ pub level: c_int, ++ pub data: [u32; 4], ++ } ++ ++ pub struct cpuctl_cpuid_count_args_t { ++ pub level: c_int, ++ pub level_type: c_int, ++ pub data: [u32; 4], ++ } ++ ++ pub struct cpuctl_update_args_t { ++ pub data: *mut c_void, ++ pub size: size_t, ++ } ++} ++ ++s_no_extra_traits! { ++ pub struct utmpx { ++ pub ut_name: [c_char; 32], ++ pub ut_id: [c_char; 4], ++ ++ pub ut_line: [c_char; 32], ++ pub ut_host: [c_char; 256], ++ ++ pub ut_unused: [u8; 16], ++ pub ut_session: u16, ++ pub ut_type: u16, ++ pub ut_pid: crate::pid_t, ++ ut_exit: exit_status, ++ ut_ss: crate::sockaddr_storage, ++ pub ut_tv: crate::timeval, ++ pub ut_unused2: [u8; 16], ++ } ++ ++ pub struct lastlogx { ++ pub ll_tv: crate::timeval, ++ pub ll_line: [c_char; _UTX_LINESIZE], ++ pub ll_host: [c_char; _UTX_HOSTSIZE], ++ pub ll_ss: crate::sockaddr_storage, ++ } ++ ++ pub struct dirent { ++ pub d_fileno: crate::ino_t, ++ pub d_namlen: u16, ++ pub d_type: u8, ++ __unused1: u8, ++ __unused2: u32, ++ pub d_name: [c_char; 256], ++ } ++ ++ pub struct statfs { ++ __spare2: c_long, ++ pub f_bsize: c_long, ++ pub f_iosize: c_long, ++ pub f_blocks: c_long, ++ pub f_bfree: c_long, ++ pub f_bavail: c_long, ++ pub f_files: c_long, ++ pub f_ffree: c_long, ++ pub f_fsid: crate::fsid_t, ++ pub f_owner: crate::uid_t, ++ pub f_type: c_int, ++ pub f_flags: c_int, ++ pub f_syncwrites: c_long, ++ pub f_asyncwrites: c_long, ++ pub f_fstypename: [c_char; 16], ++ pub f_mntonname: [c_char; 80], ++ pub f_syncreads: c_long, ++ pub f_asyncreads: c_long, ++ __spares1: c_short, ++ pub f_mntfromname: [c_char; 80], ++ __spares2: c_short, ++ __spare: [c_long; 2], ++ } ++ ++ pub struct sigevent { ++ pub sigev_notify: c_int, ++ // The union is 8-byte in size, so it is aligned at a 8-byte offset. ++ #[cfg(target_pointer_width = "64")] ++ __unused1: c_int, ++ pub sigev_signo: c_int, //actually a union ++ // pad the union ++ #[cfg(target_pointer_width = "64")] ++ __unused2: c_int, ++ pub sigev_value: crate::sigval, ++ __unused3: *mut c_void, //actually a function pointer ++ } ++ ++ pub struct mcontext_t { ++ pub mc_onstack: register_t, ++ pub mc_rdi: register_t, ++ pub mc_rsi: register_t, ++ pub mc_rdx: register_t, ++ pub mc_rcx: register_t, ++ pub mc_r8: register_t, ++ pub mc_r9: register_t, ++ pub mc_rax: register_t, ++ pub mc_rbx: register_t, ++ pub mc_rbp: register_t, ++ pub mc_r10: register_t, ++ pub mc_r11: register_t, ++ pub mc_r12: register_t, ++ pub mc_r13: register_t, ++ pub mc_r14: register_t, ++ pub mc_r15: register_t, ++ pub mc_xflags: register_t, ++ pub mc_trapno: register_t, ++ pub mc_addr: register_t, ++ pub mc_flags: register_t, ++ pub mc_err: register_t, ++ pub mc_rip: register_t, ++ pub mc_cs: register_t, ++ pub mc_rflags: register_t, ++ pub mc_rsp: register_t, ++ pub mc_ss: register_t, ++ pub mc_len: c_uint, ++ pub mc_fpformat: c_uint, ++ pub mc_ownedfp: c_uint, ++ __reserved: c_uint, ++ __unused: [c_uint; 8], ++ pub mc_fpregs: [[c_uint; 8]; 32], ++ } ++ ++ pub struct ucontext_t { ++ pub uc_sigmask: crate::sigset_t, ++ pub uc_mcontext: mcontext_t, ++ pub uc_link: *mut ucontext_t, ++ pub uc_stack: stack_t, ++ pub uc_cofunc: Option, ++ pub uc_arg: *mut c_void, ++ __pad: [c_int; 4], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for utmpx { ++ fn eq(&self, other: &utmpx) -> bool { ++ self.ut_name == other.ut_name ++ && self.ut_id == other.ut_id ++ && self.ut_line == other.ut_line ++ && self ++ .ut_host ++ .iter() ++ .zip(other.ut_host.iter()) ++ .all(|(a, b)| a == b) ++ && self.ut_unused == other.ut_unused ++ && self.ut_session == other.ut_session ++ && self.ut_type == other.ut_type ++ && self.ut_pid == other.ut_pid ++ && self.ut_exit == other.ut_exit ++ && self.ut_ss == other.ut_ss ++ && self.ut_tv == other.ut_tv ++ && self.ut_unused2 == other.ut_unused2 ++ } ++ } ++ impl Eq for utmpx {} ++ impl fmt::Debug for utmpx { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("utmpx") ++ .field("ut_name", &self.ut_name) ++ .field("ut_id", &self.ut_id) ++ .field("ut_line", &self.ut_line) ++ // FIXME: .field("ut_host", &self.ut_host) ++ .field("ut_unused", &self.ut_unused) ++ .field("ut_session", &self.ut_session) ++ .field("ut_type", &self.ut_type) ++ .field("ut_pid", &self.ut_pid) ++ .field("ut_exit", &self.ut_exit) ++ .field("ut_ss", &self.ut_ss) ++ .field("ut_tv", &self.ut_tv) ++ .field("ut_unused2", &self.ut_unused2) ++ .finish() ++ } ++ } ++ impl hash::Hash for utmpx { ++ fn hash(&self, state: &mut H) { ++ self.ut_name.hash(state); ++ self.ut_id.hash(state); ++ self.ut_line.hash(state); ++ self.ut_host.hash(state); ++ self.ut_unused.hash(state); ++ self.ut_session.hash(state); ++ self.ut_type.hash(state); ++ self.ut_pid.hash(state); ++ self.ut_exit.hash(state); ++ self.ut_ss.hash(state); ++ self.ut_tv.hash(state); ++ self.ut_unused2.hash(state); ++ } ++ } ++ impl PartialEq for lastlogx { ++ fn eq(&self, other: &lastlogx) -> bool { ++ self.ll_tv == other.ll_tv ++ && self.ll_line == other.ll_line ++ && self.ll_host == other.ll_host ++ && self.ll_ss == other.ll_ss ++ } ++ } ++ impl Eq for lastlogx {} ++ impl fmt::Debug for lastlogx { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("lastlogx") ++ .field("ll_tv", &self.ll_tv) ++ .field("ll_line", &self.ll_line) ++ .field("ll_host", &self.ll_host) ++ .field("ll_ss", &self.ll_ss) ++ .finish() ++ } ++ } ++ impl hash::Hash for lastlogx { ++ fn hash(&self, state: &mut H) { ++ self.ll_tv.hash(state); ++ self.ll_line.hash(state); ++ self.ll_host.hash(state); ++ self.ll_ss.hash(state); ++ } ++ } ++ ++ impl PartialEq for dirent { ++ fn eq(&self, other: &dirent) -> bool { ++ self.d_fileno == other.d_fileno ++ && self.d_namlen == other.d_namlen ++ && self.d_type == other.d_type ++ // Ignore __unused1 ++ // Ignore __unused2 ++ && self ++ .d_name ++ .iter() ++ .zip(other.d_name.iter()) ++ .all(|(a,b)| a == b) ++ } ++ } ++ impl Eq for dirent {} ++ impl fmt::Debug for dirent { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("dirent") ++ .field("d_fileno", &self.d_fileno) ++ .field("d_namlen", &self.d_namlen) ++ .field("d_type", &self.d_type) ++ // Ignore __unused1 ++ // Ignore __unused2 ++ // FIXME: .field("d_name", &self.d_name) ++ .finish() ++ } ++ } ++ impl hash::Hash for dirent { ++ fn hash(&self, state: &mut H) { ++ self.d_fileno.hash(state); ++ self.d_namlen.hash(state); ++ self.d_type.hash(state); ++ // Ignore __unused1 ++ // Ignore __unused2 ++ self.d_name.hash(state); ++ } ++ } ++ ++ impl PartialEq for statfs { ++ fn eq(&self, other: &statfs) -> bool { ++ self.f_bsize == other.f_bsize ++ && self.f_iosize == other.f_iosize ++ && self.f_blocks == other.f_blocks ++ && self.f_bfree == other.f_bfree ++ && self.f_bavail == other.f_bavail ++ && self.f_files == other.f_files ++ && self.f_ffree == other.f_ffree ++ && self.f_fsid == other.f_fsid ++ && self.f_owner == other.f_owner ++ && self.f_type == other.f_type ++ && self.f_flags == other.f_flags ++ && self.f_syncwrites == other.f_syncwrites ++ && self.f_asyncwrites == other.f_asyncwrites ++ && self.f_fstypename == other.f_fstypename ++ && self ++ .f_mntonname ++ .iter() ++ .zip(other.f_mntonname.iter()) ++ .all(|(a, b)| a == b) ++ && self.f_syncreads == other.f_syncreads ++ && self.f_asyncreads == other.f_asyncreads ++ && self ++ .f_mntfromname ++ .iter() ++ .zip(other.f_mntfromname.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for statfs {} ++ impl fmt::Debug for statfs { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("statfs") ++ .field("f_bsize", &self.f_bsize) ++ .field("f_iosize", &self.f_iosize) ++ .field("f_blocks", &self.f_blocks) ++ .field("f_bfree", &self.f_bfree) ++ .field("f_bavail", &self.f_bavail) ++ .field("f_files", &self.f_files) ++ .field("f_ffree", &self.f_ffree) ++ .field("f_fsid", &self.f_fsid) ++ .field("f_owner", &self.f_owner) ++ .field("f_type", &self.f_type) ++ .field("f_flags", &self.f_flags) ++ .field("f_syncwrites", &self.f_syncwrites) ++ .field("f_asyncwrites", &self.f_asyncwrites) ++ // FIXME: .field("f_mntonname", &self.f_mntonname) ++ .field("f_syncreads", &self.f_syncreads) ++ .field("f_asyncreads", &self.f_asyncreads) ++ // FIXME: .field("f_mntfromname", &self.f_mntfromname) ++ .finish() ++ } ++ } ++ impl hash::Hash for statfs { ++ fn hash(&self, state: &mut H) { ++ self.f_bsize.hash(state); ++ self.f_iosize.hash(state); ++ self.f_blocks.hash(state); ++ self.f_bfree.hash(state); ++ self.f_bavail.hash(state); ++ self.f_files.hash(state); ++ self.f_ffree.hash(state); ++ self.f_fsid.hash(state); ++ self.f_owner.hash(state); ++ self.f_type.hash(state); ++ self.f_flags.hash(state); ++ self.f_syncwrites.hash(state); ++ self.f_asyncwrites.hash(state); ++ self.f_fstypename.hash(state); ++ self.f_mntonname.hash(state); ++ self.f_syncreads.hash(state); ++ self.f_asyncreads.hash(state); ++ self.f_mntfromname.hash(state); ++ } ++ } ++ ++ impl PartialEq for sigevent { ++ fn eq(&self, other: &sigevent) -> bool { ++ self.sigev_notify == other.sigev_notify ++ && self.sigev_signo == other.sigev_signo ++ && self.sigev_value == other.sigev_value ++ } ++ } ++ impl Eq for sigevent {} ++ impl fmt::Debug for sigevent { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sigevent") ++ .field("sigev_notify", &self.sigev_notify) ++ .field("sigev_signo", &self.sigev_signo) ++ .field("sigev_value", &self.sigev_value) ++ .finish() ++ } ++ } ++ impl hash::Hash for sigevent { ++ fn hash(&self, state: &mut H) { ++ self.sigev_notify.hash(state); ++ self.sigev_signo.hash(state); ++ self.sigev_value.hash(state); ++ } ++ } ++ impl PartialEq for mcontext_t { ++ fn eq(&self, other: &mcontext_t) -> bool { ++ self.mc_onstack == other.mc_onstack ++ && self.mc_rdi == other.mc_rdi ++ && self.mc_rsi == other.mc_rsi ++ && self.mc_rdx == other.mc_rdx ++ && self.mc_rcx == other.mc_rcx ++ && self.mc_r8 == other.mc_r8 ++ && self.mc_r9 == other.mc_r9 ++ && self.mc_rax == other.mc_rax ++ && self.mc_rbx == other.mc_rbx ++ && self.mc_rbp == other.mc_rbp ++ && self.mc_r10 == other.mc_r10 ++ && self.mc_r11 == other.mc_r11 ++ && self.mc_r12 == other.mc_r12 ++ && self.mc_r13 == other.mc_r13 ++ && self.mc_r14 == other.mc_r14 ++ && self.mc_r15 == other.mc_r15 ++ && self.mc_xflags == other.mc_xflags ++ && self.mc_trapno == other.mc_trapno ++ && self.mc_addr == other.mc_addr ++ && self.mc_flags == other.mc_flags ++ && self.mc_err == other.mc_err ++ && self.mc_rip == other.mc_rip ++ && self.mc_cs == other.mc_cs ++ && self.mc_rflags == other.mc_rflags ++ && self.mc_rsp == other.mc_rsp ++ && self.mc_ss == other.mc_ss ++ && self.mc_len == other.mc_len ++ && self.mc_fpformat == other.mc_fpformat ++ && self.mc_ownedfp == other.mc_ownedfp ++ && self.mc_fpregs == other.mc_fpregs ++ } ++ } ++ impl Eq for mcontext_t {} ++ impl fmt::Debug for mcontext_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("mcontext_t") ++ .field("mc_onstack", &self.mc_onstack) ++ .field("mc_rdi", &self.mc_rdi) ++ .field("mc_rsi", &self.mc_rsi) ++ .field("mc_rdx", &self.mc_rdx) ++ .field("mc_rcx", &self.mc_rcx) ++ .field("mc_r8", &self.mc_r8) ++ .field("mc_r9", &self.mc_r9) ++ .field("mc_rax", &self.mc_rax) ++ .field("mc_rbx", &self.mc_rbx) ++ .field("mc_rbp", &self.mc_rbp) ++ .field("mc_r10", &self.mc_r10) ++ .field("mc_r11", &self.mc_r11) ++ .field("mc_r12", &self.mc_r12) ++ .field("mc_r13", &self.mc_r13) ++ .field("mc_r14", &self.mc_r14) ++ .field("mc_r15", &self.mc_r15) ++ .field("mc_xflags", &self.mc_xflags) ++ .field("mc_trapno", &self.mc_trapno) ++ .field("mc_addr", &self.mc_addr) ++ .field("mc_flags", &self.mc_flags) ++ .field("mc_err", &self.mc_err) ++ .field("mc_rip", &self.mc_rip) ++ .field("mc_cs", &self.mc_cs) ++ .field("mc_rflags", &self.mc_rflags) ++ .field("mc_rsp", &self.mc_rsp) ++ .field("mc_ss", &self.mc_ss) ++ .field("mc_len", &self.mc_len) ++ .field("mc_fpformat", &self.mc_fpformat) ++ .field("mc_ownedfp", &self.mc_ownedfp) ++ .field("mc_fpregs", &self.mc_fpregs) ++ .finish() ++ } ++ } ++ impl hash::Hash for mcontext_t { ++ fn hash(&self, state: &mut H) { ++ self.mc_onstack.hash(state); ++ self.mc_rdi.hash(state); ++ self.mc_rsi.hash(state); ++ self.mc_rdx.hash(state); ++ self.mc_rcx.hash(state); ++ self.mc_r8.hash(state); ++ self.mc_r9.hash(state); ++ self.mc_rax.hash(state); ++ self.mc_rbx.hash(state); ++ self.mc_rbp.hash(state); ++ self.mc_r10.hash(state); ++ self.mc_r11.hash(state); ++ self.mc_r10.hash(state); ++ self.mc_r11.hash(state); ++ self.mc_r12.hash(state); ++ self.mc_r13.hash(state); ++ self.mc_r14.hash(state); ++ self.mc_r15.hash(state); ++ self.mc_xflags.hash(state); ++ self.mc_trapno.hash(state); ++ self.mc_addr.hash(state); ++ self.mc_flags.hash(state); ++ self.mc_err.hash(state); ++ self.mc_rip.hash(state); ++ self.mc_cs.hash(state); ++ self.mc_rflags.hash(state); ++ self.mc_rsp.hash(state); ++ self.mc_ss.hash(state); ++ self.mc_len.hash(state); ++ self.mc_fpformat.hash(state); ++ self.mc_ownedfp.hash(state); ++ self.mc_fpregs.hash(state); ++ } ++ } ++ impl PartialEq for ucontext_t { ++ fn eq(&self, other: &ucontext_t) -> bool { ++ self.uc_sigmask == other.uc_sigmask ++ && self.uc_mcontext == other.uc_mcontext ++ && self.uc_link == other.uc_link ++ && self.uc_stack == other.uc_stack ++ && self.uc_cofunc == other.uc_cofunc ++ && self.uc_arg == other.uc_arg ++ } ++ } ++ impl Eq for ucontext_t {} ++ impl fmt::Debug for ucontext_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("ucontext_t") ++ .field("uc_sigmask", &self.uc_sigmask) ++ .field("uc_mcontext", &self.uc_mcontext) ++ .field("uc_link", &self.uc_link) ++ .field("uc_stack", &self.uc_stack) ++ .field("uc_cofunc", &self.uc_cofunc) ++ .field("uc_arg", &self.uc_arg) ++ .finish() ++ } ++ } ++ impl hash::Hash for ucontext_t { ++ fn hash(&self, state: &mut H) { ++ self.uc_sigmask.hash(state); ++ self.uc_mcontext.hash(state); ++ self.uc_link.hash(state); ++ self.uc_stack.hash(state); ++ self.uc_cofunc.hash(state); ++ self.uc_arg.hash(state); ++ } ++ } ++ } ++} ++ ++pub const RAND_MAX: c_int = 0x7fff_ffff; ++pub const PTHREAD_STACK_MIN: size_t = 16384; ++pub const SIGSTKSZ: size_t = 40960; ++pub const SIGCKPT: c_int = 33; ++pub const SIGCKPTEXIT: c_int = 34; ++pub const CKPT_FREEZE: c_int = 0x1; ++pub const CKPT_THAW: c_int = 0x2; ++pub const MADV_INVAL: c_int = 10; ++pub const MADV_SETMAP: c_int = 11; ++pub const O_CLOEXEC: c_int = 0x00020000; ++pub const O_DIRECTORY: c_int = 0x08000000; ++pub const F_GETLK: c_int = 7; ++pub const F_SETLK: c_int = 8; ++pub const F_SETLKW: c_int = 9; ++pub const F_GETPATH: c_int = 19; ++pub const ENOMEDIUM: c_int = 93; ++pub const ENOTRECOVERABLE: c_int = 94; ++pub const EOWNERDEAD: c_int = 95; ++pub const EASYNC: c_int = 99; ++pub const ELAST: c_int = 99; ++pub const RLIMIT_POSIXLOCKS: c_int = 11; ++#[deprecated(since = "0.2.64", note = "Not stable across OS versions")] ++pub const RLIM_NLIMITS: crate::rlim_t = 12; ++ ++pub const Q_GETQUOTA: c_int = 0x300; ++pub const Q_SETQUOTA: c_int = 0x400; ++ ++pub const CTL_UNSPEC: c_int = 0; ++pub const CTL_KERN: c_int = 1; ++pub const CTL_VM: c_int = 2; ++pub const CTL_VFS: c_int = 3; ++pub const CTL_NET: c_int = 4; ++pub const CTL_DEBUG: c_int = 5; ++pub const CTL_HW: c_int = 6; ++pub const CTL_MACHDEP: c_int = 7; ++pub const CTL_USER: c_int = 8; ++pub const CTL_P1003_1B: c_int = 9; ++pub const CTL_LWKT: c_int = 10; ++pub const CTL_MAXID: c_int = 11; ++pub const KERN_OSTYPE: c_int = 1; ++pub const KERN_OSRELEASE: c_int = 2; ++pub const KERN_OSREV: c_int = 3; ++pub const KERN_VERSION: c_int = 4; ++pub const KERN_MAXVNODES: c_int = 5; ++pub const KERN_MAXPROC: c_int = 6; ++pub const KERN_MAXFILES: c_int = 7; ++pub const KERN_ARGMAX: c_int = 8; ++pub const KERN_SECURELVL: c_int = 9; ++pub const KERN_HOSTNAME: c_int = 10; ++pub const KERN_HOSTID: c_int = 11; ++pub const KERN_CLOCKRATE: c_int = 12; ++pub const KERN_VNODE: c_int = 13; ++pub const KERN_PROC: c_int = 14; ++pub const KERN_FILE: c_int = 15; ++pub const KERN_PROF: c_int = 16; ++pub const KERN_POSIX1: c_int = 17; ++pub const KERN_NGROUPS: c_int = 18; ++pub const KERN_JOB_CONTROL: c_int = 19; ++pub const KERN_SAVED_IDS: c_int = 20; ++pub const KERN_BOOTTIME: c_int = 21; ++pub const KERN_NISDOMAINNAME: c_int = 22; ++pub const KERN_UPDATEINTERVAL: c_int = 23; ++pub const KERN_OSRELDATE: c_int = 24; ++pub const KERN_NTP_PLL: c_int = 25; ++pub const KERN_BOOTFILE: c_int = 26; ++pub const KERN_MAXFILESPERPROC: c_int = 27; ++pub const KERN_MAXPROCPERUID: c_int = 28; ++pub const KERN_DUMPDEV: c_int = 29; ++pub const KERN_IPC: c_int = 30; ++pub const KERN_DUMMY: c_int = 31; ++pub const KERN_PS_STRINGS: c_int = 32; ++pub const KERN_USRSTACK: c_int = 33; ++pub const KERN_LOGSIGEXIT: c_int = 34; ++pub const KERN_IOV_MAX: c_int = 35; ++pub const KERN_MAXPOSIXLOCKSPERUID: c_int = 36; ++pub const KERN_MAXID: c_int = 37; ++pub const KERN_PROC_ALL: c_int = 0; ++pub const KERN_PROC_PID: c_int = 1; ++pub const KERN_PROC_PGRP: c_int = 2; ++pub const KERN_PROC_SESSION: c_int = 3; ++pub const KERN_PROC_TTY: c_int = 4; ++pub const KERN_PROC_UID: c_int = 5; ++pub const KERN_PROC_RUID: c_int = 6; ++pub const KERN_PROC_ARGS: c_int = 7; ++pub const KERN_PROC_CWD: c_int = 8; ++pub const KERN_PROC_PATHNAME: c_int = 9; ++pub const KERN_PROC_FLAGMASK: c_int = 0x10; ++pub const KERN_PROC_FLAG_LWP: c_int = 0x10; ++pub const KIPC_MAXSOCKBUF: c_int = 1; ++pub const KIPC_SOCKBUF_WASTE: c_int = 2; ++pub const KIPC_SOMAXCONN: c_int = 3; ++pub const KIPC_MAX_LINKHDR: c_int = 4; ++pub const KIPC_MAX_PROTOHDR: c_int = 5; ++pub const KIPC_MAX_HDR: c_int = 6; ++pub const KIPC_MAX_DATALEN: c_int = 7; ++pub const KIPC_MBSTAT: c_int = 8; ++pub const KIPC_NMBCLUSTERS: c_int = 9; ++pub const HW_MACHINE: c_int = 1; ++pub const HW_MODEL: c_int = 2; ++pub const HW_NCPU: c_int = 3; ++pub const HW_BYTEORDER: c_int = 4; ++pub const HW_PHYSMEM: c_int = 5; ++pub const HW_USERMEM: c_int = 6; ++pub const HW_PAGESIZE: c_int = 7; ++pub const HW_DISKNAMES: c_int = 8; ++pub const HW_DISKSTATS: c_int = 9; ++pub const HW_FLOATINGPT: c_int = 10; ++pub const HW_MACHINE_ARCH: c_int = 11; ++pub const HW_MACHINE_PLATFORM: c_int = 12; ++pub const HW_SENSORS: c_int = 13; ++pub const HW_MAXID: c_int = 14; ++pub const USER_CS_PATH: c_int = 1; ++pub const USER_BC_BASE_MAX: c_int = 2; ++pub const USER_BC_DIM_MAX: c_int = 3; ++pub const USER_BC_SCALE_MAX: c_int = 4; ++pub const USER_BC_STRING_MAX: c_int = 5; ++pub const USER_COLL_WEIGHTS_MAX: c_int = 6; ++pub const USER_EXPR_NEST_MAX: c_int = 7; ++pub const USER_LINE_MAX: c_int = 8; ++pub const USER_RE_DUP_MAX: c_int = 9; ++pub const USER_POSIX2_VERSION: c_int = 10; ++pub const USER_POSIX2_C_BIND: c_int = 11; ++pub const USER_POSIX2_C_DEV: c_int = 12; ++pub const USER_POSIX2_CHAR_TERM: c_int = 13; ++pub const USER_POSIX2_FORT_DEV: c_int = 14; ++pub const USER_POSIX2_FORT_RUN: c_int = 15; ++pub const USER_POSIX2_LOCALEDEF: c_int = 16; ++pub const USER_POSIX2_SW_DEV: c_int = 17; ++pub const USER_POSIX2_UPE: c_int = 18; ++pub const USER_STREAM_MAX: c_int = 19; ++pub const USER_TZNAME_MAX: c_int = 20; ++pub const USER_MAXID: c_int = 21; ++pub const CTL_P1003_1B_ASYNCHRONOUS_IO: c_int = 1; ++pub const CTL_P1003_1B_MAPPED_FILES: c_int = 2; ++pub const CTL_P1003_1B_MEMLOCK: c_int = 3; ++pub const CTL_P1003_1B_MEMLOCK_RANGE: c_int = 4; ++pub const CTL_P1003_1B_MEMORY_PROTECTION: c_int = 5; ++pub const CTL_P1003_1B_MESSAGE_PASSING: c_int = 6; ++pub const CTL_P1003_1B_PRIORITIZED_IO: c_int = 7; ++pub const CTL_P1003_1B_PRIORITY_SCHEDULING: c_int = 8; ++pub const CTL_P1003_1B_REALTIME_SIGNALS: c_int = 9; ++pub const CTL_P1003_1B_SEMAPHORES: c_int = 10; ++pub const CTL_P1003_1B_FSYNC: c_int = 11; ++pub const CTL_P1003_1B_SHARED_MEMORY_OBJECTS: c_int = 12; ++pub const CTL_P1003_1B_SYNCHRONIZED_IO: c_int = 13; ++pub const CTL_P1003_1B_TIMERS: c_int = 14; ++pub const CTL_P1003_1B_AIO_LISTIO_MAX: c_int = 15; ++pub const CTL_P1003_1B_AIO_MAX: c_int = 16; ++pub const CTL_P1003_1B_AIO_PRIO_DELTA_MAX: c_int = 17; ++pub const CTL_P1003_1B_DELAYTIMER_MAX: c_int = 18; ++pub const CTL_P1003_1B_UNUSED1: c_int = 19; ++pub const CTL_P1003_1B_PAGESIZE: c_int = 20; ++pub const CTL_P1003_1B_RTSIG_MAX: c_int = 21; ++pub const CTL_P1003_1B_SEM_NSEMS_MAX: c_int = 22; ++pub const CTL_P1003_1B_SEM_VALUE_MAX: c_int = 23; ++pub const CTL_P1003_1B_SIGQUEUE_MAX: c_int = 24; ++pub const CTL_P1003_1B_TIMER_MAX: c_int = 25; ++pub const CTL_P1003_1B_MAXID: c_int = 26; ++ ++pub const CPUCTL_RSMSR: c_int = 0xc0106301; ++pub const CPUCTL_WRMSR: c_int = 0xc0106302; ++pub const CPUCTL_CPUID: c_int = 0xc0106303; ++pub const CPUCTL_UPDATE: c_int = 0xc0106304; ++pub const CPUCTL_MSRSBIT: c_int = 0xc0106305; ++pub const CPUCTL_MSRCBIT: c_int = 0xc0106306; ++pub const CPUCTL_CPUID_COUNT: c_int = 0xc0106307; ++ ++pub const CPU_SETSIZE: size_t = mem::size_of::() * 8; ++ ++pub const EVFILT_READ: i16 = -1; ++pub const EVFILT_WRITE: i16 = -2; ++pub const EVFILT_AIO: i16 = -3; ++pub const EVFILT_VNODE: i16 = -4; ++pub const EVFILT_PROC: i16 = -5; ++pub const EVFILT_SIGNAL: i16 = -6; ++pub const EVFILT_TIMER: i16 = -7; ++pub const EVFILT_EXCEPT: i16 = -8; ++pub const EVFILT_USER: i16 = -9; ++pub const EVFILT_FS: i16 = -10; ++ ++pub const EV_ADD: u16 = 0x1; ++pub const EV_DELETE: u16 = 0x2; ++pub const EV_ENABLE: u16 = 0x4; ++pub const EV_DISABLE: u16 = 0x8; ++pub const EV_ONESHOT: u16 = 0x10; ++pub const EV_CLEAR: u16 = 0x20; ++pub const EV_RECEIPT: u16 = 0x40; ++pub const EV_DISPATCH: u16 = 0x80; ++pub const EV_NODATA: u16 = 0x1000; ++pub const EV_FLAG1: u16 = 0x2000; ++pub const EV_ERROR: u16 = 0x4000; ++pub const EV_EOF: u16 = 0x8000; ++pub const EV_HUP: u16 = 0x8000; ++pub const EV_SYSFLAGS: u16 = 0xf000; ++ ++pub const FIODNAME: c_ulong = 0x80106678; ++ ++pub const NOTE_TRIGGER: u32 = 0x01000000; ++pub const NOTE_FFNOP: u32 = 0x00000000; ++pub const NOTE_FFAND: u32 = 0x40000000; ++pub const NOTE_FFOR: u32 = 0x80000000; ++pub const NOTE_FFCOPY: u32 = 0xc0000000; ++pub const NOTE_FFCTRLMASK: u32 = 0xc0000000; ++pub const NOTE_FFLAGSMASK: u32 = 0x00ffffff; ++pub const NOTE_LOWAT: u32 = 0x00000001; ++pub const NOTE_OOB: u32 = 0x00000002; ++pub const NOTE_DELETE: u32 = 0x00000001; ++pub const NOTE_WRITE: u32 = 0x00000002; ++pub const NOTE_EXTEND: u32 = 0x00000004; ++pub const NOTE_ATTRIB: u32 = 0x00000008; ++pub const NOTE_LINK: u32 = 0x00000010; ++pub const NOTE_RENAME: u32 = 0x00000020; ++pub const NOTE_REVOKE: u32 = 0x00000040; ++pub const NOTE_EXIT: u32 = 0x80000000; ++pub const NOTE_FORK: u32 = 0x40000000; ++pub const NOTE_EXEC: u32 = 0x20000000; ++pub const NOTE_PDATAMASK: u32 = 0x000fffff; ++pub const NOTE_PCTRLMASK: u32 = 0xf0000000; ++pub const NOTE_TRACK: u32 = 0x00000001; ++pub const NOTE_TRACKERR: u32 = 0x00000002; ++pub const NOTE_CHILD: u32 = 0x00000004; ++ ++pub const SO_SNDSPACE: c_int = 0x100a; ++pub const SO_CPUHINT: c_int = 0x1030; ++pub const SO_PASSCRED: c_int = 0x4000; ++ ++pub const PT_FIRSTMACH: c_int = 32; ++ ++pub const PROC_REAP_ACQUIRE: c_int = 0x0001; ++pub const PROC_REAP_RELEASE: c_int = 0x0002; ++pub const PROC_REAP_STATUS: c_int = 0x0003; ++pub const PROC_PDEATHSIG_CTL: c_int = 0x0004; ++pub const PROC_PDEATHSIG_STATUS: c_int = 0x0005; ++ ++// https://github.com/DragonFlyBSD/DragonFlyBSD/blob/HEAD/sys/net/if.h#L101 ++pub const IFF_UP: c_int = 0x1; // interface is up ++pub const IFF_BROADCAST: c_int = 0x2; // broadcast address valid ++pub const IFF_DEBUG: c_int = 0x4; // turn on debugging ++pub const IFF_LOOPBACK: c_int = 0x8; // is a loopback net ++pub const IFF_POINTOPOINT: c_int = 0x10; // interface is point-to-point link ++pub const IFF_SMART: c_int = 0x20; // interface manages own routes ++pub const IFF_RUNNING: c_int = 0x40; // resources allocated ++pub const IFF_NOARP: c_int = 0x80; // no address resolution protocol ++pub const IFF_PROMISC: c_int = 0x100; // receive all packets ++pub const IFF_ALLMULTI: c_int = 0x200; // receive all multicast packets ++pub const IFF_OACTIVE_COMPAT: c_int = 0x400; // was transmission in progress ++pub const IFF_SIMPLEX: c_int = 0x800; // can't hear own transmissions ++pub const IFF_LINK0: c_int = 0x1000; // per link layer defined bit ++pub const IFF_LINK1: c_int = 0x2000; // per link layer defined bit ++pub const IFF_LINK2: c_int = 0x4000; // per link layer defined bit ++pub const IFF_ALTPHYS: c_int = IFF_LINK2; // use alternate physical connection ++pub const IFF_MULTICAST: c_int = 0x8000; // supports multicast ++ // was interface is in polling mode ++pub const IFF_POLLING_COMPAT: c_int = 0x10000; ++pub const IFF_PPROMISC: c_int = 0x20000; // user-requested promisc mode ++pub const IFF_MONITOR: c_int = 0x40000; // user-requested monitor mode ++pub const IFF_STATICARP: c_int = 0x80000; // static ARP ++pub const IFF_NPOLLING: c_int = 0x100000; // interface is in polling mode ++pub const IFF_IDIRECT: c_int = 0x200000; // direct input ++ ++// ++// sys/netinet/in.h ++// Protocols (RFC 1700) ++// NOTE: These are in addition to the constants defined in src/unix/mod.rs ++ ++// IPPROTO_IP defined in src/unix/mod.rs ++/// IP6 hop-by-hop options ++pub const IPPROTO_HOPOPTS: c_int = 0; ++// IPPROTO_ICMP defined in src/unix/mod.rs ++/// group mgmt protocol ++pub const IPPROTO_IGMP: c_int = 2; ++/// gateway^2 (deprecated) ++pub const IPPROTO_GGP: c_int = 3; ++/// for compatibility ++pub const IPPROTO_IPIP: c_int = 4; ++// IPPROTO_TCP defined in src/unix/mod.rs ++/// Stream protocol II. ++pub const IPPROTO_ST: c_int = 7; ++/// exterior gateway protocol ++pub const IPPROTO_EGP: c_int = 8; ++/// private interior gateway ++pub const IPPROTO_PIGP: c_int = 9; ++/// BBN RCC Monitoring ++pub const IPPROTO_RCCMON: c_int = 10; ++/// network voice protocol ++pub const IPPROTO_NVPII: c_int = 11; ++/// pup ++pub const IPPROTO_PUP: c_int = 12; ++/// Argus ++pub const IPPROTO_ARGUS: c_int = 13; ++/// EMCON ++pub const IPPROTO_EMCON: c_int = 14; ++/// Cross Net Debugger ++pub const IPPROTO_XNET: c_int = 15; ++/// Chaos ++pub const IPPROTO_CHAOS: c_int = 16; ++// IPPROTO_UDP defined in src/unix/mod.rs ++/// Multiplexing ++pub const IPPROTO_MUX: c_int = 18; ++/// DCN Measurement Subsystems ++pub const IPPROTO_MEAS: c_int = 19; ++/// Host Monitoring ++pub const IPPROTO_HMP: c_int = 20; ++/// Packet Radio Measurement ++pub const IPPROTO_PRM: c_int = 21; ++/// xns idp ++pub const IPPROTO_IDP: c_int = 22; ++/// Trunk-1 ++pub const IPPROTO_TRUNK1: c_int = 23; ++/// Trunk-2 ++pub const IPPROTO_TRUNK2: c_int = 24; ++/// Leaf-1 ++pub const IPPROTO_LEAF1: c_int = 25; ++/// Leaf-2 ++pub const IPPROTO_LEAF2: c_int = 26; ++/// Reliable Data ++pub const IPPROTO_RDP: c_int = 27; ++/// Reliable Transaction ++pub const IPPROTO_IRTP: c_int = 28; ++/// tp-4 w/ class negotiation ++pub const IPPROTO_TP: c_int = 29; ++/// Bulk Data Transfer ++pub const IPPROTO_BLT: c_int = 30; ++/// Network Services ++pub const IPPROTO_NSP: c_int = 31; ++/// Merit Internodal ++pub const IPPROTO_INP: c_int = 32; ++/// Sequential Exchange ++pub const IPPROTO_SEP: c_int = 33; ++/// Third Party Connect ++pub const IPPROTO_3PC: c_int = 34; ++/// InterDomain Policy Routing ++pub const IPPROTO_IDPR: c_int = 35; ++/// XTP ++pub const IPPROTO_XTP: c_int = 36; ++/// Datagram Delivery ++pub const IPPROTO_DDP: c_int = 37; ++/// Control Message Transport ++pub const IPPROTO_CMTP: c_int = 38; ++/// TP++ Transport ++pub const IPPROTO_TPXX: c_int = 39; ++/// IL transport protocol ++pub const IPPROTO_IL: c_int = 40; ++// IPPROTO_IPV6 defined in src/unix/mod.rs ++/// Source Demand Routing ++pub const IPPROTO_SDRP: c_int = 42; ++/// IP6 routing header ++pub const IPPROTO_ROUTING: c_int = 43; ++/// IP6 fragmentation header ++pub const IPPROTO_FRAGMENT: c_int = 44; ++/// InterDomain Routing ++pub const IPPROTO_IDRP: c_int = 45; ++/// resource reservation ++pub const IPPROTO_RSVP: c_int = 46; ++/// General Routing Encap. ++pub const IPPROTO_GRE: c_int = 47; ++/// Mobile Host Routing ++pub const IPPROTO_MHRP: c_int = 48; ++/// BHA ++pub const IPPROTO_BHA: c_int = 49; ++/// IP6 Encap Sec. Payload ++pub const IPPROTO_ESP: c_int = 50; ++/// IP6 Auth Header ++pub const IPPROTO_AH: c_int = 51; ++/// Integ. Net Layer Security ++pub const IPPROTO_INLSP: c_int = 52; ++/// IP with encryption ++pub const IPPROTO_SWIPE: c_int = 53; ++/// Next Hop Resolution ++pub const IPPROTO_NHRP: c_int = 54; ++/// IP Mobility ++pub const IPPROTO_MOBILE: c_int = 55; ++/// Transport Layer Security ++pub const IPPROTO_TLSP: c_int = 56; ++/// SKIP ++pub const IPPROTO_SKIP: c_int = 57; ++// IPPROTO_ICMPV6 defined in src/unix/mod.rs ++/// IP6 no next header ++pub const IPPROTO_NONE: c_int = 59; ++/// IP6 destination option ++pub const IPPROTO_DSTOPTS: c_int = 60; ++/// any host internal protocol ++pub const IPPROTO_AHIP: c_int = 61; ++/// CFTP ++pub const IPPROTO_CFTP: c_int = 62; ++/// "hello" routing protocol ++pub const IPPROTO_HELLO: c_int = 63; ++/// SATNET/Backroom EXPAK ++pub const IPPROTO_SATEXPAK: c_int = 64; ++/// Kryptolan ++pub const IPPROTO_KRYPTOLAN: c_int = 65; ++/// Remote Virtual Disk ++pub const IPPROTO_RVD: c_int = 66; ++/// Pluribus Packet Core ++pub const IPPROTO_IPPC: c_int = 67; ++/// Any distributed FS ++pub const IPPROTO_ADFS: c_int = 68; ++/// Satnet Monitoring ++pub const IPPROTO_SATMON: c_int = 69; ++/// VISA Protocol ++pub const IPPROTO_VISA: c_int = 70; ++/// Packet Core Utility ++pub const IPPROTO_IPCV: c_int = 71; ++/// Comp. Prot. Net. Executive ++pub const IPPROTO_CPNX: c_int = 72; ++/// Comp. Prot. HeartBeat ++pub const IPPROTO_CPHB: c_int = 73; ++/// Wang Span Network ++pub const IPPROTO_WSN: c_int = 74; ++/// Packet Video Protocol ++pub const IPPROTO_PVP: c_int = 75; ++/// BackRoom SATNET Monitoring ++pub const IPPROTO_BRSATMON: c_int = 76; ++/// Sun net disk proto (temp.) ++pub const IPPROTO_ND: c_int = 77; ++/// WIDEBAND Monitoring ++pub const IPPROTO_WBMON: c_int = 78; ++/// WIDEBAND EXPAK ++pub const IPPROTO_WBEXPAK: c_int = 79; ++/// ISO cnlp ++pub const IPPROTO_EON: c_int = 80; ++/// VMTP ++pub const IPPROTO_VMTP: c_int = 81; ++/// Secure VMTP ++pub const IPPROTO_SVMTP: c_int = 82; ++/// Banyon VINES ++pub const IPPROTO_VINES: c_int = 83; ++/// TTP ++pub const IPPROTO_TTP: c_int = 84; ++/// NSFNET-IGP ++pub const IPPROTO_IGP: c_int = 85; ++/// dissimilar gateway prot. ++pub const IPPROTO_DGP: c_int = 86; ++/// TCF ++pub const IPPROTO_TCF: c_int = 87; ++/// Cisco/GXS IGRP ++pub const IPPROTO_IGRP: c_int = 88; ++/// OSPFIGP ++pub const IPPROTO_OSPFIGP: c_int = 89; ++/// Strite RPC protocol ++pub const IPPROTO_SRPC: c_int = 90; ++/// Locus Address Resoloution ++pub const IPPROTO_LARP: c_int = 91; ++/// Multicast Transport ++pub const IPPROTO_MTP: c_int = 92; ++/// AX.25 Frames ++pub const IPPROTO_AX25: c_int = 93; ++/// IP encapsulated in IP ++pub const IPPROTO_IPEIP: c_int = 94; ++/// Mobile Int.ing control ++pub const IPPROTO_MICP: c_int = 95; ++/// Semaphore Comm. security ++pub const IPPROTO_SCCSP: c_int = 96; ++/// Ethernet IP encapsulation ++pub const IPPROTO_ETHERIP: c_int = 97; ++/// encapsulation header ++pub const IPPROTO_ENCAP: c_int = 98; ++/// any private encr. scheme ++pub const IPPROTO_APES: c_int = 99; ++/// GMTP ++pub const IPPROTO_GMTP: c_int = 100; ++/// payload compression (IPComp) ++pub const IPPROTO_IPCOMP: c_int = 108; ++ ++/* 101-254: Partly Unassigned */ ++/// Protocol Independent Mcast ++pub const IPPROTO_PIM: c_int = 103; ++/// CARP ++pub const IPPROTO_CARP: c_int = 112; ++/// PGM ++pub const IPPROTO_PGM: c_int = 113; ++/// PFSYNC ++pub const IPPROTO_PFSYNC: c_int = 240; ++ ++/* 255: Reserved */ ++/* BSD Private, local use, namespace incursion, no longer used */ ++/// divert pseudo-protocol ++pub const IPPROTO_DIVERT: c_int = 254; ++pub const IPPROTO_MAX: c_int = 256; ++/// last return value of *_input(), meaning "all job for this pkt is done". ++pub const IPPROTO_DONE: c_int = 257; ++ ++/// Used by RSS: the layer3 protocol is unknown ++pub const IPPROTO_UNKNOWN: c_int = 258; ++ ++// sys/netinet/tcp.h ++pub const TCP_SIGNATURE_ENABLE: c_int = 16; ++pub const TCP_KEEPINIT: c_int = 32; ++pub const TCP_FASTKEEP: c_int = 128; ++ ++pub const AF_BLUETOOTH: c_int = 33; ++pub const AF_MPLS: c_int = 34; ++pub const AF_IEEE80211: c_int = 35; ++ ++pub const PF_BLUETOOTH: c_int = AF_BLUETOOTH; ++ ++pub const NET_RT_DUMP: c_int = 1; ++pub const NET_RT_FLAGS: c_int = 2; ++pub const NET_RT_IFLIST: c_int = 3; ++pub const NET_RT_MAXID: c_int = 4; ++ ++pub const SOMAXOPT_SIZE: c_int = 65536; ++ ++pub const MSG_UNUSED09: c_int = 0x00000200; ++pub const MSG_NOSIGNAL: c_int = 0x00000400; ++pub const MSG_SYNC: c_int = 0x00000800; ++pub const MSG_CMSG_CLOEXEC: c_int = 0x00001000; ++pub const MSG_FBLOCKING: c_int = 0x00010000; ++pub const MSG_FNONBLOCKING: c_int = 0x00020000; ++pub const MSG_FMASK: c_int = 0xFFFF0000; ++ ++// sys/mount.h ++pub const MNT_NODEV: c_int = 0x00000010; ++pub const MNT_AUTOMOUNTED: c_int = 0x00000020; ++pub const MNT_TRIM: c_int = 0x01000000; ++pub const MNT_LOCAL: c_int = 0x00001000; ++pub const MNT_QUOTA: c_int = 0x00002000; ++pub const MNT_ROOTFS: c_int = 0x00004000; ++pub const MNT_USER: c_int = 0x00008000; ++pub const MNT_IGNORE: c_int = 0x00800000; ++ ++// utmpx entry types ++pub const EMPTY: c_short = 0; ++pub const RUN_LVL: c_short = 1; ++pub const BOOT_TIME: c_short = 2; ++pub const OLD_TIME: c_short = 3; ++pub const NEW_TIME: c_short = 4; ++pub const INIT_PROCESS: c_short = 5; ++pub const LOGIN_PROCESS: c_short = 6; ++pub const USER_PROCESS: c_short = 7; ++pub const DEAD_PROCESS: c_short = 8; ++pub const ACCOUNTING: c_short = 9; ++pub const SIGNATURE: c_short = 10; ++pub const DOWNTIME: c_short = 11; ++// utmpx database types ++pub const UTX_DB_UTMPX: c_uint = 0; ++pub const UTX_DB_WTMPX: c_uint = 1; ++pub const UTX_DB_LASTLOG: c_uint = 2; ++pub const _UTX_LINESIZE: usize = 32; ++pub const _UTX_USERSIZE: usize = 32; ++pub const _UTX_IDSIZE: usize = 4; ++pub const _UTX_HOSTSIZE: usize = 256; ++ ++pub const LC_COLLATE_MASK: c_int = 1 << 0; ++pub const LC_CTYPE_MASK: c_int = 1 << 1; ++pub const LC_MONETARY_MASK: c_int = 1 << 2; ++pub const LC_NUMERIC_MASK: c_int = 1 << 3; ++pub const LC_TIME_MASK: c_int = 1 << 4; ++pub const LC_MESSAGES_MASK: c_int = 1 << 5; ++pub const LC_ALL_MASK: c_int = LC_COLLATE_MASK ++ | LC_CTYPE_MASK ++ | LC_MESSAGES_MASK ++ | LC_MONETARY_MASK ++ | LC_NUMERIC_MASK ++ | LC_TIME_MASK; ++ ++pub const TIOCSIG: c_ulong = 0x2000745f; ++pub const BTUARTDISC: c_int = 0x7; ++pub const TIOCDCDTIMESTAMP: c_ulong = 0x40107458; ++pub const TIOCISPTMASTER: c_ulong = 0x20007455; ++pub const TIOCMODG: c_ulong = 0x40047403; ++pub const TIOCMODS: c_ulong = 0x80047404; ++pub const TIOCREMOTE: c_ulong = 0x80047469; ++pub const TIOCTIMESTAMP: c_ulong = 0x40107459; ++ ++// Constants used by "at" family of system calls. ++pub const AT_FDCWD: c_int = 0xFFFAFDCD; // invalid file descriptor ++pub const AT_SYMLINK_NOFOLLOW: c_int = 1; ++pub const AT_REMOVEDIR: c_int = 2; ++pub const AT_EACCESS: c_int = 4; ++pub const AT_SYMLINK_FOLLOW: c_int = 8; ++ ++pub const VCHECKPT: usize = 19; ++ ++pub const _PC_2_SYMLINKS: c_int = 22; ++pub const _PC_TIMESTAMP_RESOLUTION: c_int = 23; ++ ++pub const _SC_V7_ILP32_OFF32: c_int = 122; ++pub const _SC_V7_ILP32_OFFBIG: c_int = 123; ++pub const _SC_V7_LP64_OFF64: c_int = 124; ++pub const _SC_V7_LPBIG_OFFBIG: c_int = 125; ++pub const _SC_THREAD_ROBUST_PRIO_INHERIT: c_int = 126; ++pub const _SC_THREAD_ROBUST_PRIO_PROTECT: c_int = 127; ++ ++pub const WCONTINUED: c_int = 0x4; ++pub const WSTOPPED: c_int = 0x2; ++pub const WNOWAIT: c_int = 0x8; ++pub const WEXITED: c_int = 0x10; ++pub const WTRAPPED: c_int = 0x20; ++ ++// Similar to FreeBSD, only the standardized ones are exposed. ++// There are more. ++pub const P_PID: idtype_t = 0; ++pub const P_PGID: idtype_t = 2; ++pub const P_ALL: idtype_t = 7; ++ ++// Values for struct rtprio (type_ field) ++pub const RTP_PRIO_REALTIME: c_ushort = 0; ++pub const RTP_PRIO_NORMAL: c_ushort = 1; ++pub const RTP_PRIO_IDLE: c_ushort = 2; ++pub const RTP_PRIO_THREAD: c_ushort = 3; ++ ++// Flags for chflags(2) ++pub const UF_NOHISTORY: c_ulong = 0x00000040; ++pub const UF_CACHE: c_ulong = 0x00000080; ++pub const UF_XLINK: c_ulong = 0x00000100; ++pub const SF_NOHISTORY: c_ulong = 0x00400000; ++pub const SF_CACHE: c_ulong = 0x00800000; ++pub const SF_XLINK: c_ulong = 0x01000000; ++ ++// timespec constants ++pub const UTIME_OMIT: c_long = -2; ++pub const UTIME_NOW: c_long = -1; ++ ++pub const MINCORE_SUPER: c_int = 0x20; ++ ++// kinfo_proc constants ++pub const MAXCOMLEN: usize = 16; ++pub const MAXLOGNAME: usize = 33; ++pub const NGROUPS: usize = 16; ++ ++pub const RB_PAUSE: c_int = 0x40000; ++pub const RB_VIDEO: c_int = 0x20000000; ++ ++// net/route.h ++pub const RTF_CLONING: c_int = 0x100; ++pub const RTF_PRCLONING: c_int = 0x10000; ++pub const RTF_WASCLONED: c_int = 0x20000; ++pub const RTF_MPLSOPS: c_int = 0x1000000; ++ ++pub const RTM_VERSION: c_int = 7; ++ ++pub const RTAX_MPLS1: c_int = 8; ++pub const RTAX_MPLS2: c_int = 9; ++pub const RTAX_MPLS3: c_int = 10; ++pub const RTAX_MAX: c_int = 11; ++ ++const_fn! { ++ {const} fn _CMSG_ALIGN(n: usize) -> usize { ++ (n + (mem::size_of::() - 1)) & !(mem::size_of::() - 1) ++ } ++} ++ ++f! { ++ pub fn CMSG_DATA(cmsg: *const cmsghdr) -> *mut c_uchar { ++ (cmsg as *mut c_uchar).offset(_CMSG_ALIGN(mem::size_of::()) as isize) ++ } ++ ++ pub {const} fn CMSG_LEN(length: c_uint) -> c_uint { ++ (_CMSG_ALIGN(mem::size_of::()) + length as usize) as c_uint ++ } ++ ++ pub fn CMSG_NXTHDR(mhdr: *const crate::msghdr, cmsg: *const cmsghdr) -> *mut cmsghdr { ++ let next = cmsg as usize ++ + _CMSG_ALIGN((*cmsg).cmsg_len as usize) ++ + _CMSG_ALIGN(mem::size_of::()); ++ let max = (*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize; ++ if next <= max { ++ (cmsg as usize + _CMSG_ALIGN((*cmsg).cmsg_len as usize)) as *mut cmsghdr ++ } else { ++ 0 as *mut cmsghdr ++ } ++ } ++ ++ pub {const} fn CMSG_SPACE(length: c_uint) -> c_uint { ++ (_CMSG_ALIGN(mem::size_of::()) + _CMSG_ALIGN(length as usize)) as c_uint ++ } ++ ++ pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () { ++ for slot in cpuset.ary.iter_mut() { ++ *slot = 0; ++ } ++ } ++ ++ pub fn CPU_SET(cpu: usize, cpuset: &mut cpu_set_t) -> () { ++ let (idx, offset) = ((cpu >> 6) & 3, cpu & 63); ++ cpuset.ary[idx] |= 1 << offset; ++ () ++ } ++ ++ pub fn CPU_CLR(cpu: usize, cpuset: &mut cpu_set_t) -> () { ++ let (idx, offset) = ((cpu >> 6) & 3, cpu & 63); ++ cpuset.ary[idx] &= !(1 << offset); ++ () ++ } ++ ++ pub fn CPU_ISSET(cpu: usize, cpuset: &cpu_set_t) -> bool { ++ let (idx, offset) = ((cpu >> 6) & 3, cpu & 63); ++ 0 != cpuset.ary[idx] & (1 << offset) ++ } ++ ++ pub fn major(dev: crate::dev_t) -> c_int { ++ ((dev >> 8) & 0xff) as c_int ++ } ++ ++ pub fn minor(dev: crate::dev_t) -> c_int { ++ (dev & 0xffff00ff) as c_int ++ } ++} ++ ++safe_f! { ++ pub {const} fn WIFSIGNALED(status: c_int) -> bool { ++ (status & 0o177) != 0o177 && (status & 0o177) != 0 ++ } ++ ++ pub {const} fn makedev(major: c_uint, minor: c_uint) -> crate::dev_t { ++ let major = major as crate::dev_t; ++ let minor = minor as crate::dev_t; ++ let mut dev = 0; ++ dev |= major << 8; ++ dev |= minor; ++ dev ++ } ++} ++ ++extern "C" { ++ pub fn __errno_location() -> *mut c_int; ++ pub fn setgrent(); ++ pub fn mprotect(addr: *mut c_void, len: size_t, prot: c_int) -> c_int; ++ ++ pub fn setutxdb(_type: c_uint, file: *mut c_char) -> c_int; ++ ++ pub fn aio_waitcomplete(iocbp: *mut *mut aiocb, timeout: *mut crate::timespec) -> c_int; ++ ++ pub fn devname_r( ++ dev: crate::dev_t, ++ mode: crate::mode_t, ++ buf: *mut c_char, ++ len: size_t, ++ ) -> *mut c_char; ++ ++ pub fn waitid( ++ idtype: idtype_t, ++ id: crate::id_t, ++ infop: *mut crate::siginfo_t, ++ options: c_int, ++ ) -> c_int; ++ ++ pub fn freelocale(loc: crate::locale_t); ++ ++ pub fn lwp_rtprio( ++ function: c_int, ++ pid: crate::pid_t, ++ lwpid: lwpid_t, ++ rtp: *mut super::rtprio, ++ ) -> c_int; ++ ++ pub fn statfs(path: *const c_char, buf: *mut statfs) -> c_int; ++ pub fn fstatfs(fd: c_int, buf: *mut statfs) -> c_int; ++ pub fn uname(buf: *mut crate::utsname) -> c_int; ++ pub fn memmem( ++ haystack: *const c_void, ++ haystacklen: size_t, ++ needle: *const c_void, ++ needlelen: size_t, ++ ) -> *mut c_void; ++ pub fn pthread_spin_init(lock: *mut pthread_spinlock_t, pshared: c_int) -> c_int; ++ pub fn pthread_spin_destroy(lock: *mut pthread_spinlock_t) -> c_int; ++ pub fn pthread_spin_lock(lock: *mut pthread_spinlock_t) -> c_int; ++ pub fn pthread_spin_trylock(lock: *mut pthread_spinlock_t) -> c_int; ++ pub fn pthread_spin_unlock(lock: *mut pthread_spinlock_t) -> c_int; ++ ++ pub fn sched_getaffinity(pid: crate::pid_t, cpusetsize: size_t, mask: *mut cpu_set_t) -> c_int; ++ pub fn sched_setaffinity( ++ pid: crate::pid_t, ++ cpusetsize: size_t, ++ mask: *const cpu_set_t, ++ ) -> c_int; ++ pub fn sched_getcpu() -> c_int; ++ pub fn setproctitle(fmt: *const c_char, ...); ++ ++ pub fn shmget(key: crate::key_t, size: size_t, shmflg: c_int) -> c_int; ++ pub fn shmat(shmid: c_int, shmaddr: *const c_void, shmflg: c_int) -> *mut c_void; ++ pub fn shmdt(shmaddr: *const c_void) -> c_int; ++ pub fn shmctl(shmid: c_int, cmd: c_int, buf: *mut crate::shmid_ds) -> c_int; ++ pub fn procctl( ++ idtype: crate::idtype_t, ++ id: crate::id_t, ++ cmd: c_int, ++ data: *mut c_void, ++ ) -> c_int; ++ ++ pub fn updwtmpx(file: *const c_char, ut: *const utmpx) -> c_int; ++ pub fn getlastlogx(fname: *const c_char, uid: crate::uid_t, ll: *mut lastlogx) ++ -> *mut lastlogx; ++ pub fn updlastlogx(fname: *const c_char, uid: crate::uid_t, ll: *mut lastlogx) -> c_int; ++ pub fn getutxuser(name: *const c_char) -> utmpx; ++ pub fn utmpxname(file: *const c_char) -> c_int; ++ ++ pub fn sys_checkpoint(tpe: c_int, fd: c_int, pid: crate::pid_t, retval: c_int) -> c_int; ++ ++ pub fn umtx_sleep(ptr: *const c_int, value: c_int, timeout: c_int) -> c_int; ++ pub fn umtx_wakeup(ptr: *const c_int, count: c_int) -> c_int; ++ ++ pub fn dirname(path: *mut c_char) -> *mut c_char; ++ pub fn basename(path: *mut c_char) -> *mut c_char; ++ pub fn getmntinfo(mntbufp: *mut *mut crate::statfs, flags: c_int) -> c_int; ++ pub fn getmntvinfo( ++ mntbufp: *mut *mut crate::statfs, ++ mntvbufp: *mut *mut crate::statvfs, ++ flags: c_int, ++ ) -> c_int; ++} ++ ++#[link(name = "rt")] ++extern "C" { ++ pub fn aio_cancel(fd: c_int, aiocbp: *mut aiocb) -> c_int; ++ pub fn aio_error(aiocbp: *const aiocb) -> c_int; ++ pub fn aio_fsync(op: c_int, aiocbp: *mut aiocb) -> c_int; ++ pub fn aio_read(aiocbp: *mut aiocb) -> c_int; ++ pub fn aio_return(aiocbp: *mut aiocb) -> ssize_t; ++ pub fn aio_suspend( ++ aiocb_list: *const *const aiocb, ++ nitems: c_int, ++ timeout: *const crate::timespec, ++ ) -> c_int; ++ pub fn aio_write(aiocbp: *mut aiocb) -> c_int; ++ pub fn lio_listio( ++ mode: c_int, ++ aiocb_list: *const *mut aiocb, ++ nitems: c_int, ++ sevp: *mut sigevent, ++ ) -> c_int; ++ ++ pub fn reallocf(ptr: *mut c_void, size: size_t) -> *mut c_void; ++ pub fn freezero(ptr: *mut c_void, size: size_t); ++} ++ ++#[link(name = "kvm")] ++extern "C" { ++ pub fn kvm_vm_map_entry_first( ++ kvm: *mut crate::kvm_t, ++ map: vm_map_t, ++ entry: vm_map_entry_t, ++ ) -> vm_map_entry_t; ++ pub fn kvm_vm_map_entry_next( ++ kvm: *mut crate::kvm_t, ++ map: vm_map_entry_t, ++ entry: vm_map_entry_t, ++ ) -> vm_map_entry_t; ++} ++ ++// DIFF(main): module removed in de76fee6 ++cfg_if! { ++ if #[cfg(libc_thread_local)] { ++ mod errno; ++ pub use self::errno::*; ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/aarch64.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/aarch64.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/aarch64.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/aarch64.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,147 @@ ++use crate::prelude::*; ++ ++pub type c_char = u8; ++pub type c_long = i64; ++pub type c_ulong = u64; ++pub type clock_t = i32; ++pub type wchar_t = u32; ++pub type time_t = i64; ++pub type suseconds_t = i64; ++pub type register_t = i64; ++ ++s_no_extra_traits! { ++ pub struct gpregs { ++ pub gp_x: [crate::register_t; 30], ++ pub gp_lr: crate::register_t, ++ pub gp_sp: crate::register_t, ++ pub gp_elr: crate::register_t, ++ pub gp_spsr: u32, ++ pub gp_pad: c_int, ++ } ++ ++ pub struct fpregs { ++ pub fp_q: u128, ++ pub fp_sr: u32, ++ pub fp_cr: u32, ++ pub fp_flags: c_int, ++ pub fp_pad: c_int, ++ } ++ ++ pub struct mcontext_t { ++ pub mc_gpregs: gpregs, ++ pub mc_fpregs: fpregs, ++ pub mc_flags: c_int, ++ pub mc_pad: c_int, ++ pub mc_spare: [u64; 8], ++ } ++} ++ ++pub(crate) const _ALIGNBYTES: usize = mem::size_of::() - 1; ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for gpregs { ++ fn eq(&self, other: &gpregs) -> bool { ++ self.gp_x.iter().zip(other.gp_x.iter()).all(|(a, b)| a == b) ++ && self.gp_lr == other.gp_lr ++ && self.gp_sp == other.gp_sp ++ && self.gp_elr == other.gp_elr ++ && self.gp_spsr == other.gp_spsr ++ && self.gp_pad == other.gp_pad ++ } ++ } ++ impl Eq for gpregs {} ++ impl fmt::Debug for gpregs { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("gpregs") ++ .field("gp_x", &self.gp_x) ++ .field("gp_lr", &self.gp_lr) ++ .field("gp_sp", &self.gp_sp) ++ .field("gp_elr", &self.gp_elr) ++ .field("gp_spsr", &self.gp_spsr) ++ .field("gp_pad", &self.gp_pad) ++ .finish() ++ } ++ } ++ impl hash::Hash for gpregs { ++ fn hash(&self, state: &mut H) { ++ self.gp_x.hash(state); ++ self.gp_lr.hash(state); ++ self.gp_sp.hash(state); ++ self.gp_elr.hash(state); ++ self.gp_spsr.hash(state); ++ self.gp_pad.hash(state); ++ } ++ } ++ impl PartialEq for fpregs { ++ fn eq(&self, other: &fpregs) -> bool { ++ self.fp_q == other.fp_q ++ && self.fp_sr == other.fp_sr ++ && self.fp_cr == other.fp_cr ++ && self.fp_flags == other.fp_flags ++ && self.fp_pad == other.fp_pad ++ } ++ } ++ impl Eq for fpregs {} ++ impl fmt::Debug for fpregs { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("fpregs") ++ .field("fp_q", &self.fp_q) ++ .field("fp_sr", &self.fp_sr) ++ .field("fp_cr", &self.fp_cr) ++ .field("fp_flags", &self.fp_flags) ++ .field("fp_pad", &self.fp_pad) ++ .finish() ++ } ++ } ++ impl hash::Hash for fpregs { ++ fn hash(&self, state: &mut H) { ++ self.fp_q.hash(state); ++ self.fp_sr.hash(state); ++ self.fp_cr.hash(state); ++ self.fp_flags.hash(state); ++ self.fp_pad.hash(state); ++ } ++ } ++ impl PartialEq for mcontext_t { ++ fn eq(&self, other: &mcontext_t) -> bool { ++ self.mc_gpregs == other.mc_gpregs ++ && self.mc_fpregs == other.mc_fpregs ++ && self.mc_flags == other.mc_flags ++ && self.mc_pad == other.mc_pad ++ && self ++ .mc_spare ++ .iter() ++ .zip(other.mc_spare.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for mcontext_t {} ++ impl fmt::Debug for mcontext_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("mcontext_t") ++ .field("mc_gpregs", &self.mc_gpregs) ++ .field("mc_fpregs", &self.mc_fpregs) ++ .field("mc_flags", &self.mc_flags) ++ .field("mc_pad", &self.mc_pad) ++ .field("mc_spare", &self.mc_spare) ++ .finish() ++ } ++ } ++ impl hash::Hash for mcontext_t { ++ fn hash(&self, state: &mut H) { ++ self.mc_gpregs.hash(state); ++ self.mc_fpregs.hash(state); ++ self.mc_flags.hash(state); ++ self.mc_pad.hash(state); ++ self.mc_spare.hash(state); ++ } ++ } ++ } ++} ++ ++pub const BIOCSRTIMEOUT: c_ulong = 0x8010426d; ++pub const BIOCGRTIMEOUT: c_ulong = 0x4010426e; ++pub const MAP_32BIT: c_int = 0x00080000; ++pub const MINSIGSTKSZ: size_t = 4096; // 1024 * 4 ++pub const TIOCTIMESTAMP: c_ulong = 0x40107459; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/arm.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/arm.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/arm.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/arm.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,66 @@ ++use crate::prelude::*; ++ ++pub type c_char = u8; ++pub type c_long = i32; ++pub type c_ulong = u32; ++pub type clock_t = u32; ++pub type wchar_t = u32; ++pub type time_t = i64; ++pub type suseconds_t = i32; ++pub type register_t = i32; ++pub type __greg_t = c_uint; ++pub type __gregset_t = [crate::__greg_t; 17]; ++ ++s_no_extra_traits! { ++ pub struct mcontext_t { ++ pub __gregs: crate::__gregset_t, ++ pub mc_vfp_size: usize, ++ pub mc_vfp_ptr: *mut c_void, ++ pub mc_spare: [c_uint; 33], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for mcontext_t { ++ fn eq(&self, other: &mcontext_t) -> bool { ++ self.__gregs == other.__gregs ++ && self.mc_vfp_size == other.mc_vfp_size ++ && self.mc_vfp_ptr == other.mc_vfp_ptr ++ && self ++ .mc_spare ++ .iter() ++ .zip(other.mc_spare.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for mcontext_t {} ++ impl fmt::Debug for mcontext_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("mcontext_t") ++ .field("__gregs", &self.__gregs) ++ .field("mc_vfp_size", &self.mc_vfp_size) ++ .field("mc_vfp_ptr", &self.mc_vfp_ptr) ++ .field("mc_spare", &self.mc_spare) ++ .finish() ++ } ++ } ++ impl hash::Hash for mcontext_t { ++ fn hash(&self, state: &mut H) { ++ self.__gregs.hash(state); ++ self.mc_vfp_size.hash(state); ++ self.mc_vfp_ptr.hash(state); ++ self.mc_spare.hash(state); ++ } ++ } ++ } ++} ++ ++pub(crate) const _ALIGNBYTES: usize = mem::size_of::() - 1; ++ ++pub const BIOCSRTIMEOUT: c_ulong = 0x8010426d; ++pub const BIOCGRTIMEOUT: c_ulong = 0x4010426e; ++ ++pub const MAP_32BIT: c_int = 0x00080000; ++pub const MINSIGSTKSZ: size_t = 4096; // 1024 * 4 ++pub const TIOCTIMESTAMP: c_ulong = 0x40107459; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd11/b32.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd11/b32.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd11/b32.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd11/b32.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,36 @@ ++use crate::off_t; ++use crate::prelude::*; ++ ++#[repr(C)] ++#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))] ++pub struct stat { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ pub st_size: off_t, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_blksize: crate::blksize_t, ++ pub st_flags: crate::fflags_t, ++ pub st_gen: u32, ++ pub st_lspare: i32, ++ pub st_birthtime: crate::time_t, ++ pub st_birthtime_nsec: c_long, ++ __unused: [u8; 8], ++} ++ ++impl Copy for crate::stat {} ++impl Clone for crate::stat { ++ fn clone(&self) -> crate::stat { ++ *self ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd11/b64.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,35 @@ ++use crate::off_t; ++use crate::prelude::*; ++ ++#[repr(C)] ++#[cfg_attr(feature = "extra_traits", derive(Debug, Eq, Hash, PartialEq))] ++pub struct stat { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ pub st_size: off_t, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_blksize: crate::blksize_t, ++ pub st_flags: crate::fflags_t, ++ pub st_gen: u32, ++ pub st_lspare: i32, ++ pub st_birthtime: crate::time_t, ++ pub st_birthtime_nsec: c_long, ++} ++ ++impl Copy for crate::stat {} ++impl Clone for crate::stat { ++ fn clone(&self) -> crate::stat { ++ *self ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd11/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,490 @@ ++use crate::prelude::*; ++ ++// APIs that were changed after FreeBSD 11 ++ ++// The type of `nlink_t` changed from `u16` to `u64` in FreeBSD 12: ++pub type nlink_t = u16; ++// Type of `dev_t` changed from `u32` to `u64` in FreeBSD 12: ++pub type dev_t = u32; ++// Type of `ino_t` changed from `__uint32_t` to `__uint64_t` in FreeBSD 12: ++pub type ino_t = u32; ++ ++s! { ++ pub struct kevent { ++ pub ident: crate::uintptr_t, ++ pub filter: c_short, ++ pub flags: c_ushort, ++ pub fflags: c_uint, ++ pub data: intptr_t, ++ pub udata: *mut c_void, ++ } ++ ++ pub struct shmid_ds { ++ pub shm_perm: crate::ipc_perm, ++ pub shm_segsz: size_t, ++ pub shm_lpid: crate::pid_t, ++ pub shm_cpid: crate::pid_t, ++ // Type of shm_nattc changed from `int` to `shmatt_t` (aka `unsigned ++ // int`) in FreeBSD 12: ++ pub shm_nattch: c_int, ++ pub shm_atime: crate::time_t, ++ pub shm_dtime: crate::time_t, ++ pub shm_ctime: crate::time_t, ++ } ++ ++ pub struct kinfo_proc { ++ /// Size of this structure. ++ pub ki_structsize: c_int, ++ /// Reserved: layout identifier. ++ pub ki_layout: c_int, ++ /// Address of command arguments. ++ pub ki_args: *mut crate::pargs, ++ // This is normally "struct proc". ++ /// Address of proc. ++ pub ki_paddr: *mut c_void, ++ // This is normally "struct user". ++ /// Kernel virtual address of u-area. ++ pub ki_addr: *mut c_void, ++ // This is normally "struct vnode". ++ /// Pointer to trace file. ++ pub ki_tracep: *mut c_void, ++ // This is normally "struct vnode". ++ /// Pointer to executable file. ++ pub ki_textvp: *mut c_void, ++ // This is normally "struct filedesc". ++ /// Pointer to open file info. ++ pub ki_fd: *mut c_void, ++ // This is normally "struct vmspace". ++ /// Pointer to kernel vmspace struct. ++ pub ki_vmspace: *mut c_void, ++ /// Sleep address. ++ pub ki_wchan: *mut c_void, ++ /// Process identifier. ++ pub ki_pid: crate::pid_t, ++ /// Parent process ID. ++ pub ki_ppid: crate::pid_t, ++ /// Process group ID. ++ pub ki_pgid: crate::pid_t, ++ /// tty process group ID. ++ pub ki_tpgid: crate::pid_t, ++ /// Process session ID. ++ pub ki_sid: crate::pid_t, ++ /// Terminal session ID. ++ pub ki_tsid: crate::pid_t, ++ /// Job control counter. ++ pub ki_jobc: c_short, ++ /// Unused (just here for alignment). ++ pub ki_spare_short1: c_short, ++ /// Controlling tty dev. ++ pub ki_tdev: crate::dev_t, ++ /// Signals arrived but not delivered. ++ pub ki_siglist: crate::sigset_t, ++ /// Current signal mask. ++ pub ki_sigmask: crate::sigset_t, ++ /// Signals being ignored. ++ pub ki_sigignore: crate::sigset_t, ++ /// Signals being caught by user. ++ pub ki_sigcatch: crate::sigset_t, ++ /// Effective user ID. ++ pub ki_uid: crate::uid_t, ++ /// Real user ID. ++ pub ki_ruid: crate::uid_t, ++ /// Saved effective user ID. ++ pub ki_svuid: crate::uid_t, ++ /// Real group ID. ++ pub ki_rgid: crate::gid_t, ++ /// Saved effective group ID. ++ pub ki_svgid: crate::gid_t, ++ /// Number of groups. ++ pub ki_ngroups: c_short, ++ /// Unused (just here for alignment). ++ pub ki_spare_short2: c_short, ++ /// Groups. ++ pub ki_groups: [crate::gid_t; crate::KI_NGROUPS], ++ /// Virtual size. ++ pub ki_size: crate::vm_size_t, ++ /// Current resident set size in pages. ++ pub ki_rssize: crate::segsz_t, ++ /// Resident set size before last swap. ++ pub ki_swrss: crate::segsz_t, ++ /// Text size (pages) XXX. ++ pub ki_tsize: crate::segsz_t, ++ /// Data size (pages) XXX. ++ pub ki_dsize: crate::segsz_t, ++ /// Stack size (pages). ++ pub ki_ssize: crate::segsz_t, ++ /// Exit status for wait & stop signal. ++ pub ki_xstat: crate::u_short, ++ /// Accounting flags. ++ pub ki_acflag: crate::u_short, ++ /// %cpu for process during `ki_swtime`. ++ pub ki_pctcpu: crate::fixpt_t, ++ /// Time averaged value of `ki_cpticks`. ++ pub ki_estcpu: crate::u_int, ++ /// Time since last blocked. ++ pub ki_slptime: crate::u_int, ++ /// Time swapped in or out. ++ pub ki_swtime: crate::u_int, ++ /// Number of copy-on-write faults. ++ pub ki_cow: crate::u_int, ++ /// Real time in microsec. ++ pub ki_runtime: u64, ++ /// Starting time. ++ pub ki_start: crate::timeval, ++ /// Time used by process children. ++ pub ki_childtime: crate::timeval, ++ /// P_* flags. ++ pub ki_flag: c_long, ++ /// KI_* flags (below). ++ pub ki_kiflag: c_long, ++ /// Kernel trace points. ++ pub ki_traceflag: c_int, ++ /// S* process status. ++ pub ki_stat: c_char, ++ /// Process "nice" value. ++ pub ki_nice: i8, // signed char ++ /// Process lock (prevent swap) count. ++ pub ki_lock: c_char, ++ /// Run queue index. ++ pub ki_rqindex: c_char, ++ /// Which cpu we are on. ++ pub ki_oncpu_old: c_uchar, ++ /// Last cpu we were on. ++ pub ki_lastcpu_old: c_uchar, ++ /// Thread name. ++ pub ki_tdname: [c_char; crate::TDNAMLEN + 1], ++ /// Wchan message. ++ pub ki_wmesg: [c_char; crate::WMESGLEN + 1], ++ /// Setlogin name. ++ pub ki_login: [c_char; crate::LOGNAMELEN + 1], ++ /// Lock name. ++ pub ki_lockname: [c_char; crate::LOCKNAMELEN + 1], ++ /// Command name. ++ pub ki_comm: [c_char; crate::COMMLEN + 1], ++ /// Emulation name. ++ pub ki_emul: [c_char; crate::KI_EMULNAMELEN + 1], ++ /// Login class. ++ pub ki_loginclass: [c_char; crate::LOGINCLASSLEN + 1], ++ /// More thread name. ++ pub ki_moretdname: [c_char; crate::MAXCOMLEN - crate::TDNAMLEN + 1], ++ /// Spare string space. ++ pub ki_sparestrings: [[c_char; 23]; 2], // little hack to allow PartialEq ++ /// Spare room for growth. ++ pub ki_spareints: [c_int; crate::KI_NSPARE_INT], ++ /// Which cpu we are on. ++ pub ki_oncpu: c_int, ++ /// Last cpu we were on. ++ pub ki_lastcpu: c_int, ++ /// PID of tracing process. ++ pub ki_tracer: c_int, ++ /// P2_* flags. ++ pub ki_flag2: c_int, ++ /// Default FIB number. ++ pub ki_fibnum: c_int, ++ /// Credential flags. ++ pub ki_cr_flags: crate::u_int, ++ /// Process jail ID. ++ pub ki_jid: c_int, ++ /// Number of threads in total. ++ pub ki_numthreads: c_int, ++ /// Thread ID. ++ pub ki_tid: crate::lwpid_t, ++ /// Process priority. ++ pub ki_pri: crate::priority, ++ /// Process rusage statistics. ++ pub ki_rusage: crate::rusage, ++ /// rusage of children processes. ++ pub ki_rusage_ch: crate::rusage, ++ // This is normally "struct pcb". ++ /// Kernel virtual addr of pcb. ++ pub ki_pcb: *mut c_void, ++ /// Kernel virtual addr of stack. ++ pub ki_kstack: *mut c_void, ++ /// User convenience pointer. ++ pub ki_udata: *mut c_void, ++ // This is normally "struct thread". ++ pub ki_tdaddr: *mut c_void, ++ pub ki_spareptrs: [*mut c_void; crate::KI_NSPARE_PTR], ++ pub ki_sparelongs: [c_long; crate::KI_NSPARE_LONG], ++ /// PS_* flags. ++ pub ki_sflag: c_long, ++ /// kthread flag. ++ pub ki_tdflags: c_long, ++ } ++} ++ ++s_no_extra_traits! { ++ pub struct dirent { ++ pub d_fileno: crate::ino_t, ++ pub d_reclen: u16, ++ pub d_type: u8, ++ // Type of `d_namlen` changed from `char` to `u16` in FreeBSD 12: ++ pub d_namlen: u8, ++ pub d_name: [c_char; 256], ++ } ++ ++ pub struct statfs { ++ pub f_version: u32, ++ pub f_type: u32, ++ pub f_flags: u64, ++ pub f_bsize: u64, ++ pub f_iosize: u64, ++ pub f_blocks: u64, ++ pub f_bfree: u64, ++ pub f_bavail: i64, ++ pub f_files: u64, ++ pub f_ffree: i64, ++ pub f_syncwrites: u64, ++ pub f_asyncwrites: u64, ++ pub f_syncreads: u64, ++ pub f_asyncreads: u64, ++ f_spare: [u64; 10], ++ pub f_namemax: u32, ++ pub f_owner: crate::uid_t, ++ pub f_fsid: crate::fsid_t, ++ f_charspare: [c_char; 80], ++ pub f_fstypename: [c_char; 16], ++ // Array length changed from 88 to 1024 in FreeBSD 12: ++ pub f_mntfromname: [c_char; 88], ++ // Array length changed from 88 to 1024 in FreeBSD 12: ++ pub f_mntonname: [c_char; 88], ++ } ++ ++ pub struct vnstat { ++ pub vn_fileid: u64, ++ pub vn_size: u64, ++ pub vn_mntdir: *mut c_char, ++ pub vn_dev: u32, ++ pub vn_fsid: u32, ++ pub vn_type: c_int, ++ pub vn_mode: u16, ++ pub vn_devname: [c_char; crate::SPECNAMELEN as usize + 1], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for statfs { ++ fn eq(&self, other: &statfs) -> bool { ++ self.f_version == other.f_version ++ && self.f_type == other.f_type ++ && self.f_flags == other.f_flags ++ && self.f_bsize == other.f_bsize ++ && self.f_iosize == other.f_iosize ++ && self.f_blocks == other.f_blocks ++ && self.f_bfree == other.f_bfree ++ && self.f_bavail == other.f_bavail ++ && self.f_files == other.f_files ++ && self.f_ffree == other.f_ffree ++ && self.f_syncwrites == other.f_syncwrites ++ && self.f_asyncwrites == other.f_asyncwrites ++ && self.f_syncreads == other.f_syncreads ++ && self.f_asyncreads == other.f_asyncreads ++ && self.f_namemax == other.f_namemax ++ && self.f_owner == other.f_owner ++ && self.f_fsid == other.f_fsid ++ && self.f_fstypename == other.f_fstypename ++ && self ++ .f_mntfromname ++ .iter() ++ .zip(other.f_mntfromname.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .f_mntonname ++ .iter() ++ .zip(other.f_mntonname.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for statfs {} ++ impl fmt::Debug for statfs { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("statfs") ++ .field("f_bsize", &self.f_bsize) ++ .field("f_iosize", &self.f_iosize) ++ .field("f_blocks", &self.f_blocks) ++ .field("f_bfree", &self.f_bfree) ++ .field("f_bavail", &self.f_bavail) ++ .field("f_files", &self.f_files) ++ .field("f_ffree", &self.f_ffree) ++ .field("f_syncwrites", &self.f_syncwrites) ++ .field("f_asyncwrites", &self.f_asyncwrites) ++ .field("f_syncreads", &self.f_syncreads) ++ .field("f_asyncreads", &self.f_asyncreads) ++ .field("f_namemax", &self.f_namemax) ++ .field("f_owner", &self.f_owner) ++ .field("f_fsid", &self.f_fsid) ++ .field("f_fstypename", &self.f_fstypename) ++ .field("f_mntfromname", &&self.f_mntfromname[..]) ++ .field("f_mntonname", &&self.f_mntonname[..]) ++ .finish() ++ } ++ } ++ impl hash::Hash for statfs { ++ fn hash(&self, state: &mut H) { ++ self.f_version.hash(state); ++ self.f_type.hash(state); ++ self.f_flags.hash(state); ++ self.f_bsize.hash(state); ++ self.f_iosize.hash(state); ++ self.f_blocks.hash(state); ++ self.f_bfree.hash(state); ++ self.f_bavail.hash(state); ++ self.f_files.hash(state); ++ self.f_ffree.hash(state); ++ self.f_syncwrites.hash(state); ++ self.f_asyncwrites.hash(state); ++ self.f_syncreads.hash(state); ++ self.f_asyncreads.hash(state); ++ self.f_namemax.hash(state); ++ self.f_owner.hash(state); ++ self.f_fsid.hash(state); ++ self.f_fstypename.hash(state); ++ self.f_mntfromname.hash(state); ++ self.f_mntonname.hash(state); ++ } ++ } ++ ++ impl PartialEq for dirent { ++ fn eq(&self, other: &dirent) -> bool { ++ self.d_fileno == other.d_fileno ++ && self.d_reclen == other.d_reclen ++ && self.d_type == other.d_type ++ && self.d_namlen == other.d_namlen ++ && self.d_name[..self.d_namlen as _] ++ .iter() ++ .zip(other.d_name.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for dirent {} ++ impl fmt::Debug for dirent { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("dirent") ++ .field("d_fileno", &self.d_fileno) ++ .field("d_reclen", &self.d_reclen) ++ .field("d_type", &self.d_type) ++ .field("d_namlen", &self.d_namlen) ++ .field("d_name", &&self.d_name[..self.d_namlen as _]) ++ .finish() ++ } ++ } ++ impl hash::Hash for dirent { ++ fn hash(&self, state: &mut H) { ++ self.d_fileno.hash(state); ++ self.d_reclen.hash(state); ++ self.d_type.hash(state); ++ self.d_namlen.hash(state); ++ self.d_name[..self.d_namlen as _].hash(state); ++ } ++ } ++ ++ impl PartialEq for vnstat { ++ fn eq(&self, other: &vnstat) -> bool { ++ let self_vn_devname: &[c_char] = &self.vn_devname; ++ let other_vn_devname: &[c_char] = &other.vn_devname; ++ ++ self.vn_fileid == other.vn_fileid ++ && self.vn_size == other.vn_size ++ && self.vn_mntdir == other.vn_mntdir ++ && self.vn_dev == other.vn_dev ++ && self.vn_fsid == other.vn_fsid ++ && self.vn_type == other.vn_type ++ && self.vn_mode == other.vn_mode ++ && self_vn_devname == other_vn_devname ++ } ++ } ++ impl Eq for vnstat {} ++ impl fmt::Debug for vnstat { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ let self_vn_devname: &[c_char] = &self.vn_devname; ++ ++ f.debug_struct("vnstat") ++ .field("vn_fileid", &self.vn_fileid) ++ .field("vn_size", &self.vn_size) ++ .field("vn_mntdir", &self.vn_mntdir) ++ .field("vn_dev", &self.vn_dev) ++ .field("vn_fsid", &self.vn_fsid) ++ .field("vn_type", &self.vn_type) ++ .field("vn_mode", &self.vn_mode) ++ .field("vn_devname", &self_vn_devname) ++ .finish() ++ } ++ } ++ impl hash::Hash for vnstat { ++ fn hash(&self, state: &mut H) { ++ let self_vn_devname: &[c_char] = &self.vn_devname; ++ ++ self.vn_fileid.hash(state); ++ self.vn_size.hash(state); ++ self.vn_mntdir.hash(state); ++ self.vn_dev.hash(state); ++ self.vn_fsid.hash(state); ++ self.vn_type.hash(state); ++ self.vn_mode.hash(state); ++ self_vn_devname.hash(state); ++ } ++ } ++ } ++} ++ ++pub const ELAST: c_int = 96; ++pub const RAND_MAX: c_int = 0x7fff_fffd; ++pub const KI_NSPARE_PTR: usize = 6; ++pub const MINCORE_SUPER: c_int = 0x20; ++/// max length of devicename ++pub const SPECNAMELEN: c_int = 63; ++ ++safe_f! { ++ pub {const} fn makedev(major: c_uint, minor: c_uint) -> crate::dev_t { ++ let major = major as crate::dev_t; ++ let minor = minor as crate::dev_t; ++ (major << 8) | minor ++ } ++} ++ ++f! { ++ pub fn major(dev: crate::dev_t) -> c_int { ++ ((dev >> 8) & 0xff) as c_int ++ } ++ ++ pub fn minor(dev: crate::dev_t) -> c_int { ++ (dev & 0xffff00ff) as c_int ++ } ++} ++ ++extern "C" { ++ // Return type c_int was removed in FreeBSD 12 ++ pub fn setgrent() -> c_int; ++ ++ // Type of `addr` argument changed from `const void*` to `void*` ++ // in FreeBSD 12 ++ pub fn mprotect(addr: *const c_void, len: size_t, prot: c_int) -> c_int; ++ ++ // Return type c_int was removed in FreeBSD 12 ++ pub fn freelocale(loc: crate::locale_t) -> c_int; ++ ++ // Return type c_int changed to ssize_t in FreeBSD 12: ++ pub fn msgrcv( ++ msqid: c_int, ++ msgp: *mut c_void, ++ msgsz: size_t, ++ msgtyp: c_long, ++ msgflg: c_int, ++ ) -> c_int; ++ ++ // Type of `path` argument changed from `const void*` to `void*` ++ // in FreeBSD 12 ++ pub fn dirname(path: *const c_char) -> *mut c_char; ++ pub fn basename(path: *const c_char) -> *mut c_char; ++} ++ ++cfg_if! { ++ if #[cfg(target_pointer_width = "64")] { ++ mod b64; ++ pub use self::b64::*; ++ } else { ++ mod b32; ++ pub use self::b32::*; ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd12/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,532 @@ ++use crate::off_t; ++use crate::prelude::*; ++ ++// APIs in FreeBSD 12 that have changed since 11. ++ ++pub type nlink_t = u64; ++pub type dev_t = u64; ++pub type ino_t = u64; ++pub type shmatt_t = c_uint; ++ ++s! { ++ pub struct shmid_ds { ++ pub shm_perm: crate::ipc_perm, ++ pub shm_segsz: size_t, ++ pub shm_lpid: crate::pid_t, ++ pub shm_cpid: crate::pid_t, ++ pub shm_nattch: crate::shmatt_t, ++ pub shm_atime: crate::time_t, ++ pub shm_dtime: crate::time_t, ++ pub shm_ctime: crate::time_t, ++ } ++ ++ pub struct kevent { ++ pub ident: crate::uintptr_t, ++ pub filter: c_short, ++ pub flags: c_ushort, ++ pub fflags: c_uint, ++ pub data: i64, ++ pub udata: *mut c_void, ++ pub ext: [u64; 4], ++ } ++ ++ pub struct kvm_page { ++ pub version: c_uint, ++ pub paddr: c_ulong, ++ pub kmap_vaddr: c_ulong, ++ pub dmap_vaddr: c_ulong, ++ pub prot: crate::vm_prot_t, ++ pub offset: crate::u_long, ++ pub len: size_t, ++ } ++ ++ pub struct kinfo_proc { ++ /// Size of this structure. ++ pub ki_structsize: c_int, ++ /// Reserved: layout identifier. ++ pub ki_layout: c_int, ++ /// Address of command arguments. ++ pub ki_args: *mut crate::pargs, ++ // This is normally "struct proc". ++ /// Address of proc. ++ pub ki_paddr: *mut c_void, ++ // This is normally "struct user". ++ /// Kernel virtual address of u-area. ++ pub ki_addr: *mut c_void, ++ // This is normally "struct vnode". ++ /// Pointer to trace file. ++ pub ki_tracep: *mut c_void, ++ // This is normally "struct vnode". ++ /// Pointer to executable file. ++ pub ki_textvp: *mut c_void, ++ // This is normally "struct filedesc". ++ /// Pointer to open file info. ++ pub ki_fd: *mut c_void, ++ // This is normally "struct vmspace". ++ /// Pointer to kernel vmspace struct. ++ pub ki_vmspace: *mut c_void, ++ /// Sleep address. ++ pub ki_wchan: *mut c_void, ++ /// Process identifier. ++ pub ki_pid: crate::pid_t, ++ /// Parent process ID. ++ pub ki_ppid: crate::pid_t, ++ /// Process group ID. ++ pub ki_pgid: crate::pid_t, ++ /// tty process group ID. ++ pub ki_tpgid: crate::pid_t, ++ /// Process session ID. ++ pub ki_sid: crate::pid_t, ++ /// Terminal session ID. ++ pub ki_tsid: crate::pid_t, ++ /// Job control counter. ++ pub ki_jobc: c_short, ++ /// Unused (just here for alignment). ++ pub ki_spare_short1: c_short, ++ /// Controlling tty dev. ++ pub ki_tdev_freebsd11: u32, ++ /// Signals arrived but not delivered. ++ pub ki_siglist: crate::sigset_t, ++ /// Current signal mask. ++ pub ki_sigmask: crate::sigset_t, ++ /// Signals being ignored. ++ pub ki_sigignore: crate::sigset_t, ++ /// Signals being caught by user. ++ pub ki_sigcatch: crate::sigset_t, ++ /// Effective user ID. ++ pub ki_uid: crate::uid_t, ++ /// Real user ID. ++ pub ki_ruid: crate::uid_t, ++ /// Saved effective user ID. ++ pub ki_svuid: crate::uid_t, ++ /// Real group ID. ++ pub ki_rgid: crate::gid_t, ++ /// Saved effective group ID. ++ pub ki_svgid: crate::gid_t, ++ /// Number of groups. ++ pub ki_ngroups: c_short, ++ /// Unused (just here for alignment). ++ pub ki_spare_short2: c_short, ++ /// Groups. ++ pub ki_groups: [crate::gid_t; crate::KI_NGROUPS], ++ /// Virtual size. ++ pub ki_size: crate::vm_size_t, ++ /// Current resident set size in pages. ++ pub ki_rssize: crate::segsz_t, ++ /// Resident set size before last swap. ++ pub ki_swrss: crate::segsz_t, ++ /// Text size (pages) XXX. ++ pub ki_tsize: crate::segsz_t, ++ /// Data size (pages) XXX. ++ pub ki_dsize: crate::segsz_t, ++ /// Stack size (pages). ++ pub ki_ssize: crate::segsz_t, ++ /// Exit status for wait & stop signal. ++ pub ki_xstat: crate::u_short, ++ /// Accounting flags. ++ pub ki_acflag: crate::u_short, ++ /// %cpu for process during `ki_swtime`. ++ pub ki_pctcpu: crate::fixpt_t, ++ /// Time averaged value of `ki_cpticks`. ++ pub ki_estcpu: crate::u_int, ++ /// Time since last blocked. ++ pub ki_slptime: crate::u_int, ++ /// Time swapped in or out. ++ pub ki_swtime: crate::u_int, ++ /// Number of copy-on-write faults. ++ pub ki_cow: crate::u_int, ++ /// Real time in microsec. ++ pub ki_runtime: u64, ++ /// Starting time. ++ pub ki_start: crate::timeval, ++ /// Time used by process children. ++ pub ki_childtime: crate::timeval, ++ /// P_* flags. ++ pub ki_flag: c_long, ++ /// KI_* flags (below). ++ pub ki_kiflag: c_long, ++ /// Kernel trace points. ++ pub ki_traceflag: c_int, ++ /// S* process status. ++ pub ki_stat: c_char, ++ /// Process "nice" value. ++ pub ki_nice: i8, // signed char ++ /// Process lock (prevent swap) count. ++ pub ki_lock: c_char, ++ /// Run queue index. ++ pub ki_rqindex: c_char, ++ /// Which cpu we are on. ++ pub ki_oncpu_old: c_uchar, ++ /// Last cpu we were on. ++ pub ki_lastcpu_old: c_uchar, ++ /// Thread name. ++ pub ki_tdname: [c_char; crate::TDNAMLEN + 1], ++ /// Wchan message. ++ pub ki_wmesg: [c_char; crate::WMESGLEN + 1], ++ /// Setlogin name. ++ pub ki_login: [c_char; crate::LOGNAMELEN + 1], ++ /// Lock name. ++ pub ki_lockname: [c_char; crate::LOCKNAMELEN + 1], ++ /// Command name. ++ pub ki_comm: [c_char; crate::COMMLEN + 1], ++ /// Emulation name. ++ pub ki_emul: [c_char; crate::KI_EMULNAMELEN + 1], ++ /// Login class. ++ pub ki_loginclass: [c_char; crate::LOGINCLASSLEN + 1], ++ /// More thread name. ++ pub ki_moretdname: [c_char; crate::MAXCOMLEN - crate::TDNAMLEN + 1], ++ /// Spare string space. ++ pub ki_sparestrings: [[c_char; 23]; 2], // little hack to allow PartialEq ++ /// Spare room for growth. ++ pub ki_spareints: [c_int; crate::KI_NSPARE_INT], ++ /// Controlling tty dev. ++ pub ki_tdev: crate::dev_t, ++ /// Which cpu we are on. ++ pub ki_oncpu: c_int, ++ /// Last cpu we were on. ++ pub ki_lastcpu: c_int, ++ /// PID of tracing process. ++ pub ki_tracer: c_int, ++ /// P2_* flags. ++ pub ki_flag2: c_int, ++ /// Default FIB number. ++ pub ki_fibnum: c_int, ++ /// Credential flags. ++ pub ki_cr_flags: crate::u_int, ++ /// Process jail ID. ++ pub ki_jid: c_int, ++ /// Number of threads in total. ++ pub ki_numthreads: c_int, ++ /// Thread ID. ++ pub ki_tid: crate::lwpid_t, ++ /// Process priority. ++ pub ki_pri: crate::priority, ++ /// Process rusage statistics. ++ pub ki_rusage: crate::rusage, ++ /// rusage of children processes. ++ pub ki_rusage_ch: crate::rusage, ++ // This is normally "struct pcb". ++ /// Kernel virtual addr of pcb. ++ pub ki_pcb: *mut c_void, ++ /// Kernel virtual addr of stack. ++ pub ki_kstack: *mut c_void, ++ /// User convenience pointer. ++ pub ki_udata: *mut c_void, ++ // This is normally "struct thread". ++ pub ki_tdaddr: *mut c_void, ++ pub ki_spareptrs: [*mut c_void; crate::KI_NSPARE_PTR], ++ pub ki_sparelongs: [c_long; crate::KI_NSPARE_LONG], ++ /// PS_* flags. ++ pub ki_sflag: c_long, ++ /// kthread flag. ++ pub ki_tdflags: c_long, ++ } ++ ++ pub struct stat { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_mode: crate::mode_t, ++ st_padding0: i16, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ st_padding1: i32, ++ pub st_rdev: crate::dev_t, ++ #[cfg(target_arch = "x86")] ++ st_atim_ext: i32, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ #[cfg(target_arch = "x86")] ++ st_mtim_ext: i32, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ #[cfg(target_arch = "x86")] ++ st_ctim_ext: i32, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ #[cfg(target_arch = "x86")] ++ st_btim_ext: i32, ++ pub st_birthtime: crate::time_t, ++ pub st_birthtime_nsec: c_long, ++ pub st_size: off_t, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_blksize: crate::blksize_t, ++ pub st_flags: crate::fflags_t, ++ pub st_gen: u64, ++ pub st_spare: [u64; 10], ++ } ++} ++ ++s_no_extra_traits! { ++ pub struct dirent { ++ pub d_fileno: crate::ino_t, ++ pub d_off: off_t, ++ pub d_reclen: u16, ++ pub d_type: u8, ++ d_pad0: u8, ++ pub d_namlen: u16, ++ d_pad1: u16, ++ pub d_name: [c_char; 256], ++ } ++ ++ pub struct statfs { ++ pub f_version: u32, ++ pub f_type: u32, ++ pub f_flags: u64, ++ pub f_bsize: u64, ++ pub f_iosize: u64, ++ pub f_blocks: u64, ++ pub f_bfree: u64, ++ pub f_bavail: i64, ++ pub f_files: u64, ++ pub f_ffree: i64, ++ pub f_syncwrites: u64, ++ pub f_asyncwrites: u64, ++ pub f_syncreads: u64, ++ pub f_asyncreads: u64, ++ f_spare: [u64; 10], ++ pub f_namemax: u32, ++ pub f_owner: crate::uid_t, ++ pub f_fsid: crate::fsid_t, ++ f_charspare: [c_char; 80], ++ pub f_fstypename: [c_char; 16], ++ pub f_mntfromname: [c_char; 1024], ++ pub f_mntonname: [c_char; 1024], ++ } ++ ++ pub struct vnstat { ++ pub vn_fileid: u64, ++ pub vn_size: u64, ++ pub vn_dev: u64, ++ pub vn_fsid: u64, ++ pub vn_mntdir: *mut c_char, ++ pub vn_type: c_int, ++ pub vn_mode: u16, ++ pub vn_devname: [c_char; crate::SPECNAMELEN as usize + 1], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for statfs { ++ fn eq(&self, other: &statfs) -> bool { ++ self.f_version == other.f_version ++ && self.f_type == other.f_type ++ && self.f_flags == other.f_flags ++ && self.f_bsize == other.f_bsize ++ && self.f_iosize == other.f_iosize ++ && self.f_blocks == other.f_blocks ++ && self.f_bfree == other.f_bfree ++ && self.f_bavail == other.f_bavail ++ && self.f_files == other.f_files ++ && self.f_ffree == other.f_ffree ++ && self.f_syncwrites == other.f_syncwrites ++ && self.f_asyncwrites == other.f_asyncwrites ++ && self.f_syncreads == other.f_syncreads ++ && self.f_asyncreads == other.f_asyncreads ++ && self.f_namemax == other.f_namemax ++ && self.f_owner == other.f_owner ++ && self.f_fsid == other.f_fsid ++ && self.f_fstypename == other.f_fstypename ++ && self ++ .f_mntfromname ++ .iter() ++ .zip(other.f_mntfromname.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .f_mntonname ++ .iter() ++ .zip(other.f_mntonname.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for statfs {} ++ impl fmt::Debug for statfs { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("statfs") ++ .field("f_bsize", &self.f_bsize) ++ .field("f_iosize", &self.f_iosize) ++ .field("f_blocks", &self.f_blocks) ++ .field("f_bfree", &self.f_bfree) ++ .field("f_bavail", &self.f_bavail) ++ .field("f_files", &self.f_files) ++ .field("f_ffree", &self.f_ffree) ++ .field("f_syncwrites", &self.f_syncwrites) ++ .field("f_asyncwrites", &self.f_asyncwrites) ++ .field("f_syncreads", &self.f_syncreads) ++ .field("f_asyncreads", &self.f_asyncreads) ++ .field("f_namemax", &self.f_namemax) ++ .field("f_owner", &self.f_owner) ++ .field("f_fsid", &self.f_fsid) ++ .field("f_fstypename", &self.f_fstypename) ++ .field("f_mntfromname", &&self.f_mntfromname[..]) ++ .field("f_mntonname", &&self.f_mntonname[..]) ++ .finish() ++ } ++ } ++ impl hash::Hash for statfs { ++ fn hash(&self, state: &mut H) { ++ self.f_version.hash(state); ++ self.f_type.hash(state); ++ self.f_flags.hash(state); ++ self.f_bsize.hash(state); ++ self.f_iosize.hash(state); ++ self.f_blocks.hash(state); ++ self.f_bfree.hash(state); ++ self.f_bavail.hash(state); ++ self.f_files.hash(state); ++ self.f_ffree.hash(state); ++ self.f_syncwrites.hash(state); ++ self.f_asyncwrites.hash(state); ++ self.f_syncreads.hash(state); ++ self.f_asyncreads.hash(state); ++ self.f_namemax.hash(state); ++ self.f_owner.hash(state); ++ self.f_fsid.hash(state); ++ self.f_charspare.hash(state); ++ self.f_fstypename.hash(state); ++ self.f_mntfromname.hash(state); ++ self.f_mntonname.hash(state); ++ } ++ } ++ ++ impl PartialEq for dirent { ++ fn eq(&self, other: &dirent) -> bool { ++ self.d_fileno == other.d_fileno ++ && self.d_off == other.d_off ++ && self.d_reclen == other.d_reclen ++ && self.d_type == other.d_type ++ && self.d_namlen == other.d_namlen ++ && self.d_name[..self.d_namlen as _] ++ .iter() ++ .zip(other.d_name.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for dirent {} ++ impl fmt::Debug for dirent { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("dirent") ++ .field("d_fileno", &self.d_fileno) ++ .field("d_off", &self.d_off) ++ .field("d_reclen", &self.d_reclen) ++ .field("d_type", &self.d_type) ++ .field("d_namlen", &self.d_namlen) ++ .field("d_name", &&self.d_name[..self.d_namlen as _]) ++ .finish() ++ } ++ } ++ impl hash::Hash for dirent { ++ fn hash(&self, state: &mut H) { ++ self.d_fileno.hash(state); ++ self.d_off.hash(state); ++ self.d_reclen.hash(state); ++ self.d_type.hash(state); ++ self.d_namlen.hash(state); ++ self.d_name[..self.d_namlen as _].hash(state); ++ } ++ } ++ ++ impl PartialEq for vnstat { ++ fn eq(&self, other: &vnstat) -> bool { ++ let self_vn_devname: &[c_char] = &self.vn_devname; ++ let other_vn_devname: &[c_char] = &other.vn_devname; ++ ++ self.vn_fileid == other.vn_fileid ++ && self.vn_size == other.vn_size ++ && self.vn_dev == other.vn_dev ++ && self.vn_fsid == other.vn_fsid ++ && self.vn_mntdir == other.vn_mntdir ++ && self.vn_type == other.vn_type ++ && self.vn_mode == other.vn_mode ++ && self_vn_devname == other_vn_devname ++ } ++ } ++ impl Eq for vnstat {} ++ impl fmt::Debug for vnstat { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ let self_vn_devname: &[c_char] = &self.vn_devname; ++ ++ f.debug_struct("vnstat") ++ .field("vn_fileid", &self.vn_fileid) ++ .field("vn_size", &self.vn_size) ++ .field("vn_dev", &self.vn_dev) ++ .field("vn_fsid", &self.vn_fsid) ++ .field("vn_mntdir", &self.vn_mntdir) ++ .field("vn_type", &self.vn_type) ++ .field("vn_mode", &self.vn_mode) ++ .field("vn_devname", &self_vn_devname) ++ .finish() ++ } ++ } ++ impl hash::Hash for vnstat { ++ fn hash(&self, state: &mut H) { ++ let self_vn_devname: &[c_char] = &self.vn_devname; ++ ++ self.vn_fileid.hash(state); ++ self.vn_size.hash(state); ++ self.vn_dev.hash(state); ++ self.vn_fsid.hash(state); ++ self.vn_mntdir.hash(state); ++ self.vn_type.hash(state); ++ self.vn_mode.hash(state); ++ self_vn_devname.hash(state); ++ } ++ } ++ } ++} ++ ++pub const RAND_MAX: c_int = 0x7fff_fffd; ++pub const ELAST: c_int = 97; ++ ++/// max length of devicename ++pub const SPECNAMELEN: c_int = 63; ++pub const KI_NSPARE_PTR: usize = 6; ++ ++pub const MINCORE_SUPER: c_int = 0x20; ++ ++safe_f! { ++ pub {const} fn makedev(major: c_uint, minor: c_uint) -> crate::dev_t { ++ let major = major as crate::dev_t; ++ let minor = minor as crate::dev_t; ++ let mut dev = 0; ++ dev |= ((major & 0xffffff00) as dev_t) << 32; ++ dev |= ((major & 0x000000ff) as dev_t) << 8; ++ dev |= ((minor & 0x0000ff00) as dev_t) << 24; ++ dev |= ((minor & 0xffff00ff) as dev_t) << 0; ++ dev ++ } ++} ++ ++f! { ++ pub fn major(dev: crate::dev_t) -> c_int { ++ (((dev >> 32) & 0xffffff00) | ((dev >> 8) & 0xff)) as c_int ++ } ++ ++ pub fn minor(dev: crate::dev_t) -> c_int { ++ (((dev >> 24) & 0xff00) | (dev & 0xffff00ff)) as c_int ++ } ++} ++ ++extern "C" { ++ pub fn setgrent(); ++ pub fn mprotect(addr: *mut c_void, len: size_t, prot: c_int) -> c_int; ++ pub fn freelocale(loc: crate::locale_t); ++ pub fn msgrcv( ++ msqid: c_int, ++ msgp: *mut c_void, ++ msgsz: size_t, ++ msgtyp: c_long, ++ msgflg: c_int, ++ ) -> ssize_t; ++ ++ pub fn dirname(path: *mut c_char) -> *mut c_char; ++ pub fn basename(path: *mut c_char) -> *mut c_char; ++} ++ ++cfg_if! { ++ if #[cfg(target_arch = "x86_64")] { ++ mod x86_64; ++ pub use self::x86_64::*; ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd12/x86_64.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,7 @@ ++use crate::prelude::*; ++ ++pub const PROC_KPTI_CTL: c_int = crate::PROC_PROCCTL_MD_MIN; ++pub const PROC_KPTI_CTL_ENABLE_ON_EXEC: c_int = 1; ++pub const PROC_KPTI_CTL_DISABLE_ON_EXEC: c_int = 2; ++pub const PROC_KPTI_STATUS: c_int = crate::PROC_PROCCTL_MD_MIN + 1; ++pub const PROC_KPTI_STATUS_ACTIVE: c_int = 0x80000000; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd13/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,576 @@ ++use crate::off_t; ++use crate::prelude::*; ++ ++// APIs in FreeBSD 13 that have changed since 11. ++ ++pub type nlink_t = u64; ++pub type dev_t = u64; ++pub type ino_t = u64; ++pub type shmatt_t = c_uint; ++pub type kpaddr_t = u64; ++pub type kssize_t = i64; ++pub type domainset_t = __c_anonymous_domainset; ++ ++s! { ++ pub struct shmid_ds { ++ pub shm_perm: crate::ipc_perm, ++ pub shm_segsz: size_t, ++ pub shm_lpid: crate::pid_t, ++ pub shm_cpid: crate::pid_t, ++ pub shm_nattch: crate::shmatt_t, ++ pub shm_atime: crate::time_t, ++ pub shm_dtime: crate::time_t, ++ pub shm_ctime: crate::time_t, ++ } ++ ++ pub struct kevent { ++ pub ident: crate::uintptr_t, ++ pub filter: c_short, ++ pub flags: c_ushort, ++ pub fflags: c_uint, ++ pub data: i64, ++ pub udata: *mut c_void, ++ pub ext: [u64; 4], ++ } ++ ++ pub struct kvm_page { ++ pub kp_version: crate::u_int, ++ pub kp_paddr: crate::kpaddr_t, ++ pub kp_kmap_vaddr: crate::kvaddr_t, ++ pub kp_dmap_vaddr: crate::kvaddr_t, ++ pub kp_prot: crate::vm_prot_t, ++ pub kp_offset: off_t, ++ pub kp_len: size_t, ++ } ++ ++ pub struct __c_anonymous_domainset { ++ #[cfg(target_pointer_width = "64")] ++ _priv: [c_ulong; 4], ++ #[cfg(target_pointer_width = "32")] ++ _priv: [c_ulong; 8], ++ } ++ ++ pub struct kinfo_proc { ++ /// Size of this structure. ++ pub ki_structsize: c_int, ++ /// Reserved: layout identifier. ++ pub ki_layout: c_int, ++ /// Address of command arguments. ++ pub ki_args: *mut crate::pargs, ++ // This is normally "struct proc". ++ /// Address of proc. ++ pub ki_paddr: *mut c_void, ++ // This is normally "struct user". ++ /// Kernel virtual address of u-area. ++ pub ki_addr: *mut c_void, ++ // This is normally "struct vnode". ++ /// Pointer to trace file. ++ pub ki_tracep: *mut c_void, ++ // This is normally "struct vnode". ++ /// Pointer to executable file. ++ pub ki_textvp: *mut c_void, ++ // This is normally "struct filedesc". ++ /// Pointer to open file info. ++ pub ki_fd: *mut c_void, ++ // This is normally "struct vmspace". ++ /// Pointer to kernel vmspace struct. ++ pub ki_vmspace: *mut c_void, ++ /// Sleep address. ++ pub ki_wchan: *const c_void, ++ /// Process identifier. ++ pub ki_pid: crate::pid_t, ++ /// Parent process ID. ++ pub ki_ppid: crate::pid_t, ++ /// Process group ID. ++ pub ki_pgid: crate::pid_t, ++ /// tty process group ID. ++ pub ki_tpgid: crate::pid_t, ++ /// Process session ID. ++ pub ki_sid: crate::pid_t, ++ /// Terminal session ID. ++ pub ki_tsid: crate::pid_t, ++ /// Job control counter. ++ pub ki_jobc: c_short, ++ /// Unused (just here for alignment). ++ pub ki_spare_short1: c_short, ++ /// Controlling tty dev. ++ pub ki_tdev_freebsd11: u32, ++ /// Signals arrived but not delivered. ++ pub ki_siglist: crate::sigset_t, ++ /// Current signal mask. ++ pub ki_sigmask: crate::sigset_t, ++ /// Signals being ignored. ++ pub ki_sigignore: crate::sigset_t, ++ /// Signals being caught by user. ++ pub ki_sigcatch: crate::sigset_t, ++ /// Effective user ID. ++ pub ki_uid: crate::uid_t, ++ /// Real user ID. ++ pub ki_ruid: crate::uid_t, ++ /// Saved effective user ID. ++ pub ki_svuid: crate::uid_t, ++ /// Real group ID. ++ pub ki_rgid: crate::gid_t, ++ /// Saved effective group ID. ++ pub ki_svgid: crate::gid_t, ++ /// Number of groups. ++ pub ki_ngroups: c_short, ++ /// Unused (just here for alignment). ++ pub ki_spare_short2: c_short, ++ /// Groups. ++ pub ki_groups: [crate::gid_t; crate::KI_NGROUPS], ++ /// Virtual size. ++ pub ki_size: crate::vm_size_t, ++ /// Current resident set size in pages. ++ pub ki_rssize: crate::segsz_t, ++ /// Resident set size before last swap. ++ pub ki_swrss: crate::segsz_t, ++ /// Text size (pages) XXX. ++ pub ki_tsize: crate::segsz_t, ++ /// Data size (pages) XXX. ++ pub ki_dsize: crate::segsz_t, ++ /// Stack size (pages). ++ pub ki_ssize: crate::segsz_t, ++ /// Exit status for wait & stop signal. ++ pub ki_xstat: crate::u_short, ++ /// Accounting flags. ++ pub ki_acflag: crate::u_short, ++ /// %cpu for process during `ki_swtime`. ++ pub ki_pctcpu: crate::fixpt_t, ++ /// Time averaged value of `ki_cpticks`. ++ pub ki_estcpu: crate::u_int, ++ /// Time since last blocked. ++ pub ki_slptime: crate::u_int, ++ /// Time swapped in or out. ++ pub ki_swtime: crate::u_int, ++ /// Number of copy-on-write faults. ++ pub ki_cow: crate::u_int, ++ /// Real time in microsec. ++ pub ki_runtime: u64, ++ /// Starting time. ++ pub ki_start: crate::timeval, ++ /// Time used by process children. ++ pub ki_childtime: crate::timeval, ++ /// P_* flags. ++ pub ki_flag: c_long, ++ /// KI_* flags (below). ++ pub ki_kiflag: c_long, ++ /// Kernel trace points. ++ pub ki_traceflag: c_int, ++ /// S* process status. ++ pub ki_stat: c_char, ++ /// Process "nice" value. ++ pub ki_nice: i8, // signed char ++ /// Process lock (prevent swap) count. ++ pub ki_lock: c_char, ++ /// Run queue index. ++ pub ki_rqindex: c_char, ++ /// Which cpu we are on. ++ pub ki_oncpu_old: c_uchar, ++ /// Last cpu we were on. ++ pub ki_lastcpu_old: c_uchar, ++ /// Thread name. ++ pub ki_tdname: [c_char; crate::TDNAMLEN + 1], ++ /// Wchan message. ++ pub ki_wmesg: [c_char; crate::WMESGLEN + 1], ++ /// Setlogin name. ++ pub ki_login: [c_char; crate::LOGNAMELEN + 1], ++ /// Lock name. ++ pub ki_lockname: [c_char; crate::LOCKNAMELEN + 1], ++ /// Command name. ++ pub ki_comm: [c_char; crate::COMMLEN + 1], ++ /// Emulation name. ++ pub ki_emul: [c_char; crate::KI_EMULNAMELEN + 1], ++ /// Login class. ++ pub ki_loginclass: [c_char; crate::LOGINCLASSLEN + 1], ++ /// More thread name. ++ pub ki_moretdname: [c_char; crate::MAXCOMLEN - crate::TDNAMLEN + 1], ++ /// Spare string space. ++ pub ki_sparestrings: [[c_char; 23]; 2], // little hack to allow PartialEq ++ /// Spare room for growth. ++ pub ki_spareints: [c_int; crate::KI_NSPARE_INT], ++ /// Controlling tty dev. ++ pub ki_tdev: u64, ++ /// Which cpu we are on. ++ pub ki_oncpu: c_int, ++ /// Last cpu we were on. ++ pub ki_lastcpu: c_int, ++ /// PID of tracing process. ++ pub ki_tracer: c_int, ++ /// P2_* flags. ++ pub ki_flag2: c_int, ++ /// Default FIB number. ++ pub ki_fibnum: c_int, ++ /// Credential flags. ++ pub ki_cr_flags: crate::u_int, ++ /// Process jail ID. ++ pub ki_jid: c_int, ++ /// Number of threads in total. ++ pub ki_numthreads: c_int, ++ /// Thread ID. ++ pub ki_tid: crate::lwpid_t, ++ /// Process priority. ++ pub ki_pri: crate::priority, ++ /// Process rusage statistics. ++ pub ki_rusage: crate::rusage, ++ /// rusage of children processes. ++ pub ki_rusage_ch: crate::rusage, ++ // This is normally "struct pcb". ++ /// Kernel virtual addr of pcb. ++ pub ki_pcb: *mut c_void, ++ /// Kernel virtual addr of stack. ++ pub ki_kstack: *mut c_void, ++ /// User convenience pointer. ++ pub ki_udata: *mut c_void, ++ // This is normally "struct thread". ++ pub ki_tdaddr: *mut c_void, ++ // This is normally "struct pwddesc". ++ /// Pointer to process paths info. ++ pub ki_pd: *mut c_void, ++ pub ki_spareptrs: [*mut c_void; crate::KI_NSPARE_PTR], ++ pub ki_sparelongs: [c_long; crate::KI_NSPARE_LONG], ++ /// PS_* flags. ++ pub ki_sflag: c_long, ++ /// kthread flag. ++ pub ki_tdflags: c_long, ++ } ++ ++ pub struct stat { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_mode: crate::mode_t, ++ st_padding0: i16, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ st_padding1: i32, ++ pub st_rdev: crate::dev_t, ++ #[cfg(target_arch = "x86")] ++ st_atim_ext: i32, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ #[cfg(target_arch = "x86")] ++ st_mtim_ext: i32, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ #[cfg(target_arch = "x86")] ++ st_ctim_ext: i32, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ #[cfg(target_arch = "x86")] ++ st_btim_ext: i32, ++ pub st_birthtime: crate::time_t, ++ pub st_birthtime_nsec: c_long, ++ pub st_size: off_t, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_blksize: crate::blksize_t, ++ pub st_flags: crate::fflags_t, ++ pub st_gen: u64, ++ pub st_spare: [u64; 10], ++ } ++} ++ ++s_no_extra_traits! { ++ pub struct dirent { ++ pub d_fileno: crate::ino_t, ++ pub d_off: off_t, ++ pub d_reclen: u16, ++ pub d_type: u8, ++ d_pad0: u8, ++ pub d_namlen: u16, ++ d_pad1: u16, ++ pub d_name: [c_char; 256], ++ } ++ ++ pub struct statfs { ++ pub f_version: u32, ++ pub f_type: u32, ++ pub f_flags: u64, ++ pub f_bsize: u64, ++ pub f_iosize: u64, ++ pub f_blocks: u64, ++ pub f_bfree: u64, ++ pub f_bavail: i64, ++ pub f_files: u64, ++ pub f_ffree: i64, ++ pub f_syncwrites: u64, ++ pub f_asyncwrites: u64, ++ pub f_syncreads: u64, ++ pub f_asyncreads: u64, ++ f_spare: [u64; 10], ++ pub f_namemax: u32, ++ pub f_owner: crate::uid_t, ++ pub f_fsid: crate::fsid_t, ++ f_charspare: [c_char; 80], ++ pub f_fstypename: [c_char; 16], ++ pub f_mntfromname: [c_char; 1024], ++ pub f_mntonname: [c_char; 1024], ++ } ++ ++ pub struct vnstat { ++ pub vn_fileid: u64, ++ pub vn_size: u64, ++ pub vn_dev: u64, ++ pub vn_fsid: u64, ++ pub vn_mntdir: *mut c_char, ++ pub vn_type: c_int, ++ pub vn_mode: u16, ++ pub vn_devname: [c_char; crate::SPECNAMELEN as usize + 1], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for statfs { ++ fn eq(&self, other: &statfs) -> bool { ++ self.f_version == other.f_version ++ && self.f_type == other.f_type ++ && self.f_flags == other.f_flags ++ && self.f_bsize == other.f_bsize ++ && self.f_iosize == other.f_iosize ++ && self.f_blocks == other.f_blocks ++ && self.f_bfree == other.f_bfree ++ && self.f_bavail == other.f_bavail ++ && self.f_files == other.f_files ++ && self.f_ffree == other.f_ffree ++ && self.f_syncwrites == other.f_syncwrites ++ && self.f_asyncwrites == other.f_asyncwrites ++ && self.f_syncreads == other.f_syncreads ++ && self.f_asyncreads == other.f_asyncreads ++ && self.f_namemax == other.f_namemax ++ && self.f_owner == other.f_owner ++ && self.f_fsid == other.f_fsid ++ && self.f_fstypename == other.f_fstypename ++ && self ++ .f_mntfromname ++ .iter() ++ .zip(other.f_mntfromname.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .f_mntonname ++ .iter() ++ .zip(other.f_mntonname.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for statfs {} ++ impl fmt::Debug for statfs { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("statfs") ++ .field("f_bsize", &self.f_bsize) ++ .field("f_iosize", &self.f_iosize) ++ .field("f_blocks", &self.f_blocks) ++ .field("f_bfree", &self.f_bfree) ++ .field("f_bavail", &self.f_bavail) ++ .field("f_files", &self.f_files) ++ .field("f_ffree", &self.f_ffree) ++ .field("f_syncwrites", &self.f_syncwrites) ++ .field("f_asyncwrites", &self.f_asyncwrites) ++ .field("f_syncreads", &self.f_syncreads) ++ .field("f_asyncreads", &self.f_asyncreads) ++ .field("f_namemax", &self.f_namemax) ++ .field("f_owner", &self.f_owner) ++ .field("f_fsid", &self.f_fsid) ++ .field("f_fstypename", &self.f_fstypename) ++ .field("f_mntfromname", &&self.f_mntfromname[..]) ++ .field("f_mntonname", &&self.f_mntonname[..]) ++ .finish() ++ } ++ } ++ impl hash::Hash for statfs { ++ fn hash(&self, state: &mut H) { ++ self.f_version.hash(state); ++ self.f_type.hash(state); ++ self.f_flags.hash(state); ++ self.f_bsize.hash(state); ++ self.f_iosize.hash(state); ++ self.f_blocks.hash(state); ++ self.f_bfree.hash(state); ++ self.f_bavail.hash(state); ++ self.f_files.hash(state); ++ self.f_ffree.hash(state); ++ self.f_syncwrites.hash(state); ++ self.f_asyncwrites.hash(state); ++ self.f_syncreads.hash(state); ++ self.f_asyncreads.hash(state); ++ self.f_namemax.hash(state); ++ self.f_owner.hash(state); ++ self.f_fsid.hash(state); ++ self.f_charspare.hash(state); ++ self.f_fstypename.hash(state); ++ self.f_mntfromname.hash(state); ++ self.f_mntonname.hash(state); ++ } ++ } ++ ++ impl PartialEq for dirent { ++ fn eq(&self, other: &dirent) -> bool { ++ self.d_fileno == other.d_fileno ++ && self.d_off == other.d_off ++ && self.d_reclen == other.d_reclen ++ && self.d_type == other.d_type ++ && self.d_namlen == other.d_namlen ++ && self.d_name[..self.d_namlen as _] ++ .iter() ++ .zip(other.d_name.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for dirent {} ++ impl fmt::Debug for dirent { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("dirent") ++ .field("d_fileno", &self.d_fileno) ++ .field("d_off", &self.d_off) ++ .field("d_reclen", &self.d_reclen) ++ .field("d_type", &self.d_type) ++ .field("d_namlen", &self.d_namlen) ++ .field("d_name", &&self.d_name[..self.d_namlen as _]) ++ .finish() ++ } ++ } ++ impl hash::Hash for dirent { ++ fn hash(&self, state: &mut H) { ++ self.d_fileno.hash(state); ++ self.d_off.hash(state); ++ self.d_reclen.hash(state); ++ self.d_type.hash(state); ++ self.d_namlen.hash(state); ++ self.d_name[..self.d_namlen as _].hash(state); ++ } ++ } ++ ++ impl PartialEq for vnstat { ++ fn eq(&self, other: &vnstat) -> bool { ++ let self_vn_devname: &[c_char] = &self.vn_devname; ++ let other_vn_devname: &[c_char] = &other.vn_devname; ++ ++ self.vn_fileid == other.vn_fileid ++ && self.vn_size == other.vn_size ++ && self.vn_dev == other.vn_dev ++ && self.vn_fsid == other.vn_fsid ++ && self.vn_mntdir == other.vn_mntdir ++ && self.vn_type == other.vn_type ++ && self.vn_mode == other.vn_mode ++ && self_vn_devname == other_vn_devname ++ } ++ } ++ impl Eq for vnstat {} ++ impl fmt::Debug for vnstat { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ let self_vn_devname: &[c_char] = &self.vn_devname; ++ ++ f.debug_struct("vnstat") ++ .field("vn_fileid", &self.vn_fileid) ++ .field("vn_size", &self.vn_size) ++ .field("vn_dev", &self.vn_dev) ++ .field("vn_fsid", &self.vn_fsid) ++ .field("vn_mntdir", &self.vn_mntdir) ++ .field("vn_type", &self.vn_type) ++ .field("vn_mode", &self.vn_mode) ++ .field("vn_devname", &self_vn_devname) ++ .finish() ++ } ++ } ++ impl hash::Hash for vnstat { ++ fn hash(&self, state: &mut H) { ++ let self_vn_devname: &[c_char] = &self.vn_devname; ++ ++ self.vn_fileid.hash(state); ++ self.vn_size.hash(state); ++ self.vn_dev.hash(state); ++ self.vn_fsid.hash(state); ++ self.vn_mntdir.hash(state); ++ self.vn_type.hash(state); ++ self.vn_mode.hash(state); ++ self_vn_devname.hash(state); ++ } ++ } ++ } ++} ++ ++pub const RAND_MAX: c_int = 0x7fff_ffff; ++pub const ELAST: c_int = 97; ++ ++pub const KF_TYPE_EVENTFD: c_int = 13; ++ ++/// max length of devicename ++pub const SPECNAMELEN: c_int = 255; ++pub const KI_NSPARE_PTR: usize = 5; ++ ++/// domainset policies ++pub const DOMAINSET_POLICY_INVALID: c_int = 0; ++pub const DOMAINSET_POLICY_ROUNDROBIN: c_int = 1; ++pub const DOMAINSET_POLICY_FIRSTTOUCH: c_int = 2; ++pub const DOMAINSET_POLICY_PREFER: c_int = 3; ++pub const DOMAINSET_POLICY_INTERLEAVE: c_int = 4; ++ ++pub const MINCORE_SUPER: c_int = 0x20; ++ ++safe_f! { ++ pub {const} fn makedev(major: c_uint, minor: c_uint) -> crate::dev_t { ++ let major = major as crate::dev_t; ++ let minor = minor as crate::dev_t; ++ let mut dev = 0; ++ dev |= ((major & 0xffffff00) as dev_t) << 32; ++ dev |= ((major & 0x000000ff) as dev_t) << 8; ++ dev |= ((minor & 0x0000ff00) as dev_t) << 24; ++ dev |= ((minor & 0xffff00ff) as dev_t) << 0; ++ dev ++ } ++} ++ ++f! { ++ pub fn major(dev: crate::dev_t) -> c_int { ++ (((dev >> 32) & 0xffffff00) | ((dev >> 8) & 0xff)) as c_int ++ } ++ ++ pub fn minor(dev: crate::dev_t) -> c_int { ++ (((dev >> 24) & 0xff00) | (dev & 0xffff00ff)) as c_int ++ } ++} ++ ++extern "C" { ++ pub fn setgrent(); ++ pub fn mprotect(addr: *mut c_void, len: size_t, prot: c_int) -> c_int; ++ pub fn freelocale(loc: crate::locale_t); ++ pub fn msgrcv( ++ msqid: c_int, ++ msgp: *mut c_void, ++ msgsz: size_t, ++ msgtyp: c_long, ++ msgflg: c_int, ++ ) -> ssize_t; ++ ++ pub fn cpuset_getdomain( ++ level: crate::cpulevel_t, ++ which: crate::cpuwhich_t, ++ id: crate::id_t, ++ setsize: size_t, ++ mask: *mut crate::domainset_t, ++ policy: *mut c_int, ++ ) -> c_int; ++ pub fn cpuset_setdomain( ++ level: crate::cpulevel_t, ++ which: crate::cpuwhich_t, ++ id: crate::id_t, ++ setsize: size_t, ++ mask: *const crate::domainset_t, ++ policy: c_int, ++ ) -> c_int; ++ ++ pub fn dirname(path: *mut c_char) -> *mut c_char; ++ pub fn basename(path: *mut c_char) -> *mut c_char; ++} ++ ++#[link(name = "kvm")] ++extern "C" { ++ pub fn kvm_kerndisp(kd: *mut crate::kvm_t) -> crate::kssize_t; ++} ++ ++cfg_if! { ++ if #[cfg(target_arch = "x86_64")] { ++ mod x86_64; ++ pub use self::x86_64::*; ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd13/x86_64.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd13/x86_64.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd13/x86_64.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd13/x86_64.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,7 @@ ++use crate::prelude::*; ++ ++pub const PROC_KPTI_CTL: c_int = crate::PROC_PROCCTL_MD_MIN; ++pub const PROC_KPTI_CTL_ENABLE_ON_EXEC: c_int = 1; ++pub const PROC_KPTI_CTL_DISABLE_ON_EXEC: c_int = 2; ++pub const PROC_KPTI_STATUS: c_int = crate::PROC_PROCCTL_MD_MIN + 1; ++pub const PROC_KPTI_STATUS_ACTIVE: c_int = 0x80000000; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd14/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,576 @@ ++use crate::off_t; ++use crate::prelude::*; ++ ++// APIs in FreeBSD 14 that have changed since 11. ++ ++pub type nlink_t = u64; ++pub type dev_t = u64; ++pub type ino_t = u64; ++pub type shmatt_t = c_uint; ++pub type kpaddr_t = u64; ++pub type kssize_t = i64; ++pub type domainset_t = __c_anonymous_domainset; ++ ++s! { ++ pub struct shmid_ds { ++ pub shm_perm: crate::ipc_perm, ++ pub shm_segsz: size_t, ++ pub shm_lpid: crate::pid_t, ++ pub shm_cpid: crate::pid_t, ++ pub shm_nattch: crate::shmatt_t, ++ pub shm_atime: crate::time_t, ++ pub shm_dtime: crate::time_t, ++ pub shm_ctime: crate::time_t, ++ } ++ ++ pub struct kevent { ++ pub ident: crate::uintptr_t, ++ pub filter: c_short, ++ pub flags: c_ushort, ++ pub fflags: c_uint, ++ pub data: i64, ++ pub udata: *mut c_void, ++ pub ext: [u64; 4], ++ } ++ ++ pub struct kvm_page { ++ pub kp_version: crate::u_int, ++ pub kp_paddr: crate::kpaddr_t, ++ pub kp_kmap_vaddr: crate::kvaddr_t, ++ pub kp_dmap_vaddr: crate::kvaddr_t, ++ pub kp_prot: crate::vm_prot_t, ++ pub kp_offset: off_t, ++ pub kp_len: size_t, ++ } ++ ++ pub struct __c_anonymous_domainset { ++ #[cfg(target_pointer_width = "64")] ++ _priv: [c_ulong; 4], ++ #[cfg(target_pointer_width = "32")] ++ _priv: [c_ulong; 8], ++ } ++ ++ pub struct kinfo_proc { ++ /// Size of this structure. ++ pub ki_structsize: c_int, ++ /// Reserved: layout identifier. ++ pub ki_layout: c_int, ++ /// Address of command arguments. ++ pub ki_args: *mut crate::pargs, ++ // This is normally "struct proc". ++ /// Address of proc. ++ pub ki_paddr: *mut c_void, ++ // This is normally "struct user". ++ /// Kernel virtual address of u-area. ++ pub ki_addr: *mut c_void, ++ // This is normally "struct vnode". ++ /// Pointer to trace file. ++ pub ki_tracep: *mut c_void, ++ // This is normally "struct vnode". ++ /// Pointer to executable file. ++ pub ki_textvp: *mut c_void, ++ // This is normally "struct filedesc". ++ /// Pointer to open file info. ++ pub ki_fd: *mut c_void, ++ // This is normally "struct vmspace". ++ /// Pointer to kernel vmspace struct. ++ pub ki_vmspace: *mut c_void, ++ /// Sleep address. ++ pub ki_wchan: *const c_void, ++ /// Process identifier. ++ pub ki_pid: crate::pid_t, ++ /// Parent process ID. ++ pub ki_ppid: crate::pid_t, ++ /// Process group ID. ++ pub ki_pgid: crate::pid_t, ++ /// tty process group ID. ++ pub ki_tpgid: crate::pid_t, ++ /// Process session ID. ++ pub ki_sid: crate::pid_t, ++ /// Terminal session ID. ++ pub ki_tsid: crate::pid_t, ++ /// Job control counter. ++ pub ki_jobc: c_short, ++ /// Unused (just here for alignment). ++ pub ki_spare_short1: c_short, ++ /// Controlling tty dev. ++ pub ki_tdev_freebsd11: u32, ++ /// Signals arrived but not delivered. ++ pub ki_siglist: crate::sigset_t, ++ /// Current signal mask. ++ pub ki_sigmask: crate::sigset_t, ++ /// Signals being ignored. ++ pub ki_sigignore: crate::sigset_t, ++ /// Signals being caught by user. ++ pub ki_sigcatch: crate::sigset_t, ++ /// Effective user ID. ++ pub ki_uid: crate::uid_t, ++ /// Real user ID. ++ pub ki_ruid: crate::uid_t, ++ /// Saved effective user ID. ++ pub ki_svuid: crate::uid_t, ++ /// Real group ID. ++ pub ki_rgid: crate::gid_t, ++ /// Saved effective group ID. ++ pub ki_svgid: crate::gid_t, ++ /// Number of groups. ++ pub ki_ngroups: c_short, ++ /// Unused (just here for alignment). ++ pub ki_spare_short2: c_short, ++ /// Groups. ++ pub ki_groups: [crate::gid_t; crate::KI_NGROUPS], ++ /// Virtual size. ++ pub ki_size: crate::vm_size_t, ++ /// Current resident set size in pages. ++ pub ki_rssize: crate::segsz_t, ++ /// Resident set size before last swap. ++ pub ki_swrss: crate::segsz_t, ++ /// Text size (pages) XXX. ++ pub ki_tsize: crate::segsz_t, ++ /// Data size (pages) XXX. ++ pub ki_dsize: crate::segsz_t, ++ /// Stack size (pages). ++ pub ki_ssize: crate::segsz_t, ++ /// Exit status for wait & stop signal. ++ pub ki_xstat: crate::u_short, ++ /// Accounting flags. ++ pub ki_acflag: crate::u_short, ++ /// %cpu for process during `ki_swtime`. ++ pub ki_pctcpu: crate::fixpt_t, ++ /// Time averaged value of `ki_cpticks`. ++ pub ki_estcpu: crate::u_int, ++ /// Time since last blocked. ++ pub ki_slptime: crate::u_int, ++ /// Time swapped in or out. ++ pub ki_swtime: crate::u_int, ++ /// Number of copy-on-write faults. ++ pub ki_cow: crate::u_int, ++ /// Real time in microsec. ++ pub ki_runtime: u64, ++ /// Starting time. ++ pub ki_start: crate::timeval, ++ /// Time used by process children. ++ pub ki_childtime: crate::timeval, ++ /// P_* flags. ++ pub ki_flag: c_long, ++ /// KI_* flags (below). ++ pub ki_kiflag: c_long, ++ /// Kernel trace points. ++ pub ki_traceflag: c_int, ++ /// S* process status. ++ pub ki_stat: c_char, ++ /// Process "nice" value. ++ pub ki_nice: i8, // signed char ++ /// Process lock (prevent swap) count. ++ pub ki_lock: c_char, ++ /// Run queue index. ++ pub ki_rqindex: c_char, ++ /// Which cpu we are on. ++ pub ki_oncpu_old: c_uchar, ++ /// Last cpu we were on. ++ pub ki_lastcpu_old: c_uchar, ++ /// Thread name. ++ pub ki_tdname: [c_char; crate::TDNAMLEN + 1], ++ /// Wchan message. ++ pub ki_wmesg: [c_char; crate::WMESGLEN + 1], ++ /// Setlogin name. ++ pub ki_login: [c_char; crate::LOGNAMELEN + 1], ++ /// Lock name. ++ pub ki_lockname: [c_char; crate::LOCKNAMELEN + 1], ++ /// Command name. ++ pub ki_comm: [c_char; crate::COMMLEN + 1], ++ /// Emulation name. ++ pub ki_emul: [c_char; crate::KI_EMULNAMELEN + 1], ++ /// Login class. ++ pub ki_loginclass: [c_char; crate::LOGINCLASSLEN + 1], ++ /// More thread name. ++ pub ki_moretdname: [c_char; crate::MAXCOMLEN - crate::TDNAMLEN + 1], ++ /// Spare string space. ++ pub ki_sparestrings: [[c_char; 23]; 2], // little hack to allow PartialEq ++ /// Spare room for growth. ++ pub ki_spareints: [c_int; crate::KI_NSPARE_INT], ++ /// Controlling tty dev. ++ pub ki_tdev: u64, ++ /// Which cpu we are on. ++ pub ki_oncpu: c_int, ++ /// Last cpu we were on. ++ pub ki_lastcpu: c_int, ++ /// PID of tracing process. ++ pub ki_tracer: c_int, ++ /// P2_* flags. ++ pub ki_flag2: c_int, ++ /// Default FIB number. ++ pub ki_fibnum: c_int, ++ /// Credential flags. ++ pub ki_cr_flags: crate::u_int, ++ /// Process jail ID. ++ pub ki_jid: c_int, ++ /// Number of threads in total. ++ pub ki_numthreads: c_int, ++ /// Thread ID. ++ pub ki_tid: crate::lwpid_t, ++ /// Process priority. ++ pub ki_pri: crate::priority, ++ /// Process rusage statistics. ++ pub ki_rusage: crate::rusage, ++ /// rusage of children processes. ++ pub ki_rusage_ch: crate::rusage, ++ // This is normally "struct pcb". ++ /// Kernel virtual addr of pcb. ++ pub ki_pcb: *mut c_void, ++ /// Kernel virtual addr of stack. ++ pub ki_kstack: *mut c_void, ++ /// User convenience pointer. ++ pub ki_udata: *mut c_void, ++ // This is normally "struct thread". ++ pub ki_tdaddr: *mut c_void, ++ // This is normally "struct pwddesc". ++ /// Pointer to process paths info. ++ pub ki_pd: *mut c_void, ++ pub ki_spareptrs: [*mut c_void; crate::KI_NSPARE_PTR], ++ pub ki_sparelongs: [c_long; crate::KI_NSPARE_LONG], ++ /// PS_* flags. ++ pub ki_sflag: c_long, ++ /// kthread flag. ++ pub ki_tdflags: c_long, ++ } ++ ++ pub struct stat { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_mode: crate::mode_t, ++ st_padding0: i16, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ st_padding1: i32, ++ pub st_rdev: crate::dev_t, ++ #[cfg(target_arch = "x86")] ++ st_atim_ext: i32, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ #[cfg(target_arch = "x86")] ++ st_mtim_ext: i32, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ #[cfg(target_arch = "x86")] ++ st_ctim_ext: i32, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ #[cfg(target_arch = "x86")] ++ st_btim_ext: i32, ++ pub st_birthtime: crate::time_t, ++ pub st_birthtime_nsec: c_long, ++ pub st_size: off_t, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_blksize: crate::blksize_t, ++ pub st_flags: crate::fflags_t, ++ pub st_gen: u64, ++ pub st_spare: [u64; 10], ++ } ++} ++ ++s_no_extra_traits! { ++ pub struct dirent { ++ pub d_fileno: crate::ino_t, ++ pub d_off: off_t, ++ pub d_reclen: u16, ++ pub d_type: u8, ++ d_pad0: u8, ++ pub d_namlen: u16, ++ d_pad1: u16, ++ pub d_name: [c_char; 256], ++ } ++ ++ pub struct statfs { ++ pub f_version: u32, ++ pub f_type: u32, ++ pub f_flags: u64, ++ pub f_bsize: u64, ++ pub f_iosize: u64, ++ pub f_blocks: u64, ++ pub f_bfree: u64, ++ pub f_bavail: i64, ++ pub f_files: u64, ++ pub f_ffree: i64, ++ pub f_syncwrites: u64, ++ pub f_asyncwrites: u64, ++ pub f_syncreads: u64, ++ pub f_asyncreads: u64, ++ f_spare: [u64; 10], ++ pub f_namemax: u32, ++ pub f_owner: crate::uid_t, ++ pub f_fsid: crate::fsid_t, ++ f_charspare: [c_char; 80], ++ pub f_fstypename: [c_char; 16], ++ pub f_mntfromname: [c_char; 1024], ++ pub f_mntonname: [c_char; 1024], ++ } ++ ++ pub struct vnstat { ++ pub vn_fileid: u64, ++ pub vn_size: u64, ++ pub vn_dev: u64, ++ pub vn_fsid: u64, ++ pub vn_mntdir: *mut c_char, ++ pub vn_type: c_int, ++ pub vn_mode: u16, ++ pub vn_devname: [c_char; crate::SPECNAMELEN as usize + 1], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for statfs { ++ fn eq(&self, other: &statfs) -> bool { ++ self.f_version == other.f_version ++ && self.f_type == other.f_type ++ && self.f_flags == other.f_flags ++ && self.f_bsize == other.f_bsize ++ && self.f_iosize == other.f_iosize ++ && self.f_blocks == other.f_blocks ++ && self.f_bfree == other.f_bfree ++ && self.f_bavail == other.f_bavail ++ && self.f_files == other.f_files ++ && self.f_ffree == other.f_ffree ++ && self.f_syncwrites == other.f_syncwrites ++ && self.f_asyncwrites == other.f_asyncwrites ++ && self.f_syncreads == other.f_syncreads ++ && self.f_asyncreads == other.f_asyncreads ++ && self.f_namemax == other.f_namemax ++ && self.f_owner == other.f_owner ++ && self.f_fsid == other.f_fsid ++ && self.f_fstypename == other.f_fstypename ++ && self ++ .f_mntfromname ++ .iter() ++ .zip(other.f_mntfromname.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .f_mntonname ++ .iter() ++ .zip(other.f_mntonname.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for statfs {} ++ impl fmt::Debug for statfs { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("statfs") ++ .field("f_bsize", &self.f_bsize) ++ .field("f_iosize", &self.f_iosize) ++ .field("f_blocks", &self.f_blocks) ++ .field("f_bfree", &self.f_bfree) ++ .field("f_bavail", &self.f_bavail) ++ .field("f_files", &self.f_files) ++ .field("f_ffree", &self.f_ffree) ++ .field("f_syncwrites", &self.f_syncwrites) ++ .field("f_asyncwrites", &self.f_asyncwrites) ++ .field("f_syncreads", &self.f_syncreads) ++ .field("f_asyncreads", &self.f_asyncreads) ++ .field("f_namemax", &self.f_namemax) ++ .field("f_owner", &self.f_owner) ++ .field("f_fsid", &self.f_fsid) ++ .field("f_fstypename", &self.f_fstypename) ++ .field("f_mntfromname", &&self.f_mntfromname[..]) ++ .field("f_mntonname", &&self.f_mntonname[..]) ++ .finish() ++ } ++ } ++ impl hash::Hash for statfs { ++ fn hash(&self, state: &mut H) { ++ self.f_version.hash(state); ++ self.f_type.hash(state); ++ self.f_flags.hash(state); ++ self.f_bsize.hash(state); ++ self.f_iosize.hash(state); ++ self.f_blocks.hash(state); ++ self.f_bfree.hash(state); ++ self.f_bavail.hash(state); ++ self.f_files.hash(state); ++ self.f_ffree.hash(state); ++ self.f_syncwrites.hash(state); ++ self.f_asyncwrites.hash(state); ++ self.f_syncreads.hash(state); ++ self.f_asyncreads.hash(state); ++ self.f_namemax.hash(state); ++ self.f_owner.hash(state); ++ self.f_fsid.hash(state); ++ self.f_charspare.hash(state); ++ self.f_fstypename.hash(state); ++ self.f_mntfromname.hash(state); ++ self.f_mntonname.hash(state); ++ } ++ } ++ ++ impl PartialEq for dirent { ++ fn eq(&self, other: &dirent) -> bool { ++ self.d_fileno == other.d_fileno ++ && self.d_off == other.d_off ++ && self.d_reclen == other.d_reclen ++ && self.d_type == other.d_type ++ && self.d_namlen == other.d_namlen ++ && self.d_name[..self.d_namlen as _] ++ .iter() ++ .zip(other.d_name.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for dirent {} ++ impl fmt::Debug for dirent { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("dirent") ++ .field("d_fileno", &self.d_fileno) ++ .field("d_off", &self.d_off) ++ .field("d_reclen", &self.d_reclen) ++ .field("d_type", &self.d_type) ++ .field("d_namlen", &self.d_namlen) ++ .field("d_name", &&self.d_name[..self.d_namlen as _]) ++ .finish() ++ } ++ } ++ impl hash::Hash for dirent { ++ fn hash(&self, state: &mut H) { ++ self.d_fileno.hash(state); ++ self.d_off.hash(state); ++ self.d_reclen.hash(state); ++ self.d_type.hash(state); ++ self.d_namlen.hash(state); ++ self.d_name[..self.d_namlen as _].hash(state); ++ } ++ } ++ ++ impl PartialEq for vnstat { ++ fn eq(&self, other: &vnstat) -> bool { ++ let self_vn_devname: &[c_char] = &self.vn_devname; ++ let other_vn_devname: &[c_char] = &other.vn_devname; ++ ++ self.vn_fileid == other.vn_fileid ++ && self.vn_size == other.vn_size ++ && self.vn_dev == other.vn_dev ++ && self.vn_fsid == other.vn_fsid ++ && self.vn_mntdir == other.vn_mntdir ++ && self.vn_type == other.vn_type ++ && self.vn_mode == other.vn_mode ++ && self_vn_devname == other_vn_devname ++ } ++ } ++ impl Eq for vnstat {} ++ impl fmt::Debug for vnstat { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ let self_vn_devname: &[c_char] = &self.vn_devname; ++ ++ f.debug_struct("vnstat") ++ .field("vn_fileid", &self.vn_fileid) ++ .field("vn_size", &self.vn_size) ++ .field("vn_dev", &self.vn_dev) ++ .field("vn_fsid", &self.vn_fsid) ++ .field("vn_mntdir", &self.vn_mntdir) ++ .field("vn_type", &self.vn_type) ++ .field("vn_mode", &self.vn_mode) ++ .field("vn_devname", &self_vn_devname) ++ .finish() ++ } ++ } ++ impl hash::Hash for vnstat { ++ fn hash(&self, state: &mut H) { ++ let self_vn_devname: &[c_char] = &self.vn_devname; ++ ++ self.vn_fileid.hash(state); ++ self.vn_size.hash(state); ++ self.vn_dev.hash(state); ++ self.vn_fsid.hash(state); ++ self.vn_mntdir.hash(state); ++ self.vn_type.hash(state); ++ self.vn_mode.hash(state); ++ self_vn_devname.hash(state); ++ } ++ } ++ } ++} ++ ++pub const RAND_MAX: c_int = 0x7fff_ffff; ++pub const ELAST: c_int = 97; ++ ++pub const KF_TYPE_EVENTFD: c_int = 13; ++ ++/// max length of devicename ++pub const SPECNAMELEN: c_int = 255; ++pub const KI_NSPARE_PTR: usize = 5; ++ ++/// domainset policies ++pub const DOMAINSET_POLICY_INVALID: c_int = 0; ++pub const DOMAINSET_POLICY_ROUNDROBIN: c_int = 1; ++pub const DOMAINSET_POLICY_FIRSTTOUCH: c_int = 2; ++pub const DOMAINSET_POLICY_PREFER: c_int = 3; ++pub const DOMAINSET_POLICY_INTERLEAVE: c_int = 4; ++ ++pub const MINCORE_SUPER: c_int = 0x60; ++ ++safe_f! { ++ pub {const} fn makedev(major: c_uint, minor: c_uint) -> crate::dev_t { ++ let major = major as crate::dev_t; ++ let minor = minor as crate::dev_t; ++ let mut dev = 0; ++ dev |= ((major & 0xffffff00) as dev_t) << 32; ++ dev |= ((major & 0x000000ff) as dev_t) << 8; ++ dev |= ((minor & 0x0000ff00) as dev_t) << 24; ++ dev |= ((minor & 0xffff00ff) as dev_t) << 0; ++ dev ++ } ++} ++ ++f! { ++ pub fn major(dev: crate::dev_t) -> c_int { ++ (((dev >> 32) & 0xffffff00) | ((dev >> 8) & 0xff)) as c_int ++ } ++ ++ pub fn minor(dev: crate::dev_t) -> c_int { ++ (((dev >> 24) & 0xff00) | (dev & 0xffff00ff)) as c_int ++ } ++} ++ ++extern "C" { ++ pub fn setgrent(); ++ pub fn mprotect(addr: *mut c_void, len: size_t, prot: c_int) -> c_int; ++ pub fn freelocale(loc: crate::locale_t); ++ pub fn msgrcv( ++ msqid: c_int, ++ msgp: *mut c_void, ++ msgsz: size_t, ++ msgtyp: c_long, ++ msgflg: c_int, ++ ) -> ssize_t; ++ ++ pub fn cpuset_getdomain( ++ level: crate::cpulevel_t, ++ which: crate::cpuwhich_t, ++ id: crate::id_t, ++ setsize: size_t, ++ mask: *mut crate::domainset_t, ++ policy: *mut c_int, ++ ) -> c_int; ++ pub fn cpuset_setdomain( ++ level: crate::cpulevel_t, ++ which: crate::cpuwhich_t, ++ id: crate::id_t, ++ setsize: size_t, ++ mask: *const crate::domainset_t, ++ policy: c_int, ++ ) -> c_int; ++ ++ pub fn dirname(path: *mut c_char) -> *mut c_char; ++ pub fn basename(path: *mut c_char) -> *mut c_char; ++} ++ ++#[link(name = "kvm")] ++extern "C" { ++ pub fn kvm_kerndisp(kd: *mut crate::kvm_t) -> crate::kssize_t; ++} ++ ++cfg_if! { ++ if #[cfg(target_arch = "x86_64")] { ++ mod x86_64; ++ pub use self::x86_64::*; ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd14/x86_64.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,14 @@ ++use crate::prelude::*; ++ ++pub const PROC_KPTI_CTL: c_int = crate::PROC_PROCCTL_MD_MIN; ++pub const PROC_KPTI_CTL_ENABLE_ON_EXEC: c_int = 1; ++pub const PROC_KPTI_CTL_DISABLE_ON_EXEC: c_int = 2; ++pub const PROC_KPTI_STATUS: c_int = crate::PROC_PROCCTL_MD_MIN + 1; ++pub const PROC_KPTI_STATUS_ACTIVE: c_int = 0x80000000; ++pub const PROC_LA_CTL: c_int = crate::PROC_PROCCTL_MD_MIN + 2; ++pub const PROC_LA_STATUS: c_int = crate::PROC_PROCCTL_MD_MIN + 3; ++pub const PROC_LA_CTL_LA48_ON_EXEC: c_int = 1; ++pub const PROC_LA_CTL_LA57_ON_EXEC: c_int = 2; ++pub const PROC_LA_CTL_DEFAULT_ON_EXEC: c_int = 3; ++pub const PROC_LA_STATUS_LA48: c_int = 0x01000000; ++pub const PROC_LA_STATUS_LA57: c_int = 0x02000000; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd15/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,576 @@ ++use crate::off_t; ++use crate::prelude::*; ++ ++// APIs in FreeBSD 15 that have changed since 11. ++ ++pub type nlink_t = u64; ++pub type dev_t = u64; ++pub type ino_t = u64; ++pub type shmatt_t = c_uint; ++pub type kpaddr_t = u64; ++pub type kssize_t = i64; ++pub type domainset_t = __c_anonymous_domainset; ++ ++s! { ++ pub struct shmid_ds { ++ pub shm_perm: crate::ipc_perm, ++ pub shm_segsz: size_t, ++ pub shm_lpid: crate::pid_t, ++ pub shm_cpid: crate::pid_t, ++ pub shm_nattch: crate::shmatt_t, ++ pub shm_atime: crate::time_t, ++ pub shm_dtime: crate::time_t, ++ pub shm_ctime: crate::time_t, ++ } ++ ++ pub struct kevent { ++ pub ident: crate::uintptr_t, ++ pub filter: c_short, ++ pub flags: c_ushort, ++ pub fflags: c_uint, ++ pub data: i64, ++ pub udata: *mut c_void, ++ pub ext: [u64; 4], ++ } ++ ++ pub struct kvm_page { ++ pub kp_version: crate::u_int, ++ pub kp_paddr: crate::kpaddr_t, ++ pub kp_kmap_vaddr: crate::kvaddr_t, ++ pub kp_dmap_vaddr: crate::kvaddr_t, ++ pub kp_prot: crate::vm_prot_t, ++ pub kp_offset: off_t, ++ pub kp_len: size_t, ++ } ++ ++ pub struct __c_anonymous_domainset { ++ #[cfg(target_pointer_width = "64")] ++ _priv: [c_ulong; 4], ++ #[cfg(target_pointer_width = "32")] ++ _priv: [c_ulong; 8], ++ } ++ ++ pub struct kinfo_proc { ++ /// Size of this structure. ++ pub ki_structsize: c_int, ++ /// Reserved: layout identifier. ++ pub ki_layout: c_int, ++ /// Address of command arguments. ++ pub ki_args: *mut crate::pargs, ++ // This is normally "struct proc". ++ /// Address of proc. ++ pub ki_paddr: *mut c_void, ++ // This is normally "struct user". ++ /// Kernel virtual address of u-area. ++ pub ki_addr: *mut c_void, ++ // This is normally "struct vnode". ++ /// Pointer to trace file. ++ pub ki_tracep: *mut c_void, ++ // This is normally "struct vnode". ++ /// Pointer to executable file. ++ pub ki_textvp: *mut c_void, ++ // This is normally "struct filedesc". ++ /// Pointer to open file info. ++ pub ki_fd: *mut c_void, ++ // This is normally "struct vmspace". ++ /// Pointer to kernel vmspace struct. ++ pub ki_vmspace: *mut c_void, ++ /// Sleep address. ++ pub ki_wchan: *const c_void, ++ /// Process identifier. ++ pub ki_pid: crate::pid_t, ++ /// Parent process ID. ++ pub ki_ppid: crate::pid_t, ++ /// Process group ID. ++ pub ki_pgid: crate::pid_t, ++ /// tty process group ID. ++ pub ki_tpgid: crate::pid_t, ++ /// Process session ID. ++ pub ki_sid: crate::pid_t, ++ /// Terminal session ID. ++ pub ki_tsid: crate::pid_t, ++ /// Job control counter. ++ pub ki_jobc: c_short, ++ /// Unused (just here for alignment). ++ pub ki_spare_short1: c_short, ++ /// Controlling tty dev. ++ pub ki_tdev_freebsd11: u32, ++ /// Signals arrived but not delivered. ++ pub ki_siglist: crate::sigset_t, ++ /// Current signal mask. ++ pub ki_sigmask: crate::sigset_t, ++ /// Signals being ignored. ++ pub ki_sigignore: crate::sigset_t, ++ /// Signals being caught by user. ++ pub ki_sigcatch: crate::sigset_t, ++ /// Effective user ID. ++ pub ki_uid: crate::uid_t, ++ /// Real user ID. ++ pub ki_ruid: crate::uid_t, ++ /// Saved effective user ID. ++ pub ki_svuid: crate::uid_t, ++ /// Real group ID. ++ pub ki_rgid: crate::gid_t, ++ /// Saved effective group ID. ++ pub ki_svgid: crate::gid_t, ++ /// Number of groups. ++ pub ki_ngroups: c_short, ++ /// Unused (just here for alignment). ++ pub ki_spare_short2: c_short, ++ /// Groups. ++ pub ki_groups: [crate::gid_t; crate::KI_NGROUPS], ++ /// Virtual size. ++ pub ki_size: crate::vm_size_t, ++ /// Current resident set size in pages. ++ pub ki_rssize: crate::segsz_t, ++ /// Resident set size before last swap. ++ pub ki_swrss: crate::segsz_t, ++ /// Text size (pages) XXX. ++ pub ki_tsize: crate::segsz_t, ++ /// Data size (pages) XXX. ++ pub ki_dsize: crate::segsz_t, ++ /// Stack size (pages). ++ pub ki_ssize: crate::segsz_t, ++ /// Exit status for wait & stop signal. ++ pub ki_xstat: crate::u_short, ++ /// Accounting flags. ++ pub ki_acflag: crate::u_short, ++ /// %cpu for process during `ki_swtime`. ++ pub ki_pctcpu: crate::fixpt_t, ++ /// Time averaged value of `ki_cpticks`. ++ pub ki_estcpu: crate::u_int, ++ /// Time since last blocked. ++ pub ki_slptime: crate::u_int, ++ /// Time swapped in or out. ++ pub ki_swtime: crate::u_int, ++ /// Number of copy-on-write faults. ++ pub ki_cow: crate::u_int, ++ /// Real time in microsec. ++ pub ki_runtime: u64, ++ /// Starting time. ++ pub ki_start: crate::timeval, ++ /// Time used by process children. ++ pub ki_childtime: crate::timeval, ++ /// P_* flags. ++ pub ki_flag: c_long, ++ /// KI_* flags (below). ++ pub ki_kiflag: c_long, ++ /// Kernel trace points. ++ pub ki_traceflag: c_int, ++ /// S* process status. ++ pub ki_stat: c_char, ++ /// Process "nice" value. ++ pub ki_nice: i8, // signed char ++ /// Process lock (prevent swap) count. ++ pub ki_lock: c_char, ++ /// Run queue index. ++ pub ki_rqindex: c_char, ++ /// Which cpu we are on. ++ pub ki_oncpu_old: c_uchar, ++ /// Last cpu we were on. ++ pub ki_lastcpu_old: c_uchar, ++ /// Thread name. ++ pub ki_tdname: [c_char; crate::TDNAMLEN + 1], ++ /// Wchan message. ++ pub ki_wmesg: [c_char; crate::WMESGLEN + 1], ++ /// Setlogin name. ++ pub ki_login: [c_char; crate::LOGNAMELEN + 1], ++ /// Lock name. ++ pub ki_lockname: [c_char; crate::LOCKNAMELEN + 1], ++ /// Command name. ++ pub ki_comm: [c_char; crate::COMMLEN + 1], ++ /// Emulation name. ++ pub ki_emul: [c_char; crate::KI_EMULNAMELEN + 1], ++ /// Login class. ++ pub ki_loginclass: [c_char; crate::LOGINCLASSLEN + 1], ++ /// More thread name. ++ pub ki_moretdname: [c_char; crate::MAXCOMLEN - crate::TDNAMLEN + 1], ++ /// Spare string space. ++ pub ki_sparestrings: [[c_char; 23]; 2], // little hack to allow PartialEq ++ /// Spare room for growth. ++ pub ki_spareints: [c_int; crate::KI_NSPARE_INT], ++ /// Controlling tty dev. ++ pub ki_tdev: u64, ++ /// Which cpu we are on. ++ pub ki_oncpu: c_int, ++ /// Last cpu we were on. ++ pub ki_lastcpu: c_int, ++ /// PID of tracing process. ++ pub ki_tracer: c_int, ++ /// P2_* flags. ++ pub ki_flag2: c_int, ++ /// Default FIB number. ++ pub ki_fibnum: c_int, ++ /// Credential flags. ++ pub ki_cr_flags: crate::u_int, ++ /// Process jail ID. ++ pub ki_jid: c_int, ++ /// Number of threads in total. ++ pub ki_numthreads: c_int, ++ /// Thread ID. ++ pub ki_tid: crate::lwpid_t, ++ /// Process priority. ++ pub ki_pri: crate::priority, ++ /// Process rusage statistics. ++ pub ki_rusage: crate::rusage, ++ /// rusage of children processes. ++ pub ki_rusage_ch: crate::rusage, ++ // This is normally "struct pcb". ++ /// Kernel virtual addr of pcb. ++ pub ki_pcb: *mut c_void, ++ /// Kernel virtual addr of stack. ++ pub ki_kstack: *mut c_void, ++ /// User convenience pointer. ++ pub ki_udata: *mut c_void, ++ // This is normally "struct thread". ++ pub ki_tdaddr: *mut c_void, ++ // This is normally "struct pwddesc". ++ /// Pointer to process paths info. ++ pub ki_pd: *mut c_void, ++ pub ki_spareptrs: [*mut c_void; crate::KI_NSPARE_PTR], ++ pub ki_sparelongs: [c_long; crate::KI_NSPARE_LONG], ++ /// PS_* flags. ++ pub ki_sflag: c_long, ++ /// kthread flag. ++ pub ki_tdflags: c_long, ++ } ++ ++ pub struct stat { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_mode: crate::mode_t, ++ st_padding0: i16, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ st_padding1: i32, ++ pub st_rdev: crate::dev_t, ++ #[cfg(target_arch = "x86")] ++ st_atim_ext: i32, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ #[cfg(target_arch = "x86")] ++ st_mtim_ext: i32, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ #[cfg(target_arch = "x86")] ++ st_ctim_ext: i32, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ #[cfg(target_arch = "x86")] ++ st_btim_ext: i32, ++ pub st_birthtime: crate::time_t, ++ pub st_birthtime_nsec: c_long, ++ pub st_size: off_t, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_blksize: crate::blksize_t, ++ pub st_flags: crate::fflags_t, ++ pub st_gen: u64, ++ pub st_spare: [u64; 10], ++ } ++} ++ ++s_no_extra_traits! { ++ pub struct dirent { ++ pub d_fileno: crate::ino_t, ++ pub d_off: off_t, ++ pub d_reclen: u16, ++ pub d_type: u8, ++ d_pad0: u8, ++ pub d_namlen: u16, ++ d_pad1: u16, ++ pub d_name: [c_char; 256], ++ } ++ ++ pub struct statfs { ++ pub f_version: u32, ++ pub f_type: u32, ++ pub f_flags: u64, ++ pub f_bsize: u64, ++ pub f_iosize: u64, ++ pub f_blocks: u64, ++ pub f_bfree: u64, ++ pub f_bavail: i64, ++ pub f_files: u64, ++ pub f_ffree: i64, ++ pub f_syncwrites: u64, ++ pub f_asyncwrites: u64, ++ pub f_syncreads: u64, ++ pub f_asyncreads: u64, ++ f_spare: [u64; 10], ++ pub f_namemax: u32, ++ pub f_owner: crate::uid_t, ++ pub f_fsid: crate::fsid_t, ++ f_charspare: [c_char; 80], ++ pub f_fstypename: [c_char; 16], ++ pub f_mntfromname: [c_char; 1024], ++ pub f_mntonname: [c_char; 1024], ++ } ++ ++ pub struct vnstat { ++ pub vn_fileid: u64, ++ pub vn_size: u64, ++ pub vn_dev: u64, ++ pub vn_fsid: u64, ++ pub vn_mntdir: *mut c_char, ++ pub vn_type: c_int, ++ pub vn_mode: u16, ++ pub vn_devname: [c_char; crate::SPECNAMELEN as usize + 1], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for statfs { ++ fn eq(&self, other: &statfs) -> bool { ++ self.f_version == other.f_version ++ && self.f_type == other.f_type ++ && self.f_flags == other.f_flags ++ && self.f_bsize == other.f_bsize ++ && self.f_iosize == other.f_iosize ++ && self.f_blocks == other.f_blocks ++ && self.f_bfree == other.f_bfree ++ && self.f_bavail == other.f_bavail ++ && self.f_files == other.f_files ++ && self.f_ffree == other.f_ffree ++ && self.f_syncwrites == other.f_syncwrites ++ && self.f_asyncwrites == other.f_asyncwrites ++ && self.f_syncreads == other.f_syncreads ++ && self.f_asyncreads == other.f_asyncreads ++ && self.f_namemax == other.f_namemax ++ && self.f_owner == other.f_owner ++ && self.f_fsid == other.f_fsid ++ && self.f_fstypename == other.f_fstypename ++ && self ++ .f_mntfromname ++ .iter() ++ .zip(other.f_mntfromname.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .f_mntonname ++ .iter() ++ .zip(other.f_mntonname.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for statfs {} ++ impl fmt::Debug for statfs { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("statfs") ++ .field("f_bsize", &self.f_bsize) ++ .field("f_iosize", &self.f_iosize) ++ .field("f_blocks", &self.f_blocks) ++ .field("f_bfree", &self.f_bfree) ++ .field("f_bavail", &self.f_bavail) ++ .field("f_files", &self.f_files) ++ .field("f_ffree", &self.f_ffree) ++ .field("f_syncwrites", &self.f_syncwrites) ++ .field("f_asyncwrites", &self.f_asyncwrites) ++ .field("f_syncreads", &self.f_syncreads) ++ .field("f_asyncreads", &self.f_asyncreads) ++ .field("f_namemax", &self.f_namemax) ++ .field("f_owner", &self.f_owner) ++ .field("f_fsid", &self.f_fsid) ++ .field("f_fstypename", &self.f_fstypename) ++ .field("f_mntfromname", &&self.f_mntfromname[..]) ++ .field("f_mntonname", &&self.f_mntonname[..]) ++ .finish() ++ } ++ } ++ impl hash::Hash for statfs { ++ fn hash(&self, state: &mut H) { ++ self.f_version.hash(state); ++ self.f_type.hash(state); ++ self.f_flags.hash(state); ++ self.f_bsize.hash(state); ++ self.f_iosize.hash(state); ++ self.f_blocks.hash(state); ++ self.f_bfree.hash(state); ++ self.f_bavail.hash(state); ++ self.f_files.hash(state); ++ self.f_ffree.hash(state); ++ self.f_syncwrites.hash(state); ++ self.f_asyncwrites.hash(state); ++ self.f_syncreads.hash(state); ++ self.f_asyncreads.hash(state); ++ self.f_namemax.hash(state); ++ self.f_owner.hash(state); ++ self.f_fsid.hash(state); ++ self.f_charspare.hash(state); ++ self.f_fstypename.hash(state); ++ self.f_mntfromname.hash(state); ++ self.f_mntonname.hash(state); ++ } ++ } ++ ++ impl PartialEq for dirent { ++ fn eq(&self, other: &dirent) -> bool { ++ self.d_fileno == other.d_fileno ++ && self.d_off == other.d_off ++ && self.d_reclen == other.d_reclen ++ && self.d_type == other.d_type ++ && self.d_namlen == other.d_namlen ++ && self.d_name[..self.d_namlen as _] ++ .iter() ++ .zip(other.d_name.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for dirent {} ++ impl fmt::Debug for dirent { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("dirent") ++ .field("d_fileno", &self.d_fileno) ++ .field("d_off", &self.d_off) ++ .field("d_reclen", &self.d_reclen) ++ .field("d_type", &self.d_type) ++ .field("d_namlen", &self.d_namlen) ++ .field("d_name", &&self.d_name[..self.d_namlen as _]) ++ .finish() ++ } ++ } ++ impl hash::Hash for dirent { ++ fn hash(&self, state: &mut H) { ++ self.d_fileno.hash(state); ++ self.d_off.hash(state); ++ self.d_reclen.hash(state); ++ self.d_type.hash(state); ++ self.d_namlen.hash(state); ++ self.d_name[..self.d_namlen as _].hash(state); ++ } ++ } ++ ++ impl PartialEq for vnstat { ++ fn eq(&self, other: &vnstat) -> bool { ++ let self_vn_devname: &[c_char] = &self.vn_devname; ++ let other_vn_devname: &[c_char] = &other.vn_devname; ++ ++ self.vn_fileid == other.vn_fileid ++ && self.vn_size == other.vn_size ++ && self.vn_dev == other.vn_dev ++ && self.vn_fsid == other.vn_fsid ++ && self.vn_mntdir == other.vn_mntdir ++ && self.vn_type == other.vn_type ++ && self.vn_mode == other.vn_mode ++ && self_vn_devname == other_vn_devname ++ } ++ } ++ impl Eq for vnstat {} ++ impl fmt::Debug for vnstat { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ let self_vn_devname: &[c_char] = &self.vn_devname; ++ ++ f.debug_struct("vnstat") ++ .field("vn_fileid", &self.vn_fileid) ++ .field("vn_size", &self.vn_size) ++ .field("vn_dev", &self.vn_dev) ++ .field("vn_fsid", &self.vn_fsid) ++ .field("vn_mntdir", &self.vn_mntdir) ++ .field("vn_type", &self.vn_type) ++ .field("vn_mode", &self.vn_mode) ++ .field("vn_devname", &self_vn_devname) ++ .finish() ++ } ++ } ++ impl hash::Hash for vnstat { ++ fn hash(&self, state: &mut H) { ++ let self_vn_devname: &[c_char] = &self.vn_devname; ++ ++ self.vn_fileid.hash(state); ++ self.vn_size.hash(state); ++ self.vn_dev.hash(state); ++ self.vn_fsid.hash(state); ++ self.vn_mntdir.hash(state); ++ self.vn_type.hash(state); ++ self.vn_mode.hash(state); ++ self_vn_devname.hash(state); ++ } ++ } ++ } ++} ++ ++pub const RAND_MAX: c_int = 0x7fff_ffff; ++pub const ELAST: c_int = 97; ++ ++pub const KF_TYPE_EVENTFD: c_int = 13; ++ ++/// max length of devicename ++pub const SPECNAMELEN: c_int = 255; ++pub const KI_NSPARE_PTR: usize = 5; ++ ++/// domainset policies ++pub const DOMAINSET_POLICY_INVALID: c_int = 0; ++pub const DOMAINSET_POLICY_ROUNDROBIN: c_int = 1; ++pub const DOMAINSET_POLICY_FIRSTTOUCH: c_int = 2; ++pub const DOMAINSET_POLICY_PREFER: c_int = 3; ++pub const DOMAINSET_POLICY_INTERLEAVE: c_int = 4; ++ ++pub const MINCORE_SUPER: c_int = 0x60; ++ ++safe_f! { ++ pub {const} fn makedev(major: c_uint, minor: c_uint) -> crate::dev_t { ++ let major = major as crate::dev_t; ++ let minor = minor as crate::dev_t; ++ let mut dev = 0; ++ dev |= ((major & 0xffffff00) as dev_t) << 32; ++ dev |= ((major & 0x000000ff) as dev_t) << 8; ++ dev |= ((minor & 0x0000ff00) as dev_t) << 24; ++ dev |= ((minor & 0xffff00ff) as dev_t) << 0; ++ dev ++ } ++} ++ ++f! { ++ pub fn major(dev: crate::dev_t) -> c_int { ++ (((dev >> 32) & 0xffffff00) | ((dev >> 8) & 0xff)) as c_int ++ } ++ ++ pub fn minor(dev: crate::dev_t) -> c_int { ++ (((dev >> 24) & 0xff00) | (dev & 0xffff00ff)) as c_int ++ } ++} ++ ++extern "C" { ++ pub fn setgrent(); ++ pub fn mprotect(addr: *mut c_void, len: size_t, prot: c_int) -> c_int; ++ pub fn freelocale(loc: crate::locale_t); ++ pub fn msgrcv( ++ msqid: c_int, ++ msgp: *mut c_void, ++ msgsz: size_t, ++ msgtyp: c_long, ++ msgflg: c_int, ++ ) -> ssize_t; ++ ++ pub fn cpuset_getdomain( ++ level: crate::cpulevel_t, ++ which: crate::cpuwhich_t, ++ id: crate::id_t, ++ setsize: size_t, ++ mask: *mut crate::domainset_t, ++ policy: *mut c_int, ++ ) -> c_int; ++ pub fn cpuset_setdomain( ++ level: crate::cpulevel_t, ++ which: crate::cpuwhich_t, ++ id: crate::id_t, ++ setsize: size_t, ++ mask: *const crate::domainset_t, ++ policy: c_int, ++ ) -> c_int; ++ ++ pub fn dirname(path: *mut c_char) -> *mut c_char; ++ pub fn basename(path: *mut c_char) -> *mut c_char; ++} ++ ++#[link(name = "kvm")] ++extern "C" { ++ pub fn kvm_kerndisp(kd: *mut crate::kvm_t) -> crate::kssize_t; ++} ++ ++cfg_if! { ++ if #[cfg(target_arch = "x86_64")] { ++ mod x86_64; ++ pub use self::x86_64::*; ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd15/x86_64.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd15/x86_64.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd15/x86_64.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/freebsd15/x86_64.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,14 @@ ++use crate::prelude::*; ++ ++pub const PROC_KPTI_CTL: c_int = crate::PROC_PROCCTL_MD_MIN; ++pub const PROC_KPTI_CTL_ENABLE_ON_EXEC: c_int = 1; ++pub const PROC_KPTI_CTL_DISABLE_ON_EXEC: c_int = 2; ++pub const PROC_KPTI_STATUS: c_int = crate::PROC_PROCCTL_MD_MIN + 1; ++pub const PROC_KPTI_STATUS_ACTIVE: c_int = 0x80000000; ++pub const PROC_LA_CTL: c_int = crate::PROC_PROCCTL_MD_MIN + 2; ++pub const PROC_LA_STATUS: c_int = crate::PROC_PROCCTL_MD_MIN + 3; ++pub const PROC_LA_CTL_LA48_ON_EXEC: c_int = 1; ++pub const PROC_LA_CTL_LA57_ON_EXEC: c_int = 2; ++pub const PROC_LA_CTL_DEFAULT_ON_EXEC: c_int = 3; ++pub const PROC_LA_STATUS_LA48: c_int = 0x01000000; ++pub const PROC_LA_STATUS_LA57: c_int = 0x02000000; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,5860 @@ ++use crate::prelude::*; ++use crate::{cmsghdr, off_t}; ++ ++pub type fflags_t = u32; ++ ++pub type vm_prot_t = u_char; ++pub type kvaddr_t = u64; ++pub type segsz_t = isize; ++pub type __fixpt_t = u32; ++pub type fixpt_t = __fixpt_t; ++pub type __lwpid_t = i32; ++pub type lwpid_t = __lwpid_t; ++pub type blksize_t = i32; ++pub type clockid_t = c_int; ++pub type sem_t = _sem; ++pub type timer_t = *mut __c_anonymous__timer; ++ ++pub type fsblkcnt_t = u64; ++pub type fsfilcnt_t = u64; ++pub type idtype_t = c_uint; ++ ++pub type msglen_t = c_ulong; ++pub type msgqnum_t = c_ulong; ++ ++pub type cpulevel_t = c_int; ++pub type cpuwhich_t = c_int; ++ ++pub type mqd_t = *mut c_void; ++pub type posix_spawnattr_t = *mut c_void; ++pub type posix_spawn_file_actions_t = *mut c_void; ++ ++pub type pthread_spinlock_t = *mut __c_anonymous_pthread_spinlock; ++pub type pthread_barrierattr_t = *mut __c_anonymous_pthread_barrierattr; ++pub type pthread_barrier_t = *mut __c_anonymous_pthread_barrier; ++ ++pub type uuid_t = crate::uuid; ++pub type u_int = c_uint; ++pub type u_char = c_uchar; ++pub type u_long = c_ulong; ++pub type u_short = c_ushort; ++ ++pub type caddr_t = *mut c_char; ++ ++pub type fhandle_t = fhandle; ++ ++pub type au_id_t = crate::uid_t; ++pub type au_asid_t = crate::pid_t; ++ ++pub type cpusetid_t = c_int; ++ ++pub type sctp_assoc_t = u32; ++ ++pub type eventfd_t = u64; ++ ++#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))] ++#[repr(u32)] ++pub enum devstat_support_flags { ++ DEVSTAT_ALL_SUPPORTED = 0x00, ++ DEVSTAT_NO_BLOCKSIZE = 0x01, ++ DEVSTAT_NO_ORDERED_TAGS = 0x02, ++ DEVSTAT_BS_UNAVAILABLE = 0x04, ++} ++impl Copy for devstat_support_flags {} ++impl Clone for devstat_support_flags { ++ fn clone(&self) -> devstat_support_flags { ++ *self ++ } ++} ++ ++#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))] ++#[repr(u32)] ++pub enum devstat_trans_flags { ++ DEVSTAT_NO_DATA = 0x00, ++ DEVSTAT_READ = 0x01, ++ DEVSTAT_WRITE = 0x02, ++ DEVSTAT_FREE = 0x03, ++} ++ ++impl Copy for devstat_trans_flags {} ++impl Clone for devstat_trans_flags { ++ fn clone(&self) -> devstat_trans_flags { ++ *self ++ } ++} ++ ++#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))] ++#[repr(u32)] ++pub enum devstat_tag_type { ++ DEVSTAT_TAG_SIMPLE = 0x00, ++ DEVSTAT_TAG_HEAD = 0x01, ++ DEVSTAT_TAG_ORDERED = 0x02, ++ DEVSTAT_TAG_NONE = 0x03, ++} ++impl Copy for devstat_tag_type {} ++impl Clone for devstat_tag_type { ++ fn clone(&self) -> devstat_tag_type { ++ *self ++ } ++} ++ ++#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))] ++#[repr(u32)] ++pub enum devstat_match_flags { ++ DEVSTAT_MATCH_NONE = 0x00, ++ DEVSTAT_MATCH_TYPE = 0x01, ++ DEVSTAT_MATCH_IF = 0x02, ++ DEVSTAT_MATCH_PASS = 0x04, ++} ++impl Copy for devstat_match_flags {} ++impl Clone for devstat_match_flags { ++ fn clone(&self) -> devstat_match_flags { ++ *self ++ } ++} ++ ++#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))] ++#[repr(u32)] ++pub enum devstat_priority { ++ DEVSTAT_PRIORITY_MIN = 0x000, ++ DEVSTAT_PRIORITY_OTHER = 0x020, ++ DEVSTAT_PRIORITY_PASS = 0x030, ++ DEVSTAT_PRIORITY_FD = 0x040, ++ DEVSTAT_PRIORITY_WFD = 0x050, ++ DEVSTAT_PRIORITY_TAPE = 0x060, ++ DEVSTAT_PRIORITY_CD = 0x090, ++ DEVSTAT_PRIORITY_DISK = 0x110, ++ DEVSTAT_PRIORITY_ARRAY = 0x120, ++ DEVSTAT_PRIORITY_MAX = 0xfff, ++} ++impl Copy for devstat_priority {} ++impl Clone for devstat_priority { ++ fn clone(&self) -> devstat_priority { ++ *self ++ } ++} ++ ++#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))] ++#[repr(u32)] ++pub enum devstat_type_flags { ++ DEVSTAT_TYPE_DIRECT = 0x000, ++ DEVSTAT_TYPE_SEQUENTIAL = 0x001, ++ DEVSTAT_TYPE_PRINTER = 0x002, ++ DEVSTAT_TYPE_PROCESSOR = 0x003, ++ DEVSTAT_TYPE_WORM = 0x004, ++ DEVSTAT_TYPE_CDROM = 0x005, ++ DEVSTAT_TYPE_SCANNER = 0x006, ++ DEVSTAT_TYPE_OPTICAL = 0x007, ++ DEVSTAT_TYPE_CHANGER = 0x008, ++ DEVSTAT_TYPE_COMM = 0x009, ++ DEVSTAT_TYPE_ASC0 = 0x00a, ++ DEVSTAT_TYPE_ASC1 = 0x00b, ++ DEVSTAT_TYPE_STORARRAY = 0x00c, ++ DEVSTAT_TYPE_ENCLOSURE = 0x00d, ++ DEVSTAT_TYPE_FLOPPY = 0x00e, ++ DEVSTAT_TYPE_MASK = 0x00f, ++ DEVSTAT_TYPE_IF_SCSI = 0x010, ++ DEVSTAT_TYPE_IF_IDE = 0x020, ++ DEVSTAT_TYPE_IF_OTHER = 0x030, ++ DEVSTAT_TYPE_IF_MASK = 0x0f0, ++ DEVSTAT_TYPE_PASS = 0x100, ++} ++impl Copy for devstat_type_flags {} ++impl Clone for devstat_type_flags { ++ fn clone(&self) -> devstat_type_flags { ++ *self ++ } ++} ++ ++#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))] ++#[repr(u32)] ++pub enum devstat_metric { ++ DSM_NONE, ++ DSM_TOTAL_BYTES, ++ DSM_TOTAL_BYTES_READ, ++ DSM_TOTAL_BYTES_WRITE, ++ DSM_TOTAL_TRANSFERS, ++ DSM_TOTAL_TRANSFERS_READ, ++ DSM_TOTAL_TRANSFERS_WRITE, ++ DSM_TOTAL_TRANSFERS_OTHER, ++ DSM_TOTAL_BLOCKS, ++ DSM_TOTAL_BLOCKS_READ, ++ DSM_TOTAL_BLOCKS_WRITE, ++ DSM_KB_PER_TRANSFER, ++ DSM_KB_PER_TRANSFER_READ, ++ DSM_KB_PER_TRANSFER_WRITE, ++ DSM_TRANSFERS_PER_SECOND, ++ DSM_TRANSFERS_PER_SECOND_READ, ++ DSM_TRANSFERS_PER_SECOND_WRITE, ++ DSM_TRANSFERS_PER_SECOND_OTHER, ++ DSM_MB_PER_SECOND, ++ DSM_MB_PER_SECOND_READ, ++ DSM_MB_PER_SECOND_WRITE, ++ DSM_BLOCKS_PER_SECOND, ++ DSM_BLOCKS_PER_SECOND_READ, ++ DSM_BLOCKS_PER_SECOND_WRITE, ++ DSM_MS_PER_TRANSACTION, ++ DSM_MS_PER_TRANSACTION_READ, ++ DSM_MS_PER_TRANSACTION_WRITE, ++ DSM_SKIP, ++ DSM_TOTAL_BYTES_FREE, ++ DSM_TOTAL_TRANSFERS_FREE, ++ DSM_TOTAL_BLOCKS_FREE, ++ DSM_KB_PER_TRANSFER_FREE, ++ DSM_MB_PER_SECOND_FREE, ++ DSM_TRANSFERS_PER_SECOND_FREE, ++ DSM_BLOCKS_PER_SECOND_FREE, ++ DSM_MS_PER_TRANSACTION_OTHER, ++ DSM_MS_PER_TRANSACTION_FREE, ++ DSM_BUSY_PCT, ++ DSM_QUEUE_LENGTH, ++ DSM_TOTAL_DURATION, ++ DSM_TOTAL_DURATION_READ, ++ DSM_TOTAL_DURATION_WRITE, ++ DSM_TOTAL_DURATION_FREE, ++ DSM_TOTAL_DURATION_OTHER, ++ DSM_TOTAL_BUSY_TIME, ++ DSM_MAX, ++} ++impl Copy for devstat_metric {} ++impl Clone for devstat_metric { ++ fn clone(&self) -> devstat_metric { ++ *self ++ } ++} ++ ++#[cfg_attr(feature = "extra_traits", derive(Debug, Hash, PartialEq, Eq))] ++#[repr(u32)] ++pub enum devstat_select_mode { ++ DS_SELECT_ADD, ++ DS_SELECT_ONLY, ++ DS_SELECT_REMOVE, ++ DS_SELECT_ADDONLY, ++} ++impl Copy for devstat_select_mode {} ++impl Clone for devstat_select_mode { ++ fn clone(&self) -> devstat_select_mode { ++ *self ++ } ++} ++ ++s! { ++ pub struct aiocb { ++ pub aio_fildes: c_int, ++ pub aio_offset: off_t, ++ pub aio_buf: *mut c_void, ++ pub aio_nbytes: size_t, ++ __unused1: [c_int; 2], ++ __unused2: *mut c_void, ++ pub aio_lio_opcode: c_int, ++ pub aio_reqprio: c_int, ++ // unused 3 through 5 are the __aiocb_private structure ++ __unused3: c_long, ++ __unused4: c_long, ++ __unused5: *mut c_void, ++ pub aio_sigevent: sigevent, ++ } ++ ++ pub struct jail { ++ pub version: u32, ++ pub path: *mut c_char, ++ pub hostname: *mut c_char, ++ pub jailname: *mut c_char, ++ pub ip4s: c_uint, ++ pub ip6s: c_uint, ++ pub ip4: *mut crate::in_addr, ++ pub ip6: *mut crate::in6_addr, ++ } ++ ++ pub struct statvfs { ++ pub f_bavail: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_favail: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_files: crate::fsfilcnt_t, ++ pub f_bsize: c_ulong, ++ pub f_flag: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_fsid: c_ulong, ++ pub f_namemax: c_ulong, ++ } ++ ++ // internal structure has changed over time ++ pub struct _sem { ++ data: [u32; 4], ++ } ++ pub struct sembuf { ++ pub sem_num: c_ushort, ++ pub sem_op: c_short, ++ pub sem_flg: c_short, ++ } ++ ++ pub struct msqid_ds { ++ pub msg_perm: crate::ipc_perm, ++ __unused1: *mut c_void, ++ __unused2: *mut c_void, ++ pub msg_cbytes: crate::msglen_t, ++ pub msg_qnum: crate::msgqnum_t, ++ pub msg_qbytes: crate::msglen_t, ++ pub msg_lspid: crate::pid_t, ++ pub msg_lrpid: crate::pid_t, ++ pub msg_stime: crate::time_t, ++ pub msg_rtime: crate::time_t, ++ pub msg_ctime: crate::time_t, ++ } ++ ++ pub struct stack_t { ++ pub ss_sp: *mut c_void, ++ pub ss_size: size_t, ++ pub ss_flags: c_int, ++ } ++ ++ pub struct mmsghdr { ++ pub msg_hdr: crate::msghdr, ++ pub msg_len: ssize_t, ++ } ++ ++ pub struct sockcred { ++ pub sc_uid: crate::uid_t, ++ pub sc_euid: crate::uid_t, ++ pub sc_gid: crate::gid_t, ++ pub sc_egid: crate::gid_t, ++ pub sc_ngroups: c_int, ++ pub sc_groups: [crate::gid_t; 1], ++ } ++ ++ pub struct ptrace_vm_entry { ++ pub pve_entry: c_int, ++ pub pve_timestamp: c_int, ++ pub pve_start: c_ulong, ++ pub pve_end: c_ulong, ++ pub pve_offset: c_ulong, ++ pub pve_prot: c_uint, ++ pub pve_pathlen: c_uint, ++ pub pve_fileid: c_long, ++ pub pve_fsid: u32, ++ pub pve_path: *mut c_char, ++ } ++ ++ pub struct ptrace_lwpinfo { ++ pub pl_lwpid: lwpid_t, ++ pub pl_event: c_int, ++ pub pl_flags: c_int, ++ pub pl_sigmask: crate::sigset_t, ++ pub pl_siglist: crate::sigset_t, ++ pub pl_siginfo: crate::siginfo_t, ++ pub pl_tdname: [c_char; crate::MAXCOMLEN as usize + 1], ++ pub pl_child_pid: crate::pid_t, ++ pub pl_syscall_code: c_uint, ++ pub pl_syscall_narg: c_uint, ++ } ++ ++ pub struct ptrace_sc_ret { ++ pub sr_retval: [crate::register_t; 2], ++ pub sr_error: c_int, ++ } ++ ++ pub struct ptrace_coredump { ++ pub pc_fd: c_int, ++ pub pc_flags: u32, ++ pub pc_limit: off_t, ++ } ++ ++ pub struct ptrace_sc_remote { ++ pub pscr_ret: ptrace_sc_ret, ++ pub pscr_syscall: c_uint, ++ pub pscr_nargs: c_uint, ++ pub pscr_args: *mut crate::register_t, ++ } ++ ++ pub struct cpuset_t { ++ #[cfg(all(any(freebsd15, freebsd14), target_pointer_width = "64"))] ++ __bits: [c_long; 16], ++ #[cfg(all(any(freebsd15, freebsd14), target_pointer_width = "32"))] ++ __bits: [c_long; 32], ++ #[cfg(all(not(any(freebsd15, freebsd14)), target_pointer_width = "64"))] ++ __bits: [c_long; 4], ++ #[cfg(all(not(any(freebsd15, freebsd14)), target_pointer_width = "32"))] ++ __bits: [c_long; 8], ++ } ++ ++ pub struct cap_rights_t { ++ cr_rights: [u64; 2], ++ } ++ ++ pub struct umutex { ++ m_owner: crate::lwpid_t, ++ m_flags: u32, ++ m_ceilings: [u32; 2], ++ m_rb_link: crate::uintptr_t, ++ #[cfg(target_pointer_width = "32")] ++ m_pad: u32, ++ m_spare: [u32; 2], ++ } ++ ++ pub struct ucond { ++ c_has_waiters: u32, ++ c_flags: u32, ++ c_clockid: u32, ++ c_spare: [u32; 1], ++ } ++ ++ pub struct uuid { ++ pub time_low: u32, ++ pub time_mid: u16, ++ pub time_hi_and_version: u16, ++ pub clock_seq_hi_and_reserved: u8, ++ pub clock_seq_low: u8, ++ pub node: [u8; _UUID_NODE_LEN], ++ } ++ ++ pub struct __c_anonymous_pthread_spinlock { ++ s_clock: umutex, ++ } ++ ++ pub struct __c_anonymous_pthread_barrierattr { ++ pshared: c_int, ++ } ++ ++ pub struct __c_anonymous_pthread_barrier { ++ b_lock: umutex, ++ b_cv: ucond, ++ b_cycle: i64, ++ b_count: c_int, ++ b_waiters: c_int, ++ b_refcount: c_int, ++ b_destroying: c_int, ++ } ++ ++ pub struct kinfo_vmentry { ++ pub kve_structsize: c_int, ++ pub kve_type: c_int, ++ pub kve_start: u64, ++ pub kve_end: u64, ++ pub kve_offset: u64, ++ pub kve_vn_fileid: u64, ++ #[cfg(not(freebsd11))] ++ pub kve_vn_fsid_freebsd11: u32, ++ #[cfg(freebsd11)] ++ pub kve_vn_fsid: u32, ++ pub kve_flags: c_int, ++ pub kve_resident: c_int, ++ pub kve_private_resident: c_int, ++ pub kve_protection: c_int, ++ pub kve_ref_count: c_int, ++ pub kve_shadow_count: c_int, ++ pub kve_vn_type: c_int, ++ pub kve_vn_size: u64, ++ #[cfg(not(freebsd11))] ++ pub kve_vn_rdev_freebsd11: u32, ++ #[cfg(freebsd11)] ++ pub kve_vn_rdev: u32, ++ pub kve_vn_mode: u16, ++ pub kve_status: u16, ++ #[cfg(not(freebsd11))] ++ pub kve_vn_fsid: u64, ++ #[cfg(not(freebsd11))] ++ pub kve_vn_rdev: u64, ++ #[cfg(not(freebsd11))] ++ _kve_is_spare: [c_int; 8], ++ #[cfg(freebsd11)] ++ _kve_is_spare: [c_int; 12], ++ pub kve_path: [[c_char; 32]; 32], ++ } ++ ++ pub struct __c_anonymous_filestat { ++ pub stqe_next: *mut filestat, ++ } ++ ++ pub struct filestat { ++ pub fs_type: c_int, ++ pub fs_flags: c_int, ++ pub fs_fflags: c_int, ++ pub fs_uflags: c_int, ++ pub fs_fd: c_int, ++ pub fs_ref_count: c_int, ++ pub fs_offset: off_t, ++ pub fs_typedep: *mut c_void, ++ pub fs_path: *mut c_char, ++ pub next: __c_anonymous_filestat, ++ pub fs_cap_rights: cap_rights_t, ++ } ++ ++ pub struct filestat_list { ++ pub stqh_first: *mut filestat, ++ pub stqh_last: *mut *mut filestat, ++ } ++ ++ pub struct procstat { ++ pub tpe: c_int, ++ pub kd: crate::uintptr_t, ++ pub vmentries: *mut c_void, ++ pub files: *mut c_void, ++ pub argv: *mut c_void, ++ pub envv: *mut c_void, ++ pub core: crate::uintptr_t, ++ } ++ ++ pub struct itimerspec { ++ pub it_interval: crate::timespec, ++ pub it_value: crate::timespec, ++ } ++ ++ pub struct __c_anonymous__timer { ++ _priv: [c_int; 3], ++ } ++ ++ /// Used to hold a copy of the command line, if it had a sane length. ++ pub struct pargs { ++ /// Reference count. ++ pub ar_ref: u_int, ++ /// Length. ++ pub ar_length: u_int, ++ /// Arguments. ++ pub ar_args: [c_uchar; 1], ++ } ++ ++ pub struct priority { ++ /// Scheduling class. ++ pub pri_class: u_char, ++ /// Normal priority level. ++ pub pri_level: u_char, ++ /// Priority before propagation. ++ pub pri_native: u_char, ++ /// User priority based on p_cpu and p_nice. ++ pub pri_user: u_char, ++ } ++ ++ pub struct kvm_swap { ++ pub ksw_devname: [c_char; 32], ++ pub ksw_used: u_int, ++ pub ksw_total: u_int, ++ pub ksw_flags: c_int, ++ pub ksw_reserved1: u_int, ++ pub ksw_reserved2: u_int, ++ } ++ ++ pub struct nlist { ++ /// symbol name (in memory) ++ pub n_name: *const c_char, ++ /// type defines ++ pub n_type: c_uchar, ++ /// "type" and binding information ++ pub n_other: c_char, ++ /// used by stab entries ++ pub n_desc: c_short, ++ pub n_value: c_ulong, ++ } ++ ++ pub struct kvm_nlist { ++ pub n_name: *const c_char, ++ pub n_type: c_uchar, ++ pub n_value: crate::kvaddr_t, ++ } ++ ++ pub struct __c_anonymous_sem { ++ _priv: crate::uintptr_t, ++ } ++ ++ pub struct semid_ds { ++ pub sem_perm: crate::ipc_perm, ++ pub __sem_base: *mut __c_anonymous_sem, ++ pub sem_nsems: c_ushort, ++ pub sem_otime: crate::time_t, ++ pub sem_ctime: crate::time_t, ++ } ++ ++ pub struct vmtotal { ++ pub t_vm: u64, ++ pub t_avm: u64, ++ pub t_rm: u64, ++ pub t_arm: u64, ++ pub t_vmshr: u64, ++ pub t_avmshr: u64, ++ pub t_rmshr: u64, ++ pub t_armshr: u64, ++ pub t_free: u64, ++ pub t_rq: i16, ++ pub t_dw: i16, ++ pub t_pw: i16, ++ pub t_sl: i16, ++ pub t_sw: i16, ++ pub t_pad: [u16; 3], ++ } ++ ++ pub struct sockstat { ++ pub inp_ppcb: u64, ++ pub so_addr: u64, ++ pub so_pcb: u64, ++ pub unp_conn: u64, ++ pub dom_family: c_int, ++ pub proto: c_int, ++ pub so_rcv_sb_state: c_int, ++ pub so_snd_sb_state: c_int, ++ /// Socket address. ++ pub sa_local: crate::sockaddr_storage, ++ /// Peer address. ++ pub sa_peer: crate::sockaddr_storage, ++ pub type_: c_int, ++ pub dname: [c_char; 32], ++ #[cfg(any(freebsd12, freebsd13, freebsd14, freebsd15))] ++ pub sendq: c_uint, ++ #[cfg(any(freebsd12, freebsd13, freebsd14, freebsd15))] ++ pub recvq: c_uint, ++ } ++ ++ pub struct shmstat { ++ pub size: u64, ++ pub mode: u16, ++ } ++ ++ pub struct spacectl_range { ++ pub r_offset: off_t, ++ pub r_len: off_t, ++ } ++ ++ pub struct rusage_ext { ++ pub rux_runtime: u64, ++ pub rux_uticks: u64, ++ pub rux_sticks: u64, ++ pub rux_iticks: u64, ++ pub rux_uu: u64, ++ pub rux_su: u64, ++ pub rux_tu: u64, ++ } ++ ++ pub struct if_clonereq { ++ pub ifcr_total: c_int, ++ pub ifcr_count: c_int, ++ pub ifcr_buffer: *mut c_char, ++ } ++ ++ pub struct if_msghdr { ++ /// to skip over non-understood messages ++ pub ifm_msglen: c_ushort, ++ /// future binary compatibility ++ pub ifm_version: c_uchar, ++ /// message type ++ pub ifm_type: c_uchar, ++ /// like rtm_addrs ++ pub ifm_addrs: c_int, ++ /// value of if_flags ++ pub ifm_flags: c_int, ++ /// index for associated ifp ++ pub ifm_index: c_ushort, ++ pub _ifm_spare1: c_ushort, ++ /// statistics and other data about if ++ pub ifm_data: if_data, ++ } ++ ++ pub struct if_msghdrl { ++ /// to skip over non-understood messages ++ pub ifm_msglen: c_ushort, ++ /// future binary compatibility ++ pub ifm_version: c_uchar, ++ /// message type ++ pub ifm_type: c_uchar, ++ /// like rtm_addrs ++ pub ifm_addrs: c_int, ++ /// value of if_flags ++ pub ifm_flags: c_int, ++ /// index for associated ifp ++ pub ifm_index: c_ushort, ++ /// spare space to grow if_index, see if_var.h ++ pub _ifm_spare1: c_ushort, ++ /// length of if_msghdrl incl. if_data ++ pub ifm_len: c_ushort, ++ /// offset of if_data from beginning ++ pub ifm_data_off: c_ushort, ++ pub _ifm_spare2: c_int, ++ /// statistics and other data about if ++ pub ifm_data: if_data, ++ } ++ ++ pub struct ifa_msghdr { ++ /// to skip over non-understood messages ++ pub ifam_msglen: c_ushort, ++ /// future binary compatibility ++ pub ifam_version: c_uchar, ++ /// message type ++ pub ifam_type: c_uchar, ++ /// like rtm_addrs ++ pub ifam_addrs: c_int, ++ /// value of ifa_flags ++ pub ifam_flags: c_int, ++ /// index for associated ifp ++ pub ifam_index: c_ushort, ++ pub _ifam_spare1: c_ushort, ++ /// value of ifa_ifp->if_metric ++ pub ifam_metric: c_int, ++ } ++ ++ pub struct ifa_msghdrl { ++ /// to skip over non-understood messages ++ pub ifam_msglen: c_ushort, ++ /// future binary compatibility ++ pub ifam_version: c_uchar, ++ /// message type ++ pub ifam_type: c_uchar, ++ /// like rtm_addrs ++ pub ifam_addrs: c_int, ++ /// value of ifa_flags ++ pub ifam_flags: c_int, ++ /// index for associated ifp ++ pub ifam_index: c_ushort, ++ /// spare space to grow if_index, see if_var.h ++ pub _ifam_spare1: c_ushort, ++ /// length of ifa_msghdrl incl. if_data ++ pub ifam_len: c_ushort, ++ /// offset of if_data from beginning ++ pub ifam_data_off: c_ushort, ++ /// value of ifa_ifp->if_metric ++ pub ifam_metric: c_int, ++ /// statistics and other data about if or address ++ pub ifam_data: if_data, ++ } ++ ++ pub struct ifma_msghdr { ++ /// to skip over non-understood messages ++ pub ifmam_msglen: c_ushort, ++ /// future binary compatibility ++ pub ifmam_version: c_uchar, ++ /// message type ++ pub ifmam_type: c_uchar, ++ /// like rtm_addrs ++ pub ifmam_addrs: c_int, ++ /// value of ifa_flags ++ pub ifmam_flags: c_int, ++ /// index for associated ifp ++ pub ifmam_index: c_ushort, ++ pub _ifmam_spare1: c_ushort, ++ } ++ ++ pub struct if_announcemsghdr { ++ /// to skip over non-understood messages ++ pub ifan_msglen: c_ushort, ++ /// future binary compatibility ++ pub ifan_version: c_uchar, ++ /// message type ++ pub ifan_type: c_uchar, ++ /// index for associated ifp ++ pub ifan_index: c_ushort, ++ /// if name, e.g. "en0" ++ pub ifan_name: [c_char; crate::IFNAMSIZ as usize], ++ /// what type of announcement ++ pub ifan_what: c_ushort, ++ } ++ ++ pub struct ifreq_buffer { ++ pub length: size_t, ++ pub buffer: *mut c_void, ++ } ++ ++ pub struct ifaliasreq { ++ /// if name, e.g. "en0" ++ pub ifra_name: [c_char; crate::IFNAMSIZ as usize], ++ pub ifra_addr: crate::sockaddr, ++ pub ifra_broadaddr: crate::sockaddr, ++ pub ifra_mask: crate::sockaddr, ++ pub ifra_vhid: c_int, ++ } ++ ++ /// 9.x compat ++ pub struct oifaliasreq { ++ /// if name, e.g. "en0" ++ pub ifra_name: [c_char; crate::IFNAMSIZ as usize], ++ pub ifra_addr: crate::sockaddr, ++ pub ifra_broadaddr: crate::sockaddr, ++ pub ifra_mask: crate::sockaddr, ++ } ++ ++ pub struct ifmediareq { ++ /// if name, e.g. "en0" ++ pub ifm_name: [c_char; crate::IFNAMSIZ as usize], ++ /// current media options ++ pub ifm_current: c_int, ++ /// don't care mask ++ pub ifm_mask: c_int, ++ /// media status ++ pub ifm_status: c_int, ++ /// active options ++ pub ifm_active: c_int, ++ /// # entries in ifm_ulist array ++ pub ifm_count: c_int, ++ /// media words ++ pub ifm_ulist: *mut c_int, ++ } ++ ++ pub struct ifdrv { ++ /// if name, e.g. "en0" ++ pub ifd_name: [c_char; crate::IFNAMSIZ as usize], ++ pub ifd_cmd: c_ulong, ++ pub ifd_len: size_t, ++ pub ifd_data: *mut c_void, ++ } ++ ++ pub struct ifi2creq { ++ /// i2c address (0xA0, 0xA2) ++ pub dev_addr: u8, ++ /// read offset ++ pub offset: u8, ++ /// read length ++ pub len: u8, ++ pub spare0: u8, ++ pub spare1: u32, ++ /// read buffer ++ pub data: [u8; 8], ++ } ++ ++ pub struct ifrsshash { ++ /// if name, e.g. "en0" ++ pub ifrh_name: [c_char; crate::IFNAMSIZ as usize], ++ /// RSS_FUNC_ ++ pub ifrh_func: u8, ++ pub ifrh_spare0: u8, ++ pub ifrh_spare1: u16, ++ /// RSS_TYPE_ ++ pub ifrh_types: u32, ++ } ++ ++ pub struct ifmibdata { ++ /// name of interface ++ pub ifmd_name: [c_char; crate::IFNAMSIZ as usize], ++ /// number of promiscuous listeners ++ pub ifmd_pcount: c_int, ++ /// interface flags ++ pub ifmd_flags: c_int, ++ /// instantaneous length of send queue ++ pub ifmd_snd_len: c_int, ++ /// maximum length of send queue ++ pub ifmd_snd_maxlen: c_int, ++ /// number of drops in send queue ++ pub ifmd_snd_drops: c_int, ++ /// for future expansion ++ pub ifmd_filler: [c_int; 4], ++ /// generic information and statistics ++ pub ifmd_data: if_data, ++ } ++ ++ pub struct ifmib_iso_8802_3 { ++ pub dot3StatsAlignmentErrors: u32, ++ pub dot3StatsFCSErrors: u32, ++ pub dot3StatsSingleCollisionFrames: u32, ++ pub dot3StatsMultipleCollisionFrames: u32, ++ pub dot3StatsSQETestErrors: u32, ++ pub dot3StatsDeferredTransmissions: u32, ++ pub dot3StatsLateCollisions: u32, ++ pub dot3StatsExcessiveCollisions: u32, ++ pub dot3StatsInternalMacTransmitErrors: u32, ++ pub dot3StatsCarrierSenseErrors: u32, ++ pub dot3StatsFrameTooLongs: u32, ++ pub dot3StatsInternalMacReceiveErrors: u32, ++ pub dot3StatsEtherChipSet: u32, ++ pub dot3StatsMissedFrames: u32, ++ pub dot3StatsCollFrequencies: [u32; 16], ++ pub dot3Compliance: u32, ++ } ++ ++ pub struct __c_anonymous_ph { ++ pub ph1: u64, ++ pub ph2: u64, ++ } ++ ++ pub struct fid { ++ pub fid_len: c_ushort, ++ pub fid_data0: c_ushort, ++ pub fid_data: [c_char; crate::MAXFIDSZ as usize], ++ } ++ ++ pub struct fhandle { ++ pub fh_fsid: crate::fsid_t, ++ pub fh_fid: fid, ++ } ++ ++ pub struct bintime { ++ pub sec: crate::time_t, ++ pub frac: u64, ++ } ++ ++ pub struct clockinfo { ++ /// clock frequency ++ pub hz: c_int, ++ /// micro-seconds per hz tick ++ pub tick: c_int, ++ pub spare: c_int, ++ /// statistics clock frequency ++ pub stathz: c_int, ++ /// profiling clock frequency ++ pub profhz: c_int, ++ } ++ ++ pub struct __c_anonymous_stailq_entry_devstat { ++ pub stqe_next: *mut devstat, ++ } ++ ++ pub struct devstat { ++ /// Update sequence ++ pub sequence0: crate::u_int, ++ /// Allocated entry ++ pub allocated: c_int, ++ /// started ops ++ pub start_count: crate::u_int, ++ /// completed ops ++ pub end_count: crate::u_int, ++ /// busy time unaccounted for since this time ++ pub busy_from: bintime, ++ pub dev_links: __c_anonymous_stailq_entry_devstat, ++ /// Devstat device number. ++ pub device_number: u32, ++ pub device_name: [c_char; DEVSTAT_NAME_LEN as usize], ++ pub unit_number: c_int, ++ pub bytes: [u64; DEVSTAT_N_TRANS_FLAGS as usize], ++ pub operations: [u64; DEVSTAT_N_TRANS_FLAGS as usize], ++ pub duration: [bintime; DEVSTAT_N_TRANS_FLAGS as usize], ++ pub busy_time: bintime, ++ /// Time the device was created. ++ pub creation_time: bintime, ++ /// Block size, bytes ++ pub block_size: u32, ++ /// The number of simple, ordered, and head of queue tags sent. ++ pub tag_types: [u64; 3], ++ /// Which statistics are supported by a given device. ++ pub flags: devstat_support_flags, ++ /// Device type ++ pub device_type: devstat_type_flags, ++ /// Controls list pos. ++ pub priority: devstat_priority, ++ /// Identification for GEOM nodes ++ pub id: *const c_void, ++ /// Update sequence ++ pub sequence1: crate::u_int, ++ } ++ ++ pub struct devstat_match { ++ pub match_fields: devstat_match_flags, ++ pub device_type: devstat_type_flags, ++ pub num_match_categories: c_int, ++ } ++ ++ pub struct devstat_match_table { ++ pub match_str: *const c_char, ++ pub type_: devstat_type_flags, ++ pub match_field: devstat_match_flags, ++ } ++ ++ pub struct device_selection { ++ pub device_number: u32, ++ pub device_name: [c_char; DEVSTAT_NAME_LEN as usize], ++ pub unit_number: c_int, ++ pub selected: c_int, ++ pub bytes: u64, ++ pub position: c_int, ++ } ++ ++ pub struct devinfo { ++ pub devices: *mut devstat, ++ pub mem_ptr: *mut u8, ++ pub generation: c_long, ++ pub numdevs: c_int, ++ } ++ ++ pub struct sockcred2 { ++ pub sc_version: c_int, ++ pub sc_pid: crate::pid_t, ++ pub sc_uid: crate::uid_t, ++ pub sc_euid: crate::uid_t, ++ pub sc_gid: crate::gid_t, ++ pub sc_egid: crate::gid_t, ++ pub sc_ngroups: c_int, ++ pub sc_groups: [crate::gid_t; 1], ++ } ++ ++ pub struct ifconf { ++ pub ifc_len: c_int, ++ pub ifc_ifcu: __c_anonymous_ifc_ifcu, ++ } ++ ++ pub struct au_mask_t { ++ pub am_success: c_uint, ++ pub am_failure: c_uint, ++ } ++ ++ pub struct au_tid_t { ++ pub port: u32, ++ pub machine: u32, ++ } ++ ++ pub struct auditinfo_t { ++ pub ai_auid: crate::au_id_t, ++ pub ai_mask: crate::au_mask_t, ++ pub ai_termid: au_tid_t, ++ pub ai_asid: crate::au_asid_t, ++ } ++ ++ pub struct tcp_fastopen { ++ pub enable: c_int, ++ pub psk: [u8; crate::TCP_FASTOPEN_PSK_LEN as usize], ++ } ++ ++ pub struct tcp_function_set { ++ pub function_set_name: [c_char; crate::TCP_FUNCTION_NAME_LEN_MAX as usize], ++ pub pcbcnt: u32, ++ } ++ ++ // Note: this structure will change in a backwards-incompatible way in ++ // FreeBSD 15. ++ pub struct tcp_info { ++ pub tcpi_state: u8, ++ pub __tcpi_ca_state: u8, ++ pub __tcpi_retransmits: u8, ++ pub __tcpi_probes: u8, ++ pub __tcpi_backoff: u8, ++ pub tcpi_options: u8, ++ pub tcp_snd_wscale: u8, ++ pub tcp_rcv_wscale: u8, ++ pub tcpi_rto: u32, ++ pub __tcpi_ato: u32, ++ pub tcpi_snd_mss: u32, ++ pub tcpi_rcv_mss: u32, ++ pub __tcpi_unacked: u32, ++ pub __tcpi_sacked: u32, ++ pub __tcpi_lost: u32, ++ pub __tcpi_retrans: u32, ++ pub __tcpi_fackets: u32, ++ pub __tcpi_last_data_sent: u32, ++ pub __tcpi_last_ack_sent: u32, ++ pub tcpi_last_data_recv: u32, ++ pub __tcpi_last_ack_recv: u32, ++ pub __tcpi_pmtu: u32, ++ pub __tcpi_rcv_ssthresh: u32, ++ pub tcpi_rtt: u32, ++ pub tcpi_rttvar: u32, ++ pub tcpi_snd_ssthresh: u32, ++ pub tcpi_snd_cwnd: u32, ++ pub __tcpi_advmss: u32, ++ pub __tcpi_reordering: u32, ++ pub __tcpi_rcv_rtt: u32, ++ pub tcpi_rcv_space: u32, ++ pub tcpi_snd_wnd: u32, ++ pub tcpi_snd_bwnd: u32, ++ pub tcpi_snd_nxt: u32, ++ pub tcpi_rcv_nxt: u32, ++ pub tcpi_toe_tid: u32, ++ pub tcpi_snd_rexmitpack: u32, ++ pub tcpi_rcv_ooopack: u32, ++ pub tcpi_snd_zerowin: u32, ++ #[cfg(any(freebsd15, freebsd14))] ++ pub tcpi_delivered_ce: u32, ++ #[cfg(any(freebsd15, freebsd14))] ++ pub tcpi_received_ce: u32, ++ #[cfg(any(freebsd15, freebsd14))] ++ pub __tcpi_delivered_e1_bytes: u32, ++ #[cfg(any(freebsd15, freebsd14))] ++ pub __tcpi_delivered_e0_bytes: u32, ++ #[cfg(any(freebsd15, freebsd14))] ++ pub __tcpi_delivered_ce_bytes: u32, ++ #[cfg(any(freebsd15, freebsd14))] ++ pub __tcpi_received_e1_bytes: u32, ++ #[cfg(any(freebsd15, freebsd14))] ++ pub __tcpi_received_e0_bytes: u32, ++ #[cfg(any(freebsd15, freebsd14))] ++ pub __tcpi_received_ce_bytes: u32, ++ #[cfg(any(freebsd15, freebsd14))] ++ pub tcpi_total_tlp: u32, ++ #[cfg(any(freebsd15, freebsd14))] ++ pub tcpi_total_tlp_bytes: u64, ++ #[cfg(any(freebsd15, freebsd14))] ++ pub tcpi_snd_una: u32, ++ #[cfg(any(freebsd15, freebsd14))] ++ pub tcpi_snd_max: u32, ++ #[cfg(any(freebsd15, freebsd14))] ++ pub tcpi_rcv_numsacks: u32, ++ #[cfg(any(freebsd15, freebsd14))] ++ pub tcpi_rcv_adv: u32, ++ #[cfg(any(freebsd15, freebsd14))] ++ pub tcpi_dupacks: u32, ++ #[cfg(freebsd14)] ++ pub __tcpi_pad: [u32; 10], ++ #[cfg(freebsd15)] ++ pub __tcpi_pad: [u32; 14], ++ #[cfg(not(any(freebsd15, freebsd14)))] ++ pub __tcpi_pad: [u32; 26], ++ } ++ ++ pub struct _umtx_time { ++ pub _timeout: crate::timespec, ++ pub _flags: u32, ++ pub _clockid: u32, ++ } ++ ++ pub struct shm_largepage_conf { ++ pub psind: c_int, ++ pub alloc_policy: c_int, ++ __pad: [c_int; 10], ++ } ++ ++ pub struct memory_type { ++ __priva: [crate::uintptr_t; 32], ++ __privb: [crate::uintptr_t; 26], ++ } ++ ++ pub struct memory_type_list { ++ __priv: [crate::uintptr_t; 2], ++ } ++ ++ pub struct pidfh { ++ __priva: [[crate::uintptr_t; 32]; 8], ++ __privb: [crate::uintptr_t; 2], ++ } ++ ++ pub struct sctp_event { ++ pub se_assoc_id: crate::sctp_assoc_t, ++ pub se_type: u16, ++ pub se_on: u8, ++ } ++ ++ pub struct sctp_event_subscribe { ++ pub sctp_data_io_event: u8, ++ pub sctp_association_event: u8, ++ pub sctp_address_event: u8, ++ pub sctp_send_failure_event: u8, ++ pub sctp_peer_error_event: u8, ++ pub sctp_shutdown_event: u8, ++ pub sctp_partial_delivery_event: u8, ++ pub sctp_adaptation_layer_event: u8, ++ pub sctp_authentication_event: u8, ++ pub sctp_sender_dry_event: u8, ++ pub sctp_stream_reset_event: u8, ++ } ++ ++ pub struct sctp_initmsg { ++ pub sinit_num_ostreams: u16, ++ pub sinit_max_instreams: u16, ++ pub sinit_max_attempts: u16, ++ pub sinit_max_init_timeo: u16, ++ } ++ ++ pub struct sctp_sndrcvinfo { ++ pub sinfo_stream: u16, ++ pub sinfo_ssn: u16, ++ pub sinfo_flags: u16, ++ pub sinfo_ppid: u32, ++ pub sinfo_context: u32, ++ pub sinfo_timetolive: u32, ++ pub sinfo_tsn: u32, ++ pub sinfo_cumtsn: u32, ++ pub sinfo_assoc_id: crate::sctp_assoc_t, ++ pub sinfo_keynumber: u16, ++ pub sinfo_keynumber_valid: u16, ++ pub __reserve_pad: [[u8; 23]; 4], ++ } ++ ++ pub struct sctp_extrcvinfo { ++ pub sinfo_stream: u16, ++ pub sinfo_ssn: u16, ++ pub sinfo_flags: u16, ++ pub sinfo_ppid: u32, ++ pub sinfo_context: u32, ++ pub sinfo_timetolive: u32, ++ pub sinfo_tsn: u32, ++ pub sinfo_cumtsn: u32, ++ pub sinfo_assoc_id: crate::sctp_assoc_t, ++ pub serinfo_next_flags: u16, ++ pub serinfo_next_stream: u16, ++ pub serinfo_next_aid: u32, ++ pub serinfo_next_length: u32, ++ pub serinfo_next_ppid: u32, ++ pub sinfo_keynumber: u16, ++ pub sinfo_keynumber_valid: u16, ++ pub __reserve_pad: [[u8; 19]; 4], ++ } ++ ++ pub struct sctp_sndinfo { ++ pub snd_sid: u16, ++ pub snd_flags: u16, ++ pub snd_ppid: u32, ++ pub snd_context: u32, ++ pub snd_assoc_id: crate::sctp_assoc_t, ++ } ++ ++ pub struct sctp_prinfo { ++ pub pr_policy: u16, ++ pub pr_value: u32, ++ } ++ ++ pub struct sctp_default_prinfo { ++ pub pr_policy: u16, ++ pub pr_value: u32, ++ pub pr_assoc_id: crate::sctp_assoc_t, ++ } ++ ++ pub struct sctp_authinfo { ++ pub auth_keynumber: u16, ++ } ++ ++ pub struct sctp_rcvinfo { ++ pub rcv_sid: u16, ++ pub rcv_ssn: u16, ++ pub rcv_flags: u16, ++ pub rcv_ppid: u32, ++ pub rcv_tsn: u32, ++ pub rcv_cumtsn: u32, ++ pub rcv_context: u32, ++ pub rcv_assoc_id: crate::sctp_assoc_t, ++ } ++ ++ pub struct sctp_nxtinfo { ++ pub nxt_sid: u16, ++ pub nxt_flags: u16, ++ pub nxt_ppid: u32, ++ pub nxt_length: u32, ++ pub nxt_assoc_id: crate::sctp_assoc_t, ++ } ++ ++ pub struct sctp_recvv_rn { ++ pub recvv_rcvinfo: sctp_rcvinfo, ++ pub recvv_nxtinfo: sctp_nxtinfo, ++ } ++ ++ pub struct sctp_sendv_spa { ++ pub sendv_flags: u32, ++ pub sendv_sndinfo: sctp_sndinfo, ++ pub sendv_prinfo: sctp_prinfo, ++ pub sendv_authinfo: sctp_authinfo, ++ } ++ ++ pub struct sctp_snd_all_completes { ++ pub sall_stream: u16, ++ pub sall_flags: u16, ++ pub sall_ppid: u32, ++ pub sall_context: u32, ++ pub sall_num_sent: u32, ++ pub sall_num_failed: u32, ++ } ++ ++ pub struct sctp_pcbinfo { ++ pub ep_count: u32, ++ pub asoc_count: u32, ++ pub laddr_count: u32, ++ pub raddr_count: u32, ++ pub chk_count: u32, ++ pub readq_count: u32, ++ pub free_chunks: u32, ++ pub stream_oque: u32, ++ } ++ ++ pub struct sctp_sockstat { ++ pub ss_assoc_id: crate::sctp_assoc_t, ++ pub ss_total_sndbuf: u32, ++ pub ss_total_recv_buf: u32, ++ } ++ ++ pub struct sctp_assoc_change { ++ pub sac_type: u16, ++ pub sac_flags: u16, ++ pub sac_length: u32, ++ pub sac_state: u16, ++ pub sac_error: u16, ++ pub sac_outbound_streams: u16, ++ pub sac_inbound_streams: u16, ++ pub sac_assoc_id: crate::sctp_assoc_t, ++ pub sac_info: [u8; 0], ++ } ++ ++ pub struct sctp_paddr_change { ++ pub spc_type: u16, ++ pub spc_flags: u16, ++ pub spc_length: u32, ++ pub spc_aaddr: crate::sockaddr_storage, ++ pub spc_state: u32, ++ pub spc_error: u32, ++ pub spc_assoc_id: crate::sctp_assoc_t, ++ } ++ ++ pub struct sctp_remote_error { ++ pub sre_type: u16, ++ pub sre_flags: u16, ++ pub sre_length: u32, ++ pub sre_error: u16, ++ pub sre_assoc_id: crate::sctp_assoc_t, ++ pub sre_data: [u8; 0], ++ } ++ ++ pub struct sctp_send_failed_event { ++ pub ssfe_type: u16, ++ pub ssfe_flags: u16, ++ pub ssfe_length: u32, ++ pub ssfe_error: u32, ++ pub ssfe_info: sctp_sndinfo, ++ pub ssfe_assoc_id: crate::sctp_assoc_t, ++ pub ssfe_data: [u8; 0], ++ } ++ ++ pub struct sctp_shutdown_event { ++ pub sse_type: u16, ++ pub sse_flags: u16, ++ pub sse_length: u32, ++ pub sse_assoc_id: crate::sctp_assoc_t, ++ } ++ ++ pub struct sctp_adaptation_event { ++ pub sai_type: u16, ++ pub sai_flags: u16, ++ pub sai_length: u32, ++ pub sai_adaptation_ind: u32, ++ pub sai_assoc_id: crate::sctp_assoc_t, ++ } ++ ++ pub struct sctp_setadaptation { ++ pub ssb_adaptation_ind: u32, ++ } ++ ++ pub struct sctp_pdapi_event { ++ pub pdapi_type: u16, ++ pub pdapi_flags: u16, ++ pub pdapi_length: u32, ++ pub pdapi_indication: u32, ++ pub pdapi_stream: u16, ++ pub pdapi_seq: u16, ++ pub pdapi_assoc_id: crate::sctp_assoc_t, ++ } ++ ++ pub struct sctp_sender_dry_event { ++ pub sender_dry_type: u16, ++ pub sender_dry_flags: u16, ++ pub sender_dry_length: u32, ++ pub sender_dry_assoc_id: crate::sctp_assoc_t, ++ } ++ ++ pub struct sctp_stream_reset_event { ++ pub strreset_type: u16, ++ pub strreset_flags: u16, ++ pub strreset_length: u32, ++ pub strreset_assoc_id: crate::sctp_assoc_t, ++ pub strreset_stream_list: [u16; 0], ++ } ++ ++ pub struct sctp_stream_change_event { ++ pub strchange_type: u16, ++ pub strchange_flags: u16, ++ pub strchange_length: u32, ++ pub strchange_assoc_id: crate::sctp_assoc_t, ++ pub strchange_instrms: u16, ++ pub strchange_outstrms: u16, ++ } ++} ++ ++s_no_extra_traits! { ++ pub struct utmpx { ++ pub ut_type: c_short, ++ pub ut_tv: crate::timeval, ++ pub ut_id: [c_char; 8], ++ pub ut_pid: crate::pid_t, ++ pub ut_user: [c_char; 32], ++ pub ut_line: [c_char; 16], ++ pub ut_host: [c_char; 128], ++ pub __ut_spare: [c_char; 64], ++ } ++ ++ pub union __c_anonymous_cr_pid { ++ __cr_unused: *mut c_void, ++ pub cr_pid: crate::pid_t, ++ } ++ ++ pub struct xucred { ++ pub cr_version: c_uint, ++ pub cr_uid: crate::uid_t, ++ pub cr_ngroups: c_short, ++ pub cr_groups: [crate::gid_t; 16], ++ pub cr_pid__c_anonymous_union: __c_anonymous_cr_pid, ++ } ++ ++ pub struct sockaddr_dl { ++ pub sdl_len: c_uchar, ++ pub sdl_family: c_uchar, ++ pub sdl_index: c_ushort, ++ pub sdl_type: c_uchar, ++ pub sdl_nlen: c_uchar, ++ pub sdl_alen: c_uchar, ++ pub sdl_slen: c_uchar, ++ pub sdl_data: [c_char; 46], ++ } ++ ++ pub struct mq_attr { ++ pub mq_flags: c_long, ++ pub mq_maxmsg: c_long, ++ pub mq_msgsize: c_long, ++ pub mq_curmsgs: c_long, ++ __reserved: [c_long; 4], ++ } ++ ++ pub struct sigevent { ++ pub sigev_notify: c_int, ++ pub sigev_signo: c_int, ++ pub sigev_value: crate::sigval, ++ //The rest of the structure is actually a union. We expose only ++ //sigev_notify_thread_id because it's the most useful union member. ++ pub sigev_notify_thread_id: crate::lwpid_t, ++ #[cfg(target_pointer_width = "64")] ++ __unused1: c_int, ++ __unused2: [c_long; 7], ++ } ++ ++ pub struct ptsstat { ++ #[cfg(any(freebsd12, freebsd13, freebsd14, freebsd15))] ++ pub dev: u64, ++ #[cfg(not(any(freebsd12, freebsd13, freebsd14, freebsd15)))] ++ pub dev: u32, ++ pub devname: [c_char; SPECNAMELEN as usize + 1], ++ } ++ ++ pub union __c_anonymous_elf32_auxv_union { ++ pub a_val: c_int, ++ } ++ ++ pub struct Elf32_Auxinfo { ++ pub a_type: c_int, ++ pub a_un: __c_anonymous_elf32_auxv_union, ++ } ++ ++ pub union __c_anonymous_ifi_epoch { ++ pub tt: crate::time_t, ++ pub ph: u64, ++ } ++ ++ pub union __c_anonymous_ifi_lastchange { ++ pub tv: crate::timeval, ++ pub ph: __c_anonymous_ph, ++ } ++ ++ pub struct if_data { ++ /// ethernet, tokenring, etc ++ pub ifi_type: u8, ++ /// e.g., AUI, Thinnet, 10base-T, etc ++ pub ifi_physical: u8, ++ /// media address length ++ pub ifi_addrlen: u8, ++ /// media header length ++ pub ifi_hdrlen: u8, ++ /// current link state ++ pub ifi_link_state: u8, ++ /// carp vhid ++ pub ifi_vhid: u8, ++ /// length of this data struct ++ pub ifi_datalen: u16, ++ /// maximum transmission unit ++ pub ifi_mtu: u32, ++ /// routing metric (external only) ++ pub ifi_metric: u32, ++ /// linespeed ++ pub ifi_baudrate: u64, ++ /// packets received on interface ++ pub ifi_ipackets: u64, ++ /// input errors on interface ++ pub ifi_ierrors: u64, ++ /// packets sent on interface ++ pub ifi_opackets: u64, ++ /// output errors on interface ++ pub ifi_oerrors: u64, ++ /// collisions on csma interfaces ++ pub ifi_collisions: u64, ++ /// total number of octets received ++ pub ifi_ibytes: u64, ++ /// total number of octets sent ++ pub ifi_obytes: u64, ++ /// packets received via multicast ++ pub ifi_imcasts: u64, ++ /// packets sent via multicast ++ pub ifi_omcasts: u64, ++ /// dropped on input ++ pub ifi_iqdrops: u64, ++ /// dropped on output ++ pub ifi_oqdrops: u64, ++ /// destined for unsupported protocol ++ pub ifi_noproto: u64, ++ /// HW offload capabilities, see IFCAP ++ pub ifi_hwassist: u64, ++ /// uptime at attach or stat reset ++ pub __ifi_epoch: __c_anonymous_ifi_epoch, ++ /// time of last administrative change ++ pub __ifi_lastchange: __c_anonymous_ifi_lastchange, ++ } ++ ++ pub union __c_anonymous_ifr_ifru { ++ pub ifru_addr: crate::sockaddr, ++ pub ifru_dstaddr: crate::sockaddr, ++ pub ifru_broadaddr: crate::sockaddr, ++ pub ifru_buffer: ifreq_buffer, ++ pub ifru_flags: [c_short; 2], ++ pub ifru_index: c_short, ++ pub ifru_jid: c_int, ++ pub ifru_metric: c_int, ++ pub ifru_mtu: c_int, ++ pub ifru_phys: c_int, ++ pub ifru_media: c_int, ++ pub ifru_data: crate::caddr_t, ++ pub ifru_cap: [c_int; 2], ++ pub ifru_fib: c_uint, ++ pub ifru_vlan_pcp: c_uchar, ++ } ++ ++ pub struct ifreq { ++ /// if name, e.g. "en0" ++ pub ifr_name: [c_char; crate::IFNAMSIZ], ++ pub ifr_ifru: __c_anonymous_ifr_ifru, ++ } ++ ++ pub union __c_anonymous_ifc_ifcu { ++ pub ifcu_buf: crate::caddr_t, ++ pub ifcu_req: *mut ifreq, ++ } ++ ++ pub struct ifstat { ++ /// if name, e.g. "en0" ++ pub ifs_name: [c_char; crate::IFNAMSIZ as usize], ++ pub ascii: [c_char; crate::IFSTATMAX as usize + 1], ++ } ++ ++ pub struct ifrsskey { ++ /// if name, e.g. "en0" ++ pub ifrk_name: [c_char; crate::IFNAMSIZ as usize], ++ /// RSS_FUNC_ ++ pub ifrk_func: u8, ++ pub ifrk_spare0: u8, ++ pub ifrk_keylen: u16, ++ pub ifrk_key: [u8; crate::RSS_KEYLEN as usize], ++ } ++ ++ pub struct ifdownreason { ++ pub ifdr_name: [c_char; crate::IFNAMSIZ as usize], ++ pub ifdr_reason: u32, ++ pub ifdr_vendor: u32, ++ pub ifdr_msg: [c_char; crate::IFDR_MSG_SIZE as usize], ++ } ++ ++ #[repr(packed)] ++ pub struct sctphdr { ++ pub src_port: u16, ++ pub dest_port: u16, ++ pub v_tag: u32, ++ pub checksum: u32, ++ } ++ ++ #[repr(packed)] ++ pub struct sctp_chunkhdr { ++ pub chunk_type: u8, ++ pub chunk_flags: u8, ++ pub chunk_length: u16, ++ } ++ ++ #[repr(packed)] ++ pub struct sctp_paramhdr { ++ pub param_type: u16, ++ pub param_length: u16, ++ } ++ ++ #[repr(packed)] ++ pub struct sctp_gen_error_cause { ++ pub code: u16, ++ pub length: u16, ++ pub info: [u8; 0], ++ } ++ ++ #[repr(packed)] ++ pub struct sctp_error_cause { ++ pub code: u16, ++ pub length: u16, ++ } ++ ++ #[repr(packed)] ++ pub struct sctp_error_invalid_stream { ++ pub cause: sctp_error_cause, ++ pub stream_id: u16, ++ __reserved: u16, ++ } ++ ++ #[repr(packed)] ++ pub struct sctp_error_missing_param { ++ pub cause: sctp_error_cause, ++ pub num_missing_params: u32, ++ pub tpe: [u8; 0], ++ } ++ ++ #[repr(packed)] ++ pub struct sctp_error_stale_cookie { ++ pub cause: sctp_error_cause, ++ pub stale_time: u32, ++ } ++ ++ #[repr(packed)] ++ pub struct sctp_error_out_of_resource { ++ pub cause: sctp_error_cause, ++ } ++ ++ #[repr(packed)] ++ pub struct sctp_error_unresolv_addr { ++ pub cause: sctp_error_cause, ++ } ++ ++ #[repr(packed)] ++ pub struct sctp_error_unrecognized_chunk { ++ pub cause: sctp_error_cause, ++ pub ch: sctp_chunkhdr, ++ } ++ ++ #[repr(packed)] ++ pub struct sctp_error_no_user_data { ++ pub cause: sctp_error_cause, ++ pub tsn: u32, ++ } ++ ++ #[repr(packed)] ++ pub struct sctp_error_auth_invalid_hmac { ++ pub cause: sctp_error_cause, ++ pub hmac_id: u16, ++ } ++ ++ pub struct kinfo_file { ++ pub kf_structsize: c_int, ++ pub kf_type: c_int, ++ pub kf_fd: c_int, ++ pub kf_ref_count: c_int, ++ pub kf_flags: c_int, ++ _kf_pad0: c_int, ++ pub kf_offset: i64, ++ _priv: [u8; 304], // FIXME: this is really a giant union ++ pub kf_status: u16, ++ _kf_pad1: u16, ++ _kf_ispare0: c_int, ++ pub kf_cap_rights: crate::cap_rights_t, ++ _kf_cap_spare: u64, ++ pub kf_path: [c_char; crate::PATH_MAX as usize], ++ } ++ ++ pub struct ucontext_t { ++ pub uc_sigmask: crate::sigset_t, ++ pub uc_mcontext: crate::mcontext_t, ++ pub uc_link: *mut crate::ucontext_t, ++ pub uc_stack: crate::stack_t, ++ pub uc_flags: c_int, ++ __spare__: [c_int; 4], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for utmpx { ++ fn eq(&self, other: &utmpx) -> bool { ++ self.ut_type == other.ut_type ++ && self.ut_tv == other.ut_tv ++ && self.ut_id == other.ut_id ++ && self.ut_pid == other.ut_pid ++ && self.ut_user == other.ut_user ++ && self.ut_line == other.ut_line ++ && self ++ .ut_host ++ .iter() ++ .zip(other.ut_host.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .__ut_spare ++ .iter() ++ .zip(other.__ut_spare.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for utmpx {} ++ impl fmt::Debug for utmpx { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("utmpx") ++ .field("ut_type", &self.ut_type) ++ .field("ut_tv", &self.ut_tv) ++ .field("ut_id", &self.ut_id) ++ .field("ut_pid", &self.ut_pid) ++ .field("ut_user", &self.ut_user) ++ .field("ut_line", &self.ut_line) ++ // FIXME: .field("ut_host", &self.ut_host) ++ // FIXME: .field("__ut_spare", &self.__ut_spare) ++ .finish() ++ } ++ } ++ impl hash::Hash for utmpx { ++ fn hash(&self, state: &mut H) { ++ self.ut_type.hash(state); ++ self.ut_tv.hash(state); ++ self.ut_id.hash(state); ++ self.ut_pid.hash(state); ++ self.ut_user.hash(state); ++ self.ut_line.hash(state); ++ self.ut_host.hash(state); ++ self.__ut_spare.hash(state); ++ } ++ } ++ ++ impl PartialEq for __c_anonymous_cr_pid { ++ fn eq(&self, other: &__c_anonymous_cr_pid) -> bool { ++ unsafe { self.cr_pid == other.cr_pid } ++ } ++ } ++ impl Eq for __c_anonymous_cr_pid {} ++ impl hash::Hash for __c_anonymous_cr_pid { ++ fn hash(&self, state: &mut H) { ++ unsafe { self.cr_pid.hash(state) }; ++ } ++ } ++ ++ impl PartialEq for xucred { ++ fn eq(&self, other: &xucred) -> bool { ++ self.cr_version == other.cr_version ++ && self.cr_uid == other.cr_uid ++ && self.cr_ngroups == other.cr_ngroups ++ && self.cr_groups == other.cr_groups ++ && self.cr_pid__c_anonymous_union == other.cr_pid__c_anonymous_union ++ } ++ } ++ impl Eq for xucred {} ++ impl fmt::Debug for xucred { ++ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { ++ f.debug_struct("xucred") ++ .field("cr_version", &self.cr_version) ++ .field("cr_uid", &self.cr_uid) ++ .field("cr_ngroups", &self.cr_ngroups) ++ .field("cr_groups", &self.cr_groups) ++ .field("cr_pid__c_anonymous_union", &self.cr_pid__c_anonymous_union) ++ .finish() ++ } ++ } ++ impl hash::Hash for xucred { ++ fn hash(&self, state: &mut H) { ++ self.cr_version.hash(state); ++ self.cr_uid.hash(state); ++ self.cr_ngroups.hash(state); ++ self.cr_groups.hash(state); ++ self.cr_pid__c_anonymous_union.hash(state); ++ } ++ } ++ ++ impl PartialEq for sockaddr_dl { ++ fn eq(&self, other: &sockaddr_dl) -> bool { ++ self.sdl_len == other.sdl_len ++ && self.sdl_family == other.sdl_family ++ && self.sdl_index == other.sdl_index ++ && self.sdl_type == other.sdl_type ++ && self.sdl_nlen == other.sdl_nlen ++ && self.sdl_alen == other.sdl_alen ++ && self.sdl_slen == other.sdl_slen ++ && self ++ .sdl_data ++ .iter() ++ .zip(other.sdl_data.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for sockaddr_dl {} ++ impl fmt::Debug for sockaddr_dl { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sockaddr_dl") ++ .field("sdl_len", &self.sdl_len) ++ .field("sdl_family", &self.sdl_family) ++ .field("sdl_index", &self.sdl_index) ++ .field("sdl_type", &self.sdl_type) ++ .field("sdl_nlen", &self.sdl_nlen) ++ .field("sdl_alen", &self.sdl_alen) ++ .field("sdl_slen", &self.sdl_slen) ++ // FIXME: .field("sdl_data", &self.sdl_data) ++ .finish() ++ } ++ } ++ impl hash::Hash for sockaddr_dl { ++ fn hash(&self, state: &mut H) { ++ self.sdl_len.hash(state); ++ self.sdl_family.hash(state); ++ self.sdl_index.hash(state); ++ self.sdl_type.hash(state); ++ self.sdl_nlen.hash(state); ++ self.sdl_alen.hash(state); ++ self.sdl_slen.hash(state); ++ self.sdl_data.hash(state); ++ } ++ } ++ ++ impl PartialEq for mq_attr { ++ fn eq(&self, other: &mq_attr) -> bool { ++ self.mq_flags == other.mq_flags ++ && self.mq_maxmsg == other.mq_maxmsg ++ && self.mq_msgsize == other.mq_msgsize ++ && self.mq_curmsgs == other.mq_curmsgs ++ } ++ } ++ impl Eq for mq_attr {} ++ impl fmt::Debug for mq_attr { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("mq_attr") ++ .field("mq_flags", &self.mq_flags) ++ .field("mq_maxmsg", &self.mq_maxmsg) ++ .field("mq_msgsize", &self.mq_msgsize) ++ .field("mq_curmsgs", &self.mq_curmsgs) ++ .finish() ++ } ++ } ++ impl hash::Hash for mq_attr { ++ fn hash(&self, state: &mut H) { ++ self.mq_flags.hash(state); ++ self.mq_maxmsg.hash(state); ++ self.mq_msgsize.hash(state); ++ self.mq_curmsgs.hash(state); ++ } ++ } ++ ++ impl PartialEq for sigevent { ++ fn eq(&self, other: &sigevent) -> bool { ++ self.sigev_notify == other.sigev_notify ++ && self.sigev_signo == other.sigev_signo ++ && self.sigev_value == other.sigev_value ++ && self.sigev_notify_thread_id == other.sigev_notify_thread_id ++ } ++ } ++ impl Eq for sigevent {} ++ impl fmt::Debug for sigevent { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sigevent") ++ .field("sigev_notify", &self.sigev_notify) ++ .field("sigev_signo", &self.sigev_signo) ++ .field("sigev_value", &self.sigev_value) ++ .field("sigev_notify_thread_id", &self.sigev_notify_thread_id) ++ .finish() ++ } ++ } ++ impl hash::Hash for sigevent { ++ fn hash(&self, state: &mut H) { ++ self.sigev_notify.hash(state); ++ self.sigev_signo.hash(state); ++ self.sigev_value.hash(state); ++ self.sigev_notify_thread_id.hash(state); ++ } ++ } ++ ++ impl PartialEq for ptsstat { ++ fn eq(&self, other: &ptsstat) -> bool { ++ let self_devname: &[c_char] = &self.devname; ++ let other_devname: &[c_char] = &other.devname; ++ ++ self.dev == other.dev && self_devname == other_devname ++ } ++ } ++ impl Eq for ptsstat {} ++ impl fmt::Debug for ptsstat { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ let self_devname: &[c_char] = &self.devname; ++ ++ f.debug_struct("ptsstat") ++ .field("dev", &self.dev) ++ .field("devname", &self_devname) ++ .finish() ++ } ++ } ++ impl hash::Hash for ptsstat { ++ fn hash(&self, state: &mut H) { ++ let self_devname: &[c_char] = &self.devname; ++ ++ self.dev.hash(state); ++ self_devname.hash(state); ++ } ++ } ++ ++ impl PartialEq for __c_anonymous_elf32_auxv_union { ++ fn eq(&self, other: &__c_anonymous_elf32_auxv_union) -> bool { ++ unsafe { self.a_val == other.a_val } ++ } ++ } ++ impl Eq for __c_anonymous_elf32_auxv_union {} ++ impl PartialEq for Elf32_Auxinfo { ++ fn eq(&self, other: &Elf32_Auxinfo) -> bool { ++ self.a_type == other.a_type && self.a_un == other.a_un ++ } ++ } ++ impl Eq for Elf32_Auxinfo {} ++ impl fmt::Debug for Elf32_Auxinfo { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("Elf32_Auxinfo") ++ .field("a_type", &self.a_type) ++ .field("a_un", &self.a_un) ++ .finish() ++ } ++ } ++ ++ impl PartialEq for __c_anonymous_ifr_ifru { ++ fn eq(&self, other: &__c_anonymous_ifr_ifru) -> bool { ++ unsafe { ++ self.ifru_addr == other.ifru_addr ++ && self.ifru_dstaddr == other.ifru_dstaddr ++ && self.ifru_broadaddr == other.ifru_broadaddr ++ && self.ifru_buffer == other.ifru_buffer ++ && self.ifru_flags == other.ifru_flags ++ && self.ifru_index == other.ifru_index ++ && self.ifru_jid == other.ifru_jid ++ && self.ifru_metric == other.ifru_metric ++ && self.ifru_mtu == other.ifru_mtu ++ && self.ifru_phys == other.ifru_phys ++ && self.ifru_media == other.ifru_media ++ && self.ifru_data == other.ifru_data ++ && self.ifru_cap == other.ifru_cap ++ && self.ifru_fib == other.ifru_fib ++ && self.ifru_vlan_pcp == other.ifru_vlan_pcp ++ } ++ } ++ } ++ impl Eq for __c_anonymous_ifr_ifru {} ++ impl hash::Hash for __c_anonymous_ifr_ifru { ++ fn hash(&self, state: &mut H) { ++ unsafe { self.ifru_addr.hash(state) }; ++ unsafe { self.ifru_dstaddr.hash(state) }; ++ unsafe { self.ifru_broadaddr.hash(state) }; ++ unsafe { self.ifru_buffer.hash(state) }; ++ unsafe { self.ifru_flags.hash(state) }; ++ unsafe { self.ifru_index.hash(state) }; ++ unsafe { self.ifru_jid.hash(state) }; ++ unsafe { self.ifru_metric.hash(state) }; ++ unsafe { self.ifru_mtu.hash(state) }; ++ unsafe { self.ifru_phys.hash(state) }; ++ unsafe { self.ifru_media.hash(state) }; ++ unsafe { self.ifru_data.hash(state) }; ++ unsafe { self.ifru_cap.hash(state) }; ++ unsafe { self.ifru_fib.hash(state) }; ++ unsafe { self.ifru_vlan_pcp.hash(state) }; ++ } ++ } ++ ++ impl PartialEq for ifreq { ++ fn eq(&self, other: &ifreq) -> bool { ++ self.ifr_name == other.ifr_name && self.ifr_ifru == other.ifr_ifru ++ } ++ } ++ impl Eq for ifreq {} ++ impl fmt::Debug for ifreq { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("ifreq") ++ .field("ifr_name", &self.ifr_name) ++ .field("ifr_ifru", &self.ifr_ifru) ++ .finish() ++ } ++ } ++ impl hash::Hash for ifreq { ++ fn hash(&self, state: &mut H) { ++ self.ifr_name.hash(state); ++ self.ifr_ifru.hash(state); ++ } ++ } ++ ++ impl Eq for __c_anonymous_ifc_ifcu {} ++ ++ impl PartialEq for __c_anonymous_ifc_ifcu { ++ fn eq(&self, other: &__c_anonymous_ifc_ifcu) -> bool { ++ unsafe { self.ifcu_buf == other.ifcu_buf && self.ifcu_req == other.ifcu_req } ++ } ++ } ++ ++ impl hash::Hash for __c_anonymous_ifc_ifcu { ++ fn hash(&self, state: &mut H) { ++ unsafe { self.ifcu_buf.hash(state) }; ++ unsafe { self.ifcu_req.hash(state) }; ++ } ++ } ++ ++ impl PartialEq for ifstat { ++ fn eq(&self, other: &ifstat) -> bool { ++ let self_ascii: &[c_char] = &self.ascii; ++ let other_ascii: &[c_char] = &other.ascii; ++ ++ self.ifs_name == other.ifs_name && self_ascii == other_ascii ++ } ++ } ++ impl Eq for ifstat {} ++ impl fmt::Debug for ifstat { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ let ascii: &[c_char] = &self.ascii; ++ ++ f.debug_struct("ifstat") ++ .field("ifs_name", &self.ifs_name) ++ .field("ascii", &ascii) ++ .finish() ++ } ++ } ++ impl hash::Hash for ifstat { ++ fn hash(&self, state: &mut H) { ++ self.ifs_name.hash(state); ++ self.ascii.hash(state); ++ } ++ } ++ ++ impl PartialEq for ifrsskey { ++ fn eq(&self, other: &ifrsskey) -> bool { ++ let self_ifrk_key: &[u8] = &self.ifrk_key; ++ let other_ifrk_key: &[u8] = &other.ifrk_key; ++ ++ self.ifrk_name == other.ifrk_name ++ && self.ifrk_func == other.ifrk_func ++ && self.ifrk_spare0 == other.ifrk_spare0 ++ && self.ifrk_keylen == other.ifrk_keylen ++ && self_ifrk_key == other_ifrk_key ++ } ++ } ++ impl Eq for ifrsskey {} ++ impl fmt::Debug for ifrsskey { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ let ifrk_key: &[u8] = &self.ifrk_key; ++ ++ f.debug_struct("ifrsskey") ++ .field("ifrk_name", &self.ifrk_name) ++ .field("ifrk_func", &self.ifrk_func) ++ .field("ifrk_spare0", &self.ifrk_spare0) ++ .field("ifrk_keylen", &self.ifrk_keylen) ++ .field("ifrk_key", &ifrk_key) ++ .finish() ++ } ++ } ++ impl hash::Hash for ifrsskey { ++ fn hash(&self, state: &mut H) { ++ self.ifrk_name.hash(state); ++ self.ifrk_func.hash(state); ++ self.ifrk_spare0.hash(state); ++ self.ifrk_keylen.hash(state); ++ self.ifrk_key.hash(state); ++ } ++ } ++ ++ impl PartialEq for ifdownreason { ++ fn eq(&self, other: &ifdownreason) -> bool { ++ let self_ifdr_msg: &[c_char] = &self.ifdr_msg; ++ let other_ifdr_msg: &[c_char] = &other.ifdr_msg; ++ ++ self.ifdr_name == other.ifdr_name ++ && self.ifdr_reason == other.ifdr_reason ++ && self.ifdr_vendor == other.ifdr_vendor ++ && self_ifdr_msg == other_ifdr_msg ++ } ++ } ++ impl Eq for ifdownreason {} ++ impl fmt::Debug for ifdownreason { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ let ifdr_msg: &[c_char] = &self.ifdr_msg; ++ ++ f.debug_struct("ifdownreason") ++ .field("ifdr_name", &self.ifdr_name) ++ .field("ifdr_reason", &self.ifdr_reason) ++ .field("ifdr_vendor", &self.ifdr_vendor) ++ .field("ifdr_msg", &ifdr_msg) ++ .finish() ++ } ++ } ++ impl hash::Hash for ifdownreason { ++ fn hash(&self, state: &mut H) { ++ self.ifdr_name.hash(state); ++ self.ifdr_reason.hash(state); ++ self.ifdr_vendor.hash(state); ++ self.ifdr_msg.hash(state); ++ } ++ } ++ ++ impl PartialEq for __c_anonymous_ifi_epoch { ++ fn eq(&self, other: &__c_anonymous_ifi_epoch) -> bool { ++ unsafe { self.tt == other.tt && self.ph == other.ph } ++ } ++ } ++ impl Eq for __c_anonymous_ifi_epoch {} ++ impl hash::Hash for __c_anonymous_ifi_epoch { ++ fn hash(&self, state: &mut H) { ++ unsafe { ++ self.tt.hash(state); ++ self.ph.hash(state); ++ } ++ } ++ } ++ ++ impl PartialEq for __c_anonymous_ifi_lastchange { ++ fn eq(&self, other: &__c_anonymous_ifi_lastchange) -> bool { ++ unsafe { self.tv == other.tv && self.ph == other.ph } ++ } ++ } ++ impl Eq for __c_anonymous_ifi_lastchange {} ++ impl hash::Hash for __c_anonymous_ifi_lastchange { ++ fn hash(&self, state: &mut H) { ++ unsafe { ++ self.tv.hash(state); ++ self.ph.hash(state); ++ } ++ } ++ } ++ ++ impl PartialEq for if_data { ++ fn eq(&self, other: &if_data) -> bool { ++ self.ifi_type == other.ifi_type ++ && self.ifi_physical == other.ifi_physical ++ && self.ifi_addrlen == other.ifi_addrlen ++ && self.ifi_hdrlen == other.ifi_hdrlen ++ && self.ifi_link_state == other.ifi_link_state ++ && self.ifi_vhid == other.ifi_vhid ++ && self.ifi_datalen == other.ifi_datalen ++ && self.ifi_mtu == other.ifi_mtu ++ && self.ifi_metric == other.ifi_metric ++ && self.ifi_baudrate == other.ifi_baudrate ++ && self.ifi_ipackets == other.ifi_ipackets ++ && self.ifi_ierrors == other.ifi_ierrors ++ && self.ifi_opackets == other.ifi_opackets ++ && self.ifi_oerrors == other.ifi_oerrors ++ && self.ifi_collisions == other.ifi_collisions ++ && self.ifi_ibytes == other.ifi_ibytes ++ && self.ifi_obytes == other.ifi_obytes ++ && self.ifi_imcasts == other.ifi_imcasts ++ && self.ifi_omcasts == other.ifi_omcasts ++ && self.ifi_iqdrops == other.ifi_iqdrops ++ && self.ifi_oqdrops == other.ifi_oqdrops ++ && self.ifi_noproto == other.ifi_noproto ++ && self.ifi_hwassist == other.ifi_hwassist ++ && self.__ifi_epoch == other.__ifi_epoch ++ && self.__ifi_lastchange == other.__ifi_lastchange ++ } ++ } ++ impl Eq for if_data {} ++ impl fmt::Debug for if_data { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("if_data") ++ .field("ifi_type", &self.ifi_type) ++ .field("ifi_physical", &self.ifi_physical) ++ .field("ifi_addrlen", &self.ifi_addrlen) ++ .field("ifi_hdrlen", &self.ifi_hdrlen) ++ .field("ifi_link_state", &self.ifi_link_state) ++ .field("ifi_vhid", &self.ifi_vhid) ++ .field("ifi_datalen", &self.ifi_datalen) ++ .field("ifi_mtu", &self.ifi_mtu) ++ .field("ifi_metric", &self.ifi_metric) ++ .field("ifi_baudrate", &self.ifi_baudrate) ++ .field("ifi_ipackets", &self.ifi_ipackets) ++ .field("ifi_ierrors", &self.ifi_ierrors) ++ .field("ifi_opackets", &self.ifi_opackets) ++ .field("ifi_oerrors", &self.ifi_oerrors) ++ .field("ifi_collisions", &self.ifi_collisions) ++ .field("ifi_ibytes", &self.ifi_ibytes) ++ .field("ifi_obytes", &self.ifi_obytes) ++ .field("ifi_imcasts", &self.ifi_imcasts) ++ .field("ifi_omcasts", &self.ifi_omcasts) ++ .field("ifi_iqdrops", &self.ifi_iqdrops) ++ .field("ifi_oqdrops", &self.ifi_oqdrops) ++ .field("ifi_noproto", &self.ifi_noproto) ++ .field("ifi_hwassist", &self.ifi_hwassist) ++ .field("__ifi_epoch", &self.__ifi_epoch) ++ .field("__ifi_lastchange", &self.__ifi_lastchange) ++ .finish() ++ } ++ } ++ impl hash::Hash for if_data { ++ fn hash(&self, state: &mut H) { ++ self.ifi_type.hash(state); ++ self.ifi_physical.hash(state); ++ self.ifi_addrlen.hash(state); ++ self.ifi_hdrlen.hash(state); ++ self.ifi_link_state.hash(state); ++ self.ifi_vhid.hash(state); ++ self.ifi_datalen.hash(state); ++ self.ifi_mtu.hash(state); ++ self.ifi_metric.hash(state); ++ self.ifi_baudrate.hash(state); ++ self.ifi_ipackets.hash(state); ++ self.ifi_ierrors.hash(state); ++ self.ifi_opackets.hash(state); ++ self.ifi_oerrors.hash(state); ++ self.ifi_collisions.hash(state); ++ self.ifi_ibytes.hash(state); ++ self.ifi_obytes.hash(state); ++ self.ifi_imcasts.hash(state); ++ self.ifi_omcasts.hash(state); ++ self.ifi_iqdrops.hash(state); ++ self.ifi_oqdrops.hash(state); ++ self.ifi_noproto.hash(state); ++ self.ifi_hwassist.hash(state); ++ self.__ifi_epoch.hash(state); ++ self.__ifi_lastchange.hash(state); ++ } ++ } ++ ++ impl PartialEq for sctphdr { ++ fn eq(&self, other: &sctphdr) -> bool { ++ return { self.src_port } == { other.src_port } ++ && { self.dest_port } == { other.dest_port } ++ && { self.v_tag } == { other.v_tag } ++ && { self.checksum } == { other.checksum }; ++ } ++ } ++ impl Eq for sctphdr {} ++ impl fmt::Debug for sctphdr { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sctphdr") ++ .field("src_port", &{ self.src_port }) ++ .field("dest_port", &{ self.dest_port }) ++ .field("v_tag", &{ self.v_tag }) ++ .field("checksum", &{ self.checksum }) ++ .finish() ++ } ++ } ++ impl hash::Hash for sctphdr { ++ fn hash(&self, state: &mut H) { ++ { self.src_port }.hash(state); ++ { self.dest_port }.hash(state); ++ { self.v_tag }.hash(state); ++ { self.checksum }.hash(state); ++ } ++ } ++ ++ impl PartialEq for sctp_chunkhdr { ++ fn eq(&self, other: &sctp_chunkhdr) -> bool { ++ return { self.chunk_type } == { other.chunk_type } ++ && { self.chunk_flags } == { other.chunk_flags } ++ && { self.chunk_length } == { other.chunk_length }; ++ } ++ } ++ impl Eq for sctp_chunkhdr {} ++ impl fmt::Debug for sctp_chunkhdr { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sctp_chunkhdr") ++ .field("chunk_type", &{ self.chunk_type }) ++ .field("chunk_flags", &{ self.chunk_flags }) ++ .field("chunk_length", &{ self.chunk_length }) ++ .finish() ++ } ++ } ++ impl hash::Hash for sctp_chunkhdr { ++ fn hash(&self, state: &mut H) { ++ { self.chunk_type }.hash(state); ++ { self.chunk_flags }.hash(state); ++ { self.chunk_length }.hash(state); ++ } ++ } ++ ++ impl PartialEq for sctp_paramhdr { ++ fn eq(&self, other: &sctp_paramhdr) -> bool { ++ return { self.param_type } == { other.param_type } && { self.param_length } == { ++ other.param_length ++ }; ++ } ++ } ++ impl Eq for sctp_paramhdr {} ++ impl fmt::Debug for sctp_paramhdr { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sctp_paramhdr") ++ .field("param_type", &{ self.param_type }) ++ .field("param_length", &{ self.param_length }) ++ .finish() ++ } ++ } ++ impl hash::Hash for sctp_paramhdr { ++ fn hash(&self, state: &mut H) { ++ { self.param_type }.hash(state); ++ { self.param_length }.hash(state); ++ } ++ } ++ ++ impl PartialEq for sctp_gen_error_cause { ++ fn eq(&self, other: &sctp_gen_error_cause) -> bool { ++ return { self.code } == { other.code } && { self.length } == { other.length } && { ++ self.info ++ } ++ .iter() ++ .zip({ other.info }.iter()) ++ .all(|(a, b)| a == b); ++ } ++ } ++ impl Eq for sctp_gen_error_cause {} ++ impl fmt::Debug for sctp_gen_error_cause { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sctp_gen_error_cause") ++ .field("code", &{ self.code }) ++ .field("length", &{ self.length }) ++ // FIXME: .field("info", &{self.info}) ++ .finish() ++ } ++ } ++ impl hash::Hash for sctp_gen_error_cause { ++ fn hash(&self, state: &mut H) { ++ { self.code }.hash(state); ++ { self.length }.hash(state); ++ { self.info }.hash(state); ++ } ++ } ++ ++ impl PartialEq for sctp_error_cause { ++ fn eq(&self, other: &sctp_error_cause) -> bool { ++ return { self.code } == { other.code } && { self.length } == { other.length }; ++ } ++ } ++ impl Eq for sctp_error_cause {} ++ impl fmt::Debug for sctp_error_cause { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sctp_error_cause") ++ .field("code", &{ self.code }) ++ .field("length", &{ self.length }) ++ .finish() ++ } ++ } ++ impl hash::Hash for sctp_error_cause { ++ fn hash(&self, state: &mut H) { ++ { self.code }.hash(state); ++ { self.length }.hash(state); ++ } ++ } ++ ++ impl PartialEq for sctp_error_invalid_stream { ++ fn eq(&self, other: &sctp_error_invalid_stream) -> bool { ++ return { self.cause } == { other.cause } && { self.stream_id } == { ++ other.stream_id ++ }; ++ } ++ } ++ impl Eq for sctp_error_invalid_stream {} ++ impl fmt::Debug for sctp_error_invalid_stream { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sctp_error_invalid_stream") ++ .field("cause", &{ self.cause }) ++ .field("stream_id", &{ self.stream_id }) ++ .finish() ++ } ++ } ++ impl hash::Hash for sctp_error_invalid_stream { ++ fn hash(&self, state: &mut H) { ++ { self.cause }.hash(state); ++ { self.stream_id }.hash(state); ++ } ++ } ++ ++ impl PartialEq for sctp_error_missing_param { ++ fn eq(&self, other: &sctp_error_missing_param) -> bool { ++ return { self.cause } == { other.cause } ++ && { self.num_missing_params } == { other.num_missing_params } ++ && { self.tpe } ++ .iter() ++ .zip({ other.tpe }.iter()) ++ .all(|(a, b)| a == b); ++ } ++ } ++ impl Eq for sctp_error_missing_param {} ++ impl fmt::Debug for sctp_error_missing_param { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sctp_error_missing_param") ++ .field("cause", &{ self.cause }) ++ .field("num_missing_params", &{ self.num_missing_params }) ++ // FIXME: .field("tpe", &{self.tpe}) ++ .finish() ++ } ++ } ++ impl hash::Hash for sctp_error_missing_param { ++ fn hash(&self, state: &mut H) { ++ { self.cause }.hash(state); ++ { self.num_missing_params }.hash(state); ++ { self.tpe }.hash(state); ++ } ++ } ++ ++ impl PartialEq for sctp_error_stale_cookie { ++ fn eq(&self, other: &sctp_error_stale_cookie) -> bool { ++ return { self.cause } == { other.cause } && { self.stale_time } == { ++ other.stale_time ++ }; ++ } ++ } ++ impl Eq for sctp_error_stale_cookie {} ++ impl fmt::Debug for sctp_error_stale_cookie { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sctp_error_stale_cookie") ++ .field("cause", &{ self.cause }) ++ .field("stale_time", &{ self.stale_time }) ++ .finish() ++ } ++ } ++ impl hash::Hash for sctp_error_stale_cookie { ++ fn hash(&self, state: &mut H) { ++ { self.cause }.hash(state); ++ { self.stale_time }.hash(state); ++ } ++ } ++ ++ impl PartialEq for sctp_error_out_of_resource { ++ fn eq(&self, other: &sctp_error_out_of_resource) -> bool { ++ return { self.cause } == { other.cause }; ++ } ++ } ++ impl Eq for sctp_error_out_of_resource {} ++ impl fmt::Debug for sctp_error_out_of_resource { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sctp_error_out_of_resource") ++ .field("cause", &{ self.cause }) ++ .finish() ++ } ++ } ++ impl hash::Hash for sctp_error_out_of_resource { ++ fn hash(&self, state: &mut H) { ++ { self.cause }.hash(state); ++ } ++ } ++ ++ impl PartialEq for sctp_error_unresolv_addr { ++ fn eq(&self, other: &sctp_error_unresolv_addr) -> bool { ++ return { self.cause } == { other.cause }; ++ } ++ } ++ impl Eq for sctp_error_unresolv_addr {} ++ impl fmt::Debug for sctp_error_unresolv_addr { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sctp_error_unresolv_addr") ++ .field("cause", &{ self.cause }) ++ .finish() ++ } ++ } ++ impl hash::Hash for sctp_error_unresolv_addr { ++ fn hash(&self, state: &mut H) { ++ { self.cause }.hash(state); ++ } ++ } ++ ++ impl PartialEq for sctp_error_unrecognized_chunk { ++ fn eq(&self, other: &sctp_error_unrecognized_chunk) -> bool { ++ return { self.cause } == { other.cause } && { self.ch } == { other.ch }; ++ } ++ } ++ impl Eq for sctp_error_unrecognized_chunk {} ++ impl fmt::Debug for sctp_error_unrecognized_chunk { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sctp_error_unrecognized_chunk") ++ .field("cause", &{ self.cause }) ++ .field("ch", &{ self.ch }) ++ .finish() ++ } ++ } ++ impl hash::Hash for sctp_error_unrecognized_chunk { ++ fn hash(&self, state: &mut H) { ++ { self.cause }.hash(state); ++ { self.ch }.hash(state); ++ } ++ } ++ ++ impl PartialEq for sctp_error_no_user_data { ++ fn eq(&self, other: &sctp_error_no_user_data) -> bool { ++ return { self.cause } == { other.cause } && { self.tsn } == { other.tsn }; ++ } ++ } ++ impl Eq for sctp_error_no_user_data {} ++ impl fmt::Debug for sctp_error_no_user_data { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sctp_error_no_user_data") ++ .field("cause", &{ self.cause }) ++ .field("tsn", &{ self.tsn }) ++ .finish() ++ } ++ } ++ impl hash::Hash for sctp_error_no_user_data { ++ fn hash(&self, state: &mut H) { ++ { self.cause }.hash(state); ++ { self.tsn }.hash(state); ++ } ++ } ++ ++ impl PartialEq for sctp_error_auth_invalid_hmac { ++ fn eq(&self, other: &sctp_error_auth_invalid_hmac) -> bool { ++ return { self.cause } == { other.cause } && { self.hmac_id } == { other.hmac_id }; ++ } ++ } ++ impl Eq for sctp_error_auth_invalid_hmac {} ++ impl fmt::Debug for sctp_error_auth_invalid_hmac { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sctp_error_invalid_hmac") ++ .field("cause", &{ self.cause }) ++ .field("hmac_id", &{ self.hmac_id }) ++ .finish() ++ } ++ } ++ impl hash::Hash for sctp_error_auth_invalid_hmac { ++ fn hash(&self, state: &mut H) { ++ { self.cause }.hash(state); ++ { self.hmac_id }.hash(state); ++ } ++ } ++ ++ impl PartialEq for kinfo_file { ++ fn eq(&self, other: &kinfo_file) -> bool { ++ self.kf_structsize == other.kf_structsize ++ && self.kf_type == other.kf_type ++ && self.kf_fd == other.kf_fd ++ && self.kf_ref_count == other.kf_ref_count ++ && self.kf_flags == other.kf_flags ++ && self.kf_offset == other.kf_offset ++ && self.kf_status == other.kf_status ++ && self.kf_cap_rights == other.kf_cap_rights ++ && self ++ .kf_path ++ .iter() ++ .zip(other.kf_path.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for kinfo_file {} ++ impl fmt::Debug for kinfo_file { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("kinfo_file") ++ .field("kf_structsize", &self.kf_structsize) ++ .field("kf_type", &self.kf_type) ++ .field("kf_fd", &self.kf_fd) ++ .field("kf_ref_count", &self.kf_ref_count) ++ .field("kf_flags", &self.kf_flags) ++ .field("kf_offset", &self.kf_offset) ++ .field("kf_status", &self.kf_status) ++ .field("kf_cap_rights", &self.kf_cap_rights) ++ .field("kf_path", &&self.kf_path[..]) ++ .finish() ++ } ++ } ++ impl hash::Hash for kinfo_file { ++ fn hash(&self, state: &mut H) { ++ self.kf_structsize.hash(state); ++ self.kf_type.hash(state); ++ self.kf_fd.hash(state); ++ self.kf_ref_count.hash(state); ++ self.kf_flags.hash(state); ++ self.kf_offset.hash(state); ++ self.kf_status.hash(state); ++ self.kf_cap_rights.hash(state); ++ self.kf_path.hash(state); ++ } ++ } ++ ++ impl fmt::Debug for ucontext_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("ucontext_t") ++ .field("uc_sigmask", &self.uc_sigmask) ++ .field("uc_mcontext", &self.uc_mcontext) ++ .field("uc_link", &self.uc_link) ++ .field("uc_stack", &self.uc_stack) ++ .field("uc_flags", &self.uc_flags) ++ .finish() ++ } ++ } ++ } ++} ++ ++#[cfg_attr(feature = "extra_traits", derive(Debug))] ++#[repr(u32)] ++pub enum dot3Vendors { ++ dot3VendorAMD = 1, ++ dot3VendorIntel = 2, ++ dot3VendorNational = 4, ++ dot3VendorFujitsu = 5, ++ dot3VendorDigital = 6, ++ dot3VendorWesternDigital = 7, ++} ++impl Copy for dot3Vendors {} ++impl Clone for dot3Vendors { ++ fn clone(&self) -> dot3Vendors { ++ *self ++ } ++} ++ ++// aio.h ++pub const LIO_VECTORED: c_int = 4; ++pub const LIO_WRITEV: c_int = 5; ++pub const LIO_READV: c_int = 6; ++ ++// sys/caprights.h ++pub const CAP_RIGHTS_VERSION_00: i32 = 0; ++pub const CAP_RIGHTS_VERSION: i32 = CAP_RIGHTS_VERSION_00; ++ ++// sys/capsicum.h ++macro_rules! cap_right { ++ ($idx:expr, $bit:expr) => { ++ ((1u64 << (57 + ($idx))) | ($bit)) ++ }; ++} ++pub const CAP_READ: u64 = cap_right!(0, 0x0000000000000001u64); ++pub const CAP_WRITE: u64 = cap_right!(0, 0x0000000000000002u64); ++pub const CAP_SEEK_TELL: u64 = cap_right!(0, 0x0000000000000004u64); ++pub const CAP_SEEK: u64 = CAP_SEEK_TELL | 0x0000000000000008u64; ++pub const CAP_PREAD: u64 = CAP_SEEK | CAP_READ; ++pub const CAP_PWRITE: u64 = CAP_SEEK | CAP_WRITE; ++pub const CAP_MMAP: u64 = cap_right!(0, 0x0000000000000010u64); ++pub const CAP_MMAP_R: u64 = CAP_MMAP | CAP_SEEK | CAP_READ; ++pub const CAP_MMAP_W: u64 = CAP_MMAP | CAP_SEEK | CAP_WRITE; ++pub const CAP_MMAP_X: u64 = CAP_MMAP | CAP_SEEK | 0x0000000000000020u64; ++pub const CAP_MMAP_RW: u64 = CAP_MMAP_R | CAP_MMAP_W; ++pub const CAP_MMAP_RX: u64 = CAP_MMAP_R | CAP_MMAP_X; ++pub const CAP_MMAP_WX: u64 = CAP_MMAP_W | CAP_MMAP_X; ++pub const CAP_MMAP_RWX: u64 = CAP_MMAP_R | CAP_MMAP_W | CAP_MMAP_X; ++pub const CAP_CREATE: u64 = cap_right!(0, 0x0000000000000040u64); ++pub const CAP_FEXECVE: u64 = cap_right!(0, 0x0000000000000080u64); ++pub const CAP_FSYNC: u64 = cap_right!(0, 0x0000000000000100u64); ++pub const CAP_FTRUNCATE: u64 = cap_right!(0, 0x0000000000000200u64); ++pub const CAP_LOOKUP: u64 = cap_right!(0, 0x0000000000000400u64); ++pub const CAP_FCHDIR: u64 = cap_right!(0, 0x0000000000000800u64); ++pub const CAP_FCHFLAGS: u64 = cap_right!(0, 0x0000000000001000u64); ++pub const CAP_CHFLAGSAT: u64 = CAP_FCHFLAGS | CAP_LOOKUP; ++pub const CAP_FCHMOD: u64 = cap_right!(0, 0x0000000000002000u64); ++pub const CAP_FCHMODAT: u64 = CAP_FCHMOD | CAP_LOOKUP; ++pub const CAP_FCHOWN: u64 = cap_right!(0, 0x0000000000004000u64); ++pub const CAP_FCHOWNAT: u64 = CAP_FCHOWN | CAP_LOOKUP; ++pub const CAP_FCNTL: u64 = cap_right!(0, 0x0000000000008000u64); ++pub const CAP_FLOCK: u64 = cap_right!(0, 0x0000000000010000u64); ++pub const CAP_FPATHCONF: u64 = cap_right!(0, 0x0000000000020000u64); ++pub const CAP_FSCK: u64 = cap_right!(0, 0x0000000000040000u64); ++pub const CAP_FSTAT: u64 = cap_right!(0, 0x0000000000080000u64); ++pub const CAP_FSTATAT: u64 = CAP_FSTAT | CAP_LOOKUP; ++pub const CAP_FSTATFS: u64 = cap_right!(0, 0x0000000000100000u64); ++pub const CAP_FUTIMES: u64 = cap_right!(0, 0x0000000000200000u64); ++pub const CAP_FUTIMESAT: u64 = CAP_FUTIMES | CAP_LOOKUP; ++// Note: this was named CAP_LINKAT prior to FreeBSD 11.0. ++pub const CAP_LINKAT_TARGET: u64 = CAP_LOOKUP | 0x0000000000400000u64; ++pub const CAP_MKDIRAT: u64 = CAP_LOOKUP | 0x0000000000800000u64; ++pub const CAP_MKFIFOAT: u64 = CAP_LOOKUP | 0x0000000001000000u64; ++pub const CAP_MKNODAT: u64 = CAP_LOOKUP | 0x0000000002000000u64; ++// Note: this was named CAP_RENAMEAT prior to FreeBSD 11.0. ++pub const CAP_RENAMEAT_SOURCE: u64 = CAP_LOOKUP | 0x0000000004000000u64; ++pub const CAP_SYMLINKAT: u64 = CAP_LOOKUP | 0x0000000008000000u64; ++pub const CAP_UNLINKAT: u64 = CAP_LOOKUP | 0x0000000010000000u64; ++pub const CAP_ACCEPT: u64 = cap_right!(0, 0x0000000020000000u64); ++pub const CAP_BIND: u64 = cap_right!(0, 0x0000000040000000u64); ++pub const CAP_CONNECT: u64 = cap_right!(0, 0x0000000080000000u64); ++pub const CAP_GETPEERNAME: u64 = cap_right!(0, 0x0000000100000000u64); ++pub const CAP_GETSOCKNAME: u64 = cap_right!(0, 0x0000000200000000u64); ++pub const CAP_GETSOCKOPT: u64 = cap_right!(0, 0x0000000400000000u64); ++pub const CAP_LISTEN: u64 = cap_right!(0, 0x0000000800000000u64); ++pub const CAP_PEELOFF: u64 = cap_right!(0, 0x0000001000000000u64); ++pub const CAP_RECV: u64 = CAP_READ; ++pub const CAP_SEND: u64 = CAP_WRITE; ++pub const CAP_SETSOCKOPT: u64 = cap_right!(0, 0x0000002000000000u64); ++pub const CAP_SHUTDOWN: u64 = cap_right!(0, 0x0000004000000000u64); ++pub const CAP_BINDAT: u64 = CAP_LOOKUP | 0x0000008000000000u64; ++pub const CAP_CONNECTAT: u64 = CAP_LOOKUP | 0x0000010000000000u64; ++pub const CAP_LINKAT_SOURCE: u64 = CAP_LOOKUP | 0x0000020000000000u64; ++pub const CAP_RENAMEAT_TARGET: u64 = CAP_LOOKUP | 0x0000040000000000u64; ++pub const CAP_SOCK_CLIENT: u64 = CAP_CONNECT ++ | CAP_GETPEERNAME ++ | CAP_GETSOCKNAME ++ | CAP_GETSOCKOPT ++ | CAP_PEELOFF ++ | CAP_RECV ++ | CAP_SEND ++ | CAP_SETSOCKOPT ++ | CAP_SHUTDOWN; ++pub const CAP_SOCK_SERVER: u64 = CAP_ACCEPT ++ | CAP_BIND ++ | CAP_GETPEERNAME ++ | CAP_GETSOCKNAME ++ | CAP_GETSOCKOPT ++ | CAP_LISTEN ++ | CAP_PEELOFF ++ | CAP_RECV ++ | CAP_SEND ++ | CAP_SETSOCKOPT ++ | CAP_SHUTDOWN; ++#[deprecated(since = "0.2.165", note = "Not stable across OS versions")] ++pub const CAP_ALL0: u64 = cap_right!(0, 0x000007FFFFFFFFFFu64); ++#[deprecated(since = "0.2.165", note = "Not stable across OS versions")] ++pub const CAP_UNUSED0_44: u64 = cap_right!(0, 0x0000080000000000u64); ++#[deprecated(since = "0.2.165", note = "Not stable across OS versions")] ++pub const CAP_UNUSED0_57: u64 = cap_right!(0, 0x0100000000000000u64); ++pub const CAP_MAC_GET: u64 = cap_right!(1, 0x0000000000000001u64); ++pub const CAP_MAC_SET: u64 = cap_right!(1, 0x0000000000000002u64); ++pub const CAP_SEM_GETVALUE: u64 = cap_right!(1, 0x0000000000000004u64); ++pub const CAP_SEM_POST: u64 = cap_right!(1, 0x0000000000000008u64); ++pub const CAP_SEM_WAIT: u64 = cap_right!(1, 0x0000000000000010u64); ++pub const CAP_EVENT: u64 = cap_right!(1, 0x0000000000000020u64); ++pub const CAP_KQUEUE_EVENT: u64 = cap_right!(1, 0x0000000000000040u64); ++pub const CAP_IOCTL: u64 = cap_right!(1, 0x0000000000000080u64); ++pub const CAP_TTYHOOK: u64 = cap_right!(1, 0x0000000000000100u64); ++pub const CAP_PDGETPID: u64 = cap_right!(1, 0x0000000000000200u64); ++pub const CAP_PDWAIT: u64 = cap_right!(1, 0x0000000000000400u64); ++pub const CAP_PDKILL: u64 = cap_right!(1, 0x0000000000000800u64); ++pub const CAP_EXTATTR_DELETE: u64 = cap_right!(1, 0x0000000000001000u64); ++pub const CAP_EXTATTR_GET: u64 = cap_right!(1, 0x0000000000002000u64); ++pub const CAP_EXTATTR_LIST: u64 = cap_right!(1, 0x0000000000004000u64); ++pub const CAP_EXTATTR_SET: u64 = cap_right!(1, 0x0000000000008000u64); ++pub const CAP_ACL_CHECK: u64 = cap_right!(1, 0x0000000000010000u64); ++pub const CAP_ACL_DELETE: u64 = cap_right!(1, 0x0000000000020000u64); ++pub const CAP_ACL_GET: u64 = cap_right!(1, 0x0000000000040000u64); ++pub const CAP_ACL_SET: u64 = cap_right!(1, 0x0000000000080000u64); ++pub const CAP_KQUEUE_CHANGE: u64 = cap_right!(1, 0x0000000000100000u64); ++pub const CAP_KQUEUE: u64 = CAP_KQUEUE_EVENT | CAP_KQUEUE_CHANGE; ++#[deprecated(since = "0.2.165", note = "Not stable across OS versions")] ++pub const CAP_ALL1: u64 = cap_right!(1, 0x00000000001FFFFFu64); ++#[deprecated(since = "0.2.165", note = "Not stable across OS versions")] ++pub const CAP_UNUSED1_22: u64 = cap_right!(1, 0x0000000000200000u64); ++#[deprecated(since = "0.2.165", note = "Not stable across OS versions")] ++pub const CAP_UNUSED1_57: u64 = cap_right!(1, 0x0100000000000000u64); ++pub const CAP_FCNTL_GETFL: u32 = 1 << 3; ++pub const CAP_FCNTL_SETFL: u32 = 1 << 4; ++pub const CAP_FCNTL_GETOWN: u32 = 1 << 5; ++pub const CAP_FCNTL_SETOWN: u32 = 1 << 6; ++ ++// sys/devicestat.h ++pub const DEVSTAT_N_TRANS_FLAGS: c_int = 4; ++pub const DEVSTAT_NAME_LEN: c_int = 16; ++ ++// sys/cpuset.h ++cfg_if! { ++ if #[cfg(any(freebsd15, freebsd14))] { ++ pub const CPU_SETSIZE: c_int = 1024; ++ } else { ++ pub const CPU_SETSIZE: c_int = 256; ++ } ++} ++ ++pub const SIGEV_THREAD_ID: c_int = 4; ++ ++pub const EXTATTR_NAMESPACE_EMPTY: c_int = 0; ++pub const EXTATTR_NAMESPACE_USER: c_int = 1; ++pub const EXTATTR_NAMESPACE_SYSTEM: c_int = 2; ++ ++pub const PTHREAD_STACK_MIN: size_t = MINSIGSTKSZ; ++pub const PTHREAD_MUTEX_ADAPTIVE_NP: c_int = 4; ++pub const PTHREAD_MUTEX_STALLED: c_int = 0; ++pub const PTHREAD_MUTEX_ROBUST: c_int = 1; ++pub const SIGSTKSZ: size_t = MINSIGSTKSZ + 32768; ++pub const SF_NODISKIO: c_int = 0x00000001; ++pub const SF_MNOWAIT: c_int = 0x00000002; ++pub const SF_SYNC: c_int = 0x00000004; ++pub const SF_USER_READAHEAD: c_int = 0x00000008; ++pub const SF_NOCACHE: c_int = 0x00000010; ++pub const O_CLOEXEC: c_int = 0x00100000; ++pub const O_DIRECTORY: c_int = 0x00020000; ++pub const O_DSYNC: c_int = 0x01000000; ++pub const O_EMPTY_PATH: c_int = 0x02000000; ++pub const O_EXEC: c_int = 0x00040000; ++pub const O_PATH: c_int = 0x00400000; ++pub const O_RESOLVE_BENEATH: c_int = 0x00800000; ++pub const O_SEARCH: c_int = O_EXEC; ++pub const O_TTY_INIT: c_int = 0x00080000; ++pub const O_VERIFY: c_int = 0x00200000; ++pub const F_GETLK: c_int = 11; ++pub const F_SETLK: c_int = 12; ++pub const F_SETLKW: c_int = 13; ++pub const ENOTCAPABLE: c_int = 93; ++pub const ECAPMODE: c_int = 94; ++pub const ENOTRECOVERABLE: c_int = 95; ++pub const EOWNERDEAD: c_int = 96; ++pub const EINTEGRITY: c_int = 97; ++pub const RLIMIT_NPTS: c_int = 11; ++pub const RLIMIT_SWAP: c_int = 12; ++pub const RLIMIT_KQUEUES: c_int = 13; ++pub const RLIMIT_UMTXP: c_int = 14; ++#[deprecated(since = "0.2.64", note = "Not stable across OS versions")] ++pub const RLIM_NLIMITS: crate::rlim_t = 15; ++pub const RLIM_SAVED_MAX: crate::rlim_t = crate::RLIM_INFINITY; ++pub const RLIM_SAVED_CUR: crate::rlim_t = crate::RLIM_INFINITY; ++ ++pub const CP_USER: c_int = 0; ++pub const CP_NICE: c_int = 1; ++pub const CP_SYS: c_int = 2; ++pub const CP_INTR: c_int = 3; ++pub const CP_IDLE: c_int = 4; ++pub const CPUSTATES: c_int = 5; ++ ++pub const NI_NOFQDN: c_int = 0x00000001; ++pub const NI_NUMERICHOST: c_int = 0x00000002; ++pub const NI_NAMEREQD: c_int = 0x00000004; ++pub const NI_NUMERICSERV: c_int = 0x00000008; ++pub const NI_DGRAM: c_int = 0x00000010; ++pub const NI_NUMERICSCOPE: c_int = 0x00000020; ++ ++pub const XU_NGROUPS: c_int = 16; ++ ++pub const Q_GETQUOTA: c_int = 0x700; ++pub const Q_SETQUOTA: c_int = 0x800; ++ ++pub const MAP_GUARD: c_int = 0x00002000; ++pub const MAP_EXCL: c_int = 0x00004000; ++pub const MAP_PREFAULT_READ: c_int = 0x00040000; ++pub const MAP_ALIGNMENT_SHIFT: c_int = 24; ++pub const MAP_ALIGNMENT_MASK: c_int = 0xff << MAP_ALIGNMENT_SHIFT; ++pub const MAP_ALIGNED_SUPER: c_int = 1 << MAP_ALIGNMENT_SHIFT; ++ ++pub const POSIX_FADV_NORMAL: c_int = 0; ++pub const POSIX_FADV_RANDOM: c_int = 1; ++pub const POSIX_FADV_SEQUENTIAL: c_int = 2; ++pub const POSIX_FADV_WILLNEED: c_int = 3; ++pub const POSIX_FADV_DONTNEED: c_int = 4; ++pub const POSIX_FADV_NOREUSE: c_int = 5; ++ ++pub const POLLINIGNEOF: c_short = 0x2000; ++pub const POLLRDHUP: c_short = 0x4000; ++ ++pub const EVFILT_READ: i16 = -1; ++pub const EVFILT_WRITE: i16 = -2; ++pub const EVFILT_AIO: i16 = -3; ++pub const EVFILT_VNODE: i16 = -4; ++pub const EVFILT_PROC: i16 = -5; ++pub const EVFILT_SIGNAL: i16 = -6; ++pub const EVFILT_TIMER: i16 = -7; ++pub const EVFILT_PROCDESC: i16 = -8; ++pub const EVFILT_FS: i16 = -9; ++pub const EVFILT_LIO: i16 = -10; ++pub const EVFILT_USER: i16 = -11; ++pub const EVFILT_SENDFILE: i16 = -12; ++pub const EVFILT_EMPTY: i16 = -13; ++ ++pub const EV_ADD: u16 = 0x1; ++pub const EV_DELETE: u16 = 0x2; ++pub const EV_ENABLE: u16 = 0x4; ++pub const EV_DISABLE: u16 = 0x8; ++pub const EV_FORCEONESHOT: u16 = 0x100; ++pub const EV_KEEPUDATA: u16 = 0x200; ++ ++pub const EV_ONESHOT: u16 = 0x10; ++pub const EV_CLEAR: u16 = 0x20; ++pub const EV_RECEIPT: u16 = 0x40; ++pub const EV_DISPATCH: u16 = 0x80; ++pub const EV_SYSFLAGS: u16 = 0xf000; ++pub const EV_DROP: u16 = 0x1000; ++pub const EV_FLAG1: u16 = 0x2000; ++pub const EV_FLAG2: u16 = 0x4000; ++ ++pub const EV_EOF: u16 = 0x8000; ++pub const EV_ERROR: u16 = 0x4000; ++ ++pub const NOTE_TRIGGER: u32 = 0x01000000; ++pub const NOTE_FFNOP: u32 = 0x00000000; ++pub const NOTE_FFAND: u32 = 0x40000000; ++pub const NOTE_FFOR: u32 = 0x80000000; ++pub const NOTE_FFCOPY: u32 = 0xc0000000; ++pub const NOTE_FFCTRLMASK: u32 = 0xc0000000; ++pub const NOTE_FFLAGSMASK: u32 = 0x00ffffff; ++pub const NOTE_LOWAT: u32 = 0x00000001; ++pub const NOTE_FILE_POLL: u32 = 0x00000002; ++pub const NOTE_DELETE: u32 = 0x00000001; ++pub const NOTE_WRITE: u32 = 0x00000002; ++pub const NOTE_EXTEND: u32 = 0x00000004; ++pub const NOTE_ATTRIB: u32 = 0x00000008; ++pub const NOTE_LINK: u32 = 0x00000010; ++pub const NOTE_RENAME: u32 = 0x00000020; ++pub const NOTE_REVOKE: u32 = 0x00000040; ++pub const NOTE_OPEN: u32 = 0x00000080; ++pub const NOTE_CLOSE: u32 = 0x00000100; ++pub const NOTE_CLOSE_WRITE: u32 = 0x00000200; ++pub const NOTE_READ: u32 = 0x00000400; ++pub const NOTE_EXIT: u32 = 0x80000000; ++pub const NOTE_FORK: u32 = 0x40000000; ++pub const NOTE_EXEC: u32 = 0x20000000; ++pub const NOTE_PDATAMASK: u32 = 0x000fffff; ++pub const NOTE_PCTRLMASK: u32 = 0xf0000000; ++pub const NOTE_TRACK: u32 = 0x00000001; ++pub const NOTE_TRACKERR: u32 = 0x00000002; ++pub const NOTE_CHILD: u32 = 0x00000004; ++pub const NOTE_SECONDS: u32 = 0x00000001; ++pub const NOTE_MSECONDS: u32 = 0x00000002; ++pub const NOTE_USECONDS: u32 = 0x00000004; ++pub const NOTE_NSECONDS: u32 = 0x00000008; ++pub const NOTE_ABSTIME: u32 = 0x00000010; ++ ++pub const MADV_PROTECT: c_int = 10; ++ ++#[doc(hidden)] ++#[deprecated( ++ since = "0.2.72", ++ note = "CTL_UNSPEC is deprecated. Use CTL_SYSCTL instead" ++)] ++pub const CTL_UNSPEC: c_int = 0; ++pub const CTL_SYSCTL: c_int = 0; ++pub const CTL_KERN: c_int = 1; ++pub const CTL_VM: c_int = 2; ++pub const CTL_VFS: c_int = 3; ++pub const CTL_NET: c_int = 4; ++pub const CTL_DEBUG: c_int = 5; ++pub const CTL_HW: c_int = 6; ++pub const CTL_MACHDEP: c_int = 7; ++pub const CTL_USER: c_int = 8; ++pub const CTL_P1003_1B: c_int = 9; ++ ++// sys/sysctl.h ++pub const CTL_MAXNAME: c_int = 24; ++ ++pub const CTLTYPE: c_int = 0xf; ++pub const CTLTYPE_NODE: c_int = 1; ++pub const CTLTYPE_INT: c_int = 2; ++pub const CTLTYPE_STRING: c_int = 3; ++pub const CTLTYPE_S64: c_int = 4; ++pub const CTLTYPE_OPAQUE: c_int = 5; ++pub const CTLTYPE_STRUCT: c_int = CTLTYPE_OPAQUE; ++pub const CTLTYPE_UINT: c_int = 6; ++pub const CTLTYPE_LONG: c_int = 7; ++pub const CTLTYPE_ULONG: c_int = 8; ++pub const CTLTYPE_U64: c_int = 9; ++pub const CTLTYPE_U8: c_int = 0xa; ++pub const CTLTYPE_U16: c_int = 0xb; ++pub const CTLTYPE_S8: c_int = 0xc; ++pub const CTLTYPE_S16: c_int = 0xd; ++pub const CTLTYPE_S32: c_int = 0xe; ++pub const CTLTYPE_U32: c_int = 0xf; ++ ++pub const CTLFLAG_RD: c_int = 0x80000000; ++pub const CTLFLAG_WR: c_int = 0x40000000; ++pub const CTLFLAG_RW: c_int = CTLFLAG_RD | CTLFLAG_WR; ++pub const CTLFLAG_DORMANT: c_int = 0x20000000; ++pub const CTLFLAG_ANYBODY: c_int = 0x10000000; ++pub const CTLFLAG_SECURE: c_int = 0x08000000; ++pub const CTLFLAG_PRISON: c_int = 0x04000000; ++pub const CTLFLAG_DYN: c_int = 0x02000000; ++pub const CTLFLAG_SKIP: c_int = 0x01000000; ++pub const CTLMASK_SECURE: c_int = 0x00F00000; ++pub const CTLFLAG_TUN: c_int = 0x00080000; ++pub const CTLFLAG_RDTUN: c_int = CTLFLAG_RD | CTLFLAG_TUN; ++pub const CTLFLAG_RWTUN: c_int = CTLFLAG_RW | CTLFLAG_TUN; ++pub const CTLFLAG_MPSAFE: c_int = 0x00040000; ++pub const CTLFLAG_VNET: c_int = 0x00020000; ++pub const CTLFLAG_DYING: c_int = 0x00010000; ++pub const CTLFLAG_CAPRD: c_int = 0x00008000; ++pub const CTLFLAG_CAPWR: c_int = 0x00004000; ++pub const CTLFLAG_STATS: c_int = 0x00002000; ++pub const CTLFLAG_NOFETCH: c_int = 0x00001000; ++pub const CTLFLAG_CAPRW: c_int = CTLFLAG_CAPRD | CTLFLAG_CAPWR; ++pub const CTLFLAG_NEEDGIANT: c_int = 0x00000800; ++ ++pub const CTLSHIFT_SECURE: c_int = 20; ++pub const CTLFLAG_SECURE1: c_int = CTLFLAG_SECURE | (0 << CTLSHIFT_SECURE); ++pub const CTLFLAG_SECURE2: c_int = CTLFLAG_SECURE | (1 << CTLSHIFT_SECURE); ++pub const CTLFLAG_SECURE3: c_int = CTLFLAG_SECURE | (2 << CTLSHIFT_SECURE); ++ ++pub const OID_AUTO: c_int = -1; ++ ++pub const CTL_SYSCTL_DEBUG: c_int = 0; ++pub const CTL_SYSCTL_NAME: c_int = 1; ++pub const CTL_SYSCTL_NEXT: c_int = 2; ++pub const CTL_SYSCTL_NAME2OID: c_int = 3; ++pub const CTL_SYSCTL_OIDFMT: c_int = 4; ++pub const CTL_SYSCTL_OIDDESCR: c_int = 5; ++pub const CTL_SYSCTL_OIDLABEL: c_int = 6; ++pub const CTL_SYSCTL_NEXTNOSKIP: c_int = 7; ++ ++pub const KERN_OSTYPE: c_int = 1; ++pub const KERN_OSRELEASE: c_int = 2; ++pub const KERN_OSREV: c_int = 3; ++pub const KERN_VERSION: c_int = 4; ++pub const KERN_MAXVNODES: c_int = 5; ++pub const KERN_MAXPROC: c_int = 6; ++pub const KERN_MAXFILES: c_int = 7; ++pub const KERN_ARGMAX: c_int = 8; ++pub const KERN_SECURELVL: c_int = 9; ++pub const KERN_HOSTNAME: c_int = 10; ++pub const KERN_HOSTID: c_int = 11; ++pub const KERN_CLOCKRATE: c_int = 12; ++pub const KERN_VNODE: c_int = 13; ++pub const KERN_PROC: c_int = 14; ++pub const KERN_FILE: c_int = 15; ++pub const KERN_PROF: c_int = 16; ++pub const KERN_POSIX1: c_int = 17; ++pub const KERN_NGROUPS: c_int = 18; ++pub const KERN_JOB_CONTROL: c_int = 19; ++pub const KERN_SAVED_IDS: c_int = 20; ++pub const KERN_BOOTTIME: c_int = 21; ++pub const KERN_NISDOMAINNAME: c_int = 22; ++pub const KERN_UPDATEINTERVAL: c_int = 23; ++pub const KERN_OSRELDATE: c_int = 24; ++pub const KERN_NTP_PLL: c_int = 25; ++pub const KERN_BOOTFILE: c_int = 26; ++pub const KERN_MAXFILESPERPROC: c_int = 27; ++pub const KERN_MAXPROCPERUID: c_int = 28; ++pub const KERN_DUMPDEV: c_int = 29; ++pub const KERN_IPC: c_int = 30; ++pub const KERN_DUMMY: c_int = 31; ++pub const KERN_PS_STRINGS: c_int = 32; ++pub const KERN_USRSTACK: c_int = 33; ++pub const KERN_LOGSIGEXIT: c_int = 34; ++pub const KERN_IOV_MAX: c_int = 35; ++pub const KERN_HOSTUUID: c_int = 36; ++pub const KERN_ARND: c_int = 37; ++pub const KERN_MAXPHYS: c_int = 38; ++ ++pub const KERN_PROC_ALL: c_int = 0; ++pub const KERN_PROC_PID: c_int = 1; ++pub const KERN_PROC_PGRP: c_int = 2; ++pub const KERN_PROC_SESSION: c_int = 3; ++pub const KERN_PROC_TTY: c_int = 4; ++pub const KERN_PROC_UID: c_int = 5; ++pub const KERN_PROC_RUID: c_int = 6; ++pub const KERN_PROC_ARGS: c_int = 7; ++pub const KERN_PROC_PROC: c_int = 8; ++pub const KERN_PROC_SV_NAME: c_int = 9; ++pub const KERN_PROC_RGID: c_int = 10; ++pub const KERN_PROC_GID: c_int = 11; ++pub const KERN_PROC_PATHNAME: c_int = 12; ++pub const KERN_PROC_OVMMAP: c_int = 13; ++pub const KERN_PROC_OFILEDESC: c_int = 14; ++pub const KERN_PROC_KSTACK: c_int = 15; ++pub const KERN_PROC_INC_THREAD: c_int = 0x10; ++pub const KERN_PROC_VMMAP: c_int = 32; ++pub const KERN_PROC_FILEDESC: c_int = 33; ++pub const KERN_PROC_GROUPS: c_int = 34; ++pub const KERN_PROC_ENV: c_int = 35; ++pub const KERN_PROC_AUXV: c_int = 36; ++pub const KERN_PROC_RLIMIT: c_int = 37; ++pub const KERN_PROC_PS_STRINGS: c_int = 38; ++pub const KERN_PROC_UMASK: c_int = 39; ++pub const KERN_PROC_OSREL: c_int = 40; ++pub const KERN_PROC_SIGTRAMP: c_int = 41; ++pub const KERN_PROC_CWD: c_int = 42; ++pub const KERN_PROC_NFDS: c_int = 43; ++pub const KERN_PROC_SIGFASTBLK: c_int = 44; ++ ++pub const KIPC_MAXSOCKBUF: c_int = 1; ++pub const KIPC_SOCKBUF_WASTE: c_int = 2; ++pub const KIPC_SOMAXCONN: c_int = 3; ++pub const KIPC_MAX_LINKHDR: c_int = 4; ++pub const KIPC_MAX_PROTOHDR: c_int = 5; ++pub const KIPC_MAX_HDR: c_int = 6; ++pub const KIPC_MAX_DATALEN: c_int = 7; ++ ++pub const HW_MACHINE: c_int = 1; ++pub const HW_MODEL: c_int = 2; ++pub const HW_NCPU: c_int = 3; ++pub const HW_BYTEORDER: c_int = 4; ++pub const HW_PHYSMEM: c_int = 5; ++pub const HW_USERMEM: c_int = 6; ++pub const HW_PAGESIZE: c_int = 7; ++pub const HW_DISKNAMES: c_int = 8; ++pub const HW_DISKSTATS: c_int = 9; ++pub const HW_FLOATINGPT: c_int = 10; ++pub const HW_MACHINE_ARCH: c_int = 11; ++pub const HW_REALMEM: c_int = 12; ++ ++pub const USER_CS_PATH: c_int = 1; ++pub const USER_BC_BASE_MAX: c_int = 2; ++pub const USER_BC_DIM_MAX: c_int = 3; ++pub const USER_BC_SCALE_MAX: c_int = 4; ++pub const USER_BC_STRING_MAX: c_int = 5; ++pub const USER_COLL_WEIGHTS_MAX: c_int = 6; ++pub const USER_EXPR_NEST_MAX: c_int = 7; ++pub const USER_LINE_MAX: c_int = 8; ++pub const USER_RE_DUP_MAX: c_int = 9; ++pub const USER_POSIX2_VERSION: c_int = 10; ++pub const USER_POSIX2_C_BIND: c_int = 11; ++pub const USER_POSIX2_C_DEV: c_int = 12; ++pub const USER_POSIX2_CHAR_TERM: c_int = 13; ++pub const USER_POSIX2_FORT_DEV: c_int = 14; ++pub const USER_POSIX2_FORT_RUN: c_int = 15; ++pub const USER_POSIX2_LOCALEDEF: c_int = 16; ++pub const USER_POSIX2_SW_DEV: c_int = 17; ++pub const USER_POSIX2_UPE: c_int = 18; ++pub const USER_STREAM_MAX: c_int = 19; ++pub const USER_TZNAME_MAX: c_int = 20; ++pub const USER_LOCALBASE: c_int = 21; ++ ++pub const CTL_P1003_1B_ASYNCHRONOUS_IO: c_int = 1; ++pub const CTL_P1003_1B_MAPPED_FILES: c_int = 2; ++pub const CTL_P1003_1B_MEMLOCK: c_int = 3; ++pub const CTL_P1003_1B_MEMLOCK_RANGE: c_int = 4; ++pub const CTL_P1003_1B_MEMORY_PROTECTION: c_int = 5; ++pub const CTL_P1003_1B_MESSAGE_PASSING: c_int = 6; ++pub const CTL_P1003_1B_PRIORITIZED_IO: c_int = 7; ++pub const CTL_P1003_1B_PRIORITY_SCHEDULING: c_int = 8; ++pub const CTL_P1003_1B_REALTIME_SIGNALS: c_int = 9; ++pub const CTL_P1003_1B_SEMAPHORES: c_int = 10; ++pub const CTL_P1003_1B_FSYNC: c_int = 11; ++pub const CTL_P1003_1B_SHARED_MEMORY_OBJECTS: c_int = 12; ++pub const CTL_P1003_1B_SYNCHRONIZED_IO: c_int = 13; ++pub const CTL_P1003_1B_TIMERS: c_int = 14; ++pub const CTL_P1003_1B_AIO_LISTIO_MAX: c_int = 15; ++pub const CTL_P1003_1B_AIO_MAX: c_int = 16; ++pub const CTL_P1003_1B_AIO_PRIO_DELTA_MAX: c_int = 17; ++pub const CTL_P1003_1B_DELAYTIMER_MAX: c_int = 18; ++pub const CTL_P1003_1B_MQ_OPEN_MAX: c_int = 19; ++pub const CTL_P1003_1B_PAGESIZE: c_int = 20; ++pub const CTL_P1003_1B_RTSIG_MAX: c_int = 21; ++pub const CTL_P1003_1B_SEM_NSEMS_MAX: c_int = 22; ++pub const CTL_P1003_1B_SEM_VALUE_MAX: c_int = 23; ++pub const CTL_P1003_1B_SIGQUEUE_MAX: c_int = 24; ++pub const CTL_P1003_1B_TIMER_MAX: c_int = 25; ++ ++pub const TIOCGPTN: c_ulong = 0x4004740f; ++pub const TIOCPTMASTER: c_ulong = 0x2000741c; ++pub const TIOCSIG: c_ulong = 0x2004745f; ++pub const TIOCM_DCD: c_int = 0x40; ++pub const H4DISC: c_int = 0x7; ++ ++pub const VM_TOTAL: c_int = 1; ++ ++cfg_if! { ++ if #[cfg(target_pointer_width = "64")] { ++ pub const BIOCSETFNR: c_ulong = 0x80104282; ++ } else { ++ pub const BIOCSETFNR: c_ulong = 0x80084282; ++ } ++} ++ ++cfg_if! { ++ if #[cfg(target_pointer_width = "64")] { ++ pub const FIODGNAME: c_ulong = 0x80106678; ++ } else { ++ pub const FIODGNAME: c_ulong = 0x80086678; ++ } ++} ++ ++pub const FIONWRITE: c_ulong = 0x40046677; ++pub const FIONSPACE: c_ulong = 0x40046676; ++pub const FIOSEEKDATA: c_ulong = 0xc0086661; ++pub const FIOSEEKHOLE: c_ulong = 0xc0086662; ++pub const FIOSSHMLPGCNF: c_ulong = 0x80306664; ++ ++pub const JAIL_API_VERSION: u32 = 2; ++pub const JAIL_CREATE: c_int = 0x01; ++pub const JAIL_UPDATE: c_int = 0x02; ++pub const JAIL_ATTACH: c_int = 0x04; ++pub const JAIL_DYING: c_int = 0x08; ++pub const JAIL_SET_MASK: c_int = 0x0f; ++pub const JAIL_GET_MASK: c_int = 0x08; ++pub const JAIL_SYS_DISABLE: c_int = 0; ++pub const JAIL_SYS_NEW: c_int = 1; ++pub const JAIL_SYS_INHERIT: c_int = 2; ++ ++pub const MNT_ACLS: c_int = 0x08000000; ++pub const MNT_BYFSID: c_int = 0x08000000; ++pub const MNT_GJOURNAL: c_int = 0x02000000; ++pub const MNT_MULTILABEL: c_int = 0x04000000; ++pub const MNT_NFS4ACLS: c_int = 0x00000010; ++pub const MNT_SNAPSHOT: c_int = 0x01000000; ++pub const MNT_UNION: c_int = 0x00000020; ++pub const MNT_NONBUSY: c_int = 0x04000000; ++ ++pub const SCM_BINTIME: c_int = 0x04; ++pub const SCM_REALTIME: c_int = 0x05; ++pub const SCM_MONOTONIC: c_int = 0x06; ++pub const SCM_TIME_INFO: c_int = 0x07; ++pub const SCM_CREDS2: c_int = 0x08; ++ ++pub const SO_BINTIME: c_int = 0x2000; ++pub const SO_NO_OFFLOAD: c_int = 0x4000; ++pub const SO_NO_DDP: c_int = 0x8000; ++pub const SO_REUSEPORT_LB: c_int = 0x10000; ++pub const SO_LABEL: c_int = 0x1009; ++pub const SO_PEERLABEL: c_int = 0x1010; ++pub const SO_LISTENQLIMIT: c_int = 0x1011; ++pub const SO_LISTENQLEN: c_int = 0x1012; ++pub const SO_LISTENINCQLEN: c_int = 0x1013; ++pub const SO_SETFIB: c_int = 0x1014; ++pub const SO_USER_COOKIE: c_int = 0x1015; ++pub const SO_PROTOCOL: c_int = 0x1016; ++pub const SO_PROTOTYPE: c_int = SO_PROTOCOL; ++pub const SO_TS_CLOCK: c_int = 0x1017; ++pub const SO_DOMAIN: c_int = 0x1019; ++pub const SO_VENDOR: c_int = 0x80000000; ++ ++pub const SO_TS_REALTIME_MICRO: c_int = 0; ++pub const SO_TS_BINTIME: c_int = 1; ++pub const SO_TS_REALTIME: c_int = 2; ++pub const SO_TS_MONOTONIC: c_int = 3; ++pub const SO_TS_DEFAULT: c_int = SO_TS_REALTIME_MICRO; ++pub const SO_TS_CLOCK_MAX: c_int = SO_TS_MONOTONIC; ++ ++pub const LOCAL_CREDS: c_int = 2; ++pub const LOCAL_CREDS_PERSISTENT: c_int = 3; ++pub const LOCAL_CONNWAIT: c_int = 4; ++pub const LOCAL_VENDOR: c_int = SO_VENDOR; ++ ++pub const PL_EVENT_NONE: c_int = 0; ++pub const PL_EVENT_SIGNAL: c_int = 1; ++pub const PL_FLAG_SA: c_int = 0x01; ++pub const PL_FLAG_BOUND: c_int = 0x02; ++pub const PL_FLAG_SCE: c_int = 0x04; ++pub const PL_FLAG_SCX: c_int = 0x08; ++pub const PL_FLAG_EXEC: c_int = 0x10; ++pub const PL_FLAG_SI: c_int = 0x20; ++pub const PL_FLAG_FORKED: c_int = 0x40; ++pub const PL_FLAG_CHILD: c_int = 0x80; ++pub const PL_FLAG_BORN: c_int = 0x100; ++pub const PL_FLAG_EXITED: c_int = 0x200; ++pub const PL_FLAG_VFORKED: c_int = 0x400; ++pub const PL_FLAG_VFORK_DONE: c_int = 0x800; ++ ++pub const PT_LWPINFO: c_int = 13; ++pub const PT_GETNUMLWPS: c_int = 14; ++pub const PT_GETLWPLIST: c_int = 15; ++pub const PT_CLEARSTEP: c_int = 16; ++pub const PT_SETSTEP: c_int = 17; ++pub const PT_SUSPEND: c_int = 18; ++pub const PT_RESUME: c_int = 19; ++pub const PT_TO_SCE: c_int = 20; ++pub const PT_TO_SCX: c_int = 21; ++pub const PT_SYSCALL: c_int = 22; ++pub const PT_FOLLOW_FORK: c_int = 23; ++pub const PT_LWP_EVENTS: c_int = 24; ++pub const PT_GET_EVENT_MASK: c_int = 25; ++pub const PT_SET_EVENT_MASK: c_int = 26; ++pub const PT_GET_SC_ARGS: c_int = 27; ++pub const PT_GET_SC_RET: c_int = 28; ++pub const PT_COREDUMP: c_int = 29; ++pub const PT_GETREGS: c_int = 33; ++pub const PT_SETREGS: c_int = 34; ++pub const PT_GETFPREGS: c_int = 35; ++pub const PT_SETFPREGS: c_int = 36; ++pub const PT_GETDBREGS: c_int = 37; ++pub const PT_SETDBREGS: c_int = 38; ++pub const PT_VM_TIMESTAMP: c_int = 40; ++pub const PT_VM_ENTRY: c_int = 41; ++pub const PT_GETREGSET: c_int = 42; ++pub const PT_SETREGSET: c_int = 43; ++pub const PT_SC_REMOTE: c_int = 44; ++pub const PT_FIRSTMACH: c_int = 64; ++ ++pub const PTRACE_EXEC: c_int = 0x0001; ++pub const PTRACE_SCE: c_int = 0x0002; ++pub const PTRACE_SCX: c_int = 0x0004; ++pub const PTRACE_SYSCALL: c_int = PTRACE_SCE | PTRACE_SCX; ++pub const PTRACE_FORK: c_int = 0x0008; ++pub const PTRACE_LWP: c_int = 0x0010; ++pub const PTRACE_VFORK: c_int = 0x0020; ++pub const PTRACE_DEFAULT: c_int = PTRACE_EXEC; ++ ++pub const PC_COMPRESS: u32 = 0x00000001; ++pub const PC_ALL: u32 = 0x00000002; ++ ++pub const PROC_SPROTECT: c_int = 1; ++pub const PROC_REAP_ACQUIRE: c_int = 2; ++pub const PROC_REAP_RELEASE: c_int = 3; ++pub const PROC_REAP_STATUS: c_int = 4; ++pub const PROC_REAP_GETPIDS: c_int = 5; ++pub const PROC_REAP_KILL: c_int = 6; ++pub const PROC_TRACE_CTL: c_int = 7; ++pub const PROC_TRACE_STATUS: c_int = 8; ++pub const PROC_TRAPCAP_CTL: c_int = 9; ++pub const PROC_TRAPCAP_STATUS: c_int = 10; ++pub const PROC_PDEATHSIG_CTL: c_int = 11; ++pub const PROC_PDEATHSIG_STATUS: c_int = 12; ++pub const PROC_ASLR_CTL: c_int = 13; ++pub const PROC_ASLR_STATUS: c_int = 14; ++pub const PROC_PROTMAX_CTL: c_int = 15; ++pub const PROC_PROTMAX_STATUS: c_int = 16; ++pub const PROC_STACKGAP_CTL: c_int = 17; ++pub const PROC_STACKGAP_STATUS: c_int = 18; ++pub const PROC_NO_NEW_PRIVS_CTL: c_int = 19; ++pub const PROC_NO_NEW_PRIVS_STATUS: c_int = 20; ++pub const PROC_WXMAP_CTL: c_int = 21; ++pub const PROC_WXMAP_STATUS: c_int = 22; ++pub const PROC_PROCCTL_MD_MIN: c_int = 0x10000000; ++ ++pub const PPROT_SET: c_int = 1; ++pub const PPROT_CLEAR: c_int = 2; ++pub const PPROT_DESCEND: c_int = 0x10; ++pub const PPROT_INHERIT: c_int = 0x20; ++ ++pub const PROC_TRACE_CTL_ENABLE: c_int = 1; ++pub const PROC_TRACE_CTL_DISABLE: c_int = 2; ++pub const PROC_TRACE_CTL_DISABLE_EXEC: c_int = 3; ++ ++pub const PROC_TRAPCAP_CTL_ENABLE: c_int = 1; ++pub const PROC_TRAPCAP_CTL_DISABLE: c_int = 2; ++ ++pub const PROC_ASLR_FORCE_ENABLE: c_int = 1; ++pub const PROC_ASLR_FORCE_DISABLE: c_int = 2; ++pub const PROC_ASLR_NOFORCE: c_int = 3; ++pub const PROC_ASLR_ACTIVE: c_int = 0x80000000; ++ ++pub const PROC_PROTMAX_FORCE_ENABLE: c_int = 1; ++pub const PROC_PROTMAX_FORCE_DISABLE: c_int = 2; ++pub const PROC_PROTMAX_NOFORCE: c_int = 3; ++pub const PROC_PROTMAX_ACTIVE: c_int = 0x80000000; ++ ++pub const PROC_STACKGAP_ENABLE: c_int = 0x0001; ++pub const PROC_STACKGAP_DISABLE: c_int = 0x0002; ++pub const PROC_STACKGAP_ENABLE_EXEC: c_int = 0x0004; ++pub const PROC_STACKGAP_DISABLE_EXEC: c_int = 0x0008; ++ ++pub const PROC_NO_NEW_PRIVS_ENABLE: c_int = 1; ++pub const PROC_NO_NEW_PRIVS_DISABLE: c_int = 2; ++ ++pub const PROC_WX_MAPPINGS_PERMIT: c_int = 0x0001; ++pub const PROC_WX_MAPPINGS_DISALLOW_EXEC: c_int = 0x0002; ++pub const PROC_WXORX_ENFORCE: c_int = 0x80000000; ++ ++pub const AF_SLOW: c_int = 33; ++pub const AF_SCLUSTER: c_int = 34; ++pub const AF_ARP: c_int = 35; ++pub const AF_BLUETOOTH: c_int = 36; ++pub const AF_IEEE80211: c_int = 37; ++pub const AF_INET_SDP: c_int = 40; ++pub const AF_INET6_SDP: c_int = 42; ++ ++// sys/net/if.h ++pub const IF_MAXUNIT: c_int = 0x7fff; ++/// (n) interface is up ++pub const IFF_UP: c_int = 0x1; ++/// (i) broadcast address valid ++pub const IFF_BROADCAST: c_int = 0x2; ++/// (n) turn on debugging ++pub const IFF_DEBUG: c_int = 0x4; ++/// (i) is a loopback net ++pub const IFF_LOOPBACK: c_int = 0x8; ++/// (i) is a point-to-point link ++pub const IFF_POINTOPOINT: c_int = 0x10; ++/// (i) calls if_input in net epoch ++#[deprecated(since = "0.2.149", note = "Removed in FreeBSD 14")] ++pub const IFF_KNOWSEPOCH: c_int = 0x20; ++/// (d) resources allocated ++pub const IFF_RUNNING: c_int = 0x40; ++#[doc(hidden)] ++#[deprecated( ++ since = "0.2.54", ++ note = "IFF_DRV_RUNNING is deprecated. Use the portable IFF_RUNNING instead" ++)] ++/// (d) resources allocate ++pub const IFF_DRV_RUNNING: c_int = 0x40; ++/// (n) no address resolution protocol ++pub const IFF_NOARP: c_int = 0x80; ++/// (n) receive all packets ++pub const IFF_PROMISC: c_int = 0x100; ++/// (n) receive all multicast packets ++pub const IFF_ALLMULTI: c_int = 0x200; ++/// (d) tx hardware queue is full ++pub const IFF_OACTIVE: c_int = 0x400; ++#[doc(hidden)] ++#[deprecated(since = "0.2.54", note = "Use the portable `IFF_OACTIVE` instead")] ++/// (d) tx hardware queue is full ++pub const IFF_DRV_OACTIVE: c_int = 0x400; ++/// (i) can't hear own transmissions ++pub const IFF_SIMPLEX: c_int = 0x800; ++/// per link layer defined bit ++pub const IFF_LINK0: c_int = 0x1000; ++/// per link layer defined bit ++pub const IFF_LINK1: c_int = 0x2000; ++/// per link layer defined bit ++pub const IFF_LINK2: c_int = 0x4000; ++/// use alternate physical connection ++pub const IFF_ALTPHYS: c_int = IFF_LINK2; ++/// (i) supports multicast ++pub const IFF_MULTICAST: c_int = 0x8000; ++/// (i) unconfigurable using ioctl(2) ++pub const IFF_CANTCONFIG: c_int = 0x10000; ++/// (n) user-requested promisc mode ++pub const IFF_PPROMISC: c_int = 0x20000; ++/// (n) user-requested monitor mode ++pub const IFF_MONITOR: c_int = 0x40000; ++/// (n) static ARP ++pub const IFF_STATICARP: c_int = 0x80000; ++/// (n) interface is winding down ++pub const IFF_DYING: c_int = 0x200000; ++/// (n) interface is being renamed ++pub const IFF_RENAMING: c_int = 0x400000; ++/// interface is not part of any groups ++#[deprecated(since = "0.2.149", note = "Removed in FreeBSD 14")] ++pub const IFF_NOGROUP: c_int = 0x800000; ++ ++/// link invalid/unknown ++pub const LINK_STATE_UNKNOWN: c_int = 0; ++/// link is down ++pub const LINK_STATE_DOWN: c_int = 1; ++/// link is up ++pub const LINK_STATE_UP: c_int = 2; ++ ++/// can offload checksum on RX ++pub const IFCAP_RXCSUM: c_int = 0x00001; ++/// can offload checksum on TX ++pub const IFCAP_TXCSUM: c_int = 0x00002; ++/// can be a network console ++pub const IFCAP_NETCONS: c_int = 0x00004; ++/// VLAN-compatible MTU ++pub const IFCAP_VLAN_MTU: c_int = 0x00008; ++/// hardware VLAN tag support ++pub const IFCAP_VLAN_HWTAGGING: c_int = 0x00010; ++/// 9000 byte MTU supported ++pub const IFCAP_JUMBO_MTU: c_int = 0x00020; ++/// driver supports polling ++pub const IFCAP_POLLING: c_int = 0x00040; ++/// can do IFCAP_HWCSUM on VLANs ++pub const IFCAP_VLAN_HWCSUM: c_int = 0x00080; ++/// can do TCP Segmentation Offload ++pub const IFCAP_TSO4: c_int = 0x00100; ++/// can do TCP6 Segmentation Offload ++pub const IFCAP_TSO6: c_int = 0x00200; ++/// can do Large Receive Offload ++pub const IFCAP_LRO: c_int = 0x00400; ++/// wake on any unicast frame ++pub const IFCAP_WOL_UCAST: c_int = 0x00800; ++/// wake on any multicast frame ++pub const IFCAP_WOL_MCAST: c_int = 0x01000; ++/// wake on any Magic Packet ++pub const IFCAP_WOL_MAGIC: c_int = 0x02000; ++/// interface can offload TCP ++pub const IFCAP_TOE4: c_int = 0x04000; ++/// interface can offload TCP6 ++pub const IFCAP_TOE6: c_int = 0x08000; ++/// interface hw can filter vlan tag ++pub const IFCAP_VLAN_HWFILTER: c_int = 0x10000; ++/// can do SIOCGIFCAPNV/SIOCSIFCAPNV ++pub const IFCAP_NV: c_int = 0x20000; ++/// can do IFCAP_TSO on VLANs ++pub const IFCAP_VLAN_HWTSO: c_int = 0x40000; ++/// the runtime link state is dynamic ++pub const IFCAP_LINKSTATE: c_int = 0x80000; ++/// netmap mode supported/enabled ++pub const IFCAP_NETMAP: c_int = 0x100000; ++/// can offload checksum on IPv6 RX ++pub const IFCAP_RXCSUM_IPV6: c_int = 0x200000; ++/// can offload checksum on IPv6 TX ++pub const IFCAP_TXCSUM_IPV6: c_int = 0x400000; ++/// manages counters internally ++pub const IFCAP_HWSTATS: c_int = 0x800000; ++/// hardware supports TX rate limiting ++pub const IFCAP_TXRTLMT: c_int = 0x1000000; ++/// hardware rx timestamping ++pub const IFCAP_HWRXTSTMP: c_int = 0x2000000; ++/// understands M_EXTPG mbufs ++pub const IFCAP_MEXTPG: c_int = 0x4000000; ++/// can do TLS encryption and segmentation for TCP ++pub const IFCAP_TXTLS4: c_int = 0x8000000; ++/// can do TLS encryption and segmentation for TCP6 ++pub const IFCAP_TXTLS6: c_int = 0x10000000; ++/// can do IFCAN_HWCSUM on VXLANs ++pub const IFCAP_VXLAN_HWCSUM: c_int = 0x20000000; ++/// can do IFCAP_TSO on VXLANs ++pub const IFCAP_VXLAN_HWTSO: c_int = 0x40000000; ++/// can do TLS with rate limiting ++pub const IFCAP_TXTLS_RTLMT: c_int = 0x80000000; ++ ++pub const IFCAP_HWCSUM_IPV6: c_int = IFCAP_RXCSUM_IPV6 | IFCAP_TXCSUM_IPV6; ++pub const IFCAP_HWCSUM: c_int = IFCAP_RXCSUM | IFCAP_TXCSUM; ++pub const IFCAP_TSO: c_int = IFCAP_TSO4 | IFCAP_TSO6; ++pub const IFCAP_WOL: c_int = IFCAP_WOL_UCAST | IFCAP_WOL_MCAST | IFCAP_WOL_MAGIC; ++pub const IFCAP_TOE: c_int = IFCAP_TOE4 | IFCAP_TOE6; ++pub const IFCAP_TXTLS: c_int = IFCAP_TXTLS4 | IFCAP_TXTLS6; ++pub const IFCAP_CANTCHANGE: c_int = IFCAP_NETMAP | IFCAP_NV; ++ ++pub const IFQ_MAXLEN: c_int = 50; ++pub const IFNET_SLOWHZ: c_int = 1; ++ ++pub const IFAN_ARRIVAL: c_int = 0; ++pub const IFAN_DEPARTURE: c_int = 1; ++ ++pub const IFSTATMAX: c_int = 800; ++ ++pub const RSS_FUNC_NONE: c_int = 0; ++pub const RSS_FUNC_PRIVATE: c_int = 1; ++pub const RSS_FUNC_TOEPLITZ: c_int = 2; ++ ++pub const RSS_TYPE_IPV4: c_int = 0x00000001; ++pub const RSS_TYPE_TCP_IPV4: c_int = 0x00000002; ++pub const RSS_TYPE_IPV6: c_int = 0x00000004; ++pub const RSS_TYPE_IPV6_EX: c_int = 0x00000008; ++pub const RSS_TYPE_TCP_IPV6: c_int = 0x00000010; ++pub const RSS_TYPE_TCP_IPV6_EX: c_int = 0x00000020; ++pub const RSS_TYPE_UDP_IPV4: c_int = 0x00000040; ++pub const RSS_TYPE_UDP_IPV6: c_int = 0x00000080; ++pub const RSS_TYPE_UDP_IPV6_EX: c_int = 0x00000100; ++pub const RSS_KEYLEN: c_int = 128; ++ ++pub const IFNET_PCP_NONE: c_int = 0xff; ++pub const IFDR_MSG_SIZE: c_int = 64; ++pub const IFDR_REASON_MSG: c_int = 1; ++pub const IFDR_REASON_VENDOR: c_int = 2; ++ ++// sys/net/if_mib.h ++ ++/// non-interface-specific ++pub const IFMIB_SYSTEM: c_int = 1; ++/// per-interface data table ++pub const IFMIB_IFDATA: c_int = 2; ++ ++/// generic stats for all kinds of ifaces ++pub const IFDATA_GENERAL: c_int = 1; ++/// specific to the type of interface ++pub const IFDATA_LINKSPECIFIC: c_int = 2; ++/// driver name and unit ++pub const IFDATA_DRIVERNAME: c_int = 3; ++ ++/// number of interfaces configured ++pub const IFMIB_IFCOUNT: c_int = 1; ++ ++/// functions not specific to a type of iface ++pub const NETLINK_GENERIC: c_int = 0; ++ ++pub const DOT3COMPLIANCE_STATS: c_int = 1; ++pub const DOT3COMPLIANCE_COLLS: c_int = 2; ++ ++pub const dot3ChipSetAMD7990: c_int = 1; ++pub const dot3ChipSetAMD79900: c_int = 2; ++pub const dot3ChipSetAMD79C940: c_int = 3; ++ ++pub const dot3ChipSetIntel82586: c_int = 1; ++pub const dot3ChipSetIntel82596: c_int = 2; ++pub const dot3ChipSetIntel82557: c_int = 3; ++ ++pub const dot3ChipSetNational8390: c_int = 1; ++pub const dot3ChipSetNationalSonic: c_int = 2; ++ ++pub const dot3ChipSetFujitsu86950: c_int = 1; ++ ++pub const dot3ChipSetDigitalDC21040: c_int = 1; ++pub const dot3ChipSetDigitalDC21140: c_int = 2; ++pub const dot3ChipSetDigitalDC21041: c_int = 3; ++pub const dot3ChipSetDigitalDC21140A: c_int = 4; ++pub const dot3ChipSetDigitalDC21142: c_int = 5; ++ ++pub const dot3ChipSetWesternDigital83C690: c_int = 1; ++pub const dot3ChipSetWesternDigital83C790: c_int = 2; ++ ++// sys/netinet/in.h ++// Protocols (RFC 1700) ++// NOTE: These are in addition to the constants defined in src/unix/mod.rs ++ ++// IPPROTO_IP defined in src/unix/mod.rs ++/// IP6 hop-by-hop options ++pub const IPPROTO_HOPOPTS: c_int = 0; ++// IPPROTO_ICMP defined in src/unix/mod.rs ++/// group mgmt protocol ++pub const IPPROTO_IGMP: c_int = 2; ++/// gateway^2 (deprecated) ++pub const IPPROTO_GGP: c_int = 3; ++/// for compatibility ++pub const IPPROTO_IPIP: c_int = 4; ++// IPPROTO_TCP defined in src/unix/mod.rs ++/// Stream protocol II. ++pub const IPPROTO_ST: c_int = 7; ++/// exterior gateway protocol ++pub const IPPROTO_EGP: c_int = 8; ++/// private interior gateway ++pub const IPPROTO_PIGP: c_int = 9; ++/// BBN RCC Monitoring ++pub const IPPROTO_RCCMON: c_int = 10; ++/// network voice protocol ++pub const IPPROTO_NVPII: c_int = 11; ++/// pup ++pub const IPPROTO_PUP: c_int = 12; ++/// Argus ++pub const IPPROTO_ARGUS: c_int = 13; ++/// EMCON ++pub const IPPROTO_EMCON: c_int = 14; ++/// Cross Net Debugger ++pub const IPPROTO_XNET: c_int = 15; ++/// Chaos ++pub const IPPROTO_CHAOS: c_int = 16; ++// IPPROTO_UDP defined in src/unix/mod.rs ++/// Multiplexing ++pub const IPPROTO_MUX: c_int = 18; ++/// DCN Measurement Subsystems ++pub const IPPROTO_MEAS: c_int = 19; ++/// Host Monitoring ++pub const IPPROTO_HMP: c_int = 20; ++/// Packet Radio Measurement ++pub const IPPROTO_PRM: c_int = 21; ++/// xns idp ++pub const IPPROTO_IDP: c_int = 22; ++/// Trunk-1 ++pub const IPPROTO_TRUNK1: c_int = 23; ++/// Trunk-2 ++pub const IPPROTO_TRUNK2: c_int = 24; ++/// Leaf-1 ++pub const IPPROTO_LEAF1: c_int = 25; ++/// Leaf-2 ++pub const IPPROTO_LEAF2: c_int = 26; ++/// Reliable Data ++pub const IPPROTO_RDP: c_int = 27; ++/// Reliable Transaction ++pub const IPPROTO_IRTP: c_int = 28; ++/// tp-4 w/ class negotiation ++pub const IPPROTO_TP: c_int = 29; ++/// Bulk Data Transfer ++pub const IPPROTO_BLT: c_int = 30; ++/// Network Services ++pub const IPPROTO_NSP: c_int = 31; ++/// Merit Internodal ++pub const IPPROTO_INP: c_int = 32; ++#[doc(hidden)] ++#[deprecated( ++ since = "0.2.72", ++ note = "IPPROTO_SEP is deprecated. Use IPPROTO_DCCP instead" ++)] ++pub const IPPROTO_SEP: c_int = 33; ++/// Datagram Congestion Control Protocol ++pub const IPPROTO_DCCP: c_int = 33; ++/// Third Party Connect ++pub const IPPROTO_3PC: c_int = 34; ++/// InterDomain Policy Routing ++pub const IPPROTO_IDPR: c_int = 35; ++/// XTP ++pub const IPPROTO_XTP: c_int = 36; ++/// Datagram Delivery ++pub const IPPROTO_DDP: c_int = 37; ++/// Control Message Transport ++pub const IPPROTO_CMTP: c_int = 38; ++/// TP++ Transport ++pub const IPPROTO_TPXX: c_int = 39; ++/// IL transport protocol ++pub const IPPROTO_IL: c_int = 40; ++// IPPROTO_IPV6 defined in src/unix/mod.rs ++/// Source Demand Routing ++pub const IPPROTO_SDRP: c_int = 42; ++/// IP6 routing header ++pub const IPPROTO_ROUTING: c_int = 43; ++/// IP6 fragmentation header ++pub const IPPROTO_FRAGMENT: c_int = 44; ++/// InterDomain Routing ++pub const IPPROTO_IDRP: c_int = 45; ++/// resource reservation ++pub const IPPROTO_RSVP: c_int = 46; ++/// General Routing Encap. ++pub const IPPROTO_GRE: c_int = 47; ++/// Mobile Host Routing ++pub const IPPROTO_MHRP: c_int = 48; ++/// BHA ++pub const IPPROTO_BHA: c_int = 49; ++/// IP6 Encap Sec. Payload ++pub const IPPROTO_ESP: c_int = 50; ++/// IP6 Auth Header ++pub const IPPROTO_AH: c_int = 51; ++/// Integ. Net Layer Security ++pub const IPPROTO_INLSP: c_int = 52; ++/// IP with encryption ++pub const IPPROTO_SWIPE: c_int = 53; ++/// Next Hop Resolution ++pub const IPPROTO_NHRP: c_int = 54; ++/// IP Mobility ++pub const IPPROTO_MOBILE: c_int = 55; ++/// Transport Layer Security ++pub const IPPROTO_TLSP: c_int = 56; ++/// SKIP ++pub const IPPROTO_SKIP: c_int = 57; ++// IPPROTO_ICMPV6 defined in src/unix/mod.rs ++/// IP6 no next header ++pub const IPPROTO_NONE: c_int = 59; ++/// IP6 destination option ++pub const IPPROTO_DSTOPTS: c_int = 60; ++/// any host internal protocol ++pub const IPPROTO_AHIP: c_int = 61; ++/// CFTP ++pub const IPPROTO_CFTP: c_int = 62; ++/// "hello" routing protocol ++pub const IPPROTO_HELLO: c_int = 63; ++/// SATNET/Backroom EXPAK ++pub const IPPROTO_SATEXPAK: c_int = 64; ++/// Kryptolan ++pub const IPPROTO_KRYPTOLAN: c_int = 65; ++/// Remote Virtual Disk ++pub const IPPROTO_RVD: c_int = 66; ++/// Pluribus Packet Core ++pub const IPPROTO_IPPC: c_int = 67; ++/// Any distributed FS ++pub const IPPROTO_ADFS: c_int = 68; ++/// Satnet Monitoring ++pub const IPPROTO_SATMON: c_int = 69; ++/// VISA Protocol ++pub const IPPROTO_VISA: c_int = 70; ++/// Packet Core Utility ++pub const IPPROTO_IPCV: c_int = 71; ++/// Comp. Prot. Net. Executive ++pub const IPPROTO_CPNX: c_int = 72; ++/// Comp. Prot. HeartBeat ++pub const IPPROTO_CPHB: c_int = 73; ++/// Wang Span Network ++pub const IPPROTO_WSN: c_int = 74; ++/// Packet Video Protocol ++pub const IPPROTO_PVP: c_int = 75; ++/// BackRoom SATNET Monitoring ++pub const IPPROTO_BRSATMON: c_int = 76; ++/// Sun net disk proto (temp.) ++pub const IPPROTO_ND: c_int = 77; ++/// WIDEBAND Monitoring ++pub const IPPROTO_WBMON: c_int = 78; ++/// WIDEBAND EXPAK ++pub const IPPROTO_WBEXPAK: c_int = 79; ++/// ISO cnlp ++pub const IPPROTO_EON: c_int = 80; ++/// VMTP ++pub const IPPROTO_VMTP: c_int = 81; ++/// Secure VMTP ++pub const IPPROTO_SVMTP: c_int = 82; ++/// Banyon VINES ++pub const IPPROTO_VINES: c_int = 83; ++/// TTP ++pub const IPPROTO_TTP: c_int = 84; ++/// NSFNET-IGP ++pub const IPPROTO_IGP: c_int = 85; ++/// dissimilar gateway prot. ++pub const IPPROTO_DGP: c_int = 86; ++/// TCF ++pub const IPPROTO_TCF: c_int = 87; ++/// Cisco/GXS IGRP ++pub const IPPROTO_IGRP: c_int = 88; ++/// OSPFIGP ++pub const IPPROTO_OSPFIGP: c_int = 89; ++/// Strite RPC protocol ++pub const IPPROTO_SRPC: c_int = 90; ++/// Locus Address Resoloution ++pub const IPPROTO_LARP: c_int = 91; ++/// Multicast Transport ++pub const IPPROTO_MTP: c_int = 92; ++/// AX.25 Frames ++pub const IPPROTO_AX25: c_int = 93; ++/// IP encapsulated in IP ++pub const IPPROTO_IPEIP: c_int = 94; ++/// Mobile Int.ing control ++pub const IPPROTO_MICP: c_int = 95; ++/// Semaphore Comm. security ++pub const IPPROTO_SCCSP: c_int = 96; ++/// Ethernet IP encapsulation ++pub const IPPROTO_ETHERIP: c_int = 97; ++/// encapsulation header ++pub const IPPROTO_ENCAP: c_int = 98; ++/// any private encr. scheme ++pub const IPPROTO_APES: c_int = 99; ++/// GMTP ++pub const IPPROTO_GMTP: c_int = 100; ++/// payload compression (IPComp) ++pub const IPPROTO_IPCOMP: c_int = 108; ++/// SCTP ++pub const IPPROTO_SCTP: c_int = 132; ++/// IPv6 Mobility Header ++pub const IPPROTO_MH: c_int = 135; ++/// UDP-Lite ++pub const IPPROTO_UDPLITE: c_int = 136; ++/// IP6 Host Identity Protocol ++pub const IPPROTO_HIP: c_int = 139; ++/// IP6 Shim6 Protocol ++pub const IPPROTO_SHIM6: c_int = 140; ++ ++/* 101-254: Partly Unassigned */ ++/// Protocol Independent Mcast ++pub const IPPROTO_PIM: c_int = 103; ++/// CARP ++pub const IPPROTO_CARP: c_int = 112; ++/// PGM ++pub const IPPROTO_PGM: c_int = 113; ++/// MPLS-in-IP ++pub const IPPROTO_MPLS: c_int = 137; ++/// PFSYNC ++pub const IPPROTO_PFSYNC: c_int = 240; ++ ++/* 255: Reserved */ ++/* BSD Private, local use, namespace incursion, no longer used */ ++/// OLD divert pseudo-proto ++pub const IPPROTO_OLD_DIVERT: c_int = 254; ++pub const IPPROTO_MAX: c_int = 256; ++/// last return value of *_input(), meaning "all job for this pkt is done". ++pub const IPPROTO_DONE: c_int = 257; ++ ++/* Only used internally, so can be outside the range of valid IP protocols. */ ++/// divert pseudo-protocol ++pub const IPPROTO_DIVERT: c_int = 258; ++/// SeND pseudo-protocol ++pub const IPPROTO_SEND: c_int = 259; ++ ++// sys/netinet/TCP.h ++pub const TCP_MD5SIG: c_int = 16; ++pub const TCP_INFO: c_int = 32; ++pub const TCP_CONGESTION: c_int = 64; ++pub const TCP_CCALGOOPT: c_int = 65; ++pub const TCP_MAXUNACKTIME: c_int = 68; ++#[deprecated(since = "0.2.160", note = "Removed in FreeBSD 15")] ++pub const TCP_MAXPEAKRATE: c_int = 69; ++pub const TCP_IDLE_REDUCE: c_int = 70; ++pub const TCP_REMOTE_UDP_ENCAPS_PORT: c_int = 71; ++pub const TCP_DELACK: c_int = 72; ++pub const TCP_FIN_IS_RST: c_int = 73; ++pub const TCP_LOG_LIMIT: c_int = 74; ++pub const TCP_SHARED_CWND_ALLOWED: c_int = 75; ++pub const TCP_PROC_ACCOUNTING: c_int = 76; ++pub const TCP_USE_CMP_ACKS: c_int = 77; ++pub const TCP_PERF_INFO: c_int = 78; ++pub const TCP_LRD: c_int = 79; ++pub const TCP_KEEPINIT: c_int = 128; ++pub const TCP_FASTOPEN: c_int = 1025; ++pub const TCP_PCAP_OUT: c_int = 2048; ++pub const TCP_PCAP_IN: c_int = 4096; ++pub const TCP_FUNCTION_BLK: c_int = 8192; ++pub const TCP_FUNCTION_ALIAS: c_int = 8193; ++pub const TCP_FASTOPEN_PSK_LEN: c_int = 16; ++pub const TCP_FUNCTION_NAME_LEN_MAX: c_int = 32; ++ ++pub const TCP_REUSPORT_LB_NUMA: c_int = 1026; ++pub const TCP_RACK_MBUF_QUEUE: c_int = 1050; ++pub const TCP_RACK_TLP_REDUCE: c_int = 1052; ++pub const TCP_RACK_PACE_MAX_SEG: c_int = 1054; ++pub const TCP_RACK_PACE_ALWAYS: c_int = 1055; ++pub const TCP_RACK_PRR_SENDALOT: c_int = 1057; ++pub const TCP_RACK_MIN_TO: c_int = 1058; ++pub const TCP_RACK_EARLY_SEG: c_int = 1060; ++pub const TCP_RACK_REORD_THRESH: c_int = 1061; ++pub const TCP_RACK_REORD_FADE: c_int = 1062; ++pub const TCP_RACK_TLP_THRESH: c_int = 1063; ++pub const TCP_RACK_PKT_DELAY: c_int = 1064; ++pub const TCP_BBR_IWINTSO: c_int = 1067; ++pub const TCP_BBR_STARTUP_PG: c_int = 1069; ++pub const TCP_BBR_DRAIN_PG: c_int = 1070; ++pub const TCP_BBR_PROBE_RTT_INT: c_int = 1072; ++pub const TCP_BBR_STARTUP_LOSS_EXIT: c_int = 1074; ++pub const TCP_BBR_TSLIMITS: c_int = 1076; ++pub const TCP_BBR_PACE_OH: c_int = 1077; ++pub const TCP_BBR_USEDEL_RATE: c_int = 1079; ++pub const TCP_BBR_MIN_RTO: c_int = 1080; ++pub const TCP_BBR_MAX_RTO: c_int = 1081; ++pub const TCP_BBR_ALGORITHM: c_int = 1083; ++ ++pub const IP_BINDANY: c_int = 24; ++pub const IP_BINDMULTI: c_int = 25; ++pub const IP_RSS_LISTEN_BUCKET: c_int = 26; ++pub const IP_ORIGDSTADDR: c_int = 27; ++pub const IP_RECVORIGDSTADDR: c_int = IP_ORIGDSTADDR; ++ ++pub const IP_DONTFRAG: c_int = 67; ++pub const IP_RECVTOS: c_int = 68; ++ ++pub const IPV6_BINDANY: c_int = 64; ++pub const IPV6_ORIGDSTADDR: c_int = 72; ++pub const IPV6_RECVORIGDSTADDR: c_int = IPV6_ORIGDSTADDR; ++ ++pub const PF_SLOW: c_int = AF_SLOW; ++pub const PF_SCLUSTER: c_int = AF_SCLUSTER; ++pub const PF_ARP: c_int = AF_ARP; ++pub const PF_BLUETOOTH: c_int = AF_BLUETOOTH; ++pub const PF_IEEE80211: c_int = AF_IEEE80211; ++pub const PF_INET_SDP: c_int = AF_INET_SDP; ++pub const PF_INET6_SDP: c_int = AF_INET6_SDP; ++ ++pub const NET_RT_DUMP: c_int = 1; ++pub const NET_RT_FLAGS: c_int = 2; ++pub const NET_RT_IFLIST: c_int = 3; ++pub const NET_RT_IFMALIST: c_int = 4; ++pub const NET_RT_IFLISTL: c_int = 5; ++ ++// System V IPC ++pub const IPC_INFO: c_int = 3; ++pub const MSG_NOERROR: c_int = 0o10000; ++pub const SHM_LOCK: c_int = 11; ++pub const SHM_UNLOCK: c_int = 12; ++pub const SHM_STAT: c_int = 13; ++pub const SHM_INFO: c_int = 14; ++pub const SHM_ANON: *mut c_char = 1 as *mut c_char; ++ ++// The *_MAXID constants never should've been used outside of the ++// FreeBSD base system. And with the exception of CTL_P1003_1B_MAXID, ++// they were all removed in svn r262489. They remain here for backwards ++// compatibility only, and are scheduled to be removed in libc 1.0.0. ++#[doc(hidden)] ++#[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")] ++pub const CTL_MAXID: c_int = 10; ++#[doc(hidden)] ++#[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")] ++pub const KERN_MAXID: c_int = 38; ++#[doc(hidden)] ++#[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")] ++pub const HW_MAXID: c_int = 13; ++#[doc(hidden)] ++#[deprecated(since = "0.2.54", note = "Removed in FreeBSD 11")] ++pub const USER_MAXID: c_int = 21; ++#[doc(hidden)] ++#[deprecated(since = "0.2.74", note = "Removed in FreeBSD 13")] ++pub const CTL_P1003_1B_MAXID: c_int = 26; ++ ++pub const MSG_NOTIFICATION: c_int = 0x00002000; ++pub const MSG_NBIO: c_int = 0x00004000; ++pub const MSG_COMPAT: c_int = 0x00008000; ++pub const MSG_CMSG_CLOEXEC: c_int = 0x00040000; ++pub const MSG_NOSIGNAL: c_int = 0x20000; ++pub const MSG_WAITFORONE: c_int = 0x00080000; ++ ++// utmpx entry types ++pub const EMPTY: c_short = 0; ++pub const BOOT_TIME: c_short = 1; ++pub const OLD_TIME: c_short = 2; ++pub const NEW_TIME: c_short = 3; ++pub const USER_PROCESS: c_short = 4; ++pub const INIT_PROCESS: c_short = 5; ++pub const LOGIN_PROCESS: c_short = 6; ++pub const DEAD_PROCESS: c_short = 7; ++pub const SHUTDOWN_TIME: c_short = 8; ++// utmp database types ++pub const UTXDB_ACTIVE: c_int = 0; ++pub const UTXDB_LASTLOGIN: c_int = 1; ++pub const UTXDB_LOG: c_int = 2; ++ ++pub const LC_COLLATE_MASK: c_int = 1 << 0; ++pub const LC_CTYPE_MASK: c_int = 1 << 1; ++pub const LC_MONETARY_MASK: c_int = 1 << 2; ++pub const LC_NUMERIC_MASK: c_int = 1 << 3; ++pub const LC_TIME_MASK: c_int = 1 << 4; ++pub const LC_MESSAGES_MASK: c_int = 1 << 5; ++pub const LC_ALL_MASK: c_int = LC_COLLATE_MASK ++ | LC_CTYPE_MASK ++ | LC_MESSAGES_MASK ++ | LC_MONETARY_MASK ++ | LC_NUMERIC_MASK ++ | LC_TIME_MASK; ++ ++pub const WSTOPPED: c_int = 2; // same as WUNTRACED ++pub const WCONTINUED: c_int = 4; ++pub const WNOWAIT: c_int = 8; ++pub const WEXITED: c_int = 16; ++pub const WTRAPPED: c_int = 32; ++ ++// FreeBSD defines a great many more of these, we only expose the ++// standardized ones. ++pub const P_PID: idtype_t = 0; ++pub const P_PGID: idtype_t = 2; ++pub const P_ALL: idtype_t = 7; ++ ++pub const UTIME_OMIT: c_long = -2; ++pub const UTIME_NOW: c_long = -1; ++ ++pub const B460800: crate::speed_t = 460800; ++pub const B921600: crate::speed_t = 921600; ++ ++pub const AT_FDCWD: c_int = -100; ++pub const AT_EACCESS: c_int = 0x100; ++pub const AT_SYMLINK_NOFOLLOW: c_int = 0x200; ++pub const AT_SYMLINK_FOLLOW: c_int = 0x400; ++pub const AT_REMOVEDIR: c_int = 0x800; ++pub const AT_RESOLVE_BENEATH: c_int = 0x2000; ++pub const AT_EMPTY_PATH: c_int = 0x4000; ++ ++pub const AT_NULL: c_int = 0; ++pub const AT_IGNORE: c_int = 1; ++pub const AT_EXECFD: c_int = 2; ++pub const AT_PHDR: c_int = 3; ++pub const AT_PHENT: c_int = 4; ++pub const AT_PHNUM: c_int = 5; ++pub const AT_PAGESZ: c_int = 6; ++pub const AT_BASE: c_int = 7; ++pub const AT_FLAGS: c_int = 8; ++pub const AT_ENTRY: c_int = 9; ++pub const AT_NOTELF: c_int = 10; ++pub const AT_UID: c_int = 11; ++pub const AT_EUID: c_int = 12; ++pub const AT_GID: c_int = 13; ++pub const AT_EGID: c_int = 14; ++pub const AT_EXECPATH: c_int = 15; ++pub const AT_CANARY: c_int = 16; ++pub const AT_OSRELDATE: c_int = 18; ++pub const AT_NCPUS: c_int = 19; ++pub const AT_PAGESIZES: c_int = 20; ++pub const AT_TIMEKEEP: c_int = 22; ++pub const AT_HWCAP: c_int = 25; ++pub const AT_HWCAP2: c_int = 26; ++pub const AT_USRSTACKBASE: c_int = 35; ++pub const AT_USRSTACKLIM: c_int = 36; ++ ++pub const TABDLY: crate::tcflag_t = 0x00000004; ++pub const TAB0: crate::tcflag_t = 0x00000000; ++pub const TAB3: crate::tcflag_t = 0x00000004; ++ ++pub const _PC_ACL_NFS4: c_int = 64; ++ ++pub const _SC_CPUSET_SIZE: c_int = 122; ++ ++pub const _UUID_NODE_LEN: usize = 6; ++ ++// Flags which can be passed to pdfork(2) ++pub const PD_DAEMON: c_int = 0x00000001; ++pub const PD_CLOEXEC: c_int = 0x00000002; ++pub const PD_ALLOWED_AT_FORK: c_int = PD_DAEMON | PD_CLOEXEC; ++ ++// Values for struct rtprio (type_ field) ++pub const RTP_PRIO_REALTIME: c_ushort = 2; ++pub const RTP_PRIO_NORMAL: c_ushort = 3; ++pub const RTP_PRIO_IDLE: c_ushort = 4; ++ ++// DIFF(main): changed to `c_short` in f62eb023ab ++pub const POSIX_SPAWN_RESETIDS: c_int = 0x01; ++pub const POSIX_SPAWN_SETPGROUP: c_int = 0x02; ++pub const POSIX_SPAWN_SETSCHEDPARAM: c_int = 0x04; ++pub const POSIX_SPAWN_SETSCHEDULER: c_int = 0x08; ++pub const POSIX_SPAWN_SETSIGDEF: c_int = 0x10; ++pub const POSIX_SPAWN_SETSIGMASK: c_int = 0x20; ++ ++// Flags for chflags(2) ++pub const UF_SYSTEM: c_ulong = 0x00000080; ++pub const UF_SPARSE: c_ulong = 0x00000100; ++pub const UF_OFFLINE: c_ulong = 0x00000200; ++pub const UF_REPARSE: c_ulong = 0x00000400; ++pub const UF_ARCHIVE: c_ulong = 0x00000800; ++pub const UF_READONLY: c_ulong = 0x00001000; ++pub const UF_HIDDEN: c_ulong = 0x00008000; ++pub const SF_SNAPSHOT: c_ulong = 0x00200000; ++ ++// fcntl commands ++pub const F_ADD_SEALS: c_int = 19; ++pub const F_GET_SEALS: c_int = 20; ++pub const F_OGETLK: c_int = 7; ++pub const F_OSETLK: c_int = 8; ++pub const F_OSETLKW: c_int = 9; ++pub const F_RDAHEAD: c_int = 16; ++pub const F_READAHEAD: c_int = 15; ++pub const F_SETLK_REMOTE: c_int = 14; ++pub const F_KINFO: c_int = 22; ++ ++// for use with F_ADD_SEALS ++pub const F_SEAL_GROW: c_int = 4; ++pub const F_SEAL_SEAL: c_int = 1; ++pub const F_SEAL_SHRINK: c_int = 2; ++pub const F_SEAL_WRITE: c_int = 8; ++ ++// for use with fspacectl ++pub const SPACECTL_DEALLOC: c_int = 1; ++ ++// For realhostname* api ++pub const HOSTNAME_FOUND: c_int = 0; ++pub const HOSTNAME_INCORRECTNAME: c_int = 1; ++pub const HOSTNAME_INVALIDADDR: c_int = 2; ++pub const HOSTNAME_INVALIDNAME: c_int = 3; ++ ++// For rfork ++pub const RFFDG: c_int = 4; ++pub const RFPROC: c_int = 16; ++pub const RFMEM: c_int = 32; ++pub const RFNOWAIT: c_int = 64; ++pub const RFCFDG: c_int = 4096; ++pub const RFTHREAD: c_int = 8192; ++pub const RFSIGSHARE: c_int = 16384; ++pub const RFLINUXTHPN: c_int = 65536; ++pub const RFTSIGZMB: c_int = 524288; ++pub const RFSPAWN: c_int = 2147483648; ++ ++// For eventfd ++pub const EFD_SEMAPHORE: c_int = 0x1; ++pub const EFD_NONBLOCK: c_int = 0x4; ++pub const EFD_CLOEXEC: c_int = 0x100000; ++ ++pub const MALLOCX_ZERO: c_int = 0x40; ++ ++/// size of returned wchan message ++pub const WMESGLEN: usize = 8; ++/// size of returned lock name ++pub const LOCKNAMELEN: usize = 8; ++/// size of returned thread name ++pub const TDNAMLEN: usize = 16; ++/// size of returned ki_comm name ++pub const COMMLEN: usize = 19; ++/// size of returned ki_emul ++pub const KI_EMULNAMELEN: usize = 16; ++/// number of groups in ki_groups ++pub const KI_NGROUPS: usize = 16; ++cfg_if! { ++ if #[cfg(freebsd11)] { ++ pub const KI_NSPARE_INT: usize = 4; ++ } else { ++ pub const KI_NSPARE_INT: usize = 2; ++ } ++} ++pub const KI_NSPARE_LONG: usize = 12; ++/// Flags for the process credential. ++pub const KI_CRF_CAPABILITY_MODE: usize = 0x00000001; ++/// Steal a bit from ki_cr_flags to indicate that the cred had more than ++/// KI_NGROUPS groups. ++pub const KI_CRF_GRP_OVERFLOW: usize = 0x80000000; ++/// controlling tty vnode active ++pub const KI_CTTY: usize = 0x00000001; ++/// session leader ++pub const KI_SLEADER: usize = 0x00000002; ++/// proc blocked on lock ki_lockname ++pub const KI_LOCKBLOCK: usize = 0x00000004; ++/// size of returned ki_login ++pub const LOGNAMELEN: usize = 17; ++/// size of returned ki_loginclass ++pub const LOGINCLASSLEN: usize = 17; ++ ++pub const KF_ATTR_VALID: c_int = 0x0001; ++pub const KF_TYPE_NONE: c_int = 0; ++pub const KF_TYPE_VNODE: c_int = 1; ++pub const KF_TYPE_SOCKET: c_int = 2; ++pub const KF_TYPE_PIPE: c_int = 3; ++pub const KF_TYPE_FIFO: c_int = 4; ++pub const KF_TYPE_KQUEUE: c_int = 5; ++pub const KF_TYPE_MQUEUE: c_int = 7; ++pub const KF_TYPE_SHM: c_int = 8; ++pub const KF_TYPE_SEM: c_int = 9; ++pub const KF_TYPE_PTS: c_int = 10; ++pub const KF_TYPE_PROCDESC: c_int = 11; ++pub const KF_TYPE_DEV: c_int = 12; ++pub const KF_TYPE_UNKNOWN: c_int = 255; ++ ++pub const KF_VTYPE_VNON: c_int = 0; ++pub const KF_VTYPE_VREG: c_int = 1; ++pub const KF_VTYPE_VDIR: c_int = 2; ++pub const KF_VTYPE_VBLK: c_int = 3; ++pub const KF_VTYPE_VCHR: c_int = 4; ++pub const KF_VTYPE_VLNK: c_int = 5; ++pub const KF_VTYPE_VSOCK: c_int = 6; ++pub const KF_VTYPE_VFIFO: c_int = 7; ++pub const KF_VTYPE_VBAD: c_int = 8; ++pub const KF_VTYPE_UNKNOWN: c_int = 255; ++ ++/// Current working directory ++pub const KF_FD_TYPE_CWD: c_int = -1; ++/// Root directory ++pub const KF_FD_TYPE_ROOT: c_int = -2; ++/// Jail directory ++pub const KF_FD_TYPE_JAIL: c_int = -3; ++/// Ktrace vnode ++pub const KF_FD_TYPE_TRACE: c_int = -4; ++pub const KF_FD_TYPE_TEXT: c_int = -5; ++/// Controlling terminal ++pub const KF_FD_TYPE_CTTY: c_int = -6; ++pub const KF_FLAG_READ: c_int = 0x00000001; ++pub const KF_FLAG_WRITE: c_int = 0x00000002; ++pub const KF_FLAG_APPEND: c_int = 0x00000004; ++pub const KF_FLAG_ASYNC: c_int = 0x00000008; ++pub const KF_FLAG_FSYNC: c_int = 0x00000010; ++pub const KF_FLAG_NONBLOCK: c_int = 0x00000020; ++pub const KF_FLAG_DIRECT: c_int = 0x00000040; ++pub const KF_FLAG_HASLOCK: c_int = 0x00000080; ++pub const KF_FLAG_SHLOCK: c_int = 0x00000100; ++pub const KF_FLAG_EXLOCK: c_int = 0x00000200; ++pub const KF_FLAG_NOFOLLOW: c_int = 0x00000400; ++pub const KF_FLAG_CREAT: c_int = 0x00000800; ++pub const KF_FLAG_TRUNC: c_int = 0x00001000; ++pub const KF_FLAG_EXCL: c_int = 0x00002000; ++pub const KF_FLAG_EXEC: c_int = 0x00004000; ++ ++pub const KVME_TYPE_NONE: c_int = 0; ++pub const KVME_TYPE_DEFAULT: c_int = 1; ++pub const KVME_TYPE_VNODE: c_int = 2; ++pub const KVME_TYPE_SWAP: c_int = 3; ++pub const KVME_TYPE_DEVICE: c_int = 4; ++pub const KVME_TYPE_PHYS: c_int = 5; ++pub const KVME_TYPE_DEAD: c_int = 6; ++pub const KVME_TYPE_SG: c_int = 7; ++pub const KVME_TYPE_MGTDEVICE: c_int = 8; ++// Present in `sys/user.h` but is undefined for whatever reason... ++// pub const KVME_TYPE_GUARD: c_int = 9; ++pub const KVME_TYPE_UNKNOWN: c_int = 255; ++pub const KVME_PROT_READ: c_int = 0x00000001; ++pub const KVME_PROT_WRITE: c_int = 0x00000002; ++pub const KVME_PROT_EXEC: c_int = 0x00000004; ++pub const KVME_FLAG_COW: c_int = 0x00000001; ++pub const KVME_FLAG_NEEDS_COPY: c_int = 0x00000002; ++pub const KVME_FLAG_NOCOREDUMP: c_int = 0x00000004; ++pub const KVME_FLAG_SUPER: c_int = 0x00000008; ++pub const KVME_FLAG_GROWS_UP: c_int = 0x00000010; ++pub const KVME_FLAG_GROWS_DOWN: c_int = 0x00000020; ++pub const KVME_FLAG_USER_WIRED: c_int = 0x00000040; ++ ++pub const KKST_MAXLEN: c_int = 1024; ++/// Stack is valid. ++pub const KKST_STATE_STACKOK: c_int = 0; ++/// Stack swapped out. ++pub const KKST_STATE_SWAPPED: c_int = 1; ++pub const KKST_STATE_RUNNING: c_int = 2; ++ ++// Constants about priority. ++pub const PRI_MIN: c_int = 0; ++pub const PRI_MAX: c_int = 255; ++pub const PRI_MIN_ITHD: c_int = PRI_MIN; ++#[deprecated(since = "0.2.133", note = "Not stable across OS versions")] ++#[allow(deprecated)] ++pub const PRI_MAX_ITHD: c_int = PRI_MIN_REALTIME - 1; ++pub const PI_REALTIME: c_int = PRI_MIN_ITHD + 0; ++#[deprecated(since = "0.2.133", note = "Not stable across OS versions")] ++pub const PI_AV: c_int = PRI_MIN_ITHD + 4; ++#[deprecated(since = "0.2.133", note = "Not stable across OS versions")] ++pub const PI_NET: c_int = PRI_MIN_ITHD + 8; ++#[deprecated(since = "0.2.133", note = "Not stable across OS versions")] ++pub const PI_DISK: c_int = PRI_MIN_ITHD + 12; ++#[deprecated(since = "0.2.133", note = "Not stable across OS versions")] ++pub const PI_TTY: c_int = PRI_MIN_ITHD + 16; ++#[deprecated(since = "0.2.133", note = "Not stable across OS versions")] ++pub const PI_DULL: c_int = PRI_MIN_ITHD + 20; ++#[deprecated(since = "0.2.133", note = "Not stable across OS versions")] ++pub const PI_SOFT: c_int = PRI_MIN_ITHD + 24; ++#[deprecated(since = "0.2.133", note = "Not stable across OS versions")] ++pub const PRI_MIN_REALTIME: c_int = 48; ++#[deprecated(since = "0.2.133", note = "Not stable across OS versions")] ++#[allow(deprecated)] ++pub const PRI_MAX_REALTIME: c_int = PRI_MIN_KERN - 1; ++#[deprecated(since = "0.2.133", note = "Not stable across OS versions")] ++pub const PRI_MIN_KERN: c_int = 80; ++#[deprecated(since = "0.2.133", note = "Not stable across OS versions")] ++#[allow(deprecated)] ++pub const PRI_MAX_KERN: c_int = PRI_MIN_TIMESHARE - 1; ++#[deprecated(since = "0.2.133", note = "Not stable across OS versions")] ++#[allow(deprecated)] ++pub const PSWP: c_int = PRI_MIN_KERN + 0; ++#[deprecated(since = "0.2.133", note = "Not stable across OS versions")] ++#[allow(deprecated)] ++pub const PVM: c_int = PRI_MIN_KERN + 4; ++#[deprecated(since = "0.2.133", note = "Not stable across OS versions")] ++#[allow(deprecated)] ++pub const PINOD: c_int = PRI_MIN_KERN + 8; ++#[deprecated(since = "0.2.133", note = "Not stable across OS versions")] ++#[allow(deprecated)] ++pub const PRIBIO: c_int = PRI_MIN_KERN + 12; ++#[deprecated(since = "0.2.133", note = "Not stable across OS versions")] ++#[allow(deprecated)] ++pub const PVFS: c_int = PRI_MIN_KERN + 16; ++#[deprecated(since = "0.2.133", note = "Not stable across OS versions")] ++#[allow(deprecated)] ++pub const PZERO: c_int = PRI_MIN_KERN + 20; ++#[deprecated(since = "0.2.133", note = "Not stable across OS versions")] ++#[allow(deprecated)] ++pub const PSOCK: c_int = PRI_MIN_KERN + 24; ++#[deprecated(since = "0.2.133", note = "Not stable across OS versions")] ++#[allow(deprecated)] ++pub const PWAIT: c_int = PRI_MIN_KERN + 28; ++#[deprecated(since = "0.2.133", note = "Not stable across OS versions")] ++#[allow(deprecated)] ++pub const PLOCK: c_int = PRI_MIN_KERN + 32; ++#[deprecated(since = "0.2.133", note = "Not stable across OS versions")] ++#[allow(deprecated)] ++pub const PPAUSE: c_int = PRI_MIN_KERN + 36; ++#[deprecated(since = "0.2.133", note = "Not stable across OS versions")] ++pub const PRI_MIN_TIMESHARE: c_int = 120; ++pub const PRI_MAX_TIMESHARE: c_int = PRI_MIN_IDLE - 1; ++#[deprecated(since = "0.2.133", note = "Not stable across OS versions")] ++#[allow(deprecated)] ++pub const PUSER: c_int = PRI_MIN_TIMESHARE; ++pub const PRI_MIN_IDLE: c_int = 224; ++pub const PRI_MAX_IDLE: c_int = PRI_MAX; ++ ++pub const NZERO: c_int = 0; ++ ++// Resource utilization information. ++pub const RUSAGE_THREAD: c_int = 1; ++ ++cfg_if! { ++ if #[cfg(any(freebsd11, target_pointer_width = "32"))] { ++ pub const ARG_MAX: c_int = 256 * 1024; ++ } else { ++ pub const ARG_MAX: c_int = 2 * 256 * 1024; ++ } ++} ++pub const CHILD_MAX: c_int = 40; ++/// max command name remembered ++pub const MAXCOMLEN: usize = 19; ++/// max interpreter file name length ++pub const MAXINTERP: c_int = crate::PATH_MAX; ++/// max login name length (incl. NUL) ++pub const MAXLOGNAME: c_int = 33; ++/// max simultaneous processes ++pub const MAXUPRC: c_int = CHILD_MAX; ++/// max bytes for an exec function ++pub const NCARGS: c_int = ARG_MAX; ++/// /* max number groups ++pub const NGROUPS: c_int = NGROUPS_MAX + 1; ++/// max open files per process ++pub const NOFILE: c_int = OPEN_MAX; ++/// marker for empty group set member ++pub const NOGROUP: c_int = 65535; ++/// max hostname size ++pub const MAXHOSTNAMELEN: c_int = 256; ++/// max bytes in term canon input line ++pub const MAX_CANON: c_int = 255; ++/// max bytes in terminal input ++pub const MAX_INPUT: c_int = 255; ++/// max bytes in a file name ++pub const NAME_MAX: c_int = 255; ++pub const MAXSYMLINKS: c_int = 32; ++/// max supplemental group id's ++pub const NGROUPS_MAX: c_int = 1023; ++/// max open files per process ++pub const OPEN_MAX: c_int = 64; ++ ++pub const _POSIX_ARG_MAX: c_int = 4096; ++pub const _POSIX_LINK_MAX: c_int = 8; ++pub const _POSIX_MAX_CANON: c_int = 255; ++pub const _POSIX_MAX_INPUT: c_int = 255; ++pub const _POSIX_NAME_MAX: c_int = 14; ++pub const _POSIX_PIPE_BUF: c_int = 512; ++pub const _POSIX_SSIZE_MAX: c_int = 32767; ++pub const _POSIX_STREAM_MAX: c_int = 8; ++ ++/// max ibase/obase values in bc(1) ++pub const BC_BASE_MAX: c_int = 99; ++/// max array elements in bc(1) ++pub const BC_DIM_MAX: c_int = 2048; ++/// max scale value in bc(1) ++pub const BC_SCALE_MAX: c_int = 99; ++/// max const string length in bc(1) ++pub const BC_STRING_MAX: c_int = 1000; ++/// max character class name size ++pub const CHARCLASS_NAME_MAX: c_int = 14; ++/// max weights for order keyword ++pub const COLL_WEIGHTS_MAX: c_int = 10; ++/// max expressions nested in expr(1) ++pub const EXPR_NEST_MAX: c_int = 32; ++/// max bytes in an input line ++pub const LINE_MAX: c_int = 2048; ++/// max RE's in interval notation ++pub const RE_DUP_MAX: c_int = 255; ++ ++pub const _POSIX2_BC_BASE_MAX: c_int = 99; ++pub const _POSIX2_BC_DIM_MAX: c_int = 2048; ++pub const _POSIX2_BC_SCALE_MAX: c_int = 99; ++pub const _POSIX2_BC_STRING_MAX: c_int = 1000; ++pub const _POSIX2_CHARCLASS_NAME_MAX: c_int = 14; ++pub const _POSIX2_COLL_WEIGHTS_MAX: c_int = 2; ++pub const _POSIX2_EQUIV_CLASS_MAX: c_int = 2; ++pub const _POSIX2_EXPR_NEST_MAX: c_int = 32; ++pub const _POSIX2_LINE_MAX: c_int = 2048; ++pub const _POSIX2_RE_DUP_MAX: c_int = 255; ++ ++// sys/proc.h ++pub const TDF_BORROWING: c_int = 0x00000001; ++pub const TDF_INPANIC: c_int = 0x00000002; ++pub const TDF_INMEM: c_int = 0x00000004; ++pub const TDF_SINTR: c_int = 0x00000008; ++pub const TDF_TIMEOUT: c_int = 0x00000010; ++pub const TDF_IDLETD: c_int = 0x00000020; ++pub const TDF_CANSWAP: c_int = 0x00000040; ++pub const TDF_KTH_SUSP: c_int = 0x00000100; ++pub const TDF_ALLPROCSUSP: c_int = 0x00000200; ++pub const TDF_BOUNDARY: c_int = 0x00000400; ++#[deprecated(since = "0.2.133", note = "Not stable across OS versions")] ++pub const TDF_ASTPENDING: c_int = 0x00000800; ++pub const TDF_SBDRY: c_int = 0x00002000; ++pub const TDF_UPIBLOCKED: c_int = 0x00004000; ++#[deprecated(since = "0.2.133", note = "Not stable across OS versions")] ++pub const TDF_NEEDSUSPCHK: c_int = 0x00008000; ++#[deprecated(since = "0.2.133", note = "Not stable across OS versions")] ++pub const TDF_NEEDRESCHED: c_int = 0x00010000; ++#[deprecated(since = "0.2.133", note = "Not stable across OS versions")] ++pub const TDF_NEEDSIGCHK: c_int = 0x00020000; ++pub const TDF_NOLOAD: c_int = 0x00040000; ++pub const TDF_SERESTART: c_int = 0x00080000; ++pub const TDF_THRWAKEUP: c_int = 0x00100000; ++pub const TDF_SEINTR: c_int = 0x00200000; ++pub const TDF_SWAPINREQ: c_int = 0x00400000; ++#[deprecated(since = "0.2.133", note = "Removed in FreeBSD 14")] ++pub const TDF_UNUSED23: c_int = 0x00800000; ++pub const TDF_SCHED0: c_int = 0x01000000; ++pub const TDF_SCHED1: c_int = 0x02000000; ++pub const TDF_SCHED2: c_int = 0x04000000; ++pub const TDF_SCHED3: c_int = 0x08000000; ++#[deprecated(since = "0.2.133", note = "Not stable across OS versions")] ++pub const TDF_ALRMPEND: c_int = 0x10000000; ++#[deprecated(since = "0.2.133", note = "Not stable across OS versions")] ++pub const TDF_PROFPEND: c_int = 0x20000000; ++#[deprecated(since = "0.2.133", note = "Not stable across OS versions")] ++pub const TDF_MACPEND: c_int = 0x40000000; ++ ++pub const TDB_SUSPEND: c_int = 0x00000001; ++pub const TDB_XSIG: c_int = 0x00000002; ++pub const TDB_USERWR: c_int = 0x00000004; ++pub const TDB_SCE: c_int = 0x00000008; ++pub const TDB_SCX: c_int = 0x00000010; ++pub const TDB_EXEC: c_int = 0x00000020; ++pub const TDB_FORK: c_int = 0x00000040; ++pub const TDB_STOPATFORK: c_int = 0x00000080; ++pub const TDB_CHILD: c_int = 0x00000100; ++pub const TDB_BORN: c_int = 0x00000200; ++pub const TDB_EXIT: c_int = 0x00000400; ++pub const TDB_VFORK: c_int = 0x00000800; ++pub const TDB_FSTP: c_int = 0x00001000; ++pub const TDB_STEP: c_int = 0x00002000; ++ ++pub const TDP_OLDMASK: c_int = 0x00000001; ++pub const TDP_INKTR: c_int = 0x00000002; ++pub const TDP_INKTRACE: c_int = 0x00000004; ++pub const TDP_BUFNEED: c_int = 0x00000008; ++pub const TDP_COWINPROGRESS: c_int = 0x00000010; ++pub const TDP_ALTSTACK: c_int = 0x00000020; ++pub const TDP_DEADLKTREAT: c_int = 0x00000040; ++pub const TDP_NOFAULTING: c_int = 0x00000080; ++pub const TDP_OWEUPC: c_int = 0x00000200; ++pub const TDP_ITHREAD: c_int = 0x00000400; ++pub const TDP_SYNCIO: c_int = 0x00000800; ++pub const TDP_SCHED1: c_int = 0x00001000; ++pub const TDP_SCHED2: c_int = 0x00002000; ++pub const TDP_SCHED3: c_int = 0x00004000; ++pub const TDP_SCHED4: c_int = 0x00008000; ++pub const TDP_GEOM: c_int = 0x00010000; ++pub const TDP_SOFTDEP: c_int = 0x00020000; ++pub const TDP_NORUNNINGBUF: c_int = 0x00040000; ++pub const TDP_WAKEUP: c_int = 0x00080000; ++pub const TDP_INBDFLUSH: c_int = 0x00100000; ++pub const TDP_KTHREAD: c_int = 0x00200000; ++pub const TDP_CALLCHAIN: c_int = 0x00400000; ++pub const TDP_IGNSUSP: c_int = 0x00800000; ++pub const TDP_AUDITREC: c_int = 0x01000000; ++pub const TDP_RFPPWAIT: c_int = 0x02000000; ++pub const TDP_RESETSPUR: c_int = 0x04000000; ++pub const TDP_NERRNO: c_int = 0x08000000; ++pub const TDP_EXECVMSPC: c_int = 0x40000000; ++ ++pub const TDI_SUSPENDED: c_int = 0x0001; ++pub const TDI_SLEEPING: c_int = 0x0002; ++pub const TDI_SWAPPED: c_int = 0x0004; ++pub const TDI_LOCK: c_int = 0x0008; ++pub const TDI_IWAIT: c_int = 0x0010; ++ ++pub const P_ADVLOCK: c_int = 0x00000001; ++pub const P_CONTROLT: c_int = 0x00000002; ++pub const P_KPROC: c_int = 0x00000004; ++pub const P_UNUSED3: c_int = 0x00000008; ++pub const P_PPWAIT: c_int = 0x00000010; ++pub const P_PROFIL: c_int = 0x00000020; ++pub const P_STOPPROF: c_int = 0x00000040; ++pub const P_HADTHREADS: c_int = 0x00000080; ++pub const P_SUGID: c_int = 0x00000100; ++pub const P_SYSTEM: c_int = 0x00000200; ++pub const P_SINGLE_EXIT: c_int = 0x00000400; ++pub const P_TRACED: c_int = 0x00000800; ++pub const P_WAITED: c_int = 0x00001000; ++pub const P_WEXIT: c_int = 0x00002000; ++pub const P_EXEC: c_int = 0x00004000; ++pub const P_WKILLED: c_int = 0x00008000; ++pub const P_CONTINUED: c_int = 0x00010000; ++pub const P_STOPPED_SIG: c_int = 0x00020000; ++pub const P_STOPPED_TRACE: c_int = 0x00040000; ++pub const P_STOPPED_SINGLE: c_int = 0x00080000; ++pub const P_PROTECTED: c_int = 0x00100000; ++pub const P_SIGEVENT: c_int = 0x00200000; ++pub const P_SINGLE_BOUNDARY: c_int = 0x00400000; ++pub const P_HWPMC: c_int = 0x00800000; ++pub const P_JAILED: c_int = 0x01000000; ++pub const P_TOTAL_STOP: c_int = 0x02000000; ++pub const P_INEXEC: c_int = 0x04000000; ++pub const P_STATCHILD: c_int = 0x08000000; ++pub const P_INMEM: c_int = 0x10000000; ++pub const P_SWAPPINGOUT: c_int = 0x20000000; ++pub const P_SWAPPINGIN: c_int = 0x40000000; ++pub const P_PPTRACE: c_int = 0x80000000; ++pub const P_STOPPED: c_int = P_STOPPED_SIG | P_STOPPED_SINGLE | P_STOPPED_TRACE; ++ ++pub const P2_INHERIT_PROTECTED: c_int = 0x00000001; ++pub const P2_NOTRACE: c_int = 0x00000002; ++pub const P2_NOTRACE_EXEC: c_int = 0x00000004; ++pub const P2_AST_SU: c_int = 0x00000008; ++pub const P2_PTRACE_FSTP: c_int = 0x00000010; ++pub const P2_TRAPCAP: c_int = 0x00000020; ++pub const P2_STKGAP_DISABLE: c_int = 0x00000800; ++pub const P2_STKGAP_DISABLE_EXEC: c_int = 0x00001000; ++ ++pub const P_TREE_ORPHANED: c_int = 0x00000001; ++pub const P_TREE_FIRST_ORPHAN: c_int = 0x00000002; ++pub const P_TREE_REAPER: c_int = 0x00000004; ++ ++pub const SIDL: c_char = 1; ++pub const SRUN: c_char = 2; ++pub const SSLEEP: c_char = 3; ++pub const SSTOP: c_char = 4; ++pub const SZOMB: c_char = 5; ++pub const SWAIT: c_char = 6; ++pub const SLOCK: c_char = 7; ++ ++pub const P_MAGIC: c_int = 0xbeefface; ++ ++pub const TDP_SIGFASTBLOCK: c_int = 0x00000100; ++pub const TDP_UIOHELD: c_int = 0x10000000; ++pub const TDP_SIGFASTPENDING: c_int = 0x80000000; ++pub const TDP2_COMPAT32RB: c_int = 0x00000002; ++pub const P2_PROTMAX_ENABLE: c_int = 0x00000200; ++pub const P2_PROTMAX_DISABLE: c_int = 0x00000400; ++pub const TDP2_SBPAGES: c_int = 0x00000001; ++pub const P2_ASLR_ENABLE: c_int = 0x00000040; ++pub const P2_ASLR_DISABLE: c_int = 0x00000080; ++pub const P2_ASLR_IGNSTART: c_int = 0x00000100; ++pub const P_TREE_GRPEXITED: c_int = 0x00000008; ++ ++// libprocstat.h ++pub const PS_FST_VTYPE_VNON: c_int = 1; ++pub const PS_FST_VTYPE_VREG: c_int = 2; ++pub const PS_FST_VTYPE_VDIR: c_int = 3; ++pub const PS_FST_VTYPE_VBLK: c_int = 4; ++pub const PS_FST_VTYPE_VCHR: c_int = 5; ++pub const PS_FST_VTYPE_VLNK: c_int = 6; ++pub const PS_FST_VTYPE_VSOCK: c_int = 7; ++pub const PS_FST_VTYPE_VFIFO: c_int = 8; ++pub const PS_FST_VTYPE_VBAD: c_int = 9; ++pub const PS_FST_VTYPE_UNKNOWN: c_int = 255; ++ ++pub const PS_FST_TYPE_VNODE: c_int = 1; ++pub const PS_FST_TYPE_FIFO: c_int = 2; ++pub const PS_FST_TYPE_SOCKET: c_int = 3; ++pub const PS_FST_TYPE_PIPE: c_int = 4; ++pub const PS_FST_TYPE_PTS: c_int = 5; ++pub const PS_FST_TYPE_KQUEUE: c_int = 6; ++pub const PS_FST_TYPE_MQUEUE: c_int = 8; ++pub const PS_FST_TYPE_SHM: c_int = 9; ++pub const PS_FST_TYPE_SEM: c_int = 10; ++pub const PS_FST_TYPE_UNKNOWN: c_int = 11; ++pub const PS_FST_TYPE_NONE: c_int = 12; ++pub const PS_FST_TYPE_PROCDESC: c_int = 13; ++pub const PS_FST_TYPE_DEV: c_int = 14; ++pub const PS_FST_TYPE_EVENTFD: c_int = 15; ++ ++pub const PS_FST_UFLAG_RDIR: c_int = 0x0001; ++pub const PS_FST_UFLAG_CDIR: c_int = 0x0002; ++pub const PS_FST_UFLAG_JAIL: c_int = 0x0004; ++pub const PS_FST_UFLAG_TRACE: c_int = 0x0008; ++pub const PS_FST_UFLAG_TEXT: c_int = 0x0010; ++pub const PS_FST_UFLAG_MMAP: c_int = 0x0020; ++pub const PS_FST_UFLAG_CTTY: c_int = 0x0040; ++ ++pub const PS_FST_FFLAG_READ: c_int = 0x0001; ++pub const PS_FST_FFLAG_WRITE: c_int = 0x0002; ++pub const PS_FST_FFLAG_NONBLOCK: c_int = 0x0004; ++pub const PS_FST_FFLAG_APPEND: c_int = 0x0008; ++pub const PS_FST_FFLAG_SHLOCK: c_int = 0x0010; ++pub const PS_FST_FFLAG_EXLOCK: c_int = 0x0020; ++pub const PS_FST_FFLAG_ASYNC: c_int = 0x0040; ++pub const PS_FST_FFLAG_SYNC: c_int = 0x0080; ++pub const PS_FST_FFLAG_NOFOLLOW: c_int = 0x0100; ++pub const PS_FST_FFLAG_CREAT: c_int = 0x0200; ++pub const PS_FST_FFLAG_TRUNC: c_int = 0x0400; ++pub const PS_FST_FFLAG_EXCL: c_int = 0x0800; ++pub const PS_FST_FFLAG_DIRECT: c_int = 0x1000; ++pub const PS_FST_FFLAG_EXEC: c_int = 0x2000; ++pub const PS_FST_FFLAG_HASLOCK: c_int = 0x4000; ++ ++// sys/mount.h ++ ++/// File identifier. ++/// These are unique per filesystem on a single machine. ++/// ++/// Note that the offset of fid_data is 4 bytes, so care must be taken to avoid ++/// undefined behavior accessing unaligned fields within an embedded struct. ++pub const MAXFIDSZ: c_int = 16; ++/// Length of type name including null. ++pub const MFSNAMELEN: c_int = 16; ++cfg_if! { ++ if #[cfg(any(freebsd10, freebsd11))] { ++ /// Size of on/from name bufs. ++ pub const MNAMELEN: c_int = 88; ++ } else { ++ /// Size of on/from name bufs. ++ pub const MNAMELEN: c_int = 1024; ++ } ++} ++ ++/// Using journaled soft updates. ++pub const MNT_SUJ: u64 = 0x100000000; ++/// Mounted by automountd(8). ++pub const MNT_AUTOMOUNTED: u64 = 0x200000000; ++/// Filesys metadata untrusted. ++pub const MNT_UNTRUSTED: u64 = 0x800000000; ++ ++/// Require TLS. ++pub const MNT_EXTLS: u64 = 0x4000000000; ++/// Require TLS with client cert. ++pub const MNT_EXTLSCERT: u64 = 0x8000000000; ++/// Require TLS with user cert. ++pub const MNT_EXTLSCERTUSER: u64 = 0x10000000000; ++ ++/// Filesystem is stored locally. ++pub const MNT_LOCAL: u64 = 0x000001000; ++/// Quotas are enabled on fs. ++pub const MNT_QUOTA: u64 = 0x000002000; ++/// Identifies the root fs. ++pub const MNT_ROOTFS: u64 = 0x000004000; ++/// Mounted by a user. ++pub const MNT_USER: u64 = 0x000008000; ++/// Do not show entry in df. ++pub const MNT_IGNORE: u64 = 0x000800000; ++/// Filesystem is verified. ++pub const MNT_VERIFIED: u64 = 0x400000000; ++ ++/// Do not cover a mount point. ++pub const MNT_NOCOVER: u64 = 0x001000000000; ++/// Only mount on empty dir. ++pub const MNT_EMPTYDIR: u64 = 0x002000000000; ++/// Recursively unmount uppers. ++pub const MNT_RECURSE: u64 = 0x100000000000; ++/// Unmount in async context. ++pub const MNT_DEFERRED: u64 = 0x200000000000; ++ ++/// Get configured filesystems. ++pub const VFS_VFSCONF: c_int = 0; ++/// Generic filesystem information. ++pub const VFS_GENERIC: c_int = 0; ++ ++/// int: highest defined filesystem type. ++pub const VFS_MAXTYPENUM: c_int = 1; ++/// struct: vfsconf for filesystem given as next argument. ++pub const VFS_CONF: c_int = 2; ++ ++/// Synchronously wait for I/O to complete. ++pub const MNT_WAIT: c_int = 1; ++/// Start all I/O, but do not wait for it. ++pub const MNT_NOWAIT: c_int = 2; ++/// Push data not written by filesystem syncer. ++pub const MNT_LAZY: c_int = 3; ++/// Suspend file system after sync. ++pub const MNT_SUSPEND: c_int = 4; ++ ++pub const MAXSECFLAVORS: c_int = 5; ++ ++/// Statically compiled into kernel. ++pub const VFCF_STATIC: c_int = 0x00010000; ++/// May get data over the network. ++pub const VFCF_NETWORK: c_int = 0x00020000; ++/// Writes are not implemented. ++pub const VFCF_READONLY: c_int = 0x00040000; ++/// Data does not represent real files. ++pub const VFCF_SYNTHETIC: c_int = 0x00080000; ++/// Aliases some other mounted FS. ++pub const VFCF_LOOPBACK: c_int = 0x00100000; ++/// Stores file names as Unicode. ++pub const VFCF_UNICODE: c_int = 0x00200000; ++/// Can be mounted from within a jail. ++pub const VFCF_JAIL: c_int = 0x00400000; ++/// Supports delegated administration. ++pub const VFCF_DELEGADMIN: c_int = 0x00800000; ++/// Stop at Boundary: defer stop requests to kernel->user (AST) transition. ++pub const VFCF_SBDRY: c_int = 0x01000000; ++ ++// time.h ++ ++/// not on dst ++pub const DST_NONE: c_int = 0; ++/// USA style dst ++pub const DST_USA: c_int = 1; ++/// Australian style dst ++pub const DST_AUST: c_int = 2; ++/// Western European dst ++pub const DST_WET: c_int = 3; ++/// Middle European dst ++pub const DST_MET: c_int = 4; ++/// Eastern European dst ++pub const DST_EET: c_int = 5; ++/// Canada ++pub const DST_CAN: c_int = 6; ++ ++pub const CPUCLOCK_WHICH_PID: c_int = 0; ++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; ++pub const SHM_LARGEPAGE_ALLOC_HARD: c_int = 2; ++pub const SHM_RENAME_NOREPLACE: c_int = 1 << 0; ++pub const SHM_RENAME_EXCHANGE: c_int = 1 << 1; ++ ++// sys/umtx.h ++ ++pub const UMTX_OP_WAIT: c_int = 2; ++pub const UMTX_OP_WAKE: c_int = 3; ++pub const UMTX_OP_MUTEX_TRYLOCK: c_int = 4; ++pub const UMTX_OP_MUTEX_LOCK: c_int = 5; ++pub const UMTX_OP_MUTEX_UNLOCK: c_int = 6; ++pub const UMTX_OP_SET_CEILING: c_int = 7; ++pub const UMTX_OP_CV_WAIT: c_int = 8; ++pub const UMTX_OP_CV_SIGNAL: c_int = 9; ++pub const UMTX_OP_CV_BROADCAST: c_int = 10; ++pub const UMTX_OP_WAIT_UINT: c_int = 11; ++pub const UMTX_OP_RW_RDLOCK: c_int = 12; ++pub const UMTX_OP_RW_WRLOCK: c_int = 13; ++pub const UMTX_OP_RW_UNLOCK: c_int = 14; ++pub const UMTX_OP_WAIT_UINT_PRIVATE: c_int = 15; ++pub const UMTX_OP_WAKE_PRIVATE: c_int = 16; ++pub const UMTX_OP_MUTEX_WAIT: c_int = 17; ++pub const UMTX_OP_NWAKE_PRIVATE: c_int = 21; ++pub const UMTX_OP_MUTEX_WAKE2: c_int = 22; ++pub const UMTX_OP_SEM2_WAIT: c_int = 23; ++pub const UMTX_OP_SEM2_WAKE: c_int = 24; ++pub const UMTX_OP_SHM: c_int = 25; ++pub const UMTX_OP_ROBUST_LISTS: c_int = 26; ++ ++pub const UMTX_ABSTIME: u32 = 1; ++ ++pub const CPU_LEVEL_ROOT: c_int = 1; ++pub const CPU_LEVEL_CPUSET: c_int = 2; ++pub const CPU_LEVEL_WHICH: c_int = 3; ++ ++pub const CPU_WHICH_TID: c_int = 1; ++pub const CPU_WHICH_PID: c_int = 2; ++pub const CPU_WHICH_CPUSET: c_int = 3; ++pub const CPU_WHICH_IRQ: c_int = 4; ++pub const CPU_WHICH_JAIL: c_int = 5; ++ ++// net/route.h ++pub const RTF_LLDATA: c_int = 0x400; ++pub const RTF_FIXEDMTU: c_int = 0x80000; ++ ++pub const RTM_VERSION: c_int = 5; ++ ++pub const RTAX_MAX: c_int = 8; ++ ++// sys/signal.h ++pub const SIGTHR: c_int = 32; ++pub const SIGLWP: c_int = SIGTHR; ++pub const SIGLIBRT: c_int = 33; ++ ++// netinet/sctp.h ++pub const SCTP_FUTURE_ASSOC: c_int = 0; ++pub const SCTP_CURRENT_ASSOC: c_int = 1; ++pub const SCTP_ALL_ASSOC: c_int = 2; ++ ++pub const SCTP_NO_NEXT_MSG: c_int = 0x0000; ++pub const SCTP_NEXT_MSG_AVAIL: c_int = 0x0001; ++pub const SCTP_NEXT_MSG_ISCOMPLETE: c_int = 0x0002; ++pub const SCTP_NEXT_MSG_IS_UNORDERED: c_int = 0x0004; ++pub const SCTP_NEXT_MSG_IS_NOTIFICATION: c_int = 0x0008; ++ ++pub const SCTP_RECVV_NOINFO: c_int = 0; ++pub const SCTP_RECVV_RCVINFO: c_int = 1; ++pub const SCTP_RECVV_NXTINFO: c_int = 2; ++pub const SCTP_RECVV_RN: c_int = 3; ++ ++pub const SCTP_SENDV_NOINFO: c_int = 0; ++pub const SCTP_SENDV_SNDINFO: c_int = 1; ++pub const SCTP_SENDV_PRINFO: c_int = 2; ++pub const SCTP_SENDV_AUTHINFO: c_int = 3; ++pub const SCTP_SENDV_SPA: c_int = 4; ++ ++pub const SCTP_SEND_SNDINFO_VALID: c_int = 0x00000001; ++pub const SCTP_SEND_PRINFO_VALID: c_int = 0x00000002; ++pub const SCTP_SEND_AUTHINFO_VALID: c_int = 0x00000004; ++ ++pub const SCTP_NOTIFICATION: c_int = 0x0010; ++pub const SCTP_COMPLETE: c_int = 0x0020; ++pub const SCTP_EOF: c_int = 0x0100; ++pub const SCTP_ABORT: c_int = 0x0200; ++pub const SCTP_UNORDERED: c_int = 0x0400; ++pub const SCTP_ADDR_OVER: c_int = 0x0800; ++pub const SCTP_SENDALL: c_int = 0x1000; ++pub const SCTP_EOR: c_int = 0x2000; ++pub const SCTP_SACK_IMMEDIATELY: c_int = 0x4000; ++pub const SCTP_PR_SCTP_NONE: c_int = 0x0000; ++pub const SCTP_PR_SCTP_TTL: c_int = 0x0001; ++pub const SCTP_PR_SCTP_PRIO: c_int = 0x0002; ++pub const SCTP_PR_SCTP_BUF: c_int = SCTP_PR_SCTP_PRIO; ++pub const SCTP_PR_SCTP_RTX: c_int = 0x0003; ++pub const SCTP_PR_SCTP_MAX: c_int = SCTP_PR_SCTP_RTX; ++pub const SCTP_PR_SCTP_ALL: c_int = 0x000f; ++ ++pub const SCTP_INIT: c_int = 0x0001; ++pub const SCTP_SNDRCV: c_int = 0x0002; ++pub const SCTP_EXTRCV: c_int = 0x0003; ++pub const SCTP_SNDINFO: c_int = 0x0004; ++pub const SCTP_RCVINFO: c_int = 0x0005; ++pub const SCTP_NXTINFO: c_int = 0x0006; ++pub const SCTP_PRINFO: c_int = 0x0007; ++pub const SCTP_AUTHINFO: c_int = 0x0008; ++pub const SCTP_DSTADDRV4: c_int = 0x0009; ++pub const SCTP_DSTADDRV6: c_int = 0x000a; ++ ++pub const SCTP_RTOINFO: c_int = 0x00000001; ++pub const SCTP_ASSOCINFO: c_int = 0x00000002; ++pub const SCTP_INITMSG: c_int = 0x00000003; ++pub const SCTP_NODELAY: c_int = 0x00000004; ++pub const SCTP_AUTOCLOSE: c_int = 0x00000005; ++pub const SCTP_SET_PEER_PRIMARY_ADDR: c_int = 0x00000006; ++pub const SCTP_PRIMARY_ADDR: c_int = 0x00000007; ++pub const SCTP_ADAPTATION_LAYER: c_int = 0x00000008; ++pub const SCTP_ADAPTION_LAYER: c_int = 0x00000008; ++pub const SCTP_DISABLE_FRAGMENTS: c_int = 0x00000009; ++pub const SCTP_PEER_ADDR_PARAMS: c_int = 0x0000000a; ++pub const SCTP_DEFAULT_SEND_PARAM: c_int = 0x0000000b; ++pub const SCTP_EVENTS: c_int = 0x0000000c; ++pub const SCTP_I_WANT_MAPPED_V4_ADDR: c_int = 0x0000000d; ++pub const SCTP_MAXSEG: c_int = 0x0000000e; ++pub const SCTP_DELAYED_SACK: c_int = 0x0000000f; ++pub const SCTP_FRAGMENT_INTERLEAVE: c_int = 0x00000010; ++pub const SCTP_PARTIAL_DELIVERY_POINT: c_int = 0x00000011; ++pub const SCTP_AUTH_CHUNK: c_int = 0x00000012; ++pub const SCTP_AUTH_KEY: c_int = 0x00000013; ++pub const SCTP_HMAC_IDENT: c_int = 0x00000014; ++pub const SCTP_AUTH_ACTIVE_KEY: c_int = 0x00000015; ++pub const SCTP_AUTH_DELETE_KEY: c_int = 0x00000016; ++pub const SCTP_USE_EXT_RCVINFO: c_int = 0x00000017; ++pub const SCTP_AUTO_ASCONF: c_int = 0x00000018; ++pub const SCTP_MAXBURST: c_int = 0x00000019; ++pub const SCTP_MAX_BURST: c_int = 0x00000019; ++pub const SCTP_CONTEXT: c_int = 0x0000001a; ++pub const SCTP_EXPLICIT_EOR: c_int = 0x00000001b; ++pub const SCTP_REUSE_PORT: c_int = 0x00000001c; ++pub const SCTP_AUTH_DEACTIVATE_KEY: c_int = 0x00000001d; ++pub const SCTP_EVENT: c_int = 0x0000001e; ++pub const SCTP_RECVRCVINFO: c_int = 0x0000001f; ++pub const SCTP_RECVNXTINFO: c_int = 0x00000020; ++pub const SCTP_DEFAULT_SNDINFO: c_int = 0x00000021; ++pub const SCTP_DEFAULT_PRINFO: c_int = 0x00000022; ++pub const SCTP_PEER_ADDR_THLDS: c_int = 0x00000023; ++pub const SCTP_REMOTE_UDP_ENCAPS_PORT: c_int = 0x00000024; ++pub const SCTP_ECN_SUPPORTED: c_int = 0x00000025; ++pub const SCTP_AUTH_SUPPORTED: c_int = 0x00000027; ++pub const SCTP_ASCONF_SUPPORTED: c_int = 0x00000028; ++pub const SCTP_RECONFIG_SUPPORTED: c_int = 0x00000029; ++pub const SCTP_NRSACK_SUPPORTED: c_int = 0x00000030; ++pub const SCTP_PKTDROP_SUPPORTED: c_int = 0x00000031; ++pub const SCTP_MAX_CWND: c_int = 0x00000032; ++ ++pub const SCTP_STATUS: c_int = 0x00000100; ++pub const SCTP_GET_PEER_ADDR_INFO: c_int = 0x00000101; ++pub const SCTP_PEER_AUTH_CHUNKS: c_int = 0x00000102; ++pub const SCTP_LOCAL_AUTH_CHUNKS: c_int = 0x00000103; ++pub const SCTP_GET_ASSOC_NUMBER: c_int = 0x00000104; ++pub const SCTP_GET_ASSOC_ID_LIST: c_int = 0x00000105; ++pub const SCTP_TIMEOUTS: c_int = 0x00000106; ++pub const SCTP_PR_STREAM_STATUS: c_int = 0x00000107; ++pub const SCTP_PR_ASSOC_STATUS: c_int = 0x00000108; ++ ++pub const SCTP_COMM_UP: c_int = 0x0001; ++pub const SCTP_COMM_LOST: c_int = 0x0002; ++pub const SCTP_RESTART: c_int = 0x0003; ++pub const SCTP_SHUTDOWN_COMP: c_int = 0x0004; ++pub const SCTP_CANT_STR_ASSOC: c_int = 0x0005; ++ ++pub const SCTP_ASSOC_SUPPORTS_PR: c_int = 0x01; ++pub const SCTP_ASSOC_SUPPORTS_AUTH: c_int = 0x02; ++pub const SCTP_ASSOC_SUPPORTS_ASCONF: c_int = 0x03; ++pub const SCTP_ASSOC_SUPPORTS_MULTIBUF: c_int = 0x04; ++pub const SCTP_ASSOC_SUPPORTS_RE_CONFIG: c_int = 0x05; ++pub const SCTP_ASSOC_SUPPORTS_INTERLEAVING: c_int = 0x06; ++pub const SCTP_ASSOC_SUPPORTS_MAX: c_int = 0x06; ++ ++pub const SCTP_ADDR_AVAILABLE: c_int = 0x0001; ++pub const SCTP_ADDR_UNREACHABLE: c_int = 0x0002; ++pub const SCTP_ADDR_REMOVED: c_int = 0x0003; ++pub const SCTP_ADDR_ADDED: c_int = 0x0004; ++pub const SCTP_ADDR_MADE_PRIM: c_int = 0x0005; ++pub const SCTP_ADDR_CONFIRMED: c_int = 0x0006; ++ ++pub const SCTP_ACTIVE: c_int = 0x0001; ++pub const SCTP_INACTIVE: c_int = 0x0002; ++pub const SCTP_UNCONFIRMED: c_int = 0x0200; ++ ++pub const SCTP_DATA_UNSENT: c_int = 0x0001; ++pub const SCTP_DATA_SENT: c_int = 0x0002; ++ ++pub const SCTP_PARTIAL_DELIVERY_ABORTED: c_int = 0x0001; ++ ++pub const SCTP_AUTH_NEW_KEY: c_int = 0x0001; ++pub const SCTP_AUTH_NEWKEY: c_int = SCTP_AUTH_NEW_KEY; ++pub const SCTP_AUTH_NO_AUTH: c_int = 0x0002; ++pub const SCTP_AUTH_FREE_KEY: c_int = 0x0003; ++ ++pub const SCTP_STREAM_RESET_INCOMING_SSN: c_int = 0x0001; ++pub const SCTP_STREAM_RESET_OUTGOING_SSN: c_int = 0x0002; ++pub const SCTP_STREAM_RESET_DENIED: c_int = 0x0004; ++pub const SCTP_STREAM_RESET_FAILED: c_int = 0x0008; ++ ++pub const SCTP_ASSOC_RESET_DENIED: c_int = 0x0004; ++pub const SCTP_ASSOC_RESET_FAILED: c_int = 0x0008; ++ ++pub const SCTP_STREAM_CHANGE_DENIED: c_int = 0x0004; ++pub const SCTP_STREAM_CHANGE_FAILED: c_int = 0x0008; ++ ++pub const KENV_DUMP_LOADER: c_int = 4; ++pub const KENV_DUMP_STATIC: c_int = 5; ++ ++pub const RB_PAUSE: c_int = 0x100000; ++pub const RB_REROOT: c_int = 0x200000; ++pub const RB_POWERCYCLE: c_int = 0x400000; ++pub const RB_PROBE: c_int = 0x10000000; ++pub const RB_MULTIPLE: c_int = 0x20000000; ++ ++// sys/time.h ++pub const CLOCK_BOOTTIME: crate::clockid_t = crate::CLOCK_UPTIME; ++pub const CLOCK_REALTIME_COARSE: crate::clockid_t = crate::CLOCK_REALTIME_FAST; ++pub const CLOCK_MONOTONIC_COARSE: crate::clockid_t = crate::CLOCK_MONOTONIC_FAST; ++ ++// sys/timerfd.h ++ ++pub const TFD_NONBLOCK: c_int = crate::O_NONBLOCK; ++pub const TFD_CLOEXEC: c_int = O_CLOEXEC; ++pub const TFD_TIMER_ABSTIME: c_int = 0x01; ++pub const TFD_TIMER_CANCEL_ON_SET: c_int = 0x02; ++ ++// sys/unistd.h ++ ++pub const CLOSE_RANGE_CLOEXEC: c_uint = 1 << 2; ++ ++pub const KCMP_FILE: c_int = 100; ++pub const KCMP_FILEOBJ: c_int = 101; ++pub const KCMP_FILES: c_int = 102; ++pub const KCMP_SIGHAND: c_int = 103; ++pub const KCMP_VM: c_int = 104; ++ ++pub const fn MAP_ALIGNED(a: c_int) -> c_int { ++ a << 24 ++} ++ ++const_fn! { ++ {const} fn _ALIGN(p: usize) -> usize { ++ (p + _ALIGNBYTES) & !_ALIGNBYTES ++ } ++} ++ ++f! { ++ pub fn CMSG_DATA(cmsg: *const cmsghdr) -> *mut c_uchar { ++ (cmsg as *mut c_uchar).offset(_ALIGN(mem::size_of::()) as isize) ++ } ++ ++ pub {const} fn CMSG_LEN(length: c_uint) -> c_uint { ++ _ALIGN(mem::size_of::()) as c_uint + length ++ } ++ ++ pub fn CMSG_NXTHDR(mhdr: *const crate::msghdr, cmsg: *const cmsghdr) -> *mut cmsghdr { ++ if cmsg.is_null() { ++ return crate::CMSG_FIRSTHDR(mhdr); ++ }; ++ let next = ++ cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize) + _ALIGN(mem::size_of::()); ++ let max = (*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize; ++ if next > max { ++ 0 as *mut cmsghdr ++ } else { ++ (cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize)) as *mut cmsghdr ++ } ++ } ++ ++ pub {const} fn CMSG_SPACE(length: c_uint) -> c_uint { ++ (_ALIGN(mem::size_of::()) + _ALIGN(length as usize)) as c_uint ++ } ++ ++ pub fn MALLOCX_ALIGN(lg: c_uint) -> c_int { ++ ffsl(lg as c_long - 1) ++ } ++ ++ pub {const} fn MALLOCX_TCACHE(tc: c_int) -> c_int { ++ (tc + 2) << 8 as c_int ++ } ++ ++ pub {const} fn MALLOCX_ARENA(a: c_int) -> c_int { ++ (a + 1) << 20 as c_int ++ } ++ ++ pub fn SOCKCREDSIZE(ngrps: usize) -> usize { ++ let ngrps = if ngrps > 0 { ngrps - 1 } else { 0 }; ++ mem::size_of::() + mem::size_of::() * ngrps ++ } ++ ++ pub fn uname(buf: *mut crate::utsname) -> c_int { ++ __xuname(256, buf as *mut c_void) ++ } ++ ++ pub fn CPU_ZERO(cpuset: &mut cpuset_t) -> () { ++ for slot in cpuset.__bits.iter_mut() { ++ *slot = 0; ++ } ++ } ++ ++ pub fn CPU_FILL(cpuset: &mut cpuset_t) -> () { ++ for slot in cpuset.__bits.iter_mut() { ++ *slot = !0; ++ } ++ } ++ ++ pub fn CPU_SET(cpu: usize, cpuset: &mut cpuset_t) -> () { ++ let bitset_bits = 8 * mem::size_of::(); ++ 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::(); ++ 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::(); ++ let (idx, offset) = (cpu / bitset_bits, cpu % bitset_bits); ++ 0 != cpuset.__bits[idx] & (1 << offset) ++ } ++ ++ 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::(); ++ ++ for i in cpuset.__bits[..(cpuset_size / bitset_size)].iter() { ++ s += i.count_ones(); ++ } ++ s as c_int ++ } ++ ++ pub fn SOCKCRED2SIZE(ngrps: usize) -> usize { ++ let ngrps = if ngrps > 0 { ngrps - 1 } else { 0 }; ++ mem::size_of::() + mem::size_of::() * ngrps ++ } ++ ++ pub fn PROT_MAX(x: c_int) -> c_int { ++ x << 16 ++ } ++ ++ pub fn PROT_MAX_EXTRACT(x: c_int) -> c_int { ++ (x >> 16) & (crate::PROT_READ | crate::PROT_WRITE | crate::PROT_EXEC) ++ } ++} ++ ++safe_f! { ++ pub {const} fn WIFSIGNALED(status: c_int) -> bool { ++ (status & 0o177) != 0o177 && (status & 0o177) != 0 && status != 0x13 ++ } ++ ++ pub {const} fn INVALID_SINFO_FLAG(x: c_int) -> bool { ++ (x) & 0xfffffff0 ++ & !(SCTP_EOF ++ | SCTP_ABORT ++ | SCTP_UNORDERED ++ | SCTP_ADDR_OVER ++ | SCTP_SENDALL ++ | SCTP_EOR ++ | SCTP_SACK_IMMEDIATELY) ++ != 0 ++ } ++ ++ pub {const} fn PR_SCTP_POLICY(x: c_int) -> c_int { ++ x & 0x0f ++ } ++ ++ pub {const} fn PR_SCTP_ENABLED(x: c_int) -> bool { ++ PR_SCTP_POLICY(x) != SCTP_PR_SCTP_NONE && PR_SCTP_POLICY(x) != SCTP_PR_SCTP_ALL ++ } ++ ++ pub {const} fn PR_SCTP_TTL_ENABLED(x: c_int) -> bool { ++ PR_SCTP_POLICY(x) == SCTP_PR_SCTP_TTL ++ } ++ ++ pub {const} fn PR_SCTP_BUF_ENABLED(x: c_int) -> bool { ++ PR_SCTP_POLICY(x) == SCTP_PR_SCTP_BUF ++ } ++ ++ pub {const} fn PR_SCTP_RTX_ENABLED(x: c_int) -> bool { ++ PR_SCTP_POLICY(x) == SCTP_PR_SCTP_RTX ++ } ++ ++ pub {const} fn PR_SCTP_INVALID_POLICY(x: c_int) -> bool { ++ PR_SCTP_POLICY(x) > SCTP_PR_SCTP_MAX ++ } ++ ++ pub {const} fn PR_SCTP_VALID_POLICY(x: c_int) -> bool { ++ PR_SCTP_POLICY(x) <= SCTP_PR_SCTP_MAX ++ } ++} ++ ++cfg_if! { ++ if #[cfg(not(any(freebsd10, freebsd11)))] { ++ extern "C" { ++ pub fn fhlink(fhp: *mut fhandle_t, to: *const c_char) -> c_int; ++ pub fn fhlinkat(fhp: *mut fhandle_t, tofd: c_int, to: *const c_char) -> c_int; ++ pub fn fhreadlink(fhp: *mut fhandle_t, buf: *mut c_char, bufsize: size_t) -> c_int; ++ pub fn getfhat(fd: c_int, path: *mut c_char, fhp: *mut fhandle, flag: c_int) -> c_int; ++ } ++ } ++} ++ ++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; ++ pub fn aio_error(aiocbp: *const aiocb) -> c_int; ++ pub fn aio_fsync(op: c_int, aiocbp: *mut aiocb) -> c_int; ++ pub fn aio_read(aiocbp: *mut aiocb) -> c_int; ++ pub fn aio_readv(aiocbp: *mut crate::aiocb) -> c_int; ++ pub fn aio_return(aiocbp: *mut aiocb) -> ssize_t; ++ pub fn aio_suspend( ++ aiocb_list: *const *const aiocb, ++ nitems: c_int, ++ timeout: *const crate::timespec, ++ ) -> c_int; ++ pub fn aio_write(aiocbp: *mut aiocb) -> c_int; ++ pub fn aio_writev(aiocbp: *mut crate::aiocb) -> c_int; ++ ++ pub fn copy_file_range( ++ infd: c_int, ++ inoffp: *mut off_t, ++ outfd: c_int, ++ outoffp: *mut off_t, ++ len: size_t, ++ flags: c_uint, ++ ) -> ssize_t; ++ ++ pub fn devname_r( ++ dev: crate::dev_t, ++ mode: crate::mode_t, ++ buf: *mut c_char, ++ len: c_int, ++ ) -> *mut c_char; ++ ++ pub fn extattr_delete_fd(fd: c_int, attrnamespace: c_int, attrname: *const c_char) -> c_int; ++ pub fn extattr_delete_file( ++ path: *const c_char, ++ attrnamespace: c_int, ++ attrname: *const c_char, ++ ) -> c_int; ++ pub fn extattr_delete_link( ++ path: *const c_char, ++ attrnamespace: c_int, ++ attrname: *const c_char, ++ ) -> c_int; ++ pub fn extattr_get_fd( ++ fd: c_int, ++ attrnamespace: c_int, ++ attrname: *const c_char, ++ data: *mut c_void, ++ nbytes: size_t, ++ ) -> ssize_t; ++ pub fn extattr_get_file( ++ path: *const c_char, ++ attrnamespace: c_int, ++ attrname: *const c_char, ++ data: *mut c_void, ++ nbytes: size_t, ++ ) -> ssize_t; ++ pub fn extattr_get_link( ++ path: *const c_char, ++ attrnamespace: c_int, ++ attrname: *const c_char, ++ data: *mut c_void, ++ nbytes: size_t, ++ ) -> ssize_t; ++ pub fn extattr_list_fd( ++ fd: c_int, ++ attrnamespace: c_int, ++ data: *mut c_void, ++ nbytes: size_t, ++ ) -> ssize_t; ++ pub fn extattr_list_file( ++ path: *const c_char, ++ attrnamespace: c_int, ++ data: *mut c_void, ++ nbytes: size_t, ++ ) -> ssize_t; ++ pub fn extattr_list_link( ++ path: *const c_char, ++ attrnamespace: c_int, ++ data: *mut c_void, ++ nbytes: size_t, ++ ) -> ssize_t; ++ pub fn extattr_set_fd( ++ fd: c_int, ++ attrnamespace: c_int, ++ attrname: *const c_char, ++ data: *const c_void, ++ nbytes: size_t, ++ ) -> ssize_t; ++ pub fn extattr_set_file( ++ path: *const c_char, ++ attrnamespace: c_int, ++ attrname: *const c_char, ++ data: *const c_void, ++ nbytes: size_t, ++ ) -> ssize_t; ++ pub fn extattr_set_link( ++ path: *const c_char, ++ attrnamespace: c_int, ++ attrname: *const c_char, ++ data: *const c_void, ++ nbytes: size_t, ++ ) -> ssize_t; ++ ++ pub fn fspacectl( ++ fd: c_int, ++ cmd: c_int, ++ rqsr: *const spacectl_range, ++ flags: c_int, ++ rmsr: *mut spacectl_range, ++ ) -> c_int; ++ ++ pub fn jail(jail: *mut crate::jail) -> c_int; ++ pub fn jail_attach(jid: c_int) -> c_int; ++ pub fn jail_remove(jid: c_int) -> c_int; ++ pub fn jail_get(iov: *mut crate::iovec, niov: c_uint, flags: c_int) -> c_int; ++ pub fn jail_set(iov: *mut crate::iovec, niov: c_uint, flags: c_int) -> c_int; ++ ++ pub fn lio_listio( ++ mode: c_int, ++ aiocb_list: *const *mut aiocb, ++ nitems: c_int, ++ sevp: *mut sigevent, ++ ) -> c_int; ++ ++ pub fn mkostemp(template: *mut c_char, flags: c_int) -> c_int; ++ pub fn mkostemps(template: *mut c_char, suffixlen: c_int, flags: c_int) -> c_int; ++ ++ pub fn getutxuser(user: *const c_char) -> *mut utmpx; ++ pub fn setutxdb(_type: c_int, file: *const c_char) -> c_int; ++ ++ pub fn aio_waitcomplete(iocbp: *mut *mut aiocb, timeout: *mut crate::timespec) -> ssize_t; ++ pub fn mq_getfd_np(mqd: crate::mqd_t) -> c_int; ++ ++ pub fn waitid( ++ idtype: idtype_t, ++ id: crate::id_t, ++ infop: *mut crate::siginfo_t, ++ options: c_int, ++ ) -> c_int; ++ pub fn ptsname_r(fd: c_int, buf: *mut c_char, buflen: size_t) -> c_int; ++ ++ pub fn ftok(pathname: *const c_char, proj_id: c_int) -> crate::key_t; ++ pub fn shmget(key: crate::key_t, size: size_t, shmflg: c_int) -> c_int; ++ pub fn shmat(shmid: c_int, shmaddr: *const c_void, shmflg: c_int) -> *mut c_void; ++ pub fn shmdt(shmaddr: *const c_void) -> c_int; ++ pub fn shmctl(shmid: c_int, cmd: c_int, buf: *mut crate::shmid_ds) -> c_int; ++ pub fn semget(key: crate::key_t, nsems: c_int, semflg: c_int) -> c_int; ++ pub fn semctl(semid: c_int, semnum: c_int, cmd: c_int, ...) -> c_int; ++ pub fn semop(semid: c_int, sops: *mut sembuf, nsops: size_t) -> c_int; ++ pub fn msgctl(msqid: c_int, cmd: c_int, buf: *mut crate::msqid_ds) -> c_int; ++ pub fn msgget(key: crate::key_t, msgflg: c_int) -> c_int; ++ pub fn msgsnd(msqid: c_int, msgp: *const c_void, msgsz: size_t, msgflg: c_int) -> c_int; ++ pub fn cfmakesane(termios: *mut crate::termios); ++ ++ pub fn pdfork(fdp: *mut c_int, flags: c_int) -> crate::pid_t; ++ pub fn pdgetpid(fd: c_int, pidp: *mut crate::pid_t) -> c_int; ++ pub fn pdkill(fd: c_int, signum: c_int) -> c_int; ++ ++ pub fn rtprio_thread(function: c_int, lwpid: crate::lwpid_t, rtp: *mut super::rtprio) -> c_int; ++ ++ pub fn posix_spawn( ++ pid: *mut crate::pid_t, ++ path: *const c_char, ++ file_actions: *const crate::posix_spawn_file_actions_t, ++ attrp: *const crate::posix_spawnattr_t, ++ argv: *const *mut c_char, ++ envp: *const *mut c_char, ++ ) -> c_int; ++ pub fn posix_spawnp( ++ pid: *mut crate::pid_t, ++ file: *const c_char, ++ file_actions: *const crate::posix_spawn_file_actions_t, ++ attrp: *const crate::posix_spawnattr_t, ++ argv: *const *mut c_char, ++ envp: *const *mut c_char, ++ ) -> 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_getsigdefault( ++ attr: *const posix_spawnattr_t, ++ default: *mut crate::sigset_t, ++ ) -> c_int; ++ pub fn posix_spawnattr_setsigdefault( ++ attr: *mut posix_spawnattr_t, ++ default: *const crate::sigset_t, ++ ) -> c_int; ++ pub fn posix_spawnattr_getsigmask( ++ attr: *const posix_spawnattr_t, ++ default: *mut crate::sigset_t, ++ ) -> c_int; ++ pub fn posix_spawnattr_setsigmask( ++ attr: *mut posix_spawnattr_t, ++ default: *const crate::sigset_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, ++ flags: *mut crate::pid_t, ++ ) -> c_int; ++ pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: crate::pid_t) -> c_int; ++ pub fn posix_spawnattr_getschedpolicy( ++ attr: *const posix_spawnattr_t, ++ flags: *mut c_int, ++ ) -> c_int; ++ pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: c_int) -> c_int; ++ pub fn posix_spawnattr_getschedparam( ++ attr: *const posix_spawnattr_t, ++ param: *mut crate::sched_param, ++ ) -> c_int; ++ pub fn posix_spawnattr_setschedparam( ++ attr: *mut posix_spawnattr_t, ++ param: *const crate::sched_param, ++ ) -> c_int; ++ ++ pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> c_int; ++ pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> c_int; ++ pub fn posix_spawn_file_actions_addopen( ++ actions: *mut posix_spawn_file_actions_t, ++ fd: c_int, ++ path: *const c_char, ++ oflag: c_int, ++ mode: crate::mode_t, ++ ) -> c_int; ++ pub fn posix_spawn_file_actions_addclose( ++ actions: *mut posix_spawn_file_actions_t, ++ fd: c_int, ++ ) -> c_int; ++ pub fn posix_spawn_file_actions_adddup2( ++ actions: *mut posix_spawn_file_actions_t, ++ fd: c_int, ++ newfd: c_int, ++ ) -> c_int; ++ ++ pub fn uuidgen(store: *mut uuid, count: c_int) -> c_int; ++ ++ pub fn thr_kill(id: c_long, sig: c_int) -> c_int; ++ pub fn thr_kill2(pid: crate::pid_t, id: c_long, sig: c_int) -> c_int; ++ pub fn thr_self(tid: *mut c_long) -> c_int; ++ pub fn pthread_getthreadid_np() -> c_int; ++ pub fn pthread_getaffinity_np( ++ td: crate::pthread_t, ++ cpusetsize: size_t, ++ cpusetp: *mut cpuset_t, ++ ) -> c_int; ++ pub fn pthread_setaffinity_np( ++ td: crate::pthread_t, ++ cpusetsize: size_t, ++ cpusetp: *const cpuset_t, ++ ) -> c_int; ++ ++ // sched.h linux compatibility api ++ pub fn sched_getaffinity( ++ pid: crate::pid_t, ++ cpusetsz: size_t, ++ cpuset: *mut crate::cpuset_t, ++ ) -> c_int; ++ pub fn sched_setaffinity( ++ pid: crate::pid_t, ++ cpusetsz: size_t, ++ cpuset: *const crate::cpuset_t, ++ ) -> c_int; ++ pub fn sched_getcpu() -> c_int; ++ ++ pub fn pthread_mutex_consistent(mutex: *mut crate::pthread_mutex_t) -> c_int; ++ ++ pub fn pthread_mutexattr_getrobust( ++ attr: *mut crate::pthread_mutexattr_t, ++ robust: *mut c_int, ++ ) -> c_int; ++ pub fn pthread_mutexattr_setrobust( ++ attr: *mut crate::pthread_mutexattr_t, ++ robust: c_int, ++ ) -> c_int; ++ ++ pub fn pthread_spin_init(lock: *mut pthread_spinlock_t, pshared: c_int) -> c_int; ++ pub fn pthread_spin_destroy(lock: *mut pthread_spinlock_t) -> c_int; ++ pub fn pthread_spin_lock(lock: *mut pthread_spinlock_t) -> c_int; ++ pub fn pthread_spin_trylock(lock: *mut pthread_spinlock_t) -> c_int; ++ pub fn pthread_spin_unlock(lock: *mut pthread_spinlock_t) -> c_int; ++ ++ #[cfg_attr(all(target_os = "freebsd", freebsd11), link_name = "statfs@FBSD_1.0")] ++ pub fn statfs(path: *const c_char, buf: *mut statfs) -> c_int; ++ #[cfg_attr(all(target_os = "freebsd", freebsd11), link_name = "fstatfs@FBSD_1.0")] ++ pub fn fstatfs(fd: c_int, buf: *mut statfs) -> c_int; ++ ++ pub fn dup3(src: c_int, dst: c_int, flags: c_int) -> c_int; ++ pub fn __xuname(nmln: c_int, buf: *mut c_void) -> c_int; ++ ++ pub fn sendmmsg( ++ sockfd: c_int, ++ msgvec: *mut crate::mmsghdr, ++ vlen: size_t, ++ flags: c_int, ++ ) -> ssize_t; ++ pub fn recvmmsg( ++ sockfd: c_int, ++ msgvec: *mut crate::mmsghdr, ++ vlen: size_t, ++ flags: c_int, ++ timeout: *const crate::timespec, ++ ) -> ssize_t; ++ pub fn memmem( ++ haystack: *const c_void, ++ haystacklen: size_t, ++ needle: *const c_void, ++ needlelen: size_t, ++ ) -> *mut c_void; ++ ++ pub fn fhopen(fhp: *const fhandle_t, flags: c_int) -> c_int; ++ pub fn fhstat(fhp: *const fhandle, buf: *mut crate::stat) -> c_int; ++ pub fn fhstatfs(fhp: *const fhandle_t, buf: *mut crate::statfs) -> c_int; ++ pub fn getfh(path: *const c_char, fhp: *mut fhandle_t) -> c_int; ++ pub fn lgetfh(path: *const c_char, fhp: *mut fhandle_t) -> c_int; ++ pub fn getfsstat(buf: *mut crate::statfs, bufsize: c_long, mode: c_int) -> c_int; ++ #[cfg_attr( ++ all(target_os = "freebsd", freebsd11), ++ link_name = "getmntinfo@FBSD_1.0" ++ )] ++ pub fn getmntinfo(mntbufp: *mut *mut crate::statfs, mode: c_int) -> c_int; ++ pub fn mount( ++ type_: *const c_char, ++ dir: *const c_char, ++ flags: c_int, ++ data: *mut c_void, ++ ) -> c_int; ++ pub fn nmount(iov: *mut crate::iovec, niov: c_uint, flags: c_int) -> c_int; ++ ++ pub fn setproctitle(fmt: *const c_char, ...); ++ pub fn rfork(flags: c_int) -> c_int; ++ pub fn cpuset_getaffinity( ++ level: cpulevel_t, ++ which: cpuwhich_t, ++ id: crate::id_t, ++ setsize: size_t, ++ mask: *mut cpuset_t, ++ ) -> c_int; ++ pub fn cpuset_setaffinity( ++ level: cpulevel_t, ++ which: cpuwhich_t, ++ id: crate::id_t, ++ setsize: size_t, ++ mask: *const cpuset_t, ++ ) -> c_int; ++ pub fn cpuset(setid: *mut crate::cpusetid_t) -> c_int; ++ pub fn cpuset_getid( ++ level: cpulevel_t, ++ which: cpuwhich_t, ++ id: crate::id_t, ++ setid: *mut crate::cpusetid_t, ++ ) -> c_int; ++ pub fn cpuset_setid(which: cpuwhich_t, id: crate::id_t, setid: crate::cpusetid_t) -> c_int; ++ pub fn cap_enter() -> c_int; ++ pub fn cap_getmode(modep: *mut c_uint) -> c_int; ++ pub fn cap_fcntls_get(fd: c_int, fcntlrightsp: *mut u32) -> c_int; ++ pub fn cap_fcntls_limit(fd: c_int, fcntlrights: u32) -> c_int; ++ pub fn cap_ioctls_get(fd: c_int, cmds: *mut u_long, maxcmds: usize) -> isize; ++ pub fn cap_ioctls_limit(fd: c_int, cmds: *const u_long, ncmds: usize) -> c_int; ++ pub fn __cap_rights_init(version: c_int, rights: *mut cap_rights_t, ...) -> *mut cap_rights_t; ++ pub fn __cap_rights_get(version: c_int, fd: c_int, rightsp: *mut cap_rights_t) -> c_int; ++ pub fn __cap_rights_set(rights: *mut cap_rights_t, ...) -> *mut cap_rights_t; ++ pub fn __cap_rights_clear(rights: *mut cap_rights_t, ...) -> *mut cap_rights_t; ++ pub fn __cap_rights_is_set(rights: *const cap_rights_t, ...) -> bool; ++ pub fn cap_rights_is_valid(rights: *const cap_rights_t) -> bool; ++ pub fn cap_rights_limit(fd: c_int, rights: *const cap_rights_t) -> c_int; ++ pub fn cap_rights_merge(dst: *mut cap_rights_t, src: *const cap_rights_t) -> *mut cap_rights_t; ++ pub fn cap_rights_remove(dst: *mut cap_rights_t, src: *const cap_rights_t) ++ -> *mut cap_rights_t; ++ pub fn cap_rights_contains(big: *const cap_rights_t, little: *const cap_rights_t) -> bool; ++ pub fn cap_sandboxed() -> bool; ++ ++ pub fn reallocarray(ptr: *mut c_void, nmemb: size_t, size: size_t) -> *mut c_void; ++ ++ pub fn ffs(value: c_int) -> c_int; ++ pub fn ffsl(value: c_long) -> c_int; ++ pub fn ffsll(value: c_longlong) -> c_int; ++ pub fn fls(value: c_int) -> c_int; ++ pub fn flsl(value: c_long) -> c_int; ++ pub fn flsll(value: c_longlong) -> c_int; ++ pub fn malloc_stats_print( ++ write_cb: unsafe extern "C" fn(*mut c_void, *const c_char), ++ cbopaque: *mut c_void, ++ opt: *const c_char, ++ ); ++ pub fn mallctl( ++ name: *const c_char, ++ oldp: *mut c_void, ++ oldlenp: *mut size_t, ++ newp: *mut c_void, ++ newlen: size_t, ++ ) -> c_int; ++ pub fn mallctlnametomib(name: *const c_char, mibp: *mut size_t, miplen: *mut size_t) -> c_int; ++ pub fn mallctlbymib( ++ mib: *const size_t, ++ mible: size_t, ++ oldp: *mut c_void, ++ oldlenp: *mut size_t, ++ newp: *mut c_void, ++ newlen: size_t, ++ ) -> c_int; ++ pub fn mallocx(size: size_t, flags: c_int) -> *mut c_void; ++ pub fn rallocx(ptr: *mut c_void, size: size_t, flags: c_int) -> *mut c_void; ++ pub fn xallocx(ptr: *mut c_void, size: size_t, extra: size_t, flags: c_int) -> size_t; ++ pub fn sallocx(ptr: *const c_void, flags: c_int) -> size_t; ++ pub fn dallocx(ptr: *mut c_void, flags: c_int); ++ pub fn sdallocx(ptr: *mut c_void, size: size_t, flags: c_int); ++ pub fn nallocx(size: size_t, flags: c_int) -> size_t; ++ ++ pub fn procctl( ++ idtype: crate::idtype_t, ++ id: crate::id_t, ++ cmd: c_int, ++ data: *mut c_void, ++ ) -> c_int; ++ ++ pub fn getpagesize() -> c_int; ++ pub fn getpagesizes(pagesize: *mut size_t, nelem: c_int) -> c_int; ++ ++ pub fn clock_getcpuclockid2(arg1: crate::id_t, arg2: c_int, arg3: *mut clockid_t) -> c_int; ++ pub fn strchrnul(s: *const c_char, c: c_int) -> *mut c_char; ++ ++ pub fn shm_create_largepage( ++ path: *const c_char, ++ flags: c_int, ++ psind: c_int, ++ alloc_policy: c_int, ++ mode: crate::mode_t, ++ ) -> c_int; ++ pub fn shm_rename(path_from: *const c_char, path_to: *const c_char, flags: c_int) -> c_int; ++ pub fn memfd_create(name: *const c_char, flags: c_uint) -> c_int; ++ pub fn setaudit(auditinfo: *const auditinfo_t) -> c_int; ++ ++ pub fn eventfd(init: c_uint, flags: c_int) -> c_int; ++ pub fn eventfd_read(fd: c_int, value: *mut eventfd_t) -> c_int; ++ pub fn eventfd_write(fd: c_int, value: eventfd_t) -> c_int; ++ ++ pub fn fdatasync(fd: c_int) -> c_int; ++ ++ pub fn elf_aux_info(aux: c_int, buf: *mut c_void, buflen: c_int) -> c_int; ++ pub fn setproctitle_fast(fmt: *const c_char, ...); ++ pub fn timingsafe_bcmp(a: *const c_void, b: *const c_void, len: size_t) -> c_int; ++ pub fn timingsafe_memcmp(a: *const c_void, b: *const c_void, len: size_t) -> c_int; ++ ++ pub fn _umtx_op( ++ obj: *mut c_void, ++ op: c_int, ++ val: c_ulong, ++ uaddr: *mut c_void, ++ uaddr2: *mut c_void, ++ ) -> c_int; ++ ++ pub fn sctp_peeloff(s: c_int, id: crate::sctp_assoc_t) -> c_int; ++ pub fn sctp_bindx(s: c_int, addrs: *mut crate::sockaddr, num: c_int, tpe: c_int) -> c_int; ++ pub fn sctp_connectx( ++ s: c_int, ++ addrs: *const crate::sockaddr, ++ addrcnt: c_int, ++ id: *mut crate::sctp_assoc_t, ++ ) -> c_int; ++ pub fn sctp_getaddrlen(family: crate::sa_family_t) -> c_int; ++ pub fn sctp_getpaddrs( ++ s: c_int, ++ asocid: crate::sctp_assoc_t, ++ addrs: *mut *mut crate::sockaddr, ++ ) -> c_int; ++ pub fn sctp_freepaddrs(addrs: *mut crate::sockaddr); ++ pub fn sctp_getladdrs( ++ s: c_int, ++ asocid: crate::sctp_assoc_t, ++ addrs: *mut *mut crate::sockaddr, ++ ) -> c_int; ++ pub fn sctp_freeladdrs(addrs: *mut crate::sockaddr); ++ pub fn sctp_opt_info( ++ s: c_int, ++ id: crate::sctp_assoc_t, ++ opt: c_int, ++ arg: *mut c_void, ++ size: *mut crate::socklen_t, ++ ) -> c_int; ++ pub fn sctp_sendv( ++ sd: c_int, ++ iov: *const crate::iovec, ++ iovcnt: c_int, ++ addrs: *mut crate::sockaddr, ++ addrcnt: c_int, ++ info: *mut c_void, ++ infolen: crate::socklen_t, ++ infotype: c_uint, ++ flags: c_int, ++ ) -> ssize_t; ++ pub fn sctp_recvv( ++ sd: c_int, ++ iov: *const crate::iovec, ++ iovcnt: c_int, ++ from: *mut crate::sockaddr, ++ fromlen: *mut crate::socklen_t, ++ info: *mut c_void, ++ infolen: *mut crate::socklen_t, ++ infotype: *mut c_uint, ++ flags: *mut c_int, ++ ) -> ssize_t; ++ ++ pub fn timerfd_create(clockid: c_int, flags: c_int) -> c_int; ++ pub fn timerfd_gettime(fd: c_int, curr_value: *mut itimerspec) -> c_int; ++ pub fn timerfd_settime( ++ fd: c_int, ++ flags: c_int, ++ new_value: *const itimerspec, ++ old_value: *mut itimerspec, ++ ) -> c_int; ++ pub fn closefrom(lowfd: c_int); ++ pub fn close_range(lowfd: c_uint, highfd: c_uint, flags: c_int) -> c_int; ++ ++ pub fn execvpe( ++ file: *const c_char, ++ argv: *const *const c_char, ++ envp: *const *const c_char, ++ ) -> c_int; ++ ++ pub fn kcmp( ++ pid1: crate::pid_t, ++ pid2: crate::pid_t, ++ type_: c_int, ++ idx1: c_ulong, ++ idx2: c_ulong, ++ ) -> c_int; ++} ++ ++#[link(name = "memstat")] ++extern "C" { ++ pub fn memstat_strerror(error: c_int) -> *const c_char; ++ pub fn memstat_mtl_alloc() -> *mut memory_type_list; ++ pub fn memstat_mtl_first(list: *mut memory_type_list) -> *mut memory_type; ++ pub fn memstat_mtl_next(mtp: *mut memory_type) -> *mut memory_type; ++ pub fn memstat_mtl_find( ++ list: *mut memory_type_list, ++ allocator: c_int, ++ name: *const c_char, ++ ) -> *mut memory_type; ++ pub fn memstat_mtl_free(list: *mut memory_type_list); ++ pub fn memstat_mtl_geterror(list: *mut memory_type_list) -> c_int; ++ pub fn memstat_get_name(mtp: *const memory_type) -> *const c_char; ++} ++ ++#[link(name = "kvm")] ++extern "C" { ++ pub fn kvm_dpcpu_setcpu(kd: *mut crate::kvm_t, cpu: c_uint) -> c_int; ++ pub fn kvm_getargv( ++ kd: *mut crate::kvm_t, ++ p: *const kinfo_proc, ++ nchr: c_int, ++ ) -> *mut *mut c_char; ++ pub fn kvm_getcptime(kd: *mut crate::kvm_t, cp_time: *mut c_long) -> c_int; ++ pub fn kvm_getenvv( ++ kd: *mut crate::kvm_t, ++ p: *const kinfo_proc, ++ nchr: c_int, ++ ) -> *mut *mut c_char; ++ pub fn kvm_geterr(kd: *mut crate::kvm_t) -> *mut c_char; ++ pub fn kvm_getmaxcpu(kd: *mut crate::kvm_t) -> c_int; ++ pub fn kvm_getncpus(kd: *mut crate::kvm_t) -> c_int; ++ pub fn kvm_getpcpu(kd: *mut crate::kvm_t, cpu: c_int) -> *mut c_void; ++ pub fn kvm_counter_u64_fetch(kd: *mut crate::kvm_t, base: c_ulong) -> u64; ++ pub fn kvm_getswapinfo( ++ kd: *mut crate::kvm_t, ++ info: *mut kvm_swap, ++ maxswap: c_int, ++ flags: c_int, ++ ) -> c_int; ++ pub fn kvm_native(kd: *mut crate::kvm_t) -> c_int; ++ pub fn kvm_nlist(kd: *mut crate::kvm_t, nl: *mut nlist) -> c_int; ++ pub fn kvm_nlist2(kd: *mut crate::kvm_t, nl: *mut kvm_nlist) -> c_int; ++ pub fn kvm_read_zpcpu( ++ kd: *mut crate::kvm_t, ++ base: c_ulong, ++ buf: *mut c_void, ++ size: size_t, ++ cpu: c_int, ++ ) -> ssize_t; ++ pub fn kvm_read2( ++ kd: *mut crate::kvm_t, ++ addr: kvaddr_t, ++ buf: *mut c_void, ++ nbytes: size_t, ++ ) -> ssize_t; ++} ++ ++#[link(name = "util")] ++extern "C" { ++ pub fn extattr_namespace_to_string(attrnamespace: c_int, string: *mut *mut c_char) -> c_int; ++ pub fn extattr_string_to_namespace(string: *const c_char, attrnamespace: *mut c_int) -> c_int; ++ pub fn realhostname(host: *mut c_char, hsize: size_t, ip: *const crate::in_addr) -> c_int; ++ pub fn realhostname_sa( ++ host: *mut c_char, ++ hsize: size_t, ++ addr: *mut crate::sockaddr, ++ addrlen: c_int, ++ ) -> c_int; ++ ++ pub fn kld_isloaded(name: *const c_char) -> c_int; ++ pub fn kld_load(name: *const c_char) -> c_int; ++ ++ pub fn kinfo_getvmmap(pid: crate::pid_t, cntp: *mut c_int) -> *mut kinfo_vmentry; ++ ++ pub fn hexdump(ptr: *const c_void, length: c_int, hdr: *const c_char, flags: c_int); ++ pub fn humanize_number( ++ buf: *mut c_char, ++ len: size_t, ++ number: i64, ++ suffix: *const c_char, ++ scale: c_int, ++ flags: c_int, ++ ) -> c_int; ++ ++ pub fn flopen(path: *const c_char, flags: c_int, ...) -> c_int; ++ pub fn flopenat(fd: c_int, path: *const c_char, flags: c_int, ...) -> c_int; ++ ++ pub fn getlocalbase() -> *const c_char; ++ ++ pub fn pidfile_open( ++ path: *const c_char, ++ mode: crate::mode_t, ++ pidptr: *mut crate::pid_t, ++ ) -> *mut crate::pidfh; ++ pub fn pidfile_write(path: *mut crate::pidfh) -> c_int; ++ pub fn pidfile_close(path: *mut crate::pidfh) -> c_int; ++ pub fn pidfile_remove(path: *mut crate::pidfh) -> c_int; ++ pub fn pidfile_fileno(path: *const crate::pidfh) -> c_int; ++ // FIXME: pidfile_signal in due time (both manpage present and updated image snapshot) ++} ++ ++#[link(name = "procstat")] ++extern "C" { ++ pub fn procstat_open_sysctl() -> *mut procstat; ++ pub fn procstat_getfiles( ++ procstat: *mut procstat, ++ kp: *mut kinfo_proc, ++ mmapped: c_int, ++ ) -> *mut filestat_list; ++ pub fn procstat_freefiles(procstat: *mut procstat, head: *mut filestat_list); ++ pub fn procstat_getprocs( ++ procstat: *mut procstat, ++ what: c_int, ++ arg: c_int, ++ count: *mut c_uint, ++ ) -> *mut kinfo_proc; ++ pub fn procstat_freeprocs(procstat: *mut procstat, p: *mut kinfo_proc); ++ pub fn procstat_getvmmap( ++ procstat: *mut procstat, ++ kp: *mut kinfo_proc, ++ count: *mut c_uint, ++ ) -> *mut kinfo_vmentry; ++ pub fn procstat_freevmmap(procstat: *mut procstat, vmmap: *mut kinfo_vmentry); ++ pub fn procstat_close(procstat: *mut procstat); ++ pub fn procstat_freeargv(procstat: *mut procstat); ++ pub fn procstat_freeenvv(procstat: *mut procstat); ++ pub fn procstat_freegroups(procstat: *mut procstat, groups: *mut crate::gid_t); ++ pub fn procstat_freeptlwpinfo(procstat: *mut procstat, pl: *mut ptrace_lwpinfo); ++ pub fn procstat_getargv( ++ procstat: *mut procstat, ++ kp: *mut kinfo_proc, ++ nchr: size_t, ++ ) -> *mut *mut c_char; ++ pub fn procstat_getenvv( ++ procstat: *mut procstat, ++ kp: *mut kinfo_proc, ++ nchr: size_t, ++ ) -> *mut *mut c_char; ++ pub fn procstat_getgroups( ++ procstat: *mut procstat, ++ kp: *mut kinfo_proc, ++ count: *mut c_uint, ++ ) -> *mut crate::gid_t; ++ pub fn procstat_getosrel( ++ procstat: *mut procstat, ++ kp: *mut kinfo_proc, ++ osrelp: *mut c_int, ++ ) -> c_int; ++ pub fn procstat_getpathname( ++ procstat: *mut procstat, ++ kp: *mut kinfo_proc, ++ pathname: *mut c_char, ++ maxlen: size_t, ++ ) -> c_int; ++ pub fn procstat_getrlimit( ++ procstat: *mut procstat, ++ kp: *mut kinfo_proc, ++ which: c_int, ++ rlimit: *mut crate::rlimit, ++ ) -> c_int; ++ pub fn procstat_getumask( ++ procstat: *mut procstat, ++ kp: *mut kinfo_proc, ++ maskp: *mut c_ushort, ++ ) -> c_int; ++ pub fn procstat_open_core(filename: *const c_char) -> *mut procstat; ++ pub fn procstat_open_kvm(nlistf: *const c_char, memf: *const c_char) -> *mut procstat; ++ pub fn procstat_get_socket_info( ++ proc_: *mut procstat, ++ fst: *mut filestat, ++ sock: *mut sockstat, ++ errbuf: *mut c_char, ++ ) -> c_int; ++ pub fn procstat_get_vnode_info( ++ proc_: *mut procstat, ++ fst: *mut filestat, ++ vn: *mut vnstat, ++ errbuf: *mut c_char, ++ ) -> c_int; ++ pub fn procstat_get_pts_info( ++ proc_: *mut procstat, ++ fst: *mut filestat, ++ pts: *mut ptsstat, ++ errbuf: *mut c_char, ++ ) -> c_int; ++ pub fn procstat_get_shm_info( ++ proc_: *mut procstat, ++ fst: *mut filestat, ++ shm: *mut shmstat, ++ errbuf: *mut c_char, ++ ) -> c_int; ++} ++ ++#[link(name = "rt")] ++extern "C" { ++ pub fn timer_create(clock_id: clockid_t, evp: *mut sigevent, timerid: *mut timer_t) -> c_int; ++ pub fn timer_delete(timerid: timer_t) -> c_int; ++ pub fn timer_getoverrun(timerid: timer_t) -> c_int; ++ pub fn timer_gettime(timerid: timer_t, value: *mut itimerspec) -> c_int; ++ pub fn timer_settime( ++ timerid: timer_t, ++ flags: c_int, ++ value: *const itimerspec, ++ ovalue: *mut itimerspec, ++ ) -> c_int; ++} ++ ++#[link(name = "devstat")] ++extern "C" { ++ pub fn devstat_getnumdevs(kd: *mut crate::kvm_t) -> c_int; ++ pub fn devstat_getgeneration(kd: *mut crate::kvm_t) -> c_long; ++ pub fn devstat_getversion(kd: *mut crate::kvm_t) -> c_int; ++ pub fn devstat_checkversion(kd: *mut crate::kvm_t) -> c_int; ++ pub fn devstat_selectdevs( ++ dev_select: *mut *mut device_selection, ++ num_selected: *mut c_int, ++ num_selections: *mut c_int, ++ select_generation: *mut c_long, ++ current_generation: c_long, ++ devices: *mut devstat, ++ numdevs: c_int, ++ matches: *mut devstat_match, ++ num_matches: c_int, ++ dev_selections: *mut *mut c_char, ++ num_dev_selections: c_int, ++ select_mode: devstat_select_mode, ++ maxshowdevs: c_int, ++ perf_select: c_int, ++ ) -> c_int; ++ pub fn devstat_buildmatch( ++ match_str: *mut c_char, ++ matches: *mut *mut devstat_match, ++ num_matches: *mut c_int, ++ ) -> c_int; ++} ++ ++cfg_if! { ++ if #[cfg(freebsd15)] { ++ mod freebsd15; ++ pub use self::freebsd15::*; ++ } else if #[cfg(freebsd14)] { ++ mod freebsd14; ++ pub use self::freebsd14::*; ++ } else if #[cfg(freebsd13)] { ++ mod freebsd13; ++ pub use self::freebsd13::*; ++ } else if #[cfg(freebsd12)] { ++ mod freebsd12; ++ pub use self::freebsd12::*; ++ } else if #[cfg(any(freebsd10, freebsd11))] { ++ mod freebsd11; ++ pub use self::freebsd11::*; ++ } else { ++ // Unknown freebsd version ++ } ++} ++ ++cfg_if! { ++ if #[cfg(target_arch = "x86")] { ++ mod x86; ++ pub use self::x86::*; ++ } else if #[cfg(target_arch = "x86_64")] { ++ mod x86_64; ++ pub use self::x86_64::*; ++ } else if #[cfg(target_arch = "aarch64")] { ++ mod aarch64; ++ pub use self::aarch64::*; ++ } else if #[cfg(target_arch = "arm")] { ++ mod arm; ++ pub use self::arm::*; ++ } else if #[cfg(target_arch = "powerpc64")] { ++ mod powerpc64; ++ pub use self::powerpc64::*; ++ } else if #[cfg(target_arch = "powerpc")] { ++ mod powerpc; ++ pub use self::powerpc::*; ++ } else if #[cfg(target_arch = "riscv64")] { ++ mod riscv64; ++ pub use self::riscv64::*; ++ } else { ++ // Unknown target_arch ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/powerpc64.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,81 @@ ++use crate::prelude::*; ++ ++pub type c_char = u8; ++pub type c_long = i64; ++pub type c_ulong = u64; ++pub type clock_t = u32; ++pub type wchar_t = i32; ++pub type time_t = i64; ++pub type suseconds_t = i64; ++pub type register_t = i64; ++ ++s_no_extra_traits! { ++ #[repr(align(16))] ++ pub struct mcontext_t { ++ pub mc_vers: c_int, ++ pub mc_flags: c_int, ++ pub mc_onstack: c_int, ++ pub mc_len: c_int, ++ pub mc_avec: [u64; 64], ++ pub mc_av: [u32; 2], ++ pub mc_frame: [crate::register_t; 42], ++ pub mc_fpreg: [u64; 33], ++ pub mc_vsxfpreg: [u64; 32], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for mcontext_t { ++ fn eq(&self, other: &mcontext_t) -> bool { ++ self.mc_vers == other.mc_vers ++ && self.mc_flags == other.mc_flags ++ && self.mc_onstack == other.mc_onstack ++ && self.mc_len == other.mc_len ++ && self.mc_avec == other.mc_avec ++ && self.mc_av == other.mc_av ++ && self.mc_frame == other.mc_frame ++ && self.mc_fpreg == other.mc_fpreg ++ && self.mc_vsxfpreg == other.mc_vsxfpreg ++ } ++ } ++ impl Eq for mcontext_t {} ++ impl fmt::Debug for mcontext_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("mcontext_t") ++ .field("mc_vers", &self.mc_vers) ++ .field("mc_flags", &self.mc_flags) ++ .field("mc_onstack", &self.mc_onstack) ++ .field("mc_len", &self.mc_len) ++ .field("mc_avec", &self.mc_avec) ++ .field("mc_av", &self.mc_av) ++ .field("mc_frame", &self.mc_frame) ++ .field("mc_fpreg", &self.mc_fpreg) ++ .field("mc_vsxfpreg", &self.mc_vsxfpreg) ++ .finish() ++ } ++ } ++ impl hash::Hash for mcontext_t { ++ fn hash(&self, state: &mut H) { ++ self.mc_vers.hash(state); ++ self.mc_flags.hash(state); ++ self.mc_onstack.hash(state); ++ self.mc_len.hash(state); ++ self.mc_avec.hash(state); ++ self.mc_av.hash(state); ++ self.mc_frame.hash(state); ++ self.mc_fpreg.hash(state); ++ self.mc_vsxfpreg.hash(state); ++ } ++ } ++ } ++} ++ ++pub(crate) const _ALIGNBYTES: usize = mem::size_of::() - 1; ++ ++pub const BIOCSRTIMEOUT: c_ulong = 0x8010426d; ++pub const BIOCGRTIMEOUT: c_ulong = 0x4010426e; ++ ++pub const MAP_32BIT: c_int = 0x00080000; ++pub const MINSIGSTKSZ: size_t = 2048; // 512 * 4 ++pub const TIOCTIMESTAMP: c_ulong = 0x40107459; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/powerpc.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/powerpc.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/powerpc.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/powerpc.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,80 @@ ++use crate::prelude::*; ++ ++pub type c_char = u8; ++pub type c_long = i32; ++pub type c_ulong = u32; ++pub type clock_t = u32; ++pub type wchar_t = i32; ++pub type time_t = i64; ++pub type suseconds_t = i32; ++pub type register_t = i32; ++ ++s_no_extra_traits! { ++ #[repr(align(16))] ++ pub struct mcontext_t { ++ pub mc_vers: c_int, ++ pub mc_flags: c_int, ++ pub mc_onstack: c_int, ++ pub mc_len: c_int, ++ pub mc_avec: [u64; 64], ++ pub mc_av: [u32; 2], ++ pub mc_frame: [crate::register_t; 42], ++ pub mc_fpreg: [u64; 33], ++ pub mc_vsxfpreg: [u64; 32], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for mcontext_t { ++ fn eq(&self, other: &mcontext_t) -> bool { ++ self.mc_vers == other.mc_vers ++ && self.mc_flags == other.mc_flags ++ && self.mc_onstack == other.mc_onstack ++ && self.mc_len == other.mc_len ++ && self.mc_avec == other.mc_avec ++ && self.mc_av == other.mc_av ++ && self.mc_frame == other.mc_frame ++ && self.mc_fpreg == other.mc_fpreg ++ && self.mc_vsxfpreg == other.mc_vsxfpreg ++ } ++ } ++ impl Eq for mcontext_t {} ++ impl fmt::Debug for mcontext_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("mcontext_t") ++ .field("mc_vers", &self.mc_vers) ++ .field("mc_flags", &self.mc_flags) ++ .field("mc_onstack", &self.mc_onstack) ++ .field("mc_len", &self.mc_len) ++ .field("mc_avec", &self.mc_avec) ++ .field("mc_av", &self.mc_av) ++ .field("mc_frame", &self.mc_frame) ++ .field("mc_fpreg", &self.mc_fpreg) ++ .field("mc_vsxfpreg", &self.mc_vsxfpreg) ++ .finish() ++ } ++ } ++ impl hash::Hash for mcontext_t { ++ fn hash(&self, state: &mut H) { ++ self.mc_vers.hash(state); ++ self.mc_flags.hash(state); ++ self.mc_onstack.hash(state); ++ self.mc_len.hash(state); ++ self.mc_avec.hash(state); ++ self.mc_av.hash(state); ++ self.mc_frame.hash(state); ++ self.mc_fpreg.hash(state); ++ self.mc_vsxfpreg.hash(state); ++ } ++ } ++ } ++} ++ ++pub(crate) const _ALIGNBYTES: usize = mem::size_of::() - 1; ++ ++pub const BIOCSRTIMEOUT: c_ulong = 0x8010426d; ++pub const BIOCGRTIMEOUT: c_ulong = 0x4010426e; ++pub const MAP_32BIT: c_int = 0x00080000; ++pub const MINSIGSTKSZ: size_t = 2048; // 512 * 4 ++pub const TIOCTIMESTAMP: c_ulong = 0x40107459; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/riscv64.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/riscv64.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/riscv64.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/riscv64.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,155 @@ ++use crate::prelude::*; ++ ++pub type c_char = u8; ++pub type c_long = i64; ++pub type c_ulong = u64; ++pub type clock_t = i32; ++pub type wchar_t = c_int; ++pub type time_t = i64; ++pub type suseconds_t = c_long; ++pub type register_t = i64; ++ ++s_no_extra_traits! { ++ pub struct gpregs { ++ pub gp_ra: crate::register_t, ++ pub gp_sp: crate::register_t, ++ pub gp_gp: crate::register_t, ++ pub gp_tp: crate::register_t, ++ pub gp_t: [crate::register_t; 7], ++ pub gp_s: [crate::register_t; 12], ++ pub gp_a: [crate::register_t; 8], ++ pub gp_sepc: crate::register_t, ++ pub gp_sstatus: crate::register_t, ++ } ++ ++ pub struct fpregs { ++ pub fp_x: [[u64; 2]; 32], ++ pub fp_fcsr: u64, ++ pub fp_flags: c_int, ++ pub pad: c_int, ++ } ++ ++ pub struct mcontext_t { ++ pub mc_gpregs: gpregs, ++ pub mc_fpregs: fpregs, ++ pub mc_flags: c_int, ++ pub mc_pad: c_int, ++ pub mc_spare: [u64; 8], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for gpregs { ++ fn eq(&self, other: &gpregs) -> bool { ++ self.gp_ra == other.gp_ra ++ && self.gp_sp == other.gp_sp ++ && self.gp_gp == other.gp_gp ++ && self.gp_tp == other.gp_tp ++ && self.gp_t.iter().zip(other.gp_t.iter()).all(|(a, b)| a == b) ++ && self.gp_s.iter().zip(other.gp_s.iter()).all(|(a, b)| a == b) ++ && self.gp_a.iter().zip(other.gp_a.iter()).all(|(a, b)| a == b) ++ && self.gp_sepc == other.gp_sepc ++ && self.gp_sstatus == other.gp_sstatus ++ } ++ } ++ impl Eq for gpregs {} ++ impl fmt::Debug for gpregs { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("gpregs") ++ .field("gp_ra", &self.gp_ra) ++ .field("gp_sp", &self.gp_sp) ++ .field("gp_gp", &self.gp_gp) ++ .field("gp_tp", &self.gp_tp) ++ .field("gp_t", &self.gp_t) ++ .field("gp_s", &self.gp_s) ++ .field("gp_a", &self.gp_a) ++ .field("gp_sepc", &self.gp_sepc) ++ .field("gp_sstatus", &self.gp_sstatus) ++ .finish() ++ } ++ } ++ impl hash::Hash for gpregs { ++ fn hash(&self, state: &mut H) { ++ self.gp_ra.hash(state); ++ self.gp_sp.hash(state); ++ self.gp_gp.hash(state); ++ self.gp_tp.hash(state); ++ self.gp_t.hash(state); ++ self.gp_s.hash(state); ++ self.gp_a.hash(state); ++ self.gp_sepc.hash(state); ++ self.gp_sstatus.hash(state); ++ } ++ } ++ impl PartialEq for fpregs { ++ fn eq(&self, other: &fpregs) -> bool { ++ self.fp_x == other.fp_x ++ && self.fp_fcsr == other.fp_fcsr ++ && self.fp_flags == other.fp_flags ++ && self.pad == other.pad ++ } ++ } ++ impl Eq for fpregs {} ++ impl fmt::Debug for fpregs { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("fpregs") ++ .field("fp_x", &self.fp_x) ++ .field("fp_fcsr", &self.fp_fcsr) ++ .field("fp_flags", &self.fp_flags) ++ .field("pad", &self.pad) ++ .finish() ++ } ++ } ++ impl hash::Hash for fpregs { ++ fn hash(&self, state: &mut H) { ++ self.fp_x.hash(state); ++ self.fp_fcsr.hash(state); ++ self.fp_flags.hash(state); ++ self.pad.hash(state); ++ } ++ } ++ impl PartialEq for mcontext_t { ++ fn eq(&self, other: &mcontext_t) -> bool { ++ self.mc_gpregs == other.mc_gpregs ++ && self.mc_fpregs == other.mc_fpregs ++ && self.mc_flags == other.mc_flags ++ && self.mc_pad == other.mc_pad ++ && self ++ .mc_spare ++ .iter() ++ .zip(other.mc_spare.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for mcontext_t {} ++ impl fmt::Debug for mcontext_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("mcontext_t") ++ .field("mc_gpregs", &self.mc_gpregs) ++ .field("mc_fpregs", &self.mc_fpregs) ++ .field("mc_flags", &self.mc_flags) ++ .field("mc_pad", &self.mc_pad) ++ .field("mc_spare", &self.mc_spare) ++ .finish() ++ } ++ } ++ impl hash::Hash for mcontext_t { ++ fn hash(&self, state: &mut H) { ++ self.mc_gpregs.hash(state); ++ self.mc_fpregs.hash(state); ++ self.mc_flags.hash(state); ++ self.mc_pad.hash(state); ++ self.mc_spare.hash(state); ++ } ++ } ++ } ++} ++ ++pub(crate) const _ALIGNBYTES: usize = mem::size_of::() - 1; ++ ++pub const BIOCSRTIMEOUT: c_ulong = 0x8010426d; ++pub const BIOCGRTIMEOUT: c_ulong = 0x4010426e; ++pub const MAP_32BIT: c_int = 0x00080000; ++pub const MINSIGSTKSZ: size_t = 4096; // 1024 * 4 ++pub const TIOCTIMESTAMP: c_ulong = 0x40107459; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/x86_64/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,425 @@ ++use crate::prelude::*; ++ ++pub type c_char = i8; ++pub type c_long = i64; ++pub type c_ulong = u64; ++pub type clock_t = i32; ++pub type wchar_t = i32; ++pub type time_t = i64; ++pub type suseconds_t = i64; ++pub type register_t = i64; ++ ++s! { ++ pub struct reg32 { ++ pub r_fs: u32, ++ pub r_es: u32, ++ pub r_ds: u32, ++ pub r_edi: u32, ++ pub r_esi: u32, ++ pub r_ebp: u32, ++ pub r_isp: u32, ++ pub r_ebx: u32, ++ pub r_edx: u32, ++ pub r_ecx: u32, ++ pub r_eax: u32, ++ pub r_trapno: u32, ++ pub r_err: u32, ++ pub r_eip: u32, ++ pub r_cs: u32, ++ pub r_eflags: u32, ++ pub r_esp: u32, ++ pub r_ss: u32, ++ pub r_gs: u32, ++ } ++ ++ pub struct reg { ++ pub r_r15: i64, ++ pub r_r14: i64, ++ pub r_r13: i64, ++ pub r_r12: i64, ++ pub r_r11: i64, ++ pub r_r10: i64, ++ pub r_r9: i64, ++ pub r_r8: i64, ++ pub r_rdi: i64, ++ pub r_rsi: i64, ++ pub r_rbp: i64, ++ pub r_rbx: i64, ++ pub r_rdx: i64, ++ pub r_rcx: i64, ++ pub r_rax: i64, ++ pub r_trapno: u32, ++ pub r_fs: u16, ++ pub r_gs: u16, ++ pub r_err: u32, ++ pub r_es: u16, ++ pub r_ds: u16, ++ pub r_rip: i64, ++ pub r_cs: i64, ++ pub r_rflags: i64, ++ pub r_rsp: i64, ++ pub r_ss: i64, ++ } ++} ++ ++s_no_extra_traits! { ++ pub struct fpreg32 { ++ pub fpr_env: [u32; 7], ++ pub fpr_acc: [[u8; 10]; 8], ++ pub fpr_ex_sw: u32, ++ pub fpr_pad: [u8; 64], ++ } ++ ++ pub struct fpreg { ++ pub fpr_env: [u64; 4], ++ pub fpr_acc: [[u8; 16]; 8], ++ pub fpr_xacc: [[u8; 16]; 16], ++ pub fpr_spare: [u64; 12], ++ } ++ ++ pub struct xmmreg { ++ pub xmm_env: [u32; 8], ++ pub xmm_acc: [[u8; 16]; 8], ++ pub xmm_reg: [[u8; 16]; 8], ++ pub xmm_pad: [u8; 224], ++ } ++ ++ pub union __c_anonymous_elf64_auxv_union { ++ pub a_val: c_long, ++ pub a_ptr: *mut c_void, ++ pub a_fcn: extern "C" fn(), ++ } ++ ++ pub struct Elf64_Auxinfo { ++ pub a_type: c_long, ++ pub a_un: __c_anonymous_elf64_auxv_union, ++ } ++ ++ #[allow(missing_debug_implementations)] ++ #[repr(align(16))] ++ pub struct max_align_t { ++ priv_: [f64; 4], ++ } ++ ++ #[repr(align(16))] ++ pub struct mcontext_t { ++ pub mc_onstack: register_t, ++ pub mc_rdi: register_t, ++ pub mc_rsi: register_t, ++ pub mc_rdx: register_t, ++ pub mc_rcx: register_t, ++ pub mc_r8: register_t, ++ pub mc_r9: register_t, ++ pub mc_rax: register_t, ++ pub mc_rbx: register_t, ++ pub mc_rbp: register_t, ++ pub mc_r10: register_t, ++ pub mc_r11: register_t, ++ pub mc_r12: register_t, ++ pub mc_r13: register_t, ++ pub mc_r14: register_t, ++ pub mc_r15: register_t, ++ pub mc_trapno: u32, ++ pub mc_fs: u16, ++ pub mc_gs: u16, ++ pub mc_addr: register_t, ++ pub mc_flags: u32, ++ pub mc_es: u16, ++ pub mc_ds: u16, ++ pub mc_err: register_t, ++ pub mc_rip: register_t, ++ pub mc_cs: register_t, ++ pub mc_rflags: register_t, ++ pub mc_rsp: register_t, ++ pub mc_ss: register_t, ++ pub mc_len: c_long, ++ pub mc_fpformat: c_long, ++ pub mc_ownedfp: c_long, ++ pub mc_fpstate: [c_long; 64], ++ pub mc_fsbase: register_t, ++ pub mc_gsbase: register_t, ++ pub mc_xfpustate: register_t, ++ pub mc_xfpustate_len: register_t, ++ pub mc_spare: [c_long; 4], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for fpreg32 { ++ fn eq(&self, other: &fpreg32) -> bool { ++ self.fpr_env == other.fpr_env ++ && self.fpr_acc == other.fpr_acc ++ && self.fpr_ex_sw == other.fpr_ex_sw ++ && self ++ .fpr_pad ++ .iter() ++ .zip(other.fpr_pad.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for fpreg32 {} ++ impl fmt::Debug for fpreg32 { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("fpreg32") ++ .field("fpr_env", &&self.fpr_env[..]) ++ .field("fpr_acc", &self.fpr_acc) ++ .field("fpr_ex_sw", &self.fpr_ex_sw) ++ .field("fpr_pad", &&self.fpr_pad[..]) ++ .finish() ++ } ++ } ++ impl hash::Hash for fpreg32 { ++ fn hash(&self, state: &mut H) { ++ self.fpr_env.hash(state); ++ self.fpr_acc.hash(state); ++ self.fpr_ex_sw.hash(state); ++ self.fpr_pad.hash(state); ++ } ++ } ++ ++ impl PartialEq for fpreg { ++ fn eq(&self, other: &fpreg) -> bool { ++ self.fpr_env == other.fpr_env ++ && self.fpr_acc == other.fpr_acc ++ && self.fpr_xacc == other.fpr_xacc ++ && self.fpr_spare == other.fpr_spare ++ } ++ } ++ impl Eq for fpreg {} ++ impl fmt::Debug for fpreg { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("fpreg") ++ .field("fpr_env", &self.fpr_env) ++ .field("fpr_acc", &self.fpr_acc) ++ .field("fpr_xacc", &self.fpr_xacc) ++ .field("fpr_spare", &self.fpr_spare) ++ .finish() ++ } ++ } ++ impl hash::Hash for fpreg { ++ fn hash(&self, state: &mut H) { ++ self.fpr_env.hash(state); ++ self.fpr_acc.hash(state); ++ self.fpr_xacc.hash(state); ++ self.fpr_spare.hash(state); ++ } ++ } ++ ++ impl PartialEq for xmmreg { ++ fn eq(&self, other: &xmmreg) -> bool { ++ self.xmm_env == other.xmm_env ++ && self.xmm_acc == other.xmm_acc ++ && self.xmm_reg == other.xmm_reg ++ && self ++ .xmm_pad ++ .iter() ++ .zip(other.xmm_pad.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for xmmreg {} ++ impl fmt::Debug for xmmreg { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("xmmreg") ++ .field("xmm_env", &self.xmm_env) ++ .field("xmm_acc", &self.xmm_acc) ++ .field("xmm_reg", &self.xmm_reg) ++ .field("xmm_pad", &&self.xmm_pad[..]) ++ .finish() ++ } ++ } ++ impl hash::Hash for xmmreg { ++ fn hash(&self, state: &mut H) { ++ self.xmm_env.hash(state); ++ self.xmm_acc.hash(state); ++ self.xmm_reg.hash(state); ++ self.xmm_pad.hash(state); ++ } ++ } ++ ++ // FIXME(msrv): suggested method was added in 1.85 ++ #[allow(unpredictable_function_pointer_comparisons)] ++ impl PartialEq for __c_anonymous_elf64_auxv_union { ++ fn eq(&self, other: &__c_anonymous_elf64_auxv_union) -> bool { ++ unsafe { ++ self.a_val == other.a_val ++ || self.a_ptr == other.a_ptr ++ || self.a_fcn == other.a_fcn ++ } ++ } ++ } ++ impl Eq for __c_anonymous_elf64_auxv_union {} ++ impl PartialEq for Elf64_Auxinfo { ++ fn eq(&self, other: &Elf64_Auxinfo) -> bool { ++ self.a_type == other.a_type && self.a_un == other.a_un ++ } ++ } ++ impl Eq for Elf64_Auxinfo {} ++ impl fmt::Debug for Elf64_Auxinfo { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("Elf64_Auxinfo") ++ .field("a_type", &self.a_type) ++ .field("a_un", &self.a_un) ++ .finish() ++ } ++ } ++ ++ impl PartialEq for mcontext_t { ++ fn eq(&self, other: &mcontext_t) -> bool { ++ self.mc_onstack == other.mc_onstack ++ && self.mc_rdi == other.mc_rdi ++ && self.mc_rsi == other.mc_rsi ++ && self.mc_rdx == other.mc_rdx ++ && self.mc_rcx == other.mc_rcx ++ && self.mc_r8 == other.mc_r8 ++ && self.mc_r9 == other.mc_r9 ++ && self.mc_rax == other.mc_rax ++ && self.mc_rbx == other.mc_rbx ++ && self.mc_rbp == other.mc_rbp ++ && self.mc_r10 == other.mc_r10 ++ && self.mc_r11 == other.mc_r11 ++ && self.mc_r12 == other.mc_r12 ++ && self.mc_r13 == other.mc_r13 ++ && self.mc_r14 == other.mc_r14 ++ && self.mc_r15 == other.mc_r15 ++ && self.mc_trapno == other.mc_trapno ++ && self.mc_fs == other.mc_fs ++ && self.mc_gs == other.mc_gs ++ && self.mc_addr == other.mc_addr ++ && self.mc_flags == other.mc_flags ++ && self.mc_es == other.mc_es ++ && self.mc_ds == other.mc_ds ++ && self.mc_err == other.mc_err ++ && self.mc_rip == other.mc_rip ++ && self.mc_cs == other.mc_cs ++ && self.mc_rflags == other.mc_rflags ++ && self.mc_rsp == other.mc_rsp ++ && self.mc_ss == other.mc_ss ++ && self.mc_len == other.mc_len ++ && self.mc_fpformat == other.mc_fpformat ++ && self.mc_ownedfp == other.mc_ownedfp ++ && self ++ .mc_fpstate ++ .iter() ++ .zip(other.mc_fpstate.iter()) ++ .all(|(a, b)| a == b) ++ && self.mc_fsbase == other.mc_fsbase ++ && self.mc_gsbase == other.mc_gsbase ++ && self.mc_xfpustate == other.mc_xfpustate ++ && self.mc_xfpustate_len == other.mc_xfpustate_len ++ && self.mc_spare == other.mc_spare ++ } ++ } ++ impl Eq for mcontext_t {} ++ impl fmt::Debug for mcontext_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("mcontext_t") ++ .field("mc_onstack", &self.mc_onstack) ++ .field("mc_rdi", &self.mc_rdi) ++ .field("mc_rsi", &self.mc_rsi) ++ .field("mc_rdx", &self.mc_rdx) ++ .field("mc_rcx", &self.mc_rcx) ++ .field("mc_r8", &self.mc_r8) ++ .field("mc_r9", &self.mc_r9) ++ .field("mc_rax", &self.mc_rax) ++ .field("mc_rbx", &self.mc_rbx) ++ .field("mc_rbp", &self.mc_rbp) ++ .field("mc_r10", &self.mc_r10) ++ .field("mc_r11", &self.mc_r11) ++ .field("mc_r12", &self.mc_r12) ++ .field("mc_r13", &self.mc_r13) ++ .field("mc_r14", &self.mc_r14) ++ .field("mc_r15", &self.mc_r15) ++ .field("mc_trapno", &self.mc_trapno) ++ .field("mc_fs", &self.mc_fs) ++ .field("mc_gs", &self.mc_gs) ++ .field("mc_addr", &self.mc_addr) ++ .field("mc_flags", &self.mc_flags) ++ .field("mc_es", &self.mc_es) ++ .field("mc_ds", &self.mc_ds) ++ .field("mc_err", &self.mc_err) ++ .field("mc_rip", &self.mc_rip) ++ .field("mc_cs", &self.mc_cs) ++ .field("mc_rflags", &self.mc_rflags) ++ .field("mc_rsp", &self.mc_rsp) ++ .field("mc_ss", &self.mc_ss) ++ .field("mc_len", &self.mc_len) ++ .field("mc_fpformat", &self.mc_fpformat) ++ .field("mc_ownedfp", &self.mc_ownedfp) ++ // FIXME: .field("mc_fpstate", &self.mc_fpstate) ++ .field("mc_fsbase", &self.mc_fsbase) ++ .field("mc_gsbase", &self.mc_gsbase) ++ .field("mc_xfpustate", &self.mc_xfpustate) ++ .field("mc_xfpustate_len", &self.mc_xfpustate_len) ++ .field("mc_spare", &self.mc_spare) ++ .finish() ++ } ++ } ++ impl hash::Hash for mcontext_t { ++ fn hash(&self, state: &mut H) { ++ self.mc_onstack.hash(state); ++ self.mc_rdi.hash(state); ++ self.mc_rsi.hash(state); ++ self.mc_rdx.hash(state); ++ self.mc_rcx.hash(state); ++ self.mc_r8.hash(state); ++ self.mc_r9.hash(state); ++ self.mc_rax.hash(state); ++ self.mc_rbx.hash(state); ++ self.mc_rbp.hash(state); ++ self.mc_r10.hash(state); ++ self.mc_r11.hash(state); ++ self.mc_r12.hash(state); ++ self.mc_r13.hash(state); ++ self.mc_r14.hash(state); ++ self.mc_r15.hash(state); ++ self.mc_trapno.hash(state); ++ self.mc_fs.hash(state); ++ self.mc_gs.hash(state); ++ self.mc_addr.hash(state); ++ self.mc_flags.hash(state); ++ self.mc_es.hash(state); ++ self.mc_ds.hash(state); ++ self.mc_err.hash(state); ++ self.mc_rip.hash(state); ++ self.mc_cs.hash(state); ++ self.mc_rflags.hash(state); ++ self.mc_rsp.hash(state); ++ self.mc_ss.hash(state); ++ self.mc_len.hash(state); ++ self.mc_fpformat.hash(state); ++ self.mc_ownedfp.hash(state); ++ self.mc_fpstate.hash(state); ++ self.mc_fsbase.hash(state); ++ self.mc_gsbase.hash(state); ++ self.mc_xfpustate.hash(state); ++ self.mc_xfpustate_len.hash(state); ++ self.mc_spare.hash(state); ++ } ++ } ++ } ++} ++ ++pub(crate) const _ALIGNBYTES: usize = mem::size_of::() - 1; ++ ++pub const BIOCSRTIMEOUT: c_ulong = 0x8010426d; ++pub const BIOCGRTIMEOUT: c_ulong = 0x4010426e; ++ ++pub const MAP_32BIT: c_int = 0x00080000; ++pub const MINSIGSTKSZ: size_t = 2048; // 512 * 4 ++ ++pub const _MC_HASSEGS: u32 = 0x1; ++pub const _MC_HASBASES: u32 = 0x2; ++pub const _MC_HASFPXSTATE: u32 = 0x4; ++pub const _MC_FLAG_MASK: u32 = _MC_HASSEGS | _MC_HASBASES | _MC_HASFPXSTATE; ++ ++pub const _MC_FPFMT_NODEV: c_long = 0x10000; ++pub const _MC_FPFMT_XMM: c_long = 0x10002; ++pub const _MC_FPOWNED_NONE: c_long = 0x20000; ++pub const _MC_FPOWNED_FPU: c_long = 0x20001; ++pub const _MC_FPOWNED_PCB: c_long = 0x20002; ++ ++pub const KINFO_FILE_SIZE: c_int = 1392; ++ ++pub const TIOCTIMESTAMP: c_ulong = 0x40107459; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/x86.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/x86.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/x86.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/freebsd/x86.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,173 @@ ++use crate::prelude::*; ++ ++pub type c_char = i8; ++pub type c_long = i32; ++pub type c_ulong = u32; ++pub type clock_t = c_ulong; ++pub type wchar_t = i32; ++pub type time_t = i32; ++pub type suseconds_t = i32; ++pub type register_t = i32; ++ ++s_no_extra_traits! { ++ #[repr(align(16))] ++ pub struct mcontext_t { ++ pub mc_onstack: register_t, ++ pub mc_gs: register_t, ++ pub mc_fs: register_t, ++ pub mc_es: register_t, ++ pub mc_ds: register_t, ++ pub mc_edi: register_t, ++ pub mc_esi: register_t, ++ pub mc_ebp: register_t, ++ pub mc_isp: register_t, ++ pub mc_ebx: register_t, ++ pub mc_edx: register_t, ++ pub mc_ecx: register_t, ++ pub mc_eax: register_t, ++ pub mc_trapno: register_t, ++ pub mc_err: register_t, ++ pub mc_eip: register_t, ++ pub mc_cs: register_t, ++ pub mc_eflags: register_t, ++ pub mc_esp: register_t, ++ pub mc_ss: register_t, ++ pub mc_len: c_int, ++ pub mc_fpformat: c_int, ++ pub mc_ownedfp: c_int, ++ pub mc_flags: register_t, ++ pub mc_fpstate: [c_int; 128], ++ pub mc_fsbase: register_t, ++ pub mc_gsbase: register_t, ++ pub mc_xfpustate: register_t, ++ pub mc_xfpustate_len: register_t, ++ pub mc_spare2: [c_int; 4], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for mcontext_t { ++ fn eq(&self, other: &mcontext_t) -> bool { ++ self.mc_onstack == other.mc_onstack ++ && self.mc_gs == other.mc_gs ++ && self.mc_fs == other.mc_fs ++ && self.mc_es == other.mc_es ++ && self.mc_ds == other.mc_ds ++ && self.mc_edi == other.mc_edi ++ && self.mc_esi == other.mc_esi ++ && self.mc_ebp == other.mc_ebp ++ && self.mc_isp == other.mc_isp ++ && self.mc_ebx == other.mc_ebx ++ && self.mc_edx == other.mc_edx ++ && self.mc_ecx == other.mc_ecx ++ && self.mc_eax == other.mc_eax ++ && self.mc_trapno == other.mc_trapno ++ && self.mc_err == other.mc_err ++ && self.mc_eip == other.mc_eip ++ && self.mc_cs == other.mc_cs ++ && self.mc_eflags == other.mc_eflags ++ && self.mc_esp == other.mc_esp ++ && self.mc_ss == other.mc_ss ++ && self.mc_len == other.mc_len ++ && self.mc_fpformat == other.mc_fpformat ++ && self.mc_ownedfp == other.mc_ownedfp ++ && self.mc_flags == other.mc_flags ++ && self ++ .mc_fpstate ++ .iter() ++ .zip(other.mc_fpstate.iter()) ++ .all(|(a, b)| a == b) ++ && self.mc_fsbase == other.mc_fsbase ++ && self.mc_gsbase == other.mc_gsbase ++ && self.mc_xfpustate == other.mc_xfpustate ++ && self.mc_xfpustate_len == other.mc_xfpustate_len ++ && self ++ .mc_spare2 ++ .iter() ++ .zip(other.mc_spare2.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for mcontext_t {} ++ impl fmt::Debug for mcontext_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("mcontext_t") ++ .field("mc_onstack", &self.mc_onstack) ++ .field("mc_gs", &self.mc_gs) ++ .field("mc_fs", &self.mc_fs) ++ .field("mc_es", &self.mc_es) ++ .field("mc_ds", &self.mc_ds) ++ .field("mc_edi", &self.mc_edi) ++ .field("mc_esi", &self.mc_esi) ++ .field("mc_ebp", &self.mc_ebp) ++ .field("mc_isp", &self.mc_isp) ++ .field("mc_ebx", &self.mc_ebx) ++ .field("mc_edx", &self.mc_edx) ++ .field("mc_ecx", &self.mc_ecx) ++ .field("mc_eax", &self.mc_eax) ++ .field("mc_trapno", &self.mc_trapno) ++ .field("mc_err", &self.mc_err) ++ .field("mc_eip", &self.mc_eip) ++ .field("mc_cs", &self.mc_cs) ++ .field("mc_eflags", &self.mc_eflags) ++ .field("mc_esp", &self.mc_esp) ++ .field("mc_ss", &self.mc_ss) ++ .field("mc_len", &self.mc_len) ++ .field("mc_fpformat", &self.mc_fpformat) ++ .field("mc_ownedfp", &self.mc_ownedfp) ++ .field("mc_flags", &self.mc_flags) ++ .field("mc_fpstate", &self.mc_fpstate) ++ .field("mc_fsbase", &self.mc_fsbase) ++ .field("mc_gsbase", &self.mc_gsbase) ++ .field("mc_xfpustate", &self.mc_xfpustate) ++ .field("mc_xfpustate_len", &self.mc_xfpustate_len) ++ .field("mc_spare2", &self.mc_spare2) ++ .finish() ++ } ++ } ++ impl hash::Hash for mcontext_t { ++ fn hash(&self, state: &mut H) { ++ self.mc_onstack.hash(state); ++ self.mc_gs.hash(state); ++ self.mc_fs.hash(state); ++ self.mc_es.hash(state); ++ self.mc_ds.hash(state); ++ self.mc_edi.hash(state); ++ self.mc_esi.hash(state); ++ self.mc_ebp.hash(state); ++ self.mc_isp.hash(state); ++ self.mc_ebx.hash(state); ++ self.mc_edx.hash(state); ++ self.mc_ecx.hash(state); ++ self.mc_eax.hash(state); ++ self.mc_trapno.hash(state); ++ self.mc_err.hash(state); ++ self.mc_eip.hash(state); ++ self.mc_cs.hash(state); ++ self.mc_eflags.hash(state); ++ self.mc_esp.hash(state); ++ self.mc_ss.hash(state); ++ self.mc_len.hash(state); ++ self.mc_fpformat.hash(state); ++ self.mc_ownedfp.hash(state); ++ self.mc_flags.hash(state); ++ self.mc_fpstate.hash(state); ++ self.mc_fsbase.hash(state); ++ self.mc_gsbase.hash(state); ++ self.mc_xfpustate.hash(state); ++ self.mc_xfpustate_len.hash(state); ++ self.mc_spare2.hash(state); ++ } ++ } ++ } ++} ++ ++pub(crate) const _ALIGNBYTES: usize = mem::size_of::() - 1; ++ ++pub const MINSIGSTKSZ: size_t = 2048; // 512 * 4 ++ ++pub const BIOCSRTIMEOUT: c_ulong = 0x8008426d; ++pub const BIOCGRTIMEOUT: c_ulong = 0x4008426e; ++pub const KINFO_FILE_SIZE: c_int = 1392; ++pub const TIOCTIMESTAMP: c_ulong = 0x40087459; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/freebsdlike/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,1923 @@ ++use crate::off_t; ++use crate::prelude::*; ++ ++pub type mode_t = u16; ++pub type pthread_attr_t = *mut c_void; ++pub type rlim_t = i64; ++pub type pthread_mutex_t = *mut c_void; ++pub type pthread_mutexattr_t = *mut c_void; ++pub type pthread_cond_t = *mut c_void; ++pub type pthread_condattr_t = *mut c_void; ++pub type pthread_rwlock_t = *mut c_void; ++pub type pthread_rwlockattr_t = *mut c_void; ++pub type pthread_key_t = c_int; ++pub type tcflag_t = c_uint; ++pub type speed_t = c_uint; ++pub type nl_item = c_int; ++pub type id_t = i64; ++pub type vm_size_t = crate::uintptr_t; ++pub type key_t = c_long; ++ ++// elf.h ++ ++pub type Elf32_Addr = u32; ++pub type Elf32_Half = u16; ++pub type Elf32_Lword = u64; ++pub type Elf32_Off = u32; ++pub type Elf32_Sword = i32; ++pub type Elf32_Word = u32; ++ ++pub type Elf64_Addr = u64; ++pub type Elf64_Half = u16; ++pub type Elf64_Lword = u64; ++pub type Elf64_Off = u64; ++pub type Elf64_Sword = i32; ++pub type Elf64_Sxword = i64; ++pub type Elf64_Word = u32; ++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; ++ type Elf_Half = Elf64_Half; ++ type Elf_Phdr = Elf64_Phdr; ++ } else if #[cfg(target_pointer_width = "32")] { ++ type Elf_Addr = Elf32_Addr; ++ type Elf_Half = Elf32_Half; ++ type Elf_Phdr = Elf32_Phdr; ++ } ++} ++ ++// link.h ++ ++#[cfg_attr(feature = "extra_traits", derive(Debug))] ++pub enum timezone {} ++impl Copy for timezone {} ++impl Clone for timezone { ++ fn clone(&self) -> timezone { ++ *self ++ } ++} ++ ++impl siginfo_t { ++ pub unsafe fn si_addr(&self) -> *mut c_void { ++ self.si_addr ++ } ++ ++ pub unsafe fn si_value(&self) -> crate::sigval { ++ self.si_value ++ } ++ ++ pub unsafe fn si_pid(&self) -> crate::pid_t { ++ self.si_pid ++ } ++ ++ pub unsafe fn si_uid(&self) -> crate::uid_t { ++ self.si_uid ++ } ++ ++ pub unsafe fn si_status(&self) -> c_int { ++ self.si_status ++ } ++} ++ ++s! { ++ pub struct in_addr { ++ pub s_addr: crate::in_addr_t, ++ } ++ ++ pub struct ip_mreq { ++ pub imr_multiaddr: in_addr, ++ pub imr_interface: in_addr, ++ } ++ ++ pub struct ip_mreqn { ++ pub imr_multiaddr: in_addr, ++ pub imr_address: in_addr, ++ pub imr_ifindex: c_int, ++ } ++ ++ pub struct ip_mreq_source { ++ pub imr_multiaddr: in_addr, ++ pub imr_sourceaddr: in_addr, ++ pub imr_interface: in_addr, ++ } ++ ++ pub struct glob_t { ++ pub gl_pathc: size_t, ++ pub gl_matchc: size_t, ++ pub gl_offs: size_t, ++ pub gl_flags: c_int, ++ pub gl_pathv: *mut *mut c_char, ++ __unused3: *mut c_void, ++ __unused4: *mut c_void, ++ __unused5: *mut c_void, ++ __unused6: *mut c_void, ++ __unused7: *mut c_void, ++ __unused8: *mut c_void, ++ } ++ ++ pub struct addrinfo { ++ pub ai_flags: c_int, ++ pub ai_family: c_int, ++ pub ai_socktype: c_int, ++ pub ai_protocol: c_int, ++ pub ai_addrlen: crate::socklen_t, ++ pub ai_canonname: *mut c_char, ++ pub ai_addr: *mut crate::sockaddr, ++ pub ai_next: *mut addrinfo, ++ } ++ ++ pub struct sigset_t { ++ bits: [u32; 4], ++ } ++ ++ pub struct siginfo_t { ++ pub si_signo: c_int, ++ pub si_errno: c_int, ++ pub si_code: c_int, ++ pub si_pid: crate::pid_t, ++ pub si_uid: crate::uid_t, ++ pub si_status: c_int, ++ pub si_addr: *mut c_void, ++ pub si_value: crate::sigval, ++ _pad1: c_long, ++ _pad2: [c_int; 7], ++ } ++ ++ pub struct sigaction { ++ pub sa_sigaction: crate::sighandler_t, ++ pub sa_flags: c_int, ++ pub sa_mask: sigset_t, ++ } ++ ++ pub struct sched_param { ++ pub sched_priority: c_int, ++ } ++ ++ pub struct Dl_info { ++ pub dli_fname: *const c_char, ++ pub dli_fbase: *mut c_void, ++ pub dli_sname: *const c_char, ++ pub dli_saddr: *mut c_void, ++ } ++ ++ pub struct sockaddr_in { ++ pub sin_len: u8, ++ pub sin_family: crate::sa_family_t, ++ pub sin_port: crate::in_port_t, ++ pub sin_addr: crate::in_addr, ++ pub sin_zero: [c_char; 8], ++ } ++ ++ pub struct termios { ++ pub c_iflag: crate::tcflag_t, ++ pub c_oflag: crate::tcflag_t, ++ pub c_cflag: crate::tcflag_t, ++ pub c_lflag: crate::tcflag_t, ++ pub c_cc: [crate::cc_t; crate::NCCS], ++ pub c_ispeed: crate::speed_t, ++ pub c_ospeed: crate::speed_t, ++ } ++ ++ pub struct flock { ++ pub l_start: off_t, ++ pub l_len: off_t, ++ pub l_pid: crate::pid_t, ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ #[cfg(not(target_os = "dragonfly"))] ++ pub l_sysid: c_int, ++ } ++ ++ pub struct sf_hdtr { ++ pub headers: *mut crate::iovec, ++ pub hdr_cnt: c_int, ++ pub trailers: *mut crate::iovec, ++ pub trl_cnt: c_int, ++ } ++ ++ pub struct lconv { ++ pub decimal_point: *mut c_char, ++ pub thousands_sep: *mut c_char, ++ pub grouping: *mut c_char, ++ pub int_curr_symbol: *mut c_char, ++ pub currency_symbol: *mut c_char, ++ pub mon_decimal_point: *mut c_char, ++ pub mon_thousands_sep: *mut c_char, ++ pub mon_grouping: *mut c_char, ++ pub positive_sign: *mut c_char, ++ pub negative_sign: *mut c_char, ++ pub int_frac_digits: c_char, ++ pub frac_digits: c_char, ++ pub p_cs_precedes: c_char, ++ pub p_sep_by_space: c_char, ++ pub n_cs_precedes: c_char, ++ pub n_sep_by_space: c_char, ++ pub p_sign_posn: c_char, ++ pub n_sign_posn: c_char, ++ pub int_p_cs_precedes: c_char, ++ pub int_n_cs_precedes: c_char, ++ pub int_p_sep_by_space: c_char, ++ pub int_n_sep_by_space: c_char, ++ pub int_p_sign_posn: c_char, ++ pub int_n_sign_posn: c_char, ++ } ++ ++ pub struct cmsgcred { ++ pub cmcred_pid: crate::pid_t, ++ pub cmcred_uid: crate::uid_t, ++ pub cmcred_euid: crate::uid_t, ++ pub cmcred_gid: crate::gid_t, ++ pub cmcred_ngroups: c_short, ++ pub cmcred_groups: [crate::gid_t; CMGROUP_MAX], ++ } ++ ++ pub struct rtprio { ++ pub type_: c_ushort, ++ pub prio: c_ushort, ++ } ++ ++ pub struct in6_pktinfo { ++ pub ipi6_addr: crate::in6_addr, ++ pub ipi6_ifindex: c_uint, ++ } ++ ++ pub struct arphdr { ++ pub ar_hrd: u16, ++ pub ar_pro: u16, ++ pub ar_hln: u8, ++ pub ar_pln: u8, ++ pub ar_op: u16, ++ } ++ ++ pub struct timex { ++ pub modes: c_uint, ++ pub offset: c_long, ++ pub freq: c_long, ++ pub maxerror: c_long, ++ pub esterror: c_long, ++ pub status: c_int, ++ pub constant: c_long, ++ pub precision: c_long, ++ pub tolerance: c_long, ++ pub ppsfreq: c_long, ++ pub jitter: c_long, ++ pub shift: c_int, ++ pub stabil: c_long, ++ pub jitcnt: c_long, ++ pub calcnt: c_long, ++ pub errcnt: c_long, ++ pub stbcnt: c_long, ++ } ++ ++ pub struct ntptimeval { ++ pub time: crate::timespec, ++ pub maxerror: c_long, ++ pub esterror: c_long, ++ pub tai: c_long, ++ pub time_state: c_int, ++ } ++ ++ pub struct accept_filter_arg { ++ pub af_name: [c_char; 16], ++ af_arg: [c_char; 256 - 16], ++ } ++ ++ pub struct ptrace_io_desc { ++ pub piod_op: c_int, ++ pub piod_offs: *mut c_void, ++ pub piod_addr: *mut c_void, ++ pub piod_len: size_t, ++ } ++ ++ // bpf.h ++ ++ pub struct bpf_program { ++ pub bf_len: c_uint, ++ pub bf_insns: *mut bpf_insn, ++ } ++ ++ pub struct bpf_stat { ++ pub bs_recv: c_uint, ++ pub bs_drop: c_uint, ++ } ++ ++ pub struct bpf_version { ++ pub bv_major: c_ushort, ++ pub bv_minor: c_ushort, ++ } ++ ++ pub struct bpf_hdr { ++ pub bh_tstamp: crate::timeval, ++ pub bh_caplen: u32, ++ pub bh_datalen: u32, ++ pub bh_hdrlen: c_ushort, ++ } ++ ++ pub struct bpf_insn { ++ pub code: c_ushort, ++ pub jt: c_uchar, ++ pub jf: c_uchar, ++ pub k: u32, ++ } ++ ++ pub struct bpf_dltlist { ++ bfl_len: c_uint, ++ bfl_list: *mut c_uint, ++ } ++ ++ // elf.h ++ ++ pub struct Elf32_Phdr { ++ pub p_type: Elf32_Word, ++ pub p_offset: Elf32_Off, ++ pub p_vaddr: Elf32_Addr, ++ pub p_paddr: Elf32_Addr, ++ pub p_filesz: Elf32_Word, ++ pub p_memsz: Elf32_Word, ++ pub p_flags: Elf32_Word, ++ pub p_align: Elf32_Word, ++ } ++ ++ pub struct Elf64_Phdr { ++ pub p_type: Elf64_Word, ++ pub p_flags: Elf64_Word, ++ pub p_offset: Elf64_Off, ++ pub p_vaddr: Elf64_Addr, ++ pub p_paddr: Elf64_Addr, ++ pub p_filesz: Elf64_Xword, ++ pub p_memsz: Elf64_Xword, ++ pub p_align: Elf64_Xword, ++ } ++ ++ // link.h ++ ++ pub struct dl_phdr_info { ++ pub dlpi_addr: Elf_Addr, ++ pub dlpi_name: *const c_char, ++ pub dlpi_phdr: *const Elf_Phdr, ++ pub dlpi_phnum: Elf_Half, ++ pub dlpi_adds: c_ulonglong, ++ pub dlpi_subs: c_ulonglong, ++ pub dlpi_tls_modid: usize, ++ pub dlpi_tls_data: *mut c_void, ++ } ++ ++ pub struct ipc_perm { ++ pub cuid: crate::uid_t, ++ pub cgid: crate::gid_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub mode: crate::mode_t, ++ pub seq: c_ushort, ++ pub key: crate::key_t, ++ } ++ ++ pub struct eui64 { ++ pub octet: [u8; EUI64_LEN], ++ } ++} ++ ++s_no_extra_traits! { ++ pub struct sockaddr_storage { ++ pub ss_len: u8, ++ pub ss_family: crate::sa_family_t, ++ __ss_pad1: [u8; 6], ++ __ss_align: i64, ++ __ss_pad2: [u8; 112], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for sockaddr_storage { ++ fn eq(&self, other: &sockaddr_storage) -> bool { ++ self.ss_len == other.ss_len ++ && self.ss_family == other.ss_family ++ && self.__ss_pad1 == other.__ss_pad1 ++ && self.__ss_align == other.__ss_align ++ && self ++ .__ss_pad2 ++ .iter() ++ .zip(other.__ss_pad2.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for sockaddr_storage {} ++ impl fmt::Debug for sockaddr_storage { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sockaddr_storage") ++ .field("ss_len", &self.ss_len) ++ .field("ss_family", &self.ss_family) ++ .field("__ss_pad1", &self.__ss_pad1) ++ .field("__ss_align", &self.__ss_align) ++ // FIXME: .field("__ss_pad2", &self.__ss_pad2) ++ .finish() ++ } ++ } ++ impl hash::Hash for sockaddr_storage { ++ fn hash(&self, state: &mut H) { ++ self.ss_len.hash(state); ++ self.ss_family.hash(state); ++ self.__ss_pad1.hash(state); ++ self.__ss_align.hash(state); ++ self.__ss_pad2.hash(state); ++ } ++ } ++ } ++} ++ ++// Non-public helper constant ++const SIZEOF_LONG: usize = mem::size_of::(); ++ ++#[deprecated( ++ since = "0.2.64", ++ note = "Can vary at runtime. Use sysconf(3) instead" ++)] ++pub const AIO_LISTIO_MAX: c_int = 16; ++pub const AIO_CANCELED: c_int = 1; ++pub const AIO_NOTCANCELED: c_int = 2; ++pub const AIO_ALLDONE: c_int = 3; ++pub const LIO_NOP: c_int = 0; ++pub const LIO_WRITE: c_int = 1; ++pub const LIO_READ: c_int = 2; ++pub const LIO_WAIT: c_int = 1; ++pub const LIO_NOWAIT: c_int = 0; ++ ++pub const SIGEV_NONE: c_int = 0; ++pub const SIGEV_SIGNAL: c_int = 1; ++pub const SIGEV_THREAD: c_int = 2; ++pub const SIGEV_KEVENT: c_int = 3; ++ ++pub const CODESET: crate::nl_item = 0; ++pub const D_T_FMT: crate::nl_item = 1; ++pub const D_FMT: crate::nl_item = 2; ++pub const T_FMT: crate::nl_item = 3; ++pub const T_FMT_AMPM: crate::nl_item = 4; ++pub const AM_STR: crate::nl_item = 5; ++pub const PM_STR: crate::nl_item = 6; ++ ++pub const DAY_1: crate::nl_item = 7; ++pub const DAY_2: crate::nl_item = 8; ++pub const DAY_3: crate::nl_item = 9; ++pub const DAY_4: crate::nl_item = 10; ++pub const DAY_5: crate::nl_item = 11; ++pub const DAY_6: crate::nl_item = 12; ++pub const DAY_7: crate::nl_item = 13; ++ ++pub const ABDAY_1: crate::nl_item = 14; ++pub const ABDAY_2: crate::nl_item = 15; ++pub const ABDAY_3: crate::nl_item = 16; ++pub const ABDAY_4: crate::nl_item = 17; ++pub const ABDAY_5: crate::nl_item = 18; ++pub const ABDAY_6: crate::nl_item = 19; ++pub const ABDAY_7: crate::nl_item = 20; ++ ++pub const MON_1: crate::nl_item = 21; ++pub const MON_2: crate::nl_item = 22; ++pub const MON_3: crate::nl_item = 23; ++pub const MON_4: crate::nl_item = 24; ++pub const MON_5: crate::nl_item = 25; ++pub const MON_6: crate::nl_item = 26; ++pub const MON_7: crate::nl_item = 27; ++pub const MON_8: crate::nl_item = 28; ++pub const MON_9: crate::nl_item = 29; ++pub const MON_10: crate::nl_item = 30; ++pub const MON_11: crate::nl_item = 31; ++pub const MON_12: crate::nl_item = 32; ++ ++pub const ABMON_1: crate::nl_item = 33; ++pub const ABMON_2: crate::nl_item = 34; ++pub const ABMON_3: crate::nl_item = 35; ++pub const ABMON_4: crate::nl_item = 36; ++pub const ABMON_5: crate::nl_item = 37; ++pub const ABMON_6: crate::nl_item = 38; ++pub const ABMON_7: crate::nl_item = 39; ++pub const ABMON_8: crate::nl_item = 40; ++pub const ABMON_9: crate::nl_item = 41; ++pub const ABMON_10: crate::nl_item = 42; ++pub const ABMON_11: crate::nl_item = 43; ++pub const ABMON_12: crate::nl_item = 44; ++ ++pub const ERA: crate::nl_item = 45; ++pub const ERA_D_FMT: crate::nl_item = 46; ++pub const ERA_D_T_FMT: crate::nl_item = 47; ++pub const ERA_T_FMT: crate::nl_item = 48; ++pub const ALT_DIGITS: crate::nl_item = 49; ++ ++pub const RADIXCHAR: crate::nl_item = 50; ++pub const THOUSEP: crate::nl_item = 51; ++ ++pub const YESEXPR: crate::nl_item = 52; ++pub const NOEXPR: crate::nl_item = 53; ++ ++pub const YESSTR: crate::nl_item = 54; ++pub const NOSTR: crate::nl_item = 55; ++ ++pub const CRNCYSTR: crate::nl_item = 56; ++ ++pub const D_MD_ORDER: crate::nl_item = 57; ++ ++pub const ALTMON_1: crate::nl_item = 58; ++pub const ALTMON_2: crate::nl_item = 59; ++pub const ALTMON_3: crate::nl_item = 60; ++pub const ALTMON_4: crate::nl_item = 61; ++pub const ALTMON_5: crate::nl_item = 62; ++pub const ALTMON_6: crate::nl_item = 63; ++pub const ALTMON_7: crate::nl_item = 64; ++pub const ALTMON_8: crate::nl_item = 65; ++pub const ALTMON_9: crate::nl_item = 66; ++pub const ALTMON_10: crate::nl_item = 67; ++pub const ALTMON_11: crate::nl_item = 68; ++pub const ALTMON_12: crate::nl_item = 69; ++ ++pub const EXIT_FAILURE: c_int = 1; ++pub const EXIT_SUCCESS: c_int = 0; ++pub const EOF: c_int = -1; ++pub const SEEK_SET: c_int = 0; ++pub const SEEK_CUR: c_int = 1; ++pub const SEEK_END: c_int = 2; ++pub const SEEK_DATA: c_int = 3; ++pub const SEEK_HOLE: c_int = 4; ++pub const _IOFBF: c_int = 0; ++pub const _IONBF: c_int = 2; ++pub const _IOLBF: c_int = 1; ++pub const BUFSIZ: c_uint = 1024; ++pub const FOPEN_MAX: c_uint = 20; ++pub const FILENAME_MAX: c_uint = 1024; ++pub const L_tmpnam: c_uint = 1024; ++pub const TMP_MAX: c_uint = 308915776; ++ ++pub const O_NOCTTY: c_int = 32768; ++pub const O_DIRECT: c_int = 0x00010000; ++ ++pub const S_IFIFO: mode_t = 0o1_0000; ++pub const S_IFCHR: mode_t = 0o2_0000; ++pub const S_IFBLK: mode_t = 0o6_0000; ++pub const S_IFDIR: mode_t = 0o4_0000; ++pub const S_IFREG: mode_t = 0o10_0000; ++pub const S_IFLNK: mode_t = 0o12_0000; ++pub const S_IFSOCK: mode_t = 0o14_0000; ++pub const S_IFMT: mode_t = 0o17_0000; ++pub const S_IEXEC: mode_t = 0o0100; ++pub const S_IWRITE: mode_t = 0o0200; ++pub const S_IREAD: mode_t = 0o0400; ++pub const S_IRWXU: mode_t = 0o0700; ++pub const S_IXUSR: mode_t = 0o0100; ++pub const S_IWUSR: mode_t = 0o0200; ++pub const S_IRUSR: mode_t = 0o0400; ++pub const S_IRWXG: mode_t = 0o0070; ++pub const S_IXGRP: mode_t = 0o0010; ++pub const S_IWGRP: mode_t = 0o0020; ++pub const S_IRGRP: mode_t = 0o0040; ++pub const S_IRWXO: mode_t = 0o0007; ++pub const S_IXOTH: mode_t = 0o0001; ++pub const S_IWOTH: mode_t = 0o0002; ++pub const S_IROTH: mode_t = 0o0004; ++pub const F_OK: c_int = 0; ++pub const R_OK: c_int = 4; ++pub const W_OK: c_int = 2; ++pub const X_OK: c_int = 1; ++pub const STDIN_FILENO: c_int = 0; ++pub const STDOUT_FILENO: c_int = 1; ++pub const STDERR_FILENO: c_int = 2; ++pub const F_LOCK: c_int = 1; ++pub const F_TEST: c_int = 3; ++pub const F_TLOCK: c_int = 2; ++pub const F_ULOCK: c_int = 0; ++pub const F_DUPFD_CLOEXEC: c_int = 17; ++pub const F_DUP2FD: c_int = 10; ++pub const F_DUP2FD_CLOEXEC: c_int = 18; ++pub const SIGHUP: c_int = 1; ++pub const SIGINT: c_int = 2; ++pub const SIGQUIT: c_int = 3; ++pub const SIGILL: c_int = 4; ++pub const SIGABRT: c_int = 6; ++pub const SIGEMT: c_int = 7; ++pub const SIGFPE: c_int = 8; ++pub const SIGKILL: c_int = 9; ++pub const SIGSEGV: c_int = 11; ++pub const SIGPIPE: c_int = 13; ++pub const SIGALRM: c_int = 14; ++pub const SIGTERM: c_int = 15; ++ ++pub const PROT_NONE: c_int = 0; ++pub const PROT_READ: c_int = 1; ++pub const PROT_WRITE: c_int = 2; ++pub const PROT_EXEC: c_int = 4; ++ ++pub const MAP_FILE: c_int = 0x0000; ++pub const MAP_SHARED: c_int = 0x0001; ++pub const MAP_PRIVATE: c_int = 0x0002; ++pub const MAP_FIXED: c_int = 0x0010; ++pub const MAP_ANON: c_int = 0x1000; ++pub const MAP_ANONYMOUS: c_int = MAP_ANON; ++ ++pub const MAP_FAILED: *mut c_void = !0 as *mut c_void; ++ ++pub const MCL_CURRENT: c_int = 0x0001; ++pub const MCL_FUTURE: c_int = 0x0002; ++ ++pub const MNT_EXPUBLIC: c_int = 0x20000000; ++pub const MNT_NOATIME: c_int = 0x10000000; ++pub const MNT_NOCLUSTERR: c_int = 0x40000000; ++pub const MNT_NOCLUSTERW: c_int = 0x80000000; ++pub const MNT_NOSYMFOLLOW: c_int = 0x00400000; ++pub const MNT_SOFTDEP: c_int = 0x00200000; ++pub const MNT_SUIDDIR: c_int = 0x00100000; ++pub const MNT_EXRDONLY: c_int = 0x00000080; ++pub const MNT_DEFEXPORTED: c_int = 0x00000200; ++pub const MNT_EXPORTANON: c_int = 0x00000400; ++pub const MNT_EXKERB: c_int = 0x00000800; ++pub const MNT_DELEXPORT: c_int = 0x00020000; ++ ++pub const MS_SYNC: c_int = 0x0000; ++pub const MS_ASYNC: c_int = 0x0001; ++pub const MS_INVALIDATE: c_int = 0x0002; ++ ++pub const EPERM: c_int = 1; ++pub const ENOENT: c_int = 2; ++pub const ESRCH: c_int = 3; ++pub const EINTR: c_int = 4; ++pub const EIO: c_int = 5; ++pub const ENXIO: c_int = 6; ++pub const E2BIG: c_int = 7; ++pub const ENOEXEC: c_int = 8; ++pub const EBADF: c_int = 9; ++pub const ECHILD: c_int = 10; ++pub const EDEADLK: c_int = 11; ++pub const ENOMEM: c_int = 12; ++pub const EACCES: c_int = 13; ++pub const EFAULT: c_int = 14; ++pub const ENOTBLK: c_int = 15; ++pub const EBUSY: c_int = 16; ++pub const EEXIST: c_int = 17; ++pub const EXDEV: c_int = 18; ++pub const ENODEV: c_int = 19; ++pub const ENOTDIR: c_int = 20; ++pub const EISDIR: c_int = 21; ++pub const EINVAL: c_int = 22; ++pub const ENFILE: c_int = 23; ++pub const EMFILE: c_int = 24; ++pub const ENOTTY: c_int = 25; ++pub const ETXTBSY: c_int = 26; ++pub const EFBIG: c_int = 27; ++pub const ENOSPC: c_int = 28; ++pub const ESPIPE: c_int = 29; ++pub const EROFS: c_int = 30; ++pub const EMLINK: c_int = 31; ++pub const EPIPE: c_int = 32; ++pub const EDOM: c_int = 33; ++pub const ERANGE: c_int = 34; ++pub const EAGAIN: c_int = 35; ++pub const EWOULDBLOCK: c_int = 35; ++pub const EINPROGRESS: c_int = 36; ++pub const EALREADY: c_int = 37; ++pub const ENOTSOCK: c_int = 38; ++pub const EDESTADDRREQ: c_int = 39; ++pub const EMSGSIZE: c_int = 40; ++pub const EPROTOTYPE: c_int = 41; ++pub const ENOPROTOOPT: c_int = 42; ++pub const EPROTONOSUPPORT: c_int = 43; ++pub const ESOCKTNOSUPPORT: c_int = 44; ++pub const EOPNOTSUPP: c_int = 45; ++pub const ENOTSUP: c_int = EOPNOTSUPP; ++pub const EPFNOSUPPORT: c_int = 46; ++pub const EAFNOSUPPORT: c_int = 47; ++pub const EADDRINUSE: c_int = 48; ++pub const EADDRNOTAVAIL: c_int = 49; ++pub const ENETDOWN: c_int = 50; ++pub const ENETUNREACH: c_int = 51; ++pub const ENETRESET: c_int = 52; ++pub const ECONNABORTED: c_int = 53; ++pub const ECONNRESET: c_int = 54; ++pub const ENOBUFS: c_int = 55; ++pub const EISCONN: c_int = 56; ++pub const ENOTCONN: c_int = 57; ++pub const ESHUTDOWN: c_int = 58; ++pub const ETOOMANYREFS: c_int = 59; ++pub const ETIMEDOUT: c_int = 60; ++pub const ECONNREFUSED: c_int = 61; ++pub const ELOOP: c_int = 62; ++pub const ENAMETOOLONG: c_int = 63; ++pub const EHOSTDOWN: c_int = 64; ++pub const EHOSTUNREACH: c_int = 65; ++pub const ENOTEMPTY: c_int = 66; ++pub const EPROCLIM: c_int = 67; ++pub const EUSERS: c_int = 68; ++pub const EDQUOT: c_int = 69; ++pub const ESTALE: c_int = 70; ++pub const EREMOTE: c_int = 71; ++pub const EBADRPC: c_int = 72; ++pub const ERPCMISMATCH: c_int = 73; ++pub const EPROGUNAVAIL: c_int = 74; ++pub const EPROGMISMATCH: c_int = 75; ++pub const EPROCUNAVAIL: c_int = 76; ++pub const ENOLCK: c_int = 77; ++pub const ENOSYS: c_int = 78; ++pub const EFTYPE: c_int = 79; ++pub const EAUTH: c_int = 80; ++pub const ENEEDAUTH: c_int = 81; ++pub const EIDRM: c_int = 82; ++pub const ENOMSG: c_int = 83; ++pub const EOVERFLOW: c_int = 84; ++pub const ECANCELED: c_int = 85; ++pub const EILSEQ: c_int = 86; ++pub const ENOATTR: c_int = 87; ++pub const EDOOFUS: c_int = 88; ++pub const EBADMSG: c_int = 89; ++pub const EMULTIHOP: c_int = 90; ++pub const ENOLINK: c_int = 91; ++pub const EPROTO: c_int = 92; ++ ++pub const POLLSTANDARD: c_short = crate::POLLIN ++ | crate::POLLPRI ++ | crate::POLLOUT ++ | crate::POLLRDNORM ++ | crate::POLLRDBAND ++ | crate::POLLWRBAND ++ | crate::POLLERR ++ | crate::POLLHUP ++ | crate::POLLNVAL; ++ ++pub const AI_PASSIVE: c_int = 0x00000001; ++pub const AI_CANONNAME: c_int = 0x00000002; ++pub const AI_NUMERICHOST: c_int = 0x00000004; ++pub const AI_NUMERICSERV: c_int = 0x00000008; ++pub const AI_ALL: c_int = 0x00000100; ++pub const AI_ADDRCONFIG: c_int = 0x00000400; ++pub const AI_V4MAPPED: c_int = 0x00000800; ++ ++pub const EAI_AGAIN: c_int = 2; ++pub const EAI_BADFLAGS: c_int = 3; ++pub const EAI_FAIL: c_int = 4; ++pub const EAI_FAMILY: c_int = 5; ++pub const EAI_MEMORY: c_int = 6; ++pub const EAI_NONAME: c_int = 8; ++pub const EAI_SERVICE: c_int = 9; ++pub const EAI_SOCKTYPE: c_int = 10; ++pub const EAI_SYSTEM: c_int = 11; ++pub const EAI_OVERFLOW: c_int = 14; ++ ++pub const F_DUPFD: c_int = 0; ++pub const F_GETFD: c_int = 1; ++pub const F_SETFD: c_int = 2; ++pub const F_GETFL: c_int = 3; ++pub const F_SETFL: c_int = 4; ++ ++pub const SIGTRAP: c_int = 5; ++ ++pub const GLOB_APPEND: c_int = 0x0001; ++pub const GLOB_DOOFFS: c_int = 0x0002; ++pub const GLOB_ERR: c_int = 0x0004; ++pub const GLOB_MARK: c_int = 0x0008; ++pub const GLOB_NOCHECK: c_int = 0x0010; ++pub const GLOB_NOSORT: c_int = 0x0020; ++pub const GLOB_NOESCAPE: c_int = 0x2000; ++ ++pub const GLOB_NOSPACE: c_int = -1; ++pub const GLOB_ABORTED: c_int = -2; ++pub const GLOB_NOMATCH: c_int = -3; ++ ++pub const POSIX_MADV_NORMAL: c_int = 0; ++pub const POSIX_MADV_RANDOM: c_int = 1; ++pub const POSIX_MADV_SEQUENTIAL: c_int = 2; ++pub const POSIX_MADV_WILLNEED: c_int = 3; ++pub const POSIX_MADV_DONTNEED: c_int = 4; ++ ++pub const PTHREAD_BARRIER_SERIAL_THREAD: c_int = -1; ++pub const PTHREAD_PROCESS_PRIVATE: c_int = 0; ++pub const PTHREAD_PROCESS_SHARED: c_int = 1; ++pub const PTHREAD_CREATE_JOINABLE: c_int = 0; ++pub const PTHREAD_CREATE_DETACHED: c_int = 1; ++ ++pub const RLIMIT_CPU: c_int = 0; ++pub const RLIMIT_FSIZE: c_int = 1; ++pub const RLIMIT_DATA: c_int = 2; ++pub const RLIMIT_STACK: c_int = 3; ++pub const RLIMIT_CORE: c_int = 4; ++pub const RLIMIT_RSS: c_int = 5; ++pub const RLIMIT_MEMLOCK: c_int = 6; ++pub const RLIMIT_NPROC: c_int = 7; ++pub const RLIMIT_NOFILE: c_int = 8; ++pub const RLIMIT_SBSIZE: c_int = 9; ++pub const RLIMIT_VMEM: c_int = 10; ++pub const RLIMIT_AS: c_int = RLIMIT_VMEM; ++pub const RLIM_INFINITY: rlim_t = 0x7fff_ffff_ffff_ffff; ++ ++pub const RUSAGE_SELF: c_int = 0; ++pub const RUSAGE_CHILDREN: c_int = -1; ++ ++pub const CLOCK_REALTIME: crate::clockid_t = 0; ++pub const CLOCK_VIRTUAL: crate::clockid_t = 1; ++pub const CLOCK_PROF: crate::clockid_t = 2; ++pub const CLOCK_MONOTONIC: crate::clockid_t = 4; ++pub const CLOCK_UPTIME: crate::clockid_t = 5; ++pub const CLOCK_UPTIME_PRECISE: crate::clockid_t = 7; ++pub const CLOCK_UPTIME_FAST: crate::clockid_t = 8; ++pub const CLOCK_REALTIME_PRECISE: crate::clockid_t = 9; ++pub const CLOCK_REALTIME_FAST: crate::clockid_t = 10; ++pub const CLOCK_MONOTONIC_PRECISE: crate::clockid_t = 11; ++pub const CLOCK_MONOTONIC_FAST: crate::clockid_t = 12; ++pub const CLOCK_SECOND: crate::clockid_t = 13; ++pub const CLOCK_THREAD_CPUTIME_ID: crate::clockid_t = 14; ++pub const CLOCK_PROCESS_CPUTIME_ID: crate::clockid_t = 15; ++ ++pub const MADV_NORMAL: c_int = 0; ++pub const MADV_RANDOM: c_int = 1; ++pub const MADV_SEQUENTIAL: c_int = 2; ++pub const MADV_WILLNEED: c_int = 3; ++pub const MADV_DONTNEED: c_int = 4; ++pub const MADV_FREE: c_int = 5; ++pub const MADV_NOSYNC: c_int = 6; ++pub const MADV_AUTOSYNC: c_int = 7; ++pub const MADV_NOCORE: c_int = 8; ++pub const MADV_CORE: c_int = 9; ++ ++pub const MINCORE_INCORE: c_int = 0x1; ++pub const MINCORE_REFERENCED: c_int = 0x2; ++pub const MINCORE_MODIFIED: c_int = 0x4; ++pub const MINCORE_REFERENCED_OTHER: c_int = 0x8; ++pub const MINCORE_MODIFIED_OTHER: c_int = 0x10; ++ ++pub const AF_UNSPEC: c_int = 0; ++pub const AF_LOCAL: c_int = 1; ++pub const AF_UNIX: c_int = AF_LOCAL; ++pub const AF_INET: c_int = 2; ++pub const AF_IMPLINK: c_int = 3; ++pub const AF_PUP: c_int = 4; ++pub const AF_CHAOS: c_int = 5; ++pub const AF_NETBIOS: c_int = 6; ++pub const AF_ISO: c_int = 7; ++pub const AF_OSI: c_int = AF_ISO; ++pub const AF_ECMA: c_int = 8; ++pub const AF_DATAKIT: c_int = 9; ++pub const AF_CCITT: c_int = 10; ++pub const AF_SNA: c_int = 11; ++pub const AF_DECnet: c_int = 12; ++pub const AF_DLI: c_int = 13; ++pub const AF_LAT: c_int = 14; ++pub const AF_HYLINK: c_int = 15; ++pub const AF_APPLETALK: c_int = 16; ++pub const AF_ROUTE: c_int = 17; ++pub const AF_LINK: c_int = 18; ++pub const pseudo_AF_XTP: c_int = 19; ++pub const AF_COIP: c_int = 20; ++pub const AF_CNT: c_int = 21; ++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_ISDN: c_int = 26; ++pub const AF_E164: c_int = AF_ISDN; ++pub const pseudo_AF_KEY: c_int = 27; ++pub const AF_INET6: c_int = 28; ++pub const AF_NATM: c_int = 29; ++pub const AF_ATM: c_int = 30; ++pub const pseudo_AF_HDRCMPLT: c_int = 31; ++pub const AF_NETGRAPH: c_int = 32; ++ ++pub const PF_UNSPEC: c_int = AF_UNSPEC; ++pub const PF_LOCAL: c_int = AF_LOCAL; ++pub const PF_UNIX: c_int = PF_LOCAL; ++pub const PF_INET: c_int = AF_INET; ++pub const PF_IMPLINK: c_int = AF_IMPLINK; ++pub const PF_PUP: c_int = AF_PUP; ++pub const PF_CHAOS: c_int = AF_CHAOS; ++pub const PF_NETBIOS: c_int = AF_NETBIOS; ++pub const PF_ISO: c_int = AF_ISO; ++pub const PF_OSI: c_int = AF_ISO; ++pub const PF_ECMA: c_int = AF_ECMA; ++pub const PF_DATAKIT: c_int = AF_DATAKIT; ++pub const PF_CCITT: c_int = AF_CCITT; ++pub const PF_SNA: c_int = AF_SNA; ++pub const PF_DECnet: c_int = AF_DECnet; ++pub const PF_DLI: c_int = AF_DLI; ++pub const PF_LAT: c_int = AF_LAT; ++pub const PF_HYLINK: c_int = AF_HYLINK; ++pub const PF_APPLETALK: c_int = AF_APPLETALK; ++pub const PF_ROUTE: c_int = AF_ROUTE; ++pub const PF_LINK: c_int = AF_LINK; ++pub const PF_XTP: c_int = pseudo_AF_XTP; ++pub const PF_COIP: c_int = AF_COIP; ++pub const PF_CNT: c_int = AF_CNT; ++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_ISDN: c_int = AF_ISDN; ++pub const PF_KEY: c_int = pseudo_AF_KEY; ++pub const PF_INET6: c_int = AF_INET6; ++pub const PF_NATM: c_int = AF_NATM; ++pub const PF_ATM: c_int = AF_ATM; ++pub const PF_NETGRAPH: c_int = AF_NETGRAPH; ++ ++pub const PIOD_READ_D: c_int = 1; ++pub const PIOD_WRITE_D: c_int = 2; ++pub const PIOD_READ_I: c_int = 3; ++pub const PIOD_WRITE_I: c_int = 4; ++ ++pub const PT_TRACE_ME: c_int = 0; ++pub const PT_READ_I: c_int = 1; ++pub const PT_READ_D: c_int = 2; ++pub const PT_WRITE_I: c_int = 4; ++pub const PT_WRITE_D: c_int = 5; ++pub const PT_CONTINUE: c_int = 7; ++pub const PT_KILL: c_int = 8; ++pub const PT_STEP: c_int = 9; ++pub const PT_ATTACH: c_int = 10; ++pub const PT_DETACH: c_int = 11; ++pub const PT_IO: c_int = 12; ++ ++pub const SOMAXCONN: c_int = 128; ++ ++pub const MSG_OOB: c_int = 0x00000001; ++pub const MSG_PEEK: c_int = 0x00000002; ++pub const MSG_DONTROUTE: c_int = 0x00000004; ++pub const MSG_EOR: c_int = 0x00000008; ++pub const MSG_TRUNC: c_int = 0x00000010; ++pub const MSG_CTRUNC: c_int = 0x00000020; ++pub const MSG_WAITALL: c_int = 0x00000040; ++pub const MSG_DONTWAIT: c_int = 0x00000080; ++pub const MSG_EOF: c_int = 0x00000100; ++ ++pub const SCM_TIMESTAMP: c_int = 0x02; ++pub const SCM_CREDS: c_int = 0x03; ++ ++pub const SOCK_STREAM: c_int = 1; ++pub const SOCK_DGRAM: c_int = 2; ++pub const SOCK_RAW: c_int = 3; ++pub const SOCK_RDM: c_int = 4; ++pub const SOCK_SEQPACKET: c_int = 5; ++pub const SOCK_CLOEXEC: c_int = 0x10000000; ++pub const SOCK_NONBLOCK: c_int = 0x20000000; ++pub const SOCK_MAXADDRLEN: c_int = 255; ++pub const IP_TTL: c_int = 4; ++pub const IP_HDRINCL: c_int = 2; ++pub const IP_RECVDSTADDR: c_int = 7; ++pub const IP_SENDSRCADDR: c_int = IP_RECVDSTADDR; ++pub const IP_ADD_MEMBERSHIP: c_int = 12; ++pub const IP_DROP_MEMBERSHIP: c_int = 13; ++pub const IP_RECVIF: c_int = 20; ++pub const IP_RECVTTL: c_int = 65; ++pub const IPV6_RECVHOPLIMIT: c_int = 37; ++pub const IPV6_JOIN_GROUP: c_int = 12; ++pub const IPV6_LEAVE_GROUP: c_int = 13; ++pub const IPV6_CHECKSUM: c_int = 26; ++pub const IPV6_RECVPKTINFO: c_int = 36; ++pub const IPV6_PKTINFO: c_int = 46; ++pub const IPV6_HOPLIMIT: c_int = 47; ++pub const IPV6_RECVTCLASS: c_int = 57; ++pub const IPV6_TCLASS: c_int = 61; ++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 TCP_NOPUSH: c_int = 4; ++pub const TCP_NOOPT: c_int = 8; ++pub const TCP_KEEPIDLE: c_int = 256; ++pub const TCP_KEEPINTVL: c_int = 512; ++pub const TCP_KEEPCNT: c_int = 1024; ++ ++pub const SOL_SOCKET: c_int = 0xffff; ++pub const SO_DEBUG: c_int = 0x01; ++pub const SO_ACCEPTCONN: c_int = 0x0002; ++pub const SO_REUSEADDR: c_int = 0x0004; ++pub const SO_KEEPALIVE: c_int = 0x0008; ++pub const SO_DONTROUTE: c_int = 0x0010; ++pub const SO_BROADCAST: c_int = 0x0020; ++pub const SO_USELOOPBACK: c_int = 0x0040; ++pub const SO_LINGER: c_int = 0x0080; ++pub const SO_OOBINLINE: c_int = 0x0100; ++pub const SO_REUSEPORT: c_int = 0x0200; ++pub const SO_TIMESTAMP: c_int = 0x0400; ++pub const SO_NOSIGPIPE: c_int = 0x0800; ++pub const SO_ACCEPTFILTER: c_int = 0x1000; ++pub const SO_SNDBUF: c_int = 0x1001; ++pub const SO_RCVBUF: c_int = 0x1002; ++pub const SO_SNDLOWAT: c_int = 0x1003; ++pub const SO_RCVLOWAT: c_int = 0x1004; ++pub const SO_SNDTIMEO: c_int = 0x1005; ++pub const SO_RCVTIMEO: c_int = 0x1006; ++pub const SO_ERROR: c_int = 0x1007; ++pub const SO_TYPE: c_int = 0x1008; ++ ++pub const LOCAL_PEERCRED: c_int = 1; ++ ++// net/route.h ++pub const RTF_XRESOLVE: c_int = 0x200; ++pub const RTF_LLINFO: c_int = 0x400; ++pub const RTF_PROTO3: c_int = 0x40000; ++pub const RTF_PINNED: c_int = 0x100000; ++pub const RTF_LOCAL: c_int = 0x200000; ++pub const RTF_BROADCAST: c_int = 0x400000; ++pub const RTF_MULTICAST: c_int = 0x800000; ++ ++pub const RTM_LOCK: c_int = 0x8; ++pub const RTM_RESOLVE: c_int = 0xb; ++pub const RTM_NEWADDR: c_int = 0xc; ++pub const RTM_DELADDR: c_int = 0xd; ++pub const RTM_IFINFO: c_int = 0xe; ++pub const RTM_NEWMADDR: c_int = 0xf; ++pub const RTM_DELMADDR: c_int = 0x10; ++pub const RTM_IFANNOUNCE: c_int = 0x11; ++pub const RTM_IEEE80211: c_int = 0x12; ++ ++pub const SHUT_RD: c_int = 0; ++pub const SHUT_WR: c_int = 1; ++pub const SHUT_RDWR: c_int = 2; ++ ++pub const LOCK_SH: c_int = 1; ++pub const LOCK_EX: c_int = 2; ++pub const LOCK_NB: c_int = 4; ++pub const LOCK_UN: c_int = 8; ++ ++pub const MAP_COPY: c_int = 0x0002; ++#[doc(hidden)] ++#[deprecated( ++ since = "0.2.54", ++ note = "Removed in FreeBSD 11, unused in DragonFlyBSD" ++)] ++pub const MAP_RENAME: c_int = 0x0020; ++#[doc(hidden)] ++#[deprecated( ++ since = "0.2.54", ++ note = "Removed in FreeBSD 11, unused in DragonFlyBSD" ++)] ++pub const MAP_NORESERVE: c_int = 0x0040; ++pub const MAP_HASSEMAPHORE: c_int = 0x0200; ++pub const MAP_STACK: c_int = 0x0400; ++pub const MAP_NOSYNC: c_int = 0x0800; ++pub const MAP_NOCORE: c_int = 0x020000; ++ ++pub const IPPROTO_RAW: c_int = 255; ++ ++pub const _PC_LINK_MAX: c_int = 1; ++pub const _PC_MAX_CANON: c_int = 2; ++pub const _PC_MAX_INPUT: c_int = 3; ++pub const _PC_NAME_MAX: c_int = 4; ++pub const _PC_PATH_MAX: c_int = 5; ++pub const _PC_PIPE_BUF: c_int = 6; ++pub const _PC_CHOWN_RESTRICTED: c_int = 7; ++pub const _PC_NO_TRUNC: c_int = 8; ++pub const _PC_VDISABLE: c_int = 9; ++pub const _PC_ALLOC_SIZE_MIN: c_int = 10; ++pub const _PC_FILESIZEBITS: c_int = 12; ++pub const _PC_REC_INCR_XFER_SIZE: c_int = 14; ++pub const _PC_REC_MAX_XFER_SIZE: c_int = 15; ++pub const _PC_REC_MIN_XFER_SIZE: c_int = 16; ++pub const _PC_REC_XFER_ALIGN: c_int = 17; ++pub const _PC_SYMLINK_MAX: c_int = 18; ++pub const _PC_MIN_HOLE_SIZE: c_int = 21; ++pub const _PC_ASYNC_IO: c_int = 53; ++pub const _PC_PRIO_IO: c_int = 54; ++pub const _PC_SYNC_IO: c_int = 55; ++pub const _PC_ACL_EXTENDED: c_int = 59; ++pub const _PC_ACL_PATH_MAX: c_int = 60; ++pub const _PC_CAP_PRESENT: c_int = 61; ++pub const _PC_INF_PRESENT: c_int = 62; ++pub const _PC_MAC_PRESENT: c_int = 63; ++ ++pub const _SC_ARG_MAX: c_int = 1; ++pub const _SC_CHILD_MAX: c_int = 2; ++pub const _SC_CLK_TCK: c_int = 3; ++pub const _SC_NGROUPS_MAX: c_int = 4; ++pub const _SC_OPEN_MAX: c_int = 5; ++pub const _SC_JOB_CONTROL: c_int = 6; ++pub const _SC_SAVED_IDS: c_int = 7; ++pub const _SC_VERSION: c_int = 8; ++pub const _SC_BC_BASE_MAX: c_int = 9; ++pub const _SC_BC_DIM_MAX: c_int = 10; ++pub const _SC_BC_SCALE_MAX: c_int = 11; ++pub const _SC_BC_STRING_MAX: c_int = 12; ++pub const _SC_COLL_WEIGHTS_MAX: c_int = 13; ++pub const _SC_EXPR_NEST_MAX: c_int = 14; ++pub const _SC_LINE_MAX: c_int = 15; ++pub const _SC_RE_DUP_MAX: c_int = 16; ++pub const _SC_2_VERSION: c_int = 17; ++pub const _SC_2_C_BIND: c_int = 18; ++pub const _SC_2_C_DEV: c_int = 19; ++pub const _SC_2_CHAR_TERM: c_int = 20; ++pub const _SC_2_FORT_DEV: c_int = 21; ++pub const _SC_2_FORT_RUN: c_int = 22; ++pub const _SC_2_LOCALEDEF: c_int = 23; ++pub const _SC_2_SW_DEV: c_int = 24; ++pub const _SC_2_UPE: c_int = 25; ++pub const _SC_STREAM_MAX: c_int = 26; ++pub const _SC_TZNAME_MAX: c_int = 27; ++pub const _SC_ASYNCHRONOUS_IO: c_int = 28; ++pub const _SC_MAPPED_FILES: c_int = 29; ++pub const _SC_MEMLOCK: c_int = 30; ++pub const _SC_MEMLOCK_RANGE: c_int = 31; ++pub const _SC_MEMORY_PROTECTION: c_int = 32; ++pub const _SC_MESSAGE_PASSING: c_int = 33; ++pub const _SC_PRIORITIZED_IO: c_int = 34; ++pub const _SC_PRIORITY_SCHEDULING: c_int = 35; ++pub const _SC_REALTIME_SIGNALS: c_int = 36; ++pub const _SC_SEMAPHORES: c_int = 37; ++pub const _SC_FSYNC: c_int = 38; ++pub const _SC_SHARED_MEMORY_OBJECTS: c_int = 39; ++pub const _SC_SYNCHRONIZED_IO: c_int = 40; ++pub const _SC_TIMERS: c_int = 41; ++pub const _SC_AIO_LISTIO_MAX: c_int = 42; ++pub const _SC_AIO_MAX: c_int = 43; ++pub const _SC_AIO_PRIO_DELTA_MAX: c_int = 44; ++pub const _SC_DELAYTIMER_MAX: c_int = 45; ++pub const _SC_MQ_OPEN_MAX: c_int = 46; ++pub const _SC_PAGESIZE: c_int = 47; ++pub const _SC_PAGE_SIZE: c_int = _SC_PAGESIZE; ++pub const _SC_RTSIG_MAX: c_int = 48; ++pub const _SC_SEM_NSEMS_MAX: c_int = 49; ++pub const _SC_SEM_VALUE_MAX: c_int = 50; ++pub const _SC_SIGQUEUE_MAX: c_int = 51; ++pub const _SC_TIMER_MAX: c_int = 52; ++pub const _SC_IOV_MAX: c_int = 56; ++pub const _SC_NPROCESSORS_CONF: c_int = 57; ++pub const _SC_2_PBS: c_int = 59; ++pub const _SC_2_PBS_ACCOUNTING: c_int = 60; ++pub const _SC_2_PBS_CHECKPOINT: c_int = 61; ++pub const _SC_2_PBS_LOCATE: c_int = 62; ++pub const _SC_2_PBS_MESSAGE: c_int = 63; ++pub const _SC_2_PBS_TRACK: c_int = 64; ++pub const _SC_ADVISORY_INFO: c_int = 65; ++pub const _SC_BARRIERS: c_int = 66; ++pub const _SC_CLOCK_SELECTION: c_int = 67; ++pub const _SC_CPUTIME: c_int = 68; ++pub const _SC_FILE_LOCKING: c_int = 69; ++pub const _SC_NPROCESSORS_ONLN: c_int = 58; ++pub const _SC_GETGR_R_SIZE_MAX: c_int = 70; ++pub const _SC_GETPW_R_SIZE_MAX: c_int = 71; ++pub const _SC_HOST_NAME_MAX: c_int = 72; ++pub const _SC_LOGIN_NAME_MAX: c_int = 73; ++pub const _SC_MONOTONIC_CLOCK: c_int = 74; ++pub const _SC_MQ_PRIO_MAX: c_int = 75; ++pub const _SC_READER_WRITER_LOCKS: c_int = 76; ++pub const _SC_REGEXP: c_int = 77; ++pub const _SC_SHELL: c_int = 78; ++pub const _SC_SPAWN: c_int = 79; ++pub const _SC_SPIN_LOCKS: c_int = 80; ++pub const _SC_SPORADIC_SERVER: c_int = 81; ++pub const _SC_THREAD_ATTR_STACKADDR: c_int = 82; ++pub const _SC_THREAD_ATTR_STACKSIZE: c_int = 83; ++pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: c_int = 85; ++pub const _SC_THREAD_KEYS_MAX: c_int = 86; ++pub const _SC_THREAD_PRIO_INHERIT: c_int = 87; ++pub const _SC_THREAD_PRIO_PROTECT: c_int = 88; ++pub const _SC_THREAD_PRIORITY_SCHEDULING: c_int = 89; ++pub const _SC_THREAD_PROCESS_SHARED: c_int = 90; ++pub const _SC_THREAD_SAFE_FUNCTIONS: c_int = 91; ++pub const _SC_THREAD_SPORADIC_SERVER: c_int = 92; ++pub const _SC_THREAD_STACK_MIN: c_int = 93; ++pub const _SC_THREAD_THREADS_MAX: c_int = 94; ++pub const _SC_TIMEOUTS: c_int = 95; ++pub const _SC_THREADS: c_int = 96; ++pub const _SC_TRACE: c_int = 97; ++pub const _SC_TRACE_EVENT_FILTER: c_int = 98; ++pub const _SC_TRACE_INHERIT: c_int = 99; ++pub const _SC_TRACE_LOG: c_int = 100; ++pub const _SC_TTY_NAME_MAX: c_int = 101; ++pub const _SC_TYPED_MEMORY_OBJECTS: c_int = 102; ++pub const _SC_V6_ILP32_OFF32: c_int = 103; ++pub const _SC_V6_ILP32_OFFBIG: c_int = 104; ++pub const _SC_V6_LP64_OFF64: c_int = 105; ++pub const _SC_V6_LPBIG_OFFBIG: c_int = 106; ++pub const _SC_ATEXIT_MAX: c_int = 107; ++pub const _SC_XOPEN_CRYPT: c_int = 108; ++pub const _SC_XOPEN_ENH_I18N: c_int = 109; ++pub const _SC_XOPEN_LEGACY: c_int = 110; ++pub const _SC_XOPEN_REALTIME: c_int = 111; ++pub const _SC_XOPEN_REALTIME_THREADS: c_int = 112; ++pub const _SC_XOPEN_SHM: c_int = 113; ++pub const _SC_XOPEN_STREAMS: c_int = 114; ++pub const _SC_XOPEN_UNIX: c_int = 115; ++pub const _SC_XOPEN_VERSION: c_int = 116; ++pub const _SC_XOPEN_XCU_VERSION: c_int = 117; ++pub const _SC_IPV6: c_int = 118; ++pub const _SC_RAW_SOCKETS: c_int = 119; ++pub const _SC_SYMLOOP_MAX: c_int = 120; ++pub const _SC_PHYS_PAGES: c_int = 121; ++ ++pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = 0 as *mut _; ++pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = 0 as *mut _; ++pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = 0 as *mut _; ++pub const PTHREAD_MUTEX_ERRORCHECK: c_int = 1; ++pub const PTHREAD_MUTEX_RECURSIVE: c_int = 2; ++pub const PTHREAD_MUTEX_NORMAL: c_int = 3; ++pub const PTHREAD_MUTEX_DEFAULT: c_int = PTHREAD_MUTEX_ERRORCHECK; ++ ++pub const SCHED_FIFO: c_int = 1; ++pub const SCHED_OTHER: c_int = 2; ++pub const SCHED_RR: c_int = 3; ++ ++pub const FD_SETSIZE: usize = 1024; ++ ++pub const ST_NOSUID: c_ulong = 2; ++ ++pub const NI_MAXHOST: size_t = 1025; ++ ++pub const XUCRED_VERSION: c_uint = 0; ++ ++pub const RTLD_LOCAL: c_int = 0; ++pub const RTLD_NODELETE: c_int = 0x1000; ++pub const RTLD_NOLOAD: c_int = 0x2000; ++pub const RTLD_GLOBAL: c_int = 0x100; ++ ++pub const LOG_NTP: c_int = 12 << 3; ++pub const LOG_SECURITY: c_int = 13 << 3; ++pub const LOG_CONSOLE: c_int = 14 << 3; ++pub const LOG_NFACILITIES: c_int = 24; ++ ++pub const TIOCEXCL: c_ulong = 0x2000740d; ++pub const TIOCNXCL: c_ulong = 0x2000740e; ++pub const TIOCFLUSH: c_ulong = 0x80047410; ++pub const TIOCGETA: c_ulong = 0x402c7413; ++pub const TIOCSETA: c_ulong = 0x802c7414; ++pub const TIOCSETAW: c_ulong = 0x802c7415; ++pub const TIOCSETAF: c_ulong = 0x802c7416; ++pub const TIOCGETD: c_ulong = 0x4004741a; ++pub const TIOCSETD: c_ulong = 0x8004741b; ++pub const TIOCGDRAINWAIT: c_ulong = 0x40047456; ++pub const TIOCSDRAINWAIT: c_ulong = 0x80047457; ++pub const TIOCMGDTRWAIT: c_ulong = 0x4004745a; ++pub const TIOCMSDTRWAIT: c_ulong = 0x8004745b; ++pub const TIOCDRAIN: c_ulong = 0x2000745e; ++pub const TIOCEXT: c_ulong = 0x80047460; ++pub const TIOCSCTTY: c_ulong = 0x20007461; ++pub const TIOCCONS: c_ulong = 0x80047462; ++pub const TIOCGSID: c_ulong = 0x40047463; ++pub const TIOCSTAT: c_ulong = 0x20007465; ++pub const TIOCUCNTL: c_ulong = 0x80047466; ++pub const TIOCSWINSZ: c_ulong = 0x80087467; ++pub const TIOCGWINSZ: c_ulong = 0x40087468; ++pub const TIOCMGET: c_ulong = 0x4004746a; ++pub const TIOCM_LE: c_int = 0x1; ++pub const TIOCM_DTR: c_int = 0x2; ++pub const TIOCM_RTS: c_int = 0x4; ++pub const TIOCM_ST: c_int = 0x8; ++pub const TIOCM_SR: c_int = 0x10; ++pub const TIOCM_CTS: c_int = 0x20; ++pub const TIOCM_RI: c_int = 0x80; ++pub const TIOCM_DSR: c_int = 0x100; ++pub const TIOCM_CD: c_int = 0x40; ++pub const TIOCM_CAR: c_int = 0x40; ++pub const TIOCM_RNG: c_int = 0x80; ++pub const TIOCMBIC: c_ulong = 0x8004746b; ++pub const TIOCMBIS: c_ulong = 0x8004746c; ++pub const TIOCMSET: c_ulong = 0x8004746d; ++pub const TIOCSTART: c_ulong = 0x2000746e; ++pub const TIOCSTOP: c_ulong = 0x2000746f; ++pub const TIOCPKT: c_ulong = 0x80047470; ++pub const TIOCPKT_DATA: c_int = 0x0; ++pub const TIOCPKT_FLUSHREAD: c_int = 0x1; ++pub const TIOCPKT_FLUSHWRITE: c_int = 0x2; ++pub const TIOCPKT_STOP: c_int = 0x4; ++pub const TIOCPKT_START: c_int = 0x8; ++pub const TIOCPKT_NOSTOP: c_int = 0x10; ++pub const TIOCPKT_DOSTOP: c_int = 0x20; ++pub const TIOCPKT_IOCTL: c_int = 0x40; ++pub const TIOCNOTTY: c_ulong = 0x20007471; ++pub const TIOCSTI: c_ulong = 0x80017472; ++pub const TIOCOUTQ: c_ulong = 0x40047473; ++pub const TIOCSPGRP: c_ulong = 0x80047476; ++pub const TIOCGPGRP: c_ulong = 0x40047477; ++pub const TIOCCDTR: c_ulong = 0x20007478; ++pub const TIOCSDTR: c_ulong = 0x20007479; ++pub const TTYDISC: c_int = 0x0; ++pub const SLIPDISC: c_int = 0x4; ++pub const PPPDISC: c_int = 0x5; ++pub const NETGRAPHDISC: c_int = 0x6; ++ ++pub const BIOCGRSIG: c_ulong = 0x40044272; ++pub const BIOCSRSIG: c_ulong = 0x80044273; ++pub const BIOCSDLT: c_ulong = 0x80044278; ++pub const BIOCGSEESENT: c_ulong = 0x40044276; ++pub const BIOCSSEESENT: c_ulong = 0x80044277; ++cfg_if! { ++ if #[cfg(target_pointer_width = "64")] { ++ pub const BIOCGDLTLIST: c_ulong = 0xc0104279; ++ pub const BIOCSETF: c_ulong = 0x80104267; ++ } else if #[cfg(target_pointer_width = "32")] { ++ pub const BIOCGDLTLIST: c_ulong = 0xc0084279; ++ pub const BIOCSETF: c_ulong = 0x80084267; ++ } ++} ++ ++pub const FIODTYPE: c_ulong = 0x4004667a; ++pub const FIOGETLBA: c_ulong = 0x40046679; ++ ++pub const B0: speed_t = 0; ++pub const B50: speed_t = 50; ++pub const B75: speed_t = 75; ++pub const B110: speed_t = 110; ++pub const B134: speed_t = 134; ++pub const B150: speed_t = 150; ++pub const B200: speed_t = 200; ++pub const B300: speed_t = 300; ++pub const B600: speed_t = 600; ++pub const B1200: speed_t = 1200; ++pub const B1800: speed_t = 1800; ++pub const B2400: speed_t = 2400; ++pub const B4800: speed_t = 4800; ++pub const B9600: speed_t = 9600; ++pub const B19200: speed_t = 19200; ++pub const B38400: speed_t = 38400; ++pub const B7200: speed_t = 7200; ++pub const B14400: speed_t = 14400; ++pub const B28800: speed_t = 28800; ++pub const B57600: speed_t = 57600; ++pub const B76800: speed_t = 76800; ++pub const B115200: speed_t = 115200; ++pub const B230400: speed_t = 230400; ++pub const EXTA: speed_t = 19200; ++pub const EXTB: speed_t = 38400; ++ ++pub const SEM_FAILED: *mut sem_t = 0 as *mut sem_t; ++ ++pub const CRTSCTS: crate::tcflag_t = 0x00030000; ++pub const CCTS_OFLOW: crate::tcflag_t = 0x00010000; ++pub const CRTS_IFLOW: crate::tcflag_t = 0x00020000; ++pub const CDTR_IFLOW: crate::tcflag_t = 0x00040000; ++pub const CDSR_OFLOW: crate::tcflag_t = 0x00080000; ++pub const CCAR_OFLOW: crate::tcflag_t = 0x00100000; ++pub const VERASE2: usize = 7; ++pub const OCRNL: crate::tcflag_t = 0x10; ++pub const ONOCR: crate::tcflag_t = 0x20; ++pub const ONLRET: crate::tcflag_t = 0x40; ++ ++pub const CMGROUP_MAX: usize = 16; ++ ++pub const EUI64_LEN: usize = 8; ++ ++// https://github.com/freebsd/freebsd/blob/HEAD/sys/net/bpf.h ++pub const BPF_ALIGNMENT: usize = SIZEOF_LONG; ++ ++// Values for rtprio struct (prio field) and syscall (function argument) ++pub const RTP_PRIO_MIN: c_ushort = 0; ++pub const RTP_PRIO_MAX: c_ushort = 31; ++pub const RTP_LOOKUP: c_int = 0; ++pub const RTP_SET: c_int = 1; ++ ++// 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 UF_NOUNLINK: c_ulong = 0x00000010; ++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 SF_NOUNLINK: c_ulong = 0x00100000; ++ ++pub const TIMER_ABSTIME: c_int = 1; ++ ++// ++pub const NTP_API: c_int = 4; ++pub const MAXPHASE: c_long = 500000000; ++pub const MAXFREQ: c_long = 500000; ++pub const MINSEC: c_int = 256; ++pub const MAXSEC: c_int = 2048; ++pub const NANOSECOND: c_long = 1000000000; ++pub const SCALE_PPM: c_int = 65; ++pub const MAXTC: c_int = 10; ++pub const MOD_OFFSET: c_uint = 0x0001; ++pub const MOD_FREQUENCY: c_uint = 0x0002; ++pub const MOD_MAXERROR: c_uint = 0x0004; ++pub const MOD_ESTERROR: c_uint = 0x0008; ++pub const MOD_STATUS: c_uint = 0x0010; ++pub const MOD_TIMECONST: c_uint = 0x0020; ++pub const MOD_PPSMAX: c_uint = 0x0040; ++pub const MOD_TAI: c_uint = 0x0080; ++pub const MOD_MICRO: c_uint = 0x1000; ++pub const MOD_NANO: c_uint = 0x2000; ++pub const MOD_CLKB: c_uint = 0x4000; ++pub const MOD_CLKA: c_uint = 0x8000; ++pub const STA_PLL: c_int = 0x0001; ++pub const STA_PPSFREQ: c_int = 0x0002; ++pub const STA_PPSTIME: c_int = 0x0004; ++pub const STA_FLL: c_int = 0x0008; ++pub const STA_INS: c_int = 0x0010; ++pub const STA_DEL: c_int = 0x0020; ++pub const STA_UNSYNC: c_int = 0x0040; ++pub const STA_FREQHOLD: c_int = 0x0080; ++pub const STA_PPSSIGNAL: c_int = 0x0100; ++pub const STA_PPSJITTER: c_int = 0x0200; ++pub const STA_PPSWANDER: c_int = 0x0400; ++pub const STA_PPSERROR: c_int = 0x0800; ++pub const STA_CLOCKERR: c_int = 0x1000; ++pub const STA_NANO: c_int = 0x2000; ++pub const STA_MODE: c_int = 0x4000; ++pub const STA_CLK: c_int = 0x8000; ++pub const STA_RONLY: c_int = STA_PPSSIGNAL ++ | STA_PPSJITTER ++ | STA_PPSWANDER ++ | STA_PPSERROR ++ | STA_CLOCKERR ++ | STA_NANO ++ | STA_MODE ++ | STA_CLK; ++pub const TIME_OK: c_int = 0; ++pub const TIME_INS: c_int = 1; ++pub const TIME_DEL: c_int = 2; ++pub const TIME_OOP: c_int = 3; ++pub const TIME_WAIT: c_int = 4; ++pub const TIME_ERROR: c_int = 5; ++ ++pub const REG_ENOSYS: c_int = -1; ++pub const REG_ILLSEQ: c_int = 17; ++ ++pub const IPC_PRIVATE: crate::key_t = 0; ++pub const IPC_CREAT: c_int = 0o1000; ++pub const IPC_EXCL: c_int = 0o2000; ++pub const IPC_NOWAIT: c_int = 0o4000; ++pub const IPC_RMID: c_int = 0; ++pub const IPC_SET: c_int = 1; ++pub const IPC_STAT: c_int = 2; ++pub const IPC_R: c_int = 0o400; ++pub const IPC_W: c_int = 0o200; ++pub const IPC_M: c_int = 0o10000; ++ ++pub const SHM_RDONLY: c_int = 0o10000; ++pub const SHM_RND: c_int = 0o20000; ++pub const SHM_R: c_int = 0o400; ++pub const SHM_W: c_int = 0o200; ++ ++pub const KENV_GET: c_int = 0; ++pub const KENV_SET: c_int = 1; ++pub const KENV_UNSET: c_int = 2; ++pub const KENV_DUMP: c_int = 3; ++pub const KENV_MNAMELEN: c_int = 128; ++pub const KENV_MVALLEN: c_int = 128; ++ ++pub const RB_ASKNAME: c_int = 0x001; ++pub const RB_SINGLE: c_int = 0x002; ++pub const RB_NOSYNC: c_int = 0x004; ++pub const RB_HALT: c_int = 0x008; ++pub const RB_INITNAME: c_int = 0x010; ++pub const RB_DFLTROOT: c_int = 0x020; ++pub const RB_KDB: c_int = 0x040; ++pub const RB_RDONLY: c_int = 0x080; ++pub const RB_DUMP: c_int = 0x100; ++pub const RB_MINIROOT: c_int = 0x200; ++pub const RB_VERBOSE: c_int = 0x800; ++pub const RB_SERIAL: c_int = 0x1000; ++pub const RB_CDROM: c_int = 0x2000; ++pub const RB_POWEROFF: c_int = 0x4000; ++pub const RB_GDB: c_int = 0x8000; ++pub const RB_MUTE: c_int = 0x10000; ++pub const RB_SELFTEST: c_int = 0x20000; ++ ++// For getrandom() ++pub const GRND_NONBLOCK: c_uint = 0x1; ++pub const GRND_RANDOM: c_uint = 0x2; ++pub const GRND_INSECURE: c_uint = 0x4; ++ ++safe_f! { ++ pub {const} fn WIFCONTINUED(status: c_int) -> bool { ++ status == 0x13 ++ } ++ ++ pub {const} fn WSTOPSIG(status: c_int) -> c_int { ++ status >> 8 ++ } ++ ++ pub {const} fn WIFSTOPPED(status: c_int) -> bool { ++ (status & 0o177) == 0o177 ++ } ++} ++ ++extern "C" { ++ pub fn sem_destroy(sem: *mut sem_t) -> c_int; ++ pub fn sem_init(sem: *mut sem_t, pshared: c_int, value: c_uint) -> c_int; ++ ++ pub fn daemon(nochdir: c_int, noclose: c_int) -> c_int; ++ pub fn gettimeofday(tp: *mut crate::timeval, tz: *mut crate::timezone) -> c_int; ++ pub fn accept4( ++ s: c_int, ++ addr: *mut crate::sockaddr, ++ addrlen: *mut crate::socklen_t, ++ flags: c_int, ++ ) -> c_int; ++ pub fn chflags(path: *const c_char, flags: c_ulong) -> c_int; ++ pub fn chflagsat(fd: c_int, path: *const c_char, flags: c_ulong, atflag: c_int) -> c_int; ++ ++ pub fn clock_nanosleep( ++ clk_id: crate::clockid_t, ++ flags: c_int, ++ rqtp: *const crate::timespec, ++ rmtp: *mut crate::timespec, ++ ) -> c_int; ++ ++ pub fn clock_getres(clk_id: crate::clockid_t, tp: *mut crate::timespec) -> c_int; ++ pub fn clock_gettime(clk_id: crate::clockid_t, tp: *mut crate::timespec) -> c_int; ++ pub fn clock_settime(clk_id: crate::clockid_t, tp: *const crate::timespec) -> c_int; ++ pub fn clock_getcpuclockid(pid: crate::pid_t, clk_id: *mut crate::clockid_t) -> c_int; ++ ++ pub fn pthread_getcpuclockid(thread: crate::pthread_t, clk_id: *mut crate::clockid_t) -> c_int; ++ ++ pub fn dirfd(dirp: *mut crate::DIR) -> c_int; ++ pub fn duplocale(base: crate::locale_t) -> crate::locale_t; ++ pub fn endutxent(); ++ pub fn fchflags(fd: c_int, flags: c_ulong) -> c_int; ++ ++ // DIFF(main): changed to `*const *mut` in e77f551de9 ++ pub fn fexecve(fd: c_int, argv: *const *const c_char, envp: *const *const c_char) -> c_int; ++ ++ pub fn futimens(fd: c_int, times: *const crate::timespec) -> c_int; ++ pub fn getdomainname(name: *mut c_char, len: c_int) -> c_int; ++ pub fn getgrent_r( ++ grp: *mut crate::group, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut crate::group, ++ ) -> c_int; ++ pub fn getpwent_r( ++ pwd: *mut crate::passwd, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut crate::passwd, ++ ) -> c_int; ++ pub fn getgrouplist( ++ name: *const c_char, ++ basegid: crate::gid_t, ++ groups: *mut crate::gid_t, ++ ngroups: *mut c_int, ++ ) -> c_int; ++ pub fn getnameinfo( ++ sa: *const crate::sockaddr, ++ salen: crate::socklen_t, ++ host: *mut c_char, ++ hostlen: size_t, ++ serv: *mut c_char, ++ servlen: size_t, ++ flags: c_int, ++ ) -> c_int; ++ pub fn getpriority(which: c_int, who: c_int) -> c_int; ++ pub fn getresgid( ++ rgid: *mut crate::gid_t, ++ egid: *mut crate::gid_t, ++ sgid: *mut crate::gid_t, ++ ) -> c_int; ++ pub fn getresuid( ++ ruid: *mut crate::uid_t, ++ euid: *mut crate::uid_t, ++ suid: *mut crate::uid_t, ++ ) -> c_int; ++ pub fn getutxent() -> *mut utmpx; ++ pub fn getutxid(ut: *const utmpx) -> *mut utmpx; ++ pub fn getutxline(ut: *const utmpx) -> *mut utmpx; ++ pub fn initgroups(name: *const c_char, basegid: crate::gid_t) -> c_int; ++ #[cfg_attr( ++ all(target_os = "freebsd", any(freebsd11, freebsd10)), ++ link_name = "kevent@FBSD_1.0" ++ )] ++ pub fn kevent( ++ kq: c_int, ++ changelist: *const crate::kevent, ++ nchanges: c_int, ++ eventlist: *mut crate::kevent, ++ nevents: c_int, ++ timeout: *const crate::timespec, ++ ) -> c_int; ++ pub fn lchflags(path: *const c_char, flags: c_ulong) -> c_int; ++ pub fn lutimes(file: *const c_char, times: *const crate::timeval) -> c_int; ++ pub fn memrchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void; ++ pub fn mkfifoat(dirfd: c_int, pathname: *const c_char, mode: crate::mode_t) -> c_int; ++ #[cfg_attr( ++ all(target_os = "freebsd", any(freebsd11, freebsd10)), ++ link_name = "mknodat@FBSD_1.1" ++ )] ++ pub fn mknodat(dirfd: c_int, pathname: *const c_char, mode: crate::mode_t, dev: dev_t) ++ -> c_int; ++ pub fn malloc_usable_size(ptr: *const c_void) -> size_t; ++ pub fn mincore(addr: *const c_void, len: size_t, vec: *mut c_char) -> c_int; ++ pub fn newlocale(mask: c_int, locale: *const c_char, base: crate::locale_t) -> crate::locale_t; ++ pub fn nl_langinfo_l(item: crate::nl_item, locale: crate::locale_t) -> *mut c_char; ++ pub fn pipe2(fds: *mut c_int, flags: c_int) -> c_int; ++ pub fn posix_fallocate(fd: c_int, offset: off_t, len: off_t) -> c_int; ++ pub fn posix_fadvise(fd: c_int, offset: off_t, len: off_t, advise: c_int) -> c_int; ++ pub fn ppoll( ++ fds: *mut crate::pollfd, ++ nfds: crate::nfds_t, ++ timeout: *const crate::timespec, ++ sigmask: *const sigset_t, ++ ) -> c_int; ++ pub fn preadv(fd: c_int, iov: *const crate::iovec, iovcnt: c_int, offset: off_t) -> ssize_t; ++ pub fn pthread_attr_get_np(tid: crate::pthread_t, attr: *mut crate::pthread_attr_t) -> c_int; ++ pub fn pthread_attr_getguardsize( ++ attr: *const crate::pthread_attr_t, ++ guardsize: *mut size_t, ++ ) -> c_int; ++ pub fn pthread_attr_setguardsize(attr: *mut crate::pthread_attr_t, guardsize: size_t) -> c_int; ++ pub fn pthread_attr_getstack( ++ attr: *const crate::pthread_attr_t, ++ stackaddr: *mut *mut c_void, ++ stacksize: *mut size_t, ++ ) -> c_int; ++ pub fn pthread_condattr_getclock( ++ attr: *const pthread_condattr_t, ++ clock_id: *mut clockid_t, ++ ) -> c_int; ++ pub fn pthread_condattr_getpshared( ++ attr: *const pthread_condattr_t, ++ pshared: *mut c_int, ++ ) -> c_int; ++ pub fn pthread_condattr_setclock( ++ attr: *mut pthread_condattr_t, ++ clock_id: crate::clockid_t, ++ ) -> c_int; ++ pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t, pshared: c_int) -> c_int; ++ pub fn pthread_main_np() -> c_int; ++ pub fn pthread_mutex_timedlock( ++ lock: *mut pthread_mutex_t, ++ abstime: *const crate::timespec, ++ ) -> c_int; ++ pub fn pthread_mutexattr_getpshared( ++ attr: *const pthread_mutexattr_t, ++ pshared: *mut c_int, ++ ) -> c_int; ++ pub fn pthread_mutexattr_setpshared(attr: *mut pthread_mutexattr_t, pshared: c_int) -> c_int; ++ pub fn pthread_rwlockattr_getpshared( ++ attr: *const pthread_rwlockattr_t, ++ val: *mut c_int, ++ ) -> c_int; ++ pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, val: c_int) -> c_int; ++ pub fn pthread_barrierattr_init(attr: *mut crate::pthread_barrierattr_t) -> c_int; ++ pub fn pthread_barrierattr_destroy(attr: *mut crate::pthread_barrierattr_t) -> c_int; ++ pub fn pthread_barrierattr_getpshared( ++ attr: *const crate::pthread_barrierattr_t, ++ shared: *mut c_int, ++ ) -> c_int; ++ pub fn pthread_barrierattr_setpshared( ++ attr: *mut crate::pthread_barrierattr_t, ++ shared: c_int, ++ ) -> c_int; ++ pub fn pthread_barrier_init( ++ barrier: *mut pthread_barrier_t, ++ attr: *const crate::pthread_barrierattr_t, ++ count: c_uint, ++ ) -> c_int; ++ pub fn pthread_barrier_destroy(barrier: *mut pthread_barrier_t) -> c_int; ++ pub fn pthread_barrier_wait(barrier: *mut pthread_barrier_t) -> c_int; ++ pub fn pthread_get_name_np(tid: crate::pthread_t, name: *mut c_char, len: size_t); ++ pub fn pthread_set_name_np(tid: crate::pthread_t, name: *const c_char); ++ pub fn pthread_getname_np( ++ thread: crate::pthread_t, ++ buffer: *mut c_char, ++ length: size_t, ++ ) -> c_int; ++ pub fn pthread_setname_np(thread: crate::pthread_t, name: *const c_char) -> c_int; ++ pub fn pthread_setschedparam( ++ native: crate::pthread_t, ++ policy: c_int, ++ param: *const sched_param, ++ ) -> c_int; ++ pub fn pthread_getschedparam( ++ native: crate::pthread_t, ++ policy: *mut c_int, ++ param: *mut sched_param, ++ ) -> c_int; ++ pub fn ptrace(request: c_int, pid: crate::pid_t, addr: *mut c_char, data: c_int) -> c_int; ++ pub fn utrace(addr: *const c_void, len: size_t) -> c_int; ++ pub fn pututxline(ut: *const utmpx) -> *mut utmpx; ++ pub fn pwritev(fd: c_int, iov: *const crate::iovec, iovcnt: c_int, offset: off_t) -> ssize_t; ++ pub fn querylocale(mask: c_int, loc: crate::locale_t) -> *const c_char; ++ pub fn rtprio(function: c_int, pid: crate::pid_t, rtp: *mut rtprio) -> c_int; ++ pub fn sched_rr_get_interval(pid: crate::pid_t, t: *mut crate::timespec) -> c_int; ++ pub fn sched_getparam(pid: crate::pid_t, param: *mut sched_param) -> c_int; ++ pub fn sched_setparam(pid: crate::pid_t, param: *const sched_param) -> c_int; ++ pub fn sched_getscheduler(pid: crate::pid_t) -> c_int; ++ pub fn sched_setscheduler( ++ pid: crate::pid_t, ++ policy: c_int, ++ param: *const crate::sched_param, ++ ) -> c_int; ++ pub fn sem_getvalue(sem: *mut sem_t, sval: *mut c_int) -> c_int; ++ pub fn sem_timedwait(sem: *mut sem_t, abstime: *const crate::timespec) -> c_int; ++ pub fn sendfile( ++ fd: c_int, ++ s: c_int, ++ offset: off_t, ++ nbytes: size_t, ++ hdtr: *mut crate::sf_hdtr, ++ sbytes: *mut off_t, ++ flags: c_int, ++ ) -> c_int; ++ pub fn setdomainname(name: *const c_char, len: c_int) -> c_int; ++ pub fn sethostname(name: *const c_char, len: c_int) -> c_int; ++ pub fn setpriority(which: c_int, who: c_int, prio: c_int) -> c_int; ++ pub fn setresgid(rgid: crate::gid_t, egid: crate::gid_t, sgid: crate::gid_t) -> c_int; ++ pub fn setresuid(ruid: crate::uid_t, euid: crate::uid_t, suid: crate::uid_t) -> c_int; ++ pub fn settimeofday(tv: *const crate::timeval, tz: *const crate::timezone) -> c_int; ++ pub fn setutxent(); ++ pub fn shm_open(name: *const c_char, oflag: c_int, mode: crate::mode_t) -> c_int; ++ pub fn sigtimedwait( ++ set: *const sigset_t, ++ info: *mut siginfo_t, ++ timeout: *const crate::timespec, ++ ) -> c_int; ++ pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> c_int; ++ pub fn sysctl( ++ name: *const c_int, ++ namelen: c_uint, ++ oldp: *mut c_void, ++ oldlenp: *mut size_t, ++ newp: *const c_void, ++ newlen: size_t, ++ ) -> c_int; ++ pub fn sysctlbyname( ++ name: *const c_char, ++ oldp: *mut c_void, ++ oldlenp: *mut size_t, ++ newp: *const c_void, ++ newlen: size_t, ++ ) -> c_int; ++ pub fn sysctlnametomib(name: *const c_char, mibp: *mut c_int, sizep: *mut size_t) -> c_int; ++ pub fn uselocale(loc: crate::locale_t) -> crate::locale_t; ++ pub fn utimensat( ++ dirfd: c_int, ++ path: *const c_char, ++ times: *const crate::timespec, ++ flag: c_int, ++ ) -> c_int; ++ ++ pub fn ntp_adjtime(buf: *mut timex) -> c_int; ++ pub fn ntp_gettime(buf: *mut ntptimeval) -> c_int; ++ ++ // #include ++ pub fn dl_iterate_phdr( ++ callback: Option< ++ unsafe extern "C" fn(info: *mut dl_phdr_info, size: usize, data: *mut c_void) -> c_int, ++ >, ++ data: *mut c_void, ++ ) -> c_int; ++ ++ pub fn iconv_open(tocode: *const c_char, fromcode: *const c_char) -> iconv_t; ++ pub fn iconv( ++ cd: iconv_t, ++ inbuf: *mut *mut c_char, ++ inbytesleft: *mut size_t, ++ outbuf: *mut *mut c_char, ++ outbytesleft: *mut size_t, ++ ) -> size_t; ++ pub fn iconv_close(cd: iconv_t) -> c_int; ++ ++ // Added in `FreeBSD` 11.0 ++ // Added in `DragonFly BSD` 5.4 ++ pub fn explicit_bzero(s: *mut c_void, len: size_t); ++ // ISO/IEC 9899:2011 ("ISO C11") K.3.7.4.1 ++ pub fn memset_s(s: *mut c_void, smax: size_t, c: c_int, n: size_t) -> c_int; ++ pub fn gethostid() -> c_long; ++ pub fn sethostid(hostid: c_long); ++ ++ pub fn eui64_aton(a: *const c_char, e: *mut eui64) -> c_int; ++ pub fn eui64_ntoa(id: *const eui64, a: *mut c_char, len: size_t) -> c_int; ++ pub fn eui64_ntohost(hostname: *mut c_char, len: size_t, id: *const eui64) -> c_int; ++ pub fn eui64_hostton(hostname: *const c_char, id: *mut eui64) -> c_int; ++ ++ pub fn eaccess(path: *const c_char, mode: c_int) -> c_int; ++ ++ pub fn kenv(action: c_int, name: *const c_char, value: *mut c_char, len: c_int) -> c_int; ++ pub fn reboot(howto: c_int) -> c_int; ++ ++ pub fn exect(path: *const c_char, argv: *const *mut c_char, envp: *const *mut c_char) -> c_int; ++ pub fn execvP( ++ file: *const c_char, ++ search_path: *const c_char, ++ argv: *const *mut c_char, ++ ) -> c_int; ++} ++ ++#[link(name = "rt")] ++extern "C" { ++ pub fn mq_close(mqd: crate::mqd_t) -> c_int; ++ pub fn mq_getattr(mqd: crate::mqd_t, attr: *mut crate::mq_attr) -> c_int; ++ pub fn mq_notify(mqd: crate::mqd_t, notification: *const crate::sigevent) -> c_int; ++ pub fn mq_open(name: *const c_char, oflag: c_int, ...) -> crate::mqd_t; ++ pub fn mq_receive( ++ mqd: crate::mqd_t, ++ msg_ptr: *mut c_char, ++ msg_len: size_t, ++ msg_prio: *mut c_uint, ++ ) -> ssize_t; ++ pub fn mq_send( ++ mqd: crate::mqd_t, ++ msg_ptr: *const c_char, ++ msg_len: size_t, ++ msg_prio: c_uint, ++ ) -> c_int; ++ pub fn mq_setattr( ++ mqd: crate::mqd_t, ++ newattr: *const crate::mq_attr, ++ oldattr: *mut crate::mq_attr, ++ ) -> c_int; ++ pub fn mq_timedreceive( ++ mqd: crate::mqd_t, ++ msg_ptr: *mut c_char, ++ msg_len: size_t, ++ msg_prio: *mut c_uint, ++ abs_timeout: *const crate::timespec, ++ ) -> ssize_t; ++ pub fn mq_timedsend( ++ mqd: crate::mqd_t, ++ msg_ptr: *const c_char, ++ msg_len: size_t, ++ msg_prio: c_uint, ++ abs_timeout: *const crate::timespec, ++ ) -> c_int; ++ pub fn mq_unlink(name: *const c_char) -> c_int; ++ ++ pub fn getrandom(buf: *mut c_void, buflen: size_t, flags: c_uint) -> ssize_t; ++ pub fn getentropy(buf: *mut c_void, buflen: size_t) -> c_int; ++} ++ ++#[link(name = "util")] ++extern "C" { ++ pub fn openpty( ++ amaster: *mut c_int, ++ aslave: *mut c_int, ++ name: *mut c_char, ++ termp: *mut termios, ++ winp: *mut crate::winsize, ++ ) -> c_int; ++ pub fn forkpty( ++ amaster: *mut c_int, ++ name: *mut c_char, ++ termp: *mut termios, ++ winp: *mut crate::winsize, ++ ) -> crate::pid_t; ++ pub fn login_tty(fd: c_int) -> c_int; ++ pub fn fparseln( ++ stream: *mut crate::FILE, ++ len: *mut size_t, ++ lineno: *mut size_t, ++ delim: *const c_char, ++ flags: c_int, ++ ) -> *mut c_char; ++} ++ ++#[link(name = "execinfo")] ++extern "C" { ++ pub fn backtrace(addrlist: *mut *mut c_void, len: size_t) -> size_t; ++ pub fn backtrace_symbols(addrlist: *const *mut c_void, len: size_t) -> *mut *mut c_char; ++ pub fn backtrace_symbols_fd(addrlist: *const *mut c_void, len: size_t, fd: c_int) -> 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 crate::kvm_t; ++ pub fn kvm_close(kd: *mut crate::kvm_t) -> c_int; ++ pub fn kvm_getprocs( ++ kd: *mut crate::kvm_t, ++ op: c_int, ++ arg: c_int, ++ cnt: *mut c_int, ++ ) -> *mut crate::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 crate::kvm_t; ++ pub fn kvm_read( ++ kd: *mut crate::kvm_t, ++ addr: c_ulong, ++ buf: *mut c_void, ++ nbytes: size_t, ++ ) -> ssize_t; ++ pub fn kvm_write( ++ kd: *mut crate::kvm_t, ++ addr: c_ulong, ++ buf: *const c_void, ++ nbytes: size_t, ++ ) -> ssize_t; ++} ++ ++cfg_if! { ++ if #[cfg(target_os = "freebsd")] { ++ mod freebsd; ++ pub use self::freebsd::*; ++ } else if #[cfg(target_os = "dragonfly")] { ++ mod dragonfly; ++ pub use self::dragonfly::*; ++ } else { ++ // ... ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,989 @@ ++use crate::prelude::*; ++ ++pub type off_t = i64; ++pub type useconds_t = u32; ++pub type blkcnt_t = i64; ++pub type socklen_t = u32; ++pub type sa_family_t = u8; ++pub type pthread_t = crate::uintptr_t; ++pub type nfds_t = c_uint; ++pub type regoff_t = off_t; ++ ++s! { ++ pub struct sockaddr { ++ pub sa_len: u8, ++ pub sa_family: sa_family_t, ++ pub sa_data: [c_char; 14], ++ } ++ ++ pub struct sockaddr_in6 { ++ pub sin6_len: u8, ++ pub sin6_family: sa_family_t, ++ pub sin6_port: crate::in_port_t, ++ pub sin6_flowinfo: u32, ++ pub sin6_addr: crate::in6_addr, ++ pub sin6_scope_id: u32, ++ } ++ ++ pub struct passwd { ++ pub pw_name: *mut c_char, ++ pub pw_passwd: *mut c_char, ++ pub pw_uid: crate::uid_t, ++ pub pw_gid: crate::gid_t, ++ pub pw_change: crate::time_t, ++ pub pw_class: *mut c_char, ++ pub pw_gecos: *mut c_char, ++ pub pw_dir: *mut c_char, ++ pub pw_shell: *mut c_char, ++ pub pw_expire: crate::time_t, ++ ++ #[cfg(not(any( ++ target_os = "macos", ++ target_os = "ios", ++ target_os = "tvos", ++ target_os = "watchos", ++ target_os = "visionos", ++ target_os = "netbsd", ++ target_os = "openbsd" ++ )))] ++ pub pw_fields: c_int, ++ } ++ ++ pub struct ifaddrs { ++ pub ifa_next: *mut ifaddrs, ++ pub ifa_name: *mut c_char, ++ pub ifa_flags: c_uint, ++ pub ifa_addr: *mut crate::sockaddr, ++ pub ifa_netmask: *mut crate::sockaddr, ++ pub ifa_dstaddr: *mut crate::sockaddr, ++ pub ifa_data: *mut c_void, ++ #[cfg(target_os = "netbsd")] ++ pub ifa_addrflags: c_uint, ++ } ++ ++ pub struct fd_set { ++ #[cfg(all( ++ target_pointer_width = "64", ++ any(target_os = "freebsd", target_os = "dragonfly") ++ ))] ++ fds_bits: [i64; FD_SETSIZE as usize / 64], ++ #[cfg(not(all( ++ target_pointer_width = "64", ++ any(target_os = "freebsd", target_os = "dragonfly") ++ )))] ++ fds_bits: [i32; FD_SETSIZE as usize / 32], ++ } ++ ++ pub struct tm { ++ pub tm_sec: c_int, ++ pub tm_min: c_int, ++ pub tm_hour: c_int, ++ pub tm_mday: c_int, ++ pub tm_mon: c_int, ++ pub tm_year: c_int, ++ pub tm_wday: c_int, ++ pub tm_yday: c_int, ++ pub tm_isdst: c_int, ++ pub tm_gmtoff: c_long, ++ pub tm_zone: *mut c_char, ++ } ++ ++ pub struct msghdr { ++ pub msg_name: *mut c_void, ++ pub msg_namelen: crate::socklen_t, ++ pub msg_iov: *mut crate::iovec, ++ pub msg_iovlen: c_int, ++ pub msg_control: *mut c_void, ++ pub msg_controllen: crate::socklen_t, ++ pub msg_flags: c_int, ++ } ++ ++ pub struct cmsghdr { ++ pub cmsg_len: crate::socklen_t, ++ pub cmsg_level: c_int, ++ pub cmsg_type: c_int, ++ } ++ ++ pub struct fsid_t { ++ __fsid_val: [i32; 2], ++ } ++ ++ pub struct if_nameindex { ++ pub if_index: c_uint, ++ pub if_name: *mut c_char, ++ } ++ ++ pub struct regex_t { ++ __re_magic: c_int, ++ __re_nsub: size_t, ++ __re_endp: *const c_char, ++ __re_g: *mut c_void, ++ } ++ ++ pub struct regmatch_t { ++ pub rm_so: regoff_t, ++ pub rm_eo: regoff_t, ++ } ++ ++ pub struct option { ++ pub name: *const c_char, ++ pub has_arg: c_int, ++ pub flag: *mut c_int, ++ pub val: c_int, ++ } ++} ++ ++s_no_extra_traits! { ++ pub struct sockaddr_un { ++ pub sun_len: u8, ++ pub sun_family: sa_family_t, ++ pub sun_path: [c_char; 104], ++ } ++ ++ pub struct utsname { ++ #[cfg(not(target_os = "dragonfly"))] ++ pub sysname: [c_char; 256], ++ #[cfg(target_os = "dragonfly")] ++ pub sysname: [c_char; 32], ++ #[cfg(not(target_os = "dragonfly"))] ++ pub nodename: [c_char; 256], ++ #[cfg(target_os = "dragonfly")] ++ pub nodename: [c_char; 32], ++ #[cfg(not(target_os = "dragonfly"))] ++ pub release: [c_char; 256], ++ #[cfg(target_os = "dragonfly")] ++ pub release: [c_char; 32], ++ #[cfg(not(target_os = "dragonfly"))] ++ pub version: [c_char; 256], ++ #[cfg(target_os = "dragonfly")] ++ pub version: [c_char; 32], ++ #[cfg(not(target_os = "dragonfly"))] ++ pub machine: [c_char; 256], ++ #[cfg(target_os = "dragonfly")] ++ pub machine: [c_char; 32], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for sockaddr_un { ++ fn eq(&self, other: &sockaddr_un) -> bool { ++ self.sun_len == other.sun_len ++ && self.sun_family == other.sun_family ++ && self ++ .sun_path ++ .iter() ++ .zip(other.sun_path.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ ++ impl Eq for sockaddr_un {} ++ ++ impl fmt::Debug for sockaddr_un { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sockaddr_un") ++ .field("sun_len", &self.sun_len) ++ .field("sun_family", &self.sun_family) ++ // FIXME: .field("sun_path", &self.sun_path) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for sockaddr_un { ++ fn hash(&self, state: &mut H) { ++ self.sun_len.hash(state); ++ self.sun_family.hash(state); ++ self.sun_path.hash(state); ++ } ++ } ++ ++ impl PartialEq for utsname { ++ fn eq(&self, other: &utsname) -> bool { ++ self.sysname ++ .iter() ++ .zip(other.sysname.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .nodename ++ .iter() ++ .zip(other.nodename.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .release ++ .iter() ++ .zip(other.release.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .version ++ .iter() ++ .zip(other.version.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .machine ++ .iter() ++ .zip(other.machine.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ ++ impl Eq for utsname {} ++ ++ impl fmt::Debug for utsname { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("utsname") ++ // FIXME: .field("sysname", &self.sysname) ++ // FIXME: .field("nodename", &self.nodename) ++ // FIXME: .field("release", &self.release) ++ // FIXME: .field("version", &self.version) ++ // FIXME: .field("machine", &self.machine) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for utsname { ++ fn hash(&self, state: &mut H) { ++ self.sysname.hash(state); ++ self.nodename.hash(state); ++ self.release.hash(state); ++ self.version.hash(state); ++ self.machine.hash(state); ++ } ++ } ++ } ++} ++ ++pub const LC_ALL: c_int = 0; ++pub const LC_COLLATE: c_int = 1; ++pub const LC_CTYPE: c_int = 2; ++pub const LC_MONETARY: c_int = 3; ++pub const LC_NUMERIC: c_int = 4; ++pub const LC_TIME: c_int = 5; ++pub const LC_MESSAGES: c_int = 6; ++ ++pub const FIOCLEX: c_ulong = 0x20006601; ++pub const FIONCLEX: c_ulong = 0x20006602; ++pub const FIONREAD: c_ulong = 0x4004667f; ++pub const FIONBIO: c_ulong = 0x8004667e; ++pub const FIOASYNC: c_ulong = 0x8004667d; ++pub const FIOSETOWN: c_ulong = 0x8004667c; ++pub const FIOGETOWN: c_ulong = 0x4004667b; ++ ++pub const PATH_MAX: c_int = 1024; ++pub const MAXPATHLEN: c_int = PATH_MAX; ++ ++pub const IOV_MAX: c_int = 1024; ++ ++pub const SA_ONSTACK: c_int = 0x0001; ++pub const SA_SIGINFO: c_int = 0x0040; ++pub const SA_RESTART: c_int = 0x0002; ++pub const SA_RESETHAND: c_int = 0x0004; ++pub const SA_NOCLDSTOP: c_int = 0x0008; ++pub const SA_NODEFER: c_int = 0x0010; ++pub const SA_NOCLDWAIT: c_int = 0x0020; ++ ++pub const SS_ONSTACK: c_int = 1; ++pub const SS_DISABLE: c_int = 4; ++ ++pub const SIGCHLD: c_int = 20; ++pub const SIGBUS: c_int = 10; ++pub const SIGUSR1: c_int = 30; ++pub const SIGUSR2: c_int = 31; ++pub const SIGCONT: c_int = 19; ++pub const SIGSTOP: c_int = 17; ++pub const SIGTSTP: c_int = 18; ++pub const SIGURG: c_int = 16; ++pub const SIGIO: c_int = 23; ++pub const SIGSYS: c_int = 12; ++pub const SIGTTIN: c_int = 21; ++pub const SIGTTOU: c_int = 22; ++pub const SIGXCPU: c_int = 24; ++pub const SIGXFSZ: c_int = 25; ++pub const SIGVTALRM: c_int = 26; ++pub const SIGPROF: c_int = 27; ++pub const SIGWINCH: c_int = 28; ++pub const SIGINFO: c_int = 29; ++ ++pub const SIG_SETMASK: c_int = 3; ++pub const SIG_BLOCK: c_int = 0x1; ++pub const SIG_UNBLOCK: c_int = 0x2; ++ ++pub const IP_TOS: c_int = 3; ++pub const IP_MULTICAST_IF: c_int = 9; ++pub const IP_MULTICAST_TTL: c_int = 10; ++pub const IP_MULTICAST_LOOP: c_int = 11; ++ ++pub const IPV6_UNICAST_HOPS: c_int = 4; ++pub const IPV6_MULTICAST_IF: c_int = 9; ++pub const IPV6_MULTICAST_HOPS: c_int = 10; ++pub const IPV6_MULTICAST_LOOP: c_int = 11; ++pub const IPV6_V6ONLY: c_int = 27; ++pub const IPV6_DONTFRAG: c_int = 62; ++ ++pub const IPTOS_ECN_NOTECT: u8 = 0x00; ++pub const IPTOS_ECN_MASK: u8 = 0x03; ++pub const IPTOS_ECN_ECT1: u8 = 0x01; ++pub const IPTOS_ECN_ECT0: u8 = 0x02; ++pub const IPTOS_ECN_CE: u8 = 0x03; ++ ++pub const ST_RDONLY: c_ulong = 1; ++ ++pub const SCM_RIGHTS: c_int = 0x01; ++ ++pub const NCCS: usize = 20; ++ ++pub const O_ACCMODE: c_int = 0x3; ++pub const O_RDONLY: c_int = 0; ++pub const O_WRONLY: c_int = 1; ++pub const O_RDWR: c_int = 2; ++pub const O_APPEND: c_int = 8; ++pub const O_CREAT: c_int = 512; ++pub const O_TRUNC: c_int = 1024; ++pub const O_EXCL: c_int = 2048; ++pub const O_ASYNC: c_int = 0x40; ++pub const O_SYNC: c_int = 0x80; ++pub const O_NONBLOCK: c_int = 0x4; ++pub const O_NOFOLLOW: c_int = 0x100; ++pub const O_SHLOCK: c_int = 0x10; ++pub const O_EXLOCK: c_int = 0x20; ++pub const O_FSYNC: c_int = O_SYNC; ++pub const O_NDELAY: c_int = O_NONBLOCK; ++ ++pub const F_GETOWN: c_int = 5; ++pub const F_SETOWN: c_int = 6; ++ ++pub const F_RDLCK: c_short = 1; ++pub const F_UNLCK: c_short = 2; ++pub const F_WRLCK: c_short = 3; ++ ++pub const MNT_RDONLY: c_int = 0x00000001; ++pub const MNT_SYNCHRONOUS: c_int = 0x00000002; ++pub const MNT_NOEXEC: c_int = 0x00000004; ++pub const MNT_NOSUID: c_int = 0x00000008; ++pub const MNT_ASYNC: c_int = 0x00000040; ++pub const MNT_EXPORTED: c_int = 0x00000100; ++pub const MNT_UPDATE: c_int = 0x00010000; ++pub const MNT_RELOAD: c_int = 0x00040000; ++pub const MNT_FORCE: c_int = 0x00080000; ++ ++pub const Q_SYNC: c_int = 0x600; ++pub const Q_QUOTAON: c_int = 0x100; ++pub const Q_QUOTAOFF: c_int = 0x200; ++ ++pub const TCIOFF: c_int = 3; ++pub const TCION: c_int = 4; ++pub const TCOOFF: c_int = 1; ++pub const TCOON: c_int = 2; ++pub const TCIFLUSH: c_int = 1; ++pub const TCOFLUSH: c_int = 2; ++pub const TCIOFLUSH: c_int = 3; ++pub const TCSANOW: c_int = 0; ++pub const TCSADRAIN: c_int = 1; ++pub const TCSAFLUSH: c_int = 2; ++pub const VEOF: usize = 0; ++pub const VEOL: usize = 1; ++pub const VEOL2: usize = 2; ++pub const VERASE: usize = 3; ++pub const VWERASE: usize = 4; ++pub const VKILL: usize = 5; ++pub const VREPRINT: usize = 6; ++pub const VINTR: usize = 8; ++pub const VQUIT: usize = 9; ++pub const VSUSP: usize = 10; ++pub const VDSUSP: usize = 11; ++pub const VSTART: usize = 12; ++pub const VSTOP: usize = 13; ++pub const VLNEXT: usize = 14; ++pub const VDISCARD: usize = 15; ++pub const VMIN: usize = 16; ++pub const VTIME: usize = 17; ++pub const VSTATUS: usize = 18; ++pub const _POSIX_VDISABLE: crate::cc_t = 0xff; ++pub const IGNBRK: crate::tcflag_t = 0x00000001; ++pub const BRKINT: crate::tcflag_t = 0x00000002; ++pub const IGNPAR: crate::tcflag_t = 0x00000004; ++pub const PARMRK: crate::tcflag_t = 0x00000008; ++pub const INPCK: crate::tcflag_t = 0x00000010; ++pub const ISTRIP: crate::tcflag_t = 0x00000020; ++pub const INLCR: crate::tcflag_t = 0x00000040; ++pub const IGNCR: crate::tcflag_t = 0x00000080; ++pub const ICRNL: crate::tcflag_t = 0x00000100; ++pub const IXON: crate::tcflag_t = 0x00000200; ++pub const IXOFF: crate::tcflag_t = 0x00000400; ++pub const IXANY: crate::tcflag_t = 0x00000800; ++pub const IMAXBEL: crate::tcflag_t = 0x00002000; ++pub const OPOST: crate::tcflag_t = 0x1; ++pub const ONLCR: crate::tcflag_t = 0x2; ++pub const OXTABS: crate::tcflag_t = 0x4; ++pub const ONOEOT: crate::tcflag_t = 0x8; ++pub const CIGNORE: crate::tcflag_t = 0x00000001; ++pub const CSIZE: crate::tcflag_t = 0x00000300; ++pub const CS5: crate::tcflag_t = 0x00000000; ++pub const CS6: crate::tcflag_t = 0x00000100; ++pub const CS7: crate::tcflag_t = 0x00000200; ++pub const CS8: crate::tcflag_t = 0x00000300; ++pub const CSTOPB: crate::tcflag_t = 0x00000400; ++pub const CREAD: crate::tcflag_t = 0x00000800; ++pub const PARENB: crate::tcflag_t = 0x00001000; ++pub const PARODD: crate::tcflag_t = 0x00002000; ++pub const HUPCL: crate::tcflag_t = 0x00004000; ++pub const CLOCAL: crate::tcflag_t = 0x00008000; ++pub const ECHOKE: crate::tcflag_t = 0x00000001; ++pub const ECHOE: crate::tcflag_t = 0x00000002; ++pub const ECHOK: crate::tcflag_t = 0x00000004; ++pub const ECHO: crate::tcflag_t = 0x00000008; ++pub const ECHONL: crate::tcflag_t = 0x00000010; ++pub const ECHOPRT: crate::tcflag_t = 0x00000020; ++pub const ECHOCTL: crate::tcflag_t = 0x00000040; ++pub const ISIG: crate::tcflag_t = 0x00000080; ++pub const ICANON: crate::tcflag_t = 0x00000100; ++pub const ALTWERASE: crate::tcflag_t = 0x00000200; ++pub const IEXTEN: crate::tcflag_t = 0x00000400; ++pub const EXTPROC: crate::tcflag_t = 0x00000800; ++pub const TOSTOP: crate::tcflag_t = 0x00400000; ++pub const FLUSHO: crate::tcflag_t = 0x00800000; ++pub const NOKERNINFO: crate::tcflag_t = 0x02000000; ++pub const PENDIN: crate::tcflag_t = 0x20000000; ++pub const NOFLSH: crate::tcflag_t = 0x80000000; ++pub const MDMBUF: crate::tcflag_t = 0x00100000; ++ ++pub const WNOHANG: c_int = 0x00000001; ++pub const WUNTRACED: c_int = 0x00000002; ++ ++pub const RTLD_LAZY: c_int = 0x1; ++pub const RTLD_NOW: c_int = 0x2; ++pub const RTLD_NEXT: *mut c_void = -1isize as *mut c_void; ++pub const RTLD_DEFAULT: *mut c_void = -2isize as *mut c_void; ++pub const RTLD_SELF: *mut c_void = -3isize as *mut c_void; ++ ++pub const LOG_CRON: c_int = 9 << 3; ++pub const LOG_AUTHPRIV: c_int = 10 << 3; ++pub const LOG_FTP: c_int = 11 << 3; ++pub const LOG_PERROR: c_int = 0x20; ++ ++pub const TCP_NODELAY: c_int = 1; ++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; ++pub const CLD_TRAPPED: c_int = 4; ++pub const CLD_STOPPED: c_int = 5; ++pub const CLD_CONTINUED: c_int = 6; ++ ++pub const POLLIN: c_short = 0x1; ++pub const POLLPRI: c_short = 0x2; ++pub const POLLOUT: c_short = 0x4; ++pub const POLLERR: c_short = 0x8; ++pub const POLLHUP: c_short = 0x10; ++pub const POLLNVAL: c_short = 0x20; ++pub const POLLRDNORM: c_short = 0x040; ++pub const POLLWRNORM: c_short = 0x004; ++pub const POLLRDBAND: c_short = 0x080; ++pub const POLLWRBAND: c_short = 0x100; ++ ++pub const BIOCGBLEN: c_ulong = 0x40044266; ++pub const BIOCSBLEN: c_ulong = 0xc0044266; ++pub const BIOCFLUSH: c_uint = 0x20004268; ++pub const BIOCPROMISC: c_uint = 0x20004269; ++pub const BIOCGDLT: c_ulong = 0x4004426a; ++pub const BIOCGETIF: c_ulong = 0x4020426b; ++pub const BIOCSETIF: c_ulong = 0x8020426c; ++pub const BIOCGSTATS: c_ulong = 0x4008426f; ++pub const BIOCIMMEDIATE: c_ulong = 0x80044270; ++pub const BIOCVERSION: c_ulong = 0x40044271; ++pub const BIOCGHDRCMPLT: c_ulong = 0x40044274; ++pub const BIOCSHDRCMPLT: c_ulong = 0x80044275; ++pub const SIOCGIFADDR: c_ulong = 0xc0206921; ++ ++pub const REG_BASIC: c_int = 0o0000; ++pub const REG_EXTENDED: c_int = 0o0001; ++pub const REG_ICASE: c_int = 0o0002; ++pub const REG_NOSUB: c_int = 0o0004; ++pub const REG_NEWLINE: c_int = 0o0010; ++pub const REG_NOSPEC: c_int = 0o0020; ++pub const REG_PEND: c_int = 0o0040; ++pub const REG_DUMP: c_int = 0o0200; ++ ++pub const REG_NOMATCH: c_int = 1; ++pub const REG_BADPAT: c_int = 2; ++pub const REG_ECOLLATE: c_int = 3; ++pub const REG_ECTYPE: c_int = 4; ++pub const REG_EESCAPE: c_int = 5; ++pub const REG_ESUBREG: c_int = 6; ++pub const REG_EBRACK: c_int = 7; ++pub const REG_EPAREN: c_int = 8; ++pub const REG_EBRACE: c_int = 9; ++pub const REG_BADBR: c_int = 10; ++pub const REG_ERANGE: c_int = 11; ++pub const REG_ESPACE: c_int = 12; ++pub const REG_BADRPT: c_int = 13; ++pub const REG_EMPTY: c_int = 14; ++pub const REG_ASSERT: c_int = 15; ++pub const REG_INVARG: c_int = 16; ++pub const REG_ATOI: c_int = 255; ++pub const REG_ITOA: c_int = 0o0400; ++ ++pub const REG_NOTBOL: c_int = 0o00001; ++pub const REG_NOTEOL: c_int = 0o00002; ++pub const REG_STARTEND: c_int = 0o00004; ++pub const REG_TRACE: c_int = 0o00400; ++pub const REG_LARGE: c_int = 0o01000; ++pub const REG_BACKR: c_int = 0o02000; ++ ++pub const TIOCCBRK: c_uint = 0x2000747a; ++pub const TIOCSBRK: c_uint = 0x2000747b; ++ ++pub const PRIO_PROCESS: c_int = 0; ++pub const PRIO_PGRP: c_int = 1; ++pub const PRIO_USER: c_int = 2; ++ ++pub const ITIMER_REAL: c_int = 0; ++pub const ITIMER_VIRTUAL: c_int = 1; ++pub const ITIMER_PROF: c_int = 2; ++ ++// net/route.h ++ ++pub const RTF_UP: c_int = 0x1; ++pub const RTF_GATEWAY: c_int = 0x2; ++pub const RTF_HOST: c_int = 0x4; ++pub const RTF_REJECT: c_int = 0x8; ++pub const RTF_DYNAMIC: c_int = 0x10; ++pub const RTF_MODIFIED: c_int = 0x20; ++pub const RTF_DONE: c_int = 0x40; ++pub const RTF_STATIC: c_int = 0x800; ++pub const RTF_BLACKHOLE: c_int = 0x1000; ++pub const RTF_PROTO2: c_int = 0x4000; ++pub const RTF_PROTO1: c_int = 0x8000; ++ ++// Message types ++pub const RTM_ADD: c_int = 0x1; ++pub const RTM_DELETE: c_int = 0x2; ++pub const RTM_CHANGE: c_int = 0x3; ++pub const RTM_GET: c_int = 0x4; ++pub const RTM_LOSING: c_int = 0x5; ++pub const RTM_REDIRECT: c_int = 0x6; ++pub const RTM_MISS: c_int = 0x7; ++ ++// Bitmask values for rtm_addrs. ++pub const RTA_DST: c_int = 0x1; ++pub const RTA_GATEWAY: c_int = 0x2; ++pub const RTA_NETMASK: c_int = 0x4; ++pub const RTA_GENMASK: c_int = 0x8; ++pub const RTA_IFP: c_int = 0x10; ++pub const RTA_IFA: c_int = 0x20; ++pub const RTA_AUTHOR: c_int = 0x40; ++pub const RTA_BRD: c_int = 0x80; ++ ++// Index offsets for sockaddr array for alternate internal encoding. ++pub const RTAX_DST: c_int = 0; ++pub const RTAX_GATEWAY: c_int = 1; ++pub const RTAX_NETMASK: c_int = 2; ++pub const RTAX_GENMASK: c_int = 3; ++pub const RTAX_IFP: c_int = 4; ++pub const RTAX_IFA: c_int = 5; ++pub const RTAX_AUTHOR: c_int = 6; ++pub const RTAX_BRD: c_int = 7; ++ ++f! { ++ pub fn CMSG_FIRSTHDR(mhdr: *const crate::msghdr) -> *mut cmsghdr { ++ if (*mhdr).msg_controllen as usize >= mem::size_of::() { ++ (*mhdr).msg_control as *mut cmsghdr ++ } else { ++ core::ptr::null_mut() ++ } ++ } ++ ++ pub fn FD_CLR(fd: c_int, set: *mut fd_set) -> () { ++ let bits = mem::size_of_val(&(*set).fds_bits[0]) * 8; ++ let fd = fd as usize; ++ (*set).fds_bits[fd / bits] &= !(1 << (fd % bits)); ++ return; ++ } ++ ++ pub fn FD_ISSET(fd: c_int, set: *const fd_set) -> bool { ++ let bits = mem::size_of_val(&(*set).fds_bits[0]) * 8; ++ let fd = fd as usize; ++ return ((*set).fds_bits[fd / bits] & (1 << (fd % bits))) != 0; ++ } ++ ++ pub fn FD_SET(fd: c_int, set: *mut fd_set) -> () { ++ let bits = mem::size_of_val(&(*set).fds_bits[0]) * 8; ++ let fd = fd as usize; ++ (*set).fds_bits[fd / bits] |= 1 << (fd % bits); ++ return; ++ } ++ ++ pub fn FD_ZERO(set: *mut fd_set) -> () { ++ for slot in (*set).fds_bits.iter_mut() { ++ *slot = 0; ++ } ++ } ++} ++ ++safe_f! { ++ pub {const} fn WTERMSIG(status: c_int) -> c_int { ++ status & 0o177 ++ } ++ ++ pub {const} fn WIFEXITED(status: c_int) -> bool { ++ (status & 0o177) == 0 ++ } ++ ++ pub {const} fn WEXITSTATUS(status: c_int) -> c_int { ++ status >> 8 ++ } ++ ++ pub {const} fn WCOREDUMP(status: c_int) -> bool { ++ (status & 0o200) != 0 ++ } ++ ++ pub {const} fn QCMD(cmd: c_int, type_: c_int) -> c_int { ++ (cmd << 8) | (type_ & 0x00ff) ++ } ++} ++ ++extern "C" { ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "getrlimit$UNIX2003" ++ )] ++ pub fn getrlimit(resource: c_int, rlim: *mut crate::rlimit) -> c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "setrlimit$UNIX2003" ++ )] ++ pub fn setrlimit(resource: c_int, rlim: *const crate::rlimit) -> c_int; ++ ++ pub fn strerror_r(errnum: c_int, buf: *mut c_char, buflen: size_t) -> c_int; ++ pub fn abs(i: c_int) -> c_int; ++ pub fn labs(i: c_long) -> c_long; ++ #[cfg_attr( ++ all(target_os = "freebsd", any(freebsd12, freebsd11, freebsd10)), ++ link_name = "rand@FBSD_1.0" ++ )] ++ pub fn rand() -> c_int; ++ #[cfg_attr( ++ all(target_os = "freebsd", any(freebsd12, freebsd11, freebsd10)), ++ link_name = "srand@FBSD_1.0" ++ )] ++ pub fn srand(seed: c_uint); ++ ++ pub fn getifaddrs(ifap: *mut *mut crate::ifaddrs) -> c_int; ++ pub fn freeifaddrs(ifa: *mut crate::ifaddrs); ++ pub fn setgroups(ngroups: c_int, ptr: *const crate::gid_t) -> c_int; ++ pub fn setlogin(name: *const c_char) -> c_int; ++ pub fn ioctl(fd: c_int, request: c_ulong, ...) -> c_int; ++ pub fn kqueue() -> c_int; ++ pub fn unmount(target: *const c_char, arg: c_int) -> c_int; ++ pub fn syscall(num: c_int, ...) -> c_int; ++ #[cfg_attr(target_os = "netbsd", link_name = "__getpwent50")] ++ pub fn getpwent() -> *mut passwd; ++ pub fn setpwent(); ++ pub fn endpwent(); ++ pub fn endgrent(); ++ pub fn getgrent() -> *mut crate::group; ++ ++ pub fn getprogname() -> *const c_char; ++ pub fn setprogname(name: *const c_char); ++ pub fn getloadavg(loadavg: *mut c_double, nelem: c_int) -> c_int; ++ pub fn if_nameindex() -> *mut if_nameindex; ++ pub fn if_freenameindex(ptr: *mut if_nameindex); ++ ++ pub fn getpeereid(socket: c_int, euid: *mut crate::uid_t, egid: *mut crate::gid_t) -> c_int; ++ ++ #[cfg_attr( ++ all(target_os = "macos", not(target_arch = "aarch64")), ++ link_name = "glob$INODE64" ++ )] ++ #[cfg_attr(target_os = "netbsd", link_name = "__glob30")] ++ #[cfg_attr( ++ all(target_os = "freebsd", any(freebsd11, freebsd10)), ++ link_name = "glob@FBSD_1.0" ++ )] ++ pub fn glob( ++ pattern: *const c_char, ++ flags: c_int, ++ errfunc: Option c_int>, ++ pglob: *mut crate::glob_t, ++ ) -> c_int; ++ #[cfg_attr(target_os = "netbsd", link_name = "__globfree30")] ++ #[cfg_attr( ++ all(target_os = "freebsd", any(freebsd11, freebsd10)), ++ link_name = "globfree@FBSD_1.0" ++ )] ++ pub fn globfree(pglob: *mut crate::glob_t); ++ ++ pub fn posix_madvise(addr: *mut c_void, len: size_t, advice: c_int) -> c_int; ++ ++ pub fn shm_unlink(name: *const c_char) -> c_int; ++ ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86_64"), ++ link_name = "seekdir$INODE64" ++ )] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "seekdir$INODE64$UNIX2003" ++ )] ++ pub fn seekdir(dirp: *mut crate::DIR, loc: c_long); ++ ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86_64"), ++ link_name = "telldir$INODE64" ++ )] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "telldir$INODE64$UNIX2003" ++ )] ++ pub fn telldir(dirp: *mut crate::DIR) -> c_long; ++ pub fn madvise(addr: *mut c_void, len: size_t, advice: c_int) -> c_int; ++ ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "msync$UNIX2003" ++ )] ++ #[cfg_attr(target_os = "netbsd", link_name = "__msync13")] ++ pub fn msync(addr: *mut c_void, len: size_t, flags: c_int) -> c_int; ++ ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "recvfrom$UNIX2003" ++ )] ++ pub fn recvfrom( ++ socket: c_int, ++ buf: *mut c_void, ++ len: size_t, ++ flags: c_int, ++ addr: *mut crate::sockaddr, ++ addrlen: *mut crate::socklen_t, ++ ) -> ssize_t; ++ pub fn mkstemps(template: *mut c_char, suffixlen: c_int) -> c_int; ++ #[cfg_attr(target_os = "netbsd", link_name = "__futimes50")] ++ pub fn futimes(fd: c_int, times: *const crate::timeval) -> c_int; ++ pub fn nl_langinfo(item: crate::nl_item) -> *mut c_char; ++ ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "bind$UNIX2003" ++ )] ++ pub fn bind( ++ socket: c_int, ++ address: *const crate::sockaddr, ++ address_len: crate::socklen_t, ++ ) -> c_int; ++ ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "writev$UNIX2003" ++ )] ++ pub fn writev(fd: c_int, iov: *const crate::iovec, iovcnt: c_int) -> ssize_t; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "readv$UNIX2003" ++ )] ++ pub fn readv(fd: c_int, iov: *const crate::iovec, iovcnt: c_int) -> ssize_t; ++ ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "sendmsg$UNIX2003" ++ )] ++ pub fn sendmsg(fd: c_int, msg: *const crate::msghdr, flags: c_int) -> ssize_t; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "recvmsg$UNIX2003" ++ )] ++ pub fn recvmsg(fd: c_int, msg: *mut crate::msghdr, flags: c_int) -> ssize_t; ++ ++ pub fn sync(); ++ pub fn getgrgid_r( ++ gid: crate::gid_t, ++ grp: *mut crate::group, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut crate::group, ++ ) -> c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "sigaltstack$UNIX2003" ++ )] ++ #[cfg_attr(target_os = "netbsd", link_name = "__sigaltstack14")] ++ pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> c_int; ++ pub fn sigsuspend(mask: *const crate::sigset_t) -> c_int; ++ pub fn sem_close(sem: *mut sem_t) -> c_int; ++ pub fn getdtablesize() -> c_int; ++ pub fn getgrnam_r( ++ name: *const c_char, ++ grp: *mut crate::group, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut crate::group, ++ ) -> c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "pthread_sigmask$UNIX2003" ++ )] ++ pub fn pthread_sigmask(how: c_int, set: *const sigset_t, oldset: *mut sigset_t) -> c_int; ++ pub fn sem_open(name: *const c_char, oflag: c_int, ...) -> *mut sem_t; ++ pub fn getgrnam(name: *const c_char) -> *mut crate::group; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "pthread_cancel$UNIX2003" ++ )] ++ pub fn pthread_cancel(thread: crate::pthread_t) -> c_int; ++ pub fn pthread_kill(thread: crate::pthread_t, sig: c_int) -> c_int; ++ pub fn sched_get_priority_min(policy: c_int) -> c_int; ++ pub fn sched_get_priority_max(policy: c_int) -> c_int; ++ pub fn sem_unlink(name: *const c_char) -> c_int; ++ #[cfg_attr(target_os = "netbsd", link_name = "__getpwnam_r50")] ++ pub fn getpwnam_r( ++ name: *const c_char, ++ pwd: *mut passwd, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut passwd, ++ ) -> c_int; ++ #[cfg_attr(target_os = "netbsd", link_name = "__getpwuid_r50")] ++ pub fn getpwuid_r( ++ uid: crate::uid_t, ++ pwd: *mut passwd, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut passwd, ++ ) -> c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "sigwait$UNIX2003" ++ )] ++ pub fn sigwait(set: *const sigset_t, sig: *mut c_int) -> c_int; ++ pub fn pthread_atfork( ++ prepare: Option, ++ parent: Option, ++ child: Option, ++ ) -> c_int; ++ pub fn getgrgid(gid: crate::gid_t) -> *mut crate::group; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "popen$UNIX2003" ++ )] ++ pub fn popen(command: *const c_char, mode: *const c_char) -> *mut crate::FILE; ++ pub fn faccessat(dirfd: c_int, pathname: *const c_char, mode: c_int, flags: c_int) -> c_int; ++ pub fn pthread_create( ++ native: *mut crate::pthread_t, ++ attr: *const crate::pthread_attr_t, ++ f: extern "C" fn(*mut c_void) -> *mut c_void, ++ value: *mut c_void, ++ ) -> c_int; ++ pub fn acct(filename: *const c_char) -> c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "wait4$UNIX2003" ++ )] ++ #[cfg_attr( ++ all(target_os = "freebsd", any(freebsd12, freebsd11, freebsd10)), ++ link_name = "wait4@FBSD_1.0" ++ )] ++ pub fn wait4( ++ pid: crate::pid_t, ++ status: *mut c_int, ++ options: c_int, ++ rusage: *mut crate::rusage, ++ ) -> crate::pid_t; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "getitimer$UNIX2003" ++ )] ++ pub fn getitimer(which: c_int, curr_value: *mut crate::itimerval) -> c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "setitimer$UNIX2003" ++ )] ++ pub fn setitimer( ++ which: c_int, ++ new_value: *const crate::itimerval, ++ old_value: *mut crate::itimerval, ++ ) -> c_int; ++ ++ pub fn regcomp(preg: *mut regex_t, pattern: *const c_char, cflags: c_int) -> c_int; ++ ++ pub fn regexec( ++ preg: *const regex_t, ++ input: *const c_char, ++ nmatch: size_t, ++ pmatch: *mut regmatch_t, ++ eflags: c_int, ++ ) -> c_int; ++ ++ pub fn regerror( ++ errcode: c_int, ++ preg: *const regex_t, ++ errbuf: *mut c_char, ++ errbuf_size: size_t, ++ ) -> size_t; ++ ++ pub fn regfree(preg: *mut regex_t); ++ ++ pub fn arc4random() -> u32; ++ pub fn arc4random_buf(buf: *mut c_void, size: size_t); ++ pub fn arc4random_uniform(l: u32) -> u32; ++ ++ pub fn drand48() -> c_double; ++ pub fn erand48(xseed: *mut c_ushort) -> c_double; ++ pub fn lrand48() -> c_long; ++ pub fn nrand48(xseed: *mut c_ushort) -> c_long; ++ pub fn mrand48() -> c_long; ++ pub fn jrand48(xseed: *mut c_ushort) -> c_long; ++ pub fn srand48(seed: c_long); ++ pub fn seed48(xseed: *mut c_ushort) -> *mut c_ushort; ++ pub fn lcong48(p: *mut c_ushort); ++ pub fn getopt_long( ++ argc: c_int, ++ argv: *const *mut c_char, ++ optstring: *const c_char, ++ longopts: *const option, ++ longindex: *mut c_int, ++ ) -> c_int; ++ ++ pub fn strftime( ++ buf: *mut c_char, ++ maxsize: size_t, ++ format: *const c_char, ++ timeptr: *const crate::tm, ++ ) -> size_t; ++ pub fn strftime_l( ++ buf: *mut c_char, ++ maxsize: size_t, ++ format: *const c_char, ++ timeptr: *const crate::tm, ++ locale: crate::locale_t, ++ ) -> size_t; ++} ++ ++cfg_if! { ++ if #[cfg(any( ++ target_os = "macos", ++ target_os = "ios", ++ target_os = "tvos", ++ target_os = "watchos", ++ target_os = "visionos" ++ ))] { ++ mod apple; ++ pub use self::apple::*; ++ } else if #[cfg(any(target_os = "openbsd", target_os = "netbsd"))] { ++ mod netbsdlike; ++ pub use self::netbsdlike::*; ++ } else if #[cfg(any(target_os = "freebsd", target_os = "dragonfly"))] { ++ mod freebsdlike; ++ pub use self::freebsdlike::*; ++ } else { ++ // Unknown target_os ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,876 @@ ++use crate::off_t; ++use crate::prelude::*; ++ ++pub type wchar_t = i32; ++pub type time_t = i64; ++pub type mode_t = u32; ++pub type nlink_t = u32; ++pub type ino_t = u64; ++pub type pthread_key_t = c_int; ++pub type rlim_t = u64; ++pub type speed_t = c_uint; ++pub type tcflag_t = c_uint; ++pub type nl_item = c_long; ++pub type clockid_t = c_int; ++pub type id_t = u32; ++pub type sem_t = *mut sem; ++pub type key_t = c_long; ++ ++#[cfg_attr(feature = "extra_traits", derive(Debug))] ++pub enum timezone {} ++impl Copy for timezone {} ++impl Clone for timezone { ++ fn clone(&self) -> timezone { ++ *self ++ } ++} ++#[cfg_attr(feature = "extra_traits", derive(Debug))] ++pub enum sem {} ++impl Copy for sem {} ++impl Clone for sem { ++ fn clone(&self) -> sem { ++ *self ++ } ++} ++ ++s! { ++ pub struct sched_param { ++ pub sched_priority: c_int, ++ } ++ ++ pub struct sigaction { ++ pub sa_sigaction: crate::sighandler_t, ++ pub sa_mask: crate::sigset_t, ++ pub sa_flags: c_int, ++ } ++ ++ pub struct stack_t { ++ pub ss_sp: *mut c_void, ++ pub ss_size: size_t, ++ pub ss_flags: c_int, ++ } ++ ++ pub struct in6_pktinfo { ++ pub ipi6_addr: crate::in6_addr, ++ pub ipi6_ifindex: c_uint, ++ } ++ ++ pub struct termios { ++ pub c_iflag: crate::tcflag_t, ++ pub c_oflag: crate::tcflag_t, ++ pub c_cflag: crate::tcflag_t, ++ pub c_lflag: crate::tcflag_t, ++ pub c_cc: [crate::cc_t; crate::NCCS], ++ pub c_ispeed: c_int, ++ pub c_ospeed: c_int, ++ } ++ ++ pub struct flock { ++ pub l_start: off_t, ++ pub l_len: off_t, ++ pub l_pid: crate::pid_t, ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ } ++ ++ pub struct ipc_perm { ++ pub cuid: crate::uid_t, ++ pub cgid: crate::gid_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub mode: crate::mode_t, ++ #[cfg(target_os = "openbsd")] ++ pub seq: c_ushort, ++ #[cfg(target_os = "netbsd")] ++ pub _seq: c_ushort, ++ #[cfg(target_os = "openbsd")] ++ pub key: crate::key_t, ++ #[cfg(target_os = "netbsd")] ++ pub _key: crate::key_t, ++ } ++ ++ pub struct ptrace_io_desc { ++ pub piod_op: c_int, ++ pub piod_offs: *mut c_void, ++ pub piod_addr: *mut c_void, ++ pub piod_len: size_t, ++ } ++ ++ pub struct mmsghdr { ++ pub msg_hdr: crate::msghdr, ++ pub msg_len: c_uint, ++ } ++} ++ ++pub const D_T_FMT: crate::nl_item = 0; ++pub const D_FMT: crate::nl_item = 1; ++pub const T_FMT: crate::nl_item = 2; ++pub const T_FMT_AMPM: crate::nl_item = 3; ++pub const AM_STR: crate::nl_item = 4; ++pub const PM_STR: crate::nl_item = 5; ++ ++pub const DAY_1: crate::nl_item = 6; ++pub const DAY_2: crate::nl_item = 7; ++pub const DAY_3: crate::nl_item = 8; ++pub const DAY_4: crate::nl_item = 9; ++pub const DAY_5: crate::nl_item = 10; ++pub const DAY_6: crate::nl_item = 11; ++pub const DAY_7: crate::nl_item = 12; ++ ++pub const ABDAY_1: crate::nl_item = 13; ++pub const ABDAY_2: crate::nl_item = 14; ++pub const ABDAY_3: crate::nl_item = 15; ++pub const ABDAY_4: crate::nl_item = 16; ++pub const ABDAY_5: crate::nl_item = 17; ++pub const ABDAY_6: crate::nl_item = 18; ++pub const ABDAY_7: crate::nl_item = 19; ++ ++pub const MON_1: crate::nl_item = 20; ++pub const MON_2: crate::nl_item = 21; ++pub const MON_3: crate::nl_item = 22; ++pub const MON_4: crate::nl_item = 23; ++pub const MON_5: crate::nl_item = 24; ++pub const MON_6: crate::nl_item = 25; ++pub const MON_7: crate::nl_item = 26; ++pub const MON_8: crate::nl_item = 27; ++pub const MON_9: crate::nl_item = 28; ++pub const MON_10: crate::nl_item = 29; ++pub const MON_11: crate::nl_item = 30; ++pub const MON_12: crate::nl_item = 31; ++ ++pub const ABMON_1: crate::nl_item = 32; ++pub const ABMON_2: crate::nl_item = 33; ++pub const ABMON_3: crate::nl_item = 34; ++pub const ABMON_4: crate::nl_item = 35; ++pub const ABMON_5: crate::nl_item = 36; ++pub const ABMON_6: crate::nl_item = 37; ++pub const ABMON_7: crate::nl_item = 38; ++pub const ABMON_8: crate::nl_item = 39; ++pub const ABMON_9: crate::nl_item = 40; ++pub const ABMON_10: crate::nl_item = 41; ++pub const ABMON_11: crate::nl_item = 42; ++pub const ABMON_12: crate::nl_item = 43; ++ ++pub const RADIXCHAR: crate::nl_item = 44; ++pub const THOUSEP: crate::nl_item = 45; ++pub const YESSTR: crate::nl_item = 46; ++pub const YESEXPR: crate::nl_item = 47; ++pub const NOSTR: crate::nl_item = 48; ++pub const NOEXPR: crate::nl_item = 49; ++pub const CRNCYSTR: crate::nl_item = 50; ++ ++pub const CODESET: crate::nl_item = 51; ++ ++pub const EXIT_FAILURE: c_int = 1; ++pub const EXIT_SUCCESS: c_int = 0; ++pub const RAND_MAX: c_int = 2147483647; ++pub const EOF: c_int = -1; ++pub const SEEK_SET: c_int = 0; ++pub const SEEK_CUR: c_int = 1; ++pub const SEEK_END: c_int = 2; ++pub const _IOFBF: c_int = 0; ++pub const _IONBF: c_int = 2; ++pub const _IOLBF: c_int = 1; ++pub const BUFSIZ: c_uint = 1024; ++pub const FOPEN_MAX: c_uint = 20; ++pub const FILENAME_MAX: c_uint = 1024; ++pub const L_tmpnam: c_uint = 1024; ++pub const O_NOCTTY: c_int = 32768; ++pub const S_IFIFO: mode_t = 0o1_0000; ++pub const S_IFCHR: mode_t = 0o2_0000; ++pub const S_IFBLK: mode_t = 0o6_0000; ++pub const S_IFDIR: mode_t = 0o4_0000; ++pub const S_IFREG: mode_t = 0o10_0000; ++pub const S_IFLNK: mode_t = 0o12_0000; ++pub const S_IFSOCK: mode_t = 0o14_0000; ++pub const S_IFMT: mode_t = 0o17_0000; ++pub const S_IEXEC: mode_t = 0o0100; ++pub const S_IWRITE: mode_t = 0o0200; ++pub const S_IREAD: mode_t = 0o0400; ++pub const S_IRWXU: mode_t = 0o0700; ++pub const S_IXUSR: mode_t = 0o0100; ++pub const S_IWUSR: mode_t = 0o0200; ++pub const S_IRUSR: mode_t = 0o0400; ++pub const S_IRWXG: mode_t = 0o0070; ++pub const S_IXGRP: mode_t = 0o0010; ++pub const S_IWGRP: mode_t = 0o0020; ++pub const S_IRGRP: mode_t = 0o0040; ++pub const S_IRWXO: mode_t = 0o0007; ++pub const S_IXOTH: mode_t = 0o0001; ++pub const S_IWOTH: mode_t = 0o0002; ++pub const S_IROTH: mode_t = 0o0004; ++pub const F_OK: c_int = 0; ++pub const R_OK: c_int = 4; ++pub const W_OK: c_int = 2; ++pub const X_OK: c_int = 1; ++pub const STDIN_FILENO: c_int = 0; ++pub const STDOUT_FILENO: c_int = 1; ++pub const STDERR_FILENO: c_int = 2; ++pub const F_LOCK: c_int = 1; ++pub const F_TEST: c_int = 3; ++pub const F_TLOCK: c_int = 2; ++pub const F_ULOCK: c_int = 0; ++pub const F_GETLK: c_int = 7; ++pub const F_SETLK: c_int = 8; ++pub const F_SETLKW: c_int = 9; ++pub const SIGHUP: c_int = 1; ++pub const SIGINT: c_int = 2; ++pub const SIGQUIT: c_int = 3; ++pub const SIGILL: c_int = 4; ++pub const SIGABRT: c_int = 6; ++pub const SIGEMT: c_int = 7; ++pub const SIGFPE: c_int = 8; ++pub const SIGKILL: c_int = 9; ++pub const SIGSEGV: c_int = 11; ++pub const SIGPIPE: c_int = 13; ++pub const SIGALRM: c_int = 14; ++pub const SIGTERM: c_int = 15; ++ ++pub const PROT_NONE: c_int = 0; ++pub const PROT_READ: c_int = 1; ++pub const PROT_WRITE: c_int = 2; ++pub const PROT_EXEC: c_int = 4; ++ ++pub const MAP_FILE: c_int = 0x0000; ++pub const MAP_SHARED: c_int = 0x0001; ++pub const MAP_PRIVATE: c_int = 0x0002; ++pub const MAP_FIXED: c_int = 0x0010; ++pub const MAP_ANON: c_int = 0x1000; ++pub const MAP_ANONYMOUS: c_int = MAP_ANON; ++ ++pub const MAP_FAILED: *mut c_void = !0 as *mut c_void; ++ ++pub const IPC_CREAT: c_int = 0o001000; ++pub const IPC_EXCL: c_int = 0o002000; ++pub const IPC_NOWAIT: c_int = 0o004000; ++ ++pub const IPC_PRIVATE: crate::key_t = 0; ++ ++pub const IPC_RMID: c_int = 0; ++pub const IPC_SET: c_int = 1; ++pub const IPC_STAT: c_int = 2; ++ ++pub const IPC_R: c_int = 0o000400; ++pub const IPC_W: c_int = 0o000200; ++pub const IPC_M: c_int = 0o010000; ++ ++pub const SHM_R: c_int = IPC_R; ++pub const SHM_W: c_int = IPC_W; ++ ++pub const MCL_CURRENT: c_int = 0x0001; ++pub const MCL_FUTURE: c_int = 0x0002; ++ ++pub const MS_ASYNC: c_int = 0x0001; ++ ++pub const EPERM: c_int = 1; ++pub const ENOENT: c_int = 2; ++pub const ESRCH: c_int = 3; ++pub const EINTR: c_int = 4; ++pub const EIO: c_int = 5; ++pub const ENXIO: c_int = 6; ++pub const E2BIG: c_int = 7; ++pub const ENOEXEC: c_int = 8; ++pub const EBADF: c_int = 9; ++pub const ECHILD: c_int = 10; ++pub const EDEADLK: c_int = 11; ++pub const ENOMEM: c_int = 12; ++pub const EACCES: c_int = 13; ++pub const EFAULT: c_int = 14; ++pub const ENOTBLK: c_int = 15; ++pub const EBUSY: c_int = 16; ++pub const EEXIST: c_int = 17; ++pub const EXDEV: c_int = 18; ++pub const ENODEV: c_int = 19; ++pub const ENOTDIR: c_int = 20; ++pub const EISDIR: c_int = 21; ++pub const EINVAL: c_int = 22; ++pub const ENFILE: c_int = 23; ++pub const EMFILE: c_int = 24; ++pub const ENOTTY: c_int = 25; ++pub const ETXTBSY: c_int = 26; ++pub const EFBIG: c_int = 27; ++pub const ENOSPC: c_int = 28; ++pub const ESPIPE: c_int = 29; ++pub const EROFS: c_int = 30; ++pub const EMLINK: c_int = 31; ++pub const EPIPE: c_int = 32; ++pub const EDOM: c_int = 33; ++pub const ERANGE: c_int = 34; ++pub const EAGAIN: c_int = 35; ++pub const EWOULDBLOCK: c_int = 35; ++pub const EINPROGRESS: c_int = 36; ++pub const EALREADY: c_int = 37; ++pub const ENOTSOCK: c_int = 38; ++pub const EDESTADDRREQ: c_int = 39; ++pub const EMSGSIZE: c_int = 40; ++pub const EPROTOTYPE: c_int = 41; ++pub const ENOPROTOOPT: c_int = 42; ++pub const EPROTONOSUPPORT: c_int = 43; ++pub const ESOCKTNOSUPPORT: c_int = 44; ++pub const EOPNOTSUPP: c_int = 45; ++pub const EPFNOSUPPORT: c_int = 46; ++pub const EAFNOSUPPORT: c_int = 47; ++pub const EADDRINUSE: c_int = 48; ++pub const EADDRNOTAVAIL: c_int = 49; ++pub const ENETDOWN: c_int = 50; ++pub const ENETUNREACH: c_int = 51; ++pub const ENETRESET: c_int = 52; ++pub const ECONNABORTED: c_int = 53; ++pub const ECONNRESET: c_int = 54; ++pub const ENOBUFS: c_int = 55; ++pub const EISCONN: c_int = 56; ++pub const ENOTCONN: c_int = 57; ++pub const ESHUTDOWN: c_int = 58; ++pub const ETOOMANYREFS: c_int = 59; ++pub const ETIMEDOUT: c_int = 60; ++pub const ECONNREFUSED: c_int = 61; ++pub const ELOOP: c_int = 62; ++pub const ENAMETOOLONG: c_int = 63; ++pub const EHOSTDOWN: c_int = 64; ++pub const EHOSTUNREACH: c_int = 65; ++pub const ENOTEMPTY: c_int = 66; ++pub const EPROCLIM: c_int = 67; ++pub const EUSERS: c_int = 68; ++pub const EDQUOT: c_int = 69; ++pub const ESTALE: c_int = 70; ++pub const EREMOTE: c_int = 71; ++pub const EBADRPC: c_int = 72; ++pub const ERPCMISMATCH: c_int = 73; ++pub const EPROGUNAVAIL: c_int = 74; ++pub const EPROGMISMATCH: c_int = 75; ++pub const EPROCUNAVAIL: c_int = 76; ++pub const ENOLCK: c_int = 77; ++pub const ENOSYS: c_int = 78; ++pub const EFTYPE: c_int = 79; ++pub const EAUTH: c_int = 80; ++pub const ENEEDAUTH: c_int = 81; ++ ++pub const F_DUPFD: c_int = 0; ++pub const F_GETFD: c_int = 1; ++pub const F_SETFD: c_int = 2; ++pub const F_GETFL: c_int = 3; ++pub const F_SETFL: c_int = 4; ++ ++pub const SIGTRAP: c_int = 5; ++ ++pub const GLOB_APPEND: c_int = 0x0001; ++pub const GLOB_DOOFFS: c_int = 0x0002; ++pub const GLOB_ERR: c_int = 0x0004; ++pub const GLOB_MARK: c_int = 0x0008; ++pub const GLOB_NOCHECK: c_int = 0x0010; ++pub const GLOB_NOSORT: c_int = 0x0020; ++pub const GLOB_NOESCAPE: c_int = 0x1000; ++ ++pub const GLOB_NOSPACE: c_int = -1; ++pub const GLOB_ABORTED: c_int = -2; ++pub const GLOB_NOMATCH: c_int = -3; ++pub const GLOB_NOSYS: c_int = -4; ++ ++pub const POSIX_MADV_NORMAL: c_int = 0; ++pub const POSIX_MADV_RANDOM: c_int = 1; ++pub const POSIX_MADV_SEQUENTIAL: c_int = 2; ++pub const POSIX_MADV_WILLNEED: c_int = 3; ++pub const POSIX_MADV_DONTNEED: c_int = 4; ++ ++// DIFF(main): changed to `c_short` in f62eb023ab ++pub const POSIX_SPAWN_RESETIDS: c_int = 0x01; ++pub const POSIX_SPAWN_SETPGROUP: c_int = 0x02; ++pub const POSIX_SPAWN_SETSCHEDPARAM: c_int = 0x04; ++pub const POSIX_SPAWN_SETSCHEDULER: c_int = 0x08; ++pub const POSIX_SPAWN_SETSIGDEF: c_int = 0x10; ++pub const POSIX_SPAWN_SETSIGMASK: c_int = 0x20; ++ ++pub const PTHREAD_CREATE_JOINABLE: c_int = 0; ++pub const PTHREAD_CREATE_DETACHED: c_int = 1; ++ ++pub const PIOD_READ_D: c_int = 1; ++pub const PIOD_WRITE_D: c_int = 2; ++pub const PIOD_READ_I: c_int = 3; ++pub const PIOD_WRITE_I: c_int = 4; ++pub const PIOD_READ_AUXV: c_int = 5; ++ ++pub const PT_TRACE_ME: c_int = 0; ++pub const PT_READ_I: c_int = 1; ++pub const PT_READ_D: c_int = 2; ++pub const PT_WRITE_I: c_int = 4; ++pub const PT_WRITE_D: c_int = 5; ++pub const PT_CONTINUE: c_int = 7; ++pub const PT_KILL: c_int = 8; ++pub const PT_ATTACH: c_int = 9; ++pub const PT_DETACH: c_int = 10; ++pub const PT_IO: c_int = 11; ++ ++// http://man.openbsd.org/OpenBSD-current/man2/clock_getres.2 ++// The man page says clock_gettime(3) can accept various values as clockid_t but ++// http://fxr.watson.org/fxr/source/kern/kern_time.c?v=OPENBSD;im=excerpts#L161 ++// the implementation rejects anything other than the below two ++// ++// http://netbsd.gw.com/cgi-bin/man-cgi?clock_gettime ++// https://github.com/jsonn/src/blob/HEAD/sys/kern/subr_time.c#L222 ++// Basically the same goes for NetBSD ++pub const CLOCK_REALTIME: crate::clockid_t = 0; ++pub const CLOCK_MONOTONIC: crate::clockid_t = 3; ++ ++pub const RLIMIT_CPU: c_int = 0; ++pub const RLIMIT_FSIZE: c_int = 1; ++pub const RLIMIT_DATA: c_int = 2; ++pub const RLIMIT_STACK: c_int = 3; ++pub const RLIMIT_CORE: c_int = 4; ++pub const RLIMIT_RSS: c_int = 5; ++pub const RLIMIT_MEMLOCK: c_int = 6; ++pub const RLIMIT_NPROC: c_int = 7; ++pub const RLIMIT_NOFILE: c_int = 8; ++ ++pub const RLIM_INFINITY: rlim_t = 0x7fff_ffff_ffff_ffff; ++pub const RLIM_SAVED_MAX: rlim_t = RLIM_INFINITY; ++pub const RLIM_SAVED_CUR: rlim_t = RLIM_INFINITY; ++ ++pub const RUSAGE_SELF: c_int = 0; ++pub const RUSAGE_CHILDREN: c_int = -1; ++ ++pub const MADV_NORMAL: c_int = 0; ++pub const MADV_RANDOM: c_int = 1; ++pub const MADV_SEQUENTIAL: c_int = 2; ++pub const MADV_WILLNEED: c_int = 3; ++pub const MADV_DONTNEED: c_int = 4; ++pub const MADV_FREE: c_int = 6; ++ ++// sys/fstypes.h in NetBSD, or sys/mount.h in OpenBSD ++pub const MNT_NODEV: c_int = 0x00000010; ++pub const MNT_LOCAL: c_int = 0x00001000; ++pub const MNT_QUOTA: c_int = 0x00002000; ++ ++pub const AF_UNSPEC: c_int = 0; ++pub const AF_LOCAL: c_int = 1; ++pub const AF_UNIX: c_int = AF_LOCAL; ++pub const AF_INET: c_int = 2; ++pub const AF_IMPLINK: c_int = 3; ++pub const AF_PUP: c_int = 4; ++pub const AF_CHAOS: c_int = 5; ++pub const AF_NS: c_int = 6; ++pub const AF_ISO: c_int = 7; ++pub const AF_OSI: c_int = AF_ISO; ++pub const AF_DATAKIT: c_int = 9; ++pub const AF_CCITT: c_int = 10; ++pub const AF_SNA: c_int = 11; ++pub const AF_DECnet: c_int = 12; ++pub const AF_DLI: c_int = 13; ++pub const AF_LAT: c_int = 14; ++pub const AF_HYLINK: c_int = 15; ++pub const AF_APPLETALK: c_int = 16; ++pub const AF_LINK: c_int = 18; ++pub const pseudo_AF_XTP: c_int = 19; ++pub const AF_COIP: c_int = 20; ++pub const AF_CNT: c_int = 21; ++pub const pseudo_AF_RTIP: c_int = 22; ++pub const AF_IPX: c_int = 23; ++pub const AF_INET6: c_int = 24; ++pub const pseudo_AF_PIP: c_int = 25; ++pub const AF_ISDN: c_int = 26; ++pub const AF_E164: c_int = AF_ISDN; ++pub const AF_NATM: c_int = 27; ++ ++pub const PF_UNSPEC: c_int = AF_UNSPEC; ++pub const PF_LOCAL: c_int = AF_LOCAL; ++pub const PF_UNIX: c_int = PF_LOCAL; ++pub const PF_INET: c_int = AF_INET; ++pub const PF_IMPLINK: c_int = AF_IMPLINK; ++pub const PF_PUP: c_int = AF_PUP; ++pub const PF_CHAOS: c_int = AF_CHAOS; ++pub const PF_NS: c_int = AF_NS; ++pub const PF_ISO: c_int = AF_ISO; ++pub const PF_OSI: c_int = AF_ISO; ++pub const PF_DATAKIT: c_int = AF_DATAKIT; ++pub const PF_CCITT: c_int = AF_CCITT; ++pub const PF_SNA: c_int = AF_SNA; ++pub const PF_DECnet: c_int = AF_DECnet; ++pub const PF_DLI: c_int = AF_DLI; ++pub const PF_LAT: c_int = AF_LAT; ++pub const PF_HYLINK: c_int = AF_HYLINK; ++pub const PF_APPLETALK: c_int = AF_APPLETALK; ++pub const PF_LINK: c_int = AF_LINK; ++pub const PF_XTP: c_int = pseudo_AF_XTP; ++pub const PF_COIP: c_int = AF_COIP; ++pub const PF_CNT: c_int = AF_CNT; ++pub const PF_IPX: c_int = AF_IPX; ++pub const PF_INET6: c_int = AF_INET6; ++pub const PF_RTIP: c_int = pseudo_AF_RTIP; ++pub const PF_PIP: c_int = pseudo_AF_PIP; ++pub const PF_ISDN: c_int = AF_ISDN; ++pub const PF_NATM: c_int = AF_NATM; ++ ++pub const SOCK_STREAM: c_int = 1; ++pub const SOCK_DGRAM: c_int = 2; ++pub const SOCK_RAW: c_int = 3; ++pub const SOCK_RDM: c_int = 4; ++pub const SOCK_SEQPACKET: c_int = 5; ++pub const IP_TTL: c_int = 4; ++pub const IP_HDRINCL: c_int = 2; ++pub const IP_ADD_MEMBERSHIP: c_int = 12; ++pub const IP_DROP_MEMBERSHIP: c_int = 13; ++pub const IPV6_RECVPKTINFO: c_int = 36; ++pub const IPV6_PKTINFO: c_int = 46; ++pub const IPV6_RECVTCLASS: c_int = 57; ++pub const IPV6_TCLASS: c_int = 61; ++ ++pub const SOL_SOCKET: c_int = 0xffff; ++pub const SO_DEBUG: c_int = 0x01; ++pub const SO_ACCEPTCONN: c_int = 0x0002; ++pub const SO_REUSEADDR: c_int = 0x0004; ++pub const SO_KEEPALIVE: c_int = 0x0008; ++pub const SO_DONTROUTE: c_int = 0x0010; ++pub const SO_BROADCAST: c_int = 0x0020; ++pub const SO_USELOOPBACK: c_int = 0x0040; ++pub const SO_LINGER: c_int = 0x0080; ++pub const SO_OOBINLINE: c_int = 0x0100; ++pub const SO_REUSEPORT: c_int = 0x0200; ++pub const SO_SNDBUF: c_int = 0x1001; ++pub const SO_RCVBUF: c_int = 0x1002; ++pub const SO_SNDLOWAT: c_int = 0x1003; ++pub const SO_RCVLOWAT: c_int = 0x1004; ++pub const SO_ERROR: c_int = 0x1007; ++pub const SO_TYPE: c_int = 0x1008; ++ ++pub const SOMAXCONN: c_int = 128; ++ ++pub const MSG_OOB: c_int = 0x1; ++pub const MSG_PEEK: c_int = 0x2; ++pub const MSG_DONTROUTE: c_int = 0x4; ++pub const MSG_EOR: c_int = 0x8; ++pub const MSG_TRUNC: c_int = 0x10; ++pub const MSG_CTRUNC: c_int = 0x20; ++pub const MSG_WAITALL: c_int = 0x40; ++pub const MSG_DONTWAIT: c_int = 0x80; ++pub const MSG_BCAST: c_int = 0x100; ++pub const MSG_MCAST: c_int = 0x200; ++pub const MSG_NOSIGNAL: c_int = 0x400; ++pub const MSG_CMSG_CLOEXEC: c_int = 0x800; ++ ++pub const SHUT_RD: c_int = 0; ++pub const SHUT_WR: c_int = 1; ++pub const SHUT_RDWR: c_int = 2; ++ ++pub const LOCK_SH: c_int = 1; ++pub const LOCK_EX: c_int = 2; ++pub const LOCK_NB: c_int = 4; ++pub const LOCK_UN: c_int = 8; ++ ++pub const IPPROTO_RAW: c_int = 255; ++ ++pub const _SC_ARG_MAX: c_int = 1; ++pub const _SC_CHILD_MAX: c_int = 2; ++pub const _SC_NGROUPS_MAX: c_int = 4; ++pub const _SC_OPEN_MAX: c_int = 5; ++pub const _SC_JOB_CONTROL: c_int = 6; ++pub const _SC_SAVED_IDS: c_int = 7; ++pub const _SC_VERSION: c_int = 8; ++pub const _SC_BC_BASE_MAX: c_int = 9; ++pub const _SC_BC_DIM_MAX: c_int = 10; ++pub const _SC_BC_SCALE_MAX: c_int = 11; ++pub const _SC_BC_STRING_MAX: c_int = 12; ++pub const _SC_COLL_WEIGHTS_MAX: c_int = 13; ++pub const _SC_EXPR_NEST_MAX: c_int = 14; ++pub const _SC_LINE_MAX: c_int = 15; ++pub const _SC_RE_DUP_MAX: c_int = 16; ++pub const _SC_2_VERSION: c_int = 17; ++pub const _SC_2_C_BIND: c_int = 18; ++pub const _SC_2_C_DEV: c_int = 19; ++pub const _SC_2_CHAR_TERM: c_int = 20; ++pub const _SC_2_FORT_DEV: c_int = 21; ++pub const _SC_2_FORT_RUN: c_int = 22; ++pub const _SC_2_LOCALEDEF: c_int = 23; ++pub const _SC_2_SW_DEV: c_int = 24; ++pub const _SC_2_UPE: c_int = 25; ++pub const _SC_STREAM_MAX: c_int = 26; ++pub const _SC_TZNAME_MAX: c_int = 27; ++pub const _SC_PAGESIZE: c_int = 28; ++pub const _SC_PAGE_SIZE: c_int = _SC_PAGESIZE; ++pub const _SC_FSYNC: c_int = 29; ++pub const _SC_XOPEN_SHM: c_int = 30; ++ ++pub const Q_GETQUOTA: c_int = 0x300; ++pub const Q_SETQUOTA: c_int = 0x400; ++ ++pub const RTLD_GLOBAL: c_int = 0x100; ++ ++pub const LOG_NFACILITIES: c_int = 24; ++ ++pub const HW_NCPU: c_int = 3; ++ ++pub const B0: speed_t = 0; ++pub const B50: speed_t = 50; ++pub const B75: speed_t = 75; ++pub const B110: speed_t = 110; ++pub const B134: speed_t = 134; ++pub const B150: speed_t = 150; ++pub const B200: speed_t = 200; ++pub const B300: speed_t = 300; ++pub const B600: speed_t = 600; ++pub const B1200: speed_t = 1200; ++pub const B1800: speed_t = 1800; ++pub const B2400: speed_t = 2400; ++pub const B4800: speed_t = 4800; ++pub const B9600: speed_t = 9600; ++pub const B19200: speed_t = 19200; ++pub const B38400: speed_t = 38400; ++pub const B7200: speed_t = 7200; ++pub const B14400: speed_t = 14400; ++pub const B28800: speed_t = 28800; ++pub const B57600: speed_t = 57600; ++pub const B76800: speed_t = 76800; ++pub const B115200: speed_t = 115200; ++pub const B230400: speed_t = 230400; ++pub const EXTA: speed_t = 19200; ++pub const EXTB: speed_t = 38400; ++ ++pub const SEM_FAILED: *mut sem_t = 0 as *mut sem_t; ++ ++pub const CRTSCTS: crate::tcflag_t = 0x00010000; ++pub const CRTS_IFLOW: crate::tcflag_t = CRTSCTS; ++pub const CCTS_OFLOW: crate::tcflag_t = CRTSCTS; ++pub const OCRNL: crate::tcflag_t = 0x10; ++ ++pub const TIOCEXCL: c_ulong = 0x2000740d; ++pub const TIOCNXCL: c_ulong = 0x2000740e; ++pub const TIOCFLUSH: c_ulong = 0x80047410; ++pub const TIOCGETA: c_ulong = 0x402c7413; ++pub const TIOCSETA: c_ulong = 0x802c7414; ++pub const TIOCSETAW: c_ulong = 0x802c7415; ++pub const TIOCSETAF: c_ulong = 0x802c7416; ++pub const TIOCGETD: c_ulong = 0x4004741a; ++pub const TIOCSETD: c_ulong = 0x8004741b; ++pub const TIOCMGET: c_ulong = 0x4004746a; ++pub const TIOCMBIC: c_ulong = 0x8004746b; ++pub const TIOCMBIS: c_ulong = 0x8004746c; ++pub const TIOCMSET: c_ulong = 0x8004746d; ++pub const TIOCSTART: c_ulong = 0x2000746e; ++pub const TIOCSTOP: c_ulong = 0x2000746f; ++pub const TIOCSCTTY: c_ulong = 0x20007461; ++pub const TIOCGWINSZ: c_ulong = 0x40087468; ++pub const TIOCSWINSZ: c_ulong = 0x80087467; ++pub const TIOCM_LE: c_int = 0o0001; ++pub const TIOCM_DTR: c_int = 0o0002; ++pub const TIOCM_RTS: c_int = 0o0004; ++pub const TIOCM_ST: c_int = 0o0010; ++pub const TIOCM_SR: c_int = 0o0020; ++pub const TIOCM_CTS: c_int = 0o0040; ++pub const TIOCM_CAR: c_int = 0o0100; ++pub const TIOCM_RNG: c_int = 0o0200; ++pub const TIOCM_DSR: c_int = 0o0400; ++pub const TIOCM_CD: c_int = TIOCM_CAR; ++pub const TIOCM_RI: c_int = TIOCM_RNG; ++ ++pub const TIMER_ABSTIME: c_int = 1; ++ ++// sys/reboot.h ++ ++pub const RB_AUTOBOOT: c_int = 0; ++ ++pub const TCP_INFO: c_int = 9; ++ ++#[link(name = "util")] ++extern "C" { ++ pub fn setgrent(); ++ pub fn sem_destroy(sem: *mut sem_t) -> c_int; ++ pub fn sem_init(sem: *mut sem_t, pshared: c_int, value: c_uint) -> c_int; ++ ++ pub fn daemon(nochdir: c_int, noclose: c_int) -> c_int; ++ pub fn accept4( ++ s: c_int, ++ addr: *mut crate::sockaddr, ++ addrlen: *mut crate::socklen_t, ++ flags: c_int, ++ ) -> c_int; ++ pub fn mincore(addr: *mut c_void, len: size_t, vec: *mut c_char) -> c_int; ++ #[cfg_attr(target_os = "netbsd", link_name = "__clock_getres50")] ++ pub fn clock_getres(clk_id: crate::clockid_t, tp: *mut crate::timespec) -> c_int; ++ #[cfg_attr(target_os = "netbsd", link_name = "__clock_gettime50")] ++ pub fn clock_gettime(clk_id: crate::clockid_t, tp: *mut crate::timespec) -> c_int; ++ #[cfg_attr(target_os = "netbsd", link_name = "__clock_settime50")] ++ pub fn clock_settime(clk_id: crate::clockid_t, tp: *const crate::timespec) -> c_int; ++ pub fn __errno() -> *mut c_int; ++ pub fn shm_open(name: *const c_char, oflag: c_int, mode: crate::mode_t) -> c_int; ++ pub fn memrchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void; ++ pub fn mkostemp(template: *mut c_char, flags: c_int) -> c_int; ++ pub fn mkostemps(template: *mut c_char, suffixlen: c_int, flags: c_int) -> c_int; ++ pub fn pwritev(fd: c_int, iov: *const crate::iovec, iovcnt: c_int, offset: off_t) -> ssize_t; ++ pub fn preadv(fd: c_int, iov: *const crate::iovec, iovcnt: c_int, offset: off_t) -> ssize_t; ++ pub fn futimens(fd: c_int, times: *const crate::timespec) -> c_int; ++ pub fn utimensat( ++ dirfd: c_int, ++ path: *const c_char, ++ times: *const crate::timespec, ++ flag: c_int, ++ ) -> c_int; ++ pub fn fdatasync(fd: c_int) -> c_int; ++ pub fn login_tty(fd: c_int) -> c_int; ++ pub fn getpriority(which: c_int, who: crate::id_t) -> c_int; ++ pub fn setpriority(which: c_int, who: crate::id_t, prio: c_int) -> c_int; ++ ++ pub fn mknodat(dirfd: c_int, pathname: *const c_char, mode: crate::mode_t, dev: dev_t) ++ -> c_int; ++ pub fn mkfifoat(dirfd: c_int, pathname: *const c_char, mode: crate::mode_t) -> c_int; ++ pub fn sem_timedwait(sem: *mut sem_t, abstime: *const crate::timespec) -> c_int; ++ pub fn sem_getvalue(sem: *mut sem_t, sval: *mut c_int) -> c_int; ++ pub fn pthread_condattr_setclock( ++ attr: *mut pthread_condattr_t, ++ clock_id: crate::clockid_t, ++ ) -> c_int; ++ pub fn sethostname(name: *const c_char, len: size_t) -> c_int; ++ pub fn pthread_mutex_timedlock( ++ lock: *mut pthread_mutex_t, ++ abstime: *const crate::timespec, ++ ) -> c_int; ++ pub fn pthread_spin_init(lock: *mut pthread_spinlock_t, pshared: c_int) -> c_int; ++ pub fn pthread_spin_destroy(lock: *mut pthread_spinlock_t) -> c_int; ++ pub fn pthread_spin_lock(lock: *mut pthread_spinlock_t) -> c_int; ++ pub fn pthread_spin_trylock(lock: *mut pthread_spinlock_t) -> c_int; ++ pub fn pthread_spin_unlock(lock: *mut pthread_spinlock_t) -> c_int; ++ pub fn pthread_setschedparam( ++ native: crate::pthread_t, ++ policy: c_int, ++ param: *const sched_param, ++ ) -> c_int; ++ pub fn pthread_getschedparam( ++ native: crate::pthread_t, ++ policy: *mut c_int, ++ param: *mut sched_param, ++ ) -> c_int; ++ pub fn pipe2(fds: *mut c_int, flags: c_int) -> c_int; ++ ++ pub fn getgrouplist( ++ name: *const c_char, ++ basegid: crate::gid_t, ++ groups: *mut crate::gid_t, ++ ngroups: *mut c_int, ++ ) -> c_int; ++ pub fn initgroups(name: *const c_char, basegid: crate::gid_t) -> c_int; ++ pub fn getdomainname(name: *mut c_char, len: size_t) -> c_int; ++ pub fn setdomainname(name: *const c_char, len: size_t) -> c_int; ++ pub fn uname(buf: *mut crate::utsname) -> c_int; ++ ++ pub fn shmget(key: crate::key_t, size: size_t, shmflg: c_int) -> c_int; ++ pub fn shmat(shmid: c_int, shmaddr: *const c_void, shmflg: c_int) -> *mut c_void; ++ pub fn shmdt(shmaddr: *const c_void) -> c_int; ++ pub fn shmctl(shmid: c_int, cmd: c_int, buf: *mut crate::shmid_ds) -> c_int; ++ ++ // DIFF(main): changed to `*const *mut` in e77f551de9 ++ pub fn execvpe( ++ file: *const c_char, ++ argv: *const *const c_char, ++ envp: *const *const c_char, ++ ) -> c_int; ++ ++ pub fn waitid( ++ idtype: idtype_t, ++ id: crate::id_t, ++ infop: *mut crate::siginfo_t, ++ options: c_int, ++ ) -> c_int; ++ ++ pub fn posix_spawn( ++ pid: *mut crate::pid_t, ++ path: *const c_char, ++ file_actions: *const crate::posix_spawn_file_actions_t, ++ attrp: *const crate::posix_spawnattr_t, ++ argv: *const *mut c_char, ++ envp: *const *mut c_char, ++ ) -> c_int; ++ pub fn posix_spawnp( ++ pid: *mut crate::pid_t, ++ file: *const c_char, ++ file_actions: *const crate::posix_spawn_file_actions_t, ++ attrp: *const crate::posix_spawnattr_t, ++ argv: *const *mut c_char, ++ envp: *const *mut c_char, ++ ) -> 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_getsigdefault( ++ attr: *const posix_spawnattr_t, ++ default: *mut crate::sigset_t, ++ ) -> c_int; ++ pub fn posix_spawnattr_setsigdefault( ++ attr: *mut posix_spawnattr_t, ++ default: *const crate::sigset_t, ++ ) -> c_int; ++ pub fn posix_spawnattr_getsigmask( ++ attr: *const posix_spawnattr_t, ++ default: *mut crate::sigset_t, ++ ) -> c_int; ++ pub fn posix_spawnattr_setsigmask( ++ attr: *mut posix_spawnattr_t, ++ default: *const crate::sigset_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, ++ flags: *mut crate::pid_t, ++ ) -> c_int; ++ pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: crate::pid_t) -> c_int; ++ pub fn posix_spawnattr_getschedpolicy( ++ attr: *const posix_spawnattr_t, ++ flags: *mut c_int, ++ ) -> c_int; ++ pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: c_int) -> c_int; ++ pub fn posix_spawnattr_getschedparam( ++ attr: *const posix_spawnattr_t, ++ param: *mut crate::sched_param, ++ ) -> c_int; ++ pub fn posix_spawnattr_setschedparam( ++ attr: *mut posix_spawnattr_t, ++ param: *const crate::sched_param, ++ ) -> c_int; ++ ++ pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> c_int; ++ pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> c_int; ++ pub fn posix_spawn_file_actions_addopen( ++ actions: *mut posix_spawn_file_actions_t, ++ fd: c_int, ++ path: *const c_char, ++ oflag: c_int, ++ mode: crate::mode_t, ++ ) -> c_int; ++ pub fn posix_spawn_file_actions_addclose( ++ actions: *mut posix_spawn_file_actions_t, ++ fd: c_int, ++ ) -> c_int; ++ pub fn posix_spawn_file_actions_adddup2( ++ actions: *mut posix_spawn_file_actions_t, ++ fd: c_int, ++ newfd: c_int, ++ ) -> c_int; ++} ++ ++extern "C" { ++ pub fn reallocarray(ptr: *mut c_void, nmemb: size_t, size: size_t) -> *mut c_void; ++ pub fn gethostid() -> c_long; ++ pub fn sethostid(hostid: c_long) -> c_int; ++ pub fn ftok(path: *const c_char, id: c_int) -> crate::key_t; ++ ++ pub fn dirname(path: *mut c_char) -> *mut c_char; ++ pub fn basename(path: *mut c_char) -> *mut c_char; ++ pub fn getentropy(buf: *mut c_void, buflen: size_t) -> c_int; ++ ++ pub fn sendmmsg(sockfd: c_int, mmsg: *mut crate::mmsghdr, vlen: c_uint, flags: c_int) -> c_int; ++ pub fn recvmmsg( ++ sockfd: c_int, ++ mmsg: *mut crate::mmsghdr, ++ vlen: c_uint, ++ flags: c_int, ++ timeout: *mut crate::timespec, ++ ) -> c_int; ++} ++ ++cfg_if! { ++ if #[cfg(target_os = "netbsd")] { ++ mod netbsd; ++ pub use self::netbsd::*; ++ } else if #[cfg(target_os = "openbsd")] { ++ mod openbsd; ++ pub use self::openbsd::*; ++ } else { ++ // Unknown target_os ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/aarch64.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/aarch64.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/aarch64.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/aarch64.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,135 @@ ++use crate::prelude::*; ++use crate::PT_FIRSTMACH; ++ ++pub type c_long = i64; ++pub type c_ulong = u64; ++pub type c_char = u8; ++pub type greg_t = u64; ++pub type __cpu_simple_lock_nv_t = c_uchar; ++ ++s! { ++ pub struct __fregset { ++ pub __qregs: [__c_anonymous__freg; 32], ++ pub __fpcr: u32, ++ pub __fpsr: u32, ++ } ++ ++ pub struct mcontext_t { ++ pub __gregs: [crate::greg_t; 32], ++ pub __fregs: __fregset, ++ __spare: [crate::greg_t; 8], ++ } ++ ++ pub struct ucontext_t { ++ pub uc_flags: c_uint, ++ pub uc_link: *mut ucontext_t, ++ pub uc_sigmask: crate::sigset_t, ++ pub uc_stack: crate::stack_t, ++ pub uc_mcontext: mcontext_t, ++ } ++} ++ ++s_no_extra_traits! { ++ #[repr(align(16))] ++ pub union __c_anonymous__freg { ++ pub __b8: [u8; 16], ++ pub __h16: [u16; 8], ++ pub __s32: [u32; 4], ++ pub __d64: [u64; 2], ++ pub __q128: [u128; 1], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for __c_anonymous__freg { ++ fn eq(&self, other: &__c_anonymous__freg) -> bool { ++ unsafe { ++ self.__b8 == other.__b8 ++ || self.__h16 == other.__h16 ++ || self.__s32 == other.__s32 ++ || self.__d64 == other.__d64 ++ || self.__q128 == other.__q128 ++ } ++ } ++ } ++ impl Eq for __c_anonymous__freg {} ++ impl hash::Hash for __c_anonymous__freg { ++ fn hash(&self, state: &mut H) { ++ unsafe { ++ self.__b8.hash(state); ++ self.__h16.hash(state); ++ self.__s32.hash(state); ++ self.__d64.hash(state); ++ self.__q128.hash(state); ++ } ++ } ++ } ++ } ++} ++ ++pub(crate) const _ALIGNBYTES: usize = mem::size_of::() - 1; ++ ++pub const PT_GETREGS: c_int = PT_FIRSTMACH + 0; ++pub const PT_SETREGS: c_int = PT_FIRSTMACH + 1; ++pub const PT_GETFPREGS: c_int = PT_FIRSTMACH + 2; ++pub const PT_SETFPREGS: c_int = PT_FIRSTMACH + 3; ++ ++pub const _REG_R0: c_int = 0; ++pub const _REG_R1: c_int = 1; ++pub const _REG_R2: c_int = 2; ++pub const _REG_R3: c_int = 3; ++pub const _REG_R4: c_int = 4; ++pub const _REG_R5: c_int = 5; ++pub const _REG_R6: c_int = 6; ++pub const _REG_R7: c_int = 7; ++pub const _REG_R8: c_int = 8; ++pub const _REG_R9: c_int = 9; ++pub const _REG_R10: c_int = 10; ++pub const _REG_R11: c_int = 11; ++pub const _REG_R12: c_int = 12; ++pub const _REG_R13: c_int = 13; ++pub const _REG_R14: c_int = 14; ++pub const _REG_R15: c_int = 15; ++pub const _REG_CPSR: c_int = 16; ++pub const _REG_X0: c_int = 0; ++pub const _REG_X1: c_int = 1; ++pub const _REG_X2: c_int = 2; ++pub const _REG_X3: c_int = 3; ++pub const _REG_X4: c_int = 4; ++pub const _REG_X5: c_int = 5; ++pub const _REG_X6: c_int = 6; ++pub const _REG_X7: c_int = 7; ++pub const _REG_X8: c_int = 8; ++pub const _REG_X9: c_int = 9; ++pub const _REG_X10: c_int = 10; ++pub const _REG_X11: c_int = 11; ++pub const _REG_X12: c_int = 12; ++pub const _REG_X13: c_int = 13; ++pub const _REG_X14: c_int = 14; ++pub const _REG_X15: c_int = 15; ++pub const _REG_X16: c_int = 16; ++pub const _REG_X17: c_int = 17; ++pub const _REG_X18: c_int = 18; ++pub const _REG_X19: c_int = 19; ++pub const _REG_X20: c_int = 20; ++pub const _REG_X21: c_int = 21; ++pub const _REG_X22: c_int = 22; ++pub const _REG_X23: c_int = 23; ++pub const _REG_X24: c_int = 24; ++pub const _REG_X25: c_int = 25; ++pub const _REG_X26: c_int = 26; ++pub const _REG_X27: c_int = 27; ++pub const _REG_X28: c_int = 28; ++pub const _REG_X29: c_int = 29; ++pub const _REG_X30: c_int = 30; ++pub const _REG_X31: c_int = 31; ++pub const _REG_ELR: c_int = 32; ++pub const _REG_SPSR: c_int = 33; ++pub const _REG_TIPDR: c_int = 34; ++ ++pub const _REG_RV: c_int = _REG_X0; ++pub const _REG_FP: c_int = _REG_X29; ++pub const _REG_LR: c_int = _REG_X30; ++pub const _REG_SP: c_int = _REG_X31; ++pub const _REG_PC: c_int = _REG_ELR; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/arm.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/arm.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/arm.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/arm.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,73 @@ ++use crate::prelude::*; ++use crate::PT_FIRSTMACH; ++ ++pub type c_long = i32; ++pub type c_ulong = u32; ++pub type c_char = u8; ++pub type __cpu_simple_lock_nv_t = c_int; ++ ++pub(crate) const _ALIGNBYTES: usize = mem::size_of::() - 1; ++ ++pub const PT_GETREGS: c_int = PT_FIRSTMACH + 1; ++pub const PT_SETREGS: c_int = PT_FIRSTMACH + 2; ++pub const PT_GETFPREGS: c_int = PT_FIRSTMACH + 3; ++pub const PT_SETFPREGS: c_int = PT_FIRSTMACH + 4; ++ ++pub const _REG_R0: c_int = 0; ++pub const _REG_R1: c_int = 1; ++pub const _REG_R2: c_int = 2; ++pub const _REG_R3: c_int = 3; ++pub const _REG_R4: c_int = 4; ++pub const _REG_R5: c_int = 5; ++pub const _REG_R6: c_int = 6; ++pub const _REG_R7: c_int = 7; ++pub const _REG_R8: c_int = 8; ++pub const _REG_R9: c_int = 9; ++pub const _REG_R10: c_int = 10; ++pub const _REG_R11: c_int = 11; ++pub const _REG_R12: c_int = 12; ++pub const _REG_R13: c_int = 13; ++pub const _REG_R14: c_int = 14; ++pub const _REG_R15: c_int = 15; ++pub const _REG_CPSR: c_int = 16; ++pub const _REG_X0: c_int = 0; ++pub const _REG_X1: c_int = 1; ++pub const _REG_X2: c_int = 2; ++pub const _REG_X3: c_int = 3; ++pub const _REG_X4: c_int = 4; ++pub const _REG_X5: c_int = 5; ++pub const _REG_X6: c_int = 6; ++pub const _REG_X7: c_int = 7; ++pub const _REG_X8: c_int = 8; ++pub const _REG_X9: c_int = 9; ++pub const _REG_X10: c_int = 10; ++pub const _REG_X11: c_int = 11; ++pub const _REG_X12: c_int = 12; ++pub const _REG_X13: c_int = 13; ++pub const _REG_X14: c_int = 14; ++pub const _REG_X15: c_int = 15; ++pub const _REG_X16: c_int = 16; ++pub const _REG_X17: c_int = 17; ++pub const _REG_X18: c_int = 18; ++pub const _REG_X19: c_int = 19; ++pub const _REG_X20: c_int = 20; ++pub const _REG_X21: c_int = 21; ++pub const _REG_X22: c_int = 22; ++pub const _REG_X23: c_int = 23; ++pub const _REG_X24: c_int = 24; ++pub const _REG_X25: c_int = 25; ++pub const _REG_X26: c_int = 26; ++pub const _REG_X27: c_int = 27; ++pub const _REG_X28: c_int = 28; ++pub const _REG_X29: c_int = 29; ++pub const _REG_X30: c_int = 30; ++pub const _REG_X31: c_int = 31; ++pub const _REG_ELR: c_int = 32; ++pub const _REG_SPSR: c_int = 33; ++pub const _REG_TIPDR: c_int = 34; ++ ++pub const _REG_RV: c_int = _REG_R0; ++pub const _REG_FP: c_int = _REG_R11; ++pub const _REG_LR: c_int = _REG_R13; ++pub const _REG_SP: c_int = _REG_R14; ++pub const _REG_PC: c_int = _REG_R15; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/mips.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/mips.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/mips.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/mips.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,14 @@ ++use crate::prelude::*; ++use crate::PT_FIRSTMACH; ++ ++pub type c_long = i32; ++pub type c_ulong = u32; ++pub type c_char = i8; ++pub type __cpu_simple_lock_nv_t = c_int; ++ ++pub(crate) const _ALIGNBYTES: usize = mem::size_of::() - 1; ++ ++pub const PT_GETREGS: c_int = PT_FIRSTMACH + 1; ++pub const PT_SETREGS: c_int = PT_FIRSTMACH + 2; ++pub const PT_GETFPREGS: c_int = PT_FIRSTMACH + 3; ++pub const PT_SETFPREGS: c_int = PT_FIRSTMACH + 4; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,3090 @@ ++use crate::prelude::*; ++use crate::{cmsghdr, off_t}; ++ ++pub type clock_t = c_uint; ++pub type suseconds_t = c_int; ++pub type dev_t = u64; ++pub type blksize_t = i32; ++pub type fsblkcnt_t = u64; ++pub type fsfilcnt_t = u64; ++pub type idtype_t = c_int; ++pub type mqd_t = c_int; ++type __pthread_spin_t = __cpu_simple_lock_nv_t; ++pub type vm_size_t = crate::uintptr_t; // FIXME: deprecated since long time ++pub type lwpid_t = c_uint; ++pub type shmatt_t = c_uint; ++pub type cpuid_t = c_ulong; ++pub type cpuset_t = _cpuset; ++pub type pthread_spin_t = c_uchar; ++pub type timer_t = c_int; ++ ++// elf.h ++ ++pub type Elf32_Addr = u32; ++pub type Elf32_Half = u16; ++pub type Elf32_Lword = u64; ++pub type Elf32_Off = u32; ++pub type Elf32_Sword = i32; ++pub type Elf32_Word = u32; ++ ++pub type Elf64_Addr = u64; ++pub type Elf64_Half = u16; ++pub type Elf64_Lword = u64; ++pub type Elf64_Off = u64; ++pub type Elf64_Sword = i32; ++pub type Elf64_Sxword = i64; ++pub type Elf64_Word = u32; ++pub type Elf64_Xword = u64; ++ ++pub type iconv_t = *mut c_void; ++ ++e! { ++ pub enum fae_action { ++ FAE_OPEN, ++ FAE_DUP2, ++ FAE_CLOSE, ++ } ++} ++ ++cfg_if! { ++ if #[cfg(target_pointer_width = "64")] { ++ type Elf_Addr = Elf64_Addr; ++ type Elf_Half = Elf64_Half; ++ type Elf_Phdr = Elf64_Phdr; ++ } else if #[cfg(target_pointer_width = "32")] { ++ type Elf_Addr = Elf32_Addr; ++ type Elf_Half = Elf32_Half; ++ type Elf_Phdr = Elf32_Phdr; ++ } ++} ++ ++impl siginfo_t { ++ pub unsafe fn si_addr(&self) -> *mut c_void { ++ self.si_addr ++ } ++ ++ pub unsafe fn si_code(&self) -> c_int { ++ self.si_code ++ } ++ ++ pub unsafe fn si_errno(&self) -> c_int { ++ self.si_errno ++ } ++ ++ pub unsafe fn si_pid(&self) -> crate::pid_t { ++ #[repr(C)] ++ struct siginfo_timer { ++ _si_signo: c_int, ++ _si_errno: c_int, ++ _si_code: c_int, ++ __pad1: c_int, ++ _pid: crate::pid_t, ++ } ++ (*(self as *const siginfo_t as *const siginfo_timer))._pid ++ } ++ ++ pub unsafe fn si_uid(&self) -> crate::uid_t { ++ #[repr(C)] ++ struct siginfo_timer { ++ _si_signo: c_int, ++ _si_errno: c_int, ++ _si_code: c_int, ++ __pad1: c_int, ++ _pid: crate::pid_t, ++ _uid: crate::uid_t, ++ } ++ (*(self as *const siginfo_t as *const siginfo_timer))._uid ++ } ++ ++ pub unsafe fn si_value(&self) -> crate::sigval { ++ #[repr(C)] ++ struct siginfo_timer { ++ _si_signo: c_int, ++ _si_errno: c_int, ++ _si_code: c_int, ++ __pad1: c_int, ++ _pid: crate::pid_t, ++ _uid: crate::uid_t, ++ value: crate::sigval, ++ } ++ (*(self as *const siginfo_t as *const siginfo_timer)).value ++ } ++ ++ pub unsafe fn si_status(&self) -> c_int { ++ #[repr(C)] ++ struct siginfo_timer { ++ _si_signo: c_int, ++ _si_errno: c_int, ++ _si_code: c_int, ++ __pad1: c_int, ++ _pid: crate::pid_t, ++ _uid: crate::uid_t, ++ _value: crate::sigval, ++ _cpid: crate::pid_t, ++ _cuid: crate::uid_t, ++ status: c_int, ++ } ++ (*(self as *const siginfo_t as *const siginfo_timer)).status ++ } ++} ++ ++s! { ++ pub struct aiocb { ++ pub aio_offset: off_t, ++ pub aio_buf: *mut c_void, ++ pub aio_nbytes: size_t, ++ pub aio_fildes: c_int, ++ pub aio_lio_opcode: c_int, ++ pub aio_reqprio: c_int, ++ pub aio_sigevent: crate::sigevent, ++ _state: c_int, ++ _errno: c_int, ++ _retval: ssize_t, ++ } ++ ++ pub struct glob_t { ++ pub gl_pathc: size_t, ++ pub gl_matchc: size_t, ++ pub gl_offs: size_t, ++ pub gl_flags: c_int, ++ pub gl_pathv: *mut *mut c_char, ++ ++ __unused3: *mut c_void, ++ ++ __unused4: *mut c_void, ++ __unused5: *mut c_void, ++ __unused6: *mut c_void, ++ __unused7: *mut c_void, ++ __unused8: *mut c_void, ++ } ++ ++ pub struct mq_attr { ++ pub mq_flags: c_long, ++ pub mq_maxmsg: c_long, ++ pub mq_msgsize: c_long, ++ pub mq_curmsgs: c_long, ++ } ++ ++ pub struct itimerspec { ++ pub it_interval: crate::timespec, ++ pub it_value: crate::timespec, ++ } ++ ++ pub struct sigset_t { ++ __bits: [u32; 4], ++ } ++ ++ pub struct stat { ++ pub st_dev: crate::dev_t, ++ pub st_mode: crate::mode_t, ++ pub st_ino: crate::ino_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ pub st_atime: crate::time_t, ++ pub st_atimensec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtimensec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctimensec: c_long, ++ pub st_birthtime: crate::time_t, ++ pub st_birthtimensec: c_long, ++ pub st_size: off_t, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_blksize: crate::blksize_t, ++ pub st_flags: u32, ++ pub st_gen: u32, ++ pub st_spare: [u32; 2], ++ } ++ ++ pub struct addrinfo { ++ pub ai_flags: c_int, ++ pub ai_family: c_int, ++ pub ai_socktype: c_int, ++ pub ai_protocol: c_int, ++ pub ai_addrlen: crate::socklen_t, ++ pub ai_canonname: *mut c_char, ++ pub ai_addr: *mut crate::sockaddr, ++ pub ai_next: *mut crate::addrinfo, ++ } ++ ++ pub struct siginfo_t { ++ pub si_signo: c_int, ++ pub si_code: c_int, ++ pub si_errno: c_int, ++ __pad1: c_int, ++ pub si_addr: *mut c_void, ++ __pad2: [u64; 13], ++ } ++ ++ pub struct pthread_attr_t { ++ pta_magic: c_uint, ++ pta_flags: c_int, ++ pta_private: *mut c_void, ++ } ++ ++ pub struct pthread_mutex_t { ++ ptm_magic: c_uint, ++ ptm_errorcheck: __pthread_spin_t, ++ #[cfg(any( ++ target_arch = "sparc", ++ target_arch = "sparc64", ++ target_arch = "x86", ++ target_arch = "x86_64" ++ ))] ++ ptm_pad1: [u8; 3], ++ // actually a union with a non-unused, 0-initialized field ++ ptm_unused: __pthread_spin_t, ++ #[cfg(any( ++ target_arch = "sparc", ++ target_arch = "sparc64", ++ target_arch = "x86", ++ target_arch = "x86_64" ++ ))] ++ ptm_pad2: [u8; 3], ++ ptm_owner: crate::pthread_t, ++ ptm_waiters: *mut u8, ++ ptm_recursed: c_uint, ++ ptm_spare2: *mut c_void, ++ } ++ ++ pub struct pthread_mutexattr_t { ++ ptma_magic: c_uint, ++ ptma_private: *mut c_void, ++ } ++ ++ pub struct pthread_rwlockattr_t { ++ ptra_magic: c_uint, ++ ptra_private: *mut c_void, ++ } ++ ++ pub struct pthread_cond_t { ++ ptc_magic: c_uint, ++ ptc_lock: __pthread_spin_t, ++ ptc_waiters_first: *mut u8, ++ ptc_waiters_last: *mut u8, ++ ptc_mutex: *mut crate::pthread_mutex_t, ++ ptc_private: *mut c_void, ++ } ++ ++ pub struct pthread_condattr_t { ++ ptca_magic: c_uint, ++ ptca_private: *mut c_void, ++ } ++ ++ pub struct pthread_rwlock_t { ++ ptr_magic: c_uint, ++ ptr_interlock: __pthread_spin_t, ++ ptr_rblocked_first: *mut u8, ++ ptr_rblocked_last: *mut u8, ++ ptr_wblocked_first: *mut u8, ++ ptr_wblocked_last: *mut u8, ++ ptr_nreaders: c_uint, ++ ptr_owner: crate::pthread_t, ++ ptr_private: *mut c_void, ++ } ++ ++ pub struct pthread_spinlock_t { ++ pts_magic: c_uint, ++ pts_spin: crate::pthread_spin_t, ++ pts_flags: c_int, ++ } ++ ++ pub struct kevent { ++ pub ident: crate::uintptr_t, ++ pub filter: u32, ++ pub flags: u32, ++ pub fflags: u32, ++ pub data: i64, ++ pub udata: intptr_t, /* FIXME: NetBSD 10.0 will finally have same layout as other BSD */ ++ } ++ ++ pub struct dqblk { ++ pub dqb_bhardlimit: u32, ++ pub dqb_bsoftlimit: u32, ++ pub dqb_curblocks: u32, ++ pub dqb_ihardlimit: u32, ++ pub dqb_isoftlimit: u32, ++ pub dqb_curinodes: u32, ++ pub dqb_btime: i32, ++ pub dqb_itime: i32, ++ } ++ ++ pub struct Dl_info { ++ pub dli_fname: *const c_char, ++ pub dli_fbase: *mut c_void, ++ pub dli_sname: *const c_char, ++ pub dli_saddr: *const c_void, ++ } ++ ++ pub struct lconv { ++ pub decimal_point: *mut c_char, ++ pub thousands_sep: *mut c_char, ++ pub grouping: *mut c_char, ++ pub int_curr_symbol: *mut c_char, ++ pub currency_symbol: *mut c_char, ++ pub mon_decimal_point: *mut c_char, ++ pub mon_thousands_sep: *mut c_char, ++ pub mon_grouping: *mut c_char, ++ pub positive_sign: *mut c_char, ++ pub negative_sign: *mut c_char, ++ pub int_frac_digits: c_char, ++ pub frac_digits: c_char, ++ pub p_cs_precedes: c_char, ++ pub p_sep_by_space: c_char, ++ pub n_cs_precedes: c_char, ++ pub n_sep_by_space: c_char, ++ pub p_sign_posn: c_char, ++ pub n_sign_posn: c_char, ++ pub int_p_cs_precedes: c_char, ++ pub int_n_cs_precedes: c_char, ++ pub int_p_sep_by_space: c_char, ++ pub int_n_sep_by_space: c_char, ++ pub int_p_sign_posn: c_char, ++ pub int_n_sign_posn: c_char, ++ } ++ ++ pub struct if_data { ++ pub ifi_type: c_uchar, ++ pub ifi_addrlen: c_uchar, ++ pub ifi_hdrlen: c_uchar, ++ pub ifi_link_state: c_int, ++ pub ifi_mtu: u64, ++ pub ifi_metric: u64, ++ pub ifi_baudrate: u64, ++ pub ifi_ipackets: u64, ++ pub ifi_ierrors: u64, ++ pub ifi_opackets: u64, ++ pub ifi_oerrors: u64, ++ pub ifi_collisions: u64, ++ pub ifi_ibytes: u64, ++ pub ifi_obytes: u64, ++ pub ifi_imcasts: u64, ++ pub ifi_omcasts: u64, ++ pub ifi_iqdrops: u64, ++ pub ifi_noproto: u64, ++ pub ifi_lastchange: crate::timespec, ++ } ++ ++ pub struct if_msghdr { ++ pub ifm_msglen: c_ushort, ++ pub ifm_version: c_uchar, ++ pub ifm_type: c_uchar, ++ pub ifm_addrs: c_int, ++ pub ifm_flags: c_int, ++ pub ifm_index: c_ushort, ++ pub ifm_data: if_data, ++ } ++ ++ pub struct sockcred { ++ pub sc_pid: crate::pid_t, ++ pub sc_uid: crate::uid_t, ++ pub sc_euid: crate::uid_t, ++ pub sc_gid: crate::gid_t, ++ pub sc_egid: crate::gid_t, ++ pub sc_ngroups: c_int, ++ pub sc_groups: [crate::gid_t; 1], ++ } ++ ++ pub struct uucred { ++ pub cr_unused: c_ushort, ++ pub cr_uid: crate::uid_t, ++ pub cr_gid: crate::gid_t, ++ pub cr_ngroups: c_int, ++ pub cr_groups: [crate::gid_t; NGROUPS_MAX as usize], ++ } ++ ++ pub struct unpcbid { ++ pub unp_pid: crate::pid_t, ++ pub unp_euid: crate::uid_t, ++ pub unp_egid: crate::gid_t, ++ } ++ ++ pub struct sockaddr_dl { ++ pub sdl_len: c_uchar, ++ pub sdl_family: c_uchar, ++ pub sdl_index: c_ushort, ++ pub sdl_type: u8, ++ pub sdl_nlen: u8, ++ pub sdl_alen: u8, ++ pub sdl_slen: u8, ++ pub sdl_data: [c_char; 12], ++ } ++ ++ pub struct __exit_status { ++ pub e_termination: u16, ++ pub e_exit: u16, ++ } ++ ++ pub struct shmid_ds { ++ pub shm_perm: crate::ipc_perm, ++ pub shm_segsz: size_t, ++ pub shm_lpid: crate::pid_t, ++ pub shm_cpid: crate::pid_t, ++ pub shm_nattch: crate::shmatt_t, ++ pub shm_atime: crate::time_t, ++ pub shm_dtime: crate::time_t, ++ pub shm_ctime: crate::time_t, ++ _shm_internal: *mut c_void, ++ } ++ ++ pub struct utmp { ++ pub ut_line: [c_char; UT_LINESIZE], ++ pub ut_name: [c_char; UT_NAMESIZE], ++ pub ut_host: [c_char; UT_HOSTSIZE], ++ pub ut_time: crate::time_t, ++ } ++ ++ pub struct lastlog { ++ pub ll_line: [c_char; UT_LINESIZE], ++ pub ll_host: [c_char; UT_HOSTSIZE], ++ pub ll_time: crate::time_t, ++ } ++ ++ pub struct timex { ++ pub modes: c_uint, ++ pub offset: c_long, ++ pub freq: c_long, ++ pub maxerror: c_long, ++ pub esterror: c_long, ++ pub status: c_int, ++ pub constant: c_long, ++ pub precision: c_long, ++ pub tolerance: c_long, ++ pub ppsfreq: c_long, ++ pub jitter: c_long, ++ pub shift: c_int, ++ pub stabil: c_long, ++ pub jitcnt: c_long, ++ pub calcnt: c_long, ++ pub errcnt: c_long, ++ pub stbcnt: c_long, ++ } ++ ++ pub struct ntptimeval { ++ pub time: crate::timespec, ++ pub maxerror: c_long, ++ pub esterror: c_long, ++ pub tai: c_long, ++ pub time_state: c_int, ++ } ++ ++ // elf.h ++ ++ pub struct Elf32_Phdr { ++ pub p_type: Elf32_Word, ++ pub p_offset: Elf32_Off, ++ pub p_vaddr: Elf32_Addr, ++ pub p_paddr: Elf32_Addr, ++ pub p_filesz: Elf32_Word, ++ pub p_memsz: Elf32_Word, ++ pub p_flags: Elf32_Word, ++ pub p_align: Elf32_Word, ++ } ++ ++ pub struct Elf64_Phdr { ++ pub p_type: Elf64_Word, ++ pub p_flags: Elf64_Word, ++ pub p_offset: Elf64_Off, ++ pub p_vaddr: Elf64_Addr, ++ pub p_paddr: Elf64_Addr, ++ pub p_filesz: Elf64_Xword, ++ pub p_memsz: Elf64_Xword, ++ pub p_align: Elf64_Xword, ++ } ++ ++ pub struct Aux32Info { ++ pub a_type: Elf32_Word, ++ pub a_v: Elf32_Word, ++ } ++ ++ pub struct Aux64Info { ++ pub a_type: Elf64_Word, ++ pub a_v: Elf64_Xword, ++ } ++ ++ // link.h ++ ++ pub struct dl_phdr_info { ++ pub dlpi_addr: Elf_Addr, ++ pub dlpi_name: *const c_char, ++ pub dlpi_phdr: *const Elf_Phdr, ++ pub dlpi_phnum: Elf_Half, ++ pub dlpi_adds: c_ulonglong, ++ pub dlpi_subs: c_ulonglong, ++ pub dlpi_tls_modid: usize, ++ pub dlpi_tls_data: *mut c_void, ++ } ++ ++ pub struct _cpuset { ++ bits: [u32; 0], ++ } ++ ++ pub struct accept_filter_arg { ++ pub af_name: [c_char; 16], ++ af_arg: [c_char; 256 - 16], ++ } ++ ++ 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, ++ pub kve_offset: u64, ++ pub kve_type: u32, ++ pub kve_flags: u32, ++ pub kve_count: u32, ++ pub kve_wired_count: u32, ++ pub kve_advice: u32, ++ pub kve_attributes: u32, ++ pub kve_protection: u32, ++ pub kve_max_protection: u32, ++ pub kve_ref_count: u32, ++ pub kve_inheritance: u32, ++ pub kve_vn_fileid: u64, ++ pub kve_vn_size: u64, ++ pub kve_vn_fsid: u64, ++ pub kve_vn_rdev: u64, ++ pub kve_vn_type: u32, ++ pub kve_vn_mode: u32, ++ pub kve_path: [[c_char; 32]; 32], ++ } ++ ++ pub struct __c_anonymous_posix_spawn_fae_open { ++ pub path: *mut c_char, ++ pub oflag: c_int, ++ pub mode: crate::mode_t, ++ } ++ ++ pub struct __c_anonymous_posix_spawn_fae_dup2 { ++ pub newfildes: c_int, ++ } ++ ++ pub struct posix_spawnattr_t { ++ pub sa_flags: c_short, ++ pub sa_pgroup: crate::pid_t, ++ pub sa_schedparam: crate::sched_param, ++ pub sa_schedpolicy: c_int, ++ pub sa_sigdefault: sigset_t, ++ pub sa_sigmask: sigset_t, ++ } ++ ++ pub struct posix_spawn_file_actions_entry_t { ++ pub fae_action: fae_action, ++ pub fae_fildes: c_int, ++ pub fae_data: __c_anonymous_posix_spawn_fae, ++ } ++ ++ pub struct posix_spawn_file_actions_t { ++ pub size: c_uint, ++ pub len: c_uint, ++ pub fae: *mut posix_spawn_file_actions_entry_t, ++ } ++ ++ pub struct ptrace_lwpinfo { ++ pub pl_lwpid: lwpid_t, ++ pub pl_event: c_int, ++ } ++ ++ pub struct ptrace_lwpstatus { ++ pub pl_lwpid: lwpid_t, ++ pub pl_sigpend: sigset_t, ++ pub pl_sigmask: sigset_t, ++ pub pl_name: [c_char; 20], ++ pub pl_private: *mut c_void, ++ } ++ ++ pub struct ptrace_siginfo { ++ pub psi_siginfo: siginfo_t, ++ pub psi_lwpid: lwpid_t, ++ } ++ ++ pub struct ptrace_event { ++ pub pe_set_event: c_int, ++ } ++ ++ pub struct sysctldesc { ++ pub descr_num: i32, ++ pub descr_ver: u32, ++ pub descr_len: u32, ++ pub descr_str: [c_char; 1], ++ } ++ ++ pub struct ifreq { ++ pub _priv: [[c_char; 6]; 24], ++ } ++ ++ pub struct ifconf { ++ pub ifc_len: c_int, ++ pub ifc_ifcu: __c_anonymous_ifc_ifcu, ++ } ++ ++ pub struct tcp_info { ++ pub tcpi_state: u8, ++ pub __tcpi_ca_state: u8, ++ pub __tcpi_retransmits: u8, ++ pub __tcpi_probes: u8, ++ pub __tcpi_backoff: u8, ++ pub tcpi_options: u8, ++ pub tcp_snd_wscale: u8, ++ pub tcp_rcv_wscale: u8, ++ pub tcpi_rto: u32, ++ pub __tcpi_ato: u32, ++ pub tcpi_snd_mss: u32, ++ pub tcpi_rcv_mss: u32, ++ pub __tcpi_unacked: u32, ++ pub __tcpi_sacked: u32, ++ pub __tcpi_lost: u32, ++ pub __tcpi_retrans: u32, ++ pub __tcpi_fackets: u32, ++ pub __tcpi_last_data_sent: u32, ++ pub __tcpi_last_ack_sent: u32, ++ pub tcpi_last_data_recv: u32, ++ pub __tcpi_last_ack_recv: u32, ++ pub __tcpi_pmtu: u32, ++ pub __tcpi_rcv_ssthresh: u32, ++ pub tcpi_rtt: u32, ++ pub tcpi_rttvar: u32, ++ pub tcpi_snd_ssthresh: u32, ++ pub tcpi_snd_cwnd: u32, ++ pub __tcpi_advmss: u32, ++ pub __tcpi_reordering: u32, ++ pub __tcpi_rcv_rtt: u32, ++ pub tcpi_rcv_space: u32, ++ pub tcpi_snd_wnd: u32, ++ pub tcpi_snd_bwnd: u32, ++ pub tcpi_snd_nxt: u32, ++ pub tcpi_rcv_nxt: u32, ++ pub tcpi_toe_tid: u32, ++ pub tcpi_snd_rexmitpack: u32, ++ pub tcpi_rcv_ooopack: u32, ++ pub tcpi_snd_zerowin: u32, ++ pub __tcpi_pad: [u32; 26], ++ } ++} ++ ++s_no_extra_traits! { ++ pub struct utmpx { ++ pub ut_name: [c_char; _UTX_USERSIZE], ++ pub ut_id: [c_char; _UTX_IDSIZE], ++ pub ut_line: [c_char; _UTX_LINESIZE], ++ pub ut_host: [c_char; _UTX_HOSTSIZE], ++ pub ut_session: u16, ++ pub ut_type: u16, ++ pub ut_pid: crate::pid_t, ++ pub ut_exit: __exit_status, // FIXME: when anonymous struct are supported ++ pub ut_ss: sockaddr_storage, ++ pub ut_tv: crate::timeval, ++ pub ut_pad: [u8; _UTX_PADSIZE], ++ } ++ ++ pub struct lastlogx { ++ pub ll_tv: crate::timeval, ++ pub ll_line: [c_char; _UTX_LINESIZE], ++ pub ll_host: [c_char; _UTX_HOSTSIZE], ++ pub ll_ss: sockaddr_storage, ++ } ++ ++ pub struct in_pktinfo { ++ pub ipi_addr: crate::in_addr, ++ pub ipi_ifindex: c_uint, ++ } ++ ++ pub struct arphdr { ++ pub ar_hrd: u16, ++ pub ar_pro: u16, ++ pub ar_hln: u8, ++ pub ar_pln: u8, ++ pub ar_op: u16, ++ } ++ ++ pub struct in_addr { ++ pub s_addr: crate::in_addr_t, ++ } ++ ++ pub struct ip_mreq { ++ pub imr_multiaddr: in_addr, ++ pub imr_interface: in_addr, ++ } ++ ++ pub struct sockaddr_in { ++ pub sin_len: u8, ++ pub sin_family: crate::sa_family_t, ++ pub sin_port: crate::in_port_t, ++ pub sin_addr: crate::in_addr, ++ pub sin_zero: [i8; 8], ++ } ++ ++ pub struct dirent { ++ pub d_fileno: crate::ino_t, ++ pub d_reclen: u16, ++ pub d_namlen: u16, ++ pub d_type: u8, ++ pub d_name: [c_char; 512], ++ } ++ ++ pub struct statvfs { ++ pub f_flag: c_ulong, ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_iosize: c_ulong, ++ ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ pub f_bresvd: crate::fsblkcnt_t, ++ ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_favail: crate::fsfilcnt_t, ++ pub f_fresvd: crate::fsfilcnt_t, ++ ++ pub f_syncreads: u64, ++ pub f_syncwrites: u64, ++ ++ pub f_asyncreads: u64, ++ pub f_asyncwrites: u64, ++ ++ pub f_fsidx: crate::fsid_t, ++ pub f_fsid: c_ulong, ++ pub f_namemax: c_ulong, ++ pub f_owner: crate::uid_t, ++ ++ pub f_spare: [u32; 4], ++ ++ pub f_fstypename: [c_char; 32], ++ pub f_mntonname: [c_char; 1024], ++ pub f_mntfromname: [c_char; 1024], ++ } ++ ++ pub struct sockaddr_storage { ++ pub ss_len: u8, ++ pub ss_family: crate::sa_family_t, ++ __ss_pad1: [u8; 6], ++ __ss_pad2: i64, ++ __ss_pad3: [u8; 112], ++ } ++ ++ pub struct sigevent { ++ pub sigev_notify: c_int, ++ pub sigev_signo: c_int, ++ pub sigev_value: crate::sigval, ++ __unused1: *mut c_void, //actually a function pointer ++ pub sigev_notify_attributes: *mut c_void, ++ } ++ ++ pub union __c_anonymous_posix_spawn_fae { ++ pub open: __c_anonymous_posix_spawn_fae_open, ++ pub dup2: __c_anonymous_posix_spawn_fae_dup2, ++ } ++ ++ pub union __c_anonymous_ifc_ifcu { ++ pub ifcu_buf: *mut c_void, ++ pub ifcu_req: *mut ifreq, ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for utmpx { ++ fn eq(&self, other: &utmpx) -> bool { ++ self.ut_type == other.ut_type ++ && self.ut_pid == other.ut_pid ++ && self.ut_name == other.ut_name ++ && self.ut_line == other.ut_line ++ && self.ut_id == other.ut_id ++ && self.ut_exit == other.ut_exit ++ && self.ut_session == other.ut_session ++ && self.ut_tv == other.ut_tv ++ && self.ut_ss == other.ut_ss ++ && self ++ .ut_pad ++ .iter() ++ .zip(other.ut_pad.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .ut_host ++ .iter() ++ .zip(other.ut_host.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ ++ impl Eq for utmpx {} ++ ++ impl fmt::Debug for utmpx { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("utmpx") ++ .field("ut_name", &self.ut_name) ++ .field("ut_id", &self.ut_id) ++ .field("ut_line", &self.ut_line) ++ // FIXME .field("ut_host", &self.ut_host) ++ .field("ut_session", &self.ut_session) ++ .field("ut_type", &self.ut_type) ++ .field("ut_pid", &self.ut_pid) ++ .field("ut_exit", &self.ut_exit) ++ .field("ut_ss", &self.ut_ss) ++ .field("ut_tv", &self.ut_tv) ++ // FIXME .field("ut_pad", &self.ut_pad) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for utmpx { ++ fn hash(&self, state: &mut H) { ++ self.ut_name.hash(state); ++ self.ut_type.hash(state); ++ self.ut_pid.hash(state); ++ self.ut_line.hash(state); ++ self.ut_id.hash(state); ++ self.ut_host.hash(state); ++ self.ut_exit.hash(state); ++ self.ut_session.hash(state); ++ self.ut_tv.hash(state); ++ self.ut_ss.hash(state); ++ self.ut_pad.hash(state); ++ } ++ } ++ ++ impl PartialEq for lastlogx { ++ fn eq(&self, other: &lastlogx) -> bool { ++ self.ll_tv == other.ll_tv ++ && self.ll_line == other.ll_line ++ && self.ll_ss == other.ll_ss ++ && self ++ .ll_host ++ .iter() ++ .zip(other.ll_host.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ ++ impl Eq for lastlogx {} ++ ++ impl fmt::Debug for lastlogx { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("lastlogx") ++ .field("ll_tv", &self.ll_tv) ++ .field("ll_line", &self.ll_line) ++ // FIXME.field("ll_host", &self.ll_host) ++ .field("ll_ss", &self.ll_ss) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for lastlogx { ++ fn hash(&self, state: &mut H) { ++ self.ll_tv.hash(state); ++ self.ll_line.hash(state); ++ self.ll_host.hash(state); ++ self.ll_ss.hash(state); ++ } ++ } ++ ++ impl PartialEq for in_pktinfo { ++ fn eq(&self, other: &in_pktinfo) -> bool { ++ self.ipi_addr == other.ipi_addr && self.ipi_ifindex == other.ipi_ifindex ++ } ++ } ++ impl Eq for in_pktinfo {} ++ impl fmt::Debug for in_pktinfo { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("in_pktinfo") ++ .field("ipi_addr", &self.ipi_addr) ++ .field("ipi_ifindex", &self.ipi_ifindex) ++ .finish() ++ } ++ } ++ impl hash::Hash for in_pktinfo { ++ fn hash(&self, state: &mut H) { ++ self.ipi_addr.hash(state); ++ self.ipi_ifindex.hash(state); ++ } ++ } ++ ++ impl PartialEq for arphdr { ++ fn eq(&self, other: &arphdr) -> bool { ++ self.ar_hrd == other.ar_hrd ++ && self.ar_pro == other.ar_pro ++ && self.ar_hln == other.ar_hln ++ && self.ar_pln == other.ar_pln ++ && self.ar_op == other.ar_op ++ } ++ } ++ impl Eq for arphdr {} ++ impl fmt::Debug for arphdr { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ let ar_hrd = self.ar_hrd; ++ let ar_pro = self.ar_pro; ++ let ar_op = self.ar_op; ++ f.debug_struct("arphdr") ++ .field("ar_hrd", &ar_hrd) ++ .field("ar_pro", &ar_pro) ++ .field("ar_hln", &self.ar_hln) ++ .field("ar_pln", &self.ar_pln) ++ .field("ar_op", &ar_op) ++ .finish() ++ } ++ } ++ impl hash::Hash for arphdr { ++ fn hash(&self, state: &mut H) { ++ let ar_hrd = self.ar_hrd; ++ let ar_pro = self.ar_pro; ++ let ar_op = self.ar_op; ++ ar_hrd.hash(state); ++ ar_pro.hash(state); ++ self.ar_hln.hash(state); ++ self.ar_pln.hash(state); ++ ar_op.hash(state); ++ } ++ } ++ ++ impl PartialEq for in_addr { ++ fn eq(&self, other: &in_addr) -> bool { ++ self.s_addr == other.s_addr ++ } ++ } ++ impl Eq for in_addr {} ++ impl fmt::Debug for in_addr { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ let s_addr = self.s_addr; ++ f.debug_struct("in_addr").field("s_addr", &s_addr).finish() ++ } ++ } ++ impl hash::Hash for in_addr { ++ fn hash(&self, state: &mut H) { ++ let s_addr = self.s_addr; ++ s_addr.hash(state); ++ } ++ } ++ ++ impl PartialEq for ip_mreq { ++ fn eq(&self, other: &ip_mreq) -> bool { ++ self.imr_multiaddr == other.imr_multiaddr ++ && self.imr_interface == other.imr_interface ++ } ++ } ++ impl Eq for ip_mreq {} ++ impl fmt::Debug for ip_mreq { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("ip_mreq") ++ .field("imr_multiaddr", &self.imr_multiaddr) ++ .field("imr_interface", &self.imr_interface) ++ .finish() ++ } ++ } ++ impl hash::Hash for ip_mreq { ++ fn hash(&self, state: &mut H) { ++ self.imr_multiaddr.hash(state); ++ self.imr_interface.hash(state); ++ } ++ } ++ ++ impl PartialEq for sockaddr_in { ++ fn eq(&self, other: &sockaddr_in) -> bool { ++ self.sin_len == other.sin_len ++ && self.sin_family == other.sin_family ++ && self.sin_port == other.sin_port ++ && self.sin_addr == other.sin_addr ++ && self.sin_zero == other.sin_zero ++ } ++ } ++ impl Eq for sockaddr_in {} ++ impl fmt::Debug for sockaddr_in { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sockaddr_in") ++ .field("sin_len", &self.sin_len) ++ .field("sin_family", &self.sin_family) ++ .field("sin_port", &self.sin_port) ++ .field("sin_addr", &self.sin_addr) ++ .field("sin_zero", &self.sin_zero) ++ .finish() ++ } ++ } ++ impl hash::Hash for sockaddr_in { ++ fn hash(&self, state: &mut H) { ++ self.sin_len.hash(state); ++ self.sin_family.hash(state); ++ self.sin_port.hash(state); ++ self.sin_addr.hash(state); ++ self.sin_zero.hash(state); ++ } ++ } ++ ++ impl PartialEq for dirent { ++ fn eq(&self, other: &dirent) -> bool { ++ self.d_fileno == other.d_fileno ++ && self.d_reclen == other.d_reclen ++ && self.d_namlen == other.d_namlen ++ && self.d_type == other.d_type ++ && self ++ .d_name ++ .iter() ++ .zip(other.d_name.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for dirent {} ++ impl fmt::Debug for dirent { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("dirent") ++ .field("d_fileno", &self.d_fileno) ++ .field("d_reclen", &self.d_reclen) ++ .field("d_namlen", &self.d_namlen) ++ .field("d_type", &self.d_type) ++ // FIXME: .field("d_name", &self.d_name) ++ .finish() ++ } ++ } ++ impl hash::Hash for dirent { ++ fn hash(&self, state: &mut H) { ++ self.d_fileno.hash(state); ++ self.d_reclen.hash(state); ++ self.d_namlen.hash(state); ++ self.d_type.hash(state); ++ self.d_name.hash(state); ++ } ++ } ++ ++ impl PartialEq for statvfs { ++ fn eq(&self, other: &statvfs) -> bool { ++ self.f_flag == other.f_flag ++ && self.f_bsize == other.f_bsize ++ && self.f_frsize == other.f_frsize ++ && self.f_iosize == other.f_iosize ++ && self.f_blocks == other.f_blocks ++ && self.f_bfree == other.f_bfree ++ && self.f_bavail == other.f_bavail ++ && self.f_bresvd == other.f_bresvd ++ && self.f_files == other.f_files ++ && self.f_ffree == other.f_ffree ++ && self.f_favail == other.f_favail ++ && self.f_fresvd == other.f_fresvd ++ && self.f_syncreads == other.f_syncreads ++ && self.f_syncwrites == other.f_syncwrites ++ && self.f_asyncreads == other.f_asyncreads ++ && self.f_asyncwrites == other.f_asyncwrites ++ && self.f_fsidx == other.f_fsidx ++ && self.f_fsid == other.f_fsid ++ && self.f_namemax == other.f_namemax ++ && self.f_owner == other.f_owner ++ && self.f_spare == other.f_spare ++ && self.f_fstypename == other.f_fstypename ++ && self ++ .f_mntonname ++ .iter() ++ .zip(other.f_mntonname.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .f_mntfromname ++ .iter() ++ .zip(other.f_mntfromname.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for statvfs {} ++ impl fmt::Debug for statvfs { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("statvfs") ++ .field("f_flag", &self.f_flag) ++ .field("f_bsize", &self.f_bsize) ++ .field("f_frsize", &self.f_frsize) ++ .field("f_iosize", &self.f_iosize) ++ .field("f_blocks", &self.f_blocks) ++ .field("f_bfree", &self.f_bfree) ++ .field("f_bavail", &self.f_bavail) ++ .field("f_bresvd", &self.f_bresvd) ++ .field("f_files", &self.f_files) ++ .field("f_ffree", &self.f_ffree) ++ .field("f_favail", &self.f_favail) ++ .field("f_fresvd", &self.f_fresvd) ++ .field("f_syncreads", &self.f_syncreads) ++ .field("f_syncwrites", &self.f_syncwrites) ++ .field("f_asyncreads", &self.f_asyncreads) ++ .field("f_asyncwrites", &self.f_asyncwrites) ++ .field("f_fsidx", &self.f_fsidx) ++ .field("f_fsid", &self.f_fsid) ++ .field("f_namemax", &self.f_namemax) ++ .field("f_owner", &self.f_owner) ++ .field("f_spare", &self.f_spare) ++ .field("f_fstypename", &self.f_fstypename) ++ // FIXME: .field("f_mntonname", &self.f_mntonname) ++ // FIXME: .field("f_mntfromname", &self.f_mntfromname) ++ .finish() ++ } ++ } ++ impl hash::Hash for statvfs { ++ fn hash(&self, state: &mut H) { ++ self.f_flag.hash(state); ++ self.f_bsize.hash(state); ++ self.f_frsize.hash(state); ++ self.f_iosize.hash(state); ++ self.f_blocks.hash(state); ++ self.f_bfree.hash(state); ++ self.f_bavail.hash(state); ++ self.f_bresvd.hash(state); ++ self.f_files.hash(state); ++ self.f_ffree.hash(state); ++ self.f_favail.hash(state); ++ self.f_fresvd.hash(state); ++ self.f_syncreads.hash(state); ++ self.f_syncwrites.hash(state); ++ self.f_asyncreads.hash(state); ++ self.f_asyncwrites.hash(state); ++ self.f_fsidx.hash(state); ++ self.f_fsid.hash(state); ++ self.f_namemax.hash(state); ++ self.f_owner.hash(state); ++ self.f_spare.hash(state); ++ self.f_fstypename.hash(state); ++ self.f_mntonname.hash(state); ++ self.f_mntfromname.hash(state); ++ } ++ } ++ ++ impl PartialEq for sockaddr_storage { ++ fn eq(&self, other: &sockaddr_storage) -> bool { ++ self.ss_len == other.ss_len ++ && self.ss_family == other.ss_family ++ && self.__ss_pad1 == other.__ss_pad1 ++ && self.__ss_pad2 == other.__ss_pad2 ++ && self ++ .__ss_pad3 ++ .iter() ++ .zip(other.__ss_pad3.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for sockaddr_storage {} ++ impl fmt::Debug for sockaddr_storage { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sockaddr_storage") ++ .field("ss_len", &self.ss_len) ++ .field("ss_family", &self.ss_family) ++ .field("__ss_pad1", &self.__ss_pad1) ++ .field("__ss_pad2", &self.__ss_pad2) ++ // FIXME: .field("__ss_pad3", &self.__ss_pad3) ++ .finish() ++ } ++ } ++ impl hash::Hash for sockaddr_storage { ++ fn hash(&self, state: &mut H) { ++ self.ss_len.hash(state); ++ self.ss_family.hash(state); ++ self.__ss_pad1.hash(state); ++ self.__ss_pad2.hash(state); ++ self.__ss_pad3.hash(state); ++ } ++ } ++ ++ impl PartialEq for sigevent { ++ fn eq(&self, other: &sigevent) -> bool { ++ self.sigev_notify == other.sigev_notify ++ && self.sigev_signo == other.sigev_signo ++ && self.sigev_value == other.sigev_value ++ && self.sigev_notify_attributes == other.sigev_notify_attributes ++ } ++ } ++ impl Eq for sigevent {} ++ impl fmt::Debug for sigevent { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sigevent") ++ .field("sigev_notify", &self.sigev_notify) ++ .field("sigev_signo", &self.sigev_signo) ++ .field("sigev_value", &self.sigev_value) ++ .field("sigev_notify_attributes", &self.sigev_notify_attributes) ++ .finish() ++ } ++ } ++ impl hash::Hash for sigevent { ++ fn hash(&self, state: &mut H) { ++ self.sigev_notify.hash(state); ++ self.sigev_signo.hash(state); ++ self.sigev_value.hash(state); ++ self.sigev_notify_attributes.hash(state); ++ } ++ } ++ ++ impl Eq for __c_anonymous_posix_spawn_fae {} ++ ++ impl PartialEq for __c_anonymous_posix_spawn_fae { ++ fn eq(&self, other: &__c_anonymous_posix_spawn_fae) -> bool { ++ unsafe { self.open == other.open || self.dup2 == other.dup2 } ++ } ++ } ++ ++ impl hash::Hash for __c_anonymous_posix_spawn_fae { ++ fn hash(&self, state: &mut H) { ++ unsafe { ++ self.open.hash(state); ++ self.dup2.hash(state); ++ } ++ } ++ } ++ ++ impl Eq for __c_anonymous_ifc_ifcu {} ++ ++ impl PartialEq for __c_anonymous_ifc_ifcu { ++ fn eq(&self, other: &__c_anonymous_ifc_ifcu) -> bool { ++ unsafe { self.ifcu_buf == other.ifcu_buf || self.ifcu_req == other.ifcu_req } ++ } ++ } ++ ++ impl hash::Hash for __c_anonymous_ifc_ifcu { ++ fn hash(&self, state: &mut H) { ++ unsafe { ++ self.ifcu_buf.hash(state); ++ self.ifcu_req.hash(state); ++ } ++ } ++ } ++ } ++} ++ ++pub const AT_FDCWD: c_int = -100; ++pub const AT_EACCESS: c_int = 0x100; ++pub const AT_SYMLINK_NOFOLLOW: c_int = 0x200; ++pub const AT_SYMLINK_FOLLOW: c_int = 0x400; ++pub const AT_REMOVEDIR: c_int = 0x800; ++ ++pub const AT_NULL: c_int = 0; ++pub const AT_IGNORE: c_int = 1; ++pub const AT_EXECFD: c_int = 2; ++pub const AT_PHDR: c_int = 3; ++pub const AT_PHENT: c_int = 4; ++pub const AT_PHNUM: c_int = 5; ++pub const AT_PAGESZ: c_int = 6; ++pub const AT_BASE: c_int = 7; ++pub const AT_FLAGS: c_int = 8; ++pub const AT_ENTRY: c_int = 9; ++pub const AT_DCACHEBSIZE: c_int = 10; ++pub const AT_ICACHEBSIZE: c_int = 11; ++pub const AT_UCACHEBSIZE: c_int = 12; ++pub const AT_STACKBASE: c_int = 13; ++pub const AT_EUID: c_int = 2000; ++pub const AT_RUID: c_int = 2001; ++pub const AT_EGID: c_int = 2002; ++pub const AT_RGID: c_int = 2003; ++pub const AT_SUN_LDELF: c_int = 2004; ++pub const AT_SUN_LDSHDR: c_int = 2005; ++pub const AT_SUN_LDNAME: c_int = 2006; ++pub const AT_SUN_LDPGSIZE: c_int = 2007; ++pub const AT_SUN_PLATFORM: c_int = 2008; ++pub const AT_SUN_HWCAP: c_int = 2009; ++pub const AT_SUN_IFLUSH: c_int = 2010; ++pub const AT_SUN_CPU: c_int = 2011; ++pub const AT_SUN_EMUL_ENTRY: c_int = 2012; ++pub const AT_SUN_EMUL_EXECFD: c_int = 2013; ++pub const AT_SUN_EXECNAME: c_int = 2014; ++ ++pub const EXTATTR_NAMESPACE_USER: c_int = 1; ++pub const EXTATTR_NAMESPACE_SYSTEM: c_int = 2; ++ ++pub const LC_COLLATE_MASK: c_int = 1 << crate::LC_COLLATE; ++pub const LC_CTYPE_MASK: c_int = 1 << crate::LC_CTYPE; ++pub const LC_MONETARY_MASK: c_int = 1 << crate::LC_MONETARY; ++pub const LC_NUMERIC_MASK: c_int = 1 << crate::LC_NUMERIC; ++pub const LC_TIME_MASK: c_int = 1 << crate::LC_TIME; ++pub const LC_MESSAGES_MASK: c_int = 1 << crate::LC_MESSAGES; ++pub const LC_ALL_MASK: c_int = !0; ++ ++pub const ERA: crate::nl_item = 52; ++pub const ERA_D_FMT: crate::nl_item = 53; ++pub const ERA_D_T_FMT: crate::nl_item = 54; ++pub const ERA_T_FMT: crate::nl_item = 55; ++pub const ALT_DIGITS: crate::nl_item = 56; ++ ++pub const O_CLOEXEC: c_int = 0x400000; ++pub const O_ALT_IO: c_int = 0x40000; ++pub const O_NOSIGPIPE: c_int = 0x1000000; ++pub const O_SEARCH: c_int = 0x800000; ++pub const O_DIRECTORY: c_int = 0x200000; ++pub const O_DIRECT: c_int = 0x00080000; ++pub const O_RSYNC: c_int = 0x00020000; ++ ++pub const MS_SYNC: c_int = 0x4; ++pub const MS_INVALIDATE: c_int = 0x2; ++ ++// Here because they are not present on OpenBSD ++// (https://github.com/openbsd/src/blob/HEAD/sys/sys/resource.h) ++pub const RLIMIT_SBSIZE: c_int = 9; ++pub const RLIMIT_AS: c_int = 10; ++pub const RLIMIT_NTHR: c_int = 11; ++ ++#[deprecated(since = "0.2.64", note = "Not stable across OS versions")] ++pub const RLIM_NLIMITS: c_int = 12; ++ ++pub const EIDRM: c_int = 82; ++pub const ENOMSG: c_int = 83; ++pub const EOVERFLOW: c_int = 84; ++pub const EILSEQ: c_int = 85; ++pub const ENOTSUP: c_int = 86; ++pub const ECANCELED: c_int = 87; ++pub const EBADMSG: c_int = 88; ++pub const ENODATA: c_int = 89; ++pub const ENOSR: c_int = 90; ++pub const ENOSTR: c_int = 91; ++pub const ETIME: c_int = 92; ++pub const ENOATTR: c_int = 93; ++pub const EMULTIHOP: c_int = 94; ++pub const ENOLINK: c_int = 95; ++pub const EPROTO: c_int = 96; ++pub const EOWNERDEAD: c_int = 97; ++pub const ENOTRECOVERABLE: c_int = 98; ++#[deprecated( ++ since = "0.2.143", ++ note = "This value will always match the highest defined error number \ ++ and thus is not stable. \ ++ See #3040 for more info." ++)] ++pub const ELAST: c_int = 98; ++ ++pub const F_DUPFD_CLOEXEC: c_int = 12; ++pub const F_CLOSEM: c_int = 10; ++pub const F_GETNOSIGPIPE: c_int = 13; ++pub const F_SETNOSIGPIPE: c_int = 14; ++pub const F_MAXFD: c_int = 11; ++pub const F_GETPATH: c_int = 15; ++ ++pub const FUTEX_WAIT: c_int = 0; ++pub const FUTEX_WAKE: c_int = 1; ++pub const FUTEX_FD: c_int = 2; ++pub const FUTEX_REQUEUE: c_int = 3; ++pub const FUTEX_CMP_REQUEUE: c_int = 4; ++pub const FUTEX_WAKE_OP: c_int = 5; ++pub const FUTEX_LOCK_PI: c_int = 6; ++pub const FUTEX_UNLOCK_PI: c_int = 7; ++pub const FUTEX_TRYLOCK_PI: c_int = 8; ++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_PRIVATE_FLAG: c_int = 1 << 7; ++pub const FUTEX_CLOCK_REALTIME: c_int = 1 << 8; ++pub const FUTEX_CMD_MASK: c_int = !(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME); ++pub const FUTEX_WAITERS: u32 = 1 << 31; ++pub const FUTEX_OWNER_DIED: u32 = 1 << 30; ++pub const FUTEX_SYNCOBJ_1: u32 = 1 << 29; ++pub const FUTEX_SYNCOBJ_0: u32 = 1 << 28; ++pub const FUTEX_TID_MASK: u32 = (1 << 28) - 1; ++pub const FUTEX_BITSET_MATCH_ANY: u32 = !0; ++ ++pub const IP_RECVDSTADDR: c_int = 7; ++pub const IP_SENDSRCADDR: c_int = IP_RECVDSTADDR; ++pub const IP_RECVIF: c_int = 20; ++pub const IP_PKTINFO: c_int = 25; ++pub const IP_RECVPKTINFO: c_int = 26; ++pub const IPV6_JOIN_GROUP: c_int = 12; ++pub const IPV6_LEAVE_GROUP: c_int = 13; ++ ++pub const TCP_KEEPIDLE: c_int = 3; ++pub const TCP_KEEPINTVL: c_int = 5; ++pub const TCP_KEEPCNT: c_int = 6; ++pub const TCP_KEEPINIT: c_int = 7; ++pub const TCP_MD5SIG: c_int = 0x10; ++pub const TCP_CONGCTL: c_int = 0x20; ++ ++pub const SOCK_CONN_DGRAM: c_int = 6; ++pub const SOCK_DCCP: c_int = SOCK_CONN_DGRAM; ++pub const SOCK_NOSIGPIPE: c_int = 0x40000000; ++pub const SOCK_FLAGS_MASK: c_int = 0xf0000000; ++ ++pub const SO_SNDTIMEO: c_int = 0x100b; ++pub const SO_RCVTIMEO: c_int = 0x100c; ++pub const SO_NOSIGPIPE: c_int = 0x0800; ++pub const SO_ACCEPTFILTER: c_int = 0x1000; ++pub const SO_TIMESTAMP: c_int = 0x2000; ++pub const SO_OVERFLOWED: c_int = 0x1009; ++pub const SO_NOHEADER: c_int = 0x100a; ++ ++// http://cvsweb.netbsd.org/bsdweb.cgi/src/sys/sys/un.h?annotate ++pub const LOCAL_OCREDS: c_int = 0x0001; // pass credentials to receiver ++pub const LOCAL_CONNWAIT: c_int = 0x0002; // connects block until accepted ++pub const LOCAL_PEEREID: c_int = 0x0003; // get peer identification ++pub const LOCAL_CREDS: c_int = 0x0004; // pass credentials to receiver ++ ++// https://github.com/NetBSD/src/blob/trunk/sys/net/if.h#L373 ++pub const IFF_UP: c_int = 0x0001; // interface is up ++pub const IFF_BROADCAST: c_int = 0x0002; // broadcast address valid ++pub const IFF_DEBUG: c_int = 0x0004; // turn on debugging ++pub const IFF_LOOPBACK: c_int = 0x0008; // is a loopback net ++pub const IFF_POINTOPOINT: c_int = 0x0010; // interface is point-to-point link ++pub const IFF_NOTRAILERS: c_int = 0x0020; // avoid use of trailers ++pub const IFF_RUNNING: c_int = 0x0040; // resources allocated ++pub const IFF_NOARP: c_int = 0x0080; // no address resolution protocol ++pub const IFF_PROMISC: c_int = 0x0100; // receive all packets ++pub const IFF_ALLMULTI: c_int = 0x0200; // receive all multicast packets ++pub const IFF_OACTIVE: c_int = 0x0400; // transmission in progress ++pub const IFF_SIMPLEX: c_int = 0x0800; // can't hear own transmissions ++pub const IFF_LINK0: c_int = 0x1000; // per link layer defined bit ++pub const IFF_LINK1: c_int = 0x2000; // per link layer defined bit ++pub const IFF_LINK2: c_int = 0x4000; // per link layer defined bit ++pub const IFF_MULTICAST: c_int = 0x8000; // supports multicast ++ ++// sys/netinet/in.h ++// Protocols (RFC 1700) ++// NOTE: These are in addition to the constants defined in src/unix/mod.rs ++ ++// IPPROTO_IP defined in src/unix/mod.rs ++/// Hop-by-hop option header ++pub const IPPROTO_HOPOPTS: c_int = 0; ++// IPPROTO_ICMP defined in src/unix/mod.rs ++/// group mgmt protocol ++pub const IPPROTO_IGMP: c_int = 2; ++/// gateway^2 (deprecated) ++pub const IPPROTO_GGP: c_int = 3; ++/// for compatibility ++pub const IPPROTO_IPIP: c_int = 4; ++// IPPROTO_TCP defined in src/unix/mod.rs ++/// exterior gateway protocol ++pub const IPPROTO_EGP: c_int = 8; ++/// pup ++pub const IPPROTO_PUP: c_int = 12; ++// IPPROTO_UDP defined in src/unix/mod.rs ++/// xns idp ++pub const IPPROTO_IDP: c_int = 22; ++/// tp-4 w/ class negotiation ++pub const IPPROTO_TP: c_int = 29; ++/// DCCP ++pub const IPPROTO_DCCP: c_int = 33; ++// IPPROTO_IPV6 defined in src/unix/mod.rs ++/// IP6 routing header ++pub const IPPROTO_ROUTING: c_int = 43; ++/// IP6 fragmentation header ++pub const IPPROTO_FRAGMENT: c_int = 44; ++/// resource reservation ++pub const IPPROTO_RSVP: c_int = 46; ++/// General Routing Encap. ++pub const IPPROTO_GRE: c_int = 47; ++/// IP6 Encap Sec. Payload ++pub const IPPROTO_ESP: c_int = 50; ++/// IP6 Auth Header ++pub const IPPROTO_AH: c_int = 51; ++/// IP Mobility RFC 2004 ++pub const IPPROTO_MOBILE: c_int = 55; ++/// IPv6 ICMP ++pub const IPPROTO_IPV6_ICMP: c_int = 58; ++// IPPROTO_ICMPV6 defined in src/unix/mod.rs ++/// IP6 no next header ++pub const IPPROTO_NONE: c_int = 59; ++/// IP6 destination option ++pub const IPPROTO_DSTOPTS: c_int = 60; ++/// ISO cnlp ++pub const IPPROTO_EON: c_int = 80; ++/// Ethernet-in-IP ++pub const IPPROTO_ETHERIP: c_int = 97; ++/// encapsulation header ++pub const IPPROTO_ENCAP: c_int = 98; ++/// Protocol indep. multicast ++pub const IPPROTO_PIM: c_int = 103; ++/// IP Payload Comp. Protocol ++pub const IPPROTO_IPCOMP: c_int = 108; ++/// VRRP RFC 2338 ++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; ++/// SCTP ++pub const IPPROTO_SCTP: c_int = 132; ++/// PFSYNC ++pub const IPPROTO_PFSYNC: c_int = 240; ++pub const IPPROTO_MAX: c_int = 256; ++ ++/// last return value of *_input(), meaning "all job for this pkt is done". ++pub const IPPROTO_DONE: c_int = 257; ++ ++/// sysctl placeholder for (FAST_)IPSEC ++pub const CTL_IPPROTO_IPSEC: c_int = 258; ++ ++pub const AF_OROUTE: c_int = 17; ++pub const AF_ARP: c_int = 28; ++pub const pseudo_AF_KEY: c_int = 29; ++pub const pseudo_AF_HDRCMPLT: c_int = 30; ++pub const AF_BLUETOOTH: c_int = 31; ++pub const AF_IEEE80211: c_int = 32; ++pub const AF_MPLS: c_int = 33; ++pub const AF_ROUTE: c_int = 34; ++pub const NET_RT_DUMP: c_int = 1; ++pub const NET_RT_FLAGS: c_int = 2; ++pub const NET_RT_OOOIFLIST: c_int = 3; ++pub const NET_RT_OOIFLIST: c_int = 4; ++pub const NET_RT_OIFLIST: c_int = 5; ++pub const NET_RT_IFLIST: c_int = 6; ++pub const NET_RT_MAXID: c_int = 7; ++ ++pub const PF_OROUTE: c_int = AF_OROUTE; ++pub const PF_ARP: c_int = AF_ARP; ++pub const PF_KEY: c_int = pseudo_AF_KEY; ++pub const PF_BLUETOOTH: c_int = AF_BLUETOOTH; ++pub const PF_MPLS: c_int = AF_MPLS; ++pub const PF_ROUTE: c_int = AF_ROUTE; ++ ++pub const MSG_NBIO: c_int = 0x1000; ++pub const MSG_WAITFORONE: c_int = 0x2000; ++pub const MSG_NOTIFICATION: c_int = 0x4000; ++ ++pub const SCM_TIMESTAMP: c_int = 0x08; ++pub const SCM_CREDS: c_int = 0x10; ++ ++pub const O_DSYNC: c_int = 0x10000; ++ ++pub const MAP_RENAME: c_int = 0x20; ++pub const MAP_NORESERVE: c_int = 0x40; ++pub const MAP_HASSEMAPHORE: c_int = 0x200; ++pub const MAP_TRYFIXED: c_int = 0x400; ++pub const MAP_WIRED: c_int = 0x800; ++pub const MAP_STACK: c_int = 0x2000; ++// map alignment aliases for MAP_ALIGNED ++pub const MAP_ALIGNMENT_SHIFT: c_int = 24; ++pub const MAP_ALIGNMENT_MASK: c_int = 0xff << MAP_ALIGNMENT_SHIFT; ++pub const MAP_ALIGNMENT_64KB: c_int = 16 << MAP_ALIGNMENT_SHIFT; ++pub const MAP_ALIGNMENT_16MB: c_int = 24 << MAP_ALIGNMENT_SHIFT; ++pub const MAP_ALIGNMENT_4GB: c_int = 32 << MAP_ALIGNMENT_SHIFT; ++pub const MAP_ALIGNMENT_1TB: c_int = 40 << MAP_ALIGNMENT_SHIFT; ++pub const MAP_ALIGNMENT_256TB: c_int = 48 << MAP_ALIGNMENT_SHIFT; ++pub const MAP_ALIGNMENT_64PB: c_int = 56 << MAP_ALIGNMENT_SHIFT; ++// mremap flag ++pub const MAP_REMAPDUP: c_int = 0x004; ++ ++pub const DCCP_TYPE_REQUEST: c_int = 0; ++pub const DCCP_TYPE_RESPONSE: c_int = 1; ++pub const DCCP_TYPE_DATA: c_int = 2; ++pub const DCCP_TYPE_ACK: c_int = 3; ++pub const DCCP_TYPE_DATAACK: c_int = 4; ++pub const DCCP_TYPE_CLOSEREQ: c_int = 5; ++pub const DCCP_TYPE_CLOSE: c_int = 6; ++pub const DCCP_TYPE_RESET: c_int = 7; ++pub const DCCP_TYPE_MOVE: c_int = 8; ++ ++pub const DCCP_FEATURE_CC: c_int = 1; ++pub const DCCP_FEATURE_ECN: c_int = 2; ++pub const DCCP_FEATURE_ACKRATIO: c_int = 3; ++pub const DCCP_FEATURE_ACKVECTOR: c_int = 4; ++pub const DCCP_FEATURE_MOBILITY: c_int = 5; ++pub const DCCP_FEATURE_LOSSWINDOW: c_int = 6; ++pub const DCCP_FEATURE_CONN_NONCE: c_int = 8; ++pub const DCCP_FEATURE_IDENTREG: c_int = 7; ++ ++pub const DCCP_OPT_PADDING: c_int = 0; ++pub const DCCP_OPT_DATA_DISCARD: c_int = 1; ++pub const DCCP_OPT_SLOW_RECV: c_int = 2; ++pub const DCCP_OPT_BUF_CLOSED: c_int = 3; ++pub const DCCP_OPT_CHANGE_L: c_int = 32; ++pub const DCCP_OPT_CONFIRM_L: c_int = 33; ++pub const DCCP_OPT_CHANGE_R: c_int = 34; ++pub const DCCP_OPT_CONFIRM_R: c_int = 35; ++pub const DCCP_OPT_INIT_COOKIE: c_int = 36; ++pub const DCCP_OPT_NDP_COUNT: c_int = 37; ++pub const DCCP_OPT_ACK_VECTOR0: c_int = 38; ++pub const DCCP_OPT_ACK_VECTOR1: c_int = 39; ++pub const DCCP_OPT_RECV_BUF_DROPS: c_int = 40; ++pub const DCCP_OPT_TIMESTAMP: c_int = 41; ++pub const DCCP_OPT_TIMESTAMP_ECHO: c_int = 42; ++pub const DCCP_OPT_ELAPSEDTIME: c_int = 43; ++pub const DCCP_OPT_DATACHECKSUM: c_int = 44; ++ ++pub const DCCP_REASON_UNSPEC: c_int = 0; ++pub const DCCP_REASON_CLOSED: c_int = 1; ++pub const DCCP_REASON_INVALID: c_int = 2; ++pub const DCCP_REASON_OPTION_ERR: c_int = 3; ++pub const DCCP_REASON_FEA_ERR: c_int = 4; ++pub const DCCP_REASON_CONN_REF: c_int = 5; ++pub const DCCP_REASON_BAD_SNAME: c_int = 6; ++pub const DCCP_REASON_BAD_COOKIE: c_int = 7; ++pub const DCCP_REASON_INV_MOVE: c_int = 8; ++pub const DCCP_REASON_UNANSW_CH: c_int = 10; ++pub const DCCP_REASON_FRUITLESS_NEG: c_int = 11; ++ ++pub const DCCP_CCID: c_int = 1; ++pub const DCCP_CSLEN: c_int = 2; ++pub const DCCP_MAXSEG: c_int = 4; ++pub const DCCP_SERVICE: c_int = 8; ++ ++pub const DCCP_NDP_LIMIT: c_int = 16; ++pub const DCCP_SEQ_NUM_LIMIT: c_int = 16777216; ++pub const DCCP_MAX_OPTIONS: c_int = 32; ++pub const DCCP_MAX_PKTS: c_int = 100; ++ ++pub const _PC_LINK_MAX: c_int = 1; ++pub const _PC_MAX_CANON: c_int = 2; ++pub const _PC_MAX_INPUT: c_int = 3; ++pub const _PC_NAME_MAX: c_int = 4; ++pub const _PC_PATH_MAX: c_int = 5; ++pub const _PC_PIPE_BUF: c_int = 6; ++pub const _PC_CHOWN_RESTRICTED: c_int = 7; ++pub const _PC_NO_TRUNC: c_int = 8; ++pub const _PC_VDISABLE: c_int = 9; ++pub const _PC_SYNC_IO: c_int = 10; ++pub const _PC_FILESIZEBITS: c_int = 11; ++pub const _PC_SYMLINK_MAX: c_int = 12; ++pub const _PC_2_SYMLINKS: c_int = 13; ++pub const _PC_ACL_EXTENDED: c_int = 14; ++pub const _PC_MIN_HOLE_SIZE: c_int = 15; ++ ++pub const _SC_SYNCHRONIZED_IO: c_int = 31; ++pub const _SC_IOV_MAX: c_int = 32; ++pub const _SC_MAPPED_FILES: c_int = 33; ++pub const _SC_MEMLOCK: c_int = 34; ++pub const _SC_MEMLOCK_RANGE: c_int = 35; ++pub const _SC_MEMORY_PROTECTION: c_int = 36; ++pub const _SC_LOGIN_NAME_MAX: c_int = 37; ++pub const _SC_MONOTONIC_CLOCK: c_int = 38; ++pub const _SC_CLK_TCK: c_int = 39; ++pub const _SC_ATEXIT_MAX: c_int = 40; ++pub const _SC_THREADS: c_int = 41; ++pub const _SC_SEMAPHORES: c_int = 42; ++pub const _SC_BARRIERS: c_int = 43; ++pub const _SC_TIMERS: c_int = 44; ++pub const _SC_SPIN_LOCKS: c_int = 45; ++pub const _SC_READER_WRITER_LOCKS: c_int = 46; ++pub const _SC_GETGR_R_SIZE_MAX: c_int = 47; ++pub const _SC_GETPW_R_SIZE_MAX: c_int = 48; ++pub const _SC_CLOCK_SELECTION: c_int = 49; ++pub const _SC_ASYNCHRONOUS_IO: c_int = 50; ++pub const _SC_AIO_LISTIO_MAX: c_int = 51; ++pub const _SC_AIO_MAX: c_int = 52; ++pub const _SC_MESSAGE_PASSING: c_int = 53; ++pub const _SC_MQ_OPEN_MAX: c_int = 54; ++pub const _SC_MQ_PRIO_MAX: c_int = 55; ++pub const _SC_PRIORITY_SCHEDULING: c_int = 56; ++pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: c_int = 57; ++pub const _SC_THREAD_KEYS_MAX: c_int = 58; ++pub const _SC_THREAD_STACK_MIN: c_int = 59; ++pub const _SC_THREAD_THREADS_MAX: c_int = 60; ++pub const _SC_THREAD_ATTR_STACKADDR: c_int = 61; ++pub const _SC_THREAD_ATTR_STACKSIZE: c_int = 62; ++pub const _SC_THREAD_PRIORITY_SCHEDULING: c_int = 63; ++pub const _SC_THREAD_PRIO_INHERIT: c_int = 64; ++pub const _SC_THREAD_PRIO_PROTECT: c_int = 65; ++pub const _SC_THREAD_PROCESS_SHARED: c_int = 66; ++pub const _SC_THREAD_SAFE_FUNCTIONS: c_int = 67; ++pub const _SC_TTY_NAME_MAX: c_int = 68; ++pub const _SC_HOST_NAME_MAX: c_int = 69; ++pub const _SC_PASS_MAX: c_int = 70; ++pub const _SC_REGEXP: c_int = 71; ++pub const _SC_SHELL: c_int = 72; ++pub const _SC_SYMLOOP_MAX: c_int = 73; ++pub const _SC_V6_ILP32_OFF32: c_int = 74; ++pub const _SC_V6_ILP32_OFFBIG: c_int = 75; ++pub const _SC_V6_LP64_OFF64: c_int = 76; ++pub const _SC_V6_LPBIG_OFFBIG: c_int = 77; ++pub const _SC_2_PBS: c_int = 80; ++pub const _SC_2_PBS_ACCOUNTING: c_int = 81; ++pub const _SC_2_PBS_CHECKPOINT: c_int = 82; ++pub const _SC_2_PBS_LOCATE: c_int = 83; ++pub const _SC_2_PBS_MESSAGE: c_int = 84; ++pub const _SC_2_PBS_TRACK: c_int = 85; ++pub const _SC_SPAWN: c_int = 86; ++pub const _SC_SHARED_MEMORY_OBJECTS: c_int = 87; ++pub const _SC_TIMER_MAX: c_int = 88; ++pub const _SC_SEM_NSEMS_MAX: c_int = 89; ++pub const _SC_CPUTIME: c_int = 90; ++pub const _SC_THREAD_CPUTIME: c_int = 91; ++pub const _SC_DELAYTIMER_MAX: c_int = 92; ++// These two variables will be supported in NetBSD 8.0 ++// pub const _SC_SIGQUEUE_MAX : c_int = 93; ++// pub const _SC_REALTIME_SIGNALS : c_int = 94; ++pub const _SC_PHYS_PAGES: c_int = 121; ++pub const _SC_NPROCESSORS_CONF: c_int = 1001; ++pub const _SC_NPROCESSORS_ONLN: c_int = 1002; ++pub const _SC_SCHED_RT_TS: c_int = 2001; ++pub const _SC_SCHED_PRI_MIN: c_int = 2002; ++pub const _SC_SCHED_PRI_MAX: c_int = 2003; ++ ++pub const FD_SETSIZE: usize = 0x100; ++ ++pub const ST_NOSUID: c_ulong = 8; ++ ++pub const BIOCGRSIG: c_ulong = 0x40044272; ++pub const BIOCSRSIG: c_ulong = 0x80044273; ++pub const BIOCSDLT: c_ulong = 0x80044278; ++pub const BIOCGSEESENT: c_ulong = 0x40044276; ++pub const BIOCSSEESENT: c_ulong = 0x80044277; ++ ++// ++pub const MNT_UNION: c_int = 0x00000020; ++pub const MNT_NOCOREDUMP: c_int = 0x00008000; ++pub const MNT_RELATIME: c_int = 0x00020000; ++pub const MNT_IGNORE: c_int = 0x00100000; ++pub const MNT_NFS4ACLS: c_int = 0x00200000; ++pub const MNT_DISCARD: c_int = 0x00800000; ++pub const MNT_EXTATTR: c_int = 0x01000000; ++pub const MNT_LOG: c_int = 0x02000000; ++pub const MNT_NOATIME: c_int = 0x04000000; ++pub const MNT_AUTOMOUNTED: c_int = 0x10000000; ++pub const MNT_SYMPERM: c_int = 0x20000000; ++pub const MNT_NODEVMTIME: c_int = 0x40000000; ++pub const MNT_SOFTDEP: c_int = 0x80000000; ++pub const MNT_POSIX1EACLS: c_int = 0x00000800; ++pub const MNT_ACLS: c_int = MNT_POSIX1EACLS; ++pub const MNT_WAIT: c_int = 1; ++pub const MNT_NOWAIT: c_int = 2; ++pub const MNT_LAZY: c_int = 3; ++ ++// ++pub const CLOCK_PROCESS_CPUTIME_ID: crate::clockid_t = 2; ++pub const CLOCK_THREAD_CPUTIME_ID: crate::clockid_t = 4; ++pub const NTP_API: c_int = 4; ++pub const MAXPHASE: c_long = 500000000; ++pub const MAXFREQ: c_long = 500000; ++pub const MINSEC: c_int = 256; ++pub const MAXSEC: c_int = 2048; ++pub const NANOSECOND: c_long = 1000000000; ++pub const SCALE_PPM: c_int = 65; ++pub const MAXTC: c_int = 10; ++pub const MOD_OFFSET: c_uint = 0x0001; ++pub const MOD_FREQUENCY: c_uint = 0x0002; ++pub const MOD_MAXERROR: c_uint = 0x0004; ++pub const MOD_ESTERROR: c_uint = 0x0008; ++pub const MOD_STATUS: c_uint = 0x0010; ++pub const MOD_TIMECONST: c_uint = 0x0020; ++pub const MOD_PPSMAX: c_uint = 0x0040; ++pub const MOD_TAI: c_uint = 0x0080; ++pub const MOD_MICRO: c_uint = 0x1000; ++pub const MOD_NANO: c_uint = 0x2000; ++pub const MOD_CLKB: c_uint = 0x4000; ++pub const MOD_CLKA: c_uint = 0x8000; ++pub const STA_PLL: c_int = 0x0001; ++pub const STA_PPSFREQ: c_int = 0x0002; ++pub const STA_PPSTIME: c_int = 0x0004; ++pub const STA_FLL: c_int = 0x0008; ++pub const STA_INS: c_int = 0x0010; ++pub const STA_DEL: c_int = 0x0020; ++pub const STA_UNSYNC: c_int = 0x0040; ++pub const STA_FREQHOLD: c_int = 0x0080; ++pub const STA_PPSSIGNAL: c_int = 0x0100; ++pub const STA_PPSJITTER: c_int = 0x0200; ++pub const STA_PPSWANDER: c_int = 0x0400; ++pub const STA_PPSERROR: c_int = 0x0800; ++pub const STA_CLOCKERR: c_int = 0x1000; ++pub const STA_NANO: c_int = 0x2000; ++pub const STA_MODE: c_int = 0x4000; ++pub const STA_CLK: c_int = 0x8000; ++pub const STA_RONLY: c_int = STA_PPSSIGNAL ++ | STA_PPSJITTER ++ | STA_PPSWANDER ++ | STA_PPSERROR ++ | STA_CLOCKERR ++ | STA_NANO ++ | STA_MODE ++ | STA_CLK; ++pub const TIME_OK: c_int = 0; ++pub const TIME_INS: c_int = 1; ++pub const TIME_DEL: c_int = 2; ++pub const TIME_OOP: c_int = 3; ++pub const TIME_WAIT: c_int = 4; ++pub const TIME_ERROR: c_int = 5; ++ ++pub const LITTLE_ENDIAN: c_int = 1234; ++pub const BIG_ENDIAN: c_int = 4321; ++ ++pub const PL_EVENT_NONE: c_int = 0; ++pub const PL_EVENT_SIGNAL: c_int = 1; ++pub const PL_EVENT_SUSPENDED: c_int = 2; ++ ++cfg_if! { ++ if #[cfg(any( ++ target_arch = "sparc", ++ target_arch = "sparc64", ++ target_arch = "x86", ++ target_arch = "x86_64" ++ ))] { ++ pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { ++ ptm_magic: 0x33330003, ++ ptm_errorcheck: 0, ++ ptm_pad1: [0; 3], ++ ptm_unused: 0, ++ ptm_pad2: [0; 3], ++ ptm_waiters: 0 as *mut _, ++ ptm_owner: 0, ++ ptm_recursed: 0, ++ ptm_spare2: 0 as *mut _, ++ }; ++ } else { ++ pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { ++ ptm_magic: 0x33330003, ++ ptm_errorcheck: 0, ++ ptm_unused: 0, ++ ptm_waiters: 0 as *mut _, ++ ptm_owner: 0, ++ ptm_recursed: 0, ++ ptm_spare2: 0 as *mut _, ++ }; ++ } ++} ++ ++pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { ++ ptc_magic: 0x55550005, ++ ptc_lock: 0, ++ ptc_waiters_first: 0 as *mut _, ++ ptc_waiters_last: 0 as *mut _, ++ ptc_mutex: 0 as *mut _, ++ ptc_private: 0 as *mut _, ++}; ++pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { ++ ptr_magic: 0x99990009, ++ ptr_interlock: 0, ++ ptr_rblocked_first: 0 as *mut _, ++ ptr_rblocked_last: 0 as *mut _, ++ ptr_wblocked_first: 0 as *mut _, ++ ptr_wblocked_last: 0 as *mut _, ++ ptr_nreaders: 0, ++ ptr_owner: 0, ++ ptr_private: 0 as *mut _, ++}; ++pub const PTHREAD_MUTEX_NORMAL: c_int = 0; ++pub const PTHREAD_MUTEX_ERRORCHECK: c_int = 1; ++pub const PTHREAD_MUTEX_RECURSIVE: c_int = 2; ++pub const PTHREAD_MUTEX_DEFAULT: c_int = PTHREAD_MUTEX_NORMAL; ++ ++pub const SCHED_NONE: c_int = -1; ++pub const SCHED_OTHER: c_int = 0; ++pub const SCHED_FIFO: c_int = 1; ++pub const SCHED_RR: c_int = 2; ++ ++pub const EVFILT_AIO: u32 = 2; ++pub const EVFILT_PROC: u32 = 4; ++pub const EVFILT_READ: u32 = 0; ++pub const EVFILT_SIGNAL: u32 = 5; ++pub const EVFILT_TIMER: u32 = 6; ++pub const EVFILT_VNODE: u32 = 3; ++pub const EVFILT_WRITE: u32 = 1; ++pub const EVFILT_FS: u32 = 7; ++pub const EVFILT_USER: u32 = 8; ++pub const EVFILT_EMPTY: u32 = 9; ++ ++pub const EV_ADD: u32 = 0x1; ++pub const EV_DELETE: u32 = 0x2; ++pub const EV_ENABLE: u32 = 0x4; ++pub const EV_DISABLE: u32 = 0x8; ++pub const EV_ONESHOT: u32 = 0x10; ++pub const EV_CLEAR: u32 = 0x20; ++pub const EV_RECEIPT: u32 = 0x40; ++pub const EV_DISPATCH: u32 = 0x80; ++pub const EV_FLAG1: u32 = 0x2000; ++pub const EV_ERROR: u32 = 0x4000; ++pub const EV_EOF: u32 = 0x8000; ++pub const EV_SYSFLAGS: u32 = 0xf000; ++ ++pub const NOTE_TRIGGER: u32 = 0x01000000; ++pub const NOTE_FFNOP: u32 = 0x00000000; ++pub const NOTE_FFAND: u32 = 0x40000000; ++pub const NOTE_FFOR: u32 = 0x80000000; ++pub const NOTE_FFCOPY: u32 = 0xc0000000; ++pub const NOTE_FFCTRLMASK: u32 = 0xc0000000; ++pub const NOTE_FFLAGSMASK: u32 = 0x00ffffff; ++pub const NOTE_LOWAT: u32 = 0x00000001; ++pub const NOTE_DELETE: u32 = 0x00000001; ++pub const NOTE_WRITE: u32 = 0x00000002; ++pub const NOTE_EXTEND: u32 = 0x00000004; ++pub const NOTE_ATTRIB: u32 = 0x00000008; ++pub const NOTE_LINK: u32 = 0x00000010; ++pub const NOTE_RENAME: u32 = 0x00000020; ++pub const NOTE_REVOKE: u32 = 0x00000040; ++pub const NOTE_EXIT: u32 = 0x80000000; ++pub const NOTE_FORK: u32 = 0x40000000; ++pub const NOTE_EXEC: u32 = 0x20000000; ++pub const NOTE_PDATAMASK: u32 = 0x000fffff; ++pub const NOTE_PCTRLMASK: u32 = 0xf0000000; ++pub const NOTE_TRACK: u32 = 0x00000001; ++pub const NOTE_TRACKERR: u32 = 0x00000002; ++pub const NOTE_CHILD: u32 = 0x00000004; ++pub const NOTE_MSECONDS: u32 = 0x00000000; ++pub const NOTE_SECONDS: u32 = 0x00000001; ++pub const NOTE_USECONDS: u32 = 0x00000002; ++pub const NOTE_NSECONDS: u32 = 0x00000003; ++pub const NOTE_ABSTIME: u32 = 0x000000010; ++ ++pub const TMP_MAX: c_uint = 308915776; ++ ++pub const AI_PASSIVE: c_int = 0x00000001; ++pub const AI_CANONNAME: c_int = 0x00000002; ++pub const AI_NUMERICHOST: c_int = 0x00000004; ++pub const AI_NUMERICSERV: c_int = 0x00000008; ++pub const AI_ADDRCONFIG: c_int = 0x00000400; ++pub const AI_SRV: c_int = 0x00000800; ++ ++pub const NI_MAXHOST: crate::socklen_t = 1025; ++pub const NI_MAXSERV: crate::socklen_t = 32; ++ ++pub const NI_NOFQDN: c_int = 0x00000001; ++pub const NI_NUMERICHOST: c_int = 0x000000002; ++pub const NI_NAMEREQD: c_int = 0x000000004; ++pub const NI_NUMERICSERV: c_int = 0x000000008; ++pub const NI_DGRAM: c_int = 0x00000010; ++pub const NI_WITHSCOPEID: c_int = 0x00000020; ++pub const NI_NUMERICSCOPE: c_int = 0x00000040; ++ ++pub const RTLD_NOLOAD: c_int = 0x2000; ++pub const RTLD_LOCAL: c_int = 0x200; ++ ++pub const CTL_MAXNAME: c_int = 12; ++pub const SYSCTL_NAMELEN: c_int = 32; ++pub const SYSCTL_DEFSIZE: c_int = 8; ++pub const CTLTYPE_NODE: c_int = 1; ++pub const CTLTYPE_INT: c_int = 2; ++pub const CTLTYPE_STRING: c_int = 3; ++pub const CTLTYPE_QUAD: c_int = 4; ++pub const CTLTYPE_STRUCT: c_int = 5; ++pub const CTLTYPE_BOOL: c_int = 6; ++pub const CTLFLAG_READONLY: c_int = 0x00000000; ++pub const CTLFLAG_READWRITE: c_int = 0x00000070; ++pub const CTLFLAG_ANYWRITE: c_int = 0x00000080; ++pub const CTLFLAG_PRIVATE: c_int = 0x00000100; ++pub const CTLFLAG_PERMANENT: c_int = 0x00000200; ++pub const CTLFLAG_OWNDATA: c_int = 0x00000400; ++pub const CTLFLAG_IMMEDIATE: c_int = 0x00000800; ++pub const CTLFLAG_HEX: c_int = 0x00001000; ++pub const CTLFLAG_ROOT: c_int = 0x00002000; ++pub const CTLFLAG_ANYNUMBER: c_int = 0x00004000; ++pub const CTLFLAG_HIDDEN: c_int = 0x00008000; ++pub const CTLFLAG_ALIAS: c_int = 0x00010000; ++pub const CTLFLAG_MMAP: c_int = 0x00020000; ++pub const CTLFLAG_OWNDESC: c_int = 0x00040000; ++pub const CTLFLAG_UNSIGNED: c_int = 0x00080000; ++pub const SYSCTL_VERS_MASK: c_int = 0xff000000; ++pub const SYSCTL_VERS_0: c_int = 0x00000000; ++pub const SYSCTL_VERS_1: c_int = 0x01000000; ++pub const SYSCTL_VERSION: c_int = SYSCTL_VERS_1; ++pub const CTL_EOL: c_int = -1; ++pub const CTL_QUERY: c_int = -2; ++pub const CTL_CREATE: c_int = -3; ++pub const CTL_CREATESYM: c_int = -4; ++pub const CTL_DESTROY: c_int = -5; ++pub const CTL_MMAP: c_int = -6; ++pub const CTL_DESCRIBE: c_int = -7; ++pub const CTL_UNSPEC: c_int = 0; ++pub const CTL_KERN: c_int = 1; ++pub const CTL_VM: c_int = 2; ++pub const CTL_VFS: c_int = 3; ++pub const CTL_NET: c_int = 4; ++pub const CTL_DEBUG: c_int = 5; ++pub const CTL_HW: c_int = 6; ++pub const CTL_MACHDEP: c_int = 7; ++pub const CTL_USER: c_int = 8; ++pub const CTL_DDB: c_int = 9; ++pub const CTL_PROC: c_int = 10; ++pub const CTL_VENDOR: c_int = 11; ++pub const CTL_EMUL: c_int = 12; ++pub const CTL_SECURITY: c_int = 13; ++pub const CTL_MAXID: c_int = 14; ++pub const KERN_OSTYPE: c_int = 1; ++pub const KERN_OSRELEASE: c_int = 2; ++pub const KERN_OSREV: c_int = 3; ++pub const KERN_VERSION: c_int = 4; ++pub const KERN_MAXVNODES: c_int = 5; ++pub const KERN_MAXPROC: c_int = 6; ++pub const KERN_MAXFILES: c_int = 7; ++pub const KERN_ARGMAX: c_int = 8; ++pub const KERN_SECURELVL: c_int = 9; ++pub const KERN_HOSTNAME: c_int = 10; ++pub const KERN_HOSTID: c_int = 11; ++pub const KERN_CLOCKRATE: c_int = 12; ++pub const KERN_VNODE: c_int = 13; ++pub const KERN_PROC: c_int = 14; ++pub const KERN_FILE: c_int = 15; ++pub const KERN_PROF: c_int = 16; ++pub const KERN_POSIX1: c_int = 17; ++pub const KERN_NGROUPS: c_int = 18; ++pub const KERN_JOB_CONTROL: c_int = 19; ++pub const KERN_SAVED_IDS: c_int = 20; ++pub const KERN_OBOOTTIME: c_int = 21; ++pub const KERN_DOMAINNAME: c_int = 22; ++pub const KERN_MAXPARTITIONS: c_int = 23; ++pub const KERN_RAWPARTITION: c_int = 24; ++pub const KERN_NTPTIME: c_int = 25; ++pub const KERN_TIMEX: c_int = 26; ++pub const KERN_AUTONICETIME: c_int = 27; ++pub const KERN_AUTONICEVAL: c_int = 28; ++pub const KERN_RTC_OFFSET: c_int = 29; ++pub const KERN_ROOT_DEVICE: c_int = 30; ++pub const KERN_MSGBUFSIZE: c_int = 31; ++pub const KERN_FSYNC: c_int = 32; ++pub const KERN_OLDSYSVMSG: c_int = 33; ++pub const KERN_OLDSYSVSEM: c_int = 34; ++pub const KERN_OLDSYSVSHM: c_int = 35; ++pub const KERN_OLDSHORTCORENAME: c_int = 36; ++pub const KERN_SYNCHRONIZED_IO: c_int = 37; ++pub const KERN_IOV_MAX: c_int = 38; ++pub const KERN_MBUF: c_int = 39; ++pub const KERN_MAPPED_FILES: c_int = 40; ++pub const KERN_MEMLOCK: c_int = 41; ++pub const KERN_MEMLOCK_RANGE: c_int = 42; ++pub const KERN_MEMORY_PROTECTION: c_int = 43; ++pub const KERN_LOGIN_NAME_MAX: c_int = 44; ++pub const KERN_DEFCORENAME: c_int = 45; ++pub const KERN_LOGSIGEXIT: c_int = 46; ++pub const KERN_PROC2: c_int = 47; ++pub const KERN_PROC_ARGS: c_int = 48; ++pub const KERN_FSCALE: c_int = 49; ++pub const KERN_CCPU: c_int = 50; ++pub const KERN_CP_TIME: c_int = 51; ++pub const KERN_OLDSYSVIPC_INFO: c_int = 52; ++pub const KERN_MSGBUF: c_int = 53; ++pub const KERN_CONSDEV: c_int = 54; ++pub const KERN_MAXPTYS: c_int = 55; ++pub const KERN_PIPE: c_int = 56; ++pub const KERN_MAXPHYS: c_int = 57; ++pub const KERN_SBMAX: c_int = 58; ++pub const KERN_TKSTAT: c_int = 59; ++pub const KERN_MONOTONIC_CLOCK: c_int = 60; ++pub const KERN_URND: c_int = 61; ++pub const KERN_LABELSECTOR: c_int = 62; ++pub const KERN_LABELOFFSET: c_int = 63; ++pub const KERN_LWP: c_int = 64; ++pub const KERN_FORKFSLEEP: c_int = 65; ++pub const KERN_POSIX_THREADS: c_int = 66; ++pub const KERN_POSIX_SEMAPHORES: c_int = 67; ++pub const KERN_POSIX_BARRIERS: c_int = 68; ++pub const KERN_POSIX_TIMERS: c_int = 69; ++pub const KERN_POSIX_SPIN_LOCKS: c_int = 70; ++pub const KERN_POSIX_READER_WRITER_LOCKS: c_int = 71; ++pub const KERN_DUMP_ON_PANIC: c_int = 72; ++pub const KERN_SOMAXKVA: c_int = 73; ++pub const KERN_ROOT_PARTITION: c_int = 74; ++pub const KERN_DRIVERS: c_int = 75; ++pub const KERN_BUF: c_int = 76; ++pub const KERN_FILE2: c_int = 77; ++pub const KERN_VERIEXEC: c_int = 78; ++pub const KERN_CP_ID: c_int = 79; ++pub const KERN_HARDCLOCK_TICKS: c_int = 80; ++pub const KERN_ARND: c_int = 81; ++pub const KERN_SYSVIPC: c_int = 82; ++pub const KERN_BOOTTIME: c_int = 83; ++pub const KERN_EVCNT: c_int = 84; ++pub const KERN_MAXID: c_int = 85; ++pub const KERN_PROC_ALL: c_int = 0; ++pub const KERN_PROC_PID: c_int = 1; ++pub const KERN_PROC_PGRP: c_int = 2; ++pub const KERN_PROC_SESSION: c_int = 3; ++pub const KERN_PROC_TTY: c_int = 4; ++pub const KERN_PROC_UID: c_int = 5; ++pub const KERN_PROC_RUID: c_int = 6; ++pub const KERN_PROC_GID: c_int = 7; ++pub const KERN_PROC_RGID: c_int = 8; ++pub const KERN_PROC_ARGV: c_int = 1; ++pub const KERN_PROC_NARGV: c_int = 2; ++pub const KERN_PROC_ENV: c_int = 3; ++pub const KERN_PROC_NENV: c_int = 4; ++pub const KERN_PROC_PATHNAME: c_int = 5; ++pub const VM_PROC: c_int = 16; ++pub const VM_PROC_MAP: c_int = 1; ++ ++pub const EAI_AGAIN: c_int = 2; ++pub const EAI_BADFLAGS: c_int = 3; ++pub const EAI_FAIL: c_int = 4; ++pub const EAI_FAMILY: c_int = 5; ++pub const EAI_MEMORY: c_int = 6; ++pub const EAI_NODATA: c_int = 7; ++pub const EAI_NONAME: c_int = 8; ++pub const EAI_SERVICE: c_int = 9; ++pub const EAI_SOCKTYPE: c_int = 10; ++pub const EAI_SYSTEM: c_int = 11; ++pub const EAI_OVERFLOW: c_int = 14; ++ ++pub const AIO_CANCELED: c_int = 1; ++pub const AIO_NOTCANCELED: c_int = 2; ++pub const AIO_ALLDONE: c_int = 3; ++pub const LIO_NOP: c_int = 0; ++pub const LIO_WRITE: c_int = 1; ++pub const LIO_READ: c_int = 2; ++pub const LIO_WAIT: c_int = 1; ++pub const LIO_NOWAIT: c_int = 0; ++ ++pub const SIGEV_NONE: c_int = 0; ++pub const SIGEV_SIGNAL: c_int = 1; ++pub const SIGEV_THREAD: c_int = 2; ++ ++pub const WSTOPPED: c_int = 0x00000002; // same as WUNTRACED ++pub const WCONTINUED: c_int = 0x00000010; ++pub const WEXITED: c_int = 0x000000020; ++pub const WNOWAIT: c_int = 0x00010000; ++ ++pub const WALTSIG: c_int = 0x00000004; ++pub const WALLSIG: c_int = 0x00000008; ++pub const WTRAPPED: c_int = 0x00000040; ++pub const WNOZOMBIE: c_int = 0x00020000; ++ ++pub const P_ALL: idtype_t = 0; ++pub const P_PID: idtype_t = 1; ++pub const P_PGID: idtype_t = 4; ++ ++pub const UTIME_OMIT: c_long = 1073741822; ++pub const UTIME_NOW: c_long = 1073741823; ++ ++pub const B460800: crate::speed_t = 460800; ++pub const B921600: crate::speed_t = 921600; ++ ++pub const ONOCR: crate::tcflag_t = 0x20; ++pub const ONLRET: crate::tcflag_t = 0x40; ++pub const CDTRCTS: crate::tcflag_t = 0x00020000; ++pub const CHWFLOW: crate::tcflag_t = crate::MDMBUF | crate::CRTSCTS | crate::CDTRCTS; ++ ++// pub const _PATH_UTMPX: &[c_char; 14] = b"/var/run/utmpx"; ++// pub const _PATH_WTMPX: &[c_char; 14] = b"/var/log/wtmpx"; ++// pub const _PATH_LASTLOGX: &[c_char; 17] = b"/var/log/lastlogx"; ++// pub const _PATH_UTMP_UPDATE: &[c_char; 24] = b"/usr/libexec/utmp_update"; ++pub const UT_NAMESIZE: usize = 8; ++pub const UT_LINESIZE: usize = 8; ++pub const UT_HOSTSIZE: usize = 16; ++pub const _UTX_USERSIZE: usize = 32; ++pub const _UTX_LINESIZE: usize = 32; ++pub const _UTX_PADSIZE: usize = 40; ++pub const _UTX_IDSIZE: usize = 4; ++pub const _UTX_HOSTSIZE: usize = 256; ++pub const EMPTY: u16 = 0; ++pub const RUN_LVL: u16 = 1; ++pub const BOOT_TIME: u16 = 2; ++pub const OLD_TIME: u16 = 3; ++pub const NEW_TIME: u16 = 4; ++pub const INIT_PROCESS: u16 = 5; ++pub const LOGIN_PROCESS: u16 = 6; ++pub const USER_PROCESS: u16 = 7; ++pub const DEAD_PROCESS: u16 = 8; ++pub const ACCOUNTING: u16 = 9; ++pub const SIGNATURE: u16 = 10; ++pub const DOWN_TIME: u16 = 11; ++ ++pub const SOCK_CLOEXEC: c_int = 0x10000000; ++pub const SOCK_NONBLOCK: c_int = 0x20000000; ++ ++// Uncomment on next NetBSD release ++// pub const FIOSEEKDATA: c_ulong = 0xc0086661; ++// pub const FIOSEEKHOLE: c_ulong = 0xc0086662; ++pub const OFIOGETBMAP: c_ulong = 0xc004667a; ++pub const FIOGETBMAP: c_ulong = 0xc008667a; ++pub const FIONWRITE: c_ulong = 0x40046679; ++pub const FIONSPACE: c_ulong = 0x40046678; ++pub const FIBMAP: c_ulong = 0xc008667a; ++ ++pub const SIGSTKSZ: size_t = 40960; ++ ++pub const REG_ENOSYS: c_int = 17; ++ ++pub const PT_DUMPCORE: c_int = 12; ++pub const PT_LWPINFO: c_int = 13; ++pub const PT_SYSCALL: c_int = 14; ++pub const PT_SYSCALLEMU: c_int = 15; ++pub const PT_SET_EVENT_MASK: c_int = 16; ++pub const PT_GET_EVENT_MASK: c_int = 17; ++pub const PT_GET_PROCESS_STATE: c_int = 18; ++pub const PT_SET_SIGINFO: c_int = 19; ++pub const PT_GET_SIGINFO: c_int = 20; ++pub const PT_RESUME: c_int = 21; ++pub const PT_SUSPEND: c_int = 23; ++pub const PT_STOP: c_int = 23; ++pub const PT_LWPSTATUS: c_int = 24; ++pub const PT_LWPNEXT: c_int = 25; ++pub const PT_SET_SIGPASS: c_int = 26; ++pub const PT_GET_SIGPASS: c_int = 27; ++pub const PT_FIRSTMACH: c_int = 32; ++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_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; ++pub const KVME_PROT_WRITE: c_int = 0x00000002; ++pub const KVME_PROT_EXEC: c_int = 0x00000004; ++ ++pub const KVME_FLAG_COW: c_int = 0x00000001; ++pub const KVME_FLAG_NEEDS_COPY: c_int = 0x00000002; ++pub const KVME_FLAG_NOCOREDUMP: c_int = 0x000000004; ++pub const KVME_FLAG_PAGEABLE: c_int = 0x000000008; ++pub const KVME_FLAG_GROWS_UP: c_int = 0x000000010; ++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; ++ ++// sys/xattr.h ++pub const XATTR_CREATE: c_int = 0x01; ++pub const XATTR_REPLACE: c_int = 0x02; ++// sys/extattr.h ++pub const EXTATTR_NAMESPACE_EMPTY: c_int = 0; ++ ++// For getrandom() ++pub const GRND_NONBLOCK: c_uint = 0x1; ++pub const GRND_RANDOM: c_uint = 0x2; ++pub const GRND_INSECURE: c_uint = 0x4; ++ ++// sys/reboot.h ++pub const RB_ASKNAME: c_int = 0x000000001; ++pub const RB_SINGLE: c_int = 0x000000002; ++pub const RB_NOSYNC: c_int = 0x000000004; ++pub const RB_HALT: c_int = 0x000000008; ++pub const RB_INITNAME: c_int = 0x000000010; ++pub const RB_KDB: c_int = 0x000000040; ++pub const RB_RDONLY: c_int = 0x000000080; ++pub const RB_DUMP: c_int = 0x000000100; ++pub const RB_MINIROOT: c_int = 0x000000200; ++pub const RB_STRING: c_int = 0x000000400; ++pub const RB_POWERDOWN: c_int = RB_HALT | 0x000000800; ++pub const RB_USERCONF: c_int = 0x000001000; ++ ++pub const fn MAP_ALIGNED(alignment: c_int) -> c_int { ++ alignment << MAP_ALIGNMENT_SHIFT ++} ++ ++// net/route.h ++pub const RTF_MASK: c_int = 0x80; ++pub const RTF_CONNECTED: c_int = 0x100; ++pub const RTF_ANNOUNCE: c_int = 0x20000; ++pub const RTF_SRC: c_int = 0x10000; ++pub const RTF_LOCAL: c_int = 0x40000; ++pub const RTF_BROADCAST: c_int = 0x80000; ++pub const RTF_UPDATING: c_int = 0x100000; ++pub const RTF_DONTCHANGEIFA: c_int = 0x200000; ++ ++pub const RTM_VERSION: c_int = 4; ++pub const RTM_LOCK: c_int = 0x8; ++pub const RTM_IFANNOUNCE: c_int = 0x10; ++pub const RTM_IEEE80211: c_int = 0x11; ++pub const RTM_SETGATE: c_int = 0x12; ++pub const RTM_LLINFO_UPD: c_int = 0x13; ++pub const RTM_IFINFO: c_int = 0x14; ++pub const RTM_OCHGADDR: c_int = 0x15; ++pub const RTM_NEWADDR: c_int = 0x16; ++pub const RTM_DELADDR: c_int = 0x17; ++pub const RTM_CHGADDR: c_int = 0x18; ++ ++pub const RTA_TAG: c_int = 0x100; ++ ++pub const RTAX_TAG: c_int = 8; ++pub const RTAX_MAX: c_int = 9; ++ ++const_fn! { ++ {const} fn _ALIGN(p: usize) -> usize { ++ (p + _ALIGNBYTES) & !_ALIGNBYTES ++ } ++} ++ ++f! { ++ pub fn CMSG_DATA(cmsg: *const cmsghdr) -> *mut c_uchar { ++ (cmsg as *mut c_uchar).offset(_ALIGN(mem::size_of::()) as isize) ++ } ++ ++ pub {const} fn CMSG_LEN(length: c_uint) -> c_uint { ++ _ALIGN(mem::size_of::()) as c_uint + length ++ } ++ ++ pub fn CMSG_NXTHDR(mhdr: *const crate::msghdr, cmsg: *const cmsghdr) -> *mut cmsghdr { ++ if cmsg.is_null() { ++ return crate::CMSG_FIRSTHDR(mhdr); ++ }; ++ let next = ++ cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize) + _ALIGN(mem::size_of::()); ++ let max = (*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize; ++ if next > max { ++ 0 as *mut cmsghdr ++ } else { ++ (cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize)) as *mut cmsghdr ++ } ++ } ++ ++ pub {const} fn CMSG_SPACE(length: c_uint) -> c_uint { ++ (_ALIGN(mem::size_of::()) + _ALIGN(length as usize)) as c_uint ++ } ++ ++ // dirfd() is a macro on netbsd to access ++ // the first field of the struct where dirp points to: ++ // http://cvsweb.netbsd.org/bsdweb.cgi/src/include/dirent.h?rev=1.36 ++ pub fn dirfd(dirp: *mut crate::DIR) -> c_int { ++ *(dirp as *const c_int) ++ } ++ ++ pub fn SOCKCREDSIZE(ngrps: usize) -> usize { ++ let ngrps = if ngrps > 0 { ngrps - 1 } else { 0 }; ++ mem::size_of::() + mem::size_of::() * ngrps ++ } ++ ++ pub fn PROT_MPROTECT(x: c_int) -> c_int { ++ x << 3 ++ } ++ ++ pub fn PROT_MPROTECT_EXTRACT(x: c_int) -> c_int { ++ (x >> 3) & 0x7 ++ } ++ ++ pub fn major(dev: crate::dev_t) -> c_int { ++ (((dev as u32) & 0x000fff00) >> 8) as c_int ++ } ++ ++ pub fn minor(dev: crate::dev_t) -> c_int { ++ let mut res = 0; ++ res |= ((dev as u32) & 0xfff00000) >> 12; ++ res |= (dev as u32) & 0x000000ff; ++ res as c_int ++ } ++} ++ ++safe_f! { ++ pub {const} fn WSTOPSIG(status: c_int) -> c_int { ++ status >> 8 ++ } ++ ++ pub {const} fn WIFSIGNALED(status: c_int) -> bool { ++ (status & 0o177) != 0o177 && (status & 0o177) != 0 ++ } ++ ++ pub {const} fn WIFSTOPPED(status: c_int) -> bool { ++ (status & 0o177) == 0o177 ++ } ++ ++ pub {const} fn WIFCONTINUED(status: c_int) -> bool { ++ status == 0xffff ++ } ++ ++ pub {const} fn makedev(major: c_uint, minor: c_uint) -> crate::dev_t { ++ let major = major as crate::dev_t; ++ let minor = minor as crate::dev_t; ++ let mut dev = 0; ++ dev |= (major << 8) & 0x000ff00; ++ dev |= (minor << 12) & 0xfff00000; ++ dev |= minor & 0xff; ++ dev ++ } ++} ++ ++extern "C" { ++ pub fn ntp_adjtime(buf: *mut timex) -> c_int; ++ pub fn ntp_gettime(buf: *mut ntptimeval) -> c_int; ++ pub fn clock_nanosleep( ++ clk_id: crate::clockid_t, ++ flags: c_int, ++ rqtp: *const crate::timespec, ++ rmtp: *mut crate::timespec, ++ ) -> c_int; ++ ++ pub fn reallocarr(ptr: *mut c_void, number: size_t, size: size_t) -> c_int; ++ ++ pub fn chflags(path: *const c_char, flags: c_ulong) -> c_int; ++ pub fn fchflags(fd: c_int, flags: c_ulong) -> c_int; ++ pub fn lchflags(path: *const c_char, flags: c_ulong) -> c_int; ++ ++ pub fn extattr_list_fd( ++ fd: c_int, ++ attrnamespace: c_int, ++ data: *mut c_void, ++ nbytes: size_t, ++ ) -> ssize_t; ++ pub fn extattr_list_file( ++ path: *const c_char, ++ attrnamespace: c_int, ++ data: *mut c_void, ++ nbytes: size_t, ++ ) -> ssize_t; ++ pub fn extattr_list_link( ++ path: *const c_char, ++ attrnamespace: c_int, ++ data: *mut c_void, ++ nbytes: size_t, ++ ) -> ssize_t; ++ pub fn extattr_delete_fd(fd: c_int, attrnamespace: c_int, attrname: *const c_char) -> c_int; ++ pub fn extattr_delete_file( ++ path: *const c_char, ++ attrnamespace: c_int, ++ attrname: *const c_char, ++ ) -> c_int; ++ pub fn extattr_delete_link( ++ path: *const c_char, ++ attrnamespace: c_int, ++ attrname: *const c_char, ++ ) -> c_int; ++ pub fn extattr_get_fd( ++ fd: c_int, ++ attrnamespace: c_int, ++ attrname: *const c_char, ++ data: *mut c_void, ++ nbytes: size_t, ++ ) -> ssize_t; ++ pub fn extattr_get_file( ++ path: *const c_char, ++ attrnamespace: c_int, ++ attrname: *const c_char, ++ data: *mut c_void, ++ nbytes: size_t, ++ ) -> ssize_t; ++ pub fn extattr_get_link( ++ path: *const c_char, ++ attrnamespace: c_int, ++ attrname: *const c_char, ++ data: *mut c_void, ++ nbytes: size_t, ++ ) -> ssize_t; ++ pub fn extattr_namespace_to_string(attrnamespace: c_int, string: *mut *mut c_char) -> c_int; ++ pub fn extattr_set_fd( ++ fd: c_int, ++ attrnamespace: c_int, ++ attrname: *const c_char, ++ data: *const c_void, ++ nbytes: size_t, ++ ) -> c_int; ++ pub fn extattr_set_file( ++ path: *const c_char, ++ attrnamespace: c_int, ++ attrname: *const c_char, ++ data: *const c_void, ++ nbytes: size_t, ++ ) -> c_int; ++ pub fn extattr_set_link( ++ path: *const c_char, ++ attrnamespace: c_int, ++ attrname: *const c_char, ++ data: *const c_void, ++ nbytes: size_t, ++ ) -> c_int; ++ pub fn extattr_string_to_namespace(string: *const c_char, attrnamespace: *mut c_int) -> c_int; ++ ++ pub fn openpty( ++ amaster: *mut c_int, ++ aslave: *mut c_int, ++ name: *mut c_char, ++ termp: *mut crate::termios, ++ winp: *mut crate::winsize, ++ ) -> c_int; ++ pub fn forkpty( ++ amaster: *mut c_int, ++ name: *mut c_char, ++ termp: *mut crate::termios, ++ winp: *mut crate::winsize, ++ ) -> crate::pid_t; ++ ++ #[link_name = "__lutimes50"] ++ pub fn lutimes(file: *const c_char, times: *const crate::timeval) -> c_int; ++ #[link_name = "__gettimeofday50"] ++ pub fn gettimeofday(tp: *mut crate::timeval, tz: *mut c_void) -> c_int; ++ pub fn getnameinfo( ++ sa: *const crate::sockaddr, ++ salen: crate::socklen_t, ++ host: *mut c_char, ++ hostlen: crate::socklen_t, ++ serv: *mut c_char, ++ servlen: crate::socklen_t, ++ flags: c_int, ++ ) -> c_int; ++ pub fn mprotect(addr: *mut c_void, len: size_t, prot: c_int) -> c_int; ++ pub fn sysctl( ++ name: *const c_int, ++ namelen: c_uint, ++ oldp: *mut c_void, ++ oldlenp: *mut size_t, ++ newp: *const c_void, ++ newlen: size_t, ++ ) -> c_int; ++ pub fn sysctlbyname( ++ name: *const c_char, ++ oldp: *mut c_void, ++ oldlenp: *mut size_t, ++ newp: *const c_void, ++ newlen: size_t, ++ ) -> c_int; ++ pub fn sysctlnametomib(sname: *const c_char, name: *mut c_int, namelenp: *mut size_t) -> c_int; ++ #[link_name = "__kevent50"] ++ pub fn kevent( ++ kq: c_int, ++ changelist: *const crate::kevent, ++ nchanges: size_t, ++ eventlist: *mut crate::kevent, ++ nevents: size_t, ++ timeout: *const crate::timespec, ++ ) -> c_int; ++ #[link_name = "__mount50"] ++ pub fn mount( ++ src: *const c_char, ++ target: *const c_char, ++ flags: c_int, ++ data: *mut c_void, ++ size: size_t, ++ ) -> c_int; ++ pub fn mq_open(name: *const c_char, oflag: c_int, ...) -> crate::mqd_t; ++ pub fn mq_close(mqd: crate::mqd_t) -> c_int; ++ pub fn mq_getattr(mqd: crate::mqd_t, attr: *mut crate::mq_attr) -> c_int; ++ pub fn mq_notify(mqd: crate::mqd_t, notification: *const crate::sigevent) -> c_int; ++ pub fn mq_receive( ++ mqd: crate::mqd_t, ++ msg_ptr: *mut c_char, ++ msg_len: size_t, ++ msg_prio: *mut c_uint, ++ ) -> ssize_t; ++ pub fn mq_send( ++ mqd: crate::mqd_t, ++ msg_ptr: *const c_char, ++ msg_len: size_t, ++ msg_prio: c_uint, ++ ) -> c_int; ++ pub fn mq_setattr( ++ mqd: crate::mqd_t, ++ newattr: *const crate::mq_attr, ++ oldattr: *mut crate::mq_attr, ++ ) -> c_int; ++ #[link_name = "__mq_timedreceive50"] ++ pub fn mq_timedreceive( ++ mqd: crate::mqd_t, ++ msg_ptr: *mut c_char, ++ msg_len: size_t, ++ msg_prio: *mut c_uint, ++ abs_timeout: *const crate::timespec, ++ ) -> ssize_t; ++ #[link_name = "__mq_timedsend50"] ++ pub fn mq_timedsend( ++ mqd: crate::mqd_t, ++ msg_ptr: *const c_char, ++ msg_len: size_t, ++ msg_prio: c_uint, ++ abs_timeout: *const crate::timespec, ++ ) -> c_int; ++ pub fn mq_unlink(name: *const c_char) -> c_int; ++ pub fn ptrace(request: c_int, pid: crate::pid_t, addr: *mut c_void, data: c_int) -> c_int; ++ pub fn utrace(label: *const c_char, addr: *mut c_void, len: size_t) -> c_int; ++ pub fn pthread_getname_np(t: crate::pthread_t, name: *mut c_char, len: size_t) -> c_int; ++ pub fn pthread_setname_np( ++ t: crate::pthread_t, ++ name: *const c_char, ++ arg: *const c_void, ++ ) -> c_int; ++ pub fn pthread_attr_get_np(thread: crate::pthread_t, attr: *mut crate::pthread_attr_t) ++ -> c_int; ++ pub fn pthread_getattr_np(native: crate::pthread_t, attr: *mut crate::pthread_attr_t) -> c_int; ++ pub fn pthread_attr_getguardsize( ++ attr: *const crate::pthread_attr_t, ++ guardsize: *mut size_t, ++ ) -> c_int; ++ pub fn pthread_attr_setguardsize(attr: *mut crate::pthread_attr_t, guardsize: size_t) -> c_int; ++ pub fn pthread_attr_getstack( ++ attr: *const crate::pthread_attr_t, ++ stackaddr: *mut *mut c_void, ++ stacksize: *mut size_t, ++ ) -> c_int; ++ pub fn pthread_getaffinity_np( ++ thread: crate::pthread_t, ++ size: size_t, ++ set: *mut cpuset_t, ++ ) -> c_int; ++ pub fn pthread_setaffinity_np( ++ thread: crate::pthread_t, ++ size: size_t, ++ set: *mut cpuset_t, ++ ) -> c_int; ++ ++ pub fn _cpuset_create() -> *mut cpuset_t; ++ pub fn _cpuset_destroy(set: *mut cpuset_t); ++ pub fn _cpuset_clr(cpu: cpuid_t, set: *mut cpuset_t) -> c_int; ++ pub fn _cpuset_set(cpu: cpuid_t, set: *mut cpuset_t) -> c_int; ++ pub fn _cpuset_isset(cpu: cpuid_t, set: *const cpuset_t) -> c_int; ++ pub fn _cpuset_size(set: *const cpuset_t) -> size_t; ++ pub fn _cpuset_zero(set: *mut cpuset_t); ++ #[link_name = "__sigtimedwait50"] ++ pub fn sigtimedwait( ++ set: *const sigset_t, ++ info: *mut siginfo_t, ++ timeout: *const crate::timespec, ++ ) -> c_int; ++ pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> c_int; ++ ++ pub fn duplocale(base: crate::locale_t) -> crate::locale_t; ++ pub fn freelocale(loc: crate::locale_t); ++ pub fn localeconv_l(loc: crate::locale_t) -> *mut lconv; ++ pub fn newlocale(mask: c_int, locale: *const c_char, base: crate::locale_t) -> crate::locale_t; ++ #[link_name = "__settimeofday50"] ++ pub fn settimeofday(tv: *const crate::timeval, tz: *const c_void) -> c_int; ++ ++ pub fn dup3(src: c_int, dst: c_int, flags: c_int) -> c_int; ++ ++ pub fn kqueue1(flags: c_int) -> c_int; ++ ++ pub fn _lwp_self() -> lwpid_t; ++ pub fn memmem( ++ haystack: *const c_void, ++ haystacklen: size_t, ++ needle: *const c_void, ++ needlelen: size_t, ++ ) -> *mut c_void; ++ ++ // link.h ++ ++ pub fn dl_iterate_phdr( ++ callback: Option< ++ unsafe extern "C" fn(info: *mut dl_phdr_info, size: usize, data: *mut c_void) -> c_int, ++ >, ++ data: *mut c_void, ++ ) -> c_int; ++ ++ // dlfcn.h ++ ++ pub fn _dlauxinfo() -> *mut c_void; ++ ++ pub fn iconv_open(tocode: *const c_char, fromcode: *const c_char) -> iconv_t; ++ pub fn iconv( ++ cd: iconv_t, ++ inbuf: *mut *mut c_char, ++ inbytesleft: *mut size_t, ++ outbuf: *mut *mut c_char, ++ outbytesleft: *mut size_t, ++ ) -> size_t; ++ pub fn iconv_close(cd: iconv_t) -> c_int; ++ ++ pub fn timer_create( ++ clockid: crate::clockid_t, ++ sevp: *mut crate::sigevent, ++ timerid: *mut crate::timer_t, ++ ) -> c_int; ++ pub fn timer_delete(timerid: crate::timer_t) -> c_int; ++ pub fn timer_getoverrun(timerid: crate::timer_t) -> c_int; ++ pub fn timer_gettime(timerid: crate::timer_t, curr_value: *mut crate::itimerspec) -> c_int; ++ pub fn timer_settime( ++ timerid: crate::timer_t, ++ flags: c_int, ++ new_value: *const crate::itimerspec, ++ old_value: *mut crate::itimerspec, ++ ) -> c_int; ++ ++ // Added in `NetBSD` 7.0 ++ pub fn explicit_memset(b: *mut c_void, c: c_int, len: size_t); ++ pub fn consttime_memequal(a: *const c_void, b: *const c_void, len: size_t) -> c_int; ++ ++ pub fn setproctitle(fmt: *const c_char, ...); ++ pub fn mremap( ++ oldp: *mut c_void, ++ oldsize: size_t, ++ newp: *mut c_void, ++ newsize: size_t, ++ flags: c_int, ++ ) -> *mut c_void; ++ ++ pub fn sched_rr_get_interval(pid: crate::pid_t, t: *mut crate::timespec) -> c_int; ++ pub fn sched_setparam(pid: crate::pid_t, param: *const crate::sched_param) -> c_int; ++ pub fn sched_getparam(pid: crate::pid_t, param: *mut crate::sched_param) -> c_int; ++ pub fn sched_getscheduler(pid: crate::pid_t) -> c_int; ++ pub fn sched_setscheduler( ++ pid: crate::pid_t, ++ policy: c_int, ++ param: *const crate::sched_param, ++ ) -> c_int; ++ ++ #[link_name = "__pollts50"] ++ pub fn pollts( ++ fds: *mut crate::pollfd, ++ nfds: crate::nfds_t, ++ ts: *const crate::timespec, ++ sigmask: *const crate::sigset_t, ++ ) -> c_int; ++ pub fn ppoll( ++ fds: *mut crate::pollfd, ++ nfds: crate::nfds_t, ++ ts: *const crate::timespec, ++ sigmask: *const crate::sigset_t, ++ ) -> c_int; ++ pub fn getrandom(buf: *mut c_void, buflen: size_t, flags: c_uint) -> ssize_t; ++ ++ pub fn reboot(mode: c_int, bootstr: *mut c_char) -> c_int; ++ ++ #[link_name = "___lwp_park60"] ++ pub fn _lwp_park( ++ clock: crate::clockid_t, ++ flags: c_int, ++ ts: *const crate::timespec, ++ unpark: crate::lwpid_t, ++ hint: *const c_void, ++ unparkhint: *mut c_void, ++ ) -> c_int; ++ pub fn _lwp_unpark(lwp: crate::lwpid_t, hint: *const c_void) -> c_int; ++ pub fn _lwp_unpark_all( ++ targets: *const crate::lwpid_t, ++ ntargets: size_t, ++ hint: *const c_void, ++ ) -> c_int; ++ ++ pub fn getmntinfo(mntbufp: *mut *mut crate::statvfs, flags: c_int) -> c_int; ++ pub fn getvfsstat(buf: *mut statvfs, bufsize: size_t, flags: c_int) -> c_int; ++} ++ ++#[link(name = "rt")] ++extern "C" { ++ pub fn aio_read(aiocbp: *mut aiocb) -> c_int; ++ pub fn aio_write(aiocbp: *mut aiocb) -> c_int; ++ pub fn aio_fsync(op: c_int, aiocbp: *mut aiocb) -> c_int; ++ pub fn aio_error(aiocbp: *const aiocb) -> c_int; ++ pub fn aio_return(aiocbp: *mut aiocb) -> ssize_t; ++ #[link_name = "__aio_suspend50"] ++ pub fn aio_suspend( ++ aiocb_list: *const *const aiocb, ++ nitems: c_int, ++ timeout: *const crate::timespec, ++ ) -> c_int; ++ pub fn aio_cancel(fd: c_int, aiocbp: *mut aiocb) -> c_int; ++ pub fn lio_listio( ++ mode: c_int, ++ aiocb_list: *const *mut aiocb, ++ nitems: c_int, ++ sevp: *mut sigevent, ++ ) -> c_int; ++} ++ ++#[link(name = "util")] ++extern "C" { ++ #[cfg_attr(target_os = "netbsd", link_name = "__getpwent_r50")] ++ pub fn getpwent_r( ++ pwd: *mut crate::passwd, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut crate::passwd, ++ ) -> c_int; ++ pub fn getgrent_r( ++ grp: *mut crate::group, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut crate::group, ++ ) -> c_int; ++ ++ pub fn updwtmpx(file: *const c_char, ut: *const utmpx) -> c_int; ++ pub fn getlastlogx(fname: *const c_char, uid: crate::uid_t, ll: *mut lastlogx) ++ -> *mut lastlogx; ++ pub fn updlastlogx(fname: *const c_char, uid: crate::uid_t, ll: *mut lastlogx) -> c_int; ++ pub fn utmpxname(file: *const c_char) -> c_int; ++ pub fn getutxent() -> *mut utmpx; ++ pub fn getutxid(ut: *const utmpx) -> *mut utmpx; ++ pub fn getutxline(ut: *const utmpx) -> *mut utmpx; ++ pub fn pututxline(ut: *const utmpx) -> *mut utmpx; ++ pub fn setutxent(); ++ pub fn endutxent(); ++ ++ pub fn getutmp(ux: *const utmpx, u: *mut utmp); ++ pub fn getutmpx(u: *const utmp, ux: *mut utmpx); ++ ++ pub fn utpname(file: *const c_char) -> c_int; ++ pub fn setutent(); ++ pub fn endutent(); ++ pub fn getutent() -> *mut utmp; ++ ++ pub fn efopen(p: *const c_char, m: *const c_char) -> crate::FILE; ++ pub fn emalloc(n: size_t) -> *mut c_void; ++ pub fn ecalloc(n: size_t, c: size_t) -> *mut c_void; ++ pub fn erealloc(p: *mut c_void, n: size_t) -> *mut c_void; ++ pub fn ereallocarr(p: *mut c_void, n: size_t, s: size_t); ++ pub fn estrdup(s: *const c_char) -> *mut c_char; ++ pub fn estrndup(s: *const c_char, len: size_t) -> *mut c_char; ++ pub fn estrlcpy(dst: *mut c_char, src: *const c_char, len: size_t) -> size_t; ++ pub fn estrlcat(dst: *mut c_char, src: *const c_char, len: size_t) -> size_t; ++ pub fn estrtoi( ++ nptr: *const c_char, ++ base: c_int, ++ lo: crate::intmax_t, ++ hi: crate::intmax_t, ++ ) -> crate::intmax_t; ++ pub fn estrtou( ++ nptr: *const c_char, ++ base: c_int, ++ lo: crate::uintmax_t, ++ hi: crate::uintmax_t, ++ ) -> crate::uintmax_t; ++ pub fn easprintf(string: *mut *mut c_char, fmt: *const c_char, ...) -> c_int; ++ pub fn evasprintf(string: *mut *mut c_char, fmt: *const c_char, ...) -> c_int; ++ pub fn esetfunc( ++ cb: Option, ++ ) -> Option; ++ pub fn secure_path(path: *const c_char) -> c_int; ++ pub fn snprintb(buf: *mut c_char, buflen: size_t, fmt: *const c_char, val: u64) -> c_int; ++ pub fn snprintb_m( ++ buf: *mut c_char, ++ buflen: size_t, ++ fmt: *const c_char, ++ val: u64, ++ max: size_t, ++ ) -> c_int; ++ ++ pub fn getbootfile() -> *const c_char; ++ pub fn getbyteorder() -> c_int; ++ pub fn getdiskrawname(buf: *mut c_char, buflen: size_t, name: *const c_char) -> *const c_char; ++ pub fn getdiskcookedname( ++ buf: *mut c_char, ++ buflen: size_t, ++ name: *const c_char, ++ ) -> *const c_char; ++ pub fn getfsspecname(buf: *mut c_char, buflen: size_t, spec: *const c_char) -> *const c_char; ++ ++ pub fn strpct( ++ buf: *mut c_char, ++ bufsiz: size_t, ++ numerator: crate::uintmax_t, ++ denominator: crate::uintmax_t, ++ precision: size_t, ++ ) -> *mut c_char; ++ pub fn strspct( ++ buf: *mut c_char, ++ bufsiz: size_t, ++ numerator: crate::intmax_t, ++ denominator: crate::intmax_t, ++ precision: size_t, ++ ) -> *mut c_char; ++ #[link_name = "__login50"] ++ pub fn login(ut: *const utmp); ++ #[link_name = "__loginx50"] ++ pub fn loginx(ut: *const utmpx); ++ pub fn logout(line: *const c_char); ++ pub fn logoutx(line: *const c_char, status: c_int, tpe: c_int); ++ pub fn logwtmp(line: *const c_char, name: *const c_char, host: *const c_char); ++ pub fn logwtmpx( ++ line: *const c_char, ++ name: *const c_char, ++ host: *const c_char, ++ status: c_int, ++ tpe: c_int, ++ ); ++ ++ pub fn getxattr( ++ path: *const c_char, ++ name: *const c_char, ++ value: *mut c_void, ++ size: size_t, ++ ) -> ssize_t; ++ pub fn lgetxattr( ++ path: *const c_char, ++ name: *const c_char, ++ value: *mut c_void, ++ size: size_t, ++ ) -> ssize_t; ++ pub fn fgetxattr( ++ filedes: c_int, ++ name: *const c_char, ++ value: *mut c_void, ++ size: size_t, ++ ) -> ssize_t; ++ pub fn setxattr( ++ path: *const c_char, ++ name: *const c_char, ++ value: *const c_void, ++ size: size_t, ++ ) -> c_int; ++ pub fn lsetxattr( ++ path: *const c_char, ++ name: *const c_char, ++ value: *const c_void, ++ size: size_t, ++ ) -> c_int; ++ pub fn fsetxattr( ++ filedes: c_int, ++ name: *const c_char, ++ value: *const c_void, ++ size: size_t, ++ flags: c_int, ++ ) -> c_int; ++ pub fn listxattr(path: *const c_char, list: *mut c_char, size: size_t) -> ssize_t; ++ pub fn llistxattr(path: *const c_char, list: *mut c_char, size: size_t) -> ssize_t; ++ pub fn flistxattr(filedes: c_int, list: *mut c_char, size: size_t) -> ssize_t; ++ pub fn removexattr(path: *const c_char, name: *const c_char) -> c_int; ++ pub fn lremovexattr(path: *const c_char, name: *const c_char) -> c_int; ++ pub fn fremovexattr(fd: c_int, path: *const c_char, name: *const c_char) -> c_int; ++ ++ pub fn string_to_flags( ++ string_p: *mut *mut c_char, ++ setp: *mut c_ulong, ++ clrp: *mut c_ulong, ++ ) -> c_int; ++ pub fn flags_to_string(flags: c_ulong, def: *const c_char) -> c_int; ++ ++ pub fn kinfo_getvmmap(pid: crate::pid_t, cntp: *mut size_t) -> *mut kinfo_vmentry; ++} ++ ++#[link(name = "execinfo")] ++extern "C" { ++ pub fn backtrace(addrlist: *mut *mut c_void, len: size_t) -> size_t; ++ pub fn backtrace_symbols(addrlist: *const *mut c_void, len: size_t) -> *mut *mut c_char; ++ pub fn backtrace_symbols_fd(addrlist: *const *mut c_void, len: size_t, fd: c_int) -> c_int; ++ pub fn backtrace_symbols_fmt( ++ addrlist: *const *mut c_void, ++ len: size_t, ++ fmt: *const c_char, ++ ) -> *mut *mut c_char; ++ pub fn backtrace_symbols_fd_fmt( ++ addrlist: *const *mut c_void, ++ len: size_t, ++ fd: c_int, ++ fmt: *const c_char, ++ ) -> c_int; ++} ++ ++cfg_if! { ++ if #[cfg(target_arch = "aarch64")] { ++ mod aarch64; ++ pub use self::aarch64::*; ++ } else if #[cfg(target_arch = "arm")] { ++ mod arm; ++ pub use self::arm::*; ++ } else if #[cfg(target_arch = "powerpc")] { ++ mod powerpc; ++ pub use self::powerpc::*; ++ } else if #[cfg(target_arch = "sparc64")] { ++ mod sparc64; ++ pub use self::sparc64::*; ++ } else if #[cfg(target_arch = "x86_64")] { ++ mod x86_64; ++ pub use self::x86_64::*; ++ } else if #[cfg(target_arch = "x86")] { ++ mod x86; ++ pub use self::x86::*; ++ } else if #[cfg(target_arch = "mips")] { ++ mod mips; ++ pub use self::mips::*; ++ } else if #[cfg(target_arch = "riscv64")] { ++ mod riscv64; ++ pub use self::riscv64::*; ++ } else { ++ // Unknown target_arch ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/powerpc.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/powerpc.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/powerpc.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/powerpc.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,13 @@ ++use crate::prelude::*; ++use crate::PT_FIRSTMACH; ++ ++pub type c_long = i32; ++pub type c_ulong = u32; ++pub type c_char = u8; ++pub type __cpu_simple_lock_nv_t = c_int; ++ ++pub(crate) const _ALIGNBYTES: usize = mem::size_of::() - 1; ++ ++pub const PT_STEP: c_int = PT_FIRSTMACH + 0; ++pub const PT_GETREGS: c_int = PT_FIRSTMACH + 1; ++pub const PT_SETREGS: c_int = PT_FIRSTMACH + 2; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/riscv64.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/riscv64.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/riscv64.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/riscv64.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,80 @@ ++use PT_FIRSTMACH; ++ ++use crate::prelude::*; ++ ++pub type c_long = i64; ++pub type c_ulong = u64; ++pub type c_char = u8; ++pub type __greg_t = u64; ++pub type __cpu_simple_lock_nv_t = c_int; ++pub type __gregset = [__greg_t; _NGREG]; ++pub type __fregset = [__freg; _NFREG]; ++ ++s! { ++ pub struct mcontext_t { ++ pub __gregs: __gregset, ++ pub __fregs: __fpregset, ++ __spare: [crate::__greg_t; 7], ++ } ++} ++ ++s_no_extra_traits! { ++ pub union __fpreg { ++ pub u_u64: u64, ++ pub u_d: c_double, ++ } ++} ++ ++pub(crate) const _ALIGNBYTES: usize = mem::size_of::() - 1; ++ ++pub const PT_GETREGS: c_int = PT_FIRSTMACH + 0; ++pub const PT_SETREGS: c_int = PT_FIRSTMACH + 1; ++pub const PT_GETFPREGS: c_int = PT_FIRSTMACH + 2; ++pub const PT_SETFPREGS: c_int = PT_FIRSTMACH + 3; ++ ++pub const _NGREG: usize = 32; ++pub const _NFREG: usize = 33; ++ ++pub const _REG_X1: c_int = 0; ++pub const _REG_X2: c_int = 1; ++pub const _REG_X3: c_int = 2; ++pub const _REG_X4: c_int = 3; ++pub const _REG_X5: c_int = 4; ++pub const _REG_X6: c_int = 5; ++pub const _REG_X7: c_int = 6; ++pub const _REG_X8: c_int = 7; ++pub const _REG_X9: c_int = 8; ++pub const _REG_X10: c_int = 9; ++pub const _REG_X11: c_int = 10; ++pub const _REG_X12: c_int = 11; ++pub const _REG_X13: c_int = 12; ++pub const _REG_X14: c_int = 13; ++pub const _REG_X15: c_int = 14; ++pub const _REG_X16: c_int = 15; ++pub const _REG_X17: c_int = 16; ++pub const _REG_X18: c_int = 17; ++pub const _REG_X19: c_int = 18; ++pub const _REG_X20: c_int = 19; ++pub const _REG_X21: c_int = 20; ++pub const _REG_X22: c_int = 21; ++pub const _REG_X23: c_int = 22; ++pub const _REG_X24: c_int = 23; ++pub const _REG_X25: c_int = 24; ++pub const _REG_X26: c_int = 25; ++pub const _REG_X27: c_int = 26; ++pub const _REG_X28: c_int = 27; ++pub const _REG_X29: c_int = 28; ++pub const _REG_X30: c_int = 29; ++pub const _REG_X31: c_int = 30; ++pub const _REG_PC: c_int = 31; ++ ++pub const _REG_RA: c_int = _REG_X1; ++pub const _REG_SP: c_int = _REG_X2; ++pub const _REG_GP: c_int = _REG_X3; ++pub const _REG_TP: c_int = _REG_X4; ++pub const _REG_S0: c_int = _REG_X8; ++pub const _REG_RV: c_int = _REG_X10; ++pub const _REG_A0: c_int = _REG_X10; ++ ++pub const _REG_F0: c_int = 0; ++pub const _REG_FPCSR: c_int = 32; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/sparc64.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/sparc64.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/sparc64.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/sparc64.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,10 @@ ++use crate::prelude::*; ++ ++pub type c_long = i64; ++pub type c_ulong = u64; ++pub type c_char = i8; ++pub type __cpu_simple_lock_nv_t = c_uchar; ++ ++// should be pub(crate), but that requires Rust 1.18.0 ++#[doc(hidden)] ++pub const _ALIGNBYTES: usize = 0xf; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/x86_64.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/x86_64.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/x86_64.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/x86_64.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,59 @@ ++use crate::prelude::*; ++use crate::PT_FIRSTMACH; ++ ++pub type c_long = i64; ++pub type c_ulong = u64; ++pub type c_char = i8; ++pub type c___greg_t = u64; ++pub type __cpu_simple_lock_nv_t = c_uchar; ++ ++s! { ++ pub struct mcontext_t { ++ pub __gregs: [c___greg_t; 26], ++ pub _mc_tlsbase: c___greg_t, ++ pub __fpregs: [[c_char; 32]; 16], ++ } ++ ++ pub struct ucontext_t { ++ pub uc_flags: c_uint, ++ pub uc_link: *mut crate::ucontext_t, ++ pub uc_sigmask: crate::sigset_t, ++ pub uc_stack: crate::stack_t, ++ pub uc_mcontext: crate::mcontext_t, ++ } ++} ++ ++pub(crate) const _ALIGNBYTES: usize = mem::size_of::() - 1; ++ ++pub const PT_STEP: c_int = PT_FIRSTMACH + 0; ++pub const PT_GETREGS: c_int = PT_FIRSTMACH + 1; ++pub const PT_SETREGS: c_int = PT_FIRSTMACH + 2; ++pub const PT_GETFPREGS: c_int = PT_FIRSTMACH + 3; ++pub const PT_SETFPREGS: c_int = PT_FIRSTMACH + 4; ++ ++pub const _REG_RDI: c_int = 0; ++pub const _REG_RSI: c_int = 1; ++pub const _REG_RDX: c_int = 2; ++pub const _REG_RCX: c_int = 3; ++pub const _REG_R8: c_int = 4; ++pub const _REG_R9: c_int = 5; ++pub const _REG_R10: c_int = 6; ++pub const _REG_R11: c_int = 7; ++pub const _REG_R12: c_int = 8; ++pub const _REG_R13: c_int = 9; ++pub const _REG_R14: c_int = 10; ++pub const _REG_R15: c_int = 11; ++pub const _REG_RBP: c_int = 12; ++pub const _REG_RBX: c_int = 13; ++pub const _REG_RAX: c_int = 14; ++pub const _REG_GS: c_int = 15; ++pub const _REG_FS: c_int = 16; ++pub const _REG_ES: c_int = 17; ++pub const _REG_DS: c_int = 18; ++pub const _REG_TRAPNO: c_int = 19; ++pub const _REG_ERR: c_int = 20; ++pub const _REG_RIP: c_int = 21; ++pub const _REG_CS: c_int = 22; ++pub const _REG_RFLAGS: c_int = 23; ++pub const _REG_RSP: c_int = 24; ++pub const _REG_SS: c_int = 25; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/x86.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/x86.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/x86.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/netbsd/x86.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,8 @@ ++use crate::prelude::*; ++ ++pub type c_long = i32; ++pub type c_ulong = u32; ++pub type c_char = i8; ++pub type __cpu_simple_lock_nv_t = c_uchar; ++ ++pub(crate) const _ALIGNBYTES: usize = mem::size_of::() - 1; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/aarch64.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/aarch64.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/aarch64.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/aarch64.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,23 @@ ++use crate::prelude::*; ++ ++pub type c_long = i64; ++pub type c_ulong = u64; ++pub type c_char = u8; ++pub type ucontext_t = sigcontext; ++ ++s! { ++ pub struct sigcontext { ++ __sc_unused: c_int, ++ pub sc_mask: c_int, ++ pub sc_sp: c_ulong, ++ pub sc_lr: c_ulong, ++ pub sc_elr: c_ulong, ++ pub sc_spsr: c_ulong, ++ pub sc_x: [c_ulong; 30], ++ pub sc_cookie: c_long, ++ } ++} ++ ++pub(crate) const _ALIGNBYTES: usize = mem::size_of::() - 1; ++ ++pub const _MAX_PAGE_SHIFT: u32 = 12; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/arm.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/arm.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/arm.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/arm.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,9 @@ ++use crate::prelude::*; ++ ++pub type c_long = i32; ++pub type c_ulong = u32; ++pub type c_char = u8; ++ ++pub(crate) const _ALIGNBYTES: usize = mem::size_of::() - 1; ++ ++pub const _MAX_PAGE_SHIFT: u32 = 12; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/mips64.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/mips64.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/mips64.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/mips64.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,8 @@ ++pub type c_long = i64; ++pub type c_ulong = u64; ++pub type c_char = i8; ++ ++#[doc(hidden)] ++pub const _ALIGNBYTES: usize = 7; ++ ++pub const _MAX_PAGE_SHIFT: u32 = 14; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,2209 @@ ++use crate::prelude::*; ++use crate::unix::bsd::O_SYNC; ++use crate::{cmsghdr, off_t}; ++ ++pub type clock_t = i64; ++pub type suseconds_t = c_long; ++pub type dev_t = i32; ++pub type sigset_t = c_uint; ++pub type blksize_t = i32; ++pub type fsblkcnt_t = u64; ++pub type fsfilcnt_t = u64; ++pub type idtype_t = c_uint; ++pub type pthread_attr_t = *mut c_void; ++pub type pthread_mutex_t = *mut c_void; ++pub type pthread_mutexattr_t = *mut c_void; ++pub type pthread_cond_t = *mut c_void; ++pub type pthread_condattr_t = *mut c_void; ++pub type pthread_rwlock_t = *mut c_void; ++pub type pthread_rwlockattr_t = *mut c_void; ++pub type pthread_spinlock_t = crate::uintptr_t; ++pub type caddr_t = *mut c_char; ++ ++// elf.h ++ ++pub type Elf32_Addr = u32; ++pub type Elf32_Half = u16; ++pub type Elf32_Lword = u64; ++pub type Elf32_Off = u32; ++pub type Elf32_Sword = i32; ++pub type Elf32_Word = u32; ++ ++pub type Elf64_Addr = u64; ++pub type Elf64_Half = u16; ++pub type Elf64_Lword = u64; ++pub type Elf64_Off = u64; ++pub type Elf64_Sword = i32; ++pub type Elf64_Sxword = i64; ++pub type Elf64_Word = u32; ++pub type Elf64_Xword = u64; ++ ++// search.h ++ ++pub type ENTRY = entry; ++pub type ACTION = c_uint; ++ ++// spawn.h ++pub type posix_spawnattr_t = *mut c_void; ++pub type posix_spawn_file_actions_t = *mut c_void; ++ ++cfg_if! { ++ if #[cfg(target_pointer_width = "64")] { ++ type Elf_Addr = Elf64_Addr; ++ type Elf_Half = Elf64_Half; ++ type Elf_Phdr = Elf64_Phdr; ++ } else if #[cfg(target_pointer_width = "32")] { ++ type Elf_Addr = Elf32_Addr; ++ type Elf_Half = Elf32_Half; ++ type Elf_Phdr = Elf32_Phdr; ++ } ++} ++ ++s! { ++ pub struct ip_mreqn { ++ pub imr_multiaddr: in_addr, ++ pub imr_address: in_addr, ++ pub imr_ifindex: c_int, ++ } ++ ++ pub struct glob_t { ++ pub gl_pathc: size_t, ++ pub gl_matchc: size_t, ++ pub gl_offs: size_t, ++ pub gl_flags: c_int, ++ pub gl_pathv: *mut *mut c_char, ++ __unused1: *mut c_void, ++ __unused2: *mut c_void, ++ __unused3: *mut c_void, ++ __unused4: *mut c_void, ++ __unused5: *mut c_void, ++ __unused6: *mut c_void, ++ __unused7: *mut c_void, ++ } ++ ++ pub struct lconv { ++ pub decimal_point: *mut c_char, ++ pub thousands_sep: *mut c_char, ++ pub grouping: *mut c_char, ++ pub int_curr_symbol: *mut c_char, ++ pub currency_symbol: *mut c_char, ++ pub mon_decimal_point: *mut c_char, ++ pub mon_thousands_sep: *mut c_char, ++ pub mon_grouping: *mut c_char, ++ pub positive_sign: *mut c_char, ++ pub negative_sign: *mut c_char, ++ pub int_frac_digits: c_char, ++ pub frac_digits: c_char, ++ pub p_cs_precedes: c_char, ++ pub p_sep_by_space: c_char, ++ pub n_cs_precedes: c_char, ++ pub n_sep_by_space: c_char, ++ pub p_sign_posn: c_char, ++ pub n_sign_posn: c_char, ++ pub int_p_cs_precedes: c_char, ++ pub int_p_sep_by_space: c_char, ++ pub int_n_cs_precedes: c_char, ++ pub int_n_sep_by_space: c_char, ++ pub int_p_sign_posn: c_char, ++ pub int_n_sign_posn: c_char, ++ } ++ ++ pub struct ufs_args { ++ pub fspec: *mut c_char, ++ pub export_info: export_args, ++ } ++ ++ pub struct mfs_args { ++ pub fspec: *mut c_char, ++ pub export_info: export_args, ++ // https://github.com/openbsd/src/blob/HEAD/sys/sys/types.h#L134 ++ pub base: *mut c_char, ++ pub size: c_ulong, ++ } ++ ++ pub struct iso_args { ++ pub fspec: *mut c_char, ++ pub export_info: export_args, ++ pub flags: c_int, ++ pub sess: c_int, ++ } ++ ++ pub struct nfs_args { ++ pub version: c_int, ++ pub addr: *mut crate::sockaddr, ++ pub addrlen: c_int, ++ pub sotype: c_int, ++ pub proto: c_int, ++ pub fh: *mut c_uchar, ++ pub fhsize: c_int, ++ pub flags: c_int, ++ pub wsize: c_int, ++ pub rsize: c_int, ++ pub readdirsize: c_int, ++ pub timeo: c_int, ++ pub retrans: c_int, ++ pub maxgrouplist: c_int, ++ pub readahead: c_int, ++ pub leaseterm: c_int, ++ pub deadthresh: c_int, ++ pub hostname: *mut c_char, ++ pub acregmin: c_int, ++ pub acregmax: c_int, ++ pub acdirmin: c_int, ++ pub acdirmax: c_int, ++ } ++ ++ pub struct msdosfs_args { ++ pub fspec: *mut c_char, ++ pub export_info: export_args, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub mask: crate::mode_t, ++ pub flags: c_int, ++ } ++ ++ pub struct ntfs_args { ++ pub fspec: *mut c_char, ++ pub export_info: export_args, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub mode: crate::mode_t, ++ pub flag: c_ulong, ++ } ++ ++ pub struct udf_args { ++ pub fspec: *mut c_char, ++ pub lastblock: u32, ++ } ++ ++ pub struct tmpfs_args { ++ pub ta_version: c_int, ++ pub ta_nodes_max: crate::ino_t, ++ pub ta_size_max: off_t, ++ pub ta_root_uid: crate::uid_t, ++ pub ta_root_gid: crate::gid_t, ++ pub ta_root_mode: crate::mode_t, ++ } ++ ++ pub struct fusefs_args { ++ pub name: *mut c_char, ++ pub fd: c_int, ++ pub max_read: c_int, ++ pub allow_other: c_int, ++ } ++ ++ pub struct xucred { ++ pub cr_uid: crate::uid_t, ++ pub cr_gid: crate::gid_t, ++ pub cr_ngroups: c_short, ++ //https://github.com/openbsd/src/blob/HEAD/sys/sys/syslimits.h#L44 ++ pub cr_groups: [crate::gid_t; 16], ++ } ++ ++ pub struct export_args { ++ pub ex_flags: c_int, ++ pub ex_root: crate::uid_t, ++ pub ex_anon: xucred, ++ pub ex_addr: *mut crate::sockaddr, ++ pub ex_addrlen: c_int, ++ pub ex_mask: *mut crate::sockaddr, ++ pub ex_masklen: c_int, ++ } ++ ++ pub struct ip_mreq { ++ pub imr_multiaddr: in_addr, ++ pub imr_interface: in_addr, ++ } ++ ++ pub struct in_addr { ++ pub s_addr: crate::in_addr_t, ++ } ++ ++ pub struct sockaddr_in { ++ pub sin_len: u8, ++ pub sin_family: crate::sa_family_t, ++ pub sin_port: crate::in_port_t, ++ pub sin_addr: crate::in_addr, ++ pub sin_zero: [i8; 8], ++ } ++ ++ pub struct splice { ++ pub sp_fd: c_int, ++ pub sp_max: off_t, ++ pub sp_idle: crate::timeval, ++ } ++ ++ pub struct kevent { ++ pub ident: crate::uintptr_t, ++ pub filter: c_short, ++ pub flags: c_ushort, ++ pub fflags: c_uint, ++ pub data: i64, ++ pub udata: *mut c_void, ++ } ++ ++ pub struct stat { ++ pub st_mode: crate::mode_t, ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ pub st_size: off_t, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_blksize: crate::blksize_t, ++ pub st_flags: u32, ++ pub st_gen: u32, ++ pub st_birthtime: crate::time_t, ++ pub st_birthtime_nsec: c_long, ++ } ++ ++ pub struct statvfs { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_favail: crate::fsfilcnt_t, ++ pub f_fsid: c_ulong, ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ } ++ ++ pub struct addrinfo { ++ pub ai_flags: c_int, ++ pub ai_family: c_int, ++ pub ai_socktype: c_int, ++ pub ai_protocol: c_int, ++ pub ai_addrlen: crate::socklen_t, ++ pub ai_addr: *mut crate::sockaddr, ++ pub ai_canonname: *mut c_char, ++ pub ai_next: *mut crate::addrinfo, ++ } ++ ++ pub struct Dl_info { ++ pub dli_fname: *const c_char, ++ pub dli_fbase: *mut c_void, ++ pub dli_sname: *const c_char, ++ pub dli_saddr: *mut c_void, ++ } ++ ++ pub struct if_data { ++ pub ifi_type: c_uchar, ++ pub ifi_addrlen: c_uchar, ++ pub ifi_hdrlen: c_uchar, ++ pub ifi_link_state: c_uchar, ++ pub ifi_mtu: u32, ++ pub ifi_metric: u32, ++ pub ifi_rdomain: u32, ++ pub ifi_baudrate: u64, ++ pub ifi_ipackets: u64, ++ pub ifi_ierrors: u64, ++ pub ifi_opackets: u64, ++ pub ifi_oerrors: u64, ++ pub ifi_collisions: u64, ++ pub ifi_ibytes: u64, ++ pub ifi_obytes: u64, ++ pub ifi_imcasts: u64, ++ pub ifi_omcasts: u64, ++ pub ifi_iqdrops: u64, ++ pub ifi_oqdrops: u64, ++ pub ifi_noproto: u64, ++ pub ifi_capabilities: u32, ++ pub ifi_lastchange: crate::timeval, ++ } ++ ++ pub struct if_msghdr { ++ pub ifm_msglen: c_ushort, ++ pub ifm_version: c_uchar, ++ pub ifm_type: c_uchar, ++ pub ifm_hdrlen: c_ushort, ++ pub ifm_index: c_ushort, ++ pub ifm_tableid: c_ushort, ++ pub ifm_pad1: c_uchar, ++ pub ifm_pad2: c_uchar, ++ pub ifm_addrs: c_int, ++ pub ifm_flags: c_int, ++ pub ifm_xflags: c_int, ++ pub ifm_data: if_data, ++ } ++ ++ pub struct sockaddr_dl { ++ pub sdl_len: c_uchar, ++ pub sdl_family: c_uchar, ++ pub sdl_index: c_ushort, ++ pub sdl_type: c_uchar, ++ pub sdl_nlen: c_uchar, ++ pub sdl_alen: c_uchar, ++ pub sdl_slen: c_uchar, ++ pub sdl_data: [c_char; 24], ++ } ++ ++ pub struct sockpeercred { ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub pid: crate::pid_t, ++ } ++ ++ pub struct arphdr { ++ pub ar_hrd: u16, ++ pub ar_pro: u16, ++ pub ar_hln: u8, ++ pub ar_pln: u8, ++ pub ar_op: u16, ++ } ++ ++ pub struct shmid_ds { ++ pub shm_perm: crate::ipc_perm, ++ pub shm_segsz: c_int, ++ pub shm_lpid: crate::pid_t, ++ pub shm_cpid: crate::pid_t, ++ pub shm_nattch: c_short, ++ pub shm_atime: crate::time_t, ++ __shm_atimensec: c_long, ++ pub shm_dtime: crate::time_t, ++ __shm_dtimensec: c_long, ++ pub shm_ctime: crate::time_t, ++ __shm_ctimensec: c_long, ++ pub shm_internal: *mut c_void, ++ } ++ ++ // elf.h ++ pub struct Elf32_Phdr { ++ pub p_type: Elf32_Word, ++ pub p_offset: Elf32_Off, ++ pub p_vaddr: Elf32_Addr, ++ pub p_paddr: Elf32_Addr, ++ pub p_filesz: Elf32_Word, ++ pub p_memsz: Elf32_Word, ++ pub p_flags: Elf32_Word, ++ pub p_align: Elf32_Word, ++ } ++ ++ pub struct Elf64_Phdr { ++ pub p_type: Elf64_Word, ++ pub p_flags: Elf64_Word, ++ pub p_offset: Elf64_Off, ++ pub p_vaddr: Elf64_Addr, ++ pub p_paddr: Elf64_Addr, ++ pub p_filesz: Elf64_Xword, ++ pub p_memsz: Elf64_Xword, ++ pub p_align: Elf64_Xword, ++ } ++ ++ // link.h ++ ++ pub struct dl_phdr_info { ++ pub dlpi_addr: Elf_Addr, ++ pub dlpi_name: *const c_char, ++ pub dlpi_phdr: *const Elf_Phdr, ++ pub dlpi_phnum: Elf_Half, ++ } ++ ++ // sys/sysctl.h ++ pub struct kinfo_proc { ++ pub p_forw: u64, ++ pub p_back: u64, ++ pub p_paddr: u64, ++ pub p_addr: u64, ++ pub p_fd: 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: i32, ++ pub p_sigmask: u32, ++ pub p_sigignore: u32, ++ pub p_sigcatch: u32, ++ pub p_stat: i8, ++ pub p_priority: u8, ++ pub p_usrpri: u8, ++ pub p_nice: u8, ++ pub p_xstat: u16, ++ pub p_spare: 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: u64, ++ 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_psflags: u32, ++ pub p_acflag: u32, ++ pub p_svuid: u32, ++ pub p_svgid: u32, ++ pub p_emul: [c_char; KI_EMULNAMELEN as usize], ++ pub p_rlim_rss_cur: u64, ++ pub p_cpuid: u64, ++ pub p_vm_map_size: u64, ++ pub p_tid: i32, ++ pub p_rtableid: u32, ++ pub p_pledge: u64, ++ pub p_name: [c_char; KI_MAXCOMLEN as usize], ++ } ++ ++ pub struct kinfo_vmentry { ++ pub kve_start: c_ulong, ++ pub kve_end: c_ulong, ++ pub kve_guard: c_ulong, ++ pub kve_fspace: c_ulong, ++ pub kve_fspace_augment: c_ulong, ++ pub kve_offset: u64, ++ pub kve_wired_count: c_int, ++ pub kve_etype: c_int, ++ pub kve_protection: c_int, ++ pub kve_max_protection: c_int, ++ pub kve_advice: c_int, ++ pub kve_inheritance: c_int, ++ pub kve_flags: u8, ++ } ++ ++ pub struct ptrace_state { ++ pub pe_report_event: c_int, ++ pub pe_other_pid: crate::pid_t, ++ pub pe_tid: crate::pid_t, ++ } ++ ++ pub struct ptrace_thread_state { ++ pub pts_tid: crate::pid_t, ++ } ++ ++ // search.h ++ pub struct entry { ++ pub key: *mut c_char, ++ pub data: *mut c_void, ++ } ++ ++ pub struct ifreq { ++ pub ifr_name: [c_char; crate::IFNAMSIZ], ++ pub ifr_ifru: __c_anonymous_ifr_ifru, ++ } ++ ++ pub struct tcp_info { ++ pub tcpi_state: u8, ++ pub __tcpi_ca_state: u8, ++ pub __tcpi_retransmits: u8, ++ pub __tcpi_probes: u8, ++ pub __tcpi_backoff: u8, ++ pub tcpi_options: u8, ++ pub tcpi_snd_wscale: u8, ++ pub tcpi_rcv_wscale: u8, ++ pub tcpi_rto: u32, ++ pub __tcpi_ato: u32, ++ pub tcpi_snd_mss: u32, ++ pub tcpi_rcv_mss: u32, ++ pub __tcpi_unacked: u32, ++ pub __tcpi_sacked: u32, ++ pub __tcpi_lost: u32, ++ pub __tcpi_retrans: u32, ++ pub __tcpi_fackets: u32, ++ pub tcpi_last_data_sent: u32, ++ pub tcpi_last_ack_sent: u32, ++ pub tcpi_last_data_recv: u32, ++ pub tcpi_last_ack_recv: u32, ++ pub __tcpi_pmtu: u32, ++ pub __tcpi_rcv_ssthresh: u32, ++ pub tcpi_rtt: u32, ++ pub tcpi_rttvar: u32, ++ pub tcpi_snd_ssthresh: u32, ++ pub tcpi_snd_cwnd: u32, ++ pub __tcpi_advmss: u32, ++ pub __tcpi_reordering: u32, ++ pub __tcpi_rcv_rtt: u32, ++ pub tcpi_rcv_space: u32, ++ pub tcpi_snd_wnd: u32, ++ pub tcpi_snd_nxt: u32, ++ pub tcpi_rcv_nxt: u32, ++ pub tcpi_toe_tid: u32, ++ pub tcpi_snd_rexmitpack: u32, ++ pub tcpi_rcv_ooopack: u32, ++ pub tcpi_snd_zerowin: u32, ++ pub tcpi_rttmin: u32, ++ pub tcpi_max_sndwnd: u32, ++ pub tcpi_rcv_adv: u32, ++ pub tcpi_rcv_up: u32, ++ pub tcpi_snd_una: u32, ++ pub tcpi_snd_up: u32, ++ pub tcpi_snd_wl1: u32, ++ pub tcpi_snd_wl2: u32, ++ pub tcpi_snd_max: u32, ++ pub tcpi_ts_recent: u32, ++ pub tcpi_ts_recent_age: u32, ++ pub tcpi_rfbuf_cnt: u32, ++ pub tcpi_rfbuf_ts: u32, ++ pub tcpi_so_rcv_sb_cc: u32, ++ pub tcpi_so_rcv_sb_hiwat: u32, ++ pub tcpi_so_rcv_sb_lowat: u32, ++ pub tcpi_so_rcv_sb_wat: u32, ++ pub tcpi_so_snd_sb_cc: u32, ++ pub tcpi_so_snd_sb_hiwat: u32, ++ pub tcpi_so_snd_sb_lowat: u32, ++ pub tcpi_so_snd_sb_wat: u32, ++ } ++} ++ ++impl siginfo_t { ++ pub unsafe fn si_addr(&self) -> *mut c_char { ++ self.si_addr ++ } ++ ++ pub unsafe fn si_code(&self) -> c_int { ++ self.si_code ++ } ++ ++ pub unsafe fn si_errno(&self) -> c_int { ++ self.si_errno ++ } ++ ++ pub unsafe fn si_pid(&self) -> crate::pid_t { ++ #[repr(C)] ++ struct siginfo_timer { ++ _si_signo: c_int, ++ _si_code: c_int, ++ _si_errno: c_int, ++ _pad: [c_int; SI_PAD], ++ _pid: crate::pid_t, ++ } ++ (*(self as *const siginfo_t as *const siginfo_timer))._pid ++ } ++ ++ pub unsafe fn si_uid(&self) -> crate::uid_t { ++ #[repr(C)] ++ struct siginfo_timer { ++ _si_signo: c_int, ++ _si_code: c_int, ++ _si_errno: c_int, ++ _pad: [c_int; SI_PAD], ++ _pid: crate::pid_t, ++ _uid: crate::uid_t, ++ } ++ (*(self as *const siginfo_t as *const siginfo_timer))._uid ++ } ++ ++ pub unsafe fn si_value(&self) -> crate::sigval { ++ #[repr(C)] ++ struct siginfo_timer { ++ _si_signo: c_int, ++ _si_code: c_int, ++ _si_errno: c_int, ++ _pad: [c_int; SI_PAD], ++ _pid: crate::pid_t, ++ _uid: crate::uid_t, ++ value: crate::sigval, ++ } ++ (*(self as *const siginfo_t as *const siginfo_timer)).value ++ } ++} ++ ++s_no_extra_traits! { ++ pub struct dirent { ++ pub d_fileno: crate::ino_t, ++ pub d_off: off_t, ++ pub d_reclen: u16, ++ pub d_type: u8, ++ pub d_namlen: u8, ++ __d_padding: [u8; 4], ++ pub d_name: [c_char; 256], ++ } ++ ++ pub struct sockaddr_storage { ++ pub ss_len: u8, ++ pub ss_family: crate::sa_family_t, ++ __ss_pad1: [u8; 6], ++ __ss_pad2: i64, ++ __ss_pad3: [u8; 240], ++ } ++ ++ pub struct siginfo_t { ++ pub si_signo: c_int, ++ pub si_code: c_int, ++ pub si_errno: c_int, ++ pub si_addr: *mut c_char, ++ #[cfg(target_pointer_width = "32")] ++ __pad: [u8; 112], ++ #[cfg(target_pointer_width = "64")] ++ __pad: [u8; 108], ++ } ++ ++ pub struct lastlog { ++ ll_time: crate::time_t, ++ ll_line: [c_char; UT_LINESIZE], ++ ll_host: [c_char; UT_HOSTSIZE], ++ } ++ ++ pub struct utmp { ++ pub ut_line: [c_char; UT_LINESIZE], ++ pub ut_name: [c_char; UT_NAMESIZE], ++ pub ut_host: [c_char; UT_HOSTSIZE], ++ pub ut_time: crate::time_t, ++ } ++ ++ pub union mount_info { ++ pub ufs_args: ufs_args, ++ pub mfs_args: mfs_args, ++ pub nfs_args: nfs_args, ++ pub iso_args: iso_args, ++ pub msdosfs_args: msdosfs_args, ++ pub ntfs_args: ntfs_args, ++ pub tmpfs_args: tmpfs_args, ++ align: [c_char; 160], ++ } ++ ++ pub union __c_anonymous_ifr_ifru { ++ pub ifru_addr: crate::sockaddr, ++ pub ifru_dstaddr: crate::sockaddr, ++ pub ifru_broadaddr: crate::sockaddr, ++ pub ifru_flags: c_short, ++ pub ifru_metric: c_int, ++ pub ifru_vnetid: i64, ++ pub ifru_media: u64, ++ pub ifru_data: crate::caddr_t, ++ pub ifru_index: c_uint, ++ } ++ ++ // This type uses the union mount_info: ++ pub struct statfs { ++ pub f_flags: u32, ++ pub f_bsize: u32, ++ pub f_iosize: u32, ++ pub f_blocks: u64, ++ pub f_bfree: u64, ++ pub f_bavail: i64, ++ pub f_files: u64, ++ pub f_ffree: u64, ++ pub f_favail: i64, ++ pub f_syncwrites: u64, ++ pub f_syncreads: u64, ++ pub f_asyncwrites: u64, ++ pub f_asyncreads: u64, ++ pub f_fsid: crate::fsid_t, ++ pub f_namemax: u32, ++ pub f_owner: crate::uid_t, ++ pub f_ctime: u64, ++ pub f_fstypename: [c_char; 16], ++ pub f_mntonname: [c_char; 90], ++ pub f_mntfromname: [c_char; 90], ++ pub f_mntfromspec: [c_char; 90], ++ pub mount_info: mount_info, ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for dirent { ++ fn eq(&self, other: &dirent) -> bool { ++ self.d_fileno == other.d_fileno ++ && self.d_off == other.d_off ++ && self.d_reclen == other.d_reclen ++ && self.d_type == other.d_type ++ && self.d_namlen == other.d_namlen ++ && self ++ .d_name ++ .iter() ++ .zip(other.d_name.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ ++ impl Eq for dirent {} ++ ++ impl fmt::Debug for dirent { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("dirent") ++ .field("d_fileno", &self.d_fileno) ++ .field("d_off", &self.d_off) ++ .field("d_reclen", &self.d_reclen) ++ .field("d_type", &self.d_type) ++ .field("d_namlen", &self.d_namlen) ++ // FIXME: .field("d_name", &self.d_name) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for dirent { ++ fn hash(&self, state: &mut H) { ++ self.d_fileno.hash(state); ++ self.d_off.hash(state); ++ self.d_reclen.hash(state); ++ self.d_type.hash(state); ++ self.d_namlen.hash(state); ++ self.d_name.hash(state); ++ } ++ } ++ ++ impl PartialEq for sockaddr_storage { ++ fn eq(&self, other: &sockaddr_storage) -> bool { ++ self.ss_len == other.ss_len && self.ss_family == other.ss_family ++ } ++ } ++ ++ impl Eq for sockaddr_storage {} ++ ++ impl fmt::Debug for sockaddr_storage { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sockaddr_storage") ++ .field("ss_len", &self.ss_len) ++ .field("ss_family", &self.ss_family) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for sockaddr_storage { ++ fn hash(&self, state: &mut H) { ++ self.ss_len.hash(state); ++ self.ss_family.hash(state); ++ } ++ } ++ ++ impl PartialEq for siginfo_t { ++ fn eq(&self, other: &siginfo_t) -> bool { ++ self.si_signo == other.si_signo ++ && self.si_code == other.si_code ++ && self.si_errno == other.si_errno ++ && self.si_addr == other.si_addr ++ } ++ } ++ ++ impl Eq for siginfo_t {} ++ ++ impl fmt::Debug for siginfo_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("siginfo_t") ++ .field("si_signo", &self.si_signo) ++ .field("si_code", &self.si_code) ++ .field("si_errno", &self.si_errno) ++ .field("si_addr", &self.si_addr) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for siginfo_t { ++ fn hash(&self, state: &mut H) { ++ self.si_signo.hash(state); ++ self.si_code.hash(state); ++ self.si_errno.hash(state); ++ self.si_addr.hash(state); ++ } ++ } ++ ++ impl PartialEq for lastlog { ++ fn eq(&self, other: &lastlog) -> bool { ++ self.ll_time == other.ll_time ++ && self ++ .ll_line ++ .iter() ++ .zip(other.ll_line.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .ll_host ++ .iter() ++ .zip(other.ll_host.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ ++ impl Eq for lastlog {} ++ ++ impl fmt::Debug for lastlog { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("lastlog") ++ .field("ll_time", &self.ll_time) ++ // FIXME: .field("ll_line", &self.ll_line) ++ // FIXME: .field("ll_host", &self.ll_host) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for lastlog { ++ fn hash(&self, state: &mut H) { ++ self.ll_time.hash(state); ++ self.ll_line.hash(state); ++ self.ll_host.hash(state); ++ } ++ } ++ ++ impl PartialEq for utmp { ++ fn eq(&self, other: &utmp) -> bool { ++ self.ut_time == other.ut_time ++ && self ++ .ut_line ++ .iter() ++ .zip(other.ut_line.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .ut_name ++ .iter() ++ .zip(other.ut_name.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .ut_host ++ .iter() ++ .zip(other.ut_host.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ ++ impl Eq for utmp {} ++ ++ impl fmt::Debug for utmp { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("utmp") ++ // FIXME: .field("ut_line", &self.ut_line) ++ // FIXME: .field("ut_name", &self.ut_name) ++ // FIXME: .field("ut_host", &self.ut_host) ++ .field("ut_time", &self.ut_time) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for utmp { ++ fn hash(&self, state: &mut H) { ++ self.ut_line.hash(state); ++ self.ut_name.hash(state); ++ self.ut_host.hash(state); ++ self.ut_time.hash(state); ++ } ++ } ++ ++ impl PartialEq for mount_info { ++ fn eq(&self, other: &mount_info) -> bool { ++ unsafe { ++ self.align ++ .iter() ++ .zip(other.align.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ } ++ ++ impl Eq for mount_info {} ++ ++ impl hash::Hash for mount_info { ++ fn hash(&self, state: &mut H) { ++ unsafe { self.align.hash(state) }; ++ } ++ } ++ ++ impl PartialEq for __c_anonymous_ifr_ifru { ++ fn eq(&self, other: &__c_anonymous_ifr_ifru) -> bool { ++ unsafe { ++ self.ifru_addr == other.ifru_addr ++ && self.ifru_dstaddr == other.ifru_dstaddr ++ && self.ifru_broadaddr == other.ifru_broadaddr ++ && self.ifru_flags == other.ifru_flags ++ && self.ifru_metric == other.ifru_metric ++ && self.ifru_vnetid == other.ifru_vnetid ++ && self.ifru_media == other.ifru_media ++ && self.ifru_data == other.ifru_data ++ && self.ifru_index == other.ifru_index ++ } ++ } ++ } ++ ++ impl Eq for __c_anonymous_ifr_ifru {} ++ ++ impl hash::Hash for __c_anonymous_ifr_ifru { ++ fn hash(&self, state: &mut H) { ++ unsafe { ++ self.ifru_addr.hash(state); ++ self.ifru_dstaddr.hash(state); ++ self.ifru_broadaddr.hash(state); ++ self.ifru_flags.hash(state); ++ self.ifru_metric.hash(state); ++ self.ifru_vnetid.hash(state); ++ self.ifru_media.hash(state); ++ self.ifru_data.hash(state); ++ self.ifru_index.hash(state); ++ } ++ } ++ } ++ ++ impl PartialEq for statfs { ++ fn eq(&self, other: &statfs) -> bool { ++ self.f_flags == other.f_flags ++ && self.f_bsize == other.f_bsize ++ && self.f_iosize == other.f_iosize ++ && self.f_blocks == other.f_blocks ++ && self.f_bfree == other.f_bfree ++ && self.f_bavail == other.f_bavail ++ && self.f_files == other.f_files ++ && self.f_ffree == other.f_ffree ++ && self.f_favail == other.f_favail ++ && self.f_syncwrites == other.f_syncwrites ++ && self.f_syncreads == other.f_syncreads ++ && self.f_asyncwrites == other.f_asyncwrites ++ && self.f_asyncreads == other.f_asyncreads ++ && self.f_fsid == other.f_fsid ++ && self.f_namemax == other.f_namemax ++ && self.f_owner == other.f_owner ++ && self.f_ctime == other.f_ctime ++ && self ++ .f_fstypename ++ .iter() ++ .zip(other.f_fstypename.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .f_mntonname ++ .iter() ++ .zip(other.f_mntonname.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .f_mntfromname ++ .iter() ++ .zip(other.f_mntfromname.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .f_mntfromspec ++ .iter() ++ .zip(other.f_mntfromspec.iter()) ++ .all(|(a, b)| a == b) ++ && self.mount_info == other.mount_info ++ } ++ } ++ ++ impl Eq for statfs {} ++ ++ impl fmt::Debug for statfs { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("statfs") ++ .field("f_flags", &self.f_flags) ++ .field("f_bsize", &self.f_bsize) ++ .field("f_iosize", &self.f_iosize) ++ .field("f_blocks", &self.f_blocks) ++ .field("f_bfree", &self.f_bfree) ++ .field("f_bavail", &self.f_bavail) ++ .field("f_files", &self.f_files) ++ .field("f_ffree", &self.f_ffree) ++ .field("f_favail", &self.f_favail) ++ .field("f_syncwrites", &self.f_syncwrites) ++ .field("f_syncreads", &self.f_syncreads) ++ .field("f_asyncwrites", &self.f_asyncwrites) ++ .field("f_asyncreads", &self.f_asyncreads) ++ .field("f_fsid", &self.f_fsid) ++ .field("f_namemax", &self.f_namemax) ++ .field("f_owner", &self.f_owner) ++ .field("f_ctime", &self.f_ctime) ++ // FIXME: .field("f_fstypename", &self.f_fstypename) ++ // FIXME: .field("f_mntonname", &self.f_mntonname) ++ // FIXME: .field("f_mntfromname", &self.f_mntfromname) ++ // FIXME: .field("f_mntfromspec", &self.f_mntfromspec) ++ .field("mount_info", &self.mount_info) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for statfs { ++ fn hash(&self, state: &mut H) { ++ self.f_flags.hash(state); ++ self.f_bsize.hash(state); ++ self.f_iosize.hash(state); ++ self.f_blocks.hash(state); ++ self.f_bfree.hash(state); ++ self.f_bavail.hash(state); ++ self.f_files.hash(state); ++ self.f_ffree.hash(state); ++ self.f_favail.hash(state); ++ self.f_syncwrites.hash(state); ++ self.f_syncreads.hash(state); ++ self.f_asyncwrites.hash(state); ++ self.f_asyncreads.hash(state); ++ self.f_fsid.hash(state); ++ self.f_namemax.hash(state); ++ self.f_owner.hash(state); ++ self.f_ctime.hash(state); ++ self.f_fstypename.hash(state); ++ self.f_mntonname.hash(state); ++ self.f_mntfromname.hash(state); ++ self.f_mntfromspec.hash(state); ++ self.mount_info.hash(state); ++ } ++ } ++ } ++} ++ ++pub const UT_NAMESIZE: usize = 32; ++pub const UT_LINESIZE: usize = 8; ++pub const UT_HOSTSIZE: usize = 256; ++ ++pub const O_CLOEXEC: c_int = 0x10000; ++pub const O_DIRECTORY: c_int = 0x20000; ++pub const O_RSYNC: c_int = O_SYNC; ++ ++pub const MS_SYNC: c_int = 0x0002; ++pub const MS_INVALIDATE: c_int = 0x0004; ++ ++pub const POLLNORM: c_short = crate::POLLRDNORM; ++ ++pub const ENOATTR: c_int = 83; ++pub const EILSEQ: c_int = 84; ++pub const EOVERFLOW: c_int = 87; ++pub const ECANCELED: c_int = 88; ++pub const EIDRM: c_int = 89; ++pub const ENOMSG: c_int = 90; ++pub const ENOTSUP: c_int = 91; ++pub const EBADMSG: c_int = 92; ++pub const ENOTRECOVERABLE: c_int = 93; ++pub const EOWNERDEAD: c_int = 94; ++pub const EPROTO: c_int = 95; ++pub const ELAST: c_int = 95; ++ ++pub const F_DUPFD_CLOEXEC: c_int = 10; ++ ++pub const UTIME_OMIT: c_long = -1; ++pub const UTIME_NOW: c_long = -2; ++ ++pub const AT_FDCWD: c_int = -100; ++pub const AT_EACCESS: c_int = 0x01; ++pub const AT_SYMLINK_NOFOLLOW: c_int = 0x02; ++pub const AT_SYMLINK_FOLLOW: c_int = 0x04; ++pub const AT_REMOVEDIR: c_int = 0x08; ++ ++#[deprecated(since = "0.2.64", note = "Not stable across OS versions")] ++pub const RLIM_NLIMITS: c_int = 9; ++ ++pub const SO_TIMESTAMP: c_int = 0x0800; ++pub const SO_SNDTIMEO: c_int = 0x1005; ++pub const SO_RCVTIMEO: c_int = 0x1006; ++pub const SO_BINDANY: c_int = 0x1000; ++pub const SO_NETPROC: c_int = 0x1020; ++pub const SO_RTABLE: c_int = 0x1021; ++pub const SO_PEERCRED: c_int = 0x1022; ++pub const SO_SPLICE: c_int = 0x1023; ++pub const SO_DOMAIN: c_int = 0x1024; ++pub const SO_PROTOCOL: c_int = 0x1025; ++ ++// sys/netinet/in.h ++// Protocols (RFC 1700) ++// NOTE: These are in addition to the constants defined in src/unix/mod.rs ++ ++// IPPROTO_IP defined in src/unix/mod.rs ++/// Hop-by-hop option header ++pub const IPPROTO_HOPOPTS: c_int = 0; ++// IPPROTO_ICMP defined in src/unix/mod.rs ++/// group mgmt protocol ++pub const IPPROTO_IGMP: c_int = 2; ++/// gateway^2 (deprecated) ++pub const IPPROTO_GGP: c_int = 3; ++/// for compatibility ++pub const IPPROTO_IPIP: c_int = 4; ++// IPPROTO_TCP defined in src/unix/mod.rs ++/// exterior gateway protocol ++pub const IPPROTO_EGP: c_int = 8; ++/// pup ++pub const IPPROTO_PUP: c_int = 12; ++// IPPROTO_UDP defined in src/unix/mod.rs ++/// xns idp ++pub const IPPROTO_IDP: c_int = 22; ++/// tp-4 w/ class negotiation ++pub const IPPROTO_TP: c_int = 29; ++// IPPROTO_IPV6 defined in src/unix/mod.rs ++/// IP6 routing header ++pub const IPPROTO_ROUTING: c_int = 43; ++/// IP6 fragmentation header ++pub const IPPROTO_FRAGMENT: c_int = 44; ++/// resource reservation ++pub const IPPROTO_RSVP: c_int = 46; ++/// General Routing Encap. ++pub const IPPROTO_GRE: c_int = 47; ++/// IP6 Encap Sec. Payload ++pub const IPPROTO_ESP: c_int = 50; ++/// IP6 Auth Header ++pub const IPPROTO_AH: c_int = 51; ++/// IP Mobility RFC 2004 ++pub const IPPROTO_MOBILE: c_int = 55; ++// IPPROTO_ICMPV6 defined in src/unix/mod.rs ++/// IP6 no next header ++pub const IPPROTO_NONE: c_int = 59; ++/// IP6 destination option ++pub const IPPROTO_DSTOPTS: c_int = 60; ++/// ISO cnlp ++pub const IPPROTO_EON: c_int = 80; ++/// Ethernet-in-IP ++pub const IPPROTO_ETHERIP: c_int = 97; ++/// encapsulation header ++pub const IPPROTO_ENCAP: c_int = 98; ++/// Protocol indep. multicast ++pub const IPPROTO_PIM: c_int = 103; ++/// IP Payload Comp. Protocol ++pub const IPPROTO_IPCOMP: c_int = 108; ++/// CARP ++pub const IPPROTO_CARP: c_int = 112; ++/// unicast MPLS packet ++pub const IPPROTO_MPLS: c_int = 137; ++/// PFSYNC ++pub const IPPROTO_PFSYNC: c_int = 240; ++pub const IPPROTO_MAX: c_int = 256; ++ ++// Only used internally, so it can be outside the range of valid IP protocols ++pub const IPPROTO_DIVERT: c_int = 258; ++ ++pub const IP_RECVDSTADDR: c_int = 7; ++pub const IP_SENDSRCADDR: c_int = IP_RECVDSTADDR; ++pub const IP_RECVIF: c_int = 30; ++ ++// sys/netinet/in.h ++pub const TCP_MD5SIG: c_int = 0x04; ++pub const TCP_NOPUSH: c_int = 0x10; ++ ++pub const MSG_WAITFORONE: c_int = 0x1000; ++ ++pub const AF_ECMA: c_int = 8; ++pub const AF_ROUTE: c_int = 17; ++pub const AF_ENCAP: c_int = 28; ++pub const AF_SIP: c_int = 29; ++pub const AF_KEY: c_int = 30; ++pub const pseudo_AF_HDRCMPLT: c_int = 31; ++pub const AF_BLUETOOTH: c_int = 32; ++pub const AF_MPLS: c_int = 33; ++pub const pseudo_AF_PFLOW: c_int = 34; ++pub const pseudo_AF_PIPEX: c_int = 35; ++pub const NET_RT_DUMP: c_int = 1; ++pub const NET_RT_FLAGS: c_int = 2; ++pub const NET_RT_IFLIST: c_int = 3; ++pub const NET_RT_STATS: c_int = 4; ++pub const NET_RT_TABLE: c_int = 5; ++pub const NET_RT_IFNAMES: c_int = 6; ++#[doc(hidden)] ++#[deprecated( ++ since = "0.2.95", ++ note = "Possibly increasing over the releases and might not be so used in the field" ++)] ++pub const NET_RT_MAXID: c_int = 7; ++ ++pub const IPV6_JOIN_GROUP: c_int = 12; ++pub const IPV6_LEAVE_GROUP: c_int = 13; ++ ++pub const PF_ROUTE: c_int = AF_ROUTE; ++pub const PF_ECMA: c_int = AF_ECMA; ++pub const PF_ENCAP: c_int = AF_ENCAP; ++pub const PF_SIP: c_int = AF_SIP; ++pub const PF_KEY: c_int = AF_KEY; ++pub const PF_BPF: c_int = pseudo_AF_HDRCMPLT; ++pub const PF_BLUETOOTH: c_int = AF_BLUETOOTH; ++pub const PF_MPLS: c_int = AF_MPLS; ++pub const PF_PFLOW: c_int = pseudo_AF_PFLOW; ++pub const PF_PIPEX: c_int = pseudo_AF_PIPEX; ++ ++pub const SCM_TIMESTAMP: c_int = 0x04; ++ ++pub const O_DSYNC: c_int = 128; ++ ++pub const MAP_RENAME: c_int = 0x0000; ++pub const MAP_NORESERVE: c_int = 0x0000; ++pub const MAP_HASSEMAPHORE: c_int = 0x0000; ++pub const MAP_TRYFIXED: c_int = 0; ++ ++pub const EIPSEC: c_int = 82; ++pub const ENOMEDIUM: c_int = 85; ++pub const EMEDIUMTYPE: c_int = 86; ++ ++pub const EAI_BADFLAGS: c_int = -1; ++pub const EAI_NONAME: c_int = -2; ++pub const EAI_AGAIN: c_int = -3; ++pub const EAI_FAIL: c_int = -4; ++pub const EAI_NODATA: c_int = -5; ++pub const EAI_FAMILY: c_int = -6; ++pub const EAI_SOCKTYPE: c_int = -7; ++pub const EAI_SERVICE: c_int = -8; ++pub const EAI_MEMORY: c_int = -10; ++pub const EAI_SYSTEM: c_int = -11; ++pub const EAI_OVERFLOW: c_int = -14; ++ ++pub const RUSAGE_THREAD: c_int = 1; ++ ++pub const MAP_COPY: c_int = 0x0002; ++pub const MAP_NOEXTEND: c_int = 0x0000; ++ ++pub const _PC_LINK_MAX: c_int = 1; ++pub const _PC_MAX_CANON: c_int = 2; ++pub const _PC_MAX_INPUT: c_int = 3; ++pub const _PC_NAME_MAX: c_int = 4; ++pub const _PC_PATH_MAX: c_int = 5; ++pub const _PC_PIPE_BUF: c_int = 6; ++pub const _PC_CHOWN_RESTRICTED: c_int = 7; ++pub const _PC_NO_TRUNC: c_int = 8; ++pub const _PC_VDISABLE: c_int = 9; ++pub const _PC_2_SYMLINKS: c_int = 10; ++pub const _PC_ALLOC_SIZE_MIN: c_int = 11; ++pub const _PC_ASYNC_IO: c_int = 12; ++pub const _PC_FILESIZEBITS: c_int = 13; ++pub const _PC_PRIO_IO: c_int = 14; ++pub const _PC_REC_INCR_XFER_SIZE: c_int = 15; ++pub const _PC_REC_MAX_XFER_SIZE: c_int = 16; ++pub const _PC_REC_MIN_XFER_SIZE: c_int = 17; ++pub const _PC_REC_XFER_ALIGN: c_int = 18; ++pub const _PC_SYMLINK_MAX: c_int = 19; ++pub const _PC_SYNC_IO: c_int = 20; ++pub const _PC_TIMESTAMP_RESOLUTION: c_int = 21; ++ ++pub const _SC_CLK_TCK: c_int = 3; ++pub const _SC_SEM_NSEMS_MAX: c_int = 31; ++pub const _SC_SEM_VALUE_MAX: c_int = 32; ++pub const _SC_HOST_NAME_MAX: c_int = 33; ++pub const _SC_MONOTONIC_CLOCK: c_int = 34; ++pub const _SC_2_PBS: c_int = 35; ++pub const _SC_2_PBS_ACCOUNTING: c_int = 36; ++pub const _SC_2_PBS_CHECKPOINT: c_int = 37; ++pub const _SC_2_PBS_LOCATE: c_int = 38; ++pub const _SC_2_PBS_MESSAGE: c_int = 39; ++pub const _SC_2_PBS_TRACK: c_int = 40; ++pub const _SC_ADVISORY_INFO: c_int = 41; ++pub const _SC_AIO_LISTIO_MAX: c_int = 42; ++pub const _SC_AIO_MAX: c_int = 43; ++pub const _SC_AIO_PRIO_DELTA_MAX: c_int = 44; ++pub const _SC_ASYNCHRONOUS_IO: c_int = 45; ++pub const _SC_ATEXIT_MAX: c_int = 46; ++pub const _SC_BARRIERS: c_int = 47; ++pub const _SC_CLOCK_SELECTION: c_int = 48; ++pub const _SC_CPUTIME: c_int = 49; ++pub const _SC_DELAYTIMER_MAX: c_int = 50; ++pub const _SC_IOV_MAX: c_int = 51; ++pub const _SC_IPV6: c_int = 52; ++pub const _SC_MAPPED_FILES: c_int = 53; ++pub const _SC_MEMLOCK: c_int = 54; ++pub const _SC_MEMLOCK_RANGE: c_int = 55; ++pub const _SC_MEMORY_PROTECTION: c_int = 56; ++pub const _SC_MESSAGE_PASSING: c_int = 57; ++pub const _SC_MQ_OPEN_MAX: c_int = 58; ++pub const _SC_MQ_PRIO_MAX: c_int = 59; ++pub const _SC_PRIORITIZED_IO: c_int = 60; ++pub const _SC_PRIORITY_SCHEDULING: c_int = 61; ++pub const _SC_RAW_SOCKETS: c_int = 62; ++pub const _SC_READER_WRITER_LOCKS: c_int = 63; ++pub const _SC_REALTIME_SIGNALS: c_int = 64; ++pub const _SC_REGEXP: c_int = 65; ++pub const _SC_RTSIG_MAX: c_int = 66; ++pub const _SC_SEMAPHORES: c_int = 67; ++pub const _SC_SHARED_MEMORY_OBJECTS: c_int = 68; ++pub const _SC_SHELL: c_int = 69; ++pub const _SC_SIGQUEUE_MAX: c_int = 70; ++pub const _SC_SPAWN: c_int = 71; ++pub const _SC_SPIN_LOCKS: c_int = 72; ++pub const _SC_SPORADIC_SERVER: c_int = 73; ++pub const _SC_SS_REPL_MAX: c_int = 74; ++pub const _SC_SYNCHRONIZED_IO: c_int = 75; ++pub const _SC_SYMLOOP_MAX: c_int = 76; ++pub const _SC_THREAD_ATTR_STACKADDR: c_int = 77; ++pub const _SC_THREAD_ATTR_STACKSIZE: c_int = 78; ++pub const _SC_THREAD_CPUTIME: c_int = 79; ++pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: c_int = 80; ++pub const _SC_THREAD_KEYS_MAX: c_int = 81; ++pub const _SC_THREAD_PRIO_INHERIT: c_int = 82; ++pub const _SC_THREAD_PRIO_PROTECT: c_int = 83; ++pub const _SC_THREAD_PRIORITY_SCHEDULING: c_int = 84; ++pub const _SC_THREAD_PROCESS_SHARED: c_int = 85; ++pub const _SC_THREAD_ROBUST_PRIO_INHERIT: c_int = 86; ++pub const _SC_THREAD_ROBUST_PRIO_PROTECT: c_int = 87; ++pub const _SC_THREAD_SPORADIC_SERVER: c_int = 88; ++pub const _SC_THREAD_STACK_MIN: c_int = 89; ++pub const _SC_THREAD_THREADS_MAX: c_int = 90; ++pub const _SC_THREADS: c_int = 91; ++pub const _SC_TIMEOUTS: c_int = 92; ++pub const _SC_TIMER_MAX: c_int = 93; ++pub const _SC_TIMERS: c_int = 94; ++pub const _SC_TRACE: c_int = 95; ++pub const _SC_TRACE_EVENT_FILTER: c_int = 96; ++pub const _SC_TRACE_EVENT_NAME_MAX: c_int = 97; ++pub const _SC_TRACE_INHERIT: c_int = 98; ++pub const _SC_TRACE_LOG: c_int = 99; ++pub const _SC_GETGR_R_SIZE_MAX: c_int = 100; ++pub const _SC_GETPW_R_SIZE_MAX: c_int = 101; ++pub const _SC_LOGIN_NAME_MAX: c_int = 102; ++pub const _SC_THREAD_SAFE_FUNCTIONS: c_int = 103; ++pub const _SC_TRACE_NAME_MAX: c_int = 104; ++pub const _SC_TRACE_SYS_MAX: c_int = 105; ++pub const _SC_TRACE_USER_EVENT_MAX: c_int = 106; ++pub const _SC_TTY_NAME_MAX: c_int = 107; ++pub const _SC_TYPED_MEMORY_OBJECTS: c_int = 108; ++pub const _SC_V6_ILP32_OFF32: c_int = 109; ++pub const _SC_V6_ILP32_OFFBIG: c_int = 110; ++pub const _SC_V6_LP64_OFF64: c_int = 111; ++pub const _SC_V6_LPBIG_OFFBIG: c_int = 112; ++pub const _SC_V7_ILP32_OFF32: c_int = 113; ++pub const _SC_V7_ILP32_OFFBIG: c_int = 114; ++pub const _SC_V7_LP64_OFF64: c_int = 115; ++pub const _SC_V7_LPBIG_OFFBIG: c_int = 116; ++pub const _SC_XOPEN_CRYPT: c_int = 117; ++pub const _SC_XOPEN_ENH_I18N: c_int = 118; ++pub const _SC_XOPEN_LEGACY: c_int = 119; ++pub const _SC_XOPEN_REALTIME: c_int = 120; ++pub const _SC_XOPEN_REALTIME_THREADS: c_int = 121; ++pub const _SC_XOPEN_STREAMS: c_int = 122; ++pub const _SC_XOPEN_UNIX: c_int = 123; ++pub const _SC_XOPEN_UUCP: c_int = 124; ++pub const _SC_XOPEN_VERSION: c_int = 125; ++pub const _SC_PHYS_PAGES: c_int = 500; ++pub const _SC_AVPHYS_PAGES: c_int = 501; ++pub const _SC_NPROCESSORS_CONF: c_int = 502; ++pub const _SC_NPROCESSORS_ONLN: c_int = 503; ++ ++pub const FD_SETSIZE: usize = 1024; ++ ++pub const SCHED_FIFO: c_int = 1; ++pub const SCHED_OTHER: c_int = 2; ++pub const SCHED_RR: c_int = 3; ++ ++pub const ST_NOSUID: c_ulong = 2; ++ ++pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = 0 as *mut _; ++pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = 0 as *mut _; ++pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = 0 as *mut _; ++ ++pub const PTHREAD_MUTEX_ERRORCHECK: c_int = 1; ++pub const PTHREAD_MUTEX_RECURSIVE: c_int = 2; ++pub const PTHREAD_MUTEX_NORMAL: c_int = 3; ++pub const PTHREAD_MUTEX_STRICT_NP: c_int = 4; ++pub const PTHREAD_MUTEX_DEFAULT: c_int = PTHREAD_MUTEX_STRICT_NP; ++ ++pub const EVFILT_READ: i16 = -1; ++pub const EVFILT_WRITE: i16 = -2; ++pub const EVFILT_AIO: i16 = -3; ++pub const EVFILT_VNODE: i16 = -4; ++pub const EVFILT_PROC: i16 = -5; ++pub const EVFILT_SIGNAL: i16 = -6; ++pub const EVFILT_TIMER: i16 = -7; ++pub const EVFILT_DEVICE: i16 = -8; ++pub const EVFILT_EXCEPT: i16 = -9; ++ ++pub const EV_ADD: u16 = 0x1; ++pub const EV_DELETE: u16 = 0x2; ++pub const EV_ENABLE: u16 = 0x4; ++pub const EV_DISABLE: u16 = 0x8; ++pub const EV_ONESHOT: u16 = 0x10; ++pub const EV_CLEAR: u16 = 0x20; ++pub const EV_RECEIPT: u16 = 0x40; ++pub const EV_DISPATCH: u16 = 0x80; ++pub const EV_FLAG1: u16 = 0x2000; ++pub const EV_ERROR: u16 = 0x4000; ++pub const EV_EOF: u16 = 0x8000; ++ ++#[deprecated(since = "0.2.113", note = "Not stable across OS versions")] ++pub const EV_SYSFLAGS: u16 = 0xf800; ++ ++pub const NOTE_LOWAT: u32 = 0x00000001; ++pub const NOTE_EOF: u32 = 0x00000002; ++pub const NOTE_OOB: u32 = 0x00000004; ++pub const NOTE_DELETE: u32 = 0x00000001; ++pub const NOTE_WRITE: u32 = 0x00000002; ++pub const NOTE_EXTEND: u32 = 0x00000004; ++pub const NOTE_ATTRIB: u32 = 0x00000008; ++pub const NOTE_LINK: u32 = 0x00000010; ++pub const NOTE_RENAME: u32 = 0x00000020; ++pub const NOTE_REVOKE: u32 = 0x00000040; ++pub const NOTE_TRUNCATE: u32 = 0x00000080; ++pub const NOTE_EXIT: u32 = 0x80000000; ++pub const NOTE_FORK: u32 = 0x40000000; ++pub const NOTE_EXEC: u32 = 0x20000000; ++pub const NOTE_PDATAMASK: u32 = 0x000fffff; ++pub const NOTE_PCTRLMASK: u32 = 0xf0000000; ++pub const NOTE_TRACK: u32 = 0x00000001; ++pub const NOTE_TRACKERR: u32 = 0x00000002; ++pub const NOTE_CHILD: u32 = 0x00000004; ++pub const NOTE_CHANGE: u32 = 0x00000001; ++ ++pub const TMP_MAX: c_uint = 0x7fffffff; ++ ++pub const AI_PASSIVE: c_int = 1; ++pub const AI_CANONNAME: c_int = 2; ++pub const AI_NUMERICHOST: c_int = 4; ++pub const AI_EXT: c_int = 8; ++pub const AI_NUMERICSERV: c_int = 16; ++pub const AI_FQDN: c_int = 32; ++pub const AI_ADDRCONFIG: c_int = 64; ++ ++pub const NI_NUMERICHOST: c_int = 1; ++pub const NI_NUMERICSERV: c_int = 2; ++pub const NI_NOFQDN: c_int = 4; ++pub const NI_NAMEREQD: c_int = 8; ++pub const NI_DGRAM: c_int = 16; ++ ++pub const NI_MAXHOST: size_t = 256; ++ ++pub const RTLD_LOCAL: c_int = 0; ++ ++pub const CTL_MAXNAME: c_int = 12; ++ ++pub const CTLTYPE_NODE: c_int = 1; ++pub const CTLTYPE_INT: c_int = 2; ++pub const CTLTYPE_STRING: c_int = 3; ++pub const CTLTYPE_QUAD: c_int = 4; ++pub const CTLTYPE_STRUCT: c_int = 5; ++ ++pub const CTL_UNSPEC: c_int = 0; ++pub const CTL_KERN: c_int = 1; ++pub const CTL_VM: c_int = 2; ++pub const CTL_FS: c_int = 3; ++pub const CTL_NET: c_int = 4; ++pub const CTL_DEBUG: c_int = 5; ++pub const CTL_HW: c_int = 6; ++pub const CTL_MACHDEP: c_int = 7; ++pub const CTL_DDB: c_int = 9; ++pub const CTL_VFS: c_int = 10; ++pub const CTL_MAXID: c_int = 11; ++ ++pub const HW_NCPUONLINE: c_int = 25; ++ ++pub const KERN_OSTYPE: c_int = 1; ++pub const KERN_OSRELEASE: c_int = 2; ++pub const KERN_OSREV: c_int = 3; ++pub const KERN_VERSION: c_int = 4; ++pub const KERN_MAXVNODES: c_int = 5; ++pub const KERN_MAXPROC: c_int = 6; ++pub const KERN_MAXFILES: c_int = 7; ++pub const KERN_ARGMAX: c_int = 8; ++pub const KERN_SECURELVL: c_int = 9; ++pub const KERN_HOSTNAME: c_int = 10; ++pub const KERN_HOSTID: c_int = 11; ++pub const KERN_CLOCKRATE: c_int = 12; ++pub const KERN_PROF: c_int = 16; ++pub const KERN_POSIX1: c_int = 17; ++pub const KERN_NGROUPS: c_int = 18; ++pub const KERN_JOB_CONTROL: c_int = 19; ++pub const KERN_SAVED_IDS: c_int = 20; ++pub const KERN_BOOTTIME: c_int = 21; ++pub const KERN_DOMAINNAME: c_int = 22; ++pub const KERN_MAXPARTITIONS: c_int = 23; ++pub const KERN_RAWPARTITION: c_int = 24; ++pub const KERN_MAXTHREAD: c_int = 25; ++pub const KERN_NTHREADS: c_int = 26; ++pub const KERN_OSVERSION: c_int = 27; ++pub const KERN_SOMAXCONN: c_int = 28; ++pub const KERN_SOMINCONN: c_int = 29; ++#[deprecated(since = "0.2.71", note = "Removed in OpenBSD 6.0")] ++pub const KERN_USERMOUNT: c_int = 30; ++pub const KERN_NOSUIDCOREDUMP: c_int = 32; ++pub const KERN_FSYNC: c_int = 33; ++pub const KERN_SYSVMSG: c_int = 34; ++pub const KERN_SYSVSEM: c_int = 35; ++pub const KERN_SYSVSHM: c_int = 36; ++#[deprecated(since = "0.2.71", note = "Removed in OpenBSD 6.0")] ++pub const KERN_ARND: c_int = 37; ++pub const KERN_MSGBUFSIZE: c_int = 38; ++pub const KERN_MALLOCSTATS: c_int = 39; ++pub const KERN_CPTIME: c_int = 40; ++pub const KERN_NCHSTATS: c_int = 41; ++pub const KERN_FORKSTAT: c_int = 42; ++pub const KERN_NSELCOLL: c_int = 43; ++pub const KERN_TTY: c_int = 44; ++pub const KERN_CCPU: c_int = 45; ++pub const KERN_FSCALE: c_int = 46; ++pub const KERN_NPROCS: c_int = 47; ++pub const KERN_MSGBUF: c_int = 48; ++pub const KERN_POOL: c_int = 49; ++pub const KERN_STACKGAPRANDOM: c_int = 50; ++pub const KERN_SYSVIPC_INFO: c_int = 51; ++pub const KERN_SPLASSERT: c_int = 54; ++pub const KERN_PROC_ARGS: c_int = 55; ++pub const KERN_NFILES: c_int = 56; ++pub const KERN_TTYCOUNT: c_int = 57; ++pub const KERN_NUMVNODES: c_int = 58; ++pub const KERN_MBSTAT: c_int = 59; ++pub const KERN_SEMINFO: c_int = 61; ++pub const KERN_SHMINFO: c_int = 62; ++pub const KERN_INTRCNT: c_int = 63; ++pub const KERN_WATCHDOG: c_int = 64; ++pub const KERN_PROC: c_int = 66; ++pub const KERN_MAXCLUSTERS: c_int = 67; ++pub const KERN_EVCOUNT: c_int = 68; ++pub const KERN_TIMECOUNTER: c_int = 69; ++pub const KERN_MAXLOCKSPERUID: c_int = 70; ++pub const KERN_CPTIME2: c_int = 71; ++pub const KERN_CACHEPCT: c_int = 72; ++pub const KERN_FILE: c_int = 73; ++pub const KERN_CONSDEV: c_int = 75; ++pub const KERN_NETLIVELOCKS: c_int = 76; ++pub const KERN_POOL_DEBUG: c_int = 77; ++pub const KERN_PROC_CWD: c_int = 78; ++pub const KERN_PROC_NOBROADCASTKILL: c_int = 79; ++pub const KERN_PROC_VMMAP: c_int = 80; ++pub const KERN_GLOBAL_PTRACE: c_int = 81; ++pub const KERN_CONSBUFSIZE: c_int = 82; ++pub const KERN_CONSBUF: c_int = 83; ++pub const KERN_AUDIO: c_int = 84; ++pub const KERN_CPUSTATS: c_int = 85; ++pub const KERN_PFSTATUS: c_int = 86; ++pub const KERN_TIMEOUT_STATS: c_int = 87; ++#[deprecated( ++ since = "0.2.95", ++ note = "Possibly increasing over the releases and might not be so used in the field" ++)] ++pub const KERN_MAXID: c_int = 88; ++ ++pub const KERN_PROC_ALL: c_int = 0; ++pub const KERN_PROC_PID: c_int = 1; ++pub const KERN_PROC_PGRP: c_int = 2; ++pub const KERN_PROC_SESSION: c_int = 3; ++pub const KERN_PROC_TTY: c_int = 4; ++pub const KERN_PROC_UID: c_int = 5; ++pub const KERN_PROC_RUID: c_int = 6; ++pub const KERN_PROC_KTHREAD: c_int = 7; ++pub const KERN_PROC_SHOW_THREADS: c_int = 0x40000000; ++ ++pub const KERN_SYSVIPC_MSG_INFO: c_int = 1; ++pub const KERN_SYSVIPC_SEM_INFO: c_int = 2; ++pub const KERN_SYSVIPC_SHM_INFO: c_int = 3; ++ ++pub const KERN_PROC_ARGV: c_int = 1; ++pub const KERN_PROC_NARGV: c_int = 2; ++pub const KERN_PROC_ENV: c_int = 3; ++pub const KERN_PROC_NENV: c_int = 4; ++ ++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 = 32; ++pub const KI_EMULNAMELEN: c_int = 8; ++ ++pub const KVE_ET_OBJ: c_int = 0x00000001; ++pub const KVE_ET_SUBMAP: c_int = 0x00000002; ++pub const KVE_ET_COPYONWRITE: c_int = 0x00000004; ++pub const KVE_ET_NEEDSCOPY: c_int = 0x00000008; ++pub const KVE_ET_HOLE: c_int = 0x00000010; ++pub const KVE_ET_NOFAULT: c_int = 0x00000020; ++pub const KVE_ET_STACK: c_int = 0x00000040; ++pub const KVE_ET_WC: c_int = 0x000000080; ++pub const KVE_ET_CONCEAL: c_int = 0x000000100; ++pub const KVE_ET_SYSCALL: c_int = 0x000000200; ++pub const KVE_ET_FREEMAPPED: c_int = 0x000000800; ++ ++pub const KVE_PROT_NONE: c_int = 0x00000000; ++pub const KVE_PROT_READ: c_int = 0x00000001; ++pub const KVE_PROT_WRITE: c_int = 0x00000002; ++pub const KVE_PROT_EXEC: c_int = 0x00000004; ++ ++pub const KVE_ADV_NORMAL: c_int = 0x00000000; ++pub const KVE_ADV_RANDOM: c_int = 0x00000001; ++pub const KVE_ADV_SEQUENTIAL: c_int = 0x00000002; ++ ++pub const KVE_INH_SHARE: c_int = 0x00000000; ++pub const KVE_INH_COPY: c_int = 0x00000010; ++pub const KVE_INH_NONE: c_int = 0x00000020; ++pub const KVE_INH_ZERO: c_int = 0x00000030; ++ ++pub const KVE_F_STATIC: c_int = 0x1; ++pub const KVE_F_KMEM: c_int = 0x2; ++ ++pub const CHWFLOW: crate::tcflag_t = crate::MDMBUF | crate::CRTSCTS; ++pub const OLCUC: crate::tcflag_t = 0x20; ++pub const ONOCR: crate::tcflag_t = 0x40; ++pub const ONLRET: crate::tcflag_t = 0x80; ++ ++//https://github.com/openbsd/src/blob/HEAD/sys/sys/mount.h ++pub const ISOFSMNT_NORRIP: c_int = 0x1; // disable Rock Ridge Ext ++pub const ISOFSMNT_GENS: c_int = 0x2; // enable generation numbers ++pub const ISOFSMNT_EXTATT: c_int = 0x4; // enable extended attr ++pub const ISOFSMNT_NOJOLIET: c_int = 0x8; // disable Joliet Ext ++pub const ISOFSMNT_SESS: c_int = 0x10; // use iso_args.sess ++ ++pub const NFS_ARGSVERSION: c_int = 4; // change when nfs_args changes ++ ++pub const NFSMNT_RESVPORT: c_int = 0; // always use reserved ports ++pub const NFSMNT_SOFT: c_int = 0x1; // soft mount (hard is default) ++pub const NFSMNT_WSIZE: c_int = 0x2; // set write size ++pub const NFSMNT_RSIZE: c_int = 0x4; // set read size ++pub const NFSMNT_TIMEO: c_int = 0x8; // set initial timeout ++pub const NFSMNT_RETRANS: c_int = 0x10; // set number of request retries ++pub const NFSMNT_MAXGRPS: c_int = 0x20; // set maximum grouplist size ++pub const NFSMNT_INT: c_int = 0x40; // allow interrupts on hard mount ++pub const NFSMNT_NOCONN: c_int = 0x80; // Don't Connect the socket ++pub const NFSMNT_NQNFS: c_int = 0x100; // Use Nqnfs protocol ++pub const NFSMNT_NFSV3: c_int = 0x200; // Use NFS Version 3 protocol ++pub const NFSMNT_KERB: c_int = 0x400; // Use Kerberos authentication ++pub const NFSMNT_DUMBTIMR: c_int = 0x800; // Don't estimate rtt dynamically ++pub const NFSMNT_LEASETERM: c_int = 0x1000; // set lease term (nqnfs) ++pub const NFSMNT_READAHEAD: c_int = 0x2000; // set read ahead ++pub const NFSMNT_DEADTHRESH: c_int = 0x4000; // set dead server retry thresh ++pub const NFSMNT_NOAC: c_int = 0x8000; // disable attribute cache ++pub const NFSMNT_RDIRPLUS: c_int = 0x10000; // Use Readdirplus for V3 ++pub const NFSMNT_READDIRSIZE: c_int = 0x20000; // Set readdir size ++ ++/* Flags valid only in mount syscall arguments */ ++pub const NFSMNT_ACREGMIN: c_int = 0x40000; // acregmin field valid ++pub const NFSMNT_ACREGMAX: c_int = 0x80000; // acregmax field valid ++pub const NFSMNT_ACDIRMIN: c_int = 0x100000; // acdirmin field valid ++pub const NFSMNT_ACDIRMAX: c_int = 0x200000; // acdirmax field valid ++ ++/* Flags valid only in kernel */ ++pub const NFSMNT_INTERNAL: c_int = 0xfffc0000; // Bits set internally ++pub const NFSMNT_HASWRITEVERF: c_int = 0x40000; // Has write verifier for V3 ++pub const NFSMNT_GOTPATHCONF: c_int = 0x80000; // Got the V3 pathconf info ++pub const NFSMNT_GOTFSINFO: c_int = 0x100000; // Got the V3 fsinfo ++pub const NFSMNT_MNTD: c_int = 0x200000; // Mnt server for mnt point ++pub const NFSMNT_DISMINPROG: c_int = 0x400000; // Dismount in progress ++pub const NFSMNT_DISMNT: c_int = 0x800000; // Dismounted ++pub const NFSMNT_SNDLOCK: c_int = 0x1000000; // Send socket lock ++pub const NFSMNT_WANTSND: c_int = 0x2000000; // Want above ++pub const NFSMNT_RCVLOCK: c_int = 0x4000000; // Rcv socket lock ++pub const NFSMNT_WANTRCV: c_int = 0x8000000; // Want above ++pub const NFSMNT_WAITAUTH: c_int = 0x10000000; // Wait for authentication ++pub const NFSMNT_HASAUTH: c_int = 0x20000000; // Has authenticator ++pub const NFSMNT_WANTAUTH: c_int = 0x40000000; // Wants an authenticator ++pub const NFSMNT_AUTHERR: c_int = 0x80000000; // Authentication error ++ ++pub const MSDOSFSMNT_SHORTNAME: c_int = 0x1; // Force old DOS short names only ++pub const MSDOSFSMNT_LONGNAME: c_int = 0x2; // Force Win'95 long names ++pub const MSDOSFSMNT_NOWIN95: c_int = 0x4; // Completely ignore Win95 entries ++ ++pub const NTFS_MFLAG_CASEINS: c_int = 0x1; ++pub const NTFS_MFLAG_ALLNAMES: c_int = 0x2; ++ ++pub const TMPFS_ARGS_VERSION: c_int = 1; ++ ++const SI_MAXSZ: size_t = 128; ++const SI_PAD: size_t = (SI_MAXSZ / mem::size_of::()) - 3; ++ ++pub const MAP_STACK: c_int = 0x4000; ++pub const MAP_CONCEAL: c_int = 0x8000; ++ ++// https://github.com/openbsd/src/blob/HEAD/sys/net/if.h#L187 ++pub const IFF_UP: c_int = 0x1; // interface is up ++pub const IFF_BROADCAST: c_int = 0x2; // broadcast address valid ++pub const IFF_DEBUG: c_int = 0x4; // turn on debugging ++pub const IFF_LOOPBACK: c_int = 0x8; // is a loopback net ++pub const IFF_POINTOPOINT: c_int = 0x10; // interface is point-to-point link ++pub const IFF_STATICARP: c_int = 0x20; // only static ARP ++pub const IFF_RUNNING: c_int = 0x40; // resources allocated ++pub const IFF_NOARP: c_int = 0x80; // no address resolution protocol ++pub const IFF_PROMISC: c_int = 0x100; // receive all packets ++pub const IFF_ALLMULTI: c_int = 0x200; // receive all multicast packets ++pub const IFF_OACTIVE: c_int = 0x400; // transmission in progress ++pub const IFF_SIMPLEX: c_int = 0x800; // can't hear own transmissions ++pub const IFF_LINK0: c_int = 0x1000; // per link layer defined bit ++pub const IFF_LINK1: c_int = 0x2000; // per link layer defined bit ++pub const IFF_LINK2: c_int = 0x4000; // per link layer defined bit ++pub const IFF_MULTICAST: c_int = 0x8000; // supports multicast ++ ++pub const PTHREAD_STACK_MIN: size_t = 1_usize << _MAX_PAGE_SHIFT; ++pub const MINSIGSTKSZ: size_t = 3_usize << _MAX_PAGE_SHIFT; ++pub const SIGSTKSZ: size_t = MINSIGSTKSZ + (1_usize << _MAX_PAGE_SHIFT) * 4; ++ ++pub const PT_SET_EVENT_MASK: c_int = 12; ++pub const PT_GET_EVENT_MASK: c_int = 13; ++pub const PT_GET_PROCESS_STATE: c_int = 14; ++pub const PT_GET_THREAD_FIRST: c_int = 15; ++pub const PT_GET_THREAD_NEXT: c_int = 16; ++pub const PT_FIRSTMACH: c_int = 32; ++ ++pub const SOCK_CLOEXEC: c_int = 0x8000; ++pub const SOCK_NONBLOCK: c_int = 0x4000; ++pub const SOCK_DNS: c_int = 0x1000; ++ ++pub const BIOCGRSIG: c_ulong = 0x40044273; ++pub const BIOCSRSIG: c_ulong = 0x80044272; ++pub const BIOCSDLT: c_ulong = 0x8004427a; ++ ++pub const PTRACE_FORK: c_int = 0x0002; ++ ++pub const WCONTINUED: c_int = 0x08; ++pub const WEXITED: c_int = 0x04; ++pub const WSTOPPED: c_int = 0x02; // same as WUNTRACED ++pub const WNOWAIT: c_int = 0x10; ++pub const WTRAPPED: c_int = 0x20; ++ ++pub const P_ALL: crate::idtype_t = 0; ++pub const P_PGID: crate::idtype_t = 1; ++pub const P_PID: crate::idtype_t = 2; ++ ++// search.h ++pub const FIND: crate::ACTION = 0; ++pub const ENTER: crate::ACTION = 1; ++ ++// futex.h ++pub const FUTEX_WAIT: c_int = 1; ++pub const FUTEX_WAKE: c_int = 2; ++pub const FUTEX_REQUEUE: c_int = 3; ++pub const FUTEX_PRIVATE_FLAG: c_int = 128; ++ ++// sysctl.h, kinfo_proc p_eflag constants ++pub const EPROC_CTTY: i32 = 0x01; // controlling tty vnode active ++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; ++ ++// sys/exec_elf.h - Legal values for p_type (segment type). ++pub const PT_NULL: u32 = 0; ++pub const PT_LOAD: u32 = 1; ++pub const PT_DYNAMIC: u32 = 2; ++pub const PT_INTERP: u32 = 3; ++pub const PT_NOTE: u32 = 4; ++pub const PT_SHLIB: u32 = 5; ++pub const PT_PHDR: u32 = 6; ++pub const PT_TLS: u32 = 7; ++pub const PT_LOOS: u32 = 0x60000000; ++pub const PT_HIOS: u32 = 0x6fffffff; ++pub const PT_LOPROC: u32 = 0x70000000; ++pub const PT_HIPROC: u32 = 0x7fffffff; ++ ++pub const PT_GNU_EH_FRAME: u32 = 0x6474e550; ++pub const PT_GNU_RELRO: u32 = 0x6474e552; ++ ++// sys/exec_elf.h - Legal values for p_flags (segment flags). ++pub const PF_X: u32 = 0x1; ++pub const PF_W: u32 = 0x2; ++pub const PF_R: u32 = 0x4; ++pub const PF_MASKOS: u32 = 0x0ff00000; ++pub const PF_MASKPROC: u32 = 0xf0000000; ++ ++// sys/mount.h ++pub const MNT_NOPERM: c_int = 0x00000020; ++pub const MNT_WXALLOWED: c_int = 0x00000800; ++pub const MNT_EXRDONLY: c_int = 0x00000080; ++pub const MNT_DEFEXPORTED: c_int = 0x00000200; ++pub const MNT_EXPORTANON: c_int = 0x00000400; ++pub const MNT_ROOTFS: c_int = 0x00004000; ++pub const MNT_NOATIME: c_int = 0x00008000; ++pub const MNT_DELEXPORT: c_int = 0x00020000; ++pub const MNT_STALLED: c_int = 0x00100000; ++pub const MNT_SWAPPABLE: c_int = 0x00200000; ++pub const MNT_WANTRDWR: c_int = 0x02000000; ++pub const MNT_SOFTDEP: c_int = 0x04000000; ++pub const MNT_DOOMED: c_int = 0x08000000; ++ ++// For use with vfs_fsync and getfsstat ++pub const MNT_WAIT: c_int = 1; ++pub const MNT_NOWAIT: c_int = 2; ++pub const MNT_LAZY: c_int = 3; ++ ++// sys/_time.h ++pub const CLOCK_PROCESS_CPUTIME_ID: crate::clockid_t = 2; ++pub const CLOCK_THREAD_CPUTIME_ID: crate::clockid_t = 4; ++pub const CLOCK_UPTIME: crate::clockid_t = 5; ++pub const CLOCK_BOOTTIME: crate::clockid_t = 6; ++ ++pub const LC_COLLATE_MASK: c_int = 1 << crate::LC_COLLATE; ++pub const LC_CTYPE_MASK: c_int = 1 << crate::LC_CTYPE; ++pub const LC_MONETARY_MASK: c_int = 1 << crate::LC_MONETARY; ++pub const LC_NUMERIC_MASK: c_int = 1 << crate::LC_NUMERIC; ++pub const LC_TIME_MASK: c_int = 1 << crate::LC_TIME; ++pub const LC_MESSAGES_MASK: c_int = 1 << crate::LC_MESSAGES; ++ ++const _LC_LAST: c_int = 7; ++pub const LC_ALL_MASK: c_int = (1 << _LC_LAST) - 2; ++ ++pub const LC_GLOBAL_LOCALE: crate::locale_t = -1isize as crate::locale_t; ++ ++// sys/reboot.h ++pub const RB_ASKNAME: c_int = 0x00001; ++pub const RB_SINGLE: c_int = 0x00002; ++pub const RB_NOSYNC: c_int = 0x00004; ++pub const RB_HALT: c_int = 0x00008; ++pub const RB_INITNAME: c_int = 0x00010; ++pub const RB_KDB: c_int = 0x00040; ++pub const RB_RDONLY: c_int = 0x00080; ++pub const RB_DUMP: c_int = 0x00100; ++pub const RB_MINIROOT: c_int = 0x00200; ++pub const RB_CONFIG: c_int = 0x00400; ++pub const RB_TIMEBAD: c_int = 0x00800; ++pub const RB_POWERDOWN: c_int = 0x01000; ++pub const RB_SERCONS: c_int = 0x02000; ++pub const RB_USERREQ: c_int = 0x04000; ++pub const RB_RESET: c_int = 0x08000; ++pub const RB_GOODRANDOM: c_int = 0x10000; ++pub const RB_UNHIBERNATE: c_int = 0x20000; ++ ++// net/route.h ++pub const RTF_CLONING: c_int = 0x100; ++pub const RTF_MULTICAST: c_int = 0x200; ++pub const RTF_LLINFO: c_int = 0x400; ++pub const RTF_PROTO3: c_int = 0x2000; ++pub const RTF_ANNOUNCE: c_int = crate::RTF_PROTO2; ++ ++pub const RTF_CLONED: c_int = 0x10000; ++pub const RTF_CACHED: c_int = 0x20000; ++pub const RTF_MPATH: c_int = 0x40000; ++pub const RTF_MPLS: c_int = 0x100000; ++pub const RTF_LOCAL: c_int = 0x200000; ++pub const RTF_BROADCAST: c_int = 0x400000; ++pub const RTF_CONNECTED: c_int = 0x800000; ++pub const RTF_BFD: c_int = 0x1000000; ++pub const RTF_FMASK: c_int = crate::RTF_LLINFO ++ | crate::RTF_PROTO1 ++ | crate::RTF_PROTO2 ++ | crate::RTF_PROTO3 ++ | crate::RTF_BLACKHOLE ++ | crate::RTF_REJECT ++ | crate::RTF_STATIC ++ | crate::RTF_MPLS ++ | crate::RTF_BFD; ++ ++pub const RTM_VERSION: c_int = 5; ++pub const RTM_RESOLVE: c_int = 0xb; ++pub const RTM_NEWADDR: c_int = 0xc; ++pub const RTM_DELADDR: c_int = 0xd; ++pub const RTM_IFINFO: c_int = 0xe; ++pub const RTM_IFANNOUNCE: c_int = 0xf; ++pub const RTM_DESYNC: c_int = 0x10; ++pub const RTM_INVALIDATE: c_int = 0x11; ++pub const RTM_BFD: c_int = 0x12; ++pub const RTM_PROPOSAL: c_int = 0x13; ++pub const RTM_CHGADDRATTR: c_int = 0x14; ++pub const RTM_80211INFO: c_int = 0x15; ++pub const RTM_SOURCE: c_int = 0x16; ++ ++pub const RTA_SRC: c_int = 0x100; ++pub const RTA_SRCMASK: c_int = 0x200; ++pub const RTA_LABEL: c_int = 0x400; ++pub const RTA_BFD: c_int = 0x800; ++pub const RTA_DNS: c_int = 0x1000; ++pub const RTA_STATIC: c_int = 0x2000; ++pub const RTA_SEARCH: c_int = 0x4000; ++ ++pub const RTAX_SRC: c_int = 8; ++pub const RTAX_SRCMASK: c_int = 9; ++pub const RTAX_LABEL: c_int = 10; ++pub const RTAX_BFD: c_int = 11; ++pub const RTAX_DNS: c_int = 12; ++pub const RTAX_STATIC: c_int = 13; ++pub const RTAX_SEARCH: c_int = 14; ++pub const RTAX_MAX: c_int = 15; ++ ++const_fn! { ++ {const} fn _ALIGN(p: usize) -> usize { ++ (p + _ALIGNBYTES) & !_ALIGNBYTES ++ } ++} ++ ++f! { ++ pub fn CMSG_DATA(cmsg: *const cmsghdr) -> *mut c_uchar { ++ (cmsg as *mut c_uchar).offset(_ALIGN(mem::size_of::()) as isize) ++ } ++ ++ pub {const} fn CMSG_LEN(length: c_uint) -> c_uint { ++ _ALIGN(mem::size_of::()) as c_uint + length ++ } ++ ++ pub fn CMSG_NXTHDR(mhdr: *const crate::msghdr, cmsg: *const cmsghdr) -> *mut cmsghdr { ++ if cmsg.is_null() { ++ return crate::CMSG_FIRSTHDR(mhdr); ++ }; ++ let next = ++ cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize) + _ALIGN(mem::size_of::()); ++ let max = (*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize; ++ if next > max { ++ 0 as *mut cmsghdr ++ } else { ++ (cmsg as usize + _ALIGN((*cmsg).cmsg_len as usize)) as *mut cmsghdr ++ } ++ } ++ ++ pub {const} fn CMSG_SPACE(length: c_uint) -> c_uint { ++ (_ALIGN(mem::size_of::()) + _ALIGN(length as usize)) as c_uint ++ } ++ ++ pub fn major(dev: crate::dev_t) -> c_uint { ++ ((dev as c_uint) >> 8) & 0xff ++ } ++ ++ pub fn minor(dev: crate::dev_t) -> c_uint { ++ let dev = dev as c_uint; ++ let mut res = 0; ++ res |= (dev) & 0xff; ++ res |= ((dev) & 0xffff0000) >> 8; ++ ++ res ++ } ++} ++ ++safe_f! { ++ pub {const} fn WSTOPSIG(status: c_int) -> c_int { ++ status >> 8 ++ } ++ ++ pub {const} fn WIFSIGNALED(status: c_int) -> bool { ++ (status & 0o177) != 0o177 && (status & 0o177) != 0 ++ } ++ ++ pub {const} fn WIFSTOPPED(status: c_int) -> bool { ++ (status & 0xff) == 0o177 ++ } ++ ++ pub {const} fn WIFCONTINUED(status: c_int) -> bool { ++ (status & 0o177777) == 0o177777 ++ } ++ ++ pub {const} fn makedev(major: c_uint, minor: c_uint) -> crate::dev_t { ++ let major = major as crate::dev_t; ++ let minor = minor as crate::dev_t; ++ let mut dev = 0; ++ dev |= (major & 0xff) << 8; ++ dev |= minor & 0xff; ++ dev |= (minor & 0xffff00) << 8; ++ dev ++ } ++} ++ ++extern "C" { ++ pub fn gettimeofday(tp: *mut crate::timeval, tz: *mut crate::timezone) -> c_int; ++ pub fn settimeofday(tp: *const crate::timeval, tz: *const crate::timezone) -> c_int; ++ pub fn pledge(promises: *const c_char, execpromises: *const c_char) -> c_int; ++ pub fn unveil(path: *const c_char, permissions: *const c_char) -> c_int; ++ pub fn strtonum( ++ nptr: *const c_char, ++ minval: c_longlong, ++ maxval: c_longlong, ++ errstr: *mut *const c_char, ++ ) -> c_longlong; ++ pub fn dup3(src: c_int, dst: c_int, flags: c_int) -> c_int; ++ pub fn chflags(path: *const c_char, flags: c_uint) -> c_int; ++ pub fn fchflags(fd: c_int, flags: c_uint) -> c_int; ++ pub fn chflagsat(fd: c_int, path: *const c_char, flags: c_uint, atflag: c_int) -> c_int; ++ pub fn dirfd(dirp: *mut crate::DIR) -> c_int; ++ pub fn getnameinfo( ++ sa: *const crate::sockaddr, ++ salen: crate::socklen_t, ++ host: *mut c_char, ++ hostlen: size_t, ++ serv: *mut c_char, ++ servlen: size_t, ++ flags: c_int, ++ ) -> c_int; ++ pub fn getresgid( ++ rgid: *mut crate::gid_t, ++ egid: *mut crate::gid_t, ++ sgid: *mut crate::gid_t, ++ ) -> c_int; ++ pub fn getresuid( ++ ruid: *mut crate::uid_t, ++ euid: *mut crate::uid_t, ++ suid: *mut crate::uid_t, ++ ) -> c_int; ++ pub fn kevent( ++ kq: c_int, ++ changelist: *const crate::kevent, ++ nchanges: c_int, ++ eventlist: *mut crate::kevent, ++ nevents: c_int, ++ timeout: *const crate::timespec, ++ ) -> c_int; ++ pub fn mprotect(addr: *mut c_void, len: size_t, prot: c_int) -> c_int; ++ pub fn getthrid() -> crate::pid_t; ++ pub fn pthread_attr_getguardsize( ++ attr: *const crate::pthread_attr_t, ++ guardsize: *mut size_t, ++ ) -> c_int; ++ pub fn pthread_attr_setguardsize(attr: *mut crate::pthread_attr_t, guardsize: size_t) -> c_int; ++ pub fn pthread_attr_getstack( ++ attr: *const crate::pthread_attr_t, ++ stackaddr: *mut *mut c_void, ++ stacksize: *mut size_t, ++ ) -> c_int; ++ pub fn pthread_main_np() -> c_int; ++ pub fn pthread_get_name_np(tid: crate::pthread_t, name: *mut c_char, len: size_t); ++ pub fn pthread_set_name_np(tid: crate::pthread_t, name: *const c_char); ++ pub fn pthread_stackseg_np(thread: crate::pthread_t, sinfo: *mut crate::stack_t) -> c_int; ++ ++ pub fn openpty( ++ amaster: *mut c_int, ++ aslave: *mut c_int, ++ name: *mut c_char, ++ termp: *const crate::termios, ++ winp: *const crate::winsize, ++ ) -> c_int; ++ pub fn forkpty( ++ amaster: *mut c_int, ++ name: *mut c_char, ++ termp: *const crate::termios, ++ winp: *const crate::winsize, ++ ) -> crate::pid_t; ++ ++ pub fn sysctl( ++ name: *const c_int, ++ namelen: c_uint, ++ oldp: *mut c_void, ++ oldlenp: *mut size_t, ++ newp: *mut c_void, ++ newlen: size_t, ++ ) -> c_int; ++ pub fn setresgid(rgid: crate::gid_t, egid: crate::gid_t, sgid: crate::gid_t) -> c_int; ++ pub fn setresuid(ruid: crate::uid_t, euid: crate::uid_t, suid: crate::uid_t) -> c_int; ++ pub fn ptrace(request: c_int, pid: crate::pid_t, addr: caddr_t, data: c_int) -> c_int; ++ pub fn utrace(label: *const c_char, addr: *const c_void, len: size_t) -> c_int; ++ pub fn memmem( ++ haystack: *const c_void, ++ haystacklen: size_t, ++ needle: *const c_void, ++ needlelen: size_t, ++ ) -> *mut c_void; ++ // #include ++ pub fn dl_iterate_phdr( ++ callback: Option< ++ unsafe extern "C" fn(info: *mut dl_phdr_info, size: usize, data: *mut c_void) -> c_int, ++ >, ++ data: *mut c_void, ++ ) -> c_int; ++ pub fn uselocale(loc: crate::locale_t) -> crate::locale_t; ++ pub fn freelocale(loc: crate::locale_t); ++ pub fn newlocale(mask: c_int, locale: *const c_char, base: crate::locale_t) -> crate::locale_t; ++ pub fn duplocale(base: crate::locale_t) -> crate::locale_t; ++ ++ // Added in `OpenBSD` 5.5 ++ pub fn explicit_bzero(s: *mut c_void, len: size_t); ++ ++ pub fn setproctitle(fmt: *const c_char, ...); ++ ++ pub fn freezero(ptr: *mut c_void, size: size_t); ++ pub fn malloc_conceal(size: size_t) -> *mut c_void; ++ pub fn calloc_conceal(nmemb: size_t, size: size_t) -> *mut c_void; ++ ++ pub fn srand48_deterministic(seed: c_long); ++ pub fn seed48_deterministic(xseed: *mut c_ushort) -> *mut c_ushort; ++ pub fn lcong48_deterministic(p: *mut c_ushort); ++ ++ pub fn lsearch( ++ key: *const c_void, ++ base: *mut c_void, ++ nelp: *mut size_t, ++ width: size_t, ++ compar: Option c_int>, ++ ) -> *mut c_void; ++ pub fn lfind( ++ key: *const c_void, ++ base: *const c_void, ++ nelp: *mut size_t, ++ width: size_t, ++ compar: Option c_int>, ++ ) -> *mut c_void; ++ pub fn hcreate(nelt: size_t) -> c_int; ++ pub fn hdestroy(); ++ pub fn hsearch(entry: crate::ENTRY, action: crate::ACTION) -> *mut crate::ENTRY; ++ ++ // futex.h ++ pub fn futex( ++ uaddr: *mut u32, ++ op: c_int, ++ val: c_int, ++ timeout: *const crate::timespec, ++ uaddr2: *mut u32, ++ ) -> c_int; ++ ++ pub fn mimmutable(addr: *mut c_void, len: size_t) -> c_int; ++ ++ pub fn reboot(mode: c_int) -> c_int; ++ ++ pub fn statfs(path: *const c_char, buf: *mut statfs) -> c_int; ++ pub fn fstatfs(fd: c_int, buf: *mut statfs) -> c_int; ++ pub fn getmntinfo(mntbufp: *mut *mut crate::statfs, flags: c_int) -> c_int; ++ pub fn getfsstat(buf: *mut statfs, bufsize: size_t, flags: c_int) -> c_int; ++} ++ ++#[link(name = "execinfo")] ++extern "C" { ++ pub fn backtrace(addrlist: *mut *mut c_void, len: size_t) -> size_t; ++ pub fn backtrace_symbols(addrlist: *const *mut c_void, len: size_t) -> *mut *mut c_char; ++ pub fn backtrace_symbols_fd(addrlist: *const *mut c_void, len: size_t, fd: c_int) -> c_int; ++ pub fn backtrace_symbols_fmt( ++ addrlist: *const *mut c_void, ++ len: size_t, ++ fmt: *const c_char, ++ ) -> *mut *mut c_char; ++} ++ ++cfg_if! { ++ if #[cfg(target_arch = "aarch64")] { ++ mod aarch64; ++ pub use self::aarch64::*; ++ } else if #[cfg(target_arch = "arm")] { ++ mod arm; ++ pub use self::arm::*; ++ } else if #[cfg(target_arch = "mips64")] { ++ mod mips64; ++ pub use self::mips64::*; ++ } else if #[cfg(target_arch = "powerpc")] { ++ mod powerpc; ++ pub use self::powerpc::*; ++ } else if #[cfg(target_arch = "powerpc64")] { ++ mod powerpc64; ++ pub use self::powerpc64::*; ++ } else if #[cfg(target_arch = "riscv64")] { ++ mod riscv64; ++ pub use self::riscv64::*; ++ } else if #[cfg(target_arch = "sparc64")] { ++ mod sparc64; ++ pub use self::sparc64::*; ++ } else if #[cfg(target_arch = "x86")] { ++ mod x86; ++ pub use self::x86::*; ++ } else if #[cfg(target_arch = "x86_64")] { ++ mod x86_64; ++ pub use self::x86_64::*; ++ } else { ++ // Unknown target_arch ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/powerpc64.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/powerpc64.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/powerpc64.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/powerpc64.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,9 @@ ++use crate::prelude::*; ++ ++pub type c_long = i64; ++pub type c_ulong = u64; ++pub type c_char = u8; ++ ++pub(crate) const _ALIGNBYTES: usize = mem::size_of::() - 1; ++ ++pub const _MAX_PAGE_SHIFT: u32 = 12; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/powerpc.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/powerpc.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/powerpc.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/powerpc.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,9 @@ ++use crate::prelude::*; ++ ++pub type c_long = i32; ++pub type c_ulong = u32; ++pub type c_char = u8; ++ ++pub(crate) const _ALIGNBYTES: usize = mem::size_of::() - 1; ++ ++pub const _MAX_PAGE_SHIFT: u32 = 12; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/riscv64.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/riscv64.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/riscv64.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/riscv64.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,28 @@ ++use crate::prelude::*; ++ ++pub type c_long = i64; ++pub type c_ulong = u64; ++pub type c_char = u8; ++pub type ucontext_t = sigcontext; ++ ++s! { ++ pub struct sigcontext { ++ __sc_unused: c_int, ++ pub sc_mask: c_int, ++ pub sc_ra: c_long, ++ pub sc_sp: c_long, ++ pub sc_gp: c_long, ++ pub sc_tp: c_long, ++ pub sc_t: [c_long; 7], ++ pub sc_s: [c_long; 12], ++ pub sc_a: [c_long; 8], ++ pub sc_sepc: c_long, ++ pub sc_f: [c_long; 32], ++ pub sc_fcsr: c_long, ++ pub sc_cookie: c_long, ++ } ++} ++ ++pub(crate) const _ALIGNBYTES: usize = mem::size_of::() - 1; ++ ++pub const _MAX_PAGE_SHIFT: u32 = 12; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/sparc64.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/sparc64.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/sparc64.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/sparc64.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,8 @@ ++pub type c_long = i64; ++pub type c_ulong = u64; ++pub type c_char = i8; ++ ++#[doc(hidden)] ++pub const _ALIGNBYTES: usize = 0xf; ++ ++pub const _MAX_PAGE_SHIFT: u32 = 13; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/x86_64.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/x86_64.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/x86_64.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/x86_64.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,128 @@ ++use crate::prelude::*; ++use crate::PT_FIRSTMACH; ++ ++pub type c_long = i64; ++pub type c_ulong = u64; ++pub type c_char = i8; ++pub type ucontext_t = sigcontext; ++ ++s! { ++ pub struct sigcontext { ++ pub sc_rdi: c_long, ++ pub sc_rsi: c_long, ++ pub sc_rdx: c_long, ++ pub sc_rcx: c_long, ++ pub sc_r8: c_long, ++ pub sc_r9: c_long, ++ pub sc_r10: c_long, ++ pub sc_r11: c_long, ++ pub sc_r12: c_long, ++ pub sc_r13: c_long, ++ pub sc_r14: c_long, ++ pub sc_r15: c_long, ++ pub sc_rbp: c_long, ++ pub sc_rbx: c_long, ++ pub sc_rax: c_long, ++ pub sc_gs: c_long, ++ pub sc_fs: c_long, ++ pub sc_es: c_long, ++ pub sc_ds: c_long, ++ pub sc_trapno: c_long, ++ pub sc_err: c_long, ++ pub sc_rip: c_long, ++ pub sc_cs: c_long, ++ pub sc_rflags: c_long, ++ pub sc_rsp: c_long, ++ pub sc_ss: c_long, ++ pub sc_fpstate: *mut fxsave64, ++ __sc_unused: c_int, ++ pub sc_mask: c_int, ++ pub sc_cookie: c_long, ++ } ++} ++ ++s_no_extra_traits! { ++ #[repr(packed)] ++ pub struct fxsave64 { ++ pub fx_fcw: u16, ++ pub fx_fsw: u16, ++ pub fx_ftw: u8, ++ __fx_unused1: u8, ++ pub fx_fop: u16, ++ pub fx_rip: u64, ++ pub fx_rdp: u64, ++ pub fx_mxcsr: u32, ++ pub fx_mxcsr_mask: u32, ++ pub fx_st: [[u64; 2]; 8], ++ pub fx_xmm: [[u64; 2]; 16], ++ __fx_unused3: [u8; 96], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ // `fxsave64` is packed, so field access is unaligned. ++ // use {x} to create temporary storage, copy field to it, and do aligned access. ++ impl PartialEq for fxsave64 { ++ fn eq(&self, other: &fxsave64) -> bool { ++ return { self.fx_fcw } == { other.fx_fcw } ++ && { self.fx_fsw } == { other.fx_fsw } ++ && { self.fx_ftw } == { other.fx_ftw } ++ && { self.fx_fop } == { other.fx_fop } ++ && { self.fx_rip } == { other.fx_rip } ++ && { self.fx_rdp } == { other.fx_rdp } ++ && { self.fx_mxcsr } == { other.fx_mxcsr } ++ && { self.fx_mxcsr_mask } == { other.fx_mxcsr_mask } ++ && { self.fx_st } ++ .iter() ++ .zip({ other.fx_st }.iter()) ++ .all(|(a, b)| a == b) ++ && { self.fx_xmm } ++ .iter() ++ .zip({ other.fx_xmm }.iter()) ++ .all(|(a, b)| a == b); ++ } ++ } ++ impl Eq for fxsave64 {} ++ impl fmt::Debug for fxsave64 { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("fxsave64") ++ .field("fx_fcw", &{ self.fx_fcw }) ++ .field("fx_fsw", &{ self.fx_fsw }) ++ .field("fx_ftw", &{ self.fx_ftw }) ++ .field("fx_fop", &{ self.fx_fop }) ++ .field("fx_rip", &{ self.fx_rip }) ++ .field("fx_rdp", &{ self.fx_rdp }) ++ .field("fx_mxcsr", &{ self.fx_mxcsr }) ++ .field("fx_mxcsr_mask", &{ self.fx_mxcsr_mask }) ++ // FIXME: .field("fx_st", &{self.fx_st}) ++ // FIXME: .field("fx_xmm", &{self.fx_xmm}) ++ .finish() ++ } ++ } ++ impl hash::Hash for fxsave64 { ++ fn hash(&self, state: &mut H) { ++ { self.fx_fcw }.hash(state); ++ { self.fx_fsw }.hash(state); ++ { self.fx_ftw }.hash(state); ++ { self.fx_fop }.hash(state); ++ { self.fx_rip }.hash(state); ++ { self.fx_rdp }.hash(state); ++ { self.fx_mxcsr }.hash(state); ++ { self.fx_mxcsr_mask }.hash(state); ++ { self.fx_st }.hash(state); ++ { self.fx_xmm }.hash(state); ++ } ++ } ++ } ++} ++ ++pub(crate) const _ALIGNBYTES: usize = mem::size_of::() - 1; ++ ++pub const _MAX_PAGE_SHIFT: u32 = 12; ++ ++pub const PT_STEP: c_int = PT_FIRSTMACH + 0; ++pub const PT_GETREGS: c_int = PT_FIRSTMACH + 1; ++pub const PT_SETREGS: c_int = PT_FIRSTMACH + 2; ++pub const PT_GETFPREGS: c_int = PT_FIRSTMACH + 3; ++pub const PT_SETFPREGS: c_int = PT_FIRSTMACH + 4; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/x86.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/x86.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/x86.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/bsd/netbsdlike/openbsd/x86.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,9 @@ ++use crate::prelude::*; ++ ++pub type c_long = i32; ++pub type c_ulong = u32; ++pub type c_char = i8; ++ ++pub(crate) const _ALIGNBYTES: usize = mem::size_of::() - 1; ++ ++pub const _MAX_PAGE_SHIFT: u32 = 12; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/haiku/b32.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/haiku/b32.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/haiku/b32.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/haiku/b32.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,20 @@ ++pub type c_long = i32; ++pub type c_ulong = u32; ++pub type time_t = i32; ++ ++pub type Elf_Addr = crate::Elf32_Addr; ++pub type Elf_Half = crate::Elf32_Half; ++pub type Elf_Phdr = crate::Elf32_Phdr; ++ ++s! { ++ pub struct Elf32_Phdr { ++ pub p_type: crate::Elf32_Word, ++ pub p_offset: crate::Elf32_Off, ++ pub p_vaddr: crate::Elf32_Addr, ++ pub p_paddr: crate::Elf32_Addr, ++ pub p_filesz: crate::Elf32_Word, ++ pub p_memsz: crate::Elf32_Word, ++ pub p_flags: crate::Elf32_Word, ++ pub p_align: crate::Elf32_Word, ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/haiku/b64.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/haiku/b64.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/haiku/b64.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/haiku/b64.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,20 @@ ++pub type c_ulong = u64; ++pub type c_long = i64; ++pub type time_t = i64; ++ ++pub type Elf_Addr = crate::Elf64_Addr; ++pub type Elf_Half = crate::Elf64_Half; ++pub type Elf_Phdr = crate::Elf64_Phdr; ++ ++s! { ++ pub struct Elf64_Phdr { ++ pub p_type: crate::Elf64_Word, ++ pub p_flags: crate::Elf64_Word, ++ pub p_offset: crate::Elf64_Off, ++ pub p_vaddr: crate::Elf64_Addr, ++ pub p_paddr: crate::Elf64_Addr, ++ pub p_filesz: crate::Elf64_Xword, ++ pub p_memsz: crate::Elf64_Xword, ++ pub p_align: crate::Elf64_Xword, ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/haiku/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/haiku/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/haiku/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/haiku/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,2179 @@ ++use crate::prelude::*; ++ ++pub type rlim_t = crate::uintptr_t; ++pub type sa_family_t = u8; ++pub type pthread_key_t = c_int; ++pub type nfds_t = c_ulong; ++pub type tcflag_t = c_uint; ++pub type speed_t = c_uchar; ++pub type c_char = i8; ++pub type clock_t = i32; ++pub type clockid_t = i32; ++pub type suseconds_t = i32; ++pub type wchar_t = i32; ++pub type off_t = i64; ++pub type ino_t = i64; ++pub type blkcnt_t = i64; ++pub type blksize_t = i32; ++pub type dev_t = i32; ++pub type mode_t = u32; ++pub type nlink_t = i32; ++pub type useconds_t = u32; ++pub type socklen_t = u32; ++pub type pthread_t = crate::uintptr_t; ++pub type pthread_condattr_t = crate::uintptr_t; ++pub type pthread_mutexattr_t = crate::uintptr_t; ++pub type pthread_rwlockattr_t = crate::uintptr_t; ++pub type sigset_t = u64; ++pub type fsblkcnt_t = i64; ++pub type fsfilcnt_t = i64; ++pub type pthread_attr_t = *mut c_void; ++pub type nl_item = c_int; ++pub type id_t = i32; ++pub type idtype_t = c_int; ++pub type fd_mask = u32; ++pub type regoff_t = c_int; ++pub type key_t = i32; ++pub type msgqnum_t = u32; ++pub type msglen_t = u32; ++ ++pub type Elf32_Addr = u32; ++pub type Elf32_Half = u16; ++pub type Elf32_Off = u32; ++pub type Elf32_Sword = i32; ++pub type Elf32_Word = u32; ++ ++pub type Elf64_Addr = u64; ++pub type Elf64_Half = u16; ++pub type Elf64_Off = u64; ++pub type Elf64_Sword = i32; ++pub type Elf64_Sxword = i64; ++pub type Elf64_Word = u32; ++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; ++ ++pub type StringList = _stringlist; ++ ++#[cfg_attr(feature = "extra_traits", derive(Debug))] ++pub enum timezone {} ++impl Copy for timezone {} ++impl Clone for timezone { ++ fn clone(&self) -> timezone { ++ *self ++ } ++} ++ ++impl siginfo_t { ++ pub unsafe fn si_addr(&self) -> *mut c_void { ++ self.si_addr ++ } ++ ++ pub unsafe fn si_pid(&self) -> crate::pid_t { ++ self.si_pid ++ } ++ ++ pub unsafe fn si_uid(&self) -> crate::uid_t { ++ self.si_uid ++ } ++ ++ pub unsafe fn si_status(&self) -> c_int { ++ self.si_status ++ } ++} ++ ++s! { ++ pub struct in_addr { ++ pub s_addr: crate::in_addr_t, ++ } ++ ++ pub struct ip_mreq { ++ pub imr_multiaddr: in_addr, ++ pub imr_interface: in_addr, ++ } ++ ++ pub struct sockaddr { ++ pub sa_len: u8, ++ pub sa_family: sa_family_t, ++ pub sa_data: [u8; 30], ++ } ++ ++ pub struct sockaddr_in { ++ pub sin_len: u8, ++ pub sin_family: sa_family_t, ++ pub sin_port: crate::in_port_t, ++ pub sin_addr: crate::in_addr, ++ pub sin_zero: [i8; 24], ++ } ++ ++ pub struct sockaddr_in6 { ++ pub sin6_len: u8, ++ pub sin6_family: u8, ++ pub sin6_port: u16, ++ pub sin6_flowinfo: u32, ++ pub sin6_addr: crate::in6_addr, ++ pub sin6_scope_id: u32, ++ } ++ ++ pub struct addrinfo { ++ pub ai_flags: c_int, ++ pub ai_family: c_int, ++ pub ai_socktype: c_int, ++ pub ai_protocol: c_int, ++ pub ai_addrlen: socklen_t, ++ pub ai_canonname: *mut c_char, ++ pub ai_addr: *mut crate::sockaddr, ++ pub ai_next: *mut addrinfo, ++ } ++ ++ pub struct ifaddrs { ++ pub ifa_next: *mut ifaddrs, ++ pub ifa_name: *const c_char, ++ pub ifa_flags: c_uint, ++ pub ifa_addr: *mut crate::sockaddr, ++ pub ifa_netmask: *mut crate::sockaddr, ++ pub ifa_dstaddr: *mut crate::sockaddr, ++ pub ifa_data: *mut c_void, ++ } ++ ++ pub struct fd_set { ++ // size for 1024 bits, and a fd_mask with size u32 ++ fds_bits: [fd_mask; 32], ++ } ++ ++ pub struct tm { ++ pub tm_sec: c_int, ++ pub tm_min: c_int, ++ pub tm_hour: c_int, ++ pub tm_mday: c_int, ++ pub tm_mon: c_int, ++ pub tm_year: c_int, ++ pub tm_wday: c_int, ++ pub tm_yday: c_int, ++ pub tm_isdst: c_int, ++ pub tm_gmtoff: c_int, ++ pub tm_zone: *mut c_char, ++ } ++ ++ pub struct utsname { ++ pub sysname: [c_char; 32], ++ pub nodename: [c_char; 32], ++ pub release: [c_char; 32], ++ pub version: [c_char; 32], ++ pub machine: [c_char; 32], ++ } ++ ++ pub struct lconv { ++ pub decimal_point: *mut c_char, ++ pub thousands_sep: *mut c_char, ++ pub grouping: *mut c_char, ++ pub int_curr_symbol: *mut c_char, ++ pub currency_symbol: *mut c_char, ++ pub mon_decimal_point: *mut c_char, ++ pub mon_thousands_sep: *mut c_char, ++ pub mon_grouping: *mut c_char, ++ pub positive_sign: *mut c_char, ++ pub negative_sign: *mut c_char, ++ pub int_frac_digits: c_char, ++ pub frac_digits: c_char, ++ pub p_cs_precedes: c_char, ++ pub p_sep_by_space: c_char, ++ pub n_cs_precedes: c_char, ++ pub n_sep_by_space: c_char, ++ pub p_sign_posn: c_char, ++ pub n_sign_posn: c_char, ++ pub int_p_cs_precedes: c_char, ++ pub int_p_sep_by_space: c_char, ++ pub int_n_cs_precedes: c_char, ++ pub int_n_sep_by_space: c_char, ++ pub int_p_sign_posn: c_char, ++ pub int_n_sign_posn: c_char, ++ } ++ ++ pub struct msghdr { ++ pub msg_name: *mut c_void, ++ pub msg_namelen: socklen_t, ++ pub msg_iov: *mut crate::iovec, ++ pub msg_iovlen: c_int, ++ pub msg_control: *mut c_void, ++ pub msg_controllen: socklen_t, ++ pub msg_flags: c_int, ++ } ++ ++ pub struct cmsghdr { ++ pub cmsg_len: crate::socklen_t, ++ pub cmsg_level: c_int, ++ pub cmsg_type: c_int, ++ } ++ ++ pub struct Dl_info { ++ pub dli_fname: *const c_char, ++ pub dli_fbase: *mut c_void, ++ pub dli_sname: *const c_char, ++ pub dli_saddr: *mut c_void, ++ } ++ ++ pub struct termios { ++ pub c_iflag: crate::tcflag_t, ++ pub c_oflag: crate::tcflag_t, ++ pub c_cflag: crate::tcflag_t, ++ pub c_lflag: crate::tcflag_t, ++ pub c_line: c_char, ++ pub c_ispeed: crate::speed_t, ++ pub c_ospeed: crate::speed_t, ++ pub c_cc: [crate::cc_t; crate::NCCS], ++ } ++ ++ pub struct flock { ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ pub l_start: off_t, ++ pub l_len: off_t, ++ pub l_pid: crate::pid_t, ++ } ++ ++ pub struct stat { ++ pub st_dev: dev_t, ++ pub st_ino: ino_t, ++ pub st_mode: mode_t, ++ pub st_nlink: nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_size: off_t, ++ pub st_rdev: dev_t, ++ pub st_blksize: blksize_t, ++ pub st_atime: time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: time_t, ++ pub st_ctime_nsec: c_long, ++ pub st_crtime: time_t, ++ pub st_crtime_nsec: c_long, ++ pub st_type: u32, ++ pub st_blocks: blkcnt_t, ++ } ++ ++ pub struct glob_t { ++ pub gl_pathc: size_t, ++ __unused1: size_t, ++ pub gl_offs: size_t, ++ __unused2: size_t, ++ pub gl_pathv: *mut *mut c_char, ++ ++ __unused3: *mut c_void, ++ __unused4: *mut c_void, ++ __unused5: *mut c_void, ++ __unused6: *mut c_void, ++ __unused7: *mut c_void, ++ __unused8: *mut c_void, ++ } ++ ++ pub struct pthread_mutex_t { ++ flags: u32, ++ lock: i32, ++ unused: i32, ++ owner: i32, ++ owner_count: i32, ++ } ++ ++ pub struct pthread_cond_t { ++ flags: u32, ++ unused: i32, ++ mutex: *mut c_void, ++ waiter_count: i32, ++ lock: i32, ++ } ++ ++ pub struct pthread_rwlock_t { ++ flags: u32, ++ owner: i32, ++ lock_sem: i32, // this is actually a union ++ lock_count: i32, ++ reader_count: i32, ++ writer_count: i32, ++ waiters: [*mut c_void; 2], ++ } ++ ++ pub struct pthread_spinlock_t { ++ lock: u32, ++ } ++ ++ pub struct passwd { ++ pub pw_name: *mut c_char, ++ pub pw_passwd: *mut c_char, ++ pub pw_uid: crate::uid_t, ++ pub pw_gid: crate::gid_t, ++ pub pw_dir: *mut c_char, ++ pub pw_shell: *mut c_char, ++ pub pw_gecos: *mut c_char, ++ } ++ ++ pub struct statvfs { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_favail: crate::fsfilcnt_t, ++ pub f_fsid: c_ulong, ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ } ++ ++ pub struct stack_t { ++ pub ss_sp: *mut c_void, ++ pub ss_size: size_t, ++ pub ss_flags: c_int, ++ } ++ ++ pub struct siginfo_t { ++ pub si_signo: c_int, ++ pub si_code: c_int, ++ pub si_errno: c_int, ++ pub si_pid: crate::pid_t, ++ pub si_uid: crate::uid_t, ++ pub si_addr: *mut c_void, ++ pub si_status: c_int, ++ pub si_band: c_long, ++ pub sigval: *mut c_void, ++ } ++ ++ pub struct sigaction { ++ pub sa_sigaction: crate::sighandler_t, //actually a union with sa_handler ++ pub sa_mask: crate::sigset_t, ++ pub sa_flags: c_int, ++ sa_userdata: *mut c_void, ++ } ++ ++ pub struct sem_t { ++ pub type_: i32, ++ pub named_sem_id: i32, // actually a union with unnamed_sem (i32) ++ pub padding: [i32; 2], ++ } ++ ++ pub struct ucred { ++ pub pid: crate::pid_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ } ++ ++ pub struct sockaddr_dl { ++ pub sdl_len: u8, ++ pub sdl_family: u8, ++ pub sdl_e_type: u16, ++ pub sdl_index: u32, ++ pub sdl_type: u8, ++ pub sdl_nlen: u8, ++ pub sdl_alen: u8, ++ pub sdl_slen: u8, ++ pub sdl_data: [u8; 46], ++ } ++ ++ pub struct spwd { ++ pub sp_namp: *mut c_char, ++ pub sp_pwdp: *mut c_char, ++ pub sp_lstchg: c_int, ++ pub sp_min: c_int, ++ pub sp_max: c_int, ++ pub sp_warn: c_int, ++ pub sp_inact: c_int, ++ pub sp_expire: c_int, ++ pub sp_flag: c_int, ++ } ++ ++ pub struct regex_t { ++ __buffer: *mut c_void, ++ __allocated: size_t, ++ __used: size_t, ++ __syntax: c_ulong, ++ __fastmap: *mut c_char, ++ __translate: *mut c_char, ++ __re_nsub: size_t, ++ __bitfield: u8, ++ } ++ ++ pub struct regmatch_t { ++ pub rm_so: regoff_t, ++ pub rm_eo: regoff_t, ++ } ++ ++ pub struct msqid_ds { ++ pub msg_perm: crate::ipc_perm, ++ pub msg_qnum: crate::msgqnum_t, ++ pub msg_qbytes: crate::msglen_t, ++ pub msg_lspid: crate::pid_t, ++ pub msg_lrpid: crate::pid_t, ++ pub msg_stime: crate::time_t, ++ pub msg_rtime: crate::time_t, ++ pub msg_ctime: crate::time_t, ++ } ++ ++ pub struct ipc_perm { ++ pub key: crate::key_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub cuid: crate::uid_t, ++ pub cgid: crate::gid_t, ++ pub mode: crate::mode_t, ++ } ++ ++ pub struct sembuf { ++ pub sem_num: c_ushort, ++ pub sem_op: c_short, ++ pub sem_flg: c_short, ++ } ++ ++ pub struct entry { ++ pub key: *mut c_char, ++ pub data: *mut c_void, ++ } ++ ++ pub struct option { ++ pub name: *const c_char, ++ pub has_arg: c_int, ++ pub flag: *mut c_int, ++ pub val: c_int, ++ } ++ ++ pub struct _stringlist { ++ pub sl_str: *mut *mut c_char, ++ pub sl_max: size_t, ++ pub sl_cur: size_t, ++ } ++ ++ pub struct dl_phdr_info { ++ pub dlpi_addr: crate::Elf_Addr, ++ pub dlpi_name: *const c_char, ++ pub dlpi_phdr: *const crate::Elf_Phdr, ++ pub dlpi_phnum: crate::Elf_Half, ++ } ++} ++ ++s_no_extra_traits! { ++ pub struct sockaddr_un { ++ pub sun_len: u8, ++ pub sun_family: sa_family_t, ++ pub sun_path: [c_char; 126], ++ } ++ pub struct sockaddr_storage { ++ pub ss_len: u8, ++ pub ss_family: sa_family_t, ++ __ss_pad1: [u8; 6], ++ __ss_pad2: u64, ++ __ss_pad3: [u8; 112], ++ } ++ pub struct dirent { ++ pub d_dev: dev_t, ++ pub d_pdev: dev_t, ++ pub d_ino: ino_t, ++ pub d_pino: i64, ++ pub d_reclen: c_ushort, ++ pub d_name: [c_char; 1024], // Max length is _POSIX_PATH_MAX ++ } ++ ++ pub struct sigevent { ++ pub sigev_notify: c_int, ++ pub sigev_signo: c_int, ++ pub sigev_value: crate::sigval, ++ __unused1: *mut c_void, // actually a function pointer ++ pub sigev_notify_attributes: *mut crate::pthread_attr_t, ++ } ++ ++ pub struct utmpx { ++ pub ut_type: c_short, ++ pub ut_tv: crate::timeval, ++ pub ut_id: [c_char; 8], ++ pub ut_pid: crate::pid_t, ++ pub ut_user: [c_char; 32], ++ pub ut_line: [c_char; 16], ++ pub ut_host: [c_char; 128], ++ __ut_reserved: [c_char; 64], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for utmpx { ++ fn eq(&self, other: &utmpx) -> bool { ++ self.ut_type == other.ut_type ++ && self.ut_tv == other.ut_tv ++ && self.ut_id == other.ut_id ++ && self.ut_pid == other.ut_pid ++ && self.ut_user == other.ut_user ++ && self.ut_line == other.ut_line ++ && self ++ .ut_host ++ .iter() ++ .zip(other.ut_host.iter()) ++ .all(|(a, b)| a == b) ++ && self.__ut_reserved == other.__ut_reserved ++ } ++ } ++ ++ impl Eq for utmpx {} ++ ++ impl fmt::Debug for utmpx { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("utmpx") ++ .field("ut_type", &self.ut_type) ++ .field("ut_tv", &self.ut_tv) ++ .field("ut_id", &self.ut_id) ++ .field("ut_pid", &self.ut_pid) ++ .field("ut_user", &self.ut_user) ++ .field("ut_line", &self.ut_line) ++ .field("ut_host", &self.ut_host) ++ .field("__ut_reserved", &self.__ut_reserved) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for utmpx { ++ fn hash(&self, state: &mut H) { ++ self.ut_type.hash(state); ++ self.ut_tv.hash(state); ++ self.ut_id.hash(state); ++ self.ut_pid.hash(state); ++ self.ut_user.hash(state); ++ self.ut_line.hash(state); ++ self.ut_host.hash(state); ++ self.__ut_reserved.hash(state); ++ } ++ } ++ impl PartialEq for sockaddr_un { ++ fn eq(&self, other: &sockaddr_un) -> bool { ++ self.sun_len == other.sun_len ++ && self.sun_family == other.sun_family ++ && self ++ .sun_path ++ .iter() ++ .zip(other.sun_path.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for sockaddr_un {} ++ impl fmt::Debug for sockaddr_un { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sockaddr_un") ++ .field("sun_len", &self.sun_len) ++ .field("sun_family", &self.sun_family) ++ // FIXME: .field("sun_path", &self.sun_path) ++ .finish() ++ } ++ } ++ impl hash::Hash for sockaddr_un { ++ fn hash(&self, state: &mut H) { ++ self.sun_len.hash(state); ++ self.sun_family.hash(state); ++ self.sun_path.hash(state); ++ } ++ } ++ ++ impl PartialEq for sockaddr_storage { ++ fn eq(&self, other: &sockaddr_storage) -> bool { ++ self.ss_len == other.ss_len ++ && self.ss_family == other.ss_family ++ && self ++ .__ss_pad1 ++ .iter() ++ .zip(other.__ss_pad1.iter()) ++ .all(|(a, b)| a == b) ++ && self.__ss_pad2 == other.__ss_pad2 ++ && self ++ .__ss_pad3 ++ .iter() ++ .zip(other.__ss_pad3.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for sockaddr_storage {} ++ impl fmt::Debug for sockaddr_storage { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sockaddr_storage") ++ .field("ss_len", &self.ss_len) ++ .field("ss_family", &self.ss_family) ++ .field("__ss_pad1", &self.__ss_pad1) ++ .field("__ss_pad2", &self.__ss_pad2) ++ // FIXME: .field("__ss_pad3", &self.__ss_pad3) ++ .finish() ++ } ++ } ++ impl hash::Hash for sockaddr_storage { ++ fn hash(&self, state: &mut H) { ++ self.ss_len.hash(state); ++ self.ss_family.hash(state); ++ self.__ss_pad1.hash(state); ++ self.__ss_pad2.hash(state); ++ self.__ss_pad3.hash(state); ++ } ++ } ++ ++ impl PartialEq for dirent { ++ fn eq(&self, other: &dirent) -> bool { ++ self.d_dev == other.d_dev ++ && self.d_pdev == other.d_pdev ++ && self.d_ino == other.d_ino ++ && self.d_pino == other.d_pino ++ && self.d_reclen == other.d_reclen ++ && self ++ .d_name ++ .iter() ++ .zip(other.d_name.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for dirent {} ++ impl fmt::Debug for dirent { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("dirent") ++ .field("d_dev", &self.d_dev) ++ .field("d_pdev", &self.d_pdev) ++ .field("d_ino", &self.d_ino) ++ .field("d_pino", &self.d_pino) ++ .field("d_reclen", &self.d_reclen) ++ // FIXME: .field("d_name", &self.d_name) ++ .finish() ++ } ++ } ++ impl hash::Hash for dirent { ++ fn hash(&self, state: &mut H) { ++ self.d_dev.hash(state); ++ self.d_pdev.hash(state); ++ self.d_ino.hash(state); ++ self.d_pino.hash(state); ++ self.d_reclen.hash(state); ++ self.d_name.hash(state); ++ } ++ } ++ ++ impl PartialEq for sigevent { ++ fn eq(&self, other: &sigevent) -> bool { ++ self.sigev_notify == other.sigev_notify ++ && self.sigev_signo == other.sigev_signo ++ && self.sigev_value == other.sigev_value ++ && self.sigev_notify_attributes == other.sigev_notify_attributes ++ } ++ } ++ impl Eq for sigevent {} ++ impl fmt::Debug for sigevent { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sigevent") ++ .field("sigev_notify", &self.sigev_notify) ++ .field("sigev_signo", &self.sigev_signo) ++ .field("sigev_value", &self.sigev_value) ++ .field("sigev_notify_attributes", &self.sigev_notify_attributes) ++ .finish() ++ } ++ } ++ impl hash::Hash for sigevent { ++ fn hash(&self, state: &mut H) { ++ self.sigev_notify.hash(state); ++ self.sigev_signo.hash(state); ++ self.sigev_value.hash(state); ++ self.sigev_notify_attributes.hash(state); ++ } ++ } ++ } ++} ++ ++pub const EXIT_FAILURE: c_int = 1; ++pub const EXIT_SUCCESS: c_int = 0; ++pub const RAND_MAX: c_int = 2147483647; ++pub const EOF: c_int = -1; ++pub const SEEK_SET: c_int = 0; ++pub const SEEK_CUR: c_int = 1; ++pub const SEEK_END: c_int = 2; ++pub const L_SET: c_int = SEEK_SET; ++pub const L_INCR: c_int = SEEK_CUR; ++pub const L_XTND: c_int = SEEK_END; ++pub const _IOFBF: c_int = 0; ++pub const _IONBF: c_int = 2; ++pub const _IOLBF: c_int = 1; ++ ++pub const F_DUPFD: c_int = 0x0001; ++pub const F_GETFD: c_int = 0x0002; ++pub const F_SETFD: c_int = 0x0004; ++pub const F_GETFL: c_int = 0x0008; ++pub const F_SETFL: c_int = 0x0010; ++pub const F_GETLK: c_int = 0x0020; ++pub const F_SETLK: c_int = 0x0080; ++pub const F_SETLKW: c_int = 0x0100; ++pub const F_DUPFD_CLOEXEC: c_int = 0x0200; ++ ++pub const F_RDLCK: c_int = 0x0040; ++pub const F_UNLCK: c_int = 0x0200; ++pub const F_WRLCK: c_int = 0x0400; ++ ++pub const AT_FDCWD: c_int = -100; ++pub const AT_SYMLINK_NOFOLLOW: c_int = 0x01; ++pub const AT_SYMLINK_FOLLOW: c_int = 0x02; ++pub const AT_REMOVEDIR: c_int = 0x04; ++pub const AT_EACCESS: c_int = 0x08; ++ ++pub const POLLIN: c_short = 0x0001; ++pub const POLLOUT: c_short = 0x0002; ++pub const POLLRDNORM: c_short = POLLIN; ++pub const POLLWRNORM: c_short = POLLOUT; ++pub const POLLRDBAND: c_short = 0x0008; ++pub const POLLWRBAND: c_short = 0x0010; ++pub const POLLPRI: c_short = 0x0020; ++pub const POLLERR: c_short = 0x0004; ++pub const POLLHUP: c_short = 0x0080; ++pub const POLLNVAL: c_short = 0x1000; ++ ++pub const PTHREAD_CREATE_JOINABLE: c_int = 0; ++pub const PTHREAD_CREATE_DETACHED: c_int = 1; ++ ++pub const CLOCK_REALTIME: c_int = -1; ++pub const CLOCK_MONOTONIC: c_int = 0; ++pub const CLOCK_PROCESS_CPUTIME_ID: c_int = -2; ++pub const CLOCK_THREAD_CPUTIME_ID: c_int = -3; ++ ++pub const RLIMIT_CORE: c_int = 0; ++pub const RLIMIT_CPU: c_int = 1; ++pub const RLIMIT_DATA: c_int = 2; ++pub const RLIMIT_FSIZE: c_int = 3; ++pub const RLIMIT_NOFILE: c_int = 4; ++pub const RLIMIT_STACK: c_int = 5; ++pub const RLIMIT_AS: c_int = 6; ++pub const RLIM_INFINITY: crate::rlim_t = 0xffffffff; ++// Haiku specific ++pub const RLIMIT_NOVMON: c_int = 7; ++#[deprecated(since = "0.2.64", note = "Not stable across OS versions")] ++pub const RLIM_NLIMITS: c_int = 8; ++ ++pub const RUSAGE_SELF: c_int = 0; ++ ++pub const RTLD_LAZY: c_int = 0; ++ ++pub const NCCS: usize = 11; ++ ++pub const O_RDONLY: c_int = 0x0000; ++pub const O_WRONLY: c_int = 0x0001; ++pub const O_RDWR: c_int = 0x0002; ++pub const O_ACCMODE: c_int = 0x0003; ++ ++pub const O_EXCL: c_int = 0x0100; ++pub const O_CREAT: c_int = 0x0200; ++pub const O_TRUNC: c_int = 0x0400; ++pub const O_NOCTTY: c_int = 0x1000; ++pub const O_NOTRAVERSE: c_int = 0x2000; ++ ++pub const O_CLOEXEC: c_int = 0x00000040; ++pub const O_NONBLOCK: c_int = 0x00000080; ++pub const O_APPEND: c_int = 0x00000800; ++pub const O_SYNC: c_int = 0x00010000; ++pub const O_RSYNC: c_int = 0x00020000; ++pub const O_DSYNC: c_int = 0x00040000; ++pub const O_NOFOLLOW: c_int = 0x00080000; ++pub const O_NOCACHE: c_int = 0x00100000; ++pub const O_DIRECTORY: c_int = 0x00200000; ++ ++pub const S_IFIFO: crate::mode_t = 0o1_0000; ++pub const S_IFCHR: crate::mode_t = 0o2_0000; ++pub const S_IFBLK: crate::mode_t = 0o6_0000; ++pub const S_IFDIR: crate::mode_t = 0o4_0000; ++pub const S_IFREG: crate::mode_t = 0o10_0000; ++pub const S_IFLNK: crate::mode_t = 0o12_0000; ++pub const S_IFSOCK: crate::mode_t = 0o14_0000; ++pub const S_IFMT: crate::mode_t = 0o17_0000; ++ ++pub const S_IRWXU: crate::mode_t = 0o0700; ++pub const S_IRUSR: crate::mode_t = 0o0400; ++pub const S_IWUSR: crate::mode_t = 0o0200; ++pub const S_IXUSR: crate::mode_t = 0o0100; ++pub const S_IRWXG: crate::mode_t = 0o0070; ++pub const S_IRGRP: crate::mode_t = 0o0040; ++pub const S_IWGRP: crate::mode_t = 0o0020; ++pub const S_IXGRP: crate::mode_t = 0o0010; ++pub const S_IRWXO: crate::mode_t = 0o0007; ++pub const S_IROTH: crate::mode_t = 0o0004; ++pub const S_IWOTH: crate::mode_t = 0o0002; ++pub const S_IXOTH: crate::mode_t = 0o0001; ++ ++pub const F_OK: c_int = 0; ++pub const R_OK: c_int = 4; ++pub const W_OK: c_int = 2; ++pub const X_OK: c_int = 1; ++pub const STDIN_FILENO: c_int = 0; ++pub const STDOUT_FILENO: c_int = 1; ++pub const STDERR_FILENO: c_int = 2; ++ ++pub const SIGHUP: c_int = 1; ++pub const SIGINT: c_int = 2; ++pub const SIGQUIT: c_int = 3; ++pub const SIGILL: c_int = 4; ++pub const SIGCHLD: c_int = 5; ++pub const SIGABRT: c_int = 6; ++pub const SIGPIPE: c_int = 7; ++pub const SIGFPE: c_int = 8; ++pub const SIGKILL: c_int = 9; ++pub const SIGSTOP: c_int = 10; ++pub const SIGSEGV: c_int = 11; ++pub const SIGCONT: c_int = 12; ++pub const SIGTSTP: c_int = 13; ++pub const SIGALRM: c_int = 14; ++pub const SIGTERM: c_int = 15; ++pub const SIGTTIN: c_int = 16; ++pub const SIGTTOU: c_int = 17; ++pub const SIGUSR1: c_int = 18; ++pub const SIGUSR2: c_int = 19; ++pub const SIGWINCH: c_int = 20; ++pub const SIGKILLTHR: c_int = 21; ++pub const SIGTRAP: c_int = 22; ++pub const SIGPOLL: c_int = 23; ++pub const SIGPROF: c_int = 24; ++pub const SIGSYS: c_int = 25; ++pub const SIGURG: c_int = 26; ++pub const SIGVTALRM: c_int = 27; ++pub const SIGXCPU: c_int = 28; ++pub const SIGXFSZ: c_int = 29; ++pub const SIGBUS: c_int = 30; ++ ++pub const SIG_BLOCK: c_int = 1; ++pub const SIG_UNBLOCK: c_int = 2; ++pub const SIG_SETMASK: c_int = 3; ++ ++pub const SIGEV_NONE: c_int = 0; ++pub const SIGEV_SIGNAL: c_int = 1; ++pub const SIGEV_THREAD: c_int = 2; ++ ++pub const EAI_AGAIN: c_int = 2; ++pub const EAI_BADFLAGS: c_int = 3; ++pub const EAI_FAIL: c_int = 4; ++pub const EAI_FAMILY: c_int = 5; ++pub const EAI_MEMORY: c_int = 6; ++pub const EAI_NODATA: c_int = 7; ++pub const EAI_NONAME: c_int = 8; ++pub const EAI_SERVICE: c_int = 9; ++pub const EAI_SOCKTYPE: c_int = 10; ++pub const EAI_SYSTEM: c_int = 11; ++pub const EAI_OVERFLOW: c_int = 14; ++ ++pub const PROT_NONE: c_int = 0; ++pub const PROT_READ: c_int = 1; ++pub const PROT_WRITE: c_int = 2; ++pub const PROT_EXEC: c_int = 4; ++ ++pub const LC_ALL: c_int = 0; ++pub const LC_COLLATE: c_int = 1; ++pub const LC_CTYPE: c_int = 2; ++pub const LC_MONETARY: c_int = 3; ++pub const LC_NUMERIC: c_int = 4; ++pub const LC_TIME: c_int = 5; ++pub const LC_MESSAGES: c_int = 6; ++ ++// FIXME: Haiku does not have MAP_FILE, but library/std/os.rs requires it ++pub const MAP_FILE: c_int = 0x00; ++pub const MAP_SHARED: c_int = 0x01; ++pub const MAP_PRIVATE: c_int = 0x02; ++pub const MAP_FIXED: c_int = 0x04; ++pub const MAP_ANONYMOUS: c_int = 0x08; ++pub const MAP_NORESERVE: c_int = 0x10; ++pub const MAP_ANON: c_int = MAP_ANONYMOUS; ++ ++pub const MAP_FAILED: *mut c_void = !0 as *mut c_void; ++ ++pub const MS_ASYNC: c_int = 0x01; ++pub const MS_INVALIDATE: c_int = 0x04; ++pub const MS_SYNC: c_int = 0x02; ++ ++pub const E2BIG: c_int = -2147454975; ++pub const ECHILD: c_int = -2147454974; ++pub const EDEADLK: c_int = -2147454973; ++pub const EFBIG: c_int = -2147454972; ++pub const EMLINK: c_int = -2147454971; ++pub const ENFILE: c_int = -2147454970; ++pub const ENODEV: c_int = -2147454969; ++pub const ENOLCK: c_int = -2147454968; ++pub const ENOSYS: c_int = -2147454967; ++pub const ENOTTY: c_int = -2147454966; ++pub const ENXIO: c_int = -2147454965; ++pub const ESPIPE: c_int = -2147454964; ++pub const ESRCH: c_int = -2147454963; ++pub const EFPOS: c_int = -2147454962; ++pub const ESIGPARM: c_int = -2147454961; ++pub const EDOM: c_int = -2147454960; ++pub const ERANGE: c_int = -2147454959; ++pub const EPROTOTYPE: c_int = -2147454958; ++pub const EPROTONOSUPPORT: c_int = -2147454957; ++pub const EPFNOSUPPORT: c_int = -2147454956; ++pub const EAFNOSUPPORT: c_int = -2147454955; ++pub const EADDRINUSE: c_int = -2147454954; ++pub const EADDRNOTAVAIL: c_int = -2147454953; ++pub const ENETDOWN: c_int = -2147454952; ++pub const ENETUNREACH: c_int = -2147454951; ++pub const ENETRESET: c_int = -2147454950; ++pub const ECONNABORTED: c_int = -2147454949; ++pub const ECONNRESET: c_int = -2147454948; ++pub const EISCONN: c_int = -2147454947; ++pub const ENOTCONN: c_int = -2147454946; ++pub const ESHUTDOWN: c_int = -2147454945; ++pub const ECONNREFUSED: c_int = -2147454944; ++pub const EHOSTUNREACH: c_int = -2147454943; ++pub const ENOPROTOOPT: c_int = -2147454942; ++pub const ENOBUFS: c_int = -2147454941; ++pub const EINPROGRESS: c_int = -2147454940; ++pub const EALREADY: c_int = -2147454939; ++pub const EILSEQ: c_int = -2147454938; ++pub const ENOMSG: c_int = -2147454937; ++pub const ESTALE: c_int = -2147454936; ++pub const EOVERFLOW: c_int = -2147454935; ++pub const EMSGSIZE: c_int = -2147454934; ++pub const EOPNOTSUPP: c_int = -2147454933; ++pub const ENOTSOCK: c_int = -2147454932; ++pub const EHOSTDOWN: c_int = -2147454931; ++pub const EBADMSG: c_int = -2147454930; ++pub const ECANCELED: c_int = -2147454929; ++pub const EDESTADDRREQ: c_int = -2147454928; ++pub const EDQUOT: c_int = -2147454927; ++pub const EIDRM: c_int = -2147454926; ++pub const EMULTIHOP: c_int = -2147454925; ++pub const ENODATA: c_int = -2147454924; ++pub const ENOLINK: c_int = -2147454923; ++pub const ENOSR: c_int = -2147454922; ++pub const ENOSTR: c_int = -2147454921; ++pub const ENOTSUP: c_int = -2147454920; ++pub const EPROTO: c_int = -2147454919; ++pub const ETIME: c_int = -2147454918; ++pub const ETXTBSY: c_int = -2147454917; ++pub const ENOATTR: c_int = -2147454916; ++ ++// INT_MIN ++pub const ENOMEM: c_int = -2147483648; ++ ++// POSIX errors that can be mapped to BeOS error codes ++pub const EACCES: c_int = -2147483646; ++pub const EINTR: c_int = -2147483638; ++pub const EIO: c_int = -2147483647; ++pub const EBUSY: c_int = -2147483634; ++pub const EFAULT: c_int = -2147478783; ++pub const ETIMEDOUT: c_int = -2147483639; ++pub const EAGAIN: c_int = -2147483637; ++pub const EWOULDBLOCK: c_int = -2147483637; ++pub const EBADF: c_int = -2147459072; ++pub const EEXIST: c_int = -2147459070; ++pub const EINVAL: c_int = -2147483643; ++pub const ENAMETOOLONG: c_int = -2147459068; ++pub const ENOENT: c_int = -2147459069; ++pub const EPERM: c_int = -2147483633; ++pub const ENOTDIR: c_int = -2147459067; ++pub const EISDIR: c_int = -2147459063; ++pub const ENOTEMPTY: c_int = -2147459066; ++pub const ENOSPC: c_int = -2147459065; ++pub const EROFS: c_int = -2147459064; ++pub const EMFILE: c_int = -2147459062; ++pub const EXDEV: c_int = -2147459061; ++pub const ELOOP: c_int = -2147459060; ++pub const ENOEXEC: c_int = -2147478782; ++pub const EPIPE: c_int = -2147459059; ++ ++pub const IPPROTO_RAW: c_int = 255; ++ ++// These are prefixed with POSIX_ on Haiku ++pub const MADV_NORMAL: c_int = 1; ++pub const MADV_SEQUENTIAL: c_int = 2; ++pub const MADV_RANDOM: c_int = 3; ++pub const MADV_WILLNEED: c_int = 4; ++pub const MADV_DONTNEED: c_int = 5; ++pub const MADV_FREE: c_int = 6; ++ ++// https://github.com/haiku/haiku/blob/HEAD/headers/posix/net/if.h#L80 ++pub const IFF_UP: c_int = 0x0001; ++pub const IFF_BROADCAST: c_int = 0x0002; // valid broadcast address ++pub const IFF_LOOPBACK: c_int = 0x0008; ++pub const IFF_POINTOPOINT: c_int = 0x0010; // point-to-point link ++pub const IFF_NOARP: c_int = 0x0040; // no address resolution ++pub const IFF_AUTOUP: c_int = 0x0080; // auto dial ++pub const IFF_PROMISC: c_int = 0x0100; // receive all packets ++pub const IFF_ALLMULTI: c_int = 0x0200; // receive all multicast packets ++pub const IFF_SIMPLEX: c_int = 0x0800; // doesn't receive own transmissions ++pub const IFF_LINK: c_int = 0x1000; // has link ++pub const IFF_AUTO_CONFIGURED: c_int = 0x2000; ++pub const IFF_CONFIGURING: c_int = 0x4000; ++pub const IFF_MULTICAST: c_int = 0x8000; // supports multicast ++ ++pub const AF_UNSPEC: c_int = 0; ++pub const AF_INET: c_int = 1; ++pub const AF_APPLETALK: c_int = 2; ++pub const AF_ROUTE: c_int = 3; ++pub const AF_LINK: c_int = 4; ++pub const AF_INET6: c_int = 5; ++pub const AF_DLI: c_int = 6; ++pub const AF_IPX: c_int = 7; ++pub const AF_NOTIFY: c_int = 8; ++pub const AF_LOCAL: c_int = 9; ++pub const AF_UNIX: c_int = AF_LOCAL; ++pub const AF_BLUETOOTH: c_int = 10; ++ ++pub const PF_UNSPEC: c_int = AF_UNSPEC; ++pub const PF_INET: c_int = AF_INET; ++pub const PF_ROUTE: c_int = AF_ROUTE; ++pub const PF_LINK: c_int = AF_LINK; ++pub const PF_INET6: c_int = AF_INET6; ++pub const PF_LOCAL: c_int = AF_LOCAL; ++pub const PF_UNIX: c_int = AF_UNIX; ++pub const PF_BLUETOOTH: c_int = AF_BLUETOOTH; ++ ++pub const IP_OPTIONS: c_int = 1; ++pub const IP_HDRINCL: c_int = 2; ++pub const IP_TOS: c_int = 3; ++pub const IP_TTL: c_int = 4; ++pub const IP_RECVOPTS: c_int = 5; ++pub const IP_RECVRETOPTS: c_int = 6; ++pub const IP_RECVDSTADDR: c_int = 7; ++pub const IP_RETOPTS: c_int = 8; ++pub const IP_MULTICAST_IF: c_int = 9; ++pub const IP_MULTICAST_TTL: c_int = 10; ++pub const IP_MULTICAST_LOOP: c_int = 11; ++pub const IP_ADD_MEMBERSHIP: c_int = 12; ++pub const IP_DROP_MEMBERSHIP: c_int = 13; ++pub const IP_BLOCK_SOURCE: c_int = 14; ++pub const IP_UNBLOCK_SOURCE: c_int = 15; ++pub const IP_ADD_SOURCE_MEMBERSHIP: c_int = 16; ++pub const IP_DROP_SOURCE_MEMBERSHIP: c_int = 17; ++ ++pub const TCP_NODELAY: c_int = 0x01; ++pub const TCP_MAXSEG: c_int = 0x02; ++pub const TCP_NOPUSH: c_int = 0x04; ++pub const TCP_NOOPT: c_int = 0x08; ++ ++pub const IF_NAMESIZE: size_t = 32; ++pub const IFNAMSIZ: size_t = IF_NAMESIZE; ++ ++pub const IPV6_MULTICAST_IF: c_int = 24; ++pub const IPV6_MULTICAST_HOPS: c_int = 25; ++pub const IPV6_MULTICAST_LOOP: c_int = 26; ++pub const IPV6_UNICAST_HOPS: c_int = 27; ++pub const IPV6_JOIN_GROUP: c_int = 28; ++pub const IPV6_LEAVE_GROUP: c_int = 29; ++pub const IPV6_V6ONLY: c_int = 30; ++pub const IPV6_PKTINFO: c_int = 31; ++pub const IPV6_RECVPKTINFO: c_int = 32; ++pub const IPV6_HOPLIMIT: c_int = 33; ++pub const IPV6_RECVHOPLIMIT: c_int = 34; ++pub const IPV6_HOPOPTS: c_int = 35; ++pub const IPV6_DSTOPTS: c_int = 36; ++pub const IPV6_RTHDR: c_int = 37; ++ ++pub const MSG_OOB: c_int = 0x0001; ++pub const MSG_PEEK: c_int = 0x0002; ++pub const MSG_DONTROUTE: c_int = 0x0004; ++pub const MSG_EOR: c_int = 0x0008; ++pub const MSG_TRUNC: c_int = 0x0010; ++pub const MSG_CTRUNC: c_int = 0x0020; ++pub const MSG_WAITALL: c_int = 0x0040; ++pub const MSG_DONTWAIT: c_int = 0x0080; ++pub const MSG_BCAST: c_int = 0x0100; ++pub const MSG_MCAST: c_int = 0x0200; ++pub const MSG_EOF: c_int = 0x0400; ++pub const MSG_NOSIGNAL: c_int = 0x0800; ++ ++pub const SHUT_RD: c_int = 0; ++pub const SHUT_WR: c_int = 1; ++pub const SHUT_RDWR: c_int = 2; ++ ++pub const LOCK_SH: c_int = 0x01; ++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; ++pub const PATH_MAX: c_int = 1024; ++ ++pub const SA_NOCLDSTOP: c_int = 0x01; ++pub const SA_NOCLDWAIT: c_int = 0x02; ++pub const SA_RESETHAND: c_int = 0x04; ++pub const SA_NODEFER: c_int = 0x08; ++pub const SA_RESTART: c_int = 0x10; ++pub const SA_ONSTACK: c_int = 0x20; ++pub const SA_SIGINFO: c_int = 0x40; ++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; ++ ++// DIFF(main): changed to `c_int` in 500365e1 ++pub const FD_SETSIZE: usize = 1024; ++ ++pub const RTLD_LOCAL: c_int = 0x0; ++pub const RTLD_NOW: c_int = 0x1; ++pub const RTLD_GLOBAL: c_int = 0x2; ++pub const RTLD_DEFAULT: *mut c_void = 0isize as *mut c_void; ++ ++pub const BUFSIZ: c_uint = 8192; ++pub const FILENAME_MAX: c_uint = 256; ++pub const FOPEN_MAX: c_uint = 128; ++pub const L_tmpnam: c_uint = 512; ++pub const TMP_MAX: c_uint = 32768; ++ ++pub const _PC_CHOWN_RESTRICTED: c_int = 1; ++pub const _PC_MAX_CANON: c_int = 2; ++pub const _PC_MAX_INPUT: c_int = 3; ++pub const _PC_NAME_MAX: c_int = 4; ++pub const _PC_NO_TRUNC: c_int = 5; ++pub const _PC_PATH_MAX: c_int = 6; ++pub const _PC_PIPE_BUF: c_int = 7; ++pub const _PC_VDISABLE: c_int = 8; ++pub const _PC_LINK_MAX: c_int = 25; ++pub const _PC_SYNC_IO: c_int = 26; ++pub const _PC_ASYNC_IO: c_int = 27; ++pub const _PC_PRIO_IO: c_int = 28; ++pub const _PC_SOCK_MAXBUF: c_int = 29; ++pub const _PC_FILESIZEBITS: c_int = 30; ++pub const _PC_REC_INCR_XFER_SIZE: c_int = 31; ++pub const _PC_REC_MAX_XFER_SIZE: c_int = 32; ++pub const _PC_REC_MIN_XFER_SIZE: c_int = 33; ++pub const _PC_REC_XFER_ALIGN: c_int = 34; ++pub const _PC_ALLOC_SIZE_MIN: c_int = 35; ++pub const _PC_SYMLINK_MAX: c_int = 36; ++pub const _PC_2_SYMLINKS: c_int = 37; ++pub const _PC_XATTR_EXISTS: c_int = 38; ++pub const _PC_XATTR_ENABLED: c_int = 39; ++ ++pub const FIONBIO: c_ulong = 0xbe000000; ++pub const FIONREAD: c_ulong = 0xbe000001; ++pub const FIOSEEKDATA: c_ulong = 0xbe000002; ++pub const FIOSEEKHOLE: c_ulong = 0xbe000003; ++ ++pub const _SC_ARG_MAX: c_int = 15; ++pub const _SC_CHILD_MAX: c_int = 16; ++pub const _SC_CLK_TCK: c_int = 17; ++pub const _SC_JOB_CONTROL: c_int = 18; ++pub const _SC_NGROUPS_MAX: c_int = 19; ++pub const _SC_OPEN_MAX: c_int = 20; ++pub const _SC_SAVED_IDS: c_int = 21; ++pub const _SC_STREAM_MAX: c_int = 22; ++pub const _SC_TZNAME_MAX: c_int = 23; ++pub const _SC_VERSION: c_int = 24; ++pub const _SC_GETGR_R_SIZE_MAX: c_int = 25; ++pub const _SC_GETPW_R_SIZE_MAX: c_int = 26; ++pub const _SC_PAGESIZE: c_int = 27; ++pub const _SC_PAGE_SIZE: c_int = 27; ++pub const _SC_SEM_NSEMS_MAX: c_int = 28; ++pub const _SC_SEM_VALUE_MAX: c_int = 29; ++pub const _SC_SEMAPHORES: c_int = 30; ++pub const _SC_THREADS: c_int = 31; ++pub const _SC_IOV_MAX: c_int = 32; ++pub const _SC_UIO_MAXIOV: c_int = 32; ++pub const _SC_NPROCESSORS_CONF: c_int = 34; ++pub const _SC_NPROCESSORS_ONLN: c_int = 35; ++pub const _SC_ATEXIT_MAX: c_int = 37; ++pub const _SC_PASS_MAX: c_int = 39; ++pub const _SC_PHYS_PAGES: c_int = 40; ++pub const _SC_AVPHYS_PAGES: c_int = 41; ++pub const _SC_PIPE: c_int = 42; ++pub const _SC_SELECT: c_int = 43; ++pub const _SC_POLL: c_int = 44; ++pub const _SC_MAPPED_FILES: c_int = 45; ++pub const _SC_THREAD_PROCESS_SHARED: c_int = 46; ++pub const _SC_THREAD_STACK_MIN: c_int = 47; ++pub const _SC_THREAD_ATTR_STACKADDR: c_int = 48; ++pub const _SC_THREAD_ATTR_STACKSIZE: c_int = 49; ++pub const _SC_THREAD_PRIORITY_SCHEDULING: c_int = 50; ++pub const _SC_REALTIME_SIGNALS: c_int = 51; ++pub const _SC_MEMORY_PROTECTION: c_int = 52; ++pub const _SC_SIGQUEUE_MAX: c_int = 53; ++pub const _SC_RTSIG_MAX: c_int = 54; ++pub const _SC_MONOTONIC_CLOCK: c_int = 55; ++pub const _SC_DELAYTIMER_MAX: c_int = 56; ++pub const _SC_TIMER_MAX: c_int = 57; ++pub const _SC_TIMERS: c_int = 58; ++pub const _SC_CPUTIME: c_int = 59; ++pub const _SC_THREAD_CPUTIME: c_int = 60; ++pub const _SC_HOST_NAME_MAX: c_int = 61; ++pub const _SC_REGEXP: c_int = 62; ++pub const _SC_SYMLOOP_MAX: c_int = 63; ++pub const _SC_SHELL: c_int = 64; ++pub const _SC_TTY_NAME_MAX: c_int = 65; ++pub const _SC_ADVISORY_INFO: c_int = 66; ++pub const _SC_BARRIERS: c_int = 67; ++pub const _SC_CLOCK_SELECTION: c_int = 68; ++pub const _SC_FSYNC: c_int = 69; ++pub const _SC_IPV6: c_int = 70; ++pub const _SC_MEMLOCK: c_int = 71; ++pub const _SC_MEMLOCK_RANGE: c_int = 72; ++pub const _SC_MESSAGE_PASSING: c_int = 73; ++pub const _SC_PRIORITIZED_IO: c_int = 74; ++pub const _SC_PRIORITY_SCHEDULING: c_int = 75; ++pub const _SC_READER_WRITER_LOCKS: c_int = 76; ++pub const _SC_SHARED_MEMORY_OBJECTS: c_int = 77; ++pub const _SC_SPAWN: c_int = 78; ++pub const _SC_SPIN_LOCKS: c_int = 79; ++pub const _SC_SPORADIC_SERVER: c_int = 80; ++pub const _SC_SYNCHRONIZED_IO: c_int = 81; ++pub const _SC_THREAD_PRIO_INHERIT: c_int = 82; ++pub const _SC_THREAD_PRIO_PROTECT: c_int = 83; ++pub const _SC_THREAD_ROBUST_PRIO_INHERIT: c_int = 84; ++pub const _SC_THREAD_ROBUST_PRIO_PROTECT: c_int = 85; ++pub const _SC_THREAD_SAFE_FUNCTIONS: c_int = 86; ++pub const _SC_THREAD_SPORADIC_SERVER: c_int = 87; ++pub const _SC_TIMEOUTS: c_int = 88; ++pub const _SC_TRACE: c_int = 89; ++pub const _SC_TRACE_EVENT_FILTER: c_int = 90; ++pub const _SC_TRACE_INHERIT: c_int = 91; ++pub const _SC_TRACE_LOG: c_int = 92; ++pub const _SC_TYPED_MEMORY_OBJECTS: c_int = 93; ++pub const _SC_V6_ILP32_OFF32: c_int = 94; ++pub const _SC_V6_ILP32_OFFBIG: c_int = 95; ++pub const _SC_V6_LP64_OFF64: c_int = 96; ++pub const _SC_V6_LPBIG_OFFBIG: c_int = 97; ++pub const _SC_V7_ILP32_OFF32: c_int = 98; ++pub const _SC_V7_ILP32_OFFBIG: c_int = 99; ++pub const _SC_V7_LP64_OFF64: c_int = 100; ++pub const _SC_V7_LPBIG_OFFBIG: c_int = 101; ++pub const _SC_2_C_BIND: c_int = 102; ++pub const _SC_2_C_DEV: c_int = 103; ++pub const _SC_2_CHAR_TERM: c_int = 104; ++pub const _SC_2_FORT_DEV: c_int = 105; ++pub const _SC_2_FORT_RUN: c_int = 106; ++pub const _SC_2_LOCALEDEF: c_int = 107; ++pub const _SC_2_PBS: c_int = 108; ++pub const _SC_2_PBS_ACCOUNTING: c_int = 109; ++pub const _SC_2_PBS_CHECKPOINT: c_int = 110; ++pub const _SC_2_PBS_LOCATE: c_int = 111; ++pub const _SC_2_PBS_MESSAGE: c_int = 112; ++pub const _SC_2_PBS_TRACK: c_int = 113; ++pub const _SC_2_SW_DEV: c_int = 114; ++pub const _SC_2_UPE: c_int = 115; ++pub const _SC_2_VERSION: c_int = 116; ++pub const _SC_XOPEN_CRYPT: c_int = 117; ++pub const _SC_XOPEN_ENH_I18N: c_int = 118; ++pub const _SC_XOPEN_REALTIME: c_int = 119; ++pub const _SC_XOPEN_REALTIME_THREADS: c_int = 120; ++pub const _SC_XOPEN_SHM: c_int = 121; ++pub const _SC_XOPEN_STREAMS: c_int = 122; ++pub const _SC_XOPEN_UNIX: c_int = 123; ++pub const _SC_XOPEN_UUCP: c_int = 124; ++pub const _SC_XOPEN_VERSION: c_int = 125; ++pub const _SC_BC_BASE_MAX: c_int = 129; ++pub const _SC_BC_DIM_MAX: c_int = 130; ++pub const _SC_BC_SCALE_MAX: c_int = 131; ++pub const _SC_BC_STRING_MAX: c_int = 132; ++pub const _SC_COLL_WEIGHTS_MAX: c_int = 133; ++pub const _SC_EXPR_NEST_MAX: c_int = 134; ++pub const _SC_LINE_MAX: c_int = 135; ++pub const _SC_LOGIN_NAME_MAX: c_int = 136; ++pub const _SC_MQ_OPEN_MAX: c_int = 137; ++pub const _SC_MQ_PRIO_MAX: c_int = 138; ++pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: c_int = 139; ++pub const _SC_THREAD_KEYS_MAX: c_int = 140; ++pub const _SC_THREAD_THREADS_MAX: c_int = 141; ++pub const _SC_RE_DUP_MAX: c_int = 142; ++ ++pub const PTHREAD_STACK_MIN: size_t = 8192; ++ ++pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { ++ flags: 0, ++ lock: 0, ++ unused: -42, ++ owner: -1, ++ owner_count: 0, ++}; ++pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { ++ flags: 0, ++ unused: -42, ++ mutex: 0 as *mut _, ++ waiter_count: 0, ++ lock: 0, ++}; ++pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { ++ flags: 0, ++ owner: -1, ++ lock_sem: 0, ++ lock_count: 0, ++ reader_count: 0, ++ writer_count: 0, ++ waiters: [0 as *mut _; 2], ++}; ++ ++pub const PTHREAD_MUTEX_DEFAULT: c_int = 0; ++pub const PTHREAD_MUTEX_NORMAL: c_int = 1; ++pub const PTHREAD_MUTEX_ERRORCHECK: c_int = 2; ++pub const PTHREAD_MUTEX_RECURSIVE: c_int = 3; ++ ++pub const FIOCLEX: c_ulong = 0; // FIXME: does not exist on Haiku! ++ ++pub const RUSAGE_CHILDREN: c_int = -1; ++ ++pub const SOCK_STREAM: c_int = 1; ++pub const SOCK_DGRAM: c_int = 2; ++pub const SOCK_RAW: c_int = 3; ++pub const SOCK_SEQPACKET: c_int = 5; ++ ++pub const SOL_SOCKET: c_int = -1; ++pub const SO_ACCEPTCONN: c_int = 0x00000001; ++pub const SO_BROADCAST: c_int = 0x00000002; ++pub const SO_DEBUG: c_int = 0x00000004; ++pub const SO_DONTROUTE: c_int = 0x00000008; ++pub const SO_KEEPALIVE: c_int = 0x00000010; ++pub const SO_OOBINLINE: c_int = 0x00000020; ++pub const SO_REUSEADDR: c_int = 0x00000040; ++pub const SO_REUSEPORT: c_int = 0x00000080; ++pub const SO_USELOOPBACK: c_int = 0x00000100; ++pub const SO_LINGER: c_int = 0x00000200; ++pub const SO_SNDBUF: c_int = 0x40000001; ++pub const SO_SNDLOWAT: c_int = 0x40000002; ++pub const SO_SNDTIMEO: c_int = 0x40000003; ++pub const SO_RCVBUF: c_int = 0x40000004; ++pub const SO_RCVLOWAT: c_int = 0x40000005; ++pub const SO_RCVTIMEO: c_int = 0x40000006; ++pub const SO_ERROR: c_int = 0x40000007; ++pub const SO_TYPE: c_int = 0x40000008; ++pub const SO_NONBLOCK: c_int = 0x40000009; ++pub const SO_BINDTODEVICE: c_int = 0x4000000a; ++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; ++pub const WUNTRACED: c_int = 0x02; ++pub const WCONTINUED: c_int = 0x04; ++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; ++pub const CLD_TRAPPED: c_int = 63; ++pub const CLD_STOPPED: c_int = 64; ++pub const CLD_CONTINUED: c_int = 65; ++ ++pub const P_ALL: idtype_t = 0; ++pub const P_PID: idtype_t = 1; ++pub const P_PGID: idtype_t = 2; ++ ++pub const UTIME_OMIT: c_long = 1000000001; ++pub const UTIME_NOW: c_long = 1000000000; ++ ++pub const VINTR: usize = 0; ++pub const VQUIT: usize = 1; ++pub const VERASE: usize = 2; ++pub const VKILL: usize = 3; ++pub const VEOF: usize = 4; ++pub const VEOL: usize = 5; ++pub const VMIN: usize = 4; ++pub const VTIME: usize = 5; ++pub const VEOL2: usize = 6; ++pub const VSWTCH: usize = 7; ++pub const VSTART: usize = 8; ++pub const VSTOP: usize = 9; ++pub const VSUSP: usize = 10; ++ ++pub const IGNBRK: crate::tcflag_t = 0x01; ++pub const BRKINT: crate::tcflag_t = 0x02; ++pub const IGNPAR: crate::tcflag_t = 0x04; ++pub const PARMRK: crate::tcflag_t = 0x08; ++pub const INPCK: crate::tcflag_t = 0x10; ++pub const ISTRIP: crate::tcflag_t = 0x20; ++pub const INLCR: crate::tcflag_t = 0x40; ++pub const IGNCR: crate::tcflag_t = 0x80; ++pub const ICRNL: crate::tcflag_t = 0x100; ++pub const IUCLC: crate::tcflag_t = 0x200; ++pub const IXON: crate::tcflag_t = 0x400; ++pub const IXANY: crate::tcflag_t = 0x800; ++pub const IXOFF: crate::tcflag_t = 0x1000; ++ ++pub const OPOST: crate::tcflag_t = 0x00000001; ++pub const OLCUC: crate::tcflag_t = 0x00000002; ++pub const ONLCR: crate::tcflag_t = 0x00000004; ++pub const OCRNL: crate::tcflag_t = 0x00000008; ++pub const ONOCR: crate::tcflag_t = 0x00000010; ++pub const ONLRET: crate::tcflag_t = 0x00000020; ++pub const OFILL: crate::tcflag_t = 0x00000040; ++pub const OFDEL: crate::tcflag_t = 0x00000080; ++pub const NLDLY: crate::tcflag_t = 0x00000100; ++pub const NL0: crate::tcflag_t = 0x00000000; ++pub const NL1: crate::tcflag_t = 0x00000100; ++pub const CRDLY: crate::tcflag_t = 0x00000600; ++pub const CR0: crate::tcflag_t = 0x00000000; ++pub const CR1: crate::tcflag_t = 0x00000200; ++pub const CR2: crate::tcflag_t = 0x00000400; ++pub const CR3: crate::tcflag_t = 0x00000600; ++pub const TABDLY: crate::tcflag_t = 0x00001800; ++pub const TAB0: crate::tcflag_t = 0x00000000; ++pub const TAB1: crate::tcflag_t = 0x00000800; ++pub const TAB2: crate::tcflag_t = 0x00001000; ++pub const TAB3: crate::tcflag_t = 0x00001800; ++pub const BSDLY: crate::tcflag_t = 0x00002000; ++pub const BS0: crate::tcflag_t = 0x00000000; ++pub const BS1: crate::tcflag_t = 0x00002000; ++pub const VTDLY: crate::tcflag_t = 0x00004000; ++pub const VT0: crate::tcflag_t = 0x00000000; ++pub const VT1: crate::tcflag_t = 0x00004000; ++pub const FFDLY: crate::tcflag_t = 0x00008000; ++pub const FF0: crate::tcflag_t = 0x00000000; ++pub const FF1: crate::tcflag_t = 0x00008000; ++ ++pub const CSIZE: crate::tcflag_t = 0x00000020; ++pub const CS5: crate::tcflag_t = 0x00000000; ++pub const CS6: crate::tcflag_t = 0x00000000; ++pub const CS7: crate::tcflag_t = 0x00000000; ++pub const CS8: crate::tcflag_t = 0x00000020; ++pub const CSTOPB: crate::tcflag_t = 0x00000040; ++pub const CREAD: crate::tcflag_t = 0x00000080; ++pub const PARENB: crate::tcflag_t = 0x00000100; ++pub const PARODD: crate::tcflag_t = 0x00000200; ++pub const HUPCL: crate::tcflag_t = 0x00000400; ++pub const CLOCAL: crate::tcflag_t = 0x00000800; ++pub const XLOBLK: crate::tcflag_t = 0x00001000; ++pub const CTSFLOW: crate::tcflag_t = 0x00002000; ++pub const RTSFLOW: crate::tcflag_t = 0x00004000; ++pub const CRTSCTS: crate::tcflag_t = RTSFLOW | CTSFLOW; ++ ++pub const ISIG: crate::tcflag_t = 0x00000001; ++pub const ICANON: crate::tcflag_t = 0x00000002; ++pub const XCASE: crate::tcflag_t = 0x00000004; ++pub const ECHO: crate::tcflag_t = 0x00000008; ++pub const ECHOE: crate::tcflag_t = 0x00000010; ++pub const ECHOK: crate::tcflag_t = 0x00000020; ++pub const ECHONL: crate::tcflag_t = 0x00000040; ++pub const NOFLSH: crate::tcflag_t = 0x00000080; ++pub const TOSTOP: crate::tcflag_t = 0x00000100; ++pub const IEXTEN: crate::tcflag_t = 0x00000200; ++pub const ECHOCTL: crate::tcflag_t = 0x00000400; ++pub const ECHOPRT: crate::tcflag_t = 0x00000800; ++pub const ECHOKE: crate::tcflag_t = 0x00001000; ++pub const FLUSHO: crate::tcflag_t = 0x00002000; ++pub const PENDIN: crate::tcflag_t = 0x00004000; ++ ++pub const TCGB_CTS: c_int = 0x01; ++pub const TCGB_DSR: c_int = 0x02; ++pub const TCGB_RI: c_int = 0x04; ++pub const TCGB_DCD: c_int = 0x08; ++pub const TIOCM_CTS: c_int = TCGB_CTS; ++pub const TIOCM_CD: c_int = TCGB_DCD; ++pub const TIOCM_CAR: c_int = TCGB_DCD; ++pub const TIOCM_RI: c_int = TCGB_RI; ++pub const TIOCM_RNG: c_int = TCGB_RI; ++pub const TIOCM_DSR: c_int = TCGB_DSR; ++pub const TIOCM_DTR: c_int = 0x10; ++pub const TIOCM_RTS: c_int = 0x20; ++ ++pub const B0: speed_t = 0x00; ++pub const B50: speed_t = 0x01; ++pub const B75: speed_t = 0x02; ++pub const B110: speed_t = 0x03; ++pub const B134: speed_t = 0x04; ++pub const B150: speed_t = 0x05; ++pub const B200: speed_t = 0x06; ++pub const B300: speed_t = 0x07; ++pub const B600: speed_t = 0x08; ++pub const B1200: speed_t = 0x09; ++pub const B1800: speed_t = 0x0A; ++pub const B2400: speed_t = 0x0B; ++pub const B4800: speed_t = 0x0C; ++pub const B9600: speed_t = 0x0D; ++pub const B19200: speed_t = 0x0E; ++pub const B38400: speed_t = 0x0F; ++pub const B57600: speed_t = 0x10; ++pub const B115200: speed_t = 0x11; ++pub const B230400: speed_t = 0x12; ++pub const B31250: speed_t = 0x13; ++ ++pub const TCSANOW: c_int = 0x01; ++pub const TCSADRAIN: c_int = 0x02; ++pub const TCSAFLUSH: c_int = 0x04; ++ ++pub const TCOOFF: c_int = 0x01; ++pub const TCOON: c_int = 0x02; ++pub const TCIOFF: c_int = 0x04; ++pub const TCION: c_int = 0x08; ++ ++pub const TCIFLUSH: c_int = 0x01; ++pub const TCOFLUSH: c_int = 0x02; ++pub const TCIOFLUSH: c_int = 0x03; ++ ++pub const TCGETA: c_ulong = 0x8000; ++pub const TCSETA: c_ulong = TCGETA + 1; ++pub const TCSETAF: c_ulong = TCGETA + 2; ++pub const TCSETAW: c_ulong = TCGETA + 3; ++pub const TCSBRK: c_ulong = TCGETA + 5; ++pub const TCFLSH: c_ulong = TCGETA + 6; ++pub const TCXONC: c_ulong = TCGETA + 7; ++pub const TCGETBITS: c_ulong = TCGETA + 9; ++pub const TCSETDTR: c_ulong = TCGETA + 10; ++pub const TCSETRTS: c_ulong = TCGETA + 11; ++pub const TIOCGWINSZ: c_ulong = TCGETA + 12; ++pub const TIOCSWINSZ: c_ulong = TCGETA + 13; ++pub const TIOCGPGRP: c_ulong = TCGETA + 15; ++pub const TIOCSPGRP: c_ulong = TCGETA + 16; ++pub const TIOCSCTTY: c_ulong = TCGETA + 17; ++pub const TIOCMGET: c_ulong = TCGETA + 18; ++pub const TIOCMSET: c_ulong = TCGETA + 19; ++pub const TIOCSBRK: c_ulong = TCGETA + 20; ++pub const TIOCCBRK: c_ulong = TCGETA + 21; ++pub const TIOCMBIS: c_ulong = TCGETA + 22; ++pub const TIOCMBIC: c_ulong = TCGETA + 23; ++pub const TIOCGSID: c_ulong = TCGETA + 24; ++pub const TIOCOUTQ: c_ulong = TCGETA + 25; ++pub const TIOCEXCL: c_ulong = TCGETA + 26; ++pub const TIOCNXCL: c_ulong = TCGETA + 27; ++ ++pub const PRIO_PROCESS: c_int = 0; ++pub const PRIO_PGRP: c_int = 1; ++pub const PRIO_USER: c_int = 2; ++ ++// utmpx entry types ++pub const EMPTY: c_short = 0; ++pub const BOOT_TIME: c_short = 1; ++pub const OLD_TIME: c_short = 2; ++pub const NEW_TIME: c_short = 3; ++pub const USER_PROCESS: c_short = 4; ++pub const INIT_PROCESS: c_short = 5; ++pub const LOGIN_PROCESS: c_short = 6; ++pub const DEAD_PROCESS: c_short = 7; ++ ++pub const LOG_PID: c_int = 1 << 12; ++pub const LOG_CONS: c_int = 2 << 12; ++pub const LOG_ODELAY: c_int = 4 << 12; ++pub const LOG_NDELAY: c_int = 8 << 12; ++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 ++// DIFF(main): changed to `c_short` in f62eb023ab ++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) ++ } ++} ++ ++f! { ++ pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr { ++ if (*mhdr).msg_controllen as usize >= mem::size_of::() { ++ (*mhdr).msg_control as *mut cmsghdr ++ } else { ++ 0 as *mut cmsghdr ++ } ++ } ++ ++ pub fn CMSG_DATA(cmsg: *const cmsghdr) -> *mut c_uchar { ++ (cmsg as *mut c_uchar).offset(CMSG_ALIGN(mem::size_of::()) as isize) ++ } ++ ++ pub {const} fn CMSG_SPACE(length: c_uint) -> c_uint { ++ (CMSG_ALIGN(length as usize) + CMSG_ALIGN(mem::size_of::())) as c_uint ++ } ++ ++ pub {const} fn CMSG_LEN(length: c_uint) -> c_uint { ++ CMSG_ALIGN(mem::size_of::()) as c_uint + length ++ } ++ ++ pub fn CMSG_NXTHDR(mhdr: *const msghdr, cmsg: *const cmsghdr) -> *mut cmsghdr { ++ if cmsg.is_null() { ++ return crate::CMSG_FIRSTHDR(mhdr); ++ }; ++ let next = cmsg as usize ++ + CMSG_ALIGN((*cmsg).cmsg_len as usize) ++ + CMSG_ALIGN(mem::size_of::()); ++ let max = (*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize; ++ if next > max { ++ 0 as *mut cmsghdr ++ } else { ++ (cmsg as usize + CMSG_ALIGN((*cmsg).cmsg_len as usize)) as *mut cmsghdr ++ } ++ } ++ ++ pub fn FD_CLR(fd: c_int, set: *mut fd_set) -> () { ++ let fd = fd as usize; ++ let size = mem::size_of_val(&(*set).fds_bits[0]) * 8; ++ (*set).fds_bits[fd / size] &= !(1 << (fd % size)); ++ return; ++ } ++ ++ pub fn FD_ISSET(fd: c_int, set: *const fd_set) -> bool { ++ let fd = fd as usize; ++ let size = mem::size_of_val(&(*set).fds_bits[0]) * 8; ++ return ((*set).fds_bits[fd / size] & (1 << (fd % size))) != 0; ++ } ++ ++ pub fn FD_SET(fd: c_int, set: *mut fd_set) -> () { ++ let fd = fd as usize; ++ let size = mem::size_of_val(&(*set).fds_bits[0]) * 8; ++ (*set).fds_bits[fd / size] |= 1 << (fd % size); ++ return; ++ } ++ ++ pub fn FD_ZERO(set: *mut fd_set) -> () { ++ for slot in (*set).fds_bits.iter_mut() { ++ *slot = 0; ++ } ++ } ++} ++ ++safe_f! { ++ pub {const} fn WIFEXITED(status: c_int) -> bool { ++ (status & !0xff) == 0 ++ } ++ ++ pub {const} fn WEXITSTATUS(status: c_int) -> c_int { ++ status & 0xff ++ } ++ ++ pub {const} fn WIFSIGNALED(status: c_int) -> bool { ++ ((status >> 8) & 0xff) != 0 ++ } ++ ++ pub {const} fn WTERMSIG(status: c_int) -> c_int { ++ (status >> 8) & 0xff ++ } ++ ++ pub {const} fn WIFSTOPPED(status: c_int) -> bool { ++ ((status >> 16) & 0xff) != 0 ++ } ++ ++ pub {const} fn WSTOPSIG(status: c_int) -> c_int { ++ (status >> 16) & 0xff ++ } ++ ++ // actually WIFCORED, but this is used everywhere else ++ pub {const} fn WCOREDUMP(status: c_int) -> bool { ++ (status & 0x10000) != 0 ++ } ++ ++ pub {const} fn WIFCONTINUED(status: c_int) -> bool { ++ (status & 0x20000) != 0 ++ } ++} ++ ++extern "C" { ++ pub fn getrlimit(resource: c_int, rlim: *mut crate::rlimit) -> c_int; ++ pub fn setrlimit(resource: c_int, rlim: *const crate::rlimit) -> c_int; ++ pub fn getpriority(which: c_int, who: id_t) -> c_int; ++ pub fn setpriority(which: c_int, who: id_t, priority: c_int) -> c_int; ++ ++ pub fn endusershell(); ++ pub fn getpass(prompt: *const c_char) -> *mut c_char; ++ pub fn getusershell() -> *mut c_char; ++ pub fn issetugid() -> c_int; ++ pub fn setusershell(); ++ ++ pub fn utimensat( ++ fd: c_int, ++ path: *const c_char, ++ times: *const crate::timespec, ++ flag: c_int, ++ ) -> c_int; ++ pub fn futimens(fd: c_int, times: *const crate::timespec) -> c_int; ++ pub fn strerror_r(errnum: c_int, buf: *mut c_char, buflen: size_t) -> c_int; ++ pub fn _errnop() -> *mut c_int; ++ ++ pub fn abs(i: c_int) -> c_int; ++ pub fn labs(i: c_long) -> c_long; ++ pub fn rand() -> c_int; ++ pub fn srand(seed: c_uint); ++ pub fn getifaddrs(ifap: *mut *mut crate::ifaddrs) -> c_int; ++ pub fn freeifaddrs(ifa: *mut crate::ifaddrs); ++ pub fn ppoll( ++ fds: *mut crate::pollfd, ++ numfds: crate::nfds_t, ++ timeout: *const crate::timespec, ++ sigMask: *const sigset_t, ++ ) -> c_int; ++ ++ pub fn getspent() -> *mut spwd; ++ pub fn getspent_r( ++ pwd: *mut spwd, ++ buf: *mut c_char, ++ bufferSize: size_t, ++ res: *mut *mut spwd, ++ ) -> c_int; ++ pub fn setspent(); ++ pub fn endspent(); ++ pub fn getspnam(name: *const c_char) -> *mut spwd; ++ pub fn getspnam_r( ++ name: *const c_char, ++ spwd: *mut spwd, ++ buffer: *mut c_char, ++ bufferSize: size_t, ++ res: *mut *mut spwd, ++ ) -> c_int; ++ pub fn sgetspent(line: *const c_char) -> *mut spwd; ++ pub fn sgetspent_r( ++ line: *const c_char, ++ spwd: *mut spwd, ++ buffer: *mut c_char, ++ bufferSize: size_t, ++ res: *mut *mut spwd, ++ ) -> c_int; ++ pub fn fgetspent(file: *mut crate::FILE) -> *mut spwd; ++ pub fn fgetspent_r( ++ file: *mut crate::FILE, ++ spwd: *mut spwd, ++ buffer: *mut c_char, ++ bufferSize: size_t, ++ res: *mut *mut spwd, ++ ) -> c_int; ++ pub fn mkfifoat(dirfd: c_int, pathname: *const c_char, mode: crate::mode_t) -> c_int; ++ pub fn mknodat(dirfd: c_int, pathname: *const c_char, mode: crate::mode_t, dev: dev_t) ++ -> c_int; ++ pub fn sem_destroy(sem: *mut sem_t) -> c_int; ++ pub fn sem_init(sem: *mut sem_t, pshared: c_int, value: c_uint) -> c_int; ++ ++ pub fn clock_getres(clk_id: crate::clockid_t, tp: *mut crate::timespec) -> c_int; ++ pub fn clock_gettime(clk_id: crate::clockid_t, tp: *mut crate::timespec) -> c_int; ++ pub fn clock_settime(clk_id: crate::clockid_t, tp: *const crate::timespec) -> c_int; ++ pub fn clock_getcpuclockid(pid: crate::pid_t, clk_id: *mut crate::clockid_t) -> c_int; ++ pub fn pthread_create( ++ thread: *mut crate::pthread_t, ++ attr: *const crate::pthread_attr_t, ++ f: extern "C" fn(*mut c_void) -> *mut c_void, ++ value: *mut c_void, ++ ) -> c_int; ++ pub fn pthread_attr_getguardsize( ++ attr: *const crate::pthread_attr_t, ++ guardsize: *mut size_t, ++ ) -> c_int; ++ pub fn pthread_attr_setguardsize(attr: *mut crate::pthread_attr_t, guardsize: size_t) -> c_int; ++ pub fn pthread_attr_getstack( ++ attr: *const crate::pthread_attr_t, ++ stackaddr: *mut *mut c_void, ++ stacksize: *mut size_t, ++ ) -> c_int; ++ pub fn pthread_condattr_getclock( ++ attr: *const pthread_condattr_t, ++ clock_id: *mut clockid_t, ++ ) -> c_int; ++ pub fn pthread_condattr_setclock( ++ attr: *mut pthread_condattr_t, ++ clock_id: crate::clockid_t, ++ ) -> c_int; ++ pub fn valloc(numBytes: size_t) -> *mut c_void; ++ pub fn malloc_usable_size(ptr: *mut c_void) -> size_t; ++ pub fn memalign(align: size_t, size: size_t) -> *mut c_void; ++ pub fn setgroups(ngroups: c_int, ptr: *const crate::gid_t) -> c_int; ++ pub fn initgroups(name: *const c_char, basegid: crate::gid_t) -> c_int; ++ pub fn ioctl(fd: c_int, request: c_ulong, ...) -> c_int; ++ pub fn mprotect(addr: *mut c_void, len: size_t, prot: c_int) -> c_int; ++ pub fn dirfd(dirp: *mut crate::DIR) -> c_int; ++ pub fn getnameinfo( ++ sa: *const crate::sockaddr, ++ salen: crate::socklen_t, ++ host: *mut c_char, ++ hostlen: crate::socklen_t, ++ serv: *mut c_char, ++ servlen: crate::socklen_t, ++ flags: c_int, ++ ) -> c_int; ++ pub fn pthread_mutex_timedlock( ++ lock: *mut pthread_mutex_t, ++ abstime: *const crate::timespec, ++ ) -> c_int; ++ pub fn pthread_sigqueue(thread: crate::pthread_t, sig: c_int, value: crate::sigval) -> c_int; ++ pub fn pthread_spin_init(lock: *mut crate::pthread_spinlock_t, pshared: c_int) -> c_int; ++ pub fn pthread_spin_destroy(lock: *mut crate::pthread_spinlock_t) -> c_int; ++ pub fn pthread_spin_lock(lock: *mut crate::pthread_spinlock_t) -> c_int; ++ pub fn pthread_spin_trylock(lock: *mut crate::pthread_spinlock_t) -> c_int; ++ pub fn pthread_spin_unlock(lock: *mut crate::pthread_spinlock_t) -> c_int; ++ pub fn waitid( ++ idtype: idtype_t, ++ id: id_t, ++ infop: *mut crate::siginfo_t, ++ options: c_int, ++ ) -> c_int; ++ ++ pub fn glob( ++ pattern: *const c_char, ++ flags: c_int, ++ errfunc: Option c_int>, ++ pglob: *mut crate::glob_t, ++ ) -> c_int; ++ pub fn globfree(pglob: *mut crate::glob_t); ++ pub fn gettimeofday(tp: *mut crate::timeval, tz: *mut c_void) -> c_int; ++ pub fn posix_madvise(addr: *mut c_void, len: size_t, advice: c_int) -> c_int; ++ pub fn posix_fadvise(fd: c_int, offset: off_t, len: off_t, advice: c_int) -> c_int; ++ pub fn posix_fallocate(fd: c_int, offset: off_t, len: off_t) -> c_int; ++ ++ pub fn shm_open(name: *const c_char, oflag: c_int, mode: crate::mode_t) -> c_int; ++ pub fn shm_unlink(name: *const c_char) -> c_int; ++ ++ pub fn seekdir(dirp: *mut crate::DIR, loc: c_long); ++ ++ pub fn telldir(dirp: *mut crate::DIR) -> c_long; ++ pub fn madvise(addr: *mut c_void, len: size_t, advice: c_int) -> c_int; ++ ++ pub fn msync(addr: *mut c_void, len: size_t, flags: c_int) -> c_int; ++ ++ pub fn recvfrom( ++ socket: c_int, ++ buf: *mut c_void, ++ len: size_t, ++ flags: c_int, ++ addr: *mut crate::sockaddr, ++ addrlen: *mut crate::socklen_t, ++ ) -> ssize_t; ++ pub fn mkstemps(template: *mut c_char, suffixlen: c_int) -> c_int; ++ pub fn nl_langinfo(item: crate::nl_item) -> *mut c_char; ++ ++ pub fn bind( ++ socket: c_int, ++ address: *const crate::sockaddr, ++ address_len: crate::socklen_t, ++ ) -> c_int; ++ ++ pub fn writev(fd: c_int, iov: *const crate::iovec, count: c_int) -> ssize_t; ++ pub fn readv(fd: c_int, iov: *const crate::iovec, count: c_int) -> ssize_t; ++ ++ pub fn sendmsg(fd: c_int, msg: *const crate::msghdr, flags: c_int) -> ssize_t; ++ pub fn recvmsg(fd: c_int, msg: *mut crate::msghdr, flags: c_int) -> ssize_t; ++ ++ // DIFF(main): changed to `*const *mut` in e77f551de9 ++ pub fn execvpe( ++ file: *const c_char, ++ argv: *const *const c_char, ++ environment: *const *const c_char, ++ ) -> c_int; ++ ++ pub fn getgrgid_r( ++ gid: crate::gid_t, ++ grp: *mut crate::group, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut crate::group, ++ ) -> c_int; ++ pub fn getgrouplist( ++ user: *const c_char, ++ basegroup: crate::gid_t, ++ grouplist: *mut crate::gid_t, ++ groupcount: *mut c_int, ++ ) -> c_int; ++ pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> c_int; ++ pub fn sigsuspend(mask: *const crate::sigset_t) -> c_int; ++ pub fn sem_close(sem: *mut sem_t) -> c_int; ++ pub fn getdtablesize() -> c_int; ++ pub fn getgrnam_r( ++ name: *const c_char, ++ grp: *mut crate::group, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut crate::group, ++ ) -> c_int; ++ pub fn pthread_sigmask(how: c_int, set: *const sigset_t, oldset: *mut sigset_t) -> c_int; ++ pub fn sem_open(name: *const c_char, oflag: c_int, ...) -> *mut sem_t; ++ pub fn getgrnam(name: *const c_char) -> *mut crate::group; ++ pub fn pthread_kill(thread: crate::pthread_t, sig: c_int) -> c_int; ++ pub fn sem_unlink(name: *const c_char) -> c_int; ++ pub fn getpwnam_r( ++ name: *const c_char, ++ pwd: *mut passwd, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut passwd, ++ ) -> c_int; ++ pub fn getpwuid_r( ++ uid: crate::uid_t, ++ pwd: *mut passwd, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut passwd, ++ ) -> c_int; ++ pub fn getpwent() -> *mut passwd; ++ pub fn setpwent(); ++ pub fn endpwent(); ++ pub fn endgrent(); ++ pub fn getgrent() -> *mut crate::group; ++ pub fn setgrent(); ++ pub fn sigwait(set: *const sigset_t, sig: *mut c_int) -> c_int; ++ pub fn pthread_atfork( ++ prepare: Option, ++ parent: Option, ++ child: Option, ++ ) -> c_int; ++ pub fn getgrgid(gid: crate::gid_t) -> *mut crate::group; ++ pub fn popen(command: *const c_char, mode: *const c_char) -> *mut crate::FILE; ++ pub fn sethostname(name: *const c_char, len: size_t) -> c_int; ++ pub fn uname(buf: *mut crate::utsname) -> c_int; ++ pub fn getutxent() -> *mut utmpx; ++ pub fn getutxid(ut: *const utmpx) -> *mut utmpx; ++ pub fn getutxline(ut: *const utmpx) -> *mut utmpx; ++ pub fn pututxline(ut: *const utmpx) -> *mut utmpx; ++ pub fn setutxent(); ++ pub fn endutxent(); ++ pub fn faccessat(dirfd: c_int, pathname: *const c_char, mode: c_int, flags: c_int) -> c_int; ++ ++ pub fn sigtimedwait( ++ set: *const sigset_t, ++ info: *mut siginfo_t, ++ timeout: *const crate::timespec, ++ ) -> c_int; ++ pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> c_int; ++ ++ pub fn getitimer(which: c_int, curr_value: *mut crate::itimerval) -> c_int; ++ pub fn setitimer( ++ which: c_int, ++ new_value: *const crate::itimerval, ++ old_value: *mut crate::itimerval, ++ ) -> c_int; ++ ++ pub fn regcomp(preg: *mut regex_t, pattern: *const c_char, cflags: c_int) -> c_int; ++ ++ pub fn regexec( ++ preg: *const regex_t, ++ input: *const c_char, ++ nmatch: size_t, ++ pmatch: *mut regmatch_t, ++ eflags: c_int, ++ ) -> c_int; ++ ++ pub fn regerror( ++ errcode: c_int, ++ preg: *const regex_t, ++ errbuf: *mut c_char, ++ errbuf_size: size_t, ++ ) -> size_t; ++ ++ pub fn regfree(preg: *mut regex_t); ++ ++ pub fn msgctl(msqid: c_int, cmd: c_int, buf: *mut msqid_ds) -> c_int; ++ pub fn msgget(key: crate::key_t, msgflg: c_int) -> c_int; ++ pub fn msgrcv( ++ msqid: c_int, ++ msgp: *mut c_void, ++ msgsz: size_t, ++ msgtype: c_long, ++ msgflg: c_int, ++ ) -> ssize_t; ++ pub fn msgsnd(msqid: c_int, msgp: *const c_void, msgsz: size_t, msgflg: c_int) -> c_int; ++ pub fn semget(key: crate::key_t, nsems: c_int, semflg: c_int) -> c_int; ++ pub fn semctl(semid: c_int, semnum: c_int, cmd: c_int, ...) -> c_int; ++ pub fn semop(semid: c_int, sops: *mut sembuf, nsops: size_t) -> c_int; ++ pub fn ftok(pathname: *const c_char, proj_id: c_int) -> crate::key_t; ++ ++ pub fn memrchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void; ++ ++ pub fn lsearch( ++ key: *const c_void, ++ base: *mut c_void, ++ nelp: *mut size_t, ++ width: size_t, ++ compar: Option c_int>, ++ ) -> *mut c_void; ++ pub fn lfind( ++ key: *const c_void, ++ base: *const c_void, ++ nelp: *mut size_t, ++ width: size_t, ++ compar: Option c_int>, ++ ) -> *mut c_void; ++ pub fn hcreate(nelt: size_t) -> c_int; ++ pub fn hdestroy(); ++ pub fn hsearch(entry: crate::ENTRY, action: crate::ACTION) -> *mut crate::ENTRY; ++ ++ pub fn drand48() -> c_double; ++ pub fn erand48(xseed: *mut c_ushort) -> c_double; ++ pub fn lrand48() -> c_long; ++ pub fn nrand48(xseed: *mut c_ushort) -> c_long; ++ pub fn mrand48() -> c_long; ++ pub fn jrand48(xseed: *mut c_ushort) -> c_long; ++ pub fn srand48(seed: c_long); ++ pub fn seed48(xseed: *mut c_ushort) -> *mut c_ushort; ++ pub fn lcong48(p: *mut c_ushort); ++ ++ pub fn clearenv() -> c_int; ++ pub fn ctermid(s: *mut c_char) -> *mut c_char; ++ ++ pub fn sync(); ++ pub fn getpagesize() -> c_int; ++ ++ pub fn brk(addr: *mut c_void) -> c_int; ++ pub fn sbrk(increment: intptr_t) -> *mut c_void; ++ ++ pub fn posix_spawn( ++ pid: *mut crate::pid_t, ++ path: *const c_char, ++ file_actions: *const crate::posix_spawn_file_actions_t, ++ attrp: *const crate::posix_spawnattr_t, ++ argv: *const *mut c_char, ++ envp: *const *mut c_char, ++ ) -> c_int; ++ pub fn posix_spawnp( ++ pid: *mut crate::pid_t, ++ file: *const c_char, ++ file_actions: *const crate::posix_spawn_file_actions_t, ++ attrp: *const crate::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: crate::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 crate::pid_t, ++ ) -> c_int; ++ pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, pgroup: crate::pid_t) -> c_int; ++ pub fn posix_spawnattr_getsigdefault( ++ attr: *const posix_spawnattr_t, ++ sigdefault: *mut crate::sigset_t, ++ ) -> c_int; ++ pub fn posix_spawnattr_setsigdefault( ++ attr: *mut posix_spawnattr_t, ++ sigdefault: *const crate::sigset_t, ++ ) -> c_int; ++ pub fn posix_spawnattr_getsigmask( ++ attr: *const posix_spawnattr_t, ++ _sigmask: *mut crate::sigset_t, ++ ) -> c_int; ++ pub fn posix_spawnattr_setsigmask( ++ attr: *mut posix_spawnattr_t, ++ sigmask: *const crate::sigset_t, ++ ) -> c_int; ++ pub fn getopt_long( ++ argc: c_int, ++ argv: *const *mut c_char, ++ optstring: *const c_char, ++ longopts: *const option, ++ longindex: *mut c_int, ++ ) -> c_int; ++ pub fn strcasecmp_l( ++ string1: *const c_char, ++ string2: *const c_char, ++ locale: crate::locale_t, ++ ) -> c_int; ++ pub fn strncasecmp_l( ++ string1: *const c_char, ++ string2: *const c_char, ++ length: size_t, ++ locale: crate::locale_t, ++ ) -> c_int; ++ ++ pub fn getentropy(buf: *mut c_void, buflen: size_t) -> c_int; ++} ++ ++#[link(name = "bsd")] ++extern "C" { ++ pub fn lutimes(file: *const c_char, times: *const crate::timeval) -> c_int; ++ pub fn daemon(nochdir: c_int, noclose: c_int) -> c_int; ++ pub fn forkpty( ++ amaster: *mut c_int, ++ name: *mut c_char, ++ termp: *mut termios, ++ winp: *mut crate::winsize, ++ ) -> crate::pid_t; ++ pub fn openpty( ++ amaster: *mut c_int, ++ aslave: *mut c_int, ++ name: *mut c_char, ++ termp: *mut termios, ++ winp: *mut crate::winsize, ++ ) -> c_int; ++ pub fn strsep(string: *mut *mut c_char, delimiters: *const c_char) -> *mut c_char; ++ pub fn explicit_bzero(buf: *mut c_void, len: size_t); ++ pub fn login_tty(_fd: c_int) -> c_int; ++ ++ pub fn sl_init() -> *mut StringList; ++ pub fn sl_add(sl: *mut StringList, n: *mut c_char) -> c_int; ++ pub fn sl_free(sl: *mut StringList, i: c_int); ++ pub fn sl_find(sl: *mut StringList, n: *mut c_char) -> *mut c_char; ++ ++ pub fn getprogname() -> *const c_char; ++ pub fn setprogname(progname: *const c_char); ++ pub fn dl_iterate_phdr( ++ callback: Option< ++ unsafe extern "C" fn(info: *mut dl_phdr_info, size: usize, data: *mut c_void) -> c_int, ++ >, ++ data: *mut c_void, ++ ) -> c_int; ++ ++ pub fn arc4random() -> u32; ++ pub fn arc4random_uniform(upper_bound: u32) -> u32; ++ pub fn arc4random_buf(buf: *mut c_void, n: size_t); ++} ++ ++#[link(name = "gnu")] ++extern "C" { ++ pub fn memmem( ++ source: *const c_void, ++ sourceLength: size_t, ++ search: *const c_void, ++ searchLength: size_t, ++ ) -> *mut c_void; ++ ++ pub fn pthread_getattr_np(thread: crate::pthread_t, attr: *mut crate::pthread_attr_t) -> c_int; ++ pub fn pthread_getname_np( ++ thread: crate::pthread_t, ++ buffer: *mut c_char, ++ length: size_t, ++ ) -> c_int; ++ pub fn pthread_setname_np(thread: crate::pthread_t, name: *const c_char) -> c_int; ++} ++ ++cfg_if! { ++ if #[cfg(target_pointer_width = "64")] { ++ mod b64; ++ pub use self::b64::*; ++ } else { ++ mod b32; ++ pub use self::b32::*; ++ } ++} ++ ++cfg_if! { ++ if #[cfg(target_arch = "x86")] { ++ // TODO ++ // mod x86; ++ // pub use self::x86::*; ++ } else if #[cfg(target_arch = "x86_64")] { ++ mod x86_64; ++ pub use self::x86_64::*; ++ } else if #[cfg(target_arch = "aarch64")] { ++ // TODO ++ // mod aarch64; ++ // pub use self::aarch64::*; ++ } ++} ++ ++mod native; ++pub use self::native::*; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/haiku/native.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/haiku/native.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/haiku/native.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/haiku/native.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,1441 @@ ++use crate::off_t; ++use crate::prelude::*; ++ ++// This module contains bindings to the native Haiku API. The Haiku API ++// originates from BeOS, and it was the original way to perform low level ++// system and IO operations. The POSIX API was in that era was like a ++// compatibility layer. In current Haiku development, both the POSIX API and ++// the Haiku API are considered to be co-equal status. However, they are not ++// integrated like they are on other UNIX platforms, which means that for many ++// low level concepts there are two versions, like processes (POSIX) and ++// teams (Haiku), or pthreads and native threads. ++// ++// Both the POSIX API and the Haiku API live in libroot.so, the library that is ++// linked to any binary by default. ++// ++// This file follows the Haiku API for Haiku R1 beta 2. It is organized by the ++// C/C++ header files in which the concepts can be found, while adhering to the ++// style guide for this crate. ++ ++// Helper macro to generate u32 constants. The Haiku API uses (non-standard) ++// multi-character constants (like 'UPDA' or 'MSGM') to represent 32 bit ++// integer constants. ++ ++macro_rules! haiku_constant { ++ ($a:tt, $b:tt, $c:tt, $d:tt) => { ++ (($a as u32) << 24) + (($b as u32) << 16) + (($c as u32) << 8) + ($d as u32) ++ }; ++} ++ ++// support/SupportDefs.h ++pub type status_t = i32; ++pub type bigtime_t = i64; ++pub type nanotime_t = i64; ++pub type type_code = u32; ++pub type perform_code = u32; ++ ++// kernel/OS.h ++pub type area_id = i32; ++pub type port_id = i32; ++pub type sem_id = i32; ++pub type team_id = i32; ++pub type thread_id = i32; ++ ++pub type thread_func = extern "C" fn(*mut c_void) -> status_t; ++ ++// kernel/image.h ++pub type image_id = i32; ++ ++e! { ++ // kernel/OS.h ++ pub enum thread_state { ++ B_THREAD_RUNNING = 1, ++ B_THREAD_READY, ++ B_THREAD_RECEIVING, ++ B_THREAD_ASLEEP, ++ B_THREAD_SUSPENDED, ++ B_THREAD_WAITING, ++ } ++ ++ // kernel/image.h ++ pub enum image_type { ++ B_APP_IMAGE = 1, ++ B_LIBRARY_IMAGE, ++ B_ADD_ON_IMAGE, ++ B_SYSTEM_IMAGE, ++ } ++ ++ // kernel/scheduler.h ++ ++ pub enum be_task_flags { ++ B_DEFAULT_MEDIA_PRIORITY = 0x000, ++ B_OFFLINE_PROCESSING = 0x001, ++ B_STATUS_RENDERING = 0x002, ++ B_USER_INPUT_HANDLING = 0x004, ++ B_LIVE_VIDEO_MANIPULATION = 0x008, ++ B_VIDEO_PLAYBACK = 0x010, ++ B_VIDEO_RECORDING = 0x020, ++ B_LIVE_AUDIO_MANIPULATION = 0x040, ++ B_AUDIO_PLAYBACK = 0x080, ++ B_AUDIO_RECORDING = 0x100, ++ B_LIVE_3D_RENDERING = 0x200, ++ B_NUMBER_CRUNCHING = 0x400, ++ B_MIDI_PROCESSING = 0x800, ++ } ++ ++ pub enum schduler_mode { ++ SCHEDULER_MODE_LOW_LATENCY, ++ SCHEDULER_MODE_POWER_SAVING, ++ } ++ ++ // FindDirectory.h ++ pub enum path_base_directory { ++ B_FIND_PATH_INSTALLATION_LOCATION_DIRECTORY, ++ B_FIND_PATH_ADD_ONS_DIRECTORY, ++ B_FIND_PATH_APPS_DIRECTORY, ++ B_FIND_PATH_BIN_DIRECTORY, ++ B_FIND_PATH_BOOT_DIRECTORY, ++ B_FIND_PATH_CACHE_DIRECTORY, ++ B_FIND_PATH_DATA_DIRECTORY, ++ B_FIND_PATH_DEVELOP_DIRECTORY, ++ B_FIND_PATH_DEVELOP_LIB_DIRECTORY, ++ B_FIND_PATH_DOCUMENTATION_DIRECTORY, ++ B_FIND_PATH_ETC_DIRECTORY, ++ B_FIND_PATH_FONTS_DIRECTORY, ++ B_FIND_PATH_HEADERS_DIRECTORY, ++ B_FIND_PATH_LIB_DIRECTORY, ++ B_FIND_PATH_LOG_DIRECTORY, ++ B_FIND_PATH_MEDIA_NODES_DIRECTORY, ++ B_FIND_PATH_PACKAGES_DIRECTORY, ++ B_FIND_PATH_PREFERENCES_DIRECTORY, ++ B_FIND_PATH_SERVERS_DIRECTORY, ++ B_FIND_PATH_SETTINGS_DIRECTORY, ++ B_FIND_PATH_SOUNDS_DIRECTORY, ++ B_FIND_PATH_SPOOL_DIRECTORY, ++ B_FIND_PATH_TRANSLATORS_DIRECTORY, ++ B_FIND_PATH_VAR_DIRECTORY, ++ B_FIND_PATH_IMAGE_PATH = 1000, ++ B_FIND_PATH_PACKAGE_PATH, ++ } ++ ++ pub enum directory_which { ++ B_DESKTOP_DIRECTORY = 0, ++ B_TRASH_DIRECTORY, ++ B_SYSTEM_DIRECTORY = 1000, ++ B_SYSTEM_ADDONS_DIRECTORY = 1002, ++ B_SYSTEM_BOOT_DIRECTORY, ++ B_SYSTEM_FONTS_DIRECTORY, ++ B_SYSTEM_LIB_DIRECTORY, ++ B_SYSTEM_SERVERS_DIRECTORY, ++ B_SYSTEM_APPS_DIRECTORY, ++ B_SYSTEM_BIN_DIRECTORY, ++ B_SYSTEM_DOCUMENTATION_DIRECTORY = 1010, ++ B_SYSTEM_PREFERENCES_DIRECTORY, ++ B_SYSTEM_TRANSLATORS_DIRECTORY, ++ B_SYSTEM_MEDIA_NODES_DIRECTORY, ++ B_SYSTEM_SOUNDS_DIRECTORY, ++ B_SYSTEM_DATA_DIRECTORY, ++ B_SYSTEM_DEVELOP_DIRECTORY, ++ B_SYSTEM_PACKAGES_DIRECTORY, ++ B_SYSTEM_HEADERS_DIRECTORY, ++ B_SYSTEM_ETC_DIRECTORY = 2008, ++ B_SYSTEM_SETTINGS_DIRECTORY = 2010, ++ B_SYSTEM_LOG_DIRECTORY = 2012, ++ B_SYSTEM_SPOOL_DIRECTORY, ++ B_SYSTEM_TEMP_DIRECTORY, ++ B_SYSTEM_VAR_DIRECTORY, ++ B_SYSTEM_CACHE_DIRECTORY = 2020, ++ B_SYSTEM_NONPACKAGED_DIRECTORY = 2023, ++ B_SYSTEM_NONPACKAGED_ADDONS_DIRECTORY, ++ B_SYSTEM_NONPACKAGED_TRANSLATORS_DIRECTORY, ++ B_SYSTEM_NONPACKAGED_MEDIA_NODES_DIRECTORY, ++ B_SYSTEM_NONPACKAGED_BIN_DIRECTORY, ++ B_SYSTEM_NONPACKAGED_DATA_DIRECTORY, ++ B_SYSTEM_NONPACKAGED_FONTS_DIRECTORY, ++ B_SYSTEM_NONPACKAGED_SOUNDS_DIRECTORY, ++ B_SYSTEM_NONPACKAGED_DOCUMENTATION_DIRECTORY, ++ B_SYSTEM_NONPACKAGED_LIB_DIRECTORY, ++ B_SYSTEM_NONPACKAGED_HEADERS_DIRECTORY, ++ B_SYSTEM_NONPACKAGED_DEVELOP_DIRECTORY, ++ B_USER_DIRECTORY = 3000, ++ B_USER_CONFIG_DIRECTORY, ++ B_USER_ADDONS_DIRECTORY, ++ B_USER_BOOT_DIRECTORY, ++ B_USER_FONTS_DIRECTORY, ++ B_USER_LIB_DIRECTORY, ++ B_USER_SETTINGS_DIRECTORY, ++ B_USER_DESKBAR_DIRECTORY, ++ B_USER_PRINTERS_DIRECTORY, ++ B_USER_TRANSLATORS_DIRECTORY, ++ B_USER_MEDIA_NODES_DIRECTORY, ++ B_USER_SOUNDS_DIRECTORY, ++ B_USER_DATA_DIRECTORY, ++ B_USER_CACHE_DIRECTORY, ++ B_USER_PACKAGES_DIRECTORY, ++ B_USER_HEADERS_DIRECTORY, ++ B_USER_NONPACKAGED_DIRECTORY, ++ B_USER_NONPACKAGED_ADDONS_DIRECTORY, ++ B_USER_NONPACKAGED_TRANSLATORS_DIRECTORY, ++ B_USER_NONPACKAGED_MEDIA_NODES_DIRECTORY, ++ B_USER_NONPACKAGED_BIN_DIRECTORY, ++ B_USER_NONPACKAGED_DATA_DIRECTORY, ++ B_USER_NONPACKAGED_FONTS_DIRECTORY, ++ B_USER_NONPACKAGED_SOUNDS_DIRECTORY, ++ B_USER_NONPACKAGED_DOCUMENTATION_DIRECTORY, ++ B_USER_NONPACKAGED_LIB_DIRECTORY, ++ B_USER_NONPACKAGED_HEADERS_DIRECTORY, ++ B_USER_NONPACKAGED_DEVELOP_DIRECTORY, ++ B_USER_DEVELOP_DIRECTORY, ++ B_USER_DOCUMENTATION_DIRECTORY, ++ B_USER_SERVERS_DIRECTORY, ++ B_USER_APPS_DIRECTORY, ++ B_USER_BIN_DIRECTORY, ++ B_USER_PREFERENCES_DIRECTORY, ++ B_USER_ETC_DIRECTORY, ++ B_USER_LOG_DIRECTORY, ++ B_USER_SPOOL_DIRECTORY, ++ B_USER_VAR_DIRECTORY, ++ B_APPS_DIRECTORY = 4000, ++ B_PREFERENCES_DIRECTORY, ++ B_UTILITIES_DIRECTORY, ++ B_PACKAGE_LINKS_DIRECTORY, ++ } ++ ++ // kernel/OS.h ++ ++ pub enum topology_level_type { ++ B_TOPOLOGY_UNKNOWN, ++ B_TOPOLOGY_ROOT, ++ B_TOPOLOGY_SMT, ++ B_TOPOLOGY_CORE, ++ B_TOPOLOGY_PACKAGE, ++ } ++ ++ pub enum cpu_platform { ++ B_CPU_UNKNOWN, ++ B_CPU_x86, ++ B_CPU_x86_64, ++ B_CPU_PPC, ++ B_CPU_PPC_64, ++ B_CPU_M68K, ++ B_CPU_ARM, ++ B_CPU_ARM_64, ++ B_CPU_ALPHA, ++ B_CPU_MIPS, ++ B_CPU_SH, ++ B_CPU_SPARC, ++ B_CPU_RISC_V, ++ } ++ ++ pub enum cpu_vendor { ++ B_CPU_VENDOR_UNKNOWN, ++ B_CPU_VENDOR_AMD, ++ B_CPU_VENDOR_CYRIX, ++ B_CPU_VENDOR_IDT, ++ B_CPU_VENDOR_INTEL, ++ B_CPU_VENDOR_NATIONAL_SEMICONDUCTOR, ++ B_CPU_VENDOR_RISE, ++ B_CPU_VENDOR_TRANSMETA, ++ B_CPU_VENDOR_VIA, ++ B_CPU_VENDOR_IBM, ++ B_CPU_VENDOR_MOTOROLA, ++ B_CPU_VENDOR_NEC, ++ B_CPU_VENDOR_HYGON, ++ B_CPU_VENDOR_SUN, ++ B_CPU_VENDOR_FUJITSU, ++ } ++} ++ ++s! { ++ // kernel/OS.h ++ pub struct area_info { ++ pub area: area_id, ++ pub name: [c_char; B_OS_NAME_LENGTH], ++ pub size: usize, ++ pub lock: u32, ++ pub protection: u32, ++ pub team: team_id, ++ pub ram_size: u32, ++ pub copy_count: u32, ++ pub in_count: u32, ++ pub out_count: u32, ++ pub address: *mut c_void, ++ } ++ ++ pub struct port_info { ++ pub port: port_id, ++ pub team: team_id, ++ pub name: [c_char; B_OS_NAME_LENGTH], ++ pub capacity: i32, ++ pub queue_count: i32, ++ pub total_count: i32, ++ } ++ ++ pub struct port_message_info { ++ pub size: size_t, ++ pub sender: crate::uid_t, ++ pub sender_group: crate::gid_t, ++ pub sender_team: crate::team_id, ++ } ++ ++ pub struct team_info { ++ pub team: team_id, ++ pub thread_count: i32, ++ pub image_count: i32, ++ pub area_count: i32, ++ pub debugger_nub_thread: thread_id, ++ pub debugger_nub_port: port_id, ++ pub argc: i32, ++ pub args: [c_char; 64], ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ } ++ ++ pub struct sem_info { ++ pub sem: sem_id, ++ pub team: team_id, ++ pub name: [c_char; B_OS_NAME_LENGTH], ++ pub count: i32, ++ pub latest_holder: thread_id, ++ } ++ ++ pub struct team_usage_info { ++ pub user_time: bigtime_t, ++ pub kernel_time: bigtime_t, ++ } ++ ++ pub struct thread_info { ++ pub thread: thread_id, ++ pub team: team_id, ++ pub name: [c_char; B_OS_NAME_LENGTH], ++ pub state: thread_state, ++ pub priority: i32, ++ pub sem: sem_id, ++ pub user_time: bigtime_t, ++ pub kernel_time: bigtime_t, ++ pub stack_base: *mut c_void, ++ pub stack_end: *mut c_void, ++ } ++ ++ pub struct cpu_info { ++ pub active_time: bigtime_t, ++ pub enabled: bool, ++ pub current_frequency: u64, ++ } ++ ++ pub struct system_info { ++ pub boot_time: bigtime_t, ++ pub cpu_count: u32, ++ pub max_pages: u64, ++ pub used_pages: u64, ++ pub cached_pages: u64, ++ pub block_cache_pages: u64, ++ pub ignored_pages: u64, ++ pub needed_memory: u64, ++ pub free_memory: u64, ++ pub max_swap_pages: u64, ++ pub free_swap_pages: u64, ++ pub page_faults: u32, ++ pub max_sems: u32, ++ pub used_sems: u32, ++ pub max_ports: u32, ++ pub used_ports: u32, ++ pub max_threads: u32, ++ pub used_threads: u32, ++ pub max_teams: u32, ++ pub used_teams: u32, ++ pub kernel_name: [c_char; B_FILE_NAME_LENGTH], ++ pub kernel_build_date: [c_char; B_OS_NAME_LENGTH], ++ pub kernel_build_time: [c_char; B_OS_NAME_LENGTH], ++ pub kernel_version: i64, ++ pub abi: u32, ++ } ++ ++ pub struct object_wait_info { ++ pub object: i32, ++ pub type_: u16, ++ pub events: u16, ++ } ++ ++ pub struct cpu_topology_root_info { ++ pub platform: cpu_platform, ++ } ++ ++ pub struct cpu_topology_package_info { ++ pub vendor: cpu_vendor, ++ pub cache_line_size: u32, ++ } ++ ++ pub struct cpu_topology_core_info { ++ pub model: u32, ++ pub default_frequency: u64, ++ } ++ // kernel/fs_attr.h ++ pub struct attr_info { ++ pub type_: u32, ++ pub size: off_t, ++ } ++ ++ // kernel/fs_index.h ++ pub struct index_info { ++ pub type_: u32, ++ pub size: off_t, ++ pub modification_time: crate::time_t, ++ pub creation_time: crate::time_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ } ++ ++ //kernel/fs_info.h ++ pub struct fs_info { ++ pub dev: crate::dev_t, ++ pub root: crate::ino_t, ++ pub flags: u32, ++ pub block_size: off_t, ++ pub io_size: off_t, ++ pub total_blocks: off_t, ++ pub free_blocks: off_t, ++ pub total_nodes: off_t, ++ pub free_nodes: off_t, ++ pub device_name: [c_char; 128], ++ pub volume_name: [c_char; B_FILE_NAME_LENGTH], ++ pub fsh_name: [c_char; B_OS_NAME_LENGTH], ++ } ++ ++ // kernel/image.h ++ pub struct image_info { ++ pub id: image_id, ++ pub image_type: c_int, ++ pub sequence: i32, ++ pub init_order: i32, ++ pub init_routine: extern "C" fn(), ++ pub term_routine: extern "C" fn(), ++ pub device: crate::dev_t, ++ pub node: crate::ino_t, ++ pub name: [c_char; crate::PATH_MAX as usize], ++ pub text: *mut c_void, ++ pub data: *mut c_void, ++ pub text_size: i32, ++ pub data_size: i32, ++ pub api_version: i32, ++ pub abi: i32, ++ } ++ ++ pub struct __c_anonymous_eax_0 { ++ pub max_eax: u32, ++ pub vendor_id: [c_char; 12], ++ } ++ ++ pub struct __c_anonymous_eax_1 { ++ pub stepping: u32, ++ pub model: u32, ++ pub family: u32, ++ pub tpe: u32, ++ __reserved_0: u32, ++ pub extended_model: u32, ++ pub extended_family: u32, ++ __reserved_1: u32, ++ pub brand_index: u32, ++ pub clflush: u32, ++ pub logical_cpus: u32, ++ pub apic_id: u32, ++ pub features: u32, ++ pub extended_features: u32, ++ } ++ ++ pub struct __c_anonymous_eax_2 { ++ pub call_num: u8, ++ pub cache_descriptors: [u8; 15], ++ } ++ ++ pub struct __c_anonymous_eax_3 { ++ __reserved: [u32; 2], ++ pub serial_number_high: u32, ++ pub serial_number_low: u32, ++ } ++ ++ pub struct __c_anonymous_regs { ++ pub eax: u32, ++ pub ebx: u32, ++ pub edx: u32, ++ pub ecx: u32, ++ } ++} ++ ++s_no_extra_traits! { ++ pub union cpuid_info { ++ pub eax_0: __c_anonymous_eax_0, ++ pub eax_1: __c_anonymous_eax_1, ++ pub eax_2: __c_anonymous_eax_2, ++ pub eax_3: __c_anonymous_eax_3, ++ pub as_chars: [c_char; 16], ++ pub regs: __c_anonymous_regs, ++ } ++ ++ pub union __c_anonymous_cpu_topology_info_data { ++ pub root: cpu_topology_root_info, ++ pub package: cpu_topology_package_info, ++ pub core: cpu_topology_core_info, ++ } ++ ++ pub struct cpu_topology_node_info { ++ pub id: u32, ++ pub type_: topology_level_type, ++ pub level: u32, ++ pub data: __c_anonymous_cpu_topology_info_data, ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for cpuid_info { ++ fn eq(&self, other: &cpuid_info) -> bool { ++ unsafe { ++ self.eax_0 == other.eax_0 ++ || self.eax_1 == other.eax_1 ++ || self.eax_2 == other.eax_2 ++ || self.eax_3 == other.eax_3 ++ || self.as_chars == other.as_chars ++ || self.regs == other.regs ++ } ++ } ++ } ++ impl Eq for cpuid_info {} ++ ++ impl PartialEq for __c_anonymous_cpu_topology_info_data { ++ fn eq(&self, other: &__c_anonymous_cpu_topology_info_data) -> bool { ++ unsafe { ++ self.root == other.root ++ || self.package == other.package ++ || self.core == other.core ++ } ++ } ++ } ++ impl Eq for __c_anonymous_cpu_topology_info_data {} ++ ++ impl PartialEq for cpu_topology_node_info { ++ fn eq(&self, other: &cpu_topology_node_info) -> bool { ++ self.id == other.id && self.type_ == other.type_ && self.level == other.level ++ } ++ } ++ ++ impl Eq for cpu_topology_node_info {} ++ impl fmt::Debug for cpu_topology_node_info { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("cpu_topology_node_info") ++ .field("id", &self.id) ++ .field("type", &self.type_) ++ .field("level", &self.level) ++ .finish() ++ } ++ } ++ } ++} ++ ++// kernel/OS.h ++pub const B_OS_NAME_LENGTH: usize = 32; ++pub const B_PAGE_SIZE: usize = 4096; ++pub const B_INFINITE_TIMEOUT: usize = 9223372036854775807; ++ ++pub const B_RELATIVE_TIMEOUT: u32 = 0x8; ++pub const B_ABSOLUTE_TIMEOUT: u32 = 0x10; ++pub const B_TIMEOUT_REAL_TIME_BASE: u32 = 0x40; ++pub const B_ABSOLUTE_REAL_TIME_TIMEOUT: u32 = B_ABSOLUTE_TIMEOUT | B_TIMEOUT_REAL_TIME_BASE; ++ ++pub const B_NO_LOCK: u32 = 0; ++pub const B_LAZY_LOCK: u32 = 1; ++pub const B_FULL_LOCK: u32 = 2; ++pub const B_CONTIGUOUS: u32 = 3; ++pub const B_LOMEM: u32 = 4; ++pub const B_32_BIT_FULL_LOCK: u32 = 5; ++pub const B_32_BIT_CONTIGUOUS: u32 = 6; ++ ++pub const B_ANY_ADDRESS: u32 = 0; ++pub const B_EXACT_ADDRESS: u32 = 1; ++pub const B_BASE_ADDRESS: u32 = 2; ++pub const B_CLONE_ADDRESS: u32 = 3; ++pub const B_ANY_KERNEL_ADDRESS: u32 = 4; ++pub const B_RANDOMIZED_ANY_ADDRESS: u32 = 6; ++pub const B_RANDOMIZED_BASE_ADDRESS: u32 = 7; ++ ++pub const B_READ_AREA: u32 = 1 << 0; ++pub const B_WRITE_AREA: u32 = 1 << 1; ++pub const B_EXECUTE_AREA: u32 = 1 << 2; ++pub const B_STACK_AREA: u32 = 1 << 3; ++pub const B_CLONEABLE_AREA: u32 = 1 << 8; ++ ++pub const B_CAN_INTERRUPT: u32 = 0x01; ++pub const B_CHECK_PERMISSION: u32 = 0x04; ++pub const B_KILL_CAN_INTERRUPT: u32 = 0x20; ++pub const B_DO_NOT_RESCHEDULE: u32 = 0x02; ++pub const B_RELEASE_ALL: u32 = 0x08; ++pub const B_RELEASE_IF_WAITING_ONLY: u32 = 0x10; ++ ++pub const B_CURRENT_TEAM: team_id = 0; ++pub const B_SYSTEM_TEAM: team_id = 1; ++ ++pub const B_TEAM_USAGE_SELF: i32 = 0; ++pub const B_TEAM_USAGE_CHILDREN: i32 = -1; ++ ++pub const B_IDLE_PRIORITY: i32 = 0; ++pub const B_LOWEST_ACTIVE_PRIORITY: i32 = 1; ++pub const B_LOW_PRIORITY: i32 = 5; ++pub const B_NORMAL_PRIORITY: i32 = 10; ++pub const B_DISPLAY_PRIORITY: i32 = 15; ++pub const B_URGENT_DISPLAY_PRIORITY: i32 = 20; ++pub const B_REAL_TIME_DISPLAY_PRIORITY: i32 = 100; ++pub const B_URGENT_PRIORITY: i32 = 110; ++pub const B_REAL_TIME_PRIORITY: i32 = 120; ++ ++pub const B_SYSTEM_TIMEBASE: i32 = 0; ++pub const B_FIRST_REAL_TIME_PRIORITY: i32 = B_REAL_TIME_DISPLAY_PRIORITY; ++ ++pub const B_ONE_SHOT_ABSOLUTE_ALARM: u32 = 1; ++pub const B_ONE_SHOT_RELATIVE_ALARM: u32 = 2; ++pub const B_PERIODIC_ALARM: u32 = 3; ++ ++pub const B_OBJECT_TYPE_FD: u16 = 0; ++pub const B_OBJECT_TYPE_SEMAPHORE: u16 = 1; ++pub const B_OBJECT_TYPE_PORT: u16 = 2; ++pub const B_OBJECT_TYPE_THREAD: u16 = 3; ++ ++pub const B_EVENT_READ: u16 = 0x0001; ++pub const B_EVENT_WRITE: u16 = 0x0002; ++pub const B_EVENT_ERROR: u16 = 0x0004; ++pub const B_EVENT_PRIORITY_READ: u16 = 0x0008; ++pub const B_EVENT_PRIORITY_WRITE: u16 = 0x0010; ++pub const B_EVENT_HIGH_PRIORITY_READ: u16 = 0x0020; ++pub const B_EVENT_HIGH_PRIORITY_WRITE: u16 = 0x0040; ++pub const B_EVENT_DISCONNECTED: u16 = 0x0080; ++pub const B_EVENT_ACQUIRE_SEMAPHORE: u16 = 0x0001; ++pub const B_EVENT_INVALID: u16 = 0x1000; ++ ++// kernel/fs_info.h ++pub const B_FS_IS_READONLY: u32 = 0x00000001; ++pub const B_FS_IS_REMOVABLE: u32 = 0x00000002; ++pub const B_FS_IS_PERSISTENT: u32 = 0x00000004; ++pub const B_FS_IS_SHARED: u32 = 0x00000008; ++pub const B_FS_HAS_MIME: u32 = 0x00010000; ++pub const B_FS_HAS_ATTR: u32 = 0x00020000; ++pub const B_FS_HAS_QUERY: u32 = 0x00040000; ++pub const B_FS_HAS_SELF_HEALING_LINKS: u32 = 0x00080000; ++pub const B_FS_HAS_ALIASES: u32 = 0x00100000; ++pub const B_FS_SUPPORTS_NODE_MONITORING: u32 = 0x00200000; ++pub const B_FS_SUPPORTS_MONITOR_CHILDREN: u32 = 0x00400000; ++ ++// kernel/fs_query.h ++pub const B_LIVE_QUERY: u32 = 0x00000001; ++pub const B_QUERY_NON_INDEXED: u32 = 0x00000002; ++ ++// kernel/fs_volume.h ++pub const B_MOUNT_READ_ONLY: u32 = 1; ++pub const B_MOUNT_VIRTUAL_DEVICE: u32 = 2; ++pub const B_FORCE_UNMOUNT: u32 = 1; ++ ++// kernel/image.h ++pub const B_FLUSH_DCACHE: u32 = 0x0001; ++pub const B_FLUSH_ICACHE: u32 = 0x0004; ++pub const B_INVALIDATE_DCACHE: u32 = 0x0002; ++pub const B_INVALIDATE_ICACHE: u32 = 0x0008; ++ ++pub const B_SYMBOL_TYPE_DATA: i32 = 0x1; ++pub const B_SYMBOL_TYPE_TEXT: i32 = 0x2; ++pub const B_SYMBOL_TYPE_ANY: i32 = 0x5; ++ ++// storage/StorageDefs.h ++pub const B_DEV_NAME_LENGTH: usize = 128; ++pub const B_FILE_NAME_LENGTH: usize = crate::FILENAME_MAX as usize; ++pub const B_PATH_NAME_LENGTH: usize = crate::PATH_MAX as usize; ++pub const B_ATTR_NAME_LENGTH: usize = B_FILE_NAME_LENGTH - 1; ++pub const B_MIME_TYPE_LENGTH: usize = B_ATTR_NAME_LENGTH - 15; ++pub const B_MAX_SYMLINKS: usize = 16; ++ ++// Haiku open modes in BFile are passed as u32 ++pub const B_READ_ONLY: u32 = crate::O_RDONLY as u32; ++pub const B_WRITE_ONLY: u32 = crate::O_WRONLY as u32; ++pub const B_READ_WRITE: u32 = crate::O_RDWR as u32; ++ ++pub const B_FAIL_IF_EXISTS: u32 = crate::O_EXCL as u32; ++pub const B_CREATE_FILE: u32 = crate::O_CREAT as u32; ++pub const B_ERASE_FILE: u32 = crate::O_TRUNC as u32; ++pub const B_OPEN_AT_END: u32 = crate::O_APPEND as u32; ++ ++pub const B_FILE_NODE: u32 = 0x01; ++pub const B_SYMLINK_NODE: u32 = 0x02; ++pub const B_DIRECTORY_NODE: u32 = 0x04; ++pub const B_ANY_NODE: u32 = 0x07; ++ ++// support/Errors.h ++pub const B_GENERAL_ERROR_BASE: status_t = core::i32::MIN; ++pub const B_OS_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x1000; ++pub const B_APP_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x2000; ++pub const B_INTERFACE_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x3000; ++pub const B_MEDIA_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x4000; ++pub const B_TRANSLATION_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x4800; ++pub const B_MIDI_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x5000; ++pub const B_STORAGE_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x6000; ++pub const B_POSIX_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x7000; ++pub const B_MAIL_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x8000; ++pub const B_PRINT_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0x9000; ++pub const B_DEVICE_ERROR_BASE: status_t = B_GENERAL_ERROR_BASE + 0xa000; ++pub const B_ERRORS_END: status_t = B_GENERAL_ERROR_BASE + 0xffff; ++ ++// General errors ++pub const B_NO_MEMORY: status_t = B_GENERAL_ERROR_BASE + 0; ++pub const B_IO_ERROR: status_t = B_GENERAL_ERROR_BASE + 1; ++pub const B_PERMISSION_DENIED: status_t = B_GENERAL_ERROR_BASE + 2; ++pub const B_BAD_INDEX: status_t = B_GENERAL_ERROR_BASE + 3; ++pub const B_BAD_TYPE: status_t = B_GENERAL_ERROR_BASE + 4; ++pub const B_BAD_VALUE: status_t = B_GENERAL_ERROR_BASE + 5; ++pub const B_MISMATCHED_VALUES: status_t = B_GENERAL_ERROR_BASE + 6; ++pub const B_NAME_NOT_FOUND: status_t = B_GENERAL_ERROR_BASE + 7; ++pub const B_NAME_IN_USE: status_t = B_GENERAL_ERROR_BASE + 8; ++pub const B_TIMED_OUT: status_t = B_GENERAL_ERROR_BASE + 9; ++pub const B_INTERRUPTED: status_t = B_GENERAL_ERROR_BASE + 10; ++pub const B_WOULD_BLOCK: status_t = B_GENERAL_ERROR_BASE + 11; ++pub const B_CANCELED: status_t = B_GENERAL_ERROR_BASE + 12; ++pub const B_NO_INIT: status_t = B_GENERAL_ERROR_BASE + 13; ++pub const B_NOT_INITIALIZED: status_t = B_GENERAL_ERROR_BASE + 13; ++pub const B_BUSY: status_t = B_GENERAL_ERROR_BASE + 14; ++pub const B_NOT_ALLOWED: status_t = B_GENERAL_ERROR_BASE + 15; ++pub const B_BAD_DATA: status_t = B_GENERAL_ERROR_BASE + 16; ++pub const B_DONT_DO_THAT: status_t = B_GENERAL_ERROR_BASE + 17; ++ ++pub const B_ERROR: status_t = -1; ++pub const B_OK: status_t = 0; ++pub const B_NO_ERROR: status_t = 0; ++ ++// Kernel kit errors ++pub const B_BAD_SEM_ID: status_t = B_OS_ERROR_BASE + 0; ++pub const B_NO_MORE_SEMS: status_t = B_OS_ERROR_BASE + 1; ++ ++pub const B_BAD_THREAD_ID: status_t = B_OS_ERROR_BASE + 0x100; ++pub const B_NO_MORE_THREADS: status_t = B_OS_ERROR_BASE + 0x101; ++pub const B_BAD_THREAD_STATE: status_t = B_OS_ERROR_BASE + 0x102; ++pub const B_BAD_TEAM_ID: status_t = B_OS_ERROR_BASE + 0x103; ++pub const B_NO_MORE_TEAMS: status_t = B_OS_ERROR_BASE + 0x104; ++ ++pub const B_BAD_PORT_ID: status_t = B_OS_ERROR_BASE + 0x200; ++pub const B_NO_MORE_PORTS: status_t = B_OS_ERROR_BASE + 0x201; ++ ++pub const B_BAD_IMAGE_ID: status_t = B_OS_ERROR_BASE + 0x300; ++pub const B_BAD_ADDRESS: status_t = B_OS_ERROR_BASE + 0x301; ++pub const B_NOT_AN_EXECUTABLE: status_t = B_OS_ERROR_BASE + 0x302; ++pub const B_MISSING_LIBRARY: status_t = B_OS_ERROR_BASE + 0x303; ++pub const B_MISSING_SYMBOL: status_t = B_OS_ERROR_BASE + 0x304; ++pub const B_UNKNOWN_EXECUTABLE: status_t = B_OS_ERROR_BASE + 0x305; ++pub const B_LEGACY_EXECUTABLE: status_t = B_OS_ERROR_BASE + 0x306; ++ ++pub const B_DEBUGGER_ALREADY_INSTALLED: status_t = B_OS_ERROR_BASE + 0x400; ++ ++// Application kit errors ++pub const B_BAD_REPLY: status_t = B_APP_ERROR_BASE + 0; ++pub const B_DUPLICATE_REPLY: status_t = B_APP_ERROR_BASE + 1; ++pub const B_MESSAGE_TO_SELF: status_t = B_APP_ERROR_BASE + 2; ++pub const B_BAD_HANDLER: status_t = B_APP_ERROR_BASE + 3; ++pub const B_ALREADY_RUNNING: status_t = B_APP_ERROR_BASE + 4; ++pub const B_LAUNCH_FAILED: status_t = B_APP_ERROR_BASE + 5; ++pub const B_AMBIGUOUS_APP_LAUNCH: status_t = B_APP_ERROR_BASE + 6; ++pub const B_UNKNOWN_MIME_TYPE: status_t = B_APP_ERROR_BASE + 7; ++pub const B_BAD_SCRIPT_SYNTAX: status_t = B_APP_ERROR_BASE + 8; ++pub const B_LAUNCH_FAILED_NO_RESOLVE_LINK: status_t = B_APP_ERROR_BASE + 9; ++pub const B_LAUNCH_FAILED_EXECUTABLE: status_t = B_APP_ERROR_BASE + 10; ++pub const B_LAUNCH_FAILED_APP_NOT_FOUND: status_t = B_APP_ERROR_BASE + 11; ++pub const B_LAUNCH_FAILED_APP_IN_TRASH: status_t = B_APP_ERROR_BASE + 12; ++pub const B_LAUNCH_FAILED_NO_PREFERRED_APP: status_t = B_APP_ERROR_BASE + 13; ++pub const B_LAUNCH_FAILED_FILES_APP_NOT_FOUND: status_t = B_APP_ERROR_BASE + 14; ++pub const B_BAD_MIME_SNIFFER_RULE: status_t = B_APP_ERROR_BASE + 15; ++pub const B_NOT_A_MESSAGE: status_t = B_APP_ERROR_BASE + 16; ++pub const B_SHUTDOWN_CANCELLED: status_t = B_APP_ERROR_BASE + 17; ++pub const B_SHUTTING_DOWN: status_t = B_APP_ERROR_BASE + 18; ++ ++// Storage kit errors ++pub const B_FILE_ERROR: status_t = B_STORAGE_ERROR_BASE + 0; ++pub const B_FILE_EXISTS: status_t = B_STORAGE_ERROR_BASE + 2; ++pub const B_ENTRY_NOT_FOUND: status_t = B_STORAGE_ERROR_BASE + 3; ++pub const B_NAME_TOO_LONG: status_t = B_STORAGE_ERROR_BASE + 4; ++pub const B_NOT_A_DIRECTORY: status_t = B_STORAGE_ERROR_BASE + 5; ++pub const B_DIRECTORY_NOT_EMPTY: status_t = B_STORAGE_ERROR_BASE + 6; ++pub const B_DEVICE_FULL: status_t = B_STORAGE_ERROR_BASE + 7; ++pub const B_READ_ONLY_DEVICE: status_t = B_STORAGE_ERROR_BASE + 8; ++pub const B_IS_A_DIRECTORY: status_t = B_STORAGE_ERROR_BASE + 9; ++pub const B_NO_MORE_FDS: status_t = B_STORAGE_ERROR_BASE + 10; ++pub const B_CROSS_DEVICE_LINK: status_t = B_STORAGE_ERROR_BASE + 11; ++pub const B_LINK_LIMIT: status_t = B_STORAGE_ERROR_BASE + 12; ++pub const B_BUSTED_PIPE: status_t = B_STORAGE_ERROR_BASE + 13; ++pub const B_UNSUPPORTED: status_t = B_STORAGE_ERROR_BASE + 14; ++pub const B_PARTITION_TOO_SMALL: status_t = B_STORAGE_ERROR_BASE + 15; ++pub const B_PARTIAL_READ: status_t = B_STORAGE_ERROR_BASE + 16; ++pub const B_PARTIAL_WRITE: status_t = B_STORAGE_ERROR_BASE + 17; ++ ++// Mapped posix errors ++pub const B_BUFFER_OVERFLOW: status_t = crate::EOVERFLOW; ++pub const B_TOO_MANY_ARGS: status_t = crate::E2BIG; ++pub const B_FILE_TOO_LARGE: status_t = crate::EFBIG; ++pub const B_RESULT_NOT_REPRESENTABLE: status_t = crate::ERANGE; ++pub const B_DEVICE_NOT_FOUND: status_t = crate::ENODEV; ++pub const B_NOT_SUPPORTED: status_t = crate::EOPNOTSUPP; ++ ++// Media kit errors ++pub const B_STREAM_NOT_FOUND: status_t = B_MEDIA_ERROR_BASE + 0; ++pub const B_SERVER_NOT_FOUND: status_t = B_MEDIA_ERROR_BASE + 1; ++pub const B_RESOURCE_NOT_FOUND: status_t = B_MEDIA_ERROR_BASE + 2; ++pub const B_RESOURCE_UNAVAILABLE: status_t = B_MEDIA_ERROR_BASE + 3; ++pub const B_BAD_SUBSCRIBER: status_t = B_MEDIA_ERROR_BASE + 4; ++pub const B_SUBSCRIBER_NOT_ENTERED: status_t = B_MEDIA_ERROR_BASE + 5; ++pub const B_BUFFER_NOT_AVAILABLE: status_t = B_MEDIA_ERROR_BASE + 6; ++pub const B_LAST_BUFFER_ERROR: status_t = B_MEDIA_ERROR_BASE + 7; ++ ++pub const B_MEDIA_SYSTEM_FAILURE: status_t = B_MEDIA_ERROR_BASE + 100; ++pub const B_MEDIA_BAD_NODE: status_t = B_MEDIA_ERROR_BASE + 101; ++pub const B_MEDIA_NODE_BUSY: status_t = B_MEDIA_ERROR_BASE + 102; ++pub const B_MEDIA_BAD_FORMAT: status_t = B_MEDIA_ERROR_BASE + 103; ++pub const B_MEDIA_BAD_BUFFER: status_t = B_MEDIA_ERROR_BASE + 104; ++pub const B_MEDIA_TOO_MANY_NODES: status_t = B_MEDIA_ERROR_BASE + 105; ++pub const B_MEDIA_TOO_MANY_BUFFERS: status_t = B_MEDIA_ERROR_BASE + 106; ++pub const B_MEDIA_NODE_ALREADY_EXISTS: status_t = B_MEDIA_ERROR_BASE + 107; ++pub const B_MEDIA_BUFFER_ALREADY_EXISTS: status_t = B_MEDIA_ERROR_BASE + 108; ++pub const B_MEDIA_CANNOT_SEEK: status_t = B_MEDIA_ERROR_BASE + 109; ++pub const B_MEDIA_CANNOT_CHANGE_RUN_MODE: status_t = B_MEDIA_ERROR_BASE + 110; ++pub const B_MEDIA_APP_ALREADY_REGISTERED: status_t = B_MEDIA_ERROR_BASE + 111; ++pub const B_MEDIA_APP_NOT_REGISTERED: status_t = B_MEDIA_ERROR_BASE + 112; ++pub const B_MEDIA_CANNOT_RECLAIM_BUFFERS: status_t = B_MEDIA_ERROR_BASE + 113; ++pub const B_MEDIA_BUFFERS_NOT_RECLAIMED: status_t = B_MEDIA_ERROR_BASE + 114; ++pub const B_MEDIA_TIME_SOURCE_STOPPED: status_t = B_MEDIA_ERROR_BASE + 115; ++pub const B_MEDIA_TIME_SOURCE_BUSY: status_t = B_MEDIA_ERROR_BASE + 116; ++pub const B_MEDIA_BAD_SOURCE: status_t = B_MEDIA_ERROR_BASE + 117; ++pub const B_MEDIA_BAD_DESTINATION: status_t = B_MEDIA_ERROR_BASE + 118; ++pub const B_MEDIA_ALREADY_CONNECTED: status_t = B_MEDIA_ERROR_BASE + 119; ++pub const B_MEDIA_NOT_CONNECTED: status_t = B_MEDIA_ERROR_BASE + 120; ++pub const B_MEDIA_BAD_CLIP_FORMAT: status_t = B_MEDIA_ERROR_BASE + 121; ++pub const B_MEDIA_ADDON_FAILED: status_t = B_MEDIA_ERROR_BASE + 122; ++pub const B_MEDIA_ADDON_DISABLED: status_t = B_MEDIA_ERROR_BASE + 123; ++pub const B_MEDIA_CHANGE_IN_PROGRESS: status_t = B_MEDIA_ERROR_BASE + 124; ++pub const B_MEDIA_STALE_CHANGE_COUNT: status_t = B_MEDIA_ERROR_BASE + 125; ++pub const B_MEDIA_ADDON_RESTRICTED: status_t = B_MEDIA_ERROR_BASE + 126; ++pub const B_MEDIA_NO_HANDLER: status_t = B_MEDIA_ERROR_BASE + 127; ++pub const B_MEDIA_DUPLICATE_FORMAT: status_t = B_MEDIA_ERROR_BASE + 128; ++pub const B_MEDIA_REALTIME_DISABLED: status_t = B_MEDIA_ERROR_BASE + 129; ++pub const B_MEDIA_REALTIME_UNAVAILABLE: status_t = B_MEDIA_ERROR_BASE + 130; ++ ++// Mail kit errors ++pub const B_MAIL_NO_DAEMON: status_t = B_MAIL_ERROR_BASE + 0; ++pub const B_MAIL_UNKNOWN_USER: status_t = B_MAIL_ERROR_BASE + 1; ++pub const B_MAIL_WRONG_PASSWORD: status_t = B_MAIL_ERROR_BASE + 2; ++pub const B_MAIL_UNKNOWN_HOST: status_t = B_MAIL_ERROR_BASE + 3; ++pub const B_MAIL_ACCESS_ERROR: status_t = B_MAIL_ERROR_BASE + 4; ++pub const B_MAIL_UNKNOWN_FIELD: status_t = B_MAIL_ERROR_BASE + 5; ++pub const B_MAIL_NO_RECIPIENT: status_t = B_MAIL_ERROR_BASE + 6; ++pub const B_MAIL_INVALID_MAIL: status_t = B_MAIL_ERROR_BASE + 7; ++ ++// Print kit errors ++pub const B_NO_PRINT_SERVER: status_t = B_PRINT_ERROR_BASE + 0; ++ ++// Device kit errors ++pub const B_DEV_INVALID_IOCTL: status_t = B_DEVICE_ERROR_BASE + 0; ++pub const B_DEV_NO_MEMORY: status_t = B_DEVICE_ERROR_BASE + 1; ++pub const B_DEV_BAD_DRIVE_NUM: status_t = B_DEVICE_ERROR_BASE + 2; ++pub const B_DEV_NO_MEDIA: status_t = B_DEVICE_ERROR_BASE + 3; ++pub const B_DEV_UNREADABLE: status_t = B_DEVICE_ERROR_BASE + 4; ++pub const B_DEV_FORMAT_ERROR: status_t = B_DEVICE_ERROR_BASE + 5; ++pub const B_DEV_TIMEOUT: status_t = B_DEVICE_ERROR_BASE + 6; ++pub const B_DEV_RECALIBRATE_ERROR: status_t = B_DEVICE_ERROR_BASE + 7; ++pub const B_DEV_SEEK_ERROR: status_t = B_DEVICE_ERROR_BASE + 8; ++pub const B_DEV_ID_ERROR: status_t = B_DEVICE_ERROR_BASE + 9; ++pub const B_DEV_READ_ERROR: status_t = B_DEVICE_ERROR_BASE + 10; ++pub const B_DEV_WRITE_ERROR: status_t = B_DEVICE_ERROR_BASE + 11; ++pub const B_DEV_NOT_READY: status_t = B_DEVICE_ERROR_BASE + 12; ++pub const B_DEV_MEDIA_CHANGED: status_t = B_DEVICE_ERROR_BASE + 13; ++pub const B_DEV_MEDIA_CHANGE_REQUESTED: status_t = B_DEVICE_ERROR_BASE + 14; ++pub const B_DEV_RESOURCE_CONFLICT: status_t = B_DEVICE_ERROR_BASE + 15; ++pub const B_DEV_CONFIGURATION_ERROR: status_t = B_DEVICE_ERROR_BASE + 16; ++pub const B_DEV_DISABLED_BY_USER: status_t = B_DEVICE_ERROR_BASE + 17; ++pub const B_DEV_DOOR_OPEN: status_t = B_DEVICE_ERROR_BASE + 18; ++ ++pub const B_DEV_INVALID_PIPE: status_t = B_DEVICE_ERROR_BASE + 19; ++pub const B_DEV_CRC_ERROR: status_t = B_DEVICE_ERROR_BASE + 20; ++pub const B_DEV_STALLED: status_t = B_DEVICE_ERROR_BASE + 21; ++pub const B_DEV_BAD_PID: status_t = B_DEVICE_ERROR_BASE + 22; ++pub const B_DEV_UNEXPECTED_PID: status_t = B_DEVICE_ERROR_BASE + 23; ++pub const B_DEV_DATA_OVERRUN: status_t = B_DEVICE_ERROR_BASE + 24; ++pub const B_DEV_DATA_UNDERRUN: status_t = B_DEVICE_ERROR_BASE + 25; ++pub const B_DEV_FIFO_OVERRUN: status_t = B_DEVICE_ERROR_BASE + 26; ++pub const B_DEV_FIFO_UNDERRUN: status_t = B_DEVICE_ERROR_BASE + 27; ++pub const B_DEV_PENDING: status_t = B_DEVICE_ERROR_BASE + 28; ++pub const B_DEV_MULTIPLE_ERRORS: status_t = B_DEVICE_ERROR_BASE + 29; ++pub const B_DEV_TOO_LATE: status_t = B_DEVICE_ERROR_BASE + 30; ++ ++// translation kit errors ++pub const B_TRANSLATION_BASE_ERROR: status_t = B_TRANSLATION_ERROR_BASE + 0; ++pub const B_NO_TRANSLATOR: status_t = B_TRANSLATION_ERROR_BASE + 1; ++pub const B_ILLEGAL_DATA: status_t = B_TRANSLATION_ERROR_BASE + 2; ++ ++// support/TypeConstants.h ++pub const B_AFFINE_TRANSFORM_TYPE: u32 = haiku_constant!('A', 'M', 'T', 'X'); ++pub const B_ALIGNMENT_TYPE: u32 = haiku_constant!('A', 'L', 'G', 'N'); ++pub const B_ANY_TYPE: u32 = haiku_constant!('A', 'N', 'Y', 'T'); ++pub const B_ATOM_TYPE: u32 = haiku_constant!('A', 'T', 'O', 'M'); ++pub const B_ATOMREF_TYPE: u32 = haiku_constant!('A', 'T', 'M', 'R'); ++pub const B_BOOL_TYPE: u32 = haiku_constant!('B', 'O', 'O', 'L'); ++pub const B_CHAR_TYPE: u32 = haiku_constant!('C', 'H', 'A', 'R'); ++pub const B_COLOR_8_BIT_TYPE: u32 = haiku_constant!('C', 'L', 'R', 'B'); ++pub const B_DOUBLE_TYPE: u32 = haiku_constant!('D', 'B', 'L', 'E'); ++pub const B_FLOAT_TYPE: u32 = haiku_constant!('F', 'L', 'O', 'T'); ++pub const B_GRAYSCALE_8_BIT_TYPE: u32 = haiku_constant!('G', 'R', 'Y', 'B'); ++pub const B_INT16_TYPE: u32 = haiku_constant!('S', 'H', 'R', 'T'); ++pub const B_INT32_TYPE: u32 = haiku_constant!('L', 'O', 'N', 'G'); ++pub const B_INT64_TYPE: u32 = haiku_constant!('L', 'L', 'N', 'G'); ++pub const B_INT8_TYPE: u32 = haiku_constant!('B', 'Y', 'T', 'E'); ++pub const B_LARGE_ICON_TYPE: u32 = haiku_constant!('I', 'C', 'O', 'N'); ++pub const B_MEDIA_PARAMETER_GROUP_TYPE: u32 = haiku_constant!('B', 'M', 'C', 'G'); ++pub const B_MEDIA_PARAMETER_TYPE: u32 = haiku_constant!('B', 'M', 'C', 'T'); ++pub const B_MEDIA_PARAMETER_WEB_TYPE: u32 = haiku_constant!('B', 'M', 'C', 'W'); ++pub const B_MESSAGE_TYPE: u32 = haiku_constant!('M', 'S', 'G', 'G'); ++pub const B_MESSENGER_TYPE: u32 = haiku_constant!('M', 'S', 'N', 'G'); ++pub const B_MIME_TYPE: u32 = haiku_constant!('M', 'I', 'M', 'E'); ++pub const B_MINI_ICON_TYPE: u32 = haiku_constant!('M', 'I', 'C', 'N'); ++pub const B_MONOCHROME_1_BIT_TYPE: u32 = haiku_constant!('M', 'N', 'O', 'B'); ++pub const B_OBJECT_TYPE: u32 = haiku_constant!('O', 'P', 'T', 'R'); ++pub const B_OFF_T_TYPE: u32 = haiku_constant!('O', 'F', 'F', 'T'); ++pub const B_PATTERN_TYPE: u32 = haiku_constant!('P', 'A', 'T', 'N'); ++pub const B_POINTER_TYPE: u32 = haiku_constant!('P', 'N', 'T', 'R'); ++pub const B_POINT_TYPE: u32 = haiku_constant!('B', 'P', 'N', 'T'); ++pub const B_PROPERTY_INFO_TYPE: u32 = haiku_constant!('S', 'C', 'T', 'D'); ++pub const B_RAW_TYPE: u32 = haiku_constant!('R', 'A', 'W', 'T'); ++pub const B_RECT_TYPE: u32 = haiku_constant!('R', 'E', 'C', 'T'); ++pub const B_REF_TYPE: u32 = haiku_constant!('R', 'R', 'E', 'F'); ++pub const B_RGB_32_BIT_TYPE: u32 = haiku_constant!('R', 'G', 'B', 'B'); ++pub const B_RGB_COLOR_TYPE: u32 = haiku_constant!('R', 'G', 'B', 'C'); ++pub const B_SIZE_TYPE: u32 = haiku_constant!('S', 'I', 'Z', 'E'); ++pub const B_SIZE_T_TYPE: u32 = haiku_constant!('S', 'I', 'Z', 'T'); ++pub const B_SSIZE_T_TYPE: u32 = haiku_constant!('S', 'S', 'Z', 'T'); ++pub const B_STRING_TYPE: u32 = haiku_constant!('C', 'S', 'T', 'R'); ++pub const B_STRING_LIST_TYPE: u32 = haiku_constant!('S', 'T', 'R', 'L'); ++pub const B_TIME_TYPE: u32 = haiku_constant!('T', 'I', 'M', 'E'); ++pub const B_UINT16_TYPE: u32 = haiku_constant!('U', 'S', 'H', 'T'); ++pub const B_UINT32_TYPE: u32 = haiku_constant!('U', 'L', 'N', 'G'); ++pub const B_UINT64_TYPE: u32 = haiku_constant!('U', 'L', 'L', 'G'); ++pub const B_UINT8_TYPE: u32 = haiku_constant!('U', 'B', 'Y', 'T'); ++pub const B_VECTOR_ICON_TYPE: u32 = haiku_constant!('V', 'I', 'C', 'N'); ++pub const B_XATTR_TYPE: u32 = haiku_constant!('X', 'A', 'T', 'R'); ++pub const B_NETWORK_ADDRESS_TYPE: u32 = haiku_constant!('N', 'W', 'A', 'D'); ++pub const B_MIME_STRING_TYPE: u32 = haiku_constant!('M', 'I', 'M', 'S'); ++pub const B_ASCII_TYPE: u32 = haiku_constant!('T', 'E', 'X', 'T'); ++pub const B_APP_IMAGE_SYMBOL: *const c_void = core::ptr::null(); ++ ++extern "C" { ++ // kernel/OS.h ++ pub fn create_area( ++ name: *const c_char, ++ startAddress: *mut *mut c_void, ++ addressSpec: u32, ++ size: usize, ++ lock: u32, ++ protection: u32, ++ ) -> area_id; ++ pub fn clone_area( ++ name: *const c_char, ++ destAddress: *mut *mut c_void, ++ addressSpec: u32, ++ protection: u32, ++ source: area_id, ++ ) -> area_id; ++ pub fn find_area(name: *const c_char) -> area_id; ++ pub fn area_for(address: *mut c_void) -> area_id; ++ pub fn delete_area(id: area_id) -> status_t; ++ pub fn resize_area(id: area_id, newSize: usize) -> status_t; ++ pub fn set_area_protection(id: area_id, newProtection: u32) -> status_t; ++ pub fn _get_area_info(id: area_id, areaInfo: *mut area_info, size: usize) -> status_t; ++ pub fn _get_next_area_info( ++ team: team_id, ++ cookie: *mut isize, ++ areaInfo: *mut area_info, ++ size: usize, ++ ) -> status_t; ++ ++ pub fn create_port(capacity: i32, name: *const c_char) -> port_id; ++ pub fn find_port(name: *const c_char) -> port_id; ++ pub fn read_port( ++ port: port_id, ++ code: *mut i32, ++ buffer: *mut c_void, ++ bufferSize: size_t, ++ ) -> ssize_t; ++ pub fn read_port_etc( ++ port: port_id, ++ code: *mut i32, ++ buffer: *mut c_void, ++ bufferSize: size_t, ++ flags: u32, ++ timeout: bigtime_t, ++ ) -> ssize_t; ++ pub fn write_port( ++ port: port_id, ++ code: i32, ++ buffer: *const c_void, ++ bufferSize: size_t, ++ ) -> status_t; ++ pub fn write_port_etc( ++ port: port_id, ++ code: i32, ++ buffer: *const c_void, ++ bufferSize: size_t, ++ flags: u32, ++ timeout: bigtime_t, ++ ) -> status_t; ++ pub fn close_port(port: port_id) -> status_t; ++ pub fn delete_port(port: port_id) -> status_t; ++ pub fn port_buffer_size(port: port_id) -> ssize_t; ++ pub fn port_buffer_size_etc(port: port_id, flags: u32, timeout: bigtime_t) -> ssize_t; ++ pub fn port_count(port: port_id) -> ssize_t; ++ pub fn set_port_owner(port: port_id, team: team_id) -> status_t; ++ ++ pub fn _get_port_info(port: port_id, buf: *mut port_info, portInfoSize: size_t) -> status_t; ++ pub fn _get_next_port_info( ++ port: port_id, ++ cookie: *mut i32, ++ portInfo: *mut port_info, ++ portInfoSize: size_t, ++ ) -> status_t; ++ pub fn _get_port_message_info_etc( ++ port: port_id, ++ info: *mut port_message_info, ++ infoSize: size_t, ++ flags: u32, ++ timeout: bigtime_t, ++ ) -> status_t; ++ ++ pub fn create_sem(count: i32, name: *const c_char) -> sem_id; ++ pub fn delete_sem(id: sem_id) -> status_t; ++ pub fn acquire_sem(id: sem_id) -> status_t; ++ pub fn acquire_sem_etc(id: sem_id, count: i32, flags: u32, timeout: bigtime_t) -> status_t; ++ pub fn release_sem(id: sem_id) -> status_t; ++ pub fn release_sem_etc(id: sem_id, count: i32, flags: u32) -> status_t; ++ pub fn switch_sem(semToBeReleased: sem_id, id: sem_id) -> status_t; ++ pub fn switch_sem_etc( ++ semToBeReleased: sem_id, ++ id: sem_id, ++ count: i32, ++ flags: u32, ++ timeout: bigtime_t, ++ ) -> status_t; ++ pub fn get_sem_count(id: sem_id, threadCount: *mut i32) -> status_t; ++ pub fn set_sem_owner(id: sem_id, team: team_id) -> status_t; ++ pub fn _get_sem_info(id: sem_id, info: *mut sem_info, infoSize: size_t) -> status_t; ++ pub fn _get_next_sem_info( ++ team: team_id, ++ cookie: *mut i32, ++ info: *mut sem_info, ++ infoSize: size_t, ++ ) -> status_t; ++ ++ pub fn kill_team(team: team_id) -> status_t; ++ pub fn _get_team_info(team: team_id, info: *mut team_info, size: size_t) -> status_t; ++ pub fn _get_next_team_info(cookie: *mut i32, info: *mut team_info, size: size_t) -> status_t; ++ ++ pub fn spawn_thread( ++ func: thread_func, ++ name: *const c_char, ++ priority: i32, ++ data: *mut c_void, ++ ) -> thread_id; ++ pub fn kill_thread(thread: thread_id) -> status_t; ++ pub fn resume_thread(thread: thread_id) -> status_t; ++ pub fn suspend_thread(thread: thread_id) -> status_t; ++ ++ pub fn rename_thread(thread: thread_id, newName: *const c_char) -> status_t; ++ pub fn set_thread_priority(thread: thread_id, newPriority: i32) -> status_t; ++ pub fn suggest_thread_priority( ++ what: u32, ++ period: i32, ++ jitter: crate::bigtime_t, ++ length: crate::bigtime_t, ++ ) -> i32; ++ pub fn estimate_max_scheduling_latency(th: crate::thread_id) -> crate::bigtime_t; ++ pub fn exit_thread(status: status_t); ++ pub fn wait_for_thread(thread: thread_id, returnValue: *mut status_t) -> status_t; ++ pub fn on_exit_thread(callback: extern "C" fn(*mut c_void), data: *mut c_void) -> status_t; ++ ++ pub fn find_thread(name: *const c_char) -> thread_id; ++ ++ pub fn get_scheduler_mode() -> i32; ++ pub fn set_scheduler_mode(mode: i32) -> status_t; ++ ++ pub fn send_data( ++ thread: thread_id, ++ code: i32, ++ buffer: *const c_void, ++ bufferSize: size_t, ++ ) -> status_t; ++ pub fn receive_data(sender: *mut thread_id, buffer: *mut c_void, bufferSize: size_t) -> i32; ++ pub fn has_data(thread: thread_id) -> bool; ++ ++ pub fn snooze(amount: bigtime_t) -> status_t; ++ pub fn snooze_etc(amount: bigtime_t, timeBase: c_int, flags: u32) -> status_t; ++ pub fn snooze_until(time: bigtime_t, timeBase: c_int) -> status_t; ++ ++ pub fn _get_thread_info(id: thread_id, info: *mut thread_info, size: size_t) -> status_t; ++ pub fn _get_next_thread_info( ++ team: team_id, ++ cookie: *mut i32, ++ info: *mut thread_info, ++ size: size_t, ++ ) -> status_t; ++ ++ pub fn get_pthread_thread_id(thread: crate::pthread_t) -> thread_id; ++ ++ pub fn _get_team_usage_info( ++ team: team_id, ++ who: i32, ++ info: *mut team_usage_info, ++ size: size_t, ++ ) -> status_t; ++ ++ pub fn real_time_clock() -> c_ulong; ++ pub fn set_real_time_clock(secsSinceJan1st1970: c_ulong); ++ pub fn real_time_clock_usecs() -> bigtime_t; ++ pub fn system_time() -> bigtime_t; ++ pub fn system_time_nsecs() -> nanotime_t; ++ // set_timezone() is deprecated and a no-op ++ ++ pub fn set_alarm(when: bigtime_t, flags: u32) -> bigtime_t; ++ pub fn debugger(message: *const c_char); ++ pub fn disable_debugger(state: c_int) -> c_int; ++ ++ pub fn get_system_info(info: *mut system_info) -> status_t; ++ pub fn _get_cpu_info_etc( ++ firstCPU: u32, ++ cpuCount: u32, ++ info: *mut cpu_info, ++ size: size_t, ++ ) -> status_t; ++ pub fn get_cpu_topology_info( ++ topologyInfos: *mut cpu_topology_node_info, ++ topologyInfoCount: *mut u32, ++ ) -> status_t; ++ pub fn is_computer_on() -> i32; ++ pub fn is_computer_on_fire() -> c_double; ++ pub fn send_signal(threadID: thread_id, signal: c_uint) -> c_int; ++ pub fn set_signal_stack(base: *mut c_void, size: size_t); ++ ++ pub fn wait_for_objects(infos: *mut object_wait_info, numInfos: c_int) -> ssize_t; ++ pub fn wait_for_objects_etc( ++ infos: *mut object_wait_info, ++ numInfos: c_int, ++ flags: u32, ++ timeout: bigtime_t, ++ ) -> ssize_t; ++ ++ // kernel/fs_attr.h ++ pub fn fs_read_attr( ++ fd: c_int, ++ attribute: *const c_char, ++ type_: u32, ++ pos: off_t, ++ buffer: *mut c_void, ++ readBytes: size_t, ++ ) -> ssize_t; ++ pub fn fs_write_attr( ++ fd: c_int, ++ attribute: *const c_char, ++ type_: u32, ++ pos: off_t, ++ buffer: *const c_void, ++ writeBytes: size_t, ++ ) -> ssize_t; ++ pub fn fs_remove_attr(fd: c_int, attribute: *const c_char) -> c_int; ++ pub fn fs_stat_attr(fd: c_int, attribute: *const c_char, attrInfo: *mut attr_info) -> c_int; ++ ++ pub fn fs_open_attr( ++ path: *const c_char, ++ attribute: *const c_char, ++ type_: u32, ++ openMode: c_int, ++ ) -> c_int; ++ pub fn fs_fopen_attr(fd: c_int, attribute: *const c_char, type_: u32, openMode: c_int) ++ -> c_int; ++ pub fn fs_close_attr(fd: c_int) -> c_int; ++ ++ pub fn fs_open_attr_dir(path: *const c_char) -> *mut crate::DIR; ++ pub fn fs_lopen_attr_dir(path: *const c_char) -> *mut crate::DIR; ++ pub fn fs_fopen_attr_dir(fd: c_int) -> *mut crate::DIR; ++ pub fn fs_close_attr_dir(dir: *mut crate::DIR) -> c_int; ++ pub fn fs_read_attr_dir(dir: *mut crate::DIR) -> *mut crate::dirent; ++ pub fn fs_rewind_attr_dir(dir: *mut crate::DIR); ++ ++ // kernel/fs_image.h ++ pub fn fs_create_index( ++ device: crate::dev_t, ++ name: *const c_char, ++ type_: u32, ++ flags: u32, ++ ) -> c_int; ++ pub fn fs_remove_index(device: crate::dev_t, name: *const c_char) -> c_int; ++ pub fn fs_stat_index( ++ device: crate::dev_t, ++ name: *const c_char, ++ indexInfo: *mut index_info, ++ ) -> c_int; ++ ++ pub fn fs_open_index_dir(device: crate::dev_t) -> *mut crate::DIR; ++ pub fn fs_close_index_dir(indexDirectory: *mut crate::DIR) -> c_int; ++ pub fn fs_read_index_dir(indexDirectory: *mut crate::DIR) -> *mut crate::dirent; ++ pub fn fs_rewind_index_dir(indexDirectory: *mut crate::DIR); ++ ++ // kernel/fs_info.h ++ pub fn dev_for_path(path: *const c_char) -> crate::dev_t; ++ pub fn next_dev(pos: *mut i32) -> crate::dev_t; ++ pub fn fs_stat_dev(dev: crate::dev_t, info: *mut fs_info) -> c_int; ++ ++ // kernel/fs_query.h ++ pub fn fs_open_query(device: crate::dev_t, query: *const c_char, flags: u32) ++ -> *mut crate::DIR; ++ pub fn fs_open_live_query( ++ device: crate::dev_t, ++ query: *const c_char, ++ flags: u32, ++ port: port_id, ++ token: i32, ++ ) -> *mut crate::DIR; ++ pub fn fs_close_query(d: *mut crate::DIR) -> c_int; ++ pub fn fs_read_query(d: *mut crate::DIR) -> *mut crate::dirent; ++ pub fn get_path_for_dirent(dent: *mut crate::dirent, buf: *mut c_char, len: size_t) ++ -> status_t; ++ ++ // kernel/fs_volume.h ++ pub fn fs_mount_volume( ++ where_: *const c_char, ++ device: *const c_char, ++ filesystem: *const c_char, ++ flags: u32, ++ parameters: *const c_char, ++ ) -> crate::dev_t; ++ pub fn fs_unmount_volume(path: *const c_char, flags: u32) -> status_t; ++ ++ // kernel/image.h ++ pub fn load_image( ++ argc: i32, ++ argv: *mut *const c_char, ++ environ: *mut *const c_char, ++ ) -> thread_id; ++ pub fn load_add_on(path: *const c_char) -> image_id; ++ pub fn unload_add_on(image: image_id) -> status_t; ++ pub fn get_image_symbol( ++ image: image_id, ++ name: *const c_char, ++ symbolType: i32, ++ symbolLocation: *mut *mut c_void, ++ ) -> status_t; ++ pub fn get_nth_image_symbol( ++ image: image_id, ++ n: i32, ++ nameBuffer: *mut c_char, ++ nameLength: *mut i32, ++ symbolType: *mut i32, ++ symbolLocation: *mut *mut c_void, ++ ) -> status_t; ++ pub fn clear_caches(address: *mut c_void, length: size_t, flags: u32); ++ pub fn _get_image_info(image: image_id, info: *mut image_info, size: size_t) -> status_t; ++ pub fn _get_next_image_info( ++ team: team_id, ++ cookie: *mut i32, ++ info: *mut image_info, ++ size: size_t, ++ ) -> status_t; ++ pub fn find_path( ++ codePointer: *const c_void, ++ baseDirectory: path_base_directory, ++ subPath: *const c_char, ++ pathBuffer: *mut c_char, ++ bufferSize: usize, ++ ) -> status_t; ++ pub fn find_path_etc( ++ codePointer: *const c_void, ++ dependency: *const c_char, ++ architecture: *const c_char, ++ baseDirectory: path_base_directory, ++ subPath: *const c_char, ++ flags: u32, ++ pathBuffer: *mut c_char, ++ bufferSize: size_t, ++ ) -> status_t; ++ pub fn find_path_for_path( ++ path: *const c_char, ++ baseDirectory: path_base_directory, ++ subPath: *const c_char, ++ pathBuffer: *mut c_char, ++ bufferSize: size_t, ++ ) -> status_t; ++ pub fn find_path_for_path_etc( ++ path: *const c_char, ++ dependency: *const c_char, ++ architecture: *const c_char, ++ baseDirectory: path_base_directory, ++ subPath: *const c_char, ++ flags: u32, ++ pathBuffer: *mut c_char, ++ bufferSize: size_t, ++ ) -> status_t; ++ pub fn find_paths( ++ baseDirectory: path_base_directory, ++ subPath: *const c_char, ++ _paths: *mut *mut *mut c_char, ++ pathCount: *mut size_t, ++ ) -> status_t; ++ pub fn find_paths_etc( ++ architecture: *const c_char, ++ baseDirectory: path_base_directory, ++ subPath: *const c_char, ++ flags: u32, ++ _paths: *mut *mut *mut c_char, ++ pathCount: *mut size_t, ++ ) -> status_t; ++ pub fn find_directory( ++ which: directory_which, ++ volume: crate::dev_t, ++ createIt: bool, ++ pathString: *mut c_char, ++ length: i32, ++ ) -> status_t; ++ ++ pub fn get_cpuid(info: *mut cpuid_info, eaxRegister: u32, cpuNum: u32) -> status_t; ++} ++ ++// The following functions are defined as macros in C/C++ ++#[inline] ++pub unsafe fn get_cpu_info(firstCPU: u32, cpuCount: u32, info: *mut cpu_info) -> status_t { ++ _get_cpu_info_etc( ++ firstCPU, ++ cpuCount, ++ info, ++ core::mem::size_of::() as size_t, ++ ) ++} ++ ++#[inline] ++pub unsafe fn get_area_info(id: area_id, info: *mut area_info) -> status_t { ++ _get_area_info(id, info, core::mem::size_of::() as usize) ++} ++ ++#[inline] ++pub unsafe fn get_next_area_info( ++ team: team_id, ++ cookie: *mut isize, ++ info: *mut area_info, ++) -> status_t { ++ _get_next_area_info( ++ team, ++ cookie, ++ info, ++ core::mem::size_of::() as usize, ++ ) ++} ++ ++#[inline] ++pub unsafe fn get_port_info(port: port_id, buf: *mut port_info) -> status_t { ++ _get_port_info(port, buf, core::mem::size_of::() as size_t) ++} ++ ++#[inline] ++pub unsafe fn get_next_port_info( ++ port: port_id, ++ cookie: *mut i32, ++ portInfo: *mut port_info, ++) -> status_t { ++ _get_next_port_info( ++ port, ++ cookie, ++ portInfo, ++ core::mem::size_of::() as size_t, ++ ) ++} ++ ++#[inline] ++pub unsafe fn get_port_message_info_etc( ++ port: port_id, ++ info: *mut port_message_info, ++ flags: u32, ++ timeout: bigtime_t, ++) -> status_t { ++ _get_port_message_info_etc( ++ port, ++ info, ++ core::mem::size_of::() as size_t, ++ flags, ++ timeout, ++ ) ++} ++ ++#[inline] ++pub unsafe fn get_sem_info(id: sem_id, info: *mut sem_info) -> status_t { ++ _get_sem_info(id, info, core::mem::size_of::() as size_t) ++} ++ ++#[inline] ++pub unsafe fn get_next_sem_info(team: team_id, cookie: *mut i32, info: *mut sem_info) -> status_t { ++ _get_next_sem_info( ++ team, ++ cookie, ++ info, ++ core::mem::size_of::() as size_t, ++ ) ++} ++ ++#[inline] ++pub unsafe fn get_team_info(team: team_id, info: *mut team_info) -> status_t { ++ _get_team_info(team, info, core::mem::size_of::() as size_t) ++} ++ ++#[inline] ++pub unsafe fn get_next_team_info(cookie: *mut i32, info: *mut team_info) -> status_t { ++ _get_next_team_info(cookie, info, core::mem::size_of::() as size_t) ++} ++ ++#[inline] ++pub unsafe fn get_team_usage_info(team: team_id, who: i32, info: *mut team_usage_info) -> status_t { ++ _get_team_usage_info( ++ team, ++ who, ++ info, ++ core::mem::size_of::() as size_t, ++ ) ++} ++ ++#[inline] ++pub unsafe fn get_thread_info(id: thread_id, info: *mut thread_info) -> status_t { ++ _get_thread_info(id, info, core::mem::size_of::() as size_t) ++} ++ ++#[inline] ++pub unsafe fn get_next_thread_info( ++ team: team_id, ++ cookie: *mut i32, ++ info: *mut thread_info, ++) -> status_t { ++ _get_next_thread_info( ++ team, ++ cookie, ++ info, ++ core::mem::size_of::() as size_t, ++ ) ++} ++ ++// kernel/image.h ++#[inline] ++pub unsafe fn get_image_info(image: image_id, info: *mut image_info) -> status_t { ++ _get_image_info(image, info, core::mem::size_of::() as size_t) ++} ++ ++#[inline] ++pub unsafe fn get_next_image_info( ++ team: team_id, ++ cookie: *mut i32, ++ info: *mut image_info, ++) -> status_t { ++ _get_next_image_info( ++ team, ++ cookie, ++ info, ++ core::mem::size_of::() as size_t, ++ ) ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/haiku/x86_64.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/haiku/x86_64.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/haiku/x86_64.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/haiku/x86_64.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,278 @@ ++use crate::prelude::*; ++ ++s_no_extra_traits! { ++ pub struct fpu_state { ++ pub control: c_ushort, ++ pub status: c_ushort, ++ pub tag: c_ushort, ++ pub opcode: c_ushort, ++ pub rip: c_ulong, ++ pub rdp: c_ulong, ++ pub mxcsr: c_uint, ++ pub mscsr_mask: c_uint, ++ pub _fpreg: [[c_uchar; 8]; 16], ++ pub _xmm: [[c_uchar; 16]; 16], ++ pub _reserved_416_511: [c_uchar; 96], ++ } ++ ++ pub struct xstate_hdr { ++ pub bv: c_ulong, ++ pub xcomp_bv: c_ulong, ++ pub _reserved: [c_uchar; 48], ++ } ++ ++ pub struct savefpu { ++ pub fp_fxsave: fpu_state, ++ pub fp_xstate: xstate_hdr, ++ pub _fp_ymm: [[c_uchar; 16]; 16], ++ } ++ ++ pub struct mcontext_t { ++ pub rax: c_ulong, ++ pub rbx: c_ulong, ++ pub rcx: c_ulong, ++ pub rdx: c_ulong, ++ pub rdi: c_ulong, ++ pub rsi: c_ulong, ++ pub rbp: c_ulong, ++ pub r8: c_ulong, ++ pub r9: c_ulong, ++ pub r10: c_ulong, ++ pub r11: c_ulong, ++ pub r12: c_ulong, ++ pub r13: c_ulong, ++ pub r14: c_ulong, ++ pub r15: c_ulong, ++ pub rsp: c_ulong, ++ pub rip: c_ulong, ++ pub rflags: c_ulong, ++ pub fpu: savefpu, ++ } ++ ++ pub struct ucontext_t { ++ pub uc_link: *mut ucontext_t, ++ pub uc_sigmask: crate::sigset_t, ++ pub uc_stack: crate::stack_t, ++ pub uc_mcontext: mcontext_t, ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for fpu_state { ++ fn eq(&self, other: &fpu_state) -> bool { ++ self.control == other.control ++ && self.status == other.status ++ && self.tag == other.tag ++ && self.opcode == other.opcode ++ && self.rip == other.rip ++ && self.rdp == other.rdp ++ && self.mxcsr == other.mxcsr ++ && self.mscsr_mask == other.mscsr_mask ++ && self ++ ._fpreg ++ .iter() ++ .zip(other._fpreg.iter()) ++ .all(|(a, b)| a == b) ++ && self._xmm.iter().zip(other._xmm.iter()).all(|(a, b)| a == b) ++ && self ++ ._reserved_416_511 ++ .iter() ++ .zip(other._reserved_416_511.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for fpu_state {} ++ impl fmt::Debug for fpu_state { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("fpu_state") ++ .field("control", &self.control) ++ .field("status", &self.status) ++ .field("tag", &self.tag) ++ .field("opcode", &self.opcode) ++ .field("rip", &self.rip) ++ .field("rdp", &self.rdp) ++ .field("mxcsr", &self.mxcsr) ++ .field("mscsr_mask", &self.mscsr_mask) ++ // FIXME: .field("_fpreg", &self._fpreg) ++ // FIXME: .field("_xmm", &self._xmm) ++ // FIXME: .field("_reserved_416_511", &self._reserved_416_511) ++ .finish() ++ } ++ } ++ impl hash::Hash for fpu_state { ++ fn hash(&self, state: &mut H) { ++ self.control.hash(state); ++ self.status.hash(state); ++ self.tag.hash(state); ++ self.opcode.hash(state); ++ self.rip.hash(state); ++ self.rdp.hash(state); ++ self.mxcsr.hash(state); ++ self.mscsr_mask.hash(state); ++ self._fpreg.hash(state); ++ self._xmm.hash(state); ++ self._reserved_416_511.hash(state); ++ } ++ } ++ ++ impl PartialEq for xstate_hdr { ++ fn eq(&self, other: &xstate_hdr) -> bool { ++ self.bv == other.bv ++ && self.xcomp_bv == other.xcomp_bv ++ && self ++ ._reserved ++ .iter() ++ .zip(other._reserved.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for xstate_hdr {} ++ impl fmt::Debug for xstate_hdr { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("xstate_hdr") ++ .field("bv", &self.bv) ++ .field("xcomp_bv", &self.xcomp_bv) ++ // FIXME: .field("_reserved", &field._reserved) ++ .finish() ++ } ++ } ++ impl hash::Hash for xstate_hdr { ++ fn hash(&self, state: &mut H) { ++ self.bv.hash(state); ++ self.xcomp_bv.hash(state); ++ self._reserved.hash(state); ++ } ++ } ++ ++ impl PartialEq for savefpu { ++ fn eq(&self, other: &savefpu) -> bool { ++ self.fp_fxsave == other.fp_fxsave ++ && self.fp_xstate == other.fp_xstate ++ && self ++ ._fp_ymm ++ .iter() ++ .zip(other._fp_ymm.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for savefpu {} ++ impl fmt::Debug for savefpu { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("savefpu") ++ .field("fp_fxsave", &self.fp_fxsave) ++ .field("fp_xstate", &self.fp_xstate) ++ // FIXME: .field("_fp_ymm", &field._fp_ymm) ++ .finish() ++ } ++ } ++ impl hash::Hash for savefpu { ++ fn hash(&self, state: &mut H) { ++ self.fp_fxsave.hash(state); ++ self.fp_xstate.hash(state); ++ self._fp_ymm.hash(state); ++ } ++ } ++ ++ impl PartialEq for mcontext_t { ++ fn eq(&self, other: &mcontext_t) -> bool { ++ self.rax == other.rax ++ && self.rbx == other.rbx ++ && self.rbx == other.rbx ++ && self.rcx == other.rcx ++ && self.rdx == other.rdx ++ && self.rdi == other.rdi ++ && self.rsi == other.rsi ++ && self.r8 == other.r8 ++ && self.r9 == other.r9 ++ && self.r10 == other.r10 ++ && self.r11 == other.r11 ++ && self.r12 == other.r12 ++ && self.r13 == other.r13 ++ && self.r14 == other.r14 ++ && self.r15 == other.r15 ++ && self.rsp == other.rsp ++ && self.rip == other.rip ++ && self.rflags == other.rflags ++ && self.fpu == other.fpu ++ } ++ } ++ impl Eq for mcontext_t {} ++ impl fmt::Debug for mcontext_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("mcontext_t") ++ .field("rax", &self.rax) ++ .field("rbx", &self.rbx) ++ .field("rcx", &self.rcx) ++ .field("rdx", &self.rdx) ++ .field("rdi", &self.rdi) ++ .field("rsi", &self.rsi) ++ .field("rbp", &self.rbp) ++ .field("r8", &self.r8) ++ .field("r9", &self.r9) ++ .field("r10", &self.r10) ++ .field("r11", &self.r11) ++ .field("r12", &self.r12) ++ .field("r13", &self.r13) ++ .field("r14", &self.r14) ++ .field("r15", &self.r15) ++ .field("rsp", &self.rsp) ++ .field("rip", &self.rip) ++ .field("rflags", &self.rflags) ++ .field("fpu", &self.fpu) ++ .finish() ++ } ++ } ++ impl hash::Hash for mcontext_t { ++ fn hash(&self, state: &mut H) { ++ self.rax.hash(state); ++ self.rbx.hash(state); ++ self.rcx.hash(state); ++ self.rdx.hash(state); ++ self.rdi.hash(state); ++ self.rsi.hash(state); ++ self.rbp.hash(state); ++ self.r8.hash(state); ++ self.r9.hash(state); ++ self.r10.hash(state); ++ self.r11.hash(state); ++ self.r12.hash(state); ++ self.r13.hash(state); ++ self.r14.hash(state); ++ self.r15.hash(state); ++ self.rsp.hash(state); ++ self.rip.hash(state); ++ self.rflags.hash(state); ++ self.fpu.hash(state); ++ } ++ } ++ ++ impl PartialEq for ucontext_t { ++ fn eq(&self, other: &ucontext_t) -> bool { ++ self.uc_link == other.uc_link ++ && self.uc_sigmask == other.uc_sigmask ++ && self.uc_stack == other.uc_stack ++ && self.uc_mcontext == other.uc_mcontext ++ } ++ } ++ impl Eq for ucontext_t {} ++ impl fmt::Debug for ucontext_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("ucontext_t") ++ .field("uc_link", &self.uc_link) ++ .field("uc_sigmask", &self.uc_sigmask) ++ .field("uc_stack", &self.uc_stack) ++ .field("uc_mcontext", &self.uc_mcontext) ++ .finish() ++ } ++ } ++ impl hash::Hash for ucontext_t { ++ fn hash(&self, state: &mut H) { ++ self.uc_link.hash(state); ++ self.uc_sigmask.hash(state); ++ self.uc_stack.hash(state); ++ self.uc_mcontext.hash(state); ++ } ++ } ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/hurd/b32.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/hurd/b32.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/hurd/b32.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/hurd/b32.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,95 @@ ++use crate::prelude::*; ++ ++pub type c_long = i32; ++pub type c_ulong = u32; ++ ++pub type __int64_t = c_longlong; ++pub type __uint64_t = c_ulonglong; ++ ++pub type int_fast16_t = c_int; ++pub type int_fast32_t = c_int; ++pub type int_fast64_t = c_longlong; ++pub type uint_fast16_t = c_uint; ++pub type uint_fast32_t = c_uint; ++pub type uint_fast64_t = c_ulonglong; ++ ++pub type __quad_t = c_longlong; ++pub type __u_quad_t = c_ulonglong; ++pub type __intmax_t = c_longlong; ++pub type __uintmax_t = c_ulonglong; ++ ++pub type __squad_type = crate::__int64_t; ++pub type __uquad_type = crate::__uint64_t; ++pub type __sword_type = c_int; ++pub type __uword_type = c_uint; ++pub type __slong32_type = c_long; ++pub type __ulong32_type = c_ulong; ++pub type __s64_type = crate::__int64_t; ++pub type __u64_type = crate::__uint64_t; ++ ++pub type __ipc_pid_t = c_ushort; ++ ++pub type Elf32_Half = u16; ++pub type Elf32_Word = u32; ++pub type Elf32_Off = u32; ++pub type Elf32_Addr = u32; ++pub type Elf32_Section = u16; ++ ++pub type Elf_Addr = crate::Elf32_Addr; ++pub type Elf_Half = crate::Elf32_Half; ++pub type Elf_Ehdr = crate::Elf32_Ehdr; ++pub type Elf_Phdr = crate::Elf32_Phdr; ++pub type Elf_Shdr = crate::Elf32_Shdr; ++pub type Elf_Sym = crate::Elf32_Sym; ++ ++s! { ++ pub struct Elf32_Ehdr { ++ pub e_ident: [c_uchar; 16], ++ pub e_type: Elf32_Half, ++ pub e_machine: Elf32_Half, ++ pub e_version: Elf32_Word, ++ pub e_entry: Elf32_Addr, ++ pub e_phoff: Elf32_Off, ++ pub e_shoff: Elf32_Off, ++ pub e_flags: Elf32_Word, ++ pub e_ehsize: Elf32_Half, ++ pub e_phentsize: Elf32_Half, ++ pub e_phnum: Elf32_Half, ++ pub e_shentsize: Elf32_Half, ++ pub e_shnum: Elf32_Half, ++ pub e_shstrndx: Elf32_Half, ++ } ++ ++ pub struct Elf32_Shdr { ++ pub sh_name: Elf32_Word, ++ pub sh_type: Elf32_Word, ++ pub sh_flags: Elf32_Word, ++ pub sh_addr: Elf32_Addr, ++ pub sh_offset: Elf32_Off, ++ pub sh_size: Elf32_Word, ++ pub sh_link: Elf32_Word, ++ pub sh_info: Elf32_Word, ++ pub sh_addralign: Elf32_Word, ++ pub sh_entsize: Elf32_Word, ++ } ++ ++ pub struct Elf32_Sym { ++ pub st_name: Elf32_Word, ++ pub st_value: Elf32_Addr, ++ pub st_size: Elf32_Word, ++ pub st_info: c_uchar, ++ pub st_other: c_uchar, ++ pub st_shndx: Elf32_Section, ++ } ++ ++ pub struct Elf32_Phdr { ++ pub p_type: crate::Elf32_Word, ++ pub p_offset: crate::Elf32_Off, ++ pub p_vaddr: crate::Elf32_Addr, ++ pub p_paddr: crate::Elf32_Addr, ++ pub p_filesz: crate::Elf32_Word, ++ pub p_memsz: crate::Elf32_Word, ++ pub p_flags: crate::Elf32_Word, ++ pub p_align: crate::Elf32_Word, ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/hurd/b64.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/hurd/b64.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/hurd/b64.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/hurd/b64.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,97 @@ ++use crate::prelude::*; ++ ++pub type c_long = i64; ++pub type c_ulong = u64; ++ ++pub type __int64_t = c_long; ++pub type __uint64_t = c_ulong; ++ ++pub type int_fast16_t = c_long; ++pub type int_fast32_t = c_long; ++pub type int_fast64_t = c_long; ++pub type uint_fast16_t = c_ulong; ++pub type uint_fast32_t = c_ulong; ++pub type uint_fast64_t = c_ulong; ++ ++pub type __quad_t = c_long; ++pub type __u_quad_t = c_ulong; ++pub type __intmax_t = c_long; ++pub type __uintmax_t = c_ulong; ++ ++pub type __squad_type = c_long; ++pub type __uquad_type = c_ulong; ++pub type __sword_type = c_long; ++pub type __uword_type = c_ulong; ++pub type __slong32_type = c_int; ++pub type __ulong32_type = c_uint; ++pub type __s64_type = c_long; ++pub type __u64_type = c_ulong; ++ ++pub type __ipc_pid_t = c_int; ++ ++pub type Elf64_Half = u16; ++pub type Elf64_Word = u32; ++pub type Elf64_Off = u64; ++pub type Elf64_Addr = u64; ++pub type Elf64_Xword = u64; ++pub type Elf64_Sxword = i64; ++pub type Elf64_Section = u16; ++ ++pub type Elf_Addr = crate::Elf64_Addr; ++pub type Elf_Half = crate::Elf64_Half; ++pub type Elf_Ehdr = crate::Elf64_Ehdr; ++pub type Elf_Phdr = crate::Elf64_Phdr; ++pub type Elf_Shdr = crate::Elf64_Shdr; ++pub type Elf_Sym = crate::Elf64_Sym; ++ ++s! { ++ pub struct Elf64_Ehdr { ++ pub e_ident: [c_uchar; 16], ++ pub e_type: Elf64_Half, ++ pub e_machine: Elf64_Half, ++ pub e_version: Elf64_Word, ++ pub e_entry: Elf64_Addr, ++ pub e_phoff: Elf64_Off, ++ pub e_shoff: Elf64_Off, ++ pub e_flags: Elf64_Word, ++ pub e_ehsize: Elf64_Half, ++ pub e_phentsize: Elf64_Half, ++ pub e_phnum: Elf64_Half, ++ pub e_shentsize: Elf64_Half, ++ pub e_shnum: Elf64_Half, ++ pub e_shstrndx: Elf64_Half, ++ } ++ ++ pub struct Elf64_Shdr { ++ pub sh_name: Elf64_Word, ++ pub sh_type: Elf64_Word, ++ pub sh_flags: Elf64_Xword, ++ pub sh_addr: Elf64_Addr, ++ pub sh_offset: Elf64_Off, ++ pub sh_size: Elf64_Xword, ++ pub sh_link: Elf64_Word, ++ pub sh_info: Elf64_Word, ++ pub sh_addralign: Elf64_Xword, ++ pub sh_entsize: Elf64_Xword, ++ } ++ ++ pub struct Elf64_Sym { ++ pub st_name: Elf64_Word, ++ pub st_info: c_uchar, ++ pub st_other: c_uchar, ++ pub st_shndx: Elf64_Section, ++ pub st_value: Elf64_Addr, ++ pub st_size: Elf64_Xword, ++ } ++ ++ pub struct Elf64_Phdr { ++ pub p_type: crate::Elf64_Word, ++ pub p_flags: crate::Elf64_Word, ++ pub p_offset: crate::Elf64_Off, ++ pub p_vaddr: crate::Elf64_Addr, ++ pub p_paddr: crate::Elf64_Addr, ++ pub p_filesz: crate::Elf64_Xword, ++ pub p_memsz: crate::Elf64_Xword, ++ pub p_align: crate::Elf64_Xword, ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/hurd/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/hurd/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/hurd/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/hurd/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,4648 @@ ++#![allow(dead_code)] ++ ++use crate::c_schar; ++use crate::prelude::*; ++ ++// types ++pub type c_char = i8; ++ ++pub type __s16_type = c_short; ++pub type __u16_type = c_ushort; ++pub type __s32_type = c_int; ++pub type __u32_type = c_uint; ++pub type __slongword_type = c_long; ++pub type __ulongword_type = c_ulong; ++ ++pub type __u_char = c_uchar; ++pub type __u_short = c_ushort; ++pub type __u_int = c_uint; ++pub type __u_long = c_ulong; ++pub type __int8_t = c_schar; ++pub type __uint8_t = c_uchar; ++pub type __int16_t = c_short; ++pub type __uint16_t = c_ushort; ++pub type __int32_t = c_int; ++pub type __uint32_t = c_uint; ++pub type __int_least8_t = __int8_t; ++pub type __uint_least8_t = __uint8_t; ++pub type __int_least16_t = __int16_t; ++pub type __uint_least16_t = __uint16_t; ++pub type __int_least32_t = __int32_t; ++pub type __uint_least32_t = __uint32_t; ++pub type __int_least64_t = __int64_t; ++pub type __uint_least64_t = __uint64_t; ++ ++pub type __dev_t = __uword_type; ++pub type __uid_t = __u32_type; ++pub type __gid_t = __u32_type; ++pub type __ino_t = __ulongword_type; ++pub type __ino64_t = __uquad_type; ++pub type __mode_t = __u32_type; ++pub type __nlink_t = __uword_type; ++pub type __off_t = __slongword_type; ++pub type __off64_t = __squad_type; ++pub type __pid_t = __s32_type; ++pub type __rlim_t = __ulongword_type; ++pub type __rlim64_t = __uquad_type; ++pub type __blkcnt_t = __slongword_type; ++pub type __blkcnt64_t = __squad_type; ++pub type __fsblkcnt_t = __ulongword_type; ++pub type __fsblkcnt64_t = __uquad_type; ++pub type __fsfilcnt_t = __ulongword_type; ++pub type __fsfilcnt64_t = __uquad_type; ++pub type __fsword_t = __sword_type; ++pub type __id_t = __u32_type; ++pub type __clock_t = __slongword_type; ++pub type __time_t = __slongword_type; ++pub type __useconds_t = __u32_type; ++pub type __suseconds_t = __slongword_type; ++pub type __suseconds64_t = __squad_type; ++pub type __daddr_t = __s32_type; ++pub type __key_t = __s32_type; ++pub type __clockid_t = __s32_type; ++pub type __timer_t = __uword_type; ++pub type __blksize_t = __slongword_type; ++pub type __fsid_t = __uquad_type; ++pub type __ssize_t = __sword_type; ++pub type __syscall_slong_t = __slongword_type; ++pub type __syscall_ulong_t = __ulongword_type; ++pub type __cpu_mask = __ulongword_type; ++ ++pub type __loff_t = __off64_t; ++pub type __caddr_t = *mut c_char; ++pub type __intptr_t = __sword_type; ++pub type __ptrdiff_t = __sword_type; ++pub type __socklen_t = __u32_type; ++pub type __sig_atomic_t = c_int; ++pub type __time64_t = __int64_t; ++pub type wchar_t = c_int; ++pub type wint_t = c_uint; ++pub type gid_t = __gid_t; ++pub type uid_t = __uid_t; ++pub type off_t = __off_t; ++pub type off64_t = __off64_t; ++pub type useconds_t = __useconds_t; ++pub type pid_t = __pid_t; ++pub type socklen_t = __socklen_t; ++ ++pub type in_addr_t = u32; ++ ++pub type _Float32 = f32; ++pub type _Float64 = f64; ++pub type _Float32x = f64; ++pub type _Float64x = f64; ++ ++pub type __locale_t = *mut __locale_struct; ++pub type locale_t = __locale_t; ++ ++pub type u_char = __u_char; ++pub type u_short = __u_short; ++pub type u_int = __u_int; ++pub type u_long = __u_long; ++pub type quad_t = __quad_t; ++pub type u_quad_t = __u_quad_t; ++pub type fsid_t = __fsid_t; ++pub type loff_t = __loff_t; ++pub type ino_t = __ino_t; ++pub type ino64_t = __ino64_t; ++pub type dev_t = __dev_t; ++pub type mode_t = __mode_t; ++pub type nlink_t = __nlink_t; ++pub type id_t = __id_t; ++pub type daddr_t = __daddr_t; ++pub type caddr_t = __caddr_t; ++pub type key_t = __key_t; ++pub type clock_t = __clock_t; ++pub type clockid_t = __clockid_t; ++pub type time_t = __time_t; ++pub type timer_t = __timer_t; ++pub type suseconds_t = __suseconds_t; ++pub type ulong = c_ulong; ++pub type ushort = c_ushort; ++pub type uint = c_uint; ++pub type u_int8_t = __uint8_t; ++pub type u_int16_t = __uint16_t; ++pub type u_int32_t = __uint32_t; ++pub type u_int64_t = __uint64_t; ++pub type register_t = c_int; ++pub type __sigset_t = c_ulong; ++pub type sigset_t = __sigset_t; ++ ++pub type __fd_mask = c_long; ++pub type fd_mask = __fd_mask; ++pub type blksize_t = __blksize_t; ++pub type blkcnt_t = __blkcnt_t; ++pub type fsblkcnt_t = __fsblkcnt_t; ++pub type fsfilcnt_t = __fsfilcnt_t; ++pub type blkcnt64_t = __blkcnt64_t; ++pub type fsblkcnt64_t = __fsblkcnt64_t; ++pub type fsfilcnt64_t = __fsfilcnt64_t; ++ ++pub type __pthread_spinlock_t = c_int; ++pub type __tss_t = c_int; ++pub type __thrd_t = c_long; ++pub type __pthread_t = c_long; ++pub type pthread_t = __pthread_t; ++pub type __pthread_process_shared = c_uint; ++pub type __pthread_inheritsched = c_uint; ++pub type __pthread_contentionscope = c_uint; ++pub type __pthread_detachstate = c_uint; ++pub type pthread_attr_t = __pthread_attr; ++pub type __pthread_mutex_protocol = c_uint; ++pub type __pthread_mutex_type = c_uint; ++pub type __pthread_mutex_robustness = c_uint; ++pub type pthread_mutexattr_t = __pthread_mutexattr; ++pub type pthread_mutex_t = __pthread_mutex; ++pub type pthread_condattr_t = __pthread_condattr; ++pub type pthread_cond_t = __pthread_cond; ++pub type pthread_spinlock_t = __pthread_spinlock_t; ++pub type pthread_rwlockattr_t = __pthread_rwlockattr; ++pub type pthread_rwlock_t = __pthread_rwlock; ++pub type pthread_barrierattr_t = __pthread_barrierattr; ++pub type pthread_barrier_t = __pthread_barrier; ++pub type __pthread_key = c_int; ++pub type pthread_key_t = __pthread_key; ++pub type pthread_once_t = __pthread_once; ++ ++pub type __rlimit_resource = c_uint; ++pub type __rlimit_resource_t = __rlimit_resource; ++pub type rlim_t = __rlim_t; ++pub type rlim64_t = __rlim64_t; ++ ++pub type __rusage_who = c_int; ++ ++pub type __priority_which = c_uint; ++ ++pub type sa_family_t = c_uchar; ++ ++pub type in_port_t = u16; ++ ++pub type __sigval_t = crate::sigval; ++ ++pub type sigevent_t = sigevent; ++ ++pub type nfds_t = c_ulong; ++ ++pub type tcflag_t = c_uint; ++pub type cc_t = c_uchar; ++pub type speed_t = c_int; ++ ++pub type sigval_t = crate::sigval; ++ ++pub type greg_t = c_int; ++pub type gregset_t = [greg_t; 19usize]; ++ ++pub type __ioctl_dir = c_uint; ++ ++pub type __ioctl_datum = c_uint; ++ ++pub type __error_t_codes = c_int; ++ ++pub type int_least8_t = __int_least8_t; ++pub type int_least16_t = __int_least16_t; ++pub type int_least32_t = __int_least32_t; ++pub type int_least64_t = __int_least64_t; ++pub type uint_least8_t = __uint_least8_t; ++pub type uint_least16_t = __uint_least16_t; ++pub type uint_least32_t = __uint_least32_t; ++pub type uint_least64_t = __uint_least64_t; ++pub type int_fast8_t = c_schar; ++pub type uint_fast8_t = c_uchar; ++pub type intmax_t = __intmax_t; ++pub type uintmax_t = __uintmax_t; ++ ++pub type tcp_seq = u32; ++ ++pub type tcp_ca_state = c_uint; ++ ++pub type idtype_t = c_uint; ++ ++pub type mqd_t = c_int; ++ ++pub type Lmid_t = c_long; ++ ++pub type regoff_t = c_int; ++ ++pub type nl_item = c_int; ++ ++pub type iconv_t = *mut c_void; ++ ++#[cfg_attr(feature = "extra_traits", derive(Debug))] ++pub enum fpos64_t {} // FIXME: fill this out with a struct ++impl Copy for fpos64_t {} ++impl Clone for fpos64_t { ++ fn clone(&self) -> fpos64_t { ++ *self ++ } ++} ++ ++#[cfg_attr(feature = "extra_traits", derive(Debug))] ++pub enum timezone {} ++impl Copy for timezone {} ++impl Clone for timezone { ++ fn clone(&self) -> timezone { ++ *self ++ } ++} ++ ++// structs ++s! { ++ pub struct ip_mreq { ++ pub imr_multiaddr: in_addr, ++ pub imr_interface: in_addr, ++ } ++ ++ pub struct ip_mreqn { ++ pub imr_multiaddr: in_addr, ++ pub imr_address: in_addr, ++ pub imr_ifindex: c_int, ++ } ++ ++ pub struct ip_mreq_source { ++ pub imr_multiaddr: in_addr, ++ pub imr_interface: in_addr, ++ pub imr_sourceaddr: in_addr, ++ } ++ ++ pub struct sockaddr { ++ pub sa_len: c_uchar, ++ pub sa_family: sa_family_t, ++ pub sa_data: [c_char; 14usize], ++ } ++ ++ pub struct in_addr { ++ pub s_addr: in_addr_t, ++ } ++ ++ pub struct sockaddr_in { ++ pub sin_len: c_uchar, ++ pub sin_family: sa_family_t, ++ pub sin_port: in_port_t, ++ pub sin_addr: crate::in_addr, ++ pub sin_zero: [c_uchar; 8usize], ++ } ++ ++ pub struct sockaddr_in6 { ++ pub sin6_len: c_uchar, ++ pub sin6_family: sa_family_t, ++ pub sin6_port: in_port_t, ++ pub sin6_flowinfo: u32, ++ pub sin6_addr: crate::in6_addr, ++ pub sin6_scope_id: u32, ++ } ++ ++ pub struct sockaddr_un { ++ pub sun_len: c_uchar, ++ pub sun_family: sa_family_t, ++ pub sun_path: [c_char; 108usize], ++ } ++ ++ pub struct sockaddr_storage { ++ pub ss_len: c_uchar, ++ pub ss_family: sa_family_t, ++ pub __ss_padding: [c_char; 122usize], ++ pub __ss_align: __uint32_t, ++ } ++ ++ pub struct sockaddr_at { ++ pub _address: u8, ++ } ++ ++ pub struct sockaddr_ax25 { ++ pub _address: u8, ++ } ++ ++ pub struct sockaddr_x25 { ++ pub _address: u8, ++ } ++ ++ pub struct sockaddr_dl { ++ pub _address: u8, ++ } ++ pub struct sockaddr_eon { ++ pub _address: u8, ++ } ++ pub struct sockaddr_inarp { ++ pub _address: u8, ++ } ++ ++ pub struct sockaddr_ipx { ++ pub _address: u8, ++ } ++ pub struct sockaddr_iso { ++ pub _address: u8, ++ } ++ ++ pub struct sockaddr_ns { ++ pub _address: u8, ++ } ++ ++ pub struct addrinfo { ++ pub ai_flags: c_int, ++ pub ai_family: c_int, ++ pub ai_socktype: c_int, ++ pub ai_protocol: c_int, ++ pub ai_addrlen: crate::socklen_t, ++ pub ai_addr: *mut sockaddr, ++ pub ai_canonname: *mut c_char, ++ pub ai_next: *mut addrinfo, ++ } ++ ++ pub struct msghdr { ++ pub msg_name: *mut c_void, ++ pub msg_namelen: crate::socklen_t, ++ pub msg_iov: *mut crate::iovec, ++ pub msg_iovlen: c_int, ++ pub msg_control: *mut c_void, ++ pub msg_controllen: crate::socklen_t, ++ pub msg_flags: c_int, ++ } ++ ++ pub struct cmsghdr { ++ pub cmsg_len: crate::socklen_t, ++ pub cmsg_level: c_int, ++ pub cmsg_type: c_int, ++ } ++ ++ pub struct dirent { ++ pub d_ino: __ino_t, ++ pub d_reclen: c_ushort, ++ pub d_type: c_uchar, ++ pub d_namlen: c_uchar, ++ pub d_name: [c_char; 1usize], ++ } ++ ++ pub struct dirent64 { ++ pub d_ino: __ino64_t, ++ pub d_reclen: c_ushort, ++ pub d_type: c_uchar, ++ pub d_namlen: c_uchar, ++ pub d_name: [c_char; 1usize], ++ } ++ ++ pub struct fd_set { ++ pub fds_bits: [__fd_mask; 8usize], ++ } ++ ++ pub struct termios { ++ pub c_iflag: crate::tcflag_t, ++ pub c_oflag: crate::tcflag_t, ++ pub c_cflag: crate::tcflag_t, ++ pub c_lflag: crate::tcflag_t, ++ pub c_cc: [crate::cc_t; 20usize], ++ pub __ispeed: crate::speed_t, ++ pub __ospeed: crate::speed_t, ++ } ++ ++ pub struct mallinfo { ++ pub arena: c_int, ++ pub ordblks: c_int, ++ pub smblks: c_int, ++ pub hblks: c_int, ++ pub hblkhd: c_int, ++ pub usmblks: c_int, ++ pub fsmblks: c_int, ++ pub uordblks: c_int, ++ pub fordblks: c_int, ++ pub keepcost: c_int, ++ } ++ ++ pub struct mallinfo2 { ++ pub arena: size_t, ++ pub ordblks: size_t, ++ pub smblks: size_t, ++ pub hblks: size_t, ++ pub hblkhd: size_t, ++ pub usmblks: size_t, ++ pub fsmblks: size_t, ++ pub uordblks: size_t, ++ pub fordblks: size_t, ++ pub keepcost: size_t, ++ } ++ ++ pub struct sigaction { ++ pub sa_sigaction: crate::sighandler_t, ++ pub sa_mask: __sigset_t, ++ pub sa_flags: c_int, ++ } ++ ++ pub struct sigevent { ++ pub sigev_value: crate::sigval, ++ pub sigev_signo: c_int, ++ pub sigev_notify: c_int, ++ __unused1: *mut c_void, //actually a function pointer ++ pub sigev_notify_attributes: *mut pthread_attr_t, ++ } ++ ++ pub struct siginfo_t { ++ pub si_signo: c_int, ++ pub si_errno: c_int, ++ pub si_code: c_int, ++ pub si_pid: __pid_t, ++ pub si_uid: __uid_t, ++ pub si_addr: *mut c_void, ++ pub si_status: c_int, ++ pub si_band: c_long, ++ pub si_value: crate::sigval, ++ } ++ ++ pub struct timespec { ++ pub tv_sec: __time_t, ++ pub tv_nsec: __syscall_slong_t, ++ } ++ ++ pub struct __timeval { ++ pub tv_sec: i32, ++ pub tv_usec: i32, ++ } ++ ++ pub struct __locale_data { ++ pub _address: u8, ++ } ++ ++ pub struct stat { ++ pub st_fstype: c_int, ++ pub st_dev: __fsid_t, /* Actually st_fsid */ ++ pub st_ino: __ino_t, ++ pub st_gen: c_uint, ++ pub st_rdev: __dev_t, ++ pub st_mode: __mode_t, ++ pub st_nlink: __nlink_t, ++ pub st_uid: __uid_t, ++ pub st_gid: __gid_t, ++ pub st_size: __off_t, ++ pub st_atim: crate::timespec, ++ pub st_mtim: crate::timespec, ++ pub st_ctim: crate::timespec, ++ pub st_blksize: __blksize_t, ++ pub st_blocks: __blkcnt_t, ++ pub st_author: __uid_t, ++ pub st_flags: c_uint, ++ pub st_spare: [c_int; 11usize], ++ } ++ ++ pub struct stat64 { ++ pub st_fstype: c_int, ++ pub st_dev: __fsid_t, /* Actually st_fsid */ ++ pub st_ino: __ino64_t, ++ pub st_gen: c_uint, ++ pub st_rdev: __dev_t, ++ pub st_mode: __mode_t, ++ pub st_nlink: __nlink_t, ++ pub st_uid: __uid_t, ++ pub st_gid: __gid_t, ++ pub st_size: __off64_t, ++ pub st_atim: crate::timespec, ++ pub st_mtim: crate::timespec, ++ pub st_ctim: crate::timespec, ++ pub st_blksize: __blksize_t, ++ pub st_blocks: __blkcnt64_t, ++ pub st_author: __uid_t, ++ pub st_flags: c_uint, ++ pub st_spare: [c_int; 8usize], ++ } ++ ++ pub struct statx { ++ pub stx_mask: u32, ++ pub stx_blksize: u32, ++ pub stx_attributes: u64, ++ pub stx_nlink: u32, ++ pub stx_uid: u32, ++ pub stx_gid: u32, ++ pub stx_mode: u16, ++ __statx_pad1: [u16; 1], ++ pub stx_ino: u64, ++ pub stx_size: u64, ++ pub stx_blocks: u64, ++ pub stx_attributes_mask: u64, ++ pub stx_atime: crate::statx_timestamp, ++ pub stx_btime: crate::statx_timestamp, ++ pub stx_ctime: crate::statx_timestamp, ++ pub stx_mtime: crate::statx_timestamp, ++ pub stx_rdev_major: u32, ++ pub stx_rdev_minor: u32, ++ pub stx_dev_major: u32, ++ pub stx_dev_minor: u32, ++ __statx_pad2: [u64; 14], ++ } ++ ++ pub struct statx_timestamp { ++ pub tv_sec: i64, ++ pub tv_nsec: u32, ++ pub __statx_timestamp_pad1: [i32; 1], ++ } ++ ++ pub struct statfs { ++ pub f_type: c_uint, ++ pub f_bsize: c_ulong, ++ pub f_blocks: __fsblkcnt_t, ++ pub f_bfree: __fsblkcnt_t, ++ pub f_bavail: __fsblkcnt_t, ++ pub f_files: __fsblkcnt_t, ++ pub f_ffree: __fsblkcnt_t, ++ pub f_fsid: __fsid_t, ++ pub f_namelen: c_ulong, ++ pub f_favail: __fsfilcnt_t, ++ pub f_frsize: c_ulong, ++ pub f_flag: c_ulong, ++ pub f_spare: [c_uint; 3usize], ++ } ++ ++ pub struct statfs64 { ++ pub f_type: c_uint, ++ pub f_bsize: c_ulong, ++ pub f_blocks: __fsblkcnt64_t, ++ pub f_bfree: __fsblkcnt64_t, ++ pub f_bavail: __fsblkcnt64_t, ++ pub f_files: __fsblkcnt64_t, ++ pub f_ffree: __fsblkcnt64_t, ++ pub f_fsid: __fsid_t, ++ pub f_namelen: c_ulong, ++ pub f_favail: __fsfilcnt64_t, ++ pub f_frsize: c_ulong, ++ pub f_flag: c_ulong, ++ pub f_spare: [c_uint; 3usize], ++ } ++ ++ pub struct statvfs { ++ pub __f_type: c_uint, ++ pub f_bsize: c_ulong, ++ pub f_blocks: __fsblkcnt_t, ++ pub f_bfree: __fsblkcnt_t, ++ pub f_bavail: __fsblkcnt_t, ++ pub f_files: __fsfilcnt_t, ++ pub f_ffree: __fsfilcnt_t, ++ pub f_fsid: __fsid_t, ++ pub f_namemax: c_ulong, ++ pub f_favail: __fsfilcnt_t, ++ pub f_frsize: c_ulong, ++ pub f_flag: c_ulong, ++ pub f_spare: [c_uint; 3usize], ++ } ++ ++ pub struct statvfs64 { ++ pub __f_type: c_uint, ++ pub f_bsize: c_ulong, ++ pub f_blocks: __fsblkcnt64_t, ++ pub f_bfree: __fsblkcnt64_t, ++ pub f_bavail: __fsblkcnt64_t, ++ pub f_files: __fsfilcnt64_t, ++ pub f_ffree: __fsfilcnt64_t, ++ pub f_fsid: __fsid_t, ++ pub f_namemax: c_ulong, ++ pub f_favail: __fsfilcnt64_t, ++ pub f_frsize: c_ulong, ++ pub f_flag: c_ulong, ++ pub f_spare: [c_uint; 3usize], ++ } ++ ++ pub struct aiocb { ++ pub aio_fildes: c_int, ++ pub aio_lio_opcode: c_int, ++ pub aio_reqprio: c_int, ++ pub aio_buf: *mut c_void, ++ pub aio_nbytes: size_t, ++ pub aio_sigevent: crate::sigevent, ++ __next_prio: *mut aiocb, ++ __abs_prio: c_int, ++ __policy: c_int, ++ __error_code: c_int, ++ __return_value: ssize_t, ++ pub aio_offset: off_t, ++ #[cfg(all(not(target_arch = "x86_64"), target_pointer_width = "32"))] ++ __unused1: [c_char; 4], ++ __glibc_reserved: [c_char; 32], ++ } ++ ++ pub struct mq_attr { ++ pub mq_flags: c_long, ++ pub mq_maxmsg: c_long, ++ pub mq_msgsize: c_long, ++ pub mq_curmsgs: c_long, ++ } ++ ++ pub struct __exit_status { ++ pub e_termination: c_short, ++ pub e_exit: c_short, ++ } ++ ++ #[cfg_attr(target_pointer_width = "32", repr(align(4)))] ++ #[cfg_attr(target_pointer_width = "64", repr(align(8)))] ++ pub struct sem_t { ++ __size: [c_char; 20usize], ++ } ++ ++ pub struct __pthread { ++ pub _address: u8, ++ } ++ ++ pub struct __pthread_mutexattr { ++ pub __prioceiling: c_int, ++ pub __protocol: __pthread_mutex_protocol, ++ pub __pshared: __pthread_process_shared, ++ pub __mutex_type: __pthread_mutex_type, ++ } ++ pub struct __pthread_mutex { ++ pub __lock: c_uint, ++ pub __owner_id: c_uint, ++ pub __cnt: c_uint, ++ pub __shpid: c_int, ++ pub __type: c_int, ++ pub __flags: c_int, ++ pub __reserved1: c_uint, ++ pub __reserved2: c_uint, ++ } ++ ++ pub struct __pthread_condattr { ++ pub __pshared: __pthread_process_shared, ++ pub __clock: __clockid_t, ++ } ++ ++ pub struct __pthread_rwlockattr { ++ pub __pshared: __pthread_process_shared, ++ } ++ ++ pub struct __pthread_barrierattr { ++ pub __pshared: __pthread_process_shared, ++ } ++ ++ pub struct __pthread_once { ++ pub __run: c_int, ++ pub __lock: __pthread_spinlock_t, ++ } ++ ++ pub struct __pthread_cond { ++ pub __lock: __pthread_spinlock_t, ++ pub __queue: *mut __pthread, ++ pub __attr: *mut __pthread_condattr, ++ pub __wrefs: c_uint, ++ pub __data: *mut c_void, ++ } ++ ++ pub struct __pthread_attr { ++ pub __schedparam: sched_param, ++ pub __stackaddr: *mut c_void, ++ pub __stacksize: size_t, ++ pub __guardsize: size_t, ++ pub __detachstate: __pthread_detachstate, ++ pub __inheritsched: __pthread_inheritsched, ++ pub __contentionscope: __pthread_contentionscope, ++ pub __schedpolicy: c_int, ++ } ++ ++ pub struct __pthread_rwlock { ++ pub __held: __pthread_spinlock_t, ++ pub __lock: __pthread_spinlock_t, ++ pub __readers: c_int, ++ pub __readerqueue: *mut __pthread, ++ pub __writerqueue: *mut __pthread, ++ pub __attr: *mut __pthread_rwlockattr, ++ pub __data: *mut c_void, ++ } ++ ++ pub struct __pthread_barrier { ++ pub __lock: __pthread_spinlock_t, ++ pub __queue: *mut __pthread, ++ pub __pending: c_uint, ++ pub __count: c_uint, ++ pub __attr: *mut __pthread_barrierattr, ++ pub __data: *mut c_void, ++ } ++ ++ pub struct seminfo { ++ pub semmap: c_int, ++ pub semmni: c_int, ++ pub semmns: c_int, ++ pub semmnu: c_int, ++ pub semmsl: c_int, ++ pub semopm: c_int, ++ pub semume: c_int, ++ pub semusz: c_int, ++ pub semvmx: c_int, ++ pub semaem: c_int, ++ } ++ ++ pub struct _IO_FILE { ++ _unused: [u8; 0], ++ } ++ ++ pub struct sched_param { ++ pub sched_priority: c_int, ++ } ++ ++ pub struct iovec { ++ pub iov_base: *mut c_void, ++ pub iov_len: size_t, ++ } ++ ++ pub struct passwd { ++ pub pw_name: *mut c_char, ++ pub pw_passwd: *mut c_char, ++ pub pw_uid: __uid_t, ++ pub pw_gid: __gid_t, ++ pub pw_gecos: *mut c_char, ++ pub pw_dir: *mut c_char, ++ pub pw_shell: *mut c_char, ++ } ++ ++ pub struct spwd { ++ pub sp_namp: *mut c_char, ++ pub sp_pwdp: *mut c_char, ++ pub sp_lstchg: c_long, ++ pub sp_min: c_long, ++ pub sp_max: c_long, ++ pub sp_warn: c_long, ++ pub sp_inact: c_long, ++ pub sp_expire: c_long, ++ pub sp_flag: c_ulong, ++ } ++ ++ pub struct itimerspec { ++ pub it_interval: crate::timespec, ++ pub it_value: crate::timespec, ++ } ++ ++ pub struct tm { ++ pub tm_sec: c_int, ++ pub tm_min: c_int, ++ pub tm_hour: c_int, ++ pub tm_mday: c_int, ++ pub tm_mon: c_int, ++ pub tm_year: c_int, ++ pub tm_wday: c_int, ++ pub tm_yday: c_int, ++ pub tm_isdst: c_int, ++ pub tm_gmtoff: c_long, ++ pub tm_zone: *const c_char, ++ } ++ ++ pub struct lconv { ++ pub decimal_point: *mut c_char, ++ pub thousands_sep: *mut c_char, ++ pub grouping: *mut c_char, ++ pub int_curr_symbol: *mut c_char, ++ pub currency_symbol: *mut c_char, ++ pub mon_decimal_point: *mut c_char, ++ pub mon_thousands_sep: *mut c_char, ++ pub mon_grouping: *mut c_char, ++ pub positive_sign: *mut c_char, ++ pub negative_sign: *mut c_char, ++ pub int_frac_digits: c_char, ++ pub frac_digits: c_char, ++ pub p_cs_precedes: c_char, ++ pub p_sep_by_space: c_char, ++ pub n_cs_precedes: c_char, ++ pub n_sep_by_space: c_char, ++ pub p_sign_posn: c_char, ++ pub n_sign_posn: c_char, ++ pub int_p_cs_precedes: c_char, ++ pub int_p_sep_by_space: c_char, ++ pub int_n_cs_precedes: c_char, ++ pub int_n_sep_by_space: c_char, ++ pub int_p_sign_posn: c_char, ++ pub int_n_sign_posn: c_char, ++ } ++ ++ pub struct Dl_info { ++ pub dli_fname: *const c_char, ++ pub dli_fbase: *mut c_void, ++ pub dli_sname: *const c_char, ++ pub dli_saddr: *mut c_void, ++ } ++ ++ pub struct ifaddrs { ++ pub ifa_next: *mut ifaddrs, ++ pub ifa_name: *mut c_char, ++ pub ifa_flags: c_uint, ++ pub ifa_addr: *mut crate::sockaddr, ++ pub ifa_netmask: *mut crate::sockaddr, ++ pub ifa_ifu: *mut crate::sockaddr, // FIXME This should be a union ++ pub ifa_data: *mut c_void, ++ } ++ ++ pub struct arpreq { ++ pub arp_pa: crate::sockaddr, ++ pub arp_ha: crate::sockaddr, ++ pub arp_flags: c_int, ++ pub arp_netmask: crate::sockaddr, ++ pub arp_dev: [c_char; 16], ++ } ++ ++ pub struct arpreq_old { ++ pub arp_pa: crate::sockaddr, ++ pub arp_ha: crate::sockaddr, ++ pub arp_flags: c_int, ++ pub arp_netmask: crate::sockaddr, ++ } ++ ++ pub struct arphdr { ++ pub ar_hrd: u16, ++ pub ar_pro: u16, ++ pub ar_hln: u8, ++ pub ar_pln: u8, ++ pub ar_op: u16, ++ } ++ ++ pub struct arpd_request { ++ pub req: c_ushort, ++ pub ip: u32, ++ pub dev: c_ulong, ++ pub stamp: c_ulong, ++ pub updated: c_ulong, ++ pub ha: [c_uchar; crate::MAX_ADDR_LEN], ++ } ++ ++ pub struct mmsghdr { ++ pub msg_hdr: crate::msghdr, ++ pub msg_len: c_uint, ++ } ++ ++ pub struct ifreq { ++ /// interface name, e.g. "en0" ++ pub ifr_name: [c_char; crate::IFNAMSIZ], ++ pub ifr_ifru: crate::sockaddr, ++ } ++ ++ pub struct __locale_struct { ++ pub __locales: [*mut __locale_data; 13usize], ++ pub __ctype_b: *const c_ushort, ++ pub __ctype_tolower: *const c_int, ++ pub __ctype_toupper: *const c_int, ++ pub __names: [*const c_char; 13usize], ++ } ++ ++ pub struct utsname { ++ pub sysname: [c_char; _UTSNAME_LENGTH], ++ pub nodename: [c_char; _UTSNAME_LENGTH], ++ pub release: [c_char; _UTSNAME_LENGTH], ++ pub version: [c_char; _UTSNAME_LENGTH], ++ pub machine: [c_char; _UTSNAME_LENGTH], ++ pub domainname: [c_char; _UTSNAME_LENGTH], ++ } ++ ++ pub struct rlimit64 { ++ pub rlim_cur: rlim64_t, ++ pub rlim_max: rlim64_t, ++ } ++ ++ pub struct stack_t { ++ pub ss_sp: *mut c_void, ++ pub ss_size: size_t, ++ pub ss_flags: c_int, ++ } ++ ++ pub struct dl_phdr_info { ++ pub dlpi_addr: Elf_Addr, ++ pub dlpi_name: *const c_char, ++ pub dlpi_phdr: *const Elf_Phdr, ++ pub dlpi_phnum: Elf_Half, ++ pub dlpi_adds: c_ulonglong, ++ pub dlpi_subs: c_ulonglong, ++ pub dlpi_tls_modid: size_t, ++ pub dlpi_tls_data: *mut c_void, ++ } ++ ++ pub struct flock { ++ #[cfg(target_pointer_width = "32")] ++ pub l_type: c_int, ++ #[cfg(target_pointer_width = "32")] ++ pub l_whence: c_int, ++ #[cfg(target_pointer_width = "64")] ++ pub l_type: c_short, ++ #[cfg(target_pointer_width = "64")] ++ pub l_whence: c_short, ++ pub l_start: __off_t, ++ pub l_len: __off_t, ++ pub l_pid: __pid_t, ++ } ++ ++ pub struct flock64 { ++ #[cfg(target_pointer_width = "32")] ++ pub l_type: c_int, ++ #[cfg(target_pointer_width = "32")] ++ pub l_whence: c_int, ++ #[cfg(target_pointer_width = "64")] ++ pub l_type: c_short, ++ #[cfg(target_pointer_width = "64")] ++ pub l_whence: c_short, ++ pub l_start: __off_t, ++ pub l_len: __off64_t, ++ pub l_pid: __pid_t, ++ } ++ ++ pub struct glob_t { ++ pub gl_pathc: size_t, ++ pub gl_pathv: *mut *mut c_char, ++ pub gl_offs: size_t, ++ pub gl_flags: c_int, ++ ++ __unused1: *mut c_void, ++ __unused2: *mut c_void, ++ __unused3: *mut c_void, ++ __unused4: *mut c_void, ++ __unused5: *mut c_void, ++ } ++ ++ pub struct glob64_t { ++ pub gl_pathc: size_t, ++ pub gl_pathv: *mut *mut c_char, ++ pub gl_offs: size_t, ++ pub gl_flags: c_int, ++ ++ __unused1: *mut c_void, ++ __unused2: *mut c_void, ++ __unused3: *mut c_void, ++ __unused4: *mut c_void, ++ __unused5: *mut c_void, ++ } ++ ++ pub struct regex_t { ++ __buffer: *mut c_void, ++ __allocated: size_t, ++ __used: size_t, ++ __syntax: c_ulong, ++ __fastmap: *mut c_char, ++ __translate: *mut c_char, ++ __re_nsub: size_t, ++ __bitfield: u8, ++ } ++ ++ pub struct cpu_set_t { ++ #[cfg(all(target_pointer_width = "32", not(target_arch = "x86_64")))] ++ bits: [u32; 32], ++ #[cfg(not(all(target_pointer_width = "32", not(target_arch = "x86_64"))))] ++ bits: [u64; 16], ++ } ++ ++ pub struct if_nameindex { ++ pub if_index: c_uint, ++ pub if_name: *mut c_char, ++ } ++ ++ // System V IPC ++ pub struct msginfo { ++ pub msgpool: c_int, ++ pub msgmap: c_int, ++ pub msgmax: c_int, ++ pub msgmnb: c_int, ++ pub msgmni: c_int, ++ pub msgssz: c_int, ++ pub msgtql: c_int, ++ pub msgseg: c_ushort, ++ } ++ ++ pub struct sembuf { ++ pub sem_num: c_ushort, ++ pub sem_op: c_short, ++ pub sem_flg: c_short, ++ } ++ ++ pub struct mntent { ++ pub mnt_fsname: *mut c_char, ++ pub mnt_dir: *mut c_char, ++ pub mnt_type: *mut c_char, ++ pub mnt_opts: *mut c_char, ++ pub mnt_freq: c_int, ++ pub mnt_passno: c_int, ++ } ++ ++ pub struct posix_spawn_file_actions_t { ++ __allocated: c_int, ++ __used: c_int, ++ __actions: *mut c_int, ++ __pad: [c_int; 16], ++ } ++ ++ pub struct posix_spawnattr_t { ++ __flags: c_short, ++ __pgrp: crate::pid_t, ++ __sd: crate::sigset_t, ++ __ss: crate::sigset_t, ++ __sp: crate::sched_param, ++ __policy: c_int, ++ __pad: [c_int; 16], ++ } ++ ++ pub struct regmatch_t { ++ pub rm_so: regoff_t, ++ pub rm_eo: regoff_t, ++ } ++ ++ pub struct option { ++ pub name: *const c_char, ++ pub has_arg: c_int, ++ pub flag: *mut c_int, ++ pub val: c_int, ++ } ++} ++ ++s_no_extra_traits! { ++ pub struct utmpx { ++ pub ut_type: c_short, ++ pub ut_pid: crate::pid_t, ++ pub ut_line: [c_char; __UT_LINESIZE], ++ pub ut_id: [c_char; 4], ++ ++ pub ut_user: [c_char; __UT_NAMESIZE], ++ pub ut_host: [c_char; __UT_HOSTSIZE], ++ pub ut_exit: __exit_status, ++ ++ #[cfg(any(all(target_pointer_width = "32", not(target_arch = "x86_64"))))] ++ pub ut_session: c_long, ++ #[cfg(any(all(target_pointer_width = "32", not(target_arch = "x86_64"))))] ++ pub ut_tv: crate::timeval, ++ ++ #[cfg(not(any(all(target_pointer_width = "32", not(target_arch = "x86_64")))))] ++ pub ut_session: i32, ++ #[cfg(not(any(all(target_pointer_width = "32", not(target_arch = "x86_64")))))] ++ pub ut_tv: __timeval, ++ ++ pub ut_addr_v6: [i32; 4], ++ __glibc_reserved: [c_char; 20], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for utmpx { ++ fn eq(&self, other: &utmpx) -> bool { ++ self.ut_type == other.ut_type ++ && self.ut_pid == other.ut_pid ++ && self.ut_line == other.ut_line ++ && self.ut_id == other.ut_id ++ && self.ut_user == other.ut_user ++ && self ++ .ut_host ++ .iter() ++ .zip(other.ut_host.iter()) ++ .all(|(a, b)| a == b) ++ && self.ut_exit == other.ut_exit ++ && self.ut_session == other.ut_session ++ && self.ut_tv == other.ut_tv ++ && self.ut_addr_v6 == other.ut_addr_v6 ++ && self.__glibc_reserved == other.__glibc_reserved ++ } ++ } ++ ++ impl Eq for utmpx {} ++ ++ impl fmt::Debug for utmpx { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("utmpx") ++ .field("ut_type", &self.ut_type) ++ .field("ut_pid", &self.ut_pid) ++ .field("ut_line", &self.ut_line) ++ .field("ut_id", &self.ut_id) ++ .field("ut_user", &self.ut_user) ++ // FIXME: .field("ut_host", &self.ut_host) ++ .field("ut_exit", &self.ut_exit) ++ .field("ut_session", &self.ut_session) ++ .field("ut_tv", &self.ut_tv) ++ .field("ut_addr_v6", &self.ut_addr_v6) ++ .field("__glibc_reserved", &self.__glibc_reserved) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for utmpx { ++ fn hash(&self, state: &mut H) { ++ self.ut_type.hash(state); ++ self.ut_pid.hash(state); ++ self.ut_line.hash(state); ++ self.ut_id.hash(state); ++ self.ut_user.hash(state); ++ self.ut_host.hash(state); ++ self.ut_exit.hash(state); ++ self.ut_session.hash(state); ++ self.ut_tv.hash(state); ++ self.ut_addr_v6.hash(state); ++ self.__glibc_reserved.hash(state); ++ } ++ } ++ } ++} ++ ++impl siginfo_t { ++ pub unsafe fn si_addr(&self) -> *mut c_void { ++ self.si_addr ++ } ++ ++ pub unsafe fn si_value(&self) -> crate::sigval { ++ self.si_value ++ } ++ ++ pub unsafe fn si_pid(&self) -> crate::pid_t { ++ self.si_pid ++ } ++ ++ pub unsafe fn si_uid(&self) -> crate::uid_t { ++ self.si_uid ++ } ++ ++ pub unsafe fn si_status(&self) -> c_int { ++ self.si_status ++ } ++} ++ ++// const ++ ++// aio.h ++pub const AIO_CANCELED: c_int = 0; ++pub const AIO_NOTCANCELED: c_int = 1; ++pub const AIO_ALLDONE: c_int = 2; ++pub const LIO_READ: c_int = 0; ++pub const LIO_WRITE: c_int = 1; ++pub const LIO_NOP: c_int = 2; ++pub const LIO_WAIT: c_int = 0; ++pub const LIO_NOWAIT: c_int = 1; ++ ++// glob.h ++pub const GLOB_ERR: c_int = 1 << 0; ++pub const GLOB_MARK: c_int = 1 << 1; ++pub const GLOB_NOSORT: c_int = 1 << 2; ++pub const GLOB_DOOFFS: c_int = 1 << 3; ++pub const GLOB_NOCHECK: c_int = 1 << 4; ++pub const GLOB_APPEND: c_int = 1 << 5; ++pub const GLOB_NOESCAPE: c_int = 1 << 6; ++ ++pub const GLOB_NOSPACE: c_int = 1; ++pub const GLOB_ABORTED: c_int = 2; ++pub const GLOB_NOMATCH: c_int = 3; ++ ++pub const GLOB_PERIOD: c_int = 1 << 7; ++pub const GLOB_ALTDIRFUNC: c_int = 1 << 9; ++pub const GLOB_BRACE: c_int = 1 << 10; ++pub const GLOB_NOMAGIC: c_int = 1 << 11; ++pub const GLOB_TILDE: c_int = 1 << 12; ++pub const GLOB_ONLYDIR: c_int = 1 << 13; ++pub const GLOB_TILDE_CHECK: c_int = 1 << 14; ++ ++// ipc.h ++pub const IPC_PRIVATE: crate::key_t = 0; ++ ++pub const IPC_CREAT: c_int = 0o1000; ++pub const IPC_EXCL: c_int = 0o2000; ++pub const IPC_NOWAIT: c_int = 0o4000; ++ ++pub const IPC_RMID: c_int = 0; ++pub const IPC_SET: c_int = 1; ++pub const IPC_STAT: c_int = 2; ++pub const IPC_INFO: c_int = 3; ++pub const MSG_STAT: c_int = 11; ++pub const MSG_INFO: c_int = 12; ++ ++pub const MSG_NOERROR: c_int = 0o10000; ++pub const MSG_EXCEPT: c_int = 0o20000; ++ ++// shm.h ++pub const SHM_R: c_int = 0o400; ++pub const SHM_W: c_int = 0o200; ++ ++pub const SHM_RDONLY: c_int = 0o10000; ++pub const SHM_RND: c_int = 0o20000; ++pub const SHM_REMAP: c_int = 0o40000; ++ ++pub const SHM_LOCK: c_int = 11; ++pub const SHM_UNLOCK: c_int = 12; ++// unistd.h ++pub const STDIN_FILENO: c_int = 0; ++pub const STDOUT_FILENO: c_int = 1; ++pub const STDERR_FILENO: c_int = 2; ++pub const __FD_SETSIZE: usize = 256; ++pub const R_OK: c_int = 4; ++pub const W_OK: c_int = 2; ++pub const X_OK: c_int = 1; ++pub const F_OK: c_int = 0; ++pub const SEEK_SET: c_int = 0; ++pub const SEEK_CUR: c_int = 1; ++pub const SEEK_END: c_int = 2; ++pub const SEEK_DATA: c_int = 3; ++pub const SEEK_HOLE: c_int = 4; ++pub const L_SET: c_int = 0; ++pub const L_INCR: c_int = 1; ++pub const L_XTND: c_int = 2; ++pub const F_ULOCK: c_int = 0; ++pub const F_LOCK: c_int = 1; ++pub const F_TLOCK: c_int = 2; ++pub const F_TEST: c_int = 3; ++pub const CLOSE_RANGE_CLOEXEC: c_int = 4; ++ ++// stdio.h ++pub const EOF: c_int = -1; ++ ++// stdlib.h ++pub const WNOHANG: c_int = 1; ++pub const WUNTRACED: c_int = 2; ++pub const WSTOPPED: c_int = 2; ++pub const WCONTINUED: c_int = 4; ++pub const WNOWAIT: c_int = 8; ++pub const WEXITED: c_int = 16; ++pub const __W_CONTINUED: c_int = 65535; ++pub const __WCOREFLAG: c_int = 128; ++pub const RAND_MAX: c_int = 2147483647; ++pub const EXIT_FAILURE: c_int = 1; ++pub const EXIT_SUCCESS: c_int = 0; ++pub const __LITTLE_ENDIAN: usize = 1234; ++pub const __BIG_ENDIAN: usize = 4321; ++pub const __PDP_ENDIAN: usize = 3412; ++pub const __BYTE_ORDER: usize = 1234; ++pub const __FLOAT_WORD_ORDER: usize = 1234; ++pub const LITTLE_ENDIAN: usize = 1234; ++pub const BIG_ENDIAN: usize = 4321; ++pub const PDP_ENDIAN: usize = 3412; ++pub const BYTE_ORDER: usize = 1234; ++ ++// sys/select.h ++pub const FD_SETSIZE: usize = 256; ++pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 32; ++pub const __SIZEOF_PTHREAD_ATTR_T: usize = 32; ++pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 28; ++pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 24; ++pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 16; ++pub const __SIZEOF_PTHREAD_COND_T: usize = 20; ++pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 8; ++pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 4; ++pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4; ++pub const __SIZEOF_PTHREAD_ONCE_T: usize = 8; ++pub const __PTHREAD_SPIN_LOCK_INITIALIZER: c_int = 0; ++pub const PTHREAD_MUTEX_NORMAL: c_int = 0; ++ ++// sys/resource.h ++pub const RLIM_INFINITY: crate::rlim_t = 2147483647; ++pub const RLIM64_INFINITY: crate::rlim64_t = 9223372036854775807; ++pub const RLIM_SAVED_MAX: crate::rlim_t = RLIM_INFINITY; ++pub const RLIM_SAVED_CUR: crate::rlim_t = RLIM_INFINITY; ++pub const PRIO_MIN: c_int = -20; ++pub const PRIO_MAX: c_int = 20; ++ ++// pwd.h ++pub const NSS_BUFLEN_PASSWD: usize = 1024; ++ ++// sys/socket.h ++pub const SOCK_TYPE_MASK: usize = 15; ++pub const PF_UNSPEC: c_int = 0; ++pub const PF_LOCAL: c_int = 1; ++pub const PF_UNIX: c_int = 1; ++pub const PF_FILE: c_int = 1; ++pub const PF_INET: c_int = 2; ++pub const PF_IMPLINK: c_int = 3; ++pub const PF_PUP: c_int = 4; ++pub const PF_CHAOS: c_int = 5; ++pub const PF_NS: c_int = 6; ++pub const PF_ISO: c_int = 7; ++pub const PF_OSI: c_int = 7; ++pub const PF_ECMA: c_int = 8; ++pub const PF_DATAKIT: c_int = 9; ++pub const PF_CCITT: c_int = 10; ++pub const PF_SNA: c_int = 11; ++pub const PF_DECnet: c_int = 12; ++pub const PF_DLI: c_int = 13; ++pub const PF_LAT: c_int = 14; ++pub const PF_HYLINK: c_int = 15; ++pub const PF_APPLETALK: c_int = 16; ++pub const PF_ROUTE: c_int = 17; ++pub const PF_XTP: c_int = 19; ++pub const PF_COIP: c_int = 20; ++pub const PF_CNT: c_int = 21; ++pub const PF_RTIP: c_int = 22; ++pub const PF_IPX: c_int = 23; ++pub const PF_SIP: c_int = 24; ++pub const PF_PIP: c_int = 25; ++pub const PF_INET6: c_int = 26; ++pub const PF_MAX: c_int = 27; ++pub const AF_UNSPEC: c_int = 0; ++pub const AF_LOCAL: c_int = 1; ++pub const AF_UNIX: c_int = 1; ++pub const AF_FILE: c_int = 1; ++pub const AF_INET: c_int = 2; ++pub const AF_IMPLINK: c_int = 3; ++pub const AF_PUP: c_int = 4; ++pub const AF_CHAOS: c_int = 5; ++pub const AF_NS: c_int = 6; ++pub const AF_ISO: c_int = 7; ++pub const AF_OSI: c_int = 7; ++pub const AF_ECMA: c_int = 8; ++pub const AF_DATAKIT: c_int = 9; ++pub const AF_CCITT: c_int = 10; ++pub const AF_SNA: c_int = 11; ++pub const AF_DECnet: c_int = 12; ++pub const AF_DLI: c_int = 13; ++pub const AF_LAT: c_int = 14; ++pub const AF_HYLINK: c_int = 15; ++pub const AF_APPLETALK: c_int = 16; ++pub const AF_ROUTE: c_int = 17; ++pub const pseudo_AF_XTP: c_int = 19; ++pub const AF_COIP: c_int = 20; ++pub const AF_CNT: c_int = 21; ++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_INET6: c_int = 26; ++pub const AF_MAX: c_int = 27; ++pub const SOMAXCONN: c_int = 4096; ++pub const _SS_SIZE: usize = 128; ++pub const CMGROUP_MAX: usize = 16; ++pub const SOL_SOCKET: c_int = 65535; ++ ++// sys/time.h ++pub const ITIMER_REAL: c_int = 0; ++pub const ITIMER_VIRTUAL: c_int = 1; ++pub const ITIMER_PROF: c_int = 2; ++ ++// netinet/in.h ++pub const SOL_IP: c_int = 0; ++pub const SOL_TCP: c_int = 6; ++pub const SOL_UDP: c_int = 17; ++pub const SOL_IPV6: c_int = 41; ++pub const SOL_ICMPV6: c_int = 58; ++pub const IP_OPTIONS: c_int = 1; ++pub const IP_HDRINCL: c_int = 2; ++pub const IP_TOS: c_int = 3; ++pub const IP_TTL: c_int = 4; ++pub const IP_RECVOPTS: c_int = 5; ++pub const IP_RECVRETOPTS: c_int = 6; ++pub const IP_RECVDSTADDR: c_int = 7; ++pub const IP_RETOPTS: c_int = 8; ++pub const IP_MULTICAST_IF: c_int = 9; ++pub const IP_MULTICAST_TTL: c_int = 10; ++pub const IP_MULTICAST_LOOP: c_int = 11; ++pub const IP_ADD_MEMBERSHIP: c_int = 12; ++pub const IP_DROP_MEMBERSHIP: c_int = 13; ++pub const IPV6_ADDRFORM: c_int = 1; ++pub const IPV6_2292PKTINFO: c_int = 2; ++pub const IPV6_2292HOPOPTS: c_int = 3; ++pub const IPV6_2292DSTOPTS: c_int = 4; ++pub const IPV6_2292RTHDR: c_int = 5; ++pub const IPV6_2292PKTOPTIONS: c_int = 6; ++pub const IPV6_CHECKSUM: c_int = 7; ++pub const IPV6_2292HOPLIMIT: c_int = 8; ++pub const IPV6_RXINFO: c_int = 2; ++pub const IPV6_TXINFO: c_int = 2; ++pub const SCM_SRCINFO: c_int = 2; ++pub const IPV6_UNICAST_HOPS: c_int = 16; ++pub const IPV6_MULTICAST_IF: c_int = 17; ++pub const IPV6_MULTICAST_HOPS: c_int = 18; ++pub const IPV6_MULTICAST_LOOP: c_int = 19; ++pub const IPV6_JOIN_GROUP: c_int = 20; ++pub const IPV6_LEAVE_GROUP: c_int = 21; ++pub const IPV6_ROUTER_ALERT: c_int = 22; ++pub const IPV6_MTU_DISCOVER: c_int = 23; ++pub const IPV6_MTU: c_int = 24; ++pub const IPV6_RECVERR: c_int = 25; ++pub const IPV6_V6ONLY: c_int = 26; ++pub const IPV6_JOIN_ANYCAST: c_int = 27; ++pub const IPV6_LEAVE_ANYCAST: c_int = 28; ++pub const IPV6_RECVPKTINFO: c_int = 49; ++pub const IPV6_PKTINFO: c_int = 50; ++pub const IPV6_RECVHOPLIMIT: c_int = 51; ++pub const IPV6_HOPLIMIT: c_int = 52; ++pub const IPV6_RECVHOPOPTS: c_int = 53; ++pub const IPV6_HOPOPTS: c_int = 54; ++pub const IPV6_RTHDRDSTOPTS: c_int = 55; ++pub const IPV6_RECVRTHDR: c_int = 56; ++pub const IPV6_RTHDR: c_int = 57; ++pub const IPV6_RECVDSTOPTS: c_int = 58; ++pub const IPV6_DSTOPTS: c_int = 59; ++pub const IPV6_RECVPATHMTU: c_int = 60; ++pub const IPV6_PATHMTU: c_int = 61; ++pub const IPV6_DONTFRAG: c_int = 62; ++pub const IPV6_RECVTCLASS: c_int = 66; ++pub const IPV6_TCLASS: c_int = 67; ++pub const IPV6_ADDR_PREFERENCES: c_int = 72; ++pub const IPV6_MINHOPCOUNT: c_int = 73; ++pub const IPV6_ADD_MEMBERSHIP: c_int = 20; ++pub const IPV6_DROP_MEMBERSHIP: c_int = 21; ++pub const IPV6_RXHOPOPTS: c_int = 3; ++pub const IPV6_RXDSTOPTS: c_int = 4; ++pub const IPV6_RTHDR_LOOSE: c_int = 0; ++pub const IPV6_RTHDR_STRICT: c_int = 1; ++pub const IPV6_RTHDR_TYPE_0: c_int = 0; ++pub const IN_CLASSA_NET: u32 = 4278190080; ++pub const IN_CLASSA_NSHIFT: usize = 24; ++pub const IN_CLASSA_HOST: u32 = 16777215; ++pub const IN_CLASSA_MAX: u32 = 128; ++pub const IN_CLASSB_NET: u32 = 4294901760; ++pub const IN_CLASSB_NSHIFT: usize = 16; ++pub const IN_CLASSB_HOST: u32 = 65535; ++pub const IN_CLASSB_MAX: u32 = 65536; ++pub const IN_CLASSC_NET: u32 = 4294967040; ++pub const IN_CLASSC_NSHIFT: usize = 8; ++pub const IN_CLASSC_HOST: u32 = 255; ++pub const IN_LOOPBACKNET: u32 = 127; ++pub const INET_ADDRSTRLEN: usize = 16; ++pub const INET6_ADDRSTRLEN: usize = 46; ++ ++// netinet/ip.h ++pub const IPTOS_TOS_MASK: u8 = 0x1E; ++pub const IPTOS_PREC_MASK: u8 = 0xE0; ++ ++pub const IPTOS_ECN_NOT_ECT: u8 = 0x00; ++ ++pub const IPTOS_LOWDELAY: u8 = 0x10; ++pub const IPTOS_THROUGHPUT: u8 = 0x08; ++pub const IPTOS_RELIABILITY: u8 = 0x04; ++pub const IPTOS_MINCOST: u8 = 0x02; ++ ++pub const IPTOS_PREC_NETCONTROL: u8 = 0xe0; ++pub const IPTOS_PREC_INTERNETCONTROL: u8 = 0xc0; ++pub const IPTOS_PREC_CRITIC_ECP: u8 = 0xa0; ++pub const IPTOS_PREC_FLASHOVERRIDE: u8 = 0x80; ++pub const IPTOS_PREC_FLASH: u8 = 0x60; ++pub const IPTOS_PREC_IMMEDIATE: u8 = 0x40; ++pub const IPTOS_PREC_PRIORITY: u8 = 0x20; ++pub const IPTOS_PREC_ROUTINE: u8 = 0x00; ++ ++pub const IPTOS_ECN_MASK: u8 = 0x03; ++pub const IPTOS_ECN_ECT1: u8 = 0x01; ++pub const IPTOS_ECN_ECT0: u8 = 0x02; ++pub const IPTOS_ECN_CE: u8 = 0x03; ++ ++pub const IPOPT_COPY: u8 = 0x80; ++pub const IPOPT_CLASS_MASK: u8 = 0x60; ++pub const IPOPT_NUMBER_MASK: u8 = 0x1f; ++ ++pub const IPOPT_CONTROL: u8 = 0x00; ++pub const IPOPT_RESERVED1: u8 = 0x20; ++pub const IPOPT_MEASUREMENT: u8 = 0x40; ++pub const IPOPT_RESERVED2: u8 = 0x60; ++pub const IPOPT_END: u8 = 0 | IPOPT_CONTROL; ++pub const IPOPT_NOOP: u8 = 1 | IPOPT_CONTROL; ++pub const IPOPT_SEC: u8 = 2 | IPOPT_CONTROL | IPOPT_COPY; ++pub const IPOPT_LSRR: u8 = 3 | IPOPT_CONTROL | IPOPT_COPY; ++pub const IPOPT_TIMESTAMP: u8 = 4 | IPOPT_MEASUREMENT; ++pub const IPOPT_RR: u8 = 7 | IPOPT_CONTROL; ++pub const IPOPT_SID: u8 = 8 | IPOPT_CONTROL | IPOPT_COPY; ++pub const IPOPT_SSRR: u8 = 9 | IPOPT_CONTROL | IPOPT_COPY; ++pub const IPOPT_RA: u8 = 20 | IPOPT_CONTROL | IPOPT_COPY; ++pub const IPVERSION: u8 = 4; ++pub const MAXTTL: u8 = 255; ++pub const IPDEFTTL: u8 = 64; ++pub const IPOPT_OPTVAL: u8 = 0; ++pub const IPOPT_OLEN: u8 = 1; ++pub const IPOPT_OFFSET: u8 = 2; ++pub const IPOPT_MINOFF: u8 = 4; ++pub const MAX_IPOPTLEN: u8 = 40; ++pub const IPOPT_NOP: u8 = IPOPT_NOOP; ++pub const IPOPT_EOL: u8 = IPOPT_END; ++pub const IPOPT_TS: u8 = IPOPT_TIMESTAMP; ++pub const IPOPT_TS_TSONLY: u8 = 0; ++pub const IPOPT_TS_TSANDADDR: u8 = 1; ++pub const IPOPT_TS_PRESPEC: u8 = 3; ++ ++// net/if_arp.h ++pub const ARPOP_REQUEST: u16 = 1; ++pub const ARPOP_REPLY: u16 = 2; ++pub const ARPOP_RREQUEST: u16 = 3; ++pub const ARPOP_RREPLY: u16 = 4; ++pub const ARPOP_InREQUEST: u16 = 8; ++pub const ARPOP_InREPLY: u16 = 9; ++pub const ARPOP_NAK: u16 = 10; ++ ++pub const MAX_ADDR_LEN: usize = 7; ++pub const ARPD_UPDATE: c_ushort = 0x01; ++pub const ARPD_LOOKUP: c_ushort = 0x02; ++pub const ARPD_FLUSH: c_ushort = 0x03; ++pub const ATF_MAGIC: c_int = 0x80; ++ ++pub const ATF_NETMASK: c_int = 0x20; ++pub const ATF_DONTPUB: c_int = 0x40; ++ ++pub const ARPHRD_NETROM: u16 = 0; ++pub const ARPHRD_ETHER: u16 = 1; ++pub const ARPHRD_EETHER: u16 = 2; ++pub const ARPHRD_AX25: u16 = 3; ++pub const ARPHRD_PRONET: u16 = 4; ++pub const ARPHRD_CHAOS: u16 = 5; ++pub const ARPHRD_IEEE802: u16 = 6; ++pub const ARPHRD_ARCNET: u16 = 7; ++pub const ARPHRD_APPLETLK: u16 = 8; ++pub const ARPHRD_DLCI: u16 = 15; ++pub const ARPHRD_ATM: u16 = 19; ++pub const ARPHRD_METRICOM: u16 = 23; ++pub const ARPHRD_IEEE1394: u16 = 24; ++pub const ARPHRD_EUI64: u16 = 27; ++pub const ARPHRD_INFINIBAND: u16 = 32; ++ ++pub const ARPHRD_SLIP: u16 = 256; ++pub const ARPHRD_CSLIP: u16 = 257; ++pub const ARPHRD_SLIP6: u16 = 258; ++pub const ARPHRD_CSLIP6: u16 = 259; ++pub const ARPHRD_RSRVD: u16 = 260; ++pub const ARPHRD_ADAPT: u16 = 264; ++pub const ARPHRD_ROSE: u16 = 270; ++pub const ARPHRD_X25: u16 = 271; ++pub const ARPHRD_HWX25: u16 = 272; ++pub const ARPHRD_CAN: u16 = 280; ++pub const ARPHRD_PPP: u16 = 512; ++pub const ARPHRD_CISCO: u16 = 513; ++pub const ARPHRD_HDLC: u16 = ARPHRD_CISCO; ++pub const ARPHRD_LAPB: u16 = 516; ++pub const ARPHRD_DDCMP: u16 = 517; ++pub const ARPHRD_RAWHDLC: u16 = 518; ++ ++pub const ARPHRD_TUNNEL: u16 = 768; ++pub const ARPHRD_TUNNEL6: u16 = 769; ++pub const ARPHRD_FRAD: u16 = 770; ++pub const ARPHRD_SKIP: u16 = 771; ++pub const ARPHRD_LOOPBACK: u16 = 772; ++pub const ARPHRD_LOCALTLK: u16 = 773; ++pub const ARPHRD_FDDI: u16 = 774; ++pub const ARPHRD_BIF: u16 = 775; ++pub const ARPHRD_SIT: u16 = 776; ++pub const ARPHRD_IPDDP: u16 = 777; ++pub const ARPHRD_IPGRE: u16 = 778; ++pub const ARPHRD_PIMREG: u16 = 779; ++pub const ARPHRD_HIPPI: u16 = 780; ++pub const ARPHRD_ASH: u16 = 781; ++pub const ARPHRD_ECONET: u16 = 782; ++pub const ARPHRD_IRDA: u16 = 783; ++pub const ARPHRD_FCPP: u16 = 784; ++pub const ARPHRD_FCAL: u16 = 785; ++pub const ARPHRD_FCPL: u16 = 786; ++pub const ARPHRD_FCFABRIC: u16 = 787; ++pub const ARPHRD_IEEE802_TR: u16 = 800; ++pub const ARPHRD_IEEE80211: u16 = 801; ++pub const ARPHRD_IEEE80211_PRISM: u16 = 802; ++pub const ARPHRD_IEEE80211_RADIOTAP: u16 = 803; ++pub const ARPHRD_IEEE802154: u16 = 804; ++ ++pub const ARPHRD_VOID: u16 = 0xFFFF; ++pub const ARPHRD_NONE: u16 = 0xFFFE; ++ ++// bits/posix1_lim.h ++pub const _POSIX_AIO_LISTIO_MAX: usize = 2; ++pub const _POSIX_AIO_MAX: usize = 1; ++pub const _POSIX_ARG_MAX: usize = 4096; ++pub const _POSIX_CHILD_MAX: usize = 25; ++pub const _POSIX_DELAYTIMER_MAX: usize = 32; ++pub const _POSIX_HOST_NAME_MAX: usize = 255; ++pub const _POSIX_LINK_MAX: usize = 8; ++pub const _POSIX_LOGIN_NAME_MAX: usize = 9; ++pub const _POSIX_MAX_CANON: usize = 255; ++pub const _POSIX_MAX_INPUT: usize = 255; ++pub const _POSIX_MQ_OPEN_MAX: usize = 8; ++pub const _POSIX_MQ_PRIO_MAX: usize = 32; ++pub const _POSIX_NAME_MAX: usize = 14; ++pub const _POSIX_NGROUPS_MAX: usize = 8; ++pub const _POSIX_OPEN_MAX: usize = 20; ++pub const _POSIX_FD_SETSIZE: usize = 20; ++pub const _POSIX_PATH_MAX: usize = 256; ++pub const _POSIX_PIPE_BUF: usize = 512; ++pub const _POSIX_RE_DUP_MAX: usize = 255; ++pub const _POSIX_RTSIG_MAX: usize = 8; ++pub const _POSIX_SEM_NSEMS_MAX: usize = 256; ++pub const _POSIX_SEM_VALUE_MAX: usize = 32767; ++pub const _POSIX_SIGQUEUE_MAX: usize = 32; ++pub const _POSIX_SSIZE_MAX: usize = 32767; ++pub const _POSIX_STREAM_MAX: usize = 8; ++pub const _POSIX_SYMLINK_MAX: usize = 255; ++pub const _POSIX_SYMLOOP_MAX: usize = 8; ++pub const _POSIX_TIMER_MAX: usize = 32; ++pub const _POSIX_TTY_NAME_MAX: usize = 9; ++pub const _POSIX_TZNAME_MAX: usize = 6; ++pub const _POSIX_QLIMIT: usize = 1; ++pub const _POSIX_HIWAT: usize = 512; ++pub const _POSIX_UIO_MAXIOV: usize = 16; ++pub const _POSIX_CLOCKRES_MIN: usize = 20000000; ++pub const NAME_MAX: usize = 255; ++pub const NGROUPS_MAX: usize = 256; ++pub const _POSIX_THREAD_KEYS_MAX: usize = 128; ++pub const _POSIX_THREAD_DESTRUCTOR_ITERATIONS: usize = 4; ++pub const _POSIX_THREAD_THREADS_MAX: usize = 64; ++pub const SEM_VALUE_MAX: c_int = 2147483647; ++pub const MAXNAMLEN: usize = 255; ++ ++// netdb.h ++pub const _PATH_HEQUIV: &'static [u8; 17usize] = b"/etc/hosts.equiv\0"; ++pub const _PATH_HOSTS: &'static [u8; 11usize] = b"/etc/hosts\0"; ++pub const _PATH_NETWORKS: &'static [u8; 14usize] = b"/etc/networks\0"; ++pub const _PATH_NSSWITCH_CONF: &'static [u8; 19usize] = b"/etc/nsswitch.conf\0"; ++pub const _PATH_PROTOCOLS: &'static [u8; 15usize] = b"/etc/protocols\0"; ++pub const _PATH_SERVICES: &'static [u8; 14usize] = b"/etc/services\0"; ++pub const HOST_NOT_FOUND: c_int = 1; ++pub const TRY_AGAIN: c_int = 2; ++pub const NO_RECOVERY: c_int = 3; ++pub const NO_DATA: c_int = 4; ++pub const NETDB_INTERNAL: c_int = -1; ++pub const NETDB_SUCCESS: c_int = 0; ++pub const NO_ADDRESS: c_int = 4; ++pub const IPPORT_RESERVED: c_int = 1024; ++pub const SCOPE_DELIMITER: u8 = 37u8; ++pub const GAI_WAIT: c_int = 0; ++pub const GAI_NOWAIT: c_int = 1; ++pub const AI_PASSIVE: c_int = 1; ++pub const AI_CANONNAME: c_int = 2; ++pub const AI_NUMERICHOST: c_int = 4; ++pub const AI_V4MAPPED: c_int = 8; ++pub const AI_ALL: c_int = 16; ++pub const AI_ADDRCONFIG: c_int = 32; ++pub const AI_IDN: c_int = 64; ++pub const AI_CANONIDN: c_int = 128; ++pub const AI_NUMERICSERV: c_int = 1024; ++pub const EAI_BADFLAGS: c_int = -1; ++pub const EAI_NONAME: c_int = -2; ++pub const EAI_AGAIN: c_int = -3; ++pub const EAI_FAIL: c_int = -4; ++pub const EAI_FAMILY: c_int = -6; ++pub const EAI_SOCKTYPE: c_int = -7; ++pub const EAI_SERVICE: c_int = -8; ++pub const EAI_MEMORY: c_int = -10; ++pub const EAI_SYSTEM: c_int = -11; ++pub const EAI_OVERFLOW: c_int = -12; ++pub const EAI_NODATA: c_int = -5; ++pub const EAI_ADDRFAMILY: c_int = -9; ++pub const EAI_INPROGRESS: c_int = -100; ++pub const EAI_CANCELED: c_int = -101; ++pub const EAI_NOTCANCELED: c_int = -102; ++pub const EAI_ALLDONE: c_int = -103; ++pub const EAI_INTR: c_int = -104; ++pub const EAI_IDN_ENCODE: c_int = -105; ++pub const NI_MAXHOST: usize = 1025; ++pub const NI_MAXSERV: usize = 32; ++pub const NI_NUMERICHOST: c_int = 1; ++pub const NI_NUMERICSERV: c_int = 2; ++pub const NI_NOFQDN: c_int = 4; ++pub const NI_NAMEREQD: c_int = 8; ++pub const NI_DGRAM: c_int = 16; ++pub const NI_IDN: c_int = 32; ++ ++// time.h ++pub const CLOCK_REALTIME: crate::clockid_t = 0; ++pub const CLOCK_MONOTONIC: crate::clockid_t = 1; ++pub const CLOCK_PROCESS_CPUTIME_ID: crate::clockid_t = 2; ++pub const CLOCK_THREAD_CPUTIME_ID: crate::clockid_t = 3; ++pub const CLOCK_MONOTONIC_RAW: crate::clockid_t = 4; ++pub const CLOCK_REALTIME_COARSE: crate::clockid_t = 5; ++pub const CLOCK_MONOTONIC_COARSE: crate::clockid_t = 6; ++pub const TIMER_ABSTIME: c_int = 1; ++pub const TIME_UTC: c_int = 1; ++ ++// sys/poll.h ++pub const POLLIN: i16 = 1; ++pub const POLLPRI: i16 = 2; ++pub const POLLOUT: i16 = 4; ++pub const POLLRDNORM: i16 = 1; ++pub const POLLRDBAND: i16 = 2; ++pub const POLLWRNORM: i16 = 4; ++pub const POLLWRBAND: i16 = 4; ++pub const POLLERR: i16 = 8; ++pub const POLLHUP: i16 = 16; ++pub const POLLNVAL: i16 = 32; ++ ++// locale.h ++pub const __LC_CTYPE: usize = 0; ++pub const __LC_NUMERIC: usize = 1; ++pub const __LC_TIME: usize = 2; ++pub const __LC_COLLATE: usize = 3; ++pub const __LC_MONETARY: usize = 4; ++pub const __LC_MESSAGES: usize = 5; ++pub const __LC_ALL: usize = 6; ++pub const __LC_PAPER: usize = 7; ++pub const __LC_NAME: usize = 8; ++pub const __LC_ADDRESS: usize = 9; ++pub const __LC_TELEPHONE: usize = 10; ++pub const __LC_MEASUREMENT: usize = 11; ++pub const __LC_IDENTIFICATION: usize = 12; ++pub const LC_CTYPE: c_int = 0; ++pub const LC_NUMERIC: c_int = 1; ++pub const LC_TIME: c_int = 2; ++pub const LC_COLLATE: c_int = 3; ++pub const LC_MONETARY: c_int = 4; ++pub const LC_MESSAGES: c_int = 5; ++pub const LC_ALL: c_int = 6; ++pub const LC_PAPER: c_int = 7; ++pub const LC_NAME: c_int = 8; ++pub const LC_ADDRESS: c_int = 9; ++pub const LC_TELEPHONE: c_int = 10; ++pub const LC_MEASUREMENT: c_int = 11; ++pub const LC_IDENTIFICATION: c_int = 12; ++pub const LC_CTYPE_MASK: c_int = 1; ++pub const LC_NUMERIC_MASK: c_int = 2; ++pub const LC_TIME_MASK: c_int = 4; ++pub const LC_COLLATE_MASK: c_int = 8; ++pub const LC_MONETARY_MASK: c_int = 16; ++pub const LC_MESSAGES_MASK: c_int = 32; ++pub const LC_PAPER_MASK: c_int = 128; ++pub const LC_NAME_MASK: c_int = 256; ++pub const LC_ADDRESS_MASK: c_int = 512; ++pub const LC_TELEPHONE_MASK: c_int = 1024; ++pub const LC_MEASUREMENT_MASK: c_int = 2048; ++pub const LC_IDENTIFICATION_MASK: c_int = 4096; ++pub const LC_ALL_MASK: c_int = 8127; ++ ++pub const ABDAY_1: crate::nl_item = 0x20000; ++pub const ABDAY_2: crate::nl_item = 0x20001; ++pub const ABDAY_3: crate::nl_item = 0x20002; ++pub const ABDAY_4: crate::nl_item = 0x20003; ++pub const ABDAY_5: crate::nl_item = 0x20004; ++pub const ABDAY_6: crate::nl_item = 0x20005; ++pub const ABDAY_7: crate::nl_item = 0x20006; ++ ++pub const DAY_1: crate::nl_item = 0x20007; ++pub const DAY_2: crate::nl_item = 0x20008; ++pub const DAY_3: crate::nl_item = 0x20009; ++pub const DAY_4: crate::nl_item = 0x2000A; ++pub const DAY_5: crate::nl_item = 0x2000B; ++pub const DAY_6: crate::nl_item = 0x2000C; ++pub const DAY_7: crate::nl_item = 0x2000D; ++ ++pub const ABMON_1: crate::nl_item = 0x2000E; ++pub const ABMON_2: crate::nl_item = 0x2000F; ++pub const ABMON_3: crate::nl_item = 0x20010; ++pub const ABMON_4: crate::nl_item = 0x20011; ++pub const ABMON_5: crate::nl_item = 0x20012; ++pub const ABMON_6: crate::nl_item = 0x20013; ++pub const ABMON_7: crate::nl_item = 0x20014; ++pub const ABMON_8: crate::nl_item = 0x20015; ++pub const ABMON_9: crate::nl_item = 0x20016; ++pub const ABMON_10: crate::nl_item = 0x20017; ++pub const ABMON_11: crate::nl_item = 0x20018; ++pub const ABMON_12: crate::nl_item = 0x20019; ++ ++pub const MON_1: crate::nl_item = 0x2001A; ++pub const MON_2: crate::nl_item = 0x2001B; ++pub const MON_3: crate::nl_item = 0x2001C; ++pub const MON_4: crate::nl_item = 0x2001D; ++pub const MON_5: crate::nl_item = 0x2001E; ++pub const MON_6: crate::nl_item = 0x2001F; ++pub const MON_7: crate::nl_item = 0x20020; ++pub const MON_8: crate::nl_item = 0x20021; ++pub const MON_9: crate::nl_item = 0x20022; ++pub const MON_10: crate::nl_item = 0x20023; ++pub const MON_11: crate::nl_item = 0x20024; ++pub const MON_12: crate::nl_item = 0x20025; ++ ++pub const AM_STR: crate::nl_item = 0x20026; ++pub const PM_STR: crate::nl_item = 0x20027; ++ ++pub const D_T_FMT: crate::nl_item = 0x20028; ++pub const D_FMT: crate::nl_item = 0x20029; ++pub const T_FMT: crate::nl_item = 0x2002A; ++pub const T_FMT_AMPM: crate::nl_item = 0x2002B; ++ ++pub const ERA: crate::nl_item = 0x2002C; ++pub const ERA_D_FMT: crate::nl_item = 0x2002E; ++pub const ALT_DIGITS: crate::nl_item = 0x2002F; ++pub const ERA_D_T_FMT: crate::nl_item = 0x20030; ++pub const ERA_T_FMT: crate::nl_item = 0x20031; ++ ++pub const CODESET: crate::nl_item = 14; ++pub const CRNCYSTR: crate::nl_item = 0x4000F; ++pub const RADIXCHAR: crate::nl_item = 0x10000; ++pub const THOUSEP: crate::nl_item = 0x10001; ++pub const YESEXPR: crate::nl_item = 0x50000; ++pub const NOEXPR: crate::nl_item = 0x50001; ++pub const YESSTR: crate::nl_item = 0x50002; ++pub const NOSTR: crate::nl_item = 0x50003; ++ ++// reboot.h ++pub const RB_AUTOBOOT: c_int = 0x0; ++pub const RB_ASKNAME: c_int = 0x1; ++pub const RB_SINGLE: c_int = 0x2; ++pub const RB_KBD: c_int = 0x4; ++pub const RB_HALT: c_int = 0x8; ++pub const RB_INITNAME: c_int = 0x10; ++pub const RB_DFLTROOT: c_int = 0x20; ++pub const RB_NOBOOTRC: c_int = 0x20; ++pub const RB_ALTBOOT: c_int = 0x40; ++pub const RB_UNIPROC: c_int = 0x80; ++pub const RB_DEBUGGER: c_int = 0x1000; ++ ++// semaphore.h ++pub const __SIZEOF_SEM_T: usize = 20; ++pub const SEM_FAILED: *mut crate::sem_t = 0 as *mut sem_t; ++ ++// termios.h ++pub const IGNBRK: crate::tcflag_t = 1; ++pub const BRKINT: crate::tcflag_t = 2; ++pub const IGNPAR: crate::tcflag_t = 4; ++pub const PARMRK: crate::tcflag_t = 8; ++pub const INPCK: crate::tcflag_t = 16; ++pub const ISTRIP: crate::tcflag_t = 32; ++pub const INLCR: crate::tcflag_t = 64; ++pub const IGNCR: crate::tcflag_t = 128; ++pub const ICRNL: crate::tcflag_t = 256; ++pub const IXON: crate::tcflag_t = 512; ++pub const IXOFF: crate::tcflag_t = 1024; ++pub const IXANY: crate::tcflag_t = 2048; ++pub const IMAXBEL: crate::tcflag_t = 8192; ++pub const IUCLC: crate::tcflag_t = 16384; ++pub const OPOST: crate::tcflag_t = 1; ++pub const ONLCR: crate::tcflag_t = 2; ++pub const ONOEOT: crate::tcflag_t = 8; ++pub const OCRNL: crate::tcflag_t = 16; ++pub const ONOCR: crate::tcflag_t = 32; ++pub const ONLRET: crate::tcflag_t = 64; ++pub const NLDLY: crate::tcflag_t = 768; ++pub const NL0: crate::tcflag_t = 0; ++pub const NL1: crate::tcflag_t = 256; ++pub const TABDLY: crate::tcflag_t = 3076; ++pub const TAB0: crate::tcflag_t = 0; ++pub const TAB1: crate::tcflag_t = 1024; ++pub const TAB2: crate::tcflag_t = 2048; ++pub const TAB3: crate::tcflag_t = 4; ++pub const CRDLY: crate::tcflag_t = 12288; ++pub const CR0: crate::tcflag_t = 0; ++pub const CR1: crate::tcflag_t = 4096; ++pub const CR2: crate::tcflag_t = 8192; ++pub const CR3: crate::tcflag_t = 12288; ++pub const FFDLY: crate::tcflag_t = 16384; ++pub const FF0: crate::tcflag_t = 0; ++pub const FF1: crate::tcflag_t = 16384; ++pub const BSDLY: crate::tcflag_t = 32768; ++pub const BS0: crate::tcflag_t = 0; ++pub const BS1: crate::tcflag_t = 32768; ++pub const VTDLY: crate::tcflag_t = 65536; ++pub const VT0: crate::tcflag_t = 0; ++pub const VT1: crate::tcflag_t = 65536; ++pub const OLCUC: crate::tcflag_t = 131072; ++pub const OFILL: crate::tcflag_t = 262144; ++pub const OFDEL: crate::tcflag_t = 524288; ++pub const CIGNORE: crate::tcflag_t = 1; ++pub const CSIZE: crate::tcflag_t = 768; ++pub const CS5: crate::tcflag_t = 0; ++pub const CS6: crate::tcflag_t = 256; ++pub const CS7: crate::tcflag_t = 512; ++pub const CS8: crate::tcflag_t = 768; ++pub const CSTOPB: crate::tcflag_t = 1024; ++pub const CREAD: crate::tcflag_t = 2048; ++pub const PARENB: crate::tcflag_t = 4096; ++pub const PARODD: crate::tcflag_t = 8192; ++pub const HUPCL: crate::tcflag_t = 16384; ++pub const CLOCAL: crate::tcflag_t = 32768; ++pub const CRTSCTS: crate::tcflag_t = 65536; ++pub const CRTS_IFLOW: crate::tcflag_t = 65536; ++pub const CCTS_OFLOW: crate::tcflag_t = 65536; ++pub const CDTRCTS: crate::tcflag_t = 131072; ++pub const MDMBUF: crate::tcflag_t = 1048576; ++pub const CHWFLOW: crate::tcflag_t = 1245184; ++pub const ECHOKE: crate::tcflag_t = 1; ++pub const _ECHOE: crate::tcflag_t = 2; ++pub const ECHOE: crate::tcflag_t = 2; ++pub const _ECHOK: crate::tcflag_t = 4; ++pub const ECHOK: crate::tcflag_t = 4; ++pub const _ECHO: crate::tcflag_t = 8; ++pub const ECHO: crate::tcflag_t = 8; ++pub const _ECHONL: crate::tcflag_t = 16; ++pub const ECHONL: crate::tcflag_t = 16; ++pub const ECHOPRT: crate::tcflag_t = 32; ++pub const ECHOCTL: crate::tcflag_t = 64; ++pub const _ISIG: crate::tcflag_t = 128; ++pub const ISIG: crate::tcflag_t = 128; ++pub const _ICANON: crate::tcflag_t = 256; ++pub const ICANON: crate::tcflag_t = 256; ++pub const ALTWERASE: crate::tcflag_t = 512; ++pub const _IEXTEN: crate::tcflag_t = 1024; ++pub const IEXTEN: crate::tcflag_t = 1024; ++pub const EXTPROC: crate::tcflag_t = 2048; ++pub const _TOSTOP: crate::tcflag_t = 4194304; ++pub const TOSTOP: crate::tcflag_t = 4194304; ++pub const FLUSHO: crate::tcflag_t = 8388608; ++pub const NOKERNINFO: crate::tcflag_t = 33554432; ++pub const PENDIN: crate::tcflag_t = 536870912; ++pub const _NOFLSH: crate::tcflag_t = 2147483648; ++pub const NOFLSH: crate::tcflag_t = 2147483648; ++pub const VEOF: usize = 0; ++pub const VEOL: usize = 1; ++pub const VEOL2: usize = 2; ++pub const VERASE: usize = 3; ++pub const VWERASE: usize = 4; ++pub const VKILL: usize = 5; ++pub const VREPRINT: usize = 6; ++pub const VINTR: usize = 8; ++pub const VQUIT: usize = 9; ++pub const VSUSP: usize = 10; ++pub const VDSUSP: usize = 11; ++pub const VSTART: usize = 12; ++pub const VSTOP: usize = 13; ++pub const VLNEXT: usize = 14; ++pub const VDISCARD: usize = 15; ++pub const VMIN: usize = 16; ++pub const VTIME: usize = 17; ++pub const VSTATUS: usize = 18; ++pub const NCCS: usize = 20; ++pub const B0: crate::speed_t = 0; ++pub const B50: crate::speed_t = 50; ++pub const B75: crate::speed_t = 75; ++pub const B110: crate::speed_t = 110; ++pub const B134: crate::speed_t = 134; ++pub const B150: crate::speed_t = 150; ++pub const B200: crate::speed_t = 200; ++pub const B300: crate::speed_t = 300; ++pub const B600: crate::speed_t = 600; ++pub const B1200: crate::speed_t = 1200; ++pub const B1800: crate::speed_t = 1800; ++pub const B2400: crate::speed_t = 2400; ++pub const B4800: crate::speed_t = 4800; ++pub const B9600: crate::speed_t = 9600; ++pub const B7200: crate::speed_t = 7200; ++pub const B14400: crate::speed_t = 14400; ++pub const B19200: crate::speed_t = 19200; ++pub const B28800: crate::speed_t = 28800; ++pub const B38400: crate::speed_t = 38400; ++pub const EXTA: crate::speed_t = B19200; ++pub const EXTB: crate::speed_t = B38400; ++pub const B57600: crate::speed_t = 57600; ++pub const B76800: crate::speed_t = 76800; ++pub const B115200: crate::speed_t = 115200; ++pub const B230400: crate::speed_t = 230400; ++pub const B460800: crate::speed_t = 460800; ++pub const B500000: crate::speed_t = 500000; ++pub const B576000: crate::speed_t = 576000; ++pub const B921600: crate::speed_t = 921600; ++pub const B1000000: crate::speed_t = 1000000; ++pub const B1152000: crate::speed_t = 1152000; ++pub const B1500000: crate::speed_t = 1500000; ++pub const B2000000: crate::speed_t = 2000000; ++pub const B2500000: crate::speed_t = 2500000; ++pub const B3000000: crate::speed_t = 3000000; ++pub const B3500000: crate::speed_t = 3500000; ++pub const B4000000: crate::speed_t = 4000000; ++pub const TCSANOW: c_int = 0; ++pub const TCSADRAIN: c_int = 1; ++pub const TCSAFLUSH: c_int = 2; ++pub const TCSASOFT: c_int = 16; ++pub const TCIFLUSH: c_int = 1; ++pub const TCOFLUSH: c_int = 2; ++pub const TCIOFLUSH: c_int = 3; ++pub const TCOOFF: c_int = 1; ++pub const TCOON: c_int = 2; ++pub const TCIOFF: c_int = 3; ++pub const TCION: c_int = 4; ++pub const TTYDEF_IFLAG: crate::tcflag_t = 11042; ++pub const TTYDEF_LFLAG: crate::tcflag_t = 1483; ++pub const TTYDEF_CFLAG: crate::tcflag_t = 23040; ++pub const TTYDEF_SPEED: crate::tcflag_t = 9600; ++pub const CEOL: u8 = 0u8; ++pub const CERASE: u8 = 127; ++pub const CMIN: u8 = 1; ++pub const CQUIT: u8 = 28; ++pub const CTIME: u8 = 0; ++pub const CBRK: u8 = 0u8; ++ ++// dlfcn.h ++pub const RTLD_DEFAULT: *mut c_void = 0i64 as *mut c_void; ++pub const RTLD_NEXT: *mut c_void = -1i64 as *mut c_void; ++pub const RTLD_LAZY: c_int = 1; ++pub const RTLD_NOW: c_int = 2; ++pub const RTLD_BINDING_MASK: c_int = 3; ++pub const RTLD_NOLOAD: c_int = 4; ++pub const RTLD_DEEPBIND: c_int = 8; ++pub const RTLD_GLOBAL: c_int = 256; ++pub const RTLD_LOCAL: c_int = 0; ++pub const RTLD_NODELETE: c_int = 4096; ++pub const DLFO_STRUCT_HAS_EH_DBASE: usize = 1; ++pub const DLFO_STRUCT_HAS_EH_COUNT: usize = 0; ++pub const LM_ID_BASE: c_long = 0; ++pub const LM_ID_NEWLM: c_long = -1; ++ ++// bits/signum_generic.h ++pub const SIGINT: c_int = 2; ++pub const SIGILL: c_int = 4; ++pub const SIGABRT: c_int = 6; ++pub const SIGFPE: c_int = 8; ++pub const SIGSEGV: c_int = 11; ++pub const SIGTERM: c_int = 15; ++pub const SIGHUP: c_int = 1; ++pub const SIGQUIT: c_int = 3; ++pub const SIGTRAP: c_int = 5; ++pub const SIGKILL: c_int = 9; ++pub const SIGPIPE: c_int = 13; ++pub const SIGALRM: c_int = 14; ++pub const SIGIOT: c_int = 6; ++pub const SIGBUS: c_int = 10; ++pub const SIGSYS: c_int = 12; ++pub const SIGEMT: c_int = 7; ++pub const SIGINFO: c_int = 29; ++pub const SIGLOST: c_int = 32; ++pub const SIGURG: c_int = 16; ++pub const SIGSTOP: c_int = 17; ++pub const SIGTSTP: c_int = 18; ++pub const SIGCONT: c_int = 19; ++pub const SIGCHLD: c_int = 20; ++pub const SIGTTIN: c_int = 21; ++pub const SIGTTOU: c_int = 22; ++pub const SIGPOLL: c_int = 23; ++pub const SIGXCPU: c_int = 24; ++pub const SIGVTALRM: c_int = 26; ++pub const SIGPROF: c_int = 27; ++pub const SIGXFSZ: c_int = 25; ++pub const SIGUSR1: c_int = 30; ++pub const SIGUSR2: c_int = 31; ++pub const SIGWINCH: c_int = 28; ++pub const SIGIO: c_int = 23; ++pub const SIGCLD: c_int = 20; ++pub const __SIGRTMIN: usize = 32; ++pub const __SIGRTMAX: usize = 32; ++pub const _NSIG: usize = 33; ++pub const NSIG: usize = 33; ++ ++// bits/sigaction.h ++pub const SA_ONSTACK: c_int = 1; ++pub const SA_RESTART: c_int = 2; ++pub const SA_NODEFER: c_int = 16; ++pub const SA_RESETHAND: c_int = 4; ++pub const SA_NOCLDSTOP: c_int = 8; ++pub const SA_SIGINFO: c_int = 64; ++pub const SA_INTERRUPT: c_int = 0; ++pub const SA_NOMASK: c_int = 16; ++pub const SA_ONESHOT: c_int = 4; ++pub const SA_STACK: c_int = 1; ++pub const SIG_BLOCK: c_int = 1; ++pub const SIG_UNBLOCK: c_int = 2; ++pub const SIG_SETMASK: c_int = 3; ++ ++// bits/sigcontext.h ++pub const FPC_IE: u16 = 1; ++pub const FPC_IM: u16 = 1; ++pub const FPC_DE: u16 = 2; ++pub const FPC_DM: u16 = 2; ++pub const FPC_ZE: u16 = 4; ++pub const FPC_ZM: u16 = 4; ++pub const FPC_OE: u16 = 8; ++pub const FPC_OM: u16 = 8; ++pub const FPC_UE: u16 = 16; ++pub const FPC_PE: u16 = 32; ++pub const FPC_PC: u16 = 768; ++pub const FPC_PC_24: u16 = 0; ++pub const FPC_PC_53: u16 = 512; ++pub const FPC_PC_64: u16 = 768; ++pub const FPC_RC: u16 = 3072; ++pub const FPC_RC_RN: u16 = 0; ++pub const FPC_RC_RD: u16 = 1024; ++pub const FPC_RC_RU: u16 = 2048; ++pub const FPC_RC_CHOP: u16 = 3072; ++pub const FPC_IC: u16 = 4096; ++pub const FPC_IC_PROJ: u16 = 0; ++pub const FPC_IC_AFF: u16 = 4096; ++pub const FPS_IE: u16 = 1; ++pub const FPS_DE: u16 = 2; ++pub const FPS_ZE: u16 = 4; ++pub const FPS_OE: u16 = 8; ++pub const FPS_UE: u16 = 16; ++pub const FPS_PE: u16 = 32; ++pub const FPS_SF: u16 = 64; ++pub const FPS_ES: u16 = 128; ++pub const FPS_C0: u16 = 256; ++pub const FPS_C1: u16 = 512; ++pub const FPS_C2: u16 = 1024; ++pub const FPS_TOS: u16 = 14336; ++pub const FPS_TOS_SHIFT: u16 = 11; ++pub const FPS_C3: u16 = 16384; ++pub const FPS_BUSY: u16 = 32768; ++pub const FPE_INTOVF_TRAP: c_int = 1; ++pub const FPE_INTDIV_FAULT: c_int = 2; ++pub const FPE_FLTOVF_FAULT: c_int = 3; ++pub const FPE_FLTDIV_FAULT: c_int = 4; ++pub const FPE_FLTUND_FAULT: c_int = 5; ++pub const FPE_SUBRNG_FAULT: c_int = 7; ++pub const FPE_FLTDNR_FAULT: c_int = 8; ++pub const FPE_FLTINX_FAULT: c_int = 9; ++pub const FPE_EMERR_FAULT: c_int = 10; ++pub const FPE_EMBND_FAULT: c_int = 11; ++pub const ILL_INVOPR_FAULT: c_int = 1; ++pub const ILL_STACK_FAULT: c_int = 2; ++pub const ILL_FPEOPR_FAULT: c_int = 3; ++pub const DBG_SINGLE_TRAP: c_int = 1; ++pub const DBG_BRKPNT_FAULT: c_int = 2; ++pub const __NGREG: usize = 19; ++pub const NGREG: usize = 19; ++ ++// bits/sigstack.h ++pub const MINSIGSTKSZ: usize = 8192; ++pub const SIGSTKSZ: usize = 40960; ++ ++// sys/stat.h ++pub const __S_IFMT: mode_t = 0o17_0000; ++pub const __S_IFDIR: mode_t = 0o4_0000; ++pub const __S_IFCHR: mode_t = 0o2_0000; ++pub const __S_IFBLK: mode_t = 0o6_0000; ++pub const __S_IFREG: mode_t = 0o10_0000; ++pub const __S_IFLNK: mode_t = 0o12_0000; ++pub const __S_IFSOCK: mode_t = 0o14_0000; ++pub const __S_IFIFO: mode_t = 0o1_0000; ++pub const __S_ISUID: mode_t = 0o4000; ++pub const __S_ISGID: mode_t = 0o2000; ++pub const __S_ISVTX: mode_t = 0o1000; ++pub const __S_IREAD: mode_t = 0o0400; ++pub const __S_IWRITE: mode_t = 0o0200; ++pub const __S_IEXEC: mode_t = 0o0100; ++pub const S_INOCACHE: mode_t = 0o20_0000; ++pub const S_IUSEUNK: mode_t = 0o40_0000; ++pub const S_IUNKNOWN: mode_t = 0o700_0000; ++pub const S_IUNKSHIFT: mode_t = 0o0014; ++pub const S_IPTRANS: mode_t = 0o1000_0000; ++pub const S_IATRANS: mode_t = 0o2000_0000; ++pub const S_IROOT: mode_t = 0o4000_0000; ++pub const S_ITRANS: mode_t = 0o7000_0000; ++pub const S_IMMAP0: mode_t = 0o10000_0000; ++pub const CMASK: mode_t = 18; ++pub const UF_SETTABLE: c_uint = 65535; ++pub const UF_NODUMP: c_uint = 1; ++pub const UF_IMMUTABLE: c_uint = 2; ++pub const UF_APPEND: c_uint = 4; ++pub const UF_OPAQUE: c_uint = 8; ++pub const UF_NOUNLINK: c_uint = 16; ++pub const SF_SETTABLE: c_uint = 4294901760; ++pub const SF_ARCHIVED: c_uint = 65536; ++pub const SF_IMMUTABLE: c_uint = 131072; ++pub const SF_APPEND: c_uint = 262144; ++pub const SF_NOUNLINK: c_uint = 1048576; ++pub const SF_SNAPSHOT: c_uint = 2097152; ++pub const UTIME_NOW: c_long = -1; ++pub const UTIME_OMIT: c_long = -2; ++pub const S_IFMT: crate::mode_t = 0o17_0000; ++pub const S_IFDIR: crate::mode_t = 0o4_0000; ++pub const S_IFCHR: crate::mode_t = 0o2_0000; ++pub const S_IFBLK: crate::mode_t = 0o6_0000; ++pub const S_IFREG: crate::mode_t = 0o10_0000; ++pub const S_IFIFO: crate::mode_t = 0o1_0000; ++pub const S_IFLNK: crate::mode_t = 0o12_0000; ++pub const S_IFSOCK: crate::mode_t = 0o14_0000; ++pub const S_ISUID: crate::mode_t = 0o4000; ++pub const S_ISGID: crate::mode_t = 0o2000; ++pub const S_ISVTX: crate::mode_t = 0o1000; ++pub const S_IRUSR: crate::mode_t = 0o0400; ++pub const S_IWUSR: crate::mode_t = 0o0200; ++pub const S_IXUSR: crate::mode_t = 0o0100; ++pub const S_IRWXU: crate::mode_t = 0o0700; ++pub const S_IREAD: crate::mode_t = 0o0400; ++pub const S_IWRITE: crate::mode_t = 0o0200; ++pub const S_IEXEC: crate::mode_t = 0o0100; ++pub const S_IRGRP: crate::mode_t = 0o0040; ++pub const S_IWGRP: crate::mode_t = 0o0020; ++pub const S_IXGRP: crate::mode_t = 0o0010; ++pub const S_IRWXG: crate::mode_t = 0o0070; ++pub const S_IROTH: crate::mode_t = 0o0004; ++pub const S_IWOTH: crate::mode_t = 0o0002; ++pub const S_IXOTH: crate::mode_t = 0o0001; ++pub const S_IRWXO: crate::mode_t = 0o0007; ++pub const ACCESSPERMS: crate::mode_t = 511; ++pub const ALLPERMS: crate::mode_t = 4095; ++pub const DEFFILEMODE: crate::mode_t = 438; ++pub const S_BLKSIZE: usize = 512; ++pub const STATX_TYPE: c_uint = 1; ++pub const STATX_MODE: c_uint = 2; ++pub const STATX_NLINK: c_uint = 4; ++pub const STATX_UID: c_uint = 8; ++pub const STATX_GID: c_uint = 16; ++pub const STATX_ATIME: c_uint = 32; ++pub const STATX_MTIME: c_uint = 64; ++pub const STATX_CTIME: c_uint = 128; ++pub const STATX_INO: c_uint = 256; ++pub const STATX_SIZE: c_uint = 512; ++pub const STATX_BLOCKS: c_uint = 1024; ++pub const STATX_BASIC_STATS: c_uint = 2047; ++pub const STATX_ALL: c_uint = 4095; ++pub const STATX_BTIME: c_uint = 2048; ++pub const STATX_MNT_ID: c_uint = 4096; ++pub const STATX_DIOALIGN: c_uint = 8192; ++pub const STATX__RESERVED: c_uint = 2147483648; ++pub const STATX_ATTR_COMPRESSED: c_uint = 4; ++pub const STATX_ATTR_IMMUTABLE: c_uint = 16; ++pub const STATX_ATTR_APPEND: c_uint = 32; ++pub const STATX_ATTR_NODUMP: c_uint = 64; ++pub const STATX_ATTR_ENCRYPTED: c_uint = 2048; ++pub const STATX_ATTR_AUTOMOUNT: c_uint = 4096; ++pub const STATX_ATTR_MOUNT_ROOT: c_uint = 8192; ++pub const STATX_ATTR_VERITY: c_uint = 1048576; ++pub const STATX_ATTR_DAX: c_uint = 2097152; ++ ++// sys/ioctl.h ++pub const TIOCM_LE: c_int = 1; ++pub const TIOCM_DTR: c_int = 2; ++pub const TIOCM_RTS: c_int = 4; ++pub const TIOCM_ST: c_int = 8; ++pub const TIOCM_SR: c_int = 16; ++pub const TIOCM_CTS: c_int = 32; ++pub const TIOCM_CAR: c_int = 64; ++pub const TIOCM_CD: c_int = 64; ++pub const TIOCM_RNG: c_int = 128; ++pub const TIOCM_RI: c_int = 128; ++pub const TIOCM_DSR: c_int = 256; ++pub const TIOCPKT_DATA: c_int = 0; ++pub const TIOCPKT_FLUSHREAD: c_int = 1; ++pub const TIOCPKT_FLUSHWRITE: c_int = 2; ++pub const TIOCPKT_STOP: c_int = 4; ++pub const TIOCPKT_START: c_int = 8; ++pub const TIOCPKT_NOSTOP: c_int = 16; ++pub const TIOCPKT_DOSTOP: c_int = 32; ++pub const TIOCPKT_IOCTL: c_int = 64; ++pub const TTYDISC: c_int = 0; ++pub const TABLDISC: c_int = 3; ++pub const SLIPDISC: c_int = 4; ++pub const TANDEM: crate::tcflag_t = 1; ++pub const CBREAK: crate::tcflag_t = 2; ++pub const LCASE: crate::tcflag_t = 4; ++pub const CRMOD: crate::tcflag_t = 16; ++pub const RAW: crate::tcflag_t = 32; ++pub const ODDP: crate::tcflag_t = 64; ++pub const EVENP: crate::tcflag_t = 128; ++pub const ANYP: crate::tcflag_t = 192; ++pub const NLDELAY: crate::tcflag_t = 768; ++pub const NL2: crate::tcflag_t = 512; ++pub const NL3: crate::tcflag_t = 768; ++pub const TBDELAY: crate::tcflag_t = 3072; ++pub const XTABS: crate::tcflag_t = 3072; ++pub const CRDELAY: crate::tcflag_t = 12288; ++pub const VTDELAY: crate::tcflag_t = 16384; ++pub const BSDELAY: crate::tcflag_t = 32768; ++pub const ALLDELAY: crate::tcflag_t = 65280; ++pub const CRTBS: crate::tcflag_t = 65536; ++pub const PRTERA: crate::tcflag_t = 131072; ++pub const CRTERA: crate::tcflag_t = 262144; ++pub const TILDE: crate::tcflag_t = 524288; ++pub const LITOUT: crate::tcflag_t = 2097152; ++pub const NOHANG: crate::tcflag_t = 16777216; ++pub const L001000: crate::tcflag_t = 33554432; ++pub const CRTKIL: crate::tcflag_t = 67108864; ++pub const PASS8: crate::tcflag_t = 134217728; ++pub const CTLECH: crate::tcflag_t = 268435456; ++pub const DECCTQ: crate::tcflag_t = 1073741824; ++ ++pub const FIONBIO: c_ulong = 0xa008007e; ++pub const FIONREAD: c_ulong = 0x6008007f; ++pub const TIOCSWINSZ: c_ulong = 0x90200767; ++pub const TIOCGWINSZ: c_ulong = 0x50200768; ++pub const TIOCEXCL: c_ulong = 0x70d; ++pub const TIOCNXCL: c_ulong = 0x70e; ++pub const TIOCSCTTY: c_ulong = 0x761; ++ ++pub const FIOCLEX: c_ulong = 1; ++ ++// fcntl.h ++pub const O_EXEC: c_int = 4; ++pub const O_NORW: c_int = 0; ++pub const O_RDONLY: c_int = 1; ++pub const O_WRONLY: c_int = 2; ++pub const O_RDWR: c_int = 3; ++pub const O_ACCMODE: c_int = 3; ++pub const O_LARGEFILE: c_int = 0; ++pub const O_CREAT: c_int = 16; ++pub const O_EXCL: c_int = 32; ++pub const O_NOLINK: c_int = 64; ++pub const O_NOTRANS: c_int = 128; ++pub const O_NOFOLLOW: c_int = 1048576; ++pub const O_DIRECTORY: c_int = 2097152; ++pub const O_APPEND: c_int = 256; ++pub const O_ASYNC: c_int = 512; ++pub const O_FSYNC: c_int = 1024; ++pub const O_SYNC: c_int = 1024; ++pub const O_NOATIME: c_int = 2048; ++pub const O_SHLOCK: c_int = 131072; ++pub const O_EXLOCK: c_int = 262144; ++pub const O_DSYNC: c_int = 1024; ++pub const O_RSYNC: c_int = 1024; ++pub const O_NONBLOCK: c_int = 8; ++pub const O_NDELAY: c_int = 8; ++pub const O_HURD: c_int = 458751; ++pub const O_TRUNC: c_int = 65536; ++pub const O_CLOEXEC: c_int = 4194304; ++pub const O_IGNORE_CTTY: c_int = 524288; ++pub const O_TMPFILE: c_int = 8388608; ++pub const O_NOCTTY: c_int = 0; ++pub const FREAD: c_int = 1; ++pub const FWRITE: c_int = 2; ++pub const FASYNC: c_int = 512; ++pub const FCREAT: c_int = 16; ++pub const FEXCL: c_int = 32; ++pub const FTRUNC: c_int = 65536; ++pub const FNOCTTY: c_int = 0; ++pub const FFSYNC: c_int = 1024; ++pub const FSYNC: c_int = 1024; ++pub const FAPPEND: c_int = 256; ++pub const FNONBLOCK: c_int = 8; ++pub const FNDELAY: c_int = 8; ++pub const F_DUPFD: c_int = 0; ++pub const F_GETFD: c_int = 1; ++pub const F_SETFD: c_int = 2; ++pub const F_GETFL: c_int = 3; ++pub const F_SETFL: c_int = 4; ++pub const F_GETOWN: c_int = 5; ++pub const F_SETOWN: c_int = 6; ++pub const F_GETLK: c_int = 7; ++pub const F_SETLK: c_int = 8; ++pub const F_SETLKW: c_int = 9; ++pub const F_GETLK64: c_int = 10; ++pub const F_SETLK64: c_int = 11; ++pub const F_SETLKW64: c_int = 12; ++pub const F_DUPFD_CLOEXEC: c_int = 1030; ++pub const FD_CLOEXEC: c_int = 1; ++pub const F_RDLCK: c_int = 1; ++pub const F_WRLCK: c_int = 2; ++pub const F_UNLCK: c_int = 3; ++pub const POSIX_FADV_NORMAL: c_int = 0; ++pub const POSIX_FADV_RANDOM: c_int = 1; ++pub const POSIX_FADV_SEQUENTIAL: c_int = 2; ++pub const POSIX_FADV_WILLNEED: c_int = 3; ++pub const POSIX_FADV_DONTNEED: c_int = 4; ++pub const POSIX_FADV_NOREUSE: c_int = 5; ++pub const AT_FDCWD: c_int = -100; ++pub const AT_SYMLINK_NOFOLLOW: c_int = 256; ++pub const AT_REMOVEDIR: c_int = 512; ++pub const AT_SYMLINK_FOLLOW: c_int = 1024; ++pub const AT_NO_AUTOMOUNT: c_int = 2048; ++pub const AT_EMPTY_PATH: c_int = 4096; ++pub const AT_STATX_SYNC_TYPE: c_int = 24576; ++pub const AT_STATX_SYNC_AS_STAT: c_int = 0; ++pub const AT_STATX_FORCE_SYNC: c_int = 8192; ++pub const AT_STATX_DONT_SYNC: c_int = 16384; ++pub const AT_RECURSIVE: c_int = 32768; ++pub const AT_EACCESS: c_int = 512; ++ ++// sys/uio.h ++pub const RWF_HIPRI: c_int = 1; ++pub const RWF_DSYNC: c_int = 2; ++pub const RWF_SYNC: c_int = 4; ++pub const RWF_NOWAIT: c_int = 8; ++pub const RWF_APPEND: c_int = 16; ++ ++// errno.h ++pub const EPERM: c_int = 1073741825; ++pub const ENOENT: c_int = 1073741826; ++pub const ESRCH: c_int = 1073741827; ++pub const EINTR: c_int = 1073741828; ++pub const EIO: c_int = 1073741829; ++pub const ENXIO: c_int = 1073741830; ++pub const E2BIG: c_int = 1073741831; ++pub const ENOEXEC: c_int = 1073741832; ++pub const EBADF: c_int = 1073741833; ++pub const ECHILD: c_int = 1073741834; ++pub const EDEADLK: c_int = 1073741835; ++pub const ENOMEM: c_int = 1073741836; ++pub const EACCES: c_int = 1073741837; ++pub const EFAULT: c_int = 1073741838; ++pub const ENOTBLK: c_int = 1073741839; ++pub const EBUSY: c_int = 1073741840; ++pub const EEXIST: c_int = 1073741841; ++pub const EXDEV: c_int = 1073741842; ++pub const ENODEV: c_int = 1073741843; ++pub const ENOTDIR: c_int = 1073741844; ++pub const EISDIR: c_int = 1073741845; ++pub const EINVAL: c_int = 1073741846; ++pub const EMFILE: c_int = 1073741848; ++pub const ENFILE: c_int = 1073741847; ++pub const ENOTTY: c_int = 1073741849; ++pub const ETXTBSY: c_int = 1073741850; ++pub const EFBIG: c_int = 1073741851; ++pub const ENOSPC: c_int = 1073741852; ++pub const ESPIPE: c_int = 1073741853; ++pub const EROFS: c_int = 1073741854; ++pub const EMLINK: c_int = 1073741855; ++pub const EPIPE: c_int = 1073741856; ++pub const EDOM: c_int = 1073741857; ++pub const ERANGE: c_int = 1073741858; ++pub const EAGAIN: c_int = 1073741859; ++pub const EWOULDBLOCK: c_int = 1073741859; ++pub const EINPROGRESS: c_int = 1073741860; ++pub const EALREADY: c_int = 1073741861; ++pub const ENOTSOCK: c_int = 1073741862; ++pub const EMSGSIZE: c_int = 1073741864; ++pub const EPROTOTYPE: c_int = 1073741865; ++pub const ENOPROTOOPT: c_int = 1073741866; ++pub const EPROTONOSUPPORT: c_int = 1073741867; ++pub const ESOCKTNOSUPPORT: c_int = 1073741868; ++pub const EOPNOTSUPP: c_int = 1073741869; ++pub const EPFNOSUPPORT: c_int = 1073741870; ++pub const EAFNOSUPPORT: c_int = 1073741871; ++pub const EADDRINUSE: c_int = 1073741872; ++pub const EADDRNOTAVAIL: c_int = 1073741873; ++pub const ENETDOWN: c_int = 1073741874; ++pub const ENETUNREACH: c_int = 1073741875; ++pub const ENETRESET: c_int = 1073741876; ++pub const ECONNABORTED: c_int = 1073741877; ++pub const ECONNRESET: c_int = 1073741878; ++pub const ENOBUFS: c_int = 1073741879; ++pub const EISCONN: c_int = 1073741880; ++pub const ENOTCONN: c_int = 1073741881; ++pub const EDESTADDRREQ: c_int = 1073741863; ++pub const ESHUTDOWN: c_int = 1073741882; ++pub const ETOOMANYREFS: c_int = 1073741883; ++pub const ETIMEDOUT: c_int = 1073741884; ++pub const ECONNREFUSED: c_int = 1073741885; ++pub const ELOOP: c_int = 1073741886; ++pub const ENAMETOOLONG: c_int = 1073741887; ++pub const EHOSTDOWN: c_int = 1073741888; ++pub const EHOSTUNREACH: c_int = 1073741889; ++pub const ENOTEMPTY: c_int = 1073741890; ++pub const EPROCLIM: c_int = 1073741891; ++pub const EUSERS: c_int = 1073741892; ++pub const EDQUOT: c_int = 1073741893; ++pub const ESTALE: c_int = 1073741894; ++pub const EREMOTE: c_int = 1073741895; ++pub const EBADRPC: c_int = 1073741896; ++pub const ERPCMISMATCH: c_int = 1073741897; ++pub const EPROGUNAVAIL: c_int = 1073741898; ++pub const EPROGMISMATCH: c_int = 1073741899; ++pub const EPROCUNAVAIL: c_int = 1073741900; ++pub const ENOLCK: c_int = 1073741901; ++pub const EFTYPE: c_int = 1073741903; ++pub const EAUTH: c_int = 1073741904; ++pub const ENEEDAUTH: c_int = 1073741905; ++pub const ENOSYS: c_int = 1073741902; ++pub const ELIBEXEC: c_int = 1073741907; ++pub const ENOTSUP: c_int = 1073741942; ++pub const EILSEQ: c_int = 1073741930; ++pub const EBACKGROUND: c_int = 1073741924; ++pub const EDIED: c_int = 1073741925; ++pub const EGREGIOUS: c_int = 1073741927; ++pub const EIEIO: c_int = 1073741928; ++pub const EGRATUITOUS: c_int = 1073741929; ++pub const EBADMSG: c_int = 1073741931; ++pub const EIDRM: c_int = 1073741932; ++pub const EMULTIHOP: c_int = 1073741933; ++pub const ENODATA: c_int = 1073741934; ++pub const ENOLINK: c_int = 1073741935; ++pub const ENOMSG: c_int = 1073741936; ++pub const ENOSR: c_int = 1073741937; ++pub const ENOSTR: c_int = 1073741938; ++pub const EOVERFLOW: c_int = 1073741939; ++pub const EPROTO: c_int = 1073741940; ++pub const ETIME: c_int = 1073741941; ++pub const ECANCELED: c_int = 1073741943; ++pub const EOWNERDEAD: c_int = 1073741944; ++pub const ENOTRECOVERABLE: c_int = 1073741945; ++pub const EMACH_SEND_IN_PROGRESS: c_int = 268435457; ++pub const EMACH_SEND_INVALID_DATA: c_int = 268435458; ++pub const EMACH_SEND_INVALID_DEST: c_int = 268435459; ++pub const EMACH_SEND_TIMED_OUT: c_int = 268435460; ++pub const EMACH_SEND_WILL_NOTIFY: c_int = 268435461; ++pub const EMACH_SEND_NOTIFY_IN_PROGRESS: c_int = 268435462; ++pub const EMACH_SEND_INTERRUPTED: c_int = 268435463; ++pub const EMACH_SEND_MSG_TOO_SMALL: c_int = 268435464; ++pub const EMACH_SEND_INVALID_REPLY: c_int = 268435465; ++pub const EMACH_SEND_INVALID_RIGHT: c_int = 268435466; ++pub const EMACH_SEND_INVALID_NOTIFY: c_int = 268435467; ++pub const EMACH_SEND_INVALID_MEMORY: c_int = 268435468; ++pub const EMACH_SEND_NO_BUFFER: c_int = 268435469; ++pub const EMACH_SEND_NO_NOTIFY: c_int = 268435470; ++pub const EMACH_SEND_INVALID_TYPE: c_int = 268435471; ++pub const EMACH_SEND_INVALID_HEADER: c_int = 268435472; ++pub const EMACH_RCV_IN_PROGRESS: c_int = 268451841; ++pub const EMACH_RCV_INVALID_NAME: c_int = 268451842; ++pub const EMACH_RCV_TIMED_OUT: c_int = 268451843; ++pub const EMACH_RCV_TOO_LARGE: c_int = 268451844; ++pub const EMACH_RCV_INTERRUPTED: c_int = 268451845; ++pub const EMACH_RCV_PORT_CHANGED: c_int = 268451846; ++pub const EMACH_RCV_INVALID_NOTIFY: c_int = 268451847; ++pub const EMACH_RCV_INVALID_DATA: c_int = 268451848; ++pub const EMACH_RCV_PORT_DIED: c_int = 268451849; ++pub const EMACH_RCV_IN_SET: c_int = 268451850; ++pub const EMACH_RCV_HEADER_ERROR: c_int = 268451851; ++pub const EMACH_RCV_BODY_ERROR: c_int = 268451852; ++pub const EKERN_INVALID_ADDRESS: c_int = 1; ++pub const EKERN_PROTECTION_FAILURE: c_int = 2; ++pub const EKERN_NO_SPACE: c_int = 3; ++pub const EKERN_INVALID_ARGUMENT: c_int = 4; ++pub const EKERN_FAILURE: c_int = 5; ++pub const EKERN_RESOURCE_SHORTAGE: c_int = 6; ++pub const EKERN_NOT_RECEIVER: c_int = 7; ++pub const EKERN_NO_ACCESS: c_int = 8; ++pub const EKERN_MEMORY_FAILURE: c_int = 9; ++pub const EKERN_MEMORY_ERROR: c_int = 10; ++pub const EKERN_NOT_IN_SET: c_int = 12; ++pub const EKERN_NAME_EXISTS: c_int = 13; ++pub const EKERN_ABORTED: c_int = 14; ++pub const EKERN_INVALID_NAME: c_int = 15; ++pub const EKERN_INVALID_TASK: c_int = 16; ++pub const EKERN_INVALID_RIGHT: c_int = 17; ++pub const EKERN_INVALID_VALUE: c_int = 18; ++pub const EKERN_UREFS_OVERFLOW: c_int = 19; ++pub const EKERN_INVALID_CAPABILITY: c_int = 20; ++pub const EKERN_RIGHT_EXISTS: c_int = 21; ++pub const EKERN_INVALID_HOST: c_int = 22; ++pub const EKERN_MEMORY_PRESENT: c_int = 23; ++pub const EKERN_WRITE_PROTECTION_FAILURE: c_int = 24; ++pub const EKERN_TERMINATED: c_int = 26; ++pub const EKERN_TIMEDOUT: c_int = 27; ++pub const EKERN_INTERRUPTED: c_int = 28; ++pub const EMIG_TYPE_ERROR: c_int = -300; ++pub const EMIG_REPLY_MISMATCH: c_int = -301; ++pub const EMIG_REMOTE_ERROR: c_int = -302; ++pub const EMIG_BAD_ID: c_int = -303; ++pub const EMIG_BAD_ARGUMENTS: c_int = -304; ++pub const EMIG_NO_REPLY: c_int = -305; ++pub const EMIG_EXCEPTION: c_int = -306; ++pub const EMIG_ARRAY_TOO_LARGE: c_int = -307; ++pub const EMIG_SERVER_DIED: c_int = -308; ++pub const EMIG_DESTROY_REQUEST: c_int = -309; ++pub const ED_IO_ERROR: c_int = 2500; ++pub const ED_WOULD_BLOCK: c_int = 2501; ++pub const ED_NO_SUCH_DEVICE: c_int = 2502; ++pub const ED_ALREADY_OPEN: c_int = 2503; ++pub const ED_DEVICE_DOWN: c_int = 2504; ++pub const ED_INVALID_OPERATION: c_int = 2505; ++pub const ED_INVALID_RECNUM: c_int = 2506; ++pub const ED_INVALID_SIZE: c_int = 2507; ++pub const ED_NO_MEMORY: c_int = 2508; ++pub const ED_READ_ONLY: c_int = 2509; ++pub const _HURD_ERRNOS: usize = 122; ++ ++// sched.h ++pub const SCHED_OTHER: c_int = 0; ++pub const SCHED_FIFO: c_int = 1; ++pub const SCHED_RR: c_int = 2; ++pub const _BITS_TYPES_STRUCT_SCHED_PARAM: usize = 1; ++pub const __CPU_SETSIZE: usize = 1024; ++pub const CPU_SETSIZE: usize = 1024; ++ ++// pthread.h ++pub const PTHREAD_SPINLOCK_INITIALIZER: c_int = 0; ++pub const PTHREAD_CANCEL_DISABLE: c_int = 0; ++pub const PTHREAD_CANCEL_ENABLE: c_int = 1; ++pub const PTHREAD_CANCEL_DEFERRED: c_int = 0; ++pub const PTHREAD_CANCEL_ASYNCHRONOUS: c_int = 1; ++pub const PTHREAD_BARRIER_SERIAL_THREAD: c_int = -1; ++ ++// netinet/tcp.h ++pub const TCP_NODELAY: c_int = 1; ++pub const TCP_MAXSEG: c_int = 2; ++pub const TCP_CORK: c_int = 3; ++pub const TCP_KEEPIDLE: c_int = 4; ++pub const TCP_KEEPINTVL: c_int = 5; ++pub const TCP_KEEPCNT: c_int = 6; ++pub const TCP_SYNCNT: c_int = 7; ++pub const TCP_LINGER2: c_int = 8; ++pub const TCP_DEFER_ACCEPT: c_int = 9; ++pub const TCP_WINDOW_CLAMP: c_int = 10; ++pub const TCP_INFO: c_int = 11; ++pub const TCP_QUICKACK: c_int = 12; ++pub const TCP_CONGESTION: c_int = 13; ++pub const TCP_MD5SIG: c_int = 14; ++pub const TCP_COOKIE_TRANSACTIONS: c_int = 15; ++pub const TCP_THIN_LINEAR_TIMEOUTS: c_int = 16; ++pub const TCP_THIN_DUPACK: c_int = 17; ++pub const TCP_USER_TIMEOUT: c_int = 18; ++pub const TCP_REPAIR: c_int = 19; ++pub const TCP_REPAIR_QUEUE: c_int = 20; ++pub const TCP_QUEUE_SEQ: c_int = 21; ++pub const TCP_REPAIR_OPTIONS: c_int = 22; ++pub const TCP_FASTOPEN: c_int = 23; ++pub const TCP_TIMESTAMP: c_int = 24; ++pub const TCP_NOTSENT_LOWAT: c_int = 25; ++pub const TCP_CC_INFO: c_int = 26; ++pub const TCP_SAVE_SYN: c_int = 27; ++pub const TCP_SAVED_SYN: c_int = 28; ++pub const TCP_REPAIR_WINDOW: c_int = 29; ++pub const TCP_FASTOPEN_CONNECT: c_int = 30; ++pub const TCP_ULP: c_int = 31; ++pub const TCP_MD5SIG_EXT: c_int = 32; ++pub const TCP_FASTOPEN_KEY: c_int = 33; ++pub const TCP_FASTOPEN_NO_COOKIE: c_int = 34; ++pub const TCP_ZEROCOPY_RECEIVE: c_int = 35; ++pub const TCP_INQ: c_int = 36; ++pub const TCP_CM_INQ: c_int = 36; ++pub const TCP_TX_DELAY: c_int = 37; ++pub const TCP_REPAIR_ON: c_int = 1; ++pub const TCP_REPAIR_OFF: c_int = 0; ++pub const TCP_REPAIR_OFF_NO_WP: c_int = -1; ++ ++// stdint.h ++pub const INT8_MIN: i8 = -128; ++pub const INT16_MIN: i16 = -32768; ++pub const INT32_MIN: i32 = -2147483648; ++pub const INT8_MAX: i8 = 127; ++pub const INT16_MAX: i16 = 32767; ++pub const INT32_MAX: i32 = 2147483647; ++pub const UINT8_MAX: u8 = 255; ++pub const UINT16_MAX: u16 = 65535; ++pub const UINT32_MAX: u32 = 4294967295; ++pub const INT_LEAST8_MIN: int_least8_t = -128; ++pub const INT_LEAST16_MIN: int_least16_t = -32768; ++pub const INT_LEAST32_MIN: int_least32_t = -2147483648; ++pub const INT_LEAST8_MAX: int_least8_t = 127; ++pub const INT_LEAST16_MAX: int_least16_t = 32767; ++pub const INT_LEAST32_MAX: int_least32_t = 2147483647; ++pub const UINT_LEAST8_MAX: uint_least8_t = 255; ++pub const UINT_LEAST16_MAX: uint_least16_t = 65535; ++pub const UINT_LEAST32_MAX: uint_least32_t = 4294967295; ++pub const INT_FAST8_MIN: int_fast8_t = -128; ++pub const INT_FAST16_MIN: int_fast16_t = -2147483648; ++pub const INT_FAST32_MIN: int_fast32_t = -2147483648; ++pub const INT_FAST8_MAX: int_fast8_t = 127; ++pub const INT_FAST16_MAX: int_fast16_t = 2147483647; ++pub const INT_FAST32_MAX: int_fast32_t = 2147483647; ++pub const UINT_FAST8_MAX: uint_fast8_t = 255; ++pub const UINT_FAST16_MAX: uint_fast16_t = 4294967295; ++pub const UINT_FAST32_MAX: uint_fast32_t = 4294967295; ++pub const INTPTR_MIN: __intptr_t = -2147483648; ++pub const INTPTR_MAX: __intptr_t = 2147483647; ++pub const UINTPTR_MAX: usize = 4294967295; ++pub const PTRDIFF_MIN: __ptrdiff_t = -2147483648; ++pub const PTRDIFF_MAX: __ptrdiff_t = 2147483647; ++pub const SIG_ATOMIC_MIN: __sig_atomic_t = -2147483648; ++pub const SIG_ATOMIC_MAX: __sig_atomic_t = 2147483647; ++pub const SIZE_MAX: usize = 4294967295; ++pub const WINT_MIN: wint_t = 0; ++pub const WINT_MAX: wint_t = 4294967295; ++pub const INT8_WIDTH: usize = 8; ++pub const UINT8_WIDTH: usize = 8; ++pub const INT16_WIDTH: usize = 16; ++pub const UINT16_WIDTH: usize = 16; ++pub const INT32_WIDTH: usize = 32; ++pub const UINT32_WIDTH: usize = 32; ++pub const INT64_WIDTH: usize = 64; ++pub const UINT64_WIDTH: usize = 64; ++pub const INT_LEAST8_WIDTH: usize = 8; ++pub const UINT_LEAST8_WIDTH: usize = 8; ++pub const INT_LEAST16_WIDTH: usize = 16; ++pub const UINT_LEAST16_WIDTH: usize = 16; ++pub const INT_LEAST32_WIDTH: usize = 32; ++pub const UINT_LEAST32_WIDTH: usize = 32; ++pub const INT_LEAST64_WIDTH: usize = 64; ++pub const UINT_LEAST64_WIDTH: usize = 64; ++pub const INT_FAST8_WIDTH: usize = 8; ++pub const UINT_FAST8_WIDTH: usize = 8; ++pub const INT_FAST16_WIDTH: usize = 32; ++pub const UINT_FAST16_WIDTH: usize = 32; ++pub const INT_FAST32_WIDTH: usize = 32; ++pub const UINT_FAST32_WIDTH: usize = 32; ++pub const INT_FAST64_WIDTH: usize = 64; ++pub const UINT_FAST64_WIDTH: usize = 64; ++pub const INTPTR_WIDTH: usize = 32; ++pub const UINTPTR_WIDTH: usize = 32; ++pub const INTMAX_WIDTH: usize = 64; ++pub const UINTMAX_WIDTH: usize = 64; ++pub const PTRDIFF_WIDTH: usize = 32; ++pub const SIG_ATOMIC_WIDTH: usize = 32; ++pub const SIZE_WIDTH: usize = 32; ++pub const WCHAR_WIDTH: usize = 32; ++pub const WINT_WIDTH: usize = 32; ++ ++pub const TH_FIN: u8 = 1; ++pub const TH_SYN: u8 = 2; ++pub const TH_RST: u8 = 4; ++pub const TH_PUSH: u8 = 8; ++pub const TH_ACK: u8 = 16; ++pub const TH_URG: u8 = 32; ++pub const TCPOPT_EOL: u8 = 0; ++pub const TCPOPT_NOP: u8 = 1; ++pub const TCPOPT_MAXSEG: u8 = 2; ++pub const TCPOLEN_MAXSEG: u8 = 4; ++pub const TCPOPT_WINDOW: u8 = 3; ++pub const TCPOLEN_WINDOW: u8 = 3; ++pub const TCPOPT_SACK_PERMITTED: u8 = 4; ++pub const TCPOLEN_SACK_PERMITTED: u8 = 2; ++pub const TCPOPT_SACK: u8 = 5; ++pub const TCPOPT_TIMESTAMP: u8 = 8; ++pub const TCPOLEN_TIMESTAMP: u8 = 10; ++pub const TCPOLEN_TSTAMP_APPA: u8 = 12; ++pub const TCPOPT_TSTAMP_HDR: u32 = 16844810; ++pub const TCP_MSS: usize = 512; ++pub const TCP_MAXWIN: usize = 65535; ++pub const TCP_MAX_WINSHIFT: usize = 14; ++pub const TCPI_OPT_TIMESTAMPS: u8 = 1; ++pub const TCPI_OPT_SACK: u8 = 2; ++pub const TCPI_OPT_WSCALE: u8 = 4; ++pub const TCPI_OPT_ECN: u8 = 8; ++pub const TCPI_OPT_ECN_SEEN: u8 = 16; ++pub const TCPI_OPT_SYN_DATA: u8 = 32; ++pub const TCP_MD5SIG_MAXKEYLEN: usize = 80; ++pub const TCP_MD5SIG_FLAG_PREFIX: usize = 1; ++pub const TCP_COOKIE_MIN: usize = 8; ++pub const TCP_COOKIE_MAX: usize = 16; ++pub const TCP_COOKIE_PAIR_SIZE: usize = 32; ++pub const TCP_COOKIE_IN_ALWAYS: c_int = 1; ++pub const TCP_COOKIE_OUT_NEVER: c_int = 2; ++pub const TCP_S_DATA_IN: c_int = 4; ++pub const TCP_S_DATA_OUT: c_int = 8; ++pub const TCP_MSS_DEFAULT: usize = 536; ++pub const TCP_MSS_DESIRED: usize = 1220; ++ ++// sys/wait.h ++pub const WCOREFLAG: c_int = 128; ++pub const WAIT_ANY: pid_t = -1; ++pub const WAIT_MYPGRP: pid_t = 0; ++ ++// sys/file.h ++pub const LOCK_SH: c_int = 1; ++pub const LOCK_EX: c_int = 2; ++pub const LOCK_UN: c_int = 8; ++pub const LOCK_NB: c_int = 4; ++ ++// sys/mman.h ++pub const PROT_NONE: c_int = 0; ++pub const PROT_READ: c_int = 4; ++pub const PROT_WRITE: c_int = 2; ++pub const PROT_EXEC: c_int = 1; ++pub const MAP_FILE: c_int = 1; ++pub const MAP_ANON: c_int = 2; ++pub const MAP_ANONYMOUS: c_int = MAP_ANON; ++pub const MAP_TYPE: c_int = 15; ++pub const MAP_COPY: c_int = 32; ++pub const MAP_SHARED: c_int = 16; ++pub const MAP_PRIVATE: c_int = 0; ++pub const MAP_FIXED: c_int = 256; ++pub const MAP_NOEXTEND: c_int = 512; ++pub const MAP_HASSEMAPHORE: c_int = 1024; ++pub const MAP_INHERIT: c_int = 2048; ++pub const MAP_32BIT: c_int = 4096; ++pub const MAP_EXCL: c_int = 16384; ++pub const MAP_FAILED: *mut c_void = !0 as *mut c_void; ++pub const MADV_NORMAL: c_int = 0; ++pub const MADV_RANDOM: c_int = 1; ++pub const MADV_SEQUENTIAL: c_int = 2; ++pub const MADV_WILLNEED: c_int = 3; ++pub const MADV_DONTNEED: c_int = 4; ++pub const POSIX_MADV_NORMAL: c_int = 0; ++pub const POSIX_MADV_RANDOM: c_int = 1; ++pub const POSIX_MADV_SEQUENTIAL: c_int = 2; ++pub const POSIX_MADV_WILLNEED: c_int = 3; ++pub const POSIX_MADV_WONTNEED: c_int = 4; ++ ++pub const MS_ASYNC: c_int = 1; ++pub const MS_SYNC: c_int = 0; ++pub const MS_INVALIDATE: c_int = 2; ++pub const MREMAP_MAYMOVE: c_int = 1; ++pub const MREMAP_FIXED: c_int = 2; ++pub const MCL_CURRENT: c_int = 0x0001; ++pub const MCL_FUTURE: c_int = 0x0002; ++ ++// sys/xattr.h ++pub const XATTR_CREATE: c_int = 0x1; ++pub const XATTR_REPLACE: c_int = 0x2; ++ ++// spawn.h ++pub const POSIX_SPAWN_USEVFORK: c_int = 64; ++pub const POSIX_SPAWN_SETSID: c_int = 128; ++ ++// sys/syslog.h ++pub const LOG_CRON: c_int = 9 << 3; ++pub const LOG_AUTHPRIV: c_int = 10 << 3; ++pub const LOG_FTP: c_int = 11 << 3; ++pub const LOG_PERROR: c_int = 0x20; ++ ++// net/if.h ++pub const IFF_UP: c_int = 0x1; ++pub const IFF_BROADCAST: c_int = 0x2; ++pub const IFF_DEBUG: c_int = 0x4; ++pub const IFF_LOOPBACK: c_int = 0x8; ++pub const IFF_POINTOPOINT: c_int = 0x10; ++pub const IFF_NOTRAILERS: c_int = 0x20; ++pub const IFF_RUNNING: c_int = 0x40; ++pub const IFF_NOARP: c_int = 0x80; ++pub const IFF_PROMISC: c_int = 0x100; ++pub const IFF_ALLMULTI: c_int = 0x200; ++pub const IFF_MASTER: c_int = 0x400; ++pub const IFF_SLAVE: c_int = 0x800; ++pub const IFF_MULTICAST: c_int = 0x1000; ++pub const IFF_PORTSEL: c_int = 0x2000; ++pub const IFF_AUTOMEDIA: c_int = 0x4000; ++pub const IFF_DYNAMIC: c_int = 0x8000; ++ ++// random.h ++pub const GRND_NONBLOCK: c_uint = 1; ++pub const GRND_RANDOM: c_uint = 2; ++pub const GRND_INSECURE: c_uint = 4; ++ ++pub const _PC_LINK_MAX: c_int = 0; ++pub const _PC_MAX_CANON: c_int = 1; ++pub const _PC_MAX_INPUT: c_int = 2; ++pub const _PC_NAME_MAX: c_int = 3; ++pub const _PC_PATH_MAX: c_int = 4; ++pub const _PC_PIPE_BUF: c_int = 5; ++pub const _PC_CHOWN_RESTRICTED: c_int = 6; ++pub const _PC_NO_TRUNC: c_int = 7; ++pub const _PC_VDISABLE: c_int = 8; ++pub const _PC_SYNC_IO: c_int = 9; ++pub const _PC_ASYNC_IO: c_int = 10; ++pub const _PC_PRIO_IO: c_int = 11; ++pub const _PC_SOCK_MAXBUF: c_int = 12; ++pub const _PC_FILESIZEBITS: c_int = 13; ++pub const _PC_REC_INCR_XFER_SIZE: c_int = 14; ++pub const _PC_REC_MAX_XFER_SIZE: c_int = 15; ++pub const _PC_REC_MIN_XFER_SIZE: c_int = 16; ++pub const _PC_REC_XFER_ALIGN: c_int = 17; ++pub const _PC_ALLOC_SIZE_MIN: c_int = 18; ++pub const _PC_SYMLINK_MAX: c_int = 19; ++pub const _PC_2_SYMLINKS: c_int = 20; ++pub const _SC_ARG_MAX: c_int = 0; ++pub const _SC_CHILD_MAX: c_int = 1; ++pub const _SC_CLK_TCK: c_int = 2; ++pub const _SC_NGROUPS_MAX: c_int = 3; ++pub const _SC_OPEN_MAX: c_int = 4; ++pub const _SC_STREAM_MAX: c_int = 5; ++pub const _SC_TZNAME_MAX: c_int = 6; ++pub const _SC_JOB_CONTROL: c_int = 7; ++pub const _SC_SAVED_IDS: c_int = 8; ++pub const _SC_REALTIME_SIGNALS: c_int = 9; ++pub const _SC_PRIORITY_SCHEDULING: c_int = 10; ++pub const _SC_TIMERS: c_int = 11; ++pub const _SC_ASYNCHRONOUS_IO: c_int = 12; ++pub const _SC_PRIORITIZED_IO: c_int = 13; ++pub const _SC_SYNCHRONIZED_IO: c_int = 14; ++pub const _SC_FSYNC: c_int = 15; ++pub const _SC_MAPPED_FILES: c_int = 16; ++pub const _SC_MEMLOCK: c_int = 17; ++pub const _SC_MEMLOCK_RANGE: c_int = 18; ++pub const _SC_MEMORY_PROTECTION: c_int = 19; ++pub const _SC_MESSAGE_PASSING: c_int = 20; ++pub const _SC_SEMAPHORES: c_int = 21; ++pub const _SC_SHARED_MEMORY_OBJECTS: c_int = 22; ++pub const _SC_AIO_LISTIO_MAX: c_int = 23; ++pub const _SC_AIO_MAX: c_int = 24; ++pub const _SC_AIO_PRIO_DELTA_MAX: c_int = 25; ++pub const _SC_DELAYTIMER_MAX: c_int = 26; ++pub const _SC_MQ_OPEN_MAX: c_int = 27; ++pub const _SC_MQ_PRIO_MAX: c_int = 28; ++pub const _SC_VERSION: c_int = 29; ++pub const _SC_PAGESIZE: c_int = 30; ++pub const _SC_PAGE_SIZE: c_int = 30; ++pub const _SC_RTSIG_MAX: c_int = 31; ++pub const _SC_SEM_NSEMS_MAX: c_int = 32; ++pub const _SC_SEM_VALUE_MAX: c_int = 33; ++pub const _SC_SIGQUEUE_MAX: c_int = 34; ++pub const _SC_TIMER_MAX: c_int = 35; ++pub const _SC_BC_BASE_MAX: c_int = 36; ++pub const _SC_BC_DIM_MAX: c_int = 37; ++pub const _SC_BC_SCALE_MAX: c_int = 38; ++pub const _SC_BC_STRING_MAX: c_int = 39; ++pub const _SC_COLL_WEIGHTS_MAX: c_int = 40; ++pub const _SC_EQUIV_CLASS_MAX: c_int = 41; ++pub const _SC_EXPR_NEST_MAX: c_int = 42; ++pub const _SC_LINE_MAX: c_int = 43; ++pub const _SC_RE_DUP_MAX: c_int = 44; ++pub const _SC_CHARCLASS_NAME_MAX: c_int = 45; ++pub const _SC_2_VERSION: c_int = 46; ++pub const _SC_2_C_BIND: c_int = 47; ++pub const _SC_2_C_DEV: c_int = 48; ++pub const _SC_2_FORT_DEV: c_int = 49; ++pub const _SC_2_FORT_RUN: c_int = 50; ++pub const _SC_2_SW_DEV: c_int = 51; ++pub const _SC_2_LOCALEDEF: c_int = 52; ++pub const _SC_PII: c_int = 53; ++pub const _SC_PII_XTI: c_int = 54; ++pub const _SC_PII_SOCKET: c_int = 55; ++pub const _SC_PII_INTERNET: c_int = 56; ++pub const _SC_PII_OSI: c_int = 57; ++pub const _SC_POLL: c_int = 58; ++pub const _SC_SELECT: c_int = 59; ++pub const _SC_UIO_MAXIOV: c_int = 60; ++pub const _SC_IOV_MAX: c_int = 60; ++pub const _SC_PII_INTERNET_STREAM: c_int = 61; ++pub const _SC_PII_INTERNET_DGRAM: c_int = 62; ++pub const _SC_PII_OSI_COTS: c_int = 63; ++pub const _SC_PII_OSI_CLTS: c_int = 64; ++pub const _SC_PII_OSI_M: c_int = 65; ++pub const _SC_T_IOV_MAX: c_int = 66; ++pub const _SC_THREADS: c_int = 67; ++pub const _SC_THREAD_SAFE_FUNCTIONS: c_int = 68; ++pub const _SC_GETGR_R_SIZE_MAX: c_int = 69; ++pub const _SC_GETPW_R_SIZE_MAX: c_int = 70; ++pub const _SC_LOGIN_NAME_MAX: c_int = 71; ++pub const _SC_TTY_NAME_MAX: c_int = 72; ++pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: c_int = 73; ++pub const _SC_THREAD_KEYS_MAX: c_int = 74; ++pub const _SC_THREAD_STACK_MIN: c_int = 75; ++pub const _SC_THREAD_THREADS_MAX: c_int = 76; ++pub const _SC_THREAD_ATTR_STACKADDR: c_int = 77; ++pub const _SC_THREAD_ATTR_STACKSIZE: c_int = 78; ++pub const _SC_THREAD_PRIORITY_SCHEDULING: c_int = 79; ++pub const _SC_THREAD_PRIO_INHERIT: c_int = 80; ++pub const _SC_THREAD_PRIO_PROTECT: c_int = 81; ++pub const _SC_THREAD_PROCESS_SHARED: c_int = 82; ++pub const _SC_NPROCESSORS_CONF: c_int = 83; ++pub const _SC_NPROCESSORS_ONLN: c_int = 84; ++pub const _SC_PHYS_PAGES: c_int = 85; ++pub const _SC_AVPHYS_PAGES: c_int = 86; ++pub const _SC_ATEXIT_MAX: c_int = 87; ++pub const _SC_PASS_MAX: c_int = 88; ++pub const _SC_XOPEN_VERSION: c_int = 89; ++pub const _SC_XOPEN_XCU_VERSION: c_int = 90; ++pub const _SC_XOPEN_UNIX: c_int = 91; ++pub const _SC_XOPEN_CRYPT: c_int = 92; ++pub const _SC_XOPEN_ENH_I18N: c_int = 93; ++pub const _SC_XOPEN_SHM: c_int = 94; ++pub const _SC_2_CHAR_TERM: c_int = 95; ++pub const _SC_2_C_VERSION: c_int = 96; ++pub const _SC_2_UPE: c_int = 97; ++pub const _SC_XOPEN_XPG2: c_int = 98; ++pub const _SC_XOPEN_XPG3: c_int = 99; ++pub const _SC_XOPEN_XPG4: c_int = 100; ++pub const _SC_CHAR_BIT: c_int = 101; ++pub const _SC_CHAR_MAX: c_int = 102; ++pub const _SC_CHAR_MIN: c_int = 103; ++pub const _SC_INT_MAX: c_int = 104; ++pub const _SC_INT_MIN: c_int = 105; ++pub const _SC_LONG_BIT: c_int = 106; ++pub const _SC_WORD_BIT: c_int = 107; ++pub const _SC_MB_LEN_MAX: c_int = 108; ++pub const _SC_NZERO: c_int = 109; ++pub const _SC_SSIZE_MAX: c_int = 110; ++pub const _SC_SCHAR_MAX: c_int = 111; ++pub const _SC_SCHAR_MIN: c_int = 112; ++pub const _SC_SHRT_MAX: c_int = 113; ++pub const _SC_SHRT_MIN: c_int = 114; ++pub const _SC_UCHAR_MAX: c_int = 115; ++pub const _SC_UINT_MAX: c_int = 116; ++pub const _SC_ULONG_MAX: c_int = 117; ++pub const _SC_USHRT_MAX: c_int = 118; ++pub const _SC_NL_ARGMAX: c_int = 119; ++pub const _SC_NL_LANGMAX: c_int = 120; ++pub const _SC_NL_MSGMAX: c_int = 121; ++pub const _SC_NL_NMAX: c_int = 122; ++pub const _SC_NL_SETMAX: c_int = 123; ++pub const _SC_NL_TEXTMAX: c_int = 124; ++pub const _SC_XBS5_ILP32_OFF32: c_int = 125; ++pub const _SC_XBS5_ILP32_OFFBIG: c_int = 126; ++pub const _SC_XBS5_LP64_OFF64: c_int = 127; ++pub const _SC_XBS5_LPBIG_OFFBIG: c_int = 128; ++pub const _SC_XOPEN_LEGACY: c_int = 129; ++pub const _SC_XOPEN_REALTIME: c_int = 130; ++pub const _SC_XOPEN_REALTIME_THREADS: c_int = 131; ++pub const _SC_ADVISORY_INFO: c_int = 132; ++pub const _SC_BARRIERS: c_int = 133; ++pub const _SC_BASE: c_int = 134; ++pub const _SC_C_LANG_SUPPORT: c_int = 135; ++pub const _SC_C_LANG_SUPPORT_R: c_int = 136; ++pub const _SC_CLOCK_SELECTION: c_int = 137; ++pub const _SC_CPUTIME: c_int = 138; ++pub const _SC_THREAD_CPUTIME: c_int = 139; ++pub const _SC_DEVICE_IO: c_int = 140; ++pub const _SC_DEVICE_SPECIFIC: c_int = 141; ++pub const _SC_DEVICE_SPECIFIC_R: c_int = 142; ++pub const _SC_FD_MGMT: c_int = 143; ++pub const _SC_FIFO: c_int = 144; ++pub const _SC_PIPE: c_int = 145; ++pub const _SC_FILE_ATTRIBUTES: c_int = 146; ++pub const _SC_FILE_LOCKING: c_int = 147; ++pub const _SC_FILE_SYSTEM: c_int = 148; ++pub const _SC_MONOTONIC_CLOCK: c_int = 149; ++pub const _SC_MULTI_PROCESS: c_int = 150; ++pub const _SC_SINGLE_PROCESS: c_int = 151; ++pub const _SC_NETWORKING: c_int = 152; ++pub const _SC_READER_WRITER_LOCKS: c_int = 153; ++pub const _SC_SPIN_LOCKS: c_int = 154; ++pub const _SC_REGEXP: c_int = 155; ++pub const _SC_REGEX_VERSION: c_int = 156; ++pub const _SC_SHELL: c_int = 157; ++pub const _SC_SIGNALS: c_int = 158; ++pub const _SC_SPAWN: c_int = 159; ++pub const _SC_SPORADIC_SERVER: c_int = 160; ++pub const _SC_THREAD_SPORADIC_SERVER: c_int = 161; ++pub const _SC_SYSTEM_DATABASE: c_int = 162; ++pub const _SC_SYSTEM_DATABASE_R: c_int = 163; ++pub const _SC_TIMEOUTS: c_int = 164; ++pub const _SC_TYPED_MEMORY_OBJECTS: c_int = 165; ++pub const _SC_USER_GROUPS: c_int = 166; ++pub const _SC_USER_GROUPS_R: c_int = 167; ++pub const _SC_2_PBS: c_int = 168; ++pub const _SC_2_PBS_ACCOUNTING: c_int = 169; ++pub const _SC_2_PBS_LOCATE: c_int = 170; ++pub const _SC_2_PBS_MESSAGE: c_int = 171; ++pub const _SC_2_PBS_TRACK: c_int = 172; ++pub const _SC_SYMLOOP_MAX: c_int = 173; ++pub const _SC_STREAMS: c_int = 174; ++pub const _SC_2_PBS_CHECKPOINT: c_int = 175; ++pub const _SC_V6_ILP32_OFF32: c_int = 176; ++pub const _SC_V6_ILP32_OFFBIG: c_int = 177; ++pub const _SC_V6_LP64_OFF64: c_int = 178; ++pub const _SC_V6_LPBIG_OFFBIG: c_int = 179; ++pub const _SC_HOST_NAME_MAX: c_int = 180; ++pub const _SC_TRACE: c_int = 181; ++pub const _SC_TRACE_EVENT_FILTER: c_int = 182; ++pub const _SC_TRACE_INHERIT: c_int = 183; ++pub const _SC_TRACE_LOG: c_int = 184; ++pub const _SC_LEVEL1_ICACHE_SIZE: c_int = 185; ++pub const _SC_LEVEL1_ICACHE_ASSOC: c_int = 186; ++pub const _SC_LEVEL1_ICACHE_LINESIZE: c_int = 187; ++pub const _SC_LEVEL1_DCACHE_SIZE: c_int = 188; ++pub const _SC_LEVEL1_DCACHE_ASSOC: c_int = 189; ++pub const _SC_LEVEL1_DCACHE_LINESIZE: c_int = 190; ++pub const _SC_LEVEL2_CACHE_SIZE: c_int = 191; ++pub const _SC_LEVEL2_CACHE_ASSOC: c_int = 192; ++pub const _SC_LEVEL2_CACHE_LINESIZE: c_int = 193; ++pub const _SC_LEVEL3_CACHE_SIZE: c_int = 194; ++pub const _SC_LEVEL3_CACHE_ASSOC: c_int = 195; ++pub const _SC_LEVEL3_CACHE_LINESIZE: c_int = 196; ++pub const _SC_LEVEL4_CACHE_SIZE: c_int = 197; ++pub const _SC_LEVEL4_CACHE_ASSOC: c_int = 198; ++pub const _SC_LEVEL4_CACHE_LINESIZE: c_int = 199; ++pub const _SC_IPV6: c_int = 235; ++pub const _SC_RAW_SOCKETS: c_int = 236; ++pub const _SC_V7_ILP32_OFF32: c_int = 237; ++pub const _SC_V7_ILP32_OFFBIG: c_int = 238; ++pub const _SC_V7_LP64_OFF64: c_int = 239; ++pub const _SC_V7_LPBIG_OFFBIG: c_int = 240; ++pub const _SC_SS_REPL_MAX: c_int = 241; ++pub const _SC_TRACE_EVENT_NAME_MAX: c_int = 242; ++pub const _SC_TRACE_NAME_MAX: c_int = 243; ++pub const _SC_TRACE_SYS_MAX: c_int = 244; ++pub const _SC_TRACE_USER_EVENT_MAX: c_int = 245; ++pub const _SC_XOPEN_STREAMS: c_int = 246; ++pub const _SC_THREAD_ROBUST_PRIO_INHERIT: c_int = 247; ++pub const _SC_THREAD_ROBUST_PRIO_PROTECT: c_int = 248; ++pub const _SC_MINSIGSTKSZ: c_int = 249; ++pub const _SC_SIGSTKSZ: c_int = 250; ++ ++pub const _CS_PATH: c_int = 0; ++pub const _CS_V6_WIDTH_RESTRICTED_ENVS: c_int = 1; ++pub const _CS_GNU_LIBC_VERSION: c_int = 2; ++pub const _CS_GNU_LIBPTHREAD_VERSION: c_int = 3; ++pub const _CS_V5_WIDTH_RESTRICTED_ENVS: c_int = 4; ++pub const _CS_V7_WIDTH_RESTRICTED_ENVS: c_int = 5; ++pub const _CS_LFS_CFLAGS: c_int = 1000; ++pub const _CS_LFS_LDFLAGS: c_int = 1001; ++pub const _CS_LFS_LIBS: c_int = 1002; ++pub const _CS_LFS_LINTFLAGS: c_int = 1003; ++pub const _CS_LFS64_CFLAGS: c_int = 1004; ++pub const _CS_LFS64_LDFLAGS: c_int = 1005; ++pub const _CS_LFS64_LIBS: c_int = 1006; ++pub const _CS_LFS64_LINTFLAGS: c_int = 1007; ++pub const _CS_XBS5_ILP32_OFF32_CFLAGS: c_int = 1100; ++pub const _CS_XBS5_ILP32_OFF32_LDFLAGS: c_int = 1101; ++pub const _CS_XBS5_ILP32_OFF32_LIBS: c_int = 1102; ++pub const _CS_XBS5_ILP32_OFF32_LINTFLAGS: c_int = 1103; ++pub const _CS_XBS5_ILP32_OFFBIG_CFLAGS: c_int = 1104; ++pub const _CS_XBS5_ILP32_OFFBIG_LDFLAGS: c_int = 1105; ++pub const _CS_XBS5_ILP32_OFFBIG_LIBS: c_int = 1106; ++pub const _CS_XBS5_ILP32_OFFBIG_LINTFLAGS: c_int = 1107; ++pub const _CS_XBS5_LP64_OFF64_CFLAGS: c_int = 1108; ++pub const _CS_XBS5_LP64_OFF64_LDFLAGS: c_int = 1109; ++pub const _CS_XBS5_LP64_OFF64_LIBS: c_int = 1110; ++pub const _CS_XBS5_LP64_OFF64_LINTFLAGS: c_int = 1111; ++pub const _CS_XBS5_LPBIG_OFFBIG_CFLAGS: c_int = 1112; ++pub const _CS_XBS5_LPBIG_OFFBIG_LDFLAGS: c_int = 1113; ++pub const _CS_XBS5_LPBIG_OFFBIG_LIBS: c_int = 1114; ++pub const _CS_XBS5_LPBIG_OFFBIG_LINTFLAGS: c_int = 1115; ++pub const _CS_POSIX_V6_ILP32_OFF32_CFLAGS: c_int = 1116; ++pub const _CS_POSIX_V6_ILP32_OFF32_LDFLAGS: c_int = 1117; ++pub const _CS_POSIX_V6_ILP32_OFF32_LIBS: c_int = 1118; ++pub const _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS: c_int = 1119; ++pub const _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS: c_int = 1120; ++pub const _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS: c_int = 1121; ++pub const _CS_POSIX_V6_ILP32_OFFBIG_LIBS: c_int = 1122; ++pub const _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS: c_int = 1123; ++pub const _CS_POSIX_V6_LP64_OFF64_CFLAGS: c_int = 1124; ++pub const _CS_POSIX_V6_LP64_OFF64_LDFLAGS: c_int = 1125; ++pub const _CS_POSIX_V6_LP64_OFF64_LIBS: c_int = 1126; ++pub const _CS_POSIX_V6_LP64_OFF64_LINTFLAGS: c_int = 1127; ++pub const _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS: c_int = 1128; ++pub const _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS: c_int = 1129; ++pub const _CS_POSIX_V6_LPBIG_OFFBIG_LIBS: c_int = 1130; ++pub const _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS: c_int = 1131; ++pub const _CS_POSIX_V7_ILP32_OFF32_CFLAGS: c_int = 1132; ++pub const _CS_POSIX_V7_ILP32_OFF32_LDFLAGS: c_int = 1133; ++pub const _CS_POSIX_V7_ILP32_OFF32_LIBS: c_int = 1134; ++pub const _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS: c_int = 1135; ++pub const _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS: c_int = 1136; ++pub const _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS: c_int = 1137; ++pub const _CS_POSIX_V7_ILP32_OFFBIG_LIBS: c_int = 1138; ++pub const _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS: c_int = 1139; ++pub const _CS_POSIX_V7_LP64_OFF64_CFLAGS: c_int = 1140; ++pub const _CS_POSIX_V7_LP64_OFF64_LDFLAGS: c_int = 1141; ++pub const _CS_POSIX_V7_LP64_OFF64_LIBS: c_int = 1142; ++pub const _CS_POSIX_V7_LP64_OFF64_LINTFLAGS: c_int = 1143; ++pub const _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS: c_int = 1144; ++pub const _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS: c_int = 1145; ++pub const _CS_POSIX_V7_LPBIG_OFFBIG_LIBS: c_int = 1146; ++pub const _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS: c_int = 1147; ++pub const _CS_V6_ENV: c_int = 1148; ++pub const _CS_V7_ENV: c_int = 1149; ++ ++pub const PTHREAD_PROCESS_PRIVATE: __pthread_process_shared = 0; ++pub const PTHREAD_PROCESS_SHARED: __pthread_process_shared = 1; ++ ++pub const PTHREAD_EXPLICIT_SCHED: __pthread_inheritsched = 0; ++pub const PTHREAD_INHERIT_SCHED: __pthread_inheritsched = 1; ++ ++pub const PTHREAD_SCOPE_SYSTEM: __pthread_contentionscope = 0; ++pub const PTHREAD_SCOPE_PROCESS: __pthread_contentionscope = 1; ++ ++pub const PTHREAD_CREATE_JOINABLE: __pthread_detachstate = 0; ++pub const PTHREAD_CREATE_DETACHED: __pthread_detachstate = 1; ++ ++pub const PTHREAD_PRIO_NONE: __pthread_mutex_protocol = 0; ++pub const PTHREAD_PRIO_INHERIT: __pthread_mutex_protocol = 1; ++pub const PTHREAD_PRIO_PROTECT: __pthread_mutex_protocol = 2; ++ ++pub const PTHREAD_MUTEX_TIMED: __pthread_mutex_type = 0; ++pub const PTHREAD_MUTEX_ERRORCHECK: __pthread_mutex_type = 1; ++pub const PTHREAD_MUTEX_RECURSIVE: __pthread_mutex_type = 2; ++ ++pub const PTHREAD_MUTEX_STALLED: __pthread_mutex_robustness = 0; ++pub const PTHREAD_MUTEX_ROBUST: __pthread_mutex_robustness = 256; ++ ++pub const RLIMIT_CPU: crate::__rlimit_resource_t = 0; ++pub const RLIMIT_FSIZE: crate::__rlimit_resource_t = 1; ++pub const RLIMIT_DATA: crate::__rlimit_resource_t = 2; ++pub const RLIMIT_STACK: crate::__rlimit_resource_t = 3; ++pub const RLIMIT_CORE: crate::__rlimit_resource_t = 4; ++pub const RLIMIT_RSS: crate::__rlimit_resource_t = 5; ++pub const RLIMIT_MEMLOCK: crate::__rlimit_resource_t = 6; ++pub const RLIMIT_NPROC: crate::__rlimit_resource_t = 7; ++pub const RLIMIT_OFILE: crate::__rlimit_resource_t = 8; ++pub const RLIMIT_NOFILE: crate::__rlimit_resource_t = 8; ++pub const RLIMIT_SBSIZE: crate::__rlimit_resource_t = 9; ++pub const RLIMIT_AS: crate::__rlimit_resource_t = 10; ++pub const RLIMIT_VMEM: crate::__rlimit_resource_t = 10; ++pub const RLIMIT_NLIMITS: crate::__rlimit_resource_t = 11; ++pub const RLIM_NLIMITS: crate::__rlimit_resource_t = 11; ++ ++pub const RUSAGE_SELF: __rusage_who = 0; ++pub const RUSAGE_CHILDREN: __rusage_who = -1; ++ ++pub const PRIO_PROCESS: __priority_which = 0; ++pub const PRIO_PGRP: __priority_which = 1; ++pub const PRIO_USER: __priority_which = 2; ++ ++pub const __UT_LINESIZE: usize = 32; ++pub const __UT_NAMESIZE: usize = 32; ++pub const __UT_HOSTSIZE: usize = 256; ++ ++pub const SOCK_STREAM: c_int = 1; ++pub const SOCK_DGRAM: c_int = 2; ++pub const SOCK_RAW: c_int = 3; ++pub const SOCK_RDM: c_int = 4; ++pub const SOCK_SEQPACKET: c_int = 5; ++pub const SOCK_CLOEXEC: c_int = 4194304; ++pub const SOCK_NONBLOCK: c_int = 2048; ++ ++pub const MSG_OOB: c_int = 1; ++pub const MSG_PEEK: c_int = 2; ++pub const MSG_DONTROUTE: c_int = 4; ++pub const MSG_EOR: c_int = 8; ++pub const MSG_TRUNC: c_int = 16; ++pub const MSG_CTRUNC: c_int = 32; ++pub const MSG_WAITALL: c_int = 64; ++pub const MSG_DONTWAIT: c_int = 128; ++pub const MSG_NOSIGNAL: c_int = 1024; ++pub const MSG_CMSG_CLOEXEC: c_int = 0x40000000; ++ ++pub const SCM_RIGHTS: c_int = 1; ++pub const SCM_TIMESTAMP: c_int = 2; ++pub const SCM_CREDS: c_int = 3; ++ ++pub const SO_DEBUG: c_int = 1; ++pub const SO_ACCEPTCONN: c_int = 2; ++pub const SO_REUSEADDR: c_int = 4; ++pub const SO_KEEPALIVE: c_int = 8; ++pub const SO_DONTROUTE: c_int = 16; ++pub const SO_BROADCAST: c_int = 32; ++pub const SO_USELOOPBACK: c_int = 64; ++pub const SO_LINGER: c_int = 128; ++pub const SO_OOBINLINE: c_int = 256; ++pub const SO_REUSEPORT: c_int = 512; ++pub const SO_SNDBUF: c_int = 4097; ++pub const SO_RCVBUF: c_int = 4098; ++pub const SO_SNDLOWAT: c_int = 4099; ++pub const SO_RCVLOWAT: c_int = 4100; ++pub const SO_SNDTIMEO: c_int = 4101; ++pub const SO_RCVTIMEO: c_int = 4102; ++pub const SO_ERROR: c_int = 4103; ++pub const SO_STYLE: c_int = 4104; ++pub const SO_TYPE: c_int = 4104; ++ ++pub const IPPROTO_IP: c_int = 0; ++pub const IPPROTO_ICMP: c_int = 1; ++pub const IPPROTO_IGMP: c_int = 2; ++pub const IPPROTO_IPIP: c_int = 4; ++pub const IPPROTO_TCP: c_int = 6; ++pub const IPPROTO_EGP: c_int = 8; ++pub const IPPROTO_PUP: c_int = 12; ++pub const IPPROTO_UDP: c_int = 17; ++pub const IPPROTO_IDP: c_int = 22; ++pub const IPPROTO_TP: c_int = 29; ++pub const IPPROTO_DCCP: c_int = 33; ++pub const IPPROTO_IPV6: c_int = 41; ++pub const IPPROTO_RSVP: c_int = 46; ++pub const IPPROTO_GRE: c_int = 47; ++pub const IPPROTO_ESP: c_int = 50; ++pub const IPPROTO_AH: c_int = 51; ++pub const IPPROTO_MTP: c_int = 92; ++pub const IPPROTO_BEETPH: c_int = 94; ++pub const IPPROTO_ENCAP: c_int = 98; ++pub const IPPROTO_PIM: c_int = 103; ++pub const IPPROTO_COMP: c_int = 108; ++pub const IPPROTO_L2TP: c_int = 115; ++pub const IPPROTO_SCTP: c_int = 132; ++pub const IPPROTO_UDPLITE: c_int = 136; ++pub const IPPROTO_MPLS: c_int = 137; ++pub const IPPROTO_ETHERNET: c_int = 143; ++pub const IPPROTO_RAW: c_int = 255; ++pub const IPPROTO_MPTCP: c_int = 262; ++pub const IPPROTO_MAX: c_int = 263; ++ ++pub const IPPROTO_HOPOPTS: c_int = 0; ++pub const IPPROTO_ROUTING: c_int = 43; ++pub const IPPROTO_FRAGMENT: c_int = 44; ++pub const IPPROTO_ICMPV6: c_int = 58; ++pub const IPPROTO_NONE: c_int = 59; ++pub const IPPROTO_DSTOPTS: c_int = 60; ++pub const IPPROTO_MH: c_int = 135; ++ ++pub const IPPORT_ECHO: in_port_t = 7; ++pub const IPPORT_DISCARD: in_port_t = 9; ++pub const IPPORT_SYSTAT: in_port_t = 11; ++pub const IPPORT_DAYTIME: in_port_t = 13; ++pub const IPPORT_NETSTAT: in_port_t = 15; ++pub const IPPORT_FTP: in_port_t = 21; ++pub const IPPORT_TELNET: in_port_t = 23; ++pub const IPPORT_SMTP: in_port_t = 25; ++pub const IPPORT_TIMESERVER: in_port_t = 37; ++pub const IPPORT_NAMESERVER: in_port_t = 42; ++pub const IPPORT_WHOIS: in_port_t = 43; ++pub const IPPORT_MTP: in_port_t = 57; ++pub const IPPORT_TFTP: in_port_t = 69; ++pub const IPPORT_RJE: in_port_t = 77; ++pub const IPPORT_FINGER: in_port_t = 79; ++pub const IPPORT_TTYLINK: in_port_t = 87; ++pub const IPPORT_SUPDUP: in_port_t = 95; ++pub const IPPORT_EXECSERVER: in_port_t = 512; ++pub const IPPORT_LOGINSERVER: in_port_t = 513; ++pub const IPPORT_CMDSERVER: in_port_t = 514; ++pub const IPPORT_EFSSERVER: in_port_t = 520; ++pub const IPPORT_BIFFUDP: in_port_t = 512; ++pub const IPPORT_WHOSERVER: in_port_t = 513; ++pub const IPPORT_ROUTESERVER: in_port_t = 520; ++pub const IPPORT_USERRESERVED: in_port_t = 5000; ++ ++pub const DT_UNKNOWN: c_uchar = 0; ++pub const DT_FIFO: c_uchar = 1; ++pub const DT_CHR: c_uchar = 2; ++pub const DT_DIR: c_uchar = 4; ++pub const DT_BLK: c_uchar = 6; ++pub const DT_REG: c_uchar = 8; ++pub const DT_LNK: c_uchar = 10; ++pub const DT_SOCK: c_uchar = 12; ++pub const DT_WHT: c_uchar = 14; ++ ++pub const ST_RDONLY: c_ulong = 1; ++pub const ST_NOSUID: c_ulong = 2; ++pub const ST_NOEXEC: c_ulong = 8; ++pub const ST_SYNCHRONOUS: c_ulong = 16; ++pub const ST_NOATIME: c_ulong = 32; ++pub const ST_RELATIME: c_ulong = 64; ++ ++pub const RTLD_DI_LMID: c_int = 1; ++pub const RTLD_DI_LINKMAP: c_int = 2; ++pub const RTLD_DI_CONFIGADDR: c_int = 3; ++pub const RTLD_DI_SERINFO: c_int = 4; ++pub const RTLD_DI_SERINFOSIZE: c_int = 5; ++pub const RTLD_DI_ORIGIN: c_int = 6; ++pub const RTLD_DI_PROFILENAME: c_int = 7; ++pub const RTLD_DI_PROFILEOUT: c_int = 8; ++pub const RTLD_DI_TLS_MODID: c_int = 9; ++pub const RTLD_DI_TLS_DATA: c_int = 10; ++pub const RTLD_DI_PHDR: c_int = 11; ++pub const RTLD_DI_MAX: c_int = 11; ++ ++pub const SI_ASYNCIO: c_int = -4; ++pub const SI_MESGQ: c_int = -3; ++pub const SI_TIMER: c_int = -2; ++pub const SI_QUEUE: c_int = -1; ++pub const SI_USER: c_int = 0; ++ ++pub const ILL_ILLOPC: c_int = 1; ++pub const ILL_ILLOPN: c_int = 2; ++pub const ILL_ILLADR: c_int = 3; ++pub const ILL_ILLTRP: c_int = 4; ++pub const ILL_PRVOPC: c_int = 5; ++pub const ILL_PRVREG: c_int = 6; ++pub const ILL_COPROC: c_int = 7; ++pub const ILL_BADSTK: c_int = 8; ++ ++pub const FPE_INTDIV: c_int = 1; ++pub const FPE_INTOVF: c_int = 2; ++pub const FPE_FLTDIV: c_int = 3; ++pub const FPE_FLTOVF: c_int = 4; ++pub const FPE_FLTUND: c_int = 5; ++pub const FPE_FLTRES: c_int = 6; ++pub const FPE_FLTINV: c_int = 7; ++pub const FPE_FLTSUB: c_int = 8; ++ ++pub const SEGV_MAPERR: c_int = 1; ++pub const SEGV_ACCERR: c_int = 2; ++ ++pub const BUS_ADRALN: c_int = 1; ++pub const BUS_ADRERR: c_int = 2; ++pub const BUS_OBJERR: c_int = 3; ++ ++pub const TRAP_BRKPT: c_int = 1; ++pub const TRAP_TRACE: c_int = 2; ++ ++pub const CLD_EXITED: c_int = 1; ++pub const CLD_KILLED: c_int = 2; ++pub const CLD_DUMPED: c_int = 3; ++pub const CLD_TRAPPED: c_int = 4; ++pub const CLD_STOPPED: c_int = 5; ++pub const CLD_CONTINUED: c_int = 6; ++ ++pub const POLL_IN: c_int = 1; ++pub const POLL_OUT: c_int = 2; ++pub const POLL_MSG: c_int = 3; ++pub const POLL_ERR: c_int = 4; ++pub const POLL_PRI: c_int = 5; ++pub const POLL_HUP: c_int = 6; ++ ++pub const SIGEV_SIGNAL: c_int = 0; ++pub const SIGEV_NONE: c_int = 1; ++pub const SIGEV_THREAD: c_int = 2; ++ ++pub const REG_GS: c_uint = 0; ++pub const REG_FS: c_uint = 1; ++pub const REG_ES: c_uint = 2; ++pub const REG_DS: c_uint = 3; ++pub const REG_EDI: c_uint = 4; ++pub const REG_ESI: c_uint = 5; ++pub const REG_EBP: c_uint = 6; ++pub const REG_ESP: c_uint = 7; ++pub const REG_EBX: c_uint = 8; ++pub const REG_EDX: c_uint = 9; ++pub const REG_ECX: c_uint = 10; ++pub const REG_EAX: c_uint = 11; ++pub const REG_TRAPNO: c_uint = 12; ++pub const REG_ERR: c_uint = 13; ++pub const REG_EIP: c_uint = 14; ++pub const REG_CS: c_uint = 15; ++pub const REG_EFL: c_uint = 16; ++pub const REG_UESP: c_uint = 17; ++pub const REG_SS: c_uint = 18; ++ ++pub const IOC_VOID: __ioctl_dir = 0; ++pub const IOC_OUT: __ioctl_dir = 1; ++pub const IOC_IN: __ioctl_dir = 2; ++pub const IOC_INOUT: __ioctl_dir = 3; ++ ++pub const IOC_8: __ioctl_datum = 0; ++pub const IOC_16: __ioctl_datum = 1; ++pub const IOC_32: __ioctl_datum = 2; ++pub const IOC_64: __ioctl_datum = 3; ++ ++pub const TCP_ESTABLISHED: c_uint = 1; ++pub const TCP_SYN_SENT: c_uint = 2; ++pub const TCP_SYN_RECV: c_uint = 3; ++pub const TCP_FIN_WAIT1: c_uint = 4; ++pub const TCP_FIN_WAIT2: c_uint = 5; ++pub const TCP_TIME_WAIT: c_uint = 6; ++pub const TCP_CLOSE: c_uint = 7; ++pub const TCP_CLOSE_WAIT: c_uint = 8; ++pub const TCP_LAST_ACK: c_uint = 9; ++pub const TCP_LISTEN: c_uint = 10; ++pub const TCP_CLOSING: c_uint = 11; ++ ++pub const TCP_CA_Open: tcp_ca_state = 0; ++pub const TCP_CA_Disorder: tcp_ca_state = 1; ++pub const TCP_CA_CWR: tcp_ca_state = 2; ++pub const TCP_CA_Recovery: tcp_ca_state = 3; ++pub const TCP_CA_Loss: tcp_ca_state = 4; ++ ++pub const TCP_NO_QUEUE: c_uint = 0; ++pub const TCP_RECV_QUEUE: c_uint = 1; ++pub const TCP_SEND_QUEUE: c_uint = 2; ++pub const TCP_QUEUES_NR: c_uint = 3; ++ ++pub const P_ALL: idtype_t = 0; ++pub const P_PID: idtype_t = 1; ++pub const P_PGID: idtype_t = 2; ++ ++pub const SS_ONSTACK: c_int = 1; ++pub const SS_DISABLE: c_int = 4; ++ ++pub const SHUT_RD: c_int = 0; ++pub const SHUT_WR: c_int = 1; ++pub const SHUT_RDWR: c_int = 2; ++pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { ++ __lock: 0, ++ __owner_id: 0, ++ __cnt: 0, ++ __shpid: 0, ++ __type: PTHREAD_MUTEX_TIMED as c_int, ++ __flags: 0, ++ __reserved1: 0, ++ __reserved2: 0, ++}; ++pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { ++ __lock: __PTHREAD_SPIN_LOCK_INITIALIZER, ++ __queue: 0i64 as *mut __pthread, ++ __attr: 0i64 as *mut __pthread_condattr, ++ __wrefs: 0, ++ __data: 0i64 as *mut c_void, ++}; ++pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { ++ __held: __PTHREAD_SPIN_LOCK_INITIALIZER, ++ __lock: __PTHREAD_SPIN_LOCK_INITIALIZER, ++ __readers: 0, ++ __readerqueue: 0i64 as *mut __pthread, ++ __writerqueue: 0i64 as *mut __pthread, ++ __attr: 0i64 as *mut __pthread_rwlockattr, ++ __data: 0i64 as *mut c_void, ++}; ++pub const PTHREAD_STACK_MIN: size_t = 0; ++ ++// Non-public helper constants ++const _UTSNAME_LENGTH: usize = 1024; ++ ++const_fn! { ++ {const} fn CMSG_ALIGN(len: usize) -> usize { ++ len + mem::size_of::() - 1 & !(mem::size_of::() - 1) ++ } ++} ++ ++// functions ++f! { ++ pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr { ++ if (*mhdr).msg_controllen as usize >= mem::size_of::() { ++ (*mhdr).msg_control as *mut cmsghdr ++ } else { ++ 0 as *mut cmsghdr ++ } ++ } ++ ++ pub fn CMSG_DATA(cmsg: *const cmsghdr) -> *mut c_uchar { ++ cmsg.offset(1) as *mut c_uchar ++ } ++ ++ pub {const} fn CMSG_SPACE(length: c_uint) -> c_uint { ++ (CMSG_ALIGN(length as usize) + CMSG_ALIGN(mem::size_of::())) as c_uint ++ } ++ ++ pub {const} fn CMSG_LEN(length: c_uint) -> c_uint { ++ CMSG_ALIGN(mem::size_of::()) as c_uint + length ++ } ++ ++ pub fn CMSG_NXTHDR(mhdr: *const msghdr, cmsg: *const cmsghdr) -> *mut cmsghdr { ++ if ((*cmsg).cmsg_len as usize) < mem::size_of::() { ++ return 0 as *mut cmsghdr; ++ }; ++ let next = (cmsg as usize + CMSG_ALIGN((*cmsg).cmsg_len as usize)) as *mut cmsghdr; ++ let max = (*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize; ++ if (next.offset(1)) as usize > max ++ || next as usize + CMSG_ALIGN((*next).cmsg_len as usize) > max ++ { ++ 0 as *mut cmsghdr ++ } else { ++ next as *mut cmsghdr ++ } ++ } ++ ++ pub fn CPU_ALLOC_SIZE(count: c_int) -> size_t { ++ let _dummy: cpu_set_t = mem::zeroed(); ++ let size_in_bits = 8 * mem::size_of_val(&_dummy.bits[0]); ++ ((count as size_t + size_in_bits - 1) / 8) as size_t ++ } ++ ++ pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () { ++ for slot in cpuset.bits.iter_mut() { ++ *slot = 0; ++ } ++ } ++ ++ pub fn CPU_SET(cpu: usize, cpuset: &mut cpu_set_t) -> () { ++ let size_in_bits = 8 * mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc ++ let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits); ++ cpuset.bits[idx] |= 1 << offset; ++ () ++ } ++ ++ pub fn CPU_CLR(cpu: usize, cpuset: &mut cpu_set_t) -> () { ++ let size_in_bits = 8 * mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc ++ let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits); ++ cpuset.bits[idx] &= !(1 << offset); ++ () ++ } ++ ++ pub fn CPU_ISSET(cpu: usize, cpuset: &cpu_set_t) -> bool { ++ let size_in_bits = 8 * mem::size_of_val(&cpuset.bits[0]); ++ let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits); ++ 0 != (cpuset.bits[idx] & (1 << offset)) ++ } ++ ++ pub fn CPU_COUNT_S(size: usize, cpuset: &cpu_set_t) -> c_int { ++ let mut s: u32 = 0; ++ let size_of_mask = mem::size_of_val(&cpuset.bits[0]); ++ for i in cpuset.bits[..(size / size_of_mask)].iter() { ++ s += i.count_ones(); ++ } ++ s as c_int ++ } ++ ++ pub fn CPU_COUNT(cpuset: &cpu_set_t) -> c_int { ++ CPU_COUNT_S(mem::size_of::(), cpuset) ++ } ++ ++ pub fn CPU_EQUAL(set1: &cpu_set_t, set2: &cpu_set_t) -> bool { ++ set1.bits == set2.bits ++ } ++ ++ pub fn major(dev: crate::dev_t) -> c_uint { ++ ((dev >> 8) & 0xff) as c_uint ++ } ++ ++ pub fn minor(dev: crate::dev_t) -> c_uint { ++ (dev & 0xffff00ff) as c_uint ++ } ++ ++ pub fn IPTOS_TOS(tos: u8) -> u8 { ++ tos & IPTOS_TOS_MASK ++ } ++ ++ pub fn IPTOS_PREC(tos: u8) -> u8 { ++ tos & IPTOS_PREC_MASK ++ } ++ ++ pub fn FD_CLR(fd: c_int, set: *mut fd_set) -> () { ++ let fd = fd as usize; ++ let size = mem::size_of_val(&(*set).fds_bits[0]) * 8; ++ (*set).fds_bits[fd / size] &= !(1 << (fd % size)); ++ return; ++ } ++ ++ pub fn FD_ISSET(fd: c_int, set: *const fd_set) -> bool { ++ let fd = fd as usize; ++ let size = mem::size_of_val(&(*set).fds_bits[0]) * 8; ++ return ((*set).fds_bits[fd / size] & (1 << (fd % size))) != 0; ++ } ++ ++ pub fn FD_SET(fd: c_int, set: *mut fd_set) -> () { ++ let fd = fd as usize; ++ let size = mem::size_of_val(&(*set).fds_bits[0]) * 8; ++ (*set).fds_bits[fd / size] |= 1 << (fd % size); ++ return; ++ } ++ ++ pub fn FD_ZERO(set: *mut fd_set) -> () { ++ for slot in (*set).fds_bits.iter_mut() { ++ *slot = 0; ++ } ++ } ++} ++ ++extern "C" { ++ pub fn lutimes(file: *const c_char, times: *const crate::timeval) -> c_int; ++ ++ pub fn futimes(fd: c_int, times: *const crate::timeval) -> c_int; ++ pub fn futimens(__fd: c_int, __times: *const crate::timespec) -> c_int; ++ ++ pub fn utimensat( ++ dirfd: c_int, ++ path: *const c_char, ++ times: *const crate::timespec, ++ flag: c_int, ++ ) -> c_int; ++ ++ pub fn mkfifoat(__fd: c_int, __path: *const c_char, __mode: __mode_t) -> c_int; ++ ++ pub fn mknodat(dirfd: c_int, pathname: *const c_char, mode: crate::mode_t, dev: dev_t) ++ -> c_int; ++ ++ pub fn __libc_current_sigrtmin() -> c_int; ++ ++ pub fn __libc_current_sigrtmax() -> c_int; ++ ++ pub fn wait4( ++ pid: crate::pid_t, ++ status: *mut c_int, ++ options: c_int, ++ rusage: *mut crate::rusage, ++ ) -> crate::pid_t; ++ ++ pub fn waitid( ++ idtype: idtype_t, ++ id: id_t, ++ infop: *mut crate::siginfo_t, ++ options: c_int, ++ ) -> c_int; ++ ++ pub fn sigwait(__set: *const sigset_t, __sig: *mut c_int) -> c_int; ++ ++ pub fn sigsuspend(mask: *const crate::sigset_t) -> c_int; ++ pub fn sigtimedwait( ++ set: *const sigset_t, ++ info: *mut siginfo_t, ++ timeout: *const crate::timespec, ++ ) -> c_int; ++ pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> c_int; ++ ++ pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> c_int; ++ ++ pub fn ioctl(__fd: c_int, __request: c_ulong, ...) -> c_int; ++ ++ pub fn pipe2(fds: *mut c_int, flags: c_int) -> c_int; ++ ++ pub fn dup3(oldfd: c_int, newfd: c_int, flags: c_int) -> c_int; ++ ++ pub fn pread64(fd: c_int, buf: *mut c_void, count: size_t, offset: off64_t) -> ssize_t; ++ pub fn pwrite64(fd: c_int, buf: *const c_void, count: size_t, offset: off64_t) -> ssize_t; ++ ++ pub fn readv(__fd: c_int, __iovec: *const crate::iovec, __count: c_int) -> ssize_t; ++ pub fn writev(__fd: c_int, __iovec: *const crate::iovec, __count: c_int) -> ssize_t; ++ ++ pub fn preadv( ++ __fd: c_int, ++ __iovec: *const crate::iovec, ++ __count: c_int, ++ __offset: __off_t, ++ ) -> ssize_t; ++ pub fn pwritev( ++ __fd: c_int, ++ __iovec: *const crate::iovec, ++ __count: c_int, ++ __offset: __off_t, ++ ) -> ssize_t; ++ ++ pub fn preadv64(fd: c_int, iov: *const crate::iovec, iovcnt: c_int, offset: off64_t) ++ -> ssize_t; ++ pub fn pwritev64( ++ fd: c_int, ++ iov: *const crate::iovec, ++ iovcnt: c_int, ++ offset: off64_t, ++ ) -> ssize_t; ++ ++ pub fn fread_unlocked( ++ buf: *mut c_void, ++ size: size_t, ++ nobj: size_t, ++ stream: *mut crate::FILE, ++ ) -> size_t; ++ ++ pub fn aio_read(aiocbp: *mut aiocb) -> c_int; ++ pub fn aio_write(aiocbp: *mut aiocb) -> c_int; ++ pub fn aio_fsync(op: c_int, aiocbp: *mut aiocb) -> c_int; ++ pub fn aio_error(aiocbp: *const aiocb) -> c_int; ++ pub fn aio_return(aiocbp: *mut aiocb) -> ssize_t; ++ pub fn aio_suspend( ++ aiocb_list: *const *const aiocb, ++ nitems: c_int, ++ timeout: *const crate::timespec, ++ ) -> c_int; ++ pub fn aio_cancel(fd: c_int, aiocbp: *mut aiocb) -> c_int; ++ pub fn lio_listio( ++ mode: c_int, ++ aiocb_list: *const *mut aiocb, ++ nitems: c_int, ++ sevp: *mut crate::sigevent, ++ ) -> c_int; ++ ++ pub fn mq_open(name: *const c_char, oflag: c_int, ...) -> crate::mqd_t; ++ pub fn mq_close(mqd: crate::mqd_t) -> c_int; ++ pub fn mq_unlink(name: *const c_char) -> c_int; ++ pub fn mq_receive( ++ mqd: crate::mqd_t, ++ msg_ptr: *mut c_char, ++ msg_len: size_t, ++ msg_prio: *mut c_uint, ++ ) -> ssize_t; ++ pub fn mq_timedreceive( ++ mqd: crate::mqd_t, ++ msg_ptr: *mut c_char, ++ msg_len: size_t, ++ msg_prio: *mut c_uint, ++ abs_timeout: *const crate::timespec, ++ ) -> ssize_t; ++ pub fn mq_send( ++ mqd: crate::mqd_t, ++ msg_ptr: *const c_char, ++ msg_len: size_t, ++ msg_prio: c_uint, ++ ) -> c_int; ++ pub fn mq_timedsend( ++ mqd: crate::mqd_t, ++ msg_ptr: *const c_char, ++ msg_len: size_t, ++ msg_prio: c_uint, ++ abs_timeout: *const crate::timespec, ++ ) -> c_int; ++ pub fn mq_getattr(mqd: crate::mqd_t, attr: *mut crate::mq_attr) -> c_int; ++ pub fn mq_setattr( ++ mqd: crate::mqd_t, ++ newattr: *const crate::mq_attr, ++ oldattr: *mut crate::mq_attr, ++ ) -> c_int; ++ ++ pub fn lseek64(__fd: c_int, __offset: __off64_t, __whence: c_int) -> __off64_t; ++ ++ pub fn lseek(__fd: c_int, __offset: __off_t, __whence: c_int) -> __off_t; ++ ++ pub fn fgetpos64(stream: *mut crate::FILE, ptr: *mut fpos64_t) -> c_int; ++ pub fn fseeko64(stream: *mut crate::FILE, offset: off64_t, whence: c_int) -> c_int; ++ pub fn fsetpos64(stream: *mut crate::FILE, ptr: *const fpos64_t) -> c_int; ++ pub fn ftello64(stream: *mut crate::FILE) -> off64_t; ++ ++ pub fn bind(__fd: c_int, __addr: *const sockaddr, __len: crate::socklen_t) -> c_int; ++ ++ pub fn accept4( ++ fd: c_int, ++ addr: *mut crate::sockaddr, ++ len: *mut crate::socklen_t, ++ flg: c_int, ++ ) -> c_int; ++ ++ pub fn ppoll( ++ fds: *mut crate::pollfd, ++ nfds: nfds_t, ++ timeout: *const crate::timespec, ++ sigmask: *const sigset_t, ++ ) -> c_int; ++ ++ pub fn recvmsg(__fd: c_int, __message: *mut msghdr, __flags: c_int) -> ssize_t; ++ ++ pub fn sendmsg(__fd: c_int, __message: *const msghdr, __flags: c_int) -> ssize_t; ++ ++ pub fn recvfrom( ++ socket: c_int, ++ buf: *mut c_void, ++ len: size_t, ++ flags: c_int, ++ addr: *mut crate::sockaddr, ++ addrlen: *mut crate::socklen_t, ++ ) -> ssize_t; ++ ++ pub fn sendfile(out_fd: c_int, in_fd: c_int, offset: *mut off_t, count: size_t) -> ssize_t; ++ pub fn sendfile64(out_fd: c_int, in_fd: c_int, offset: *mut off64_t, count: size_t) -> ssize_t; ++ ++ pub fn shutdown(__fd: c_int, __how: c_int) -> c_int; ++ ++ pub fn sethostname(name: *const c_char, len: size_t) -> c_int; ++ pub fn getdomainname(name: *mut c_char, len: size_t) -> c_int; ++ pub fn setdomainname(name: *const c_char, len: size_t) -> c_int; ++ pub fn if_nameindex() -> *mut if_nameindex; ++ pub fn if_freenameindex(ptr: *mut if_nameindex); ++ ++ pub fn getnameinfo( ++ sa: *const crate::sockaddr, ++ salen: crate::socklen_t, ++ host: *mut c_char, ++ hostlen: crate::socklen_t, ++ serv: *mut c_char, ++ servlen: crate::socklen_t, ++ flags: c_int, ++ ) -> c_int; ++ ++ pub fn getifaddrs(ifap: *mut *mut crate::ifaddrs) -> c_int; ++ pub fn freeifaddrs(ifa: *mut crate::ifaddrs); ++ ++ pub fn uname(buf: *mut crate::utsname) -> c_int; ++ ++ pub fn gethostid() -> c_long; ++ pub fn sethostid(hostid: c_long) -> c_int; ++ ++ pub fn setpwent(); ++ pub fn endpwent(); ++ pub fn getpwent() -> *mut passwd; ++ pub fn setgrent(); ++ pub fn endgrent(); ++ pub fn getgrent() -> *mut crate::group; ++ pub fn setspent(); ++ pub fn endspent(); ++ pub fn getspent() -> *mut spwd; ++ ++ pub fn getspnam(name: *const c_char) -> *mut spwd; ++ ++ pub fn getpwent_r( ++ pwd: *mut crate::passwd, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut crate::passwd, ++ ) -> c_int; ++ pub fn getgrent_r( ++ grp: *mut crate::group, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut crate::group, ++ ) -> c_int; ++ pub fn fgetpwent_r( ++ stream: *mut crate::FILE, ++ pwd: *mut crate::passwd, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut crate::passwd, ++ ) -> c_int; ++ pub fn fgetgrent_r( ++ stream: *mut crate::FILE, ++ grp: *mut crate::group, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut crate::group, ++ ) -> c_int; ++ ++ pub fn putpwent(p: *const crate::passwd, stream: *mut crate::FILE) -> c_int; ++ pub fn putgrent(grp: *const crate::group, stream: *mut crate::FILE) -> c_int; ++ ++ pub fn getpwnam_r( ++ name: *const c_char, ++ pwd: *mut passwd, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut passwd, ++ ) -> c_int; ++ ++ pub fn getpwuid_r( ++ uid: crate::uid_t, ++ pwd: *mut passwd, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut passwd, ++ ) -> c_int; ++ ++ pub fn fgetspent_r( ++ fp: *mut crate::FILE, ++ spbuf: *mut crate::spwd, ++ buf: *mut c_char, ++ buflen: size_t, ++ spbufp: *mut *mut crate::spwd, ++ ) -> c_int; ++ pub fn sgetspent_r( ++ s: *const c_char, ++ spbuf: *mut crate::spwd, ++ buf: *mut c_char, ++ buflen: size_t, ++ spbufp: *mut *mut crate::spwd, ++ ) -> c_int; ++ pub fn getspent_r( ++ spbuf: *mut crate::spwd, ++ buf: *mut c_char, ++ buflen: size_t, ++ spbufp: *mut *mut crate::spwd, ++ ) -> c_int; ++ ++ pub fn getspnam_r( ++ name: *const c_char, ++ spbuf: *mut spwd, ++ buf: *mut c_char, ++ buflen: size_t, ++ spbufp: *mut *mut spwd, ++ ) -> c_int; ++ ++ // mntent.h ++ pub fn getmntent_r( ++ stream: *mut crate::FILE, ++ mntbuf: *mut crate::mntent, ++ buf: *mut c_char, ++ buflen: c_int, ++ ) -> *mut crate::mntent; ++ ++ pub fn utmpname(file: *const c_char) -> c_int; ++ pub fn utmpxname(file: *const c_char) -> c_int; ++ pub fn getutxent() -> *mut utmpx; ++ pub fn getutxid(ut: *const utmpx) -> *mut utmpx; ++ pub fn getutxline(ut: *const utmpx) -> *mut utmpx; ++ pub fn pututxline(ut: *const utmpx) -> *mut utmpx; ++ pub fn setutxent(); ++ pub fn endutxent(); ++ ++ pub fn getresuid( ++ ruid: *mut crate::uid_t, ++ euid: *mut crate::uid_t, ++ suid: *mut crate::uid_t, ++ ) -> c_int; ++ pub fn getresgid( ++ rgid: *mut crate::gid_t, ++ egid: *mut crate::gid_t, ++ sgid: *mut crate::gid_t, ++ ) -> c_int; ++ pub fn setresuid(ruid: crate::uid_t, euid: crate::uid_t, suid: crate::uid_t) -> c_int; ++ pub fn setresgid(rgid: crate::gid_t, egid: crate::gid_t, sgid: crate::gid_t) -> c_int; ++ ++ pub fn initgroups(user: *const c_char, group: crate::gid_t) -> c_int; ++ ++ pub fn getgrgid(gid: crate::gid_t) -> *mut crate::group; ++ pub fn getgrgid_r( ++ gid: crate::gid_t, ++ grp: *mut crate::group, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut crate::group, ++ ) -> c_int; ++ ++ pub fn getgrnam(name: *const c_char) -> *mut crate::group; ++ pub fn getgrnam_r( ++ name: *const c_char, ++ grp: *mut crate::group, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut crate::group, ++ ) -> c_int; ++ ++ pub fn getgrouplist( ++ user: *const c_char, ++ group: crate::gid_t, ++ groups: *mut crate::gid_t, ++ ngroups: *mut c_int, ++ ) -> c_int; ++ ++ pub fn setgroups(ngroups: size_t, ptr: *const crate::gid_t) -> c_int; ++ ++ pub fn acct(filename: *const c_char) -> c_int; ++ ++ pub fn setmntent(filename: *const c_char, ty: *const c_char) -> *mut crate::FILE; ++ pub fn getmntent(stream: *mut crate::FILE) -> *mut crate::mntent; ++ pub fn addmntent(stream: *mut crate::FILE, mnt: *const crate::mntent) -> c_int; ++ pub fn endmntent(streamp: *mut crate::FILE) -> c_int; ++ pub fn hasmntopt(mnt: *const crate::mntent, opt: *const c_char) -> *mut c_char; ++ ++ pub fn pthread_create( ++ native: *mut crate::pthread_t, ++ attr: *const crate::pthread_attr_t, ++ f: extern "C" fn(*mut c_void) -> *mut c_void, ++ value: *mut c_void, ++ ) -> c_int; ++ pub fn pthread_kill(__threadid: crate::pthread_t, __signo: c_int) -> c_int; ++ pub fn pthread_cancel(thread: crate::pthread_t) -> c_int; ++ pub fn __pthread_equal(__t1: __pthread_t, __t2: __pthread_t) -> c_int; ++ ++ pub fn pthread_getattr_np(__thr: crate::pthread_t, __attr: *mut pthread_attr_t) -> c_int; ++ ++ pub fn pthread_attr_getguardsize( ++ __attr: *const pthread_attr_t, ++ __guardsize: *mut size_t, ++ ) -> c_int; ++ pub fn pthread_attr_setguardsize(attr: *mut crate::pthread_attr_t, guardsize: size_t) -> c_int; ++ ++ pub fn pthread_attr_getstack( ++ __attr: *const pthread_attr_t, ++ __stackaddr: *mut *mut c_void, ++ __stacksize: *mut size_t, ++ ) -> c_int; ++ ++ pub fn pthread_mutexattr_getpshared( ++ attr: *const pthread_mutexattr_t, ++ pshared: *mut c_int, ++ ) -> c_int; ++ pub fn pthread_mutexattr_setpshared(attr: *mut pthread_mutexattr_t, pshared: c_int) -> c_int; ++ ++ pub fn pthread_mutex_timedlock( ++ lock: *mut pthread_mutex_t, ++ abstime: *const crate::timespec, ++ ) -> c_int; ++ ++ pub fn pthread_rwlockattr_getpshared( ++ attr: *const pthread_rwlockattr_t, ++ val: *mut c_int, ++ ) -> c_int; ++ pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, val: c_int) -> c_int; ++ ++ pub fn pthread_condattr_getclock( ++ attr: *const pthread_condattr_t, ++ clock_id: *mut clockid_t, ++ ) -> c_int; ++ pub fn pthread_condattr_setclock( ++ __attr: *mut pthread_condattr_t, ++ __clock_id: __clockid_t, ++ ) -> c_int; ++ pub fn pthread_condattr_getpshared( ++ attr: *const pthread_condattr_t, ++ pshared: *mut c_int, ++ ) -> c_int; ++ pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t, pshared: c_int) -> c_int; ++ ++ pub fn pthread_once(control: *mut pthread_once_t, routine: extern "C" fn()) -> c_int; ++ ++ pub fn pthread_barrierattr_init(attr: *mut crate::pthread_barrierattr_t) -> c_int; ++ pub fn pthread_barrierattr_destroy(attr: *mut crate::pthread_barrierattr_t) -> c_int; ++ pub fn pthread_barrierattr_getpshared( ++ attr: *const crate::pthread_barrierattr_t, ++ shared: *mut c_int, ++ ) -> c_int; ++ pub fn pthread_barrierattr_setpshared( ++ attr: *mut crate::pthread_barrierattr_t, ++ shared: c_int, ++ ) -> c_int; ++ pub fn pthread_barrier_init( ++ barrier: *mut pthread_barrier_t, ++ attr: *const crate::pthread_barrierattr_t, ++ count: c_uint, ++ ) -> c_int; ++ pub fn pthread_barrier_destroy(barrier: *mut pthread_barrier_t) -> c_int; ++ pub fn pthread_barrier_wait(barrier: *mut pthread_barrier_t) -> c_int; ++ pub fn pthread_spin_init(lock: *mut crate::pthread_spinlock_t, pshared: c_int) -> c_int; ++ pub fn pthread_spin_destroy(lock: *mut crate::pthread_spinlock_t) -> c_int; ++ pub fn pthread_spin_lock(lock: *mut crate::pthread_spinlock_t) -> c_int; ++ pub fn pthread_spin_trylock(lock: *mut crate::pthread_spinlock_t) -> c_int; ++ pub fn pthread_spin_unlock(lock: *mut crate::pthread_spinlock_t) -> c_int; ++ pub fn pthread_atfork( ++ prepare: Option, ++ parent: Option, ++ child: Option, ++ ) -> c_int; ++ ++ pub fn pthread_sigmask( ++ __how: c_int, ++ __newmask: *const __sigset_t, ++ __oldmask: *mut __sigset_t, ++ ) -> c_int; ++ ++ pub fn sched_getparam(pid: crate::pid_t, param: *mut crate::sched_param) -> c_int; ++ pub fn sched_setparam(pid: crate::pid_t, param: *const crate::sched_param) -> c_int; ++ pub fn sched_getscheduler(pid: crate::pid_t) -> c_int; ++ pub fn sched_setscheduler( ++ pid: crate::pid_t, ++ policy: c_int, ++ param: *const crate::sched_param, ++ ) -> c_int; ++ pub fn pthread_getschedparam( ++ native: crate::pthread_t, ++ policy: *mut c_int, ++ param: *mut crate::sched_param, ++ ) -> c_int; ++ pub fn pthread_setschedparam( ++ native: crate::pthread_t, ++ policy: c_int, ++ param: *const crate::sched_param, ++ ) -> c_int; ++ ++ pub fn pthread_getcpuclockid(thread: crate::pthread_t, clk_id: *mut crate::clockid_t) -> c_int; ++ ++ pub fn sem_init(sem: *mut sem_t, pshared: c_int, value: c_uint) -> c_int; ++ pub fn sem_destroy(sem: *mut sem_t) -> c_int; ++ pub fn sem_timedwait(sem: *mut sem_t, abstime: *const crate::timespec) -> c_int; ++ pub fn sem_getvalue(sem: *mut sem_t, sval: *mut c_int) -> c_int; ++ ++ pub fn clock_getres(__clock_id: clockid_t, __res: *mut crate::timespec) -> c_int; ++ pub fn clock_gettime(__clock_id: clockid_t, __tp: *mut crate::timespec) -> c_int; ++ pub fn clock_settime(__clock_id: clockid_t, __tp: *const crate::timespec) -> c_int; ++ pub fn clock_getcpuclockid(pid: crate::pid_t, clk_id: *mut crate::clockid_t) -> c_int; ++ ++ pub fn clock_nanosleep( ++ clk_id: crate::clockid_t, ++ flags: c_int, ++ rqtp: *const crate::timespec, ++ rmtp: *mut crate::timespec, ++ ) -> c_int; ++ ++ pub fn gettimeofday(tp: *mut crate::timeval, tz: *mut crate::timezone) -> c_int; ++ pub fn settimeofday(tv: *const crate::timeval, tz: *const crate::timezone) -> c_int; ++ ++ pub fn asctime_r(tm: *const crate::tm, buf: *mut c_char) -> *mut c_char; ++ pub fn ctime_r(timep: *const time_t, buf: *mut c_char) -> *mut c_char; ++ ++ pub fn strftime( ++ s: *mut c_char, ++ max: size_t, ++ format: *const c_char, ++ tm: *const crate::tm, ++ ) -> size_t; ++ pub fn strptime(s: *const c_char, format: *const c_char, tm: *mut crate::tm) -> *mut c_char; ++ ++ pub fn timer_create( ++ clockid: crate::clockid_t, ++ sevp: *mut crate::sigevent, ++ timerid: *mut crate::timer_t, ++ ) -> c_int; ++ pub fn timer_delete(timerid: crate::timer_t) -> c_int; ++ pub fn timer_getoverrun(timerid: crate::timer_t) -> c_int; ++ pub fn timer_gettime(timerid: crate::timer_t, curr_value: *mut crate::itimerspec) -> c_int; ++ pub fn timer_settime( ++ timerid: crate::timer_t, ++ flags: c_int, ++ new_value: *const crate::itimerspec, ++ old_value: *mut crate::itimerspec, ++ ) -> c_int; ++ ++ pub fn fstat(__fd: c_int, __buf: *mut stat) -> c_int; ++ pub fn fstat64(__fd: c_int, __buf: *mut stat64) -> c_int; ++ ++ pub fn fstatat(__fd: c_int, __file: *const c_char, __buf: *mut stat, __flag: c_int) -> c_int; ++ pub fn fstatat64( ++ __fd: c_int, ++ __file: *const c_char, ++ __buf: *mut stat64, ++ __flag: c_int, ++ ) -> c_int; ++ ++ pub fn statx( ++ dirfd: c_int, ++ pathname: *const c_char, ++ flags: c_int, ++ mask: c_uint, ++ statxbuf: *mut statx, ++ ) -> c_int; ++ ++ pub fn ftruncate(__fd: c_int, __length: __off_t) -> c_int; ++ pub fn ftruncate64(__fd: c_int, __length: __off64_t) -> c_int; ++ pub fn truncate64(__file: *const c_char, __length: __off64_t) -> c_int; ++ ++ pub fn lstat(__file: *const c_char, __buf: *mut stat) -> c_int; ++ pub fn lstat64(__file: *const c_char, __buf: *mut stat64) -> c_int; ++ ++ pub fn statfs(path: *const c_char, buf: *mut statfs) -> c_int; ++ pub fn statfs64(__file: *const c_char, __buf: *mut statfs64) -> c_int; ++ pub fn fstatfs(fd: c_int, buf: *mut statfs) -> c_int; ++ pub fn fstatfs64(__fildes: c_int, __buf: *mut statfs64) -> c_int; ++ ++ pub fn statvfs(__file: *const c_char, __buf: *mut statvfs) -> c_int; ++ pub fn statvfs64(__file: *const c_char, __buf: *mut statvfs64) -> c_int; ++ pub fn fstatvfs(__fildes: c_int, __buf: *mut statvfs) -> c_int; ++ pub fn fstatvfs64(__fildes: c_int, __buf: *mut statvfs64) -> c_int; ++ ++ pub fn open(__file: *const c_char, __oflag: c_int, ...) -> c_int; ++ pub fn open64(__file: *const c_char, __oflag: c_int, ...) -> c_int; ++ ++ pub fn openat(__fd: c_int, __file: *const c_char, __oflag: c_int, ...) -> c_int; ++ pub fn openat64(__fd: c_int, __file: *const c_char, __oflag: c_int, ...) -> c_int; ++ ++ pub fn fopen64(filename: *const c_char, mode: *const c_char) -> *mut crate::FILE; ++ pub fn freopen64( ++ filename: *const c_char, ++ mode: *const c_char, ++ file: *mut crate::FILE, ++ ) -> *mut crate::FILE; ++ ++ pub fn creat64(path: *const c_char, mode: mode_t) -> c_int; ++ ++ pub fn mkostemp(template: *mut c_char, flags: c_int) -> c_int; ++ pub fn mkostemps(template: *mut c_char, suffixlen: c_int, flags: c_int) -> c_int; ++ pub fn mkstemps(template: *mut c_char, suffixlen: c_int) -> c_int; ++ pub fn tmpfile64() -> *mut crate::FILE; ++ ++ pub fn popen(command: *const c_char, mode: *const c_char) -> *mut crate::FILE; ++ ++ pub fn getdtablesize() -> c_int; ++ ++ // Added in `glibc` 2.34 ++ pub fn close_range(first: c_uint, last: c_uint, flags: c_int) -> c_int; ++ ++ pub fn openpty( ++ __amaster: *mut c_int, ++ __aslave: *mut c_int, ++ __name: *mut c_char, ++ __termp: *const termios, ++ __winp: *const crate::winsize, ++ ) -> c_int; ++ ++ pub fn forkpty( ++ __amaster: *mut c_int, ++ __name: *mut c_char, ++ __termp: *const termios, ++ __winp: *const crate::winsize, ++ ) -> crate::pid_t; ++ ++ pub fn getpt() -> c_int; ++ pub fn ptsname_r(fd: c_int, buf: *mut c_char, buflen: size_t) -> c_int; ++ pub fn login_tty(fd: c_int) -> c_int; ++ ++ pub fn ctermid(s: *mut c_char) -> *mut c_char; ++ ++ pub fn clearenv() -> c_int; ++ ++ pub fn execveat( ++ dirfd: c_int, ++ pathname: *const c_char, ++ argv: *const *mut c_char, ++ envp: *const *mut c_char, ++ flags: c_int, ++ ) -> c_int; ++ ++ // DIFF(main): changed to `*const *mut` in e77f551de9 ++ pub fn execvpe( ++ file: *const c_char, ++ argv: *const *const c_char, ++ envp: *const *const c_char, ++ ) -> c_int; ++ pub fn fexecve(fd: c_int, argv: *const *const c_char, envp: *const *const c_char) -> c_int; ++ ++ pub fn daemon(nochdir: c_int, noclose: c_int) -> c_int; ++ ++ // posix/spawn.h ++ pub fn posix_spawn( ++ pid: *mut crate::pid_t, ++ path: *const c_char, ++ file_actions: *const crate::posix_spawn_file_actions_t, ++ attrp: *const crate::posix_spawnattr_t, ++ argv: *const *mut c_char, ++ envp: *const *mut c_char, ++ ) -> c_int; ++ pub fn posix_spawnp( ++ pid: *mut crate::pid_t, ++ file: *const c_char, ++ file_actions: *const crate::posix_spawn_file_actions_t, ++ attrp: *const crate::posix_spawnattr_t, ++ argv: *const *mut c_char, ++ envp: *const *mut c_char, ++ ) -> 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_getsigdefault( ++ attr: *const posix_spawnattr_t, ++ default: *mut crate::sigset_t, ++ ) -> c_int; ++ pub fn posix_spawnattr_setsigdefault( ++ attr: *mut posix_spawnattr_t, ++ default: *const crate::sigset_t, ++ ) -> c_int; ++ pub fn posix_spawnattr_getsigmask( ++ attr: *const posix_spawnattr_t, ++ default: *mut crate::sigset_t, ++ ) -> c_int; ++ pub fn posix_spawnattr_setsigmask( ++ attr: *mut posix_spawnattr_t, ++ default: *const crate::sigset_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, ++ flags: *mut crate::pid_t, ++ ) -> c_int; ++ pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: crate::pid_t) -> c_int; ++ pub fn posix_spawnattr_getschedpolicy( ++ attr: *const posix_spawnattr_t, ++ flags: *mut c_int, ++ ) -> c_int; ++ pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: c_int) -> c_int; ++ pub fn posix_spawnattr_getschedparam( ++ attr: *const posix_spawnattr_t, ++ param: *mut crate::sched_param, ++ ) -> c_int; ++ pub fn posix_spawnattr_setschedparam( ++ attr: *mut posix_spawnattr_t, ++ param: *const crate::sched_param, ++ ) -> c_int; ++ ++ pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> c_int; ++ pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> c_int; ++ pub fn posix_spawn_file_actions_addopen( ++ actions: *mut posix_spawn_file_actions_t, ++ fd: c_int, ++ path: *const c_char, ++ oflag: c_int, ++ mode: crate::mode_t, ++ ) -> c_int; ++ pub fn posix_spawn_file_actions_addclose( ++ actions: *mut posix_spawn_file_actions_t, ++ fd: c_int, ++ ) -> c_int; ++ pub fn posix_spawn_file_actions_adddup2( ++ actions: *mut posix_spawn_file_actions_t, ++ fd: c_int, ++ newfd: c_int, ++ ) -> c_int; ++ ++ // Added in `glibc` 2.29 ++ pub fn posix_spawn_file_actions_addchdir_np( ++ actions: *mut crate::posix_spawn_file_actions_t, ++ path: *const c_char, ++ ) -> c_int; ++ // Added in `glibc` 2.29 ++ pub fn posix_spawn_file_actions_addfchdir_np( ++ actions: *mut crate::posix_spawn_file_actions_t, ++ fd: c_int, ++ ) -> c_int; ++ // Added in `glibc` 2.34 ++ pub fn posix_spawn_file_actions_addclosefrom_np( ++ actions: *mut crate::posix_spawn_file_actions_t, ++ from: c_int, ++ ) -> c_int; ++ // Added in `glibc` 2.35 ++ pub fn posix_spawn_file_actions_addtcsetpgrp_np( ++ actions: *mut crate::posix_spawn_file_actions_t, ++ tcfd: c_int, ++ ) -> c_int; ++ ++ pub fn shm_open(name: *const c_char, oflag: c_int, mode: mode_t) -> c_int; ++ pub fn shm_unlink(name: *const c_char) -> c_int; ++ ++ pub fn euidaccess(pathname: *const c_char, mode: c_int) -> c_int; ++ pub fn eaccess(pathname: *const c_char, mode: c_int) -> c_int; ++ ++ pub fn faccessat(dirfd: c_int, pathname: *const c_char, mode: c_int, flags: c_int) -> c_int; ++ ++ pub fn stat(__file: *const c_char, __buf: *mut stat) -> c_int; ++ pub fn stat64(__file: *const c_char, __buf: *mut stat64) -> c_int; ++ ++ pub fn readdir(dirp: *mut crate::DIR) -> *mut crate::dirent; ++ pub fn readdir64(dirp: *mut crate::DIR) -> *mut crate::dirent64; ++ pub fn readdir_r( ++ dirp: *mut crate::DIR, ++ entry: *mut crate::dirent, ++ result: *mut *mut crate::dirent, ++ ) -> c_int; ++ pub fn readdir64_r( ++ dirp: *mut crate::DIR, ++ entry: *mut crate::dirent64, ++ result: *mut *mut crate::dirent64, ++ ) -> c_int; ++ pub fn seekdir(dirp: *mut crate::DIR, loc: c_long); ++ pub fn telldir(dirp: *mut crate::DIR) -> c_long; ++ ++ pub fn dirfd(dirp: *mut crate::DIR) -> c_int; ++ ++ #[link_name = "__xpg_strerror_r"] ++ pub fn strerror_r(__errnum: c_int, __buf: *mut c_char, __buflen: size_t) -> c_int; ++ ++ pub fn __errno_location() -> *mut c_int; ++ ++ pub fn mmap64( ++ __addr: *mut c_void, ++ __len: size_t, ++ __prot: c_int, ++ __flags: c_int, ++ __fd: c_int, ++ __offset: __off64_t, ++ ) -> *mut c_void; ++ ++ pub fn mremap( ++ addr: *mut c_void, ++ len: size_t, ++ new_len: size_t, ++ flags: c_int, ++ ... ++ ) -> *mut c_void; ++ ++ pub fn mprotect(__addr: *mut c_void, __len: size_t, __prot: c_int) -> c_int; ++ ++ pub fn msync(__addr: *mut c_void, __len: size_t, __flags: c_int) -> c_int; ++ pub fn sync(); ++ pub fn syncfs(fd: c_int) -> c_int; ++ pub fn fdatasync(fd: c_int) -> c_int; ++ ++ pub fn fallocate64(fd: c_int, mode: c_int, offset: off64_t, len: off64_t) -> c_int; ++ pub fn posix_fallocate(fd: c_int, offset: off_t, len: off_t) -> c_int; ++ pub fn posix_fallocate64(fd: c_int, offset: off64_t, len: off64_t) -> c_int; ++ ++ pub fn posix_fadvise(fd: c_int, offset: off_t, len: off_t, advise: c_int) -> c_int; ++ ++ pub fn posix_fadvise64(fd: c_int, offset: off64_t, len: off64_t, advise: c_int) -> c_int; ++ ++ pub fn madvise(__addr: *mut c_void, __len: size_t, __advice: c_int) -> c_int; ++ ++ pub fn posix_madvise(addr: *mut c_void, len: size_t, advice: c_int) -> c_int; ++ ++ pub fn getrlimit(resource: crate::__rlimit_resource_t, rlim: *mut crate::rlimit) -> c_int; ++ pub fn getrlimit64(resource: crate::__rlimit_resource_t, rlim: *mut crate::rlimit64) -> c_int; ++ pub fn setrlimit(resource: crate::__rlimit_resource_t, rlim: *const crate::rlimit) -> c_int; ++ pub fn setrlimit64(resource: crate::__rlimit_resource_t, rlim: *const crate::rlimit64) ++ -> c_int; ++ ++ pub fn getpriority(which: crate::__priority_which, who: crate::id_t) -> c_int; ++ pub fn setpriority(which: crate::__priority_which, who: crate::id_t, prio: c_int) -> c_int; ++ ++ pub fn getrandom(__buffer: *mut c_void, __length: size_t, __flags: c_uint) -> ssize_t; ++ pub fn getentropy(__buffer: *mut c_void, __length: size_t) -> c_int; ++ ++ pub fn memrchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void; ++ pub fn memmem( ++ haystack: *const c_void, ++ haystacklen: size_t, ++ needle: *const c_void, ++ needlelen: size_t, ++ ) -> *mut c_void; ++ pub fn strchrnul(s: *const c_char, c: c_int) -> *mut c_char; ++ ++ pub fn abs(i: c_int) -> c_int; ++ pub fn labs(i: c_long) -> c_long; ++ pub fn rand() -> c_int; ++ pub fn srand(seed: c_uint); ++ ++ pub fn drand48() -> c_double; ++ pub fn erand48(xseed: *mut c_ushort) -> c_double; ++ pub fn lrand48() -> c_long; ++ pub fn nrand48(xseed: *mut c_ushort) -> c_long; ++ pub fn mrand48() -> c_long; ++ pub fn jrand48(xseed: *mut c_ushort) -> c_long; ++ pub fn srand48(seed: c_long); ++ pub fn seed48(xseed: *mut c_ushort) -> *mut c_ushort; ++ pub fn lcong48(p: *mut c_ushort); ++ ++ pub fn qsort_r( ++ base: *mut c_void, ++ num: size_t, ++ size: size_t, ++ compar: Option c_int>, ++ arg: *mut c_void, ++ ); ++ ++ pub fn brk(addr: *mut c_void) -> c_int; ++ pub fn sbrk(increment: intptr_t) -> *mut c_void; ++ ++ pub fn memalign(align: size_t, size: size_t) -> *mut c_void; ++ pub fn mallopt(param: c_int, value: c_int) -> c_int; ++ ++ pub fn mallinfo() -> crate::mallinfo; ++ pub fn mallinfo2() -> crate::mallinfo2; ++ pub fn malloc_info(options: c_int, stream: *mut crate::FILE) -> c_int; ++ pub fn malloc_usable_size(ptr: *mut c_void) -> size_t; ++ pub fn malloc_trim(__pad: size_t) -> c_int; ++ ++ pub fn iconv_open(tocode: *const c_char, fromcode: *const c_char) -> iconv_t; ++ pub fn iconv( ++ cd: iconv_t, ++ inbuf: *mut *mut c_char, ++ inbytesleft: *mut size_t, ++ outbuf: *mut *mut c_char, ++ outbytesleft: *mut size_t, ++ ) -> size_t; ++ pub fn iconv_close(cd: iconv_t) -> c_int; ++ ++ pub fn getopt_long( ++ argc: c_int, ++ argv: *const *mut c_char, ++ optstring: *const c_char, ++ longopts: *const option, ++ longindex: *mut c_int, ++ ) -> c_int; ++ ++ pub fn backtrace(buf: *mut *mut c_void, sz: c_int) -> c_int; ++ ++ pub fn reboot(how_to: c_int) -> c_int; ++ ++ pub fn getloadavg(loadavg: *mut c_double, nelem: c_int) -> c_int; ++ ++ pub fn regexec( ++ preg: *const crate::regex_t, ++ input: *const c_char, ++ nmatch: size_t, ++ pmatch: *mut regmatch_t, ++ eflags: c_int, ++ ) -> c_int; ++ ++ pub fn regerror( ++ errcode: c_int, ++ preg: *const crate::regex_t, ++ errbuf: *mut c_char, ++ errbuf_size: size_t, ++ ) -> size_t; ++ ++ pub fn regfree(preg: *mut crate::regex_t); ++ ++ pub fn glob( ++ pattern: *const c_char, ++ flags: c_int, ++ errfunc: Option c_int>, ++ pglob: *mut crate::glob_t, ++ ) -> c_int; ++ pub fn globfree(pglob: *mut crate::glob_t); ++ ++ pub fn glob64( ++ pattern: *const c_char, ++ flags: c_int, ++ errfunc: Option c_int>, ++ pglob: *mut glob64_t, ++ ) -> c_int; ++ pub fn globfree64(pglob: *mut glob64_t); ++ ++ pub fn getxattr( ++ path: *const c_char, ++ name: *const c_char, ++ value: *mut c_void, ++ size: size_t, ++ ) -> ssize_t; ++ pub fn lgetxattr( ++ path: *const c_char, ++ name: *const c_char, ++ value: *mut c_void, ++ size: size_t, ++ ) -> ssize_t; ++ pub fn fgetxattr( ++ filedes: c_int, ++ name: *const c_char, ++ value: *mut c_void, ++ size: size_t, ++ ) -> ssize_t; ++ pub fn setxattr( ++ path: *const c_char, ++ name: *const c_char, ++ value: *const c_void, ++ size: size_t, ++ flags: c_int, ++ ) -> c_int; ++ pub fn lsetxattr( ++ path: *const c_char, ++ name: *const c_char, ++ value: *const c_void, ++ size: size_t, ++ flags: c_int, ++ ) -> c_int; ++ pub fn fsetxattr( ++ filedes: c_int, ++ name: *const c_char, ++ value: *const c_void, ++ size: size_t, ++ flags: c_int, ++ ) -> c_int; ++ pub fn listxattr(path: *const c_char, list: *mut c_char, size: size_t) -> ssize_t; ++ pub fn llistxattr(path: *const c_char, list: *mut c_char, size: size_t) -> ssize_t; ++ pub fn flistxattr(filedes: c_int, list: *mut c_char, size: size_t) -> ssize_t; ++ pub fn removexattr(path: *const c_char, name: *const c_char) -> c_int; ++ pub fn lremovexattr(path: *const c_char, name: *const c_char) -> c_int; ++ pub fn fremovexattr(filedes: c_int, name: *const c_char) -> c_int; ++ ++ pub fn dirname(path: *mut c_char) -> *mut c_char; ++ /// POSIX version of `basename(3)`, defined in `libgen.h`. ++ #[link_name = "__xpg_basename"] ++ pub fn posix_basename(path: *mut c_char) -> *mut c_char; ++ /// GNU version of `basename(3)`, defined in `string.h`. ++ #[link_name = "basename"] ++ pub fn gnu_basename(path: *const c_char) -> *mut c_char; ++ ++ pub fn dlmopen(lmid: Lmid_t, filename: *const c_char, flag: c_int) -> *mut c_void; ++ pub fn dlinfo(handle: *mut c_void, request: c_int, info: *mut c_void) -> c_int; ++ pub fn dladdr1( ++ addr: *const c_void, ++ info: *mut crate::Dl_info, ++ extra_info: *mut *mut c_void, ++ flags: c_int, ++ ) -> c_int; ++ ++ pub fn duplocale(base: crate::locale_t) -> crate::locale_t; ++ pub fn freelocale(loc: crate::locale_t); ++ pub fn newlocale(mask: c_int, locale: *const c_char, base: crate::locale_t) -> crate::locale_t; ++ pub fn uselocale(loc: crate::locale_t) -> crate::locale_t; ++ pub fn nl_langinfo(item: crate::nl_item) -> *mut c_char; ++ pub fn nl_langinfo_l(item: crate::nl_item, locale: crate::locale_t) -> *mut c_char; ++ ++ pub fn dl_iterate_phdr( ++ callback: Option< ++ unsafe extern "C" fn( ++ info: *mut crate::dl_phdr_info, ++ size: size_t, ++ data: *mut c_void, ++ ) -> c_int, ++ >, ++ data: *mut c_void, ++ ) -> c_int; ++ ++ pub fn gnu_get_libc_release() -> *const c_char; ++ pub fn gnu_get_libc_version() -> *const c_char; ++} ++ ++safe_f! { ++ pub {const} fn makedev(major: c_uint, minor: c_uint) -> crate::dev_t { ++ let major = major as crate::dev_t; ++ let minor = minor as crate::dev_t; ++ let mut dev = 0; ++ dev |= major << 8; ++ dev |= minor; ++ dev ++ } ++ ++ pub fn SIGRTMAX() -> c_int { ++ unsafe { __libc_current_sigrtmax() } ++ } ++ ++ pub fn SIGRTMIN() -> c_int { ++ unsafe { __libc_current_sigrtmin() } ++ } ++ ++ pub {const} fn WIFSTOPPED(status: c_int) -> bool { ++ (status & 0xff) == 0x7f ++ } ++ ++ pub {const} fn WSTOPSIG(status: c_int) -> c_int { ++ (status >> 8) & 0xff ++ } ++ ++ pub {const} fn WIFCONTINUED(status: c_int) -> bool { ++ status == 0xffff ++ } ++ ++ pub {const} fn WIFSIGNALED(status: c_int) -> bool { ++ ((status & 0x7f) + 1) as i8 >= 2 ++ } ++ ++ pub {const} fn WTERMSIG(status: c_int) -> c_int { ++ status & 0x7f ++ } ++ ++ pub {const} fn WIFEXITED(status: c_int) -> bool { ++ (status & 0x7f) == 0 ++ } ++ ++ pub {const} fn WEXITSTATUS(status: c_int) -> c_int { ++ (status >> 8) & 0xff ++ } ++ ++ pub {const} fn WCOREDUMP(status: c_int) -> bool { ++ (status & 0x80) != 0 ++ } ++ ++ pub {const} fn W_EXITCODE(ret: c_int, sig: c_int) -> c_int { ++ (ret << 8) | sig ++ } ++ ++ pub {const} fn W_STOPCODE(sig: c_int) -> c_int { ++ (sig << 8) | 0x7f ++ } ++ ++ pub {const} fn QCMD(cmd: c_int, type_: c_int) -> c_int { ++ (cmd << 8) | (type_ & 0x00ff) ++ } ++ ++ pub {const} fn IPOPT_COPIED(o: u8) -> u8 { ++ o & IPOPT_COPY ++ } ++ ++ pub {const} fn IPOPT_CLASS(o: u8) -> u8 { ++ o & IPOPT_CLASS_MASK ++ } ++ ++ pub {const} fn IPOPT_NUMBER(o: u8) -> u8 { ++ o & IPOPT_NUMBER_MASK ++ } ++ ++ pub {const} fn IPTOS_ECN(x: u8) -> u8 { ++ x & crate::IPTOS_ECN_MASK ++ } ++} ++ ++cfg_if! { ++ if #[cfg(target_pointer_width = "64")] { ++ mod b64; ++ pub use self::b64::*; ++ } else { ++ mod b32; ++ pub use self::b32::*; ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/android/b32/arm.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/android/b32/arm.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/android/b32/arm.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/android/b32/arm.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,557 @@ ++use crate::prelude::*; ++ ++pub type c_char = u8; ++pub type wchar_t = u32; ++pub type greg_t = i32; ++pub type mcontext_t = sigcontext; ++ ++s! { ++ pub struct sigcontext { ++ pub trap_no: c_ulong, ++ pub error_code: c_ulong, ++ pub oldmask: c_ulong, ++ pub arm_r0: c_ulong, ++ pub arm_r1: c_ulong, ++ pub arm_r2: c_ulong, ++ pub arm_r3: c_ulong, ++ pub arm_r4: c_ulong, ++ pub arm_r5: c_ulong, ++ pub arm_r6: c_ulong, ++ pub arm_r7: c_ulong, ++ pub arm_r8: c_ulong, ++ pub arm_r9: c_ulong, ++ pub arm_r10: c_ulong, ++ pub arm_fp: c_ulong, ++ pub arm_ip: c_ulong, ++ pub arm_sp: c_ulong, ++ pub arm_lr: c_ulong, ++ pub arm_pc: c_ulong, ++ pub arm_cpsr: c_ulong, ++ pub fault_address: c_ulong, ++ } ++} ++ ++s_no_extra_traits! { ++ pub struct __c_anonymous_uc_sigmask_with_padding { ++ pub uc_sigmask: crate::sigset_t, ++ /* Android has a wrong (smaller) sigset_t on x86. */ ++ __padding_rt_sigset: u32, ++ } ++ ++ pub union __c_anonymous_uc_sigmask { ++ uc_sigmask: __c_anonymous_uc_sigmask_with_padding, ++ uc_sigmask64: crate::sigset64_t, ++ } ++ ++ pub struct ucontext_t { ++ pub uc_flags: c_ulong, ++ pub uc_link: *mut ucontext_t, ++ pub uc_stack: crate::stack_t, ++ pub uc_mcontext: mcontext_t, ++ pub uc_sigmask__c_anonymous_union: __c_anonymous_uc_sigmask, ++ /* The kernel adds extra padding after uc_sigmask to match ++ * glibc sigset_t on ARM. */ ++ __padding: [c_char; 120], ++ __align: [c_longlong; 0], ++ uc_regspace: [c_ulong; 128], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for __c_anonymous_uc_sigmask_with_padding { ++ fn eq(&self, other: &__c_anonymous_uc_sigmask_with_padding) -> bool { ++ self.uc_sigmask == other.uc_sigmask ++ // Ignore padding ++ } ++ } ++ impl Eq for __c_anonymous_uc_sigmask_with_padding {} ++ impl fmt::Debug for __c_anonymous_uc_sigmask_with_padding { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("uc_sigmask_with_padding") ++ .field("uc_sigmask_with_padding", &self.uc_sigmask) ++ // Ignore padding ++ .finish() ++ } ++ } ++ impl hash::Hash for __c_anonymous_uc_sigmask_with_padding { ++ fn hash(&self, state: &mut H) { ++ self.uc_sigmask.hash(state) ++ // Ignore padding ++ } ++ } ++ ++ impl PartialEq for __c_anonymous_uc_sigmask { ++ fn eq(&self, other: &__c_anonymous_uc_sigmask) -> bool { ++ unsafe { self.uc_sigmask == other.uc_sigmask } ++ } ++ } ++ impl Eq for __c_anonymous_uc_sigmask {} ++ impl hash::Hash for __c_anonymous_uc_sigmask { ++ fn hash(&self, state: &mut H) { ++ unsafe { self.uc_sigmask.hash(state) } ++ } ++ } ++ ++ impl PartialEq for ucontext_t { ++ fn eq(&self, other: &Self) -> bool { ++ self.uc_flags == other.uc_flags ++ && self.uc_link == other.uc_link ++ && self.uc_stack == other.uc_stack ++ && self.uc_mcontext == other.uc_mcontext ++ && self.uc_sigmask__c_anonymous_union == other.uc_sigmask__c_anonymous_union ++ && &self.uc_regspace[..] == &other.uc_regspace[..] ++ // Ignore padding field ++ } ++ } ++ impl Eq for ucontext_t {} ++ impl fmt::Debug for ucontext_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("ucontext_t") ++ .field("uc_flags", &self.uc_flags) ++ .field("uc_link", &self.uc_link) ++ .field("uc_stack", &self.uc_stack) ++ .field("uc_mcontext", &self.uc_mcontext) ++ .field( ++ "uc_sigmask__c_anonymous_union", ++ &self.uc_sigmask__c_anonymous_union, ++ ) ++ .field("uc_regspace", &&self.uc_regspace[..]) ++ // Ignore padding field ++ .finish() ++ } ++ } ++ impl hash::Hash for ucontext_t { ++ fn hash(&self, state: &mut H) { ++ self.uc_flags.hash(state); ++ self.uc_link.hash(state); ++ self.uc_stack.hash(state); ++ self.uc_mcontext.hash(state); ++ self.uc_sigmask__c_anonymous_union.hash(state); ++ self.uc_regspace[..].hash(state); ++ // Ignore padding field ++ } ++ } ++ } ++} ++ ++pub const O_DIRECT: c_int = 0x10000; ++pub const O_DIRECTORY: c_int = 0x4000; ++pub const O_NOFOLLOW: c_int = 0x8000; ++pub const O_LARGEFILE: c_int = 0o400000; ++ ++pub const SYS_restart_syscall: c_long = 0; ++pub const SYS_exit: c_long = 1; ++pub const SYS_fork: c_long = 2; ++pub const SYS_read: c_long = 3; ++pub const SYS_write: c_long = 4; ++pub const SYS_open: c_long = 5; ++pub const SYS_close: c_long = 6; ++pub const SYS_creat: c_long = 8; ++pub const SYS_link: c_long = 9; ++pub const SYS_unlink: c_long = 10; ++pub const SYS_execve: c_long = 11; ++pub const SYS_chdir: c_long = 12; ++pub const SYS_mknod: c_long = 14; ++pub const SYS_chmod: c_long = 15; ++pub const SYS_lchown: c_long = 16; ++pub const SYS_lseek: c_long = 19; ++pub const SYS_getpid: c_long = 20; ++pub const SYS_mount: c_long = 21; ++pub const SYS_setuid: c_long = 23; ++pub const SYS_getuid: c_long = 24; ++pub const SYS_ptrace: c_long = 26; ++pub const SYS_pause: c_long = 29; ++pub const SYS_access: c_long = 33; ++pub const SYS_nice: c_long = 34; ++pub const SYS_sync: c_long = 36; ++pub const SYS_kill: c_long = 37; ++pub const SYS_rename: c_long = 38; ++pub const SYS_mkdir: c_long = 39; ++pub const SYS_rmdir: c_long = 40; ++pub const SYS_dup: c_long = 41; ++pub const SYS_pipe: c_long = 42; ++pub const SYS_times: c_long = 43; ++pub const SYS_brk: c_long = 45; ++pub const SYS_setgid: c_long = 46; ++pub const SYS_getgid: c_long = 47; ++pub const SYS_geteuid: c_long = 49; ++pub const SYS_getegid: c_long = 50; ++pub const SYS_acct: c_long = 51; ++pub const SYS_umount2: c_long = 52; ++pub const SYS_ioctl: c_long = 54; ++pub const SYS_fcntl: c_long = 55; ++pub const SYS_setpgid: c_long = 57; ++pub const SYS_umask: c_long = 60; ++pub const SYS_chroot: c_long = 61; ++pub const SYS_ustat: c_long = 62; ++pub const SYS_dup2: c_long = 63; ++pub const SYS_getppid: c_long = 64; ++pub const SYS_getpgrp: c_long = 65; ++pub const SYS_setsid: c_long = 66; ++pub const SYS_sigaction: c_long = 67; ++pub const SYS_setreuid: c_long = 70; ++pub const SYS_setregid: c_long = 71; ++pub const SYS_sigsuspend: c_long = 72; ++pub const SYS_sigpending: c_long = 73; ++pub const SYS_sethostname: c_long = 74; ++pub const SYS_setrlimit: c_long = 75; ++pub const SYS_getrusage: c_long = 77; ++pub const SYS_gettimeofday: c_long = 78; ++pub const SYS_settimeofday: c_long = 79; ++pub const SYS_getgroups: c_long = 80; ++pub const SYS_setgroups: c_long = 81; ++pub const SYS_symlink: c_long = 83; ++pub const SYS_readlink: c_long = 85; ++pub const SYS_uselib: c_long = 86; ++pub const SYS_swapon: c_long = 87; ++pub const SYS_reboot: c_long = 88; ++pub const SYS_munmap: c_long = 91; ++pub const SYS_truncate: c_long = 92; ++pub const SYS_ftruncate: c_long = 93; ++pub const SYS_fchmod: c_long = 94; ++pub const SYS_fchown: c_long = 95; ++pub const SYS_getpriority: c_long = 96; ++pub const SYS_setpriority: c_long = 97; ++pub const SYS_statfs: c_long = 99; ++pub const SYS_fstatfs: c_long = 100; ++pub const SYS_syslog: c_long = 103; ++pub const SYS_setitimer: c_long = 104; ++pub const SYS_getitimer: c_long = 105; ++pub const SYS_stat: c_long = 106; ++pub const SYS_lstat: c_long = 107; ++pub const SYS_fstat: c_long = 108; ++pub const SYS_vhangup: c_long = 111; ++pub const SYS_wait4: c_long = 114; ++pub const SYS_swapoff: c_long = 115; ++pub const SYS_sysinfo: c_long = 116; ++pub const SYS_fsync: c_long = 118; ++pub const SYS_sigreturn: c_long = 119; ++pub const SYS_clone: c_long = 120; ++pub const SYS_setdomainname: c_long = 121; ++pub const SYS_uname: c_long = 122; ++pub const SYS_adjtimex: c_long = 124; ++pub const SYS_mprotect: c_long = 125; ++pub const SYS_sigprocmask: c_long = 126; ++pub const SYS_init_module: c_long = 128; ++pub const SYS_delete_module: c_long = 129; ++pub const SYS_quotactl: c_long = 131; ++pub const SYS_getpgid: c_long = 132; ++pub const SYS_fchdir: c_long = 133; ++pub const SYS_bdflush: c_long = 134; ++pub const SYS_sysfs: c_long = 135; ++pub const SYS_personality: c_long = 136; ++pub const SYS_setfsuid: c_long = 138; ++pub const SYS_setfsgid: c_long = 139; ++pub const SYS_getdents: c_long = 141; ++pub const SYS_flock: c_long = 143; ++pub const SYS_msync: c_long = 144; ++pub const SYS_readv: c_long = 145; ++pub const SYS_writev: c_long = 146; ++pub const SYS_getsid: c_long = 147; ++pub const SYS_fdatasync: c_long = 148; ++pub const SYS_mlock: c_long = 150; ++pub const SYS_munlock: c_long = 151; ++pub const SYS_mlockall: c_long = 152; ++pub const SYS_munlockall: c_long = 153; ++pub const SYS_sched_setparam: c_long = 154; ++pub const SYS_sched_getparam: c_long = 155; ++pub const SYS_sched_setscheduler: c_long = 156; ++pub const SYS_sched_getscheduler: c_long = 157; ++pub const SYS_sched_yield: c_long = 158; ++pub const SYS_sched_get_priority_max: c_long = 159; ++pub const SYS_sched_get_priority_min: c_long = 160; ++pub const SYS_sched_rr_get_interval: c_long = 161; ++pub const SYS_nanosleep: c_long = 162; ++pub const SYS_mremap: c_long = 163; ++pub const SYS_setresuid: c_long = 164; ++pub const SYS_getresuid: c_long = 165; ++pub const SYS_poll: c_long = 168; ++pub const SYS_nfsservctl: c_long = 169; ++pub const SYS_setresgid: c_long = 170; ++pub const SYS_getresgid: c_long = 171; ++pub const SYS_prctl: c_long = 172; ++pub const SYS_rt_sigreturn: c_long = 173; ++pub const SYS_rt_sigaction: c_long = 174; ++pub const SYS_rt_sigprocmask: c_long = 175; ++pub const SYS_rt_sigpending: c_long = 176; ++pub const SYS_rt_sigtimedwait: c_long = 177; ++pub const SYS_rt_sigqueueinfo: c_long = 178; ++pub const SYS_rt_sigsuspend: c_long = 179; ++pub const SYS_pread64: c_long = 180; ++pub const SYS_pwrite64: c_long = 181; ++pub const SYS_chown: c_long = 182; ++pub const SYS_getcwd: c_long = 183; ++pub const SYS_capget: c_long = 184; ++pub const SYS_capset: c_long = 185; ++pub const SYS_sigaltstack: c_long = 186; ++pub const SYS_sendfile: c_long = 187; ++pub const SYS_vfork: c_long = 190; ++pub const SYS_ugetrlimit: c_long = 191; ++pub const SYS_mmap2: c_long = 192; ++pub const SYS_truncate64: c_long = 193; ++pub const SYS_ftruncate64: c_long = 194; ++pub const SYS_stat64: c_long = 195; ++pub const SYS_lstat64: c_long = 196; ++pub const SYS_fstat64: c_long = 197; ++pub const SYS_lchown32: c_long = 198; ++pub const SYS_getuid32: c_long = 199; ++pub const SYS_getgid32: c_long = 200; ++pub const SYS_geteuid32: c_long = 201; ++pub const SYS_getegid32: c_long = 202; ++pub const SYS_setreuid32: c_long = 203; ++pub const SYS_setregid32: c_long = 204; ++pub const SYS_getgroups32: c_long = 205; ++pub const SYS_setgroups32: c_long = 206; ++pub const SYS_fchown32: c_long = 207; ++pub const SYS_setresuid32: c_long = 208; ++pub const SYS_getresuid32: c_long = 209; ++pub const SYS_setresgid32: c_long = 210; ++pub const SYS_getresgid32: c_long = 211; ++pub const SYS_chown32: c_long = 212; ++pub const SYS_setuid32: c_long = 213; ++pub const SYS_setgid32: c_long = 214; ++pub const SYS_setfsuid32: c_long = 215; ++pub const SYS_setfsgid32: c_long = 216; ++pub const SYS_getdents64: c_long = 217; ++pub const SYS_pivot_root: c_long = 218; ++pub const SYS_mincore: c_long = 219; ++pub const SYS_madvise: c_long = 220; ++pub const SYS_fcntl64: c_long = 221; ++pub const SYS_gettid: c_long = 224; ++pub const SYS_readahead: c_long = 225; ++pub const SYS_setxattr: c_long = 226; ++pub const SYS_lsetxattr: c_long = 227; ++pub const SYS_fsetxattr: c_long = 228; ++pub const SYS_getxattr: c_long = 229; ++pub const SYS_lgetxattr: c_long = 230; ++pub const SYS_fgetxattr: c_long = 231; ++pub const SYS_listxattr: c_long = 232; ++pub const SYS_llistxattr: c_long = 233; ++pub const SYS_flistxattr: c_long = 234; ++pub const SYS_removexattr: c_long = 235; ++pub const SYS_lremovexattr: c_long = 236; ++pub const SYS_fremovexattr: c_long = 237; ++pub const SYS_tkill: c_long = 238; ++pub const SYS_sendfile64: c_long = 239; ++pub const SYS_futex: c_long = 240; ++pub const SYS_sched_setaffinity: c_long = 241; ++pub const SYS_sched_getaffinity: c_long = 242; ++pub const SYS_io_setup: c_long = 243; ++pub const SYS_io_destroy: c_long = 244; ++pub const SYS_io_getevents: c_long = 245; ++pub const SYS_io_submit: c_long = 246; ++pub const SYS_io_cancel: c_long = 247; ++pub const SYS_exit_group: c_long = 248; ++pub const SYS_lookup_dcookie: c_long = 249; ++pub const SYS_epoll_create: c_long = 250; ++pub const SYS_epoll_ctl: c_long = 251; ++pub const SYS_epoll_wait: c_long = 252; ++pub const SYS_remap_file_pages: c_long = 253; ++pub const SYS_set_tid_address: c_long = 256; ++pub const SYS_timer_create: c_long = 257; ++pub const SYS_timer_settime: c_long = 258; ++pub const SYS_timer_gettime: c_long = 259; ++pub const SYS_timer_getoverrun: c_long = 260; ++pub const SYS_timer_delete: c_long = 261; ++pub const SYS_clock_settime: c_long = 262; ++pub const SYS_clock_gettime: c_long = 263; ++pub const SYS_clock_getres: c_long = 264; ++pub const SYS_clock_nanosleep: c_long = 265; ++pub const SYS_statfs64: c_long = 266; ++pub const SYS_fstatfs64: c_long = 267; ++pub const SYS_tgkill: c_long = 268; ++pub const SYS_utimes: c_long = 269; ++pub const SYS_arm_fadvise64_64: c_long = 270; ++pub const SYS_pciconfig_iobase: c_long = 271; ++pub const SYS_pciconfig_read: c_long = 272; ++pub const SYS_pciconfig_write: c_long = 273; ++pub const SYS_mq_open: c_long = 274; ++pub const SYS_mq_unlink: c_long = 275; ++pub const SYS_mq_timedsend: c_long = 276; ++pub const SYS_mq_timedreceive: c_long = 277; ++pub const SYS_mq_notify: c_long = 278; ++pub const SYS_mq_getsetattr: c_long = 279; ++pub const SYS_waitid: c_long = 280; ++pub const SYS_socket: c_long = 281; ++pub const SYS_bind: c_long = 282; ++pub const SYS_connect: c_long = 283; ++pub const SYS_listen: c_long = 284; ++pub const SYS_accept: c_long = 285; ++pub const SYS_getsockname: c_long = 286; ++pub const SYS_getpeername: c_long = 287; ++pub const SYS_socketpair: c_long = 288; ++pub const SYS_send: c_long = 289; ++pub const SYS_sendto: c_long = 290; ++pub const SYS_recv: c_long = 291; ++pub const SYS_recvfrom: c_long = 292; ++pub const SYS_shutdown: c_long = 293; ++pub const SYS_setsockopt: c_long = 294; ++pub const SYS_getsockopt: c_long = 295; ++pub const SYS_sendmsg: c_long = 296; ++pub const SYS_recvmsg: c_long = 297; ++pub const SYS_semop: c_long = 298; ++pub const SYS_semget: c_long = 299; ++pub const SYS_semctl: c_long = 300; ++pub const SYS_msgsnd: c_long = 301; ++pub const SYS_msgrcv: c_long = 302; ++pub const SYS_msgget: c_long = 303; ++pub const SYS_msgctl: c_long = 304; ++pub const SYS_shmat: c_long = 305; ++pub const SYS_shmdt: c_long = 306; ++pub const SYS_shmget: c_long = 307; ++pub const SYS_shmctl: c_long = 308; ++pub const SYS_add_key: c_long = 309; ++pub const SYS_request_key: c_long = 310; ++pub const SYS_keyctl: c_long = 311; ++pub const SYS_semtimedop: c_long = 312; ++pub const SYS_vserver: c_long = 313; ++pub const SYS_ioprio_set: c_long = 314; ++pub const SYS_ioprio_get: c_long = 315; ++pub const SYS_inotify_init: c_long = 316; ++pub const SYS_inotify_add_watch: c_long = 317; ++pub const SYS_inotify_rm_watch: c_long = 318; ++pub const SYS_mbind: c_long = 319; ++pub const SYS_get_mempolicy: c_long = 320; ++pub const SYS_set_mempolicy: c_long = 321; ++pub const SYS_openat: c_long = 322; ++pub const SYS_mkdirat: c_long = 323; ++pub const SYS_mknodat: c_long = 324; ++pub const SYS_fchownat: c_long = 325; ++pub const SYS_futimesat: c_long = 326; ++pub const SYS_fstatat64: c_long = 327; ++pub const SYS_unlinkat: c_long = 328; ++pub const SYS_renameat: c_long = 329; ++pub const SYS_linkat: c_long = 330; ++pub const SYS_symlinkat: c_long = 331; ++pub const SYS_readlinkat: c_long = 332; ++pub const SYS_fchmodat: c_long = 333; ++pub const SYS_faccessat: c_long = 334; ++pub const SYS_pselect6: c_long = 335; ++pub const SYS_ppoll: c_long = 336; ++pub const SYS_unshare: c_long = 337; ++pub const SYS_set_robust_list: c_long = 338; ++pub const SYS_get_robust_list: c_long = 339; ++pub const SYS_splice: c_long = 340; ++pub const SYS_arm_sync_file_range: c_long = 341; ++pub const SYS_tee: c_long = 342; ++pub const SYS_vmsplice: c_long = 343; ++pub const SYS_move_pages: c_long = 344; ++pub const SYS_getcpu: c_long = 345; ++pub const SYS_epoll_pwait: c_long = 346; ++pub const SYS_kexec_load: c_long = 347; ++pub const SYS_utimensat: c_long = 348; ++pub const SYS_signalfd: c_long = 349; ++pub const SYS_timerfd_create: c_long = 350; ++pub const SYS_eventfd: c_long = 351; ++pub const SYS_fallocate: c_long = 352; ++pub const SYS_timerfd_settime: c_long = 353; ++pub const SYS_timerfd_gettime: c_long = 354; ++pub const SYS_signalfd4: c_long = 355; ++pub const SYS_eventfd2: c_long = 356; ++pub const SYS_epoll_create1: c_long = 357; ++pub const SYS_dup3: c_long = 358; ++pub const SYS_pipe2: c_long = 359; ++pub const SYS_inotify_init1: c_long = 360; ++pub const SYS_preadv: c_long = 361; ++pub const SYS_pwritev: c_long = 362; ++pub const SYS_rt_tgsigqueueinfo: c_long = 363; ++pub const SYS_perf_event_open: c_long = 364; ++pub const SYS_recvmmsg: c_long = 365; ++pub const SYS_accept4: c_long = 366; ++pub const SYS_fanotify_init: c_long = 367; ++pub const SYS_fanotify_mark: c_long = 368; ++pub const SYS_prlimit64: c_long = 369; ++pub const SYS_name_to_handle_at: c_long = 370; ++pub const SYS_open_by_handle_at: c_long = 371; ++pub const SYS_clock_adjtime: c_long = 372; ++pub const SYS_syncfs: c_long = 373; ++pub const SYS_sendmmsg: c_long = 374; ++pub const SYS_setns: c_long = 375; ++pub const SYS_process_vm_readv: c_long = 376; ++pub const SYS_process_vm_writev: c_long = 377; ++pub const SYS_kcmp: c_long = 378; ++pub const SYS_finit_module: c_long = 379; ++pub const SYS_sched_setattr: c_long = 380; ++pub const SYS_sched_getattr: c_long = 381; ++pub const SYS_renameat2: c_long = 382; ++pub const SYS_seccomp: c_long = 383; ++pub const SYS_getrandom: c_long = 384; ++pub const SYS_memfd_create: c_long = 385; ++pub const SYS_bpf: c_long = 386; ++pub const SYS_execveat: c_long = 387; ++pub const SYS_userfaultfd: c_long = 388; ++pub const SYS_membarrier: c_long = 389; ++pub const SYS_mlock2: c_long = 390; ++pub const SYS_copy_file_range: c_long = 391; ++pub const SYS_preadv2: c_long = 392; ++pub const SYS_pwritev2: c_long = 393; ++pub const SYS_pkey_mprotect: c_long = 394; ++pub const SYS_pkey_alloc: c_long = 395; ++pub const SYS_pkey_free: c_long = 396; ++pub const SYS_statx: c_long = 397; ++pub const SYS_pidfd_send_signal: c_long = 424; ++pub const SYS_io_uring_setup: c_long = 425; ++pub const SYS_io_uring_enter: c_long = 426; ++pub const SYS_io_uring_register: c_long = 427; ++pub const SYS_open_tree: c_long = 428; ++pub const SYS_move_mount: c_long = 429; ++pub const SYS_fsopen: c_long = 430; ++pub const SYS_fsconfig: c_long = 431; ++pub const SYS_fsmount: c_long = 432; ++pub const SYS_fspick: c_long = 433; ++pub const SYS_pidfd_open: c_long = 434; ++pub const SYS_clone3: c_long = 435; ++pub const SYS_close_range: c_long = 436; ++pub const SYS_openat2: c_long = 437; ++pub const SYS_pidfd_getfd: c_long = 438; ++pub const SYS_faccessat2: c_long = 439; ++pub const SYS_process_madvise: c_long = 440; ++pub const SYS_epoll_pwait2: c_long = 441; ++pub const SYS_mount_setattr: c_long = 442; ++pub const SYS_quotactl_fd: c_long = 443; ++pub const SYS_landlock_create_ruleset: c_long = 444; ++pub const SYS_landlock_add_rule: c_long = 445; ++pub const SYS_landlock_restrict_self: c_long = 446; ++pub const SYS_process_mrelease: c_long = 448; ++pub const SYS_futex_waitv: c_long = 449; ++pub const SYS_set_mempolicy_home_node: c_long = 450; ++ ++// offsets in mcontext_t.gregs from sys/ucontext.h ++pub const REG_R0: c_int = 0; ++pub const REG_R1: c_int = 1; ++pub const REG_R2: c_int = 2; ++pub const REG_R3: c_int = 3; ++pub const REG_R4: c_int = 4; ++pub const REG_R5: c_int = 5; ++pub const REG_R6: c_int = 6; ++pub const REG_R7: c_int = 7; ++pub const REG_R8: c_int = 8; ++pub const REG_R9: c_int = 9; ++pub const REG_R10: c_int = 10; ++pub const REG_R11: c_int = 11; ++pub const REG_R12: c_int = 12; ++pub const REG_R13: c_int = 13; ++pub const REG_R14: c_int = 14; ++pub const REG_R15: c_int = 15; ++ ++pub const NGREG: c_int = 18; ++ ++// From NDK's asm/auxvec.h ++pub const AT_SYSINFO_EHDR: c_ulong = 33; ++ ++f! { ++ // Sadly, Android before 5.0 (API level 21), the accept4 syscall is not ++ // exposed by the libc. As work-around, we implement it through `syscall` ++ // directly. This workaround can be removed if the minimum version of ++ // Android is bumped. When the workaround is removed, `accept4` can be ++ // moved back to `linux_like/mod.rs` ++ pub fn accept4( ++ fd: c_int, ++ addr: *mut crate::sockaddr, ++ len: *mut crate::socklen_t, ++ flg: c_int, ++ ) -> c_int { ++ crate::syscall(SYS_accept4, fd, addr, len, flg) as c_int ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/android/b32/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/android/b32/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/android/b32/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/android/b32/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,251 @@ ++use crate::prelude::*; ++ ++// The following definitions are correct for arm and i686, ++// but may be wrong for mips ++ ++pub type c_long = i32; ++pub type c_ulong = u32; ++pub type mode_t = u16; ++pub type off64_t = c_longlong; ++pub type sigset_t = c_ulong; ++pub type socklen_t = i32; ++pub type time64_t = i64; ++pub type __u64 = c_ulonglong; ++pub type __s64 = c_longlong; ++ ++s! { ++ pub struct sigaction { ++ pub sa_sigaction: crate::sighandler_t, ++ pub sa_mask: crate::sigset_t, ++ pub sa_flags: c_int, ++ pub sa_restorer: Option, ++ } ++ ++ pub struct rlimit64 { ++ pub rlim_cur: u64, ++ pub rlim_max: u64, ++ } ++ ++ pub struct stat { ++ pub st_dev: c_ulonglong, ++ __pad0: [c_uchar; 4], ++ __st_ino: crate::ino_t, ++ pub st_mode: c_uint, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: c_ulonglong, ++ __pad3: [c_uchar; 4], ++ pub st_size: c_longlong, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: c_ulonglong, ++ pub st_atime: c_long, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: c_long, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: c_long, ++ pub st_ctime_nsec: c_long, ++ pub st_ino: c_ulonglong, ++ } ++ ++ pub struct stat64 { ++ pub st_dev: c_ulonglong, ++ __pad0: [c_uchar; 4], ++ __st_ino: crate::ino_t, ++ pub st_mode: c_uint, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: c_ulonglong, ++ __pad3: [c_uchar; 4], ++ pub st_size: c_longlong, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: c_ulonglong, ++ pub st_atime: c_long, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: c_long, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: c_long, ++ pub st_ctime_nsec: c_long, ++ pub st_ino: c_ulonglong, ++ } ++ ++ pub struct statfs64 { ++ pub f_type: u32, ++ pub f_bsize: u32, ++ pub f_blocks: u64, ++ pub f_bfree: u64, ++ pub f_bavail: u64, ++ pub f_files: u64, ++ pub f_ffree: u64, ++ pub f_fsid: crate::__fsid_t, ++ pub f_namelen: u32, ++ pub f_frsize: u32, ++ pub f_flags: u32, ++ pub f_spare: [u32; 4], ++ } ++ ++ pub struct statvfs64 { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: c_ulong, ++ pub f_bfree: c_ulong, ++ pub f_bavail: c_ulong, ++ pub f_files: c_ulong, ++ pub f_ffree: c_ulong, ++ pub f_favail: c_ulong, ++ pub f_fsid: c_ulong, ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ } ++ ++ pub struct pthread_attr_t { ++ pub flags: u32, ++ pub stack_base: *mut c_void, ++ pub stack_size: size_t, ++ pub guard_size: size_t, ++ pub sched_policy: i32, ++ pub sched_priority: i32, ++ } ++ ++ pub struct pthread_mutex_t { ++ value: c_int, ++ } ++ ++ pub struct pthread_cond_t { ++ value: c_int, ++ } ++ ++ pub struct pthread_rwlock_t { ++ lock: pthread_mutex_t, ++ cond: pthread_cond_t, ++ numLocks: c_int, ++ writerThreadId: c_int, ++ pendingReaders: c_int, ++ pendingWriters: c_int, ++ attr: i32, ++ __reserved: [c_char; 12], ++ } ++ ++ pub struct pthread_barrier_t { ++ __private: [i32; 8], ++ } ++ ++ pub struct pthread_spinlock_t { ++ __private: [i32; 2], ++ } ++ ++ pub struct passwd { ++ pub pw_name: *mut c_char, ++ pub pw_passwd: *mut c_char, ++ pub pw_uid: crate::uid_t, ++ pub pw_gid: crate::gid_t, ++ pub pw_dir: *mut c_char, ++ pub pw_shell: *mut c_char, ++ } ++ ++ pub struct statfs { ++ pub f_type: u32, ++ pub f_bsize: u32, ++ pub f_blocks: u64, ++ pub f_bfree: u64, ++ pub f_bavail: u64, ++ pub f_files: u64, ++ pub f_ffree: u64, ++ pub f_fsid: crate::__fsid_t, ++ pub f_namelen: u32, ++ pub f_frsize: u32, ++ pub f_flags: u32, ++ pub f_spare: [u32; 4], ++ } ++ ++ pub struct sysinfo { ++ pub uptime: c_long, ++ pub loads: [c_ulong; 3], ++ pub totalram: c_ulong, ++ pub freeram: c_ulong, ++ pub sharedram: c_ulong, ++ pub bufferram: c_ulong, ++ pub totalswap: c_ulong, ++ pub freeswap: c_ulong, ++ pub procs: c_ushort, ++ pub pad: c_ushort, ++ pub totalhigh: c_ulong, ++ pub freehigh: c_ulong, ++ pub mem_unit: c_uint, ++ pub _f: [c_char; 8], ++ } ++} ++ ++s_no_extra_traits! { ++ pub struct sigset64_t { ++ __bits: [c_ulong; 2], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl fmt::Debug for sigset64_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sigset64_t") ++ .field("__bits", &self.__bits) ++ .finish() ++ } ++ } ++ } ++} ++ ++// These constants must be of the same type of sigaction.sa_flags ++pub const SA_NOCLDSTOP: c_int = 0x00000001; ++pub const SA_NOCLDWAIT: c_int = 0x00000002; ++pub const SA_NODEFER: c_int = 0x40000000; ++pub const SA_ONSTACK: c_int = 0x08000000; ++pub const SA_RESETHAND: c_int = 0x80000000; ++pub const SA_RESTART: c_int = 0x10000000; ++pub const SA_SIGINFO: c_int = 0x00000004; ++ ++pub const RTLD_GLOBAL: c_int = 2; ++pub const RTLD_NOW: c_int = 0; ++pub const RTLD_DEFAULT: *mut c_void = -1isize as *mut c_void; ++ ++pub const PTRACE_GETFPREGS: c_int = 14; ++pub const PTRACE_SETFPREGS: c_int = 15; ++ ++pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { value: 0 }; ++pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { value: 0 }; ++pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { ++ lock: PTHREAD_MUTEX_INITIALIZER, ++ cond: PTHREAD_COND_INITIALIZER, ++ numLocks: 0, ++ writerThreadId: 0, ++ pendingReaders: 0, ++ pendingWriters: 0, ++ attr: 0, ++ __reserved: [0; 12], ++}; ++pub const PTHREAD_STACK_MIN: size_t = 4096 * 2; ++pub const CPU_SETSIZE: size_t = 32; ++pub const __CPU_BITS: size_t = 32; ++ ++pub const UT_LINESIZE: usize = 8; ++pub const UT_NAMESIZE: usize = 8; ++pub const UT_HOSTSIZE: usize = 16; ++ ++pub const SIGSTKSZ: size_t = 8192; ++pub const MINSIGSTKSZ: size_t = 2048; ++ ++extern "C" { ++ pub fn timegm64(tm: *const crate::tm) -> crate::time64_t; ++} ++ ++cfg_if! { ++ if #[cfg(target_arch = "x86")] { ++ mod x86; ++ pub use self::x86::*; ++ } else if #[cfg(target_arch = "arm")] { ++ mod arm; ++ pub use self::arm::*; ++ } else { ++ // Unknown target_arch ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/android/b32/x86/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/android/b32/x86/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/android/b32/x86/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/android/b32/x86/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,626 @@ ++use crate::prelude::*; ++ ++pub type c_char = i8; ++pub type wchar_t = i32; ++pub type greg_t = i32; ++ ++s! { ++ pub struct _libc_fpreg { ++ pub significand: [u16; 4], ++ pub exponent: u16, ++ } ++ ++ pub struct _libc_fpstate { ++ pub cw: c_ulong, ++ pub sw: c_ulong, ++ pub tag: c_ulong, ++ pub ipoff: c_ulong, ++ pub cssel: c_ulong, ++ pub dataoff: c_ulong, ++ pub datasel: c_ulong, ++ pub _st: [_libc_fpreg; 8], ++ pub status: c_ulong, ++ } ++ ++ pub struct mcontext_t { ++ pub gregs: [greg_t; 19], ++ pub fpregs: *mut _libc_fpstate, ++ pub oldmask: c_ulong, ++ pub cr2: c_ulong, ++ } ++} ++ ++s_no_extra_traits! { ++ pub struct __c_anonymous_uc_sigmask_with_padding { ++ pub uc_sigmask: crate::sigset_t, ++ /* Android has a wrong (smaller) sigset_t on x86. */ ++ __padding_rt_sigset: u32, ++ } ++ ++ pub union __c_anonymous_uc_sigmask { ++ uc_sigmask: __c_anonymous_uc_sigmask_with_padding, ++ uc_sigmask64: crate::sigset64_t, ++ } ++ ++ pub struct ucontext_t { ++ pub uc_flags: c_ulong, ++ pub uc_link: *mut ucontext_t, ++ pub uc_stack: crate::stack_t, ++ pub uc_mcontext: mcontext_t, ++ pub uc_sigmask__c_anonymous_union: __c_anonymous_uc_sigmask, ++ __padding_rt_sigset: u32, ++ __fpregs_mem: _libc_fpstate, ++ } ++ ++ #[allow(missing_debug_implementations)] ++ #[repr(align(8))] ++ pub struct max_align_t { ++ priv_: [f64; 2], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for __c_anonymous_uc_sigmask_with_padding { ++ fn eq(&self, other: &__c_anonymous_uc_sigmask_with_padding) -> bool { ++ self.uc_sigmask == other.uc_sigmask ++ // Ignore padding ++ } ++ } ++ impl Eq for __c_anonymous_uc_sigmask_with_padding {} ++ impl fmt::Debug for __c_anonymous_uc_sigmask_with_padding { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("uc_sigmask_with_padding") ++ .field("uc_sigmask_with_padding", &self.uc_sigmask) ++ // Ignore padding ++ .finish() ++ } ++ } ++ impl hash::Hash for __c_anonymous_uc_sigmask_with_padding { ++ fn hash(&self, state: &mut H) { ++ self.uc_sigmask.hash(state) ++ // Ignore padding ++ } ++ } ++ ++ impl PartialEq for __c_anonymous_uc_sigmask { ++ fn eq(&self, other: &__c_anonymous_uc_sigmask) -> bool { ++ unsafe { self.uc_sigmask == other.uc_sigmask } ++ } ++ } ++ impl Eq for __c_anonymous_uc_sigmask {} ++ impl hash::Hash for __c_anonymous_uc_sigmask { ++ fn hash(&self, state: &mut H) { ++ unsafe { self.uc_sigmask.hash(state) } ++ } ++ } ++ ++ impl PartialEq for ucontext_t { ++ fn eq(&self, other: &Self) -> bool { ++ self.uc_flags == other.uc_flags ++ && self.uc_link == other.uc_link ++ && self.uc_stack == other.uc_stack ++ && self.uc_mcontext == other.uc_mcontext ++ && self.uc_sigmask__c_anonymous_union == other.uc_sigmask__c_anonymous_union ++ // Ignore padding field ++ } ++ } ++ impl Eq for ucontext_t {} ++ impl fmt::Debug for ucontext_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("ucontext_t") ++ .field("uc_flags", &self.uc_flags) ++ .field("uc_link", &self.uc_link) ++ .field("uc_stack", &self.uc_stack) ++ .field("uc_mcontext", &self.uc_mcontext) ++ .field( ++ "uc_sigmask__c_anonymous_union", ++ &self.uc_sigmask__c_anonymous_union, ++ ) ++ // Ignore padding field ++ .finish() ++ } ++ } ++ impl hash::Hash for ucontext_t { ++ fn hash(&self, state: &mut H) { ++ self.uc_flags.hash(state); ++ self.uc_link.hash(state); ++ self.uc_stack.hash(state); ++ self.uc_mcontext.hash(state); ++ self.uc_sigmask__c_anonymous_union.hash(state); ++ // Ignore padding field ++ } ++ } ++ } ++} ++ ++pub const O_DIRECT: c_int = 0x4000; ++pub const O_DIRECTORY: c_int = 0x10000; ++pub const O_NOFOLLOW: c_int = 0x20000; ++pub const O_LARGEFILE: c_int = 0o0100000; ++ ++pub const MAP_32BIT: c_int = 0x40; ++ ++// Syscall table ++pub const SYS_restart_syscall: c_long = 0; ++pub const SYS_exit: c_long = 1; ++pub const SYS_fork: c_long = 2; ++pub const SYS_read: c_long = 3; ++pub const SYS_write: c_long = 4; ++pub const SYS_open: c_long = 5; ++pub const SYS_close: c_long = 6; ++pub const SYS_waitpid: c_long = 7; ++pub const SYS_creat: c_long = 8; ++pub const SYS_link: c_long = 9; ++pub const SYS_unlink: c_long = 10; ++pub const SYS_execve: c_long = 11; ++pub const SYS_chdir: c_long = 12; ++pub const SYS_time: c_long = 13; ++pub const SYS_mknod: c_long = 14; ++pub const SYS_chmod: c_long = 15; ++pub const SYS_lchown: c_long = 16; ++pub const SYS_break: c_long = 17; ++pub const SYS_oldstat: c_long = 18; ++pub const SYS_lseek: c_long = 19; ++pub const SYS_getpid: c_long = 20; ++pub const SYS_mount: c_long = 21; ++pub const SYS_umount: c_long = 22; ++pub const SYS_setuid: c_long = 23; ++pub const SYS_getuid: c_long = 24; ++pub const SYS_stime: c_long = 25; ++pub const SYS_ptrace: c_long = 26; ++pub const SYS_alarm: c_long = 27; ++pub const SYS_oldfstat: c_long = 28; ++pub const SYS_pause: c_long = 29; ++pub const SYS_utime: c_long = 30; ++pub const SYS_stty: c_long = 31; ++pub const SYS_gtty: c_long = 32; ++pub const SYS_access: c_long = 33; ++pub const SYS_nice: c_long = 34; ++pub const SYS_ftime: c_long = 35; ++pub const SYS_sync: c_long = 36; ++pub const SYS_kill: c_long = 37; ++pub const SYS_rename: c_long = 38; ++pub const SYS_mkdir: c_long = 39; ++pub const SYS_rmdir: c_long = 40; ++pub const SYS_dup: c_long = 41; ++pub const SYS_pipe: c_long = 42; ++pub const SYS_times: c_long = 43; ++pub const SYS_prof: c_long = 44; ++pub const SYS_brk: c_long = 45; ++pub const SYS_setgid: c_long = 46; ++pub const SYS_getgid: c_long = 47; ++pub const SYS_signal: c_long = 48; ++pub const SYS_geteuid: c_long = 49; ++pub const SYS_getegid: c_long = 50; ++pub const SYS_acct: c_long = 51; ++pub const SYS_umount2: c_long = 52; ++pub const SYS_lock: c_long = 53; ++pub const SYS_ioctl: c_long = 54; ++pub const SYS_fcntl: c_long = 55; ++pub const SYS_mpx: c_long = 56; ++pub const SYS_setpgid: c_long = 57; ++pub const SYS_ulimit: c_long = 58; ++pub const SYS_oldolduname: c_long = 59; ++pub const SYS_umask: c_long = 60; ++pub const SYS_chroot: c_long = 61; ++pub const SYS_ustat: c_long = 62; ++pub const SYS_dup2: c_long = 63; ++pub const SYS_getppid: c_long = 64; ++pub const SYS_getpgrp: c_long = 65; ++pub const SYS_setsid: c_long = 66; ++pub const SYS_sigaction: c_long = 67; ++pub const SYS_sgetmask: c_long = 68; ++pub const SYS_ssetmask: c_long = 69; ++pub const SYS_setreuid: c_long = 70; ++pub const SYS_setregid: c_long = 71; ++pub const SYS_sigsuspend: c_long = 72; ++pub const SYS_sigpending: c_long = 73; ++pub const SYS_sethostname: c_long = 74; ++pub const SYS_setrlimit: c_long = 75; ++pub const SYS_getrlimit: c_long = 76; ++pub const SYS_getrusage: c_long = 77; ++pub const SYS_gettimeofday: c_long = 78; ++pub const SYS_settimeofday: c_long = 79; ++pub const SYS_getgroups: c_long = 80; ++pub const SYS_setgroups: c_long = 81; ++pub const SYS_select: c_long = 82; ++pub const SYS_symlink: c_long = 83; ++pub const SYS_oldlstat: c_long = 84; ++pub const SYS_readlink: c_long = 85; ++pub const SYS_uselib: c_long = 86; ++pub const SYS_swapon: c_long = 87; ++pub const SYS_reboot: c_long = 88; ++pub const SYS_readdir: c_long = 89; ++pub const SYS_mmap: c_long = 90; ++pub const SYS_munmap: c_long = 91; ++pub const SYS_truncate: c_long = 92; ++pub const SYS_ftruncate: c_long = 93; ++pub const SYS_fchmod: c_long = 94; ++pub const SYS_fchown: c_long = 95; ++pub const SYS_getpriority: c_long = 96; ++pub const SYS_setpriority: c_long = 97; ++pub const SYS_profil: c_long = 98; ++pub const SYS_statfs: c_long = 99; ++pub const SYS_fstatfs: c_long = 100; ++pub const SYS_ioperm: c_long = 101; ++pub const SYS_socketcall: c_long = 102; ++pub const SYS_syslog: c_long = 103; ++pub const SYS_setitimer: c_long = 104; ++pub const SYS_getitimer: c_long = 105; ++pub const SYS_stat: c_long = 106; ++pub const SYS_lstat: c_long = 107; ++pub const SYS_fstat: c_long = 108; ++pub const SYS_olduname: c_long = 109; ++pub const SYS_iopl: c_long = 110; ++pub const SYS_vhangup: c_long = 111; ++pub const SYS_idle: c_long = 112; ++pub const SYS_vm86old: c_long = 113; ++pub const SYS_wait4: c_long = 114; ++pub const SYS_swapoff: c_long = 115; ++pub const SYS_sysinfo: c_long = 116; ++pub const SYS_ipc: c_long = 117; ++pub const SYS_fsync: c_long = 118; ++pub const SYS_sigreturn: c_long = 119; ++pub const SYS_clone: c_long = 120; ++pub const SYS_setdomainname: c_long = 121; ++pub const SYS_uname: c_long = 122; ++pub const SYS_modify_ldt: c_long = 123; ++pub const SYS_adjtimex: c_long = 124; ++pub const SYS_mprotect: c_long = 125; ++pub const SYS_sigprocmask: c_long = 126; ++pub const SYS_create_module: c_long = 127; ++pub const SYS_init_module: c_long = 128; ++pub const SYS_delete_module: c_long = 129; ++pub const SYS_get_kernel_syms: c_long = 130; ++pub const SYS_quotactl: c_long = 131; ++pub const SYS_getpgid: c_long = 132; ++pub const SYS_fchdir: c_long = 133; ++pub const SYS_bdflush: c_long = 134; ++pub const SYS_sysfs: c_long = 135; ++pub const SYS_personality: c_long = 136; ++pub const SYS_afs_syscall: c_long = 137; ++pub const SYS_setfsuid: c_long = 138; ++pub const SYS_setfsgid: c_long = 139; ++// FIXME: SYS__llseek is in the NDK sources but for some reason is ++// not available in the tests ++// pub const SYS__llseek: c_long = 140; ++pub const SYS_getdents: c_long = 141; ++// FIXME: SYS__newselect is in the NDK sources but for some reason is ++// not available in the tests ++// pub const SYS__newselect: c_long = 142; ++pub const SYS_flock: c_long = 143; ++pub const SYS_msync: c_long = 144; ++pub const SYS_readv: c_long = 145; ++pub const SYS_writev: c_long = 146; ++pub const SYS_getsid: c_long = 147; ++pub const SYS_fdatasync: c_long = 148; ++// FIXME: SYS__llseek is in the NDK sources but for some reason is ++// not available in the tests ++// pub const SYS__sysctl: c_long = 149; ++pub const SYS_mlock: c_long = 150; ++pub const SYS_munlock: c_long = 151; ++pub const SYS_mlockall: c_long = 152; ++pub const SYS_munlockall: c_long = 153; ++pub const SYS_sched_setparam: c_long = 154; ++pub const SYS_sched_getparam: c_long = 155; ++pub const SYS_sched_setscheduler: c_long = 156; ++pub const SYS_sched_getscheduler: c_long = 157; ++pub const SYS_sched_yield: c_long = 158; ++pub const SYS_sched_get_priority_max: c_long = 159; ++pub const SYS_sched_get_priority_min: c_long = 160; ++pub const SYS_sched_rr_get_interval: c_long = 161; ++pub const SYS_nanosleep: c_long = 162; ++pub const SYS_mremap: c_long = 163; ++pub const SYS_setresuid: c_long = 164; ++pub const SYS_getresuid: c_long = 165; ++pub const SYS_vm86: c_long = 166; ++pub const SYS_query_module: c_long = 167; ++pub const SYS_poll: c_long = 168; ++pub const SYS_nfsservctl: c_long = 169; ++pub const SYS_setresgid: c_long = 170; ++pub const SYS_getresgid: c_long = 171; ++pub const SYS_prctl: c_long = 172; ++pub const SYS_rt_sigreturn: c_long = 173; ++pub const SYS_rt_sigaction: c_long = 174; ++pub const SYS_rt_sigprocmask: c_long = 175; ++pub const SYS_rt_sigpending: c_long = 176; ++pub const SYS_rt_sigtimedwait: c_long = 177; ++pub const SYS_rt_sigqueueinfo: c_long = 178; ++pub const SYS_rt_sigsuspend: c_long = 179; ++pub const SYS_pread64: c_long = 180; ++pub const SYS_pwrite64: c_long = 181; ++pub const SYS_chown: c_long = 182; ++pub const SYS_getcwd: c_long = 183; ++pub const SYS_capget: c_long = 184; ++pub const SYS_capset: c_long = 185; ++pub const SYS_sigaltstack: c_long = 186; ++pub const SYS_sendfile: c_long = 187; ++pub const SYS_getpmsg: c_long = 188; ++pub const SYS_putpmsg: c_long = 189; ++pub const SYS_vfork: c_long = 190; ++pub const SYS_ugetrlimit: c_long = 191; ++pub const SYS_mmap2: c_long = 192; ++pub const SYS_truncate64: c_long = 193; ++pub const SYS_ftruncate64: c_long = 194; ++pub const SYS_stat64: c_long = 195; ++pub const SYS_lstat64: c_long = 196; ++pub const SYS_fstat64: c_long = 197; ++pub const SYS_lchown32: c_long = 198; ++pub const SYS_getuid32: c_long = 199; ++pub const SYS_getgid32: c_long = 200; ++pub const SYS_geteuid32: c_long = 201; ++pub const SYS_getegid32: c_long = 202; ++pub const SYS_setreuid32: c_long = 203; ++pub const SYS_setregid32: c_long = 204; ++pub const SYS_getgroups32: c_long = 205; ++pub const SYS_setgroups32: c_long = 206; ++pub const SYS_fchown32: c_long = 207; ++pub const SYS_setresuid32: c_long = 208; ++pub const SYS_getresuid32: c_long = 209; ++pub const SYS_setresgid32: c_long = 210; ++pub const SYS_getresgid32: c_long = 211; ++pub const SYS_chown32: c_long = 212; ++pub const SYS_setuid32: c_long = 213; ++pub const SYS_setgid32: c_long = 214; ++pub const SYS_setfsuid32: c_long = 215; ++pub const SYS_setfsgid32: c_long = 216; ++pub const SYS_pivot_root: c_long = 217; ++pub const SYS_mincore: c_long = 218; ++pub const SYS_madvise: c_long = 219; ++pub const SYS_getdents64: c_long = 220; ++pub const SYS_fcntl64: c_long = 221; ++pub const SYS_gettid: c_long = 224; ++pub const SYS_readahead: c_long = 225; ++pub const SYS_setxattr: c_long = 226; ++pub const SYS_lsetxattr: c_long = 227; ++pub const SYS_fsetxattr: c_long = 228; ++pub const SYS_getxattr: c_long = 229; ++pub const SYS_lgetxattr: c_long = 230; ++pub const SYS_fgetxattr: c_long = 231; ++pub const SYS_listxattr: c_long = 232; ++pub const SYS_llistxattr: c_long = 233; ++pub const SYS_flistxattr: c_long = 234; ++pub const SYS_removexattr: c_long = 235; ++pub const SYS_lremovexattr: c_long = 236; ++pub const SYS_fremovexattr: c_long = 237; ++pub const SYS_tkill: c_long = 238; ++pub const SYS_sendfile64: c_long = 239; ++pub const SYS_futex: c_long = 240; ++pub const SYS_sched_setaffinity: c_long = 241; ++pub const SYS_sched_getaffinity: c_long = 242; ++pub const SYS_set_thread_area: c_long = 243; ++pub const SYS_get_thread_area: c_long = 244; ++pub const SYS_io_setup: c_long = 245; ++pub const SYS_io_destroy: c_long = 246; ++pub const SYS_io_getevents: c_long = 247; ++pub const SYS_io_submit: c_long = 248; ++pub const SYS_io_cancel: c_long = 249; ++pub const SYS_fadvise64: c_long = 250; ++pub const SYS_exit_group: c_long = 252; ++pub const SYS_lookup_dcookie: c_long = 253; ++pub const SYS_epoll_create: c_long = 254; ++pub const SYS_epoll_ctl: c_long = 255; ++pub const SYS_epoll_wait: c_long = 256; ++pub const SYS_remap_file_pages: c_long = 257; ++pub const SYS_set_tid_address: c_long = 258; ++pub const SYS_timer_create: c_long = 259; ++pub const SYS_timer_settime: c_long = 260; ++pub const SYS_timer_gettime: c_long = 261; ++pub const SYS_timer_getoverrun: c_long = 262; ++pub const SYS_timer_delete: c_long = 263; ++pub const SYS_clock_settime: c_long = 264; ++pub const SYS_clock_gettime: c_long = 265; ++pub const SYS_clock_getres: c_long = 266; ++pub const SYS_clock_nanosleep: c_long = 267; ++pub const SYS_statfs64: c_long = 268; ++pub const SYS_fstatfs64: c_long = 269; ++pub const SYS_tgkill: c_long = 270; ++pub const SYS_utimes: c_long = 271; ++pub const SYS_fadvise64_64: c_long = 272; ++pub const SYS_vserver: c_long = 273; ++pub const SYS_mbind: c_long = 274; ++pub const SYS_get_mempolicy: c_long = 275; ++pub const SYS_set_mempolicy: c_long = 276; ++pub const SYS_mq_open: c_long = 277; ++pub const SYS_mq_unlink: c_long = 278; ++pub const SYS_mq_timedsend: c_long = 279; ++pub const SYS_mq_timedreceive: c_long = 280; ++pub const SYS_mq_notify: c_long = 281; ++pub const SYS_mq_getsetattr: c_long = 282; ++pub const SYS_kexec_load: c_long = 283; ++pub const SYS_waitid: c_long = 284; ++pub const SYS_add_key: c_long = 286; ++pub const SYS_request_key: c_long = 287; ++pub const SYS_keyctl: c_long = 288; ++pub const SYS_ioprio_set: c_long = 289; ++pub const SYS_ioprio_get: c_long = 290; ++pub const SYS_inotify_init: c_long = 291; ++pub const SYS_inotify_add_watch: c_long = 292; ++pub const SYS_inotify_rm_watch: c_long = 293; ++pub const SYS_migrate_pages: c_long = 294; ++pub const SYS_openat: c_long = 295; ++pub const SYS_mkdirat: c_long = 296; ++pub const SYS_mknodat: c_long = 297; ++pub const SYS_fchownat: c_long = 298; ++pub const SYS_futimesat: c_long = 299; ++pub const SYS_fstatat64: c_long = 300; ++pub const SYS_unlinkat: c_long = 301; ++pub const SYS_renameat: c_long = 302; ++pub const SYS_linkat: c_long = 303; ++pub const SYS_symlinkat: c_long = 304; ++pub const SYS_readlinkat: c_long = 305; ++pub const SYS_fchmodat: c_long = 306; ++pub const SYS_faccessat: c_long = 307; ++pub const SYS_pselect6: c_long = 308; ++pub const SYS_ppoll: c_long = 309; ++pub const SYS_unshare: c_long = 310; ++pub const SYS_set_robust_list: c_long = 311; ++pub const SYS_get_robust_list: c_long = 312; ++pub const SYS_splice: c_long = 313; ++pub const SYS_sync_file_range: c_long = 314; ++pub const SYS_tee: c_long = 315; ++pub const SYS_vmsplice: c_long = 316; ++pub const SYS_move_pages: c_long = 317; ++pub const SYS_getcpu: c_long = 318; ++pub const SYS_epoll_pwait: c_long = 319; ++pub const SYS_utimensat: c_long = 320; ++pub const SYS_signalfd: c_long = 321; ++pub const SYS_timerfd_create: c_long = 322; ++pub const SYS_eventfd: c_long = 323; ++pub const SYS_fallocate: c_long = 324; ++pub const SYS_timerfd_settime: c_long = 325; ++pub const SYS_timerfd_gettime: c_long = 326; ++pub const SYS_signalfd4: c_long = 327; ++pub const SYS_eventfd2: c_long = 328; ++pub const SYS_epoll_create1: c_long = 329; ++pub const SYS_dup3: c_long = 330; ++pub const SYS_pipe2: c_long = 331; ++pub const SYS_inotify_init1: c_long = 332; ++pub const SYS_preadv: c_long = 333; ++pub const SYS_pwritev: c_long = 334; ++pub const SYS_rt_tgsigqueueinfo: c_long = 335; ++pub const SYS_perf_event_open: c_long = 336; ++pub const SYS_recvmmsg: c_long = 337; ++pub const SYS_fanotify_init: c_long = 338; ++pub const SYS_fanotify_mark: c_long = 339; ++pub const SYS_prlimit64: c_long = 340; ++pub const SYS_name_to_handle_at: c_long = 341; ++pub const SYS_open_by_handle_at: c_long = 342; ++pub const SYS_clock_adjtime: c_long = 343; ++pub const SYS_syncfs: c_long = 344; ++pub const SYS_sendmmsg: c_long = 345; ++pub const SYS_setns: c_long = 346; ++pub const SYS_process_vm_readv: c_long = 347; ++pub const SYS_process_vm_writev: c_long = 348; ++pub const SYS_kcmp: c_long = 349; ++pub const SYS_finit_module: c_long = 350; ++pub const SYS_sched_setattr: c_long = 351; ++pub const SYS_sched_getattr: c_long = 352; ++pub const SYS_renameat2: c_long = 353; ++pub const SYS_seccomp: c_long = 354; ++pub const SYS_getrandom: c_long = 355; ++pub const SYS_memfd_create: c_long = 356; ++pub const SYS_bpf: c_long = 357; ++pub const SYS_execveat: c_long = 358; ++pub const SYS_socket: c_long = 359; ++pub const SYS_socketpair: c_long = 360; ++pub const SYS_bind: c_long = 361; ++pub const SYS_connect: c_long = 362; ++pub const SYS_listen: c_long = 363; ++pub const SYS_accept4: c_long = 364; ++pub const SYS_getsockopt: c_long = 365; ++pub const SYS_setsockopt: c_long = 366; ++pub const SYS_getsockname: c_long = 367; ++pub const SYS_getpeername: c_long = 368; ++pub const SYS_sendto: c_long = 369; ++pub const SYS_sendmsg: c_long = 370; ++pub const SYS_recvfrom: c_long = 371; ++pub const SYS_recvmsg: c_long = 372; ++pub const SYS_shutdown: c_long = 373; ++pub const SYS_userfaultfd: c_long = 374; ++pub const SYS_membarrier: c_long = 375; ++pub const SYS_mlock2: c_long = 376; ++pub const SYS_copy_file_range: c_long = 377; ++pub const SYS_preadv2: c_long = 378; ++pub const SYS_pwritev2: c_long = 379; ++pub const SYS_pkey_mprotect: c_long = 380; ++pub const SYS_pkey_alloc: c_long = 381; ++pub const SYS_pkey_free: c_long = 382; ++pub const SYS_statx: c_long = 383; ++pub const SYS_pidfd_send_signal: c_long = 424; ++pub const SYS_io_uring_setup: c_long = 425; ++pub const SYS_io_uring_enter: c_long = 426; ++pub const SYS_io_uring_register: c_long = 427; ++pub const SYS_open_tree: c_long = 428; ++pub const SYS_move_mount: c_long = 429; ++pub const SYS_fsopen: c_long = 430; ++pub const SYS_fsconfig: c_long = 431; ++pub const SYS_fsmount: c_long = 432; ++pub const SYS_fspick: c_long = 433; ++pub const SYS_pidfd_open: c_long = 434; ++pub const SYS_clone3: c_long = 435; ++pub const SYS_close_range: c_long = 436; ++pub const SYS_openat2: c_long = 437; ++pub const SYS_pidfd_getfd: c_long = 438; ++pub const SYS_faccessat2: c_long = 439; ++pub const SYS_process_madvise: c_long = 440; ++pub const SYS_epoll_pwait2: c_long = 441; ++pub const SYS_mount_setattr: c_long = 442; ++pub const SYS_quotactl_fd: c_long = 443; ++pub const SYS_landlock_create_ruleset: c_long = 444; ++pub const SYS_landlock_add_rule: c_long = 445; ++pub const SYS_landlock_restrict_self: c_long = 446; ++pub const SYS_memfd_secret: c_long = 447; ++pub const SYS_process_mrelease: c_long = 448; ++pub const SYS_futex_waitv: c_long = 449; ++pub const SYS_set_mempolicy_home_node: c_long = 450; ++ ++// offsets in user_regs_structs, from sys/reg.h ++pub const EBX: c_int = 0; ++pub const ECX: c_int = 1; ++pub const EDX: c_int = 2; ++pub const ESI: c_int = 3; ++pub const EDI: c_int = 4; ++pub const EBP: c_int = 5; ++pub const EAX: c_int = 6; ++pub const DS: c_int = 7; ++pub const ES: c_int = 8; ++pub const FS: c_int = 9; ++pub const GS: c_int = 10; ++pub const ORIG_EAX: c_int = 11; ++pub const EIP: c_int = 12; ++pub const CS: c_int = 13; ++pub const EFL: c_int = 14; ++pub const UESP: c_int = 15; ++pub const SS: c_int = 16; ++ ++// offsets in mcontext_t.gregs from sys/ucontext.h ++pub const REG_GS: c_int = 0; ++pub const REG_FS: c_int = 1; ++pub const REG_ES: c_int = 2; ++pub const REG_DS: c_int = 3; ++pub const REG_EDI: c_int = 4; ++pub const REG_ESI: c_int = 5; ++pub const REG_EBP: c_int = 6; ++pub const REG_ESP: c_int = 7; ++pub const REG_EBX: c_int = 8; ++pub const REG_EDX: c_int = 9; ++pub const REG_ECX: c_int = 10; ++pub const REG_EAX: c_int = 11; ++pub const REG_TRAPNO: c_int = 12; ++pub const REG_ERR: c_int = 13; ++pub const REG_EIP: c_int = 14; ++pub const REG_CS: c_int = 15; ++pub const REG_EFL: c_int = 16; ++pub const REG_UESP: c_int = 17; ++pub const REG_SS: c_int = 18; ++ ++// From NDK's asm/auxvec.h ++pub const AT_SYSINFO: c_ulong = 32; ++pub const AT_SYSINFO_EHDR: c_ulong = 33; ++pub const AT_VECTOR_SIZE_ARCH: c_ulong = 3; ++ ++// socketcall values from linux/net.h (only the needed ones, and not public) ++const SYS_ACCEPT4: c_int = 18; ++ ++f! { ++ // Sadly, Android before 5.0 (API level 21), the accept4 syscall is not ++ // exposed by the libc. As work-around, we implement it as raw syscall. ++ // Note that for x86, the `accept4` syscall is not available either, ++ // and we must use the `socketcall` syscall instead. ++ // This workaround can be removed if the minimum Android version is bumped. ++ // When the workaround is removed, `accept4` can be moved back ++ // to `linux_like/mod.rs` ++ pub fn accept4( ++ fd: c_int, ++ addr: *mut crate::sockaddr, ++ len: *mut crate::socklen_t, ++ flg: c_int, ++ ) -> c_int { ++ // Arguments are passed as array of `long int` ++ // (which is big enough on x86 for a pointer). ++ let mut args = [fd as c_long, addr as c_long, len as c_long, flg as c_long]; ++ crate::syscall(SYS_socketcall, SYS_ACCEPT4, args[..].as_mut_ptr()) ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/android/b64/aarch64/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/android/b64/aarch64/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/android/b64/aarch64/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/android/b64/aarch64/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,475 @@ ++use crate::off64_t; ++use crate::prelude::*; ++ ++pub type c_char = u8; ++pub type wchar_t = u32; ++pub type __u64 = c_ulonglong; ++pub type __s64 = c_longlong; ++ ++s! { ++ pub struct stat { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino_t, ++ pub st_mode: c_uint, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ __pad1: c_ulong, ++ pub st_size: off64_t, ++ pub st_blksize: c_int, ++ __pad2: c_int, ++ pub st_blocks: c_long, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ __unused4: c_uint, ++ __unused5: c_uint, ++ } ++ ++ pub struct stat64 { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino_t, ++ pub st_mode: c_uint, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ __pad1: c_ulong, ++ pub st_size: off64_t, ++ pub st_blksize: c_int, ++ __pad2: c_int, ++ pub st_blocks: c_long, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ __unused4: c_uint, ++ __unused5: c_uint, ++ } ++ ++ pub struct user_regs_struct { ++ pub regs: [u64; 31], ++ pub sp: u64, ++ pub pc: u64, ++ pub pstate: u64, ++ } ++ ++ pub struct ucontext_t { ++ pub uc_flags: c_ulong, ++ pub uc_link: *mut ucontext_t, ++ pub uc_stack: crate::stack_t, ++ pub uc_sigmask: crate::sigset_t, ++ pub uc_mcontext: mcontext_t, ++ } ++ ++ #[repr(align(16))] ++ pub struct mcontext_t { ++ pub fault_address: c_ulonglong, ++ pub regs: [c_ulonglong; 31], ++ pub sp: c_ulonglong, ++ pub pc: c_ulonglong, ++ pub pstate: c_ulonglong, ++ __reserved: [u64; 512], ++ } ++ ++ pub struct user_fpsimd_struct { ++ pub vregs: [crate::__uint128_t; 32], ++ pub fpsr: u32, ++ pub fpcr: u32, ++ } ++} ++ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ #[repr(align(16))] ++ pub struct max_align_t { ++ priv_: [f32; 8], ++ } ++} ++ ++pub const O_DIRECT: c_int = 0x10000; ++pub const O_DIRECTORY: c_int = 0x4000; ++pub const O_NOFOLLOW: c_int = 0x8000; ++pub const O_LARGEFILE: c_int = 0o400000; ++ ++pub const SIGSTKSZ: size_t = 16384; ++pub const MINSIGSTKSZ: size_t = 5120; ++ ++// From NDK's asm/hwcap.h ++pub const HWCAP_FP: c_ulong = 1 << 0; ++pub const HWCAP_ASIMD: c_ulong = 1 << 1; ++pub const HWCAP_EVTSTRM: c_ulong = 1 << 2; ++pub const HWCAP_AES: c_ulong = 1 << 3; ++pub const HWCAP_PMULL: c_ulong = 1 << 4; ++pub const HWCAP_SHA1: c_ulong = 1 << 5; ++pub const HWCAP_SHA2: c_ulong = 1 << 6; ++pub const HWCAP_CRC32: c_ulong = 1 << 7; ++pub const HWCAP_ATOMICS: c_ulong = 1 << 8; ++pub const HWCAP_FPHP: c_ulong = 1 << 9; ++pub const HWCAP_ASIMDHP: c_ulong = 1 << 10; ++pub const HWCAP_CPUID: c_ulong = 1 << 11; ++pub const HWCAP_ASIMDRDM: c_ulong = 1 << 12; ++pub const HWCAP_JSCVT: c_ulong = 1 << 13; ++pub const HWCAP_FCMA: c_ulong = 1 << 14; ++pub const HWCAP_LRCPC: c_ulong = 1 << 15; ++pub const HWCAP_DCPOP: c_ulong = 1 << 16; ++pub const HWCAP_SHA3: c_ulong = 1 << 17; ++pub const HWCAP_SM3: c_ulong = 1 << 18; ++pub const HWCAP_SM4: c_ulong = 1 << 19; ++pub const HWCAP_ASIMDDP: c_ulong = 1 << 20; ++pub const HWCAP_SHA512: c_ulong = 1 << 21; ++pub const HWCAP_SVE: c_ulong = 1 << 22; ++pub const HWCAP_ASIMDFHM: c_ulong = 1 << 23; ++pub const HWCAP_DIT: c_ulong = 1 << 24; ++pub const HWCAP_USCAT: c_ulong = 1 << 25; ++pub const HWCAP_ILRCPC: c_ulong = 1 << 26; ++pub const HWCAP_FLAGM: c_ulong = 1 << 27; ++pub const HWCAP_SSBS: c_ulong = 1 << 28; ++pub const HWCAP_SB: c_ulong = 1 << 29; ++pub const HWCAP_PACA: c_ulong = 1 << 30; ++pub const HWCAP_PACG: c_ulong = 1 << 31; ++pub const HWCAP2_DCPODP: c_ulong = 1 << 0; ++pub const HWCAP2_SVE2: c_ulong = 1 << 1; ++pub const HWCAP2_SVEAES: c_ulong = 1 << 2; ++pub const HWCAP2_SVEPMULL: c_ulong = 1 << 3; ++pub const HWCAP2_SVEBITPERM: c_ulong = 1 << 4; ++pub const HWCAP2_SVESHA3: c_ulong = 1 << 5; ++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_SVEI8MM: c_ulong = 1 << 9; ++pub const HWCAP2_SVEF32MM: c_ulong = 1 << 10; ++pub const HWCAP2_SVEF64MM: c_ulong = 1 << 11; ++pub const HWCAP2_SVEBF16: c_ulong = 1 << 12; ++pub const HWCAP2_I8MM: c_ulong = 1 << 13; ++pub const HWCAP2_BF16: c_ulong = 1 << 14; ++pub const HWCAP2_DGH: c_ulong = 1 << 15; ++pub const HWCAP2_RNG: c_ulong = 1 << 16; ++pub const HWCAP2_BTI: c_ulong = 1 << 17; ++pub const HWCAP2_MTE: c_ulong = 1 << 18; ++pub const HWCAP2_ECV: c_ulong = 1 << 19; ++pub const HWCAP2_AFP: c_ulong = 1 << 20; ++pub const HWCAP2_RPRES: c_ulong = 1 << 21; ++pub const HWCAP2_MTE3: c_ulong = 1 << 22; ++pub const HWCAP2_SME: c_ulong = 1 << 23; ++pub const HWCAP2_SME_I16I64: c_ulong = 1 << 24; ++pub const HWCAP2_SME_F64F64: c_ulong = 1 << 25; ++pub const HWCAP2_SME_I8I32: c_ulong = 1 << 26; ++pub const HWCAP2_SME_F16F32: c_ulong = 1 << 27; ++pub const HWCAP2_SME_B16F32: c_ulong = 1 << 28; ++pub const HWCAP2_SME_F32F32: c_ulong = 1 << 29; ++pub const HWCAP2_SME_FA64: c_ulong = 1 << 30; ++pub const HWCAP2_WFXT: c_ulong = 1 << 31; ++pub const HWCAP2_EBF16: c_ulong = 1 << 32; ++pub const HWCAP2_SVE_EBF16: c_ulong = 1 << 33; ++ ++pub const SYS_io_setup: c_long = 0; ++pub const SYS_io_destroy: c_long = 1; ++pub const SYS_io_submit: c_long = 2; ++pub const SYS_io_cancel: c_long = 3; ++pub const SYS_io_getevents: c_long = 4; ++pub const SYS_setxattr: c_long = 5; ++pub const SYS_lsetxattr: c_long = 6; ++pub const SYS_fsetxattr: c_long = 7; ++pub const SYS_getxattr: c_long = 8; ++pub const SYS_lgetxattr: c_long = 9; ++pub const SYS_fgetxattr: c_long = 10; ++pub const SYS_listxattr: c_long = 11; ++pub const SYS_llistxattr: c_long = 12; ++pub const SYS_flistxattr: c_long = 13; ++pub const SYS_removexattr: c_long = 14; ++pub const SYS_lremovexattr: c_long = 15; ++pub const SYS_fremovexattr: c_long = 16; ++pub const SYS_getcwd: c_long = 17; ++pub const SYS_lookup_dcookie: c_long = 18; ++pub const SYS_eventfd2: c_long = 19; ++pub const SYS_epoll_create1: c_long = 20; ++pub const SYS_epoll_ctl: c_long = 21; ++pub const SYS_epoll_pwait: c_long = 22; ++pub const SYS_dup: c_long = 23; ++pub const SYS_dup3: c_long = 24; ++pub const SYS_fcntl: c_long = 25; ++pub const SYS_inotify_init1: c_long = 26; ++pub const SYS_inotify_add_watch: c_long = 27; ++pub const SYS_inotify_rm_watch: c_long = 28; ++pub const SYS_ioctl: c_long = 29; ++pub const SYS_ioprio_set: c_long = 30; ++pub const SYS_ioprio_get: c_long = 31; ++pub const SYS_flock: c_long = 32; ++pub const SYS_mknodat: c_long = 33; ++pub const SYS_mkdirat: c_long = 34; ++pub const SYS_unlinkat: c_long = 35; ++pub const SYS_symlinkat: c_long = 36; ++pub const SYS_linkat: c_long = 37; ++pub const SYS_renameat: c_long = 38; ++pub const SYS_umount2: c_long = 39; ++pub const SYS_mount: c_long = 40; ++pub const SYS_pivot_root: c_long = 41; ++pub const SYS_nfsservctl: c_long = 42; ++pub const SYS_fallocate: c_long = 47; ++pub const SYS_faccessat: c_long = 48; ++pub const SYS_chdir: c_long = 49; ++pub const SYS_fchdir: c_long = 50; ++pub const SYS_chroot: c_long = 51; ++pub const SYS_fchmod: c_long = 52; ++pub const SYS_fchmodat: c_long = 53; ++pub const SYS_fchownat: c_long = 54; ++pub const SYS_fchown: c_long = 55; ++pub const SYS_openat: c_long = 56; ++pub const SYS_close: c_long = 57; ++pub const SYS_vhangup: c_long = 58; ++pub const SYS_pipe2: c_long = 59; ++pub const SYS_quotactl: c_long = 60; ++pub const SYS_getdents64: c_long = 61; ++pub const SYS_lseek: c_long = 62; ++pub const SYS_read: c_long = 63; ++pub const SYS_write: c_long = 64; ++pub const SYS_readv: c_long = 65; ++pub const SYS_writev: c_long = 66; ++pub const SYS_pread64: c_long = 67; ++pub const SYS_pwrite64: c_long = 68; ++pub const SYS_preadv: c_long = 69; ++pub const SYS_pwritev: c_long = 70; ++pub const SYS_pselect6: c_long = 72; ++pub const SYS_ppoll: c_long = 73; ++pub const SYS_signalfd4: c_long = 74; ++pub const SYS_vmsplice: c_long = 75; ++pub const SYS_splice: c_long = 76; ++pub const SYS_tee: c_long = 77; ++pub const SYS_readlinkat: c_long = 78; ++pub const SYS_sync: c_long = 81; ++pub const SYS_fsync: c_long = 82; ++pub const SYS_fdatasync: c_long = 83; ++pub const SYS_sync_file_range: c_long = 84; ++pub const SYS_timerfd_create: c_long = 85; ++pub const SYS_timerfd_settime: c_long = 86; ++pub const SYS_timerfd_gettime: c_long = 87; ++pub const SYS_utimensat: c_long = 88; ++pub const SYS_acct: c_long = 89; ++pub const SYS_capget: c_long = 90; ++pub const SYS_capset: c_long = 91; ++pub const SYS_personality: c_long = 92; ++pub const SYS_exit: c_long = 93; ++pub const SYS_exit_group: c_long = 94; ++pub const SYS_waitid: c_long = 95; ++pub const SYS_set_tid_address: c_long = 96; ++pub const SYS_unshare: c_long = 97; ++pub const SYS_futex: c_long = 98; ++pub const SYS_set_robust_list: c_long = 99; ++pub const SYS_get_robust_list: c_long = 100; ++pub const SYS_nanosleep: c_long = 101; ++pub const SYS_getitimer: c_long = 102; ++pub const SYS_setitimer: c_long = 103; ++pub const SYS_kexec_load: c_long = 104; ++pub const SYS_init_module: c_long = 105; ++pub const SYS_delete_module: c_long = 106; ++pub const SYS_timer_create: c_long = 107; ++pub const SYS_timer_gettime: c_long = 108; ++pub const SYS_timer_getoverrun: c_long = 109; ++pub const SYS_timer_settime: c_long = 110; ++pub const SYS_timer_delete: c_long = 111; ++pub const SYS_clock_settime: c_long = 112; ++pub const SYS_clock_gettime: c_long = 113; ++pub const SYS_clock_getres: c_long = 114; ++pub const SYS_clock_nanosleep: c_long = 115; ++pub const SYS_syslog: c_long = 116; ++pub const SYS_ptrace: c_long = 117; ++pub const SYS_sched_setparam: c_long = 118; ++pub const SYS_sched_setscheduler: c_long = 119; ++pub const SYS_sched_getscheduler: c_long = 120; ++pub const SYS_sched_getparam: c_long = 121; ++pub const SYS_sched_setaffinity: c_long = 122; ++pub const SYS_sched_getaffinity: c_long = 123; ++pub const SYS_sched_yield: c_long = 124; ++pub const SYS_sched_get_priority_max: c_long = 125; ++pub const SYS_sched_get_priority_min: c_long = 126; ++pub const SYS_sched_rr_get_interval: c_long = 127; ++pub const SYS_restart_syscall: c_long = 128; ++pub const SYS_kill: c_long = 129; ++pub const SYS_tkill: c_long = 130; ++pub const SYS_tgkill: c_long = 131; ++pub const SYS_sigaltstack: c_long = 132; ++pub const SYS_rt_sigsuspend: c_long = 133; ++pub const SYS_rt_sigaction: c_long = 134; ++pub const SYS_rt_sigprocmask: c_long = 135; ++pub const SYS_rt_sigpending: c_long = 136; ++pub const SYS_rt_sigtimedwait: c_long = 137; ++pub const SYS_rt_sigqueueinfo: c_long = 138; ++pub const SYS_rt_sigreturn: c_long = 139; ++pub const SYS_setpriority: c_long = 140; ++pub const SYS_getpriority: c_long = 141; ++pub const SYS_reboot: c_long = 142; ++pub const SYS_setregid: c_long = 143; ++pub const SYS_setgid: c_long = 144; ++pub const SYS_setreuid: c_long = 145; ++pub const SYS_setuid: c_long = 146; ++pub const SYS_setresuid: c_long = 147; ++pub const SYS_getresuid: c_long = 148; ++pub const SYS_setresgid: c_long = 149; ++pub const SYS_getresgid: c_long = 150; ++pub const SYS_setfsuid: c_long = 151; ++pub const SYS_setfsgid: c_long = 152; ++pub const SYS_times: c_long = 153; ++pub const SYS_setpgid: c_long = 154; ++pub const SYS_getpgid: c_long = 155; ++pub const SYS_getsid: c_long = 156; ++pub const SYS_setsid: c_long = 157; ++pub const SYS_getgroups: c_long = 158; ++pub const SYS_setgroups: c_long = 159; ++pub const SYS_uname: c_long = 160; ++pub const SYS_sethostname: c_long = 161; ++pub const SYS_setdomainname: c_long = 162; ++pub const SYS_getrlimit: c_long = 163; ++pub const SYS_setrlimit: c_long = 164; ++pub const SYS_getrusage: c_long = 165; ++pub const SYS_umask: c_long = 166; ++pub const SYS_prctl: c_long = 167; ++pub const SYS_getcpu: c_long = 168; ++pub const SYS_gettimeofday: c_long = 169; ++pub const SYS_settimeofday: c_long = 170; ++pub const SYS_adjtimex: c_long = 171; ++pub const SYS_getpid: c_long = 172; ++pub const SYS_getppid: c_long = 173; ++pub const SYS_getuid: c_long = 174; ++pub const SYS_geteuid: c_long = 175; ++pub const SYS_getgid: c_long = 176; ++pub const SYS_getegid: c_long = 177; ++pub const SYS_gettid: c_long = 178; ++pub const SYS_sysinfo: c_long = 179; ++pub const SYS_mq_open: c_long = 180; ++pub const SYS_mq_unlink: c_long = 181; ++pub const SYS_mq_timedsend: c_long = 182; ++pub const SYS_mq_timedreceive: c_long = 183; ++pub const SYS_mq_notify: c_long = 184; ++pub const SYS_mq_getsetattr: c_long = 185; ++pub const SYS_msgget: c_long = 186; ++pub const SYS_msgctl: c_long = 187; ++pub const SYS_msgrcv: c_long = 188; ++pub const SYS_msgsnd: c_long = 189; ++pub const SYS_semget: c_long = 190; ++pub const SYS_semctl: c_long = 191; ++pub const SYS_semtimedop: c_long = 192; ++pub const SYS_semop: c_long = 193; ++pub const SYS_shmget: c_long = 194; ++pub const SYS_shmctl: c_long = 195; ++pub const SYS_shmat: c_long = 196; ++pub const SYS_shmdt: c_long = 197; ++pub const SYS_socket: c_long = 198; ++pub const SYS_socketpair: c_long = 199; ++pub const SYS_bind: c_long = 200; ++pub const SYS_listen: c_long = 201; ++pub const SYS_accept: c_long = 202; ++pub const SYS_connect: c_long = 203; ++pub const SYS_getsockname: c_long = 204; ++pub const SYS_getpeername: c_long = 205; ++pub const SYS_sendto: c_long = 206; ++pub const SYS_recvfrom: c_long = 207; ++pub const SYS_setsockopt: c_long = 208; ++pub const SYS_getsockopt: c_long = 209; ++pub const SYS_shutdown: c_long = 210; ++pub const SYS_sendmsg: c_long = 211; ++pub const SYS_recvmsg: c_long = 212; ++pub const SYS_readahead: c_long = 213; ++pub const SYS_brk: c_long = 214; ++pub const SYS_munmap: c_long = 215; ++pub const SYS_mremap: c_long = 216; ++pub const SYS_add_key: c_long = 217; ++pub const SYS_request_key: c_long = 218; ++pub const SYS_keyctl: c_long = 219; ++pub const SYS_clone: c_long = 220; ++pub const SYS_execve: c_long = 221; ++pub const SYS_mmap: c_long = 222; ++pub const SYS_swapon: c_long = 224; ++pub const SYS_swapoff: c_long = 225; ++pub const SYS_mprotect: c_long = 226; ++pub const SYS_msync: c_long = 227; ++pub const SYS_mlock: c_long = 228; ++pub const SYS_munlock: c_long = 229; ++pub const SYS_mlockall: c_long = 230; ++pub const SYS_munlockall: c_long = 231; ++pub const SYS_mincore: c_long = 232; ++pub const SYS_madvise: c_long = 233; ++pub const SYS_remap_file_pages: c_long = 234; ++pub const SYS_mbind: c_long = 235; ++pub const SYS_get_mempolicy: c_long = 236; ++pub const SYS_set_mempolicy: c_long = 237; ++pub const SYS_migrate_pages: c_long = 238; ++pub const SYS_move_pages: c_long = 239; ++pub const SYS_rt_tgsigqueueinfo: c_long = 240; ++pub const SYS_perf_event_open: c_long = 241; ++pub const SYS_accept4: c_long = 242; ++pub const SYS_recvmmsg: c_long = 243; ++pub const SYS_arch_specific_syscall: c_long = 244; ++pub const SYS_wait4: c_long = 260; ++pub const SYS_prlimit64: c_long = 261; ++pub const SYS_fanotify_init: c_long = 262; ++pub const SYS_fanotify_mark: c_long = 263; ++pub const SYS_name_to_handle_at: c_long = 264; ++pub const SYS_open_by_handle_at: c_long = 265; ++pub const SYS_clock_adjtime: c_long = 266; ++pub const SYS_syncfs: c_long = 267; ++pub const SYS_setns: c_long = 268; ++pub const SYS_sendmmsg: c_long = 269; ++pub const SYS_process_vm_readv: c_long = 270; ++pub const SYS_process_vm_writev: c_long = 271; ++pub const SYS_kcmp: c_long = 272; ++pub const SYS_finit_module: c_long = 273; ++pub const SYS_sched_setattr: c_long = 274; ++pub const SYS_sched_getattr: c_long = 275; ++pub const SYS_renameat2: c_long = 276; ++pub const SYS_seccomp: c_long = 277; ++pub const SYS_getrandom: c_long = 278; ++pub const SYS_memfd_create: c_long = 279; ++pub const SYS_bpf: c_long = 280; ++pub const SYS_execveat: c_long = 281; ++pub const SYS_userfaultfd: c_long = 282; ++pub const SYS_membarrier: c_long = 283; ++pub const SYS_mlock2: c_long = 284; ++pub const SYS_copy_file_range: c_long = 285; ++pub const SYS_preadv2: c_long = 286; ++pub const SYS_pwritev2: c_long = 287; ++pub const SYS_pkey_mprotect: c_long = 288; ++pub const SYS_pkey_alloc: c_long = 289; ++pub const SYS_pkey_free: c_long = 290; ++pub const SYS_statx: c_long = 291; ++pub const SYS_pidfd_send_signal: c_long = 424; ++pub const SYS_io_uring_setup: c_long = 425; ++pub const SYS_io_uring_enter: c_long = 426; ++pub const SYS_io_uring_register: c_long = 427; ++pub const SYS_open_tree: c_long = 428; ++pub const SYS_move_mount: c_long = 429; ++pub const SYS_fsopen: c_long = 430; ++pub const SYS_fsconfig: c_long = 431; ++pub const SYS_fsmount: c_long = 432; ++pub const SYS_fspick: c_long = 433; ++pub const SYS_pidfd_open: c_long = 434; ++pub const SYS_clone3: c_long = 435; ++pub const SYS_close_range: c_long = 436; ++pub const SYS_openat2: c_long = 437; ++pub const SYS_pidfd_getfd: c_long = 438; ++pub const SYS_faccessat2: c_long = 439; ++pub const SYS_process_madvise: c_long = 440; ++pub const SYS_epoll_pwait2: c_long = 441; ++pub const SYS_mount_setattr: c_long = 442; ++pub const SYS_quotactl_fd: c_long = 443; ++pub const SYS_landlock_create_ruleset: c_long = 444; ++pub const SYS_landlock_add_rule: c_long = 445; ++pub const SYS_landlock_restrict_self: c_long = 446; ++pub const SYS_memfd_secret: c_long = 447; ++pub const SYS_process_mrelease: c_long = 448; ++pub const SYS_futex_waitv: c_long = 449; ++pub const SYS_set_mempolicy_home_node: c_long = 450; ++pub const SYS_syscalls: c_long = 451; ++ ++pub const PROT_BTI: c_int = 0x10; ++pub const PROT_MTE: c_int = 0x20; ++ ++// From NDK's asm/auxvec.h ++pub const AT_SYSINFO_EHDR: c_ulong = 33; ++pub const AT_VECTOR_SIZE_ARCH: c_ulong = 2; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/android/b64/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/android/b64/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/android/b64/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/android/b64/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,332 @@ ++use crate::prelude::*; ++ ++// The following definitions are correct for aarch64 and x86_64, ++// but may be wrong for mips64 ++ ++pub type c_long = i64; ++pub type c_ulong = u64; ++pub type mode_t = u32; ++pub type off64_t = i64; ++pub type socklen_t = u32; ++ ++s! { ++ pub struct sigset_t { ++ __val: [c_ulong; 1], ++ } ++ ++ pub struct sigaction { ++ pub sa_flags: c_int, ++ pub sa_sigaction: crate::sighandler_t, ++ pub sa_mask: crate::sigset_t, ++ pub sa_restorer: Option, ++ } ++ ++ pub struct rlimit64 { ++ pub rlim_cur: c_ulonglong, ++ pub rlim_max: c_ulonglong, ++ } ++ ++ pub struct pthread_attr_t { ++ pub flags: u32, ++ pub stack_base: *mut c_void, ++ pub stack_size: size_t, ++ pub guard_size: size_t, ++ pub sched_policy: i32, ++ pub sched_priority: i32, ++ __reserved: [c_char; 16], ++ } ++ ++ pub struct passwd { ++ pub pw_name: *mut c_char, ++ pub pw_passwd: *mut c_char, ++ pub pw_uid: crate::uid_t, ++ pub pw_gid: crate::gid_t, ++ pub pw_gecos: *mut c_char, ++ pub pw_dir: *mut c_char, ++ pub pw_shell: *mut c_char, ++ } ++ ++ pub struct statfs { ++ pub f_type: u64, ++ pub f_bsize: u64, ++ pub f_blocks: u64, ++ pub f_bfree: u64, ++ pub f_bavail: u64, ++ pub f_files: u64, ++ pub f_ffree: u64, ++ pub f_fsid: crate::__fsid_t, ++ pub f_namelen: u64, ++ pub f_frsize: u64, ++ pub f_flags: u64, ++ pub f_spare: [u64; 4], ++ } ++ ++ pub struct sysinfo { ++ pub uptime: c_long, ++ pub loads: [c_ulong; 3], ++ pub totalram: c_ulong, ++ pub freeram: c_ulong, ++ pub sharedram: c_ulong, ++ pub bufferram: c_ulong, ++ pub totalswap: c_ulong, ++ pub freeswap: c_ulong, ++ pub procs: c_ushort, ++ pub pad: c_ushort, ++ pub totalhigh: c_ulong, ++ pub freehigh: c_ulong, ++ pub mem_unit: c_uint, ++ pub _f: [c_char; 0], ++ } ++ ++ pub struct statfs64 { ++ pub f_type: u64, ++ pub f_bsize: u64, ++ pub f_blocks: u64, ++ pub f_bfree: u64, ++ pub f_bavail: u64, ++ pub f_files: u64, ++ pub f_ffree: u64, ++ pub f_fsid: crate::__fsid_t, ++ pub f_namelen: u64, ++ pub f_frsize: u64, ++ pub f_flags: u64, ++ pub f_spare: [u64; 4], ++ } ++ ++ pub struct statvfs64 { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: u64, ++ pub f_bfree: u64, ++ pub f_bavail: u64, ++ pub f_files: u64, ++ pub f_ffree: u64, ++ pub f_favail: u64, ++ pub f_fsid: c_ulong, ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ __f_spare: [c_int; 6], ++ } ++ ++ pub struct pthread_barrier_t { ++ __private: [i64; 4], ++ } ++ ++ pub struct pthread_spinlock_t { ++ __private: i64, ++ } ++} ++ ++s_no_extra_traits! { ++ pub struct pthread_mutex_t { ++ value: c_int, ++ __reserved: [c_char; 36], ++ } ++ ++ pub struct pthread_cond_t { ++ value: c_int, ++ __reserved: [c_char; 44], ++ } ++ ++ pub struct pthread_rwlock_t { ++ numLocks: c_int, ++ writerThreadId: c_int, ++ pendingReaders: c_int, ++ pendingWriters: c_int, ++ attr: i32, ++ __reserved: [c_char; 36], ++ } ++ ++ pub struct sigset64_t { ++ __bits: [c_ulong; 1], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for pthread_mutex_t { ++ fn eq(&self, other: &pthread_mutex_t) -> bool { ++ self.value == other.value ++ && self ++ .__reserved ++ .iter() ++ .zip(other.__reserved.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ ++ impl Eq for pthread_mutex_t {} ++ ++ impl fmt::Debug for pthread_mutex_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("pthread_mutex_t") ++ .field("value", &self.value) ++ // FIXME: .field("__reserved", &self.__reserved) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for pthread_mutex_t { ++ fn hash(&self, state: &mut H) { ++ self.value.hash(state); ++ self.__reserved.hash(state); ++ } ++ } ++ ++ impl PartialEq for pthread_cond_t { ++ fn eq(&self, other: &pthread_cond_t) -> bool { ++ self.value == other.value ++ && self ++ .__reserved ++ .iter() ++ .zip(other.__reserved.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ ++ impl Eq for pthread_cond_t {} ++ ++ impl fmt::Debug for pthread_cond_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("pthread_cond_t") ++ .field("value", &self.value) ++ // FIXME: .field("__reserved", &self.__reserved) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for pthread_cond_t { ++ fn hash(&self, state: &mut H) { ++ self.value.hash(state); ++ self.__reserved.hash(state); ++ } ++ } ++ ++ impl PartialEq for pthread_rwlock_t { ++ fn eq(&self, other: &pthread_rwlock_t) -> bool { ++ self.numLocks == other.numLocks ++ && self.writerThreadId == other.writerThreadId ++ && self.pendingReaders == other.pendingReaders ++ && self.pendingWriters == other.pendingWriters ++ && self.attr == other.attr ++ && self ++ .__reserved ++ .iter() ++ .zip(other.__reserved.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ ++ impl Eq for pthread_rwlock_t {} ++ ++ impl fmt::Debug for pthread_rwlock_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("pthread_rwlock_t") ++ .field("numLocks", &self.numLocks) ++ .field("writerThreadId", &self.writerThreadId) ++ .field("pendingReaders", &self.pendingReaders) ++ .field("pendingWriters", &self.pendingWriters) ++ .field("attr", &self.attr) ++ // FIXME: .field("__reserved", &self.__reserved) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for pthread_rwlock_t { ++ fn hash(&self, state: &mut H) { ++ self.numLocks.hash(state); ++ self.writerThreadId.hash(state); ++ self.pendingReaders.hash(state); ++ self.pendingWriters.hash(state); ++ self.attr.hash(state); ++ self.__reserved.hash(state); ++ } ++ } ++ ++ impl fmt::Debug for sigset64_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sigset64_t") ++ .field("__bits", &self.__bits) ++ .finish() ++ } ++ } ++ } ++} ++ ++// These constants must be of the same type of sigaction.sa_flags ++pub const SA_NOCLDSTOP: c_int = 0x00000001; ++pub const SA_NOCLDWAIT: c_int = 0x00000002; ++pub const SA_NODEFER: c_int = 0x40000000; ++pub const SA_ONSTACK: c_int = 0x08000000; ++pub const SA_RESETHAND: c_int = 0x80000000; ++pub const SA_RESTART: c_int = 0x10000000; ++pub const SA_SIGINFO: c_int = 0x00000004; ++ ++pub const RTLD_GLOBAL: c_int = 0x00100; ++pub const RTLD_NOW: c_int = 2; ++pub const RTLD_DEFAULT: *mut c_void = 0i64 as *mut c_void; ++ ++pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { ++ value: 0, ++ __reserved: [0; 36], ++}; ++pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { ++ value: 0, ++ __reserved: [0; 44], ++}; ++pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { ++ numLocks: 0, ++ writerThreadId: 0, ++ pendingReaders: 0, ++ pendingWriters: 0, ++ attr: 0, ++ __reserved: [0; 36], ++}; ++pub const PTHREAD_STACK_MIN: size_t = 4096 * 4; ++pub const CPU_SETSIZE: size_t = 1024; ++pub const __CPU_BITS: size_t = 64; ++ ++pub const UT_LINESIZE: usize = 32; ++pub const UT_NAMESIZE: usize = 32; ++pub const UT_HOSTSIZE: usize = 256; ++ ++f! { ++ // Sadly, Android before 5.0 (API level 21), the accept4 syscall is not ++ // exposed by the libc. As work-around, we implement it through `syscall` ++ // directly. This workaround can be removed if the minimum version of ++ // Android is bumped. When the workaround is removed, `accept4` can be ++ // moved back to `linux_like/mod.rs` ++ pub fn accept4( ++ fd: c_int, ++ addr: *mut crate::sockaddr, ++ len: *mut crate::socklen_t, ++ flg: c_int, ++ ) -> c_int { ++ crate::syscall(SYS_accept4, fd, addr, len, flg) as c_int ++ } ++} ++ ++extern "C" { ++ pub fn getauxval(type_: c_ulong) -> c_ulong; ++ pub fn __system_property_wait( ++ pi: *const crate::prop_info, ++ __old_serial: u32, ++ __new_serial_ptr: *mut u32, ++ __relative_timeout: *const crate::timespec, ++ ) -> bool; ++} ++ ++cfg_if! { ++ if #[cfg(target_arch = "x86_64")] { ++ mod x86_64; ++ pub use self::x86_64::*; ++ } 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 -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/android/b64/riscv64/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/android/b64/riscv64/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/android/b64/riscv64/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/android/b64/riscv64/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,386 @@ ++use crate::off64_t; ++use crate::prelude::*; ++ ++pub type c_char = u8; ++pub type wchar_t = u32; ++pub type greg_t = i64; ++pub type __u64 = c_ulonglong; ++pub type __s64 = c_longlong; ++ ++s! { ++ pub struct stat { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino_t, ++ pub st_mode: c_uint, ++ pub st_nlink: c_uint, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ __pad1: c_ulong, ++ pub st_size: off64_t, ++ pub st_blksize: c_int, ++ __pad2: c_int, ++ pub st_blocks: c_long, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ __unused4: c_uint, ++ __unused5: c_uint, ++ } ++ ++ pub struct stat64 { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino_t, ++ pub st_mode: c_uint, ++ pub st_nlink: c_uint, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ __pad1: c_ulong, ++ pub st_size: off64_t, ++ pub st_blksize: c_int, ++ __pad2: c_int, ++ pub st_blocks: c_long, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ __unused4: c_uint, ++ __unused5: c_uint, ++ } ++} ++ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ #[repr(align(16))] ++ pub struct max_align_t { ++ priv_: [f32; 8], ++ } ++} ++ ++pub const O_DIRECT: c_int = 0x40000; ++pub const O_DIRECTORY: c_int = 0x200000; ++pub const O_NOFOLLOW: c_int = 0x400000; ++pub const O_LARGEFILE: c_int = 0x100000; ++ ++pub const SIGSTKSZ: size_t = 8192; ++pub const MINSIGSTKSZ: size_t = 2048; ++ ++// From NDK's asm/hwcap.h ++pub const COMPAT_HWCAP_ISA_I: c_ulong = 1 << (b'I' - b'A'); ++pub const COMPAT_HWCAP_ISA_M: c_ulong = 1 << (b'M' - b'A'); ++pub const COMPAT_HWCAP_ISA_A: c_ulong = 1 << (b'A' - b'A'); ++pub const COMPAT_HWCAP_ISA_F: c_ulong = 1 << (b'F' - b'A'); ++pub const COMPAT_HWCAP_ISA_D: c_ulong = 1 << (b'D' - b'A'); ++pub const COMPAT_HWCAP_ISA_C: c_ulong = 1 << (b'C' - b'A'); ++ ++pub const SYS_io_setup: c_long = 0; ++pub const SYS_io_destroy: c_long = 1; ++pub const SYS_io_submit: c_long = 2; ++pub const SYS_io_cancel: c_long = 3; ++pub const SYS_io_getevents: c_long = 4; ++pub const SYS_setxattr: c_long = 5; ++pub const SYS_lsetxattr: c_long = 6; ++pub const SYS_fsetxattr: c_long = 7; ++pub const SYS_getxattr: c_long = 8; ++pub const SYS_lgetxattr: c_long = 9; ++pub const SYS_fgetxattr: c_long = 10; ++pub const SYS_listxattr: c_long = 11; ++pub const SYS_llistxattr: c_long = 12; ++pub const SYS_flistxattr: c_long = 13; ++pub const SYS_removexattr: c_long = 14; ++pub const SYS_lremovexattr: c_long = 15; ++pub const SYS_fremovexattr: c_long = 16; ++pub const SYS_getcwd: c_long = 17; ++pub const SYS_lookup_dcookie: c_long = 18; ++pub const SYS_eventfd2: c_long = 19; ++pub const SYS_epoll_create1: c_long = 20; ++pub const SYS_epoll_ctl: c_long = 21; ++pub const SYS_epoll_pwait: c_long = 22; ++pub const SYS_dup: c_long = 23; ++pub const SYS_dup3: c_long = 24; ++pub const SYS_inotify_init1: c_long = 26; ++pub const SYS_inotify_add_watch: c_long = 27; ++pub const SYS_inotify_rm_watch: c_long = 28; ++pub const SYS_ioctl: c_long = 29; ++pub const SYS_ioprio_set: c_long = 30; ++pub const SYS_ioprio_get: c_long = 31; ++pub const SYS_flock: c_long = 32; ++pub const SYS_mknodat: c_long = 33; ++pub const SYS_mkdirat: c_long = 34; ++pub const SYS_unlinkat: c_long = 35; ++pub const SYS_symlinkat: c_long = 36; ++pub const SYS_linkat: c_long = 37; ++pub const SYS_renameat: c_long = 38; ++pub const SYS_umount2: c_long = 39; ++pub const SYS_mount: c_long = 40; ++pub const SYS_pivot_root: c_long = 41; ++pub const SYS_nfsservctl: c_long = 42; ++pub const SYS_fallocate: c_long = 47; ++pub const SYS_faccessat: c_long = 48; ++pub const SYS_chdir: c_long = 49; ++pub const SYS_fchdir: c_long = 50; ++pub const SYS_chroot: c_long = 51; ++pub const SYS_fchmod: c_long = 52; ++pub const SYS_fchmodat: c_long = 53; ++pub const SYS_fchownat: c_long = 54; ++pub const SYS_fchown: c_long = 55; ++pub const SYS_openat: c_long = 56; ++pub const SYS_close: c_long = 57; ++pub const SYS_vhangup: c_long = 58; ++pub const SYS_pipe2: c_long = 59; ++pub const SYS_quotactl: c_long = 60; ++pub const SYS_getdents64: c_long = 61; ++pub const SYS_read: c_long = 63; ++pub const SYS_write: c_long = 64; ++pub const SYS_readv: c_long = 65; ++pub const SYS_writev: c_long = 66; ++pub const SYS_pread64: c_long = 67; ++pub const SYS_pwrite64: c_long = 68; ++pub const SYS_preadv: c_long = 69; ++pub const SYS_pwritev: c_long = 70; ++pub const SYS_pselect6: c_long = 72; ++pub const SYS_ppoll: c_long = 73; ++pub const SYS_signalfd4: c_long = 74; ++pub const SYS_vmsplice: c_long = 75; ++pub const SYS_splice: c_long = 76; ++pub const SYS_tee: c_long = 77; ++pub const SYS_readlinkat: c_long = 78; ++pub const SYS_sync: c_long = 81; ++pub const SYS_fsync: c_long = 82; ++pub const SYS_fdatasync: c_long = 83; ++pub const SYS_sync_file_range: c_long = 84; ++pub const SYS_timerfd_create: c_long = 85; ++pub const SYS_timerfd_settime: c_long = 86; ++pub const SYS_timerfd_gettime: c_long = 87; ++pub const SYS_utimensat: c_long = 88; ++pub const SYS_acct: c_long = 89; ++pub const SYS_capget: c_long = 90; ++pub const SYS_capset: c_long = 91; ++pub const SYS_personality: c_long = 92; ++pub const SYS_exit: c_long = 93; ++pub const SYS_exit_group: c_long = 94; ++pub const SYS_waitid: c_long = 95; ++pub const SYS_set_tid_address: c_long = 96; ++pub const SYS_unshare: c_long = 97; ++pub const SYS_futex: c_long = 98; ++pub const SYS_set_robust_list: c_long = 99; ++pub const SYS_get_robust_list: c_long = 100; ++pub const SYS_nanosleep: c_long = 101; ++pub const SYS_getitimer: c_long = 102; ++pub const SYS_setitimer: c_long = 103; ++pub const SYS_kexec_load: c_long = 104; ++pub const SYS_init_module: c_long = 105; ++pub const SYS_delete_module: c_long = 106; ++pub const SYS_timer_create: c_long = 107; ++pub const SYS_timer_gettime: c_long = 108; ++pub const SYS_timer_getoverrun: c_long = 109; ++pub const SYS_timer_settime: c_long = 110; ++pub const SYS_timer_delete: c_long = 111; ++pub const SYS_clock_settime: c_long = 112; ++pub const SYS_clock_gettime: c_long = 113; ++pub const SYS_clock_getres: c_long = 114; ++pub const SYS_clock_nanosleep: c_long = 115; ++pub const SYS_syslog: c_long = 116; ++pub const SYS_ptrace: c_long = 117; ++pub const SYS_sched_setparam: c_long = 118; ++pub const SYS_sched_setscheduler: c_long = 119; ++pub const SYS_sched_getscheduler: c_long = 120; ++pub const SYS_sched_getparam: c_long = 121; ++pub const SYS_sched_setaffinity: c_long = 122; ++pub const SYS_sched_getaffinity: c_long = 123; ++pub const SYS_sched_yield: c_long = 124; ++pub const SYS_sched_get_priority_max: c_long = 125; ++pub const SYS_sched_get_priority_min: c_long = 126; ++pub const SYS_sched_rr_get_interval: c_long = 127; ++pub const SYS_restart_syscall: c_long = 128; ++pub const SYS_kill: c_long = 129; ++pub const SYS_tkill: c_long = 130; ++pub const SYS_tgkill: c_long = 131; ++pub const SYS_sigaltstack: c_long = 132; ++pub const SYS_rt_sigsuspend: c_long = 133; ++pub const SYS_rt_sigaction: c_long = 134; ++pub const SYS_rt_sigprocmask: c_long = 135; ++pub const SYS_rt_sigpending: c_long = 136; ++pub const SYS_rt_sigtimedwait: c_long = 137; ++pub const SYS_rt_sigqueueinfo: c_long = 138; ++pub const SYS_rt_sigreturn: c_long = 139; ++pub const SYS_setpriority: c_long = 140; ++pub const SYS_getpriority: c_long = 141; ++pub const SYS_reboot: c_long = 142; ++pub const SYS_setregid: c_long = 143; ++pub const SYS_setgid: c_long = 144; ++pub const SYS_setreuid: c_long = 145; ++pub const SYS_setuid: c_long = 146; ++pub const SYS_setresuid: c_long = 147; ++pub const SYS_getresuid: c_long = 148; ++pub const SYS_setresgid: c_long = 149; ++pub const SYS_getresgid: c_long = 150; ++pub const SYS_setfsuid: c_long = 151; ++pub const SYS_setfsgid: c_long = 152; ++pub const SYS_times: c_long = 153; ++pub const SYS_setpgid: c_long = 154; ++pub const SYS_getpgid: c_long = 155; ++pub const SYS_getsid: c_long = 156; ++pub const SYS_setsid: c_long = 157; ++pub const SYS_getgroups: c_long = 158; ++pub const SYS_setgroups: c_long = 159; ++pub const SYS_uname: c_long = 160; ++pub const SYS_sethostname: c_long = 161; ++pub const SYS_setdomainname: c_long = 162; ++pub const SYS_getrlimit: c_long = 163; ++pub const SYS_setrlimit: c_long = 164; ++pub const SYS_getrusage: c_long = 165; ++pub const SYS_umask: c_long = 166; ++pub const SYS_prctl: c_long = 167; ++pub const SYS_getcpu: c_long = 168; ++pub const SYS_gettimeofday: c_long = 169; ++pub const SYS_settimeofday: c_long = 170; ++pub const SYS_adjtimex: c_long = 171; ++pub const SYS_getpid: c_long = 172; ++pub const SYS_getppid: c_long = 173; ++pub const SYS_getuid: c_long = 174; ++pub const SYS_geteuid: c_long = 175; ++pub const SYS_getgid: c_long = 176; ++pub const SYS_getegid: c_long = 177; ++pub const SYS_gettid: c_long = 178; ++pub const SYS_sysinfo: c_long = 179; ++pub const SYS_mq_open: c_long = 180; ++pub const SYS_mq_unlink: c_long = 181; ++pub const SYS_mq_timedsend: c_long = 182; ++pub const SYS_mq_timedreceive: c_long = 183; ++pub const SYS_mq_notify: c_long = 184; ++pub const SYS_mq_getsetattr: c_long = 185; ++pub const SYS_msgget: c_long = 186; ++pub const SYS_msgctl: c_long = 187; ++pub const SYS_msgrcv: c_long = 188; ++pub const SYS_msgsnd: c_long = 189; ++pub const SYS_semget: c_long = 190; ++pub const SYS_semctl: c_long = 191; ++pub const SYS_semtimedop: c_long = 192; ++pub const SYS_semop: c_long = 193; ++pub const SYS_shmget: c_long = 194; ++pub const SYS_shmctl: c_long = 195; ++pub const SYS_shmat: c_long = 196; ++pub const SYS_shmdt: c_long = 197; ++pub const SYS_socket: c_long = 198; ++pub const SYS_socketpair: c_long = 199; ++pub const SYS_bind: c_long = 200; ++pub const SYS_listen: c_long = 201; ++pub const SYS_accept: c_long = 202; ++pub const SYS_connect: c_long = 203; ++pub const SYS_getsockname: c_long = 204; ++pub const SYS_getpeername: c_long = 205; ++pub const SYS_sendto: c_long = 206; ++pub const SYS_recvfrom: c_long = 207; ++pub const SYS_setsockopt: c_long = 208; ++pub const SYS_getsockopt: c_long = 209; ++pub const SYS_shutdown: c_long = 210; ++pub const SYS_sendmsg: c_long = 211; ++pub const SYS_recvmsg: c_long = 212; ++pub const SYS_readahead: c_long = 213; ++pub const SYS_brk: c_long = 214; ++pub const SYS_munmap: c_long = 215; ++pub const SYS_mremap: c_long = 216; ++pub const SYS_add_key: c_long = 217; ++pub const SYS_request_key: c_long = 218; ++pub const SYS_keyctl: c_long = 219; ++pub const SYS_clone: c_long = 220; ++pub const SYS_execve: c_long = 221; ++pub const SYS_swapon: c_long = 224; ++pub const SYS_swapoff: c_long = 225; ++pub const SYS_mprotect: c_long = 226; ++pub const SYS_msync: c_long = 227; ++pub const SYS_mlock: c_long = 228; ++pub const SYS_munlock: c_long = 229; ++pub const SYS_mlockall: c_long = 230; ++pub const SYS_munlockall: c_long = 231; ++pub const SYS_mincore: c_long = 232; ++pub const SYS_madvise: c_long = 233; ++pub const SYS_remap_file_pages: c_long = 234; ++pub const SYS_mbind: c_long = 235; ++pub const SYS_get_mempolicy: c_long = 236; ++pub const SYS_set_mempolicy: c_long = 237; ++pub const SYS_migrate_pages: c_long = 238; ++pub const SYS_move_pages: c_long = 239; ++pub const SYS_rt_tgsigqueueinfo: c_long = 240; ++pub const SYS_perf_event_open: c_long = 241; ++pub const SYS_accept4: c_long = 242; ++pub const SYS_recvmmsg: c_long = 243; ++pub const SYS_arch_specific_syscall: c_long = 244; ++pub const SYS_wait4: c_long = 260; ++pub const SYS_prlimit64: c_long = 261; ++pub const SYS_fanotify_init: c_long = 262; ++pub const SYS_fanotify_mark: c_long = 263; ++pub const SYS_name_to_handle_at: c_long = 264; ++pub const SYS_open_by_handle_at: c_long = 265; ++pub const SYS_clock_adjtime: c_long = 266; ++pub const SYS_syncfs: c_long = 267; ++pub const SYS_setns: c_long = 268; ++pub const SYS_sendmmsg: c_long = 269; ++pub const SYS_process_vm_readv: c_long = 270; ++pub const SYS_process_vm_writev: c_long = 271; ++pub const SYS_kcmp: c_long = 272; ++pub const SYS_finit_module: c_long = 273; ++pub const SYS_sched_setattr: c_long = 274; ++pub const SYS_sched_getattr: c_long = 275; ++pub const SYS_renameat2: c_long = 276; ++pub const SYS_seccomp: c_long = 277; ++pub const SYS_getrandom: c_long = 278; ++pub const SYS_memfd_create: c_long = 279; ++pub const SYS_bpf: c_long = 280; ++pub const SYS_execveat: c_long = 281; ++pub const SYS_userfaultfd: c_long = 282; ++pub const SYS_membarrier: c_long = 283; ++pub const SYS_mlock2: c_long = 284; ++pub const SYS_copy_file_range: c_long = 285; ++pub const SYS_preadv2: c_long = 286; ++pub const SYS_pwritev2: c_long = 287; ++pub const SYS_pkey_mprotect: c_long = 288; ++pub const SYS_pkey_alloc: c_long = 289; ++pub const SYS_pkey_free: c_long = 290; ++pub const SYS_statx: c_long = 291; ++pub const SYS_pidfd_send_signal: c_long = 424; ++pub const SYS_io_uring_setup: c_long = 425; ++pub const SYS_io_uring_enter: c_long = 426; ++pub const SYS_io_uring_register: c_long = 427; ++pub const SYS_open_tree: c_long = 428; ++pub const SYS_move_mount: c_long = 429; ++pub const SYS_fsopen: c_long = 430; ++pub const SYS_fsconfig: c_long = 431; ++pub const SYS_fsmount: c_long = 432; ++pub const SYS_fspick: c_long = 433; ++pub const SYS_pidfd_open: c_long = 434; ++pub const SYS_clone3: c_long = 435; ++pub const SYS_close_range: c_long = 436; ++pub const SYS_openat2: c_long = 437; ++pub const SYS_pidfd_getfd: c_long = 438; ++pub const SYS_faccessat2: c_long = 439; ++pub const SYS_process_madvise: c_long = 440; ++pub const SYS_epoll_pwait2: c_long = 441; ++pub const SYS_mount_setattr: c_long = 442; ++pub const SYS_quotactl_fd: c_long = 443; ++pub const SYS_landlock_create_ruleset: c_long = 444; ++pub const SYS_landlock_add_rule: c_long = 445; ++pub const SYS_landlock_restrict_self: c_long = 446; ++pub const SYS_memfd_secret: c_long = 447; ++pub const SYS_process_mrelease: c_long = 448; ++pub const SYS_futex_waitv: c_long = 449; ++pub const SYS_set_mempolicy_home_node: c_long = 450; ++ ++// From NDK's asm/auxvec.h ++pub const AT_SYSINFO_EHDR: c_ulong = 33; ++pub const AT_L1I_CACHESIZE: c_ulong = 40; ++pub const AT_L1I_CACHEGEOMETRY: c_ulong = 41; ++pub const AT_L1D_CACHESIZE: c_ulong = 42; ++pub const AT_L1D_CACHEGEOMETRY: c_ulong = 43; ++pub const AT_L2_CACHESIZE: c_ulong = 44; ++pub const AT_L2_CACHEGEOMETRY: c_ulong = 45; ++pub const AT_L3_CACHESIZE: c_ulong = 46; ++pub const AT_L3_CACHEGEOMETRY: c_ulong = 47; ++pub const AT_VECTOR_SIZE_ARCH: c_ulong = 9; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/android/b64/x86_64/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/android/b64/x86_64/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/android/b64/x86_64/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/android/b64/x86_64/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,812 @@ ++use crate::off64_t; ++use crate::prelude::*; ++ ++pub type c_char = i8; ++pub type wchar_t = i32; ++pub type greg_t = i64; ++pub type __u64 = c_ulonglong; ++pub type __s64 = c_longlong; ++ ++s! { ++ pub struct stat { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino_t, ++ pub st_nlink: c_ulong, ++ pub st_mode: c_uint, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ pub st_size: off64_t, ++ pub st_blksize: c_long, ++ pub st_blocks: c_long, ++ pub st_atime: c_long, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: c_long, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: c_long, ++ pub st_ctime_nsec: c_long, ++ __unused: [c_long; 3], ++ } ++ ++ pub struct stat64 { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino_t, ++ pub st_nlink: c_ulong, ++ pub st_mode: c_uint, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ pub st_size: off64_t, ++ pub st_blksize: c_long, ++ pub st_blocks: c_long, ++ pub st_atime: c_long, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: c_long, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: c_long, ++ pub st_ctime_nsec: c_long, ++ __unused: [c_long; 3], ++ } ++ ++ pub struct _libc_xmmreg { ++ pub element: [u32; 4], ++ } ++ ++ pub struct user_regs_struct { ++ pub r15: c_ulong, ++ pub r14: c_ulong, ++ pub r13: c_ulong, ++ pub r12: c_ulong, ++ pub rbp: c_ulong, ++ pub rbx: c_ulong, ++ pub r11: c_ulong, ++ pub r10: c_ulong, ++ pub r9: c_ulong, ++ pub r8: c_ulong, ++ pub rax: c_ulong, ++ pub rcx: c_ulong, ++ pub rdx: c_ulong, ++ pub rsi: c_ulong, ++ pub rdi: c_ulong, ++ pub orig_rax: c_ulong, ++ pub rip: c_ulong, ++ pub cs: c_ulong, ++ pub eflags: c_ulong, ++ pub rsp: c_ulong, ++ pub ss: c_ulong, ++ pub fs_base: c_ulong, ++ pub gs_base: c_ulong, ++ pub ds: c_ulong, ++ pub es: c_ulong, ++ pub fs: c_ulong, ++ pub gs: c_ulong, ++ } ++ ++ pub struct user { ++ pub regs: user_regs_struct, ++ pub u_fpvalid: c_int, ++ pub i387: user_fpregs_struct, ++ pub u_tsize: c_ulong, ++ pub u_dsize: c_ulong, ++ pub u_ssize: c_ulong, ++ pub start_code: c_ulong, ++ pub start_stack: c_ulong, ++ pub signal: c_long, ++ __reserved: c_int, ++ #[cfg(target_pointer_width = "32")] ++ __pad1: u32, ++ pub u_ar0: *mut user_regs_struct, ++ #[cfg(target_pointer_width = "32")] ++ __pad2: u32, ++ pub u_fpstate: *mut user_fpregs_struct, ++ pub magic: c_ulong, ++ pub u_comm: [c_char; 32], ++ pub u_debugreg: [c_ulong; 8], ++ pub error_code: c_ulong, ++ pub fault_address: c_ulong, ++ } ++} ++ ++s_no_extra_traits! { ++ pub union __c_anonymous_uc_sigmask { ++ uc_sigmask: crate::sigset_t, ++ uc_sigmask64: crate::sigset64_t, ++ } ++ ++ #[allow(missing_debug_implementations)] ++ #[repr(align(16))] ++ pub struct max_align_t { ++ priv_: [f64; 4], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for __c_anonymous_uc_sigmask { ++ fn eq(&self, other: &__c_anonymous_uc_sigmask) -> bool { ++ unsafe { self.uc_sigmask == other.uc_sigmask } ++ } ++ } ++ impl Eq for __c_anonymous_uc_sigmask {} ++ impl hash::Hash for __c_anonymous_uc_sigmask { ++ fn hash(&self, state: &mut H) { ++ unsafe { self.uc_sigmask.hash(state) } ++ } ++ } ++ } ++} ++ ++s_no_extra_traits! { ++ pub struct _libc_fpxreg { ++ pub significand: [u16; 4], ++ pub exponent: u16, ++ __padding: [u16; 3], ++ } ++ ++ pub struct _libc_fpstate { ++ pub cwd: u16, ++ pub swd: u16, ++ pub ftw: u16, ++ pub fop: u16, ++ pub rip: u64, ++ pub rdp: u64, ++ pub mxcsr: u32, ++ pub mxcr_mask: u32, ++ pub _st: [_libc_fpxreg; 8], ++ pub _xmm: [_libc_xmmreg; 16], ++ __private: [u32; 24], ++ } ++ ++ pub struct mcontext_t { ++ pub gregs: [greg_t; 23], ++ pub fpregs: *mut _libc_fpstate, ++ __private: [u64; 8], ++ } ++ ++ pub struct ucontext_t { ++ pub uc_flags: c_ulong, ++ pub uc_link: *mut ucontext_t, ++ pub uc_stack: crate::stack_t, ++ pub uc_mcontext: mcontext_t, ++ pub uc_sigmask64: __c_anonymous_uc_sigmask, ++ __fpregs_mem: _libc_fpstate, ++ } ++ ++ pub struct user_fpregs_struct { ++ pub cwd: c_ushort, ++ pub swd: c_ushort, ++ pub ftw: c_ushort, ++ pub fop: c_ushort, ++ pub rip: c_ulong, ++ pub rdp: c_ulong, ++ pub mxcsr: c_uint, ++ pub mxcr_mask: c_uint, ++ pub st_space: [c_uint; 32], ++ pub xmm_space: [c_uint; 64], ++ padding: [c_uint; 24], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for _libc_fpxreg { ++ fn eq(&self, other: &Self) -> bool { ++ self.significand == other.significand && self.exponent == other.exponent ++ // Ignore padding field ++ } ++ } ++ impl Eq for _libc_fpxreg {} ++ impl fmt::Debug for _libc_fpxreg { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("_libc_fpxreg") ++ .field("significand", &self.significand) ++ .field("exponent", &self.exponent) ++ // Ignore padding field ++ .finish() ++ } ++ } ++ impl hash::Hash for _libc_fpxreg { ++ fn hash(&self, state: &mut H) { ++ self.significand.hash(state); ++ self.exponent.hash(state); ++ // Ignore padding field ++ } ++ } ++ ++ impl PartialEq for _libc_fpstate { ++ fn eq(&self, other: &Self) -> bool { ++ self.cwd == other.cwd ++ && self.swd == other.swd ++ && self.ftw == other.ftw ++ && self.fop == other.fop ++ && self.rip == other.rip ++ && self.rdp == other.rdp ++ && self.mxcsr == other.mxcsr ++ && self.mxcr_mask == other.mxcr_mask ++ && self._st == other._st ++ && self._xmm == other._xmm ++ // Ignore padding field ++ } ++ } ++ impl Eq for _libc_fpstate {} ++ impl fmt::Debug for _libc_fpstate { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("_libc_fpstate") ++ .field("cwd", &self.cwd) ++ .field("swd", &self.swd) ++ .field("ftw", &self.ftw) ++ .field("fop", &self.fop) ++ .field("rip", &self.rip) ++ .field("rdp", &self.rdp) ++ .field("mxcsr", &self.mxcsr) ++ .field("mxcr_mask", &self.mxcr_mask) ++ .field("_st", &self._st) ++ .field("_xmm", &self._xmm) ++ // Ignore padding field ++ .finish() ++ } ++ } ++ impl hash::Hash for _libc_fpstate { ++ 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); ++ self.rdp.hash(state); ++ self.mxcsr.hash(state); ++ self.mxcr_mask.hash(state); ++ self._st.hash(state); ++ self._xmm.hash(state); ++ // Ignore padding field ++ } ++ } ++ ++ impl PartialEq for mcontext_t { ++ fn eq(&self, other: &Self) -> bool { ++ self.gregs == other.gregs && self.fpregs == other.fpregs ++ // Ignore padding field ++ } ++ } ++ impl Eq for mcontext_t {} ++ impl fmt::Debug for mcontext_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("mcontext_t") ++ .field("gregs", &self.gregs) ++ .field("fpregs", &self.fpregs) ++ // Ignore padding field ++ .finish() ++ } ++ } ++ impl hash::Hash for mcontext_t { ++ fn hash(&self, state: &mut H) { ++ self.gregs.hash(state); ++ self.fpregs.hash(state); ++ // Ignore padding field ++ } ++ } ++ ++ impl PartialEq for ucontext_t { ++ fn eq(&self, other: &Self) -> bool { ++ self.uc_flags == other.uc_flags ++ && self.uc_link == other.uc_link ++ && self.uc_stack == other.uc_stack ++ && self.uc_mcontext == other.uc_mcontext ++ && self.uc_sigmask64 == other.uc_sigmask64 ++ // Ignore padding field ++ } ++ } ++ impl Eq for ucontext_t {} ++ impl fmt::Debug for ucontext_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("ucontext_t") ++ .field("uc_flags", &self.uc_flags) ++ .field("uc_link", &self.uc_link) ++ .field("uc_stack", &self.uc_stack) ++ .field("uc_mcontext", &self.uc_mcontext) ++ .field("uc_sigmask64", &self.uc_sigmask64) ++ // Ignore padding field ++ .finish() ++ } ++ } ++ impl hash::Hash for ucontext_t { ++ fn hash(&self, state: &mut H) { ++ self.uc_flags.hash(state); ++ self.uc_link.hash(state); ++ self.uc_stack.hash(state); ++ self.uc_mcontext.hash(state); ++ self.uc_sigmask64.hash(state); ++ // Ignore padding field ++ } ++ } ++ ++ impl PartialEq for user_fpregs_struct { ++ fn eq(&self, other: &user_fpregs_struct) -> bool { ++ self.cwd == other.cwd ++ && self.swd == other.swd ++ && self.ftw == other.ftw ++ && self.fop == other.fop ++ && self.rip == other.rip ++ && self.rdp == other.rdp ++ && self.mxcsr == other.mxcsr ++ && self.mxcr_mask == other.mxcr_mask ++ && self.st_space == other.st_space ++ && self ++ .xmm_space ++ .iter() ++ .zip(other.xmm_space.iter()) ++ .all(|(a, b)| a == b) ++ // Ignore padding field ++ } ++ } ++ ++ impl Eq for user_fpregs_struct {} ++ ++ impl fmt::Debug for user_fpregs_struct { ++ 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) ++ .field("rdp", &self.rdp) ++ .field("mxcsr", &self.mxcsr) ++ .field("mxcr_mask", &self.mxcr_mask) ++ .field("st_space", &self.st_space) ++ // FIXME: .field("xmm_space", &self.xmm_space) ++ // Ignore padding field ++ .finish() ++ } ++ } ++ ++ 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); ++ self.rdp.hash(state); ++ self.mxcsr.hash(state); ++ self.mxcr_mask.hash(state); ++ self.st_space.hash(state); ++ self.xmm_space.hash(state); ++ // Ignore padding field ++ } ++ } ++ } ++} ++ ++pub const O_DIRECT: c_int = 0x4000; ++pub const O_DIRECTORY: c_int = 0x10000; ++pub const O_NOFOLLOW: c_int = 0x20000; ++pub const O_LARGEFILE: c_int = 0o0100000; ++ ++pub const SIGSTKSZ: size_t = 8192; ++pub const MINSIGSTKSZ: size_t = 2048; ++ ++pub const MAP_32BIT: c_int = 0x40; ++ ++// Syscall table ++ ++pub const SYS_read: c_long = 0; ++pub const SYS_write: c_long = 1; ++pub const SYS_open: c_long = 2; ++pub const SYS_close: c_long = 3; ++pub const SYS_stat: c_long = 4; ++pub const SYS_fstat: c_long = 5; ++pub const SYS_lstat: c_long = 6; ++pub const SYS_poll: c_long = 7; ++pub const SYS_lseek: c_long = 8; ++pub const SYS_mmap: c_long = 9; ++pub const SYS_mprotect: c_long = 10; ++pub const SYS_munmap: c_long = 11; ++pub const SYS_brk: c_long = 12; ++pub const SYS_rt_sigaction: c_long = 13; ++pub const SYS_rt_sigprocmask: c_long = 14; ++pub const SYS_rt_sigreturn: c_long = 15; ++pub const SYS_ioctl: c_long = 16; ++pub const SYS_pread64: c_long = 17; ++pub const SYS_pwrite64: c_long = 18; ++pub const SYS_readv: c_long = 19; ++pub const SYS_writev: c_long = 20; ++pub const SYS_access: c_long = 21; ++pub const SYS_pipe: c_long = 22; ++pub const SYS_select: c_long = 23; ++pub const SYS_sched_yield: c_long = 24; ++pub const SYS_mremap: c_long = 25; ++pub const SYS_msync: c_long = 26; ++pub const SYS_mincore: c_long = 27; ++pub const SYS_madvise: c_long = 28; ++pub const SYS_shmget: c_long = 29; ++pub const SYS_shmat: c_long = 30; ++pub const SYS_shmctl: c_long = 31; ++pub const SYS_dup: c_long = 32; ++pub const SYS_dup2: c_long = 33; ++pub const SYS_pause: c_long = 34; ++pub const SYS_nanosleep: c_long = 35; ++pub const SYS_getitimer: c_long = 36; ++pub const SYS_alarm: c_long = 37; ++pub const SYS_setitimer: c_long = 38; ++pub const SYS_getpid: c_long = 39; ++pub const SYS_sendfile: c_long = 40; ++pub const SYS_socket: c_long = 41; ++pub const SYS_connect: c_long = 42; ++pub const SYS_accept: c_long = 43; ++pub const SYS_sendto: c_long = 44; ++pub const SYS_recvfrom: c_long = 45; ++pub const SYS_sendmsg: c_long = 46; ++pub const SYS_recvmsg: c_long = 47; ++pub const SYS_shutdown: c_long = 48; ++pub const SYS_bind: c_long = 49; ++pub const SYS_listen: c_long = 50; ++pub const SYS_getsockname: c_long = 51; ++pub const SYS_getpeername: c_long = 52; ++pub const SYS_socketpair: c_long = 53; ++pub const SYS_setsockopt: c_long = 54; ++pub const SYS_getsockopt: c_long = 55; ++pub const SYS_clone: c_long = 56; ++pub const SYS_fork: c_long = 57; ++pub const SYS_vfork: c_long = 58; ++pub const SYS_execve: c_long = 59; ++pub const SYS_exit: c_long = 60; ++pub const SYS_wait4: c_long = 61; ++pub const SYS_kill: c_long = 62; ++pub const SYS_uname: c_long = 63; ++pub const SYS_semget: c_long = 64; ++pub const SYS_semop: c_long = 65; ++pub const SYS_semctl: c_long = 66; ++pub const SYS_shmdt: c_long = 67; ++pub const SYS_msgget: c_long = 68; ++pub const SYS_msgsnd: c_long = 69; ++pub const SYS_msgrcv: c_long = 70; ++pub const SYS_msgctl: c_long = 71; ++pub const SYS_fcntl: c_long = 72; ++pub const SYS_flock: c_long = 73; ++pub const SYS_fsync: c_long = 74; ++pub const SYS_fdatasync: c_long = 75; ++pub const SYS_truncate: c_long = 76; ++pub const SYS_ftruncate: c_long = 77; ++pub const SYS_getdents: c_long = 78; ++pub const SYS_getcwd: c_long = 79; ++pub const SYS_chdir: c_long = 80; ++pub const SYS_fchdir: c_long = 81; ++pub const SYS_rename: c_long = 82; ++pub const SYS_mkdir: c_long = 83; ++pub const SYS_rmdir: c_long = 84; ++pub const SYS_creat: c_long = 85; ++pub const SYS_link: c_long = 86; ++pub const SYS_unlink: c_long = 87; ++pub const SYS_symlink: c_long = 88; ++pub const SYS_readlink: c_long = 89; ++pub const SYS_chmod: c_long = 90; ++pub const SYS_fchmod: c_long = 91; ++pub const SYS_chown: c_long = 92; ++pub const SYS_fchown: c_long = 93; ++pub const SYS_lchown: c_long = 94; ++pub const SYS_umask: c_long = 95; ++pub const SYS_gettimeofday: c_long = 96; ++pub const SYS_getrlimit: c_long = 97; ++pub const SYS_getrusage: c_long = 98; ++pub const SYS_sysinfo: c_long = 99; ++pub const SYS_times: c_long = 100; ++pub const SYS_ptrace: c_long = 101; ++pub const SYS_getuid: c_long = 102; ++pub const SYS_syslog: c_long = 103; ++pub const SYS_getgid: c_long = 104; ++pub const SYS_setuid: c_long = 105; ++pub const SYS_setgid: c_long = 106; ++pub const SYS_geteuid: c_long = 107; ++pub const SYS_getegid: c_long = 108; ++pub const SYS_setpgid: c_long = 109; ++pub const SYS_getppid: c_long = 110; ++pub const SYS_getpgrp: c_long = 111; ++pub const SYS_setsid: c_long = 112; ++pub const SYS_setreuid: c_long = 113; ++pub const SYS_setregid: c_long = 114; ++pub const SYS_getgroups: c_long = 115; ++pub const SYS_setgroups: c_long = 116; ++pub const SYS_setresuid: c_long = 117; ++pub const SYS_getresuid: c_long = 118; ++pub const SYS_setresgid: c_long = 119; ++pub const SYS_getresgid: c_long = 120; ++pub const SYS_getpgid: c_long = 121; ++pub const SYS_setfsuid: c_long = 122; ++pub const SYS_setfsgid: c_long = 123; ++pub const SYS_getsid: c_long = 124; ++pub const SYS_capget: c_long = 125; ++pub const SYS_capset: c_long = 126; ++pub const SYS_rt_sigpending: c_long = 127; ++pub const SYS_rt_sigtimedwait: c_long = 128; ++pub const SYS_rt_sigqueueinfo: c_long = 129; ++pub const SYS_rt_sigsuspend: c_long = 130; ++pub const SYS_sigaltstack: c_long = 131; ++pub const SYS_utime: c_long = 132; ++pub const SYS_mknod: c_long = 133; ++pub const SYS_uselib: c_long = 134; ++pub const SYS_personality: c_long = 135; ++pub const SYS_ustat: c_long = 136; ++pub const SYS_statfs: c_long = 137; ++pub const SYS_fstatfs: c_long = 138; ++pub const SYS_sysfs: c_long = 139; ++pub const SYS_getpriority: c_long = 140; ++pub const SYS_setpriority: c_long = 141; ++pub const SYS_sched_setparam: c_long = 142; ++pub const SYS_sched_getparam: c_long = 143; ++pub const SYS_sched_setscheduler: c_long = 144; ++pub const SYS_sched_getscheduler: c_long = 145; ++pub const SYS_sched_get_priority_max: c_long = 146; ++pub const SYS_sched_get_priority_min: c_long = 147; ++pub const SYS_sched_rr_get_interval: c_long = 148; ++pub const SYS_mlock: c_long = 149; ++pub const SYS_munlock: c_long = 150; ++pub const SYS_mlockall: c_long = 151; ++pub const SYS_munlockall: c_long = 152; ++pub const SYS_vhangup: c_long = 153; ++pub const SYS_modify_ldt: c_long = 154; ++pub const SYS_pivot_root: c_long = 155; ++// FIXME: SYS__sysctl is in the NDK sources but for some reason is ++// not available in the tests ++// pub const SYS__sysctl: c_long = 156; ++pub const SYS_prctl: c_long = 157; ++pub const SYS_arch_prctl: c_long = 158; ++pub const SYS_adjtimex: c_long = 159; ++pub const SYS_setrlimit: c_long = 160; ++pub const SYS_chroot: c_long = 161; ++pub const SYS_sync: c_long = 162; ++pub const SYS_acct: c_long = 163; ++pub const SYS_settimeofday: c_long = 164; ++pub const SYS_mount: c_long = 165; ++pub const SYS_umount2: c_long = 166; ++pub const SYS_swapon: c_long = 167; ++pub const SYS_swapoff: c_long = 168; ++pub const SYS_reboot: c_long = 169; ++pub const SYS_sethostname: c_long = 170; ++pub const SYS_setdomainname: c_long = 171; ++pub const SYS_iopl: c_long = 172; ++pub const SYS_ioperm: c_long = 173; ++pub const SYS_create_module: c_long = 174; ++pub const SYS_init_module: c_long = 175; ++pub const SYS_delete_module: c_long = 176; ++pub const SYS_get_kernel_syms: c_long = 177; ++pub const SYS_query_module: c_long = 178; ++pub const SYS_quotactl: c_long = 179; ++pub const SYS_nfsservctl: c_long = 180; ++pub const SYS_getpmsg: c_long = 181; ++pub const SYS_putpmsg: c_long = 182; ++pub const SYS_afs_syscall: c_long = 183; ++pub const SYS_tuxcall: c_long = 184; ++pub const SYS_security: c_long = 185; ++pub const SYS_gettid: c_long = 186; ++pub const SYS_readahead: c_long = 187; ++pub const SYS_setxattr: c_long = 188; ++pub const SYS_lsetxattr: c_long = 189; ++pub const SYS_fsetxattr: c_long = 190; ++pub const SYS_getxattr: c_long = 191; ++pub const SYS_lgetxattr: c_long = 192; ++pub const SYS_fgetxattr: c_long = 193; ++pub const SYS_listxattr: c_long = 194; ++pub const SYS_llistxattr: c_long = 195; ++pub const SYS_flistxattr: c_long = 196; ++pub const SYS_removexattr: c_long = 197; ++pub const SYS_lremovexattr: c_long = 198; ++pub const SYS_fremovexattr: c_long = 199; ++pub const SYS_tkill: c_long = 200; ++pub const SYS_time: c_long = 201; ++pub const SYS_futex: c_long = 202; ++pub const SYS_sched_setaffinity: c_long = 203; ++pub const SYS_sched_getaffinity: c_long = 204; ++pub const SYS_set_thread_area: c_long = 205; ++pub const SYS_io_setup: c_long = 206; ++pub const SYS_io_destroy: c_long = 207; ++pub const SYS_io_getevents: c_long = 208; ++pub const SYS_io_submit: c_long = 209; ++pub const SYS_io_cancel: c_long = 210; ++pub const SYS_get_thread_area: c_long = 211; ++pub const SYS_lookup_dcookie: c_long = 212; ++pub const SYS_epoll_create: c_long = 213; ++pub const SYS_epoll_ctl_old: c_long = 214; ++pub const SYS_epoll_wait_old: c_long = 215; ++pub const SYS_remap_file_pages: c_long = 216; ++pub const SYS_getdents64: c_long = 217; ++pub const SYS_set_tid_address: c_long = 218; ++pub const SYS_restart_syscall: c_long = 219; ++pub const SYS_semtimedop: c_long = 220; ++pub const SYS_fadvise64: c_long = 221; ++pub const SYS_timer_create: c_long = 222; ++pub const SYS_timer_settime: c_long = 223; ++pub const SYS_timer_gettime: c_long = 224; ++pub const SYS_timer_getoverrun: c_long = 225; ++pub const SYS_timer_delete: c_long = 226; ++pub const SYS_clock_settime: c_long = 227; ++pub const SYS_clock_gettime: c_long = 228; ++pub const SYS_clock_getres: c_long = 229; ++pub const SYS_clock_nanosleep: c_long = 230; ++pub const SYS_exit_group: c_long = 231; ++pub const SYS_epoll_wait: c_long = 232; ++pub const SYS_epoll_ctl: c_long = 233; ++pub const SYS_tgkill: c_long = 234; ++pub const SYS_utimes: c_long = 235; ++pub const SYS_vserver: c_long = 236; ++pub const SYS_mbind: c_long = 237; ++pub const SYS_set_mempolicy: c_long = 238; ++pub const SYS_get_mempolicy: c_long = 239; ++pub const SYS_mq_open: c_long = 240; ++pub const SYS_mq_unlink: c_long = 241; ++pub const SYS_mq_timedsend: c_long = 242; ++pub const SYS_mq_timedreceive: c_long = 243; ++pub const SYS_mq_notify: c_long = 244; ++pub const SYS_mq_getsetattr: c_long = 245; ++pub const SYS_kexec_load: c_long = 246; ++pub const SYS_waitid: c_long = 247; ++pub const SYS_add_key: c_long = 248; ++pub const SYS_request_key: c_long = 249; ++pub const SYS_keyctl: c_long = 250; ++pub const SYS_ioprio_set: c_long = 251; ++pub const SYS_ioprio_get: c_long = 252; ++pub const SYS_inotify_init: c_long = 253; ++pub const SYS_inotify_add_watch: c_long = 254; ++pub const SYS_inotify_rm_watch: c_long = 255; ++pub const SYS_migrate_pages: c_long = 256; ++pub const SYS_openat: c_long = 257; ++pub const SYS_mkdirat: c_long = 258; ++pub const SYS_mknodat: c_long = 259; ++pub const SYS_fchownat: c_long = 260; ++pub const SYS_futimesat: c_long = 261; ++pub const SYS_newfstatat: c_long = 262; ++pub const SYS_unlinkat: c_long = 263; ++pub const SYS_renameat: c_long = 264; ++pub const SYS_linkat: c_long = 265; ++pub const SYS_symlinkat: c_long = 266; ++pub const SYS_readlinkat: c_long = 267; ++pub const SYS_fchmodat: c_long = 268; ++pub const SYS_faccessat: c_long = 269; ++pub const SYS_pselect6: c_long = 270; ++pub const SYS_ppoll: c_long = 271; ++pub const SYS_unshare: c_long = 272; ++pub const SYS_set_robust_list: c_long = 273; ++pub const SYS_get_robust_list: c_long = 274; ++pub const SYS_splice: c_long = 275; ++pub const SYS_tee: c_long = 276; ++pub const SYS_sync_file_range: c_long = 277; ++pub const SYS_vmsplice: c_long = 278; ++pub const SYS_move_pages: c_long = 279; ++pub const SYS_utimensat: c_long = 280; ++pub const SYS_epoll_pwait: c_long = 281; ++pub const SYS_signalfd: c_long = 282; ++pub const SYS_timerfd_create: c_long = 283; ++pub const SYS_eventfd: c_long = 284; ++pub const SYS_fallocate: c_long = 285; ++pub const SYS_timerfd_settime: c_long = 286; ++pub const SYS_timerfd_gettime: c_long = 287; ++pub const SYS_accept4: c_long = 288; ++pub const SYS_signalfd4: c_long = 289; ++pub const SYS_eventfd2: c_long = 290; ++pub const SYS_epoll_create1: c_long = 291; ++pub const SYS_dup3: c_long = 292; ++pub const SYS_pipe2: c_long = 293; ++pub const SYS_inotify_init1: c_long = 294; ++pub const SYS_preadv: c_long = 295; ++pub const SYS_pwritev: c_long = 296; ++pub const SYS_rt_tgsigqueueinfo: c_long = 297; ++pub const SYS_perf_event_open: c_long = 298; ++pub const SYS_recvmmsg: c_long = 299; ++pub const SYS_fanotify_init: c_long = 300; ++pub const SYS_fanotify_mark: c_long = 301; ++pub const SYS_prlimit64: c_long = 302; ++pub const SYS_name_to_handle_at: c_long = 303; ++pub const SYS_open_by_handle_at: c_long = 304; ++pub const SYS_clock_adjtime: c_long = 305; ++pub const SYS_syncfs: c_long = 306; ++pub const SYS_sendmmsg: c_long = 307; ++pub const SYS_setns: c_long = 308; ++pub const SYS_getcpu: c_long = 309; ++pub const SYS_process_vm_readv: c_long = 310; ++pub const SYS_process_vm_writev: c_long = 311; ++pub const SYS_kcmp: c_long = 312; ++pub const SYS_finit_module: c_long = 313; ++pub const SYS_sched_setattr: c_long = 314; ++pub const SYS_sched_getattr: c_long = 315; ++pub const SYS_renameat2: c_long = 316; ++pub const SYS_seccomp: c_long = 317; ++pub const SYS_getrandom: c_long = 318; ++pub const SYS_memfd_create: c_long = 319; ++pub const SYS_kexec_file_load: c_long = 320; ++pub const SYS_bpf: c_long = 321; ++pub const SYS_execveat: c_long = 322; ++pub const SYS_userfaultfd: c_long = 323; ++pub const SYS_membarrier: c_long = 324; ++pub const SYS_mlock2: c_long = 325; ++pub const SYS_copy_file_range: c_long = 326; ++pub const SYS_preadv2: c_long = 327; ++pub const SYS_pwritev2: c_long = 328; ++pub const SYS_pkey_mprotect: c_long = 329; ++pub const SYS_pkey_alloc: c_long = 330; ++pub const SYS_pkey_free: c_long = 331; ++pub const SYS_statx: c_long = 332; ++pub const SYS_pidfd_send_signal: c_long = 424; ++pub const SYS_io_uring_setup: c_long = 425; ++pub const SYS_io_uring_enter: c_long = 426; ++pub const SYS_io_uring_register: c_long = 427; ++pub const SYS_open_tree: c_long = 428; ++pub const SYS_move_mount: c_long = 429; ++pub const SYS_fsopen: c_long = 430; ++pub const SYS_fsconfig: c_long = 431; ++pub const SYS_fsmount: c_long = 432; ++pub const SYS_fspick: c_long = 433; ++pub const SYS_pidfd_open: c_long = 434; ++pub const SYS_clone3: c_long = 435; ++pub const SYS_close_range: c_long = 436; ++pub const SYS_openat2: c_long = 437; ++pub const SYS_pidfd_getfd: c_long = 438; ++pub const SYS_faccessat2: c_long = 439; ++pub const SYS_process_madvise: c_long = 440; ++pub const SYS_epoll_pwait2: c_long = 441; ++pub const SYS_mount_setattr: c_long = 442; ++pub const SYS_quotactl_fd: c_long = 443; ++pub const SYS_landlock_create_ruleset: c_long = 444; ++pub const SYS_landlock_add_rule: c_long = 445; ++pub const SYS_landlock_restrict_self: c_long = 446; ++pub const SYS_memfd_secret: c_long = 447; ++pub const SYS_process_mrelease: c_long = 448; ++pub const SYS_futex_waitv: c_long = 449; ++pub const SYS_set_mempolicy_home_node: c_long = 450; ++ ++// offsets in user_regs_structs, from sys/reg.h ++pub const R15: c_int = 0; ++pub const R14: c_int = 1; ++pub const R13: c_int = 2; ++pub const R12: c_int = 3; ++pub const RBP: c_int = 4; ++pub const RBX: c_int = 5; ++pub const R11: c_int = 6; ++pub const R10: c_int = 7; ++pub const R9: c_int = 8; ++pub const R8: c_int = 9; ++pub const RAX: c_int = 10; ++pub const RCX: c_int = 11; ++pub const RDX: c_int = 12; ++pub const RSI: c_int = 13; ++pub const RDI: c_int = 14; ++pub const ORIG_RAX: c_int = 15; ++pub const RIP: c_int = 16; ++pub const CS: c_int = 17; ++pub const EFLAGS: c_int = 18; ++pub const RSP: c_int = 19; ++pub const SS: c_int = 20; ++pub const FS_BASE: c_int = 21; ++pub const GS_BASE: c_int = 22; ++pub const DS: c_int = 23; ++pub const ES: c_int = 24; ++pub const FS: c_int = 25; ++pub const GS: c_int = 26; ++ ++// offsets in mcontext_t.gregs from sys/ucontext.h ++pub const REG_R8: c_int = 0; ++pub const REG_R9: c_int = 1; ++pub const REG_R10: c_int = 2; ++pub const REG_R11: c_int = 3; ++pub const REG_R12: c_int = 4; ++pub const REG_R13: c_int = 5; ++pub const REG_R14: c_int = 6; ++pub const REG_R15: c_int = 7; ++pub const REG_RDI: c_int = 8; ++pub const REG_RSI: c_int = 9; ++pub const REG_RBP: c_int = 10; ++pub const REG_RBX: c_int = 11; ++pub const REG_RDX: c_int = 12; ++pub const REG_RAX: c_int = 13; ++pub const REG_RCX: c_int = 14; ++pub const REG_RSP: c_int = 15; ++pub const REG_RIP: c_int = 16; ++pub const REG_EFL: c_int = 17; ++pub const REG_CSGSFS: c_int = 18; ++pub const REG_ERR: c_int = 19; ++pub const REG_TRAPNO: c_int = 20; ++pub const REG_OLDMASK: c_int = 21; ++pub const REG_CR2: c_int = 22; ++ ++// From NDK's asm/auxvec.h ++pub const AT_SYSINFO_EHDR: c_ulong = 33; ++pub const AT_VECTOR_SIZE_ARCH: c_ulong = 3; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/android/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/android/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/android/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/android/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,4225 @@ ++//! Android-specific definitions for linux-like values ++ ++use crate::prelude::*; ++ ++pub type clock_t = c_long; ++pub type time_t = c_long; ++pub type suseconds_t = c_long; ++pub type off_t = c_long; ++pub type blkcnt_t = c_ulong; ++pub type blksize_t = c_ulong; ++pub type nlink_t = u32; ++pub type useconds_t = u32; ++pub type pthread_t = c_long; ++pub type pthread_mutexattr_t = c_long; ++pub type pthread_rwlockattr_t = c_long; ++pub type pthread_barrierattr_t = c_int; ++pub type pthread_condattr_t = c_long; ++pub type pthread_key_t = c_int; ++pub type fsfilcnt_t = c_ulong; ++pub type fsblkcnt_t = c_ulong; ++pub type nfds_t = c_uint; ++pub type rlim_t = c_ulong; ++pub type dev_t = c_ulong; ++pub type ino_t = c_ulong; ++pub type ino64_t = u64; ++pub type __CPU_BITTYPE = c_ulong; ++pub type idtype_t = c_int; ++pub type loff_t = c_longlong; ++pub type __kernel_loff_t = c_longlong; ++pub type __kernel_pid_t = c_int; ++ ++pub type __u8 = c_uchar; ++pub type __u16 = c_ushort; ++pub type __s16 = c_short; ++pub type __u32 = c_uint; ++pub type __s32 = c_int; ++ ++// linux/elf.h ++ ++pub type Elf32_Addr = u32; ++pub type Elf32_Half = u16; ++pub type Elf32_Off = u32; ++pub type Elf32_Word = u32; ++ ++pub type Elf64_Addr = u64; ++pub type Elf64_Half = u16; ++pub type Elf64_Off = u64; ++pub type Elf64_Word = u32; ++pub type Elf64_Xword = u64; ++ ++pub type eventfd_t = u64; ++ ++// these structs sit behind a heap allocation on Android ++pub type posix_spawn_file_actions_t = *mut c_void; ++pub type posix_spawnattr_t = *mut c_void; ++ ++s! { ++ pub struct stack_t { ++ pub ss_sp: *mut c_void, ++ pub ss_flags: c_int, ++ pub ss_size: size_t, ++ } ++ ++ pub struct __fsid_t { ++ __val: [c_int; 2], ++ } ++ ++ pub struct msghdr { ++ pub msg_name: *mut c_void, ++ pub msg_namelen: crate::socklen_t, ++ pub msg_iov: *mut crate::iovec, ++ pub msg_iovlen: size_t, ++ pub msg_control: *mut c_void, ++ pub msg_controllen: size_t, ++ pub msg_flags: c_int, ++ } ++ ++ pub struct cmsghdr { ++ pub cmsg_len: size_t, ++ pub cmsg_level: c_int, ++ pub cmsg_type: c_int, ++ } ++ ++ pub struct termios { ++ pub c_iflag: crate::tcflag_t, ++ pub c_oflag: crate::tcflag_t, ++ pub c_cflag: crate::tcflag_t, ++ pub c_lflag: crate::tcflag_t, ++ pub c_line: crate::cc_t, ++ pub c_cc: [crate::cc_t; crate::NCCS], ++ } ++ ++ pub struct termios2 { ++ pub c_iflag: crate::tcflag_t, ++ pub c_oflag: crate::tcflag_t, ++ pub c_cflag: crate::tcflag_t, ++ pub c_lflag: crate::tcflag_t, ++ pub c_line: crate::cc_t, ++ pub c_cc: [crate::cc_t; 19], ++ pub c_ispeed: crate::speed_t, ++ pub c_ospeed: crate::speed_t, ++ } ++ ++ pub struct mallinfo { ++ pub arena: size_t, ++ pub ordblks: size_t, ++ pub smblks: size_t, ++ pub hblks: size_t, ++ pub hblkhd: size_t, ++ pub usmblks: size_t, ++ pub fsmblks: size_t, ++ pub uordblks: size_t, ++ pub fordblks: size_t, ++ pub keepcost: size_t, ++ } ++ ++ pub struct flock { ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ pub l_start: off_t, ++ pub l_len: off_t, ++ pub l_pid: crate::pid_t, ++ } ++ ++ pub struct flock64 { ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ pub l_start: crate::__kernel_loff_t, ++ pub l_len: crate::__kernel_loff_t, ++ pub l_pid: crate::__kernel_pid_t, ++ } ++ ++ pub struct cpu_set_t { ++ #[cfg(target_pointer_width = "64")] ++ __bits: [__CPU_BITTYPE; 16], ++ #[cfg(target_pointer_width = "32")] ++ __bits: [__CPU_BITTYPE; 1], ++ } ++ ++ pub struct sem_t { ++ count: c_uint, ++ #[cfg(target_pointer_width = "64")] ++ __reserved: [c_int; 3], ++ } ++ ++ pub struct exit_status { ++ pub e_termination: c_short, ++ pub e_exit: c_short, ++ } ++ ++ pub struct statvfs { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_favail: crate::fsfilcnt_t, ++ pub f_fsid: c_ulong, ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ #[cfg(target_pointer_width = "64")] ++ __f_reserved: [u32; 6], ++ } ++ ++ pub struct signalfd_siginfo { ++ pub ssi_signo: u32, ++ pub ssi_errno: i32, ++ pub ssi_code: i32, ++ pub ssi_pid: u32, ++ pub ssi_uid: u32, ++ pub ssi_fd: i32, ++ pub ssi_tid: u32, ++ pub ssi_band: u32, ++ pub ssi_overrun: u32, ++ pub ssi_trapno: u32, ++ pub ssi_status: i32, ++ pub ssi_int: i32, ++ pub ssi_ptr: c_ulonglong, ++ pub ssi_utime: c_ulonglong, ++ pub ssi_stime: c_ulonglong, ++ pub ssi_addr: c_ulonglong, ++ pub ssi_addr_lsb: u16, ++ _pad2: u16, ++ pub ssi_syscall: i32, ++ pub ssi_call_addr: u64, ++ pub ssi_arch: u32, ++ _pad: [u8; 28], ++ } ++ ++ pub struct itimerspec { ++ pub it_interval: crate::timespec, ++ pub it_value: crate::timespec, ++ } ++ ++ pub struct ucred { ++ pub pid: crate::pid_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ } ++ ++ pub struct genlmsghdr { ++ pub cmd: u8, ++ pub version: u8, ++ pub reserved: u16, ++ } ++ ++ pub struct nlmsghdr { ++ pub nlmsg_len: u32, ++ pub nlmsg_type: u16, ++ pub nlmsg_flags: u16, ++ pub nlmsg_seq: u32, ++ pub nlmsg_pid: u32, ++ } ++ ++ pub struct nlmsgerr { ++ pub error: c_int, ++ pub msg: nlmsghdr, ++ } ++ ++ pub struct nl_pktinfo { ++ pub group: u32, ++ } ++ ++ pub struct nl_mmap_req { ++ pub nm_block_size: c_uint, ++ pub nm_block_nr: c_uint, ++ pub nm_frame_size: c_uint, ++ pub nm_frame_nr: c_uint, ++ } ++ ++ pub struct nl_mmap_hdr { ++ pub nm_status: c_uint, ++ pub nm_len: c_uint, ++ pub nm_group: u32, ++ pub nm_pid: u32, ++ pub nm_uid: u32, ++ pub nm_gid: u32, ++ } ++ ++ pub struct nlattr { ++ pub nla_len: u16, ++ pub nla_type: u16, ++ } ++ ++ pub struct in6_pktinfo { ++ pub ipi6_addr: crate::in6_addr, ++ pub ipi6_ifindex: c_int, ++ } ++ ++ pub struct inotify_event { ++ pub wd: c_int, ++ pub mask: u32, ++ pub cookie: u32, ++ pub len: u32, ++ } ++ ++ pub struct sock_extended_err { ++ pub ee_errno: u32, ++ pub ee_origin: u8, ++ pub ee_type: u8, ++ pub ee_code: u8, ++ pub ee_pad: u8, ++ pub ee_info: u32, ++ pub ee_data: u32, ++ } ++ ++ pub struct regex_t { ++ re_magic: c_int, ++ re_nsub: size_t, ++ re_endp: *const c_char, ++ re_guts: *mut c_void, ++ } ++ ++ pub struct regmatch_t { ++ pub rm_so: ssize_t, ++ pub rm_eo: ssize_t, ++ } ++ ++ pub struct sockaddr_vm { ++ pub svm_family: crate::sa_family_t, ++ pub svm_reserved1: c_ushort, ++ pub svm_port: c_uint, ++ pub svm_cid: c_uint, ++ pub svm_zero: [u8; 4], ++ } ++ ++ // linux/elf.h ++ ++ pub struct Elf32_Phdr { ++ pub p_type: Elf32_Word, ++ pub p_offset: Elf32_Off, ++ pub p_vaddr: Elf32_Addr, ++ pub p_paddr: Elf32_Addr, ++ pub p_filesz: Elf32_Word, ++ pub p_memsz: Elf32_Word, ++ pub p_flags: Elf32_Word, ++ pub p_align: Elf32_Word, ++ } ++ ++ pub struct Elf64_Phdr { ++ pub p_type: Elf64_Word, ++ pub p_flags: Elf64_Word, ++ pub p_offset: Elf64_Off, ++ pub p_vaddr: Elf64_Addr, ++ pub p_paddr: Elf64_Addr, ++ pub p_filesz: Elf64_Xword, ++ pub p_memsz: Elf64_Xword, ++ pub p_align: Elf64_Xword, ++ } ++ ++ // link.h ++ ++ pub struct dl_phdr_info { ++ #[cfg(target_pointer_width = "64")] ++ pub dlpi_addr: Elf64_Addr, ++ #[cfg(target_pointer_width = "32")] ++ pub dlpi_addr: Elf32_Addr, ++ ++ pub dlpi_name: *const c_char, ++ ++ #[cfg(target_pointer_width = "64")] ++ pub dlpi_phdr: *const Elf64_Phdr, ++ #[cfg(target_pointer_width = "32")] ++ pub dlpi_phdr: *const Elf32_Phdr, ++ ++ #[cfg(target_pointer_width = "64")] ++ pub dlpi_phnum: Elf64_Half, ++ #[cfg(target_pointer_width = "32")] ++ pub dlpi_phnum: Elf32_Half, ++ ++ // These fields were added in Android R ++ pub dlpi_adds: c_ulonglong, ++ pub dlpi_subs: c_ulonglong, ++ pub dlpi_tls_modid: size_t, ++ pub dlpi_tls_data: *mut c_void, ++ } ++ ++ // linux/filter.h ++ pub struct sock_filter { ++ pub code: crate::__u16, ++ pub jt: crate::__u8, ++ pub jf: crate::__u8, ++ pub k: crate::__u32, ++ } ++ ++ pub struct sock_fprog { ++ pub len: c_ushort, ++ pub filter: *mut sock_filter, ++ } ++ ++ // linux/seccomp.h ++ pub struct seccomp_data { ++ pub nr: c_int, ++ pub arch: crate::__u32, ++ pub instruction_pointer: crate::__u64, ++ pub args: [crate::__u64; 6], ++ } ++ ++ pub struct seccomp_metadata { ++ pub filter_off: crate::__u64, ++ pub flags: crate::__u64, ++ } ++ ++ pub struct ptrace_peeksiginfo_args { ++ pub off: crate::__u64, ++ pub flags: crate::__u32, ++ pub nr: crate::__s32, ++ } ++ ++ // linux/input.h ++ pub struct input_event { ++ pub time: crate::timeval, ++ pub type_: crate::__u16, ++ pub code: crate::__u16, ++ pub value: crate::__s32, ++ } ++ ++ pub struct input_id { ++ pub bustype: crate::__u16, ++ pub vendor: crate::__u16, ++ pub product: crate::__u16, ++ pub version: crate::__u16, ++ } ++ ++ pub struct input_absinfo { ++ pub value: crate::__s32, ++ pub minimum: crate::__s32, ++ pub maximum: crate::__s32, ++ pub fuzz: crate::__s32, ++ pub flat: crate::__s32, ++ pub resolution: crate::__s32, ++ } ++ ++ pub struct input_keymap_entry { ++ pub flags: crate::__u8, ++ pub len: crate::__u8, ++ pub index: crate::__u16, ++ pub keycode: crate::__u32, ++ pub scancode: [crate::__u8; 32], ++ } ++ ++ pub struct input_mask { ++ pub type_: crate::__u32, ++ pub codes_size: crate::__u32, ++ pub codes_ptr: crate::__u64, ++ } ++ ++ pub struct ff_replay { ++ pub length: crate::__u16, ++ pub delay: crate::__u16, ++ } ++ ++ pub struct ff_trigger { ++ pub button: crate::__u16, ++ pub interval: crate::__u16, ++ } ++ ++ pub struct ff_envelope { ++ pub attack_length: crate::__u16, ++ pub attack_level: crate::__u16, ++ pub fade_length: crate::__u16, ++ pub fade_level: crate::__u16, ++ } ++ ++ pub struct ff_constant_effect { ++ pub level: crate::__s16, ++ pub envelope: ff_envelope, ++ } ++ ++ pub struct ff_ramp_effect { ++ pub start_level: crate::__s16, ++ pub end_level: crate::__s16, ++ pub envelope: ff_envelope, ++ } ++ ++ pub struct ff_condition_effect { ++ pub right_saturation: crate::__u16, ++ pub left_saturation: crate::__u16, ++ ++ pub right_coeff: crate::__s16, ++ pub left_coeff: crate::__s16, ++ ++ pub deadband: crate::__u16, ++ pub center: crate::__s16, ++ } ++ ++ pub struct ff_periodic_effect { ++ pub waveform: crate::__u16, ++ pub period: crate::__u16, ++ pub magnitude: crate::__s16, ++ pub offset: crate::__s16, ++ pub phase: crate::__u16, ++ ++ pub envelope: ff_envelope, ++ ++ pub custom_len: crate::__u32, ++ pub custom_data: *mut crate::__s16, ++ } ++ ++ pub struct ff_rumble_effect { ++ pub strong_magnitude: crate::__u16, ++ pub weak_magnitude: crate::__u16, ++ } ++ ++ pub struct ff_effect { ++ pub type_: crate::__u16, ++ pub id: crate::__s16, ++ pub direction: crate::__u16, ++ pub trigger: ff_trigger, ++ pub replay: ff_replay, ++ // FIXME(1.0): this is actually a union ++ #[cfg(target_pointer_width = "64")] ++ pub u: [u64; 4], ++ #[cfg(target_pointer_width = "32")] ++ pub u: [u32; 7], ++ } ++ ++ // linux/uinput.h ++ pub struct uinput_ff_upload { ++ pub request_id: crate::__u32, ++ pub retval: crate::__s32, ++ pub effect: ff_effect, ++ pub old: ff_effect, ++ } ++ ++ pub struct uinput_ff_erase { ++ pub request_id: crate::__u32, ++ pub retval: crate::__s32, ++ pub effect_id: crate::__u32, ++ } ++ ++ pub struct uinput_abs_setup { ++ pub code: crate::__u16, ++ pub absinfo: input_absinfo, ++ } ++ ++ pub struct option { ++ pub name: *const c_char, ++ pub has_arg: c_int, ++ pub flag: *mut c_int, ++ pub val: c_int, ++ } ++ ++ pub struct __c_anonymous_ifru_map { ++ pub mem_start: c_ulong, ++ pub mem_end: c_ulong, ++ pub base_addr: c_ushort, ++ pub irq: c_uchar, ++ pub dma: c_uchar, ++ pub port: c_uchar, ++ } ++ ++ pub struct in6_ifreq { ++ pub ifr6_addr: crate::in6_addr, ++ pub ifr6_prefixlen: u32, ++ pub ifr6_ifindex: c_int, ++ } ++} ++ ++s_no_extra_traits! { ++ pub struct sockaddr_nl { ++ pub nl_family: crate::sa_family_t, ++ nl_pad: c_ushort, ++ pub nl_pid: u32, ++ pub nl_groups: u32, ++ } ++ ++ pub struct dirent { ++ pub d_ino: u64, ++ pub d_off: i64, ++ pub d_reclen: c_ushort, ++ pub d_type: c_uchar, ++ pub d_name: [c_char; 256], ++ } ++ ++ pub struct dirent64 { ++ pub d_ino: u64, ++ pub d_off: i64, ++ pub d_reclen: c_ushort, ++ pub d_type: c_uchar, ++ pub d_name: [c_char; 256], ++ } ++ ++ pub struct siginfo_t { ++ pub si_signo: c_int, ++ pub si_errno: c_int, ++ pub si_code: c_int, ++ pub _pad: [c_int; 29], ++ _align: [usize; 0], ++ } ++ ++ pub struct lastlog { ++ ll_time: crate::time_t, ++ ll_line: [c_char; UT_LINESIZE], ++ ll_host: [c_char; UT_HOSTSIZE], ++ } ++ ++ pub struct utmp { ++ pub ut_type: c_short, ++ pub ut_pid: crate::pid_t, ++ pub ut_line: [c_char; UT_LINESIZE], ++ pub ut_id: [c_char; 4], ++ pub ut_user: [c_char; UT_NAMESIZE], ++ pub ut_host: [c_char; UT_HOSTSIZE], ++ pub ut_exit: exit_status, ++ pub ut_session: c_long, ++ pub ut_tv: crate::timeval, ++ pub ut_addr_v6: [i32; 4], ++ unused: [c_char; 20], ++ } ++ ++ pub struct sockaddr_alg { ++ pub salg_family: crate::sa_family_t, ++ pub salg_type: [c_uchar; 14], ++ pub salg_feat: u32, ++ pub salg_mask: u32, ++ pub salg_name: [c_uchar; 64], ++ } ++ ++ pub struct uinput_setup { ++ pub id: input_id, ++ pub name: [c_char; UINPUT_MAX_NAME_SIZE], ++ pub ff_effects_max: crate::__u32, ++ } ++ ++ pub struct uinput_user_dev { ++ pub name: [c_char; UINPUT_MAX_NAME_SIZE], ++ pub id: input_id, ++ pub ff_effects_max: crate::__u32, ++ pub absmax: [crate::__s32; ABS_CNT], ++ pub absmin: [crate::__s32; ABS_CNT], ++ pub absfuzz: [crate::__s32; ABS_CNT], ++ pub absflat: [crate::__s32; ABS_CNT], ++ } ++ ++ /// WARNING: The `PartialEq`, `Eq` and `Hash` implementations of this ++ /// type are unsound and will be removed in the future. ++ #[deprecated( ++ note = "this struct has unsafe trait implementations that will be \ ++ removed in the future", ++ since = "0.2.80" ++ )] ++ pub struct af_alg_iv { ++ pub ivlen: u32, ++ pub iv: [c_uchar; 0], ++ } ++ ++ pub struct prop_info { ++ __name: [c_char; 32], ++ __serial: c_uint, ++ __value: [c_char; 92], ++ } ++ ++ pub union __c_anonymous_ifr_ifru { ++ pub ifru_addr: crate::sockaddr, ++ pub ifru_dstaddr: crate::sockaddr, ++ pub ifru_broadaddr: crate::sockaddr, ++ pub ifru_netmask: crate::sockaddr, ++ pub ifru_hwaddr: crate::sockaddr, ++ pub ifru_flags: c_short, ++ pub ifru_ifindex: c_int, ++ pub ifru_metric: c_int, ++ pub ifru_mtu: c_int, ++ pub ifru_map: __c_anonymous_ifru_map, ++ pub ifru_slave: [c_char; crate::IFNAMSIZ], ++ pub ifru_newname: [c_char; crate::IFNAMSIZ], ++ pub ifru_data: *mut c_char, ++ } ++ ++ pub struct ifreq { ++ /// interface name, e.g. "en0" ++ pub ifr_name: [c_char; crate::IFNAMSIZ], ++ pub ifr_ifru: __c_anonymous_ifr_ifru, ++ } ++ ++ pub union __c_anonymous_ifc_ifcu { ++ pub ifcu_buf: *mut c_char, ++ pub ifcu_req: *mut crate::ifreq, ++ } ++ ++ /* Structure used in SIOCGIFCONF request. Used to retrieve interface ++ configuration for machine (useful for programs which must know all ++ networks accessible). */ ++ pub struct ifconf { ++ pub ifc_len: c_int, /* Size of buffer. */ ++ pub ifc_ifcu: __c_anonymous_ifc_ifcu, ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for sockaddr_nl { ++ fn eq(&self, other: &sockaddr_nl) -> bool { ++ self.nl_family == other.nl_family ++ && self.nl_pid == other.nl_pid ++ && self.nl_groups == other.nl_groups ++ } ++ } ++ impl Eq for sockaddr_nl {} ++ impl fmt::Debug for sockaddr_nl { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sockaddr_nl") ++ .field("nl_family", &self.nl_family) ++ .field("nl_pid", &self.nl_pid) ++ .field("nl_groups", &self.nl_groups) ++ .finish() ++ } ++ } ++ impl hash::Hash for sockaddr_nl { ++ fn hash(&self, state: &mut H) { ++ self.nl_family.hash(state); ++ self.nl_pid.hash(state); ++ self.nl_groups.hash(state); ++ } ++ } ++ ++ impl PartialEq for dirent { ++ fn eq(&self, other: &dirent) -> bool { ++ self.d_ino == other.d_ino ++ && self.d_off == other.d_off ++ && self.d_reclen == other.d_reclen ++ && self.d_type == other.d_type ++ && self ++ .d_name ++ .iter() ++ .zip(other.d_name.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ ++ impl Eq for dirent {} ++ ++ impl fmt::Debug for dirent { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("dirent") ++ .field("d_ino", &self.d_ino) ++ .field("d_off", &self.d_off) ++ .field("d_reclen", &self.d_reclen) ++ .field("d_type", &self.d_type) ++ // FIXME: .field("d_name", &self.d_name) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for dirent { ++ fn hash(&self, state: &mut H) { ++ self.d_ino.hash(state); ++ self.d_off.hash(state); ++ self.d_reclen.hash(state); ++ self.d_type.hash(state); ++ self.d_name.hash(state); ++ } ++ } ++ ++ impl PartialEq for dirent64 { ++ fn eq(&self, other: &dirent64) -> bool { ++ self.d_ino == other.d_ino ++ && self.d_off == other.d_off ++ && self.d_reclen == other.d_reclen ++ && self.d_type == other.d_type ++ && self ++ .d_name ++ .iter() ++ .zip(other.d_name.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ ++ impl Eq for dirent64 {} ++ ++ impl fmt::Debug for dirent64 { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("dirent64") ++ .field("d_ino", &self.d_ino) ++ .field("d_off", &self.d_off) ++ .field("d_reclen", &self.d_reclen) ++ .field("d_type", &self.d_type) ++ // FIXME: .field("d_name", &self.d_name) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for dirent64 { ++ fn hash(&self, state: &mut H) { ++ self.d_ino.hash(state); ++ self.d_off.hash(state); ++ self.d_reclen.hash(state); ++ self.d_type.hash(state); ++ self.d_name.hash(state); ++ } ++ } ++ ++ impl PartialEq for siginfo_t { ++ fn eq(&self, other: &siginfo_t) -> bool { ++ self.si_signo == other.si_signo ++ && self.si_errno == other.si_errno ++ && self.si_code == other.si_code ++ // Ignore _pad ++ // Ignore _align ++ } ++ } ++ ++ impl Eq for siginfo_t {} ++ ++ impl fmt::Debug for siginfo_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("siginfo_t") ++ .field("si_signo", &self.si_signo) ++ .field("si_errno", &self.si_errno) ++ .field("si_code", &self.si_code) ++ // Ignore _pad ++ // Ignore _align ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for siginfo_t { ++ fn hash(&self, state: &mut H) { ++ self.si_signo.hash(state); ++ self.si_errno.hash(state); ++ self.si_code.hash(state); ++ // Ignore _pad ++ // Ignore _align ++ } ++ } ++ ++ impl PartialEq for lastlog { ++ fn eq(&self, other: &lastlog) -> bool { ++ self.ll_time == other.ll_time ++ && self ++ .ll_line ++ .iter() ++ .zip(other.ll_line.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .ll_host ++ .iter() ++ .zip(other.ll_host.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ ++ impl Eq for lastlog {} ++ ++ impl fmt::Debug for lastlog { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("lastlog") ++ .field("ll_time", &self.ll_time) ++ .field("ll_line", &self.ll_line) ++ // FIXME: .field("ll_host", &self.ll_host) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for lastlog { ++ fn hash(&self, state: &mut H) { ++ self.ll_time.hash(state); ++ self.ll_line.hash(state); ++ self.ll_host.hash(state); ++ } ++ } ++ ++ impl PartialEq for utmp { ++ fn eq(&self, other: &utmp) -> bool { ++ self.ut_type == other.ut_type ++ && self.ut_pid == other.ut_pid ++ && self ++ .ut_line ++ .iter() ++ .zip(other.ut_line.iter()) ++ .all(|(a, b)| a == b) ++ && self.ut_id == other.ut_id ++ && self ++ .ut_user ++ .iter() ++ .zip(other.ut_user.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .ut_host ++ .iter() ++ .zip(other.ut_host.iter()) ++ .all(|(a, b)| a == b) ++ && self.ut_exit == other.ut_exit ++ && self.ut_session == other.ut_session ++ && self.ut_tv == other.ut_tv ++ && self.ut_addr_v6 == other.ut_addr_v6 ++ && self.unused == other.unused ++ } ++ } ++ ++ impl Eq for utmp {} ++ ++ impl fmt::Debug for utmp { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("utmp") ++ .field("ut_type", &self.ut_type) ++ .field("ut_pid", &self.ut_pid) ++ .field("ut_line", &self.ut_line) ++ .field("ut_id", &self.ut_id) ++ .field("ut_user", &self.ut_user) ++ // FIXME: .field("ut_host", &self.ut_host) ++ .field("ut_exit", &self.ut_exit) ++ .field("ut_session", &self.ut_session) ++ .field("ut_tv", &self.ut_tv) ++ .field("ut_addr_v6", &self.ut_addr_v6) ++ .field("unused", &self.unused) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for utmp { ++ fn hash(&self, state: &mut H) { ++ self.ut_type.hash(state); ++ self.ut_pid.hash(state); ++ self.ut_line.hash(state); ++ self.ut_id.hash(state); ++ self.ut_user.hash(state); ++ self.ut_host.hash(state); ++ self.ut_exit.hash(state); ++ self.ut_session.hash(state); ++ self.ut_tv.hash(state); ++ self.ut_addr_v6.hash(state); ++ self.unused.hash(state); ++ } ++ } ++ ++ impl PartialEq for sockaddr_alg { ++ fn eq(&self, other: &sockaddr_alg) -> bool { ++ self.salg_family == other.salg_family ++ && self ++ .salg_type ++ .iter() ++ .zip(other.salg_type.iter()) ++ .all(|(a, b)| a == b) ++ && self.salg_feat == other.salg_feat ++ && self.salg_mask == other.salg_mask ++ && self ++ .salg_name ++ .iter() ++ .zip(other.salg_name.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ ++ impl Eq for sockaddr_alg {} ++ ++ impl fmt::Debug for sockaddr_alg { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sockaddr_alg") ++ .field("salg_family", &self.salg_family) ++ .field("salg_type", &self.salg_type) ++ .field("salg_feat", &self.salg_feat) ++ .field("salg_mask", &self.salg_mask) ++ .field("salg_name", &&self.salg_name[..]) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for sockaddr_alg { ++ fn hash(&self, state: &mut H) { ++ self.salg_family.hash(state); ++ self.salg_type.hash(state); ++ self.salg_feat.hash(state); ++ self.salg_mask.hash(state); ++ self.salg_name.hash(state); ++ } ++ } ++ ++ impl PartialEq for uinput_setup { ++ fn eq(&self, other: &uinput_setup) -> bool { ++ self.id == other.id ++ && self.name[..] == other.name[..] ++ && self.ff_effects_max == other.ff_effects_max ++ } ++ } ++ impl Eq for uinput_setup {} ++ ++ impl fmt::Debug for uinput_setup { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("uinput_setup") ++ .field("id", &self.id) ++ .field("name", &&self.name[..]) ++ .field("ff_effects_max", &self.ff_effects_max) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for uinput_setup { ++ fn hash(&self, state: &mut H) { ++ self.id.hash(state); ++ self.name.hash(state); ++ self.ff_effects_max.hash(state); ++ } ++ } ++ ++ impl PartialEq for uinput_user_dev { ++ fn eq(&self, other: &uinput_user_dev) -> bool { ++ self.name[..] == other.name[..] ++ && self.id == other.id ++ && self.ff_effects_max == other.ff_effects_max ++ && self.absmax[..] == other.absmax[..] ++ && self.absmin[..] == other.absmin[..] ++ && self.absfuzz[..] == other.absfuzz[..] ++ && self.absflat[..] == other.absflat[..] ++ } ++ } ++ impl Eq for uinput_user_dev {} ++ ++ impl fmt::Debug for uinput_user_dev { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("uinput_setup") ++ .field("name", &&self.name[..]) ++ .field("id", &self.id) ++ .field("ff_effects_max", &self.ff_effects_max) ++ .field("absmax", &&self.absmax[..]) ++ .field("absmin", &&self.absmin[..]) ++ .field("absfuzz", &&self.absfuzz[..]) ++ .field("absflat", &&self.absflat[..]) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for uinput_user_dev { ++ fn hash(&self, state: &mut H) { ++ self.name.hash(state); ++ self.id.hash(state); ++ self.ff_effects_max.hash(state); ++ self.absmax.hash(state); ++ self.absmin.hash(state); ++ self.absfuzz.hash(state); ++ self.absflat.hash(state); ++ } ++ } ++ ++ impl fmt::Debug for ifreq { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("ifreq") ++ .field("ifr_name", &self.ifr_name) ++ .field("ifr_ifru", &self.ifr_ifru) ++ .finish() ++ } ++ } ++ ++ impl fmt::Debug for ifconf { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("ifconf") ++ .field("ifc_len", &self.ifc_len) ++ .field("ifc_ifcu", &self.ifc_ifcu) ++ .finish() ++ } ++ } ++ ++ #[allow(deprecated)] ++ impl af_alg_iv { ++ fn as_slice(&self) -> &[u8] { ++ unsafe { ::core::slice::from_raw_parts(self.iv.as_ptr(), self.ivlen as usize) } ++ } ++ } ++ ++ #[allow(deprecated)] ++ impl PartialEq for af_alg_iv { ++ fn eq(&self, other: &af_alg_iv) -> bool { ++ *self.as_slice() == *other.as_slice() ++ } ++ } ++ ++ #[allow(deprecated)] ++ impl Eq for af_alg_iv {} ++ ++ #[allow(deprecated)] ++ impl fmt::Debug for af_alg_iv { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("af_alg_iv") ++ .field("ivlen", &self.ivlen) ++ .finish() ++ } ++ } ++ ++ #[allow(deprecated)] ++ impl hash::Hash for af_alg_iv { ++ fn hash(&self, state: &mut H) { ++ self.as_slice().hash(state); ++ } ++ } ++ ++ impl PartialEq for prop_info { ++ fn eq(&self, other: &prop_info) -> bool { ++ self.__name == other.__name ++ && self.__serial == other.__serial ++ && self.__value == other.__value ++ } ++ } ++ impl Eq for prop_info {} ++ impl fmt::Debug for prop_info { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("prop_info") ++ .field("__name", &self.__name) ++ .field("__serial", &self.__serial) ++ .field("__value", &self.__value) ++ .finish() ++ } ++ } ++ } ++} ++ ++pub const MADV_SOFT_OFFLINE: c_int = 101; ++pub const MS_NOUSER: c_ulong = 0xffffffff80000000; ++pub const MS_RMT_MASK: c_ulong = 0x02800051; ++ ++pub const O_TRUNC: c_int = 512; ++pub const O_CLOEXEC: c_int = 0x80000; ++pub const O_PATH: c_int = 0o10000000; ++pub const O_NOATIME: c_int = 0o1000000; ++ ++pub const EBFONT: c_int = 59; ++pub const ENOSTR: c_int = 60; ++pub const ENODATA: c_int = 61; ++pub const ETIME: c_int = 62; ++pub const ENOSR: c_int = 63; ++pub const ENONET: c_int = 64; ++pub const ENOPKG: c_int = 65; ++pub const EREMOTE: c_int = 66; ++pub const ENOLINK: c_int = 67; ++pub const EADV: c_int = 68; ++pub const ESRMNT: c_int = 69; ++pub const ECOMM: c_int = 70; ++pub const EPROTO: c_int = 71; ++pub const EDOTDOT: c_int = 73; ++ ++pub const EPOLL_CLOEXEC: c_int = 0x80000; ++ ++// sys/eventfd.h ++pub const EFD_SEMAPHORE: c_int = 0x1; ++pub const EFD_CLOEXEC: c_int = O_CLOEXEC; ++pub const EFD_NONBLOCK: c_int = O_NONBLOCK; ++ ++// sys/timerfd.h ++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 USER_PROCESS: c_short = 7; ++ ++pub const _POSIX_VDISABLE: crate::cc_t = 0; ++ ++// linux/falloc.h ++pub const FALLOC_FL_KEEP_SIZE: c_int = 0x01; ++pub const FALLOC_FL_PUNCH_HOLE: c_int = 0x02; ++pub const FALLOC_FL_NO_HIDE_STALE: c_int = 0x04; ++pub const FALLOC_FL_COLLAPSE_RANGE: c_int = 0x08; ++pub const FALLOC_FL_ZERO_RANGE: c_int = 0x10; ++pub const FALLOC_FL_INSERT_RANGE: c_int = 0x20; ++pub const FALLOC_FL_UNSHARE_RANGE: c_int = 0x40; ++ ++pub const BUFSIZ: c_uint = 1024; ++pub const FILENAME_MAX: c_uint = 4096; ++pub const FOPEN_MAX: c_uint = 20; ++pub const POSIX_FADV_DONTNEED: c_int = 4; ++pub const POSIX_FADV_NOREUSE: c_int = 5; ++pub const L_tmpnam: c_uint = 4096; ++pub const TMP_MAX: c_uint = 308915776; ++pub const _PC_LINK_MAX: c_int = 1; ++pub const _PC_MAX_CANON: c_int = 2; ++pub const _PC_MAX_INPUT: c_int = 3; ++pub const _PC_NAME_MAX: c_int = 4; ++pub const _PC_PATH_MAX: c_int = 5; ++pub const _PC_PIPE_BUF: c_int = 6; ++pub const _PC_2_SYMLINKS: c_int = 7; ++pub const _PC_ALLOC_SIZE_MIN: c_int = 8; ++pub const _PC_REC_INCR_XFER_SIZE: c_int = 9; ++pub const _PC_REC_MAX_XFER_SIZE: c_int = 10; ++pub const _PC_REC_MIN_XFER_SIZE: c_int = 11; ++pub const _PC_REC_XFER_ALIGN: c_int = 12; ++pub const _PC_SYMLINK_MAX: c_int = 13; ++pub const _PC_CHOWN_RESTRICTED: c_int = 14; ++pub const _PC_NO_TRUNC: c_int = 15; ++pub const _PC_VDISABLE: c_int = 16; ++pub const _PC_ASYNC_IO: c_int = 17; ++pub const _PC_PRIO_IO: c_int = 18; ++pub const _PC_SYNC_IO: c_int = 19; ++ ++pub const FIONBIO: c_int = 0x5421; ++ ++pub const _SC_ARG_MAX: c_int = 0x0000; ++pub const _SC_BC_BASE_MAX: c_int = 0x0001; ++pub const _SC_BC_DIM_MAX: c_int = 0x0002; ++pub const _SC_BC_SCALE_MAX: c_int = 0x0003; ++pub const _SC_BC_STRING_MAX: c_int = 0x0004; ++pub const _SC_CHILD_MAX: c_int = 0x0005; ++pub const _SC_CLK_TCK: c_int = 0x0006; ++pub const _SC_COLL_WEIGHTS_MAX: c_int = 0x0007; ++pub const _SC_EXPR_NEST_MAX: c_int = 0x0008; ++pub const _SC_LINE_MAX: c_int = 0x0009; ++pub const _SC_NGROUPS_MAX: c_int = 0x000a; ++pub const _SC_OPEN_MAX: c_int = 0x000b; ++pub const _SC_PASS_MAX: c_int = 0x000c; ++pub const _SC_2_C_BIND: c_int = 0x000d; ++pub const _SC_2_C_DEV: c_int = 0x000e; ++pub const _SC_2_C_VERSION: c_int = 0x000f; ++pub const _SC_2_CHAR_TERM: c_int = 0x0010; ++pub const _SC_2_FORT_DEV: c_int = 0x0011; ++pub const _SC_2_FORT_RUN: c_int = 0x0012; ++pub const _SC_2_LOCALEDEF: c_int = 0x0013; ++pub const _SC_2_SW_DEV: c_int = 0x0014; ++pub const _SC_2_UPE: c_int = 0x0015; ++pub const _SC_2_VERSION: c_int = 0x0016; ++pub const _SC_JOB_CONTROL: c_int = 0x0017; ++pub const _SC_SAVED_IDS: c_int = 0x0018; ++pub const _SC_VERSION: c_int = 0x0019; ++pub const _SC_RE_DUP_MAX: c_int = 0x001a; ++pub const _SC_STREAM_MAX: c_int = 0x001b; ++pub const _SC_TZNAME_MAX: c_int = 0x001c; ++pub const _SC_XOPEN_CRYPT: c_int = 0x001d; ++pub const _SC_XOPEN_ENH_I18N: c_int = 0x001e; ++pub const _SC_XOPEN_SHM: c_int = 0x001f; ++pub const _SC_XOPEN_VERSION: c_int = 0x0020; ++pub const _SC_XOPEN_XCU_VERSION: c_int = 0x0021; ++pub const _SC_XOPEN_REALTIME: c_int = 0x0022; ++pub const _SC_XOPEN_REALTIME_THREADS: c_int = 0x0023; ++pub const _SC_XOPEN_LEGACY: c_int = 0x0024; ++pub const _SC_ATEXIT_MAX: c_int = 0x0025; ++pub const _SC_IOV_MAX: c_int = 0x0026; ++pub const _SC_UIO_MAXIOV: c_int = _SC_IOV_MAX; ++pub const _SC_PAGESIZE: c_int = 0x0027; ++pub const _SC_PAGE_SIZE: c_int = 0x0028; ++pub const _SC_XOPEN_UNIX: c_int = 0x0029; ++pub const _SC_XBS5_ILP32_OFF32: c_int = 0x002a; ++pub const _SC_XBS5_ILP32_OFFBIG: c_int = 0x002b; ++pub const _SC_XBS5_LP64_OFF64: c_int = 0x002c; ++pub const _SC_XBS5_LPBIG_OFFBIG: c_int = 0x002d; ++pub const _SC_AIO_LISTIO_MAX: c_int = 0x002e; ++pub const _SC_AIO_MAX: c_int = 0x002f; ++pub const _SC_AIO_PRIO_DELTA_MAX: c_int = 0x0030; ++pub const _SC_DELAYTIMER_MAX: c_int = 0x0031; ++pub const _SC_MQ_OPEN_MAX: c_int = 0x0032; ++pub const _SC_MQ_PRIO_MAX: c_int = 0x0033; ++pub const _SC_RTSIG_MAX: c_int = 0x0034; ++pub const _SC_SEM_NSEMS_MAX: c_int = 0x0035; ++pub const _SC_SEM_VALUE_MAX: c_int = 0x0036; ++pub const _SC_SIGQUEUE_MAX: c_int = 0x0037; ++pub const _SC_TIMER_MAX: c_int = 0x0038; ++pub const _SC_ASYNCHRONOUS_IO: c_int = 0x0039; ++pub const _SC_FSYNC: c_int = 0x003a; ++pub const _SC_MAPPED_FILES: c_int = 0x003b; ++pub const _SC_MEMLOCK: c_int = 0x003c; ++pub const _SC_MEMLOCK_RANGE: c_int = 0x003d; ++pub const _SC_MEMORY_PROTECTION: c_int = 0x003e; ++pub const _SC_MESSAGE_PASSING: c_int = 0x003f; ++pub const _SC_PRIORITIZED_IO: c_int = 0x0040; ++pub const _SC_PRIORITY_SCHEDULING: c_int = 0x0041; ++pub const _SC_REALTIME_SIGNALS: c_int = 0x0042; ++pub const _SC_SEMAPHORES: c_int = 0x0043; ++pub const _SC_SHARED_MEMORY_OBJECTS: c_int = 0x0044; ++pub const _SC_SYNCHRONIZED_IO: c_int = 0x0045; ++pub const _SC_TIMERS: c_int = 0x0046; ++pub const _SC_GETGR_R_SIZE_MAX: c_int = 0x0047; ++pub const _SC_GETPW_R_SIZE_MAX: c_int = 0x0048; ++pub const _SC_LOGIN_NAME_MAX: c_int = 0x0049; ++pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: c_int = 0x004a; ++pub const _SC_THREAD_KEYS_MAX: c_int = 0x004b; ++pub const _SC_THREAD_STACK_MIN: c_int = 0x004c; ++pub const _SC_THREAD_THREADS_MAX: c_int = 0x004d; ++pub const _SC_TTY_NAME_MAX: c_int = 0x004e; ++pub const _SC_THREADS: c_int = 0x004f; ++pub const _SC_THREAD_ATTR_STACKADDR: c_int = 0x0050; ++pub const _SC_THREAD_ATTR_STACKSIZE: c_int = 0x0051; ++pub const _SC_THREAD_PRIORITY_SCHEDULING: c_int = 0x0052; ++pub const _SC_THREAD_PRIO_INHERIT: c_int = 0x0053; ++pub const _SC_THREAD_PRIO_PROTECT: c_int = 0x0054; ++pub const _SC_THREAD_SAFE_FUNCTIONS: c_int = 0x0055; ++pub const _SC_NPROCESSORS_CONF: c_int = 0x0060; ++pub const _SC_NPROCESSORS_ONLN: c_int = 0x0061; ++pub const _SC_PHYS_PAGES: c_int = 0x0062; ++pub const _SC_AVPHYS_PAGES: c_int = 0x0063; ++pub const _SC_MONOTONIC_CLOCK: c_int = 0x0064; ++pub const _SC_2_PBS: c_int = 0x0065; ++pub const _SC_2_PBS_ACCOUNTING: c_int = 0x0066; ++pub const _SC_2_PBS_CHECKPOINT: c_int = 0x0067; ++pub const _SC_2_PBS_LOCATE: c_int = 0x0068; ++pub const _SC_2_PBS_MESSAGE: c_int = 0x0069; ++pub const _SC_2_PBS_TRACK: c_int = 0x006a; ++pub const _SC_ADVISORY_INFO: c_int = 0x006b; ++pub const _SC_BARRIERS: c_int = 0x006c; ++pub const _SC_CLOCK_SELECTION: c_int = 0x006d; ++pub const _SC_CPUTIME: c_int = 0x006e; ++pub const _SC_HOST_NAME_MAX: c_int = 0x006f; ++pub const _SC_IPV6: c_int = 0x0070; ++pub const _SC_RAW_SOCKETS: c_int = 0x0071; ++pub const _SC_READER_WRITER_LOCKS: c_int = 0x0072; ++pub const _SC_REGEXP: c_int = 0x0073; ++pub const _SC_SHELL: c_int = 0x0074; ++pub const _SC_SPAWN: c_int = 0x0075; ++pub const _SC_SPIN_LOCKS: c_int = 0x0076; ++pub const _SC_SPORADIC_SERVER: c_int = 0x0077; ++pub const _SC_SS_REPL_MAX: c_int = 0x0078; ++pub const _SC_SYMLOOP_MAX: c_int = 0x0079; ++pub const _SC_THREAD_CPUTIME: c_int = 0x007a; ++pub const _SC_THREAD_PROCESS_SHARED: c_int = 0x007b; ++pub const _SC_THREAD_ROBUST_PRIO_INHERIT: c_int = 0x007c; ++pub const _SC_THREAD_ROBUST_PRIO_PROTECT: c_int = 0x007d; ++pub const _SC_THREAD_SPORADIC_SERVER: c_int = 0x007e; ++pub const _SC_TIMEOUTS: c_int = 0x007f; ++pub const _SC_TRACE: c_int = 0x0080; ++pub const _SC_TRACE_EVENT_FILTER: c_int = 0x0081; ++pub const _SC_TRACE_EVENT_NAME_MAX: c_int = 0x0082; ++pub const _SC_TRACE_INHERIT: c_int = 0x0083; ++pub const _SC_TRACE_LOG: c_int = 0x0084; ++pub const _SC_TRACE_NAME_MAX: c_int = 0x0085; ++pub const _SC_TRACE_SYS_MAX: c_int = 0x0086; ++pub const _SC_TRACE_USER_EVENT_MAX: c_int = 0x0087; ++pub const _SC_TYPED_MEMORY_OBJECTS: c_int = 0x0088; ++pub const _SC_V7_ILP32_OFF32: c_int = 0x0089; ++pub const _SC_V7_ILP32_OFFBIG: c_int = 0x008a; ++pub const _SC_V7_LP64_OFF64: c_int = 0x008b; ++pub const _SC_V7_LPBIG_OFFBIG: c_int = 0x008c; ++pub const _SC_XOPEN_STREAMS: c_int = 0x008d; ++pub const _SC_XOPEN_UUCP: c_int = 0x008e; ++pub const _SC_LEVEL1_ICACHE_SIZE: c_int = 0x008f; ++pub const _SC_LEVEL1_ICACHE_ASSOC: c_int = 0x0090; ++pub const _SC_LEVEL1_ICACHE_LINESIZE: c_int = 0x0091; ++pub const _SC_LEVEL1_DCACHE_SIZE: c_int = 0x0092; ++pub const _SC_LEVEL1_DCACHE_ASSOC: c_int = 0x0093; ++pub const _SC_LEVEL1_DCACHE_LINESIZE: c_int = 0x0094; ++pub const _SC_LEVEL2_CACHE_SIZE: c_int = 0x0095; ++pub const _SC_LEVEL2_CACHE_ASSOC: c_int = 0x0096; ++pub const _SC_LEVEL2_CACHE_LINESIZE: c_int = 0x0097; ++pub const _SC_LEVEL3_CACHE_SIZE: c_int = 0x0098; ++pub const _SC_LEVEL3_CACHE_ASSOC: c_int = 0x0099; ++pub const _SC_LEVEL3_CACHE_LINESIZE: c_int = 0x009a; ++pub const _SC_LEVEL4_CACHE_SIZE: c_int = 0x009b; ++pub const _SC_LEVEL4_CACHE_ASSOC: c_int = 0x009c; ++pub const _SC_LEVEL4_CACHE_LINESIZE: c_int = 0x009d; ++ ++pub const F_LOCK: c_int = 1; ++pub const F_TEST: c_int = 3; ++pub const F_TLOCK: c_int = 2; ++pub const F_ULOCK: c_int = 0; ++ ++pub const F_SEAL_FUTURE_WRITE: c_int = 0x0010; ++ ++pub const IFF_LOWER_UP: c_int = 0x10000; ++pub const IFF_DORMANT: c_int = 0x20000; ++pub const IFF_ECHO: c_int = 0x40000; ++ ++pub const PTHREAD_BARRIER_SERIAL_THREAD: c_int = -1; ++pub const PTHREAD_MUTEX_NORMAL: c_int = 0; ++pub const PTHREAD_MUTEX_RECURSIVE: c_int = 1; ++pub const PTHREAD_MUTEX_ERRORCHECK: c_int = 2; ++pub const PTHREAD_MUTEX_DEFAULT: c_int = PTHREAD_MUTEX_NORMAL; ++ ++pub const PTHREAD_EXPLICIT_SCHED: c_int = 0; ++pub const PTHREAD_INHERIT_SCHED: c_int = 1; ++ ++// stdio.h ++pub const RENAME_NOREPLACE: c_int = 1; ++pub const RENAME_EXCHANGE: c_int = 2; ++pub const RENAME_WHITEOUT: c_int = 4; ++ ++pub const FIOCLEX: c_int = 0x5451; ++pub const FIONCLEX: c_int = 0x5450; ++ ++pub const SIGCHLD: c_int = 17; ++pub const SIGBUS: c_int = 7; ++pub const SIGUSR1: c_int = 10; ++pub const SIGUSR2: c_int = 12; ++pub const SIGCONT: c_int = 18; ++pub const SIGSTOP: c_int = 19; ++pub const SIGTSTP: c_int = 20; ++pub const SIGURG: c_int = 23; ++pub const SIGIO: c_int = 29; ++pub const SIGSYS: c_int = 31; ++pub const SIGSTKFLT: c_int = 16; ++#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")] ++pub const SIGUNUSED: c_int = 31; ++pub const SIGTTIN: c_int = 21; ++pub const SIGTTOU: c_int = 22; ++pub const SIGXCPU: c_int = 24; ++pub const SIGXFSZ: c_int = 25; ++pub const SIGVTALRM: c_int = 26; ++pub const SIGPROF: c_int = 27; ++pub const SIGWINCH: c_int = 28; ++pub const SIGPOLL: c_int = 29; ++pub const SIGPWR: c_int = 30; ++pub const SIG_SETMASK: c_int = 2; ++pub const SIG_BLOCK: c_int = 0x000000; ++pub const SIG_UNBLOCK: c_int = 0x01; ++ ++pub const RUSAGE_CHILDREN: c_int = -1; ++ ++pub const LC_PAPER: c_int = 7; ++pub const LC_NAME: c_int = 8; ++pub const LC_ADDRESS: c_int = 9; ++pub const LC_TELEPHONE: c_int = 10; ++pub const LC_MEASUREMENT: c_int = 11; ++pub const LC_IDENTIFICATION: c_int = 12; ++pub const LC_PAPER_MASK: c_int = 1 << LC_PAPER; ++pub const LC_NAME_MASK: c_int = 1 << LC_NAME; ++pub const LC_ADDRESS_MASK: c_int = 1 << LC_ADDRESS; ++pub const LC_TELEPHONE_MASK: c_int = 1 << LC_TELEPHONE; ++pub const LC_MEASUREMENT_MASK: c_int = 1 << LC_MEASUREMENT; ++pub const LC_IDENTIFICATION_MASK: c_int = 1 << LC_IDENTIFICATION; ++pub const LC_ALL_MASK: c_int = crate::LC_CTYPE_MASK ++ | crate::LC_NUMERIC_MASK ++ | crate::LC_TIME_MASK ++ | crate::LC_COLLATE_MASK ++ | crate::LC_MONETARY_MASK ++ | crate::LC_MESSAGES_MASK ++ | LC_PAPER_MASK ++ | LC_NAME_MASK ++ | LC_ADDRESS_MASK ++ | LC_TELEPHONE_MASK ++ | LC_MEASUREMENT_MASK ++ | LC_IDENTIFICATION_MASK; ++ ++pub const MAP_ANON: c_int = 0x0020; ++pub const MAP_ANONYMOUS: c_int = 0x0020; ++pub const MAP_GROWSDOWN: c_int = 0x0100; ++pub const MAP_DENYWRITE: c_int = 0x0800; ++pub const MAP_EXECUTABLE: c_int = 0x01000; ++pub const MAP_LOCKED: c_int = 0x02000; ++pub const MAP_NORESERVE: c_int = 0x04000; ++pub const MAP_POPULATE: c_int = 0x08000; ++pub const MAP_NONBLOCK: c_int = 0x010000; ++pub const MAP_STACK: c_int = 0x020000; ++ ++pub const EDEADLK: c_int = 35; ++pub const ENAMETOOLONG: c_int = 36; ++pub const ENOLCK: c_int = 37; ++pub const ENOSYS: c_int = 38; ++pub const ENOTEMPTY: c_int = 39; ++pub const ELOOP: c_int = 40; ++pub const ENOMSG: c_int = 42; ++pub const EIDRM: c_int = 43; ++pub const ECHRNG: c_int = 44; ++pub const EL2NSYNC: c_int = 45; ++pub const EL3HLT: c_int = 46; ++pub const EL3RST: c_int = 47; ++pub const ELNRNG: c_int = 48; ++pub const EUNATCH: c_int = 49; ++pub const ENOCSI: c_int = 50; ++pub const EL2HLT: c_int = 51; ++pub const EBADE: c_int = 52; ++pub const EBADR: c_int = 53; ++pub const EXFULL: c_int = 54; ++pub const ENOANO: c_int = 55; ++pub const EBADRQC: c_int = 56; ++pub const EBADSLT: c_int = 57; ++ ++pub const EMULTIHOP: c_int = 72; ++pub const EBADMSG: c_int = 74; ++pub const EOVERFLOW: c_int = 75; ++pub const ENOTUNIQ: c_int = 76; ++pub const EBADFD: c_int = 77; ++pub const EREMCHG: c_int = 78; ++pub const ELIBACC: c_int = 79; ++pub const ELIBBAD: c_int = 80; ++pub const ELIBSCN: c_int = 81; ++pub const ELIBMAX: c_int = 82; ++pub const ELIBEXEC: c_int = 83; ++pub const EILSEQ: c_int = 84; ++pub const ERESTART: c_int = 85; ++pub const ESTRPIPE: c_int = 86; ++pub const EUSERS: c_int = 87; ++pub const ENOTSOCK: c_int = 88; ++pub const EDESTADDRREQ: c_int = 89; ++pub const EMSGSIZE: c_int = 90; ++pub const EPROTOTYPE: c_int = 91; ++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 EADDRINUSE: c_int = 98; ++pub const EADDRNOTAVAIL: c_int = 99; ++pub const ENETDOWN: c_int = 100; ++pub const ENETUNREACH: c_int = 101; ++pub const ENETRESET: c_int = 102; ++pub const ECONNABORTED: c_int = 103; ++pub const ECONNRESET: c_int = 104; ++pub const ENOBUFS: c_int = 105; ++pub const EISCONN: c_int = 106; ++pub const ENOTCONN: c_int = 107; ++pub const ESHUTDOWN: c_int = 108; ++pub const ETOOMANYREFS: c_int = 109; ++pub const ETIMEDOUT: c_int = 110; ++pub const ECONNREFUSED: c_int = 111; ++pub const EHOSTDOWN: c_int = 112; ++pub const EHOSTUNREACH: c_int = 113; ++pub const EALREADY: c_int = 114; ++pub const EINPROGRESS: c_int = 115; ++pub const ESTALE: c_int = 116; ++pub const EUCLEAN: c_int = 117; ++pub const ENOTNAM: c_int = 118; ++pub const ENAVAIL: c_int = 119; ++pub const EISNAM: c_int = 120; ++pub const EREMOTEIO: c_int = 121; ++pub const EDQUOT: c_int = 122; ++pub const ENOMEDIUM: c_int = 123; ++pub const EMEDIUMTYPE: c_int = 124; ++pub const ECANCELED: c_int = 125; ++pub const ENOKEY: c_int = 126; ++pub const EKEYEXPIRED: c_int = 127; ++pub const EKEYREVOKED: c_int = 128; ++pub const EKEYREJECTED: c_int = 129; ++pub const EOWNERDEAD: c_int = 130; ++pub const ENOTRECOVERABLE: c_int = 131; ++ ++pub const SOCK_STREAM: c_int = 1; ++pub const SOCK_DGRAM: c_int = 2; ++pub const SOCK_SEQPACKET: c_int = 5; ++pub const SOCK_DCCP: c_int = 6; ++pub const SOCK_PACKET: c_int = 10; ++ ++pub const IPPROTO_MAX: c_int = 256; ++ ++pub const SOL_SOCKET: c_int = 1; ++pub const SOL_SCTP: c_int = 132; ++pub const SOL_IPX: c_int = 256; ++pub const SOL_AX25: c_int = 257; ++pub const SOL_ATALK: c_int = 258; ++pub const SOL_NETROM: c_int = 259; ++pub const SOL_ROSE: c_int = 260; ++ ++/* DCCP socket options */ ++pub const DCCP_SOCKOPT_PACKET_SIZE: c_int = 1; ++pub const DCCP_SOCKOPT_SERVICE: c_int = 2; ++pub const DCCP_SOCKOPT_CHANGE_L: c_int = 3; ++pub const DCCP_SOCKOPT_CHANGE_R: c_int = 4; ++pub const DCCP_SOCKOPT_GET_CUR_MPS: c_int = 5; ++pub const DCCP_SOCKOPT_SERVER_TIMEWAIT: c_int = 6; ++pub const DCCP_SOCKOPT_SEND_CSCOV: c_int = 10; ++pub const DCCP_SOCKOPT_RECV_CSCOV: c_int = 11; ++pub const DCCP_SOCKOPT_AVAILABLE_CCIDS: c_int = 12; ++pub const DCCP_SOCKOPT_CCID: c_int = 13; ++pub const DCCP_SOCKOPT_TX_CCID: c_int = 14; ++pub const DCCP_SOCKOPT_RX_CCID: c_int = 15; ++pub const DCCP_SOCKOPT_QPOLICY_ID: c_int = 16; ++pub const DCCP_SOCKOPT_QPOLICY_TXQLEN: c_int = 17; ++pub const DCCP_SOCKOPT_CCID_RX_INFO: c_int = 128; ++pub const DCCP_SOCKOPT_CCID_TX_INFO: c_int = 192; ++ ++/// maximum number of services provided on the same listening port ++pub const DCCP_SERVICE_LIST_MAX_LEN: c_int = 32; ++ ++pub const SO_REUSEADDR: c_int = 2; ++pub const SO_TYPE: c_int = 3; ++pub const SO_ERROR: c_int = 4; ++pub const SO_DONTROUTE: c_int = 5; ++pub const SO_BROADCAST: c_int = 6; ++pub const SO_SNDBUF: c_int = 7; ++pub const SO_RCVBUF: c_int = 8; ++pub const SO_KEEPALIVE: c_int = 9; ++pub const SO_OOBINLINE: c_int = 10; ++pub const SO_PRIORITY: c_int = 12; ++pub const SO_LINGER: c_int = 13; ++pub const SO_BSDCOMPAT: c_int = 14; ++pub const SO_REUSEPORT: c_int = 15; ++pub const SO_PASSCRED: c_int = 16; ++pub const SO_PEERCRED: c_int = 17; ++pub const SO_RCVLOWAT: c_int = 18; ++pub const SO_SNDLOWAT: c_int = 19; ++pub const SO_RCVTIMEO: c_int = 20; ++pub const SO_SNDTIMEO: c_int = 21; ++pub const SO_BINDTODEVICE: c_int = 25; ++pub const SO_ATTACH_FILTER: c_int = 26; ++pub const SO_DETACH_FILTER: c_int = 27; ++pub const SO_GET_FILTER: c_int = SO_ATTACH_FILTER; ++pub const SO_TIMESTAMP: c_int = 29; ++pub const SO_ACCEPTCONN: c_int = 30; ++pub const SO_PEERSEC: c_int = 31; ++pub const SO_SNDBUFFORCE: c_int = 32; ++pub const SO_RCVBUFFORCE: c_int = 33; ++pub const SO_PASSSEC: c_int = 34; ++pub const SO_TIMESTAMPNS: c_int = 35; ++// pub const SO_TIMESTAMPNS_OLD: c_int = 35; ++pub const SO_MARK: c_int = 36; ++pub const SO_TIMESTAMPING: c_int = 37; ++// pub const SO_TIMESTAMPING_OLD: c_int = 37; ++pub const SO_PROTOCOL: c_int = 38; ++pub const SO_DOMAIN: c_int = 39; ++pub const SO_RXQ_OVFL: c_int = 40; ++pub const SO_PEEK_OFF: c_int = 42; ++pub const SO_BUSY_POLL: c_int = 46; ++pub const SCM_TIMESTAMPING_OPT_STATS: c_int = 54; ++pub const SCM_TIMESTAMPING_PKTINFO: c_int = 58; ++pub const SO_TIMESTAMP_NEW: c_int = 63; ++pub const SO_TIMESTAMPNS_NEW: c_int = 64; ++pub const SO_TIMESTAMPING_NEW: c_int = 65; ++ ++// Defined in unix/linux_like/mod.rs ++// pub const SCM_TIMESTAMP: c_int = SO_TIMESTAMP; ++pub const SCM_TIMESTAMPNS: c_int = SO_TIMESTAMPNS; ++pub const SCM_TIMESTAMPING: c_int = SO_TIMESTAMPING; ++ ++pub const IPTOS_ECN_NOTECT: u8 = 0x00; ++ ++pub const O_ACCMODE: c_int = 3; ++pub const O_APPEND: c_int = 1024; ++pub const O_CREAT: c_int = 64; ++pub const O_EXCL: c_int = 128; ++pub const O_NOCTTY: c_int = 256; ++pub const O_NONBLOCK: c_int = 2048; ++pub const O_SYNC: c_int = 0x101000; ++pub const O_ASYNC: c_int = 0x2000; ++pub const O_NDELAY: c_int = 0x800; ++pub const O_DSYNC: c_int = 4096; ++pub const O_RSYNC: c_int = O_SYNC; ++ ++pub const NI_MAXHOST: size_t = 1025; ++pub const NI_MAXSERV: size_t = 32; ++ ++pub const NI_NOFQDN: c_int = 0x00000001; ++pub const NI_NUMERICHOST: c_int = 0x00000002; ++pub const NI_NAMEREQD: c_int = 0x00000004; ++pub const NI_NUMERICSERV: c_int = 0x00000008; ++pub const NI_DGRAM: c_int = 0x00000010; ++ ++pub const NCCS: usize = 19; ++pub const TCSBRKP: c_int = 0x5425; ++pub const TCSANOW: c_int = 0; ++pub const TCSADRAIN: c_int = 0x1; ++pub const TCSAFLUSH: c_int = 0x2; ++pub const VEOF: usize = 4; ++pub const VEOL: usize = 11; ++pub const VEOL2: usize = 16; ++pub const VMIN: usize = 6; ++pub const IEXTEN: crate::tcflag_t = 0x00008000; ++pub const TOSTOP: crate::tcflag_t = 0x00000100; ++pub const FLUSHO: crate::tcflag_t = 0x00001000; ++pub const EXTPROC: crate::tcflag_t = 0o200000; ++ ++pub const MAP_HUGETLB: c_int = 0x040000; ++ ++pub const PTRACE_TRACEME: c_int = 0; ++pub const PTRACE_PEEKTEXT: c_int = 1; ++pub const PTRACE_PEEKDATA: c_int = 2; ++pub const PTRACE_PEEKUSER: c_int = 3; ++pub const PTRACE_POKETEXT: c_int = 4; ++pub const PTRACE_POKEDATA: c_int = 5; ++pub const PTRACE_POKEUSER: c_int = 6; ++pub const PTRACE_CONT: c_int = 7; ++pub const PTRACE_KILL: c_int = 8; ++pub const PTRACE_SINGLESTEP: c_int = 9; ++pub const PTRACE_GETREGS: c_int = 12; ++pub const PTRACE_SETREGS: c_int = 13; ++pub const PTRACE_ATTACH: c_int = 16; ++pub const PTRACE_DETACH: c_int = 17; ++pub const PTRACE_SYSCALL: c_int = 24; ++pub const PTRACE_SETOPTIONS: c_int = 0x4200; ++pub const PTRACE_GETEVENTMSG: c_int = 0x4201; ++pub const PTRACE_GETSIGINFO: c_int = 0x4202; ++pub const PTRACE_SETSIGINFO: c_int = 0x4203; ++pub const PTRACE_GETREGSET: c_int = 0x4204; ++pub const PTRACE_SETREGSET: c_int = 0x4205; ++pub const PTRACE_SECCOMP_GET_METADATA: c_int = 0x420d; ++ ++pub const PTRACE_EVENT_STOP: c_int = 128; ++ ++pub const F_GETLK: c_int = 5; ++pub const F_GETOWN: c_int = 9; ++pub const F_SETOWN: c_int = 8; ++pub const F_SETLK: c_int = 6; ++pub const F_SETLKW: c_int = 7; ++pub const F_RDLCK: c_int = 0; ++pub const F_WRLCK: c_int = 1; ++pub const F_UNLCK: c_int = 2; ++pub const F_OFD_GETLK: c_int = 36; ++pub const F_OFD_SETLK: c_int = 37; ++pub const F_OFD_SETLKW: c_int = 38; ++ ++pub const RLIMIT_CPU: c_int = 0; ++pub const RLIMIT_FSIZE: c_int = 1; ++pub const RLIMIT_DATA: c_int = 2; ++pub const RLIMIT_STACK: c_int = 3; ++pub const RLIMIT_CORE: c_int = 4; ++pub const RLIMIT_RSS: c_int = 5; ++pub const RLIMIT_NPROC: c_int = 6; ++pub const RLIMIT_NOFILE: c_int = 7; ++pub const RLIMIT_MEMLOCK: c_int = 8; ++pub const RLIMIT_AS: c_int = 9; ++pub const RLIMIT_LOCKS: c_int = 10; ++pub const RLIMIT_SIGPENDING: c_int = 11; ++pub const RLIMIT_MSGQUEUE: c_int = 12; ++pub const RLIMIT_NICE: c_int = 13; ++pub const RLIMIT_RTPRIO: c_int = 14; ++ ++#[deprecated(since = "0.2.64", note = "Not stable across OS versions")] ++pub const RLIM_NLIMITS: c_int = 16; ++pub const RLIM_INFINITY: crate::rlim_t = !0; ++ ++pub const TCGETS: c_int = 0x5401; ++pub const TCSETS: c_int = 0x5402; ++pub const TCSETSW: c_int = 0x5403; ++pub const TCSETSF: c_int = 0x5404; ++pub const TCGETS2: c_int = 0x802c542a; ++pub const TCSETS2: c_int = 0x402c542b; ++pub const TCSETSW2: c_int = 0x402c542c; ++pub const TCSETSF2: c_int = 0x402c542d; ++pub const TCGETA: c_int = 0x5405; ++pub const TCSETA: c_int = 0x5406; ++pub const TCSETAW: c_int = 0x5407; ++pub const TCSETAF: c_int = 0x5408; ++pub const TCSBRK: c_int = 0x5409; ++pub const TCXONC: c_int = 0x540A; ++pub const TCFLSH: c_int = 0x540B; ++pub const TIOCGSOFTCAR: c_int = 0x5419; ++pub const TIOCSSOFTCAR: c_int = 0x541A; ++pub const TIOCINQ: c_int = 0x541B; ++pub const TIOCLINUX: c_int = 0x541C; ++pub const TIOCGSERIAL: c_int = 0x541E; ++pub const TIOCEXCL: c_int = 0x540C; ++pub const TIOCNXCL: c_int = 0x540D; ++pub const TIOCSCTTY: c_int = 0x540E; ++pub const TIOCGPGRP: c_int = 0x540F; ++pub const TIOCSPGRP: c_int = 0x5410; ++pub const TIOCOUTQ: c_int = 0x5411; ++pub const TIOCSTI: c_int = 0x5412; ++pub const TIOCGWINSZ: c_int = 0x5413; ++pub const TIOCSWINSZ: c_int = 0x5414; ++pub const TIOCMGET: c_int = 0x5415; ++pub const TIOCMBIS: c_int = 0x5416; ++pub const TIOCMBIC: c_int = 0x5417; ++pub const TIOCMSET: c_int = 0x5418; ++pub const FIONREAD: c_int = 0x541B; ++pub const TIOCCONS: c_int = 0x541D; ++pub const TIOCSBRK: c_int = 0x5427; ++pub const TIOCCBRK: c_int = 0x5428; ++cfg_if! { ++ if #[cfg(any( ++ target_arch = "x86", ++ target_arch = "x86_64", ++ target_arch = "arm", ++ target_arch = "aarch64", ++ target_arch = "riscv64", ++ target_arch = "s390x" ++ ))] { ++ pub const FICLONE: c_int = 0x40049409; ++ pub const FICLONERANGE: c_int = 0x4020940D; ++ } else if #[cfg(any( ++ target_arch = "mips", ++ target_arch = "mips64", ++ target_arch = "powerpc", ++ target_arch = "powerpc64" ++ ))] { ++ pub const FICLONE: c_int = 0x80049409; ++ pub const FICLONERANGE: c_int = 0x8020940D; ++ } ++} ++ ++pub const ST_RDONLY: c_ulong = 1; ++pub const ST_NOSUID: c_ulong = 2; ++pub const ST_NODEV: c_ulong = 4; ++pub const ST_NOEXEC: c_ulong = 8; ++pub const ST_SYNCHRONOUS: c_ulong = 16; ++pub const ST_MANDLOCK: c_ulong = 64; ++pub const ST_NOATIME: c_ulong = 1024; ++pub const ST_NODIRATIME: c_ulong = 2048; ++pub const ST_RELATIME: c_ulong = 4096; ++ ++pub const RTLD_NOLOAD: c_int = 0x4; ++pub const RTLD_NODELETE: c_int = 0x1000; ++ ++pub const SEM_FAILED: *mut sem_t = 0 as *mut sem_t; ++ ++pub const AI_PASSIVE: c_int = 0x00000001; ++pub const AI_CANONNAME: c_int = 0x00000002; ++pub const AI_NUMERICHOST: c_int = 0x00000004; ++pub const AI_NUMERICSERV: c_int = 0x00000008; ++pub const AI_MASK: c_int = ++ AI_PASSIVE | AI_CANONNAME | AI_NUMERICHOST | AI_NUMERICSERV | AI_ADDRCONFIG; ++pub const AI_ALL: c_int = 0x00000100; ++pub const AI_V4MAPPED_CFG: c_int = 0x00000200; ++pub const AI_ADDRCONFIG: c_int = 0x00000400; ++pub const AI_V4MAPPED: c_int = 0x00000800; ++pub const AI_DEFAULT: c_int = AI_V4MAPPED_CFG | AI_ADDRCONFIG; ++ ++// linux/kexec.h ++pub const KEXEC_ON_CRASH: c_int = 0x00000001; ++pub const KEXEC_PRESERVE_CONTEXT: c_int = 0x00000002; ++pub const KEXEC_ARCH_MASK: c_int = 0xffff0000; ++pub const KEXEC_FILE_UNLOAD: c_int = 0x00000001; ++pub const KEXEC_FILE_ON_CRASH: c_int = 0x00000002; ++pub const KEXEC_FILE_NO_INITRAMFS: c_int = 0x00000004; ++ ++pub const LINUX_REBOOT_MAGIC1: c_int = 0xfee1dead; ++pub const LINUX_REBOOT_MAGIC2: c_int = 672274793; ++pub const LINUX_REBOOT_MAGIC2A: c_int = 85072278; ++pub const LINUX_REBOOT_MAGIC2B: c_int = 369367448; ++pub const LINUX_REBOOT_MAGIC2C: c_int = 537993216; ++ ++pub const LINUX_REBOOT_CMD_RESTART: c_int = 0x01234567; ++pub const LINUX_REBOOT_CMD_HALT: c_int = 0xCDEF0123; ++pub const LINUX_REBOOT_CMD_CAD_ON: c_int = 0x89ABCDEF; ++pub const LINUX_REBOOT_CMD_CAD_OFF: c_int = 0x00000000; ++pub const LINUX_REBOOT_CMD_POWER_OFF: c_int = 0x4321FEDC; ++pub const LINUX_REBOOT_CMD_RESTART2: c_int = 0xA1B2C3D4; ++pub const LINUX_REBOOT_CMD_SW_SUSPEND: c_int = 0xD000FCE2; ++pub const LINUX_REBOOT_CMD_KEXEC: c_int = 0x45584543; ++ ++pub const REG_BASIC: c_int = 0; ++pub const REG_EXTENDED: c_int = 1; ++pub const REG_ICASE: c_int = 2; ++pub const REG_NOSUB: c_int = 4; ++pub const REG_NEWLINE: c_int = 8; ++pub const REG_NOSPEC: c_int = 16; ++pub const REG_PEND: c_int = 32; ++pub const REG_DUMP: c_int = 128; ++ ++pub const REG_NOMATCH: c_int = 1; ++pub const REG_BADPAT: c_int = 2; ++pub const REG_ECOLLATE: c_int = 3; ++pub const REG_ECTYPE: c_int = 4; ++pub const REG_EESCAPE: c_int = 5; ++pub const REG_ESUBREG: c_int = 6; ++pub const REG_EBRACK: c_int = 7; ++pub const REG_EPAREN: c_int = 8; ++pub const REG_EBRACE: c_int = 9; ++pub const REG_BADBR: c_int = 10; ++pub const REG_ERANGE: c_int = 11; ++pub const REG_ESPACE: c_int = 12; ++pub const REG_BADRPT: c_int = 13; ++pub const REG_EMPTY: c_int = 14; ++pub const REG_ASSERT: c_int = 15; ++pub const REG_INVARG: c_int = 16; ++pub const REG_ATOI: c_int = 255; ++pub const REG_ITOA: c_int = 256; ++ ++pub const REG_NOTBOL: c_int = 1; ++pub const REG_NOTEOL: c_int = 2; ++pub const REG_STARTEND: c_int = 4; ++pub const REG_TRACE: c_int = 256; ++pub const REG_LARGE: c_int = 512; ++pub const REG_BACKR: c_int = 1024; ++ ++pub const MCL_CURRENT: c_int = 0x0001; ++pub const MCL_FUTURE: c_int = 0x0002; ++pub const MCL_ONFAULT: c_int = 0x0004; ++ ++pub const CBAUD: crate::tcflag_t = 0o0010017; ++pub const TAB1: crate::tcflag_t = 0x00000800; ++pub const TAB2: crate::tcflag_t = 0x00001000; ++pub const TAB3: crate::tcflag_t = 0x00001800; ++pub const CR1: crate::tcflag_t = 0x00000200; ++pub const CR2: crate::tcflag_t = 0x00000400; ++pub const CR3: crate::tcflag_t = 0x00000600; ++pub const FF1: crate::tcflag_t = 0x00008000; ++pub const BS1: crate::tcflag_t = 0x00002000; ++pub const VT1: crate::tcflag_t = 0x00004000; ++pub const VWERASE: usize = 14; ++pub const VREPRINT: usize = 12; ++pub const VSUSP: usize = 10; ++pub const VSTART: usize = 8; ++pub const VSTOP: usize = 9; ++pub const VDISCARD: usize = 13; ++pub const VTIME: usize = 5; ++pub const IXON: crate::tcflag_t = 0x00000400; ++pub const IXOFF: crate::tcflag_t = 0x00001000; ++pub const ONLCR: crate::tcflag_t = 0x4; ++pub const CSIZE: crate::tcflag_t = 0x00000030; ++pub const CS6: crate::tcflag_t = 0x00000010; ++pub const CS7: crate::tcflag_t = 0x00000020; ++pub const CS8: crate::tcflag_t = 0x00000030; ++pub const CSTOPB: crate::tcflag_t = 0x00000040; ++pub const CREAD: crate::tcflag_t = 0x00000080; ++pub const PARENB: crate::tcflag_t = 0x00000100; ++pub const PARODD: crate::tcflag_t = 0x00000200; ++pub const HUPCL: crate::tcflag_t = 0x00000400; ++pub const CLOCAL: crate::tcflag_t = 0x00000800; ++pub const ECHOKE: crate::tcflag_t = 0x00000800; ++pub const ECHOE: crate::tcflag_t = 0x00000010; ++pub const ECHOK: crate::tcflag_t = 0x00000020; ++pub const ECHONL: crate::tcflag_t = 0x00000040; ++pub const ECHOPRT: crate::tcflag_t = 0x00000400; ++pub const ECHOCTL: crate::tcflag_t = 0x00000200; ++pub const ISIG: crate::tcflag_t = 0x00000001; ++pub const ICANON: crate::tcflag_t = 0x00000002; ++pub const PENDIN: crate::tcflag_t = 0x00004000; ++pub const NOFLSH: crate::tcflag_t = 0x00000080; ++pub const VSWTC: usize = 7; ++pub const OLCUC: crate::tcflag_t = 0o000002; ++pub const NLDLY: crate::tcflag_t = 0o000400; ++pub const CRDLY: crate::tcflag_t = 0o003000; ++pub const TABDLY: crate::tcflag_t = 0o014000; ++pub const BSDLY: crate::tcflag_t = 0o020000; ++pub const FFDLY: crate::tcflag_t = 0o100000; ++pub const VTDLY: crate::tcflag_t = 0o040000; ++pub const XTABS: crate::tcflag_t = 0o014000; ++ ++pub const B0: crate::speed_t = 0o000000; ++pub const B50: crate::speed_t = 0o000001; ++pub const B75: crate::speed_t = 0o000002; ++pub const B110: crate::speed_t = 0o000003; ++pub const B134: crate::speed_t = 0o000004; ++pub const B150: crate::speed_t = 0o000005; ++pub const B200: crate::speed_t = 0o000006; ++pub const B300: crate::speed_t = 0o000007; ++pub const B600: crate::speed_t = 0o000010; ++pub const B1200: crate::speed_t = 0o000011; ++pub const B1800: crate::speed_t = 0o000012; ++pub const B2400: crate::speed_t = 0o000013; ++pub const B4800: crate::speed_t = 0o000014; ++pub const B9600: crate::speed_t = 0o000015; ++pub const B19200: crate::speed_t = 0o000016; ++pub const B38400: crate::speed_t = 0o000017; ++pub const EXTA: crate::speed_t = B19200; ++pub const EXTB: crate::speed_t = B38400; ++pub const BOTHER: crate::speed_t = 0o010000; ++pub const B57600: crate::speed_t = 0o010001; ++pub const B115200: crate::speed_t = 0o010002; ++pub const B230400: crate::speed_t = 0o010003; ++pub const B460800: crate::speed_t = 0o010004; ++pub const B500000: crate::speed_t = 0o010005; ++pub const B576000: crate::speed_t = 0o010006; ++pub const B921600: crate::speed_t = 0o010007; ++pub const B1000000: crate::speed_t = 0o010010; ++pub const B1152000: crate::speed_t = 0o010011; ++pub const B1500000: crate::speed_t = 0o010012; ++pub const B2000000: crate::speed_t = 0o010013; ++pub const B2500000: crate::speed_t = 0o010014; ++pub const B3000000: crate::speed_t = 0o010015; ++pub const B3500000: crate::speed_t = 0o010016; ++pub const B4000000: crate::speed_t = 0o010017; ++pub const IBSHIFT: crate::tcflag_t = 16; ++ ++pub const BLKIOMIN: c_int = 0x1278; ++pub const BLKIOOPT: c_int = 0x1279; ++pub const BLKSSZGET: c_int = 0x1268; ++pub const BLKPBSZGET: c_int = 0x127B; ++ ++cfg_if! { ++ // Those type are constructed using the _IOC macro ++ // DD-SS_SSSS_SSSS_SSSS-TTTT_TTTT-NNNN_NNNN ++ // where D stands for direction (either None (00), Read (01) or Write (11)) ++ // where S stands for size (int, long, struct...) ++ // where T stands for type ('f','v','X'...) ++ // where N stands for NR (NumbeR) ++ if #[cfg(any(target_arch = "x86", target_arch = "arm"))] { ++ pub const FS_IOC_GETFLAGS: c_int = 0x80046601; ++ pub const FS_IOC_SETFLAGS: c_int = 0x40046602; ++ pub const FS_IOC_GETVERSION: c_int = 0x80047601; ++ pub const FS_IOC_SETVERSION: c_int = 0x40047602; ++ pub const FS_IOC32_GETFLAGS: c_int = 0x80046601; ++ pub const FS_IOC32_SETFLAGS: c_int = 0x40046602; ++ pub const FS_IOC32_GETVERSION: c_int = 0x80047601; ++ pub const FS_IOC32_SETVERSION: c_int = 0x40047602; ++ } else if #[cfg(any( ++ target_arch = "x86_64", ++ target_arch = "riscv64", ++ target_arch = "aarch64" ++ ))] { ++ pub const FS_IOC_GETFLAGS: c_int = 0x80086601; ++ pub const FS_IOC_SETFLAGS: c_int = 0x40086602; ++ pub const FS_IOC_GETVERSION: c_int = 0x80087601; ++ pub const FS_IOC_SETVERSION: c_int = 0x40087602; ++ pub const FS_IOC32_GETFLAGS: c_int = 0x80046601; ++ pub const FS_IOC32_SETFLAGS: c_int = 0x40046602; ++ pub const FS_IOC32_GETVERSION: c_int = 0x80047601; ++ pub const FS_IOC32_SETVERSION: c_int = 0x40047602; ++ } ++} ++ ++pub const EAI_AGAIN: c_int = 2; ++pub const EAI_BADFLAGS: c_int = 3; ++pub const EAI_FAIL: c_int = 4; ++pub const EAI_FAMILY: c_int = 5; ++pub const EAI_MEMORY: c_int = 6; ++pub const EAI_NODATA: c_int = 7; ++pub const EAI_NONAME: c_int = 8; ++pub const EAI_SERVICE: c_int = 9; ++pub const EAI_SOCKTYPE: c_int = 10; ++pub const EAI_SYSTEM: c_int = 11; ++pub const EAI_OVERFLOW: c_int = 14; ++ ++pub const NETLINK_ROUTE: c_int = 0; ++pub const NETLINK_UNUSED: c_int = 1; ++pub const NETLINK_USERSOCK: c_int = 2; ++pub const NETLINK_FIREWALL: c_int = 3; ++pub const NETLINK_SOCK_DIAG: c_int = 4; ++pub const NETLINK_NFLOG: c_int = 5; ++pub const NETLINK_XFRM: c_int = 6; ++pub const NETLINK_SELINUX: c_int = 7; ++pub const NETLINK_ISCSI: c_int = 8; ++pub const NETLINK_AUDIT: c_int = 9; ++pub const NETLINK_FIB_LOOKUP: c_int = 10; ++pub const NETLINK_CONNECTOR: c_int = 11; ++pub const NETLINK_NETFILTER: c_int = 12; ++pub const NETLINK_IP6_FW: c_int = 13; ++pub const NETLINK_DNRTMSG: c_int = 14; ++pub const NETLINK_KOBJECT_UEVENT: c_int = 15; ++pub const NETLINK_GENERIC: c_int = 16; ++pub const NETLINK_SCSITRANSPORT: c_int = 18; ++pub const NETLINK_ECRYPTFS: c_int = 19; ++pub const NETLINK_RDMA: c_int = 20; ++pub const NETLINK_CRYPTO: c_int = 21; ++pub const NETLINK_INET_DIAG: c_int = NETLINK_SOCK_DIAG; ++ ++pub const MAX_LINKS: c_int = 32; ++ ++pub const NLM_F_REQUEST: c_int = 1; ++pub const NLM_F_MULTI: c_int = 2; ++pub const NLM_F_ACK: c_int = 4; ++pub const NLM_F_ECHO: c_int = 8; ++pub const NLM_F_DUMP_INTR: c_int = 16; ++pub const NLM_F_DUMP_FILTERED: c_int = 32; ++ ++pub const NLM_F_ROOT: c_int = 0x100; ++pub const NLM_F_MATCH: c_int = 0x200; ++pub const NLM_F_ATOMIC: c_int = 0x400; ++pub const NLM_F_DUMP: c_int = NLM_F_ROOT | NLM_F_MATCH; ++ ++pub const NLM_F_REPLACE: c_int = 0x100; ++pub const NLM_F_EXCL: c_int = 0x200; ++pub const NLM_F_CREATE: c_int = 0x400; ++pub const NLM_F_APPEND: c_int = 0x800; ++ ++pub const NLMSG_NOOP: c_int = 0x1; ++pub const NLMSG_ERROR: c_int = 0x2; ++pub const NLMSG_DONE: c_int = 0x3; ++pub const NLMSG_OVERRUN: c_int = 0x4; ++pub const NLMSG_MIN_TYPE: c_int = 0x10; ++ ++// linux/netfilter/nfnetlink.h ++pub const NFNLGRP_NONE: c_int = 0; ++pub const NFNLGRP_CONNTRACK_NEW: c_int = 1; ++pub const NFNLGRP_CONNTRACK_UPDATE: c_int = 2; ++pub const NFNLGRP_CONNTRACK_DESTROY: c_int = 3; ++pub const NFNLGRP_CONNTRACK_EXP_NEW: c_int = 4; ++pub const NFNLGRP_CONNTRACK_EXP_UPDATE: c_int = 5; ++pub const NFNLGRP_CONNTRACK_EXP_DESTROY: c_int = 6; ++pub const NFNLGRP_NFTABLES: c_int = 7; ++pub const NFNLGRP_ACCT_QUOTA: c_int = 8; ++ ++pub const NFNETLINK_V0: c_int = 0; ++ ++pub const NFNL_SUBSYS_NONE: c_int = 0; ++pub const NFNL_SUBSYS_CTNETLINK: c_int = 1; ++pub const NFNL_SUBSYS_CTNETLINK_EXP: c_int = 2; ++pub const NFNL_SUBSYS_QUEUE: c_int = 3; ++pub const NFNL_SUBSYS_ULOG: c_int = 4; ++pub const NFNL_SUBSYS_OSF: c_int = 5; ++pub const NFNL_SUBSYS_IPSET: c_int = 6; ++pub const NFNL_SUBSYS_ACCT: c_int = 7; ++pub const NFNL_SUBSYS_CTNETLINK_TIMEOUT: c_int = 8; ++pub const NFNL_SUBSYS_CTHELPER: c_int = 9; ++pub const NFNL_SUBSYS_NFTABLES: c_int = 10; ++pub const NFNL_SUBSYS_NFT_COMPAT: c_int = 11; ++pub const NFNL_SUBSYS_COUNT: c_int = 12; ++ ++pub const NFNL_MSG_BATCH_BEGIN: c_int = NLMSG_MIN_TYPE; ++pub const NFNL_MSG_BATCH_END: c_int = NLMSG_MIN_TYPE + 1; ++ ++// linux/netfilter/nfnetlink_log.h ++pub const NFULNL_MSG_PACKET: c_int = 0; ++pub const NFULNL_MSG_CONFIG: c_int = 1; ++ ++pub const NFULA_UNSPEC: c_int = 0; ++pub const NFULA_PACKET_HDR: c_int = 1; ++pub const NFULA_MARK: c_int = 2; ++pub const NFULA_TIMESTAMP: c_int = 3; ++pub const NFULA_IFINDEX_INDEV: c_int = 4; ++pub const NFULA_IFINDEX_OUTDEV: c_int = 5; ++pub const NFULA_IFINDEX_PHYSINDEV: c_int = 6; ++pub const NFULA_IFINDEX_PHYSOUTDEV: c_int = 7; ++pub const NFULA_HWADDR: c_int = 8; ++pub const NFULA_PAYLOAD: c_int = 9; ++pub const NFULA_PREFIX: c_int = 10; ++pub const NFULA_UID: c_int = 11; ++pub const NFULA_SEQ: c_int = 12; ++pub const NFULA_SEQ_GLOBAL: c_int = 13; ++pub const NFULA_GID: c_int = 14; ++pub const NFULA_HWTYPE: c_int = 15; ++pub const NFULA_HWHEADER: c_int = 16; ++pub const NFULA_HWLEN: c_int = 17; ++pub const NFULA_CT: c_int = 18; ++pub const NFULA_CT_INFO: c_int = 19; ++ ++pub const NFULNL_CFG_CMD_NONE: c_int = 0; ++pub const NFULNL_CFG_CMD_BIND: c_int = 1; ++pub const NFULNL_CFG_CMD_UNBIND: c_int = 2; ++pub const NFULNL_CFG_CMD_PF_BIND: c_int = 3; ++pub const NFULNL_CFG_CMD_PF_UNBIND: c_int = 4; ++ ++pub const NFULA_CFG_UNSPEC: c_int = 0; ++pub const NFULA_CFG_CMD: c_int = 1; ++pub const NFULA_CFG_MODE: c_int = 2; ++pub const NFULA_CFG_NLBUFSIZ: c_int = 3; ++pub const NFULA_CFG_TIMEOUT: c_int = 4; ++pub const NFULA_CFG_QTHRESH: c_int = 5; ++pub const NFULA_CFG_FLAGS: c_int = 6; ++ ++pub const NFULNL_COPY_NONE: c_int = 0x00; ++pub const NFULNL_COPY_META: c_int = 0x01; ++pub const NFULNL_COPY_PACKET: c_int = 0x02; ++ ++pub const NFULNL_CFG_F_SEQ: c_int = 0x0001; ++pub const NFULNL_CFG_F_SEQ_GLOBAL: c_int = 0x0002; ++pub const NFULNL_CFG_F_CONNTRACK: c_int = 0x0004; ++ ++// linux/netfilter/nfnetlink_log.h ++pub const NFQNL_MSG_PACKET: c_int = 0; ++pub const NFQNL_MSG_VERDICT: c_int = 1; ++pub const NFQNL_MSG_CONFIG: c_int = 2; ++pub const NFQNL_MSG_VERDICT_BATCH: c_int = 3; ++ ++pub const NFQA_UNSPEC: c_int = 0; ++pub const NFQA_PACKET_HDR: c_int = 1; ++pub const NFQA_VERDICT_HDR: c_int = 2; ++pub const NFQA_MARK: c_int = 3; ++pub const NFQA_TIMESTAMP: c_int = 4; ++pub const NFQA_IFINDEX_INDEV: c_int = 5; ++pub const NFQA_IFINDEX_OUTDEV: c_int = 6; ++pub const NFQA_IFINDEX_PHYSINDEV: c_int = 7; ++pub const NFQA_IFINDEX_PHYSOUTDEV: c_int = 8; ++pub const NFQA_HWADDR: c_int = 9; ++pub const NFQA_PAYLOAD: c_int = 10; ++pub const NFQA_CT: c_int = 11; ++pub const NFQA_CT_INFO: c_int = 12; ++pub const NFQA_CAP_LEN: c_int = 13; ++pub const NFQA_SKB_INFO: c_int = 14; ++pub const NFQA_EXP: c_int = 15; ++pub const NFQA_UID: c_int = 16; ++pub const NFQA_GID: c_int = 17; ++pub const NFQA_SECCTX: c_int = 18; ++/* ++ FIXME: These are not yet available in musl sanitized kernel headers and ++ make the tests fail. Enable them once musl has them. ++ ++ See https://github.com/rust-lang/libc/pull/1628 for more details. ++pub const NFQA_VLAN: c_int = 19; ++pub const NFQA_L2HDR: c_int = 20; ++ ++pub const NFQA_VLAN_UNSPEC: c_int = 0; ++pub const NFQA_VLAN_PROTO: c_int = 1; ++pub const NFQA_VLAN_TCI: c_int = 2; ++*/ ++ ++pub const NFQNL_CFG_CMD_NONE: c_int = 0; ++pub const NFQNL_CFG_CMD_BIND: c_int = 1; ++pub const NFQNL_CFG_CMD_UNBIND: c_int = 2; ++pub const NFQNL_CFG_CMD_PF_BIND: c_int = 3; ++pub const NFQNL_CFG_CMD_PF_UNBIND: c_int = 4; ++ ++pub const NFQNL_COPY_NONE: c_int = 0; ++pub const NFQNL_COPY_META: c_int = 1; ++pub const NFQNL_COPY_PACKET: c_int = 2; ++ ++pub const NFQA_CFG_UNSPEC: c_int = 0; ++pub const NFQA_CFG_CMD: c_int = 1; ++pub const NFQA_CFG_PARAMS: c_int = 2; ++pub const NFQA_CFG_QUEUE_MAXLEN: c_int = 3; ++pub const NFQA_CFG_MASK: c_int = 4; ++pub const NFQA_CFG_FLAGS: c_int = 5; ++ ++pub const NFQA_CFG_F_FAIL_OPEN: c_int = 0x0001; ++pub const NFQA_CFG_F_CONNTRACK: c_int = 0x0002; ++pub const NFQA_CFG_F_GSO: c_int = 0x0004; ++pub const NFQA_CFG_F_UID_GID: c_int = 0x0008; ++pub const NFQA_CFG_F_SECCTX: c_int = 0x0010; ++pub const NFQA_CFG_F_MAX: c_int = 0x0020; ++ ++pub const NFQA_SKB_CSUMNOTREADY: c_int = 0x0001; ++pub const NFQA_SKB_GSO: c_int = 0x0002; ++pub const NFQA_SKB_CSUM_NOTVERIFIED: c_int = 0x0004; ++ ++pub const GENL_NAMSIZ: c_int = 16; ++ ++pub const GENL_MIN_ID: c_int = NLMSG_MIN_TYPE; ++pub const GENL_MAX_ID: c_int = 1023; ++ ++pub const GENL_ADMIN_PERM: c_int = 0x01; ++pub const GENL_CMD_CAP_DO: c_int = 0x02; ++pub const GENL_CMD_CAP_DUMP: c_int = 0x04; ++pub const GENL_CMD_CAP_HASPOL: c_int = 0x08; ++pub const GENL_UNS_ADMIN_PERM: c_int = 0x10; ++ ++pub const GENL_ID_CTRL: c_int = NLMSG_MIN_TYPE; ++pub const GENL_ID_VFS_DQUOT: c_int = NLMSG_MIN_TYPE + 1; ++pub const GENL_ID_PMCRAID: c_int = NLMSG_MIN_TYPE + 2; ++ ++pub const CTRL_CMD_UNSPEC: c_int = 0; ++pub const CTRL_CMD_NEWFAMILY: c_int = 1; ++pub const CTRL_CMD_DELFAMILY: c_int = 2; ++pub const CTRL_CMD_GETFAMILY: c_int = 3; ++pub const CTRL_CMD_NEWOPS: c_int = 4; ++pub const CTRL_CMD_DELOPS: c_int = 5; ++pub const CTRL_CMD_GETOPS: c_int = 6; ++pub const CTRL_CMD_NEWMCAST_GRP: c_int = 7; ++pub const CTRL_CMD_DELMCAST_GRP: c_int = 8; ++pub const CTRL_CMD_GETMCAST_GRP: c_int = 9; ++ ++pub const CTRL_ATTR_UNSPEC: c_int = 0; ++pub const CTRL_ATTR_FAMILY_ID: c_int = 1; ++pub const CTRL_ATTR_FAMILY_NAME: c_int = 2; ++pub const CTRL_ATTR_VERSION: c_int = 3; ++pub const CTRL_ATTR_HDRSIZE: c_int = 4; ++pub const CTRL_ATTR_MAXATTR: c_int = 5; ++pub const CTRL_ATTR_OPS: c_int = 6; ++pub const CTRL_ATTR_MCAST_GROUPS: c_int = 7; ++ ++pub const CTRL_ATTR_OP_UNSPEC: c_int = 0; ++pub const CTRL_ATTR_OP_ID: c_int = 1; ++pub const CTRL_ATTR_OP_FLAGS: c_int = 2; ++ ++pub const CTRL_ATTR_MCAST_GRP_UNSPEC: c_int = 0; ++pub const CTRL_ATTR_MCAST_GRP_NAME: c_int = 1; ++pub const CTRL_ATTR_MCAST_GRP_ID: c_int = 2; ++ ++pub const NETLINK_ADD_MEMBERSHIP: c_int = 1; ++pub const NETLINK_DROP_MEMBERSHIP: c_int = 2; ++pub const NETLINK_PKTINFO: c_int = 3; ++pub const NETLINK_BROADCAST_ERROR: c_int = 4; ++pub const NETLINK_NO_ENOBUFS: c_int = 5; ++pub const NETLINK_RX_RING: c_int = 6; ++pub const NETLINK_TX_RING: c_int = 7; ++pub const NETLINK_LISTEN_ALL_NSID: c_int = 8; ++pub const NETLINK_LIST_MEMBERSHIPS: c_int = 9; ++pub const NETLINK_CAP_ACK: c_int = 10; ++pub const NETLINK_EXT_ACK: c_int = 11; ++pub const NETLINK_GET_STRICT_CHK: c_int = 12; ++ ++pub const GRND_NONBLOCK: c_uint = 0x0001; ++pub const GRND_RANDOM: c_uint = 0x0002; ++pub const GRND_INSECURE: c_uint = 0x0004; ++ ++pub const SECCOMP_MODE_DISABLED: c_uint = 0; ++pub const SECCOMP_MODE_STRICT: c_uint = 1; ++pub const SECCOMP_MODE_FILTER: c_uint = 2; ++ ++pub const SECCOMP_FILTER_FLAG_TSYNC: c_ulong = 1; ++pub const SECCOMP_FILTER_FLAG_LOG: c_ulong = 2; ++pub const SECCOMP_FILTER_FLAG_SPEC_ALLOW: c_ulong = 4; ++pub const SECCOMP_FILTER_FLAG_NEW_LISTENER: c_ulong = 8; ++ ++pub const SECCOMP_RET_ACTION_FULL: c_uint = 0xffff0000; ++pub const SECCOMP_RET_ACTION: c_uint = 0x7fff0000; ++pub const SECCOMP_RET_DATA: c_uint = 0x0000ffff; ++ ++pub const SECCOMP_RET_KILL_PROCESS: c_uint = 0x80000000; ++pub const SECCOMP_RET_KILL_THREAD: c_uint = 0x00000000; ++pub const SECCOMP_RET_KILL: c_uint = SECCOMP_RET_KILL_THREAD; ++pub const SECCOMP_RET_TRAP: c_uint = 0x00030000; ++pub const SECCOMP_RET_ERRNO: c_uint = 0x00050000; ++pub const SECCOMP_RET_USER_NOTIF: c_uint = 0x7fc00000; ++pub const SECCOMP_RET_TRACE: c_uint = 0x7ff00000; ++pub const SECCOMP_RET_LOG: c_uint = 0x7ffc0000; ++pub const SECCOMP_RET_ALLOW: c_uint = 0x7fff0000; ++ ++pub const NLA_F_NESTED: c_int = 1 << 15; ++pub const NLA_F_NET_BYTEORDER: c_int = 1 << 14; ++pub const NLA_TYPE_MASK: c_int = !(NLA_F_NESTED | NLA_F_NET_BYTEORDER); ++ ++pub const NLA_ALIGNTO: c_int = 4; ++ ++pub const SIGEV_THREAD_ID: c_int = 4; ++ ++pub const CIBAUD: crate::tcflag_t = 0o02003600000; ++pub const CBAUDEX: crate::tcflag_t = 0o010000; ++ ++pub const TIOCM_LE: c_int = 0x001; ++pub const TIOCM_DTR: c_int = 0x002; ++pub const TIOCM_RTS: c_int = 0x004; ++pub const TIOCM_ST: c_int = 0x008; ++pub const TIOCM_SR: c_int = 0x010; ++pub const TIOCM_CTS: c_int = 0x020; ++pub const TIOCM_CAR: c_int = 0x040; ++pub const TIOCM_RNG: c_int = 0x080; ++pub const TIOCM_DSR: c_int = 0x100; ++pub const TIOCM_CD: c_int = TIOCM_CAR; ++pub const TIOCM_RI: c_int = TIOCM_RNG; ++ ++pub const POLLWRNORM: c_short = 0x100; ++pub const POLLWRBAND: c_short = 0x200; ++ ++pub const SFD_CLOEXEC: c_int = O_CLOEXEC; ++pub const SFD_NONBLOCK: c_int = O_NONBLOCK; ++ ++pub const SOCK_NONBLOCK: c_int = O_NONBLOCK; ++ ++pub const SO_ORIGINAL_DST: c_int = 80; ++ ++pub const IP_RECVFRAGSIZE: c_int = 25; ++ ++pub const IPV6_FLOWINFO: c_int = 11; ++pub const IPV6_MULTICAST_ALL: c_int = 29; ++pub const IPV6_ROUTER_ALERT_ISOLATE: c_int = 30; ++pub const IPV6_FLOWLABEL_MGR: c_int = 32; ++pub const IPV6_FLOWINFO_SEND: c_int = 33; ++pub const IPV6_RECVFRAGSIZE: c_int = 77; ++pub const IPV6_FREEBIND: c_int = 78; ++pub const IPV6_FLOWINFO_FLOWLABEL: c_int = 0x000fffff; ++pub const IPV6_FLOWINFO_PRIORITY: c_int = 0x0ff00000; ++ ++pub const IUTF8: crate::tcflag_t = 0x00004000; ++pub const CMSPAR: crate::tcflag_t = 0o10000000000; ++pub const O_TMPFILE: c_int = 0o20000000 | O_DIRECTORY; ++ ++pub const MFD_CLOEXEC: c_uint = 0x0001; ++pub const MFD_ALLOW_SEALING: c_uint = 0x0002; ++pub const MFD_HUGETLB: c_uint = 0x0004; ++pub const MFD_NOEXEC_SEAL: c_uint = 0x0008; ++pub const MFD_EXEC: c_uint = 0x0010; ++pub const MFD_HUGE_64KB: c_uint = 0x40000000; ++pub const MFD_HUGE_512KB: c_uint = 0x4c000000; ++pub const MFD_HUGE_1MB: c_uint = 0x50000000; ++pub const MFD_HUGE_2MB: c_uint = 0x54000000; ++pub const MFD_HUGE_8MB: c_uint = 0x5c000000; ++pub const MFD_HUGE_16MB: c_uint = 0x60000000; ++pub const MFD_HUGE_32MB: c_uint = 0x64000000; ++pub const MFD_HUGE_256MB: c_uint = 0x70000000; ++pub const MFD_HUGE_512MB: c_uint = 0x74000000; ++pub const MFD_HUGE_1GB: c_uint = 0x78000000; ++pub const MFD_HUGE_2GB: c_uint = 0x7c000000; ++pub const MFD_HUGE_16GB: c_uint = 0x88000000; ++pub const MFD_HUGE_MASK: c_uint = 63; ++pub const MFD_HUGE_SHIFT: c_uint = 26; ++ ++// these are used in the p_type field of Elf32_Phdr and Elf64_Phdr, which has ++// the type Elf32Word and Elf64Word respectively. Luckily, both of those are u32 ++// so we can use that type here to avoid having to cast. ++pub const PT_NULL: u32 = 0; ++pub const PT_LOAD: u32 = 1; ++pub const PT_DYNAMIC: u32 = 2; ++pub const PT_INTERP: u32 = 3; ++pub const PT_NOTE: u32 = 4; ++pub const PT_SHLIB: u32 = 5; ++pub const PT_PHDR: u32 = 6; ++pub const PT_TLS: u32 = 7; ++pub const PT_LOOS: u32 = 0x60000000; ++pub const PT_GNU_EH_FRAME: u32 = 0x6474e550; ++pub const PT_GNU_STACK: u32 = 0x6474e551; ++pub const PT_GNU_RELRO: u32 = 0x6474e552; ++pub const PT_HIOS: u32 = 0x6fffffff; ++pub const PT_LOPROC: u32 = 0x70000000; ++pub const PT_HIPROC: u32 = 0x7fffffff; ++ ++// uapi/linux/mount.h ++pub const OPEN_TREE_CLONE: c_uint = 0x01; ++pub const OPEN_TREE_CLOEXEC: c_uint = O_CLOEXEC as c_uint; ++ ++// linux/netfilter.h ++pub const NF_DROP: c_int = 0; ++pub const NF_ACCEPT: c_int = 1; ++pub const NF_STOLEN: c_int = 2; ++pub const NF_QUEUE: c_int = 3; ++pub const NF_REPEAT: c_int = 4; ++pub const NF_STOP: c_int = 5; ++pub const NF_MAX_VERDICT: c_int = NF_STOP; ++ ++pub const NF_VERDICT_MASK: c_int = 0x000000ff; ++pub const NF_VERDICT_FLAG_QUEUE_BYPASS: c_int = 0x00008000; ++ ++pub const NF_VERDICT_QMASK: c_int = 0xffff0000; ++pub const NF_VERDICT_QBITS: c_int = 16; ++ ++pub const NF_VERDICT_BITS: c_int = 16; ++ ++pub const NF_INET_PRE_ROUTING: c_int = 0; ++pub const NF_INET_LOCAL_IN: c_int = 1; ++pub const NF_INET_FORWARD: c_int = 2; ++pub const NF_INET_LOCAL_OUT: c_int = 3; ++pub const NF_INET_POST_ROUTING: c_int = 4; ++pub const NF_INET_NUMHOOKS: c_int = 5; ++pub const NF_INET_INGRESS: c_int = NF_INET_NUMHOOKS; ++ ++pub const NF_NETDEV_INGRESS: c_int = 0; ++pub const NF_NETDEV_EGRESS: c_int = 1; ++pub const NF_NETDEV_NUMHOOKS: c_int = 2; ++ ++pub const NFPROTO_UNSPEC: c_int = 0; ++pub const NFPROTO_INET: c_int = 1; ++pub const NFPROTO_IPV4: c_int = 2; ++pub const NFPROTO_ARP: c_int = 3; ++pub const NFPROTO_NETDEV: c_int = 5; ++pub const NFPROTO_BRIDGE: c_int = 7; ++pub const NFPROTO_IPV6: c_int = 10; ++pub const NFPROTO_DECNET: c_int = 12; ++pub const NFPROTO_NUMPROTO: c_int = 13; ++ ++// linux/netfilter_arp.h ++pub const NF_ARP: c_int = 0; ++pub const NF_ARP_IN: c_int = 0; ++pub const NF_ARP_OUT: c_int = 1; ++pub const NF_ARP_FORWARD: c_int = 2; ++pub const NF_ARP_NUMHOOKS: c_int = 3; ++ ++// linux/netfilter_bridge.h ++pub const NF_BR_PRE_ROUTING: c_int = 0; ++pub const NF_BR_LOCAL_IN: c_int = 1; ++pub const NF_BR_FORWARD: c_int = 2; ++pub const NF_BR_LOCAL_OUT: c_int = 3; ++pub const NF_BR_POST_ROUTING: c_int = 4; ++pub const NF_BR_BROUTING: c_int = 5; ++pub const NF_BR_NUMHOOKS: c_int = 6; ++ ++pub const NF_BR_PRI_FIRST: c_int = crate::INT_MIN; ++pub const NF_BR_PRI_NAT_DST_BRIDGED: c_int = -300; ++pub const NF_BR_PRI_FILTER_BRIDGED: c_int = -200; ++pub const NF_BR_PRI_BRNF: c_int = 0; ++pub const NF_BR_PRI_NAT_DST_OTHER: c_int = 100; ++pub const NF_BR_PRI_FILTER_OTHER: c_int = 200; ++pub const NF_BR_PRI_NAT_SRC: c_int = 300; ++pub const NF_BR_PRI_LAST: c_int = crate::INT_MAX; ++ ++// linux/netfilter_ipv4.h ++pub const NF_IP_PRE_ROUTING: c_int = 0; ++pub const NF_IP_LOCAL_IN: c_int = 1; ++pub const NF_IP_FORWARD: c_int = 2; ++pub const NF_IP_LOCAL_OUT: c_int = 3; ++pub const NF_IP_POST_ROUTING: c_int = 4; ++pub const NF_IP_NUMHOOKS: c_int = 5; ++ ++pub const NF_IP_PRI_FIRST: c_int = crate::INT_MIN; ++pub const NF_IP_PRI_RAW_BEFORE_DEFRAG: c_int = -450; ++pub const NF_IP_PRI_CONNTRACK_DEFRAG: c_int = -400; ++pub const NF_IP_PRI_RAW: c_int = -300; ++pub const NF_IP_PRI_SELINUX_FIRST: c_int = -225; ++pub const NF_IP_PRI_CONNTRACK: c_int = -200; ++pub const NF_IP_PRI_MANGLE: c_int = -150; ++pub const NF_IP_PRI_NAT_DST: c_int = -100; ++pub const NF_IP_PRI_FILTER: c_int = 0; ++pub const NF_IP_PRI_SECURITY: c_int = 50; ++pub const NF_IP_PRI_NAT_SRC: c_int = 100; ++pub const NF_IP_PRI_SELINUX_LAST: c_int = 225; ++pub const NF_IP_PRI_CONNTRACK_HELPER: c_int = 300; ++pub const NF_IP_PRI_CONNTRACK_CONFIRM: c_int = crate::INT_MAX; ++pub const NF_IP_PRI_LAST: c_int = crate::INT_MAX; ++ ++// linux/netfilter_ipv6.h ++pub const NF_IP6_PRE_ROUTING: c_int = 0; ++pub const NF_IP6_LOCAL_IN: c_int = 1; ++pub const NF_IP6_FORWARD: c_int = 2; ++pub const NF_IP6_LOCAL_OUT: c_int = 3; ++pub const NF_IP6_POST_ROUTING: c_int = 4; ++pub const NF_IP6_NUMHOOKS: c_int = 5; ++ ++pub const NF_IP6_PRI_FIRST: c_int = crate::INT_MIN; ++pub const NF_IP6_PRI_RAW_BEFORE_DEFRAG: c_int = -450; ++pub const NF_IP6_PRI_CONNTRACK_DEFRAG: c_int = -400; ++pub const NF_IP6_PRI_RAW: c_int = -300; ++pub const NF_IP6_PRI_SELINUX_FIRST: c_int = -225; ++pub const NF_IP6_PRI_CONNTRACK: c_int = -200; ++pub const NF_IP6_PRI_MANGLE: c_int = -150; ++pub const NF_IP6_PRI_NAT_DST: c_int = -100; ++pub const NF_IP6_PRI_FILTER: c_int = 0; ++pub const NF_IP6_PRI_SECURITY: c_int = 50; ++pub const NF_IP6_PRI_NAT_SRC: c_int = 100; ++pub const NF_IP6_PRI_SELINUX_LAST: c_int = 225; ++pub const NF_IP6_PRI_CONNTRACK_HELPER: c_int = 300; ++pub const NF_IP6_PRI_LAST: c_int = crate::INT_MAX; ++ ++// linux/netfilter_ipv6/ip6_tables.h ++pub const IP6T_SO_ORIGINAL_DST: c_int = 80; ++ ++// linux/netfilter/nf_tables.h ++pub const NFT_TABLE_MAXNAMELEN: c_int = 256; ++pub const NFT_CHAIN_MAXNAMELEN: c_int = 256; ++pub const NFT_SET_MAXNAMELEN: c_int = 256; ++pub const NFT_OBJ_MAXNAMELEN: c_int = 256; ++pub const NFT_USERDATA_MAXLEN: c_int = 256; ++ ++pub const NFT_REG_VERDICT: c_int = 0; ++pub const NFT_REG_1: c_int = 1; ++pub const NFT_REG_2: c_int = 2; ++pub const NFT_REG_3: c_int = 3; ++pub const NFT_REG_4: c_int = 4; ++pub const __NFT_REG_MAX: c_int = 5; ++pub const NFT_REG32_00: c_int = 8; ++pub const NFT_REG32_01: c_int = 9; ++pub const NFT_REG32_02: c_int = 10; ++pub const NFT_REG32_03: c_int = 11; ++pub const NFT_REG32_04: c_int = 12; ++pub const NFT_REG32_05: c_int = 13; ++pub const NFT_REG32_06: c_int = 14; ++pub const NFT_REG32_07: c_int = 15; ++pub const NFT_REG32_08: c_int = 16; ++pub const NFT_REG32_09: c_int = 17; ++pub const NFT_REG32_10: c_int = 18; ++pub const NFT_REG32_11: c_int = 19; ++pub const NFT_REG32_12: c_int = 20; ++pub const NFT_REG32_13: c_int = 21; ++pub const NFT_REG32_14: c_int = 22; ++pub const NFT_REG32_15: c_int = 23; ++ ++pub const NFT_REG_SIZE: c_int = 16; ++pub const NFT_REG32_SIZE: c_int = 4; ++ ++pub const NFT_CONTINUE: c_int = -1; ++pub const NFT_BREAK: c_int = -2; ++pub const NFT_JUMP: c_int = -3; ++pub const NFT_GOTO: c_int = -4; ++pub const NFT_RETURN: c_int = -5; ++ ++pub const NFT_MSG_NEWTABLE: c_int = 0; ++pub const NFT_MSG_GETTABLE: c_int = 1; ++pub const NFT_MSG_DELTABLE: c_int = 2; ++pub const NFT_MSG_NEWCHAIN: c_int = 3; ++pub const NFT_MSG_GETCHAIN: c_int = 4; ++pub const NFT_MSG_DELCHAIN: c_int = 5; ++pub const NFT_MSG_NEWRULE: c_int = 6; ++pub const NFT_MSG_GETRULE: c_int = 7; ++pub const NFT_MSG_DELRULE: c_int = 8; ++pub const NFT_MSG_NEWSET: c_int = 9; ++pub const NFT_MSG_GETSET: c_int = 10; ++pub const NFT_MSG_DELSET: c_int = 11; ++pub const NFT_MSG_NEWSETELEM: c_int = 12; ++pub const NFT_MSG_GETSETELEM: c_int = 13; ++pub const NFT_MSG_DELSETELEM: c_int = 14; ++pub const NFT_MSG_NEWGEN: c_int = 15; ++pub const NFT_MSG_GETGEN: c_int = 16; ++pub const NFT_MSG_TRACE: c_int = 17; ++pub const NFT_MSG_NEWOBJ: c_int = 18; ++pub const NFT_MSG_GETOBJ: c_int = 19; ++pub const NFT_MSG_DELOBJ: c_int = 20; ++pub const NFT_MSG_GETOBJ_RESET: c_int = 21; ++pub const NFT_MSG_MAX: c_int = 25; ++ ++pub const NFT_SET_ANONYMOUS: c_int = 0x1; ++pub const NFT_SET_CONSTANT: c_int = 0x2; ++pub const NFT_SET_INTERVAL: c_int = 0x4; ++pub const NFT_SET_MAP: c_int = 0x8; ++pub const NFT_SET_TIMEOUT: c_int = 0x10; ++pub const NFT_SET_EVAL: c_int = 0x20; ++ ++pub const NFT_SET_POL_PERFORMANCE: c_int = 0; ++pub const NFT_SET_POL_MEMORY: c_int = 1; ++ ++pub const NFT_SET_ELEM_INTERVAL_END: c_int = 0x1; ++ ++pub const NFT_DATA_VALUE: c_uint = 0; ++pub const NFT_DATA_VERDICT: c_uint = 0xffffff00; ++ ++pub const NFT_DATA_RESERVED_MASK: c_uint = 0xffffff00; ++ ++pub const NFT_DATA_VALUE_MAXLEN: c_int = 64; ++ ++pub const NFT_BYTEORDER_NTOH: c_int = 0; ++pub const NFT_BYTEORDER_HTON: c_int = 1; ++ ++pub const NFT_CMP_EQ: c_int = 0; ++pub const NFT_CMP_NEQ: c_int = 1; ++pub const NFT_CMP_LT: c_int = 2; ++pub const NFT_CMP_LTE: c_int = 3; ++pub const NFT_CMP_GT: c_int = 4; ++pub const NFT_CMP_GTE: c_int = 5; ++ ++pub const NFT_RANGE_EQ: c_int = 0; ++pub const NFT_RANGE_NEQ: c_int = 1; ++ ++pub const NFT_LOOKUP_F_INV: c_int = 1 << 0; ++ ++pub const NFT_DYNSET_OP_ADD: c_int = 0; ++pub const NFT_DYNSET_OP_UPDATE: c_int = 1; ++ ++pub const NFT_DYNSET_F_INV: c_int = 1 << 0; ++ ++pub const NFT_PAYLOAD_LL_HEADER: c_int = 0; ++pub const NFT_PAYLOAD_NETWORK_HEADER: c_int = 1; ++pub const NFT_PAYLOAD_TRANSPORT_HEADER: c_int = 2; ++ ++pub const NFT_PAYLOAD_CSUM_NONE: c_int = 0; ++pub const NFT_PAYLOAD_CSUM_INET: c_int = 1; ++ ++pub const NFT_META_LEN: c_int = 0; ++pub const NFT_META_PROTOCOL: c_int = 1; ++pub const NFT_META_PRIORITY: c_int = 2; ++pub const NFT_META_MARK: c_int = 3; ++pub const NFT_META_IIF: c_int = 4; ++pub const NFT_META_OIF: c_int = 5; ++pub const NFT_META_IIFNAME: c_int = 6; ++pub const NFT_META_OIFNAME: c_int = 7; ++pub const NFT_META_IIFTYPE: c_int = 8; ++pub const NFT_META_OIFTYPE: c_int = 9; ++pub const NFT_META_SKUID: c_int = 10; ++pub const NFT_META_SKGID: c_int = 11; ++pub const NFT_META_NFTRACE: c_int = 12; ++pub const NFT_META_RTCLASSID: c_int = 13; ++pub const NFT_META_SECMARK: c_int = 14; ++pub const NFT_META_NFPROTO: c_int = 15; ++pub const NFT_META_L4PROTO: c_int = 16; ++pub const NFT_META_BRI_IIFNAME: c_int = 17; ++pub const NFT_META_BRI_OIFNAME: c_int = 18; ++pub const NFT_META_PKTTYPE: c_int = 19; ++pub const NFT_META_CPU: c_int = 20; ++pub const NFT_META_IIFGROUP: c_int = 21; ++pub const NFT_META_OIFGROUP: c_int = 22; ++pub const NFT_META_CGROUP: c_int = 23; ++pub const NFT_META_PRANDOM: c_int = 24; ++ ++pub const NFT_CT_STATE: c_int = 0; ++pub const NFT_CT_DIRECTION: c_int = 1; ++pub const NFT_CT_STATUS: c_int = 2; ++pub const NFT_CT_MARK: c_int = 3; ++pub const NFT_CT_SECMARK: c_int = 4; ++pub const NFT_CT_EXPIRATION: c_int = 5; ++pub const NFT_CT_HELPER: c_int = 6; ++pub const NFT_CT_L3PROTOCOL: c_int = 7; ++pub const NFT_CT_SRC: c_int = 8; ++pub const NFT_CT_DST: c_int = 9; ++pub const NFT_CT_PROTOCOL: c_int = 10; ++pub const NFT_CT_PROTO_SRC: c_int = 11; ++pub const NFT_CT_PROTO_DST: c_int = 12; ++pub const NFT_CT_LABELS: c_int = 13; ++pub const NFT_CT_PKTS: c_int = 14; ++pub const NFT_CT_BYTES: c_int = 15; ++pub const NFT_CT_AVGPKT: c_int = 16; ++pub const NFT_CT_ZONE: c_int = 17; ++pub const NFT_CT_EVENTMASK: c_int = 18; ++pub const NFT_CT_SRC_IP: c_int = 19; ++pub const NFT_CT_DST_IP: c_int = 20; ++pub const NFT_CT_SRC_IP6: c_int = 21; ++pub const NFT_CT_DST_IP6: c_int = 22; ++pub const NFT_CT_ID: c_int = 23; ++ ++pub const NFT_LIMIT_PKTS: c_int = 0; ++pub const NFT_LIMIT_PKT_BYTES: c_int = 1; ++ ++pub const NFT_LIMIT_F_INV: c_int = 1 << 0; ++ ++pub const NFT_QUEUE_FLAG_BYPASS: c_int = 0x01; ++pub const NFT_QUEUE_FLAG_CPU_FANOUT: c_int = 0x02; ++pub const NFT_QUEUE_FLAG_MASK: c_int = 0x03; ++ ++pub const NFT_QUOTA_F_INV: c_int = 1 << 0; ++ ++pub const NFT_REJECT_ICMP_UNREACH: c_int = 0; ++pub const NFT_REJECT_TCP_RST: c_int = 1; ++pub const NFT_REJECT_ICMPX_UNREACH: c_int = 2; ++ ++pub const NFT_REJECT_ICMPX_NO_ROUTE: c_int = 0; ++pub const NFT_REJECT_ICMPX_PORT_UNREACH: c_int = 1; ++pub const NFT_REJECT_ICMPX_HOST_UNREACH: c_int = 2; ++pub const NFT_REJECT_ICMPX_ADMIN_PROHIBITED: c_int = 3; ++ ++pub const NFT_NAT_SNAT: c_int = 0; ++pub const NFT_NAT_DNAT: c_int = 1; ++ ++pub const NFT_TRACETYPE_UNSPEC: c_int = 0; ++pub const NFT_TRACETYPE_POLICY: c_int = 1; ++pub const NFT_TRACETYPE_RETURN: c_int = 2; ++pub const NFT_TRACETYPE_RULE: c_int = 3; ++ ++pub const NFT_NG_INCREMENTAL: c_int = 0; ++pub const NFT_NG_RANDOM: c_int = 1; ++ ++// linux/input.h ++pub const FF_MAX: crate::__u16 = 0x7f; ++pub const FF_CNT: usize = FF_MAX as usize + 1; ++ ++// linux/input-event-codes.h ++pub const INPUT_PROP_MAX: crate::__u16 = 0x1f; ++pub const INPUT_PROP_CNT: usize = INPUT_PROP_MAX as usize + 1; ++pub const EV_MAX: crate::__u16 = 0x1f; ++pub const EV_CNT: usize = EV_MAX as usize + 1; ++pub const SYN_MAX: crate::__u16 = 0xf; ++pub const SYN_CNT: usize = SYN_MAX as usize + 1; ++pub const KEY_MAX: crate::__u16 = 0x2ff; ++pub const KEY_CNT: usize = KEY_MAX as usize + 1; ++pub const REL_MAX: crate::__u16 = 0x0f; ++pub const REL_CNT: usize = REL_MAX as usize + 1; ++pub const ABS_MAX: crate::__u16 = 0x3f; ++pub const ABS_CNT: usize = ABS_MAX as usize + 1; ++pub const SW_MAX: crate::__u16 = 0x0f; ++pub const SW_CNT: usize = SW_MAX as usize + 1; ++pub const MSC_MAX: crate::__u16 = 0x07; ++pub const MSC_CNT: usize = MSC_MAX as usize + 1; ++pub const LED_MAX: crate::__u16 = 0x0f; ++pub const LED_CNT: usize = LED_MAX as usize + 1; ++pub const REP_MAX: crate::__u16 = 0x01; ++pub const REP_CNT: usize = REP_MAX as usize + 1; ++pub const SND_MAX: crate::__u16 = 0x07; ++pub const SND_CNT: usize = SND_MAX as usize + 1; ++ ++// linux/uinput.h ++pub const UINPUT_VERSION: c_uint = 5; ++pub const UINPUT_MAX_NAME_SIZE: usize = 80; ++ ++// bionic/libc/kernel/uapi/linux/if_tun.h ++pub const IFF_TUN: c_int = 0x0001; ++pub const IFF_TAP: c_int = 0x0002; ++pub const IFF_NAPI: c_int = 0x0010; ++pub const IFF_NAPI_FRAGS: c_int = 0x0020; ++pub const IFF_NO_CARRIER: c_int = 0x0040; ++pub const IFF_NO_PI: c_int = 0x1000; ++pub const IFF_ONE_QUEUE: c_int = 0x2000; ++pub const IFF_VNET_HDR: c_int = 0x4000; ++pub const IFF_TUN_EXCL: c_int = 0x8000; ++pub const IFF_MULTI_QUEUE: c_int = 0x0100; ++pub const IFF_ATTACH_QUEUE: c_int = 0x0200; ++pub const IFF_DETACH_QUEUE: c_int = 0x0400; ++pub const IFF_PERSIST: c_int = 0x0800; ++pub const IFF_NOFILTER: c_int = 0x1000; ++// Features for GSO (TUNSETOFFLOAD) ++pub const TUN_F_CSUM: c_uint = 0x01; ++pub const TUN_F_TSO4: c_uint = 0x02; ++pub const TUN_F_TSO6: c_uint = 0x04; ++pub const TUN_F_TSO_ECN: c_uint = 0x08; ++pub const TUN_F_UFO: c_uint = 0x10; ++pub const TUN_F_USO4: c_uint = 0x20; ++pub const TUN_F_USO6: c_uint = 0x40; ++ ++// start android/platform/bionic/libc/kernel/uapi/linux/if_ether.h ++// from https://android.googlesource.com/platform/bionic/+/HEAD/libc/kernel/uapi/linux/if_ether.h ++pub const ETH_ALEN: c_int = 6; ++pub const ETH_HLEN: c_int = 14; ++pub const ETH_ZLEN: c_int = 60; ++pub const ETH_DATA_LEN: c_int = 1500; ++pub const ETH_FRAME_LEN: c_int = 1514; ++pub const ETH_FCS_LEN: c_int = 4; ++pub const ETH_MIN_MTU: c_int = 68; ++pub const ETH_MAX_MTU: c_int = 0xFFFF; ++pub const ETH_P_LOOP: c_int = 0x0060; ++pub const ETH_P_PUP: c_int = 0x0200; ++pub const ETH_P_PUPAT: c_int = 0x0201; ++pub const ETH_P_TSN: c_int = 0x22F0; ++pub const ETH_P_IP: c_int = 0x0800; ++pub const ETH_P_X25: c_int = 0x0805; ++pub const ETH_P_ARP: c_int = 0x0806; ++pub const ETH_P_BPQ: c_int = 0x08FF; ++pub const ETH_P_IEEEPUP: c_int = 0x0a00; ++pub const ETH_P_IEEEPUPAT: c_int = 0x0a01; ++pub const ETH_P_BATMAN: c_int = 0x4305; ++pub const ETH_P_DEC: c_int = 0x6000; ++pub const ETH_P_DNA_DL: c_int = 0x6001; ++pub const ETH_P_DNA_RC: c_int = 0x6002; ++pub const ETH_P_DNA_RT: c_int = 0x6003; ++pub const ETH_P_LAT: c_int = 0x6004; ++pub const ETH_P_DIAG: c_int = 0x6005; ++pub const ETH_P_CUST: c_int = 0x6006; ++pub const ETH_P_SCA: c_int = 0x6007; ++pub const ETH_P_TEB: c_int = 0x6558; ++pub const ETH_P_RARP: c_int = 0x8035; ++pub const ETH_P_ATALK: c_int = 0x809B; ++pub const ETH_P_AARP: c_int = 0x80F3; ++pub const ETH_P_8021Q: c_int = 0x8100; ++/* see rust-lang/libc#924 pub const ETH_P_ERSPAN: c_int = 0x88BE;*/ ++pub const ETH_P_IPX: c_int = 0x8137; ++pub const ETH_P_IPV6: c_int = 0x86DD; ++pub const ETH_P_PAUSE: c_int = 0x8808; ++pub const ETH_P_SLOW: c_int = 0x8809; ++pub const ETH_P_WCCP: c_int = 0x883E; ++pub const ETH_P_MPLS_UC: c_int = 0x8847; ++pub const ETH_P_MPLS_MC: c_int = 0x8848; ++pub const ETH_P_ATMMPOA: c_int = 0x884c; ++pub const ETH_P_PPP_DISC: c_int = 0x8863; ++pub const ETH_P_PPP_SES: c_int = 0x8864; ++pub const ETH_P_LINK_CTL: c_int = 0x886c; ++pub const ETH_P_ATMFATE: c_int = 0x8884; ++pub const ETH_P_PAE: c_int = 0x888E; ++pub const ETH_P_AOE: c_int = 0x88A2; ++pub const ETH_P_8021AD: c_int = 0x88A8; ++pub const ETH_P_802_EX1: c_int = 0x88B5; ++pub const ETH_P_TIPC: c_int = 0x88CA; ++pub const ETH_P_MACSEC: c_int = 0x88E5; ++pub const ETH_P_8021AH: c_int = 0x88E7; ++pub const ETH_P_MVRP: c_int = 0x88F5; ++pub const ETH_P_1588: c_int = 0x88F7; ++pub const ETH_P_NCSI: c_int = 0x88F8; ++pub const ETH_P_PRP: c_int = 0x88FB; ++pub const ETH_P_FCOE: c_int = 0x8906; ++/* see rust-lang/libc#924 pub const ETH_P_IBOE: c_int = 0x8915;*/ ++pub const ETH_P_TDLS: c_int = 0x890D; ++pub const ETH_P_FIP: c_int = 0x8914; ++pub const ETH_P_80221: c_int = 0x8917; ++pub const ETH_P_HSR: c_int = 0x892F; ++/* see rust-lang/libc#924 pub const ETH_P_NSH: c_int = 0x894F;*/ ++pub const ETH_P_LOOPBACK: c_int = 0x9000; ++pub const ETH_P_QINQ1: c_int = 0x9100; ++pub const ETH_P_QINQ2: c_int = 0x9200; ++pub const ETH_P_QINQ3: c_int = 0x9300; ++pub const ETH_P_EDSA: c_int = 0xDADA; ++/* see rust-lang/libc#924 pub const ETH_P_IFE: c_int = 0xED3E;*/ ++pub const ETH_P_AF_IUCV: c_int = 0xFBFB; ++pub const ETH_P_802_3_MIN: c_int = 0x0600; ++pub const ETH_P_802_3: c_int = 0x0001; ++pub const ETH_P_AX25: c_int = 0x0002; ++pub const ETH_P_ALL: c_int = 0x0003; ++pub const ETH_P_802_2: c_int = 0x0004; ++pub const ETH_P_SNAP: c_int = 0x0005; ++pub const ETH_P_DDCMP: c_int = 0x0006; ++pub const ETH_P_WAN_PPP: c_int = 0x0007; ++pub const ETH_P_PPP_MP: c_int = 0x0008; ++pub const ETH_P_LOCALTALK: c_int = 0x0009; ++pub const ETH_P_CAN: c_int = 0x000C; ++pub const ETH_P_CANFD: c_int = 0x000D; ++pub const ETH_P_PPPTALK: c_int = 0x0010; ++pub const ETH_P_TR_802_2: c_int = 0x0011; ++pub const ETH_P_MOBITEX: c_int = 0x0015; ++pub const ETH_P_CONTROL: c_int = 0x0016; ++pub const ETH_P_IRDA: c_int = 0x0017; ++pub const ETH_P_ECONET: c_int = 0x0018; ++pub const ETH_P_HDLC: c_int = 0x0019; ++pub const ETH_P_ARCNET: c_int = 0x001A; ++pub const ETH_P_DSA: c_int = 0x001B; ++pub const ETH_P_TRAILER: c_int = 0x001C; ++pub const ETH_P_PHONET: c_int = 0x00F5; ++pub const ETH_P_IEEE802154: c_int = 0x00F6; ++pub const ETH_P_CAIF: c_int = 0x00F7; ++pub const ETH_P_XDSA: c_int = 0x00F8; ++/* see rust-lang/libc#924 pub const ETH_P_MAP: c_int = 0x00F9;*/ ++// end android/platform/bionic/libc/kernel/uapi/linux/if_ether.h ++ ++// start android/platform/bionic/libc/kernel/uapi/linux/neighbour.h ++pub const NDA_UNSPEC: c_ushort = 0; ++pub const NDA_DST: c_ushort = 1; ++pub const NDA_LLADDR: c_ushort = 2; ++pub const NDA_CACHEINFO: c_ushort = 3; ++pub const NDA_PROBES: c_ushort = 4; ++pub const NDA_VLAN: c_ushort = 5; ++pub const NDA_PORT: c_ushort = 6; ++pub const NDA_VNI: c_ushort = 7; ++pub const NDA_IFINDEX: c_ushort = 8; ++pub const NDA_MASTER: c_ushort = 9; ++pub const NDA_LINK_NETNSID: c_ushort = 10; ++pub const NDA_SRC_VNI: c_ushort = 11; ++pub const NDA_PROTOCOL: c_ushort = 12; ++pub const NDA_NH_ID: c_ushort = 13; ++pub const NDA_FDB_EXT_ATTRS: c_ushort = 14; ++pub const NDA_FLAGS_EXT: c_ushort = 15; ++pub const NDA_NDM_STATE_MASK: c_ushort = 16; ++pub const NDA_NDM_FLAGS_MASK: c_ushort = 17; ++ ++pub const NTF_USE: u8 = 0x01; ++pub const NTF_SELF: u8 = 0x02; ++pub const NTF_MASTER: u8 = 0x04; ++pub const NTF_PROXY: u8 = 0x08; ++pub const NTF_EXT_LEARNED: u8 = 0x10; ++pub const NTF_OFFLOADED: u8 = 0x20; ++pub const NTF_STICKY: u8 = 0x40; ++pub const NTF_ROUTER: u8 = 0x80; ++ ++pub const NTF_EXT_MANAGED: u8 = 0x01; ++pub const NTF_EXT_LOCKED: u8 = 0x02; ++ ++pub const NUD_NONE: u16 = 0x00; ++pub const NUD_INCOMPLETE: u16 = 0x01; ++pub const NUD_REACHABLE: u16 = 0x02; ++pub const NUD_STALE: u16 = 0x04; ++pub const NUD_DELAY: u16 = 0x08; ++pub const NUD_PROBE: u16 = 0x10; ++pub const NUD_FAILED: u16 = 0x20; ++pub const NUD_NOARP: u16 = 0x40; ++pub const NUD_PERMANENT: u16 = 0x80; ++ ++pub const NDTPA_UNSPEC: c_ushort = 0; ++pub const NDTPA_IFINDEX: c_ushort = 1; ++pub const NDTPA_REFCNT: c_ushort = 2; ++pub const NDTPA_REACHABLE_TIME: c_ushort = 3; ++pub const NDTPA_BASE_REACHABLE_TIME: c_ushort = 4; ++pub const NDTPA_RETRANS_TIME: c_ushort = 5; ++pub const NDTPA_GC_STALETIME: c_ushort = 6; ++pub const NDTPA_DELAY_PROBE_TIME: c_ushort = 7; ++pub const NDTPA_QUEUE_LEN: c_ushort = 8; ++pub const NDTPA_APP_PROBES: c_ushort = 9; ++pub const NDTPA_UCAST_PROBES: c_ushort = 10; ++pub const NDTPA_MCAST_PROBES: c_ushort = 11; ++pub const NDTPA_ANYCAST_DELAY: c_ushort = 12; ++pub const NDTPA_PROXY_DELAY: c_ushort = 13; ++pub const NDTPA_PROXY_QLEN: c_ushort = 14; ++pub const NDTPA_LOCKTIME: c_ushort = 15; ++pub const NDTPA_QUEUE_LENBYTES: c_ushort = 16; ++pub const NDTPA_MCAST_REPROBES: c_ushort = 17; ++pub const NDTPA_PAD: c_ushort = 18; ++pub const NDTPA_INTERVAL_PROBE_TIME_MS: c_ushort = 19; ++ ++pub const NDTA_UNSPEC: c_ushort = 0; ++pub const NDTA_NAME: c_ushort = 1; ++pub const NDTA_THRESH1: c_ushort = 2; ++pub const NDTA_THRESH2: c_ushort = 3; ++pub const NDTA_THRESH3: c_ushort = 4; ++pub const NDTA_CONFIG: c_ushort = 5; ++pub const NDTA_PARMS: c_ushort = 6; ++pub const NDTA_STATS: c_ushort = 7; ++pub const NDTA_GC_INTERVAL: c_ushort = 8; ++pub const NDTA_PAD: c_ushort = 9; ++ ++pub const FDB_NOTIFY_BIT: u16 = 0x01; ++pub const FDB_NOTIFY_INACTIVE_BIT: u16 = 0x02; ++ ++pub const NFEA_UNSPEC: c_ushort = 0; ++pub const NFEA_ACTIVITY_NOTIFY: c_ushort = 1; ++pub const NFEA_DONT_REFRESH: c_ushort = 2; ++// end android/platform/bionic/libc/kernel/uapi/linux/neighbour.h ++ ++pub const SIOCADDRT: c_ulong = 0x0000890B; ++pub const SIOCDELRT: c_ulong = 0x0000890C; ++pub const SIOCRTMSG: c_ulong = 0x0000890D; ++pub const SIOCGIFNAME: c_ulong = 0x00008910; ++pub const SIOCSIFLINK: c_ulong = 0x00008911; ++pub const SIOCGIFCONF: c_ulong = 0x00008912; ++pub const SIOCGIFFLAGS: c_ulong = 0x00008913; ++pub const SIOCSIFFLAGS: c_ulong = 0x00008914; ++pub const SIOCGIFADDR: c_ulong = 0x00008915; ++pub const SIOCSIFADDR: c_ulong = 0x00008916; ++pub const SIOCGIFDSTADDR: c_ulong = 0x00008917; ++pub const SIOCSIFDSTADDR: c_ulong = 0x00008918; ++pub const SIOCGIFBRDADDR: c_ulong = 0x00008919; ++pub const SIOCSIFBRDADDR: c_ulong = 0x0000891A; ++pub const SIOCGIFNETMASK: c_ulong = 0x0000891B; ++pub const SIOCSIFNETMASK: c_ulong = 0x0000891C; ++pub const SIOCGIFMETRIC: c_ulong = 0x0000891D; ++pub const SIOCSIFMETRIC: c_ulong = 0x0000891E; ++pub const SIOCGIFMEM: c_ulong = 0x0000891F; ++pub const SIOCSIFMEM: c_ulong = 0x00008920; ++pub const SIOCGIFMTU: c_ulong = 0x00008921; ++pub const SIOCSIFMTU: c_ulong = 0x00008922; ++pub const SIOCSIFNAME: c_ulong = 0x00008923; ++pub const SIOCSIFHWADDR: c_ulong = 0x00008924; ++pub const SIOCGIFENCAP: c_ulong = 0x00008925; ++pub const SIOCSIFENCAP: c_ulong = 0x00008926; ++pub const SIOCGIFHWADDR: c_ulong = 0x00008927; ++pub const SIOCGIFSLAVE: c_ulong = 0x00008929; ++pub const SIOCSIFSLAVE: c_ulong = 0x00008930; ++pub const SIOCADDMULTI: c_ulong = 0x00008931; ++pub const SIOCDELMULTI: c_ulong = 0x00008932; ++pub const SIOCGIFINDEX: c_ulong = 0x00008933; ++pub const SIOGIFINDEX: c_ulong = SIOCGIFINDEX; ++pub const SIOCSIFPFLAGS: c_ulong = 0x00008934; ++pub const SIOCGIFPFLAGS: c_ulong = 0x00008935; ++pub const SIOCDIFADDR: c_ulong = 0x00008936; ++pub const SIOCSIFHWBROADCAST: c_ulong = 0x00008937; ++pub const SIOCGIFCOUNT: c_ulong = 0x00008938; ++pub const SIOCGIFBR: c_ulong = 0x00008940; ++pub const SIOCSIFBR: c_ulong = 0x00008941; ++pub const SIOCGIFTXQLEN: c_ulong = 0x00008942; ++pub const SIOCSIFTXQLEN: c_ulong = 0x00008943; ++pub const SIOCETHTOOL: c_ulong = 0x00008946; ++pub const SIOCGMIIPHY: c_ulong = 0x00008947; ++pub const SIOCGMIIREG: c_ulong = 0x00008948; ++pub const SIOCSMIIREG: c_ulong = 0x00008949; ++pub const SIOCWANDEV: c_ulong = 0x0000894A; ++pub const SIOCOUTQNSD: c_ulong = 0x0000894B; ++pub const SIOCGSKNS: c_ulong = 0x0000894C; ++pub const SIOCDARP: c_ulong = 0x00008953; ++pub const SIOCGARP: c_ulong = 0x00008954; ++pub const SIOCSARP: c_ulong = 0x00008955; ++pub const SIOCDRARP: c_ulong = 0x00008960; ++pub const SIOCGRARP: c_ulong = 0x00008961; ++pub const SIOCSRARP: c_ulong = 0x00008962; ++pub const SIOCGIFMAP: c_ulong = 0x00008970; ++pub const SIOCSIFMAP: c_ulong = 0x00008971; ++pub const SIOCADDDLCI: c_ulong = 0x00008980; ++pub const SIOCDELDLCI: c_ulong = 0x00008981; ++pub const SIOCGIFVLAN: c_ulong = 0x00008982; ++pub const SIOCSIFVLAN: c_ulong = 0x00008983; ++pub const SIOCBONDENSLAVE: c_ulong = 0x00008990; ++pub const SIOCBONDRELEASE: c_ulong = 0x00008991; ++pub const SIOCBONDSETHWADDR: c_ulong = 0x00008992; ++pub const SIOCBONDSLAVEINFOQUERY: c_ulong = 0x00008993; ++pub const SIOCBONDINFOQUERY: c_ulong = 0x00008994; ++pub const SIOCBONDCHANGEACTIVE: c_ulong = 0x00008995; ++pub const SIOCBRADDBR: c_ulong = 0x000089a0; ++pub const SIOCBRDELBR: c_ulong = 0x000089a1; ++pub const SIOCBRADDIF: c_ulong = 0x000089a2; ++pub const SIOCBRDELIF: c_ulong = 0x000089a3; ++pub const SIOCSHWTSTAMP: c_ulong = 0x000089b0; ++pub const SIOCGHWTSTAMP: c_ulong = 0x000089b1; ++pub const SIOCDEVPRIVATE: c_ulong = 0x000089F0; ++pub const SIOCPROTOPRIVATE: c_ulong = 0x000089E0; ++ ++// linux/module.h ++pub const MODULE_INIT_IGNORE_MODVERSIONS: c_uint = 0x0001; ++pub const MODULE_INIT_IGNORE_VERMAGIC: c_uint = 0x0002; ++ ++// linux/net_tstamp.h ++pub const SOF_TIMESTAMPING_TX_HARDWARE: c_uint = 1 << 0; ++pub const SOF_TIMESTAMPING_TX_SOFTWARE: c_uint = 1 << 1; ++pub const SOF_TIMESTAMPING_RX_HARDWARE: c_uint = 1 << 2; ++pub const SOF_TIMESTAMPING_RX_SOFTWARE: c_uint = 1 << 3; ++pub const SOF_TIMESTAMPING_SOFTWARE: c_uint = 1 << 4; ++pub const SOF_TIMESTAMPING_SYS_HARDWARE: c_uint = 1 << 5; ++pub const SOF_TIMESTAMPING_RAW_HARDWARE: c_uint = 1 << 6; ++pub const SOF_TIMESTAMPING_OPT_ID: c_uint = 1 << 7; ++pub const SOF_TIMESTAMPING_TX_SCHED: c_uint = 1 << 8; ++pub const SOF_TIMESTAMPING_TX_ACK: c_uint = 1 << 9; ++pub const SOF_TIMESTAMPING_OPT_CMSG: c_uint = 1 << 10; ++pub const SOF_TIMESTAMPING_OPT_TSONLY: c_uint = 1 << 11; ++pub const SOF_TIMESTAMPING_OPT_STATS: c_uint = 1 << 12; ++pub const SOF_TIMESTAMPING_OPT_PKTINFO: c_uint = 1 << 13; ++pub const SOF_TIMESTAMPING_OPT_TX_SWHW: c_uint = 1 << 14; ++ ++#[deprecated( ++ since = "0.2.55", ++ note = "ENOATTR is not available on Android; use ENODATA instead" ++)] ++pub const ENOATTR: c_int = crate::ENODATA; ++ ++// linux/if_alg.h ++pub const ALG_SET_KEY: c_int = 1; ++pub const ALG_SET_IV: c_int = 2; ++pub const ALG_SET_OP: c_int = 3; ++pub const ALG_SET_AEAD_ASSOCLEN: c_int = 4; ++pub const ALG_SET_AEAD_AUTHSIZE: c_int = 5; ++pub const ALG_SET_DRBG_ENTROPY: c_int = 6; ++ ++pub const ALG_OP_DECRYPT: c_int = 0; ++pub const ALG_OP_ENCRYPT: c_int = 1; ++ ++// sys/mman.h ++pub const MLOCK_ONFAULT: c_int = 0x01; ++ ++// uapi/linux/vm_sockets.h ++pub const VMADDR_CID_ANY: c_uint = 0xFFFFFFFF; ++pub const VMADDR_CID_HYPERVISOR: c_uint = 0; ++pub const VMADDR_CID_LOCAL: c_uint = 1; ++pub const VMADDR_CID_HOST: c_uint = 2; ++pub const VMADDR_PORT_ANY: c_uint = 0xFFFFFFFF; ++ ++// uapi/linux/inotify.h ++pub const IN_ACCESS: u32 = 0x0000_0001; ++pub const IN_MODIFY: u32 = 0x0000_0002; ++pub const IN_ATTRIB: u32 = 0x0000_0004; ++pub const IN_CLOSE_WRITE: u32 = 0x0000_0008; ++pub const IN_CLOSE_NOWRITE: u32 = 0x0000_0010; ++pub const IN_CLOSE: u32 = IN_CLOSE_WRITE | IN_CLOSE_NOWRITE; ++pub const IN_OPEN: u32 = 0x0000_0020; ++pub const IN_MOVED_FROM: u32 = 0x0000_0040; ++pub const IN_MOVED_TO: u32 = 0x0000_0080; ++pub const IN_MOVE: u32 = IN_MOVED_FROM | IN_MOVED_TO; ++pub const IN_CREATE: u32 = 0x0000_0100; ++pub const IN_DELETE: u32 = 0x0000_0200; ++pub const IN_DELETE_SELF: u32 = 0x0000_0400; ++pub const IN_MOVE_SELF: u32 = 0x0000_0800; ++pub const IN_UNMOUNT: u32 = 0x0000_2000; ++pub const IN_Q_OVERFLOW: u32 = 0x0000_4000; ++pub const IN_IGNORED: u32 = 0x0000_8000; ++pub const IN_ONLYDIR: u32 = 0x0100_0000; ++pub const IN_DONT_FOLLOW: u32 = 0x0200_0000; ++pub const IN_EXCL_UNLINK: u32 = 0x0400_0000; ++ ++pub const IN_MASK_CREATE: u32 = 0x1000_0000; ++pub const IN_MASK_ADD: u32 = 0x2000_0000; ++pub const IN_ISDIR: u32 = 0x4000_0000; ++pub const IN_ONESHOT: u32 = 0x8000_0000; ++ ++pub const IN_ALL_EVENTS: u32 = IN_ACCESS ++ | IN_MODIFY ++ | IN_ATTRIB ++ | IN_CLOSE_WRITE ++ | IN_CLOSE_NOWRITE ++ | IN_OPEN ++ | IN_MOVED_FROM ++ | IN_MOVED_TO ++ | IN_DELETE ++ | IN_CREATE ++ | IN_DELETE_SELF ++ | IN_MOVE_SELF; ++ ++pub const IN_CLOEXEC: c_int = O_CLOEXEC; ++pub const IN_NONBLOCK: c_int = O_NONBLOCK; ++ ++pub const FUTEX_WAIT: c_int = 0; ++pub const FUTEX_WAKE: c_int = 1; ++pub const FUTEX_FD: c_int = 2; ++pub const FUTEX_REQUEUE: c_int = 3; ++pub const FUTEX_CMP_REQUEUE: c_int = 4; ++pub const FUTEX_WAKE_OP: c_int = 5; ++pub const FUTEX_LOCK_PI: c_int = 6; ++pub const FUTEX_UNLOCK_PI: c_int = 7; ++pub const FUTEX_TRYLOCK_PI: c_int = 8; ++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; ++pub const FUTEX_CMD_MASK: c_int = !(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME); ++ ++// linux/errqueue.h ++pub const SO_EE_ORIGIN_NONE: u8 = 0; ++pub const SO_EE_ORIGIN_LOCAL: u8 = 1; ++pub const SO_EE_ORIGIN_ICMP: u8 = 2; ++pub const SO_EE_ORIGIN_ICMP6: u8 = 3; ++pub const SO_EE_ORIGIN_TXSTATUS: u8 = 4; ++pub const SO_EE_ORIGIN_TIMESTAMPING: u8 = SO_EE_ORIGIN_TXSTATUS; ++ ++// errno.h ++pub const EPERM: c_int = 1; ++pub const ENOENT: c_int = 2; ++pub const ESRCH: c_int = 3; ++pub const EINTR: c_int = 4; ++pub const EIO: c_int = 5; ++pub const ENXIO: c_int = 6; ++pub const E2BIG: c_int = 7; ++pub const ENOEXEC: c_int = 8; ++pub const EBADF: c_int = 9; ++pub const ECHILD: c_int = 10; ++pub const EAGAIN: c_int = 11; ++pub const ENOMEM: c_int = 12; ++pub const EACCES: c_int = 13; ++pub const EFAULT: c_int = 14; ++pub const ENOTBLK: c_int = 15; ++pub const EBUSY: c_int = 16; ++pub const EEXIST: c_int = 17; ++pub const EXDEV: c_int = 18; ++pub const ENODEV: c_int = 19; ++pub const ENOTDIR: c_int = 20; ++pub const EISDIR: c_int = 21; ++pub const EINVAL: c_int = 22; ++pub const ENFILE: c_int = 23; ++pub const EMFILE: c_int = 24; ++pub const ENOTTY: c_int = 25; ++pub const ETXTBSY: c_int = 26; ++pub const EFBIG: c_int = 27; ++pub const ENOSPC: c_int = 28; ++pub const ESPIPE: c_int = 29; ++pub const EROFS: c_int = 30; ++pub const EMLINK: c_int = 31; ++pub const EPIPE: c_int = 32; ++pub const EDOM: c_int = 33; ++pub const ERANGE: c_int = 34; ++pub const EWOULDBLOCK: c_int = EAGAIN; ++ ++pub const PRIO_PROCESS: c_int = 0; ++pub const PRIO_PGRP: c_int = 1; ++pub const PRIO_USER: c_int = 2; ++ ++// linux/sched.h ++pub const SCHED_NORMAL: c_int = 0; ++pub const SCHED_FIFO: c_int = 1; ++pub const SCHED_RR: c_int = 2; ++pub const SCHED_BATCH: c_int = 3; ++pub const SCHED_IDLE: c_int = 5; ++pub const SCHED_DEADLINE: c_int = 6; ++ ++pub const SCHED_RESET_ON_FORK: c_int = 0x40000000; ++ ++pub const CLONE_PIDFD: c_int = 0x1000; ++ ++// linux/membarrier.h ++pub const MEMBARRIER_CMD_QUERY: c_int = 0; ++pub const MEMBARRIER_CMD_GLOBAL: c_int = 1 << 0; ++pub const MEMBARRIER_CMD_GLOBAL_EXPEDITED: c_int = 1 << 1; ++pub const MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED: c_int = 1 << 2; ++pub const MEMBARRIER_CMD_PRIVATE_EXPEDITED: c_int = 1 << 3; ++pub const MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED: c_int = 1 << 4; ++pub const MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE: c_int = 1 << 5; ++pub const MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE: c_int = 1 << 6; ++pub const MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ: c_int = 1 << 7; ++pub const MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ: c_int = 1 << 8; ++ ++// linux/mempolicy.h ++pub const MPOL_DEFAULT: c_int = 0; ++pub const MPOL_PREFERRED: c_int = 1; ++pub const MPOL_BIND: c_int = 2; ++pub const MPOL_INTERLEAVE: c_int = 3; ++pub const MPOL_LOCAL: c_int = 4; ++pub const MPOL_F_NUMA_BALANCING: c_int = 1 << 13; ++pub const MPOL_F_RELATIVE_NODES: c_int = 1 << 14; ++pub const MPOL_F_STATIC_NODES: c_int = 1 << 15; ++ ++// bits/seek_constants.h ++pub const SEEK_DATA: c_int = 3; ++pub const SEEK_HOLE: c_int = 4; ++ ++// sys/socket.h ++pub const AF_NFC: c_int = 39; ++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/prctl.h ++pub const PR_SET_PDEATHSIG: c_int = 1; ++pub const PR_GET_PDEATHSIG: c_int = 2; ++pub const PR_GET_SECUREBITS: c_int = 27; ++pub const PR_SET_SECUREBITS: c_int = 28; ++ ++// sys/system_properties.h ++pub const PROP_VALUE_MAX: c_int = 92; ++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; ++pub const PR_SET_NAME: c_int = 15; ++pub const PR_GET_NAME: c_int = 16; ++ ++// 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_PROP_LIST: c_ushort = 52; ++pub const IFLA_ALT_IFNAME: c_ushort = 53; ++pub const IFLA_PERM_ADDRESS: c_ushort = 54; ++pub const IFLA_PROTO_DOWN_REASON: c_ushort = 55; ++pub const IFLA_PARENT_DEV_NAME: c_ushort = 56; ++pub const IFLA_PARENT_DEV_BUS_NAME: c_ushort = 57; ++pub const IFLA_GRO_MAX_SIZE: c_ushort = 58; ++pub const IFLA_TSO_MAX_SIZE: c_ushort = 59; ++pub const IFLA_TSO_MAX_SEGS: c_ushort = 60; ++pub const IFLA_ALLMULTI: c_ushort = 61; ++pub const IFLA_DEVLINK_PORT: c_ushort = 62; ++pub const IFLA_GSO_IPV4_MAX_SIZE: c_ushort = 63; ++pub const IFLA_GRO_IPV4_MAX_SIZE: c_ushort = 64; ++ ++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; ++ ++pub const CTL_KERN: c_int = 1; ++pub const CTL_VM: c_int = 2; ++pub const CTL_NET: c_int = 3; ++pub const CTL_FS: c_int = 5; ++pub const CTL_DEBUG: c_int = 6; ++pub const CTL_DEV: c_int = 7; ++pub const CTL_BUS: c_int = 8; ++pub const CTL_ABI: c_int = 9; ++pub const CTL_CPU: c_int = 10; ++ ++pub const CTL_BUS_ISA: c_int = 1; ++ ++pub const INOTIFY_MAX_USER_INSTANCES: c_int = 1; ++pub const INOTIFY_MAX_USER_WATCHES: c_int = 2; ++pub const INOTIFY_MAX_QUEUED_EVENTS: c_int = 3; ++ ++pub const KERN_OSTYPE: c_int = 1; ++pub const KERN_OSRELEASE: c_int = 2; ++pub const KERN_OSREV: c_int = 3; ++pub const KERN_VERSION: c_int = 4; ++pub const KERN_SECUREMASK: c_int = 5; ++pub const KERN_PROF: c_int = 6; ++pub const KERN_NODENAME: c_int = 7; ++pub const KERN_DOMAINNAME: c_int = 8; ++pub const KERN_PANIC: c_int = 15; ++pub const KERN_REALROOTDEV: c_int = 16; ++pub const KERN_SPARC_REBOOT: c_int = 21; ++pub const KERN_CTLALTDEL: c_int = 22; ++pub const KERN_PRINTK: c_int = 23; ++pub const KERN_NAMETRANS: c_int = 24; ++pub const KERN_PPC_HTABRECLAIM: c_int = 25; ++pub const KERN_PPC_ZEROPAGED: c_int = 26; ++pub const KERN_PPC_POWERSAVE_NAP: c_int = 27; ++pub const KERN_MODPROBE: c_int = 28; ++pub const KERN_SG_BIG_BUFF: c_int = 29; ++pub const KERN_ACCT: c_int = 30; ++pub const KERN_PPC_L2CR: c_int = 31; ++pub const KERN_RTSIGNR: c_int = 32; ++pub const KERN_RTSIGMAX: c_int = 33; ++pub const KERN_SHMMAX: c_int = 34; ++pub const KERN_MSGMAX: c_int = 35; ++pub const KERN_MSGMNB: c_int = 36; ++pub const KERN_MSGPOOL: c_int = 37; ++pub const KERN_SYSRQ: c_int = 38; ++pub const KERN_MAX_THREADS: c_int = 39; ++pub const KERN_RANDOM: c_int = 40; ++pub const KERN_SHMALL: c_int = 41; ++pub const KERN_MSGMNI: c_int = 42; ++pub const KERN_SEM: c_int = 43; ++pub const KERN_SPARC_STOP_A: c_int = 44; ++pub const KERN_SHMMNI: c_int = 45; ++pub const KERN_OVERFLOWUID: c_int = 46; ++pub const KERN_OVERFLOWGID: c_int = 47; ++pub const KERN_SHMPATH: c_int = 48; ++pub const KERN_HOTPLUG: c_int = 49; ++pub const KERN_IEEE_EMULATION_WARNINGS: c_int = 50; ++pub const KERN_S390_USER_DEBUG_LOGGING: c_int = 51; ++pub const KERN_CORE_USES_PID: c_int = 52; ++pub const KERN_TAINTED: c_int = 53; ++pub const KERN_CADPID: c_int = 54; ++pub const KERN_PIDMAX: c_int = 55; ++pub const KERN_CORE_PATTERN: c_int = 56; ++pub const KERN_PANIC_ON_OOPS: c_int = 57; ++pub const KERN_HPPA_PWRSW: c_int = 58; ++pub const KERN_HPPA_UNALIGNED: c_int = 59; ++pub const KERN_PRINTK_RATELIMIT: c_int = 60; ++pub const KERN_PRINTK_RATELIMIT_BURST: c_int = 61; ++pub const KERN_PTY: c_int = 62; ++pub const KERN_NGROUPS_MAX: c_int = 63; ++pub const KERN_SPARC_SCONS_PWROFF: c_int = 64; ++pub const KERN_HZ_TIMER: c_int = 65; ++pub const KERN_UNKNOWN_NMI_PANIC: c_int = 66; ++pub const KERN_BOOTLOADER_TYPE: c_int = 67; ++pub const KERN_RANDOMIZE: c_int = 68; ++pub const KERN_SETUID_DUMPABLE: c_int = 69; ++pub const KERN_SPIN_RETRY: c_int = 70; ++pub const KERN_ACPI_VIDEO_FLAGS: c_int = 71; ++pub const KERN_IA64_UNALIGNED: c_int = 72; ++pub const KERN_COMPAT_LOG: c_int = 73; ++pub const KERN_MAX_LOCK_DEPTH: c_int = 74; ++ ++pub const VM_OVERCOMMIT_MEMORY: c_int = 5; ++pub const VM_PAGE_CLUSTER: c_int = 10; ++pub const VM_DIRTY_BACKGROUND: c_int = 11; ++pub const VM_DIRTY_RATIO: c_int = 12; ++pub const VM_DIRTY_WB_CS: c_int = 13; ++pub const VM_DIRTY_EXPIRE_CS: c_int = 14; ++pub const VM_NR_PDFLUSH_THREADS: c_int = 15; ++pub const VM_OVERCOMMIT_RATIO: c_int = 16; ++pub const VM_PAGEBUF: c_int = 17; ++pub const VM_HUGETLB_PAGES: c_int = 18; ++pub const VM_SWAPPINESS: c_int = 19; ++pub const VM_LOWMEM_RESERVE_RATIO: c_int = 20; ++pub const VM_MIN_FREE_KBYTES: c_int = 21; ++pub const VM_MAX_MAP_COUNT: c_int = 22; ++pub const VM_LAPTOP_MODE: c_int = 23; ++pub const VM_BLOCK_DUMP: c_int = 24; ++pub const VM_HUGETLB_GROUP: c_int = 25; ++pub const VM_VFS_CACHE_PRESSURE: c_int = 26; ++pub const VM_LEGACY_VA_LAYOUT: c_int = 27; ++pub const VM_SWAP_TOKEN_TIMEOUT: c_int = 28; ++pub const VM_DROP_PAGECACHE: c_int = 29; ++pub const VM_PERCPU_PAGELIST_FRACTION: c_int = 30; ++pub const VM_ZONE_RECLAIM_MODE: c_int = 31; ++pub const VM_MIN_UNMAPPED: c_int = 32; ++pub const VM_PANIC_ON_OOM: c_int = 33; ++pub const VM_VDSO_ENABLED: c_int = 34; ++ ++pub const NET_CORE: c_int = 1; ++pub const NET_ETHER: c_int = 2; ++pub const NET_802: c_int = 3; ++pub const NET_UNIX: c_int = 4; ++pub const NET_IPV4: c_int = 5; ++pub const NET_IPX: c_int = 6; ++pub const NET_ATALK: c_int = 7; ++pub const NET_NETROM: c_int = 8; ++pub const NET_AX25: c_int = 9; ++pub const NET_BRIDGE: c_int = 10; ++pub const NET_ROSE: c_int = 11; ++pub const NET_IPV6: c_int = 12; ++pub const NET_X25: c_int = 13; ++pub const NET_TR: c_int = 14; ++pub const NET_DECNET: c_int = 15; ++pub const NET_ECONET: c_int = 16; ++pub const NET_SCTP: c_int = 17; ++pub const NET_LLC: c_int = 18; ++pub const NET_NETFILTER: c_int = 19; ++pub const NET_DCCP: c_int = 20; ++pub const HUGETLB_FLAG_ENCODE_SHIFT: c_int = 26; ++pub const MAP_HUGE_SHIFT: c_int = HUGETLB_FLAG_ENCODE_SHIFT; ++ ++// include/linux/sched.h ++pub const PF_VCPU: c_int = 0x00000001; ++pub const PF_IDLE: c_int = 0x00000002; ++pub const PF_EXITING: c_int = 0x00000004; ++pub const PF_POSTCOREDUMP: c_int = 0x00000008; ++pub const PF_IO_WORKER: c_int = 0x00000010; ++pub const PF_WQ_WORKER: c_int = 0x00000020; ++pub const PF_FORKNOEXEC: c_int = 0x00000040; ++pub const PF_MCE_PROCESS: c_int = 0x00000080; ++pub const PF_SUPERPRIV: c_int = 0x00000100; ++pub const PF_DUMPCORE: c_int = 0x00000200; ++pub const PF_SIGNALED: c_int = 0x00000400; ++pub const PF_MEMALLOC: c_int = 0x00000800; ++pub const PF_NPROC_EXCEEDED: c_int = 0x00001000; ++pub const PF_USED_MATH: c_int = 0x00002000; ++pub const PF_USER_WORKER: c_int = 0x00004000; ++pub const PF_NOFREEZE: c_int = 0x00008000; ++ ++pub const PF_KSWAPD: c_int = 0x00020000; ++pub const PF_MEMALLOC_NOFS: c_int = 0x00040000; ++pub const PF_MEMALLOC_NOIO: c_int = 0x00080000; ++pub const PF_LOCAL_THROTTLE: c_int = 0x00100000; ++pub const PF_KTHREAD: c_int = 0x00200000; ++pub const PF_RANDOMIZE: c_int = 0x00400000; ++ ++pub const PF_NO_SETAFFINITY: c_int = 0x04000000; ++pub const PF_MCE_EARLY: c_int = 0x08000000; ++pub const PF_MEMALLOC_PIN: c_int = 0x10000000; ++ ++pub const PF_SUSPEND_TASK: c_int = 0x80000000; ++ ++pub const KLOG_CLOSE: c_int = 0; ++pub const KLOG_OPEN: c_int = 1; ++pub const KLOG_READ: c_int = 2; ++pub const KLOG_READ_ALL: c_int = 3; ++pub const KLOG_READ_CLEAR: c_int = 4; ++pub const KLOG_CLEAR: c_int = 5; ++pub const KLOG_CONSOLE_OFF: c_int = 6; ++pub const KLOG_CONSOLE_ON: c_int = 7; ++pub const KLOG_CONSOLE_LEVEL: c_int = 8; ++pub const KLOG_SIZE_UNREAD: c_int = 9; ++pub const KLOG_SIZE_BUFFER: c_int = 10; ++ ++// From NDK's linux/auxvec.h ++pub const AT_NULL: c_ulong = 0; ++pub const AT_IGNORE: c_ulong = 1; ++pub const AT_EXECFD: c_ulong = 2; ++pub const AT_PHDR: c_ulong = 3; ++pub const AT_PHENT: c_ulong = 4; ++pub const AT_PHNUM: c_ulong = 5; ++pub const AT_PAGESZ: c_ulong = 6; ++pub const AT_BASE: c_ulong = 7; ++pub const AT_FLAGS: c_ulong = 8; ++pub const AT_ENTRY: c_ulong = 9; ++pub const AT_NOTELF: c_ulong = 10; ++pub const AT_UID: c_ulong = 11; ++pub const AT_EUID: c_ulong = 12; ++pub const AT_GID: c_ulong = 13; ++pub const AT_EGID: c_ulong = 14; ++pub const AT_PLATFORM: c_ulong = 15; ++pub const AT_HWCAP: c_ulong = 16; ++pub const AT_CLKTCK: c_ulong = 17; ++pub const AT_SECURE: c_ulong = 23; ++pub const AT_BASE_PLATFORM: c_ulong = 24; ++pub const AT_RANDOM: c_ulong = 25; ++pub const AT_HWCAP2: c_ulong = 26; ++pub const AT_RSEQ_FEATURE_SIZE: c_ulong = 27; ++pub const AT_RSEQ_ALIGN: c_ulong = 28; ++pub const AT_EXECFN: c_ulong = 31; ++pub const AT_MINSIGSTKSZ: c_ulong = 51; ++ ++// Most `*_SUPER_MAGIC` constants are defined at the `linux_like` level; the ++// following are only available on newer Linux versions than the versions ++// currently used in CI in some configurations, so we define them here. ++cfg_if! { ++ if #[cfg(not(target_arch = "s390x"))] { ++ pub const XFS_SUPER_MAGIC: c_long = 0x58465342; ++ } else if #[cfg(target_arch = "s390x")] { ++ pub const XFS_SUPER_MAGIC: c_uint = 0x58465342; ++ } ++} ++ ++f! { ++ pub fn CMSG_NXTHDR(mhdr: *const msghdr, cmsg: *const cmsghdr) -> *mut cmsghdr { ++ let next = (cmsg as usize + super::CMSG_ALIGN((*cmsg).cmsg_len as usize)) as *mut cmsghdr; ++ let max = (*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize; ++ if (next.offset(1)) as usize > max { ++ 0 as *mut cmsghdr ++ } else { ++ next as *mut cmsghdr ++ } ++ } ++ ++ pub fn CPU_ALLOC_SIZE(count: c_int) -> size_t { ++ let _dummy: cpu_set_t = mem::zeroed(); ++ let size_in_bits = 8 * mem::size_of_val(&_dummy.__bits[0]); ++ ((count as size_t + size_in_bits - 1) / 8) as size_t ++ } ++ ++ pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () { ++ for slot in cpuset.__bits.iter_mut() { ++ *slot = 0; ++ } ++ } ++ ++ pub fn CPU_SET(cpu: usize, cpuset: &mut cpu_set_t) -> () { ++ let size_in_bits = 8 * mem::size_of_val(&cpuset.__bits[0]); // 32, 64 etc ++ let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits); ++ cpuset.__bits[idx] |= 1 << offset; ++ () ++ } ++ ++ pub fn CPU_CLR(cpu: usize, cpuset: &mut cpu_set_t) -> () { ++ let size_in_bits = 8 * mem::size_of_val(&cpuset.__bits[0]); // 32, 64 etc ++ let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits); ++ cpuset.__bits[idx] &= !(1 << offset); ++ () ++ } ++ ++ pub fn CPU_ISSET(cpu: usize, cpuset: &cpu_set_t) -> bool { ++ let size_in_bits = 8 * mem::size_of_val(&cpuset.__bits[0]); ++ let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits); ++ 0 != (cpuset.__bits[idx] & (1 << offset)) ++ } ++ ++ pub fn CPU_COUNT_S(size: usize, cpuset: &cpu_set_t) -> c_int { ++ let mut s: u32 = 0; ++ let size_of_mask = mem::size_of_val(&cpuset.__bits[0]); ++ for i in cpuset.__bits[..(size / size_of_mask)].iter() { ++ s += i.count_ones(); ++ } ++ s as c_int ++ } ++ ++ pub fn CPU_COUNT(cpuset: &cpu_set_t) -> c_int { ++ CPU_COUNT_S(mem::size_of::(), cpuset) ++ } ++ ++ pub fn CPU_EQUAL(set1: &cpu_set_t, set2: &cpu_set_t) -> bool { ++ set1.__bits == set2.__bits ++ } ++ ++ pub fn major(dev: crate::dev_t) -> c_int { ++ ((dev >> 8) & 0xfff) as c_int ++ } ++ pub fn minor(dev: crate::dev_t) -> c_int { ++ ((dev & 0xff) | ((dev >> 12) & 0xfff00)) as c_int ++ } ++ pub fn NLA_ALIGN(len: c_int) -> c_int { ++ return ((len) + NLA_ALIGNTO - 1) & !(NLA_ALIGNTO - 1); ++ } ++ ++ pub fn SO_EE_OFFENDER(ee: *const crate::sock_extended_err) -> *mut crate::sockaddr { ++ ee.offset(1) as *mut crate::sockaddr ++ } ++} ++ ++safe_f! { ++ pub {const} fn makedev(ma: c_uint, mi: c_uint) -> crate::dev_t { ++ let ma = ma as crate::dev_t; ++ let mi = mi as crate::dev_t; ++ ((ma & 0xfff) << 8) | (mi & 0xff) | ((mi & 0xfff00) << 12) ++ } ++} ++ ++extern "C" { ++ pub fn setgrent(); ++ pub fn endgrent(); ++ pub fn getgrent() -> *mut crate::group; ++ pub fn getrlimit64(resource: c_int, rlim: *mut rlimit64) -> c_int; ++ pub fn setrlimit64(resource: c_int, rlim: *const rlimit64) -> c_int; ++ pub fn getrlimit(resource: c_int, rlim: *mut crate::rlimit) -> c_int; ++ pub fn setrlimit(resource: c_int, rlim: *const crate::rlimit) -> c_int; ++ pub fn prlimit( ++ pid: crate::pid_t, ++ resource: c_int, ++ new_limit: *const crate::rlimit, ++ old_limit: *mut crate::rlimit, ++ ) -> c_int; ++ pub fn prlimit64( ++ pid: crate::pid_t, ++ resource: c_int, ++ new_limit: *const crate::rlimit64, ++ old_limit: *mut crate::rlimit64, ++ ) -> c_int; ++ pub fn strerror_r(errnum: c_int, buf: *mut c_char, buflen: size_t) -> c_int; ++ ++ pub fn gettimeofday(tp: *mut crate::timeval, tz: *mut crate::timezone) -> c_int; ++ pub fn mlock2(addr: *const c_void, len: size_t, flags: c_int) -> c_int; ++ pub fn madvise(addr: *mut c_void, len: size_t, advice: c_int) -> c_int; ++ pub fn ioctl(fd: c_int, request: c_int, ...) -> c_int; ++ pub fn msync(addr: *mut c_void, len: size_t, flags: c_int) -> c_int; ++ pub fn mprotect(addr: *mut c_void, len: size_t, prot: c_int) -> c_int; ++ pub fn recvfrom( ++ socket: c_int, ++ buf: *mut c_void, ++ len: size_t, ++ flags: c_int, ++ addr: *mut crate::sockaddr, ++ addrlen: *mut crate::socklen_t, ++ ) -> ssize_t; ++ pub fn getnameinfo( ++ sa: *const crate::sockaddr, ++ salen: crate::socklen_t, ++ host: *mut c_char, ++ hostlen: size_t, ++ serv: *mut c_char, ++ servlen: size_t, ++ flags: c_int, ++ ) -> c_int; ++ pub fn preadv(fd: c_int, iov: *const crate::iovec, count: c_int, offset: off_t) -> ssize_t; ++ pub fn pwritev(fd: c_int, iov: *const crate::iovec, count: c_int, offset: off_t) -> ssize_t; ++ pub fn process_vm_readv( ++ pid: crate::pid_t, ++ local_iov: *const crate::iovec, ++ local_iov_count: c_ulong, ++ remote_iov: *const crate::iovec, ++ remote_iov_count: c_ulong, ++ flags: c_ulong, ++ ) -> ssize_t; ++ pub fn process_vm_writev( ++ pid: crate::pid_t, ++ local_iov: *const crate::iovec, ++ local_iov_count: c_ulong, ++ remote_iov: *const crate::iovec, ++ remote_iov_count: c_ulong, ++ flags: c_ulong, ++ ) -> ssize_t; ++ pub fn ptrace(request: c_int, ...) -> c_long; ++ pub fn getpriority(which: c_int, who: crate::id_t) -> c_int; ++ pub fn setpriority(which: c_int, who: crate::id_t, prio: c_int) -> c_int; ++ pub fn __sched_cpualloc(count: size_t) -> *mut crate::cpu_set_t; ++ pub fn __sched_cpufree(set: *mut crate::cpu_set_t); ++ pub fn __sched_cpucount(setsize: size_t, set: *const cpu_set_t) -> c_int; ++ pub fn sched_getcpu() -> c_int; ++ pub fn mallinfo() -> crate::mallinfo; ++ // available from API 23 ++ pub fn malloc_info(options: c_int, stream: *mut crate::FILE) -> c_int; ++ ++ pub fn malloc_usable_size(ptr: *const c_void) -> size_t; ++ ++ pub fn utmpname(name: *const c_char) -> c_int; ++ pub fn setutent(); ++ pub fn getutent() -> *mut utmp; ++ ++ pub fn seekdir(dirp: *mut crate::DIR, loc: c_long); ++ pub fn telldir(dirp: *mut crate::DIR) -> c_long; ++ pub fn fallocate(fd: c_int, mode: c_int, offset: off_t, len: off_t) -> c_int; ++ pub fn fallocate64(fd: c_int, mode: c_int, offset: off64_t, len: off64_t) -> c_int; ++ pub fn posix_fallocate(fd: c_int, offset: off_t, len: off_t) -> c_int; ++ pub fn posix_fallocate64(fd: c_int, offset: off64_t, len: off64_t) -> c_int; ++ pub fn getxattr( ++ path: *const c_char, ++ name: *const c_char, ++ value: *mut c_void, ++ size: size_t, ++ ) -> ssize_t; ++ pub fn lgetxattr( ++ path: *const c_char, ++ name: *const c_char, ++ value: *mut c_void, ++ size: size_t, ++ ) -> ssize_t; ++ pub fn fgetxattr( ++ filedes: c_int, ++ name: *const c_char, ++ value: *mut c_void, ++ size: size_t, ++ ) -> ssize_t; ++ pub fn setxattr( ++ path: *const c_char, ++ name: *const c_char, ++ value: *const c_void, ++ size: size_t, ++ flags: c_int, ++ ) -> c_int; ++ pub fn lsetxattr( ++ path: *const c_char, ++ name: *const c_char, ++ value: *const c_void, ++ size: size_t, ++ flags: c_int, ++ ) -> c_int; ++ pub fn fsetxattr( ++ filedes: c_int, ++ name: *const c_char, ++ value: *const c_void, ++ size: size_t, ++ flags: c_int, ++ ) -> c_int; ++ pub fn listxattr(path: *const c_char, list: *mut c_char, size: size_t) -> ssize_t; ++ pub fn llistxattr(path: *const c_char, list: *mut c_char, size: size_t) -> ssize_t; ++ pub fn flistxattr(filedes: c_int, list: *mut c_char, size: size_t) -> ssize_t; ++ pub fn removexattr(path: *const c_char, name: *const c_char) -> c_int; ++ pub fn lremovexattr(path: *const c_char, name: *const c_char) -> c_int; ++ pub fn fremovexattr(filedes: c_int, name: *const c_char) -> c_int; ++ pub fn signalfd(fd: c_int, mask: *const crate::sigset_t, flags: c_int) -> c_int; ++ pub fn timerfd_create(clock: crate::clockid_t, flags: c_int) -> c_int; ++ pub fn timerfd_gettime(fd: c_int, current_value: *mut itimerspec) -> c_int; ++ pub fn timerfd_settime( ++ fd: c_int, ++ flags: c_int, ++ new_value: *const itimerspec, ++ old_value: *mut itimerspec, ++ ) -> c_int; ++ pub fn syscall(num: c_long, ...) -> c_long; ++ pub fn sched_getaffinity( ++ pid: crate::pid_t, ++ cpusetsize: size_t, ++ cpuset: *mut cpu_set_t, ++ ) -> c_int; ++ pub fn sched_setaffinity( ++ pid: crate::pid_t, ++ cpusetsize: size_t, ++ cpuset: *const cpu_set_t, ++ ) -> c_int; ++ pub fn epoll_create(size: c_int) -> c_int; ++ pub fn epoll_create1(flags: c_int) -> c_int; ++ pub fn epoll_wait( ++ epfd: c_int, ++ events: *mut crate::epoll_event, ++ maxevents: c_int, ++ timeout: c_int, ++ ) -> c_int; ++ pub fn epoll_ctl(epfd: c_int, op: c_int, fd: c_int, event: *mut crate::epoll_event) -> c_int; ++ pub fn pthread_getschedparam( ++ native: crate::pthread_t, ++ policy: *mut c_int, ++ param: *mut crate::sched_param, ++ ) -> c_int; ++ pub fn unshare(flags: c_int) -> c_int; ++ pub fn umount(target: *const c_char) -> c_int; ++ pub fn sched_get_priority_max(policy: c_int) -> c_int; ++ pub fn tee(fd_in: c_int, fd_out: c_int, len: size_t, flags: c_uint) -> ssize_t; ++ pub fn settimeofday(tv: *const crate::timeval, tz: *const crate::timezone) -> c_int; ++ pub fn splice( ++ fd_in: c_int, ++ off_in: *mut crate::loff_t, ++ fd_out: c_int, ++ off_out: *mut crate::loff_t, ++ len: size_t, ++ flags: c_uint, ++ ) -> ssize_t; ++ pub fn eventfd(init: c_uint, flags: c_int) -> c_int; ++ pub fn eventfd_read(fd: c_int, value: *mut eventfd_t) -> c_int; ++ pub fn eventfd_write(fd: c_int, value: eventfd_t) -> c_int; ++ pub fn sched_rr_get_interval(pid: crate::pid_t, tp: *mut crate::timespec) -> c_int; ++ pub fn sem_timedwait(sem: *mut sem_t, abstime: *const crate::timespec) -> c_int; ++ pub fn sem_getvalue(sem: *mut sem_t, sval: *mut c_int) -> c_int; ++ pub fn sched_setparam(pid: crate::pid_t, param: *const crate::sched_param) -> c_int; ++ pub fn setns(fd: c_int, nstype: c_int) -> c_int; ++ pub fn swapoff(puath: *const c_char) -> c_int; ++ pub fn vmsplice(fd: c_int, iov: *const crate::iovec, nr_segs: size_t, flags: c_uint) ++ -> ssize_t; ++ pub fn mount( ++ src: *const c_char, ++ target: *const c_char, ++ fstype: *const c_char, ++ flags: c_ulong, ++ data: *const c_void, ++ ) -> c_int; ++ pub fn personality(persona: c_uint) -> c_int; ++ pub fn prctl(option: c_int, ...) -> c_int; ++ pub fn sched_getparam(pid: crate::pid_t, param: *mut crate::sched_param) -> c_int; ++ pub fn ppoll( ++ fds: *mut crate::pollfd, ++ nfds: nfds_t, ++ timeout: *const crate::timespec, ++ sigmask: *const sigset_t, ++ ) -> c_int; ++ pub fn pthread_mutex_timedlock( ++ lock: *mut pthread_mutex_t, ++ abstime: *const crate::timespec, ++ ) -> c_int; ++ pub fn pthread_barrierattr_init(attr: *mut crate::pthread_barrierattr_t) -> c_int; ++ pub fn pthread_barrierattr_destroy(attr: *mut crate::pthread_barrierattr_t) -> c_int; ++ pub fn pthread_barrierattr_getpshared( ++ attr: *const crate::pthread_barrierattr_t, ++ shared: *mut c_int, ++ ) -> c_int; ++ pub fn pthread_barrierattr_setpshared( ++ attr: *mut crate::pthread_barrierattr_t, ++ shared: c_int, ++ ) -> c_int; ++ pub fn pthread_barrier_init( ++ barrier: *mut pthread_barrier_t, ++ attr: *const crate::pthread_barrierattr_t, ++ count: c_uint, ++ ) -> c_int; ++ pub fn pthread_barrier_destroy(barrier: *mut pthread_barrier_t) -> c_int; ++ pub fn pthread_barrier_wait(barrier: *mut pthread_barrier_t) -> c_int; ++ pub fn pthread_spin_init(lock: *mut crate::pthread_spinlock_t, pshared: c_int) -> c_int; ++ pub fn pthread_spin_destroy(lock: *mut crate::pthread_spinlock_t) -> c_int; ++ pub fn pthread_spin_lock(lock: *mut crate::pthread_spinlock_t) -> c_int; ++ pub fn pthread_spin_trylock(lock: *mut crate::pthread_spinlock_t) -> c_int; ++ pub fn pthread_spin_unlock(lock: *mut crate::pthread_spinlock_t) -> c_int; ++ pub fn clone( ++ cb: extern "C" fn(*mut c_void) -> c_int, ++ child_stack: *mut c_void, ++ flags: c_int, ++ arg: *mut c_void, ++ ... ++ ) -> c_int; ++ pub fn sched_getscheduler(pid: crate::pid_t) -> c_int; ++ pub fn clock_nanosleep( ++ clk_id: crate::clockid_t, ++ flags: c_int, ++ rqtp: *const crate::timespec, ++ rmtp: *mut crate::timespec, ++ ) -> c_int; ++ pub fn pthread_attr_getguardsize( ++ attr: *const crate::pthread_attr_t, ++ guardsize: *mut size_t, ++ ) -> c_int; ++ pub fn pthread_attr_setguardsize(attr: *mut crate::pthread_attr_t, guardsize: size_t) -> c_int; ++ pub fn pthread_attr_getinheritsched( ++ attr: *const crate::pthread_attr_t, ++ flag: *mut c_int, ++ ) -> c_int; ++ pub fn pthread_attr_setinheritsched(attr: *mut crate::pthread_attr_t, flag: c_int) -> c_int; ++ pub fn sethostname(name: *const c_char, len: size_t) -> c_int; ++ pub fn sched_get_priority_min(policy: c_int) -> c_int; ++ pub fn pthread_condattr_getpshared( ++ attr: *const pthread_condattr_t, ++ pshared: *mut c_int, ++ ) -> c_int; ++ pub fn sysinfo(info: *mut crate::sysinfo) -> c_int; ++ pub fn umount2(target: *const c_char, flags: c_int) -> c_int; ++ pub fn pthread_setschedparam( ++ native: crate::pthread_t, ++ policy: c_int, ++ param: *const crate::sched_param, ++ ) -> c_int; ++ pub fn swapon(path: *const c_char, swapflags: c_int) -> c_int; ++ pub fn sched_setscheduler( ++ pid: crate::pid_t, ++ policy: c_int, ++ param: *const crate::sched_param, ++ ) -> c_int; ++ pub fn sendfile(out_fd: c_int, in_fd: c_int, offset: *mut off_t, count: size_t) -> ssize_t; ++ pub fn sendfile64(out_fd: c_int, in_fd: c_int, offset: *mut off64_t, count: size_t) -> ssize_t; ++ pub fn setfsgid(gid: crate::gid_t) -> c_int; ++ pub fn setfsuid(uid: crate::uid_t) -> c_int; ++ pub fn sigsuspend(mask: *const crate::sigset_t) -> c_int; ++ pub fn getgrgid_r( ++ gid: crate::gid_t, ++ grp: *mut crate::group, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut crate::group, ++ ) -> c_int; ++ pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> c_int; ++ pub fn sem_close(sem: *mut sem_t) -> c_int; ++ pub fn getgrnam_r( ++ name: *const c_char, ++ grp: *mut crate::group, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut crate::group, ++ ) -> c_int; ++ pub fn pthread_sigmask(how: c_int, set: *const sigset_t, oldset: *mut sigset_t) -> c_int; ++ pub fn sem_open(name: *const c_char, oflag: c_int, ...) -> *mut sem_t; ++ pub fn getgrnam(name: *const c_char) -> *mut crate::group; ++ pub fn pthread_kill(thread: crate::pthread_t, sig: c_int) -> c_int; ++ pub fn sem_unlink(name: *const c_char) -> c_int; ++ pub fn daemon(nochdir: c_int, noclose: c_int) -> c_int; ++ pub fn getpwnam_r( ++ name: *const c_char, ++ pwd: *mut passwd, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut passwd, ++ ) -> c_int; ++ pub fn getpwuid_r( ++ uid: crate::uid_t, ++ pwd: *mut passwd, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut passwd, ++ ) -> c_int; ++ pub fn sigtimedwait( ++ set: *const sigset_t, ++ info: *mut siginfo_t, ++ timeout: *const crate::timespec, ++ ) -> c_int; ++ pub fn sigwait(set: *const sigset_t, sig: *mut c_int) -> c_int; ++ pub fn pthread_atfork( ++ prepare: Option, ++ parent: Option, ++ child: Option, ++ ) -> c_int; ++ pub fn getgrgid(gid: crate::gid_t) -> *mut crate::group; ++ pub fn getgrouplist( ++ user: *const c_char, ++ group: crate::gid_t, ++ groups: *mut crate::gid_t, ++ ngroups: *mut c_int, ++ ) -> c_int; ++ pub fn initgroups(user: *const c_char, group: crate::gid_t) -> c_int; ++ pub fn pthread_mutexattr_getpshared( ++ attr: *const pthread_mutexattr_t, ++ pshared: *mut c_int, ++ ) -> c_int; ++ pub fn popen(command: *const c_char, mode: *const c_char) -> *mut crate::FILE; ++ pub fn faccessat(dirfd: c_int, pathname: *const c_char, mode: c_int, flags: c_int) -> c_int; ++ pub fn pthread_create( ++ native: *mut crate::pthread_t, ++ attr: *const crate::pthread_attr_t, ++ f: extern "C" fn(*mut c_void) -> *mut c_void, ++ value: *mut c_void, ++ ) -> c_int; ++ pub fn __errno() -> *mut c_int; ++ pub fn inotify_rm_watch(fd: c_int, wd: u32) -> c_int; ++ pub fn sendmmsg( ++ sockfd: c_int, ++ msgvec: *const crate::mmsghdr, ++ vlen: c_uint, ++ flags: c_int, ++ ) -> c_int; ++ pub fn recvmmsg( ++ sockfd: c_int, ++ msgvec: *mut crate::mmsghdr, ++ vlen: c_uint, ++ flags: c_int, ++ timeout: *const crate::timespec, ++ ) -> c_int; ++ pub fn inotify_init() -> c_int; ++ pub fn inotify_init1(flags: c_int) -> c_int; ++ pub fn inotify_add_watch(fd: c_int, path: *const c_char, mask: u32) -> c_int; ++ ++ pub fn regcomp(preg: *mut crate::regex_t, pattern: *const c_char, cflags: c_int) -> c_int; ++ ++ pub fn regexec( ++ preg: *const crate::regex_t, ++ input: *const c_char, ++ nmatch: size_t, ++ pmatch: *mut regmatch_t, ++ eflags: c_int, ++ ) -> c_int; ++ ++ pub fn regerror( ++ errcode: c_int, ++ preg: *const crate::regex_t, ++ errbuf: *mut c_char, ++ errbuf_size: size_t, ++ ) -> size_t; ++ ++ pub fn regfree(preg: *mut crate::regex_t); ++ ++ pub fn android_set_abort_message(msg: *const c_char); ++ ++ pub fn gettid() -> crate::pid_t; ++ ++ /// Only available in API Version 28+ ++ pub fn getrandom(buf: *mut c_void, buflen: size_t, flags: c_uint) -> ssize_t; ++ pub fn getentropy(buf: *mut c_void, buflen: size_t) -> c_int; ++ ++ pub fn pthread_setname_np(thread: crate::pthread_t, name: *const c_char) -> c_int; ++ ++ pub fn __system_property_set(__name: *const c_char, __value: *const c_char) -> c_int; ++ pub fn __system_property_get(__name: *const c_char, __value: *mut c_char) -> c_int; ++ pub fn __system_property_find(__name: *const c_char) -> *const prop_info; ++ pub fn __system_property_find_nth(__n: c_uint) -> *const prop_info; ++ pub fn __system_property_foreach( ++ __callback: unsafe extern "C" fn(__pi: *const prop_info, __cookie: *mut c_void), ++ __cookie: *mut c_void, ++ ) -> c_int; ++ ++ // #include ++ /// Only available in API Version 21+ ++ pub fn dl_iterate_phdr( ++ callback: Option< ++ unsafe extern "C" fn(info: *mut dl_phdr_info, size: usize, data: *mut c_void) -> c_int, ++ >, ++ data: *mut c_void, ++ ) -> c_int; ++ ++ pub fn arc4random() -> u32; ++ pub fn arc4random_uniform(__upper_bound: u32) -> u32; ++ pub fn arc4random_buf(__buf: *mut c_void, __n: size_t); ++ ++ pub fn reallocarray(ptr: *mut c_void, nmemb: size_t, size: size_t) -> *mut c_void; ++ ++ pub fn pthread_getcpuclockid(thread: crate::pthread_t, clk_id: *mut crate::clockid_t) -> c_int; ++ ++ pub fn dirname(path: *const c_char) -> *mut c_char; ++ pub fn basename(path: *const c_char) -> *mut c_char; ++ pub fn getopt_long( ++ argc: c_int, ++ argv: *const *mut c_char, ++ optstring: *const c_char, ++ longopts: *const option, ++ longindex: *mut c_int, ++ ) -> c_int; ++ ++ pub fn sync(); ++ pub fn syncfs(fd: c_int) -> c_int; ++ ++ pub fn memmem( ++ haystack: *const c_void, ++ haystacklen: size_t, ++ needle: *const c_void, ++ needlelen: size_t, ++ ) -> *mut c_void; ++ pub fn fread_unlocked( ++ buf: *mut c_void, ++ size: size_t, ++ nobj: size_t, ++ stream: *mut crate::FILE, ++ ) -> size_t; ++ pub fn fwrite_unlocked( ++ buf: *const c_void, ++ size: size_t, ++ nobj: size_t, ++ stream: *mut crate::FILE, ++ ) -> size_t; ++ pub fn fflush_unlocked(stream: *mut crate::FILE) -> c_int; ++ pub fn fgets_unlocked(buf: *mut c_char, size: c_int, stream: *mut crate::FILE) -> *mut c_char; ++ ++ pub fn klogctl(syslog_type: c_int, bufp: *mut c_char, len: c_int) -> c_int; ++ ++ pub fn memfd_create(name: *const c_char, flags: c_uint) -> c_int; ++ pub fn renameat2( ++ olddirfd: c_int, ++ oldpath: *const c_char, ++ newdirfd: c_int, ++ newpath: *const c_char, ++ flags: c_uint, ++ ) -> c_int; ++} ++ ++cfg_if! { ++ if #[cfg(target_pointer_width = "32")] { ++ mod b32; ++ pub use self::b32::*; ++ } else if #[cfg(target_pointer_width = "64")] { ++ mod b64; ++ pub use self::b64::*; ++ } else { ++ // Unknown target_pointer_width ++ } ++} ++ ++impl siginfo_t { ++ pub unsafe fn si_addr(&self) -> *mut c_void { ++ #[repr(C)] ++ struct siginfo_sigfault { ++ _si_signo: c_int, ++ _si_errno: c_int, ++ _si_code: c_int, ++ si_addr: *mut c_void, ++ } ++ (*(self as *const siginfo_t as *const siginfo_sigfault)).si_addr ++ } ++ ++ pub unsafe fn si_value(&self) -> crate::sigval { ++ #[repr(C)] ++ struct siginfo_timer { ++ _si_signo: c_int, ++ _si_errno: c_int, ++ _si_code: c_int, ++ _si_tid: c_int, ++ _si_overrun: c_int, ++ si_sigval: crate::sigval, ++ } ++ (*(self as *const siginfo_t as *const siginfo_timer)).si_sigval ++ } ++} ++ ++// Internal, for casts to access union fields ++#[repr(C)] ++struct sifields_sigchld { ++ si_pid: crate::pid_t, ++ si_uid: crate::uid_t, ++ si_status: c_int, ++ si_utime: c_long, ++ si_stime: c_long, ++} ++impl Copy for sifields_sigchld {} ++impl Clone for sifields_sigchld { ++ fn clone(&self) -> sifields_sigchld { ++ *self ++ } ++} ++ ++// Internal, for casts to access union fields ++#[repr(C)] ++union sifields { ++ _align_pointer: *mut c_void, ++ sigchld: sifields_sigchld, ++} ++ ++// Internal, for casts to access union fields. Note that some variants ++// of sifields start with a pointer, which makes the alignment of ++// sifields vary on 32-bit and 64-bit architectures. ++#[repr(C)] ++struct siginfo_f { ++ _siginfo_base: [c_int; 3], ++ sifields: sifields, ++} ++ ++impl siginfo_t { ++ unsafe fn sifields(&self) -> &sifields { ++ &(*(self as *const siginfo_t as *const siginfo_f)).sifields ++ } ++ ++ pub unsafe fn si_pid(&self) -> crate::pid_t { ++ self.sifields().sigchld.si_pid ++ } ++ ++ pub unsafe fn si_uid(&self) -> crate::uid_t { ++ self.sifields().sigchld.si_uid ++ } ++ ++ pub unsafe fn si_status(&self) -> c_int { ++ self.sifields().sigchld.si_status ++ } ++ ++ pub unsafe fn si_utime(&self) -> c_long { ++ self.sifields().sigchld.si_utime ++ } ++ ++ pub unsafe fn si_stime(&self) -> c_long { ++ self.sifields().sigchld.si_stime ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/emscripten/lfs64.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/emscripten/lfs64.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/emscripten/lfs64.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/emscripten/lfs64.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,211 @@ ++use crate::off64_t; ++use crate::prelude::*; ++ ++// In-sync with ../linux/musl/lfs64.rs except for fallocate64, prlimit64 and sendfile64 ++ ++#[inline] ++pub unsafe extern "C" fn creat64(path: *const c_char, mode: crate::mode_t) -> c_int { ++ crate::creat(path, mode) ++} ++ ++#[inline] ++pub unsafe extern "C" fn fgetpos64(stream: *mut crate::FILE, pos: *mut crate::fpos64_t) -> c_int { ++ crate::fgetpos(stream, pos as *mut _) ++} ++ ++#[inline] ++pub unsafe extern "C" fn fopen64(pathname: *const c_char, mode: *const c_char) -> *mut crate::FILE { ++ crate::fopen(pathname, mode) ++} ++ ++#[inline] ++pub unsafe extern "C" fn freopen64( ++ pathname: *const c_char, ++ mode: *const c_char, ++ stream: *mut crate::FILE, ++) -> *mut crate::FILE { ++ crate::freopen(pathname, mode, stream) ++} ++ ++#[inline] ++pub unsafe extern "C" fn fseeko64( ++ stream: *mut crate::FILE, ++ offset: off64_t, ++ whence: c_int, ++) -> c_int { ++ crate::fseeko(stream, offset, whence) ++} ++ ++#[inline] ++pub unsafe extern "C" fn fsetpos64(stream: *mut crate::FILE, pos: *const crate::fpos64_t) -> c_int { ++ crate::fsetpos(stream, pos as *mut _) ++} ++ ++#[inline] ++pub unsafe extern "C" fn fstat64(fildes: c_int, buf: *mut crate::stat64) -> c_int { ++ crate::fstat(fildes, buf as *mut _) ++} ++ ++#[inline] ++pub unsafe extern "C" fn fstatat64( ++ fd: c_int, ++ path: *const c_char, ++ buf: *mut crate::stat64, ++ flag: c_int, ++) -> c_int { ++ crate::fstatat(fd, path, buf as *mut _, flag) ++} ++ ++#[inline] ++pub unsafe extern "C" fn fstatfs64(fd: c_int, buf: *mut crate::statfs64) -> c_int { ++ crate::fstatfs(fd, buf as *mut _) ++} ++ ++#[inline] ++pub unsafe extern "C" fn fstatvfs64(fd: c_int, buf: *mut crate::statvfs64) -> c_int { ++ crate::fstatvfs(fd, buf as *mut _) ++} ++ ++#[inline] ++pub unsafe extern "C" fn ftello64(stream: *mut crate::FILE) -> off64_t { ++ crate::ftello(stream) ++} ++ ++#[inline] ++pub unsafe extern "C" fn ftruncate64(fd: c_int, length: off64_t) -> c_int { ++ crate::ftruncate(fd, length) ++} ++ ++#[inline] ++pub unsafe extern "C" fn getrlimit64(resource: c_int, rlim: *mut crate::rlimit64) -> c_int { ++ crate::getrlimit(resource, rlim as *mut _) ++} ++ ++#[inline] ++pub unsafe extern "C" fn lseek64(fd: c_int, offset: off64_t, whence: c_int) -> off64_t { ++ crate::lseek(fd, offset, whence) ++} ++ ++#[inline] ++pub unsafe extern "C" fn lstat64(path: *const c_char, buf: *mut crate::stat64) -> c_int { ++ crate::lstat(path, buf as *mut _) ++} ++ ++#[inline] ++pub unsafe extern "C" fn mmap64( ++ addr: *mut c_void, ++ length: size_t, ++ prot: c_int, ++ flags: c_int, ++ fd: c_int, ++ offset: off64_t, ++) -> *mut c_void { ++ crate::mmap(addr, length, prot, flags, fd, offset) ++} ++ ++// These functions are variadic in the C ABI since the `mode` argument is "optional". Variadic ++// `extern "C"` functions are unstable in Rust so we cannot write a shim function for these ++// entrypoints. See https://github.com/rust-lang/rust/issues/44930. ++// ++// These aliases are mostly fine though, neither function takes a LFS64-namespaced type as an ++// argument, nor do their names clash with any declared types. ++pub use crate::{open as open64, openat as openat64}; ++ ++#[inline] ++pub unsafe extern "C" fn posix_fadvise64( ++ fd: c_int, ++ offset: off64_t, ++ len: off64_t, ++ advice: c_int, ++) -> c_int { ++ crate::posix_fadvise(fd, offset, len, advice) ++} ++ ++#[inline] ++pub unsafe extern "C" fn posix_fallocate64(fd: c_int, offset: off64_t, len: off64_t) -> c_int { ++ crate::posix_fallocate(fd, offset, len) ++} ++ ++#[inline] ++pub unsafe extern "C" fn pread64( ++ fd: c_int, ++ buf: *mut c_void, ++ count: size_t, ++ offset: off64_t, ++) -> ssize_t { ++ crate::pread(fd, buf, count, offset) ++} ++ ++#[inline] ++pub unsafe extern "C" fn preadv64( ++ fd: c_int, ++ iov: *const crate::iovec, ++ iovcnt: c_int, ++ offset: off64_t, ++) -> ssize_t { ++ crate::preadv(fd, iov, iovcnt, offset) ++} ++ ++#[inline] ++pub unsafe extern "C" fn pwrite64( ++ fd: c_int, ++ buf: *const c_void, ++ count: size_t, ++ offset: off64_t, ++) -> ssize_t { ++ crate::pwrite(fd, buf, count, offset) ++} ++ ++#[inline] ++pub unsafe extern "C" fn pwritev64( ++ fd: c_int, ++ iov: *const crate::iovec, ++ iovcnt: c_int, ++ offset: off64_t, ++) -> ssize_t { ++ crate::pwritev(fd, iov, iovcnt, offset) ++} ++ ++#[inline] ++pub unsafe extern "C" fn readdir64(dirp: *mut crate::DIR) -> *mut crate::dirent64 { ++ crate::readdir(dirp) as *mut _ ++} ++ ++#[inline] ++pub unsafe extern "C" fn readdir64_r( ++ dirp: *mut crate::DIR, ++ entry: *mut crate::dirent64, ++ result: *mut *mut crate::dirent64, ++) -> c_int { ++ crate::readdir_r(dirp, entry as *mut _, result as *mut _) ++} ++ ++#[inline] ++pub unsafe extern "C" fn setrlimit64(resource: c_int, rlim: *const crate::rlimit64) -> c_int { ++ crate::setrlimit(resource, rlim as *mut _) ++} ++ ++#[inline] ++pub unsafe extern "C" fn stat64(pathname: *const c_char, statbuf: *mut crate::stat64) -> c_int { ++ crate::stat(pathname, statbuf as *mut _) ++} ++ ++#[inline] ++pub unsafe extern "C" fn statfs64(pathname: *const c_char, buf: *mut crate::statfs64) -> c_int { ++ crate::statfs(pathname, buf as *mut _) ++} ++ ++#[inline] ++pub unsafe extern "C" fn statvfs64(path: *const c_char, buf: *mut crate::statvfs64) -> c_int { ++ crate::statvfs(path, buf as *mut _) ++} ++ ++#[inline] ++pub unsafe extern "C" fn tmpfile64() -> *mut crate::FILE { ++ crate::tmpfile() ++} ++ ++#[inline] ++pub unsafe extern "C" fn truncate64(path: *const c_char, length: off64_t) -> c_int { ++ crate::truncate(path, length) ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/emscripten/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/emscripten/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/emscripten/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/emscripten/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,1642 @@ ++use crate::prelude::*; ++ ++pub type c_char = i8; ++pub type wchar_t = i32; ++pub type useconds_t = u32; ++pub type dev_t = u32; ++pub type socklen_t = u32; ++pub type pthread_t = c_ulong; ++pub type mode_t = u32; ++pub type shmatt_t = c_ulong; ++pub type mqd_t = c_int; ++pub type msgqnum_t = c_ulong; ++pub type msglen_t = c_ulong; ++pub type nfds_t = c_ulong; ++pub type nl_item = c_int; ++pub type idtype_t = c_uint; ++pub type loff_t = i64; ++pub type pthread_key_t = c_uint; ++ ++pub type clock_t = c_long; ++pub type time_t = i64; ++pub type suseconds_t = c_long; ++pub type ino_t = u64; ++pub type off_t = i64; ++pub type blkcnt_t = i32; ++ ++pub type blksize_t = c_long; ++pub type fsblkcnt_t = u32; ++pub type fsfilcnt_t = u32; ++pub type rlim_t = u64; ++pub type c_long = i32; ++pub type c_ulong = u32; ++pub type nlink_t = u32; ++ ++pub type ino64_t = crate::ino_t; ++pub type off64_t = off_t; ++pub type blkcnt64_t = crate::blkcnt_t; ++pub type rlim64_t = crate::rlim_t; ++ ++pub type rlimit64 = crate::rlimit; ++pub type flock64 = crate::flock; ++pub type stat64 = crate::stat; ++pub type statfs64 = crate::statfs; ++pub type statvfs64 = crate::statvfs; ++pub type dirent64 = crate::dirent; ++ ++#[cfg_attr(feature = "extra_traits", derive(Debug))] ++pub enum fpos64_t {} // FIXME: fill this out with a struct ++impl Copy for fpos64_t {} ++impl Clone for fpos64_t { ++ fn clone(&self) -> fpos64_t { ++ *self ++ } ++} ++ ++s! { ++ pub struct glob_t { ++ pub gl_pathc: size_t, ++ pub gl_pathv: *mut *mut c_char, ++ pub gl_offs: size_t, ++ pub gl_flags: c_int, ++ ++ __unused1: *mut c_void, ++ __unused2: *mut c_void, ++ __unused3: *mut c_void, ++ __unused4: *mut c_void, ++ __unused5: *mut c_void, ++ } ++ ++ pub struct passwd { ++ pub pw_name: *mut c_char, ++ pub pw_passwd: *mut c_char, ++ pub pw_uid: crate::uid_t, ++ pub pw_gid: crate::gid_t, ++ pub pw_gecos: *mut c_char, ++ pub pw_dir: *mut c_char, ++ pub pw_shell: *mut c_char, ++ } ++ ++ pub struct spwd { ++ pub sp_namp: *mut c_char, ++ pub sp_pwdp: *mut c_char, ++ pub sp_lstchg: c_long, ++ pub sp_min: c_long, ++ pub sp_max: c_long, ++ pub sp_warn: c_long, ++ pub sp_inact: c_long, ++ pub sp_expire: c_long, ++ pub sp_flag: c_ulong, ++ } ++ ++ pub struct statvfs { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_favail: crate::fsfilcnt_t, ++ pub f_fsid: c_ulong, ++ __f_unused: c_int, ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ __f_spare: [c_int; 6], ++ } ++ ++ pub struct signalfd_siginfo { ++ pub ssi_signo: u32, ++ pub ssi_errno: i32, ++ pub ssi_code: i32, ++ pub ssi_pid: u32, ++ pub ssi_uid: u32, ++ pub ssi_fd: i32, ++ pub ssi_tid: u32, ++ pub ssi_band: u32, ++ pub ssi_overrun: u32, ++ pub ssi_trapno: u32, ++ pub ssi_status: i32, ++ pub ssi_int: i32, ++ pub ssi_ptr: u64, ++ pub ssi_utime: u64, ++ pub ssi_stime: u64, ++ pub ssi_addr: u64, ++ pub ssi_addr_lsb: u16, ++ _pad2: u16, ++ pub ssi_syscall: i32, ++ pub ssi_call_addr: u64, ++ pub ssi_arch: u32, ++ _pad: [u8; 28], ++ } ++ ++ pub struct fsid_t { ++ __val: [c_int; 2], ++ } ++ ++ pub struct cpu_set_t { ++ bits: [u32; 32], ++ } ++ ++ pub struct if_nameindex { ++ pub if_index: c_uint, ++ pub if_name: *mut c_char, ++ } ++ ++ // System V IPC ++ pub struct msginfo { ++ pub msgpool: c_int, ++ pub msgmap: c_int, ++ pub msgmax: c_int, ++ pub msgmnb: c_int, ++ pub msgmni: c_int, ++ pub msgssz: c_int, ++ pub msgtql: c_int, ++ pub msgseg: c_ushort, ++ } ++ ++ pub struct sembuf { ++ pub sem_num: c_ushort, ++ pub sem_op: c_short, ++ pub sem_flg: c_short, ++ } ++ ++ pub struct sigaction { ++ pub sa_sigaction: crate::sighandler_t, ++ pub sa_mask: crate::sigset_t, ++ pub sa_flags: c_int, ++ pub sa_restorer: Option, ++ } ++ ++ pub struct ipc_perm { ++ pub __ipc_perm_key: crate::key_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub cuid: crate::uid_t, ++ pub cgid: crate::gid_t, ++ pub mode: crate::mode_t, ++ pub __seq: c_int, ++ __unused1: c_long, ++ __unused2: c_long, ++ } ++ ++ pub struct termios { ++ pub c_iflag: crate::tcflag_t, ++ pub c_oflag: crate::tcflag_t, ++ pub c_cflag: crate::tcflag_t, ++ pub c_lflag: crate::tcflag_t, ++ pub c_line: crate::cc_t, ++ pub c_cc: [crate::cc_t; crate::NCCS], ++ pub __c_ispeed: crate::speed_t, ++ pub __c_ospeed: crate::speed_t, ++ } ++ ++ pub struct flock { ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ pub l_start: off_t, ++ pub l_len: off_t, ++ pub l_pid: crate::pid_t, ++ } ++ ++ pub struct pthread_attr_t { ++ __size: [u32; 11], ++ } ++ ++ pub struct sigset_t { ++ __val: [c_ulong; 32], ++ } ++ ++ pub struct msghdr { ++ pub msg_name: *mut c_void, ++ pub msg_namelen: crate::socklen_t, ++ pub msg_iov: *mut crate::iovec, ++ pub msg_iovlen: c_int, ++ pub msg_control: *mut c_void, ++ pub msg_controllen: crate::socklen_t, ++ pub msg_flags: c_int, ++ } ++ ++ pub struct cmsghdr { ++ pub cmsg_len: crate::socklen_t, ++ pub cmsg_level: c_int, ++ pub cmsg_type: c_int, ++ } ++ ++ pub struct sem_t { ++ __val: [c_int; 4], ++ } ++ pub struct stat { ++ pub st_dev: crate::dev_t, ++ #[cfg(not(emscripten_new_stat_abi))] ++ __st_dev_padding: c_int, ++ #[cfg(not(emscripten_new_stat_abi))] ++ __st_ino_truncated: c_long, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ #[cfg(not(emscripten_new_stat_abi))] ++ __st_rdev_padding: c_int, ++ pub st_size: off_t, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ pub st_ino: crate::ino_t, ++ } ++ ++ pub struct stack_t { ++ pub ss_sp: *mut c_void, ++ pub ss_flags: c_int, ++ pub ss_size: size_t, ++ } ++ ++ pub struct shmid_ds { ++ pub shm_perm: crate::ipc_perm, ++ pub shm_segsz: size_t, ++ pub shm_atime: crate::time_t, ++ pub shm_dtime: crate::time_t, ++ pub shm_ctime: crate::time_t, ++ pub shm_cpid: crate::pid_t, ++ pub shm_lpid: crate::pid_t, ++ pub shm_nattch: c_ulong, ++ __pad1: c_ulong, ++ __pad2: c_ulong, ++ } ++ ++ pub struct msqid_ds { ++ pub msg_perm: crate::ipc_perm, ++ pub msg_stime: crate::time_t, ++ pub msg_rtime: crate::time_t, ++ pub msg_ctime: crate::time_t, ++ __msg_cbytes: c_ulong, ++ pub msg_qnum: crate::msgqnum_t, ++ pub msg_qbytes: crate::msglen_t, ++ pub msg_lspid: crate::pid_t, ++ pub msg_lrpid: crate::pid_t, ++ __pad1: c_ulong, ++ __pad2: c_ulong, ++ } ++ ++ pub struct statfs { ++ pub f_type: c_ulong, ++ pub f_bsize: c_ulong, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_fsid: crate::fsid_t, ++ pub f_namelen: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_flags: c_ulong, ++ pub f_spare: [c_ulong; 4], ++ } ++ ++ pub struct siginfo_t { ++ pub si_signo: c_int, ++ pub si_errno: c_int, ++ pub si_code: c_int, ++ pub _pad: [c_int; 29], ++ _align: [usize; 0], ++ } ++ ++ pub struct arpd_request { ++ pub req: c_ushort, ++ pub ip: u32, ++ pub dev: c_ulong, ++ pub stamp: c_ulong, ++ pub updated: c_ulong, ++ pub ha: [c_uchar; crate::MAX_ADDR_LEN], ++ } ++ ++ #[allow(missing_debug_implementations)] ++ #[repr(align(4))] ++ pub struct pthread_mutex_t { ++ size: [u8; crate::__SIZEOF_PTHREAD_MUTEX_T], ++ } ++ ++ #[repr(align(4))] ++ pub struct pthread_rwlock_t { ++ size: [u8; crate::__SIZEOF_PTHREAD_RWLOCK_T], ++ } ++ ++ #[repr(align(4))] ++ pub struct pthread_mutexattr_t { ++ size: [u8; crate::__SIZEOF_PTHREAD_MUTEXATTR_T], ++ } ++ ++ #[repr(align(4))] ++ pub struct pthread_rwlockattr_t { ++ size: [u8; crate::__SIZEOF_PTHREAD_RWLOCKATTR_T], ++ } ++ ++ #[repr(align(4))] ++ pub struct pthread_condattr_t { ++ size: [u8; crate::__SIZEOF_PTHREAD_CONDATTR_T], ++ } ++} ++ ++s_no_extra_traits! { ++ pub struct dirent { ++ pub d_ino: crate::ino_t, ++ pub d_off: off_t, ++ pub d_reclen: c_ushort, ++ pub d_type: c_uchar, ++ pub d_name: [c_char; 256], ++ } ++ ++ pub struct sysinfo { ++ pub uptime: c_ulong, ++ pub loads: [c_ulong; 3], ++ pub totalram: c_ulong, ++ pub freeram: c_ulong, ++ pub sharedram: c_ulong, ++ pub bufferram: c_ulong, ++ pub totalswap: c_ulong, ++ pub freeswap: c_ulong, ++ pub procs: c_ushort, ++ pub pad: c_ushort, ++ pub totalhigh: c_ulong, ++ pub freehigh: c_ulong, ++ pub mem_unit: c_uint, ++ pub __reserved: [c_char; 256], ++ } ++ ++ pub struct mq_attr { ++ pub mq_flags: c_long, ++ pub mq_maxmsg: c_long, ++ pub mq_msgsize: c_long, ++ pub mq_curmsgs: c_long, ++ pad: [c_long; 4], ++ } ++ ++ #[cfg_attr(target_pointer_width = "32", repr(align(4)))] ++ #[cfg_attr(target_pointer_width = "64", repr(align(8)))] ++ pub struct pthread_cond_t { ++ size: [u8; crate::__SIZEOF_PTHREAD_COND_T], ++ } ++ ++ #[allow(missing_debug_implementations)] ++ #[repr(align(8))] ++ pub struct max_align_t { ++ priv_: [f64; 3], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for dirent { ++ fn eq(&self, other: &dirent) -> bool { ++ self.d_ino == other.d_ino ++ && self.d_off == other.d_off ++ && self.d_reclen == other.d_reclen ++ && self.d_type == other.d_type ++ && self ++ .d_name ++ .iter() ++ .zip(other.d_name.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for dirent {} ++ impl fmt::Debug for dirent { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("dirent") ++ .field("d_ino", &self.d_ino) ++ .field("d_off", &self.d_off) ++ .field("d_reclen", &self.d_reclen) ++ .field("d_type", &self.d_type) ++ // FIXME: .field("d_name", &self.d_name) ++ .finish() ++ } ++ } ++ impl hash::Hash for dirent { ++ fn hash(&self, state: &mut H) { ++ self.d_ino.hash(state); ++ self.d_off.hash(state); ++ self.d_reclen.hash(state); ++ self.d_type.hash(state); ++ self.d_name.hash(state); ++ } ++ } ++ ++ impl PartialEq for sysinfo { ++ fn eq(&self, other: &sysinfo) -> bool { ++ self.uptime == other.uptime ++ && self.loads == other.loads ++ && self.totalram == other.totalram ++ && self.freeram == other.freeram ++ && self.sharedram == other.sharedram ++ && self.bufferram == other.bufferram ++ && self.totalswap == other.totalswap ++ && self.freeswap == other.freeswap ++ && self.procs == other.procs ++ && self.pad == other.pad ++ && self.totalhigh == other.totalhigh ++ && self.freehigh == other.freehigh ++ && self.mem_unit == other.mem_unit ++ && self ++ .__reserved ++ .iter() ++ .zip(other.__reserved.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for sysinfo {} ++ impl fmt::Debug for sysinfo { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sysinfo") ++ .field("uptime", &self.uptime) ++ .field("loads", &self.loads) ++ .field("totalram", &self.totalram) ++ .field("freeram", &self.freeram) ++ .field("sharedram", &self.sharedram) ++ .field("bufferram", &self.bufferram) ++ .field("totalswap", &self.totalswap) ++ .field("freeswap", &self.freeswap) ++ .field("procs", &self.procs) ++ .field("pad", &self.pad) ++ .field("totalhigh", &self.totalhigh) ++ .field("freehigh", &self.freehigh) ++ .field("mem_unit", &self.mem_unit) ++ // FIXME: .field("__reserved", &self.__reserved) ++ .finish() ++ } ++ } ++ impl hash::Hash for sysinfo { ++ fn hash(&self, state: &mut H) { ++ self.uptime.hash(state); ++ self.loads.hash(state); ++ self.totalram.hash(state); ++ self.freeram.hash(state); ++ self.sharedram.hash(state); ++ self.bufferram.hash(state); ++ self.totalswap.hash(state); ++ self.freeswap.hash(state); ++ self.procs.hash(state); ++ self.pad.hash(state); ++ self.totalhigh.hash(state); ++ self.freehigh.hash(state); ++ self.mem_unit.hash(state); ++ self.__reserved.hash(state); ++ } ++ } ++ ++ impl PartialEq for mq_attr { ++ fn eq(&self, other: &mq_attr) -> bool { ++ self.mq_flags == other.mq_flags ++ && self.mq_maxmsg == other.mq_maxmsg ++ && self.mq_msgsize == other.mq_msgsize ++ && self.mq_curmsgs == other.mq_curmsgs ++ } ++ } ++ impl Eq for mq_attr {} ++ impl fmt::Debug for mq_attr { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("mq_attr") ++ .field("mq_flags", &self.mq_flags) ++ .field("mq_maxmsg", &self.mq_maxmsg) ++ .field("mq_msgsize", &self.mq_msgsize) ++ .field("mq_curmsgs", &self.mq_curmsgs) ++ .finish() ++ } ++ } ++ impl hash::Hash for mq_attr { ++ fn hash(&self, state: &mut H) { ++ self.mq_flags.hash(state); ++ self.mq_maxmsg.hash(state); ++ self.mq_msgsize.hash(state); ++ self.mq_curmsgs.hash(state); ++ } ++ } ++ ++ impl PartialEq for pthread_cond_t { ++ fn eq(&self, other: &pthread_cond_t) -> bool { ++ self.size.iter().zip(other.size.iter()).all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for pthread_cond_t {} ++ impl fmt::Debug for pthread_cond_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("pthread_cond_t") ++ // FIXME: .field("size", &self.size) ++ .finish() ++ } ++ } ++ impl hash::Hash for pthread_cond_t { ++ fn hash(&self, state: &mut H) { ++ self.size.hash(state); ++ } ++ } ++ } ++} ++ ++pub const MADV_SOFT_OFFLINE: c_int = 101; ++pub const MS_NOUSER: c_ulong = 0x80000000; ++pub const MS_RMT_MASK: c_ulong = 0x02800051; ++ ++pub const ABDAY_1: crate::nl_item = 0x20000; ++pub const ABDAY_2: crate::nl_item = 0x20001; ++pub const ABDAY_3: crate::nl_item = 0x20002; ++pub const ABDAY_4: crate::nl_item = 0x20003; ++pub const ABDAY_5: crate::nl_item = 0x20004; ++pub const ABDAY_6: crate::nl_item = 0x20005; ++pub const ABDAY_7: crate::nl_item = 0x20006; ++ ++pub const DAY_1: crate::nl_item = 0x20007; ++pub const DAY_2: crate::nl_item = 0x20008; ++pub const DAY_3: crate::nl_item = 0x20009; ++pub const DAY_4: crate::nl_item = 0x2000A; ++pub const DAY_5: crate::nl_item = 0x2000B; ++pub const DAY_6: crate::nl_item = 0x2000C; ++pub const DAY_7: crate::nl_item = 0x2000D; ++ ++pub const ABMON_1: crate::nl_item = 0x2000E; ++pub const ABMON_2: crate::nl_item = 0x2000F; ++pub const ABMON_3: crate::nl_item = 0x20010; ++pub const ABMON_4: crate::nl_item = 0x20011; ++pub const ABMON_5: crate::nl_item = 0x20012; ++pub const ABMON_6: crate::nl_item = 0x20013; ++pub const ABMON_7: crate::nl_item = 0x20014; ++pub const ABMON_8: crate::nl_item = 0x20015; ++pub const ABMON_9: crate::nl_item = 0x20016; ++pub const ABMON_10: crate::nl_item = 0x20017; ++pub const ABMON_11: crate::nl_item = 0x20018; ++pub const ABMON_12: crate::nl_item = 0x20019; ++ ++pub const MON_1: crate::nl_item = 0x2001A; ++pub const MON_2: crate::nl_item = 0x2001B; ++pub const MON_3: crate::nl_item = 0x2001C; ++pub const MON_4: crate::nl_item = 0x2001D; ++pub const MON_5: crate::nl_item = 0x2001E; ++pub const MON_6: crate::nl_item = 0x2001F; ++pub const MON_7: crate::nl_item = 0x20020; ++pub const MON_8: crate::nl_item = 0x20021; ++pub const MON_9: crate::nl_item = 0x20022; ++pub const MON_10: crate::nl_item = 0x20023; ++pub const MON_11: crate::nl_item = 0x20024; ++pub const MON_12: crate::nl_item = 0x20025; ++ ++pub const AM_STR: crate::nl_item = 0x20026; ++pub const PM_STR: crate::nl_item = 0x20027; ++ ++pub const D_T_FMT: crate::nl_item = 0x20028; ++pub const D_FMT: crate::nl_item = 0x20029; ++pub const T_FMT: crate::nl_item = 0x2002A; ++pub const T_FMT_AMPM: crate::nl_item = 0x2002B; ++ ++pub const ERA: crate::nl_item = 0x2002C; ++pub const ERA_D_FMT: crate::nl_item = 0x2002E; ++pub const ALT_DIGITS: crate::nl_item = 0x2002F; ++pub const ERA_D_T_FMT: crate::nl_item = 0x20030; ++pub const ERA_T_FMT: crate::nl_item = 0x20031; ++ ++pub const CODESET: crate::nl_item = 14; ++ ++pub const CRNCYSTR: crate::nl_item = 0x4000F; ++ ++pub const RUSAGE_THREAD: c_int = 1; ++pub const RUSAGE_CHILDREN: c_int = -1; ++ ++pub const RADIXCHAR: crate::nl_item = 0x10000; ++pub const THOUSEP: crate::nl_item = 0x10001; ++ ++pub const YESEXPR: crate::nl_item = 0x50000; ++pub const NOEXPR: crate::nl_item = 0x50001; ++pub const YESSTR: crate::nl_item = 0x50002; ++pub const NOSTR: crate::nl_item = 0x50003; ++ ++pub const FILENAME_MAX: c_uint = 4096; ++pub const L_tmpnam: c_uint = 20; ++pub const _PC_LINK_MAX: c_int = 0; ++pub const _PC_MAX_CANON: c_int = 1; ++pub const _PC_MAX_INPUT: c_int = 2; ++pub const _PC_NAME_MAX: c_int = 3; ++pub const _PC_PATH_MAX: c_int = 4; ++pub const _PC_PIPE_BUF: c_int = 5; ++pub const _PC_CHOWN_RESTRICTED: c_int = 6; ++pub const _PC_NO_TRUNC: c_int = 7; ++pub const _PC_VDISABLE: c_int = 8; ++pub const _PC_SYNC_IO: c_int = 9; ++pub const _PC_ASYNC_IO: c_int = 10; ++pub const _PC_PRIO_IO: c_int = 11; ++pub const _PC_SOCK_MAXBUF: c_int = 12; ++pub const _PC_FILESIZEBITS: c_int = 13; ++pub const _PC_REC_INCR_XFER_SIZE: c_int = 14; ++pub const _PC_REC_MAX_XFER_SIZE: c_int = 15; ++pub const _PC_REC_MIN_XFER_SIZE: c_int = 16; ++pub const _PC_REC_XFER_ALIGN: c_int = 17; ++pub const _PC_ALLOC_SIZE_MIN: c_int = 18; ++pub const _PC_SYMLINK_MAX: c_int = 19; ++pub const _PC_2_SYMLINKS: c_int = 20; ++ ++pub const _SC_ARG_MAX: c_int = 0; ++pub const _SC_CHILD_MAX: c_int = 1; ++pub const _SC_CLK_TCK: c_int = 2; ++pub const _SC_NGROUPS_MAX: c_int = 3; ++pub const _SC_OPEN_MAX: c_int = 4; ++pub const _SC_STREAM_MAX: c_int = 5; ++pub const _SC_TZNAME_MAX: c_int = 6; ++pub const _SC_JOB_CONTROL: c_int = 7; ++pub const _SC_SAVED_IDS: c_int = 8; ++pub const _SC_REALTIME_SIGNALS: c_int = 9; ++pub const _SC_PRIORITY_SCHEDULING: c_int = 10; ++pub const _SC_TIMERS: c_int = 11; ++pub const _SC_ASYNCHRONOUS_IO: c_int = 12; ++pub const _SC_PRIORITIZED_IO: c_int = 13; ++pub const _SC_SYNCHRONIZED_IO: c_int = 14; ++pub const _SC_FSYNC: c_int = 15; ++pub const _SC_MAPPED_FILES: c_int = 16; ++pub const _SC_MEMLOCK: c_int = 17; ++pub const _SC_MEMLOCK_RANGE: c_int = 18; ++pub const _SC_MEMORY_PROTECTION: c_int = 19; ++pub const _SC_MESSAGE_PASSING: c_int = 20; ++pub const _SC_SEMAPHORES: c_int = 21; ++pub const _SC_SHARED_MEMORY_OBJECTS: c_int = 22; ++pub const _SC_AIO_LISTIO_MAX: c_int = 23; ++pub const _SC_AIO_MAX: c_int = 24; ++pub const _SC_AIO_PRIO_DELTA_MAX: c_int = 25; ++pub const _SC_DELAYTIMER_MAX: c_int = 26; ++pub const _SC_MQ_OPEN_MAX: c_int = 27; ++pub const _SC_MQ_PRIO_MAX: c_int = 28; ++pub const _SC_VERSION: c_int = 29; ++pub const _SC_PAGESIZE: c_int = 30; ++pub const _SC_PAGE_SIZE: c_int = _SC_PAGESIZE; ++pub const _SC_RTSIG_MAX: c_int = 31; ++pub const _SC_SEM_NSEMS_MAX: c_int = 32; ++pub const _SC_SEM_VALUE_MAX: c_int = 33; ++pub const _SC_SIGQUEUE_MAX: c_int = 34; ++pub const _SC_TIMER_MAX: c_int = 35; ++pub const _SC_BC_BASE_MAX: c_int = 36; ++pub const _SC_BC_DIM_MAX: c_int = 37; ++pub const _SC_BC_SCALE_MAX: c_int = 38; ++pub const _SC_BC_STRING_MAX: c_int = 39; ++pub const _SC_COLL_WEIGHTS_MAX: c_int = 40; ++pub const _SC_EXPR_NEST_MAX: c_int = 42; ++pub const _SC_LINE_MAX: c_int = 43; ++pub const _SC_RE_DUP_MAX: c_int = 44; ++pub const _SC_2_VERSION: c_int = 46; ++pub const _SC_2_C_BIND: c_int = 47; ++pub const _SC_2_C_DEV: c_int = 48; ++pub const _SC_2_FORT_DEV: c_int = 49; ++pub const _SC_2_FORT_RUN: c_int = 50; ++pub const _SC_2_SW_DEV: c_int = 51; ++pub const _SC_2_LOCALEDEF: c_int = 52; ++pub const _SC_UIO_MAXIOV: c_int = 60; ++pub const _SC_IOV_MAX: c_int = 60; ++pub const _SC_THREADS: c_int = 67; ++pub const _SC_THREAD_SAFE_FUNCTIONS: c_int = 68; ++pub const _SC_GETGR_R_SIZE_MAX: c_int = 69; ++pub const _SC_GETPW_R_SIZE_MAX: c_int = 70; ++pub const _SC_LOGIN_NAME_MAX: c_int = 71; ++pub const _SC_TTY_NAME_MAX: c_int = 72; ++pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: c_int = 73; ++pub const _SC_THREAD_KEYS_MAX: c_int = 74; ++pub const _SC_THREAD_STACK_MIN: c_int = 75; ++pub const _SC_THREAD_THREADS_MAX: c_int = 76; ++pub const _SC_THREAD_ATTR_STACKADDR: c_int = 77; ++pub const _SC_THREAD_ATTR_STACKSIZE: c_int = 78; ++pub const _SC_THREAD_PRIORITY_SCHEDULING: c_int = 79; ++pub const _SC_THREAD_PRIO_INHERIT: c_int = 80; ++pub const _SC_THREAD_PRIO_PROTECT: c_int = 81; ++pub const _SC_THREAD_PROCESS_SHARED: c_int = 82; ++pub const _SC_NPROCESSORS_CONF: c_int = 83; ++pub const _SC_NPROCESSORS_ONLN: c_int = 84; ++pub const _SC_PHYS_PAGES: c_int = 85; ++pub const _SC_AVPHYS_PAGES: c_int = 86; ++pub const _SC_ATEXIT_MAX: c_int = 87; ++pub const _SC_PASS_MAX: c_int = 88; ++pub const _SC_XOPEN_VERSION: c_int = 89; ++pub const _SC_XOPEN_XCU_VERSION: c_int = 90; ++pub const _SC_XOPEN_UNIX: c_int = 91; ++pub const _SC_XOPEN_CRYPT: c_int = 92; ++pub const _SC_XOPEN_ENH_I18N: c_int = 93; ++pub const _SC_XOPEN_SHM: c_int = 94; ++pub const _SC_2_CHAR_TERM: c_int = 95; ++pub const _SC_2_UPE: c_int = 97; ++pub const _SC_XOPEN_XPG2: c_int = 98; ++pub const _SC_XOPEN_XPG3: c_int = 99; ++pub const _SC_XOPEN_XPG4: c_int = 100; ++pub const _SC_NZERO: c_int = 109; ++pub const _SC_XBS5_ILP32_OFF32: c_int = 125; ++pub const _SC_XBS5_ILP32_OFFBIG: c_int = 126; ++pub const _SC_XBS5_LP64_OFF64: c_int = 127; ++pub const _SC_XBS5_LPBIG_OFFBIG: c_int = 128; ++pub const _SC_XOPEN_LEGACY: c_int = 129; ++pub const _SC_XOPEN_REALTIME: c_int = 130; ++pub const _SC_XOPEN_REALTIME_THREADS: c_int = 131; ++pub const _SC_ADVISORY_INFO: c_int = 132; ++pub const _SC_BARRIERS: c_int = 133; ++pub const _SC_CLOCK_SELECTION: c_int = 137; ++pub const _SC_CPUTIME: c_int = 138; ++pub const _SC_THREAD_CPUTIME: c_int = 139; ++pub const _SC_MONOTONIC_CLOCK: c_int = 149; ++pub const _SC_READER_WRITER_LOCKS: c_int = 153; ++pub const _SC_SPIN_LOCKS: c_int = 154; ++pub const _SC_REGEXP: c_int = 155; ++pub const _SC_SHELL: c_int = 157; ++pub const _SC_SPAWN: c_int = 159; ++pub const _SC_SPORADIC_SERVER: c_int = 160; ++pub const _SC_THREAD_SPORADIC_SERVER: c_int = 161; ++pub const _SC_TIMEOUTS: c_int = 164; ++pub const _SC_TYPED_MEMORY_OBJECTS: c_int = 165; ++pub const _SC_2_PBS: c_int = 168; ++pub const _SC_2_PBS_ACCOUNTING: c_int = 169; ++pub const _SC_2_PBS_LOCATE: c_int = 170; ++pub const _SC_2_PBS_MESSAGE: c_int = 171; ++pub const _SC_2_PBS_TRACK: c_int = 172; ++pub const _SC_SYMLOOP_MAX: c_int = 173; ++pub const _SC_STREAMS: c_int = 174; ++pub const _SC_2_PBS_CHECKPOINT: c_int = 175; ++pub const _SC_V6_ILP32_OFF32: c_int = 176; ++pub const _SC_V6_ILP32_OFFBIG: c_int = 177; ++pub const _SC_V6_LP64_OFF64: c_int = 178; ++pub const _SC_V6_LPBIG_OFFBIG: c_int = 179; ++pub const _SC_HOST_NAME_MAX: c_int = 180; ++pub const _SC_TRACE: c_int = 181; ++pub const _SC_TRACE_EVENT_FILTER: c_int = 182; ++pub const _SC_TRACE_INHERIT: c_int = 183; ++pub const _SC_TRACE_LOG: c_int = 184; ++pub const _SC_IPV6: c_int = 235; ++pub const _SC_RAW_SOCKETS: c_int = 236; ++pub const _SC_V7_ILP32_OFF32: c_int = 237; ++pub const _SC_V7_ILP32_OFFBIG: c_int = 238; ++pub const _SC_V7_LP64_OFF64: c_int = 239; ++pub const _SC_V7_LPBIG_OFFBIG: c_int = 240; ++pub const _SC_SS_REPL_MAX: c_int = 241; ++pub const _SC_TRACE_EVENT_NAME_MAX: c_int = 242; ++pub const _SC_TRACE_NAME_MAX: c_int = 243; ++pub const _SC_TRACE_SYS_MAX: c_int = 244; ++pub const _SC_TRACE_USER_EVENT_MAX: c_int = 245; ++pub const _SC_XOPEN_STREAMS: c_int = 246; ++pub const _SC_THREAD_ROBUST_PRIO_INHERIT: c_int = 247; ++pub const _SC_THREAD_ROBUST_PRIO_PROTECT: c_int = 248; ++ ++pub const RLIM_SAVED_MAX: crate::rlim_t = RLIM_INFINITY; ++pub const RLIM_SAVED_CUR: crate::rlim_t = RLIM_INFINITY; ++ ++pub const GLOB_ERR: c_int = 1 << 0; ++pub const GLOB_MARK: c_int = 1 << 1; ++pub const GLOB_NOSORT: c_int = 1 << 2; ++pub const GLOB_DOOFFS: c_int = 1 << 3; ++pub const GLOB_NOCHECK: c_int = 1 << 4; ++pub const GLOB_APPEND: c_int = 1 << 5; ++pub const GLOB_NOESCAPE: c_int = 1 << 6; ++ ++pub const GLOB_NOSPACE: c_int = 1; ++pub const GLOB_ABORTED: c_int = 2; ++pub const GLOB_NOMATCH: c_int = 3; ++ ++pub const POSIX_MADV_NORMAL: c_int = 0; ++pub const POSIX_MADV_RANDOM: c_int = 1; ++pub const POSIX_MADV_SEQUENTIAL: c_int = 2; ++pub const POSIX_MADV_WILLNEED: c_int = 3; ++ ++pub const AT_EACCESS: c_int = 0x200; ++ ++pub const S_IEXEC: mode_t = 0o0100; ++pub const S_IWRITE: mode_t = 0o0200; ++pub const S_IREAD: mode_t = 0o0400; ++ ++pub const F_LOCK: c_int = 1; ++pub const F_TEST: c_int = 3; ++pub const F_TLOCK: c_int = 2; ++pub const F_ULOCK: c_int = 0; ++ ++pub const ST_RDONLY: c_ulong = 1; ++pub const ST_NOSUID: c_ulong = 2; ++pub const ST_NODEV: c_ulong = 4; ++pub const ST_NOEXEC: c_ulong = 8; ++pub const ST_SYNCHRONOUS: c_ulong = 16; ++pub const ST_MANDLOCK: c_ulong = 64; ++pub const ST_WRITE: c_ulong = 128; ++pub const ST_APPEND: c_ulong = 256; ++pub const ST_IMMUTABLE: c_ulong = 512; ++pub const ST_NOATIME: c_ulong = 1024; ++pub const ST_NODIRATIME: c_ulong = 2048; ++ ++pub const RTLD_NEXT: *mut c_void = -1i64 as *mut c_void; ++pub const RTLD_DEFAULT: *mut c_void = 0i64 as *mut c_void; ++pub const RTLD_NODELETE: c_int = 0x1000; ++pub const RTLD_NOW: c_int = 0x2; ++ ++pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { ++ size: [0; __SIZEOF_PTHREAD_MUTEX_T], ++}; ++pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { ++ size: [0; __SIZEOF_PTHREAD_COND_T], ++}; ++pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { ++ size: [0; __SIZEOF_PTHREAD_RWLOCK_T], ++}; ++ ++pub const PTHREAD_MUTEX_NORMAL: c_int = 0; ++pub const PTHREAD_MUTEX_RECURSIVE: c_int = 1; ++pub const PTHREAD_MUTEX_ERRORCHECK: c_int = 2; ++pub const PTHREAD_MUTEX_DEFAULT: c_int = PTHREAD_MUTEX_NORMAL; ++pub const PTHREAD_PROCESS_PRIVATE: c_int = 0; ++pub const PTHREAD_PROCESS_SHARED: c_int = 1; ++pub const __SIZEOF_PTHREAD_COND_T: usize = 48; ++ ++pub const SCHED_OTHER: c_int = 0; ++pub const SCHED_FIFO: c_int = 1; ++pub const SCHED_RR: c_int = 2; ++pub const SCHED_BATCH: c_int = 3; ++pub const SCHED_IDLE: c_int = 5; ++ ++pub const AF_IB: c_int = 27; ++pub const AF_MPLS: c_int = 28; ++pub const AF_NFC: c_int = 39; ++pub const AF_VSOCK: c_int = 40; ++pub const PF_IB: c_int = AF_IB; ++pub const PF_MPLS: c_int = AF_MPLS; ++pub const PF_NFC: c_int = AF_NFC; ++pub const PF_VSOCK: c_int = AF_VSOCK; ++ ++// System V IPC ++pub const IPC_PRIVATE: crate::key_t = 0; ++ ++pub const IPC_CREAT: c_int = 0o1000; ++pub const IPC_EXCL: c_int = 0o2000; ++pub const IPC_NOWAIT: c_int = 0o4000; ++ ++pub const IPC_RMID: c_int = 0; ++pub const IPC_SET: c_int = 1; ++pub const IPC_STAT: c_int = 2; ++pub const IPC_INFO: c_int = 3; ++pub const MSG_STAT: c_int = 11; ++pub const MSG_INFO: c_int = 12; ++ ++pub const MSG_NOERROR: c_int = 0o10000; ++pub const MSG_EXCEPT: c_int = 0o20000; ++ ++pub const SHM_R: c_int = 0o400; ++pub const SHM_W: c_int = 0o200; ++ ++pub const SHM_RDONLY: c_int = 0o10000; ++pub const SHM_RND: c_int = 0o20000; ++pub const SHM_REMAP: c_int = 0o40000; ++pub const SHM_EXEC: c_int = 0o100000; ++ ++pub const SHM_LOCK: c_int = 11; ++pub const SHM_UNLOCK: c_int = 12; ++ ++pub const SHM_HUGETLB: c_int = 0o4000; ++pub const SHM_NORESERVE: c_int = 0o10000; ++ ++pub const LOG_NFACILITIES: c_int = 24; ++ ++pub const SEM_FAILED: *mut crate::sem_t = 0 as *mut sem_t; ++ ++pub const AI_PASSIVE: c_int = 0x0001; ++pub const AI_CANONNAME: c_int = 0x0002; ++pub const AI_NUMERICHOST: c_int = 0x0004; ++pub const AI_V4MAPPED: c_int = 0x0008; ++pub const AI_ALL: c_int = 0x0010; ++pub const AI_ADDRCONFIG: c_int = 0x0020; ++ ++pub const AI_NUMERICSERV: c_int = 0x0400; ++ ++pub const EAI_BADFLAGS: c_int = -1; ++pub const EAI_NONAME: c_int = -2; ++pub const EAI_AGAIN: c_int = -3; ++pub const EAI_FAIL: c_int = -4; ++pub const EAI_FAMILY: c_int = -6; ++pub const EAI_SOCKTYPE: c_int = -7; ++pub const EAI_SERVICE: c_int = -8; ++pub const EAI_MEMORY: c_int = -10; ++pub const EAI_OVERFLOW: c_int = -12; ++ ++pub const NI_NUMERICHOST: c_int = 1; ++pub const NI_NUMERICSERV: c_int = 2; ++pub const NI_NOFQDN: c_int = 4; ++pub const NI_NAMEREQD: c_int = 8; ++pub const NI_DGRAM: c_int = 16; ++ ++pub const SYNC_FILE_RANGE_WAIT_BEFORE: c_uint = 1; ++pub const SYNC_FILE_RANGE_WRITE: c_uint = 2; ++pub const SYNC_FILE_RANGE_WAIT_AFTER: c_uint = 4; ++ ++pub const EAI_SYSTEM: c_int = -11; ++ ++pub const MREMAP_MAYMOVE: c_int = 1; ++pub const MREMAP_FIXED: c_int = 2; ++ ++pub const ITIMER_REAL: c_int = 0; ++pub const ITIMER_VIRTUAL: c_int = 1; ++pub const ITIMER_PROF: c_int = 2; ++ ++pub const _POSIX_VDISABLE: crate::cc_t = 0; ++ ++pub const FALLOC_FL_KEEP_SIZE: c_int = 0x01; ++pub const FALLOC_FL_PUNCH_HOLE: c_int = 0x02; ++ ++pub const NCCS: usize = 32; ++ ++pub const O_TRUNC: c_int = 512; ++pub const O_NOATIME: c_int = 0o1000000; ++pub const O_CLOEXEC: c_int = 0x80000; ++ ++// Defined as wasi value. ++pub const EPERM: c_int = 63; ++pub const ENOENT: c_int = 44; ++pub const ESRCH: c_int = 71; ++pub const EINTR: c_int = 27; ++pub const EIO: c_int = 29; ++pub const ENXIO: c_int = 60; ++pub const E2BIG: c_int = 1; ++pub const ENOEXEC: c_int = 45; ++pub const EBADF: c_int = 8; ++pub const ECHILD: c_int = 12; ++pub const EAGAIN: c_int = 6; ++pub const ENOMEM: c_int = 48; ++pub const EACCES: c_int = 2; ++pub const EFAULT: c_int = 21; ++pub const ENOTBLK: c_int = 105; ++pub const EBUSY: c_int = 10; ++pub const EEXIST: c_int = 20; ++pub const EXDEV: c_int = 75; ++pub const ENODEV: c_int = 43; ++pub const ENOTDIR: c_int = 54; ++pub const EISDIR: c_int = 31; ++pub const EINVAL: c_int = 28; ++pub const ENFILE: c_int = 41; ++pub const EMFILE: c_int = 33; ++pub const ENOTTY: c_int = 59; ++pub const ETXTBSY: c_int = 74; ++pub const EFBIG: c_int = 22; ++pub const ENOSPC: c_int = 51; ++pub const ESPIPE: c_int = 70; ++pub const EROFS: c_int = 69; ++pub const EMLINK: c_int = 34; ++pub const EPIPE: c_int = 64; ++pub const EDOM: c_int = 18; ++pub const ERANGE: c_int = 68; ++pub const EWOULDBLOCK: c_int = EAGAIN; ++pub const ENOLINK: c_int = 47; ++pub const EPROTO: c_int = 65; ++pub const EDEADLK: c_int = 16; ++pub const EDEADLOCK: c_int = EDEADLK; ++pub const ENAMETOOLONG: c_int = 37; ++pub const ENOLCK: c_int = 46; ++pub const ENOSYS: c_int = 52; ++pub const ENOTEMPTY: c_int = 55; ++pub const ELOOP: c_int = 32; ++pub const ENOMSG: c_int = 49; ++pub const EIDRM: c_int = 24; ++pub const EMULTIHOP: c_int = 36; ++pub const EBADMSG: c_int = 9; ++pub const EOVERFLOW: c_int = 61; ++pub const EILSEQ: c_int = 25; ++pub const ENOTSOCK: c_int = 57; ++pub const EDESTADDRREQ: c_int = 17; ++pub const EMSGSIZE: c_int = 35; ++pub const EPROTOTYPE: c_int = 67; ++pub const ENOPROTOOPT: c_int = 50; ++pub const EPROTONOSUPPORT: c_int = 66; ++pub const EAFNOSUPPORT: c_int = 5; ++pub const EADDRINUSE: c_int = 3; ++pub const EADDRNOTAVAIL: c_int = 4; ++pub const ENETDOWN: c_int = 38; ++pub const ENETUNREACH: c_int = 40; ++pub const ENETRESET: c_int = 39; ++pub const ECONNABORTED: c_int = 13; ++pub const ECONNRESET: c_int = 15; ++pub const ENOBUFS: c_int = 42; ++pub const EISCONN: c_int = 30; ++pub const ENOTCONN: c_int = 53; ++pub const ETIMEDOUT: c_int = 73; ++pub const ECONNREFUSED: c_int = 14; ++pub const EHOSTUNREACH: c_int = 23; ++pub const EALREADY: c_int = 7; ++pub const EINPROGRESS: c_int = 26; ++pub const ESTALE: c_int = 72; ++pub const EDQUOT: c_int = 19; ++pub const ECANCELED: c_int = 11; ++pub const EOWNERDEAD: c_int = 62; ++pub const ENOTRECOVERABLE: c_int = 56; ++ ++pub const ENOSTR: c_int = 100; ++pub const EBFONT: c_int = 101; ++pub const EBADSLT: c_int = 102; ++pub const EBADRQC: c_int = 103; ++pub const ENOANO: c_int = 104; ++pub const ECHRNG: c_int = 106; ++pub const EL3HLT: c_int = 107; ++pub const EL3RST: c_int = 108; ++pub const ELNRNG: c_int = 109; ++pub const EUNATCH: c_int = 110; ++pub const ENOCSI: c_int = 111; ++pub const EL2HLT: c_int = 112; ++pub const EBADE: c_int = 113; ++pub const EBADR: c_int = 114; ++pub const EXFULL: c_int = 115; ++pub const ENODATA: c_int = 116; ++pub const ETIME: c_int = 117; ++pub const ENOSR: c_int = 118; ++pub const ENONET: c_int = 119; ++pub const ENOPKG: c_int = 120; ++pub const EREMOTE: c_int = 121; ++pub const EADV: c_int = 122; ++pub const ESRMNT: c_int = 123; ++pub const ECOMM: c_int = 124; ++pub const EDOTDOT: c_int = 125; ++pub const ENOTUNIQ: c_int = 126; ++pub const EBADFD: c_int = 127; ++pub const EREMCHG: c_int = 128; ++pub const ELIBACC: c_int = 129; ++pub const ELIBBAD: c_int = 130; ++pub const ELIBSCN: c_int = 131; ++pub const ELIBMAX: c_int = 132; ++pub const ELIBEXEC: c_int = 133; ++pub const ERESTART: c_int = 134; ++pub const ESTRPIPE: c_int = 135; ++pub const EUSERS: c_int = 136; ++pub const ESOCKTNOSUPPORT: c_int = 137; ++pub const EOPNOTSUPP: c_int = 138; ++pub const ENOTSUP: c_int = EOPNOTSUPP; ++pub const EPFNOSUPPORT: c_int = 139; ++pub const ESHUTDOWN: c_int = 140; ++pub const ETOOMANYREFS: c_int = 141; ++pub const EHOSTDOWN: c_int = 142; ++pub const EUCLEAN: c_int = 143; ++pub const ENOTNAM: c_int = 144; ++pub const ENAVAIL: c_int = 145; ++pub const EISNAM: c_int = 146; ++pub const EREMOTEIO: c_int = 147; ++pub const ENOMEDIUM: c_int = 148; ++pub const EMEDIUMTYPE: c_int = 149; ++pub const ENOKEY: c_int = 150; ++pub const EKEYEXPIRED: c_int = 151; ++pub const EKEYREVOKED: c_int = 152; ++pub const EKEYREJECTED: c_int = 153; ++pub const ERFKILL: c_int = 154; ++pub const EHWPOISON: c_int = 155; ++pub const EL2NSYNC: c_int = 156; ++ ++pub const SA_NODEFER: c_int = 0x40000000; ++pub const SA_RESETHAND: c_int = 0x80000000; ++pub const SA_RESTART: c_int = 0x10000000; ++pub const SA_NOCLDSTOP: c_int = 0x00000001; ++ ++pub const BUFSIZ: c_uint = 1024; ++pub const TMP_MAX: c_uint = 10000; ++pub const FOPEN_MAX: c_uint = 1000; ++pub const O_PATH: c_int = 0o10000000; ++pub const O_EXEC: c_int = 0o10000000; ++pub const O_SEARCH: c_int = 0o10000000; ++pub const O_ACCMODE: c_int = 0o10000003; ++pub const O_NDELAY: c_int = O_NONBLOCK; ++pub const NI_MAXHOST: crate::socklen_t = 255; ++pub const PTHREAD_STACK_MIN: size_t = 2048; ++pub const POSIX_FADV_DONTNEED: c_int = 4; ++pub const POSIX_FADV_NOREUSE: c_int = 5; ++ ++pub const POSIX_MADV_DONTNEED: c_int = 4; ++ ++pub const RLIM_INFINITY: crate::rlim_t = !0; ++#[deprecated(since = "0.2.64", note = "Not stable across OS versions")] ++pub const RLIMIT_NLIMITS: c_int = 16; ++#[allow(deprecated)] ++#[deprecated(since = "0.2.64", note = "Not stable across OS versions")] ++pub const RLIM_NLIMITS: c_int = RLIMIT_NLIMITS; ++ ++pub const MAP_ANONYMOUS: c_int = MAP_ANON; ++ ++#[doc(hidden)] ++#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")] ++pub const SIGUNUSED: c_int = crate::SIGSYS; ++ ++pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; ++pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; ++pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8; ++ ++pub const CPU_SETSIZE: c_int = 1024; ++ ++pub const TCSANOW: c_int = 0; ++pub const TCSADRAIN: c_int = 1; ++pub const TCSAFLUSH: c_int = 2; ++ ++pub const TIOCINQ: c_int = crate::FIONREAD; ++ ++pub const RTLD_GLOBAL: c_int = 0x100; ++pub const RTLD_NOLOAD: c_int = 0x4; ++ ++pub const CLOCK_SGI_CYCLE: crate::clockid_t = 10; ++ ++pub const MCL_CURRENT: c_int = 0x0001; ++pub const MCL_FUTURE: c_int = 0x0002; ++ ++pub const SIGSTKSZ: size_t = 8192; ++pub const MINSIGSTKSZ: size_t = 2048; ++pub const CBAUD: crate::tcflag_t = 0o0010017; ++pub const TAB1: c_int = 0x00000800; ++pub const TAB2: c_int = 0x00001000; ++pub const TAB3: c_int = 0x00001800; ++pub const CR1: c_int = 0x00000200; ++pub const CR2: c_int = 0x00000400; ++pub const CR3: c_int = 0x00000600; ++pub const FF1: c_int = 0x00008000; ++pub const BS1: c_int = 0x00002000; ++pub const VT1: c_int = 0x00004000; ++pub const VWERASE: usize = 14; ++pub const VREPRINT: usize = 12; ++pub const VSUSP: usize = 10; ++pub const VSTART: usize = 8; ++pub const VSTOP: usize = 9; ++pub const VDISCARD: usize = 13; ++pub const VTIME: usize = 5; ++pub const IXON: crate::tcflag_t = 0x00000400; ++pub const IXOFF: crate::tcflag_t = 0x00001000; ++pub const ONLCR: crate::tcflag_t = 0x4; ++pub const CSIZE: crate::tcflag_t = 0x00000030; ++pub const CS6: crate::tcflag_t = 0x00000010; ++pub const CS7: crate::tcflag_t = 0x00000020; ++pub const CS8: crate::tcflag_t = 0x00000030; ++pub const CSTOPB: crate::tcflag_t = 0x00000040; ++pub const CREAD: crate::tcflag_t = 0x00000080; ++pub const PARENB: crate::tcflag_t = 0x00000100; ++pub const PARODD: crate::tcflag_t = 0x00000200; ++pub const HUPCL: crate::tcflag_t = 0x00000400; ++pub const CLOCAL: crate::tcflag_t = 0x00000800; ++pub const ECHOKE: crate::tcflag_t = 0x00000800; ++pub const ECHOE: crate::tcflag_t = 0x00000010; ++pub const ECHOK: crate::tcflag_t = 0x00000020; ++pub const ECHONL: crate::tcflag_t = 0x00000040; ++pub const ECHOPRT: crate::tcflag_t = 0x00000400; ++pub const ECHOCTL: crate::tcflag_t = 0x00000200; ++pub const ISIG: crate::tcflag_t = 0x00000001; ++pub const ICANON: crate::tcflag_t = 0x00000002; ++pub const PENDIN: crate::tcflag_t = 0x00004000; ++pub const NOFLSH: crate::tcflag_t = 0x00000080; ++pub const CBAUDEX: crate::tcflag_t = 0o010000; ++pub const VSWTC: usize = 7; ++pub const OLCUC: crate::tcflag_t = 0o000002; ++pub const NLDLY: crate::tcflag_t = 0o000400; ++pub const CRDLY: crate::tcflag_t = 0o003000; ++pub const TABDLY: crate::tcflag_t = 0o014000; ++pub const BSDLY: crate::tcflag_t = 0o020000; ++pub const FFDLY: crate::tcflag_t = 0o100000; ++pub const VTDLY: crate::tcflag_t = 0o040000; ++pub const XTABS: crate::tcflag_t = 0o014000; ++ ++pub const B0: crate::speed_t = 0o000000; ++pub const B50: crate::speed_t = 0o000001; ++pub const B75: crate::speed_t = 0o000002; ++pub const B110: crate::speed_t = 0o000003; ++pub const B134: crate::speed_t = 0o000004; ++pub const B150: crate::speed_t = 0o000005; ++pub const B200: crate::speed_t = 0o000006; ++pub const B300: crate::speed_t = 0o000007; ++pub const B600: crate::speed_t = 0o000010; ++pub const B1200: crate::speed_t = 0o000011; ++pub const B1800: crate::speed_t = 0o000012; ++pub const B2400: crate::speed_t = 0o000013; ++pub const B4800: crate::speed_t = 0o000014; ++pub const B9600: crate::speed_t = 0o000015; ++pub const B19200: crate::speed_t = 0o000016; ++pub const B38400: crate::speed_t = 0o000017; ++pub const B57600: crate::speed_t = 0o010001; ++pub const B115200: crate::speed_t = 0o010002; ++pub const B230400: crate::speed_t = 0o010003; ++pub const B460800: crate::speed_t = 0o010004; ++pub const B500000: crate::speed_t = 0o010005; ++pub const B576000: crate::speed_t = 0o010006; ++pub const B921600: crate::speed_t = 0o010007; ++pub const B1000000: crate::speed_t = 0o010010; ++pub const B1152000: crate::speed_t = 0o010011; ++pub const B1500000: crate::speed_t = 0o010012; ++pub const B2000000: crate::speed_t = 0o010013; ++pub const B2500000: crate::speed_t = 0o010014; ++pub const B3000000: crate::speed_t = 0o010015; ++pub const B3500000: crate::speed_t = 0o010016; ++pub const B4000000: crate::speed_t = 0o010017; ++ ++pub const SO_BINDTODEVICE: c_int = 25; ++pub const SO_TIMESTAMP: c_int = 63; ++pub const SO_MARK: c_int = 36; ++pub const SO_RXQ_OVFL: c_int = 40; ++pub const SO_PEEK_OFF: c_int = 42; ++pub const SO_BUSY_POLL: c_int = 46; ++ ++pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 32; ++pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 24; ++ ++pub const O_DIRECT: c_int = 0x4000; ++pub const O_DIRECTORY: c_int = 0x10000; ++pub const O_NOFOLLOW: c_int = 0x20000; ++pub const O_ASYNC: c_int = 0x2000; ++ ++pub const FIOCLEX: c_int = 0x5451; ++pub const FIONBIO: c_int = 0x5421; ++ ++pub const RLIMIT_RSS: c_int = 5; ++pub const RLIMIT_NOFILE: c_int = 7; ++pub const RLIMIT_AS: c_int = 9; ++pub const RLIMIT_NPROC: c_int = 6; ++pub const RLIMIT_MEMLOCK: c_int = 8; ++pub const RLIMIT_CPU: c_int = 0; ++pub const RLIMIT_FSIZE: c_int = 1; ++pub const RLIMIT_DATA: c_int = 2; ++pub const RLIMIT_STACK: c_int = 3; ++pub const RLIMIT_CORE: c_int = 4; ++pub const RLIMIT_LOCKS: c_int = 10; ++pub const RLIMIT_SIGPENDING: c_int = 11; ++pub const RLIMIT_MSGQUEUE: c_int = 12; ++pub const RLIMIT_NICE: c_int = 13; ++pub const RLIMIT_RTPRIO: c_int = 14; ++ ++pub const O_APPEND: c_int = 1024; ++pub const O_CREAT: c_int = 64; ++pub const O_EXCL: c_int = 128; ++pub const O_NOCTTY: c_int = 256; ++pub const O_NONBLOCK: c_int = 2048; ++pub const O_SYNC: c_int = 1052672; ++pub const O_RSYNC: c_int = 1052672; ++pub const O_DSYNC: c_int = 4096; ++ ++pub const SOCK_NONBLOCK: c_int = 2048; ++ ++pub const MAP_ANON: c_int = 0x0020; ++pub const MAP_GROWSDOWN: c_int = 0x0100; ++pub const MAP_DENYWRITE: c_int = 0x0800; ++pub const MAP_EXECUTABLE: c_int = 0x01000; ++pub const MAP_LOCKED: c_int = 0x02000; ++pub const MAP_NORESERVE: c_int = 0x04000; ++pub const MAP_POPULATE: c_int = 0x08000; ++pub const MAP_NONBLOCK: c_int = 0x010000; ++pub const MAP_STACK: c_int = 0x020000; ++ ++pub const SOCK_STREAM: c_int = 1; ++pub const SOCK_DGRAM: c_int = 2; ++pub const SOCK_SEQPACKET: c_int = 5; ++ ++pub const IPPROTO_MAX: c_int = 263; ++ ++pub const SOL_SOCKET: c_int = 1; ++ ++pub const SO_REUSEADDR: c_int = 2; ++pub const SO_TYPE: c_int = 3; ++pub const SO_ERROR: c_int = 4; ++pub const SO_DONTROUTE: c_int = 5; ++pub const SO_BROADCAST: c_int = 6; ++pub const SO_SNDBUF: c_int = 7; ++pub const SO_RCVBUF: c_int = 8; ++pub const SO_KEEPALIVE: c_int = 9; ++pub const SO_OOBINLINE: c_int = 10; ++pub const SO_LINGER: c_int = 13; ++pub const SO_REUSEPORT: c_int = 15; ++pub const SO_RCVLOWAT: c_int = 18; ++pub const SO_SNDLOWAT: c_int = 19; ++pub const SO_RCVTIMEO: c_int = 66; ++pub const SO_SNDTIMEO: c_int = 67; ++pub const SO_ACCEPTCONN: c_int = 30; ++ ++pub const IPV6_RTHDR_LOOSE: c_int = 0; ++pub const IPV6_RTHDR_STRICT: c_int = 1; ++ ++pub const SA_ONSTACK: c_int = 0x08000000; ++pub const SA_SIGINFO: c_int = 0x00000004; ++pub const SA_NOCLDWAIT: c_int = 0x00000002; ++ ++pub const SIGCHLD: c_int = 17; ++pub const SIGBUS: c_int = 7; ++pub const SIGTTIN: c_int = 21; ++pub const SIGTTOU: c_int = 22; ++pub const SIGXCPU: c_int = 24; ++pub const SIGXFSZ: c_int = 25; ++pub const SIGVTALRM: c_int = 26; ++pub const SIGPROF: c_int = 27; ++pub const SIGWINCH: c_int = 28; ++pub const SIGUSR1: c_int = 10; ++pub const SIGUSR2: c_int = 12; ++pub const SIGCONT: c_int = 18; ++pub const SIGSTOP: c_int = 19; ++pub const SIGTSTP: c_int = 20; ++pub const SIGURG: c_int = 23; ++pub const SIGIO: c_int = 29; ++pub const SIGSYS: c_int = 31; ++pub const SIGSTKFLT: c_int = 16; ++pub const SIGPOLL: c_int = 29; ++pub const SIGPWR: c_int = 30; ++pub const SIG_SETMASK: c_int = 2; ++pub const SIG_BLOCK: c_int = 0x000000; ++pub const SIG_UNBLOCK: c_int = 0x01; ++ ++pub const EXTPROC: crate::tcflag_t = 0x00010000; ++ ++pub const MAP_HUGETLB: c_int = 0x040000; ++ ++pub const F_GETLK: c_int = 12; ++pub const F_GETOWN: c_int = 9; ++pub const F_SETLK: c_int = 13; ++pub const F_SETLKW: c_int = 14; ++pub const F_SETOWN: c_int = 8; ++pub const F_OFD_GETLK: c_int = 36; ++pub const F_OFD_SETLK: c_int = 37; ++pub const F_OFD_SETLKW: c_int = 38; ++ ++pub const VEOF: usize = 4; ++pub const VEOL: usize = 11; ++pub const VEOL2: usize = 16; ++pub const VMIN: usize = 6; ++pub const IEXTEN: crate::tcflag_t = 0x00008000; ++pub const TOSTOP: crate::tcflag_t = 0x00000100; ++pub const FLUSHO: crate::tcflag_t = 0x00001000; ++ ++pub const TCGETS: c_int = 0x5401; ++pub const TCSETS: c_int = 0x5402; ++pub const TCSETSW: c_int = 0x5403; ++pub const TCSETSF: c_int = 0x5404; ++pub const TCGETA: c_int = 0x5405; ++pub const TCSETA: c_int = 0x5406; ++pub const TCSETAW: c_int = 0x5407; ++pub const TCSETAF: c_int = 0x5408; ++pub const TCSBRK: c_int = 0x5409; ++pub const TCXONC: c_int = 0x540A; ++pub const TCFLSH: c_int = 0x540B; ++pub const TIOCGSOFTCAR: c_int = 0x5419; ++pub const TIOCSSOFTCAR: c_int = 0x541A; ++pub const TIOCLINUX: c_int = 0x541C; ++pub const TIOCGSERIAL: c_int = 0x541E; ++pub const TIOCEXCL: c_int = 0x540C; ++pub const TIOCNXCL: c_int = 0x540D; ++pub const TIOCSCTTY: c_int = 0x540E; ++pub const TIOCGPGRP: c_int = 0x540F; ++pub const TIOCSPGRP: c_int = 0x5410; ++pub const TIOCOUTQ: c_int = 0x5411; ++pub const TIOCSTI: c_int = 0x5412; ++pub const TIOCGWINSZ: c_int = 0x5413; ++pub const TIOCSWINSZ: c_int = 0x5414; ++pub const TIOCMGET: c_int = 0x5415; ++pub const TIOCMBIS: c_int = 0x5416; ++pub const TIOCMBIC: c_int = 0x5417; ++pub const TIOCMSET: c_int = 0x5418; ++pub const FIONREAD: c_int = 0x541B; ++pub const TIOCCONS: c_int = 0x541D; ++ ++pub const SYS_gettid: c_long = 224; // Valid for arm (32-bit) and x86 (32-bit) ++ ++pub const POLLWRNORM: c_short = 0x100; ++pub const POLLWRBAND: c_short = 0x200; ++ ++pub const TIOCM_LE: c_int = 0x001; ++pub const TIOCM_DTR: c_int = 0x002; ++pub const TIOCM_RTS: c_int = 0x004; ++pub const TIOCM_ST: c_int = 0x008; ++pub const TIOCM_SR: c_int = 0x010; ++pub const TIOCM_CTS: c_int = 0x020; ++pub const TIOCM_CAR: c_int = 0x040; ++pub const TIOCM_RNG: c_int = 0x080; ++pub const TIOCM_DSR: c_int = 0x100; ++pub const TIOCM_CD: c_int = TIOCM_CAR; ++pub const TIOCM_RI: c_int = TIOCM_RNG; ++pub const O_TMPFILE: c_int = 0x410000; ++ ++pub const MAX_ADDR_LEN: usize = 7; ++pub const ARPD_UPDATE: c_ushort = 0x01; ++pub const ARPD_LOOKUP: c_ushort = 0x02; ++pub const ARPD_FLUSH: c_ushort = 0x03; ++pub const ATF_MAGIC: c_int = 0x80; ++ ++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 { ++ if ((*cmsg).cmsg_len as usize) < mem::size_of::() { ++ return 0 as *mut cmsghdr; ++ }; ++ let next = (cmsg as usize + super::CMSG_ALIGN((*cmsg).cmsg_len as usize)) as *mut cmsghdr; ++ let max = (*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize; ++ if (next.offset(1)) as usize > max { ++ 0 as *mut cmsghdr ++ } else { ++ next as *mut cmsghdr ++ } ++ } ++ ++ pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () { ++ for slot in cpuset.bits.iter_mut() { ++ *slot = 0; ++ } ++ } ++ ++ pub fn CPU_SET(cpu: usize, cpuset: &mut cpu_set_t) -> () { ++ let size_in_bits = 8 * mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc ++ let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits); ++ cpuset.bits[idx] |= 1 << offset; ++ () ++ } ++ ++ pub fn CPU_CLR(cpu: usize, cpuset: &mut cpu_set_t) -> () { ++ let size_in_bits = 8 * mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc ++ let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits); ++ cpuset.bits[idx] &= !(1 << offset); ++ () ++ } ++ ++ pub fn CPU_ISSET(cpu: usize, cpuset: &cpu_set_t) -> bool { ++ let size_in_bits = 8 * mem::size_of_val(&cpuset.bits[0]); ++ let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits); ++ 0 != (cpuset.bits[idx] & (1 << offset)) ++ } ++ ++ pub fn CPU_EQUAL(set1: &cpu_set_t, set2: &cpu_set_t) -> bool { ++ set1.bits == set2.bits ++ } ++ ++ pub fn major(dev: crate::dev_t) -> c_uint { ++ // see ++ // https://github.com/emscripten-core/emscripten/blob/ ++ // main/system/lib/libc/musl/include/sys/sysmacros.h ++ let mut major = 0; ++ major |= (dev & 0x00000fff) >> 8; ++ major |= (dev & 0xfffff000) >> 31 >> 1; ++ major as c_uint ++ } ++ ++ pub fn minor(dev: crate::dev_t) -> c_uint { ++ // see ++ // https://github.com/emscripten-core/emscripten/blob/ ++ // main/system/lib/libc/musl/include/sys/sysmacros.h ++ let mut minor = 0; ++ minor |= (dev & 0x000000ff) >> 0; ++ minor |= (dev & 0xffffff00) >> 12; ++ minor as c_uint ++ } ++} ++ ++safe_f! { ++ pub {const} fn makedev(major: c_uint, minor: c_uint) -> crate::dev_t { ++ let major = major as crate::dev_t; ++ let minor = minor as crate::dev_t; ++ let mut dev = 0; ++ dev |= (major & 0x00000fff) << 8; ++ dev |= (major & 0xfffff000) << 31 << 1; ++ dev |= (minor & 0x000000ff) << 0; ++ dev |= (minor & 0xffffff00) << 12; ++ dev ++ } ++} ++ ++extern "C" { ++ pub fn getrlimit(resource: c_int, rlim: *mut crate::rlimit) -> c_int; ++ pub fn setrlimit(resource: c_int, rlim: *const crate::rlimit) -> c_int; ++ pub fn strerror_r(errnum: c_int, buf: *mut c_char, buflen: size_t) -> c_int; ++ ++ pub fn abs(i: c_int) -> c_int; ++ pub fn labs(i: c_long) -> c_long; ++ pub fn rand() -> c_int; ++ pub fn srand(seed: c_uint); ++ ++ pub fn gettimeofday(tp: *mut crate::timeval, tz: *mut c_void) -> c_int; ++ ++ pub fn setpwent(); ++ pub fn endpwent(); ++ pub fn getpwent() -> *mut passwd; ++ ++ pub fn shm_open(name: *const c_char, oflag: c_int, mode: mode_t) -> c_int; ++ ++ pub fn mprotect(addr: *mut c_void, len: size_t, prot: c_int) -> c_int; ++ pub fn __errno_location() -> *mut c_int; ++ ++ pub fn posix_fallocate(fd: c_int, offset: off_t, len: off_t) -> c_int; ++ pub fn pwritev(fd: c_int, iov: *const crate::iovec, iovcnt: c_int, offset: off_t) -> ssize_t; ++ pub fn preadv(fd: c_int, iov: *const crate::iovec, iovcnt: c_int, offset: off_t) -> ssize_t; ++ pub fn dup3(oldfd: c_int, newfd: c_int, flags: c_int) -> c_int; ++ pub fn nl_langinfo_l(item: crate::nl_item, locale: crate::locale_t) -> *mut c_char; ++ pub fn accept4( ++ fd: c_int, ++ addr: *mut crate::sockaddr, ++ len: *mut crate::socklen_t, ++ flg: c_int, ++ ) -> c_int; ++ pub fn getnameinfo( ++ sa: *const crate::sockaddr, ++ salen: crate::socklen_t, ++ host: *mut c_char, ++ hostlen: crate::socklen_t, ++ serv: *mut c_char, ++ servlen: crate::socklen_t, ++ flags: c_int, ++ ) -> c_int; ++ pub fn getloadavg(loadavg: *mut c_double, nelem: c_int) -> c_int; ++ ++ pub fn mkfifoat(dirfd: c_int, pathname: *const c_char, mode: crate::mode_t) -> c_int; ++ pub fn if_nameindex() -> *mut if_nameindex; ++ pub fn if_freenameindex(ptr: *mut if_nameindex); ++ ++ pub fn mremap( ++ addr: *mut c_void, ++ len: size_t, ++ new_len: size_t, ++ flags: c_int, ++ ... ++ ) -> *mut c_void; ++ ++ pub fn glob( ++ pattern: *const c_char, ++ flags: c_int, ++ errfunc: Option c_int>, ++ pglob: *mut crate::glob_t, ++ ) -> c_int; ++ pub fn globfree(pglob: *mut crate::glob_t); ++ ++ pub fn posix_madvise(addr: *mut c_void, len: size_t, advice: c_int) -> c_int; ++ ++ pub fn shm_unlink(name: *const c_char) -> c_int; ++ ++ pub fn seekdir(dirp: *mut crate::DIR, loc: c_long); ++ ++ pub fn telldir(dirp: *mut crate::DIR) -> c_long; ++ pub fn madvise(addr: *mut c_void, len: size_t, advice: c_int) -> c_int; ++ ++ pub fn msync(addr: *mut c_void, len: size_t, flags: c_int) -> c_int; ++ ++ pub fn recvfrom( ++ socket: c_int, ++ buf: *mut c_void, ++ len: size_t, ++ flags: c_int, ++ addr: *mut crate::sockaddr, ++ addrlen: *mut crate::socklen_t, ++ ) -> ssize_t; ++ pub fn mkstemps(template: *mut c_char, suffixlen: c_int) -> c_int; ++ pub fn nl_langinfo(item: crate::nl_item) -> *mut c_char; ++ ++ pub fn getdomainname(name: *mut c_char, len: size_t) -> c_int; ++ pub fn setdomainname(name: *const c_char, len: size_t) -> c_int; ++ pub fn sendmmsg( ++ sockfd: c_int, ++ msgvec: *mut crate::mmsghdr, ++ vlen: c_uint, ++ flags: c_uint, ++ ) -> c_int; ++ pub fn recvmmsg( ++ sockfd: c_int, ++ msgvec: *mut crate::mmsghdr, ++ vlen: c_uint, ++ flags: c_uint, ++ timeout: *mut crate::timespec, ++ ) -> c_int; ++ pub fn sync(); ++ pub fn ioctl(fd: c_int, request: c_int, ...) -> c_int; ++ pub fn getpriority(which: c_int, who: crate::id_t) -> c_int; ++ pub fn setpriority(which: c_int, who: crate::id_t, prio: c_int) -> c_int; ++ pub fn pthread_create( ++ native: *mut crate::pthread_t, ++ attr: *const crate::pthread_attr_t, ++ f: extern "C" fn(*mut c_void) -> *mut c_void, ++ value: *mut c_void, ++ ) -> c_int; ++ ++ pub fn getentropy(buf: *mut c_void, buflen: size_t) -> c_int; ++ ++ pub fn getpwnam_r( ++ name: *const c_char, ++ pwd: *mut passwd, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut passwd, ++ ) -> c_int; ++ pub fn getpwuid_r( ++ uid: crate::uid_t, ++ pwd: *mut passwd, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut passwd, ++ ) -> c_int; ++ ++ // grp.h ++ pub fn getgrgid(gid: crate::gid_t) -> *mut crate::group; ++ pub fn getgrnam(name: *const c_char) -> *mut crate::group; ++ pub fn getgrnam_r( ++ name: *const c_char, ++ grp: *mut crate::group, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut crate::group, ++ ) -> c_int; ++ pub fn getgrgid_r( ++ gid: crate::gid_t, ++ grp: *mut crate::group, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut crate::group, ++ ) -> c_int; ++} ++ ++// Alias to 64 to mimic glibc's LFS64 support ++mod lfs64; ++pub use self::lfs64::*; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/arch/generic/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/arch/generic/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/arch/generic/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/arch/generic/mod.rs 2024-12-28 15:35:00.000000000 -0500 +@@ -0,0 +1,392 @@ ++use crate::prelude::*; ++use crate::Ioctl; ++ ++s! { ++ pub struct termios2 { ++ pub c_iflag: crate::tcflag_t, ++ pub c_oflag: crate::tcflag_t, ++ pub c_cflag: crate::tcflag_t, ++ pub c_lflag: crate::tcflag_t, ++ pub c_line: crate::cc_t, ++ pub c_cc: [crate::cc_t; 19], ++ pub c_ispeed: crate::speed_t, ++ pub c_ospeed: crate::speed_t, ++ } ++} ++ ++// include/uapi/asm-generic/socket.h ++// arch/alpha/include/uapi/asm/socket.h ++// tools/include/uapi/asm-generic/socket.h ++// arch/mips/include/uapi/asm/socket.h ++pub const SOL_SOCKET: c_int = 1; ++ ++// Defined in unix/linux_like/mod.rs ++// pub const SO_DEBUG: c_int = 1; ++pub const SO_REUSEADDR: c_int = 2; ++pub const SO_TYPE: c_int = 3; ++pub const SO_ERROR: c_int = 4; ++pub const SO_DONTROUTE: c_int = 5; ++pub const SO_BROADCAST: c_int = 6; ++pub const SO_SNDBUF: c_int = 7; ++pub const SO_RCVBUF: c_int = 8; ++pub const SO_KEEPALIVE: c_int = 9; ++pub const SO_OOBINLINE: c_int = 10; ++pub const SO_NO_CHECK: c_int = 11; ++pub const SO_PRIORITY: c_int = 12; ++pub const SO_LINGER: c_int = 13; ++pub const SO_BSDCOMPAT: c_int = 14; ++pub const SO_REUSEPORT: c_int = 15; ++pub const SO_PASSCRED: c_int = 16; ++pub const SO_PEERCRED: c_int = 17; ++pub const SO_RCVLOWAT: c_int = 18; ++pub const SO_SNDLOWAT: c_int = 19; ++pub const SO_SECURITY_AUTHENTICATION: c_int = 22; ++pub const SO_SECURITY_ENCRYPTION_TRANSPORT: c_int = 23; ++pub const SO_SECURITY_ENCRYPTION_NETWORK: c_int = 24; ++pub const SO_BINDTODEVICE: c_int = 25; ++pub const SO_ATTACH_FILTER: c_int = 26; ++pub const SO_DETACH_FILTER: c_int = 27; ++pub const SO_GET_FILTER: c_int = SO_ATTACH_FILTER; ++pub const SO_PEERNAME: c_int = 28; ++ ++cfg_if! { ++ if #[cfg(all(gnu_time64_abi, ++ any(target_arch = "arm", target_arch = "x86")))] { ++ pub const SO_TIMESTAMP: c_int = 63; ++ pub const SO_TIMESTAMPNS: c_int = 64; ++ pub const SO_TIMESTAMPING: c_int = 65; ++ pub const SO_RCVTIMEO: c_int = 66; ++ pub const SO_SNDTIMEO: c_int = 67; ++ } else { ++ pub const SO_TIMESTAMP: c_int = 29; ++ pub const SO_TIMESTAMPNS: c_int = 35; ++ pub const SO_TIMESTAMPING: c_int = 37; ++ pub const SO_RCVTIMEO: c_int = 20; ++ pub const SO_SNDTIMEO: c_int = 21; ++ } ++} ++// pub const SO_TIMESTAMP_OLD: c_int = 29; ++// pub const SO_TIMESTAMPNS_OLD: c_int = 35; ++// pub const SO_TIMESTAMPING_OLD: c_int = 37; ++// pub const SO_RCVTIMEO_OLD: c_int = 20; ++// pub const SO_SNDTIMEO_OLD: c_int = 21; ++ ++pub const SO_ACCEPTCONN: c_int = 30; ++pub const SO_PEERSEC: c_int = 31; ++pub const SO_SNDBUFFORCE: c_int = 32; ++pub const SO_RCVBUFFORCE: c_int = 33; ++pub const SO_PASSSEC: c_int = 34; ++pub const SO_MARK: c_int = 36; ++pub const SO_PROTOCOL: c_int = 38; ++pub const SO_DOMAIN: c_int = 39; ++pub const SO_RXQ_OVFL: c_int = 40; ++pub const SO_WIFI_STATUS: c_int = 41; ++pub const SCM_WIFI_STATUS: c_int = SO_WIFI_STATUS; ++pub const SO_PEEK_OFF: c_int = 42; ++pub const SO_NOFCS: c_int = 43; ++pub const SO_LOCK_FILTER: c_int = 44; ++pub const SO_SELECT_ERR_QUEUE: c_int = 45; ++pub const SO_BUSY_POLL: c_int = 46; ++pub const SO_MAX_PACING_RATE: c_int = 47; ++pub const SO_BPF_EXTENSIONS: c_int = 48; ++pub const SO_INCOMING_CPU: c_int = 49; ++pub const SO_ATTACH_BPF: c_int = 50; ++pub const SO_DETACH_BPF: c_int = SO_DETACH_FILTER; ++pub const SO_ATTACH_REUSEPORT_CBPF: c_int = 51; ++pub const SO_ATTACH_REUSEPORT_EBPF: c_int = 52; ++pub const SO_CNX_ADVICE: c_int = 53; ++pub const SCM_TIMESTAMPING_OPT_STATS: c_int = 54; ++pub const SO_MEMINFO: c_int = 55; ++pub const SO_INCOMING_NAPI_ID: c_int = 56; ++pub const SO_COOKIE: c_int = 57; ++pub const SCM_TIMESTAMPING_PKTINFO: c_int = 58; ++pub const SO_PEERGROUPS: c_int = 59; ++pub const SO_ZEROCOPY: c_int = 60; ++pub const SO_TXTIME: c_int = 61; ++pub const SCM_TXTIME: c_int = SO_TXTIME; ++pub const SO_BINDTOIFINDEX: c_int = 62; ++cfg_if! { ++ // Some of these platforms in CI already have these constants. ++ // But they may still not have those _OLD ones. ++ if #[cfg(all( ++ any( ++ target_arch = "x86", ++ target_arch = "x86_64", ++ target_arch = "aarch64", ++ target_arch = "csky", ++ target_arch = "loongarch64" ++ ), ++ not(any(target_env = "musl", target_env = "ohos")) ++ ))] { ++ pub const SO_TIMESTAMP_NEW: c_int = 63; ++ pub const SO_TIMESTAMPNS_NEW: c_int = 64; ++ pub const SO_TIMESTAMPING_NEW: c_int = 65; ++ pub const SO_RCVTIMEO_NEW: c_int = 66; ++ pub const SO_SNDTIMEO_NEW: c_int = 67; ++ pub const SO_DETACH_REUSEPORT_BPF: c_int = 68; ++ } ++} ++// pub const SO_PREFER_BUSY_POLL: c_int = 69; ++// pub const SO_BUSY_POLL_BUDGET: c_int = 70; ++ ++cfg_if! { ++ if #[cfg(any( ++ target_arch = "x86", ++ target_arch = "x86_64", ++ target_arch = "arm", ++ target_arch = "aarch64", ++ target_arch = "riscv64", ++ target_arch = "s390x", ++ target_arch = "csky", ++ target_arch = "loongarch64" ++ ))] { ++ pub const FICLONE: c_ulong = 0x40049409; ++ pub const FICLONERANGE: c_ulong = 0x4020940D; ++ } ++} ++ ++// Defined in unix/linux_like/mod.rs ++// pub const SCM_TIMESTAMP: c_int = SO_TIMESTAMP; ++pub const SCM_TIMESTAMPNS: c_int = SO_TIMESTAMPNS; ++pub const SCM_TIMESTAMPING: c_int = SO_TIMESTAMPING; ++ ++// Ioctl Constants ++ ++pub const TCGETS: Ioctl = 0x5401; ++pub const TCSETS: Ioctl = 0x5402; ++pub const TCSETSW: Ioctl = 0x5403; ++pub const TCSETSF: Ioctl = 0x5404; ++pub const TCGETA: Ioctl = 0x5405; ++pub const TCSETA: Ioctl = 0x5406; ++pub const TCSETAW: Ioctl = 0x5407; ++pub const TCSETAF: Ioctl = 0x5408; ++pub const TCSBRK: Ioctl = 0x5409; ++pub const TCXONC: Ioctl = 0x540A; ++pub const TCFLSH: Ioctl = 0x540B; ++pub const TIOCEXCL: Ioctl = 0x540C; ++pub const TIOCNXCL: Ioctl = 0x540D; ++pub const TIOCSCTTY: Ioctl = 0x540E; ++pub const TIOCGPGRP: Ioctl = 0x540F; ++pub const TIOCSPGRP: Ioctl = 0x5410; ++pub const TIOCOUTQ: Ioctl = 0x5411; ++pub const TIOCSTI: Ioctl = 0x5412; ++pub const TIOCGWINSZ: Ioctl = 0x5413; ++pub const TIOCSWINSZ: Ioctl = 0x5414; ++pub const TIOCMGET: Ioctl = 0x5415; ++pub const TIOCMBIS: Ioctl = 0x5416; ++pub const TIOCMBIC: Ioctl = 0x5417; ++pub const TIOCMSET: Ioctl = 0x5418; ++pub const TIOCGSOFTCAR: Ioctl = 0x5419; ++pub const TIOCSSOFTCAR: Ioctl = 0x541A; ++pub const FIONREAD: Ioctl = 0x541B; ++pub const TIOCINQ: Ioctl = FIONREAD; ++pub const TIOCLINUX: Ioctl = 0x541C; ++pub const TIOCCONS: Ioctl = 0x541D; ++pub const TIOCGSERIAL: Ioctl = 0x541E; ++pub const TIOCSSERIAL: Ioctl = 0x541F; ++pub const TIOCPKT: Ioctl = 0x5420; ++pub const FIONBIO: Ioctl = 0x5421; ++pub const TIOCNOTTY: Ioctl = 0x5422; ++pub const TIOCSETD: Ioctl = 0x5423; ++pub const TIOCGETD: Ioctl = 0x5424; ++pub const TCSBRKP: Ioctl = 0x5425; ++pub const TIOCSBRK: Ioctl = 0x5427; ++pub const TIOCCBRK: Ioctl = 0x5428; ++pub const TIOCGSID: Ioctl = 0x5429; ++pub const TCGETS2: Ioctl = 0x802c542a; ++pub const TCSETS2: Ioctl = 0x402c542b; ++pub const TCSETSW2: Ioctl = 0x402c542c; ++pub const TCSETSF2: Ioctl = 0x402c542d; ++pub const TIOCGRS485: Ioctl = 0x542E; ++pub const TIOCSRS485: Ioctl = 0x542F; ++pub const TIOCGPTN: Ioctl = 0x80045430; ++pub const TIOCSPTLCK: Ioctl = 0x40045431; ++pub const TIOCGDEV: Ioctl = 0x80045432; ++pub const TCGETX: Ioctl = 0x5432; ++pub const TCSETX: Ioctl = 0x5433; ++pub const TCSETXF: Ioctl = 0x5434; ++pub const TCSETXW: Ioctl = 0x5435; ++pub const TIOCSIG: Ioctl = 0x40045436; ++pub const TIOCVHANGUP: Ioctl = 0x5437; ++pub const TIOCGPKT: Ioctl = 0x80045438; ++pub const TIOCGPTLCK: Ioctl = 0x80045439; ++pub const TIOCGEXCL: Ioctl = 0x80045440; ++pub const TIOCGPTPEER: Ioctl = 0x5441; ++// pub const TIOCGISO7816: Ioctl = 0x80285442; ++// pub const TIOCSISO7816: Ioctl = 0xc0285443; ++pub const FIONCLEX: Ioctl = 0x5450; ++pub const FIOCLEX: Ioctl = 0x5451; ++pub const FIOASYNC: Ioctl = 0x5452; ++pub const TIOCSERCONFIG: Ioctl = 0x5453; ++pub const TIOCSERGWILD: Ioctl = 0x5454; ++pub const TIOCSERSWILD: Ioctl = 0x5455; ++pub const TIOCGLCKTRMIOS: Ioctl = 0x5456; ++pub const TIOCSLCKTRMIOS: Ioctl = 0x5457; ++pub const TIOCSERGSTRUCT: Ioctl = 0x5458; ++pub const TIOCSERGETLSR: Ioctl = 0x5459; ++pub const TIOCSERGETMULTI: Ioctl = 0x545A; ++pub const TIOCSERSETMULTI: Ioctl = 0x545B; ++pub const TIOCMIWAIT: Ioctl = 0x545C; ++pub const TIOCGICOUNT: Ioctl = 0x545D; ++pub const BLKIOMIN: Ioctl = 0x1278; ++pub const BLKIOOPT: Ioctl = 0x1279; ++pub const BLKSSZGET: Ioctl = 0x1268; ++pub const BLKPBSZGET: Ioctl = 0x127B; ++// linux/if_tun.h ++pub const TUNSETNOCSUM: Ioctl = 0x400454c8; ++pub const TUNSETDEBUG: Ioctl = 0x400454c9; ++pub const TUNSETIFF: Ioctl = 0x400454ca; ++pub const TUNSETPERSIST: Ioctl = 0x400454cb; ++pub const TUNSETOWNER: Ioctl = 0x400454cc; ++pub const TUNSETLINK: Ioctl = 0x400454cd; ++pub const TUNSETGROUP: Ioctl = 0x400454ce; ++pub const TUNGETFEATURES: Ioctl = 0x800454cf; ++pub const TUNSETOFFLOAD: Ioctl = 0x400454d0; ++pub const TUNSETTXFILTER: Ioctl = 0x400454d1; ++pub const TUNGETIFF: Ioctl = 0x800454d2; ++pub const TUNGETSNDBUF: Ioctl = 0x800454d3; ++pub const TUNSETSNDBUF: Ioctl = 0x400454d4; ++pub const TUNGETVNETHDRSZ: Ioctl = 0x800454d7; ++pub const TUNSETVNETHDRSZ: Ioctl = 0x400454d8; ++pub const TUNSETQUEUE: Ioctl = 0x400454d9; ++pub const TUNSETIFINDEX: Ioctl = 0x400454da; ++pub const TUNSETVNETLE: Ioctl = 0x400454dc; ++pub const TUNGETVNETLE: Ioctl = 0x800454dd; ++/* The TUNSETVNETBE and TUNGETVNETBE ioctls are for cross-endian support on ++ * little-endian hosts. Not all kernel configurations support them, but all ++ * configurations that support SET also support GET. ++ */ ++pub const TUNSETVNETBE: Ioctl = 0x400454de; ++pub const TUNGETVNETBE: Ioctl = 0x800454df; ++pub const TUNSETSTEERINGEBPF: Ioctl = 0x800454e0; ++pub const TUNSETFILTEREBPF: Ioctl = 0x800454e1; ++ ++cfg_if! { ++ // Those type are constructed using the _IOC macro ++ // DD-SS_SSSS_SSSS_SSSS-TTTT_TTTT-NNNN_NNNN ++ // where D stands for direction (either None (00), Read (01) or Write (11)) ++ // where S stands for size (int, long, struct...) ++ // where T stands for type ('f','v','X'...) ++ // where N stands for NR (NumbeR) ++ if #[cfg(any( ++ target_arch = "x86", ++ target_arch = "arm", ++ target_arch = "csky" ++ ))] { ++ pub const FS_IOC_GETFLAGS: Ioctl = 0x80046601; ++ pub const FS_IOC_SETFLAGS: Ioctl = 0x40046602; ++ pub const FS_IOC_GETVERSION: Ioctl = 0x80047601; ++ pub const FS_IOC_SETVERSION: Ioctl = 0x40047602; ++ pub const FS_IOC32_GETFLAGS: Ioctl = 0x80046601; ++ pub const FS_IOC32_SETFLAGS: Ioctl = 0x40046602; ++ pub const FS_IOC32_GETVERSION: Ioctl = 0x80047601; ++ pub const FS_IOC32_SETVERSION: Ioctl = 0x40047602; ++ pub const TUNATTACHFILTER: Ioctl = 0x400854d5; ++ pub const TUNDETACHFILTER: Ioctl = 0x400854d6; ++ pub const TUNGETFILTER: Ioctl = 0x800854db; ++ } else if #[cfg(any( ++ target_arch = "x86_64", ++ target_arch = "riscv64", ++ target_arch = "aarch64", ++ target_arch = "s390x", ++ target_arch = "loongarch64" ++ ))] { ++ pub const FS_IOC_GETFLAGS: Ioctl = 0x80086601; ++ pub const FS_IOC_SETFLAGS: Ioctl = 0x40086602; ++ pub const FS_IOC_GETVERSION: Ioctl = 0x80087601; ++ pub const FS_IOC_SETVERSION: Ioctl = 0x40087602; ++ pub const FS_IOC32_GETFLAGS: Ioctl = 0x80046601; ++ pub const FS_IOC32_SETFLAGS: Ioctl = 0x40046602; ++ pub const FS_IOC32_GETVERSION: Ioctl = 0x80047601; ++ pub const FS_IOC32_SETVERSION: Ioctl = 0x40047602; ++ pub const TUNATTACHFILTER: Ioctl = 0x401054d5; ++ pub const TUNDETACHFILTER: Ioctl = 0x401054d6; ++ pub const TUNGETFILTER: Ioctl = 0x801054db; ++ } ++} ++ ++cfg_if! { ++ if #[cfg(any(target_arch = "arm", target_arch = "s390x"))] { ++ pub const FIOQSIZE: Ioctl = 0x545E; ++ } else { ++ pub const FIOQSIZE: Ioctl = 0x5460; ++ } ++} ++ ++pub const TIOCM_LE: c_int = 0x001; ++pub const TIOCM_DTR: c_int = 0x002; ++pub const TIOCM_RTS: c_int = 0x004; ++pub const TIOCM_ST: c_int = 0x008; ++pub const TIOCM_SR: c_int = 0x010; ++pub const TIOCM_CTS: c_int = 0x020; ++pub const TIOCM_CAR: c_int = 0x040; ++pub const TIOCM_CD: c_int = TIOCM_CAR; ++pub const TIOCM_RNG: c_int = 0x080; ++pub const TIOCM_RI: c_int = TIOCM_RNG; ++pub const TIOCM_DSR: c_int = 0x100; ++ ++pub const BOTHER: crate::speed_t = 0o010000; ++pub const IBSHIFT: crate::tcflag_t = 16; ++ ++// RLIMIT Constants ++ ++cfg_if! { ++ if #[cfg(any(target_env = "gnu", target_env = "uclibc"))] { ++ pub const RLIMIT_CPU: crate::__rlimit_resource_t = 0; ++ pub const RLIMIT_FSIZE: crate::__rlimit_resource_t = 1; ++ pub const RLIMIT_DATA: crate::__rlimit_resource_t = 2; ++ pub const RLIMIT_STACK: crate::__rlimit_resource_t = 3; ++ pub const RLIMIT_CORE: crate::__rlimit_resource_t = 4; ++ pub const RLIMIT_RSS: crate::__rlimit_resource_t = 5; ++ pub const RLIMIT_NPROC: crate::__rlimit_resource_t = 6; ++ pub const RLIMIT_NOFILE: crate::__rlimit_resource_t = 7; ++ pub const RLIMIT_MEMLOCK: crate::__rlimit_resource_t = 8; ++ pub const RLIMIT_AS: crate::__rlimit_resource_t = 9; ++ pub const RLIMIT_LOCKS: crate::__rlimit_resource_t = 10; ++ pub const RLIMIT_SIGPENDING: crate::__rlimit_resource_t = 11; ++ pub const RLIMIT_MSGQUEUE: crate::__rlimit_resource_t = 12; ++ pub const RLIMIT_NICE: crate::__rlimit_resource_t = 13; ++ pub const RLIMIT_RTPRIO: crate::__rlimit_resource_t = 14; ++ pub const RLIMIT_RTTIME: crate::__rlimit_resource_t = 15; ++ #[allow(deprecated)] ++ #[deprecated(since = "0.2.64", note = "Not stable across OS versions")] ++ pub const RLIMIT_NLIMITS: crate::__rlimit_resource_t = RLIM_NLIMITS; ++ } else if #[cfg(any(target_env = "musl", target_env = "ohos"))] { ++ pub const RLIMIT_CPU: c_int = 0; ++ pub const RLIMIT_FSIZE: c_int = 1; ++ pub const RLIMIT_DATA: c_int = 2; ++ pub const RLIMIT_STACK: c_int = 3; ++ pub const RLIMIT_CORE: c_int = 4; ++ pub const RLIMIT_RSS: c_int = 5; ++ pub const RLIMIT_NPROC: c_int = 6; ++ pub const RLIMIT_NOFILE: c_int = 7; ++ pub const RLIMIT_MEMLOCK: c_int = 8; ++ pub const RLIMIT_AS: c_int = 9; ++ pub const RLIMIT_LOCKS: c_int = 10; ++ pub const RLIMIT_SIGPENDING: c_int = 11; ++ pub const RLIMIT_MSGQUEUE: c_int = 12; ++ pub const RLIMIT_NICE: c_int = 13; ++ pub const RLIMIT_RTPRIO: c_int = 14; ++ pub const RLIMIT_RTTIME: c_int = 15; ++ #[deprecated(since = "0.2.64", note = "Not stable across OS versions")] ++ #[cfg(not(target_arch = "loongarch64"))] ++ pub const RLIM_NLIMITS: c_int = 15; ++ #[cfg(target_arch = "loongarch64")] ++ pub const RLIM_NLIMITS: c_int = 16; ++ #[allow(deprecated)] ++ #[deprecated(since = "0.2.64", note = "Not stable across OS versions")] ++ pub const RLIMIT_NLIMITS: c_int = RLIM_NLIMITS; ++ } ++} ++ ++cfg_if! { ++ if #[cfg(target_env = "gnu")] { ++ #[deprecated(since = "0.2.64", note = "Not stable across OS versions")] ++ pub const RLIM_NLIMITS: crate::__rlimit_resource_t = 16; ++ } else if #[cfg(target_env = "uclibc")] { ++ #[deprecated(since = "0.2.64", note = "Not stable across OS versions")] ++ pub const RLIM_NLIMITS: crate::__rlimit_resource_t = 15; ++ } ++} ++ ++pub const RLIM_INFINITY: crate::rlim_t = !0; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/arch/mips/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/arch/mips/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/arch/mips/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/arch/mips/mod.rs 2024-12-28 15:35:00.000000000 -0500 +@@ -0,0 +1,375 @@ ++use crate::prelude::*; ++use crate::Ioctl; ++ ++s! { ++ pub struct termios2 { ++ pub c_iflag: crate::tcflag_t, ++ pub c_oflag: crate::tcflag_t, ++ pub c_cflag: crate::tcflag_t, ++ pub c_lflag: crate::tcflag_t, ++ pub c_line: crate::cc_t, ++ pub c_cc: [crate::cc_t; 23], ++ pub c_ispeed: crate::speed_t, ++ pub c_ospeed: crate::speed_t, ++ } ++} ++ ++// arch/mips/include/uapi/asm/socket.h ++pub const SOL_SOCKET: c_int = 0xffff; ++ ++// Defined in unix/linux_like/mod.rs ++// pub const SO_DEBUG: c_int = 0x0001; ++pub const SO_REUSEADDR: c_int = 0x0004; ++pub const SO_KEEPALIVE: c_int = 0x0008; ++pub const SO_DONTROUTE: c_int = 0x0010; ++pub const SO_BROADCAST: c_int = 0x0020; ++pub const SO_LINGER: c_int = 0x0080; ++pub const SO_OOBINLINE: c_int = 0x0100; ++pub const SO_REUSEPORT: c_int = 0x0200; ++pub const SO_TYPE: c_int = 0x1008; ++// pub const SO_STYLE: c_int = SO_TYPE; ++pub const SO_ERROR: c_int = 0x1007; ++pub const SO_SNDBUF: c_int = 0x1001; ++pub const SO_RCVBUF: c_int = 0x1002; ++pub const SO_SNDLOWAT: c_int = 0x1003; ++pub const SO_RCVLOWAT: c_int = 0x1004; ++// NOTE: These definitions are now being renamed with _OLD postfix, ++// but CI haven't support them yet. ++// Some related consts could be found in b32.rs and b64.rs ++cfg_if! { ++ if #[cfg(gnu_time64_abi)] { ++ pub const SO_SNDTIMEO: c_int = 67; ++ pub const SO_RCVTIMEO: c_int = 66; ++ } else { ++ pub const SO_SNDTIMEO: c_int = 0x1005; ++ pub const SO_RCVTIMEO: c_int = 0x1006; ++ } ++} ++// pub const SO_SNDTIMEO_OLD: c_int = 0x1005; ++// pub const SO_RCVTIMEO_OLD: c_int = 0x1006; ++pub const SO_ACCEPTCONN: c_int = 0x1009; ++pub const SO_PROTOCOL: c_int = 0x1028; ++pub const SO_DOMAIN: c_int = 0x1029; ++ ++pub const SO_NO_CHECK: c_int = 11; ++pub const SO_PRIORITY: c_int = 12; ++pub const SO_BSDCOMPAT: c_int = 14; ++pub const SO_PASSCRED: c_int = 17; ++pub const SO_PEERCRED: c_int = 18; ++pub const SO_SECURITY_AUTHENTICATION: c_int = 22; ++pub const SO_SECURITY_ENCRYPTION_TRANSPORT: c_int = 23; ++pub const SO_SECURITY_ENCRYPTION_NETWORK: c_int = 24; ++pub const SO_BINDTODEVICE: c_int = 25; ++pub const SO_ATTACH_FILTER: c_int = 26; ++pub const SO_DETACH_FILTER: c_int = 27; ++pub const SO_GET_FILTER: c_int = SO_ATTACH_FILTER; ++pub const SO_PEERNAME: c_int = 28; ++pub const SO_PEERSEC: c_int = 30; ++pub const SO_SNDBUFFORCE: c_int = 31; ++pub const SO_RCVBUFFORCE: c_int = 33; ++pub const SO_PASSSEC: c_int = 34; ++pub const SO_MARK: c_int = 36; ++pub const SO_RXQ_OVFL: c_int = 40; ++pub const SO_WIFI_STATUS: c_int = 41; ++pub const SCM_WIFI_STATUS: c_int = SO_WIFI_STATUS; ++pub const SO_PEEK_OFF: c_int = 42; ++pub const SO_NOFCS: c_int = 43; ++pub const SO_LOCK_FILTER: c_int = 44; ++pub const SO_SELECT_ERR_QUEUE: c_int = 45; ++pub const SO_BUSY_POLL: c_int = 46; ++pub const SO_MAX_PACING_RATE: c_int = 47; ++pub const SO_BPF_EXTENSIONS: c_int = 48; ++pub const SO_INCOMING_CPU: c_int = 49; ++pub const SO_ATTACH_BPF: c_int = 50; ++pub const SO_DETACH_BPF: c_int = SO_DETACH_FILTER; ++pub const SO_ATTACH_REUSEPORT_CBPF: c_int = 51; ++pub const SO_ATTACH_REUSEPORT_EBPF: c_int = 52; ++pub const SO_CNX_ADVICE: c_int = 53; ++pub const SCM_TIMESTAMPING_OPT_STATS: c_int = 54; ++pub const SO_MEMINFO: c_int = 55; ++pub const SO_INCOMING_NAPI_ID: c_int = 56; ++pub const SO_COOKIE: c_int = 57; ++pub const SCM_TIMESTAMPING_PKTINFO: c_int = 58; ++pub const SO_PEERGROUPS: c_int = 59; ++pub const SO_ZEROCOPY: c_int = 60; ++pub const SO_TXTIME: c_int = 61; ++pub const SCM_TXTIME: c_int = SO_TXTIME; ++pub const SO_BINDTOIFINDEX: c_int = 62; ++// NOTE: These definitions are now being renamed with _OLD postfix, ++// but CI haven't support them yet. ++// Some related consts could be found in b32.rs and b64.rs ++cfg_if! { ++ if #[cfg(gnu_time64_abi)] { ++ pub const SO_TIMESTAMP: c_int = 63; ++ pub const SO_TIMESTAMPNS: c_int = 64; ++ pub const SO_TIMESTAMPING: c_int = 65; ++ } else { ++ pub const SO_TIMESTAMP: c_int = 29; ++ pub const SO_TIMESTAMPNS: c_int = 35; ++ pub const SO_TIMESTAMPING: c_int = 37; ++ } ++} ++// pub const SO_TIMESTAMP_OLD: c_int = 29; ++// pub const SO_TIMESTAMPNS_OLD: c_int = 35; ++// pub const SO_TIMESTAMPING_OLD: c_int = 37; ++// pub const SO_TIMESTAMP_NEW: c_int = 63; ++// pub const SO_TIMESTAMPNS_NEW: c_int = 64; ++// pub const SO_TIMESTAMPING_NEW: c_int = 65; ++// pub const SO_RCVTIMEO_NEW: c_int = 66; ++// pub const SO_SNDTIMEO_NEW: c_int = 67; ++// pub const SO_DETACH_REUSEPORT_BPF: c_int = 68; ++// pub const SO_PREFER_BUSY_POLL: c_int = 69; ++// pub const SO_BUSY_POLL_BUDGET: c_int = 70; ++ ++pub const FICLONE: c_ulong = 0x80049409; ++pub const FICLONERANGE: c_ulong = 0x8020940D; ++ ++// Defined in unix/linux_like/mod.rs ++// pub const SCM_TIMESTAMP: c_int = SO_TIMESTAMP; ++pub const SCM_TIMESTAMPNS: c_int = SO_TIMESTAMPNS; ++pub const SCM_TIMESTAMPING: c_int = SO_TIMESTAMPING; ++ ++// Ioctl Constants ++ ++pub const TCGETS: Ioctl = 0x540d; ++pub const TCSETS: Ioctl = 0x540e; ++pub const TCSETSW: Ioctl = 0x540f; ++pub const TCSETSF: Ioctl = 0x5410; ++pub const TCGETA: Ioctl = 0x5401; ++pub const TCSETA: Ioctl = 0x5402; ++pub const TCSETAW: Ioctl = 0x5403; ++pub const TCSETAF: Ioctl = 0x5404; ++pub const TCSBRK: Ioctl = 0x5405; ++pub const TCXONC: Ioctl = 0x5406; ++pub const TCFLSH: Ioctl = 0x5407; ++pub const TIOCEXCL: Ioctl = 0x740d; ++pub const TIOCNXCL: Ioctl = 0x740e; ++pub const TIOCSCTTY: Ioctl = 0x5480; ++pub const TIOCGPGRP: Ioctl = 0x40047477; ++pub const TIOCSPGRP: Ioctl = 0x80047476; ++pub const TIOCOUTQ: Ioctl = 0x7472; ++pub const TIOCSTI: Ioctl = 0x5472; ++pub const TIOCGWINSZ: Ioctl = 0x40087468; ++pub const TIOCSWINSZ: Ioctl = 0x80087467; ++pub const TIOCMGET: Ioctl = 0x741d; ++pub const TIOCMBIS: Ioctl = 0x741b; ++pub const TIOCMBIC: Ioctl = 0x741c; ++pub const TIOCMSET: Ioctl = 0x741a; ++pub const TIOCGSOFTCAR: Ioctl = 0x5481; ++pub const TIOCSSOFTCAR: Ioctl = 0x5482; ++pub const FIONREAD: Ioctl = 0x467f; ++pub const TIOCINQ: Ioctl = FIONREAD; ++pub const TIOCLINUX: Ioctl = 0x5483; ++pub const TIOCCONS: Ioctl = 0x80047478; ++pub const TIOCGSERIAL: Ioctl = 0x5484; ++pub const TIOCSSERIAL: Ioctl = 0x5485; ++pub const TIOCPKT: Ioctl = 0x5470; ++pub const FIONBIO: Ioctl = 0x667e; ++pub const TIOCNOTTY: Ioctl = 0x5471; ++pub const TIOCSETD: Ioctl = 0x7401; ++pub const TIOCGETD: Ioctl = 0x7400; ++pub const TCSBRKP: Ioctl = 0x5486; ++pub const TIOCSBRK: Ioctl = 0x5427; ++pub const TIOCCBRK: Ioctl = 0x5428; ++pub const TIOCGSID: Ioctl = 0x7416; ++pub const TCGETS2: Ioctl = 0x4030542a; ++pub const TCSETS2: Ioctl = 0x8030542b; ++pub const TCSETSW2: Ioctl = 0x8030542c; ++pub const TCSETSF2: Ioctl = 0x8030542d; ++pub const TIOCGPTN: Ioctl = 0x40045430; ++pub const TIOCSPTLCK: Ioctl = 0x80045431; ++pub const TIOCGDEV: Ioctl = 0x40045432; ++pub const TIOCSIG: Ioctl = 0x80045436; ++pub const TIOCVHANGUP: Ioctl = 0x5437; ++pub const TIOCGPKT: Ioctl = 0x40045438; ++pub const TIOCGPTLCK: Ioctl = 0x40045439; ++pub const TIOCGEXCL: Ioctl = 0x40045440; ++pub const TIOCGPTPEER: Ioctl = 0x20005441; ++//pub const TIOCGISO7816: Ioctl = 0x40285442; ++//pub const TIOCSISO7816: Ioctl = 0xc0285443; ++pub const FIONCLEX: Ioctl = 0x6602; ++pub const FIOCLEX: Ioctl = 0x6601; ++pub const FIOASYNC: Ioctl = 0x667d; ++pub const TIOCSERCONFIG: Ioctl = 0x5488; ++pub const TIOCSERGWILD: Ioctl = 0x5489; ++pub const TIOCSERSWILD: Ioctl = 0x548a; ++pub const TIOCGLCKTRMIOS: Ioctl = 0x548b; ++pub const TIOCSLCKTRMIOS: Ioctl = 0x548c; ++pub const TIOCSERGSTRUCT: Ioctl = 0x548d; ++pub const TIOCSERGETLSR: Ioctl = 0x548e; ++pub const TIOCSERGETMULTI: Ioctl = 0x548f; ++pub const TIOCSERSETMULTI: Ioctl = 0x5490; ++pub const TIOCMIWAIT: Ioctl = 0x5491; ++pub const TIOCGICOUNT: Ioctl = 0x5492; ++pub const FIOQSIZE: Ioctl = 0x667f; ++pub const TIOCSLTC: Ioctl = 0x7475; ++pub const TIOCGETP: Ioctl = 0x7408; ++pub const TIOCSETP: Ioctl = 0x7409; ++pub const TIOCSETN: Ioctl = 0x740a; ++pub const BLKIOMIN: Ioctl = 0x20001278; ++pub const BLKIOOPT: Ioctl = 0x20001279; ++pub const BLKSSZGET: Ioctl = 0x20001268; ++pub const BLKPBSZGET: Ioctl = 0x2000127B; ++// linux/if_tun.h ++pub const TUNSETNOCSUM: Ioctl = 0x800454c8; ++pub const TUNSETDEBUG: Ioctl = 0x800454c9; ++pub const TUNSETIFF: Ioctl = 0x800454ca; ++pub const TUNSETPERSIST: Ioctl = 0x800454cb; ++pub const TUNSETOWNER: Ioctl = 0x800454cc; ++pub const TUNSETLINK: Ioctl = 0x800454cd; ++pub const TUNSETGROUP: Ioctl = 0x800454ce; ++pub const TUNGETFEATURES: Ioctl = 0x400454cf; ++pub const TUNSETOFFLOAD: Ioctl = 0x800454d0; ++pub const TUNSETTXFILTER: Ioctl = 0x800454d1; ++pub const TUNGETIFF: Ioctl = 0x400454d2; ++pub const TUNGETSNDBUF: Ioctl = 0x400454d3; ++pub const TUNSETSNDBUF: Ioctl = 0x800454d4; ++pub const TUNGETVNETHDRSZ: Ioctl = 0x400454d7; ++pub const TUNSETVNETHDRSZ: Ioctl = 0x800454d8; ++pub const TUNSETQUEUE: Ioctl = 0x800454d9; ++pub const TUNSETIFINDEX: Ioctl = 0x800454da; ++pub const TUNSETVNETLE: Ioctl = 0x800454dc; ++pub const TUNGETVNETLE: Ioctl = 0x400454dd; ++/* The TUNSETVNETBE and TUNGETVNETBE ioctls are for cross-endian support on ++ * little-endian hosts. Not all kernel configurations support them, but all ++ * configurations that support SET also support GET. ++ */ ++pub const TUNSETVNETBE: Ioctl = 0x800454de; ++pub const TUNGETVNETBE: Ioctl = 0x400454df; ++pub const TUNSETSTEERINGEBPF: Ioctl = 0x400454e0; ++pub const TUNSETFILTEREBPF: Ioctl = 0x400454e1; ++ ++cfg_if! { ++ // Those type are constructed using the _IOC macro ++ // DD-SS_SSSS_SSSS_SSSS-TTTT_TTTT-NNNN_NNNN ++ // where D stands for direction (either None (00), Read (01) or Write (11)) ++ // where S stands for size (int, long, struct...) ++ // where T stands for type ('f','v','X'...) ++ // where N stands for NR (NumbeR) ++ if #[cfg(any(target_arch = "mips", target_arch = "mips32r6"))] { ++ pub const FS_IOC_GETFLAGS: Ioctl = 0x40046601; ++ pub const FS_IOC_SETFLAGS: Ioctl = 0x80046602; ++ pub const FS_IOC_GETVERSION: Ioctl = 0x40047601; ++ pub const FS_IOC_SETVERSION: Ioctl = 0x80047602; ++ pub const FS_IOC32_GETFLAGS: Ioctl = 0x40046601; ++ pub const FS_IOC32_SETFLAGS: Ioctl = 0x80046602; ++ pub const FS_IOC32_GETVERSION: Ioctl = 0x40047601; ++ pub const FS_IOC32_SETVERSION: Ioctl = 0x80047602; ++ pub const TUNATTACHFILTER: Ioctl = 0x800854d5; ++ pub const TUNDETACHFILTER: Ioctl = 0x800854d6; ++ pub const TUNGETFILTER: Ioctl = 0x400854db; ++ } else if #[cfg(any(target_arch = "mips64", target_arch = "mips64r6"))] { ++ pub const FS_IOC_GETFLAGS: Ioctl = 0x40086601; ++ pub const FS_IOC_SETFLAGS: Ioctl = 0x80086602; ++ pub const FS_IOC_GETVERSION: Ioctl = 0x40087601; ++ pub const FS_IOC_SETVERSION: Ioctl = 0x80087602; ++ pub const FS_IOC32_GETFLAGS: Ioctl = 0x40046601; ++ pub const FS_IOC32_SETFLAGS: Ioctl = 0x80046602; ++ pub const FS_IOC32_GETVERSION: Ioctl = 0x40047601; ++ pub const FS_IOC32_SETVERSION: Ioctl = 0x80047602; ++ pub const TUNATTACHFILTER: Ioctl = 0x801054d5; ++ pub const TUNDETACHFILTER: Ioctl = 0x801054d6; ++ pub const TUNGETFILTER: Ioctl = 0x401054db; ++ } ++} ++ ++cfg_if! { ++ if #[cfg(target_env = "musl")] { ++ pub const TIOCGRS485: Ioctl = 0x4020542e; ++ pub const TIOCSRS485: Ioctl = 0xc020542f; ++ } ++} ++ ++pub const TIOCM_LE: c_int = 0x001; ++pub const TIOCM_DTR: c_int = 0x002; ++pub const TIOCM_RTS: c_int = 0x004; ++pub const TIOCM_ST: c_int = 0x010; ++pub const TIOCM_SR: c_int = 0x020; ++pub const TIOCM_CTS: c_int = 0x040; ++pub const TIOCM_CAR: c_int = 0x100; ++pub const TIOCM_CD: c_int = TIOCM_CAR; ++pub const TIOCM_RNG: c_int = 0x200; ++pub const TIOCM_RI: c_int = TIOCM_RNG; ++pub const TIOCM_DSR: c_int = 0x400; ++ ++pub const BOTHER: crate::speed_t = 0o010000; ++pub const IBSHIFT: crate::tcflag_t = 16; ++ ++// RLIMIT Constants ++ ++cfg_if! { ++ if #[cfg(any(target_env = "gnu", target_env = "uclibc"))] { ++ pub const RLIMIT_CPU: crate::__rlimit_resource_t = 0; ++ pub const RLIMIT_FSIZE: crate::__rlimit_resource_t = 1; ++ pub const RLIMIT_DATA: crate::__rlimit_resource_t = 2; ++ pub const RLIMIT_STACK: crate::__rlimit_resource_t = 3; ++ pub const RLIMIT_CORE: crate::__rlimit_resource_t = 4; ++ pub const RLIMIT_NOFILE: crate::__rlimit_resource_t = 5; ++ pub const RLIMIT_AS: crate::__rlimit_resource_t = 6; ++ pub const RLIMIT_RSS: crate::__rlimit_resource_t = 7; ++ pub const RLIMIT_NPROC: crate::__rlimit_resource_t = 8; ++ pub const RLIMIT_MEMLOCK: crate::__rlimit_resource_t = 9; ++ pub const RLIMIT_LOCKS: crate::__rlimit_resource_t = 10; ++ pub const RLIMIT_SIGPENDING: crate::__rlimit_resource_t = 11; ++ pub const RLIMIT_MSGQUEUE: crate::__rlimit_resource_t = 12; ++ pub const RLIMIT_NICE: crate::__rlimit_resource_t = 13; ++ pub const RLIMIT_RTPRIO: crate::__rlimit_resource_t = 14; ++ pub const RLIMIT_RTTIME: crate::__rlimit_resource_t = 15; ++ #[allow(deprecated)] ++ #[deprecated(since = "0.2.64", note = "Not stable across OS versions")] ++ pub const RLIMIT_NLIMITS: crate::__rlimit_resource_t = RLIM_NLIMITS; ++ } else if #[cfg(target_env = "musl")] { ++ pub const RLIMIT_CPU: c_int = 0; ++ pub const RLIMIT_FSIZE: c_int = 1; ++ pub const RLIMIT_DATA: c_int = 2; ++ pub const RLIMIT_STACK: c_int = 3; ++ pub const RLIMIT_CORE: c_int = 4; ++ pub const RLIMIT_NOFILE: c_int = 5; ++ pub const RLIMIT_AS: c_int = 6; ++ pub const RLIMIT_RSS: c_int = 7; ++ pub const RLIMIT_NPROC: c_int = 8; ++ pub const RLIMIT_MEMLOCK: c_int = 9; ++ pub const RLIMIT_LOCKS: c_int = 10; ++ pub const RLIMIT_SIGPENDING: c_int = 11; ++ pub const RLIMIT_MSGQUEUE: c_int = 12; ++ pub const RLIMIT_NICE: c_int = 13; ++ pub const RLIMIT_RTPRIO: c_int = 14; ++ pub const RLIMIT_RTTIME: c_int = 15; ++ #[deprecated(since = "0.2.64", note = "Not stable across OS versions")] ++ pub const RLIM_NLIMITS: c_int = 15; ++ #[allow(deprecated)] ++ #[deprecated(since = "0.2.64", note = "Not stable across OS versions")] ++ pub const RLIMIT_NLIMITS: c_int = RLIM_NLIMITS; ++ pub const RLIM_INFINITY: crate::rlim_t = !0; ++ } ++} ++ ++cfg_if! { ++ if #[cfg(target_env = "gnu")] { ++ #[deprecated(since = "0.2.64", note = "Not stable across OS versions")] ++ pub const RLIM_NLIMITS: crate::__rlimit_resource_t = 16; ++ } else if #[cfg(target_env = "uclibc")] { ++ #[deprecated(since = "0.2.64", note = "Not stable across OS versions")] ++ pub const RLIM_NLIMITS: crate::__rlimit_resource_t = 15; ++ } ++} ++ ++cfg_if! { ++ if #[cfg( ++ any(target_arch = "mips64", target_arch = "mips64r6"), ++ any(target_env = "gnu", target_env = "uclibc") ++ )] { ++ pub const RLIM_INFINITY: crate::rlim_t = !0; ++ } ++} ++ ++cfg_if! { ++ if #[cfg(all(gnu_time64_abi, any(target_arch = "mips", target_arch = "mips32r6")))] { ++ pub const RLIM_INFINITY: ::rlim_t = !0; ++ } else if #[cfg(all( ++ any(target_arch = "mips", target_arch = "mips32r6"), ++ target_env = "uclibc" ++ ))] { ++ pub const RLIM_INFINITY: crate::rlim_t = 0x7fffffff; ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/arch/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/arch/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/arch/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/arch/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,20 @@ ++cfg_if! { ++ if #[cfg(any( ++ target_arch = "mips", ++ target_arch = "mips32r6", ++ target_arch = "mips64", ++ target_arch = "mips64r6" ++ ))] { ++ mod mips; ++ pub use self::mips::*; ++ } else if #[cfg(any(target_arch = "powerpc", target_arch = "powerpc64"))] { ++ mod powerpc; ++ pub use self::powerpc::*; ++ } else if #[cfg(any(target_arch = "sparc", target_arch = "sparc64"))] { ++ mod sparc; ++ pub use self::sparc::*; ++ } else { ++ mod generic; ++ pub use self::generic::*; ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/arch/powerpc/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/arch/powerpc/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/arch/powerpc/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/arch/powerpc/mod.rs 2024-12-28 15:35:00.000000000 -0500 +@@ -0,0 +1,326 @@ ++use crate::prelude::*; ++use crate::Ioctl; ++ ++// arch/powerpc/include/uapi/asm/socket.h ++ ++pub const SOL_SOCKET: c_int = 1; ++ ++// Defined in unix/linux_like/mod.rs ++// pub const SO_DEBUG: c_int = 1; ++pub const SO_REUSEADDR: c_int = 2; ++pub const SO_TYPE: c_int = 3; ++pub const SO_ERROR: c_int = 4; ++pub const SO_DONTROUTE: c_int = 5; ++pub const SO_BROADCAST: c_int = 6; ++pub const SO_SNDBUF: c_int = 7; ++pub const SO_RCVBUF: c_int = 8; ++pub const SO_KEEPALIVE: c_int = 9; ++pub const SO_OOBINLINE: c_int = 10; ++pub const SO_NO_CHECK: c_int = 11; ++pub const SO_PRIORITY: c_int = 12; ++pub const SO_LINGER: c_int = 13; ++pub const SO_BSDCOMPAT: c_int = 14; ++pub const SO_REUSEPORT: c_int = 15; ++// powerpc only differs in these ++pub const SO_RCVLOWAT: c_int = 16; ++pub const SO_SNDLOWAT: c_int = 17; ++cfg_if! { ++ if #[cfg(gnu_time64_abi)] { ++ pub const SO_SNDTIMEO: c_int = 67; ++ pub const SO_RCVTIMEO: c_int = 66; ++ } else { ++ pub const SO_SNDTIMEO: c_int = 19; ++ pub const SO_RCVTIMEO: c_int = 18; ++ } ++} ++// pub const SO_RCVTIMEO_OLD: c_int = 18; ++// pub const SO_SNDTIMEO_OLD: c_int = 19; ++pub const SO_PASSCRED: c_int = 20; ++pub const SO_PEERCRED: c_int = 21; ++// end ++pub const SO_SECURITY_AUTHENTICATION: c_int = 22; ++pub const SO_SECURITY_ENCRYPTION_TRANSPORT: c_int = 23; ++pub const SO_SECURITY_ENCRYPTION_NETWORK: c_int = 24; ++pub const SO_BINDTODEVICE: c_int = 25; ++pub const SO_ATTACH_FILTER: c_int = 26; ++pub const SO_DETACH_FILTER: c_int = 27; ++pub const SO_GET_FILTER: c_int = SO_ATTACH_FILTER; ++pub const SO_PEERNAME: c_int = 28; ++cfg_if! { ++ if #[cfg(gnu_time64_abi)] { ++ pub const SO_TIMESTAMP: c_int = 63; ++ pub const SO_TIMESTAMPNS: c_int = 64; ++ pub const SO_TIMESTAMPING: c_int = 65; ++ } else { ++ pub const SO_TIMESTAMP: c_int = 29; ++ pub const SO_TIMESTAMPNS: c_int = 35; ++ pub const SO_TIMESTAMPING: c_int = 37; ++ } ++} ++// pub const SO_TIMESTAMP_OLD: c_int = 29; ++// pub const SO_TIMESTAMPNS_OLD: c_int = 35; ++// pub const SO_TIMESTAMPING_OLD: c_int = 37; ++pub const SO_ACCEPTCONN: c_int = 30; ++pub const SO_PEERSEC: c_int = 31; ++pub const SO_SNDBUFFORCE: c_int = 32; ++pub const SO_RCVBUFFORCE: c_int = 33; ++pub const SO_PASSSEC: c_int = 34; ++pub const SO_MARK: c_int = 36; ++pub const SO_PROTOCOL: c_int = 38; ++pub const SO_DOMAIN: c_int = 39; ++pub const SO_RXQ_OVFL: c_int = 40; ++pub const SO_WIFI_STATUS: c_int = 41; ++pub const SCM_WIFI_STATUS: c_int = SO_WIFI_STATUS; ++pub const SO_PEEK_OFF: c_int = 42; ++pub const SO_NOFCS: c_int = 43; ++pub const SO_LOCK_FILTER: c_int = 44; ++pub const SO_SELECT_ERR_QUEUE: c_int = 45; ++pub const SO_BUSY_POLL: c_int = 46; ++pub const SO_MAX_PACING_RATE: c_int = 47; ++pub const SO_BPF_EXTENSIONS: c_int = 48; ++pub const SO_INCOMING_CPU: c_int = 49; ++pub const SO_ATTACH_BPF: c_int = 50; ++pub const SO_DETACH_BPF: c_int = SO_DETACH_FILTER; ++pub const SO_ATTACH_REUSEPORT_CBPF: c_int = 51; ++pub const SO_ATTACH_REUSEPORT_EBPF: c_int = 52; ++pub const SO_CNX_ADVICE: c_int = 53; ++pub const SCM_TIMESTAMPING_OPT_STATS: c_int = 54; ++pub const SO_MEMINFO: c_int = 55; ++pub const SO_INCOMING_NAPI_ID: c_int = 56; ++pub const SO_COOKIE: c_int = 57; ++pub const SCM_TIMESTAMPING_PKTINFO: c_int = 58; ++pub const SO_PEERGROUPS: c_int = 59; ++pub const SO_ZEROCOPY: c_int = 60; ++pub const SO_TXTIME: c_int = 61; ++pub const SCM_TXTIME: c_int = SO_TXTIME; ++pub const SO_BINDTOIFINDEX: c_int = 62; ++// pub const SO_TIMESTAMP_NEW: c_int = 63; ++// pub const SO_TIMESTAMPNS_NEW: c_int = 64; ++// pub const SO_TIMESTAMPING_NEW: c_int = 65; ++// pub const SO_RCVTIMEO_NEW: c_int = 66; ++// pub const SO_SNDTIMEO_NEW: c_int = 67; ++// pub const SO_DETACH_REUSEPORT_BPF: c_int = 68; ++// pub const SO_PREFER_BUSY_POLL: c_int = 69; ++// pub const SO_BUSY_POLL_BUDGET: c_int = 70; ++ ++pub const FICLONE: c_ulong = 0x80049409; ++pub const FICLONERANGE: c_ulong = 0x8020940D; ++ ++// Defined in unix/linux_like/mod.rs ++// pub const SCM_TIMESTAMP: c_int = SO_TIMESTAMP; ++pub const SCM_TIMESTAMPNS: c_int = SO_TIMESTAMPNS; ++pub const SCM_TIMESTAMPING: c_int = SO_TIMESTAMPING; ++ ++// Ioctl Constants ++ ++cfg_if! { ++ if #[cfg(target_env = "gnu")] { ++ pub const TCGETS: Ioctl = 0x403c7413; ++ pub const TCSETS: Ioctl = 0x803c7414; ++ pub const TCSETSW: Ioctl = 0x803c7415; ++ pub const TCSETSF: Ioctl = 0x803c7416; ++ } else if #[cfg(target_env = "musl")] { ++ pub const TCGETS: Ioctl = 0x402c7413; ++ pub const TCSETS: Ioctl = 0x802c7414; ++ pub const TCSETSW: Ioctl = 0x802c7415; ++ pub const TCSETSF: Ioctl = 0x802c7416; ++ } ++} ++ ++pub const TCGETA: Ioctl = 0x40147417; ++pub const TCSETA: Ioctl = 0x80147418; ++pub const TCSETAW: Ioctl = 0x80147419; ++pub const TCSETAF: Ioctl = 0x8014741C; ++pub const TCSBRK: Ioctl = 0x2000741D; ++pub const TCXONC: Ioctl = 0x2000741E; ++pub const TCFLSH: Ioctl = 0x2000741F; ++pub const TIOCEXCL: Ioctl = 0x540C; ++pub const TIOCNXCL: Ioctl = 0x540D; ++pub const TIOCSCTTY: Ioctl = 0x540E; ++pub const TIOCGPGRP: Ioctl = 0x40047477; ++pub const TIOCSPGRP: Ioctl = 0x80047476; ++pub const TIOCOUTQ: Ioctl = 0x40047473; ++pub const TIOCSTI: Ioctl = 0x5412; ++pub const TIOCGWINSZ: Ioctl = 0x40087468; ++pub const TIOCSWINSZ: Ioctl = 0x80087467; ++pub const TIOCMGET: Ioctl = 0x5415; ++pub const TIOCMBIS: Ioctl = 0x5416; ++pub const TIOCMBIC: Ioctl = 0x5417; ++pub const TIOCMSET: Ioctl = 0x5418; ++pub const TIOCGSOFTCAR: Ioctl = 0x5419; ++pub const TIOCSSOFTCAR: Ioctl = 0x541A; ++pub const FIONREAD: Ioctl = 0x4004667F; ++pub const TIOCINQ: Ioctl = FIONREAD; ++pub const TIOCLINUX: Ioctl = 0x541C; ++pub const TIOCCONS: Ioctl = 0x541D; ++pub const TIOCGSERIAL: Ioctl = 0x541E; ++pub const TIOCSSERIAL: Ioctl = 0x541F; ++pub const TIOCPKT: Ioctl = 0x5420; ++pub const FIONBIO: Ioctl = 0x8004667e; ++pub const TIOCNOTTY: Ioctl = 0x5422; ++pub const TIOCSETD: Ioctl = 0x5423; ++pub const TIOCGETD: Ioctl = 0x5424; ++pub const TCSBRKP: Ioctl = 0x5425; ++pub const TIOCSBRK: Ioctl = 0x5427; ++pub const TIOCCBRK: Ioctl = 0x5428; ++pub const TIOCGSID: Ioctl = 0x5429; ++pub const TIOCGRS485: Ioctl = 0x542e; ++pub const TIOCSRS485: Ioctl = 0x542f; ++pub const TIOCGPTN: Ioctl = 0x40045430; ++pub const TIOCSPTLCK: Ioctl = 0x80045431; ++pub const TIOCGDEV: Ioctl = 0x40045432; ++pub const TIOCSIG: Ioctl = 0x80045436; ++pub const TIOCVHANGUP: Ioctl = 0x5437; ++pub const TIOCGPKT: Ioctl = 0x40045438; ++pub const TIOCGPTLCK: Ioctl = 0x40045439; ++pub const TIOCGEXCL: Ioctl = 0x40045440; ++pub const TIOCGPTPEER: Ioctl = 0x20005441; ++//pub const TIOCGISO7816: Ioctl = 0x40285442; ++//pub const TIOCSISO7816: Ioctl = 0xc0285443; ++pub const FIONCLEX: Ioctl = 0x20006602; ++pub const FIOCLEX: Ioctl = 0x20006601; ++pub const FIOASYNC: Ioctl = 0x8004667d; ++pub const TIOCSERCONFIG: Ioctl = 0x5453; ++pub const TIOCSERGWILD: Ioctl = 0x5454; ++pub const TIOCSERSWILD: Ioctl = 0x5455; ++pub const TIOCGLCKTRMIOS: Ioctl = 0x5456; ++pub const TIOCSLCKTRMIOS: Ioctl = 0x5457; ++pub const TIOCSERGSTRUCT: Ioctl = 0x5458; ++pub const TIOCSERGETLSR: Ioctl = 0x5459; ++pub const TIOCSERGETMULTI: Ioctl = 0x545A; ++pub const TIOCSERSETMULTI: Ioctl = 0x545B; ++pub const TIOCMIWAIT: Ioctl = 0x545C; ++pub const TIOCGICOUNT: Ioctl = 0x545D; ++pub const BLKIOMIN: Ioctl = 0x20001278; ++pub const BLKIOOPT: Ioctl = 0x20001279; ++pub const BLKSSZGET: Ioctl = 0x20001268; ++pub const BLKPBSZGET: Ioctl = 0x2000127B; ++//pub const FIOQSIZE: Ioctl = 0x40086680; ++// linux/if_tun.h ++pub const TUNSETNOCSUM: Ioctl = 0x800454c8; ++pub const TUNSETDEBUG: Ioctl = 0x800454c9; ++pub const TUNSETIFF: Ioctl = 0x800454ca; ++pub const TUNSETPERSIST: Ioctl = 0x800454cb; ++pub const TUNSETOWNER: Ioctl = 0x800454cc; ++pub const TUNSETLINK: Ioctl = 0x800454cd; ++pub const TUNSETGROUP: Ioctl = 0x800454ce; ++pub const TUNGETFEATURES: Ioctl = 0x400454cf; ++pub const TUNSETOFFLOAD: Ioctl = 0x800454d0; ++pub const TUNSETTXFILTER: Ioctl = 0x800454d1; ++pub const TUNGETIFF: Ioctl = 0x400454d2; ++pub const TUNGETSNDBUF: Ioctl = 0x400454d3; ++pub const TUNSETSNDBUF: Ioctl = 0x800454d4; ++pub const TUNGETVNETHDRSZ: Ioctl = 0x400454d7; ++pub const TUNSETVNETHDRSZ: Ioctl = 0x800454d8; ++pub const TUNSETQUEUE: Ioctl = 0x800454d9; ++pub const TUNSETIFINDEX: Ioctl = 0x800454da; ++pub const TUNSETVNETLE: Ioctl = 0x800454dc; ++pub const TUNGETVNETLE: Ioctl = 0x400454dd; ++/* The TUNSETVNETBE and TUNGETVNETBE ioctls are for cross-endian support on ++ * little-endian hosts. Not all kernel configurations support them, but all ++ * configurations that support SET also support GET. ++ */ ++pub const TUNSETVNETBE: Ioctl = 0x800454de; ++pub const TUNGETVNETBE: Ioctl = 0x400454df; ++pub const TUNSETSTEERINGEBPF: Ioctl = 0x400454e0; ++pub const TUNSETFILTEREBPF: Ioctl = 0x400454e1; ++ ++cfg_if! { ++ // Those type are constructed using the _IOC macro ++ // DD-SS_SSSS_SSSS_SSSS-TTTT_TTTT-NNNN_NNNN ++ // where D stands for direction (either None (00), Read (01) or Write (11)) ++ // where S stands for size (int, long, struct...) ++ // where T stands for type ('f','v','X'...) ++ // where N stands for NR (NumbeR) ++ if #[cfg(target_arch = "powerpc")] { ++ pub const FS_IOC_GETFLAGS: Ioctl = 0x40046601; ++ pub const FS_IOC_SETFLAGS: Ioctl = 0x80046602; ++ pub const FS_IOC_GETVERSION: Ioctl = 0x40047601; ++ pub const FS_IOC_SETVERSION: Ioctl = 0x80047602; ++ pub const FS_IOC32_GETFLAGS: Ioctl = 0x40046601; ++ pub const FS_IOC32_SETFLAGS: Ioctl = 0x80046602; ++ pub const FS_IOC32_GETVERSION: Ioctl = 0x40047601; ++ pub const FS_IOC32_SETVERSION: Ioctl = 0x80047602; ++ pub const TUNATTACHFILTER: Ioctl = 0x800854d5; ++ pub const TUNDETACHFILTER: Ioctl = 0x800854d6; ++ pub const TUNGETFILTER: Ioctl = 0x400854db; ++ } else if #[cfg(target_arch = "powerpc64")] { ++ pub const FS_IOC_GETFLAGS: Ioctl = 0x40086601; ++ pub const FS_IOC_SETFLAGS: Ioctl = 0x80086602; ++ pub const FS_IOC_GETVERSION: Ioctl = 0x40087601; ++ pub const FS_IOC_SETVERSION: Ioctl = 0x80087602; ++ pub const FS_IOC32_GETFLAGS: Ioctl = 0x40046601; ++ pub const FS_IOC32_SETFLAGS: Ioctl = 0x80046602; ++ pub const FS_IOC32_GETVERSION: Ioctl = 0x40047601; ++ pub const FS_IOC32_SETVERSION: Ioctl = 0x80047602; ++ pub const TUNATTACHFILTER: Ioctl = 0x801054d5; ++ pub const TUNDETACHFILTER: Ioctl = 0x801054d6; ++ pub const TUNGETFILTER: Ioctl = 0x401054db; ++ } ++} ++ ++pub const TIOCM_LE: c_int = 0x001; ++pub const TIOCM_DTR: c_int = 0x002; ++pub const TIOCM_RTS: c_int = 0x004; ++pub const TIOCM_ST: c_int = 0x008; ++pub const TIOCM_SR: c_int = 0x010; ++pub const TIOCM_CTS: c_int = 0x020; ++pub const TIOCM_CAR: c_int = 0x040; ++pub const TIOCM_CD: c_int = TIOCM_CAR; ++pub const TIOCM_RNG: c_int = 0x080; ++pub const TIOCM_RI: c_int = TIOCM_RNG; ++pub const TIOCM_DSR: c_int = 0x100; ++ ++pub const BOTHER: crate::speed_t = 0o0037; ++pub const IBSHIFT: crate::tcflag_t = 16; ++ ++// RLIMIT Constants ++ ++cfg_if! { ++ if #[cfg(target_env = "gnu")] { ++ pub const RLIMIT_CPU: crate::__rlimit_resource_t = 0; ++ pub const RLIMIT_FSIZE: crate::__rlimit_resource_t = 1; ++ pub const RLIMIT_DATA: crate::__rlimit_resource_t = 2; ++ pub const RLIMIT_STACK: crate::__rlimit_resource_t = 3; ++ pub const RLIMIT_CORE: crate::__rlimit_resource_t = 4; ++ pub const RLIMIT_RSS: crate::__rlimit_resource_t = 5; ++ pub const RLIMIT_NPROC: crate::__rlimit_resource_t = 6; ++ pub const RLIMIT_NOFILE: crate::__rlimit_resource_t = 7; ++ pub const RLIMIT_MEMLOCK: crate::__rlimit_resource_t = 8; ++ pub const RLIMIT_AS: crate::__rlimit_resource_t = 9; ++ pub const RLIMIT_LOCKS: crate::__rlimit_resource_t = 10; ++ pub const RLIMIT_SIGPENDING: crate::__rlimit_resource_t = 11; ++ pub const RLIMIT_MSGQUEUE: crate::__rlimit_resource_t = 12; ++ pub const RLIMIT_NICE: crate::__rlimit_resource_t = 13; ++ pub const RLIMIT_RTPRIO: crate::__rlimit_resource_t = 14; ++ pub const RLIMIT_RTTIME: crate::__rlimit_resource_t = 15; ++ #[deprecated(since = "0.2.64", note = "Not stable across OS versions")] ++ pub const RLIM_NLIMITS: crate::__rlimit_resource_t = 16; ++ #[allow(deprecated)] ++ #[deprecated(since = "0.2.64", note = "Not stable across OS versions")] ++ pub const RLIMIT_NLIMITS: crate::__rlimit_resource_t = RLIM_NLIMITS; ++ } else if #[cfg(target_env = "musl")] { ++ pub const RLIMIT_CPU: c_int = 0; ++ pub const RLIMIT_FSIZE: c_int = 1; ++ pub const RLIMIT_DATA: c_int = 2; ++ pub const RLIMIT_STACK: c_int = 3; ++ pub const RLIMIT_CORE: c_int = 4; ++ pub const RLIMIT_RSS: c_int = 5; ++ pub const RLIMIT_NPROC: c_int = 6; ++ pub const RLIMIT_NOFILE: c_int = 7; ++ pub const RLIMIT_MEMLOCK: c_int = 8; ++ pub const RLIMIT_AS: c_int = 9; ++ pub const RLIMIT_LOCKS: c_int = 10; ++ pub const RLIMIT_SIGPENDING: c_int = 11; ++ pub const RLIMIT_MSGQUEUE: c_int = 12; ++ pub const RLIMIT_NICE: c_int = 13; ++ pub const RLIMIT_RTPRIO: c_int = 14; ++ pub const RLIMIT_RTTIME: c_int = 15; ++ #[deprecated(since = "0.2.64", note = "Not stable across OS versions")] ++ pub const RLIM_NLIMITS: c_int = 15; ++ #[allow(deprecated)] ++ #[deprecated(since = "0.2.64", note = "Not stable across OS versions")] ++ pub const RLIMIT_NLIMITS: c_int = RLIM_NLIMITS; ++ } ++} ++pub const RLIM_INFINITY: crate::rlim_t = !0; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/arch/sparc/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/arch/sparc/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/arch/sparc/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/arch/sparc/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,297 @@ ++use crate::prelude::*; ++use crate::Ioctl; ++ ++s! { ++ pub struct termios2 { ++ pub c_iflag: crate::tcflag_t, ++ pub c_oflag: crate::tcflag_t, ++ pub c_cflag: crate::tcflag_t, ++ pub c_lflag: crate::tcflag_t, ++ pub c_line: crate::cc_t, ++ pub c_cc: [crate::cc_t; 19], ++ pub c_ispeed: crate::speed_t, ++ pub c_ospeed: crate::speed_t, ++ } ++} ++ ++// arch/sparc/include/uapi/asm/socket.h ++pub const SOL_SOCKET: c_int = 0xffff; ++ ++// Defined in unix/linux_like/mod.rs ++// pub const SO_DEBUG: c_int = 0x0001; ++pub const SO_PASSCRED: c_int = 0x0002; ++pub const SO_REUSEADDR: c_int = 0x0004; ++pub const SO_KEEPALIVE: c_int = 0x0008; ++pub const SO_DONTROUTE: c_int = 0x0010; ++pub const SO_BROADCAST: c_int = 0x0020; ++pub const SO_PEERCRED: c_int = 0x0040; ++pub const SO_LINGER: c_int = 0x0080; ++pub const SO_OOBINLINE: c_int = 0x0100; ++pub const SO_REUSEPORT: c_int = 0x0200; ++pub const SO_BSDCOMPAT: c_int = 0x0400; ++pub const SO_RCVLOWAT: c_int = 0x0800; ++pub const SO_SNDLOWAT: c_int = 0x1000; ++pub const SO_RCVTIMEO: c_int = 0x2000; ++pub const SO_SNDTIMEO: c_int = 0x4000; ++// pub const SO_RCVTIMEO_OLD: c_int = 0x2000; ++// pub const SO_SNDTIMEO_OLD: c_int = 0x4000; ++pub const SO_ACCEPTCONN: c_int = 0x8000; ++pub const SO_SNDBUF: c_int = 0x1001; ++pub const SO_RCVBUF: c_int = 0x1002; ++pub const SO_SNDBUFFORCE: c_int = 0x100a; ++pub const SO_RCVBUFFORCE: c_int = 0x100b; ++pub const SO_ERROR: c_int = 0x1007; ++pub const SO_TYPE: c_int = 0x1008; ++pub const SO_PROTOCOL: c_int = 0x1028; ++pub const SO_DOMAIN: c_int = 0x1029; ++pub const SO_NO_CHECK: c_int = 0x000b; ++pub const SO_PRIORITY: c_int = 0x000c; ++pub const SO_BINDTODEVICE: c_int = 0x000d; ++pub const SO_ATTACH_FILTER: c_int = 0x001a; ++pub const SO_DETACH_FILTER: c_int = 0x001b; ++pub const SO_GET_FILTER: c_int = SO_ATTACH_FILTER; ++pub const SO_PEERNAME: c_int = 0x001c; ++pub const SO_PEERSEC: c_int = 0x001e; ++pub const SO_PASSSEC: c_int = 0x001f; ++pub const SO_MARK: c_int = 0x0022; ++pub const SO_RXQ_OVFL: c_int = 0x0024; ++pub const SO_WIFI_STATUS: c_int = 0x0025; ++pub const SCM_WIFI_STATUS: c_int = SO_WIFI_STATUS; ++pub const SO_PEEK_OFF: c_int = 0x0026; ++pub const SO_NOFCS: c_int = 0x0027; ++pub const SO_LOCK_FILTER: c_int = 0x0028; ++pub const SO_SELECT_ERR_QUEUE: c_int = 0x0029; ++pub const SO_BUSY_POLL: c_int = 0x0030; ++pub const SO_MAX_PACING_RATE: c_int = 0x0031; ++pub const SO_BPF_EXTENSIONS: c_int = 0x0032; ++pub const SO_INCOMING_CPU: c_int = 0x0033; ++pub const SO_ATTACH_BPF: c_int = 0x0034; ++pub const SO_DETACH_BPF: c_int = SO_DETACH_FILTER; ++pub const SO_ATTACH_REUSEPORT_CBPF: c_int = 0x0035; ++pub const SO_ATTACH_REUSEPORT_EBPF: c_int = 0x0036; ++pub const SO_CNX_ADVICE: c_int = 0x0037; ++pub const SCM_TIMESTAMPING_OPT_STATS: c_int = 0x0038; ++pub const SO_MEMINFO: c_int = 0x0039; ++pub const SO_INCOMING_NAPI_ID: c_int = 0x003a; ++pub const SO_COOKIE: c_int = 0x003b; ++pub const SCM_TIMESTAMPING_PKTINFO: c_int = 0x003c; ++pub const SO_PEERGROUPS: c_int = 0x003d; ++pub const SO_ZEROCOPY: c_int = 0x003e; ++pub const SO_TXTIME: c_int = 0x003f; ++pub const SCM_TXTIME: c_int = SO_TXTIME; ++pub const SO_BINDTOIFINDEX: c_int = 0x0041; ++pub const SO_SECURITY_AUTHENTICATION: c_int = 0x5001; ++pub const SO_SECURITY_ENCRYPTION_TRANSPORT: c_int = 0x5002; ++pub const SO_SECURITY_ENCRYPTION_NETWORK: c_int = 0x5004; ++pub const SO_TIMESTAMP: c_int = 0x001d; ++pub const SO_TIMESTAMPNS: c_int = 0x0021; ++pub const SO_TIMESTAMPING: c_int = 0x0023; ++// pub const SO_TIMESTAMP_OLD: c_int = 0x001d; ++// pub const SO_TIMESTAMPNS_OLD: c_int = 0x0021; ++// pub const SO_TIMESTAMPING_OLD: c_int = 0x0023; ++// pub const SO_TIMESTAMP_NEW: c_int = 0x0046; ++// pub const SO_TIMESTAMPNS_NEW: c_int = 0x0042; ++// pub const SO_TIMESTAMPING_NEW: c_int = 0x0043; ++// pub const SO_RCVTIMEO_NEW: c_int = 0x0044; ++// pub const SO_SNDTIMEO_NEW: c_int = 0x0045; ++// pub const SO_DETACH_REUSEPORT_BPF: c_int = 0x0047; ++// pub const SO_PREFER_BUSY_POLL: c_int = 0x0048; ++// pub const SO_BUSY_POLL_BUDGET: c_int = 0x0049; ++ ++// Defined in unix/linux_like/mod.rs ++// pub const SCM_TIMESTAMP: c_int = SO_TIMESTAMP; ++pub const SCM_TIMESTAMPNS: c_int = SO_TIMESTAMPNS; ++pub const SCM_TIMESTAMPING: c_int = SO_TIMESTAMPING; ++ ++// Ioctl Constants ++ ++pub const TCGETS: Ioctl = 0x40245408; ++pub const TCSETS: Ioctl = 0x80245409; ++pub const TCSETSW: Ioctl = 0x8024540a; ++pub const TCSETSF: Ioctl = 0x8024540b; ++pub const TCGETA: Ioctl = 0x40125401; ++pub const TCSETA: Ioctl = 0x80125402; ++pub const TCSETAW: Ioctl = 0x80125403; ++pub const TCSETAF: Ioctl = 0x80125404; ++pub const TCSBRK: Ioctl = 0x20005405; ++pub const TCXONC: Ioctl = 0x20005406; ++pub const TCFLSH: Ioctl = 0x20005407; ++pub const TIOCEXCL: Ioctl = 0x2000740d; ++pub const TIOCNXCL: Ioctl = 0x2000740e; ++pub const TIOCSCTTY: Ioctl = 0x20007484; ++pub const TIOCGPGRP: Ioctl = 0x40047483; ++pub const TIOCSPGRP: Ioctl = 0x80047482; ++pub const TIOCOUTQ: Ioctl = 0x40047473; ++pub const TIOCSTI: Ioctl = 0x80017472; ++pub const TIOCGWINSZ: Ioctl = 0x40087468; ++pub const TIOCSWINSZ: Ioctl = 0x80087467; ++pub const TIOCMGET: Ioctl = 0x4004746a; ++pub const TIOCMBIS: Ioctl = 0x8004746c; ++pub const TIOCMBIC: Ioctl = 0x8004746b; ++pub const TIOCMSET: Ioctl = 0x8004746d; ++pub const TIOCGSOFTCAR: Ioctl = 0x40047464; ++pub const TIOCSSOFTCAR: Ioctl = 0x80047465; ++pub const FIONREAD: Ioctl = 0x4004667f; ++pub const TIOCINQ: Ioctl = FIONREAD; ++pub const TIOCLINUX: Ioctl = 0x541C; ++pub const TIOCCONS: Ioctl = 0x20007424; ++pub const TIOCGSERIAL: Ioctl = 0x541E; ++pub const TIOCSSERIAL: Ioctl = 0x541F; ++pub const TIOCPKT: Ioctl = 0x80047470; ++pub const FIONBIO: Ioctl = 0x8004667e; ++pub const TIOCNOTTY: Ioctl = 0x20007471; ++pub const TIOCSETD: Ioctl = 0x80047401; ++pub const TIOCGETD: Ioctl = 0x40047400; ++pub const TCSBRKP: Ioctl = 0x5425; ++pub const TIOCSBRK: Ioctl = 0x2000747b; ++pub const TIOCCBRK: Ioctl = 0x2000747a; ++pub const TIOCGSID: Ioctl = 0x40047485; ++pub const TCGETS2: Ioctl = 0x402c540c; ++pub const TCSETS2: Ioctl = 0x802c540d; ++pub const TCSETSW2: Ioctl = 0x802c540e; ++pub const TCSETSF2: Ioctl = 0x802c540f; ++pub const TIOCGPTN: Ioctl = 0x40047486; ++pub const TIOCSPTLCK: Ioctl = 0x80047487; ++pub const TIOCGDEV: Ioctl = 0x40045432; ++pub const TIOCSIG: Ioctl = 0x80047488; ++pub const TIOCVHANGUP: Ioctl = 0x20005437; ++pub const TIOCGPKT: Ioctl = 0x40045438; ++pub const TIOCGPTLCK: Ioctl = 0x40045439; ++pub const TIOCGEXCL: Ioctl = 0x40045440; ++pub const TIOCGPTPEER: Ioctl = 0x20007489; ++pub const FIONCLEX: Ioctl = 0x20006602; ++pub const FIOCLEX: Ioctl = 0x20006601; ++pub const TIOCSERCONFIG: Ioctl = 0x5453; ++pub const TIOCSERGWILD: Ioctl = 0x5454; ++pub const TIOCSERSWILD: Ioctl = 0x5455; ++pub const TIOCGLCKTRMIOS: Ioctl = 0x5456; ++pub const TIOCSLCKTRMIOS: Ioctl = 0x5457; ++pub const TIOCSERGSTRUCT: Ioctl = 0x5458; ++pub const TIOCSERGETLSR: Ioctl = 0x5459; ++pub const TIOCSERGETMULTI: Ioctl = 0x545A; ++pub const TIOCSERSETMULTI: Ioctl = 0x545B; ++pub const TIOCMIWAIT: Ioctl = 0x545C; ++pub const TIOCGICOUNT: Ioctl = 0x545D; ++pub const TIOCSTART: Ioctl = 0x2000746e; ++pub const TIOCSTOP: Ioctl = 0x2000746f; ++pub const BLKIOMIN: Ioctl = 0x20001278; ++pub const BLKIOOPT: Ioctl = 0x20001279; ++pub const BLKSSZGET: Ioctl = 0x20001268; ++pub const BLKPBSZGET: Ioctl = 0x2000127B; ++ ++//pub const FIOASYNC: Ioctl = 0x4004667d; ++//pub const FIOQSIZE: Ioctl = ; ++//pub const TIOCGISO7816: Ioctl = 0x40285443; ++//pub const TIOCSISO7816: Ioctl = 0xc0285444; ++//pub const TIOCGRS485: Ioctl = 0x40205441; ++//pub const TIOCSRS485: Ioctl = 0xc0205442; ++ ++// linux/if_tun.h ++pub const TUNSETNOCSUM: Ioctl = 0x800454c8; ++pub const TUNSETDEBUG: Ioctl = 0x800454c9; ++pub const TUNSETIFF: Ioctl = 0x800454ca; ++pub const TUNSETPERSIST: Ioctl = 0x800454cb; ++pub const TUNSETOWNER: Ioctl = 0x800454cc; ++pub const TUNSETLINK: Ioctl = 0x800454cd; ++pub const TUNSETGROUP: Ioctl = 0x800454ce; ++pub const TUNGETFEATURES: Ioctl = 0x400454cf; ++pub const TUNSETOFFLOAD: Ioctl = 0x800454d0; ++pub const TUNSETTXFILTER: Ioctl = 0x800454d1; ++pub const TUNGETIFF: Ioctl = 0x400454d2; ++pub const TUNGETSNDBUF: Ioctl = 0x400454d3; ++pub const TUNSETSNDBUF: Ioctl = 0x800454d4; ++pub const TUNGETVNETHDRSZ: Ioctl = 0x400454d7; ++pub const TUNSETVNETHDRSZ: Ioctl = 0x800454d8; ++pub const TUNSETQUEUE: Ioctl = 0x800454d9; ++pub const TUNSETIFINDEX: Ioctl = 0x800454da; ++pub const TUNSETVNETLE: Ioctl = 0x800454dc; ++pub const TUNGETVNETLE: Ioctl = 0x400454dd; ++/* The TUNSETVNETBE and TUNGETVNETBE ioctls are for cross-endian support on ++ * little-endian hosts. Not all kernel configurations support them, but all ++ * configurations that support SET also support GET. ++ */ ++pub const TUNSETVNETBE: Ioctl = 0x800454de; ++pub const TUNGETVNETBE: Ioctl = 0x400454df; ++pub const TUNSETSTEERINGEBPF: Ioctl = 0x400454e0; ++pub const TUNSETFILTEREBPF: Ioctl = 0x400454e1; ++ ++pub const TIOCM_LE: c_int = 0x001; ++pub const TIOCM_DTR: c_int = 0x002; ++pub const TIOCM_RTS: c_int = 0x004; ++pub const TIOCM_ST: c_int = 0x008; ++pub const TIOCM_SR: c_int = 0x010; ++pub const TIOCM_CTS: c_int = 0x020; ++pub const TIOCM_CAR: c_int = 0x040; ++pub const TIOCM_CD: c_int = TIOCM_CAR; ++pub const TIOCM_RNG: c_int = 0x080; ++pub const TIOCM_RI: c_int = TIOCM_RNG; ++pub const TIOCM_DSR: c_int = 0x100; ++ ++pub const BOTHER: crate::speed_t = 0x1000; ++pub const IBSHIFT: crate::tcflag_t = 16; ++ ++// RLIMIT Constants ++ ++pub const RLIMIT_CPU: crate::__rlimit_resource_t = 0; ++pub const RLIMIT_FSIZE: crate::__rlimit_resource_t = 1; ++pub const RLIMIT_DATA: crate::__rlimit_resource_t = 2; ++pub const RLIMIT_STACK: crate::__rlimit_resource_t = 3; ++pub const RLIMIT_CORE: crate::__rlimit_resource_t = 4; ++pub const RLIMIT_RSS: crate::__rlimit_resource_t = 5; ++pub const RLIMIT_NOFILE: crate::__rlimit_resource_t = 6; ++pub const RLIMIT_NPROC: crate::__rlimit_resource_t = 7; ++pub const RLIMIT_MEMLOCK: crate::__rlimit_resource_t = 8; ++pub const RLIMIT_AS: crate::__rlimit_resource_t = 9; ++pub const RLIMIT_LOCKS: crate::__rlimit_resource_t = 10; ++pub const RLIMIT_SIGPENDING: crate::__rlimit_resource_t = 11; ++pub const RLIMIT_MSGQUEUE: crate::__rlimit_resource_t = 12; ++pub const RLIMIT_NICE: crate::__rlimit_resource_t = 13; ++pub const RLIMIT_RTPRIO: crate::__rlimit_resource_t = 14; ++pub const RLIMIT_RTTIME: crate::__rlimit_resource_t = 15; ++#[deprecated(since = "0.2.64", note = "Not stable across OS versions")] ++pub const RLIM_NLIMITS: crate::__rlimit_resource_t = 16; ++#[allow(deprecated)] ++#[deprecated(since = "0.2.64", note = "Not stable across OS versions")] ++pub const RLIMIT_NLIMITS: crate::__rlimit_resource_t = RLIM_NLIMITS; ++ ++cfg_if! { ++ if #[cfg(target_arch = "sparc64")] { ++ pub const RLIM_INFINITY: crate::rlim_t = !0; ++ } else if #[cfg(target_arch = "sparc")] { ++ pub const RLIM_INFINITY: crate::rlim_t = 0x7fffffff; ++ } ++} ++ ++cfg_if! { ++ // Those type are constructed using the _IOC macro ++ // DD-SS_SSSS_SSSS_SSSS-TTTT_TTTT-NNNN_NNNN ++ // where D stands for direction (either None (00), Read (01) or Write (11)) ++ // where S stands for size (int, long, struct...) ++ // where T stands for type ('f','v','X'...) ++ // where N stands for NR (NumbeR) ++ if #[cfg(target_arch = "sparc")] { ++ pub const FS_IOC_GETFLAGS: Ioctl = 0x40046601; ++ pub const FS_IOC_SETFLAGS: Ioctl = 0x80046602; ++ pub const FS_IOC_GETVERSION: Ioctl = 0x40047601; ++ pub const FS_IOC_SETVERSION: Ioctl = 0x80047602; ++ pub const FS_IOC32_GETFLAGS: Ioctl = 0x40046601; ++ pub const FS_IOC32_SETFLAGS: Ioctl = 0x80046602; ++ pub const FS_IOC32_GETVERSION: Ioctl = 0x40047601; ++ pub const FS_IOC32_SETVERSION: Ioctl = 0x80047602; ++ pub const TUNATTACHFILTER: Ioctl = 0x800854d5; ++ pub const TUNDETACHFILTER: Ioctl = 0x800854d6; ++ pub const TUNGETFILTER: Ioctl = 0x400854db; ++ } else if #[cfg(target_arch = "sparc64")] { ++ pub const FS_IOC_GETFLAGS: Ioctl = 0x40086601; ++ pub const FS_IOC_SETFLAGS: Ioctl = 0x80086602; ++ pub const FS_IOC_GETVERSION: Ioctl = 0x40087601; ++ pub const FS_IOC_SETVERSION: Ioctl = 0x80087602; ++ pub const FS_IOC32_GETFLAGS: Ioctl = 0x40046601; ++ pub const FS_IOC32_SETFLAGS: Ioctl = 0x80046602; ++ pub const FS_IOC32_GETVERSION: Ioctl = 0x40047601; ++ pub const FS_IOC32_SETVERSION: Ioctl = 0x80047602; ++ pub const TUNATTACHFILTER: Ioctl = 0x801054d5; ++ pub const TUNDETACHFILTER: Ioctl = 0x801054d6; ++ pub const TUNGETFILTER: Ioctl = 0x401054db; ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/arm/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/arm/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/arm/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/arm/mod.rs 2024-12-28 15:35:00.000000000 -0500 +@@ -0,0 +1,878 @@ ++use crate::prelude::*; ++use crate::{off64_t, off_t}; ++ ++pub type c_char = u8; ++pub type wchar_t = u32; ++ ++s! { ++ pub struct sigaction { ++ pub sa_sigaction: crate::sighandler_t, ++ pub sa_mask: crate::sigset_t, ++ pub sa_flags: c_int, ++ pub sa_restorer: Option, ++ } ++ ++ pub struct statfs { ++ pub f_type: crate::__fsword_t, ++ pub f_bsize: crate::__fsword_t, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_fsid: crate::fsid_t, ++ ++ pub f_namelen: crate::__fsword_t, ++ pub f_frsize: crate::__fsword_t, ++ pub f_flags: crate::__fsword_t, ++ f_spare: [crate::__fsword_t; 4], ++ } ++ ++ pub struct flock { ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ pub l_start: off_t, ++ pub l_len: off_t, ++ pub l_pid: crate::pid_t, ++ } ++ ++ pub struct flock64 { ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ pub l_start: off64_t, ++ pub l_len: off64_t, ++ pub l_pid: crate::pid_t, ++ } ++ ++ pub struct ipc_perm { ++ pub __key: crate::key_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub cuid: crate::uid_t, ++ pub cgid: crate::gid_t, ++ pub mode: c_ushort, ++ __pad1: c_ushort, ++ pub __seq: c_ushort, ++ __pad2: c_ushort, ++ __unused1: c_ulong, ++ __unused2: c_ulong, ++ } ++ ++ ++ ++ ++ pub struct shmid_ds { ++ pub shm_perm: crate::ipc_perm, ++ pub shm_segsz: size_t, ++ pub shm_atime: crate::time_t, ++ #[cfg(not(gnu_time64_abi))] ++ __unused1: c_ulong, ++ pub shm_dtime: crate::time_t, ++ #[cfg(not(gnu_time64_abi))] ++ __unused2: c_ulong, ++ pub shm_ctime: crate::time_t, ++ #[cfg(not(gnu_time64_abi))] ++ __unused3: c_ulong, ++ pub shm_cpid: crate::pid_t, ++ pub shm_lpid: crate::pid_t, ++ pub shm_nattch: crate::shmatt_t, ++ __unused4: c_ulong, ++ __unused5: c_ulong, ++ } ++ ++ pub struct msqid_ds { ++ pub msg_perm: crate::ipc_perm, ++ pub msg_stime: crate::time_t, ++ #[cfg(not(gnu_time64_abi))] ++ __glibc_reserved1: c_ulong, ++ pub msg_rtime: crate::time_t, ++ #[cfg(not(gnu_time64_abi))] ++ __glibc_reserved2: c_ulong, ++ pub msg_ctime: crate::time_t, ++ #[cfg(not(gnu_time64_abi))] ++ __glibc_reserved3: c_ulong, ++ __msg_cbytes: c_ulong, ++ pub msg_qnum: crate::msgqnum_t, ++ pub msg_qbytes: crate::msglen_t, ++ pub msg_lspid: crate::pid_t, ++ pub msg_lrpid: crate::pid_t, ++ __glibc_reserved4: c_ulong, ++ __glibc_reserved5: c_ulong, ++ } ++ ++ pub struct siginfo_t { ++ pub si_signo: c_int, ++ pub si_errno: c_int, ++ pub si_code: c_int, ++ #[doc(hidden)] ++ #[deprecated( ++ since = "0.2.54", ++ note = "Please leave a comment on \ ++ https://github.com/rust-lang/libc/pull/1316 if you're using \ ++ this field" ++ )] ++ pub _pad: [c_int; 29], ++ _align: [usize; 0], ++ } ++ ++ pub struct stack_t { ++ pub ss_sp: *mut c_void, ++ pub ss_flags: c_int, ++ pub ss_size: size_t, ++ } ++ ++ pub struct mcontext_t { ++ pub trap_no: c_ulong, ++ pub error_code: c_ulong, ++ pub oldmask: c_ulong, ++ pub arm_r0: c_ulong, ++ pub arm_r1: c_ulong, ++ pub arm_r2: c_ulong, ++ pub arm_r3: c_ulong, ++ pub arm_r4: c_ulong, ++ pub arm_r5: c_ulong, ++ pub arm_r6: c_ulong, ++ pub arm_r7: c_ulong, ++ pub arm_r8: c_ulong, ++ pub arm_r9: c_ulong, ++ pub arm_r10: c_ulong, ++ pub arm_fp: c_ulong, ++ pub arm_ip: c_ulong, ++ pub arm_sp: c_ulong, ++ pub arm_lr: c_ulong, ++ pub arm_pc: c_ulong, ++ pub arm_cpsr: c_ulong, ++ pub fault_address: c_ulong, ++ } ++ ++ pub struct user_regs { ++ pub arm_r0: c_ulong, ++ pub arm_r1: c_ulong, ++ pub arm_r2: c_ulong, ++ pub arm_r3: c_ulong, ++ pub arm_r4: c_ulong, ++ pub arm_r5: c_ulong, ++ pub arm_r6: c_ulong, ++ pub arm_r7: c_ulong, ++ pub arm_r8: c_ulong, ++ pub arm_r9: c_ulong, ++ pub arm_r10: c_ulong, ++ pub arm_fp: c_ulong, ++ pub arm_ip: c_ulong, ++ pub arm_sp: c_ulong, ++ pub arm_lr: c_ulong, ++ pub arm_pc: c_ulong, ++ pub arm_cpsr: c_ulong, ++ pub arm_orig_r0: c_ulong, ++ } ++} ++ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ #[repr(align(8))] ++ pub struct max_align_t { ++ priv_: [i64; 2], ++ } ++ ++ #[allow(missing_debug_implementations)] ++ #[repr(align(8))] ++ pub struct ucontext_t { ++ pub uc_flags: c_ulong, ++ pub uc_link: *mut ucontext_t, ++ pub uc_stack: crate::stack_t, ++ pub uc_mcontext: crate::mcontext_t, ++ pub uc_sigmask: crate::sigset_t, ++ pub uc_regspace: [c_ulong; 128], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for ucontext_t { ++ fn eq(&self, other: &ucontext_t) -> bool { ++ self.uc_flags == other.uc_flags ++ && self.uc_link == other.uc_link ++ && self.uc_stack == other.uc_stack ++ && self.uc_mcontext == other.uc_mcontext ++ && self.uc_sigmask == other.uc_sigmask ++ } ++ } ++ impl Eq for ucontext_t {} ++ impl fmt::Debug for ucontext_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("ucontext_t") ++ .field("uc_flags", &self.uc_link) ++ .field("uc_link", &self.uc_link) ++ .field("uc_stack", &self.uc_stack) ++ .field("uc_mcontext", &self.uc_mcontext) ++ .field("uc_sigmask", &self.uc_sigmask) ++ .finish() ++ } ++ } ++ impl hash::Hash for ucontext_t { ++ fn hash(&self, state: &mut H) { ++ self.uc_flags.hash(state); ++ self.uc_link.hash(state); ++ self.uc_stack.hash(state); ++ self.uc_mcontext.hash(state); ++ self.uc_sigmask.hash(state); ++ } ++ } ++ } ++} ++ ++pub const VEOF: usize = 4; ++pub const RTLD_DEEPBIND: c_int = 0x8; ++pub const RTLD_GLOBAL: c_int = 0x100; ++pub const RTLD_NOLOAD: c_int = 0x4; ++pub const O_DIRECT: c_int = 0x10000; ++pub const O_DIRECTORY: c_int = 0x4000; ++pub const O_NOFOLLOW: c_int = 0x8000; ++pub const O_LARGEFILE: c_int = 0o400000; ++pub const O_APPEND: c_int = 1024; ++pub const O_CREAT: c_int = 64; ++pub const O_EXCL: c_int = 128; ++pub const O_NOCTTY: c_int = 256; ++pub const O_NONBLOCK: c_int = 2048; ++pub const O_SYNC: c_int = 1052672; ++pub const O_RSYNC: c_int = 1052672; ++pub const O_DSYNC: c_int = 4096; ++pub const O_FSYNC: c_int = 0x101000; ++pub const O_ASYNC: c_int = 0x2000; ++pub const O_NDELAY: c_int = 0x800; ++ ++pub const MADV_SOFT_OFFLINE: c_int = 101; ++pub const MAP_LOCKED: c_int = 0x02000; ++pub const MAP_NORESERVE: c_int = 0x04000; ++pub const MAP_ANON: c_int = 0x0020; ++pub const MAP_ANONYMOUS: c_int = 0x0020; ++pub const MAP_DENYWRITE: c_int = 0x0800; ++pub const MAP_EXECUTABLE: c_int = 0x01000; ++pub const MAP_POPULATE: c_int = 0x08000; ++pub const MAP_NONBLOCK: c_int = 0x010000; ++pub const MAP_STACK: c_int = 0x020000; ++pub const MAP_HUGETLB: c_int = 0x040000; ++pub const MAP_GROWSDOWN: c_int = 0x0100; ++pub const MAP_SYNC: c_int = 0x080000; ++ ++pub const EDEADLOCK: c_int = 35; ++pub const EUCLEAN: c_int = 117; ++pub const ENOTNAM: c_int = 118; ++pub const ENAVAIL: c_int = 119; ++pub const EISNAM: c_int = 120; ++pub const EREMOTEIO: c_int = 121; ++pub const EDEADLK: c_int = 35; ++pub const ENAMETOOLONG: c_int = 36; ++pub const ENOLCK: c_int = 37; ++pub const ENOSYS: c_int = 38; ++pub const ENOTEMPTY: c_int = 39; ++pub const ELOOP: c_int = 40; ++pub const ENOMSG: c_int = 42; ++pub const EIDRM: c_int = 43; ++pub const ECHRNG: c_int = 44; ++pub const EL2NSYNC: c_int = 45; ++pub const EL3HLT: c_int = 46; ++pub const EL3RST: c_int = 47; ++pub const ELNRNG: c_int = 48; ++pub const EUNATCH: c_int = 49; ++pub const ENOCSI: c_int = 50; ++pub const EL2HLT: c_int = 51; ++pub const EBADE: c_int = 52; ++pub const EBADR: c_int = 53; ++pub const EXFULL: c_int = 54; ++pub const ENOANO: c_int = 55; ++pub const EBADRQC: c_int = 56; ++pub const EBADSLT: c_int = 57; ++pub const EMULTIHOP: c_int = 72; ++pub const EOVERFLOW: c_int = 75; ++pub const ENOTUNIQ: c_int = 76; ++pub const EBADFD: c_int = 77; ++pub const EBADMSG: c_int = 74; ++pub const EREMCHG: c_int = 78; ++pub const ELIBACC: c_int = 79; ++pub const ELIBBAD: c_int = 80; ++pub const ELIBSCN: c_int = 81; ++pub const ELIBMAX: c_int = 82; ++pub const ELIBEXEC: c_int = 83; ++pub const EILSEQ: c_int = 84; ++pub const ERESTART: c_int = 85; ++pub const ESTRPIPE: c_int = 86; ++pub const EUSERS: c_int = 87; ++pub const ENOTSOCK: c_int = 88; ++pub const EDESTADDRREQ: c_int = 89; ++pub const EMSGSIZE: c_int = 90; ++pub const EPROTOTYPE: c_int = 91; ++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 EPFNOSUPPORT: c_int = 96; ++pub const EAFNOSUPPORT: c_int = 97; ++pub const EADDRINUSE: c_int = 98; ++pub const EADDRNOTAVAIL: c_int = 99; ++pub const ENETDOWN: c_int = 100; ++pub const ENETUNREACH: c_int = 101; ++pub const ENETRESET: c_int = 102; ++pub const ECONNABORTED: c_int = 103; ++pub const ECONNRESET: c_int = 104; ++pub const ENOBUFS: c_int = 105; ++pub const EISCONN: c_int = 106; ++pub const ENOTCONN: c_int = 107; ++pub const ESHUTDOWN: c_int = 108; ++pub const ETOOMANYREFS: c_int = 109; ++pub const ETIMEDOUT: c_int = 110; ++pub const ECONNREFUSED: c_int = 111; ++pub const EHOSTDOWN: c_int = 112; ++pub const EHOSTUNREACH: c_int = 113; ++pub const EALREADY: c_int = 114; ++pub const EINPROGRESS: c_int = 115; ++pub const ESTALE: c_int = 116; ++pub const EDQUOT: c_int = 122; ++pub const ENOMEDIUM: c_int = 123; ++pub const EMEDIUMTYPE: c_int = 124; ++pub const ECANCELED: c_int = 125; ++pub const ENOKEY: c_int = 126; ++pub const EKEYEXPIRED: c_int = 127; ++pub const EKEYREVOKED: c_int = 128; ++pub const EKEYREJECTED: c_int = 129; ++pub const EOWNERDEAD: c_int = 130; ++pub const ENOTRECOVERABLE: c_int = 131; ++pub const EHWPOISON: c_int = 133; ++pub const ERFKILL: c_int = 132; ++ ++pub const SA_SIGINFO: c_int = 0x00000004; ++pub const SA_NOCLDWAIT: c_int = 0x00000002; ++ ++pub const SOCK_STREAM: c_int = 1; ++pub const SOCK_DGRAM: c_int = 2; ++ ++pub const MCL_CURRENT: c_int = 0x0001; ++pub const MCL_FUTURE: c_int = 0x0002; ++pub const MCL_ONFAULT: c_int = 0x0004; ++ ++pub const POLLWRNORM: c_short = 0x100; ++pub const POLLWRBAND: c_short = 0x200; ++ ++cfg_if! { ++ if #[cfg(gnu_time64_abi)] { ++ pub const F_GETLK: c_int = 12; ++ } else { ++ pub const F_GETLK: c_int = 5; ++ } ++} ++pub const F_GETOWN: c_int = 9; ++pub const F_SETOWN: c_int = 8; ++ ++pub const EFD_NONBLOCK: c_int = 0x800; ++pub const SFD_NONBLOCK: c_int = 0x0800; ++ ++pub const SIGCHLD: c_int = 17; ++pub const SIGBUS: c_int = 7; ++pub const SIGUSR1: c_int = 10; ++pub const SIGUSR2: c_int = 12; ++pub const SIGCONT: c_int = 18; ++pub const SIGSTOP: c_int = 19; ++pub const SIGTSTP: c_int = 20; ++pub const SIGURG: c_int = 23; ++pub const SIGIO: c_int = 29; ++pub const SIGSYS: c_int = 31; ++pub const SIGSTKFLT: c_int = 16; ++#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")] ++pub const SIGUNUSED: c_int = 31; ++pub const SIGPOLL: c_int = 29; ++pub const SIGPWR: c_int = 30; ++pub const SIG_SETMASK: c_int = 2; ++pub const SIG_BLOCK: c_int = 0x000000; ++pub const SIG_UNBLOCK: c_int = 0x01; ++pub const SIGTTIN: c_int = 21; ++pub const SIGTTOU: c_int = 22; ++pub const SIGXCPU: c_int = 24; ++pub const SIGXFSZ: c_int = 25; ++pub const SIGVTALRM: c_int = 26; ++pub const SIGPROF: c_int = 27; ++pub const SIGWINCH: c_int = 28; ++pub const SIGSTKSZ: size_t = 8192; ++pub const MINSIGSTKSZ: size_t = 2048; ++pub const CBAUD: crate::tcflag_t = 0o0010017; ++pub const TAB1: crate::tcflag_t = 0x00000800; ++pub const TAB2: crate::tcflag_t = 0x00001000; ++pub const TAB3: crate::tcflag_t = 0x00001800; ++pub const CR1: crate::tcflag_t = 0x00000200; ++pub const CR2: crate::tcflag_t = 0x00000400; ++pub const CR3: crate::tcflag_t = 0x00000600; ++pub const FF1: crate::tcflag_t = 0x00008000; ++pub const BS1: crate::tcflag_t = 0x00002000; ++pub const VT1: crate::tcflag_t = 0x00004000; ++pub const VWERASE: usize = 14; ++pub const VREPRINT: usize = 12; ++pub const VSUSP: usize = 10; ++pub const VSTART: usize = 8; ++pub const VSTOP: usize = 9; ++pub const VDISCARD: usize = 13; ++pub const VTIME: usize = 5; ++pub const IXON: crate::tcflag_t = 0x00000400; ++pub const IXOFF: crate::tcflag_t = 0x00001000; ++pub const ONLCR: crate::tcflag_t = 0x4; ++pub const CSIZE: crate::tcflag_t = 0x00000030; ++pub const CS6: crate::tcflag_t = 0x00000010; ++pub const CS7: crate::tcflag_t = 0x00000020; ++pub const CS8: crate::tcflag_t = 0x00000030; ++pub const CSTOPB: crate::tcflag_t = 0x00000040; ++pub const CREAD: crate::tcflag_t = 0x00000080; ++pub const PARENB: crate::tcflag_t = 0x00000100; ++pub const PARODD: crate::tcflag_t = 0x00000200; ++pub const HUPCL: crate::tcflag_t = 0x00000400; ++pub const CLOCAL: crate::tcflag_t = 0x00000800; ++pub const ECHOKE: crate::tcflag_t = 0x00000800; ++pub const ECHOE: crate::tcflag_t = 0x00000010; ++pub const ECHOK: crate::tcflag_t = 0x00000020; ++pub const ECHONL: crate::tcflag_t = 0x00000040; ++pub const ECHOPRT: crate::tcflag_t = 0x00000400; ++pub const ECHOCTL: crate::tcflag_t = 0x00000200; ++pub const ISIG: crate::tcflag_t = 0x00000001; ++pub const ICANON: crate::tcflag_t = 0x00000002; ++pub const PENDIN: crate::tcflag_t = 0x00004000; ++pub const NOFLSH: crate::tcflag_t = 0x00000080; ++pub const CIBAUD: crate::tcflag_t = 0o02003600000; ++pub const CBAUDEX: crate::tcflag_t = 0o010000; ++pub const VSWTC: usize = 7; ++pub const OLCUC: crate::tcflag_t = 0o000002; ++pub const NLDLY: crate::tcflag_t = 0o000400; ++pub const CRDLY: crate::tcflag_t = 0o003000; ++pub const TABDLY: crate::tcflag_t = 0o014000; ++pub const BSDLY: crate::tcflag_t = 0o020000; ++pub const FFDLY: crate::tcflag_t = 0o100000; ++pub const VTDLY: crate::tcflag_t = 0o040000; ++pub const XTABS: crate::tcflag_t = 0o014000; ++ ++pub const B0: crate::speed_t = 0o000000; ++pub const B50: crate::speed_t = 0o000001; ++pub const B75: crate::speed_t = 0o000002; ++pub const B110: crate::speed_t = 0o000003; ++pub const B134: crate::speed_t = 0o000004; ++pub const B150: crate::speed_t = 0o000005; ++pub const B200: crate::speed_t = 0o000006; ++pub const B300: crate::speed_t = 0o000007; ++pub const B600: crate::speed_t = 0o000010; ++pub const B1200: crate::speed_t = 0o000011; ++pub const B1800: crate::speed_t = 0o000012; ++pub const B2400: crate::speed_t = 0o000013; ++pub const B4800: crate::speed_t = 0o000014; ++pub const B9600: crate::speed_t = 0o000015; ++pub const B19200: crate::speed_t = 0o000016; ++pub const B38400: crate::speed_t = 0o000017; ++pub const EXTA: crate::speed_t = B19200; ++pub const EXTB: crate::speed_t = B38400; ++pub const B57600: crate::speed_t = 0o010001; ++pub const B115200: crate::speed_t = 0o010002; ++pub const B230400: crate::speed_t = 0o010003; ++pub const B460800: crate::speed_t = 0o010004; ++pub const B500000: crate::speed_t = 0o010005; ++pub const B576000: crate::speed_t = 0o010006; ++pub const B921600: crate::speed_t = 0o010007; ++pub const B1000000: crate::speed_t = 0o010010; ++pub const B1152000: crate::speed_t = 0o010011; ++pub const B1500000: crate::speed_t = 0o010012; ++pub const B2000000: crate::speed_t = 0o010013; ++pub const B2500000: crate::speed_t = 0o010014; ++pub const B3000000: crate::speed_t = 0o010015; ++pub const B3500000: crate::speed_t = 0o010016; ++pub const B4000000: crate::speed_t = 0o010017; ++ ++pub const VEOL: usize = 11; ++pub const VEOL2: usize = 16; ++pub const VMIN: usize = 6; ++pub const IEXTEN: crate::tcflag_t = 0x00008000; ++pub const TOSTOP: crate::tcflag_t = 0x00000100; ++pub const FLUSHO: crate::tcflag_t = 0x00001000; ++pub const EXTPROC: crate::tcflag_t = 0x00010000; ++ ++pub const TCSANOW: c_int = 0; ++pub const TCSADRAIN: c_int = 1; ++pub const TCSAFLUSH: c_int = 2; ++ ++// Syscall table ++pub const SYS_restart_syscall: c_long = 0; ++pub const SYS_exit: c_long = 1; ++pub const SYS_fork: c_long = 2; ++pub const SYS_read: c_long = 3; ++pub const SYS_write: c_long = 4; ++pub const SYS_open: c_long = 5; ++pub const SYS_close: c_long = 6; ++pub const SYS_creat: c_long = 8; ++pub const SYS_link: c_long = 9; ++pub const SYS_unlink: c_long = 10; ++pub const SYS_execve: c_long = 11; ++pub const SYS_chdir: c_long = 12; ++pub const SYS_mknod: c_long = 14; ++pub const SYS_chmod: c_long = 15; ++pub const SYS_lchown: c_long = 16; ++pub const SYS_lseek: c_long = 19; ++pub const SYS_getpid: c_long = 20; ++pub const SYS_mount: c_long = 21; ++pub const SYS_setuid: c_long = 23; ++pub const SYS_getuid: c_long = 24; ++pub const SYS_ptrace: c_long = 26; ++pub const SYS_pause: c_long = 29; ++pub const SYS_access: c_long = 33; ++pub const SYS_nice: c_long = 34; ++pub const SYS_sync: c_long = 36; ++pub const SYS_kill: c_long = 37; ++pub const SYS_rename: c_long = 38; ++pub const SYS_mkdir: c_long = 39; ++pub const SYS_rmdir: c_long = 40; ++pub const SYS_dup: c_long = 41; ++pub const SYS_pipe: c_long = 42; ++pub const SYS_times: c_long = 43; ++pub const SYS_brk: c_long = 45; ++pub const SYS_setgid: c_long = 46; ++pub const SYS_getgid: c_long = 47; ++pub const SYS_geteuid: c_long = 49; ++pub const SYS_getegid: c_long = 50; ++pub const SYS_acct: c_long = 51; ++pub const SYS_umount2: c_long = 52; ++pub const SYS_ioctl: c_long = 54; ++pub const SYS_fcntl: c_long = 55; ++pub const SYS_setpgid: c_long = 57; ++pub const SYS_umask: c_long = 60; ++pub const SYS_chroot: c_long = 61; ++pub const SYS_ustat: c_long = 62; ++pub const SYS_dup2: c_long = 63; ++pub const SYS_getppid: c_long = 64; ++pub const SYS_getpgrp: c_long = 65; ++pub const SYS_setsid: c_long = 66; ++pub const SYS_sigaction: c_long = 67; ++pub const SYS_setreuid: c_long = 70; ++pub const SYS_setregid: c_long = 71; ++pub const SYS_sigsuspend: c_long = 72; ++pub const SYS_sigpending: c_long = 73; ++pub const SYS_sethostname: c_long = 74; ++pub const SYS_setrlimit: c_long = 75; ++pub const SYS_getrusage: c_long = 77; ++pub const SYS_gettimeofday: c_long = 78; ++pub const SYS_settimeofday: c_long = 79; ++pub const SYS_getgroups: c_long = 80; ++pub const SYS_setgroups: c_long = 81; ++pub const SYS_symlink: c_long = 83; ++pub const SYS_readlink: c_long = 85; ++pub const SYS_uselib: c_long = 86; ++pub const SYS_swapon: c_long = 87; ++pub const SYS_reboot: c_long = 88; ++pub const SYS_munmap: c_long = 91; ++pub const SYS_truncate: c_long = 92; ++pub const SYS_ftruncate: c_long = 93; ++pub const SYS_fchmod: c_long = 94; ++pub const SYS_fchown: c_long = 95; ++pub const SYS_getpriority: c_long = 96; ++pub const SYS_setpriority: c_long = 97; ++pub const SYS_statfs: c_long = 99; ++pub const SYS_fstatfs: c_long = 100; ++pub const SYS_syslog: c_long = 103; ++pub const SYS_setitimer: c_long = 104; ++pub const SYS_getitimer: c_long = 105; ++pub const SYS_stat: c_long = 106; ++pub const SYS_lstat: c_long = 107; ++pub const SYS_fstat: c_long = 108; ++pub const SYS_vhangup: c_long = 111; ++pub const SYS_wait4: c_long = 114; ++pub const SYS_swapoff: c_long = 115; ++pub const SYS_sysinfo: c_long = 116; ++pub const SYS_fsync: c_long = 118; ++pub const SYS_sigreturn: c_long = 119; ++pub const SYS_clone: c_long = 120; ++pub const SYS_setdomainname: c_long = 121; ++pub const SYS_uname: c_long = 122; ++pub const SYS_adjtimex: c_long = 124; ++pub const SYS_mprotect: c_long = 125; ++pub const SYS_sigprocmask: c_long = 126; ++pub const SYS_init_module: c_long = 128; ++pub const SYS_delete_module: c_long = 129; ++pub const SYS_quotactl: c_long = 131; ++pub const SYS_getpgid: c_long = 132; ++pub const SYS_fchdir: c_long = 133; ++pub const SYS_bdflush: c_long = 134; ++pub const SYS_sysfs: c_long = 135; ++pub const SYS_personality: c_long = 136; ++pub const SYS_setfsuid: c_long = 138; ++pub const SYS_setfsgid: c_long = 139; ++pub const SYS__llseek: c_long = 140; ++pub const SYS_getdents: c_long = 141; ++pub const SYS__newselect: c_long = 142; ++pub const SYS_flock: c_long = 143; ++pub const SYS_msync: c_long = 144; ++pub const SYS_readv: c_long = 145; ++pub const SYS_writev: c_long = 146; ++pub const SYS_getsid: c_long = 147; ++pub const SYS_fdatasync: c_long = 148; ++pub const SYS__sysctl: c_long = 149; ++pub const SYS_mlock: c_long = 150; ++pub const SYS_munlock: c_long = 151; ++pub const SYS_mlockall: c_long = 152; ++pub const SYS_munlockall: c_long = 153; ++pub const SYS_sched_setparam: c_long = 154; ++pub const SYS_sched_getparam: c_long = 155; ++pub const SYS_sched_setscheduler: c_long = 156; ++pub const SYS_sched_getscheduler: c_long = 157; ++pub const SYS_sched_yield: c_long = 158; ++pub const SYS_sched_get_priority_max: c_long = 159; ++pub const SYS_sched_get_priority_min: c_long = 160; ++pub const SYS_sched_rr_get_interval: c_long = 161; ++pub const SYS_nanosleep: c_long = 162; ++pub const SYS_mremap: c_long = 163; ++pub const SYS_setresuid: c_long = 164; ++pub const SYS_getresuid: c_long = 165; ++pub const SYS_poll: c_long = 168; ++pub const SYS_nfsservctl: c_long = 169; ++pub const SYS_setresgid: c_long = 170; ++pub const SYS_getresgid: c_long = 171; ++pub const SYS_prctl: c_long = 172; ++pub const SYS_rt_sigreturn: c_long = 173; ++pub const SYS_rt_sigaction: c_long = 174; ++pub const SYS_rt_sigprocmask: c_long = 175; ++pub const SYS_rt_sigpending: c_long = 176; ++pub const SYS_rt_sigtimedwait: c_long = 177; ++pub const SYS_rt_sigqueueinfo: c_long = 178; ++pub const SYS_rt_sigsuspend: c_long = 179; ++pub const SYS_pread64: c_long = 180; ++pub const SYS_pwrite64: c_long = 181; ++pub const SYS_chown: c_long = 182; ++pub const SYS_getcwd: c_long = 183; ++pub const SYS_capget: c_long = 184; ++pub const SYS_capset: c_long = 185; ++pub const SYS_sigaltstack: c_long = 186; ++pub const SYS_sendfile: c_long = 187; ++pub const SYS_vfork: c_long = 190; ++pub const SYS_ugetrlimit: c_long = 191; ++pub const SYS_mmap2: c_long = 192; ++pub const SYS_truncate64: c_long = 193; ++pub const SYS_ftruncate64: c_long = 194; ++pub const SYS_stat64: c_long = 195; ++pub const SYS_lstat64: c_long = 196; ++pub const SYS_fstat64: c_long = 197; ++pub const SYS_lchown32: c_long = 198; ++pub const SYS_getuid32: c_long = 199; ++pub const SYS_getgid32: c_long = 200; ++pub const SYS_geteuid32: c_long = 201; ++pub const SYS_getegid32: c_long = 202; ++pub const SYS_setreuid32: c_long = 203; ++pub const SYS_setregid32: c_long = 204; ++pub const SYS_getgroups32: c_long = 205; ++pub const SYS_setgroups32: c_long = 206; ++pub const SYS_fchown32: c_long = 207; ++pub const SYS_setresuid32: c_long = 208; ++pub const SYS_getresuid32: c_long = 209; ++pub const SYS_setresgid32: c_long = 210; ++pub const SYS_getresgid32: c_long = 211; ++pub const SYS_chown32: c_long = 212; ++pub const SYS_setuid32: c_long = 213; ++pub const SYS_setgid32: c_long = 214; ++pub const SYS_setfsuid32: c_long = 215; ++pub const SYS_setfsgid32: c_long = 216; ++pub const SYS_getdents64: c_long = 217; ++pub const SYS_pivot_root: c_long = 218; ++pub const SYS_mincore: c_long = 219; ++pub const SYS_madvise: c_long = 220; ++pub const SYS_fcntl64: c_long = 221; ++pub const SYS_gettid: c_long = 224; ++pub const SYS_readahead: c_long = 225; ++pub const SYS_setxattr: c_long = 226; ++pub const SYS_lsetxattr: c_long = 227; ++pub const SYS_fsetxattr: c_long = 228; ++pub const SYS_getxattr: c_long = 229; ++pub const SYS_lgetxattr: c_long = 230; ++pub const SYS_fgetxattr: c_long = 231; ++pub const SYS_listxattr: c_long = 232; ++pub const SYS_llistxattr: c_long = 233; ++pub const SYS_flistxattr: c_long = 234; ++pub const SYS_removexattr: c_long = 235; ++pub const SYS_lremovexattr: c_long = 236; ++pub const SYS_fremovexattr: c_long = 237; ++pub const SYS_tkill: c_long = 238; ++pub const SYS_sendfile64: c_long = 239; ++pub const SYS_futex: c_long = 240; ++pub const SYS_sched_setaffinity: c_long = 241; ++pub const SYS_sched_getaffinity: c_long = 242; ++pub const SYS_io_setup: c_long = 243; ++pub const SYS_io_destroy: c_long = 244; ++pub const SYS_io_getevents: c_long = 245; ++pub const SYS_io_submit: c_long = 246; ++pub const SYS_io_cancel: c_long = 247; ++pub const SYS_exit_group: c_long = 248; ++pub const SYS_lookup_dcookie: c_long = 249; ++pub const SYS_epoll_create: c_long = 250; ++pub const SYS_epoll_ctl: c_long = 251; ++pub const SYS_epoll_wait: c_long = 252; ++pub const SYS_remap_file_pages: c_long = 253; ++pub const SYS_set_tid_address: c_long = 256; ++pub const SYS_timer_create: c_long = 257; ++pub const SYS_timer_settime: c_long = 258; ++pub const SYS_timer_gettime: c_long = 259; ++pub const SYS_timer_getoverrun: c_long = 260; ++pub const SYS_timer_delete: c_long = 261; ++pub const SYS_clock_settime: c_long = 262; ++pub const SYS_clock_gettime: c_long = 263; ++pub const SYS_clock_getres: c_long = 264; ++pub const SYS_clock_nanosleep: c_long = 265; ++pub const SYS_statfs64: c_long = 266; ++pub const SYS_fstatfs64: c_long = 267; ++pub const SYS_tgkill: c_long = 268; ++pub const SYS_utimes: c_long = 269; ++pub const SYS_arm_fadvise64_64: c_long = 270; ++pub const SYS_pciconfig_iobase: c_long = 271; ++pub const SYS_pciconfig_read: c_long = 272; ++pub const SYS_pciconfig_write: c_long = 273; ++pub const SYS_mq_open: c_long = 274; ++pub const SYS_mq_unlink: c_long = 275; ++pub const SYS_mq_timedsend: c_long = 276; ++pub const SYS_mq_timedreceive: c_long = 277; ++pub const SYS_mq_notify: c_long = 278; ++pub const SYS_mq_getsetattr: c_long = 279; ++pub const SYS_waitid: c_long = 280; ++pub const SYS_socket: c_long = 281; ++pub const SYS_bind: c_long = 282; ++pub const SYS_connect: c_long = 283; ++pub const SYS_listen: c_long = 284; ++pub const SYS_accept: c_long = 285; ++pub const SYS_getsockname: c_long = 286; ++pub const SYS_getpeername: c_long = 287; ++pub const SYS_socketpair: c_long = 288; ++pub const SYS_send: c_long = 289; ++pub const SYS_sendto: c_long = 290; ++pub const SYS_recv: c_long = 291; ++pub const SYS_recvfrom: c_long = 292; ++pub const SYS_shutdown: c_long = 293; ++pub const SYS_setsockopt: c_long = 294; ++pub const SYS_getsockopt: c_long = 295; ++pub const SYS_sendmsg: c_long = 296; ++pub const SYS_recvmsg: c_long = 297; ++pub const SYS_semop: c_long = 298; ++pub const SYS_semget: c_long = 299; ++pub const SYS_semctl: c_long = 300; ++pub const SYS_msgsnd: c_long = 301; ++pub const SYS_msgrcv: c_long = 302; ++pub const SYS_msgget: c_long = 303; ++pub const SYS_msgctl: c_long = 304; ++pub const SYS_shmat: c_long = 305; ++pub const SYS_shmdt: c_long = 306; ++pub const SYS_shmget: c_long = 307; ++pub const SYS_shmctl: c_long = 308; ++pub const SYS_add_key: c_long = 309; ++pub const SYS_request_key: c_long = 310; ++pub const SYS_keyctl: c_long = 311; ++pub const SYS_semtimedop: c_long = 312; ++pub const SYS_vserver: c_long = 313; ++pub const SYS_ioprio_set: c_long = 314; ++pub const SYS_ioprio_get: c_long = 315; ++pub const SYS_inotify_init: c_long = 316; ++pub const SYS_inotify_add_watch: c_long = 317; ++pub const SYS_inotify_rm_watch: c_long = 318; ++pub const SYS_mbind: c_long = 319; ++pub const SYS_get_mempolicy: c_long = 320; ++pub const SYS_set_mempolicy: c_long = 321; ++pub const SYS_openat: c_long = 322; ++pub const SYS_mkdirat: c_long = 323; ++pub const SYS_mknodat: c_long = 324; ++pub const SYS_fchownat: c_long = 325; ++pub const SYS_futimesat: c_long = 326; ++pub const SYS_fstatat64: c_long = 327; ++pub const SYS_unlinkat: c_long = 328; ++pub const SYS_renameat: c_long = 329; ++pub const SYS_linkat: c_long = 330; ++pub const SYS_symlinkat: c_long = 331; ++pub const SYS_readlinkat: c_long = 332; ++pub const SYS_fchmodat: c_long = 333; ++pub const SYS_faccessat: c_long = 334; ++pub const SYS_pselect6: c_long = 335; ++pub const SYS_ppoll: c_long = 336; ++pub const SYS_unshare: c_long = 337; ++pub const SYS_set_robust_list: c_long = 338; ++pub const SYS_get_robust_list: c_long = 339; ++pub const SYS_splice: c_long = 340; ++pub const SYS_arm_sync_file_range: c_long = 341; ++pub const SYS_tee: c_long = 342; ++pub const SYS_vmsplice: c_long = 343; ++pub const SYS_move_pages: c_long = 344; ++pub const SYS_getcpu: c_long = 345; ++pub const SYS_epoll_pwait: c_long = 346; ++pub const SYS_kexec_load: c_long = 347; ++pub const SYS_utimensat: c_long = 348; ++pub const SYS_signalfd: c_long = 349; ++pub const SYS_timerfd_create: c_long = 350; ++pub const SYS_eventfd: c_long = 351; ++pub const SYS_fallocate: c_long = 352; ++pub const SYS_timerfd_settime: c_long = 353; ++pub const SYS_timerfd_gettime: c_long = 354; ++pub const SYS_signalfd4: c_long = 355; ++pub const SYS_eventfd2: c_long = 356; ++pub const SYS_epoll_create1: c_long = 357; ++pub const SYS_dup3: c_long = 358; ++pub const SYS_pipe2: c_long = 359; ++pub const SYS_inotify_init1: c_long = 360; ++pub const SYS_preadv: c_long = 361; ++pub const SYS_pwritev: c_long = 362; ++pub const SYS_rt_tgsigqueueinfo: c_long = 363; ++pub const SYS_perf_event_open: c_long = 364; ++pub const SYS_recvmmsg: c_long = 365; ++pub const SYS_accept4: c_long = 366; ++pub const SYS_fanotify_init: c_long = 367; ++pub const SYS_fanotify_mark: c_long = 368; ++pub const SYS_prlimit64: c_long = 369; ++pub const SYS_name_to_handle_at: c_long = 370; ++pub const SYS_open_by_handle_at: c_long = 371; ++pub const SYS_clock_adjtime: c_long = 372; ++pub const SYS_syncfs: c_long = 373; ++pub const SYS_sendmmsg: c_long = 374; ++pub const SYS_setns: c_long = 375; ++pub const SYS_process_vm_readv: c_long = 376; ++pub const SYS_process_vm_writev: c_long = 377; ++pub const SYS_kcmp: c_long = 378; ++pub const SYS_finit_module: c_long = 379; ++pub const SYS_sched_setattr: c_long = 380; ++pub const SYS_sched_getattr: c_long = 381; ++pub const SYS_renameat2: c_long = 382; ++pub const SYS_seccomp: c_long = 383; ++pub const SYS_getrandom: c_long = 384; ++pub const SYS_memfd_create: c_long = 385; ++pub const SYS_bpf: c_long = 386; ++pub const SYS_execveat: c_long = 387; ++pub const SYS_userfaultfd: c_long = 388; ++pub const SYS_membarrier: c_long = 389; ++pub const SYS_mlock2: c_long = 390; ++pub const SYS_copy_file_range: c_long = 391; ++pub const SYS_preadv2: c_long = 392; ++pub const SYS_pwritev2: c_long = 393; ++pub const SYS_pkey_mprotect: c_long = 394; ++pub const SYS_pkey_alloc: c_long = 395; ++pub const SYS_pkey_free: c_long = 396; ++pub const SYS_statx: c_long = 397; ++pub const SYS_rseq: c_long = 398; ++pub const SYS_kexec_file_load: c_long = 401; ++pub const SYS_pidfd_send_signal: c_long = 424; ++pub const SYS_io_uring_setup: c_long = 425; ++pub const SYS_io_uring_enter: c_long = 426; ++pub const SYS_io_uring_register: c_long = 427; ++pub const SYS_open_tree: c_long = 428; ++pub const SYS_move_mount: c_long = 429; ++pub const SYS_fsopen: c_long = 430; ++pub const SYS_fsconfig: c_long = 431; ++pub const SYS_fsmount: c_long = 432; ++pub const SYS_fspick: c_long = 433; ++pub const SYS_pidfd_open: c_long = 434; ++pub const SYS_clone3: c_long = 435; ++pub const SYS_close_range: c_long = 436; ++pub const SYS_openat2: c_long = 437; ++pub const SYS_pidfd_getfd: c_long = 438; ++pub const SYS_faccessat2: c_long = 439; ++pub const SYS_process_madvise: c_long = 440; ++pub const SYS_epoll_pwait2: c_long = 441; ++pub const SYS_mount_setattr: c_long = 442; ++pub const SYS_quotactl_fd: c_long = 443; ++pub const SYS_landlock_create_ruleset: c_long = 444; ++pub const SYS_landlock_add_rule: c_long = 445; ++pub const SYS_landlock_restrict_self: c_long = 446; ++pub const SYS_memfd_secret: c_long = 447; ++pub const SYS_process_mrelease: c_long = 448; ++pub const SYS_futex_waitv: c_long = 449; ++pub const SYS_set_mempolicy_home_node: c_long = 450; ++pub const SYS_mseal: c_long = 462; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/csky/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/csky/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/csky/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/csky/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,745 @@ ++use crate::prelude::*; ++use crate::{off64_t, off_t}; ++ ++pub type c_char = u8; ++pub type wchar_t = u32; ++ ++s! { ++ pub struct sigaction { ++ pub sa_sigaction: crate::sighandler_t, ++ pub sa_mask: crate::sigset_t, ++ pub sa_flags: c_int, ++ pub sa_restorer: Option, ++ } ++ ++ pub struct statfs { ++ pub f_type: crate::__fsword_t, ++ pub f_bsize: crate::__fsword_t, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_fsid: crate::fsid_t, ++ ++ pub f_namelen: crate::__fsword_t, ++ pub f_frsize: crate::__fsword_t, ++ f_spare: [crate::__fsword_t; 5], ++ } ++ ++ pub struct flock { ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ pub l_start: off_t, ++ pub l_len: off_t, ++ pub l_pid: crate::pid_t, ++ } ++ ++ pub struct flock64 { ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ pub l_start: off64_t, ++ pub l_len: off64_t, ++ pub l_pid: crate::pid_t, ++ } ++ ++ pub struct ipc_perm { ++ pub __key: crate::key_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub cuid: crate::uid_t, ++ pub cgid: crate::gid_t, ++ pub mode: c_ushort, ++ __pad1: c_ushort, ++ pub __seq: c_ushort, ++ __pad2: c_ushort, ++ __unused1: c_ulong, ++ __unused2: c_ulong, ++ } ++ ++ pub struct stat64 { ++ pub st_dev: crate::dev_t, ++ __pad1: c_uint, ++ __st_ino: crate::ino_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ __pad2: c_uint, ++ pub st_size: off64_t, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt64_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ pub st_ino: crate::ino64_t, ++ } ++ ++ pub struct statfs64 { ++ pub f_type: crate::__fsword_t, ++ pub f_bsize: crate::__fsword_t, ++ pub f_blocks: u64, ++ pub f_bfree: u64, ++ pub f_bavail: u64, ++ pub f_files: u64, ++ pub f_ffree: u64, ++ pub f_fsid: crate::fsid_t, ++ pub f_namelen: crate::__fsword_t, ++ pub f_frsize: crate::__fsword_t, ++ pub f_flags: crate::__fsword_t, ++ pub f_spare: [crate::__fsword_t; 4], ++ } ++ ++ pub struct statvfs64 { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: u64, ++ pub f_bfree: u64, ++ pub f_bavail: u64, ++ pub f_files: u64, ++ pub f_ffree: u64, ++ pub f_favail: u64, ++ pub f_fsid: c_ulong, ++ __f_unused: c_int, ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ __f_spare: [c_int; 6], ++ } ++ ++ pub struct shmid_ds { ++ pub shm_perm: crate::ipc_perm, ++ pub shm_segsz: size_t, ++ pub shm_atime: crate::time_t, ++ __unused1: c_ulong, ++ pub shm_dtime: crate::time_t, ++ __unused2: c_ulong, ++ pub shm_ctime: crate::time_t, ++ __unused3: c_ulong, ++ pub shm_cpid: crate::pid_t, ++ pub shm_lpid: crate::pid_t, ++ pub shm_nattch: crate::shmatt_t, ++ __unused4: c_ulong, ++ __unused5: c_ulong, ++ } ++ ++ pub struct msqid_ds { ++ pub msg_perm: crate::ipc_perm, ++ pub msg_stime: crate::time_t, ++ __glibc_reserved1: c_ulong, ++ pub msg_rtime: crate::time_t, ++ __glibc_reserved2: c_ulong, ++ pub msg_ctime: crate::time_t, ++ __glibc_reserved3: c_ulong, ++ __msg_cbytes: c_ulong, ++ pub msg_qnum: crate::msgqnum_t, ++ pub msg_qbytes: crate::msglen_t, ++ pub msg_lspid: crate::pid_t, ++ pub msg_lrpid: crate::pid_t, ++ __glibc_reserved4: c_ulong, ++ __glibc_reserved5: c_ulong, ++ } ++ ++ pub struct siginfo_t { ++ pub si_signo: c_int, ++ pub si_errno: c_int, ++ pub si_code: c_int, ++ #[doc(hidden)] ++ #[deprecated( ++ since = "0.2.54", ++ note = "Please leave a comment on \ ++ https://github.com/rust-lang/libc/pull/1316 if you're using \ ++ this field" ++ )] ++ pub _pad: [c_int; 29], ++ _align: [usize; 0], ++ } ++ ++ pub struct stack_t { ++ pub ss_sp: *mut c_void, ++ pub ss_flags: c_int, ++ pub ss_size: size_t, ++ } ++} ++ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ #[repr(align(8))] ++ pub struct max_align_t { ++ priv_: [i64; 2], ++ } ++} ++ ++pub const VEOF: usize = 4; ++pub const RTLD_DEEPBIND: c_int = 0x8; ++pub const RTLD_GLOBAL: c_int = 0x100; ++pub const RTLD_NOLOAD: c_int = 0x4; ++pub const O_DIRECT: c_int = 0x4000; ++pub const O_DIRECTORY: c_int = 0x10000; ++pub const O_NOFOLLOW: c_int = 0x20000; ++pub const O_LARGEFILE: c_int = 0o100000; ++pub const O_APPEND: c_int = 1024; ++pub const O_CREAT: c_int = 64; ++pub const O_EXCL: c_int = 128; ++pub const O_NOCTTY: c_int = 256; ++pub const O_NONBLOCK: c_int = 2048; ++pub const O_SYNC: c_int = 1052672; ++pub const O_RSYNC: c_int = 1052672; ++pub const O_DSYNC: c_int = 4096; ++pub const O_FSYNC: c_int = 0x101000; ++pub const O_ASYNC: c_int = 0x2000; ++pub const O_NDELAY: c_int = 0x800; ++ ++pub const MADV_SOFT_OFFLINE: c_int = 101; ++pub const MAP_LOCKED: c_int = 0x02000; ++pub const MAP_NORESERVE: c_int = 0x04000; ++pub const MAP_ANON: c_int = 0x0020; ++pub const MAP_ANONYMOUS: c_int = 0x0020; ++pub const MAP_DENYWRITE: c_int = 0x0800; ++pub const MAP_EXECUTABLE: c_int = 0x01000; ++pub const MAP_POPULATE: c_int = 0x08000; ++pub const MAP_NONBLOCK: c_int = 0x010000; ++pub const MAP_STACK: c_int = 0x020000; ++pub const MAP_HUGETLB: c_int = 0x040000; ++pub const MAP_GROWSDOWN: c_int = 0x0100; ++pub const MAP_SYNC: c_int = 0x080000; ++ ++pub const EDEADLOCK: c_int = 35; ++pub const EUCLEAN: c_int = 117; ++pub const ENOTNAM: c_int = 118; ++pub const ENAVAIL: c_int = 119; ++pub const EISNAM: c_int = 120; ++pub const EREMOTEIO: c_int = 121; ++pub const EDEADLK: c_int = 35; ++pub const ENAMETOOLONG: c_int = 36; ++pub const ENOLCK: c_int = 37; ++pub const ENOSYS: c_int = 38; ++pub const ENOTEMPTY: c_int = 39; ++pub const ELOOP: c_int = 40; ++pub const ENOMSG: c_int = 42; ++pub const EIDRM: c_int = 43; ++pub const ECHRNG: c_int = 44; ++pub const EL2NSYNC: c_int = 45; ++pub const EL3HLT: c_int = 46; ++pub const EL3RST: c_int = 47; ++pub const ELNRNG: c_int = 48; ++pub const EUNATCH: c_int = 49; ++pub const ENOCSI: c_int = 50; ++pub const EL2HLT: c_int = 51; ++pub const EBADE: c_int = 52; ++pub const EBADR: c_int = 53; ++pub const EXFULL: c_int = 54; ++pub const ENOANO: c_int = 55; ++pub const EBADRQC: c_int = 56; ++pub const EBADSLT: c_int = 57; ++pub const EMULTIHOP: c_int = 72; ++pub const EOVERFLOW: c_int = 75; ++pub const ENOTUNIQ: c_int = 76; ++pub const EBADFD: c_int = 77; ++pub const EBADMSG: c_int = 74; ++pub const EREMCHG: c_int = 78; ++pub const ELIBACC: c_int = 79; ++pub const ELIBBAD: c_int = 80; ++pub const ELIBSCN: c_int = 81; ++pub const ELIBMAX: c_int = 82; ++pub const ELIBEXEC: c_int = 83; ++pub const EILSEQ: c_int = 84; ++pub const ERESTART: c_int = 85; ++pub const ESTRPIPE: c_int = 86; ++pub const EUSERS: c_int = 87; ++pub const ENOTSOCK: c_int = 88; ++pub const EDESTADDRREQ: c_int = 89; ++pub const EMSGSIZE: c_int = 90; ++pub const EPROTOTYPE: c_int = 91; ++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 EPFNOSUPPORT: c_int = 96; ++pub const EAFNOSUPPORT: c_int = 97; ++pub const EADDRINUSE: c_int = 98; ++pub const EADDRNOTAVAIL: c_int = 99; ++pub const ENETDOWN: c_int = 100; ++pub const ENETUNREACH: c_int = 101; ++pub const ENETRESET: c_int = 102; ++pub const ECONNABORTED: c_int = 103; ++pub const ECONNRESET: c_int = 104; ++pub const ENOBUFS: c_int = 105; ++pub const EISCONN: c_int = 106; ++pub const ENOTCONN: c_int = 107; ++pub const ESHUTDOWN: c_int = 108; ++pub const ETOOMANYREFS: c_int = 109; ++pub const ETIMEDOUT: c_int = 110; ++pub const ECONNREFUSED: c_int = 111; ++pub const EHOSTDOWN: c_int = 112; ++pub const EHOSTUNREACH: c_int = 113; ++pub const EALREADY: c_int = 114; ++pub const EINPROGRESS: c_int = 115; ++pub const ESTALE: c_int = 116; ++pub const EDQUOT: c_int = 122; ++pub const ENOMEDIUM: c_int = 123; ++pub const EMEDIUMTYPE: c_int = 124; ++pub const ECANCELED: c_int = 125; ++pub const ENOKEY: c_int = 126; ++pub const EKEYEXPIRED: c_int = 127; ++pub const EKEYREVOKED: c_int = 128; ++pub const EKEYREJECTED: c_int = 129; ++pub const EOWNERDEAD: c_int = 130; ++pub const ENOTRECOVERABLE: c_int = 131; ++pub const EHWPOISON: c_int = 133; ++pub const ERFKILL: c_int = 132; ++ ++pub const SA_SIGINFO: c_int = 0x00000004; ++pub const SA_NOCLDWAIT: c_int = 0x00000002; ++ ++pub const SOCK_STREAM: c_int = 1; ++pub const SOCK_DGRAM: c_int = 2; ++ ++pub const MCL_CURRENT: c_int = 0x0001; ++pub const MCL_FUTURE: c_int = 0x0002; ++pub const MCL_ONFAULT: c_int = 0x0004; ++ ++pub const POLLWRNORM: c_short = 0x100; ++pub const POLLWRBAND: c_short = 0x200; ++ ++pub const F_GETLK: c_int = 5; ++pub const F_GETOWN: c_int = 9; ++pub const F_SETOWN: c_int = 8; ++ ++pub const EFD_NONBLOCK: c_int = 0x800; ++pub const SFD_NONBLOCK: c_int = 0x0800; ++ ++pub const SIGCHLD: c_int = 17; ++pub const SIGBUS: c_int = 7; ++pub const SIGUSR1: c_int = 10; ++pub const SIGUSR2: c_int = 12; ++pub const SIGCONT: c_int = 18; ++pub const SIGSTOP: c_int = 19; ++pub const SIGTSTP: c_int = 20; ++pub const SIGURG: c_int = 23; ++pub const SIGIO: c_int = 29; ++pub const SIGSYS: c_int = 31; ++pub const SIGSTKFLT: c_int = 16; ++#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")] ++pub const SIGUNUSED: c_int = 31; ++pub const SIGPOLL: c_int = 29; ++pub const SIGPWR: c_int = 30; ++pub const SIG_SETMASK: c_int = 2; ++pub const SIG_BLOCK: c_int = 0x000000; ++pub const SIG_UNBLOCK: c_int = 0x01; ++pub const SIGTTIN: c_int = 21; ++pub const SIGTTOU: c_int = 22; ++pub const SIGXCPU: c_int = 24; ++pub const SIGXFSZ: c_int = 25; ++pub const SIGVTALRM: c_int = 26; ++pub const SIGPROF: c_int = 27; ++pub const SIGWINCH: c_int = 28; ++pub const SIGSTKSZ: size_t = 8192; ++pub const MINSIGSTKSZ: size_t = 2048; ++pub const CBAUD: crate::tcflag_t = 0o0010017; ++pub const TAB1: crate::tcflag_t = 0x00000800; ++pub const TAB2: crate::tcflag_t = 0x00001000; ++pub const TAB3: crate::tcflag_t = 0x00001800; ++pub const CR1: crate::tcflag_t = 0x00000200; ++pub const CR2: crate::tcflag_t = 0x00000400; ++pub const CR3: crate::tcflag_t = 0x00000600; ++pub const FF1: crate::tcflag_t = 0x00008000; ++pub const BS1: crate::tcflag_t = 0x00002000; ++pub const VT1: crate::tcflag_t = 0x00004000; ++pub const VWERASE: usize = 14; ++pub const VREPRINT: usize = 12; ++pub const VSUSP: usize = 10; ++pub const VSTART: usize = 8; ++pub const VSTOP: usize = 9; ++pub const VDISCARD: usize = 13; ++pub const VTIME: usize = 5; ++pub const IXON: crate::tcflag_t = 0x00000400; ++pub const IXOFF: crate::tcflag_t = 0x00001000; ++pub const ONLCR: crate::tcflag_t = 0x4; ++pub const CSIZE: crate::tcflag_t = 0x00000030; ++pub const CS6: crate::tcflag_t = 0x00000010; ++pub const CS7: crate::tcflag_t = 0x00000020; ++pub const CS8: crate::tcflag_t = 0x00000030; ++pub const CSTOPB: crate::tcflag_t = 0x00000040; ++pub const CREAD: crate::tcflag_t = 0x00000080; ++pub const PARENB: crate::tcflag_t = 0x00000100; ++pub const PARODD: crate::tcflag_t = 0x00000200; ++pub const HUPCL: crate::tcflag_t = 0x00000400; ++pub const CLOCAL: crate::tcflag_t = 0x00000800; ++pub const ECHOKE: crate::tcflag_t = 0x00000800; ++pub const ECHOE: crate::tcflag_t = 0x00000010; ++pub const ECHOK: crate::tcflag_t = 0x00000020; ++pub const ECHONL: crate::tcflag_t = 0x00000040; ++pub const ECHOPRT: crate::tcflag_t = 0x00000400; ++pub const ECHOCTL: crate::tcflag_t = 0x00000200; ++pub const ISIG: crate::tcflag_t = 0x00000001; ++pub const ICANON: crate::tcflag_t = 0x00000002; ++pub const PENDIN: crate::tcflag_t = 0x00004000; ++pub const NOFLSH: crate::tcflag_t = 0x00000080; ++pub const CIBAUD: crate::tcflag_t = 0o02003600000; ++pub const CBAUDEX: crate::tcflag_t = 0o010000; ++pub const VSWTC: usize = 7; ++pub const OLCUC: crate::tcflag_t = 0o000002; ++pub const NLDLY: crate::tcflag_t = 0o000400; ++pub const CRDLY: crate::tcflag_t = 0o003000; ++pub const TABDLY: crate::tcflag_t = 0o014000; ++pub const BSDLY: crate::tcflag_t = 0o020000; ++pub const FFDLY: crate::tcflag_t = 0o100000; ++pub const VTDLY: crate::tcflag_t = 0o040000; ++pub const XTABS: crate::tcflag_t = 0o014000; ++ ++pub const B0: crate::speed_t = 0o000000; ++pub const B50: crate::speed_t = 0o000001; ++pub const B75: crate::speed_t = 0o000002; ++pub const B110: crate::speed_t = 0o000003; ++pub const B134: crate::speed_t = 0o000004; ++pub const B150: crate::speed_t = 0o000005; ++pub const B200: crate::speed_t = 0o000006; ++pub const B300: crate::speed_t = 0o000007; ++pub const B600: crate::speed_t = 0o000010; ++pub const B1200: crate::speed_t = 0o000011; ++pub const B1800: crate::speed_t = 0o000012; ++pub const B2400: crate::speed_t = 0o000013; ++pub const B4800: crate::speed_t = 0o000014; ++pub const B9600: crate::speed_t = 0o000015; ++pub const B19200: crate::speed_t = 0o000016; ++pub const B38400: crate::speed_t = 0o000017; ++pub const EXTA: crate::speed_t = B19200; ++pub const EXTB: crate::speed_t = B38400; ++pub const B57600: crate::speed_t = 0o010001; ++pub const B115200: crate::speed_t = 0o010002; ++pub const B230400: crate::speed_t = 0o010003; ++pub const B460800: crate::speed_t = 0o010004; ++pub const B500000: crate::speed_t = 0o010005; ++pub const B576000: crate::speed_t = 0o010006; ++pub const B921600: crate::speed_t = 0o010007; ++pub const B1000000: crate::speed_t = 0o010010; ++pub const B1152000: crate::speed_t = 0o010011; ++pub const B1500000: crate::speed_t = 0o010012; ++pub const B2000000: crate::speed_t = 0o010013; ++pub const B2500000: crate::speed_t = 0o010014; ++pub const B3000000: crate::speed_t = 0o010015; ++pub const B3500000: crate::speed_t = 0o010016; ++pub const B4000000: crate::speed_t = 0o010017; ++ ++pub const VEOL: usize = 11; ++pub const VEOL2: usize = 16; ++pub const VMIN: usize = 6; ++pub const IEXTEN: crate::tcflag_t = 0x00008000; ++pub const TOSTOP: crate::tcflag_t = 0x00000100; ++pub const FLUSHO: crate::tcflag_t = 0x00001000; ++pub const EXTPROC: crate::tcflag_t = 0x00010000; ++ ++pub const TCSANOW: c_int = 0; ++pub const TCSADRAIN: c_int = 1; ++pub const TCSAFLUSH: c_int = 2; ++ ++// Syscall table ++pub const SYS_read: c_long = 63; ++pub const SYS_write: c_long = 64; ++pub const SYS_close: c_long = 57; ++pub const SYS_fstat: c_long = 80; ++pub const SYS_lseek: c_long = 62; ++pub const SYS_mmap: c_long = 222; ++pub const SYS_mprotect: c_long = 226; ++pub const SYS_munmap: c_long = 215; ++pub const SYS_brk: c_long = 214; ++pub const SYS_rt_sigaction: c_long = 134; ++pub const SYS_rt_sigprocmask: c_long = 135; ++pub const SYS_rt_sigreturn: c_long = 139; ++pub const SYS_ioctl: c_long = 29; ++pub const SYS_pread64: c_long = 67; ++pub const SYS_pwrite64: c_long = 68; ++pub const SYS_readv: c_long = 65; ++pub const SYS_writev: c_long = 66; ++pub const SYS_sched_yield: c_long = 124; ++pub const SYS_mremap: c_long = 216; ++pub const SYS_msync: c_long = 227; ++pub const SYS_mincore: c_long = 232; ++pub const SYS_madvise: c_long = 233; ++pub const SYS_shmget: c_long = 194; ++pub const SYS_shmat: c_long = 196; ++pub const SYS_shmctl: c_long = 195; ++pub const SYS_dup: c_long = 23; ++pub const SYS_nanosleep: c_long = 101; ++pub const SYS_getitimer: c_long = 102; ++pub const SYS_setitimer: c_long = 103; ++pub const SYS_getpid: c_long = 172; ++pub const SYS_sendfile: c_long = 71; ++pub const SYS_socket: c_long = 198; ++pub const SYS_connect: c_long = 203; ++pub const SYS_accept: c_long = 202; ++pub const SYS_sendto: c_long = 206; ++pub const SYS_recvfrom: c_long = 207; ++pub const SYS_sendmsg: c_long = 211; ++pub const SYS_recvmsg: c_long = 212; ++pub const SYS_shutdown: c_long = 210; ++pub const SYS_bind: c_long = 200; ++pub const SYS_listen: c_long = 201; ++pub const SYS_getsockname: c_long = 204; ++pub const SYS_getpeername: c_long = 205; ++pub const SYS_socketpair: c_long = 199; ++pub const SYS_setsockopt: c_long = 208; ++pub const SYS_getsockopt: c_long = 209; ++pub const SYS_clone: c_long = 220; ++pub const SYS_execve: c_long = 221; ++pub const SYS_exit: c_long = 93; ++pub const SYS_wait4: c_long = 260; ++pub const SYS_kill: c_long = 129; ++pub const SYS_uname: c_long = 160; ++pub const SYS_semget: c_long = 190; ++pub const SYS_semop: c_long = 193; ++pub const SYS_semctl: c_long = 191; ++pub const SYS_shmdt: c_long = 197; ++pub const SYS_msgget: c_long = 186; ++pub const SYS_msgsnd: c_long = 189; ++pub const SYS_msgrcv: c_long = 188; ++pub const SYS_msgctl: c_long = 187; ++pub const SYS_fcntl: c_long = 25; ++pub const SYS_flock: c_long = 32; ++pub const SYS_fsync: c_long = 82; ++pub const SYS_fdatasync: c_long = 83; ++pub const SYS_truncate: c_long = 45; ++pub const SYS_ftruncate: c_long = 46; ++pub const SYS_getcwd: c_long = 17; ++pub const SYS_chdir: c_long = 49; ++pub const SYS_fchdir: c_long = 50; ++pub const SYS_fchmod: c_long = 52; ++pub const SYS_fchown: c_long = 55; ++pub const SYS_umask: c_long = 166; ++pub const SYS_gettimeofday: c_long = 169; ++pub const SYS_getrlimit: c_long = 163; ++pub const SYS_getrusage: c_long = 165; ++pub const SYS_sysinfo: c_long = 179; ++pub const SYS_times: c_long = 153; ++pub const SYS_ptrace: c_long = 117; ++pub const SYS_getuid: c_long = 174; ++pub const SYS_syslog: c_long = 116; ++pub const SYS_getgid: c_long = 176; ++pub const SYS_setuid: c_long = 146; ++pub const SYS_setgid: c_long = 144; ++pub const SYS_geteuid: c_long = 175; ++pub const SYS_getegid: c_long = 177; ++pub const SYS_setpgid: c_long = 154; ++pub const SYS_getppid: c_long = 173; ++pub const SYS_setsid: c_long = 157; ++pub const SYS_setreuid: c_long = 145; ++pub const SYS_setregid: c_long = 143; ++pub const SYS_getgroups: c_long = 158; ++pub const SYS_setgroups: c_long = 159; ++pub const SYS_setresuid: c_long = 147; ++pub const SYS_getresuid: c_long = 148; ++pub const SYS_setresgid: c_long = 149; ++pub const SYS_getresgid: c_long = 150; ++pub const SYS_getpgid: c_long = 155; ++pub const SYS_setfsuid: c_long = 151; ++pub const SYS_setfsgid: c_long = 152; ++pub const SYS_getsid: c_long = 156; ++pub const SYS_capget: c_long = 90; ++pub const SYS_capset: c_long = 91; ++pub const SYS_rt_sigpending: c_long = 136; ++pub const SYS_rt_sigtimedwait: c_long = 137; ++pub const SYS_rt_sigqueueinfo: c_long = 138; ++pub const SYS_rt_sigsuspend: c_long = 133; ++pub const SYS_sigaltstack: c_long = 132; ++pub const SYS_personality: c_long = 92; ++pub const SYS_statfs: c_long = 43; ++pub const SYS_fstatfs: c_long = 44; ++pub const SYS_getpriority: c_long = 141; ++pub const SYS_setpriority: c_long = 140; ++pub const SYS_sched_setparam: c_long = 118; ++pub const SYS_sched_getparam: c_long = 121; ++pub const SYS_sched_setscheduler: c_long = 119; ++pub const SYS_sched_getscheduler: c_long = 120; ++pub const SYS_sched_get_priority_max: c_long = 125; ++pub const SYS_sched_get_priority_min: c_long = 126; ++pub const SYS_sched_rr_get_interval: c_long = 127; ++pub const SYS_mlock: c_long = 228; ++pub const SYS_munlock: c_long = 229; ++pub const SYS_mlockall: c_long = 230; ++pub const SYS_munlockall: c_long = 231; ++pub const SYS_vhangup: c_long = 58; ++pub const SYS_pivot_root: c_long = 41; ++pub const SYS_prctl: c_long = 167; ++pub const SYS_adjtimex: c_long = 171; ++pub const SYS_setrlimit: c_long = 164; ++pub const SYS_chroot: c_long = 51; ++pub const SYS_sync: c_long = 81; ++pub const SYS_acct: c_long = 89; ++pub const SYS_settimeofday: c_long = 170; ++pub const SYS_mount: c_long = 40; ++pub const SYS_umount2: c_long = 39; ++pub const SYS_swapon: c_long = 224; ++pub const SYS_swapoff: c_long = 225; ++pub const SYS_reboot: c_long = 142; ++pub const SYS_sethostname: c_long = 161; ++pub const SYS_setdomainname: c_long = 162; ++pub const SYS_init_module: c_long = 105; ++pub const SYS_delete_module: c_long = 106; ++pub const SYS_quotactl: c_long = 60; ++pub const SYS_nfsservctl: c_long = 42; ++pub const SYS_gettid: c_long = 178; ++pub const SYS_readahead: c_long = 213; ++pub const SYS_setxattr: c_long = 5; ++pub const SYS_lsetxattr: c_long = 6; ++pub const SYS_fsetxattr: c_long = 7; ++pub const SYS_getxattr: c_long = 8; ++pub const SYS_lgetxattr: c_long = 9; ++pub const SYS_fgetxattr: c_long = 10; ++pub const SYS_listxattr: c_long = 11; ++pub const SYS_llistxattr: c_long = 12; ++pub const SYS_flistxattr: c_long = 13; ++pub const SYS_removexattr: c_long = 14; ++pub const SYS_lremovexattr: c_long = 15; ++pub const SYS_fremovexattr: c_long = 16; ++pub const SYS_tkill: c_long = 130; ++pub const SYS_futex: c_long = 98; ++pub const SYS_sched_setaffinity: c_long = 122; ++pub const SYS_sched_getaffinity: c_long = 123; ++pub const SYS_io_setup: c_long = 0; ++pub const SYS_io_destroy: c_long = 1; ++pub const SYS_io_getevents: c_long = 4; ++pub const SYS_io_submit: c_long = 2; ++pub const SYS_io_cancel: c_long = 3; ++pub const SYS_lookup_dcookie: c_long = 18; ++pub const SYS_remap_file_pages: c_long = 234; ++pub const SYS_getdents64: c_long = 61; ++pub const SYS_set_tid_address: c_long = 96; ++pub const SYS_restart_syscall: c_long = 128; ++pub const SYS_semtimedop: c_long = 192; ++pub const SYS_fadvise64: c_long = 223; ++pub const SYS_timer_create: c_long = 107; ++pub const SYS_timer_settime: c_long = 110; ++pub const SYS_timer_gettime: c_long = 108; ++pub const SYS_timer_getoverrun: c_long = 109; ++pub const SYS_timer_delete: c_long = 111; ++pub const SYS_clock_settime: c_long = 112; ++pub const SYS_clock_gettime: c_long = 113; ++pub const SYS_clock_getres: c_long = 114; ++pub const SYS_clock_nanosleep: c_long = 115; ++pub const SYS_exit_group: c_long = 94; ++pub const SYS_epoll_ctl: c_long = 21; ++pub const SYS_tgkill: c_long = 131; ++pub const SYS_mbind: c_long = 235; ++pub const SYS_set_mempolicy: c_long = 237; ++pub const SYS_get_mempolicy: c_long = 236; ++pub const SYS_mq_open: c_long = 180; ++pub const SYS_mq_unlink: c_long = 181; ++pub const SYS_mq_timedsend: c_long = 182; ++pub const SYS_mq_timedreceive: c_long = 183; ++pub const SYS_mq_notify: c_long = 184; ++pub const SYS_mq_getsetattr: c_long = 185; ++pub const SYS_kexec_load: c_long = 104; ++pub const SYS_waitid: c_long = 95; ++pub const SYS_add_key: c_long = 217; ++pub const SYS_request_key: c_long = 218; ++pub const SYS_keyctl: c_long = 219; ++pub const SYS_ioprio_set: c_long = 30; ++pub const SYS_ioprio_get: c_long = 31; ++pub const SYS_inotify_add_watch: c_long = 27; ++pub const SYS_inotify_rm_watch: c_long = 28; ++pub const SYS_migrate_pages: c_long = 238; ++pub const SYS_openat: c_long = 56; ++pub const SYS_mkdirat: c_long = 34; ++pub const SYS_mknodat: c_long = 33; ++pub const SYS_fchownat: c_long = 54; ++pub const SYS_newfstatat: c_long = 79; ++pub const SYS_unlinkat: c_long = 35; ++pub const SYS_linkat: c_long = 37; ++pub const SYS_symlinkat: c_long = 36; ++pub const SYS_readlinkat: c_long = 78; ++pub const SYS_fchmodat: c_long = 53; ++pub const SYS_faccessat: c_long = 48; ++pub const SYS_pselect6: c_long = 72; ++pub const SYS_ppoll: c_long = 73; ++pub const SYS_unshare: c_long = 97; ++pub const SYS_set_robust_list: c_long = 99; ++pub const SYS_get_robust_list: c_long = 100; ++pub const SYS_splice: c_long = 76; ++pub const SYS_tee: c_long = 77; ++pub const SYS_sync_file_range: c_long = 84; ++pub const SYS_vmsplice: c_long = 75; ++pub const SYS_move_pages: c_long = 239; ++pub const SYS_utimensat: c_long = 88; ++pub const SYS_epoll_pwait: c_long = 22; ++pub const SYS_timerfd_create: c_long = 85; ++pub const SYS_fallocate: c_long = 47; ++pub const SYS_timerfd_settime: c_long = 86; ++pub const SYS_timerfd_gettime: c_long = 87; ++pub const SYS_accept4: c_long = 242; ++pub const SYS_signalfd4: c_long = 74; ++pub const SYS_eventfd2: c_long = 19; ++pub const SYS_epoll_create1: c_long = 20; ++pub const SYS_dup3: c_long = 24; ++pub const SYS_pipe2: c_long = 59; ++pub const SYS_inotify_init1: c_long = 26; ++pub const SYS_preadv: c_long = 69; ++pub const SYS_pwritev: c_long = 70; ++pub const SYS_rt_tgsigqueueinfo: c_long = 240; ++pub const SYS_perf_event_open: c_long = 241; ++pub const SYS_recvmmsg: c_long = 243; ++pub const SYS_fanotify_init: c_long = 262; ++pub const SYS_fanotify_mark: c_long = 263; ++pub const SYS_prlimit64: c_long = 261; ++pub const SYS_name_to_handle_at: c_long = 264; ++pub const SYS_open_by_handle_at: c_long = 265; ++pub const SYS_clock_adjtime: c_long = 266; ++pub const SYS_syncfs: c_long = 267; ++pub const SYS_sendmmsg: c_long = 269; ++pub const SYS_setns: c_long = 268; ++pub const SYS_getcpu: c_long = 168; ++pub const SYS_process_vm_readv: c_long = 270; ++pub const SYS_process_vm_writev: c_long = 271; ++pub const SYS_kcmp: c_long = 272; ++pub const SYS_finit_module: c_long = 273; ++pub const SYS_sched_setattr: c_long = 274; ++pub const SYS_sched_getattr: c_long = 275; ++pub const SYS_renameat2: c_long = 276; ++pub const SYS_seccomp: c_long = 277; ++pub const SYS_getrandom: c_long = 278; ++pub const SYS_memfd_create: c_long = 279; ++pub const SYS_bpf: c_long = 280; ++pub const SYS_execveat: c_long = 281; ++pub const SYS_userfaultfd: c_long = 282; ++pub const SYS_membarrier: c_long = 283; ++pub const SYS_mlock2: c_long = 284; ++pub const SYS_copy_file_range: c_long = 285; ++pub const SYS_preadv2: c_long = 286; ++pub const SYS_pwritev2: c_long = 287; ++pub const SYS_pkey_mprotect: c_long = 288; ++pub const SYS_pkey_alloc: c_long = 289; ++pub const SYS_pkey_free: c_long = 290; ++pub const SYS_statx: c_long = 291; ++pub const SYS_rseq: c_long = 293; ++pub const SYS_syscall: c_long = 294; ++pub const SYS_pidfd_send_signal: c_long = 424; ++pub const SYS_io_uring_setup: c_long = 425; ++pub const SYS_io_uring_enter: c_long = 426; ++pub const SYS_io_uring_register: c_long = 427; ++pub const SYS_open_tree: c_long = 428; ++pub const SYS_move_mount: c_long = 429; ++pub const SYS_fsopen: c_long = 430; ++pub const SYS_fsconfig: c_long = 431; ++pub const SYS_fsmount: c_long = 432; ++pub const SYS_fspick: c_long = 433; ++pub const SYS_pidfd_open: c_long = 434; ++pub const SYS_clone3: c_long = 435; ++pub const SYS_close_range: c_long = 436; ++pub const SYS_openat2: c_long = 437; ++pub const SYS_pidfd_getfd: c_long = 438; ++pub const SYS_faccessat2: c_long = 439; ++pub const SYS_process_madvise: c_long = 440; ++pub const SYS_epoll_pwait2: c_long = 441; ++pub const SYS_mount_setattr: c_long = 442; ++pub const SYS_quotactl_fd: c_long = 443; ++pub const SYS_landlock_create_ruleset: c_long = 444; ++pub const SYS_landlock_add_rule: c_long = 445; ++pub const SYS_landlock_restrict_self: c_long = 446; ++pub const SYS_memfd_secret: c_long = 447; ++pub const SYS_process_mrelease: c_long = 448; ++pub const SYS_futex_waitv: c_long = 449; ++pub const SYS_set_mempolicy_home_node: c_long = 450; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/generic.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/generic.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/generic.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/generic.rs 2024-12-28 15:35:00.000000000 -0500 +@@ -0,0 +1,34 @@ ++s! { ++ pub struct stat { ++ pub st_dev: crate::dev_t, ++ #[cfg(not(gnu_time64_abi))] ++ _pad1: i32, ++ pub st_ino: crate::ino_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ #[cfg(not(gnu_time64_abi))] ++ __pad2: i32, ++ pub st_size: crate::off_t, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: crate::c_long, ++ #[cfg(gnu_time64_abi)] ++ __pad3: i32, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: crate::c_long, ++ #[cfg(gnu_time64_abi)] ++ __pad4: i32, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: crate::c_long, ++ #[cfg(gnu_time64_abi)] ++ __pad5: i32, ++ #[cfg(not(gnu_time64_abi))] ++ __unused4: crate::c_long, ++ #[cfg(not(gnu_time64_abi))] ++ __unused5: crate::c_long, ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/m68k/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/m68k/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/m68k/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/m68k/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,861 @@ ++use crate::prelude::*; ++use crate::{off64_t, off_t}; ++ ++pub type c_char = i8; ++pub type wchar_t = i32; ++ ++s! { ++ pub struct sigaction { ++ pub sa_sigaction: crate::sighandler_t, ++ pub sa_mask: crate::sigset_t, ++ pub sa_flags: c_int, ++ pub sa_restorer: Option, ++ } ++ ++ pub struct statfs { ++ pub f_type: crate::__fsword_t, ++ pub f_bsize: crate::__fsword_t, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_fsid: crate::fsid_t, ++ ++ pub f_namelen: crate::__fsword_t, ++ pub f_frsize: crate::__fsword_t, ++ pub f_flags: crate::__fsword_t, ++ f_spare: [crate::__fsword_t; 4], ++ } ++ ++ pub struct flock { ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ pub l_start: off_t, ++ pub l_len: off_t, ++ pub l_pid: crate::pid_t, ++ } ++ ++ pub struct flock64 { ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ pub l_start: off64_t, ++ pub l_len: off64_t, ++ pub l_pid: crate::pid_t, ++ } ++ ++ pub struct ipc_perm { ++ __key: crate::key_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub cuid: crate::uid_t, ++ pub cgid: crate::gid_t, ++ pub mode: crate::mode_t, ++ __seq: c_ushort, ++ __pad1: c_ushort, ++ __glibc_reserved1: c_ulong, ++ __glibc_reserved2: c_ulong, ++ } ++ ++ pub struct stat64 { ++ pub st_dev: crate::dev_t, ++ __pad1: c_ushort, ++ pub __st_ino: crate::ino_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ __pad2: c_ushort, ++ pub st_size: off64_t, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt64_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_ulong, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_ulong, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_ulong, ++ pub st_ino: crate::ino64_t, ++ } ++ ++ pub struct statfs64 { ++ pub f_type: crate::__fsword_t, ++ pub f_bsize: crate::__fsword_t, ++ pub f_blocks: crate::fsblkcnt64_t, ++ pub f_bfree: crate::fsblkcnt64_t, ++ pub f_bavail: crate::fsblkcnt64_t, ++ pub f_files: crate::fsblkcnt64_t, ++ pub f_ffree: crate::fsblkcnt64_t, ++ pub f_fsid: crate::fsid_t, ++ pub f_namelen: crate::__fsword_t, ++ pub f_frsize: crate::__fsword_t, ++ pub f_flags: crate::__fsword_t, ++ pub f_spare: [crate::__fsword_t; 4], ++ } ++ ++ pub struct statvfs64 { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: crate::fsblkcnt64_t, ++ pub f_bfree: crate::fsblkcnt64_t, ++ pub f_bavail: crate::fsblkcnt64_t, ++ pub f_files: crate::fsblkcnt64_t, ++ pub f_ffree: crate::fsblkcnt64_t, ++ pub f_favail: crate::fsblkcnt64_t, ++ pub f_fsid: c_ulong, ++ __f_unused: c_int, ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ __f_spare: [c_int; 6], ++ } ++ ++ pub struct shmid_ds { ++ pub shm_perm: crate::ipc_perm, ++ pub shm_segsz: size_t, ++ pub shm_atime: crate::time_t, ++ __glibc_reserved1: c_long, ++ pub shm_dtime: crate::time_t, ++ __glibc_reserved2: c_long, ++ pub shm_ctime: crate::time_t, ++ __glibc_reserved3: c_long, ++ pub shm_cpid: crate::pid_t, ++ pub shm_lpid: crate::pid_t, ++ pub shm_nattch: crate::shmatt_t, ++ __glibc_reserved5: c_ulong, ++ __glibc_reserved6: c_ulong, ++ } ++ ++ pub struct msqid_ds { ++ pub msg_perm: crate::ipc_perm, ++ pub msg_stime: crate::time_t, ++ __glibc_reserved1: c_uint, ++ pub msg_rtime: crate::time_t, ++ __glibc_reserved2: c_uint, ++ pub msg_ctime: crate::time_t, ++ __glibc_reserved3: c_uint, ++ __msg_cbytes: c_ulong, ++ pub msg_qnum: crate::msgqnum_t, ++ pub msg_qbytes: crate::msglen_t, ++ pub msg_lspid: crate::pid_t, ++ pub msg_lrpid: crate::pid_t, ++ __glibc_reserved4: c_ulong, ++ __glibc_reserved5: c_ulong, ++ } ++ ++ pub struct siginfo_t { ++ pub si_signo: c_int, ++ pub si_code: c_int, ++ pub si_errno: c_int, ++ _pad: [c_int; 29], ++ _align: [usize; 0], ++ } ++ ++ pub struct stack_t { ++ pub ss_sp: *mut c_void, ++ pub ss_flags: c_int, ++ pub ss_size: size_t, ++ } ++} ++ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ #[repr(align(2))] ++ pub struct max_align_t { ++ priv_: [i8; 20], ++ } ++} ++ ++pub const VEOF: usize = 4; ++pub const RTLD_DEEPBIND: c_int = 0x8; ++pub const RTLD_GLOBAL: c_int = 0x100; ++pub const RTLD_NOLOAD: c_int = 0x4; ++pub const O_DIRECT: c_int = 0x10000; ++pub const O_DIRECTORY: c_int = 0x4000; ++pub const O_NOFOLLOW: c_int = 0x8000; ++pub const O_LARGEFILE: c_int = 0x20000; ++pub const O_APPEND: c_int = 1024; ++pub const O_CREAT: c_int = 64; ++pub const O_EXCL: c_int = 128; ++pub const O_NOCTTY: c_int = 256; ++pub const O_NONBLOCK: c_int = 2048; ++pub const O_SYNC: c_int = 1052672; ++pub const O_RSYNC: c_int = 1052672; ++pub const O_DSYNC: c_int = 4096; ++pub const O_FSYNC: c_int = 0x101000; ++pub const O_ASYNC: c_int = 0x2000; ++pub const O_NDELAY: c_int = 0x800; ++ ++pub const MADV_SOFT_OFFLINE: c_int = 101; ++pub const MAP_LOCKED: c_int = 0x02000; ++pub const MAP_NORESERVE: c_int = 0x04000; ++pub const MAP_32BIT: c_int = 0x0040; ++pub const MAP_ANON: c_int = 0x0020; ++pub const MAP_ANONYMOUS: c_int = 0x0020; ++pub const MAP_DENYWRITE: c_int = 0x0800; ++pub const MAP_EXECUTABLE: c_int = 0x01000; ++pub const MAP_POPULATE: c_int = 0x08000; ++pub const MAP_NONBLOCK: c_int = 0x010000; ++pub const MAP_STACK: c_int = 0x020000; ++pub const MAP_HUGETLB: c_int = 0x040000; ++pub const MAP_GROWSDOWN: c_int = 0x0100; ++pub const MAP_SYNC: c_int = 0x080000; ++ ++pub const EDEADLOCK: c_int = 35; ++pub const EUCLEAN: c_int = 117; ++pub const ENOTNAM: c_int = 118; ++pub const ENAVAIL: c_int = 119; ++pub const EISNAM: c_int = 120; ++pub const EREMOTEIO: c_int = 121; ++pub const EDEADLK: c_int = 35; ++pub const ENAMETOOLONG: c_int = 36; ++pub const ENOLCK: c_int = 37; ++pub const ENOSYS: c_int = 38; ++pub const ENOTEMPTY: c_int = 39; ++pub const ELOOP: c_int = 40; ++pub const ENOMSG: c_int = 42; ++pub const EIDRM: c_int = 43; ++pub const ECHRNG: c_int = 44; ++pub const EL2NSYNC: c_int = 45; ++pub const EL3HLT: c_int = 46; ++pub const EL3RST: c_int = 47; ++pub const ELNRNG: c_int = 48; ++pub const EUNATCH: c_int = 49; ++pub const ENOCSI: c_int = 50; ++pub const EL2HLT: c_int = 51; ++pub const EBADE: c_int = 52; ++pub const EBADR: c_int = 53; ++pub const EXFULL: c_int = 54; ++pub const ENOANO: c_int = 55; ++pub const EBADRQC: c_int = 56; ++pub const EBADSLT: c_int = 57; ++pub const EMULTIHOP: c_int = 72; ++pub const EOVERFLOW: c_int = 75; ++pub const ENOTUNIQ: c_int = 76; ++pub const EBADFD: c_int = 77; ++pub const EBADMSG: c_int = 74; ++pub const EREMCHG: c_int = 78; ++pub const ELIBACC: c_int = 79; ++pub const ELIBBAD: c_int = 80; ++pub const ELIBSCN: c_int = 81; ++pub const ELIBMAX: c_int = 82; ++pub const ELIBEXEC: c_int = 83; ++pub const EILSEQ: c_int = 84; ++pub const ERESTART: c_int = 85; ++pub const ESTRPIPE: c_int = 86; ++pub const EUSERS: c_int = 87; ++pub const ENOTSOCK: c_int = 88; ++pub const EDESTADDRREQ: c_int = 89; ++pub const EMSGSIZE: c_int = 90; ++pub const EPROTOTYPE: c_int = 91; ++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 EPFNOSUPPORT: c_int = 96; ++pub const EAFNOSUPPORT: c_int = 97; ++pub const EADDRINUSE: c_int = 98; ++pub const EADDRNOTAVAIL: c_int = 99; ++pub const ENETDOWN: c_int = 100; ++pub const ENETUNREACH: c_int = 101; ++pub const ENETRESET: c_int = 102; ++pub const ECONNABORTED: c_int = 103; ++pub const ECONNRESET: c_int = 104; ++pub const ENOBUFS: c_int = 105; ++pub const EISCONN: c_int = 106; ++pub const ENOTCONN: c_int = 107; ++pub const ESHUTDOWN: c_int = 108; ++pub const ETOOMANYREFS: c_int = 109; ++pub const ETIMEDOUT: c_int = 110; ++pub const ECONNREFUSED: c_int = 111; ++pub const EHOSTDOWN: c_int = 112; ++pub const EHOSTUNREACH: c_int = 113; ++pub const EALREADY: c_int = 114; ++pub const EINPROGRESS: c_int = 115; ++pub const ESTALE: c_int = 116; ++pub const EDQUOT: c_int = 122; ++pub const ENOMEDIUM: c_int = 123; ++pub const EMEDIUMTYPE: c_int = 124; ++pub const ECANCELED: c_int = 125; ++pub const ENOKEY: c_int = 126; ++pub const EKEYEXPIRED: c_int = 127; ++pub const EKEYREVOKED: c_int = 128; ++pub const EKEYREJECTED: c_int = 129; ++pub const EOWNERDEAD: c_int = 130; ++pub const ENOTRECOVERABLE: c_int = 131; ++pub const EHWPOISON: c_int = 133; ++pub const ERFKILL: c_int = 132; ++ ++pub const SA_SIGINFO: c_int = 0x00000004; ++pub const SA_NOCLDWAIT: c_int = 0x00000002; ++ ++pub const SOCK_STREAM: c_int = 1; ++pub const SOCK_DGRAM: c_int = 2; ++ ++pub const F_GETLK: c_int = 5; ++pub const F_GETOWN: c_int = 9; ++pub const F_SETOWN: c_int = 8; ++ ++pub const PTRACE_GETFPXREGS: c_uint = 18; ++pub const PTRACE_SETFPXREGS: c_uint = 19; ++pub const PTRACE_SYSEMU: c_uint = 31; ++pub const PTRACE_SYSEMU_SINGLESTEP: c_uint = 32; ++ ++pub const MCL_CURRENT: c_int = 0x0001; ++pub const MCL_FUTURE: c_int = 0x0002; ++pub const MCL_ONFAULT: c_int = 0x0004; ++ ++pub const POLLWRNORM: c_short = 0x100; ++pub const POLLWRBAND: c_short = 0x200; ++ ++pub const EFD_NONBLOCK: c_int = 0x800; ++pub const SFD_NONBLOCK: c_int = 0x0800; ++ ++pub const SIGCHLD: c_int = 17; ++pub const SIGBUS: c_int = 7; ++pub const SIGUSR1: c_int = 10; ++pub const SIGUSR2: c_int = 12; ++pub const SIGCONT: c_int = 18; ++pub const SIGSTOP: c_int = 19; ++pub const SIGTSTP: c_int = 20; ++pub const SIGURG: c_int = 23; ++pub const SIGIO: c_int = 29; ++pub const SIGSYS: c_int = 31; ++pub const SIGSTKFLT: c_int = 16; ++#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")] ++pub const SIGUNUSED: c_int = 31; ++pub const SIGPOLL: c_int = 29; ++pub const SIGPWR: c_int = 30; ++pub const SIG_SETMASK: c_int = 2; ++pub const SIG_BLOCK: c_int = 0x000000; ++pub const SIG_UNBLOCK: c_int = 0x01; ++pub const SIGTTIN: c_int = 21; ++pub const SIGTTOU: c_int = 22; ++pub const SIGXCPU: c_int = 24; ++pub const SIGXFSZ: c_int = 25; ++pub const SIGVTALRM: c_int = 26; ++pub const SIGPROF: c_int = 27; ++pub const SIGWINCH: c_int = 28; ++pub const SIGSTKSZ: size_t = 8192; ++pub const MINSIGSTKSZ: size_t = 2048; ++pub const CBAUD: crate::tcflag_t = 0o0010017; ++pub const TAB1: crate::tcflag_t = 0x00000800; ++pub const TAB2: crate::tcflag_t = 0x00001000; ++pub const TAB3: crate::tcflag_t = 0x00001800; ++pub const CR1: crate::tcflag_t = 0x00000200; ++pub const CR2: crate::tcflag_t = 0x00000400; ++pub const CR3: crate::tcflag_t = 0x00000600; ++pub const FF1: crate::tcflag_t = 0x00008000; ++pub const BS1: crate::tcflag_t = 0x00002000; ++pub const VT1: crate::tcflag_t = 0x00004000; ++pub const VWERASE: usize = 14; ++pub const VREPRINT: usize = 12; ++pub const VSUSP: usize = 10; ++pub const VSTART: usize = 8; ++pub const VSTOP: usize = 9; ++pub const VDISCARD: usize = 13; ++pub const VTIME: usize = 5; ++pub const IXON: crate::tcflag_t = 0x00000400; ++pub const IXOFF: crate::tcflag_t = 0x00001000; ++pub const ONLCR: crate::tcflag_t = 0x4; ++pub const CSIZE: crate::tcflag_t = 0x00000030; ++pub const CS6: crate::tcflag_t = 0x00000010; ++pub const CS7: crate::tcflag_t = 0x00000020; ++pub const CS8: crate::tcflag_t = 0x00000030; ++pub const CSTOPB: crate::tcflag_t = 0x00000040; ++pub const CREAD: crate::tcflag_t = 0x00000080; ++pub const PARENB: crate::tcflag_t = 0x00000100; ++pub const PARODD: crate::tcflag_t = 0x00000200; ++pub const HUPCL: crate::tcflag_t = 0x00000400; ++pub const CLOCAL: crate::tcflag_t = 0x00000800; ++pub const ECHOKE: crate::tcflag_t = 0x00000800; ++pub const ECHOE: crate::tcflag_t = 0x00000010; ++pub const ECHOK: crate::tcflag_t = 0x00000020; ++pub const ECHONL: crate::tcflag_t = 0x00000040; ++pub const ECHOPRT: crate::tcflag_t = 0x00000400; ++pub const ECHOCTL: crate::tcflag_t = 0x00000200; ++pub const ISIG: crate::tcflag_t = 0x00000001; ++pub const ICANON: crate::tcflag_t = 0x00000002; ++pub const PENDIN: crate::tcflag_t = 0x00004000; ++pub const NOFLSH: crate::tcflag_t = 0x00000080; ++pub const CIBAUD: crate::tcflag_t = 0o02003600000; ++pub const CBAUDEX: crate::tcflag_t = 0o010000; ++pub const VSWTC: usize = 7; ++pub const OLCUC: crate::tcflag_t = 0o000002; ++pub const NLDLY: crate::tcflag_t = 0o000400; ++pub const CRDLY: crate::tcflag_t = 0o003000; ++pub const TABDLY: crate::tcflag_t = 0o014000; ++pub const BSDLY: crate::tcflag_t = 0o020000; ++pub const FFDLY: crate::tcflag_t = 0o100000; ++pub const VTDLY: crate::tcflag_t = 0o040000; ++pub const XTABS: crate::tcflag_t = 0o014000; ++ ++pub const B0: crate::speed_t = 0o000000; ++pub const B50: crate::speed_t = 0o000001; ++pub const B75: crate::speed_t = 0o000002; ++pub const B110: crate::speed_t = 0o000003; ++pub const B134: crate::speed_t = 0o000004; ++pub const B150: crate::speed_t = 0o000005; ++pub const B200: crate::speed_t = 0o000006; ++pub const B300: crate::speed_t = 0o000007; ++pub const B600: crate::speed_t = 0o000010; ++pub const B1200: crate::speed_t = 0o000011; ++pub const B1800: crate::speed_t = 0o000012; ++pub const B2400: crate::speed_t = 0o000013; ++pub const B4800: crate::speed_t = 0o000014; ++pub const B9600: crate::speed_t = 0o000015; ++pub const B19200: crate::speed_t = 0o000016; ++pub const B38400: crate::speed_t = 0o000017; ++pub const EXTA: crate::speed_t = B19200; ++pub const EXTB: crate::speed_t = B38400; ++pub const B57600: crate::speed_t = 0o010001; ++pub const B115200: crate::speed_t = 0o010002; ++pub const B230400: crate::speed_t = 0o010003; ++pub const B460800: crate::speed_t = 0o010004; ++pub const B500000: crate::speed_t = 0o010005; ++pub const B576000: crate::speed_t = 0o010006; ++pub const B921600: crate::speed_t = 0o010007; ++pub const B1000000: crate::speed_t = 0o010010; ++pub const B1152000: crate::speed_t = 0o010011; ++pub const B1500000: crate::speed_t = 0o010012; ++pub const B2000000: crate::speed_t = 0o010013; ++pub const B2500000: crate::speed_t = 0o010014; ++pub const B3000000: crate::speed_t = 0o010015; ++pub const B3500000: crate::speed_t = 0o010016; ++pub const B4000000: crate::speed_t = 0o010017; ++ ++pub const VEOL: usize = 11; ++pub const VEOL2: usize = 16; ++pub const VMIN: usize = 6; ++pub const IEXTEN: crate::tcflag_t = 0x00008000; ++pub const TOSTOP: crate::tcflag_t = 0x00000100; ++pub const FLUSHO: crate::tcflag_t = 0x00001000; ++pub const EXTPROC: crate::tcflag_t = 0x00010000; ++ ++pub const TCSANOW: c_int = 0; ++pub const TCSADRAIN: c_int = 1; ++pub const TCSAFLUSH: c_int = 2; ++ ++pub const SYS_restart_syscall: c_long = 0; ++pub const SYS_exit: c_long = 1; ++pub const SYS_fork: c_long = 2; ++pub const SYS_read: c_long = 3; ++pub const SYS_write: c_long = 4; ++pub const SYS_open: c_long = 5; ++pub const SYS_close: c_long = 6; ++pub const SYS_waitpid: c_long = 7; ++pub const SYS_creat: c_long = 8; ++pub const SYS_link: c_long = 9; ++pub const SYS_unlink: c_long = 10; ++pub const SYS_execve: c_long = 11; ++pub const SYS_chdir: c_long = 12; ++pub const SYS_time32: c_long = 13; ++pub const SYS_mknod: c_long = 14; ++pub const SYS_chmod: c_long = 15; ++pub const SYS_chown16: c_long = 16; ++pub const SYS_stat: c_long = 18; ++pub const SYS_lseek: c_long = 19; ++pub const SYS_getpid: c_long = 20; ++pub const SYS_mount: c_long = 21; ++pub const SYS_oldumount: c_long = 22; ++pub const SYS_setuid16: c_long = 23; ++pub const SYS_getuid16: c_long = 24; ++pub const SYS_stime32: c_long = 25; ++pub const SYS_ptrace: c_long = 26; ++pub const SYS_alarm: c_long = 27; ++pub const SYS_fstat: c_long = 28; ++pub const SYS_pause: c_long = 29; ++pub const SYS_utime32: c_long = 30; ++pub const SYS_access: c_long = 33; ++pub const SYS_nice: c_long = 34; ++pub const SYS_sync: c_long = 36; ++pub const SYS_kill: c_long = 37; ++pub const SYS_rename: c_long = 38; ++pub const SYS_mkdir: c_long = 39; ++pub const SYS_rmdir: c_long = 40; ++pub const SYS_dup: c_long = 41; ++pub const SYS_pipe: c_long = 42; ++pub const SYS_times: c_long = 43; ++pub const SYS_brk: c_long = 45; ++pub const SYS_setgid16: c_long = 46; ++pub const SYS_getgid16: c_long = 47; ++pub const SYS_signal: c_long = 48; ++pub const SYS_geteuid16: c_long = 49; ++pub const SYS_getegid16: c_long = 50; ++pub const SYS_acct: c_long = 51; ++pub const SYS_umount: c_long = 52; ++pub const SYS_ioctl: c_long = 54; ++pub const SYS_fcntl: c_long = 55; ++pub const SYS_setpgid: c_long = 57; ++pub const SYS_umask: c_long = 60; ++pub const SYS_chroot: c_long = 61; ++pub const SYS_ustat: c_long = 62; ++pub const SYS_dup2: c_long = 63; ++pub const SYS_getppid: c_long = 64; ++pub const SYS_getpgrp: c_long = 65; ++pub const SYS_setsid: c_long = 66; ++pub const SYS_sigaction: c_long = 67; ++pub const SYS_sgetmask: c_long = 68; ++pub const SYS_ssetmask: c_long = 69; ++pub const SYS_setreuid16: c_long = 70; ++pub const SYS_setregid16: c_long = 71; ++pub const SYS_sigsuspend: c_long = 72; ++pub const SYS_sigpending: c_long = 73; ++pub const SYS_sethostname: c_long = 74; ++pub const SYS_setrlimit: c_long = 75; ++pub const SYS_old_getrlimit: c_long = 76; ++pub const SYS_getrusage: c_long = 77; ++pub const SYS_gettimeofday: c_long = 78; ++pub const SYS_settimeofday: c_long = 79; ++pub const SYS_getgroups16: c_long = 80; ++pub const SYS_setgroups16: c_long = 81; ++pub const SYS_old_select: c_long = 82; ++pub const SYS_symlink: c_long = 83; ++pub const SYS_lstat: c_long = 84; ++pub const SYS_readlink: c_long = 85; ++pub const SYS_uselib: c_long = 86; ++pub const SYS_swapon: c_long = 87; ++pub const SYS_reboot: c_long = 88; ++pub const SYS_old_readdir: c_long = 89; ++pub const SYS_old_mmap: c_long = 90; ++pub const SYS_munmap: c_long = 91; ++pub const SYS_truncate: c_long = 92; ++pub const SYS_ftruncate: c_long = 93; ++pub const SYS_fchmod: c_long = 94; ++pub const SYS_fchown16: c_long = 95; ++pub const SYS_getpriority: c_long = 96; ++pub const SYS_setpriority: c_long = 97; ++pub const SYS_statfs: c_long = 99; ++pub const SYS_fstatfs: c_long = 100; ++pub const SYS_socketcall: c_long = 102; ++pub const SYS_syslog: c_long = 103; ++pub const SYS_setitimer: c_long = 104; ++pub const SYS_getitimer: c_long = 105; ++pub const SYS_newstat: c_long = 106; ++pub const SYS_newlstat: c_long = 107; ++pub const SYS_newfstat: c_long = 108; ++pub const SYS_vhangup: c_long = 111; ++pub const SYS_wait4: c_long = 114; ++pub const SYS_swapoff: c_long = 115; ++pub const SYS_sysinfo: c_long = 116; ++pub const SYS_ipc: c_long = 117; ++pub const SYS_fsync: c_long = 118; ++pub const SYS_sigreturn: c_long = 119; ++pub const SYS_clone: c_long = 120; ++pub const SYS_setdomainname: c_long = 121; ++pub const SYS_newuname: c_long = 122; ++pub const SYS_cacheflush: c_long = 123; ++pub const SYS_adjtimex_time32: c_long = 124; ++pub const SYS_mprotect: c_long = 125; ++pub const SYS_sigprocmask: c_long = 126; ++pub const SYS_create_module: c_long = 127; ++pub const SYS_init_module: c_long = 128; ++pub const SYS_delete_module: c_long = 129; ++pub const SYS_get_kernel_syms: c_long = 130; ++pub const SYS_quotactl: c_long = 131; ++pub const SYS_getpgid: c_long = 132; ++pub const SYS_fchdir: c_long = 133; ++pub const SYS_bdflush: c_long = 134; ++pub const SYS_sysfs: c_long = 135; ++pub const SYS_personality: c_long = 136; ++pub const SYS_setfsuid16: c_long = 138; ++pub const SYS_setfsgid16: c_long = 139; ++pub const SYS_llseek: c_long = 140; ++pub const SYS_getdents: c_long = 141; ++pub const SYS_select: c_long = 142; ++pub const SYS_flock: c_long = 143; ++pub const SYS_msync: c_long = 144; ++pub const SYS_readv: c_long = 145; ++pub const SYS_writev: c_long = 146; ++pub const SYS_getsid: c_long = 147; ++pub const SYS_fdatasync: c_long = 148; ++pub const SYS__sysctl: c_long = 149; ++pub const SYS_mlock: c_long = 150; ++pub const SYS_munlock: c_long = 151; ++pub const SYS_mlockall: c_long = 152; ++pub const SYS_munlockall: c_long = 153; ++pub const SYS_sched_setparam: c_long = 154; ++pub const SYS_sched_getparam: c_long = 155; ++pub const SYS_sched_setscheduler: c_long = 156; ++pub const SYS_sched_getscheduler: c_long = 157; ++pub const SYS_sched_yield: c_long = 158; ++pub const SYS_sched_get_priority_max: c_long = 159; ++pub const SYS_sched_get_priority_min: c_long = 160; ++pub const SYS_sched_rr_get_interval_time32: c_long = 161; ++pub const SYS_nanosleep_time32: c_long = 162; ++pub const SYS_mremap: c_long = 163; ++pub const SYS_setresuid16: c_long = 164; ++pub const SYS_getresuid16: c_long = 165; ++pub const SYS_getpagesize: c_long = 166; ++pub const SYS_query_module: c_long = 167; ++pub const SYS_poll: c_long = 168; ++pub const SYS_nfsservctl: c_long = 169; ++pub const SYS_setresgid16: c_long = 170; ++pub const SYS_getresgid16: c_long = 171; ++pub const SYS_prctl: c_long = 172; ++pub const SYS_rt_sigreturn: c_long = 173; ++pub const SYS_rt_sigaction: c_long = 174; ++pub const SYS_rt_sigprocmask: c_long = 175; ++pub const SYS_rt_sigpending: c_long = 176; ++pub const SYS_rt_sigtimedwait_time32: c_long = 177; ++pub const SYS_rt_sigqueueinfo: c_long = 178; ++pub const SYS_rt_sigsuspend: c_long = 179; ++pub const SYS_pread64: c_long = 180; ++pub const SYS_pwrite64: c_long = 181; ++pub const SYS_lchown16: c_long = 182; ++pub const SYS_getcwd: c_long = 183; ++pub const SYS_capget: c_long = 184; ++pub const SYS_capset: c_long = 185; ++pub const SYS_sigaltstack: c_long = 186; ++pub const SYS_sendfile: c_long = 187; ++pub const SYS_getpmsg: c_long = 188; ++pub const SYS_putpmsg: c_long = 189; ++pub const SYS_vfork: c_long = 190; ++pub const SYS_getrlimit: c_long = 191; ++pub const SYS_mmap2: c_long = 192; ++pub const SYS_truncate64: c_long = 193; ++pub const SYS_ftruncate64: c_long = 194; ++pub const SYS_stat64: c_long = 195; ++pub const SYS_lstat64: c_long = 196; ++pub const SYS_fstat64: c_long = 197; ++pub const SYS_chown: c_long = 198; ++pub const SYS_getuid: c_long = 199; ++pub const SYS_getgid: c_long = 200; ++pub const SYS_geteuid: c_long = 201; ++pub const SYS_getegid: c_long = 202; ++pub const SYS_setreuid: c_long = 203; ++pub const SYS_setregid: c_long = 204; ++pub const SYS_getgroups: c_long = 205; ++pub const SYS_setgroups: c_long = 206; ++pub const SYS_fchown: c_long = 207; ++pub const SYS_setresuid: c_long = 208; ++pub const SYS_getresuid: c_long = 209; ++pub const SYS_setresgid: c_long = 210; ++pub const SYS_getresgid: c_long = 211; ++pub const SYS_lchown: c_long = 212; ++pub const SYS_setuid: c_long = 213; ++pub const SYS_setgid: c_long = 214; ++pub const SYS_setfsuid: c_long = 215; ++pub const SYS_setfsgid: c_long = 216; ++pub const SYS_pivot_root: c_long = 217; ++pub const SYS_getdents64: c_long = 220; ++pub const SYS_gettid: c_long = 221; ++pub const SYS_tkill: c_long = 222; ++pub const SYS_setxattr: c_long = 223; ++pub const SYS_lsetxattr: c_long = 224; ++pub const SYS_fsetxattr: c_long = 225; ++pub const SYS_getxattr: c_long = 226; ++pub const SYS_lgetxattr: c_long = 227; ++pub const SYS_fgetxattr: c_long = 228; ++pub const SYS_listxattr: c_long = 229; ++pub const SYS_llistxattr: c_long = 230; ++pub const SYS_flistxattr: c_long = 231; ++pub const SYS_removexattr: c_long = 232; ++pub const SYS_lremovexattr: c_long = 233; ++pub const SYS_fremovexattr: c_long = 234; ++pub const SYS_futex_time32: c_long = 235; ++pub const SYS_sendfile64: c_long = 236; ++pub const SYS_mincore: c_long = 237; ++pub const SYS_madvise: c_long = 238; ++pub const SYS_fcntl64: c_long = 239; ++pub const SYS_readahead: c_long = 240; ++pub const SYS_io_setup: c_long = 241; ++pub const SYS_io_destroy: c_long = 242; ++pub const SYS_io_getevents_time32: c_long = 243; ++pub const SYS_io_submit: c_long = 244; ++pub const SYS_io_cancel: c_long = 245; ++pub const SYS_fadvise64: c_long = 246; ++pub const SYS_exit_group: c_long = 247; ++pub const SYS_lookup_dcookie: c_long = 248; ++pub const SYS_epoll_create: c_long = 249; ++pub const SYS_epoll_ctl: c_long = 250; ++pub const SYS_epoll_wait: c_long = 251; ++pub const SYS_remap_file_pages: c_long = 252; ++pub const SYS_set_tid_address: c_long = 253; ++pub const SYS_timer_create: c_long = 254; ++pub const SYS_timer_settime32: c_long = 255; ++pub const SYS_timer_gettime32: c_long = 256; ++pub const SYS_timer_getoverrun: c_long = 257; ++pub const SYS_timer_delete: c_long = 258; ++pub const SYS_clock_settime32: c_long = 259; ++pub const SYS_clock_gettime32: c_long = 260; ++pub const SYS_clock_getres_time32: c_long = 261; ++pub const SYS_clock_nanosleep_time32: c_long = 262; ++pub const SYS_statfs64: c_long = 263; ++pub const SYS_fstatfs64: c_long = 264; ++pub const SYS_tgkill: c_long = 265; ++pub const SYS_utimes_time32: c_long = 266; ++pub const SYS_fadvise64_64: c_long = 267; ++pub const SYS_mbind: c_long = 268; ++pub const SYS_get_mempolicy: c_long = 269; ++pub const SYS_set_mempolicy: c_long = 270; ++pub const SYS_mq_open: c_long = 271; ++pub const SYS_mq_unlink: c_long = 272; ++pub const SYS_mq_timedsend_time32: c_long = 273; ++pub const SYS_mq_timedreceive_time32: c_long = 274; ++pub const SYS_mq_notify: c_long = 275; ++pub const SYS_mq_getsetattr: c_long = 276; ++pub const SYS_waitid: c_long = 277; ++pub const SYS_add_key: c_long = 279; ++pub const SYS_request_key: c_long = 280; ++pub const SYS_keyctl: c_long = 281; ++pub const SYS_ioprio_set: c_long = 282; ++pub const SYS_ioprio_get: c_long = 283; ++pub const SYS_inotify_init: c_long = 284; ++pub const SYS_inotify_add_watch: c_long = 285; ++pub const SYS_inotify_rm_watch: c_long = 286; ++pub const SYS_migrate_pages: c_long = 287; ++pub const SYS_openat: c_long = 288; ++pub const SYS_mkdirat: c_long = 289; ++pub const SYS_mknodat: c_long = 290; ++pub const SYS_fchownat: c_long = 291; ++pub const SYS_futimesat_time32: c_long = 292; ++pub const SYS_fstatat64: c_long = 293; ++pub const SYS_unlinkat: c_long = 294; ++pub const SYS_renameat: c_long = 295; ++pub const SYS_linkat: c_long = 296; ++pub const SYS_symlinkat: c_long = 297; ++pub const SYS_readlinkat: c_long = 298; ++pub const SYS_fchmodat: c_long = 299; ++pub const SYS_faccessat: c_long = 300; ++pub const SYS_pselect6_time32: c_long = 301; ++pub const SYS_ppoll_time32: c_long = 302; ++pub const SYS_unshare: c_long = 303; ++pub const SYS_set_robust_list: c_long = 304; ++pub const SYS_get_robust_list: c_long = 305; ++pub const SYS_splice: c_long = 306; ++pub const SYS_sync_file_range: c_long = 307; ++pub const SYS_tee: c_long = 308; ++pub const SYS_vmsplice: c_long = 309; ++pub const SYS_move_pages: c_long = 310; ++pub const SYS_sched_setaffinity: c_long = 311; ++pub const SYS_sched_getaffinity: c_long = 312; ++pub const SYS_kexec_load: c_long = 313; ++pub const SYS_getcpu: c_long = 314; ++pub const SYS_epoll_pwait: c_long = 315; ++pub const SYS_utimensat_time32: c_long = 316; ++pub const SYS_signalfd: c_long = 317; ++pub const SYS_timerfd_create: c_long = 318; ++pub const SYS_eventfd: c_long = 319; ++pub const SYS_fallocate: c_long = 320; ++pub const SYS_timerfd_settime32: c_long = 321; ++pub const SYS_timerfd_gettime32: c_long = 322; ++pub const SYS_signalfd4: c_long = 323; ++pub const SYS_eventfd2: c_long = 324; ++pub const SYS_epoll_create1: c_long = 325; ++pub const SYS_dup3: c_long = 326; ++pub const SYS_pipe2: c_long = 327; ++pub const SYS_inotify_init1: c_long = 328; ++pub const SYS_preadv: c_long = 329; ++pub const SYS_pwritev: c_long = 330; ++pub const SYS_rt_tgsigqueueinfo: c_long = 331; ++pub const SYS_perf_event_open: c_long = 332; ++pub const SYS_get_thread_area: c_long = 333; ++pub const SYS_set_thread_area: c_long = 334; ++pub const SYS_atomic_cmpxchg_32: c_long = 335; ++pub const SYS_atomic_barrier: c_long = 336; ++pub const SYS_fanotify_init: c_long = 337; ++pub const SYS_fanotify_mark: c_long = 338; ++pub const SYS_prlimit64: c_long = 339; ++pub const SYS_name_to_handle_at: c_long = 340; ++pub const SYS_open_by_handle_at: c_long = 341; ++pub const SYS_clock_adjtime32: c_long = 342; ++pub const SYS_syncfs: c_long = 343; ++pub const SYS_setns: c_long = 344; ++pub const SYS_process_vm_readv: c_long = 345; ++pub const SYS_process_vm_writev: c_long = 346; ++pub const SYS_kcmp: c_long = 347; ++pub const SYS_finit_module: c_long = 348; ++pub const SYS_sched_setattr: c_long = 349; ++pub const SYS_sched_getattr: c_long = 350; ++pub const SYS_renameat2: c_long = 351; ++pub const SYS_getrandom: c_long = 352; ++pub const SYS_memfd_create: c_long = 353; ++pub const SYS_bpf: c_long = 354; ++pub const SYS_execveat: c_long = 355; ++pub const SYS_socket: c_long = 356; ++pub const SYS_socketpair: c_long = 357; ++pub const SYS_bind: c_long = 358; ++pub const SYS_connect: c_long = 359; ++pub const SYS_listen: c_long = 360; ++pub const SYS_accept4: c_long = 361; ++pub const SYS_getsockopt: c_long = 362; ++pub const SYS_setsockopt: c_long = 363; ++pub const SYS_getsockname: c_long = 364; ++pub const SYS_getpeername: c_long = 365; ++pub const SYS_sendto: c_long = 366; ++pub const SYS_sendmsg: c_long = 367; ++pub const SYS_recvfrom: c_long = 368; ++pub const SYS_recvmsg: c_long = 369; ++pub const SYS_shutdown: c_long = 370; ++pub const SYS_recvmmsg_time32: c_long = 371; ++pub const SYS_sendmmsg: c_long = 372; ++pub const SYS_userfaultfd: c_long = 373; ++pub const SYS_membarrier: c_long = 374; ++pub const SYS_mlock2: c_long = 375; ++pub const SYS_copy_file_range: c_long = 376; ++pub const SYS_preadv2: c_long = 377; ++pub const SYS_pwritev2: c_long = 378; ++pub const SYS_statx: c_long = 379; ++pub const SYS_seccomp: c_long = 380; ++pub const SYS_pkey_mprotect: c_long = 381; ++pub const SYS_pkey_alloc: c_long = 382; ++pub const SYS_pkey_free: c_long = 383; ++pub const SYS_rseq: c_long = 384; ++pub const SYS_semget: c_long = 393; ++pub const SYS_semctl: c_long = 394; ++pub const SYS_shmget: c_long = 395; ++pub const SYS_shmctl: c_long = 396; ++pub const SYS_shmat: c_long = 397; ++pub const SYS_shmdt: c_long = 398; ++pub const SYS_msgget: c_long = 399; ++pub const SYS_msgsnd: c_long = 400; ++pub const SYS_msgrcv: c_long = 401; ++pub const SYS_msgctl: c_long = 402; ++pub const SYS_clock_gettime: c_long = 403; ++pub const SYS_clock_settime: c_long = 404; ++pub const SYS_clock_adjtime: c_long = 405; ++pub const SYS_clock_getres: c_long = 406; ++pub const SYS_clock_nanosleep: c_long = 407; ++pub const SYS_timer_gettime: c_long = 408; ++pub const SYS_timer_settime: c_long = 409; ++pub const SYS_timerfd_gettime: c_long = 410; ++pub const SYS_timerfd_settime: c_long = 411; ++pub const SYS_utimensat: c_long = 412; ++pub const SYS_pselect6: c_long = 413; ++pub const SYS_ppoll: c_long = 414; ++pub const SYS_io_pgetevents: c_long = 416; ++pub const SYS_recvmmsg: c_long = 417; ++pub const SYS_mq_timedsend: c_long = 418; ++pub const SYS_mq_timedreceive: c_long = 419; ++pub const SYS_semtimedop: c_long = 420; ++pub const SYS_rt_sigtimedwait: c_long = 421; ++pub const SYS_futex: c_long = 422; ++pub const SYS_sched_rr_get_interval: c_long = 423; ++pub const SYS_pidfd_send_signal: c_long = 424; ++pub const SYS_io_uring_setup: c_long = 425; ++pub const SYS_io_uring_enter: c_long = 426; ++pub const SYS_io_uring_register: c_long = 427; ++pub const SYS_open_tree: c_long = 428; ++pub const SYS_move_mount: c_long = 429; ++pub const SYS_fsopen: c_long = 430; ++pub const SYS_fsconfig: c_long = 431; ++pub const SYS_fsmount: c_long = 432; ++pub const SYS_fspick: c_long = 433; ++pub const SYS_pidfd_open: c_long = 434; ++pub const SYS_clone3: c_long = 435; ++pub const SYS_close_range: c_long = 436; ++pub const SYS_openat2: c_long = 437; ++pub const SYS_pidfd_getfd: c_long = 438; ++pub const SYS_faccessat2: c_long = 439; ++pub const SYS_process_madvise: c_long = 440; ++pub const SYS_epoll_pwait2: c_long = 441; ++pub const SYS_mount_setattr: c_long = 442; ++pub const SYS_quotactl_fd: c_long = 443; ++pub const SYS_landlock_create_ruleset: c_long = 444; ++pub const SYS_landlock_add_rule: c_long = 445; ++pub const SYS_landlock_restrict_self: c_long = 446; ++pub const SYS_process_mrelease: c_long = 448; ++pub const SYS_futex_waitv: c_long = 449; ++pub const SYS_set_mempolicy_home_node: c_long = 450; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/mips/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/mips/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/mips/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/mips/mod.rs 2024-12-28 15:35:00.000000000 -0500 +@@ -0,0 +1,863 @@ ++use crate::prelude::*; ++use crate::{off64_t, off_t}; ++ ++pub type c_char = i8; ++pub type wchar_t = i32; ++ ++pub type statfs64 = statfs; ++s! { ++ pub struct stat { ++ #[cfg(gnu_time64_abi)] ++ pub st_dev: crate::dev_t, ++ #[cfg(not(gnu_time64_abi))] ++ pub st_dev: c_ulong, ++ #[cfg(not(gnu_time64_abi))] ++ st_pad1: [c_long; 3], ++ ++ pub st_ino: crate::ino_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ #[cfg(gnu_time64_abi)] ++ pub st_rdev: crate::dev_t, ++ #[cfg(not(gnu_time64_abi))] ++ pub st_rdev: c_ulong, ++ ++ #[cfg(not(gnu_time64_abi))] ++ st_pad2: [c_long; 2], ++ ++ ++ pub st_size: crate::off_t, ++ ++ #[cfg(not(gnu_time64_abi))] ++ st_pad3: c_long, ++ ++ #[cfg(gnu_time64_abi)] ++ pub st_blksize: crate::blksize_t, ++ #[cfg(gnu_time64_abi)] ++ pub st_blocks: crate::blkcnt_t, ++ ++ pub st_atime: crate::time_t, ++ #[cfg(gnu_time64_abi)] ++ __pad1: i32, ++ pub st_atime_nsec: c_long, ++ #[cfg(not(gnu_time64_abi))] ++ __pad1: i32, ++ pub st_mtime: crate::time_t, ++ #[cfg(gnu_time64_abi)] ++ __pad2: i32, ++ pub st_mtime_nsec: c_long, ++ #[cfg(not(gnu_time64_abi))] ++ __pad2: i32, ++ pub st_ctime: crate::time_t, ++ #[cfg(gnu_time64_abi)] ++ __pad3: i32, ++ pub st_ctime_nsec: c_long, ++ #[cfg(not(gnu_time64_abi))] ++ __pad3: i32, ++ ++ ++ #[cfg(not(gnu_time64_abi))] ++ pub st_blksize: crate::blksize_t, ++ #[cfg(not(gnu_time64_abi))] ++ pub st_blocks: crate::blkcnt_t, ++ #[cfg(not(gnu_time64_abi))] ++ st_pad5: [c_long; 14], ++ } ++ ++ pub struct stat64 { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino64_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ pub st_size: off64_t, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt64_t, ++ pub st_atime: crate::time_t, ++ __pad1: i32, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ __pad2: i32, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ __pad3: i32, ++ pub st_ctime_nsec: c_long, ++ } ++ ++ pub struct statfs { ++ pub f_type: c_long, ++ pub f_bsize: c_long, ++ pub f_frsize: c_long, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_files: crate::fsblkcnt_t, ++ pub f_ffree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ pub f_fsid: crate::fsid_t, ++ ++ pub f_namelen: c_long, ++ pub f_flags: c_long, ++ f_spare: [c_long; 5], ++ } ++ ++ pub struct statvfs64 { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: u64, ++ pub f_bfree: u64, ++ pub f_bavail: u64, ++ pub f_files: u64, ++ pub f_ffree: u64, ++ pub f_favail: u64, ++ pub f_fsid: c_ulong, ++ __f_unused: c_int, ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ __f_spare: [c_int; 6], ++ } ++ ++ pub struct sigaction { ++ pub sa_flags: c_int, ++ pub sa_sigaction: crate::sighandler_t, ++ pub sa_mask: crate::sigset_t, ++ pub sa_restorer: Option, ++ _resv: [c_int; 1], ++ } ++ ++ pub struct stack_t { ++ pub ss_sp: *mut c_void, ++ pub ss_size: size_t, ++ pub ss_flags: c_int, ++ } ++ ++ pub struct siginfo_t { ++ pub si_signo: c_int, ++ pub si_code: c_int, ++ pub si_errno: c_int, ++ pub _pad: [c_int; 29], ++ } ++ ++ pub struct ipc_perm { ++ pub __key: crate::key_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub cuid: crate::uid_t, ++ pub cgid: crate::gid_t, ++ pub mode: c_uint, ++ pub __seq: c_ushort, ++ __pad1: c_ushort, ++ __unused1: c_ulong, ++ __unused2: c_ulong, ++ } ++ ++ pub struct shmid_ds { ++ pub shm_perm: crate::ipc_perm, ++ pub shm_segsz: size_t, ++ pub shm_atime: crate::time_t, ++ pub shm_dtime: crate::time_t, ++ pub shm_ctime: crate::time_t, ++ pub shm_cpid: crate::pid_t, ++ pub shm_lpid: crate::pid_t, ++ pub shm_nattch: crate::shmatt_t, ++ __unused4: c_ulong, ++ __unused5: c_ulong, ++ } ++ ++ pub struct msqid_ds { ++ pub msg_perm: crate::ipc_perm, ++ pub msg_stime: crate::time_t, ++ pub msg_rtime: crate::time_t, ++ pub msg_ctime: crate::time_t, ++ __msg_cbytes: c_ulong, ++ pub msg_qnum: crate::msgqnum_t, ++ pub msg_qbytes: crate::msglen_t, ++ pub msg_lspid: crate::pid_t, ++ pub msg_lrpid: crate::pid_t, ++ __glibc_reserved4: c_ulong, ++ __glibc_reserved5: c_ulong, ++ } ++ ++ pub struct flock { ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ pub l_start: off_t, ++ pub l_len: off_t, ++ pub l_sysid: c_long, ++ pub l_pid: crate::pid_t, ++ pad: [c_long; 4], ++ } ++} ++ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ #[repr(align(8))] ++ pub struct max_align_t { ++ priv_: [f32; 4], ++ } ++} ++ ++pub const O_LARGEFILE: c_int = 0x2000; ++ ++pub const SYS_syscall: c_long = 4000 + 0; ++pub const SYS_exit: c_long = 4000 + 1; ++pub const SYS_fork: c_long = 4000 + 2; ++pub const SYS_read: c_long = 4000 + 3; ++pub const SYS_write: c_long = 4000 + 4; ++pub const SYS_open: c_long = 4000 + 5; ++pub const SYS_close: c_long = 4000 + 6; ++pub const SYS_waitpid: c_long = 4000 + 7; ++pub const SYS_creat: c_long = 4000 + 8; ++pub const SYS_link: c_long = 4000 + 9; ++pub const SYS_unlink: c_long = 4000 + 10; ++pub const SYS_execve: c_long = 4000 + 11; ++pub const SYS_chdir: c_long = 4000 + 12; ++pub const SYS_time: c_long = 4000 + 13; ++pub const SYS_mknod: c_long = 4000 + 14; ++pub const SYS_chmod: c_long = 4000 + 15; ++pub const SYS_lchown: c_long = 4000 + 16; ++pub const SYS_break: c_long = 4000 + 17; ++pub const SYS_lseek: c_long = 4000 + 19; ++pub const SYS_getpid: c_long = 4000 + 20; ++pub const SYS_mount: c_long = 4000 + 21; ++pub const SYS_umount: c_long = 4000 + 22; ++pub const SYS_setuid: c_long = 4000 + 23; ++pub const SYS_getuid: c_long = 4000 + 24; ++pub const SYS_stime: c_long = 4000 + 25; ++pub const SYS_ptrace: c_long = 4000 + 26; ++pub const SYS_alarm: c_long = 4000 + 27; ++pub const SYS_pause: c_long = 4000 + 29; ++pub const SYS_utime: c_long = 4000 + 30; ++pub const SYS_stty: c_long = 4000 + 31; ++pub const SYS_gtty: c_long = 4000 + 32; ++pub const SYS_access: c_long = 4000 + 33; ++pub const SYS_nice: c_long = 4000 + 34; ++pub const SYS_ftime: c_long = 4000 + 35; ++pub const SYS_sync: c_long = 4000 + 36; ++pub const SYS_kill: c_long = 4000 + 37; ++pub const SYS_rename: c_long = 4000 + 38; ++pub const SYS_mkdir: c_long = 4000 + 39; ++pub const SYS_rmdir: c_long = 4000 + 40; ++pub const SYS_dup: c_long = 4000 + 41; ++pub const SYS_pipe: c_long = 4000 + 42; ++pub const SYS_times: c_long = 4000 + 43; ++pub const SYS_prof: c_long = 4000 + 44; ++pub const SYS_brk: c_long = 4000 + 45; ++pub const SYS_setgid: c_long = 4000 + 46; ++pub const SYS_getgid: c_long = 4000 + 47; ++pub const SYS_signal: c_long = 4000 + 48; ++pub const SYS_geteuid: c_long = 4000 + 49; ++pub const SYS_getegid: c_long = 4000 + 50; ++pub const SYS_acct: c_long = 4000 + 51; ++pub const SYS_umount2: c_long = 4000 + 52; ++pub const SYS_lock: c_long = 4000 + 53; ++pub const SYS_ioctl: c_long = 4000 + 54; ++pub const SYS_fcntl: c_long = 4000 + 55; ++pub const SYS_mpx: c_long = 4000 + 56; ++pub const SYS_setpgid: c_long = 4000 + 57; ++pub const SYS_ulimit: c_long = 4000 + 58; ++pub const SYS_umask: c_long = 4000 + 60; ++pub const SYS_chroot: c_long = 4000 + 61; ++pub const SYS_ustat: c_long = 4000 + 62; ++pub const SYS_dup2: c_long = 4000 + 63; ++pub const SYS_getppid: c_long = 4000 + 64; ++pub const SYS_getpgrp: c_long = 4000 + 65; ++pub const SYS_setsid: c_long = 4000 + 66; ++pub const SYS_sigaction: c_long = 4000 + 67; ++pub const SYS_sgetmask: c_long = 4000 + 68; ++pub const SYS_ssetmask: c_long = 4000 + 69; ++pub const SYS_setreuid: c_long = 4000 + 70; ++pub const SYS_setregid: c_long = 4000 + 71; ++pub const SYS_sigsuspend: c_long = 4000 + 72; ++pub const SYS_sigpending: c_long = 4000 + 73; ++pub const SYS_sethostname: c_long = 4000 + 74; ++pub const SYS_setrlimit: c_long = 4000 + 75; ++pub const SYS_getrlimit: c_long = 4000 + 76; ++pub const SYS_getrusage: c_long = 4000 + 77; ++pub const SYS_gettimeofday: c_long = 4000 + 78; ++pub const SYS_settimeofday: c_long = 4000 + 79; ++pub const SYS_getgroups: c_long = 4000 + 80; ++pub const SYS_setgroups: c_long = 4000 + 81; ++pub const SYS_symlink: c_long = 4000 + 83; ++pub const SYS_readlink: c_long = 4000 + 85; ++pub const SYS_uselib: c_long = 4000 + 86; ++pub const SYS_swapon: c_long = 4000 + 87; ++pub const SYS_reboot: c_long = 4000 + 88; ++pub const SYS_readdir: c_long = 4000 + 89; ++pub const SYS_mmap: c_long = 4000 + 90; ++pub const SYS_munmap: c_long = 4000 + 91; ++pub const SYS_truncate: c_long = 4000 + 92; ++pub const SYS_ftruncate: c_long = 4000 + 93; ++pub const SYS_fchmod: c_long = 4000 + 94; ++pub const SYS_fchown: c_long = 4000 + 95; ++pub const SYS_getpriority: c_long = 4000 + 96; ++pub const SYS_setpriority: c_long = 4000 + 97; ++pub const SYS_profil: c_long = 4000 + 98; ++pub const SYS_statfs: c_long = 4000 + 99; ++pub const SYS_fstatfs: c_long = 4000 + 100; ++pub const SYS_ioperm: c_long = 4000 + 101; ++pub const SYS_socketcall: c_long = 4000 + 102; ++pub const SYS_syslog: c_long = 4000 + 103; ++pub const SYS_setitimer: c_long = 4000 + 104; ++pub const SYS_getitimer: c_long = 4000 + 105; ++pub const SYS_stat: c_long = 4000 + 106; ++pub const SYS_lstat: c_long = 4000 + 107; ++pub const SYS_fstat: c_long = 4000 + 108; ++pub const SYS_iopl: c_long = 4000 + 110; ++pub const SYS_vhangup: c_long = 4000 + 111; ++pub const SYS_idle: c_long = 4000 + 112; ++pub const SYS_vm86: c_long = 4000 + 113; ++pub const SYS_wait4: c_long = 4000 + 114; ++pub const SYS_swapoff: c_long = 4000 + 115; ++pub const SYS_sysinfo: c_long = 4000 + 116; ++pub const SYS_ipc: c_long = 4000 + 117; ++pub const SYS_fsync: c_long = 4000 + 118; ++pub const SYS_sigreturn: c_long = 4000 + 119; ++pub const SYS_clone: c_long = 4000 + 120; ++pub const SYS_setdomainname: c_long = 4000 + 121; ++pub const SYS_uname: c_long = 4000 + 122; ++pub const SYS_modify_ldt: c_long = 4000 + 123; ++pub const SYS_adjtimex: c_long = 4000 + 124; ++pub const SYS_mprotect: c_long = 4000 + 125; ++pub const SYS_sigprocmask: c_long = 4000 + 126; ++pub const SYS_create_module: c_long = 4000 + 127; ++pub const SYS_init_module: c_long = 4000 + 128; ++pub const SYS_delete_module: c_long = 4000 + 129; ++pub const SYS_get_kernel_syms: c_long = 4000 + 130; ++pub const SYS_quotactl: c_long = 4000 + 131; ++pub const SYS_getpgid: c_long = 4000 + 132; ++pub const SYS_fchdir: c_long = 4000 + 133; ++pub const SYS_bdflush: c_long = 4000 + 134; ++pub const SYS_sysfs: c_long = 4000 + 135; ++pub const SYS_personality: c_long = 4000 + 136; ++pub const SYS_afs_syscall: c_long = 4000 + 137; ++pub const SYS_setfsuid: c_long = 4000 + 138; ++pub const SYS_setfsgid: c_long = 4000 + 139; ++pub const SYS__llseek: c_long = 4000 + 140; ++pub const SYS_getdents: c_long = 4000 + 141; ++pub const SYS__newselect: c_long = 4000 + 142; ++pub const SYS_flock: c_long = 4000 + 143; ++pub const SYS_msync: c_long = 4000 + 144; ++pub const SYS_readv: c_long = 4000 + 145; ++pub const SYS_writev: c_long = 4000 + 146; ++pub const SYS_cacheflush: c_long = 4000 + 147; ++pub const SYS_cachectl: c_long = 4000 + 148; ++pub const SYS_sysmips: c_long = 4000 + 149; ++pub const SYS_getsid: c_long = 4000 + 151; ++pub const SYS_fdatasync: c_long = 4000 + 152; ++pub const SYS__sysctl: c_long = 4000 + 153; ++pub const SYS_mlock: c_long = 4000 + 154; ++pub const SYS_munlock: c_long = 4000 + 155; ++pub const SYS_mlockall: c_long = 4000 + 156; ++pub const SYS_munlockall: c_long = 4000 + 157; ++pub const SYS_sched_setparam: c_long = 4000 + 158; ++pub const SYS_sched_getparam: c_long = 4000 + 159; ++pub const SYS_sched_setscheduler: c_long = 4000 + 160; ++pub const SYS_sched_getscheduler: c_long = 4000 + 161; ++pub const SYS_sched_yield: c_long = 4000 + 162; ++pub const SYS_sched_get_priority_max: c_long = 4000 + 163; ++pub const SYS_sched_get_priority_min: c_long = 4000 + 164; ++pub const SYS_sched_rr_get_interval: c_long = 4000 + 165; ++pub const SYS_nanosleep: c_long = 4000 + 166; ++pub const SYS_mremap: c_long = 4000 + 167; ++pub const SYS_accept: c_long = 4000 + 168; ++pub const SYS_bind: c_long = 4000 + 169; ++pub const SYS_connect: c_long = 4000 + 170; ++pub const SYS_getpeername: c_long = 4000 + 171; ++pub const SYS_getsockname: c_long = 4000 + 172; ++pub const SYS_getsockopt: c_long = 4000 + 173; ++pub const SYS_listen: c_long = 4000 + 174; ++pub const SYS_recv: c_long = 4000 + 175; ++pub const SYS_recvfrom: c_long = 4000 + 176; ++pub const SYS_recvmsg: c_long = 4000 + 177; ++pub const SYS_send: c_long = 4000 + 178; ++pub const SYS_sendmsg: c_long = 4000 + 179; ++pub const SYS_sendto: c_long = 4000 + 180; ++pub const SYS_setsockopt: c_long = 4000 + 181; ++pub const SYS_shutdown: c_long = 4000 + 182; ++pub const SYS_socket: c_long = 4000 + 183; ++pub const SYS_socketpair: c_long = 4000 + 184; ++pub const SYS_setresuid: c_long = 4000 + 185; ++pub const SYS_getresuid: c_long = 4000 + 186; ++pub const SYS_query_module: c_long = 4000 + 187; ++pub const SYS_poll: c_long = 4000 + 188; ++pub const SYS_nfsservctl: c_long = 4000 + 189; ++pub const SYS_setresgid: c_long = 4000 + 190; ++pub const SYS_getresgid: c_long = 4000 + 191; ++pub const SYS_prctl: c_long = 4000 + 192; ++pub const SYS_rt_sigreturn: c_long = 4000 + 193; ++pub const SYS_rt_sigaction: c_long = 4000 + 194; ++pub const SYS_rt_sigprocmask: c_long = 4000 + 195; ++pub const SYS_rt_sigpending: c_long = 4000 + 196; ++pub const SYS_rt_sigtimedwait: c_long = 4000 + 197; ++pub const SYS_rt_sigqueueinfo: c_long = 4000 + 198; ++pub const SYS_rt_sigsuspend: c_long = 4000 + 199; ++pub const SYS_pread64: c_long = 4000 + 200; ++pub const SYS_pwrite64: c_long = 4000 + 201; ++pub const SYS_chown: c_long = 4000 + 202; ++pub const SYS_getcwd: c_long = 4000 + 203; ++pub const SYS_capget: c_long = 4000 + 204; ++pub const SYS_capset: c_long = 4000 + 205; ++pub const SYS_sigaltstack: c_long = 4000 + 206; ++pub const SYS_sendfile: c_long = 4000 + 207; ++pub const SYS_getpmsg: c_long = 4000 + 208; ++pub const SYS_putpmsg: c_long = 4000 + 209; ++pub const SYS_mmap2: c_long = 4000 + 210; ++pub const SYS_truncate64: c_long = 4000 + 211; ++pub const SYS_ftruncate64: c_long = 4000 + 212; ++pub const SYS_stat64: c_long = 4000 + 213; ++pub const SYS_lstat64: c_long = 4000 + 214; ++pub const SYS_fstat64: c_long = 4000 + 215; ++pub const SYS_pivot_root: c_long = 4000 + 216; ++pub const SYS_mincore: c_long = 4000 + 217; ++pub const SYS_madvise: c_long = 4000 + 218; ++pub const SYS_getdents64: c_long = 4000 + 219; ++pub const SYS_fcntl64: c_long = 4000 + 220; ++pub const SYS_gettid: c_long = 4000 + 222; ++pub const SYS_readahead: c_long = 4000 + 223; ++pub const SYS_setxattr: c_long = 4000 + 224; ++pub const SYS_lsetxattr: c_long = 4000 + 225; ++pub const SYS_fsetxattr: c_long = 4000 + 226; ++pub const SYS_getxattr: c_long = 4000 + 227; ++pub const SYS_lgetxattr: c_long = 4000 + 228; ++pub const SYS_fgetxattr: c_long = 4000 + 229; ++pub const SYS_listxattr: c_long = 4000 + 230; ++pub const SYS_llistxattr: c_long = 4000 + 231; ++pub const SYS_flistxattr: c_long = 4000 + 232; ++pub const SYS_removexattr: c_long = 4000 + 233; ++pub const SYS_lremovexattr: c_long = 4000 + 234; ++pub const SYS_fremovexattr: c_long = 4000 + 235; ++pub const SYS_tkill: c_long = 4000 + 236; ++pub const SYS_sendfile64: c_long = 4000 + 237; ++pub const SYS_futex: c_long = 4000 + 238; ++pub const SYS_sched_setaffinity: c_long = 4000 + 239; ++pub const SYS_sched_getaffinity: c_long = 4000 + 240; ++pub const SYS_io_setup: c_long = 4000 + 241; ++pub const SYS_io_destroy: c_long = 4000 + 242; ++pub const SYS_io_getevents: c_long = 4000 + 243; ++pub const SYS_io_submit: c_long = 4000 + 244; ++pub const SYS_io_cancel: c_long = 4000 + 245; ++pub const SYS_exit_group: c_long = 4000 + 246; ++pub const SYS_lookup_dcookie: c_long = 4000 + 247; ++pub const SYS_epoll_create: c_long = 4000 + 248; ++pub const SYS_epoll_ctl: c_long = 4000 + 249; ++pub const SYS_epoll_wait: c_long = 4000 + 250; ++pub const SYS_remap_file_pages: c_long = 4000 + 251; ++pub const SYS_set_tid_address: c_long = 4000 + 252; ++pub const SYS_restart_syscall: c_long = 4000 + 253; ++pub const SYS_fadvise64: c_long = 4000 + 254; ++pub const SYS_statfs64: c_long = 4000 + 255; ++pub const SYS_fstatfs64: c_long = 4000 + 256; ++pub const SYS_timer_create: c_long = 4000 + 257; ++pub const SYS_timer_settime: c_long = 4000 + 258; ++pub const SYS_timer_gettime: c_long = 4000 + 259; ++pub const SYS_timer_getoverrun: c_long = 4000 + 260; ++pub const SYS_timer_delete: c_long = 4000 + 261; ++pub const SYS_clock_settime: c_long = 4000 + 262; ++pub const SYS_clock_gettime: c_long = 4000 + 263; ++pub const SYS_clock_getres: c_long = 4000 + 264; ++pub const SYS_clock_nanosleep: c_long = 4000 + 265; ++pub const SYS_tgkill: c_long = 4000 + 266; ++pub const SYS_utimes: c_long = 4000 + 267; ++pub const SYS_mbind: c_long = 4000 + 268; ++pub const SYS_get_mempolicy: c_long = 4000 + 269; ++pub const SYS_set_mempolicy: c_long = 4000 + 270; ++pub const SYS_mq_open: c_long = 4000 + 271; ++pub const SYS_mq_unlink: c_long = 4000 + 272; ++pub const SYS_mq_timedsend: c_long = 4000 + 273; ++pub const SYS_mq_timedreceive: c_long = 4000 + 274; ++pub const SYS_mq_notify: c_long = 4000 + 275; ++pub const SYS_mq_getsetattr: c_long = 4000 + 276; ++pub const SYS_vserver: c_long = 4000 + 277; ++pub const SYS_waitid: c_long = 4000 + 278; ++/* pub const SYS_sys_setaltroot: c_long = 4000 + 279; */ ++pub const SYS_add_key: c_long = 4000 + 280; ++pub const SYS_request_key: c_long = 4000 + 281; ++pub const SYS_keyctl: c_long = 4000 + 282; ++pub const SYS_set_thread_area: c_long = 4000 + 283; ++pub const SYS_inotify_init: c_long = 4000 + 284; ++pub const SYS_inotify_add_watch: c_long = 4000 + 285; ++pub const SYS_inotify_rm_watch: c_long = 4000 + 286; ++pub const SYS_migrate_pages: c_long = 4000 + 287; ++pub const SYS_openat: c_long = 4000 + 288; ++pub const SYS_mkdirat: c_long = 4000 + 289; ++pub const SYS_mknodat: c_long = 4000 + 290; ++pub const SYS_fchownat: c_long = 4000 + 291; ++pub const SYS_futimesat: c_long = 4000 + 292; ++pub const SYS_fstatat64: c_long = 4000 + 293; ++pub const SYS_unlinkat: c_long = 4000 + 294; ++pub const SYS_renameat: c_long = 4000 + 295; ++pub const SYS_linkat: c_long = 4000 + 296; ++pub const SYS_symlinkat: c_long = 4000 + 297; ++pub const SYS_readlinkat: c_long = 4000 + 298; ++pub const SYS_fchmodat: c_long = 4000 + 299; ++pub const SYS_faccessat: c_long = 4000 + 300; ++pub const SYS_pselect6: c_long = 4000 + 301; ++pub const SYS_ppoll: c_long = 4000 + 302; ++pub const SYS_unshare: c_long = 4000 + 303; ++pub const SYS_splice: c_long = 4000 + 304; ++pub const SYS_sync_file_range: c_long = 4000 + 305; ++pub const SYS_tee: c_long = 4000 + 306; ++pub const SYS_vmsplice: c_long = 4000 + 307; ++pub const SYS_move_pages: c_long = 4000 + 308; ++pub const SYS_set_robust_list: c_long = 4000 + 309; ++pub const SYS_get_robust_list: c_long = 4000 + 310; ++pub const SYS_kexec_load: c_long = 4000 + 311; ++pub const SYS_getcpu: c_long = 4000 + 312; ++pub const SYS_epoll_pwait: c_long = 4000 + 313; ++pub const SYS_ioprio_set: c_long = 4000 + 314; ++pub const SYS_ioprio_get: c_long = 4000 + 315; ++pub const SYS_utimensat: c_long = 4000 + 316; ++pub const SYS_signalfd: c_long = 4000 + 317; ++pub const SYS_timerfd: c_long = 4000 + 318; ++pub const SYS_eventfd: c_long = 4000 + 319; ++pub const SYS_fallocate: c_long = 4000 + 320; ++pub const SYS_timerfd_create: c_long = 4000 + 321; ++pub const SYS_timerfd_gettime: c_long = 4000 + 322; ++pub const SYS_timerfd_settime: c_long = 4000 + 323; ++pub const SYS_signalfd4: c_long = 4000 + 324; ++pub const SYS_eventfd2: c_long = 4000 + 325; ++pub const SYS_epoll_create1: c_long = 4000 + 326; ++pub const SYS_dup3: c_long = 4000 + 327; ++pub const SYS_pipe2: c_long = 4000 + 328; ++pub const SYS_inotify_init1: c_long = 4000 + 329; ++pub const SYS_preadv: c_long = 4000 + 330; ++pub const SYS_pwritev: c_long = 4000 + 331; ++pub const SYS_rt_tgsigqueueinfo: c_long = 4000 + 332; ++pub const SYS_perf_event_open: c_long = 4000 + 333; ++pub const SYS_accept4: c_long = 4000 + 334; ++pub const SYS_recvmmsg: c_long = 4000 + 335; ++pub const SYS_fanotify_init: c_long = 4000 + 336; ++pub const SYS_fanotify_mark: c_long = 4000 + 337; ++pub const SYS_prlimit64: c_long = 4000 + 338; ++pub const SYS_name_to_handle_at: c_long = 4000 + 339; ++pub const SYS_open_by_handle_at: c_long = 4000 + 340; ++pub const SYS_clock_adjtime: c_long = 4000 + 341; ++pub const SYS_syncfs: c_long = 4000 + 342; ++pub const SYS_sendmmsg: c_long = 4000 + 343; ++pub const SYS_setns: c_long = 4000 + 344; ++pub const SYS_process_vm_readv: c_long = 4000 + 345; ++pub const SYS_process_vm_writev: c_long = 4000 + 346; ++pub const SYS_kcmp: c_long = 4000 + 347; ++pub const SYS_finit_module: c_long = 4000 + 348; ++pub const SYS_sched_setattr: c_long = 4000 + 349; ++pub const SYS_sched_getattr: c_long = 4000 + 350; ++pub const SYS_renameat2: c_long = 4000 + 351; ++pub const SYS_seccomp: c_long = 4000 + 352; ++pub const SYS_getrandom: c_long = 4000 + 353; ++pub const SYS_memfd_create: c_long = 4000 + 354; ++pub const SYS_bpf: c_long = 4000 + 355; ++pub const SYS_execveat: c_long = 4000 + 356; ++pub const SYS_userfaultfd: c_long = 4000 + 357; ++pub const SYS_membarrier: c_long = 4000 + 358; ++pub const SYS_mlock2: c_long = 4000 + 359; ++pub const SYS_copy_file_range: c_long = 4000 + 360; ++pub const SYS_preadv2: c_long = 4000 + 361; ++pub const SYS_pwritev2: c_long = 4000 + 362; ++pub const SYS_pkey_mprotect: c_long = 4000 + 363; ++pub const SYS_pkey_alloc: c_long = 4000 + 364; ++pub const SYS_pkey_free: c_long = 4000 + 365; ++pub const SYS_statx: c_long = 4000 + 366; ++pub const SYS_rseq: c_long = 4000 + 367; ++pub const SYS_pidfd_send_signal: c_long = 4000 + 424; ++pub const SYS_io_uring_setup: c_long = 4000 + 425; ++pub const SYS_io_uring_enter: c_long = 4000 + 426; ++pub const SYS_io_uring_register: c_long = 4000 + 427; ++pub const SYS_open_tree: c_long = 4000 + 428; ++pub const SYS_move_mount: c_long = 4000 + 429; ++pub const SYS_fsopen: c_long = 4000 + 430; ++pub const SYS_fsconfig: c_long = 4000 + 431; ++pub const SYS_fsmount: c_long = 4000 + 432; ++pub const SYS_fspick: c_long = 4000 + 433; ++pub const SYS_pidfd_open: c_long = 4000 + 434; ++pub const SYS_clone3: c_long = 4000 + 435; ++pub const SYS_close_range: c_long = 4000 + 436; ++pub const SYS_openat2: c_long = 4000 + 437; ++pub const SYS_pidfd_getfd: c_long = 4000 + 438; ++pub const SYS_faccessat2: c_long = 4000 + 439; ++pub const SYS_process_madvise: c_long = 4000 + 440; ++pub const SYS_epoll_pwait2: c_long = 4000 + 441; ++pub const SYS_mount_setattr: c_long = 4000 + 442; ++pub const SYS_quotactl_fd: c_long = 4000 + 443; ++pub const SYS_landlock_create_ruleset: c_long = 4000 + 444; ++pub const SYS_landlock_add_rule: c_long = 4000 + 445; ++pub const SYS_landlock_restrict_self: c_long = 4000 + 446; ++pub const SYS_memfd_secret: c_long = 4000 + 447; ++pub const SYS_process_mrelease: c_long = 4000 + 448; ++pub const SYS_futex_waitv: c_long = 4000 + 449; ++pub const SYS_set_mempolicy_home_node: c_long = 4000 + 450; ++ ++pub const O_DIRECT: c_int = 0x8000; ++pub const O_DIRECTORY: c_int = 0x10000; ++pub const O_NOFOLLOW: c_int = 0x20000; ++ ++pub const O_APPEND: c_int = 8; ++pub const O_CREAT: c_int = 256; ++pub const O_EXCL: c_int = 1024; ++pub const O_NOCTTY: c_int = 2048; ++pub const O_NONBLOCK: c_int = 128; ++pub const O_SYNC: c_int = 0x4010; ++pub const O_RSYNC: c_int = 0x4010; ++pub const O_DSYNC: c_int = 0x10; ++pub const O_FSYNC: c_int = 0x4010; ++pub const O_ASYNC: c_int = 0x1000; ++pub const O_NDELAY: c_int = 0x80; ++ ++pub const EDEADLK: c_int = 45; ++pub const ENAMETOOLONG: c_int = 78; ++pub const ENOLCK: c_int = 46; ++pub const ENOSYS: c_int = 89; ++pub const ENOTEMPTY: c_int = 93; ++pub const ELOOP: c_int = 90; ++pub const ENOMSG: c_int = 35; ++pub const EIDRM: c_int = 36; ++pub const ECHRNG: c_int = 37; ++pub const EL2NSYNC: c_int = 38; ++pub const EL3HLT: c_int = 39; ++pub const EL3RST: c_int = 40; ++pub const ELNRNG: c_int = 41; ++pub const EUNATCH: c_int = 42; ++pub const ENOCSI: c_int = 43; ++pub const EL2HLT: c_int = 44; ++pub const EBADE: c_int = 50; ++pub const EBADR: c_int = 51; ++pub const EXFULL: c_int = 52; ++pub const ENOANO: c_int = 53; ++pub const EBADRQC: c_int = 54; ++pub const EBADSLT: c_int = 55; ++pub const EDEADLOCK: c_int = 56; ++pub const EMULTIHOP: c_int = 74; ++pub const EOVERFLOW: c_int = 79; ++pub const ENOTUNIQ: c_int = 80; ++pub const EBADFD: c_int = 81; ++pub const EBADMSG: c_int = 77; ++pub const EREMCHG: c_int = 82; ++pub const ELIBACC: c_int = 83; ++pub const ELIBBAD: c_int = 84; ++pub const ELIBSCN: c_int = 85; ++pub const ELIBMAX: c_int = 86; ++pub const ELIBEXEC: c_int = 87; ++pub const EILSEQ: c_int = 88; ++pub const ERESTART: c_int = 91; ++pub const ESTRPIPE: c_int = 92; ++pub const EUSERS: c_int = 94; ++pub const ENOTSOCK: c_int = 95; ++pub const EDESTADDRREQ: c_int = 96; ++pub const EMSGSIZE: c_int = 97; ++pub const EPROTOTYPE: c_int = 98; ++pub const ENOPROTOOPT: c_int = 99; ++pub const EPROTONOSUPPORT: c_int = 120; ++pub const ESOCKTNOSUPPORT: c_int = 121; ++pub const EOPNOTSUPP: c_int = 122; ++pub const EPFNOSUPPORT: c_int = 123; ++pub const EAFNOSUPPORT: c_int = 124; ++pub const EADDRINUSE: c_int = 125; ++pub const EADDRNOTAVAIL: c_int = 126; ++pub const ENETDOWN: c_int = 127; ++pub const ENETUNREACH: c_int = 128; ++pub const ENETRESET: c_int = 129; ++pub const ECONNABORTED: c_int = 130; ++pub const ECONNRESET: c_int = 131; ++pub const ENOBUFS: c_int = 132; ++pub const EISCONN: c_int = 133; ++pub const ENOTCONN: c_int = 134; ++pub const ESHUTDOWN: c_int = 143; ++pub const ETOOMANYREFS: c_int = 144; ++pub const ETIMEDOUT: c_int = 145; ++pub const ECONNREFUSED: c_int = 146; ++pub const EHOSTDOWN: c_int = 147; ++pub const EHOSTUNREACH: c_int = 148; ++pub const EALREADY: c_int = 149; ++pub const EINPROGRESS: c_int = 150; ++pub const ESTALE: c_int = 151; ++pub const EUCLEAN: c_int = 135; ++pub const ENOTNAM: c_int = 137; ++pub const ENAVAIL: c_int = 138; ++pub const EISNAM: c_int = 139; ++pub const EREMOTEIO: c_int = 140; ++pub const EDQUOT: c_int = 1133; ++pub const ENOMEDIUM: c_int = 159; ++pub const EMEDIUMTYPE: c_int = 160; ++pub const ECANCELED: c_int = 158; ++pub const ENOKEY: c_int = 161; ++pub const EKEYEXPIRED: c_int = 162; ++pub const EKEYREVOKED: c_int = 163; ++pub const EKEYREJECTED: c_int = 164; ++pub const EOWNERDEAD: c_int = 165; ++pub const ENOTRECOVERABLE: c_int = 166; ++pub const ERFKILL: c_int = 167; ++ ++pub const MAP_NORESERVE: c_int = 0x400; ++pub const MAP_ANON: c_int = 0x800; ++pub const MAP_ANONYMOUS: c_int = 0x800; ++pub const MAP_GROWSDOWN: c_int = 0x1000; ++pub const MAP_DENYWRITE: c_int = 0x2000; ++pub const MAP_EXECUTABLE: c_int = 0x4000; ++pub const MAP_LOCKED: c_int = 0x8000; ++pub const MAP_POPULATE: c_int = 0x10000; ++pub const MAP_NONBLOCK: c_int = 0x20000; ++pub const MAP_STACK: c_int = 0x40000; ++ ++pub const SOCK_STREAM: c_int = 2; ++pub const SOCK_DGRAM: c_int = 1; ++ ++pub const SA_SIGINFO: c_int = 0x00000008; ++pub const SA_NOCLDWAIT: c_int = 0x00010000; ++ ++pub const SIGCHLD: c_int = 18; ++pub const SIGBUS: c_int = 10; ++pub const SIGTTIN: c_int = 26; ++pub const SIGTTOU: c_int = 27; ++pub const SIGXCPU: c_int = 30; ++pub const SIGXFSZ: c_int = 31; ++pub const SIGVTALRM: c_int = 28; ++pub const SIGPROF: c_int = 29; ++pub const SIGWINCH: c_int = 20; ++pub const SIGUSR1: c_int = 16; ++pub const SIGUSR2: c_int = 17; ++pub const SIGCONT: c_int = 25; ++pub const SIGSTOP: c_int = 23; ++pub const SIGTSTP: c_int = 24; ++pub const SIGURG: c_int = 21; ++pub const SIGIO: c_int = 22; ++pub const SIGSYS: c_int = 12; ++pub const SIGPOLL: c_int = 22; ++pub const SIGPWR: c_int = 19; ++pub const SIG_SETMASK: c_int = 3; ++pub const SIG_BLOCK: c_int = 0x1; ++pub const SIG_UNBLOCK: c_int = 0x2; ++ ++pub const POLLWRNORM: c_short = 0x004; ++pub const POLLWRBAND: c_short = 0x100; ++ ++pub const VEOF: usize = 16; ++pub const VEOL: usize = 17; ++pub const VEOL2: usize = 6; ++pub const VMIN: usize = 4; ++pub const IEXTEN: crate::tcflag_t = 0x00000100; ++pub const TOSTOP: crate::tcflag_t = 0x00008000; ++pub const FLUSHO: crate::tcflag_t = 0x00002000; ++pub const EXTPROC: crate::tcflag_t = 0o200000; ++pub const TCSANOW: c_int = 0x540e; ++pub const TCSADRAIN: c_int = 0x540f; ++pub const TCSAFLUSH: c_int = 0x5410; ++ ++pub const PTRACE_GETFPXREGS: c_uint = 18; ++pub const PTRACE_SETFPXREGS: c_uint = 19; ++ ++pub const MAP_HUGETLB: c_int = 0x080000; ++ ++pub const EFD_NONBLOCK: c_int = 0x80; ++ ++cfg_if! { ++ if #[cfg(gnu_time64_abi)] { ++ pub const F_GETLK: c_int = 33; ++ } else { ++ pub const F_GETLK: c_int = 14; ++ } ++} ++pub const F_GETOWN: c_int = 23; ++pub const F_SETOWN: c_int = 24; ++ ++pub const SFD_NONBLOCK: c_int = 0x80; ++ ++pub const RTLD_DEEPBIND: c_int = 0x10; ++pub const RTLD_GLOBAL: c_int = 0x4; ++pub const RTLD_NOLOAD: c_int = 0x8; ++ ++pub const MCL_CURRENT: c_int = 0x0001; ++pub const MCL_FUTURE: c_int = 0x0002; ++pub const MCL_ONFAULT: c_int = 0x0004; ++ ++pub const SIGSTKSZ: size_t = 8192; ++pub const MINSIGSTKSZ: size_t = 2048; ++pub const CBAUD: crate::tcflag_t = 0o0010017; ++pub const TAB1: crate::tcflag_t = 0x00000800; ++pub const TAB2: crate::tcflag_t = 0x00001000; ++pub const TAB3: crate::tcflag_t = 0x00001800; ++pub const CR1: crate::tcflag_t = 0x00000200; ++pub const CR2: crate::tcflag_t = 0x00000400; ++pub const CR3: crate::tcflag_t = 0x00000600; ++pub const FF1: crate::tcflag_t = 0x00008000; ++pub const BS1: crate::tcflag_t = 0x00002000; ++pub const VT1: crate::tcflag_t = 0x00004000; ++pub const VWERASE: usize = 14; ++pub const VREPRINT: usize = 12; ++pub const VSUSP: usize = 10; ++pub const VSTART: usize = 8; ++pub const VSTOP: usize = 9; ++pub const VDISCARD: usize = 13; ++pub const VTIME: usize = 5; ++pub const IXON: crate::tcflag_t = 0x00000400; ++pub const IXOFF: crate::tcflag_t = 0x00001000; ++pub const ONLCR: crate::tcflag_t = 0x4; ++pub const CSIZE: crate::tcflag_t = 0x00000030; ++pub const CS6: crate::tcflag_t = 0x00000010; ++pub const CS7: crate::tcflag_t = 0x00000020; ++pub const CS8: crate::tcflag_t = 0x00000030; ++pub const CSTOPB: crate::tcflag_t = 0x00000040; ++pub const CREAD: crate::tcflag_t = 0x00000080; ++pub const PARENB: crate::tcflag_t = 0x00000100; ++pub const PARODD: crate::tcflag_t = 0x00000200; ++pub const HUPCL: crate::tcflag_t = 0x00000400; ++pub const CLOCAL: crate::tcflag_t = 0x00000800; ++pub const ECHOKE: crate::tcflag_t = 0x00000800; ++pub const ECHOE: crate::tcflag_t = 0x00000010; ++pub const ECHOK: crate::tcflag_t = 0x00000020; ++pub const ECHONL: crate::tcflag_t = 0x00000040; ++pub const ECHOPRT: crate::tcflag_t = 0x00000400; ++pub const ECHOCTL: crate::tcflag_t = 0x00000200; ++pub const ISIG: crate::tcflag_t = 0x00000001; ++pub const ICANON: crate::tcflag_t = 0x00000002; ++pub const PENDIN: crate::tcflag_t = 0x00004000; ++pub const NOFLSH: crate::tcflag_t = 0x00000080; ++pub const CIBAUD: crate::tcflag_t = 0o02003600000; ++pub const CBAUDEX: crate::tcflag_t = 0o010000; ++pub const VSWTC: usize = 7; ++pub const OLCUC: crate::tcflag_t = 0o000002; ++pub const NLDLY: crate::tcflag_t = 0o000400; ++pub const CRDLY: crate::tcflag_t = 0o003000; ++pub const TABDLY: crate::tcflag_t = 0o014000; ++pub const BSDLY: crate::tcflag_t = 0o020000; ++pub const FFDLY: crate::tcflag_t = 0o100000; ++pub const VTDLY: crate::tcflag_t = 0o040000; ++pub const XTABS: crate::tcflag_t = 0o014000; ++ ++pub const B0: crate::speed_t = 0o000000; ++pub const B50: crate::speed_t = 0o000001; ++pub const B75: crate::speed_t = 0o000002; ++pub const B110: crate::speed_t = 0o000003; ++pub const B134: crate::speed_t = 0o000004; ++pub const B150: crate::speed_t = 0o000005; ++pub const B200: crate::speed_t = 0o000006; ++pub const B300: crate::speed_t = 0o000007; ++pub const B600: crate::speed_t = 0o000010; ++pub const B1200: crate::speed_t = 0o000011; ++pub const B1800: crate::speed_t = 0o000012; ++pub const B2400: crate::speed_t = 0o000013; ++pub const B4800: crate::speed_t = 0o000014; ++pub const B9600: crate::speed_t = 0o000015; ++pub const B19200: crate::speed_t = 0o000016; ++pub const B38400: crate::speed_t = 0o000017; ++pub const EXTA: crate::speed_t = B19200; ++pub const EXTB: crate::speed_t = B38400; ++pub const B57600: crate::speed_t = 0o010001; ++pub const B115200: crate::speed_t = 0o010002; ++pub const B230400: crate::speed_t = 0o010003; ++pub const B460800: crate::speed_t = 0o010004; ++pub const B500000: crate::speed_t = 0o010005; ++pub const B576000: crate::speed_t = 0o010006; ++pub const B921600: crate::speed_t = 0o010007; ++pub const B1000000: crate::speed_t = 0o010010; ++pub const B1152000: crate::speed_t = 0o010011; ++pub const B1500000: crate::speed_t = 0o010012; ++pub const B2000000: crate::speed_t = 0o010013; ++pub const B2500000: crate::speed_t = 0o010014; ++pub const B3000000: crate::speed_t = 0o010015; ++pub const B3500000: crate::speed_t = 0o010016; ++pub const B4000000: crate::speed_t = 0o010017; ++ ++pub const EHWPOISON: c_int = 168; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/mod.rs 2024-12-28 15:35:00.000000000 -0500 +@@ -0,0 +1,448 @@ ++//! 32-bit specific definitions for linux-like values ++ ++use crate::prelude::*; ++use crate::ntptimeval; ++use crate::pthread_mutex_t; ++ ++pub type c_long = i32; ++pub type c_ulong = u32; ++pub type clock_t = i32; ++ ++pub type shmatt_t = c_ulong; ++pub type msgqnum_t = c_ulong; ++pub type msglen_t = c_ulong; ++pub type nlink_t = u32; ++pub type __u64 = c_ulonglong; ++pub type __s64 = c_longlong; ++pub type __fsword_t = i32; ++pub type fsblkcnt64_t = u64; ++pub type fsfilcnt64_t = u64; ++pub type __syscall_ulong_t = c_ulong; ++ ++pub type __syscall_slong_t = c_long; ++cfg_if! { ++ if #[cfg(target_arch = "riscv32")] { ++ pub type time_t = i64; ++ pub type suseconds_t = i64; ++ pub type ino_t = u64; ++ pub type off_t = i64; ++ pub type blkcnt_t = i64; ++ pub type fsblkcnt_t = u64; ++ pub type fsfilcnt_t = u64; ++ pub type rlim_t = u64; ++ pub type blksize_t = i64; ++ } else if #[cfg(gnu_time64_abi)] { ++ pub type time_t = i64; ++ pub type suseconds_t = i32; ++ pub type ino_t = u64; ++ pub type off_t = i64; ++ pub type blkcnt_t = i64; ++ pub type fsblkcnt_t = u64; ++ pub type fsfilcnt_t = u64; ++ pub type rlim_t = u64; ++ pub type blksize_t = i32; ++ } else { ++ pub type time_t = i32; ++ pub type suseconds_t = i32; ++ pub type ino_t = u32; ++ pub type off_t = i32; ++ pub type blkcnt_t = i32; ++ pub type fsblkcnt_t = c_ulong; ++ pub type fsfilcnt_t = c_ulong; ++ pub type rlim_t = c_ulong; ++ pub type blksize_t = i32; ++ } ++} ++cfg_if! { ++ if #[cfg(any(target_arch = "arm", target_arch="riscv32", target_arch="sparc"))] { ++ pub type stat64 = stat; ++ pub type statfs64 = statfs; ++ pub type statvfs64 = statvfs; ++ } ++} ++ ++s! { ++ pub struct statvfs { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_favail: crate::fsfilcnt_t, ++ pub f_fsid: c_ulong, ++ __f_unused: c_int, ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ __f_spare: [c_int; 6], ++ } ++ ++ pub struct pthread_attr_t { ++ __size: [u32; 9], ++ } ++ ++ pub struct sigset_t { ++ __val: [c_ulong; 32], ++ } ++ ++ pub struct sysinfo { ++ pub uptime: c_long, ++ pub loads: [c_ulong; 3], ++ pub totalram: c_ulong, ++ pub freeram: c_ulong, ++ pub sharedram: c_ulong, ++ pub bufferram: c_ulong, ++ pub totalswap: c_ulong, ++ pub freeswap: c_ulong, ++ pub procs: c_ushort, ++ #[deprecated( ++ since = "0.2.58", ++ note = "This padding field might become private in the future" ++ )] ++ pub pad: c_ushort, ++ pub totalhigh: c_ulong, ++ pub freehigh: c_ulong, ++ pub mem_unit: c_uint, ++ pub _f: [c_char; 8], ++ } ++ ++ pub struct semid_ds { ++ pub sem_perm: ipc_perm, ++ #[cfg(all(not(gnu_time64_abi), target_arch = "powerpc"))] ++ __reserved: crate::__syscall_ulong_t, ++ pub sem_otime: crate::time_t, ++ #[cfg(not(any( ++ gnu_time64_abi, ++ target_arch = "mips", ++ target_arch = "mips32r6", ++ target_arch = "powerpc" ++ )))] ++ __reserved: crate::__syscall_ulong_t, ++ #[cfg(all(not(gnu_time64_abi), target_arch = "powerpc"))] ++ __reserved2: crate::__syscall_ulong_t, ++ pub sem_ctime: crate::time_t, ++ #[cfg(not(any( ++ gnu_time64_abi, ++ target_arch = "mips", ++ target_arch = "mips32r6", ++ target_arch = "powerpc" ++ )))] ++ __reserved2: crate::__syscall_ulong_t, ++ pub sem_nsems: crate::__syscall_ulong_t, ++ #[cfg(all(gnu_time64_abi, ++ not(any( ++ target_arch = "mips", ++ target_arch = "mips32r6", ++ target_arch = "powerpc", ++ target_arch = "arm", ++ target_arch = "x86" ++ ))))] ++ __reserved2: crate::__syscall_ulong_t, ++ __glibc_reserved3: crate::__syscall_ulong_t, ++ __glibc_reserved4: crate::__syscall_ulong_t, ++ } ++ ++ pub struct timex { ++ pub modes: c_uint, ++ ++ #[cfg(not(gnu_time64_abi))] ++ pub offset: crate::__syscall_slong_t, ++ #[cfg(gnu_time64_abi)] ++ pub __unused_pad1: i32, ++ #[cfg(gnu_time64_abi)] ++ pub offset: c_longlong, ++ #[cfg(not(gnu_time64_abi))] ++ pub freq: crate::__syscall_slong_t, ++ #[cfg(gnu_time64_abi)] ++ pub freq: c_longlong, ++ #[cfg(not(gnu_time64_abi))] ++ pub maxerror: crate::__syscall_slong_t, ++ #[cfg(gnu_time64_abi)] ++ pub maxerror: c_longlong, ++ #[cfg(not(gnu_time64_abi))] ++ pub esterror: crate::__syscall_slong_t, ++ #[cfg(gnu_time64_abi)] ++ pub esterror: c_longlong, ++ pub status: c_int, ++ #[cfg(not(gnu_time64_abi))] ++ pub constant: crate::__syscall_slong_t, ++ #[cfg(gnu_time64_abi)] ++ pub __unused_pad2: i32, ++ #[cfg(gnu_time64_abi)] ++ pub constant: c_longlong, ++ #[cfg(not(gnu_time64_abi))] ++ pub precision: crate::__syscall_slong_t, ++ #[cfg(gnu_time64_abi)] ++ pub precision: c_longlong, ++ #[cfg(not(gnu_time64_abi))] ++ pub tolerance: crate::__syscall_slong_t, ++ #[cfg(gnu_time64_abi)] ++ pub tolerance: c_longlong, ++ pub time: crate::timeval, ++ #[cfg(not(gnu_time64_abi))] ++ pub tick: crate::__syscall_slong_t, ++ #[cfg(gnu_time64_abi)] ++ pub tick: c_longlong, ++ #[cfg(not(gnu_time64_abi))] ++ pub ppsfreq: crate::__syscall_slong_t, ++ #[cfg(gnu_time64_abi)] ++ pub ppsfreq: c_longlong, ++ #[cfg(not(gnu_time64_abi))] ++ pub jitter: crate::__syscall_slong_t, ++ #[cfg(gnu_time64_abi)] ++ pub jitter: c_longlong, ++ pub shift: c_int, ++ #[cfg(not(gnu_time64_abi))] ++ pub stabil: crate::__syscall_slong_t, ++ #[cfg(gnu_time64_abi)] ++ pub __unused_pad3: i32, ++ #[cfg(gnu_time64_abi)] ++ pub stabil: c_longlong, ++ #[cfg(not(gnu_time64_abi))] ++ pub jitcnt: crate::__syscall_slong_t, ++ #[cfg(gnu_time64_abi)] ++ pub jitcnt: c_longlong, ++ #[cfg(not(gnu_time64_abi))] ++ pub calcnt: crate::__syscall_slong_t, ++ #[cfg(gnu_time64_abi)] ++ pub calcnt: c_longlong, ++ #[cfg(not(gnu_time64_abi))] ++ pub errcnt: crate::__syscall_slong_t, ++ #[cfg(gnu_time64_abi)] ++ pub errcnt: c_longlong, ++ #[cfg(not(gnu_time64_abi))] ++ pub stbcnt: crate::__syscall_slong_t, ++ #[cfg(gnu_time64_abi)] ++ pub stbcnt: c_longlong, ++ pub tai: c_int, ++ pub __unused1: i32, ++ pub __unused2: i32, ++ pub __unused3: i32, ++ pub __unused4: i32, ++ pub __unused5: i32, ++ pub __unused6: i32, ++ pub __unused7: i32, ++ pub __unused8: i32, ++ pub __unused9: i32, ++ pub __unused10: i32, ++ pub __unused11: i32, ++ } ++} ++ ++pub const POSIX_FADV_DONTNEED: c_int = 4; ++pub const POSIX_FADV_NOREUSE: c_int = 5; ++ ++pub const F_OFD_GETLK: c_int = 36; ++pub const F_OFD_SETLK: c_int = 37; ++pub const F_OFD_SETLKW: c_int = 38; ++ ++pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; ++pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 24; ++pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 32; ++pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 20; ++pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; ++pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8; ++pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4; ++ ++cfg_if! { ++ if #[cfg(target_arch = "sparc")] { ++ pub const O_NOATIME: c_int = 0x200000; ++ pub const O_PATH: c_int = 0x1000000; ++ pub const O_TMPFILE: c_int = 0x2000000 | O_DIRECTORY; ++ ++ pub const SA_ONSTACK: c_int = 1; ++ ++ pub const PTRACE_DETACH: c_uint = 11; ++ ++ pub const F_RDLCK: c_int = 1; ++ pub const F_WRLCK: c_int = 2; ++ pub const F_UNLCK: c_int = 3; ++ ++ pub const SFD_CLOEXEC: c_int = 0x400000; ++ ++ pub const NCCS: usize = 17; ++ ++ pub const O_TRUNC: c_int = 0x400; ++ pub const O_CLOEXEC: c_int = 0x400000; ++ ++ pub const EBFONT: c_int = 109; ++ pub const ENOSTR: c_int = 72; ++ pub const ENODATA: c_int = 111; ++ pub const ETIME: c_int = 73; ++ pub const ENOSR: c_int = 74; ++ pub const ENONET: c_int = 80; ++ pub const ENOPKG: c_int = 113; ++ pub const EREMOTE: c_int = 71; ++ pub const ENOLINK: c_int = 82; ++ pub const EADV: c_int = 83; ++ pub const ESRMNT: c_int = 84; ++ pub const ECOMM: c_int = 85; ++ pub const EPROTO: c_int = 86; ++ pub const EDOTDOT: c_int = 88; ++ ++ pub const SA_NODEFER: c_int = 0x20; ++ pub const SA_RESETHAND: c_int = 0x4; ++ pub const SA_RESTART: c_int = 0x2; ++ pub const SA_NOCLDSTOP: c_int = 0x00000008; ++ ++ pub const EPOLL_CLOEXEC: c_int = 0x400000; ++ ++ pub const EFD_CLOEXEC: c_int = 0x400000; ++ } else { ++ pub const O_NOATIME: c_int = 0o1000000; ++ pub const O_PATH: c_int = 0o10000000; ++ pub const O_TMPFILE: c_int = 0o20000000 | O_DIRECTORY; ++ ++ pub const SA_ONSTACK: c_int = 0x08000000; ++ ++ pub const PTRACE_DETACH: c_uint = 17; ++ ++ pub const F_RDLCK: c_int = 0; ++ pub const F_WRLCK: c_int = 1; ++ pub const F_UNLCK: c_int = 2; ++ ++ pub const SFD_CLOEXEC: c_int = 0x080000; ++ ++ pub const NCCS: usize = 32; ++ ++ pub const O_TRUNC: c_int = 512; ++ pub const O_CLOEXEC: c_int = 0x80000; ++ pub const EBFONT: c_int = 59; ++ pub const ENOSTR: c_int = 60; ++ pub const ENODATA: c_int = 61; ++ pub const ETIME: c_int = 62; ++ pub const ENOSR: c_int = 63; ++ pub const ENONET: c_int = 64; ++ pub const ENOPKG: c_int = 65; ++ pub const EREMOTE: c_int = 66; ++ pub const ENOLINK: c_int = 67; ++ pub const EADV: c_int = 68; ++ pub const ESRMNT: c_int = 69; ++ pub const ECOMM: c_int = 70; ++ pub const EPROTO: c_int = 71; ++ pub const EDOTDOT: c_int = 73; ++ ++ pub const SA_NODEFER: c_int = 0x40000000; ++ pub const SA_RESETHAND: c_int = 0x80000000; ++ pub const SA_RESTART: c_int = 0x10000000; ++ pub const SA_NOCLDSTOP: c_int = 0x00000001; ++ ++ pub const EPOLL_CLOEXEC: c_int = 0x80000; ++ ++ pub const EFD_CLOEXEC: c_int = 0x80000; ++ } ++} ++cfg_if! { ++ if #[cfg(target_arch = "sparc")] { ++ pub const F_SETLK: c_int = 8; ++ pub const F_SETLKW: c_int = 9; ++ } else if #[cfg(all(gnu_time64_abi, target_arch = "mips"))] { ++ pub const F_SETLK: c_int = 34; ++ pub const F_SETLKW: c_int = 35; ++ } else if #[cfg(gnu_time64_abi)] { ++ pub const F_SETLK: c_int = 13; ++ pub const F_SETLKW: c_int = 14; ++ } else { ++ pub const F_SETLK: c_int = 6; ++ pub const F_SETLKW: c_int = 7; ++ } ++} ++ ++#[cfg(target_endian = "little")] ++pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++}; ++#[cfg(target_endian = "little")] ++pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++}; ++#[cfg(target_endian = "little")] ++pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++}; ++#[cfg(target_endian = "big")] ++pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++}; ++#[cfg(target_endian = "big")] ++pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++}; ++#[cfg(target_endian = "big")] ++pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++}; ++ ++pub const PTRACE_GETFPREGS: c_uint = 14; ++pub const PTRACE_SETFPREGS: c_uint = 15; ++pub const PTRACE_GETREGS: c_uint = 12; ++pub const PTRACE_SETREGS: c_uint = 13; ++ ++extern "C" { ++ pub fn sysctl( ++ name: *mut c_int, ++ namelen: c_int, ++ oldp: *mut c_void, ++ oldlenp: *mut size_t, ++ newp: *mut c_void, ++ newlen: size_t, ++ ) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "__ntp_gettime64")] ++ pub fn ntp_gettime(buf: *mut ntptimeval) -> c_int; ++} ++ ++cfg_if! { ++ if #[cfg(target_arch = "x86")] { ++ mod x86; ++ pub use self::x86::*; ++ } else if #[cfg(target_arch = "arm")] { ++ mod arm; ++ pub use self::arm::*; ++ } else if #[cfg(any(target_arch = "mips", target_arch = "mips32r6"))] { ++ mod mips; ++ pub use self::mips::*; ++ } else if #[cfg(target_arch = "m68k")] { ++ mod m68k; ++ pub use self::m68k::*; ++ } else if #[cfg(target_arch = "powerpc")] { ++ mod powerpc; ++ pub use self::powerpc::*; ++ } else if #[cfg(target_arch = "sparc")] { ++ mod sparc; ++ pub use self::sparc::*; ++ } else if #[cfg(target_arch = "riscv32")] { ++ mod riscv32; ++ pub use self::riscv32::*; ++ } else if #[cfg(target_arch = "csky")] { ++ mod csky; ++ pub use self::csky::*; ++ } else { ++ // Unknown target_arch ++ } ++} ++ ++cfg_if! { ++ if #[cfg(not(any( ++ target_arch = "mips", ++ target_arch = "mips32r6", ++ target_arch = "powerpc", ++ target_arch = "riscv32", ++ target_arch = "sparc", ++ )))] { ++ mod generic; ++ pub use self::generic::*; ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/powerpc.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/powerpc.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/powerpc.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/powerpc.rs 2024-12-28 15:35:00.000000000 -0500 +@@ -0,0 +1,848 @@ ++use crate::prelude::*; ++use crate::{off64_t, off_t}; ++ ++pub type c_char = u8; ++pub type wchar_t = i32; ++ ++pub type statfs64 = statfs; ++ ++s! { ++ pub struct sigaction { ++ pub sa_sigaction: crate::sighandler_t, ++ pub sa_mask: crate::sigset_t, ++ pub sa_flags: c_int, ++ pub sa_restorer: Option, ++ } ++ ++ pub struct stat { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ pub st_size: off_t, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_atime: crate::time_t, ++ #[cfg(gnu_time64_abi)] ++ __pad1: i32, ++ pub st_atime_nsec: c_long, ++ #[cfg(not(gnu_time64_abi))] ++ __pad1: i32, ++ pub st_mtime: crate::time_t, ++ #[cfg(gnu_time64_abi)] ++ __pad2: i32, ++ pub st_mtime_nsec: c_long, ++ #[cfg(not(gnu_time64_abi))] ++ __pad2: i32, ++ pub st_ctime: crate::time_t, ++ #[cfg(gnu_time64_abi)] ++ __pad3: i32, ++ pub st_ctime_nsec: c_long, ++ #[cfg(not(gnu_time64_abi))] ++ __pad3: i32, ++ } ++ ++ ++ pub struct statfs { ++ pub f_type: crate::__fsword_t, ++ pub f_bsize: crate::__fsword_t, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_fsid: crate::fsid_t, ++ ++ pub f_namelen: crate::__fsword_t, ++ pub f_frsize: crate::__fsword_t, ++ pub f_flags: crate::__fsword_t, ++ f_spare: [crate::__fsword_t; 4], ++ } ++ ++ pub struct flock { ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ pub l_start: off_t, ++ pub l_len: off_t, ++ pub l_pid: crate::pid_t, ++ } ++ ++ pub struct flock64 { ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ pub l_start: off64_t, ++ pub l_len: off64_t, ++ pub l_pid: crate::pid_t, ++ } ++ ++ pub struct ipc_perm { ++ __key: crate::key_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub cuid: crate::uid_t, ++ pub cgid: crate::gid_t, ++ pub mode: crate::mode_t, ++ __seq: u32, ++ __pad1: u32, ++ __glibc_reserved1: u64, ++ __glibc_reserved2: u64, ++ } ++ ++ pub struct stat64 { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino64_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ pub st_size: off64_t, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt64_t, ++ pub st_atime: crate::time_t, ++ __pad1: i32, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ __pad2: i32, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ __pad3: i32, ++ pub st_ctime_nsec: c_long, ++ } ++ ++ pub struct statvfs64 { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: u64, ++ pub f_bfree: u64, ++ pub f_bavail: u64, ++ pub f_files: u64, ++ pub f_ffree: u64, ++ pub f_favail: u64, ++ pub f_fsid: c_ulong, ++ __f_unused: c_int, ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ __f_spare: [c_int; 6], ++ } ++ ++ pub struct shmid_ds { ++ pub shm_perm: crate::ipc_perm, ++ pub shm_segsz: crate::size_t, ++ pub shm_atime: crate::time_t, ++ pub shm_dtime: crate::time_t, ++ pub shm_ctime: crate::time_t, ++ pub shm_cpid: crate::pid_t, ++ pub shm_lpid: crate::pid_t, ++ pub shm_nattch: crate::shmatt_t, ++ __glibc_reserved5: c_ulong, ++ __glibc_reserved6: c_ulong, ++ } ++ ++ pub struct msqid_ds { ++ pub msg_perm: crate::ipc_perm, ++ pub msg_stime: crate::time_t, ++ pub msg_rtime: crate::time_t, ++ pub msg_ctime: crate::time_t, ++ __msg_cbytes: c_ulong, ++ pub msg_qnum: crate::msgqnum_t, ++ pub msg_qbytes: crate::msglen_t, ++ pub msg_lspid: crate::pid_t, ++ pub msg_lrpid: crate::pid_t, ++ __glibc_reserved4: c_ulong, ++ __glibc_reserved5: c_ulong, ++ } ++ ++ pub struct siginfo_t { ++ pub si_signo: c_int, ++ pub si_errno: c_int, ++ pub si_code: c_int, ++ #[doc(hidden)] ++ #[deprecated( ++ since = "0.2.54", ++ note = "Please leave a comment on \ ++ https://github.com/rust-lang/libc/pull/1316 if you're using \ ++ this field" ++ )] ++ pub _pad: [c_int; 29], ++ _align: [usize; 0], ++ } ++ ++ pub struct stack_t { ++ pub ss_sp: *mut c_void, ++ pub ss_flags: c_int, ++ pub ss_size: size_t, ++ } ++} ++ ++pub const VEOF: usize = 4; ++pub const RTLD_DEEPBIND: c_int = 0x8; ++pub const RTLD_GLOBAL: c_int = 0x100; ++pub const RTLD_NOLOAD: c_int = 0x4; ++pub const O_DIRECT: c_int = 0x20000; ++pub const O_DIRECTORY: c_int = 0x4000; ++pub const O_NOFOLLOW: c_int = 0x8000; ++pub const O_LARGEFILE: c_int = 0o200000; ++pub const O_APPEND: c_int = 1024; ++pub const O_CREAT: c_int = 64; ++pub const O_EXCL: c_int = 128; ++pub const O_NOCTTY: c_int = 256; ++pub const O_NONBLOCK: c_int = 2048; ++pub const O_SYNC: c_int = 1052672; ++pub const O_RSYNC: c_int = 1052672; ++pub const O_DSYNC: c_int = 4096; ++pub const O_FSYNC: c_int = 0x101000; ++pub const O_ASYNC: c_int = 0x2000; ++pub const O_NDELAY: c_int = 0x800; ++pub const TCSANOW: c_int = 0; ++pub const TCSADRAIN: c_int = 1; ++pub const TCSAFLUSH: c_int = 2; ++ ++pub const MADV_SOFT_OFFLINE: c_int = 101; ++pub const MAP_LOCKED: c_int = 0x00080; ++pub const MAP_NORESERVE: c_int = 0x00040; ++pub const MAP_ANON: c_int = 0x0020; ++pub const MAP_ANONYMOUS: c_int = 0x0020; ++pub const MAP_DENYWRITE: c_int = 0x0800; ++pub const MAP_EXECUTABLE: c_int = 0x01000; ++pub const MAP_POPULATE: c_int = 0x08000; ++pub const MAP_NONBLOCK: c_int = 0x010000; ++pub const MAP_STACK: c_int = 0x020000; ++pub const MAP_HUGETLB: c_int = 0x040000; ++pub const MAP_GROWSDOWN: c_int = 0x0100; ++pub const MAP_SYNC: c_int = 0x080000; ++ ++pub const EDEADLOCK: c_int = 58; ++pub const EUCLEAN: c_int = 117; ++pub const ENOTNAM: c_int = 118; ++pub const ENAVAIL: c_int = 119; ++pub const EISNAM: c_int = 120; ++pub const EREMOTEIO: c_int = 121; ++pub const EDEADLK: c_int = 35; ++pub const ENAMETOOLONG: c_int = 36; ++pub const ENOLCK: c_int = 37; ++pub const ENOSYS: c_int = 38; ++pub const ENOTEMPTY: c_int = 39; ++pub const ELOOP: c_int = 40; ++pub const ENOMSG: c_int = 42; ++pub const EIDRM: c_int = 43; ++pub const ECHRNG: c_int = 44; ++pub const EL2NSYNC: c_int = 45; ++pub const EL3HLT: c_int = 46; ++pub const EL3RST: c_int = 47; ++pub const ELNRNG: c_int = 48; ++pub const EUNATCH: c_int = 49; ++pub const ENOCSI: c_int = 50; ++pub const EL2HLT: c_int = 51; ++pub const EBADE: c_int = 52; ++pub const EBADR: c_int = 53; ++pub const EXFULL: c_int = 54; ++pub const ENOANO: c_int = 55; ++pub const EBADRQC: c_int = 56; ++pub const EBADSLT: c_int = 57; ++pub const EMULTIHOP: c_int = 72; ++pub const EOVERFLOW: c_int = 75; ++pub const ENOTUNIQ: c_int = 76; ++pub const EBADFD: c_int = 77; ++pub const EBADMSG: c_int = 74; ++pub const EREMCHG: c_int = 78; ++pub const ELIBACC: c_int = 79; ++pub const ELIBBAD: c_int = 80; ++pub const ELIBSCN: c_int = 81; ++pub const ELIBMAX: c_int = 82; ++pub const ELIBEXEC: c_int = 83; ++pub const EILSEQ: c_int = 84; ++pub const ERESTART: c_int = 85; ++pub const ESTRPIPE: c_int = 86; ++pub const EUSERS: c_int = 87; ++pub const ENOTSOCK: c_int = 88; ++pub const EDESTADDRREQ: c_int = 89; ++pub const EMSGSIZE: c_int = 90; ++pub const EPROTOTYPE: c_int = 91; ++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 EPFNOSUPPORT: c_int = 96; ++pub const EAFNOSUPPORT: c_int = 97; ++pub const EADDRINUSE: c_int = 98; ++pub const EADDRNOTAVAIL: c_int = 99; ++pub const ENETDOWN: c_int = 100; ++pub const ENETUNREACH: c_int = 101; ++pub const ENETRESET: c_int = 102; ++pub const ECONNABORTED: c_int = 103; ++pub const ECONNRESET: c_int = 104; ++pub const ENOBUFS: c_int = 105; ++pub const EISCONN: c_int = 106; ++pub const ENOTCONN: c_int = 107; ++pub const ESHUTDOWN: c_int = 108; ++pub const ETOOMANYREFS: c_int = 109; ++pub const ETIMEDOUT: c_int = 110; ++pub const ECONNREFUSED: c_int = 111; ++pub const EHOSTDOWN: c_int = 112; ++pub const EHOSTUNREACH: c_int = 113; ++pub const EALREADY: c_int = 114; ++pub const EINPROGRESS: c_int = 115; ++pub const ESTALE: c_int = 116; ++pub const EDQUOT: c_int = 122; ++pub const ENOMEDIUM: c_int = 123; ++pub const EMEDIUMTYPE: c_int = 124; ++pub const ECANCELED: c_int = 125; ++pub const ENOKEY: c_int = 126; ++pub const EKEYEXPIRED: c_int = 127; ++pub const EKEYREVOKED: c_int = 128; ++pub const EKEYREJECTED: c_int = 129; ++pub const EOWNERDEAD: c_int = 130; ++pub const ENOTRECOVERABLE: c_int = 131; ++pub const EHWPOISON: c_int = 133; ++pub const ERFKILL: c_int = 132; ++ ++pub const SA_SIGINFO: c_int = 0x00000004; ++pub const SA_NOCLDWAIT: c_int = 0x00000002; ++ ++pub const SOCK_STREAM: c_int = 1; ++pub const SOCK_DGRAM: c_int = 2; ++ ++pub const MCL_CURRENT: c_int = 0x2000; ++pub const MCL_FUTURE: c_int = 0x4000; ++pub const MCL_ONFAULT: c_int = 0x8000; ++ ++pub const POLLWRNORM: c_short = 0x100; ++pub const POLLWRBAND: c_short = 0x200; ++ ++cfg_if! { ++ if #[cfg(gnu_time64_abi)] { ++ pub const F_GETLK: c_int = 12; ++ } else { ++ pub const F_GETLK: c_int = 5; ++ } ++} ++pub const F_GETOWN: c_int = 9; ++pub const F_SETOWN: c_int = 8; ++ ++pub const EFD_NONBLOCK: c_int = 0x800; ++pub const SFD_NONBLOCK: c_int = 0x0800; ++ ++pub const SIGCHLD: c_int = 17; ++pub const SIGBUS: c_int = 7; ++pub const SIGUSR1: c_int = 10; ++pub const SIGUSR2: c_int = 12; ++pub const SIGCONT: c_int = 18; ++pub const SIGSTOP: c_int = 19; ++pub const SIGTSTP: c_int = 20; ++pub const SIGURG: c_int = 23; ++pub const SIGIO: c_int = 29; ++pub const SIGSYS: c_int = 31; ++pub const SIGSTKFLT: c_int = 16; ++#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")] ++pub const SIGUNUSED: c_int = 31; ++pub const SIGPOLL: c_int = 29; ++pub const SIGPWR: c_int = 30; ++pub const SIG_SETMASK: c_int = 2; ++pub const SIG_BLOCK: c_int = 0x000000; ++pub const SIG_UNBLOCK: c_int = 0x01; ++pub const SIGTTIN: c_int = 21; ++pub const SIGTTOU: c_int = 22; ++pub const SIGXCPU: c_int = 24; ++pub const SIGXFSZ: c_int = 25; ++pub const SIGVTALRM: c_int = 26; ++pub const SIGPROF: c_int = 27; ++pub const SIGWINCH: c_int = 28; ++pub const SIGSTKSZ: size_t = 0x4000; ++pub const MINSIGSTKSZ: size_t = 4096; ++pub const CBAUD: crate::tcflag_t = 0xff; ++pub const TAB1: crate::tcflag_t = 0x400; ++pub const TAB2: crate::tcflag_t = 0x800; ++pub const TAB3: crate::tcflag_t = 0xc00; ++pub const CR1: crate::tcflag_t = 0x1000; ++pub const CR2: crate::tcflag_t = 0x2000; ++pub const CR3: crate::tcflag_t = 0x3000; ++pub const FF1: crate::tcflag_t = 0x4000; ++pub const BS1: crate::tcflag_t = 0x8000; ++pub const VT1: crate::tcflag_t = 0x10000; ++pub const VWERASE: usize = 0xa; ++pub const VREPRINT: usize = 0xb; ++pub const VSUSP: usize = 0xc; ++pub const VSTART: usize = 0xd; ++pub const VSTOP: usize = 0xe; ++pub const VDISCARD: usize = 0x10; ++pub const VTIME: usize = 0x7; ++pub const IXON: crate::tcflag_t = 0x200; ++pub const IXOFF: crate::tcflag_t = 0x400; ++pub const ONLCR: crate::tcflag_t = 0x2; ++pub const CSIZE: crate::tcflag_t = 0x300; ++pub const CS6: crate::tcflag_t = 0x100; ++pub const CS7: crate::tcflag_t = 0x200; ++pub const CS8: crate::tcflag_t = 0x300; ++pub const CSTOPB: crate::tcflag_t = 0x400; ++pub const CREAD: crate::tcflag_t = 0x800; ++pub const PARENB: crate::tcflag_t = 0x1000; ++pub const PARODD: crate::tcflag_t = 0x2000; ++pub const HUPCL: crate::tcflag_t = 0x4000; ++pub const CLOCAL: crate::tcflag_t = 0x8000; ++pub const ECHOKE: crate::tcflag_t = 0x1; ++pub const ECHOE: crate::tcflag_t = 0x2; ++pub const ECHOK: crate::tcflag_t = 0x4; ++pub const ECHONL: crate::tcflag_t = 0x10; ++pub const ECHOPRT: crate::tcflag_t = 0x20; ++pub const ECHOCTL: crate::tcflag_t = 0x40; ++pub const ISIG: crate::tcflag_t = 0x80; ++pub const ICANON: crate::tcflag_t = 0x100; ++pub const PENDIN: crate::tcflag_t = 0x20000000; ++pub const NOFLSH: crate::tcflag_t = 0x80000000; ++pub const VSWTC: usize = 9; ++pub const OLCUC: crate::tcflag_t = 0o000004; ++pub const NLDLY: crate::tcflag_t = 0o001400; ++pub const CRDLY: crate::tcflag_t = 0o030000; ++pub const TABDLY: crate::tcflag_t = 0o006000; ++pub const BSDLY: crate::tcflag_t = 0o100000; ++pub const FFDLY: crate::tcflag_t = 0o040000; ++pub const VTDLY: crate::tcflag_t = 0o200000; ++pub const XTABS: crate::tcflag_t = 0o006000; ++ ++pub const B0: crate::speed_t = 0o000000; ++pub const B50: crate::speed_t = 0o000001; ++pub const B75: crate::speed_t = 0o000002; ++pub const B110: crate::speed_t = 0o000003; ++pub const B134: crate::speed_t = 0o000004; ++pub const B150: crate::speed_t = 0o000005; ++pub const B200: crate::speed_t = 0o000006; ++pub const B300: crate::speed_t = 0o000007; ++pub const B600: crate::speed_t = 0o000010; ++pub const B1200: crate::speed_t = 0o000011; ++pub const B1800: crate::speed_t = 0o000012; ++pub const B2400: crate::speed_t = 0o000013; ++pub const B4800: crate::speed_t = 0o000014; ++pub const B9600: crate::speed_t = 0o000015; ++pub const B19200: crate::speed_t = 0o000016; ++pub const B38400: crate::speed_t = 0o000017; ++pub const EXTA: crate::speed_t = B19200; ++pub const EXTB: crate::speed_t = B38400; ++pub const CBAUDEX: crate::speed_t = 0o000020; ++pub const B57600: crate::speed_t = 0o0020; ++pub const B115200: crate::speed_t = 0o0021; ++pub const B230400: crate::speed_t = 0o0022; ++pub const B460800: crate::speed_t = 0o0023; ++pub const B500000: crate::speed_t = 0o0024; ++pub const B576000: crate::speed_t = 0o0025; ++pub const B921600: crate::speed_t = 0o0026; ++pub const B1000000: crate::speed_t = 0o0027; ++pub const B1152000: crate::speed_t = 0o0030; ++pub const B1500000: crate::speed_t = 0o0031; ++pub const B2000000: crate::speed_t = 0o0032; ++pub const B2500000: crate::speed_t = 0o0033; ++pub const B3000000: crate::speed_t = 0o0034; ++pub const B3500000: crate::speed_t = 0o0035; ++pub const B4000000: crate::speed_t = 0o0036; ++ ++pub const VEOL: usize = 6; ++pub const VEOL2: usize = 8; ++pub const VMIN: usize = 5; ++pub const IEXTEN: crate::tcflag_t = 0x400; ++pub const TOSTOP: crate::tcflag_t = 0x400000; ++pub const FLUSHO: crate::tcflag_t = 0x800000; ++pub const EXTPROC: crate::tcflag_t = 0x10000000; ++ ++pub const SYS_restart_syscall: c_long = 0; ++pub const SYS_exit: c_long = 1; ++pub const SYS_fork: c_long = 2; ++pub const SYS_read: c_long = 3; ++pub const SYS_write: c_long = 4; ++pub const SYS_open: c_long = 5; ++pub const SYS_close: c_long = 6; ++pub const SYS_waitpid: c_long = 7; ++pub const SYS_creat: c_long = 8; ++pub const SYS_link: c_long = 9; ++pub const SYS_unlink: c_long = 10; ++pub const SYS_execve: c_long = 11; ++pub const SYS_chdir: c_long = 12; ++pub const SYS_time: c_long = 13; ++pub const SYS_mknod: c_long = 14; ++pub const SYS_chmod: c_long = 15; ++pub const SYS_lchown: c_long = 16; ++pub const SYS_break: c_long = 17; ++pub const SYS_oldstat: c_long = 18; ++pub const SYS_lseek: c_long = 19; ++pub const SYS_getpid: c_long = 20; ++pub const SYS_mount: c_long = 21; ++pub const SYS_umount: c_long = 22; ++pub const SYS_setuid: c_long = 23; ++pub const SYS_getuid: c_long = 24; ++pub const SYS_stime: c_long = 25; ++pub const SYS_ptrace: c_long = 26; ++pub const SYS_alarm: c_long = 27; ++pub const SYS_oldfstat: c_long = 28; ++pub const SYS_pause: c_long = 29; ++pub const SYS_utime: c_long = 30; ++pub const SYS_stty: c_long = 31; ++pub const SYS_gtty: c_long = 32; ++pub const SYS_access: c_long = 33; ++pub const SYS_nice: c_long = 34; ++pub const SYS_ftime: c_long = 35; ++pub const SYS_sync: c_long = 36; ++pub const SYS_kill: c_long = 37; ++pub const SYS_rename: c_long = 38; ++pub const SYS_mkdir: c_long = 39; ++pub const SYS_rmdir: c_long = 40; ++pub const SYS_dup: c_long = 41; ++pub const SYS_pipe: c_long = 42; ++pub const SYS_times: c_long = 43; ++pub const SYS_prof: c_long = 44; ++pub const SYS_brk: c_long = 45; ++pub const SYS_setgid: c_long = 46; ++pub const SYS_getgid: c_long = 47; ++pub const SYS_signal: c_long = 48; ++pub const SYS_geteuid: c_long = 49; ++pub const SYS_getegid: c_long = 50; ++pub const SYS_acct: c_long = 51; ++pub const SYS_umount2: c_long = 52; ++pub const SYS_lock: c_long = 53; ++pub const SYS_ioctl: c_long = 54; ++pub const SYS_fcntl: c_long = 55; ++pub const SYS_mpx: c_long = 56; ++pub const SYS_setpgid: c_long = 57; ++pub const SYS_ulimit: c_long = 58; ++pub const SYS_oldolduname: c_long = 59; ++pub const SYS_umask: c_long = 60; ++pub const SYS_chroot: c_long = 61; ++pub const SYS_ustat: c_long = 62; ++pub const SYS_dup2: c_long = 63; ++pub const SYS_getppid: c_long = 64; ++pub const SYS_getpgrp: c_long = 65; ++pub const SYS_setsid: c_long = 66; ++pub const SYS_sigaction: c_long = 67; ++pub const SYS_sgetmask: c_long = 68; ++pub const SYS_ssetmask: c_long = 69; ++pub const SYS_setreuid: c_long = 70; ++pub const SYS_setregid: c_long = 71; ++pub const SYS_sigsuspend: c_long = 72; ++pub const SYS_sigpending: c_long = 73; ++pub const SYS_sethostname: c_long = 74; ++pub const SYS_setrlimit: c_long = 75; ++pub const SYS_getrlimit: c_long = 76; ++pub const SYS_getrusage: c_long = 77; ++pub const SYS_gettimeofday: c_long = 78; ++pub const SYS_settimeofday: c_long = 79; ++pub const SYS_getgroups: c_long = 80; ++pub const SYS_setgroups: c_long = 81; ++pub const SYS_select: c_long = 82; ++pub const SYS_symlink: c_long = 83; ++pub const SYS_oldlstat: c_long = 84; ++pub const SYS_readlink: c_long = 85; ++pub const SYS_uselib: c_long = 86; ++pub const SYS_swapon: c_long = 87; ++pub const SYS_reboot: c_long = 88; ++pub const SYS_readdir: c_long = 89; ++pub const SYS_mmap: c_long = 90; ++pub const SYS_munmap: c_long = 91; ++pub const SYS_truncate: c_long = 92; ++pub const SYS_ftruncate: c_long = 93; ++pub const SYS_fchmod: c_long = 94; ++pub const SYS_fchown: c_long = 95; ++pub const SYS_getpriority: c_long = 96; ++pub const SYS_setpriority: c_long = 97; ++pub const SYS_profil: c_long = 98; ++pub const SYS_statfs: c_long = 99; ++pub const SYS_fstatfs: c_long = 100; ++pub const SYS_ioperm: c_long = 101; ++pub const SYS_socketcall: c_long = 102; ++pub const SYS_syslog: c_long = 103; ++pub const SYS_setitimer: c_long = 104; ++pub const SYS_getitimer: c_long = 105; ++pub const SYS_stat: c_long = 106; ++pub const SYS_lstat: c_long = 107; ++pub const SYS_fstat: c_long = 108; ++pub const SYS_olduname: c_long = 109; ++pub const SYS_iopl: c_long = 110; ++pub const SYS_vhangup: c_long = 111; ++pub const SYS_idle: c_long = 112; ++pub const SYS_vm86: c_long = 113; ++pub const SYS_wait4: c_long = 114; ++pub const SYS_swapoff: c_long = 115; ++pub const SYS_sysinfo: c_long = 116; ++pub const SYS_ipc: c_long = 117; ++pub const SYS_fsync: c_long = 118; ++pub const SYS_sigreturn: c_long = 119; ++pub const SYS_clone: c_long = 120; ++pub const SYS_setdomainname: c_long = 121; ++pub const SYS_uname: c_long = 122; ++pub const SYS_modify_ldt: c_long = 123; ++pub const SYS_adjtimex: c_long = 124; ++pub const SYS_mprotect: c_long = 125; ++pub const SYS_sigprocmask: c_long = 126; ++pub const SYS_create_module: c_long = 127; ++pub const SYS_init_module: c_long = 128; ++pub const SYS_delete_module: c_long = 129; ++pub const SYS_get_kernel_syms: c_long = 130; ++pub const SYS_quotactl: c_long = 131; ++pub const SYS_getpgid: c_long = 132; ++pub const SYS_fchdir: c_long = 133; ++pub const SYS_bdflush: c_long = 134; ++pub const SYS_sysfs: c_long = 135; ++pub const SYS_personality: c_long = 136; ++pub const SYS_afs_syscall: c_long = 137; /* Syscall for Andrew File System */ ++pub const SYS_setfsuid: c_long = 138; ++pub const SYS_setfsgid: c_long = 139; ++pub const SYS__llseek: c_long = 140; ++pub const SYS_getdents: c_long = 141; ++pub const SYS__newselect: c_long = 142; ++pub const SYS_flock: c_long = 143; ++pub const SYS_msync: c_long = 144; ++pub const SYS_readv: c_long = 145; ++pub const SYS_writev: c_long = 146; ++pub const SYS_getsid: c_long = 147; ++pub const SYS_fdatasync: c_long = 148; ++pub const SYS__sysctl: c_long = 149; ++pub const SYS_mlock: c_long = 150; ++pub const SYS_munlock: c_long = 151; ++pub const SYS_mlockall: c_long = 152; ++pub const SYS_munlockall: c_long = 153; ++pub const SYS_sched_setparam: c_long = 154; ++pub const SYS_sched_getparam: c_long = 155; ++pub const SYS_sched_setscheduler: c_long = 156; ++pub const SYS_sched_getscheduler: c_long = 157; ++pub const SYS_sched_yield: c_long = 158; ++pub const SYS_sched_get_priority_max: c_long = 159; ++pub const SYS_sched_get_priority_min: c_long = 160; ++pub const SYS_sched_rr_get_interval: c_long = 161; ++pub const SYS_nanosleep: c_long = 162; ++pub const SYS_mremap: c_long = 163; ++pub const SYS_setresuid: c_long = 164; ++pub const SYS_getresuid: c_long = 165; ++pub const SYS_query_module: c_long = 166; ++pub const SYS_poll: c_long = 167; ++pub const SYS_nfsservctl: c_long = 168; ++pub const SYS_setresgid: c_long = 169; ++pub const SYS_getresgid: c_long = 170; ++pub const SYS_prctl: c_long = 171; ++pub const SYS_rt_sigreturn: c_long = 172; ++pub const SYS_rt_sigaction: c_long = 173; ++pub const SYS_rt_sigprocmask: c_long = 174; ++pub const SYS_rt_sigpending: c_long = 175; ++pub const SYS_rt_sigtimedwait: c_long = 176; ++pub const SYS_rt_sigqueueinfo: c_long = 177; ++pub const SYS_rt_sigsuspend: c_long = 178; ++pub const SYS_pread64: c_long = 179; ++pub const SYS_pwrite64: c_long = 180; ++pub const SYS_chown: c_long = 181; ++pub const SYS_getcwd: c_long = 182; ++pub const SYS_capget: c_long = 183; ++pub const SYS_capset: c_long = 184; ++pub const SYS_sigaltstack: c_long = 185; ++pub const SYS_sendfile: c_long = 186; ++pub const SYS_getpmsg: c_long = 187; /* some people actually want streams */ ++pub const SYS_putpmsg: c_long = 188; /* some people actually want streams */ ++pub const SYS_vfork: c_long = 189; ++pub const SYS_ugetrlimit: c_long = 190; /* SuS compliant getrlimit */ ++pub const SYS_readahead: c_long = 191; ++pub const SYS_mmap2: c_long = 192; ++pub const SYS_truncate64: c_long = 193; ++pub const SYS_ftruncate64: c_long = 194; ++pub const SYS_stat64: c_long = 195; ++pub const SYS_lstat64: c_long = 196; ++pub const SYS_fstat64: c_long = 197; ++pub const SYS_pciconfig_read: c_long = 198; ++pub const SYS_pciconfig_write: c_long = 199; ++pub const SYS_pciconfig_iobase: c_long = 200; ++pub const SYS_multiplexer: c_long = 201; ++pub const SYS_getdents64: c_long = 202; ++pub const SYS_pivot_root: c_long = 203; ++pub const SYS_fcntl64: c_long = 204; ++pub const SYS_madvise: c_long = 205; ++pub const SYS_mincore: c_long = 206; ++pub const SYS_gettid: c_long = 207; ++pub const SYS_tkill: c_long = 208; ++pub const SYS_setxattr: c_long = 209; ++pub const SYS_lsetxattr: c_long = 210; ++pub const SYS_fsetxattr: c_long = 211; ++pub const SYS_getxattr: c_long = 212; ++pub const SYS_lgetxattr: c_long = 213; ++pub const SYS_fgetxattr: c_long = 214; ++pub const SYS_listxattr: c_long = 215; ++pub const SYS_llistxattr: c_long = 216; ++pub const SYS_flistxattr: c_long = 217; ++pub const SYS_removexattr: c_long = 218; ++pub const SYS_lremovexattr: c_long = 219; ++pub const SYS_fremovexattr: c_long = 220; ++pub const SYS_futex: c_long = 221; ++pub const SYS_sched_setaffinity: c_long = 222; ++pub const SYS_sched_getaffinity: c_long = 223; ++pub const SYS_tuxcall: c_long = 225; ++pub const SYS_sendfile64: c_long = 226; ++pub const SYS_io_setup: c_long = 227; ++pub const SYS_io_destroy: c_long = 228; ++pub const SYS_io_getevents: c_long = 229; ++pub const SYS_io_submit: c_long = 230; ++pub const SYS_io_cancel: c_long = 231; ++pub const SYS_set_tid_address: c_long = 232; ++pub const SYS_fadvise64: c_long = 233; ++pub const SYS_exit_group: c_long = 234; ++pub const SYS_lookup_dcookie: c_long = 235; ++pub const SYS_epoll_create: c_long = 236; ++pub const SYS_epoll_ctl: c_long = 237; ++pub const SYS_epoll_wait: c_long = 238; ++pub const SYS_remap_file_pages: c_long = 239; ++pub const SYS_timer_create: c_long = 240; ++pub const SYS_timer_settime: c_long = 241; ++pub const SYS_timer_gettime: c_long = 242; ++pub const SYS_timer_getoverrun: c_long = 243; ++pub const SYS_timer_delete: c_long = 244; ++pub const SYS_clock_settime: c_long = 245; ++pub const SYS_clock_gettime: c_long = 246; ++pub const SYS_clock_getres: c_long = 247; ++pub const SYS_clock_nanosleep: c_long = 248; ++pub const SYS_swapcontext: c_long = 249; ++pub const SYS_tgkill: c_long = 250; ++pub const SYS_utimes: c_long = 251; ++pub const SYS_statfs64: c_long = 252; ++pub const SYS_fstatfs64: c_long = 253; ++pub const SYS_fadvise64_64: c_long = 254; ++pub const SYS_rtas: c_long = 255; ++pub const SYS_sys_debug_setcontext: c_long = 256; ++pub const SYS_migrate_pages: c_long = 258; ++pub const SYS_mbind: c_long = 259; ++pub const SYS_get_mempolicy: c_long = 260; ++pub const SYS_set_mempolicy: c_long = 261; ++pub const SYS_mq_open: c_long = 262; ++pub const SYS_mq_unlink: c_long = 263; ++pub const SYS_mq_timedsend: c_long = 264; ++pub const SYS_mq_timedreceive: c_long = 265; ++pub const SYS_mq_notify: c_long = 266; ++pub const SYS_mq_getsetattr: c_long = 267; ++pub const SYS_kexec_load: c_long = 268; ++pub const SYS_add_key: c_long = 269; ++pub const SYS_request_key: c_long = 270; ++pub const SYS_keyctl: c_long = 271; ++pub const SYS_waitid: c_long = 272; ++pub const SYS_ioprio_set: c_long = 273; ++pub const SYS_ioprio_get: c_long = 274; ++pub const SYS_inotify_init: c_long = 275; ++pub const SYS_inotify_add_watch: c_long = 276; ++pub const SYS_inotify_rm_watch: c_long = 277; ++pub const SYS_spu_run: c_long = 278; ++pub const SYS_spu_create: c_long = 279; ++pub const SYS_pselect6: c_long = 280; ++pub const SYS_ppoll: c_long = 281; ++pub const SYS_unshare: c_long = 282; ++pub const SYS_splice: c_long = 283; ++pub const SYS_tee: c_long = 284; ++pub const SYS_vmsplice: c_long = 285; ++pub const SYS_openat: c_long = 286; ++pub const SYS_mkdirat: c_long = 287; ++pub const SYS_mknodat: c_long = 288; ++pub const SYS_fchownat: c_long = 289; ++pub const SYS_futimesat: c_long = 290; ++pub const SYS_fstatat64: c_long = 291; ++pub const SYS_unlinkat: c_long = 292; ++pub const SYS_renameat: c_long = 293; ++pub const SYS_linkat: c_long = 294; ++pub const SYS_symlinkat: c_long = 295; ++pub const SYS_readlinkat: c_long = 296; ++pub const SYS_fchmodat: c_long = 297; ++pub const SYS_faccessat: c_long = 298; ++pub const SYS_get_robust_list: c_long = 299; ++pub const SYS_set_robust_list: c_long = 300; ++pub const SYS_move_pages: c_long = 301; ++pub const SYS_getcpu: c_long = 302; ++pub const SYS_epoll_pwait: c_long = 303; ++pub const SYS_utimensat: c_long = 304; ++pub const SYS_signalfd: c_long = 305; ++pub const SYS_timerfd_create: c_long = 306; ++pub const SYS_eventfd: c_long = 307; ++pub const SYS_sync_file_range2: c_long = 308; ++pub const SYS_fallocate: c_long = 309; ++pub const SYS_subpage_prot: c_long = 310; ++pub const SYS_timerfd_settime: c_long = 311; ++pub const SYS_timerfd_gettime: c_long = 312; ++pub const SYS_signalfd4: c_long = 313; ++pub const SYS_eventfd2: c_long = 314; ++pub const SYS_epoll_create1: c_long = 315; ++pub const SYS_dup3: c_long = 316; ++pub const SYS_pipe2: c_long = 317; ++pub const SYS_inotify_init1: c_long = 318; ++pub const SYS_perf_event_open: c_long = 319; ++pub const SYS_preadv: c_long = 320; ++pub const SYS_pwritev: c_long = 321; ++pub const SYS_rt_tgsigqueueinfo: c_long = 322; ++pub const SYS_fanotify_init: c_long = 323; ++pub const SYS_fanotify_mark: c_long = 324; ++pub const SYS_prlimit64: c_long = 325; ++pub const SYS_socket: c_long = 326; ++pub const SYS_bind: c_long = 327; ++pub const SYS_connect: c_long = 328; ++pub const SYS_listen: c_long = 329; ++pub const SYS_accept: c_long = 330; ++pub const SYS_getsockname: c_long = 331; ++pub const SYS_getpeername: c_long = 332; ++pub const SYS_socketpair: c_long = 333; ++pub const SYS_send: c_long = 334; ++pub const SYS_sendto: c_long = 335; ++pub const SYS_recv: c_long = 336; ++pub const SYS_recvfrom: c_long = 337; ++pub const SYS_shutdown: c_long = 338; ++pub const SYS_setsockopt: c_long = 339; ++pub const SYS_getsockopt: c_long = 340; ++pub const SYS_sendmsg: c_long = 341; ++pub const SYS_recvmsg: c_long = 342; ++pub const SYS_recvmmsg: c_long = 343; ++pub const SYS_accept4: c_long = 344; ++pub const SYS_name_to_handle_at: c_long = 345; ++pub const SYS_open_by_handle_at: c_long = 346; ++pub const SYS_clock_adjtime: c_long = 347; ++pub const SYS_syncfs: c_long = 348; ++pub const SYS_sendmmsg: c_long = 349; ++pub const SYS_setns: c_long = 350; ++pub const SYS_process_vm_readv: c_long = 351; ++pub const SYS_process_vm_writev: c_long = 352; ++pub const SYS_finit_module: c_long = 353; ++pub const SYS_kcmp: c_long = 354; ++pub const SYS_sched_setattr: c_long = 355; ++pub const SYS_sched_getattr: c_long = 356; ++pub const SYS_renameat2: c_long = 357; ++pub const SYS_seccomp: c_long = 358; ++pub const SYS_getrandom: c_long = 359; ++pub const SYS_memfd_create: c_long = 360; ++pub const SYS_bpf: c_long = 361; ++pub const SYS_execveat: c_long = 362; ++pub const SYS_switch_endian: c_long = 363; ++pub const SYS_userfaultfd: c_long = 364; ++pub const SYS_membarrier: c_long = 365; ++pub const SYS_mlock2: c_long = 378; ++pub const SYS_copy_file_range: c_long = 379; ++pub const SYS_preadv2: c_long = 380; ++pub const SYS_pwritev2: c_long = 381; ++pub const SYS_kexec_file_load: c_long = 382; ++pub const SYS_statx: c_long = 383; ++pub const SYS_rseq: c_long = 387; ++pub const SYS_pidfd_send_signal: c_long = 424; ++pub const SYS_io_uring_setup: c_long = 425; ++pub const SYS_io_uring_enter: c_long = 426; ++pub const SYS_io_uring_register: c_long = 427; ++pub const SYS_open_tree: c_long = 428; ++pub const SYS_move_mount: c_long = 429; ++pub const SYS_fsopen: c_long = 430; ++pub const SYS_fsconfig: c_long = 431; ++pub const SYS_fsmount: c_long = 432; ++pub const SYS_fspick: c_long = 433; ++pub const SYS_pidfd_open: c_long = 434; ++pub const SYS_clone3: c_long = 435; ++pub const SYS_close_range: c_long = 436; ++pub const SYS_openat2: c_long = 437; ++pub const SYS_pidfd_getfd: c_long = 438; ++pub const SYS_faccessat2: c_long = 439; ++pub const SYS_process_madvise: c_long = 440; ++pub const SYS_epoll_pwait2: c_long = 441; ++pub const SYS_mount_setattr: c_long = 442; ++pub const SYS_quotactl_fd: c_long = 443; ++pub const SYS_landlock_create_ruleset: c_long = 444; ++pub const SYS_landlock_add_rule: c_long = 445; ++pub const SYS_landlock_restrict_self: c_long = 446; ++pub const SYS_memfd_secret: c_long = 447; ++pub const SYS_process_mrelease: c_long = 448; ++pub const SYS_futex_waitv: c_long = 449; ++pub const SYS_set_mempolicy_home_node: c_long = 450; ++pub const SYS_mseal: c_long = 462; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/riscv32/mod.rs 2024-12-28 15:35:00.000000000 -0500 +@@ -0,0 +1,760 @@ ++//! RISC-V-specific definitions for 32-bit linux-like values ++ ++use crate::prelude::*; ++use crate::{off64_t, off_t}; ++ ++pub type c_char = u8; ++pub type wchar_t = c_int; ++ ++s! { ++ pub struct msqid_ds { ++ pub msg_perm: crate::ipc_perm, ++ pub msg_stime: crate::time_t, ++ pub msg_rtime: crate::time_t, ++ pub msg_ctime: crate::time_t, ++ __msg_cbytes: c_ulong, ++ pub msg_qnum: crate::msgqnum_t, ++ pub msg_qbytes: crate::msglen_t, ++ pub msg_lspid: crate::pid_t, ++ pub msg_lrpid: crate::pid_t, ++ __glibc_reserved4: c_ulong, ++ __glibc_reserved5: c_ulong, ++ } ++ ++ pub struct statfs { ++ pub f_type: c_long, ++ pub f_bsize: c_long, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_fsid: crate::fsid_t, ++ pub f_namelen: c_long, ++ pub f_frsize: c_long, ++ pub f_flags: c_long, ++ pub f_spare: [c_long; 4], ++ } ++ ++ pub struct siginfo_t { ++ pub si_signo: c_int, ++ pub si_errno: c_int, ++ pub si_code: c_int, ++ #[doc(hidden)] ++ #[deprecated( ++ since = "0.2.54", ++ note = "Please leave a comment on \ ++ https://github.com/rust-lang/libc/pull/1316 if you're using \ ++ this field" ++ )] ++ pub _pad: [c_int; 29], ++ _align: [u64; 0], ++ } ++ ++ pub struct stack_t { ++ pub ss_sp: *mut c_void, ++ pub ss_flags: c_int, ++ pub ss_size: size_t, ++ } ++ ++ pub struct sigaction { ++ pub sa_sigaction: crate::sighandler_t, ++ pub sa_mask: crate::sigset_t, ++ pub sa_flags: c_int, ++ pub sa_restorer: Option, ++ } ++ ++ pub struct ipc_perm { ++ pub __key: crate::key_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub cuid: crate::uid_t, ++ pub cgid: crate::gid_t, ++ pub mode: c_ushort, ++ __pad1: c_ushort, ++ pub __seq: c_ushort, ++ __pad2: c_ushort, ++ __unused1: c_ulong, ++ __unused2: c_ulong, ++ } ++ ++ pub struct shmid_ds { ++ pub shm_perm: crate::ipc_perm, ++ pub shm_segsz: size_t, ++ pub shm_atime: crate::time_t, ++ pub shm_dtime: crate::time_t, ++ pub shm_ctime: crate::time_t, ++ pub shm_cpid: crate::pid_t, ++ pub shm_lpid: crate::pid_t, ++ pub shm_nattch: crate::shmatt_t, ++ __unused5: c_ulong, ++ __unused6: c_ulong, ++ } ++ ++ pub struct flock { ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ pub l_start: off_t, ++ pub l_len: off_t, ++ pub l_pid: crate::pid_t, ++ } ++ ++ pub struct flock64 { ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ pub l_start: off64_t, ++ pub l_len: off64_t, ++ pub l_pid: crate::pid_t, ++ } ++ ++ pub struct user_regs_struct { ++ pub pc: c_ulong, ++ pub ra: c_ulong, ++ pub sp: c_ulong, ++ pub gp: c_ulong, ++ pub tp: c_ulong, ++ pub t0: c_ulong, ++ pub t1: c_ulong, ++ pub t2: c_ulong, ++ pub s0: c_ulong, ++ pub s1: c_ulong, ++ pub a0: c_ulong, ++ pub a1: c_ulong, ++ pub a2: c_ulong, ++ pub a3: c_ulong, ++ pub a4: c_ulong, ++ pub a5: c_ulong, ++ pub a6: c_ulong, ++ pub a7: c_ulong, ++ pub s2: c_ulong, ++ pub s3: c_ulong, ++ pub s4: c_ulong, ++ pub s5: c_ulong, ++ pub s6: c_ulong, ++ pub s7: c_ulong, ++ pub s8: c_ulong, ++ pub s9: c_ulong, ++ pub s10: c_ulong, ++ pub s11: c_ulong, ++ pub t3: c_ulong, ++ pub t4: c_ulong, ++ pub t5: c_ulong, ++ pub t6: c_ulong, ++ } ++} ++ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ pub struct ucontext_t { ++ pub __uc_flags: c_ulong, ++ pub uc_link: *mut ucontext_t, ++ pub uc_stack: crate::stack_t, ++ pub uc_sigmask: crate::sigset_t, ++ pub uc_mcontext: mcontext_t, ++ } ++ ++ #[allow(missing_debug_implementations)] ++ #[repr(align(16))] ++ pub struct mcontext_t { ++ pub __gregs: [c_ulong; 32], ++ pub __fpregs: __riscv_mc_fp_state, ++ } ++ ++ pub union __riscv_mc_fp_state { ++ pub __f: __riscv_mc_f_ext_state, ++ pub __d: __riscv_mc_d_ext_state, ++ pub __q: __riscv_mc_q_ext_state, ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub struct __riscv_mc_f_ext_state { ++ pub __f: [c_uint; 32], ++ pub __fcsr: c_uint, ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub struct __riscv_mc_d_ext_state { ++ pub __f: [c_ulonglong; 32], ++ pub __fcsr: c_uint, ++ } ++ ++ #[allow(missing_debug_implementations)] ++ #[repr(align(16))] ++ pub struct __riscv_mc_q_ext_state { ++ pub __f: [c_ulonglong; 64], ++ pub __fcsr: c_uint, ++ pub __glibc_reserved: [c_uint; 3], ++ } ++} ++ ++pub const O_LARGEFILE: c_int = 0; ++pub const VEOF: usize = 4; ++pub const RTLD_DEEPBIND: c_int = 0x8; ++pub const RTLD_GLOBAL: c_int = 0x100; ++pub const RTLD_NOLOAD: c_int = 0x4; ++pub const O_APPEND: c_int = 1024; ++pub const O_CREAT: c_int = 64; ++pub const O_EXCL: c_int = 128; ++pub const O_NOCTTY: c_int = 256; ++pub const O_NONBLOCK: c_int = 2048; ++pub const O_SYNC: c_int = 1052672; ++pub const O_RSYNC: c_int = 1052672; ++pub const O_DSYNC: c_int = 4096; ++pub const O_FSYNC: c_int = 1052672; ++pub const MADV_SOFT_OFFLINE: c_int = 101; ++pub const MAP_GROWSDOWN: c_int = 256; ++pub const EDEADLK: c_int = 35; ++pub const ENAMETOOLONG: c_int = 36; ++pub const ENOLCK: c_int = 37; ++pub const ENOSYS: c_int = 38; ++pub const ENOTEMPTY: c_int = 39; ++pub const ELOOP: c_int = 40; ++pub const ENOMSG: c_int = 42; ++pub const EIDRM: c_int = 43; ++pub const ECHRNG: c_int = 44; ++pub const EL2NSYNC: c_int = 45; ++pub const EL3HLT: c_int = 46; ++pub const EL3RST: c_int = 47; ++pub const ELNRNG: c_int = 48; ++pub const EUNATCH: c_int = 49; ++pub const ENOCSI: c_int = 50; ++pub const EL2HLT: c_int = 51; ++pub const EBADE: c_int = 52; ++pub const EBADR: c_int = 53; ++pub const EXFULL: c_int = 54; ++pub const ENOANO: c_int = 55; ++pub const EBADRQC: c_int = 56; ++pub const EBADSLT: c_int = 57; ++pub const EMULTIHOP: c_int = 72; ++pub const EOVERFLOW: c_int = 75; ++pub const ENOTUNIQ: c_int = 76; ++pub const EBADFD: c_int = 77; ++pub const EBADMSG: c_int = 74; ++pub const EREMCHG: c_int = 78; ++pub const ELIBACC: c_int = 79; ++pub const ELIBBAD: c_int = 80; ++pub const ELIBSCN: c_int = 81; ++pub const ELIBMAX: c_int = 82; ++pub const ELIBEXEC: c_int = 83; ++pub const EILSEQ: c_int = 84; ++pub const ERESTART: c_int = 85; ++pub const ESTRPIPE: c_int = 86; ++pub const EUSERS: c_int = 87; ++pub const ENOTSOCK: c_int = 88; ++pub const EDESTADDRREQ: c_int = 89; ++pub const EMSGSIZE: c_int = 90; ++pub const EPROTOTYPE: c_int = 91; ++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 EPFNOSUPPORT: c_int = 96; ++pub const EAFNOSUPPORT: c_int = 97; ++pub const EADDRINUSE: c_int = 98; ++pub const EADDRNOTAVAIL: c_int = 99; ++pub const ENETDOWN: c_int = 100; ++pub const ENETUNREACH: c_int = 101; ++pub const ENETRESET: c_int = 102; ++pub const ECONNABORTED: c_int = 103; ++pub const ECONNRESET: c_int = 104; ++pub const ENOBUFS: c_int = 105; ++pub const EISCONN: c_int = 106; ++pub const ENOTCONN: c_int = 107; ++pub const ESHUTDOWN: c_int = 108; ++pub const ETOOMANYREFS: c_int = 109; ++pub const ETIMEDOUT: c_int = 110; ++pub const ECONNREFUSED: c_int = 111; ++pub const EHOSTDOWN: c_int = 112; ++pub const EHOSTUNREACH: c_int = 113; ++pub const EALREADY: c_int = 114; ++pub const EINPROGRESS: c_int = 115; ++pub const ESTALE: c_int = 116; ++pub const EDQUOT: c_int = 122; ++pub const ENOMEDIUM: c_int = 123; ++pub const EMEDIUMTYPE: c_int = 124; ++pub const ECANCELED: c_int = 125; ++pub const ENOKEY: c_int = 126; ++pub const EKEYEXPIRED: c_int = 127; ++pub const EKEYREVOKED: c_int = 128; ++pub const EKEYREJECTED: c_int = 129; ++pub const EOWNERDEAD: c_int = 130; ++pub const ENOTRECOVERABLE: c_int = 131; ++pub const EHWPOISON: c_int = 133; ++pub const ERFKILL: c_int = 132; ++ ++pub const SOCK_STREAM: c_int = 1; ++pub const SOCK_DGRAM: c_int = 2; ++pub const SA_SIGINFO: c_int = 4; ++pub const SA_NOCLDWAIT: c_int = 2; ++pub const SIGTTIN: c_int = 21; ++pub const SIGTTOU: c_int = 22; ++pub const SIGXCPU: c_int = 24; ++pub const SIGXFSZ: c_int = 25; ++pub const SIGVTALRM: c_int = 26; ++pub const SIGPROF: c_int = 27; ++pub const SIGWINCH: c_int = 28; ++pub const SIGCHLD: c_int = 17; ++pub const SIGBUS: c_int = 7; ++pub const SIGUSR1: c_int = 10; ++pub const SIGUSR2: c_int = 12; ++pub const SIGCONT: c_int = 18; ++pub const SIGSTOP: c_int = 19; ++pub const SIGTSTP: c_int = 20; ++pub const SIGURG: c_int = 23; ++pub const SIGIO: c_int = 29; ++pub const SIGSYS: c_int = 31; ++pub const SIGSTKFLT: c_int = 16; ++pub const SIGPOLL: c_int = 29; ++pub const SIGPWR: c_int = 30; ++pub const SIG_SETMASK: c_int = 2; ++pub const SIG_BLOCK: c_int = 0; ++pub const SIG_UNBLOCK: c_int = 1; ++pub const POLLWRNORM: c_short = 256; ++pub const POLLWRBAND: c_short = 512; ++pub const O_ASYNC: c_int = 8192; ++pub const O_NDELAY: c_int = 2048; ++pub const EFD_NONBLOCK: c_int = 2048; ++pub const F_GETLK: c_int = 5; ++pub const F_GETOWN: c_int = 9; ++pub const F_SETOWN: c_int = 8; ++pub const SFD_NONBLOCK: c_int = 2048; ++pub const TCSANOW: c_int = 0; ++pub const TCSADRAIN: c_int = 1; ++pub const TCSAFLUSH: c_int = 2; ++ ++pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; ++pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; ++pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4; ++pub const O_DIRECT: c_int = 16384; ++pub const O_DIRECTORY: c_int = 65536; ++pub const O_NOFOLLOW: c_int = 131072; ++pub const MAP_HUGETLB: c_int = 262144; ++pub const MAP_LOCKED: c_int = 8192; ++pub const MAP_NORESERVE: c_int = 16384; ++pub const MAP_ANON: c_int = 32; ++pub const MAP_ANONYMOUS: c_int = 32; ++pub const MAP_DENYWRITE: c_int = 2048; ++pub const MAP_EXECUTABLE: c_int = 4096; ++pub const MAP_POPULATE: c_int = 32768; ++pub const MAP_NONBLOCK: c_int = 65536; ++pub const MAP_STACK: c_int = 131072; ++pub const MAP_SYNC: c_int = 0x080000; ++pub const EDEADLOCK: c_int = 35; ++pub const EUCLEAN: c_int = 117; ++pub const ENOTNAM: c_int = 118; ++pub const ENAVAIL: c_int = 119; ++pub const EISNAM: c_int = 120; ++pub const EREMOTEIO: c_int = 121; ++pub const MCL_CURRENT: c_int = 1; ++pub const MCL_FUTURE: c_int = 2; ++pub const MCL_ONFAULT: c_int = 4; ++pub const SIGSTKSZ: size_t = 8192; ++pub const MINSIGSTKSZ: size_t = 2048; ++pub const CBAUD: crate::tcflag_t = 4111; ++pub const TAB1: crate::tcflag_t = 2048; ++pub const TAB2: crate::tcflag_t = 4096; ++pub const TAB3: crate::tcflag_t = 6144; ++pub const CR1: crate::tcflag_t = 512; ++pub const CR2: crate::tcflag_t = 1024; ++pub const CR3: crate::tcflag_t = 1536; ++pub const FF1: crate::tcflag_t = 32768; ++pub const BS1: crate::tcflag_t = 8192; ++pub const VT1: crate::tcflag_t = 16384; ++pub const VWERASE: usize = 14; ++pub const VREPRINT: usize = 12; ++pub const VSUSP: usize = 10; ++pub const VSTART: usize = 8; ++pub const VSTOP: usize = 9; ++pub const VDISCARD: usize = 13; ++pub const VTIME: usize = 5; ++pub const IXON: crate::tcflag_t = 1024; ++pub const IXOFF: crate::tcflag_t = 4096; ++pub const ONLCR: crate::tcflag_t = 4; ++pub const CSIZE: crate::tcflag_t = 48; ++pub const CS6: crate::tcflag_t = 16; ++pub const CS7: crate::tcflag_t = 32; ++pub const CS8: crate::tcflag_t = 48; ++pub const CSTOPB: crate::tcflag_t = 64; ++pub const CREAD: crate::tcflag_t = 128; ++pub const PARENB: crate::tcflag_t = 256; ++pub const PARODD: crate::tcflag_t = 512; ++pub const HUPCL: crate::tcflag_t = 1024; ++pub const CLOCAL: crate::tcflag_t = 2048; ++pub const ECHOKE: crate::tcflag_t = 2048; ++pub const ECHOE: crate::tcflag_t = 16; ++pub const ECHOK: crate::tcflag_t = 32; ++pub const ECHONL: crate::tcflag_t = 64; ++pub const ECHOPRT: crate::tcflag_t = 1024; ++pub const ECHOCTL: crate::tcflag_t = 512; ++pub const ISIG: crate::tcflag_t = 1; ++pub const ICANON: crate::tcflag_t = 2; ++pub const PENDIN: crate::tcflag_t = 16384; ++pub const NOFLSH: crate::tcflag_t = 128; ++pub const CIBAUD: crate::tcflag_t = 269418496; ++pub const CBAUDEX: crate::tcflag_t = 4096; ++pub const VSWTC: usize = 7; ++pub const OLCUC: crate::tcflag_t = 2; ++pub const NLDLY: crate::tcflag_t = 256; ++pub const CRDLY: crate::tcflag_t = 1536; ++pub const TABDLY: crate::tcflag_t = 6144; ++pub const BSDLY: crate::tcflag_t = 8192; ++pub const FFDLY: crate::tcflag_t = 32768; ++pub const VTDLY: crate::tcflag_t = 16384; ++pub const XTABS: crate::tcflag_t = 6144; ++pub const B0: crate::speed_t = 0; ++pub const B50: crate::speed_t = 1; ++pub const B75: crate::speed_t = 2; ++pub const B110: crate::speed_t = 3; ++pub const B134: crate::speed_t = 4; ++pub const B150: crate::speed_t = 5; ++pub const B200: crate::speed_t = 6; ++pub const B300: crate::speed_t = 7; ++pub const B600: crate::speed_t = 8; ++pub const B1200: crate::speed_t = 9; ++pub const B1800: crate::speed_t = 10; ++pub const B2400: crate::speed_t = 11; ++pub const B4800: crate::speed_t = 12; ++pub const B9600: crate::speed_t = 13; ++pub const B19200: crate::speed_t = 14; ++pub const B38400: crate::speed_t = 15; ++pub const EXTA: crate::speed_t = 14; ++pub const EXTB: crate::speed_t = 15; ++pub const B57600: crate::speed_t = 4097; ++pub const B115200: crate::speed_t = 4098; ++pub const B230400: crate::speed_t = 4099; ++pub const B460800: crate::speed_t = 4100; ++pub const B500000: crate::speed_t = 4101; ++pub const B576000: crate::speed_t = 4102; ++pub const B921600: crate::speed_t = 4103; ++pub const B1000000: crate::speed_t = 4104; ++pub const B1152000: crate::speed_t = 4105; ++pub const B1500000: crate::speed_t = 4106; ++pub const B2000000: crate::speed_t = 4107; ++pub const B2500000: crate::speed_t = 4108; ++pub const B3000000: crate::speed_t = 4109; ++pub const B3500000: crate::speed_t = 4110; ++pub const B4000000: crate::speed_t = 4111; ++pub const VEOL: usize = 11; ++pub const VEOL2: usize = 16; ++pub const VMIN: usize = 6; ++pub const IEXTEN: crate::tcflag_t = 32768; ++pub const TOSTOP: crate::tcflag_t = 256; ++pub const FLUSHO: crate::tcflag_t = 4096; ++pub const EXTPROC: crate::tcflag_t = 65536; ++pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; ++pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; ++pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32; ++pub const NGREG: usize = 32; ++pub const REG_PC: usize = 0; ++pub const REG_RA: usize = 1; ++pub const REG_SP: usize = 2; ++pub const REG_TP: usize = 4; ++pub const REG_S0: usize = 8; ++pub const REG_S1: usize = 9; ++pub const REG_A0: usize = 10; ++pub const REG_S2: usize = 18; ++pub const REG_NARGS: usize = 8; ++ ++pub const SYS_read: c_long = 63; ++pub const SYS_write: c_long = 64; ++pub const SYS_close: c_long = 57; ++pub const SYS_fstat: c_long = 80; ++pub const SYS_lseek: c_long = 62; ++pub const SYS_mmap: c_long = 222; ++pub const SYS_mprotect: c_long = 226; ++pub const SYS_munmap: c_long = 215; ++pub const SYS_brk: c_long = 214; ++pub const SYS_rt_sigaction: c_long = 134; ++pub const SYS_rt_sigprocmask: c_long = 135; ++pub const SYS_rt_sigreturn: c_long = 139; ++pub const SYS_ioctl: c_long = 29; ++pub const SYS_pread64: c_long = 67; ++pub const SYS_pwrite64: c_long = 68; ++pub const SYS_readv: c_long = 65; ++pub const SYS_writev: c_long = 66; ++pub const SYS_sched_yield: c_long = 124; ++pub const SYS_mremap: c_long = 216; ++pub const SYS_msync: c_long = 227; ++pub const SYS_mincore: c_long = 232; ++pub const SYS_madvise: c_long = 233; ++pub const SYS_shmget: c_long = 194; ++pub const SYS_shmat: c_long = 196; ++pub const SYS_shmctl: c_long = 195; ++pub const SYS_dup: c_long = 23; ++pub const SYS_nanosleep: c_long = 101; ++pub const SYS_getitimer: c_long = 102; ++pub const SYS_setitimer: c_long = 103; ++pub const SYS_getpid: c_long = 172; ++pub const SYS_sendfile: c_long = 71; ++pub const SYS_socket: c_long = 198; ++pub const SYS_connect: c_long = 203; ++pub const SYS_accept: c_long = 202; ++pub const SYS_sendto: c_long = 206; ++pub const SYS_recvfrom: c_long = 207; ++pub const SYS_sendmsg: c_long = 211; ++pub const SYS_recvmsg: c_long = 212; ++pub const SYS_shutdown: c_long = 210; ++pub const SYS_bind: c_long = 200; ++pub const SYS_listen: c_long = 201; ++pub const SYS_getsockname: c_long = 204; ++pub const SYS_getpeername: c_long = 205; ++pub const SYS_socketpair: c_long = 199; ++pub const SYS_setsockopt: c_long = 208; ++pub const SYS_getsockopt: c_long = 209; ++pub const SYS_clone: c_long = 220; ++pub const SYS_execve: c_long = 221; ++pub const SYS_exit: c_long = 93; ++pub const SYS_wait4: c_long = 260; ++pub const SYS_kill: c_long = 129; ++pub const SYS_uname: c_long = 160; ++pub const SYS_semget: c_long = 190; ++pub const SYS_semop: c_long = 193; ++pub const SYS_semctl: c_long = 191; ++pub const SYS_shmdt: c_long = 197; ++pub const SYS_msgget: c_long = 186; ++pub const SYS_msgsnd: c_long = 189; ++pub const SYS_msgrcv: c_long = 188; ++pub const SYS_msgctl: c_long = 187; ++pub const SYS_fcntl: c_long = 25; ++pub const SYS_flock: c_long = 32; ++pub const SYS_fsync: c_long = 82; ++pub const SYS_fdatasync: c_long = 83; ++pub const SYS_truncate: c_long = 45; ++pub const SYS_ftruncate: c_long = 46; ++pub const SYS_getcwd: c_long = 17; ++pub const SYS_chdir: c_long = 49; ++pub const SYS_fchdir: c_long = 50; ++pub const SYS_fchmod: c_long = 52; ++pub const SYS_fchown: c_long = 55; ++pub const SYS_umask: c_long = 166; ++pub const SYS_gettimeofday: c_long = 169; ++pub const SYS_getrlimit: c_long = 163; ++pub const SYS_getrusage: c_long = 165; ++pub const SYS_sysinfo: c_long = 179; ++pub const SYS_times: c_long = 153; ++pub const SYS_ptrace: c_long = 117; ++pub const SYS_getuid: c_long = 174; ++pub const SYS_syslog: c_long = 116; ++pub const SYS_getgid: c_long = 176; ++pub const SYS_setuid: c_long = 146; ++pub const SYS_setgid: c_long = 144; ++pub const SYS_geteuid: c_long = 175; ++pub const SYS_getegid: c_long = 177; ++pub const SYS_setpgid: c_long = 154; ++pub const SYS_getppid: c_long = 173; ++pub const SYS_setsid: c_long = 157; ++pub const SYS_setreuid: c_long = 145; ++pub const SYS_setregid: c_long = 143; ++pub const SYS_getgroups: c_long = 158; ++pub const SYS_setgroups: c_long = 159; ++pub const SYS_setresuid: c_long = 147; ++pub const SYS_getresuid: c_long = 148; ++pub const SYS_setresgid: c_long = 149; ++pub const SYS_getresgid: c_long = 150; ++pub const SYS_getpgid: c_long = 155; ++pub const SYS_setfsuid: c_long = 151; ++pub const SYS_setfsgid: c_long = 152; ++pub const SYS_getsid: c_long = 156; ++pub const SYS_capget: c_long = 90; ++pub const SYS_capset: c_long = 91; ++pub const SYS_rt_sigpending: c_long = 136; ++pub const SYS_rt_sigtimedwait: c_long = 137; ++pub const SYS_rt_sigqueueinfo: c_long = 138; ++pub const SYS_rt_sigsuspend: c_long = 133; ++pub const SYS_sigaltstack: c_long = 132; ++pub const SYS_personality: c_long = 92; ++pub const SYS_statfs: c_long = 43; ++pub const SYS_fstatfs: c_long = 44; ++pub const SYS_getpriority: c_long = 141; ++pub const SYS_setpriority: c_long = 140; ++pub const SYS_sched_setparam: c_long = 118; ++pub const SYS_sched_getparam: c_long = 121; ++pub const SYS_sched_setscheduler: c_long = 119; ++pub const SYS_sched_getscheduler: c_long = 120; ++pub const SYS_sched_get_priority_max: c_long = 125; ++pub const SYS_sched_get_priority_min: c_long = 126; ++pub const SYS_sched_rr_get_interval: c_long = 127; ++pub const SYS_mlock: c_long = 228; ++pub const SYS_munlock: c_long = 229; ++pub const SYS_mlockall: c_long = 230; ++pub const SYS_munlockall: c_long = 231; ++pub const SYS_vhangup: c_long = 58; ++pub const SYS_pivot_root: c_long = 41; ++pub const SYS_prctl: c_long = 167; ++pub const SYS_adjtimex: c_long = 171; ++pub const SYS_setrlimit: c_long = 164; ++pub const SYS_chroot: c_long = 51; ++pub const SYS_sync: c_long = 81; ++pub const SYS_acct: c_long = 89; ++pub const SYS_settimeofday: c_long = 170; ++pub const SYS_mount: c_long = 40; ++pub const SYS_umount2: c_long = 39; ++pub const SYS_swapon: c_long = 224; ++pub const SYS_swapoff: c_long = 225; ++pub const SYS_reboot: c_long = 142; ++pub const SYS_sethostname: c_long = 161; ++pub const SYS_setdomainname: c_long = 162; ++pub const SYS_init_module: c_long = 105; ++pub const SYS_delete_module: c_long = 106; ++pub const SYS_quotactl: c_long = 60; ++pub const SYS_nfsservctl: c_long = 42; ++pub const SYS_gettid: c_long = 178; ++pub const SYS_readahead: c_long = 213; ++pub const SYS_setxattr: c_long = 5; ++pub const SYS_lsetxattr: c_long = 6; ++pub const SYS_fsetxattr: c_long = 7; ++pub const SYS_getxattr: c_long = 8; ++pub const SYS_lgetxattr: c_long = 9; ++pub const SYS_fgetxattr: c_long = 10; ++pub const SYS_listxattr: c_long = 11; ++pub const SYS_llistxattr: c_long = 12; ++pub const SYS_flistxattr: c_long = 13; ++pub const SYS_removexattr: c_long = 14; ++pub const SYS_lremovexattr: c_long = 15; ++pub const SYS_fremovexattr: c_long = 16; ++pub const SYS_tkill: c_long = 130; ++pub const SYS_futex: c_long = 98; ++pub const SYS_sched_setaffinity: c_long = 122; ++pub const SYS_sched_getaffinity: c_long = 123; ++pub const SYS_io_setup: c_long = 0; ++pub const SYS_io_destroy: c_long = 1; ++pub const SYS_io_getevents: c_long = 4; ++pub const SYS_io_submit: c_long = 2; ++pub const SYS_io_cancel: c_long = 3; ++pub const SYS_lookup_dcookie: c_long = 18; ++pub const SYS_remap_file_pages: c_long = 234; ++pub const SYS_getdents64: c_long = 61; ++pub const SYS_set_tid_address: c_long = 96; ++pub const SYS_restart_syscall: c_long = 128; ++pub const SYS_semtimedop: c_long = 192; ++pub const SYS_fadvise64: c_long = 223; ++pub const SYS_timer_create: c_long = 107; ++pub const SYS_timer_settime: c_long = 110; ++pub const SYS_timer_gettime: c_long = 108; ++pub const SYS_timer_getoverrun: c_long = 109; ++pub const SYS_timer_delete: c_long = 111; ++pub const SYS_clock_settime: c_long = 112; ++pub const SYS_clock_gettime: c_long = 113; ++pub const SYS_clock_getres: c_long = 114; ++pub const SYS_clock_nanosleep: c_long = 115; ++pub const SYS_exit_group: c_long = 94; ++pub const SYS_epoll_ctl: c_long = 21; ++pub const SYS_tgkill: c_long = 131; ++pub const SYS_mbind: c_long = 235; ++pub const SYS_set_mempolicy: c_long = 237; ++pub const SYS_get_mempolicy: c_long = 236; ++pub const SYS_mq_open: c_long = 180; ++pub const SYS_mq_unlink: c_long = 181; ++pub const SYS_mq_timedsend: c_long = 182; ++pub const SYS_mq_timedreceive: c_long = 183; ++pub const SYS_mq_notify: c_long = 184; ++pub const SYS_mq_getsetattr: c_long = 185; ++pub const SYS_kexec_load: c_long = 104; ++pub const SYS_waitid: c_long = 95; ++pub const SYS_add_key: c_long = 217; ++pub const SYS_request_key: c_long = 218; ++pub const SYS_keyctl: c_long = 219; ++pub const SYS_ioprio_set: c_long = 30; ++pub const SYS_ioprio_get: c_long = 31; ++pub const SYS_inotify_add_watch: c_long = 27; ++pub const SYS_inotify_rm_watch: c_long = 28; ++pub const SYS_migrate_pages: c_long = 238; ++pub const SYS_openat: c_long = 56; ++pub const SYS_mkdirat: c_long = 34; ++pub const SYS_mknodat: c_long = 33; ++pub const SYS_fchownat: c_long = 54; ++pub const SYS_newfstatat: c_long = 79; ++pub const SYS_unlinkat: c_long = 35; ++pub const SYS_linkat: c_long = 37; ++pub const SYS_symlinkat: c_long = 36; ++pub const SYS_readlinkat: c_long = 78; ++pub const SYS_fchmodat: c_long = 53; ++pub const SYS_faccessat: c_long = 48; ++pub const SYS_pselect6: c_long = 72; ++pub const SYS_ppoll: c_long = 73; ++pub const SYS_unshare: c_long = 97; ++pub const SYS_set_robust_list: c_long = 99; ++pub const SYS_get_robust_list: c_long = 100; ++pub const SYS_splice: c_long = 76; ++pub const SYS_tee: c_long = 77; ++pub const SYS_sync_file_range: c_long = 84; ++pub const SYS_vmsplice: c_long = 75; ++pub const SYS_move_pages: c_long = 239; ++pub const SYS_utimensat: c_long = 88; ++pub const SYS_epoll_pwait: c_long = 22; ++pub const SYS_timerfd_create: c_long = 85; ++pub const SYS_fallocate: c_long = 47; ++pub const SYS_timerfd_settime: c_long = 86; ++pub const SYS_timerfd_gettime: c_long = 87; ++pub const SYS_accept4: c_long = 242; ++pub const SYS_signalfd4: c_long = 74; ++pub const SYS_eventfd2: c_long = 19; ++pub const SYS_epoll_create1: c_long = 20; ++pub const SYS_dup3: c_long = 24; ++pub const SYS_pipe2: c_long = 59; ++pub const SYS_inotify_init1: c_long = 26; ++pub const SYS_preadv: c_long = 69; ++pub const SYS_pwritev: c_long = 70; ++pub const SYS_rt_tgsigqueueinfo: c_long = 240; ++pub const SYS_perf_event_open: c_long = 241; ++pub const SYS_recvmmsg: c_long = 243; ++pub const SYS_fanotify_init: c_long = 262; ++pub const SYS_fanotify_mark: c_long = 263; ++pub const SYS_prlimit64: c_long = 261; ++pub const SYS_name_to_handle_at: c_long = 264; ++pub const SYS_open_by_handle_at: c_long = 265; ++pub const SYS_clock_adjtime: c_long = 266; ++pub const SYS_syncfs: c_long = 267; ++pub const SYS_sendmmsg: c_long = 269; ++pub const SYS_setns: c_long = 268; ++pub const SYS_getcpu: c_long = 168; ++pub const SYS_process_vm_readv: c_long = 270; ++pub const SYS_process_vm_writev: c_long = 271; ++pub const SYS_kcmp: c_long = 272; ++pub const SYS_finit_module: c_long = 273; ++pub const SYS_sched_setattr: c_long = 274; ++pub const SYS_sched_getattr: c_long = 275; ++pub const SYS_renameat2: c_long = 276; ++pub const SYS_seccomp: c_long = 277; ++pub const SYS_getrandom: c_long = 278; ++pub const SYS_memfd_create: c_long = 279; ++pub const SYS_bpf: c_long = 280; ++pub const SYS_execveat: c_long = 281; ++pub const SYS_userfaultfd: c_long = 282; ++pub const SYS_membarrier: c_long = 283; ++pub const SYS_mlock2: c_long = 284; ++pub const SYS_copy_file_range: c_long = 285; ++pub const SYS_preadv2: c_long = 286; ++pub const SYS_pwritev2: c_long = 287; ++pub const SYS_pkey_mprotect: c_long = 288; ++pub const SYS_pkey_alloc: c_long = 289; ++pub const SYS_pkey_free: c_long = 290; ++pub const SYS_statx: c_long = 291; ++pub const SYS_rseq: c_long = 293; ++pub const SYS_pidfd_send_signal: c_long = 424; ++pub const SYS_io_uring_setup: c_long = 425; ++pub const SYS_io_uring_enter: c_long = 426; ++pub const SYS_io_uring_register: c_long = 427; ++pub const SYS_open_tree: c_long = 428; ++pub const SYS_move_mount: c_long = 429; ++pub const SYS_fsopen: c_long = 430; ++pub const SYS_fsconfig: c_long = 431; ++pub const SYS_fsmount: c_long = 432; ++pub const SYS_fspick: c_long = 433; ++pub const SYS_pidfd_open: c_long = 434; ++pub const SYS_clone3: c_long = 435; ++pub const SYS_close_range: c_long = 436; ++pub const SYS_openat2: c_long = 437; ++pub const SYS_pidfd_getfd: c_long = 438; ++pub const SYS_faccessat2: c_long = 439; ++pub const SYS_process_madvise: c_long = 440; ++pub const SYS_epoll_pwait2: c_long = 441; ++pub const SYS_mount_setattr: c_long = 442; ++pub const SYS_quotactl_fd: c_long = 443; ++pub const SYS_landlock_create_ruleset: c_long = 444; ++pub const SYS_landlock_add_rule: c_long = 445; ++pub const SYS_landlock_restrict_self: c_long = 446; ++pub const SYS_memfd_secret: c_long = 447; ++pub const SYS_process_mrelease: c_long = 448; ++pub const SYS_futex_waitv: c_long = 449; ++pub const SYS_set_mempolicy_home_node: c_long = 450; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/sparc/mod.rs 2024-12-28 15:35:00.000000000 -0500 +@@ -0,0 +1,776 @@ ++//! SPARC-specific definitions for 32-bit linux-like values ++ ++use crate::prelude::*; ++use crate::{off64_t, off_t}; ++ ++pub type c_char = i8; ++pub type wchar_t = i32; ++ ++s! { ++ pub struct sigaction { ++ pub sa_sigaction: crate::sighandler_t, ++ pub sa_mask: crate::sigset_t, ++ pub sa_flags: c_int, ++ pub sa_restorer: Option, ++ } ++ ++ pub struct statfs { ++ pub f_type: crate::__fsword_t, ++ pub f_bsize: crate::__fsword_t, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_fsid: crate::fsid_t, ++ ++ pub f_namelen: crate::__fsword_t, ++ pub f_frsize: crate::__fsword_t, ++ f_spare: [crate::__fsword_t; 5], ++ } ++ ++ pub struct siginfo_t { ++ pub si_signo: c_int, ++ pub si_errno: c_int, ++ pub si_code: c_int, ++ _pad: [c_int; 29], ++ _align: [usize; 0], ++ } ++ ++ pub struct flock { ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ pub l_start: off_t, ++ pub l_len: off_t, ++ pub l_pid: crate::pid_t, ++ } ++ ++ pub struct flock64 { ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ pub l_start: off64_t, ++ pub l_len: off64_t, ++ pub l_pid: crate::pid_t, ++ __reserved: c_short, ++ } ++ ++ pub struct stack_t { ++ pub ss_sp: *mut c_void, ++ pub ss_flags: c_int, ++ pub ss_size: size_t, ++ } ++ ++ ++ ++ pub struct ipc_perm { ++ pub __key: crate::key_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub cuid: crate::uid_t, ++ pub cgid: crate::gid_t, ++ __pad1: c_ushort, ++ pub mode: c_ushort, ++ __pad2: c_ushort, ++ pub __seq: c_ushort, ++ __unused1: c_ulonglong, ++ __unused2: c_ulonglong, ++ } ++ ++ pub struct shmid_ds { ++ pub shm_perm: crate::ipc_perm, ++ __pad1: c_uint, ++ pub shm_atime: crate::time_t, ++ __pad2: c_uint, ++ pub shm_dtime: crate::time_t, ++ __pad3: c_uint, ++ pub shm_ctime: crate::time_t, ++ pub shm_segsz: size_t, ++ pub shm_cpid: crate::pid_t, ++ pub shm_lpid: crate::pid_t, ++ pub shm_nattch: crate::shmatt_t, ++ __reserved1: c_ulong, ++ __reserved2: c_ulong, ++ } ++ ++ pub struct msqid_ds { ++ pub msg_perm: crate::ipc_perm, ++ __pad1: c_uint, ++ pub msg_stime: crate::time_t, ++ __pad2: c_uint, ++ pub msg_rtime: crate::time_t, ++ __pad3: c_uint, ++ pub msg_ctime: crate::time_t, ++ __msg_cbytes: c_ushort, ++ pub msg_qnum: crate::msgqnum_t, ++ pub msg_qbytes: crate::msglen_t, ++ pub msg_lspid: crate::pid_t, ++ pub msg_lrpid: crate::pid_t, ++ __glibc_reserved1: c_ulong, ++ __glibc_reserved2: c_ulong, ++ } ++} ++ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ #[repr(align(8))] ++ pub struct max_align_t { ++ priv_: [i64; 3], ++ } ++} ++ ++pub const VEOF: usize = 4; ++pub const RTLD_DEEPBIND: c_int = 0x8; ++pub const RTLD_GLOBAL: c_int = 0x100; ++pub const RTLD_NOLOAD: c_int = 0x4; ++ ++pub const O_APPEND: c_int = 0x8; ++pub const O_CREAT: c_int = 0x200; ++pub const O_EXCL: c_int = 0x800; ++pub const O_NOCTTY: c_int = 0x8000; ++pub const O_NONBLOCK: c_int = 0x4000; ++pub const O_SYNC: c_int = 0x802000; ++pub const O_RSYNC: c_int = 0x802000; ++pub const O_DSYNC: c_int = 0x2000; ++pub const O_FSYNC: c_int = 0x802000; ++ ++pub const MADV_SOFT_OFFLINE: c_int = 101; ++pub const MAP_GROWSDOWN: c_int = 0x0200; ++pub const MAP_ANON: c_int = 0x0020; ++pub const MAP_ANONYMOUS: c_int = 0x0020; ++pub const MAP_DENYWRITE: c_int = 0x0800; ++pub const MAP_EXECUTABLE: c_int = 0x01000; ++pub const MAP_POPULATE: c_int = 0x08000; ++pub const MAP_NONBLOCK: c_int = 0x010000; ++pub const MAP_STACK: c_int = 0x020000; ++pub const MAP_HUGETLB: c_int = 0x040000; ++pub const MAP_SYNC: c_int = 0x080000; ++ ++pub const EDEADLK: c_int = 78; ++pub const ENAMETOOLONG: c_int = 63; ++pub const ENOLCK: c_int = 79; ++pub const ENOSYS: c_int = 90; ++pub const ENOTEMPTY: c_int = 66; ++pub const ELOOP: c_int = 62; ++pub const ENOMSG: c_int = 75; ++pub const EIDRM: c_int = 77; ++pub const ECHRNG: c_int = 94; ++pub const EL2NSYNC: c_int = 95; ++pub const EL3HLT: c_int = 96; ++pub const EL3RST: c_int = 97; ++pub const ELNRNG: c_int = 98; ++pub const EUNATCH: c_int = 99; ++pub const ENOCSI: c_int = 100; ++pub const EL2HLT: c_int = 101; ++pub const EBADE: c_int = 102; ++pub const EBADR: c_int = 103; ++pub const EXFULL: c_int = 104; ++pub const ENOANO: c_int = 105; ++pub const EBADRQC: c_int = 106; ++pub const EBADSLT: c_int = 107; ++pub const EMULTIHOP: c_int = 87; ++pub const EOVERFLOW: c_int = 92; ++pub const ENOTUNIQ: c_int = 115; ++pub const EBADFD: c_int = 93; ++pub const EBADMSG: c_int = 76; ++pub const EREMCHG: c_int = 89; ++pub const ELIBACC: c_int = 114; ++pub const ELIBBAD: c_int = 112; ++pub const ELIBSCN: c_int = 124; ++pub const ELIBMAX: c_int = 123; ++pub const ELIBEXEC: c_int = 110; ++pub const EILSEQ: c_int = 122; ++pub const ERESTART: c_int = 116; ++pub const ESTRPIPE: c_int = 91; ++pub const EUSERS: c_int = 68; ++pub const ENOTSOCK: c_int = 38; ++pub const EDESTADDRREQ: c_int = 39; ++pub const EMSGSIZE: c_int = 40; ++pub const EPROTOTYPE: c_int = 41; ++pub const ENOPROTOOPT: c_int = 42; ++pub const EPROTONOSUPPORT: c_int = 43; ++pub const ESOCKTNOSUPPORT: c_int = 44; ++pub const EOPNOTSUPP: c_int = 45; ++pub const EPFNOSUPPORT: c_int = 46; ++pub const EAFNOSUPPORT: c_int = 47; ++pub const EADDRINUSE: c_int = 48; ++pub const EADDRNOTAVAIL: c_int = 49; ++pub const ENETDOWN: c_int = 50; ++pub const ENETUNREACH: c_int = 51; ++pub const ENETRESET: c_int = 52; ++pub const ECONNABORTED: c_int = 53; ++pub const ECONNRESET: c_int = 54; ++pub const ENOBUFS: c_int = 55; ++pub const EISCONN: c_int = 56; ++pub const ENOTCONN: c_int = 57; ++pub const ESHUTDOWN: c_int = 58; ++pub const ETOOMANYREFS: c_int = 59; ++pub const ETIMEDOUT: c_int = 60; ++pub const ECONNREFUSED: c_int = 61; ++pub const EHOSTDOWN: c_int = 64; ++pub const EHOSTUNREACH: c_int = 65; ++pub const EALREADY: c_int = 37; ++pub const EINPROGRESS: c_int = 36; ++pub const ESTALE: c_int = 70; ++pub const EDQUOT: c_int = 69; ++pub const ENOMEDIUM: c_int = 125; ++pub const EMEDIUMTYPE: c_int = 126; ++pub const ECANCELED: c_int = 127; ++pub const ENOKEY: c_int = 128; ++pub const EKEYEXPIRED: c_int = 129; ++pub const EKEYREVOKED: c_int = 130; ++pub const EKEYREJECTED: c_int = 131; ++pub const EOWNERDEAD: c_int = 132; ++pub const ENOTRECOVERABLE: c_int = 133; ++pub const EHWPOISON: c_int = 135; ++pub const ERFKILL: c_int = 134; ++ ++pub const SOCK_STREAM: c_int = 1; ++pub const SOCK_DGRAM: c_int = 2; ++ ++pub const SA_SIGINFO: c_int = 0x200; ++pub const SA_NOCLDWAIT: c_int = 0x100; ++ ++pub const SIGTTIN: c_int = 21; ++pub const SIGTTOU: c_int = 22; ++pub const SIGXCPU: c_int = 24; ++pub const SIGXFSZ: c_int = 25; ++pub const SIGVTALRM: c_int = 26; ++pub const SIGPROF: c_int = 27; ++pub const SIGWINCH: c_int = 28; ++pub const SIGCHLD: c_int = 20; ++pub const SIGBUS: c_int = 10; ++pub const SIGUSR1: c_int = 30; ++pub const SIGUSR2: c_int = 31; ++pub const SIGCONT: c_int = 19; ++pub const SIGSTOP: c_int = 17; ++pub const SIGTSTP: c_int = 18; ++pub const SIGURG: c_int = 16; ++pub const SIGIO: c_int = 23; ++pub const SIGSYS: c_int = 12; ++pub const SIGPOLL: c_int = 23; ++pub const SIGPWR: c_int = 29; ++pub const SIG_SETMASK: c_int = 4; ++pub const SIG_BLOCK: c_int = 1; ++pub const SIG_UNBLOCK: c_int = 2; ++ ++pub const POLLWRNORM: c_short = 4; ++pub const POLLWRBAND: c_short = 0x100; ++ ++pub const O_ASYNC: c_int = 0x40; ++pub const O_NDELAY: c_int = 0x4004; ++ ++pub const EFD_NONBLOCK: c_int = 0x4000; ++ ++pub const F_GETLK: c_int = 7; ++pub const F_GETOWN: c_int = 5; ++pub const F_SETOWN: c_int = 6; ++ ++pub const SFD_NONBLOCK: c_int = 0x4000; ++ ++pub const TCSANOW: c_int = 0; ++pub const TCSADRAIN: c_int = 1; ++pub const TCSAFLUSH: c_int = 2; ++ ++pub const O_DIRECTORY: c_int = 0o200000; ++pub const O_NOFOLLOW: c_int = 0o400000; ++pub const O_LARGEFILE: c_int = 0x40000; ++pub const O_DIRECT: c_int = 0x100000; ++ ++pub const MAP_LOCKED: c_int = 0x0100; ++pub const MAP_NORESERVE: c_int = 0x00040; ++ ++pub const EDEADLOCK: c_int = 108; ++pub const EUCLEAN: c_int = 117; ++pub const ENOTNAM: c_int = 118; ++pub const ENAVAIL: c_int = 119; ++pub const EISNAM: c_int = 120; ++pub const EREMOTEIO: c_int = 121; ++ ++pub const MCL_CURRENT: c_int = 0x2000; ++pub const MCL_FUTURE: c_int = 0x4000; ++pub const MCL_ONFAULT: c_int = 0x8000; ++ ++pub const SIGSTKSZ: size_t = 16384; ++pub const MINSIGSTKSZ: size_t = 4096; ++pub const CBAUD: crate::tcflag_t = 0x0000100f; ++pub const TAB1: crate::tcflag_t = 0x800; ++pub const TAB2: crate::tcflag_t = 0x1000; ++pub const TAB3: crate::tcflag_t = 0x1800; ++pub const CR1: crate::tcflag_t = 0x200; ++pub const CR2: crate::tcflag_t = 0x400; ++pub const CR3: crate::tcflag_t = 0x600; ++pub const FF1: crate::tcflag_t = 0x8000; ++pub const BS1: crate::tcflag_t = 0x2000; ++pub const VT1: crate::tcflag_t = 0x4000; ++pub const VWERASE: usize = 0xe; ++pub const VREPRINT: usize = 0xc; ++pub const VSUSP: usize = 0xa; ++pub const VSTART: usize = 0x8; ++pub const VSTOP: usize = 0x9; ++pub const VDISCARD: usize = 0xd; ++pub const VTIME: usize = 0x5; ++pub const IXON: crate::tcflag_t = 0x400; ++pub const IXOFF: crate::tcflag_t = 0x1000; ++pub const ONLCR: crate::tcflag_t = 0x4; ++pub const CSIZE: crate::tcflag_t = 0x30; ++pub const CS6: crate::tcflag_t = 0x10; ++pub const CS7: crate::tcflag_t = 0x20; ++pub const CS8: crate::tcflag_t = 0x30; ++pub const CSTOPB: crate::tcflag_t = 0x40; ++pub const CREAD: crate::tcflag_t = 0x80; ++pub const PARENB: crate::tcflag_t = 0x100; ++pub const PARODD: crate::tcflag_t = 0x200; ++pub const HUPCL: crate::tcflag_t = 0x400; ++pub const CLOCAL: crate::tcflag_t = 0x800; ++pub const ECHOKE: crate::tcflag_t = 0x800; ++pub const ECHOE: crate::tcflag_t = 0x10; ++pub const ECHOK: crate::tcflag_t = 0x20; ++pub const ECHONL: crate::tcflag_t = 0x40; ++pub const ECHOPRT: crate::tcflag_t = 0x400; ++pub const ECHOCTL: crate::tcflag_t = 0x200; ++pub const ISIG: crate::tcflag_t = 0x1; ++pub const ICANON: crate::tcflag_t = 0x2; ++pub const PENDIN: crate::tcflag_t = 0x4000; ++pub const NOFLSH: crate::tcflag_t = 0x80; ++pub const CIBAUD: crate::tcflag_t = 0o02003600000; ++pub const CBAUDEX: crate::tcflag_t = 0x00001000; ++pub const VSWTC: usize = 7; ++pub const OLCUC: crate::tcflag_t = 0o000002; ++pub const NLDLY: crate::tcflag_t = 0o000400; ++pub const CRDLY: crate::tcflag_t = 0o003000; ++pub const TABDLY: crate::tcflag_t = 0o014000; ++pub const BSDLY: crate::tcflag_t = 0o020000; ++pub const FFDLY: crate::tcflag_t = 0o100000; ++pub const VTDLY: crate::tcflag_t = 0o040000; ++pub const XTABS: crate::tcflag_t = 0o014000; ++ ++pub const B0: crate::speed_t = 0o000000; ++pub const B50: crate::speed_t = 0o000001; ++pub const B75: crate::speed_t = 0o000002; ++pub const B110: crate::speed_t = 0o000003; ++pub const B134: crate::speed_t = 0o000004; ++pub const B150: crate::speed_t = 0o000005; ++pub const B200: crate::speed_t = 0o000006; ++pub const B300: crate::speed_t = 0o000007; ++pub const B600: crate::speed_t = 0o000010; ++pub const B1200: crate::speed_t = 0o000011; ++pub const B1800: crate::speed_t = 0o000012; ++pub const B2400: crate::speed_t = 0o000013; ++pub const B4800: crate::speed_t = 0o000014; ++pub const B9600: crate::speed_t = 0o000015; ++pub const B19200: crate::speed_t = 0o000016; ++pub const B38400: crate::speed_t = 0o000017; ++pub const EXTA: crate::speed_t = B19200; ++pub const EXTB: crate::speed_t = B38400; ++pub const B57600: crate::speed_t = 0x1001; ++pub const B115200: crate::speed_t = 0x1002; ++pub const B230400: crate::speed_t = 0x1003; ++pub const B460800: crate::speed_t = 0x1004; ++pub const B76800: crate::speed_t = 0x1005; ++pub const B153600: crate::speed_t = 0x1006; ++pub const B307200: crate::speed_t = 0x1007; ++pub const B614400: crate::speed_t = 0x1008; ++pub const B921600: crate::speed_t = 0x1009; ++pub const B500000: crate::speed_t = 0x100a; ++pub const B576000: crate::speed_t = 0x100b; ++pub const B1000000: crate::speed_t = 0x100c; ++pub const B1152000: crate::speed_t = 0x100d; ++pub const B1500000: crate::speed_t = 0x100e; ++pub const B2000000: crate::speed_t = 0x100f; ++ ++pub const VEOL: usize = 5; ++pub const VEOL2: usize = 6; ++pub const VMIN: usize = 4; ++pub const IEXTEN: crate::tcflag_t = 0x8000; ++pub const TOSTOP: crate::tcflag_t = 0x100; ++pub const FLUSHO: crate::tcflag_t = 0x1000; ++pub const EXTPROC: crate::tcflag_t = 0x10000; ++ ++pub const SYS_restart_syscall: c_long = 0; ++pub const SYS_exit: c_long = 1; ++pub const SYS_fork: c_long = 2; ++pub const SYS_read: c_long = 3; ++pub const SYS_write: c_long = 4; ++pub const SYS_open: c_long = 5; ++pub const SYS_close: c_long = 6; ++pub const SYS_wait4: c_long = 7; ++pub const SYS_creat: c_long = 8; ++pub const SYS_link: c_long = 9; ++pub const SYS_unlink: c_long = 10; ++pub const SYS_execv: c_long = 11; ++pub const SYS_chdir: c_long = 12; ++pub const SYS_chown: c_long = 13; ++pub const SYS_mknod: c_long = 14; ++pub const SYS_chmod: c_long = 15; ++pub const SYS_lchown: c_long = 16; ++pub const SYS_brk: c_long = 17; ++pub const SYS_perfctr: c_long = 18; ++pub const SYS_lseek: c_long = 19; ++pub const SYS_getpid: c_long = 20; ++pub const SYS_capget: c_long = 21; ++pub const SYS_capset: c_long = 22; ++pub const SYS_setuid: c_long = 23; ++pub const SYS_getuid: c_long = 24; ++pub const SYS_vmsplice: c_long = 25; ++pub const SYS_ptrace: c_long = 26; ++pub const SYS_alarm: c_long = 27; ++pub const SYS_sigaltstack: c_long = 28; ++pub const SYS_pause: c_long = 29; ++pub const SYS_utime: c_long = 30; ++pub const SYS_lchown32: c_long = 31; ++pub const SYS_fchown32: c_long = 32; ++pub const SYS_access: c_long = 33; ++pub const SYS_nice: c_long = 34; ++pub const SYS_chown32: c_long = 35; ++pub const SYS_sync: c_long = 36; ++pub const SYS_kill: c_long = 37; ++pub const SYS_stat: c_long = 38; ++pub const SYS_sendfile: c_long = 39; ++pub const SYS_lstat: c_long = 40; ++pub const SYS_dup: c_long = 41; ++pub const SYS_pipe: c_long = 42; ++pub const SYS_times: c_long = 43; ++pub const SYS_getuid32: c_long = 44; ++pub const SYS_umount2: c_long = 45; ++pub const SYS_setgid: c_long = 46; ++pub const SYS_getgid: c_long = 47; ++pub const SYS_signal: c_long = 48; ++pub const SYS_geteuid: c_long = 49; ++pub const SYS_getegid: c_long = 50; ++pub const SYS_acct: c_long = 51; ++pub const SYS_getgid32: c_long = 53; ++pub const SYS_ioctl: c_long = 54; ++pub const SYS_reboot: c_long = 55; ++pub const SYS_mmap2: c_long = 56; ++pub const SYS_symlink: c_long = 57; ++pub const SYS_readlink: c_long = 58; ++pub const SYS_execve: c_long = 59; ++pub const SYS_umask: c_long = 60; ++pub const SYS_chroot: c_long = 61; ++pub const SYS_fstat: c_long = 62; ++pub const SYS_fstat64: c_long = 63; ++pub const SYS_getpagesize: c_long = 64; ++pub const SYS_msync: c_long = 65; ++pub const SYS_vfork: c_long = 66; ++pub const SYS_pread64: c_long = 67; ++pub const SYS_pwrite64: c_long = 68; ++pub const SYS_geteuid32: c_long = 69; ++pub const SYS_getegid32: c_long = 70; ++pub const SYS_mmap: c_long = 71; ++pub const SYS_setreuid32: c_long = 72; ++pub const SYS_munmap: c_long = 73; ++pub const SYS_mprotect: c_long = 74; ++pub const SYS_madvise: c_long = 75; ++pub const SYS_vhangup: c_long = 76; ++pub const SYS_truncate64: c_long = 77; ++pub const SYS_mincore: c_long = 78; ++pub const SYS_getgroups: c_long = 79; ++pub const SYS_setgroups: c_long = 80; ++pub const SYS_getpgrp: c_long = 81; ++pub const SYS_setgroups32: c_long = 82; ++pub const SYS_setitimer: c_long = 83; ++pub const SYS_ftruncate64: c_long = 84; ++pub const SYS_swapon: c_long = 85; ++pub const SYS_getitimer: c_long = 86; ++pub const SYS_setuid32: c_long = 87; ++pub const SYS_sethostname: c_long = 88; ++pub const SYS_setgid32: c_long = 89; ++pub const SYS_dup2: c_long = 90; ++pub const SYS_setfsuid32: c_long = 91; ++pub const SYS_fcntl: c_long = 92; ++pub const SYS_select: c_long = 93; ++pub const SYS_setfsgid32: c_long = 94; ++pub const SYS_fsync: c_long = 95; ++pub const SYS_setpriority: c_long = 96; ++pub const SYS_socket: c_long = 97; ++pub const SYS_connect: c_long = 98; ++pub const SYS_accept: c_long = 99; ++pub const SYS_getpriority: c_long = 100; ++pub const SYS_rt_sigreturn: c_long = 101; ++pub const SYS_rt_sigaction: c_long = 102; ++pub const SYS_rt_sigprocmask: c_long = 103; ++pub const SYS_rt_sigpending: c_long = 104; ++pub const SYS_rt_sigtimedwait: c_long = 105; ++pub const SYS_rt_sigqueueinfo: c_long = 106; ++pub const SYS_rt_sigsuspend: c_long = 107; ++pub const SYS_setresuid32: c_long = 108; ++pub const SYS_getresuid32: c_long = 109; ++pub const SYS_setresgid32: c_long = 110; ++pub const SYS_getresgid32: c_long = 111; ++pub const SYS_setregid32: c_long = 112; ++pub const SYS_recvmsg: c_long = 113; ++pub const SYS_sendmsg: c_long = 114; ++pub const SYS_getgroups32: c_long = 115; ++pub const SYS_gettimeofday: c_long = 116; ++pub const SYS_getrusage: c_long = 117; ++pub const SYS_getsockopt: c_long = 118; ++pub const SYS_getcwd: c_long = 119; ++pub const SYS_readv: c_long = 120; ++pub const SYS_writev: c_long = 121; ++pub const SYS_settimeofday: c_long = 122; ++pub const SYS_fchown: c_long = 123; ++pub const SYS_fchmod: c_long = 124; ++pub const SYS_recvfrom: c_long = 125; ++pub const SYS_setreuid: c_long = 126; ++pub const SYS_setregid: c_long = 127; ++pub const SYS_rename: c_long = 128; ++pub const SYS_truncate: c_long = 129; ++pub const SYS_ftruncate: c_long = 130; ++pub const SYS_flock: c_long = 131; ++pub const SYS_lstat64: c_long = 132; ++pub const SYS_sendto: c_long = 133; ++pub const SYS_shutdown: c_long = 134; ++pub const SYS_socketpair: c_long = 135; ++pub const SYS_mkdir: c_long = 136; ++pub const SYS_rmdir: c_long = 137; ++pub const SYS_utimes: c_long = 138; ++pub const SYS_stat64: c_long = 139; ++pub const SYS_sendfile64: c_long = 140; ++pub const SYS_getpeername: c_long = 141; ++pub const SYS_futex: c_long = 142; ++pub const SYS_gettid: c_long = 143; ++pub const SYS_getrlimit: c_long = 144; ++pub const SYS_setrlimit: c_long = 145; ++pub const SYS_pivot_root: c_long = 146; ++pub const SYS_prctl: c_long = 147; ++pub const SYS_pciconfig_read: c_long = 148; ++pub const SYS_pciconfig_write: c_long = 149; ++pub const SYS_getsockname: c_long = 150; ++pub const SYS_inotify_init: c_long = 151; ++pub const SYS_inotify_add_watch: c_long = 152; ++pub const SYS_poll: c_long = 153; ++pub const SYS_getdents64: c_long = 154; ++pub const SYS_fcntl64: c_long = 155; ++pub const SYS_inotify_rm_watch: c_long = 156; ++pub const SYS_statfs: c_long = 157; ++pub const SYS_fstatfs: c_long = 158; ++pub const SYS_umount: c_long = 159; ++pub const SYS_sched_set_affinity: c_long = 160; ++pub const SYS_sched_get_affinity: c_long = 161; ++pub const SYS_getdomainname: c_long = 162; ++pub const SYS_setdomainname: c_long = 163; ++pub const SYS_quotactl: c_long = 165; ++pub const SYS_set_tid_address: c_long = 166; ++pub const SYS_mount: c_long = 167; ++pub const SYS_ustat: c_long = 168; ++pub const SYS_setxattr: c_long = 169; ++pub const SYS_lsetxattr: c_long = 170; ++pub const SYS_fsetxattr: c_long = 171; ++pub const SYS_getxattr: c_long = 172; ++pub const SYS_lgetxattr: c_long = 173; ++pub const SYS_getdents: c_long = 174; ++pub const SYS_setsid: c_long = 175; ++pub const SYS_fchdir: c_long = 176; ++pub const SYS_fgetxattr: c_long = 177; ++pub const SYS_listxattr: c_long = 178; ++pub const SYS_llistxattr: c_long = 179; ++pub const SYS_flistxattr: c_long = 180; ++pub const SYS_removexattr: c_long = 181; ++pub const SYS_lremovexattr: c_long = 182; ++pub const SYS_sigpending: c_long = 183; ++pub const SYS_query_module: c_long = 184; ++pub const SYS_setpgid: c_long = 185; ++pub const SYS_fremovexattr: c_long = 186; ++pub const SYS_tkill: c_long = 187; ++pub const SYS_exit_group: c_long = 188; ++pub const SYS_uname: c_long = 189; ++pub const SYS_init_module: c_long = 190; ++pub const SYS_personality: c_long = 191; ++pub const SYS_remap_file_pages: c_long = 192; ++pub const SYS_epoll_create: c_long = 193; ++pub const SYS_epoll_ctl: c_long = 194; ++pub const SYS_epoll_wait: c_long = 195; ++pub const SYS_ioprio_set: c_long = 196; ++pub const SYS_getppid: c_long = 197; ++pub const SYS_sigaction: c_long = 198; ++pub const SYS_sgetmask: c_long = 199; ++pub const SYS_ssetmask: c_long = 200; ++pub const SYS_sigsuspend: c_long = 201; ++pub const SYS_oldlstat: c_long = 202; ++pub const SYS_uselib: c_long = 203; ++pub const SYS_readdir: c_long = 204; ++pub const SYS_readahead: c_long = 205; ++pub const SYS_socketcall: c_long = 206; ++pub const SYS_syslog: c_long = 207; ++pub const SYS_lookup_dcookie: c_long = 208; ++pub const SYS_fadvise64: c_long = 209; ++pub const SYS_fadvise64_64: c_long = 210; ++pub const SYS_tgkill: c_long = 211; ++pub const SYS_waitpid: c_long = 212; ++pub const SYS_swapoff: c_long = 213; ++pub const SYS_sysinfo: c_long = 214; ++pub const SYS_ipc: c_long = 215; ++pub const SYS_sigreturn: c_long = 216; ++pub const SYS_clone: c_long = 217; ++pub const SYS_ioprio_get: c_long = 218; ++pub const SYS_adjtimex: c_long = 219; ++pub const SYS_sigprocmask: c_long = 220; ++pub const SYS_create_module: c_long = 221; ++pub const SYS_delete_module: c_long = 222; ++pub const SYS_get_kernel_syms: c_long = 223; ++pub const SYS_getpgid: c_long = 224; ++pub const SYS_bdflush: c_long = 225; ++pub const SYS_sysfs: c_long = 226; ++pub const SYS_afs_syscall: c_long = 227; ++pub const SYS_setfsuid: c_long = 228; ++pub const SYS_setfsgid: c_long = 229; ++pub const SYS__newselect: c_long = 230; ++pub const SYS_time: c_long = 231; ++pub const SYS_splice: c_long = 232; ++pub const SYS_stime: c_long = 233; ++pub const SYS_statfs64: c_long = 234; ++pub const SYS_fstatfs64: c_long = 235; ++pub const SYS__llseek: c_long = 236; ++pub const SYS_mlock: c_long = 237; ++pub const SYS_munlock: c_long = 238; ++pub const SYS_mlockall: c_long = 239; ++pub const SYS_munlockall: c_long = 240; ++pub const SYS_sched_setparam: c_long = 241; ++pub const SYS_sched_getparam: c_long = 242; ++pub const SYS_sched_setscheduler: c_long = 243; ++pub const SYS_sched_getscheduler: c_long = 244; ++pub const SYS_sched_yield: c_long = 245; ++pub const SYS_sched_get_priority_max: c_long = 246; ++pub const SYS_sched_get_priority_min: c_long = 247; ++pub const SYS_sched_rr_get_interval: c_long = 248; ++pub const SYS_nanosleep: c_long = 249; ++pub const SYS_mremap: c_long = 250; ++pub const SYS__sysctl: c_long = 251; ++pub const SYS_getsid: c_long = 252; ++pub const SYS_fdatasync: c_long = 253; ++pub const SYS_nfsservctl: c_long = 254; ++pub const SYS_sync_file_range: c_long = 255; ++pub const SYS_clock_settime: c_long = 256; ++pub const SYS_clock_gettime: c_long = 257; ++pub const SYS_clock_getres: c_long = 258; ++pub const SYS_clock_nanosleep: c_long = 259; ++pub const SYS_sched_getaffinity: c_long = 260; ++pub const SYS_sched_setaffinity: c_long = 261; ++pub const SYS_timer_settime: c_long = 262; ++pub const SYS_timer_gettime: c_long = 263; ++pub const SYS_timer_getoverrun: c_long = 264; ++pub const SYS_timer_delete: c_long = 265; ++pub const SYS_timer_create: c_long = 266; ++pub const SYS_io_setup: c_long = 268; ++pub const SYS_io_destroy: c_long = 269; ++pub const SYS_io_submit: c_long = 270; ++pub const SYS_io_cancel: c_long = 271; ++pub const SYS_io_getevents: c_long = 272; ++pub const SYS_mq_open: c_long = 273; ++pub const SYS_mq_unlink: c_long = 274; ++pub const SYS_mq_timedsend: c_long = 275; ++pub const SYS_mq_timedreceive: c_long = 276; ++pub const SYS_mq_notify: c_long = 277; ++pub const SYS_mq_getsetattr: c_long = 278; ++pub const SYS_waitid: c_long = 279; ++pub const SYS_tee: c_long = 280; ++pub const SYS_add_key: c_long = 281; ++pub const SYS_request_key: c_long = 282; ++pub const SYS_keyctl: c_long = 283; ++pub const SYS_openat: c_long = 284; ++pub const SYS_mkdirat: c_long = 285; ++pub const SYS_mknodat: c_long = 286; ++pub const SYS_fchownat: c_long = 287; ++pub const SYS_futimesat: c_long = 288; ++pub const SYS_fstatat64: c_long = 289; ++pub const SYS_unlinkat: c_long = 290; ++pub const SYS_renameat: c_long = 291; ++pub const SYS_linkat: c_long = 292; ++pub const SYS_symlinkat: c_long = 293; ++pub const SYS_readlinkat: c_long = 294; ++pub const SYS_fchmodat: c_long = 295; ++pub const SYS_faccessat: c_long = 296; ++pub const SYS_pselect6: c_long = 297; ++pub const SYS_ppoll: c_long = 298; ++pub const SYS_unshare: c_long = 299; ++pub const SYS_set_robust_list: c_long = 300; ++pub const SYS_get_robust_list: c_long = 301; ++pub const SYS_migrate_pages: c_long = 302; ++pub const SYS_mbind: c_long = 303; ++pub const SYS_get_mempolicy: c_long = 304; ++pub const SYS_set_mempolicy: c_long = 305; ++pub const SYS_kexec_load: c_long = 306; ++pub const SYS_move_pages: c_long = 307; ++pub const SYS_getcpu: c_long = 308; ++pub const SYS_epoll_pwait: c_long = 309; ++pub const SYS_utimensat: c_long = 310; ++pub const SYS_signalfd: c_long = 311; ++pub const SYS_timerfd_create: c_long = 312; ++pub const SYS_eventfd: c_long = 313; ++pub const SYS_fallocate: c_long = 314; ++pub const SYS_timerfd_settime: c_long = 315; ++pub const SYS_timerfd_gettime: c_long = 316; ++pub const SYS_signalfd4: c_long = 317; ++pub const SYS_eventfd2: c_long = 318; ++pub const SYS_epoll_create1: c_long = 319; ++pub const SYS_dup3: c_long = 320; ++pub const SYS_pipe2: c_long = 321; ++pub const SYS_inotify_init1: c_long = 322; ++pub const SYS_accept4: c_long = 323; ++pub const SYS_preadv: c_long = 324; ++pub const SYS_pwritev: c_long = 325; ++pub const SYS_rt_tgsigqueueinfo: c_long = 326; ++pub const SYS_perf_event_open: c_long = 327; ++pub const SYS_recvmmsg: c_long = 328; ++pub const SYS_fanotify_init: c_long = 329; ++pub const SYS_fanotify_mark: c_long = 330; ++pub const SYS_prlimit64: c_long = 331; ++pub const SYS_name_to_handle_at: c_long = 332; ++pub const SYS_open_by_handle_at: c_long = 333; ++pub const SYS_clock_adjtime: c_long = 334; ++pub const SYS_syncfs: c_long = 335; ++pub const SYS_sendmmsg: c_long = 336; ++pub const SYS_setns: c_long = 337; ++pub const SYS_process_vm_readv: c_long = 338; ++pub const SYS_process_vm_writev: c_long = 339; ++pub const SYS_kern_features: c_long = 340; ++pub const SYS_kcmp: c_long = 341; ++pub const SYS_finit_module: c_long = 342; ++pub const SYS_sched_setattr: c_long = 343; ++pub const SYS_sched_getattr: c_long = 344; ++pub const SYS_renameat2: c_long = 345; ++pub const SYS_seccomp: c_long = 346; ++pub const SYS_getrandom: c_long = 347; ++pub const SYS_memfd_create: c_long = 348; ++pub const SYS_bpf: c_long = 349; ++pub const SYS_execveat: c_long = 350; ++pub const SYS_membarrier: c_long = 351; ++pub const SYS_userfaultfd: c_long = 352; ++pub const SYS_bind: c_long = 353; ++pub const SYS_listen: c_long = 354; ++pub const SYS_setsockopt: c_long = 355; ++pub const SYS_mlock2: c_long = 356; ++pub const SYS_copy_file_range: c_long = 357; ++pub const SYS_preadv2: c_long = 358; ++pub const SYS_pwritev2: c_long = 359; ++pub const SYS_statx: c_long = 360; ++pub const SYS_rseq: c_long = 365; ++pub const SYS_pidfd_send_signal: c_long = 424; ++pub const SYS_io_uring_setup: c_long = 425; ++pub const SYS_io_uring_enter: c_long = 426; ++pub const SYS_io_uring_register: c_long = 427; ++pub const SYS_open_tree: c_long = 428; ++pub const SYS_move_mount: c_long = 429; ++pub const SYS_fsopen: c_long = 430; ++pub const SYS_fsconfig: c_long = 431; ++pub const SYS_fsmount: c_long = 432; ++pub const SYS_fspick: c_long = 433; ++pub const SYS_pidfd_open: c_long = 434; ++// Reserved in the kernel, but not actually implemented yet ++pub const SYS_clone3: c_long = 435; ++pub const SYS_close_range: c_long = 436; ++pub const SYS_openat2: c_long = 437; ++pub const SYS_pidfd_getfd: c_long = 438; ++pub const SYS_faccessat2: c_long = 439; ++pub const SYS_process_madvise: c_long = 440; ++pub const SYS_epoll_pwait2: c_long = 441; ++pub const SYS_mount_setattr: c_long = 442; ++pub const SYS_quotactl_fd: c_long = 443; ++pub const SYS_landlock_create_ruleset: c_long = 444; ++pub const SYS_landlock_add_rule: c_long = 445; ++pub const SYS_landlock_restrict_self: c_long = 446; ++pub const SYS_memfd_secret: c_long = 447; ++pub const SYS_process_mrelease: c_long = 448; ++pub const SYS_futex_waitv: c_long = 449; ++pub const SYS_set_mempolicy_home_node: c_long = 450; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/x86/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/x86/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/x86/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b32/x86/mod.rs 2024-12-28 15:35:00.000000000 -0500 +@@ -0,0 +1,1137 @@ ++use crate::prelude::*; ++use crate::{off64_t, off_t}; ++ ++pub type c_char = i8; ++pub type wchar_t = i32; ++pub type greg_t = i32; ++ ++#[cfg(gnu_time64_abi)] ++pub type statfs64 = statfs; ++ ++s! { ++ pub struct sigaction { ++ pub sa_sigaction: crate::sighandler_t, ++ pub sa_mask: crate::sigset_t, ++ pub sa_flags: c_int, ++ pub sa_restorer: Option, ++ } ++ ++ pub struct statfs { ++ pub f_type: crate::__fsword_t, ++ pub f_bsize: crate::__fsword_t, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_fsid: crate::fsid_t, ++ ++ pub f_namelen: crate::__fsword_t, ++ pub f_frsize: crate::__fsword_t, ++ pub f_flags: crate::__fsword_t, ++ f_spare: [crate::__fsword_t; 4], ++ } ++ ++ pub struct flock { ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ pub l_start: off_t, ++ pub l_len: off_t, ++ pub l_pid: crate::pid_t, ++ } ++ ++ pub struct flock64 { ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ pub l_start: off64_t, ++ pub l_len: off64_t, ++ pub l_pid: crate::pid_t, ++ } ++ ++ pub struct _libc_fpreg { ++ pub significand: [u16; 4], ++ pub exponent: u16, ++ } ++ ++ pub struct _libc_fpstate { ++ pub cw: c_ulong, ++ pub sw: c_ulong, ++ pub tag: c_ulong, ++ pub ipoff: c_ulong, ++ pub cssel: c_ulong, ++ pub dataoff: c_ulong, ++ pub datasel: c_ulong, ++ pub _st: [_libc_fpreg; 8], ++ pub status: c_ulong, ++ } ++ ++ pub struct user_fpregs_struct { ++ pub cwd: c_long, ++ pub swd: c_long, ++ pub twd: c_long, ++ pub fip: c_long, ++ pub fcs: c_long, ++ pub foo: c_long, ++ pub fos: c_long, ++ pub st_space: [c_long; 20], ++ } ++ ++ pub struct user_regs_struct { ++ pub ebx: c_long, ++ pub ecx: c_long, ++ pub edx: c_long, ++ pub esi: c_long, ++ pub edi: c_long, ++ pub ebp: c_long, ++ pub eax: c_long, ++ pub xds: c_long, ++ pub xes: c_long, ++ pub xfs: c_long, ++ pub xgs: c_long, ++ pub orig_eax: c_long, ++ pub eip: c_long, ++ pub xcs: c_long, ++ pub eflags: c_long, ++ pub esp: c_long, ++ pub xss: c_long, ++ } ++ ++ pub struct user { ++ pub regs: user_regs_struct, ++ pub u_fpvalid: c_int, ++ pub i387: user_fpregs_struct, ++ pub u_tsize: c_ulong, ++ pub u_dsize: c_ulong, ++ pub u_ssize: c_ulong, ++ pub start_code: c_ulong, ++ pub start_stack: c_ulong, ++ pub signal: c_long, ++ __reserved: c_int, ++ pub u_ar0: *mut user_regs_struct, ++ pub u_fpstate: *mut user_fpregs_struct, ++ pub magic: c_ulong, ++ pub u_comm: [c_char; 32], ++ pub u_debugreg: [c_int; 8], ++ } ++ ++ pub struct mcontext_t { ++ pub gregs: [greg_t; 19], ++ pub fpregs: *mut _libc_fpstate, ++ pub oldmask: c_ulong, ++ pub cr2: c_ulong, ++ } ++ ++ pub struct ipc_perm { ++ pub __key: crate::key_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub cuid: crate::uid_t, ++ pub cgid: crate::gid_t, ++ pub mode: c_ushort, ++ __pad1: c_ushort, ++ pub __seq: c_ushort, ++ __pad2: c_ushort, ++ __unused1: c_ulong, ++ __unused2: c_ulong, ++ } ++} ++ ++#[cfg(not(gnu_time64_abi))] ++s! { ++ pub struct stat64 { ++ pub st_dev: crate::dev_t, ++ __pad1: c_uint, ++ __st_ino: crate::ino_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ __pad2: c_uint, ++ pub st_size: crate::off64_t, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt64_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ pub st_ino: crate::ino64_t, ++ } ++ ++ pub struct statfs64 { ++ pub f_type: crate::__fsword_t, ++ pub f_bsize: crate::__fsword_t, ++ pub f_blocks: u64, ++ pub f_bfree: u64, ++ pub f_bavail: u64, ++ pub f_files: u64, ++ pub f_ffree: u64, ++ pub f_fsid: crate::fsid_t, ++ pub f_namelen: crate::__fsword_t, ++ pub f_frsize: crate::__fsword_t, ++ pub f_flags: crate::__fsword_t, ++ pub f_spare: [crate::__fsword_t; 4], ++ } ++} ++ ++#[cfg(gnu_time64_abi)] ++s! { ++ pub struct stat64 { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ pub st_size: off64_t, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt64_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ __pad1: i32, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ __pad2: i32, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ __pad3: i32, ++ } ++} ++ ++s! { ++ pub struct statvfs64 { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: u64, ++ pub f_bfree: u64, ++ pub f_bavail: u64, ++ pub f_files: u64, ++ pub f_ffree: u64, ++ pub f_favail: u64, ++ pub f_fsid: c_ulong, ++ __f_unused: c_int, ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ __f_spare: [c_int; 6], ++ } ++ ++ pub struct shmid_ds { ++ pub shm_perm: crate::ipc_perm, ++ pub shm_segsz: size_t, ++ pub shm_atime: crate::time_t, ++ pub shm_dtime: crate::time_t, ++ pub shm_ctime: crate::time_t, ++ pub shm_cpid: crate::pid_t, ++ pub shm_lpid: crate::pid_t, ++ pub shm_nattch: crate::shmatt_t, ++ __unused4: c_ulong, ++ __unused5: c_ulong, ++ } ++ ++ pub struct msqid_ds { ++ pub msg_perm: crate::ipc_perm, ++ pub msg_stime: crate::time_t, ++ pub msg_rtime: crate::time_t, ++ pub msg_ctime: crate::time_t, ++ __msg_cbytes: c_ulong, ++ pub msg_qnum: crate::msgqnum_t, ++ pub msg_qbytes: crate::msglen_t, ++ pub msg_lspid: crate::pid_t, ++ pub msg_lrpid: crate::pid_t, ++ __glibc_reserved4: c_ulong, ++ __glibc_reserved5: c_ulong, ++ } ++ ++ pub struct siginfo_t { ++ pub si_signo: c_int, ++ pub si_errno: c_int, ++ pub si_code: c_int, ++ #[doc(hidden)] ++ #[deprecated( ++ since = "0.2.54", ++ note = "Please leave a comment on \ ++ https://github.com/rust-lang/libc/pull/1316 if you're using \ ++ this field" ++ )] ++ pub _pad: [c_int; 29], ++ _align: [usize; 0], ++ } ++ ++ pub struct stack_t { ++ pub ss_sp: *mut c_void, ++ pub ss_flags: c_int, ++ pub ss_size: size_t, ++ } ++} ++ ++s_no_extra_traits! { ++ pub struct user_fpxregs_struct { ++ pub cwd: c_ushort, ++ pub swd: c_ushort, ++ pub twd: c_ushort, ++ pub fop: c_ushort, ++ pub fip: c_long, ++ pub fcs: c_long, ++ pub foo: c_long, ++ pub fos: c_long, ++ pub mxcsr: c_long, ++ __reserved: c_long, ++ pub st_space: [c_long; 32], ++ pub xmm_space: [c_long; 32], ++ padding: [c_long; 56], ++ } ++ ++ pub struct ucontext_t { ++ pub uc_flags: c_ulong, ++ pub uc_link: *mut ucontext_t, ++ pub uc_stack: crate::stack_t, ++ pub uc_mcontext: mcontext_t, ++ pub uc_sigmask: crate::sigset_t, ++ __private: [u8; 112], ++ __ssp: [c_ulong; 4], ++ } ++ ++ #[allow(missing_debug_implementations)] ++ #[repr(align(16))] ++ pub struct max_align_t { ++ priv_: [f64; 6], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for user_fpxregs_struct { ++ fn eq(&self, other: &user_fpxregs_struct) -> bool { ++ self.cwd == other.cwd ++ && self.swd == other.swd ++ && self.twd == other.twd ++ && self.fop == other.fop ++ && self.fip == other.fip ++ && self.fcs == other.fcs ++ && self.foo == other.foo ++ && self.fos == other.fos ++ && self.mxcsr == other.mxcsr ++ // Ignore __reserved field ++ && self.st_space == other.st_space ++ && self.xmm_space == other.xmm_space ++ // Ignore padding field ++ } ++ } ++ ++ impl Eq for user_fpxregs_struct {} ++ ++ impl fmt::Debug for user_fpxregs_struct { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("user_fpxregs_struct") ++ .field("cwd", &self.cwd) ++ .field("swd", &self.swd) ++ .field("twd", &self.twd) ++ .field("fop", &self.fop) ++ .field("fip", &self.fip) ++ .field("fcs", &self.fcs) ++ .field("foo", &self.foo) ++ .field("fos", &self.fos) ++ .field("mxcsr", &self.mxcsr) ++ // Ignore __reserved field ++ .field("st_space", &self.st_space) ++ .field("xmm_space", &self.xmm_space) ++ // Ignore padding field ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for user_fpxregs_struct { ++ fn hash(&self, state: &mut H) { ++ self.cwd.hash(state); ++ self.swd.hash(state); ++ self.twd.hash(state); ++ self.fop.hash(state); ++ self.fip.hash(state); ++ self.fcs.hash(state); ++ self.foo.hash(state); ++ self.fos.hash(state); ++ self.mxcsr.hash(state); ++ // Ignore __reserved field ++ self.st_space.hash(state); ++ self.xmm_space.hash(state); ++ // Ignore padding field ++ } ++ } ++ ++ impl PartialEq for ucontext_t { ++ fn eq(&self, other: &ucontext_t) -> bool { ++ self.uc_flags == other.uc_flags ++ && self.uc_link == other.uc_link ++ && self.uc_stack == other.uc_stack ++ && self.uc_mcontext == other.uc_mcontext ++ && self.uc_sigmask == other.uc_sigmask ++ // Ignore __private field ++ } ++ } ++ ++ impl Eq for ucontext_t {} ++ ++ impl fmt::Debug for ucontext_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("ucontext_t") ++ .field("uc_flags", &self.uc_flags) ++ .field("uc_link", &self.uc_link) ++ .field("uc_stack", &self.uc_stack) ++ .field("uc_mcontext", &self.uc_mcontext) ++ .field("uc_sigmask", &self.uc_sigmask) ++ // Ignore __private field ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for ucontext_t { ++ fn hash(&self, state: &mut H) { ++ self.uc_flags.hash(state); ++ self.uc_link.hash(state); ++ self.uc_stack.hash(state); ++ self.uc_mcontext.hash(state); ++ self.uc_sigmask.hash(state); ++ // Ignore __private field ++ } ++ } ++ } ++} ++ ++pub const VEOF: usize = 4; ++pub const RTLD_DEEPBIND: c_int = 0x8; ++pub const RTLD_GLOBAL: c_int = 0x100; ++pub const RTLD_NOLOAD: c_int = 0x4; ++pub const O_DIRECT: c_int = 0x4000; ++pub const O_DIRECTORY: c_int = 0x10000; ++pub const O_NOFOLLOW: c_int = 0x20000; ++pub const O_LARGEFILE: c_int = 0o0100000; ++pub const O_APPEND: c_int = 1024; ++pub const O_CREAT: c_int = 64; ++pub const O_EXCL: c_int = 128; ++pub const O_NOCTTY: c_int = 256; ++pub const O_NONBLOCK: c_int = 2048; ++pub const O_SYNC: c_int = 1052672; ++pub const O_RSYNC: c_int = 1052672; ++pub const O_DSYNC: c_int = 4096; ++pub const O_FSYNC: c_int = 0x101000; ++pub const O_ASYNC: c_int = 0x2000; ++pub const O_NDELAY: c_int = 0x800; ++ ++pub const MADV_SOFT_OFFLINE: c_int = 101; ++pub const MAP_LOCKED: c_int = 0x02000; ++pub const MAP_NORESERVE: c_int = 0x04000; ++pub const MAP_32BIT: c_int = 0x0040; ++pub const MAP_ANON: c_int = 0x0020; ++pub const MAP_ANONYMOUS: c_int = 0x0020; ++pub const MAP_DENYWRITE: c_int = 0x0800; ++pub const MAP_EXECUTABLE: c_int = 0x01000; ++pub const MAP_POPULATE: c_int = 0x08000; ++pub const MAP_NONBLOCK: c_int = 0x010000; ++pub const MAP_STACK: c_int = 0x020000; ++pub const MAP_HUGETLB: c_int = 0x040000; ++pub const MAP_GROWSDOWN: c_int = 0x0100; ++pub const MAP_SYNC: c_int = 0x080000; ++ ++pub const EDEADLOCK: c_int = 35; ++pub const EUCLEAN: c_int = 117; ++pub const ENOTNAM: c_int = 118; ++pub const ENAVAIL: c_int = 119; ++pub const EISNAM: c_int = 120; ++pub const EREMOTEIO: c_int = 121; ++pub const EDEADLK: c_int = 35; ++pub const ENAMETOOLONG: c_int = 36; ++pub const ENOLCK: c_int = 37; ++pub const ENOSYS: c_int = 38; ++pub const ENOTEMPTY: c_int = 39; ++pub const ELOOP: c_int = 40; ++pub const ENOMSG: c_int = 42; ++pub const EIDRM: c_int = 43; ++pub const ECHRNG: c_int = 44; ++pub const EL2NSYNC: c_int = 45; ++pub const EL3HLT: c_int = 46; ++pub const EL3RST: c_int = 47; ++pub const ELNRNG: c_int = 48; ++pub const EUNATCH: c_int = 49; ++pub const ENOCSI: c_int = 50; ++pub const EL2HLT: c_int = 51; ++pub const EBADE: c_int = 52; ++pub const EBADR: c_int = 53; ++pub const EXFULL: c_int = 54; ++pub const ENOANO: c_int = 55; ++pub const EBADRQC: c_int = 56; ++pub const EBADSLT: c_int = 57; ++pub const EMULTIHOP: c_int = 72; ++pub const EOVERFLOW: c_int = 75; ++pub const ENOTUNIQ: c_int = 76; ++pub const EBADFD: c_int = 77; ++pub const EBADMSG: c_int = 74; ++pub const EREMCHG: c_int = 78; ++pub const ELIBACC: c_int = 79; ++pub const ELIBBAD: c_int = 80; ++pub const ELIBSCN: c_int = 81; ++pub const ELIBMAX: c_int = 82; ++pub const ELIBEXEC: c_int = 83; ++pub const EILSEQ: c_int = 84; ++pub const ERESTART: c_int = 85; ++pub const ESTRPIPE: c_int = 86; ++pub const EUSERS: c_int = 87; ++pub const ENOTSOCK: c_int = 88; ++pub const EDESTADDRREQ: c_int = 89; ++pub const EMSGSIZE: c_int = 90; ++pub const EPROTOTYPE: c_int = 91; ++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 EPFNOSUPPORT: c_int = 96; ++pub const EAFNOSUPPORT: c_int = 97; ++pub const EADDRINUSE: c_int = 98; ++pub const EADDRNOTAVAIL: c_int = 99; ++pub const ENETDOWN: c_int = 100; ++pub const ENETUNREACH: c_int = 101; ++pub const ENETRESET: c_int = 102; ++pub const ECONNABORTED: c_int = 103; ++pub const ECONNRESET: c_int = 104; ++pub const ENOBUFS: c_int = 105; ++pub const EISCONN: c_int = 106; ++pub const ENOTCONN: c_int = 107; ++pub const ESHUTDOWN: c_int = 108; ++pub const ETOOMANYREFS: c_int = 109; ++pub const ETIMEDOUT: c_int = 110; ++pub const ECONNREFUSED: c_int = 111; ++pub const EHOSTDOWN: c_int = 112; ++pub const EHOSTUNREACH: c_int = 113; ++pub const EALREADY: c_int = 114; ++pub const EINPROGRESS: c_int = 115; ++pub const ESTALE: c_int = 116; ++pub const EDQUOT: c_int = 122; ++pub const ENOMEDIUM: c_int = 123; ++pub const EMEDIUMTYPE: c_int = 124; ++pub const ECANCELED: c_int = 125; ++pub const ENOKEY: c_int = 126; ++pub const EKEYEXPIRED: c_int = 127; ++pub const EKEYREVOKED: c_int = 128; ++pub const EKEYREJECTED: c_int = 129; ++pub const EOWNERDEAD: c_int = 130; ++pub const ENOTRECOVERABLE: c_int = 131; ++pub const EHWPOISON: c_int = 133; ++pub const ERFKILL: c_int = 132; ++ ++pub const SA_SIGINFO: c_int = 0x00000004; ++pub const SA_NOCLDWAIT: c_int = 0x00000002; ++ ++pub const SOCK_STREAM: c_int = 1; ++pub const SOCK_DGRAM: c_int = 2; ++ ++cfg_if! { ++ if #[cfg(gnu_time64_abi)] { ++ pub const F_GETLK: c_int = 12; ++ } else { ++ pub const F_GETLK: c_int = 5; ++ } ++} ++pub const F_GETOWN: c_int = 9; ++pub const F_SETOWN: c_int = 8; ++ ++pub const PTRACE_GETFPXREGS: c_uint = 18; ++pub const PTRACE_SETFPXREGS: c_uint = 19; ++pub const PTRACE_SYSEMU: c_uint = 31; ++pub const PTRACE_SYSEMU_SINGLESTEP: c_uint = 32; ++ ++pub const MCL_CURRENT: c_int = 0x0001; ++pub const MCL_FUTURE: c_int = 0x0002; ++pub const MCL_ONFAULT: c_int = 0x0004; ++ ++pub const POLLWRNORM: c_short = 0x100; ++pub const POLLWRBAND: c_short = 0x200; ++ ++pub const EFD_NONBLOCK: c_int = 0x800; ++pub const SFD_NONBLOCK: c_int = 0x0800; ++ ++pub const SIGCHLD: c_int = 17; ++pub const SIGBUS: c_int = 7; ++pub const SIGUSR1: c_int = 10; ++pub const SIGUSR2: c_int = 12; ++pub const SIGCONT: c_int = 18; ++pub const SIGSTOP: c_int = 19; ++pub const SIGTSTP: c_int = 20; ++pub const SIGURG: c_int = 23; ++pub const SIGIO: c_int = 29; ++pub const SIGSYS: c_int = 31; ++pub const SIGSTKFLT: c_int = 16; ++#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")] ++pub const SIGUNUSED: c_int = 31; ++pub const SIGPOLL: c_int = 29; ++pub const SIGPWR: c_int = 30; ++pub const SIG_SETMASK: c_int = 2; ++pub const SIG_BLOCK: c_int = 0x000000; ++pub const SIG_UNBLOCK: c_int = 0x01; ++pub const SIGTTIN: c_int = 21; ++pub const SIGTTOU: c_int = 22; ++pub const SIGXCPU: c_int = 24; ++pub const SIGXFSZ: c_int = 25; ++pub const SIGVTALRM: c_int = 26; ++pub const SIGPROF: c_int = 27; ++pub const SIGWINCH: c_int = 28; ++pub const SIGSTKSZ: size_t = 8192; ++pub const MINSIGSTKSZ: size_t = 2048; ++pub const CBAUD: crate::tcflag_t = 0o0010017; ++pub const TAB1: crate::tcflag_t = 0x00000800; ++pub const TAB2: crate::tcflag_t = 0x00001000; ++pub const TAB3: crate::tcflag_t = 0x00001800; ++pub const CR1: crate::tcflag_t = 0x00000200; ++pub const CR2: crate::tcflag_t = 0x00000400; ++pub const CR3: crate::tcflag_t = 0x00000600; ++pub const FF1: crate::tcflag_t = 0x00008000; ++pub const BS1: crate::tcflag_t = 0x00002000; ++pub const VT1: crate::tcflag_t = 0x00004000; ++pub const VWERASE: usize = 14; ++pub const VREPRINT: usize = 12; ++pub const VSUSP: usize = 10; ++pub const VSTART: usize = 8; ++pub const VSTOP: usize = 9; ++pub const VDISCARD: usize = 13; ++pub const VTIME: usize = 5; ++pub const IXON: crate::tcflag_t = 0x00000400; ++pub const IXOFF: crate::tcflag_t = 0x00001000; ++pub const ONLCR: crate::tcflag_t = 0x4; ++pub const CSIZE: crate::tcflag_t = 0x00000030; ++pub const CS6: crate::tcflag_t = 0x00000010; ++pub const CS7: crate::tcflag_t = 0x00000020; ++pub const CS8: crate::tcflag_t = 0x00000030; ++pub const CSTOPB: crate::tcflag_t = 0x00000040; ++pub const CREAD: crate::tcflag_t = 0x00000080; ++pub const PARENB: crate::tcflag_t = 0x00000100; ++pub const PARODD: crate::tcflag_t = 0x00000200; ++pub const HUPCL: crate::tcflag_t = 0x00000400; ++pub const CLOCAL: crate::tcflag_t = 0x00000800; ++pub const ECHOKE: crate::tcflag_t = 0x00000800; ++pub const ECHOE: crate::tcflag_t = 0x00000010; ++pub const ECHOK: crate::tcflag_t = 0x00000020; ++pub const ECHONL: crate::tcflag_t = 0x00000040; ++pub const ECHOPRT: crate::tcflag_t = 0x00000400; ++pub const ECHOCTL: crate::tcflag_t = 0x00000200; ++pub const ISIG: crate::tcflag_t = 0x00000001; ++pub const ICANON: crate::tcflag_t = 0x00000002; ++pub const PENDIN: crate::tcflag_t = 0x00004000; ++pub const NOFLSH: crate::tcflag_t = 0x00000080; ++pub const CIBAUD: crate::tcflag_t = 0o02003600000; ++pub const CBAUDEX: crate::tcflag_t = 0o010000; ++pub const VSWTC: usize = 7; ++pub const OLCUC: crate::tcflag_t = 0o000002; ++pub const NLDLY: crate::tcflag_t = 0o000400; ++pub const CRDLY: crate::tcflag_t = 0o003000; ++pub const TABDLY: crate::tcflag_t = 0o014000; ++pub const BSDLY: crate::tcflag_t = 0o020000; ++pub const FFDLY: crate::tcflag_t = 0o100000; ++pub const VTDLY: crate::tcflag_t = 0o040000; ++pub const XTABS: crate::tcflag_t = 0o014000; ++ ++pub const B0: crate::speed_t = 0o000000; ++pub const B50: crate::speed_t = 0o000001; ++pub const B75: crate::speed_t = 0o000002; ++pub const B110: crate::speed_t = 0o000003; ++pub const B134: crate::speed_t = 0o000004; ++pub const B150: crate::speed_t = 0o000005; ++pub const B200: crate::speed_t = 0o000006; ++pub const B300: crate::speed_t = 0o000007; ++pub const B600: crate::speed_t = 0o000010; ++pub const B1200: crate::speed_t = 0o000011; ++pub const B1800: crate::speed_t = 0o000012; ++pub const B2400: crate::speed_t = 0o000013; ++pub const B4800: crate::speed_t = 0o000014; ++pub const B9600: crate::speed_t = 0o000015; ++pub const B19200: crate::speed_t = 0o000016; ++pub const B38400: crate::speed_t = 0o000017; ++pub const EXTA: crate::speed_t = B19200; ++pub const EXTB: crate::speed_t = B38400; ++pub const B57600: crate::speed_t = 0o010001; ++pub const B115200: crate::speed_t = 0o010002; ++pub const B230400: crate::speed_t = 0o010003; ++pub const B460800: crate::speed_t = 0o010004; ++pub const B500000: crate::speed_t = 0o010005; ++pub const B576000: crate::speed_t = 0o010006; ++pub const B921600: crate::speed_t = 0o010007; ++pub const B1000000: crate::speed_t = 0o010010; ++pub const B1152000: crate::speed_t = 0o010011; ++pub const B1500000: crate::speed_t = 0o010012; ++pub const B2000000: crate::speed_t = 0o010013; ++pub const B2500000: crate::speed_t = 0o010014; ++pub const B3000000: crate::speed_t = 0o010015; ++pub const B3500000: crate::speed_t = 0o010016; ++pub const B4000000: crate::speed_t = 0o010017; ++ ++pub const VEOL: usize = 11; ++pub const VEOL2: usize = 16; ++pub const VMIN: usize = 6; ++pub const IEXTEN: crate::tcflag_t = 0x00008000; ++pub const TOSTOP: crate::tcflag_t = 0x00000100; ++pub const FLUSHO: crate::tcflag_t = 0x00001000; ++pub const EXTPROC: crate::tcflag_t = 0x00010000; ++ ++pub const TCSANOW: c_int = 0; ++pub const TCSADRAIN: c_int = 1; ++pub const TCSAFLUSH: c_int = 2; ++ ++// Syscall table ++pub const SYS_restart_syscall: c_long = 0; ++pub const SYS_exit: c_long = 1; ++pub const SYS_fork: c_long = 2; ++pub const SYS_read: c_long = 3; ++pub const SYS_write: c_long = 4; ++pub const SYS_open: c_long = 5; ++pub const SYS_close: c_long = 6; ++pub const SYS_waitpid: c_long = 7; ++pub const SYS_creat: c_long = 8; ++pub const SYS_link: c_long = 9; ++pub const SYS_unlink: c_long = 10; ++pub const SYS_execve: c_long = 11; ++pub const SYS_chdir: c_long = 12; ++pub const SYS_time: c_long = 13; ++pub const SYS_mknod: c_long = 14; ++pub const SYS_chmod: c_long = 15; ++pub const SYS_lchown: c_long = 16; ++pub const SYS_break: c_long = 17; ++pub const SYS_oldstat: c_long = 18; ++pub const SYS_lseek: c_long = 19; ++pub const SYS_getpid: c_long = 20; ++pub const SYS_mount: c_long = 21; ++pub const SYS_umount: c_long = 22; ++pub const SYS_setuid: c_long = 23; ++pub const SYS_getuid: c_long = 24; ++pub const SYS_stime: c_long = 25; ++pub const SYS_ptrace: c_long = 26; ++pub const SYS_alarm: c_long = 27; ++pub const SYS_oldfstat: c_long = 28; ++pub const SYS_pause: c_long = 29; ++pub const SYS_utime: c_long = 30; ++pub const SYS_stty: c_long = 31; ++pub const SYS_gtty: c_long = 32; ++pub const SYS_access: c_long = 33; ++pub const SYS_nice: c_long = 34; ++pub const SYS_ftime: c_long = 35; ++pub const SYS_sync: c_long = 36; ++pub const SYS_kill: c_long = 37; ++pub const SYS_rename: c_long = 38; ++pub const SYS_mkdir: c_long = 39; ++pub const SYS_rmdir: c_long = 40; ++pub const SYS_dup: c_long = 41; ++pub const SYS_pipe: c_long = 42; ++pub const SYS_times: c_long = 43; ++pub const SYS_prof: c_long = 44; ++pub const SYS_brk: c_long = 45; ++pub const SYS_setgid: c_long = 46; ++pub const SYS_getgid: c_long = 47; ++pub const SYS_signal: c_long = 48; ++pub const SYS_geteuid: c_long = 49; ++pub const SYS_getegid: c_long = 50; ++pub const SYS_acct: c_long = 51; ++pub const SYS_umount2: c_long = 52; ++pub const SYS_lock: c_long = 53; ++pub const SYS_ioctl: c_long = 54; ++pub const SYS_fcntl: c_long = 55; ++pub const SYS_mpx: c_long = 56; ++pub const SYS_setpgid: c_long = 57; ++pub const SYS_ulimit: c_long = 58; ++pub const SYS_oldolduname: c_long = 59; ++pub const SYS_umask: c_long = 60; ++pub const SYS_chroot: c_long = 61; ++pub const SYS_ustat: c_long = 62; ++pub const SYS_dup2: c_long = 63; ++pub const SYS_getppid: c_long = 64; ++pub const SYS_getpgrp: c_long = 65; ++pub const SYS_setsid: c_long = 66; ++pub const SYS_sigaction: c_long = 67; ++pub const SYS_sgetmask: c_long = 68; ++pub const SYS_ssetmask: c_long = 69; ++pub const SYS_setreuid: c_long = 70; ++pub const SYS_setregid: c_long = 71; ++pub const SYS_sigsuspend: c_long = 72; ++pub const SYS_sigpending: c_long = 73; ++pub const SYS_sethostname: c_long = 74; ++pub const SYS_setrlimit: c_long = 75; ++pub const SYS_getrlimit: c_long = 76; ++pub const SYS_getrusage: c_long = 77; ++pub const SYS_gettimeofday: c_long = 78; ++pub const SYS_settimeofday: c_long = 79; ++pub const SYS_getgroups: c_long = 80; ++pub const SYS_setgroups: c_long = 81; ++pub const SYS_select: c_long = 82; ++pub const SYS_symlink: c_long = 83; ++pub const SYS_oldlstat: c_long = 84; ++pub const SYS_readlink: c_long = 85; ++pub const SYS_uselib: c_long = 86; ++pub const SYS_swapon: c_long = 87; ++pub const SYS_reboot: c_long = 88; ++pub const SYS_readdir: c_long = 89; ++pub const SYS_mmap: c_long = 90; ++pub const SYS_munmap: c_long = 91; ++pub const SYS_truncate: c_long = 92; ++pub const SYS_ftruncate: c_long = 93; ++pub const SYS_fchmod: c_long = 94; ++pub const SYS_fchown: c_long = 95; ++pub const SYS_getpriority: c_long = 96; ++pub const SYS_setpriority: c_long = 97; ++pub const SYS_profil: c_long = 98; ++pub const SYS_statfs: c_long = 99; ++pub const SYS_fstatfs: c_long = 100; ++pub const SYS_ioperm: c_long = 101; ++pub const SYS_socketcall: c_long = 102; ++pub const SYS_syslog: c_long = 103; ++pub const SYS_setitimer: c_long = 104; ++pub const SYS_getitimer: c_long = 105; ++pub const SYS_stat: c_long = 106; ++pub const SYS_lstat: c_long = 107; ++pub const SYS_fstat: c_long = 108; ++pub const SYS_olduname: c_long = 109; ++pub const SYS_iopl: c_long = 110; ++pub const SYS_vhangup: c_long = 111; ++pub const SYS_idle: c_long = 112; ++pub const SYS_vm86old: c_long = 113; ++pub const SYS_wait4: c_long = 114; ++pub const SYS_swapoff: c_long = 115; ++pub const SYS_sysinfo: c_long = 116; ++pub const SYS_ipc: c_long = 117; ++pub const SYS_fsync: c_long = 118; ++pub const SYS_sigreturn: c_long = 119; ++pub const SYS_clone: c_long = 120; ++pub const SYS_setdomainname: c_long = 121; ++pub const SYS_uname: c_long = 122; ++pub const SYS_modify_ldt: c_long = 123; ++pub const SYS_adjtimex: c_long = 124; ++pub const SYS_mprotect: c_long = 125; ++pub const SYS_sigprocmask: c_long = 126; ++pub const SYS_create_module: c_long = 127; ++pub const SYS_init_module: c_long = 128; ++pub const SYS_delete_module: c_long = 129; ++pub const SYS_get_kernel_syms: c_long = 130; ++pub const SYS_quotactl: c_long = 131; ++pub const SYS_getpgid: c_long = 132; ++pub const SYS_fchdir: c_long = 133; ++pub const SYS_bdflush: c_long = 134; ++pub const SYS_sysfs: c_long = 135; ++pub const SYS_personality: c_long = 136; ++pub const SYS_afs_syscall: c_long = 137; ++pub const SYS_setfsuid: c_long = 138; ++pub const SYS_setfsgid: c_long = 139; ++pub const SYS__llseek: c_long = 140; ++pub const SYS_getdents: c_long = 141; ++pub const SYS__newselect: c_long = 142; ++pub const SYS_flock: c_long = 143; ++pub const SYS_msync: c_long = 144; ++pub const SYS_readv: c_long = 145; ++pub const SYS_writev: c_long = 146; ++pub const SYS_getsid: c_long = 147; ++pub const SYS_fdatasync: c_long = 148; ++pub const SYS__sysctl: c_long = 149; ++pub const SYS_mlock: c_long = 150; ++pub const SYS_munlock: c_long = 151; ++pub const SYS_mlockall: c_long = 152; ++pub const SYS_munlockall: c_long = 153; ++pub const SYS_sched_setparam: c_long = 154; ++pub const SYS_sched_getparam: c_long = 155; ++pub const SYS_sched_setscheduler: c_long = 156; ++pub const SYS_sched_getscheduler: c_long = 157; ++pub const SYS_sched_yield: c_long = 158; ++pub const SYS_sched_get_priority_max: c_long = 159; ++pub const SYS_sched_get_priority_min: c_long = 160; ++pub const SYS_sched_rr_get_interval: c_long = 161; ++pub const SYS_nanosleep: c_long = 162; ++pub const SYS_mremap: c_long = 163; ++pub const SYS_setresuid: c_long = 164; ++pub const SYS_getresuid: c_long = 165; ++pub const SYS_vm86: c_long = 166; ++pub const SYS_query_module: c_long = 167; ++pub const SYS_poll: c_long = 168; ++pub const SYS_nfsservctl: c_long = 169; ++pub const SYS_setresgid: c_long = 170; ++pub const SYS_getresgid: c_long = 171; ++pub const SYS_prctl: c_long = 172; ++pub const SYS_rt_sigreturn: c_long = 173; ++pub const SYS_rt_sigaction: c_long = 174; ++pub const SYS_rt_sigprocmask: c_long = 175; ++pub const SYS_rt_sigpending: c_long = 176; ++pub const SYS_rt_sigtimedwait: c_long = 177; ++pub const SYS_rt_sigqueueinfo: c_long = 178; ++pub const SYS_rt_sigsuspend: c_long = 179; ++pub const SYS_pread64: c_long = 180; ++pub const SYS_pwrite64: c_long = 181; ++pub const SYS_chown: c_long = 182; ++pub const SYS_getcwd: c_long = 183; ++pub const SYS_capget: c_long = 184; ++pub const SYS_capset: c_long = 185; ++pub const SYS_sigaltstack: c_long = 186; ++pub const SYS_sendfile: c_long = 187; ++pub const SYS_getpmsg: c_long = 188; ++pub const SYS_putpmsg: c_long = 189; ++pub const SYS_vfork: c_long = 190; ++pub const SYS_ugetrlimit: c_long = 191; ++pub const SYS_mmap2: c_long = 192; ++pub const SYS_truncate64: c_long = 193; ++pub const SYS_ftruncate64: c_long = 194; ++pub const SYS_stat64: c_long = 195; ++pub const SYS_lstat64: c_long = 196; ++pub const SYS_fstat64: c_long = 197; ++pub const SYS_lchown32: c_long = 198; ++pub const SYS_getuid32: c_long = 199; ++pub const SYS_getgid32: c_long = 200; ++pub const SYS_geteuid32: c_long = 201; ++pub const SYS_getegid32: c_long = 202; ++pub const SYS_setreuid32: c_long = 203; ++pub const SYS_setregid32: c_long = 204; ++pub const SYS_getgroups32: c_long = 205; ++pub const SYS_setgroups32: c_long = 206; ++pub const SYS_fchown32: c_long = 207; ++pub const SYS_setresuid32: c_long = 208; ++pub const SYS_getresuid32: c_long = 209; ++pub const SYS_setresgid32: c_long = 210; ++pub const SYS_getresgid32: c_long = 211; ++pub const SYS_chown32: c_long = 212; ++pub const SYS_setuid32: c_long = 213; ++pub const SYS_setgid32: c_long = 214; ++pub const SYS_setfsuid32: c_long = 215; ++pub const SYS_setfsgid32: c_long = 216; ++pub const SYS_pivot_root: c_long = 217; ++pub const SYS_mincore: c_long = 218; ++pub const SYS_madvise: c_long = 219; ++pub const SYS_getdents64: c_long = 220; ++pub const SYS_fcntl64: c_long = 221; ++pub const SYS_gettid: c_long = 224; ++pub const SYS_readahead: c_long = 225; ++pub const SYS_setxattr: c_long = 226; ++pub const SYS_lsetxattr: c_long = 227; ++pub const SYS_fsetxattr: c_long = 228; ++pub const SYS_getxattr: c_long = 229; ++pub const SYS_lgetxattr: c_long = 230; ++pub const SYS_fgetxattr: c_long = 231; ++pub const SYS_listxattr: c_long = 232; ++pub const SYS_llistxattr: c_long = 233; ++pub const SYS_flistxattr: c_long = 234; ++pub const SYS_removexattr: c_long = 235; ++pub const SYS_lremovexattr: c_long = 236; ++pub const SYS_fremovexattr: c_long = 237; ++pub const SYS_tkill: c_long = 238; ++pub const SYS_sendfile64: c_long = 239; ++pub const SYS_futex: c_long = 240; ++pub const SYS_sched_setaffinity: c_long = 241; ++pub const SYS_sched_getaffinity: c_long = 242; ++pub const SYS_set_thread_area: c_long = 243; ++pub const SYS_get_thread_area: c_long = 244; ++pub const SYS_io_setup: c_long = 245; ++pub const SYS_io_destroy: c_long = 246; ++pub const SYS_io_getevents: c_long = 247; ++pub const SYS_io_submit: c_long = 248; ++pub const SYS_io_cancel: c_long = 249; ++pub const SYS_fadvise64: c_long = 250; ++pub const SYS_exit_group: c_long = 252; ++pub const SYS_lookup_dcookie: c_long = 253; ++pub const SYS_epoll_create: c_long = 254; ++pub const SYS_epoll_ctl: c_long = 255; ++pub const SYS_epoll_wait: c_long = 256; ++pub const SYS_remap_file_pages: c_long = 257; ++pub const SYS_set_tid_address: c_long = 258; ++pub const SYS_timer_create: c_long = 259; ++pub const SYS_timer_settime: c_long = 260; ++pub const SYS_timer_gettime: c_long = 261; ++pub const SYS_timer_getoverrun: c_long = 262; ++pub const SYS_timer_delete: c_long = 263; ++pub const SYS_clock_settime: c_long = 264; ++pub const SYS_clock_gettime: c_long = 265; ++pub const SYS_clock_getres: c_long = 266; ++pub const SYS_clock_nanosleep: c_long = 267; ++pub const SYS_statfs64: c_long = 268; ++pub const SYS_fstatfs64: c_long = 269; ++pub const SYS_tgkill: c_long = 270; ++pub const SYS_utimes: c_long = 271; ++pub const SYS_fadvise64_64: c_long = 272; ++pub const SYS_vserver: c_long = 273; ++pub const SYS_mbind: c_long = 274; ++pub const SYS_get_mempolicy: c_long = 275; ++pub const SYS_set_mempolicy: c_long = 276; ++pub const SYS_mq_open: c_long = 277; ++pub const SYS_mq_unlink: c_long = 278; ++pub const SYS_mq_timedsend: c_long = 279; ++pub const SYS_mq_timedreceive: c_long = 280; ++pub const SYS_mq_notify: c_long = 281; ++pub const SYS_mq_getsetattr: c_long = 282; ++pub const SYS_kexec_load: c_long = 283; ++pub const SYS_waitid: c_long = 284; ++pub const SYS_add_key: c_long = 286; ++pub const SYS_request_key: c_long = 287; ++pub const SYS_keyctl: c_long = 288; ++pub const SYS_ioprio_set: c_long = 289; ++pub const SYS_ioprio_get: c_long = 290; ++pub const SYS_inotify_init: c_long = 291; ++pub const SYS_inotify_add_watch: c_long = 292; ++pub const SYS_inotify_rm_watch: c_long = 293; ++pub const SYS_migrate_pages: c_long = 294; ++pub const SYS_openat: c_long = 295; ++pub const SYS_mkdirat: c_long = 296; ++pub const SYS_mknodat: c_long = 297; ++pub const SYS_fchownat: c_long = 298; ++pub const SYS_futimesat: c_long = 299; ++pub const SYS_fstatat64: c_long = 300; ++pub const SYS_unlinkat: c_long = 301; ++pub const SYS_renameat: c_long = 302; ++pub const SYS_linkat: c_long = 303; ++pub const SYS_symlinkat: c_long = 304; ++pub const SYS_readlinkat: c_long = 305; ++pub const SYS_fchmodat: c_long = 306; ++pub const SYS_faccessat: c_long = 307; ++pub const SYS_pselect6: c_long = 308; ++pub const SYS_ppoll: c_long = 309; ++pub const SYS_unshare: c_long = 310; ++pub const SYS_set_robust_list: c_long = 311; ++pub const SYS_get_robust_list: c_long = 312; ++pub const SYS_splice: c_long = 313; ++pub const SYS_sync_file_range: c_long = 314; ++pub const SYS_tee: c_long = 315; ++pub const SYS_vmsplice: c_long = 316; ++pub const SYS_move_pages: c_long = 317; ++pub const SYS_getcpu: c_long = 318; ++pub const SYS_epoll_pwait: c_long = 319; ++pub const SYS_utimensat: c_long = 320; ++pub const SYS_signalfd: c_long = 321; ++pub const SYS_timerfd_create: c_long = 322; ++pub const SYS_eventfd: c_long = 323; ++pub const SYS_fallocate: c_long = 324; ++pub const SYS_timerfd_settime: c_long = 325; ++pub const SYS_timerfd_gettime: c_long = 326; ++pub const SYS_signalfd4: c_long = 327; ++pub const SYS_eventfd2: c_long = 328; ++pub const SYS_epoll_create1: c_long = 329; ++pub const SYS_dup3: c_long = 330; ++pub const SYS_pipe2: c_long = 331; ++pub const SYS_inotify_init1: c_long = 332; ++pub const SYS_preadv: c_long = 333; ++pub const SYS_pwritev: c_long = 334; ++pub const SYS_rt_tgsigqueueinfo: c_long = 335; ++pub const SYS_perf_event_open: c_long = 336; ++pub const SYS_recvmmsg: c_long = 337; ++pub const SYS_fanotify_init: c_long = 338; ++pub const SYS_fanotify_mark: c_long = 339; ++pub const SYS_prlimit64: c_long = 340; ++pub const SYS_name_to_handle_at: c_long = 341; ++pub const SYS_open_by_handle_at: c_long = 342; ++pub const SYS_clock_adjtime: c_long = 343; ++pub const SYS_syncfs: c_long = 344; ++pub const SYS_sendmmsg: c_long = 345; ++pub const SYS_setns: c_long = 346; ++pub const SYS_process_vm_readv: c_long = 347; ++pub const SYS_process_vm_writev: c_long = 348; ++pub const SYS_kcmp: c_long = 349; ++pub const SYS_finit_module: c_long = 350; ++pub const SYS_sched_setattr: c_long = 351; ++pub const SYS_sched_getattr: c_long = 352; ++pub const SYS_renameat2: c_long = 353; ++pub const SYS_seccomp: c_long = 354; ++pub const SYS_getrandom: c_long = 355; ++pub const SYS_memfd_create: c_long = 356; ++pub const SYS_bpf: c_long = 357; ++pub const SYS_execveat: c_long = 358; ++pub const SYS_socket: c_long = 359; ++pub const SYS_socketpair: c_long = 360; ++pub const SYS_bind: c_long = 361; ++pub const SYS_connect: c_long = 362; ++pub const SYS_listen: c_long = 363; ++pub const SYS_accept4: c_long = 364; ++pub const SYS_getsockopt: c_long = 365; ++pub const SYS_setsockopt: c_long = 366; ++pub const SYS_getsockname: c_long = 367; ++pub const SYS_getpeername: c_long = 368; ++pub const SYS_sendto: c_long = 369; ++pub const SYS_sendmsg: c_long = 370; ++pub const SYS_recvfrom: c_long = 371; ++pub const SYS_recvmsg: c_long = 372; ++pub const SYS_shutdown: c_long = 373; ++pub const SYS_userfaultfd: c_long = 374; ++pub const SYS_membarrier: c_long = 375; ++pub const SYS_mlock2: c_long = 376; ++pub const SYS_copy_file_range: c_long = 377; ++pub const SYS_preadv2: c_long = 378; ++pub const SYS_pwritev2: c_long = 379; ++pub const SYS_pkey_mprotect: c_long = 380; ++pub const SYS_pkey_alloc: c_long = 381; ++pub const SYS_pkey_free: c_long = 382; ++pub const SYS_statx: c_long = 383; ++pub const SYS_rseq: c_long = 386; ++pub const SYS_pidfd_send_signal: c_long = 424; ++pub const SYS_io_uring_setup: c_long = 425; ++pub const SYS_io_uring_enter: c_long = 426; ++pub const SYS_io_uring_register: c_long = 427; ++pub const SYS_open_tree: c_long = 428; ++pub const SYS_move_mount: c_long = 429; ++pub const SYS_fsopen: c_long = 430; ++pub const SYS_fsconfig: c_long = 431; ++pub const SYS_fsmount: c_long = 432; ++pub const SYS_fspick: c_long = 433; ++pub const SYS_pidfd_open: c_long = 434; ++pub const SYS_clone3: c_long = 435; ++pub const SYS_close_range: c_long = 436; ++pub const SYS_openat2: c_long = 437; ++pub const SYS_pidfd_getfd: c_long = 438; ++pub const SYS_faccessat2: c_long = 439; ++pub const SYS_process_madvise: c_long = 440; ++pub const SYS_epoll_pwait2: c_long = 441; ++pub const SYS_mount_setattr: c_long = 442; ++pub const SYS_quotactl_fd: c_long = 443; ++pub const SYS_landlock_create_ruleset: c_long = 444; ++pub const SYS_landlock_add_rule: c_long = 445; ++pub const SYS_landlock_restrict_self: c_long = 446; ++pub const SYS_memfd_secret: c_long = 447; ++pub const SYS_process_mrelease: c_long = 448; ++pub const SYS_futex_waitv: c_long = 449; ++pub const SYS_set_mempolicy_home_node: c_long = 450; ++pub const SYS_fchmodat2: c_long = 452; ++pub const SYS_mseal: c_long = 462; ++ ++// offsets in user_regs_structs, from sys/reg.h ++pub const EBX: c_int = 0; ++pub const ECX: c_int = 1; ++pub const EDX: c_int = 2; ++pub const ESI: c_int = 3; ++pub const EDI: c_int = 4; ++pub const EBP: c_int = 5; ++pub const EAX: c_int = 6; ++pub const DS: c_int = 7; ++pub const ES: c_int = 8; ++pub const FS: c_int = 9; ++pub const GS: c_int = 10; ++pub const ORIG_EAX: c_int = 11; ++pub const EIP: c_int = 12; ++pub const CS: c_int = 13; ++pub const EFL: c_int = 14; ++pub const UESP: c_int = 15; ++pub const SS: c_int = 16; ++ ++// offsets in mcontext_t.gregs from sys/ucontext.h ++pub const REG_GS: c_int = 0; ++pub const REG_FS: c_int = 1; ++pub const REG_ES: c_int = 2; ++pub const REG_DS: c_int = 3; ++pub const REG_EDI: c_int = 4; ++pub const REG_ESI: c_int = 5; ++pub const REG_EBP: c_int = 6; ++pub const REG_ESP: c_int = 7; ++pub const REG_EBX: c_int = 8; ++pub const REG_EDX: c_int = 9; ++pub const REG_ECX: c_int = 10; ++pub const REG_EAX: c_int = 11; ++pub const REG_TRAPNO: c_int = 12; ++pub const REG_ERR: c_int = 13; ++pub const REG_EIP: c_int = 14; ++pub const REG_CS: c_int = 15; ++pub const REG_EFL: c_int = 16; ++pub const REG_UESP: c_int = 17; ++pub const REG_SS: c_int = 18; ++ ++extern "C" { ++ pub fn getcontext(ucp: *mut ucontext_t) -> c_int; ++ pub fn setcontext(ucp: *const ucontext_t) -> c_int; ++ pub fn makecontext(ucp: *mut ucontext_t, func: extern "C" fn(), argc: c_int, ...); ++ pub fn swapcontext(uocp: *mut ucontext_t, ucp: *const ucontext_t) -> c_int; ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/aarch64/ilp32.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,56 @@ ++use crate::pthread_mutex_t; ++ ++pub type c_long = i32; ++pub type c_ulong = u32; ++ ++pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; ++pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 32; ++pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; ++pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 48; ++pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4; ++pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 20; ++ ++#[cfg(target_endian = "little")] ++pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, ++ ], ++}; ++#[cfg(target_endian = "little")] ++pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, ++ ], ++}; ++#[cfg(target_endian = "little")] ++pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, ++ ], ++}; ++#[cfg(target_endian = "big")] ++pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, ++ ], ++}; ++#[cfg(target_endian = "big")] ++pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, ++ ], ++}; ++#[cfg(target_endian = "big")] ++pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, ++ ], ++}; ++ ++pub const SYS_sync_file_range2: c_long = 84; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/aarch64/lp64.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,59 @@ ++use crate::pthread_mutex_t; ++ ++pub type c_long = i64; ++pub type c_ulong = u64; ++ ++pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 8; ++pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 48; ++pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 8; ++pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; ++pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 8; ++pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32; ++ ++#[cfg(target_endian = "little")] ++pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++}; ++#[cfg(target_endian = "little")] ++pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++}; ++#[cfg(target_endian = "little")] ++pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++}; ++#[cfg(target_endian = "big")] ++pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++}; ++#[cfg(target_endian = "big")] ++pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++}; ++#[cfg(target_endian = "big")] ++pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++}; ++ ++pub const SYS_renameat: c_long = 38; ++pub const SYS_sync_file_range: c_long = 84; ++pub const SYS_getrlimit: c_long = 163; ++pub const SYS_setrlimit: c_long = 164; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/aarch64/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,973 @@ ++//! AArch64-specific definitions for 64-bit linux-like values ++ ++use crate::prelude::*; ++use crate::{off64_t, off_t}; ++ ++pub type c_char = u8; ++pub type wchar_t = u32; ++pub type nlink_t = u32; ++pub type blksize_t = i32; ++pub type suseconds_t = i64; ++pub type __u64 = c_ulonglong; ++pub type __s64 = c_longlong; ++ ++s! { ++ pub struct sigaction { ++ pub sa_sigaction: crate::sighandler_t, ++ pub sa_mask: crate::sigset_t, ++ #[cfg(target_arch = "sparc64")] ++ __reserved0: c_int, ++ pub sa_flags: c_int, ++ pub sa_restorer: Option, ++ } ++ ++ pub struct statfs { ++ pub f_type: crate::__fsword_t, ++ pub f_bsize: crate::__fsword_t, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_fsid: crate::fsid_t, ++ ++ pub f_namelen: crate::__fsword_t, ++ pub f_frsize: crate::__fsword_t, ++ f_spare: [crate::__fsword_t; 5], ++ } ++ ++ pub struct flock { ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ pub l_start: off_t, ++ pub l_len: off_t, ++ pub l_pid: crate::pid_t, ++ } ++ ++ pub struct flock64 { ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ pub l_start: off64_t, ++ pub l_len: off64_t, ++ pub l_pid: crate::pid_t, ++ } ++ ++ pub struct stat { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ __pad1: crate::dev_t, ++ pub st_size: off_t, ++ pub st_blksize: crate::blksize_t, ++ __pad2: c_int, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ __unused: [c_int; 2], ++ } ++ ++ pub struct stat64 { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ __pad1: crate::dev_t, ++ pub st_size: off64_t, ++ pub st_blksize: crate::blksize_t, ++ __pad2: c_int, ++ pub st_blocks: crate::blkcnt64_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ __unused: [c_int; 2], ++ } ++ ++ pub struct statfs64 { ++ pub f_type: crate::__fsword_t, ++ pub f_bsize: crate::__fsword_t, ++ pub f_blocks: u64, ++ pub f_bfree: u64, ++ pub f_bavail: u64, ++ pub f_files: u64, ++ pub f_ffree: u64, ++ pub f_fsid: crate::fsid_t, ++ pub f_namelen: crate::__fsword_t, ++ pub f_frsize: crate::__fsword_t, ++ pub f_flags: crate::__fsword_t, ++ pub f_spare: [crate::__fsword_t; 4], ++ } ++ ++ pub struct statvfs { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_favail: crate::fsfilcnt_t, ++ pub f_fsid: c_ulong, ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ __f_spare: [c_int; 6], ++ } ++ ++ pub struct statvfs64 { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: u64, ++ pub f_bfree: u64, ++ pub f_bavail: u64, ++ pub f_files: u64, ++ pub f_ffree: u64, ++ pub f_favail: u64, ++ pub f_fsid: c_ulong, ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ __f_spare: [c_int; 6], ++ } ++ ++ pub struct pthread_attr_t { ++ __size: [usize; 8], ++ } ++ ++ pub struct user_regs_struct { ++ pub regs: [c_ulonglong; 31], ++ pub sp: c_ulonglong, ++ pub pc: c_ulonglong, ++ pub pstate: c_ulonglong, ++ } ++ ++ pub struct ipc_perm { ++ pub __key: crate::key_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub cuid: crate::uid_t, ++ pub cgid: crate::gid_t, ++ pub mode: c_uint, ++ pub __seq: c_ushort, ++ __pad1: c_ushort, ++ __unused1: c_ulong, ++ __unused2: c_ulong, ++ } ++ ++ pub struct shmid_ds { ++ pub shm_perm: crate::ipc_perm, ++ pub shm_segsz: size_t, ++ pub shm_atime: crate::time_t, ++ pub shm_dtime: crate::time_t, ++ pub shm_ctime: crate::time_t, ++ pub shm_cpid: crate::pid_t, ++ pub shm_lpid: crate::pid_t, ++ pub shm_nattch: crate::shmatt_t, ++ __unused4: c_ulong, ++ __unused5: c_ulong, ++ } ++ ++ pub struct siginfo_t { ++ pub si_signo: c_int, ++ pub si_errno: c_int, ++ pub si_code: c_int, ++ #[doc(hidden)] ++ #[deprecated( ++ since = "0.2.54", ++ note = "Please leave a comment on \ ++ https://github.com/rust-lang/libc/pull/1316 if you're using \ ++ this field" ++ )] ++ pub _pad: [c_int; 29], ++ _align: [usize; 0], ++ } ++ ++ pub struct stack_t { ++ pub ss_sp: *mut c_void, ++ pub ss_flags: c_int, ++ pub ss_size: size_t, ++ } ++ ++ pub struct ucontext_t { ++ pub uc_flags: c_ulong, ++ pub uc_link: *mut ucontext_t, ++ pub uc_stack: crate::stack_t, ++ pub uc_sigmask: crate::sigset_t, ++ pub uc_mcontext: mcontext_t, ++ } ++ ++ #[repr(align(16))] ++ pub struct mcontext_t { ++ pub fault_address: c_ulonglong, ++ pub regs: [c_ulonglong; 31], ++ pub sp: c_ulonglong, ++ pub pc: c_ulonglong, ++ pub pstate: c_ulonglong, ++ __reserved: [u64; 512], ++ } ++ ++ pub struct user_fpsimd_struct { ++ pub vregs: [crate::__uint128_t; 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, ++ } ++} ++ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ #[repr(align(16))] ++ pub struct max_align_t { ++ priv_: [f32; 8], ++ } ++} ++ ++pub const VEOF: usize = 4; ++ ++pub const RTLD_DEEPBIND: c_int = 0x8; ++pub const RTLD_GLOBAL: c_int = 0x100; ++pub const RTLD_NOLOAD: c_int = 0x4; ++ ++pub const O_APPEND: c_int = 1024; ++pub const O_CREAT: c_int = 64; ++pub const O_EXCL: c_int = 128; ++pub const O_NOCTTY: c_int = 256; ++pub const O_NONBLOCK: c_int = 2048; ++pub const O_SYNC: c_int = 1052672; ++pub const O_RSYNC: c_int = 1052672; ++pub const O_DSYNC: c_int = 4096; ++pub const O_FSYNC: c_int = 0x101000; ++pub const O_NOATIME: c_int = 0o1000000; ++pub const O_PATH: c_int = 0o10000000; ++pub const O_TMPFILE: c_int = 0o20000000 | O_DIRECTORY; ++ ++pub const MADV_SOFT_OFFLINE: c_int = 101; ++pub const MAP_GROWSDOWN: c_int = 0x0100; ++ ++pub const EUCLEAN: c_int = 117; ++pub const ENOTNAM: c_int = 118; ++pub const ENAVAIL: c_int = 119; ++pub const EISNAM: c_int = 120; ++pub const EREMOTEIO: c_int = 121; ++pub const EDEADLK: c_int = 35; ++pub const ENAMETOOLONG: c_int = 36; ++pub const ENOLCK: c_int = 37; ++pub const ENOSYS: c_int = 38; ++pub const ENOTEMPTY: c_int = 39; ++pub const ELOOP: c_int = 40; ++pub const ENOMSG: c_int = 42; ++pub const EIDRM: c_int = 43; ++pub const ECHRNG: c_int = 44; ++pub const EL2NSYNC: c_int = 45; ++pub const EL3HLT: c_int = 46; ++pub const EL3RST: c_int = 47; ++pub const ELNRNG: c_int = 48; ++pub const EUNATCH: c_int = 49; ++pub const ENOCSI: c_int = 50; ++pub const EL2HLT: c_int = 51; ++pub const EBADE: c_int = 52; ++pub const EBADR: c_int = 53; ++pub const EXFULL: c_int = 54; ++pub const ENOANO: c_int = 55; ++pub const EBADRQC: c_int = 56; ++pub const EBADSLT: c_int = 57; ++pub const EMULTIHOP: c_int = 72; ++pub const EOVERFLOW: c_int = 75; ++pub const ENOTUNIQ: c_int = 76; ++pub const EBADFD: c_int = 77; ++pub const EBADMSG: c_int = 74; ++pub const EREMCHG: c_int = 78; ++pub const ELIBACC: c_int = 79; ++pub const ELIBBAD: c_int = 80; ++pub const ELIBSCN: c_int = 81; ++pub const ELIBMAX: c_int = 82; ++pub const ELIBEXEC: c_int = 83; ++pub const EILSEQ: c_int = 84; ++pub const ERESTART: c_int = 85; ++pub const ESTRPIPE: c_int = 86; ++pub const EUSERS: c_int = 87; ++pub const ENOTSOCK: c_int = 88; ++pub const EDESTADDRREQ: c_int = 89; ++pub const EMSGSIZE: c_int = 90; ++pub const EPROTOTYPE: c_int = 91; ++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 EPFNOSUPPORT: c_int = 96; ++pub const EAFNOSUPPORT: c_int = 97; ++pub const EADDRINUSE: c_int = 98; ++pub const EADDRNOTAVAIL: c_int = 99; ++pub const ENETDOWN: c_int = 100; ++pub const ENETUNREACH: c_int = 101; ++pub const ENETRESET: c_int = 102; ++pub const ECONNABORTED: c_int = 103; ++pub const ECONNRESET: c_int = 104; ++pub const ENOBUFS: c_int = 105; ++pub const EISCONN: c_int = 106; ++pub const ENOTCONN: c_int = 107; ++pub const ESHUTDOWN: c_int = 108; ++pub const ETOOMANYREFS: c_int = 109; ++pub const ETIMEDOUT: c_int = 110; ++pub const ECONNREFUSED: c_int = 111; ++pub const EHOSTDOWN: c_int = 112; ++pub const EHOSTUNREACH: c_int = 113; ++pub const EALREADY: c_int = 114; ++pub const EINPROGRESS: c_int = 115; ++pub const ESTALE: c_int = 116; ++pub const EDQUOT: c_int = 122; ++pub const ENOMEDIUM: c_int = 123; ++pub const EMEDIUMTYPE: c_int = 124; ++pub const ECANCELED: c_int = 125; ++pub const ENOKEY: c_int = 126; ++pub const EKEYEXPIRED: c_int = 127; ++pub const EKEYREVOKED: c_int = 128; ++pub const EKEYREJECTED: c_int = 129; ++pub const EOWNERDEAD: c_int = 130; ++pub const ENOTRECOVERABLE: c_int = 131; ++pub const EHWPOISON: c_int = 133; ++pub const ERFKILL: c_int = 132; ++ ++pub const POSIX_FADV_DONTNEED: c_int = 4; ++pub const POSIX_FADV_NOREUSE: c_int = 5; ++ ++pub const SOCK_STREAM: c_int = 1; ++pub const SOCK_DGRAM: c_int = 2; ++ ++pub const SA_ONSTACK: c_int = 0x08000000; ++pub const SA_SIGINFO: c_int = 0x00000004; ++pub const SA_NOCLDWAIT: c_int = 0x00000002; ++ ++pub const SIGTTIN: c_int = 21; ++pub const SIGTTOU: c_int = 22; ++pub const SIGXCPU: c_int = 24; ++pub const SIGXFSZ: c_int = 25; ++pub const SIGVTALRM: c_int = 26; ++pub const SIGPROF: c_int = 27; ++pub const SIGWINCH: c_int = 28; ++pub const SIGCHLD: c_int = 17; ++pub const SIGBUS: c_int = 7; ++pub const SIGUSR1: c_int = 10; ++pub const SIGUSR2: c_int = 12; ++pub const SIGCONT: c_int = 18; ++pub const SIGSTOP: c_int = 19; ++pub const SIGTSTP: c_int = 20; ++pub const SIGURG: c_int = 23; ++pub const SIGIO: c_int = 29; ++pub const SIGSYS: c_int = 31; ++pub const SIGSTKFLT: c_int = 16; ++#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")] ++pub const SIGUNUSED: c_int = 31; ++pub const SIGPOLL: c_int = 29; ++pub const SIGPWR: c_int = 30; ++pub const SIG_SETMASK: c_int = 2; ++pub const SIG_BLOCK: c_int = 0x000000; ++pub const SIG_UNBLOCK: c_int = 0x01; ++ ++pub const POLLWRNORM: c_short = 0x100; ++pub const POLLWRBAND: c_short = 0x200; ++ ++pub const O_ASYNC: c_int = 0x2000; ++pub const O_NDELAY: c_int = 0x800; ++ ++pub const PTRACE_DETACH: c_uint = 17; ++ ++pub const EFD_NONBLOCK: c_int = 0x800; ++ ++pub const F_GETLK: c_int = 5; ++pub const F_GETOWN: c_int = 9; ++pub const F_SETOWN: c_int = 8; ++pub const F_SETLK: c_int = 6; ++pub const F_SETLKW: c_int = 7; ++pub const F_OFD_GETLK: c_int = 36; ++pub const F_OFD_SETLK: c_int = 37; ++pub const F_OFD_SETLKW: c_int = 38; ++ ++pub const F_RDLCK: c_int = 0; ++pub const F_WRLCK: c_int = 1; ++pub const F_UNLCK: c_int = 2; ++ ++pub const SFD_NONBLOCK: c_int = 0x0800; ++ ++pub const SFD_CLOEXEC: c_int = 0x080000; ++ ++pub const NCCS: usize = 32; ++ ++pub const O_TRUNC: c_int = 512; ++ ++pub const O_CLOEXEC: c_int = 0x80000; ++ ++pub const EBFONT: c_int = 59; ++pub const ENOSTR: c_int = 60; ++pub const ENODATA: c_int = 61; ++pub const ETIME: c_int = 62; ++pub const ENOSR: c_int = 63; ++pub const ENONET: c_int = 64; ++pub const ENOPKG: c_int = 65; ++pub const EREMOTE: c_int = 66; ++pub const ENOLINK: c_int = 67; ++pub const EADV: c_int = 68; ++pub const ESRMNT: c_int = 69; ++pub const ECOMM: c_int = 70; ++pub const EPROTO: c_int = 71; ++pub const EDOTDOT: c_int = 73; ++ ++pub const SA_NODEFER: c_int = 0x40000000; ++pub const SA_RESETHAND: c_int = 0x80000000; ++pub const SA_RESTART: c_int = 0x10000000; ++pub const SA_NOCLDSTOP: c_int = 0x00000001; ++ ++pub const EPOLL_CLOEXEC: c_int = 0x80000; ++ ++pub const EFD_CLOEXEC: c_int = 0x80000; ++ ++pub const O_DIRECT: c_int = 0x10000; ++pub const O_DIRECTORY: c_int = 0x4000; ++pub const O_NOFOLLOW: c_int = 0x8000; ++ ++pub const MAP_LOCKED: c_int = 0x02000; ++pub const MAP_NORESERVE: c_int = 0x04000; ++pub const MAP_ANON: c_int = 0x0020; ++pub const MAP_ANONYMOUS: c_int = 0x0020; ++pub const MAP_DENYWRITE: c_int = 0x0800; ++pub const MAP_EXECUTABLE: c_int = 0x01000; ++pub const MAP_POPULATE: c_int = 0x08000; ++pub const MAP_NONBLOCK: c_int = 0x010000; ++pub const MAP_STACK: c_int = 0x020000; ++pub const MAP_HUGETLB: c_int = 0x040000; ++pub const MAP_SYNC: c_int = 0x080000; ++ ++pub const EDEADLOCK: c_int = 35; ++ ++pub const MCL_CURRENT: c_int = 0x0001; ++pub const MCL_FUTURE: c_int = 0x0002; ++pub const MCL_ONFAULT: c_int = 0x0004; ++ ++pub const SIGSTKSZ: size_t = 16384; ++pub const MINSIGSTKSZ: size_t = 5120; ++pub const CBAUD: crate::tcflag_t = 0o0010017; ++pub const TAB1: crate::tcflag_t = 0x00000800; ++pub const TAB2: crate::tcflag_t = 0x00001000; ++pub const TAB3: crate::tcflag_t = 0x00001800; ++pub const CR1: crate::tcflag_t = 0x00000200; ++pub const CR2: crate::tcflag_t = 0x00000400; ++pub const CR3: crate::tcflag_t = 0x00000600; ++pub const FF1: crate::tcflag_t = 0x00008000; ++pub const BS1: crate::tcflag_t = 0x00002000; ++pub const VT1: crate::tcflag_t = 0x00004000; ++pub const VWERASE: usize = 14; ++pub const VREPRINT: usize = 12; ++pub const VSUSP: usize = 10; ++pub const VSTART: usize = 8; ++pub const VSTOP: usize = 9; ++pub const VDISCARD: usize = 13; ++pub const VTIME: usize = 5; ++pub const IXON: crate::tcflag_t = 0x00000400; ++pub const IXOFF: crate::tcflag_t = 0x00001000; ++pub const ONLCR: crate::tcflag_t = 0x4; ++pub const CSIZE: crate::tcflag_t = 0x00000030; ++pub const CS6: crate::tcflag_t = 0x00000010; ++pub const CS7: crate::tcflag_t = 0x00000020; ++pub const CS8: crate::tcflag_t = 0x00000030; ++pub const CSTOPB: crate::tcflag_t = 0x00000040; ++pub const CREAD: crate::tcflag_t = 0x00000080; ++pub const PARENB: crate::tcflag_t = 0x00000100; ++pub const PARODD: crate::tcflag_t = 0x00000200; ++pub const HUPCL: crate::tcflag_t = 0x00000400; ++pub const CLOCAL: crate::tcflag_t = 0x00000800; ++pub const ECHOKE: crate::tcflag_t = 0x00000800; ++pub const ECHOE: crate::tcflag_t = 0x00000010; ++pub const ECHOK: crate::tcflag_t = 0x00000020; ++pub const ECHONL: crate::tcflag_t = 0x00000040; ++pub const ECHOPRT: crate::tcflag_t = 0x00000400; ++pub const ECHOCTL: crate::tcflag_t = 0x00000200; ++pub const ISIG: crate::tcflag_t = 0x00000001; ++pub const ICANON: crate::tcflag_t = 0x00000002; ++pub const PENDIN: crate::tcflag_t = 0x00004000; ++pub const NOFLSH: crate::tcflag_t = 0x00000080; ++pub const CIBAUD: crate::tcflag_t = 0o02003600000; ++pub const CBAUDEX: crate::tcflag_t = 0o010000; ++pub const VSWTC: usize = 7; ++pub const OLCUC: crate::tcflag_t = 0o000002; ++pub const NLDLY: crate::tcflag_t = 0o000400; ++pub const CRDLY: crate::tcflag_t = 0o003000; ++pub const TABDLY: crate::tcflag_t = 0o014000; ++pub const BSDLY: crate::tcflag_t = 0o020000; ++pub const FFDLY: crate::tcflag_t = 0o100000; ++pub const VTDLY: crate::tcflag_t = 0o040000; ++pub const XTABS: crate::tcflag_t = 0o014000; ++ ++pub const B0: crate::speed_t = 0o000000; ++pub const B50: crate::speed_t = 0o000001; ++pub const B75: crate::speed_t = 0o000002; ++pub const B110: crate::speed_t = 0o000003; ++pub const B134: crate::speed_t = 0o000004; ++pub const B150: crate::speed_t = 0o000005; ++pub const B200: crate::speed_t = 0o000006; ++pub const B300: crate::speed_t = 0o000007; ++pub const B600: crate::speed_t = 0o000010; ++pub const B1200: crate::speed_t = 0o000011; ++pub const B1800: crate::speed_t = 0o000012; ++pub const B2400: crate::speed_t = 0o000013; ++pub const B4800: crate::speed_t = 0o000014; ++pub const B9600: crate::speed_t = 0o000015; ++pub const B19200: crate::speed_t = 0o000016; ++pub const B38400: crate::speed_t = 0o000017; ++pub const EXTA: crate::speed_t = B19200; ++pub const EXTB: crate::speed_t = B38400; ++pub const B57600: crate::speed_t = 0o010001; ++pub const B115200: crate::speed_t = 0o010002; ++pub const B230400: crate::speed_t = 0o010003; ++pub const B460800: crate::speed_t = 0o010004; ++pub const B500000: crate::speed_t = 0o010005; ++pub const B576000: crate::speed_t = 0o010006; ++pub const B921600: crate::speed_t = 0o010007; ++pub const B1000000: crate::speed_t = 0o010010; ++pub const B1152000: crate::speed_t = 0o010011; ++pub const B1500000: crate::speed_t = 0o010012; ++pub const B2000000: crate::speed_t = 0o010013; ++pub const B2500000: crate::speed_t = 0o010014; ++pub const B3000000: crate::speed_t = 0o010015; ++pub const B3500000: crate::speed_t = 0o010016; ++pub const B4000000: crate::speed_t = 0o010017; ++ ++pub const VEOL: usize = 11; ++pub const VEOL2: usize = 16; ++pub const VMIN: usize = 6; ++pub const IEXTEN: crate::tcflag_t = 0x00008000; ++pub const TOSTOP: crate::tcflag_t = 0x00000100; ++pub const FLUSHO: crate::tcflag_t = 0x00001000; ++pub const EXTPROC: crate::tcflag_t = 0x00010000; ++ ++pub const TCSANOW: c_int = 0; ++pub const TCSADRAIN: c_int = 1; ++pub const TCSAFLUSH: c_int = 2; ++ ++// sys/auxv.h ++pub const HWCAP_FP: c_ulong = 1 << 0; ++pub const HWCAP_ASIMD: c_ulong = 1 << 1; ++pub const HWCAP_EVTSTRM: c_ulong = 1 << 2; ++pub const HWCAP_AES: c_ulong = 1 << 3; ++pub const HWCAP_PMULL: c_ulong = 1 << 4; ++pub const HWCAP_SHA1: c_ulong = 1 << 5; ++pub const HWCAP_SHA2: c_ulong = 1 << 6; ++pub const HWCAP_CRC32: c_ulong = 1 << 7; ++pub const HWCAP_ATOMICS: c_ulong = 1 << 8; ++pub const HWCAP_FPHP: c_ulong = 1 << 9; ++pub const HWCAP_ASIMDHP: c_ulong = 1 << 10; ++pub const HWCAP_CPUID: c_ulong = 1 << 11; ++pub const HWCAP_ASIMDRDM: c_ulong = 1 << 12; ++pub const HWCAP_JSCVT: c_ulong = 1 << 13; ++pub const HWCAP_FCMA: c_ulong = 1 << 14; ++pub const HWCAP_LRCPC: c_ulong = 1 << 15; ++pub const HWCAP_DCPOP: c_ulong = 1 << 16; ++pub const HWCAP_SHA3: c_ulong = 1 << 17; ++pub const HWCAP_SM3: c_ulong = 1 << 18; ++pub const HWCAP_SM4: c_ulong = 1 << 19; ++pub const HWCAP_ASIMDDP: c_ulong = 1 << 20; ++pub const HWCAP_SHA512: c_ulong = 1 << 21; ++pub const HWCAP_SVE: c_ulong = 1 << 22; ++pub const HWCAP_ASIMDFHM: c_ulong = 1 << 23; ++pub const HWCAP_DIT: c_ulong = 1 << 24; ++pub const HWCAP_USCAT: c_ulong = 1 << 25; ++pub const HWCAP_ILRCPC: c_ulong = 1 << 26; ++pub const HWCAP_FLAGM: c_ulong = 1 << 27; ++pub const HWCAP_SSBS: c_ulong = 1 << 28; ++pub const HWCAP_SB: c_ulong = 1 << 29; ++pub const HWCAP_PACA: c_ulong = 1 << 30; ++pub const HWCAP_PACG: c_ulong = 1 << 31; ++// FIXME: enable these again once linux-api-headers are up to date enough on CI. ++// See discussion in https://github.com/rust-lang/libc/pull/1638 ++//pub const HWCAP2_DCPODP: c_ulong = 1 << 0; ++//pub const HWCAP2_SVE2: c_ulong = 1 << 1; ++//pub const HWCAP2_SVEAES: c_ulong = 1 << 2; ++//pub const HWCAP2_SVEPMULL: c_ulong = 1 << 3; ++//pub const HWCAP2_SVEBITPERM: c_ulong = 1 << 4; ++//pub const HWCAP2_SVESHA3: c_ulong = 1 << 5; ++//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; ++ ++pub const PR_SME_SET_VL: c_int = 63; ++pub const PR_SME_GET_VL: c_int = 64; ++pub const PR_SME_VL_LEN_MAX: c_int = 0xffff; ++ ++pub const PR_SME_SET_VL_INHERIT: c_ulong = 1 << 17; ++pub const PR_SME_SET_VL_ONE_EXEC: c_ulong = 1 << 18; ++ ++// Syscall table ++pub const SYS_io_setup: c_long = 0; ++pub const SYS_io_destroy: c_long = 1; ++pub const SYS_io_submit: c_long = 2; ++pub const SYS_io_cancel: c_long = 3; ++pub const SYS_io_getevents: c_long = 4; ++pub const SYS_setxattr: c_long = 5; ++pub const SYS_lsetxattr: c_long = 6; ++pub const SYS_fsetxattr: c_long = 7; ++pub const SYS_getxattr: c_long = 8; ++pub const SYS_lgetxattr: c_long = 9; ++pub const SYS_fgetxattr: c_long = 10; ++pub const SYS_listxattr: c_long = 11; ++pub const SYS_llistxattr: c_long = 12; ++pub const SYS_flistxattr: c_long = 13; ++pub const SYS_removexattr: c_long = 14; ++pub const SYS_lremovexattr: c_long = 15; ++pub const SYS_fremovexattr: c_long = 16; ++pub const SYS_getcwd: c_long = 17; ++pub const SYS_lookup_dcookie: c_long = 18; ++pub const SYS_eventfd2: c_long = 19; ++pub const SYS_epoll_create1: c_long = 20; ++pub const SYS_epoll_ctl: c_long = 21; ++pub const SYS_epoll_pwait: c_long = 22; ++pub const SYS_dup: c_long = 23; ++pub const SYS_dup3: c_long = 24; ++pub const SYS_fcntl: c_long = 25; ++pub const SYS_inotify_init1: c_long = 26; ++pub const SYS_inotify_add_watch: c_long = 27; ++pub const SYS_inotify_rm_watch: c_long = 28; ++pub const SYS_ioctl: c_long = 29; ++pub const SYS_ioprio_set: c_long = 30; ++pub const SYS_ioprio_get: c_long = 31; ++pub const SYS_flock: c_long = 32; ++pub const SYS_mknodat: c_long = 33; ++pub const SYS_mkdirat: c_long = 34; ++pub const SYS_unlinkat: c_long = 35; ++pub const SYS_symlinkat: c_long = 36; ++pub const SYS_linkat: c_long = 37; ++// 38 is renameat only on LP64 ++pub const SYS_umount2: c_long = 39; ++pub const SYS_mount: c_long = 40; ++pub const SYS_pivot_root: c_long = 41; ++pub const SYS_nfsservctl: c_long = 42; ++pub const SYS_statfs: c_long = 43; ++pub const SYS_fstatfs: c_long = 44; ++pub const SYS_truncate: c_long = 45; ++pub const SYS_ftruncate: c_long = 46; ++pub const SYS_fallocate: c_long = 47; ++pub const SYS_faccessat: c_long = 48; ++pub const SYS_chdir: c_long = 49; ++pub const SYS_fchdir: c_long = 50; ++pub const SYS_chroot: c_long = 51; ++pub const SYS_fchmod: c_long = 52; ++pub const SYS_fchmodat: c_long = 53; ++pub const SYS_fchownat: c_long = 54; ++pub const SYS_fchown: c_long = 55; ++pub const SYS_openat: c_long = 56; ++pub const SYS_close: c_long = 57; ++pub const SYS_vhangup: c_long = 58; ++pub const SYS_pipe2: c_long = 59; ++pub const SYS_quotactl: c_long = 60; ++pub const SYS_getdents64: c_long = 61; ++pub const SYS_lseek: c_long = 62; ++pub const SYS_read: c_long = 63; ++pub const SYS_write: c_long = 64; ++pub const SYS_readv: c_long = 65; ++pub const SYS_writev: c_long = 66; ++pub const SYS_pread64: c_long = 67; ++pub const SYS_pwrite64: c_long = 68; ++pub const SYS_preadv: c_long = 69; ++pub const SYS_pwritev: c_long = 70; ++pub const SYS_pselect6: c_long = 72; ++pub const SYS_ppoll: c_long = 73; ++pub const SYS_signalfd4: c_long = 74; ++pub const SYS_vmsplice: c_long = 75; ++pub const SYS_splice: c_long = 76; ++pub const SYS_tee: c_long = 77; ++pub const SYS_readlinkat: c_long = 78; ++pub const SYS_newfstatat: c_long = 79; ++pub const SYS_fstat: c_long = 80; ++pub const SYS_sync: c_long = 81; ++pub const SYS_fsync: c_long = 82; ++pub const SYS_fdatasync: c_long = 83; ++// 84 sync_file_range on LP64 and sync_file_range2 on ILP32 ++pub const SYS_timerfd_create: c_long = 85; ++pub const SYS_timerfd_settime: c_long = 86; ++pub const SYS_timerfd_gettime: c_long = 87; ++pub const SYS_utimensat: c_long = 88; ++pub const SYS_acct: c_long = 89; ++pub const SYS_capget: c_long = 90; ++pub const SYS_capset: c_long = 91; ++pub const SYS_personality: c_long = 92; ++pub const SYS_exit: c_long = 93; ++pub const SYS_exit_group: c_long = 94; ++pub const SYS_waitid: c_long = 95; ++pub const SYS_set_tid_address: c_long = 96; ++pub const SYS_unshare: c_long = 97; ++pub const SYS_futex: c_long = 98; ++pub const SYS_set_robust_list: c_long = 99; ++pub const SYS_get_robust_list: c_long = 100; ++pub const SYS_nanosleep: c_long = 101; ++pub const SYS_getitimer: c_long = 102; ++pub const SYS_setitimer: c_long = 103; ++pub const SYS_kexec_load: c_long = 104; ++pub const SYS_init_module: c_long = 105; ++pub const SYS_delete_module: c_long = 106; ++pub const SYS_timer_create: c_long = 107; ++pub const SYS_timer_gettime: c_long = 108; ++pub const SYS_timer_getoverrun: c_long = 109; ++pub const SYS_timer_settime: c_long = 110; ++pub const SYS_timer_delete: c_long = 111; ++pub const SYS_clock_settime: c_long = 112; ++pub const SYS_clock_gettime: c_long = 113; ++pub const SYS_clock_getres: c_long = 114; ++pub const SYS_clock_nanosleep: c_long = 115; ++pub const SYS_syslog: c_long = 116; ++pub const SYS_ptrace: c_long = 117; ++pub const SYS_sched_setparam: c_long = 118; ++pub const SYS_sched_setscheduler: c_long = 119; ++pub const SYS_sched_getscheduler: c_long = 120; ++pub const SYS_sched_getparam: c_long = 121; ++pub const SYS_sched_setaffinity: c_long = 122; ++pub const SYS_sched_getaffinity: c_long = 123; ++pub const SYS_sched_yield: c_long = 124; ++pub const SYS_sched_get_priority_max: c_long = 125; ++pub const SYS_sched_get_priority_min: c_long = 126; ++pub const SYS_sched_rr_get_interval: c_long = 127; ++pub const SYS_restart_syscall: c_long = 128; ++pub const SYS_kill: c_long = 129; ++pub const SYS_tkill: c_long = 130; ++pub const SYS_tgkill: c_long = 131; ++pub const SYS_sigaltstack: c_long = 132; ++pub const SYS_rt_sigsuspend: c_long = 133; ++pub const SYS_rt_sigaction: c_long = 134; ++pub const SYS_rt_sigprocmask: c_long = 135; ++pub const SYS_rt_sigpending: c_long = 136; ++pub const SYS_rt_sigtimedwait: c_long = 137; ++pub const SYS_rt_sigqueueinfo: c_long = 138; ++pub const SYS_rt_sigreturn: c_long = 139; ++pub const SYS_setpriority: c_long = 140; ++pub const SYS_getpriority: c_long = 141; ++pub const SYS_reboot: c_long = 142; ++pub const SYS_setregid: c_long = 143; ++pub const SYS_setgid: c_long = 144; ++pub const SYS_setreuid: c_long = 145; ++pub const SYS_setuid: c_long = 146; ++pub const SYS_setresuid: c_long = 147; ++pub const SYS_getresuid: c_long = 148; ++pub const SYS_setresgid: c_long = 149; ++pub const SYS_getresgid: c_long = 150; ++pub const SYS_setfsuid: c_long = 151; ++pub const SYS_setfsgid: c_long = 152; ++pub const SYS_times: c_long = 153; ++pub const SYS_setpgid: c_long = 154; ++pub const SYS_getpgid: c_long = 155; ++pub const SYS_getsid: c_long = 156; ++pub const SYS_setsid: c_long = 157; ++pub const SYS_getgroups: c_long = 158; ++pub const SYS_setgroups: c_long = 159; ++pub const SYS_uname: c_long = 160; ++pub const SYS_sethostname: c_long = 161; ++pub const SYS_setdomainname: c_long = 162; ++// 163 is getrlimit only on LP64 ++// 164 is setrlimit only on LP64 ++pub const SYS_getrusage: c_long = 165; ++pub const SYS_umask: c_long = 166; ++pub const SYS_prctl: c_long = 167; ++pub const SYS_getcpu: c_long = 168; ++pub const SYS_gettimeofday: c_long = 169; ++pub const SYS_settimeofday: c_long = 170; ++pub const SYS_adjtimex: c_long = 171; ++pub const SYS_getpid: c_long = 172; ++pub const SYS_getppid: c_long = 173; ++pub const SYS_getuid: c_long = 174; ++pub const SYS_geteuid: c_long = 175; ++pub const SYS_getgid: c_long = 176; ++pub const SYS_getegid: c_long = 177; ++pub const SYS_gettid: c_long = 178; ++pub const SYS_sysinfo: c_long = 179; ++pub const SYS_mq_open: c_long = 180; ++pub const SYS_mq_unlink: c_long = 181; ++pub const SYS_mq_timedsend: c_long = 182; ++pub const SYS_mq_timedreceive: c_long = 183; ++pub const SYS_mq_notify: c_long = 184; ++pub const SYS_mq_getsetattr: c_long = 185; ++pub const SYS_msgget: c_long = 186; ++pub const SYS_msgctl: c_long = 187; ++pub const SYS_msgrcv: c_long = 188; ++pub const SYS_msgsnd: c_long = 189; ++pub const SYS_semget: c_long = 190; ++pub const SYS_semctl: c_long = 191; ++pub const SYS_semtimedop: c_long = 192; ++pub const SYS_semop: c_long = 193; ++pub const SYS_shmget: c_long = 194; ++pub const SYS_shmctl: c_long = 195; ++pub const SYS_shmat: c_long = 196; ++pub const SYS_shmdt: c_long = 197; ++pub const SYS_socket: c_long = 198; ++pub const SYS_socketpair: c_long = 199; ++pub const SYS_bind: c_long = 200; ++pub const SYS_listen: c_long = 201; ++pub const SYS_accept: c_long = 202; ++pub const SYS_connect: c_long = 203; ++pub const SYS_getsockname: c_long = 204; ++pub const SYS_getpeername: c_long = 205; ++pub const SYS_sendto: c_long = 206; ++pub const SYS_recvfrom: c_long = 207; ++pub const SYS_setsockopt: c_long = 208; ++pub const SYS_getsockopt: c_long = 209; ++pub const SYS_shutdown: c_long = 210; ++pub const SYS_sendmsg: c_long = 211; ++pub const SYS_recvmsg: c_long = 212; ++pub const SYS_readahead: c_long = 213; ++pub const SYS_brk: c_long = 214; ++pub const SYS_munmap: c_long = 215; ++pub const SYS_mremap: c_long = 216; ++pub const SYS_add_key: c_long = 217; ++pub const SYS_request_key: c_long = 218; ++pub const SYS_keyctl: c_long = 219; ++pub const SYS_clone: c_long = 220; ++pub const SYS_execve: c_long = 221; ++pub const SYS_mmap: c_long = 222; ++pub const SYS_swapon: c_long = 224; ++pub const SYS_swapoff: c_long = 225; ++pub const SYS_mprotect: c_long = 226; ++pub const SYS_msync: c_long = 227; ++pub const SYS_mlock: c_long = 228; ++pub const SYS_munlock: c_long = 229; ++pub const SYS_mlockall: c_long = 230; ++pub const SYS_munlockall: c_long = 231; ++pub const SYS_mincore: c_long = 232; ++pub const SYS_madvise: c_long = 233; ++pub const SYS_remap_file_pages: c_long = 234; ++pub const SYS_mbind: c_long = 235; ++pub const SYS_get_mempolicy: c_long = 236; ++pub const SYS_set_mempolicy: c_long = 237; ++pub const SYS_migrate_pages: c_long = 238; ++pub const SYS_move_pages: c_long = 239; ++pub const SYS_rt_tgsigqueueinfo: c_long = 240; ++pub const SYS_perf_event_open: c_long = 241; ++pub const SYS_accept4: c_long = 242; ++pub const SYS_recvmmsg: c_long = 243; ++pub const SYS_wait4: c_long = 260; ++pub const SYS_prlimit64: c_long = 261; ++pub const SYS_fanotify_init: c_long = 262; ++pub const SYS_fanotify_mark: c_long = 263; ++pub const SYS_name_to_handle_at: c_long = 264; ++pub const SYS_open_by_handle_at: c_long = 265; ++pub const SYS_clock_adjtime: c_long = 266; ++pub const SYS_syncfs: c_long = 267; ++pub const SYS_setns: c_long = 268; ++pub const SYS_sendmmsg: c_long = 269; ++pub const SYS_process_vm_readv: c_long = 270; ++pub const SYS_process_vm_writev: c_long = 271; ++pub const SYS_kcmp: c_long = 272; ++pub const SYS_finit_module: c_long = 273; ++pub const SYS_sched_setattr: c_long = 274; ++pub const SYS_sched_getattr: c_long = 275; ++pub const SYS_renameat2: c_long = 276; ++pub const SYS_seccomp: c_long = 277; ++pub const SYS_getrandom: c_long = 278; ++pub const SYS_memfd_create: c_long = 279; ++pub const SYS_bpf: c_long = 280; ++pub const SYS_execveat: c_long = 281; ++pub const SYS_userfaultfd: c_long = 282; ++pub const SYS_membarrier: c_long = 283; ++pub const SYS_mlock2: c_long = 284; ++pub const SYS_copy_file_range: c_long = 285; ++pub const SYS_preadv2: c_long = 286; ++pub const SYS_pwritev2: c_long = 287; ++pub const SYS_pkey_mprotect: c_long = 288; ++pub const SYS_pkey_alloc: c_long = 289; ++pub const SYS_pkey_free: c_long = 290; ++pub const SYS_statx: c_long = 291; ++pub const SYS_rseq: c_long = 293; ++pub const SYS_kexec_file_load: c_long = 294; ++pub const SYS_pidfd_send_signal: c_long = 424; ++pub const SYS_io_uring_setup: c_long = 425; ++pub const SYS_io_uring_enter: c_long = 426; ++pub const SYS_io_uring_register: c_long = 427; ++pub const SYS_open_tree: c_long = 428; ++pub const SYS_move_mount: c_long = 429; ++pub const SYS_fsopen: c_long = 430; ++pub const SYS_fsconfig: c_long = 431; ++pub const SYS_fsmount: c_long = 432; ++pub const SYS_fspick: c_long = 433; ++pub const SYS_pidfd_open: c_long = 434; ++pub const SYS_clone3: c_long = 435; ++pub const SYS_close_range: c_long = 436; ++pub const SYS_openat2: c_long = 437; ++pub const SYS_pidfd_getfd: c_long = 438; ++pub const SYS_faccessat2: c_long = 439; ++pub const SYS_process_madvise: c_long = 440; ++pub const SYS_epoll_pwait2: c_long = 441; ++pub const SYS_mount_setattr: c_long = 442; ++pub const SYS_quotactl_fd: c_long = 443; ++pub const SYS_landlock_create_ruleset: c_long = 444; ++pub const SYS_landlock_add_rule: c_long = 445; ++pub const SYS_landlock_restrict_self: c_long = 446; ++pub const SYS_memfd_secret: c_long = 447; ++pub const SYS_process_mrelease: c_long = 448; ++pub const SYS_futex_waitv: c_long = 449; ++pub const SYS_set_mempolicy_home_node: c_long = 450; ++pub const SYS_mseal: c_long = 462; ++ ++pub const PROT_BTI: c_int = 0x10; ++pub const PROT_MTE: c_int = 0x20; ++ ++extern "C" { ++ pub fn sysctl( ++ name: *mut c_int, ++ namelen: c_int, ++ oldp: *mut c_void, ++ oldlenp: *mut size_t, ++ newp: *mut c_void, ++ newlen: size_t, ++ ) -> c_int; ++ ++ pub fn getcontext(ucp: *mut ucontext_t) -> c_int; ++ pub fn setcontext(ucp: *const ucontext_t) -> c_int; ++ pub fn makecontext(ucp: *mut ucontext_t, func: extern "C" fn(), argc: c_int, ...); ++ pub fn swapcontext(uocp: *mut ucontext_t, ucp: *const ucontext_t) -> c_int; ++} ++ ++cfg_if! { ++ if #[cfg(target_pointer_width = "32")] { ++ mod ilp32; ++ pub use self::ilp32::*; ++ } else { ++ mod lp64; ++ pub use self::lp64::*; ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/loongarch64/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,924 @@ ++use crate::prelude::*; ++use crate::{off64_t, off_t, pthread_mutex_t}; ++ ++pub type c_char = i8; ++pub type c_long = i64; ++pub type c_ulong = u64; ++pub type wchar_t = i32; ++ ++pub type blksize_t = i32; ++pub type nlink_t = u32; ++pub type suseconds_t = i64; ++pub type __u64 = c_ulonglong; ++pub type __s64 = c_longlong; ++ ++s! { ++ pub struct stat { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ __pad1: crate::dev_t, ++ pub st_size: off_t, ++ pub st_blksize: crate::blksize_t, ++ __pad2: c_int, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ __unused: [c_int; 2], ++ } ++ ++ pub struct stat64 { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino64_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ pub __pad1: crate::dev_t, ++ pub st_size: off64_t, ++ pub st_blksize: crate::blksize_t, ++ pub __pad2: c_int, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ __unused: [c_int; 2], ++ } ++ ++ pub struct statfs { ++ pub f_type: crate::__fsword_t, ++ pub f_bsize: crate::__fsword_t, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_fsid: crate::fsid_t, ++ pub f_namelen: crate::__fsword_t, ++ pub f_frsize: crate::__fsword_t, ++ pub f_flags: crate::__fsword_t, ++ pub f_spare: [crate::__fsword_t; 4], ++ } ++ ++ pub struct statfs64 { ++ pub f_type: crate::__fsword_t, ++ pub f_bsize: crate::__fsword_t, ++ pub f_blocks: u64, ++ pub f_bfree: u64, ++ pub f_bavail: u64, ++ pub f_files: u64, ++ pub f_ffree: u64, ++ pub f_fsid: crate::fsid_t, ++ pub f_namelen: crate::__fsword_t, ++ pub f_frsize: crate::__fsword_t, ++ pub f_flags: crate::__fsword_t, ++ pub f_spare: [crate::__fsword_t; 4], ++ } ++ ++ pub struct flock { ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ pub l_start: off_t, ++ pub l_len: off_t, ++ pub l_pid: crate::pid_t, ++ } ++ ++ pub struct flock64 { ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ pub l_start: off64_t, ++ pub l_len: off64_t, ++ pub l_pid: crate::pid_t, ++ } ++ ++ pub struct statvfs { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_favail: crate::fsfilcnt_t, ++ pub f_fsid: c_ulong, ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ __f_spare: [c_int; 6], ++ } ++ ++ pub struct statvfs64 { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: u64, ++ pub f_bfree: u64, ++ pub f_bavail: u64, ++ pub f_files: u64, ++ pub f_ffree: u64, ++ pub f_favail: u64, ++ pub f_fsid: c_ulong, ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ __f_spare: [c_int; 6], ++ } ++ ++ pub struct pthread_attr_t { ++ __size: [c_ulong; 7], ++ } ++ ++ pub struct sigaction { ++ pub sa_sigaction: crate::sighandler_t, ++ pub sa_mask: crate::sigset_t, ++ pub sa_flags: c_int, ++ pub sa_restorer: Option, ++ } ++ ++ pub struct stack_t { ++ pub ss_sp: *mut c_void, ++ pub ss_flags: c_int, ++ pub ss_size: size_t, ++ } ++ ++ pub struct siginfo_t { ++ pub si_signo: c_int, ++ pub si_errno: c_int, ++ pub si_code: c_int, ++ #[doc(hidden)] ++ #[deprecated( ++ since = "0.2.54", ++ note = "Please leave a comment on \ ++ https://github.com/rust-lang/libc/pull/1316 if you're using \ ++ this field" ++ )] ++ pub _pad: [c_int; 29], ++ _align: [u64; 0], ++ } ++ ++ pub struct ipc_perm { ++ pub __key: crate::key_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub cuid: crate::uid_t, ++ pub cgid: crate::gid_t, ++ pub mode: c_uint, ++ pub __seq: c_ushort, ++ __pad2: c_ushort, ++ __unused1: c_ulong, ++ __unused2: c_ulong, ++ } ++ ++ pub struct shmid_ds { ++ pub shm_perm: crate::ipc_perm, ++ pub shm_segsz: size_t, ++ pub shm_atime: crate::time_t, ++ pub shm_dtime: crate::time_t, ++ pub shm_ctime: crate::time_t, ++ pub shm_cpid: crate::pid_t, ++ pub shm_lpid: crate::pid_t, ++ pub shm_nattch: crate::shmatt_t, ++ __unused4: c_ulong, ++ __unused5: c_ulong, ++ } ++ ++ pub struct user_regs_struct { ++ pub regs: [u64; 32], ++ pub orig_a0: u64, ++ pub csr_era: u64, ++ pub csr_badv: u64, ++ pub reserved: [u64; 10], ++ } ++ ++ pub struct user_fp_struct { ++ pub fpr: [u64; 32], ++ pub fcc: u64, ++ pub fcsr: u32, ++ } ++ ++ pub struct ucontext_t { ++ pub uc_flags: c_ulong, ++ pub uc_link: *mut ucontext_t, ++ pub uc_stack: crate::stack_t, ++ pub uc_sigmask: crate::sigset_t, ++ pub uc_mcontext: mcontext_t, ++ } ++ ++ #[repr(align(16))] ++ pub struct mcontext_t { ++ pub __pc: c_ulonglong, ++ pub __gregs: [c_ulonglong; 32], ++ pub __flags: c_uint, ++ pub __extcontext: [c_ulonglong; 0], ++ } ++ ++ #[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, ++ } ++} ++ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ #[repr(align(16))] ++ pub struct max_align_t { ++ priv_: [f64; 4], ++ } ++} ++ ++pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; ++pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; ++pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4; ++pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; ++pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; ++pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32; ++ ++#[cfg(target_endian = "little")] ++pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++}; ++#[cfg(target_endian = "little")] ++pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++}; ++#[cfg(target_endian = "little")] ++pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++}; ++#[cfg(target_endian = "big")] ++pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++}; ++#[cfg(target_endian = "big")] ++pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++}; ++#[cfg(target_endian = "big")] ++pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++}; ++ ++pub const HWCAP_LOONGARCH_CPUCFG: c_ulong = 1 << 0; ++pub const HWCAP_LOONGARCH_LAM: c_ulong = 1 << 1; ++pub const HWCAP_LOONGARCH_UAL: c_ulong = 1 << 2; ++pub const HWCAP_LOONGARCH_FPU: c_ulong = 1 << 3; ++pub const HWCAP_LOONGARCH_LSX: c_ulong = 1 << 4; ++pub const HWCAP_LOONGARCH_LASX: c_ulong = 1 << 5; ++pub const HWCAP_LOONGARCH_CRC32: c_ulong = 1 << 6; ++pub const HWCAP_LOONGARCH_COMPLEX: c_ulong = 1 << 7; ++pub const HWCAP_LOONGARCH_CRYPTO: c_ulong = 1 << 8; ++pub const HWCAP_LOONGARCH_LVZ: c_ulong = 1 << 9; ++pub const HWCAP_LOONGARCH_LBT_X86: c_ulong = 1 << 10; ++pub const HWCAP_LOONGARCH_LBT_ARM: c_ulong = 1 << 11; ++pub const HWCAP_LOONGARCH_LBT_MIPS: c_ulong = 1 << 12; ++pub const HWCAP_LOONGARCH_PTW: c_ulong = 1 << 13; ++ ++pub const SYS_io_setup: c_long = 0; ++pub const SYS_io_destroy: c_long = 1; ++pub const SYS_io_submit: c_long = 2; ++pub const SYS_io_cancel: c_long = 3; ++pub const SYS_io_getevents: c_long = 4; ++pub const SYS_setxattr: c_long = 5; ++pub const SYS_lsetxattr: c_long = 6; ++pub const SYS_fsetxattr: c_long = 7; ++pub const SYS_getxattr: c_long = 8; ++pub const SYS_lgetxattr: c_long = 9; ++pub const SYS_fgetxattr: c_long = 10; ++pub const SYS_listxattr: c_long = 11; ++pub const SYS_llistxattr: c_long = 12; ++pub const SYS_flistxattr: c_long = 13; ++pub const SYS_removexattr: c_long = 14; ++pub const SYS_lremovexattr: c_long = 15; ++pub const SYS_fremovexattr: c_long = 16; ++pub const SYS_getcwd: c_long = 17; ++pub const SYS_lookup_dcookie: c_long = 18; ++pub const SYS_eventfd2: c_long = 19; ++pub const SYS_epoll_create1: c_long = 20; ++pub const SYS_epoll_ctl: c_long = 21; ++pub const SYS_epoll_pwait: c_long = 22; ++pub const SYS_dup: c_long = 23; ++pub const SYS_dup3: c_long = 24; ++pub const SYS_fcntl: c_long = 25; ++pub const SYS_inotify_init1: c_long = 26; ++pub const SYS_inotify_add_watch: c_long = 27; ++pub const SYS_inotify_rm_watch: c_long = 28; ++pub const SYS_ioctl: c_long = 29; ++pub const SYS_ioprio_set: c_long = 30; ++pub const SYS_ioprio_get: c_long = 31; ++pub const SYS_flock: c_long = 32; ++pub const SYS_mknodat: c_long = 33; ++pub const SYS_mkdirat: c_long = 34; ++pub const SYS_unlinkat: c_long = 35; ++pub const SYS_symlinkat: c_long = 36; ++pub const SYS_linkat: c_long = 37; ++pub const SYS_umount2: c_long = 39; ++pub const SYS_mount: c_long = 40; ++pub const SYS_pivot_root: c_long = 41; ++pub const SYS_nfsservctl: c_long = 42; ++pub const SYS_statfs: c_long = 43; ++pub const SYS_fstatfs: c_long = 44; ++pub const SYS_truncate: c_long = 45; ++pub const SYS_ftruncate: c_long = 46; ++pub const SYS_fallocate: c_long = 47; ++pub const SYS_faccessat: c_long = 48; ++pub const SYS_chdir: c_long = 49; ++pub const SYS_fchdir: c_long = 50; ++pub const SYS_chroot: c_long = 51; ++pub const SYS_fchmod: c_long = 52; ++pub const SYS_fchmodat: c_long = 53; ++pub const SYS_fchownat: c_long = 54; ++pub const SYS_fchown: c_long = 55; ++pub const SYS_openat: c_long = 56; ++pub const SYS_close: c_long = 57; ++pub const SYS_vhangup: c_long = 58; ++pub const SYS_pipe2: c_long = 59; ++pub const SYS_quotactl: c_long = 60; ++pub const SYS_getdents64: c_long = 61; ++pub const SYS_lseek: c_long = 62; ++pub const SYS_read: c_long = 63; ++pub const SYS_write: c_long = 64; ++pub const SYS_readv: c_long = 65; ++pub const SYS_writev: c_long = 66; ++pub const SYS_pread64: c_long = 67; ++pub const SYS_pwrite64: c_long = 68; ++pub const SYS_preadv: c_long = 69; ++pub const SYS_pwritev: c_long = 70; ++pub const SYS_sendfile: c_long = 71; ++pub const SYS_pselect6: c_long = 72; ++pub const SYS_ppoll: c_long = 73; ++pub const SYS_signalfd4: c_long = 74; ++pub const SYS_vmsplice: c_long = 75; ++pub const SYS_splice: c_long = 76; ++pub const SYS_tee: c_long = 77; ++pub const SYS_readlinkat: c_long = 78; ++pub const SYS_sync: c_long = 81; ++pub const SYS_fsync: c_long = 82; ++pub const SYS_fdatasync: c_long = 83; ++pub const SYS_sync_file_range: c_long = 84; ++pub const SYS_timerfd_create: c_long = 85; ++pub const SYS_timerfd_settime: c_long = 86; ++pub const SYS_timerfd_gettime: c_long = 87; ++pub const SYS_utimensat: c_long = 88; ++pub const SYS_acct: c_long = 89; ++pub const SYS_capget: c_long = 90; ++pub const SYS_capset: c_long = 91; ++pub const SYS_personality: c_long = 92; ++pub const SYS_exit: c_long = 93; ++pub const SYS_exit_group: c_long = 94; ++pub const SYS_waitid: c_long = 95; ++pub const SYS_set_tid_address: c_long = 96; ++pub const SYS_unshare: c_long = 97; ++pub const SYS_futex: c_long = 98; ++pub const SYS_set_robust_list: c_long = 99; ++pub const SYS_get_robust_list: c_long = 100; ++pub const SYS_nanosleep: c_long = 101; ++pub const SYS_getitimer: c_long = 102; ++pub const SYS_setitimer: c_long = 103; ++pub const SYS_kexec_load: c_long = 104; ++pub const SYS_init_module: c_long = 105; ++pub const SYS_delete_module: c_long = 106; ++pub const SYS_timer_create: c_long = 107; ++pub const SYS_timer_gettime: c_long = 108; ++pub const SYS_timer_getoverrun: c_long = 109; ++pub const SYS_timer_settime: c_long = 110; ++pub const SYS_timer_delete: c_long = 111; ++pub const SYS_clock_settime: c_long = 112; ++pub const SYS_clock_gettime: c_long = 113; ++pub const SYS_clock_getres: c_long = 114; ++pub const SYS_clock_nanosleep: c_long = 115; ++pub const SYS_syslog: c_long = 116; ++pub const SYS_ptrace: c_long = 117; ++pub const SYS_sched_setparam: c_long = 118; ++pub const SYS_sched_setscheduler: c_long = 119; ++pub const SYS_sched_getscheduler: c_long = 120; ++pub const SYS_sched_getparam: c_long = 121; ++pub const SYS_sched_setaffinity: c_long = 122; ++pub const SYS_sched_getaffinity: c_long = 123; ++pub const SYS_sched_yield: c_long = 124; ++pub const SYS_sched_get_priority_max: c_long = 125; ++pub const SYS_sched_get_priority_min: c_long = 126; ++pub const SYS_sched_rr_get_interval: c_long = 127; ++pub const SYS_restart_syscall: c_long = 128; ++pub const SYS_kill: c_long = 129; ++pub const SYS_tkill: c_long = 130; ++pub const SYS_tgkill: c_long = 131; ++pub const SYS_sigaltstack: c_long = 132; ++pub const SYS_rt_sigsuspend: c_long = 133; ++pub const SYS_rt_sigaction: c_long = 134; ++pub const SYS_rt_sigprocmask: c_long = 135; ++pub const SYS_rt_sigpending: c_long = 136; ++pub const SYS_rt_sigtimedwait: c_long = 137; ++pub const SYS_rt_sigqueueinfo: c_long = 138; ++pub const SYS_rt_sigreturn: c_long = 139; ++pub const SYS_setpriority: c_long = 140; ++pub const SYS_getpriority: c_long = 141; ++pub const SYS_reboot: c_long = 142; ++pub const SYS_setregid: c_long = 143; ++pub const SYS_setgid: c_long = 144; ++pub const SYS_setreuid: c_long = 145; ++pub const SYS_setuid: c_long = 146; ++pub const SYS_setresuid: c_long = 147; ++pub const SYS_getresuid: c_long = 148; ++pub const SYS_setresgid: c_long = 149; ++pub const SYS_getresgid: c_long = 150; ++pub const SYS_setfsuid: c_long = 151; ++pub const SYS_setfsgid: c_long = 152; ++pub const SYS_times: c_long = 153; ++pub const SYS_setpgid: c_long = 154; ++pub const SYS_getpgid: c_long = 155; ++pub const SYS_getsid: c_long = 156; ++pub const SYS_setsid: c_long = 157; ++pub const SYS_getgroups: c_long = 158; ++pub const SYS_setgroups: c_long = 159; ++pub const SYS_uname: c_long = 160; ++pub const SYS_sethostname: c_long = 161; ++pub const SYS_setdomainname: c_long = 162; ++pub const SYS_getrusage: c_long = 165; ++pub const SYS_umask: c_long = 166; ++pub const SYS_prctl: c_long = 167; ++pub const SYS_getcpu: c_long = 168; ++pub const SYS_gettimeofday: c_long = 169; ++pub const SYS_settimeofday: c_long = 170; ++pub const SYS_adjtimex: c_long = 171; ++pub const SYS_getpid: c_long = 172; ++pub const SYS_getppid: c_long = 173; ++pub const SYS_getuid: c_long = 174; ++pub const SYS_geteuid: c_long = 175; ++pub const SYS_getgid: c_long = 176; ++pub const SYS_getegid: c_long = 177; ++pub const SYS_gettid: c_long = 178; ++pub const SYS_sysinfo: c_long = 179; ++pub const SYS_mq_open: c_long = 180; ++pub const SYS_mq_unlink: c_long = 181; ++pub const SYS_mq_timedsend: c_long = 182; ++pub const SYS_mq_timedreceive: c_long = 183; ++pub const SYS_mq_notify: c_long = 184; ++pub const SYS_mq_getsetattr: c_long = 185; ++pub const SYS_msgget: c_long = 186; ++pub const SYS_msgctl: c_long = 187; ++pub const SYS_msgrcv: c_long = 188; ++pub const SYS_msgsnd: c_long = 189; ++pub const SYS_semget: c_long = 190; ++pub const SYS_semctl: c_long = 191; ++pub const SYS_semtimedop: c_long = 192; ++pub const SYS_semop: c_long = 193; ++pub const SYS_shmget: c_long = 194; ++pub const SYS_shmctl: c_long = 195; ++pub const SYS_shmat: c_long = 196; ++pub const SYS_shmdt: c_long = 197; ++pub const SYS_socket: c_long = 198; ++pub const SYS_socketpair: c_long = 199; ++pub const SYS_bind: c_long = 200; ++pub const SYS_listen: c_long = 201; ++pub const SYS_accept: c_long = 202; ++pub const SYS_connect: c_long = 203; ++pub const SYS_getsockname: c_long = 204; ++pub const SYS_getpeername: c_long = 205; ++pub const SYS_sendto: c_long = 206; ++pub const SYS_recvfrom: c_long = 207; ++pub const SYS_setsockopt: c_long = 208; ++pub const SYS_getsockopt: c_long = 209; ++pub const SYS_shutdown: c_long = 210; ++pub const SYS_sendmsg: c_long = 211; ++pub const SYS_recvmsg: c_long = 212; ++pub const SYS_readahead: c_long = 213; ++pub const SYS_brk: c_long = 214; ++pub const SYS_munmap: c_long = 215; ++pub const SYS_mremap: c_long = 216; ++pub const SYS_add_key: c_long = 217; ++pub const SYS_request_key: c_long = 218; ++pub const SYS_keyctl: c_long = 219; ++pub const SYS_clone: c_long = 220; ++pub const SYS_execve: c_long = 221; ++pub const SYS_mmap: c_long = 222; ++pub const SYS_fadvise64: c_long = 223; ++pub const SYS_swapon: c_long = 224; ++pub const SYS_swapoff: c_long = 225; ++pub const SYS_mprotect: c_long = 226; ++pub const SYS_msync: c_long = 227; ++pub const SYS_mlock: c_long = 228; ++pub const SYS_munlock: c_long = 229; ++pub const SYS_mlockall: c_long = 230; ++pub const SYS_munlockall: c_long = 231; ++pub const SYS_mincore: c_long = 232; ++pub const SYS_madvise: c_long = 233; ++pub const SYS_remap_file_pages: c_long = 234; ++pub const SYS_mbind: c_long = 235; ++pub const SYS_get_mempolicy: c_long = 236; ++pub const SYS_set_mempolicy: c_long = 237; ++pub const SYS_migrate_pages: c_long = 238; ++pub const SYS_move_pages: c_long = 239; ++pub const SYS_rt_tgsigqueueinfo: c_long = 240; ++pub const SYS_perf_event_open: c_long = 241; ++pub const SYS_accept4: c_long = 242; ++pub const SYS_recvmmsg: c_long = 243; ++//pub const SYS_arch_specific_syscall: c_long = 244; ++pub const SYS_wait4: c_long = 260; ++pub const SYS_prlimit64: c_long = 261; ++pub const SYS_fanotify_init: c_long = 262; ++pub const SYS_fanotify_mark: c_long = 263; ++pub const SYS_name_to_handle_at: c_long = 264; ++pub const SYS_open_by_handle_at: c_long = 265; ++pub const SYS_clock_adjtime: c_long = 266; ++pub const SYS_syncfs: c_long = 267; ++pub const SYS_setns: c_long = 268; ++pub const SYS_sendmmsg: c_long = 269; ++pub const SYS_process_vm_readv: c_long = 270; ++pub const SYS_process_vm_writev: c_long = 271; ++pub const SYS_kcmp: c_long = 272; ++pub const SYS_finit_module: c_long = 273; ++pub const SYS_sched_setattr: c_long = 274; ++pub const SYS_sched_getattr: c_long = 275; ++pub const SYS_renameat2: c_long = 276; ++pub const SYS_seccomp: c_long = 277; ++pub const SYS_getrandom: c_long = 278; ++pub const SYS_memfd_create: c_long = 279; ++pub const SYS_bpf: c_long = 280; ++pub const SYS_execveat: c_long = 281; ++pub const SYS_userfaultfd: c_long = 282; ++pub const SYS_membarrier: c_long = 283; ++pub const SYS_mlock2: c_long = 284; ++pub const SYS_copy_file_range: c_long = 285; ++pub const SYS_preadv2: c_long = 286; ++pub const SYS_pwritev2: c_long = 287; ++pub const SYS_pkey_mprotect: c_long = 288; ++pub const SYS_pkey_alloc: c_long = 289; ++pub const SYS_pkey_free: c_long = 290; ++pub const SYS_statx: c_long = 291; ++pub const SYS_io_pgetevents: c_long = 292; ++pub const SYS_rseq: c_long = 293; ++pub const SYS_kexec_file_load: c_long = 294; ++pub const SYS_pidfd_send_signal: c_long = 424; ++pub const SYS_io_uring_setup: c_long = 425; ++pub const SYS_io_uring_enter: c_long = 426; ++pub const SYS_io_uring_register: c_long = 427; ++pub const SYS_open_tree: c_long = 428; ++pub const SYS_move_mount: c_long = 429; ++pub const SYS_fsopen: c_long = 430; ++pub const SYS_fsconfig: c_long = 431; ++pub const SYS_fsmount: c_long = 432; ++pub const SYS_fspick: c_long = 433; ++pub const SYS_pidfd_open: c_long = 434; ++pub const SYS_clone3: c_long = 435; ++pub const SYS_close_range: c_long = 436; ++pub const SYS_openat2: c_long = 437; ++pub const SYS_pidfd_getfd: c_long = 438; ++pub const SYS_faccessat2: c_long = 439; ++pub const SYS_process_madvise: c_long = 440; ++pub const SYS_epoll_pwait2: c_long = 441; ++pub const SYS_mount_setattr: c_long = 442; ++pub const SYS_quotactl_fd: c_long = 443; ++pub const SYS_landlock_create_ruleset: c_long = 444; ++pub const SYS_landlock_add_rule: c_long = 445; ++pub const SYS_landlock_restrict_self: c_long = 446; ++pub const SYS_process_mrelease: c_long = 448; ++pub const SYS_futex_waitv: c_long = 449; ++pub const SYS_set_mempolicy_home_node: c_long = 450; ++ ++pub const POSIX_FADV_DONTNEED: c_int = 4; ++pub const POSIX_FADV_NOREUSE: c_int = 5; ++pub const O_DIRECT: c_int = 0o00040000; ++pub const O_DIRECTORY: c_int = 0o00200000; ++pub const O_NOFOLLOW: c_int = 0o00400000; ++pub const O_TRUNC: c_int = 0o00001000; ++pub const O_NOATIME: c_int = 0o1000000; ++pub const O_CLOEXEC: c_int = 0o02000000; ++pub const O_PATH: c_int = 0o10000000; ++pub const O_TMPFILE: c_int = 0o20000000 | O_DIRECTORY; ++pub const O_APPEND: c_int = 0o00002000; ++pub const O_CREAT: c_int = 0o00000100; ++pub const O_EXCL: c_int = 0o00000200; ++pub const O_NOCTTY: c_int = 0o00000400; ++pub const O_NONBLOCK: c_int = 0o00004000; ++pub const FASYNC: c_int = 0o00020000; ++pub const O_SYNC: c_int = 0o04010000; ++pub const O_RSYNC: c_int = 0o04010000; ++pub const O_FSYNC: c_int = O_SYNC; ++pub const O_ASYNC: c_int = 0o00020000; ++pub const O_DSYNC: c_int = 0o00010000; ++pub const O_NDELAY: c_int = O_NONBLOCK; ++pub const F_RDLCK: c_int = 0; ++pub const F_WRLCK: c_int = 1; ++pub const F_UNLCK: c_int = 2; ++pub const F_GETLK: c_int = 5; ++pub const F_SETLK: c_int = 6; ++pub const F_SETLKW: c_int = 7; ++pub const F_SETOWN: c_int = 8; ++pub const F_GETOWN: c_int = 9; ++pub const F_OFD_GETLK: c_int = 36; ++pub const F_OFD_SETLK: c_int = 37; ++pub const F_OFD_SETLKW: c_int = 38; ++ ++pub const EDEADLK: c_int = 35; ++pub const EDEADLOCK: c_int = 35; ++pub const ENAMETOOLONG: c_int = 36; ++pub const ENOLCK: c_int = 37; ++pub const ENOSYS: c_int = 38; ++pub const ENOTEMPTY: c_int = 39; ++pub const ELOOP: c_int = 40; ++pub const ENOMSG: c_int = 42; ++pub const EIDRM: c_int = 43; ++pub const ECHRNG: c_int = 44; ++pub const EL2NSYNC: c_int = 45; ++pub const EL3HLT: c_int = 46; ++pub const EL3RST: c_int = 47; ++pub const ELNRNG: c_int = 48; ++pub const EUNATCH: c_int = 49; ++pub const ENOCSI: c_int = 50; ++pub const EL2HLT: c_int = 51; ++pub const EBADE: c_int = 52; ++pub const EBADR: c_int = 53; ++pub const EXFULL: c_int = 54; ++pub const ENOANO: c_int = 55; ++pub const EBADRQC: c_int = 56; ++pub const EBADSLT: c_int = 57; ++pub const EBFONT: c_int = 59; ++pub const ENOSTR: c_int = 60; ++pub const ENODATA: c_int = 61; ++pub const ETIME: c_int = 62; ++pub const ENOSR: c_int = 63; ++pub const ENONET: c_int = 64; ++pub const ENOPKG: c_int = 65; ++pub const EREMOTE: c_int = 66; ++pub const ENOLINK: c_int = 67; ++pub const EADV: c_int = 68; ++pub const ESRMNT: c_int = 69; ++pub const ECOMM: c_int = 70; ++pub const EPROTO: c_int = 71; ++pub const EDOTDOT: c_int = 73; ++pub const EMULTIHOP: c_int = 72; ++pub const EOVERFLOW: c_int = 75; ++pub const ENOTUNIQ: c_int = 76; ++pub const EBADFD: c_int = 77; ++pub const EBADMSG: c_int = 74; ++pub const EREMCHG: c_int = 78; ++pub const ELIBACC: c_int = 79; ++pub const ELIBBAD: c_int = 80; ++pub const ELIBSCN: c_int = 81; ++pub const ELIBMAX: c_int = 82; ++pub const ELIBEXEC: c_int = 83; ++pub const EILSEQ: c_int = 84; ++pub const ERESTART: c_int = 85; ++pub const ESTRPIPE: c_int = 86; ++pub const EUSERS: c_int = 87; ++pub const ENOTSOCK: c_int = 88; ++pub const EDESTADDRREQ: c_int = 89; ++pub const EMSGSIZE: c_int = 90; ++pub const EPROTOTYPE: c_int = 91; ++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 EPFNOSUPPORT: c_int = 96; ++pub const EAFNOSUPPORT: c_int = 97; ++pub const EADDRINUSE: c_int = 98; ++pub const EADDRNOTAVAIL: c_int = 99; ++pub const ENETDOWN: c_int = 100; ++pub const ENETUNREACH: c_int = 101; ++pub const ENETRESET: c_int = 102; ++pub const ECONNABORTED: c_int = 103; ++pub const ECONNRESET: c_int = 104; ++pub const ENOBUFS: c_int = 105; ++pub const EISCONN: c_int = 106; ++pub const ENOTCONN: c_int = 107; ++pub const ESHUTDOWN: c_int = 108; ++pub const ETOOMANYREFS: c_int = 109; ++pub const ETIMEDOUT: c_int = 110; ++pub const ECONNREFUSED: c_int = 111; ++pub const EHOSTDOWN: c_int = 112; ++pub const EHOSTUNREACH: c_int = 113; ++pub const EALREADY: c_int = 114; ++pub const EINPROGRESS: c_int = 115; ++pub const ESTALE: c_int = 116; ++pub const EUCLEAN: c_int = 117; ++pub const ENOTNAM: c_int = 118; ++pub const ENAVAIL: c_int = 119; ++pub const EISNAM: c_int = 120; ++pub const EREMOTEIO: c_int = 121; ++pub const EDQUOT: c_int = 122; ++pub const ENOMEDIUM: c_int = 123; ++pub const EMEDIUMTYPE: c_int = 124; ++pub const ECANCELED: c_int = 125; ++pub const ENOKEY: c_int = 126; ++pub const EKEYEXPIRED: c_int = 127; ++pub const EKEYREVOKED: c_int = 128; ++pub const EKEYREJECTED: c_int = 129; ++pub const EOWNERDEAD: c_int = 130; ++pub const ENOTRECOVERABLE: c_int = 131; ++pub const ERFKILL: c_int = 132; ++pub const EHWPOISON: c_int = 133; ++ ++pub const MADV_SOFT_OFFLINE: c_int = 101; ++ ++pub const MAP_NORESERVE: c_int = 0x4000; ++pub const MAP_ANONYMOUS: c_int = 0x0020; ++pub const MAP_ANON: c_int = 0x0020; ++pub const MAP_GROWSDOWN: c_int = 0x0100; ++pub const MAP_DENYWRITE: c_int = 0x0800; ++pub const MAP_EXECUTABLE: c_int = 0x1000; ++pub const MAP_LOCKED: c_int = 0x2000; ++pub const MAP_POPULATE: c_int = 0x8000; ++pub const MAP_NONBLOCK: c_int = 0x10000; ++pub const MAP_STACK: c_int = 0x20000; ++pub const MAP_HUGETLB: c_int = 0x40000; ++pub const MAP_SYNC: c_int = 0x080000; ++pub const MCL_CURRENT: c_int = 0x0001; ++pub const MCL_FUTURE: c_int = 0x0002; ++pub const MCL_ONFAULT: c_int = 0x0004; ++ ++pub const SOCK_STREAM: c_int = 1; ++pub const SOCK_DGRAM: c_int = 2; ++ ++pub const SFD_NONBLOCK: c_int = 0x800; ++pub const SFD_CLOEXEC: c_int = 0x080000; ++pub const SA_NODEFER: c_int = 0x40000000; ++pub const SA_RESETHAND: c_int = 0x80000000; ++pub const SA_RESTART: c_int = 0x10000000; ++pub const SA_NOCLDSTOP: c_int = 0x00000001; ++pub const SA_ONSTACK: c_int = 0x08000000; ++pub const SA_SIGINFO: c_int = 0x00000004; ++pub const SA_NOCLDWAIT: c_int = 0x00000002; ++pub const SIG_BLOCK: c_int = 0; ++pub const SIG_UNBLOCK: c_int = 1; ++pub const SIG_SETMASK: c_int = 2; ++pub const SIGBUS: c_int = 7; ++pub const SIGUSR1: c_int = 10; ++pub const SIGUSR2: c_int = 12; ++pub const SIGSTKFLT: c_int = 16; ++pub const SIGCHLD: c_int = 17; ++pub const SIGCONT: c_int = 18; ++pub const SIGSTOP: c_int = 19; ++pub const SIGTSTP: c_int = 20; ++pub const SIGTTIN: c_int = 21; ++pub const SIGTTOU: c_int = 22; ++pub const SIGURG: c_int = 23; ++pub const SIGXCPU: c_int = 24; ++pub const SIGXFSZ: c_int = 25; ++pub const SIGVTALRM: c_int = 26; ++pub const SIGPROF: c_int = 27; ++pub const SIGWINCH: c_int = 28; ++pub const SIGIO: c_int = 29; ++pub const SIGPOLL: c_int = 29; ++pub const SIGPWR: c_int = 30; ++pub const SIGSYS: c_int = 31; ++pub const SIGUNUSED: c_int = 31; ++ ++pub const POLLWRNORM: c_short = 0x100; ++pub const POLLWRBAND: c_short = 0x200; ++ ++pub const PTRACE_GETFPREGS: c_uint = 14; ++pub const PTRACE_SETFPREGS: c_uint = 15; ++pub const PTRACE_DETACH: c_uint = 17; ++pub const PTRACE_GETFPXREGS: c_uint = 18; ++pub const PTRACE_SETFPXREGS: c_uint = 19; ++pub const PTRACE_GETREGS: c_uint = 12; ++pub const PTRACE_SETREGS: c_uint = 13; ++pub const PTRACE_SYSEMU: c_uint = 31; ++pub const PTRACE_SYSEMU_SINGLESTEP: c_uint = 32; ++ ++pub const RTLD_DEEPBIND: c_int = 0x8; ++pub const RTLD_GLOBAL: c_int = 0x100; ++pub const RTLD_NOLOAD: c_int = 0x4; ++ ++pub const VEOF: usize = 4; ++pub const VTIME: usize = 5; ++pub const VMIN: usize = 6; ++pub const VSWTC: usize = 7; ++pub const VSTART: usize = 8; ++pub const VSTOP: usize = 9; ++pub const VSUSP: usize = 10; ++pub const VEOL: usize = 11; ++pub const VREPRINT: usize = 12; ++pub const VDISCARD: usize = 13; ++pub const VWERASE: usize = 14; ++pub const VEOL2: usize = 16; ++pub const IEXTEN: crate::tcflag_t = 0x00008000; ++pub const TOSTOP: crate::tcflag_t = 0x00000100; ++pub const FLUSHO: crate::tcflag_t = 0x00001000; ++pub const EXTPROC: crate::tcflag_t = 0x00010000; ++pub const TCSANOW: c_int = 0; ++pub const TCSADRAIN: c_int = 1; ++pub const TCSAFLUSH: c_int = 2; ++pub const SIGSTKSZ: size_t = 16384; ++pub const MINSIGSTKSZ: size_t = 4096; ++pub const CBAUD: crate::tcflag_t = 0o0010017; ++pub const CSIZE: crate::tcflag_t = 0x00000030; ++pub const CS6: crate::tcflag_t = 0x00000010; ++pub const CS7: crate::tcflag_t = 0x00000020; ++pub const CS8: crate::tcflag_t = 0x00000030; ++pub const CSTOPB: crate::tcflag_t = 0x00000040; ++pub const CREAD: crate::tcflag_t = 0x00000080; ++pub const PARENB: crate::tcflag_t = 0x00000100; ++pub const PARODD: crate::tcflag_t = 0x00000200; ++pub const HUPCL: crate::tcflag_t = 0x00000400; ++pub const CLOCAL: crate::tcflag_t = 0x00000800; ++pub const CIBAUD: crate::tcflag_t = 0o02003600000; ++pub const CBAUDEX: crate::tcflag_t = 0o010000; ++pub const B0: crate::speed_t = 0o000000; ++pub const B50: crate::speed_t = 0o000001; ++pub const B75: crate::speed_t = 0o000002; ++pub const B110: crate::speed_t = 0o000003; ++pub const B134: crate::speed_t = 0o000004; ++pub const B150: crate::speed_t = 0o000005; ++pub const B200: crate::speed_t = 0o000006; ++pub const B300: crate::speed_t = 0o000007; ++pub const B600: crate::speed_t = 0o000010; ++pub const B1200: crate::speed_t = 0o000011; ++pub const B1800: crate::speed_t = 0o000012; ++pub const B2400: crate::speed_t = 0o000013; ++pub const B4800: crate::speed_t = 0o000014; ++pub const B9600: crate::speed_t = 0o000015; ++pub const B19200: crate::speed_t = 0o000016; ++pub const B38400: crate::speed_t = 0o000017; ++pub const EXTA: crate::speed_t = B19200; ++pub const EXTB: crate::speed_t = B38400; ++pub const B57600: crate::speed_t = 0o010001; ++pub const B115200: crate::speed_t = 0o010002; ++pub const B230400: crate::speed_t = 0o010003; ++pub const B460800: crate::speed_t = 0o010004; ++pub const B500000: crate::speed_t = 0o010005; ++pub const B576000: crate::speed_t = 0o010006; ++pub const B921600: crate::speed_t = 0o010007; ++pub const B1000000: crate::speed_t = 0o010010; ++pub const B1152000: crate::speed_t = 0o010011; ++pub const B1500000: crate::speed_t = 0o010012; ++pub const B2000000: crate::speed_t = 0o010013; ++pub const B2500000: crate::speed_t = 0o010014; ++pub const B3000000: crate::speed_t = 0o010015; ++pub const B3500000: crate::speed_t = 0o010016; ++pub const B4000000: crate::speed_t = 0o010017; ++pub const TAB1: crate::tcflag_t = 0x00000800; ++pub const TAB2: crate::tcflag_t = 0x00001000; ++pub const TAB3: crate::tcflag_t = 0x00001800; ++pub const CR1: crate::tcflag_t = 0x00000200; ++pub const CR2: crate::tcflag_t = 0x00000400; ++pub const CR3: crate::tcflag_t = 0x00000600; ++pub const FF1: crate::tcflag_t = 0x00008000; ++pub const BS1: crate::tcflag_t = 0x00002000; ++pub const OLCUC: crate::tcflag_t = 0o000002; ++pub const NLDLY: crate::tcflag_t = 0o000400; ++pub const CRDLY: crate::tcflag_t = 0o003000; ++pub const TABDLY: crate::tcflag_t = 0o014000; ++pub const BSDLY: crate::tcflag_t = 0o020000; ++pub const FFDLY: crate::tcflag_t = 0o100000; ++pub const VTDLY: crate::tcflag_t = 0o040000; ++pub const XTABS: crate::tcflag_t = 0o014000; ++pub const VT1: crate::tcflag_t = 0x00004000; ++pub const ONLCR: crate::tcflag_t = 0x4; ++pub const IXON: crate::tcflag_t = 0x00000400; ++pub const IXOFF: crate::tcflag_t = 0x00001000; ++pub const ECHOKE: crate::tcflag_t = 0x00000800; ++pub const ECHOE: crate::tcflag_t = 0x00000010; ++pub const ECHOK: crate::tcflag_t = 0x00000020; ++pub const ECHONL: crate::tcflag_t = 0x00000040; ++pub const ECHOPRT: crate::tcflag_t = 0x00000400; ++pub const ECHOCTL: crate::tcflag_t = 0x00000200; ++pub const ISIG: crate::tcflag_t = 0x00000001; ++pub const ICANON: crate::tcflag_t = 0x00000002; ++pub const XCASE: crate::tcflag_t = 0x00000004; ++pub const PENDIN: crate::tcflag_t = 0x00004000; ++pub const NOFLSH: crate::tcflag_t = 0x00000080; ++ ++pub const NCCS: usize = 32; ++ ++pub const EPOLL_CLOEXEC: c_int = 0x80000; ++ ++pub const EFD_CLOEXEC: c_int = 0x80000; ++pub const EFD_NONBLOCK: c_int = 0x800; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/mips64/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,928 @@ ++use crate::prelude::*; ++use crate::{off64_t, off_t, pthread_mutex_t}; ++ ++pub type blksize_t = i64; ++pub type c_char = i8; ++pub type c_long = i64; ++pub type c_ulong = u64; ++pub type nlink_t = u64; ++pub type suseconds_t = i64; ++pub type wchar_t = i32; ++pub type __u64 = c_ulong; ++pub type __s64 = c_long; ++ ++s! { ++ pub struct stat { ++ pub st_dev: c_ulong, ++ st_pad1: [c_long; 2], ++ pub st_ino: crate::ino_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: c_ulong, ++ st_pad2: [c_ulong; 1], ++ pub st_size: off_t, ++ st_pad3: c_long, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ pub st_blksize: crate::blksize_t, ++ st_pad4: c_long, ++ pub st_blocks: crate::blkcnt_t, ++ st_pad5: [c_long; 7], ++ } ++ ++ pub struct statfs { ++ pub f_type: c_long, ++ pub f_bsize: c_long, ++ pub f_frsize: c_long, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_files: crate::fsblkcnt_t, ++ pub f_ffree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ pub f_fsid: crate::fsid_t, ++ ++ pub f_namelen: c_long, ++ f_spare: [c_long; 6], ++ } ++ ++ pub struct flock { ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ pub l_start: off_t, ++ pub l_len: off_t, ++ pub l_pid: crate::pid_t, ++ } ++ ++ pub struct flock64 { ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ pub l_start: off64_t, ++ pub l_len: off64_t, ++ pub l_pid: crate::pid_t, ++ } ++ ++ pub struct stat64 { ++ pub st_dev: c_ulong, ++ st_pad1: [c_long; 2], ++ pub st_ino: crate::ino64_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: c_ulong, ++ st_pad2: [c_long; 2], ++ pub st_size: off64_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ pub st_blksize: crate::blksize_t, ++ st_pad3: c_long, ++ pub st_blocks: crate::blkcnt64_t, ++ st_pad5: [c_long; 7], ++ } ++ ++ pub struct statfs64 { ++ pub f_type: c_long, ++ pub f_bsize: c_long, ++ pub f_frsize: c_long, ++ pub f_blocks: u64, ++ pub f_bfree: u64, ++ pub f_files: u64, ++ pub f_ffree: u64, ++ pub f_bavail: u64, ++ pub f_fsid: crate::fsid_t, ++ pub f_namelen: c_long, ++ pub f_flags: c_long, ++ pub f_spare: [c_long; 5], ++ } ++ ++ pub struct statvfs { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_favail: crate::fsfilcnt_t, ++ pub f_fsid: c_ulong, ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ __f_spare: [c_int; 6], ++ } ++ ++ pub struct statvfs64 { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: u64, ++ pub f_bfree: u64, ++ pub f_bavail: u64, ++ pub f_files: u64, ++ pub f_ffree: u64, ++ pub f_favail: u64, ++ pub f_fsid: c_ulong, ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ __f_spare: [c_int; 6], ++ } ++ ++ pub struct pthread_attr_t { ++ __size: [c_ulong; 7], ++ } ++ ++ pub struct sigaction { ++ pub sa_flags: c_int, ++ pub sa_sigaction: crate::sighandler_t, ++ pub sa_mask: crate::sigset_t, ++ pub sa_restorer: Option, ++ } ++ ++ pub struct stack_t { ++ pub ss_sp: *mut c_void, ++ pub ss_size: size_t, ++ pub ss_flags: c_int, ++ } ++ ++ pub struct siginfo_t { ++ pub si_signo: c_int, ++ pub si_code: c_int, ++ pub si_errno: c_int, ++ _pad: c_int, ++ _pad2: [c_long; 14], ++ } ++ ++ pub struct ipc_perm { ++ pub __key: crate::key_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub cuid: crate::uid_t, ++ pub cgid: crate::gid_t, ++ pub mode: c_uint, ++ pub __seq: c_ushort, ++ __pad1: c_ushort, ++ __unused1: c_ulong, ++ __unused2: c_ulong, ++ } ++ ++ pub struct shmid_ds { ++ pub shm_perm: crate::ipc_perm, ++ pub shm_segsz: size_t, ++ pub shm_atime: crate::time_t, ++ pub shm_dtime: crate::time_t, ++ pub shm_ctime: crate::time_t, ++ pub shm_cpid: crate::pid_t, ++ pub shm_lpid: crate::pid_t, ++ pub shm_nattch: crate::shmatt_t, ++ __unused4: c_ulong, ++ __unused5: c_ulong, ++ } ++} ++ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ #[repr(align(16))] ++ pub struct max_align_t { ++ priv_: [f64; 4], ++ } ++} ++ ++pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; ++pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; ++pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4; ++pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; ++pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; ++pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32; ++ ++#[cfg(target_endian = "little")] ++pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++}; ++#[cfg(target_endian = "little")] ++pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++}; ++#[cfg(target_endian = "little")] ++pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++}; ++#[cfg(target_endian = "big")] ++pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++}; ++#[cfg(target_endian = "big")] ++pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++}; ++#[cfg(target_endian = "big")] ++pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++}; ++ ++pub const SYS_read: c_long = 5000 + 0; ++pub const SYS_write: c_long = 5000 + 1; ++pub const SYS_open: c_long = 5000 + 2; ++pub const SYS_close: c_long = 5000 + 3; ++pub const SYS_stat: c_long = 5000 + 4; ++pub const SYS_fstat: c_long = 5000 + 5; ++pub const SYS_lstat: c_long = 5000 + 6; ++pub const SYS_poll: c_long = 5000 + 7; ++pub const SYS_lseek: c_long = 5000 + 8; ++pub const SYS_mmap: c_long = 5000 + 9; ++pub const SYS_mprotect: c_long = 5000 + 10; ++pub const SYS_munmap: c_long = 5000 + 11; ++pub const SYS_brk: c_long = 5000 + 12; ++pub const SYS_rt_sigaction: c_long = 5000 + 13; ++pub const SYS_rt_sigprocmask: c_long = 5000 + 14; ++pub const SYS_ioctl: c_long = 5000 + 15; ++pub const SYS_pread64: c_long = 5000 + 16; ++pub const SYS_pwrite64: c_long = 5000 + 17; ++pub const SYS_readv: c_long = 5000 + 18; ++pub const SYS_writev: c_long = 5000 + 19; ++pub const SYS_access: c_long = 5000 + 20; ++pub const SYS_pipe: c_long = 5000 + 21; ++pub const SYS__newselect: c_long = 5000 + 22; ++pub const SYS_sched_yield: c_long = 5000 + 23; ++pub const SYS_mremap: c_long = 5000 + 24; ++pub const SYS_msync: c_long = 5000 + 25; ++pub const SYS_mincore: c_long = 5000 + 26; ++pub const SYS_madvise: c_long = 5000 + 27; ++pub const SYS_shmget: c_long = 5000 + 28; ++pub const SYS_shmat: c_long = 5000 + 29; ++pub const SYS_shmctl: c_long = 5000 + 30; ++pub const SYS_dup: c_long = 5000 + 31; ++pub const SYS_dup2: c_long = 5000 + 32; ++pub const SYS_pause: c_long = 5000 + 33; ++pub const SYS_nanosleep: c_long = 5000 + 34; ++pub const SYS_getitimer: c_long = 5000 + 35; ++pub const SYS_setitimer: c_long = 5000 + 36; ++pub const SYS_alarm: c_long = 5000 + 37; ++pub const SYS_getpid: c_long = 5000 + 38; ++pub const SYS_sendfile: c_long = 5000 + 39; ++pub const SYS_socket: c_long = 5000 + 40; ++pub const SYS_connect: c_long = 5000 + 41; ++pub const SYS_accept: c_long = 5000 + 42; ++pub const SYS_sendto: c_long = 5000 + 43; ++pub const SYS_recvfrom: c_long = 5000 + 44; ++pub const SYS_sendmsg: c_long = 5000 + 45; ++pub const SYS_recvmsg: c_long = 5000 + 46; ++pub const SYS_shutdown: c_long = 5000 + 47; ++pub const SYS_bind: c_long = 5000 + 48; ++pub const SYS_listen: c_long = 5000 + 49; ++pub const SYS_getsockname: c_long = 5000 + 50; ++pub const SYS_getpeername: c_long = 5000 + 51; ++pub const SYS_socketpair: c_long = 5000 + 52; ++pub const SYS_setsockopt: c_long = 5000 + 53; ++pub const SYS_getsockopt: c_long = 5000 + 54; ++pub const SYS_clone: c_long = 5000 + 55; ++pub const SYS_fork: c_long = 5000 + 56; ++pub const SYS_execve: c_long = 5000 + 57; ++pub const SYS_exit: c_long = 5000 + 58; ++pub const SYS_wait4: c_long = 5000 + 59; ++pub const SYS_kill: c_long = 5000 + 60; ++pub const SYS_uname: c_long = 5000 + 61; ++pub const SYS_semget: c_long = 5000 + 62; ++pub const SYS_semop: c_long = 5000 + 63; ++pub const SYS_semctl: c_long = 5000 + 64; ++pub const SYS_shmdt: c_long = 5000 + 65; ++pub const SYS_msgget: c_long = 5000 + 66; ++pub const SYS_msgsnd: c_long = 5000 + 67; ++pub const SYS_msgrcv: c_long = 5000 + 68; ++pub const SYS_msgctl: c_long = 5000 + 69; ++pub const SYS_fcntl: c_long = 5000 + 70; ++pub const SYS_flock: c_long = 5000 + 71; ++pub const SYS_fsync: c_long = 5000 + 72; ++pub const SYS_fdatasync: c_long = 5000 + 73; ++pub const SYS_truncate: c_long = 5000 + 74; ++pub const SYS_ftruncate: c_long = 5000 + 75; ++pub const SYS_getdents: c_long = 5000 + 76; ++pub const SYS_getcwd: c_long = 5000 + 77; ++pub const SYS_chdir: c_long = 5000 + 78; ++pub const SYS_fchdir: c_long = 5000 + 79; ++pub const SYS_rename: c_long = 5000 + 80; ++pub const SYS_mkdir: c_long = 5000 + 81; ++pub const SYS_rmdir: c_long = 5000 + 82; ++pub const SYS_creat: c_long = 5000 + 83; ++pub const SYS_link: c_long = 5000 + 84; ++pub const SYS_unlink: c_long = 5000 + 85; ++pub const SYS_symlink: c_long = 5000 + 86; ++pub const SYS_readlink: c_long = 5000 + 87; ++pub const SYS_chmod: c_long = 5000 + 88; ++pub const SYS_fchmod: c_long = 5000 + 89; ++pub const SYS_chown: c_long = 5000 + 90; ++pub const SYS_fchown: c_long = 5000 + 91; ++pub const SYS_lchown: c_long = 5000 + 92; ++pub const SYS_umask: c_long = 5000 + 93; ++pub const SYS_gettimeofday: c_long = 5000 + 94; ++pub const SYS_getrlimit: c_long = 5000 + 95; ++pub const SYS_getrusage: c_long = 5000 + 96; ++pub const SYS_sysinfo: c_long = 5000 + 97; ++pub const SYS_times: c_long = 5000 + 98; ++pub const SYS_ptrace: c_long = 5000 + 99; ++pub const SYS_getuid: c_long = 5000 + 100; ++pub const SYS_syslog: c_long = 5000 + 101; ++pub const SYS_getgid: c_long = 5000 + 102; ++pub const SYS_setuid: c_long = 5000 + 103; ++pub const SYS_setgid: c_long = 5000 + 104; ++pub const SYS_geteuid: c_long = 5000 + 105; ++pub const SYS_getegid: c_long = 5000 + 106; ++pub const SYS_setpgid: c_long = 5000 + 107; ++pub const SYS_getppid: c_long = 5000 + 108; ++pub const SYS_getpgrp: c_long = 5000 + 109; ++pub const SYS_setsid: c_long = 5000 + 110; ++pub const SYS_setreuid: c_long = 5000 + 111; ++pub const SYS_setregid: c_long = 5000 + 112; ++pub const SYS_getgroups: c_long = 5000 + 113; ++pub const SYS_setgroups: c_long = 5000 + 114; ++pub const SYS_setresuid: c_long = 5000 + 115; ++pub const SYS_getresuid: c_long = 5000 + 116; ++pub const SYS_setresgid: c_long = 5000 + 117; ++pub const SYS_getresgid: c_long = 5000 + 118; ++pub const SYS_getpgid: c_long = 5000 + 119; ++pub const SYS_setfsuid: c_long = 5000 + 120; ++pub const SYS_setfsgid: c_long = 5000 + 121; ++pub const SYS_getsid: c_long = 5000 + 122; ++pub const SYS_capget: c_long = 5000 + 123; ++pub const SYS_capset: c_long = 5000 + 124; ++pub const SYS_rt_sigpending: c_long = 5000 + 125; ++pub const SYS_rt_sigtimedwait: c_long = 5000 + 126; ++pub const SYS_rt_sigqueueinfo: c_long = 5000 + 127; ++pub const SYS_rt_sigsuspend: c_long = 5000 + 128; ++pub const SYS_sigaltstack: c_long = 5000 + 129; ++pub const SYS_utime: c_long = 5000 + 130; ++pub const SYS_mknod: c_long = 5000 + 131; ++pub const SYS_personality: c_long = 5000 + 132; ++pub const SYS_ustat: c_long = 5000 + 133; ++pub const SYS_statfs: c_long = 5000 + 134; ++pub const SYS_fstatfs: c_long = 5000 + 135; ++pub const SYS_sysfs: c_long = 5000 + 136; ++pub const SYS_getpriority: c_long = 5000 + 137; ++pub const SYS_setpriority: c_long = 5000 + 138; ++pub const SYS_sched_setparam: c_long = 5000 + 139; ++pub const SYS_sched_getparam: c_long = 5000 + 140; ++pub const SYS_sched_setscheduler: c_long = 5000 + 141; ++pub const SYS_sched_getscheduler: c_long = 5000 + 142; ++pub const SYS_sched_get_priority_max: c_long = 5000 + 143; ++pub const SYS_sched_get_priority_min: c_long = 5000 + 144; ++pub const SYS_sched_rr_get_interval: c_long = 5000 + 145; ++pub const SYS_mlock: c_long = 5000 + 146; ++pub const SYS_munlock: c_long = 5000 + 147; ++pub const SYS_mlockall: c_long = 5000 + 148; ++pub const SYS_munlockall: c_long = 5000 + 149; ++pub const SYS_vhangup: c_long = 5000 + 150; ++pub const SYS_pivot_root: c_long = 5000 + 151; ++pub const SYS__sysctl: c_long = 5000 + 152; ++pub const SYS_prctl: c_long = 5000 + 153; ++pub const SYS_adjtimex: c_long = 5000 + 154; ++pub const SYS_setrlimit: c_long = 5000 + 155; ++pub const SYS_chroot: c_long = 5000 + 156; ++pub const SYS_sync: c_long = 5000 + 157; ++pub const SYS_acct: c_long = 5000 + 158; ++pub const SYS_settimeofday: c_long = 5000 + 159; ++pub const SYS_mount: c_long = 5000 + 160; ++pub const SYS_umount2: c_long = 5000 + 161; ++pub const SYS_swapon: c_long = 5000 + 162; ++pub const SYS_swapoff: c_long = 5000 + 163; ++pub const SYS_reboot: c_long = 5000 + 164; ++pub const SYS_sethostname: c_long = 5000 + 165; ++pub const SYS_setdomainname: c_long = 5000 + 166; ++pub const SYS_create_module: c_long = 5000 + 167; ++pub const SYS_init_module: c_long = 5000 + 168; ++pub const SYS_delete_module: c_long = 5000 + 169; ++pub const SYS_get_kernel_syms: c_long = 5000 + 170; ++pub const SYS_query_module: c_long = 5000 + 171; ++pub const SYS_quotactl: c_long = 5000 + 172; ++pub const SYS_nfsservctl: c_long = 5000 + 173; ++pub const SYS_getpmsg: c_long = 5000 + 174; ++pub const SYS_putpmsg: c_long = 5000 + 175; ++pub const SYS_afs_syscall: c_long = 5000 + 176; ++pub const SYS_gettid: c_long = 5000 + 178; ++pub const SYS_readahead: c_long = 5000 + 179; ++pub const SYS_setxattr: c_long = 5000 + 180; ++pub const SYS_lsetxattr: c_long = 5000 + 181; ++pub const SYS_fsetxattr: c_long = 5000 + 182; ++pub const SYS_getxattr: c_long = 5000 + 183; ++pub const SYS_lgetxattr: c_long = 5000 + 184; ++pub const SYS_fgetxattr: c_long = 5000 + 185; ++pub const SYS_listxattr: c_long = 5000 + 186; ++pub const SYS_llistxattr: c_long = 5000 + 187; ++pub const SYS_flistxattr: c_long = 5000 + 188; ++pub const SYS_removexattr: c_long = 5000 + 189; ++pub const SYS_lremovexattr: c_long = 5000 + 190; ++pub const SYS_fremovexattr: c_long = 5000 + 191; ++pub const SYS_tkill: c_long = 5000 + 192; ++pub const SYS_futex: c_long = 5000 + 194; ++pub const SYS_sched_setaffinity: c_long = 5000 + 195; ++pub const SYS_sched_getaffinity: c_long = 5000 + 196; ++pub const SYS_cacheflush: c_long = 5000 + 197; ++pub const SYS_cachectl: c_long = 5000 + 198; ++pub const SYS_sysmips: c_long = 5000 + 199; ++pub const SYS_io_setup: c_long = 5000 + 200; ++pub const SYS_io_destroy: c_long = 5000 + 201; ++pub const SYS_io_getevents: c_long = 5000 + 202; ++pub const SYS_io_submit: c_long = 5000 + 203; ++pub const SYS_io_cancel: c_long = 5000 + 204; ++pub const SYS_exit_group: c_long = 5000 + 205; ++pub const SYS_lookup_dcookie: c_long = 5000 + 206; ++pub const SYS_epoll_create: c_long = 5000 + 207; ++pub const SYS_epoll_ctl: c_long = 5000 + 208; ++pub const SYS_epoll_wait: c_long = 5000 + 209; ++pub const SYS_remap_file_pages: c_long = 5000 + 210; ++pub const SYS_rt_sigreturn: c_long = 5000 + 211; ++pub const SYS_set_tid_address: c_long = 5000 + 212; ++pub const SYS_restart_syscall: c_long = 5000 + 213; ++pub const SYS_semtimedop: c_long = 5000 + 214; ++pub const SYS_fadvise64: c_long = 5000 + 215; ++pub const SYS_timer_create: c_long = 5000 + 216; ++pub const SYS_timer_settime: c_long = 5000 + 217; ++pub const SYS_timer_gettime: c_long = 5000 + 218; ++pub const SYS_timer_getoverrun: c_long = 5000 + 219; ++pub const SYS_timer_delete: c_long = 5000 + 220; ++pub const SYS_clock_settime: c_long = 5000 + 221; ++pub const SYS_clock_gettime: c_long = 5000 + 222; ++pub const SYS_clock_getres: c_long = 5000 + 223; ++pub const SYS_clock_nanosleep: c_long = 5000 + 224; ++pub const SYS_tgkill: c_long = 5000 + 225; ++pub const SYS_utimes: c_long = 5000 + 226; ++pub const SYS_mbind: c_long = 5000 + 227; ++pub const SYS_get_mempolicy: c_long = 5000 + 228; ++pub const SYS_set_mempolicy: c_long = 5000 + 229; ++pub const SYS_mq_open: c_long = 5000 + 230; ++pub const SYS_mq_unlink: c_long = 5000 + 231; ++pub const SYS_mq_timedsend: c_long = 5000 + 232; ++pub const SYS_mq_timedreceive: c_long = 5000 + 233; ++pub const SYS_mq_notify: c_long = 5000 + 234; ++pub const SYS_mq_getsetattr: c_long = 5000 + 235; ++pub const SYS_vserver: c_long = 5000 + 236; ++pub const SYS_waitid: c_long = 5000 + 237; ++/* pub const SYS_sys_setaltroot: c_long = 5000 + 238; */ ++pub const SYS_add_key: c_long = 5000 + 239; ++pub const SYS_request_key: c_long = 5000 + 240; ++pub const SYS_keyctl: c_long = 5000 + 241; ++pub const SYS_set_thread_area: c_long = 5000 + 242; ++pub const SYS_inotify_init: c_long = 5000 + 243; ++pub const SYS_inotify_add_watch: c_long = 5000 + 244; ++pub const SYS_inotify_rm_watch: c_long = 5000 + 245; ++pub const SYS_migrate_pages: c_long = 5000 + 246; ++pub const SYS_openat: c_long = 5000 + 247; ++pub const SYS_mkdirat: c_long = 5000 + 248; ++pub const SYS_mknodat: c_long = 5000 + 249; ++pub const SYS_fchownat: c_long = 5000 + 250; ++pub const SYS_futimesat: c_long = 5000 + 251; ++pub const SYS_newfstatat: c_long = 5000 + 252; ++pub const SYS_unlinkat: c_long = 5000 + 253; ++pub const SYS_renameat: c_long = 5000 + 254; ++pub const SYS_linkat: c_long = 5000 + 255; ++pub const SYS_symlinkat: c_long = 5000 + 256; ++pub const SYS_readlinkat: c_long = 5000 + 257; ++pub const SYS_fchmodat: c_long = 5000 + 258; ++pub const SYS_faccessat: c_long = 5000 + 259; ++pub const SYS_pselect6: c_long = 5000 + 260; ++pub const SYS_ppoll: c_long = 5000 + 261; ++pub const SYS_unshare: c_long = 5000 + 262; ++pub const SYS_splice: c_long = 5000 + 263; ++pub const SYS_sync_file_range: c_long = 5000 + 264; ++pub const SYS_tee: c_long = 5000 + 265; ++pub const SYS_vmsplice: c_long = 5000 + 266; ++pub const SYS_move_pages: c_long = 5000 + 267; ++pub const SYS_set_robust_list: c_long = 5000 + 268; ++pub const SYS_get_robust_list: c_long = 5000 + 269; ++pub const SYS_kexec_load: c_long = 5000 + 270; ++pub const SYS_getcpu: c_long = 5000 + 271; ++pub const SYS_epoll_pwait: c_long = 5000 + 272; ++pub const SYS_ioprio_set: c_long = 5000 + 273; ++pub const SYS_ioprio_get: c_long = 5000 + 274; ++pub const SYS_utimensat: c_long = 5000 + 275; ++pub const SYS_signalfd: c_long = 5000 + 276; ++pub const SYS_timerfd: c_long = 5000 + 277; ++pub const SYS_eventfd: c_long = 5000 + 278; ++pub const SYS_fallocate: c_long = 5000 + 279; ++pub const SYS_timerfd_create: c_long = 5000 + 280; ++pub const SYS_timerfd_gettime: c_long = 5000 + 281; ++pub const SYS_timerfd_settime: c_long = 5000 + 282; ++pub const SYS_signalfd4: c_long = 5000 + 283; ++pub const SYS_eventfd2: c_long = 5000 + 284; ++pub const SYS_epoll_create1: c_long = 5000 + 285; ++pub const SYS_dup3: c_long = 5000 + 286; ++pub const SYS_pipe2: c_long = 5000 + 287; ++pub const SYS_inotify_init1: c_long = 5000 + 288; ++pub const SYS_preadv: c_long = 5000 + 289; ++pub const SYS_pwritev: c_long = 5000 + 290; ++pub const SYS_rt_tgsigqueueinfo: c_long = 5000 + 291; ++pub const SYS_perf_event_open: c_long = 5000 + 292; ++pub const SYS_accept4: c_long = 5000 + 293; ++pub const SYS_recvmmsg: c_long = 5000 + 294; ++pub const SYS_fanotify_init: c_long = 5000 + 295; ++pub const SYS_fanotify_mark: c_long = 5000 + 296; ++pub const SYS_prlimit64: c_long = 5000 + 297; ++pub const SYS_name_to_handle_at: c_long = 5000 + 298; ++pub const SYS_open_by_handle_at: c_long = 5000 + 299; ++pub const SYS_clock_adjtime: c_long = 5000 + 300; ++pub const SYS_syncfs: c_long = 5000 + 301; ++pub const SYS_sendmmsg: c_long = 5000 + 302; ++pub const SYS_setns: c_long = 5000 + 303; ++pub const SYS_process_vm_readv: c_long = 5000 + 304; ++pub const SYS_process_vm_writev: c_long = 5000 + 305; ++pub const SYS_kcmp: c_long = 5000 + 306; ++pub const SYS_finit_module: c_long = 5000 + 307; ++pub const SYS_getdents64: c_long = 5000 + 308; ++pub const SYS_sched_setattr: c_long = 5000 + 309; ++pub const SYS_sched_getattr: c_long = 5000 + 310; ++pub const SYS_renameat2: c_long = 5000 + 311; ++pub const SYS_seccomp: c_long = 5000 + 312; ++pub const SYS_getrandom: c_long = 5000 + 313; ++pub const SYS_memfd_create: c_long = 5000 + 314; ++pub const SYS_bpf: c_long = 5000 + 315; ++pub const SYS_execveat: c_long = 5000 + 316; ++pub const SYS_userfaultfd: c_long = 5000 + 317; ++pub const SYS_membarrier: c_long = 5000 + 318; ++pub const SYS_mlock2: c_long = 5000 + 319; ++pub const SYS_copy_file_range: c_long = 5000 + 320; ++pub const SYS_preadv2: c_long = 5000 + 321; ++pub const SYS_pwritev2: c_long = 5000 + 322; ++pub const SYS_pkey_mprotect: c_long = 5000 + 323; ++pub const SYS_pkey_alloc: c_long = 5000 + 324; ++pub const SYS_pkey_free: c_long = 5000 + 325; ++pub const SYS_statx: c_long = 5000 + 326; ++pub const SYS_rseq: c_long = 5000 + 327; ++pub const SYS_pidfd_send_signal: c_long = 5000 + 424; ++pub const SYS_io_uring_setup: c_long = 5000 + 425; ++pub const SYS_io_uring_enter: c_long = 5000 + 426; ++pub const SYS_io_uring_register: c_long = 5000 + 427; ++pub const SYS_open_tree: c_long = 5000 + 428; ++pub const SYS_move_mount: c_long = 5000 + 429; ++pub const SYS_fsopen: c_long = 5000 + 430; ++pub const SYS_fsconfig: c_long = 5000 + 431; ++pub const SYS_fsmount: c_long = 5000 + 432; ++pub const SYS_fspick: c_long = 5000 + 433; ++pub const SYS_pidfd_open: c_long = 5000 + 434; ++pub const SYS_clone3: c_long = 5000 + 435; ++pub const SYS_close_range: c_long = 5000 + 436; ++pub const SYS_openat2: c_long = 5000 + 437; ++pub const SYS_pidfd_getfd: c_long = 5000 + 438; ++pub const SYS_faccessat2: c_long = 5000 + 439; ++pub const SYS_process_madvise: c_long = 5000 + 440; ++pub const SYS_epoll_pwait2: c_long = 5000 + 441; ++pub const SYS_mount_setattr: c_long = 5000 + 442; ++pub const SYS_quotactl_fd: c_long = 5000 + 443; ++pub const SYS_landlock_create_ruleset: c_long = 5000 + 444; ++pub const SYS_landlock_add_rule: c_long = 5000 + 445; ++pub const SYS_landlock_restrict_self: c_long = 5000 + 446; ++pub const SYS_memfd_secret: c_long = 5000 + 447; ++pub const SYS_process_mrelease: c_long = 5000 + 448; ++pub const SYS_futex_waitv: c_long = 5000 + 449; ++pub const SYS_set_mempolicy_home_node: c_long = 5000 + 450; ++ ++pub const SFD_CLOEXEC: c_int = 0x080000; ++ ++pub const NCCS: usize = 32; ++ ++pub const O_TRUNC: c_int = 512; ++ ++pub const O_NOATIME: c_int = 0o1000000; ++pub const O_CLOEXEC: c_int = 0x80000; ++pub const O_PATH: c_int = 0o10000000; ++pub const O_TMPFILE: c_int = 0o20000000 | O_DIRECTORY; ++ ++pub const EBFONT: c_int = 59; ++pub const ENOSTR: c_int = 60; ++pub const ENODATA: c_int = 61; ++pub const ETIME: c_int = 62; ++pub const ENOSR: c_int = 63; ++pub const ENONET: c_int = 64; ++pub const ENOPKG: c_int = 65; ++pub const EREMOTE: c_int = 66; ++pub const ENOLINK: c_int = 67; ++pub const EADV: c_int = 68; ++pub const ESRMNT: c_int = 69; ++pub const ECOMM: c_int = 70; ++pub const EPROTO: c_int = 71; ++pub const EDOTDOT: c_int = 73; ++ ++pub const SA_NODEFER: c_int = 0x40000000; ++pub const SA_RESETHAND: c_int = 0x80000000; ++pub const SA_RESTART: c_int = 0x10000000; ++pub const SA_NOCLDSTOP: c_int = 0x00000001; ++ ++pub const POSIX_FADV_DONTNEED: c_int = 4; ++pub const POSIX_FADV_NOREUSE: c_int = 5; ++ ++pub const EPOLL_CLOEXEC: c_int = 0x80000; ++ ++pub const EFD_CLOEXEC: c_int = 0x80000; ++ ++pub const O_DIRECT: c_int = 0x8000; ++pub const O_DIRECTORY: c_int = 0x10000; ++pub const O_NOFOLLOW: c_int = 0x20000; ++ ++pub const O_APPEND: c_int = 8; ++pub const O_CREAT: c_int = 256; ++pub const O_EXCL: c_int = 1024; ++pub const O_NOCTTY: c_int = 2048; ++pub const O_NONBLOCK: c_int = 128; ++pub const O_SYNC: c_int = 0x4010; ++pub const O_RSYNC: c_int = 0x4010; ++pub const O_DSYNC: c_int = 0x10; ++pub const O_FSYNC: c_int = 0x4010; ++pub const O_ASYNC: c_int = 0x1000; ++pub const O_NDELAY: c_int = 0x80; ++ ++pub const EDEADLK: c_int = 45; ++pub const ENAMETOOLONG: c_int = 78; ++pub const ENOLCK: c_int = 46; ++pub const ENOSYS: c_int = 89; ++pub const ENOTEMPTY: c_int = 93; ++pub const ELOOP: c_int = 90; ++pub const ENOMSG: c_int = 35; ++pub const EIDRM: c_int = 36; ++pub const ECHRNG: c_int = 37; ++pub const EL2NSYNC: c_int = 38; ++pub const EL3HLT: c_int = 39; ++pub const EL3RST: c_int = 40; ++pub const ELNRNG: c_int = 41; ++pub const EUNATCH: c_int = 42; ++pub const ENOCSI: c_int = 43; ++pub const EL2HLT: c_int = 44; ++pub const EBADE: c_int = 50; ++pub const EBADR: c_int = 51; ++pub const EXFULL: c_int = 52; ++pub const ENOANO: c_int = 53; ++pub const EBADRQC: c_int = 54; ++pub const EBADSLT: c_int = 55; ++pub const EDEADLOCK: c_int = 56; ++pub const EMULTIHOP: c_int = 74; ++pub const EOVERFLOW: c_int = 79; ++pub const ENOTUNIQ: c_int = 80; ++pub const EBADFD: c_int = 81; ++pub const EBADMSG: c_int = 77; ++pub const EREMCHG: c_int = 82; ++pub const ELIBACC: c_int = 83; ++pub const ELIBBAD: c_int = 84; ++pub const ELIBSCN: c_int = 85; ++pub const ELIBMAX: c_int = 86; ++pub const ELIBEXEC: c_int = 87; ++pub const EILSEQ: c_int = 88; ++pub const ERESTART: c_int = 91; ++pub const ESTRPIPE: c_int = 92; ++pub const EUSERS: c_int = 94; ++pub const ENOTSOCK: c_int = 95; ++pub const EDESTADDRREQ: c_int = 96; ++pub const EMSGSIZE: c_int = 97; ++pub const EPROTOTYPE: c_int = 98; ++pub const ENOPROTOOPT: c_int = 99; ++pub const EPROTONOSUPPORT: c_int = 120; ++pub const ESOCKTNOSUPPORT: c_int = 121; ++pub const EOPNOTSUPP: c_int = 122; ++pub const EPFNOSUPPORT: c_int = 123; ++pub const EAFNOSUPPORT: c_int = 124; ++pub const EADDRINUSE: c_int = 125; ++pub const EADDRNOTAVAIL: c_int = 126; ++pub const ENETDOWN: c_int = 127; ++pub const ENETUNREACH: c_int = 128; ++pub const ENETRESET: c_int = 129; ++pub const ECONNABORTED: c_int = 130; ++pub const ECONNRESET: c_int = 131; ++pub const ENOBUFS: c_int = 132; ++pub const EISCONN: c_int = 133; ++pub const ENOTCONN: c_int = 134; ++pub const ESHUTDOWN: c_int = 143; ++pub const ETOOMANYREFS: c_int = 144; ++pub const ETIMEDOUT: c_int = 145; ++pub const ECONNREFUSED: c_int = 146; ++pub const EHOSTDOWN: c_int = 147; ++pub const EHOSTUNREACH: c_int = 148; ++pub const EALREADY: c_int = 149; ++pub const EINPROGRESS: c_int = 150; ++pub const ESTALE: c_int = 151; ++pub const EUCLEAN: c_int = 135; ++pub const ENOTNAM: c_int = 137; ++pub const ENAVAIL: c_int = 138; ++pub const EISNAM: c_int = 139; ++pub const EREMOTEIO: c_int = 140; ++pub const EDQUOT: c_int = 1133; ++pub const ENOMEDIUM: c_int = 159; ++pub const EMEDIUMTYPE: c_int = 160; ++pub const ECANCELED: c_int = 158; ++pub const ENOKEY: c_int = 161; ++pub const EKEYEXPIRED: c_int = 162; ++pub const EKEYREVOKED: c_int = 163; ++pub const EKEYREJECTED: c_int = 164; ++pub const EOWNERDEAD: c_int = 165; ++pub const ENOTRECOVERABLE: c_int = 166; ++pub const ERFKILL: c_int = 167; ++ ++pub const MAP_NORESERVE: c_int = 0x400; ++pub const MAP_ANON: c_int = 0x800; ++pub const MAP_ANONYMOUS: c_int = 0x800; ++pub const MAP_GROWSDOWN: c_int = 0x1000; ++pub const MAP_DENYWRITE: c_int = 0x2000; ++pub const MAP_EXECUTABLE: c_int = 0x4000; ++pub const MAP_LOCKED: c_int = 0x8000; ++pub const MAP_POPULATE: c_int = 0x10000; ++pub const MAP_NONBLOCK: c_int = 0x20000; ++pub const MAP_STACK: c_int = 0x40000; ++pub const MAP_HUGETLB: c_int = 0x080000; ++ ++pub const SOCK_STREAM: c_int = 2; ++pub const SOCK_DGRAM: c_int = 1; ++ ++pub const SA_ONSTACK: c_int = 0x08000000; ++pub const SA_SIGINFO: c_int = 0x00000008; ++pub const SA_NOCLDWAIT: c_int = 0x00010000; ++ ++pub const SIGCHLD: c_int = 18; ++pub const SIGBUS: c_int = 10; ++pub const SIGTTIN: c_int = 26; ++pub const SIGTTOU: c_int = 27; ++pub const SIGXCPU: c_int = 30; ++pub const SIGXFSZ: c_int = 31; ++pub const SIGVTALRM: c_int = 28; ++pub const SIGPROF: c_int = 29; ++pub const SIGWINCH: c_int = 20; ++pub const SIGUSR1: c_int = 16; ++pub const SIGUSR2: c_int = 17; ++pub const SIGCONT: c_int = 25; ++pub const SIGSTOP: c_int = 23; ++pub const SIGTSTP: c_int = 24; ++pub const SIGURG: c_int = 21; ++pub const SIGIO: c_int = 22; ++pub const SIGSYS: c_int = 12; ++pub const SIGPOLL: c_int = 22; ++pub const SIGPWR: c_int = 19; ++pub const SIG_SETMASK: c_int = 3; ++pub const SIG_BLOCK: c_int = 0x1; ++pub const SIG_UNBLOCK: c_int = 0x2; ++ ++pub const POLLWRNORM: c_short = 0x004; ++pub const POLLWRBAND: c_short = 0x100; ++ ++pub const VEOF: usize = 16; ++pub const VEOL: usize = 17; ++pub const VEOL2: usize = 6; ++pub const VMIN: usize = 4; ++pub const IEXTEN: crate::tcflag_t = 0x00000100; ++pub const TOSTOP: crate::tcflag_t = 0x00008000; ++pub const FLUSHO: crate::tcflag_t = 0x00002000; ++pub const EXTPROC: crate::tcflag_t = 0o200000; ++pub const TCSANOW: c_int = 0x540e; ++pub const TCSADRAIN: c_int = 0x540f; ++pub const TCSAFLUSH: c_int = 0x5410; ++ ++pub const PTRACE_GETFPREGS: c_uint = 14; ++pub const PTRACE_SETFPREGS: c_uint = 15; ++pub const PTRACE_DETACH: c_uint = 17; ++pub const PTRACE_GETFPXREGS: c_uint = 18; ++pub const PTRACE_SETFPXREGS: c_uint = 19; ++pub const PTRACE_GETREGS: c_uint = 12; ++pub const PTRACE_SETREGS: c_uint = 13; ++ ++pub const EFD_NONBLOCK: c_int = 0x80; ++ ++pub const F_RDLCK: c_int = 0; ++pub const F_WRLCK: c_int = 1; ++pub const F_UNLCK: c_int = 2; ++pub const F_GETLK: c_int = 14; ++pub const F_GETOWN: c_int = 23; ++pub const F_SETOWN: c_int = 24; ++pub const F_SETLK: c_int = 6; ++pub const F_SETLKW: c_int = 7; ++pub const F_OFD_GETLK: c_int = 36; ++pub const F_OFD_SETLK: c_int = 37; ++pub const F_OFD_SETLKW: c_int = 38; ++ ++pub const SFD_NONBLOCK: c_int = 0x80; ++ ++pub const RTLD_DEEPBIND: c_int = 0x10; ++pub const RTLD_GLOBAL: c_int = 0x4; ++pub const RTLD_NOLOAD: c_int = 0x8; ++ ++pub const MCL_CURRENT: c_int = 0x0001; ++pub const MCL_FUTURE: c_int = 0x0002; ++pub const MCL_ONFAULT: c_int = 0x0004; ++ ++pub const SIGSTKSZ: size_t = 8192; ++pub const MINSIGSTKSZ: size_t = 2048; ++pub const CBAUD: crate::tcflag_t = 0o0010017; ++pub const TAB1: crate::tcflag_t = 0x00000800; ++pub const TAB2: crate::tcflag_t = 0x00001000; ++pub const TAB3: crate::tcflag_t = 0x00001800; ++pub const CR1: crate::tcflag_t = 0x00000200; ++pub const CR2: crate::tcflag_t = 0x00000400; ++pub const CR3: crate::tcflag_t = 0x00000600; ++pub const FF1: crate::tcflag_t = 0x00008000; ++pub const BS1: crate::tcflag_t = 0x00002000; ++pub const VT1: crate::tcflag_t = 0x00004000; ++pub const VWERASE: usize = 14; ++pub const VREPRINT: usize = 12; ++pub const VSUSP: usize = 10; ++pub const VSTART: usize = 8; ++pub const VSTOP: usize = 9; ++pub const VDISCARD: usize = 13; ++pub const VTIME: usize = 5; ++pub const IXON: crate::tcflag_t = 0x00000400; ++pub const IXOFF: crate::tcflag_t = 0x00001000; ++pub const ONLCR: crate::tcflag_t = 0x4; ++pub const CSIZE: crate::tcflag_t = 0x00000030; ++pub const CS6: crate::tcflag_t = 0x00000010; ++pub const CS7: crate::tcflag_t = 0x00000020; ++pub const CS8: crate::tcflag_t = 0x00000030; ++pub const CSTOPB: crate::tcflag_t = 0x00000040; ++pub const CREAD: crate::tcflag_t = 0x00000080; ++pub const PARENB: crate::tcflag_t = 0x00000100; ++pub const PARODD: crate::tcflag_t = 0x00000200; ++pub const HUPCL: crate::tcflag_t = 0x00000400; ++pub const CLOCAL: crate::tcflag_t = 0x00000800; ++pub const ECHOKE: crate::tcflag_t = 0x00000800; ++pub const ECHOE: crate::tcflag_t = 0x00000010; ++pub const ECHOK: crate::tcflag_t = 0x00000020; ++pub const ECHONL: crate::tcflag_t = 0x00000040; ++pub const ECHOPRT: crate::tcflag_t = 0x00000400; ++pub const ECHOCTL: crate::tcflag_t = 0x00000200; ++pub const ISIG: crate::tcflag_t = 0x00000001; ++pub const ICANON: crate::tcflag_t = 0x00000002; ++pub const PENDIN: crate::tcflag_t = 0x00004000; ++pub const NOFLSH: crate::tcflag_t = 0x00000080; ++pub const CIBAUD: crate::tcflag_t = 0o02003600000; ++pub const CBAUDEX: crate::tcflag_t = 0o010000; ++pub const VSWTC: usize = 7; ++pub const OLCUC: crate::tcflag_t = 0o000002; ++pub const NLDLY: crate::tcflag_t = 0o000400; ++pub const CRDLY: crate::tcflag_t = 0o003000; ++pub const TABDLY: crate::tcflag_t = 0o014000; ++pub const BSDLY: crate::tcflag_t = 0o020000; ++pub const FFDLY: crate::tcflag_t = 0o100000; ++pub const VTDLY: crate::tcflag_t = 0o040000; ++pub const XTABS: crate::tcflag_t = 0o014000; ++ ++pub const B0: crate::speed_t = 0o000000; ++pub const B50: crate::speed_t = 0o000001; ++pub const B75: crate::speed_t = 0o000002; ++pub const B110: crate::speed_t = 0o000003; ++pub const B134: crate::speed_t = 0o000004; ++pub const B150: crate::speed_t = 0o000005; ++pub const B200: crate::speed_t = 0o000006; ++pub const B300: crate::speed_t = 0o000007; ++pub const B600: crate::speed_t = 0o000010; ++pub const B1200: crate::speed_t = 0o000011; ++pub const B1800: crate::speed_t = 0o000012; ++pub const B2400: crate::speed_t = 0o000013; ++pub const B4800: crate::speed_t = 0o000014; ++pub const B9600: crate::speed_t = 0o000015; ++pub const B19200: crate::speed_t = 0o000016; ++pub const B38400: crate::speed_t = 0o000017; ++pub const EXTA: crate::speed_t = B19200; ++pub const EXTB: crate::speed_t = B38400; ++pub const B57600: crate::speed_t = 0o010001; ++pub const B115200: crate::speed_t = 0o010002; ++pub const B230400: crate::speed_t = 0o010003; ++pub const B460800: crate::speed_t = 0o010004; ++pub const B500000: crate::speed_t = 0o010005; ++pub const B576000: crate::speed_t = 0o010006; ++pub const B921600: crate::speed_t = 0o010007; ++pub const B1000000: crate::speed_t = 0o010010; ++pub const B1152000: crate::speed_t = 0o010011; ++pub const B1500000: crate::speed_t = 0o010012; ++pub const B2000000: crate::speed_t = 0o010013; ++pub const B2500000: crate::speed_t = 0o010014; ++pub const B3000000: crate::speed_t = 0o010015; ++pub const B3500000: crate::speed_t = 0o010016; ++pub const B4000000: crate::speed_t = 0o010017; ++ ++pub const EHWPOISON: c_int = 168; ++ ++extern "C" { ++ pub fn sysctl( ++ name: *mut c_int, ++ namelen: c_int, ++ oldp: *mut c_void, ++ oldlenp: *mut size_t, ++ newp: *mut c_void, ++ newlen: size_t, ++ ) -> c_int; ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/mod.rs 2024-12-28 15:35:00.000000000 -0500 +@@ -0,0 +1,184 @@ ++//! 64-bit specific definitions for linux-like values ++ ++use crate::prelude::*; ++ ++use crate::ntptimeval; ++ ++pub type ino_t = u64; ++pub type off_t = i64; ++pub type blkcnt_t = i64; ++pub type shmatt_t = u64; ++pub type msgqnum_t = u64; ++pub type msglen_t = u64; ++pub type fsblkcnt_t = u64; ++pub type fsfilcnt_t = u64; ++pub type rlim_t = u64; ++ ++cfg_if! { ++ if #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] { ++ pub type __syscall_ulong_t = c_ulonglong; ++ pub type __syscall_slong_t = c_longlong; ++ } else { ++ pub type __syscall_ulong_t = c_ulong; ++ pub type __syscall_slong_t = c_long; ++ } ++} ++cfg_if! { ++ if #[cfg(all(target_arch = "aarch64", target_pointer_width = "32"))] { ++ pub type clock_t = i32; ++ pub type time_t = i32; ++ pub type __fsword_t = i32; ++ } else { ++ pub type __fsword_t = i64; ++ pub type clock_t = i64; ++ pub type time_t = i64; ++ } ++} ++ ++s! { ++ pub struct sigset_t { ++ #[cfg(target_pointer_width = "32")] ++ __val: [u32; 32], ++ #[cfg(target_pointer_width = "64")] ++ __val: [u64; 16], ++ } ++ ++ pub struct sysinfo { ++ pub uptime: i64, ++ pub loads: [u64; 3], ++ pub totalram: u64, ++ pub freeram: u64, ++ pub sharedram: u64, ++ pub bufferram: u64, ++ pub totalswap: u64, ++ pub freeswap: u64, ++ pub procs: c_ushort, ++ pub pad: c_ushort, ++ pub totalhigh: u64, ++ pub freehigh: u64, ++ pub mem_unit: c_uint, ++ pub _f: [c_char; 0], ++ } ++ ++ pub struct msqid_ds { ++ pub msg_perm: crate::ipc_perm, ++ pub msg_stime: crate::time_t, ++ pub msg_rtime: crate::time_t, ++ pub msg_ctime: crate::time_t, ++ __msg_cbytes: u64, ++ pub msg_qnum: crate::msgqnum_t, ++ pub msg_qbytes: crate::msglen_t, ++ pub msg_lspid: crate::pid_t, ++ pub msg_lrpid: crate::pid_t, ++ __glibc_reserved4: u64, ++ __glibc_reserved5: u64, ++ } ++ ++ pub struct semid_ds { ++ pub sem_perm: ipc_perm, ++ pub sem_otime: crate::time_t, ++ #[cfg(not(any( ++ target_arch = "aarch64", ++ target_arch = "loongarch64", ++ target_arch = "mips64", ++ target_arch = "mips64r6", ++ target_arch = "powerpc64", ++ target_arch = "riscv64", ++ target_arch = "sparc64" ++ )))] ++ __reserved: crate::__syscall_ulong_t, ++ pub sem_ctime: crate::time_t, ++ #[cfg(not(any( ++ target_arch = "aarch64", ++ target_arch = "loongarch64", ++ target_arch = "mips64", ++ target_arch = "mips64r6", ++ target_arch = "powerpc64", ++ target_arch = "riscv64", ++ target_arch = "sparc64" ++ )))] ++ __reserved2: crate::__syscall_ulong_t, ++ pub sem_nsems: crate::__syscall_ulong_t, ++ __glibc_reserved3: crate::__syscall_ulong_t, ++ __glibc_reserved4: crate::__syscall_ulong_t, ++ } ++ ++ pub struct timex { ++ pub modes: c_uint, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ pub __unused_pad1: i32, ++ pub offset: crate::__syscall_slong_t, ++ pub freq: crate::__syscall_slong_t, ++ pub maxerror: crate::__syscall_slong_t, ++ pub esterror: crate::__syscall_slong_t, ++ pub status: c_int, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ pub __unused_pad2: i32, ++ pub constant: crate::__syscall_slong_t, ++ pub precision: crate::__syscall_slong_t, ++ pub tolerance: crate::__syscall_slong_t, ++ pub time: crate::timeval, ++ pub tick: crate::__syscall_slong_t, ++ pub ppsfreq: crate::__syscall_slong_t, ++ pub jitter: crate::__syscall_slong_t, ++ pub shift: c_int, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ pub __unused_pad3: i32, ++ pub stabil: crate::__syscall_slong_t, ++ pub jitcnt: crate::__syscall_slong_t, ++ pub calcnt: crate::__syscall_slong_t, ++ pub errcnt: crate::__syscall_slong_t, ++ pub stbcnt: crate::__syscall_slong_t, ++ pub tai: c_int, ++ pub __unused1: i32, ++ pub __unused2: i32, ++ pub __unused3: i32, ++ pub __unused4: i32, ++ pub __unused5: i32, ++ pub __unused6: i32, ++ pub __unused7: i32, ++ pub __unused8: i32, ++ pub __unused9: i32, ++ pub __unused10: i32, ++ pub __unused11: i32, ++ } ++} ++ ++pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8; ++ ++pub const O_LARGEFILE: c_int = 0; ++ ++extern "C" { ++ #[link_name = "ntp_gettimex"] ++ pub fn ntp_gettime(buf: *mut crate::ntptimeval) -> c_int; ++} ++ ++cfg_if! { ++ if #[cfg(target_arch = "aarch64")] { ++ mod aarch64; ++ pub use self::aarch64::*; ++ } else if #[cfg(any(target_arch = "powerpc64"))] { ++ mod powerpc64; ++ pub use self::powerpc64::*; ++ } else if #[cfg(any(target_arch = "sparc64"))] { ++ mod sparc64; ++ pub use self::sparc64::*; ++ } else if #[cfg(any(target_arch = "mips64", target_arch = "mips64r6"))] { ++ mod mips64; ++ pub use self::mips64::*; ++ } else if #[cfg(any(target_arch = "s390x"))] { ++ mod s390x; ++ pub use self::s390x::*; ++ } else if #[cfg(any(target_arch = "x86_64"))] { ++ mod x86_64; ++ pub use self::x86_64::*; ++ } else if #[cfg(any(target_arch = "riscv64"))] { ++ mod riscv64; ++ pub use self::riscv64::*; ++ } else if #[cfg(any(target_arch = "loongarch64"))] { ++ mod loongarch64; ++ pub use self::loongarch64::*; ++ } else { ++ // Unknown target_arch ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/powerpc64/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,973 @@ ++//! PowerPC64-specific definitions for 64-bit linux-like values ++ ++use crate::prelude::*; ++use crate::{off64_t, off_t, pthread_mutex_t}; ++ ++pub type c_long = i64; ++pub type c_ulong = u64; ++pub type c_char = u8; ++pub type wchar_t = i32; ++pub type nlink_t = u64; ++pub type blksize_t = i64; ++pub type suseconds_t = i64; ++pub type __u64 = c_ulong; ++pub type __s64 = c_long; ++ ++s! { ++ pub struct sigaction { ++ pub sa_sigaction: crate::sighandler_t, ++ pub sa_mask: crate::sigset_t, ++ #[cfg(target_arch = "sparc64")] ++ __reserved0: c_int, ++ pub sa_flags: c_int, ++ pub sa_restorer: Option, ++ } ++ ++ pub struct statfs { ++ pub f_type: crate::__fsword_t, ++ pub f_bsize: crate::__fsword_t, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_fsid: crate::fsid_t, ++ ++ pub f_namelen: crate::__fsword_t, ++ pub f_frsize: crate::__fsword_t, ++ f_spare: [crate::__fsword_t; 5], ++ } ++ ++ pub struct flock { ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ pub l_start: off_t, ++ pub l_len: off_t, ++ pub l_pid: crate::pid_t, ++ } ++ ++ pub struct flock64 { ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ pub l_start: off64_t, ++ pub l_len: off64_t, ++ pub l_pid: crate::pid_t, ++ } ++ ++ pub struct stat { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_mode: crate::mode_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ __pad0: c_int, ++ pub st_rdev: crate::dev_t, ++ pub st_size: off_t, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ __unused: [c_long; 3], ++ } ++ ++ pub struct stat64 { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino64_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_mode: crate::mode_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ __pad0: c_int, ++ pub st_rdev: crate::dev_t, ++ pub st_size: off64_t, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt64_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ __reserved: [c_long; 3], ++ } ++ ++ pub struct statfs64 { ++ pub f_type: crate::__fsword_t, ++ pub f_bsize: crate::__fsword_t, ++ pub f_blocks: u64, ++ pub f_bfree: u64, ++ pub f_bavail: u64, ++ pub f_files: u64, ++ pub f_ffree: u64, ++ pub f_fsid: crate::fsid_t, ++ pub f_namelen: crate::__fsword_t, ++ pub f_frsize: crate::__fsword_t, ++ pub f_flags: crate::__fsword_t, ++ pub f_spare: [crate::__fsword_t; 4], ++ } ++ ++ pub struct statvfs { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_favail: crate::fsfilcnt_t, ++ pub f_fsid: c_ulong, ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ __f_spare: [c_int; 6], ++ } ++ ++ pub struct statvfs64 { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: u64, ++ pub f_bfree: u64, ++ pub f_bavail: u64, ++ pub f_files: u64, ++ pub f_ffree: u64, ++ pub f_favail: u64, ++ pub f_fsid: c_ulong, ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ __f_spare: [c_int; 6], ++ } ++ ++ pub struct pthread_attr_t { ++ __size: [u64; 7], ++ } ++ ++ pub struct ipc_perm { ++ pub __key: crate::key_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub cuid: crate::uid_t, ++ pub cgid: crate::gid_t, ++ pub mode: crate::mode_t, ++ pub __seq: u32, ++ __pad1: u32, ++ __unused1: u64, ++ __unused2: c_ulong, ++ } ++ ++ pub struct shmid_ds { ++ pub shm_perm: crate::ipc_perm, ++ pub shm_atime: crate::time_t, ++ pub shm_dtime: crate::time_t, ++ pub shm_ctime: crate::time_t, ++ pub shm_segsz: size_t, ++ pub shm_cpid: crate::pid_t, ++ pub shm_lpid: crate::pid_t, ++ pub shm_nattch: crate::shmatt_t, ++ __unused4: c_ulong, ++ __unused5: c_ulong, ++ } ++ ++ pub struct siginfo_t { ++ pub si_signo: c_int, ++ pub si_errno: c_int, ++ pub si_code: c_int, ++ #[doc(hidden)] ++ #[deprecated( ++ since = "0.2.54", ++ note = "Please leave a comment on \ ++ https://github.com/rust-lang/libc/pull/1316 if you're using \ ++ this field" ++ )] ++ pub _pad: [c_int; 29], ++ _align: [usize; 0], ++ } ++ ++ pub struct stack_t { ++ pub ss_sp: *mut c_void, ++ pub ss_flags: c_int, ++ pub ss_size: size_t, ++ } ++} ++ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ #[repr(align(16))] ++ pub struct max_align_t { ++ priv_: [i64; 4], ++ } ++} ++ ++pub const POSIX_FADV_DONTNEED: c_int = 4; ++pub const POSIX_FADV_NOREUSE: c_int = 5; ++ ++pub const RTLD_DEEPBIND: c_int = 0x8; ++pub const RTLD_GLOBAL: c_int = 0x100; ++pub const RTLD_NOLOAD: c_int = 0x4; ++pub const VEOF: usize = 4; ++pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; ++pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32; ++ ++pub const O_APPEND: c_int = 1024; ++pub const O_CREAT: c_int = 64; ++pub const O_EXCL: c_int = 128; ++pub const O_NOCTTY: c_int = 256; ++pub const O_NONBLOCK: c_int = 2048; ++pub const O_SYNC: c_int = 1052672; ++pub const O_RSYNC: c_int = 1052672; ++pub const O_DSYNC: c_int = 4096; ++pub const O_FSYNC: c_int = 0x101000; ++pub const O_NOATIME: c_int = 0o1000000; ++pub const O_PATH: c_int = 0o10000000; ++pub const O_TMPFILE: c_int = 0o20000000 | O_DIRECTORY; ++ ++pub const MADV_SOFT_OFFLINE: c_int = 101; ++pub const MAP_GROWSDOWN: c_int = 0x0100; ++pub const MAP_ANON: c_int = 0x0020; ++pub const MAP_ANONYMOUS: c_int = 0x0020; ++pub const MAP_DENYWRITE: c_int = 0x0800; ++pub const MAP_EXECUTABLE: c_int = 0x01000; ++pub const MAP_POPULATE: c_int = 0x08000; ++pub const MAP_NONBLOCK: c_int = 0x010000; ++pub const MAP_STACK: c_int = 0x020000; ++pub const MAP_HUGETLB: c_int = 0x040000; ++ ++pub const EDEADLK: c_int = 35; ++pub const ENAMETOOLONG: c_int = 36; ++pub const ENOLCK: c_int = 37; ++pub const ENOSYS: c_int = 38; ++pub const ENOTEMPTY: c_int = 39; ++pub const ELOOP: c_int = 40; ++pub const ENOMSG: c_int = 42; ++pub const EIDRM: c_int = 43; ++pub const ECHRNG: c_int = 44; ++pub const EL2NSYNC: c_int = 45; ++pub const EL3HLT: c_int = 46; ++pub const EL3RST: c_int = 47; ++pub const ELNRNG: c_int = 48; ++pub const EUNATCH: c_int = 49; ++pub const ENOCSI: c_int = 50; ++pub const EL2HLT: c_int = 51; ++pub const EBADE: c_int = 52; ++pub const EBADR: c_int = 53; ++pub const EXFULL: c_int = 54; ++pub const ENOANO: c_int = 55; ++pub const EBADRQC: c_int = 56; ++pub const EBADSLT: c_int = 57; ++pub const EMULTIHOP: c_int = 72; ++pub const EOVERFLOW: c_int = 75; ++pub const ENOTUNIQ: c_int = 76; ++pub const EBADFD: c_int = 77; ++pub const EBADMSG: c_int = 74; ++pub const EREMCHG: c_int = 78; ++pub const ELIBACC: c_int = 79; ++pub const ELIBBAD: c_int = 80; ++pub const ELIBSCN: c_int = 81; ++pub const ELIBMAX: c_int = 82; ++pub const ELIBEXEC: c_int = 83; ++pub const EILSEQ: c_int = 84; ++pub const ERESTART: c_int = 85; ++pub const ESTRPIPE: c_int = 86; ++pub const EUSERS: c_int = 87; ++pub const ENOTSOCK: c_int = 88; ++pub const EDESTADDRREQ: c_int = 89; ++pub const EMSGSIZE: c_int = 90; ++pub const EPROTOTYPE: c_int = 91; ++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 EPFNOSUPPORT: c_int = 96; ++pub const EAFNOSUPPORT: c_int = 97; ++pub const EADDRINUSE: c_int = 98; ++pub const EADDRNOTAVAIL: c_int = 99; ++pub const ENETDOWN: c_int = 100; ++pub const ENETUNREACH: c_int = 101; ++pub const ENETRESET: c_int = 102; ++pub const ECONNABORTED: c_int = 103; ++pub const ECONNRESET: c_int = 104; ++pub const ENOBUFS: c_int = 105; ++pub const EISCONN: c_int = 106; ++pub const ENOTCONN: c_int = 107; ++pub const ESHUTDOWN: c_int = 108; ++pub const ETOOMANYREFS: c_int = 109; ++pub const ETIMEDOUT: c_int = 110; ++pub const ECONNREFUSED: c_int = 111; ++pub const EHOSTDOWN: c_int = 112; ++pub const EHOSTUNREACH: c_int = 113; ++pub const EALREADY: c_int = 114; ++pub const EINPROGRESS: c_int = 115; ++pub const ESTALE: c_int = 116; ++pub const EDQUOT: c_int = 122; ++pub const ENOMEDIUM: c_int = 123; ++pub const EMEDIUMTYPE: c_int = 124; ++pub const ECANCELED: c_int = 125; ++pub const ENOKEY: c_int = 126; ++pub const EKEYEXPIRED: c_int = 127; ++pub const EKEYREVOKED: c_int = 128; ++pub const EKEYREJECTED: c_int = 129; ++pub const EOWNERDEAD: c_int = 130; ++pub const ENOTRECOVERABLE: c_int = 131; ++pub const EHWPOISON: c_int = 133; ++pub const ERFKILL: c_int = 132; ++ ++pub const SOCK_STREAM: c_int = 1; ++pub const SOCK_DGRAM: c_int = 2; ++ ++pub const SA_ONSTACK: c_int = 0x08000000; ++pub const SA_SIGINFO: c_int = 0x00000004; ++pub const SA_NOCLDWAIT: c_int = 0x00000002; ++ ++pub const SIGTTIN: c_int = 21; ++pub const SIGTTOU: c_int = 22; ++pub const SIGXCPU: c_int = 24; ++pub const SIGXFSZ: c_int = 25; ++pub const SIGVTALRM: c_int = 26; ++pub const SIGPROF: c_int = 27; ++pub const SIGWINCH: c_int = 28; ++pub const SIGCHLD: c_int = 17; ++pub const SIGBUS: c_int = 7; ++pub const SIGUSR1: c_int = 10; ++pub const SIGUSR2: c_int = 12; ++pub const SIGCONT: c_int = 18; ++pub const SIGSTOP: c_int = 19; ++pub const SIGTSTP: c_int = 20; ++pub const SIGURG: c_int = 23; ++pub const SIGIO: c_int = 29; ++pub const SIGSYS: c_int = 31; ++pub const SIGSTKFLT: c_int = 16; ++#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")] ++pub const SIGUNUSED: c_int = 31; ++pub const SIGPOLL: c_int = 29; ++pub const SIGPWR: c_int = 30; ++pub const SIG_SETMASK: c_int = 2; ++pub const SIG_BLOCK: c_int = 0x000000; ++pub const SIG_UNBLOCK: c_int = 0x01; ++ ++pub const POLLWRNORM: c_short = 0x100; ++pub const POLLWRBAND: c_short = 0x200; ++ ++pub const O_ASYNC: c_int = 0x2000; ++pub const O_NDELAY: c_int = 0x800; ++ ++pub const PTRACE_DETACH: c_uint = 17; ++ ++pub const EFD_NONBLOCK: c_int = 0x800; ++ ++pub const F_GETLK: c_int = 5; ++pub const F_GETOWN: c_int = 9; ++pub const F_SETOWN: c_int = 8; ++pub const F_SETLK: c_int = 6; ++pub const F_SETLKW: c_int = 7; ++pub const F_OFD_GETLK: c_int = 36; ++pub const F_OFD_SETLK: c_int = 37; ++pub const F_OFD_SETLKW: c_int = 38; ++ ++pub const F_RDLCK: c_int = 0; ++pub const F_WRLCK: c_int = 1; ++pub const F_UNLCK: c_int = 2; ++ ++pub const SFD_NONBLOCK: c_int = 0x0800; ++ ++pub const TCSANOW: c_int = 0; ++pub const TCSADRAIN: c_int = 1; ++pub const TCSAFLUSH: c_int = 2; ++ ++pub const SFD_CLOEXEC: c_int = 0x080000; ++ ++pub const NCCS: usize = 32; ++ ++pub const O_TRUNC: c_int = 512; ++ ++pub const O_CLOEXEC: c_int = 0x80000; ++ ++pub const EBFONT: c_int = 59; ++pub const ENOSTR: c_int = 60; ++pub const ENODATA: c_int = 61; ++pub const ETIME: c_int = 62; ++pub const ENOSR: c_int = 63; ++pub const ENONET: c_int = 64; ++pub const ENOPKG: c_int = 65; ++pub const EREMOTE: c_int = 66; ++pub const ENOLINK: c_int = 67; ++pub const EADV: c_int = 68; ++pub const ESRMNT: c_int = 69; ++pub const ECOMM: c_int = 70; ++pub const EPROTO: c_int = 71; ++pub const EDOTDOT: c_int = 73; ++ ++pub const SA_NODEFER: c_int = 0x40000000; ++pub const SA_RESETHAND: c_int = 0x80000000; ++pub const SA_RESTART: c_int = 0x10000000; ++pub const SA_NOCLDSTOP: c_int = 0x00000001; ++ ++pub const EPOLL_CLOEXEC: c_int = 0x80000; ++ ++pub const EFD_CLOEXEC: c_int = 0x80000; ++ ++pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; ++pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; ++pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; ++pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4; ++ ++#[cfg(target_endian = "little")] ++pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++}; ++#[cfg(target_endian = "little")] ++pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++}; ++#[cfg(target_endian = "little")] ++pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++}; ++#[cfg(target_endian = "big")] ++pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++}; ++#[cfg(target_endian = "big")] ++pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++}; ++#[cfg(target_endian = "big")] ++pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++}; ++ ++pub const O_DIRECTORY: c_int = 0x4000; ++pub const O_NOFOLLOW: c_int = 0x8000; ++pub const O_DIRECT: c_int = 0x20000; ++ ++pub const MAP_LOCKED: c_int = 0x00080; ++pub const MAP_NORESERVE: c_int = 0x00040; ++pub const MAP_SYNC: c_int = 0x080000; ++ ++pub const EDEADLOCK: c_int = 58; ++pub const EUCLEAN: c_int = 117; ++pub const ENOTNAM: c_int = 118; ++pub const ENAVAIL: c_int = 119; ++pub const EISNAM: c_int = 120; ++pub const EREMOTEIO: c_int = 121; ++ ++pub const MCL_CURRENT: c_int = 0x2000; ++pub const MCL_FUTURE: c_int = 0x4000; ++pub const MCL_ONFAULT: c_int = 0x8000; ++ ++pub const SIGSTKSZ: size_t = 0x4000; ++pub const MINSIGSTKSZ: size_t = 4096; ++pub const CBAUD: crate::tcflag_t = 0xff; ++pub const TAB1: crate::tcflag_t = 0x400; ++pub const TAB2: crate::tcflag_t = 0x800; ++pub const TAB3: crate::tcflag_t = 0xc00; ++pub const CR1: crate::tcflag_t = 0x1000; ++pub const CR2: crate::tcflag_t = 0x2000; ++pub const CR3: crate::tcflag_t = 0x3000; ++pub const FF1: crate::tcflag_t = 0x4000; ++pub const BS1: crate::tcflag_t = 0x8000; ++pub const VT1: crate::tcflag_t = 0x10000; ++pub const VWERASE: usize = 0xa; ++pub const VREPRINT: usize = 0xb; ++pub const VSUSP: usize = 0xc; ++pub const VSTART: usize = 0xd; ++pub const VSTOP: usize = 0xe; ++pub const VDISCARD: usize = 0x10; ++pub const VTIME: usize = 0x7; ++pub const IXON: crate::tcflag_t = 0x200; ++pub const IXOFF: crate::tcflag_t = 0x400; ++pub const ONLCR: crate::tcflag_t = 0x2; ++pub const CSIZE: crate::tcflag_t = 0x300; ++pub const CS6: crate::tcflag_t = 0x100; ++pub const CS7: crate::tcflag_t = 0x200; ++pub const CS8: crate::tcflag_t = 0x300; ++pub const CSTOPB: crate::tcflag_t = 0x400; ++pub const CREAD: crate::tcflag_t = 0x800; ++pub const PARENB: crate::tcflag_t = 0x1000; ++pub const PARODD: crate::tcflag_t = 0x2000; ++pub const HUPCL: crate::tcflag_t = 0x4000; ++pub const CLOCAL: crate::tcflag_t = 0x8000; ++pub const ECHOKE: crate::tcflag_t = 0x1; ++pub const ECHOE: crate::tcflag_t = 0x2; ++pub const ECHOK: crate::tcflag_t = 0x4; ++pub const ECHONL: crate::tcflag_t = 0x10; ++pub const ECHOPRT: crate::tcflag_t = 0x20; ++pub const ECHOCTL: crate::tcflag_t = 0x40; ++pub const ISIG: crate::tcflag_t = 0x80; ++pub const ICANON: crate::tcflag_t = 0x100; ++pub const PENDIN: crate::tcflag_t = 0x20000000; ++pub const NOFLSH: crate::tcflag_t = 0x80000000; ++pub const VSWTC: usize = 9; ++pub const OLCUC: crate::tcflag_t = 0o000004; ++pub const NLDLY: crate::tcflag_t = 0o001400; ++pub const CRDLY: crate::tcflag_t = 0o030000; ++pub const TABDLY: crate::tcflag_t = 0o006000; ++pub const BSDLY: crate::tcflag_t = 0o100000; ++pub const FFDLY: crate::tcflag_t = 0o040000; ++pub const VTDLY: crate::tcflag_t = 0o200000; ++pub const XTABS: crate::tcflag_t = 0o006000; ++ ++pub const B0: crate::speed_t = 0o000000; ++pub const B50: crate::speed_t = 0o000001; ++pub const B75: crate::speed_t = 0o000002; ++pub const B110: crate::speed_t = 0o000003; ++pub const B134: crate::speed_t = 0o000004; ++pub const B150: crate::speed_t = 0o000005; ++pub const B200: crate::speed_t = 0o000006; ++pub const B300: crate::speed_t = 0o000007; ++pub const B600: crate::speed_t = 0o000010; ++pub const B1200: crate::speed_t = 0o000011; ++pub const B1800: crate::speed_t = 0o000012; ++pub const B2400: crate::speed_t = 0o000013; ++pub const B4800: crate::speed_t = 0o000014; ++pub const B9600: crate::speed_t = 0o000015; ++pub const B19200: crate::speed_t = 0o000016; ++pub const B38400: crate::speed_t = 0o000017; ++pub const EXTA: crate::speed_t = B19200; ++pub const EXTB: crate::speed_t = B38400; ++pub const CBAUDEX: crate::speed_t = 0o000020; ++pub const B57600: crate::speed_t = 0o0020; ++pub const B115200: crate::speed_t = 0o0021; ++pub const B230400: crate::speed_t = 0o0022; ++pub const B460800: crate::speed_t = 0o0023; ++pub const B500000: crate::speed_t = 0o0024; ++pub const B576000: crate::speed_t = 0o0025; ++pub const B921600: crate::speed_t = 0o0026; ++pub const B1000000: crate::speed_t = 0o0027; ++pub const B1152000: crate::speed_t = 0o0030; ++pub const B1500000: crate::speed_t = 0o0031; ++pub const B2000000: crate::speed_t = 0o0032; ++pub const B2500000: crate::speed_t = 0o0033; ++pub const B3000000: crate::speed_t = 0o0034; ++pub const B3500000: crate::speed_t = 0o0035; ++pub const B4000000: crate::speed_t = 0o0036; ++ ++pub const VEOL: usize = 6; ++pub const VEOL2: usize = 8; ++pub const VMIN: usize = 5; ++pub const IEXTEN: crate::tcflag_t = 0x400; ++pub const TOSTOP: crate::tcflag_t = 0x400000; ++pub const FLUSHO: crate::tcflag_t = 0x800000; ++pub const EXTPROC: crate::tcflag_t = 0x10000000; ++ ++// Syscall table ++pub const SYS_restart_syscall: c_long = 0; ++pub const SYS_exit: c_long = 1; ++pub const SYS_fork: c_long = 2; ++pub const SYS_read: c_long = 3; ++pub const SYS_write: c_long = 4; ++pub const SYS_open: c_long = 5; ++pub const SYS_close: c_long = 6; ++pub const SYS_waitpid: c_long = 7; ++pub const SYS_creat: c_long = 8; ++pub const SYS_link: c_long = 9; ++pub const SYS_unlink: c_long = 10; ++pub const SYS_execve: c_long = 11; ++pub const SYS_chdir: c_long = 12; ++pub const SYS_time: c_long = 13; ++pub const SYS_mknod: c_long = 14; ++pub const SYS_chmod: c_long = 15; ++pub const SYS_lchown: c_long = 16; ++pub const SYS_break: c_long = 17; ++pub const SYS_oldstat: c_long = 18; ++pub const SYS_lseek: c_long = 19; ++pub const SYS_getpid: c_long = 20; ++pub const SYS_mount: c_long = 21; ++pub const SYS_umount: c_long = 22; ++pub const SYS_setuid: c_long = 23; ++pub const SYS_getuid: c_long = 24; ++pub const SYS_stime: c_long = 25; ++pub const SYS_ptrace: c_long = 26; ++pub const SYS_alarm: c_long = 27; ++pub const SYS_oldfstat: c_long = 28; ++pub const SYS_pause: c_long = 29; ++pub const SYS_utime: c_long = 30; ++pub const SYS_stty: c_long = 31; ++pub const SYS_gtty: c_long = 32; ++pub const SYS_access: c_long = 33; ++pub const SYS_nice: c_long = 34; ++pub const SYS_ftime: c_long = 35; ++pub const SYS_sync: c_long = 36; ++pub const SYS_kill: c_long = 37; ++pub const SYS_rename: c_long = 38; ++pub const SYS_mkdir: c_long = 39; ++pub const SYS_rmdir: c_long = 40; ++pub const SYS_dup: c_long = 41; ++pub const SYS_pipe: c_long = 42; ++pub const SYS_times: c_long = 43; ++pub const SYS_prof: c_long = 44; ++pub const SYS_brk: c_long = 45; ++pub const SYS_setgid: c_long = 46; ++pub const SYS_getgid: c_long = 47; ++pub const SYS_signal: c_long = 48; ++pub const SYS_geteuid: c_long = 49; ++pub const SYS_getegid: c_long = 50; ++pub const SYS_acct: c_long = 51; ++pub const SYS_umount2: c_long = 52; ++pub const SYS_lock: c_long = 53; ++pub const SYS_ioctl: c_long = 54; ++pub const SYS_fcntl: c_long = 55; ++pub const SYS_mpx: c_long = 56; ++pub const SYS_setpgid: c_long = 57; ++pub const SYS_ulimit: c_long = 58; ++pub const SYS_oldolduname: c_long = 59; ++pub const SYS_umask: c_long = 60; ++pub const SYS_chroot: c_long = 61; ++pub const SYS_ustat: c_long = 62; ++pub const SYS_dup2: c_long = 63; ++pub const SYS_getppid: c_long = 64; ++pub const SYS_getpgrp: c_long = 65; ++pub const SYS_setsid: c_long = 66; ++pub const SYS_sigaction: c_long = 67; ++pub const SYS_sgetmask: c_long = 68; ++pub const SYS_ssetmask: c_long = 69; ++pub const SYS_setreuid: c_long = 70; ++pub const SYS_setregid: c_long = 71; ++pub const SYS_sigsuspend: c_long = 72; ++pub const SYS_sigpending: c_long = 73; ++pub const SYS_sethostname: c_long = 74; ++pub const SYS_setrlimit: c_long = 75; ++pub const SYS_getrlimit: c_long = 76; ++pub const SYS_getrusage: c_long = 77; ++pub const SYS_gettimeofday: c_long = 78; ++pub const SYS_settimeofday: c_long = 79; ++pub const SYS_getgroups: c_long = 80; ++pub const SYS_setgroups: c_long = 81; ++pub const SYS_select: c_long = 82; ++pub const SYS_symlink: c_long = 83; ++pub const SYS_oldlstat: c_long = 84; ++pub const SYS_readlink: c_long = 85; ++pub const SYS_uselib: c_long = 86; ++pub const SYS_swapon: c_long = 87; ++pub const SYS_reboot: c_long = 88; ++pub const SYS_readdir: c_long = 89; ++pub const SYS_mmap: c_long = 90; ++pub const SYS_munmap: c_long = 91; ++pub const SYS_truncate: c_long = 92; ++pub const SYS_ftruncate: c_long = 93; ++pub const SYS_fchmod: c_long = 94; ++pub const SYS_fchown: c_long = 95; ++pub const SYS_getpriority: c_long = 96; ++pub const SYS_setpriority: c_long = 97; ++pub const SYS_profil: c_long = 98; ++pub const SYS_statfs: c_long = 99; ++pub const SYS_fstatfs: c_long = 100; ++pub const SYS_ioperm: c_long = 101; ++pub const SYS_socketcall: c_long = 102; ++pub const SYS_syslog: c_long = 103; ++pub const SYS_setitimer: c_long = 104; ++pub const SYS_getitimer: c_long = 105; ++pub const SYS_stat: c_long = 106; ++pub const SYS_lstat: c_long = 107; ++pub const SYS_fstat: c_long = 108; ++pub const SYS_olduname: c_long = 109; ++pub const SYS_iopl: c_long = 110; ++pub const SYS_vhangup: c_long = 111; ++pub const SYS_idle: c_long = 112; ++pub const SYS_vm86: c_long = 113; ++pub const SYS_wait4: c_long = 114; ++pub const SYS_swapoff: c_long = 115; ++pub const SYS_sysinfo: c_long = 116; ++pub const SYS_ipc: c_long = 117; ++pub const SYS_fsync: c_long = 118; ++pub const SYS_sigreturn: c_long = 119; ++pub const SYS_clone: c_long = 120; ++pub const SYS_setdomainname: c_long = 121; ++pub const SYS_uname: c_long = 122; ++pub const SYS_modify_ldt: c_long = 123; ++pub const SYS_adjtimex: c_long = 124; ++pub const SYS_mprotect: c_long = 125; ++pub const SYS_sigprocmask: c_long = 126; ++pub const SYS_create_module: c_long = 127; ++pub const SYS_init_module: c_long = 128; ++pub const SYS_delete_module: c_long = 129; ++pub const SYS_get_kernel_syms: c_long = 130; ++pub const SYS_quotactl: c_long = 131; ++pub const SYS_getpgid: c_long = 132; ++pub const SYS_fchdir: c_long = 133; ++pub const SYS_bdflush: c_long = 134; ++pub const SYS_sysfs: c_long = 135; ++pub const SYS_personality: c_long = 136; ++pub const SYS_afs_syscall: c_long = 137; /* Syscall for Andrew File System */ ++pub const SYS_setfsuid: c_long = 138; ++pub const SYS_setfsgid: c_long = 139; ++pub const SYS__llseek: c_long = 140; ++pub const SYS_getdents: c_long = 141; ++pub const SYS__newselect: c_long = 142; ++pub const SYS_flock: c_long = 143; ++pub const SYS_msync: c_long = 144; ++pub const SYS_readv: c_long = 145; ++pub const SYS_writev: c_long = 146; ++pub const SYS_getsid: c_long = 147; ++pub const SYS_fdatasync: c_long = 148; ++pub const SYS__sysctl: c_long = 149; ++pub const SYS_mlock: c_long = 150; ++pub const SYS_munlock: c_long = 151; ++pub const SYS_mlockall: c_long = 152; ++pub const SYS_munlockall: c_long = 153; ++pub const SYS_sched_setparam: c_long = 154; ++pub const SYS_sched_getparam: c_long = 155; ++pub const SYS_sched_setscheduler: c_long = 156; ++pub const SYS_sched_getscheduler: c_long = 157; ++pub const SYS_sched_yield: c_long = 158; ++pub const SYS_sched_get_priority_max: c_long = 159; ++pub const SYS_sched_get_priority_min: c_long = 160; ++pub const SYS_sched_rr_get_interval: c_long = 161; ++pub const SYS_nanosleep: c_long = 162; ++pub const SYS_mremap: c_long = 163; ++pub const SYS_setresuid: c_long = 164; ++pub const SYS_getresuid: c_long = 165; ++pub const SYS_query_module: c_long = 166; ++pub const SYS_poll: c_long = 167; ++pub const SYS_nfsservctl: c_long = 168; ++pub const SYS_setresgid: c_long = 169; ++pub const SYS_getresgid: c_long = 170; ++pub const SYS_prctl: c_long = 171; ++pub const SYS_rt_sigreturn: c_long = 172; ++pub const SYS_rt_sigaction: c_long = 173; ++pub const SYS_rt_sigprocmask: c_long = 174; ++pub const SYS_rt_sigpending: c_long = 175; ++pub const SYS_rt_sigtimedwait: c_long = 176; ++pub const SYS_rt_sigqueueinfo: c_long = 177; ++pub const SYS_rt_sigsuspend: c_long = 178; ++pub const SYS_pread64: c_long = 179; ++pub const SYS_pwrite64: c_long = 180; ++pub const SYS_chown: c_long = 181; ++pub const SYS_getcwd: c_long = 182; ++pub const SYS_capget: c_long = 183; ++pub const SYS_capset: c_long = 184; ++pub const SYS_sigaltstack: c_long = 185; ++pub const SYS_sendfile: c_long = 186; ++pub const SYS_getpmsg: c_long = 187; /* some people actually want streams */ ++pub const SYS_putpmsg: c_long = 188; /* some people actually want streams */ ++pub const SYS_vfork: c_long = 189; ++pub const SYS_ugetrlimit: c_long = 190; /* SuS compliant getrlimit */ ++pub const SYS_readahead: c_long = 191; ++pub const SYS_pciconfig_read: c_long = 198; ++pub const SYS_pciconfig_write: c_long = 199; ++pub const SYS_pciconfig_iobase: c_long = 200; ++pub const SYS_multiplexer: c_long = 201; ++pub const SYS_getdents64: c_long = 202; ++pub const SYS_pivot_root: c_long = 203; ++pub const SYS_madvise: c_long = 205; ++pub const SYS_mincore: c_long = 206; ++pub const SYS_gettid: c_long = 207; ++pub const SYS_tkill: c_long = 208; ++pub const SYS_setxattr: c_long = 209; ++pub const SYS_lsetxattr: c_long = 210; ++pub const SYS_fsetxattr: c_long = 211; ++pub const SYS_getxattr: c_long = 212; ++pub const SYS_lgetxattr: c_long = 213; ++pub const SYS_fgetxattr: c_long = 214; ++pub const SYS_listxattr: c_long = 215; ++pub const SYS_llistxattr: c_long = 216; ++pub const SYS_flistxattr: c_long = 217; ++pub const SYS_removexattr: c_long = 218; ++pub const SYS_lremovexattr: c_long = 219; ++pub const SYS_fremovexattr: c_long = 220; ++pub const SYS_futex: c_long = 221; ++pub const SYS_sched_setaffinity: c_long = 222; ++pub const SYS_sched_getaffinity: c_long = 223; ++pub const SYS_tuxcall: c_long = 225; ++pub const SYS_io_setup: c_long = 227; ++pub const SYS_io_destroy: c_long = 228; ++pub const SYS_io_getevents: c_long = 229; ++pub const SYS_io_submit: c_long = 230; ++pub const SYS_io_cancel: c_long = 231; ++pub const SYS_set_tid_address: c_long = 232; ++pub const SYS_exit_group: c_long = 234; ++pub const SYS_lookup_dcookie: c_long = 235; ++pub const SYS_epoll_create: c_long = 236; ++pub const SYS_epoll_ctl: c_long = 237; ++pub const SYS_epoll_wait: c_long = 238; ++pub const SYS_remap_file_pages: c_long = 239; ++pub const SYS_timer_create: c_long = 240; ++pub const SYS_timer_settime: c_long = 241; ++pub const SYS_timer_gettime: c_long = 242; ++pub const SYS_timer_getoverrun: c_long = 243; ++pub const SYS_timer_delete: c_long = 244; ++pub const SYS_clock_settime: c_long = 245; ++pub const SYS_clock_gettime: c_long = 246; ++pub const SYS_clock_getres: c_long = 247; ++pub const SYS_clock_nanosleep: c_long = 248; ++pub const SYS_swapcontext: c_long = 249; ++pub const SYS_tgkill: c_long = 250; ++pub const SYS_utimes: c_long = 251; ++pub const SYS_statfs64: c_long = 252; ++pub const SYS_fstatfs64: c_long = 253; ++pub const SYS_rtas: c_long = 255; ++pub const SYS_sys_debug_setcontext: c_long = 256; ++pub const SYS_migrate_pages: c_long = 258; ++pub const SYS_mbind: c_long = 259; ++pub const SYS_get_mempolicy: c_long = 260; ++pub const SYS_set_mempolicy: c_long = 261; ++pub const SYS_mq_open: c_long = 262; ++pub const SYS_mq_unlink: c_long = 263; ++pub const SYS_mq_timedsend: c_long = 264; ++pub const SYS_mq_timedreceive: c_long = 265; ++pub const SYS_mq_notify: c_long = 266; ++pub const SYS_mq_getsetattr: c_long = 267; ++pub const SYS_kexec_load: c_long = 268; ++pub const SYS_add_key: c_long = 269; ++pub const SYS_request_key: c_long = 270; ++pub const SYS_keyctl: c_long = 271; ++pub const SYS_waitid: c_long = 272; ++pub const SYS_ioprio_set: c_long = 273; ++pub const SYS_ioprio_get: c_long = 274; ++pub const SYS_inotify_init: c_long = 275; ++pub const SYS_inotify_add_watch: c_long = 276; ++pub const SYS_inotify_rm_watch: c_long = 277; ++pub const SYS_spu_run: c_long = 278; ++pub const SYS_spu_create: c_long = 279; ++pub const SYS_pselect6: c_long = 280; ++pub const SYS_ppoll: c_long = 281; ++pub const SYS_unshare: c_long = 282; ++pub const SYS_splice: c_long = 283; ++pub const SYS_tee: c_long = 284; ++pub const SYS_vmsplice: c_long = 285; ++pub const SYS_openat: c_long = 286; ++pub const SYS_mkdirat: c_long = 287; ++pub const SYS_mknodat: c_long = 288; ++pub const SYS_fchownat: c_long = 289; ++pub const SYS_futimesat: c_long = 290; ++pub const SYS_newfstatat: c_long = 291; ++pub const SYS_unlinkat: c_long = 292; ++pub const SYS_renameat: c_long = 293; ++pub const SYS_linkat: c_long = 294; ++pub const SYS_symlinkat: c_long = 295; ++pub const SYS_readlinkat: c_long = 296; ++pub const SYS_fchmodat: c_long = 297; ++pub const SYS_faccessat: c_long = 298; ++pub const SYS_get_robust_list: c_long = 299; ++pub const SYS_set_robust_list: c_long = 300; ++pub const SYS_move_pages: c_long = 301; ++pub const SYS_getcpu: c_long = 302; ++pub const SYS_epoll_pwait: c_long = 303; ++pub const SYS_utimensat: c_long = 304; ++pub const SYS_signalfd: c_long = 305; ++pub const SYS_timerfd_create: c_long = 306; ++pub const SYS_eventfd: c_long = 307; ++pub const SYS_sync_file_range2: c_long = 308; ++pub const SYS_fallocate: c_long = 309; ++pub const SYS_subpage_prot: c_long = 310; ++pub const SYS_timerfd_settime: c_long = 311; ++pub const SYS_timerfd_gettime: c_long = 312; ++pub const SYS_signalfd4: c_long = 313; ++pub const SYS_eventfd2: c_long = 314; ++pub const SYS_epoll_create1: c_long = 315; ++pub const SYS_dup3: c_long = 316; ++pub const SYS_pipe2: c_long = 317; ++pub const SYS_inotify_init1: c_long = 318; ++pub const SYS_perf_event_open: c_long = 319; ++pub const SYS_preadv: c_long = 320; ++pub const SYS_pwritev: c_long = 321; ++pub const SYS_rt_tgsigqueueinfo: c_long = 322; ++pub const SYS_fanotify_init: c_long = 323; ++pub const SYS_fanotify_mark: c_long = 324; ++pub const SYS_prlimit64: c_long = 325; ++pub const SYS_socket: c_long = 326; ++pub const SYS_bind: c_long = 327; ++pub const SYS_connect: c_long = 328; ++pub const SYS_listen: c_long = 329; ++pub const SYS_accept: c_long = 330; ++pub const SYS_getsockname: c_long = 331; ++pub const SYS_getpeername: c_long = 332; ++pub const SYS_socketpair: c_long = 333; ++pub const SYS_send: c_long = 334; ++pub const SYS_sendto: c_long = 335; ++pub const SYS_recv: c_long = 336; ++pub const SYS_recvfrom: c_long = 337; ++pub const SYS_shutdown: c_long = 338; ++pub const SYS_setsockopt: c_long = 339; ++pub const SYS_getsockopt: c_long = 340; ++pub const SYS_sendmsg: c_long = 341; ++pub const SYS_recvmsg: c_long = 342; ++pub const SYS_recvmmsg: c_long = 343; ++pub const SYS_accept4: c_long = 344; ++pub const SYS_name_to_handle_at: c_long = 345; ++pub const SYS_open_by_handle_at: c_long = 346; ++pub const SYS_clock_adjtime: c_long = 347; ++pub const SYS_syncfs: c_long = 348; ++pub const SYS_sendmmsg: c_long = 349; ++pub const SYS_setns: c_long = 350; ++pub const SYS_process_vm_readv: c_long = 351; ++pub const SYS_process_vm_writev: c_long = 352; ++pub const SYS_finit_module: c_long = 353; ++pub const SYS_kcmp: c_long = 354; ++pub const SYS_sched_setattr: c_long = 355; ++pub const SYS_sched_getattr: c_long = 356; ++pub const SYS_renameat2: c_long = 357; ++pub const SYS_seccomp: c_long = 358; ++pub const SYS_getrandom: c_long = 359; ++pub const SYS_memfd_create: c_long = 360; ++pub const SYS_bpf: c_long = 361; ++pub const SYS_execveat: c_long = 362; ++pub const SYS_switch_endian: c_long = 363; ++pub const SYS_userfaultfd: c_long = 364; ++pub const SYS_membarrier: c_long = 365; ++pub const SYS_mlock2: c_long = 378; ++pub const SYS_copy_file_range: c_long = 379; ++pub const SYS_preadv2: c_long = 380; ++pub const SYS_pwritev2: c_long = 381; ++pub const SYS_kexec_file_load: c_long = 382; ++pub const SYS_statx: c_long = 383; ++pub const SYS_rseq: c_long = 387; ++pub const SYS_pidfd_send_signal: c_long = 424; ++pub const SYS_io_uring_setup: c_long = 425; ++pub const SYS_io_uring_enter: c_long = 426; ++pub const SYS_io_uring_register: c_long = 427; ++pub const SYS_open_tree: c_long = 428; ++pub const SYS_move_mount: c_long = 429; ++pub const SYS_fsopen: c_long = 430; ++pub const SYS_fsconfig: c_long = 431; ++pub const SYS_fsmount: c_long = 432; ++pub const SYS_fspick: c_long = 433; ++pub const SYS_pidfd_open: c_long = 434; ++pub const SYS_clone3: c_long = 435; ++pub const SYS_close_range: c_long = 436; ++pub const SYS_openat2: c_long = 437; ++pub const SYS_pidfd_getfd: c_long = 438; ++pub const SYS_faccessat2: c_long = 439; ++pub const SYS_process_madvise: c_long = 440; ++pub const SYS_epoll_pwait2: c_long = 441; ++pub const SYS_mount_setattr: c_long = 442; ++pub const SYS_quotactl_fd: c_long = 443; ++pub const SYS_landlock_create_ruleset: c_long = 444; ++pub const SYS_landlock_add_rule: c_long = 445; ++pub const SYS_landlock_restrict_self: c_long = 446; ++pub const SYS_memfd_secret: c_long = 447; ++pub const SYS_process_mrelease: c_long = 448; ++pub const SYS_futex_waitv: c_long = 449; ++pub const SYS_set_mempolicy_home_node: c_long = 450; ++ ++extern "C" { ++ pub fn sysctl( ++ name: *mut c_int, ++ namelen: c_int, ++ oldp: *mut c_void, ++ oldlenp: *mut size_t, ++ newp: *mut c_void, ++ newlen: size_t, ++ ) -> c_int; ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/riscv64/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,915 @@ ++//! RISC-V-specific definitions for 64-bit linux-like values ++ ++use crate::prelude::*; ++use crate::{off64_t, off_t}; ++ ++pub type c_char = u8; ++pub type c_long = i64; ++pub type c_ulong = u64; ++pub type wchar_t = c_int; ++ ++pub type nlink_t = c_uint; ++pub type blksize_t = c_int; ++pub type fsblkcnt64_t = c_ulong; ++pub type fsfilcnt64_t = c_ulong; ++pub type suseconds_t = i64; ++pub type __u64 = c_ulonglong; ++pub type __s64 = c_longlong; ++ ++s! { ++ pub struct pthread_attr_t { ++ __size: [c_ulong; 7], ++ } ++ ++ pub struct stat { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ pub __pad1: crate::dev_t, ++ pub st_size: off_t, ++ pub st_blksize: crate::blksize_t, ++ pub __pad2: c_int, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ __unused: [c_int; 2usize], ++ } ++ ++ pub struct stat64 { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino64_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ pub __pad1: crate::dev_t, ++ pub st_size: off64_t, ++ pub st_blksize: crate::blksize_t, ++ pub __pad2: c_int, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ __unused: [c_int; 2], ++ } ++ ++ pub struct statfs { ++ pub f_type: c_long, ++ pub f_bsize: c_long, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_fsid: crate::fsid_t, ++ pub f_namelen: c_long, ++ pub f_frsize: c_long, ++ pub f_flags: c_long, ++ pub f_spare: [c_long; 4], ++ } ++ ++ pub struct statfs64 { ++ pub f_type: c_long, ++ pub f_bsize: c_long, ++ pub f_blocks: crate::fsblkcnt64_t, ++ pub f_bfree: crate::fsblkcnt64_t, ++ pub f_bavail: crate::fsblkcnt64_t, ++ pub f_files: crate::fsfilcnt64_t, ++ pub f_ffree: crate::fsfilcnt64_t, ++ pub f_fsid: crate::fsid_t, ++ pub f_namelen: c_long, ++ pub f_frsize: c_long, ++ pub f_flags: c_long, ++ pub f_spare: [c_long; 4], ++ } ++ ++ pub struct statvfs { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_favail: crate::fsfilcnt_t, ++ pub f_fsid: c_ulong, ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ pub __f_spare: [c_int; 6], ++ } ++ ++ pub struct statvfs64 { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: crate::fsblkcnt64_t, ++ pub f_bfree: crate::fsblkcnt64_t, ++ pub f_bavail: crate::fsblkcnt64_t, ++ pub f_files: crate::fsfilcnt64_t, ++ pub f_ffree: crate::fsfilcnt64_t, ++ pub f_favail: crate::fsfilcnt64_t, ++ pub f_fsid: c_ulong, ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ pub __f_spare: [c_int; 6], ++ } ++ ++ pub struct siginfo_t { ++ pub si_signo: c_int, ++ pub si_errno: c_int, ++ pub si_code: c_int, ++ #[doc(hidden)] ++ #[deprecated( ++ since = "0.2.54", ++ note = "Please leave a comment on \ ++ https://github.com/rust-lang/libc/pull/1316 if you're using \ ++ this field" ++ )] ++ pub _pad: [c_int; 29], ++ _align: [u64; 0], ++ } ++ ++ pub struct stack_t { ++ pub ss_sp: *mut c_void, ++ pub ss_flags: c_int, ++ pub ss_size: size_t, ++ } ++ ++ pub struct sigaction { ++ pub sa_sigaction: crate::sighandler_t, ++ pub sa_mask: crate::sigset_t, ++ pub sa_flags: c_int, ++ pub sa_restorer: Option, ++ } ++ ++ pub struct ipc_perm { ++ pub __key: crate::key_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub cuid: crate::uid_t, ++ pub cgid: crate::gid_t, ++ pub mode: c_ushort, ++ __pad1: c_ushort, ++ pub __seq: c_ushort, ++ __pad2: c_ushort, ++ __unused1: c_ulong, ++ __unused2: c_ulong, ++ } ++ ++ pub struct shmid_ds { ++ pub shm_perm: crate::ipc_perm, ++ pub shm_segsz: size_t, ++ pub shm_atime: crate::time_t, ++ pub shm_dtime: crate::time_t, ++ pub shm_ctime: crate::time_t, ++ pub shm_cpid: crate::pid_t, ++ pub shm_lpid: crate::pid_t, ++ pub shm_nattch: crate::shmatt_t, ++ __unused5: c_ulong, ++ __unused6: c_ulong, ++ } ++ ++ pub struct flock { ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ pub l_start: off_t, ++ pub l_len: off_t, ++ pub l_pid: crate::pid_t, ++ } ++ ++ pub struct flock64 { ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ pub l_start: off64_t, ++ pub l_len: off64_t, ++ pub l_pid: crate::pid_t, ++ } ++ ++ pub struct user_regs_struct { ++ pub pc: c_ulong, ++ pub ra: c_ulong, ++ pub sp: c_ulong, ++ pub gp: c_ulong, ++ pub tp: c_ulong, ++ pub t0: c_ulong, ++ pub t1: c_ulong, ++ pub t2: c_ulong, ++ pub s0: c_ulong, ++ pub s1: c_ulong, ++ pub a0: c_ulong, ++ pub a1: c_ulong, ++ pub a2: c_ulong, ++ pub a3: c_ulong, ++ pub a4: c_ulong, ++ pub a5: c_ulong, ++ pub a6: c_ulong, ++ pub a7: c_ulong, ++ pub s2: c_ulong, ++ pub s3: c_ulong, ++ pub s4: c_ulong, ++ pub s5: c_ulong, ++ pub s6: c_ulong, ++ pub s7: c_ulong, ++ pub s8: c_ulong, ++ pub s9: c_ulong, ++ pub s10: c_ulong, ++ pub s11: c_ulong, ++ pub t3: c_ulong, ++ pub t4: c_ulong, ++ pub t5: c_ulong, ++ pub t6: c_ulong, ++ } ++ ++ #[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, ++ } ++} ++ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ pub struct ucontext_t { ++ pub __uc_flags: c_ulong, ++ pub uc_link: *mut ucontext_t, ++ pub uc_stack: crate::stack_t, ++ pub uc_sigmask: crate::sigset_t, ++ pub uc_mcontext: mcontext_t, ++ } ++ ++ #[allow(missing_debug_implementations)] ++ #[repr(align(16))] ++ pub struct mcontext_t { ++ pub __gregs: [c_ulong; 32], ++ pub __fpregs: __riscv_mc_fp_state, ++ } ++ ++ pub union __riscv_mc_fp_state { ++ pub __f: __riscv_mc_f_ext_state, ++ pub __d: __riscv_mc_d_ext_state, ++ pub __q: __riscv_mc_q_ext_state, ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub struct __riscv_mc_f_ext_state { ++ pub __f: [c_uint; 32], ++ pub __fcsr: c_uint, ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub struct __riscv_mc_d_ext_state { ++ pub __f: [c_ulonglong; 32], ++ pub __fcsr: c_uint, ++ } ++ ++ #[allow(missing_debug_implementations)] ++ #[repr(align(16))] ++ pub struct __riscv_mc_q_ext_state { ++ pub __f: [c_ulonglong; 64], ++ pub __fcsr: c_uint, ++ pub __glibc_reserved: [c_uint; 3], ++ } ++} ++ ++pub const POSIX_FADV_DONTNEED: c_int = 4; ++pub const POSIX_FADV_NOREUSE: c_int = 5; ++pub const VEOF: usize = 4; ++pub const RTLD_DEEPBIND: c_int = 0x8; ++pub const RTLD_GLOBAL: c_int = 0x100; ++pub const RTLD_NOLOAD: c_int = 0x4; ++pub const O_APPEND: c_int = 1024; ++pub const O_CREAT: c_int = 64; ++pub const O_EXCL: c_int = 128; ++pub const O_NOCTTY: c_int = 256; ++pub const O_NONBLOCK: c_int = 2048; ++pub const O_SYNC: c_int = 1052672; ++pub const O_RSYNC: c_int = 1052672; ++pub const O_DSYNC: c_int = 4096; ++pub const O_FSYNC: c_int = 1052672; ++pub const O_NOATIME: c_int = 262144; ++pub const O_PATH: c_int = 2097152; ++pub const O_TMPFILE: c_int = 4259840; ++pub const MADV_SOFT_OFFLINE: c_int = 101; ++pub const MAP_GROWSDOWN: c_int = 256; ++pub const EDEADLK: c_int = 35; ++pub const ENAMETOOLONG: c_int = 36; ++pub const ENOLCK: c_int = 37; ++pub const ENOSYS: c_int = 38; ++pub const ENOTEMPTY: c_int = 39; ++pub const ELOOP: c_int = 40; ++pub const ENOMSG: c_int = 42; ++pub const EIDRM: c_int = 43; ++pub const ECHRNG: c_int = 44; ++pub const EL2NSYNC: c_int = 45; ++pub const EL3HLT: c_int = 46; ++pub const EL3RST: c_int = 47; ++pub const ELNRNG: c_int = 48; ++pub const EUNATCH: c_int = 49; ++pub const ENOCSI: c_int = 50; ++pub const EL2HLT: c_int = 51; ++pub const EBADE: c_int = 52; ++pub const EBADR: c_int = 53; ++pub const EXFULL: c_int = 54; ++pub const ENOANO: c_int = 55; ++pub const EBADRQC: c_int = 56; ++pub const EBADSLT: c_int = 57; ++pub const EMULTIHOP: c_int = 72; ++pub const EOVERFLOW: c_int = 75; ++pub const ENOTUNIQ: c_int = 76; ++pub const EBADFD: c_int = 77; ++pub const EBADMSG: c_int = 74; ++pub const EREMCHG: c_int = 78; ++pub const ELIBACC: c_int = 79; ++pub const ELIBBAD: c_int = 80; ++pub const ELIBSCN: c_int = 81; ++pub const ELIBMAX: c_int = 82; ++pub const ELIBEXEC: c_int = 83; ++pub const EILSEQ: c_int = 84; ++pub const ERESTART: c_int = 85; ++pub const ESTRPIPE: c_int = 86; ++pub const EUSERS: c_int = 87; ++pub const ENOTSOCK: c_int = 88; ++pub const EDESTADDRREQ: c_int = 89; ++pub const EMSGSIZE: c_int = 90; ++pub const EPROTOTYPE: c_int = 91; ++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 EPFNOSUPPORT: c_int = 96; ++pub const EAFNOSUPPORT: c_int = 97; ++pub const EADDRINUSE: c_int = 98; ++pub const EADDRNOTAVAIL: c_int = 99; ++pub const ENETDOWN: c_int = 100; ++pub const ENETUNREACH: c_int = 101; ++pub const ENETRESET: c_int = 102; ++pub const ECONNABORTED: c_int = 103; ++pub const ECONNRESET: c_int = 104; ++pub const ENOBUFS: c_int = 105; ++pub const EISCONN: c_int = 106; ++pub const ENOTCONN: c_int = 107; ++pub const ESHUTDOWN: c_int = 108; ++pub const ETOOMANYREFS: c_int = 109; ++pub const ETIMEDOUT: c_int = 110; ++pub const ECONNREFUSED: c_int = 111; ++pub const EHOSTDOWN: c_int = 112; ++pub const EHOSTUNREACH: c_int = 113; ++pub const EALREADY: c_int = 114; ++pub const EINPROGRESS: c_int = 115; ++pub const ESTALE: c_int = 116; ++pub const EDQUOT: c_int = 122; ++pub const ENOMEDIUM: c_int = 123; ++pub const EMEDIUMTYPE: c_int = 124; ++pub const ECANCELED: c_int = 125; ++pub const ENOKEY: c_int = 126; ++pub const EKEYEXPIRED: c_int = 127; ++pub const EKEYREVOKED: c_int = 128; ++pub const EKEYREJECTED: c_int = 129; ++pub const EOWNERDEAD: c_int = 130; ++pub const ENOTRECOVERABLE: c_int = 131; ++pub const EHWPOISON: c_int = 133; ++pub const ERFKILL: c_int = 132; ++ ++pub const SOCK_STREAM: c_int = 1; ++pub const SOCK_DGRAM: c_int = 2; ++pub const SA_ONSTACK: c_int = 134217728; ++pub const SA_SIGINFO: c_int = 4; ++pub const SA_NOCLDWAIT: c_int = 2; ++pub const SIGTTIN: c_int = 21; ++pub const SIGTTOU: c_int = 22; ++pub const SIGXCPU: c_int = 24; ++pub const SIGXFSZ: c_int = 25; ++pub const SIGVTALRM: c_int = 26; ++pub const SIGPROF: c_int = 27; ++pub const SIGWINCH: c_int = 28; ++pub const SIGCHLD: c_int = 17; ++pub const SIGBUS: c_int = 7; ++pub const SIGUSR1: c_int = 10; ++pub const SIGUSR2: c_int = 12; ++pub const SIGCONT: c_int = 18; ++pub const SIGSTOP: c_int = 19; ++pub const SIGTSTP: c_int = 20; ++pub const SIGURG: c_int = 23; ++pub const SIGIO: c_int = 29; ++pub const SIGSYS: c_int = 31; ++pub const SIGSTKFLT: c_int = 16; ++pub const SIGPOLL: c_int = 29; ++pub const SIGPWR: c_int = 30; ++pub const SIG_SETMASK: c_int = 2; ++pub const SIG_BLOCK: c_int = 0; ++pub const SIG_UNBLOCK: c_int = 1; ++pub const POLLWRNORM: c_short = 256; ++pub const POLLWRBAND: c_short = 512; ++pub const O_ASYNC: c_int = 8192; ++pub const O_NDELAY: c_int = 2048; ++pub const PTRACE_DETACH: c_uint = 17; ++pub const EFD_NONBLOCK: c_int = 2048; ++pub const F_GETLK: c_int = 5; ++pub const F_GETOWN: c_int = 9; ++pub const F_SETOWN: c_int = 8; ++pub const F_SETLK: c_int = 6; ++pub const F_SETLKW: c_int = 7; ++pub const F_RDLCK: c_int = 0; ++pub const F_WRLCK: c_int = 1; ++pub const F_UNLCK: c_int = 2; ++pub const F_OFD_GETLK: c_int = 36; ++pub const F_OFD_SETLK: c_int = 37; ++pub const F_OFD_SETLKW: c_int = 38; ++pub const SFD_NONBLOCK: c_int = 2048; ++pub const TCSANOW: c_int = 0; ++pub const TCSADRAIN: c_int = 1; ++pub const TCSAFLUSH: c_int = 2; ++pub const SFD_CLOEXEC: c_int = 524288; ++pub const NCCS: usize = 32; ++pub const O_TRUNC: c_int = 512; ++pub const O_CLOEXEC: c_int = 524288; ++pub const EBFONT: c_int = 59; ++pub const ENOSTR: c_int = 60; ++pub const ENODATA: c_int = 61; ++pub const ETIME: c_int = 62; ++pub const ENOSR: c_int = 63; ++pub const ENONET: c_int = 64; ++pub const ENOPKG: c_int = 65; ++pub const EREMOTE: c_int = 66; ++pub const ENOLINK: c_int = 67; ++pub const EADV: c_int = 68; ++pub const ESRMNT: c_int = 69; ++pub const ECOMM: c_int = 70; ++pub const EPROTO: c_int = 71; ++pub const EDOTDOT: c_int = 73; ++pub const SA_NODEFER: c_int = 1073741824; ++pub const SA_RESETHAND: c_int = -2147483648; ++pub const SA_RESTART: c_int = 268435456; ++pub const SA_NOCLDSTOP: c_int = 1; ++pub const EPOLL_CLOEXEC: c_int = 524288; ++pub const EFD_CLOEXEC: c_int = 524288; ++pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; ++pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; ++pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4; ++pub const O_DIRECT: c_int = 16384; ++pub const O_DIRECTORY: c_int = 65536; ++pub const O_NOFOLLOW: c_int = 131072; ++pub const MAP_HUGETLB: c_int = 262144; ++pub const MAP_LOCKED: c_int = 8192; ++pub const MAP_NORESERVE: c_int = 16384; ++pub const MAP_ANON: c_int = 32; ++pub const MAP_ANONYMOUS: c_int = 32; ++pub const MAP_DENYWRITE: c_int = 2048; ++pub const MAP_EXECUTABLE: c_int = 4096; ++pub const MAP_POPULATE: c_int = 32768; ++pub const MAP_NONBLOCK: c_int = 65536; ++pub const MAP_STACK: c_int = 131072; ++pub const MAP_SYNC: c_int = 0x080000; ++pub const EDEADLOCK: c_int = 35; ++pub const EUCLEAN: c_int = 117; ++pub const ENOTNAM: c_int = 118; ++pub const ENAVAIL: c_int = 119; ++pub const EISNAM: c_int = 120; ++pub const EREMOTEIO: c_int = 121; ++pub const PTRACE_GETFPREGS: c_uint = 14; ++pub const PTRACE_SETFPREGS: c_uint = 15; ++pub const PTRACE_GETFPXREGS: c_uint = 18; ++pub const PTRACE_SETFPXREGS: c_uint = 19; ++pub const PTRACE_GETREGS: c_uint = 12; ++pub const PTRACE_SETREGS: c_uint = 13; ++pub const MCL_CURRENT: c_int = 1; ++pub const MCL_FUTURE: c_int = 2; ++pub const MCL_ONFAULT: c_int = 4; ++pub const SIGSTKSZ: size_t = 8192; ++pub const MINSIGSTKSZ: size_t = 2048; ++pub const CBAUD: crate::tcflag_t = 4111; ++pub const TAB1: crate::tcflag_t = 2048; ++pub const TAB2: crate::tcflag_t = 4096; ++pub const TAB3: crate::tcflag_t = 6144; ++pub const CR1: crate::tcflag_t = 512; ++pub const CR2: crate::tcflag_t = 1024; ++pub const CR3: crate::tcflag_t = 1536; ++pub const FF1: crate::tcflag_t = 32768; ++pub const BS1: crate::tcflag_t = 8192; ++pub const VT1: crate::tcflag_t = 16384; ++pub const VWERASE: usize = 14; ++pub const VREPRINT: usize = 12; ++pub const VSUSP: usize = 10; ++pub const VSTART: usize = 8; ++pub const VSTOP: usize = 9; ++pub const VDISCARD: usize = 13; ++pub const VTIME: usize = 5; ++pub const IXON: crate::tcflag_t = 1024; ++pub const IXOFF: crate::tcflag_t = 4096; ++pub const ONLCR: crate::tcflag_t = 4; ++pub const CSIZE: crate::tcflag_t = 48; ++pub const CS6: crate::tcflag_t = 16; ++pub const CS7: crate::tcflag_t = 32; ++pub const CS8: crate::tcflag_t = 48; ++pub const CSTOPB: crate::tcflag_t = 64; ++pub const CREAD: crate::tcflag_t = 128; ++pub const PARENB: crate::tcflag_t = 256; ++pub const PARODD: crate::tcflag_t = 512; ++pub const HUPCL: crate::tcflag_t = 1024; ++pub const CLOCAL: crate::tcflag_t = 2048; ++pub const ECHOKE: crate::tcflag_t = 2048; ++pub const ECHOE: crate::tcflag_t = 16; ++pub const ECHOK: crate::tcflag_t = 32; ++pub const ECHONL: crate::tcflag_t = 64; ++pub const ECHOPRT: crate::tcflag_t = 1024; ++pub const ECHOCTL: crate::tcflag_t = 512; ++pub const ISIG: crate::tcflag_t = 1; ++pub const ICANON: crate::tcflag_t = 2; ++pub const PENDIN: crate::tcflag_t = 16384; ++pub const NOFLSH: crate::tcflag_t = 128; ++pub const CIBAUD: crate::tcflag_t = 269418496; ++pub const CBAUDEX: crate::tcflag_t = 4096; ++pub const VSWTC: usize = 7; ++pub const OLCUC: crate::tcflag_t = 2; ++pub const NLDLY: crate::tcflag_t = 256; ++pub const CRDLY: crate::tcflag_t = 1536; ++pub const TABDLY: crate::tcflag_t = 6144; ++pub const BSDLY: crate::tcflag_t = 8192; ++pub const FFDLY: crate::tcflag_t = 32768; ++pub const VTDLY: crate::tcflag_t = 16384; ++pub const XTABS: crate::tcflag_t = 6144; ++pub const B0: crate::speed_t = 0; ++pub const B50: crate::speed_t = 1; ++pub const B75: crate::speed_t = 2; ++pub const B110: crate::speed_t = 3; ++pub const B134: crate::speed_t = 4; ++pub const B150: crate::speed_t = 5; ++pub const B200: crate::speed_t = 6; ++pub const B300: crate::speed_t = 7; ++pub const B600: crate::speed_t = 8; ++pub const B1200: crate::speed_t = 9; ++pub const B1800: crate::speed_t = 10; ++pub const B2400: crate::speed_t = 11; ++pub const B4800: crate::speed_t = 12; ++pub const B9600: crate::speed_t = 13; ++pub const B19200: crate::speed_t = 14; ++pub const B38400: crate::speed_t = 15; ++pub const EXTA: crate::speed_t = 14; ++pub const EXTB: crate::speed_t = 15; ++pub const B57600: crate::speed_t = 4097; ++pub const B115200: crate::speed_t = 4098; ++pub const B230400: crate::speed_t = 4099; ++pub const B460800: crate::speed_t = 4100; ++pub const B500000: crate::speed_t = 4101; ++pub const B576000: crate::speed_t = 4102; ++pub const B921600: crate::speed_t = 4103; ++pub const B1000000: crate::speed_t = 4104; ++pub const B1152000: crate::speed_t = 4105; ++pub const B1500000: crate::speed_t = 4106; ++pub const B2000000: crate::speed_t = 4107; ++pub const B2500000: crate::speed_t = 4108; ++pub const B3000000: crate::speed_t = 4109; ++pub const B3500000: crate::speed_t = 4110; ++pub const B4000000: crate::speed_t = 4111; ++pub const VEOL: usize = 11; ++pub const VEOL2: usize = 16; ++pub const VMIN: usize = 6; ++pub const IEXTEN: crate::tcflag_t = 32768; ++pub const TOSTOP: crate::tcflag_t = 256; ++pub const FLUSHO: crate::tcflag_t = 4096; ++pub const EXTPROC: crate::tcflag_t = 65536; ++pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; ++pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; ++pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32; ++pub const NGREG: usize = 32; ++pub const REG_PC: usize = 0; ++pub const REG_RA: usize = 1; ++pub const REG_SP: usize = 2; ++pub const REG_TP: usize = 4; ++pub const REG_S0: usize = 8; ++pub const REG_S1: usize = 9; ++pub const REG_A0: usize = 10; ++pub const REG_S2: usize = 18; ++pub const REG_NARGS: usize = 8; ++ ++pub const COMPAT_HWCAP_ISA_I: c_ulong = 1 << (b'I' - b'A'); ++pub const COMPAT_HWCAP_ISA_M: c_ulong = 1 << (b'M' - b'A'); ++pub const COMPAT_HWCAP_ISA_A: c_ulong = 1 << (b'A' - b'A'); ++pub const COMPAT_HWCAP_ISA_F: c_ulong = 1 << (b'F' - b'A'); ++pub const COMPAT_HWCAP_ISA_D: c_ulong = 1 << (b'D' - b'A'); ++pub const COMPAT_HWCAP_ISA_C: c_ulong = 1 << (b'C' - b'A'); ++pub const COMPAT_HWCAP_ISA_V: c_ulong = 1 << (b'V' - b'A'); ++ ++pub const SYS_read: c_long = 63; ++pub const SYS_write: c_long = 64; ++pub const SYS_close: c_long = 57; ++pub const SYS_fstat: c_long = 80; ++pub const SYS_lseek: c_long = 62; ++pub const SYS_mmap: c_long = 222; ++pub const SYS_mprotect: c_long = 226; ++pub const SYS_munmap: c_long = 215; ++pub const SYS_brk: c_long = 214; ++pub const SYS_rt_sigaction: c_long = 134; ++pub const SYS_rt_sigprocmask: c_long = 135; ++pub const SYS_rt_sigreturn: c_long = 139; ++pub const SYS_ioctl: c_long = 29; ++pub const SYS_pread64: c_long = 67; ++pub const SYS_pwrite64: c_long = 68; ++pub const SYS_readv: c_long = 65; ++pub const SYS_writev: c_long = 66; ++pub const SYS_sched_yield: c_long = 124; ++pub const SYS_mremap: c_long = 216; ++pub const SYS_msync: c_long = 227; ++pub const SYS_mincore: c_long = 232; ++pub const SYS_madvise: c_long = 233; ++pub const SYS_shmget: c_long = 194; ++pub const SYS_shmat: c_long = 196; ++pub const SYS_shmctl: c_long = 195; ++pub const SYS_dup: c_long = 23; ++pub const SYS_nanosleep: c_long = 101; ++pub const SYS_getitimer: c_long = 102; ++pub const SYS_setitimer: c_long = 103; ++pub const SYS_getpid: c_long = 172; ++pub const SYS_sendfile: c_long = 71; ++pub const SYS_socket: c_long = 198; ++pub const SYS_connect: c_long = 203; ++pub const SYS_accept: c_long = 202; ++pub const SYS_sendto: c_long = 206; ++pub const SYS_recvfrom: c_long = 207; ++pub const SYS_sendmsg: c_long = 211; ++pub const SYS_recvmsg: c_long = 212; ++pub const SYS_shutdown: c_long = 210; ++pub const SYS_bind: c_long = 200; ++pub const SYS_listen: c_long = 201; ++pub const SYS_getsockname: c_long = 204; ++pub const SYS_getpeername: c_long = 205; ++pub const SYS_socketpair: c_long = 199; ++pub const SYS_setsockopt: c_long = 208; ++pub const SYS_getsockopt: c_long = 209; ++pub const SYS_clone: c_long = 220; ++pub const SYS_execve: c_long = 221; ++pub const SYS_exit: c_long = 93; ++pub const SYS_wait4: c_long = 260; ++pub const SYS_kill: c_long = 129; ++pub const SYS_uname: c_long = 160; ++pub const SYS_semget: c_long = 190; ++pub const SYS_semop: c_long = 193; ++pub const SYS_semctl: c_long = 191; ++pub const SYS_shmdt: c_long = 197; ++pub const SYS_msgget: c_long = 186; ++pub const SYS_msgsnd: c_long = 189; ++pub const SYS_msgrcv: c_long = 188; ++pub const SYS_msgctl: c_long = 187; ++pub const SYS_fcntl: c_long = 25; ++pub const SYS_flock: c_long = 32; ++pub const SYS_fsync: c_long = 82; ++pub const SYS_fdatasync: c_long = 83; ++pub const SYS_truncate: c_long = 45; ++pub const SYS_ftruncate: c_long = 46; ++pub const SYS_getcwd: c_long = 17; ++pub const SYS_chdir: c_long = 49; ++pub const SYS_fchdir: c_long = 50; ++pub const SYS_fchmod: c_long = 52; ++pub const SYS_fchown: c_long = 55; ++pub const SYS_umask: c_long = 166; ++pub const SYS_gettimeofday: c_long = 169; ++pub const SYS_getrlimit: c_long = 163; ++pub const SYS_getrusage: c_long = 165; ++pub const SYS_sysinfo: c_long = 179; ++pub const SYS_times: c_long = 153; ++pub const SYS_ptrace: c_long = 117; ++pub const SYS_getuid: c_long = 174; ++pub const SYS_syslog: c_long = 116; ++pub const SYS_getgid: c_long = 176; ++pub const SYS_setuid: c_long = 146; ++pub const SYS_setgid: c_long = 144; ++pub const SYS_geteuid: c_long = 175; ++pub const SYS_getegid: c_long = 177; ++pub const SYS_setpgid: c_long = 154; ++pub const SYS_getppid: c_long = 173; ++pub const SYS_setsid: c_long = 157; ++pub const SYS_setreuid: c_long = 145; ++pub const SYS_setregid: c_long = 143; ++pub const SYS_getgroups: c_long = 158; ++pub const SYS_setgroups: c_long = 159; ++pub const SYS_setresuid: c_long = 147; ++pub const SYS_getresuid: c_long = 148; ++pub const SYS_setresgid: c_long = 149; ++pub const SYS_getresgid: c_long = 150; ++pub const SYS_getpgid: c_long = 155; ++pub const SYS_setfsuid: c_long = 151; ++pub const SYS_setfsgid: c_long = 152; ++pub const SYS_getsid: c_long = 156; ++pub const SYS_capget: c_long = 90; ++pub const SYS_capset: c_long = 91; ++pub const SYS_rt_sigpending: c_long = 136; ++pub const SYS_rt_sigtimedwait: c_long = 137; ++pub const SYS_rt_sigqueueinfo: c_long = 138; ++pub const SYS_rt_sigsuspend: c_long = 133; ++pub const SYS_sigaltstack: c_long = 132; ++pub const SYS_personality: c_long = 92; ++pub const SYS_statfs: c_long = 43; ++pub const SYS_fstatfs: c_long = 44; ++pub const SYS_getpriority: c_long = 141; ++pub const SYS_setpriority: c_long = 140; ++pub const SYS_sched_setparam: c_long = 118; ++pub const SYS_sched_getparam: c_long = 121; ++pub const SYS_sched_setscheduler: c_long = 119; ++pub const SYS_sched_getscheduler: c_long = 120; ++pub const SYS_sched_get_priority_max: c_long = 125; ++pub const SYS_sched_get_priority_min: c_long = 126; ++pub const SYS_sched_rr_get_interval: c_long = 127; ++pub const SYS_mlock: c_long = 228; ++pub const SYS_munlock: c_long = 229; ++pub const SYS_mlockall: c_long = 230; ++pub const SYS_munlockall: c_long = 231; ++pub const SYS_vhangup: c_long = 58; ++pub const SYS_pivot_root: c_long = 41; ++pub const SYS_prctl: c_long = 167; ++pub const SYS_adjtimex: c_long = 171; ++pub const SYS_setrlimit: c_long = 164; ++pub const SYS_chroot: c_long = 51; ++pub const SYS_sync: c_long = 81; ++pub const SYS_acct: c_long = 89; ++pub const SYS_settimeofday: c_long = 170; ++pub const SYS_mount: c_long = 40; ++pub const SYS_umount2: c_long = 39; ++pub const SYS_swapon: c_long = 224; ++pub const SYS_swapoff: c_long = 225; ++pub const SYS_reboot: c_long = 142; ++pub const SYS_sethostname: c_long = 161; ++pub const SYS_setdomainname: c_long = 162; ++pub const SYS_init_module: c_long = 105; ++pub const SYS_delete_module: c_long = 106; ++pub const SYS_quotactl: c_long = 60; ++pub const SYS_nfsservctl: c_long = 42; ++pub const SYS_gettid: c_long = 178; ++pub const SYS_readahead: c_long = 213; ++pub const SYS_setxattr: c_long = 5; ++pub const SYS_lsetxattr: c_long = 6; ++pub const SYS_fsetxattr: c_long = 7; ++pub const SYS_getxattr: c_long = 8; ++pub const SYS_lgetxattr: c_long = 9; ++pub const SYS_fgetxattr: c_long = 10; ++pub const SYS_listxattr: c_long = 11; ++pub const SYS_llistxattr: c_long = 12; ++pub const SYS_flistxattr: c_long = 13; ++pub const SYS_removexattr: c_long = 14; ++pub const SYS_lremovexattr: c_long = 15; ++pub const SYS_fremovexattr: c_long = 16; ++pub const SYS_tkill: c_long = 130; ++pub const SYS_futex: c_long = 98; ++pub const SYS_sched_setaffinity: c_long = 122; ++pub const SYS_sched_getaffinity: c_long = 123; ++pub const SYS_io_setup: c_long = 0; ++pub const SYS_io_destroy: c_long = 1; ++pub const SYS_io_getevents: c_long = 4; ++pub const SYS_io_submit: c_long = 2; ++pub const SYS_io_cancel: c_long = 3; ++pub const SYS_lookup_dcookie: c_long = 18; ++pub const SYS_remap_file_pages: c_long = 234; ++pub const SYS_getdents64: c_long = 61; ++pub const SYS_set_tid_address: c_long = 96; ++pub const SYS_restart_syscall: c_long = 128; ++pub const SYS_semtimedop: c_long = 192; ++pub const SYS_fadvise64: c_long = 223; ++pub const SYS_timer_create: c_long = 107; ++pub const SYS_timer_settime: c_long = 110; ++pub const SYS_timer_gettime: c_long = 108; ++pub const SYS_timer_getoverrun: c_long = 109; ++pub const SYS_timer_delete: c_long = 111; ++pub const SYS_clock_settime: c_long = 112; ++pub const SYS_clock_gettime: c_long = 113; ++pub const SYS_clock_getres: c_long = 114; ++pub const SYS_clock_nanosleep: c_long = 115; ++pub const SYS_exit_group: c_long = 94; ++pub const SYS_epoll_ctl: c_long = 21; ++pub const SYS_tgkill: c_long = 131; ++pub const SYS_mbind: c_long = 235; ++pub const SYS_set_mempolicy: c_long = 237; ++pub const SYS_get_mempolicy: c_long = 236; ++pub const SYS_mq_open: c_long = 180; ++pub const SYS_mq_unlink: c_long = 181; ++pub const SYS_mq_timedsend: c_long = 182; ++pub const SYS_mq_timedreceive: c_long = 183; ++pub const SYS_mq_notify: c_long = 184; ++pub const SYS_mq_getsetattr: c_long = 185; ++pub const SYS_kexec_load: c_long = 104; ++pub const SYS_waitid: c_long = 95; ++pub const SYS_add_key: c_long = 217; ++pub const SYS_request_key: c_long = 218; ++pub const SYS_keyctl: c_long = 219; ++pub const SYS_ioprio_set: c_long = 30; ++pub const SYS_ioprio_get: c_long = 31; ++pub const SYS_inotify_add_watch: c_long = 27; ++pub const SYS_inotify_rm_watch: c_long = 28; ++pub const SYS_migrate_pages: c_long = 238; ++pub const SYS_openat: c_long = 56; ++pub const SYS_mkdirat: c_long = 34; ++pub const SYS_mknodat: c_long = 33; ++pub const SYS_fchownat: c_long = 54; ++pub const SYS_newfstatat: c_long = 79; ++pub const SYS_unlinkat: c_long = 35; ++pub const SYS_linkat: c_long = 37; ++pub const SYS_symlinkat: c_long = 36; ++pub const SYS_readlinkat: c_long = 78; ++pub const SYS_fchmodat: c_long = 53; ++pub const SYS_faccessat: c_long = 48; ++pub const SYS_pselect6: c_long = 72; ++pub const SYS_ppoll: c_long = 73; ++pub const SYS_unshare: c_long = 97; ++pub const SYS_set_robust_list: c_long = 99; ++pub const SYS_get_robust_list: c_long = 100; ++pub const SYS_splice: c_long = 76; ++pub const SYS_tee: c_long = 77; ++pub const SYS_sync_file_range: c_long = 84; ++pub const SYS_vmsplice: c_long = 75; ++pub const SYS_move_pages: c_long = 239; ++pub const SYS_utimensat: c_long = 88; ++pub const SYS_epoll_pwait: c_long = 22; ++pub const SYS_timerfd_create: c_long = 85; ++pub const SYS_fallocate: c_long = 47; ++pub const SYS_timerfd_settime: c_long = 86; ++pub const SYS_timerfd_gettime: c_long = 87; ++pub const SYS_accept4: c_long = 242; ++pub const SYS_signalfd4: c_long = 74; ++pub const SYS_eventfd2: c_long = 19; ++pub const SYS_epoll_create1: c_long = 20; ++pub const SYS_dup3: c_long = 24; ++pub const SYS_pipe2: c_long = 59; ++pub const SYS_inotify_init1: c_long = 26; ++pub const SYS_preadv: c_long = 69; ++pub const SYS_pwritev: c_long = 70; ++pub const SYS_rt_tgsigqueueinfo: c_long = 240; ++pub const SYS_perf_event_open: c_long = 241; ++pub const SYS_recvmmsg: c_long = 243; ++pub const SYS_fanotify_init: c_long = 262; ++pub const SYS_fanotify_mark: c_long = 263; ++pub const SYS_prlimit64: c_long = 261; ++pub const SYS_name_to_handle_at: c_long = 264; ++pub const SYS_open_by_handle_at: c_long = 265; ++pub const SYS_clock_adjtime: c_long = 266; ++pub const SYS_syncfs: c_long = 267; ++pub const SYS_sendmmsg: c_long = 269; ++pub const SYS_setns: c_long = 268; ++pub const SYS_getcpu: c_long = 168; ++pub const SYS_process_vm_readv: c_long = 270; ++pub const SYS_process_vm_writev: c_long = 271; ++pub const SYS_kcmp: c_long = 272; ++pub const SYS_finit_module: c_long = 273; ++pub const SYS_sched_setattr: c_long = 274; ++pub const SYS_sched_getattr: c_long = 275; ++pub const SYS_renameat2: c_long = 276; ++pub const SYS_seccomp: c_long = 277; ++pub const SYS_getrandom: c_long = 278; ++pub const SYS_memfd_create: c_long = 279; ++pub const SYS_bpf: c_long = 280; ++pub const SYS_execveat: c_long = 281; ++pub const SYS_userfaultfd: c_long = 282; ++pub const SYS_membarrier: c_long = 283; ++pub const SYS_mlock2: c_long = 284; ++pub const SYS_copy_file_range: c_long = 285; ++pub const SYS_preadv2: c_long = 286; ++pub const SYS_pwritev2: c_long = 287; ++pub const SYS_pkey_mprotect: c_long = 288; ++pub const SYS_pkey_alloc: c_long = 289; ++pub const SYS_pkey_free: c_long = 290; ++pub const SYS_statx: c_long = 291; ++pub const SYS_rseq: c_long = 293; ++pub const SYS_pidfd_send_signal: c_long = 424; ++pub const SYS_io_uring_setup: c_long = 425; ++pub const SYS_io_uring_enter: c_long = 426; ++pub const SYS_io_uring_register: c_long = 427; ++pub const SYS_open_tree: c_long = 428; ++pub const SYS_move_mount: c_long = 429; ++pub const SYS_fsopen: c_long = 430; ++pub const SYS_fsconfig: c_long = 431; ++pub const SYS_fsmount: c_long = 432; ++pub const SYS_fspick: c_long = 433; ++pub const SYS_pidfd_open: c_long = 434; ++pub const SYS_clone3: c_long = 435; ++pub const SYS_close_range: c_long = 436; ++pub const SYS_openat2: c_long = 437; ++pub const SYS_pidfd_getfd: c_long = 438; ++pub const SYS_faccessat2: c_long = 439; ++pub const SYS_process_madvise: c_long = 440; ++pub const SYS_epoll_pwait2: c_long = 441; ++pub const SYS_mount_setattr: c_long = 442; ++pub const SYS_quotactl_fd: c_long = 443; ++pub const SYS_landlock_create_ruleset: c_long = 444; ++pub const SYS_landlock_add_rule: c_long = 445; ++pub const SYS_landlock_restrict_self: c_long = 446; ++pub const SYS_memfd_secret: c_long = 447; ++pub const SYS_process_mrelease: c_long = 448; ++pub const SYS_futex_waitv: c_long = 449; ++pub const SYS_set_mempolicy_home_node: c_long = 450; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/s390x.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/s390x.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/s390x.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/s390x.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,959 @@ ++//! s390x ++ ++use crate::prelude::*; ++use crate::{off64_t, off_t, pthread_mutex_t}; ++ ++pub type blksize_t = i64; ++pub type c_char = u8; ++pub type c_long = i64; ++pub type c_ulong = u64; ++pub type nlink_t = u64; ++pub type suseconds_t = i64; ++pub type wchar_t = i32; ++pub type greg_t = u64; ++pub type __u64 = u64; ++pub type __s64 = i64; ++ ++s! { ++ pub struct sigaction { ++ pub sa_sigaction: crate::sighandler_t, ++ __glibc_reserved0: c_int, ++ pub sa_flags: c_int, ++ pub sa_restorer: Option, ++ pub sa_mask: crate::sigset_t, ++ } ++ ++ pub struct statfs { ++ pub f_type: c_uint, ++ pub f_bsize: c_uint, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_fsid: crate::fsid_t, ++ pub f_namelen: c_uint, ++ pub f_frsize: c_uint, ++ pub f_flags: c_uint, ++ f_spare: [c_uint; 4], ++ } ++ ++ pub struct flock { ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ pub l_start: off_t, ++ pub l_len: off_t, ++ pub l_pid: crate::pid_t, ++ } ++ ++ pub struct flock64 { ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ pub l_start: off64_t, ++ pub l_len: off64_t, ++ pub l_pid: crate::pid_t, ++ } ++ ++ pub struct siginfo_t { ++ pub si_signo: c_int, ++ pub si_errno: c_int, ++ pub si_code: c_int, ++ _pad: c_int, ++ _pad2: [c_long; 14], ++ } ++ ++ pub struct stack_t { ++ pub ss_sp: *mut c_void, ++ pub ss_flags: c_int, ++ pub ss_size: size_t, ++ } ++ ++ pub struct stat { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_mode: crate::mode_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ st_pad0: c_int, ++ pub st_rdev: crate::dev_t, ++ pub st_size: off_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt_t, ++ __glibc_reserved: [c_long; 3], ++ } ++ ++ pub struct stat64 { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino64_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_mode: crate::mode_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ st_pad0: c_int, ++ pub st_rdev: crate::dev_t, ++ pub st_size: off_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt64_t, ++ __glibc_reserved: [c_long; 3], ++ } ++ ++ pub struct pthread_attr_t { ++ __size: [c_ulong; 7], ++ } ++ ++ pub struct ipc_perm { ++ pub __key: crate::key_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub cuid: crate::uid_t, ++ pub cgid: crate::gid_t, ++ pub mode: crate::mode_t, ++ pub __seq: c_ushort, ++ __pad1: c_ushort, ++ __unused1: c_ulong, ++ __unused2: c_ulong, ++ } ++ ++ pub struct shmid_ds { ++ pub shm_perm: crate::ipc_perm, ++ pub shm_segsz: size_t, ++ pub shm_atime: crate::time_t, ++ pub shm_dtime: crate::time_t, ++ pub shm_ctime: crate::time_t, ++ pub shm_cpid: crate::pid_t, ++ pub shm_lpid: crate::pid_t, ++ pub shm_nattch: crate::shmatt_t, ++ __unused4: c_ulong, ++ __unused5: c_ulong, ++ } ++ ++ pub struct statvfs { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_favail: crate::fsfilcnt_t, ++ pub f_fsid: c_ulong, ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ __f_spare: [c_int; 6], ++ } ++ ++ pub struct __psw_t { ++ pub mask: u64, ++ pub addr: u64, ++ } ++ ++ pub struct fpregset_t { ++ pub fpc: u32, ++ __pad: u32, ++ pub fprs: [fpreg_t; 16], ++ } ++ ++ pub struct mcontext_t { ++ pub psw: __psw_t, ++ pub gregs: [u64; 16], ++ pub aregs: [u32; 16], ++ pub fpregs: fpregset_t, ++ } ++ ++ pub struct ucontext_t { ++ pub uc_flags: c_ulong, ++ pub uc_link: *mut ucontext_t, ++ pub uc_stack: crate::stack_t, ++ pub uc_mcontext: mcontext_t, ++ pub uc_sigmask: crate::sigset_t, ++ } ++ ++ pub struct statfs64 { ++ pub f_type: c_uint, ++ pub f_bsize: c_uint, ++ pub f_blocks: u64, ++ pub f_bfree: u64, ++ pub f_bavail: u64, ++ pub f_files: u64, ++ pub f_ffree: u64, ++ pub f_fsid: crate::fsid_t, ++ pub f_namelen: c_uint, ++ pub f_frsize: c_uint, ++ pub f_flags: c_uint, ++ pub f_spare: [c_uint; 4], ++ } ++ ++ pub struct statvfs64 { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: u64, ++ pub f_bfree: u64, ++ pub f_bavail: u64, ++ pub f_files: u64, ++ pub f_ffree: u64, ++ pub f_favail: u64, ++ pub f_fsid: c_ulong, ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ __f_spare: [c_int; 6], ++ } ++} ++ ++s_no_extra_traits! { ++ // FIXME: This is actually a union. ++ pub struct fpreg_t { ++ pub d: c_double, ++ // f: c_float, ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for fpreg_t { ++ fn eq(&self, other: &fpreg_t) -> bool { ++ self.d == other.d ++ } ++ } ++ ++ impl Eq for fpreg_t {} ++ ++ impl fmt::Debug for fpreg_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("fpreg_t").field("d", &self.d).finish() ++ } ++ } ++ ++ impl hash::Hash for fpreg_t { ++ fn hash(&self, state: &mut H) { ++ let d: u64 = unsafe { mem::transmute(self.d) }; ++ d.hash(state); ++ } ++ } ++ } ++} ++ ++pub const POSIX_FADV_DONTNEED: c_int = 6; ++pub const POSIX_FADV_NOREUSE: c_int = 7; ++ ++pub const VEOF: usize = 4; ++pub const RTLD_DEEPBIND: c_int = 0x8; ++pub const RTLD_GLOBAL: c_int = 0x100; ++pub const RTLD_NOLOAD: c_int = 0x4; ++pub const SFD_CLOEXEC: c_int = 0x080000; ++ ++pub const NCCS: usize = 32; ++ ++pub const O_TRUNC: c_int = 512; ++pub const O_NOATIME: c_int = 0o1000000; ++pub const O_CLOEXEC: c_int = 0x80000; ++pub const O_PATH: c_int = 0o10000000; ++pub const O_TMPFILE: c_int = 0o20000000 | O_DIRECTORY; ++ ++pub const EBFONT: c_int = 59; ++pub const ENOSTR: c_int = 60; ++pub const ENODATA: c_int = 61; ++pub const ETIME: c_int = 62; ++pub const ENOSR: c_int = 63; ++pub const ENONET: c_int = 64; ++pub const ENOPKG: c_int = 65; ++pub const EREMOTE: c_int = 66; ++pub const ENOLINK: c_int = 67; ++pub const EADV: c_int = 68; ++pub const ESRMNT: c_int = 69; ++pub const ECOMM: c_int = 70; ++pub const EPROTO: c_int = 71; ++pub const EDOTDOT: c_int = 73; ++ ++pub const SA_NODEFER: c_int = 0x40000000; ++pub const SA_RESETHAND: c_int = 0x80000000; ++pub const SA_RESTART: c_int = 0x10000000; ++pub const SA_NOCLDSTOP: c_int = 0x00000001; ++ ++pub const EPOLL_CLOEXEC: c_int = 0x80000; ++ ++pub const EFD_CLOEXEC: c_int = 0x80000; ++ ++pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; ++pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; ++pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4; ++pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; ++pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; ++pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32; ++ ++pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++}; ++pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++}; ++pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++}; ++ ++pub const EUCLEAN: c_int = 117; ++pub const ENOTNAM: c_int = 118; ++pub const ENAVAIL: c_int = 119; ++pub const EISNAM: c_int = 120; ++pub const EREMOTEIO: c_int = 121; ++pub const EADDRINUSE: c_int = 98; ++pub const EADDRNOTAVAIL: c_int = 99; ++pub const ECONNABORTED: c_int = 103; ++pub const ECONNREFUSED: c_int = 111; ++pub const ECONNRESET: c_int = 104; ++pub const EDEADLK: c_int = 35; ++pub const ENOSYS: c_int = 38; ++pub const ENOTCONN: c_int = 107; ++pub const ETIMEDOUT: c_int = 110; ++pub const O_APPEND: c_int = 1024; ++pub const O_CREAT: c_int = 64; ++pub const O_EXCL: c_int = 128; ++pub const O_NONBLOCK: c_int = 2048; ++pub const SA_NOCLDWAIT: c_int = 2; ++pub const SA_ONSTACK: c_int = 0x08000000; ++pub const SA_SIGINFO: c_int = 4; ++pub const SIGBUS: c_int = 7; ++pub const SIGSTKSZ: size_t = 0x2000; ++pub const MINSIGSTKSZ: size_t = 2048; ++pub const SIG_SETMASK: c_int = 2; ++ ++pub const SOCK_STREAM: c_int = 1; ++pub const SOCK_DGRAM: c_int = 2; ++ ++pub const O_NOCTTY: c_int = 256; ++pub const O_SYNC: c_int = 1052672; ++pub const O_RSYNC: c_int = 1052672; ++pub const O_DSYNC: c_int = 4096; ++pub const O_FSYNC: c_int = 0x101000; ++pub const O_DIRECT: c_int = 0x4000; ++pub const O_DIRECTORY: c_int = 0x10000; ++pub const O_NOFOLLOW: c_int = 0x20000; ++ ++pub const MADV_SOFT_OFFLINE: c_int = 101; ++pub const MAP_GROWSDOWN: c_int = 0x0100; ++pub const MAP_LOCKED: c_int = 0x02000; ++pub const MAP_NORESERVE: c_int = 0x04000; ++pub const MAP_ANON: c_int = 0x0020; ++pub const MAP_ANONYMOUS: c_int = 0x0020; ++pub const MAP_DENYWRITE: c_int = 0x0800; ++pub const MAP_EXECUTABLE: c_int = 0x01000; ++pub const MAP_POPULATE: c_int = 0x08000; ++pub const MAP_NONBLOCK: c_int = 0x010000; ++pub const MAP_STACK: c_int = 0x020000; ++pub const MAP_HUGETLB: c_int = 0x040000; ++pub const MAP_SYNC: c_int = 0x080000; ++ ++pub const EDEADLOCK: c_int = 35; ++pub const ENAMETOOLONG: c_int = 36; ++pub const ENOLCK: c_int = 37; ++pub const ENOTEMPTY: c_int = 39; ++pub const ELOOP: c_int = 40; ++pub const ENOMSG: c_int = 42; ++pub const EIDRM: c_int = 43; ++pub const ECHRNG: c_int = 44; ++pub const EL2NSYNC: c_int = 45; ++pub const EL3HLT: c_int = 46; ++pub const EL3RST: c_int = 47; ++pub const ELNRNG: c_int = 48; ++pub const EUNATCH: c_int = 49; ++pub const ENOCSI: c_int = 50; ++pub const EL2HLT: c_int = 51; ++pub const EBADE: c_int = 52; ++pub const EBADR: c_int = 53; ++pub const EXFULL: c_int = 54; ++pub const ENOANO: c_int = 55; ++pub const EBADRQC: c_int = 56; ++pub const EBADSLT: c_int = 57; ++pub const EMULTIHOP: c_int = 72; ++pub const EOVERFLOW: c_int = 75; ++pub const ENOTUNIQ: c_int = 76; ++pub const EBADFD: c_int = 77; ++pub const EBADMSG: c_int = 74; ++pub const EREMCHG: c_int = 78; ++pub const ELIBACC: c_int = 79; ++pub const ELIBBAD: c_int = 80; ++pub const ELIBSCN: c_int = 81; ++pub const ELIBMAX: c_int = 82; ++pub const ELIBEXEC: c_int = 83; ++pub const EILSEQ: c_int = 84; ++pub const ERESTART: c_int = 85; ++pub const ESTRPIPE: c_int = 86; ++pub const EUSERS: c_int = 87; ++pub const ENOTSOCK: c_int = 88; ++pub const EDESTADDRREQ: c_int = 89; ++pub const EMSGSIZE: c_int = 90; ++pub const EPROTOTYPE: c_int = 91; ++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 EPFNOSUPPORT: c_int = 96; ++pub const EAFNOSUPPORT: c_int = 97; ++pub const ENETDOWN: c_int = 100; ++pub const ENETUNREACH: c_int = 101; ++pub const ENETRESET: c_int = 102; ++pub const ENOBUFS: c_int = 105; ++pub const EISCONN: c_int = 106; ++pub const ESHUTDOWN: c_int = 108; ++pub const ETOOMANYREFS: c_int = 109; ++pub const EHOSTDOWN: c_int = 112; ++pub const EHOSTUNREACH: c_int = 113; ++pub const EALREADY: c_int = 114; ++pub const EINPROGRESS: c_int = 115; ++pub const ESTALE: c_int = 116; ++pub const EDQUOT: c_int = 122; ++pub const ENOMEDIUM: c_int = 123; ++pub const EMEDIUMTYPE: c_int = 124; ++pub const ECANCELED: c_int = 125; ++pub const ENOKEY: c_int = 126; ++pub const EKEYEXPIRED: c_int = 127; ++pub const EKEYREVOKED: c_int = 128; ++pub const EKEYREJECTED: c_int = 129; ++pub const EOWNERDEAD: c_int = 130; ++pub const ENOTRECOVERABLE: c_int = 131; ++pub const EHWPOISON: c_int = 133; ++pub const ERFKILL: c_int = 132; ++ ++pub const SIGTTIN: c_int = 21; ++pub const SIGTTOU: c_int = 22; ++pub const SIGXCPU: c_int = 24; ++pub const SIGXFSZ: c_int = 25; ++pub const SIGVTALRM: c_int = 26; ++pub const SIGPROF: c_int = 27; ++pub const SIGWINCH: c_int = 28; ++pub const SIGCHLD: c_int = 17; ++pub const SIGUSR1: c_int = 10; ++pub const SIGUSR2: c_int = 12; ++pub const SIGCONT: c_int = 18; ++pub const SIGSTOP: c_int = 19; ++pub const SIGTSTP: c_int = 20; ++pub const SIGURG: c_int = 23; ++pub const SIGIO: c_int = 29; ++pub const SIGSYS: c_int = 31; ++pub const SIGSTKFLT: c_int = 16; ++#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")] ++pub const SIGUNUSED: c_int = 31; ++pub const SIGPOLL: c_int = 29; ++pub const SIGPWR: c_int = 30; ++pub const SIG_BLOCK: c_int = 0x000000; ++pub const SIG_UNBLOCK: c_int = 0x01; ++ ++pub const O_ASYNC: c_int = 0x2000; ++pub const O_NDELAY: c_int = 0x800; ++ ++pub const VEOL: usize = 11; ++pub const VEOL2: usize = 16; ++pub const VMIN: usize = 6; ++pub const IEXTEN: crate::tcflag_t = 0x00008000; ++pub const TOSTOP: crate::tcflag_t = 0x00000100; ++pub const FLUSHO: crate::tcflag_t = 0x00001000; ++ ++pub const EXTPROC: crate::tcflag_t = 0x00010000; ++ ++pub const PTRACE_DETACH: c_uint = 17; ++ ++pub const MCL_CURRENT: c_int = 0x0001; ++pub const MCL_FUTURE: c_int = 0x0002; ++pub const MCL_ONFAULT: c_int = 0x0004; ++ ++pub const EFD_NONBLOCK: c_int = 0x800; ++ ++pub const F_RDLCK: c_int = 0; ++pub const F_WRLCK: c_int = 1; ++pub const F_UNLCK: c_int = 2; ++pub const F_GETLK: c_int = 5; ++pub const F_GETOWN: c_int = 9; ++pub const F_SETOWN: c_int = 8; ++pub const F_SETLK: c_int = 6; ++pub const F_SETLKW: c_int = 7; ++pub const F_OFD_GETLK: c_int = 36; ++pub const F_OFD_SETLK: c_int = 37; ++pub const F_OFD_SETLKW: c_int = 38; ++ ++pub const SFD_NONBLOCK: c_int = 0x0800; ++ ++pub const TCSANOW: c_int = 0; ++pub const TCSADRAIN: c_int = 1; ++pub const TCSAFLUSH: c_int = 2; ++ ++pub const VTIME: usize = 5; ++pub const VSWTC: usize = 7; ++pub const VSTART: usize = 8; ++pub const VSTOP: usize = 9; ++pub const VSUSP: usize = 10; ++pub const VREPRINT: usize = 12; ++pub const VDISCARD: usize = 13; ++pub const VWERASE: usize = 14; ++pub const OLCUC: crate::tcflag_t = 0o000002; ++pub const ONLCR: crate::tcflag_t = 0o000004; ++pub const NLDLY: crate::tcflag_t = 0o000400; ++pub const CRDLY: crate::tcflag_t = 0o003000; ++pub const CR1: crate::tcflag_t = 0x00000200; ++pub const CR2: crate::tcflag_t = 0x00000400; ++pub const CR3: crate::tcflag_t = 0x00000600; ++pub const TABDLY: crate::tcflag_t = 0o014000; ++pub const TAB1: crate::tcflag_t = 0x00000800; ++pub const TAB2: crate::tcflag_t = 0x00001000; ++pub const TAB3: crate::tcflag_t = 0x00001800; ++pub const BSDLY: crate::tcflag_t = 0o020000; ++pub const BS1: crate::tcflag_t = 0x00002000; ++pub const FFDLY: crate::tcflag_t = 0o100000; ++pub const FF1: crate::tcflag_t = 0x00008000; ++pub const VTDLY: crate::tcflag_t = 0o040000; ++pub const VT1: crate::tcflag_t = 0x00004000; ++pub const XTABS: crate::tcflag_t = 0o014000; ++ ++pub const CBAUD: crate::speed_t = 0o010017; ++pub const B0: crate::speed_t = 0o000000; ++pub const B50: crate::speed_t = 0o000001; ++pub const B75: crate::speed_t = 0o000002; ++pub const B110: crate::speed_t = 0o000003; ++pub const B134: crate::speed_t = 0o000004; ++pub const B150: crate::speed_t = 0o000005; ++pub const B200: crate::speed_t = 0o000006; ++pub const B300: crate::speed_t = 0o000007; ++pub const B600: crate::speed_t = 0o000010; ++pub const B1200: crate::speed_t = 0o000011; ++pub const B1800: crate::speed_t = 0o000012; ++pub const B2400: crate::speed_t = 0o000013; ++pub const B4800: crate::speed_t = 0o000014; ++pub const B9600: crate::speed_t = 0o000015; ++pub const B19200: crate::speed_t = 0o000016; ++pub const B38400: crate::speed_t = 0o000017; ++pub const EXTA: crate::speed_t = B19200; ++pub const EXTB: crate::speed_t = B38400; ++pub const CSIZE: crate::tcflag_t = 0o000060; ++pub const CS6: crate::tcflag_t = 0o000020; ++pub const CS7: crate::tcflag_t = 0o000040; ++pub const CS8: crate::tcflag_t = 0o000060; ++pub const CSTOPB: crate::tcflag_t = 0o000100; ++pub const CREAD: crate::tcflag_t = 0o000200; ++pub const PARENB: crate::tcflag_t = 0o000400; ++pub const PARODD: crate::tcflag_t = 0o001000; ++pub const HUPCL: crate::tcflag_t = 0o002000; ++pub const CLOCAL: crate::tcflag_t = 0o004000; ++pub const CBAUDEX: crate::tcflag_t = 0o010000; ++pub const B57600: crate::speed_t = 0o010001; ++pub const B115200: crate::speed_t = 0o010002; ++pub const B230400: crate::speed_t = 0o010003; ++pub const B460800: crate::speed_t = 0o010004; ++pub const B500000: crate::speed_t = 0o010005; ++pub const B576000: crate::speed_t = 0o010006; ++pub const B921600: crate::speed_t = 0o010007; ++pub const B1000000: crate::speed_t = 0o010010; ++pub const B1152000: crate::speed_t = 0o010011; ++pub const B1500000: crate::speed_t = 0o010012; ++pub const B2000000: crate::speed_t = 0o010013; ++pub const B2500000: crate::speed_t = 0o010014; ++pub const B3000000: crate::speed_t = 0o010015; ++pub const B3500000: crate::speed_t = 0o010016; ++pub const B4000000: crate::speed_t = 0o010017; ++pub const CIBAUD: crate::tcflag_t = 0o02003600000; ++ ++pub const ISIG: crate::tcflag_t = 0o000001; ++pub const ICANON: crate::tcflag_t = 0o000002; ++pub const XCASE: crate::tcflag_t = 0o000004; ++pub const ECHOE: crate::tcflag_t = 0o000020; ++pub const ECHOK: crate::tcflag_t = 0o000040; ++pub const ECHONL: crate::tcflag_t = 0o000100; ++pub const NOFLSH: crate::tcflag_t = 0o000200; ++pub const ECHOCTL: crate::tcflag_t = 0o001000; ++pub const ECHOPRT: crate::tcflag_t = 0o002000; ++pub const ECHOKE: crate::tcflag_t = 0o004000; ++pub const PENDIN: crate::tcflag_t = 0o040000; ++ ++pub const POLLWRNORM: c_short = 0x100; ++pub const POLLWRBAND: c_short = 0x200; ++ ++pub const IXON: crate::tcflag_t = 0o002000; ++pub const IXOFF: crate::tcflag_t = 0o010000; ++ ++pub const SYS_exit: c_long = 1; ++pub const SYS_fork: c_long = 2; ++pub const SYS_read: c_long = 3; ++pub const SYS_write: c_long = 4; ++pub const SYS_open: c_long = 5; ++pub const SYS_close: c_long = 6; ++pub const SYS_restart_syscall: c_long = 7; ++pub const SYS_creat: c_long = 8; ++pub const SYS_link: c_long = 9; ++pub const SYS_unlink: c_long = 10; ++pub const SYS_execve: c_long = 11; ++pub const SYS_chdir: c_long = 12; ++pub const SYS_mknod: c_long = 14; ++pub const SYS_chmod: c_long = 15; ++pub const SYS_lseek: c_long = 19; ++pub const SYS_getpid: c_long = 20; ++pub const SYS_mount: c_long = 21; ++pub const SYS_umount: c_long = 22; ++pub const SYS_ptrace: c_long = 26; ++pub const SYS_alarm: c_long = 27; ++pub const SYS_pause: c_long = 29; ++pub const SYS_utime: c_long = 30; ++pub const SYS_access: c_long = 33; ++pub const SYS_nice: c_long = 34; ++pub const SYS_sync: c_long = 36; ++pub const SYS_kill: c_long = 37; ++pub const SYS_rename: c_long = 38; ++pub const SYS_mkdir: c_long = 39; ++pub const SYS_rmdir: c_long = 40; ++pub const SYS_dup: c_long = 41; ++pub const SYS_pipe: c_long = 42; ++pub const SYS_times: c_long = 43; ++pub const SYS_brk: c_long = 45; ++pub const SYS_signal: c_long = 48; ++pub const SYS_acct: c_long = 51; ++pub const SYS_umount2: c_long = 52; ++pub const SYS_ioctl: c_long = 54; ++pub const SYS_fcntl: c_long = 55; ++pub const SYS_setpgid: c_long = 57; ++pub const SYS_umask: c_long = 60; ++pub const SYS_chroot: c_long = 61; ++pub const SYS_ustat: c_long = 62; ++pub const SYS_dup2: c_long = 63; ++pub const SYS_getppid: c_long = 64; ++pub const SYS_getpgrp: c_long = 65; ++pub const SYS_setsid: c_long = 66; ++pub const SYS_sigaction: c_long = 67; ++pub const SYS_sigsuspend: c_long = 72; ++pub const SYS_sigpending: c_long = 73; ++pub const SYS_sethostname: c_long = 74; ++pub const SYS_setrlimit: c_long = 75; ++pub const SYS_getrusage: c_long = 77; ++pub const SYS_gettimeofday: c_long = 78; ++pub const SYS_settimeofday: c_long = 79; ++pub const SYS_symlink: c_long = 83; ++pub const SYS_readlink: c_long = 85; ++pub const SYS_uselib: c_long = 86; ++pub const SYS_swapon: c_long = 87; ++pub const SYS_reboot: c_long = 88; ++pub const SYS_readdir: c_long = 89; ++pub const SYS_mmap: c_long = 90; ++pub const SYS_munmap: c_long = 91; ++pub const SYS_truncate: c_long = 92; ++pub const SYS_ftruncate: c_long = 93; ++pub const SYS_fchmod: c_long = 94; ++pub const SYS_getpriority: c_long = 96; ++pub const SYS_setpriority: c_long = 97; ++pub const SYS_statfs: c_long = 99; ++pub const SYS_fstatfs: c_long = 100; ++pub const SYS_socketcall: c_long = 102; ++pub const SYS_syslog: c_long = 103; ++pub const SYS_setitimer: c_long = 104; ++pub const SYS_getitimer: c_long = 105; ++pub const SYS_stat: c_long = 106; ++pub const SYS_lstat: c_long = 107; ++pub const SYS_fstat: c_long = 108; ++pub const SYS_lookup_dcookie: c_long = 110; ++pub const SYS_vhangup: c_long = 111; ++pub const SYS_idle: c_long = 112; ++pub const SYS_wait4: c_long = 114; ++pub const SYS_swapoff: c_long = 115; ++pub const SYS_sysinfo: c_long = 116; ++pub const SYS_ipc: c_long = 117; ++pub const SYS_fsync: c_long = 118; ++pub const SYS_sigreturn: c_long = 119; ++pub const SYS_clone: c_long = 120; ++pub const SYS_setdomainname: c_long = 121; ++pub const SYS_uname: c_long = 122; ++pub const SYS_adjtimex: c_long = 124; ++pub const SYS_mprotect: c_long = 125; ++pub const SYS_sigprocmask: c_long = 126; ++pub const SYS_create_module: c_long = 127; ++pub const SYS_init_module: c_long = 128; ++pub const SYS_delete_module: c_long = 129; ++pub const SYS_get_kernel_syms: c_long = 130; ++pub const SYS_quotactl: c_long = 131; ++pub const SYS_getpgid: c_long = 132; ++pub const SYS_fchdir: c_long = 133; ++pub const SYS_bdflush: c_long = 134; ++pub const SYS_sysfs: c_long = 135; ++pub const SYS_personality: c_long = 136; ++pub const SYS_afs_syscall: c_long = 137; /* Syscall for Andrew File System */ ++pub const SYS_getdents: c_long = 141; ++pub const SYS_flock: c_long = 143; ++pub const SYS_msync: c_long = 144; ++pub const SYS_readv: c_long = 145; ++pub const SYS_writev: c_long = 146; ++pub const SYS_getsid: c_long = 147; ++pub const SYS_fdatasync: c_long = 148; ++pub const SYS__sysctl: c_long = 149; ++pub const SYS_mlock: c_long = 150; ++pub const SYS_munlock: c_long = 151; ++pub const SYS_mlockall: c_long = 152; ++pub const SYS_munlockall: c_long = 153; ++pub const SYS_sched_setparam: c_long = 154; ++pub const SYS_sched_getparam: c_long = 155; ++pub const SYS_sched_setscheduler: c_long = 156; ++pub const SYS_sched_getscheduler: c_long = 157; ++pub const SYS_sched_yield: c_long = 158; ++pub const SYS_sched_get_priority_max: c_long = 159; ++pub const SYS_sched_get_priority_min: c_long = 160; ++pub const SYS_sched_rr_get_interval: c_long = 161; ++pub const SYS_nanosleep: c_long = 162; ++pub const SYS_mremap: c_long = 163; ++pub const SYS_query_module: c_long = 167; ++pub const SYS_poll: c_long = 168; ++pub const SYS_nfsservctl: c_long = 169; ++pub const SYS_prctl: c_long = 172; ++pub const SYS_rt_sigreturn: c_long = 173; ++pub const SYS_rt_sigaction: c_long = 174; ++pub const SYS_rt_sigprocmask: c_long = 175; ++pub const SYS_rt_sigpending: c_long = 176; ++pub const SYS_rt_sigtimedwait: c_long = 177; ++pub const SYS_rt_sigqueueinfo: c_long = 178; ++pub const SYS_rt_sigsuspend: c_long = 179; ++pub const SYS_pread64: c_long = 180; ++pub const SYS_pwrite64: c_long = 181; ++pub const SYS_getcwd: c_long = 183; ++pub const SYS_capget: c_long = 184; ++pub const SYS_capset: c_long = 185; ++pub const SYS_sigaltstack: c_long = 186; ++pub const SYS_sendfile: c_long = 187; ++pub const SYS_getpmsg: c_long = 188; ++pub const SYS_putpmsg: c_long = 189; ++pub const SYS_vfork: c_long = 190; ++pub const SYS_pivot_root: c_long = 217; ++pub const SYS_mincore: c_long = 218; ++pub const SYS_madvise: c_long = 219; ++pub const SYS_getdents64: c_long = 220; ++pub const SYS_readahead: c_long = 222; ++pub const SYS_setxattr: c_long = 224; ++pub const SYS_lsetxattr: c_long = 225; ++pub const SYS_fsetxattr: c_long = 226; ++pub const SYS_getxattr: c_long = 227; ++pub const SYS_lgetxattr: c_long = 228; ++pub const SYS_fgetxattr: c_long = 229; ++pub const SYS_listxattr: c_long = 230; ++pub const SYS_llistxattr: c_long = 231; ++pub const SYS_flistxattr: c_long = 232; ++pub const SYS_removexattr: c_long = 233; ++pub const SYS_lremovexattr: c_long = 234; ++pub const SYS_fremovexattr: c_long = 235; ++pub const SYS_gettid: c_long = 236; ++pub const SYS_tkill: c_long = 237; ++pub const SYS_futex: c_long = 238; ++pub const SYS_sched_setaffinity: c_long = 239; ++pub const SYS_sched_getaffinity: c_long = 240; ++pub const SYS_tgkill: c_long = 241; ++pub const SYS_io_setup: c_long = 243; ++pub const SYS_io_destroy: c_long = 244; ++pub const SYS_io_getevents: c_long = 245; ++pub const SYS_io_submit: c_long = 246; ++pub const SYS_io_cancel: c_long = 247; ++pub const SYS_exit_group: c_long = 248; ++pub const SYS_epoll_create: c_long = 249; ++pub const SYS_epoll_ctl: c_long = 250; ++pub const SYS_epoll_wait: c_long = 251; ++pub const SYS_set_tid_address: c_long = 252; ++pub const SYS_fadvise64: c_long = 253; ++pub const SYS_timer_create: c_long = 254; ++pub const SYS_timer_settime: c_long = 255; ++pub const SYS_timer_gettime: c_long = 256; ++pub const SYS_timer_getoverrun: c_long = 257; ++pub const SYS_timer_delete: c_long = 258; ++pub const SYS_clock_settime: c_long = 259; ++pub const SYS_clock_gettime: c_long = 260; ++pub const SYS_clock_getres: c_long = 261; ++pub const SYS_clock_nanosleep: c_long = 262; ++pub const SYS_statfs64: c_long = 265; ++pub const SYS_fstatfs64: c_long = 266; ++pub const SYS_remap_file_pages: c_long = 267; ++pub const SYS_mbind: c_long = 268; ++pub const SYS_get_mempolicy: c_long = 269; ++pub const SYS_set_mempolicy: c_long = 270; ++pub const SYS_mq_open: c_long = 271; ++pub const SYS_mq_unlink: c_long = 272; ++pub const SYS_mq_timedsend: c_long = 273; ++pub const SYS_mq_timedreceive: c_long = 274; ++pub const SYS_mq_notify: c_long = 275; ++pub const SYS_mq_getsetattr: c_long = 276; ++pub const SYS_kexec_load: c_long = 277; ++pub const SYS_add_key: c_long = 278; ++pub const SYS_request_key: c_long = 279; ++pub const SYS_keyctl: c_long = 280; ++pub const SYS_waitid: c_long = 281; ++pub const SYS_ioprio_set: c_long = 282; ++pub const SYS_ioprio_get: c_long = 283; ++pub const SYS_inotify_init: c_long = 284; ++pub const SYS_inotify_add_watch: c_long = 285; ++pub const SYS_inotify_rm_watch: c_long = 286; ++pub const SYS_migrate_pages: c_long = 287; ++pub const SYS_openat: c_long = 288; ++pub const SYS_mkdirat: c_long = 289; ++pub const SYS_mknodat: c_long = 290; ++pub const SYS_fchownat: c_long = 291; ++pub const SYS_futimesat: c_long = 292; ++pub const SYS_unlinkat: c_long = 294; ++pub const SYS_renameat: c_long = 295; ++pub const SYS_linkat: c_long = 296; ++pub const SYS_symlinkat: c_long = 297; ++pub const SYS_readlinkat: c_long = 298; ++pub const SYS_fchmodat: c_long = 299; ++pub const SYS_faccessat: c_long = 300; ++pub const SYS_pselect6: c_long = 301; ++pub const SYS_ppoll: c_long = 302; ++pub const SYS_unshare: c_long = 303; ++pub const SYS_set_robust_list: c_long = 304; ++pub const SYS_get_robust_list: c_long = 305; ++pub const SYS_splice: c_long = 306; ++pub const SYS_sync_file_range: c_long = 307; ++pub const SYS_tee: c_long = 308; ++pub const SYS_vmsplice: c_long = 309; ++pub const SYS_move_pages: c_long = 310; ++pub const SYS_getcpu: c_long = 311; ++pub const SYS_epoll_pwait: c_long = 312; ++pub const SYS_utimes: c_long = 313; ++pub const SYS_fallocate: c_long = 314; ++pub const SYS_utimensat: c_long = 315; ++pub const SYS_signalfd: c_long = 316; ++pub const SYS_timerfd: c_long = 317; ++pub const SYS_eventfd: c_long = 318; ++pub const SYS_timerfd_create: c_long = 319; ++pub const SYS_timerfd_settime: c_long = 320; ++pub const SYS_timerfd_gettime: c_long = 321; ++pub const SYS_signalfd4: c_long = 322; ++pub const SYS_eventfd2: c_long = 323; ++pub const SYS_inotify_init1: c_long = 324; ++pub const SYS_pipe2: c_long = 325; ++pub const SYS_dup3: c_long = 326; ++pub const SYS_epoll_create1: c_long = 327; ++pub const SYS_preadv: c_long = 328; ++pub const SYS_pwritev: c_long = 329; ++pub const SYS_rt_tgsigqueueinfo: c_long = 330; ++pub const SYS_perf_event_open: c_long = 331; ++pub const SYS_fanotify_init: c_long = 332; ++pub const SYS_fanotify_mark: c_long = 333; ++pub const SYS_prlimit64: c_long = 334; ++pub const SYS_name_to_handle_at: c_long = 335; ++pub const SYS_open_by_handle_at: c_long = 336; ++pub const SYS_clock_adjtime: c_long = 337; ++pub const SYS_syncfs: c_long = 338; ++pub const SYS_setns: c_long = 339; ++pub const SYS_process_vm_readv: c_long = 340; ++pub const SYS_process_vm_writev: c_long = 341; ++pub const SYS_s390_runtime_instr: c_long = 342; ++pub const SYS_kcmp: c_long = 343; ++pub const SYS_finit_module: c_long = 344; ++pub const SYS_sched_setattr: c_long = 345; ++pub const SYS_sched_getattr: c_long = 346; ++pub const SYS_renameat2: c_long = 347; ++pub const SYS_seccomp: c_long = 348; ++pub const SYS_getrandom: c_long = 349; ++pub const SYS_memfd_create: c_long = 350; ++pub const SYS_bpf: c_long = 351; ++pub const SYS_s390_pci_mmio_write: c_long = 352; ++pub const SYS_s390_pci_mmio_read: c_long = 353; ++pub const SYS_execveat: c_long = 354; ++pub const SYS_userfaultfd: c_long = 355; ++pub const SYS_membarrier: c_long = 356; ++pub const SYS_recvmmsg: c_long = 357; ++pub const SYS_sendmmsg: c_long = 358; ++pub const SYS_socket: c_long = 359; ++pub const SYS_socketpair: c_long = 360; ++pub const SYS_bind: c_long = 361; ++pub const SYS_connect: c_long = 362; ++pub const SYS_listen: c_long = 363; ++pub const SYS_accept4: c_long = 364; ++pub const SYS_getsockopt: c_long = 365; ++pub const SYS_setsockopt: c_long = 366; ++pub const SYS_getsockname: c_long = 367; ++pub const SYS_getpeername: c_long = 368; ++pub const SYS_sendto: c_long = 369; ++pub const SYS_sendmsg: c_long = 370; ++pub const SYS_recvfrom: c_long = 371; ++pub const SYS_recvmsg: c_long = 372; ++pub const SYS_shutdown: c_long = 373; ++pub const SYS_mlock2: c_long = 374; ++pub const SYS_copy_file_range: c_long = 375; ++pub const SYS_preadv2: c_long = 376; ++pub const SYS_pwritev2: c_long = 377; ++pub const SYS_lchown: c_long = 198; ++pub const SYS_setuid: c_long = 213; ++pub const SYS_getuid: c_long = 199; ++pub const SYS_setgid: c_long = 214; ++pub const SYS_getgid: c_long = 200; ++pub const SYS_geteuid: c_long = 201; ++pub const SYS_setreuid: c_long = 203; ++pub const SYS_setregid: c_long = 204; ++pub const SYS_getrlimit: c_long = 191; ++pub const SYS_getgroups: c_long = 205; ++pub const SYS_fchown: c_long = 207; ++pub const SYS_setresuid: c_long = 208; ++pub const SYS_setresgid: c_long = 210; ++pub const SYS_getresgid: c_long = 211; ++pub const SYS_select: c_long = 142; ++pub const SYS_getegid: c_long = 202; ++pub const SYS_setgroups: c_long = 206; ++pub const SYS_getresuid: c_long = 209; ++pub const SYS_chown: c_long = 212; ++pub const SYS_setfsuid: c_long = 215; ++pub const SYS_setfsgid: c_long = 216; ++pub const SYS_newfstatat: c_long = 293; ++pub const SYS_statx: c_long = 379; ++pub const SYS_rseq: c_long = 383; ++pub const SYS_pidfd_send_signal: c_long = 424; ++pub const SYS_io_uring_setup: c_long = 425; ++pub const SYS_io_uring_enter: c_long = 426; ++pub const SYS_io_uring_register: c_long = 427; ++pub const SYS_open_tree: c_long = 428; ++pub const SYS_move_mount: c_long = 429; ++pub const SYS_fsopen: c_long = 430; ++pub const SYS_fsconfig: c_long = 431; ++pub const SYS_fsmount: c_long = 432; ++pub const SYS_fspick: c_long = 433; ++pub const SYS_pidfd_open: c_long = 434; ++pub const SYS_clone3: c_long = 435; ++pub const SYS_close_range: c_long = 436; ++pub const SYS_openat2: c_long = 437; ++pub const SYS_pidfd_getfd: c_long = 438; ++pub const SYS_faccessat2: c_long = 439; ++pub const SYS_process_madvise: c_long = 440; ++pub const SYS_epoll_pwait2: c_long = 441; ++pub const SYS_mount_setattr: c_long = 442; ++pub const SYS_quotactl_fd: c_long = 443; ++pub const SYS_landlock_create_ruleset: c_long = 444; ++pub const SYS_landlock_add_rule: c_long = 445; ++pub const SYS_landlock_restrict_self: c_long = 446; ++pub const SYS_memfd_secret: c_long = 447; ++pub const SYS_process_mrelease: c_long = 448; ++pub const SYS_futex_waitv: c_long = 449; ++pub const SYS_set_mempolicy_home_node: c_long = 450; ++pub const SYS_mseal: c_long = 462; ++ ++extern "C" { ++ ++ pub fn sysctl( ++ name: *mut c_int, ++ namelen: c_int, ++ oldp: *mut c_void, ++ oldlenp: *mut size_t, ++ newp: *mut c_void, ++ newlen: size_t, ++ ) -> c_int; ++ pub fn getcontext(ucp: *mut crate::ucontext_t) -> c_int; ++ pub fn setcontext(ucp: *const crate::ucontext_t) -> c_int; ++ pub fn makecontext(ucp: *mut crate::ucontext_t, func: extern "C" fn(), argc: c_int, ...); ++ pub fn swapcontext(uocp: *mut crate::ucontext_t, ucp: *const crate::ucontext_t) -> c_int; ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/sparc64/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,928 @@ ++//! SPARC64-specific definitions for 64-bit linux-like values ++ ++use crate::prelude::*; ++use crate::{off64_t, off_t, pthread_mutex_t}; ++ ++pub type c_long = i64; ++pub type c_ulong = u64; ++pub type c_char = i8; ++pub type wchar_t = i32; ++pub type nlink_t = u32; ++pub type blksize_t = i64; ++pub type suseconds_t = i32; ++pub type __u64 = c_ulonglong; ++pub type __s64 = c_longlong; ++ ++s! { ++ pub struct sigaction { ++ pub sa_sigaction: crate::sighandler_t, ++ pub sa_mask: crate::sigset_t, ++ #[cfg(target_arch = "sparc64")] ++ __reserved0: c_int, ++ pub sa_flags: c_int, ++ pub sa_restorer: Option, ++ } ++ ++ pub struct statfs { ++ pub f_type: crate::__fsword_t, ++ pub f_bsize: crate::__fsword_t, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_fsid: crate::fsid_t, ++ ++ pub f_namelen: crate::__fsword_t, ++ pub f_frsize: crate::__fsword_t, ++ f_spare: [crate::__fsword_t; 5], ++ } ++ ++ pub struct siginfo_t { ++ pub si_signo: c_int, ++ pub si_errno: c_int, ++ pub si_code: c_int, ++ #[doc(hidden)] ++ #[deprecated( ++ since = "0.2.54", ++ note = "Please leave a comment on \ ++ https://github.com/rust-lang/libc/pull/1316 if you're using \ ++ this field" ++ )] ++ pub _pad: [c_int; 29], ++ _align: [usize; 0], ++ } ++ ++ pub struct flock { ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ pub l_start: off_t, ++ pub l_len: off_t, ++ pub l_pid: crate::pid_t, ++ } ++ ++ pub struct flock64 { ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ pub l_start: off64_t, ++ pub l_len: off64_t, ++ pub l_pid: crate::pid_t, ++ __reserved: c_short, ++ } ++ ++ pub struct stack_t { ++ pub ss_sp: *mut c_void, ++ pub ss_flags: c_int, ++ pub ss_size: size_t, ++ } ++ ++ pub struct stat { ++ pub st_dev: crate::dev_t, ++ __pad0: u64, ++ pub st_ino: crate::ino_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ __pad1: u64, ++ pub st_size: off_t, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ __unused: [c_long; 2], ++ } ++ ++ pub struct stat64 { ++ pub st_dev: crate::dev_t, ++ __pad0: u64, ++ pub st_ino: crate::ino64_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ __pad2: c_int, ++ pub st_size: off64_t, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt64_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ __reserved: [c_long; 2], ++ } ++ ++ pub struct statfs64 { ++ pub f_type: crate::__fsword_t, ++ pub f_bsize: crate::__fsword_t, ++ pub f_blocks: u64, ++ pub f_bfree: u64, ++ pub f_bavail: u64, ++ pub f_files: u64, ++ pub f_ffree: u64, ++ pub f_fsid: crate::fsid_t, ++ pub f_namelen: crate::__fsword_t, ++ pub f_frsize: crate::__fsword_t, ++ pub f_flags: crate::__fsword_t, ++ pub f_spare: [crate::__fsword_t; 4], ++ } ++ ++ pub struct statvfs { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_favail: crate::fsfilcnt_t, ++ pub f_fsid: c_ulong, ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ __f_spare: [c_int; 6], ++ } ++ ++ pub struct statvfs64 { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: u64, ++ pub f_bfree: u64, ++ pub f_bavail: u64, ++ pub f_files: u64, ++ pub f_ffree: u64, ++ pub f_favail: u64, ++ pub f_fsid: c_ulong, ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ __f_spare: [c_int; 6], ++ } ++ ++ pub struct pthread_attr_t { ++ __size: [u64; 7], ++ } ++ ++ pub struct ipc_perm { ++ pub __key: crate::key_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub cuid: crate::uid_t, ++ pub cgid: crate::gid_t, ++ pub mode: crate::mode_t, ++ __pad0: u16, ++ pub __seq: c_ushort, ++ __unused1: c_ulonglong, ++ __unused2: c_ulonglong, ++ } ++ ++ pub struct shmid_ds { ++ pub shm_perm: crate::ipc_perm, ++ pub shm_atime: crate::time_t, ++ pub shm_dtime: crate::time_t, ++ pub shm_ctime: crate::time_t, ++ pub shm_segsz: size_t, ++ pub shm_cpid: crate::pid_t, ++ pub shm_lpid: crate::pid_t, ++ pub shm_nattch: crate::shmatt_t, ++ __reserved1: c_ulong, ++ __reserved2: c_ulong, ++ } ++} ++ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ #[repr(align(16))] ++ pub struct max_align_t { ++ priv_: [i64; 4], ++ } ++} ++ ++pub const POSIX_FADV_DONTNEED: c_int = 4; ++pub const POSIX_FADV_NOREUSE: c_int = 5; ++ ++pub const VEOF: usize = 4; ++pub const RTLD_DEEPBIND: c_int = 0x8; ++pub const RTLD_GLOBAL: c_int = 0x100; ++pub const RTLD_NOLOAD: c_int = 0x4; ++pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; ++pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32; ++ ++pub const O_APPEND: c_int = 0x8; ++pub const O_CREAT: c_int = 0x200; ++pub const O_EXCL: c_int = 0x800; ++pub const O_NOCTTY: c_int = 0x8000; ++pub const O_NONBLOCK: c_int = 0x4000; ++pub const O_SYNC: c_int = 0x802000; ++pub const O_RSYNC: c_int = 0x802000; ++pub const O_DSYNC: c_int = 0x2000; ++pub const O_FSYNC: c_int = 0x802000; ++pub const O_NOATIME: c_int = 0x200000; ++pub const O_PATH: c_int = 0x1000000; ++pub const O_TMPFILE: c_int = 0x2000000 | O_DIRECTORY; ++ ++pub const MADV_SOFT_OFFLINE: c_int = 101; ++pub const MAP_GROWSDOWN: c_int = 0x0200; ++pub const MAP_ANON: c_int = 0x0020; ++pub const MAP_ANONYMOUS: c_int = 0x0020; ++pub const MAP_DENYWRITE: c_int = 0x0800; ++pub const MAP_EXECUTABLE: c_int = 0x01000; ++pub const MAP_POPULATE: c_int = 0x08000; ++pub const MAP_NONBLOCK: c_int = 0x010000; ++pub const MAP_STACK: c_int = 0x020000; ++pub const MAP_HUGETLB: c_int = 0x040000; ++pub const MAP_SYNC: c_int = 0x080000; ++ ++pub const EDEADLK: c_int = 78; ++pub const ENAMETOOLONG: c_int = 63; ++pub const ENOLCK: c_int = 79; ++pub const ENOSYS: c_int = 90; ++pub const ENOTEMPTY: c_int = 66; ++pub const ELOOP: c_int = 62; ++pub const ENOMSG: c_int = 75; ++pub const EIDRM: c_int = 77; ++pub const ECHRNG: c_int = 94; ++pub const EL2NSYNC: c_int = 95; ++pub const EL3HLT: c_int = 96; ++pub const EL3RST: c_int = 97; ++pub const ELNRNG: c_int = 98; ++pub const EUNATCH: c_int = 99; ++pub const ENOCSI: c_int = 100; ++pub const EL2HLT: c_int = 101; ++pub const EBADE: c_int = 102; ++pub const EBADR: c_int = 103; ++pub const EXFULL: c_int = 104; ++pub const ENOANO: c_int = 105; ++pub const EBADRQC: c_int = 106; ++pub const EBADSLT: c_int = 107; ++pub const EMULTIHOP: c_int = 87; ++pub const EOVERFLOW: c_int = 92; ++pub const ENOTUNIQ: c_int = 115; ++pub const EBADFD: c_int = 93; ++pub const EBADMSG: c_int = 76; ++pub const EREMCHG: c_int = 89; ++pub const ELIBACC: c_int = 114; ++pub const ELIBBAD: c_int = 112; ++pub const ELIBSCN: c_int = 124; ++pub const ELIBMAX: c_int = 123; ++pub const ELIBEXEC: c_int = 110; ++pub const EILSEQ: c_int = 122; ++pub const ERESTART: c_int = 116; ++pub const ESTRPIPE: c_int = 91; ++pub const EUSERS: c_int = 68; ++pub const ENOTSOCK: c_int = 38; ++pub const EDESTADDRREQ: c_int = 39; ++pub const EMSGSIZE: c_int = 40; ++pub const EPROTOTYPE: c_int = 41; ++pub const ENOPROTOOPT: c_int = 42; ++pub const EPROTONOSUPPORT: c_int = 43; ++pub const ESOCKTNOSUPPORT: c_int = 44; ++pub const EOPNOTSUPP: c_int = 45; ++pub const EPFNOSUPPORT: c_int = 46; ++pub const EAFNOSUPPORT: c_int = 47; ++pub const EADDRINUSE: c_int = 48; ++pub const EADDRNOTAVAIL: c_int = 49; ++pub const ENETDOWN: c_int = 50; ++pub const ENETUNREACH: c_int = 51; ++pub const ENETRESET: c_int = 52; ++pub const ECONNABORTED: c_int = 53; ++pub const ECONNRESET: c_int = 54; ++pub const ENOBUFS: c_int = 55; ++pub const EISCONN: c_int = 56; ++pub const ENOTCONN: c_int = 57; ++pub const ESHUTDOWN: c_int = 58; ++pub const ETOOMANYREFS: c_int = 59; ++pub const ETIMEDOUT: c_int = 60; ++pub const ECONNREFUSED: c_int = 61; ++pub const EHOSTDOWN: c_int = 64; ++pub const EHOSTUNREACH: c_int = 65; ++pub const EALREADY: c_int = 37; ++pub const EINPROGRESS: c_int = 36; ++pub const ESTALE: c_int = 70; ++pub const EDQUOT: c_int = 69; ++pub const ENOMEDIUM: c_int = 125; ++pub const EMEDIUMTYPE: c_int = 126; ++pub const ECANCELED: c_int = 127; ++pub const ENOKEY: c_int = 128; ++pub const EKEYEXPIRED: c_int = 129; ++pub const EKEYREVOKED: c_int = 130; ++pub const EKEYREJECTED: c_int = 131; ++pub const EOWNERDEAD: c_int = 132; ++pub const ENOTRECOVERABLE: c_int = 133; ++pub const EHWPOISON: c_int = 135; ++pub const ERFKILL: c_int = 134; ++ ++pub const SOCK_STREAM: c_int = 1; ++pub const SOCK_DGRAM: c_int = 2; ++ ++pub const SA_ONSTACK: c_int = 1; ++pub const SA_SIGINFO: c_int = 0x200; ++pub const SA_NOCLDWAIT: c_int = 0x100; ++ ++pub const SIGTTIN: c_int = 21; ++pub const SIGTTOU: c_int = 22; ++pub const SIGXCPU: c_int = 24; ++pub const SIGXFSZ: c_int = 25; ++pub const SIGVTALRM: c_int = 26; ++pub const SIGPROF: c_int = 27; ++pub const SIGWINCH: c_int = 28; ++pub const SIGCHLD: c_int = 20; ++pub const SIGBUS: c_int = 10; ++pub const SIGUSR1: c_int = 30; ++pub const SIGUSR2: c_int = 31; ++pub const SIGCONT: c_int = 19; ++pub const SIGSTOP: c_int = 17; ++pub const SIGTSTP: c_int = 18; ++pub const SIGURG: c_int = 16; ++pub const SIGIO: c_int = 23; ++pub const SIGSYS: c_int = 12; ++pub const SIGPOLL: c_int = 23; ++pub const SIGPWR: c_int = 29; ++pub const SIG_SETMASK: c_int = 4; ++pub const SIG_BLOCK: c_int = 1; ++pub const SIG_UNBLOCK: c_int = 2; ++ ++pub const POLLWRNORM: c_short = 4; ++pub const POLLWRBAND: c_short = 0x100; ++ ++pub const O_ASYNC: c_int = 0x40; ++pub const O_NDELAY: c_int = 0x4004; ++ ++pub const PTRACE_DETACH: c_uint = 17; ++ ++pub const EFD_NONBLOCK: c_int = 0x4000; ++ ++pub const F_GETLK: c_int = 7; ++pub const F_GETOWN: c_int = 5; ++pub const F_SETOWN: c_int = 6; ++pub const F_SETLK: c_int = 8; ++pub const F_SETLKW: c_int = 9; ++pub const F_OFD_GETLK: c_int = 36; ++pub const F_OFD_SETLK: c_int = 37; ++pub const F_OFD_SETLKW: c_int = 38; ++ ++pub const F_RDLCK: c_int = 1; ++pub const F_WRLCK: c_int = 2; ++pub const F_UNLCK: c_int = 3; ++ ++pub const SFD_NONBLOCK: c_int = 0x4000; ++ ++pub const TCSANOW: c_int = 0; ++pub const TCSADRAIN: c_int = 1; ++pub const TCSAFLUSH: c_int = 2; ++ ++pub const SFD_CLOEXEC: c_int = 0x400000; ++ ++pub const NCCS: usize = 17; ++pub const O_TRUNC: c_int = 0x400; ++ ++pub const O_CLOEXEC: c_int = 0x400000; ++ ++pub const EBFONT: c_int = 109; ++pub const ENOSTR: c_int = 72; ++pub const ENODATA: c_int = 111; ++pub const ETIME: c_int = 73; ++pub const ENOSR: c_int = 74; ++pub const ENONET: c_int = 80; ++pub const ENOPKG: c_int = 113; ++pub const EREMOTE: c_int = 71; ++pub const ENOLINK: c_int = 82; ++pub const EADV: c_int = 83; ++pub const ESRMNT: c_int = 84; ++pub const ECOMM: c_int = 85; ++pub const EPROTO: c_int = 86; ++pub const EDOTDOT: c_int = 88; ++ ++pub const SA_NODEFER: c_int = 0x20; ++pub const SA_RESETHAND: c_int = 0x4; ++pub const SA_RESTART: c_int = 0x2; ++pub const SA_NOCLDSTOP: c_int = 0x00000008; ++ ++pub const EPOLL_CLOEXEC: c_int = 0x400000; ++ ++pub const EFD_CLOEXEC: c_int = 0x400000; ++pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; ++pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; ++pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; ++pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4; ++ ++pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++}; ++pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++}; ++pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++}; ++ ++pub const O_DIRECTORY: c_int = 0o200000; ++pub const O_NOFOLLOW: c_int = 0o400000; ++pub const O_DIRECT: c_int = 0x100000; ++ ++pub const MAP_LOCKED: c_int = 0x0100; ++pub const MAP_NORESERVE: c_int = 0x00040; ++ ++pub const EDEADLOCK: c_int = 108; ++pub const EUCLEAN: c_int = 117; ++pub const ENOTNAM: c_int = 118; ++pub const ENAVAIL: c_int = 119; ++pub const EISNAM: c_int = 120; ++pub const EREMOTEIO: c_int = 121; ++ ++pub const MCL_CURRENT: c_int = 0x2000; ++pub const MCL_FUTURE: c_int = 0x4000; ++pub const MCL_ONFAULT: c_int = 0x8000; ++ ++pub const SIGSTKSZ: size_t = 16384; ++pub const MINSIGSTKSZ: size_t = 4096; ++pub const CBAUD: crate::tcflag_t = 0x0000100f; ++pub const TAB1: crate::tcflag_t = 0x800; ++pub const TAB2: crate::tcflag_t = 0x1000; ++pub const TAB3: crate::tcflag_t = 0x1800; ++pub const CR1: crate::tcflag_t = 0x200; ++pub const CR2: crate::tcflag_t = 0x400; ++pub const CR3: crate::tcflag_t = 0x600; ++pub const FF1: crate::tcflag_t = 0x8000; ++pub const BS1: crate::tcflag_t = 0x2000; ++pub const VT1: crate::tcflag_t = 0x4000; ++pub const VWERASE: usize = 0xe; ++pub const VREPRINT: usize = 0xc; ++pub const VSUSP: usize = 0xa; ++pub const VSTART: usize = 0x8; ++pub const VSTOP: usize = 0x9; ++pub const VDISCARD: usize = 0xd; ++pub const VTIME: usize = 0x5; ++pub const IXON: crate::tcflag_t = 0x400; ++pub const IXOFF: crate::tcflag_t = 0x1000; ++pub const ONLCR: crate::tcflag_t = 0x4; ++pub const CSIZE: crate::tcflag_t = 0x30; ++pub const CS6: crate::tcflag_t = 0x10; ++pub const CS7: crate::tcflag_t = 0x20; ++pub const CS8: crate::tcflag_t = 0x30; ++pub const CSTOPB: crate::tcflag_t = 0x40; ++pub const CREAD: crate::tcflag_t = 0x80; ++pub const PARENB: crate::tcflag_t = 0x100; ++pub const PARODD: crate::tcflag_t = 0x200; ++pub const HUPCL: crate::tcflag_t = 0x400; ++pub const CLOCAL: crate::tcflag_t = 0x800; ++pub const ECHOKE: crate::tcflag_t = 0x800; ++pub const ECHOE: crate::tcflag_t = 0x10; ++pub const ECHOK: crate::tcflag_t = 0x20; ++pub const ECHONL: crate::tcflag_t = 0x40; ++pub const ECHOPRT: crate::tcflag_t = 0x400; ++pub const ECHOCTL: crate::tcflag_t = 0x200; ++pub const ISIG: crate::tcflag_t = 0x1; ++pub const ICANON: crate::tcflag_t = 0x2; ++pub const PENDIN: crate::tcflag_t = 0x4000; ++pub const NOFLSH: crate::tcflag_t = 0x80; ++pub const CIBAUD: crate::tcflag_t = 0o02003600000; ++pub const CBAUDEX: crate::tcflag_t = 0x00001000; ++pub const VSWTC: usize = 7; ++pub const OLCUC: crate::tcflag_t = 0o000002; ++pub const NLDLY: crate::tcflag_t = 0o000400; ++pub const CRDLY: crate::tcflag_t = 0o003000; ++pub const TABDLY: crate::tcflag_t = 0o014000; ++pub const BSDLY: crate::tcflag_t = 0o020000; ++pub const FFDLY: crate::tcflag_t = 0o100000; ++pub const VTDLY: crate::tcflag_t = 0o040000; ++pub const XTABS: crate::tcflag_t = 0o014000; ++ ++pub const B0: crate::speed_t = 0o000000; ++pub const B50: crate::speed_t = 0o000001; ++pub const B75: crate::speed_t = 0o000002; ++pub const B110: crate::speed_t = 0o000003; ++pub const B134: crate::speed_t = 0o000004; ++pub const B150: crate::speed_t = 0o000005; ++pub const B200: crate::speed_t = 0o000006; ++pub const B300: crate::speed_t = 0o000007; ++pub const B600: crate::speed_t = 0o000010; ++pub const B1200: crate::speed_t = 0o000011; ++pub const B1800: crate::speed_t = 0o000012; ++pub const B2400: crate::speed_t = 0o000013; ++pub const B4800: crate::speed_t = 0o000014; ++pub const B9600: crate::speed_t = 0o000015; ++pub const B19200: crate::speed_t = 0o000016; ++pub const B38400: crate::speed_t = 0o000017; ++pub const EXTA: crate::speed_t = B19200; ++pub const EXTB: crate::speed_t = B38400; ++pub const B57600: crate::speed_t = 0x1001; ++pub const B115200: crate::speed_t = 0x1002; ++pub const B230400: crate::speed_t = 0x1003; ++pub const B460800: crate::speed_t = 0x1004; ++pub const B76800: crate::speed_t = 0x1005; ++pub const B153600: crate::speed_t = 0x1006; ++pub const B307200: crate::speed_t = 0x1007; ++pub const B614400: crate::speed_t = 0x1008; ++pub const B921600: crate::speed_t = 0x1009; ++pub const B500000: crate::speed_t = 0x100a; ++pub const B576000: crate::speed_t = 0x100b; ++pub const B1000000: crate::speed_t = 0x100c; ++pub const B1152000: crate::speed_t = 0x100d; ++pub const B1500000: crate::speed_t = 0x100e; ++pub const B2000000: crate::speed_t = 0x100f; ++ ++pub const VEOL: usize = 5; ++pub const VEOL2: usize = 6; ++pub const VMIN: usize = 4; ++pub const IEXTEN: crate::tcflag_t = 0x8000; ++pub const TOSTOP: crate::tcflag_t = 0x100; ++pub const FLUSHO: crate::tcflag_t = 0x1000; ++pub const EXTPROC: crate::tcflag_t = 0x10000; ++ ++pub const SYS_restart_syscall: c_long = 0; ++pub const SYS_exit: c_long = 1; ++pub const SYS_fork: c_long = 2; ++pub const SYS_read: c_long = 3; ++pub const SYS_write: c_long = 4; ++pub const SYS_open: c_long = 5; ++pub const SYS_close: c_long = 6; ++pub const SYS_wait4: c_long = 7; ++pub const SYS_creat: c_long = 8; ++pub const SYS_link: c_long = 9; ++pub const SYS_unlink: c_long = 10; ++pub const SYS_execv: c_long = 11; ++pub const SYS_chdir: c_long = 12; ++pub const SYS_chown: c_long = 13; ++pub const SYS_mknod: c_long = 14; ++pub const SYS_chmod: c_long = 15; ++pub const SYS_lchown: c_long = 16; ++pub const SYS_brk: c_long = 17; ++pub const SYS_perfctr: c_long = 18; ++pub const SYS_lseek: c_long = 19; ++pub const SYS_getpid: c_long = 20; ++pub const SYS_capget: c_long = 21; ++pub const SYS_capset: c_long = 22; ++pub const SYS_setuid: c_long = 23; ++pub const SYS_getuid: c_long = 24; ++pub const SYS_vmsplice: c_long = 25; ++pub const SYS_ptrace: c_long = 26; ++pub const SYS_alarm: c_long = 27; ++pub const SYS_sigaltstack: c_long = 28; ++pub const SYS_pause: c_long = 29; ++pub const SYS_utime: c_long = 30; ++pub const SYS_access: c_long = 33; ++pub const SYS_nice: c_long = 34; ++pub const SYS_sync: c_long = 36; ++pub const SYS_kill: c_long = 37; ++pub const SYS_stat: c_long = 38; ++pub const SYS_sendfile: c_long = 39; ++pub const SYS_lstat: c_long = 40; ++pub const SYS_dup: c_long = 41; ++pub const SYS_pipe: c_long = 42; ++pub const SYS_times: c_long = 43; ++pub const SYS_umount2: c_long = 45; ++pub const SYS_setgid: c_long = 46; ++pub const SYS_getgid: c_long = 47; ++pub const SYS_signal: c_long = 48; ++pub const SYS_geteuid: c_long = 49; ++pub const SYS_getegid: c_long = 50; ++pub const SYS_acct: c_long = 51; ++pub const SYS_memory_ordering: c_long = 52; ++pub const SYS_ioctl: c_long = 54; ++pub const SYS_reboot: c_long = 55; ++pub const SYS_symlink: c_long = 57; ++pub const SYS_readlink: c_long = 58; ++pub const SYS_execve: c_long = 59; ++pub const SYS_umask: c_long = 60; ++pub const SYS_chroot: c_long = 61; ++pub const SYS_fstat: c_long = 62; ++pub const SYS_fstat64: c_long = 63; ++pub const SYS_getpagesize: c_long = 64; ++pub const SYS_msync: c_long = 65; ++pub const SYS_vfork: c_long = 66; ++pub const SYS_pread64: c_long = 67; ++pub const SYS_pwrite64: c_long = 68; ++pub const SYS_mmap: c_long = 71; ++pub const SYS_munmap: c_long = 73; ++pub const SYS_mprotect: c_long = 74; ++pub const SYS_madvise: c_long = 75; ++pub const SYS_vhangup: c_long = 76; ++pub const SYS_mincore: c_long = 78; ++pub const SYS_getgroups: c_long = 79; ++pub const SYS_setgroups: c_long = 80; ++pub const SYS_getpgrp: c_long = 81; ++pub const SYS_setitimer: c_long = 83; ++pub const SYS_swapon: c_long = 85; ++pub const SYS_getitimer: c_long = 86; ++pub const SYS_sethostname: c_long = 88; ++pub const SYS_dup2: c_long = 90; ++pub const SYS_fcntl: c_long = 92; ++pub const SYS_select: c_long = 93; ++pub const SYS_fsync: c_long = 95; ++pub const SYS_setpriority: c_long = 96; ++pub const SYS_socket: c_long = 97; ++pub const SYS_connect: c_long = 98; ++pub const SYS_accept: c_long = 99; ++pub const SYS_getpriority: c_long = 100; ++pub const SYS_rt_sigreturn: c_long = 101; ++pub const SYS_rt_sigaction: c_long = 102; ++pub const SYS_rt_sigprocmask: c_long = 103; ++pub const SYS_rt_sigpending: c_long = 104; ++pub const SYS_rt_sigtimedwait: c_long = 105; ++pub const SYS_rt_sigqueueinfo: c_long = 106; ++pub const SYS_rt_sigsuspend: c_long = 107; ++pub const SYS_setresuid: c_long = 108; ++pub const SYS_getresuid: c_long = 109; ++pub const SYS_setresgid: c_long = 110; ++pub const SYS_getresgid: c_long = 111; ++pub const SYS_recvmsg: c_long = 113; ++pub const SYS_sendmsg: c_long = 114; ++pub const SYS_gettimeofday: c_long = 116; ++pub const SYS_getrusage: c_long = 117; ++pub const SYS_getsockopt: c_long = 118; ++pub const SYS_getcwd: c_long = 119; ++pub const SYS_readv: c_long = 120; ++pub const SYS_writev: c_long = 121; ++pub const SYS_settimeofday: c_long = 122; ++pub const SYS_fchown: c_long = 123; ++pub const SYS_fchmod: c_long = 124; ++pub const SYS_recvfrom: c_long = 125; ++pub const SYS_setreuid: c_long = 126; ++pub const SYS_setregid: c_long = 127; ++pub const SYS_rename: c_long = 128; ++pub const SYS_truncate: c_long = 129; ++pub const SYS_ftruncate: c_long = 130; ++pub const SYS_flock: c_long = 131; ++pub const SYS_lstat64: c_long = 132; ++pub const SYS_sendto: c_long = 133; ++pub const SYS_shutdown: c_long = 134; ++pub const SYS_socketpair: c_long = 135; ++pub const SYS_mkdir: c_long = 136; ++pub const SYS_rmdir: c_long = 137; ++pub const SYS_utimes: c_long = 138; ++pub const SYS_stat64: c_long = 139; ++pub const SYS_sendfile64: c_long = 140; ++pub const SYS_getpeername: c_long = 141; ++pub const SYS_futex: c_long = 142; ++pub const SYS_gettid: c_long = 143; ++pub const SYS_getrlimit: c_long = 144; ++pub const SYS_setrlimit: c_long = 145; ++pub const SYS_pivot_root: c_long = 146; ++pub const SYS_prctl: c_long = 147; ++pub const SYS_pciconfig_read: c_long = 148; ++pub const SYS_pciconfig_write: c_long = 149; ++pub const SYS_getsockname: c_long = 150; ++pub const SYS_inotify_init: c_long = 151; ++pub const SYS_inotify_add_watch: c_long = 152; ++pub const SYS_poll: c_long = 153; ++pub const SYS_getdents64: c_long = 154; ++pub const SYS_inotify_rm_watch: c_long = 156; ++pub const SYS_statfs: c_long = 157; ++pub const SYS_fstatfs: c_long = 158; ++pub const SYS_umount: c_long = 159; ++pub const SYS_sched_set_affinity: c_long = 160; ++pub const SYS_sched_get_affinity: c_long = 161; ++pub const SYS_getdomainname: c_long = 162; ++pub const SYS_setdomainname: c_long = 163; ++pub const SYS_utrap_install: c_long = 164; ++pub const SYS_quotactl: c_long = 165; ++pub const SYS_set_tid_address: c_long = 166; ++pub const SYS_mount: c_long = 167; ++pub const SYS_ustat: c_long = 168; ++pub const SYS_setxattr: c_long = 169; ++pub const SYS_lsetxattr: c_long = 170; ++pub const SYS_fsetxattr: c_long = 171; ++pub const SYS_getxattr: c_long = 172; ++pub const SYS_lgetxattr: c_long = 173; ++pub const SYS_getdents: c_long = 174; ++pub const SYS_setsid: c_long = 175; ++pub const SYS_fchdir: c_long = 176; ++pub const SYS_fgetxattr: c_long = 177; ++pub const SYS_listxattr: c_long = 178; ++pub const SYS_llistxattr: c_long = 179; ++pub const SYS_flistxattr: c_long = 180; ++pub const SYS_removexattr: c_long = 181; ++pub const SYS_lremovexattr: c_long = 182; ++pub const SYS_sigpending: c_long = 183; ++pub const SYS_query_module: c_long = 184; ++pub const SYS_setpgid: c_long = 185; ++pub const SYS_fremovexattr: c_long = 186; ++pub const SYS_tkill: c_long = 187; ++pub const SYS_exit_group: c_long = 188; ++pub const SYS_uname: c_long = 189; ++pub const SYS_init_module: c_long = 190; ++pub const SYS_personality: c_long = 191; ++pub const SYS_remap_file_pages: c_long = 192; ++pub const SYS_epoll_create: c_long = 193; ++pub const SYS_epoll_ctl: c_long = 194; ++pub const SYS_epoll_wait: c_long = 195; ++pub const SYS_ioprio_set: c_long = 196; ++pub const SYS_getppid: c_long = 197; ++pub const SYS_sigaction: c_long = 198; ++pub const SYS_sgetmask: c_long = 199; ++pub const SYS_ssetmask: c_long = 200; ++pub const SYS_sigsuspend: c_long = 201; ++pub const SYS_oldlstat: c_long = 202; ++pub const SYS_uselib: c_long = 203; ++pub const SYS_readdir: c_long = 204; ++pub const SYS_readahead: c_long = 205; ++pub const SYS_socketcall: c_long = 206; ++pub const SYS_syslog: c_long = 207; ++pub const SYS_lookup_dcookie: c_long = 208; ++pub const SYS_fadvise64: c_long = 209; ++pub const SYS_fadvise64_64: c_long = 210; ++pub const SYS_tgkill: c_long = 211; ++pub const SYS_waitpid: c_long = 212; ++pub const SYS_swapoff: c_long = 213; ++pub const SYS_sysinfo: c_long = 214; ++pub const SYS_ipc: c_long = 215; ++pub const SYS_sigreturn: c_long = 216; ++pub const SYS_clone: c_long = 217; ++pub const SYS_ioprio_get: c_long = 218; ++pub const SYS_adjtimex: c_long = 219; ++pub const SYS_sigprocmask: c_long = 220; ++pub const SYS_create_module: c_long = 221; ++pub const SYS_delete_module: c_long = 222; ++pub const SYS_get_kernel_syms: c_long = 223; ++pub const SYS_getpgid: c_long = 224; ++pub const SYS_bdflush: c_long = 225; ++pub const SYS_sysfs: c_long = 226; ++pub const SYS_afs_syscall: c_long = 227; ++pub const SYS_setfsuid: c_long = 228; ++pub const SYS_setfsgid: c_long = 229; ++pub const SYS__newselect: c_long = 230; ++pub const SYS_splice: c_long = 232; ++pub const SYS_stime: c_long = 233; ++pub const SYS_statfs64: c_long = 234; ++pub const SYS_fstatfs64: c_long = 235; ++pub const SYS__llseek: c_long = 236; ++pub const SYS_mlock: c_long = 237; ++pub const SYS_munlock: c_long = 238; ++pub const SYS_mlockall: c_long = 239; ++pub const SYS_munlockall: c_long = 240; ++pub const SYS_sched_setparam: c_long = 241; ++pub const SYS_sched_getparam: c_long = 242; ++pub const SYS_sched_setscheduler: c_long = 243; ++pub const SYS_sched_getscheduler: c_long = 244; ++pub const SYS_sched_yield: c_long = 245; ++pub const SYS_sched_get_priority_max: c_long = 246; ++pub const SYS_sched_get_priority_min: c_long = 247; ++pub const SYS_sched_rr_get_interval: c_long = 248; ++pub const SYS_nanosleep: c_long = 249; ++pub const SYS_mremap: c_long = 250; ++pub const SYS__sysctl: c_long = 251; ++pub const SYS_getsid: c_long = 252; ++pub const SYS_fdatasync: c_long = 253; ++pub const SYS_nfsservctl: c_long = 254; ++pub const SYS_sync_file_range: c_long = 255; ++pub const SYS_clock_settime: c_long = 256; ++pub const SYS_clock_gettime: c_long = 257; ++pub const SYS_clock_getres: c_long = 258; ++pub const SYS_clock_nanosleep: c_long = 259; ++pub const SYS_sched_getaffinity: c_long = 260; ++pub const SYS_sched_setaffinity: c_long = 261; ++pub const SYS_timer_settime: c_long = 262; ++pub const SYS_timer_gettime: c_long = 263; ++pub const SYS_timer_getoverrun: c_long = 264; ++pub const SYS_timer_delete: c_long = 265; ++pub const SYS_timer_create: c_long = 266; ++pub const SYS_io_setup: c_long = 268; ++pub const SYS_io_destroy: c_long = 269; ++pub const SYS_io_submit: c_long = 270; ++pub const SYS_io_cancel: c_long = 271; ++pub const SYS_io_getevents: c_long = 272; ++pub const SYS_mq_open: c_long = 273; ++pub const SYS_mq_unlink: c_long = 274; ++pub const SYS_mq_timedsend: c_long = 275; ++pub const SYS_mq_timedreceive: c_long = 276; ++pub const SYS_mq_notify: c_long = 277; ++pub const SYS_mq_getsetattr: c_long = 278; ++pub const SYS_waitid: c_long = 279; ++pub const SYS_tee: c_long = 280; ++pub const SYS_add_key: c_long = 281; ++pub const SYS_request_key: c_long = 282; ++pub const SYS_keyctl: c_long = 283; ++pub const SYS_openat: c_long = 284; ++pub const SYS_mkdirat: c_long = 285; ++pub const SYS_mknodat: c_long = 286; ++pub const SYS_fchownat: c_long = 287; ++pub const SYS_futimesat: c_long = 288; ++pub const SYS_fstatat64: c_long = 289; ++pub const SYS_unlinkat: c_long = 290; ++pub const SYS_renameat: c_long = 291; ++pub const SYS_linkat: c_long = 292; ++pub const SYS_symlinkat: c_long = 293; ++pub const SYS_readlinkat: c_long = 294; ++pub const SYS_fchmodat: c_long = 295; ++pub const SYS_faccessat: c_long = 296; ++pub const SYS_pselect6: c_long = 297; ++pub const SYS_ppoll: c_long = 298; ++pub const SYS_unshare: c_long = 299; ++pub const SYS_set_robust_list: c_long = 300; ++pub const SYS_get_robust_list: c_long = 301; ++pub const SYS_migrate_pages: c_long = 302; ++pub const SYS_mbind: c_long = 303; ++pub const SYS_get_mempolicy: c_long = 304; ++pub const SYS_set_mempolicy: c_long = 305; ++pub const SYS_kexec_load: c_long = 306; ++pub const SYS_move_pages: c_long = 307; ++pub const SYS_getcpu: c_long = 308; ++pub const SYS_epoll_pwait: c_long = 309; ++pub const SYS_utimensat: c_long = 310; ++pub const SYS_signalfd: c_long = 311; ++pub const SYS_timerfd_create: c_long = 312; ++pub const SYS_eventfd: c_long = 313; ++pub const SYS_fallocate: c_long = 314; ++pub const SYS_timerfd_settime: c_long = 315; ++pub const SYS_timerfd_gettime: c_long = 316; ++pub const SYS_signalfd4: c_long = 317; ++pub const SYS_eventfd2: c_long = 318; ++pub const SYS_epoll_create1: c_long = 319; ++pub const SYS_dup3: c_long = 320; ++pub const SYS_pipe2: c_long = 321; ++pub const SYS_inotify_init1: c_long = 322; ++pub const SYS_accept4: c_long = 323; ++pub const SYS_preadv: c_long = 324; ++pub const SYS_pwritev: c_long = 325; ++pub const SYS_rt_tgsigqueueinfo: c_long = 326; ++pub const SYS_perf_event_open: c_long = 327; ++pub const SYS_recvmmsg: c_long = 328; ++pub const SYS_fanotify_init: c_long = 329; ++pub const SYS_fanotify_mark: c_long = 330; ++pub const SYS_prlimit64: c_long = 331; ++pub const SYS_name_to_handle_at: c_long = 332; ++pub const SYS_open_by_handle_at: c_long = 333; ++pub const SYS_clock_adjtime: c_long = 334; ++pub const SYS_syncfs: c_long = 335; ++pub const SYS_sendmmsg: c_long = 336; ++pub const SYS_setns: c_long = 337; ++pub const SYS_process_vm_readv: c_long = 338; ++pub const SYS_process_vm_writev: c_long = 339; ++pub const SYS_kern_features: c_long = 340; ++pub const SYS_kcmp: c_long = 341; ++pub const SYS_finit_module: c_long = 342; ++pub const SYS_sched_setattr: c_long = 343; ++pub const SYS_sched_getattr: c_long = 344; ++pub const SYS_renameat2: c_long = 345; ++pub const SYS_seccomp: c_long = 346; ++pub const SYS_getrandom: c_long = 347; ++pub const SYS_memfd_create: c_long = 348; ++pub const SYS_bpf: c_long = 349; ++pub const SYS_execveat: c_long = 350; ++pub const SYS_membarrier: c_long = 351; ++pub const SYS_userfaultfd: c_long = 352; ++pub const SYS_bind: c_long = 353; ++pub const SYS_listen: c_long = 354; ++pub const SYS_setsockopt: c_long = 355; ++pub const SYS_mlock2: c_long = 356; ++pub const SYS_copy_file_range: c_long = 357; ++pub const SYS_preadv2: c_long = 358; ++pub const SYS_pwritev2: c_long = 359; ++pub const SYS_statx: c_long = 360; ++pub const SYS_rseq: c_long = 365; ++pub const SYS_pidfd_send_signal: c_long = 424; ++pub const SYS_io_uring_setup: c_long = 425; ++pub const SYS_io_uring_enter: c_long = 426; ++pub const SYS_io_uring_register: c_long = 427; ++pub const SYS_open_tree: c_long = 428; ++pub const SYS_move_mount: c_long = 429; ++pub const SYS_fsopen: c_long = 430; ++pub const SYS_fsconfig: c_long = 431; ++pub const SYS_fsmount: c_long = 432; ++pub const SYS_fspick: c_long = 433; ++pub const SYS_pidfd_open: c_long = 434; ++// Reserved in the kernel, but not actually implemented yet ++pub const SYS_clone3: c_long = 435; ++pub const SYS_close_range: c_long = 436; ++pub const SYS_openat2: c_long = 437; ++pub const SYS_pidfd_getfd: c_long = 438; ++pub const SYS_faccessat2: c_long = 439; ++pub const SYS_process_madvise: c_long = 440; ++pub const SYS_epoll_pwait2: c_long = 441; ++pub const SYS_mount_setattr: c_long = 442; ++pub const SYS_quotactl_fd: c_long = 443; ++pub const SYS_landlock_create_ruleset: c_long = 444; ++pub const SYS_landlock_add_rule: c_long = 445; ++pub const SYS_landlock_restrict_self: c_long = 446; ++pub const SYS_memfd_secret: c_long = 447; ++pub const SYS_process_mrelease: c_long = 448; ++pub const SYS_futex_waitv: c_long = 449; ++pub const SYS_set_mempolicy_home_node: c_long = 450; ++ ++extern "C" { ++ pub fn sysctl( ++ name: *mut c_int, ++ namelen: c_int, ++ oldp: *mut c_void, ++ oldlenp: *mut size_t, ++ newp: *mut c_void, ++ newlen: size_t, ++ ) -> c_int; ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/x86_64/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,839 @@ ++//! x86_64-specific definitions for 64-bit linux-like values ++ ++use crate::prelude::*; ++use crate::{off64_t, off_t}; ++ ++pub type c_char = i8; ++pub type wchar_t = i32; ++pub type nlink_t = u64; ++pub type blksize_t = i64; ++pub type greg_t = i64; ++pub type suseconds_t = i64; ++pub type __u64 = c_ulonglong; ++pub type __s64 = c_longlong; ++ ++s! { ++ pub struct sigaction { ++ pub sa_sigaction: crate::sighandler_t, ++ pub sa_mask: crate::sigset_t, ++ #[cfg(target_arch = "sparc64")] ++ __reserved0: c_int, ++ pub sa_flags: c_int, ++ pub sa_restorer: Option, ++ } ++ ++ pub struct statfs { ++ pub f_type: crate::__fsword_t, ++ pub f_bsize: crate::__fsword_t, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_fsid: crate::fsid_t, ++ ++ pub f_namelen: crate::__fsword_t, ++ pub f_frsize: crate::__fsword_t, ++ f_spare: [crate::__fsword_t; 5], ++ } ++ ++ pub struct flock { ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ pub l_start: off_t, ++ pub l_len: off_t, ++ pub l_pid: crate::pid_t, ++ } ++ ++ pub struct flock64 { ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ pub l_start: off64_t, ++ pub l_len: off64_t, ++ pub l_pid: crate::pid_t, ++ } ++ ++ pub struct siginfo_t { ++ pub si_signo: c_int, ++ pub si_errno: c_int, ++ pub si_code: c_int, ++ #[doc(hidden)] ++ #[deprecated( ++ since = "0.2.54", ++ note = "Please leave a comment on \ ++ https://github.com/rust-lang/libc/pull/1316 if you're using \ ++ this field" ++ )] ++ pub _pad: [c_int; 29], ++ _align: [u64; 0], ++ } ++ ++ pub struct stack_t { ++ pub ss_sp: *mut c_void, ++ pub ss_flags: c_int, ++ pub ss_size: size_t, ++ } ++ ++ pub struct stat { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_mode: crate::mode_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ __pad0: c_int, ++ pub st_rdev: crate::dev_t, ++ pub st_size: off_t, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: i64, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: i64, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: i64, ++ __unused: [i64; 3], ++ } ++ ++ pub struct stat64 { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino64_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_mode: crate::mode_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ __pad0: c_int, ++ pub st_rdev: crate::dev_t, ++ pub st_size: off_t, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt64_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: i64, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: i64, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: i64, ++ __reserved: [i64; 3], ++ } ++ ++ pub struct statfs64 { ++ pub f_type: crate::__fsword_t, ++ pub f_bsize: crate::__fsword_t, ++ pub f_blocks: u64, ++ pub f_bfree: u64, ++ pub f_bavail: u64, ++ pub f_files: u64, ++ pub f_ffree: u64, ++ pub f_fsid: crate::fsid_t, ++ pub f_namelen: crate::__fsword_t, ++ pub f_frsize: crate::__fsword_t, ++ pub f_flags: crate::__fsword_t, ++ pub f_spare: [crate::__fsword_t; 4], ++ } ++ ++ pub struct statvfs64 { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: u64, ++ pub f_bfree: u64, ++ pub f_bavail: u64, ++ pub f_files: u64, ++ pub f_ffree: u64, ++ pub f_favail: u64, ++ pub f_fsid: c_ulong, ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ __f_spare: [c_int; 6], ++ } ++ ++ pub struct pthread_attr_t { ++ #[cfg(target_pointer_width = "32")] ++ __size: [u32; 8], ++ #[cfg(target_pointer_width = "64")] ++ __size: [u64; 7], ++ } ++ ++ pub struct _libc_fpxreg { ++ pub significand: [u16; 4], ++ pub exponent: u16, ++ __private: [u16; 3], ++ } ++ ++ pub struct _libc_xmmreg { ++ pub element: [u32; 4], ++ } ++ ++ pub struct _libc_fpstate { ++ pub cwd: u16, ++ pub swd: u16, ++ pub ftw: u16, ++ pub fop: u16, ++ pub rip: u64, ++ pub rdp: u64, ++ pub mxcsr: u32, ++ pub mxcr_mask: u32, ++ pub _st: [_libc_fpxreg; 8], ++ pub _xmm: [_libc_xmmreg; 16], ++ __private: [u64; 12], ++ } ++ ++ pub struct user_regs_struct { ++ pub r15: c_ulonglong, ++ pub r14: c_ulonglong, ++ pub r13: c_ulonglong, ++ pub r12: c_ulonglong, ++ pub rbp: c_ulonglong, ++ pub rbx: c_ulonglong, ++ pub r11: c_ulonglong, ++ pub r10: c_ulonglong, ++ pub r9: c_ulonglong, ++ pub r8: c_ulonglong, ++ pub rax: c_ulonglong, ++ pub rcx: c_ulonglong, ++ pub rdx: c_ulonglong, ++ pub rsi: c_ulonglong, ++ pub rdi: c_ulonglong, ++ pub orig_rax: c_ulonglong, ++ pub rip: c_ulonglong, ++ pub cs: c_ulonglong, ++ pub eflags: c_ulonglong, ++ pub rsp: c_ulonglong, ++ pub ss: c_ulonglong, ++ pub fs_base: c_ulonglong, ++ pub gs_base: c_ulonglong, ++ pub ds: c_ulonglong, ++ pub es: c_ulonglong, ++ pub fs: c_ulonglong, ++ pub gs: c_ulonglong, ++ } ++ ++ pub struct user { ++ pub regs: user_regs_struct, ++ pub u_fpvalid: c_int, ++ pub i387: user_fpregs_struct, ++ pub u_tsize: c_ulonglong, ++ pub u_dsize: c_ulonglong, ++ pub u_ssize: c_ulonglong, ++ pub start_code: c_ulonglong, ++ pub start_stack: c_ulonglong, ++ pub signal: c_longlong, ++ __reserved: c_int, ++ #[cfg(target_pointer_width = "32")] ++ __pad1: u32, ++ pub u_ar0: *mut user_regs_struct, ++ #[cfg(target_pointer_width = "32")] ++ __pad2: u32, ++ pub u_fpstate: *mut user_fpregs_struct, ++ pub magic: c_ulonglong, ++ pub u_comm: [c_char; 32], ++ pub u_debugreg: [c_ulonglong; 8], ++ } ++ ++ pub struct mcontext_t { ++ pub gregs: [greg_t; 23], ++ pub fpregs: *mut _libc_fpstate, ++ __private: [u64; 8], ++ } ++ ++ pub struct ipc_perm { ++ pub __key: crate::key_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub cuid: crate::uid_t, ++ pub cgid: crate::gid_t, ++ pub mode: c_ushort, ++ __pad1: c_ushort, ++ pub __seq: c_ushort, ++ __pad2: c_ushort, ++ __unused1: u64, ++ __unused2: u64, ++ } ++ ++ pub struct shmid_ds { ++ pub shm_perm: crate::ipc_perm, ++ pub shm_segsz: size_t, ++ pub shm_atime: crate::time_t, ++ pub shm_dtime: crate::time_t, ++ pub shm_ctime: crate::time_t, ++ pub shm_cpid: crate::pid_t, ++ pub shm_lpid: crate::pid_t, ++ pub shm_nattch: crate::shmatt_t, ++ __unused4: u64, ++ __unused5: u64, ++ } ++ ++ pub struct ptrace_rseq_configuration { ++ pub rseq_abi_pointer: crate::__u64, ++ pub rseq_abi_size: crate::__u32, ++ pub signature: crate::__u32, ++ pub flags: crate::__u32, ++ pub pad: crate::__u32, ++ } ++ ++ #[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, ++ } ++} ++ ++s_no_extra_traits! { ++ pub struct user_fpregs_struct { ++ pub cwd: c_ushort, ++ pub swd: c_ushort, ++ pub ftw: c_ushort, ++ pub fop: c_ushort, ++ pub rip: c_ulonglong, ++ pub rdp: c_ulonglong, ++ pub mxcsr: c_uint, ++ pub mxcr_mask: c_uint, ++ pub st_space: [c_uint; 32], ++ pub xmm_space: [c_uint; 64], ++ padding: [c_uint; 24], ++ } ++ ++ pub struct ucontext_t { ++ pub uc_flags: c_ulong, ++ pub uc_link: *mut ucontext_t, ++ pub uc_stack: crate::stack_t, ++ pub uc_mcontext: mcontext_t, ++ pub uc_sigmask: crate::sigset_t, ++ __private: [u8; 512], ++ // FIXME: the shadow stack field requires glibc >= 2.28. ++ // Re-add once we drop compatibility with glibc versions older than ++ // 2.28. ++ // ++ // __ssp: [c_ulonglong; 4], ++ } ++ ++ #[allow(missing_debug_implementations)] ++ #[repr(align(16))] ++ pub struct max_align_t { ++ priv_: [f64; 4], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for user_fpregs_struct { ++ fn eq(&self, other: &user_fpregs_struct) -> bool { ++ self.cwd == other.cwd ++ && self.swd == other.swd ++ && self.ftw == other.ftw ++ && self.fop == other.fop ++ && self.rip == other.rip ++ && self.rdp == other.rdp ++ && self.mxcsr == other.mxcsr ++ && self.mxcr_mask == other.mxcr_mask ++ && self.st_space == other.st_space ++ && self ++ .xmm_space ++ .iter() ++ .zip(other.xmm_space.iter()) ++ .all(|(a, b)| a == b) ++ // Ignore padding field ++ } ++ } ++ ++ impl Eq for user_fpregs_struct {} ++ ++ impl fmt::Debug for user_fpregs_struct { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("user_fpregs_struct") ++ .field("cwd", &self.cwd) ++ .field("ftw", &self.ftw) ++ .field("fop", &self.fop) ++ .field("rip", &self.rip) ++ .field("rdp", &self.rdp) ++ .field("mxcsr", &self.mxcsr) ++ .field("mxcr_mask", &self.mxcr_mask) ++ .field("st_space", &self.st_space) ++ // FIXME: .field("xmm_space", &self.xmm_space) ++ // Ignore padding field ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for user_fpregs_struct { ++ fn hash(&self, state: &mut H) { ++ self.cwd.hash(state); ++ self.ftw.hash(state); ++ self.fop.hash(state); ++ self.rip.hash(state); ++ self.rdp.hash(state); ++ self.mxcsr.hash(state); ++ self.mxcr_mask.hash(state); ++ self.st_space.hash(state); ++ self.xmm_space.hash(state); ++ // Ignore padding field ++ } ++ } ++ ++ impl PartialEq for ucontext_t { ++ fn eq(&self, other: &ucontext_t) -> bool { ++ self.uc_flags == other.uc_flags ++ && self.uc_link == other.uc_link ++ && self.uc_stack == other.uc_stack ++ && self.uc_mcontext == other.uc_mcontext ++ && self.uc_sigmask == other.uc_sigmask ++ // Ignore __private field ++ } ++ } ++ ++ impl Eq for ucontext_t {} ++ ++ impl fmt::Debug for ucontext_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("ucontext_t") ++ .field("uc_flags", &self.uc_flags) ++ .field("uc_link", &self.uc_link) ++ .field("uc_stack", &self.uc_stack) ++ .field("uc_mcontext", &self.uc_mcontext) ++ .field("uc_sigmask", &self.uc_sigmask) ++ // Ignore __private field ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for ucontext_t { ++ fn hash(&self, state: &mut H) { ++ self.uc_flags.hash(state); ++ self.uc_link.hash(state); ++ self.uc_stack.hash(state); ++ self.uc_mcontext.hash(state); ++ self.uc_sigmask.hash(state); ++ // Ignore __private field ++ } ++ } ++ } ++} ++ ++pub const POSIX_FADV_DONTNEED: c_int = 4; ++pub const POSIX_FADV_NOREUSE: c_int = 5; ++ ++pub const VEOF: usize = 4; ++pub const RTLD_DEEPBIND: c_int = 0x8; ++pub const RTLD_GLOBAL: c_int = 0x100; ++pub const RTLD_NOLOAD: c_int = 0x4; ++ ++pub const O_APPEND: c_int = 1024; ++pub const O_CREAT: c_int = 64; ++pub const O_EXCL: c_int = 128; ++pub const O_NOCTTY: c_int = 256; ++pub const O_NONBLOCK: c_int = 2048; ++pub const O_SYNC: c_int = 1052672; ++pub const O_RSYNC: c_int = 1052672; ++pub const O_DSYNC: c_int = 4096; ++pub const O_FSYNC: c_int = 0x101000; ++pub const O_NOATIME: c_int = 0o1000000; ++pub const O_PATH: c_int = 0o10000000; ++pub const O_TMPFILE: c_int = 0o20000000 | O_DIRECTORY; ++ ++pub const MADV_SOFT_OFFLINE: c_int = 101; ++pub const MAP_GROWSDOWN: c_int = 0x0100; ++ ++pub const EDEADLK: c_int = 35; ++pub const ENAMETOOLONG: c_int = 36; ++pub const ENOLCK: c_int = 37; ++pub const ENOSYS: c_int = 38; ++pub const ENOTEMPTY: c_int = 39; ++pub const ELOOP: c_int = 40; ++pub const ENOMSG: c_int = 42; ++pub const EIDRM: c_int = 43; ++pub const ECHRNG: c_int = 44; ++pub const EL2NSYNC: c_int = 45; ++pub const EL3HLT: c_int = 46; ++pub const EL3RST: c_int = 47; ++pub const ELNRNG: c_int = 48; ++pub const EUNATCH: c_int = 49; ++pub const ENOCSI: c_int = 50; ++pub const EL2HLT: c_int = 51; ++pub const EBADE: c_int = 52; ++pub const EBADR: c_int = 53; ++pub const EXFULL: c_int = 54; ++pub const ENOANO: c_int = 55; ++pub const EBADRQC: c_int = 56; ++pub const EBADSLT: c_int = 57; ++pub const EMULTIHOP: c_int = 72; ++pub const EOVERFLOW: c_int = 75; ++pub const ENOTUNIQ: c_int = 76; ++pub const EBADFD: c_int = 77; ++pub const EBADMSG: c_int = 74; ++pub const EREMCHG: c_int = 78; ++pub const ELIBACC: c_int = 79; ++pub const ELIBBAD: c_int = 80; ++pub const ELIBSCN: c_int = 81; ++pub const ELIBMAX: c_int = 82; ++pub const ELIBEXEC: c_int = 83; ++pub const EILSEQ: c_int = 84; ++pub const ERESTART: c_int = 85; ++pub const ESTRPIPE: c_int = 86; ++pub const EUSERS: c_int = 87; ++pub const ENOTSOCK: c_int = 88; ++pub const EDESTADDRREQ: c_int = 89; ++pub const EMSGSIZE: c_int = 90; ++pub const EPROTOTYPE: c_int = 91; ++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 EPFNOSUPPORT: c_int = 96; ++pub const EAFNOSUPPORT: c_int = 97; ++pub const EADDRINUSE: c_int = 98; ++pub const EADDRNOTAVAIL: c_int = 99; ++pub const ENETDOWN: c_int = 100; ++pub const ENETUNREACH: c_int = 101; ++pub const ENETRESET: c_int = 102; ++pub const ECONNABORTED: c_int = 103; ++pub const ECONNRESET: c_int = 104; ++pub const ENOBUFS: c_int = 105; ++pub const EISCONN: c_int = 106; ++pub const ENOTCONN: c_int = 107; ++pub const ESHUTDOWN: c_int = 108; ++pub const ETOOMANYREFS: c_int = 109; ++pub const ETIMEDOUT: c_int = 110; ++pub const ECONNREFUSED: c_int = 111; ++pub const EHOSTDOWN: c_int = 112; ++pub const EHOSTUNREACH: c_int = 113; ++pub const EALREADY: c_int = 114; ++pub const EINPROGRESS: c_int = 115; ++pub const ESTALE: c_int = 116; ++pub const EDQUOT: c_int = 122; ++pub const ENOMEDIUM: c_int = 123; ++pub const EMEDIUMTYPE: c_int = 124; ++pub const ECANCELED: c_int = 125; ++pub const ENOKEY: c_int = 126; ++pub const EKEYEXPIRED: c_int = 127; ++pub const EKEYREVOKED: c_int = 128; ++pub const EKEYREJECTED: c_int = 129; ++pub const EOWNERDEAD: c_int = 130; ++pub const ENOTRECOVERABLE: c_int = 131; ++pub const EHWPOISON: c_int = 133; ++pub const ERFKILL: c_int = 132; ++ ++pub const SOCK_STREAM: c_int = 1; ++pub const SOCK_DGRAM: c_int = 2; ++ ++pub const SA_ONSTACK: c_int = 0x08000000; ++pub const SA_SIGINFO: c_int = 0x00000004; ++pub const SA_NOCLDWAIT: c_int = 0x00000002; ++ ++pub const SIGTTIN: c_int = 21; ++pub const SIGTTOU: c_int = 22; ++pub const SIGXCPU: c_int = 24; ++pub const SIGXFSZ: c_int = 25; ++pub const SIGVTALRM: c_int = 26; ++pub const SIGPROF: c_int = 27; ++pub const SIGWINCH: c_int = 28; ++pub const SIGCHLD: c_int = 17; ++pub const SIGBUS: c_int = 7; ++pub const SIGUSR1: c_int = 10; ++pub const SIGUSR2: c_int = 12; ++pub const SIGCONT: c_int = 18; ++pub const SIGSTOP: c_int = 19; ++pub const SIGTSTP: c_int = 20; ++pub const SIGURG: c_int = 23; ++pub const SIGIO: c_int = 29; ++pub const SIGSYS: c_int = 31; ++pub const SIGSTKFLT: c_int = 16; ++#[deprecated(since = "0.2.55", note = "Use SIGSYS instead")] ++pub const SIGUNUSED: c_int = 31; ++pub const SIGPOLL: c_int = 29; ++pub const SIGPWR: c_int = 30; ++pub const SIG_SETMASK: c_int = 2; ++pub const SIG_BLOCK: c_int = 0x000000; ++pub const SIG_UNBLOCK: c_int = 0x01; ++ ++pub const POLLWRNORM: c_short = 0x100; ++pub const POLLWRBAND: c_short = 0x200; ++ ++pub const O_ASYNC: c_int = 0x2000; ++pub const O_NDELAY: c_int = 0x800; ++ ++pub const PTRACE_DETACH: c_uint = 17; ++pub const PTRACE_GET_RSEQ_CONFIGURATION: c_uint = 0x420f; ++ ++pub const EFD_NONBLOCK: c_int = 0x800; ++ ++pub const F_GETLK: c_int = 5; ++pub const F_GETOWN: c_int = 9; ++pub const F_SETOWN: c_int = 8; ++pub const F_SETLK: c_int = 6; ++pub const F_SETLKW: c_int = 7; ++pub const F_OFD_GETLK: c_int = 36; ++pub const F_OFD_SETLK: c_int = 37; ++pub const F_OFD_SETLKW: c_int = 38; ++ ++pub const F_RDLCK: c_int = 0; ++pub const F_WRLCK: c_int = 1; ++pub const F_UNLCK: c_int = 2; ++ ++pub const SFD_NONBLOCK: c_int = 0x0800; ++ ++pub const TCSANOW: c_int = 0; ++pub const TCSADRAIN: c_int = 1; ++pub const TCSAFLUSH: c_int = 2; ++ ++pub const SFD_CLOEXEC: c_int = 0x080000; ++ ++pub const NCCS: usize = 32; ++ ++pub const O_TRUNC: c_int = 512; ++ ++pub const O_CLOEXEC: c_int = 0x80000; ++ ++pub const EBFONT: c_int = 59; ++pub const ENOSTR: c_int = 60; ++pub const ENODATA: c_int = 61; ++pub const ETIME: c_int = 62; ++pub const ENOSR: c_int = 63; ++pub const ENONET: c_int = 64; ++pub const ENOPKG: c_int = 65; ++pub const EREMOTE: c_int = 66; ++pub const ENOLINK: c_int = 67; ++pub const EADV: c_int = 68; ++pub const ESRMNT: c_int = 69; ++pub const ECOMM: c_int = 70; ++pub const EPROTO: c_int = 71; ++pub const EDOTDOT: c_int = 73; ++ ++pub const SA_NODEFER: c_int = 0x40000000; ++pub const SA_RESETHAND: c_int = 0x80000000; ++pub const SA_RESTART: c_int = 0x10000000; ++pub const SA_NOCLDSTOP: c_int = 0x00000001; ++ ++pub const EPOLL_CLOEXEC: c_int = 0x80000; ++ ++pub const EFD_CLOEXEC: c_int = 0x80000; ++ ++pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; ++pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; ++pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4; ++ ++pub const O_DIRECT: c_int = 0x4000; ++pub const O_DIRECTORY: c_int = 0x10000; ++pub const O_NOFOLLOW: c_int = 0x20000; ++ ++pub const MAP_HUGETLB: c_int = 0x040000; ++pub const MAP_LOCKED: c_int = 0x02000; ++pub const MAP_NORESERVE: c_int = 0x04000; ++pub const MAP_32BIT: c_int = 0x0040; ++pub const MAP_ANON: c_int = 0x0020; ++pub const MAP_ANONYMOUS: c_int = 0x0020; ++pub const MAP_DENYWRITE: c_int = 0x0800; ++pub const MAP_EXECUTABLE: c_int = 0x01000; ++pub const MAP_POPULATE: c_int = 0x08000; ++pub const MAP_NONBLOCK: c_int = 0x010000; ++pub const MAP_STACK: c_int = 0x020000; ++pub const MAP_SYNC: c_int = 0x080000; ++ ++pub const EDEADLOCK: c_int = 35; ++pub const EUCLEAN: c_int = 117; ++pub const ENOTNAM: c_int = 118; ++pub const ENAVAIL: c_int = 119; ++pub const EISNAM: c_int = 120; ++pub const EREMOTEIO: c_int = 121; ++ ++pub const PTRACE_GETFPREGS: c_uint = 14; ++pub const PTRACE_SETFPREGS: c_uint = 15; ++pub const PTRACE_GETFPXREGS: c_uint = 18; ++pub const PTRACE_SETFPXREGS: c_uint = 19; ++pub const PTRACE_GETREGS: c_uint = 12; ++pub const PTRACE_SETREGS: c_uint = 13; ++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; ++pub const MCL_ONFAULT: c_int = 0x0004; ++ ++pub const SIGSTKSZ: size_t = 8192; ++pub const MINSIGSTKSZ: size_t = 2048; ++pub const CBAUD: crate::tcflag_t = 0o0010017; ++pub const TAB1: crate::tcflag_t = 0x00000800; ++pub const TAB2: crate::tcflag_t = 0x00001000; ++pub const TAB3: crate::tcflag_t = 0x00001800; ++pub const CR1: crate::tcflag_t = 0x00000200; ++pub const CR2: crate::tcflag_t = 0x00000400; ++pub const CR3: crate::tcflag_t = 0x00000600; ++pub const FF1: crate::tcflag_t = 0x00008000; ++pub const BS1: crate::tcflag_t = 0x00002000; ++pub const VT1: crate::tcflag_t = 0x00004000; ++pub const VWERASE: usize = 14; ++pub const VREPRINT: usize = 12; ++pub const VSUSP: usize = 10; ++pub const VSTART: usize = 8; ++pub const VSTOP: usize = 9; ++pub const VDISCARD: usize = 13; ++pub const VTIME: usize = 5; ++pub const IXON: crate::tcflag_t = 0x00000400; ++pub const IXOFF: crate::tcflag_t = 0x00001000; ++pub const ONLCR: crate::tcflag_t = 0x4; ++pub const CSIZE: crate::tcflag_t = 0x00000030; ++pub const CS6: crate::tcflag_t = 0x00000010; ++pub const CS7: crate::tcflag_t = 0x00000020; ++pub const CS8: crate::tcflag_t = 0x00000030; ++pub const CSTOPB: crate::tcflag_t = 0x00000040; ++pub const CREAD: crate::tcflag_t = 0x00000080; ++pub const PARENB: crate::tcflag_t = 0x00000100; ++pub const PARODD: crate::tcflag_t = 0x00000200; ++pub const HUPCL: crate::tcflag_t = 0x00000400; ++pub const CLOCAL: crate::tcflag_t = 0x00000800; ++pub const ECHOKE: crate::tcflag_t = 0x00000800; ++pub const ECHOE: crate::tcflag_t = 0x00000010; ++pub const ECHOK: crate::tcflag_t = 0x00000020; ++pub const ECHONL: crate::tcflag_t = 0x00000040; ++pub const ECHOPRT: crate::tcflag_t = 0x00000400; ++pub const ECHOCTL: crate::tcflag_t = 0x00000200; ++pub const ISIG: crate::tcflag_t = 0x00000001; ++pub const ICANON: crate::tcflag_t = 0x00000002; ++pub const PENDIN: crate::tcflag_t = 0x00004000; ++pub const NOFLSH: crate::tcflag_t = 0x00000080; ++pub const CIBAUD: crate::tcflag_t = 0o02003600000; ++pub const CBAUDEX: crate::tcflag_t = 0o010000; ++pub const VSWTC: usize = 7; ++pub const OLCUC: crate::tcflag_t = 0o000002; ++pub const NLDLY: crate::tcflag_t = 0o000400; ++pub const CRDLY: crate::tcflag_t = 0o003000; ++pub const TABDLY: crate::tcflag_t = 0o014000; ++pub const BSDLY: crate::tcflag_t = 0o020000; ++pub const FFDLY: crate::tcflag_t = 0o100000; ++pub const VTDLY: crate::tcflag_t = 0o040000; ++pub const XTABS: crate::tcflag_t = 0o014000; ++ ++pub const B0: crate::speed_t = 0o000000; ++pub const B50: crate::speed_t = 0o000001; ++pub const B75: crate::speed_t = 0o000002; ++pub const B110: crate::speed_t = 0o000003; ++pub const B134: crate::speed_t = 0o000004; ++pub const B150: crate::speed_t = 0o000005; ++pub const B200: crate::speed_t = 0o000006; ++pub const B300: crate::speed_t = 0o000007; ++pub const B600: crate::speed_t = 0o000010; ++pub const B1200: crate::speed_t = 0o000011; ++pub const B1800: crate::speed_t = 0o000012; ++pub const B2400: crate::speed_t = 0o000013; ++pub const B4800: crate::speed_t = 0o000014; ++pub const B9600: crate::speed_t = 0o000015; ++pub const B19200: crate::speed_t = 0o000016; ++pub const B38400: crate::speed_t = 0o000017; ++pub const EXTA: crate::speed_t = B19200; ++pub const EXTB: crate::speed_t = B38400; ++pub const B57600: crate::speed_t = 0o010001; ++pub const B115200: crate::speed_t = 0o010002; ++pub const B230400: crate::speed_t = 0o010003; ++pub const B460800: crate::speed_t = 0o010004; ++pub const B500000: crate::speed_t = 0o010005; ++pub const B576000: crate::speed_t = 0o010006; ++pub const B921600: crate::speed_t = 0o010007; ++pub const B1000000: crate::speed_t = 0o010010; ++pub const B1152000: crate::speed_t = 0o010011; ++pub const B1500000: crate::speed_t = 0o010012; ++pub const B2000000: crate::speed_t = 0o010013; ++pub const B2500000: crate::speed_t = 0o010014; ++pub const B3000000: crate::speed_t = 0o010015; ++pub const B3500000: crate::speed_t = 0o010016; ++pub const B4000000: crate::speed_t = 0o010017; ++ ++pub const VEOL: usize = 11; ++pub const VEOL2: usize = 16; ++pub const VMIN: usize = 6; ++pub const IEXTEN: crate::tcflag_t = 0x00008000; ++pub const TOSTOP: crate::tcflag_t = 0x00000100; ++pub const FLUSHO: crate::tcflag_t = 0x00001000; ++pub const EXTPROC: crate::tcflag_t = 0x00010000; ++ ++// offsets in user_regs_structs, from sys/reg.h ++pub const R15: c_int = 0; ++pub const R14: c_int = 1; ++pub const R13: c_int = 2; ++pub const R12: c_int = 3; ++pub const RBP: c_int = 4; ++pub const RBX: c_int = 5; ++pub const R11: c_int = 6; ++pub const R10: c_int = 7; ++pub const R9: c_int = 8; ++pub const R8: c_int = 9; ++pub const RAX: c_int = 10; ++pub const RCX: c_int = 11; ++pub const RDX: c_int = 12; ++pub const RSI: c_int = 13; ++pub const RDI: c_int = 14; ++pub const ORIG_RAX: c_int = 15; ++pub const RIP: c_int = 16; ++pub const CS: c_int = 17; ++pub const EFLAGS: c_int = 18; ++pub const RSP: c_int = 19; ++pub const SS: c_int = 20; ++pub const FS_BASE: c_int = 21; ++pub const GS_BASE: c_int = 22; ++pub const DS: c_int = 23; ++pub const ES: c_int = 24; ++pub const FS: c_int = 25; ++pub const GS: c_int = 26; ++ ++// offsets in mcontext_t.gregs from sys/ucontext.h ++pub const REG_R8: c_int = 0; ++pub const REG_R9: c_int = 1; ++pub const REG_R10: c_int = 2; ++pub const REG_R11: c_int = 3; ++pub const REG_R12: c_int = 4; ++pub const REG_R13: c_int = 5; ++pub const REG_R14: c_int = 6; ++pub const REG_R15: c_int = 7; ++pub const REG_RDI: c_int = 8; ++pub const REG_RSI: c_int = 9; ++pub const REG_RBP: c_int = 10; ++pub const REG_RBX: c_int = 11; ++pub const REG_RDX: c_int = 12; ++pub const REG_RAX: c_int = 13; ++pub const REG_RCX: c_int = 14; ++pub const REG_RSP: c_int = 15; ++pub const REG_RIP: c_int = 16; ++pub const REG_EFL: c_int = 17; ++pub const REG_CSGSFS: c_int = 18; ++pub const REG_ERR: c_int = 19; ++pub const REG_TRAPNO: c_int = 20; ++pub const REG_OLDMASK: c_int = 21; ++pub const REG_CR2: c_int = 22; ++ ++extern "C" { ++ pub fn getcontext(ucp: *mut ucontext_t) -> c_int; ++ pub fn setcontext(ucp: *const ucontext_t) -> c_int; ++ pub fn makecontext(ucp: *mut ucontext_t, func: extern "C" fn(), argc: c_int, ...); ++ pub fn swapcontext(uocp: *mut ucontext_t, ucp: *const ucontext_t) -> c_int; ++} ++ ++cfg_if! { ++ if #[cfg(target_pointer_width = "32")] { ++ mod x32; ++ pub use self::x32::*; ++ } else { ++ mod not_x32; ++ pub use self::not_x32::*; ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/x86_64/not_x32.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,446 @@ ++use crate::prelude::*; ++use crate::pthread_mutex_t; ++ ++pub type c_long = i64; ++pub type c_ulong = u64; ++ ++s! { ++ pub struct statvfs { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_favail: crate::fsfilcnt_t, ++ pub f_fsid: c_ulong, ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ __f_spare: [c_int; 6], ++ } ++} ++ ++pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; ++pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; ++pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32; ++ ++#[cfg(target_endian = "little")] ++pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++}; ++#[cfg(target_endian = "little")] ++pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++}; ++#[cfg(target_endian = "little")] ++pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++}; ++#[cfg(target_endian = "big")] ++pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++}; ++#[cfg(target_endian = "big")] ++pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++}; ++#[cfg(target_endian = "big")] ++pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ ], ++}; ++ ++// Syscall table ++ ++pub const SYS_read: c_long = 0; ++pub const SYS_write: c_long = 1; ++pub const SYS_open: c_long = 2; ++pub const SYS_close: c_long = 3; ++pub const SYS_stat: c_long = 4; ++pub const SYS_fstat: c_long = 5; ++pub const SYS_lstat: c_long = 6; ++pub const SYS_poll: c_long = 7; ++pub const SYS_lseek: c_long = 8; ++pub const SYS_mmap: c_long = 9; ++pub const SYS_mprotect: c_long = 10; ++pub const SYS_munmap: c_long = 11; ++pub const SYS_brk: c_long = 12; ++pub const SYS_rt_sigaction: c_long = 13; ++pub const SYS_rt_sigprocmask: c_long = 14; ++pub const SYS_rt_sigreturn: c_long = 15; ++pub const SYS_ioctl: c_long = 16; ++pub const SYS_pread64: c_long = 17; ++pub const SYS_pwrite64: c_long = 18; ++pub const SYS_readv: c_long = 19; ++pub const SYS_writev: c_long = 20; ++pub const SYS_access: c_long = 21; ++pub const SYS_pipe: c_long = 22; ++pub const SYS_select: c_long = 23; ++pub const SYS_sched_yield: c_long = 24; ++pub const SYS_mremap: c_long = 25; ++pub const SYS_msync: c_long = 26; ++pub const SYS_mincore: c_long = 27; ++pub const SYS_madvise: c_long = 28; ++pub const SYS_shmget: c_long = 29; ++pub const SYS_shmat: c_long = 30; ++pub const SYS_shmctl: c_long = 31; ++pub const SYS_dup: c_long = 32; ++pub const SYS_dup2: c_long = 33; ++pub const SYS_pause: c_long = 34; ++pub const SYS_nanosleep: c_long = 35; ++pub const SYS_getitimer: c_long = 36; ++pub const SYS_alarm: c_long = 37; ++pub const SYS_setitimer: c_long = 38; ++pub const SYS_getpid: c_long = 39; ++pub const SYS_sendfile: c_long = 40; ++pub const SYS_socket: c_long = 41; ++pub const SYS_connect: c_long = 42; ++pub const SYS_accept: c_long = 43; ++pub const SYS_sendto: c_long = 44; ++pub const SYS_recvfrom: c_long = 45; ++pub const SYS_sendmsg: c_long = 46; ++pub const SYS_recvmsg: c_long = 47; ++pub const SYS_shutdown: c_long = 48; ++pub const SYS_bind: c_long = 49; ++pub const SYS_listen: c_long = 50; ++pub const SYS_getsockname: c_long = 51; ++pub const SYS_getpeername: c_long = 52; ++pub const SYS_socketpair: c_long = 53; ++pub const SYS_setsockopt: c_long = 54; ++pub const SYS_getsockopt: c_long = 55; ++pub const SYS_clone: c_long = 56; ++pub const SYS_fork: c_long = 57; ++pub const SYS_vfork: c_long = 58; ++pub const SYS_execve: c_long = 59; ++pub const SYS_exit: c_long = 60; ++pub const SYS_wait4: c_long = 61; ++pub const SYS_kill: c_long = 62; ++pub const SYS_uname: c_long = 63; ++pub const SYS_semget: c_long = 64; ++pub const SYS_semop: c_long = 65; ++pub const SYS_semctl: c_long = 66; ++pub const SYS_shmdt: c_long = 67; ++pub const SYS_msgget: c_long = 68; ++pub const SYS_msgsnd: c_long = 69; ++pub const SYS_msgrcv: c_long = 70; ++pub const SYS_msgctl: c_long = 71; ++pub const SYS_fcntl: c_long = 72; ++pub const SYS_flock: c_long = 73; ++pub const SYS_fsync: c_long = 74; ++pub const SYS_fdatasync: c_long = 75; ++pub const SYS_truncate: c_long = 76; ++pub const SYS_ftruncate: c_long = 77; ++pub const SYS_getdents: c_long = 78; ++pub const SYS_getcwd: c_long = 79; ++pub const SYS_chdir: c_long = 80; ++pub const SYS_fchdir: c_long = 81; ++pub const SYS_rename: c_long = 82; ++pub const SYS_mkdir: c_long = 83; ++pub const SYS_rmdir: c_long = 84; ++pub const SYS_creat: c_long = 85; ++pub const SYS_link: c_long = 86; ++pub const SYS_unlink: c_long = 87; ++pub const SYS_symlink: c_long = 88; ++pub const SYS_readlink: c_long = 89; ++pub const SYS_chmod: c_long = 90; ++pub const SYS_fchmod: c_long = 91; ++pub const SYS_chown: c_long = 92; ++pub const SYS_fchown: c_long = 93; ++pub const SYS_lchown: c_long = 94; ++pub const SYS_umask: c_long = 95; ++pub const SYS_gettimeofday: c_long = 96; ++pub const SYS_getrlimit: c_long = 97; ++pub const SYS_getrusage: c_long = 98; ++pub const SYS_sysinfo: c_long = 99; ++pub const SYS_times: c_long = 100; ++pub const SYS_ptrace: c_long = 101; ++pub const SYS_getuid: c_long = 102; ++pub const SYS_syslog: c_long = 103; ++pub const SYS_getgid: c_long = 104; ++pub const SYS_setuid: c_long = 105; ++pub const SYS_setgid: c_long = 106; ++pub const SYS_geteuid: c_long = 107; ++pub const SYS_getegid: c_long = 108; ++pub const SYS_setpgid: c_long = 109; ++pub const SYS_getppid: c_long = 110; ++pub const SYS_getpgrp: c_long = 111; ++pub const SYS_setsid: c_long = 112; ++pub const SYS_setreuid: c_long = 113; ++pub const SYS_setregid: c_long = 114; ++pub const SYS_getgroups: c_long = 115; ++pub const SYS_setgroups: c_long = 116; ++pub const SYS_setresuid: c_long = 117; ++pub const SYS_getresuid: c_long = 118; ++pub const SYS_setresgid: c_long = 119; ++pub const SYS_getresgid: c_long = 120; ++pub const SYS_getpgid: c_long = 121; ++pub const SYS_setfsuid: c_long = 122; ++pub const SYS_setfsgid: c_long = 123; ++pub const SYS_getsid: c_long = 124; ++pub const SYS_capget: c_long = 125; ++pub const SYS_capset: c_long = 126; ++pub const SYS_rt_sigpending: c_long = 127; ++pub const SYS_rt_sigtimedwait: c_long = 128; ++pub const SYS_rt_sigqueueinfo: c_long = 129; ++pub const SYS_rt_sigsuspend: c_long = 130; ++pub const SYS_sigaltstack: c_long = 131; ++pub const SYS_utime: c_long = 132; ++pub const SYS_mknod: c_long = 133; ++pub const SYS_uselib: c_long = 134; ++pub const SYS_personality: c_long = 135; ++pub const SYS_ustat: c_long = 136; ++pub const SYS_statfs: c_long = 137; ++pub const SYS_fstatfs: c_long = 138; ++pub const SYS_sysfs: c_long = 139; ++pub const SYS_getpriority: c_long = 140; ++pub const SYS_setpriority: c_long = 141; ++pub const SYS_sched_setparam: c_long = 142; ++pub const SYS_sched_getparam: c_long = 143; ++pub const SYS_sched_setscheduler: c_long = 144; ++pub const SYS_sched_getscheduler: c_long = 145; ++pub const SYS_sched_get_priority_max: c_long = 146; ++pub const SYS_sched_get_priority_min: c_long = 147; ++pub const SYS_sched_rr_get_interval: c_long = 148; ++pub const SYS_mlock: c_long = 149; ++pub const SYS_munlock: c_long = 150; ++pub const SYS_mlockall: c_long = 151; ++pub const SYS_munlockall: c_long = 152; ++pub const SYS_vhangup: c_long = 153; ++pub const SYS_modify_ldt: c_long = 154; ++pub const SYS_pivot_root: c_long = 155; ++pub const SYS__sysctl: c_long = 156; ++pub const SYS_prctl: c_long = 157; ++pub const SYS_arch_prctl: c_long = 158; ++pub const SYS_adjtimex: c_long = 159; ++pub const SYS_setrlimit: c_long = 160; ++pub const SYS_chroot: c_long = 161; ++pub const SYS_sync: c_long = 162; ++pub const SYS_acct: c_long = 163; ++pub const SYS_settimeofday: c_long = 164; ++pub const SYS_mount: c_long = 165; ++pub const SYS_umount2: c_long = 166; ++pub const SYS_swapon: c_long = 167; ++pub const SYS_swapoff: c_long = 168; ++pub const SYS_reboot: c_long = 169; ++pub const SYS_sethostname: c_long = 170; ++pub const SYS_setdomainname: c_long = 171; ++pub const SYS_iopl: c_long = 172; ++pub const SYS_ioperm: c_long = 173; ++pub const SYS_create_module: c_long = 174; ++pub const SYS_init_module: c_long = 175; ++pub const SYS_delete_module: c_long = 176; ++pub const SYS_get_kernel_syms: c_long = 177; ++pub const SYS_query_module: c_long = 178; ++pub const SYS_quotactl: c_long = 179; ++pub const SYS_nfsservctl: c_long = 180; ++pub const SYS_getpmsg: c_long = 181; ++pub const SYS_putpmsg: c_long = 182; ++pub const SYS_afs_syscall: c_long = 183; ++pub const SYS_tuxcall: c_long = 184; ++pub const SYS_security: c_long = 185; ++pub const SYS_gettid: c_long = 186; ++pub const SYS_readahead: c_long = 187; ++pub const SYS_setxattr: c_long = 188; ++pub const SYS_lsetxattr: c_long = 189; ++pub const SYS_fsetxattr: c_long = 190; ++pub const SYS_getxattr: c_long = 191; ++pub const SYS_lgetxattr: c_long = 192; ++pub const SYS_fgetxattr: c_long = 193; ++pub const SYS_listxattr: c_long = 194; ++pub const SYS_llistxattr: c_long = 195; ++pub const SYS_flistxattr: c_long = 196; ++pub const SYS_removexattr: c_long = 197; ++pub const SYS_lremovexattr: c_long = 198; ++pub const SYS_fremovexattr: c_long = 199; ++pub const SYS_tkill: c_long = 200; ++pub const SYS_time: c_long = 201; ++pub const SYS_futex: c_long = 202; ++pub const SYS_sched_setaffinity: c_long = 203; ++pub const SYS_sched_getaffinity: c_long = 204; ++pub const SYS_set_thread_area: c_long = 205; ++pub const SYS_io_setup: c_long = 206; ++pub const SYS_io_destroy: c_long = 207; ++pub const SYS_io_getevents: c_long = 208; ++pub const SYS_io_submit: c_long = 209; ++pub const SYS_io_cancel: c_long = 210; ++pub const SYS_get_thread_area: c_long = 211; ++pub const SYS_lookup_dcookie: c_long = 212; ++pub const SYS_epoll_create: c_long = 213; ++pub const SYS_epoll_ctl_old: c_long = 214; ++pub const SYS_epoll_wait_old: c_long = 215; ++pub const SYS_remap_file_pages: c_long = 216; ++pub const SYS_getdents64: c_long = 217; ++pub const SYS_set_tid_address: c_long = 218; ++pub const SYS_restart_syscall: c_long = 219; ++pub const SYS_semtimedop: c_long = 220; ++pub const SYS_fadvise64: c_long = 221; ++pub const SYS_timer_create: c_long = 222; ++pub const SYS_timer_settime: c_long = 223; ++pub const SYS_timer_gettime: c_long = 224; ++pub const SYS_timer_getoverrun: c_long = 225; ++pub const SYS_timer_delete: c_long = 226; ++pub const SYS_clock_settime: c_long = 227; ++pub const SYS_clock_gettime: c_long = 228; ++pub const SYS_clock_getres: c_long = 229; ++pub const SYS_clock_nanosleep: c_long = 230; ++pub const SYS_exit_group: c_long = 231; ++pub const SYS_epoll_wait: c_long = 232; ++pub const SYS_epoll_ctl: c_long = 233; ++pub const SYS_tgkill: c_long = 234; ++pub const SYS_utimes: c_long = 235; ++pub const SYS_vserver: c_long = 236; ++pub const SYS_mbind: c_long = 237; ++pub const SYS_set_mempolicy: c_long = 238; ++pub const SYS_get_mempolicy: c_long = 239; ++pub const SYS_mq_open: c_long = 240; ++pub const SYS_mq_unlink: c_long = 241; ++pub const SYS_mq_timedsend: c_long = 242; ++pub const SYS_mq_timedreceive: c_long = 243; ++pub const SYS_mq_notify: c_long = 244; ++pub const SYS_mq_getsetattr: c_long = 245; ++pub const SYS_kexec_load: c_long = 246; ++pub const SYS_waitid: c_long = 247; ++pub const SYS_add_key: c_long = 248; ++pub const SYS_request_key: c_long = 249; ++pub const SYS_keyctl: c_long = 250; ++pub const SYS_ioprio_set: c_long = 251; ++pub const SYS_ioprio_get: c_long = 252; ++pub const SYS_inotify_init: c_long = 253; ++pub const SYS_inotify_add_watch: c_long = 254; ++pub const SYS_inotify_rm_watch: c_long = 255; ++pub const SYS_migrate_pages: c_long = 256; ++pub const SYS_openat: c_long = 257; ++pub const SYS_mkdirat: c_long = 258; ++pub const SYS_mknodat: c_long = 259; ++pub const SYS_fchownat: c_long = 260; ++pub const SYS_futimesat: c_long = 261; ++pub const SYS_newfstatat: c_long = 262; ++pub const SYS_unlinkat: c_long = 263; ++pub const SYS_renameat: c_long = 264; ++pub const SYS_linkat: c_long = 265; ++pub const SYS_symlinkat: c_long = 266; ++pub const SYS_readlinkat: c_long = 267; ++pub const SYS_fchmodat: c_long = 268; ++pub const SYS_faccessat: c_long = 269; ++pub const SYS_pselect6: c_long = 270; ++pub const SYS_ppoll: c_long = 271; ++pub const SYS_unshare: c_long = 272; ++pub const SYS_set_robust_list: c_long = 273; ++pub const SYS_get_robust_list: c_long = 274; ++pub const SYS_splice: c_long = 275; ++pub const SYS_tee: c_long = 276; ++pub const SYS_sync_file_range: c_long = 277; ++pub const SYS_vmsplice: c_long = 278; ++pub const SYS_move_pages: c_long = 279; ++pub const SYS_utimensat: c_long = 280; ++pub const SYS_epoll_pwait: c_long = 281; ++pub const SYS_signalfd: c_long = 282; ++pub const SYS_timerfd_create: c_long = 283; ++pub const SYS_eventfd: c_long = 284; ++pub const SYS_fallocate: c_long = 285; ++pub const SYS_timerfd_settime: c_long = 286; ++pub const SYS_timerfd_gettime: c_long = 287; ++pub const SYS_accept4: c_long = 288; ++pub const SYS_signalfd4: c_long = 289; ++pub const SYS_eventfd2: c_long = 290; ++pub const SYS_epoll_create1: c_long = 291; ++pub const SYS_dup3: c_long = 292; ++pub const SYS_pipe2: c_long = 293; ++pub const SYS_inotify_init1: c_long = 294; ++pub const SYS_preadv: c_long = 295; ++pub const SYS_pwritev: c_long = 296; ++pub const SYS_rt_tgsigqueueinfo: c_long = 297; ++pub const SYS_perf_event_open: c_long = 298; ++pub const SYS_recvmmsg: c_long = 299; ++pub const SYS_fanotify_init: c_long = 300; ++pub const SYS_fanotify_mark: c_long = 301; ++pub const SYS_prlimit64: c_long = 302; ++pub const SYS_name_to_handle_at: c_long = 303; ++pub const SYS_open_by_handle_at: c_long = 304; ++pub const SYS_clock_adjtime: c_long = 305; ++pub const SYS_syncfs: c_long = 306; ++pub const SYS_sendmmsg: c_long = 307; ++pub const SYS_setns: c_long = 308; ++pub const SYS_getcpu: c_long = 309; ++pub const SYS_process_vm_readv: c_long = 310; ++pub const SYS_process_vm_writev: c_long = 311; ++pub const SYS_kcmp: c_long = 312; ++pub const SYS_finit_module: c_long = 313; ++pub const SYS_sched_setattr: c_long = 314; ++pub const SYS_sched_getattr: c_long = 315; ++pub const SYS_renameat2: c_long = 316; ++pub const SYS_seccomp: c_long = 317; ++pub const SYS_getrandom: c_long = 318; ++pub const SYS_memfd_create: c_long = 319; ++pub const SYS_kexec_file_load: c_long = 320; ++pub const SYS_bpf: c_long = 321; ++pub const SYS_execveat: c_long = 322; ++pub const SYS_userfaultfd: c_long = 323; ++pub const SYS_membarrier: c_long = 324; ++pub const SYS_mlock2: c_long = 325; ++pub const SYS_copy_file_range: c_long = 326; ++pub const SYS_preadv2: c_long = 327; ++pub const SYS_pwritev2: c_long = 328; ++pub const SYS_pkey_mprotect: c_long = 329; ++pub const SYS_pkey_alloc: c_long = 330; ++pub const SYS_pkey_free: c_long = 331; ++pub const SYS_statx: c_long = 332; ++pub const SYS_rseq: c_long = 334; ++pub const SYS_pidfd_send_signal: c_long = 424; ++pub const SYS_io_uring_setup: c_long = 425; ++pub const SYS_io_uring_enter: c_long = 426; ++pub const SYS_io_uring_register: c_long = 427; ++pub const SYS_open_tree: c_long = 428; ++pub const SYS_move_mount: c_long = 429; ++pub const SYS_fsopen: c_long = 430; ++pub const SYS_fsconfig: c_long = 431; ++pub const SYS_fsmount: c_long = 432; ++pub const SYS_fspick: c_long = 433; ++pub const SYS_pidfd_open: c_long = 434; ++pub const SYS_clone3: c_long = 435; ++pub const SYS_close_range: c_long = 436; ++pub const SYS_openat2: c_long = 437; ++pub const SYS_pidfd_getfd: c_long = 438; ++pub const SYS_faccessat2: c_long = 439; ++pub const SYS_process_madvise: c_long = 440; ++pub const SYS_epoll_pwait2: c_long = 441; ++pub const SYS_mount_setattr: c_long = 442; ++pub const SYS_quotactl_fd: c_long = 443; ++pub const SYS_landlock_create_ruleset: c_long = 444; ++pub const SYS_landlock_add_rule: c_long = 445; ++pub const SYS_landlock_restrict_self: c_long = 446; ++pub const SYS_memfd_secret: c_long = 447; ++pub const SYS_process_mrelease: c_long = 448; ++pub const SYS_futex_waitv: c_long = 449; ++pub const SYS_set_mempolicy_home_node: c_long = 450; ++pub const SYS_fchmodat2: c_long = 452; ++pub const SYS_mseal: c_long = 462; ++ ++extern "C" { ++ pub fn sysctl( ++ name: *mut c_int, ++ namelen: c_int, ++ oldp: *mut c_void, ++ oldlenp: *mut size_t, ++ newp: *mut c_void, ++ newlen: size_t, ++ ) -> c_int; ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/b64/x86_64/x32.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,401 @@ ++use crate::prelude::*; ++use crate::pthread_mutex_t; ++ ++pub type c_long = i32; ++pub type c_ulong = u32; ++ ++s! { ++ pub struct statvfs { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_favail: crate::fsfilcnt_t, ++ pub f_fsid: c_ulong, ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ __f_spare: [c_int; 6], ++ } ++} ++ ++pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 32; ++pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 44; ++pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 20; ++ ++pub const PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, ++ ], ++}; ++pub const PTHREAD_ERRORCHECK_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, ++ ], ++}; ++pub const PTHREAD_ADAPTIVE_MUTEX_INITIALIZER_NP: crate::pthread_mutex_t = pthread_mutex_t { ++ size: [ ++ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ++ 0, 0, ++ ], ++}; ++ ++// Syscall table ++ ++pub const __X32_SYSCALL_BIT: c_long = 0x40000000; ++ ++pub const SYS_read: c_long = __X32_SYSCALL_BIT + 0; ++pub const SYS_write: c_long = __X32_SYSCALL_BIT + 1; ++pub const SYS_open: c_long = __X32_SYSCALL_BIT + 2; ++pub const SYS_close: c_long = __X32_SYSCALL_BIT + 3; ++pub const SYS_stat: c_long = __X32_SYSCALL_BIT + 4; ++pub const SYS_fstat: c_long = __X32_SYSCALL_BIT + 5; ++pub const SYS_lstat: c_long = __X32_SYSCALL_BIT + 6; ++pub const SYS_poll: c_long = __X32_SYSCALL_BIT + 7; ++pub const SYS_lseek: c_long = __X32_SYSCALL_BIT + 8; ++pub const SYS_mmap: c_long = __X32_SYSCALL_BIT + 9; ++pub const SYS_mprotect: c_long = __X32_SYSCALL_BIT + 10; ++pub const SYS_munmap: c_long = __X32_SYSCALL_BIT + 11; ++pub const SYS_brk: c_long = __X32_SYSCALL_BIT + 12; ++pub const SYS_rt_sigprocmask: c_long = __X32_SYSCALL_BIT + 14; ++pub const SYS_pread64: c_long = __X32_SYSCALL_BIT + 17; ++pub const SYS_pwrite64: c_long = __X32_SYSCALL_BIT + 18; ++pub const SYS_access: c_long = __X32_SYSCALL_BIT + 21; ++pub const SYS_pipe: c_long = __X32_SYSCALL_BIT + 22; ++pub const SYS_select: c_long = __X32_SYSCALL_BIT + 23; ++pub const SYS_sched_yield: c_long = __X32_SYSCALL_BIT + 24; ++pub const SYS_mremap: c_long = __X32_SYSCALL_BIT + 25; ++pub const SYS_msync: c_long = __X32_SYSCALL_BIT + 26; ++pub const SYS_mincore: c_long = __X32_SYSCALL_BIT + 27; ++pub const SYS_madvise: c_long = __X32_SYSCALL_BIT + 28; ++pub const SYS_shmget: c_long = __X32_SYSCALL_BIT + 29; ++pub const SYS_shmat: c_long = __X32_SYSCALL_BIT + 30; ++pub const SYS_shmctl: c_long = __X32_SYSCALL_BIT + 31; ++pub const SYS_dup: c_long = __X32_SYSCALL_BIT + 32; ++pub const SYS_dup2: c_long = __X32_SYSCALL_BIT + 33; ++pub const SYS_pause: c_long = __X32_SYSCALL_BIT + 34; ++pub const SYS_nanosleep: c_long = __X32_SYSCALL_BIT + 35; ++pub const SYS_getitimer: c_long = __X32_SYSCALL_BIT + 36; ++pub const SYS_alarm: c_long = __X32_SYSCALL_BIT + 37; ++pub const SYS_setitimer: c_long = __X32_SYSCALL_BIT + 38; ++pub const SYS_getpid: c_long = __X32_SYSCALL_BIT + 39; ++pub const SYS_sendfile: c_long = __X32_SYSCALL_BIT + 40; ++pub const SYS_socket: c_long = __X32_SYSCALL_BIT + 41; ++pub const SYS_connect: c_long = __X32_SYSCALL_BIT + 42; ++pub const SYS_accept: c_long = __X32_SYSCALL_BIT + 43; ++pub const SYS_sendto: c_long = __X32_SYSCALL_BIT + 44; ++pub const SYS_shutdown: c_long = __X32_SYSCALL_BIT + 48; ++pub const SYS_bind: c_long = __X32_SYSCALL_BIT + 49; ++pub const SYS_listen: c_long = __X32_SYSCALL_BIT + 50; ++pub const SYS_getsockname: c_long = __X32_SYSCALL_BIT + 51; ++pub const SYS_getpeername: c_long = __X32_SYSCALL_BIT + 52; ++pub const SYS_socketpair: c_long = __X32_SYSCALL_BIT + 53; ++pub const SYS_clone: c_long = __X32_SYSCALL_BIT + 56; ++pub const SYS_fork: c_long = __X32_SYSCALL_BIT + 57; ++pub const SYS_vfork: c_long = __X32_SYSCALL_BIT + 58; ++pub const SYS_exit: c_long = __X32_SYSCALL_BIT + 60; ++pub const SYS_wait4: c_long = __X32_SYSCALL_BIT + 61; ++pub const SYS_kill: c_long = __X32_SYSCALL_BIT + 62; ++pub const SYS_uname: c_long = __X32_SYSCALL_BIT + 63; ++pub const SYS_semget: c_long = __X32_SYSCALL_BIT + 64; ++pub const SYS_semop: c_long = __X32_SYSCALL_BIT + 65; ++pub const SYS_semctl: c_long = __X32_SYSCALL_BIT + 66; ++pub const SYS_shmdt: c_long = __X32_SYSCALL_BIT + 67; ++pub const SYS_msgget: c_long = __X32_SYSCALL_BIT + 68; ++pub const SYS_msgsnd: c_long = __X32_SYSCALL_BIT + 69; ++pub const SYS_msgrcv: c_long = __X32_SYSCALL_BIT + 70; ++pub const SYS_msgctl: c_long = __X32_SYSCALL_BIT + 71; ++pub const SYS_fcntl: c_long = __X32_SYSCALL_BIT + 72; ++pub const SYS_flock: c_long = __X32_SYSCALL_BIT + 73; ++pub const SYS_fsync: c_long = __X32_SYSCALL_BIT + 74; ++pub const SYS_fdatasync: c_long = __X32_SYSCALL_BIT + 75; ++pub const SYS_truncate: c_long = __X32_SYSCALL_BIT + 76; ++pub const SYS_ftruncate: c_long = __X32_SYSCALL_BIT + 77; ++pub const SYS_getdents: c_long = __X32_SYSCALL_BIT + 78; ++pub const SYS_getcwd: c_long = __X32_SYSCALL_BIT + 79; ++pub const SYS_chdir: c_long = __X32_SYSCALL_BIT + 80; ++pub const SYS_fchdir: c_long = __X32_SYSCALL_BIT + 81; ++pub const SYS_rename: c_long = __X32_SYSCALL_BIT + 82; ++pub const SYS_mkdir: c_long = __X32_SYSCALL_BIT + 83; ++pub const SYS_rmdir: c_long = __X32_SYSCALL_BIT + 84; ++pub const SYS_creat: c_long = __X32_SYSCALL_BIT + 85; ++pub const SYS_link: c_long = __X32_SYSCALL_BIT + 86; ++pub const SYS_unlink: c_long = __X32_SYSCALL_BIT + 87; ++pub const SYS_symlink: c_long = __X32_SYSCALL_BIT + 88; ++pub const SYS_readlink: c_long = __X32_SYSCALL_BIT + 89; ++pub const SYS_chmod: c_long = __X32_SYSCALL_BIT + 90; ++pub const SYS_fchmod: c_long = __X32_SYSCALL_BIT + 91; ++pub const SYS_chown: c_long = __X32_SYSCALL_BIT + 92; ++pub const SYS_fchown: c_long = __X32_SYSCALL_BIT + 93; ++pub const SYS_lchown: c_long = __X32_SYSCALL_BIT + 94; ++pub const SYS_umask: c_long = __X32_SYSCALL_BIT + 95; ++pub const SYS_gettimeofday: c_long = __X32_SYSCALL_BIT + 96; ++pub const SYS_getrlimit: c_long = __X32_SYSCALL_BIT + 97; ++pub const SYS_getrusage: c_long = __X32_SYSCALL_BIT + 98; ++pub const SYS_sysinfo: c_long = __X32_SYSCALL_BIT + 99; ++pub const SYS_times: c_long = __X32_SYSCALL_BIT + 100; ++pub const SYS_getuid: c_long = __X32_SYSCALL_BIT + 102; ++pub const SYS_syslog: c_long = __X32_SYSCALL_BIT + 103; ++pub const SYS_getgid: c_long = __X32_SYSCALL_BIT + 104; ++pub const SYS_setuid: c_long = __X32_SYSCALL_BIT + 105; ++pub const SYS_setgid: c_long = __X32_SYSCALL_BIT + 106; ++pub const SYS_geteuid: c_long = __X32_SYSCALL_BIT + 107; ++pub const SYS_getegid: c_long = __X32_SYSCALL_BIT + 108; ++pub const SYS_setpgid: c_long = __X32_SYSCALL_BIT + 109; ++pub const SYS_getppid: c_long = __X32_SYSCALL_BIT + 110; ++pub const SYS_getpgrp: c_long = __X32_SYSCALL_BIT + 111; ++pub const SYS_setsid: c_long = __X32_SYSCALL_BIT + 112; ++pub const SYS_setreuid: c_long = __X32_SYSCALL_BIT + 113; ++pub const SYS_setregid: c_long = __X32_SYSCALL_BIT + 114; ++pub const SYS_getgroups: c_long = __X32_SYSCALL_BIT + 115; ++pub const SYS_setgroups: c_long = __X32_SYSCALL_BIT + 116; ++pub const SYS_setresuid: c_long = __X32_SYSCALL_BIT + 117; ++pub const SYS_getresuid: c_long = __X32_SYSCALL_BIT + 118; ++pub const SYS_setresgid: c_long = __X32_SYSCALL_BIT + 119; ++pub const SYS_getresgid: c_long = __X32_SYSCALL_BIT + 120; ++pub const SYS_getpgid: c_long = __X32_SYSCALL_BIT + 121; ++pub const SYS_setfsuid: c_long = __X32_SYSCALL_BIT + 122; ++pub const SYS_setfsgid: c_long = __X32_SYSCALL_BIT + 123; ++pub const SYS_getsid: c_long = __X32_SYSCALL_BIT + 124; ++pub const SYS_capget: c_long = __X32_SYSCALL_BIT + 125; ++pub const SYS_capset: c_long = __X32_SYSCALL_BIT + 126; ++pub const SYS_rt_sigsuspend: c_long = __X32_SYSCALL_BIT + 130; ++pub const SYS_utime: c_long = __X32_SYSCALL_BIT + 132; ++pub const SYS_mknod: c_long = __X32_SYSCALL_BIT + 133; ++pub const SYS_personality: c_long = __X32_SYSCALL_BIT + 135; ++pub const SYS_ustat: c_long = __X32_SYSCALL_BIT + 136; ++pub const SYS_statfs: c_long = __X32_SYSCALL_BIT + 137; ++pub const SYS_fstatfs: c_long = __X32_SYSCALL_BIT + 138; ++pub const SYS_sysfs: c_long = __X32_SYSCALL_BIT + 139; ++pub const SYS_getpriority: c_long = __X32_SYSCALL_BIT + 140; ++pub const SYS_setpriority: c_long = __X32_SYSCALL_BIT + 141; ++pub const SYS_sched_setparam: c_long = __X32_SYSCALL_BIT + 142; ++pub const SYS_sched_getparam: c_long = __X32_SYSCALL_BIT + 143; ++pub const SYS_sched_setscheduler: c_long = __X32_SYSCALL_BIT + 144; ++pub const SYS_sched_getscheduler: c_long = __X32_SYSCALL_BIT + 145; ++pub const SYS_sched_get_priority_max: c_long = __X32_SYSCALL_BIT + 146; ++pub const SYS_sched_get_priority_min: c_long = __X32_SYSCALL_BIT + 147; ++pub const SYS_sched_rr_get_interval: c_long = __X32_SYSCALL_BIT + 148; ++pub const SYS_mlock: c_long = __X32_SYSCALL_BIT + 149; ++pub const SYS_munlock: c_long = __X32_SYSCALL_BIT + 150; ++pub const SYS_mlockall: c_long = __X32_SYSCALL_BIT + 151; ++pub const SYS_munlockall: c_long = __X32_SYSCALL_BIT + 152; ++pub const SYS_vhangup: c_long = __X32_SYSCALL_BIT + 153; ++pub const SYS_modify_ldt: c_long = __X32_SYSCALL_BIT + 154; ++pub const SYS_pivot_root: c_long = __X32_SYSCALL_BIT + 155; ++pub const SYS_prctl: c_long = __X32_SYSCALL_BIT + 157; ++pub const SYS_arch_prctl: c_long = __X32_SYSCALL_BIT + 158; ++pub const SYS_adjtimex: c_long = __X32_SYSCALL_BIT + 159; ++pub const SYS_setrlimit: c_long = __X32_SYSCALL_BIT + 160; ++pub const SYS_chroot: c_long = __X32_SYSCALL_BIT + 161; ++pub const SYS_sync: c_long = __X32_SYSCALL_BIT + 162; ++pub const SYS_acct: c_long = __X32_SYSCALL_BIT + 163; ++pub const SYS_settimeofday: c_long = __X32_SYSCALL_BIT + 164; ++pub const SYS_mount: c_long = __X32_SYSCALL_BIT + 165; ++pub const SYS_umount2: c_long = __X32_SYSCALL_BIT + 166; ++pub const SYS_swapon: c_long = __X32_SYSCALL_BIT + 167; ++pub const SYS_swapoff: c_long = __X32_SYSCALL_BIT + 168; ++pub const SYS_reboot: c_long = __X32_SYSCALL_BIT + 169; ++pub const SYS_sethostname: c_long = __X32_SYSCALL_BIT + 170; ++pub const SYS_setdomainname: c_long = __X32_SYSCALL_BIT + 171; ++pub const SYS_iopl: c_long = __X32_SYSCALL_BIT + 172; ++pub const SYS_ioperm: c_long = __X32_SYSCALL_BIT + 173; ++pub const SYS_init_module: c_long = __X32_SYSCALL_BIT + 175; ++pub const SYS_delete_module: c_long = __X32_SYSCALL_BIT + 176; ++pub const SYS_quotactl: c_long = __X32_SYSCALL_BIT + 179; ++pub const SYS_getpmsg: c_long = __X32_SYSCALL_BIT + 181; ++pub const SYS_putpmsg: c_long = __X32_SYSCALL_BIT + 182; ++pub const SYS_afs_syscall: c_long = __X32_SYSCALL_BIT + 183; ++pub const SYS_tuxcall: c_long = __X32_SYSCALL_BIT + 184; ++pub const SYS_security: c_long = __X32_SYSCALL_BIT + 185; ++pub const SYS_gettid: c_long = __X32_SYSCALL_BIT + 186; ++pub const SYS_readahead: c_long = __X32_SYSCALL_BIT + 187; ++pub const SYS_setxattr: c_long = __X32_SYSCALL_BIT + 188; ++pub const SYS_lsetxattr: c_long = __X32_SYSCALL_BIT + 189; ++pub const SYS_fsetxattr: c_long = __X32_SYSCALL_BIT + 190; ++pub const SYS_getxattr: c_long = __X32_SYSCALL_BIT + 191; ++pub const SYS_lgetxattr: c_long = __X32_SYSCALL_BIT + 192; ++pub const SYS_fgetxattr: c_long = __X32_SYSCALL_BIT + 193; ++pub const SYS_listxattr: c_long = __X32_SYSCALL_BIT + 194; ++pub const SYS_llistxattr: c_long = __X32_SYSCALL_BIT + 195; ++pub const SYS_flistxattr: c_long = __X32_SYSCALL_BIT + 196; ++pub const SYS_removexattr: c_long = __X32_SYSCALL_BIT + 197; ++pub const SYS_lremovexattr: c_long = __X32_SYSCALL_BIT + 198; ++pub const SYS_fremovexattr: c_long = __X32_SYSCALL_BIT + 199; ++pub const SYS_tkill: c_long = __X32_SYSCALL_BIT + 200; ++pub const SYS_time: c_long = __X32_SYSCALL_BIT + 201; ++pub const SYS_futex: c_long = __X32_SYSCALL_BIT + 202; ++pub const SYS_sched_setaffinity: c_long = __X32_SYSCALL_BIT + 203; ++pub const SYS_sched_getaffinity: c_long = __X32_SYSCALL_BIT + 204; ++pub const SYS_io_destroy: c_long = __X32_SYSCALL_BIT + 207; ++pub const SYS_io_getevents: c_long = __X32_SYSCALL_BIT + 208; ++pub const SYS_io_cancel: c_long = __X32_SYSCALL_BIT + 210; ++pub const SYS_lookup_dcookie: c_long = __X32_SYSCALL_BIT + 212; ++pub const SYS_epoll_create: c_long = __X32_SYSCALL_BIT + 213; ++pub const SYS_remap_file_pages: c_long = __X32_SYSCALL_BIT + 216; ++pub const SYS_getdents64: c_long = __X32_SYSCALL_BIT + 217; ++pub const SYS_set_tid_address: c_long = __X32_SYSCALL_BIT + 218; ++pub const SYS_restart_syscall: c_long = __X32_SYSCALL_BIT + 219; ++pub const SYS_semtimedop: c_long = __X32_SYSCALL_BIT + 220; ++pub const SYS_fadvise64: c_long = __X32_SYSCALL_BIT + 221; ++pub const SYS_timer_settime: c_long = __X32_SYSCALL_BIT + 223; ++pub const SYS_timer_gettime: c_long = __X32_SYSCALL_BIT + 224; ++pub const SYS_timer_getoverrun: c_long = __X32_SYSCALL_BIT + 225; ++pub const SYS_timer_delete: c_long = __X32_SYSCALL_BIT + 226; ++pub const SYS_clock_settime: c_long = __X32_SYSCALL_BIT + 227; ++pub const SYS_clock_gettime: c_long = __X32_SYSCALL_BIT + 228; ++pub const SYS_clock_getres: c_long = __X32_SYSCALL_BIT + 229; ++pub const SYS_clock_nanosleep: c_long = __X32_SYSCALL_BIT + 230; ++pub const SYS_exit_group: c_long = __X32_SYSCALL_BIT + 231; ++pub const SYS_epoll_wait: c_long = __X32_SYSCALL_BIT + 232; ++pub const SYS_epoll_ctl: c_long = __X32_SYSCALL_BIT + 233; ++pub const SYS_tgkill: c_long = __X32_SYSCALL_BIT + 234; ++pub const SYS_utimes: c_long = __X32_SYSCALL_BIT + 235; ++pub const SYS_mbind: c_long = __X32_SYSCALL_BIT + 237; ++pub const SYS_set_mempolicy: c_long = __X32_SYSCALL_BIT + 238; ++pub const SYS_get_mempolicy: c_long = __X32_SYSCALL_BIT + 239; ++pub const SYS_mq_open: c_long = __X32_SYSCALL_BIT + 240; ++pub const SYS_mq_unlink: c_long = __X32_SYSCALL_BIT + 241; ++pub const SYS_mq_timedsend: c_long = __X32_SYSCALL_BIT + 242; ++pub const SYS_mq_timedreceive: c_long = __X32_SYSCALL_BIT + 243; ++pub const SYS_mq_getsetattr: c_long = __X32_SYSCALL_BIT + 245; ++pub const SYS_add_key: c_long = __X32_SYSCALL_BIT + 248; ++pub const SYS_request_key: c_long = __X32_SYSCALL_BIT + 249; ++pub const SYS_keyctl: c_long = __X32_SYSCALL_BIT + 250; ++pub const SYS_ioprio_set: c_long = __X32_SYSCALL_BIT + 251; ++pub const SYS_ioprio_get: c_long = __X32_SYSCALL_BIT + 252; ++pub const SYS_inotify_init: c_long = __X32_SYSCALL_BIT + 253; ++pub const SYS_inotify_add_watch: c_long = __X32_SYSCALL_BIT + 254; ++pub const SYS_inotify_rm_watch: c_long = __X32_SYSCALL_BIT + 255; ++pub const SYS_migrate_pages: c_long = __X32_SYSCALL_BIT + 256; ++pub const SYS_openat: c_long = __X32_SYSCALL_BIT + 257; ++pub const SYS_mkdirat: c_long = __X32_SYSCALL_BIT + 258; ++pub const SYS_mknodat: c_long = __X32_SYSCALL_BIT + 259; ++pub const SYS_fchownat: c_long = __X32_SYSCALL_BIT + 260; ++pub const SYS_futimesat: c_long = __X32_SYSCALL_BIT + 261; ++pub const SYS_newfstatat: c_long = __X32_SYSCALL_BIT + 262; ++pub const SYS_unlinkat: c_long = __X32_SYSCALL_BIT + 263; ++pub const SYS_renameat: c_long = __X32_SYSCALL_BIT + 264; ++pub const SYS_linkat: c_long = __X32_SYSCALL_BIT + 265; ++pub const SYS_symlinkat: c_long = __X32_SYSCALL_BIT + 266; ++pub const SYS_readlinkat: c_long = __X32_SYSCALL_BIT + 267; ++pub const SYS_fchmodat: c_long = __X32_SYSCALL_BIT + 268; ++pub const SYS_faccessat: c_long = __X32_SYSCALL_BIT + 269; ++pub const SYS_pselect6: c_long = __X32_SYSCALL_BIT + 270; ++pub const SYS_ppoll: c_long = __X32_SYSCALL_BIT + 271; ++pub const SYS_unshare: c_long = __X32_SYSCALL_BIT + 272; ++pub const SYS_splice: c_long = __X32_SYSCALL_BIT + 275; ++pub const SYS_tee: c_long = __X32_SYSCALL_BIT + 276; ++pub const SYS_sync_file_range: c_long = __X32_SYSCALL_BIT + 277; ++pub const SYS_utimensat: c_long = __X32_SYSCALL_BIT + 280; ++pub const SYS_epoll_pwait: c_long = __X32_SYSCALL_BIT + 281; ++pub const SYS_signalfd: c_long = __X32_SYSCALL_BIT + 282; ++pub const SYS_timerfd_create: c_long = __X32_SYSCALL_BIT + 283; ++pub const SYS_eventfd: c_long = __X32_SYSCALL_BIT + 284; ++pub const SYS_fallocate: c_long = __X32_SYSCALL_BIT + 285; ++pub const SYS_timerfd_settime: c_long = __X32_SYSCALL_BIT + 286; ++pub const SYS_timerfd_gettime: c_long = __X32_SYSCALL_BIT + 287; ++pub const SYS_accept4: c_long = __X32_SYSCALL_BIT + 288; ++pub const SYS_signalfd4: c_long = __X32_SYSCALL_BIT + 289; ++pub const SYS_eventfd2: c_long = __X32_SYSCALL_BIT + 290; ++pub const SYS_epoll_create1: c_long = __X32_SYSCALL_BIT + 291; ++pub const SYS_dup3: c_long = __X32_SYSCALL_BIT + 292; ++pub const SYS_pipe2: c_long = __X32_SYSCALL_BIT + 293; ++pub const SYS_inotify_init1: c_long = __X32_SYSCALL_BIT + 294; ++pub const SYS_perf_event_open: c_long = __X32_SYSCALL_BIT + 298; ++pub const SYS_fanotify_init: c_long = __X32_SYSCALL_BIT + 300; ++pub const SYS_fanotify_mark: c_long = __X32_SYSCALL_BIT + 301; ++pub const SYS_prlimit64: c_long = __X32_SYSCALL_BIT + 302; ++pub const SYS_name_to_handle_at: c_long = __X32_SYSCALL_BIT + 303; ++pub const SYS_open_by_handle_at: c_long = __X32_SYSCALL_BIT + 304; ++pub const SYS_clock_adjtime: c_long = __X32_SYSCALL_BIT + 305; ++pub const SYS_syncfs: c_long = __X32_SYSCALL_BIT + 306; ++pub const SYS_setns: c_long = __X32_SYSCALL_BIT + 308; ++pub const SYS_getcpu: c_long = __X32_SYSCALL_BIT + 309; ++pub const SYS_kcmp: c_long = __X32_SYSCALL_BIT + 312; ++pub const SYS_finit_module: c_long = __X32_SYSCALL_BIT + 313; ++pub const SYS_sched_setattr: c_long = __X32_SYSCALL_BIT + 314; ++pub const SYS_sched_getattr: c_long = __X32_SYSCALL_BIT + 315; ++pub const SYS_renameat2: c_long = __X32_SYSCALL_BIT + 316; ++pub const SYS_seccomp: c_long = __X32_SYSCALL_BIT + 317; ++pub const SYS_getrandom: c_long = __X32_SYSCALL_BIT + 318; ++pub const SYS_memfd_create: c_long = __X32_SYSCALL_BIT + 319; ++pub const SYS_kexec_file_load: c_long = __X32_SYSCALL_BIT + 320; ++pub const SYS_bpf: c_long = __X32_SYSCALL_BIT + 321; ++pub const SYS_userfaultfd: c_long = __X32_SYSCALL_BIT + 323; ++pub const SYS_membarrier: c_long = __X32_SYSCALL_BIT + 324; ++pub const SYS_mlock2: c_long = __X32_SYSCALL_BIT + 325; ++pub const SYS_copy_file_range: c_long = __X32_SYSCALL_BIT + 326; ++pub const SYS_pkey_mprotect: c_long = __X32_SYSCALL_BIT + 329; ++pub const SYS_pkey_alloc: c_long = __X32_SYSCALL_BIT + 330; ++pub const SYS_pkey_free: c_long = __X32_SYSCALL_BIT + 331; ++pub const SYS_statx: c_long = __X32_SYSCALL_BIT + 332; ++pub const SYS_rseq: c_long = __X32_SYSCALL_BIT + 334; ++pub const SYS_pidfd_send_signal: c_long = __X32_SYSCALL_BIT + 424; ++pub const SYS_io_uring_setup: c_long = __X32_SYSCALL_BIT + 425; ++pub const SYS_io_uring_enter: c_long = __X32_SYSCALL_BIT + 426; ++pub const SYS_io_uring_register: c_long = __X32_SYSCALL_BIT + 427; ++pub const SYS_open_tree: c_long = __X32_SYSCALL_BIT + 428; ++pub const SYS_move_mount: c_long = __X32_SYSCALL_BIT + 429; ++pub const SYS_fsopen: c_long = __X32_SYSCALL_BIT + 430; ++pub const SYS_fsconfig: c_long = __X32_SYSCALL_BIT + 431; ++pub const SYS_fsmount: c_long = __X32_SYSCALL_BIT + 432; ++pub const SYS_fspick: c_long = __X32_SYSCALL_BIT + 433; ++pub const SYS_pidfd_open: c_long = __X32_SYSCALL_BIT + 434; ++pub const SYS_clone3: c_long = __X32_SYSCALL_BIT + 435; ++pub const SYS_close_range: c_long = __X32_SYSCALL_BIT + 436; ++pub const SYS_openat2: c_long = __X32_SYSCALL_BIT + 437; ++pub const SYS_pidfd_getfd: c_long = __X32_SYSCALL_BIT + 438; ++pub const SYS_faccessat2: c_long = __X32_SYSCALL_BIT + 439; ++pub const SYS_process_madvise: c_long = __X32_SYSCALL_BIT + 440; ++pub const SYS_epoll_pwait2: c_long = __X32_SYSCALL_BIT + 441; ++pub const SYS_mount_setattr: c_long = __X32_SYSCALL_BIT + 442; ++pub const SYS_quotactl_fd: c_long = __X32_SYSCALL_BIT + 443; ++pub const SYS_landlock_create_ruleset: c_long = __X32_SYSCALL_BIT + 444; ++pub const SYS_landlock_add_rule: c_long = __X32_SYSCALL_BIT + 445; ++pub const SYS_landlock_restrict_self: c_long = __X32_SYSCALL_BIT + 446; ++pub const SYS_memfd_secret: c_long = __X32_SYSCALL_BIT + 447; ++pub const SYS_process_mrelease: c_long = __X32_SYSCALL_BIT + 448; ++pub const SYS_futex_waitv: c_long = __X32_SYSCALL_BIT + 449; ++pub const SYS_set_mempolicy_home_node: c_long = __X32_SYSCALL_BIT + 450; ++pub const SYS_fchmodat2: c_long = __X32_SYSCALL_BIT + 452; ++pub const SYS_rt_sigaction: c_long = __X32_SYSCALL_BIT + 512; ++pub const SYS_rt_sigreturn: c_long = __X32_SYSCALL_BIT + 513; ++pub const SYS_ioctl: c_long = __X32_SYSCALL_BIT + 514; ++pub const SYS_readv: c_long = __X32_SYSCALL_BIT + 515; ++pub const SYS_writev: c_long = __X32_SYSCALL_BIT + 516; ++pub const SYS_recvfrom: c_long = __X32_SYSCALL_BIT + 517; ++pub const SYS_sendmsg: c_long = __X32_SYSCALL_BIT + 518; ++pub const SYS_recvmsg: c_long = __X32_SYSCALL_BIT + 519; ++pub const SYS_execve: c_long = __X32_SYSCALL_BIT + 520; ++pub const SYS_ptrace: c_long = __X32_SYSCALL_BIT + 521; ++pub const SYS_rt_sigpending: c_long = __X32_SYSCALL_BIT + 522; ++pub const SYS_rt_sigtimedwait: c_long = __X32_SYSCALL_BIT + 523; ++pub const SYS_rt_sigqueueinfo: c_long = __X32_SYSCALL_BIT + 524; ++pub const SYS_sigaltstack: c_long = __X32_SYSCALL_BIT + 525; ++pub const SYS_timer_create: c_long = __X32_SYSCALL_BIT + 526; ++pub const SYS_mq_notify: c_long = __X32_SYSCALL_BIT + 527; ++pub const SYS_kexec_load: c_long = __X32_SYSCALL_BIT + 528; ++pub const SYS_waitid: c_long = __X32_SYSCALL_BIT + 529; ++pub const SYS_set_robust_list: c_long = __X32_SYSCALL_BIT + 530; ++pub const SYS_get_robust_list: c_long = __X32_SYSCALL_BIT + 531; ++pub const SYS_vmsplice: c_long = __X32_SYSCALL_BIT + 532; ++pub const SYS_move_pages: c_long = __X32_SYSCALL_BIT + 533; ++pub const SYS_preadv: c_long = __X32_SYSCALL_BIT + 534; ++pub const SYS_pwritev: c_long = __X32_SYSCALL_BIT + 535; ++pub const SYS_rt_tgsigqueueinfo: c_long = __X32_SYSCALL_BIT + 536; ++pub const SYS_recvmmsg: c_long = __X32_SYSCALL_BIT + 537; ++pub const SYS_sendmmsg: c_long = __X32_SYSCALL_BIT + 538; ++pub const SYS_process_vm_readv: c_long = __X32_SYSCALL_BIT + 539; ++pub const SYS_process_vm_writev: c_long = __X32_SYSCALL_BIT + 540; ++pub const SYS_setsockopt: c_long = __X32_SYSCALL_BIT + 541; ++pub const SYS_getsockopt: c_long = __X32_SYSCALL_BIT + 542; ++pub const SYS_io_setup: c_long = __X32_SYSCALL_BIT + 543; ++pub const SYS_io_submit: c_long = __X32_SYSCALL_BIT + 544; ++pub const SYS_execveat: c_long = __X32_SYSCALL_BIT + 545; ++pub const SYS_preadv2: c_long = __X32_SYSCALL_BIT + 546; ++pub const SYS_pwritev2: c_long = __X32_SYSCALL_BIT + 547; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/gnu/mod.rs 2024-12-28 15:35:00.000000000 -0500 +@@ -0,0 +1,1509 @@ ++use crate::off64_t; ++use crate::prelude::*; ++ ++pub type pthread_t = c_ulong; ++pub type __priority_which_t = c_uint; ++pub type __rlimit_resource_t = c_uint; ++pub type Lmid_t = c_long; ++pub type regoff_t = c_int; ++pub type __kernel_rwf_t = c_int; ++ ++cfg_if! { ++ if #[cfg(doc)] { ++ // Used in `linux::arch` to define ioctl constants. ++ pub(crate) type Ioctl = c_ulong; ++ } else { ++ #[doc(hidden)] ++ pub type Ioctl = c_ulong; ++ } ++} ++ ++s! { ++ pub struct aiocb { ++ pub aio_fildes: c_int, ++ pub aio_lio_opcode: c_int, ++ pub aio_reqprio: c_int, ++ pub aio_buf: *mut c_void, ++ pub aio_nbytes: size_t, ++ pub aio_sigevent: crate::sigevent, ++ __next_prio: *mut aiocb, ++ __abs_prio: c_int, ++ __policy: c_int, ++ __error_code: c_int, ++ __return_value: ssize_t, ++ pub aio_offset: off_t, ++ #[cfg(all(not(gnu_time64_abi), not(target_arch = "x86_64"), target_pointer_width = "32"))] ++ __unused1: [c_char; 4], ++ __glibc_reserved: [c_char; 32], ++ } ++ ++ pub struct __exit_status { ++ pub e_termination: c_short, ++ pub e_exit: c_short, ++ } ++ ++ pub struct __timeval { ++ pub tv_sec: i32, ++ pub tv_usec: i32, ++ } ++ ++ pub struct glob64_t { ++ pub gl_pathc: size_t, ++ pub gl_pathv: *mut *mut c_char, ++ pub gl_offs: size_t, ++ pub gl_flags: c_int, ++ ++ __unused1: *mut c_void, ++ __unused2: *mut c_void, ++ __unused3: *mut c_void, ++ __unused4: *mut c_void, ++ __unused5: *mut c_void, ++ } ++ ++ pub struct msghdr { ++ pub msg_name: *mut c_void, ++ pub msg_namelen: crate::socklen_t, ++ pub msg_iov: *mut crate::iovec, ++ pub msg_iovlen: size_t, ++ pub msg_control: *mut c_void, ++ pub msg_controllen: size_t, ++ pub msg_flags: c_int, ++ } ++ ++ pub struct cmsghdr { ++ pub cmsg_len: size_t, ++ pub cmsg_level: c_int, ++ pub cmsg_type: c_int, ++ } ++ ++ pub struct termios { ++ pub c_iflag: crate::tcflag_t, ++ pub c_oflag: crate::tcflag_t, ++ pub c_cflag: crate::tcflag_t, ++ pub c_lflag: crate::tcflag_t, ++ pub c_line: crate::cc_t, ++ pub c_cc: [crate::cc_t; crate::NCCS], ++ #[cfg(not(any( ++ target_arch = "sparc", ++ target_arch = "sparc64", ++ target_arch = "mips", ++ target_arch = "mips32r6", ++ target_arch = "mips64", ++ target_arch = "mips64r6" ++ )))] ++ pub c_ispeed: crate::speed_t, ++ #[cfg(not(any( ++ target_arch = "sparc", ++ target_arch = "sparc64", ++ target_arch = "mips", ++ target_arch = "mips32r6", ++ target_arch = "mips64", ++ target_arch = "mips64r6" ++ )))] ++ pub c_ospeed: crate::speed_t, ++ } ++ ++ pub struct mallinfo { ++ pub arena: c_int, ++ pub ordblks: c_int, ++ pub smblks: c_int, ++ pub hblks: c_int, ++ pub hblkhd: c_int, ++ pub usmblks: c_int, ++ pub fsmblks: c_int, ++ pub uordblks: c_int, ++ pub fordblks: c_int, ++ pub keepcost: c_int, ++ } ++ ++ pub struct mallinfo2 { ++ pub arena: size_t, ++ pub ordblks: size_t, ++ pub smblks: size_t, ++ pub hblks: size_t, ++ pub hblkhd: size_t, ++ pub usmblks: size_t, ++ pub fsmblks: size_t, ++ pub uordblks: size_t, ++ pub fordblks: size_t, ++ pub keepcost: size_t, ++ } ++ ++ pub struct nl_pktinfo { ++ pub group: u32, ++ } ++ ++ pub struct nl_mmap_req { ++ pub nm_block_size: c_uint, ++ pub nm_block_nr: c_uint, ++ pub nm_frame_size: c_uint, ++ pub nm_frame_nr: c_uint, ++ } ++ ++ pub struct nl_mmap_hdr { ++ pub nm_status: c_uint, ++ pub nm_len: c_uint, ++ pub nm_group: u32, ++ pub nm_pid: u32, ++ pub nm_uid: u32, ++ pub nm_gid: u32, ++ } ++ ++ pub struct rtentry { ++ pub rt_pad1: c_ulong, ++ pub rt_dst: crate::sockaddr, ++ pub rt_gateway: crate::sockaddr, ++ pub rt_genmask: crate::sockaddr, ++ pub rt_flags: c_ushort, ++ pub rt_pad2: c_short, ++ pub rt_pad3: c_ulong, ++ pub rt_tos: c_uchar, ++ pub rt_class: c_uchar, ++ #[cfg(target_pointer_width = "64")] ++ pub rt_pad4: [c_short; 3usize], ++ #[cfg(not(target_pointer_width = "64"))] ++ pub rt_pad4: c_short, ++ pub rt_metric: c_short, ++ pub rt_dev: *mut c_char, ++ pub rt_mtu: c_ulong, ++ pub rt_window: c_ulong, ++ pub rt_irtt: c_ushort, ++ } ++ ++ pub struct ntptimeval { ++ pub time: crate::timeval, ++ pub maxerror: c_long, ++ pub esterror: c_long, ++ pub tai: c_long, ++ pub __glibc_reserved1: c_long, ++ pub __glibc_reserved2: c_long, ++ pub __glibc_reserved3: c_long, ++ pub __glibc_reserved4: c_long, ++ } ++ ++ pub struct regex_t { ++ __buffer: *mut c_void, ++ __allocated: size_t, ++ __used: size_t, ++ __syntax: c_ulong, ++ __fastmap: *mut c_char, ++ __translate: *mut c_char, ++ __re_nsub: size_t, ++ __bitfield: u8, ++ } ++ ++ pub struct Elf64_Chdr { ++ pub ch_type: crate::Elf64_Word, ++ pub ch_reserved: crate::Elf64_Word, ++ pub ch_size: crate::Elf64_Xword, ++ pub ch_addralign: crate::Elf64_Xword, ++ } ++ ++ pub struct Elf32_Chdr { ++ pub ch_type: crate::Elf32_Word, ++ pub ch_size: crate::Elf32_Word, ++ pub ch_addralign: crate::Elf32_Word, ++ } ++ ++ pub struct seminfo { ++ pub semmap: c_int, ++ pub semmni: c_int, ++ pub semmns: c_int, ++ pub semmnu: c_int, ++ pub semmsl: c_int, ++ pub semopm: c_int, ++ pub semume: c_int, ++ pub semusz: c_int, ++ pub semvmx: c_int, ++ pub semaem: c_int, ++ } ++ ++ pub struct ptrace_peeksiginfo_args { ++ pub off: crate::__u64, ++ pub flags: crate::__u32, ++ pub nr: crate::__s32, ++ } ++ ++ pub struct __c_anonymous_ptrace_syscall_info_entry { ++ pub nr: crate::__u64, ++ pub args: [crate::__u64; 6], ++ } ++ ++ pub struct __c_anonymous_ptrace_syscall_info_exit { ++ pub sval: crate::__s64, ++ pub is_error: crate::__u8, ++ } ++ ++ pub struct __c_anonymous_ptrace_syscall_info_seccomp { ++ pub nr: crate::__u64, ++ pub args: [crate::__u64; 6], ++ pub ret_data: crate::__u32, ++ } ++ ++ pub struct ptrace_syscall_info { ++ pub op: crate::__u8, ++ pub pad: [crate::__u8; 3], ++ pub arch: crate::__u32, ++ pub instruction_pointer: crate::__u64, ++ pub stack_pointer: crate::__u64, ++ pub u: __c_anonymous_ptrace_syscall_info_data, ++ } ++ ++ // linux/if_xdp.h ++ ++ pub struct sockaddr_xdp { ++ pub sxdp_family: crate::__u16, ++ pub sxdp_flags: crate::__u16, ++ pub sxdp_ifindex: crate::__u32, ++ pub sxdp_queue_id: crate::__u32, ++ pub sxdp_shared_umem_fd: crate::__u32, ++ } ++ ++ pub struct xdp_ring_offset { ++ pub producer: crate::__u64, ++ pub consumer: crate::__u64, ++ pub desc: crate::__u64, ++ pub flags: crate::__u64, ++ } ++ ++ pub struct xdp_mmap_offsets { ++ pub rx: xdp_ring_offset, ++ pub tx: xdp_ring_offset, ++ pub fr: xdp_ring_offset, ++ pub cr: xdp_ring_offset, ++ } ++ ++ pub struct xdp_ring_offset_v1 { ++ pub producer: crate::__u64, ++ pub consumer: crate::__u64, ++ pub desc: crate::__u64, ++ } ++ ++ pub struct xdp_mmap_offsets_v1 { ++ pub rx: xdp_ring_offset_v1, ++ pub tx: xdp_ring_offset_v1, ++ pub fr: xdp_ring_offset_v1, ++ pub cr: xdp_ring_offset_v1, ++ } ++ ++ pub struct xdp_umem_reg { ++ pub addr: crate::__u64, ++ pub len: crate::__u64, ++ pub chunk_size: crate::__u32, ++ pub headroom: crate::__u32, ++ pub flags: crate::__u32, ++ pub tx_metadata_len: crate::__u32, ++ } ++ ++ pub struct xdp_umem_reg_v1 { ++ pub addr: crate::__u64, ++ pub len: crate::__u64, ++ pub chunk_size: crate::__u32, ++ pub headroom: crate::__u32, ++ } ++ ++ pub struct xdp_statistics { ++ pub rx_dropped: crate::__u64, ++ pub rx_invalid_descs: crate::__u64, ++ pub tx_invalid_descs: crate::__u64, ++ pub rx_ring_full: crate::__u64, ++ pub rx_fill_ring_empty_descs: crate::__u64, ++ pub tx_ring_empty_descs: crate::__u64, ++ } ++ ++ pub struct xdp_statistics_v1 { ++ pub rx_dropped: crate::__u64, ++ pub rx_invalid_descs: crate::__u64, ++ pub tx_invalid_descs: crate::__u64, ++ } ++ ++ pub struct xdp_options { ++ pub flags: crate::__u32, ++ } ++ ++ pub struct xdp_desc { ++ pub addr: crate::__u64, ++ pub len: crate::__u32, ++ pub options: crate::__u32, ++ } ++ ++ pub struct iocb { ++ pub aio_data: crate::__u64, ++ #[cfg(target_endian = "little")] ++ pub aio_key: crate::__u32, ++ #[cfg(target_endian = "little")] ++ pub aio_rw_flags: crate::__kernel_rwf_t, ++ #[cfg(target_endian = "big")] ++ pub aio_rw_flags: crate::__kernel_rwf_t, ++ #[cfg(target_endian = "big")] ++ pub aio_key: crate::__u32, ++ pub aio_lio_opcode: crate::__u16, ++ pub aio_reqprio: crate::__s16, ++ pub aio_fildes: crate::__u32, ++ pub aio_buf: crate::__u64, ++ pub aio_nbytes: crate::__u64, ++ pub aio_offset: crate::__s64, ++ aio_reserved2: crate::__u64, ++ pub aio_flags: crate::__u32, ++ pub aio_resfd: crate::__u32, ++ } ++ ++ // netinet/tcp.h ++ ++ pub struct tcp_info { ++ pub tcpi_state: u8, ++ pub tcpi_ca_state: u8, ++ pub tcpi_retransmits: u8, ++ pub tcpi_probes: u8, ++ pub tcpi_backoff: u8, ++ pub tcpi_options: u8, ++ /// This contains the bitfields `tcpi_snd_wscale` and `tcpi_rcv_wscale`. ++ /// Each is 4 bits. ++ pub tcpi_snd_rcv_wscale: u8, ++ pub tcpi_rto: u32, ++ pub tcpi_ato: u32, ++ pub tcpi_snd_mss: u32, ++ pub tcpi_rcv_mss: u32, ++ pub tcpi_unacked: u32, ++ pub tcpi_sacked: u32, ++ pub tcpi_lost: u32, ++ pub tcpi_retrans: u32, ++ pub tcpi_fackets: u32, ++ pub tcpi_last_data_sent: u32, ++ pub tcpi_last_ack_sent: u32, ++ pub tcpi_last_data_recv: u32, ++ pub tcpi_last_ack_recv: u32, ++ pub tcpi_pmtu: u32, ++ pub tcpi_rcv_ssthresh: u32, ++ pub tcpi_rtt: u32, ++ pub tcpi_rttvar: u32, ++ pub tcpi_snd_ssthresh: u32, ++ pub tcpi_snd_cwnd: u32, ++ pub tcpi_advmss: u32, ++ pub tcpi_reordering: u32, ++ pub tcpi_rcv_rtt: u32, ++ pub tcpi_rcv_space: u32, ++ pub tcpi_total_retrans: u32, ++ } ++ ++ pub struct fanotify_event_info_pidfd { ++ pub hdr: crate::fanotify_event_info_header, ++ pub pidfd: crate::__s32, ++ } ++ ++ pub struct fanotify_event_info_error { ++ pub hdr: crate::fanotify_event_info_header, ++ pub error: crate::__s32, ++ pub error_count: crate::__u32, ++ } ++ ++ // FIXME(1.0) this is actually a union ++ #[cfg_attr(target_pointer_width = "32", repr(align(4)))] ++ #[cfg_attr(target_pointer_width = "64", repr(align(8)))] ++ pub struct sem_t { ++ #[cfg(target_pointer_width = "32")] ++ __size: [c_char; 16], ++ #[cfg(target_pointer_width = "64")] ++ __size: [c_char; 32], ++ } ++} ++ ++impl siginfo_t { ++ pub unsafe fn si_addr(&self) -> *mut c_void { ++ #[repr(C)] ++ struct siginfo_sigfault { ++ _si_signo: c_int, ++ _si_errno: c_int, ++ _si_code: c_int, ++ si_addr: *mut c_void, ++ } ++ (*(self as *const siginfo_t as *const siginfo_sigfault)).si_addr ++ } ++ ++ pub unsafe fn si_value(&self) -> crate::sigval { ++ #[repr(C)] ++ struct siginfo_timer { ++ _si_signo: c_int, ++ _si_errno: c_int, ++ _si_code: c_int, ++ _si_tid: c_int, ++ _si_overrun: c_int, ++ si_sigval: crate::sigval, ++ } ++ (*(self as *const siginfo_t as *const siginfo_timer)).si_sigval ++ } ++} ++ ++// Internal, for casts to access union fields ++#[repr(C)] ++struct sifields_sigchld { ++ si_pid: crate::pid_t, ++ si_uid: crate::uid_t, ++ si_status: c_int, ++ si_utime: c_long, ++ si_stime: c_long, ++} ++impl Copy for sifields_sigchld {} ++impl Clone for sifields_sigchld { ++ fn clone(&self) -> sifields_sigchld { ++ *self ++ } ++} ++ ++// Internal, for casts to access union fields ++#[repr(C)] ++union sifields { ++ _align_pointer: *mut c_void, ++ sigchld: sifields_sigchld, ++} ++ ++// Internal, for casts to access union fields. Note that some variants ++// of sifields start with a pointer, which makes the alignment of ++// sifields vary on 32-bit and 64-bit architectures. ++#[repr(C)] ++struct siginfo_f { ++ _siginfo_base: [c_int; 3], ++ sifields: sifields, ++} ++ ++impl siginfo_t { ++ unsafe fn sifields(&self) -> &sifields { ++ &(*(self as *const siginfo_t as *const siginfo_f)).sifields ++ } ++ ++ pub unsafe fn si_pid(&self) -> crate::pid_t { ++ self.sifields().sigchld.si_pid ++ } ++ ++ pub unsafe fn si_uid(&self) -> crate::uid_t { ++ self.sifields().sigchld.si_uid ++ } ++ ++ pub unsafe fn si_status(&self) -> c_int { ++ self.sifields().sigchld.si_status ++ } ++ ++ pub unsafe fn si_utime(&self) -> c_long { ++ self.sifields().sigchld.si_utime ++ } ++ ++ pub unsafe fn si_stime(&self) -> c_long { ++ self.sifields().sigchld.si_stime ++ } ++} ++ ++pub union __c_anonymous_ptrace_syscall_info_data { ++ pub entry: __c_anonymous_ptrace_syscall_info_entry, ++ pub exit: __c_anonymous_ptrace_syscall_info_exit, ++ pub seccomp: __c_anonymous_ptrace_syscall_info_seccomp, ++} ++impl Copy for __c_anonymous_ptrace_syscall_info_data {} ++impl Clone for __c_anonymous_ptrace_syscall_info_data { ++ fn clone(&self) -> __c_anonymous_ptrace_syscall_info_data { ++ *self ++ } ++} ++ ++s_no_extra_traits! { ++ pub struct utmpx { ++ pub ut_type: c_short, ++ pub ut_pid: crate::pid_t, ++ pub ut_line: [c_char; __UT_LINESIZE], ++ pub ut_id: [c_char; 4], ++ ++ pub ut_user: [c_char; __UT_NAMESIZE], ++ pub ut_host: [c_char; __UT_HOSTSIZE], ++ pub ut_exit: __exit_status, ++ ++ #[cfg(any( ++ target_arch = "aarch64", ++ target_arch = "s390x", ++ target_arch = "loongarch64", ++ all(target_pointer_width = "32", not(target_arch = "x86_64")) ++ ))] ++ pub ut_session: c_long, ++ #[cfg(any( ++ target_arch = "aarch64", ++ target_arch = "s390x", ++ target_arch = "loongarch64", ++ all(target_pointer_width = "32", not(target_arch = "x86_64")) ++ ))] ++ pub ut_tv: crate::timeval, ++ ++ #[cfg(not(any( ++ target_arch = "aarch64", ++ target_arch = "s390x", ++ target_arch = "loongarch64", ++ all(target_pointer_width = "32", not(target_arch = "x86_64")) ++ )))] ++ pub ut_session: i32, ++ #[cfg(not(any( ++ target_arch = "aarch64", ++ target_arch = "s390x", ++ target_arch = "loongarch64", ++ all(target_pointer_width = "32", not(target_arch = "x86_64")) ++ )))] ++ pub ut_tv: __timeval, ++ ++ pub ut_addr_v6: [i32; 4], ++ __glibc_reserved: [c_char; 20], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for utmpx { ++ fn eq(&self, other: &utmpx) -> bool { ++ self.ut_type == other.ut_type ++ && self.ut_pid == other.ut_pid ++ && self.ut_line == other.ut_line ++ && self.ut_id == other.ut_id ++ && self.ut_user == other.ut_user ++ && self ++ .ut_host ++ .iter() ++ .zip(other.ut_host.iter()) ++ .all(|(a, b)| a == b) ++ && self.ut_exit == other.ut_exit ++ && self.ut_session == other.ut_session ++ && self.ut_tv == other.ut_tv ++ && self.ut_addr_v6 == other.ut_addr_v6 ++ && self.__glibc_reserved == other.__glibc_reserved ++ } ++ } ++ ++ impl Eq for utmpx {} ++ ++ impl fmt::Debug for utmpx { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("utmpx") ++ .field("ut_type", &self.ut_type) ++ .field("ut_pid", &self.ut_pid) ++ .field("ut_line", &self.ut_line) ++ .field("ut_id", &self.ut_id) ++ .field("ut_user", &self.ut_user) ++ // FIXME: .field("ut_host", &self.ut_host) ++ .field("ut_exit", &self.ut_exit) ++ .field("ut_session", &self.ut_session) ++ .field("ut_tv", &self.ut_tv) ++ .field("ut_addr_v6", &self.ut_addr_v6) ++ .field("__glibc_reserved", &self.__glibc_reserved) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for utmpx { ++ fn hash(&self, state: &mut H) { ++ self.ut_type.hash(state); ++ self.ut_pid.hash(state); ++ self.ut_line.hash(state); ++ self.ut_id.hash(state); ++ self.ut_user.hash(state); ++ self.ut_host.hash(state); ++ self.ut_exit.hash(state); ++ self.ut_session.hash(state); ++ self.ut_tv.hash(state); ++ self.ut_addr_v6.hash(state); ++ self.__glibc_reserved.hash(state); ++ } ++ } ++ ++ impl PartialEq for __c_anonymous_ptrace_syscall_info_data { ++ fn eq(&self, other: &__c_anonymous_ptrace_syscall_info_data) -> bool { ++ unsafe { ++ self.entry == other.entry ++ || self.exit == other.exit ++ || self.seccomp == other.seccomp ++ } ++ } ++ } ++ ++ impl Eq for __c_anonymous_ptrace_syscall_info_data {} ++ ++ impl fmt::Debug for __c_anonymous_ptrace_syscall_info_data { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ unsafe { ++ f.debug_struct("__c_anonymous_ptrace_syscall_info_data") ++ .field("entry", &self.entry) ++ .field("exit", &self.exit) ++ .field("seccomp", &self.seccomp) ++ .finish() ++ } ++ } ++ } ++ ++ impl hash::Hash for __c_anonymous_ptrace_syscall_info_data { ++ fn hash(&self, state: &mut H) { ++ unsafe { ++ self.entry.hash(state); ++ self.exit.hash(state); ++ self.seccomp.hash(state); ++ } ++ } ++ } ++ } ++} ++ ++// include/uapi/asm-generic/hugetlb_encode.h ++pub const HUGETLB_FLAG_ENCODE_SHIFT: c_int = 26; ++pub const HUGETLB_FLAG_ENCODE_MASK: c_int = 0x3f; ++ ++pub const HUGETLB_FLAG_ENCODE_64KB: c_int = 16 << HUGETLB_FLAG_ENCODE_SHIFT; ++pub const HUGETLB_FLAG_ENCODE_512KB: c_int = 19 << HUGETLB_FLAG_ENCODE_SHIFT; ++pub const HUGETLB_FLAG_ENCODE_1MB: c_int = 20 << HUGETLB_FLAG_ENCODE_SHIFT; ++pub const HUGETLB_FLAG_ENCODE_2MB: c_int = 21 << HUGETLB_FLAG_ENCODE_SHIFT; ++pub const HUGETLB_FLAG_ENCODE_8MB: c_int = 23 << HUGETLB_FLAG_ENCODE_SHIFT; ++pub const HUGETLB_FLAG_ENCODE_16MB: c_int = 24 << HUGETLB_FLAG_ENCODE_SHIFT; ++pub const HUGETLB_FLAG_ENCODE_32MB: c_int = 25 << HUGETLB_FLAG_ENCODE_SHIFT; ++pub const HUGETLB_FLAG_ENCODE_256MB: c_int = 28 << HUGETLB_FLAG_ENCODE_SHIFT; ++pub const HUGETLB_FLAG_ENCODE_512MB: c_int = 29 << HUGETLB_FLAG_ENCODE_SHIFT; ++pub const HUGETLB_FLAG_ENCODE_1GB: c_int = 30 << HUGETLB_FLAG_ENCODE_SHIFT; ++pub const HUGETLB_FLAG_ENCODE_2GB: c_int = 31 << HUGETLB_FLAG_ENCODE_SHIFT; ++pub const HUGETLB_FLAG_ENCODE_16GB: c_int = 34 << HUGETLB_FLAG_ENCODE_SHIFT; ++ ++// include/uapi/linux/mman.h ++/* ++ * Huge page size encoding when MAP_HUGETLB is specified, and a huge page ++ * size other than the default is desired. See hugetlb_encode.h. ++ * All known huge page size encodings are provided here. It is the ++ * responsibility of the application to know which sizes are supported on ++ * the running system. See mmap(2) man page for details. ++ */ ++pub const MAP_HUGE_SHIFT: c_int = HUGETLB_FLAG_ENCODE_SHIFT; ++pub const MAP_HUGE_MASK: c_int = HUGETLB_FLAG_ENCODE_MASK; ++ ++pub const MAP_HUGE_64KB: c_int = HUGETLB_FLAG_ENCODE_64KB; ++pub const MAP_HUGE_512KB: c_int = HUGETLB_FLAG_ENCODE_512KB; ++pub const MAP_HUGE_1MB: c_int = HUGETLB_FLAG_ENCODE_1MB; ++pub const MAP_HUGE_2MB: c_int = HUGETLB_FLAG_ENCODE_2MB; ++pub const MAP_HUGE_8MB: c_int = HUGETLB_FLAG_ENCODE_8MB; ++pub const MAP_HUGE_16MB: c_int = HUGETLB_FLAG_ENCODE_16MB; ++pub const MAP_HUGE_32MB: c_int = HUGETLB_FLAG_ENCODE_32MB; ++pub const MAP_HUGE_256MB: c_int = HUGETLB_FLAG_ENCODE_256MB; ++pub const MAP_HUGE_512MB: c_int = HUGETLB_FLAG_ENCODE_512MB; ++pub const MAP_HUGE_1GB: c_int = HUGETLB_FLAG_ENCODE_1GB; ++pub const MAP_HUGE_2GB: c_int = HUGETLB_FLAG_ENCODE_2GB; ++pub const MAP_HUGE_16GB: c_int = HUGETLB_FLAG_ENCODE_16GB; ++ ++pub const PRIO_PROCESS: crate::__priority_which_t = 0; ++pub const PRIO_PGRP: crate::__priority_which_t = 1; ++pub const PRIO_USER: crate::__priority_which_t = 2; ++ ++pub const MS_RMT_MASK: c_ulong = 0x02800051; ++ ++pub const __UT_LINESIZE: usize = 32; ++pub const __UT_NAMESIZE: usize = 32; ++pub const __UT_HOSTSIZE: usize = 256; ++pub const EMPTY: c_short = 0; ++pub const RUN_LVL: c_short = 1; ++pub const BOOT_TIME: c_short = 2; ++pub const NEW_TIME: c_short = 3; ++pub const OLD_TIME: c_short = 4; ++pub const INIT_PROCESS: c_short = 5; ++pub const LOGIN_PROCESS: c_short = 6; ++pub const USER_PROCESS: c_short = 7; ++pub const DEAD_PROCESS: c_short = 8; ++pub const ACCOUNTING: c_short = 9; ++ ++// dlfcn.h ++pub const LM_ID_BASE: c_long = 0; ++pub const LM_ID_NEWLM: c_long = -1; ++ ++pub const RTLD_DI_LMID: c_int = 1; ++pub const RTLD_DI_LINKMAP: c_int = 2; ++pub const RTLD_DI_CONFIGADDR: c_int = 3; ++pub const RTLD_DI_SERINFO: c_int = 4; ++pub const RTLD_DI_SERINFOSIZE: c_int = 5; ++pub const RTLD_DI_ORIGIN: c_int = 6; ++pub const RTLD_DI_PROFILENAME: c_int = 7; ++pub const RTLD_DI_PROFILEOUT: c_int = 8; ++pub const RTLD_DI_TLS_MODID: c_int = 9; ++pub const RTLD_DI_TLS_DATA: c_int = 10; ++ ++pub const SOCK_NONBLOCK: c_int = O_NONBLOCK; ++pub const PIDFD_NONBLOCK: c_uint = O_NONBLOCK as c_uint; ++ ++pub const SOL_RXRPC: c_int = 272; ++pub const SOL_PPPOL2TP: c_int = 273; ++pub const SOL_PNPIPE: c_int = 275; ++pub const SOL_RDS: c_int = 276; ++pub const SOL_IUCV: c_int = 277; ++pub const SOL_CAIF: c_int = 278; ++pub const SOL_NFC: c_int = 280; ++pub const SOL_XDP: c_int = 283; ++ ++pub const MSG_TRYHARD: c_int = 4; ++ ++pub const LC_PAPER: c_int = 7; ++pub const LC_NAME: c_int = 8; ++pub const LC_ADDRESS: c_int = 9; ++pub const LC_TELEPHONE: c_int = 10; ++pub const LC_MEASUREMENT: c_int = 11; ++pub const LC_IDENTIFICATION: c_int = 12; ++pub const LC_PAPER_MASK: c_int = 1 << LC_PAPER; ++pub const LC_NAME_MASK: c_int = 1 << LC_NAME; ++pub const LC_ADDRESS_MASK: c_int = 1 << LC_ADDRESS; ++pub const LC_TELEPHONE_MASK: c_int = 1 << LC_TELEPHONE; ++pub const LC_MEASUREMENT_MASK: c_int = 1 << LC_MEASUREMENT; ++pub const LC_IDENTIFICATION_MASK: c_int = 1 << LC_IDENTIFICATION; ++pub const LC_ALL_MASK: c_int = crate::LC_CTYPE_MASK ++ | crate::LC_NUMERIC_MASK ++ | crate::LC_TIME_MASK ++ | crate::LC_COLLATE_MASK ++ | crate::LC_MONETARY_MASK ++ | crate::LC_MESSAGES_MASK ++ | LC_PAPER_MASK ++ | LC_NAME_MASK ++ | LC_ADDRESS_MASK ++ | LC_TELEPHONE_MASK ++ | LC_MEASUREMENT_MASK ++ | LC_IDENTIFICATION_MASK; ++ ++pub const ENOTSUP: c_int = EOPNOTSUPP; ++ ++pub const SOCK_SEQPACKET: c_int = 5; ++pub const SOCK_DCCP: c_int = 6; ++pub const SOCK_PACKET: c_int = 10; ++ ++pub const AF_IB: c_int = 27; ++pub const AF_MPLS: c_int = 28; ++pub const AF_NFC: c_int = 39; ++pub const AF_VSOCK: c_int = 40; ++pub const AF_XDP: c_int = 44; ++pub const PF_IB: c_int = AF_IB; ++pub const PF_MPLS: c_int = AF_MPLS; ++pub const PF_NFC: c_int = AF_NFC; ++pub const PF_VSOCK: c_int = AF_VSOCK; ++pub const PF_XDP: c_int = AF_XDP; ++ ++pub const SIGEV_THREAD_ID: c_int = 4; ++ ++pub const BUFSIZ: c_uint = 8192; ++pub const TMP_MAX: c_uint = 238328; ++pub const FOPEN_MAX: c_uint = 16; ++pub const FILENAME_MAX: c_uint = 4096; ++pub const POSIX_MADV_DONTNEED: c_int = 4; ++pub const _CS_GNU_LIBC_VERSION: c_int = 2; ++pub const _CS_GNU_LIBPTHREAD_VERSION: c_int = 3; ++pub const _CS_V6_ENV: c_int = 1148; ++pub const _CS_V7_ENV: c_int = 1149; ++pub const _SC_EQUIV_CLASS_MAX: c_int = 41; ++pub const _SC_CHARCLASS_NAME_MAX: c_int = 45; ++pub const _SC_PII: c_int = 53; ++pub const _SC_PII_XTI: c_int = 54; ++pub const _SC_PII_SOCKET: c_int = 55; ++pub const _SC_PII_INTERNET: c_int = 56; ++pub const _SC_PII_OSI: c_int = 57; ++pub const _SC_POLL: c_int = 58; ++pub const _SC_SELECT: c_int = 59; ++pub const _SC_PII_INTERNET_STREAM: c_int = 61; ++pub const _SC_PII_INTERNET_DGRAM: c_int = 62; ++pub const _SC_PII_OSI_COTS: c_int = 63; ++pub const _SC_PII_OSI_CLTS: c_int = 64; ++pub const _SC_PII_OSI_M: c_int = 65; ++pub const _SC_T_IOV_MAX: c_int = 66; ++pub const _SC_2_C_VERSION: c_int = 96; ++pub const _SC_CHAR_BIT: c_int = 101; ++pub const _SC_CHAR_MAX: c_int = 102; ++pub const _SC_CHAR_MIN: c_int = 103; ++pub const _SC_INT_MAX: c_int = 104; ++pub const _SC_INT_MIN: c_int = 105; ++pub const _SC_LONG_BIT: c_int = 106; ++pub const _SC_WORD_BIT: c_int = 107; ++pub const _SC_MB_LEN_MAX: c_int = 108; ++pub const _SC_SSIZE_MAX: c_int = 110; ++pub const _SC_SCHAR_MAX: c_int = 111; ++pub const _SC_SCHAR_MIN: c_int = 112; ++pub const _SC_SHRT_MAX: c_int = 113; ++pub const _SC_SHRT_MIN: c_int = 114; ++pub const _SC_UCHAR_MAX: c_int = 115; ++pub const _SC_UINT_MAX: c_int = 116; ++pub const _SC_ULONG_MAX: c_int = 117; ++pub const _SC_USHRT_MAX: c_int = 118; ++pub const _SC_NL_ARGMAX: c_int = 119; ++pub const _SC_NL_LANGMAX: c_int = 120; ++pub const _SC_NL_MSGMAX: c_int = 121; ++pub const _SC_NL_NMAX: c_int = 122; ++pub const _SC_NL_SETMAX: c_int = 123; ++pub const _SC_NL_TEXTMAX: c_int = 124; ++pub const _SC_BASE: c_int = 134; ++pub const _SC_C_LANG_SUPPORT: c_int = 135; ++pub const _SC_C_LANG_SUPPORT_R: c_int = 136; ++pub const _SC_DEVICE_IO: c_int = 140; ++pub const _SC_DEVICE_SPECIFIC: c_int = 141; ++pub const _SC_DEVICE_SPECIFIC_R: c_int = 142; ++pub const _SC_FD_MGMT: c_int = 143; ++pub const _SC_FIFO: c_int = 144; ++pub const _SC_PIPE: c_int = 145; ++pub const _SC_FILE_ATTRIBUTES: c_int = 146; ++pub const _SC_FILE_LOCKING: c_int = 147; ++pub const _SC_FILE_SYSTEM: c_int = 148; ++pub const _SC_MULTI_PROCESS: c_int = 150; ++pub const _SC_SINGLE_PROCESS: c_int = 151; ++pub const _SC_NETWORKING: c_int = 152; ++pub const _SC_REGEX_VERSION: c_int = 156; ++pub const _SC_SIGNALS: c_int = 158; ++pub const _SC_SYSTEM_DATABASE: c_int = 162; ++pub const _SC_SYSTEM_DATABASE_R: c_int = 163; ++pub const _SC_USER_GROUPS: c_int = 166; ++pub const _SC_USER_GROUPS_R: c_int = 167; ++pub const _SC_LEVEL1_ICACHE_SIZE: c_int = 185; ++pub const _SC_LEVEL1_ICACHE_ASSOC: c_int = 186; ++pub const _SC_LEVEL1_ICACHE_LINESIZE: c_int = 187; ++pub const _SC_LEVEL1_DCACHE_SIZE: c_int = 188; ++pub const _SC_LEVEL1_DCACHE_ASSOC: c_int = 189; ++pub const _SC_LEVEL1_DCACHE_LINESIZE: c_int = 190; ++pub const _SC_LEVEL2_CACHE_SIZE: c_int = 191; ++pub const _SC_LEVEL2_CACHE_ASSOC: c_int = 192; ++pub const _SC_LEVEL2_CACHE_LINESIZE: c_int = 193; ++pub const _SC_LEVEL3_CACHE_SIZE: c_int = 194; ++pub const _SC_LEVEL3_CACHE_ASSOC: c_int = 195; ++pub const _SC_LEVEL3_CACHE_LINESIZE: c_int = 196; ++pub const _SC_LEVEL4_CACHE_SIZE: c_int = 197; ++pub const _SC_LEVEL4_CACHE_ASSOC: c_int = 198; ++pub const _SC_LEVEL4_CACHE_LINESIZE: c_int = 199; ++pub const O_ACCMODE: c_int = 3; ++pub const ST_RELATIME: c_ulong = 4096; ++pub const NI_MAXHOST: crate::socklen_t = 1025; ++ ++// Most `*_SUPER_MAGIC` constants are defined at the `linux_like` level; the ++// following are only available on newer Linux versions than the versions ++// currently used in CI in some configurations, so we define them here. ++cfg_if! { ++ if #[cfg(not(target_arch = "s390x"))] { ++ pub const BINDERFS_SUPER_MAGIC: c_long = 0x6c6f6f70; ++ pub const XFS_SUPER_MAGIC: c_long = 0x58465342; ++ } else if #[cfg(target_arch = "s390x")] { ++ pub const BINDERFS_SUPER_MAGIC: c_uint = 0x6c6f6f70; ++ pub const XFS_SUPER_MAGIC: c_uint = 0x58465342; ++ } ++} ++ ++pub const CPU_SETSIZE: c_int = 0x400; ++ ++pub const PTRACE_TRACEME: c_uint = 0; ++pub const PTRACE_PEEKTEXT: c_uint = 1; ++pub const PTRACE_PEEKDATA: c_uint = 2; ++pub const PTRACE_PEEKUSER: c_uint = 3; ++pub const PTRACE_POKETEXT: c_uint = 4; ++pub const PTRACE_POKEDATA: c_uint = 5; ++pub const PTRACE_POKEUSER: c_uint = 6; ++pub const PTRACE_CONT: c_uint = 7; ++pub const PTRACE_KILL: c_uint = 8; ++pub const PTRACE_SINGLESTEP: c_uint = 9; ++pub const PTRACE_ATTACH: c_uint = 16; ++pub const PTRACE_SYSCALL: c_uint = 24; ++pub const PTRACE_SETOPTIONS: c_uint = 0x4200; ++pub const PTRACE_GETEVENTMSG: c_uint = 0x4201; ++pub const PTRACE_GETSIGINFO: c_uint = 0x4202; ++pub const PTRACE_SETSIGINFO: c_uint = 0x4203; ++pub const PTRACE_GETREGSET: c_uint = 0x4204; ++pub const PTRACE_SETREGSET: c_uint = 0x4205; ++pub const PTRACE_SEIZE: c_uint = 0x4206; ++pub const PTRACE_INTERRUPT: c_uint = 0x4207; ++pub const PTRACE_LISTEN: c_uint = 0x4208; ++pub const PTRACE_PEEKSIGINFO: c_uint = 0x4209; ++pub const PTRACE_GETSIGMASK: c_uint = 0x420a; ++pub const PTRACE_SETSIGMASK: c_uint = 0x420b; ++pub const PTRACE_GET_SYSCALL_INFO: c_uint = 0x420e; ++pub const PTRACE_SYSCALL_INFO_NONE: crate::__u8 = 0; ++pub const PTRACE_SYSCALL_INFO_ENTRY: crate::__u8 = 1; ++pub const PTRACE_SYSCALL_INFO_EXIT: crate::__u8 = 2; ++pub const PTRACE_SYSCALL_INFO_SECCOMP: crate::__u8 = 3; ++ ++// linux/fs.h ++ ++// Flags for preadv2/pwritev2 ++pub const RWF_HIPRI: c_int = 0x00000001; ++pub const RWF_DSYNC: c_int = 0x00000002; ++pub const RWF_SYNC: c_int = 0x00000004; ++pub const RWF_NOWAIT: c_int = 0x00000008; ++pub const RWF_APPEND: c_int = 0x00000010; ++ ++// linux/rtnetlink.h ++pub const TCA_PAD: c_ushort = 9; ++pub const TCA_DUMP_INVISIBLE: c_ushort = 10; ++pub const TCA_CHAIN: c_ushort = 11; ++pub const TCA_HW_OFFLOAD: c_ushort = 12; ++ ++pub const RTM_DELNETCONF: u16 = 81; ++pub const RTM_NEWSTATS: u16 = 92; ++pub const RTM_GETSTATS: u16 = 94; ++pub const RTM_NEWCACHEREPORT: u16 = 96; ++ ++pub const RTM_F_LOOKUP_TABLE: c_uint = 0x1000; ++pub const RTM_F_FIB_MATCH: c_uint = 0x2000; ++ ++pub const RTA_VIA: c_ushort = 18; ++pub const RTA_NEWDST: c_ushort = 19; ++pub const RTA_PREF: c_ushort = 20; ++pub const RTA_ENCAP_TYPE: c_ushort = 21; ++pub const RTA_ENCAP: c_ushort = 22; ++pub const RTA_EXPIRES: c_ushort = 23; ++pub const RTA_PAD: c_ushort = 24; ++pub const RTA_UID: c_ushort = 25; ++pub const RTA_TTL_PROPAGATE: c_ushort = 26; ++ ++// linux/neighbor.h ++pub const NTF_EXT_LEARNED: u8 = 0x10; ++pub const NTF_OFFLOADED: u8 = 0x20; ++ ++pub const NDA_MASTER: c_ushort = 9; ++pub const NDA_LINK_NETNSID: c_ushort = 10; ++pub const NDA_SRC_VNI: c_ushort = 11; ++ ++// linux/personality.h ++pub const UNAME26: c_int = 0x0020000; ++pub const FDPIC_FUNCPTRS: c_int = 0x0080000; ++ ++pub const MAX_LINKS: c_int = 32; ++ ++pub const GENL_UNS_ADMIN_PERM: c_int = 0x10; ++ ++pub const GENL_ID_VFS_DQUOT: c_int = crate::NLMSG_MIN_TYPE + 1; ++pub const GENL_ID_PMCRAID: c_int = crate::NLMSG_MIN_TYPE + 2; ++ ++// linux/if_xdp.h ++pub const XDP_SHARED_UMEM: crate::__u16 = 1 << 0; ++pub const XDP_COPY: crate::__u16 = 1 << 1; ++pub const XDP_ZEROCOPY: crate::__u16 = 1 << 2; ++pub const XDP_USE_NEED_WAKEUP: crate::__u16 = 1 << 3; ++pub const XDP_USE_SG: crate::__u16 = 1 << 4; ++ ++pub const XDP_UMEM_UNALIGNED_CHUNK_FLAG: crate::__u32 = 1 << 0; ++ ++pub const XDP_RING_NEED_WAKEUP: crate::__u32 = 1 << 0; ++ ++pub const XDP_MMAP_OFFSETS: c_int = 1; ++pub const XDP_RX_RING: c_int = 2; ++pub const XDP_TX_RING: c_int = 3; ++pub const XDP_UMEM_REG: c_int = 4; ++pub const XDP_UMEM_FILL_RING: c_int = 5; ++pub const XDP_UMEM_COMPLETION_RING: c_int = 6; ++pub const XDP_STATISTICS: c_int = 7; ++pub const XDP_OPTIONS: c_int = 8; ++ ++pub const XDP_OPTIONS_ZEROCOPY: crate::__u32 = 1 << 0; ++ ++pub const XDP_PGOFF_RX_RING: off_t = 0; ++pub const XDP_PGOFF_TX_RING: off_t = 0x80000000; ++pub const XDP_UMEM_PGOFF_FILL_RING: c_ulonglong = 0x100000000; ++pub const XDP_UMEM_PGOFF_COMPLETION_RING: c_ulonglong = 0x180000000; ++ ++pub const XSK_UNALIGNED_BUF_OFFSET_SHIFT: c_int = 48; ++pub const XSK_UNALIGNED_BUF_ADDR_MASK: c_ulonglong = (1 << XSK_UNALIGNED_BUF_OFFSET_SHIFT) - 1; ++ ++pub const XDP_PKT_CONTD: crate::__u32 = 1 << 0; ++ ++pub const ELFOSABI_ARM_AEABI: u8 = 64; ++ ++// linux/sched.h ++pub const CLONE_NEWTIME: c_int = 0x80; ++// DIFF(main): changed to `c_ulonglong` in e9abac9ac2 ++pub const CLONE_CLEAR_SIGHAND: c_int = 0x100000000; ++pub const CLONE_INTO_CGROUP: c_int = 0x200000000; ++ ++// linux/keyctl.h ++pub const KEYCTL_DH_COMPUTE: u32 = 23; ++pub const KEYCTL_PKEY_QUERY: u32 = 24; ++pub const KEYCTL_PKEY_ENCRYPT: u32 = 25; ++pub const KEYCTL_PKEY_DECRYPT: u32 = 26; ++pub const KEYCTL_PKEY_SIGN: u32 = 27; ++pub const KEYCTL_PKEY_VERIFY: u32 = 28; ++pub const KEYCTL_RESTRICT_KEYRING: u32 = 29; ++ ++pub const KEYCTL_SUPPORTS_ENCRYPT: u32 = 0x01; ++pub const KEYCTL_SUPPORTS_DECRYPT: u32 = 0x02; ++pub const KEYCTL_SUPPORTS_SIGN: u32 = 0x04; ++pub const KEYCTL_SUPPORTS_VERIFY: u32 = 0x08; ++cfg_if! { ++ if #[cfg(not(any( ++ target_arch = "mips", ++ target_arch = "mips32r6", ++ target_arch = "mips64", ++ target_arch = "mips64r6" ++ )))] { ++ pub const KEYCTL_MOVE: u32 = 30; ++ pub const KEYCTL_CAPABILITIES: u32 = 31; ++ ++ pub const KEYCTL_CAPS0_CAPABILITIES: u32 = 0x01; ++ pub const KEYCTL_CAPS0_PERSISTENT_KEYRINGS: u32 = 0x02; ++ pub const KEYCTL_CAPS0_DIFFIE_HELLMAN: u32 = 0x04; ++ pub const KEYCTL_CAPS0_PUBLIC_KEY: u32 = 0x08; ++ pub const KEYCTL_CAPS0_BIG_KEY: u32 = 0x10; ++ pub const KEYCTL_CAPS0_INVALIDATE: u32 = 0x20; ++ pub const KEYCTL_CAPS0_RESTRICT_KEYRING: u32 = 0x40; ++ pub const KEYCTL_CAPS0_MOVE: u32 = 0x80; ++ pub const KEYCTL_CAPS1_NS_KEYRING_NAME: u32 = 0x01; ++ pub const KEYCTL_CAPS1_NS_KEY_TAG: u32 = 0x02; ++ } ++} ++ ++pub const M_MXFAST: c_int = 1; ++pub const M_NLBLKS: c_int = 2; ++pub const M_GRAIN: c_int = 3; ++pub const M_KEEP: c_int = 4; ++pub const M_TRIM_THRESHOLD: c_int = -1; ++pub const M_TOP_PAD: c_int = -2; ++pub const M_MMAP_THRESHOLD: c_int = -3; ++pub const M_MMAP_MAX: c_int = -4; ++pub const M_CHECK_ACTION: c_int = -5; ++pub const M_PERTURB: c_int = -6; ++pub const M_ARENA_TEST: c_int = -7; ++pub const M_ARENA_MAX: c_int = -8; ++ ++pub const SOMAXCONN: c_int = 4096; ++ ++// linux/mount.h ++pub const MOVE_MOUNT_F_SYMLINKS: c_uint = 0x00000001; ++pub const MOVE_MOUNT_F_AUTOMOUNTS: c_uint = 0x00000002; ++pub const MOVE_MOUNT_F_EMPTY_PATH: c_uint = 0x00000004; ++pub const MOVE_MOUNT_T_SYMLINKS: c_uint = 0x00000010; ++pub const MOVE_MOUNT_T_AUTOMOUNTS: c_uint = 0x00000020; ++pub const MOVE_MOUNT_T_EMPTY_PATH: c_uint = 0x00000040; ++pub const MOVE_MOUNT_SET_GROUP: c_uint = 0x00000100; ++pub const MOVE_MOUNT_BENEATH: c_uint = 0x00000200; ++ ++// sys/timex.h ++pub const ADJ_OFFSET: c_uint = 0x0001; ++pub const ADJ_FREQUENCY: c_uint = 0x0002; ++pub const ADJ_MAXERROR: c_uint = 0x0004; ++pub const ADJ_ESTERROR: c_uint = 0x0008; ++pub const ADJ_STATUS: c_uint = 0x0010; ++pub const ADJ_TIMECONST: c_uint = 0x0020; ++pub const ADJ_TAI: c_uint = 0x0080; ++pub const ADJ_SETOFFSET: c_uint = 0x0100; ++pub const ADJ_MICRO: c_uint = 0x1000; ++pub const ADJ_NANO: c_uint = 0x2000; ++pub const ADJ_TICK: c_uint = 0x4000; ++pub const ADJ_OFFSET_SINGLESHOT: c_uint = 0x8001; ++pub const ADJ_OFFSET_SS_READ: c_uint = 0xa001; ++pub const MOD_OFFSET: c_uint = ADJ_OFFSET; ++pub const MOD_FREQUENCY: c_uint = ADJ_FREQUENCY; ++pub const MOD_MAXERROR: c_uint = ADJ_MAXERROR; ++pub const MOD_ESTERROR: c_uint = ADJ_ESTERROR; ++pub const MOD_STATUS: c_uint = ADJ_STATUS; ++pub const MOD_TIMECONST: c_uint = ADJ_TIMECONST; ++pub const MOD_CLKB: c_uint = ADJ_TICK; ++pub const MOD_CLKA: c_uint = ADJ_OFFSET_SINGLESHOT; ++pub const MOD_TAI: c_uint = ADJ_TAI; ++pub const MOD_MICRO: c_uint = ADJ_MICRO; ++pub const MOD_NANO: c_uint = ADJ_NANO; ++pub const STA_PLL: c_int = 0x0001; ++pub const STA_PPSFREQ: c_int = 0x0002; ++pub const STA_PPSTIME: c_int = 0x0004; ++pub const STA_FLL: c_int = 0x0008; ++pub const STA_INS: c_int = 0x0010; ++pub const STA_DEL: c_int = 0x0020; ++pub const STA_UNSYNC: c_int = 0x0040; ++pub const STA_FREQHOLD: c_int = 0x0080; ++pub const STA_PPSSIGNAL: c_int = 0x0100; ++pub const STA_PPSJITTER: c_int = 0x0200; ++pub const STA_PPSWANDER: c_int = 0x0400; ++pub const STA_PPSERROR: c_int = 0x0800; ++pub const STA_CLOCKERR: c_int = 0x1000; ++pub const STA_NANO: c_int = 0x2000; ++pub const STA_MODE: c_int = 0x4000; ++pub const STA_CLK: c_int = 0x8000; ++pub const STA_RONLY: c_int = STA_PPSSIGNAL ++ | STA_PPSJITTER ++ | STA_PPSWANDER ++ | STA_PPSERROR ++ | STA_CLOCKERR ++ | STA_NANO ++ | STA_MODE ++ | STA_CLK; ++pub const NTP_API: c_int = 4; ++pub const TIME_OK: c_int = 0; ++pub const TIME_INS: c_int = 1; ++pub const TIME_DEL: c_int = 2; ++pub const TIME_OOP: c_int = 3; ++pub const TIME_WAIT: c_int = 4; ++pub const TIME_ERROR: c_int = 5; ++pub const TIME_BAD: c_int = TIME_ERROR; ++pub const MAXTC: c_long = 6; ++ ++// Portable GLOB_* flags are defined at the `linux_like` level. ++// The following are GNU extensions. ++pub const GLOB_PERIOD: c_int = 1 << 7; ++pub const GLOB_ALTDIRFUNC: c_int = 1 << 9; ++pub const GLOB_BRACE: c_int = 1 << 10; ++pub const GLOB_NOMAGIC: c_int = 1 << 11; ++pub const GLOB_TILDE: c_int = 1 << 12; ++pub const GLOB_ONLYDIR: c_int = 1 << 13; ++pub const GLOB_TILDE_CHECK: c_int = 1 << 14; ++ ++pub const MADV_COLLAPSE: c_int = 25; ++ ++cfg_if! { ++ if #[cfg(any( ++ target_arch = "arm", ++ target_arch = "x86", ++ target_arch = "x86_64", ++ target_arch = "s390x", ++ target_arch = "riscv64", ++ target_arch = "riscv32" ++ ))] { ++ pub const PTHREAD_STACK_MIN: size_t = 16384; ++ } else if #[cfg(any(target_arch = "sparc", target_arch = "sparc64"))] { ++ pub const PTHREAD_STACK_MIN: size_t = 0x6000; ++ } else { ++ pub const PTHREAD_STACK_MIN: size_t = 131072; ++ } ++} ++pub const PTHREAD_MUTEX_ADAPTIVE_NP: c_int = 3; ++ ++pub const REG_STARTEND: c_int = 4; ++ ++pub const REG_EEND: c_int = 14; ++pub const REG_ESIZE: c_int = 15; ++pub const REG_ERPAREN: c_int = 16; ++ ++cfg_if! { ++ if #[cfg(any( ++ target_arch = "x86", ++ target_arch = "x86_64", ++ target_arch = "arm", ++ target_arch = "aarch64", ++ target_arch = "loongarch64", ++ target_arch = "riscv64", ++ target_arch = "s390x" ++ ))] { ++ pub const TUNSETCARRIER: Ioctl = 0x400454e2; ++ pub const TUNGETDEVNETNS: Ioctl = 0x54e3; ++ } else if #[cfg(any( ++ target_arch = "mips", ++ target_arch = "mips64", ++ target_arch = "powerpc", ++ target_arch = "powerpc64", ++ target_arch = "sparc", ++ target_arch = "sparc64" ++ ))] { ++ pub const TUNSETCARRIER: Ioctl = 0x800454e2; ++ pub const TUNGETDEVNETNS: Ioctl = 0x200054e3; ++ } else { ++ // Unknown target_arch ++ } ++} ++ ++extern "C" { ++ pub fn fgetspent_r( ++ fp: *mut crate::FILE, ++ spbuf: *mut crate::spwd, ++ buf: *mut c_char, ++ buflen: size_t, ++ spbufp: *mut *mut crate::spwd, ++ ) -> c_int; ++ pub fn sgetspent_r( ++ s: *const c_char, ++ spbuf: *mut crate::spwd, ++ buf: *mut c_char, ++ buflen: size_t, ++ spbufp: *mut *mut crate::spwd, ++ ) -> c_int; ++ pub fn getspent_r( ++ spbuf: *mut crate::spwd, ++ buf: *mut c_char, ++ buflen: size_t, ++ spbufp: *mut *mut crate::spwd, ++ ) -> c_int; ++ pub fn qsort_r( ++ base: *mut c_void, ++ num: size_t, ++ size: size_t, ++ compar: Option c_int>, ++ arg: *mut c_void, ++ ); ++ #[cfg_attr(gnu_time64_abi, link_name = "__sendmmsg64")] ++ pub fn sendmmsg( ++ sockfd: c_int, ++ msgvec: *mut crate::mmsghdr, ++ vlen: c_uint, ++ flags: c_int, ++ ) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "__recvmmsg64")] ++ pub fn recvmmsg( ++ sockfd: c_int, ++ msgvec: *mut crate::mmsghdr, ++ vlen: c_uint, ++ flags: c_int, ++ timeout: *mut crate::timespec, ++ ) -> c_int; ++ ++ pub fn getrlimit64(resource: crate::__rlimit_resource_t, rlim: *mut crate::rlimit64) -> c_int; ++ pub fn setrlimit64(resource: crate::__rlimit_resource_t, rlim: *const crate::rlimit64) ++ -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "getrlimit64")] ++ pub fn getrlimit(resource: crate::__rlimit_resource_t, rlim: *mut crate::rlimit) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "setrlimit64")] ++ pub fn setrlimit(resource: crate::__rlimit_resource_t, rlim: *const crate::rlimit) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "prlimit64")] ++ pub fn prlimit( ++ pid: crate::pid_t, ++ resource: crate::__rlimit_resource_t, ++ new_limit: *const crate::rlimit, ++ old_limit: *mut crate::rlimit, ++ ) -> c_int; ++ pub fn prlimit64( ++ pid: crate::pid_t, ++ resource: crate::__rlimit_resource_t, ++ new_limit: *const crate::rlimit64, ++ old_limit: *mut crate::rlimit64, ++ ) -> c_int; ++ pub fn utmpname(file: *const c_char) -> c_int; ++ pub fn utmpxname(file: *const c_char) -> c_int; ++ pub fn getutxent() -> *mut utmpx; ++ pub fn getutxid(ut: *const utmpx) -> *mut utmpx; ++ pub fn getutxline(ut: *const utmpx) -> *mut utmpx; ++ pub fn pututxline(ut: *const utmpx) -> *mut utmpx; ++ pub fn setutxent(); ++ pub fn endutxent(); ++ pub fn getpt() -> c_int; ++ pub fn mallopt(param: c_int, value: c_int) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "__gettimeofday64")] ++ pub fn gettimeofday(tp: *mut crate::timeval, tz: *mut crate::timezone) -> c_int; ++ pub fn getentropy(buf: *mut c_void, buflen: size_t) -> c_int; ++ pub fn getrandom(buf: *mut c_void, buflen: size_t, flags: c_uint) -> ssize_t; ++ pub fn getauxval(type_: c_ulong) -> c_ulong; ++ ++ #[cfg_attr(gnu_time64_abi, link_name = "___adjtimex64")] ++ pub fn adjtimex(buf: *mut timex) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "___adjtimex64")] ++ pub fn ntp_adjtime(buf: *mut timex) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "__clock_adjtime64")] ++ pub fn clock_adjtime(clk_id: crate::clockid_t, buf: *mut crate::timex) -> c_int; ++ ++ pub fn fanotify_mark( ++ fd: c_int, ++ flags: c_uint, ++ mask: u64, ++ dirfd: c_int, ++ path: *const c_char, ++ ) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "preadv64v2")] ++ pub fn preadv2( ++ fd: c_int, ++ iov: *const crate::iovec, ++ iovcnt: c_int, ++ offset: off_t, ++ flags: c_int, ++ ) -> ssize_t; ++ #[cfg_attr(gnu_time64_abi, link_name = "pwritev64v2")] ++ pub fn pwritev2( ++ fd: c_int, ++ iov: *const crate::iovec, ++ iovcnt: c_int, ++ offset: off_t, ++ flags: c_int, ++ ) -> ssize_t; ++ pub fn preadv64v2( ++ fd: c_int, ++ iov: *const crate::iovec, ++ iovcnt: c_int, ++ offset: off64_t, ++ flags: c_int, ++ ) -> ssize_t; ++ pub fn pwritev64v2( ++ fd: c_int, ++ iov: *const crate::iovec, ++ iovcnt: c_int, ++ offset: off64_t, ++ flags: c_int, ++ ) -> ssize_t; ++ pub fn renameat2( ++ olddirfd: c_int, ++ oldpath: *const c_char, ++ newdirfd: c_int, ++ newpath: *const c_char, ++ flags: c_uint, ++ ) -> c_int; ++ ++ // Added in `glibc` 2.25 ++ pub fn explicit_bzero(s: *mut c_void, len: size_t); ++ // Added in `glibc` 2.29 ++ pub fn reallocarray(ptr: *mut c_void, nmemb: size_t, size: size_t) -> *mut c_void; ++ ++ pub fn ctermid(s: *mut c_char) -> *mut c_char; ++ pub fn backtrace(buf: *mut *mut c_void, sz: c_int) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "__glob64_time64")] ++ pub fn glob64( ++ pattern: *const c_char, ++ flags: c_int, ++ errfunc: Option c_int>, ++ pglob: *mut glob64_t, ++ ) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "__globfree64_time64")] ++ pub fn globfree64(pglob: *mut glob64_t); ++ pub fn ptrace(request: c_uint, ...) -> c_long; ++ pub fn pthread_attr_getaffinity_np( ++ attr: *const crate::pthread_attr_t, ++ cpusetsize: size_t, ++ cpuset: *mut crate::cpu_set_t, ++ ) -> c_int; ++ pub fn pthread_attr_setaffinity_np( ++ attr: *mut crate::pthread_attr_t, ++ cpusetsize: size_t, ++ cpuset: *const crate::cpu_set_t, ++ ) -> c_int; ++ pub fn getpriority(which: crate::__priority_which_t, who: crate::id_t) -> c_int; ++ pub fn setpriority(which: crate::__priority_which_t, who: crate::id_t, prio: c_int) -> c_int; ++ pub fn pthread_rwlockattr_getkind_np( ++ attr: *const crate::pthread_rwlockattr_t, ++ val: *mut c_int, ++ ) -> c_int; ++ pub fn pthread_rwlockattr_setkind_np( ++ attr: *mut crate::pthread_rwlockattr_t, ++ val: c_int, ++ ) -> c_int; ++ pub fn pthread_sigqueue(thread: crate::pthread_t, sig: c_int, value: crate::sigval) -> c_int; ++ pub fn mallinfo() -> crate::mallinfo; ++ pub fn mallinfo2() -> crate::mallinfo2; ++ pub fn malloc_stats(); ++ pub fn malloc_info(options: c_int, stream: *mut crate::FILE) -> c_int; ++ pub fn malloc_usable_size(ptr: *mut c_void) -> size_t; ++ pub fn getpwent_r( ++ pwd: *mut crate::passwd, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut crate::passwd, ++ ) -> c_int; ++ pub fn getgrent_r( ++ grp: *mut crate::group, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut crate::group, ++ ) -> c_int; ++ pub fn fgetpwent_r( ++ stream: *mut crate::FILE, ++ pwd: *mut crate::passwd, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut crate::passwd, ++ ) -> c_int; ++ pub fn fgetgrent_r( ++ stream: *mut crate::FILE, ++ grp: *mut crate::group, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut crate::group, ++ ) -> c_int; ++ ++ pub fn putpwent(p: *const crate::passwd, stream: *mut crate::FILE) -> c_int; ++ pub fn putgrent(grp: *const crate::group, stream: *mut crate::FILE) -> c_int; ++ ++ pub fn sethostid(hostid: c_long) -> c_int; ++ ++ pub fn memfd_create(name: *const c_char, flags: c_uint) -> c_int; ++ pub fn mlock2(addr: *const c_void, len: size_t, flags: c_uint) -> c_int; ++ ++ pub fn euidaccess(pathname: *const c_char, mode: c_int) -> c_int; ++ pub fn eaccess(pathname: *const c_char, mode: c_int) -> c_int; ++ ++ pub fn asctime_r(tm: *const crate::tm, buf: *mut c_char) -> *mut c_char; ++ #[cfg_attr(gnu_time64_abi, link_name = "__ctime64_r")] ++ pub fn ctime_r(timep: *const time_t, buf: *mut c_char) -> *mut c_char; ++ ++ pub fn dirname(path: *mut c_char) -> *mut c_char; ++ /// POSIX version of `basename(3)`, defined in `libgen.h`. ++ #[link_name = "__xpg_basename"] ++ pub fn posix_basename(path: *mut c_char) -> *mut c_char; ++ /// GNU version of `basename(3)`, defined in `string.h`. ++ #[link_name = "basename"] ++ pub fn gnu_basename(path: *const c_char) -> *mut c_char; ++ pub fn dlmopen(lmid: Lmid_t, filename: *const c_char, flag: c_int) -> *mut c_void; ++ pub fn dlinfo(handle: *mut c_void, request: c_int, info: *mut c_void) -> c_int; ++ pub fn dladdr1( ++ addr: *const c_void, ++ info: *mut crate::Dl_info, ++ extra_info: *mut *mut c_void, ++ flags: c_int, ++ ) -> c_int; ++ pub fn malloc_trim(__pad: size_t) -> c_int; ++ pub fn gnu_get_libc_release() -> *const c_char; ++ pub fn gnu_get_libc_version() -> *const c_char; ++ ++ // posix/spawn.h ++ // Added in `glibc` 2.29 ++ pub fn posix_spawn_file_actions_addchdir_np( ++ actions: *mut crate::posix_spawn_file_actions_t, ++ path: *const c_char, ++ ) -> c_int; ++ // Added in `glibc` 2.29 ++ pub fn posix_spawn_file_actions_addfchdir_np( ++ actions: *mut crate::posix_spawn_file_actions_t, ++ fd: c_int, ++ ) -> c_int; ++ // Added in `glibc` 2.34 ++ pub fn posix_spawn_file_actions_addclosefrom_np( ++ actions: *mut crate::posix_spawn_file_actions_t, ++ from: c_int, ++ ) -> c_int; ++ // Added in `glibc` 2.35 ++ pub fn posix_spawn_file_actions_addtcsetpgrp_np( ++ actions: *mut crate::posix_spawn_file_actions_t, ++ tcfd: c_int, ++ ) -> c_int; ++ ++ // mntent.h ++ pub fn getmntent_r( ++ stream: *mut crate::FILE, ++ mntbuf: *mut crate::mntent, ++ buf: *mut c_char, ++ buflen: c_int, ++ ) -> *mut crate::mntent; ++ ++ pub fn execveat( ++ dirfd: c_int, ++ pathname: *const c_char, ++ argv: *const *mut c_char, ++ envp: *const *mut c_char, ++ flags: c_int, ++ ) -> c_int; ++ ++ // Added in `glibc` 2.34 ++ pub fn close_range(first: c_uint, last: c_uint, flags: c_int) -> c_int; ++ ++ pub fn mq_notify(mqdes: crate::mqd_t, sevp: *const crate::sigevent) -> c_int; ++ ++ pub fn epoll_pwait2( ++ epfd: c_int, ++ events: *mut crate::epoll_event, ++ maxevents: c_int, ++ timeout: *const crate::timespec, ++ sigmask: *const crate::sigset_t, ++ ) -> c_int; ++ ++ pub fn mempcpy(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void; ++} ++ ++cfg_if! { ++ if #[cfg(any( ++ target_arch = "x86", ++ target_arch = "arm", ++ target_arch = "m68k", ++ target_arch = "csky", ++ target_arch = "mips", ++ target_arch = "mips32r6", ++ target_arch = "powerpc", ++ target_arch = "sparc", ++ target_arch = "riscv32" ++ ))] { ++ mod b32; ++ pub use self::b32::*; ++ } else if #[cfg(any( ++ target_arch = "x86_64", ++ target_arch = "aarch64", ++ target_arch = "powerpc64", ++ target_arch = "mips64", ++ target_arch = "mips64r6", ++ target_arch = "s390x", ++ target_arch = "sparc64", ++ target_arch = "riscv64", ++ target_arch = "loongarch64" ++ ))] { ++ mod b64; ++ pub use self::b64::*; ++ } else { ++ // Unknown target_arch ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/mod.rs 2024-12-28 15:35:00.000000000 -0500 +@@ -0,0 +1,6847 @@ ++//! Linux-specific definitions for linux-like values ++ ++use core::mem::size_of; ++ ++use crate::prelude::*; ++ ++pub type useconds_t = u32; ++pub type dev_t = u64; ++pub type socklen_t = u32; ++pub type mode_t = u32; ++pub type ino64_t = u64; ++pub type off64_t = i64; ++pub type blkcnt64_t = i64; ++pub type rlim64_t = u64; ++pub type mqd_t = c_int; ++pub type nfds_t = c_ulong; ++pub type nl_item = c_int; ++pub type idtype_t = c_uint; ++pub type loff_t = c_longlong; ++pub type pthread_key_t = c_uint; ++pub type pthread_once_t = c_int; ++pub type pthread_spinlock_t = c_int; ++pub type __kernel_fsid_t = __c_anonymous__kernel_fsid_t; ++pub type __kernel_clockid_t = c_int; ++ ++pub type __u8 = c_uchar; ++pub type __u16 = c_ushort; ++pub type __s16 = c_short; ++pub type __u32 = c_uint; ++pub type __s32 = c_int; ++ ++pub type Elf32_Half = u16; ++pub type Elf32_Word = u32; ++pub type Elf32_Off = u32; ++pub type Elf32_Addr = u32; ++pub type Elf32_Xword = u64; ++pub type Elf32_Sword = i32; ++ ++pub type Elf64_Half = u16; ++pub type Elf64_Word = u32; ++pub type Elf64_Off = u64; ++pub type Elf64_Addr = u64; ++pub type Elf64_Xword = u64; ++pub type Elf64_Sxword = i64; ++pub type Elf64_Sword = i32; ++ ++pub type Elf32_Section = u16; ++pub type Elf64_Section = u16; ++ ++pub type Elf32_Relr = Elf32_Word; ++pub type Elf64_Relr = Elf32_Xword; ++pub type Elf32_Rel = __c_anonymous_elf32_rel; ++pub type Elf64_Rel = __c_anonymous_elf64_rel; ++ ++cfg_if! { ++ if #[cfg(not(target_arch = "sparc64"))] { ++ pub type Elf32_Rela = __c_anonymous_elf32_rela; ++ pub type Elf64_Rela = __c_anonymous_elf64_rela; ++ } ++} ++ ++// linux/can.h ++pub type canid_t = u32; ++ ++// linux/can/j1939.h ++pub type can_err_mask_t = u32; ++pub type pgn_t = u32; ++pub type priority_t = u8; ++pub type name_t = u64; ++ ++pub type iconv_t = *mut c_void; ++ ++// linux/sctp.h ++pub type sctp_assoc_t = __s32; ++ ++pub type eventfd_t = u64; ++missing! { ++ #[cfg_attr(feature = "extra_traits", derive(Debug))] ++ pub enum fpos64_t {} // FIXME: fill this out with a struct ++} ++ ++e! { ++ #[repr(u32)] ++ pub enum tpacket_versions { ++ TPACKET_V1, ++ TPACKET_V2, ++ TPACKET_V3, ++ } ++} ++ ++s! { ++ pub struct glob_t { ++ pub gl_pathc: size_t, ++ pub gl_pathv: *mut *mut c_char, ++ pub gl_offs: size_t, ++ pub gl_flags: c_int, ++ ++ __unused1: *mut c_void, ++ __unused2: *mut c_void, ++ __unused3: *mut c_void, ++ __unused4: *mut c_void, ++ __unused5: *mut c_void, ++ } ++ ++ pub struct passwd { ++ pub pw_name: *mut c_char, ++ pub pw_passwd: *mut c_char, ++ pub pw_uid: crate::uid_t, ++ pub pw_gid: crate::gid_t, ++ pub pw_gecos: *mut c_char, ++ pub pw_dir: *mut c_char, ++ pub pw_shell: *mut c_char, ++ } ++ ++ pub struct spwd { ++ pub sp_namp: *mut c_char, ++ pub sp_pwdp: *mut c_char, ++ pub sp_lstchg: c_long, ++ pub sp_min: c_long, ++ pub sp_max: c_long, ++ pub sp_warn: c_long, ++ pub sp_inact: c_long, ++ pub sp_expire: c_long, ++ pub sp_flag: c_ulong, ++ } ++ ++ pub struct dqblk { ++ pub dqb_bhardlimit: u64, ++ pub dqb_bsoftlimit: u64, ++ pub dqb_curspace: u64, ++ pub dqb_ihardlimit: u64, ++ pub dqb_isoftlimit: u64, ++ pub dqb_curinodes: u64, ++ pub dqb_btime: u64, ++ pub dqb_itime: u64, ++ pub dqb_valid: u32, ++ } ++ ++ pub struct signalfd_siginfo { ++ pub ssi_signo: u32, ++ pub ssi_errno: i32, ++ pub ssi_code: i32, ++ pub ssi_pid: u32, ++ pub ssi_uid: u32, ++ pub ssi_fd: i32, ++ pub ssi_tid: u32, ++ pub ssi_band: u32, ++ pub ssi_overrun: u32, ++ pub ssi_trapno: u32, ++ pub ssi_status: i32, ++ pub ssi_int: i32, ++ pub ssi_ptr: u64, ++ pub ssi_utime: u64, ++ pub ssi_stime: u64, ++ pub ssi_addr: u64, ++ pub ssi_addr_lsb: u16, ++ _pad2: u16, ++ pub ssi_syscall: i32, ++ pub ssi_call_addr: u64, ++ pub ssi_arch: u32, ++ _pad: [u8; 28], ++ } ++ ++ pub struct itimerspec { ++ pub it_interval: crate::timespec, ++ pub it_value: crate::timespec, ++ } ++ ++ pub struct fsid_t { ++ __val: [c_int; 2], ++ } ++ ++ pub struct fanout_args { ++ #[cfg(target_endian = "little")] ++ pub id: __u16, ++ pub type_flags: __u16, ++ #[cfg(target_endian = "big")] ++ pub id: __u16, ++ pub max_num_members: __u32, ++ } ++ ++ pub struct packet_mreq { ++ pub mr_ifindex: c_int, ++ pub mr_type: c_ushort, ++ pub mr_alen: c_ushort, ++ pub mr_address: [c_uchar; 8], ++ } ++ ++ pub struct sockaddr_pkt { ++ pub spkt_family: c_ushort, ++ pub spkt_device: [c_uchar; 14], ++ pub spkt_protocol: c_ushort, ++ } ++ ++ pub struct tpacket_auxdata { ++ pub tp_status: __u32, ++ pub tp_len: __u32, ++ pub tp_snaplen: __u32, ++ pub tp_mac: __u16, ++ pub tp_net: __u16, ++ pub tp_vlan_tci: __u16, ++ pub tp_vlan_tpid: __u16, ++ } ++ ++ pub struct tpacket_hdr { ++ pub tp_status: c_ulong, ++ pub tp_len: c_uint, ++ pub tp_snaplen: c_uint, ++ pub tp_mac: c_ushort, ++ pub tp_net: c_ushort, ++ pub tp_sec: c_uint, ++ pub tp_usec: c_uint, ++ } ++ ++ pub struct tpacket_hdr_variant1 { ++ pub tp_rxhash: __u32, ++ pub tp_vlan_tci: __u32, ++ pub tp_vlan_tpid: __u16, ++ pub tp_padding: __u16, ++ } ++ ++ pub struct tpacket2_hdr { ++ pub tp_status: __u32, ++ pub tp_len: __u32, ++ pub tp_snaplen: __u32, ++ pub tp_mac: __u16, ++ pub tp_net: __u16, ++ pub tp_sec: __u32, ++ pub tp_nsec: __u32, ++ pub tp_vlan_tci: __u16, ++ pub tp_vlan_tpid: __u16, ++ pub tp_padding: [__u8; 4], ++ } ++ ++ pub struct tpacket_req { ++ pub tp_block_size: c_uint, ++ pub tp_block_nr: c_uint, ++ pub tp_frame_size: c_uint, ++ pub tp_frame_nr: c_uint, ++ } ++ ++ pub struct tpacket_req3 { ++ pub tp_block_size: c_uint, ++ pub tp_block_nr: c_uint, ++ pub tp_frame_size: c_uint, ++ pub tp_frame_nr: c_uint, ++ pub tp_retire_blk_tov: c_uint, ++ pub tp_sizeof_priv: c_uint, ++ pub tp_feature_req_word: c_uint, ++ } ++ ++ #[repr(align(8))] ++ pub struct tpacket_rollover_stats { ++ pub tp_all: crate::__u64, ++ pub tp_huge: crate::__u64, ++ pub tp_failed: crate::__u64, ++ } ++ ++ pub struct tpacket_stats { ++ pub tp_packets: c_uint, ++ pub tp_drops: c_uint, ++ } ++ ++ pub struct tpacket_stats_v3 { ++ pub tp_packets: c_uint, ++ pub tp_drops: c_uint, ++ pub tp_freeze_q_cnt: c_uint, ++ } ++ ++ pub struct tpacket3_hdr { ++ pub tp_next_offset: __u32, ++ pub tp_sec: __u32, ++ pub tp_nsec: __u32, ++ pub tp_snaplen: __u32, ++ pub tp_len: __u32, ++ pub tp_status: __u32, ++ pub tp_mac: __u16, ++ pub tp_net: __u16, ++ pub hv1: crate::tpacket_hdr_variant1, ++ pub tp_padding: [__u8; 8], ++ } ++ ++ pub struct tpacket_bd_ts { ++ pub ts_sec: c_uint, ++ pub ts_usec: c_uint, ++ } ++ ++ #[repr(align(8))] ++ pub struct tpacket_hdr_v1 { ++ pub block_status: __u32, ++ pub num_pkts: __u32, ++ pub offset_to_first_pkt: __u32, ++ pub blk_len: __u32, ++ pub seq_num: crate::__u64, ++ pub ts_first_pkt: crate::tpacket_bd_ts, ++ pub ts_last_pkt: crate::tpacket_bd_ts, ++ } ++ ++ pub struct cpu_set_t { ++ #[cfg(all(target_pointer_width = "32", not(target_arch = "x86_64")))] ++ bits: [u32; 32], ++ #[cfg(not(all(target_pointer_width = "32", not(target_arch = "x86_64"))))] ++ bits: [u64; 16], ++ } ++ ++ pub struct if_nameindex { ++ pub if_index: c_uint, ++ pub if_name: *mut c_char, ++ } ++ ++ // System V IPC ++ pub struct msginfo { ++ pub msgpool: c_int, ++ pub msgmap: c_int, ++ pub msgmax: c_int, ++ pub msgmnb: c_int, ++ pub msgmni: c_int, ++ pub msgssz: c_int, ++ pub msgtql: c_int, ++ pub msgseg: c_ushort, ++ } ++ ++ pub struct sembuf { ++ pub sem_num: c_ushort, ++ pub sem_op: c_short, ++ pub sem_flg: c_short, ++ } ++ ++ pub struct input_event { ++ #[cfg(not(gnu_time64_abi))] ++ pub time: crate::timeval, ++ #[cfg(gnu_time64_abi)] ++ pub __sec: c_ulong, ++ #[cfg(gnu_time64_abi)] ++ pub __usec: c_ulong, ++ pub type_: __u16, ++ pub code: __u16, ++ pub value: __s32, ++ } ++ ++ pub struct input_id { ++ pub bustype: __u16, ++ pub vendor: __u16, ++ pub product: __u16, ++ pub version: __u16, ++ } ++ ++ pub struct input_absinfo { ++ pub value: __s32, ++ pub minimum: __s32, ++ pub maximum: __s32, ++ pub fuzz: __s32, ++ pub flat: __s32, ++ pub resolution: __s32, ++ } ++ ++ pub struct input_keymap_entry { ++ pub flags: __u8, ++ pub len: __u8, ++ pub index: __u16, ++ pub keycode: __u32, ++ pub scancode: [__u8; 32], ++ } ++ ++ pub struct input_mask { ++ pub type_: __u32, ++ pub codes_size: __u32, ++ pub codes_ptr: crate::__u64, ++ } ++ ++ pub struct ff_replay { ++ pub length: __u16, ++ pub delay: __u16, ++ } ++ ++ pub struct ff_trigger { ++ pub button: __u16, ++ pub interval: __u16, ++ } ++ ++ pub struct ff_envelope { ++ pub attack_length: __u16, ++ pub attack_level: __u16, ++ pub fade_length: __u16, ++ pub fade_level: __u16, ++ } ++ ++ pub struct ff_constant_effect { ++ pub level: __s16, ++ pub envelope: ff_envelope, ++ } ++ ++ pub struct ff_ramp_effect { ++ pub start_level: __s16, ++ pub end_level: __s16, ++ pub envelope: ff_envelope, ++ } ++ ++ pub struct ff_condition_effect { ++ pub right_saturation: __u16, ++ pub left_saturation: __u16, ++ ++ pub right_coeff: __s16, ++ pub left_coeff: __s16, ++ ++ pub deadband: __u16, ++ pub center: __s16, ++ } ++ ++ pub struct ff_periodic_effect { ++ pub waveform: __u16, ++ pub period: __u16, ++ pub magnitude: __s16, ++ pub offset: __s16, ++ pub phase: __u16, ++ ++ pub envelope: ff_envelope, ++ ++ pub custom_len: __u32, ++ pub custom_data: *mut __s16, ++ } ++ ++ pub struct ff_rumble_effect { ++ pub strong_magnitude: __u16, ++ pub weak_magnitude: __u16, ++ } ++ ++ pub struct ff_effect { ++ pub type_: __u16, ++ pub id: __s16, ++ pub direction: __u16, ++ pub trigger: ff_trigger, ++ pub replay: ff_replay, ++ // FIXME(1.0): this is actually a union ++ #[cfg(target_pointer_width = "64")] ++ pub u: [u64; 4], ++ #[cfg(target_pointer_width = "32")] ++ pub u: [u32; 7], ++ } ++ ++ pub struct uinput_ff_upload { ++ pub request_id: __u32, ++ pub retval: __s32, ++ pub effect: ff_effect, ++ pub old: ff_effect, ++ } ++ ++ pub struct uinput_ff_erase { ++ pub request_id: __u32, ++ pub retval: __s32, ++ pub effect_id: __u32, ++ } ++ ++ pub struct uinput_abs_setup { ++ pub code: __u16, ++ pub absinfo: input_absinfo, ++ } ++ ++ pub struct dl_phdr_info { ++ #[cfg(target_pointer_width = "64")] ++ pub dlpi_addr: Elf64_Addr, ++ #[cfg(target_pointer_width = "32")] ++ pub dlpi_addr: Elf32_Addr, ++ ++ pub dlpi_name: *const c_char, ++ ++ #[cfg(target_pointer_width = "64")] ++ pub dlpi_phdr: *const Elf64_Phdr, ++ #[cfg(target_pointer_width = "32")] ++ pub dlpi_phdr: *const Elf32_Phdr, ++ ++ #[cfg(target_pointer_width = "64")] ++ pub dlpi_phnum: Elf64_Half, ++ #[cfg(target_pointer_width = "32")] ++ pub dlpi_phnum: Elf32_Half, ++ ++ // As of uClibc 1.0.36, the following fields are ++ // gated behind a "#if 0" block which always evaluates ++ // to false. So I'm just removing these, and if uClibc changes ++ // the #if block in the future to include the following fields, these ++ // will probably need including here. tsidea, skrap ++ // QNX (NTO) platform does not define these fields ++ #[cfg(not(any(target_env = "uclibc", target_os = "nto")))] ++ pub dlpi_adds: c_ulonglong, ++ #[cfg(not(any(target_env = "uclibc", target_os = "nto")))] ++ pub dlpi_subs: c_ulonglong, ++ #[cfg(not(any(target_env = "uclibc", target_os = "nto")))] ++ pub dlpi_tls_modid: size_t, ++ #[cfg(not(any(target_env = "uclibc", target_os = "nto")))] ++ pub dlpi_tls_data: *mut c_void, ++ } ++ ++ pub struct Elf32_Ehdr { ++ pub e_ident: [c_uchar; 16], ++ pub e_type: Elf32_Half, ++ pub e_machine: Elf32_Half, ++ pub e_version: Elf32_Word, ++ pub e_entry: Elf32_Addr, ++ pub e_phoff: Elf32_Off, ++ pub e_shoff: Elf32_Off, ++ pub e_flags: Elf32_Word, ++ pub e_ehsize: Elf32_Half, ++ pub e_phentsize: Elf32_Half, ++ pub e_phnum: Elf32_Half, ++ pub e_shentsize: Elf32_Half, ++ pub e_shnum: Elf32_Half, ++ pub e_shstrndx: Elf32_Half, ++ } ++ ++ pub struct Elf64_Ehdr { ++ pub e_ident: [c_uchar; 16], ++ pub e_type: Elf64_Half, ++ pub e_machine: Elf64_Half, ++ pub e_version: Elf64_Word, ++ pub e_entry: Elf64_Addr, ++ pub e_phoff: Elf64_Off, ++ pub e_shoff: Elf64_Off, ++ pub e_flags: Elf64_Word, ++ pub e_ehsize: Elf64_Half, ++ pub e_phentsize: Elf64_Half, ++ pub e_phnum: Elf64_Half, ++ pub e_shentsize: Elf64_Half, ++ pub e_shnum: Elf64_Half, ++ pub e_shstrndx: Elf64_Half, ++ } ++ ++ pub struct Elf32_Sym { ++ pub st_name: Elf32_Word, ++ pub st_value: Elf32_Addr, ++ pub st_size: Elf32_Word, ++ pub st_info: c_uchar, ++ pub st_other: c_uchar, ++ pub st_shndx: Elf32_Section, ++ } ++ ++ pub struct Elf64_Sym { ++ pub st_name: Elf64_Word, ++ pub st_info: c_uchar, ++ pub st_other: c_uchar, ++ pub st_shndx: Elf64_Section, ++ pub st_value: Elf64_Addr, ++ pub st_size: Elf64_Xword, ++ } ++ ++ pub struct Elf32_Phdr { ++ pub p_type: Elf32_Word, ++ pub p_offset: Elf32_Off, ++ pub p_vaddr: Elf32_Addr, ++ pub p_paddr: Elf32_Addr, ++ pub p_filesz: Elf32_Word, ++ pub p_memsz: Elf32_Word, ++ pub p_flags: Elf32_Word, ++ pub p_align: Elf32_Word, ++ } ++ ++ pub struct Elf64_Phdr { ++ pub p_type: Elf64_Word, ++ pub p_flags: Elf64_Word, ++ pub p_offset: Elf64_Off, ++ pub p_vaddr: Elf64_Addr, ++ pub p_paddr: Elf64_Addr, ++ pub p_filesz: Elf64_Xword, ++ pub p_memsz: Elf64_Xword, ++ pub p_align: Elf64_Xword, ++ } ++ ++ pub struct Elf32_Shdr { ++ pub sh_name: Elf32_Word, ++ pub sh_type: Elf32_Word, ++ pub sh_flags: Elf32_Word, ++ pub sh_addr: Elf32_Addr, ++ pub sh_offset: Elf32_Off, ++ pub sh_size: Elf32_Word, ++ pub sh_link: Elf32_Word, ++ pub sh_info: Elf32_Word, ++ pub sh_addralign: Elf32_Word, ++ pub sh_entsize: Elf32_Word, ++ } ++ ++ pub struct Elf64_Shdr { ++ pub sh_name: Elf64_Word, ++ pub sh_type: Elf64_Word, ++ pub sh_flags: Elf64_Xword, ++ pub sh_addr: Elf64_Addr, ++ pub sh_offset: Elf64_Off, ++ pub sh_size: Elf64_Xword, ++ pub sh_link: Elf64_Word, ++ pub sh_info: Elf64_Word, ++ pub sh_addralign: Elf64_Xword, ++ pub sh_entsize: Elf64_Xword, ++ } ++ ++ pub struct __c_anonymous_elf32_rel { ++ pub r_offset: Elf32_Addr, ++ pub r_info: Elf32_Word, ++ } ++ ++ pub struct __c_anonymous_elf64_rel { ++ pub r_offset: Elf64_Addr, ++ pub r_info: Elf64_Xword, ++ } ++ ++ pub struct __c_anonymous__kernel_fsid_t { ++ pub val: [c_int; 2], ++ } ++ ++ pub struct ucred { ++ pub pid: crate::pid_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ } ++ ++ pub struct mntent { ++ pub mnt_fsname: *mut c_char, ++ pub mnt_dir: *mut c_char, ++ pub mnt_type: *mut c_char, ++ pub mnt_opts: *mut c_char, ++ pub mnt_freq: c_int, ++ pub mnt_passno: c_int, ++ } ++ ++ pub struct posix_spawn_file_actions_t { ++ __allocated: c_int, ++ __used: c_int, ++ __actions: *mut c_int, ++ __pad: [c_int; 16], ++ } ++ ++ pub struct posix_spawnattr_t { ++ __flags: c_short, ++ __pgrp: crate::pid_t, ++ __sd: crate::sigset_t, ++ __ss: crate::sigset_t, ++ #[cfg(any(target_env = "musl", target_env = "ohos"))] ++ __prio: c_int, ++ #[cfg(not(any(target_env = "musl", target_env = "ohos")))] ++ __sp: crate::sched_param, ++ __policy: c_int, ++ __pad: [c_int; 16], ++ } ++ ++ pub struct genlmsghdr { ++ pub cmd: u8, ++ pub version: u8, ++ pub reserved: u16, ++ } ++ ++ pub struct in6_pktinfo { ++ pub ipi6_addr: crate::in6_addr, ++ pub ipi6_ifindex: c_uint, ++ } ++ ++ pub struct arpd_request { ++ pub req: c_ushort, ++ pub ip: u32, ++ pub dev: c_ulong, ++ pub stamp: c_ulong, ++ pub updated: c_ulong, ++ pub ha: [c_uchar; crate::MAX_ADDR_LEN], ++ } ++ ++ pub struct inotify_event { ++ pub wd: c_int, ++ pub mask: u32, ++ pub cookie: u32, ++ pub len: u32, ++ } ++ ++ pub struct fanotify_response { ++ pub fd: c_int, ++ pub response: __u32, ++ } ++ ++ pub struct fanotify_event_info_header { ++ pub info_type: __u8, ++ pub pad: __u8, ++ pub len: __u16, ++ } ++ ++ pub struct fanotify_event_info_fid { ++ pub hdr: fanotify_event_info_header, ++ pub fsid: crate::__kernel_fsid_t, ++ pub handle: [c_uchar; 0], ++ } ++ ++ pub struct sockaddr_vm { ++ pub svm_family: crate::sa_family_t, ++ pub svm_reserved1: c_ushort, ++ pub svm_port: c_uint, ++ pub svm_cid: c_uint, ++ pub svm_zero: [u8; 4], ++ } ++ ++ pub struct regmatch_t { ++ pub rm_so: regoff_t, ++ pub rm_eo: regoff_t, ++ } ++ ++ pub struct sock_extended_err { ++ pub ee_errno: u32, ++ pub ee_origin: u8, ++ pub ee_type: u8, ++ pub ee_code: u8, ++ pub ee_pad: u8, ++ pub ee_info: u32, ++ pub ee_data: u32, ++ } ++ ++ // linux/can.h ++ pub struct __c_anonymous_sockaddr_can_tp { ++ pub rx_id: canid_t, ++ pub tx_id: canid_t, ++ } ++ ++ pub struct __c_anonymous_sockaddr_can_j1939 { ++ pub name: u64, ++ pub pgn: u32, ++ pub addr: u8, ++ } ++ ++ pub struct can_filter { ++ pub can_id: canid_t, ++ pub can_mask: canid_t, ++ } ++ ++ // linux/can/j1939.h ++ pub struct j1939_filter { ++ pub name: name_t, ++ pub name_mask: name_t, ++ pub pgn: pgn_t, ++ pub pgn_mask: pgn_t, ++ pub addr: u8, ++ pub addr_mask: u8, ++ } ++ ++ // linux/filter.h ++ pub struct sock_filter { ++ pub code: __u16, ++ pub jt: __u8, ++ pub jf: __u8, ++ pub k: __u32, ++ } ++ ++ pub struct sock_fprog { ++ pub len: c_ushort, ++ pub filter: *mut sock_filter, ++ } ++ ++ // linux/seccomp.h ++ pub struct seccomp_data { ++ pub nr: c_int, ++ pub arch: __u32, ++ pub instruction_pointer: crate::__u64, ++ pub args: [crate::__u64; 6], ++ } ++ ++ pub struct seccomp_notif_sizes { ++ pub seccomp_notif: __u16, ++ pub seccomp_notif_resp: __u16, ++ pub seccomp_data: __u16, ++ } ++ ++ pub struct seccomp_notif { ++ pub id: crate::__u64, ++ pub pid: __u32, ++ pub flags: __u32, ++ pub data: seccomp_data, ++ } ++ ++ pub struct seccomp_notif_resp { ++ pub id: crate::__u64, ++ pub val: crate::__s64, ++ pub error: __s32, ++ pub flags: __u32, ++ } ++ ++ pub struct seccomp_notif_addfd { ++ pub id: crate::__u64, ++ pub flags: __u32, ++ pub srcfd: __u32, ++ pub newfd: __u32, ++ pub newfd_flags: __u32, ++ } ++ ++ pub struct nlmsghdr { ++ pub nlmsg_len: u32, ++ pub nlmsg_type: u16, ++ pub nlmsg_flags: u16, ++ pub nlmsg_seq: u32, ++ pub nlmsg_pid: u32, ++ } ++ ++ pub struct nlmsgerr { ++ pub error: c_int, ++ pub msg: nlmsghdr, ++ } ++ ++ pub struct nlattr { ++ pub nla_len: u16, ++ pub nla_type: u16, ++ } ++ ++ pub struct file_clone_range { ++ pub src_fd: crate::__s64, ++ pub src_offset: crate::__u64, ++ pub src_length: crate::__u64, ++ pub dest_offset: crate::__u64, ++ } ++ ++ pub struct __c_anonymous_ifru_map { ++ pub mem_start: c_ulong, ++ pub mem_end: c_ulong, ++ pub base_addr: c_ushort, ++ pub irq: c_uchar, ++ pub dma: c_uchar, ++ pub port: c_uchar, ++ } ++ ++ pub struct in6_ifreq { ++ pub ifr6_addr: crate::in6_addr, ++ pub ifr6_prefixlen: u32, ++ pub ifr6_ifindex: c_int, ++ } ++ ++ pub struct option { ++ pub name: *const c_char, ++ pub has_arg: c_int, ++ pub flag: *mut c_int, ++ pub val: c_int, ++ } ++ ++ // linux/openat2.h ++ #[non_exhaustive] ++ pub struct open_how { ++ pub flags: crate::__u64, ++ pub mode: crate::__u64, ++ pub resolve: crate::__u64, ++ } ++ ++ // linux/ptp_clock.h ++ pub struct ptp_clock_time { ++ pub sec: crate::__s64, ++ pub nsec: __u32, ++ pub reserved: __u32, ++ } ++ ++ pub struct ptp_extts_request { ++ pub index: c_uint, ++ pub flags: c_uint, ++ pub rsv: [c_uint; 2], ++ } ++ ++ pub struct ptp_sys_offset_extended { ++ pub n_samples: c_uint, ++ pub clockid: __kernel_clockid_t, ++ pub rsv: [c_uint; 2], ++ pub ts: [[ptp_clock_time; 3]; PTP_MAX_SAMPLES as usize], ++ } ++ ++ pub struct ptp_sys_offset_precise { ++ pub device: ptp_clock_time, ++ pub sys_realtime: ptp_clock_time, ++ pub sys_monoraw: ptp_clock_time, ++ pub rsv: [c_uint; 4], ++ } ++ ++ pub struct ptp_extts_event { ++ pub t: ptp_clock_time, ++ index: c_uint, ++ flags: c_uint, ++ rsv: [c_uint; 2], ++ } ++ ++ // linux/sctp.h ++ ++ pub struct sctp_initmsg { ++ pub sinit_num_ostreams: __u16, ++ pub sinit_max_instreams: __u16, ++ pub sinit_max_attempts: __u16, ++ pub sinit_max_init_timeo: __u16, ++ } ++ ++ pub struct sctp_sndrcvinfo { ++ pub sinfo_stream: __u16, ++ pub sinfo_ssn: __u16, ++ pub sinfo_flags: __u16, ++ pub sinfo_ppid: __u32, ++ pub sinfo_context: __u32, ++ pub sinfo_timetolive: __u32, ++ pub sinfo_tsn: __u32, ++ pub sinfo_cumtsn: __u32, ++ pub sinfo_assoc_id: crate::sctp_assoc_t, ++ } ++ ++ pub struct sctp_sndinfo { ++ pub snd_sid: __u16, ++ pub snd_flags: __u16, ++ pub snd_ppid: __u32, ++ pub snd_context: __u32, ++ pub snd_assoc_id: crate::sctp_assoc_t, ++ } ++ ++ pub struct sctp_rcvinfo { ++ pub rcv_sid: __u16, ++ pub rcv_ssn: __u16, ++ pub rcv_flags: __u16, ++ pub rcv_ppid: __u32, ++ pub rcv_tsn: __u32, ++ pub rcv_cumtsn: __u32, ++ pub rcv_context: __u32, ++ pub rcv_assoc_id: crate::sctp_assoc_t, ++ } ++ ++ pub struct sctp_nxtinfo { ++ pub nxt_sid: __u16, ++ pub nxt_flags: __u16, ++ pub nxt_ppid: __u32, ++ pub nxt_length: __u32, ++ pub nxt_assoc_id: crate::sctp_assoc_t, ++ } ++ ++ pub struct sctp_prinfo { ++ pub pr_policy: __u16, ++ pub pr_value: __u32, ++ } ++ ++ pub struct sctp_authinfo { ++ pub auth_keynumber: __u16, ++ } ++ ++ pub struct rlimit64 { ++ pub rlim_cur: rlim64_t, ++ pub rlim_max: rlim64_t, ++ } ++ ++ // linux/tls.h ++ ++ pub struct tls_crypto_info { ++ pub version: __u16, ++ pub cipher_type: __u16, ++ } ++ ++ pub struct tls12_crypto_info_aes_gcm_128 { ++ pub info: tls_crypto_info, ++ pub iv: [c_uchar; TLS_CIPHER_AES_GCM_128_IV_SIZE], ++ pub key: [c_uchar; TLS_CIPHER_AES_GCM_128_KEY_SIZE], ++ pub salt: [c_uchar; TLS_CIPHER_AES_GCM_128_SALT_SIZE], ++ pub rec_seq: [c_uchar; TLS_CIPHER_AES_GCM_128_REC_SEQ_SIZE], ++ } ++ ++ pub struct tls12_crypto_info_aes_gcm_256 { ++ pub info: tls_crypto_info, ++ pub iv: [c_uchar; TLS_CIPHER_AES_GCM_256_IV_SIZE], ++ pub key: [c_uchar; TLS_CIPHER_AES_GCM_256_KEY_SIZE], ++ pub salt: [c_uchar; TLS_CIPHER_AES_GCM_256_SALT_SIZE], ++ pub rec_seq: [c_uchar; TLS_CIPHER_AES_GCM_256_REC_SEQ_SIZE], ++ } ++ ++ pub struct tls12_crypto_info_chacha20_poly1305 { ++ pub info: tls_crypto_info, ++ pub iv: [c_uchar; TLS_CIPHER_CHACHA20_POLY1305_IV_SIZE], ++ pub key: [c_uchar; TLS_CIPHER_CHACHA20_POLY1305_KEY_SIZE], ++ pub salt: [c_uchar; TLS_CIPHER_CHACHA20_POLY1305_SALT_SIZE], ++ pub rec_seq: [c_uchar; TLS_CIPHER_CHACHA20_POLY1305_REC_SEQ_SIZE], ++ } ++ ++ // linux/wireless.h ++ ++ pub struct iw_param { ++ pub value: __s32, ++ pub fixed: __u8, ++ pub disabled: __u8, ++ pub flags: __u16, ++ } ++ ++ pub struct iw_point { ++ pub pointer: *mut c_void, ++ pub length: __u16, ++ pub flags: __u16, ++ } ++ ++ pub struct iw_freq { ++ pub m: __s32, ++ pub e: __s16, ++ pub i: __u8, ++ pub flags: __u8, ++ } ++ ++ pub struct iw_quality { ++ pub qual: __u8, ++ pub level: __u8, ++ pub noise: __u8, ++ pub updated: __u8, ++ } ++ ++ pub struct iw_discarded { ++ pub nwid: __u32, ++ pub code: __u32, ++ pub fragment: __u32, ++ pub retries: __u32, ++ pubmisc: __u32, ++ } ++ ++ pub struct iw_missed { ++ pub beacon: __u32, ++ } ++ ++ pub struct iw_scan_req { ++ pub scan_type: __u8, ++ pub essid_len: __u8, ++ pub num_channels: __u8, ++ pub flags: __u8, ++ pub bssid: crate::sockaddr, ++ pub essid: [__u8; IW_ESSID_MAX_SIZE], ++ pub min_channel_time: __u32, ++ pub max_channel_time: __u32, ++ pub channel_list: [iw_freq; IW_MAX_FREQUENCIES], ++ } ++ ++ pub struct iw_encode_ext { ++ pub ext_flags: __u32, ++ pub tx_seq: [__u8; IW_ENCODE_SEQ_MAX_SIZE], ++ pub rx_seq: [__u8; IW_ENCODE_SEQ_MAX_SIZE], ++ pub addr: crate::sockaddr, ++ pub alg: __u16, ++ pub key_len: __u16, ++ pub key: [__u8; 0], ++ } ++ ++ pub struct iw_pmksa { ++ pub cmd: __u32, ++ pub bssid: crate::sockaddr, ++ pub pmkid: [__u8; IW_PMKID_LEN], ++ } ++ ++ pub struct iw_pmkid_cand { ++ pub flags: __u32, ++ pub index: __u32, ++ pub bssid: crate::sockaddr, ++ } ++ ++ pub struct iw_statistics { ++ pub status: __u16, ++ pub qual: iw_quality, ++ pub discard: iw_discarded, ++ pub miss: iw_missed, ++ } ++ ++ pub struct iw_range { ++ pub throughput: __u32, ++ pub min_nwid: __u32, ++ pub max_nwid: __u32, ++ pub old_num_channels: __u16, ++ pub old_num_frequency: __u8, ++ pub scan_capa: __u8, ++ pub event_capa: [__u32; 6], ++ pub sensitivity: __s32, ++ pub max_qual: iw_quality, ++ pub avg_qual: iw_quality, ++ pub num_bitrates: __u8, ++ pub bitrate: [__s32; IW_MAX_BITRATES], ++ pub min_rts: __s32, ++ pub max_rts: __s32, ++ pub min_frag: __s32, ++ pub max_frag: __s32, ++ pub min_pmp: __s32, ++ pub max_pmp: __s32, ++ pub min_pmt: __s32, ++ pub max_pmt: __s32, ++ pub pmp_flags: __u16, ++ pub pmt_flags: __u16, ++ pub pm_capa: __u16, ++ pub encoding_size: [__u16; IW_MAX_ENCODING_SIZES], ++ pub num_encoding_sizes: __u8, ++ pub max_encoding_tokens: __u8, ++ pub encoding_login_index: __u8, ++ pub txpower_capa: __u16, ++ pub num_txpower: __u8, ++ pub txpower: [__s32; IW_MAX_TXPOWER], ++ pub we_version_compiled: __u8, ++ pub we_version_source: __u8, ++ pub retry_capa: __u16, ++ pub retry_flags: __u16, ++ pub r_time_flags: __u16, ++ pub min_retry: __s32, ++ pub max_retry: __s32, ++ pub min_r_time: __s32, ++ pub max_r_time: __s32, ++ pub num_channels: __u16, ++ pub num_frequency: __u8, ++ pub freq: [iw_freq; IW_MAX_FREQUENCIES], ++ pub enc_capa: __u32, ++ } ++ ++ pub struct iw_priv_args { ++ pub cmd: __u32, ++ pub set_args: __u16, ++ pub get_args: __u16, ++ pub name: [c_char; crate::IFNAMSIZ], ++ } ++ ++ // #include ++ ++ pub struct epoll_params { ++ pub busy_poll_usecs: u32, ++ pub busy_poll_budget: u16, ++ pub prefer_busy_poll: u8, ++ pub __pad: u8, // Must be zero ++ } ++ ++ #[cfg_attr( ++ any( ++ target_pointer_width = "32", ++ target_arch = "x86_64", ++ target_arch = "powerpc64", ++ target_arch = "mips64", ++ target_arch = "mips64r6", ++ target_arch = "s390x", ++ target_arch = "sparc64", ++ target_arch = "aarch64", ++ target_arch = "riscv64", ++ target_arch = "riscv32", ++ target_arch = "loongarch64" ++ ), ++ repr(align(4)) ++ )] ++ #[cfg_attr( ++ not(any( ++ target_pointer_width = "32", ++ target_arch = "x86_64", ++ target_arch = "powerpc64", ++ target_arch = "mips64", ++ target_arch = "mips64r6", ++ target_arch = "s390x", ++ target_arch = "sparc64", ++ target_arch = "aarch64", ++ target_arch = "riscv64", ++ target_arch = "riscv32", ++ target_arch = "loongarch64" ++ )), ++ repr(align(8)) ++ )] ++ pub struct pthread_mutexattr_t { ++ #[doc(hidden)] ++ size: [u8; crate::__SIZEOF_PTHREAD_MUTEXATTR_T], ++ } ++ ++ #[cfg_attr( ++ any(target_env = "musl", target_env = "ohos", target_pointer_width = "32"), ++ repr(align(4)) ++ )] ++ #[cfg_attr( ++ all( ++ not(target_env = "musl"), ++ not(target_env = "ohos"), ++ target_pointer_width = "64" ++ ), ++ repr(align(8)) ++ )] ++ pub struct pthread_rwlockattr_t { ++ #[doc(hidden)] ++ size: [u8; crate::__SIZEOF_PTHREAD_RWLOCKATTR_T], ++ } ++ ++ #[repr(align(4))] ++ pub struct pthread_condattr_t { ++ #[doc(hidden)] ++ size: [u8; crate::__SIZEOF_PTHREAD_CONDATTR_T], ++ } ++ ++ #[repr(align(4))] ++ pub struct pthread_barrierattr_t { ++ #[doc(hidden)] ++ size: [u8; crate::__SIZEOF_PTHREAD_BARRIERATTR_T], ++ } ++ ++ #[repr(align(8))] ++ pub struct fanotify_event_metadata { ++ pub event_len: __u32, ++ pub vers: __u8, ++ pub reserved: __u8, ++ pub metadata_len: __u16, ++ pub mask: __u64, ++ pub fd: c_int, ++ pub pid: c_int, ++ } ++ ++ // linux/ptp_clock.h ++ ++ pub struct ptp_sys_offset { ++ pub n_samples: c_uint, ++ pub rsv: [c_uint; 3], ++ // FIXME(garando): replace length with `2 * PTP_MAX_SAMPLES + 1` when supported ++ pub ts: [ptp_clock_time; 51], ++ } ++ ++ pub struct ptp_pin_desc { ++ pub name: [c_char; 64], ++ pub index: c_uint, ++ pub func: c_uint, ++ pub chan: c_uint, ++ pub rsv: [c_uint; 5], ++ } ++ ++ pub struct ptp_clock_caps { ++ pub max_adj: c_int, ++ pub n_alarm: c_int, ++ pub n_ext_ts: c_int, ++ pub n_per_out: c_int, ++ pub pps: c_int, ++ pub n_pins: c_int, ++ pub cross_timestamping: c_int, ++ pub adjust_phase: c_int, ++ pub max_phase_adj: c_int, ++ pub rsv: [c_int; 11], ++ } ++ ++ // linux/if_xdp.h ++ pub struct xsk_tx_metadata_completion { ++ pub tx_timestamp: crate::__u64, ++ } ++ ++ pub struct xsk_tx_metadata_request { ++ pub csum_start: __u16, ++ pub csum_offset: __u16, ++ } ++ ++ // linux/mount.h ++ ++ pub struct mount_attr { ++ pub attr_set: crate::__u64, ++ pub attr_clr: crate::__u64, ++ pub propagation: crate::__u64, ++ pub userns_fd: crate::__u64, ++ } ++} ++ ++cfg_if! { ++ if #[cfg(not(target_arch = "sparc64"))] { ++ s! { ++ pub struct iw_thrspy { ++ pub addr: crate::sockaddr, ++ pub qual: iw_quality, ++ pub low: iw_quality, ++ pub high: iw_quality, ++ } ++ ++ pub struct iw_mlme { ++ pub cmd: __u16, ++ pub reason_code: __u16, ++ pub addr: crate::sockaddr, ++ } ++ ++ pub struct iw_michaelmicfailure { ++ pub flags: __u32, ++ pub src_addr: crate::sockaddr, ++ pub tsc: [__u8; IW_ENCODE_SEQ_MAX_SIZE], ++ } ++ ++ pub struct __c_anonymous_elf32_rela { ++ pub r_offset: Elf32_Addr, ++ pub r_info: Elf32_Word, ++ pub r_addend: Elf32_Sword, ++ } ++ ++ pub struct __c_anonymous_elf64_rela { ++ pub r_offset: Elf64_Addr, ++ pub r_info: Elf64_Xword, ++ pub r_addend: Elf64_Sxword, ++ } ++ } ++ } ++} ++ ++s_no_extra_traits! { ++ pub struct sockaddr_nl { ++ pub nl_family: crate::sa_family_t, ++ nl_pad: c_ushort, ++ pub nl_pid: u32, ++ pub nl_groups: u32, ++ } ++ ++ pub struct dirent { ++ pub d_ino: crate::ino_t, ++ pub d_off: off_t, ++ pub d_reclen: c_ushort, ++ pub d_type: c_uchar, ++ pub d_name: [c_char; 256], ++ } ++ ++ pub struct sockaddr_alg { ++ pub salg_family: crate::sa_family_t, ++ pub salg_type: [c_uchar; 14], ++ pub salg_feat: u32, ++ pub salg_mask: u32, ++ pub salg_name: [c_uchar; 64], ++ } ++ ++ pub struct uinput_setup { ++ pub id: input_id, ++ pub name: [c_char; UINPUT_MAX_NAME_SIZE], ++ pub ff_effects_max: __u32, ++ } ++ ++ pub struct uinput_user_dev { ++ pub name: [c_char; UINPUT_MAX_NAME_SIZE], ++ pub id: input_id, ++ pub ff_effects_max: __u32, ++ pub absmax: [__s32; ABS_CNT], ++ pub absmin: [__s32; ABS_CNT], ++ pub absfuzz: [__s32; ABS_CNT], ++ pub absflat: [__s32; ABS_CNT], ++ } ++ ++ /// WARNING: The `PartialEq`, `Eq` and `Hash` implementations of this ++ /// type are unsound and will be removed in the future. ++ #[deprecated( ++ note = "this struct has unsafe trait implementations that will be \ ++ removed in the future", ++ since = "0.2.80" ++ )] ++ pub struct af_alg_iv { ++ pub ivlen: u32, ++ pub iv: [c_uchar; 0], ++ } ++ ++ // x32 compatibility ++ // See https://sourceware.org/bugzilla/show_bug.cgi?id=21279 ++ pub struct mq_attr { ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ pub mq_flags: i64, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ pub mq_maxmsg: i64, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ pub mq_msgsize: i64, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ pub mq_curmsgs: i64, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ pad: [i64; 4], ++ ++ #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] ++ pub mq_flags: c_long, ++ #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] ++ pub mq_maxmsg: c_long, ++ #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] ++ pub mq_msgsize: c_long, ++ #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] ++ pub mq_curmsgs: c_long, ++ #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] ++ pad: [c_long; 4], ++ } ++ ++ pub union __c_anonymous_ifr_ifru { ++ pub ifru_addr: crate::sockaddr, ++ pub ifru_dstaddr: crate::sockaddr, ++ pub ifru_broadaddr: crate::sockaddr, ++ pub ifru_netmask: crate::sockaddr, ++ pub ifru_hwaddr: crate::sockaddr, ++ pub ifru_flags: c_short, ++ pub ifru_ifindex: c_int, ++ pub ifru_metric: c_int, ++ pub ifru_mtu: c_int, ++ pub ifru_map: __c_anonymous_ifru_map, ++ pub ifru_slave: [c_char; crate::IFNAMSIZ], ++ pub ifru_newname: [c_char; crate::IFNAMSIZ], ++ pub ifru_data: *mut c_char, ++ } ++ ++ pub struct ifreq { ++ /// interface name, e.g. "en0" ++ pub ifr_name: [c_char; crate::IFNAMSIZ], ++ pub ifr_ifru: __c_anonymous_ifr_ifru, ++ } ++ ++ pub union __c_anonymous_ifc_ifcu { ++ pub ifcu_buf: *mut c_char, ++ pub ifcu_req: *mut crate::ifreq, ++ } ++ ++ /// Structure used in SIOCGIFCONF request. Used to retrieve interface configuration for ++ /// machine (useful for programs which must know all networks accessible). ++ pub struct ifconf { ++ /// Size of buffer ++ pub ifc_len: c_int, ++ pub ifc_ifcu: __c_anonymous_ifc_ifcu, ++ } ++ ++ pub struct hwtstamp_config { ++ pub flags: c_int, ++ pub tx_type: c_int, ++ pub rx_filter: c_int, ++ } ++ ++ pub struct dirent64 { ++ pub d_ino: crate::ino64_t, ++ pub d_off: off64_t, ++ pub d_reclen: c_ushort, ++ pub d_type: c_uchar, ++ pub d_name: [c_char; 256], ++ } ++ ++ pub struct sched_attr { ++ pub size: __u32, ++ pub sched_policy: __u32, ++ pub sched_flags: crate::__u64, ++ pub sched_nice: __s32, ++ pub sched_priority: __u32, ++ pub sched_runtime: crate::__u64, ++ pub sched_deadline: crate::__u64, ++ pub sched_period: crate::__u64, ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub union tpacket_req_u { ++ pub req: crate::tpacket_req, ++ pub req3: crate::tpacket_req3, ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub union tpacket_bd_header_u { ++ pub bh1: crate::tpacket_hdr_v1, ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub struct tpacket_block_desc { ++ pub version: __u32, ++ pub offset_to_priv: __u32, ++ pub hdr: crate::tpacket_bd_header_u, ++ } ++ ++ #[cfg_attr( ++ all( ++ any(target_env = "musl", target_env = "ohos"), ++ target_pointer_width = "32" ++ ), ++ repr(align(4)) ++ )] ++ #[cfg_attr( ++ all( ++ any(target_env = "musl", target_env = "ohos"), ++ target_pointer_width = "64" ++ ), ++ repr(align(8)) ++ )] ++ #[cfg_attr( ++ all( ++ not(any(target_env = "musl", target_env = "ohos")), ++ target_arch = "x86" ++ ), ++ repr(align(4)) ++ )] ++ #[cfg_attr( ++ all( ++ not(any(target_env = "musl", target_env = "ohos")), ++ not(target_arch = "x86") ++ ), ++ repr(align(8)) ++ )] ++ pub struct pthread_cond_t { ++ #[doc(hidden)] ++ size: [u8; crate::__SIZEOF_PTHREAD_COND_T], ++ } ++ ++ #[cfg_attr( ++ all( ++ target_pointer_width = "32", ++ any( ++ target_arch = "mips", ++ target_arch = "mips32r6", ++ target_arch = "arm", ++ target_arch = "hexagon", ++ target_arch = "m68k", ++ target_arch = "csky", ++ target_arch = "powerpc", ++ target_arch = "sparc", ++ target_arch = "x86_64", ++ target_arch = "x86" ++ ) ++ ), ++ repr(align(4)) ++ )] ++ #[cfg_attr( ++ any( ++ target_pointer_width = "64", ++ not(any( ++ target_arch = "mips", ++ target_arch = "mips32r6", ++ target_arch = "arm", ++ target_arch = "hexagon", ++ target_arch = "m68k", ++ target_arch = "csky", ++ target_arch = "powerpc", ++ target_arch = "sparc", ++ target_arch = "x86_64", ++ target_arch = "x86" ++ )) ++ ), ++ repr(align(8)) ++ )] ++ pub struct pthread_mutex_t { ++ #[doc(hidden)] ++ size: [u8; crate::__SIZEOF_PTHREAD_MUTEX_T], ++ } ++ ++ #[cfg_attr( ++ all( ++ target_pointer_width = "32", ++ any( ++ target_arch = "mips", ++ target_arch = "mips32r6", ++ target_arch = "arm", ++ target_arch = "hexagon", ++ target_arch = "m68k", ++ target_arch = "csky", ++ target_arch = "powerpc", ++ target_arch = "sparc", ++ target_arch = "x86_64", ++ target_arch = "x86" ++ ) ++ ), ++ repr(align(4)) ++ )] ++ #[cfg_attr( ++ any( ++ target_pointer_width = "64", ++ not(any( ++ target_arch = "mips", ++ target_arch = "mips32r6", ++ target_arch = "arm", ++ target_arch = "hexagon", ++ target_arch = "m68k", ++ target_arch = "powerpc", ++ target_arch = "sparc", ++ target_arch = "x86_64", ++ target_arch = "x86" ++ )) ++ ), ++ repr(align(8)) ++ )] ++ pub struct pthread_rwlock_t { ++ size: [u8; crate::__SIZEOF_PTHREAD_RWLOCK_T], ++ } ++ ++ #[cfg_attr( ++ all( ++ target_pointer_width = "32", ++ any( ++ target_arch = "mips", ++ target_arch = "mips32r6", ++ target_arch = "arm", ++ target_arch = "hexagon", ++ target_arch = "m68k", ++ target_arch = "csky", ++ target_arch = "powerpc", ++ target_arch = "sparc", ++ target_arch = "x86_64", ++ target_arch = "x86" ++ ) ++ ), ++ repr(align(4)) ++ )] ++ #[cfg_attr( ++ any( ++ target_pointer_width = "64", ++ not(any( ++ target_arch = "mips", ++ target_arch = "mips32r6", ++ target_arch = "arm", ++ target_arch = "hexagon", ++ target_arch = "m68k", ++ target_arch = "csky", ++ target_arch = "powerpc", ++ target_arch = "sparc", ++ target_arch = "x86_64", ++ target_arch = "x86" ++ )) ++ ), ++ repr(align(8)) ++ )] ++ pub struct pthread_barrier_t { ++ size: [u8; crate::__SIZEOF_PTHREAD_BARRIER_T], ++ } ++ ++ // linux/net_tstamp.h ++ #[allow(missing_debug_implementations)] ++ pub struct sock_txtime { ++ pub clockid: crate::clockid_t, ++ pub flags: __u32, ++ } ++ ++ // linux/can.h ++ #[repr(align(8))] ++ #[allow(missing_debug_implementations)] ++ pub struct can_frame { ++ pub can_id: canid_t, ++ // FIXME(1.0): this field was renamed to `len` in Linux 5.11 ++ pub can_dlc: u8, ++ __pad: u8, ++ __res0: u8, ++ pub len8_dlc: u8, ++ pub data: [u8; CAN_MAX_DLEN], ++ } ++ ++ #[repr(align(8))] ++ #[allow(missing_debug_implementations)] ++ pub struct canfd_frame { ++ pub can_id: canid_t, ++ pub len: u8, ++ pub flags: u8, ++ __res0: u8, ++ __res1: u8, ++ pub data: [u8; CANFD_MAX_DLEN], ++ } ++ ++ #[repr(align(8))] ++ #[allow(missing_debug_implementations)] ++ pub struct canxl_frame { ++ pub prio: canid_t, ++ pub flags: u8, ++ pub sdt: u8, ++ pub len: u16, ++ pub af: u32, ++ pub data: [u8; CANXL_MAX_DLEN], ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub union __c_anonymous_sockaddr_can_can_addr { ++ pub tp: __c_anonymous_sockaddr_can_tp, ++ pub j1939: __c_anonymous_sockaddr_can_j1939, ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub struct sockaddr_can { ++ pub can_family: crate::sa_family_t, ++ pub can_ifindex: c_int, ++ pub can_addr: __c_anonymous_sockaddr_can_can_addr, ++ } ++ ++ // linux/wireless.h ++ pub union iwreq_data { ++ pub name: [c_char; crate::IFNAMSIZ], ++ pub essid: iw_point, ++ pub nwid: iw_param, ++ pub freq: iw_freq, ++ pub sens: iw_param, ++ pub bitrate: iw_param, ++ pub txpower: iw_param, ++ pub rts: iw_param, ++ pub frag: iw_param, ++ pub mode: __u32, ++ pub retry: iw_param, ++ pub encoding: iw_point, ++ pub power: iw_param, ++ pub qual: iw_quality, ++ pub ap_addr: crate::sockaddr, ++ pub addr: crate::sockaddr, ++ pub param: iw_param, ++ pub data: iw_point, ++ } ++ ++ pub struct iw_event { ++ pub len: __u16, ++ pub cmd: __u16, ++ pub u: iwreq_data, ++ } ++ ++ pub union __c_anonymous_iwreq { ++ pub ifrn_name: [c_char; crate::IFNAMSIZ], ++ } ++ ++ pub struct iwreq { ++ pub ifr_ifrn: __c_anonymous_iwreq, ++ pub u: iwreq_data, ++ } ++ ++ // linux/ptp_clock.h ++ pub union __c_anonymous_ptp_perout_request_1 { ++ pub start: ptp_clock_time, ++ pub phase: ptp_clock_time, ++ } ++ ++ pub union __c_anonymous_ptp_perout_request_2 { ++ pub on: ptp_clock_time, ++ pub rsv: [c_uint; 4], ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub struct ptp_perout_request { ++ pub anonymous_1: __c_anonymous_ptp_perout_request_1, ++ pub period: ptp_clock_time, ++ pub index: c_uint, ++ pub flags: c_uint, ++ pub anonymous_2: __c_anonymous_ptp_perout_request_2, ++ } ++ ++ // linux/if_xdp.h ++ #[allow(missing_debug_implementations)] ++ pub struct xsk_tx_metadata { ++ pub flags: crate::__u64, ++ pub xsk_tx_metadata_union: __c_anonymous_xsk_tx_metadata_union, ++ } ++ ++ pub union __c_anonymous_xsk_tx_metadata_union { ++ pub request: xsk_tx_metadata_request, ++ pub completion: xsk_tx_metadata_completion, ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for sockaddr_nl { ++ fn eq(&self, other: &sockaddr_nl) -> bool { ++ self.nl_family == other.nl_family ++ && self.nl_pid == other.nl_pid ++ && self.nl_groups == other.nl_groups ++ } ++ } ++ impl Eq for sockaddr_nl {} ++ impl fmt::Debug for sockaddr_nl { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sockaddr_nl") ++ .field("nl_family", &self.nl_family) ++ .field("nl_pid", &self.nl_pid) ++ .field("nl_groups", &self.nl_groups) ++ .finish() ++ } ++ } ++ impl hash::Hash for sockaddr_nl { ++ fn hash(&self, state: &mut H) { ++ self.nl_family.hash(state); ++ self.nl_pid.hash(state); ++ self.nl_groups.hash(state); ++ } ++ } ++ ++ impl PartialEq for dirent { ++ fn eq(&self, other: &dirent) -> bool { ++ self.d_ino == other.d_ino ++ && self.d_off == other.d_off ++ && self.d_reclen == other.d_reclen ++ && self.d_type == other.d_type ++ && self ++ .d_name ++ .iter() ++ .zip(other.d_name.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ ++ impl Eq for dirent {} ++ ++ impl fmt::Debug for dirent { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("dirent") ++ .field("d_ino", &self.d_ino) ++ .field("d_off", &self.d_off) ++ .field("d_reclen", &self.d_reclen) ++ .field("d_type", &self.d_type) ++ // FIXME: .field("d_name", &self.d_name) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for dirent { ++ fn hash(&self, state: &mut H) { ++ self.d_ino.hash(state); ++ self.d_off.hash(state); ++ self.d_reclen.hash(state); ++ self.d_type.hash(state); ++ self.d_name.hash(state); ++ } ++ } ++ ++ impl PartialEq for dirent64 { ++ fn eq(&self, other: &dirent64) -> bool { ++ self.d_ino == other.d_ino ++ && self.d_off == other.d_off ++ && self.d_reclen == other.d_reclen ++ && self.d_type == other.d_type ++ && self ++ .d_name ++ .iter() ++ .zip(other.d_name.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ ++ impl Eq for dirent64 {} ++ ++ impl fmt::Debug for dirent64 { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("dirent64") ++ .field("d_ino", &self.d_ino) ++ .field("d_off", &self.d_off) ++ .field("d_reclen", &self.d_reclen) ++ .field("d_type", &self.d_type) ++ // FIXME: .field("d_name", &self.d_name) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for dirent64 { ++ fn hash(&self, state: &mut H) { ++ self.d_ino.hash(state); ++ self.d_off.hash(state); ++ self.d_reclen.hash(state); ++ self.d_type.hash(state); ++ self.d_name.hash(state); ++ } ++ } ++ ++ impl PartialEq for pthread_cond_t { ++ fn eq(&self, other: &pthread_cond_t) -> bool { ++ self.size.iter().zip(other.size.iter()).all(|(a, b)| a == b) ++ } ++ } ++ ++ impl Eq for pthread_cond_t {} ++ ++ impl fmt::Debug for pthread_cond_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("pthread_cond_t") ++ // FIXME: .field("size", &self.size) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for pthread_cond_t { ++ fn hash(&self, state: &mut H) { ++ self.size.hash(state); ++ } ++ } ++ ++ impl PartialEq for pthread_mutex_t { ++ fn eq(&self, other: &pthread_mutex_t) -> bool { ++ self.size.iter().zip(other.size.iter()).all(|(a, b)| a == b) ++ } ++ } ++ ++ impl Eq for pthread_mutex_t {} ++ ++ impl fmt::Debug for pthread_mutex_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("pthread_mutex_t") ++ // FIXME: .field("size", &self.size) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for pthread_mutex_t { ++ fn hash(&self, state: &mut H) { ++ self.size.hash(state); ++ } ++ } ++ ++ impl PartialEq for pthread_rwlock_t { ++ fn eq(&self, other: &pthread_rwlock_t) -> bool { ++ self.size.iter().zip(other.size.iter()).all(|(a, b)| a == b) ++ } ++ } ++ ++ impl Eq for pthread_rwlock_t {} ++ ++ impl fmt::Debug for pthread_rwlock_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("pthread_rwlock_t") ++ // FIXME: .field("size", &self.size) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for pthread_rwlock_t { ++ fn hash(&self, state: &mut H) { ++ self.size.hash(state); ++ } ++ } ++ ++ impl PartialEq for pthread_barrier_t { ++ fn eq(&self, other: &pthread_barrier_t) -> bool { ++ self.size.iter().zip(other.size.iter()).all(|(a, b)| a == b) ++ } ++ } ++ ++ impl Eq for pthread_barrier_t {} ++ ++ impl fmt::Debug for pthread_barrier_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("pthread_barrier_t") ++ .field("size", &self.size) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for pthread_barrier_t { ++ fn hash(&self, state: &mut H) { ++ self.size.hash(state); ++ } ++ } ++ ++ impl PartialEq for sockaddr_alg { ++ fn eq(&self, other: &sockaddr_alg) -> bool { ++ self.salg_family == other.salg_family ++ && self ++ .salg_type ++ .iter() ++ .zip(other.salg_type.iter()) ++ .all(|(a, b)| a == b) ++ && self.salg_feat == other.salg_feat ++ && self.salg_mask == other.salg_mask ++ && self ++ .salg_name ++ .iter() ++ .zip(other.salg_name.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ ++ impl Eq for sockaddr_alg {} ++ ++ impl fmt::Debug for sockaddr_alg { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sockaddr_alg") ++ .field("salg_family", &self.salg_family) ++ .field("salg_type", &self.salg_type) ++ .field("salg_feat", &self.salg_feat) ++ .field("salg_mask", &self.salg_mask) ++ .field("salg_name", &&self.salg_name[..]) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for sockaddr_alg { ++ fn hash(&self, state: &mut H) { ++ self.salg_family.hash(state); ++ self.salg_type.hash(state); ++ self.salg_feat.hash(state); ++ self.salg_mask.hash(state); ++ self.salg_name.hash(state); ++ } ++ } ++ ++ impl PartialEq for uinput_setup { ++ fn eq(&self, other: &uinput_setup) -> bool { ++ self.id == other.id ++ && self.name[..] == other.name[..] ++ && self.ff_effects_max == other.ff_effects_max ++ } ++ } ++ impl Eq for uinput_setup {} ++ ++ impl fmt::Debug for uinput_setup { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("uinput_setup") ++ .field("id", &self.id) ++ .field("name", &&self.name[..]) ++ .field("ff_effects_max", &self.ff_effects_max) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for uinput_setup { ++ fn hash(&self, state: &mut H) { ++ self.id.hash(state); ++ self.name.hash(state); ++ self.ff_effects_max.hash(state); ++ } ++ } ++ ++ impl PartialEq for uinput_user_dev { ++ fn eq(&self, other: &uinput_user_dev) -> bool { ++ self.name[..] == other.name[..] ++ && self.id == other.id ++ && self.ff_effects_max == other.ff_effects_max ++ && self.absmax[..] == other.absmax[..] ++ && self.absmin[..] == other.absmin[..] ++ && self.absfuzz[..] == other.absfuzz[..] ++ && self.absflat[..] == other.absflat[..] ++ } ++ } ++ impl Eq for uinput_user_dev {} ++ ++ impl fmt::Debug for uinput_user_dev { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("uinput_setup") ++ .field("name", &&self.name[..]) ++ .field("id", &self.id) ++ .field("ff_effects_max", &self.ff_effects_max) ++ .field("absmax", &&self.absmax[..]) ++ .field("absmin", &&self.absmin[..]) ++ .field("absfuzz", &&self.absfuzz[..]) ++ .field("absflat", &&self.absflat[..]) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for uinput_user_dev { ++ fn hash(&self, state: &mut H) { ++ self.name.hash(state); ++ self.id.hash(state); ++ self.ff_effects_max.hash(state); ++ self.absmax.hash(state); ++ self.absmin.hash(state); ++ self.absfuzz.hash(state); ++ self.absflat.hash(state); ++ } ++ } ++ ++ #[allow(deprecated)] ++ impl af_alg_iv { ++ fn as_slice(&self) -> &[u8] { ++ unsafe { ::core::slice::from_raw_parts(self.iv.as_ptr(), self.ivlen as usize) } ++ } ++ } ++ ++ #[allow(deprecated)] ++ impl PartialEq for af_alg_iv { ++ fn eq(&self, other: &af_alg_iv) -> bool { ++ *self.as_slice() == *other.as_slice() ++ } ++ } ++ ++ #[allow(deprecated)] ++ impl Eq for af_alg_iv {} ++ ++ #[allow(deprecated)] ++ impl fmt::Debug for af_alg_iv { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("af_alg_iv") ++ .field("ivlen", &self.ivlen) ++ .finish() ++ } ++ } ++ ++ #[allow(deprecated)] ++ impl hash::Hash for af_alg_iv { ++ fn hash(&self, state: &mut H) { ++ self.as_slice().hash(state); ++ } ++ } ++ ++ impl PartialEq for mq_attr { ++ fn eq(&self, other: &mq_attr) -> bool { ++ self.mq_flags == other.mq_flags ++ && self.mq_maxmsg == other.mq_maxmsg ++ && self.mq_msgsize == other.mq_msgsize ++ && self.mq_curmsgs == other.mq_curmsgs ++ } ++ } ++ impl Eq for mq_attr {} ++ impl fmt::Debug for mq_attr { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("mq_attr") ++ .field("mq_flags", &self.mq_flags) ++ .field("mq_maxmsg", &self.mq_maxmsg) ++ .field("mq_msgsize", &self.mq_msgsize) ++ .field("mq_curmsgs", &self.mq_curmsgs) ++ .finish() ++ } ++ } ++ impl hash::Hash for mq_attr { ++ fn hash(&self, state: &mut H) { ++ self.mq_flags.hash(state); ++ self.mq_maxmsg.hash(state); ++ self.mq_msgsize.hash(state); ++ self.mq_curmsgs.hash(state); ++ } ++ } ++ impl fmt::Debug for ifreq { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("ifreq") ++ .field("ifr_name", &self.ifr_name) ++ .field("ifr_ifru", &self.ifr_ifru) ++ .finish() ++ } ++ } ++ impl fmt::Debug for ifconf { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("ifconf") ++ .field("ifc_len", &self.ifc_len) ++ .field("ifc_ifcu", &self.ifc_ifcu) ++ .finish() ++ } ++ } ++ impl fmt::Debug for hwtstamp_config { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("hwtstamp_config") ++ .field("flags", &self.flags) ++ .field("tx_type", &self.tx_type) ++ .field("rx_filter", &self.rx_filter) ++ .finish() ++ } ++ } ++ impl PartialEq for hwtstamp_config { ++ fn eq(&self, other: &hwtstamp_config) -> bool { ++ self.flags == other.flags ++ && self.tx_type == other.tx_type ++ && self.rx_filter == other.rx_filter ++ } ++ } ++ impl Eq for hwtstamp_config {} ++ impl hash::Hash for hwtstamp_config { ++ fn hash(&self, state: &mut H) { ++ self.flags.hash(state); ++ self.tx_type.hash(state); ++ self.rx_filter.hash(state); ++ } ++ } ++ ++ impl fmt::Debug for sched_attr { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sched_attr") ++ .field("size", &self.size) ++ .field("sched_policy", &self.sched_policy) ++ .field("sched_flags", &self.sched_flags) ++ .field("sched_nice", &self.sched_nice) ++ .field("sched_priority", &self.sched_priority) ++ .field("sched_runtime", &self.sched_runtime) ++ .field("sched_deadline", &self.sched_deadline) ++ .field("sched_period", &self.sched_period) ++ .finish() ++ } ++ } ++ impl PartialEq for sched_attr { ++ fn eq(&self, other: &sched_attr) -> bool { ++ self.size == other.size ++ && self.sched_policy == other.sched_policy ++ && self.sched_flags == other.sched_flags ++ && self.sched_nice == other.sched_nice ++ && self.sched_priority == other.sched_priority ++ && self.sched_runtime == other.sched_runtime ++ && self.sched_deadline == other.sched_deadline ++ && self.sched_period == other.sched_period ++ } ++ } ++ impl Eq for sched_attr {} ++ impl hash::Hash for sched_attr { ++ fn hash(&self, state: &mut H) { ++ self.size.hash(state); ++ self.sched_policy.hash(state); ++ self.sched_flags.hash(state); ++ self.sched_nice.hash(state); ++ self.sched_priority.hash(state); ++ self.sched_runtime.hash(state); ++ self.sched_deadline.hash(state); ++ self.sched_period.hash(state); ++ } ++ } ++ ++ impl fmt::Debug for iw_event { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("iw_event") ++ .field("len", &self.len) ++ .field("cmd", &self.cmd) ++ .field("u", &self.u) ++ .finish() ++ } ++ } ++ ++ impl fmt::Debug for iwreq { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("iwreq") ++ .field("ifr_ifrn", &self.ifr_ifrn) ++ .field("u", &self.u) ++ .finish() ++ } ++ } ++ } ++} ++ ++cfg_if! { ++ if #[cfg(all( ++ any(target_env = "gnu", target_env = "musl", target_env = "ohos"), ++ any(target_arch = "x86_64", target_arch = "x86") ++ ))] { ++ extern "C" { ++ pub fn iopl(level: c_int) -> c_int; ++ pub fn ioperm(from: c_ulong, num: c_ulong, turn_on: c_int) -> c_int; ++ } ++ } ++} ++ ++cfg_if! { ++ if #[cfg(any( ++ target_env = "gnu", ++ target_env = "musl", ++ target_env = "ohos" ++ ))] { ++ pub const ABDAY_1: crate::nl_item = 0x20000; ++ pub const ABDAY_2: crate::nl_item = 0x20001; ++ pub const ABDAY_3: crate::nl_item = 0x20002; ++ pub const ABDAY_4: crate::nl_item = 0x20003; ++ pub const ABDAY_5: crate::nl_item = 0x20004; ++ pub const ABDAY_6: crate::nl_item = 0x20005; ++ pub const ABDAY_7: crate::nl_item = 0x20006; ++ ++ pub const DAY_1: crate::nl_item = 0x20007; ++ pub const DAY_2: crate::nl_item = 0x20008; ++ pub const DAY_3: crate::nl_item = 0x20009; ++ pub const DAY_4: crate::nl_item = 0x2000A; ++ pub const DAY_5: crate::nl_item = 0x2000B; ++ pub const DAY_6: crate::nl_item = 0x2000C; ++ pub const DAY_7: crate::nl_item = 0x2000D; ++ ++ pub const ABMON_1: crate::nl_item = 0x2000E; ++ pub const ABMON_2: crate::nl_item = 0x2000F; ++ pub const ABMON_3: crate::nl_item = 0x20010; ++ pub const ABMON_4: crate::nl_item = 0x20011; ++ pub const ABMON_5: crate::nl_item = 0x20012; ++ pub const ABMON_6: crate::nl_item = 0x20013; ++ pub const ABMON_7: crate::nl_item = 0x20014; ++ pub const ABMON_8: crate::nl_item = 0x20015; ++ pub const ABMON_9: crate::nl_item = 0x20016; ++ pub const ABMON_10: crate::nl_item = 0x20017; ++ pub const ABMON_11: crate::nl_item = 0x20018; ++ pub const ABMON_12: crate::nl_item = 0x20019; ++ ++ pub const MON_1: crate::nl_item = 0x2001A; ++ pub const MON_2: crate::nl_item = 0x2001B; ++ pub const MON_3: crate::nl_item = 0x2001C; ++ pub const MON_4: crate::nl_item = 0x2001D; ++ pub const MON_5: crate::nl_item = 0x2001E; ++ pub const MON_6: crate::nl_item = 0x2001F; ++ pub const MON_7: crate::nl_item = 0x20020; ++ pub const MON_8: crate::nl_item = 0x20021; ++ pub const MON_9: crate::nl_item = 0x20022; ++ pub const MON_10: crate::nl_item = 0x20023; ++ pub const MON_11: crate::nl_item = 0x20024; ++ pub const MON_12: crate::nl_item = 0x20025; ++ ++ pub const AM_STR: crate::nl_item = 0x20026; ++ pub const PM_STR: crate::nl_item = 0x20027; ++ ++ pub const D_T_FMT: crate::nl_item = 0x20028; ++ pub const D_FMT: crate::nl_item = 0x20029; ++ pub const T_FMT: crate::nl_item = 0x2002A; ++ pub const T_FMT_AMPM: crate::nl_item = 0x2002B; ++ ++ pub const ERA: crate::nl_item = 0x2002C; ++ pub const ERA_D_FMT: crate::nl_item = 0x2002E; ++ pub const ALT_DIGITS: crate::nl_item = 0x2002F; ++ pub const ERA_D_T_FMT: crate::nl_item = 0x20030; ++ pub const ERA_T_FMT: crate::nl_item = 0x20031; ++ ++ pub const CODESET: crate::nl_item = 14; ++ pub const CRNCYSTR: crate::nl_item = 0x4000F; ++ pub const RADIXCHAR: crate::nl_item = 0x10000; ++ pub const THOUSEP: crate::nl_item = 0x10001; ++ pub const YESEXPR: crate::nl_item = 0x50000; ++ pub const NOEXPR: crate::nl_item = 0x50001; ++ pub const YESSTR: crate::nl_item = 0x50002; ++ pub const NOSTR: crate::nl_item = 0x50003; ++ } ++} ++ ++pub const RUSAGE_CHILDREN: c_int = -1; ++pub const L_tmpnam: c_uint = 20; ++pub const _PC_LINK_MAX: c_int = 0; ++pub const _PC_MAX_CANON: c_int = 1; ++pub const _PC_MAX_INPUT: c_int = 2; ++pub const _PC_NAME_MAX: c_int = 3; ++pub const _PC_PATH_MAX: c_int = 4; ++pub const _PC_PIPE_BUF: c_int = 5; ++pub const _PC_CHOWN_RESTRICTED: c_int = 6; ++pub const _PC_NO_TRUNC: c_int = 7; ++pub const _PC_VDISABLE: c_int = 8; ++pub const _PC_SYNC_IO: c_int = 9; ++pub const _PC_ASYNC_IO: c_int = 10; ++pub const _PC_PRIO_IO: c_int = 11; ++pub const _PC_SOCK_MAXBUF: c_int = 12; ++pub const _PC_FILESIZEBITS: c_int = 13; ++pub const _PC_REC_INCR_XFER_SIZE: c_int = 14; ++pub const _PC_REC_MAX_XFER_SIZE: c_int = 15; ++pub const _PC_REC_MIN_XFER_SIZE: c_int = 16; ++pub const _PC_REC_XFER_ALIGN: c_int = 17; ++pub const _PC_ALLOC_SIZE_MIN: c_int = 18; ++pub const _PC_SYMLINK_MAX: c_int = 19; ++pub const _PC_2_SYMLINKS: c_int = 20; ++ ++pub const MS_NOUSER: c_ulong = 0xffffffff80000000; ++ ++pub const _SC_ARG_MAX: c_int = 0; ++pub const _SC_CHILD_MAX: c_int = 1; ++pub const _SC_CLK_TCK: c_int = 2; ++pub const _SC_NGROUPS_MAX: c_int = 3; ++pub const _SC_OPEN_MAX: c_int = 4; ++pub const _SC_STREAM_MAX: c_int = 5; ++pub const _SC_TZNAME_MAX: c_int = 6; ++pub const _SC_JOB_CONTROL: c_int = 7; ++pub const _SC_SAVED_IDS: c_int = 8; ++pub const _SC_REALTIME_SIGNALS: c_int = 9; ++pub const _SC_PRIORITY_SCHEDULING: c_int = 10; ++pub const _SC_TIMERS: c_int = 11; ++pub const _SC_ASYNCHRONOUS_IO: c_int = 12; ++pub const _SC_PRIORITIZED_IO: c_int = 13; ++pub const _SC_SYNCHRONIZED_IO: c_int = 14; ++pub const _SC_FSYNC: c_int = 15; ++pub const _SC_MAPPED_FILES: c_int = 16; ++pub const _SC_MEMLOCK: c_int = 17; ++pub const _SC_MEMLOCK_RANGE: c_int = 18; ++pub const _SC_MEMORY_PROTECTION: c_int = 19; ++pub const _SC_MESSAGE_PASSING: c_int = 20; ++pub const _SC_SEMAPHORES: c_int = 21; ++pub const _SC_SHARED_MEMORY_OBJECTS: c_int = 22; ++pub const _SC_AIO_LISTIO_MAX: c_int = 23; ++pub const _SC_AIO_MAX: c_int = 24; ++pub const _SC_AIO_PRIO_DELTA_MAX: c_int = 25; ++pub const _SC_DELAYTIMER_MAX: c_int = 26; ++pub const _SC_MQ_OPEN_MAX: c_int = 27; ++pub const _SC_MQ_PRIO_MAX: c_int = 28; ++pub const _SC_VERSION: c_int = 29; ++pub const _SC_PAGESIZE: c_int = 30; ++pub const _SC_PAGE_SIZE: c_int = _SC_PAGESIZE; ++pub const _SC_RTSIG_MAX: c_int = 31; ++pub const _SC_SEM_NSEMS_MAX: c_int = 32; ++pub const _SC_SEM_VALUE_MAX: c_int = 33; ++pub const _SC_SIGQUEUE_MAX: c_int = 34; ++pub const _SC_TIMER_MAX: c_int = 35; ++pub const _SC_BC_BASE_MAX: c_int = 36; ++pub const _SC_BC_DIM_MAX: c_int = 37; ++pub const _SC_BC_SCALE_MAX: c_int = 38; ++pub const _SC_BC_STRING_MAX: c_int = 39; ++pub const _SC_COLL_WEIGHTS_MAX: c_int = 40; ++pub const _SC_EXPR_NEST_MAX: c_int = 42; ++pub const _SC_LINE_MAX: c_int = 43; ++pub const _SC_RE_DUP_MAX: c_int = 44; ++pub const _SC_2_VERSION: c_int = 46; ++pub const _SC_2_C_BIND: c_int = 47; ++pub const _SC_2_C_DEV: c_int = 48; ++pub const _SC_2_FORT_DEV: c_int = 49; ++pub const _SC_2_FORT_RUN: c_int = 50; ++pub const _SC_2_SW_DEV: c_int = 51; ++pub const _SC_2_LOCALEDEF: c_int = 52; ++pub const _SC_UIO_MAXIOV: c_int = 60; ++pub const _SC_IOV_MAX: c_int = 60; ++pub const _SC_THREADS: c_int = 67; ++pub const _SC_THREAD_SAFE_FUNCTIONS: c_int = 68; ++pub const _SC_GETGR_R_SIZE_MAX: c_int = 69; ++pub const _SC_GETPW_R_SIZE_MAX: c_int = 70; ++pub const _SC_LOGIN_NAME_MAX: c_int = 71; ++pub const _SC_TTY_NAME_MAX: c_int = 72; ++pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: c_int = 73; ++pub const _SC_THREAD_KEYS_MAX: c_int = 74; ++pub const _SC_THREAD_STACK_MIN: c_int = 75; ++pub const _SC_THREAD_THREADS_MAX: c_int = 76; ++pub const _SC_THREAD_ATTR_STACKADDR: c_int = 77; ++pub const _SC_THREAD_ATTR_STACKSIZE: c_int = 78; ++pub const _SC_THREAD_PRIORITY_SCHEDULING: c_int = 79; ++pub const _SC_THREAD_PRIO_INHERIT: c_int = 80; ++pub const _SC_THREAD_PRIO_PROTECT: c_int = 81; ++pub const _SC_THREAD_PROCESS_SHARED: c_int = 82; ++pub const _SC_NPROCESSORS_CONF: c_int = 83; ++pub const _SC_NPROCESSORS_ONLN: c_int = 84; ++pub const _SC_PHYS_PAGES: c_int = 85; ++pub const _SC_AVPHYS_PAGES: c_int = 86; ++pub const _SC_ATEXIT_MAX: c_int = 87; ++pub const _SC_PASS_MAX: c_int = 88; ++pub const _SC_XOPEN_VERSION: c_int = 89; ++pub const _SC_XOPEN_XCU_VERSION: c_int = 90; ++pub const _SC_XOPEN_UNIX: c_int = 91; ++pub const _SC_XOPEN_CRYPT: c_int = 92; ++pub const _SC_XOPEN_ENH_I18N: c_int = 93; ++pub const _SC_XOPEN_SHM: c_int = 94; ++pub const _SC_2_CHAR_TERM: c_int = 95; ++pub const _SC_2_UPE: c_int = 97; ++pub const _SC_XOPEN_XPG2: c_int = 98; ++pub const _SC_XOPEN_XPG3: c_int = 99; ++pub const _SC_XOPEN_XPG4: c_int = 100; ++pub const _SC_NZERO: c_int = 109; ++pub const _SC_XBS5_ILP32_OFF32: c_int = 125; ++pub const _SC_XBS5_ILP32_OFFBIG: c_int = 126; ++pub const _SC_XBS5_LP64_OFF64: c_int = 127; ++pub const _SC_XBS5_LPBIG_OFFBIG: c_int = 128; ++pub const _SC_XOPEN_LEGACY: c_int = 129; ++pub const _SC_XOPEN_REALTIME: c_int = 130; ++pub const _SC_XOPEN_REALTIME_THREADS: c_int = 131; ++pub const _SC_ADVISORY_INFO: c_int = 132; ++pub const _SC_BARRIERS: c_int = 133; ++pub const _SC_CLOCK_SELECTION: c_int = 137; ++pub const _SC_CPUTIME: c_int = 138; ++pub const _SC_THREAD_CPUTIME: c_int = 139; ++pub const _SC_MONOTONIC_CLOCK: c_int = 149; ++pub const _SC_READER_WRITER_LOCKS: c_int = 153; ++pub const _SC_SPIN_LOCKS: c_int = 154; ++pub const _SC_REGEXP: c_int = 155; ++pub const _SC_SHELL: c_int = 157; ++pub const _SC_SPAWN: c_int = 159; ++pub const _SC_SPORADIC_SERVER: c_int = 160; ++pub const _SC_THREAD_SPORADIC_SERVER: c_int = 161; ++pub const _SC_TIMEOUTS: c_int = 164; ++pub const _SC_TYPED_MEMORY_OBJECTS: c_int = 165; ++pub const _SC_2_PBS: c_int = 168; ++pub const _SC_2_PBS_ACCOUNTING: c_int = 169; ++pub const _SC_2_PBS_LOCATE: c_int = 170; ++pub const _SC_2_PBS_MESSAGE: c_int = 171; ++pub const _SC_2_PBS_TRACK: c_int = 172; ++pub const _SC_SYMLOOP_MAX: c_int = 173; ++pub const _SC_STREAMS: c_int = 174; ++pub const _SC_2_PBS_CHECKPOINT: c_int = 175; ++pub const _SC_V6_ILP32_OFF32: c_int = 176; ++pub const _SC_V6_ILP32_OFFBIG: c_int = 177; ++pub const _SC_V6_LP64_OFF64: c_int = 178; ++pub const _SC_V6_LPBIG_OFFBIG: c_int = 179; ++pub const _SC_HOST_NAME_MAX: c_int = 180; ++pub const _SC_TRACE: c_int = 181; ++pub const _SC_TRACE_EVENT_FILTER: c_int = 182; ++pub const _SC_TRACE_INHERIT: c_int = 183; ++pub const _SC_TRACE_LOG: c_int = 184; ++pub const _SC_IPV6: c_int = 235; ++pub const _SC_RAW_SOCKETS: c_int = 236; ++pub const _SC_V7_ILP32_OFF32: c_int = 237; ++pub const _SC_V7_ILP32_OFFBIG: c_int = 238; ++pub const _SC_V7_LP64_OFF64: c_int = 239; ++pub const _SC_V7_LPBIG_OFFBIG: c_int = 240; ++pub const _SC_SS_REPL_MAX: c_int = 241; ++pub const _SC_TRACE_EVENT_NAME_MAX: c_int = 242; ++pub const _SC_TRACE_NAME_MAX: c_int = 243; ++pub const _SC_TRACE_SYS_MAX: c_int = 244; ++pub const _SC_TRACE_USER_EVENT_MAX: c_int = 245; ++pub const _SC_XOPEN_STREAMS: c_int = 246; ++pub const _SC_THREAD_ROBUST_PRIO_INHERIT: c_int = 247; ++pub const _SC_THREAD_ROBUST_PRIO_PROTECT: c_int = 248; ++ ++pub const _CS_PATH: c_int = 0; ++pub const _CS_POSIX_V6_WIDTH_RESTRICTED_ENVS: c_int = 1; ++pub const _CS_POSIX_V5_WIDTH_RESTRICTED_ENVS: c_int = 4; ++pub const _CS_POSIX_V7_WIDTH_RESTRICTED_ENVS: c_int = 5; ++pub const _CS_POSIX_V6_ILP32_OFF32_CFLAGS: c_int = 1116; ++pub const _CS_POSIX_V6_ILP32_OFF32_LDFLAGS: c_int = 1117; ++pub const _CS_POSIX_V6_ILP32_OFF32_LIBS: c_int = 1118; ++pub const _CS_POSIX_V6_ILP32_OFF32_LINTFLAGS: c_int = 1119; ++pub const _CS_POSIX_V6_ILP32_OFFBIG_CFLAGS: c_int = 1120; ++pub const _CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS: c_int = 1121; ++pub const _CS_POSIX_V6_ILP32_OFFBIG_LIBS: c_int = 1122; ++pub const _CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS: c_int = 1123; ++pub const _CS_POSIX_V6_LP64_OFF64_CFLAGS: c_int = 1124; ++pub const _CS_POSIX_V6_LP64_OFF64_LDFLAGS: c_int = 1125; ++pub const _CS_POSIX_V6_LP64_OFF64_LIBS: c_int = 1126; ++pub const _CS_POSIX_V6_LP64_OFF64_LINTFLAGS: c_int = 1127; ++pub const _CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS: c_int = 1128; ++pub const _CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS: c_int = 1129; ++pub const _CS_POSIX_V6_LPBIG_OFFBIG_LIBS: c_int = 1130; ++pub const _CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS: c_int = 1131; ++pub const _CS_POSIX_V7_ILP32_OFF32_CFLAGS: c_int = 1132; ++pub const _CS_POSIX_V7_ILP32_OFF32_LDFLAGS: c_int = 1133; ++pub const _CS_POSIX_V7_ILP32_OFF32_LIBS: c_int = 1134; ++pub const _CS_POSIX_V7_ILP32_OFF32_LINTFLAGS: c_int = 1135; ++pub const _CS_POSIX_V7_ILP32_OFFBIG_CFLAGS: c_int = 1136; ++pub const _CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS: c_int = 1137; ++pub const _CS_POSIX_V7_ILP32_OFFBIG_LIBS: c_int = 1138; ++pub const _CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS: c_int = 1139; ++pub const _CS_POSIX_V7_LP64_OFF64_CFLAGS: c_int = 1140; ++pub const _CS_POSIX_V7_LP64_OFF64_LDFLAGS: c_int = 1141; ++pub const _CS_POSIX_V7_LP64_OFF64_LIBS: c_int = 1142; ++pub const _CS_POSIX_V7_LP64_OFF64_LINTFLAGS: c_int = 1143; ++pub const _CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS: c_int = 1144; ++pub const _CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS: c_int = 1145; ++pub const _CS_POSIX_V7_LPBIG_OFFBIG_LIBS: c_int = 1146; ++pub const _CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS: c_int = 1147; ++ ++pub const RLIM_SAVED_MAX: crate::rlim_t = RLIM_INFINITY; ++pub const RLIM_SAVED_CUR: crate::rlim_t = RLIM_INFINITY; ++ ++// elf.h - Fields in the e_ident array. ++pub const EI_NIDENT: usize = 16; ++ ++pub const EI_MAG0: usize = 0; ++pub const ELFMAG0: u8 = 0x7f; ++pub const EI_MAG1: usize = 1; ++pub const ELFMAG1: u8 = b'E'; ++pub const EI_MAG2: usize = 2; ++pub const ELFMAG2: u8 = b'L'; ++pub const EI_MAG3: usize = 3; ++pub const ELFMAG3: u8 = b'F'; ++pub const SELFMAG: usize = 4; ++ ++pub const EI_CLASS: usize = 4; ++pub const ELFCLASSNONE: u8 = 0; ++pub const ELFCLASS32: u8 = 1; ++pub const ELFCLASS64: u8 = 2; ++pub const ELFCLASSNUM: usize = 3; ++ ++pub const EI_DATA: usize = 5; ++pub const ELFDATANONE: u8 = 0; ++pub const ELFDATA2LSB: u8 = 1; ++pub const ELFDATA2MSB: u8 = 2; ++pub const ELFDATANUM: usize = 3; ++ ++pub const EI_VERSION: usize = 6; ++ ++pub const EI_OSABI: usize = 7; ++pub const ELFOSABI_NONE: u8 = 0; ++pub const ELFOSABI_SYSV: u8 = 0; ++pub const ELFOSABI_HPUX: u8 = 1; ++pub const ELFOSABI_NETBSD: u8 = 2; ++pub const ELFOSABI_GNU: u8 = 3; ++pub const ELFOSABI_LINUX: u8 = ELFOSABI_GNU; ++pub const ELFOSABI_SOLARIS: u8 = 6; ++pub const ELFOSABI_AIX: u8 = 7; ++pub const ELFOSABI_IRIX: u8 = 8; ++pub const ELFOSABI_FREEBSD: u8 = 9; ++pub const ELFOSABI_TRU64: u8 = 10; ++pub const ELFOSABI_MODESTO: u8 = 11; ++pub const ELFOSABI_OPENBSD: u8 = 12; ++pub const ELFOSABI_ARM: u8 = 97; ++pub const ELFOSABI_STANDALONE: u8 = 255; ++ ++pub const EI_ABIVERSION: usize = 8; ++ ++pub const EI_PAD: usize = 9; ++ ++// elf.h - Legal values for e_type (object file type). ++pub const ET_NONE: u16 = 0; ++pub const ET_REL: u16 = 1; ++pub const ET_EXEC: u16 = 2; ++pub const ET_DYN: u16 = 3; ++pub const ET_CORE: u16 = 4; ++pub const ET_NUM: u16 = 5; ++pub const ET_LOOS: u16 = 0xfe00; ++pub const ET_HIOS: u16 = 0xfeff; ++pub const ET_LOPROC: u16 = 0xff00; ++pub const ET_HIPROC: u16 = 0xffff; ++ ++// elf.h - Legal values for e_machine (architecture). ++pub const EM_NONE: u16 = 0; ++pub const EM_M32: u16 = 1; ++pub const EM_SPARC: u16 = 2; ++pub const EM_386: u16 = 3; ++pub const EM_68K: u16 = 4; ++pub const EM_88K: u16 = 5; ++pub const EM_860: u16 = 7; ++pub const EM_MIPS: u16 = 8; ++pub const EM_S370: u16 = 9; ++pub const EM_MIPS_RS3_LE: u16 = 10; ++pub const EM_PARISC: u16 = 15; ++pub const EM_VPP500: u16 = 17; ++pub const EM_SPARC32PLUS: u16 = 18; ++pub const EM_960: u16 = 19; ++pub const EM_PPC: u16 = 20; ++pub const EM_PPC64: u16 = 21; ++pub const EM_S390: u16 = 22; ++pub const EM_V800: u16 = 36; ++pub const EM_FR20: u16 = 37; ++pub const EM_RH32: u16 = 38; ++pub const EM_RCE: u16 = 39; ++pub const EM_ARM: u16 = 40; ++pub const EM_FAKE_ALPHA: u16 = 41; ++pub const EM_SH: u16 = 42; ++pub const EM_SPARCV9: u16 = 43; ++pub const EM_TRICORE: u16 = 44; ++pub const EM_ARC: u16 = 45; ++pub const EM_H8_300: u16 = 46; ++pub const EM_H8_300H: u16 = 47; ++pub const EM_H8S: u16 = 48; ++pub const EM_H8_500: u16 = 49; ++pub const EM_IA_64: u16 = 50; ++pub const EM_MIPS_X: u16 = 51; ++pub const EM_COLDFIRE: u16 = 52; ++pub const EM_68HC12: u16 = 53; ++pub const EM_MMA: u16 = 54; ++pub const EM_PCP: u16 = 55; ++pub const EM_NCPU: u16 = 56; ++pub const EM_NDR1: u16 = 57; ++pub const EM_STARCORE: u16 = 58; ++pub const EM_ME16: u16 = 59; ++pub const EM_ST100: u16 = 60; ++pub const EM_TINYJ: u16 = 61; ++pub const EM_X86_64: u16 = 62; ++pub const EM_PDSP: u16 = 63; ++pub const EM_FX66: u16 = 66; ++pub const EM_ST9PLUS: u16 = 67; ++pub const EM_ST7: u16 = 68; ++pub const EM_68HC16: u16 = 69; ++pub const EM_68HC11: u16 = 70; ++pub const EM_68HC08: u16 = 71; ++pub const EM_68HC05: u16 = 72; ++pub const EM_SVX: u16 = 73; ++pub const EM_ST19: u16 = 74; ++pub const EM_VAX: u16 = 75; ++pub const EM_CRIS: u16 = 76; ++pub const EM_JAVELIN: u16 = 77; ++pub const EM_FIREPATH: u16 = 78; ++pub const EM_ZSP: u16 = 79; ++pub const EM_MMIX: u16 = 80; ++pub const EM_HUANY: u16 = 81; ++pub const EM_PRISM: u16 = 82; ++pub const EM_AVR: u16 = 83; ++pub const EM_FR30: u16 = 84; ++pub const EM_D10V: u16 = 85; ++pub const EM_D30V: u16 = 86; ++pub const EM_V850: u16 = 87; ++pub const EM_M32R: u16 = 88; ++pub const EM_MN10300: u16 = 89; ++pub const EM_MN10200: u16 = 90; ++pub const EM_PJ: u16 = 91; ++pub const EM_OPENRISC: u16 = 92; ++pub const EM_ARC_A5: u16 = 93; ++pub const EM_XTENSA: u16 = 94; ++pub const EM_AARCH64: u16 = 183; ++pub const EM_TILEPRO: u16 = 188; ++pub const EM_TILEGX: u16 = 191; ++pub const EM_ALPHA: u16 = 0x9026; ++ ++// elf.h - Legal values for e_version (version). ++pub const EV_NONE: u32 = 0; ++pub const EV_CURRENT: u32 = 1; ++pub const EV_NUM: u32 = 2; ++ ++// elf.h - Legal values for p_type (segment type). ++pub const PT_NULL: u32 = 0; ++pub const PT_LOAD: u32 = 1; ++pub const PT_DYNAMIC: u32 = 2; ++pub const PT_INTERP: u32 = 3; ++pub const PT_NOTE: u32 = 4; ++pub const PT_SHLIB: u32 = 5; ++pub const PT_PHDR: u32 = 6; ++pub const PT_TLS: u32 = 7; ++pub const PT_NUM: u32 = 8; ++pub const PT_LOOS: u32 = 0x60000000; ++pub const PT_GNU_EH_FRAME: u32 = 0x6474e550; ++pub const PT_GNU_STACK: u32 = 0x6474e551; ++pub const PT_GNU_RELRO: u32 = 0x6474e552; ++pub const PT_LOSUNW: u32 = 0x6ffffffa; ++pub const PT_SUNWBSS: u32 = 0x6ffffffa; ++pub const PT_SUNWSTACK: u32 = 0x6ffffffb; ++pub const PT_HISUNW: u32 = 0x6fffffff; ++pub const PT_HIOS: u32 = 0x6fffffff; ++pub const PT_LOPROC: u32 = 0x70000000; ++pub const PT_HIPROC: u32 = 0x7fffffff; ++ ++// Legal values for p_flags (segment flags). ++pub const PF_X: u32 = 1 << 0; ++pub const PF_W: u32 = 1 << 1; ++pub const PF_R: u32 = 1 << 2; ++pub const PF_MASKOS: u32 = 0x0ff00000; ++pub const PF_MASKPROC: u32 = 0xf0000000; ++ ++// elf.h - Legal values for a_type (entry type). ++pub const AT_NULL: c_ulong = 0; ++pub const AT_IGNORE: c_ulong = 1; ++pub const AT_EXECFD: c_ulong = 2; ++pub const AT_PHDR: c_ulong = 3; ++pub const AT_PHENT: c_ulong = 4; ++pub const AT_PHNUM: c_ulong = 5; ++pub const AT_PAGESZ: c_ulong = 6; ++pub const AT_BASE: c_ulong = 7; ++pub const AT_FLAGS: c_ulong = 8; ++pub const AT_ENTRY: c_ulong = 9; ++pub const AT_NOTELF: c_ulong = 10; ++pub const AT_UID: c_ulong = 11; ++pub const AT_EUID: c_ulong = 12; ++pub const AT_GID: c_ulong = 13; ++pub const AT_EGID: c_ulong = 14; ++pub const AT_PLATFORM: c_ulong = 15; ++pub const AT_HWCAP: c_ulong = 16; ++pub const AT_CLKTCK: c_ulong = 17; ++ ++pub const AT_SECURE: c_ulong = 23; ++pub const AT_BASE_PLATFORM: c_ulong = 24; ++pub const AT_RANDOM: c_ulong = 25; ++pub const AT_HWCAP2: c_ulong = 26; ++ ++pub const AT_EXECFN: c_ulong = 31; ++ ++// defined in arch//include/uapi/asm/auxvec.h but has the same value ++// wherever it is defined. ++pub const AT_SYSINFO_EHDR: c_ulong = 33; ++pub const AT_MINSIGSTKSZ: c_ulong = 51; ++ ++pub const GLOB_ERR: c_int = 1 << 0; ++pub const GLOB_MARK: c_int = 1 << 1; ++pub const GLOB_NOSORT: c_int = 1 << 2; ++pub const GLOB_DOOFFS: c_int = 1 << 3; ++pub const GLOB_NOCHECK: c_int = 1 << 4; ++pub const GLOB_APPEND: c_int = 1 << 5; ++pub const GLOB_NOESCAPE: c_int = 1 << 6; ++ ++pub const GLOB_NOSPACE: c_int = 1; ++pub const GLOB_ABORTED: c_int = 2; ++pub const GLOB_NOMATCH: c_int = 3; ++ ++pub const POSIX_MADV_NORMAL: c_int = 0; ++pub const POSIX_MADV_RANDOM: c_int = 1; ++pub const POSIX_MADV_SEQUENTIAL: c_int = 2; ++pub const POSIX_MADV_WILLNEED: c_int = 3; ++pub const POSIX_SPAWN_USEVFORK: c_int = 64; ++pub const POSIX_SPAWN_SETSID: c_int = 128; ++ ++pub const S_IEXEC: mode_t = 0o0100; ++pub const S_IWRITE: mode_t = 0o0200; ++pub const S_IREAD: mode_t = 0o0400; ++ ++pub const F_LOCK: c_int = 1; ++pub const F_TEST: c_int = 3; ++pub const F_TLOCK: c_int = 2; ++pub const F_ULOCK: c_int = 0; ++ ++pub const F_SEAL_FUTURE_WRITE: c_int = 0x0010; ++ ++pub const IFF_LOWER_UP: c_int = 0x10000; ++pub const IFF_DORMANT: c_int = 0x20000; ++pub const IFF_ECHO: c_int = 0x40000; ++ ++// 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_FLAGS: c_ushort = 8; ++ ++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; ++pub const IFA_F_MANAGETEMPADDR: u32 = 0x100; ++pub const IFA_F_NOPREFIXROUTE: u32 = 0x200; ++pub const IFA_F_MCAUTOJOIN: u32 = 0x400; ++pub const IFA_F_STABLE_PRIVACY: u32 = 0x800; ++ ++// 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_PROP_LIST: c_ushort = 52; ++pub const IFLA_ALT_IFNAME: c_ushort = 53; ++pub const IFLA_PERM_ADDRESS: c_ushort = 54; ++pub const IFLA_PROTO_DOWN_REASON: c_ushort = 55; ++pub const IFLA_PARENT_DEV_NAME: c_ushort = 56; ++pub const IFLA_PARENT_DEV_BUS_NAME: c_ushort = 57; ++pub const IFLA_GRO_MAX_SIZE: c_ushort = 58; ++pub const IFLA_TSO_MAX_SIZE: c_ushort = 59; ++pub const IFLA_TSO_MAX_SEGS: c_ushort = 60; ++pub const IFLA_ALLMULTI: c_ushort = 61; ++ ++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/if_tun.h ++/* TUNSETIFF ifr flags */ ++pub const IFF_TUN: c_int = 0x0001; ++pub const IFF_TAP: c_int = 0x0002; ++pub const IFF_NAPI: c_int = 0x0010; ++pub const IFF_NAPI_FRAGS: c_int = 0x0020; ++// Used in TUNSETIFF to bring up tun/tap without carrier ++pub const IFF_NO_CARRIER: c_int = 0x0040; ++pub const IFF_NO_PI: c_int = 0x1000; ++// Read queue size ++pub const TUN_READQ_SIZE: c_short = 500; ++// TUN device type flags: deprecated. Use IFF_TUN/IFF_TAP instead. ++pub const TUN_TUN_DEV: c_short = crate::IFF_TUN as c_short; ++pub const TUN_TAP_DEV: c_short = crate::IFF_TAP as c_short; ++pub const TUN_TYPE_MASK: c_short = 0x000f; ++// This flag has no real effect ++pub const IFF_ONE_QUEUE: c_int = 0x2000; ++pub const IFF_VNET_HDR: c_int = 0x4000; ++pub const IFF_TUN_EXCL: c_int = 0x8000; ++pub const IFF_MULTI_QUEUE: c_int = 0x0100; ++pub const IFF_ATTACH_QUEUE: c_int = 0x0200; ++pub const IFF_DETACH_QUEUE: c_int = 0x0400; ++// read-only flag ++pub const IFF_PERSIST: c_int = 0x0800; ++pub const IFF_NOFILTER: c_int = 0x1000; ++// Socket options ++pub const TUN_TX_TIMESTAMP: c_int = 1; ++// Features for GSO (TUNSETOFFLOAD) ++pub const TUN_F_CSUM: c_uint = 0x01; ++pub const TUN_F_TSO4: c_uint = 0x02; ++pub const TUN_F_TSO6: c_uint = 0x04; ++pub const TUN_F_TSO_ECN: c_uint = 0x08; ++pub const TUN_F_UFO: c_uint = 0x10; ++pub const TUN_F_USO4: c_uint = 0x20; ++pub const TUN_F_USO6: c_uint = 0x40; ++// Protocol info prepended to the packets (when IFF_NO_PI is not set) ++pub const TUN_PKT_STRIP: c_int = 0x0001; ++// Accept all multicast packets ++pub const TUN_FLT_ALLMULTI: c_int = 0x0001; ++ ++// Since Linux 3.1 ++pub const SEEK_DATA: c_int = 3; ++pub const SEEK_HOLE: c_int = 4; ++ ++pub const ST_RDONLY: c_ulong = 1; ++pub const ST_NOSUID: c_ulong = 2; ++pub const ST_NODEV: c_ulong = 4; ++pub const ST_NOEXEC: c_ulong = 8; ++pub const ST_SYNCHRONOUS: c_ulong = 16; ++pub const ST_MANDLOCK: c_ulong = 64; ++pub const ST_WRITE: c_ulong = 128; ++pub const ST_APPEND: c_ulong = 256; ++pub const ST_IMMUTABLE: c_ulong = 512; ++pub const ST_NOATIME: c_ulong = 1024; ++pub const ST_NODIRATIME: c_ulong = 2048; ++ ++pub const RTLD_NEXT: *mut c_void = -1i64 as *mut c_void; ++pub const RTLD_DEFAULT: *mut c_void = 0i64 as *mut c_void; ++pub const RTLD_NODELETE: c_int = 0x1000; ++pub const RTLD_NOW: c_int = 0x2; ++ ++pub const AT_EACCESS: c_int = 0x200; ++ ++// linux/mempolicy.h ++pub const MPOL_DEFAULT: c_int = 0; ++pub const MPOL_PREFERRED: c_int = 1; ++pub const MPOL_BIND: c_int = 2; ++pub const MPOL_INTERLEAVE: c_int = 3; ++pub const MPOL_LOCAL: c_int = 4; ++pub const MPOL_F_NUMA_BALANCING: c_int = 1 << 13; ++pub const MPOL_F_RELATIVE_NODES: c_int = 1 << 14; ++pub const MPOL_F_STATIC_NODES: c_int = 1 << 15; ++ ++// linux/membarrier.h ++pub const MEMBARRIER_CMD_QUERY: c_int = 0; ++pub const MEMBARRIER_CMD_GLOBAL: c_int = 1 << 0; ++pub const MEMBARRIER_CMD_GLOBAL_EXPEDITED: c_int = 1 << 1; ++pub const MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED: c_int = 1 << 2; ++pub const MEMBARRIER_CMD_PRIVATE_EXPEDITED: c_int = 1 << 3; ++pub const MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED: c_int = 1 << 4; ++pub const MEMBARRIER_CMD_PRIVATE_EXPEDITED_SYNC_CORE: c_int = 1 << 5; ++pub const MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_SYNC_CORE: c_int = 1 << 6; ++pub const MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ: c_int = 1 << 7; ++pub const MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ: c_int = 1 << 8; ++ ++pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { ++ size: [0; __SIZEOF_PTHREAD_MUTEX_T], ++}; ++pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { ++ size: [0; __SIZEOF_PTHREAD_COND_T], ++}; ++pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { ++ size: [0; __SIZEOF_PTHREAD_RWLOCK_T], ++}; ++ ++pub const PTHREAD_BARRIER_SERIAL_THREAD: c_int = -1; ++pub const PTHREAD_ONCE_INIT: pthread_once_t = 0; ++pub const PTHREAD_MUTEX_NORMAL: c_int = 0; ++pub const PTHREAD_MUTEX_RECURSIVE: c_int = 1; ++pub const PTHREAD_MUTEX_ERRORCHECK: c_int = 2; ++pub const PTHREAD_MUTEX_DEFAULT: c_int = PTHREAD_MUTEX_NORMAL; ++pub const PTHREAD_MUTEX_STALLED: c_int = 0; ++pub const PTHREAD_MUTEX_ROBUST: c_int = 1; ++pub const PTHREAD_PRIO_NONE: c_int = 0; ++pub const PTHREAD_PRIO_INHERIT: c_int = 1; ++pub const PTHREAD_PRIO_PROTECT: c_int = 2; ++pub const PTHREAD_PROCESS_PRIVATE: c_int = 0; ++pub const PTHREAD_PROCESS_SHARED: c_int = 1; ++pub const PTHREAD_INHERIT_SCHED: c_int = 0; ++pub const PTHREAD_EXPLICIT_SCHED: c_int = 1; ++pub const __SIZEOF_PTHREAD_COND_T: usize = 48; ++ ++pub const RENAME_NOREPLACE: c_uint = 1; ++pub const RENAME_EXCHANGE: c_uint = 2; ++pub const RENAME_WHITEOUT: c_uint = 4; ++ ++// netinet/in.h ++// NOTE: These are in addition to the constants defined in src/unix/mod.rs ++ ++#[deprecated( ++ since = "0.2.80", ++ note = "This value was increased in the newer kernel \ ++ and we'll change this following upstream in the future release. \ ++ See #1896 for more info." ++)] ++pub const IPPROTO_MAX: c_int = 256; ++ ++// System V IPC ++pub const IPC_PRIVATE: crate::key_t = 0; ++ ++pub const IPC_CREAT: c_int = 0o1000; ++pub const IPC_EXCL: c_int = 0o2000; ++pub const IPC_NOWAIT: c_int = 0o4000; ++ ++pub const IPC_RMID: c_int = 0; ++pub const IPC_SET: c_int = 1; ++pub const IPC_STAT: c_int = 2; ++pub const IPC_INFO: c_int = 3; ++pub const MSG_STAT: c_int = 11; ++pub const MSG_INFO: c_int = 12; ++pub const MSG_NOTIFICATION: c_int = 0x8000; ++ ++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; ++ ++pub const SHM_RDONLY: c_int = 0o10000; ++pub const SHM_RND: c_int = 0o20000; ++pub const SHM_REMAP: c_int = 0o40000; ++ ++pub const SHM_LOCK: c_int = 11; ++pub const SHM_UNLOCK: c_int = 12; ++ ++pub const SHM_HUGETLB: c_int = 0o4000; ++#[cfg(not(all(target_env = "uclibc", target_arch = "mips")))] ++pub const SHM_NORESERVE: c_int = 0o10000; ++ ++pub const QFMT_VFS_OLD: c_int = 1; ++pub const QFMT_VFS_V0: c_int = 2; ++pub const QFMT_VFS_V1: c_int = 4; ++ ++pub const EFD_SEMAPHORE: c_int = 0x1; ++ ++pub const LOG_NFACILITIES: c_int = 24; ++ ++pub const SEM_FAILED: *mut crate::sem_t = 0 as *mut sem_t; ++ ++pub const RB_AUTOBOOT: c_int = 0x01234567u32 as i32; ++pub const RB_HALT_SYSTEM: c_int = 0xcdef0123u32 as i32; ++pub const RB_ENABLE_CAD: c_int = 0x89abcdefu32 as i32; ++pub const RB_DISABLE_CAD: c_int = 0x00000000u32 as i32; ++pub const RB_POWER_OFF: c_int = 0x4321fedcu32 as i32; ++pub const RB_SW_SUSPEND: c_int = 0xd000fce2u32 as i32; ++pub const RB_KEXEC: c_int = 0x45584543u32 as i32; ++ ++pub const AI_PASSIVE: c_int = 0x0001; ++pub const AI_CANONNAME: c_int = 0x0002; ++pub const AI_NUMERICHOST: c_int = 0x0004; ++pub const AI_V4MAPPED: c_int = 0x0008; ++pub const AI_ALL: c_int = 0x0010; ++pub const AI_ADDRCONFIG: c_int = 0x0020; ++ ++pub const AI_NUMERICSERV: c_int = 0x0400; ++ ++pub const EAI_BADFLAGS: c_int = -1; ++pub const EAI_NONAME: c_int = -2; ++pub const EAI_AGAIN: c_int = -3; ++pub const EAI_FAIL: c_int = -4; ++pub const EAI_NODATA: c_int = -5; ++pub const EAI_FAMILY: c_int = -6; ++pub const EAI_SOCKTYPE: c_int = -7; ++pub const EAI_SERVICE: c_int = -8; ++pub const EAI_MEMORY: c_int = -10; ++pub const EAI_SYSTEM: c_int = -11; ++pub const EAI_OVERFLOW: c_int = -12; ++ ++pub const NI_NUMERICHOST: c_int = 1; ++pub const NI_NUMERICSERV: c_int = 2; ++pub const NI_NOFQDN: c_int = 4; ++pub const NI_NAMEREQD: c_int = 8; ++pub const NI_DGRAM: c_int = 16; ++pub const NI_IDN: c_int = 32; ++ ++pub const SYNC_FILE_RANGE_WAIT_BEFORE: c_uint = 1; ++pub const SYNC_FILE_RANGE_WRITE: c_uint = 2; ++pub const SYNC_FILE_RANGE_WAIT_AFTER: c_uint = 4; ++ ++cfg_if! { ++ if #[cfg(not(target_env = "uclibc"))] { ++ pub const AIO_CANCELED: c_int = 0; ++ pub const AIO_NOTCANCELED: c_int = 1; ++ pub const AIO_ALLDONE: c_int = 2; ++ pub const LIO_READ: c_int = 0; ++ pub const LIO_WRITE: c_int = 1; ++ pub const LIO_NOP: c_int = 2; ++ pub const LIO_WAIT: c_int = 0; ++ pub const LIO_NOWAIT: c_int = 1; ++ pub const RUSAGE_THREAD: c_int = 1; ++ pub const MSG_COPY: c_int = 0o40000; ++ pub const SHM_EXEC: c_int = 0o100000; ++ pub const IPV6_MULTICAST_ALL: c_int = 29; ++ pub const IPV6_ROUTER_ALERT_ISOLATE: c_int = 30; ++ pub const PACKET_MR_UNICAST: c_int = 3; ++ pub const PTRACE_EVENT_STOP: c_int = 128; ++ pub const UDP_SEGMENT: c_int = 103; ++ pub const UDP_GRO: c_int = 104; ++ } ++} ++ ++pub const MREMAP_MAYMOVE: c_int = 1; ++pub const MREMAP_FIXED: c_int = 2; ++pub const MREMAP_DONTUNMAP: c_int = 4; ++ ++pub const PR_SET_PDEATHSIG: c_int = 1; ++pub const PR_GET_PDEATHSIG: c_int = 2; ++ ++pub const PR_GET_DUMPABLE: c_int = 3; ++pub const PR_SET_DUMPABLE: c_int = 4; ++ ++pub const PR_GET_UNALIGN: c_int = 5; ++pub const PR_SET_UNALIGN: c_int = 6; ++pub const PR_UNALIGN_NOPRINT: c_int = 1; ++pub const PR_UNALIGN_SIGBUS: c_int = 2; ++ ++pub const PR_GET_KEEPCAPS: c_int = 7; ++pub const PR_SET_KEEPCAPS: c_int = 8; ++ ++pub const PR_GET_FPEMU: c_int = 9; ++pub const PR_SET_FPEMU: c_int = 10; ++pub const PR_FPEMU_NOPRINT: c_int = 1; ++pub const PR_FPEMU_SIGFPE: c_int = 2; ++ ++pub const PR_GET_FPEXC: c_int = 11; ++pub const PR_SET_FPEXC: c_int = 12; ++pub const PR_FP_EXC_SW_ENABLE: c_int = 0x80; ++pub const PR_FP_EXC_DIV: c_int = 0x010000; ++pub const PR_FP_EXC_OVF: c_int = 0x020000; ++pub const PR_FP_EXC_UND: c_int = 0x040000; ++pub const PR_FP_EXC_RES: c_int = 0x080000; ++pub const PR_FP_EXC_INV: c_int = 0x100000; ++pub const PR_FP_EXC_DISABLED: c_int = 0; ++pub const PR_FP_EXC_NONRECOV: c_int = 1; ++pub const PR_FP_EXC_ASYNC: c_int = 2; ++pub const PR_FP_EXC_PRECISE: c_int = 3; ++ ++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; ++ ++pub const PR_SET_NAME: c_int = 15; ++pub const PR_GET_NAME: c_int = 16; ++ ++pub const PR_GET_ENDIAN: c_int = 19; ++pub const PR_SET_ENDIAN: c_int = 20; ++pub const PR_ENDIAN_BIG: c_int = 0; ++pub const PR_ENDIAN_LITTLE: c_int = 1; ++pub const PR_ENDIAN_PPC_LITTLE: c_int = 2; ++ ++pub const PR_GET_SECCOMP: c_int = 21; ++pub const PR_SET_SECCOMP: c_int = 22; ++ ++pub const PR_CAPBSET_READ: c_int = 23; ++pub const PR_CAPBSET_DROP: c_int = 24; ++ ++pub const PR_GET_TSC: c_int = 25; ++pub const PR_SET_TSC: c_int = 26; ++pub const PR_TSC_ENABLE: c_int = 1; ++pub const PR_TSC_SIGSEGV: c_int = 2; ++ ++pub const PR_GET_SECUREBITS: c_int = 27; ++pub const PR_SET_SECUREBITS: c_int = 28; ++ ++pub const PR_SET_TIMERSLACK: c_int = 29; ++pub const PR_GET_TIMERSLACK: c_int = 30; ++ ++pub const PR_TASK_PERF_EVENTS_DISABLE: c_int = 31; ++pub const PR_TASK_PERF_EVENTS_ENABLE: c_int = 32; ++ ++pub const PR_MCE_KILL: c_int = 33; ++pub const PR_MCE_KILL_CLEAR: c_int = 0; ++pub const PR_MCE_KILL_SET: c_int = 1; ++ ++pub const PR_MCE_KILL_LATE: c_int = 0; ++pub const PR_MCE_KILL_EARLY: c_int = 1; ++pub const PR_MCE_KILL_DEFAULT: c_int = 2; ++ ++pub const PR_MCE_KILL_GET: c_int = 34; ++ ++pub const PR_SET_MM: c_int = 35; ++pub const PR_SET_MM_START_CODE: c_int = 1; ++pub const PR_SET_MM_END_CODE: c_int = 2; ++pub const PR_SET_MM_START_DATA: c_int = 3; ++pub const PR_SET_MM_END_DATA: c_int = 4; ++pub const PR_SET_MM_START_STACK: c_int = 5; ++pub const PR_SET_MM_START_BRK: c_int = 6; ++pub const PR_SET_MM_BRK: c_int = 7; ++pub const PR_SET_MM_ARG_START: c_int = 8; ++pub const PR_SET_MM_ARG_END: c_int = 9; ++pub const PR_SET_MM_ENV_START: c_int = 10; ++pub const PR_SET_MM_ENV_END: c_int = 11; ++pub const PR_SET_MM_AUXV: c_int = 12; ++pub const PR_SET_MM_EXE_FILE: c_int = 13; ++pub const PR_SET_MM_MAP: c_int = 14; ++pub const PR_SET_MM_MAP_SIZE: c_int = 15; ++ ++pub const PR_SET_PTRACER: c_int = 0x59616d61; ++pub const PR_SET_PTRACER_ANY: c_ulong = 0xffffffffffffffff; ++ ++pub const PR_SET_CHILD_SUBREAPER: c_int = 36; ++pub const PR_GET_CHILD_SUBREAPER: c_int = 37; ++ ++pub const PR_SET_NO_NEW_PRIVS: c_int = 38; ++pub const PR_GET_NO_NEW_PRIVS: c_int = 39; ++ ++pub const PR_GET_TID_ADDRESS: c_int = 40; ++ ++pub const PR_SET_THP_DISABLE: c_int = 41; ++pub const PR_GET_THP_DISABLE: c_int = 42; ++ ++pub const PR_MPX_ENABLE_MANAGEMENT: c_int = 43; ++pub const PR_MPX_DISABLE_MANAGEMENT: c_int = 44; ++ ++pub const PR_SET_FP_MODE: c_int = 45; ++pub const PR_GET_FP_MODE: c_int = 46; ++pub const PR_FP_MODE_FR: c_int = 1 << 0; ++pub const PR_FP_MODE_FRE: c_int = 1 << 1; ++ ++pub const PR_CAP_AMBIENT: c_int = 47; ++pub const PR_CAP_AMBIENT_IS_SET: c_int = 1; ++pub const PR_CAP_AMBIENT_RAISE: c_int = 2; ++pub const PR_CAP_AMBIENT_LOWER: c_int = 3; ++pub const PR_CAP_AMBIENT_CLEAR_ALL: c_int = 4; ++ ++pub const PR_SET_VMA: c_int = 0x53564d41; ++pub const PR_SET_VMA_ANON_NAME: c_int = 0; ++ ++pub const PR_SCHED_CORE: c_int = 62; ++pub const PR_SCHED_CORE_GET: c_int = 0; ++pub const PR_SCHED_CORE_CREATE: c_int = 1; ++pub const PR_SCHED_CORE_SHARE_TO: c_int = 2; ++pub const PR_SCHED_CORE_SHARE_FROM: c_int = 3; ++pub const PR_SCHED_CORE_MAX: c_int = 4; ++pub const PR_SCHED_CORE_SCOPE_THREAD: c_int = 0; ++pub const PR_SCHED_CORE_SCOPE_THREAD_GROUP: c_int = 1; ++pub const PR_SCHED_CORE_SCOPE_PROCESS_GROUP: c_int = 2; ++ ++pub const GRND_NONBLOCK: c_uint = 0x0001; ++pub const GRND_RANDOM: c_uint = 0x0002; ++pub const GRND_INSECURE: c_uint = 0x0004; ++ ++// ++pub const SECCOMP_MODE_DISABLED: c_uint = 0; ++pub const SECCOMP_MODE_STRICT: c_uint = 1; ++pub const SECCOMP_MODE_FILTER: c_uint = 2; ++ ++pub const SECCOMP_SET_MODE_STRICT: c_uint = 0; ++pub const SECCOMP_SET_MODE_FILTER: c_uint = 1; ++pub const SECCOMP_GET_ACTION_AVAIL: c_uint = 2; ++pub const SECCOMP_GET_NOTIF_SIZES: c_uint = 3; ++ ++pub const SECCOMP_FILTER_FLAG_TSYNC: c_ulong = 1; ++pub const SECCOMP_FILTER_FLAG_LOG: c_ulong = 2; ++pub const SECCOMP_FILTER_FLAG_SPEC_ALLOW: c_ulong = 4; ++pub const SECCOMP_FILTER_FLAG_NEW_LISTENER: c_ulong = 8; ++pub const SECCOMP_FILTER_FLAG_TSYNC_ESRCH: c_ulong = 16; ++pub const SECCOMP_FILTER_FLAG_WAIT_KILLABLE_RECV: c_ulong = 32; ++ ++pub const SECCOMP_RET_KILL_PROCESS: c_uint = 0x80000000; ++pub const SECCOMP_RET_KILL_THREAD: c_uint = 0x00000000; ++pub const SECCOMP_RET_KILL: c_uint = SECCOMP_RET_KILL_THREAD; ++pub const SECCOMP_RET_TRAP: c_uint = 0x00030000; ++pub const SECCOMP_RET_ERRNO: c_uint = 0x00050000; ++pub const SECCOMP_RET_TRACE: c_uint = 0x7ff00000; ++pub const SECCOMP_RET_LOG: c_uint = 0x7ffc0000; ++pub const SECCOMP_RET_ALLOW: c_uint = 0x7fff0000; ++ ++pub const SECCOMP_RET_ACTION_FULL: c_uint = 0xffff0000; ++pub const SECCOMP_RET_ACTION: c_uint = 0x7fff0000; ++pub const SECCOMP_RET_DATA: c_uint = 0x0000ffff; ++ ++pub const SECCOMP_USER_NOTIF_FLAG_CONTINUE: c_ulong = 1; ++ ++pub const SECCOMP_ADDFD_FLAG_SETFD: c_ulong = 1; ++pub const SECCOMP_ADDFD_FLAG_SEND: c_ulong = 2; ++ ++pub const ITIMER_REAL: c_int = 0; ++pub const ITIMER_VIRTUAL: c_int = 1; ++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: crate::cc_t = 0; ++ ++pub const FALLOC_FL_KEEP_SIZE: c_int = 0x01; ++pub const FALLOC_FL_PUNCH_HOLE: c_int = 0x02; ++pub const FALLOC_FL_COLLAPSE_RANGE: c_int = 0x08; ++pub const FALLOC_FL_ZERO_RANGE: c_int = 0x10; ++pub const FALLOC_FL_INSERT_RANGE: c_int = 0x20; ++pub const FALLOC_FL_UNSHARE_RANGE: c_int = 0x40; ++ ++#[deprecated( ++ since = "0.2.55", ++ note = "ENOATTR is not available on Linux; use ENODATA instead" ++)] ++pub const ENOATTR: c_int = crate::ENODATA; ++ ++pub const SO_ORIGINAL_DST: c_int = 80; ++ ++pub const IP_RECVFRAGSIZE: c_int = 25; ++ ++pub const IPV6_FLOWINFO: c_int = 11; ++pub const IPV6_FLOWLABEL_MGR: c_int = 32; ++pub const IPV6_FLOWINFO_SEND: c_int = 33; ++pub const IPV6_RECVFRAGSIZE: c_int = 77; ++pub const IPV6_FREEBIND: c_int = 78; ++pub const IPV6_FLOWINFO_FLOWLABEL: c_int = 0x000fffff; ++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: crate::tcflag_t = 0x00004000; ++#[cfg(not(all(target_env = "uclibc", target_arch = "mips")))] ++pub const CMSPAR: crate::tcflag_t = 0o10000000000; ++ ++pub const MFD_CLOEXEC: c_uint = 0x0001; ++pub const MFD_ALLOW_SEALING: c_uint = 0x0002; ++pub const MFD_HUGETLB: c_uint = 0x0004; ++pub const MFD_NOEXEC_SEAL: c_uint = 0x0008; ++pub const MFD_EXEC: c_uint = 0x0010; ++pub const MFD_HUGE_64KB: c_uint = 0x40000000; ++pub const MFD_HUGE_512KB: c_uint = 0x4c000000; ++pub const MFD_HUGE_1MB: c_uint = 0x50000000; ++pub const MFD_HUGE_2MB: c_uint = 0x54000000; ++pub const MFD_HUGE_8MB: c_uint = 0x5c000000; ++pub const MFD_HUGE_16MB: c_uint = 0x60000000; ++pub const MFD_HUGE_32MB: c_uint = 0x64000000; ++pub const MFD_HUGE_256MB: c_uint = 0x70000000; ++pub const MFD_HUGE_512MB: c_uint = 0x74000000; ++pub const MFD_HUGE_1GB: c_uint = 0x78000000; ++pub const MFD_HUGE_2GB: c_uint = 0x7c000000; ++pub const MFD_HUGE_16GB: c_uint = 0x88000000; ++pub const MFD_HUGE_MASK: c_uint = 63; ++pub const MFD_HUGE_SHIFT: c_uint = 26; ++ ++// linux/close_range.h ++pub const CLOSE_RANGE_UNSHARE: c_uint = 1 << 1; ++pub const CLOSE_RANGE_CLOEXEC: c_uint = 1 << 2; ++ ++// linux/filter.h ++pub const SKF_AD_OFF: c_int = -0x1000; ++pub const SKF_AD_PROTOCOL: c_int = 0; ++pub const SKF_AD_PKTTYPE: c_int = 4; ++pub const SKF_AD_IFINDEX: c_int = 8; ++pub const SKF_AD_NLATTR: c_int = 12; ++pub const SKF_AD_NLATTR_NEST: c_int = 16; ++pub const SKF_AD_MARK: c_int = 20; ++pub const SKF_AD_QUEUE: c_int = 24; ++pub const SKF_AD_HATYPE: c_int = 28; ++pub const SKF_AD_RXHASH: c_int = 32; ++pub const SKF_AD_CPU: c_int = 36; ++pub const SKF_AD_ALU_XOR_X: c_int = 40; ++pub const SKF_AD_VLAN_TAG: c_int = 44; ++pub const SKF_AD_VLAN_TAG_PRESENT: c_int = 48; ++pub const SKF_AD_PAY_OFFSET: c_int = 52; ++pub const SKF_AD_RANDOM: c_int = 56; ++pub const SKF_AD_VLAN_TPID: c_int = 60; ++pub const SKF_AD_MAX: c_int = 64; ++pub const SKF_NET_OFF: c_int = -0x100000; ++pub const SKF_LL_OFF: c_int = -0x200000; ++pub const BPF_NET_OFF: c_int = SKF_NET_OFF; ++pub const BPF_LL_OFF: c_int = SKF_LL_OFF; ++pub const BPF_MEMWORDS: c_int = 16; ++pub const BPF_MAXINSNS: c_int = 4096; ++ ++// linux/bpf_common.h ++pub const BPF_LD: __u32 = 0x00; ++pub const BPF_LDX: __u32 = 0x01; ++pub const BPF_ST: __u32 = 0x02; ++pub const BPF_STX: __u32 = 0x03; ++pub const BPF_ALU: __u32 = 0x04; ++pub const BPF_JMP: __u32 = 0x05; ++pub const BPF_RET: __u32 = 0x06; ++pub const BPF_MISC: __u32 = 0x07; ++pub const BPF_W: __u32 = 0x00; ++pub const BPF_H: __u32 = 0x08; ++pub const BPF_B: __u32 = 0x10; ++pub const BPF_IMM: __u32 = 0x00; ++pub const BPF_ABS: __u32 = 0x20; ++pub const BPF_IND: __u32 = 0x40; ++pub const BPF_MEM: __u32 = 0x60; ++pub const BPF_LEN: __u32 = 0x80; ++pub const BPF_MSH: __u32 = 0xa0; ++pub const BPF_ADD: __u32 = 0x00; ++pub const BPF_SUB: __u32 = 0x10; ++pub const BPF_MUL: __u32 = 0x20; ++pub const BPF_DIV: __u32 = 0x30; ++pub const BPF_OR: __u32 = 0x40; ++pub const BPF_AND: __u32 = 0x50; ++pub const BPF_LSH: __u32 = 0x60; ++pub const BPF_RSH: __u32 = 0x70; ++pub const BPF_NEG: __u32 = 0x80; ++pub const BPF_MOD: __u32 = 0x90; ++pub const BPF_XOR: __u32 = 0xa0; ++pub const BPF_JA: __u32 = 0x00; ++pub const BPF_JEQ: __u32 = 0x10; ++pub const BPF_JGT: __u32 = 0x20; ++pub const BPF_JGE: __u32 = 0x30; ++pub const BPF_JSET: __u32 = 0x40; ++pub const BPF_K: __u32 = 0x00; ++pub const BPF_X: __u32 = 0x08; ++ ++// linux/openat2.h ++pub const RESOLVE_NO_XDEV: crate::__u64 = 0x01; ++pub const RESOLVE_NO_MAGICLINKS: crate::__u64 = 0x02; ++pub const RESOLVE_NO_SYMLINKS: crate::__u64 = 0x04; ++pub const RESOLVE_BENEATH: crate::__u64 = 0x08; ++pub const RESOLVE_IN_ROOT: crate::__u64 = 0x10; ++pub const RESOLVE_CACHED: crate::__u64 = 0x20; ++ ++// linux/if_ether.h ++pub const ETH_ALEN: c_int = 6; ++pub const ETH_HLEN: c_int = 14; ++pub const ETH_ZLEN: c_int = 60; ++pub const ETH_DATA_LEN: c_int = 1500; ++pub const ETH_FRAME_LEN: c_int = 1514; ++pub const ETH_FCS_LEN: c_int = 4; ++ ++// These are the defined Ethernet Protocol ID's. ++pub const ETH_P_LOOP: c_int = 0x0060; ++pub const ETH_P_PUP: c_int = 0x0200; ++pub const ETH_P_PUPAT: c_int = 0x0201; ++pub const ETH_P_IP: c_int = 0x0800; ++pub const ETH_P_X25: c_int = 0x0805; ++pub const ETH_P_ARP: c_int = 0x0806; ++pub const ETH_P_BPQ: c_int = 0x08FF; ++pub const ETH_P_IEEEPUP: c_int = 0x0a00; ++pub const ETH_P_IEEEPUPAT: c_int = 0x0a01; ++pub const ETH_P_BATMAN: c_int = 0x4305; ++pub const ETH_P_DEC: c_int = 0x6000; ++pub const ETH_P_DNA_DL: c_int = 0x6001; ++pub const ETH_P_DNA_RC: c_int = 0x6002; ++pub const ETH_P_DNA_RT: c_int = 0x6003; ++pub const ETH_P_LAT: c_int = 0x6004; ++pub const ETH_P_DIAG: c_int = 0x6005; ++pub const ETH_P_CUST: c_int = 0x6006; ++pub const ETH_P_SCA: c_int = 0x6007; ++pub const ETH_P_TEB: c_int = 0x6558; ++pub const ETH_P_RARP: c_int = 0x8035; ++pub const ETH_P_ATALK: c_int = 0x809B; ++pub const ETH_P_AARP: c_int = 0x80F3; ++pub const ETH_P_8021Q: c_int = 0x8100; ++pub const ETH_P_IPX: c_int = 0x8137; ++pub const ETH_P_IPV6: c_int = 0x86DD; ++pub const ETH_P_PAUSE: c_int = 0x8808; ++pub const ETH_P_SLOW: c_int = 0x8809; ++pub const ETH_P_WCCP: c_int = 0x883E; ++pub const ETH_P_MPLS_UC: c_int = 0x8847; ++pub const ETH_P_MPLS_MC: c_int = 0x8848; ++pub const ETH_P_ATMMPOA: c_int = 0x884c; ++pub const ETH_P_PPP_DISC: c_int = 0x8863; ++pub const ETH_P_PPP_SES: c_int = 0x8864; ++pub const ETH_P_LINK_CTL: c_int = 0x886c; ++pub const ETH_P_ATMFATE: c_int = 0x8884; ++pub const ETH_P_PAE: c_int = 0x888E; ++pub const ETH_P_AOE: c_int = 0x88A2; ++pub const ETH_P_8021AD: c_int = 0x88A8; ++pub const ETH_P_802_EX1: c_int = 0x88B5; ++pub const ETH_P_TIPC: c_int = 0x88CA; ++pub const ETH_P_MACSEC: c_int = 0x88E5; ++pub const ETH_P_8021AH: c_int = 0x88E7; ++pub const ETH_P_MVRP: c_int = 0x88F5; ++pub const ETH_P_1588: c_int = 0x88F7; ++pub const ETH_P_PRP: c_int = 0x88FB; ++pub const ETH_P_FCOE: c_int = 0x8906; ++pub const ETH_P_TDLS: c_int = 0x890D; ++pub const ETH_P_FIP: c_int = 0x8914; ++pub const ETH_P_80221: c_int = 0x8917; ++pub const ETH_P_LOOPBACK: c_int = 0x9000; ++pub const ETH_P_QINQ1: c_int = 0x9100; ++pub const ETH_P_QINQ2: c_int = 0x9200; ++pub const ETH_P_QINQ3: c_int = 0x9300; ++pub const ETH_P_EDSA: c_int = 0xDADA; ++pub const ETH_P_AF_IUCV: c_int = 0xFBFB; ++ ++pub const ETH_P_802_3_MIN: c_int = 0x0600; ++ ++// Non DIX types. Won't clash for 1500 types. ++pub const ETH_P_802_3: c_int = 0x0001; ++pub const ETH_P_AX25: c_int = 0x0002; ++pub const ETH_P_ALL: c_int = 0x0003; ++pub const ETH_P_802_2: c_int = 0x0004; ++pub const ETH_P_SNAP: c_int = 0x0005; ++pub const ETH_P_DDCMP: c_int = 0x0006; ++pub const ETH_P_WAN_PPP: c_int = 0x0007; ++pub const ETH_P_PPP_MP: c_int = 0x0008; ++pub const ETH_P_LOCALTALK: c_int = 0x0009; ++pub const ETH_P_CANFD: c_int = 0x000D; ++pub const ETH_P_PPPTALK: c_int = 0x0010; ++pub const ETH_P_TR_802_2: c_int = 0x0011; ++pub const ETH_P_MOBITEX: c_int = 0x0015; ++pub const ETH_P_CONTROL: c_int = 0x0016; ++pub const ETH_P_IRDA: c_int = 0x0017; ++pub const ETH_P_ECONET: c_int = 0x0018; ++pub const ETH_P_HDLC: c_int = 0x0019; ++pub const ETH_P_ARCNET: c_int = 0x001A; ++pub const ETH_P_DSA: c_int = 0x001B; ++pub const ETH_P_TRAILER: c_int = 0x001C; ++pub const ETH_P_PHONET: c_int = 0x00F5; ++pub const ETH_P_IEEE802154: c_int = 0x00F6; ++pub const ETH_P_CAIF: c_int = 0x00F7; ++ ++// DIFF(main): changed to `c_short` in f62eb023ab ++pub const POSIX_SPAWN_RESETIDS: c_int = 0x01; ++pub const POSIX_SPAWN_SETPGROUP: c_int = 0x02; ++pub const POSIX_SPAWN_SETSIGDEF: c_int = 0x04; ++pub const POSIX_SPAWN_SETSIGMASK: c_int = 0x08; ++pub const POSIX_SPAWN_SETSCHEDPARAM: c_int = 0x10; ++pub const POSIX_SPAWN_SETSCHEDULER: c_int = 0x20; ++ ++pub const NLMSG_NOOP: c_int = 0x1; ++pub const NLMSG_ERROR: c_int = 0x2; ++pub const NLMSG_DONE: c_int = 0x3; ++pub const NLMSG_OVERRUN: c_int = 0x4; ++pub const NLMSG_MIN_TYPE: c_int = 0x10; ++ ++// linux/netfilter/nfnetlink.h ++pub const NFNLGRP_NONE: c_int = 0; ++pub const NFNLGRP_CONNTRACK_NEW: c_int = 1; ++pub const NFNLGRP_CONNTRACK_UPDATE: c_int = 2; ++pub const NFNLGRP_CONNTRACK_DESTROY: c_int = 3; ++pub const NFNLGRP_CONNTRACK_EXP_NEW: c_int = 4; ++pub const NFNLGRP_CONNTRACK_EXP_UPDATE: c_int = 5; ++pub const NFNLGRP_CONNTRACK_EXP_DESTROY: c_int = 6; ++pub const NFNLGRP_NFTABLES: c_int = 7; ++pub const NFNLGRP_ACCT_QUOTA: c_int = 8; ++pub const NFNLGRP_NFTRACE: c_int = 9; ++ ++pub const NFNETLINK_V0: c_int = 0; ++ ++pub const NFNL_SUBSYS_NONE: c_int = 0; ++pub const NFNL_SUBSYS_CTNETLINK: c_int = 1; ++pub const NFNL_SUBSYS_CTNETLINK_EXP: c_int = 2; ++pub const NFNL_SUBSYS_QUEUE: c_int = 3; ++pub const NFNL_SUBSYS_ULOG: c_int = 4; ++pub const NFNL_SUBSYS_OSF: c_int = 5; ++pub const NFNL_SUBSYS_IPSET: c_int = 6; ++pub const NFNL_SUBSYS_ACCT: c_int = 7; ++pub const NFNL_SUBSYS_CTNETLINK_TIMEOUT: c_int = 8; ++pub const NFNL_SUBSYS_CTHELPER: c_int = 9; ++pub const NFNL_SUBSYS_NFTABLES: c_int = 10; ++pub const NFNL_SUBSYS_NFT_COMPAT: c_int = 11; ++pub const NFNL_SUBSYS_HOOK: c_int = 12; ++pub const NFNL_SUBSYS_COUNT: c_int = 13; ++ ++pub const NFNL_MSG_BATCH_BEGIN: c_int = NLMSG_MIN_TYPE; ++pub const NFNL_MSG_BATCH_END: c_int = NLMSG_MIN_TYPE + 1; ++ ++pub const NFNL_BATCH_UNSPEC: c_int = 0; ++pub const NFNL_BATCH_GENID: c_int = 1; ++ ++// linux/netfilter/nfnetlink_log.h ++pub const NFULNL_MSG_PACKET: c_int = 0; ++pub const NFULNL_MSG_CONFIG: c_int = 1; ++ ++pub const NFULA_VLAN_UNSPEC: c_int = 0; ++pub const NFULA_VLAN_PROTO: c_int = 1; ++pub const NFULA_VLAN_TCI: c_int = 2; ++ ++pub const NFULA_UNSPEC: c_int = 0; ++pub const NFULA_PACKET_HDR: c_int = 1; ++pub const NFULA_MARK: c_int = 2; ++pub const NFULA_TIMESTAMP: c_int = 3; ++pub const NFULA_IFINDEX_INDEV: c_int = 4; ++pub const NFULA_IFINDEX_OUTDEV: c_int = 5; ++pub const NFULA_IFINDEX_PHYSINDEV: c_int = 6; ++pub const NFULA_IFINDEX_PHYSOUTDEV: c_int = 7; ++pub const NFULA_HWADDR: c_int = 8; ++pub const NFULA_PAYLOAD: c_int = 9; ++pub const NFULA_PREFIX: c_int = 10; ++pub const NFULA_UID: c_int = 11; ++pub const NFULA_SEQ: c_int = 12; ++pub const NFULA_SEQ_GLOBAL: c_int = 13; ++pub const NFULA_GID: c_int = 14; ++pub const NFULA_HWTYPE: c_int = 15; ++pub const NFULA_HWHEADER: c_int = 16; ++pub const NFULA_HWLEN: c_int = 17; ++pub const NFULA_CT: c_int = 18; ++pub const NFULA_CT_INFO: c_int = 19; ++pub const NFULA_VLAN: c_int = 20; ++pub const NFULA_L2HDR: c_int = 21; ++ ++pub const NFULNL_CFG_CMD_NONE: c_int = 0; ++pub const NFULNL_CFG_CMD_BIND: c_int = 1; ++pub const NFULNL_CFG_CMD_UNBIND: c_int = 2; ++pub const NFULNL_CFG_CMD_PF_BIND: c_int = 3; ++pub const NFULNL_CFG_CMD_PF_UNBIND: c_int = 4; ++ ++pub const NFULA_CFG_UNSPEC: c_int = 0; ++pub const NFULA_CFG_CMD: c_int = 1; ++pub const NFULA_CFG_MODE: c_int = 2; ++pub const NFULA_CFG_NLBUFSIZ: c_int = 3; ++pub const NFULA_CFG_TIMEOUT: c_int = 4; ++pub const NFULA_CFG_QTHRESH: c_int = 5; ++pub const NFULA_CFG_FLAGS: c_int = 6; ++ ++pub const NFULNL_COPY_NONE: c_int = 0x00; ++pub const NFULNL_COPY_META: c_int = 0x01; ++pub const NFULNL_COPY_PACKET: c_int = 0x02; ++ ++pub const NFULNL_CFG_F_SEQ: c_int = 0x0001; ++pub const NFULNL_CFG_F_SEQ_GLOBAL: c_int = 0x0002; ++pub const NFULNL_CFG_F_CONNTRACK: c_int = 0x0004; ++ ++// linux/netfilter/nfnetlink_queue.h ++pub const NFQNL_MSG_PACKET: c_int = 0; ++pub const NFQNL_MSG_VERDICT: c_int = 1; ++pub const NFQNL_MSG_CONFIG: c_int = 2; ++pub const NFQNL_MSG_VERDICT_BATCH: c_int = 3; ++ ++pub const NFQA_UNSPEC: c_int = 0; ++pub const NFQA_PACKET_HDR: c_int = 1; ++pub const NFQA_VERDICT_HDR: c_int = 2; ++pub const NFQA_MARK: c_int = 3; ++pub const NFQA_TIMESTAMP: c_int = 4; ++pub const NFQA_IFINDEX_INDEV: c_int = 5; ++pub const NFQA_IFINDEX_OUTDEV: c_int = 6; ++pub const NFQA_IFINDEX_PHYSINDEV: c_int = 7; ++pub const NFQA_IFINDEX_PHYSOUTDEV: c_int = 8; ++pub const NFQA_HWADDR: c_int = 9; ++pub const NFQA_PAYLOAD: c_int = 10; ++pub const NFQA_CT: c_int = 11; ++pub const NFQA_CT_INFO: c_int = 12; ++pub const NFQA_CAP_LEN: c_int = 13; ++pub const NFQA_SKB_INFO: c_int = 14; ++pub const NFQA_EXP: c_int = 15; ++pub const NFQA_UID: c_int = 16; ++pub const NFQA_GID: c_int = 17; ++pub const NFQA_SECCTX: c_int = 18; ++pub const NFQA_VLAN: c_int = 19; ++pub const NFQA_L2HDR: c_int = 20; ++pub const NFQA_PRIORITY: c_int = 21; ++ ++pub const NFQA_VLAN_UNSPEC: c_int = 0; ++pub const NFQA_VLAN_PROTO: c_int = 1; ++pub const NFQA_VLAN_TCI: c_int = 2; ++ ++pub const NFQNL_CFG_CMD_NONE: c_int = 0; ++pub const NFQNL_CFG_CMD_BIND: c_int = 1; ++pub const NFQNL_CFG_CMD_UNBIND: c_int = 2; ++pub const NFQNL_CFG_CMD_PF_BIND: c_int = 3; ++pub const NFQNL_CFG_CMD_PF_UNBIND: c_int = 4; ++ ++pub const NFQNL_COPY_NONE: c_int = 0; ++pub const NFQNL_COPY_META: c_int = 1; ++pub const NFQNL_COPY_PACKET: c_int = 2; ++ ++pub const NFQA_CFG_UNSPEC: c_int = 0; ++pub const NFQA_CFG_CMD: c_int = 1; ++pub const NFQA_CFG_PARAMS: c_int = 2; ++pub const NFQA_CFG_QUEUE_MAXLEN: c_int = 3; ++pub const NFQA_CFG_MASK: c_int = 4; ++pub const NFQA_CFG_FLAGS: c_int = 5; ++ ++pub const NFQA_CFG_F_FAIL_OPEN: c_int = 0x0001; ++pub const NFQA_CFG_F_CONNTRACK: c_int = 0x0002; ++pub const NFQA_CFG_F_GSO: c_int = 0x0004; ++pub const NFQA_CFG_F_UID_GID: c_int = 0x0008; ++pub const NFQA_CFG_F_SECCTX: c_int = 0x0010; ++pub const NFQA_CFG_F_MAX: c_int = 0x0020; ++ ++pub const NFQA_SKB_CSUMNOTREADY: c_int = 0x0001; ++pub const NFQA_SKB_GSO: c_int = 0x0002; ++pub const NFQA_SKB_CSUM_NOTVERIFIED: c_int = 0x0004; ++ ++// linux/genetlink.h ++ ++pub const GENL_NAMSIZ: c_int = 16; ++ ++pub const GENL_MIN_ID: c_int = NLMSG_MIN_TYPE; ++pub const GENL_MAX_ID: c_int = 1023; ++ ++pub const GENL_ADMIN_PERM: c_int = 0x01; ++pub const GENL_CMD_CAP_DO: c_int = 0x02; ++pub const GENL_CMD_CAP_DUMP: c_int = 0x04; ++pub const GENL_CMD_CAP_HASPOL: c_int = 0x08; ++ ++pub const GENL_ID_CTRL: c_int = NLMSG_MIN_TYPE; ++ ++pub const CTRL_CMD_UNSPEC: c_int = 0; ++pub const CTRL_CMD_NEWFAMILY: c_int = 1; ++pub const CTRL_CMD_DELFAMILY: c_int = 2; ++pub const CTRL_CMD_GETFAMILY: c_int = 3; ++pub const CTRL_CMD_NEWOPS: c_int = 4; ++pub const CTRL_CMD_DELOPS: c_int = 5; ++pub const CTRL_CMD_GETOPS: c_int = 6; ++pub const CTRL_CMD_NEWMCAST_GRP: c_int = 7; ++pub const CTRL_CMD_DELMCAST_GRP: c_int = 8; ++pub const CTRL_CMD_GETMCAST_GRP: c_int = 9; ++ ++pub const CTRL_ATTR_UNSPEC: c_int = 0; ++pub const CTRL_ATTR_FAMILY_ID: c_int = 1; ++pub const CTRL_ATTR_FAMILY_NAME: c_int = 2; ++pub const CTRL_ATTR_VERSION: c_int = 3; ++pub const CTRL_ATTR_HDRSIZE: c_int = 4; ++pub const CTRL_ATTR_MAXATTR: c_int = 5; ++pub const CTRL_ATTR_OPS: c_int = 6; ++pub const CTRL_ATTR_MCAST_GROUPS: c_int = 7; ++ ++pub const CTRL_ATTR_OP_UNSPEC: c_int = 0; ++pub const CTRL_ATTR_OP_ID: c_int = 1; ++pub const CTRL_ATTR_OP_FLAGS: c_int = 2; ++ ++pub const CTRL_ATTR_MCAST_GRP_UNSPEC: c_int = 0; ++pub const CTRL_ATTR_MCAST_GRP_NAME: c_int = 1; ++pub const CTRL_ATTR_MCAST_GRP_ID: c_int = 2; ++ ++// linux/if_packet.h ++pub const PACKET_HOST: c_uchar = 0; ++pub const PACKET_BROADCAST: c_uchar = 1; ++pub const PACKET_MULTICAST: c_uchar = 2; ++pub const PACKET_OTHERHOST: c_uchar = 3; ++pub const PACKET_OUTGOING: c_uchar = 4; ++pub const PACKET_LOOPBACK: c_uchar = 5; ++pub const PACKET_USER: c_uchar = 6; ++pub const PACKET_KERNEL: c_uchar = 7; ++ ++pub const PACKET_ADD_MEMBERSHIP: c_int = 1; ++pub const PACKET_DROP_MEMBERSHIP: c_int = 2; ++pub const PACKET_RX_RING: c_int = 5; ++pub const PACKET_STATISTICS: c_int = 6; ++pub const PACKET_AUXDATA: c_int = 8; ++pub const PACKET_VERSION: c_int = 10; ++pub const PACKET_RESERVE: c_int = 12; ++pub const PACKET_TX_RING: c_int = 13; ++pub const PACKET_LOSS: c_int = 14; ++pub const PACKET_TIMESTAMP: c_int = 17; ++pub const PACKET_FANOUT: c_int = 18; ++pub const PACKET_QDISC_BYPASS: c_int = 20; ++ ++pub const PACKET_FANOUT_HASH: c_uint = 0; ++pub const PACKET_FANOUT_LB: c_uint = 1; ++pub const PACKET_FANOUT_CPU: c_uint = 2; ++pub const PACKET_FANOUT_ROLLOVER: c_uint = 3; ++pub const PACKET_FANOUT_RND: c_uint = 4; ++pub const PACKET_FANOUT_QM: c_uint = 5; ++pub const PACKET_FANOUT_CBPF: c_uint = 6; ++pub const PACKET_FANOUT_EBPF: c_uint = 7; ++pub const PACKET_FANOUT_FLAG_ROLLOVER: c_uint = 0x1000; ++pub const PACKET_FANOUT_FLAG_UNIQUEID: c_uint = 0x2000; ++pub const PACKET_FANOUT_FLAG_DEFRAG: c_uint = 0x8000; ++ ++pub const PACKET_MR_MULTICAST: c_int = 0; ++pub const PACKET_MR_PROMISC: c_int = 1; ++pub const PACKET_MR_ALLMULTI: c_int = 2; ++ ++pub const TP_STATUS_KERNEL: __u32 = 0; ++pub const TP_STATUS_USER: __u32 = 1 << 0; ++pub const TP_STATUS_COPY: __u32 = 1 << 1; ++pub const TP_STATUS_LOSING: __u32 = 1 << 2; ++pub const TP_STATUS_CSUMNOTREADY: __u32 = 1 << 3; ++pub const TP_STATUS_VLAN_VALID: __u32 = 1 << 4; ++pub const TP_STATUS_BLK_TMO: __u32 = 1 << 5; ++pub const TP_STATUS_VLAN_TPID_VALID: __u32 = 1 << 6; ++pub const TP_STATUS_CSUM_VALID: __u32 = 1 << 7; ++ ++pub const TP_STATUS_AVAILABLE: __u32 = 0; ++pub const TP_STATUS_SEND_REQUEST: __u32 = 1 << 0; ++pub const TP_STATUS_SENDING: __u32 = 1 << 1; ++pub const TP_STATUS_WRONG_FORMAT: __u32 = 1 << 2; ++ ++pub const TP_STATUS_TS_SOFTWARE: __u32 = 1 << 29; ++pub const TP_STATUS_TS_SYS_HARDWARE: __u32 = 1 << 30; ++pub const TP_STATUS_TS_RAW_HARDWARE: __u32 = 1 << 31; ++ ++pub const TP_FT_REQ_FILL_RXHASH: __u32 = 1; ++ ++pub const TPACKET_ALIGNMENT: usize = 16; ++ ++pub const TPACKET_HDRLEN: usize = ((size_of::() + TPACKET_ALIGNMENT - 1) ++ & !(TPACKET_ALIGNMENT - 1)) ++ + size_of::(); ++pub const TPACKET2_HDRLEN: usize = ((size_of::() + TPACKET_ALIGNMENT - 1) ++ & !(TPACKET_ALIGNMENT - 1)) ++ + size_of::(); ++pub const TPACKET3_HDRLEN: usize = ((size_of::() + TPACKET_ALIGNMENT - 1) ++ & !(TPACKET_ALIGNMENT - 1)) ++ + size_of::(); ++ ++// linux/netfilter.h ++pub const NF_DROP: c_int = 0; ++pub const NF_ACCEPT: c_int = 1; ++pub const NF_STOLEN: c_int = 2; ++pub const NF_QUEUE: c_int = 3; ++pub const NF_REPEAT: c_int = 4; ++pub const NF_STOP: c_int = 5; ++pub const NF_MAX_VERDICT: c_int = NF_STOP; ++ ++pub const NF_VERDICT_MASK: c_int = 0x000000ff; ++pub const NF_VERDICT_FLAG_QUEUE_BYPASS: c_int = 0x00008000; ++ ++pub const NF_VERDICT_QMASK: c_int = 0xffff0000; ++pub const NF_VERDICT_QBITS: c_int = 16; ++ ++pub const NF_VERDICT_BITS: c_int = 16; ++ ++pub const NF_INET_PRE_ROUTING: c_int = 0; ++pub const NF_INET_LOCAL_IN: c_int = 1; ++pub const NF_INET_FORWARD: c_int = 2; ++pub const NF_INET_LOCAL_OUT: c_int = 3; ++pub const NF_INET_POST_ROUTING: c_int = 4; ++pub const NF_INET_NUMHOOKS: c_int = 5; ++pub const NF_INET_INGRESS: c_int = NF_INET_NUMHOOKS; ++ ++pub const NF_NETDEV_INGRESS: c_int = 0; ++pub const NF_NETDEV_EGRESS: c_int = 1; ++pub const NF_NETDEV_NUMHOOKS: c_int = 2; ++ ++// Some NFPROTO are not compatible with musl and are defined in submodules. ++pub const NFPROTO_UNSPEC: c_int = 0; ++pub const NFPROTO_INET: c_int = 1; ++pub const NFPROTO_IPV4: c_int = 2; ++pub const NFPROTO_ARP: c_int = 3; ++pub const NFPROTO_NETDEV: c_int = 5; ++pub const NFPROTO_BRIDGE: c_int = 7; ++pub const NFPROTO_IPV6: c_int = 10; ++pub const NFPROTO_DECNET: c_int = 12; ++pub const NFPROTO_NUMPROTO: c_int = 13; ++ ++// linux/netfilter_arp.h ++pub const NF_ARP: c_int = 0; ++pub const NF_ARP_IN: c_int = 0; ++pub const NF_ARP_OUT: c_int = 1; ++pub const NF_ARP_FORWARD: c_int = 2; ++pub const NF_ARP_NUMHOOKS: c_int = 3; ++ ++// linux/netfilter_bridge.h ++pub const NF_BR_PRE_ROUTING: c_int = 0; ++pub const NF_BR_LOCAL_IN: c_int = 1; ++pub const NF_BR_FORWARD: c_int = 2; ++pub const NF_BR_LOCAL_OUT: c_int = 3; ++pub const NF_BR_POST_ROUTING: c_int = 4; ++pub const NF_BR_BROUTING: c_int = 5; ++pub const NF_BR_NUMHOOKS: c_int = 6; ++ ++pub const NF_BR_PRI_FIRST: c_int = crate::INT_MIN; ++pub const NF_BR_PRI_NAT_DST_BRIDGED: c_int = -300; ++pub const NF_BR_PRI_FILTER_BRIDGED: c_int = -200; ++pub const NF_BR_PRI_BRNF: c_int = 0; ++pub const NF_BR_PRI_NAT_DST_OTHER: c_int = 100; ++pub const NF_BR_PRI_FILTER_OTHER: c_int = 200; ++pub const NF_BR_PRI_NAT_SRC: c_int = 300; ++pub const NF_BR_PRI_LAST: c_int = crate::INT_MAX; ++ ++// linux/netfilter_ipv4.h ++pub const NF_IP_PRE_ROUTING: c_int = 0; ++pub const NF_IP_LOCAL_IN: c_int = 1; ++pub const NF_IP_FORWARD: c_int = 2; ++pub const NF_IP_LOCAL_OUT: c_int = 3; ++pub const NF_IP_POST_ROUTING: c_int = 4; ++pub const NF_IP_NUMHOOKS: c_int = 5; ++ ++pub const NF_IP_PRI_FIRST: c_int = crate::INT_MIN; ++pub const NF_IP_PRI_RAW_BEFORE_DEFRAG: c_int = -450; ++pub const NF_IP_PRI_CONNTRACK_DEFRAG: c_int = -400; ++pub const NF_IP_PRI_RAW: c_int = -300; ++pub const NF_IP_PRI_SELINUX_FIRST: c_int = -225; ++pub const NF_IP_PRI_CONNTRACK: c_int = -200; ++pub const NF_IP_PRI_MANGLE: c_int = -150; ++pub const NF_IP_PRI_NAT_DST: c_int = -100; ++pub const NF_IP_PRI_FILTER: c_int = 0; ++pub const NF_IP_PRI_SECURITY: c_int = 50; ++pub const NF_IP_PRI_NAT_SRC: c_int = 100; ++pub const NF_IP_PRI_SELINUX_LAST: c_int = 225; ++pub const NF_IP_PRI_CONNTRACK_HELPER: c_int = 300; ++pub const NF_IP_PRI_CONNTRACK_CONFIRM: c_int = crate::INT_MAX; ++pub const NF_IP_PRI_LAST: c_int = crate::INT_MAX; ++ ++// linux/netfilter_ipv6.h ++pub const NF_IP6_PRE_ROUTING: c_int = 0; ++pub const NF_IP6_LOCAL_IN: c_int = 1; ++pub const NF_IP6_FORWARD: c_int = 2; ++pub const NF_IP6_LOCAL_OUT: c_int = 3; ++pub const NF_IP6_POST_ROUTING: c_int = 4; ++pub const NF_IP6_NUMHOOKS: c_int = 5; ++ ++pub const NF_IP6_PRI_FIRST: c_int = crate::INT_MIN; ++pub const NF_IP6_PRI_RAW_BEFORE_DEFRAG: c_int = -450; ++pub const NF_IP6_PRI_CONNTRACK_DEFRAG: c_int = -400; ++pub const NF_IP6_PRI_RAW: c_int = -300; ++pub const NF_IP6_PRI_SELINUX_FIRST: c_int = -225; ++pub const NF_IP6_PRI_CONNTRACK: c_int = -200; ++pub const NF_IP6_PRI_MANGLE: c_int = -150; ++pub const NF_IP6_PRI_NAT_DST: c_int = -100; ++pub const NF_IP6_PRI_FILTER: c_int = 0; ++pub const NF_IP6_PRI_SECURITY: c_int = 50; ++pub const NF_IP6_PRI_NAT_SRC: c_int = 100; ++pub const NF_IP6_PRI_SELINUX_LAST: c_int = 225; ++pub const NF_IP6_PRI_CONNTRACK_HELPER: c_int = 300; ++pub const NF_IP6_PRI_LAST: c_int = crate::INT_MAX; ++ ++// linux/netfilter_ipv6/ip6_tables.h ++pub const IP6T_SO_ORIGINAL_DST: c_int = 80; ++ ++pub const SIOCADDRT: c_ulong = 0x0000890B; ++pub const SIOCDELRT: c_ulong = 0x0000890C; ++pub const SIOCGIFNAME: c_ulong = 0x00008910; ++pub const SIOCSIFLINK: c_ulong = 0x00008911; ++pub const SIOCGIFCONF: c_ulong = 0x00008912; ++pub const SIOCGIFFLAGS: c_ulong = 0x00008913; ++pub const SIOCSIFFLAGS: c_ulong = 0x00008914; ++pub const SIOCGIFADDR: c_ulong = 0x00008915; ++pub const SIOCSIFADDR: c_ulong = 0x00008916; ++pub const SIOCGIFDSTADDR: c_ulong = 0x00008917; ++pub const SIOCSIFDSTADDR: c_ulong = 0x00008918; ++pub const SIOCGIFBRDADDR: c_ulong = 0x00008919; ++pub const SIOCSIFBRDADDR: c_ulong = 0x0000891A; ++pub const SIOCGIFNETMASK: c_ulong = 0x0000891B; ++pub const SIOCSIFNETMASK: c_ulong = 0x0000891C; ++pub const SIOCGIFMETRIC: c_ulong = 0x0000891D; ++pub const SIOCSIFMETRIC: c_ulong = 0x0000891E; ++pub const SIOCGIFMEM: c_ulong = 0x0000891F; ++pub const SIOCSIFMEM: c_ulong = 0x00008920; ++pub const SIOCGIFMTU: c_ulong = 0x00008921; ++pub const SIOCSIFMTU: c_ulong = 0x00008922; ++pub const SIOCSIFNAME: c_ulong = 0x00008923; ++pub const SIOCSIFHWADDR: c_ulong = 0x00008924; ++pub const SIOCGIFENCAP: c_ulong = 0x00008925; ++pub const SIOCSIFENCAP: c_ulong = 0x00008926; ++pub const SIOCGIFHWADDR: c_ulong = 0x00008927; ++pub const SIOCGIFSLAVE: c_ulong = 0x00008929; ++pub const SIOCSIFSLAVE: c_ulong = 0x00008930; ++pub const SIOCADDMULTI: c_ulong = 0x00008931; ++pub const SIOCDELMULTI: c_ulong = 0x00008932; ++pub const SIOCGIFINDEX: c_ulong = 0x00008933; ++pub const SIOGIFINDEX: c_ulong = SIOCGIFINDEX; ++pub const SIOCSIFPFLAGS: c_ulong = 0x00008934; ++pub const SIOCGIFPFLAGS: c_ulong = 0x00008935; ++pub const SIOCDIFADDR: c_ulong = 0x00008936; ++pub const SIOCSIFHWBROADCAST: c_ulong = 0x00008937; ++pub const SIOCGIFCOUNT: c_ulong = 0x00008938; ++pub const SIOCGIFBR: c_ulong = 0x00008940; ++pub const SIOCSIFBR: c_ulong = 0x00008941; ++pub const SIOCGIFTXQLEN: c_ulong = 0x00008942; ++pub const SIOCSIFTXQLEN: c_ulong = 0x00008943; ++pub const SIOCETHTOOL: c_ulong = 0x00008946; ++pub const SIOCGMIIPHY: c_ulong = 0x00008947; ++pub const SIOCGMIIREG: c_ulong = 0x00008948; ++pub const SIOCSMIIREG: c_ulong = 0x00008949; ++pub const SIOCWANDEV: c_ulong = 0x0000894A; ++pub const SIOCOUTQNSD: c_ulong = 0x0000894B; ++pub const SIOCGSKNS: c_ulong = 0x0000894C; ++pub const SIOCDARP: c_ulong = 0x00008953; ++pub const SIOCGARP: c_ulong = 0x00008954; ++pub const SIOCSARP: c_ulong = 0x00008955; ++pub const SIOCDRARP: c_ulong = 0x00008960; ++pub const SIOCGRARP: c_ulong = 0x00008961; ++pub const SIOCSRARP: c_ulong = 0x00008962; ++pub const SIOCGIFMAP: c_ulong = 0x00008970; ++pub const SIOCSIFMAP: c_ulong = 0x00008971; ++pub const SIOCSHWTSTAMP: c_ulong = 0x000089b0; ++pub const SIOCGHWTSTAMP: c_ulong = 0x000089b1; ++ ++// wireless.h ++pub const WIRELESS_EXT: c_ulong = 0x16; ++ ++pub const SIOCSIWCOMMIT: c_ulong = 0x8B00; ++pub const SIOCGIWNAME: c_ulong = 0x8B01; ++ ++pub const SIOCSIWNWID: c_ulong = 0x8B02; ++pub const SIOCGIWNWID: c_ulong = 0x8B03; ++pub const SIOCSIWFREQ: c_ulong = 0x8B04; ++pub const SIOCGIWFREQ: c_ulong = 0x8B05; ++pub const SIOCSIWMODE: c_ulong = 0x8B06; ++pub const SIOCGIWMODE: c_ulong = 0x8B07; ++pub const SIOCSIWSENS: c_ulong = 0x8B08; ++pub const SIOCGIWSENS: c_ulong = 0x8B09; ++ ++pub const SIOCSIWRANGE: c_ulong = 0x8B0A; ++pub const SIOCGIWRANGE: c_ulong = 0x8B0B; ++pub const SIOCSIWPRIV: c_ulong = 0x8B0C; ++pub const SIOCGIWPRIV: c_ulong = 0x8B0D; ++pub const SIOCSIWSTATS: c_ulong = 0x8B0E; ++pub const SIOCGIWSTATS: c_ulong = 0x8B0F; ++ ++pub const SIOCSIWSPY: c_ulong = 0x8B10; ++pub const SIOCGIWSPY: c_ulong = 0x8B11; ++pub const SIOCSIWTHRSPY: c_ulong = 0x8B12; ++pub const SIOCGIWTHRSPY: c_ulong = 0x8B13; ++ ++pub const SIOCSIWAP: c_ulong = 0x8B14; ++pub const SIOCGIWAP: c_ulong = 0x8B15; ++pub const SIOCGIWAPLIST: c_ulong = 0x8B17; ++pub const SIOCSIWSCAN: c_ulong = 0x8B18; ++pub const SIOCGIWSCAN: c_ulong = 0x8B19; ++ ++pub const SIOCSIWESSID: c_ulong = 0x8B1A; ++pub const SIOCGIWESSID: c_ulong = 0x8B1B; ++pub const SIOCSIWNICKN: c_ulong = 0x8B1C; ++pub const SIOCGIWNICKN: c_ulong = 0x8B1D; ++ ++pub const SIOCSIWRATE: c_ulong = 0x8B20; ++pub const SIOCGIWRATE: c_ulong = 0x8B21; ++pub const SIOCSIWRTS: c_ulong = 0x8B22; ++pub const SIOCGIWRTS: c_ulong = 0x8B23; ++pub const SIOCSIWFRAG: c_ulong = 0x8B24; ++pub const SIOCGIWFRAG: c_ulong = 0x8B25; ++pub const SIOCSIWTXPOW: c_ulong = 0x8B26; ++pub const SIOCGIWTXPOW: c_ulong = 0x8B27; ++pub const SIOCSIWRETRY: c_ulong = 0x8B28; ++pub const SIOCGIWRETRY: c_ulong = 0x8B29; ++ ++pub const SIOCSIWENCODE: c_ulong = 0x8B2A; ++pub const SIOCGIWENCODE: c_ulong = 0x8B2B; ++ ++pub const SIOCSIWPOWER: c_ulong = 0x8B2C; ++pub const SIOCGIWPOWER: c_ulong = 0x8B2D; ++ ++pub const SIOCSIWGENIE: c_ulong = 0x8B30; ++pub const SIOCGIWGENIE: c_ulong = 0x8B31; ++ ++pub const SIOCSIWMLME: c_ulong = 0x8B16; ++ ++pub const SIOCSIWAUTH: c_ulong = 0x8B32; ++pub const SIOCGIWAUTH: c_ulong = 0x8B33; ++ ++pub const SIOCSIWENCODEEXT: c_ulong = 0x8B34; ++pub const SIOCGIWENCODEEXT: c_ulong = 0x8B35; ++ ++pub const SIOCSIWPMKSA: c_ulong = 0x8B36; ++ ++pub const SIOCIWFIRSTPRIV: c_ulong = 0x8BE0; ++pub const SIOCIWLASTPRIV: c_ulong = 0x8BFF; ++ ++pub const SIOCIWFIRST: c_ulong = 0x8B00; ++pub const SIOCIWLAST: c_ulong = SIOCIWLASTPRIV; ++ ++pub const IWEVTXDROP: c_ulong = 0x8C00; ++pub const IWEVQUAL: c_ulong = 0x8C01; ++pub const IWEVCUSTOM: c_ulong = 0x8C02; ++pub const IWEVREGISTERED: c_ulong = 0x8C03; ++pub const IWEVEXPIRED: c_ulong = 0x8C04; ++pub const IWEVGENIE: c_ulong = 0x8C05; ++pub const IWEVMICHAELMICFAILURE: c_ulong = 0x8C06; ++pub const IWEVASSOCREQIE: c_ulong = 0x8C07; ++pub const IWEVASSOCRESPIE: c_ulong = 0x8C08; ++pub const IWEVPMKIDCAND: c_ulong = 0x8C09; ++pub const IWEVFIRST: c_ulong = 0x8C00; ++ ++pub const IW_PRIV_TYPE_MASK: c_ulong = 0x7000; ++pub const IW_PRIV_TYPE_NONE: c_ulong = 0x0000; ++pub const IW_PRIV_TYPE_BYTE: c_ulong = 0x1000; ++pub const IW_PRIV_TYPE_CHAR: c_ulong = 0x2000; ++pub const IW_PRIV_TYPE_INT: c_ulong = 0x4000; ++pub const IW_PRIV_TYPE_FLOAT: c_ulong = 0x5000; ++pub const IW_PRIV_TYPE_ADDR: c_ulong = 0x6000; ++ ++pub const IW_PRIV_SIZE_FIXED: c_ulong = 0x0800; ++ ++pub const IW_PRIV_SIZE_MASK: c_ulong = 0x07FF; ++ ++pub const IW_MAX_FREQUENCIES: usize = 32; ++pub const IW_MAX_BITRATES: usize = 32; ++pub const IW_MAX_TXPOWER: usize = 8; ++pub const IW_MAX_SPY: usize = 8; ++pub const IW_MAX_AP: usize = 64; ++pub const IW_ESSID_MAX_SIZE: usize = 32; ++ ++pub const IW_MODE_AUTO: usize = 0; ++pub const IW_MODE_ADHOC: usize = 1; ++pub const IW_MODE_INFRA: usize = 2; ++pub const IW_MODE_MASTER: usize = 3; ++pub const IW_MODE_REPEAT: usize = 4; ++pub const IW_MODE_SECOND: usize = 5; ++pub const IW_MODE_MONITOR: usize = 6; ++pub const IW_MODE_MESH: usize = 7; ++ ++pub const IW_QUAL_QUAL_UPDATED: c_ulong = 0x01; ++pub const IW_QUAL_LEVEL_UPDATED: c_ulong = 0x02; ++pub const IW_QUAL_NOISE_UPDATED: c_ulong = 0x04; ++pub const IW_QUAL_ALL_UPDATED: c_ulong = 0x07; ++pub const IW_QUAL_DBM: c_ulong = 0x08; ++pub const IW_QUAL_QUAL_INVALID: c_ulong = 0x10; ++pub const IW_QUAL_LEVEL_INVALID: c_ulong = 0x20; ++pub const IW_QUAL_NOISE_INVALID: c_ulong = 0x40; ++pub const IW_QUAL_RCPI: c_ulong = 0x80; ++pub const IW_QUAL_ALL_INVALID: c_ulong = 0x70; ++ ++pub const IW_FREQ_AUTO: c_ulong = 0x00; ++pub const IW_FREQ_FIXED: c_ulong = 0x01; ++ ++pub const IW_MAX_ENCODING_SIZES: usize = 8; ++pub const IW_ENCODING_TOKEN_MAX: usize = 64; ++ ++pub const IW_ENCODE_INDEX: c_ulong = 0x00FF; ++pub const IW_ENCODE_FLAGS: c_ulong = 0xFF00; ++pub const IW_ENCODE_MODE: c_ulong = 0xF000; ++pub const IW_ENCODE_DISABLED: c_ulong = 0x8000; ++pub const IW_ENCODE_ENABLED: c_ulong = 0x0000; ++pub const IW_ENCODE_RESTRICTED: c_ulong = 0x4000; ++pub const IW_ENCODE_OPEN: c_ulong = 0x2000; ++pub const IW_ENCODE_NOKEY: c_ulong = 0x0800; ++pub const IW_ENCODE_TEMP: c_ulong = 0x0400; ++ ++pub const IW_POWER_ON: c_ulong = 0x0000; ++pub const IW_POWER_TYPE: c_ulong = 0xF000; ++pub const IW_POWER_PERIOD: c_ulong = 0x1000; ++pub const IW_POWER_TIMEOUT: c_ulong = 0x2000; ++pub const IW_POWER_MODE: c_ulong = 0x0F00; ++pub const IW_POWER_UNICAST_R: c_ulong = 0x0100; ++pub const IW_POWER_MULTICAST_R: c_ulong = 0x0200; ++pub const IW_POWER_ALL_R: c_ulong = 0x0300; ++pub const IW_POWER_FORCE_S: c_ulong = 0x0400; ++pub const IW_POWER_REPEATER: c_ulong = 0x0800; ++pub const IW_POWER_MODIFIER: c_ulong = 0x000F; ++pub const IW_POWER_MIN: c_ulong = 0x0001; ++pub const IW_POWER_MAX: c_ulong = 0x0002; ++pub const IW_POWER_RELATIVE: c_ulong = 0x0004; ++ ++pub const IW_TXPOW_TYPE: c_ulong = 0x00FF; ++pub const IW_TXPOW_DBM: c_ulong = 0x0000; ++pub const IW_TXPOW_MWATT: c_ulong = 0x0001; ++pub const IW_TXPOW_RELATIVE: c_ulong = 0x0002; ++pub const IW_TXPOW_RANGE: c_ulong = 0x1000; ++ ++pub const IW_RETRY_ON: c_ulong = 0x0000; ++pub const IW_RETRY_TYPE: c_ulong = 0xF000; ++pub const IW_RETRY_LIMIT: c_ulong = 0x1000; ++pub const IW_RETRY_LIFETIME: c_ulong = 0x2000; ++pub const IW_RETRY_MODIFIER: c_ulong = 0x00FF; ++pub const IW_RETRY_MIN: c_ulong = 0x0001; ++pub const IW_RETRY_MAX: c_ulong = 0x0002; ++pub const IW_RETRY_RELATIVE: c_ulong = 0x0004; ++pub const IW_RETRY_SHORT: c_ulong = 0x0010; ++pub const IW_RETRY_LONG: c_ulong = 0x0020; ++ ++pub const IW_SCAN_DEFAULT: c_ulong = 0x0000; ++pub const IW_SCAN_ALL_ESSID: c_ulong = 0x0001; ++pub const IW_SCAN_THIS_ESSID: c_ulong = 0x0002; ++pub const IW_SCAN_ALL_FREQ: c_ulong = 0x0004; ++pub const IW_SCAN_THIS_FREQ: c_ulong = 0x0008; ++pub const IW_SCAN_ALL_MODE: c_ulong = 0x0010; ++pub const IW_SCAN_THIS_MODE: c_ulong = 0x0020; ++pub const IW_SCAN_ALL_RATE: c_ulong = 0x0040; ++pub const IW_SCAN_THIS_RATE: c_ulong = 0x0080; ++ ++pub const IW_SCAN_TYPE_ACTIVE: usize = 0; ++pub const IW_SCAN_TYPE_PASSIVE: usize = 1; ++ ++pub const IW_SCAN_MAX_DATA: usize = 4096; ++ ++pub const IW_SCAN_CAPA_NONE: c_ulong = 0x00; ++pub const IW_SCAN_CAPA_ESSID: c_ulong = 0x01; ++pub const IW_SCAN_CAPA_BSSID: c_ulong = 0x02; ++pub const IW_SCAN_CAPA_CHANNEL: c_ulong = 0x04; ++pub const IW_SCAN_CAPA_MODE: c_ulong = 0x08; ++pub const IW_SCAN_CAPA_RATE: c_ulong = 0x10; ++pub const IW_SCAN_CAPA_TYPE: c_ulong = 0x20; ++pub const IW_SCAN_CAPA_TIME: c_ulong = 0x40; ++ ++pub const IW_CUSTOM_MAX: c_ulong = 256; ++ ++pub const IW_GENERIC_IE_MAX: c_ulong = 1024; ++ ++pub const IW_MLME_DEAUTH: c_ulong = 0; ++pub const IW_MLME_DISASSOC: c_ulong = 1; ++pub const IW_MLME_AUTH: c_ulong = 2; ++pub const IW_MLME_ASSOC: c_ulong = 3; ++ ++pub const IW_AUTH_INDEX: c_ulong = 0x0FFF; ++pub const IW_AUTH_FLAGS: c_ulong = 0xF000; ++ ++pub const IW_AUTH_WPA_VERSION: usize = 0; ++pub const IW_AUTH_CIPHER_PAIRWISE: usize = 1; ++pub const IW_AUTH_CIPHER_GROUP: usize = 2; ++pub const IW_AUTH_KEY_MGMT: usize = 3; ++pub const IW_AUTH_TKIP_COUNTERMEASURES: usize = 4; ++pub const IW_AUTH_DROP_UNENCRYPTED: usize = 5; ++pub const IW_AUTH_80211_AUTH_ALG: usize = 6; ++pub const IW_AUTH_WPA_ENABLED: usize = 7; ++pub const IW_AUTH_RX_UNENCRYPTED_EAPOL: usize = 8; ++pub const IW_AUTH_ROAMING_CONTROL: usize = 9; ++pub const IW_AUTH_PRIVACY_INVOKED: usize = 10; ++pub const IW_AUTH_CIPHER_GROUP_MGMT: usize = 11; ++pub const IW_AUTH_MFP: usize = 12; ++ ++pub const IW_AUTH_WPA_VERSION_DISABLED: c_ulong = 0x00000001; ++pub const IW_AUTH_WPA_VERSION_WPA: c_ulong = 0x00000002; ++pub const IW_AUTH_WPA_VERSION_WPA2: c_ulong = 0x00000004; ++ ++pub const IW_AUTH_CIPHER_NONE: c_ulong = 0x00000001; ++pub const IW_AUTH_CIPHER_WEP40: c_ulong = 0x00000002; ++pub const IW_AUTH_CIPHER_TKIP: c_ulong = 0x00000004; ++pub const IW_AUTH_CIPHER_CCMP: c_ulong = 0x00000008; ++pub const IW_AUTH_CIPHER_WEP104: c_ulong = 0x00000010; ++pub const IW_AUTH_CIPHER_AES_CMAC: c_ulong = 0x00000020; ++ ++pub const IW_AUTH_KEY_MGMT_802_1X: usize = 1; ++pub const IW_AUTH_KEY_MGMT_PSK: usize = 2; ++ ++pub const IW_AUTH_ALG_OPEN_SYSTEM: c_ulong = 0x00000001; ++pub const IW_AUTH_ALG_SHARED_KEY: c_ulong = 0x00000002; ++pub const IW_AUTH_ALG_LEAP: c_ulong = 0x00000004; ++ ++pub const IW_AUTH_ROAMING_ENABLE: usize = 0; ++pub const IW_AUTH_ROAMING_DISABLE: usize = 1; ++ ++pub const IW_AUTH_MFP_DISABLED: usize = 0; ++pub const IW_AUTH_MFP_OPTIONAL: usize = 1; ++pub const IW_AUTH_MFP_REQUIRED: usize = 2; ++ ++pub const IW_ENCODE_SEQ_MAX_SIZE: usize = 8; ++ ++pub const IW_ENCODE_ALG_NONE: usize = 0; ++pub const IW_ENCODE_ALG_WEP: usize = 1; ++pub const IW_ENCODE_ALG_TKIP: usize = 2; ++pub const IW_ENCODE_ALG_CCMP: usize = 3; ++pub const IW_ENCODE_ALG_PMK: usize = 4; ++pub const IW_ENCODE_ALG_AES_CMAC: usize = 5; ++ ++pub const IW_ENCODE_EXT_TX_SEQ_VALID: c_ulong = 0x00000001; ++pub const IW_ENCODE_EXT_RX_SEQ_VALID: c_ulong = 0x00000002; ++pub const IW_ENCODE_EXT_GROUP_KEY: c_ulong = 0x00000004; ++pub const IW_ENCODE_EXT_SET_TX_KEY: c_ulong = 0x00000008; ++ ++pub const IW_MICFAILURE_KEY_ID: c_ulong = 0x00000003; ++pub const IW_MICFAILURE_GROUP: c_ulong = 0x00000004; ++pub const IW_MICFAILURE_PAIRWISE: c_ulong = 0x00000008; ++pub const IW_MICFAILURE_STAKEY: c_ulong = 0x00000010; ++pub const IW_MICFAILURE_COUNT: c_ulong = 0x00000060; ++ ++pub const IW_ENC_CAPA_WPA: c_ulong = 0x00000001; ++pub const IW_ENC_CAPA_WPA2: c_ulong = 0x00000002; ++pub const IW_ENC_CAPA_CIPHER_TKIP: c_ulong = 0x00000004; ++pub const IW_ENC_CAPA_CIPHER_CCMP: c_ulong = 0x00000008; ++pub const IW_ENC_CAPA_4WAY_HANDSHAKE: c_ulong = 0x00000010; ++ ++pub const IW_EVENT_CAPA_K_0: c_ulong = 0x4000050; // IW_EVENT_CAPA_MASK(0x8B04) | IW_EVENT_CAPA_MASK(0x8B06) | IW_EVENT_CAPA_MASK(0x8B1A); ++pub const IW_EVENT_CAPA_K_1: c_ulong = 0x400; // W_EVENT_CAPA_MASK(0x8B2A); ++ ++pub const IW_PMKSA_ADD: usize = 1; ++pub const IW_PMKSA_REMOVE: usize = 2; ++pub const IW_PMKSA_FLUSH: usize = 3; ++ ++pub const IW_PMKID_LEN: usize = 16; ++ ++pub const IW_PMKID_CAND_PREAUTH: c_ulong = 0x00000001; ++ ++pub const IW_EV_LCP_PK_LEN: usize = 4; ++ ++pub const IW_EV_CHAR_PK_LEN: usize = 20; // IW_EV_LCP_PK_LEN + crate::IFNAMSIZ; ++pub const IW_EV_UINT_PK_LEN: usize = 8; // IW_EV_LCP_PK_LEN + size_of::(); ++pub const IW_EV_FREQ_PK_LEN: usize = 12; // IW_EV_LCP_PK_LEN + size_of::(); ++pub const IW_EV_PARAM_PK_LEN: usize = 12; // IW_EV_LCP_PK_LEN + size_of::(); ++pub const IW_EV_ADDR_PK_LEN: usize = 20; // IW_EV_LCP_PK_LEN + size_of::(); ++pub const IW_EV_QUAL_PK_LEN: usize = 8; // IW_EV_LCP_PK_LEN + size_of::(); ++pub const IW_EV_POINT_PK_LEN: usize = 8; // IW_EV_LCP_PK_LEN + 4; ++ ++pub const IPTOS_TOS_MASK: u8 = 0x1E; ++pub const IPTOS_PREC_MASK: u8 = 0xE0; ++ ++pub const IPTOS_ECN_NOT_ECT: u8 = 0x00; ++ ++pub const RTF_UP: c_ushort = 0x0001; ++pub const RTF_GATEWAY: c_ushort = 0x0002; ++ ++pub const RTF_HOST: c_ushort = 0x0004; ++pub const RTF_REINSTATE: c_ushort = 0x0008; ++pub const RTF_DYNAMIC: c_ushort = 0x0010; ++pub const RTF_MODIFIED: c_ushort = 0x0020; ++pub const RTF_MTU: c_ushort = 0x0040; ++pub const RTF_MSS: c_ushort = RTF_MTU; ++pub const RTF_WINDOW: c_ushort = 0x0080; ++pub const RTF_IRTT: c_ushort = 0x0100; ++pub const RTF_REJECT: c_ushort = 0x0200; ++pub const RTF_STATIC: c_ushort = 0x0400; ++pub const RTF_XRESOLVE: c_ushort = 0x0800; ++pub const RTF_NOFORWARD: c_ushort = 0x1000; ++pub const RTF_THROW: c_ushort = 0x2000; ++pub const RTF_NOPMTUDISC: c_ushort = 0x4000; ++ ++pub const RTF_DEFAULT: u32 = 0x00010000; ++pub const RTF_ALLONLINK: u32 = 0x00020000; ++pub const RTF_ADDRCONF: u32 = 0x00040000; ++pub const RTF_LINKRT: u32 = 0x00100000; ++pub const RTF_NONEXTHOP: u32 = 0x00200000; ++pub const RTF_CACHE: u32 = 0x01000000; ++pub const RTF_FLOW: u32 = 0x02000000; ++pub const RTF_POLICY: u32 = 0x04000000; ++ ++pub const RTCF_VALVE: u32 = 0x00200000; ++pub const RTCF_MASQ: u32 = 0x00400000; ++pub const RTCF_NAT: u32 = 0x00800000; ++pub const RTCF_DOREDIRECT: u32 = 0x01000000; ++pub const RTCF_LOG: u32 = 0x02000000; ++pub const RTCF_DIRECTSRC: u32 = 0x04000000; ++ ++pub const RTF_LOCAL: u32 = 0x80000000; ++pub const RTF_INTERFACE: u32 = 0x40000000; ++pub const RTF_MULTICAST: u32 = 0x20000000; ++pub const RTF_BROADCAST: u32 = 0x10000000; ++pub const RTF_NAT: u32 = 0x08000000; ++pub const RTF_ADDRCLASSMASK: u32 = 0xF8000000; ++ ++pub const RT_CLASS_UNSPEC: u8 = 0; ++pub const RT_CLASS_DEFAULT: u8 = 253; ++pub const RT_CLASS_MAIN: u8 = 254; ++pub const RT_CLASS_LOCAL: u8 = 255; ++pub const RT_CLASS_MAX: u8 = 255; ++ ++// linux/neighbor.h ++pub const NUD_NONE: u16 = 0x00; ++pub const NUD_INCOMPLETE: u16 = 0x01; ++pub const NUD_REACHABLE: u16 = 0x02; ++pub const NUD_STALE: u16 = 0x04; ++pub const NUD_DELAY: u16 = 0x08; ++pub const NUD_PROBE: u16 = 0x10; ++pub const NUD_FAILED: u16 = 0x20; ++pub const NUD_NOARP: u16 = 0x40; ++pub const NUD_PERMANENT: u16 = 0x80; ++ ++pub const NTF_USE: u8 = 0x01; ++pub const NTF_SELF: u8 = 0x02; ++pub const NTF_MASTER: u8 = 0x04; ++pub const NTF_PROXY: u8 = 0x08; ++pub const NTF_ROUTER: u8 = 0x80; ++ ++pub const NDA_UNSPEC: c_ushort = 0; ++pub const NDA_DST: c_ushort = 1; ++pub const NDA_LLADDR: c_ushort = 2; ++pub const NDA_CACHEINFO: c_ushort = 3; ++pub const NDA_PROBES: c_ushort = 4; ++pub const NDA_VLAN: c_ushort = 5; ++pub const NDA_PORT: c_ushort = 6; ++pub const NDA_VNI: c_ushort = 7; ++pub const NDA_IFINDEX: c_ushort = 8; ++ ++// linux/netlink.h ++pub const NLA_ALIGNTO: c_int = 4; ++ ++pub const NETLINK_ROUTE: c_int = 0; ++pub const NETLINK_UNUSED: c_int = 1; ++pub const NETLINK_USERSOCK: c_int = 2; ++pub const NETLINK_FIREWALL: c_int = 3; ++pub const NETLINK_SOCK_DIAG: c_int = 4; ++pub const NETLINK_NFLOG: c_int = 5; ++pub const NETLINK_XFRM: c_int = 6; ++pub const NETLINK_SELINUX: c_int = 7; ++pub const NETLINK_ISCSI: c_int = 8; ++pub const NETLINK_AUDIT: c_int = 9; ++pub const NETLINK_FIB_LOOKUP: c_int = 10; ++pub const NETLINK_CONNECTOR: c_int = 11; ++pub const NETLINK_NETFILTER: c_int = 12; ++pub const NETLINK_IP6_FW: c_int = 13; ++pub const NETLINK_DNRTMSG: c_int = 14; ++pub const NETLINK_KOBJECT_UEVENT: c_int = 15; ++pub const NETLINK_GENERIC: c_int = 16; ++pub const NETLINK_SCSITRANSPORT: c_int = 18; ++pub const NETLINK_ECRYPTFS: c_int = 19; ++pub const NETLINK_RDMA: c_int = 20; ++pub const NETLINK_CRYPTO: c_int = 21; ++pub const NETLINK_INET_DIAG: c_int = NETLINK_SOCK_DIAG; ++ ++pub const NLM_F_REQUEST: c_int = 1; ++pub const NLM_F_MULTI: c_int = 2; ++pub const NLM_F_ACK: c_int = 4; ++pub const NLM_F_ECHO: c_int = 8; ++pub const NLM_F_DUMP_INTR: c_int = 16; ++pub const NLM_F_DUMP_FILTERED: c_int = 32; ++ ++pub const NLM_F_ROOT: c_int = 0x100; ++pub const NLM_F_MATCH: c_int = 0x200; ++pub const NLM_F_ATOMIC: c_int = 0x400; ++pub const NLM_F_DUMP: c_int = NLM_F_ROOT | NLM_F_MATCH; ++ ++pub const NLM_F_REPLACE: c_int = 0x100; ++pub const NLM_F_EXCL: c_int = 0x200; ++pub const NLM_F_CREATE: c_int = 0x400; ++pub const NLM_F_APPEND: c_int = 0x800; ++ ++pub const NETLINK_ADD_MEMBERSHIP: c_int = 1; ++pub const NETLINK_DROP_MEMBERSHIP: c_int = 2; ++pub const NETLINK_PKTINFO: c_int = 3; ++pub const NETLINK_BROADCAST_ERROR: c_int = 4; ++pub const NETLINK_NO_ENOBUFS: c_int = 5; ++pub const NETLINK_RX_RING: c_int = 6; ++pub const NETLINK_TX_RING: c_int = 7; ++pub const NETLINK_LISTEN_ALL_NSID: c_int = 8; ++pub const NETLINK_LIST_MEMBERSHIPS: c_int = 9; ++pub const NETLINK_CAP_ACK: c_int = 10; ++pub const NETLINK_EXT_ACK: c_int = 11; ++pub const NETLINK_GET_STRICT_CHK: c_int = 12; ++ ++pub const NLA_F_NESTED: c_int = 1 << 15; ++pub const NLA_F_NET_BYTEORDER: c_int = 1 << 14; ++pub const NLA_TYPE_MASK: c_int = !(NLA_F_NESTED | NLA_F_NET_BYTEORDER); ++ ++// 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_OVERRUN: u32 = crate::NLMSG_OVERRUN as u32; ++pub const RTMSG_NEWDEVICE: u32 = 0x11; ++pub const RTMSG_DELDEVICE: u32 = 0x12; ++pub const RTMSG_NEWROUTE: u32 = 0x21; ++pub const RTMSG_DELROUTE: u32 = 0x22; ++pub const RTMSG_NEWRULE: u32 = 0x31; ++pub const RTMSG_DELRULE: u32 = 0x32; ++pub const RTMSG_CONTROL: u32 = 0x40; ++pub const RTMSG_AR_FAILED: u32 = 0x51; ++ ++pub const MAX_ADDR_LEN: usize = 7; ++pub const ARPD_UPDATE: c_ushort = 0x01; ++pub const ARPD_LOOKUP: c_ushort = 0x02; ++pub const ARPD_FLUSH: c_ushort = 0x03; ++pub const ATF_MAGIC: c_int = 0x80; ++ ++pub const RTEXT_FILTER_VF: c_int = 1 << 0; ++pub const RTEXT_FILTER_BRVLAN: c_int = 1 << 1; ++pub const RTEXT_FILTER_BRVLAN_COMPRESSED: c_int = 1 << 2; ++pub const RTEXT_FILTER_SKIP_STATS: c_int = 1 << 3; ++pub const RTEXT_FILTER_MRP: c_int = 1 << 4; ++pub const RTEXT_FILTER_CFM_CONFIG: c_int = 1 << 5; ++pub const RTEXT_FILTER_CFM_STATUS: c_int = 1 << 6; ++ ++// userspace compat definitions for RTNLGRP_* ++pub const RTMGRP_LINK: c_int = 0x00001; ++pub const RTMGRP_NOTIFY: c_int = 0x00002; ++pub const RTMGRP_NEIGH: c_int = 0x00004; ++pub const RTMGRP_TC: c_int = 0x00008; ++pub const RTMGRP_IPV4_IFADDR: c_int = 0x00010; ++pub const RTMGRP_IPV4_MROUTE: c_int = 0x00020; ++pub const RTMGRP_IPV4_ROUTE: c_int = 0x00040; ++pub const RTMGRP_IPV4_RULE: c_int = 0x00080; ++pub const RTMGRP_IPV6_IFADDR: c_int = 0x00100; ++pub const RTMGRP_IPV6_MROUTE: c_int = 0x00200; ++pub const RTMGRP_IPV6_ROUTE: c_int = 0x00400; ++pub const RTMGRP_IPV6_IFINFO: c_int = 0x00800; ++pub const RTMGRP_DECnet_IFADDR: c_int = 0x01000; ++pub const RTMGRP_DECnet_ROUTE: c_int = 0x04000; ++pub const RTMGRP_IPV6_PREFIX: c_int = 0x20000; ++ ++// enum rtnetlink_groups ++pub const RTNLGRP_NONE: c_uint = 0x00; ++pub const RTNLGRP_LINK: c_uint = 0x01; ++pub const RTNLGRP_NOTIFY: c_uint = 0x02; ++pub const RTNLGRP_NEIGH: c_uint = 0x03; ++pub const RTNLGRP_TC: c_uint = 0x04; ++pub const RTNLGRP_IPV4_IFADDR: c_uint = 0x05; ++pub const RTNLGRP_IPV4_MROUTE: c_uint = 0x06; ++pub const RTNLGRP_IPV4_ROUTE: c_uint = 0x07; ++pub const RTNLGRP_IPV4_RULE: c_uint = 0x08; ++pub const RTNLGRP_IPV6_IFADDR: c_uint = 0x09; ++pub const RTNLGRP_IPV6_MROUTE: c_uint = 0x0a; ++pub const RTNLGRP_IPV6_ROUTE: c_uint = 0x0b; ++pub const RTNLGRP_IPV6_IFINFO: c_uint = 0x0c; ++pub const RTNLGRP_DECnet_IFADDR: c_uint = 0x0d; ++pub const RTNLGRP_NOP2: c_uint = 0x0e; ++pub const RTNLGRP_DECnet_ROUTE: c_uint = 0x0f; ++pub const RTNLGRP_DECnet_RULE: c_uint = 0x10; ++pub const RTNLGRP_NOP4: c_uint = 0x11; ++pub const RTNLGRP_IPV6_PREFIX: c_uint = 0x12; ++pub const RTNLGRP_IPV6_RULE: c_uint = 0x13; ++pub const RTNLGRP_ND_USEROPT: c_uint = 0x14; ++pub const RTNLGRP_PHONET_IFADDR: c_uint = 0x15; ++pub const RTNLGRP_PHONET_ROUTE: c_uint = 0x16; ++pub const RTNLGRP_DCB: c_uint = 0x17; ++pub const RTNLGRP_IPV4_NETCONF: c_uint = 0x18; ++pub const RTNLGRP_IPV6_NETCONF: c_uint = 0x19; ++pub const RTNLGRP_MDB: c_uint = 0x1a; ++pub const RTNLGRP_MPLS_ROUTE: c_uint = 0x1b; ++pub const RTNLGRP_NSID: c_uint = 0x1c; ++pub const RTNLGRP_MPLS_NETCONF: c_uint = 0x1d; ++pub const RTNLGRP_IPV4_MROUTE_R: c_uint = 0x1e; ++pub const RTNLGRP_IPV6_MROUTE_R: c_uint = 0x1f; ++pub const RTNLGRP_NEXTHOP: c_uint = 0x20; ++pub const RTNLGRP_BRVLAN: c_uint = 0x21; ++pub const RTNLGRP_MCTP_IFADDR: c_uint = 0x22; ++pub const RTNLGRP_TUNNEL: c_uint = 0x23; ++pub const RTNLGRP_STATS: c_uint = 0x24; ++ ++// linux/module.h ++pub const MODULE_INIT_IGNORE_MODVERSIONS: c_uint = 0x0001; ++pub const MODULE_INIT_IGNORE_VERMAGIC: c_uint = 0x0002; ++ ++// linux/net_tstamp.h ++pub const SOF_TIMESTAMPING_TX_HARDWARE: c_uint = 1 << 0; ++pub const SOF_TIMESTAMPING_TX_SOFTWARE: c_uint = 1 << 1; ++pub const SOF_TIMESTAMPING_RX_HARDWARE: c_uint = 1 << 2; ++pub const SOF_TIMESTAMPING_RX_SOFTWARE: c_uint = 1 << 3; ++pub const SOF_TIMESTAMPING_SOFTWARE: c_uint = 1 << 4; ++pub const SOF_TIMESTAMPING_SYS_HARDWARE: c_uint = 1 << 5; ++pub const SOF_TIMESTAMPING_RAW_HARDWARE: c_uint = 1 << 6; ++pub const SOF_TIMESTAMPING_OPT_ID: c_uint = 1 << 7; ++pub const SOF_TIMESTAMPING_TX_SCHED: c_uint = 1 << 8; ++pub const SOF_TIMESTAMPING_TX_ACK: c_uint = 1 << 9; ++pub const SOF_TIMESTAMPING_OPT_CMSG: c_uint = 1 << 10; ++pub const SOF_TIMESTAMPING_OPT_TSONLY: c_uint = 1 << 11; ++pub const SOF_TIMESTAMPING_OPT_STATS: c_uint = 1 << 12; ++pub const SOF_TIMESTAMPING_OPT_PKTINFO: c_uint = 1 << 13; ++pub const SOF_TIMESTAMPING_OPT_TX_SWHW: c_uint = 1 << 14; ++pub const SOF_TXTIME_DEADLINE_MODE: u32 = 1 << 0; ++pub const SOF_TXTIME_REPORT_ERRORS: u32 = 1 << 1; ++ ++pub const HWTSTAMP_TX_OFF: c_uint = 0; ++pub const HWTSTAMP_TX_ON: c_uint = 1; ++pub const HWTSTAMP_TX_ONESTEP_SYNC: c_uint = 2; ++pub const HWTSTAMP_TX_ONESTEP_P2P: c_uint = 3; ++ ++pub const HWTSTAMP_FILTER_NONE: c_uint = 0; ++pub const HWTSTAMP_FILTER_ALL: c_uint = 1; ++pub const HWTSTAMP_FILTER_SOME: c_uint = 2; ++pub const HWTSTAMP_FILTER_PTP_V1_L4_EVENT: c_uint = 3; ++pub const HWTSTAMP_FILTER_PTP_V1_L4_SYNC: c_uint = 4; ++pub const HWTSTAMP_FILTER_PTP_V1_L4_DELAY_REQ: c_uint = 5; ++pub const HWTSTAMP_FILTER_PTP_V2_L4_EVENT: c_uint = 6; ++pub const HWTSTAMP_FILTER_PTP_V2_L4_SYNC: c_uint = 7; ++pub const HWTSTAMP_FILTER_PTP_V2_L4_DELAY_REQ: c_uint = 8; ++pub const HWTSTAMP_FILTER_PTP_V2_L2_EVENT: c_uint = 9; ++pub const HWTSTAMP_FILTER_PTP_V2_L2_SYNC: c_uint = 10; ++pub const HWTSTAMP_FILTER_PTP_V2_L2_DELAY_REQ: c_uint = 11; ++pub const HWTSTAMP_FILTER_PTP_V2_EVENT: c_uint = 12; ++pub const HWTSTAMP_FILTER_PTP_V2_SYNC: c_uint = 13; ++pub const HWTSTAMP_FILTER_PTP_V2_DELAY_REQ: c_uint = 14; ++pub const HWTSTAMP_FILTER_NTP_ALL: c_uint = 15; ++ ++// linux/ptp_clock.h ++pub const PTP_MAX_SAMPLES: c_uint = 25; // Maximum allowed offset measurement samples. ++ ++const PTP_CLK_MAGIC: u32 = b'=' as u32; ++ ++pub const PTP_CLOCK_GETCAPS: c_uint = _IOR::(PTP_CLK_MAGIC, 1); ++pub const PTP_EXTTS_REQUEST: c_uint = _IOW::(PTP_CLK_MAGIC, 2); ++pub const PTP_PEROUT_REQUEST: c_uint = _IOW::(PTP_CLK_MAGIC, 3); ++pub const PTP_ENABLE_PPS: c_uint = _IOW::(PTP_CLK_MAGIC, 4); ++pub const PTP_SYS_OFFSET: c_uint = _IOW::(PTP_CLK_MAGIC, 5); ++pub const PTP_PIN_GETFUNC: c_uint = _IOWR::(PTP_CLK_MAGIC, 6); ++pub const PTP_PIN_SETFUNC: c_uint = _IOW::(PTP_CLK_MAGIC, 7); ++pub const PTP_SYS_OFFSET_PRECISE: c_uint = _IOWR::(PTP_CLK_MAGIC, 8); ++pub const PTP_SYS_OFFSET_EXTENDED: c_uint = _IOWR::(PTP_CLK_MAGIC, 9); ++ ++pub const PTP_CLOCK_GETCAPS2: c_uint = _IOR::(PTP_CLK_MAGIC, 10); ++pub const PTP_EXTTS_REQUEST2: c_uint = _IOW::(PTP_CLK_MAGIC, 11); ++pub const PTP_PEROUT_REQUEST2: c_uint = _IOW::(PTP_CLK_MAGIC, 12); ++pub const PTP_ENABLE_PPS2: c_uint = _IOW::(PTP_CLK_MAGIC, 13); ++pub const PTP_SYS_OFFSET2: c_uint = _IOW::(PTP_CLK_MAGIC, 14); ++pub const PTP_PIN_GETFUNC2: c_uint = _IOWR::(PTP_CLK_MAGIC, 15); ++pub const PTP_PIN_SETFUNC2: c_uint = _IOW::(PTP_CLK_MAGIC, 16); ++pub const PTP_SYS_OFFSET_PRECISE2: c_uint = _IOWR::(PTP_CLK_MAGIC, 17); ++pub const PTP_SYS_OFFSET_EXTENDED2: c_uint = _IOWR::(PTP_CLK_MAGIC, 18); ++ ++// enum ptp_pin_function ++pub const PTP_PF_NONE: c_uint = 0; ++pub const PTP_PF_EXTTS: c_uint = 1; ++pub const PTP_PF_PEROUT: c_uint = 2; ++pub const PTP_PF_PHYSYNC: c_uint = 3; ++ ++// linux/tls.h ++pub const TLS_TX: c_int = 1; ++pub const TLS_RX: c_int = 2; ++ ++pub const TLS_1_2_VERSION_MAJOR: __u8 = 0x3; ++pub const TLS_1_2_VERSION_MINOR: __u8 = 0x3; ++pub const TLS_1_2_VERSION: __u16 = ++ ((TLS_1_2_VERSION_MAJOR as __u16) << 8) | (TLS_1_2_VERSION_MINOR as __u16); ++ ++pub const TLS_1_3_VERSION_MAJOR: __u8 = 0x3; ++pub const TLS_1_3_VERSION_MINOR: __u8 = 0x4; ++pub const TLS_1_3_VERSION: __u16 = ++ ((TLS_1_3_VERSION_MAJOR as __u16) << 8) | (TLS_1_3_VERSION_MINOR as __u16); ++ ++pub const TLS_CIPHER_AES_GCM_128: __u16 = 51; ++pub const TLS_CIPHER_AES_GCM_128_IV_SIZE: usize = 8; ++pub const TLS_CIPHER_AES_GCM_128_KEY_SIZE: usize = 16; ++pub const TLS_CIPHER_AES_GCM_128_SALT_SIZE: usize = 4; ++pub const TLS_CIPHER_AES_GCM_128_TAG_SIZE: usize = 16; ++pub const TLS_CIPHER_AES_GCM_128_REC_SEQ_SIZE: usize = 8; ++ ++pub const TLS_CIPHER_AES_GCM_256: __u16 = 52; ++pub const TLS_CIPHER_AES_GCM_256_IV_SIZE: usize = 8; ++pub const TLS_CIPHER_AES_GCM_256_KEY_SIZE: usize = 32; ++pub const TLS_CIPHER_AES_GCM_256_SALT_SIZE: usize = 4; ++pub const TLS_CIPHER_AES_GCM_256_TAG_SIZE: usize = 16; ++pub const TLS_CIPHER_AES_GCM_256_REC_SEQ_SIZE: usize = 8; ++ ++pub const TLS_CIPHER_CHACHA20_POLY1305: __u16 = 54; ++pub const TLS_CIPHER_CHACHA20_POLY1305_IV_SIZE: usize = 12; ++pub const TLS_CIPHER_CHACHA20_POLY1305_KEY_SIZE: usize = 32; ++pub const TLS_CIPHER_CHACHA20_POLY1305_SALT_SIZE: usize = 0; ++pub const TLS_CIPHER_CHACHA20_POLY1305_TAG_SIZE: usize = 16; ++pub const TLS_CIPHER_CHACHA20_POLY1305_REC_SEQ_SIZE: usize = 8; ++ ++pub const TLS_SET_RECORD_TYPE: c_int = 1; ++pub const TLS_GET_RECORD_TYPE: c_int = 2; ++ ++pub const SOL_TLS: c_int = 282; ++ ++// linux/if_alg.h ++pub const ALG_SET_KEY: c_int = 1; ++pub const ALG_SET_IV: c_int = 2; ++pub const ALG_SET_OP: c_int = 3; ++pub const ALG_SET_AEAD_ASSOCLEN: c_int = 4; ++pub const ALG_SET_AEAD_AUTHSIZE: c_int = 5; ++pub const ALG_SET_DRBG_ENTROPY: c_int = 6; ++pub const ALG_SET_KEY_BY_KEY_SERIAL: c_int = 7; ++ ++pub const ALG_OP_DECRYPT: c_int = 0; ++pub const ALG_OP_ENCRYPT: c_int = 1; ++ ++// include/uapi/linux/if.h ++pub const IF_OPER_UNKNOWN: c_int = 0; ++pub const IF_OPER_NOTPRESENT: c_int = 1; ++pub const IF_OPER_DOWN: c_int = 2; ++pub const IF_OPER_LOWERLAYERDOWN: c_int = 3; ++pub const IF_OPER_TESTING: c_int = 4; ++pub const IF_OPER_DORMANT: c_int = 5; ++pub const IF_OPER_UP: c_int = 6; ++ ++pub const IF_LINK_MODE_DEFAULT: c_int = 0; ++pub const IF_LINK_MODE_DORMANT: c_int = 1; ++pub const IF_LINK_MODE_TESTING: c_int = 2; ++ ++// include/uapi/linux/udp.h ++pub const UDP_CORK: c_int = 1; ++pub const UDP_ENCAP: c_int = 100; ++pub const UDP_NO_CHECK6_TX: c_int = 101; ++pub const UDP_NO_CHECK6_RX: c_int = 102; ++ ++// include/uapi/linux/mman.h ++pub const MAP_SHARED_VALIDATE: c_int = 0x3; ++pub const MAP_DROPPABLE: c_int = 0x8; ++ ++// include/uapi/asm-generic/mman-common.h ++pub const MAP_FIXED_NOREPLACE: c_int = 0x100000; ++pub const MLOCK_ONFAULT: c_uint = 0x01; ++ ++// uapi/linux/vm_sockets.h ++pub const VMADDR_CID_ANY: c_uint = 0xFFFFFFFF; ++pub const VMADDR_CID_HYPERVISOR: c_uint = 0; ++#[deprecated( ++ since = "0.2.74", ++ note = "VMADDR_CID_RESERVED is removed since Linux v5.6 and \ ++ replaced with VMADDR_CID_LOCAL" ++)] ++pub const VMADDR_CID_RESERVED: c_uint = 1; ++pub const VMADDR_CID_LOCAL: c_uint = 1; ++pub const VMADDR_CID_HOST: c_uint = 2; ++pub const VMADDR_PORT_ANY: c_uint = 0xFFFFFFFF; ++ ++// uapi/linux/inotify.h ++pub const IN_ACCESS: u32 = 0x0000_0001; ++pub const IN_MODIFY: u32 = 0x0000_0002; ++pub const IN_ATTRIB: u32 = 0x0000_0004; ++pub const IN_CLOSE_WRITE: u32 = 0x0000_0008; ++pub const IN_CLOSE_NOWRITE: u32 = 0x0000_0010; ++pub const IN_CLOSE: u32 = IN_CLOSE_WRITE | IN_CLOSE_NOWRITE; ++pub const IN_OPEN: u32 = 0x0000_0020; ++pub const IN_MOVED_FROM: u32 = 0x0000_0040; ++pub const IN_MOVED_TO: u32 = 0x0000_0080; ++pub const IN_MOVE: u32 = IN_MOVED_FROM | IN_MOVED_TO; ++pub const IN_CREATE: u32 = 0x0000_0100; ++pub const IN_DELETE: u32 = 0x0000_0200; ++pub const IN_DELETE_SELF: u32 = 0x0000_0400; ++pub const IN_MOVE_SELF: u32 = 0x0000_0800; ++pub const IN_UNMOUNT: u32 = 0x0000_2000; ++pub const IN_Q_OVERFLOW: u32 = 0x0000_4000; ++pub const IN_IGNORED: u32 = 0x0000_8000; ++pub const IN_ONLYDIR: u32 = 0x0100_0000; ++pub const IN_DONT_FOLLOW: u32 = 0x0200_0000; ++pub const IN_EXCL_UNLINK: u32 = 0x0400_0000; ++ ++// linux/keyctl.h ++pub const KEY_SPEC_THREAD_KEYRING: i32 = -1; ++pub const KEY_SPEC_PROCESS_KEYRING: i32 = -2; ++pub const KEY_SPEC_SESSION_KEYRING: i32 = -3; ++pub const KEY_SPEC_USER_KEYRING: i32 = -4; ++pub const KEY_SPEC_USER_SESSION_KEYRING: i32 = -5; ++pub const KEY_SPEC_GROUP_KEYRING: i32 = -6; ++pub const KEY_SPEC_REQKEY_AUTH_KEY: i32 = -7; ++pub const KEY_SPEC_REQUESTOR_KEYRING: i32 = -8; ++ ++pub const KEY_REQKEY_DEFL_NO_CHANGE: i32 = -1; ++pub const KEY_REQKEY_DEFL_DEFAULT: i32 = 0; ++pub const KEY_REQKEY_DEFL_THREAD_KEYRING: i32 = 1; ++pub const KEY_REQKEY_DEFL_PROCESS_KEYRING: i32 = 2; ++pub const KEY_REQKEY_DEFL_SESSION_KEYRING: i32 = 3; ++pub const KEY_REQKEY_DEFL_USER_KEYRING: i32 = 4; ++pub const KEY_REQKEY_DEFL_USER_SESSION_KEYRING: i32 = 5; ++pub const KEY_REQKEY_DEFL_GROUP_KEYRING: i32 = 6; ++pub const KEY_REQKEY_DEFL_REQUESTOR_KEYRING: i32 = 7; ++ ++pub const KEYCTL_GET_KEYRING_ID: u32 = 0; ++pub const KEYCTL_JOIN_SESSION_KEYRING: u32 = 1; ++pub const KEYCTL_UPDATE: u32 = 2; ++pub const KEYCTL_REVOKE: u32 = 3; ++pub const KEYCTL_CHOWN: u32 = 4; ++pub const KEYCTL_SETPERM: u32 = 5; ++pub const KEYCTL_DESCRIBE: u32 = 6; ++pub const KEYCTL_CLEAR: u32 = 7; ++pub const KEYCTL_LINK: u32 = 8; ++pub const KEYCTL_UNLINK: u32 = 9; ++pub const KEYCTL_SEARCH: u32 = 10; ++pub const KEYCTL_READ: u32 = 11; ++pub const KEYCTL_INSTANTIATE: u32 = 12; ++pub const KEYCTL_NEGATE: u32 = 13; ++pub const KEYCTL_SET_REQKEY_KEYRING: u32 = 14; ++pub const KEYCTL_SET_TIMEOUT: u32 = 15; ++pub const KEYCTL_ASSUME_AUTHORITY: u32 = 16; ++pub const KEYCTL_GET_SECURITY: u32 = 17; ++pub const KEYCTL_SESSION_TO_PARENT: u32 = 18; ++pub const KEYCTL_REJECT: u32 = 19; ++pub const KEYCTL_INSTANTIATE_IOV: u32 = 20; ++pub const KEYCTL_INVALIDATE: u32 = 21; ++pub const KEYCTL_GET_PERSISTENT: u32 = 22; ++ ++pub const IN_MASK_CREATE: u32 = 0x1000_0000; ++pub const IN_MASK_ADD: u32 = 0x2000_0000; ++pub const IN_ISDIR: u32 = 0x4000_0000; ++pub const IN_ONESHOT: u32 = 0x8000_0000; ++ ++pub const IN_ALL_EVENTS: u32 = IN_ACCESS ++ | IN_MODIFY ++ | IN_ATTRIB ++ | IN_CLOSE_WRITE ++ | IN_CLOSE_NOWRITE ++ | IN_OPEN ++ | IN_MOVED_FROM ++ | IN_MOVED_TO ++ | IN_DELETE ++ | IN_CREATE ++ | IN_DELETE_SELF ++ | IN_MOVE_SELF; ++ ++pub const IN_CLOEXEC: c_int = O_CLOEXEC; ++pub const IN_NONBLOCK: c_int = O_NONBLOCK; ++ ++// uapi/linux/mount.h ++pub const OPEN_TREE_CLONE: c_uint = 0x01; ++pub const OPEN_TREE_CLOEXEC: c_uint = O_CLOEXEC as c_uint; ++ ++// uapi/linux/netfilter/nf_tables.h ++pub const NFT_TABLE_MAXNAMELEN: c_int = 256; ++pub const NFT_CHAIN_MAXNAMELEN: c_int = 256; ++pub const NFT_SET_MAXNAMELEN: c_int = 256; ++pub const NFT_OBJ_MAXNAMELEN: c_int = 256; ++pub const NFT_USERDATA_MAXLEN: c_int = 256; ++ ++pub const NFT_REG_VERDICT: c_int = 0; ++pub const NFT_REG_1: c_int = 1; ++pub const NFT_REG_2: c_int = 2; ++pub const NFT_REG_3: c_int = 3; ++pub const NFT_REG_4: c_int = 4; ++pub const __NFT_REG_MAX: c_int = 5; ++pub const NFT_REG32_00: c_int = 8; ++pub const NFT_REG32_01: c_int = 9; ++pub const NFT_REG32_02: c_int = 10; ++pub const NFT_REG32_03: c_int = 11; ++pub const NFT_REG32_04: c_int = 12; ++pub const NFT_REG32_05: c_int = 13; ++pub const NFT_REG32_06: c_int = 14; ++pub const NFT_REG32_07: c_int = 15; ++pub const NFT_REG32_08: c_int = 16; ++pub const NFT_REG32_09: c_int = 17; ++pub const NFT_REG32_10: c_int = 18; ++pub const NFT_REG32_11: c_int = 19; ++pub const NFT_REG32_12: c_int = 20; ++pub const NFT_REG32_13: c_int = 21; ++pub const NFT_REG32_14: c_int = 22; ++pub const NFT_REG32_15: c_int = 23; ++ ++pub const NFT_REG_SIZE: c_int = 16; ++pub const NFT_REG32_SIZE: c_int = 4; ++ ++pub const NFT_CONTINUE: c_int = -1; ++pub const NFT_BREAK: c_int = -2; ++pub const NFT_JUMP: c_int = -3; ++pub const NFT_GOTO: c_int = -4; ++pub const NFT_RETURN: c_int = -5; ++ ++pub const NFT_MSG_NEWTABLE: c_int = 0; ++pub const NFT_MSG_GETTABLE: c_int = 1; ++pub const NFT_MSG_DELTABLE: c_int = 2; ++pub const NFT_MSG_NEWCHAIN: c_int = 3; ++pub const NFT_MSG_GETCHAIN: c_int = 4; ++pub const NFT_MSG_DELCHAIN: c_int = 5; ++pub const NFT_MSG_NEWRULE: c_int = 6; ++pub const NFT_MSG_GETRULE: c_int = 7; ++pub const NFT_MSG_DELRULE: c_int = 8; ++pub const NFT_MSG_NEWSET: c_int = 9; ++pub const NFT_MSG_GETSET: c_int = 10; ++pub const NFT_MSG_DELSET: c_int = 11; ++pub const NFT_MSG_NEWSETELEM: c_int = 12; ++pub const NFT_MSG_GETSETELEM: c_int = 13; ++pub const NFT_MSG_DELSETELEM: c_int = 14; ++pub const NFT_MSG_NEWGEN: c_int = 15; ++pub const NFT_MSG_GETGEN: c_int = 16; ++pub const NFT_MSG_TRACE: c_int = 17; ++cfg_if! { ++ if #[cfg(not(target_arch = "sparc64"))] { ++ pub const NFT_MSG_NEWOBJ: c_int = 18; ++ pub const NFT_MSG_GETOBJ: c_int = 19; ++ pub const NFT_MSG_DELOBJ: c_int = 20; ++ pub const NFT_MSG_GETOBJ_RESET: c_int = 21; ++ } ++} ++pub const NFT_MSG_MAX: c_int = 25; ++ ++pub const NFT_SET_ANONYMOUS: c_int = 0x1; ++pub const NFT_SET_CONSTANT: c_int = 0x2; ++pub const NFT_SET_INTERVAL: c_int = 0x4; ++pub const NFT_SET_MAP: c_int = 0x8; ++pub const NFT_SET_TIMEOUT: c_int = 0x10; ++pub const NFT_SET_EVAL: c_int = 0x20; ++ ++pub const NFT_SET_POL_PERFORMANCE: c_int = 0; ++pub const NFT_SET_POL_MEMORY: c_int = 1; ++ ++pub const NFT_SET_ELEM_INTERVAL_END: c_int = 0x1; ++ ++pub const NFT_DATA_VALUE: c_uint = 0; ++pub const NFT_DATA_VERDICT: c_uint = 0xffffff00; ++ ++pub const NFT_DATA_RESERVED_MASK: c_uint = 0xffffff00; ++ ++pub const NFT_DATA_VALUE_MAXLEN: c_int = 64; ++ ++pub const NFT_BYTEORDER_NTOH: c_int = 0; ++pub const NFT_BYTEORDER_HTON: c_int = 1; ++ ++pub const NFT_CMP_EQ: c_int = 0; ++pub const NFT_CMP_NEQ: c_int = 1; ++pub const NFT_CMP_LT: c_int = 2; ++pub const NFT_CMP_LTE: c_int = 3; ++pub const NFT_CMP_GT: c_int = 4; ++pub const NFT_CMP_GTE: c_int = 5; ++ ++pub const NFT_RANGE_EQ: c_int = 0; ++pub const NFT_RANGE_NEQ: c_int = 1; ++ ++pub const NFT_LOOKUP_F_INV: c_int = 1 << 0; ++ ++pub const NFT_DYNSET_OP_ADD: c_int = 0; ++pub const NFT_DYNSET_OP_UPDATE: c_int = 1; ++ ++pub const NFT_DYNSET_F_INV: c_int = 1 << 0; ++ ++pub const NFT_PAYLOAD_LL_HEADER: c_int = 0; ++pub const NFT_PAYLOAD_NETWORK_HEADER: c_int = 1; ++pub const NFT_PAYLOAD_TRANSPORT_HEADER: c_int = 2; ++ ++pub const NFT_PAYLOAD_CSUM_NONE: c_int = 0; ++pub const NFT_PAYLOAD_CSUM_INET: c_int = 1; ++ ++pub const NFT_META_LEN: c_int = 0; ++pub const NFT_META_PROTOCOL: c_int = 1; ++pub const NFT_META_PRIORITY: c_int = 2; ++pub const NFT_META_MARK: c_int = 3; ++pub const NFT_META_IIF: c_int = 4; ++pub const NFT_META_OIF: c_int = 5; ++pub const NFT_META_IIFNAME: c_int = 6; ++pub const NFT_META_OIFNAME: c_int = 7; ++pub const NFT_META_IIFTYPE: c_int = 8; ++pub const NFT_META_OIFTYPE: c_int = 9; ++pub const NFT_META_SKUID: c_int = 10; ++pub const NFT_META_SKGID: c_int = 11; ++pub const NFT_META_NFTRACE: c_int = 12; ++pub const NFT_META_RTCLASSID: c_int = 13; ++pub const NFT_META_SECMARK: c_int = 14; ++pub const NFT_META_NFPROTO: c_int = 15; ++pub const NFT_META_L4PROTO: c_int = 16; ++pub const NFT_META_BRI_IIFNAME: c_int = 17; ++pub const NFT_META_BRI_OIFNAME: c_int = 18; ++pub const NFT_META_PKTTYPE: c_int = 19; ++pub const NFT_META_CPU: c_int = 20; ++pub const NFT_META_IIFGROUP: c_int = 21; ++pub const NFT_META_OIFGROUP: c_int = 22; ++pub const NFT_META_CGROUP: c_int = 23; ++pub const NFT_META_PRANDOM: c_int = 24; ++ ++pub const NFT_CT_STATE: c_int = 0; ++pub const NFT_CT_DIRECTION: c_int = 1; ++pub const NFT_CT_STATUS: c_int = 2; ++pub const NFT_CT_MARK: c_int = 3; ++pub const NFT_CT_SECMARK: c_int = 4; ++pub const NFT_CT_EXPIRATION: c_int = 5; ++pub const NFT_CT_HELPER: c_int = 6; ++pub const NFT_CT_L3PROTOCOL: c_int = 7; ++pub const NFT_CT_SRC: c_int = 8; ++pub const NFT_CT_DST: c_int = 9; ++pub const NFT_CT_PROTOCOL: c_int = 10; ++pub const NFT_CT_PROTO_SRC: c_int = 11; ++pub const NFT_CT_PROTO_DST: c_int = 12; ++pub const NFT_CT_LABELS: c_int = 13; ++pub const NFT_CT_PKTS: c_int = 14; ++pub const NFT_CT_BYTES: c_int = 15; ++pub const NFT_CT_AVGPKT: c_int = 16; ++pub const NFT_CT_ZONE: c_int = 17; ++pub const NFT_CT_EVENTMASK: c_int = 18; ++pub const NFT_CT_SRC_IP: c_int = 19; ++pub const NFT_CT_DST_IP: c_int = 20; ++pub const NFT_CT_SRC_IP6: c_int = 21; ++pub const NFT_CT_DST_IP6: c_int = 22; ++ ++pub const NFT_LIMIT_PKTS: c_int = 0; ++pub const NFT_LIMIT_PKT_BYTES: c_int = 1; ++ ++pub const NFT_LIMIT_F_INV: c_int = 1 << 0; ++ ++pub const NFT_QUEUE_FLAG_BYPASS: c_int = 0x01; ++pub const NFT_QUEUE_FLAG_CPU_FANOUT: c_int = 0x02; ++pub const NFT_QUEUE_FLAG_MASK: c_int = 0x03; ++ ++pub const NFT_QUOTA_F_INV: c_int = 1 << 0; ++ ++pub const NFT_REJECT_ICMP_UNREACH: c_int = 0; ++pub const NFT_REJECT_TCP_RST: c_int = 1; ++pub const NFT_REJECT_ICMPX_UNREACH: c_int = 2; ++ ++pub const NFT_REJECT_ICMPX_NO_ROUTE: c_int = 0; ++pub const NFT_REJECT_ICMPX_PORT_UNREACH: c_int = 1; ++pub const NFT_REJECT_ICMPX_HOST_UNREACH: c_int = 2; ++pub const NFT_REJECT_ICMPX_ADMIN_PROHIBITED: c_int = 3; ++ ++pub const NFT_NAT_SNAT: c_int = 0; ++pub const NFT_NAT_DNAT: c_int = 1; ++ ++pub const NFT_TRACETYPE_UNSPEC: c_int = 0; ++pub const NFT_TRACETYPE_POLICY: c_int = 1; ++pub const NFT_TRACETYPE_RETURN: c_int = 2; ++pub const NFT_TRACETYPE_RULE: c_int = 3; ++ ++pub const NFT_NG_INCREMENTAL: c_int = 0; ++pub const NFT_NG_RANDOM: c_int = 1; ++ ++// linux/input.h ++pub const FF_MAX: __u16 = 0x7f; ++pub const FF_CNT: usize = FF_MAX as usize + 1; ++ ++// linux/input-event-codes.h ++pub const INPUT_PROP_MAX: __u16 = 0x1f; ++pub const INPUT_PROP_CNT: usize = INPUT_PROP_MAX as usize + 1; ++pub const EV_MAX: __u16 = 0x1f; ++pub const EV_CNT: usize = EV_MAX as usize + 1; ++pub const SYN_MAX: __u16 = 0xf; ++pub const SYN_CNT: usize = SYN_MAX as usize + 1; ++pub const KEY_MAX: __u16 = 0x2ff; ++pub const KEY_CNT: usize = KEY_MAX as usize + 1; ++pub const REL_MAX: __u16 = 0x0f; ++pub const REL_CNT: usize = REL_MAX as usize + 1; ++pub const ABS_MAX: __u16 = 0x3f; ++pub const ABS_CNT: usize = ABS_MAX as usize + 1; ++pub const SW_MAX: __u16 = 0x10; ++pub const SW_CNT: usize = SW_MAX as usize + 1; ++pub const MSC_MAX: __u16 = 0x07; ++pub const MSC_CNT: usize = MSC_MAX as usize + 1; ++pub const LED_MAX: __u16 = 0x0f; ++pub const LED_CNT: usize = LED_MAX as usize + 1; ++pub const REP_MAX: __u16 = 0x01; ++pub const REP_CNT: usize = REP_MAX as usize + 1; ++pub const SND_MAX: __u16 = 0x07; ++pub const SND_CNT: usize = SND_MAX as usize + 1; ++ ++// linux/uinput.h ++pub const UINPUT_VERSION: c_uint = 5; ++pub const UINPUT_MAX_NAME_SIZE: usize = 80; ++ ++// uapi/linux/fanotify.h ++pub const FAN_ACCESS: u64 = 0x0000_0001; ++pub const FAN_MODIFY: u64 = 0x0000_0002; ++pub const FAN_ATTRIB: u64 = 0x0000_0004; ++pub const FAN_CLOSE_WRITE: u64 = 0x0000_0008; ++pub const FAN_CLOSE_NOWRITE: u64 = 0x0000_0010; ++pub const FAN_OPEN: u64 = 0x0000_0020; ++pub const FAN_MOVED_FROM: u64 = 0x0000_0040; ++pub const FAN_MOVED_TO: u64 = 0x0000_0080; ++pub const FAN_CREATE: u64 = 0x0000_0100; ++pub const FAN_DELETE: u64 = 0x0000_0200; ++pub const FAN_DELETE_SELF: u64 = 0x0000_0400; ++pub const FAN_MOVE_SELF: u64 = 0x0000_0800; ++pub const FAN_OPEN_EXEC: u64 = 0x0000_1000; ++ ++pub const FAN_Q_OVERFLOW: u64 = 0x0000_4000; ++pub const FAN_FS_ERROR: u64 = 0x0000_8000; ++ ++pub const FAN_OPEN_PERM: u64 = 0x0001_0000; ++pub const FAN_ACCESS_PERM: u64 = 0x0002_0000; ++pub const FAN_OPEN_EXEC_PERM: u64 = 0x0004_0000; ++ ++pub const FAN_EVENT_ON_CHILD: u64 = 0x0800_0000; ++ ++pub const FAN_RENAME: u64 = 0x1000_0000; ++ ++pub const FAN_ONDIR: u64 = 0x4000_0000; ++ ++pub const FAN_CLOSE: u64 = FAN_CLOSE_WRITE | FAN_CLOSE_NOWRITE; ++pub const FAN_MOVE: u64 = FAN_MOVED_FROM | FAN_MOVED_TO; ++ ++pub const FAN_CLOEXEC: c_uint = 0x0000_0001; ++pub const FAN_NONBLOCK: c_uint = 0x0000_0002; ++ ++pub const FAN_CLASS_NOTIF: c_uint = 0x0000_0000; ++pub const FAN_CLASS_CONTENT: c_uint = 0x0000_0004; ++pub const FAN_CLASS_PRE_CONTENT: c_uint = 0x0000_0008; ++ ++pub const FAN_UNLIMITED_QUEUE: c_uint = 0x0000_0010; ++pub const FAN_UNLIMITED_MARKS: c_uint = 0x0000_0020; ++pub const FAN_ENABLE_AUDIT: c_uint = 0x0000_0040; ++ ++pub const FAN_REPORT_PIDFD: c_uint = 0x0000_0080; ++pub const FAN_REPORT_TID: c_uint = 0x0000_0100; ++pub const FAN_REPORT_FID: c_uint = 0x0000_0200; ++pub const FAN_REPORT_DIR_FID: c_uint = 0x0000_0400; ++pub const FAN_REPORT_NAME: c_uint = 0x0000_0800; ++pub const FAN_REPORT_TARGET_FID: c_uint = 0x0000_1000; ++ ++pub const FAN_REPORT_DFID_NAME: c_uint = FAN_REPORT_DIR_FID | FAN_REPORT_NAME; ++pub const FAN_REPORT_DFID_NAME_TARGET: c_uint = ++ FAN_REPORT_DFID_NAME | FAN_REPORT_FID | FAN_REPORT_TARGET_FID; ++ ++pub const FAN_MARK_ADD: c_uint = 0x0000_0001; ++pub const FAN_MARK_REMOVE: c_uint = 0x0000_0002; ++pub const FAN_MARK_DONT_FOLLOW: c_uint = 0x0000_0004; ++pub const FAN_MARK_ONLYDIR: c_uint = 0x0000_0008; ++pub const FAN_MARK_IGNORED_MASK: c_uint = 0x0000_0020; ++pub const FAN_MARK_IGNORED_SURV_MODIFY: c_uint = 0x0000_0040; ++pub const FAN_MARK_FLUSH: c_uint = 0x0000_0080; ++pub const FAN_MARK_EVICTABLE: c_uint = 0x0000_0200; ++pub const FAN_MARK_IGNORE: c_uint = 0x0000_0400; ++ ++pub const FAN_MARK_INODE: c_uint = 0x0000_0000; ++pub const FAN_MARK_MOUNT: c_uint = 0x0000_0010; ++pub const FAN_MARK_FILESYSTEM: c_uint = 0x0000_0100; ++ ++pub const FAN_MARK_IGNORE_SURV: c_uint = FAN_MARK_IGNORE | FAN_MARK_IGNORED_SURV_MODIFY; ++ ++pub const FANOTIFY_METADATA_VERSION: u8 = 3; ++ ++pub const FAN_EVENT_INFO_TYPE_FID: u8 = 1; ++pub const FAN_EVENT_INFO_TYPE_DFID_NAME: u8 = 2; ++pub const FAN_EVENT_INFO_TYPE_DFID: u8 = 3; ++pub const FAN_EVENT_INFO_TYPE_PIDFD: u8 = 4; ++pub const FAN_EVENT_INFO_TYPE_ERROR: u8 = 5; ++ ++pub const FAN_EVENT_INFO_TYPE_OLD_DFID_NAME: u8 = 10; ++pub const FAN_EVENT_INFO_TYPE_NEW_DFID_NAME: u8 = 12; ++ ++pub const FAN_RESPONSE_INFO_NONE: u8 = 0; ++pub const FAN_RESPONSE_INFO_AUDIT_RULE: u8 = 1; ++ ++pub const FAN_ALLOW: u32 = 0x01; ++pub const FAN_DENY: u32 = 0x02; ++pub const FAN_AUDIT: u32 = 0x10; ++pub const FAN_INFO: u32 = 0x20; ++ ++pub const FAN_NOFD: c_int = -1; ++pub const FAN_NOPIDFD: c_int = FAN_NOFD; ++pub const FAN_EPIDFD: c_int = -2; ++ ++// linux/futex.h ++pub const FUTEX_WAIT: c_int = 0; ++pub const FUTEX_WAKE: c_int = 1; ++pub const FUTEX_FD: c_int = 2; ++pub const FUTEX_REQUEUE: c_int = 3; ++pub const FUTEX_CMP_REQUEUE: c_int = 4; ++pub const FUTEX_WAKE_OP: c_int = 5; ++pub const FUTEX_LOCK_PI: c_int = 6; ++pub const FUTEX_UNLOCK_PI: c_int = 7; ++pub const FUTEX_TRYLOCK_PI: c_int = 8; ++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; ++pub const FUTEX_CMD_MASK: c_int = !(FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME); ++ ++pub const FUTEX_WAITERS: u32 = 0x80000000; ++pub const FUTEX_OWNER_DIED: u32 = 0x40000000; ++pub const FUTEX_TID_MASK: u32 = 0x3fffffff; ++ ++pub const FUTEX_BITSET_MATCH_ANY: c_int = 0xffffffff; ++ ++pub const FUTEX_OP_SET: c_int = 0; ++pub const FUTEX_OP_ADD: c_int = 1; ++pub const FUTEX_OP_OR: c_int = 2; ++pub const FUTEX_OP_ANDN: c_int = 3; ++pub const FUTEX_OP_XOR: c_int = 4; ++ ++pub const FUTEX_OP_OPARG_SHIFT: c_int = 8; ++ ++pub const FUTEX_OP_CMP_EQ: c_int = 0; ++pub const FUTEX_OP_CMP_NE: c_int = 1; ++pub const FUTEX_OP_CMP_LT: c_int = 2; ++pub const FUTEX_OP_CMP_LE: c_int = 3; ++pub const FUTEX_OP_CMP_GT: c_int = 4; ++pub const FUTEX_OP_CMP_GE: c_int = 5; ++ ++pub fn FUTEX_OP(op: c_int, oparg: c_int, cmp: c_int, cmparg: c_int) -> c_int { ++ ((op & 0xf) << 28) | ((cmp & 0xf) << 24) | ((oparg & 0xfff) << 12) | (cmparg & 0xfff) ++} ++ ++// linux/kexec.h ++pub const KEXEC_ON_CRASH: c_int = 0x00000001; ++pub const KEXEC_PRESERVE_CONTEXT: c_int = 0x00000002; ++pub const KEXEC_ARCH_MASK: c_int = 0xffff0000; ++pub const KEXEC_FILE_UNLOAD: c_int = 0x00000001; ++pub const KEXEC_FILE_ON_CRASH: c_int = 0x00000002; ++pub const KEXEC_FILE_NO_INITRAMFS: c_int = 0x00000004; ++ ++// linux/reboot.h ++pub const LINUX_REBOOT_MAGIC1: c_int = 0xfee1dead; ++pub const LINUX_REBOOT_MAGIC2: c_int = 672274793; ++pub const LINUX_REBOOT_MAGIC2A: c_int = 85072278; ++pub const LINUX_REBOOT_MAGIC2B: c_int = 369367448; ++pub const LINUX_REBOOT_MAGIC2C: c_int = 537993216; ++ ++pub const LINUX_REBOOT_CMD_RESTART: c_int = 0x01234567; ++pub const LINUX_REBOOT_CMD_HALT: c_int = 0xCDEF0123; ++pub const LINUX_REBOOT_CMD_CAD_ON: c_int = 0x89ABCDEF; ++pub const LINUX_REBOOT_CMD_CAD_OFF: c_int = 0x00000000; ++pub const LINUX_REBOOT_CMD_POWER_OFF: c_int = 0x4321FEDC; ++pub const LINUX_REBOOT_CMD_RESTART2: c_int = 0xA1B2C3D4; ++pub const LINUX_REBOOT_CMD_SW_SUSPEND: c_int = 0xD000FCE2; ++pub const LINUX_REBOOT_CMD_KEXEC: c_int = 0x45584543; ++ ++pub const REG_EXTENDED: c_int = 1; ++pub const REG_ICASE: c_int = 2; ++pub const REG_NEWLINE: c_int = 4; ++pub const REG_NOSUB: c_int = 8; ++ ++pub const REG_NOTBOL: c_int = 1; ++pub const REG_NOTEOL: c_int = 2; ++ ++pub const REG_ENOSYS: c_int = -1; ++pub const REG_NOMATCH: c_int = 1; ++pub const REG_BADPAT: c_int = 2; ++pub const REG_ECOLLATE: c_int = 3; ++pub const REG_ECTYPE: c_int = 4; ++pub const REG_EESCAPE: c_int = 5; ++pub const REG_ESUBREG: c_int = 6; ++pub const REG_EBRACK: c_int = 7; ++pub const REG_EPAREN: c_int = 8; ++pub const REG_EBRACE: c_int = 9; ++pub const REG_BADBR: c_int = 10; ++pub const REG_ERANGE: c_int = 11; ++pub const REG_ESPACE: c_int = 12; ++pub const REG_BADRPT: c_int = 13; ++ ++// linux/errqueue.h ++pub const SO_EE_ORIGIN_NONE: u8 = 0; ++pub const SO_EE_ORIGIN_LOCAL: u8 = 1; ++pub const SO_EE_ORIGIN_ICMP: u8 = 2; ++pub const SO_EE_ORIGIN_ICMP6: u8 = 3; ++pub const SO_EE_ORIGIN_TXSTATUS: u8 = 4; ++pub const SO_EE_ORIGIN_TIMESTAMPING: u8 = SO_EE_ORIGIN_TXSTATUS; ++ ++// errno.h ++pub const EPERM: c_int = 1; ++pub const ENOENT: c_int = 2; ++pub const ESRCH: c_int = 3; ++pub const EINTR: c_int = 4; ++pub const EIO: c_int = 5; ++pub const ENXIO: c_int = 6; ++pub const E2BIG: c_int = 7; ++pub const ENOEXEC: c_int = 8; ++pub const EBADF: c_int = 9; ++pub const ECHILD: c_int = 10; ++pub const EAGAIN: c_int = 11; ++pub const ENOMEM: c_int = 12; ++pub const EACCES: c_int = 13; ++pub const EFAULT: c_int = 14; ++pub const ENOTBLK: c_int = 15; ++pub const EBUSY: c_int = 16; ++pub const EEXIST: c_int = 17; ++pub const EXDEV: c_int = 18; ++pub const ENODEV: c_int = 19; ++pub const ENOTDIR: c_int = 20; ++pub const EISDIR: c_int = 21; ++pub const EINVAL: c_int = 22; ++pub const ENFILE: c_int = 23; ++pub const EMFILE: c_int = 24; ++pub const ENOTTY: c_int = 25; ++pub const ETXTBSY: c_int = 26; ++pub const EFBIG: c_int = 27; ++pub const ENOSPC: c_int = 28; ++pub const ESPIPE: c_int = 29; ++pub const EROFS: c_int = 30; ++pub const EMLINK: c_int = 31; ++pub const EPIPE: c_int = 32; ++pub const EDOM: c_int = 33; ++pub const ERANGE: c_int = 34; ++pub const EWOULDBLOCK: c_int = EAGAIN; ++ ++// linux/can.h ++pub const CAN_EFF_FLAG: canid_t = 0x80000000; ++pub const CAN_RTR_FLAG: canid_t = 0x40000000; ++pub const CAN_ERR_FLAG: canid_t = 0x20000000; ++pub const CAN_SFF_MASK: canid_t = 0x000007FF; ++pub const CAN_EFF_MASK: canid_t = 0x1FFFFFFF; ++pub const CAN_ERR_MASK: canid_t = 0x1FFFFFFF; ++pub const CANXL_PRIO_MASK: crate::canid_t = CAN_SFF_MASK; ++ ++pub const CAN_SFF_ID_BITS: c_int = 11; ++pub const CAN_EFF_ID_BITS: c_int = 29; ++pub const CANXL_PRIO_BITS: c_int = CAN_SFF_ID_BITS; ++ ++pub const CAN_MAX_DLC: c_int = 8; ++pub const CAN_MAX_DLEN: usize = 8; ++pub const CANFD_MAX_DLC: c_int = 15; ++pub const CANFD_MAX_DLEN: usize = 64; ++ ++pub const CANFD_BRS: c_int = 0x01; ++pub const CANFD_ESI: c_int = 0x02; ++ ++pub const CANXL_MIN_DLC: c_int = 0; ++pub const CANXL_MAX_DLC: c_int = 2047; ++pub const CANXL_MAX_DLC_MASK: c_int = 0x07FF; ++pub const CANXL_MIN_DLEN: usize = 1; ++pub const CANXL_MAX_DLEN: usize = 2048; ++ ++pub const CANXL_XLF: c_int = 0x80; ++pub const CANXL_SEC: c_int = 0x01; ++ ++pub const CAN_MTU: usize = size_of::(); ++pub const CANFD_MTU: usize = size_of::(); ++pub const CANXL_MTU: usize = size_of::(); ++// FIXME(offset_of): use `core::mem::offset_of!` once that is available ++// https://github.com/rust-lang/rfcs/pull/3308 ++// pub const CANXL_HDR_SIZE: usize = core::mem::offset_of!(canxl_frame, data); ++pub const CANXL_HDR_SIZE: usize = 12; ++pub const CANXL_MIN_MTU: usize = CANXL_HDR_SIZE + 64; ++pub const CANXL_MAX_MTU: usize = CANXL_MTU; ++ ++pub const CAN_RAW: c_int = 1; ++pub const CAN_BCM: c_int = 2; ++pub const CAN_TP16: c_int = 3; ++pub const CAN_TP20: c_int = 4; ++pub const CAN_MCNET: c_int = 5; ++pub const CAN_ISOTP: c_int = 6; ++pub const CAN_J1939: c_int = 7; ++pub const CAN_NPROTO: c_int = 8; ++ ++pub const SOL_CAN_BASE: c_int = 100; ++ ++pub const CAN_INV_FILTER: canid_t = 0x20000000; ++pub const CAN_RAW_FILTER_MAX: c_int = 512; ++ ++// linux/can/raw.h ++pub const SOL_CAN_RAW: c_int = SOL_CAN_BASE + CAN_RAW; ++pub const CAN_RAW_FILTER: c_int = 1; ++pub const CAN_RAW_ERR_FILTER: c_int = 2; ++pub const CAN_RAW_LOOPBACK: c_int = 3; ++pub const CAN_RAW_RECV_OWN_MSGS: c_int = 4; ++pub const CAN_RAW_FD_FRAMES: c_int = 5; ++pub const CAN_RAW_JOIN_FILTERS: c_int = 6; ++pub const CAN_RAW_XL_FRAMES: c_int = 7; ++ ++// linux/can/j1939.h ++pub const SOL_CAN_J1939: c_int = SOL_CAN_BASE + CAN_J1939; ++ ++pub const J1939_MAX_UNICAST_ADDR: c_uchar = 0xfd; ++pub const J1939_IDLE_ADDR: c_uchar = 0xfe; ++pub const J1939_NO_ADDR: c_uchar = 0xff; ++pub const J1939_NO_NAME: c_ulong = 0; ++pub const J1939_PGN_REQUEST: c_uint = 0x0ea00; ++pub const J1939_PGN_ADDRESS_CLAIMED: c_uint = 0x0ee00; ++pub const J1939_PGN_ADDRESS_COMMANDED: c_uint = 0x0fed8; ++pub const J1939_PGN_PDU1_MAX: c_uint = 0x3ff00; ++pub const J1939_PGN_MAX: c_uint = 0x3ffff; ++pub const J1939_NO_PGN: c_uint = 0x40000; ++ ++pub const SO_J1939_FILTER: c_int = 1; ++pub const SO_J1939_PROMISC: c_int = 2; ++pub const SO_J1939_SEND_PRIO: c_int = 3; ++pub const SO_J1939_ERRQUEUE: c_int = 4; ++ ++pub const SCM_J1939_DEST_ADDR: c_int = 1; ++pub const SCM_J1939_DEST_NAME: c_int = 2; ++pub const SCM_J1939_PRIO: c_int = 3; ++pub const SCM_J1939_ERRQUEUE: c_int = 4; ++ ++pub const J1939_NLA_PAD: c_int = 0; ++pub const J1939_NLA_BYTES_ACKED: c_int = 1; ++pub const J1939_NLA_TOTAL_SIZE: c_int = 2; ++pub const J1939_NLA_PGN: c_int = 3; ++pub const J1939_NLA_SRC_NAME: c_int = 4; ++pub const J1939_NLA_DEST_NAME: c_int = 5; ++pub const J1939_NLA_SRC_ADDR: c_int = 6; ++pub const J1939_NLA_DEST_ADDR: c_int = 7; ++ ++pub const J1939_EE_INFO_NONE: c_int = 0; ++pub const J1939_EE_INFO_TX_ABORT: c_int = 1; ++pub const J1939_EE_INFO_RX_RTS: c_int = 2; ++pub const J1939_EE_INFO_RX_DPO: c_int = 3; ++pub const J1939_EE_INFO_RX_ABORT: c_int = 4; ++ ++pub const J1939_FILTER_MAX: c_int = 512; ++ ++// linux/sctp.h ++pub const SCTP_FUTURE_ASSOC: c_int = 0; ++pub const SCTP_CURRENT_ASSOC: c_int = 1; ++pub const SCTP_ALL_ASSOC: c_int = 2; ++pub const SCTP_RTOINFO: c_int = 0; ++pub const SCTP_ASSOCINFO: c_int = 1; ++pub const SCTP_INITMSG: c_int = 2; ++pub const SCTP_NODELAY: c_int = 3; ++pub const SCTP_AUTOCLOSE: c_int = 4; ++pub const SCTP_SET_PEER_PRIMARY_ADDR: c_int = 5; ++pub const SCTP_PRIMARY_ADDR: c_int = 6; ++pub const SCTP_ADAPTATION_LAYER: c_int = 7; ++pub const SCTP_DISABLE_FRAGMENTS: c_int = 8; ++pub const SCTP_PEER_ADDR_PARAMS: c_int = 9; ++pub const SCTP_DEFAULT_SEND_PARAM: c_int = 10; ++pub const SCTP_EVENTS: c_int = 11; ++pub const SCTP_I_WANT_MAPPED_V4_ADDR: c_int = 12; ++pub const SCTP_MAXSEG: c_int = 13; ++pub const SCTP_STATUS: c_int = 14; ++pub const SCTP_GET_PEER_ADDR_INFO: c_int = 15; ++pub const SCTP_DELAYED_ACK_TIME: c_int = 16; ++pub const SCTP_DELAYED_ACK: c_int = SCTP_DELAYED_ACK_TIME; ++pub const SCTP_DELAYED_SACK: c_int = SCTP_DELAYED_ACK_TIME; ++pub const SCTP_CONTEXT: c_int = 17; ++pub const SCTP_FRAGMENT_INTERLEAVE: c_int = 18; ++pub const SCTP_PARTIAL_DELIVERY_POINT: c_int = 19; ++pub const SCTP_MAX_BURST: c_int = 20; ++pub const SCTP_AUTH_CHUNK: c_int = 21; ++pub const SCTP_HMAC_IDENT: c_int = 22; ++pub const SCTP_AUTH_KEY: c_int = 23; ++pub const SCTP_AUTH_ACTIVE_KEY: c_int = 24; ++pub const SCTP_AUTH_DELETE_KEY: c_int = 25; ++pub const SCTP_PEER_AUTH_CHUNKS: c_int = 26; ++pub const SCTP_LOCAL_AUTH_CHUNKS: c_int = 27; ++pub const SCTP_GET_ASSOC_NUMBER: c_int = 28; ++pub const SCTP_GET_ASSOC_ID_LIST: c_int = 29; ++pub const SCTP_AUTO_ASCONF: c_int = 30; ++pub const SCTP_PEER_ADDR_THLDS: c_int = 31; ++pub const SCTP_RECVRCVINFO: c_int = 32; ++pub const SCTP_RECVNXTINFO: c_int = 33; ++pub const SCTP_DEFAULT_SNDINFO: c_int = 34; ++pub const SCTP_AUTH_DEACTIVATE_KEY: c_int = 35; ++pub const SCTP_REUSE_PORT: c_int = 36; ++pub const SCTP_PEER_ADDR_THLDS_V2: c_int = 37; ++pub const SCTP_PR_SCTP_NONE: c_int = 0x0000; ++pub const SCTP_PR_SCTP_TTL: c_int = 0x0010; ++pub const SCTP_PR_SCTP_RTX: c_int = 0x0020; ++pub const SCTP_PR_SCTP_PRIO: c_int = 0x0030; ++pub const SCTP_PR_SCTP_MAX: c_int = SCTP_PR_SCTP_PRIO; ++pub const SCTP_PR_SCTP_MASK: c_int = 0x0030; ++pub const SCTP_ENABLE_RESET_STREAM_REQ: c_int = 0x01; ++pub const SCTP_ENABLE_RESET_ASSOC_REQ: c_int = 0x02; ++pub const SCTP_ENABLE_CHANGE_ASSOC_REQ: c_int = 0x04; ++pub const SCTP_ENABLE_STRRESET_MASK: c_int = 0x07; ++pub const SCTP_STREAM_RESET_INCOMING: c_int = 0x01; ++pub const SCTP_STREAM_RESET_OUTGOING: c_int = 0x02; ++ ++pub const SCTP_INIT: c_int = 0; ++pub const SCTP_SNDRCV: c_int = 1; ++pub const SCTP_SNDINFO: c_int = 2; ++pub const SCTP_RCVINFO: c_int = 3; ++pub const SCTP_NXTINFO: c_int = 4; ++pub const SCTP_PRINFO: c_int = 5; ++pub const SCTP_AUTHINFO: c_int = 6; ++pub const SCTP_DSTADDRV4: c_int = 7; ++pub const SCTP_DSTADDRV6: c_int = 8; ++ ++pub const SCTP_UNORDERED: c_int = 1 << 0; ++pub const SCTP_ADDR_OVER: c_int = 1 << 1; ++pub const SCTP_ABORT: c_int = 1 << 2; ++pub const SCTP_SACK_IMMEDIATELY: c_int = 1 << 3; ++pub const SCTP_SENDALL: c_int = 1 << 6; ++pub const SCTP_PR_SCTP_ALL: c_int = 1 << 7; ++pub const SCTP_NOTIFICATION: c_int = MSG_NOTIFICATION; ++pub const SCTP_EOF: c_int = crate::MSG_FIN; ++ ++/* DCCP socket options */ ++pub const DCCP_SOCKOPT_PACKET_SIZE: c_int = 1; ++pub const DCCP_SOCKOPT_SERVICE: c_int = 2; ++pub const DCCP_SOCKOPT_CHANGE_L: c_int = 3; ++pub const DCCP_SOCKOPT_CHANGE_R: c_int = 4; ++pub const DCCP_SOCKOPT_GET_CUR_MPS: c_int = 5; ++pub const DCCP_SOCKOPT_SERVER_TIMEWAIT: c_int = 6; ++pub const DCCP_SOCKOPT_SEND_CSCOV: c_int = 10; ++pub const DCCP_SOCKOPT_RECV_CSCOV: c_int = 11; ++pub const DCCP_SOCKOPT_AVAILABLE_CCIDS: c_int = 12; ++pub const DCCP_SOCKOPT_CCID: c_int = 13; ++pub const DCCP_SOCKOPT_TX_CCID: c_int = 14; ++pub const DCCP_SOCKOPT_RX_CCID: c_int = 15; ++pub const DCCP_SOCKOPT_QPOLICY_ID: c_int = 16; ++pub const DCCP_SOCKOPT_QPOLICY_TXQLEN: c_int = 17; ++pub const DCCP_SOCKOPT_CCID_RX_INFO: c_int = 128; ++pub const DCCP_SOCKOPT_CCID_TX_INFO: c_int = 192; ++ ++/// maximum number of services provided on the same listening port ++pub const DCCP_SERVICE_LIST_MAX_LEN: c_int = 32; ++ ++pub const CTL_KERN: c_int = 1; ++pub const CTL_VM: c_int = 2; ++pub const CTL_NET: c_int = 3; ++pub const CTL_FS: c_int = 5; ++pub const CTL_DEBUG: c_int = 6; ++pub const CTL_DEV: c_int = 7; ++pub const CTL_BUS: c_int = 8; ++pub const CTL_ABI: c_int = 9; ++pub const CTL_CPU: c_int = 10; ++ ++pub const CTL_BUS_ISA: c_int = 1; ++ ++pub const INOTIFY_MAX_USER_INSTANCES: c_int = 1; ++pub const INOTIFY_MAX_USER_WATCHES: c_int = 2; ++pub const INOTIFY_MAX_QUEUED_EVENTS: c_int = 3; ++ ++pub const KERN_OSTYPE: c_int = 1; ++pub const KERN_OSRELEASE: c_int = 2; ++pub const KERN_OSREV: c_int = 3; ++pub const KERN_VERSION: c_int = 4; ++pub const KERN_SECUREMASK: c_int = 5; ++pub const KERN_PROF: c_int = 6; ++pub const KERN_NODENAME: c_int = 7; ++pub const KERN_DOMAINNAME: c_int = 8; ++pub const KERN_PANIC: c_int = 15; ++pub const KERN_REALROOTDEV: c_int = 16; ++pub const KERN_SPARC_REBOOT: c_int = 21; ++pub const KERN_CTLALTDEL: c_int = 22; ++pub const KERN_PRINTK: c_int = 23; ++pub const KERN_NAMETRANS: c_int = 24; ++pub const KERN_PPC_HTABRECLAIM: c_int = 25; ++pub const KERN_PPC_ZEROPAGED: c_int = 26; ++pub const KERN_PPC_POWERSAVE_NAP: c_int = 27; ++pub const KERN_MODPROBE: c_int = 28; ++pub const KERN_SG_BIG_BUFF: c_int = 29; ++pub const KERN_ACCT: c_int = 30; ++pub const KERN_PPC_L2CR: c_int = 31; ++pub const KERN_RTSIGNR: c_int = 32; ++pub const KERN_RTSIGMAX: c_int = 33; ++pub const KERN_SHMMAX: c_int = 34; ++pub const KERN_MSGMAX: c_int = 35; ++pub const KERN_MSGMNB: c_int = 36; ++pub const KERN_MSGPOOL: c_int = 37; ++pub const KERN_SYSRQ: c_int = 38; ++pub const KERN_MAX_THREADS: c_int = 39; ++pub const KERN_RANDOM: c_int = 40; ++pub const KERN_SHMALL: c_int = 41; ++pub const KERN_MSGMNI: c_int = 42; ++pub const KERN_SEM: c_int = 43; ++pub const KERN_SPARC_STOP_A: c_int = 44; ++pub const KERN_SHMMNI: c_int = 45; ++pub const KERN_OVERFLOWUID: c_int = 46; ++pub const KERN_OVERFLOWGID: c_int = 47; ++pub const KERN_SHMPATH: c_int = 48; ++pub const KERN_HOTPLUG: c_int = 49; ++pub const KERN_IEEE_EMULATION_WARNINGS: c_int = 50; ++pub const KERN_S390_USER_DEBUG_LOGGING: c_int = 51; ++pub const KERN_CORE_USES_PID: c_int = 52; ++pub const KERN_TAINTED: c_int = 53; ++pub const KERN_CADPID: c_int = 54; ++pub const KERN_PIDMAX: c_int = 55; ++pub const KERN_CORE_PATTERN: c_int = 56; ++pub const KERN_PANIC_ON_OOPS: c_int = 57; ++pub const KERN_HPPA_PWRSW: c_int = 58; ++pub const KERN_HPPA_UNALIGNED: c_int = 59; ++pub const KERN_PRINTK_RATELIMIT: c_int = 60; ++pub const KERN_PRINTK_RATELIMIT_BURST: c_int = 61; ++pub const KERN_PTY: c_int = 62; ++pub const KERN_NGROUPS_MAX: c_int = 63; ++pub const KERN_SPARC_SCONS_PWROFF: c_int = 64; ++pub const KERN_HZ_TIMER: c_int = 65; ++pub const KERN_UNKNOWN_NMI_PANIC: c_int = 66; ++pub const KERN_BOOTLOADER_TYPE: c_int = 67; ++pub const KERN_RANDOMIZE: c_int = 68; ++pub const KERN_SETUID_DUMPABLE: c_int = 69; ++pub const KERN_SPIN_RETRY: c_int = 70; ++pub const KERN_ACPI_VIDEO_FLAGS: c_int = 71; ++pub const KERN_IA64_UNALIGNED: c_int = 72; ++pub const KERN_COMPAT_LOG: c_int = 73; ++pub const KERN_MAX_LOCK_DEPTH: c_int = 74; ++pub const KERN_NMI_WATCHDOG: c_int = 75; ++pub const KERN_PANIC_ON_NMI: c_int = 76; ++ ++pub const VM_OVERCOMMIT_MEMORY: c_int = 5; ++pub const VM_PAGE_CLUSTER: c_int = 10; ++pub const VM_DIRTY_BACKGROUND: c_int = 11; ++pub const VM_DIRTY_RATIO: c_int = 12; ++pub const VM_DIRTY_WB_CS: c_int = 13; ++pub const VM_DIRTY_EXPIRE_CS: c_int = 14; ++pub const VM_NR_PDFLUSH_THREADS: c_int = 15; ++pub const VM_OVERCOMMIT_RATIO: c_int = 16; ++pub const VM_PAGEBUF: c_int = 17; ++pub const VM_HUGETLB_PAGES: c_int = 18; ++pub const VM_SWAPPINESS: c_int = 19; ++pub const VM_LOWMEM_RESERVE_RATIO: c_int = 20; ++pub const VM_MIN_FREE_KBYTES: c_int = 21; ++pub const VM_MAX_MAP_COUNT: c_int = 22; ++pub const VM_LAPTOP_MODE: c_int = 23; ++pub const VM_BLOCK_DUMP: c_int = 24; ++pub const VM_HUGETLB_GROUP: c_int = 25; ++pub const VM_VFS_CACHE_PRESSURE: c_int = 26; ++pub const VM_LEGACY_VA_LAYOUT: c_int = 27; ++pub const VM_SWAP_TOKEN_TIMEOUT: c_int = 28; ++pub const VM_DROP_PAGECACHE: c_int = 29; ++pub const VM_PERCPU_PAGELIST_FRACTION: c_int = 30; ++pub const VM_ZONE_RECLAIM_MODE: c_int = 31; ++pub const VM_MIN_UNMAPPED: c_int = 32; ++pub const VM_PANIC_ON_OOM: c_int = 33; ++pub const VM_VDSO_ENABLED: c_int = 34; ++pub const VM_MIN_SLAB: c_int = 35; ++ ++pub const NET_CORE: c_int = 1; ++pub const NET_ETHER: c_int = 2; ++pub const NET_802: c_int = 3; ++pub const NET_UNIX: c_int = 4; ++pub const NET_IPV4: c_int = 5; ++pub const NET_IPX: c_int = 6; ++pub const NET_ATALK: c_int = 7; ++pub const NET_NETROM: c_int = 8; ++pub const NET_AX25: c_int = 9; ++pub const NET_BRIDGE: c_int = 10; ++pub const NET_ROSE: c_int = 11; ++pub const NET_IPV6: c_int = 12; ++pub const NET_X25: c_int = 13; ++pub const NET_TR: c_int = 14; ++pub const NET_DECNET: c_int = 15; ++pub const NET_ECONET: c_int = 16; ++pub const NET_SCTP: c_int = 17; ++pub const NET_LLC: c_int = 18; ++pub const NET_NETFILTER: c_int = 19; ++pub const NET_DCCP: c_int = 20; ++pub const NET_IRDA: c_int = 412; ++ ++// include/linux/sched.h ++/// I'm a virtual CPU. ++pub const PF_VCPU: c_int = 0x00000001; ++/// I am an IDLE thread. ++pub const PF_IDLE: c_int = 0x00000002; ++/// Getting shut down. ++pub const PF_EXITING: c_int = 0x00000004; ++/// Coredumps should ignore this task. ++pub const PF_POSTCOREDUMP: c_int = 0x00000008; ++/// Task is an IO worker. ++pub const PF_IO_WORKER: c_int = 0x00000010; ++/// I'm a workqueue worker. ++pub const PF_WQ_WORKER: c_int = 0x00000020; ++/// Forked but didn't exec. ++pub const PF_FORKNOEXEC: c_int = 0x00000040; ++/// Process policy on mce errors. ++pub const PF_MCE_PROCESS: c_int = 0x00000080; ++/// Used super-user privileges. ++pub const PF_SUPERPRIV: c_int = 0x00000100; ++/// Dumped core. ++pub const PF_DUMPCORE: c_int = 0x00000200; ++/// Killed by a signal. ++pub const PF_SIGNALED: c_int = 0x00000400; ++/// Allocating memory to free memory. ++/// ++/// See `memalloc_noreclaim_save()`. ++pub const PF_MEMALLOC: c_int = 0x00000800; ++/// `set_user()` noticed that `RLIMIT_NPROC` was exceeded. ++pub const PF_NPROC_EXCEEDED: c_int = 0x00001000; ++/// If unset the fpu must be initialized before use. ++pub const PF_USED_MATH: c_int = 0x00002000; ++/// Kernel thread cloned from userspace thread. ++pub const PF_USER_WORKER: c_int = 0x00004000; ++/// This thread should not be frozen. ++pub const PF_NOFREEZE: c_int = 0x00008000; ++/// I am `kswapd`. ++pub const PF_KSWAPD: c_int = 0x00020000; ++/// All allocations inherit `GFP_NOFS`. ++/// ++/// See `memalloc_nfs_save()`. ++pub const PF_MEMALLOC_NOFS: c_int = 0x00040000; ++/// All allocations inherit `GFP_NOIO`. ++/// ++/// See `memalloc_noio_save()`. ++pub const PF_MEMALLOC_NOIO: c_int = 0x00080000; ++/// Throttle writes only against the bdi I write to, I am cleaning ++/// dirty pages from some other bdi. ++pub const PF_LOCAL_THROTTLE: c_int = 0x00100000; ++/// I am a kernel thread. ++pub const PF_KTHREAD: c_int = 0x00200000; ++/// Randomize virtual address space. ++pub const PF_RANDOMIZE: c_int = 0x00400000; ++/// Userland is not allowed to meddle with `cpus_mask`. ++pub const PF_NO_SETAFFINITY: c_int = 0x04000000; ++/// Early kill for mce process policy. ++pub const PF_MCE_EARLY: c_int = 0x08000000; ++/// Allocations constrained to zones which allow long term pinning. ++/// ++/// See `memalloc_pin_save()`. ++pub const PF_MEMALLOC_PIN: c_int = 0x10000000; ++/// Plug has ts that needs updating. ++pub const PF_BLOCK_TS: c_int = 0x20000000; ++/// This thread called `freeze_processes()` and should not be frozen. ++pub const PF_SUSPEND_TASK: c_int = PF_SUSPEND_TASK_UINT as _; ++// The used value is the highest possible bit fitting on 32 bits, so directly ++// defining it as a signed integer causes the compiler to report an overflow. ++// Use instead a private intermediary that assuringly has the correct type and ++// cast it where necessary to the wanted final type, which preserves the ++// desired information as-is in terms of integer representation. ++const PF_SUSPEND_TASK_UINT: c_uint = 0x80000000; ++ ++pub const CSIGNAL: c_int = 0x000000ff; ++ ++pub const SCHED_NORMAL: c_int = 0; ++pub const SCHED_OTHER: c_int = 0; ++pub const SCHED_FIFO: c_int = 1; ++pub const SCHED_RR: c_int = 2; ++pub const SCHED_BATCH: c_int = 3; ++pub const SCHED_IDLE: c_int = 5; ++pub const SCHED_DEADLINE: c_int = 6; ++ ++pub const SCHED_RESET_ON_FORK: c_int = 0x40000000; ++ ++pub const CLONE_PIDFD: c_int = 0x1000; ++ ++pub const SCHED_FLAG_RESET_ON_FORK: c_int = 0x01; ++pub const SCHED_FLAG_RECLAIM: c_int = 0x02; ++pub const SCHED_FLAG_DL_OVERRUN: c_int = 0x04; ++pub const SCHED_FLAG_KEEP_POLICY: c_int = 0x08; ++pub const SCHED_FLAG_KEEP_PARAMS: c_int = 0x10; ++pub const SCHED_FLAG_UTIL_CLAMP_MIN: c_int = 0x20; ++pub const SCHED_FLAG_UTIL_CLAMP_MAX: c_int = 0x40; ++ ++// linux/if_xdp.h ++pub const XDP_UMEM_TX_SW_CSUM: __u32 = 1 << 1; ++pub const XDP_UMEM_TX_METADATA_LEN: __u32 = 1 << 2; ++ ++pub const XDP_TXMD_FLAGS_TIMESTAMP: __u32 = 1 << 0; ++pub const XDP_TXMD_FLAGS_CHECKSUM: __u32 = 1 << 1; ++ ++pub const XDP_TX_METADATA: __u32 = 1 << 1; ++ ++// linux/mount.h ++pub const MOUNT_ATTR_RDONLY: crate::__u64 = 0x00000001; ++pub const MOUNT_ATTR_NOSUID: crate::__u64 = 0x00000002; ++pub const MOUNT_ATTR_NODEV: crate::__u64 = 0x00000004; ++pub const MOUNT_ATTR_NOEXEC: crate::__u64 = 0x00000008; ++pub const MOUNT_ATTR__ATIME: crate::__u64 = 0x00000070; ++pub const MOUNT_ATTR_RELATIME: crate::__u64 = 0x00000000; ++pub const MOUNT_ATTR_NOATIME: crate::__u64 = 0x00000010; ++pub const MOUNT_ATTR_STRICTATIME: crate::__u64 = 0x00000020; ++pub const MOUNT_ATTR_NODIRATIME: crate::__u64 = 0x00000080; ++pub const MOUNT_ATTR_IDMAP: crate::__u64 = 0x00100000; ++pub const MOUNT_ATTR_NOSYMFOLLOW: crate::__u64 = 0x00200000; ++ ++pub const MOUNT_ATTR_SIZE_VER0: c_int = 32; ++ ++// elf.h ++pub const NT_PRSTATUS: c_int = 1; ++pub const NT_PRFPREG: c_int = 2; ++pub const NT_FPREGSET: c_int = 2; ++pub const NT_PRPSINFO: c_int = 3; ++pub const NT_PRXREG: c_int = 4; ++pub const NT_TASKSTRUCT: c_int = 4; ++pub const NT_PLATFORM: c_int = 5; ++pub const NT_AUXV: c_int = 6; ++pub const NT_GWINDOWS: c_int = 7; ++pub const NT_ASRS: c_int = 8; ++pub const NT_PSTATUS: c_int = 10; ++pub const NT_PSINFO: c_int = 13; ++pub const NT_PRCRED: c_int = 14; ++pub const NT_UTSNAME: c_int = 15; ++pub const NT_LWPSTATUS: c_int = 16; ++pub const NT_LWPSINFO: c_int = 17; ++pub const NT_PRFPXREG: c_int = 20; ++ ++pub const SCHED_FLAG_KEEP_ALL: c_int = SCHED_FLAG_KEEP_POLICY | SCHED_FLAG_KEEP_PARAMS; ++ ++pub const SCHED_FLAG_UTIL_CLAMP: c_int = SCHED_FLAG_UTIL_CLAMP_MIN | SCHED_FLAG_UTIL_CLAMP_MAX; ++ ++pub const SCHED_FLAG_ALL: c_int = SCHED_FLAG_RESET_ON_FORK ++ | SCHED_FLAG_RECLAIM ++ | SCHED_FLAG_DL_OVERRUN ++ | SCHED_FLAG_KEEP_ALL ++ | SCHED_FLAG_UTIL_CLAMP; ++ ++// ioctl_eventpoll: added in Linux 6.9 ++pub const EPIOCSPARAMS: Ioctl = 0x40088a01; ++pub const EPIOCGPARAMS: Ioctl = 0x80088a02; ++ ++const _IOC_NRBITS: u32 = 8; ++const _IOC_TYPEBITS: u32 = 8; ++ ++// https://github.com/search?q=repo%3Atorvalds%2Flinux+%22%23define+_IOC_NONE%22&type=code ++cfg_if! { ++ if #[cfg(any( ++ any(target_arch = "powerpc", target_arch = "powerpc64"), ++ any(target_arch = "sparc", target_arch = "sparc64"), ++ any(target_arch = "mips", target_arch = "mips64"), ++ ))] { ++ // https://github.com/torvalds/linux/blob/b311c1b497e51a628aa89e7cb954481e5f9dced2/arch/powerpc/include/uapi/asm/ioctl.h ++ // https://github.com/torvalds/linux/blob/b311c1b497e51a628aa89e7cb954481e5f9dced2/arch/sparc/include/uapi/asm/ioctl.h ++ // https://github.com/torvalds/linux/blob/b311c1b497e51a628aa89e7cb954481e5f9dced2/arch/mips/include/uapi/asm/ioctl.h ++ ++ const _IOC_SIZEBITS: u32 = 13; ++ const _IOC_DIRBITS: u32 = 3; ++ ++ const _IOC_NONE: u32 = 1; ++ const _IOC_READ: u32 = 2; ++ const _IOC_WRITE: u32 = 4; ++ } else { ++ // https://github.com/torvalds/linux/blob/b311c1b497e51a628aa89e7cb954481e5f9dced2/include/uapi/asm-generic/ioctl.h ++ ++ const _IOC_SIZEBITS: u32 = 14; ++ const _IOC_DIRBITS: u32 = 2; ++ ++ const _IOC_NONE: u32 = 0; ++ const _IOC_WRITE: u32 = 1; ++ const _IOC_READ: u32 = 2; ++ } ++} ++ ++const _IOC_NRMASK: u32 = (1 << _IOC_NRBITS) - 1; ++const _IOC_TYPEMASK: u32 = (1 << _IOC_TYPEBITS) - 1; ++const _IOC_SIZEMASK: u32 = (1 << _IOC_SIZEBITS) - 1; ++const _IOC_DIRMASK: u32 = (1 << _IOC_DIRBITS) - 1; ++ ++const _IOC_NRSHIFT: u32 = 0; ++const _IOC_TYPESHIFT: u32 = _IOC_NRSHIFT + _IOC_NRBITS; ++const _IOC_SIZESHIFT: u32 = _IOC_TYPESHIFT + _IOC_TYPEBITS; ++const _IOC_DIRSHIFT: u32 = _IOC_SIZESHIFT + _IOC_SIZEBITS; ++ ++// adapted from https://github.com/torvalds/linux/blob/8a696a29c6905594e4abf78eaafcb62165ac61f1/rust/kernel/ioctl.rs ++ ++/// Build an ioctl number, analogous to the C macro of the same name. ++const fn _IOC(dir: u32, ty: u32, nr: u32, size: usize) -> u32 { ++ // FIXME(ctest) the `garando_syntax` crate (used by ctest2 in the CI test suite) ++ // cannot currently parse these `debug_assert!`s ++ // ++ // debug_assert!(dir <= _IOC_DIRMASK); ++ // debug_assert!(ty <= _IOC_TYPEMASK); ++ // debug_assert!(nr <= _IOC_NRMASK); ++ // debug_assert!(size <= (_IOC_SIZEMASK as usize)); ++ ++ (dir << _IOC_DIRSHIFT) ++ | (ty << _IOC_TYPESHIFT) ++ | (nr << _IOC_NRSHIFT) ++ | ((size as u32) << _IOC_SIZESHIFT) ++} ++ ++/// Build an ioctl number for an argumentless ioctl. ++pub(crate) const fn _IO(ty: u32, nr: u32) -> u32 { ++ _IOC(_IOC_NONE, ty, nr, 0) ++} ++ ++/// Build an ioctl number for an read-only ioctl. ++pub(crate) const fn _IOR(ty: u32, nr: u32) -> u32 { ++ _IOC(_IOC_READ, ty, nr, size_of::()) ++} ++ ++/// Build an ioctl number for an write-only ioctl. ++pub(crate) const fn _IOW(ty: u32, nr: u32) -> u32 { ++ _IOC(_IOC_WRITE, ty, nr, size_of::()) ++} ++ ++/// Build an ioctl number for a read-write ioctl. ++pub(crate) const fn _IOWR(ty: u32, nr: u32) -> u32 { ++ _IOC(_IOC_READ | _IOC_WRITE, ty, nr, size_of::()) ++} ++ ++f! { ++ pub fn NLA_ALIGN(len: c_int) -> c_int { ++ return ((len) + NLA_ALIGNTO - 1) & !(NLA_ALIGNTO - 1); ++ } ++ ++ pub fn CMSG_NXTHDR(mhdr: *const msghdr, cmsg: *const cmsghdr) -> *mut cmsghdr { ++ if ((*cmsg).cmsg_len as usize) < size_of::() { ++ return 0 as *mut cmsghdr; ++ }; ++ let next = (cmsg as usize + super::CMSG_ALIGN((*cmsg).cmsg_len as usize)) as *mut cmsghdr; ++ let max = (*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize; ++ if (next.wrapping_offset(1)) as usize > max ++ || next as usize + super::CMSG_ALIGN((*next).cmsg_len as usize) > max ++ { ++ 0 as *mut cmsghdr ++ } else { ++ next as *mut cmsghdr ++ } ++ } ++ ++ pub fn CPU_ALLOC_SIZE(count: c_int) -> size_t { ++ let _dummy: cpu_set_t = mem::zeroed(); ++ let size_in_bits = 8 * mem::size_of_val(&_dummy.bits[0]); ++ ((count as size_t + size_in_bits - 1) / 8) as size_t ++ } ++ ++ pub fn CPU_ZERO(cpuset: &mut cpu_set_t) -> () { ++ for slot in cpuset.bits.iter_mut() { ++ *slot = 0; ++ } ++ } ++ ++ pub fn CPU_SET(cpu: usize, cpuset: &mut cpu_set_t) -> () { ++ let size_in_bits = 8 * mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc ++ let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits); ++ cpuset.bits[idx] |= 1 << offset; ++ () ++ } ++ ++ pub fn CPU_CLR(cpu: usize, cpuset: &mut cpu_set_t) -> () { ++ let size_in_bits = 8 * mem::size_of_val(&cpuset.bits[0]); // 32, 64 etc ++ let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits); ++ cpuset.bits[idx] &= !(1 << offset); ++ () ++ } ++ ++ pub fn CPU_ISSET(cpu: usize, cpuset: &cpu_set_t) -> bool { ++ let size_in_bits = 8 * mem::size_of_val(&cpuset.bits[0]); ++ let (idx, offset) = (cpu / size_in_bits, cpu % size_in_bits); ++ 0 != (cpuset.bits[idx] & (1 << offset)) ++ } ++ ++ pub fn CPU_COUNT_S(size: usize, cpuset: &cpu_set_t) -> c_int { ++ let mut s: u32 = 0; ++ let size_of_mask = mem::size_of_val(&cpuset.bits[0]); ++ for i in cpuset.bits[..(size / size_of_mask)].iter() { ++ s += i.count_ones(); ++ } ++ s as c_int ++ } ++ ++ pub fn CPU_COUNT(cpuset: &cpu_set_t) -> c_int { ++ CPU_COUNT_S(size_of::(), cpuset) ++ } ++ ++ pub fn CPU_EQUAL(set1: &cpu_set_t, set2: &cpu_set_t) -> bool { ++ set1.bits == set2.bits ++ } ++ ++ pub fn SCTP_PR_INDEX(policy: c_int) -> c_int { ++ policy >> 4 - 1 ++ } ++ ++ pub fn SCTP_PR_POLICY(policy: c_int) -> c_int { ++ policy & SCTP_PR_SCTP_MASK ++ } ++ ++ pub fn SCTP_PR_SET_POLICY(flags: &mut c_int, policy: c_int) -> () { ++ *flags &= !SCTP_PR_SCTP_MASK; ++ *flags |= policy; ++ () ++ } ++ ++ pub fn major(dev: crate::dev_t) -> c_uint { ++ let mut major = 0; ++ major |= (dev & 0x00000000000fff00) >> 8; ++ major |= (dev & 0xfffff00000000000) >> 32; ++ major as c_uint ++ } ++ ++ pub fn minor(dev: crate::dev_t) -> c_uint { ++ let mut minor = 0; ++ minor |= (dev & 0x00000000000000ff) >> 0; ++ minor |= (dev & 0x00000ffffff00000) >> 12; ++ minor as c_uint ++ } ++ ++ pub fn IPTOS_TOS(tos: u8) -> u8 { ++ tos & IPTOS_TOS_MASK ++ } ++ ++ pub fn IPTOS_PREC(tos: u8) -> u8 { ++ tos & IPTOS_PREC_MASK ++ } ++ ++ pub fn RT_TOS(tos: u8) -> u8 { ++ tos & crate::IPTOS_TOS_MASK ++ } ++ ++ pub fn RT_ADDRCLASS(flags: u32) -> u32 { ++ flags >> 23 ++ } ++ ++ pub fn RT_LOCALADDR(flags: u32) -> bool { ++ (flags & RTF_ADDRCLASSMASK) == (RTF_LOCAL | RTF_INTERFACE) ++ } ++ ++ pub fn SO_EE_OFFENDER(ee: *const crate::sock_extended_err) -> *mut crate::sockaddr { ++ ee.offset(1) as *mut crate::sockaddr ++ } ++ ++ pub fn TPACKET_ALIGN(x: usize) -> usize { ++ (x + TPACKET_ALIGNMENT - 1) & !(TPACKET_ALIGNMENT - 1) ++ } ++ ++ pub fn BPF_RVAL(code: __u32) -> __u32 { ++ code & 0x18 ++ } ++ ++ pub fn BPF_MISCOP(code: __u32) -> __u32 { ++ code & 0xf8 ++ } ++ ++ pub fn BPF_STMT(code: __u16, k: __u32) -> sock_filter { ++ sock_filter { ++ code: code, ++ jt: 0, ++ jf: 0, ++ k: k, ++ } ++ } ++ ++ pub fn BPF_JUMP(code: __u16, k: __u32, jt: __u8, jf: __u8) -> sock_filter { ++ sock_filter { ++ code: code, ++ jt: jt, ++ jf: jf, ++ k: k, ++ } ++ } ++ ++ pub fn ELF32_R_SYM(val: Elf32_Word) -> Elf32_Word { ++ val >> 8 ++ } ++ ++ pub fn ELF32_R_TYPE(val: Elf32_Word) -> Elf32_Word { ++ val & 0xff ++ } ++ ++ pub fn ELF32_R_INFO(sym: Elf32_Word, t: Elf32_Word) -> Elf32_Word { ++ sym << 8 + t & 0xff ++ } ++ ++ pub fn ELF64_R_SYM(val: Elf64_Xword) -> Elf64_Xword { ++ val >> 32 ++ } ++ ++ pub fn ELF64_R_TYPE(val: Elf64_Xword) -> Elf64_Xword { ++ val & 0xffffffff ++ } ++ ++ pub fn ELF64_R_INFO(sym: Elf64_Xword, t: Elf64_Xword) -> Elf64_Xword { ++ sym << 32 + t ++ } ++} ++ ++safe_f! { ++ pub {const} fn makedev(major: c_uint, minor: c_uint) -> crate::dev_t { ++ let major = major as crate::dev_t; ++ let minor = minor as crate::dev_t; ++ let mut dev = 0; ++ dev |= (major & 0x00000fff) << 8; ++ dev |= (major & 0xfffff000) << 32; ++ dev |= (minor & 0x000000ff) << 0; ++ dev |= (minor & 0xffffff00) << 12; ++ dev ++ } ++ ++ pub {const} fn SCTP_PR_TTL_ENABLED(policy: c_int) -> bool { ++ policy == SCTP_PR_SCTP_TTL ++ } ++ ++ pub {const} fn SCTP_PR_RTX_ENABLED(policy: c_int) -> bool { ++ policy == SCTP_PR_SCTP_RTX ++ } ++ ++ pub {const} fn SCTP_PR_PRIO_ENABLED(policy: c_int) -> bool { ++ policy == SCTP_PR_SCTP_PRIO ++ } ++} ++ ++cfg_if! { ++ if #[cfg(all(not(target_env = "uclibc"), not(target_env = "ohos")))] { ++ extern "C" { ++ #[cfg_attr(gnu_time64_abi, link_name = "aio_read64")] ++ pub fn aio_read(aiocbp: *mut aiocb) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "aio_write64")] ++ pub fn aio_write(aiocbp: *mut aiocb) -> c_int; ++ pub fn aio_fsync(op: c_int, aiocbp: *mut aiocb) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "aio_error64")] ++ pub fn aio_error(aiocbp: *const aiocb) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "aio_return64")] ++ pub fn aio_return(aiocbp: *mut aiocb) -> ssize_t; ++ #[cfg_attr(gnu_time64_abi, link_name = "__aio_suspend_time64")] ++ pub fn aio_suspend( ++ aiocb_list: *const *const aiocb, ++ nitems: c_int, ++ timeout: *const crate::timespec, ++ ) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "aio_cancel64")] ++ pub fn aio_cancel(fd: c_int, aiocbp: *mut aiocb) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "lio_listio64")] ++ pub fn lio_listio( ++ mode: c_int, ++ aiocb_list: *const *mut aiocb, ++ nitems: c_int, ++ sevp: *mut crate::sigevent, ++ ) -> c_int; ++ } ++ } ++} ++ ++cfg_if! { ++ if #[cfg(not(target_env = "uclibc"))] { ++ extern "C" { ++ #[cfg_attr(gnu_time64_abi, link_name = "pwritev64")] ++ pub fn pwritev( ++ fd: c_int, ++ iov: *const crate::iovec, ++ iovcnt: c_int, ++ offset: off_t, ++ ) -> ssize_t; ++ #[cfg_attr(gnu_time64_abi, link_name = "preadv64")] ++ pub fn preadv( ++ fd: c_int, ++ iov: *const crate::iovec, ++ iovcnt: c_int, ++ offset: off_t, ++ ) -> ssize_t; ++ pub fn getnameinfo( ++ sa: *const crate::sockaddr, ++ salen: crate::socklen_t, ++ host: *mut c_char, ++ hostlen: crate::socklen_t, ++ serv: *mut c_char, ++ servlen: crate::socklen_t, ++ flags: c_int, ++ ) -> c_int; ++ pub fn getloadavg(loadavg: *mut c_double, nelem: c_int) -> c_int; ++ pub fn process_vm_readv( ++ pid: crate::pid_t, ++ local_iov: *const crate::iovec, ++ liovcnt: c_ulong, ++ remote_iov: *const crate::iovec, ++ riovcnt: c_ulong, ++ flags: c_ulong, ++ ) -> isize; ++ pub fn process_vm_writev( ++ pid: crate::pid_t, ++ local_iov: *const crate::iovec, ++ liovcnt: c_ulong, ++ remote_iov: *const crate::iovec, ++ riovcnt: c_ulong, ++ flags: c_ulong, ++ ) -> isize; ++ #[cfg_attr(gnu_time64_abi, link_name = "__futimes64")] ++ pub fn futimes(fd: c_int, times: *const crate::timeval) -> c_int; ++ } ++ } ++} ++ ++// These functions are not available on OpenHarmony ++cfg_if! { ++ if #[cfg(not(target_env = "ohos"))] { ++ extern "C" { ++ // Only `getspnam_r` is implemented for musl, out of all of the reenterant ++ // functions from `shadow.h`. ++ // https://git.musl-libc.org/cgit/musl/tree/include/shadow.h ++ pub fn getspnam_r( ++ name: *const c_char, ++ spbuf: *mut spwd, ++ buf: *mut c_char, ++ buflen: size_t, ++ spbufp: *mut *mut spwd, ++ ) -> c_int; ++ ++ pub fn mq_open(name: *const c_char, oflag: c_int, ...) -> crate::mqd_t; ++ pub fn mq_close(mqd: crate::mqd_t) -> c_int; ++ pub fn mq_unlink(name: *const c_char) -> c_int; ++ pub fn mq_receive( ++ mqd: crate::mqd_t, ++ msg_ptr: *mut c_char, ++ msg_len: size_t, ++ msg_prio: *mut c_uint, ++ ) -> ssize_t; ++ #[cfg_attr(gnu_time64_abi, link_name = "__mq_timedreceive_time64")] ++ pub fn mq_timedreceive( ++ mqd: crate::mqd_t, ++ msg_ptr: *mut c_char, ++ msg_len: size_t, ++ msg_prio: *mut c_uint, ++ abs_timeout: *const crate::timespec, ++ ) -> ssize_t; ++ pub fn mq_send( ++ mqd: crate::mqd_t, ++ msg_ptr: *const c_char, ++ msg_len: size_t, ++ msg_prio: c_uint, ++ ) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "__mq_timedsend_time64")] ++ pub fn mq_timedsend( ++ mqd: crate::mqd_t, ++ msg_ptr: *const c_char, ++ msg_len: size_t, ++ msg_prio: c_uint, ++ abs_timeout: *const crate::timespec, ++ ) -> c_int; ++ pub fn mq_getattr(mqd: crate::mqd_t, attr: *mut crate::mq_attr) -> c_int; ++ pub fn mq_setattr( ++ mqd: crate::mqd_t, ++ newattr: *const crate::mq_attr, ++ oldattr: *mut crate::mq_attr, ++ ) -> c_int; ++ ++ pub fn pthread_mutex_consistent(mutex: *mut pthread_mutex_t) -> c_int; ++ pub fn pthread_cancel(thread: crate::pthread_t) -> c_int; ++ pub fn pthread_mutexattr_getrobust( ++ attr: *const pthread_mutexattr_t, ++ robustness: *mut c_int, ++ ) -> c_int; ++ pub fn pthread_mutexattr_setrobust( ++ attr: *mut pthread_mutexattr_t, ++ robustness: c_int, ++ ) -> c_int; ++ } ++ } ++} ++ ++extern "C" { ++ #[cfg_attr( ++ not(any(target_env = "musl", target_env = "ohos")), ++ link_name = "__xpg_strerror_r" ++ )] ++ pub fn strerror_r(errnum: c_int, buf: *mut c_char, buflen: size_t) -> c_int; ++ ++ pub fn abs(i: c_int) -> c_int; ++ pub fn labs(i: c_long) -> c_long; ++ pub fn rand() -> c_int; ++ pub fn srand(seed: c_uint); ++ ++ pub fn drand48() -> c_double; ++ pub fn erand48(xseed: *mut c_ushort) -> c_double; ++ pub fn lrand48() -> c_long; ++ pub fn nrand48(xseed: *mut c_ushort) -> c_long; ++ pub fn mrand48() -> c_long; ++ pub fn jrand48(xseed: *mut c_ushort) -> c_long; ++ pub fn srand48(seed: c_long); ++ pub fn seed48(xseed: *mut c_ushort) -> *mut c_ushort; ++ pub fn lcong48(p: *mut c_ushort); ++ ++ #[cfg_attr(gnu_time64_abi, link_name = "__lutimes64")] ++ pub fn lutimes(file: *const c_char, times: *const crate::timeval) -> c_int; ++ ++ pub fn setpwent(); ++ pub fn endpwent(); ++ pub fn getpwent() -> *mut passwd; ++ pub fn setgrent(); ++ pub fn endgrent(); ++ pub fn getgrent() -> *mut crate::group; ++ pub fn setspent(); ++ pub fn endspent(); ++ pub fn getspent() -> *mut spwd; ++ ++ pub fn getspnam(name: *const c_char) -> *mut spwd; ++ ++ pub fn shm_open(name: *const c_char, oflag: c_int, mode: mode_t) -> c_int; ++ pub fn shm_unlink(name: *const c_char) -> c_int; ++ ++ // System V IPC ++ pub fn shmget(key: crate::key_t, size: size_t, shmflg: c_int) -> c_int; ++ pub fn shmat(shmid: c_int, shmaddr: *const c_void, shmflg: c_int) -> *mut c_void; ++ pub fn shmdt(shmaddr: *const c_void) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "__shmctl64")] ++ pub fn shmctl(shmid: c_int, cmd: c_int, buf: *mut crate::shmid_ds) -> c_int; ++ pub fn ftok(pathname: *const c_char, proj_id: c_int) -> crate::key_t; ++ pub fn semget(key: crate::key_t, nsems: c_int, semflag: c_int) -> c_int; ++ pub fn semop(semid: c_int, sops: *mut crate::sembuf, nsops: size_t) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "__semctl64")] ++ pub fn semctl(semid: c_int, semnum: c_int, cmd: c_int, ...) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "__msgctl64")] ++ pub fn msgctl(msqid: c_int, cmd: c_int, buf: *mut msqid_ds) -> c_int; ++ pub fn msgget(key: crate::key_t, msgflg: c_int) -> c_int; ++ pub fn msgrcv( ++ msqid: c_int, ++ msgp: *mut c_void, ++ msgsz: size_t, ++ msgtyp: c_long, ++ msgflg: c_int, ++ ) -> ssize_t; ++ pub fn msgsnd(msqid: c_int, msgp: *const c_void, msgsz: size_t, msgflg: c_int) -> c_int; ++ ++ pub fn mprotect(addr: *mut c_void, len: size_t, prot: c_int) -> c_int; ++ pub fn __errno_location() -> *mut c_int; ++ ++ #[cfg_attr(gnu_time64_abi, link_name = "fallocate64")] ++ pub fn fallocate(fd: c_int, mode: c_int, offset: off_t, len: off_t) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "posix_fallocate64")] ++ pub fn posix_fallocate(fd: c_int, offset: off_t, len: off_t) -> c_int; ++ pub fn readahead(fd: c_int, offset: off64_t, count: size_t) -> ssize_t; ++ pub fn getxattr( ++ path: *const c_char, ++ name: *const c_char, ++ value: *mut c_void, ++ size: size_t, ++ ) -> ssize_t; ++ pub fn lgetxattr( ++ path: *const c_char, ++ name: *const c_char, ++ value: *mut c_void, ++ size: size_t, ++ ) -> ssize_t; ++ pub fn fgetxattr( ++ filedes: c_int, ++ name: *const c_char, ++ value: *mut c_void, ++ size: size_t, ++ ) -> ssize_t; ++ pub fn setxattr( ++ path: *const c_char, ++ name: *const c_char, ++ value: *const c_void, ++ size: size_t, ++ flags: c_int, ++ ) -> c_int; ++ pub fn lsetxattr( ++ path: *const c_char, ++ name: *const c_char, ++ value: *const c_void, ++ size: size_t, ++ flags: c_int, ++ ) -> c_int; ++ pub fn fsetxattr( ++ filedes: c_int, ++ name: *const c_char, ++ value: *const c_void, ++ size: size_t, ++ flags: c_int, ++ ) -> c_int; ++ pub fn listxattr(path: *const c_char, list: *mut c_char, size: size_t) -> ssize_t; ++ pub fn llistxattr(path: *const c_char, list: *mut c_char, size: size_t) -> ssize_t; ++ pub fn flistxattr(filedes: c_int, list: *mut c_char, size: size_t) -> ssize_t; ++ pub fn removexattr(path: *const c_char, name: *const c_char) -> c_int; ++ pub fn lremovexattr(path: *const c_char, name: *const c_char) -> c_int; ++ pub fn fremovexattr(filedes: c_int, name: *const c_char) -> c_int; ++ pub fn signalfd(fd: c_int, mask: *const crate::sigset_t, flags: c_int) -> c_int; ++ pub fn timerfd_create(clockid: crate::clockid_t, flags: c_int) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "__timerfd_gettime64")] ++ pub fn timerfd_gettime(fd: c_int, curr_value: *mut itimerspec) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "__timerfd_settime64")] ++ pub fn timerfd_settime( ++ fd: c_int, ++ flags: c_int, ++ new_value: *const itimerspec, ++ old_value: *mut itimerspec, ++ ) -> c_int; ++ pub fn quotactl(cmd: c_int, special: *const c_char, id: c_int, data: *mut c_char) -> c_int; ++ pub fn epoll_pwait( ++ epfd: c_int, ++ events: *mut crate::epoll_event, ++ maxevents: c_int, ++ timeout: c_int, ++ sigmask: *const crate::sigset_t, ++ ) -> c_int; ++ pub fn dup3(oldfd: c_int, newfd: c_int, flags: c_int) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "__sigtimedwait64")] ++ pub fn sigtimedwait( ++ set: *const sigset_t, ++ info: *mut siginfo_t, ++ timeout: *const crate::timespec, ++ ) -> c_int; ++ pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> c_int; ++ pub fn nl_langinfo_l(item: crate::nl_item, locale: crate::locale_t) -> *mut c_char; ++ pub fn accept4( ++ fd: c_int, ++ addr: *mut crate::sockaddr, ++ len: *mut crate::socklen_t, ++ flg: c_int, ++ ) -> c_int; ++ pub fn pthread_getaffinity_np( ++ thread: crate::pthread_t, ++ cpusetsize: size_t, ++ cpuset: *mut crate::cpu_set_t, ++ ) -> c_int; ++ pub fn pthread_setaffinity_np( ++ thread: crate::pthread_t, ++ cpusetsize: size_t, ++ cpuset: *const crate::cpu_set_t, ++ ) -> c_int; ++ pub fn pthread_setschedprio(native: crate::pthread_t, priority: c_int) -> c_int; ++ pub fn reboot(how_to: c_int) -> c_int; ++ pub fn setfsgid(gid: crate::gid_t) -> c_int; ++ pub fn setfsuid(uid: crate::uid_t) -> c_int; ++ ++ // Not available now on Android ++ pub fn mkfifoat(dirfd: c_int, pathname: *const c_char, mode: crate::mode_t) -> c_int; ++ pub fn if_nameindex() -> *mut if_nameindex; ++ pub fn if_freenameindex(ptr: *mut if_nameindex); ++ pub fn sync_file_range(fd: c_int, offset: off64_t, nbytes: off64_t, flags: c_uint) -> c_int; ++ pub fn mremap( ++ addr: *mut c_void, ++ len: size_t, ++ new_len: size_t, ++ flags: c_int, ++ ... ++ ) -> *mut c_void; ++ ++ #[cfg_attr(gnu_time64_abi, link_name = "__glob64_time64")] ++ pub fn glob( ++ pattern: *const c_char, ++ flags: c_int, ++ errfunc: Option c_int>, ++ pglob: *mut crate::glob_t, ++ ) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "__globfree64_time64")] ++ pub fn globfree(pglob: *mut crate::glob_t); ++ ++ pub fn posix_madvise(addr: *mut c_void, len: size_t, advice: c_int) -> c_int; ++ ++ pub fn seekdir(dirp: *mut crate::DIR, loc: c_long); ++ ++ pub fn telldir(dirp: *mut crate::DIR) -> c_long; ++ pub fn madvise(addr: *mut c_void, len: size_t, advice: c_int) -> c_int; ++ ++ pub fn msync(addr: *mut c_void, len: size_t, flags: c_int) -> c_int; ++ pub fn remap_file_pages( ++ addr: *mut c_void, ++ size: size_t, ++ prot: c_int, ++ pgoff: size_t, ++ flags: c_int, ++ ) -> c_int; ++ pub fn recvfrom( ++ socket: c_int, ++ buf: *mut c_void, ++ len: size_t, ++ flags: c_int, ++ addr: *mut crate::sockaddr, ++ addrlen: *mut crate::socklen_t, ++ ) -> ssize_t; ++ #[cfg_attr(gnu_time64_abi, link_name = "mkstemps64")] ++ pub fn mkstemps(template: *mut c_char, suffixlen: c_int) -> c_int; ++ ++ pub fn nl_langinfo(item: crate::nl_item) -> *mut c_char; ++ ++ pub fn getdomainname(name: *mut c_char, len: size_t) -> c_int; ++ pub fn setdomainname(name: *const c_char, len: size_t) -> c_int; ++ pub fn vhangup() -> c_int; ++ pub fn sync(); ++ pub fn syncfs(fd: c_int) -> c_int; ++ pub fn syscall(num: c_long, ...) -> c_long; ++ pub fn sched_getaffinity( ++ pid: crate::pid_t, ++ cpusetsize: size_t, ++ cpuset: *mut cpu_set_t, ++ ) -> c_int; ++ pub fn sched_setaffinity( ++ pid: crate::pid_t, ++ cpusetsize: size_t, ++ cpuset: *const cpu_set_t, ++ ) -> c_int; ++ pub fn epoll_create(size: c_int) -> c_int; ++ pub fn epoll_create1(flags: c_int) -> c_int; ++ pub fn epoll_wait( ++ epfd: c_int, ++ events: *mut crate::epoll_event, ++ maxevents: c_int, ++ timeout: c_int, ++ ) -> c_int; ++ pub fn epoll_ctl(epfd: c_int, op: c_int, fd: c_int, event: *mut crate::epoll_event) -> c_int; ++ pub fn pthread_getschedparam( ++ native: crate::pthread_t, ++ policy: *mut c_int, ++ param: *mut crate::sched_param, ++ ) -> c_int; ++ pub fn unshare(flags: c_int) -> c_int; ++ pub fn umount(target: *const c_char) -> c_int; ++ pub fn sched_get_priority_max(policy: c_int) -> c_int; ++ pub fn tee(fd_in: c_int, fd_out: c_int, len: size_t, flags: c_uint) -> ssize_t; ++ #[cfg_attr(gnu_time64_abi, link_name = "__settimeofday64")] ++ pub fn settimeofday(tv: *const crate::timeval, tz: *const crate::timezone) -> c_int; ++ pub fn splice( ++ fd_in: c_int, ++ off_in: *mut crate::loff_t, ++ fd_out: c_int, ++ off_out: *mut crate::loff_t, ++ len: size_t, ++ flags: c_uint, ++ ) -> ssize_t; ++ pub fn eventfd(init: c_uint, flags: c_int) -> c_int; ++ pub fn eventfd_read(fd: c_int, value: *mut eventfd_t) -> c_int; ++ pub fn eventfd_write(fd: c_int, value: eventfd_t) -> c_int; ++ ++ #[cfg_attr(gnu_time64_abi, link_name = "__sched_rr_get_interval64")] ++ pub fn sched_rr_get_interval(pid: crate::pid_t, tp: *mut crate::timespec) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "__sem_timedwait64")] ++ pub fn sem_timedwait(sem: *mut sem_t, abstime: *const crate::timespec) -> c_int; ++ pub fn sem_getvalue(sem: *mut sem_t, sval: *mut c_int) -> c_int; ++ pub fn sched_setparam(pid: crate::pid_t, param: *const crate::sched_param) -> c_int; ++ pub fn setns(fd: c_int, nstype: c_int) -> c_int; ++ pub fn swapoff(path: *const c_char) -> c_int; ++ pub fn vmsplice(fd: c_int, iov: *const crate::iovec, nr_segs: size_t, flags: c_uint) ++ -> ssize_t; ++ pub fn mount( ++ src: *const c_char, ++ target: *const c_char, ++ fstype: *const c_char, ++ flags: c_ulong, ++ data: *const c_void, ++ ) -> c_int; ++ pub fn personality(persona: c_ulong) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "__prctl_time64")] ++ pub fn prctl(option: c_int, ...) -> c_int; ++ pub fn sched_getparam(pid: crate::pid_t, param: *mut crate::sched_param) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "__ppoll64")] ++ pub fn ppoll( ++ fds: *mut crate::pollfd, ++ nfds: nfds_t, ++ timeout: *const crate::timespec, ++ sigmask: *const sigset_t, ++ ) -> c_int; ++ pub fn pthread_mutexattr_getprotocol( ++ attr: *const pthread_mutexattr_t, ++ protocol: *mut c_int, ++ ) -> c_int; ++ pub fn pthread_mutexattr_setprotocol(attr: *mut pthread_mutexattr_t, protocol: c_int) -> c_int; ++ ++ #[cfg_attr(gnu_time64_abi, link_name = "__pthread_mutex_timedlock64")] ++ pub fn pthread_mutex_timedlock( ++ lock: *mut pthread_mutex_t, ++ abstime: *const crate::timespec, ++ ) -> c_int; ++ pub fn pthread_barrierattr_init(attr: *mut crate::pthread_barrierattr_t) -> c_int; ++ pub fn pthread_barrierattr_destroy(attr: *mut crate::pthread_barrierattr_t) -> c_int; ++ pub fn pthread_barrierattr_getpshared( ++ attr: *const crate::pthread_barrierattr_t, ++ shared: *mut c_int, ++ ) -> c_int; ++ pub fn pthread_barrierattr_setpshared( ++ attr: *mut crate::pthread_barrierattr_t, ++ shared: c_int, ++ ) -> c_int; ++ pub fn pthread_barrier_init( ++ barrier: *mut pthread_barrier_t, ++ attr: *const crate::pthread_barrierattr_t, ++ count: c_uint, ++ ) -> c_int; ++ pub fn pthread_barrier_destroy(barrier: *mut pthread_barrier_t) -> c_int; ++ pub fn pthread_barrier_wait(barrier: *mut pthread_barrier_t) -> c_int; ++ pub fn pthread_spin_init(lock: *mut crate::pthread_spinlock_t, pshared: c_int) -> c_int; ++ pub fn pthread_spin_destroy(lock: *mut crate::pthread_spinlock_t) -> c_int; ++ pub fn pthread_spin_lock(lock: *mut crate::pthread_spinlock_t) -> c_int; ++ pub fn pthread_spin_trylock(lock: *mut crate::pthread_spinlock_t) -> c_int; ++ pub fn pthread_spin_unlock(lock: *mut crate::pthread_spinlock_t) -> c_int; ++ pub fn clone( ++ cb: extern "C" fn(*mut c_void) -> c_int, ++ child_stack: *mut c_void, ++ flags: c_int, ++ arg: *mut c_void, ++ ... ++ ) -> c_int; ++ pub fn sched_getscheduler(pid: crate::pid_t) -> c_int; ++ #[cfg_attr( ++ all( ++ target_env = "gnu", ++ target_pointer_width = "32", ++ not(target_arch = "x86_64"), ++ gnu_time64_abi ++ ), ++ link_name = "__clock_nanosleep_time64" ++ )] ++ pub fn clock_nanosleep( ++ clk_id: crate::clockid_t, ++ flags: c_int, ++ rqtp: *const crate::timespec, ++ rmtp: *mut crate::timespec, ++ ) -> c_int; ++ pub fn pthread_attr_getguardsize( ++ attr: *const crate::pthread_attr_t, ++ guardsize: *mut size_t, ++ ) -> c_int; ++ pub fn pthread_attr_setguardsize(attr: *mut crate::pthread_attr_t, guardsize: size_t) -> c_int; ++ pub fn pthread_attr_getinheritsched( ++ attr: *const crate::pthread_attr_t, ++ inheritsched: *mut c_int, ++ ) -> c_int; ++ pub fn pthread_attr_setinheritsched( ++ attr: *mut crate::pthread_attr_t, ++ inheritsched: c_int, ++ ) -> c_int; ++ pub fn pthread_attr_getschedpolicy( ++ attr: *const crate::pthread_attr_t, ++ policy: *mut c_int, ++ ) -> c_int; ++ pub fn pthread_attr_setschedpolicy(attr: *mut crate::pthread_attr_t, policy: c_int) -> c_int; ++ pub fn pthread_attr_getschedparam( ++ attr: *const crate::pthread_attr_t, ++ param: *mut crate::sched_param, ++ ) -> c_int; ++ pub fn pthread_attr_setschedparam( ++ attr: *mut crate::pthread_attr_t, ++ param: *const crate::sched_param, ++ ) -> c_int; ++ pub fn sethostname(name: *const c_char, len: size_t) -> c_int; ++ pub fn sched_get_priority_min(policy: c_int) -> c_int; ++ pub fn pthread_condattr_getpshared( ++ attr: *const pthread_condattr_t, ++ pshared: *mut c_int, ++ ) -> c_int; ++ pub fn sysinfo(info: *mut crate::sysinfo) -> c_int; ++ pub fn umount2(target: *const c_char, flags: c_int) -> c_int; ++ pub fn pthread_setschedparam( ++ native: crate::pthread_t, ++ policy: c_int, ++ param: *const crate::sched_param, ++ ) -> c_int; ++ pub fn swapon(path: *const c_char, swapflags: c_int) -> c_int; ++ pub fn sched_setscheduler( ++ pid: crate::pid_t, ++ policy: c_int, ++ param: *const crate::sched_param, ++ ) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "sendfile64")] ++ pub fn sendfile(out_fd: c_int, in_fd: c_int, offset: *mut off_t, count: size_t) -> ssize_t; ++ pub fn sigsuspend(mask: *const crate::sigset_t) -> c_int; ++ pub fn getgrgid_r( ++ gid: crate::gid_t, ++ grp: *mut crate::group, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut crate::group, ++ ) -> c_int; ++ pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> c_int; ++ pub fn sem_close(sem: *mut sem_t) -> c_int; ++ pub fn getdtablesize() -> c_int; ++ pub fn getgrnam_r( ++ name: *const c_char, ++ grp: *mut crate::group, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut crate::group, ++ ) -> c_int; ++ pub fn initgroups(user: *const c_char, group: crate::gid_t) -> c_int; ++ pub fn pthread_sigmask(how: c_int, set: *const sigset_t, oldset: *mut sigset_t) -> c_int; ++ pub fn sem_open(name: *const c_char, oflag: c_int, ...) -> *mut sem_t; ++ pub fn getgrnam(name: *const c_char) -> *mut crate::group; ++ pub fn pthread_kill(thread: crate::pthread_t, sig: c_int) -> c_int; ++ pub fn sem_unlink(name: *const c_char) -> c_int; ++ pub fn daemon(nochdir: c_int, noclose: c_int) -> c_int; ++ pub fn getpwnam_r( ++ name: *const c_char, ++ pwd: *mut passwd, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut passwd, ++ ) -> c_int; ++ pub fn getpwuid_r( ++ uid: crate::uid_t, ++ pwd: *mut passwd, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut passwd, ++ ) -> c_int; ++ pub fn sigwait(set: *const sigset_t, sig: *mut c_int) -> c_int; ++ pub fn pthread_atfork( ++ prepare: Option, ++ parent: Option, ++ child: Option, ++ ) -> c_int; ++ pub fn getgrgid(gid: crate::gid_t) -> *mut crate::group; ++ pub fn getgrouplist( ++ user: *const c_char, ++ group: crate::gid_t, ++ groups: *mut crate::gid_t, ++ ngroups: *mut c_int, ++ ) -> c_int; ++ pub fn pthread_mutexattr_getpshared( ++ attr: *const pthread_mutexattr_t, ++ pshared: *mut c_int, ++ ) -> c_int; ++ pub fn popen(command: *const c_char, mode: *const c_char) -> *mut crate::FILE; ++ pub fn faccessat(dirfd: c_int, pathname: *const c_char, mode: c_int, flags: c_int) -> c_int; ++ pub fn pthread_create( ++ native: *mut crate::pthread_t, ++ attr: *const crate::pthread_attr_t, ++ f: extern "C" fn(*mut c_void) -> *mut c_void, ++ value: *mut c_void, ++ ) -> c_int; ++ pub fn dl_iterate_phdr( ++ callback: Option< ++ unsafe extern "C" fn( ++ info: *mut crate::dl_phdr_info, ++ size: size_t, ++ data: *mut c_void, ++ ) -> c_int, ++ >, ++ data: *mut c_void, ++ ) -> c_int; ++ ++ pub fn setmntent(filename: *const c_char, ty: *const c_char) -> *mut crate::FILE; ++ pub fn getmntent(stream: *mut crate::FILE) -> *mut crate::mntent; ++ pub fn addmntent(stream: *mut crate::FILE, mnt: *const crate::mntent) -> c_int; ++ pub fn endmntent(streamp: *mut crate::FILE) -> c_int; ++ pub fn hasmntopt(mnt: *const crate::mntent, opt: *const c_char) -> *mut c_char; ++ ++ pub fn posix_spawn( ++ pid: *mut crate::pid_t, ++ path: *const c_char, ++ file_actions: *const crate::posix_spawn_file_actions_t, ++ attrp: *const crate::posix_spawnattr_t, ++ argv: *const *mut c_char, ++ envp: *const *mut c_char, ++ ) -> c_int; ++ pub fn posix_spawnp( ++ pid: *mut crate::pid_t, ++ file: *const c_char, ++ file_actions: *const crate::posix_spawn_file_actions_t, ++ attrp: *const crate::posix_spawnattr_t, ++ argv: *const *mut c_char, ++ envp: *const *mut c_char, ++ ) -> 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_getsigdefault( ++ attr: *const posix_spawnattr_t, ++ default: *mut crate::sigset_t, ++ ) -> c_int; ++ pub fn posix_spawnattr_setsigdefault( ++ attr: *mut posix_spawnattr_t, ++ default: *const crate::sigset_t, ++ ) -> c_int; ++ pub fn posix_spawnattr_getsigmask( ++ attr: *const posix_spawnattr_t, ++ default: *mut crate::sigset_t, ++ ) -> c_int; ++ pub fn posix_spawnattr_setsigmask( ++ attr: *mut posix_spawnattr_t, ++ default: *const crate::sigset_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, ++ flags: *mut crate::pid_t, ++ ) -> c_int; ++ pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: crate::pid_t) -> c_int; ++ pub fn posix_spawnattr_getschedpolicy( ++ attr: *const posix_spawnattr_t, ++ flags: *mut c_int, ++ ) -> c_int; ++ pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: c_int) -> c_int; ++ pub fn posix_spawnattr_getschedparam( ++ attr: *const posix_spawnattr_t, ++ param: *mut crate::sched_param, ++ ) -> c_int; ++ pub fn posix_spawnattr_setschedparam( ++ attr: *mut posix_spawnattr_t, ++ param: *const crate::sched_param, ++ ) -> c_int; ++ ++ pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> c_int; ++ pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> c_int; ++ pub fn posix_spawn_file_actions_addopen( ++ actions: *mut posix_spawn_file_actions_t, ++ fd: c_int, ++ path: *const c_char, ++ oflag: c_int, ++ mode: crate::mode_t, ++ ) -> c_int; ++ pub fn posix_spawn_file_actions_addclose( ++ actions: *mut posix_spawn_file_actions_t, ++ fd: c_int, ++ ) -> c_int; ++ pub fn posix_spawn_file_actions_adddup2( ++ actions: *mut posix_spawn_file_actions_t, ++ fd: c_int, ++ newfd: c_int, ++ ) -> c_int; ++ pub fn fread_unlocked( ++ buf: *mut c_void, ++ size: size_t, ++ nobj: size_t, ++ stream: *mut crate::FILE, ++ ) -> size_t; ++ pub fn inotify_rm_watch(fd: c_int, wd: c_int) -> c_int; ++ pub fn inotify_init() -> c_int; ++ pub fn inotify_init1(flags: c_int) -> c_int; ++ pub fn inotify_add_watch(fd: c_int, path: *const c_char, mask: u32) -> c_int; ++ pub fn fanotify_init(flags: c_uint, event_f_flags: c_uint) -> c_int; ++ ++ pub fn regcomp(preg: *mut crate::regex_t, pattern: *const c_char, cflags: c_int) -> c_int; ++ ++ pub fn regexec( ++ preg: *const crate::regex_t, ++ input: *const c_char, ++ nmatch: size_t, ++ pmatch: *mut regmatch_t, ++ eflags: c_int, ++ ) -> c_int; ++ ++ pub fn regerror( ++ errcode: c_int, ++ preg: *const crate::regex_t, ++ errbuf: *mut c_char, ++ errbuf_size: size_t, ++ ) -> size_t; ++ ++ pub fn regfree(preg: *mut crate::regex_t); ++ ++ pub fn iconv_open(tocode: *const c_char, fromcode: *const c_char) -> iconv_t; ++ pub fn iconv( ++ cd: iconv_t, ++ inbuf: *mut *mut c_char, ++ inbytesleft: *mut size_t, ++ outbuf: *mut *mut c_char, ++ outbytesleft: *mut size_t, ++ ) -> size_t; ++ pub fn iconv_close(cd: iconv_t) -> c_int; ++ ++ pub fn gettid() -> crate::pid_t; ++ ++ pub fn timer_create( ++ clockid: crate::clockid_t, ++ sevp: *mut crate::sigevent, ++ timerid: *mut crate::timer_t, ++ ) -> c_int; ++ pub fn timer_delete(timerid: crate::timer_t) -> c_int; ++ pub fn timer_getoverrun(timerid: crate::timer_t) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "__timer_gettime64")] ++ pub fn timer_gettime(timerid: crate::timer_t, curr_value: *mut crate::itimerspec) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "__timer_settime64")] ++ pub fn timer_settime( ++ timerid: crate::timer_t, ++ flags: c_int, ++ new_value: *const crate::itimerspec, ++ old_value: *mut crate::itimerspec, ++ ) -> c_int; ++ ++ pub fn gethostid() -> c_long; ++ ++ pub fn pthread_getcpuclockid(thread: crate::pthread_t, clk_id: *mut crate::clockid_t) -> c_int; ++ pub fn memmem( ++ haystack: *const c_void, ++ haystacklen: size_t, ++ needle: *const c_void, ++ needlelen: size_t, ++ ) -> *mut c_void; ++ pub fn sched_getcpu() -> c_int; ++ ++ pub fn pthread_getname_np(thread: crate::pthread_t, name: *mut c_char, len: size_t) -> c_int; ++ pub fn pthread_setname_np(thread: crate::pthread_t, name: *const c_char) -> c_int; ++ pub fn getopt_long( ++ argc: c_int, ++ argv: *const *mut c_char, ++ optstring: *const c_char, ++ longopts: *const option, ++ longindex: *mut c_int, ++ ) -> c_int; ++ ++ pub fn pthread_once(control: *mut pthread_once_t, routine: extern "C" fn()) -> c_int; ++ ++ pub fn copy_file_range( ++ fd_in: c_int, ++ off_in: *mut off64_t, ++ fd_out: c_int, ++ off_out: *mut off64_t, ++ len: size_t, ++ flags: c_uint, ++ ) -> ssize_t; ++ ++ pub fn klogctl(syslog_type: c_int, bufp: *mut c_char, len: c_int) -> c_int; ++ ++ #[cfg_attr(gnu_time64_abi, link_name = "__ioctl_time64")] ++ pub fn ioctl(fd: c_int, request: Ioctl, ...) -> c_int; ++} ++ ++// LFS64 extensions ++// ++// * musl has 64-bit versions only so aliases the LFS64 symbols to the standard ones ++cfg_if! { ++ if #[cfg(not(target_env = "musl"))] { ++ extern "C" { ++ pub fn fallocate64(fd: c_int, mode: c_int, offset: off64_t, len: off64_t) -> c_int; ++ pub fn fgetpos64(stream: *mut crate::FILE, ptr: *mut fpos64_t) -> c_int; ++ pub fn fopen64(filename: *const c_char, mode: *const c_char) -> *mut crate::FILE; ++ pub fn freopen64( ++ filename: *const c_char, ++ mode: *const c_char, ++ file: *mut crate::FILE, ++ ) -> *mut crate::FILE; ++ pub fn fseeko64(stream: *mut crate::FILE, offset: off64_t, whence: c_int) -> c_int; ++ pub fn fsetpos64(stream: *mut crate::FILE, ptr: *const fpos64_t) -> c_int; ++ pub fn ftello64(stream: *mut crate::FILE) -> off64_t; ++ pub fn posix_fallocate64(fd: c_int, offset: off64_t, len: off64_t) -> c_int; ++ pub fn sendfile64( ++ out_fd: c_int, ++ in_fd: c_int, ++ offset: *mut off64_t, ++ count: size_t, ++ ) -> ssize_t; ++ pub fn tmpfile64() -> *mut crate::FILE; ++ } ++ } ++} ++ ++cfg_if! { ++ if #[cfg(target_env = "uclibc")] { ++ mod uclibc; ++ pub use self::uclibc::*; ++ } else if #[cfg(any(target_env = "musl", target_env = "ohos"))] { ++ mod musl; ++ pub use self::musl::*; ++ } else if #[cfg(target_env = "gnu")] { ++ mod gnu; ++ pub use self::gnu::*; ++ } ++} ++ ++mod arch; ++pub use self::arch::*; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b32/arm/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b32/arm/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b32/arm/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b32/arm/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,802 @@ ++use crate::off_t; ++use crate::prelude::*; ++ ++pub type c_char = u8; ++pub type wchar_t = u32; ++ ++s! { ++ pub struct stat { ++ pub st_dev: crate::dev_t, ++ __st_dev_padding: c_int, ++ __st_ino_truncated: c_long, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ __st_rdev_padding: c_int, ++ pub st_size: off_t, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ pub st_ino: crate::ino_t, ++ } ++ ++ pub struct stat64 { ++ pub st_dev: crate::dev_t, ++ __st_dev_padding: c_int, ++ __st_ino_truncated: c_long, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ __st_rdev_padding: c_int, ++ pub st_size: off_t, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ pub st_ino: crate::ino_t, ++ } ++ ++ pub struct stack_t { ++ pub ss_sp: *mut c_void, ++ pub ss_flags: c_int, ++ pub ss_size: size_t, ++ } ++ ++ pub struct ipc_perm { ++ pub __ipc_perm_key: crate::key_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub cuid: crate::uid_t, ++ pub cgid: crate::gid_t, ++ pub mode: crate::mode_t, ++ pub __seq: c_int, ++ __unused1: c_long, ++ __unused2: c_long, ++ } ++ ++ pub struct shmid_ds { ++ pub shm_perm: crate::ipc_perm, ++ pub shm_segsz: size_t, ++ pub shm_atime: crate::time_t, ++ __unused1: c_int, ++ pub shm_dtime: crate::time_t, ++ __unused2: c_int, ++ pub shm_ctime: crate::time_t, ++ __unused3: c_int, ++ pub shm_cpid: crate::pid_t, ++ pub shm_lpid: crate::pid_t, ++ pub shm_nattch: c_ulong, ++ __pad1: c_ulong, ++ __pad2: c_ulong, ++ } ++ ++ pub struct msqid_ds { ++ pub msg_perm: crate::ipc_perm, ++ pub msg_stime: crate::time_t, ++ __unused1: c_int, ++ pub msg_rtime: crate::time_t, ++ __unused2: c_int, ++ pub msg_ctime: crate::time_t, ++ __unused3: c_int, ++ __msg_cbytes: c_ulong, ++ pub msg_qnum: crate::msgqnum_t, ++ pub msg_qbytes: crate::msglen_t, ++ pub msg_lspid: crate::pid_t, ++ pub msg_lrpid: crate::pid_t, ++ __pad1: c_ulong, ++ __pad2: c_ulong, ++ } ++ ++ pub struct mcontext_t { ++ pub trap_no: c_ulong, ++ pub error_code: c_ulong, ++ pub oldmask: c_ulong, ++ pub arm_r0: c_ulong, ++ pub arm_r1: c_ulong, ++ pub arm_r2: c_ulong, ++ pub arm_r3: c_ulong, ++ pub arm_r4: c_ulong, ++ pub arm_r5: c_ulong, ++ pub arm_r6: c_ulong, ++ pub arm_r7: c_ulong, ++ pub arm_r8: c_ulong, ++ pub arm_r9: c_ulong, ++ pub arm_r10: c_ulong, ++ pub arm_fp: c_ulong, ++ pub arm_ip: c_ulong, ++ pub arm_sp: c_ulong, ++ pub arm_lr: c_ulong, ++ pub arm_pc: c_ulong, ++ pub arm_cpsr: c_ulong, ++ pub fault_address: c_ulong, ++ } ++} ++ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ pub struct ucontext_t { ++ pub uc_flags: c_ulong, ++ pub uc_link: *mut ucontext_t, ++ pub uc_stack: crate::stack_t, ++ pub uc_mcontext: mcontext_t, ++ pub uc_sigmask: crate::sigset_t, ++ pub uc_regspace: [c_ulonglong; 64], ++ } ++ ++ #[allow(missing_debug_implementations)] ++ #[repr(align(8))] ++ pub struct max_align_t { ++ priv_: (i64, i64), ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for ucontext_t { ++ fn eq(&self, other: &ucontext_t) -> bool { ++ self.uc_flags == other.uc_flags ++ && self.uc_link == other.uc_link ++ && self.uc_stack == other.uc_stack ++ && self.uc_mcontext == other.uc_mcontext ++ && self.uc_sigmask == other.uc_sigmask ++ } ++ } ++ impl Eq for ucontext_t {} ++ impl fmt::Debug for ucontext_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("ucontext_t") ++ .field("uc_flags", &self.uc_link) ++ .field("uc_link", &self.uc_link) ++ .field("uc_stack", &self.uc_stack) ++ .field("uc_mcontext", &self.uc_mcontext) ++ .field("uc_sigmask", &self.uc_sigmask) ++ .finish() ++ } ++ } ++ impl hash::Hash for ucontext_t { ++ fn hash(&self, state: &mut H) { ++ self.uc_flags.hash(state); ++ self.uc_link.hash(state); ++ self.uc_stack.hash(state); ++ self.uc_mcontext.hash(state); ++ self.uc_sigmask.hash(state); ++ } ++ } ++ } ++} ++ ++pub const SIGSTKSZ: size_t = 8192; ++pub const MINSIGSTKSZ: size_t = 2048; ++ ++pub const O_DIRECT: c_int = 0x10000; ++pub const O_DIRECTORY: c_int = 0x4000; ++pub const O_NOFOLLOW: c_int = 0x8000; ++pub const O_ASYNC: c_int = 0x2000; ++pub const O_LARGEFILE: c_int = 0o400000; ++ ++pub const MADV_SOFT_OFFLINE: c_int = 101; ++pub const MCL_CURRENT: c_int = 0x0001; ++pub const MCL_FUTURE: c_int = 0x0002; ++pub const MCL_ONFAULT: c_int = 0x0004; ++pub const CBAUD: crate::tcflag_t = 0o0010017; ++pub const TAB1: c_int = 0x00000800; ++pub const TAB2: c_int = 0x00001000; ++pub const TAB3: c_int = 0x00001800; ++pub const CR1: c_int = 0x00000200; ++pub const CR2: c_int = 0x00000400; ++pub const CR3: c_int = 0x00000600; ++pub const FF1: c_int = 0x00008000; ++pub const BS1: c_int = 0x00002000; ++pub const VT1: c_int = 0x00004000; ++pub const VWERASE: usize = 14; ++pub const VREPRINT: usize = 12; ++pub const VSUSP: usize = 10; ++pub const VSTART: usize = 8; ++pub const VSTOP: usize = 9; ++pub const VDISCARD: usize = 13; ++pub const VTIME: usize = 5; ++pub const IXON: crate::tcflag_t = 0x00000400; ++pub const IXOFF: crate::tcflag_t = 0x00001000; ++pub const ONLCR: crate::tcflag_t = 0x4; ++pub const CSIZE: crate::tcflag_t = 0x00000030; ++pub const CS6: crate::tcflag_t = 0x00000010; ++pub const CS7: crate::tcflag_t = 0x00000020; ++pub const CS8: crate::tcflag_t = 0x00000030; ++pub const CSTOPB: crate::tcflag_t = 0x00000040; ++pub const CREAD: crate::tcflag_t = 0x00000080; ++pub const PARENB: crate::tcflag_t = 0x00000100; ++pub const PARODD: crate::tcflag_t = 0x00000200; ++pub const HUPCL: crate::tcflag_t = 0x00000400; ++pub const CLOCAL: crate::tcflag_t = 0x00000800; ++pub const ECHOKE: crate::tcflag_t = 0x00000800; ++pub const ECHOE: crate::tcflag_t = 0x00000010; ++pub const ECHOK: crate::tcflag_t = 0x00000020; ++pub const ECHONL: crate::tcflag_t = 0x00000040; ++pub const ECHOPRT: crate::tcflag_t = 0x00000400; ++pub const ECHOCTL: crate::tcflag_t = 0x00000200; ++pub const ISIG: crate::tcflag_t = 0x00000001; ++pub const ICANON: crate::tcflag_t = 0x00000002; ++pub const PENDIN: crate::tcflag_t = 0x00004000; ++pub const NOFLSH: crate::tcflag_t = 0x00000080; ++pub const CIBAUD: crate::tcflag_t = 0o02003600000; ++pub const CBAUDEX: crate::tcflag_t = 0o010000; ++pub const VSWTC: usize = 7; ++pub const OLCUC: crate::tcflag_t = 0o000002; ++pub const NLDLY: crate::tcflag_t = 0o000400; ++pub const CRDLY: crate::tcflag_t = 0o003000; ++pub const TABDLY: crate::tcflag_t = 0o014000; ++pub const BSDLY: crate::tcflag_t = 0o020000; ++pub const FFDLY: crate::tcflag_t = 0o100000; ++pub const VTDLY: crate::tcflag_t = 0o040000; ++pub const XTABS: crate::tcflag_t = 0o014000; ++pub const B57600: crate::speed_t = 0o010001; ++pub const B115200: crate::speed_t = 0o010002; ++pub const B230400: crate::speed_t = 0o010003; ++pub const B460800: crate::speed_t = 0o010004; ++pub const B500000: crate::speed_t = 0o010005; ++pub const B576000: crate::speed_t = 0o010006; ++pub const B921600: crate::speed_t = 0o010007; ++pub const B1000000: crate::speed_t = 0o010010; ++pub const B1152000: crate::speed_t = 0o010011; ++pub const B1500000: crate::speed_t = 0o010012; ++pub const B2000000: crate::speed_t = 0o010013; ++pub const B2500000: crate::speed_t = 0o010014; ++pub const B3000000: crate::speed_t = 0o010015; ++pub const B3500000: crate::speed_t = 0o010016; ++pub const B4000000: crate::speed_t = 0o010017; ++ ++pub const O_APPEND: c_int = 1024; ++pub const O_CREAT: c_int = 64; ++pub const O_EXCL: c_int = 128; ++pub const O_NOCTTY: c_int = 256; ++pub const O_NONBLOCK: c_int = 2048; ++pub const O_SYNC: c_int = 1052672; ++pub const O_RSYNC: c_int = 1052672; ++pub const O_DSYNC: c_int = 4096; ++ ++pub const MAP_ANON: c_int = 0x0020; ++pub const MAP_GROWSDOWN: c_int = 0x0100; ++pub const MAP_DENYWRITE: c_int = 0x0800; ++pub const MAP_EXECUTABLE: c_int = 0x01000; ++pub const MAP_LOCKED: c_int = 0x02000; ++pub const MAP_NORESERVE: c_int = 0x04000; ++pub const MAP_POPULATE: c_int = 0x08000; ++pub const MAP_NONBLOCK: c_int = 0x010000; ++pub const MAP_STACK: c_int = 0x020000; ++pub const MAP_SYNC: c_int = 0x080000; ++ ++pub const SOCK_STREAM: c_int = 1; ++pub const SOCK_DGRAM: c_int = 2; ++ ++pub const EDEADLK: c_int = 35; ++pub const ENAMETOOLONG: c_int = 36; ++pub const ENOLCK: c_int = 37; ++pub const ENOSYS: c_int = 38; ++pub const ENOTEMPTY: c_int = 39; ++pub const ELOOP: c_int = 40; ++pub const ENOMSG: c_int = 42; ++pub const EIDRM: c_int = 43; ++pub const ECHRNG: c_int = 44; ++pub const EL2NSYNC: c_int = 45; ++pub const EL3HLT: c_int = 46; ++pub const EL3RST: c_int = 47; ++pub const ELNRNG: c_int = 48; ++pub const EUNATCH: c_int = 49; ++pub const ENOCSI: c_int = 50; ++pub const EL2HLT: c_int = 51; ++pub const EBADE: c_int = 52; ++pub const EBADR: c_int = 53; ++pub const EXFULL: c_int = 54; ++pub const ENOANO: c_int = 55; ++pub const EBADRQC: c_int = 56; ++pub const EBADSLT: c_int = 57; ++pub const EDEADLOCK: c_int = EDEADLK; ++pub const EMULTIHOP: c_int = 72; ++pub const EBADMSG: c_int = 74; ++pub const EOVERFLOW: c_int = 75; ++pub const ENOTUNIQ: c_int = 76; ++pub const EBADFD: c_int = 77; ++pub const EREMCHG: c_int = 78; ++pub const ELIBACC: c_int = 79; ++pub const ELIBBAD: c_int = 80; ++pub const ELIBSCN: c_int = 81; ++pub const ELIBMAX: c_int = 82; ++pub const ELIBEXEC: c_int = 83; ++pub const EILSEQ: c_int = 84; ++pub const ERESTART: c_int = 85; ++pub const ESTRPIPE: c_int = 86; ++pub const EUSERS: c_int = 87; ++pub const ENOTSOCK: c_int = 88; ++pub const EDESTADDRREQ: c_int = 89; ++pub const EMSGSIZE: c_int = 90; ++pub const EPROTOTYPE: c_int = 91; ++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 EADDRINUSE: c_int = 98; ++pub const EADDRNOTAVAIL: c_int = 99; ++pub const ENETDOWN: c_int = 100; ++pub const ENETUNREACH: c_int = 101; ++pub const ENETRESET: c_int = 102; ++pub const ECONNABORTED: c_int = 103; ++pub const ECONNRESET: c_int = 104; ++pub const ENOBUFS: c_int = 105; ++pub const EISCONN: c_int = 106; ++pub const ENOTCONN: c_int = 107; ++pub const ESHUTDOWN: c_int = 108; ++pub const ETOOMANYREFS: c_int = 109; ++pub const ETIMEDOUT: c_int = 110; ++pub const ECONNREFUSED: c_int = 111; ++pub const EHOSTDOWN: c_int = 112; ++pub const EHOSTUNREACH: c_int = 113; ++pub const EALREADY: c_int = 114; ++pub const EINPROGRESS: c_int = 115; ++pub const ESTALE: c_int = 116; ++pub const EUCLEAN: c_int = 117; ++pub const ENOTNAM: c_int = 118; ++pub const ENAVAIL: c_int = 119; ++pub const EISNAM: c_int = 120; ++pub const EREMOTEIO: c_int = 121; ++pub const EDQUOT: c_int = 122; ++pub const ENOMEDIUM: c_int = 123; ++pub const EMEDIUMTYPE: c_int = 124; ++pub const ECANCELED: c_int = 125; ++pub const ENOKEY: c_int = 126; ++pub const EKEYEXPIRED: c_int = 127; ++pub const EKEYREVOKED: c_int = 128; ++pub const EKEYREJECTED: c_int = 129; ++pub const EOWNERDEAD: c_int = 130; ++pub const ENOTRECOVERABLE: c_int = 131; ++pub const ERFKILL: c_int = 132; ++pub const EHWPOISON: c_int = 133; ++ ++pub const SA_ONSTACK: c_int = 0x08000000; ++pub const SA_SIGINFO: c_int = 0x00000004; ++pub const SA_NOCLDWAIT: c_int = 0x00000002; ++ ++pub const SIGCHLD: c_int = 17; ++pub const SIGBUS: c_int = 7; ++pub const SIGTTIN: c_int = 21; ++pub const SIGTTOU: c_int = 22; ++pub const SIGXCPU: c_int = 24; ++pub const SIGXFSZ: c_int = 25; ++pub const SIGVTALRM: c_int = 26; ++pub const SIGPROF: c_int = 27; ++pub const SIGWINCH: c_int = 28; ++pub const SIGUSR1: c_int = 10; ++pub const SIGUSR2: c_int = 12; ++pub const SIGCONT: c_int = 18; ++pub const SIGSTOP: c_int = 19; ++pub const SIGTSTP: c_int = 20; ++pub const SIGURG: c_int = 23; ++pub const SIGIO: c_int = 29; ++pub const SIGSYS: c_int = 31; ++pub const SIGSTKFLT: c_int = 16; ++pub const SIGPOLL: c_int = 29; ++pub const SIGPWR: c_int = 30; ++pub const SIG_SETMASK: c_int = 2; ++pub const SIG_BLOCK: c_int = 0x000000; ++pub const SIG_UNBLOCK: c_int = 0x01; ++ ++pub const EXTPROC: crate::tcflag_t = 0x00010000; ++ ++pub const MAP_HUGETLB: c_int = 0x040000; ++ ++pub const F_GETLK: c_int = 12; ++pub const F_GETOWN: c_int = 9; ++pub const F_SETLK: c_int = 13; ++pub const F_SETLKW: c_int = 14; ++pub const F_SETOWN: c_int = 8; ++ ++pub const VEOF: usize = 4; ++pub const VEOL: usize = 11; ++pub const VEOL2: usize = 16; ++pub const VMIN: usize = 6; ++pub const IEXTEN: crate::tcflag_t = 0x00008000; ++pub const TOSTOP: crate::tcflag_t = 0x00000100; ++pub const FLUSHO: crate::tcflag_t = 0x00001000; ++ ++pub const POLLWRNORM: c_short = 0x100; ++pub const POLLWRBAND: c_short = 0x200; ++ ++// Syscall table ++pub const SYS_restart_syscall: c_long = 0; ++pub const SYS_exit: c_long = 1; ++pub const SYS_fork: c_long = 2; ++pub const SYS_read: c_long = 3; ++pub const SYS_write: c_long = 4; ++pub const SYS_open: c_long = 5; ++pub const SYS_close: c_long = 6; ++pub const SYS_creat: c_long = 8; ++pub const SYS_link: c_long = 9; ++pub const SYS_unlink: c_long = 10; ++pub const SYS_execve: c_long = 11; ++pub const SYS_chdir: c_long = 12; ++pub const SYS_mknod: c_long = 14; ++pub const SYS_chmod: c_long = 15; ++pub const SYS_lchown: c_long = 16; ++pub const SYS_lseek: c_long = 19; ++pub const SYS_getpid: c_long = 20; ++pub const SYS_mount: c_long = 21; ++pub const SYS_setuid: c_long = 23; ++pub const SYS_getuid: c_long = 24; ++pub const SYS_ptrace: c_long = 26; ++pub const SYS_pause: c_long = 29; ++pub const SYS_access: c_long = 33; ++pub const SYS_nice: c_long = 34; ++pub const SYS_sync: c_long = 36; ++pub const SYS_kill: c_long = 37; ++pub const SYS_rename: c_long = 38; ++pub const SYS_mkdir: c_long = 39; ++pub const SYS_rmdir: c_long = 40; ++pub const SYS_dup: c_long = 41; ++pub const SYS_pipe: c_long = 42; ++pub const SYS_times: c_long = 43; ++pub const SYS_brk: c_long = 45; ++pub const SYS_setgid: c_long = 46; ++pub const SYS_getgid: c_long = 47; ++pub const SYS_geteuid: c_long = 49; ++pub const SYS_getegid: c_long = 50; ++pub const SYS_acct: c_long = 51; ++pub const SYS_umount2: c_long = 52; ++pub const SYS_ioctl: c_long = 54; ++pub const SYS_fcntl: c_long = 55; ++pub const SYS_setpgid: c_long = 57; ++pub const SYS_umask: c_long = 60; ++pub const SYS_chroot: c_long = 61; ++pub const SYS_ustat: c_long = 62; ++pub const SYS_dup2: c_long = 63; ++pub const SYS_getppid: c_long = 64; ++pub const SYS_getpgrp: c_long = 65; ++pub const SYS_setsid: c_long = 66; ++pub const SYS_sigaction: c_long = 67; ++pub const SYS_setreuid: c_long = 70; ++pub const SYS_setregid: c_long = 71; ++pub const SYS_sigsuspend: c_long = 72; ++pub const SYS_sigpending: c_long = 73; ++pub const SYS_sethostname: c_long = 74; ++pub const SYS_setrlimit: c_long = 75; ++pub const SYS_getrusage: c_long = 77; ++pub const SYS_gettimeofday: c_long = 78; ++pub const SYS_settimeofday: c_long = 79; ++pub const SYS_getgroups: c_long = 80; ++pub const SYS_setgroups: c_long = 81; ++pub const SYS_symlink: c_long = 83; ++pub const SYS_readlink: c_long = 85; ++pub const SYS_uselib: c_long = 86; ++pub const SYS_swapon: c_long = 87; ++pub const SYS_reboot: c_long = 88; ++pub const SYS_munmap: c_long = 91; ++pub const SYS_truncate: c_long = 92; ++pub const SYS_ftruncate: c_long = 93; ++pub const SYS_fchmod: c_long = 94; ++pub const SYS_fchown: c_long = 95; ++pub const SYS_getpriority: c_long = 96; ++pub const SYS_setpriority: c_long = 97; ++pub const SYS_statfs: c_long = 99; ++pub const SYS_fstatfs: c_long = 100; ++pub const SYS_syslog: c_long = 103; ++pub const SYS_setitimer: c_long = 104; ++pub const SYS_getitimer: c_long = 105; ++pub const SYS_stat: c_long = 106; ++pub const SYS_lstat: c_long = 107; ++pub const SYS_fstat: c_long = 108; ++pub const SYS_vhangup: c_long = 111; ++pub const SYS_wait4: c_long = 114; ++pub const SYS_swapoff: c_long = 115; ++pub const SYS_sysinfo: c_long = 116; ++pub const SYS_fsync: c_long = 118; ++pub const SYS_sigreturn: c_long = 119; ++pub const SYS_clone: c_long = 120; ++pub const SYS_setdomainname: c_long = 121; ++pub const SYS_uname: c_long = 122; ++pub const SYS_adjtimex: c_long = 124; ++pub const SYS_mprotect: c_long = 125; ++pub const SYS_sigprocmask: c_long = 126; ++pub const SYS_init_module: c_long = 128; ++pub const SYS_delete_module: c_long = 129; ++pub const SYS_quotactl: c_long = 131; ++pub const SYS_getpgid: c_long = 132; ++pub const SYS_fchdir: c_long = 133; ++pub const SYS_bdflush: c_long = 134; ++pub const SYS_sysfs: c_long = 135; ++pub const SYS_personality: c_long = 136; ++pub const SYS_setfsuid: c_long = 138; ++pub const SYS_setfsgid: c_long = 139; ++pub const SYS__llseek: c_long = 140; ++pub const SYS_getdents: c_long = 141; ++pub const SYS__newselect: c_long = 142; ++pub const SYS_flock: c_long = 143; ++pub const SYS_msync: c_long = 144; ++pub const SYS_readv: c_long = 145; ++pub const SYS_writev: c_long = 146; ++pub const SYS_getsid: c_long = 147; ++pub const SYS_fdatasync: c_long = 148; ++pub const SYS__sysctl: c_long = 149; ++pub const SYS_mlock: c_long = 150; ++pub const SYS_munlock: c_long = 151; ++pub const SYS_mlockall: c_long = 152; ++pub const SYS_munlockall: c_long = 153; ++pub const SYS_sched_setparam: c_long = 154; ++pub const SYS_sched_getparam: c_long = 155; ++pub const SYS_sched_setscheduler: c_long = 156; ++pub const SYS_sched_getscheduler: c_long = 157; ++pub const SYS_sched_yield: c_long = 158; ++pub const SYS_sched_get_priority_max: c_long = 159; ++pub const SYS_sched_get_priority_min: c_long = 160; ++pub const SYS_sched_rr_get_interval: c_long = 161; ++pub const SYS_nanosleep: c_long = 162; ++pub const SYS_mremap: c_long = 163; ++pub const SYS_setresuid: c_long = 164; ++pub const SYS_getresuid: c_long = 165; ++pub const SYS_poll: c_long = 168; ++pub const SYS_nfsservctl: c_long = 169; ++pub const SYS_setresgid: c_long = 170; ++pub const SYS_getresgid: c_long = 171; ++pub const SYS_prctl: c_long = 172; ++pub const SYS_rt_sigreturn: c_long = 173; ++pub const SYS_rt_sigaction: c_long = 174; ++pub const SYS_rt_sigprocmask: c_long = 175; ++pub const SYS_rt_sigpending: c_long = 176; ++pub const SYS_rt_sigtimedwait: c_long = 177; ++pub const SYS_rt_sigqueueinfo: c_long = 178; ++pub const SYS_rt_sigsuspend: c_long = 179; ++pub const SYS_pread64: c_long = 180; ++pub const SYS_pwrite64: c_long = 181; ++pub const SYS_chown: c_long = 182; ++pub const SYS_getcwd: c_long = 183; ++pub const SYS_capget: c_long = 184; ++pub const SYS_capset: c_long = 185; ++pub const SYS_sigaltstack: c_long = 186; ++pub const SYS_sendfile: c_long = 187; ++pub const SYS_vfork: c_long = 190; ++pub const SYS_ugetrlimit: c_long = 191; ++pub const SYS_mmap2: c_long = 192; ++pub const SYS_truncate64: c_long = 193; ++pub const SYS_ftruncate64: c_long = 194; ++pub const SYS_stat64: c_long = 195; ++pub const SYS_lstat64: c_long = 196; ++pub const SYS_fstat64: c_long = 197; ++pub const SYS_lchown32: c_long = 198; ++pub const SYS_getuid32: c_long = 199; ++pub const SYS_getgid32: c_long = 200; ++pub const SYS_geteuid32: c_long = 201; ++pub const SYS_getegid32: c_long = 202; ++pub const SYS_setreuid32: c_long = 203; ++pub const SYS_setregid32: c_long = 204; ++pub const SYS_getgroups32: c_long = 205; ++pub const SYS_setgroups32: c_long = 206; ++pub const SYS_fchown32: c_long = 207; ++pub const SYS_setresuid32: c_long = 208; ++pub const SYS_getresuid32: c_long = 209; ++pub const SYS_setresgid32: c_long = 210; ++pub const SYS_getresgid32: c_long = 211; ++pub const SYS_chown32: c_long = 212; ++pub const SYS_setuid32: c_long = 213; ++pub const SYS_setgid32: c_long = 214; ++pub const SYS_setfsuid32: c_long = 215; ++pub const SYS_setfsgid32: c_long = 216; ++pub const SYS_getdents64: c_long = 217; ++pub const SYS_pivot_root: c_long = 218; ++pub const SYS_mincore: c_long = 219; ++pub const SYS_madvise: c_long = 220; ++pub const SYS_fcntl64: c_long = 221; ++pub const SYS_gettid: c_long = 224; ++pub const SYS_readahead: c_long = 225; ++pub const SYS_setxattr: c_long = 226; ++pub const SYS_lsetxattr: c_long = 227; ++pub const SYS_fsetxattr: c_long = 228; ++pub const SYS_getxattr: c_long = 229; ++pub const SYS_lgetxattr: c_long = 230; ++pub const SYS_fgetxattr: c_long = 231; ++pub const SYS_listxattr: c_long = 232; ++pub const SYS_llistxattr: c_long = 233; ++pub const SYS_flistxattr: c_long = 234; ++pub const SYS_removexattr: c_long = 235; ++pub const SYS_lremovexattr: c_long = 236; ++pub const SYS_fremovexattr: c_long = 237; ++pub const SYS_tkill: c_long = 238; ++pub const SYS_sendfile64: c_long = 239; ++pub const SYS_futex: c_long = 240; ++pub const SYS_sched_setaffinity: c_long = 241; ++pub const SYS_sched_getaffinity: c_long = 242; ++pub const SYS_io_setup: c_long = 243; ++pub const SYS_io_destroy: c_long = 244; ++pub const SYS_io_getevents: c_long = 245; ++pub const SYS_io_submit: c_long = 246; ++pub const SYS_io_cancel: c_long = 247; ++pub const SYS_exit_group: c_long = 248; ++pub const SYS_lookup_dcookie: c_long = 249; ++pub const SYS_epoll_create: c_long = 250; ++pub const SYS_epoll_ctl: c_long = 251; ++pub const SYS_epoll_wait: c_long = 252; ++pub const SYS_remap_file_pages: c_long = 253; ++pub const SYS_set_tid_address: c_long = 256; ++pub const SYS_timer_create: c_long = 257; ++pub const SYS_timer_settime: c_long = 258; ++pub const SYS_timer_gettime: c_long = 259; ++pub const SYS_timer_getoverrun: c_long = 260; ++pub const SYS_timer_delete: c_long = 261; ++pub const SYS_clock_settime: c_long = 262; ++pub const SYS_clock_gettime: c_long = 263; ++pub const SYS_clock_getres: c_long = 264; ++pub const SYS_clock_nanosleep: c_long = 265; ++pub const SYS_statfs64: c_long = 266; ++pub const SYS_fstatfs64: c_long = 267; ++pub const SYS_tgkill: c_long = 268; ++pub const SYS_utimes: c_long = 269; ++pub const SYS_pciconfig_iobase: c_long = 271; ++pub const SYS_pciconfig_read: c_long = 272; ++pub const SYS_pciconfig_write: c_long = 273; ++pub const SYS_mq_open: c_long = 274; ++pub const SYS_mq_unlink: c_long = 275; ++pub const SYS_mq_timedsend: c_long = 276; ++pub const SYS_mq_timedreceive: c_long = 277; ++pub const SYS_mq_notify: c_long = 278; ++pub const SYS_mq_getsetattr: c_long = 279; ++pub const SYS_waitid: c_long = 280; ++pub const SYS_socket: c_long = 281; ++pub const SYS_bind: c_long = 282; ++pub const SYS_connect: c_long = 283; ++pub const SYS_listen: c_long = 284; ++pub const SYS_accept: c_long = 285; ++pub const SYS_getsockname: c_long = 286; ++pub const SYS_getpeername: c_long = 287; ++pub const SYS_socketpair: c_long = 288; ++pub const SYS_send: c_long = 289; ++pub const SYS_sendto: c_long = 290; ++pub const SYS_recv: c_long = 291; ++pub const SYS_recvfrom: c_long = 292; ++pub const SYS_shutdown: c_long = 293; ++pub const SYS_setsockopt: c_long = 294; ++pub const SYS_getsockopt: c_long = 295; ++pub const SYS_sendmsg: c_long = 296; ++pub const SYS_recvmsg: c_long = 297; ++pub const SYS_semop: c_long = 298; ++pub const SYS_semget: c_long = 299; ++pub const SYS_semctl: c_long = 300; ++pub const SYS_msgsnd: c_long = 301; ++pub const SYS_msgrcv: c_long = 302; ++pub const SYS_msgget: c_long = 303; ++pub const SYS_msgctl: c_long = 304; ++pub const SYS_shmat: c_long = 305; ++pub const SYS_shmdt: c_long = 306; ++pub const SYS_shmget: c_long = 307; ++pub const SYS_shmctl: c_long = 308; ++pub const SYS_add_key: c_long = 309; ++pub const SYS_request_key: c_long = 310; ++pub const SYS_keyctl: c_long = 311; ++pub const SYS_semtimedop: c_long = 312; ++pub const SYS_vserver: c_long = 313; ++pub const SYS_ioprio_set: c_long = 314; ++pub const SYS_ioprio_get: c_long = 315; ++pub const SYS_inotify_init: c_long = 316; ++pub const SYS_inotify_add_watch: c_long = 317; ++pub const SYS_inotify_rm_watch: c_long = 318; ++pub const SYS_mbind: c_long = 319; ++pub const SYS_get_mempolicy: c_long = 320; ++pub const SYS_set_mempolicy: c_long = 321; ++pub const SYS_openat: c_long = 322; ++pub const SYS_mkdirat: c_long = 323; ++pub const SYS_mknodat: c_long = 324; ++pub const SYS_fchownat: c_long = 325; ++pub const SYS_futimesat: c_long = 326; ++pub const SYS_fstatat64: c_long = 327; ++pub const SYS_unlinkat: c_long = 328; ++pub const SYS_renameat: c_long = 329; ++pub const SYS_linkat: c_long = 330; ++pub const SYS_symlinkat: c_long = 331; ++pub const SYS_readlinkat: c_long = 332; ++pub const SYS_fchmodat: c_long = 333; ++pub const SYS_faccessat: c_long = 334; ++pub const SYS_pselect6: c_long = 335; ++pub const SYS_ppoll: c_long = 336; ++pub const SYS_unshare: c_long = 337; ++pub const SYS_set_robust_list: c_long = 338; ++pub const SYS_get_robust_list: c_long = 339; ++pub const SYS_splice: c_long = 340; ++pub const SYS_tee: c_long = 342; ++pub const SYS_vmsplice: c_long = 343; ++pub const SYS_move_pages: c_long = 344; ++pub const SYS_getcpu: c_long = 345; ++pub const SYS_epoll_pwait: c_long = 346; ++pub const SYS_kexec_load: c_long = 347; ++pub const SYS_utimensat: c_long = 348; ++pub const SYS_signalfd: c_long = 349; ++pub const SYS_timerfd_create: c_long = 350; ++pub const SYS_eventfd: c_long = 351; ++pub const SYS_fallocate: c_long = 352; ++pub const SYS_timerfd_settime: c_long = 353; ++pub const SYS_timerfd_gettime: c_long = 354; ++pub const SYS_signalfd4: c_long = 355; ++pub const SYS_eventfd2: c_long = 356; ++pub const SYS_epoll_create1: c_long = 357; ++pub const SYS_dup3: c_long = 358; ++pub const SYS_pipe2: c_long = 359; ++pub const SYS_inotify_init1: c_long = 360; ++pub const SYS_preadv: c_long = 361; ++pub const SYS_pwritev: c_long = 362; ++pub const SYS_rt_tgsigqueueinfo: c_long = 363; ++pub const SYS_perf_event_open: c_long = 364; ++pub const SYS_recvmmsg: c_long = 365; ++pub const SYS_accept4: c_long = 366; ++pub const SYS_fanotify_init: c_long = 367; ++pub const SYS_fanotify_mark: c_long = 368; ++pub const SYS_prlimit64: c_long = 369; ++pub const SYS_name_to_handle_at: c_long = 370; ++pub const SYS_open_by_handle_at: c_long = 371; ++pub const SYS_clock_adjtime: c_long = 372; ++pub const SYS_syncfs: c_long = 373; ++pub const SYS_sendmmsg: c_long = 374; ++pub const SYS_setns: c_long = 375; ++pub const SYS_process_vm_readv: c_long = 376; ++pub const SYS_process_vm_writev: c_long = 377; ++pub const SYS_kcmp: c_long = 378; ++pub const SYS_finit_module: c_long = 379; ++pub const SYS_sched_setattr: c_long = 380; ++pub const SYS_sched_getattr: c_long = 381; ++pub const SYS_renameat2: c_long = 382; ++pub const SYS_seccomp: c_long = 383; ++pub const SYS_getrandom: c_long = 384; ++pub const SYS_memfd_create: c_long = 385; ++pub const SYS_bpf: c_long = 386; ++pub const SYS_execveat: c_long = 387; ++pub const SYS_userfaultfd: c_long = 388; ++pub const SYS_membarrier: c_long = 389; ++pub const SYS_mlock2: c_long = 390; ++pub const SYS_copy_file_range: c_long = 391; ++pub const SYS_preadv2: c_long = 392; ++pub const SYS_pwritev2: c_long = 393; ++pub const SYS_pkey_mprotect: c_long = 394; ++pub const SYS_pkey_alloc: c_long = 395; ++pub const SYS_pkey_free: c_long = 396; ++pub const SYS_statx: c_long = 397; ++pub const SYS_pidfd_send_signal: c_long = 424; ++pub const SYS_io_uring_setup: c_long = 425; ++pub const SYS_io_uring_enter: c_long = 426; ++pub const SYS_io_uring_register: c_long = 427; ++pub const SYS_open_tree: c_long = 428; ++pub const SYS_move_mount: c_long = 429; ++pub const SYS_fsopen: c_long = 430; ++pub const SYS_fsconfig: c_long = 431; ++pub const SYS_fsmount: c_long = 432; ++pub const SYS_fspick: c_long = 433; ++pub const SYS_pidfd_open: c_long = 434; ++pub const SYS_clone3: c_long = 435; ++pub const SYS_close_range: c_long = 436; ++pub const SYS_openat2: c_long = 437; ++pub const SYS_pidfd_getfd: c_long = 438; ++pub const SYS_faccessat2: c_long = 439; ++pub const SYS_process_madvise: c_long = 440; ++pub const SYS_epoll_pwait2: c_long = 441; ++pub const SYS_mount_setattr: c_long = 442; ++pub const SYS_quotactl_fd: c_long = 443; ++pub const SYS_landlock_create_ruleset: c_long = 444; ++pub const SYS_landlock_add_rule: c_long = 445; ++pub const SYS_landlock_restrict_self: c_long = 446; ++pub const SYS_memfd_secret: c_long = 447; ++pub const SYS_process_mrelease: c_long = 448; ++pub const SYS_futex_waitv: c_long = 449; ++pub const SYS_set_mempolicy_home_node: c_long = 450; ++pub const SYS_mseal: c_long = 462; ++ ++extern "C" { ++ pub fn getrandom(buf: *mut c_void, buflen: size_t, flags: c_uint) -> ssize_t; ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b32/hexagon.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b32/hexagon.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b32/hexagon.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b32/hexagon.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,614 @@ ++use crate::prelude::*; ++ ++pub type c_char = u8; ++pub type wchar_t = u32; ++pub type stat64 = crate::stat; ++ ++s! { ++ pub struct stat { ++ pub st_dev: crate::dev_t, ++ pub st_ino: c_ulonglong, ++ pub st_mode: c_uint, ++ pub st_nlink: c_uint, ++ pub st_uid: c_uint, ++ pub st_gid: c_uint, ++ pub st_rdev: c_ulonglong, ++ __st_rdev_padding: c_ulong, ++ pub st_size: c_longlong, ++ pub st_blksize: crate::blksize_t, ++ __st_blksize_padding: c_int, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ ++ __unused: [c_int; 2], ++ } ++ ++ pub struct stack_t { ++ pub ss_sp: *mut c_void, ++ pub ss_flags: c_int, ++ pub ss_size: size_t, ++ } ++ ++ pub struct ipc_perm { ++ pub __ipc_perm_key: crate::key_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub cuid: crate::uid_t, ++ pub cgid: crate::gid_t, ++ pub mode: crate::mode_t, ++ pub __seq: c_ushort, ++ } ++ ++ pub struct shmid_ds { ++ pub shm_perm: crate::ipc_perm, ++ pub shm_segsz: size_t, ++ pub shm_atime: crate::time_t, ++ __unused1: c_int, ++ pub shm_dtime: crate::time_t, ++ __unused2: c_int, ++ pub shm_ctime: crate::time_t, ++ __unused3: c_int, ++ pub shm_cpid: crate::pid_t, ++ pub shm_lpid: crate::pid_t, ++ pub shm_nattch: c_ulong, ++ __pad1: c_ulong, ++ __pad2: c_ulong, ++ } ++ ++ pub struct msqid_ds { ++ pub msg_perm: crate::ipc_perm, ++ pub msg_stime: crate::time_t, ++ __unused1: c_int, ++ pub msg_rtime: crate::time_t, ++ __unused2: c_int, ++ pub msg_ctime: crate::time_t, ++ __unused3: c_int, ++ __msg_cbytes: c_ulong, ++ pub msg_qnum: crate::msgqnum_t, ++ pub msg_qbytes: crate::msglen_t, ++ pub msg_lspid: crate::pid_t, ++ pub msg_lrpid: crate::pid_t, ++ __pad1: c_ulong, ++ __pad2: c_ulong, ++ } ++} ++ ++pub const AF_FILE: c_int = 1; ++pub const AF_KCM: c_int = 41; ++pub const AF_MAX: c_int = 43; ++pub const AF_QIPCRTR: c_int = 42; ++pub const EADDRINUSE: c_int = 98; ++pub const EADDRNOTAVAIL: c_int = 99; ++pub const EAFNOSUPPORT: c_int = 97; ++pub const EALREADY: c_int = 114; ++pub const EBADE: c_int = 52; ++pub const EBADMSG: c_int = 74; ++pub const EBADR: c_int = 53; ++pub const EBADRQC: c_int = 56; ++pub const EBADSLT: c_int = 57; ++pub const ECANCELED: c_int = 125; ++pub const ECHRNG: c_int = 44; ++pub const ECONNABORTED: c_int = 103; ++pub const ECONNREFUSED: c_int = 111; ++pub const ECONNRESET: c_int = 104; ++pub const EDEADLK: c_int = 35; ++pub const EDEADLOCK: c_int = 35; ++pub const EDESTADDRREQ: c_int = 89; ++pub const EDQUOT: c_int = 122; ++pub const EHOSTDOWN: c_int = 112; ++pub const EHOSTUNREACH: c_int = 113; ++pub const EHWPOISON: c_int = 133; ++pub const EIDRM: c_int = 43; ++pub const EILSEQ: c_int = 84; ++pub const EINPROGRESS: c_int = 115; ++pub const EISCONN: c_int = 106; ++pub const EISNAM: c_int = 120; ++pub const EKEYEXPIRED: c_int = 127; ++pub const EKEYREJECTED: c_int = 129; ++pub const EKEYREVOKED: c_int = 128; ++pub const EL2HLT: c_int = 51; ++pub const EL2NSYNC: c_int = 45; ++pub const EL3HLT: c_int = 46; ++pub const EL3RST: c_int = 47; ++pub const ELIBACC: c_int = 79; ++pub const ELIBBAD: c_int = 80; ++pub const ELIBEXEC: c_int = 83; ++pub const ELIBMAX: c_int = 82; ++pub const ELIBSCN: c_int = 81; ++pub const ELNRNG: c_int = 48; ++pub const ELOOP: c_int = 40; ++pub const EMEDIUMTYPE: c_int = 124; ++pub const EMSGSIZE: c_int = 90; ++pub const EMULTIHOP: c_int = 72; ++pub const ENAMETOOLONG: c_int = 36; ++pub const ENAVAIL: c_int = 119; ++pub const ENETDOWN: c_int = 100; ++pub const ENETRESET: c_int = 102; ++pub const ENETUNREACH: c_int = 101; ++pub const ENOANO: c_int = 55; ++pub const ENOBUFS: c_int = 105; ++pub const ENOCSI: c_int = 50; ++pub const ENOKEY: c_int = 126; ++pub const ENOLCK: c_int = 37; ++pub const ENOMEDIUM: c_int = 123; ++pub const ENOMSG: c_int = 42; ++pub const ENOPROTOOPT: c_int = 92; ++pub const ENOSYS: c_int = 38; ++pub const ENOTCONN: c_int = 107; ++pub const ENOTEMPTY: c_int = 39; ++pub const ENOTNAM: c_int = 118; ++pub const ENOTRECOVERABLE: c_int = 131; ++pub const ENOTSOCK: c_int = 88; ++pub const ENOTSUP: c_int = 95; ++pub const ENOTUNIQ: c_int = 76; ++pub const EOPNOTSUPP: c_int = 95; ++pub const EOVERFLOW: c_int = 75; ++pub const EOWNERDEAD: c_int = 130; ++pub const EPFNOSUPPORT: c_int = 96; ++pub const EREMCHG: c_int = 78; ++pub const ERESTART: c_int = 85; ++pub const ERFKILL: c_int = 132; ++pub const ESHUTDOWN: c_int = 108; ++pub const ESOCKTNOSUPPORT: c_int = 94; ++pub const ESTALE: c_int = 116; ++pub const ESTRPIPE: c_int = 86; ++pub const ETOOMANYREFS: c_int = 109; ++pub const ETIMEDOUT: c_int = 110; ++pub const EUCLEAN: c_int = 117; ++pub const EUNATCH: c_int = 49; ++pub const EUSERS: c_int = 87; ++pub const EXFULL: c_int = 54; ++pub const EXTPROC: c_int = 65536; ++pub const F_EXLCK: c_int = 4; ++pub const F_GETLK: c_int = 12; ++pub const F_GETOWN: c_int = 9; ++pub const F_GETOWNER_UIDS: c_int = 17; ++pub const F_GETOWN_EX: c_int = 16; ++pub const F_GETSIG: c_int = 11; ++pub const F_LINUX_SPECIFIC_BASE: c_int = 1024; ++pub const FLUSHO: c_int = 4096; ++pub const F_OWNER_PGRP: c_int = 2; ++pub const F_OWNER_PID: c_int = 1; ++pub const F_OWNER_TID: c_int = 0; ++pub const F_SETLK: c_int = 13; ++pub const F_SETLKW: c_int = 14; ++pub const F_SETOWN: c_int = 8; ++pub const F_SETOWN_EX: c_int = 15; ++pub const F_SETSIG: c_int = 10; ++pub const F_SHLCK: c_int = 8; ++pub const IEXTEN: c_int = 32768; ++pub const MAP_ANON: c_int = 32; ++pub const MAP_DENYWRITE: c_int = 2048; ++pub const MAP_EXECUTABLE: c_int = 4096; ++pub const MAP_GROWSDOWN: c_int = 256; ++pub const MAP_HUGETLB: c_int = 262144; ++pub const MAP_LOCKED: c_int = 8192; ++pub const MAP_NONBLOCK: c_int = 65536; ++pub const MAP_NORESERVE: c_int = 16384; ++pub const MAP_POPULATE: c_int = 32768; ++pub const MAP_STACK: c_int = 131072; ++pub const MAP_UNINITIALIZED: c_int = 0; ++pub const O_APPEND: c_int = 1024; ++pub const O_ASYNC: c_int = 8192; ++pub const O_CREAT: c_int = 64; ++pub const O_DIRECT: c_int = 16384; ++pub const O_DIRECTORY: c_int = 65536; ++pub const O_DSYNC: c_int = 4096; ++pub const O_EXCL: c_int = 128; ++pub const O_LARGEFILE: c_int = 32768; ++pub const O_NOCTTY: c_int = 256; ++pub const O_NOFOLLOW: c_int = 131072; ++pub const O_NONBLOCK: c_int = 2048; ++pub const O_SYNC: c_int = 1052672; ++pub const PF_FILE: c_int = 1; ++pub const PF_KCM: c_int = 41; ++pub const PF_MAX: c_int = 43; ++pub const PF_QIPCRTR: c_int = 42; ++pub const SA_ONSTACK: c_int = 0x08000000; ++pub const SA_SIGINFO: c_int = 0x00000004; ++pub const SA_NOCLDWAIT: c_int = 0x00000002; ++pub const SIGBUS: c_int = 7; ++pub const SIGCHLD: c_int = 17; ++pub const SIGCONT: c_int = 18; ++pub const SIGIO: c_int = 29; ++pub const SIGPOLL: c_int = 29; ++pub const SIGPROF: c_int = 27; ++pub const SIGPWR: c_int = 30; ++pub const SIGSTKFLT: c_int = 16; ++pub const SIGSTKSZ: size_t = 8192; ++pub const MINSIGSTKSZ: size_t = 2048; ++pub const SIGSTOP: c_int = 19; ++pub const SIGSYS: c_int = 31; ++pub const SIGTSTP: c_int = 20; ++pub const SIGTTIN: c_int = 21; ++pub const SIGTTOU: c_int = 22; ++pub const SIGURG: c_int = 23; ++pub const SIGUSR1: c_int = 10; ++pub const SIGUSR2: c_int = 12; ++pub const SIGVTALRM: c_int = 26; ++pub const SIGWINCH: c_int = 28; ++pub const SIGXCPU: c_int = 24; ++pub const SIGXFSZ: c_int = 25; ++pub const SIG_SETMASK: c_int = 2; // FIXME check these ++pub const SIG_BLOCK: c_int = 0x000000; ++pub const SIG_UNBLOCK: c_int = 0x01; ++pub const SOCK_DGRAM: c_int = 2; ++pub const SOCK_STREAM: c_int = 1; ++pub const SOL_CAIF: c_int = 278; ++pub const SOL_IUCV: c_int = 277; ++pub const SOL_KCM: c_int = 281; ++pub const SOL_NFC: c_int = 280; ++pub const SOL_PNPIPE: c_int = 275; ++pub const SOL_PPPOL2TP: c_int = 273; ++pub const SOL_RDS: c_int = 276; ++pub const SOL_RXRPC: c_int = 272; ++ ++pub const SYS3264_fadvise64: c_int = 223; ++pub const SYS3264_fcntl: c_int = 25; ++pub const SYS3264_fstatat: c_int = 79; ++pub const SYS3264_fstat: c_int = 80; ++pub const SYS3264_fstatfs: c_int = 44; ++pub const SYS3264_ftruncate: c_int = 46; ++pub const SYS3264_lseek: c_int = 62; ++pub const SYS3264_lstat: c_int = 1039; ++pub const SYS3264_mmap: c_int = 222; ++pub const SYS3264_sendfile: c_int = 71; ++pub const SYS3264_stat: c_int = 1038; ++pub const SYS3264_statfs: c_int = 43; ++pub const SYS3264_truncate: c_int = 45; ++pub const SYS_accept4: c_int = 242; ++pub const SYS_accept: c_int = 202; ++pub const SYS_access: c_int = 1033; ++pub const SYS_acct: c_int = 89; ++pub const SYS_add_key: c_int = 217; ++pub const SYS_adjtimex: c_int = 171; ++pub const SYS_alarm: c_int = 1059; ++pub const SYS_arch_specific_syscall: c_int = 244; ++pub const SYS_bdflush: c_int = 1075; ++pub const SYS_bind: c_int = 200; ++pub const SYS_bpf: c_int = 280; ++pub const SYS_brk: c_int = 214; ++pub const SYS_capget: c_int = 90; ++pub const SYS_capset: c_int = 91; ++pub const SYS_chdir: c_int = 49; ++pub const SYS_chmod: c_int = 1028; ++pub const SYS_chown: c_int = 1029; ++pub const SYS_chroot: c_int = 51; ++pub const SYS_clock_adjtime: c_int = 266; ++pub const SYS_clock_getres: c_int = 114; ++pub const SYS_clock_gettime: c_int = 113; ++pub const SYS_clock_nanosleep: c_int = 115; ++pub const SYS_clock_settime: c_int = 112; ++pub const SYS_clone: c_int = 220; ++pub const SYS_close: c_int = 57; ++pub const SYS_connect: c_int = 203; ++pub const SYS_copy_file_range: c_int = -1; // FIXME ++pub const SYS_creat: c_int = 1064; ++pub const SYS_delete_module: c_int = 106; ++pub const SYS_dup2: c_int = 1041; ++pub const SYS_dup3: c_int = 24; ++pub const SYS_dup: c_int = 23; ++pub const SYS_epoll_create1: c_int = 20; ++pub const SYS_epoll_create: c_int = 1042; ++pub const SYS_epoll_ctl: c_int = 21; ++pub const SYS_epoll_pwait: c_int = 22; ++pub const SYS_epoll_wait: c_int = 1069; ++pub const SYS_eventfd2: c_int = 19; ++pub const SYS_eventfd: c_int = 1044; ++pub const SYS_execveat: c_int = 281; ++pub const SYS_execve: c_int = 221; ++pub const SYS_exit: c_int = 93; ++pub const SYS_exit_group: c_int = 94; ++pub const SYS_faccessat: c_int = 48; ++pub const SYS_fadvise64_64: c_int = 223; ++pub const SYS_fallocate: c_int = 47; ++pub const SYS_fanotify_init: c_int = 262; ++pub const SYS_fanotify_mark: c_int = 263; ++pub const SYS_fchdir: c_int = 50; ++pub const SYS_fchmodat: c_int = 53; ++pub const SYS_fchmod: c_int = 52; ++pub const SYS_fchownat: c_int = 54; ++pub const SYS_fchown: c_int = 55; ++pub const SYS_fcntl64: c_int = 25; ++pub const SYS_fcntl: c_int = 25; ++pub const SYS_fdatasync: c_int = 83; ++pub const SYS_fgetxattr: c_int = 10; ++pub const SYS_finit_module: c_int = 273; ++pub const SYS_flistxattr: c_int = 13; ++pub const SYS_flock: c_int = 32; ++pub const SYS_fork: c_int = 1079; ++pub const SYS_fremovexattr: c_int = 16; ++pub const SYS_fsetxattr: c_int = 7; ++pub const SYS_fstat64: c_int = 80; ++pub const SYS_fstatat64: c_int = 79; ++pub const SYS_fstatfs64: c_int = 44; ++pub const SYS_fstatfs: c_int = 44; ++pub const SYS_fsync: c_int = 82; ++pub const SYS_ftruncate64: c_int = 46; ++pub const SYS_ftruncate: c_int = 46; ++pub const SYS_futex: c_int = 98; ++pub const SYS_futimesat: c_int = 1066; ++pub const SYS_getcpu: c_int = 168; ++pub const SYS_getcwd: c_int = 17; ++pub const SYS_getdents64: c_int = 61; ++pub const SYS_getdents: c_int = 1065; ++pub const SYS_getegid: c_int = 177; ++pub const SYS_geteuid: c_int = 175; ++pub const SYS_getgid: c_int = 176; ++pub const SYS_getgroups: c_int = 158; ++pub const SYS_getitimer: c_int = 102; ++pub const SYS_get_mempolicy: c_int = 236; ++pub const SYS_getpeername: c_int = 205; ++pub const SYS_getpgid: c_int = 155; ++pub const SYS_getpgrp: c_int = 1060; ++pub const SYS_getpid: c_int = 172; ++pub const SYS_getppid: c_int = 173; ++pub const SYS_getpriority: c_int = 141; ++pub const SYS_getrandom: c_int = 278; ++pub const SYS_getresgid: c_int = 150; ++pub const SYS_getresuid: c_int = 148; ++pub const SYS_getrlimit: c_int = 163; ++pub const SYS_get_robust_list: c_int = 100; ++pub const SYS_getrusage: c_int = 165; ++pub const SYS_getsid: c_int = 156; ++pub const SYS_getsockname: c_int = 204; ++pub const SYS_getsockopt: c_int = 209; ++pub const SYS_gettid: c_int = 178; ++pub const SYS_gettimeofday: c_int = 169; ++pub const SYS_getuid: c_int = 174; ++pub const SYS_getxattr: c_int = 8; ++pub const SYS_init_module: c_int = 105; ++pub const SYS_inotify_add_watch: c_int = 27; ++pub const SYS_inotify_init1: c_int = 26; ++pub const SYS_inotify_init: c_int = 1043; ++pub const SYS_inotify_rm_watch: c_int = 28; ++pub const SYS_io_cancel: c_int = 3; ++pub const SYS_ioctl: c_int = 29; ++pub const SYS_io_destroy: c_int = 1; ++pub const SYS_io_getevents: c_int = 4; ++pub const SYS_ioprio_get: c_int = 31; ++pub const SYS_ioprio_set: c_int = 30; ++pub const SYS_io_setup: c_int = 0; ++pub const SYS_io_submit: c_int = 2; ++pub const SYS_kcmp: c_int = 272; ++pub const SYS_kexec_load: c_int = 104; ++pub const SYS_keyctl: c_int = 219; ++pub const SYS_kill: c_int = 129; ++pub const SYS_lchown: c_int = 1032; ++pub const SYS_lgetxattr: c_int = 9; ++pub const SYS_linkat: c_int = 37; ++pub const SYS_link: c_int = 1025; ++pub const SYS_listen: c_int = 201; ++pub const SYS_listxattr: c_int = 11; ++pub const SYS_llistxattr: c_int = 12; ++pub const SYS__llseek: c_int = 62; ++pub const SYS_lookup_dcookie: c_int = 18; ++pub const SYS_lremovexattr: c_int = 15; ++pub const SYS_lseek: c_int = 62; ++pub const SYS_lsetxattr: c_int = 6; ++pub const SYS_lstat64: c_int = 1039; ++pub const SYS_lstat: c_int = 1039; ++pub const SYS_madvise: c_int = 233; ++pub const SYS_mbind: c_int = 235; ++pub const SYS_memfd_create: c_int = 279; ++pub const SYS_migrate_pages: c_int = 238; ++pub const SYS_mincore: c_int = 232; ++pub const SYS_mkdirat: c_int = 34; ++pub const SYS_mkdir: c_int = 1030; ++pub const SYS_mknodat: c_int = 33; ++pub const SYS_mknod: c_int = 1027; ++pub const SYS_mlockall: c_int = 230; ++pub const SYS_mlock: c_int = 228; ++pub const SYS_mmap2: c_int = 222; ++pub const SYS_mount: c_int = 40; ++pub const SYS_move_pages: c_int = 239; ++pub const SYS_mprotect: c_int = 226; ++pub const SYS_mq_getsetattr: c_int = 185; ++pub const SYS_mq_notify: c_int = 184; ++pub const SYS_mq_open: c_int = 180; ++pub const SYS_mq_timedreceive: c_int = 183; ++pub const SYS_mq_timedsend: c_int = 182; ++pub const SYS_mq_unlink: c_int = 181; ++pub const SYS_mremap: c_int = 216; ++pub const SYS_msgctl: c_int = 187; ++pub const SYS_msgget: c_int = 186; ++pub const SYS_msgrcv: c_int = 188; ++pub const SYS_msgsnd: c_int = 189; ++pub const SYS_msync: c_int = 227; ++pub const SYS_munlockall: c_int = 231; ++pub const SYS_munlock: c_int = 229; ++pub const SYS_munmap: c_int = 215; ++pub const SYS_name_to_handle_at: c_int = 264; ++pub const SYS_nanosleep: c_int = 101; ++pub const SYS_newfstatat: c_int = 79; ++pub const SYS_nfsservctl: c_int = 42; ++pub const SYS_oldwait4: c_int = 1072; ++pub const SYS_openat: c_int = 56; ++pub const SYS_open_by_handle_at: c_int = 265; ++pub const SYS_open: c_int = 1024; ++pub const SYS_pause: c_int = 1061; ++pub const SYS_perf_event_open: c_int = 241; ++pub const SYS_personality: c_int = 92; ++pub const SYS_pipe2: c_int = 59; ++pub const SYS_pipe: c_int = 1040; ++pub const SYS_pivot_root: c_int = 41; ++pub const SYS_poll: c_int = 1068; ++pub const SYS_ppoll: c_int = 73; ++pub const SYS_prctl: c_int = 167; ++pub const SYS_pread64: c_int = 67; ++pub const SYS_preadv: c_int = 69; ++pub const SYS_prlimit64: c_int = 261; ++pub const SYS_process_vm_readv: c_int = 270; ++pub const SYS_process_vm_writev: c_int = 271; ++pub const SYS_pselect6: c_int = 72; ++pub const SYS_ptrace: c_int = 117; ++pub const SYS_pwrite64: c_int = 68; ++pub const SYS_pwritev: c_int = 70; ++pub const SYS_quotactl: c_int = 60; ++pub const SYS_readahead: c_int = 213; ++pub const SYS_read: c_int = 63; ++pub const SYS_readlinkat: c_int = 78; ++pub const SYS_readlink: c_int = 1035; ++pub const SYS_readv: c_int = 65; ++pub const SYS_reboot: c_int = 142; ++pub const SYS_recv: c_int = 1073; ++pub const SYS_recvfrom: c_int = 207; ++pub const SYS_recvmmsg: c_int = 243; ++pub const SYS_recvmsg: c_int = 212; ++pub const SYS_remap_file_pages: c_int = 234; ++pub const SYS_removexattr: c_int = 14; ++pub const SYS_renameat2: c_int = 276; ++pub const SYS_renameat: c_int = 38; ++pub const SYS_rename: c_int = 1034; ++pub const SYS_request_key: c_int = 218; ++pub const SYS_restart_syscall: c_int = 128; ++pub const SYS_rmdir: c_int = 1031; ++pub const SYS_rt_sigaction: c_int = 134; ++pub const SYS_rt_sigpending: c_int = 136; ++pub const SYS_rt_sigprocmask: c_int = 135; ++pub const SYS_rt_sigqueueinfo: c_int = 138; ++pub const SYS_rt_sigreturn: c_int = 139; ++pub const SYS_rt_sigsuspend: c_int = 133; ++pub const SYS_rt_sigtimedwait: c_int = 137; ++pub const SYS_rt_tgsigqueueinfo: c_int = 240; ++pub const SYS_sched_getaffinity: c_int = 123; ++pub const SYS_sched_getattr: c_int = 275; ++pub const SYS_sched_getparam: c_int = 121; ++pub const SYS_sched_get_priority_max: c_int = 125; ++pub const SYS_sched_get_priority_min: c_int = 126; ++pub const SYS_sched_getscheduler: c_int = 120; ++pub const SYS_sched_rr_get_interval: c_int = 127; ++pub const SYS_sched_setaffinity: c_int = 122; ++pub const SYS_sched_setattr: c_int = 274; ++pub const SYS_sched_setparam: c_int = 118; ++pub const SYS_sched_setscheduler: c_int = 119; ++pub const SYS_sched_yield: c_int = 124; ++pub const SYS_seccomp: c_int = 277; ++pub const SYS_select: c_int = 1067; ++pub const SYS_semctl: c_int = 191; ++pub const SYS_semget: c_int = 190; ++pub const SYS_semop: c_int = 193; ++pub const SYS_semtimedop: c_int = 192; ++pub const SYS_send: c_int = 1074; ++pub const SYS_sendfile64: c_int = 71; ++pub const SYS_sendfile: c_int = 71; ++pub const SYS_sendmmsg: c_int = 269; ++pub const SYS_sendmsg: c_int = 211; ++pub const SYS_sendto: c_int = 206; ++pub const SYS_setdomainname: c_int = 162; ++pub const SYS_setfsgid: c_int = 152; ++pub const SYS_setfsuid: c_int = 151; ++pub const SYS_setgid: c_int = 144; ++pub const SYS_setgroups: c_int = 159; ++pub const SYS_sethostname: c_int = 161; ++pub const SYS_setitimer: c_int = 103; ++pub const SYS_set_mempolicy: c_int = 237; ++pub const SYS_setns: c_int = 268; ++pub const SYS_setpgid: c_int = 154; ++pub const SYS_setpriority: c_int = 140; ++pub const SYS_setregid: c_int = 143; ++pub const SYS_setresgid: c_int = 149; ++pub const SYS_setresuid: c_int = 147; ++pub const SYS_setreuid: c_int = 145; ++pub const SYS_setrlimit: c_int = 164; ++pub const SYS_set_robust_list: c_int = 99; ++pub const SYS_setsid: c_int = 157; ++pub const SYS_setsockopt: c_int = 208; ++pub const SYS_set_tid_address: c_int = 96; ++pub const SYS_settimeofday: c_int = 170; ++pub const SYS_setuid: c_int = 146; ++pub const SYS_setxattr: c_int = 5; ++pub const SYS_shmat: c_int = 196; ++pub const SYS_shmctl: c_int = 195; ++pub const SYS_shmdt: c_int = 197; ++pub const SYS_shmget: c_int = 194; ++pub const SYS_shutdown: c_int = 210; ++pub const SYS_sigaltstack: c_int = 132; ++pub const SYS_signalfd4: c_int = 74; ++pub const SYS_signalfd: c_int = 1045; ++pub const SYS_socket: c_int = 198; ++pub const SYS_socketpair: c_int = 199; ++pub const SYS_splice: c_int = 76; ++pub const SYS_stat64: c_int = 1038; ++pub const SYS_stat: c_int = 1038; ++pub const SYS_statfs64: c_int = 43; ++pub const SYS_swapoff: c_int = 225; ++pub const SYS_swapon: c_int = 224; ++pub const SYS_symlinkat: c_int = 36; ++pub const SYS_symlink: c_int = 1036; ++pub const SYS_sync: c_int = 81; ++pub const SYS_sync_file_range2: c_int = 84; ++pub const SYS_sync_file_range: c_int = 84; ++pub const SYS_syncfs: c_int = 267; ++pub const SYS_syscalls: c_int = 1080; ++pub const SYS__sysctl: c_int = 1078; ++pub const SYS_sysinfo: c_int = 179; ++pub const SYS_syslog: c_int = 116; ++pub const SYS_tee: c_int = 77; ++pub const SYS_tgkill: c_int = 131; ++pub const SYS_time: c_int = 1062; ++pub const SYS_timer_create: c_int = 107; ++pub const SYS_timer_delete: c_int = 111; ++pub const SYS_timerfd_create: c_int = 85; ++pub const SYS_timerfd_gettime: c_int = 87; ++pub const SYS_timerfd_settime: c_int = 86; ++pub const SYS_timer_getoverrun: c_int = 109; ++pub const SYS_timer_gettime: c_int = 108; ++pub const SYS_timer_settime: c_int = 110; ++pub const SYS_times: c_int = 153; ++pub const SYS_tkill: c_int = 130; ++pub const SYS_truncate64: c_int = 45; ++pub const SYS_truncate: c_int = 45; ++pub const SYS_umask: c_int = 166; ++pub const SYS_umount2: c_int = 39; ++pub const SYS_umount: c_int = 1076; ++pub const SYS_uname: c_int = 160; ++pub const SYS_unlinkat: c_int = 35; ++pub const SYS_unlink: c_int = 1026; ++pub const SYS_unshare: c_int = 97; ++pub const SYS_uselib: c_int = 1077; ++pub const SYS_ustat: c_int = 1070; ++pub const SYS_utime: c_int = 1063; ++pub const SYS_utimensat: c_int = 88; ++pub const SYS_utimes: c_int = 1037; ++pub const SYS_vfork: c_int = 1071; ++pub const SYS_vhangup: c_int = 58; ++pub const SYS_vmsplice: c_int = 75; ++pub const SYS_wait4: c_int = 260; ++pub const SYS_waitid: c_int = 95; ++pub const SYS_write: c_int = 64; ++pub const SYS_writev: c_int = 66; ++pub const SYS_statx: c_int = 291; ++pub const SYS_pidfd_send_signal: c_long = 424; ++pub const SYS_io_uring_setup: c_long = 425; ++pub const SYS_io_uring_enter: c_long = 426; ++pub const SYS_io_uring_register: c_long = 427; ++pub const SYS_open_tree: c_long = 428; ++pub const SYS_move_mount: c_long = 429; ++pub const SYS_fsopen: c_long = 430; ++pub const SYS_fsconfig: c_long = 431; ++pub const SYS_fsmount: c_long = 432; ++pub const SYS_fspick: c_long = 433; ++pub const SYS_pidfd_open: c_long = 434; ++pub const SYS_clone3: c_long = 435; ++pub const SYS_close_range: c_long = 436; ++pub const SYS_openat2: c_long = 437; ++pub const SYS_pidfd_getfd: c_long = 438; ++pub const SYS_faccessat2: c_long = 439; ++pub const SYS_process_madvise: c_long = 440; ++pub const SYS_epoll_pwait2: c_long = 441; ++pub const SYS_mount_setattr: c_long = 442; ++pub const TIOCM_LOOP: c_int = 32768; ++pub const TIOCM_OUT1: c_int = 8192; ++pub const TIOCM_OUT2: c_int = 16384; ++pub const TIOCSER_TEMT: c_int = 1; ++pub const TOSTOP: c_int = 256; ++pub const VEOF: c_int = 4; ++pub const VEOL2: c_int = 16; ++pub const VEOL: c_int = 11; ++pub const VMIN: c_int = 6; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b32/mips/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b32/mips/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b32/mips/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b32/mips/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,765 @@ ++use crate::off_t; ++use crate::prelude::*; ++ ++pub type c_char = i8; ++pub type wchar_t = c_int; ++ ++s! { ++ pub struct stat { ++ pub st_dev: crate::dev_t, ++ __st_padding1: [c_long; 2], ++ pub st_ino: crate::ino_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ __st_padding2: [c_long; 2], ++ pub st_size: off_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ pub st_blksize: crate::blksize_t, ++ __st_padding3: c_long, ++ pub st_blocks: crate::blkcnt_t, ++ __st_padding4: [c_long; 14], ++ } ++ ++ pub struct stat64 { ++ pub st_dev: crate::dev_t, ++ __st_padding1: [c_long; 2], ++ pub st_ino: crate::ino64_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ __st_padding2: [c_long; 2], ++ pub st_size: off_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ pub st_blksize: crate::blksize_t, ++ __st_padding3: c_long, ++ pub st_blocks: crate::blkcnt64_t, ++ __st_padding4: [c_long; 14], ++ } ++ ++ pub struct stack_t { ++ pub ss_sp: *mut c_void, ++ pub ss_size: size_t, ++ pub ss_flags: c_int, ++ } ++ ++ pub struct ipc_perm { ++ pub __ipc_perm_key: crate::key_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub cuid: crate::uid_t, ++ pub cgid: crate::gid_t, ++ pub mode: crate::mode_t, ++ pub __seq: c_int, ++ __unused1: c_long, ++ __unused2: c_long, ++ } ++ ++ pub struct shmid_ds { ++ pub shm_perm: crate::ipc_perm, ++ pub shm_segsz: size_t, ++ pub shm_atime: crate::time_t, ++ pub shm_dtime: crate::time_t, ++ pub shm_ctime: crate::time_t, ++ pub shm_cpid: crate::pid_t, ++ pub shm_lpid: crate::pid_t, ++ pub shm_nattch: c_ulong, ++ __pad1: c_ulong, ++ __pad2: c_ulong, ++ } ++ ++ pub struct msqid_ds { ++ pub msg_perm: crate::ipc_perm, ++ #[cfg(target_endian = "big")] ++ __unused1: c_int, ++ pub msg_stime: crate::time_t, ++ #[cfg(target_endian = "little")] ++ __unused1: c_int, ++ #[cfg(target_endian = "big")] ++ __unused2: c_int, ++ pub msg_rtime: crate::time_t, ++ #[cfg(target_endian = "little")] ++ __unused2: c_int, ++ #[cfg(target_endian = "big")] ++ __unused3: c_int, ++ pub msg_ctime: crate::time_t, ++ #[cfg(target_endian = "little")] ++ __unused3: c_int, ++ __msg_cbytes: c_ulong, ++ pub msg_qnum: crate::msgqnum_t, ++ pub msg_qbytes: crate::msglen_t, ++ pub msg_lspid: crate::pid_t, ++ pub msg_lrpid: crate::pid_t, ++ __pad1: c_ulong, ++ __pad2: c_ulong, ++ } ++ ++ pub struct statfs { ++ pub f_type: c_ulong, ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ pub f_fsid: crate::fsid_t, ++ pub f_namelen: c_ulong, ++ pub f_flags: c_ulong, ++ pub f_spare: [c_ulong; 5], ++ } ++ ++ pub struct statfs64 { ++ pub f_type: c_ulong, ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ pub f_fsid: crate::fsid_t, ++ pub f_namelen: c_ulong, ++ pub f_flags: c_ulong, ++ pub f_spare: [c_ulong; 5], ++ } ++} ++ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ #[repr(align(8))] ++ pub struct max_align_t { ++ priv_: [f32; 4], ++ } ++} ++ ++pub const SIGSTKSZ: size_t = 8192; ++pub const MINSIGSTKSZ: size_t = 2048; ++ ++pub const O_DIRECT: c_int = 0o100000; ++pub const O_DIRECTORY: c_int = 0o200000; ++pub const O_NOFOLLOW: c_int = 0o400000; ++pub const O_ASYNC: c_int = 0o10000; ++pub const O_LARGEFILE: c_int = 0x2000; ++ ++pub const MCL_CURRENT: c_int = 0x0001; ++pub const MCL_FUTURE: c_int = 0x0002; ++pub const MCL_ONFAULT: c_int = 0x0004; ++pub const CBAUD: crate::tcflag_t = 0o0010017; ++pub const TAB1: c_int = 0x00000800; ++pub const TAB2: c_int = 0x00001000; ++pub const TAB3: c_int = 0x00001800; ++pub const CR1: c_int = 0x00000200; ++pub const CR2: c_int = 0x00000400; ++pub const CR3: c_int = 0x00000600; ++pub const FF1: c_int = 0x00008000; ++pub const BS1: c_int = 0x00002000; ++pub const VT1: c_int = 0x00004000; ++pub const VWERASE: usize = 14; ++pub const VREPRINT: usize = 12; ++pub const VSUSP: usize = 10; ++pub const VSTART: usize = 8; ++pub const VSTOP: usize = 9; ++pub const VDISCARD: usize = 13; ++pub const VTIME: usize = 5; ++pub const IXON: crate::tcflag_t = 0x00000400; ++pub const IXOFF: crate::tcflag_t = 0x00001000; ++pub const ONLCR: crate::tcflag_t = 0x4; ++pub const CSIZE: crate::tcflag_t = 0x00000030; ++pub const CS6: crate::tcflag_t = 0x00000010; ++pub const CS7: crate::tcflag_t = 0x00000020; ++pub const CS8: crate::tcflag_t = 0x00000030; ++pub const CSTOPB: crate::tcflag_t = 0x00000040; ++pub const CREAD: crate::tcflag_t = 0x00000080; ++pub const PARENB: crate::tcflag_t = 0x00000100; ++pub const PARODD: crate::tcflag_t = 0x00000200; ++pub const HUPCL: crate::tcflag_t = 0x00000400; ++pub const CLOCAL: crate::tcflag_t = 0x00000800; ++pub const ECHOKE: crate::tcflag_t = 0x00000800; ++pub const ECHOE: crate::tcflag_t = 0x00000010; ++pub const ECHOK: crate::tcflag_t = 0x00000020; ++pub const ECHONL: crate::tcflag_t = 0x00000040; ++pub const ECHOPRT: crate::tcflag_t = 0x00000400; ++pub const ECHOCTL: crate::tcflag_t = 0x00000200; ++pub const ISIG: crate::tcflag_t = 0x00000001; ++pub const ICANON: crate::tcflag_t = 0x00000002; ++pub const PENDIN: crate::tcflag_t = 0x00004000; ++pub const NOFLSH: crate::tcflag_t = 0x00000080; ++pub const CIBAUD: crate::tcflag_t = 0o02003600000; ++pub const CBAUDEX: crate::tcflag_t = 0o010000; ++pub const VSWTC: usize = 7; ++pub const OLCUC: crate::tcflag_t = 0o000002; ++pub const NLDLY: crate::tcflag_t = 0o000400; ++pub const CRDLY: crate::tcflag_t = 0o003000; ++pub const TABDLY: crate::tcflag_t = 0o014000; ++pub const BSDLY: crate::tcflag_t = 0o020000; ++pub const FFDLY: crate::tcflag_t = 0o100000; ++pub const VTDLY: crate::tcflag_t = 0o040000; ++pub const XTABS: crate::tcflag_t = 0o014000; ++pub const B57600: crate::speed_t = 0o010001; ++pub const B115200: crate::speed_t = 0o010002; ++pub const B230400: crate::speed_t = 0o010003; ++pub const B460800: crate::speed_t = 0o010004; ++pub const B500000: crate::speed_t = 0o010005; ++pub const B576000: crate::speed_t = 0o010006; ++pub const B921600: crate::speed_t = 0o010007; ++pub const B1000000: crate::speed_t = 0o010010; ++pub const B1152000: crate::speed_t = 0o010011; ++pub const B1500000: crate::speed_t = 0o010012; ++pub const B2000000: crate::speed_t = 0o010013; ++pub const B2500000: crate::speed_t = 0o010014; ++pub const B3000000: crate::speed_t = 0o010015; ++pub const B3500000: crate::speed_t = 0o010016; ++pub const B4000000: crate::speed_t = 0o010017; ++ ++pub const O_APPEND: c_int = 0o010; ++pub const O_CREAT: c_int = 0o400; ++pub const O_EXCL: c_int = 0o2000; ++pub const O_NOCTTY: c_int = 0o4000; ++pub const O_NONBLOCK: c_int = 0o200; ++pub const O_SYNC: c_int = 0o40020; ++pub const O_RSYNC: c_int = 0o40020; ++pub const O_DSYNC: c_int = 0o020; ++ ++pub const MAP_ANON: c_int = 0x800; ++pub const MAP_GROWSDOWN: c_int = 0x1000; ++pub const MAP_DENYWRITE: c_int = 0x2000; ++pub const MAP_EXECUTABLE: c_int = 0x4000; ++pub const MAP_LOCKED: c_int = 0x8000; ++pub const MAP_NORESERVE: c_int = 0x0400; ++pub const MAP_POPULATE: c_int = 0x10000; ++pub const MAP_NONBLOCK: c_int = 0x20000; ++pub const MAP_STACK: c_int = 0x40000; ++pub const MAP_HUGETLB: c_int = 0x80000; ++ ++pub const EDEADLK: c_int = 45; ++pub const ENAMETOOLONG: c_int = 78; ++pub const ENOLCK: c_int = 46; ++pub const ENOSYS: c_int = 89; ++pub const ENOTEMPTY: c_int = 93; ++pub const ELOOP: c_int = 90; ++pub const ENOMSG: c_int = 35; ++pub const EIDRM: c_int = 36; ++pub const ECHRNG: c_int = 37; ++pub const EL2NSYNC: c_int = 38; ++pub const EL3HLT: c_int = 39; ++pub const EL3RST: c_int = 40; ++pub const ELNRNG: c_int = 41; ++pub const EUNATCH: c_int = 42; ++pub const ENOCSI: c_int = 43; ++pub const EL2HLT: c_int = 44; ++pub const EBADE: c_int = 50; ++pub const EBADR: c_int = 51; ++pub const EXFULL: c_int = 52; ++pub const ENOANO: c_int = 53; ++pub const EBADRQC: c_int = 54; ++pub const EBADSLT: c_int = 55; ++pub const EDEADLOCK: c_int = 56; ++pub const EMULTIHOP: c_int = 74; ++pub const EOVERFLOW: c_int = 79; ++pub const ENOTUNIQ: c_int = 80; ++pub const EBADFD: c_int = 81; ++pub const EBADMSG: c_int = 77; ++pub const EREMCHG: c_int = 82; ++pub const ELIBACC: c_int = 83; ++pub const ELIBBAD: c_int = 84; ++pub const ELIBSCN: c_int = 85; ++pub const ELIBMAX: c_int = 86; ++pub const ELIBEXEC: c_int = 87; ++pub const EILSEQ: c_int = 88; ++pub const ERESTART: c_int = 91; ++pub const ESTRPIPE: c_int = 92; ++pub const EUSERS: c_int = 94; ++pub const ENOTSOCK: c_int = 95; ++pub const EDESTADDRREQ: c_int = 96; ++pub const EMSGSIZE: c_int = 97; ++pub const EPROTOTYPE: c_int = 98; ++pub const ENOPROTOOPT: c_int = 99; ++pub const EPROTONOSUPPORT: c_int = 120; ++pub const ESOCKTNOSUPPORT: c_int = 121; ++pub const EOPNOTSUPP: c_int = 122; ++pub const ENOTSUP: c_int = EOPNOTSUPP; ++pub const EPFNOSUPPORT: c_int = 123; ++pub const EAFNOSUPPORT: c_int = 124; ++pub const EADDRINUSE: c_int = 125; ++pub const EADDRNOTAVAIL: c_int = 126; ++pub const ENETDOWN: c_int = 127; ++pub const ENETUNREACH: c_int = 128; ++pub const ENETRESET: c_int = 129; ++pub const ECONNABORTED: c_int = 130; ++pub const ECONNRESET: c_int = 131; ++pub const ENOBUFS: c_int = 132; ++pub const EISCONN: c_int = 133; ++pub const ENOTCONN: c_int = 134; ++pub const ESHUTDOWN: c_int = 143; ++pub const ETOOMANYREFS: c_int = 144; ++pub const ETIMEDOUT: c_int = 145; ++pub const ECONNREFUSED: c_int = 146; ++pub const EHOSTDOWN: c_int = 147; ++pub const EHOSTUNREACH: c_int = 148; ++pub const EALREADY: c_int = 149; ++pub const EINPROGRESS: c_int = 150; ++pub const ESTALE: c_int = 151; ++pub const EUCLEAN: c_int = 135; ++pub const ENOTNAM: c_int = 137; ++pub const ENAVAIL: c_int = 138; ++pub const EISNAM: c_int = 139; ++pub const EREMOTEIO: c_int = 140; ++pub const EDQUOT: c_int = 1133; ++pub const ENOMEDIUM: c_int = 159; ++pub const EMEDIUMTYPE: c_int = 160; ++pub const ECANCELED: c_int = 158; ++pub const ENOKEY: c_int = 161; ++pub const EKEYEXPIRED: c_int = 162; ++pub const EKEYREVOKED: c_int = 163; ++pub const EKEYREJECTED: c_int = 164; ++pub const EOWNERDEAD: c_int = 165; ++pub const ENOTRECOVERABLE: c_int = 166; ++pub const EHWPOISON: c_int = 168; ++pub const ERFKILL: c_int = 167; ++ ++pub const SOCK_STREAM: c_int = 2; ++pub const SOCK_DGRAM: c_int = 1; ++ ++pub const SA_ONSTACK: c_int = 0x08000000; ++pub const SA_SIGINFO: c_int = 8; ++pub const SA_NOCLDWAIT: c_int = 0x10000; ++ ++pub const SIGCHLD: c_int = 18; ++pub const SIGBUS: c_int = 10; ++pub const SIGTTIN: c_int = 26; ++pub const SIGTTOU: c_int = 27; ++pub const SIGXCPU: c_int = 30; ++pub const SIGXFSZ: c_int = 31; ++pub const SIGVTALRM: c_int = 28; ++pub const SIGPROF: c_int = 29; ++pub const SIGWINCH: c_int = 20; ++pub const SIGUSR1: c_int = 16; ++pub const SIGUSR2: c_int = 17; ++pub const SIGCONT: c_int = 25; ++pub const SIGSTOP: c_int = 23; ++pub const SIGTSTP: c_int = 24; ++pub const SIGURG: c_int = 21; ++pub const SIGIO: c_int = 22; ++pub const SIGSYS: c_int = 12; ++pub const SIGSTKFLT: c_int = 7; ++pub const SIGPOLL: c_int = crate::SIGIO; ++pub const SIGPWR: c_int = 19; ++pub const SIG_SETMASK: c_int = 3; ++pub const SIG_BLOCK: c_int = 1; ++pub const SIG_UNBLOCK: c_int = 2; ++ ++pub const EXTPROC: crate::tcflag_t = 0o200000; ++ ++pub const F_GETLK: c_int = 33; ++pub const F_GETOWN: c_int = 23; ++pub const F_SETLK: c_int = 34; ++pub const F_SETLKW: c_int = 35; ++pub const F_SETOWN: c_int = 24; ++ ++pub const VEOF: usize = 16; ++pub const VEOL: usize = 17; ++pub const VEOL2: usize = 6; ++pub const VMIN: usize = 4; ++pub const IEXTEN: crate::tcflag_t = 0o000400; ++pub const TOSTOP: crate::tcflag_t = 0o100000; ++pub const FLUSHO: crate::tcflag_t = 0o020000; ++ ++pub const POLLWRNORM: c_short = 0x4; ++pub const POLLWRBAND: c_short = 0x100; ++ ++pub const SYS_syscall: c_long = 4000 + 0; ++pub const SYS_exit: c_long = 4000 + 1; ++pub const SYS_fork: c_long = 4000 + 2; ++pub const SYS_read: c_long = 4000 + 3; ++pub const SYS_write: c_long = 4000 + 4; ++pub const SYS_open: c_long = 4000 + 5; ++pub const SYS_close: c_long = 4000 + 6; ++pub const SYS_waitpid: c_long = 4000 + 7; ++pub const SYS_creat: c_long = 4000 + 8; ++pub const SYS_link: c_long = 4000 + 9; ++pub const SYS_unlink: c_long = 4000 + 10; ++pub const SYS_execve: c_long = 4000 + 11; ++pub const SYS_chdir: c_long = 4000 + 12; ++pub const SYS_time: c_long = 4000 + 13; ++pub const SYS_mknod: c_long = 4000 + 14; ++pub const SYS_chmod: c_long = 4000 + 15; ++pub const SYS_lchown: c_long = 4000 + 16; ++pub const SYS_break: c_long = 4000 + 17; ++pub const SYS_lseek: c_long = 4000 + 19; ++pub const SYS_getpid: c_long = 4000 + 20; ++pub const SYS_mount: c_long = 4000 + 21; ++pub const SYS_umount: c_long = 4000 + 22; ++pub const SYS_setuid: c_long = 4000 + 23; ++pub const SYS_getuid: c_long = 4000 + 24; ++pub const SYS_stime: c_long = 4000 + 25; ++pub const SYS_ptrace: c_long = 4000 + 26; ++pub const SYS_alarm: c_long = 4000 + 27; ++pub const SYS_pause: c_long = 4000 + 29; ++pub const SYS_utime: c_long = 4000 + 30; ++pub const SYS_stty: c_long = 4000 + 31; ++pub const SYS_gtty: c_long = 4000 + 32; ++pub const SYS_access: c_long = 4000 + 33; ++pub const SYS_nice: c_long = 4000 + 34; ++pub const SYS_ftime: c_long = 4000 + 35; ++pub const SYS_sync: c_long = 4000 + 36; ++pub const SYS_kill: c_long = 4000 + 37; ++pub const SYS_rename: c_long = 4000 + 38; ++pub const SYS_mkdir: c_long = 4000 + 39; ++pub const SYS_rmdir: c_long = 4000 + 40; ++pub const SYS_dup: c_long = 4000 + 41; ++pub const SYS_pipe: c_long = 4000 + 42; ++pub const SYS_times: c_long = 4000 + 43; ++pub const SYS_prof: c_long = 4000 + 44; ++pub const SYS_brk: c_long = 4000 + 45; ++pub const SYS_setgid: c_long = 4000 + 46; ++pub const SYS_getgid: c_long = 4000 + 47; ++pub const SYS_signal: c_long = 4000 + 48; ++pub const SYS_geteuid: c_long = 4000 + 49; ++pub const SYS_getegid: c_long = 4000 + 50; ++pub const SYS_acct: c_long = 4000 + 51; ++pub const SYS_umount2: c_long = 4000 + 52; ++pub const SYS_lock: c_long = 4000 + 53; ++pub const SYS_ioctl: c_long = 4000 + 54; ++pub const SYS_fcntl: c_long = 4000 + 55; ++pub const SYS_mpx: c_long = 4000 + 56; ++pub const SYS_setpgid: c_long = 4000 + 57; ++pub const SYS_ulimit: c_long = 4000 + 58; ++pub const SYS_umask: c_long = 4000 + 60; ++pub const SYS_chroot: c_long = 4000 + 61; ++pub const SYS_ustat: c_long = 4000 + 62; ++pub const SYS_dup2: c_long = 4000 + 63; ++pub const SYS_getppid: c_long = 4000 + 64; ++pub const SYS_getpgrp: c_long = 4000 + 65; ++pub const SYS_setsid: c_long = 4000 + 66; ++pub const SYS_sigaction: c_long = 4000 + 67; ++pub const SYS_sgetmask: c_long = 4000 + 68; ++pub const SYS_ssetmask: c_long = 4000 + 69; ++pub const SYS_setreuid: c_long = 4000 + 70; ++pub const SYS_setregid: c_long = 4000 + 71; ++pub const SYS_sigsuspend: c_long = 4000 + 72; ++pub const SYS_sigpending: c_long = 4000 + 73; ++pub const SYS_sethostname: c_long = 4000 + 74; ++pub const SYS_setrlimit: c_long = 4000 + 75; ++pub const SYS_getrlimit: c_long = 4000 + 76; ++pub const SYS_getrusage: c_long = 4000 + 77; ++pub const SYS_gettimeofday: c_long = 4000 + 78; ++pub const SYS_settimeofday: c_long = 4000 + 79; ++pub const SYS_getgroups: c_long = 4000 + 80; ++pub const SYS_setgroups: c_long = 4000 + 81; ++pub const SYS_symlink: c_long = 4000 + 83; ++pub const SYS_readlink: c_long = 4000 + 85; ++pub const SYS_uselib: c_long = 4000 + 86; ++pub const SYS_swapon: c_long = 4000 + 87; ++pub const SYS_reboot: c_long = 4000 + 88; ++pub const SYS_readdir: c_long = 4000 + 89; ++pub const SYS_mmap: c_long = 4000 + 90; ++pub const SYS_munmap: c_long = 4000 + 91; ++pub const SYS_truncate: c_long = 4000 + 92; ++pub const SYS_ftruncate: c_long = 4000 + 93; ++pub const SYS_fchmod: c_long = 4000 + 94; ++pub const SYS_fchown: c_long = 4000 + 95; ++pub const SYS_getpriority: c_long = 4000 + 96; ++pub const SYS_setpriority: c_long = 4000 + 97; ++pub const SYS_profil: c_long = 4000 + 98; ++pub const SYS_statfs: c_long = 4000 + 99; ++pub const SYS_fstatfs: c_long = 4000 + 100; ++pub const SYS_ioperm: c_long = 4000 + 101; ++pub const SYS_socketcall: c_long = 4000 + 102; ++pub const SYS_syslog: c_long = 4000 + 103; ++pub const SYS_setitimer: c_long = 4000 + 104; ++pub const SYS_getitimer: c_long = 4000 + 105; ++pub const SYS_stat: c_long = 4000 + 106; ++pub const SYS_lstat: c_long = 4000 + 107; ++pub const SYS_fstat: c_long = 4000 + 108; ++pub const SYS_iopl: c_long = 4000 + 110; ++pub const SYS_vhangup: c_long = 4000 + 111; ++pub const SYS_idle: c_long = 4000 + 112; ++pub const SYS_vm86: c_long = 4000 + 113; ++pub const SYS_wait4: c_long = 4000 + 114; ++pub const SYS_swapoff: c_long = 4000 + 115; ++pub const SYS_sysinfo: c_long = 4000 + 116; ++pub const SYS_ipc: c_long = 4000 + 117; ++pub const SYS_fsync: c_long = 4000 + 118; ++pub const SYS_sigreturn: c_long = 4000 + 119; ++pub const SYS_clone: c_long = 4000 + 120; ++pub const SYS_setdomainname: c_long = 4000 + 121; ++pub const SYS_uname: c_long = 4000 + 122; ++pub const SYS_modify_ldt: c_long = 4000 + 123; ++pub const SYS_adjtimex: c_long = 4000 + 124; ++pub const SYS_mprotect: c_long = 4000 + 125; ++pub const SYS_sigprocmask: c_long = 4000 + 126; ++pub const SYS_create_module: c_long = 4000 + 127; ++pub const SYS_init_module: c_long = 4000 + 128; ++pub const SYS_delete_module: c_long = 4000 + 129; ++pub const SYS_get_kernel_syms: c_long = 4000 + 130; ++pub const SYS_quotactl: c_long = 4000 + 131; ++pub const SYS_getpgid: c_long = 4000 + 132; ++pub const SYS_fchdir: c_long = 4000 + 133; ++pub const SYS_bdflush: c_long = 4000 + 134; ++pub const SYS_sysfs: c_long = 4000 + 135; ++pub const SYS_personality: c_long = 4000 + 136; ++pub const SYS_afs_syscall: c_long = 4000 + 137; ++pub const SYS_setfsuid: c_long = 4000 + 138; ++pub const SYS_setfsgid: c_long = 4000 + 139; ++pub const SYS__llseek: c_long = 4000 + 140; ++pub const SYS_getdents: c_long = 4000 + 141; ++pub const SYS_flock: c_long = 4000 + 143; ++pub const SYS_msync: c_long = 4000 + 144; ++pub const SYS_readv: c_long = 4000 + 145; ++pub const SYS_writev: c_long = 4000 + 146; ++pub const SYS_cacheflush: c_long = 4000 + 147; ++pub const SYS_cachectl: c_long = 4000 + 148; ++pub const SYS_sysmips: c_long = 4000 + 149; ++pub const SYS_getsid: c_long = 4000 + 151; ++pub const SYS_fdatasync: c_long = 4000 + 152; ++pub const SYS__sysctl: c_long = 4000 + 153; ++pub const SYS_mlock: c_long = 4000 + 154; ++pub const SYS_munlock: c_long = 4000 + 155; ++pub const SYS_mlockall: c_long = 4000 + 156; ++pub const SYS_munlockall: c_long = 4000 + 157; ++pub const SYS_sched_setparam: c_long = 4000 + 158; ++pub const SYS_sched_getparam: c_long = 4000 + 159; ++pub const SYS_sched_setscheduler: c_long = 4000 + 160; ++pub const SYS_sched_getscheduler: c_long = 4000 + 161; ++pub const SYS_sched_yield: c_long = 4000 + 162; ++pub const SYS_sched_get_priority_max: c_long = 4000 + 163; ++pub const SYS_sched_get_priority_min: c_long = 4000 + 164; ++pub const SYS_sched_rr_get_interval: c_long = 4000 + 165; ++pub const SYS_nanosleep: c_long = 4000 + 166; ++pub const SYS_mremap: c_long = 4000 + 167; ++pub const SYS_accept: c_long = 4000 + 168; ++pub const SYS_bind: c_long = 4000 + 169; ++pub const SYS_connect: c_long = 4000 + 170; ++pub const SYS_getpeername: c_long = 4000 + 171; ++pub const SYS_getsockname: c_long = 4000 + 172; ++pub const SYS_getsockopt: c_long = 4000 + 173; ++pub const SYS_listen: c_long = 4000 + 174; ++pub const SYS_recv: c_long = 4000 + 175; ++pub const SYS_recvfrom: c_long = 4000 + 176; ++pub const SYS_recvmsg: c_long = 4000 + 177; ++pub const SYS_send: c_long = 4000 + 178; ++pub const SYS_sendmsg: c_long = 4000 + 179; ++pub const SYS_sendto: c_long = 4000 + 180; ++pub const SYS_setsockopt: c_long = 4000 + 181; ++pub const SYS_shutdown: c_long = 4000 + 182; ++pub const SYS_socket: c_long = 4000 + 183; ++pub const SYS_socketpair: c_long = 4000 + 184; ++pub const SYS_setresuid: c_long = 4000 + 185; ++pub const SYS_getresuid: c_long = 4000 + 186; ++pub const SYS_query_module: c_long = 4000 + 187; ++pub const SYS_poll: c_long = 4000 + 188; ++pub const SYS_nfsservctl: c_long = 4000 + 189; ++pub const SYS_setresgid: c_long = 4000 + 190; ++pub const SYS_getresgid: c_long = 4000 + 191; ++pub const SYS_prctl: c_long = 4000 + 192; ++pub const SYS_rt_sigreturn: c_long = 4000 + 193; ++pub const SYS_rt_sigaction: c_long = 4000 + 194; ++pub const SYS_rt_sigprocmask: c_long = 4000 + 195; ++pub const SYS_rt_sigpending: c_long = 4000 + 196; ++pub const SYS_rt_sigtimedwait: c_long = 4000 + 197; ++pub const SYS_rt_sigqueueinfo: c_long = 4000 + 198; ++pub const SYS_rt_sigsuspend: c_long = 4000 + 199; ++pub const SYS_chown: c_long = 4000 + 202; ++pub const SYS_getcwd: c_long = 4000 + 203; ++pub const SYS_capget: c_long = 4000 + 204; ++pub const SYS_capset: c_long = 4000 + 205; ++pub const SYS_sigaltstack: c_long = 4000 + 206; ++pub const SYS_sendfile: c_long = 4000 + 207; ++pub const SYS_getpmsg: c_long = 4000 + 208; ++pub const SYS_putpmsg: c_long = 4000 + 209; ++pub const SYS_mmap2: c_long = 4000 + 210; ++pub const SYS_truncate64: c_long = 4000 + 211; ++pub const SYS_ftruncate64: c_long = 4000 + 212; ++pub const SYS_stat64: c_long = 4000 + 213; ++pub const SYS_lstat64: c_long = 4000 + 214; ++pub const SYS_fstat64: c_long = 4000 + 215; ++pub const SYS_pivot_root: c_long = 4000 + 216; ++pub const SYS_mincore: c_long = 4000 + 217; ++pub const SYS_madvise: c_long = 4000 + 218; ++pub const SYS_getdents64: c_long = 4000 + 219; ++pub const SYS_fcntl64: c_long = 4000 + 220; ++pub const SYS_gettid: c_long = 4000 + 222; ++pub const SYS_readahead: c_long = 4000 + 223; ++pub const SYS_setxattr: c_long = 4000 + 224; ++pub const SYS_lsetxattr: c_long = 4000 + 225; ++pub const SYS_fsetxattr: c_long = 4000 + 226; ++pub const SYS_getxattr: c_long = 4000 + 227; ++pub const SYS_lgetxattr: c_long = 4000 + 228; ++pub const SYS_fgetxattr: c_long = 4000 + 229; ++pub const SYS_listxattr: c_long = 4000 + 230; ++pub const SYS_llistxattr: c_long = 4000 + 231; ++pub const SYS_flistxattr: c_long = 4000 + 232; ++pub const SYS_removexattr: c_long = 4000 + 233; ++pub const SYS_lremovexattr: c_long = 4000 + 234; ++pub const SYS_fremovexattr: c_long = 4000 + 235; ++pub const SYS_tkill: c_long = 4000 + 236; ++pub const SYS_sendfile64: c_long = 4000 + 237; ++pub const SYS_futex: c_long = 4000 + 238; ++pub const SYS_sched_setaffinity: c_long = 4000 + 239; ++pub const SYS_sched_getaffinity: c_long = 4000 + 240; ++pub const SYS_io_setup: c_long = 4000 + 241; ++pub const SYS_io_destroy: c_long = 4000 + 242; ++pub const SYS_io_getevents: c_long = 4000 + 243; ++pub const SYS_io_submit: c_long = 4000 + 244; ++pub const SYS_io_cancel: c_long = 4000 + 245; ++pub const SYS_exit_group: c_long = 4000 + 246; ++pub const SYS_lookup_dcookie: c_long = 4000 + 247; ++pub const SYS_epoll_create: c_long = 4000 + 248; ++pub const SYS_epoll_ctl: c_long = 4000 + 249; ++pub const SYS_epoll_wait: c_long = 4000 + 250; ++pub const SYS_remap_file_pages: c_long = 4000 + 251; ++pub const SYS_set_tid_address: c_long = 4000 + 252; ++pub const SYS_restart_syscall: c_long = 4000 + 253; ++pub const SYS_statfs64: c_long = 4000 + 255; ++pub const SYS_fstatfs64: c_long = 4000 + 256; ++pub const SYS_timer_create: c_long = 4000 + 257; ++pub const SYS_timer_settime: c_long = 4000 + 258; ++pub const SYS_timer_gettime: c_long = 4000 + 259; ++pub const SYS_timer_getoverrun: c_long = 4000 + 260; ++pub const SYS_timer_delete: c_long = 4000 + 261; ++pub const SYS_clock_settime: c_long = 4000 + 262; ++pub const SYS_clock_gettime: c_long = 4000 + 263; ++pub const SYS_clock_getres: c_long = 4000 + 264; ++pub const SYS_clock_nanosleep: c_long = 4000 + 265; ++pub const SYS_tgkill: c_long = 4000 + 266; ++pub const SYS_utimes: c_long = 4000 + 267; ++pub const SYS_mbind: c_long = 4000 + 268; ++pub const SYS_get_mempolicy: c_long = 4000 + 269; ++pub const SYS_set_mempolicy: c_long = 4000 + 270; ++pub const SYS_mq_open: c_long = 4000 + 271; ++pub const SYS_mq_unlink: c_long = 4000 + 272; ++pub const SYS_mq_timedsend: c_long = 4000 + 273; ++pub const SYS_mq_timedreceive: c_long = 4000 + 274; ++pub const SYS_mq_notify: c_long = 4000 + 275; ++pub const SYS_mq_getsetattr: c_long = 4000 + 276; ++pub const SYS_vserver: c_long = 4000 + 277; ++pub const SYS_waitid: c_long = 4000 + 278; ++/* pub const SYS_sys_setaltroot: c_long = 4000 + 279; */ ++pub const SYS_add_key: c_long = 4000 + 280; ++pub const SYS_request_key: c_long = 4000 + 281; ++pub const SYS_keyctl: c_long = 4000 + 282; ++pub const SYS_set_thread_area: c_long = 4000 + 283; ++pub const SYS_inotify_init: c_long = 4000 + 284; ++pub const SYS_inotify_add_watch: c_long = 4000 + 285; ++pub const SYS_inotify_rm_watch: c_long = 4000 + 286; ++pub const SYS_migrate_pages: c_long = 4000 + 287; ++pub const SYS_openat: c_long = 4000 + 288; ++pub const SYS_mkdirat: c_long = 4000 + 289; ++pub const SYS_mknodat: c_long = 4000 + 290; ++pub const SYS_fchownat: c_long = 4000 + 291; ++pub const SYS_futimesat: c_long = 4000 + 292; ++pub const SYS_unlinkat: c_long = 4000 + 294; ++pub const SYS_renameat: c_long = 4000 + 295; ++pub const SYS_linkat: c_long = 4000 + 296; ++pub const SYS_symlinkat: c_long = 4000 + 297; ++pub const SYS_readlinkat: c_long = 4000 + 298; ++pub const SYS_fchmodat: c_long = 4000 + 299; ++pub const SYS_faccessat: c_long = 4000 + 300; ++pub const SYS_pselect6: c_long = 4000 + 301; ++pub const SYS_ppoll: c_long = 4000 + 302; ++pub const SYS_unshare: c_long = 4000 + 303; ++pub const SYS_splice: c_long = 4000 + 304; ++pub const SYS_sync_file_range: c_long = 4000 + 305; ++pub const SYS_tee: c_long = 4000 + 306; ++pub const SYS_vmsplice: c_long = 4000 + 307; ++pub const SYS_move_pages: c_long = 4000 + 308; ++pub const SYS_set_robust_list: c_long = 4000 + 309; ++pub const SYS_get_robust_list: c_long = 4000 + 310; ++pub const SYS_kexec_load: c_long = 4000 + 311; ++pub const SYS_getcpu: c_long = 4000 + 312; ++pub const SYS_epoll_pwait: c_long = 4000 + 313; ++pub const SYS_ioprio_set: c_long = 4000 + 314; ++pub const SYS_ioprio_get: c_long = 4000 + 315; ++pub const SYS_utimensat: c_long = 4000 + 316; ++pub const SYS_signalfd: c_long = 4000 + 317; ++pub const SYS_timerfd: c_long = 4000 + 318; ++pub const SYS_eventfd: c_long = 4000 + 319; ++pub const SYS_fallocate: c_long = 4000 + 320; ++pub const SYS_timerfd_create: c_long = 4000 + 321; ++pub const SYS_timerfd_gettime: c_long = 4000 + 322; ++pub const SYS_timerfd_settime: c_long = 4000 + 323; ++pub const SYS_signalfd4: c_long = 4000 + 324; ++pub const SYS_eventfd2: c_long = 4000 + 325; ++pub const SYS_epoll_create1: c_long = 4000 + 326; ++pub const SYS_dup3: c_long = 4000 + 327; ++pub const SYS_pipe2: c_long = 4000 + 328; ++pub const SYS_inotify_init1: c_long = 4000 + 329; ++pub const SYS_preadv: c_long = 4000 + 330; ++pub const SYS_pwritev: c_long = 4000 + 331; ++pub const SYS_rt_tgsigqueueinfo: c_long = 4000 + 332; ++pub const SYS_perf_event_open: c_long = 4000 + 333; ++pub const SYS_accept4: c_long = 4000 + 334; ++pub const SYS_recvmmsg: c_long = 4000 + 335; ++pub const SYS_fanotify_init: c_long = 4000 + 336; ++pub const SYS_fanotify_mark: c_long = 4000 + 337; ++pub const SYS_prlimit64: c_long = 4000 + 338; ++pub const SYS_name_to_handle_at: c_long = 4000 + 339; ++pub const SYS_open_by_handle_at: c_long = 4000 + 340; ++pub const SYS_clock_adjtime: c_long = 4000 + 341; ++pub const SYS_syncfs: c_long = 4000 + 342; ++pub const SYS_sendmmsg: c_long = 4000 + 343; ++pub const SYS_setns: c_long = 4000 + 344; ++pub const SYS_process_vm_readv: c_long = 4000 + 345; ++pub const SYS_process_vm_writev: c_long = 4000 + 346; ++pub const SYS_kcmp: c_long = 4000 + 347; ++pub const SYS_finit_module: c_long = 4000 + 348; ++pub const SYS_sched_setattr: c_long = 4000 + 349; ++pub const SYS_sched_getattr: c_long = 4000 + 350; ++pub const SYS_renameat2: c_long = 4000 + 351; ++pub const SYS_seccomp: c_long = 4000 + 352; ++pub const SYS_getrandom: c_long = 4000 + 353; ++pub const SYS_memfd_create: c_long = 4000 + 354; ++pub const SYS_bpf: c_long = 4000 + 355; ++pub const SYS_execveat: c_long = 4000 + 356; ++pub const SYS_userfaultfd: c_long = 4000 + 357; ++pub const SYS_membarrier: c_long = 4000 + 358; ++pub const SYS_mlock2: c_long = 4000 + 359; ++pub const SYS_copy_file_range: c_long = 4000 + 360; ++pub const SYS_preadv2: c_long = 4000 + 361; ++pub const SYS_pwritev2: c_long = 4000 + 362; ++pub const SYS_pkey_mprotect: c_long = 4000 + 363; ++pub const SYS_pkey_alloc: c_long = 4000 + 364; ++pub const SYS_pkey_free: c_long = 4000 + 365; ++pub const SYS_statx: c_long = 4000 + 366; ++pub const SYS_pidfd_send_signal: c_long = 4000 + 424; ++pub const SYS_io_uring_setup: c_long = 4000 + 425; ++pub const SYS_io_uring_enter: c_long = 4000 + 426; ++pub const SYS_io_uring_register: c_long = 4000 + 427; ++pub const SYS_open_tree: c_long = 4000 + 428; ++pub const SYS_move_mount: c_long = 4000 + 429; ++pub const SYS_fsopen: c_long = 4000 + 430; ++pub const SYS_fsconfig: c_long = 4000 + 431; ++pub const SYS_fsmount: c_long = 4000 + 432; ++pub const SYS_fspick: c_long = 4000 + 433; ++pub const SYS_pidfd_open: c_long = 4000 + 434; ++pub const SYS_clone3: c_long = 4000 + 435; ++pub const SYS_close_range: c_long = 4000 + 436; ++pub const SYS_openat2: c_long = 4000 + 437; ++pub const SYS_pidfd_getfd: c_long = 4000 + 438; ++pub const SYS_faccessat2: c_long = 4000 + 439; ++pub const SYS_process_madvise: c_long = 4000 + 440; ++pub const SYS_epoll_pwait2: c_long = 4000 + 441; ++pub const SYS_mount_setattr: c_long = 4000 + 442; ++pub const SYS_quotactl_fd: c_long = 4000 + 443; ++pub const SYS_landlock_create_ruleset: c_long = 4000 + 444; ++pub const SYS_landlock_add_rule: c_long = 4000 + 445; ++pub const SYS_landlock_restrict_self: c_long = 4000 + 446; ++pub const SYS_memfd_secret: c_long = 4000 + 447; ++pub const SYS_process_mrelease: c_long = 4000 + 448; ++pub const SYS_futex_waitv: c_long = 4000 + 449; ++pub const SYS_set_mempolicy_home_node: c_long = 4000 + 450; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b32/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b32/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b32/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b32/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,67 @@ ++use crate::prelude::*; ++ ++pub type c_long = i32; ++pub type c_ulong = u32; ++pub type nlink_t = u32; ++pub type blksize_t = c_long; ++pub type __u64 = c_ulonglong; ++pub type __s64 = c_longlong; ++pub type regoff_t = c_int; ++ ++s! { ++ pub struct pthread_attr_t { ++ __size: [u32; 9], ++ } ++ ++ pub struct sigset_t { ++ __val: [c_ulong; 32], ++ } ++ ++ pub struct msghdr { ++ pub msg_name: *mut c_void, ++ pub msg_namelen: crate::socklen_t, ++ pub msg_iov: *mut crate::iovec, ++ pub msg_iovlen: c_int, ++ pub msg_control: *mut c_void, ++ pub msg_controllen: crate::socklen_t, ++ pub msg_flags: c_int, ++ } ++ ++ pub struct cmsghdr { ++ pub cmsg_len: crate::socklen_t, ++ pub cmsg_level: c_int, ++ pub cmsg_type: c_int, ++ } ++ ++ pub struct sem_t { ++ __val: [c_int; 4], ++ } ++} ++ ++pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 32; ++pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 24; ++pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 20; ++ ++cfg_if! { ++ if #[cfg(any(target_arch = "x86"))] { ++ mod x86; ++ pub use self::x86::*; ++ } else if #[cfg(any(target_arch = "mips"))] { ++ mod mips; ++ pub use self::mips::*; ++ } else if #[cfg(any(target_arch = "arm"))] { ++ mod arm; ++ pub use self::arm::*; ++ } else if #[cfg(any(target_arch = "powerpc"))] { ++ mod powerpc; ++ pub use self::powerpc::*; ++ } else if #[cfg(any(target_arch = "hexagon"))] { ++ mod hexagon; ++ pub use self::hexagon::*; ++ } else if #[cfg(any(target_arch = "riscv32"))] { ++ mod riscv32; ++ pub use self::riscv32::*; ++ } else { ++ // Unknown target_arch ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b32/powerpc.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b32/powerpc.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b32/powerpc.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b32/powerpc.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,749 @@ ++use crate::off_t; ++use crate::prelude::*; ++ ++pub type c_char = u8; ++pub type wchar_t = i32; ++ ++s! { ++ pub struct stat { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ __st_rdev_padding: c_short, ++ pub st_size: off_t, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ __unused: [c_long; 2], ++ } ++ ++ pub struct stat64 { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ __st_rdev_padding: c_short, ++ pub st_size: off_t, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ __unused: [c_long; 2], ++ } ++ ++ pub struct stack_t { ++ pub ss_sp: *mut c_void, ++ pub ss_flags: c_int, ++ pub ss_size: size_t, ++ } ++ ++ pub struct ipc_perm { ++ pub __ipc_perm_key: crate::key_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub cuid: crate::uid_t, ++ pub cgid: crate::gid_t, ++ pub mode: crate::mode_t, ++ pub __seq: c_int, ++ __pad1: c_int, ++ __pad2: c_longlong, ++ __pad3: c_longlong, ++ } ++ ++ pub struct shmid_ds { ++ pub shm_perm: crate::ipc_perm, ++ __unused1: c_int, ++ pub shm_atime: crate::time_t, ++ __unused2: c_int, ++ pub shm_dtime: crate::time_t, ++ __unused3: c_int, ++ pub shm_ctime: crate::time_t, ++ __unused4: c_int, ++ pub shm_segsz: size_t, ++ pub shm_cpid: crate::pid_t, ++ pub shm_lpid: crate::pid_t, ++ pub shm_nattch: c_ulong, ++ __pad1: c_ulong, ++ __pad2: c_ulong, ++ } ++ ++ pub struct msqid_ds { ++ pub msg_perm: crate::ipc_perm, ++ __unused1: c_int, ++ pub msg_stime: crate::time_t, ++ __unused2: c_int, ++ pub msg_rtime: crate::time_t, ++ __unused3: c_int, ++ pub msg_ctime: crate::time_t, ++ __msg_cbytes: c_ulong, ++ pub msg_qnum: crate::msgqnum_t, ++ pub msg_qbytes: crate::msglen_t, ++ pub msg_lspid: crate::pid_t, ++ pub msg_lrpid: crate::pid_t, ++ __pad1: c_ulong, ++ __pad2: c_ulong, ++ } ++} ++ ++pub const MADV_SOFT_OFFLINE: c_int = 101; ++pub const SIGSTKSZ: size_t = 10240; ++pub const MINSIGSTKSZ: size_t = 4096; ++ ++pub const O_DIRECT: c_int = 0x20000; ++pub const O_DIRECTORY: c_int = 0x4000; ++pub const O_NOFOLLOW: c_int = 0x8000; ++pub const O_ASYNC: c_int = 0x2000; ++pub const O_LARGEFILE: c_int = 0x10000; ++ ++pub const MCL_CURRENT: c_int = 0x2000; ++pub const MCL_FUTURE: c_int = 0x4000; ++pub const MCL_ONFAULT: c_int = 0x8000; ++pub const CBAUD: crate::tcflag_t = 0o0000377; ++pub const TAB1: c_int = 0x00000400; ++pub const TAB2: c_int = 0x00000800; ++pub const TAB3: c_int = 0x00000C00; ++pub const CR1: c_int = 0x00001000; ++pub const CR2: c_int = 0x00002000; ++pub const CR3: c_int = 0x00003000; ++pub const FF1: c_int = 0x00004000; ++pub const BS1: c_int = 0x00008000; ++pub const VT1: c_int = 0x00010000; ++pub const VWERASE: usize = 10; ++pub const VREPRINT: usize = 11; ++pub const VSUSP: usize = 12; ++pub const VSTART: usize = 13; ++pub const VSTOP: usize = 14; ++pub const VDISCARD: usize = 16; ++pub const VTIME: usize = 7; ++pub const IXON: crate::tcflag_t = 0x00000200; ++pub const IXOFF: crate::tcflag_t = 0x00000400; ++pub const ONLCR: crate::tcflag_t = 0x00000002; ++pub const CSIZE: crate::tcflag_t = 0x00000300; ++pub const CS6: crate::tcflag_t = 0x00000100; ++pub const CS7: crate::tcflag_t = 0x00000200; ++pub const CS8: crate::tcflag_t = 0x00000300; ++pub const CSTOPB: crate::tcflag_t = 0x00000400; ++pub const CREAD: crate::tcflag_t = 0x00000800; ++pub const PARENB: crate::tcflag_t = 0x00001000; ++pub const PARODD: crate::tcflag_t = 0x00002000; ++pub const HUPCL: crate::tcflag_t = 0x00004000; ++pub const CLOCAL: crate::tcflag_t = 0x00008000; ++pub const ECHOKE: crate::tcflag_t = 0x00000001; ++pub const ECHOE: crate::tcflag_t = 0x00000002; ++pub const ECHOK: crate::tcflag_t = 0x00000004; ++pub const ECHONL: crate::tcflag_t = 0x00000010; ++pub const ECHOPRT: crate::tcflag_t = 0x00000020; ++pub const ECHOCTL: crate::tcflag_t = 0x00000040; ++pub const ISIG: crate::tcflag_t = 0x00000080; ++pub const ICANON: crate::tcflag_t = 0x00000100; ++pub const PENDIN: crate::tcflag_t = 0x20000000; ++pub const NOFLSH: crate::tcflag_t = 0x80000000; ++pub const CIBAUD: crate::tcflag_t = 0o00077600000; ++pub const CBAUDEX: crate::tcflag_t = 0o000020; ++pub const VSWTC: usize = 9; ++pub const OLCUC: crate::tcflag_t = 0o000004; ++pub const NLDLY: crate::tcflag_t = 0o001400; ++pub const CRDLY: crate::tcflag_t = 0o030000; ++pub const TABDLY: crate::tcflag_t = 0o006000; ++pub const BSDLY: crate::tcflag_t = 0o100000; ++pub const FFDLY: crate::tcflag_t = 0o040000; ++pub const VTDLY: crate::tcflag_t = 0o200000; ++pub const XTABS: crate::tcflag_t = 0o006000; ++pub const B57600: crate::speed_t = 0o000020; ++pub const B115200: crate::speed_t = 0o000021; ++pub const B230400: crate::speed_t = 0o000022; ++pub const B460800: crate::speed_t = 0o000023; ++pub const B500000: crate::speed_t = 0o000024; ++pub const B576000: crate::speed_t = 0o000025; ++pub const B921600: crate::speed_t = 0o000026; ++pub const B1000000: crate::speed_t = 0o000027; ++pub const B1152000: crate::speed_t = 0o000030; ++pub const B1500000: crate::speed_t = 0o000031; ++pub const B2000000: crate::speed_t = 0o000032; ++pub const B2500000: crate::speed_t = 0o000033; ++pub const B3000000: crate::speed_t = 0o000034; ++pub const B3500000: crate::speed_t = 0o000035; ++pub const B4000000: crate::speed_t = 0o000036; ++ ++pub const O_APPEND: c_int = 1024; ++pub const O_CREAT: c_int = 64; ++pub const O_EXCL: c_int = 128; ++pub const O_NOCTTY: c_int = 256; ++pub const O_NONBLOCK: c_int = 2048; ++pub const O_SYNC: c_int = 1052672; ++pub const O_RSYNC: c_int = 1052672; ++pub const O_DSYNC: c_int = 4096; ++ ++pub const MAP_ANON: c_int = 0x0020; ++pub const MAP_GROWSDOWN: c_int = 0x0100; ++pub const MAP_DENYWRITE: c_int = 0x0800; ++pub const MAP_EXECUTABLE: c_int = 0x01000; ++pub const MAP_LOCKED: c_int = 0x00080; ++pub const MAP_NORESERVE: c_int = 0x00040; ++pub const MAP_POPULATE: c_int = 0x08000; ++pub const MAP_NONBLOCK: c_int = 0x010000; ++pub const MAP_STACK: c_int = 0x020000; ++pub const MAP_HUGETLB: c_int = 0x040000; ++pub const MAP_SYNC: c_int = 0x080000; ++ ++pub const PTRACE_SYSEMU: c_int = 0x1d; ++pub const PTRACE_SYSEMU_SINGLESTEP: c_int = 0x1e; ++ ++pub const SOCK_STREAM: c_int = 1; ++pub const SOCK_DGRAM: c_int = 2; ++ ++pub const EDEADLK: c_int = 35; ++pub const ENAMETOOLONG: c_int = 36; ++pub const ENOLCK: c_int = 37; ++pub const ENOSYS: c_int = 38; ++pub const ENOTEMPTY: c_int = 39; ++pub const ELOOP: c_int = 40; ++pub const ENOMSG: c_int = 42; ++pub const EIDRM: c_int = 43; ++pub const ECHRNG: c_int = 44; ++pub const EL2NSYNC: c_int = 45; ++pub const EL3HLT: c_int = 46; ++pub const EL3RST: c_int = 47; ++pub const ELNRNG: c_int = 48; ++pub const EUNATCH: c_int = 49; ++pub const ENOCSI: c_int = 50; ++pub const EL2HLT: c_int = 51; ++pub const EBADE: c_int = 52; ++pub const EBADR: c_int = 53; ++pub const EXFULL: c_int = 54; ++pub const ENOANO: c_int = 55; ++pub const EBADRQC: c_int = 56; ++pub const EBADSLT: c_int = 57; ++pub const EDEADLOCK: c_int = 58; ++pub const EMULTIHOP: c_int = 72; ++pub const EBADMSG: c_int = 74; ++pub const EOVERFLOW: c_int = 75; ++pub const ENOTUNIQ: c_int = 76; ++pub const EBADFD: c_int = 77; ++pub const EREMCHG: c_int = 78; ++pub const ELIBACC: c_int = 79; ++pub const ELIBBAD: c_int = 80; ++pub const ELIBSCN: c_int = 81; ++pub const ELIBMAX: c_int = 82; ++pub const ELIBEXEC: c_int = 83; ++pub const EILSEQ: c_int = 84; ++pub const ERESTART: c_int = 85; ++pub const ESTRPIPE: c_int = 86; ++pub const EUSERS: c_int = 87; ++pub const ENOTSOCK: c_int = 88; ++pub const EDESTADDRREQ: c_int = 89; ++pub const EMSGSIZE: c_int = 90; ++pub const EPROTOTYPE: c_int = 91; ++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 EADDRINUSE: c_int = 98; ++pub const EADDRNOTAVAIL: c_int = 99; ++pub const ENETDOWN: c_int = 100; ++pub const ENETUNREACH: c_int = 101; ++pub const ENETRESET: c_int = 102; ++pub const ECONNABORTED: c_int = 103; ++pub const ECONNRESET: c_int = 104; ++pub const ENOBUFS: c_int = 105; ++pub const EISCONN: c_int = 106; ++pub const ENOTCONN: c_int = 107; ++pub const ESHUTDOWN: c_int = 108; ++pub const ETOOMANYREFS: c_int = 109; ++pub const ETIMEDOUT: c_int = 110; ++pub const ECONNREFUSED: c_int = 111; ++pub const EHOSTDOWN: c_int = 112; ++pub const EHOSTUNREACH: c_int = 113; ++pub const EALREADY: c_int = 114; ++pub const EINPROGRESS: c_int = 115; ++pub const ESTALE: c_int = 116; ++pub const EUCLEAN: c_int = 117; ++pub const ENOTNAM: c_int = 118; ++pub const ENAVAIL: c_int = 119; ++pub const EISNAM: c_int = 120; ++pub const EREMOTEIO: c_int = 121; ++pub const EDQUOT: c_int = 122; ++pub const ENOMEDIUM: c_int = 123; ++pub const EMEDIUMTYPE: c_int = 124; ++pub const ECANCELED: c_int = 125; ++pub const ENOKEY: c_int = 126; ++pub const EKEYEXPIRED: c_int = 127; ++pub const EKEYREVOKED: c_int = 128; ++pub const EKEYREJECTED: c_int = 129; ++pub const EOWNERDEAD: c_int = 130; ++pub const ENOTRECOVERABLE: c_int = 131; ++pub const ERFKILL: c_int = 132; ++pub const EHWPOISON: c_int = 133; ++ ++pub const SA_ONSTACK: c_int = 0x08000000; ++pub const SA_SIGINFO: c_int = 0x00000004; ++pub const SA_NOCLDWAIT: c_int = 0x00000002; ++ ++pub const SIGCHLD: c_int = 17; ++pub const SIGBUS: c_int = 7; ++pub const SIGTTIN: c_int = 21; ++pub const SIGTTOU: c_int = 22; ++pub const SIGXCPU: c_int = 24; ++pub const SIGXFSZ: c_int = 25; ++pub const SIGVTALRM: c_int = 26; ++pub const SIGPROF: c_int = 27; ++pub const SIGWINCH: c_int = 28; ++pub const SIGUSR1: c_int = 10; ++pub const SIGUSR2: c_int = 12; ++pub const SIGCONT: c_int = 18; ++pub const SIGSTOP: c_int = 19; ++pub const SIGTSTP: c_int = 20; ++pub const SIGURG: c_int = 23; ++pub const SIGIO: c_int = 29; ++pub const SIGSYS: c_int = 31; ++pub const SIGSTKFLT: c_int = 16; ++pub const SIGPOLL: c_int = 29; ++pub const SIGPWR: c_int = 30; ++pub const SIG_SETMASK: c_int = 2; ++pub const SIG_BLOCK: c_int = 0x000000; ++pub const SIG_UNBLOCK: c_int = 0x01; ++ ++pub const EXTPROC: crate::tcflag_t = 0x10000000; ++ ++pub const F_GETLK: c_int = 12; ++pub const F_GETOWN: c_int = 9; ++pub const F_SETLK: c_int = 13; ++pub const F_SETLKW: c_int = 14; ++pub const F_SETOWN: c_int = 8; ++ ++pub const VEOF: usize = 4; ++pub const VEOL: usize = 6; ++pub const VEOL2: usize = 8; ++pub const VMIN: usize = 5; ++pub const IEXTEN: crate::tcflag_t = 0x00000400; ++pub const TOSTOP: crate::tcflag_t = 0x00400000; ++pub const FLUSHO: crate::tcflag_t = 0x00800000; ++ ++pub const POLLWRNORM: c_short = 0x100; ++pub const POLLWRBAND: c_short = 0x200; ++ ++// Syscall table ++pub const SYS_restart_syscall: c_long = 0; ++pub const SYS_exit: c_long = 1; ++pub const SYS_fork: c_long = 2; ++pub const SYS_read: c_long = 3; ++pub const SYS_write: c_long = 4; ++pub const SYS_open: c_long = 5; ++pub const SYS_close: c_long = 6; ++pub const SYS_waitpid: c_long = 7; ++pub const SYS_creat: c_long = 8; ++pub const SYS_link: c_long = 9; ++pub const SYS_unlink: c_long = 10; ++pub const SYS_execve: c_long = 11; ++pub const SYS_chdir: c_long = 12; ++pub const SYS_time: c_long = 13; ++pub const SYS_mknod: c_long = 14; ++pub const SYS_chmod: c_long = 15; ++pub const SYS_lchown: c_long = 16; ++pub const SYS_break: c_long = 17; ++pub const SYS_oldstat: c_long = 18; ++pub const SYS_lseek: c_long = 19; ++pub const SYS_getpid: c_long = 20; ++pub const SYS_mount: c_long = 21; ++pub const SYS_umount: c_long = 22; ++pub const SYS_setuid: c_long = 23; ++pub const SYS_getuid: c_long = 24; ++pub const SYS_stime: c_long = 25; ++pub const SYS_ptrace: c_long = 26; ++pub const SYS_alarm: c_long = 27; ++pub const SYS_oldfstat: c_long = 28; ++pub const SYS_pause: c_long = 29; ++pub const SYS_utime: c_long = 30; ++pub const SYS_stty: c_long = 31; ++pub const SYS_gtty: c_long = 32; ++pub const SYS_access: c_long = 33; ++pub const SYS_nice: c_long = 34; ++pub const SYS_ftime: c_long = 35; ++pub const SYS_sync: c_long = 36; ++pub const SYS_kill: c_long = 37; ++pub const SYS_rename: c_long = 38; ++pub const SYS_mkdir: c_long = 39; ++pub const SYS_rmdir: c_long = 40; ++pub const SYS_dup: c_long = 41; ++pub const SYS_pipe: c_long = 42; ++pub const SYS_times: c_long = 43; ++pub const SYS_prof: c_long = 44; ++pub const SYS_brk: c_long = 45; ++pub const SYS_setgid: c_long = 46; ++pub const SYS_getgid: c_long = 47; ++pub const SYS_signal: c_long = 48; ++pub const SYS_geteuid: c_long = 49; ++pub const SYS_getegid: c_long = 50; ++pub const SYS_acct: c_long = 51; ++pub const SYS_umount2: c_long = 52; ++pub const SYS_lock: c_long = 53; ++pub const SYS_ioctl: c_long = 54; ++pub const SYS_fcntl: c_long = 55; ++pub const SYS_mpx: c_long = 56; ++pub const SYS_setpgid: c_long = 57; ++pub const SYS_ulimit: c_long = 58; ++pub const SYS_oldolduname: c_long = 59; ++pub const SYS_umask: c_long = 60; ++pub const SYS_chroot: c_long = 61; ++pub const SYS_ustat: c_long = 62; ++pub const SYS_dup2: c_long = 63; ++pub const SYS_getppid: c_long = 64; ++pub const SYS_getpgrp: c_long = 65; ++pub const SYS_setsid: c_long = 66; ++pub const SYS_sigaction: c_long = 67; ++pub const SYS_sgetmask: c_long = 68; ++pub const SYS_ssetmask: c_long = 69; ++pub const SYS_setreuid: c_long = 70; ++pub const SYS_setregid: c_long = 71; ++pub const SYS_sigsuspend: c_long = 72; ++pub const SYS_sigpending: c_long = 73; ++pub const SYS_sethostname: c_long = 74; ++pub const SYS_setrlimit: c_long = 75; ++pub const SYS_getrlimit: c_long = 76; ++pub const SYS_getrusage: c_long = 77; ++pub const SYS_gettimeofday: c_long = 78; ++pub const SYS_settimeofday: c_long = 79; ++pub const SYS_getgroups: c_long = 80; ++pub const SYS_setgroups: c_long = 81; ++pub const SYS_select: c_long = 82; ++pub const SYS_symlink: c_long = 83; ++pub const SYS_oldlstat: c_long = 84; ++pub const SYS_readlink: c_long = 85; ++pub const SYS_uselib: c_long = 86; ++pub const SYS_swapon: c_long = 87; ++pub const SYS_reboot: c_long = 88; ++pub const SYS_readdir: c_long = 89; ++pub const SYS_mmap: c_long = 90; ++pub const SYS_munmap: c_long = 91; ++pub const SYS_truncate: c_long = 92; ++pub const SYS_ftruncate: c_long = 93; ++pub const SYS_fchmod: c_long = 94; ++pub const SYS_fchown: c_long = 95; ++pub const SYS_getpriority: c_long = 96; ++pub const SYS_setpriority: c_long = 97; ++pub const SYS_profil: c_long = 98; ++pub const SYS_statfs: c_long = 99; ++pub const SYS_fstatfs: c_long = 100; ++pub const SYS_ioperm: c_long = 101; ++pub const SYS_socketcall: c_long = 102; ++pub const SYS_syslog: c_long = 103; ++pub const SYS_setitimer: c_long = 104; ++pub const SYS_getitimer: c_long = 105; ++pub const SYS_stat: c_long = 106; ++pub const SYS_lstat: c_long = 107; ++pub const SYS_fstat: c_long = 108; ++pub const SYS_olduname: c_long = 109; ++pub const SYS_iopl: c_long = 110; ++pub const SYS_vhangup: c_long = 111; ++pub const SYS_idle: c_long = 112; ++pub const SYS_vm86: c_long = 113; ++pub const SYS_wait4: c_long = 114; ++pub const SYS_swapoff: c_long = 115; ++pub const SYS_sysinfo: c_long = 116; ++pub const SYS_ipc: c_long = 117; ++pub const SYS_fsync: c_long = 118; ++pub const SYS_sigreturn: c_long = 119; ++pub const SYS_clone: c_long = 120; ++pub const SYS_setdomainname: c_long = 121; ++pub const SYS_uname: c_long = 122; ++pub const SYS_modify_ldt: c_long = 123; ++pub const SYS_adjtimex: c_long = 124; ++pub const SYS_mprotect: c_long = 125; ++pub const SYS_sigprocmask: c_long = 126; ++pub const SYS_create_module: c_long = 127; ++pub const SYS_init_module: c_long = 128; ++pub const SYS_delete_module: c_long = 129; ++pub const SYS_get_kernel_syms: c_long = 130; ++pub const SYS_quotactl: c_long = 131; ++pub const SYS_getpgid: c_long = 132; ++pub const SYS_fchdir: c_long = 133; ++pub const SYS_bdflush: c_long = 134; ++pub const SYS_sysfs: c_long = 135; ++pub const SYS_personality: c_long = 136; ++pub const SYS_afs_syscall: c_long = 137; ++pub const SYS_setfsuid: c_long = 138; ++pub const SYS_setfsgid: c_long = 139; ++pub const SYS__llseek: c_long = 140; ++pub const SYS_getdents: c_long = 141; ++pub const SYS__newselect: c_long = 142; ++pub const SYS_flock: c_long = 143; ++pub const SYS_msync: c_long = 144; ++pub const SYS_readv: c_long = 145; ++pub const SYS_writev: c_long = 146; ++pub const SYS_getsid: c_long = 147; ++pub const SYS_fdatasync: c_long = 148; ++pub const SYS__sysctl: c_long = 149; ++pub const SYS_mlock: c_long = 150; ++pub const SYS_munlock: c_long = 151; ++pub const SYS_mlockall: c_long = 152; ++pub const SYS_munlockall: c_long = 153; ++pub const SYS_sched_setparam: c_long = 154; ++pub const SYS_sched_getparam: c_long = 155; ++pub const SYS_sched_setscheduler: c_long = 156; ++pub const SYS_sched_getscheduler: c_long = 157; ++pub const SYS_sched_yield: c_long = 158; ++pub const SYS_sched_get_priority_max: c_long = 159; ++pub const SYS_sched_get_priority_min: c_long = 160; ++pub const SYS_sched_rr_get_interval: c_long = 161; ++pub const SYS_nanosleep: c_long = 162; ++pub const SYS_mremap: c_long = 163; ++pub const SYS_setresuid: c_long = 164; ++pub const SYS_getresuid: c_long = 165; ++pub const SYS_query_module: c_long = 166; ++pub const SYS_poll: c_long = 167; ++pub const SYS_nfsservctl: c_long = 168; ++pub const SYS_setresgid: c_long = 169; ++pub const SYS_getresgid: c_long = 170; ++pub const SYS_prctl: c_long = 171; ++pub const SYS_rt_sigreturn: c_long = 172; ++pub const SYS_rt_sigaction: c_long = 173; ++pub const SYS_rt_sigprocmask: c_long = 174; ++pub const SYS_rt_sigpending: c_long = 175; ++pub const SYS_rt_sigtimedwait: c_long = 176; ++pub const SYS_rt_sigqueueinfo: c_long = 177; ++pub const SYS_rt_sigsuspend: c_long = 178; ++pub const SYS_pread64: c_long = 179; ++pub const SYS_pwrite64: c_long = 180; ++pub const SYS_chown: c_long = 181; ++pub const SYS_getcwd: c_long = 182; ++pub const SYS_capget: c_long = 183; ++pub const SYS_capset: c_long = 184; ++pub const SYS_sigaltstack: c_long = 185; ++pub const SYS_sendfile: c_long = 186; ++pub const SYS_getpmsg: c_long = 187; ++pub const SYS_putpmsg: c_long = 188; ++pub const SYS_vfork: c_long = 189; ++pub const SYS_ugetrlimit: c_long = 190; ++pub const SYS_readahead: c_long = 191; ++pub const SYS_mmap2: c_long = 192; ++pub const SYS_truncate64: c_long = 193; ++pub const SYS_ftruncate64: c_long = 194; ++pub const SYS_stat64: c_long = 195; ++pub const SYS_lstat64: c_long = 196; ++pub const SYS_fstat64: c_long = 197; ++pub const SYS_pciconfig_read: c_long = 198; ++pub const SYS_pciconfig_write: c_long = 199; ++pub const SYS_pciconfig_iobase: c_long = 200; ++pub const SYS_multiplexer: c_long = 201; ++pub const SYS_getdents64: c_long = 202; ++pub const SYS_pivot_root: c_long = 203; ++pub const SYS_fcntl64: c_long = 204; ++pub const SYS_madvise: c_long = 205; ++pub const SYS_mincore: c_long = 206; ++pub const SYS_gettid: c_long = 207; ++pub const SYS_tkill: c_long = 208; ++pub const SYS_setxattr: c_long = 209; ++pub const SYS_lsetxattr: c_long = 210; ++pub const SYS_fsetxattr: c_long = 211; ++pub const SYS_getxattr: c_long = 212; ++pub const SYS_lgetxattr: c_long = 213; ++pub const SYS_fgetxattr: c_long = 214; ++pub const SYS_listxattr: c_long = 215; ++pub const SYS_llistxattr: c_long = 216; ++pub const SYS_flistxattr: c_long = 217; ++pub const SYS_removexattr: c_long = 218; ++pub const SYS_lremovexattr: c_long = 219; ++pub const SYS_fremovexattr: c_long = 220; ++pub const SYS_futex: c_long = 221; ++pub const SYS_sched_setaffinity: c_long = 222; ++pub const SYS_sched_getaffinity: c_long = 223; ++pub const SYS_tuxcall: c_long = 225; ++pub const SYS_sendfile64: c_long = 226; ++pub const SYS_io_setup: c_long = 227; ++pub const SYS_io_destroy: c_long = 228; ++pub const SYS_io_getevents: c_long = 229; ++pub const SYS_io_submit: c_long = 230; ++pub const SYS_io_cancel: c_long = 231; ++pub const SYS_set_tid_address: c_long = 232; ++pub const SYS_fadvise64: c_long = 233; ++pub const SYS_exit_group: c_long = 234; ++pub const SYS_lookup_dcookie: c_long = 235; ++pub const SYS_epoll_create: c_long = 236; ++pub const SYS_epoll_ctl: c_long = 237; ++pub const SYS_epoll_wait: c_long = 238; ++pub const SYS_remap_file_pages: c_long = 239; ++pub const SYS_timer_create: c_long = 240; ++pub const SYS_timer_settime: c_long = 241; ++pub const SYS_timer_gettime: c_long = 242; ++pub const SYS_timer_getoverrun: c_long = 243; ++pub const SYS_timer_delete: c_long = 244; ++pub const SYS_clock_settime: c_long = 245; ++pub const SYS_clock_gettime: c_long = 246; ++pub const SYS_clock_getres: c_long = 247; ++pub const SYS_clock_nanosleep: c_long = 248; ++pub const SYS_swapcontext: c_long = 249; ++pub const SYS_tgkill: c_long = 250; ++pub const SYS_utimes: c_long = 251; ++pub const SYS_statfs64: c_long = 252; ++pub const SYS_fstatfs64: c_long = 253; ++pub const SYS_fadvise64_64: c_long = 254; ++pub const SYS_rtas: c_long = 255; ++pub const SYS_sys_debug_setcontext: c_long = 256; ++pub const SYS_migrate_pages: c_long = 258; ++pub const SYS_mbind: c_long = 259; ++pub const SYS_get_mempolicy: c_long = 260; ++pub const SYS_set_mempolicy: c_long = 261; ++pub const SYS_mq_open: c_long = 262; ++pub const SYS_mq_unlink: c_long = 263; ++pub const SYS_mq_timedsend: c_long = 264; ++pub const SYS_mq_timedreceive: c_long = 265; ++pub const SYS_mq_notify: c_long = 266; ++pub const SYS_mq_getsetattr: c_long = 267; ++pub const SYS_kexec_load: c_long = 268; ++pub const SYS_add_key: c_long = 269; ++pub const SYS_request_key: c_long = 270; ++pub const SYS_keyctl: c_long = 271; ++pub const SYS_waitid: c_long = 272; ++pub const SYS_ioprio_set: c_long = 273; ++pub const SYS_ioprio_get: c_long = 274; ++pub const SYS_inotify_init: c_long = 275; ++pub const SYS_inotify_add_watch: c_long = 276; ++pub const SYS_inotify_rm_watch: c_long = 277; ++pub const SYS_spu_run: c_long = 278; ++pub const SYS_spu_create: c_long = 279; ++pub const SYS_pselect6: c_long = 280; ++pub const SYS_ppoll: c_long = 281; ++pub const SYS_unshare: c_long = 282; ++pub const SYS_splice: c_long = 283; ++pub const SYS_tee: c_long = 284; ++pub const SYS_vmsplice: c_long = 285; ++pub const SYS_openat: c_long = 286; ++pub const SYS_mkdirat: c_long = 287; ++pub const SYS_mknodat: c_long = 288; ++pub const SYS_fchownat: c_long = 289; ++pub const SYS_futimesat: c_long = 290; ++pub const SYS_fstatat64: c_long = 291; ++pub const SYS_unlinkat: c_long = 292; ++pub const SYS_renameat: c_long = 293; ++pub const SYS_linkat: c_long = 294; ++pub const SYS_symlinkat: c_long = 295; ++pub const SYS_readlinkat: c_long = 296; ++pub const SYS_fchmodat: c_long = 297; ++pub const SYS_faccessat: c_long = 298; ++pub const SYS_get_robust_list: c_long = 299; ++pub const SYS_set_robust_list: c_long = 300; ++pub const SYS_move_pages: c_long = 301; ++pub const SYS_getcpu: c_long = 302; ++pub const SYS_epoll_pwait: c_long = 303; ++pub const SYS_utimensat: c_long = 304; ++pub const SYS_signalfd: c_long = 305; ++pub const SYS_timerfd_create: c_long = 306; ++pub const SYS_eventfd: c_long = 307; ++pub const SYS_sync_file_range2: c_long = 308; ++pub const SYS_fallocate: c_long = 309; ++pub const SYS_subpage_prot: c_long = 310; ++pub const SYS_timerfd_settime: c_long = 311; ++pub const SYS_timerfd_gettime: c_long = 312; ++pub const SYS_signalfd4: c_long = 313; ++pub const SYS_eventfd2: c_long = 314; ++pub const SYS_epoll_create1: c_long = 315; ++pub const SYS_dup3: c_long = 316; ++pub const SYS_pipe2: c_long = 317; ++pub const SYS_inotify_init1: c_long = 318; ++pub const SYS_perf_event_open: c_long = 319; ++pub const SYS_preadv: c_long = 320; ++pub const SYS_pwritev: c_long = 321; ++pub const SYS_rt_tgsigqueueinfo: c_long = 322; ++pub const SYS_fanotify_init: c_long = 323; ++pub const SYS_fanotify_mark: c_long = 324; ++pub const SYS_prlimit64: c_long = 325; ++pub const SYS_socket: c_long = 326; ++pub const SYS_bind: c_long = 327; ++pub const SYS_connect: c_long = 328; ++pub const SYS_listen: c_long = 329; ++pub const SYS_accept: c_long = 330; ++pub const SYS_getsockname: c_long = 331; ++pub const SYS_getpeername: c_long = 332; ++pub const SYS_socketpair: c_long = 333; ++pub const SYS_send: c_long = 334; ++pub const SYS_sendto: c_long = 335; ++pub const SYS_recv: c_long = 336; ++pub const SYS_recvfrom: c_long = 337; ++pub const SYS_shutdown: c_long = 338; ++pub const SYS_setsockopt: c_long = 339; ++pub const SYS_getsockopt: c_long = 340; ++pub const SYS_sendmsg: c_long = 341; ++pub const SYS_recvmsg: c_long = 342; ++pub const SYS_recvmmsg: c_long = 343; ++pub const SYS_accept4: c_long = 344; ++pub const SYS_name_to_handle_at: c_long = 345; ++pub const SYS_open_by_handle_at: c_long = 346; ++pub const SYS_clock_adjtime: c_long = 347; ++pub const SYS_syncfs: c_long = 348; ++pub const SYS_sendmmsg: c_long = 349; ++pub const SYS_setns: c_long = 350; ++pub const SYS_process_vm_readv: c_long = 351; ++pub const SYS_process_vm_writev: c_long = 352; ++pub const SYS_finit_module: c_long = 353; ++pub const SYS_kcmp: c_long = 354; ++pub const SYS_sched_setattr: c_long = 355; ++pub const SYS_sched_getattr: c_long = 356; ++pub const SYS_renameat2: c_long = 357; ++pub const SYS_seccomp: c_long = 358; ++pub const SYS_getrandom: c_long = 359; ++pub const SYS_memfd_create: c_long = 360; ++pub const SYS_bpf: c_long = 361; ++pub const SYS_execveat: c_long = 362; ++pub const SYS_switch_endian: c_long = 363; ++pub const SYS_userfaultfd: c_long = 364; ++pub const SYS_membarrier: c_long = 365; ++pub const SYS_mlock2: c_long = 378; ++pub const SYS_copy_file_range: c_long = 379; ++pub const SYS_preadv2: c_long = 380; ++pub const SYS_pwritev2: c_long = 381; ++pub const SYS_kexec_file_load: c_long = 382; ++pub const SYS_statx: c_long = 383; ++pub const SYS_pkey_alloc: c_long = 384; ++pub const SYS_pkey_free: c_long = 385; ++pub const SYS_pkey_mprotect: c_long = 386; ++pub const SYS_pidfd_send_signal: c_long = 424; ++pub const SYS_io_uring_setup: c_long = 425; ++pub const SYS_io_uring_enter: c_long = 426; ++pub const SYS_io_uring_register: c_long = 427; ++pub const SYS_open_tree: c_long = 428; ++pub const SYS_move_mount: c_long = 429; ++pub const SYS_fsopen: c_long = 430; ++pub const SYS_fsconfig: c_long = 431; ++pub const SYS_fsmount: c_long = 432; ++pub const SYS_fspick: c_long = 433; ++pub const SYS_pidfd_open: c_long = 434; ++pub const SYS_clone3: c_long = 435; ++pub const SYS_close_range: c_long = 436; ++pub const SYS_openat2: c_long = 437; ++pub const SYS_pidfd_getfd: c_long = 438; ++pub const SYS_faccessat2: c_long = 439; ++pub const SYS_process_madvise: c_long = 440; ++pub const SYS_epoll_pwait2: c_long = 441; ++pub const SYS_mount_setattr: c_long = 442; ++pub const SYS_quotactl_fd: c_long = 443; ++pub const SYS_landlock_create_ruleset: c_long = 444; ++pub const SYS_landlock_add_rule: c_long = 445; ++pub const SYS_landlock_restrict_self: c_long = 446; ++pub const SYS_memfd_secret: c_long = 447; ++pub const SYS_process_mrelease: c_long = 448; ++pub const SYS_futex_waitv: c_long = 449; ++pub const SYS_set_mempolicy_home_node: c_long = 450; ++pub const SYS_mseal: c_long = 462; ++ ++extern "C" { ++ pub fn getrandom(buf: *mut c_void, buflen: size_t, flags: c_uint) -> ssize_t; ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b32/riscv32/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,640 @@ ++//! RISC-V-specific definitions for 32-bit linux-like values ++ ++use crate::prelude::*; ++use crate::{off64_t, off_t}; ++ ++pub type c_char = u8; ++pub type wchar_t = c_int; ++ ++s! { ++ pub struct stat { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ pub __pad1: crate::dev_t, ++ pub st_size: off_t, ++ pub st_blksize: crate::blksize_t, ++ pub __pad2: c_int, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ __unused: [c_int; 2usize], ++ } ++ ++ pub struct stat64 { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino64_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ pub __pad1: crate::dev_t, ++ pub st_size: off64_t, ++ pub st_blksize: crate::blksize_t, ++ pub __pad2: c_int, ++ pub st_blocks: crate::blkcnt64_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ __unused: [c_int; 2], ++ } ++ ++ pub struct stack_t { ++ pub ss_sp: *mut c_void, ++ pub ss_flags: c_int, ++ pub ss_size: size_t, ++ } ++ ++ pub struct ipc_perm { ++ pub __key: crate::key_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub cuid: crate::uid_t, ++ pub cgid: crate::gid_t, ++ pub mode: c_ushort, ++ __pad1: c_ushort, ++ pub __seq: c_ushort, ++ __pad2: c_ushort, ++ __unused1: c_ulong, ++ __unused2: c_ulong, ++ } ++ ++ pub struct shmid_ds { ++ pub shm_perm: crate::ipc_perm, ++ pub shm_segsz: size_t, ++ pub shm_atime: crate::time_t, ++ pub shm_dtime: crate::time_t, ++ pub shm_ctime: crate::time_t, ++ pub shm_cpid: crate::pid_t, ++ pub shm_lpid: crate::pid_t, ++ pub shm_nattch: crate::shmatt_t, ++ __unused5: c_ulong, ++ __unused6: c_ulong, ++ } ++ ++ pub struct msqid_ds { ++ pub msg_perm: crate::ipc_perm, ++ pub msg_stime: crate::time_t, ++ __unused1: c_int, ++ pub msg_rtime: crate::time_t, ++ __unused2: c_int, ++ pub msg_ctime: crate::time_t, ++ __unused3: c_int, ++ __msg_cbytes: c_ulong, ++ pub msg_qnum: crate::msgqnum_t, ++ pub msg_qbytes: crate::msglen_t, ++ pub msg_lspid: crate::pid_t, ++ pub msg_lrpid: crate::pid_t, ++ __pad1: c_ulong, ++ __pad2: c_ulong, ++ } ++} ++ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ #[repr(align(8))] ++ pub struct max_align_t { ++ priv_: (i64, f64), ++ } ++} ++ ++//pub const RLIM_INFINITY: crate::rlim_t = !0; ++pub const VEOF: usize = 4; ++pub const RTLD_DEEPBIND: c_int = 0x8; ++//pub const RLIMIT_RSS: crate::__rlimit_resource_t = 5; ++//pub const RLIMIT_AS: crate::__rlimit_resource_t = 9; ++//pub const RLIMIT_MEMLOCK: crate::__rlimit_resource_t = 8; ++//pub const RLIMIT_NOFILE: crate::__rlimit_resource_t = 7; ++//pub const RLIMIT_NPROC: crate::__rlimit_resource_t = 6; ++pub const O_APPEND: c_int = 1024; ++pub const O_CREAT: c_int = 64; ++pub const O_EXCL: c_int = 128; ++pub const O_NOCTTY: c_int = 256; ++pub const O_NONBLOCK: c_int = 2048; ++pub const O_SYNC: c_int = 1052672; ++pub const O_RSYNC: c_int = 1052672; ++pub const O_DSYNC: c_int = 4096; ++pub const O_FSYNC: c_int = 1052672; ++pub const MAP_GROWSDOWN: c_int = 256; ++pub const EDEADLK: c_int = 35; ++pub const ENAMETOOLONG: c_int = 36; ++pub const ENOLCK: c_int = 37; ++pub const ENOSYS: c_int = 38; ++pub const ENOTEMPTY: c_int = 39; ++pub const ELOOP: c_int = 40; ++pub const ENOMSG: c_int = 42; ++pub const EIDRM: c_int = 43; ++pub const ECHRNG: c_int = 44; ++pub const EL2NSYNC: c_int = 45; ++pub const EL3HLT: c_int = 46; ++pub const EL3RST: c_int = 47; ++pub const ELNRNG: c_int = 48; ++pub const EUNATCH: c_int = 49; ++pub const ENOCSI: c_int = 50; ++pub const EL2HLT: c_int = 51; ++pub const EBADE: c_int = 52; ++pub const EBADR: c_int = 53; ++pub const EXFULL: c_int = 54; ++pub const ENOANO: c_int = 55; ++pub const EBADRQC: c_int = 56; ++pub const EBADSLT: c_int = 57; ++pub const EMULTIHOP: c_int = 72; ++pub const EOVERFLOW: c_int = 75; ++pub const ENOTUNIQ: c_int = 76; ++pub const EBADFD: c_int = 77; ++pub const EBADMSG: c_int = 74; ++pub const EREMCHG: c_int = 78; ++pub const ELIBACC: c_int = 79; ++pub const ELIBBAD: c_int = 80; ++pub const ELIBSCN: c_int = 81; ++pub const ELIBMAX: c_int = 82; ++pub const ELIBEXEC: c_int = 83; ++pub const EILSEQ: c_int = 84; ++pub const ERESTART: c_int = 85; ++pub const ESTRPIPE: c_int = 86; ++pub const EUSERS: c_int = 87; ++pub const ENOTSOCK: c_int = 88; ++pub const EDESTADDRREQ: c_int = 89; ++pub const EMSGSIZE: c_int = 90; ++pub const EPROTOTYPE: c_int = 91; ++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 EADDRINUSE: c_int = 98; ++pub const EADDRNOTAVAIL: c_int = 99; ++pub const ENETDOWN: c_int = 100; ++pub const ENETUNREACH: c_int = 101; ++pub const ENETRESET: c_int = 102; ++pub const ECONNABORTED: c_int = 103; ++pub const ECONNRESET: c_int = 104; ++pub const ENOBUFS: c_int = 105; ++pub const EISCONN: c_int = 106; ++pub const ENOTCONN: c_int = 107; ++pub const ESHUTDOWN: c_int = 108; ++pub const ETOOMANYREFS: c_int = 109; ++pub const ETIMEDOUT: c_int = 110; ++pub const ECONNREFUSED: c_int = 111; ++pub const EHOSTDOWN: c_int = 112; ++pub const EHOSTUNREACH: c_int = 113; ++pub const EALREADY: c_int = 114; ++pub const EINPROGRESS: c_int = 115; ++pub const ESTALE: c_int = 116; ++pub const EDQUOT: c_int = 122; ++pub const ENOMEDIUM: c_int = 123; ++pub const EMEDIUMTYPE: c_int = 124; ++pub const ECANCELED: c_int = 125; ++pub const ENOKEY: c_int = 126; ++pub const EKEYEXPIRED: c_int = 127; ++pub const EKEYREVOKED: c_int = 128; ++pub const EKEYREJECTED: c_int = 129; ++pub const EOWNERDEAD: c_int = 130; ++pub const ENOTRECOVERABLE: c_int = 131; ++pub const EHWPOISON: c_int = 133; ++pub const ERFKILL: c_int = 132; ++ ++pub const SOCK_STREAM: c_int = 1; ++pub const SOCK_DGRAM: c_int = 2; ++pub const SA_ONSTACK: c_int = 8; ++pub const SA_SIGINFO: c_int = 4; ++pub const SA_NOCLDWAIT: c_int = 2; ++pub const SIGTTIN: c_int = 21; ++pub const SIGTTOU: c_int = 22; ++pub const SIGXCPU: c_int = 24; ++pub const SIGXFSZ: c_int = 25; ++pub const SIGVTALRM: c_int = 26; ++pub const SIGPROF: c_int = 27; ++pub const SIGWINCH: c_int = 28; ++pub const SIGCHLD: c_int = 17; ++pub const SIGBUS: c_int = 7; ++pub const SIGUSR1: c_int = 10; ++pub const SIGUSR2: c_int = 12; ++pub const SIGCONT: c_int = 18; ++pub const SIGSTOP: c_int = 19; ++pub const SIGTSTP: c_int = 20; ++pub const SIGURG: c_int = 23; ++pub const SIGIO: c_int = 29; ++pub const SIGSYS: c_int = 31; ++pub const SIGSTKFLT: c_int = 16; ++pub const SIGPOLL: c_int = 29; ++pub const SIGPWR: c_int = 30; ++pub const SIG_SETMASK: c_int = 2; ++pub const SIG_BLOCK: c_int = 0; ++pub const SIG_UNBLOCK: c_int = 1; ++pub const POLLWRNORM: c_short = 256; ++pub const POLLWRBAND: c_short = 512; ++pub const O_ASYNC: c_int = 8192; ++pub const F_SETOWN: c_int = 8; ++pub const F_GETOWN: c_int = 9; ++pub const F_GETLK: c_int = 12; ++pub const F_SETLK: c_int = 13; ++pub const F_SETLKW: c_int = 14; ++ ++pub const O_DIRECT: c_int = 16384; ++pub const O_DIRECTORY: c_int = 65536; ++pub const O_LARGEFILE: c_int = 0o0100000; ++pub const O_NOFOLLOW: c_int = 131072; ++pub const MAP_HUGETLB: c_int = 262144; ++pub const MAP_LOCKED: c_int = 8192; ++pub const MAP_NORESERVE: c_int = 16384; ++pub const MAP_ANON: c_int = 32; ++pub const MAP_DENYWRITE: c_int = 2048; ++pub const MAP_EXECUTABLE: c_int = 4096; ++pub const MAP_POPULATE: c_int = 32768; ++pub const MAP_NONBLOCK: c_int = 65536; ++pub const MAP_STACK: c_int = 131072; ++pub const MAP_SYNC: c_int = 0x080000; ++pub const EDEADLOCK: c_int = 35; ++pub const EUCLEAN: c_int = 117; ++pub const ENOTNAM: c_int = 118; ++pub const ENAVAIL: c_int = 119; ++pub const EISNAM: c_int = 120; ++pub const EREMOTEIO: c_int = 121; ++pub const MCL_CURRENT: c_int = 1; ++pub const MCL_FUTURE: c_int = 2; ++pub const MCL_ONFAULT: c_int = 4; ++pub const SIGSTKSZ: size_t = 8192; ++pub const MINSIGSTKSZ: size_t = 2048; ++pub const CBAUD: crate::tcflag_t = 4111; ++pub const TAB1: crate::tcflag_t = 2048; ++pub const TAB2: crate::tcflag_t = 4096; ++pub const TAB3: crate::tcflag_t = 6144; ++pub const CR1: crate::tcflag_t = 512; ++pub const CR2: crate::tcflag_t = 1024; ++pub const CR3: crate::tcflag_t = 1536; ++pub const FF1: crate::tcflag_t = 32768; ++pub const BS1: crate::tcflag_t = 8192; ++pub const VT1: crate::tcflag_t = 16384; ++pub const VWERASE: usize = 14; ++pub const VREPRINT: usize = 12; ++pub const VSUSP: usize = 10; ++pub const VSTART: usize = 8; ++pub const VSTOP: usize = 9; ++pub const VDISCARD: usize = 13; ++pub const VTIME: usize = 5; ++pub const IXON: crate::tcflag_t = 1024; ++pub const IXOFF: crate::tcflag_t = 4096; ++pub const ONLCR: crate::tcflag_t = 4; ++pub const CSIZE: crate::tcflag_t = 48; ++pub const CS6: crate::tcflag_t = 16; ++pub const CS7: crate::tcflag_t = 32; ++pub const CS8: crate::tcflag_t = 48; ++pub const CSTOPB: crate::tcflag_t = 64; ++pub const CREAD: crate::tcflag_t = 128; ++pub const PARENB: crate::tcflag_t = 256; ++pub const PARODD: crate::tcflag_t = 512; ++pub const HUPCL: crate::tcflag_t = 1024; ++pub const CLOCAL: crate::tcflag_t = 2048; ++pub const ECHOKE: crate::tcflag_t = 2048; ++pub const ECHOE: crate::tcflag_t = 16; ++pub const ECHOK: crate::tcflag_t = 32; ++pub const ECHONL: crate::tcflag_t = 64; ++pub const ECHOPRT: crate::tcflag_t = 1024; ++pub const ECHOCTL: crate::tcflag_t = 512; ++pub const ISIG: crate::tcflag_t = 1; ++pub const ICANON: crate::tcflag_t = 2; ++pub const PENDIN: crate::tcflag_t = 16384; ++pub const NOFLSH: crate::tcflag_t = 128; ++pub const CIBAUD: crate::tcflag_t = 269418496; ++pub const CBAUDEX: crate::tcflag_t = 4096; ++pub const VSWTC: usize = 7; ++pub const OLCUC: crate::tcflag_t = 2; ++pub const NLDLY: crate::tcflag_t = 256; ++pub const CRDLY: crate::tcflag_t = 1536; ++pub const TABDLY: crate::tcflag_t = 6144; ++pub const BSDLY: crate::tcflag_t = 8192; ++pub const FFDLY: crate::tcflag_t = 32768; ++pub const VTDLY: crate::tcflag_t = 16384; ++pub const XTABS: crate::tcflag_t = 6144; ++pub const B57600: crate::speed_t = 4097; ++pub const B115200: crate::speed_t = 4098; ++pub const B230400: crate::speed_t = 4099; ++pub const B460800: crate::speed_t = 4100; ++pub const B500000: crate::speed_t = 4101; ++pub const B576000: crate::speed_t = 4102; ++pub const B921600: crate::speed_t = 4103; ++pub const B1000000: crate::speed_t = 4104; ++pub const B1152000: crate::speed_t = 4105; ++pub const B1500000: crate::speed_t = 4106; ++pub const B2000000: crate::speed_t = 4107; ++pub const B2500000: crate::speed_t = 4108; ++pub const B3000000: crate::speed_t = 4109; ++pub const B3500000: crate::speed_t = 4110; ++pub const B4000000: crate::speed_t = 4111; ++pub const VEOL: usize = 11; ++pub const VEOL2: usize = 16; ++pub const VMIN: usize = 6; ++pub const IEXTEN: crate::tcflag_t = 32768; ++pub const TOSTOP: crate::tcflag_t = 256; ++pub const FLUSHO: crate::tcflag_t = 4096; ++pub const EXTPROC: crate::tcflag_t = 65536; ++ ++pub const SYS_read: c_long = 63; ++pub const SYS_write: c_long = 64; ++pub const SYS_close: c_long = 57; ++pub const SYS_fstat: c_long = 80; ++pub const SYS_lseek: c_long = 62; ++pub const SYS_mmap: c_long = 222; ++pub const SYS_mprotect: c_long = 226; ++pub const SYS_munmap: c_long = 215; ++pub const SYS_brk: c_long = 214; ++pub const SYS_rt_sigaction: c_long = 134; ++pub const SYS_rt_sigprocmask: c_long = 135; ++pub const SYS_rt_sigreturn: c_long = 139; ++pub const SYS_ioctl: c_long = 29; ++pub const SYS_pread64: c_long = 67; ++pub const SYS_pwrite64: c_long = 68; ++pub const SYS_readv: c_long = 65; ++pub const SYS_writev: c_long = 66; ++pub const SYS_sched_yield: c_long = 124; ++pub const SYS_mremap: c_long = 216; ++pub const SYS_msync: c_long = 227; ++pub const SYS_mincore: c_long = 232; ++pub const SYS_madvise: c_long = 233; ++pub const SYS_shmget: c_long = 194; ++pub const SYS_shmat: c_long = 196; ++pub const SYS_shmctl: c_long = 195; ++pub const SYS_dup: c_long = 23; ++pub const SYS_nanosleep: c_long = 101; ++pub const SYS_getitimer: c_long = 102; ++pub const SYS_setitimer: c_long = 103; ++pub const SYS_getpid: c_long = 172; ++pub const SYS_sendfile: c_long = 71; ++pub const SYS_socket: c_long = 198; ++pub const SYS_connect: c_long = 203; ++pub const SYS_accept: c_long = 202; ++pub const SYS_sendto: c_long = 206; ++pub const SYS_recvfrom: c_long = 207; ++pub const SYS_sendmsg: c_long = 211; ++pub const SYS_recvmsg: c_long = 212; ++pub const SYS_shutdown: c_long = 210; ++pub const SYS_bind: c_long = 200; ++pub const SYS_listen: c_long = 201; ++pub const SYS_getsockname: c_long = 204; ++pub const SYS_getpeername: c_long = 205; ++pub const SYS_socketpair: c_long = 199; ++pub const SYS_setsockopt: c_long = 208; ++pub const SYS_getsockopt: c_long = 209; ++pub const SYS_clone: c_long = 220; ++pub const SYS_execve: c_long = 221; ++pub const SYS_exit: c_long = 93; ++pub const SYS_wait4: c_long = 260; ++pub const SYS_kill: c_long = 129; ++pub const SYS_uname: c_long = 160; ++pub const SYS_semget: c_long = 190; ++pub const SYS_semop: c_long = 193; ++pub const SYS_semctl: c_long = 191; ++pub const SYS_shmdt: c_long = 197; ++pub const SYS_msgget: c_long = 186; ++pub const SYS_msgsnd: c_long = 189; ++pub const SYS_msgrcv: c_long = 188; ++pub const SYS_msgctl: c_long = 187; ++pub const SYS_fcntl: c_long = 25; ++pub const SYS_flock: c_long = 32; ++pub const SYS_fsync: c_long = 82; ++pub const SYS_fdatasync: c_long = 83; ++pub const SYS_truncate: c_long = 45; ++pub const SYS_ftruncate: c_long = 46; ++pub const SYS_getcwd: c_long = 17; ++pub const SYS_chdir: c_long = 49; ++pub const SYS_fchdir: c_long = 50; ++pub const SYS_fchmod: c_long = 52; ++pub const SYS_fchown: c_long = 55; ++pub const SYS_umask: c_long = 166; ++pub const SYS_gettimeofday: c_long = 169; ++pub const SYS_getrlimit: c_long = 163; ++pub const SYS_getrusage: c_long = 165; ++pub const SYS_sysinfo: c_long = 179; ++pub const SYS_times: c_long = 153; ++pub const SYS_ptrace: c_long = 117; ++pub const SYS_getuid: c_long = 174; ++pub const SYS_syslog: c_long = 116; ++pub const SYS_getgid: c_long = 176; ++pub const SYS_setuid: c_long = 146; ++pub const SYS_setgid: c_long = 144; ++pub const SYS_geteuid: c_long = 175; ++pub const SYS_getegid: c_long = 177; ++pub const SYS_setpgid: c_long = 154; ++pub const SYS_getppid: c_long = 173; ++pub const SYS_setsid: c_long = 157; ++pub const SYS_setreuid: c_long = 145; ++pub const SYS_setregid: c_long = 143; ++pub const SYS_getgroups: c_long = 158; ++pub const SYS_setgroups: c_long = 159; ++pub const SYS_setresuid: c_long = 147; ++pub const SYS_getresuid: c_long = 148; ++pub const SYS_setresgid: c_long = 149; ++pub const SYS_getresgid: c_long = 150; ++pub const SYS_getpgid: c_long = 155; ++pub const SYS_setfsuid: c_long = 151; ++pub const SYS_setfsgid: c_long = 152; ++pub const SYS_getsid: c_long = 156; ++pub const SYS_capget: c_long = 90; ++pub const SYS_capset: c_long = 91; ++pub const SYS_rt_sigpending: c_long = 136; ++pub const SYS_rt_sigtimedwait: c_long = 137; ++pub const SYS_rt_sigqueueinfo: c_long = 138; ++pub const SYS_rt_sigsuspend: c_long = 133; ++pub const SYS_sigaltstack: c_long = 132; ++pub const SYS_personality: c_long = 92; ++pub const SYS_statfs: c_long = 43; ++pub const SYS_fstatfs: c_long = 44; ++pub const SYS_getpriority: c_long = 141; ++pub const SYS_setpriority: c_long = 140; ++pub const SYS_sched_setparam: c_long = 118; ++pub const SYS_sched_getparam: c_long = 121; ++pub const SYS_sched_setscheduler: c_long = 119; ++pub const SYS_sched_getscheduler: c_long = 120; ++pub const SYS_sched_get_priority_max: c_long = 125; ++pub const SYS_sched_get_priority_min: c_long = 126; ++pub const SYS_sched_rr_get_interval: c_long = 127; ++pub const SYS_mlock: c_long = 228; ++pub const SYS_munlock: c_long = 229; ++pub const SYS_mlockall: c_long = 230; ++pub const SYS_munlockall: c_long = 231; ++pub const SYS_vhangup: c_long = 58; ++pub const SYS_pivot_root: c_long = 41; ++pub const SYS_prctl: c_long = 167; ++pub const SYS_adjtimex: c_long = 171; ++pub const SYS_setrlimit: c_long = 164; ++pub const SYS_chroot: c_long = 51; ++pub const SYS_sync: c_long = 81; ++pub const SYS_acct: c_long = 89; ++pub const SYS_settimeofday: c_long = 170; ++pub const SYS_mount: c_long = 40; ++pub const SYS_umount2: c_long = 39; ++pub const SYS_swapon: c_long = 224; ++pub const SYS_swapoff: c_long = 225; ++pub const SYS_reboot: c_long = 142; ++pub const SYS_sethostname: c_long = 161; ++pub const SYS_setdomainname: c_long = 162; ++pub const SYS_init_module: c_long = 105; ++pub const SYS_delete_module: c_long = 106; ++pub const SYS_quotactl: c_long = 60; ++pub const SYS_nfsservctl: c_long = 42; ++pub const SYS_gettid: c_long = 178; ++pub const SYS_readahead: c_long = 213; ++pub const SYS_setxattr: c_long = 5; ++pub const SYS_lsetxattr: c_long = 6; ++pub const SYS_fsetxattr: c_long = 7; ++pub const SYS_getxattr: c_long = 8; ++pub const SYS_lgetxattr: c_long = 9; ++pub const SYS_fgetxattr: c_long = 10; ++pub const SYS_listxattr: c_long = 11; ++pub const SYS_llistxattr: c_long = 12; ++pub const SYS_flistxattr: c_long = 13; ++pub const SYS_removexattr: c_long = 14; ++pub const SYS_lremovexattr: c_long = 15; ++pub const SYS_fremovexattr: c_long = 16; ++pub const SYS_tkill: c_long = 130; ++pub const SYS_futex: c_long = 98; ++pub const SYS_sched_setaffinity: c_long = 122; ++pub const SYS_sched_getaffinity: c_long = 123; ++pub const SYS_io_setup: c_long = 0; ++pub const SYS_io_destroy: c_long = 1; ++pub const SYS_io_getevents: c_long = 4; ++pub const SYS_io_submit: c_long = 2; ++pub const SYS_io_cancel: c_long = 3; ++pub const SYS_lookup_dcookie: c_long = 18; ++pub const SYS_remap_file_pages: c_long = 234; ++pub const SYS_getdents64: c_long = 61; ++pub const SYS_set_tid_address: c_long = 96; ++pub const SYS_restart_syscall: c_long = 128; ++pub const SYS_semtimedop: c_long = 192; ++pub const SYS_fadvise64: c_long = 223; ++pub const SYS_timer_create: c_long = 107; ++pub const SYS_timer_settime: c_long = 110; ++pub const SYS_timer_gettime: c_long = 108; ++pub const SYS_timer_getoverrun: c_long = 109; ++pub const SYS_timer_delete: c_long = 111; ++pub const SYS_clock_settime: c_long = 112; ++pub const SYS_clock_gettime: c_long = 113; ++pub const SYS_clock_getres: c_long = 114; ++pub const SYS_clock_nanosleep: c_long = 115; ++pub const SYS_exit_group: c_long = 94; ++pub const SYS_epoll_ctl: c_long = 21; ++pub const SYS_tgkill: c_long = 131; ++pub const SYS_mbind: c_long = 235; ++pub const SYS_set_mempolicy: c_long = 237; ++pub const SYS_get_mempolicy: c_long = 236; ++pub const SYS_mq_open: c_long = 180; ++pub const SYS_mq_unlink: c_long = 181; ++pub const SYS_mq_timedsend: c_long = 182; ++pub const SYS_mq_timedreceive: c_long = 183; ++pub const SYS_mq_notify: c_long = 184; ++pub const SYS_mq_getsetattr: c_long = 185; ++pub const SYS_kexec_load: c_long = 104; ++pub const SYS_waitid: c_long = 95; ++pub const SYS_add_key: c_long = 217; ++pub const SYS_request_key: c_long = 218; ++pub const SYS_keyctl: c_long = 219; ++pub const SYS_ioprio_set: c_long = 30; ++pub const SYS_ioprio_get: c_long = 31; ++pub const SYS_inotify_add_watch: c_long = 27; ++pub const SYS_inotify_rm_watch: c_long = 28; ++pub const SYS_migrate_pages: c_long = 238; ++pub const SYS_openat: c_long = 56; ++pub const SYS_mkdirat: c_long = 34; ++pub const SYS_mknodat: c_long = 33; ++pub const SYS_fchownat: c_long = 54; ++pub const SYS_newfstatat: c_long = 79; ++pub const SYS_unlinkat: c_long = 35; ++pub const SYS_linkat: c_long = 37; ++pub const SYS_symlinkat: c_long = 36; ++pub const SYS_readlinkat: c_long = 78; ++pub const SYS_fchmodat: c_long = 53; ++pub const SYS_faccessat: c_long = 48; ++pub const SYS_pselect6: c_long = 72; ++pub const SYS_ppoll: c_long = 73; ++pub const SYS_unshare: c_long = 97; ++pub const SYS_set_robust_list: c_long = 99; ++pub const SYS_get_robust_list: c_long = 100; ++pub const SYS_splice: c_long = 76; ++pub const SYS_tee: c_long = 77; ++pub const SYS_sync_file_range: c_long = 84; ++pub const SYS_vmsplice: c_long = 75; ++pub const SYS_move_pages: c_long = 239; ++pub const SYS_utimensat: c_long = 88; ++pub const SYS_epoll_pwait: c_long = 22; ++pub const SYS_timerfd_create: c_long = 85; ++pub const SYS_fallocate: c_long = 47; ++pub const SYS_timerfd_settime: c_long = 86; ++pub const SYS_timerfd_gettime: c_long = 87; ++pub const SYS_accept4: c_long = 242; ++pub const SYS_signalfd4: c_long = 74; ++pub const SYS_eventfd2: c_long = 19; ++pub const SYS_epoll_create1: c_long = 20; ++pub const SYS_dup3: c_long = 24; ++pub const SYS_pipe2: c_long = 59; ++pub const SYS_inotify_init1: c_long = 26; ++pub const SYS_preadv: c_long = 69; ++pub const SYS_pwritev: c_long = 70; ++pub const SYS_rt_tgsigqueueinfo: c_long = 240; ++pub const SYS_perf_event_open: c_long = 241; ++pub const SYS_recvmmsg: c_long = 243; ++pub const SYS_fanotify_init: c_long = 262; ++pub const SYS_fanotify_mark: c_long = 263; ++pub const SYS_prlimit64: c_long = 261; ++pub const SYS_name_to_handle_at: c_long = 264; ++pub const SYS_open_by_handle_at: c_long = 265; ++pub const SYS_clock_adjtime: c_long = 266; ++pub const SYS_syncfs: c_long = 267; ++pub const SYS_sendmmsg: c_long = 269; ++pub const SYS_setns: c_long = 268; ++pub const SYS_getcpu: c_long = 168; ++pub const SYS_process_vm_readv: c_long = 270; ++pub const SYS_process_vm_writev: c_long = 271; ++pub const SYS_kcmp: c_long = 272; ++pub const SYS_finit_module: c_long = 273; ++pub const SYS_sched_setattr: c_long = 274; ++pub const SYS_sched_getattr: c_long = 275; ++pub const SYS_renameat2: c_long = 276; ++pub const SYS_seccomp: c_long = 277; ++pub const SYS_getrandom: c_long = 278; ++pub const SYS_memfd_create: c_long = 279; ++pub const SYS_bpf: c_long = 280; ++pub const SYS_execveat: c_long = 281; ++pub const SYS_userfaultfd: c_long = 282; ++pub const SYS_membarrier: c_long = 283; ++pub const SYS_mlock2: c_long = 284; ++pub const SYS_copy_file_range: c_long = 285; ++pub const SYS_preadv2: c_long = 286; ++pub const SYS_pwritev2: c_long = 287; ++pub const SYS_pkey_mprotect: c_long = 288; ++pub const SYS_pkey_alloc: c_long = 289; ++pub const SYS_pkey_free: c_long = 290; ++pub const SYS_statx: c_long = 291; ++pub const SYS_pidfd_send_signal: c_long = 424; ++pub const SYS_io_uring_setup: c_long = 425; ++pub const SYS_io_uring_enter: c_long = 426; ++pub const SYS_io_uring_register: c_long = 427; ++pub const SYS_open_tree: c_long = 428; ++pub const SYS_move_mount: c_long = 429; ++pub const SYS_fsopen: c_long = 430; ++pub const SYS_fsconfig: c_long = 431; ++pub const SYS_fsmount: c_long = 432; ++pub const SYS_fspick: c_long = 433; ++pub const SYS_pidfd_open: c_long = 434; ++pub const SYS_clone3: c_long = 435; ++pub const SYS_close_range: c_long = 436; ++pub const SYS_openat2: c_long = 437; ++pub const SYS_pidfd_getfd: c_long = 438; ++pub const SYS_faccessat2: c_long = 439; ++pub const SYS_process_madvise: c_long = 440; ++pub const SYS_epoll_pwait2: c_long = 441; ++pub const SYS_mount_setattr: c_long = 442; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b32/x86/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b32/x86/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b32/x86/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b32/x86/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,917 @@ ++use crate::off_t; ++use crate::prelude::*; ++ ++pub type c_char = i8; ++pub type wchar_t = i32; ++ ++s! { ++ pub struct stat { ++ pub st_dev: crate::dev_t, ++ __st_dev_padding: c_int, ++ __st_ino_truncated: c_long, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ __st_rdev_padding: c_int, ++ pub st_size: off_t, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ pub st_ino: crate::ino_t, ++ } ++ ++ pub struct stat64 { ++ pub st_dev: crate::dev_t, ++ __st_dev_padding: c_int, ++ __st_ino_truncated: c_long, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ __st_rdev_padding: c_int, ++ pub st_size: off_t, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ pub st_ino: crate::ino_t, ++ } ++ ++ pub struct mcontext_t { ++ __private: [u32; 22], ++ } ++ ++ pub struct stack_t { ++ pub ss_sp: *mut c_void, ++ pub ss_flags: c_int, ++ pub ss_size: size_t, ++ } ++ ++ pub struct ipc_perm { ++ pub __ipc_perm_key: crate::key_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub cuid: crate::uid_t, ++ pub cgid: crate::gid_t, ++ pub mode: crate::mode_t, ++ pub __seq: c_int, ++ __unused1: c_long, ++ __unused2: c_long, ++ } ++ ++ pub struct shmid_ds { ++ pub shm_perm: crate::ipc_perm, ++ pub shm_segsz: size_t, ++ pub shm_atime: crate::time_t, ++ __unused1: c_int, ++ pub shm_dtime: crate::time_t, ++ __unused2: c_int, ++ pub shm_ctime: crate::time_t, ++ __unused3: c_int, ++ pub shm_cpid: crate::pid_t, ++ pub shm_lpid: crate::pid_t, ++ pub shm_nattch: c_ulong, ++ __pad1: c_ulong, ++ __pad2: c_ulong, ++ } ++ ++ pub struct msqid_ds { ++ pub msg_perm: crate::ipc_perm, ++ pub msg_stime: crate::time_t, ++ __unused1: c_int, ++ pub msg_rtime: crate::time_t, ++ __unused2: c_int, ++ pub msg_ctime: crate::time_t, ++ __unused3: c_int, ++ __msg_cbytes: c_ulong, ++ pub msg_qnum: crate::msgqnum_t, ++ pub msg_qbytes: crate::msglen_t, ++ pub msg_lspid: crate::pid_t, ++ pub msg_lrpid: crate::pid_t, ++ __pad1: c_ulong, ++ __pad2: c_ulong, ++ } ++} ++ ++s_no_extra_traits! { ++ pub struct user_fpxregs_struct { ++ pub cwd: c_ushort, ++ pub swd: c_ushort, ++ pub twd: c_ushort, ++ pub fop: c_ushort, ++ pub fip: c_long, ++ pub fcs: c_long, ++ pub foo: c_long, ++ pub fos: c_long, ++ pub mxcsr: c_long, ++ __reserved: c_long, ++ pub st_space: [c_long; 32], ++ pub xmm_space: [c_long; 32], ++ padding: [c_long; 56], ++ } ++ ++ pub struct ucontext_t { ++ pub uc_flags: c_ulong, ++ pub uc_link: *mut ucontext_t, ++ pub uc_stack: crate::stack_t, ++ pub uc_mcontext: mcontext_t, ++ pub uc_sigmask: crate::sigset_t, ++ __private: [u8; 112], ++ } ++ ++ #[allow(missing_debug_implementations)] ++ #[repr(align(8))] ++ pub struct max_align_t { ++ priv_: [f64; 3], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for user_fpxregs_struct { ++ fn eq(&self, other: &user_fpxregs_struct) -> bool { ++ self.cwd == other.cwd ++ && self.swd == other.swd ++ && self.twd == other.twd ++ && self.fop == other.fop ++ && self.fip == other.fip ++ && self.fcs == other.fcs ++ && self.foo == other.foo ++ && self.fos == other.fos ++ && self.mxcsr == other.mxcsr ++ // Ignore __reserved field ++ && self.st_space == other.st_space ++ && self.xmm_space == other.xmm_space ++ // Ignore padding field ++ } ++ } ++ ++ impl Eq for user_fpxregs_struct {} ++ ++ impl fmt::Debug for user_fpxregs_struct { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("user_fpxregs_struct") ++ .field("cwd", &self.cwd) ++ .field("swd", &self.swd) ++ .field("twd", &self.twd) ++ .field("fop", &self.fop) ++ .field("fip", &self.fip) ++ .field("fcs", &self.fcs) ++ .field("foo", &self.foo) ++ .field("fos", &self.fos) ++ .field("mxcsr", &self.mxcsr) ++ // Ignore __reserved field ++ .field("st_space", &self.st_space) ++ .field("xmm_space", &self.xmm_space) ++ // Ignore padding field ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for user_fpxregs_struct { ++ fn hash(&self, state: &mut H) { ++ self.cwd.hash(state); ++ self.swd.hash(state); ++ self.twd.hash(state); ++ self.fop.hash(state); ++ self.fip.hash(state); ++ self.fcs.hash(state); ++ self.foo.hash(state); ++ self.fos.hash(state); ++ self.mxcsr.hash(state); ++ // Ignore __reserved field ++ self.st_space.hash(state); ++ self.xmm_space.hash(state); ++ // Ignore padding field ++ } ++ } ++ ++ impl PartialEq for ucontext_t { ++ fn eq(&self, other: &ucontext_t) -> bool { ++ self.uc_flags == other.uc_flags ++ && self.uc_link == other.uc_link ++ && self.uc_stack == other.uc_stack ++ && self.uc_mcontext == other.uc_mcontext ++ && self.uc_sigmask == other.uc_sigmask ++ && self ++ .__private ++ .iter() ++ .zip(other.__private.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ ++ impl Eq for ucontext_t {} ++ ++ impl fmt::Debug for ucontext_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("ucontext_t") ++ .field("uc_flags", &self.uc_flags) ++ .field("uc_link", &self.uc_link) ++ .field("uc_stack", &self.uc_stack) ++ .field("uc_mcontext", &self.uc_mcontext) ++ .field("uc_sigmask", &self.uc_sigmask) ++ // Ignore __private field ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for ucontext_t { ++ fn hash(&self, state: &mut H) { ++ self.uc_flags.hash(state); ++ self.uc_link.hash(state); ++ self.uc_stack.hash(state); ++ self.uc_mcontext.hash(state); ++ self.uc_sigmask.hash(state); ++ self.__private.hash(state); ++ } ++ } ++ } ++} ++ ++pub const SIGSTKSZ: size_t = 8192; ++pub const MINSIGSTKSZ: size_t = 2048; ++ ++pub const O_DIRECT: c_int = 0x4000; ++pub const O_DIRECTORY: c_int = 0x10000; ++pub const O_NOFOLLOW: c_int = 0x20000; ++pub const O_ASYNC: c_int = 0x2000; ++pub const O_LARGEFILE: c_int = 0o0100000; ++ ++pub const MADV_SOFT_OFFLINE: c_int = 101; ++pub const MCL_CURRENT: c_int = 0x0001; ++pub const MCL_FUTURE: c_int = 0x0002; ++pub const MCL_ONFAULT: c_int = 0x0004; ++pub const CBAUD: crate::tcflag_t = 0o0010017; ++pub const TAB1: c_int = 0x00000800; ++pub const TAB2: c_int = 0x00001000; ++pub const TAB3: c_int = 0x00001800; ++pub const CR1: c_int = 0x00000200; ++pub const CR2: c_int = 0x00000400; ++pub const CR3: c_int = 0x00000600; ++pub const FF1: c_int = 0x00008000; ++pub const BS1: c_int = 0x00002000; ++pub const VT1: c_int = 0x00004000; ++pub const VWERASE: usize = 14; ++pub const VREPRINT: usize = 12; ++pub const VSUSP: usize = 10; ++pub const VSTART: usize = 8; ++pub const VSTOP: usize = 9; ++pub const VDISCARD: usize = 13; ++pub const VTIME: usize = 5; ++pub const IXON: crate::tcflag_t = 0x00000400; ++pub const IXOFF: crate::tcflag_t = 0x00001000; ++pub const ONLCR: crate::tcflag_t = 0x4; ++pub const CSIZE: crate::tcflag_t = 0x00000030; ++pub const CS6: crate::tcflag_t = 0x00000010; ++pub const CS7: crate::tcflag_t = 0x00000020; ++pub const CS8: crate::tcflag_t = 0x00000030; ++pub const CSTOPB: crate::tcflag_t = 0x00000040; ++pub const CREAD: crate::tcflag_t = 0x00000080; ++pub const PARENB: crate::tcflag_t = 0x00000100; ++pub const PARODD: crate::tcflag_t = 0x00000200; ++pub const HUPCL: crate::tcflag_t = 0x00000400; ++pub const CLOCAL: crate::tcflag_t = 0x00000800; ++pub const ECHOKE: crate::tcflag_t = 0x00000800; ++pub const ECHOE: crate::tcflag_t = 0x00000010; ++pub const ECHOK: crate::tcflag_t = 0x00000020; ++pub const ECHONL: crate::tcflag_t = 0x00000040; ++pub const ECHOPRT: crate::tcflag_t = 0x00000400; ++pub const ECHOCTL: crate::tcflag_t = 0x00000200; ++pub const ISIG: crate::tcflag_t = 0x00000001; ++pub const ICANON: crate::tcflag_t = 0x00000002; ++pub const PENDIN: crate::tcflag_t = 0x00004000; ++pub const NOFLSH: crate::tcflag_t = 0x00000080; ++pub const CIBAUD: crate::tcflag_t = 0o02003600000; ++pub const CBAUDEX: crate::tcflag_t = 0o010000; ++pub const VSWTC: usize = 7; ++pub const OLCUC: crate::tcflag_t = 0o000002; ++pub const NLDLY: crate::tcflag_t = 0o000400; ++pub const CRDLY: crate::tcflag_t = 0o003000; ++pub const TABDLY: crate::tcflag_t = 0o014000; ++pub const BSDLY: crate::tcflag_t = 0o020000; ++pub const FFDLY: crate::tcflag_t = 0o100000; ++pub const VTDLY: crate::tcflag_t = 0o040000; ++pub const XTABS: crate::tcflag_t = 0o014000; ++pub const B57600: crate::speed_t = 0o010001; ++pub const B115200: crate::speed_t = 0o010002; ++pub const B230400: crate::speed_t = 0o010003; ++pub const B460800: crate::speed_t = 0o010004; ++pub const B500000: crate::speed_t = 0o010005; ++pub const B576000: crate::speed_t = 0o010006; ++pub const B921600: crate::speed_t = 0o010007; ++pub const B1000000: crate::speed_t = 0o010010; ++pub const B1152000: crate::speed_t = 0o010011; ++pub const B1500000: crate::speed_t = 0o010012; ++pub const B2000000: crate::speed_t = 0o010013; ++pub const B2500000: crate::speed_t = 0o010014; ++pub const B3000000: crate::speed_t = 0o010015; ++pub const B3500000: crate::speed_t = 0o010016; ++pub const B4000000: crate::speed_t = 0o010017; ++ ++pub const O_APPEND: c_int = 1024; ++pub const O_CREAT: c_int = 64; ++pub const O_EXCL: c_int = 128; ++pub const O_NOCTTY: c_int = 256; ++pub const O_NONBLOCK: c_int = 2048; ++pub const O_SYNC: c_int = 1052672; ++pub const O_RSYNC: c_int = 1052672; ++pub const O_DSYNC: c_int = 4096; ++ ++pub const MAP_ANON: c_int = 0x0020; ++pub const MAP_GROWSDOWN: c_int = 0x0100; ++pub const MAP_DENYWRITE: c_int = 0x0800; ++pub const MAP_EXECUTABLE: c_int = 0x01000; ++pub const MAP_LOCKED: c_int = 0x02000; ++pub const MAP_NORESERVE: c_int = 0x04000; ++pub const MAP_POPULATE: c_int = 0x08000; ++pub const MAP_NONBLOCK: c_int = 0x010000; ++pub const MAP_STACK: c_int = 0x020000; ++pub const MAP_SYNC: c_int = 0x080000; ++ ++pub const SOCK_STREAM: c_int = 1; ++pub const SOCK_DGRAM: c_int = 2; ++ ++pub const EDEADLK: c_int = 35; ++pub const ENAMETOOLONG: c_int = 36; ++pub const ENOLCK: c_int = 37; ++pub const ENOSYS: c_int = 38; ++pub const ENOTEMPTY: c_int = 39; ++pub const ELOOP: c_int = 40; ++pub const ENOMSG: c_int = 42; ++pub const EIDRM: c_int = 43; ++pub const ECHRNG: c_int = 44; ++pub const EL2NSYNC: c_int = 45; ++pub const EL3HLT: c_int = 46; ++pub const EL3RST: c_int = 47; ++pub const ELNRNG: c_int = 48; ++pub const EUNATCH: c_int = 49; ++pub const ENOCSI: c_int = 50; ++pub const EL2HLT: c_int = 51; ++pub const EBADE: c_int = 52; ++pub const EBADR: c_int = 53; ++pub const EXFULL: c_int = 54; ++pub const ENOANO: c_int = 55; ++pub const EBADRQC: c_int = 56; ++pub const EBADSLT: c_int = 57; ++pub const EDEADLOCK: c_int = EDEADLK; ++pub const EMULTIHOP: c_int = 72; ++pub const EBADMSG: c_int = 74; ++pub const EOVERFLOW: c_int = 75; ++pub const ENOTUNIQ: c_int = 76; ++pub const EBADFD: c_int = 77; ++pub const EREMCHG: c_int = 78; ++pub const ELIBACC: c_int = 79; ++pub const ELIBBAD: c_int = 80; ++pub const ELIBSCN: c_int = 81; ++pub const ELIBMAX: c_int = 82; ++pub const ELIBEXEC: c_int = 83; ++pub const EILSEQ: c_int = 84; ++pub const ERESTART: c_int = 85; ++pub const ESTRPIPE: c_int = 86; ++pub const EUSERS: c_int = 87; ++pub const ENOTSOCK: c_int = 88; ++pub const EDESTADDRREQ: c_int = 89; ++pub const EMSGSIZE: c_int = 90; ++pub const EPROTOTYPE: c_int = 91; ++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 EADDRINUSE: c_int = 98; ++pub const EADDRNOTAVAIL: c_int = 99; ++pub const ENETDOWN: c_int = 100; ++pub const ENETUNREACH: c_int = 101; ++pub const ENETRESET: c_int = 102; ++pub const ECONNABORTED: c_int = 103; ++pub const ECONNRESET: c_int = 104; ++pub const ENOBUFS: c_int = 105; ++pub const EISCONN: c_int = 106; ++pub const ENOTCONN: c_int = 107; ++pub const ESHUTDOWN: c_int = 108; ++pub const ETOOMANYREFS: c_int = 109; ++pub const ETIMEDOUT: c_int = 110; ++pub const ECONNREFUSED: c_int = 111; ++pub const EHOSTDOWN: c_int = 112; ++pub const EHOSTUNREACH: c_int = 113; ++pub const EALREADY: c_int = 114; ++pub const EINPROGRESS: c_int = 115; ++pub const ESTALE: c_int = 116; ++pub const EUCLEAN: c_int = 117; ++pub const ENOTNAM: c_int = 118; ++pub const ENAVAIL: c_int = 119; ++pub const EISNAM: c_int = 120; ++pub const EREMOTEIO: c_int = 121; ++pub const EDQUOT: c_int = 122; ++pub const ENOMEDIUM: c_int = 123; ++pub const EMEDIUMTYPE: c_int = 124; ++pub const ECANCELED: c_int = 125; ++pub const ENOKEY: c_int = 126; ++pub const EKEYEXPIRED: c_int = 127; ++pub const EKEYREVOKED: c_int = 128; ++pub const EKEYREJECTED: c_int = 129; ++pub const EOWNERDEAD: c_int = 130; ++pub const ENOTRECOVERABLE: c_int = 131; ++pub const ERFKILL: c_int = 132; ++pub const EHWPOISON: c_int = 133; ++ ++pub const SA_ONSTACK: c_int = 0x08000000; ++pub const SA_SIGINFO: c_int = 0x00000004; ++pub const SA_NOCLDWAIT: c_int = 0x00000002; ++ ++pub const SIGCHLD: c_int = 17; ++pub const SIGBUS: c_int = 7; ++pub const SIGTTIN: c_int = 21; ++pub const SIGTTOU: c_int = 22; ++pub const SIGXCPU: c_int = 24; ++pub const SIGXFSZ: c_int = 25; ++pub const SIGVTALRM: c_int = 26; ++pub const SIGPROF: c_int = 27; ++pub const SIGWINCH: c_int = 28; ++pub const SIGUSR1: c_int = 10; ++pub const SIGUSR2: c_int = 12; ++pub const SIGCONT: c_int = 18; ++pub const SIGSTOP: c_int = 19; ++pub const SIGTSTP: c_int = 20; ++pub const SIGURG: c_int = 23; ++pub const SIGIO: c_int = 29; ++pub const SIGSYS: c_int = 31; ++pub const SIGSTKFLT: c_int = 16; ++pub const SIGPOLL: c_int = 29; ++pub const SIGPWR: c_int = 30; ++pub const SIG_SETMASK: c_int = 2; ++pub const SIG_BLOCK: c_int = 0x000000; ++pub const SIG_UNBLOCK: c_int = 0x01; ++ ++pub const EXTPROC: crate::tcflag_t = 0x00010000; ++ ++pub const MAP_HUGETLB: c_int = 0x040000; ++pub const MAP_32BIT: c_int = 0x0040; ++ ++pub const F_GETLK: c_int = 12; ++pub const F_GETOWN: c_int = 9; ++pub const F_SETLK: c_int = 13; ++pub const F_SETLKW: c_int = 14; ++pub const F_SETOWN: c_int = 8; ++ ++pub const VEOF: usize = 4; ++pub const VEOL: usize = 11; ++pub const VEOL2: usize = 16; ++pub const VMIN: usize = 6; ++pub const IEXTEN: crate::tcflag_t = 0x00008000; ++pub const TOSTOP: crate::tcflag_t = 0x00000100; ++pub const FLUSHO: crate::tcflag_t = 0x00001000; ++ ++pub const POLLWRNORM: c_short = 0x100; ++pub const POLLWRBAND: c_short = 0x200; ++ ++pub const PTRACE_SYSEMU: c_int = 31; ++pub const PTRACE_SYSEMU_SINGLESTEP: c_int = 32; ++ ++// Syscall table ++pub const SYS_restart_syscall: c_long = 0; ++pub const SYS_exit: c_long = 1; ++pub const SYS_fork: c_long = 2; ++pub const SYS_read: c_long = 3; ++pub const SYS_write: c_long = 4; ++pub const SYS_open: c_long = 5; ++pub const SYS_close: c_long = 6; ++pub const SYS_waitpid: c_long = 7; ++pub const SYS_creat: c_long = 8; ++pub const SYS_link: c_long = 9; ++pub const SYS_unlink: c_long = 10; ++pub const SYS_execve: c_long = 11; ++pub const SYS_chdir: c_long = 12; ++pub const SYS_time: c_long = 13; ++pub const SYS_mknod: c_long = 14; ++pub const SYS_chmod: c_long = 15; ++pub const SYS_lchown: c_long = 16; ++pub const SYS_break: c_long = 17; ++pub const SYS_oldstat: c_long = 18; ++pub const SYS_lseek: c_long = 19; ++pub const SYS_getpid: c_long = 20; ++pub const SYS_mount: c_long = 21; ++pub const SYS_umount: c_long = 22; ++pub const SYS_setuid: c_long = 23; ++pub const SYS_getuid: c_long = 24; ++pub const SYS_stime: c_long = 25; ++pub const SYS_ptrace: c_long = 26; ++pub const SYS_alarm: c_long = 27; ++pub const SYS_oldfstat: c_long = 28; ++pub const SYS_pause: c_long = 29; ++pub const SYS_utime: c_long = 30; ++pub const SYS_stty: c_long = 31; ++pub const SYS_gtty: c_long = 32; ++pub const SYS_access: c_long = 33; ++pub const SYS_nice: c_long = 34; ++pub const SYS_ftime: c_long = 35; ++pub const SYS_sync: c_long = 36; ++pub const SYS_kill: c_long = 37; ++pub const SYS_rename: c_long = 38; ++pub const SYS_mkdir: c_long = 39; ++pub const SYS_rmdir: c_long = 40; ++pub const SYS_dup: c_long = 41; ++pub const SYS_pipe: c_long = 42; ++pub const SYS_times: c_long = 43; ++pub const SYS_prof: c_long = 44; ++pub const SYS_brk: c_long = 45; ++pub const SYS_setgid: c_long = 46; ++pub const SYS_getgid: c_long = 47; ++pub const SYS_signal: c_long = 48; ++pub const SYS_geteuid: c_long = 49; ++pub const SYS_getegid: c_long = 50; ++pub const SYS_acct: c_long = 51; ++pub const SYS_umount2: c_long = 52; ++pub const SYS_lock: c_long = 53; ++pub const SYS_ioctl: c_long = 54; ++pub const SYS_fcntl: c_long = 55; ++pub const SYS_mpx: c_long = 56; ++pub const SYS_setpgid: c_long = 57; ++pub const SYS_ulimit: c_long = 58; ++pub const SYS_oldolduname: c_long = 59; ++pub const SYS_umask: c_long = 60; ++pub const SYS_chroot: c_long = 61; ++pub const SYS_ustat: c_long = 62; ++pub const SYS_dup2: c_long = 63; ++pub const SYS_getppid: c_long = 64; ++pub const SYS_getpgrp: c_long = 65; ++pub const SYS_setsid: c_long = 66; ++pub const SYS_sigaction: c_long = 67; ++pub const SYS_sgetmask: c_long = 68; ++pub const SYS_ssetmask: c_long = 69; ++pub const SYS_setreuid: c_long = 70; ++pub const SYS_setregid: c_long = 71; ++pub const SYS_sigsuspend: c_long = 72; ++pub const SYS_sigpending: c_long = 73; ++pub const SYS_sethostname: c_long = 74; ++pub const SYS_setrlimit: c_long = 75; ++pub const SYS_getrlimit: c_long = 76; ++pub const SYS_getrusage: c_long = 77; ++pub const SYS_gettimeofday: c_long = 78; ++pub const SYS_settimeofday: c_long = 79; ++pub const SYS_getgroups: c_long = 80; ++pub const SYS_setgroups: c_long = 81; ++pub const SYS_select: c_long = 82; ++pub const SYS_symlink: c_long = 83; ++pub const SYS_oldlstat: c_long = 84; ++pub const SYS_readlink: c_long = 85; ++pub const SYS_uselib: c_long = 86; ++pub const SYS_swapon: c_long = 87; ++pub const SYS_reboot: c_long = 88; ++pub const SYS_readdir: c_long = 89; ++pub const SYS_mmap: c_long = 90; ++pub const SYS_munmap: c_long = 91; ++pub const SYS_truncate: c_long = 92; ++pub const SYS_ftruncate: c_long = 93; ++pub const SYS_fchmod: c_long = 94; ++pub const SYS_fchown: c_long = 95; ++pub const SYS_getpriority: c_long = 96; ++pub const SYS_setpriority: c_long = 97; ++pub const SYS_profil: c_long = 98; ++pub const SYS_statfs: c_long = 99; ++pub const SYS_fstatfs: c_long = 100; ++pub const SYS_ioperm: c_long = 101; ++pub const SYS_socketcall: c_long = 102; ++pub const SYS_syslog: c_long = 103; ++pub const SYS_setitimer: c_long = 104; ++pub const SYS_getitimer: c_long = 105; ++pub const SYS_stat: c_long = 106; ++pub const SYS_lstat: c_long = 107; ++pub const SYS_fstat: c_long = 108; ++pub const SYS_olduname: c_long = 109; ++pub const SYS_iopl: c_long = 110; ++pub const SYS_vhangup: c_long = 111; ++pub const SYS_idle: c_long = 112; ++pub const SYS_vm86old: c_long = 113; ++pub const SYS_wait4: c_long = 114; ++pub const SYS_swapoff: c_long = 115; ++pub const SYS_sysinfo: c_long = 116; ++pub const SYS_ipc: c_long = 117; ++pub const SYS_fsync: c_long = 118; ++pub const SYS_sigreturn: c_long = 119; ++pub const SYS_clone: c_long = 120; ++pub const SYS_setdomainname: c_long = 121; ++pub const SYS_uname: c_long = 122; ++pub const SYS_modify_ldt: c_long = 123; ++pub const SYS_adjtimex: c_long = 124; ++pub const SYS_mprotect: c_long = 125; ++pub const SYS_sigprocmask: c_long = 126; ++pub const SYS_create_module: c_long = 127; ++pub const SYS_init_module: c_long = 128; ++pub const SYS_delete_module: c_long = 129; ++pub const SYS_get_kernel_syms: c_long = 130; ++pub const SYS_quotactl: c_long = 131; ++pub const SYS_getpgid: c_long = 132; ++pub const SYS_fchdir: c_long = 133; ++pub const SYS_bdflush: c_long = 134; ++pub const SYS_sysfs: c_long = 135; ++pub const SYS_personality: c_long = 136; ++pub const SYS_afs_syscall: c_long = 137; ++pub const SYS_setfsuid: c_long = 138; ++pub const SYS_setfsgid: c_long = 139; ++pub const SYS__llseek: c_long = 140; ++pub const SYS_getdents: c_long = 141; ++pub const SYS__newselect: c_long = 142; ++pub const SYS_flock: c_long = 143; ++pub const SYS_msync: c_long = 144; ++pub const SYS_readv: c_long = 145; ++pub const SYS_writev: c_long = 146; ++pub const SYS_getsid: c_long = 147; ++pub const SYS_fdatasync: c_long = 148; ++pub const SYS__sysctl: c_long = 149; ++pub const SYS_mlock: c_long = 150; ++pub const SYS_munlock: c_long = 151; ++pub const SYS_mlockall: c_long = 152; ++pub const SYS_munlockall: c_long = 153; ++pub const SYS_sched_setparam: c_long = 154; ++pub const SYS_sched_getparam: c_long = 155; ++pub const SYS_sched_setscheduler: c_long = 156; ++pub const SYS_sched_getscheduler: c_long = 157; ++pub const SYS_sched_yield: c_long = 158; ++pub const SYS_sched_get_priority_max: c_long = 159; ++pub const SYS_sched_get_priority_min: c_long = 160; ++pub const SYS_sched_rr_get_interval: c_long = 161; ++pub const SYS_nanosleep: c_long = 162; ++pub const SYS_mremap: c_long = 163; ++pub const SYS_setresuid: c_long = 164; ++pub const SYS_getresuid: c_long = 165; ++pub const SYS_vm86: c_long = 166; ++pub const SYS_query_module: c_long = 167; ++pub const SYS_poll: c_long = 168; ++pub const SYS_nfsservctl: c_long = 169; ++pub const SYS_setresgid: c_long = 170; ++pub const SYS_getresgid: c_long = 171; ++pub const SYS_prctl: c_long = 172; ++pub const SYS_rt_sigreturn: c_long = 173; ++pub const SYS_rt_sigaction: c_long = 174; ++pub const SYS_rt_sigprocmask: c_long = 175; ++pub const SYS_rt_sigpending: c_long = 176; ++pub const SYS_rt_sigtimedwait: c_long = 177; ++pub const SYS_rt_sigqueueinfo: c_long = 178; ++pub const SYS_rt_sigsuspend: c_long = 179; ++pub const SYS_pread64: c_long = 180; ++pub const SYS_pwrite64: c_long = 181; ++pub const SYS_chown: c_long = 182; ++pub const SYS_getcwd: c_long = 183; ++pub const SYS_capget: c_long = 184; ++pub const SYS_capset: c_long = 185; ++pub const SYS_sigaltstack: c_long = 186; ++pub const SYS_sendfile: c_long = 187; ++pub const SYS_getpmsg: c_long = 188; ++pub const SYS_putpmsg: c_long = 189; ++pub const SYS_vfork: c_long = 190; ++pub const SYS_ugetrlimit: c_long = 191; ++pub const SYS_mmap2: c_long = 192; ++pub const SYS_truncate64: c_long = 193; ++pub const SYS_ftruncate64: c_long = 194; ++pub const SYS_stat64: c_long = 195; ++pub const SYS_lstat64: c_long = 196; ++pub const SYS_fstat64: c_long = 197; ++pub const SYS_lchown32: c_long = 198; ++pub const SYS_getuid32: c_long = 199; ++pub const SYS_getgid32: c_long = 200; ++pub const SYS_geteuid32: c_long = 201; ++pub const SYS_getegid32: c_long = 202; ++pub const SYS_setreuid32: c_long = 203; ++pub const SYS_setregid32: c_long = 204; ++pub const SYS_getgroups32: c_long = 205; ++pub const SYS_setgroups32: c_long = 206; ++pub const SYS_fchown32: c_long = 207; ++pub const SYS_setresuid32: c_long = 208; ++pub const SYS_getresuid32: c_long = 209; ++pub const SYS_setresgid32: c_long = 210; ++pub const SYS_getresgid32: c_long = 211; ++pub const SYS_chown32: c_long = 212; ++pub const SYS_setuid32: c_long = 213; ++pub const SYS_setgid32: c_long = 214; ++pub const SYS_setfsuid32: c_long = 215; ++pub const SYS_setfsgid32: c_long = 216; ++pub const SYS_pivot_root: c_long = 217; ++pub const SYS_mincore: c_long = 218; ++pub const SYS_madvise: c_long = 219; ++pub const SYS_getdents64: c_long = 220; ++pub const SYS_fcntl64: c_long = 221; ++pub const SYS_gettid: c_long = 224; ++pub const SYS_readahead: c_long = 225; ++pub const SYS_setxattr: c_long = 226; ++pub const SYS_lsetxattr: c_long = 227; ++pub const SYS_fsetxattr: c_long = 228; ++pub const SYS_getxattr: c_long = 229; ++pub const SYS_lgetxattr: c_long = 230; ++pub const SYS_fgetxattr: c_long = 231; ++pub const SYS_listxattr: c_long = 232; ++pub const SYS_llistxattr: c_long = 233; ++pub const SYS_flistxattr: c_long = 234; ++pub const SYS_removexattr: c_long = 235; ++pub const SYS_lremovexattr: c_long = 236; ++pub const SYS_fremovexattr: c_long = 237; ++pub const SYS_tkill: c_long = 238; ++pub const SYS_sendfile64: c_long = 239; ++pub const SYS_futex: c_long = 240; ++pub const SYS_sched_setaffinity: c_long = 241; ++pub const SYS_sched_getaffinity: c_long = 242; ++pub const SYS_set_thread_area: c_long = 243; ++pub const SYS_get_thread_area: c_long = 244; ++pub const SYS_io_setup: c_long = 245; ++pub const SYS_io_destroy: c_long = 246; ++pub const SYS_io_getevents: c_long = 247; ++pub const SYS_io_submit: c_long = 248; ++pub const SYS_io_cancel: c_long = 249; ++pub const SYS_fadvise64: c_long = 250; ++pub const SYS_exit_group: c_long = 252; ++pub const SYS_lookup_dcookie: c_long = 253; ++pub const SYS_epoll_create: c_long = 254; ++pub const SYS_epoll_ctl: c_long = 255; ++pub const SYS_epoll_wait: c_long = 256; ++pub const SYS_remap_file_pages: c_long = 257; ++pub const SYS_set_tid_address: c_long = 258; ++pub const SYS_timer_create: c_long = 259; ++pub const SYS_timer_settime: c_long = 260; ++pub const SYS_timer_gettime: c_long = 261; ++pub const SYS_timer_getoverrun: c_long = 262; ++pub const SYS_timer_delete: c_long = 263; ++pub const SYS_clock_settime: c_long = 264; ++pub const SYS_clock_gettime: c_long = 265; ++pub const SYS_clock_getres: c_long = 266; ++pub const SYS_clock_nanosleep: c_long = 267; ++pub const SYS_statfs64: c_long = 268; ++pub const SYS_fstatfs64: c_long = 269; ++pub const SYS_tgkill: c_long = 270; ++pub const SYS_utimes: c_long = 271; ++pub const SYS_fadvise64_64: c_long = 272; ++pub const SYS_vserver: c_long = 273; ++pub const SYS_mbind: c_long = 274; ++pub const SYS_get_mempolicy: c_long = 275; ++pub const SYS_set_mempolicy: c_long = 276; ++pub const SYS_mq_open: c_long = 277; ++pub const SYS_mq_unlink: c_long = 278; ++pub const SYS_mq_timedsend: c_long = 279; ++pub const SYS_mq_timedreceive: c_long = 280; ++pub const SYS_mq_notify: c_long = 281; ++pub const SYS_mq_getsetattr: c_long = 282; ++pub const SYS_kexec_load: c_long = 283; ++pub const SYS_waitid: c_long = 284; ++pub const SYS_add_key: c_long = 286; ++pub const SYS_request_key: c_long = 287; ++pub const SYS_keyctl: c_long = 288; ++pub const SYS_ioprio_set: c_long = 289; ++pub const SYS_ioprio_get: c_long = 290; ++pub const SYS_inotify_init: c_long = 291; ++pub const SYS_inotify_add_watch: c_long = 292; ++pub const SYS_inotify_rm_watch: c_long = 293; ++pub const SYS_migrate_pages: c_long = 294; ++pub const SYS_openat: c_long = 295; ++pub const SYS_mkdirat: c_long = 296; ++pub const SYS_mknodat: c_long = 297; ++pub const SYS_fchownat: c_long = 298; ++pub const SYS_futimesat: c_long = 299; ++pub const SYS_fstatat64: c_long = 300; ++pub const SYS_unlinkat: c_long = 301; ++pub const SYS_renameat: c_long = 302; ++pub const SYS_linkat: c_long = 303; ++pub const SYS_symlinkat: c_long = 304; ++pub const SYS_readlinkat: c_long = 305; ++pub const SYS_fchmodat: c_long = 306; ++pub const SYS_faccessat: c_long = 307; ++pub const SYS_pselect6: c_long = 308; ++pub const SYS_ppoll: c_long = 309; ++pub const SYS_unshare: c_long = 310; ++pub const SYS_set_robust_list: c_long = 311; ++pub const SYS_get_robust_list: c_long = 312; ++pub const SYS_splice: c_long = 313; ++pub const SYS_sync_file_range: c_long = 314; ++pub const SYS_tee: c_long = 315; ++pub const SYS_vmsplice: c_long = 316; ++pub const SYS_move_pages: c_long = 317; ++pub const SYS_getcpu: c_long = 318; ++pub const SYS_epoll_pwait: c_long = 319; ++pub const SYS_utimensat: c_long = 320; ++pub const SYS_signalfd: c_long = 321; ++pub const SYS_timerfd_create: c_long = 322; ++pub const SYS_eventfd: c_long = 323; ++pub const SYS_fallocate: c_long = 324; ++pub const SYS_timerfd_settime: c_long = 325; ++pub const SYS_timerfd_gettime: c_long = 326; ++pub const SYS_signalfd4: c_long = 327; ++pub const SYS_eventfd2: c_long = 328; ++pub const SYS_epoll_create1: c_long = 329; ++pub const SYS_dup3: c_long = 330; ++pub const SYS_pipe2: c_long = 331; ++pub const SYS_inotify_init1: c_long = 332; ++pub const SYS_preadv: c_long = 333; ++pub const SYS_pwritev: c_long = 334; ++pub const SYS_rt_tgsigqueueinfo: c_long = 335; ++pub const SYS_perf_event_open: c_long = 336; ++pub const SYS_recvmmsg: c_long = 337; ++pub const SYS_fanotify_init: c_long = 338; ++pub const SYS_fanotify_mark: c_long = 339; ++pub const SYS_prlimit64: c_long = 340; ++pub const SYS_name_to_handle_at: c_long = 341; ++pub const SYS_open_by_handle_at: c_long = 342; ++pub const SYS_clock_adjtime: c_long = 343; ++pub const SYS_syncfs: c_long = 344; ++pub const SYS_sendmmsg: c_long = 345; ++pub const SYS_setns: c_long = 346; ++pub const SYS_process_vm_readv: c_long = 347; ++pub const SYS_process_vm_writev: c_long = 348; ++pub const SYS_kcmp: c_long = 349; ++pub const SYS_finit_module: c_long = 350; ++pub const SYS_sched_setattr: c_long = 351; ++pub const SYS_sched_getattr: c_long = 352; ++pub const SYS_renameat2: c_long = 353; ++pub const SYS_seccomp: c_long = 354; ++pub const SYS_getrandom: c_long = 355; ++pub const SYS_memfd_create: c_long = 356; ++pub const SYS_bpf: c_long = 357; ++pub const SYS_execveat: c_long = 358; ++pub const SYS_socket: c_long = 359; ++pub const SYS_socketpair: c_long = 360; ++pub const SYS_bind: c_long = 361; ++pub const SYS_connect: c_long = 362; ++pub const SYS_listen: c_long = 363; ++pub const SYS_accept4: c_long = 364; ++pub const SYS_getsockopt: c_long = 365; ++pub const SYS_setsockopt: c_long = 366; ++pub const SYS_getsockname: c_long = 367; ++pub const SYS_getpeername: c_long = 368; ++pub const SYS_sendto: c_long = 369; ++pub const SYS_sendmsg: c_long = 370; ++pub const SYS_recvfrom: c_long = 371; ++pub const SYS_recvmsg: c_long = 372; ++pub const SYS_shutdown: c_long = 373; ++pub const SYS_userfaultfd: c_long = 374; ++pub const SYS_membarrier: c_long = 375; ++pub const SYS_mlock2: c_long = 376; ++pub const SYS_copy_file_range: c_long = 377; ++pub const SYS_preadv2: c_long = 378; ++pub const SYS_pwritev2: c_long = 379; ++pub const SYS_pkey_mprotect: c_long = 380; ++pub const SYS_pkey_alloc: c_long = 381; ++pub const SYS_pkey_free: c_long = 382; ++pub const SYS_statx: c_long = 383; ++pub const SYS_pidfd_send_signal: c_long = 424; ++pub const SYS_io_uring_setup: c_long = 425; ++pub const SYS_io_uring_enter: c_long = 426; ++pub const SYS_io_uring_register: c_long = 427; ++pub const SYS_open_tree: c_long = 428; ++pub const SYS_move_mount: c_long = 429; ++pub const SYS_fsopen: c_long = 430; ++pub const SYS_fsconfig: c_long = 431; ++pub const SYS_fsmount: c_long = 432; ++pub const SYS_fspick: c_long = 433; ++pub const SYS_pidfd_open: c_long = 434; ++pub const SYS_clone3: c_long = 435; ++pub const SYS_close_range: c_long = 436; ++pub const SYS_openat2: c_long = 437; ++pub const SYS_pidfd_getfd: c_long = 438; ++pub const SYS_faccessat2: c_long = 439; ++pub const SYS_process_madvise: c_long = 440; ++pub const SYS_epoll_pwait2: c_long = 441; ++pub const SYS_mount_setattr: c_long = 442; ++pub const SYS_quotactl_fd: c_long = 443; ++pub const SYS_landlock_create_ruleset: c_long = 444; ++pub const SYS_landlock_add_rule: c_long = 445; ++pub const SYS_landlock_restrict_self: c_long = 446; ++pub const SYS_memfd_secret: c_long = 447; ++pub const SYS_process_mrelease: c_long = 448; ++pub const SYS_futex_waitv: c_long = 449; ++pub const SYS_set_mempolicy_home_node: c_long = 450; ++pub const SYS_fchmodat2: c_long = 452; ++ ++// offsets in user_regs_structs, from sys/reg.h ++pub const EBX: c_int = 0; ++pub const ECX: c_int = 1; ++pub const EDX: c_int = 2; ++pub const ESI: c_int = 3; ++pub const EDI: c_int = 4; ++pub const EBP: c_int = 5; ++pub const EAX: c_int = 6; ++pub const DS: c_int = 7; ++pub const ES: c_int = 8; ++pub const FS: c_int = 9; ++pub const GS: c_int = 10; ++pub const ORIG_EAX: c_int = 11; ++pub const EIP: c_int = 12; ++pub const CS: c_int = 13; ++pub const EFL: c_int = 14; ++pub const UESP: c_int = 15; ++pub const SS: c_int = 16; ++ ++extern "C" { ++ pub fn getrandom(buf: *mut c_void, buflen: size_t, flags: c_uint) -> ssize_t; ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b64/aarch64/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,697 @@ ++use crate::off_t; ++use crate::prelude::*; ++ ++pub type c_char = u8; ++pub type __u64 = c_ulonglong; ++pub type __s64 = c_longlong; ++pub type wchar_t = u32; ++pub type nlink_t = u32; ++pub type blksize_t = c_int; ++ ++s! { ++ pub struct stat { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ __pad0: c_ulong, ++ pub st_size: off_t, ++ pub st_blksize: crate::blksize_t, ++ __pad1: c_int, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ __unused: [c_uint; 2], ++ } ++ ++ pub struct stat64 { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ __pad0: c_ulong, ++ pub st_size: off_t, ++ pub st_blksize: crate::blksize_t, ++ __pad1: c_int, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ __unused: [c_uint; 2], ++ } ++ ++ pub struct user_regs_struct { ++ pub regs: [c_ulonglong; 31], ++ pub sp: c_ulonglong, ++ pub pc: c_ulonglong, ++ pub pstate: c_ulonglong, ++ } ++ ++ pub struct ipc_perm { ++ pub __ipc_perm_key: crate::key_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub cuid: crate::uid_t, ++ pub cgid: crate::gid_t, ++ pub mode: crate::mode_t, ++ pub __seq: c_ushort, ++ __unused1: c_ulong, ++ __unused2: c_ulong, ++ } ++ ++ pub struct ucontext_t { ++ pub uc_flags: c_ulong, ++ pub uc_link: *mut ucontext_t, ++ pub uc_stack: crate::stack_t, ++ pub uc_sigmask: crate::sigset_t, ++ pub uc_mcontext: mcontext_t, ++ } ++ ++ #[repr(align(16))] ++ pub struct mcontext_t { ++ pub fault_address: c_ulong, ++ pub regs: [c_ulong; 31], ++ pub sp: c_ulong, ++ pub pc: c_ulong, ++ pub pstate: c_ulong, ++ __reserved: [u64; 512], ++ } ++ ++ #[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, ++ } ++ ++ pub struct user_fpsimd_struct { ++ pub vregs: [crate::__uint128_t; 32], ++ pub fpsr: u32, ++ pub fpcr: u32, ++ } ++} ++ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ #[repr(align(16))] ++ pub struct max_align_t { ++ priv_: [f32; 8], ++ } ++} ++ ++pub const O_APPEND: c_int = 1024; ++pub const O_DIRECT: c_int = 0x10000; ++pub const O_DIRECTORY: c_int = 0x4000; ++pub const O_LARGEFILE: c_int = 0x20000; ++pub const O_NOFOLLOW: c_int = 0x8000; ++pub const O_CREAT: c_int = 64; ++pub const O_EXCL: c_int = 128; ++pub const O_NOCTTY: c_int = 256; ++pub const O_NONBLOCK: c_int = 2048; ++pub const O_SYNC: c_int = 1052672; ++pub const O_RSYNC: c_int = 1052672; ++pub const O_DSYNC: c_int = 4096; ++pub const O_ASYNC: c_int = 0x2000; ++ ++pub const ENAMETOOLONG: c_int = 36; ++pub const ENOLCK: c_int = 37; ++pub const ENOSYS: c_int = 38; ++pub const ENOTEMPTY: c_int = 39; ++pub const ELOOP: c_int = 40; ++pub const ENOMSG: c_int = 42; ++pub const EIDRM: c_int = 43; ++pub const ECHRNG: c_int = 44; ++pub const EL2NSYNC: c_int = 45; ++pub const EL3HLT: c_int = 46; ++pub const EL3RST: c_int = 47; ++pub const ELNRNG: c_int = 48; ++pub const EUNATCH: c_int = 49; ++pub const ENOCSI: c_int = 50; ++pub const EL2HLT: c_int = 51; ++pub const EBADE: c_int = 52; ++pub const EBADR: c_int = 53; ++pub const EXFULL: c_int = 54; ++pub const ENOANO: c_int = 55; ++pub const EBADRQC: c_int = 56; ++pub const EBADSLT: c_int = 57; ++pub const EMULTIHOP: c_int = 72; ++pub const EBADMSG: c_int = 74; ++pub const EOVERFLOW: c_int = 75; ++pub const ENOTUNIQ: c_int = 76; ++pub const EBADFD: c_int = 77; ++pub const EREMCHG: c_int = 78; ++pub const ELIBACC: c_int = 79; ++pub const ELIBBAD: c_int = 80; ++pub const ELIBSCN: c_int = 81; ++pub const ELIBMAX: c_int = 82; ++pub const ELIBEXEC: c_int = 83; ++pub const EILSEQ: c_int = 84; ++pub const ERESTART: c_int = 85; ++pub const ESTRPIPE: c_int = 86; ++pub const EUSERS: c_int = 87; ++pub const ENOTSOCK: c_int = 88; ++pub const EDESTADDRREQ: c_int = 89; ++pub const EMSGSIZE: c_int = 90; ++pub const EPROTOTYPE: c_int = 91; ++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 EADDRINUSE: c_int = 98; ++pub const EADDRNOTAVAIL: c_int = 99; ++pub const ENETDOWN: c_int = 100; ++pub const ENETUNREACH: c_int = 101; ++pub const ENETRESET: c_int = 102; ++pub const ECONNABORTED: c_int = 103; ++pub const ECONNRESET: c_int = 104; ++pub const ENOBUFS: c_int = 105; ++pub const EISCONN: c_int = 106; ++pub const ENOTCONN: c_int = 107; ++pub const ESHUTDOWN: c_int = 108; ++pub const ETOOMANYREFS: c_int = 109; ++pub const ETIMEDOUT: c_int = 110; ++pub const ECONNREFUSED: c_int = 111; ++pub const EHOSTDOWN: c_int = 112; ++pub const EHOSTUNREACH: c_int = 113; ++pub const EALREADY: c_int = 114; ++pub const EINPROGRESS: c_int = 115; ++pub const ESTALE: c_int = 116; ++pub const EUCLEAN: c_int = 117; ++pub const ENOTNAM: c_int = 118; ++pub const ENAVAIL: c_int = 119; ++pub const EISNAM: c_int = 120; ++pub const EREMOTEIO: c_int = 121; ++pub const EDQUOT: c_int = 122; ++pub const ENOMEDIUM: c_int = 123; ++pub const EMEDIUMTYPE: c_int = 124; ++pub const ECANCELED: c_int = 125; ++pub const ENOKEY: c_int = 126; ++pub const EKEYEXPIRED: c_int = 127; ++pub const EKEYREVOKED: c_int = 128; ++pub const EKEYREJECTED: c_int = 129; ++pub const EOWNERDEAD: c_int = 130; ++pub const ENOTRECOVERABLE: c_int = 131; ++pub const ERFKILL: c_int = 132; ++pub const EHWPOISON: c_int = 133; ++ ++// bits/hwcap.h ++pub const HWCAP_FP: c_ulong = 1 << 0; ++pub const HWCAP_ASIMD: c_ulong = 1 << 1; ++pub const HWCAP_EVTSTRM: c_ulong = 1 << 2; ++pub const HWCAP_AES: c_ulong = 1 << 3; ++pub const HWCAP_PMULL: c_ulong = 1 << 4; ++pub const HWCAP_SHA1: c_ulong = 1 << 5; ++pub const HWCAP_SHA2: c_ulong = 1 << 6; ++pub const HWCAP_CRC32: c_ulong = 1 << 7; ++pub const HWCAP_ATOMICS: c_ulong = 1 << 8; ++pub const HWCAP_FPHP: c_ulong = 1 << 9; ++pub const HWCAP_ASIMDHP: c_ulong = 1 << 10; ++pub const HWCAP_CPUID: c_ulong = 1 << 11; ++pub const HWCAP_ASIMDRDM: c_ulong = 1 << 12; ++pub const HWCAP_JSCVT: c_ulong = 1 << 13; ++pub const HWCAP_FCMA: c_ulong = 1 << 14; ++pub const HWCAP_LRCPC: c_ulong = 1 << 15; ++pub const HWCAP_DCPOP: c_ulong = 1 << 16; ++pub const HWCAP_SHA3: c_ulong = 1 << 17; ++pub const HWCAP_SM3: c_ulong = 1 << 18; ++pub const HWCAP_SM4: c_ulong = 1 << 19; ++pub const HWCAP_ASIMDDP: c_ulong = 1 << 20; ++pub const HWCAP_SHA512: c_ulong = 1 << 21; ++pub const HWCAP_SVE: c_ulong = 1 << 22; ++pub const HWCAP_ASIMDFHM: c_ulong = 1 << 23; ++pub const HWCAP_DIT: c_ulong = 1 << 24; ++pub const HWCAP_USCAT: c_ulong = 1 << 25; ++pub const HWCAP_ILRCPC: c_ulong = 1 << 26; ++pub const HWCAP_FLAGM: c_ulong = 1 << 27; ++pub const HWCAP_SSBS: c_ulong = 1 << 28; ++pub const HWCAP_SB: c_ulong = 1 << 29; ++pub const HWCAP_PACA: c_ulong = 1 << 30; ++pub const HWCAP_PACG: c_ulong = 1 << 31; ++ ++pub const MAP_ANON: c_int = 0x0020; ++pub const MAP_GROWSDOWN: c_int = 0x0100; ++pub const MAP_DENYWRITE: c_int = 0x0800; ++pub const MAP_EXECUTABLE: c_int = 0x01000; ++pub const MAP_LOCKED: c_int = 0x02000; ++pub const MAP_NORESERVE: c_int = 0x04000; ++pub const MAP_POPULATE: c_int = 0x08000; ++pub const MAP_NONBLOCK: c_int = 0x010000; ++pub const MAP_STACK: c_int = 0x020000; ++pub const MAP_HUGETLB: c_int = 0x040000; ++pub const MAP_SYNC: c_int = 0x080000; ++ ++pub const SOCK_STREAM: c_int = 1; ++pub const SOCK_DGRAM: c_int = 2; ++ ++pub const SA_ONSTACK: c_int = 0x08000000; ++pub const SA_SIGINFO: c_int = 0x00000004; ++pub const SA_NOCLDWAIT: c_int = 0x00000002; ++ ++pub const SIGCHLD: c_int = 17; ++pub const SIGBUS: c_int = 7; ++pub const SIGTTIN: c_int = 21; ++pub const SIGTTOU: c_int = 22; ++pub const SIGXCPU: c_int = 24; ++pub const SIGXFSZ: c_int = 25; ++pub const SIGVTALRM: c_int = 26; ++pub const SIGPROF: c_int = 27; ++pub const SIGWINCH: c_int = 28; ++pub const SIGUSR1: c_int = 10; ++pub const SIGUSR2: c_int = 12; ++pub const SIGCONT: c_int = 18; ++pub const SIGSTOP: c_int = 19; ++pub const SIGTSTP: c_int = 20; ++pub const SIGURG: c_int = 23; ++pub const SIGIO: c_int = 29; ++pub const SIGSYS: c_int = 31; ++pub const SIGSTKFLT: c_int = 16; ++pub const SIGPOLL: c_int = 29; ++pub const SIGPWR: c_int = 30; ++pub const SIG_SETMASK: c_int = 2; ++pub const SIG_BLOCK: c_int = 0x000000; ++pub const SIG_UNBLOCK: c_int = 0x01; ++ ++pub const F_GETLK: c_int = 5; ++pub const F_GETOWN: c_int = 9; ++pub const F_SETLK: c_int = 6; ++pub const F_SETLKW: c_int = 7; ++pub const F_SETOWN: c_int = 8; ++ ++pub const VEOF: usize = 4; ++ ++pub const POLLWRNORM: c_short = 0x100; ++pub const POLLWRBAND: c_short = 0x200; ++ ++pub const MINSIGSTKSZ: size_t = 6144; ++pub const SIGSTKSZ: size_t = 12288; ++ ++pub const MADV_SOFT_OFFLINE: c_int = 101; ++pub const SYS_io_setup: c_long = 0; ++pub const SYS_io_destroy: c_long = 1; ++pub const SYS_io_submit: c_long = 2; ++pub const SYS_io_cancel: c_long = 3; ++pub const SYS_io_getevents: c_long = 4; ++pub const SYS_setxattr: c_long = 5; ++pub const SYS_lsetxattr: c_long = 6; ++pub const SYS_fsetxattr: c_long = 7; ++pub const SYS_getxattr: c_long = 8; ++pub const SYS_lgetxattr: c_long = 9; ++pub const SYS_fgetxattr: c_long = 10; ++pub const SYS_listxattr: c_long = 11; ++pub const SYS_llistxattr: c_long = 12; ++pub const SYS_flistxattr: c_long = 13; ++pub const SYS_removexattr: c_long = 14; ++pub const SYS_lremovexattr: c_long = 15; ++pub const SYS_fremovexattr: c_long = 16; ++pub const SYS_getcwd: c_long = 17; ++pub const SYS_lookup_dcookie: c_long = 18; ++pub const SYS_eventfd2: c_long = 19; ++pub const SYS_epoll_create1: c_long = 20; ++pub const SYS_epoll_ctl: c_long = 21; ++pub const SYS_epoll_pwait: c_long = 22; ++pub const SYS_dup: c_long = 23; ++pub const SYS_dup3: c_long = 24; ++pub const SYS_fcntl: c_long = 25; ++pub const SYS_inotify_init1: c_long = 26; ++pub const SYS_inotify_add_watch: c_long = 27; ++pub const SYS_inotify_rm_watch: c_long = 28; ++pub const SYS_ioctl: c_long = 29; ++pub const SYS_ioprio_set: c_long = 30; ++pub const SYS_ioprio_get: c_long = 31; ++pub const SYS_flock: c_long = 32; ++pub const SYS_mknodat: c_long = 33; ++pub const SYS_mkdirat: c_long = 34; ++pub const SYS_unlinkat: c_long = 35; ++pub const SYS_symlinkat: c_long = 36; ++pub const SYS_linkat: c_long = 37; ++pub const SYS_renameat: c_long = 38; ++pub const SYS_umount2: c_long = 39; ++pub const SYS_mount: c_long = 40; ++pub const SYS_pivot_root: c_long = 41; ++pub const SYS_nfsservctl: c_long = 42; ++pub const SYS_statfs: c_long = 43; ++pub const SYS_fstatfs: c_long = 44; ++pub const SYS_truncate: c_long = 45; ++pub const SYS_ftruncate: c_long = 46; ++pub const SYS_fallocate: c_long = 47; ++pub const SYS_faccessat: c_long = 48; ++pub const SYS_chdir: c_long = 49; ++pub const SYS_fchdir: c_long = 50; ++pub const SYS_chroot: c_long = 51; ++pub const SYS_fchmod: c_long = 52; ++pub const SYS_fchmodat: c_long = 53; ++pub const SYS_fchownat: c_long = 54; ++pub const SYS_fchown: c_long = 55; ++pub const SYS_openat: c_long = 56; ++pub const SYS_close: c_long = 57; ++pub const SYS_vhangup: c_long = 58; ++pub const SYS_pipe2: c_long = 59; ++pub const SYS_quotactl: c_long = 60; ++pub const SYS_getdents64: c_long = 61; ++pub const SYS_lseek: c_long = 62; ++pub const SYS_read: c_long = 63; ++pub const SYS_write: c_long = 64; ++pub const SYS_readv: c_long = 65; ++pub const SYS_writev: c_long = 66; ++pub const SYS_pread64: c_long = 67; ++pub const SYS_pwrite64: c_long = 68; ++pub const SYS_preadv: c_long = 69; ++pub const SYS_pwritev: c_long = 70; ++pub const SYS_pselect6: c_long = 72; ++pub const SYS_ppoll: c_long = 73; ++pub const SYS_signalfd4: c_long = 74; ++pub const SYS_vmsplice: c_long = 75; ++pub const SYS_splice: c_long = 76; ++pub const SYS_tee: c_long = 77; ++pub const SYS_readlinkat: c_long = 78; ++pub const SYS_newfstatat: c_long = 79; ++pub const SYS_fstat: c_long = 80; ++pub const SYS_sync: c_long = 81; ++pub const SYS_fsync: c_long = 82; ++pub const SYS_fdatasync: c_long = 83; ++pub const SYS_sync_file_range: c_long = 84; ++pub const SYS_timerfd_create: c_long = 85; ++pub const SYS_timerfd_settime: c_long = 86; ++pub const SYS_timerfd_gettime: c_long = 87; ++pub const SYS_utimensat: c_long = 88; ++pub const SYS_acct: c_long = 89; ++pub const SYS_capget: c_long = 90; ++pub const SYS_capset: c_long = 91; ++pub const SYS_personality: c_long = 92; ++pub const SYS_exit: c_long = 93; ++pub const SYS_exit_group: c_long = 94; ++pub const SYS_waitid: c_long = 95; ++pub const SYS_set_tid_address: c_long = 96; ++pub const SYS_unshare: c_long = 97; ++pub const SYS_futex: c_long = 98; ++pub const SYS_set_robust_list: c_long = 99; ++pub const SYS_get_robust_list: c_long = 100; ++pub const SYS_nanosleep: c_long = 101; ++pub const SYS_getitimer: c_long = 102; ++pub const SYS_setitimer: c_long = 103; ++pub const SYS_kexec_load: c_long = 104; ++pub const SYS_init_module: c_long = 105; ++pub const SYS_delete_module: c_long = 106; ++pub const SYS_timer_create: c_long = 107; ++pub const SYS_timer_gettime: c_long = 108; ++pub const SYS_timer_getoverrun: c_long = 109; ++pub const SYS_timer_settime: c_long = 110; ++pub const SYS_timer_delete: c_long = 111; ++pub const SYS_clock_settime: c_long = 112; ++pub const SYS_clock_gettime: c_long = 113; ++pub const SYS_clock_getres: c_long = 114; ++pub const SYS_clock_nanosleep: c_long = 115; ++pub const SYS_syslog: c_long = 116; ++pub const SYS_ptrace: c_long = 117; ++pub const SYS_sched_setparam: c_long = 118; ++pub const SYS_sched_setscheduler: c_long = 119; ++pub const SYS_sched_getscheduler: c_long = 120; ++pub const SYS_sched_getparam: c_long = 121; ++pub const SYS_sched_setaffinity: c_long = 122; ++pub const SYS_sched_getaffinity: c_long = 123; ++pub const SYS_sched_yield: c_long = 124; ++pub const SYS_sched_get_priority_max: c_long = 125; ++pub const SYS_sched_get_priority_min: c_long = 126; ++pub const SYS_sched_rr_get_interval: c_long = 127; ++pub const SYS_restart_syscall: c_long = 128; ++pub const SYS_kill: c_long = 129; ++pub const SYS_tkill: c_long = 130; ++pub const SYS_tgkill: c_long = 131; ++pub const SYS_sigaltstack: c_long = 132; ++pub const SYS_rt_sigsuspend: c_long = 133; ++pub const SYS_rt_sigaction: c_long = 134; ++pub const SYS_rt_sigprocmask: c_long = 135; ++pub const SYS_rt_sigpending: c_long = 136; ++pub const SYS_rt_sigtimedwait: c_long = 137; ++pub const SYS_rt_sigqueueinfo: c_long = 138; ++pub const SYS_rt_sigreturn: c_long = 139; ++pub const SYS_setpriority: c_long = 140; ++pub const SYS_getpriority: c_long = 141; ++pub const SYS_reboot: c_long = 142; ++pub const SYS_setregid: c_long = 143; ++pub const SYS_setgid: c_long = 144; ++pub const SYS_setreuid: c_long = 145; ++pub const SYS_setuid: c_long = 146; ++pub const SYS_setresuid: c_long = 147; ++pub const SYS_getresuid: c_long = 148; ++pub const SYS_setresgid: c_long = 149; ++pub const SYS_getresgid: c_long = 150; ++pub const SYS_setfsuid: c_long = 151; ++pub const SYS_setfsgid: c_long = 152; ++pub const SYS_times: c_long = 153; ++pub const SYS_setpgid: c_long = 154; ++pub const SYS_getpgid: c_long = 155; ++pub const SYS_getsid: c_long = 156; ++pub const SYS_setsid: c_long = 157; ++pub const SYS_getgroups: c_long = 158; ++pub const SYS_setgroups: c_long = 159; ++pub const SYS_uname: c_long = 160; ++pub const SYS_sethostname: c_long = 161; ++pub const SYS_setdomainname: c_long = 162; ++pub const SYS_getrlimit: c_long = 163; ++pub const SYS_setrlimit: c_long = 164; ++pub const SYS_getrusage: c_long = 165; ++pub const SYS_umask: c_long = 166; ++pub const SYS_prctl: c_long = 167; ++pub const SYS_getcpu: c_long = 168; ++pub const SYS_gettimeofday: c_long = 169; ++pub const SYS_settimeofday: c_long = 170; ++pub const SYS_adjtimex: c_long = 171; ++pub const SYS_getpid: c_long = 172; ++pub const SYS_getppid: c_long = 173; ++pub const SYS_getuid: c_long = 174; ++pub const SYS_geteuid: c_long = 175; ++pub const SYS_getgid: c_long = 176; ++pub const SYS_getegid: c_long = 177; ++pub const SYS_gettid: c_long = 178; ++pub const SYS_sysinfo: c_long = 179; ++pub const SYS_mq_open: c_long = 180; ++pub const SYS_mq_unlink: c_long = 181; ++pub const SYS_mq_timedsend: c_long = 182; ++pub const SYS_mq_timedreceive: c_long = 183; ++pub const SYS_mq_notify: c_long = 184; ++pub const SYS_mq_getsetattr: c_long = 185; ++pub const SYS_msgget: c_long = 186; ++pub const SYS_msgctl: c_long = 187; ++pub const SYS_msgrcv: c_long = 188; ++pub const SYS_msgsnd: c_long = 189; ++pub const SYS_semget: c_long = 190; ++pub const SYS_semctl: c_long = 191; ++pub const SYS_semtimedop: c_long = 192; ++pub const SYS_semop: c_long = 193; ++pub const SYS_shmget: c_long = 194; ++pub const SYS_shmctl: c_long = 195; ++pub const SYS_shmat: c_long = 196; ++pub const SYS_shmdt: c_long = 197; ++pub const SYS_socket: c_long = 198; ++pub const SYS_socketpair: c_long = 199; ++pub const SYS_bind: c_long = 200; ++pub const SYS_listen: c_long = 201; ++pub const SYS_accept: c_long = 202; ++pub const SYS_connect: c_long = 203; ++pub const SYS_getsockname: c_long = 204; ++pub const SYS_getpeername: c_long = 205; ++pub const SYS_sendto: c_long = 206; ++pub const SYS_recvfrom: c_long = 207; ++pub const SYS_setsockopt: c_long = 208; ++pub const SYS_getsockopt: c_long = 209; ++pub const SYS_shutdown: c_long = 210; ++pub const SYS_sendmsg: c_long = 211; ++pub const SYS_recvmsg: c_long = 212; ++pub const SYS_readahead: c_long = 213; ++pub const SYS_brk: c_long = 214; ++pub const SYS_munmap: c_long = 215; ++pub const SYS_mremap: c_long = 216; ++pub const SYS_add_key: c_long = 217; ++pub const SYS_request_key: c_long = 218; ++pub const SYS_keyctl: c_long = 219; ++pub const SYS_clone: c_long = 220; ++pub const SYS_execve: c_long = 221; ++pub const SYS_mmap: c_long = 222; ++pub const SYS_swapon: c_long = 224; ++pub const SYS_swapoff: c_long = 225; ++pub const SYS_mprotect: c_long = 226; ++pub const SYS_msync: c_long = 227; ++pub const SYS_mlock: c_long = 228; ++pub const SYS_munlock: c_long = 229; ++pub const SYS_mlockall: c_long = 230; ++pub const SYS_munlockall: c_long = 231; ++pub const SYS_mincore: c_long = 232; ++pub const SYS_madvise: c_long = 233; ++pub const SYS_remap_file_pages: c_long = 234; ++pub const SYS_mbind: c_long = 235; ++pub const SYS_get_mempolicy: c_long = 236; ++pub const SYS_set_mempolicy: c_long = 237; ++pub const SYS_migrate_pages: c_long = 238; ++pub const SYS_move_pages: c_long = 239; ++pub const SYS_rt_tgsigqueueinfo: c_long = 240; ++pub const SYS_perf_event_open: c_long = 241; ++pub const SYS_accept4: c_long = 242; ++pub const SYS_recvmmsg: c_long = 243; ++pub const SYS_wait4: c_long = 260; ++pub const SYS_prlimit64: c_long = 261; ++pub const SYS_fanotify_init: c_long = 262; ++pub const SYS_fanotify_mark: c_long = 263; ++pub const SYS_name_to_handle_at: c_long = 264; ++pub const SYS_open_by_handle_at: c_long = 265; ++pub const SYS_clock_adjtime: c_long = 266; ++pub const SYS_syncfs: c_long = 267; ++pub const SYS_setns: c_long = 268; ++pub const SYS_sendmmsg: c_long = 269; ++pub const SYS_process_vm_readv: c_long = 270; ++pub const SYS_process_vm_writev: c_long = 271; ++pub const SYS_kcmp: c_long = 272; ++pub const SYS_finit_module: c_long = 273; ++pub const SYS_sched_setattr: c_long = 274; ++pub const SYS_sched_getattr: c_long = 275; ++pub const SYS_renameat2: c_long = 276; ++pub const SYS_seccomp: c_long = 277; ++pub const SYS_getrandom: c_long = 278; ++pub const SYS_memfd_create: c_long = 279; ++pub const SYS_bpf: c_long = 280; ++pub const SYS_execveat: c_long = 281; ++pub const SYS_userfaultfd: c_long = 282; ++pub const SYS_membarrier: c_long = 283; ++pub const SYS_mlock2: c_long = 284; ++pub const SYS_copy_file_range: c_long = 285; ++pub const SYS_preadv2: c_long = 286; ++pub const SYS_pwritev2: c_long = 287; ++pub const SYS_pkey_mprotect: c_long = 288; ++pub const SYS_pkey_alloc: c_long = 289; ++pub const SYS_pkey_free: c_long = 290; ++pub const SYS_statx: c_long = 291; ++pub const SYS_io_pgetevents: c_long = 292; ++pub const SYS_rseq: c_long = 293; ++pub const SYS_pidfd_send_signal: c_long = 424; ++pub const SYS_io_uring_setup: c_long = 425; ++pub const SYS_io_uring_enter: c_long = 426; ++pub const SYS_io_uring_register: c_long = 427; ++pub const SYS_open_tree: c_long = 428; ++pub const SYS_move_mount: c_long = 429; ++pub const SYS_fsopen: c_long = 430; ++pub const SYS_fsconfig: c_long = 431; ++pub const SYS_fsmount: c_long = 432; ++pub const SYS_fspick: c_long = 433; ++pub const SYS_pidfd_open: c_long = 434; ++pub const SYS_clone3: c_long = 435; ++pub const SYS_close_range: c_long = 436; ++pub const SYS_openat2: c_long = 437; ++pub const SYS_pidfd_getfd: c_long = 438; ++pub const SYS_faccessat2: c_long = 439; ++pub const SYS_process_madvise: c_long = 440; ++pub const SYS_epoll_pwait2: c_long = 441; ++pub const SYS_mount_setattr: c_long = 442; ++pub const SYS_quotactl_fd: c_long = 443; ++pub const SYS_landlock_create_ruleset: c_long = 444; ++pub const SYS_landlock_add_rule: c_long = 445; ++pub const SYS_landlock_restrict_self: c_long = 446; ++pub const SYS_memfd_secret: c_long = 447; ++pub const SYS_process_mrelease: c_long = 448; ++pub const SYS_futex_waitv: c_long = 449; ++pub const SYS_set_mempolicy_home_node: c_long = 450; ++pub const SYS_mseal: c_long = 462; ++ ++pub const MCL_CURRENT: c_int = 0x0001; ++pub const MCL_FUTURE: c_int = 0x0002; ++pub const MCL_ONFAULT: c_int = 0x0004; ++pub const CBAUD: crate::tcflag_t = 0o0010017; ++pub const TAB1: c_int = 0x00000800; ++pub const TAB2: c_int = 0x00001000; ++pub const TAB3: c_int = 0x00001800; ++pub const CR1: c_int = 0x00000200; ++pub const CR2: c_int = 0x00000400; ++pub const CR3: c_int = 0x00000600; ++pub const FF1: c_int = 0x00008000; ++pub const BS1: c_int = 0x00002000; ++pub const VT1: c_int = 0x00004000; ++pub const VWERASE: usize = 14; ++pub const VREPRINT: usize = 12; ++pub const VSUSP: usize = 10; ++pub const VSTART: usize = 8; ++pub const VSTOP: usize = 9; ++pub const VDISCARD: usize = 13; ++pub const VTIME: usize = 5; ++pub const IXON: crate::tcflag_t = 0x00000400; ++pub const IXOFF: crate::tcflag_t = 0x00001000; ++pub const ONLCR: crate::tcflag_t = 0x4; ++pub const CSIZE: crate::tcflag_t = 0x00000030; ++pub const CS6: crate::tcflag_t = 0x00000010; ++pub const CS7: crate::tcflag_t = 0x00000020; ++pub const CS8: crate::tcflag_t = 0x00000030; ++pub const CSTOPB: crate::tcflag_t = 0x00000040; ++pub const CREAD: crate::tcflag_t = 0x00000080; ++pub const PARENB: crate::tcflag_t = 0x00000100; ++pub const PARODD: crate::tcflag_t = 0x00000200; ++pub const HUPCL: crate::tcflag_t = 0x00000400; ++pub const CLOCAL: crate::tcflag_t = 0x00000800; ++pub const ECHOKE: crate::tcflag_t = 0x00000800; ++pub const ECHOE: crate::tcflag_t = 0x00000010; ++pub const ECHOK: crate::tcflag_t = 0x00000020; ++pub const ECHONL: crate::tcflag_t = 0x00000040; ++pub const ECHOPRT: crate::tcflag_t = 0x00000400; ++pub const ECHOCTL: crate::tcflag_t = 0x00000200; ++pub const ISIG: crate::tcflag_t = 0x00000001; ++pub const ICANON: crate::tcflag_t = 0x00000002; ++pub const PENDIN: crate::tcflag_t = 0x00004000; ++pub const NOFLSH: crate::tcflag_t = 0x00000080; ++pub const CIBAUD: crate::tcflag_t = 0o02003600000; ++pub const CBAUDEX: crate::tcflag_t = 0o010000; ++pub const VSWTC: usize = 7; ++pub const OLCUC: crate::tcflag_t = 0o000002; ++pub const NLDLY: crate::tcflag_t = 0o000400; ++pub const CRDLY: crate::tcflag_t = 0o003000; ++pub const TABDLY: crate::tcflag_t = 0o014000; ++pub const BSDLY: crate::tcflag_t = 0o020000; ++pub const FFDLY: crate::tcflag_t = 0o100000; ++pub const VTDLY: crate::tcflag_t = 0o040000; ++pub const XTABS: crate::tcflag_t = 0o014000; ++pub const B57600: crate::speed_t = 0o010001; ++pub const B115200: crate::speed_t = 0o010002; ++pub const B230400: crate::speed_t = 0o010003; ++pub const B460800: crate::speed_t = 0o010004; ++pub const B500000: crate::speed_t = 0o010005; ++pub const B576000: crate::speed_t = 0o010006; ++pub const B921600: crate::speed_t = 0o010007; ++pub const B1000000: crate::speed_t = 0o010010; ++pub const B1152000: crate::speed_t = 0o010011; ++pub const B1500000: crate::speed_t = 0o010012; ++pub const B2000000: crate::speed_t = 0o010013; ++pub const B2500000: crate::speed_t = 0o010014; ++pub const B3000000: crate::speed_t = 0o010015; ++pub const B3500000: crate::speed_t = 0o010016; ++pub const B4000000: crate::speed_t = 0o010017; ++ ++pub const EDEADLK: c_int = 35; ++pub const EDEADLOCK: c_int = EDEADLK; ++ ++pub const EXTPROC: crate::tcflag_t = 0x00010000; ++pub const VEOL: usize = 11; ++pub const VEOL2: usize = 16; ++pub const VMIN: usize = 6; ++pub const IEXTEN: crate::tcflag_t = 0x00008000; ++pub const TOSTOP: crate::tcflag_t = 0x00000100; ++pub const FLUSHO: crate::tcflag_t = 0x00001000; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b64/loongarch64/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b64/loongarch64/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b64/loongarch64/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b64/loongarch64/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,670 @@ ++//! LoongArch-specific definitions for 64-bit linux-like values ++ ++use crate::prelude::*; ++use crate::{off64_t, off_t}; ++ ++pub type c_char = i8; ++pub type wchar_t = c_int; ++ ++pub type nlink_t = c_uint; ++pub type blksize_t = c_int; ++pub type fsblkcnt64_t = c_ulong; ++pub type fsfilcnt64_t = c_ulong; ++pub type __u64 = c_ulonglong; ++pub type __s64 = c_longlong; ++ ++s! { ++ pub struct stat { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ __pad1: crate::dev_t, ++ pub st_size: off_t, ++ pub st_blksize: crate::blksize_t, ++ __pad2: c_int, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ __unused: [c_int; 2usize], ++ } ++ ++ pub struct stat64 { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino64_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ pub __pad1: crate::dev_t, ++ pub st_size: off64_t, ++ pub st_blksize: crate::blksize_t, ++ pub __pad2: c_int, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ __unused: [c_int; 2], ++ } ++ ++ pub struct ipc_perm { ++ pub __key: crate::key_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub cuid: crate::uid_t, ++ pub cgid: crate::gid_t, ++ pub mode: c_uint, ++ pub __seq: c_int, ++ __pad2: c_ushort, ++ __unused1: c_ulong, ++ __unused2: c_ulong, ++ } ++ ++ pub struct user_regs_struct { ++ pub regs: [u64; 32], ++ pub orig_a0: u64, ++ pub csr_era: u64, ++ pub csr_badv: u64, ++ pub reserved: [u64; 10], ++ } ++ ++ pub struct user_fp_struct { ++ pub fpr: [u64; 32], ++ pub fcc: u64, ++ pub fcsr: u32, ++ } ++ ++ pub struct ucontext_t { ++ pub uc_flags: c_ulong, ++ pub uc_link: *mut ucontext_t, ++ pub uc_stack: crate::stack_t, ++ pub uc_sigmask: crate::sigset_t, ++ pub uc_mcontext: mcontext_t, ++ } ++ ++ #[repr(align(16))] ++ pub struct mcontext_t { ++ pub __pc: c_ulong, ++ pub __gregs: [c_ulong; 32], ++ pub __flags: c_uint, ++ pub __extcontext: [c_ulong; 0], ++ } ++ ++ #[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, ++ } ++} ++ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ #[repr(align(16))] ++ pub struct max_align_t { ++ priv_: [f64; 4], ++ } ++} ++ ++pub const SYS_io_setup: c_long = 0; ++pub const SYS_io_destroy: c_long = 1; ++pub const SYS_io_submit: c_long = 2; ++pub const SYS_io_cancel: c_long = 3; ++pub const SYS_io_getevents: c_long = 4; ++pub const SYS_setxattr: c_long = 5; ++pub const SYS_lsetxattr: c_long = 6; ++pub const SYS_fsetxattr: c_long = 7; ++pub const SYS_getxattr: c_long = 8; ++pub const SYS_lgetxattr: c_long = 9; ++pub const SYS_fgetxattr: c_long = 10; ++pub const SYS_listxattr: c_long = 11; ++pub const SYS_llistxattr: c_long = 12; ++pub const SYS_flistxattr: c_long = 13; ++pub const SYS_removexattr: c_long = 14; ++pub const SYS_lremovexattr: c_long = 15; ++pub const SYS_fremovexattr: c_long = 16; ++pub const SYS_getcwd: c_long = 17; ++pub const SYS_lookup_dcookie: c_long = 18; ++pub const SYS_eventfd2: c_long = 19; ++pub const SYS_epoll_create1: c_long = 20; ++pub const SYS_epoll_ctl: c_long = 21; ++pub const SYS_epoll_pwait: c_long = 22; ++pub const SYS_dup: c_long = 23; ++pub const SYS_dup3: c_long = 24; ++pub const SYS_fcntl: c_long = 25; ++pub const SYS_inotify_init1: c_long = 26; ++pub const SYS_inotify_add_watch: c_long = 27; ++pub const SYS_inotify_rm_watch: c_long = 28; ++pub const SYS_ioctl: c_long = 29; ++pub const SYS_ioprio_set: c_long = 30; ++pub const SYS_ioprio_get: c_long = 31; ++pub const SYS_flock: c_long = 32; ++pub const SYS_mknodat: c_long = 33; ++pub const SYS_mkdirat: c_long = 34; ++pub const SYS_unlinkat: c_long = 35; ++pub const SYS_symlinkat: c_long = 36; ++pub const SYS_linkat: c_long = 37; ++pub const SYS_umount2: c_long = 39; ++pub const SYS_mount: c_long = 40; ++pub const SYS_pivot_root: c_long = 41; ++pub const SYS_nfsservctl: c_long = 42; ++pub const SYS_statfs: c_long = 43; ++pub const SYS_fstatfs: c_long = 44; ++pub const SYS_truncate: c_long = 45; ++pub const SYS_ftruncate: c_long = 46; ++pub const SYS_fallocate: c_long = 47; ++pub const SYS_faccessat: c_long = 48; ++pub const SYS_chdir: c_long = 49; ++pub const SYS_fchdir: c_long = 50; ++pub const SYS_chroot: c_long = 51; ++pub const SYS_fchmod: c_long = 52; ++pub const SYS_fchmodat: c_long = 53; ++pub const SYS_fchownat: c_long = 54; ++pub const SYS_fchown: c_long = 55; ++pub const SYS_openat: c_long = 56; ++pub const SYS_close: c_long = 57; ++pub const SYS_vhangup: c_long = 58; ++pub const SYS_pipe2: c_long = 59; ++pub const SYS_quotactl: c_long = 60; ++pub const SYS_getdents64: c_long = 61; ++pub const SYS_lseek: c_long = 62; ++pub const SYS_read: c_long = 63; ++pub const SYS_write: c_long = 64; ++pub const SYS_readv: c_long = 65; ++pub const SYS_writev: c_long = 66; ++pub const SYS_pread64: c_long = 67; ++pub const SYS_pwrite64: c_long = 68; ++pub const SYS_preadv: c_long = 69; ++pub const SYS_pwritev: c_long = 70; ++pub const SYS_sendfile: c_long = 71; ++pub const SYS_pselect6: c_long = 72; ++pub const SYS_ppoll: c_long = 73; ++pub const SYS_signalfd4: c_long = 74; ++pub const SYS_vmsplice: c_long = 75; ++pub const SYS_splice: c_long = 76; ++pub const SYS_tee: c_long = 77; ++pub const SYS_readlinkat: c_long = 78; ++pub const SYS_sync: c_long = 81; ++pub const SYS_fsync: c_long = 82; ++pub const SYS_fdatasync: c_long = 83; ++pub const SYS_sync_file_range: c_long = 84; ++pub const SYS_timerfd_create: c_long = 85; ++pub const SYS_timerfd_settime: c_long = 86; ++pub const SYS_timerfd_gettime: c_long = 87; ++pub const SYS_utimensat: c_long = 88; ++pub const SYS_acct: c_long = 89; ++pub const SYS_capget: c_long = 90; ++pub const SYS_capset: c_long = 91; ++pub const SYS_personality: c_long = 92; ++pub const SYS_exit: c_long = 93; ++pub const SYS_exit_group: c_long = 94; ++pub const SYS_waitid: c_long = 95; ++pub const SYS_set_tid_address: c_long = 96; ++pub const SYS_unshare: c_long = 97; ++pub const SYS_futex: c_long = 98; ++pub const SYS_set_robust_list: c_long = 99; ++pub const SYS_get_robust_list: c_long = 100; ++pub const SYS_nanosleep: c_long = 101; ++pub const SYS_getitimer: c_long = 102; ++pub const SYS_setitimer: c_long = 103; ++pub const SYS_kexec_load: c_long = 104; ++pub const SYS_init_module: c_long = 105; ++pub const SYS_delete_module: c_long = 106; ++pub const SYS_timer_create: c_long = 107; ++pub const SYS_timer_gettime: c_long = 108; ++pub const SYS_timer_getoverrun: c_long = 109; ++pub const SYS_timer_settime: c_long = 110; ++pub const SYS_timer_delete: c_long = 111; ++pub const SYS_clock_settime: c_long = 112; ++pub const SYS_clock_gettime: c_long = 113; ++pub const SYS_clock_getres: c_long = 114; ++pub const SYS_clock_nanosleep: c_long = 115; ++pub const SYS_syslog: c_long = 116; ++pub const SYS_ptrace: c_long = 117; ++pub const SYS_sched_setparam: c_long = 118; ++pub const SYS_sched_setscheduler: c_long = 119; ++pub const SYS_sched_getscheduler: c_long = 120; ++pub const SYS_sched_getparam: c_long = 121; ++pub const SYS_sched_setaffinity: c_long = 122; ++pub const SYS_sched_getaffinity: c_long = 123; ++pub const SYS_sched_yield: c_long = 124; ++pub const SYS_sched_get_priority_max: c_long = 125; ++pub const SYS_sched_get_priority_min: c_long = 126; ++pub const SYS_sched_rr_get_interval: c_long = 127; ++pub const SYS_restart_syscall: c_long = 128; ++pub const SYS_kill: c_long = 129; ++pub const SYS_tkill: c_long = 130; ++pub const SYS_tgkill: c_long = 131; ++pub const SYS_sigaltstack: c_long = 132; ++pub const SYS_rt_sigsuspend: c_long = 133; ++pub const SYS_rt_sigaction: c_long = 134; ++pub const SYS_rt_sigprocmask: c_long = 135; ++pub const SYS_rt_sigpending: c_long = 136; ++pub const SYS_rt_sigtimedwait: c_long = 137; ++pub const SYS_rt_sigqueueinfo: c_long = 138; ++pub const SYS_rt_sigreturn: c_long = 139; ++pub const SYS_setpriority: c_long = 140; ++pub const SYS_getpriority: c_long = 141; ++pub const SYS_reboot: c_long = 142; ++pub const SYS_setregid: c_long = 143; ++pub const SYS_setgid: c_long = 144; ++pub const SYS_setreuid: c_long = 145; ++pub const SYS_setuid: c_long = 146; ++pub const SYS_setresuid: c_long = 147; ++pub const SYS_getresuid: c_long = 148; ++pub const SYS_setresgid: c_long = 149; ++pub const SYS_getresgid: c_long = 150; ++pub const SYS_setfsuid: c_long = 151; ++pub const SYS_setfsgid: c_long = 152; ++pub const SYS_times: c_long = 153; ++pub const SYS_setpgid: c_long = 154; ++pub const SYS_getpgid: c_long = 155; ++pub const SYS_getsid: c_long = 156; ++pub const SYS_setsid: c_long = 157; ++pub const SYS_getgroups: c_long = 158; ++pub const SYS_setgroups: c_long = 159; ++pub const SYS_uname: c_long = 160; ++pub const SYS_sethostname: c_long = 161; ++pub const SYS_setdomainname: c_long = 162; ++pub const SYS_getrusage: c_long = 165; ++pub const SYS_umask: c_long = 166; ++pub const SYS_prctl: c_long = 167; ++pub const SYS_getcpu: c_long = 168; ++pub const SYS_gettimeofday: c_long = 169; ++pub const SYS_settimeofday: c_long = 170; ++pub const SYS_adjtimex: c_long = 171; ++pub const SYS_getpid: c_long = 172; ++pub const SYS_getppid: c_long = 173; ++pub const SYS_getuid: c_long = 174; ++pub const SYS_geteuid: c_long = 175; ++pub const SYS_getgid: c_long = 176; ++pub const SYS_getegid: c_long = 177; ++pub const SYS_gettid: c_long = 178; ++pub const SYS_sysinfo: c_long = 179; ++pub const SYS_mq_open: c_long = 180; ++pub const SYS_mq_unlink: c_long = 181; ++pub const SYS_mq_timedsend: c_long = 182; ++pub const SYS_mq_timedreceive: c_long = 183; ++pub const SYS_mq_notify: c_long = 184; ++pub const SYS_mq_getsetattr: c_long = 185; ++pub const SYS_msgget: c_long = 186; ++pub const SYS_msgctl: c_long = 187; ++pub const SYS_msgrcv: c_long = 188; ++pub const SYS_msgsnd: c_long = 189; ++pub const SYS_semget: c_long = 190; ++pub const SYS_semctl: c_long = 191; ++pub const SYS_semtimedop: c_long = 192; ++pub const SYS_semop: c_long = 193; ++pub const SYS_shmget: c_long = 194; ++pub const SYS_shmctl: c_long = 195; ++pub const SYS_shmat: c_long = 196; ++pub const SYS_shmdt: c_long = 197; ++pub const SYS_socket: c_long = 198; ++pub const SYS_socketpair: c_long = 199; ++pub const SYS_bind: c_long = 200; ++pub const SYS_listen: c_long = 201; ++pub const SYS_accept: c_long = 202; ++pub const SYS_connect: c_long = 203; ++pub const SYS_getsockname: c_long = 204; ++pub const SYS_getpeername: c_long = 205; ++pub const SYS_sendto: c_long = 206; ++pub const SYS_recvfrom: c_long = 207; ++pub const SYS_setsockopt: c_long = 208; ++pub const SYS_getsockopt: c_long = 209; ++pub const SYS_shutdown: c_long = 210; ++pub const SYS_sendmsg: c_long = 211; ++pub const SYS_recvmsg: c_long = 212; ++pub const SYS_readahead: c_long = 213; ++pub const SYS_brk: c_long = 214; ++pub const SYS_munmap: c_long = 215; ++pub const SYS_mremap: c_long = 216; ++pub const SYS_add_key: c_long = 217; ++pub const SYS_request_key: c_long = 218; ++pub const SYS_keyctl: c_long = 219; ++pub const SYS_clone: c_long = 220; ++pub const SYS_execve: c_long = 221; ++pub const SYS_mmap: c_long = 222; ++pub const SYS_fadvise64: c_long = 223; ++pub const SYS_swapon: c_long = 224; ++pub const SYS_swapoff: c_long = 225; ++pub const SYS_mprotect: c_long = 226; ++pub const SYS_msync: c_long = 227; ++pub const SYS_mlock: c_long = 228; ++pub const SYS_munlock: c_long = 229; ++pub const SYS_mlockall: c_long = 230; ++pub const SYS_munlockall: c_long = 231; ++pub const SYS_mincore: c_long = 232; ++pub const SYS_madvise: c_long = 233; ++pub const SYS_remap_file_pages: c_long = 234; ++pub const SYS_mbind: c_long = 235; ++pub const SYS_get_mempolicy: c_long = 236; ++pub const SYS_set_mempolicy: c_long = 237; ++pub const SYS_migrate_pages: c_long = 238; ++pub const SYS_move_pages: c_long = 239; ++pub const SYS_rt_tgsigqueueinfo: c_long = 240; ++pub const SYS_perf_event_open: c_long = 241; ++pub const SYS_accept4: c_long = 242; ++pub const SYS_recvmmsg: c_long = 243; ++pub const SYS_arch_specific_syscall: c_long = 244; ++pub const SYS_wait4: c_long = 260; ++pub const SYS_prlimit64: c_long = 261; ++pub const SYS_fanotify_init: c_long = 262; ++pub const SYS_fanotify_mark: c_long = 263; ++pub const SYS_name_to_handle_at: c_long = 264; ++pub const SYS_open_by_handle_at: c_long = 265; ++pub const SYS_clock_adjtime: c_long = 266; ++pub const SYS_syncfs: c_long = 267; ++pub const SYS_setns: c_long = 268; ++pub const SYS_sendmmsg: c_long = 269; ++pub const SYS_process_vm_readv: c_long = 270; ++pub const SYS_process_vm_writev: c_long = 271; ++pub const SYS_kcmp: c_long = 272; ++pub const SYS_finit_module: c_long = 273; ++pub const SYS_sched_setattr: c_long = 274; ++pub const SYS_sched_getattr: c_long = 275; ++pub const SYS_renameat2: c_long = 276; ++pub const SYS_seccomp: c_long = 277; ++pub const SYS_getrandom: c_long = 278; ++pub const SYS_memfd_create: c_long = 279; ++pub const SYS_bpf: c_long = 280; ++pub const SYS_execveat: c_long = 281; ++pub const SYS_userfaultfd: c_long = 282; ++pub const SYS_membarrier: c_long = 283; ++pub const SYS_mlock2: c_long = 284; ++pub const SYS_copy_file_range: c_long = 285; ++pub const SYS_preadv2: c_long = 286; ++pub const SYS_pwritev2: c_long = 287; ++pub const SYS_pkey_mprotect: c_long = 288; ++pub const SYS_pkey_alloc: c_long = 289; ++pub const SYS_pkey_free: c_long = 290; ++pub const SYS_statx: c_long = 291; ++pub const SYS_io_pgetevents: c_long = 292; ++pub const SYS_rseq: c_long = 293; ++pub const SYS_kexec_file_load: c_long = 294; ++pub const SYS_pidfd_send_signal: c_long = 424; ++pub const SYS_io_uring_setup: c_long = 425; ++pub const SYS_io_uring_enter: c_long = 426; ++pub const SYS_io_uring_register: c_long = 427; ++pub const SYS_open_tree: c_long = 428; ++pub const SYS_move_mount: c_long = 429; ++pub const SYS_fsopen: c_long = 430; ++pub const SYS_fsconfig: c_long = 431; ++pub const SYS_fsmount: c_long = 432; ++pub const SYS_fspick: c_long = 433; ++pub const SYS_pidfd_open: c_long = 434; ++pub const SYS_clone3: c_long = 435; ++pub const SYS_close_range: c_long = 436; ++pub const SYS_openat2: c_long = 437; ++pub const SYS_pidfd_getfd: c_long = 438; ++pub const SYS_faccessat2: c_long = 439; ++pub const SYS_process_madvise: c_long = 440; ++pub const SYS_epoll_pwait2: c_long = 441; ++pub const SYS_mount_setattr: c_long = 442; ++pub const SYS_quotactl_fd: c_long = 443; ++pub const SYS_landlock_create_ruleset: c_long = 444; ++pub const SYS_landlock_add_rule: c_long = 445; ++pub const SYS_landlock_restrict_self: c_long = 446; ++pub const SYS_process_mrelease: c_long = 448; ++pub const SYS_futex_waitv: c_long = 449; ++pub const SYS_set_mempolicy_home_node: c_long = 450; ++pub const SYS_cachestat: c_long = 451; ++pub const SYS_fchmodat2: c_long = 452; ++pub const SYS_map_shadow_stack: c_long = 453; ++pub const SYS_futex_wake: c_long = 454; ++pub const SYS_futex_wait: c_long = 455; ++pub const SYS_futex_requeue: c_long = 456; ++ ++pub const O_APPEND: c_int = 1024; ++pub const O_DIRECT: c_int = 0x4000; ++pub const O_DIRECTORY: c_int = 0x10000; ++pub const O_LARGEFILE: c_int = 0o0100000; ++pub const O_NOFOLLOW: c_int = 0x20000; ++pub const O_CREAT: c_int = 64; ++pub const O_EXCL: c_int = 128; ++pub const O_NOCTTY: c_int = 256; ++pub const O_NONBLOCK: c_int = 2048; ++pub const O_SYNC: c_int = 1052672; ++pub const O_RSYNC: c_int = 1052672; ++pub const O_DSYNC: c_int = 4096; ++pub const O_ASYNC: c_int = 0o20000; ++ ++pub const SIGSTKSZ: size_t = 16384; ++pub const MINSIGSTKSZ: size_t = 4096; ++ ++pub const ENAMETOOLONG: c_int = 36; ++pub const ENOLCK: c_int = 37; ++pub const ENOSYS: c_int = 38; ++pub const ENOTEMPTY: c_int = 39; ++pub const ELOOP: c_int = 40; ++pub const ENOMSG: c_int = 42; ++pub const EIDRM: c_int = 43; ++pub const ECHRNG: c_int = 44; ++pub const EL2NSYNC: c_int = 45; ++pub const EL3HLT: c_int = 46; ++pub const EL3RST: c_int = 47; ++pub const ELNRNG: c_int = 48; ++pub const EUNATCH: c_int = 49; ++pub const ENOCSI: c_int = 50; ++pub const EL2HLT: c_int = 51; ++pub const EBADE: c_int = 52; ++pub const EBADR: c_int = 53; ++pub const EXFULL: c_int = 54; ++pub const ENOANO: c_int = 55; ++pub const EBADRQC: c_int = 56; ++pub const EBADSLT: c_int = 57; ++pub const EMULTIHOP: c_int = 72; ++pub const EOVERFLOW: c_int = 75; ++pub const ENOTUNIQ: c_int = 76; ++pub const EBADFD: c_int = 77; ++pub const EBADMSG: c_int = 74; ++pub const EREMCHG: c_int = 78; ++pub const ELIBACC: c_int = 79; ++pub const ELIBBAD: c_int = 80; ++pub const ELIBSCN: c_int = 81; ++pub const ELIBMAX: c_int = 82; ++pub const ELIBEXEC: c_int = 83; ++pub const EILSEQ: c_int = 84; ++pub const ERESTART: c_int = 85; ++pub const ESTRPIPE: c_int = 86; ++pub const EUSERS: c_int = 87; ++pub const ENOTSOCK: c_int = 88; ++pub const EDESTADDRREQ: c_int = 89; ++pub const EMSGSIZE: c_int = 90; ++pub const EPROTOTYPE: c_int = 91; ++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 EADDRINUSE: c_int = 98; ++pub const EADDRNOTAVAIL: c_int = 99; ++pub const ENETDOWN: c_int = 100; ++pub const ENETUNREACH: c_int = 101; ++pub const ENETRESET: c_int = 102; ++pub const ECONNABORTED: c_int = 103; ++pub const ECONNRESET: c_int = 104; ++pub const ENOBUFS: c_int = 105; ++pub const EISCONN: c_int = 106; ++pub const ENOTCONN: c_int = 107; ++pub const ESHUTDOWN: c_int = 108; ++pub const ETOOMANYREFS: c_int = 109; ++pub const ETIMEDOUT: c_int = 110; ++pub const ECONNREFUSED: c_int = 111; ++pub const EHOSTDOWN: c_int = 112; ++pub const EHOSTUNREACH: c_int = 113; ++pub const EALREADY: c_int = 114; ++pub const EINPROGRESS: c_int = 115; ++pub const ESTALE: c_int = 116; ++pub const EUCLEAN: c_int = 117; ++pub const ENOTNAM: c_int = 118; ++pub const ENAVAIL: c_int = 119; ++pub const EISNAM: c_int = 120; ++pub const EREMOTEIO: c_int = 121; ++pub const EDQUOT: c_int = 122; ++pub const ENOMEDIUM: c_int = 123; ++pub const EMEDIUMTYPE: c_int = 124; ++pub const ECANCELED: c_int = 125; ++pub const ENOKEY: c_int = 126; ++pub const EKEYEXPIRED: c_int = 127; ++pub const EKEYREVOKED: c_int = 128; ++pub const EKEYREJECTED: c_int = 129; ++pub const EOWNERDEAD: c_int = 130; ++pub const ENOTRECOVERABLE: c_int = 131; ++pub const EHWPOISON: c_int = 133; ++pub const ERFKILL: c_int = 132; ++ ++pub const SA_ONSTACK: c_int = 0x08000000; ++pub const SA_SIGINFO: c_int = 0x00000004; ++pub const SA_NOCLDWAIT: c_int = 0x00000002; ++ ++pub const SIGCHLD: c_int = 17; ++pub const SIGBUS: c_int = 7; ++pub const SIGTTIN: c_int = 21; ++pub const SIGTTOU: c_int = 22; ++pub const SIGXCPU: c_int = 24; ++pub const SIGXFSZ: c_int = 25; ++pub const SIGVTALRM: c_int = 26; ++pub const SIGPROF: c_int = 27; ++pub const SIGWINCH: c_int = 28; ++pub const SIGUSR1: c_int = 10; ++pub const SIGUSR2: c_int = 12; ++pub const SIGCONT: c_int = 18; ++pub const SIGSTOP: c_int = 19; ++pub const SIGTSTP: c_int = 20; ++pub const SIGURG: c_int = 23; ++pub const SIGIO: c_int = 29; ++pub const SIGSYS: c_int = 31; ++pub const SIGSTKFLT: c_int = 16; ++pub const SIGPOLL: c_int = 29; ++pub const SIGPWR: c_int = 30; ++pub const SIG_SETMASK: c_int = 2; ++pub const SIG_BLOCK: c_int = 0; ++pub const SIG_UNBLOCK: c_int = 1; ++ ++pub const F_GETLK: c_int = 5; ++pub const F_GETOWN: c_int = 9; ++pub const F_SETLK: c_int = 6; ++pub const F_SETLKW: c_int = 7; ++pub const F_SETOWN: c_int = 8; ++ ++pub const VEOF: usize = 4; ++ ++pub const POLLWRNORM: c_short = 0x100; ++pub const POLLWRBAND: c_short = 0x200; ++ ++pub const SOCK_STREAM: c_int = 1; ++pub const SOCK_DGRAM: c_int = 2; ++ ++pub const MAP_ANON: c_int = 0x0020; ++pub const MAP_GROWSDOWN: c_int = 0x0100; ++pub const MAP_DENYWRITE: c_int = 0x0800; ++pub const MAP_EXECUTABLE: c_int = 0x01000; ++pub const MAP_LOCKED: c_int = 0x02000; ++pub const MAP_NORESERVE: c_int = 0x04000; ++pub const MAP_POPULATE: c_int = 0x08000; ++pub const MAP_NONBLOCK: c_int = 0x010000; ++pub const MAP_STACK: c_int = 0x020000; ++pub const MAP_HUGETLB: c_int = 0x040000; ++pub const MAP_SYNC: c_int = 0x080000; ++ ++pub const MCL_CURRENT: c_int = 0x0001; ++pub const MCL_FUTURE: c_int = 0x0002; ++pub const MCL_ONFAULT: c_int = 0x0004; ++pub const CBAUD: crate::tcflag_t = 0o0010017; ++pub const TAB1: c_int = 0x00000800; ++pub const TAB2: c_int = 0x00001000; ++pub const TAB3: c_int = 0x00001800; ++pub const CR1: c_int = 0x00000200; ++pub const CR2: c_int = 0x00000400; ++pub const CR3: c_int = 0x00000600; ++pub const FF1: c_int = 0x00008000; ++pub const BS1: c_int = 0x00002000; ++pub const VT1: c_int = 0x00004000; ++pub const VWERASE: usize = 14; ++pub const VREPRINT: usize = 12; ++pub const VSUSP: usize = 10; ++pub const VSTART: usize = 8; ++pub const VSTOP: usize = 9; ++pub const VDISCARD: usize = 13; ++pub const VTIME: usize = 5; ++pub const IXON: crate::tcflag_t = 0x00000400; ++pub const IXOFF: crate::tcflag_t = 0x00001000; ++pub const ONLCR: crate::tcflag_t = 0x4; ++pub const CSIZE: crate::tcflag_t = 0x00000030; ++pub const CS6: crate::tcflag_t = 0x00000010; ++pub const CS7: crate::tcflag_t = 0x00000020; ++pub const CS8: crate::tcflag_t = 0x00000030; ++pub const CSTOPB: crate::tcflag_t = 0x00000040; ++pub const CREAD: crate::tcflag_t = 0x00000080; ++pub const PARENB: crate::tcflag_t = 0x00000100; ++pub const PARODD: crate::tcflag_t = 0x00000200; ++pub const HUPCL: crate::tcflag_t = 0x00000400; ++pub const CLOCAL: crate::tcflag_t = 0x00000800; ++pub const ECHOKE: crate::tcflag_t = 0x00000800; ++pub const ECHOE: crate::tcflag_t = 0x00000010; ++pub const ECHOK: crate::tcflag_t = 0x00000020; ++pub const ECHONL: crate::tcflag_t = 0x00000040; ++pub const ECHOPRT: crate::tcflag_t = 0x00000400; ++pub const ECHOCTL: crate::tcflag_t = 0x00000200; ++pub const ISIG: crate::tcflag_t = 0x00000001; ++pub const ICANON: crate::tcflag_t = 0x00000002; ++pub const XCASE: crate::tcflag_t = 0x00000004; ++pub const PENDIN: crate::tcflag_t = 0x00004000; ++pub const NOFLSH: crate::tcflag_t = 0x00000080; ++pub const CIBAUD: crate::tcflag_t = 0o02003600000; ++pub const CBAUDEX: crate::tcflag_t = 0o010000; ++pub const VSWTC: usize = 7; ++pub const OLCUC: crate::tcflag_t = 0o000002; ++pub const NLDLY: crate::tcflag_t = 0o000400; ++pub const CRDLY: crate::tcflag_t = 0o003000; ++pub const TABDLY: crate::tcflag_t = 0o014000; ++pub const BSDLY: crate::tcflag_t = 0o020000; ++pub const FFDLY: crate::tcflag_t = 0o100000; ++pub const VTDLY: crate::tcflag_t = 0o040000; ++pub const XTABS: crate::tcflag_t = 0o014000; ++pub const B57600: crate::speed_t = 0o010001; ++pub const B115200: crate::speed_t = 0o010002; ++pub const B230400: crate::speed_t = 0o010003; ++pub const B460800: crate::speed_t = 0o010004; ++pub const B500000: crate::speed_t = 0o010005; ++pub const B576000: crate::speed_t = 0o010006; ++pub const B921600: crate::speed_t = 0o010007; ++pub const B1000000: crate::speed_t = 0o010010; ++pub const B1152000: crate::speed_t = 0o010011; ++pub const B1500000: crate::speed_t = 0o010012; ++pub const B2000000: crate::speed_t = 0o010013; ++pub const B2500000: crate::speed_t = 0o010014; ++pub const B3000000: crate::speed_t = 0o010015; ++pub const B3500000: crate::speed_t = 0o010016; ++pub const B4000000: crate::speed_t = 0o010017; ++ ++pub const EDEADLK: c_int = 35; ++pub const EDEADLOCK: c_int = EDEADLK; ++pub const EXTPROC: crate::tcflag_t = 0x00010000; ++pub const VEOL: usize = 11; ++pub const VEOL2: usize = 16; ++pub const VMIN: usize = 6; ++pub const IEXTEN: crate::tcflag_t = 0x00008000; ++pub const TOSTOP: crate::tcflag_t = 0x00000100; ++pub const FLUSHO: crate::tcflag_t = 0x00001000; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b64/mips64.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b64/mips64.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b64/mips64.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b64/mips64.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,661 @@ ++use crate::off_t; ++use crate::prelude::*; ++ ++pub type c_char = i8; ++pub type wchar_t = i32; ++pub type __u64 = c_ulong; ++pub type __s64 = c_long; ++pub type nlink_t = u64; ++pub type blksize_t = i64; ++ ++s! { ++ pub struct stat { ++ pub st_dev: crate::dev_t, ++ __pad1: [c_int; 3], ++ pub st_ino: crate::ino_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ __pad2: [c_uint; 2], ++ pub st_size: off_t, ++ __pad3: c_int, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ pub st_blksize: crate::blksize_t, ++ __pad4: c_uint, ++ pub st_blocks: crate::blkcnt_t, ++ __pad5: [c_int; 14], ++ } ++ ++ pub struct stat64 { ++ pub st_dev: crate::dev_t, ++ __pad1: [c_int; 3], ++ pub st_ino: crate::ino_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ __pad2: [c_uint; 2], ++ pub st_size: off_t, ++ __pad3: c_int, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ pub st_blksize: crate::blksize_t, ++ __pad4: c_uint, ++ pub st_blocks: crate::blkcnt_t, ++ __pad5: [c_int; 14], ++ } ++ ++ pub struct ipc_perm { ++ pub __ipc_perm_key: crate::key_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub cuid: crate::uid_t, ++ pub cgid: crate::gid_t, ++ pub mode: crate::mode_t, ++ pub __seq: c_int, ++ __pad1: c_int, ++ __unused1: c_ulong, ++ __unused2: c_ulong, ++ } ++} ++ ++pub const SIGSTKSZ: size_t = 8192; ++pub const MINSIGSTKSZ: size_t = 2048; ++ ++pub const SYS_read: c_long = 5000 + 0; ++pub const SYS_write: c_long = 5000 + 1; ++pub const SYS_open: c_long = 5000 + 2; ++pub const SYS_close: c_long = 5000 + 3; ++pub const SYS_stat: c_long = 5000 + 4; ++pub const SYS_fstat: c_long = 5000 + 5; ++pub const SYS_lstat: c_long = 5000 + 6; ++pub const SYS_poll: c_long = 5000 + 7; ++pub const SYS_lseek: c_long = 5000 + 8; ++pub const SYS_mmap: c_long = 5000 + 9; ++pub const SYS_mprotect: c_long = 5000 + 10; ++pub const SYS_munmap: c_long = 5000 + 11; ++pub const SYS_brk: c_long = 5000 + 12; ++pub const SYS_rt_sigaction: c_long = 5000 + 13; ++pub const SYS_rt_sigprocmask: c_long = 5000 + 14; ++pub const SYS_ioctl: c_long = 5000 + 15; ++pub const SYS_pread64: c_long = 5000 + 16; ++pub const SYS_pwrite64: c_long = 5000 + 17; ++pub const SYS_readv: c_long = 5000 + 18; ++pub const SYS_writev: c_long = 5000 + 19; ++pub const SYS_access: c_long = 5000 + 20; ++pub const SYS_pipe: c_long = 5000 + 21; ++pub const SYS__newselect: c_long = 5000 + 22; ++pub const SYS_sched_yield: c_long = 5000 + 23; ++pub const SYS_mremap: c_long = 5000 + 24; ++pub const SYS_msync: c_long = 5000 + 25; ++pub const SYS_mincore: c_long = 5000 + 26; ++pub const SYS_madvise: c_long = 5000 + 27; ++pub const SYS_shmget: c_long = 5000 + 28; ++pub const SYS_shmat: c_long = 5000 + 29; ++pub const SYS_shmctl: c_long = 5000 + 30; ++pub const SYS_dup: c_long = 5000 + 31; ++pub const SYS_dup2: c_long = 5000 + 32; ++pub const SYS_pause: c_long = 5000 + 33; ++pub const SYS_nanosleep: c_long = 5000 + 34; ++pub const SYS_getitimer: c_long = 5000 + 35; ++pub const SYS_setitimer: c_long = 5000 + 36; ++pub const SYS_alarm: c_long = 5000 + 37; ++pub const SYS_getpid: c_long = 5000 + 38; ++pub const SYS_sendfile: c_long = 5000 + 39; ++pub const SYS_socket: c_long = 5000 + 40; ++pub const SYS_connect: c_long = 5000 + 41; ++pub const SYS_accept: c_long = 5000 + 42; ++pub const SYS_sendto: c_long = 5000 + 43; ++pub const SYS_recvfrom: c_long = 5000 + 44; ++pub const SYS_sendmsg: c_long = 5000 + 45; ++pub const SYS_recvmsg: c_long = 5000 + 46; ++pub const SYS_shutdown: c_long = 5000 + 47; ++pub const SYS_bind: c_long = 5000 + 48; ++pub const SYS_listen: c_long = 5000 + 49; ++pub const SYS_getsockname: c_long = 5000 + 50; ++pub const SYS_getpeername: c_long = 5000 + 51; ++pub const SYS_socketpair: c_long = 5000 + 52; ++pub const SYS_setsockopt: c_long = 5000 + 53; ++pub const SYS_getsockopt: c_long = 5000 + 54; ++pub const SYS_clone: c_long = 5000 + 55; ++pub const SYS_fork: c_long = 5000 + 56; ++pub const SYS_execve: c_long = 5000 + 57; ++pub const SYS_exit: c_long = 5000 + 58; ++pub const SYS_wait4: c_long = 5000 + 59; ++pub const SYS_kill: c_long = 5000 + 60; ++pub const SYS_uname: c_long = 5000 + 61; ++pub const SYS_semget: c_long = 5000 + 62; ++pub const SYS_semop: c_long = 5000 + 63; ++pub const SYS_semctl: c_long = 5000 + 64; ++pub const SYS_shmdt: c_long = 5000 + 65; ++pub const SYS_msgget: c_long = 5000 + 66; ++pub const SYS_msgsnd: c_long = 5000 + 67; ++pub const SYS_msgrcv: c_long = 5000 + 68; ++pub const SYS_msgctl: c_long = 5000 + 69; ++pub const SYS_fcntl: c_long = 5000 + 70; ++pub const SYS_flock: c_long = 5000 + 71; ++pub const SYS_fsync: c_long = 5000 + 72; ++pub const SYS_fdatasync: c_long = 5000 + 73; ++pub const SYS_truncate: c_long = 5000 + 74; ++pub const SYS_ftruncate: c_long = 5000 + 75; ++pub const SYS_getdents: c_long = 5000 + 76; ++pub const SYS_getcwd: c_long = 5000 + 77; ++pub const SYS_chdir: c_long = 5000 + 78; ++pub const SYS_fchdir: c_long = 5000 + 79; ++pub const SYS_rename: c_long = 5000 + 80; ++pub const SYS_mkdir: c_long = 5000 + 81; ++pub const SYS_rmdir: c_long = 5000 + 82; ++pub const SYS_creat: c_long = 5000 + 83; ++pub const SYS_link: c_long = 5000 + 84; ++pub const SYS_unlink: c_long = 5000 + 85; ++pub const SYS_symlink: c_long = 5000 + 86; ++pub const SYS_readlink: c_long = 5000 + 87; ++pub const SYS_chmod: c_long = 5000 + 88; ++pub const SYS_fchmod: c_long = 5000 + 89; ++pub const SYS_chown: c_long = 5000 + 90; ++pub const SYS_fchown: c_long = 5000 + 91; ++pub const SYS_lchown: c_long = 5000 + 92; ++pub const SYS_umask: c_long = 5000 + 93; ++pub const SYS_gettimeofday: c_long = 5000 + 94; ++pub const SYS_getrlimit: c_long = 5000 + 95; ++pub const SYS_getrusage: c_long = 5000 + 96; ++pub const SYS_sysinfo: c_long = 5000 + 97; ++pub const SYS_times: c_long = 5000 + 98; ++pub const SYS_ptrace: c_long = 5000 + 99; ++pub const SYS_getuid: c_long = 5000 + 100; ++pub const SYS_syslog: c_long = 5000 + 101; ++pub const SYS_getgid: c_long = 5000 + 102; ++pub const SYS_setuid: c_long = 5000 + 103; ++pub const SYS_setgid: c_long = 5000 + 104; ++pub const SYS_geteuid: c_long = 5000 + 105; ++pub const SYS_getegid: c_long = 5000 + 106; ++pub const SYS_setpgid: c_long = 5000 + 107; ++pub const SYS_getppid: c_long = 5000 + 108; ++pub const SYS_getpgrp: c_long = 5000 + 109; ++pub const SYS_setsid: c_long = 5000 + 110; ++pub const SYS_setreuid: c_long = 5000 + 111; ++pub const SYS_setregid: c_long = 5000 + 112; ++pub const SYS_getgroups: c_long = 5000 + 113; ++pub const SYS_setgroups: c_long = 5000 + 114; ++pub const SYS_setresuid: c_long = 5000 + 115; ++pub const SYS_getresuid: c_long = 5000 + 116; ++pub const SYS_setresgid: c_long = 5000 + 117; ++pub const SYS_getresgid: c_long = 5000 + 118; ++pub const SYS_getpgid: c_long = 5000 + 119; ++pub const SYS_setfsuid: c_long = 5000 + 120; ++pub const SYS_setfsgid: c_long = 5000 + 121; ++pub const SYS_getsid: c_long = 5000 + 122; ++pub const SYS_capget: c_long = 5000 + 123; ++pub const SYS_capset: c_long = 5000 + 124; ++pub const SYS_rt_sigpending: c_long = 5000 + 125; ++pub const SYS_rt_sigtimedwait: c_long = 5000 + 126; ++pub const SYS_rt_sigqueueinfo: c_long = 5000 + 127; ++pub const SYS_rt_sigsuspend: c_long = 5000 + 128; ++pub const SYS_sigaltstack: c_long = 5000 + 129; ++pub const SYS_utime: c_long = 5000 + 130; ++pub const SYS_mknod: c_long = 5000 + 131; ++pub const SYS_personality: c_long = 5000 + 132; ++pub const SYS_ustat: c_long = 5000 + 133; ++pub const SYS_statfs: c_long = 5000 + 134; ++pub const SYS_fstatfs: c_long = 5000 + 135; ++pub const SYS_sysfs: c_long = 5000 + 136; ++pub const SYS_getpriority: c_long = 5000 + 137; ++pub const SYS_setpriority: c_long = 5000 + 138; ++pub const SYS_sched_setparam: c_long = 5000 + 139; ++pub const SYS_sched_getparam: c_long = 5000 + 140; ++pub const SYS_sched_setscheduler: c_long = 5000 + 141; ++pub const SYS_sched_getscheduler: c_long = 5000 + 142; ++pub const SYS_sched_get_priority_max: c_long = 5000 + 143; ++pub const SYS_sched_get_priority_min: c_long = 5000 + 144; ++pub const SYS_sched_rr_get_interval: c_long = 5000 + 145; ++pub const SYS_mlock: c_long = 5000 + 146; ++pub const SYS_munlock: c_long = 5000 + 147; ++pub const SYS_mlockall: c_long = 5000 + 148; ++pub const SYS_munlockall: c_long = 5000 + 149; ++pub const SYS_vhangup: c_long = 5000 + 150; ++pub const SYS_pivot_root: c_long = 5000 + 151; ++pub const SYS__sysctl: c_long = 5000 + 152; ++pub const SYS_prctl: c_long = 5000 + 153; ++pub const SYS_adjtimex: c_long = 5000 + 154; ++pub const SYS_setrlimit: c_long = 5000 + 155; ++pub const SYS_chroot: c_long = 5000 + 156; ++pub const SYS_sync: c_long = 5000 + 157; ++pub const SYS_acct: c_long = 5000 + 158; ++pub const SYS_settimeofday: c_long = 5000 + 159; ++pub const SYS_mount: c_long = 5000 + 160; ++pub const SYS_umount2: c_long = 5000 + 161; ++pub const SYS_swapon: c_long = 5000 + 162; ++pub const SYS_swapoff: c_long = 5000 + 163; ++pub const SYS_reboot: c_long = 5000 + 164; ++pub const SYS_sethostname: c_long = 5000 + 165; ++pub const SYS_setdomainname: c_long = 5000 + 166; ++pub const SYS_create_module: c_long = 5000 + 167; ++pub const SYS_init_module: c_long = 5000 + 168; ++pub const SYS_delete_module: c_long = 5000 + 169; ++pub const SYS_get_kernel_syms: c_long = 5000 + 170; ++pub const SYS_query_module: c_long = 5000 + 171; ++pub const SYS_quotactl: c_long = 5000 + 172; ++pub const SYS_nfsservctl: c_long = 5000 + 173; ++pub const SYS_getpmsg: c_long = 5000 + 174; ++pub const SYS_putpmsg: c_long = 5000 + 175; ++pub const SYS_afs_syscall: c_long = 5000 + 176; ++pub const SYS_gettid: c_long = 5000 + 178; ++pub const SYS_readahead: c_long = 5000 + 179; ++pub const SYS_setxattr: c_long = 5000 + 180; ++pub const SYS_lsetxattr: c_long = 5000 + 181; ++pub const SYS_fsetxattr: c_long = 5000 + 182; ++pub const SYS_getxattr: c_long = 5000 + 183; ++pub const SYS_lgetxattr: c_long = 5000 + 184; ++pub const SYS_fgetxattr: c_long = 5000 + 185; ++pub const SYS_listxattr: c_long = 5000 + 186; ++pub const SYS_llistxattr: c_long = 5000 + 187; ++pub const SYS_flistxattr: c_long = 5000 + 188; ++pub const SYS_removexattr: c_long = 5000 + 189; ++pub const SYS_lremovexattr: c_long = 5000 + 190; ++pub const SYS_fremovexattr: c_long = 5000 + 191; ++pub const SYS_tkill: c_long = 5000 + 192; ++pub const SYS_futex: c_long = 5000 + 194; ++pub const SYS_sched_setaffinity: c_long = 5000 + 195; ++pub const SYS_sched_getaffinity: c_long = 5000 + 196; ++pub const SYS_cacheflush: c_long = 5000 + 197; ++pub const SYS_cachectl: c_long = 5000 + 198; ++pub const SYS_sysmips: c_long = 5000 + 199; ++pub const SYS_io_setup: c_long = 5000 + 200; ++pub const SYS_io_destroy: c_long = 5000 + 201; ++pub const SYS_io_getevents: c_long = 5000 + 202; ++pub const SYS_io_submit: c_long = 5000 + 203; ++pub const SYS_io_cancel: c_long = 5000 + 204; ++pub const SYS_exit_group: c_long = 5000 + 205; ++pub const SYS_lookup_dcookie: c_long = 5000 + 206; ++pub const SYS_epoll_create: c_long = 5000 + 207; ++pub const SYS_epoll_ctl: c_long = 5000 + 208; ++pub const SYS_epoll_wait: c_long = 5000 + 209; ++pub const SYS_remap_file_pages: c_long = 5000 + 210; ++pub const SYS_rt_sigreturn: c_long = 5000 + 211; ++pub const SYS_set_tid_address: c_long = 5000 + 212; ++pub const SYS_restart_syscall: c_long = 5000 + 213; ++pub const SYS_semtimedop: c_long = 5000 + 214; ++pub const SYS_fadvise64: c_long = 5000 + 215; ++pub const SYS_timer_create: c_long = 5000 + 216; ++pub const SYS_timer_settime: c_long = 5000 + 217; ++pub const SYS_timer_gettime: c_long = 5000 + 218; ++pub const SYS_timer_getoverrun: c_long = 5000 + 219; ++pub const SYS_timer_delete: c_long = 5000 + 220; ++pub const SYS_clock_settime: c_long = 5000 + 221; ++pub const SYS_clock_gettime: c_long = 5000 + 222; ++pub const SYS_clock_getres: c_long = 5000 + 223; ++pub const SYS_clock_nanosleep: c_long = 5000 + 224; ++pub const SYS_tgkill: c_long = 5000 + 225; ++pub const SYS_utimes: c_long = 5000 + 226; ++pub const SYS_mbind: c_long = 5000 + 227; ++pub const SYS_get_mempolicy: c_long = 5000 + 228; ++pub const SYS_set_mempolicy: c_long = 5000 + 229; ++pub const SYS_mq_open: c_long = 5000 + 230; ++pub const SYS_mq_unlink: c_long = 5000 + 231; ++pub const SYS_mq_timedsend: c_long = 5000 + 232; ++pub const SYS_mq_timedreceive: c_long = 5000 + 233; ++pub const SYS_mq_notify: c_long = 5000 + 234; ++pub const SYS_mq_getsetattr: c_long = 5000 + 235; ++pub const SYS_vserver: c_long = 5000 + 236; ++pub const SYS_waitid: c_long = 5000 + 237; ++/* pub const SYS_sys_setaltroot: c_long = 5000 + 238; */ ++pub const SYS_add_key: c_long = 5000 + 239; ++pub const SYS_request_key: c_long = 5000 + 240; ++pub const SYS_keyctl: c_long = 5000 + 241; ++pub const SYS_set_thread_area: c_long = 5000 + 242; ++pub const SYS_inotify_init: c_long = 5000 + 243; ++pub const SYS_inotify_add_watch: c_long = 5000 + 244; ++pub const SYS_inotify_rm_watch: c_long = 5000 + 245; ++pub const SYS_migrate_pages: c_long = 5000 + 246; ++pub const SYS_openat: c_long = 5000 + 247; ++pub const SYS_mkdirat: c_long = 5000 + 248; ++pub const SYS_mknodat: c_long = 5000 + 249; ++pub const SYS_fchownat: c_long = 5000 + 250; ++pub const SYS_futimesat: c_long = 5000 + 251; ++pub const SYS_newfstatat: c_long = 5000 + 252; ++pub const SYS_unlinkat: c_long = 5000 + 253; ++pub const SYS_renameat: c_long = 5000 + 254; ++pub const SYS_linkat: c_long = 5000 + 255; ++pub const SYS_symlinkat: c_long = 5000 + 256; ++pub const SYS_readlinkat: c_long = 5000 + 257; ++pub const SYS_fchmodat: c_long = 5000 + 258; ++pub const SYS_faccessat: c_long = 5000 + 259; ++pub const SYS_pselect6: c_long = 5000 + 260; ++pub const SYS_ppoll: c_long = 5000 + 261; ++pub const SYS_unshare: c_long = 5000 + 262; ++pub const SYS_splice: c_long = 5000 + 263; ++pub const SYS_sync_file_range: c_long = 5000 + 264; ++pub const SYS_tee: c_long = 5000 + 265; ++pub const SYS_vmsplice: c_long = 5000 + 266; ++pub const SYS_move_pages: c_long = 5000 + 267; ++pub const SYS_set_robust_list: c_long = 5000 + 268; ++pub const SYS_get_robust_list: c_long = 5000 + 269; ++pub const SYS_kexec_load: c_long = 5000 + 270; ++pub const SYS_getcpu: c_long = 5000 + 271; ++pub const SYS_epoll_pwait: c_long = 5000 + 272; ++pub const SYS_ioprio_set: c_long = 5000 + 273; ++pub const SYS_ioprio_get: c_long = 5000 + 274; ++pub const SYS_utimensat: c_long = 5000 + 275; ++pub const SYS_signalfd: c_long = 5000 + 276; ++pub const SYS_timerfd: c_long = 5000 + 277; ++pub const SYS_eventfd: c_long = 5000 + 278; ++pub const SYS_fallocate: c_long = 5000 + 279; ++pub const SYS_timerfd_create: c_long = 5000 + 280; ++pub const SYS_timerfd_gettime: c_long = 5000 + 281; ++pub const SYS_timerfd_settime: c_long = 5000 + 282; ++pub const SYS_signalfd4: c_long = 5000 + 283; ++pub const SYS_eventfd2: c_long = 5000 + 284; ++pub const SYS_epoll_create1: c_long = 5000 + 285; ++pub const SYS_dup3: c_long = 5000 + 286; ++pub const SYS_pipe2: c_long = 5000 + 287; ++pub const SYS_inotify_init1: c_long = 5000 + 288; ++pub const SYS_preadv: c_long = 5000 + 289; ++pub const SYS_pwritev: c_long = 5000 + 290; ++pub const SYS_rt_tgsigqueueinfo: c_long = 5000 + 291; ++pub const SYS_perf_event_open: c_long = 5000 + 292; ++pub const SYS_accept4: c_long = 5000 + 293; ++pub const SYS_recvmmsg: c_long = 5000 + 294; ++pub const SYS_fanotify_init: c_long = 5000 + 295; ++pub const SYS_fanotify_mark: c_long = 5000 + 296; ++pub const SYS_prlimit64: c_long = 5000 + 297; ++pub const SYS_name_to_handle_at: c_long = 5000 + 298; ++pub const SYS_open_by_handle_at: c_long = 5000 + 299; ++pub const SYS_clock_adjtime: c_long = 5000 + 300; ++pub const SYS_syncfs: c_long = 5000 + 301; ++pub const SYS_sendmmsg: c_long = 5000 + 302; ++pub const SYS_setns: c_long = 5000 + 303; ++pub const SYS_process_vm_readv: c_long = 5000 + 304; ++pub const SYS_process_vm_writev: c_long = 5000 + 305; ++pub const SYS_kcmp: c_long = 5000 + 306; ++pub const SYS_finit_module: c_long = 5000 + 307; ++pub const SYS_getdents64: c_long = 5000 + 308; ++pub const SYS_sched_setattr: c_long = 5000 + 309; ++pub const SYS_sched_getattr: c_long = 5000 + 310; ++pub const SYS_renameat2: c_long = 5000 + 311; ++pub const SYS_seccomp: c_long = 5000 + 312; ++pub const SYS_getrandom: c_long = 5000 + 313; ++pub const SYS_memfd_create: c_long = 5000 + 314; ++pub const SYS_bpf: c_long = 5000 + 315; ++pub const SYS_execveat: c_long = 5000 + 316; ++pub const SYS_userfaultfd: c_long = 5000 + 317; ++pub const SYS_membarrier: c_long = 5000 + 318; ++pub const SYS_mlock2: c_long = 5000 + 319; ++pub const SYS_copy_file_range: c_long = 5000 + 320; ++pub const SYS_preadv2: c_long = 5000 + 321; ++pub const SYS_pwritev2: c_long = 5000 + 322; ++pub const SYS_pkey_mprotect: c_long = 5000 + 323; ++pub const SYS_pkey_alloc: c_long = 5000 + 324; ++pub const SYS_pkey_free: c_long = 5000 + 325; ++pub const SYS_statx: c_long = 5000 + 326; ++pub const SYS_pidfd_send_signal: c_long = 5000 + 424; ++pub const SYS_io_uring_setup: c_long = 5000 + 425; ++pub const SYS_io_uring_enter: c_long = 5000 + 426; ++pub const SYS_io_uring_register: c_long = 5000 + 427; ++pub const SYS_open_tree: c_long = 5000 + 428; ++pub const SYS_move_mount: c_long = 5000 + 429; ++pub const SYS_fsopen: c_long = 5000 + 430; ++pub const SYS_fsconfig: c_long = 5000 + 431; ++pub const SYS_fsmount: c_long = 5000 + 432; ++pub const SYS_fspick: c_long = 5000 + 433; ++pub const SYS_pidfd_open: c_long = 5000 + 434; ++pub const SYS_clone3: c_long = 5000 + 435; ++pub const SYS_close_range: c_long = 5000 + 436; ++pub const SYS_openat2: c_long = 5000 + 437; ++pub const SYS_pidfd_getfd: c_long = 5000 + 438; ++pub const SYS_faccessat2: c_long = 5000 + 439; ++pub const SYS_process_madvise: c_long = 5000 + 440; ++pub const SYS_epoll_pwait2: c_long = 5000 + 441; ++pub const SYS_mount_setattr: c_long = 5000 + 442; ++pub const SYS_quotactl_fd: c_long = 5000 + 443; ++pub const SYS_landlock_create_ruleset: c_long = 5000 + 444; ++pub const SYS_landlock_add_rule: c_long = 5000 + 445; ++pub const SYS_landlock_restrict_self: c_long = 5000 + 446; ++pub const SYS_memfd_secret: c_long = 5000 + 447; ++pub const SYS_process_mrelease: c_long = 5000 + 448; ++pub const SYS_futex_waitv: c_long = 5000 + 449; ++pub const SYS_set_mempolicy_home_node: c_long = 5000 + 450; ++ ++pub const O_DIRECT: c_int = 0x8000; ++pub const O_DIRECTORY: c_int = 0x10000; ++pub const O_NOFOLLOW: c_int = 0x20000; ++ ++pub const O_APPEND: c_int = 8; ++pub const O_CREAT: c_int = 256; ++pub const O_EXCL: c_int = 1024; ++pub const O_NOCTTY: c_int = 2048; ++pub const O_NONBLOCK: c_int = 128; ++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 EDEADLK: c_int = 45; ++pub const ENAMETOOLONG: c_int = 78; ++pub const ENOLCK: c_int = 46; ++pub const ENOSYS: c_int = 89; ++pub const ENOTEMPTY: c_int = 93; ++pub const ELOOP: c_int = 90; ++pub const ENOMSG: c_int = 35; ++pub const EIDRM: c_int = 36; ++pub const ECHRNG: c_int = 37; ++pub const EL2NSYNC: c_int = 38; ++pub const EL3HLT: c_int = 39; ++pub const EL3RST: c_int = 40; ++pub const ELNRNG: c_int = 41; ++pub const EUNATCH: c_int = 42; ++pub const ENOCSI: c_int = 43; ++pub const EL2HLT: c_int = 44; ++pub const EBADE: c_int = 50; ++pub const EBADR: c_int = 51; ++pub const EXFULL: c_int = 52; ++pub const ENOANO: c_int = 53; ++pub const EBADRQC: c_int = 54; ++pub const EBADSLT: c_int = 55; ++pub const EDEADLOCK: c_int = 56; ++pub const EMULTIHOP: c_int = 74; ++pub const EOVERFLOW: c_int = 79; ++pub const ENOTUNIQ: c_int = 80; ++pub const EBADFD: c_int = 81; ++pub const EBADMSG: c_int = 77; ++pub const EREMCHG: c_int = 82; ++pub const ELIBACC: c_int = 83; ++pub const ELIBBAD: c_int = 84; ++pub const ELIBSCN: c_int = 85; ++pub const ELIBMAX: c_int = 86; ++pub const ELIBEXEC: c_int = 87; ++pub const EILSEQ: c_int = 88; ++pub const ERESTART: c_int = 91; ++pub const ESTRPIPE: c_int = 92; ++pub const EUSERS: c_int = 94; ++pub const ENOTSOCK: c_int = 95; ++pub const EDESTADDRREQ: c_int = 96; ++pub const EMSGSIZE: c_int = 97; ++pub const EPROTOTYPE: c_int = 98; ++pub const ENOPROTOOPT: c_int = 99; ++pub const EPROTONOSUPPORT: c_int = 120; ++pub const ESOCKTNOSUPPORT: c_int = 121; ++pub const EOPNOTSUPP: c_int = 122; ++pub const ENOTSUP: c_int = EOPNOTSUPP; ++pub const EPFNOSUPPORT: c_int = 123; ++pub const EAFNOSUPPORT: c_int = 124; ++pub const EADDRINUSE: c_int = 125; ++pub const EADDRNOTAVAIL: c_int = 126; ++pub const ENETDOWN: c_int = 127; ++pub const ENETUNREACH: c_int = 128; ++pub const ENETRESET: c_int = 129; ++pub const ECONNABORTED: c_int = 130; ++pub const ECONNRESET: c_int = 131; ++pub const ENOBUFS: c_int = 132; ++pub const EISCONN: c_int = 133; ++pub const ENOTCONN: c_int = 134; ++pub const ESHUTDOWN: c_int = 143; ++pub const ETOOMANYREFS: c_int = 144; ++pub const ETIMEDOUT: c_int = 145; ++pub const ECONNREFUSED: c_int = 146; ++pub const EHOSTDOWN: c_int = 147; ++pub const EHOSTUNREACH: c_int = 148; ++pub const EALREADY: c_int = 149; ++pub const EINPROGRESS: c_int = 150; ++pub const ESTALE: c_int = 151; ++pub const EUCLEAN: c_int = 135; ++pub const ENOTNAM: c_int = 137; ++pub const ENAVAIL: c_int = 138; ++pub const EISNAM: c_int = 139; ++pub const EREMOTEIO: c_int = 140; ++pub const EDQUOT: c_int = 1133; ++pub const ENOMEDIUM: c_int = 159; ++pub const EMEDIUMTYPE: c_int = 160; ++pub const ECANCELED: c_int = 158; ++pub const ENOKEY: c_int = 161; ++pub const EKEYEXPIRED: c_int = 162; ++pub const EKEYREVOKED: c_int = 163; ++pub const EKEYREJECTED: c_int = 164; ++pub const EOWNERDEAD: c_int = 165; ++pub const ENOTRECOVERABLE: c_int = 166; ++pub const ERFKILL: c_int = 167; ++ ++pub const MAP_ANON: c_int = 0x800; ++pub const MAP_GROWSDOWN: c_int = 0x1000; ++pub const MAP_DENYWRITE: c_int = 0x2000; ++pub const MAP_EXECUTABLE: c_int = 0x4000; ++pub const MAP_LOCKED: c_int = 0x8000; ++pub const MAP_NORESERVE: c_int = 0x400; ++pub const MAP_POPULATE: c_int = 0x10000; ++pub const MAP_NONBLOCK: c_int = 0x20000; ++pub const MAP_STACK: c_int = 0x40000; ++pub const MAP_HUGETLB: c_int = 0x080000; ++ ++pub const SOCK_STREAM: c_int = 2; ++pub const SOCK_DGRAM: c_int = 1; ++ ++pub const SA_ONSTACK: c_int = 0x08000000; ++pub const SA_SIGINFO: c_int = 0x00000008; ++pub const SA_NOCLDWAIT: c_int = 0x00010000; ++ ++pub const SIGCHLD: c_int = 18; ++pub const SIGBUS: c_int = 10; ++pub const SIGTTIN: c_int = 26; ++pub const SIGTTOU: c_int = 27; ++pub const SIGXCPU: c_int = 30; ++pub const SIGXFSZ: c_int = 31; ++pub const SIGVTALRM: c_int = 28; ++pub const SIGPROF: c_int = 29; ++pub const SIGWINCH: c_int = 20; ++pub const SIGUSR1: c_int = 16; ++pub const SIGUSR2: c_int = 17; ++pub const SIGCONT: c_int = 25; ++pub const SIGSTOP: c_int = 23; ++pub const SIGTSTP: c_int = 24; ++pub const SIGURG: c_int = 21; ++pub const SIGIO: c_int = 22; ++pub const SIGSYS: c_int = 12; ++pub const SIGPOLL: c_int = 22; ++pub const SIGPWR: c_int = 19; ++pub const SIG_SETMASK: c_int = 3; ++pub const SIG_BLOCK: c_int = 0x1; ++pub const SIG_UNBLOCK: c_int = 0x2; ++ ++pub const POLLWRNORM: c_short = 0x004; ++pub const POLLWRBAND: c_short = 0x100; ++ ++pub const VEOF: usize = 16; ++pub const VEOL: usize = 17; ++pub const VEOL2: usize = 6; ++pub const VMIN: usize = 4; ++pub const IEXTEN: crate::tcflag_t = 0x00000100; ++pub const TOSTOP: crate::tcflag_t = 0x00008000; ++pub const FLUSHO: crate::tcflag_t = 0x00002000; ++pub const EXTPROC: crate::tcflag_t = 0o200000; ++ ++pub const F_GETLK: c_int = 14; ++pub const F_GETOWN: c_int = 23; ++pub const F_SETOWN: c_int = 24; ++pub const F_SETLK: c_int = 6; ++pub const F_SETLKW: c_int = 7; ++ ++pub const MCL_CURRENT: c_int = 0x0001; ++pub const MCL_FUTURE: c_int = 0x0002; ++pub const MCL_ONFAULT: c_int = 0x0004; ++ ++pub const CBAUD: crate::tcflag_t = 0o0010017; ++pub const TAB1: crate::tcflag_t = 0x00000800; ++pub const TAB2: crate::tcflag_t = 0x00001000; ++pub const TAB3: crate::tcflag_t = 0x00001800; ++pub const CR1: crate::tcflag_t = 0x00000200; ++pub const CR2: crate::tcflag_t = 0x00000400; ++pub const CR3: crate::tcflag_t = 0x00000600; ++pub const FF1: crate::tcflag_t = 0x00008000; ++pub const BS1: crate::tcflag_t = 0x00002000; ++pub const VT1: crate::tcflag_t = 0x00004000; ++pub const VWERASE: usize = 14; ++pub const VREPRINT: usize = 12; ++pub const VSUSP: usize = 10; ++pub const VSTART: usize = 8; ++pub const VSTOP: usize = 9; ++pub const VDISCARD: usize = 13; ++pub const VTIME: usize = 5; ++pub const IXON: crate::tcflag_t = 0x00000400; ++pub const IXOFF: crate::tcflag_t = 0x00001000; ++pub const ONLCR: crate::tcflag_t = 0x4; ++pub const CSIZE: crate::tcflag_t = 0x00000030; ++pub const CS6: crate::tcflag_t = 0x00000010; ++pub const CS7: crate::tcflag_t = 0x00000020; ++pub const CS8: crate::tcflag_t = 0x00000030; ++pub const CSTOPB: crate::tcflag_t = 0x00000040; ++pub const CREAD: crate::tcflag_t = 0x00000080; ++pub const PARENB: crate::tcflag_t = 0x00000100; ++pub const PARODD: crate::tcflag_t = 0x00000200; ++pub const HUPCL: crate::tcflag_t = 0x00000400; ++pub const CLOCAL: crate::tcflag_t = 0x00000800; ++pub const ECHOKE: crate::tcflag_t = 0x00000800; ++pub const ECHOE: crate::tcflag_t = 0x00000010; ++pub const ECHOK: crate::tcflag_t = 0x00000020; ++pub const ECHONL: crate::tcflag_t = 0x00000040; ++pub const ECHOPRT: crate::tcflag_t = 0x00000400; ++pub const ECHOCTL: crate::tcflag_t = 0x00000200; ++pub const ISIG: crate::tcflag_t = 0x00000001; ++pub const ICANON: crate::tcflag_t = 0x00000002; ++pub const PENDIN: crate::tcflag_t = 0x00004000; ++pub const NOFLSH: crate::tcflag_t = 0x00000080; ++pub const CIBAUD: crate::tcflag_t = 0o02003600000; ++pub const CBAUDEX: crate::tcflag_t = 0o010000; ++pub const VSWTC: usize = 7; ++pub const OLCUC: crate::tcflag_t = 0o000002; ++pub const NLDLY: crate::tcflag_t = 0o000400; ++pub const CRDLY: crate::tcflag_t = 0o003000; ++pub const TABDLY: crate::tcflag_t = 0o014000; ++pub const BSDLY: crate::tcflag_t = 0o020000; ++pub const FFDLY: crate::tcflag_t = 0o100000; ++pub const VTDLY: crate::tcflag_t = 0o040000; ++pub const XTABS: crate::tcflag_t = 0o014000; ++ ++pub const B57600: crate::speed_t = 0o010001; ++pub const B115200: crate::speed_t = 0o010002; ++pub const B230400: crate::speed_t = 0o010003; ++pub const B460800: crate::speed_t = 0o010004; ++pub const B500000: crate::speed_t = 0o010005; ++pub const B576000: crate::speed_t = 0o010006; ++pub const B921600: crate::speed_t = 0o010007; ++pub const B1000000: crate::speed_t = 0o010010; ++pub const B1152000: crate::speed_t = 0o010011; ++pub const B1500000: crate::speed_t = 0o010012; ++pub const B2000000: crate::speed_t = 0o010013; ++pub const B2500000: crate::speed_t = 0o010014; ++pub const B3000000: crate::speed_t = 0o010015; ++pub const B3500000: crate::speed_t = 0o010016; ++pub const B4000000: crate::speed_t = 0o010017; ++ ++pub const EHWPOISON: c_int = 168; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b64/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b64/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b64/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b64/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,115 @@ ++use crate::prelude::*; ++ ++pub type c_long = i64; ++pub type c_ulong = u64; ++pub type regoff_t = c_long; ++ ++s! { ++ pub struct stack_t { ++ pub ss_sp: *mut c_void, ++ pub ss_flags: c_int, ++ pub ss_size: size_t, ++ } ++ ++ pub struct pthread_attr_t { ++ __size: [u64; 7], ++ } ++ ++ pub struct sigset_t { ++ __val: [c_ulong; 16], ++ } ++ ++ pub struct shmid_ds { ++ pub shm_perm: crate::ipc_perm, ++ pub shm_segsz: size_t, ++ pub shm_atime: crate::time_t, ++ pub shm_dtime: crate::time_t, ++ pub shm_ctime: crate::time_t, ++ pub shm_cpid: crate::pid_t, ++ pub shm_lpid: crate::pid_t, ++ pub shm_nattch: c_ulong, ++ __pad1: c_ulong, ++ __pad2: c_ulong, ++ } ++ ++ pub struct msqid_ds { ++ pub msg_perm: crate::ipc_perm, ++ pub msg_stime: crate::time_t, ++ pub msg_rtime: crate::time_t, ++ pub msg_ctime: crate::time_t, ++ __msg_cbytes: c_ulong, ++ pub msg_qnum: crate::msgqnum_t, ++ pub msg_qbytes: crate::msglen_t, ++ pub msg_lspid: crate::pid_t, ++ pub msg_lrpid: crate::pid_t, ++ __pad1: c_ulong, ++ __pad2: c_ulong, ++ } ++ ++ pub struct msghdr { ++ pub msg_name: *mut c_void, ++ pub msg_namelen: crate::socklen_t, ++ pub msg_iov: *mut crate::iovec, ++ #[cfg(target_endian = "big")] ++ __pad1: c_int, ++ pub msg_iovlen: c_int, ++ #[cfg(target_endian = "little")] ++ __pad1: c_int, ++ pub msg_control: *mut c_void, ++ #[cfg(target_endian = "big")] ++ __pad2: c_int, ++ pub msg_controllen: crate::socklen_t, ++ #[cfg(target_endian = "little")] ++ __pad2: c_int, ++ pub msg_flags: c_int, ++ } ++ ++ pub struct cmsghdr { ++ #[cfg(target_endian = "big")] ++ pub __pad1: c_int, ++ pub cmsg_len: crate::socklen_t, ++ #[cfg(target_endian = "little")] ++ pub __pad1: c_int, ++ pub cmsg_level: c_int, ++ pub cmsg_type: c_int, ++ } ++ ++ pub struct sem_t { ++ __val: [c_int; 8], ++ } ++} ++ ++pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; ++pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; ++pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32; ++ ++extern "C" { ++ pub fn getrandom(buf: *mut c_void, buflen: size_t, flags: c_uint) -> ssize_t; ++} ++ ++cfg_if! { ++ if #[cfg(target_arch = "aarch64")] { ++ mod aarch64; ++ pub use self::aarch64::*; ++ } else if #[cfg(target_arch = "mips64")] { ++ mod mips64; ++ pub use self::mips64::*; ++ } else if #[cfg(any(target_arch = "powerpc64"))] { ++ mod powerpc64; ++ pub use self::powerpc64::*; ++ } else if #[cfg(any(target_arch = "s390x"))] { ++ mod s390x; ++ pub use self::s390x::*; ++ } else if #[cfg(any(target_arch = "x86_64"))] { ++ mod x86_64; ++ pub use self::x86_64::*; ++ } else if #[cfg(any(target_arch = "riscv64"))] { ++ mod riscv64; ++ pub use self::riscv64::*; ++ } else if #[cfg(any(target_arch = "loongarch64"))] { ++ mod loongarch64; ++ pub use self::loongarch64::*; ++ } else { ++ // Unknown target_arch ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b64/powerpc64.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b64/powerpc64.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b64/powerpc64.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b64/powerpc64.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,714 @@ ++use crate::off_t; ++use crate::prelude::*; ++ ++pub type c_char = u8; ++pub type wchar_t = i32; ++pub type __u64 = c_ulong; ++pub type __s64 = c_long; ++pub type nlink_t = u64; ++pub type blksize_t = c_long; ++ ++s! { ++ pub struct stat { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_mode: crate::mode_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ __pad0: c_int, ++ pub st_rdev: crate::dev_t, ++ pub st_size: off_t, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ __unused: [c_long; 3], ++ } ++ ++ pub struct stat64 { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino64_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_mode: crate::mode_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ __pad0: c_int, ++ pub st_rdev: crate::dev_t, ++ pub st_size: off_t, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt64_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ __reserved: [c_long; 3], ++ } ++ ++ pub struct ipc_perm { ++ pub __ipc_perm_key: crate::key_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub cuid: crate::uid_t, ++ pub cgid: crate::gid_t, ++ pub mode: crate::mode_t, ++ pub __seq: c_int, ++ __unused1: c_long, ++ __unused2: c_long, ++ } ++} ++ ++pub const MADV_SOFT_OFFLINE: c_int = 101; ++pub const MAP_32BIT: c_int = 0x0040; ++pub const O_APPEND: c_int = 1024; ++pub const O_DIRECT: c_int = 0x20000; ++pub const O_DIRECTORY: c_int = 0x4000; ++pub const O_LARGEFILE: c_int = 0x10000; ++pub const O_NOFOLLOW: c_int = 0x8000; ++pub const O_CREAT: c_int = 64; ++pub const O_EXCL: c_int = 128; ++pub const O_NOCTTY: c_int = 256; ++pub const O_NONBLOCK: c_int = 2048; ++pub const O_SYNC: c_int = 1052672; ++pub const O_RSYNC: c_int = 1052672; ++pub const O_DSYNC: c_int = 4096; ++pub const O_ASYNC: c_int = 0x2000; ++ ++pub const ENAMETOOLONG: c_int = 36; ++pub const ENOLCK: c_int = 37; ++pub const ENOSYS: c_int = 38; ++pub const ENOTEMPTY: c_int = 39; ++pub const ELOOP: c_int = 40; ++pub const ENOMSG: c_int = 42; ++pub const EIDRM: c_int = 43; ++pub const ECHRNG: c_int = 44; ++pub const EL2NSYNC: c_int = 45; ++pub const EL3HLT: c_int = 46; ++pub const EL3RST: c_int = 47; ++pub const ELNRNG: c_int = 48; ++pub const EUNATCH: c_int = 49; ++pub const ENOCSI: c_int = 50; ++pub const EL2HLT: c_int = 51; ++pub const EBADE: c_int = 52; ++pub const EBADR: c_int = 53; ++pub const EXFULL: c_int = 54; ++pub const ENOANO: c_int = 55; ++pub const EBADRQC: c_int = 56; ++pub const EBADSLT: c_int = 57; ++pub const EMULTIHOP: c_int = 72; ++pub const EBADMSG: c_int = 74; ++pub const EOVERFLOW: c_int = 75; ++pub const ENOTUNIQ: c_int = 76; ++pub const EBADFD: c_int = 77; ++pub const EREMCHG: c_int = 78; ++pub const ELIBACC: c_int = 79; ++pub const ELIBBAD: c_int = 80; ++pub const ELIBSCN: c_int = 81; ++pub const ELIBMAX: c_int = 82; ++pub const ELIBEXEC: c_int = 83; ++pub const EILSEQ: c_int = 84; ++pub const ERESTART: c_int = 85; ++pub const ESTRPIPE: c_int = 86; ++pub const EUSERS: c_int = 87; ++pub const ENOTSOCK: c_int = 88; ++pub const EDESTADDRREQ: c_int = 89; ++pub const EMSGSIZE: c_int = 90; ++pub const EPROTOTYPE: c_int = 91; ++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 EADDRINUSE: c_int = 98; ++pub const EADDRNOTAVAIL: c_int = 99; ++pub const ENETDOWN: c_int = 100; ++pub const ENETUNREACH: c_int = 101; ++pub const ENETRESET: c_int = 102; ++pub const ECONNABORTED: c_int = 103; ++pub const ECONNRESET: c_int = 104; ++pub const ENOBUFS: c_int = 105; ++pub const EISCONN: c_int = 106; ++pub const ENOTCONN: c_int = 107; ++pub const ESHUTDOWN: c_int = 108; ++pub const ETOOMANYREFS: c_int = 109; ++pub const ETIMEDOUT: c_int = 110; ++pub const ECONNREFUSED: c_int = 111; ++pub const EHOSTDOWN: c_int = 112; ++pub const EHOSTUNREACH: c_int = 113; ++pub const EALREADY: c_int = 114; ++pub const EINPROGRESS: c_int = 115; ++pub const ESTALE: c_int = 116; ++pub const EUCLEAN: c_int = 117; ++pub const ENOTNAM: c_int = 118; ++pub const ENAVAIL: c_int = 119; ++pub const EISNAM: c_int = 120; ++pub const EREMOTEIO: c_int = 121; ++pub const EDQUOT: c_int = 122; ++pub const ENOMEDIUM: c_int = 123; ++pub const EMEDIUMTYPE: c_int = 124; ++pub const ECANCELED: c_int = 125; ++pub const ENOKEY: c_int = 126; ++pub const EKEYEXPIRED: c_int = 127; ++pub const EKEYREVOKED: c_int = 128; ++pub const EKEYREJECTED: c_int = 129; ++pub const EOWNERDEAD: c_int = 130; ++pub const ENOTRECOVERABLE: c_int = 131; ++pub const ERFKILL: c_int = 132; ++pub const EHWPOISON: c_int = 133; ++ ++pub const MAP_ANON: c_int = 0x0020; ++pub const MAP_GROWSDOWN: c_int = 0x0100; ++pub const MAP_DENYWRITE: c_int = 0x0800; ++pub const MAP_EXECUTABLE: c_int = 0x01000; ++pub const MAP_LOCKED: c_int = 0x02000; ++pub const MAP_NORESERVE: c_int = 0x04000; ++pub const MAP_POPULATE: c_int = 0x08000; ++pub const MAP_NONBLOCK: c_int = 0x010000; ++pub const MAP_STACK: c_int = 0x020000; ++pub const MAP_HUGETLB: c_int = 0x040000; ++pub const MAP_SYNC: c_int = 0x080000; ++ ++pub const PTRACE_SYSEMU: c_int = 0x1d; ++pub const PTRACE_SYSEMU_SINGLESTEP: c_int = 0x1e; ++ ++pub const SOCK_STREAM: c_int = 1; ++pub const SOCK_DGRAM: c_int = 2; ++ ++pub const SA_ONSTACK: c_int = 0x08000000; ++pub const SA_SIGINFO: c_int = 0x00000004; ++pub const SA_NOCLDWAIT: c_int = 0x00000002; ++ ++pub const SIGCHLD: c_int = 17; ++pub const SIGBUS: c_int = 7; ++pub const SIGTTIN: c_int = 21; ++pub const SIGTTOU: c_int = 22; ++pub const SIGXCPU: c_int = 24; ++pub const SIGXFSZ: c_int = 25; ++pub const SIGVTALRM: c_int = 26; ++pub const SIGPROF: c_int = 27; ++pub const SIGWINCH: c_int = 28; ++pub const SIGUSR1: c_int = 10; ++pub const SIGUSR2: c_int = 12; ++pub const SIGCONT: c_int = 18; ++pub const SIGSTOP: c_int = 19; ++pub const SIGTSTP: c_int = 20; ++pub const SIGURG: c_int = 23; ++pub const SIGIO: c_int = 29; ++pub const SIGSYS: c_int = 31; ++pub const SIGSTKFLT: c_int = 16; ++pub const SIGPOLL: c_int = 29; ++pub const SIGPWR: c_int = 30; ++pub const SIG_SETMASK: c_int = 2; ++pub const SIG_BLOCK: c_int = 0x000000; ++pub const SIG_UNBLOCK: c_int = 0x01; ++ ++pub const F_GETLK: c_int = 5; ++pub const F_GETOWN: c_int = 9; ++pub const F_SETLK: c_int = 6; ++pub const F_SETLKW: c_int = 7; ++pub const F_SETOWN: c_int = 8; ++ ++pub const VEOF: usize = 4; ++ ++pub const POLLWRNORM: c_short = 0x100; ++pub const POLLWRBAND: c_short = 0x200; ++ ++pub const SIGSTKSZ: size_t = 10240; ++pub const MINSIGSTKSZ: size_t = 4096; ++ ++// Syscall table ++pub const SYS_restart_syscall: c_long = 0; ++pub const SYS_exit: c_long = 1; ++pub const SYS_fork: c_long = 2; ++pub const SYS_read: c_long = 3; ++pub const SYS_write: c_long = 4; ++pub const SYS_open: c_long = 5; ++pub const SYS_close: c_long = 6; ++pub const SYS_waitpid: c_long = 7; ++pub const SYS_creat: c_long = 8; ++pub const SYS_link: c_long = 9; ++pub const SYS_unlink: c_long = 10; ++pub const SYS_execve: c_long = 11; ++pub const SYS_chdir: c_long = 12; ++pub const SYS_time: c_long = 13; ++pub const SYS_mknod: c_long = 14; ++pub const SYS_chmod: c_long = 15; ++pub const SYS_lchown: c_long = 16; ++pub const SYS_break: c_long = 17; ++pub const SYS_oldstat: c_long = 18; ++pub const SYS_lseek: c_long = 19; ++pub const SYS_getpid: c_long = 20; ++pub const SYS_mount: c_long = 21; ++pub const SYS_umount: c_long = 22; ++pub const SYS_setuid: c_long = 23; ++pub const SYS_getuid: c_long = 24; ++pub const SYS_stime: c_long = 25; ++pub const SYS_ptrace: c_long = 26; ++pub const SYS_alarm: c_long = 27; ++pub const SYS_oldfstat: c_long = 28; ++pub const SYS_pause: c_long = 29; ++pub const SYS_utime: c_long = 30; ++pub const SYS_stty: c_long = 31; ++pub const SYS_gtty: c_long = 32; ++pub const SYS_access: c_long = 33; ++pub const SYS_nice: c_long = 34; ++pub const SYS_ftime: c_long = 35; ++pub const SYS_sync: c_long = 36; ++pub const SYS_kill: c_long = 37; ++pub const SYS_rename: c_long = 38; ++pub const SYS_mkdir: c_long = 39; ++pub const SYS_rmdir: c_long = 40; ++pub const SYS_dup: c_long = 41; ++pub const SYS_pipe: c_long = 42; ++pub const SYS_times: c_long = 43; ++pub const SYS_prof: c_long = 44; ++pub const SYS_brk: c_long = 45; ++pub const SYS_setgid: c_long = 46; ++pub const SYS_getgid: c_long = 47; ++pub const SYS_signal: c_long = 48; ++pub const SYS_geteuid: c_long = 49; ++pub const SYS_getegid: c_long = 50; ++pub const SYS_acct: c_long = 51; ++pub const SYS_umount2: c_long = 52; ++pub const SYS_lock: c_long = 53; ++pub const SYS_ioctl: c_long = 54; ++pub const SYS_fcntl: c_long = 55; ++pub const SYS_mpx: c_long = 56; ++pub const SYS_setpgid: c_long = 57; ++pub const SYS_ulimit: c_long = 58; ++pub const SYS_oldolduname: c_long = 59; ++pub const SYS_umask: c_long = 60; ++pub const SYS_chroot: c_long = 61; ++pub const SYS_ustat: c_long = 62; ++pub const SYS_dup2: c_long = 63; ++pub const SYS_getppid: c_long = 64; ++pub const SYS_getpgrp: c_long = 65; ++pub const SYS_setsid: c_long = 66; ++pub const SYS_sigaction: c_long = 67; ++pub const SYS_sgetmask: c_long = 68; ++pub const SYS_ssetmask: c_long = 69; ++pub const SYS_setreuid: c_long = 70; ++pub const SYS_setregid: c_long = 71; ++pub const SYS_sigsuspend: c_long = 72; ++pub const SYS_sigpending: c_long = 73; ++pub const SYS_sethostname: c_long = 74; ++pub const SYS_setrlimit: c_long = 75; ++pub const SYS_getrlimit: c_long = 76; ++pub const SYS_getrusage: c_long = 77; ++pub const SYS_gettimeofday: c_long = 78; ++pub const SYS_settimeofday: c_long = 79; ++pub const SYS_getgroups: c_long = 80; ++pub const SYS_setgroups: c_long = 81; ++pub const SYS_select: c_long = 82; ++pub const SYS_symlink: c_long = 83; ++pub const SYS_oldlstat: c_long = 84; ++pub const SYS_readlink: c_long = 85; ++pub const SYS_uselib: c_long = 86; ++pub const SYS_swapon: c_long = 87; ++pub const SYS_reboot: c_long = 88; ++pub const SYS_readdir: c_long = 89; ++pub const SYS_mmap: c_long = 90; ++pub const SYS_munmap: c_long = 91; ++pub const SYS_truncate: c_long = 92; ++pub const SYS_ftruncate: c_long = 93; ++pub const SYS_fchmod: c_long = 94; ++pub const SYS_fchown: c_long = 95; ++pub const SYS_getpriority: c_long = 96; ++pub const SYS_setpriority: c_long = 97; ++pub const SYS_profil: c_long = 98; ++pub const SYS_statfs: c_long = 99; ++pub const SYS_fstatfs: c_long = 100; ++pub const SYS_ioperm: c_long = 101; ++pub const SYS_socketcall: c_long = 102; ++pub const SYS_syslog: c_long = 103; ++pub const SYS_setitimer: c_long = 104; ++pub const SYS_getitimer: c_long = 105; ++pub const SYS_stat: c_long = 106; ++pub const SYS_lstat: c_long = 107; ++pub const SYS_fstat: c_long = 108; ++pub const SYS_olduname: c_long = 109; ++pub const SYS_iopl: c_long = 110; ++pub const SYS_vhangup: c_long = 111; ++pub const SYS_idle: c_long = 112; ++pub const SYS_vm86: c_long = 113; ++pub const SYS_wait4: c_long = 114; ++pub const SYS_swapoff: c_long = 115; ++pub const SYS_sysinfo: c_long = 116; ++pub const SYS_ipc: c_long = 117; ++pub const SYS_fsync: c_long = 118; ++pub const SYS_sigreturn: c_long = 119; ++pub const SYS_clone: c_long = 120; ++pub const SYS_setdomainname: c_long = 121; ++pub const SYS_uname: c_long = 122; ++pub const SYS_modify_ldt: c_long = 123; ++pub const SYS_adjtimex: c_long = 124; ++pub const SYS_mprotect: c_long = 125; ++pub const SYS_sigprocmask: c_long = 126; ++pub const SYS_create_module: c_long = 127; ++pub const SYS_init_module: c_long = 128; ++pub const SYS_delete_module: c_long = 129; ++pub const SYS_get_kernel_syms: c_long = 130; ++pub const SYS_quotactl: c_long = 131; ++pub const SYS_getpgid: c_long = 132; ++pub const SYS_fchdir: c_long = 133; ++pub const SYS_bdflush: c_long = 134; ++pub const SYS_sysfs: c_long = 135; ++pub const SYS_personality: c_long = 136; ++pub const SYS_afs_syscall: c_long = 137; /* Syscall for Andrew File System */ ++pub const SYS_setfsuid: c_long = 138; ++pub const SYS_setfsgid: c_long = 139; ++pub const SYS__llseek: c_long = 140; ++pub const SYS_getdents: c_long = 141; ++pub const SYS__newselect: c_long = 142; ++pub const SYS_flock: c_long = 143; ++pub const SYS_msync: c_long = 144; ++pub const SYS_readv: c_long = 145; ++pub const SYS_writev: c_long = 146; ++pub const SYS_getsid: c_long = 147; ++pub const SYS_fdatasync: c_long = 148; ++pub const SYS__sysctl: c_long = 149; ++pub const SYS_mlock: c_long = 150; ++pub const SYS_munlock: c_long = 151; ++pub const SYS_mlockall: c_long = 152; ++pub const SYS_munlockall: c_long = 153; ++pub const SYS_sched_setparam: c_long = 154; ++pub const SYS_sched_getparam: c_long = 155; ++pub const SYS_sched_setscheduler: c_long = 156; ++pub const SYS_sched_getscheduler: c_long = 157; ++pub const SYS_sched_yield: c_long = 158; ++pub const SYS_sched_get_priority_max: c_long = 159; ++pub const SYS_sched_get_priority_min: c_long = 160; ++pub const SYS_sched_rr_get_interval: c_long = 161; ++pub const SYS_nanosleep: c_long = 162; ++pub const SYS_mremap: c_long = 163; ++pub const SYS_setresuid: c_long = 164; ++pub const SYS_getresuid: c_long = 165; ++pub const SYS_query_module: c_long = 166; ++pub const SYS_poll: c_long = 167; ++pub const SYS_nfsservctl: c_long = 168; ++pub const SYS_setresgid: c_long = 169; ++pub const SYS_getresgid: c_long = 170; ++pub const SYS_prctl: c_long = 171; ++pub const SYS_rt_sigreturn: c_long = 172; ++pub const SYS_rt_sigaction: c_long = 173; ++pub const SYS_rt_sigprocmask: c_long = 174; ++pub const SYS_rt_sigpending: c_long = 175; ++pub const SYS_rt_sigtimedwait: c_long = 176; ++pub const SYS_rt_sigqueueinfo: c_long = 177; ++pub const SYS_rt_sigsuspend: c_long = 178; ++pub const SYS_pread64: c_long = 179; ++pub const SYS_pwrite64: c_long = 180; ++pub const SYS_chown: c_long = 181; ++pub const SYS_getcwd: c_long = 182; ++pub const SYS_capget: c_long = 183; ++pub const SYS_capset: c_long = 184; ++pub const SYS_sigaltstack: c_long = 185; ++pub const SYS_sendfile: c_long = 186; ++pub const SYS_getpmsg: c_long = 187; /* some people actually want streams */ ++pub const SYS_putpmsg: c_long = 188; /* some people actually want streams */ ++pub const SYS_vfork: c_long = 189; ++pub const SYS_ugetrlimit: c_long = 190; /* SuS compliant getrlimit */ ++pub const SYS_readahead: c_long = 191; ++pub const SYS_pciconfig_read: c_long = 198; ++pub const SYS_pciconfig_write: c_long = 199; ++pub const SYS_pciconfig_iobase: c_long = 200; ++pub const SYS_multiplexer: c_long = 201; ++pub const SYS_getdents64: c_long = 202; ++pub const SYS_pivot_root: c_long = 203; ++pub const SYS_madvise: c_long = 205; ++pub const SYS_mincore: c_long = 206; ++pub const SYS_gettid: c_long = 207; ++pub const SYS_tkill: c_long = 208; ++pub const SYS_setxattr: c_long = 209; ++pub const SYS_lsetxattr: c_long = 210; ++pub const SYS_fsetxattr: c_long = 211; ++pub const SYS_getxattr: c_long = 212; ++pub const SYS_lgetxattr: c_long = 213; ++pub const SYS_fgetxattr: c_long = 214; ++pub const SYS_listxattr: c_long = 215; ++pub const SYS_llistxattr: c_long = 216; ++pub const SYS_flistxattr: c_long = 217; ++pub const SYS_removexattr: c_long = 218; ++pub const SYS_lremovexattr: c_long = 219; ++pub const SYS_fremovexattr: c_long = 220; ++pub const SYS_futex: c_long = 221; ++pub const SYS_sched_setaffinity: c_long = 222; ++pub const SYS_sched_getaffinity: c_long = 223; ++pub const SYS_tuxcall: c_long = 225; ++pub const SYS_io_setup: c_long = 227; ++pub const SYS_io_destroy: c_long = 228; ++pub const SYS_io_getevents: c_long = 229; ++pub const SYS_io_submit: c_long = 230; ++pub const SYS_io_cancel: c_long = 231; ++pub const SYS_set_tid_address: c_long = 232; ++pub const SYS_exit_group: c_long = 234; ++pub const SYS_lookup_dcookie: c_long = 235; ++pub const SYS_epoll_create: c_long = 236; ++pub const SYS_epoll_ctl: c_long = 237; ++pub const SYS_epoll_wait: c_long = 238; ++pub const SYS_remap_file_pages: c_long = 239; ++pub const SYS_timer_create: c_long = 240; ++pub const SYS_timer_settime: c_long = 241; ++pub const SYS_timer_gettime: c_long = 242; ++pub const SYS_timer_getoverrun: c_long = 243; ++pub const SYS_timer_delete: c_long = 244; ++pub const SYS_clock_settime: c_long = 245; ++pub const SYS_clock_gettime: c_long = 246; ++pub const SYS_clock_getres: c_long = 247; ++pub const SYS_clock_nanosleep: c_long = 248; ++pub const SYS_swapcontext: c_long = 249; ++pub const SYS_tgkill: c_long = 250; ++pub const SYS_utimes: c_long = 251; ++pub const SYS_statfs64: c_long = 252; ++pub const SYS_fstatfs64: c_long = 253; ++pub const SYS_rtas: c_long = 255; ++pub const SYS_sys_debug_setcontext: c_long = 256; ++pub const SYS_migrate_pages: c_long = 258; ++pub const SYS_mbind: c_long = 259; ++pub const SYS_get_mempolicy: c_long = 260; ++pub const SYS_set_mempolicy: c_long = 261; ++pub const SYS_mq_open: c_long = 262; ++pub const SYS_mq_unlink: c_long = 263; ++pub const SYS_mq_timedsend: c_long = 264; ++pub const SYS_mq_timedreceive: c_long = 265; ++pub const SYS_mq_notify: c_long = 266; ++pub const SYS_mq_getsetattr: c_long = 267; ++pub const SYS_kexec_load: c_long = 268; ++pub const SYS_add_key: c_long = 269; ++pub const SYS_request_key: c_long = 270; ++pub const SYS_keyctl: c_long = 271; ++pub const SYS_waitid: c_long = 272; ++pub const SYS_ioprio_set: c_long = 273; ++pub const SYS_ioprio_get: c_long = 274; ++pub const SYS_inotify_init: c_long = 275; ++pub const SYS_inotify_add_watch: c_long = 276; ++pub const SYS_inotify_rm_watch: c_long = 277; ++pub const SYS_spu_run: c_long = 278; ++pub const SYS_spu_create: c_long = 279; ++pub const SYS_pselect6: c_long = 280; ++pub const SYS_ppoll: c_long = 281; ++pub const SYS_unshare: c_long = 282; ++pub const SYS_splice: c_long = 283; ++pub const SYS_tee: c_long = 284; ++pub const SYS_vmsplice: c_long = 285; ++pub const SYS_openat: c_long = 286; ++pub const SYS_mkdirat: c_long = 287; ++pub const SYS_mknodat: c_long = 288; ++pub const SYS_fchownat: c_long = 289; ++pub const SYS_futimesat: c_long = 290; ++pub const SYS_newfstatat: c_long = 291; ++pub const SYS_unlinkat: c_long = 292; ++pub const SYS_renameat: c_long = 293; ++pub const SYS_linkat: c_long = 294; ++pub const SYS_symlinkat: c_long = 295; ++pub const SYS_readlinkat: c_long = 296; ++pub const SYS_fchmodat: c_long = 297; ++pub const SYS_faccessat: c_long = 298; ++pub const SYS_get_robust_list: c_long = 299; ++pub const SYS_set_robust_list: c_long = 300; ++pub const SYS_move_pages: c_long = 301; ++pub const SYS_getcpu: c_long = 302; ++pub const SYS_epoll_pwait: c_long = 303; ++pub const SYS_utimensat: c_long = 304; ++pub const SYS_signalfd: c_long = 305; ++pub const SYS_timerfd_create: c_long = 306; ++pub const SYS_eventfd: c_long = 307; ++pub const SYS_sync_file_range2: c_long = 308; ++pub const SYS_fallocate: c_long = 309; ++pub const SYS_subpage_prot: c_long = 310; ++pub const SYS_timerfd_settime: c_long = 311; ++pub const SYS_timerfd_gettime: c_long = 312; ++pub const SYS_signalfd4: c_long = 313; ++pub const SYS_eventfd2: c_long = 314; ++pub const SYS_epoll_create1: c_long = 315; ++pub const SYS_dup3: c_long = 316; ++pub const SYS_pipe2: c_long = 317; ++pub const SYS_inotify_init1: c_long = 318; ++pub const SYS_perf_event_open: c_long = 319; ++pub const SYS_preadv: c_long = 320; ++pub const SYS_pwritev: c_long = 321; ++pub const SYS_rt_tgsigqueueinfo: c_long = 322; ++pub const SYS_fanotify_init: c_long = 323; ++pub const SYS_fanotify_mark: c_long = 324; ++pub const SYS_prlimit64: c_long = 325; ++pub const SYS_socket: c_long = 326; ++pub const SYS_bind: c_long = 327; ++pub const SYS_connect: c_long = 328; ++pub const SYS_listen: c_long = 329; ++pub const SYS_accept: c_long = 330; ++pub const SYS_getsockname: c_long = 331; ++pub const SYS_getpeername: c_long = 332; ++pub const SYS_socketpair: c_long = 333; ++pub const SYS_send: c_long = 334; ++pub const SYS_sendto: c_long = 335; ++pub const SYS_recv: c_long = 336; ++pub const SYS_recvfrom: c_long = 337; ++pub const SYS_shutdown: c_long = 338; ++pub const SYS_setsockopt: c_long = 339; ++pub const SYS_getsockopt: c_long = 340; ++pub const SYS_sendmsg: c_long = 341; ++pub const SYS_recvmsg: c_long = 342; ++pub const SYS_recvmmsg: c_long = 343; ++pub const SYS_accept4: c_long = 344; ++pub const SYS_name_to_handle_at: c_long = 345; ++pub const SYS_open_by_handle_at: c_long = 346; ++pub const SYS_clock_adjtime: c_long = 347; ++pub const SYS_syncfs: c_long = 348; ++pub const SYS_sendmmsg: c_long = 349; ++pub const SYS_setns: c_long = 350; ++pub const SYS_process_vm_readv: c_long = 351; ++pub const SYS_process_vm_writev: c_long = 352; ++pub const SYS_finit_module: c_long = 353; ++pub const SYS_kcmp: c_long = 354; ++pub const SYS_sched_setattr: c_long = 355; ++pub const SYS_sched_getattr: c_long = 356; ++pub const SYS_renameat2: c_long = 357; ++pub const SYS_seccomp: c_long = 358; ++pub const SYS_getrandom: c_long = 359; ++pub const SYS_memfd_create: c_long = 360; ++pub const SYS_bpf: c_long = 361; ++pub const SYS_execveat: c_long = 362; ++pub const SYS_switch_endian: c_long = 363; ++pub const SYS_userfaultfd: c_long = 364; ++pub const SYS_membarrier: c_long = 365; ++pub const SYS_mlock2: c_long = 378; ++pub const SYS_copy_file_range: c_long = 379; ++pub const SYS_preadv2: c_long = 380; ++pub const SYS_pwritev2: c_long = 381; ++pub const SYS_kexec_file_load: c_long = 382; ++pub const SYS_statx: c_long = 383; ++pub const SYS_pkey_alloc: c_long = 384; ++pub const SYS_pkey_free: c_long = 385; ++pub const SYS_pkey_mprotect: c_long = 386; ++pub const SYS_rseq: c_long = 387; ++pub const SYS_io_pgetevents: c_long = 388; ++pub const SYS_semtimedop: c_long = 392; ++pub const SYS_semget: c_long = 393; ++pub const SYS_semctl: c_long = 394; ++pub const SYS_shmget: c_long = 395; ++pub const SYS_shmctl: c_long = 396; ++pub const SYS_shmat: c_long = 397; ++pub const SYS_shmdt: c_long = 398; ++pub const SYS_msgget: c_long = 399; ++pub const SYS_msgsnd: c_long = 400; ++pub const SYS_msgrcv: c_long = 401; ++pub const SYS_msgctl: c_long = 402; ++pub const SYS_pidfd_send_signal: c_long = 424; ++pub const SYS_io_uring_setup: c_long = 425; ++pub const SYS_io_uring_enter: c_long = 426; ++pub const SYS_io_uring_register: c_long = 427; ++pub const SYS_open_tree: c_long = 428; ++pub const SYS_move_mount: c_long = 429; ++pub const SYS_fsopen: c_long = 430; ++pub const SYS_fsconfig: c_long = 431; ++pub const SYS_fsmount: c_long = 432; ++pub const SYS_fspick: c_long = 433; ++pub const SYS_pidfd_open: c_long = 434; ++pub const SYS_clone3: c_long = 435; ++pub const SYS_close_range: c_long = 436; ++pub const SYS_openat2: c_long = 437; ++pub const SYS_pidfd_getfd: c_long = 438; ++pub const SYS_faccessat2: c_long = 439; ++pub const SYS_process_madvise: c_long = 440; ++pub const SYS_epoll_pwait2: c_long = 441; ++pub const SYS_mount_setattr: c_long = 442; ++pub const SYS_quotactl_fd: c_long = 443; ++pub const SYS_landlock_create_ruleset: c_long = 444; ++pub const SYS_landlock_add_rule: c_long = 445; ++pub const SYS_landlock_restrict_self: c_long = 446; ++pub const SYS_memfd_secret: c_long = 447; ++pub const SYS_process_mrelease: c_long = 448; ++pub const SYS_futex_waitv: c_long = 449; ++pub const SYS_set_mempolicy_home_node: c_long = 450; ++ ++pub const EDEADLK: c_int = 58; ++pub const EDEADLOCK: c_int = EDEADLK; ++ ++pub const EXTPROC: crate::tcflag_t = 0x10000000; ++pub const VEOL: usize = 6; ++pub const VEOL2: usize = 8; ++pub const VMIN: usize = 5; ++pub const IEXTEN: crate::tcflag_t = 0x00000400; ++pub const TOSTOP: crate::tcflag_t = 0x00400000; ++pub const FLUSHO: crate::tcflag_t = 0x00800000; ++ ++pub const MCL_CURRENT: c_int = 0x2000; ++pub const MCL_FUTURE: c_int = 0x4000; ++pub const MCL_ONFAULT: c_int = 0x8000; ++pub const CBAUD: crate::tcflag_t = 0xff; ++pub const TAB1: c_int = 0x400; ++pub const TAB2: c_int = 0x800; ++pub const TAB3: c_int = 0xc00; ++pub const CR1: c_int = 0x1000; ++pub const CR2: c_int = 0x2000; ++pub const CR3: c_int = 0x3000; ++pub const FF1: c_int = 0x4000; ++pub const BS1: c_int = 0x8000; ++pub const VT1: c_int = 0x10000; ++pub const VWERASE: usize = 10; ++pub const VREPRINT: usize = 11; ++pub const VSUSP: usize = 12; ++pub const VSTART: usize = 13; ++pub const VSTOP: usize = 14; ++pub const VDISCARD: usize = 16; ++pub const VTIME: usize = 7; ++pub const IXON: crate::tcflag_t = 0x00000200; ++pub const IXOFF: crate::tcflag_t = 0x00000400; ++pub const ONLCR: crate::tcflag_t = 0x2; ++pub const CSIZE: crate::tcflag_t = 0x00000300; ++ ++pub const CS6: crate::tcflag_t = 0x00000100; ++pub const CS7: crate::tcflag_t = 0x00000200; ++pub const CS8: crate::tcflag_t = 0x00000300; ++pub const CSTOPB: crate::tcflag_t = 0x00000400; ++pub const CREAD: crate::tcflag_t = 0x00000800; ++pub const PARENB: crate::tcflag_t = 0x00001000; ++pub const PARODD: crate::tcflag_t = 0x00002000; ++pub const HUPCL: crate::tcflag_t = 0x00004000; ++pub const CLOCAL: crate::tcflag_t = 0x00008000; ++pub const ECHOKE: crate::tcflag_t = 0x00000001; ++pub const ECHOE: crate::tcflag_t = 0x00000002; ++pub const ECHOK: crate::tcflag_t = 0x00000004; ++pub const ECHONL: crate::tcflag_t = 0x00000010; ++pub const ECHOPRT: crate::tcflag_t = 0x00000020; ++pub const ECHOCTL: crate::tcflag_t = 0x00000040; ++pub const ISIG: crate::tcflag_t = 0x00000080; ++pub const ICANON: crate::tcflag_t = 0x00000100; ++pub const PENDIN: crate::tcflag_t = 0x20000000; ++pub const NOFLSH: crate::tcflag_t = 0x80000000; ++ ++pub const CIBAUD: crate::tcflag_t = 0o77600000; ++pub const CBAUDEX: crate::tcflag_t = 0o0000020; ++pub const VSWTC: usize = 9; ++pub const OLCUC: crate::tcflag_t = 0o000004; ++pub const NLDLY: crate::tcflag_t = 0o0001400; ++pub const CRDLY: crate::tcflag_t = 0o0030000; ++pub const TABDLY: crate::tcflag_t = 0o0006000; ++pub const BSDLY: crate::tcflag_t = 0o0100000; ++pub const FFDLY: crate::tcflag_t = 0o0040000; ++pub const VTDLY: crate::tcflag_t = 0o0200000; ++pub const XTABS: crate::tcflag_t = 0o00006000; ++ ++pub const B57600: crate::speed_t = 0o00020; ++pub const B115200: crate::speed_t = 0o00021; ++pub const B230400: crate::speed_t = 0o00022; ++pub const B460800: crate::speed_t = 0o00023; ++pub const B500000: crate::speed_t = 0o00024; ++pub const B576000: crate::speed_t = 0o00025; ++pub const B921600: crate::speed_t = 0o00026; ++pub const B1000000: crate::speed_t = 0o00027; ++pub const B1152000: crate::speed_t = 0o00030; ++pub const B1500000: crate::speed_t = 0o00031; ++pub const B2000000: crate::speed_t = 0o00032; ++pub const B2500000: crate::speed_t = 0o00033; ++pub const B3000000: crate::speed_t = 0o00034; ++pub const B3500000: crate::speed_t = 0o00035; ++pub const B4000000: crate::speed_t = 0o00036; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b64/riscv64/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,677 @@ ++//! RISC-V-specific definitions for 64-bit linux-like values ++ ++use crate::prelude::*; ++use crate::{off64_t, off_t}; ++ ++pub type c_char = u8; ++pub type wchar_t = c_int; ++ ++pub type nlink_t = c_uint; ++pub type blksize_t = c_int; ++pub type __u64 = c_ulonglong; ++pub type __s64 = c_longlong; ++ ++s! { ++ pub struct stat { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ pub __pad1: crate::dev_t, ++ pub st_size: off_t, ++ pub st_blksize: crate::blksize_t, ++ pub __pad2: c_int, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ __unused: [c_int; 2usize], ++ } ++ ++ pub struct stat64 { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino64_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ pub __pad1: crate::dev_t, ++ pub st_size: off64_t, ++ pub st_blksize: crate::blksize_t, ++ pub __pad2: c_int, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ __unused: [c_int; 2], ++ } ++ ++ pub struct ipc_perm { ++ pub __key: crate::key_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub cuid: crate::uid_t, ++ pub cgid: crate::gid_t, ++ pub mode: c_ushort, ++ __pad1: c_ushort, ++ pub __seq: c_ushort, ++ __pad2: c_ushort, ++ __unused1: c_ulong, ++ __unused2: c_ulong, ++ } ++ ++ #[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, ++ } ++} ++ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ pub struct ucontext_t { ++ pub __uc_flags: c_ulong, ++ pub uc_link: *mut ucontext_t, ++ pub uc_stack: crate::stack_t, ++ pub uc_sigmask: crate::sigset_t, ++ pub uc_mcontext: mcontext_t, ++ } ++ ++ #[allow(missing_debug_implementations)] ++ #[repr(align(16))] ++ pub struct mcontext_t { ++ pub __gregs: [c_ulong; 32], ++ pub __fpregs: __riscv_mc_fp_state, ++ } ++ ++ pub union __riscv_mc_fp_state { ++ pub __f: __riscv_mc_f_ext_state, ++ pub __d: __riscv_mc_d_ext_state, ++ pub __q: __riscv_mc_q_ext_state, ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub struct __riscv_mc_f_ext_state { ++ pub __f: [c_uint; 32], ++ pub __fcsr: c_uint, ++ } ++ ++ #[allow(missing_debug_implementations)] ++ pub struct __riscv_mc_d_ext_state { ++ pub __f: [c_ulonglong; 32], ++ pub __fcsr: c_uint, ++ } ++ ++ #[allow(missing_debug_implementations)] ++ #[repr(align(16))] ++ pub struct __riscv_mc_q_ext_state { ++ pub __f: [c_ulonglong; 64], ++ pub __fcsr: c_uint, ++ pub __glibc_reserved: [c_uint; 3], ++ } ++} ++ ++pub const SYS_read: c_long = 63; ++pub const SYS_write: c_long = 64; ++pub const SYS_close: c_long = 57; ++pub const SYS_fstat: c_long = 80; ++pub const SYS_lseek: c_long = 62; ++pub const SYS_mmap: c_long = 222; ++pub const SYS_mprotect: c_long = 226; ++pub const SYS_munmap: c_long = 215; ++pub const SYS_brk: c_long = 214; ++pub const SYS_rt_sigaction: c_long = 134; ++pub const SYS_rt_sigprocmask: c_long = 135; ++pub const SYS_rt_sigreturn: c_long = 139; ++pub const SYS_ioctl: c_long = 29; ++pub const SYS_pread64: c_long = 67; ++pub const SYS_pwrite64: c_long = 68; ++pub const SYS_readv: c_long = 65; ++pub const SYS_writev: c_long = 66; ++pub const SYS_sched_yield: c_long = 124; ++pub const SYS_mremap: c_long = 216; ++pub const SYS_msync: c_long = 227; ++pub const SYS_mincore: c_long = 232; ++pub const SYS_madvise: c_long = 233; ++pub const SYS_shmget: c_long = 194; ++pub const SYS_shmat: c_long = 196; ++pub const SYS_shmctl: c_long = 195; ++pub const SYS_dup: c_long = 23; ++pub const SYS_nanosleep: c_long = 101; ++pub const SYS_getitimer: c_long = 102; ++pub const SYS_setitimer: c_long = 103; ++pub const SYS_getpid: c_long = 172; ++pub const SYS_sendfile: c_long = 71; ++pub const SYS_socket: c_long = 198; ++pub const SYS_connect: c_long = 203; ++pub const SYS_accept: c_long = 202; ++pub const SYS_sendto: c_long = 206; ++pub const SYS_recvfrom: c_long = 207; ++pub const SYS_sendmsg: c_long = 211; ++pub const SYS_recvmsg: c_long = 212; ++pub const SYS_shutdown: c_long = 210; ++pub const SYS_bind: c_long = 200; ++pub const SYS_listen: c_long = 201; ++pub const SYS_getsockname: c_long = 204; ++pub const SYS_getpeername: c_long = 205; ++pub const SYS_socketpair: c_long = 199; ++pub const SYS_setsockopt: c_long = 208; ++pub const SYS_getsockopt: c_long = 209; ++pub const SYS_clone: c_long = 220; ++pub const SYS_execve: c_long = 221; ++pub const SYS_exit: c_long = 93; ++pub const SYS_wait4: c_long = 260; ++pub const SYS_kill: c_long = 129; ++pub const SYS_uname: c_long = 160; ++pub const SYS_semget: c_long = 190; ++pub const SYS_semop: c_long = 193; ++pub const SYS_semctl: c_long = 191; ++pub const SYS_shmdt: c_long = 197; ++pub const SYS_msgget: c_long = 186; ++pub const SYS_msgsnd: c_long = 189; ++pub const SYS_msgrcv: c_long = 188; ++pub const SYS_msgctl: c_long = 187; ++pub const SYS_fcntl: c_long = 25; ++pub const SYS_flock: c_long = 32; ++pub const SYS_fsync: c_long = 82; ++pub const SYS_fdatasync: c_long = 83; ++pub const SYS_truncate: c_long = 45; ++pub const SYS_ftruncate: c_long = 46; ++pub const SYS_getcwd: c_long = 17; ++pub const SYS_chdir: c_long = 49; ++pub const SYS_fchdir: c_long = 50; ++pub const SYS_fchmod: c_long = 52; ++pub const SYS_fchown: c_long = 55; ++pub const SYS_umask: c_long = 166; ++pub const SYS_gettimeofday: c_long = 169; ++pub const SYS_getrlimit: c_long = 163; ++pub const SYS_getrusage: c_long = 165; ++pub const SYS_sysinfo: c_long = 179; ++pub const SYS_times: c_long = 153; ++pub const SYS_ptrace: c_long = 117; ++pub const SYS_getuid: c_long = 174; ++pub const SYS_syslog: c_long = 116; ++pub const SYS_getgid: c_long = 176; ++pub const SYS_setuid: c_long = 146; ++pub const SYS_setgid: c_long = 144; ++pub const SYS_geteuid: c_long = 175; ++pub const SYS_getegid: c_long = 177; ++pub const SYS_setpgid: c_long = 154; ++pub const SYS_getppid: c_long = 173; ++pub const SYS_setsid: c_long = 157; ++pub const SYS_setreuid: c_long = 145; ++pub const SYS_setregid: c_long = 143; ++pub const SYS_getgroups: c_long = 158; ++pub const SYS_setgroups: c_long = 159; ++pub const SYS_setresuid: c_long = 147; ++pub const SYS_getresuid: c_long = 148; ++pub const SYS_setresgid: c_long = 149; ++pub const SYS_getresgid: c_long = 150; ++pub const SYS_getpgid: c_long = 155; ++pub const SYS_setfsuid: c_long = 151; ++pub const SYS_setfsgid: c_long = 152; ++pub const SYS_getsid: c_long = 156; ++pub const SYS_capget: c_long = 90; ++pub const SYS_capset: c_long = 91; ++pub const SYS_rt_sigpending: c_long = 136; ++pub const SYS_rt_sigtimedwait: c_long = 137; ++pub const SYS_rt_sigqueueinfo: c_long = 138; ++pub const SYS_rt_sigsuspend: c_long = 133; ++pub const SYS_sigaltstack: c_long = 132; ++pub const SYS_personality: c_long = 92; ++pub const SYS_statfs: c_long = 43; ++pub const SYS_fstatfs: c_long = 44; ++pub const SYS_getpriority: c_long = 141; ++pub const SYS_setpriority: c_long = 140; ++pub const SYS_sched_setparam: c_long = 118; ++pub const SYS_sched_getparam: c_long = 121; ++pub const SYS_sched_setscheduler: c_long = 119; ++pub const SYS_sched_getscheduler: c_long = 120; ++pub const SYS_sched_get_priority_max: c_long = 125; ++pub const SYS_sched_get_priority_min: c_long = 126; ++pub const SYS_sched_rr_get_interval: c_long = 127; ++pub const SYS_mlock: c_long = 228; ++pub const SYS_munlock: c_long = 229; ++pub const SYS_mlockall: c_long = 230; ++pub const SYS_munlockall: c_long = 231; ++pub const SYS_vhangup: c_long = 58; ++pub const SYS_pivot_root: c_long = 41; ++pub const SYS_prctl: c_long = 167; ++pub const SYS_adjtimex: c_long = 171; ++pub const SYS_setrlimit: c_long = 164; ++pub const SYS_chroot: c_long = 51; ++pub const SYS_sync: c_long = 81; ++pub const SYS_acct: c_long = 89; ++pub const SYS_settimeofday: c_long = 170; ++pub const SYS_mount: c_long = 40; ++pub const SYS_umount2: c_long = 39; ++pub const SYS_swapon: c_long = 224; ++pub const SYS_swapoff: c_long = 225; ++pub const SYS_reboot: c_long = 142; ++pub const SYS_sethostname: c_long = 161; ++pub const SYS_setdomainname: c_long = 162; ++pub const SYS_init_module: c_long = 105; ++pub const SYS_delete_module: c_long = 106; ++pub const SYS_quotactl: c_long = 60; ++pub const SYS_nfsservctl: c_long = 42; ++pub const SYS_gettid: c_long = 178; ++pub const SYS_readahead: c_long = 213; ++pub const SYS_setxattr: c_long = 5; ++pub const SYS_lsetxattr: c_long = 6; ++pub const SYS_fsetxattr: c_long = 7; ++pub const SYS_getxattr: c_long = 8; ++pub const SYS_lgetxattr: c_long = 9; ++pub const SYS_fgetxattr: c_long = 10; ++pub const SYS_listxattr: c_long = 11; ++pub const SYS_llistxattr: c_long = 12; ++pub const SYS_flistxattr: c_long = 13; ++pub const SYS_removexattr: c_long = 14; ++pub const SYS_lremovexattr: c_long = 15; ++pub const SYS_fremovexattr: c_long = 16; ++pub const SYS_tkill: c_long = 130; ++pub const SYS_futex: c_long = 98; ++pub const SYS_sched_setaffinity: c_long = 122; ++pub const SYS_sched_getaffinity: c_long = 123; ++pub const SYS_io_setup: c_long = 0; ++pub const SYS_io_destroy: c_long = 1; ++pub const SYS_io_getevents: c_long = 4; ++pub const SYS_io_submit: c_long = 2; ++pub const SYS_io_cancel: c_long = 3; ++pub const SYS_lookup_dcookie: c_long = 18; ++pub const SYS_remap_file_pages: c_long = 234; ++pub const SYS_getdents64: c_long = 61; ++pub const SYS_set_tid_address: c_long = 96; ++pub const SYS_restart_syscall: c_long = 128; ++pub const SYS_semtimedop: c_long = 192; ++pub const SYS_fadvise64: c_long = 223; ++pub const SYS_timer_create: c_long = 107; ++pub const SYS_timer_settime: c_long = 110; ++pub const SYS_timer_gettime: c_long = 108; ++pub const SYS_timer_getoverrun: c_long = 109; ++pub const SYS_timer_delete: c_long = 111; ++pub const SYS_clock_settime: c_long = 112; ++pub const SYS_clock_gettime: c_long = 113; ++pub const SYS_clock_getres: c_long = 114; ++pub const SYS_clock_nanosleep: c_long = 115; ++pub const SYS_exit_group: c_long = 94; ++pub const SYS_epoll_ctl: c_long = 21; ++pub const SYS_tgkill: c_long = 131; ++pub const SYS_mbind: c_long = 235; ++pub const SYS_set_mempolicy: c_long = 237; ++pub const SYS_get_mempolicy: c_long = 236; ++pub const SYS_mq_open: c_long = 180; ++pub const SYS_mq_unlink: c_long = 181; ++pub const SYS_mq_timedsend: c_long = 182; ++pub const SYS_mq_timedreceive: c_long = 183; ++pub const SYS_mq_notify: c_long = 184; ++pub const SYS_mq_getsetattr: c_long = 185; ++pub const SYS_kexec_load: c_long = 104; ++pub const SYS_waitid: c_long = 95; ++pub const SYS_add_key: c_long = 217; ++pub const SYS_request_key: c_long = 218; ++pub const SYS_keyctl: c_long = 219; ++pub const SYS_ioprio_set: c_long = 30; ++pub const SYS_ioprio_get: c_long = 31; ++pub const SYS_inotify_add_watch: c_long = 27; ++pub const SYS_inotify_rm_watch: c_long = 28; ++pub const SYS_migrate_pages: c_long = 238; ++pub const SYS_openat: c_long = 56; ++pub const SYS_mkdirat: c_long = 34; ++pub const SYS_mknodat: c_long = 33; ++pub const SYS_fchownat: c_long = 54; ++pub const SYS_newfstatat: c_long = 79; ++pub const SYS_unlinkat: c_long = 35; ++pub const SYS_linkat: c_long = 37; ++pub const SYS_symlinkat: c_long = 36; ++pub const SYS_readlinkat: c_long = 78; ++pub const SYS_fchmodat: c_long = 53; ++pub const SYS_faccessat: c_long = 48; ++pub const SYS_pselect6: c_long = 72; ++pub const SYS_ppoll: c_long = 73; ++pub const SYS_unshare: c_long = 97; ++pub const SYS_set_robust_list: c_long = 99; ++pub const SYS_get_robust_list: c_long = 100; ++pub const SYS_splice: c_long = 76; ++pub const SYS_tee: c_long = 77; ++pub const SYS_sync_file_range: c_long = 84; ++pub const SYS_vmsplice: c_long = 75; ++pub const SYS_move_pages: c_long = 239; ++pub const SYS_utimensat: c_long = 88; ++pub const SYS_epoll_pwait: c_long = 22; ++pub const SYS_timerfd_create: c_long = 85; ++pub const SYS_fallocate: c_long = 47; ++pub const SYS_timerfd_settime: c_long = 86; ++pub const SYS_timerfd_gettime: c_long = 87; ++pub const SYS_accept4: c_long = 242; ++pub const SYS_signalfd4: c_long = 74; ++pub const SYS_eventfd2: c_long = 19; ++pub const SYS_epoll_create1: c_long = 20; ++pub const SYS_dup3: c_long = 24; ++pub const SYS_pipe2: c_long = 59; ++pub const SYS_inotify_init1: c_long = 26; ++pub const SYS_preadv: c_long = 69; ++pub const SYS_pwritev: c_long = 70; ++pub const SYS_rt_tgsigqueueinfo: c_long = 240; ++pub const SYS_perf_event_open: c_long = 241; ++pub const SYS_recvmmsg: c_long = 243; ++pub const SYS_fanotify_init: c_long = 262; ++pub const SYS_fanotify_mark: c_long = 263; ++pub const SYS_prlimit64: c_long = 261; ++pub const SYS_name_to_handle_at: c_long = 264; ++pub const SYS_open_by_handle_at: c_long = 265; ++pub const SYS_clock_adjtime: c_long = 266; ++pub const SYS_syncfs: c_long = 267; ++pub const SYS_sendmmsg: c_long = 269; ++pub const SYS_setns: c_long = 268; ++pub const SYS_getcpu: c_long = 168; ++pub const SYS_process_vm_readv: c_long = 270; ++pub const SYS_process_vm_writev: c_long = 271; ++pub const SYS_kcmp: c_long = 272; ++pub const SYS_finit_module: c_long = 273; ++pub const SYS_sched_setattr: c_long = 274; ++pub const SYS_sched_getattr: c_long = 275; ++pub const SYS_renameat2: c_long = 276; ++pub const SYS_seccomp: c_long = 277; ++pub const SYS_getrandom: c_long = 278; ++pub const SYS_memfd_create: c_long = 279; ++pub const SYS_bpf: c_long = 280; ++pub const SYS_execveat: c_long = 281; ++pub const SYS_userfaultfd: c_long = 282; ++pub const SYS_membarrier: c_long = 283; ++pub const SYS_mlock2: c_long = 284; ++pub const SYS_copy_file_range: c_long = 285; ++pub const SYS_preadv2: c_long = 286; ++pub const SYS_pwritev2: c_long = 287; ++pub const SYS_pkey_mprotect: c_long = 288; ++pub const SYS_pkey_alloc: c_long = 289; ++pub const SYS_pkey_free: c_long = 290; ++pub const SYS_statx: c_long = 291; ++pub const SYS_io_pgetevents: c_long = 292; ++pub const SYS_rseq: c_long = 293; ++pub const SYS_pidfd_send_signal: c_long = 424; ++pub const SYS_io_uring_setup: c_long = 425; ++pub const SYS_io_uring_enter: c_long = 426; ++pub const SYS_io_uring_register: c_long = 427; ++pub const SYS_open_tree: c_long = 428; ++pub const SYS_move_mount: c_long = 429; ++pub const SYS_fsopen: c_long = 430; ++pub const SYS_fsconfig: c_long = 431; ++pub const SYS_fsmount: c_long = 432; ++pub const SYS_fspick: c_long = 433; ++pub const SYS_pidfd_open: c_long = 434; ++pub const SYS_clone3: c_long = 435; ++pub const SYS_close_range: c_long = 436; ++pub const SYS_openat2: c_long = 437; ++pub const SYS_pidfd_getfd: c_long = 438; ++pub const SYS_faccessat2: c_long = 439; ++pub const SYS_process_madvise: c_long = 440; ++pub const SYS_epoll_pwait2: c_long = 441; ++pub const SYS_mount_setattr: c_long = 442; ++pub const SYS_landlock_create_ruleset: c_long = 444; ++pub const SYS_landlock_add_rule: c_long = 445; ++pub const SYS_landlock_restrict_self: c_long = 446; ++ ++pub const O_APPEND: c_int = 1024; ++pub const O_DIRECT: c_int = 0x4000; ++pub const O_DIRECTORY: c_int = 0x10000; ++pub const O_LARGEFILE: c_int = 0; ++pub const O_NOFOLLOW: c_int = 0x20000; ++pub const O_CREAT: c_int = 64; ++pub const O_EXCL: c_int = 128; ++pub const O_NOCTTY: c_int = 256; ++pub const O_NONBLOCK: c_int = 2048; ++pub const O_SYNC: c_int = 1052672; ++pub const O_RSYNC: c_int = 1052672; ++pub const O_DSYNC: c_int = 4096; ++pub const O_ASYNC: c_int = 0x2000; ++ ++pub const SIGSTKSZ: size_t = 8192; ++pub const MINSIGSTKSZ: size_t = 2048; ++ ++pub const ENAMETOOLONG: c_int = 36; ++pub const ENOLCK: c_int = 37; ++pub const ENOSYS: c_int = 38; ++pub const ENOTEMPTY: c_int = 39; ++pub const ELOOP: c_int = 40; ++pub const ENOMSG: c_int = 42; ++pub const EIDRM: c_int = 43; ++pub const ECHRNG: c_int = 44; ++pub const EL2NSYNC: c_int = 45; ++pub const EL3HLT: c_int = 46; ++pub const EL3RST: c_int = 47; ++pub const ELNRNG: c_int = 48; ++pub const EUNATCH: c_int = 49; ++pub const ENOCSI: c_int = 50; ++pub const EL2HLT: c_int = 51; ++pub const EBADE: c_int = 52; ++pub const EBADR: c_int = 53; ++pub const EXFULL: c_int = 54; ++pub const ENOANO: c_int = 55; ++pub const EBADRQC: c_int = 56; ++pub const EBADSLT: c_int = 57; ++pub const EMULTIHOP: c_int = 72; ++pub const EOVERFLOW: c_int = 75; ++pub const ENOTUNIQ: c_int = 76; ++pub const EBADFD: c_int = 77; ++pub const EBADMSG: c_int = 74; ++pub const EREMCHG: c_int = 78; ++pub const ELIBACC: c_int = 79; ++pub const ELIBBAD: c_int = 80; ++pub const ELIBSCN: c_int = 81; ++pub const ELIBMAX: c_int = 82; ++pub const ELIBEXEC: c_int = 83; ++pub const EILSEQ: c_int = 84; ++pub const ERESTART: c_int = 85; ++pub const ESTRPIPE: c_int = 86; ++pub const EUSERS: c_int = 87; ++pub const ENOTSOCK: c_int = 88; ++pub const EDESTADDRREQ: c_int = 89; ++pub const EMSGSIZE: c_int = 90; ++pub const EPROTOTYPE: c_int = 91; ++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 EADDRINUSE: c_int = 98; ++pub const EADDRNOTAVAIL: c_int = 99; ++pub const ENETDOWN: c_int = 100; ++pub const ENETUNREACH: c_int = 101; ++pub const ENETRESET: c_int = 102; ++pub const ECONNABORTED: c_int = 103; ++pub const ECONNRESET: c_int = 104; ++pub const ENOBUFS: c_int = 105; ++pub const EISCONN: c_int = 106; ++pub const ENOTCONN: c_int = 107; ++pub const ESHUTDOWN: c_int = 108; ++pub const ETOOMANYREFS: c_int = 109; ++pub const ETIMEDOUT: c_int = 110; ++pub const ECONNREFUSED: c_int = 111; ++pub const EHOSTDOWN: c_int = 112; ++pub const EHOSTUNREACH: c_int = 113; ++pub const EALREADY: c_int = 114; ++pub const EINPROGRESS: c_int = 115; ++pub const ESTALE: c_int = 116; ++pub const EUCLEAN: c_int = 117; ++pub const ENOTNAM: c_int = 118; ++pub const ENAVAIL: c_int = 119; ++pub const EISNAM: c_int = 120; ++pub const EREMOTEIO: c_int = 121; ++pub const EDQUOT: c_int = 122; ++pub const ENOMEDIUM: c_int = 123; ++pub const EMEDIUMTYPE: c_int = 124; ++pub const ECANCELED: c_int = 125; ++pub const ENOKEY: c_int = 126; ++pub const EKEYEXPIRED: c_int = 127; ++pub const EKEYREVOKED: c_int = 128; ++pub const EKEYREJECTED: c_int = 129; ++pub const EOWNERDEAD: c_int = 130; ++pub const ENOTRECOVERABLE: c_int = 131; ++pub const EHWPOISON: c_int = 133; ++pub const ERFKILL: c_int = 132; ++ ++pub const SA_ONSTACK: c_int = 0x08000000; ++pub const SA_SIGINFO: c_int = 0x00000004; ++pub const SA_NOCLDWAIT: c_int = 0x00000002; ++ ++pub const SIGCHLD: c_int = 17; ++pub const SIGBUS: c_int = 7; ++pub const SIGTTIN: c_int = 21; ++pub const SIGTTOU: c_int = 22; ++pub const SIGXCPU: c_int = 24; ++pub const SIGXFSZ: c_int = 25; ++pub const SIGVTALRM: c_int = 26; ++pub const SIGPROF: c_int = 27; ++pub const SIGWINCH: c_int = 28; ++pub const SIGUSR1: c_int = 10; ++pub const SIGUSR2: c_int = 12; ++pub const SIGCONT: c_int = 18; ++pub const SIGSTOP: c_int = 19; ++pub const SIGTSTP: c_int = 20; ++pub const SIGURG: c_int = 23; ++pub const SIGIO: c_int = 29; ++pub const SIGSYS: c_int = 31; ++pub const SIGSTKFLT: c_int = 16; ++pub const SIGPOLL: c_int = 29; ++pub const SIGPWR: c_int = 30; ++pub const SIG_SETMASK: c_int = 2; ++pub const SIG_BLOCK: c_int = 0x000000; ++pub const SIG_UNBLOCK: c_int = 0x01; ++ ++pub const F_GETLK: c_int = 5; ++pub const F_GETOWN: c_int = 9; ++pub const F_SETLK: c_int = 6; ++pub const F_SETLKW: c_int = 7; ++pub const F_SETOWN: c_int = 8; ++ ++pub const VEOF: usize = 4; ++ ++pub const POLLWRNORM: c_short = 0x100; ++pub const POLLWRBAND: c_short = 0x200; ++ ++pub const SOCK_STREAM: c_int = 1; ++pub const SOCK_DGRAM: c_int = 2; ++ ++pub const MAP_ANON: c_int = 0x0020; ++pub const MAP_GROWSDOWN: c_int = 0x0100; ++pub const MAP_DENYWRITE: c_int = 0x0800; ++pub const MAP_EXECUTABLE: c_int = 0x01000; ++pub const MAP_LOCKED: c_int = 0x02000; ++pub const MAP_NORESERVE: c_int = 0x04000; ++pub const MAP_POPULATE: c_int = 0x08000; ++pub const MAP_NONBLOCK: c_int = 0x010000; ++pub const MAP_STACK: c_int = 0x020000; ++pub const MAP_HUGETLB: c_int = 0x040000; ++pub const MAP_SYNC: c_int = 0x080000; ++ ++pub const MCL_CURRENT: c_int = 0x0001; ++pub const MCL_FUTURE: c_int = 0x0002; ++pub const MCL_ONFAULT: c_int = 0x0004; ++pub const CBAUD: crate::tcflag_t = 0o0010017; ++pub const TAB1: c_int = 0x00000800; ++pub const TAB2: c_int = 0x00001000; ++pub const TAB3: c_int = 0x00001800; ++pub const CR1: c_int = 0x00000200; ++pub const CR2: c_int = 0x00000400; ++pub const CR3: c_int = 0x00000600; ++pub const FF1: c_int = 0x00008000; ++pub const BS1: c_int = 0x00002000; ++pub const VT1: c_int = 0x00004000; ++pub const VWERASE: usize = 14; ++pub const VREPRINT: usize = 12; ++pub const VSUSP: usize = 10; ++pub const VSTART: usize = 8; ++pub const VSTOP: usize = 9; ++pub const VDISCARD: usize = 13; ++pub const VTIME: usize = 5; ++pub const IXON: crate::tcflag_t = 0x00000400; ++pub const IXOFF: crate::tcflag_t = 0x00001000; ++pub const ONLCR: crate::tcflag_t = 0x4; ++pub const CSIZE: crate::tcflag_t = 0x00000030; ++pub const CS6: crate::tcflag_t = 0x00000010; ++pub const CS7: crate::tcflag_t = 0x00000020; ++pub const CS8: crate::tcflag_t = 0x00000030; ++pub const CSTOPB: crate::tcflag_t = 0x00000040; ++pub const CREAD: crate::tcflag_t = 0x00000080; ++pub const PARENB: crate::tcflag_t = 0x00000100; ++pub const PARODD: crate::tcflag_t = 0x00000200; ++pub const HUPCL: crate::tcflag_t = 0x00000400; ++pub const CLOCAL: crate::tcflag_t = 0x00000800; ++pub const ECHOKE: crate::tcflag_t = 0x00000800; ++pub const ECHOE: crate::tcflag_t = 0x00000010; ++pub const ECHOK: crate::tcflag_t = 0x00000020; ++pub const ECHONL: crate::tcflag_t = 0x00000040; ++pub const ECHOPRT: crate::tcflag_t = 0x00000400; ++pub const ECHOCTL: crate::tcflag_t = 0x00000200; ++pub const ISIG: crate::tcflag_t = 0x00000001; ++pub const ICANON: crate::tcflag_t = 0x00000002; ++pub const PENDIN: crate::tcflag_t = 0x00004000; ++pub const NOFLSH: crate::tcflag_t = 0x00000080; ++pub const CIBAUD: crate::tcflag_t = 0o02003600000; ++pub const CBAUDEX: crate::tcflag_t = 0o010000; ++pub const VSWTC: usize = 7; ++pub const OLCUC: crate::tcflag_t = 0o000002; ++pub const NLDLY: crate::tcflag_t = 0o000400; ++pub const CRDLY: crate::tcflag_t = 0o003000; ++pub const TABDLY: crate::tcflag_t = 0o014000; ++pub const BSDLY: crate::tcflag_t = 0o020000; ++pub const FFDLY: crate::tcflag_t = 0o100000; ++pub const VTDLY: crate::tcflag_t = 0o040000; ++pub const XTABS: crate::tcflag_t = 0o014000; ++pub const B57600: crate::speed_t = 0o010001; ++pub const B115200: crate::speed_t = 0o010002; ++pub const B230400: crate::speed_t = 0o010003; ++pub const B460800: crate::speed_t = 0o010004; ++pub const B500000: crate::speed_t = 0o010005; ++pub const B576000: crate::speed_t = 0o010006; ++pub const B921600: crate::speed_t = 0o010007; ++pub const B1000000: crate::speed_t = 0o010010; ++pub const B1152000: crate::speed_t = 0o010011; ++pub const B1500000: crate::speed_t = 0o010012; ++pub const B2000000: crate::speed_t = 0o010013; ++pub const B2500000: crate::speed_t = 0o010014; ++pub const B3000000: crate::speed_t = 0o010015; ++pub const B3500000: crate::speed_t = 0o010016; ++pub const B4000000: crate::speed_t = 0o010017; ++ ++pub const EDEADLK: c_int = 35; ++pub const EDEADLOCK: c_int = EDEADLK; ++pub const EXTPROC: crate::tcflag_t = 0x00010000; ++pub const VEOL: usize = 11; ++pub const VEOL2: usize = 16; ++pub const VMIN: usize = 6; ++pub const IEXTEN: crate::tcflag_t = 0x00008000; ++pub const TOSTOP: crate::tcflag_t = 0x00000100; ++pub const FLUSHO: crate::tcflag_t = 0x00001000; ++ ++pub const NGREG: usize = 32; ++pub const REG_PC: usize = 0; ++pub const REG_RA: usize = 1; ++pub const REG_SP: usize = 2; ++pub const REG_TP: usize = 4; ++pub const REG_S0: usize = 8; ++pub const REG_S1: usize = 9; ++pub const REG_A0: usize = 10; ++pub const REG_S2: usize = 18; ++pub const REG_NARGS: usize = 8; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b64/s390x.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b64/s390x.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b64/s390x.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b64/s390x.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,715 @@ ++use crate::off_t; ++use crate::prelude::*; ++ ++pub type blksize_t = i64; ++pub type c_char = u8; ++pub type nlink_t = u64; ++pub type wchar_t = i32; ++pub type greg_t = u64; ++pub type __u64 = u64; ++pub type __s64 = i64; ++ ++s! { ++ pub struct ipc_perm { ++ pub __ipc_perm_key: crate::key_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub cuid: crate::uid_t, ++ pub cgid: crate::gid_t, ++ pub mode: crate::mode_t, ++ pub __seq: c_int, ++ __pad1: c_long, ++ __pad2: c_long, ++ } ++ ++ pub struct stat { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_mode: crate::mode_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ pub st_size: off_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt_t, ++ __unused: [c_long; 3], ++ } ++ ++ pub struct stat64 { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino64_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_mode: crate::mode_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ pub st_size: off_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt64_t, ++ __unused: [c_long; 3], ++ } ++} ++ ++s_no_extra_traits! { ++ // FIXME: This is actually a union. ++ pub struct fpreg_t { ++ pub d: c_double, ++ // f: c_float, ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for fpreg_t { ++ fn eq(&self, other: &fpreg_t) -> bool { ++ self.d == other.d ++ } ++ } ++ ++ impl Eq for fpreg_t {} ++ ++ impl fmt::Debug for fpreg_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("fpreg_t").field("d", &self.d).finish() ++ } ++ } ++ ++ impl hash::Hash for fpreg_t { ++ fn hash(&self, state: &mut H) { ++ let d: u64 = unsafe { mem::transmute(self.d) }; ++ d.hash(state); ++ } ++ } ++ } ++} ++ ++pub const VEOF: usize = 4; ++pub const RTLD_DEEPBIND: c_int = 0x8; ++ ++pub const EUCLEAN: c_int = 117; ++pub const ENOTNAM: c_int = 118; ++pub const ENAVAIL: c_int = 119; ++pub const EISNAM: c_int = 120; ++pub const EREMOTEIO: c_int = 121; ++pub const EADDRINUSE: c_int = 98; ++pub const EADDRNOTAVAIL: c_int = 99; ++pub const ECONNABORTED: c_int = 103; ++pub const ECONNREFUSED: c_int = 111; ++pub const ECONNRESET: c_int = 104; ++pub const EDEADLK: c_int = 35; ++pub const ENOSYS: c_int = 38; ++pub const ENOTCONN: c_int = 107; ++pub const ETIMEDOUT: c_int = 110; ++pub const O_APPEND: c_int = 1024; ++pub const O_CREAT: c_int = 64; ++pub const O_EXCL: c_int = 128; ++pub const O_LARGEFILE: c_int = 0x8000; ++pub const O_NONBLOCK: c_int = 2048; ++pub const SA_NOCLDWAIT: c_int = 2; ++pub const SA_ONSTACK: c_int = 0x08000000; ++pub const SA_SIGINFO: c_int = 4; ++pub const SIGBUS: c_int = 7; ++pub const SIGSTKSZ: size_t = 0x2000; ++pub const MINSIGSTKSZ: size_t = 2048; ++pub const SIG_SETMASK: c_int = 2; ++ ++pub const SOCK_STREAM: c_int = 1; ++pub const SOCK_DGRAM: c_int = 2; ++ ++pub const O_NOCTTY: c_int = 256; ++pub const O_SYNC: c_int = 1052672; ++pub const O_RSYNC: c_int = 1052672; ++pub const O_DSYNC: c_int = 4096; ++pub const O_FSYNC: c_int = 0x101000; ++pub const O_DIRECT: c_int = 0x4000; ++pub const O_DIRECTORY: c_int = 0x10000; ++pub const O_NOFOLLOW: c_int = 0x20000; ++ ++pub const MADV_SOFT_OFFLINE: c_int = 101; ++pub const MAP_GROWSDOWN: c_int = 0x0100; ++pub const MAP_LOCKED: c_int = 0x02000; ++pub const MAP_NORESERVE: c_int = 0x04000; ++pub const MAP_ANON: c_int = 0x0020; ++pub const MAP_DENYWRITE: c_int = 0x0800; ++pub const MAP_EXECUTABLE: c_int = 0x01000; ++pub const MAP_POPULATE: c_int = 0x08000; ++pub const MAP_NONBLOCK: c_int = 0x010000; ++pub const MAP_STACK: c_int = 0x020000; ++pub const MAP_HUGETLB: c_int = 0x040000; ++pub const MAP_SYNC: c_int = 0x080000; ++ ++pub const PTRACE_SYSEMU: c_int = 31; ++pub const PTRACE_SYSEMU_SINGLESTEP: c_int = 32; ++ ++pub const EDEADLOCK: c_int = 35; ++pub const ENAMETOOLONG: c_int = 36; ++pub const ENOLCK: c_int = 37; ++pub const ENOTEMPTY: c_int = 39; ++pub const ELOOP: c_int = 40; ++pub const ENOMSG: c_int = 42; ++pub const EIDRM: c_int = 43; ++pub const ECHRNG: c_int = 44; ++pub const EL2NSYNC: c_int = 45; ++pub const EL3HLT: c_int = 46; ++pub const EL3RST: c_int = 47; ++pub const ELNRNG: c_int = 48; ++pub const EUNATCH: c_int = 49; ++pub const ENOCSI: c_int = 50; ++pub const EL2HLT: c_int = 51; ++pub const EBADE: c_int = 52; ++pub const EBADR: c_int = 53; ++pub const EXFULL: c_int = 54; ++pub const ENOANO: c_int = 55; ++pub const EBADRQC: c_int = 56; ++pub const EBADSLT: c_int = 57; ++pub const EMULTIHOP: c_int = 72; ++pub const EOVERFLOW: c_int = 75; ++pub const ENOTUNIQ: c_int = 76; ++pub const EBADFD: c_int = 77; ++pub const EBADMSG: c_int = 74; ++pub const EREMCHG: c_int = 78; ++pub const ELIBACC: c_int = 79; ++pub const ELIBBAD: c_int = 80; ++pub const ELIBSCN: c_int = 81; ++pub const ELIBMAX: c_int = 82; ++pub const ELIBEXEC: c_int = 83; ++pub const EILSEQ: c_int = 84; ++pub const ERESTART: c_int = 85; ++pub const ESTRPIPE: c_int = 86; ++pub const EUSERS: c_int = 87; ++pub const ENOTSOCK: c_int = 88; ++pub const EDESTADDRREQ: c_int = 89; ++pub const EMSGSIZE: c_int = 90; ++pub const EPROTOTYPE: c_int = 91; ++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; ++pub const ENETUNREACH: c_int = 101; ++pub const ENETRESET: c_int = 102; ++pub const ENOBUFS: c_int = 105; ++pub const EISCONN: c_int = 106; ++pub const ESHUTDOWN: c_int = 108; ++pub const ETOOMANYREFS: c_int = 109; ++pub const EHOSTDOWN: c_int = 112; ++pub const EHOSTUNREACH: c_int = 113; ++pub const EALREADY: c_int = 114; ++pub const EINPROGRESS: c_int = 115; ++pub const ESTALE: c_int = 116; ++pub const EDQUOT: c_int = 122; ++pub const ENOMEDIUM: c_int = 123; ++pub const EMEDIUMTYPE: c_int = 124; ++pub const ECANCELED: c_int = 125; ++pub const ENOKEY: c_int = 126; ++pub const EKEYEXPIRED: c_int = 127; ++pub const EKEYREVOKED: c_int = 128; ++pub const EKEYREJECTED: c_int = 129; ++pub const EOWNERDEAD: c_int = 130; ++pub const ENOTRECOVERABLE: c_int = 131; ++pub const EHWPOISON: c_int = 133; ++pub const ERFKILL: c_int = 132; ++ ++pub const SIGTTIN: c_int = 21; ++pub const SIGTTOU: c_int = 22; ++pub const SIGXCPU: c_int = 24; ++pub const SIGXFSZ: c_int = 25; ++pub const SIGVTALRM: c_int = 26; ++pub const SIGPROF: c_int = 27; ++pub const SIGWINCH: c_int = 28; ++pub const SIGCHLD: c_int = 17; ++pub const SIGUSR1: c_int = 10; ++pub const SIGUSR2: c_int = 12; ++pub const SIGCONT: c_int = 18; ++pub const SIGSTOP: c_int = 19; ++pub const SIGTSTP: c_int = 20; ++pub const SIGURG: c_int = 23; ++pub const SIGIO: c_int = 29; ++pub const SIGSYS: c_int = 31; ++pub const SIGSTKFLT: c_int = 16; ++pub const SIGPOLL: c_int = 29; ++pub const SIGPWR: c_int = 30; ++pub const SIG_BLOCK: c_int = 0x000000; ++pub const SIG_UNBLOCK: c_int = 0x01; ++ ++pub const O_ASYNC: c_int = 0x2000; ++ ++pub const VEOL: usize = 11; ++pub const VEOL2: usize = 16; ++pub const VMIN: usize = 6; ++pub const IEXTEN: crate::tcflag_t = 0x00008000; ++pub const TOSTOP: crate::tcflag_t = 0x00000100; ++pub const FLUSHO: crate::tcflag_t = 0x00001000; ++ ++pub const EXTPROC: crate::tcflag_t = 0x00010000; ++ ++pub const MCL_CURRENT: c_int = 0x0001; ++pub const MCL_FUTURE: c_int = 0x0002; ++pub const MCL_ONFAULT: c_int = 0x0004; ++ ++pub const F_GETLK: c_int = 5; ++pub const F_GETOWN: c_int = 9; ++pub const F_SETOWN: c_int = 8; ++pub const F_SETLK: c_int = 6; ++pub const F_SETLKW: c_int = 7; ++ ++pub const VTIME: usize = 5; ++pub const VSWTC: usize = 7; ++pub const VSTART: usize = 8; ++pub const VSTOP: usize = 9; ++pub const VSUSP: usize = 10; ++pub const VREPRINT: usize = 12; ++pub const VDISCARD: usize = 13; ++pub const VWERASE: usize = 14; ++pub const OLCUC: crate::tcflag_t = 0o000002; ++pub const ONLCR: crate::tcflag_t = 0o000004; ++pub const NLDLY: crate::tcflag_t = 0o000400; ++pub const CRDLY: crate::tcflag_t = 0o003000; ++pub const CR1: crate::tcflag_t = 0x00000200; ++pub const CR2: crate::tcflag_t = 0x00000400; ++pub const CR3: crate::tcflag_t = 0x00000600; ++pub const TABDLY: crate::tcflag_t = 0o014000; ++pub const TAB1: crate::tcflag_t = 0x00000800; ++pub const TAB2: crate::tcflag_t = 0x00001000; ++pub const TAB3: crate::tcflag_t = 0x00001800; ++pub const BSDLY: crate::tcflag_t = 0o020000; ++pub const BS1: crate::tcflag_t = 0x00002000; ++pub const FFDLY: crate::tcflag_t = 0o100000; ++pub const FF1: crate::tcflag_t = 0x00008000; ++pub const VTDLY: crate::tcflag_t = 0o040000; ++pub const VT1: crate::tcflag_t = 0x00004000; ++pub const XTABS: crate::tcflag_t = 0o014000; ++ ++pub const CBAUD: crate::speed_t = 0o010017; ++pub const CSIZE: crate::tcflag_t = 0o000060; ++pub const CS6: crate::tcflag_t = 0o000020; ++pub const CS7: crate::tcflag_t = 0o000040; ++pub const CS8: crate::tcflag_t = 0o000060; ++pub const CSTOPB: crate::tcflag_t = 0o000100; ++pub const CREAD: crate::tcflag_t = 0o000200; ++pub const PARENB: crate::tcflag_t = 0o000400; ++pub const PARODD: crate::tcflag_t = 0o001000; ++pub const HUPCL: crate::tcflag_t = 0o002000; ++pub const CLOCAL: crate::tcflag_t = 0o004000; ++pub const CBAUDEX: crate::tcflag_t = 0o010000; ++pub const B57600: crate::speed_t = 0o010001; ++pub const B115200: crate::speed_t = 0o010002; ++pub const B230400: crate::speed_t = 0o010003; ++pub const B460800: crate::speed_t = 0o010004; ++pub const B500000: crate::speed_t = 0o010005; ++pub const B576000: crate::speed_t = 0o010006; ++pub const B921600: crate::speed_t = 0o010007; ++pub const B1000000: crate::speed_t = 0o010010; ++pub const B1152000: crate::speed_t = 0o010011; ++pub const B1500000: crate::speed_t = 0o010012; ++pub const B2000000: crate::speed_t = 0o010013; ++pub const B2500000: crate::speed_t = 0o010014; ++pub const B3000000: crate::speed_t = 0o010015; ++pub const B3500000: crate::speed_t = 0o010016; ++pub const B4000000: crate::speed_t = 0o010017; ++pub const CIBAUD: crate::tcflag_t = 0o02003600000; ++ ++pub const ISIG: crate::tcflag_t = 0o000001; ++pub const ICANON: crate::tcflag_t = 0o000002; ++pub const XCASE: crate::tcflag_t = 0o000004; ++pub const ECHOE: crate::tcflag_t = 0o000020; ++pub const ECHOK: crate::tcflag_t = 0o000040; ++pub const ECHONL: crate::tcflag_t = 0o000100; ++pub const NOFLSH: crate::tcflag_t = 0o000200; ++pub const ECHOCTL: crate::tcflag_t = 0o001000; ++pub const ECHOPRT: crate::tcflag_t = 0o002000; ++pub const ECHOKE: crate::tcflag_t = 0o004000; ++pub const PENDIN: crate::tcflag_t = 0o040000; ++ ++pub const POLLWRNORM: c_short = 0x100; ++pub const POLLWRBAND: c_short = 0x200; ++ ++pub const IXON: crate::tcflag_t = 0o002000; ++pub const IXOFF: crate::tcflag_t = 0o010000; ++ ++pub const SYS_exit: c_long = 1; ++pub const SYS_fork: c_long = 2; ++pub const SYS_read: c_long = 3; ++pub const SYS_write: c_long = 4; ++pub const SYS_open: c_long = 5; ++pub const SYS_close: c_long = 6; ++pub const SYS_restart_syscall: c_long = 7; ++pub const SYS_creat: c_long = 8; ++pub const SYS_link: c_long = 9; ++pub const SYS_unlink: c_long = 10; ++pub const SYS_execve: c_long = 11; ++pub const SYS_chdir: c_long = 12; ++pub const SYS_mknod: c_long = 14; ++pub const SYS_chmod: c_long = 15; ++pub const SYS_lseek: c_long = 19; ++pub const SYS_getpid: c_long = 20; ++pub const SYS_mount: c_long = 21; ++pub const SYS_umount: c_long = 22; ++pub const SYS_ptrace: c_long = 26; ++pub const SYS_alarm: c_long = 27; ++pub const SYS_pause: c_long = 29; ++pub const SYS_utime: c_long = 30; ++pub const SYS_access: c_long = 33; ++pub const SYS_nice: c_long = 34; ++pub const SYS_sync: c_long = 36; ++pub const SYS_kill: c_long = 37; ++pub const SYS_rename: c_long = 38; ++pub const SYS_mkdir: c_long = 39; ++pub const SYS_rmdir: c_long = 40; ++pub const SYS_dup: c_long = 41; ++pub const SYS_pipe: c_long = 42; ++pub const SYS_times: c_long = 43; ++pub const SYS_brk: c_long = 45; ++pub const SYS_signal: c_long = 48; ++pub const SYS_acct: c_long = 51; ++pub const SYS_umount2: c_long = 52; ++pub const SYS_ioctl: c_long = 54; ++pub const SYS_fcntl: c_long = 55; ++pub const SYS_setpgid: c_long = 57; ++pub const SYS_umask: c_long = 60; ++pub const SYS_chroot: c_long = 61; ++pub const SYS_ustat: c_long = 62; ++pub const SYS_dup2: c_long = 63; ++pub const SYS_getppid: c_long = 64; ++pub const SYS_getpgrp: c_long = 65; ++pub const SYS_setsid: c_long = 66; ++pub const SYS_sigaction: c_long = 67; ++pub const SYS_sigsuspend: c_long = 72; ++pub const SYS_sigpending: c_long = 73; ++pub const SYS_sethostname: c_long = 74; ++pub const SYS_setrlimit: c_long = 75; ++pub const SYS_getrusage: c_long = 77; ++pub const SYS_gettimeofday: c_long = 78; ++pub const SYS_settimeofday: c_long = 79; ++pub const SYS_symlink: c_long = 83; ++pub const SYS_readlink: c_long = 85; ++pub const SYS_uselib: c_long = 86; ++pub const SYS_swapon: c_long = 87; ++pub const SYS_reboot: c_long = 88; ++pub const SYS_readdir: c_long = 89; ++pub const SYS_mmap: c_long = 90; ++pub const SYS_munmap: c_long = 91; ++pub const SYS_truncate: c_long = 92; ++pub const SYS_ftruncate: c_long = 93; ++pub const SYS_fchmod: c_long = 94; ++pub const SYS_getpriority: c_long = 96; ++pub const SYS_setpriority: c_long = 97; ++pub const SYS_statfs: c_long = 99; ++pub const SYS_fstatfs: c_long = 100; ++pub const SYS_socketcall: c_long = 102; ++pub const SYS_syslog: c_long = 103; ++pub const SYS_setitimer: c_long = 104; ++pub const SYS_getitimer: c_long = 105; ++pub const SYS_stat: c_long = 106; ++pub const SYS_lstat: c_long = 107; ++pub const SYS_fstat: c_long = 108; ++pub const SYS_lookup_dcookie: c_long = 110; ++pub const SYS_vhangup: c_long = 111; ++pub const SYS_idle: c_long = 112; ++pub const SYS_wait4: c_long = 114; ++pub const SYS_swapoff: c_long = 115; ++pub const SYS_sysinfo: c_long = 116; ++pub const SYS_ipc: c_long = 117; ++pub const SYS_fsync: c_long = 118; ++pub const SYS_sigreturn: c_long = 119; ++pub const SYS_clone: c_long = 120; ++pub const SYS_setdomainname: c_long = 121; ++pub const SYS_uname: c_long = 122; ++pub const SYS_adjtimex: c_long = 124; ++pub const SYS_mprotect: c_long = 125; ++pub const SYS_sigprocmask: c_long = 126; ++pub const SYS_create_module: c_long = 127; ++pub const SYS_init_module: c_long = 128; ++pub const SYS_delete_module: c_long = 129; ++pub const SYS_get_kernel_syms: c_long = 130; ++pub const SYS_quotactl: c_long = 131; ++pub const SYS_getpgid: c_long = 132; ++pub const SYS_fchdir: c_long = 133; ++pub const SYS_bdflush: c_long = 134; ++pub const SYS_sysfs: c_long = 135; ++pub const SYS_personality: c_long = 136; ++pub const SYS_afs_syscall: c_long = 137; /* Syscall for Andrew File System */ ++pub const SYS_getdents: c_long = 141; ++pub const SYS_select: c_long = 142; ++pub const SYS_flock: c_long = 143; ++pub const SYS_msync: c_long = 144; ++pub const SYS_readv: c_long = 145; ++pub const SYS_writev: c_long = 146; ++pub const SYS_getsid: c_long = 147; ++pub const SYS_fdatasync: c_long = 148; ++pub const SYS__sysctl: c_long = 149; ++pub const SYS_mlock: c_long = 150; ++pub const SYS_munlock: c_long = 151; ++pub const SYS_mlockall: c_long = 152; ++pub const SYS_munlockall: c_long = 153; ++pub const SYS_sched_setparam: c_long = 154; ++pub const SYS_sched_getparam: c_long = 155; ++pub const SYS_sched_setscheduler: c_long = 156; ++pub const SYS_sched_getscheduler: c_long = 157; ++pub const SYS_sched_yield: c_long = 158; ++pub const SYS_sched_get_priority_max: c_long = 159; ++pub const SYS_sched_get_priority_min: c_long = 160; ++pub const SYS_sched_rr_get_interval: c_long = 161; ++pub const SYS_nanosleep: c_long = 162; ++pub const SYS_mremap: c_long = 163; ++pub const SYS_query_module: c_long = 167; ++pub const SYS_poll: c_long = 168; ++pub const SYS_nfsservctl: c_long = 169; ++pub const SYS_prctl: c_long = 172; ++pub const SYS_rt_sigreturn: c_long = 173; ++pub const SYS_rt_sigaction: c_long = 174; ++pub const SYS_rt_sigprocmask: c_long = 175; ++pub const SYS_rt_sigpending: c_long = 176; ++pub const SYS_rt_sigtimedwait: c_long = 177; ++pub const SYS_rt_sigqueueinfo: c_long = 178; ++pub const SYS_rt_sigsuspend: c_long = 179; ++pub const SYS_pread64: c_long = 180; ++pub const SYS_pwrite64: c_long = 181; ++pub const SYS_getcwd: c_long = 183; ++pub const SYS_capget: c_long = 184; ++pub const SYS_capset: c_long = 185; ++pub const SYS_sigaltstack: c_long = 186; ++pub const SYS_sendfile: c_long = 187; ++pub const SYS_getpmsg: c_long = 188; ++pub const SYS_putpmsg: c_long = 189; ++pub const SYS_vfork: c_long = 190; ++pub const SYS_getrlimit: c_long = 191; ++pub const SYS_lchown: c_long = 198; ++pub const SYS_getuid: c_long = 199; ++pub const SYS_getgid: c_long = 200; ++pub const SYS_geteuid: c_long = 201; ++pub const SYS_getegid: c_long = 202; ++pub const SYS_setreuid: c_long = 203; ++pub const SYS_setregid: c_long = 204; ++pub const SYS_getgroups: c_long = 205; ++pub const SYS_setgroups: c_long = 206; ++pub const SYS_fchown: c_long = 207; ++pub const SYS_setresuid: c_long = 208; ++pub const SYS_getresuid: c_long = 209; ++pub const SYS_setresgid: c_long = 210; ++pub const SYS_getresgid: c_long = 211; ++pub const SYS_chown: c_long = 212; ++pub const SYS_setuid: c_long = 213; ++pub const SYS_setgid: c_long = 214; ++pub const SYS_setfsuid: c_long = 215; ++pub const SYS_setfsgid: c_long = 216; ++pub const SYS_pivot_root: c_long = 217; ++pub const SYS_mincore: c_long = 218; ++pub const SYS_madvise: c_long = 219; ++pub const SYS_getdents64: c_long = 220; ++pub const SYS_readahead: c_long = 222; ++pub const SYS_setxattr: c_long = 224; ++pub const SYS_lsetxattr: c_long = 225; ++pub const SYS_fsetxattr: c_long = 226; ++pub const SYS_getxattr: c_long = 227; ++pub const SYS_lgetxattr: c_long = 228; ++pub const SYS_fgetxattr: c_long = 229; ++pub const SYS_listxattr: c_long = 230; ++pub const SYS_llistxattr: c_long = 231; ++pub const SYS_flistxattr: c_long = 232; ++pub const SYS_removexattr: c_long = 233; ++pub const SYS_lremovexattr: c_long = 234; ++pub const SYS_fremovexattr: c_long = 235; ++pub const SYS_gettid: c_long = 236; ++pub const SYS_tkill: c_long = 237; ++pub const SYS_futex: c_long = 238; ++pub const SYS_sched_setaffinity: c_long = 239; ++pub const SYS_sched_getaffinity: c_long = 240; ++pub const SYS_tgkill: c_long = 241; ++pub const SYS_io_setup: c_long = 243; ++pub const SYS_io_destroy: c_long = 244; ++pub const SYS_io_getevents: c_long = 245; ++pub const SYS_io_submit: c_long = 246; ++pub const SYS_io_cancel: c_long = 247; ++pub const SYS_exit_group: c_long = 248; ++pub const SYS_epoll_create: c_long = 249; ++pub const SYS_epoll_ctl: c_long = 250; ++pub const SYS_epoll_wait: c_long = 251; ++pub const SYS_set_tid_address: c_long = 252; ++pub const SYS_fadvise64: c_long = 253; ++pub const SYS_timer_create: c_long = 254; ++pub const SYS_timer_settime: c_long = 255; ++pub const SYS_timer_gettime: c_long = 256; ++pub const SYS_timer_getoverrun: c_long = 257; ++pub const SYS_timer_delete: c_long = 258; ++pub const SYS_clock_settime: c_long = 259; ++pub const SYS_clock_gettime: c_long = 260; ++pub const SYS_clock_getres: c_long = 261; ++pub const SYS_clock_nanosleep: c_long = 262; ++pub const SYS_statfs64: c_long = 265; ++pub const SYS_fstatfs64: c_long = 266; ++pub const SYS_remap_file_pages: c_long = 267; ++pub const SYS_mbind: c_long = 268; ++pub const SYS_get_mempolicy: c_long = 269; ++pub const SYS_set_mempolicy: c_long = 270; ++pub const SYS_mq_open: c_long = 271; ++pub const SYS_mq_unlink: c_long = 272; ++pub const SYS_mq_timedsend: c_long = 273; ++pub const SYS_mq_timedreceive: c_long = 274; ++pub const SYS_mq_notify: c_long = 275; ++pub const SYS_mq_getsetattr: c_long = 276; ++pub const SYS_kexec_load: c_long = 277; ++pub const SYS_add_key: c_long = 278; ++pub const SYS_request_key: c_long = 279; ++pub const SYS_keyctl: c_long = 280; ++pub const SYS_waitid: c_long = 281; ++pub const SYS_ioprio_set: c_long = 282; ++pub const SYS_ioprio_get: c_long = 283; ++pub const SYS_inotify_init: c_long = 284; ++pub const SYS_inotify_add_watch: c_long = 285; ++pub const SYS_inotify_rm_watch: c_long = 286; ++pub const SYS_migrate_pages: c_long = 287; ++pub const SYS_openat: c_long = 288; ++pub const SYS_mkdirat: c_long = 289; ++pub const SYS_mknodat: c_long = 290; ++pub const SYS_fchownat: c_long = 291; ++pub const SYS_futimesat: c_long = 292; ++pub const SYS_newfstatat: c_long = 293; ++pub const SYS_unlinkat: c_long = 294; ++pub const SYS_renameat: c_long = 295; ++pub const SYS_linkat: c_long = 296; ++pub const SYS_symlinkat: c_long = 297; ++pub const SYS_readlinkat: c_long = 298; ++pub const SYS_fchmodat: c_long = 299; ++pub const SYS_faccessat: c_long = 300; ++pub const SYS_pselect6: c_long = 301; ++pub const SYS_ppoll: c_long = 302; ++pub const SYS_unshare: c_long = 303; ++pub const SYS_set_robust_list: c_long = 304; ++pub const SYS_get_robust_list: c_long = 305; ++pub const SYS_splice: c_long = 306; ++pub const SYS_sync_file_range: c_long = 307; ++pub const SYS_tee: c_long = 308; ++pub const SYS_vmsplice: c_long = 309; ++pub const SYS_move_pages: c_long = 310; ++pub const SYS_getcpu: c_long = 311; ++pub const SYS_epoll_pwait: c_long = 312; ++pub const SYS_utimes: c_long = 313; ++pub const SYS_fallocate: c_long = 314; ++pub const SYS_utimensat: c_long = 315; ++pub const SYS_signalfd: c_long = 316; ++pub const SYS_timerfd: c_long = 317; ++pub const SYS_eventfd: c_long = 318; ++pub const SYS_timerfd_create: c_long = 319; ++pub const SYS_timerfd_settime: c_long = 320; ++pub const SYS_timerfd_gettime: c_long = 321; ++pub const SYS_signalfd4: c_long = 322; ++pub const SYS_eventfd2: c_long = 323; ++pub const SYS_inotify_init1: c_long = 324; ++pub const SYS_pipe2: c_long = 325; ++pub const SYS_dup3: c_long = 326; ++pub const SYS_epoll_create1: c_long = 327; ++pub const SYS_preadv: c_long = 328; ++pub const SYS_pwritev: c_long = 329; ++pub const SYS_rt_tgsigqueueinfo: c_long = 330; ++pub const SYS_perf_event_open: c_long = 331; ++pub const SYS_fanotify_init: c_long = 332; ++pub const SYS_fanotify_mark: c_long = 333; ++pub const SYS_prlimit64: c_long = 334; ++pub const SYS_name_to_handle_at: c_long = 335; ++pub const SYS_open_by_handle_at: c_long = 336; ++pub const SYS_clock_adjtime: c_long = 337; ++pub const SYS_syncfs: c_long = 338; ++pub const SYS_setns: c_long = 339; ++pub const SYS_process_vm_readv: c_long = 340; ++pub const SYS_process_vm_writev: c_long = 341; ++pub const SYS_s390_runtime_instr: c_long = 342; ++pub const SYS_kcmp: c_long = 343; ++pub const SYS_finit_module: c_long = 344; ++pub const SYS_sched_setattr: c_long = 345; ++pub const SYS_sched_getattr: c_long = 346; ++pub const SYS_renameat2: c_long = 347; ++pub const SYS_seccomp: c_long = 348; ++pub const SYS_getrandom: c_long = 349; ++pub const SYS_memfd_create: c_long = 350; ++pub const SYS_bpf: c_long = 351; ++pub const SYS_s390_pci_mmio_write: c_long = 352; ++pub const SYS_s390_pci_mmio_read: c_long = 353; ++pub const SYS_execveat: c_long = 354; ++pub const SYS_userfaultfd: c_long = 355; ++pub const SYS_membarrier: c_long = 356; ++pub const SYS_recvmmsg: c_long = 357; ++pub const SYS_sendmmsg: c_long = 358; ++pub const SYS_socket: c_long = 359; ++pub const SYS_socketpair: c_long = 360; ++pub const SYS_bind: c_long = 361; ++pub const SYS_connect: c_long = 362; ++pub const SYS_listen: c_long = 363; ++pub const SYS_accept4: c_long = 364; ++pub const SYS_getsockopt: c_long = 365; ++pub const SYS_setsockopt: c_long = 366; ++pub const SYS_getsockname: c_long = 367; ++pub const SYS_getpeername: c_long = 368; ++pub const SYS_sendto: c_long = 369; ++pub const SYS_sendmsg: c_long = 370; ++pub const SYS_recvfrom: c_long = 371; ++pub const SYS_recvmsg: c_long = 372; ++pub const SYS_shutdown: c_long = 373; ++pub const SYS_mlock2: c_long = 374; ++pub const SYS_copy_file_range: c_long = 375; ++pub const SYS_preadv2: c_long = 376; ++pub const SYS_pwritev2: c_long = 377; ++pub const SYS_s390_guarded_storage: c_long = 378; ++pub const SYS_statx: c_long = 379; ++pub const SYS_s390_sthyi: c_long = 380; ++pub const SYS_kexec_file_load: c_long = 381; ++pub const SYS_io_pgetevents: c_long = 382; ++pub const SYS_rseq: c_long = 383; ++pub const SYS_pkey_mprotect: c_long = 384; ++pub const SYS_pkey_alloc: c_long = 385; ++pub const SYS_pkey_free: c_long = 386; ++pub const SYS_semtimedop: c_long = 392; ++pub const SYS_semget: c_long = 393; ++pub const SYS_semctl: c_long = 394; ++pub const SYS_shmget: c_long = 395; ++pub const SYS_shmctl: c_long = 396; ++pub const SYS_shmat: c_long = 397; ++pub const SYS_shmdt: c_long = 398; ++pub const SYS_msgget: c_long = 399; ++pub const SYS_msgsnd: c_long = 400; ++pub const SYS_msgrcv: c_long = 401; ++pub const SYS_msgctl: c_long = 402; ++pub const SYS_pidfd_send_signal: c_long = 424; ++pub const SYS_io_uring_setup: c_long = 425; ++pub const SYS_io_uring_enter: c_long = 426; ++pub const SYS_io_uring_register: c_long = 427; ++pub const SYS_open_tree: c_long = 428; ++pub const SYS_move_mount: c_long = 429; ++pub const SYS_fsopen: c_long = 430; ++pub const SYS_fsconfig: c_long = 431; ++pub const SYS_fsmount: c_long = 432; ++pub const SYS_fspick: c_long = 433; ++pub const SYS_pidfd_open: c_long = 434; ++pub const SYS_clone3: c_long = 435; ++pub const SYS_close_range: c_long = 436; ++pub const SYS_openat2: c_long = 437; ++pub const SYS_pidfd_getfd: c_long = 438; ++pub const SYS_faccessat2: c_long = 439; ++pub const SYS_process_madvise: c_long = 440; ++pub const SYS_epoll_pwait2: c_long = 441; ++pub const SYS_mount_setattr: c_long = 442; ++pub const SYS_landlock_create_ruleset: c_long = 444; ++pub const SYS_landlock_add_rule: c_long = 445; ++pub const SYS_landlock_restrict_self: c_long = 446; ++pub const SYS_memfd_secret: c_long = 447; ++pub const SYS_process_mrelease: c_long = 448; ++pub const SYS_futex_waitv: c_long = 449; ++pub const SYS_set_mempolicy_home_node: c_long = 450; ++pub const SYS_cachestat: c_long = 451; ++pub const SYS_fchmodat2: c_long = 452; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/b64/x86_64/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,936 @@ ++use crate::off_t; ++use crate::prelude::*; ++ ++pub type c_char = i8; ++pub type wchar_t = i32; ++pub type nlink_t = u64; ++pub type blksize_t = c_long; ++pub type __u64 = c_ulonglong; ++pub type __s64 = c_longlong; ++pub type greg_t = i64; ++ ++s! { ++ pub struct stat { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_mode: crate::mode_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ __pad0: c_int, ++ pub st_rdev: crate::dev_t, ++ pub st_size: off_t, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ __unused: [c_long; 3], ++ } ++ ++ pub struct stat64 { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino64_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_mode: crate::mode_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ __pad0: c_int, ++ pub st_rdev: crate::dev_t, ++ pub st_size: off_t, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt64_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ __reserved: [c_long; 3], ++ } ++ ++ pub struct user_regs_struct { ++ pub r15: c_ulong, ++ pub r14: c_ulong, ++ pub r13: c_ulong, ++ pub r12: c_ulong, ++ pub rbp: c_ulong, ++ pub rbx: c_ulong, ++ pub r11: c_ulong, ++ pub r10: c_ulong, ++ pub r9: c_ulong, ++ pub r8: c_ulong, ++ pub rax: c_ulong, ++ pub rcx: c_ulong, ++ pub rdx: c_ulong, ++ pub rsi: c_ulong, ++ pub rdi: c_ulong, ++ pub orig_rax: c_ulong, ++ pub rip: c_ulong, ++ pub cs: c_ulong, ++ pub eflags: c_ulong, ++ pub rsp: c_ulong, ++ pub ss: c_ulong, ++ pub fs_base: c_ulong, ++ pub gs_base: c_ulong, ++ pub ds: c_ulong, ++ pub es: c_ulong, ++ pub fs: c_ulong, ++ pub gs: c_ulong, ++ } ++ ++ pub struct user { ++ pub regs: user_regs_struct, ++ pub u_fpvalid: c_int, ++ pub i387: user_fpregs_struct, ++ pub u_tsize: c_ulong, ++ pub u_dsize: c_ulong, ++ pub u_ssize: c_ulong, ++ pub start_code: c_ulong, ++ pub start_stack: c_ulong, ++ pub signal: c_long, ++ __reserved: c_int, ++ #[cfg(target_pointer_width = "32")] ++ __pad1: u32, ++ pub u_ar0: *mut user_regs_struct, ++ #[cfg(target_pointer_width = "32")] ++ __pad2: u32, ++ pub u_fpstate: *mut user_fpregs_struct, ++ pub magic: c_ulong, ++ pub u_comm: [c_char; 32], ++ pub u_debugreg: [c_ulong; 8], ++ } ++ ++ // GitHub repo: ifduyue/musl/ ++ // commit: b4b1e10364c8737a632be61582e05a8d3acf5690 ++ // file: arch/x86_64/bits/signal.h#L80-L84 ++ pub struct mcontext_t { ++ pub gregs: [greg_t; 23], ++ __private: [u64; 9], ++ } ++ ++ pub struct ipc_perm { ++ pub __ipc_perm_key: crate::key_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub cuid: crate::uid_t, ++ pub cgid: crate::gid_t, ++ pub mode: crate::mode_t, ++ pub __seq: c_int, ++ __unused1: c_long, ++ __unused2: c_long, ++ } ++ ++ #[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, ++ } ++} ++ ++s_no_extra_traits! { ++ pub struct user_fpregs_struct { ++ pub cwd: c_ushort, ++ pub swd: c_ushort, ++ pub ftw: c_ushort, ++ pub fop: c_ushort, ++ pub rip: c_ulong, ++ pub rdp: c_ulong, ++ pub mxcsr: c_uint, ++ pub mxcr_mask: c_uint, ++ pub st_space: [c_uint; 32], ++ pub xmm_space: [c_uint; 64], ++ padding: [c_uint; 24], ++ } ++ ++ pub struct ucontext_t { ++ pub uc_flags: c_ulong, ++ pub uc_link: *mut ucontext_t, ++ pub uc_stack: crate::stack_t, ++ pub uc_mcontext: mcontext_t, ++ pub uc_sigmask: crate::sigset_t, ++ __private: [u8; 512], ++ } ++ ++ #[allow(missing_debug_implementations)] ++ #[repr(align(16))] ++ pub struct max_align_t { ++ priv_: [f64; 4], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for user_fpregs_struct { ++ fn eq(&self, other: &user_fpregs_struct) -> bool { ++ self.cwd == other.cwd ++ && self.swd == other.swd ++ && self.ftw == other.ftw ++ && self.fop == other.fop ++ && self.rip == other.rip ++ && self.rdp == other.rdp ++ && self.mxcsr == other.mxcsr ++ && self.mxcr_mask == other.mxcr_mask ++ && self.st_space == other.st_space ++ && self ++ .xmm_space ++ .iter() ++ .zip(other.xmm_space.iter()) ++ .all(|(a, b)| a == b) ++ // Ignore padding field ++ } ++ } ++ ++ impl Eq for user_fpregs_struct {} ++ ++ impl fmt::Debug for user_fpregs_struct { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("user_fpregs_struct") ++ .field("cwd", &self.cwd) ++ .field("ftw", &self.ftw) ++ .field("fop", &self.fop) ++ .field("rip", &self.rip) ++ .field("rdp", &self.rdp) ++ .field("mxcsr", &self.mxcsr) ++ .field("mxcr_mask", &self.mxcr_mask) ++ .field("st_space", &self.st_space) ++ // FIXME: .field("xmm_space", &self.xmm_space) ++ // Ignore padding field ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for user_fpregs_struct { ++ fn hash(&self, state: &mut H) { ++ self.cwd.hash(state); ++ self.ftw.hash(state); ++ self.fop.hash(state); ++ self.rip.hash(state); ++ self.rdp.hash(state); ++ self.mxcsr.hash(state); ++ self.mxcr_mask.hash(state); ++ self.st_space.hash(state); ++ self.xmm_space.hash(state); ++ // Ignore padding field ++ } ++ } ++ ++ impl PartialEq for ucontext_t { ++ fn eq(&self, other: &ucontext_t) -> bool { ++ self.uc_flags == other.uc_flags ++ && self.uc_link == other.uc_link ++ && self.uc_stack == other.uc_stack ++ && self.uc_mcontext == other.uc_mcontext ++ && self.uc_sigmask == other.uc_sigmask ++ && self ++ .__private ++ .iter() ++ .zip(other.__private.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ ++ impl Eq for ucontext_t {} ++ ++ impl fmt::Debug for ucontext_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("ucontext_t") ++ .field("uc_flags", &self.uc_flags) ++ .field("uc_link", &self.uc_link) ++ .field("uc_stack", &self.uc_stack) ++ .field("uc_mcontext", &self.uc_mcontext) ++ .field("uc_sigmask", &self.uc_sigmask) ++ // Ignore __private field ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for ucontext_t { ++ fn hash(&self, state: &mut H) { ++ self.uc_flags.hash(state); ++ self.uc_link.hash(state); ++ self.uc_stack.hash(state); ++ self.uc_mcontext.hash(state); ++ self.uc_sigmask.hash(state); ++ self.__private.hash(state); ++ } ++ } ++ } ++} ++ ++// Syscall table ++ ++pub const SYS_read: c_long = 0; ++pub const SYS_write: c_long = 1; ++pub const SYS_open: c_long = 2; ++pub const SYS_close: c_long = 3; ++pub const SYS_stat: c_long = 4; ++pub const SYS_fstat: c_long = 5; ++pub const SYS_lstat: c_long = 6; ++pub const SYS_poll: c_long = 7; ++pub const SYS_lseek: c_long = 8; ++pub const SYS_mmap: c_long = 9; ++pub const SYS_mprotect: c_long = 10; ++pub const SYS_munmap: c_long = 11; ++pub const SYS_brk: c_long = 12; ++pub const SYS_rt_sigaction: c_long = 13; ++pub const SYS_rt_sigprocmask: c_long = 14; ++pub const SYS_rt_sigreturn: c_long = 15; ++pub const SYS_ioctl: c_long = 16; ++pub const SYS_pread64: c_long = 17; ++pub const SYS_pwrite64: c_long = 18; ++pub const SYS_readv: c_long = 19; ++pub const SYS_writev: c_long = 20; ++pub const SYS_access: c_long = 21; ++pub const SYS_pipe: c_long = 22; ++pub const SYS_select: c_long = 23; ++pub const SYS_sched_yield: c_long = 24; ++pub const SYS_mremap: c_long = 25; ++pub const SYS_msync: c_long = 26; ++pub const SYS_mincore: c_long = 27; ++pub const SYS_madvise: c_long = 28; ++pub const SYS_shmget: c_long = 29; ++pub const SYS_shmat: c_long = 30; ++pub const SYS_shmctl: c_long = 31; ++pub const SYS_dup: c_long = 32; ++pub const SYS_dup2: c_long = 33; ++pub const SYS_pause: c_long = 34; ++pub const SYS_nanosleep: c_long = 35; ++pub const SYS_getitimer: c_long = 36; ++pub const SYS_alarm: c_long = 37; ++pub const SYS_setitimer: c_long = 38; ++pub const SYS_getpid: c_long = 39; ++pub const SYS_sendfile: c_long = 40; ++pub const SYS_socket: c_long = 41; ++pub const SYS_connect: c_long = 42; ++pub const SYS_accept: c_long = 43; ++pub const SYS_sendto: c_long = 44; ++pub const SYS_recvfrom: c_long = 45; ++pub const SYS_sendmsg: c_long = 46; ++pub const SYS_recvmsg: c_long = 47; ++pub const SYS_shutdown: c_long = 48; ++pub const SYS_bind: c_long = 49; ++pub const SYS_listen: c_long = 50; ++pub const SYS_getsockname: c_long = 51; ++pub const SYS_getpeername: c_long = 52; ++pub const SYS_socketpair: c_long = 53; ++pub const SYS_setsockopt: c_long = 54; ++pub const SYS_getsockopt: c_long = 55; ++pub const SYS_clone: c_long = 56; ++pub const SYS_fork: c_long = 57; ++pub const SYS_vfork: c_long = 58; ++pub const SYS_execve: c_long = 59; ++pub const SYS_exit: c_long = 60; ++pub const SYS_wait4: c_long = 61; ++pub const SYS_kill: c_long = 62; ++pub const SYS_uname: c_long = 63; ++pub const SYS_semget: c_long = 64; ++pub const SYS_semop: c_long = 65; ++pub const SYS_semctl: c_long = 66; ++pub const SYS_shmdt: c_long = 67; ++pub const SYS_msgget: c_long = 68; ++pub const SYS_msgsnd: c_long = 69; ++pub const SYS_msgrcv: c_long = 70; ++pub const SYS_msgctl: c_long = 71; ++pub const SYS_fcntl: c_long = 72; ++pub const SYS_flock: c_long = 73; ++pub const SYS_fsync: c_long = 74; ++pub const SYS_fdatasync: c_long = 75; ++pub const SYS_truncate: c_long = 76; ++pub const SYS_ftruncate: c_long = 77; ++pub const SYS_getdents: c_long = 78; ++pub const SYS_getcwd: c_long = 79; ++pub const SYS_chdir: c_long = 80; ++pub const SYS_fchdir: c_long = 81; ++pub const SYS_rename: c_long = 82; ++pub const SYS_mkdir: c_long = 83; ++pub const SYS_rmdir: c_long = 84; ++pub const SYS_creat: c_long = 85; ++pub const SYS_link: c_long = 86; ++pub const SYS_unlink: c_long = 87; ++pub const SYS_symlink: c_long = 88; ++pub const SYS_readlink: c_long = 89; ++pub const SYS_chmod: c_long = 90; ++pub const SYS_fchmod: c_long = 91; ++pub const SYS_chown: c_long = 92; ++pub const SYS_fchown: c_long = 93; ++pub const SYS_lchown: c_long = 94; ++pub const SYS_umask: c_long = 95; ++pub const SYS_gettimeofday: c_long = 96; ++pub const SYS_getrlimit: c_long = 97; ++pub const SYS_getrusage: c_long = 98; ++pub const SYS_sysinfo: c_long = 99; ++pub const SYS_times: c_long = 100; ++pub const SYS_ptrace: c_long = 101; ++pub const SYS_getuid: c_long = 102; ++pub const SYS_syslog: c_long = 103; ++pub const SYS_getgid: c_long = 104; ++pub const SYS_setuid: c_long = 105; ++pub const SYS_setgid: c_long = 106; ++pub const SYS_geteuid: c_long = 107; ++pub const SYS_getegid: c_long = 108; ++pub const SYS_setpgid: c_long = 109; ++pub const SYS_getppid: c_long = 110; ++pub const SYS_getpgrp: c_long = 111; ++pub const SYS_setsid: c_long = 112; ++pub const SYS_setreuid: c_long = 113; ++pub const SYS_setregid: c_long = 114; ++pub const SYS_getgroups: c_long = 115; ++pub const SYS_setgroups: c_long = 116; ++pub const SYS_setresuid: c_long = 117; ++pub const SYS_getresuid: c_long = 118; ++pub const SYS_setresgid: c_long = 119; ++pub const SYS_getresgid: c_long = 120; ++pub const SYS_getpgid: c_long = 121; ++pub const SYS_setfsuid: c_long = 122; ++pub const SYS_setfsgid: c_long = 123; ++pub const SYS_getsid: c_long = 124; ++pub const SYS_capget: c_long = 125; ++pub const SYS_capset: c_long = 126; ++pub const SYS_rt_sigpending: c_long = 127; ++pub const SYS_rt_sigtimedwait: c_long = 128; ++pub const SYS_rt_sigqueueinfo: c_long = 129; ++pub const SYS_rt_sigsuspend: c_long = 130; ++pub const SYS_sigaltstack: c_long = 131; ++pub const SYS_utime: c_long = 132; ++pub const SYS_mknod: c_long = 133; ++pub const SYS_uselib: c_long = 134; ++pub const SYS_personality: c_long = 135; ++pub const SYS_ustat: c_long = 136; ++pub const SYS_statfs: c_long = 137; ++pub const SYS_fstatfs: c_long = 138; ++pub const SYS_sysfs: c_long = 139; ++pub const SYS_getpriority: c_long = 140; ++pub const SYS_setpriority: c_long = 141; ++pub const SYS_sched_setparam: c_long = 142; ++pub const SYS_sched_getparam: c_long = 143; ++pub const SYS_sched_setscheduler: c_long = 144; ++pub const SYS_sched_getscheduler: c_long = 145; ++pub const SYS_sched_get_priority_max: c_long = 146; ++pub const SYS_sched_get_priority_min: c_long = 147; ++pub const SYS_sched_rr_get_interval: c_long = 148; ++pub const SYS_mlock: c_long = 149; ++pub const SYS_munlock: c_long = 150; ++pub const SYS_mlockall: c_long = 151; ++pub const SYS_munlockall: c_long = 152; ++pub const SYS_vhangup: c_long = 153; ++pub const SYS_modify_ldt: c_long = 154; ++pub const SYS_pivot_root: c_long = 155; ++pub const SYS__sysctl: c_long = 156; ++pub const SYS_prctl: c_long = 157; ++pub const SYS_arch_prctl: c_long = 158; ++pub const SYS_adjtimex: c_long = 159; ++pub const SYS_setrlimit: c_long = 160; ++pub const SYS_chroot: c_long = 161; ++pub const SYS_sync: c_long = 162; ++pub const SYS_acct: c_long = 163; ++pub const SYS_settimeofday: c_long = 164; ++pub const SYS_mount: c_long = 165; ++pub const SYS_umount2: c_long = 166; ++pub const SYS_swapon: c_long = 167; ++pub const SYS_swapoff: c_long = 168; ++pub const SYS_reboot: c_long = 169; ++pub const SYS_sethostname: c_long = 170; ++pub const SYS_setdomainname: c_long = 171; ++pub const SYS_iopl: c_long = 172; ++pub const SYS_ioperm: c_long = 173; ++pub const SYS_create_module: c_long = 174; ++pub const SYS_init_module: c_long = 175; ++pub const SYS_delete_module: c_long = 176; ++pub const SYS_get_kernel_syms: c_long = 177; ++pub const SYS_query_module: c_long = 178; ++pub const SYS_quotactl: c_long = 179; ++pub const SYS_nfsservctl: c_long = 180; ++pub const SYS_getpmsg: c_long = 181; ++pub const SYS_putpmsg: c_long = 182; ++pub const SYS_afs_syscall: c_long = 183; ++pub const SYS_tuxcall: c_long = 184; ++pub const SYS_security: c_long = 185; ++pub const SYS_gettid: c_long = 186; ++pub const SYS_readahead: c_long = 187; ++pub const SYS_setxattr: c_long = 188; ++pub const SYS_lsetxattr: c_long = 189; ++pub const SYS_fsetxattr: c_long = 190; ++pub const SYS_getxattr: c_long = 191; ++pub const SYS_lgetxattr: c_long = 192; ++pub const SYS_fgetxattr: c_long = 193; ++pub const SYS_listxattr: c_long = 194; ++pub const SYS_llistxattr: c_long = 195; ++pub const SYS_flistxattr: c_long = 196; ++pub const SYS_removexattr: c_long = 197; ++pub const SYS_lremovexattr: c_long = 198; ++pub const SYS_fremovexattr: c_long = 199; ++pub const SYS_tkill: c_long = 200; ++pub const SYS_time: c_long = 201; ++pub const SYS_futex: c_long = 202; ++pub const SYS_sched_setaffinity: c_long = 203; ++pub const SYS_sched_getaffinity: c_long = 204; ++pub const SYS_set_thread_area: c_long = 205; ++pub const SYS_io_setup: c_long = 206; ++pub const SYS_io_destroy: c_long = 207; ++pub const SYS_io_getevents: c_long = 208; ++pub const SYS_io_submit: c_long = 209; ++pub const SYS_io_cancel: c_long = 210; ++pub const SYS_get_thread_area: c_long = 211; ++pub const SYS_lookup_dcookie: c_long = 212; ++pub const SYS_epoll_create: c_long = 213; ++pub const SYS_epoll_ctl_old: c_long = 214; ++pub const SYS_epoll_wait_old: c_long = 215; ++pub const SYS_remap_file_pages: c_long = 216; ++pub const SYS_getdents64: c_long = 217; ++pub const SYS_set_tid_address: c_long = 218; ++pub const SYS_restart_syscall: c_long = 219; ++pub const SYS_semtimedop: c_long = 220; ++pub const SYS_fadvise64: c_long = 221; ++pub const SYS_timer_create: c_long = 222; ++pub const SYS_timer_settime: c_long = 223; ++pub const SYS_timer_gettime: c_long = 224; ++pub const SYS_timer_getoverrun: c_long = 225; ++pub const SYS_timer_delete: c_long = 226; ++pub const SYS_clock_settime: c_long = 227; ++pub const SYS_clock_gettime: c_long = 228; ++pub const SYS_clock_getres: c_long = 229; ++pub const SYS_clock_nanosleep: c_long = 230; ++pub const SYS_exit_group: c_long = 231; ++pub const SYS_epoll_wait: c_long = 232; ++pub const SYS_epoll_ctl: c_long = 233; ++pub const SYS_tgkill: c_long = 234; ++pub const SYS_utimes: c_long = 235; ++pub const SYS_vserver: c_long = 236; ++pub const SYS_mbind: c_long = 237; ++pub const SYS_set_mempolicy: c_long = 238; ++pub const SYS_get_mempolicy: c_long = 239; ++pub const SYS_mq_open: c_long = 240; ++pub const SYS_mq_unlink: c_long = 241; ++pub const SYS_mq_timedsend: c_long = 242; ++pub const SYS_mq_timedreceive: c_long = 243; ++pub const SYS_mq_notify: c_long = 244; ++pub const SYS_mq_getsetattr: c_long = 245; ++pub const SYS_kexec_load: c_long = 246; ++pub const SYS_waitid: c_long = 247; ++pub const SYS_add_key: c_long = 248; ++pub const SYS_request_key: c_long = 249; ++pub const SYS_keyctl: c_long = 250; ++pub const SYS_ioprio_set: c_long = 251; ++pub const SYS_ioprio_get: c_long = 252; ++pub const SYS_inotify_init: c_long = 253; ++pub const SYS_inotify_add_watch: c_long = 254; ++pub const SYS_inotify_rm_watch: c_long = 255; ++pub const SYS_migrate_pages: c_long = 256; ++pub const SYS_openat: c_long = 257; ++pub const SYS_mkdirat: c_long = 258; ++pub const SYS_mknodat: c_long = 259; ++pub const SYS_fchownat: c_long = 260; ++pub const SYS_futimesat: c_long = 261; ++pub const SYS_newfstatat: c_long = 262; ++pub const SYS_unlinkat: c_long = 263; ++pub const SYS_renameat: c_long = 264; ++pub const SYS_linkat: c_long = 265; ++pub const SYS_symlinkat: c_long = 266; ++pub const SYS_readlinkat: c_long = 267; ++pub const SYS_fchmodat: c_long = 268; ++pub const SYS_faccessat: c_long = 269; ++pub const SYS_pselect6: c_long = 270; ++pub const SYS_ppoll: c_long = 271; ++pub const SYS_unshare: c_long = 272; ++pub const SYS_set_robust_list: c_long = 273; ++pub const SYS_get_robust_list: c_long = 274; ++pub const SYS_splice: c_long = 275; ++pub const SYS_tee: c_long = 276; ++pub const SYS_sync_file_range: c_long = 277; ++pub const SYS_vmsplice: c_long = 278; ++pub const SYS_move_pages: c_long = 279; ++pub const SYS_utimensat: c_long = 280; ++pub const SYS_epoll_pwait: c_long = 281; ++pub const SYS_signalfd: c_long = 282; ++pub const SYS_timerfd_create: c_long = 283; ++pub const SYS_eventfd: c_long = 284; ++pub const SYS_fallocate: c_long = 285; ++pub const SYS_timerfd_settime: c_long = 286; ++pub const SYS_timerfd_gettime: c_long = 287; ++pub const SYS_accept4: c_long = 288; ++pub const SYS_signalfd4: c_long = 289; ++pub const SYS_eventfd2: c_long = 290; ++pub const SYS_epoll_create1: c_long = 291; ++pub const SYS_dup3: c_long = 292; ++pub const SYS_pipe2: c_long = 293; ++pub const SYS_inotify_init1: c_long = 294; ++pub const SYS_preadv: c_long = 295; ++pub const SYS_pwritev: c_long = 296; ++pub const SYS_rt_tgsigqueueinfo: c_long = 297; ++pub const SYS_perf_event_open: c_long = 298; ++pub const SYS_recvmmsg: c_long = 299; ++pub const SYS_fanotify_init: c_long = 300; ++pub const SYS_fanotify_mark: c_long = 301; ++pub const SYS_prlimit64: c_long = 302; ++pub const SYS_name_to_handle_at: c_long = 303; ++pub const SYS_open_by_handle_at: c_long = 304; ++pub const SYS_clock_adjtime: c_long = 305; ++pub const SYS_syncfs: c_long = 306; ++pub const SYS_sendmmsg: c_long = 307; ++pub const SYS_setns: c_long = 308; ++pub const SYS_getcpu: c_long = 309; ++pub const SYS_process_vm_readv: c_long = 310; ++pub const SYS_process_vm_writev: c_long = 311; ++pub const SYS_kcmp: c_long = 312; ++pub const SYS_finit_module: c_long = 313; ++pub const SYS_sched_setattr: c_long = 314; ++pub const SYS_sched_getattr: c_long = 315; ++pub const SYS_renameat2: c_long = 316; ++pub const SYS_seccomp: c_long = 317; ++pub const SYS_getrandom: c_long = 318; ++pub const SYS_memfd_create: c_long = 319; ++pub const SYS_kexec_file_load: c_long = 320; ++pub const SYS_bpf: c_long = 321; ++pub const SYS_execveat: c_long = 322; ++pub const SYS_userfaultfd: c_long = 323; ++pub const SYS_membarrier: c_long = 324; ++pub const SYS_mlock2: c_long = 325; ++pub const SYS_copy_file_range: c_long = 326; ++pub const SYS_preadv2: c_long = 327; ++pub const SYS_pwritev2: c_long = 328; ++pub const SYS_pkey_mprotect: c_long = 329; ++pub const SYS_pkey_alloc: c_long = 330; ++pub const SYS_pkey_free: c_long = 331; ++pub const SYS_statx: c_long = 332; ++pub const SYS_io_pgetevents: c_long = 333; ++pub const SYS_rseq: c_long = 334; ++pub const SYS_pidfd_send_signal: c_long = 424; ++pub const SYS_io_uring_setup: c_long = 425; ++pub const SYS_io_uring_enter: c_long = 426; ++pub const SYS_io_uring_register: c_long = 427; ++pub const SYS_open_tree: c_long = 428; ++pub const SYS_move_mount: c_long = 429; ++pub const SYS_fsopen: c_long = 430; ++pub const SYS_fsconfig: c_long = 431; ++pub const SYS_fsmount: c_long = 432; ++pub const SYS_fspick: c_long = 433; ++pub const SYS_pidfd_open: c_long = 434; ++pub const SYS_clone3: c_long = 435; ++pub const SYS_close_range: c_long = 436; ++pub const SYS_openat2: c_long = 437; ++pub const SYS_pidfd_getfd: c_long = 438; ++pub const SYS_faccessat2: c_long = 439; ++pub const SYS_process_madvise: c_long = 440; ++pub const SYS_epoll_pwait2: c_long = 441; ++pub const SYS_mount_setattr: c_long = 442; ++pub const SYS_quotactl_fd: c_long = 443; ++pub const SYS_landlock_create_ruleset: c_long = 444; ++pub const SYS_landlock_add_rule: c_long = 445; ++pub const SYS_landlock_restrict_self: c_long = 446; ++pub const SYS_memfd_secret: c_long = 447; ++pub const SYS_process_mrelease: c_long = 448; ++pub const SYS_futex_waitv: c_long = 449; ++pub const SYS_set_mempolicy_home_node: c_long = 450; ++pub const SYS_fchmodat2: c_long = 452; ++pub const SYS_mseal: c_long = 462; ++ ++// offsets in user_regs_structs, from sys/reg.h ++pub const R15: c_int = 0; ++pub const R14: c_int = 1; ++pub const R13: c_int = 2; ++pub const R12: c_int = 3; ++pub const RBP: c_int = 4; ++pub const RBX: c_int = 5; ++pub const R11: c_int = 6; ++pub const R10: c_int = 7; ++pub const R9: c_int = 8; ++pub const R8: c_int = 9; ++pub const RAX: c_int = 10; ++pub const RCX: c_int = 11; ++pub const RDX: c_int = 12; ++pub const RSI: c_int = 13; ++pub const RDI: c_int = 14; ++pub const ORIG_RAX: c_int = 15; ++pub const RIP: c_int = 16; ++pub const CS: c_int = 17; ++pub const EFLAGS: c_int = 18; ++pub const RSP: c_int = 19; ++pub const SS: c_int = 20; ++pub const FS_BASE: c_int = 21; ++pub const GS_BASE: c_int = 22; ++pub const DS: c_int = 23; ++pub const ES: c_int = 24; ++pub const FS: c_int = 25; ++pub const GS: c_int = 26; ++ ++// offsets in mcontext_t.gregs from bits/signal.h ++// GitHub repo: ifduyue/musl/ ++// commit: b4b1e10364c8737a632be61582e05a8d3acf5690 ++// file: arch/x86_64/bits/signal.h#L9-L56 ++pub const REG_R8: c_int = 0; ++pub const REG_R9: c_int = 1; ++pub const REG_R10: c_int = 2; ++pub const REG_R11: c_int = 3; ++pub const REG_R12: c_int = 4; ++pub const REG_R13: c_int = 5; ++pub const REG_R14: c_int = 6; ++pub const REG_R15: c_int = 7; ++pub const REG_RDI: c_int = 8; ++pub const REG_RSI: c_int = 9; ++pub const REG_RBP: c_int = 10; ++pub const REG_RBX: c_int = 11; ++pub const REG_RDX: c_int = 12; ++pub const REG_RAX: c_int = 13; ++pub const REG_RCX: c_int = 14; ++pub const REG_RSP: c_int = 15; ++pub const REG_RIP: c_int = 16; ++pub const REG_EFL: c_int = 17; ++pub const REG_CSGSFS: c_int = 18; ++pub const REG_ERR: c_int = 19; ++pub const REG_TRAPNO: c_int = 20; ++pub const REG_OLDMASK: c_int = 21; ++pub const REG_CR2: c_int = 22; ++ ++pub const MADV_SOFT_OFFLINE: c_int = 101; ++pub const MAP_32BIT: c_int = 0x0040; ++pub const O_APPEND: c_int = 1024; ++pub const O_DIRECT: c_int = 0x4000; ++pub const O_DIRECTORY: c_int = 0x10000; ++pub const O_LARGEFILE: c_int = 0; ++pub const O_NOFOLLOW: c_int = 0x20000; ++pub const O_CREAT: c_int = 64; ++pub const O_EXCL: c_int = 128; ++pub const O_NOCTTY: c_int = 256; ++pub const O_NONBLOCK: c_int = 2048; ++pub const O_SYNC: c_int = 1052672; ++pub const O_RSYNC: c_int = 1052672; ++pub const O_DSYNC: c_int = 4096; ++pub const O_ASYNC: c_int = 0x2000; ++ ++pub const PTRACE_SYSEMU: c_int = 31; ++pub const PTRACE_SYSEMU_SINGLESTEP: c_int = 32; ++ ++pub const SIGSTKSZ: size_t = 8192; ++pub const MINSIGSTKSZ: size_t = 2048; ++ ++pub const ENAMETOOLONG: c_int = 36; ++pub const ENOLCK: c_int = 37; ++pub const ENOSYS: c_int = 38; ++pub const ENOTEMPTY: c_int = 39; ++pub const ELOOP: c_int = 40; ++pub const ENOMSG: c_int = 42; ++pub const EIDRM: c_int = 43; ++pub const ECHRNG: c_int = 44; ++pub const EL2NSYNC: c_int = 45; ++pub const EL3HLT: c_int = 46; ++pub const EL3RST: c_int = 47; ++pub const ELNRNG: c_int = 48; ++pub const EUNATCH: c_int = 49; ++pub const ENOCSI: c_int = 50; ++pub const EL2HLT: c_int = 51; ++pub const EBADE: c_int = 52; ++pub const EBADR: c_int = 53; ++pub const EXFULL: c_int = 54; ++pub const ENOANO: c_int = 55; ++pub const EBADRQC: c_int = 56; ++pub const EBADSLT: c_int = 57; ++pub const EMULTIHOP: c_int = 72; ++pub const EBADMSG: c_int = 74; ++pub const EOVERFLOW: c_int = 75; ++pub const ENOTUNIQ: c_int = 76; ++pub const EBADFD: c_int = 77; ++pub const EREMCHG: c_int = 78; ++pub const ELIBACC: c_int = 79; ++pub const ELIBBAD: c_int = 80; ++pub const ELIBSCN: c_int = 81; ++pub const ELIBMAX: c_int = 82; ++pub const ELIBEXEC: c_int = 83; ++pub const EILSEQ: c_int = 84; ++pub const ERESTART: c_int = 85; ++pub const ESTRPIPE: c_int = 86; ++pub const EUSERS: c_int = 87; ++pub const ENOTSOCK: c_int = 88; ++pub const EDESTADDRREQ: c_int = 89; ++pub const EMSGSIZE: c_int = 90; ++pub const EPROTOTYPE: c_int = 91; ++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 EADDRINUSE: c_int = 98; ++pub const EADDRNOTAVAIL: c_int = 99; ++pub const ENETDOWN: c_int = 100; ++pub const ENETUNREACH: c_int = 101; ++pub const ENETRESET: c_int = 102; ++pub const ECONNABORTED: c_int = 103; ++pub const ECONNRESET: c_int = 104; ++pub const ENOBUFS: c_int = 105; ++pub const EISCONN: c_int = 106; ++pub const ENOTCONN: c_int = 107; ++pub const ESHUTDOWN: c_int = 108; ++pub const ETOOMANYREFS: c_int = 109; ++pub const ETIMEDOUT: c_int = 110; ++pub const ECONNREFUSED: c_int = 111; ++pub const EHOSTDOWN: c_int = 112; ++pub const EHOSTUNREACH: c_int = 113; ++pub const EALREADY: c_int = 114; ++pub const EINPROGRESS: c_int = 115; ++pub const ESTALE: c_int = 116; ++pub const EUCLEAN: c_int = 117; ++pub const ENOTNAM: c_int = 118; ++pub const ENAVAIL: c_int = 119; ++pub const EISNAM: c_int = 120; ++pub const EREMOTEIO: c_int = 121; ++pub const EDQUOT: c_int = 122; ++pub const ENOMEDIUM: c_int = 123; ++pub const EMEDIUMTYPE: c_int = 124; ++pub const ECANCELED: c_int = 125; ++pub const ENOKEY: c_int = 126; ++pub const EKEYEXPIRED: c_int = 127; ++pub const EKEYREVOKED: c_int = 128; ++pub const EKEYREJECTED: c_int = 129; ++pub const EOWNERDEAD: c_int = 130; ++pub const ENOTRECOVERABLE: c_int = 131; ++pub const ERFKILL: c_int = 132; ++pub const EHWPOISON: c_int = 133; ++ ++pub const SA_ONSTACK: c_int = 0x08000000; ++pub const SA_SIGINFO: c_int = 0x00000004; ++pub const SA_NOCLDWAIT: c_int = 0x00000002; ++ ++pub const SIGCHLD: c_int = 17; ++pub const SIGBUS: c_int = 7; ++pub const SIGTTIN: c_int = 21; ++pub const SIGTTOU: c_int = 22; ++pub const SIGXCPU: c_int = 24; ++pub const SIGXFSZ: c_int = 25; ++pub const SIGVTALRM: c_int = 26; ++pub const SIGPROF: c_int = 27; ++pub const SIGWINCH: c_int = 28; ++pub const SIGUSR1: c_int = 10; ++pub const SIGUSR2: c_int = 12; ++pub const SIGCONT: c_int = 18; ++pub const SIGSTOP: c_int = 19; ++pub const SIGTSTP: c_int = 20; ++pub const SIGURG: c_int = 23; ++pub const SIGIO: c_int = 29; ++pub const SIGSYS: c_int = 31; ++pub const SIGSTKFLT: c_int = 16; ++pub const SIGPOLL: c_int = 29; ++pub const SIGPWR: c_int = 30; ++pub const SIG_SETMASK: c_int = 2; ++pub const SIG_BLOCK: c_int = 0x000000; ++pub const SIG_UNBLOCK: c_int = 0x01; ++ ++pub const F_GETLK: c_int = 5; ++pub const F_GETOWN: c_int = 9; ++pub const F_SETLK: c_int = 6; ++pub const F_SETLKW: c_int = 7; ++pub const F_SETOWN: c_int = 8; ++ ++pub const VEOF: usize = 4; ++ ++pub const POLLWRNORM: c_short = 0x100; ++pub const POLLWRBAND: c_short = 0x200; ++ ++pub const SOCK_STREAM: c_int = 1; ++pub const SOCK_DGRAM: c_int = 2; ++ ++pub const MAP_ANON: c_int = 0x0020; ++pub const MAP_GROWSDOWN: c_int = 0x0100; ++pub const MAP_DENYWRITE: c_int = 0x0800; ++pub const MAP_EXECUTABLE: c_int = 0x01000; ++pub const MAP_LOCKED: c_int = 0x02000; ++pub const MAP_NORESERVE: c_int = 0x04000; ++pub const MAP_POPULATE: c_int = 0x08000; ++pub const MAP_NONBLOCK: c_int = 0x010000; ++pub const MAP_STACK: c_int = 0x020000; ++pub const MAP_HUGETLB: c_int = 0x040000; ++pub const MAP_SYNC: c_int = 0x080000; ++ ++pub const MCL_CURRENT: c_int = 0x0001; ++pub const MCL_FUTURE: c_int = 0x0002; ++pub const MCL_ONFAULT: c_int = 0x0004; ++pub const CBAUD: crate::tcflag_t = 0o0010017; ++pub const TAB1: c_int = 0x00000800; ++pub const TAB2: c_int = 0x00001000; ++pub const TAB3: c_int = 0x00001800; ++pub const CR1: c_int = 0x00000200; ++pub const CR2: c_int = 0x00000400; ++pub const CR3: c_int = 0x00000600; ++pub const FF1: c_int = 0x00008000; ++pub const BS1: c_int = 0x00002000; ++pub const VT1: c_int = 0x00004000; ++pub const VWERASE: usize = 14; ++pub const VREPRINT: usize = 12; ++pub const VSUSP: usize = 10; ++pub const VSTART: usize = 8; ++pub const VSTOP: usize = 9; ++pub const VDISCARD: usize = 13; ++pub const VTIME: usize = 5; ++pub const IXON: crate::tcflag_t = 0x00000400; ++pub const IXOFF: crate::tcflag_t = 0x00001000; ++pub const ONLCR: crate::tcflag_t = 0x4; ++pub const CSIZE: crate::tcflag_t = 0x00000030; ++pub const CS6: crate::tcflag_t = 0x00000010; ++pub const CS7: crate::tcflag_t = 0x00000020; ++pub const CS8: crate::tcflag_t = 0x00000030; ++pub const CSTOPB: crate::tcflag_t = 0x00000040; ++pub const CREAD: crate::tcflag_t = 0x00000080; ++pub const PARENB: crate::tcflag_t = 0x00000100; ++pub const PARODD: crate::tcflag_t = 0x00000200; ++pub const HUPCL: crate::tcflag_t = 0x00000400; ++pub const CLOCAL: crate::tcflag_t = 0x00000800; ++pub const ECHOKE: crate::tcflag_t = 0x00000800; ++pub const ECHOE: crate::tcflag_t = 0x00000010; ++pub const ECHOK: crate::tcflag_t = 0x00000020; ++pub const ECHONL: crate::tcflag_t = 0x00000040; ++pub const ECHOPRT: crate::tcflag_t = 0x00000400; ++pub const ECHOCTL: crate::tcflag_t = 0x00000200; ++pub const ISIG: crate::tcflag_t = 0x00000001; ++pub const ICANON: crate::tcflag_t = 0x00000002; ++pub const PENDIN: crate::tcflag_t = 0x00004000; ++pub const NOFLSH: crate::tcflag_t = 0x00000080; ++pub const CIBAUD: crate::tcflag_t = 0o02003600000; ++pub const CBAUDEX: crate::tcflag_t = 0o010000; ++pub const VSWTC: usize = 7; ++pub const OLCUC: crate::tcflag_t = 0o000002; ++pub const NLDLY: crate::tcflag_t = 0o000400; ++pub const CRDLY: crate::tcflag_t = 0o003000; ++pub const TABDLY: crate::tcflag_t = 0o014000; ++pub const BSDLY: crate::tcflag_t = 0o020000; ++pub const FFDLY: crate::tcflag_t = 0o100000; ++pub const VTDLY: crate::tcflag_t = 0o040000; ++pub const XTABS: crate::tcflag_t = 0o014000; ++pub const B57600: crate::speed_t = 0o010001; ++pub const B115200: crate::speed_t = 0o010002; ++pub const B230400: crate::speed_t = 0o010003; ++pub const B460800: crate::speed_t = 0o010004; ++pub const B500000: crate::speed_t = 0o010005; ++pub const B576000: crate::speed_t = 0o010006; ++pub const B921600: crate::speed_t = 0o010007; ++pub const B1000000: crate::speed_t = 0o010010; ++pub const B1152000: crate::speed_t = 0o010011; ++pub const B1500000: crate::speed_t = 0o010012; ++pub const B2000000: crate::speed_t = 0o010013; ++pub const B2500000: crate::speed_t = 0o010014; ++pub const B3000000: crate::speed_t = 0o010015; ++pub const B3500000: crate::speed_t = 0o010016; ++pub const B4000000: crate::speed_t = 0o010017; ++ ++pub const EDEADLK: c_int = 35; ++pub const EDEADLOCK: c_int = EDEADLK; ++ ++pub const EXTPROC: crate::tcflag_t = 0x00010000; ++pub const VEOL: usize = 11; ++pub const VEOL2: usize = 16; ++pub const VMIN: usize = 6; ++pub const IEXTEN: crate::tcflag_t = 0x00008000; ++pub const TOSTOP: crate::tcflag_t = 0x00000100; ++pub const FLUSHO: crate::tcflag_t = 0x00001000; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/lfs64.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/lfs64.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/lfs64.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/lfs64.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,239 @@ ++use crate::off64_t; ++use crate::prelude::*; ++ ++#[inline] ++pub unsafe extern "C" fn creat64(path: *const c_char, mode: crate::mode_t) -> c_int { ++ crate::creat(path, mode) ++} ++ ++#[inline] ++pub unsafe extern "C" fn fallocate64( ++ fd: c_int, ++ mode: c_int, ++ offset: off64_t, ++ len: off64_t, ++) -> c_int { ++ crate::fallocate(fd, mode, offset, len) ++} ++ ++#[inline] ++pub unsafe extern "C" fn fgetpos64(stream: *mut crate::FILE, pos: *mut crate::fpos64_t) -> c_int { ++ crate::fgetpos(stream, pos as *mut _) ++} ++ ++#[inline] ++pub unsafe extern "C" fn fopen64(pathname: *const c_char, mode: *const c_char) -> *mut crate::FILE { ++ crate::fopen(pathname, mode) ++} ++ ++#[inline] ++pub unsafe extern "C" fn freopen64( ++ pathname: *const c_char, ++ mode: *const c_char, ++ stream: *mut crate::FILE, ++) -> *mut crate::FILE { ++ crate::freopen(pathname, mode, stream) ++} ++ ++#[inline] ++pub unsafe extern "C" fn fseeko64( ++ stream: *mut crate::FILE, ++ offset: off64_t, ++ whence: c_int, ++) -> c_int { ++ crate::fseeko(stream, offset, whence) ++} ++ ++#[inline] ++pub unsafe extern "C" fn fsetpos64(stream: *mut crate::FILE, pos: *const crate::fpos64_t) -> c_int { ++ crate::fsetpos(stream, pos as *mut _) ++} ++ ++#[inline] ++pub unsafe extern "C" fn fstat64(fildes: c_int, buf: *mut crate::stat64) -> c_int { ++ crate::fstat(fildes, buf as *mut _) ++} ++ ++#[inline] ++pub unsafe extern "C" fn fstatat64( ++ fd: c_int, ++ path: *const c_char, ++ buf: *mut crate::stat64, ++ flag: c_int, ++) -> c_int { ++ crate::fstatat(fd, path, buf as *mut _, flag) ++} ++ ++#[inline] ++pub unsafe extern "C" fn fstatfs64(fd: c_int, buf: *mut crate::statfs64) -> c_int { ++ crate::fstatfs(fd, buf as *mut _) ++} ++ ++#[inline] ++pub unsafe extern "C" fn fstatvfs64(fd: c_int, buf: *mut crate::statvfs64) -> c_int { ++ crate::fstatvfs(fd, buf as *mut _) ++} ++ ++#[inline] ++pub unsafe extern "C" fn ftello64(stream: *mut crate::FILE) -> off64_t { ++ crate::ftello(stream) ++} ++ ++#[inline] ++pub unsafe extern "C" fn ftruncate64(fd: c_int, length: off64_t) -> c_int { ++ crate::ftruncate(fd, length) ++} ++ ++#[inline] ++pub unsafe extern "C" fn getrlimit64(resource: c_int, rlim: *mut crate::rlimit64) -> c_int { ++ crate::getrlimit(resource, rlim as *mut _) ++} ++ ++#[inline] ++pub unsafe extern "C" fn lseek64(fd: c_int, offset: off64_t, whence: c_int) -> off64_t { ++ crate::lseek(fd, offset, whence) ++} ++ ++#[inline] ++pub unsafe extern "C" fn lstat64(path: *const c_char, buf: *mut crate::stat64) -> c_int { ++ crate::lstat(path, buf as *mut _) ++} ++ ++#[inline] ++pub unsafe extern "C" fn mmap64( ++ addr: *mut c_void, ++ length: size_t, ++ prot: c_int, ++ flags: c_int, ++ fd: c_int, ++ offset: off64_t, ++) -> *mut c_void { ++ crate::mmap(addr, length, prot, flags, fd, offset) ++} ++ ++// These functions are variadic in the C ABI since the `mode` argument is "optional". Variadic ++// `extern "C"` functions are unstable in Rust so we cannot write a shim function for these ++// entrypoints. See https://github.com/rust-lang/rust/issues/44930. ++// ++// These aliases are mostly fine though, neither function takes a LFS64-namespaced type as an ++// argument, nor do their names clash with any declared types. ++pub use crate::{open as open64, openat as openat64}; ++ ++#[inline] ++pub unsafe extern "C" fn posix_fadvise64( ++ fd: c_int, ++ offset: off64_t, ++ len: off64_t, ++ advice: c_int, ++) -> c_int { ++ crate::posix_fadvise(fd, offset, len, advice) ++} ++ ++#[inline] ++pub unsafe extern "C" fn posix_fallocate64(fd: c_int, offset: off64_t, len: off64_t) -> c_int { ++ crate::posix_fallocate(fd, offset, len) ++} ++ ++#[inline] ++pub unsafe extern "C" fn pread64( ++ fd: c_int, ++ buf: *mut c_void, ++ count: size_t, ++ offset: off64_t, ++) -> ssize_t { ++ crate::pread(fd, buf, count, offset) ++} ++ ++#[inline] ++pub unsafe extern "C" fn preadv64( ++ fd: c_int, ++ iov: *const crate::iovec, ++ iovcnt: c_int, ++ offset: off64_t, ++) -> ssize_t { ++ crate::preadv(fd, iov, iovcnt, offset) ++} ++ ++#[inline] ++pub unsafe extern "C" fn prlimit64( ++ pid: crate::pid_t, ++ resource: c_int, ++ new_limit: *const crate::rlimit64, ++ old_limit: *mut crate::rlimit64, ++) -> c_int { ++ crate::prlimit(pid, resource, new_limit as *mut _, old_limit as *mut _) ++} ++ ++#[inline] ++pub unsafe extern "C" fn pwrite64( ++ fd: c_int, ++ buf: *const c_void, ++ count: size_t, ++ offset: off64_t, ++) -> ssize_t { ++ crate::pwrite(fd, buf, count, offset) ++} ++ ++#[inline] ++pub unsafe extern "C" fn pwritev64( ++ fd: c_int, ++ iov: *const crate::iovec, ++ iovcnt: c_int, ++ offset: off64_t, ++) -> ssize_t { ++ crate::pwritev(fd, iov, iovcnt, offset) ++} ++ ++#[inline] ++pub unsafe extern "C" fn readdir64(dirp: *mut crate::DIR) -> *mut crate::dirent64 { ++ crate::readdir(dirp) as *mut _ ++} ++ ++#[inline] ++pub unsafe extern "C" fn readdir64_r( ++ dirp: *mut crate::DIR, ++ entry: *mut crate::dirent64, ++ result: *mut *mut crate::dirent64, ++) -> c_int { ++ crate::readdir_r(dirp, entry as *mut _, result as *mut _) ++} ++ ++#[inline] ++pub unsafe extern "C" fn sendfile64( ++ out_fd: c_int, ++ in_fd: c_int, ++ offset: *mut off64_t, ++ count: size_t, ++) -> ssize_t { ++ crate::sendfile(out_fd, in_fd, offset, count) ++} ++ ++#[inline] ++pub unsafe extern "C" fn setrlimit64(resource: c_int, rlim: *const crate::rlimit64) -> c_int { ++ crate::setrlimit(resource, rlim as *mut _) ++} ++ ++#[inline] ++pub unsafe extern "C" fn stat64(pathname: *const c_char, statbuf: *mut crate::stat64) -> c_int { ++ crate::stat(pathname, statbuf as *mut _) ++} ++ ++#[inline] ++pub unsafe extern "C" fn statfs64(pathname: *const c_char, buf: *mut crate::statfs64) -> c_int { ++ crate::statfs(pathname, buf as *mut _) ++} ++ ++#[inline] ++pub unsafe extern "C" fn statvfs64(path: *const c_char, buf: *mut crate::statvfs64) -> c_int { ++ crate::statvfs(path, buf as *mut _) ++} ++ ++#[inline] ++pub unsafe extern "C" fn tmpfile64() -> *mut crate::FILE { ++ crate::tmpfile() ++} ++ ++#[inline] ++pub unsafe extern "C" fn truncate64(path: *const c_char, length: off64_t) -> c_int { ++ crate::truncate(path, length) ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/musl/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,1130 @@ ++use crate::off64_t; ++use crate::prelude::*; ++ ++pub type pthread_t = *mut c_void; ++pub type clock_t = c_long; ++#[cfg_attr( ++ not(feature = "rustc-dep-of-std"), ++ deprecated( ++ since = "0.2.80", ++ note = "This type is changed to 64-bit in musl 1.2.0, \ ++ we'll follow that change in the future release. \ ++ See #1848 for more info." ++ ) ++)] ++pub type time_t = c_long; ++pub type suseconds_t = c_long; ++pub type ino_t = u64; ++pub type off_t = i64; ++pub type blkcnt_t = i64; ++ ++pub type shmatt_t = c_ulong; ++pub type msgqnum_t = c_ulong; ++pub type msglen_t = c_ulong; ++pub type fsblkcnt_t = c_ulonglong; ++pub type fsblkcnt64_t = c_ulonglong; ++pub type fsfilcnt_t = c_ulonglong; ++pub type fsfilcnt64_t = c_ulonglong; ++pub type rlim_t = c_ulonglong; ++ ++cfg_if! { ++ if #[cfg(doc)] { ++ // Used in `linux::arch` to define ioctl constants. ++ pub(crate) type Ioctl = c_int; ++ } else { ++ #[doc(hidden)] ++ pub type Ioctl = c_int; ++ } ++} ++ ++impl siginfo_t { ++ pub unsafe fn si_addr(&self) -> *mut c_void { ++ #[repr(C)] ++ struct siginfo_sigfault { ++ _si_signo: c_int, ++ _si_errno: c_int, ++ _si_code: c_int, ++ si_addr: *mut c_void, ++ } ++ (*(self as *const siginfo_t as *const siginfo_sigfault)).si_addr ++ } ++ ++ pub unsafe fn si_value(&self) -> crate::sigval { ++ #[repr(C)] ++ struct siginfo_si_value { ++ _si_signo: c_int, ++ _si_errno: c_int, ++ _si_code: c_int, ++ _si_timerid: c_int, ++ _si_overrun: c_int, ++ si_value: crate::sigval, ++ } ++ (*(self as *const siginfo_t as *const siginfo_si_value)).si_value ++ } ++} ++ ++// Internal, for casts to access union fields ++#[repr(C)] ++struct sifields_sigchld { ++ si_pid: crate::pid_t, ++ si_uid: crate::uid_t, ++ si_status: c_int, ++ si_utime: c_long, ++ si_stime: c_long, ++} ++impl Copy for sifields_sigchld {} ++impl Clone for sifields_sigchld { ++ fn clone(&self) -> sifields_sigchld { ++ *self ++ } ++} ++ ++// Internal, for casts to access union fields ++#[repr(C)] ++union sifields { ++ _align_pointer: *mut c_void, ++ sigchld: sifields_sigchld, ++} ++ ++// Internal, for casts to access union fields. Note that some variants ++// of sifields start with a pointer, which makes the alignment of ++// sifields vary on 32-bit and 64-bit architectures. ++#[repr(C)] ++struct siginfo_f { ++ _siginfo_base: [c_int; 3], ++ sifields: sifields, ++} ++ ++impl siginfo_t { ++ unsafe fn sifields(&self) -> &sifields { ++ &(*(self as *const siginfo_t as *const siginfo_f)).sifields ++ } ++ ++ pub unsafe fn si_pid(&self) -> crate::pid_t { ++ self.sifields().sigchld.si_pid ++ } ++ ++ pub unsafe fn si_uid(&self) -> crate::uid_t { ++ self.sifields().sigchld.si_uid ++ } ++ ++ pub unsafe fn si_status(&self) -> c_int { ++ self.sifields().sigchld.si_status ++ } ++ ++ pub unsafe fn si_utime(&self) -> c_long { ++ self.sifields().sigchld.si_utime ++ } ++ ++ pub unsafe fn si_stime(&self) -> c_long { ++ self.sifields().sigchld.si_stime ++ } ++} ++ ++s! { ++ pub struct aiocb { ++ pub aio_fildes: c_int, ++ pub aio_lio_opcode: c_int, ++ pub aio_reqprio: c_int, ++ pub aio_buf: *mut c_void, ++ pub aio_nbytes: size_t, ++ pub aio_sigevent: crate::sigevent, ++ __td: *mut c_void, ++ __lock: [c_int; 2], ++ __err: c_int, ++ __ret: ssize_t, ++ pub aio_offset: off_t, ++ __next: *mut c_void, ++ __prev: *mut c_void, ++ #[cfg(target_pointer_width = "32")] ++ __dummy4: [c_char; 24], ++ #[cfg(target_pointer_width = "64")] ++ __dummy4: [c_char; 16], ++ } ++ ++ pub struct sigaction { ++ pub sa_sigaction: crate::sighandler_t, ++ pub sa_mask: crate::sigset_t, ++ pub sa_flags: c_int, ++ pub sa_restorer: Option, ++ } ++ ++ // `mips*` targets swap the `s_errno` and `s_code` fields otherwise this struct is ++ // target-agnostic (see https://www.openwall.com/lists/musl/2016/01/27/1/2) ++ // ++ // FIXME(union): C implementation uses unions ++ pub struct siginfo_t { ++ pub si_signo: c_int, ++ #[cfg(not(target_arch = "mips"))] ++ pub si_errno: c_int, ++ pub si_code: c_int, ++ #[cfg(target_arch = "mips")] ++ pub si_errno: c_int, ++ #[doc(hidden)] ++ #[deprecated( ++ since = "0.2.54", ++ note = "Please leave a comment on https://github.com/rust-lang/libc/pull/1316 \ ++ if you're using this field" ++ )] ++ pub _pad: [c_int; 29], ++ _align: [usize; 0], ++ } ++ ++ pub struct statvfs { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_favail: crate::fsfilcnt_t, ++ #[cfg(target_endian = "little")] ++ pub f_fsid: c_ulong, ++ #[cfg(target_pointer_width = "32")] ++ __pad: c_int, ++ #[cfg(target_endian = "big")] ++ pub f_fsid: c_ulong, ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ __f_reserved: [c_int; 6], ++ } ++ ++ pub struct statvfs64 { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: crate::fsblkcnt64_t, ++ pub f_bfree: crate::fsblkcnt64_t, ++ pub f_bavail: crate::fsblkcnt64_t, ++ pub f_files: crate::fsfilcnt64_t, ++ pub f_ffree: crate::fsfilcnt64_t, ++ pub f_favail: crate::fsfilcnt64_t, ++ #[cfg(target_endian = "little")] ++ pub f_fsid: c_ulong, ++ #[cfg(target_pointer_width = "32")] ++ __pad: c_int, ++ #[cfg(target_endian = "big")] ++ pub f_fsid: c_ulong, ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ __f_reserved: [c_int; 6], ++ } ++ ++ pub struct termios { ++ pub c_iflag: crate::tcflag_t, ++ pub c_oflag: crate::tcflag_t, ++ pub c_cflag: crate::tcflag_t, ++ pub c_lflag: crate::tcflag_t, ++ pub c_line: crate::cc_t, ++ pub c_cc: [crate::cc_t; crate::NCCS], ++ pub __c_ispeed: crate::speed_t, ++ pub __c_ospeed: crate::speed_t, ++ } ++ ++ pub struct flock { ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ pub l_start: off_t, ++ pub l_len: off_t, ++ pub l_pid: crate::pid_t, ++ } ++ ++ pub struct flock64 { ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ pub l_start: off64_t, ++ pub l_len: off64_t, ++ pub l_pid: crate::pid_t, ++ } ++ ++ pub struct regex_t { ++ __re_nsub: size_t, ++ __opaque: *mut c_void, ++ __padding: [*mut c_void; 4usize], ++ __nsub2: size_t, ++ __padding2: c_char, ++ } ++ ++ pub struct rtentry { ++ pub rt_pad1: c_ulong, ++ pub rt_dst: crate::sockaddr, ++ pub rt_gateway: crate::sockaddr, ++ pub rt_genmask: crate::sockaddr, ++ pub rt_flags: c_ushort, ++ pub rt_pad2: c_short, ++ pub rt_pad3: c_ulong, ++ pub rt_tos: c_uchar, ++ pub rt_class: c_uchar, ++ #[cfg(target_pointer_width = "64")] ++ pub rt_pad4: [c_short; 3usize], ++ #[cfg(not(target_pointer_width = "64"))] ++ pub rt_pad4: [c_short; 1usize], ++ pub rt_metric: c_short, ++ pub rt_dev: *mut c_char, ++ pub rt_mtu: c_ulong, ++ pub rt_window: c_ulong, ++ pub rt_irtt: c_ushort, ++ } ++ ++ pub struct __exit_status { ++ pub e_termination: c_short, ++ pub e_exit: c_short, ++ } ++ ++ pub struct Elf64_Chdr { ++ pub ch_type: crate::Elf64_Word, ++ pub ch_reserved: crate::Elf64_Word, ++ pub ch_size: crate::Elf64_Xword, ++ pub ch_addralign: crate::Elf64_Xword, ++ } ++ ++ pub struct Elf32_Chdr { ++ pub ch_type: crate::Elf32_Word, ++ pub ch_size: crate::Elf32_Word, ++ pub ch_addralign: crate::Elf32_Word, ++ } ++ ++ pub struct timex { ++ pub modes: c_uint, ++ pub offset: c_long, ++ pub freq: c_long, ++ pub maxerror: c_long, ++ pub esterror: c_long, ++ pub status: c_int, ++ pub constant: c_long, ++ pub precision: c_long, ++ pub tolerance: c_long, ++ pub time: crate::timeval, ++ pub tick: c_long, ++ pub ppsfreq: c_long, ++ pub jitter: c_long, ++ pub shift: c_int, ++ pub stabil: c_long, ++ pub jitcnt: c_long, ++ pub calcnt: c_long, ++ pub errcnt: c_long, ++ pub stbcnt: c_long, ++ pub tai: c_int, ++ pub __padding: [c_int; 11], ++ } ++ ++ pub struct ntptimeval { ++ pub time: crate::timeval, ++ pub maxerror: c_long, ++ pub esterror: c_long, ++ } ++ ++ // linux/if_xdp.h ++ ++ pub struct sockaddr_xdp { ++ pub sxdp_family: crate::__u16, ++ pub sxdp_flags: crate::__u16, ++ pub sxdp_ifindex: crate::__u32, ++ pub sxdp_queue_id: crate::__u32, ++ pub sxdp_shared_umem_fd: crate::__u32, ++ } ++ ++ pub struct xdp_ring_offset { ++ pub producer: crate::__u64, ++ pub consumer: crate::__u64, ++ pub desc: crate::__u64, ++ pub flags: crate::__u64, ++ } ++ ++ pub struct xdp_mmap_offsets { ++ pub rx: xdp_ring_offset, ++ pub tx: xdp_ring_offset, ++ pub fr: xdp_ring_offset, ++ pub cr: xdp_ring_offset, ++ } ++ ++ pub struct xdp_ring_offset_v1 { ++ pub producer: crate::__u64, ++ pub consumer: crate::__u64, ++ pub desc: crate::__u64, ++ } ++ ++ pub struct xdp_mmap_offsets_v1 { ++ pub rx: xdp_ring_offset_v1, ++ pub tx: xdp_ring_offset_v1, ++ pub fr: xdp_ring_offset_v1, ++ pub cr: xdp_ring_offset_v1, ++ } ++ ++ pub struct xdp_umem_reg { ++ pub addr: crate::__u64, ++ pub len: crate::__u64, ++ pub chunk_size: crate::__u32, ++ pub headroom: crate::__u32, ++ pub flags: crate::__u32, ++ pub tx_metadata_len: crate::__u32, ++ } ++ ++ pub struct xdp_umem_reg_v1 { ++ pub addr: crate::__u64, ++ pub len: crate::__u64, ++ pub chunk_size: crate::__u32, ++ pub headroom: crate::__u32, ++ } ++ ++ pub struct xdp_statistics { ++ pub rx_dropped: crate::__u64, ++ pub rx_invalid_descs: crate::__u64, ++ pub tx_invalid_descs: crate::__u64, ++ pub rx_ring_full: crate::__u64, ++ pub rx_fill_ring_empty_descs: crate::__u64, ++ pub tx_ring_empty_descs: crate::__u64, ++ } ++ ++ pub struct xdp_statistics_v1 { ++ pub rx_dropped: crate::__u64, ++ pub rx_invalid_descs: crate::__u64, ++ pub tx_invalid_descs: crate::__u64, ++ } ++ ++ pub struct xdp_options { ++ pub flags: crate::__u32, ++ } ++ ++ pub struct xdp_desc { ++ pub addr: crate::__u64, ++ pub len: crate::__u32, ++ pub options: crate::__u32, ++ } ++ ++ // netinet/tcp.h ++ ++ pub struct tcp_info { ++ pub tcpi_state: u8, ++ pub tcpi_ca_state: u8, ++ pub tcpi_retransmits: u8, ++ pub tcpi_probes: u8, ++ pub tcpi_backoff: u8, ++ pub tcpi_options: u8, ++ /* ++ * FIXME(musl): enable on all targets once musl headers are more up to date ++ */ ++ /// This contains the bitfields `tcpi_snd_wscale` and `tcpi_rcv_wscale`. ++ /// Each is 4 bits. ++ #[cfg(target_arch = "loongarch64")] ++ pub tcpi_snd_rcv_wscale: u8, ++ /// This contains the bitfields `tcpi_delivery_rate_app_limited` (1 bit) and ++ /// `tcpi_fastopen_client_fail` (2 bits). ++ #[cfg(target_arch = "loongarch64")] ++ pub tcpi_delivery_fastopen_bitfields: u8, ++ pub tcpi_rto: u32, ++ pub tcpi_ato: u32, ++ pub tcpi_snd_mss: u32, ++ pub tcpi_rcv_mss: u32, ++ pub tcpi_unacked: u32, ++ pub tcpi_sacked: u32, ++ pub tcpi_lost: u32, ++ pub tcpi_retrans: u32, ++ pub tcpi_fackets: u32, ++ pub tcpi_last_data_sent: u32, ++ pub tcpi_last_ack_sent: u32, ++ pub tcpi_last_data_recv: u32, ++ pub tcpi_last_ack_recv: u32, ++ pub tcpi_pmtu: u32, ++ pub tcpi_rcv_ssthresh: u32, ++ pub tcpi_rtt: u32, ++ pub tcpi_rttvar: u32, ++ pub tcpi_snd_ssthresh: u32, ++ pub tcpi_snd_cwnd: u32, ++ pub tcpi_advmss: u32, ++ pub tcpi_reordering: u32, ++ pub tcpi_rcv_rtt: u32, ++ pub tcpi_rcv_space: u32, ++ pub tcpi_total_retrans: u32, ++ pub tcpi_pacing_rate: u64, ++ pub tcpi_max_pacing_rate: u64, ++ pub tcpi_bytes_acked: u64, ++ pub tcpi_bytes_received: u64, ++ pub tcpi_segs_out: u32, ++ pub tcpi_segs_in: u32, ++ pub tcpi_notsent_bytes: u32, ++ pub tcpi_min_rtt: u32, ++ pub tcpi_data_segs_in: u32, ++ pub tcpi_data_segs_out: u32, ++ pub tcpi_delivery_rate: u64, ++ pub tcpi_busy_time: u64, ++ pub tcpi_rwnd_limited: u64, ++ pub tcpi_sndbuf_limited: u64, ++ pub tcpi_delivered: u32, ++ pub tcpi_delivered_ce: u32, ++ pub tcpi_bytes_sent: u64, ++ pub tcpi_bytes_retrans: u64, ++ pub tcpi_dsack_dups: u32, ++ pub tcpi_reord_seen: u32, ++ // FIXME(musl): enable on all targets once CI musl is updated ++ #[cfg(target_arch = "loongarch64")] ++ pub tcpi_rcv_ooopack: u32, ++ #[cfg(target_arch = "loongarch64")] ++ pub tcpi_snd_wnd: u32, ++ } ++ ++ // MIPS implementation is special (see mips arch folders) ++ #[cfg(not(target_arch = "mips"))] ++ pub struct statfs { ++ pub f_type: c_ulong, ++ pub f_bsize: c_ulong, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_fsid: crate::fsid_t, ++ pub f_namelen: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_flags: c_ulong, ++ pub f_spare: [c_ulong; 4], ++ } ++ ++ // MIPS implementation is special (see mips arch folders) ++ #[cfg(not(target_arch = "mips"))] ++ pub struct statfs64 { ++ pub f_type: c_ulong, ++ pub f_bsize: c_ulong, ++ pub f_blocks: crate::fsblkcnt64_t, ++ pub f_bfree: crate::fsblkcnt64_t, ++ pub f_bavail: crate::fsblkcnt64_t, ++ pub f_files: crate::fsfilcnt64_t, ++ pub f_ffree: crate::fsfilcnt64_t, ++ pub f_fsid: crate::fsid_t, ++ pub f_namelen: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_flags: c_ulong, ++ pub f_spare: [c_ulong; 4], ++ } ++} ++ ++s_no_extra_traits! { ++ pub struct sysinfo { ++ pub uptime: c_ulong, ++ pub loads: [c_ulong; 3], ++ pub totalram: c_ulong, ++ pub freeram: c_ulong, ++ pub sharedram: c_ulong, ++ pub bufferram: c_ulong, ++ pub totalswap: c_ulong, ++ pub freeswap: c_ulong, ++ pub procs: c_ushort, ++ pub pad: c_ushort, ++ pub totalhigh: c_ulong, ++ pub freehigh: c_ulong, ++ pub mem_unit: c_uint, ++ pub __reserved: [c_char; 256], ++ } ++ ++ // FIXME: musl added paddings and adjusted ++ // layout in 1.2.0 but our CI is still 1.1.24. ++ // So, I'm leaving some fields as cfg for now. ++ // ref. https://github.com/bminor/musl/commit/ ++ // 1e7f0fcd7ff2096904fd93a2ee6d12a2392be392 ++ // ++ // OpenHarmony uses the musl 1.2 layout. ++ pub struct utmpx { ++ pub ut_type: c_short, ++ __ut_pad1: c_short, ++ pub ut_pid: crate::pid_t, ++ pub ut_line: [c_char; 32], ++ pub ut_id: [c_char; 4], ++ pub ut_user: [c_char; 32], ++ pub ut_host: [c_char; 256], ++ pub ut_exit: __exit_status, ++ ++ #[cfg(target_env = "musl")] ++ #[cfg(not(target_arch = "loongarch64"))] ++ pub ut_session: c_long, ++ ++ #[cfg(target_env = "musl")] ++ #[cfg(target_arch = "loongarch64")] ++ pub ut_session: c_int, ++ ++ #[cfg(target_env = "musl")] ++ #[cfg(target_arch = "loongarch64")] ++ __ut_pad2: c_int, ++ ++ #[cfg(target_env = "ohos")] ++ #[cfg(target_endian = "little")] ++ pub ut_session: c_int, ++ #[cfg(target_env = "ohos")] ++ #[cfg(target_endian = "little")] ++ __ut_pad2: c_int, ++ ++ #[cfg(target_env = "ohos")] ++ #[cfg(not(target_endian = "little"))] ++ __ut_pad2: c_int, ++ #[cfg(target_env = "ohos")] ++ #[cfg(not(target_endian = "little"))] ++ pub ut_session: c_int, ++ ++ pub ut_tv: crate::timeval, ++ pub ut_addr_v6: [c_uint; 4], ++ __unused: [c_char; 20], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for sysinfo { ++ fn eq(&self, other: &sysinfo) -> bool { ++ self.uptime == other.uptime ++ && self.loads == other.loads ++ && self.totalram == other.totalram ++ && self.freeram == other.freeram ++ && self.sharedram == other.sharedram ++ && self.bufferram == other.bufferram ++ && self.totalswap == other.totalswap ++ && self.freeswap == other.freeswap ++ && self.procs == other.procs ++ && self.pad == other.pad ++ && self.totalhigh == other.totalhigh ++ && self.freehigh == other.freehigh ++ && self.mem_unit == other.mem_unit ++ && self ++ .__reserved ++ .iter() ++ .zip(other.__reserved.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ ++ impl Eq for sysinfo {} ++ ++ impl fmt::Debug for sysinfo { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sysinfo") ++ .field("uptime", &self.uptime) ++ .field("loads", &self.loads) ++ .field("totalram", &self.totalram) ++ .field("freeram", &self.freeram) ++ .field("sharedram", &self.sharedram) ++ .field("bufferram", &self.bufferram) ++ .field("totalswap", &self.totalswap) ++ .field("freeswap", &self.freeswap) ++ .field("procs", &self.procs) ++ .field("pad", &self.pad) ++ .field("totalhigh", &self.totalhigh) ++ .field("freehigh", &self.freehigh) ++ .field("mem_unit", &self.mem_unit) ++ // FIXME: .field("__reserved", &self.__reserved) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for sysinfo { ++ fn hash(&self, state: &mut H) { ++ self.uptime.hash(state); ++ self.loads.hash(state); ++ self.totalram.hash(state); ++ self.freeram.hash(state); ++ self.sharedram.hash(state); ++ self.bufferram.hash(state); ++ self.totalswap.hash(state); ++ self.freeswap.hash(state); ++ self.procs.hash(state); ++ self.pad.hash(state); ++ self.totalhigh.hash(state); ++ self.freehigh.hash(state); ++ self.mem_unit.hash(state); ++ self.__reserved.hash(state); ++ } ++ } ++ ++ impl PartialEq for utmpx { ++ fn eq(&self, other: &utmpx) -> bool { ++ self.ut_type == other.ut_type ++ //&& self.__ut_pad1 == other.__ut_pad1 ++ && self.ut_pid == other.ut_pid ++ && self.ut_line == other.ut_line ++ && self.ut_id == other.ut_id ++ && self.ut_user == other.ut_user ++ && self ++ .ut_host ++ .iter() ++ .zip(other.ut_host.iter()) ++ .all(|(a,b)| a == b) ++ && self.ut_exit == other.ut_exit ++ && self.ut_session == other.ut_session ++ //&& self.__ut_pad2 == other.__ut_pad2 ++ && self.ut_tv == other.ut_tv ++ && self.ut_addr_v6 == other.ut_addr_v6 ++ && self.__unused == other.__unused ++ } ++ } ++ ++ impl Eq for utmpx {} ++ ++ impl fmt::Debug for utmpx { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("utmpx") ++ .field("ut_type", &self.ut_type) ++ //.field("__ut_pad1", &self.__ut_pad1) ++ .field("ut_pid", &self.ut_pid) ++ .field("ut_line", &self.ut_line) ++ .field("ut_id", &self.ut_id) ++ .field("ut_user", &self.ut_user) ++ //FIXME: .field("ut_host", &self.ut_host) ++ .field("ut_exit", &self.ut_exit) ++ .field("ut_session", &self.ut_session) ++ //.field("__ut_pad2", &self.__ut_pad2) ++ .field("ut_tv", &self.ut_tv) ++ .field("ut_addr_v6", &self.ut_addr_v6) ++ .field("__unused", &self.__unused) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for utmpx { ++ fn hash(&self, state: &mut H) { ++ self.ut_type.hash(state); ++ //self.__ut_pad1.hash(state); ++ self.ut_pid.hash(state); ++ self.ut_line.hash(state); ++ self.ut_id.hash(state); ++ self.ut_user.hash(state); ++ self.ut_host.hash(state); ++ self.ut_exit.hash(state); ++ self.ut_session.hash(state); ++ //self.__ut_pad2.hash(state); ++ self.ut_tv.hash(state); ++ self.ut_addr_v6.hash(state); ++ self.__unused.hash(state); ++ } ++ } ++ } ++} ++ ++// include/sys/mman.h ++/* ++ * Huge page size encoding when MAP_HUGETLB is specified, and a huge page ++ * size other than the default is desired. See hugetlb_encode.h. ++ * All known huge page size encodings are provided here. It is the ++ * responsibility of the application to know which sizes are supported on ++ * the running system. See mmap(2) man page for details. ++ */ ++pub const MAP_HUGE_SHIFT: c_int = 26; ++pub const MAP_HUGE_MASK: c_int = 0x3f; ++ ++pub const MAP_HUGE_64KB: c_int = 16 << MAP_HUGE_SHIFT; ++pub const MAP_HUGE_512KB: c_int = 19 << MAP_HUGE_SHIFT; ++pub const MAP_HUGE_1MB: c_int = 20 << MAP_HUGE_SHIFT; ++pub const MAP_HUGE_2MB: c_int = 21 << MAP_HUGE_SHIFT; ++pub const MAP_HUGE_8MB: c_int = 23 << MAP_HUGE_SHIFT; ++pub const MAP_HUGE_16MB: c_int = 24 << MAP_HUGE_SHIFT; ++pub const MAP_HUGE_32MB: c_int = 25 << MAP_HUGE_SHIFT; ++pub const MAP_HUGE_256MB: c_int = 28 << MAP_HUGE_SHIFT; ++pub const MAP_HUGE_512MB: c_int = 29 << MAP_HUGE_SHIFT; ++pub const MAP_HUGE_1GB: c_int = 30 << MAP_HUGE_SHIFT; ++pub const MAP_HUGE_2GB: c_int = 31 << MAP_HUGE_SHIFT; ++pub const MAP_HUGE_16GB: c_int = 34 << MAP_HUGE_SHIFT; ++ ++pub const MS_RMT_MASK: c_ulong = 0x02800051; ++ ++// include/utmpx.h ++pub const EMPTY: c_short = 0; ++pub const RUN_LVL: c_short = 1; ++pub const BOOT_TIME: c_short = 2; ++pub const NEW_TIME: c_short = 3; ++pub const OLD_TIME: c_short = 4; ++pub const INIT_PROCESS: c_short = 5; ++pub const LOGIN_PROCESS: c_short = 6; ++pub const USER_PROCESS: c_short = 7; ++pub const DEAD_PROCESS: c_short = 8; ++// musl does not define ACCOUNTING ++ ++pub const SFD_CLOEXEC: c_int = 0x080000; ++ ++pub const NCCS: usize = 32; ++ ++pub const O_TRUNC: c_int = 512; ++pub const O_NOATIME: c_int = 0o1000000; ++pub const O_CLOEXEC: c_int = 0x80000; ++pub const O_TMPFILE: c_int = 0o20000000 | O_DIRECTORY; ++ ++pub const EBFONT: c_int = 59; ++pub const ENOSTR: c_int = 60; ++pub const ENODATA: c_int = 61; ++pub const ETIME: c_int = 62; ++pub const ENOSR: c_int = 63; ++pub const ENONET: c_int = 64; ++pub const ENOPKG: c_int = 65; ++pub const EREMOTE: c_int = 66; ++pub const ENOLINK: c_int = 67; ++pub const EADV: c_int = 68; ++pub const ESRMNT: c_int = 69; ++pub const ECOMM: c_int = 70; ++pub const EPROTO: c_int = 71; ++pub const EDOTDOT: c_int = 73; ++ ++pub const F_OFD_GETLK: c_int = 36; ++pub const F_OFD_SETLK: c_int = 37; ++pub const F_OFD_SETLKW: c_int = 38; ++ ++pub const F_RDLCK: c_int = 0; ++pub const F_WRLCK: c_int = 1; ++pub const F_UNLCK: c_int = 2; ++ ++pub const SA_NODEFER: c_int = 0x40000000; ++pub const SA_RESETHAND: c_int = 0x80000000; ++pub const SA_RESTART: c_int = 0x10000000; ++pub const SA_NOCLDSTOP: c_int = 0x00000001; ++ ++pub const EPOLL_CLOEXEC: c_int = 0x80000; ++ ++pub const EFD_CLOEXEC: c_int = 0x80000; ++ ++pub const BUFSIZ: c_uint = 1024; ++pub const TMP_MAX: c_uint = 10000; ++pub const FOPEN_MAX: c_uint = 1000; ++pub const FILENAME_MAX: c_uint = 4096; ++pub const O_PATH: c_int = 0o10000000; ++pub const O_EXEC: c_int = 0o10000000; ++pub const O_SEARCH: c_int = 0o10000000; ++pub const O_ACCMODE: c_int = 0o10000003; ++pub const O_NDELAY: c_int = O_NONBLOCK; ++pub const NI_MAXHOST: crate::socklen_t = 255; ++pub const PTHREAD_STACK_MIN: size_t = 2048; ++ ++pub const POSIX_MADV_DONTNEED: c_int = 4; ++ ++pub const MAP_ANONYMOUS: c_int = MAP_ANON; ++ ++pub const SOCK_SEQPACKET: c_int = 5; ++pub const SOCK_DCCP: c_int = 6; ++pub const SOCK_NONBLOCK: c_int = O_NONBLOCK; ++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 = crate::SIGSYS; ++ ++pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; ++pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; ++pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8; ++pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4; ++ ++#[cfg(not(target_arch = "loongarch64"))] ++pub const CPU_SETSIZE: c_int = 128; ++#[cfg(target_arch = "loongarch64")] ++pub const CPU_SETSIZE: c_int = 1024; ++ ++pub const PTRACE_TRACEME: c_int = 0; ++pub const PTRACE_PEEKTEXT: c_int = 1; ++pub const PTRACE_PEEKDATA: c_int = 2; ++pub const PTRACE_PEEKUSER: c_int = 3; ++pub const PTRACE_POKETEXT: c_int = 4; ++pub const PTRACE_POKEDATA: c_int = 5; ++pub const PTRACE_POKEUSER: c_int = 6; ++pub const PTRACE_CONT: c_int = 7; ++pub const PTRACE_KILL: c_int = 8; ++pub const PTRACE_SINGLESTEP: c_int = 9; ++pub const PTRACE_GETREGS: c_int = 12; ++pub const PTRACE_SETREGS: c_int = 13; ++pub const PTRACE_GETFPREGS: c_int = 14; ++pub const PTRACE_SETFPREGS: c_int = 15; ++pub const PTRACE_ATTACH: c_int = 16; ++pub const PTRACE_DETACH: c_int = 17; ++pub const PTRACE_GETFPXREGS: c_int = 18; ++pub const PTRACE_SETFPXREGS: c_int = 19; ++pub const PTRACE_SYSCALL: c_int = 24; ++pub const PTRACE_SETOPTIONS: c_int = 0x4200; ++pub const PTRACE_GETEVENTMSG: c_int = 0x4201; ++pub const PTRACE_GETSIGINFO: c_int = 0x4202; ++pub const PTRACE_SETSIGINFO: c_int = 0x4203; ++pub const PTRACE_GETREGSET: c_int = 0x4204; ++pub const PTRACE_SETREGSET: c_int = 0x4205; ++pub const PTRACE_SEIZE: c_int = 0x4206; ++pub const PTRACE_INTERRUPT: c_int = 0x4207; ++pub const PTRACE_LISTEN: c_int = 0x4208; ++pub const PTRACE_PEEKSIGINFO: c_int = 0x4209; ++pub const PTRACE_GETSIGMASK: c_uint = 0x420a; ++pub const PTRACE_SETSIGMASK: c_uint = 0x420b; ++ ++pub const RWF_HIPRI: c_int = 0x00000001; ++pub const RWF_DSYNC: c_int = 0x00000002; ++pub const RWF_SYNC: c_int = 0x00000004; ++pub const RWF_NOWAIT: c_int = 0x00000008; ++pub const RWF_APPEND: c_int = 0x00000010; ++ ++pub const AF_IB: c_int = 27; ++pub const AF_MPLS: c_int = 28; ++pub const AF_NFC: c_int = 39; ++pub const AF_VSOCK: c_int = 40; ++pub const AF_XDP: c_int = 44; ++pub const PF_IB: c_int = AF_IB; ++pub const PF_MPLS: c_int = AF_MPLS; ++pub const PF_NFC: c_int = AF_NFC; ++pub const PF_VSOCK: c_int = AF_VSOCK; ++pub const PF_XDP: c_int = AF_XDP; ++ ++pub const EFD_NONBLOCK: c_int = crate::O_NONBLOCK; ++ ++pub const SFD_NONBLOCK: c_int = crate::O_NONBLOCK; ++ ++pub const PIDFD_NONBLOCK: c_uint = O_NONBLOCK as c_uint; ++ ++pub const TCSANOW: c_int = 0; ++pub const TCSADRAIN: c_int = 1; ++pub const TCSAFLUSH: c_int = 2; ++ ++pub const RTLD_GLOBAL: c_int = 0x100; ++pub const RTLD_NOLOAD: c_int = 0x4; ++ ++pub const CLOCK_SGI_CYCLE: crate::clockid_t = 10; ++ ++pub const B0: crate::speed_t = 0o000000; ++pub const B50: crate::speed_t = 0o000001; ++pub const B75: crate::speed_t = 0o000002; ++pub const B110: crate::speed_t = 0o000003; ++pub const B134: crate::speed_t = 0o000004; ++pub const B150: crate::speed_t = 0o000005; ++pub const B200: crate::speed_t = 0o000006; ++pub const B300: crate::speed_t = 0o000007; ++pub const B600: crate::speed_t = 0o000010; ++pub const B1200: crate::speed_t = 0o000011; ++pub const B1800: crate::speed_t = 0o000012; ++pub const B2400: crate::speed_t = 0o000013; ++pub const B4800: crate::speed_t = 0o000014; ++pub const B9600: crate::speed_t = 0o000015; ++pub const B19200: crate::speed_t = 0o000016; ++pub const B38400: crate::speed_t = 0o000017; ++pub const EXTA: crate::speed_t = B19200; ++pub const EXTB: crate::speed_t = B38400; ++ ++pub const REG_OK: c_int = 0; ++ ++pub const PRIO_PROCESS: c_int = 0; ++pub const PRIO_PGRP: c_int = 1; ++pub const PRIO_USER: c_int = 2; ++ ++pub const ADJ_OFFSET: c_uint = 0x0001; ++pub const ADJ_FREQUENCY: c_uint = 0x0002; ++pub const ADJ_MAXERROR: c_uint = 0x0004; ++pub const ADJ_ESTERROR: c_uint = 0x0008; ++pub const ADJ_STATUS: c_uint = 0x0010; ++pub const ADJ_TIMECONST: c_uint = 0x0020; ++pub const ADJ_TAI: c_uint = 0x0080; ++pub const ADJ_SETOFFSET: c_uint = 0x0100; ++pub const ADJ_MICRO: c_uint = 0x1000; ++pub const ADJ_NANO: c_uint = 0x2000; ++pub const ADJ_TICK: c_uint = 0x4000; ++pub const ADJ_OFFSET_SINGLESHOT: c_uint = 0x8001; ++pub const ADJ_OFFSET_SS_READ: c_uint = 0xa001; ++pub const MOD_OFFSET: c_uint = ADJ_OFFSET; ++pub const MOD_FREQUENCY: c_uint = ADJ_FREQUENCY; ++pub const MOD_MAXERROR: c_uint = ADJ_MAXERROR; ++pub const MOD_ESTERROR: c_uint = ADJ_ESTERROR; ++pub const MOD_STATUS: c_uint = ADJ_STATUS; ++pub const MOD_TIMECONST: c_uint = ADJ_TIMECONST; ++pub const MOD_CLKB: c_uint = ADJ_TICK; ++pub const MOD_CLKA: c_uint = ADJ_OFFSET_SINGLESHOT; ++pub const MOD_TAI: c_uint = ADJ_TAI; ++pub const MOD_MICRO: c_uint = ADJ_MICRO; ++pub const MOD_NANO: c_uint = ADJ_NANO; ++pub const STA_PLL: c_int = 0x0001; ++pub const STA_PPSFREQ: c_int = 0x0002; ++pub const STA_PPSTIME: c_int = 0x0004; ++pub const STA_FLL: c_int = 0x0008; ++pub const STA_INS: c_int = 0x0010; ++pub const STA_DEL: c_int = 0x0020; ++pub const STA_UNSYNC: c_int = 0x0040; ++pub const STA_FREQHOLD: c_int = 0x0080; ++pub const STA_PPSSIGNAL: c_int = 0x0100; ++pub const STA_PPSJITTER: c_int = 0x0200; ++pub const STA_PPSWANDER: c_int = 0x0400; ++pub const STA_PPSERROR: c_int = 0x0800; ++pub const STA_CLOCKERR: c_int = 0x1000; ++pub const STA_NANO: c_int = 0x2000; ++pub const STA_MODE: c_int = 0x4000; ++pub const STA_CLK: c_int = 0x8000; ++pub const STA_RONLY: c_int = STA_PPSSIGNAL ++ | STA_PPSJITTER ++ | STA_PPSWANDER ++ | STA_PPSERROR ++ | STA_CLOCKERR ++ | STA_NANO ++ | STA_MODE ++ | STA_CLK; ++ ++pub const TIME_OK: c_int = 0; ++pub const TIME_INS: c_int = 1; ++pub const TIME_DEL: c_int = 2; ++pub const TIME_OOP: c_int = 3; ++pub const TIME_WAIT: c_int = 4; ++pub const TIME_ERROR: c_int = 5; ++pub const TIME_BAD: c_int = TIME_ERROR; ++pub const MAXTC: c_long = 6; ++ ++pub const SOL_XDP: c_int = 283; ++ ++// linux/if_xdp.h ++pub const XDP_SHARED_UMEM: crate::__u16 = 1 << 0; ++pub const XDP_COPY: crate::__u16 = 1 << 1; ++pub const XDP_ZEROCOPY: crate::__u16 = 1 << 2; ++pub const XDP_USE_NEED_WAKEUP: crate::__u16 = 1 << 3; ++pub const XDP_USE_SG: crate::__u16 = 1 << 4; ++ ++pub const XDP_UMEM_UNALIGNED_CHUNK_FLAG: crate::__u32 = 1 << 0; ++ ++pub const XDP_RING_NEED_WAKEUP: crate::__u32 = 1 << 0; ++ ++pub const XDP_MMAP_OFFSETS: c_int = 1; ++pub const XDP_RX_RING: c_int = 2; ++pub const XDP_TX_RING: c_int = 3; ++pub const XDP_UMEM_REG: c_int = 4; ++pub const XDP_UMEM_FILL_RING: c_int = 5; ++pub const XDP_UMEM_COMPLETION_RING: c_int = 6; ++pub const XDP_STATISTICS: c_int = 7; ++pub const XDP_OPTIONS: c_int = 8; ++ ++pub const XDP_OPTIONS_ZEROCOPY: crate::__u32 = 1 << 0; ++ ++pub const XDP_PGOFF_RX_RING: off_t = 0; ++pub const XDP_PGOFF_TX_RING: off_t = 0x80000000; ++pub const XDP_UMEM_PGOFF_FILL_RING: c_ulonglong = 0x100000000; ++pub const XDP_UMEM_PGOFF_COMPLETION_RING: c_ulonglong = 0x180000000; ++ ++pub const XSK_UNALIGNED_BUF_OFFSET_SHIFT: c_int = 48; ++pub const XSK_UNALIGNED_BUF_ADDR_MASK: c_ulonglong = (1 << XSK_UNALIGNED_BUF_OFFSET_SHIFT) - 1; ++ ++pub const XDP_PKT_CONTD: crate::__u32 = 1 << 0; ++ ++pub const _CS_V6_ENV: c_int = 1148; ++pub const _CS_V7_ENV: c_int = 1149; ++ ++cfg_if! { ++ if #[cfg(target_arch = "s390x")] { ++ pub const POSIX_FADV_DONTNEED: c_int = 6; ++ pub const POSIX_FADV_NOREUSE: c_int = 7; ++ } else { ++ pub const POSIX_FADV_DONTNEED: c_int = 4; ++ pub const POSIX_FADV_NOREUSE: c_int = 5; ++ } ++} ++ ++extern "C" { ++ pub fn sendmmsg( ++ sockfd: c_int, ++ msgvec: *mut crate::mmsghdr, ++ vlen: c_uint, ++ flags: c_uint, ++ ) -> c_int; ++ pub fn recvmmsg( ++ sockfd: c_int, ++ msgvec: *mut crate::mmsghdr, ++ vlen: c_uint, ++ flags: c_uint, ++ timeout: *mut crate::timespec, ++ ) -> c_int; ++ ++ pub fn getrlimit(resource: c_int, rlim: *mut crate::rlimit) -> c_int; ++ pub fn setrlimit(resource: c_int, rlim: *const crate::rlimit) -> c_int; ++ pub fn prlimit( ++ pid: crate::pid_t, ++ resource: c_int, ++ new_limit: *const crate::rlimit, ++ old_limit: *mut crate::rlimit, ++ ) -> c_int; ++ pub fn gettimeofday(tp: *mut crate::timeval, tz: *mut c_void) -> c_int; ++ pub fn ptrace(request: c_int, ...) -> c_long; ++ pub fn getpriority(which: c_int, who: crate::id_t) -> c_int; ++ pub fn setpriority(which: c_int, who: crate::id_t, prio: c_int) -> c_int; ++ // Musl targets need the `mask` argument of `fanotify_mark` be specified ++ // `c_ulonglong` instead of `u64` or there will be a type mismatch between ++ // `long long unsigned int` and the expected `uint64_t`. ++ pub fn fanotify_mark( ++ fd: c_int, ++ flags: c_uint, ++ mask: c_ulonglong, ++ dirfd: c_int, ++ path: *const c_char, ++ ) -> c_int; ++ pub fn preadv2( ++ fd: c_int, ++ iov: *const crate::iovec, ++ iovcnt: c_int, ++ offset: off_t, ++ flags: c_int, ++ ) -> ssize_t; ++ pub fn pwritev2( ++ fd: c_int, ++ iov: *const crate::iovec, ++ iovcnt: c_int, ++ offset: off_t, ++ flags: c_int, ++ ) -> ssize_t; ++ pub fn getauxval(type_: c_ulong) -> c_ulong; ++ ++ // Added in `musl` 1.1.20 ++ pub fn explicit_bzero(s: *mut c_void, len: size_t); ++ // Added in `musl` 1.2.2 ++ pub fn reallocarray(ptr: *mut c_void, nmemb: size_t, size: size_t) -> *mut c_void; ++ ++ pub fn adjtimex(buf: *mut crate::timex) -> c_int; ++ pub fn clock_adjtime(clk_id: crate::clockid_t, buf: *mut crate::timex) -> c_int; ++ ++ pub fn ctermid(s: *mut c_char) -> *mut c_char; ++ ++ pub fn memfd_create(name: *const c_char, flags: c_uint) -> c_int; ++ pub fn mlock2(addr: *const c_void, len: size_t, flags: c_uint) -> c_int; ++ pub fn malloc_usable_size(ptr: *mut c_void) -> size_t; ++ ++ pub fn euidaccess(pathname: *const c_char, mode: c_int) -> c_int; ++ pub fn eaccess(pathname: *const c_char, mode: c_int) -> c_int; ++ ++ pub fn asctime_r(tm: *const crate::tm, buf: *mut c_char) -> *mut c_char; ++ ++ pub fn dirname(path: *mut c_char) -> *mut c_char; ++ pub fn basename(path: *mut c_char) -> *mut c_char; ++ ++ // Added in `musl` 1.1.24 ++ pub fn posix_spawn_file_actions_addchdir_np( ++ actions: *mut crate::posix_spawn_file_actions_t, ++ path: *const c_char, ++ ) -> c_int; ++ // Added in `musl` 1.1.24 ++ pub fn posix_spawn_file_actions_addfchdir_np( ++ actions: *mut crate::posix_spawn_file_actions_t, ++ fd: c_int, ++ ) -> c_int; ++ ++ pub fn getutxent() -> *mut utmpx; ++ pub fn getutxid(ut: *const utmpx) -> *mut utmpx; ++ pub fn getutxline(ut: *const utmpx) -> *mut utmpx; ++ pub fn pututxline(ut: *const utmpx) -> *mut utmpx; ++ pub fn setutxent(); ++ pub fn endutxent(); ++} ++ ++// Alias to 64 to mimic glibc's LFS64 support ++mod lfs64; ++pub use self::lfs64::*; ++ ++cfg_if! { ++ if #[cfg(any( ++ target_arch = "x86_64", ++ target_arch = "aarch64", ++ target_arch = "mips64", ++ target_arch = "powerpc64", ++ target_arch = "s390x", ++ target_arch = "riscv64", ++ target_arch = "loongarch64" ++ ))] { ++ mod b64; ++ pub use self::b64::*; ++ } else if #[cfg(any( ++ target_arch = "x86", ++ target_arch = "mips", ++ target_arch = "powerpc", ++ target_arch = "hexagon", ++ target_arch = "riscv32", ++ target_arch = "arm" ++ ))] { ++ mod b32; ++ pub use self::b32::*; ++ } else { ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/uclibc/arm/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/uclibc/arm/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/uclibc/arm/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/uclibc/arm/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,927 @@ ++use crate::off64_t; ++use crate::prelude::*; ++ ++pub type c_char = u8; ++pub type wchar_t = c_uint; ++pub type c_long = i32; ++pub type c_ulong = u32; ++pub type time_t = c_long; ++ ++pub type clock_t = c_long; ++pub type fsblkcnt_t = c_ulong; ++pub type fsfilcnt_t = c_ulong; ++pub type ino_t = c_ulong; ++pub type off_t = c_long; ++pub type pthread_t = c_ulong; ++pub type suseconds_t = c_long; ++ ++pub type nlink_t = c_uint; ++pub type blksize_t = c_long; ++pub type blkcnt_t = c_long; ++ ++pub type fsblkcnt64_t = u64; ++pub type fsfilcnt64_t = u64; ++pub type __u64 = c_ulonglong; ++pub type __s64 = c_longlong; ++ ++s! { ++ pub struct cmsghdr { ++ pub cmsg_len: size_t, ++ pub cmsg_level: c_int, ++ pub cmsg_type: c_int, ++ } ++ ++ pub struct msghdr { ++ pub msg_name: *mut c_void, ++ pub msg_namelen: crate::socklen_t, ++ pub msg_iov: *mut crate::iovec, ++ pub msg_iovlen: c_int, ++ pub msg_control: *mut c_void, ++ pub msg_controllen: crate::socklen_t, ++ pub msg_flags: c_int, ++ } ++ ++ pub struct pthread_attr_t { ++ __size: [c_long; 9], ++ } ++ ++ pub struct stat { ++ pub st_dev: c_ulonglong, ++ __pad1: c_ushort, ++ pub st_ino: crate::ino_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: c_ulonglong, ++ __pad2: c_ushort, ++ pub st_size: off_t, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ __unused4: c_ulong, ++ __unused5: c_ulong, ++ } ++ ++ pub struct stat64 { ++ pub st_dev: c_ulonglong, ++ pub __pad1: c_uint, ++ pub __st_ino: crate::ino_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: c_ulonglong, ++ pub __pad2: c_uint, ++ pub st_size: off64_t, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt64_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ pub st_ino: crate::ino64_t, ++ } ++ ++ pub struct flock { ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ pub l_start: off_t, ++ pub l_len: off_t, ++ pub l_pid: crate::pid_t, ++ } ++ ++ pub struct sysinfo { ++ pub uptime: c_long, ++ pub loads: [c_ulong; 3], ++ pub totalram: c_ulong, ++ pub freeram: c_ulong, ++ pub sharedram: c_ulong, ++ pub bufferram: c_ulong, ++ pub totalswap: c_ulong, ++ pub freeswap: c_ulong, ++ pub procs: c_ushort, ++ pub pad: c_ushort, ++ pub totalhigh: c_ulong, ++ pub freehigh: c_ulong, ++ pub mem_unit: c_uint, ++ pub _f: [c_char; 8], ++ } ++ ++ pub struct statfs { ++ pub f_type: c_int, ++ pub f_bsize: c_int, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ ++ pub f_fsid: crate::fsid_t, ++ pub f_namelen: c_int, ++ pub f_frsize: c_int, ++ pub f_flags: c_int, ++ pub f_spare: [c_int; 4], ++ } ++ ++ pub struct statfs64 { ++ pub f_type: c_int, ++ pub f_bsize: c_int, ++ pub f_blocks: crate::fsblkcnt64_t, ++ pub f_bfree: crate::fsblkcnt64_t, ++ pub f_bavail: crate::fsblkcnt64_t, ++ pub f_files: crate::fsfilcnt64_t, ++ pub f_ffree: crate::fsfilcnt64_t, ++ pub f_fsid: crate::fsid_t, ++ pub f_namelen: c_int, ++ pub f_frsize: c_int, ++ pub f_flags: c_int, ++ pub f_spare: [c_int; 4], ++ } ++ ++ pub struct statvfs64 { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: u64, ++ pub f_bfree: u64, ++ pub f_bavail: u64, ++ pub f_files: u64, ++ pub f_ffree: u64, ++ pub f_favail: u64, ++ pub f_fsid: c_ulong, ++ __f_unused: c_int, ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ __f_spare: [c_int; 6], ++ } ++ ++ pub struct sigset_t { ++ __val: [c_ulong; 2], ++ } ++ ++ pub struct sigaction { ++ pub sa_sigaction: crate::sighandler_t, ++ pub sa_flags: c_ulong, ++ pub sa_restorer: Option, ++ pub sa_mask: sigset_t, ++ } ++ ++ pub struct termios { ++ pub c_iflag: crate::tcflag_t, ++ pub c_oflag: crate::tcflag_t, ++ pub c_cflag: crate::tcflag_t, ++ pub c_lflag: crate::tcflag_t, ++ pub c_line: crate::cc_t, ++ pub c_cc: [crate::cc_t; crate::NCCS], ++ pub c_ispeed: crate::speed_t, ++ pub c_ospeed: crate::speed_t, ++ } ++ ++ pub struct siginfo_t { ++ pub si_signo: c_int, ++ pub si_errno: c_int, ++ pub si_code: c_int, ++ pub _pad: [c_int; 29], ++ } ++ ++ pub struct stack_t { ++ pub ss_sp: *mut c_void, ++ pub ss_flags: c_int, ++ pub ss_size: size_t, ++ } ++ ++ pub struct ipc_perm { ++ pub __key: crate::key_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub cuid: crate::uid_t, ++ pub cgid: crate::gid_t, ++ pub mode: c_ushort, ++ __pad1: c_ushort, ++ pub __seq: c_ushort, ++ __pad2: c_ushort, ++ __unused1: c_ulong, ++ __unused2: c_ulong, ++ } ++ ++ pub struct msqid_ds { ++ pub msg_perm: crate::ipc_perm, ++ pub msg_stime: crate::time_t, ++ __unused1: c_ulong, ++ pub msg_rtime: crate::time_t, ++ __unused2: c_ulong, ++ pub msg_ctime: crate::time_t, ++ __unused3: c_ulong, ++ __msg_cbytes: c_ulong, ++ pub msg_qnum: crate::msgqnum_t, ++ pub msg_qbytes: crate::msglen_t, ++ pub msg_lspid: crate::pid_t, ++ pub msg_lrpid: crate::pid_t, ++ __unused4: c_ulong, ++ __unused5: c_ulong, ++ } ++ ++ pub struct shmid_ds { ++ pub shm_perm: crate::ipc_perm, ++ pub shm_segsz: size_t, ++ pub shm_atime: crate::time_t, ++ __unused1: c_ulong, ++ pub shm_dtime: crate::time_t, ++ __unused2: c_ulong, ++ pub shm_ctime: crate::time_t, ++ __unused3: c_ulong, ++ pub shm_cpid: crate::pid_t, ++ pub shm_lpid: crate::pid_t, ++ pub shm_nattch: crate::shmatt_t, ++ __unused4: c_ulong, ++ __unused5: c_ulong, ++ } ++ ++ // FIXME(1.0) this is actually a union ++ #[cfg_attr(target_pointer_width = "32", repr(align(4)))] ++ #[cfg_attr(target_pointer_width = "64", repr(align(8)))] ++ pub struct sem_t { ++ #[cfg(target_pointer_width = "32")] ++ __size: [c_char; 16], ++ #[cfg(target_pointer_width = "64")] ++ __size: [c_char; 32], ++ } ++} ++ ++pub const O_CLOEXEC: c_int = 0o2000000; ++pub const __SIZEOF_PTHREAD_ATTR_T: usize = 36; ++pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 24; ++pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; ++pub const __SIZEOF_PTHREAD_COND_COMPAT_T: usize = 12; ++pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; ++pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 32; ++pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8; ++pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 20; ++pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4; ++pub const NCCS: usize = 32; ++ ++// I wasn't able to find those constants ++// in uclibc build environment for armv7 ++pub const MAP_HUGETLB: c_int = 0x040000; // from linux/other/mod.rs ++ ++// autogenerated constants with hand tuned types ++pub const B0: crate::speed_t = 0; ++pub const B1000000: crate::speed_t = 0x1008; ++pub const B110: crate::speed_t = 0x3; ++pub const B115200: crate::speed_t = 0x1002; ++pub const B1152000: crate::speed_t = 0x1009; ++pub const B1200: crate::speed_t = 0x9; ++pub const B134: crate::speed_t = 0x4; ++pub const B150: crate::speed_t = 0x5; ++pub const B1500000: crate::speed_t = 0x100a; ++pub const B1800: crate::speed_t = 0xa; ++pub const B19200: crate::speed_t = 0xe; ++pub const B200: crate::speed_t = 0x6; ++pub const B2000000: crate::speed_t = 0x100b; ++pub const B230400: crate::speed_t = 0x1003; ++pub const B2400: crate::speed_t = 0xb; ++pub const B2500000: crate::speed_t = 0x100c; ++pub const B300: crate::speed_t = 0x7; ++pub const B3000000: crate::speed_t = 0x100d; ++pub const B3500000: crate::speed_t = 0x100e; ++pub const B38400: crate::speed_t = 0xf; ++pub const B4000000: crate::speed_t = 0x100f; ++pub const B460800: crate::speed_t = 0x1004; ++pub const B4800: crate::speed_t = 0xc; ++pub const B50: crate::speed_t = 0x1; ++pub const B500000: crate::speed_t = 0x1005; ++pub const B57600: crate::speed_t = 0x1001; ++pub const B576000: crate::speed_t = 0x1006; ++pub const B600: crate::speed_t = 0x8; ++pub const B75: crate::speed_t = 0x2; ++pub const B921600: crate::speed_t = 0x1007; ++pub const B9600: crate::speed_t = 0xd; ++pub const BS1: c_int = 0x2000; ++pub const BSDLY: c_int = 0x2000; ++pub const CBAUD: crate::tcflag_t = 0x100f; ++pub const CBAUDEX: crate::tcflag_t = 0x1000; ++pub const CIBAUD: crate::tcflag_t = 0x100f0000; ++pub const CLOCAL: crate::tcflag_t = 0x800; ++pub const CPU_SETSIZE: c_int = 0x400; ++pub const CR1: c_int = 0x200; ++pub const CR2: c_int = 0x400; ++pub const CR3: c_int = 0x600; ++pub const CRDLY: c_int = 0x600; ++pub const CREAD: crate::tcflag_t = 0x80; ++pub const CS6: crate::tcflag_t = 0x10; ++pub const CS7: crate::tcflag_t = 0x20; ++pub const CS8: crate::tcflag_t = 0x30; ++pub const CSIZE: crate::tcflag_t = 0x30; ++pub const CSTOPB: crate::tcflag_t = 0x40; ++pub const EADDRINUSE: c_int = 0x62; ++pub const EADDRNOTAVAIL: c_int = 0x63; ++pub const EADV: c_int = 0x44; ++pub const EAFNOSUPPORT: c_int = 0x61; ++pub const EALREADY: c_int = 0x72; ++pub const EBADE: c_int = 0x34; ++pub const EBADFD: c_int = 0x4d; ++pub const EBADMSG: c_int = 0x4a; ++pub const EBADR: c_int = 0x35; ++pub const EBADRQC: c_int = 0x38; ++pub const EBADSLT: c_int = 0x39; ++pub const EBFONT: c_int = 0x3b; ++pub const ECANCELED: c_int = 0x7d; ++pub const ECHOCTL: crate::tcflag_t = 0x200; ++pub const ECHOE: crate::tcflag_t = 0x10; ++pub const ECHOK: crate::tcflag_t = 0x20; ++pub const ECHOKE: crate::tcflag_t = 0x800; ++pub const ECHONL: crate::tcflag_t = 0x40; ++pub const ECHOPRT: crate::tcflag_t = 0x400; ++pub const ECHRNG: c_int = 0x2c; ++pub const ECOMM: c_int = 0x46; ++pub const ECONNABORTED: c_int = 0x67; ++pub const ECONNREFUSED: c_int = 0x6f; ++pub const ECONNRESET: c_int = 0x68; ++pub const EDEADLK: c_int = 0x23; ++pub const EDESTADDRREQ: c_int = 0x59; ++pub const EDOTDOT: c_int = 0x49; ++pub const EDQUOT: c_int = 0x7a; ++pub const EFD_CLOEXEC: c_int = 0x80000; ++pub const EFD_NONBLOCK: c_int = 0x800; ++pub const EHOSTDOWN: c_int = 0x70; ++pub const EHOSTUNREACH: c_int = 0x71; ++pub const EHWPOISON: c_int = 0x85; ++pub const EIDRM: c_int = 0x2b; ++pub const EILSEQ: c_int = 0x54; ++pub const EINPROGRESS: c_int = 0x73; ++pub const EISCONN: c_int = 0x6a; ++pub const EISNAM: c_int = 0x78; ++pub const EKEYEXPIRED: c_int = 0x7f; ++pub const EKEYREJECTED: c_int = 0x81; ++pub const EKEYREVOKED: c_int = 0x80; ++pub const EL2HLT: c_int = 0x33; ++pub const EL2NSYNC: c_int = 0x2d; ++pub const EL3HLT: c_int = 0x2e; ++pub const EL3RST: c_int = 0x2f; ++pub const ELIBACC: c_int = 0x4f; ++pub const ELIBBAD: c_int = 0x50; ++pub const ELIBEXEC: c_int = 0x53; ++pub const ELIBMAX: c_int = 0x52; ++pub const ELIBSCN: c_int = 0x51; ++pub const ELNRNG: c_int = 0x30; ++pub const ELOOP: c_int = 0x28; ++pub const EMEDIUMTYPE: c_int = 0x7c; ++pub const EMSGSIZE: c_int = 0x5a; ++pub const EMULTIHOP: c_int = 0x48; ++pub const ENAMETOOLONG: c_int = 0x24; ++pub const ENAVAIL: c_int = 0x77; ++pub const ENETDOWN: c_int = 0x64; ++pub const ENETRESET: c_int = 0x66; ++pub const ENETUNREACH: c_int = 0x65; ++pub const ENOANO: c_int = 0x37; ++pub const ENOBUFS: c_int = 0x69; ++pub const ENOCSI: c_int = 0x32; ++pub const ENODATA: c_int = 0x3d; ++pub const ENOKEY: c_int = 0x7e; ++pub const ENOLCK: c_int = 0x25; ++pub const ENOLINK: c_int = 0x43; ++pub const ENOMEDIUM: c_int = 0x7b; ++pub const ENOMSG: c_int = 0x2a; ++pub const ENONET: c_int = 0x40; ++pub const ENOPKG: c_int = 0x41; ++pub const ENOPROTOOPT: c_int = 0x5c; ++pub const ENOSR: c_int = 0x3f; ++pub const ENOSTR: c_int = 0x3c; ++pub const ENOSYS: c_int = 0x26; ++pub const ENOTCONN: c_int = 0x6b; ++pub const ENOTEMPTY: c_int = 0x27; ++pub const ENOTNAM: c_int = 0x76; ++pub const ENOTRECOVERABLE: c_int = 0x83; ++pub const ENOTSOCK: c_int = 0x58; ++pub const ENOTUNIQ: c_int = 0x4c; ++pub const EOPNOTSUPP: c_int = 0x5f; ++pub const EOVERFLOW: c_int = 0x4b; ++pub const EOWNERDEAD: c_int = 0x82; ++pub const EPFNOSUPPORT: c_int = 0x60; ++pub const EPOLL_CLOEXEC: c_int = 0x80000; ++pub const EPROTO: c_int = 0x47; ++pub const EPROTONOSUPPORT: c_int = 0x5d; ++pub const EPROTOTYPE: c_int = 0x5b; ++pub const EREMCHG: c_int = 0x4e; ++pub const EREMOTE: c_int = 0x42; ++pub const EREMOTEIO: c_int = 0x79; ++pub const ERESTART: c_int = 0x55; ++pub const ERFKILL: c_int = 0x84; ++pub const ESHUTDOWN: c_int = 0x6c; ++pub const ESOCKTNOSUPPORT: c_int = 0x5e; ++pub const ESRMNT: c_int = 0x45; ++pub const ESTALE: c_int = 0x74; ++pub const ESTRPIPE: c_int = 0x56; ++pub const ETIME: c_int = 0x3e; ++pub const ETIMEDOUT: c_int = 0x6e; ++pub const ETOOMANYREFS: c_int = 0x6d; ++pub const EUCLEAN: c_int = 0x75; ++pub const EUNATCH: c_int = 0x31; ++pub const EUSERS: c_int = 0x57; ++pub const EXFULL: c_int = 0x36; ++pub const FF1: c_int = 0x8000; ++pub const FFDLY: c_int = 0x8000; ++pub const FLUSHO: crate::tcflag_t = 0x1000; ++pub const F_GETLK: c_int = 0x5; ++pub const F_SETLK: c_int = 0x6; ++pub const F_SETLKW: c_int = 0x7; ++pub const HUPCL: crate::tcflag_t = 0x400; ++pub const ICANON: crate::tcflag_t = 0x2; ++pub const IEXTEN: crate::tcflag_t = 0x8000; ++pub const ISIG: crate::tcflag_t = 0x1; ++pub const IXOFF: crate::tcflag_t = 0x1000; ++pub const IXON: crate::tcflag_t = 0x400; ++pub const MAP_ANON: c_int = 0x20; ++pub const MAP_ANONYMOUS: c_int = 0x20; ++pub const MAP_DENYWRITE: c_int = 0x800; ++pub const MAP_EXECUTABLE: c_int = 0x1000; ++pub const MAP_GROWSDOWN: c_int = 0x100; ++pub const MAP_LOCKED: c_int = 0x2000; ++pub const MAP_NONBLOCK: c_int = 0x10000; ++pub const MAP_NORESERVE: c_int = 0x4000; ++pub const MAP_POPULATE: c_int = 0x8000; ++pub const MAP_STACK: c_int = 0x20000; ++pub const NLDLY: crate::tcflag_t = 0x100; ++pub const NOFLSH: crate::tcflag_t = 0x80; ++pub const OLCUC: crate::tcflag_t = 0x2; ++pub const ONLCR: crate::tcflag_t = 0x4; ++pub const O_ACCMODE: c_int = 0x3; ++pub const O_APPEND: c_int = 0x400; ++pub const O_ASYNC: c_int = 0o20000; ++pub const O_CREAT: c_int = 0x40; ++pub const O_DIRECT: c_int = 0x10000; ++pub const O_DIRECTORY: c_int = 0x4000; ++pub const O_DSYNC: c_int = O_SYNC; ++pub const O_EXCL: c_int = 0x80; ++pub const O_FSYNC: c_int = O_SYNC; ++pub const O_LARGEFILE: c_int = 0o400000; ++pub const O_NDELAY: c_int = O_NONBLOCK; ++pub const O_NOATIME: c_int = 0o1000000; ++pub const O_NOCTTY: c_int = 0x100; ++pub const O_NOFOLLOW: c_int = 0x8000; ++pub const O_NONBLOCK: c_int = 0x800; ++pub const O_PATH: c_int = 0o10000000; ++pub const O_RSYNC: c_int = O_SYNC; ++pub const O_SYNC: c_int = 0o10000; ++pub const O_TRUNC: c_int = 0x200; ++pub const PARENB: crate::tcflag_t = 0x100; ++pub const PARODD: crate::tcflag_t = 0x200; ++pub const PENDIN: crate::tcflag_t = 0x4000; ++pub const POLLWRBAND: c_short = 0x200; ++pub const POLLWRNORM: c_short = 0x100; ++pub const PTHREAD_STACK_MIN: size_t = 16384; ++pub const RTLD_GLOBAL: c_int = 0x00100; ++pub const PIDFD_NONBLOCK: c_int = 0x800; ++ ++// These are typed unsigned to match sigaction ++pub const SA_NOCLDSTOP: c_ulong = 0x1; ++pub const SA_NOCLDWAIT: c_ulong = 0x2; ++pub const SA_SIGINFO: c_ulong = 0x4; ++pub const SA_NODEFER: c_ulong = 0x40000000; ++pub const SA_ONSTACK: c_ulong = 0x8000000; ++pub const SA_RESETHAND: c_ulong = 0x80000000; ++pub const SA_RESTART: c_ulong = 0x10000000; ++ ++pub const SFD_CLOEXEC: c_int = 0x80000; ++pub const SFD_NONBLOCK: c_int = 0x800; ++pub const SIGBUS: c_int = 0x7; ++pub const SIGCHLD: c_int = 0x11; ++pub const SIGCONT: c_int = 0x12; ++pub const SIGIO: c_int = 0x1d; ++pub const SIGPROF: c_int = 0x1b; ++pub const SIGPWR: c_int = 0x1e; ++pub const SIGSTKFLT: c_int = 0x10; ++pub const SIGSTKSZ: size_t = 8192; ++pub const SIGSTOP: c_int = 0x13; ++pub const SIGSYS: c_int = 0x1f; ++pub const SIGTSTP: c_int = 0x14; ++pub const SIGTTIN: c_int = 0x15; ++pub const SIGTTOU: c_int = 0x16; ++pub const SIGURG: c_int = 0x17; ++pub const SIGUSR1: c_int = 0xa; ++pub const SIGUSR2: c_int = 0xc; ++pub const SIGVTALRM: c_int = 0x1a; ++pub const SIGWINCH: c_int = 0x1c; ++pub const SIGXCPU: c_int = 0x18; ++pub const SIGXFSZ: c_int = 0x19; ++pub const SIG_BLOCK: c_int = 0; ++pub const SIG_SETMASK: c_int = 0x2; ++pub const SIG_UNBLOCK: c_int = 0x1; ++pub const SOCK_DGRAM: c_int = 0x2; ++pub const SOCK_NONBLOCK: c_int = 0o0004000; ++pub const SOCK_SEQPACKET: c_int = 0x5; ++pub const SOCK_STREAM: c_int = 0x1; ++ ++pub const TAB1: c_int = 0x800; ++pub const TAB2: c_int = 0x1000; ++pub const TAB3: c_int = 0x1800; ++pub const TABDLY: c_int = 0x1800; ++pub const TCSADRAIN: c_int = 0x1; ++pub const TCSAFLUSH: c_int = 0x2; ++pub const TCSANOW: c_int = 0; ++pub const TOSTOP: crate::tcflag_t = 0x100; ++pub const VDISCARD: usize = 0xd; ++pub const VEOF: usize = 0x4; ++pub const VEOL: usize = 0xb; ++pub const VEOL2: usize = 0x10; ++pub const VMIN: usize = 0x6; ++pub const VREPRINT: usize = 0xc; ++pub const VSTART: usize = 0x8; ++pub const VSTOP: usize = 0x9; ++pub const VSUSP: usize = 0xa; ++pub const VSWTC: usize = 0x7; ++pub const VT1: c_int = 0x4000; ++pub const VTDLY: c_int = 0x4000; ++pub const VTIME: usize = 0x5; ++pub const VWERASE: usize = 0xe; ++pub const XTABS: crate::tcflag_t = 0x1800; ++ ++pub const MADV_SOFT_OFFLINE: c_int = 101; ++ ++// Syscall table is copied from src/unix/notbsd/linux/musl/b32/arm.rs ++pub const SYS_restart_syscall: c_long = 0; ++pub const SYS_exit: c_long = 1; ++pub const SYS_fork: c_long = 2; ++pub const SYS_read: c_long = 3; ++pub const SYS_write: c_long = 4; ++pub const SYS_open: c_long = 5; ++pub const SYS_close: c_long = 6; ++pub const SYS_creat: c_long = 8; ++pub const SYS_link: c_long = 9; ++pub const SYS_unlink: c_long = 10; ++pub const SYS_execve: c_long = 11; ++pub const SYS_chdir: c_long = 12; ++pub const SYS_mknod: c_long = 14; ++pub const SYS_chmod: c_long = 15; ++pub const SYS_lchown: c_long = 16; ++pub const SYS_lseek: c_long = 19; ++pub const SYS_getpid: c_long = 20; ++pub const SYS_mount: c_long = 21; ++pub const SYS_setuid: c_long = 23; ++pub const SYS_getuid: c_long = 24; ++pub const SYS_ptrace: c_long = 26; ++pub const SYS_pause: c_long = 29; ++pub const SYS_access: c_long = 33; ++pub const SYS_nice: c_long = 34; ++pub const SYS_sync: c_long = 36; ++pub const SYS_kill: c_long = 37; ++pub const SYS_rename: c_long = 38; ++pub const SYS_mkdir: c_long = 39; ++pub const SYS_rmdir: c_long = 40; ++pub const SYS_dup: c_long = 41; ++pub const SYS_pipe: c_long = 42; ++pub const SYS_times: c_long = 43; ++pub const SYS_brk: c_long = 45; ++pub const SYS_setgid: c_long = 46; ++pub const SYS_getgid: c_long = 47; ++pub const SYS_geteuid: c_long = 49; ++pub const SYS_getegid: c_long = 50; ++pub const SYS_acct: c_long = 51; ++pub const SYS_umount2: c_long = 52; ++pub const SYS_ioctl: c_long = 54; ++pub const SYS_fcntl: c_long = 55; ++pub const SYS_setpgid: c_long = 57; ++pub const SYS_umask: c_long = 60; ++pub const SYS_chroot: c_long = 61; ++pub const SYS_ustat: c_long = 62; ++pub const SYS_dup2: c_long = 63; ++pub const SYS_getppid: c_long = 64; ++pub const SYS_getpgrp: c_long = 65; ++pub const SYS_setsid: c_long = 66; ++pub const SYS_sigaction: c_long = 67; ++pub const SYS_setreuid: c_long = 70; ++pub const SYS_setregid: c_long = 71; ++pub const SYS_sigsuspend: c_long = 72; ++pub const SYS_sigpending: c_long = 73; ++pub const SYS_sethostname: c_long = 74; ++pub const SYS_setrlimit: c_long = 75; ++pub const SYS_getrusage: c_long = 77; ++pub const SYS_gettimeofday: c_long = 78; ++pub const SYS_settimeofday: c_long = 79; ++pub const SYS_getgroups: c_long = 80; ++pub const SYS_setgroups: c_long = 81; ++pub const SYS_symlink: c_long = 83; ++pub const SYS_readlink: c_long = 85; ++pub const SYS_uselib: c_long = 86; ++pub const SYS_swapon: c_long = 87; ++pub const SYS_reboot: c_long = 88; ++pub const SYS_munmap: c_long = 91; ++pub const SYS_truncate: c_long = 92; ++pub const SYS_ftruncate: c_long = 93; ++pub const SYS_fchmod: c_long = 94; ++pub const SYS_fchown: c_long = 95; ++pub const SYS_getpriority: c_long = 96; ++pub const SYS_setpriority: c_long = 97; ++pub const SYS_statfs: c_long = 99; ++pub const SYS_fstatfs: c_long = 100; ++pub const SYS_syslog: c_long = 103; ++pub const SYS_setitimer: c_long = 104; ++pub const SYS_getitimer: c_long = 105; ++pub const SYS_stat: c_long = 106; ++pub const SYS_lstat: c_long = 107; ++pub const SYS_fstat: c_long = 108; ++pub const SYS_vhangup: c_long = 111; ++pub const SYS_wait4: c_long = 114; ++pub const SYS_swapoff: c_long = 115; ++pub const SYS_sysinfo: c_long = 116; ++pub const SYS_fsync: c_long = 118; ++pub const SYS_sigreturn: c_long = 119; ++pub const SYS_clone: c_long = 120; ++pub const SYS_setdomainname: c_long = 121; ++pub const SYS_uname: c_long = 122; ++pub const SYS_adjtimex: c_long = 124; ++pub const SYS_mprotect: c_long = 125; ++pub const SYS_sigprocmask: c_long = 126; ++pub const SYS_init_module: c_long = 128; ++pub const SYS_delete_module: c_long = 129; ++pub const SYS_quotactl: c_long = 131; ++pub const SYS_getpgid: c_long = 132; ++pub const SYS_fchdir: c_long = 133; ++pub const SYS_bdflush: c_long = 134; ++pub const SYS_sysfs: c_long = 135; ++pub const SYS_personality: c_long = 136; ++pub const SYS_setfsuid: c_long = 138; ++pub const SYS_setfsgid: c_long = 139; ++pub const SYS__llseek: c_long = 140; ++pub const SYS_getdents: c_long = 141; ++pub const SYS__newselect: c_long = 142; ++pub const SYS_flock: c_long = 143; ++pub const SYS_msync: c_long = 144; ++pub const SYS_readv: c_long = 145; ++pub const SYS_writev: c_long = 146; ++pub const SYS_getsid: c_long = 147; ++pub const SYS_fdatasync: c_long = 148; ++pub const SYS__sysctl: c_long = 149; ++pub const SYS_mlock: c_long = 150; ++pub const SYS_munlock: c_long = 151; ++pub const SYS_mlockall: c_long = 152; ++pub const SYS_munlockall: c_long = 153; ++pub const SYS_sched_setparam: c_long = 154; ++pub const SYS_sched_getparam: c_long = 155; ++pub const SYS_sched_setscheduler: c_long = 156; ++pub const SYS_sched_getscheduler: c_long = 157; ++pub const SYS_sched_yield: c_long = 158; ++pub const SYS_sched_get_priority_max: c_long = 159; ++pub const SYS_sched_get_priority_min: c_long = 160; ++pub const SYS_sched_rr_get_interval: c_long = 161; ++pub const SYS_nanosleep: c_long = 162; ++pub const SYS_mremap: c_long = 163; ++pub const SYS_setresuid: c_long = 164; ++pub const SYS_getresuid: c_long = 165; ++pub const SYS_poll: c_long = 168; ++pub const SYS_nfsservctl: c_long = 169; ++pub const SYS_setresgid: c_long = 170; ++pub const SYS_getresgid: c_long = 171; ++pub const SYS_prctl: c_long = 172; ++pub const SYS_rt_sigreturn: c_long = 173; ++pub const SYS_rt_sigaction: c_long = 174; ++pub const SYS_rt_sigprocmask: c_long = 175; ++pub const SYS_rt_sigpending: c_long = 176; ++pub const SYS_rt_sigtimedwait: c_long = 177; ++pub const SYS_rt_sigqueueinfo: c_long = 178; ++pub const SYS_rt_sigsuspend: c_long = 179; ++pub const SYS_pread64: c_long = 180; ++pub const SYS_pwrite64: c_long = 181; ++pub const SYS_chown: c_long = 182; ++pub const SYS_getcwd: c_long = 183; ++pub const SYS_capget: c_long = 184; ++pub const SYS_capset: c_long = 185; ++pub const SYS_sigaltstack: c_long = 186; ++pub const SYS_sendfile: c_long = 187; ++pub const SYS_vfork: c_long = 190; ++pub const SYS_ugetrlimit: c_long = 191; ++pub const SYS_mmap2: c_long = 192; ++pub const SYS_truncate64: c_long = 193; ++pub const SYS_ftruncate64: c_long = 194; ++pub const SYS_stat64: c_long = 195; ++pub const SYS_lstat64: c_long = 196; ++pub const SYS_fstat64: c_long = 197; ++pub const SYS_lchown32: c_long = 198; ++pub const SYS_getuid32: c_long = 199; ++pub const SYS_getgid32: c_long = 200; ++pub const SYS_geteuid32: c_long = 201; ++pub const SYS_getegid32: c_long = 202; ++pub const SYS_setreuid32: c_long = 203; ++pub const SYS_setregid32: c_long = 204; ++pub const SYS_getgroups32: c_long = 205; ++pub const SYS_setgroups32: c_long = 206; ++pub const SYS_fchown32: c_long = 207; ++pub const SYS_setresuid32: c_long = 208; ++pub const SYS_getresuid32: c_long = 209; ++pub const SYS_setresgid32: c_long = 210; ++pub const SYS_getresgid32: c_long = 211; ++pub const SYS_chown32: c_long = 212; ++pub const SYS_setuid32: c_long = 213; ++pub const SYS_setgid32: c_long = 214; ++pub const SYS_setfsuid32: c_long = 215; ++pub const SYS_setfsgid32: c_long = 216; ++pub const SYS_getdents64: c_long = 217; ++pub const SYS_pivot_root: c_long = 218; ++pub const SYS_mincore: c_long = 219; ++pub const SYS_madvise: c_long = 220; ++pub const SYS_fcntl64: c_long = 221; ++pub const SYS_gettid: c_long = 224; ++pub const SYS_readahead: c_long = 225; ++pub const SYS_setxattr: c_long = 226; ++pub const SYS_lsetxattr: c_long = 227; ++pub const SYS_fsetxattr: c_long = 228; ++pub const SYS_getxattr: c_long = 229; ++pub const SYS_lgetxattr: c_long = 230; ++pub const SYS_fgetxattr: c_long = 231; ++pub const SYS_listxattr: c_long = 232; ++pub const SYS_llistxattr: c_long = 233; ++pub const SYS_flistxattr: c_long = 234; ++pub const SYS_removexattr: c_long = 235; ++pub const SYS_lremovexattr: c_long = 236; ++pub const SYS_fremovexattr: c_long = 237; ++pub const SYS_tkill: c_long = 238; ++pub const SYS_sendfile64: c_long = 239; ++pub const SYS_futex: c_long = 240; ++pub const SYS_sched_setaffinity: c_long = 241; ++pub const SYS_sched_getaffinity: c_long = 242; ++pub const SYS_io_setup: c_long = 243; ++pub const SYS_io_destroy: c_long = 244; ++pub const SYS_io_getevents: c_long = 245; ++pub const SYS_io_submit: c_long = 246; ++pub const SYS_io_cancel: c_long = 247; ++pub const SYS_exit_group: c_long = 248; ++pub const SYS_lookup_dcookie: c_long = 249; ++pub const SYS_epoll_create: c_long = 250; ++pub const SYS_epoll_ctl: c_long = 251; ++pub const SYS_epoll_wait: c_long = 252; ++pub const SYS_remap_file_pages: c_long = 253; ++pub const SYS_set_tid_address: c_long = 256; ++pub const SYS_timer_create: c_long = 257; ++pub const SYS_timer_settime: c_long = 258; ++pub const SYS_timer_gettime: c_long = 259; ++pub const SYS_timer_getoverrun: c_long = 260; ++pub const SYS_timer_delete: c_long = 261; ++pub const SYS_clock_settime: c_long = 262; ++pub const SYS_clock_gettime: c_long = 263; ++pub const SYS_clock_getres: c_long = 264; ++pub const SYS_clock_nanosleep: c_long = 265; ++pub const SYS_statfs64: c_long = 266; ++pub const SYS_fstatfs64: c_long = 267; ++pub const SYS_tgkill: c_long = 268; ++pub const SYS_utimes: c_long = 269; ++pub const SYS_pciconfig_iobase: c_long = 271; ++pub const SYS_pciconfig_read: c_long = 272; ++pub const SYS_pciconfig_write: c_long = 273; ++pub const SYS_mq_open: c_long = 274; ++pub const SYS_mq_unlink: c_long = 275; ++pub const SYS_mq_timedsend: c_long = 276; ++pub const SYS_mq_timedreceive: c_long = 277; ++pub const SYS_mq_notify: c_long = 278; ++pub const SYS_mq_getsetattr: c_long = 279; ++pub const SYS_waitid: c_long = 280; ++pub const SYS_socket: c_long = 281; ++pub const SYS_bind: c_long = 282; ++pub const SYS_connect: c_long = 283; ++pub const SYS_listen: c_long = 284; ++pub const SYS_accept: c_long = 285; ++pub const SYS_getsockname: c_long = 286; ++pub const SYS_getpeername: c_long = 287; ++pub const SYS_socketpair: c_long = 288; ++pub const SYS_send: c_long = 289; ++pub const SYS_sendto: c_long = 290; ++pub const SYS_recv: c_long = 291; ++pub const SYS_recvfrom: c_long = 292; ++pub const SYS_shutdown: c_long = 293; ++pub const SYS_setsockopt: c_long = 294; ++pub const SYS_getsockopt: c_long = 295; ++pub const SYS_sendmsg: c_long = 296; ++pub const SYS_recvmsg: c_long = 297; ++pub const SYS_semop: c_long = 298; ++pub const SYS_semget: c_long = 299; ++pub const SYS_semctl: c_long = 300; ++pub const SYS_msgsnd: c_long = 301; ++pub const SYS_msgrcv: c_long = 302; ++pub const SYS_msgget: c_long = 303; ++pub const SYS_msgctl: c_long = 304; ++pub const SYS_shmat: c_long = 305; ++pub const SYS_shmdt: c_long = 306; ++pub const SYS_shmget: c_long = 307; ++pub const SYS_shmctl: c_long = 308; ++pub const SYS_add_key: c_long = 309; ++pub const SYS_request_key: c_long = 310; ++pub const SYS_keyctl: c_long = 311; ++pub const SYS_semtimedop: c_long = 312; ++pub const SYS_vserver: c_long = 313; ++pub const SYS_ioprio_set: c_long = 314; ++pub const SYS_ioprio_get: c_long = 315; ++pub const SYS_inotify_init: c_long = 316; ++pub const SYS_inotify_add_watch: c_long = 317; ++pub const SYS_inotify_rm_watch: c_long = 318; ++pub const SYS_mbind: c_long = 319; ++pub const SYS_get_mempolicy: c_long = 320; ++pub const SYS_set_mempolicy: c_long = 321; ++pub const SYS_openat: c_long = 322; ++pub const SYS_mkdirat: c_long = 323; ++pub const SYS_mknodat: c_long = 324; ++pub const SYS_fchownat: c_long = 325; ++pub const SYS_futimesat: c_long = 326; ++pub const SYS_fstatat64: c_long = 327; ++pub const SYS_unlinkat: c_long = 328; ++pub const SYS_renameat: c_long = 329; ++pub const SYS_linkat: c_long = 330; ++pub const SYS_symlinkat: c_long = 331; ++pub const SYS_readlinkat: c_long = 332; ++pub const SYS_fchmodat: c_long = 333; ++pub const SYS_faccessat: c_long = 334; ++pub const SYS_pselect6: c_long = 335; ++pub const SYS_ppoll: c_long = 336; ++pub const SYS_unshare: c_long = 337; ++pub const SYS_set_robust_list: c_long = 338; ++pub const SYS_get_robust_list: c_long = 339; ++pub const SYS_splice: c_long = 340; ++pub const SYS_tee: c_long = 342; ++pub const SYS_vmsplice: c_long = 343; ++pub const SYS_move_pages: c_long = 344; ++pub const SYS_getcpu: c_long = 345; ++pub const SYS_epoll_pwait: c_long = 346; ++pub const SYS_kexec_load: c_long = 347; ++pub const SYS_utimensat: c_long = 348; ++pub const SYS_signalfd: c_long = 349; ++pub const SYS_timerfd_create: c_long = 350; ++pub const SYS_eventfd: c_long = 351; ++pub const SYS_fallocate: c_long = 352; ++pub const SYS_timerfd_settime: c_long = 353; ++pub const SYS_timerfd_gettime: c_long = 354; ++pub const SYS_signalfd4: c_long = 355; ++pub const SYS_eventfd2: c_long = 356; ++pub const SYS_epoll_create1: c_long = 357; ++pub const SYS_dup3: c_long = 358; ++pub const SYS_pipe2: c_long = 359; ++pub const SYS_inotify_init1: c_long = 360; ++pub const SYS_preadv: c_long = 361; ++pub const SYS_pwritev: c_long = 362; ++pub const SYS_rt_tgsigqueueinfo: c_long = 363; ++pub const SYS_perf_event_open: c_long = 364; ++pub const SYS_recvmmsg: c_long = 365; ++pub const SYS_accept4: c_long = 366; ++pub const SYS_fanotify_init: c_long = 367; ++pub const SYS_fanotify_mark: c_long = 368; ++pub const SYS_prlimit64: c_long = 369; ++pub const SYS_name_to_handle_at: c_long = 370; ++pub const SYS_open_by_handle_at: c_long = 371; ++pub const SYS_clock_adjtime: c_long = 372; ++pub const SYS_syncfs: c_long = 373; ++pub const SYS_sendmmsg: c_long = 374; ++pub const SYS_setns: c_long = 375; ++pub const SYS_process_vm_readv: c_long = 376; ++pub const SYS_process_vm_writev: c_long = 377; ++pub const SYS_kcmp: c_long = 378; ++pub const SYS_finit_module: c_long = 379; ++pub const SYS_sched_setattr: c_long = 380; ++pub const SYS_sched_getattr: c_long = 381; ++pub const SYS_renameat2: c_long = 382; ++pub const SYS_seccomp: c_long = 383; ++pub const SYS_getrandom: c_long = 384; ++pub const SYS_memfd_create: c_long = 385; ++pub const SYS_bpf: c_long = 386; ++pub const SYS_execveat: c_long = 387; ++pub const SYS_userfaultfd: c_long = 388; ++pub const SYS_membarrier: c_long = 389; ++pub const SYS_mlock2: c_long = 390; ++pub const SYS_copy_file_range: c_long = 391; ++pub const SYS_preadv2: c_long = 392; ++pub const SYS_pwritev2: c_long = 393; ++pub const SYS_pkey_mprotect: c_long = 394; ++pub const SYS_pkey_alloc: c_long = 395; ++pub const SYS_pkey_free: c_long = 396; ++// FIXME: should be a `c_long` too, but a bug slipped in. ++pub const SYS_statx: c_int = 397; ++pub const SYS_pidfd_send_signal: c_long = 424; ++pub const SYS_io_uring_setup: c_long = 425; ++pub const SYS_io_uring_enter: c_long = 426; ++pub const SYS_io_uring_register: c_long = 427; ++pub const SYS_open_tree: c_long = 428; ++pub const SYS_move_mount: c_long = 429; ++pub const SYS_fsopen: c_long = 430; ++pub const SYS_fsconfig: c_long = 431; ++pub const SYS_fsmount: c_long = 432; ++pub const SYS_fspick: c_long = 433; ++pub const SYS_pidfd_open: c_long = 434; ++pub const SYS_clone3: c_long = 435; ++pub const SYS_close_range: c_long = 436; ++pub const SYS_openat2: c_long = 437; ++pub const SYS_pidfd_getfd: c_long = 438; ++pub const SYS_faccessat2: c_long = 439; ++pub const SYS_process_madvise: c_long = 440; ++pub const SYS_epoll_pwait2: c_long = 441; ++pub const SYS_mount_setattr: c_long = 442; ++pub const SYS_quotactl_fd: c_long = 443; ++pub const SYS_landlock_create_ruleset: c_long = 444; ++pub const SYS_landlock_add_rule: c_long = 445; ++pub const SYS_landlock_restrict_self: c_long = 446; ++pub const SYS_memfd_secret: c_long = 447; ++pub const SYS_process_mrelease: c_long = 448; ++pub const SYS_futex_waitv: c_long = 449; ++pub const SYS_set_mempolicy_home_node: c_long = 450; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/uclibc/mips/mips32/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,695 @@ ++use crate::off64_t; ++use crate::prelude::*; ++ ++pub type c_char = i8; ++pub type c_long = i32; ++pub type c_ulong = u32; ++pub type clock_t = i32; ++pub type time_t = i32; ++pub type suseconds_t = i32; ++pub type wchar_t = i32; ++pub type off_t = i32; ++pub type ino_t = u32; ++pub type blkcnt_t = i32; ++pub type blksize_t = i32; ++pub type nlink_t = u32; ++pub type fsblkcnt_t = c_ulong; ++pub type fsfilcnt_t = c_ulong; ++pub type __u64 = c_ulonglong; ++pub type __s64 = c_longlong; ++pub type fsblkcnt64_t = u64; ++pub type fsfilcnt64_t = u64; ++ ++s! { ++ pub struct stat { ++ pub st_dev: crate::dev_t, ++ st_pad1: [c_long; 2], ++ pub st_ino: crate::ino_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ pub st_pad2: [c_long; 1], ++ pub st_size: off_t, ++ st_pad3: c_long, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt_t, ++ st_pad5: [c_long; 14], ++ } ++ ++ pub struct stat64 { ++ pub st_dev: crate::dev_t, ++ st_pad1: [c_long; 2], ++ pub st_ino: crate::ino64_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ st_pad2: [c_long; 2], ++ pub st_size: off64_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ pub st_blksize: crate::blksize_t, ++ st_pad3: c_long, ++ pub st_blocks: crate::blkcnt64_t, ++ st_pad5: [c_long; 14], ++ } ++ ++ pub struct statvfs64 { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: crate::fsblkcnt64_t, ++ pub f_bfree: crate::fsblkcnt64_t, ++ pub f_bavail: crate::fsblkcnt64_t, ++ pub f_files: crate::fsfilcnt64_t, ++ pub f_ffree: crate::fsfilcnt64_t, ++ pub f_favail: crate::fsfilcnt64_t, ++ pub f_fsid: c_ulong, ++ pub __f_unused: c_int, ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ pub __f_spare: [c_int; 6], ++ } ++ ++ pub struct pthread_attr_t { ++ __size: [u32; 9], ++ } ++ ++ pub struct sigaction { ++ pub sa_flags: c_uint, ++ pub sa_sigaction: crate::sighandler_t, ++ pub sa_mask: sigset_t, ++ _restorer: *mut c_void, ++ } ++ ++ pub struct stack_t { ++ pub ss_sp: *mut c_void, ++ pub ss_size: size_t, ++ pub ss_flags: c_int, ++ } ++ ++ pub struct sigset_t { ++ __val: [c_ulong; 4], ++ } ++ ++ pub struct siginfo_t { ++ pub si_signo: c_int, ++ pub si_code: c_int, ++ pub si_errno: c_int, ++ pub _pad: [c_int; 29], ++ } ++ ++ pub struct glob64_t { ++ pub gl_pathc: size_t, ++ pub gl_pathv: *mut *mut c_char, ++ pub gl_offs: size_t, ++ pub gl_flags: c_int, ++ ++ __unused1: *mut c_void, ++ __unused2: *mut c_void, ++ __unused3: *mut c_void, ++ __unused4: *mut c_void, ++ __unused5: *mut c_void, ++ } ++ ++ pub struct ipc_perm { ++ pub __key: crate::key_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub cuid: crate::uid_t, ++ pub cgid: crate::gid_t, ++ pub mode: c_uint, ++ pub __seq: c_ushort, ++ __pad1: c_ushort, ++ __unused1: c_ulong, ++ __unused2: c_ulong, ++ } ++ ++ pub struct shmid_ds { ++ pub shm_perm: crate::ipc_perm, ++ pub shm_segsz: size_t, ++ pub shm_atime: crate::time_t, ++ pub shm_dtime: crate::time_t, ++ pub shm_ctime: crate::time_t, ++ pub shm_cpid: crate::pid_t, ++ pub shm_lpid: crate::pid_t, ++ pub shm_nattch: crate::shmatt_t, ++ __unused4: c_ulong, ++ __unused5: c_ulong, ++ } ++ ++ pub struct msqid_ds { ++ pub msg_perm: crate::ipc_perm, ++ #[cfg(target_endian = "big")] ++ __glibc_reserved1: c_ulong, ++ pub msg_stime: crate::time_t, ++ #[cfg(target_endian = "little")] ++ __glibc_reserved1: c_ulong, ++ #[cfg(target_endian = "big")] ++ __glibc_reserved2: c_ulong, ++ pub msg_rtime: crate::time_t, ++ #[cfg(target_endian = "little")] ++ __glibc_reserved2: c_ulong, ++ #[cfg(target_endian = "big")] ++ __glibc_reserved3: c_ulong, ++ pub msg_ctime: crate::time_t, ++ #[cfg(target_endian = "little")] ++ __glibc_reserved3: c_ulong, ++ __msg_cbytes: c_ulong, ++ pub msg_qnum: crate::msgqnum_t, ++ pub msg_qbytes: crate::msglen_t, ++ pub msg_lspid: crate::pid_t, ++ pub msg_lrpid: crate::pid_t, ++ __glibc_reserved4: c_ulong, ++ __glibc_reserved5: c_ulong, ++ } ++ ++ pub struct statfs { ++ pub f_type: c_long, ++ pub f_bsize: c_long, ++ pub f_frsize: c_long, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_files: crate::fsblkcnt_t, ++ pub f_ffree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ pub f_fsid: crate::fsid_t, ++ ++ pub f_namelen: c_long, ++ f_spare: [c_long; 6], ++ } ++ ++ pub struct statfs64 { ++ pub f_type: c_long, ++ pub f_bsize: c_long, ++ pub f_frsize: c_long, ++ pub f_blocks: crate::fsblkcnt64_t, ++ pub f_bfree: crate::fsblkcnt64_t, ++ pub f_files: crate::fsblkcnt64_t, ++ pub f_ffree: crate::fsblkcnt64_t, ++ pub f_bavail: crate::fsblkcnt64_t, ++ pub f_fsid: crate::fsid_t, ++ pub f_namelen: c_long, ++ pub f_flags: c_long, ++ pub f_spare: [c_long; 5], ++ } ++ ++ pub struct msghdr { ++ pub msg_name: *mut c_void, ++ pub msg_namelen: crate::socklen_t, ++ pub msg_iov: *mut crate::iovec, ++ pub msg_iovlen: c_int, ++ pub msg_control: *mut c_void, ++ pub msg_controllen: size_t, ++ pub msg_flags: c_int, ++ } ++ ++ pub struct cmsghdr { ++ pub cmsg_len: size_t, ++ pub cmsg_level: c_int, ++ pub cmsg_type: c_int, ++ } ++ ++ pub struct termios { ++ pub c_iflag: crate::tcflag_t, ++ pub c_oflag: crate::tcflag_t, ++ pub c_cflag: crate::tcflag_t, ++ pub c_lflag: crate::tcflag_t, ++ pub c_line: crate::cc_t, ++ pub c_cc: [crate::cc_t; crate::NCCS], ++ } ++ ++ pub struct flock { ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ pub l_start: off_t, ++ pub l_len: off_t, ++ pub l_sysid: c_long, ++ pub l_pid: crate::pid_t, ++ pad: [c_long; 4], ++ } ++ ++ pub struct sysinfo { ++ pub uptime: c_long, ++ pub loads: [c_ulong; 3], ++ pub totalram: c_ulong, ++ pub freeram: c_ulong, ++ pub sharedram: c_ulong, ++ pub bufferram: c_ulong, ++ pub totalswap: c_ulong, ++ pub freeswap: c_ulong, ++ pub procs: c_ushort, ++ pub pad: c_ushort, ++ pub totalhigh: c_ulong, ++ pub freehigh: c_ulong, ++ pub mem_unit: c_uint, ++ pub _f: [c_char; 8], ++ } ++ ++ // FIXME(1.0): this is actually a union ++ #[cfg_attr(target_pointer_width = "32", repr(align(4)))] ++ #[cfg_attr(target_pointer_width = "64", repr(align(8)))] ++ pub struct sem_t { ++ #[cfg(target_pointer_width = "32")] ++ __size: [c_char; 16], ++ #[cfg(target_pointer_width = "64")] ++ __size: [c_char; 32], ++ } ++} ++ ++pub const __SIZEOF_PTHREAD_ATTR_T: usize = 36; ++pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 24; ++pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; ++pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; ++pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 32; ++pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8; ++pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 20; ++pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4; ++ ++pub const SYS_syscall: c_long = 4000 + 0; ++pub const SYS_exit: c_long = 4000 + 1; ++pub const SYS_fork: c_long = 4000 + 2; ++pub const SYS_read: c_long = 4000 + 3; ++pub const SYS_write: c_long = 4000 + 4; ++pub const SYS_open: c_long = 4000 + 5; ++pub const SYS_close: c_long = 4000 + 6; ++pub const SYS_waitpid: c_long = 4000 + 7; ++pub const SYS_creat: c_long = 4000 + 8; ++pub const SYS_link: c_long = 4000 + 9; ++pub const SYS_unlink: c_long = 4000 + 10; ++pub const SYS_execve: c_long = 4000 + 11; ++pub const SYS_chdir: c_long = 4000 + 12; ++pub const SYS_time: c_long = 4000 + 13; ++pub const SYS_mknod: c_long = 4000 + 14; ++pub const SYS_chmod: c_long = 4000 + 15; ++pub const SYS_lchown: c_long = 4000 + 16; ++pub const SYS_break: c_long = 4000 + 17; ++pub const SYS_lseek: c_long = 4000 + 19; ++pub const SYS_getpid: c_long = 4000 + 20; ++pub const SYS_mount: c_long = 4000 + 21; ++pub const SYS_umount: c_long = 4000 + 22; ++pub const SYS_setuid: c_long = 4000 + 23; ++pub const SYS_getuid: c_long = 4000 + 24; ++pub const SYS_stime: c_long = 4000 + 25; ++pub const SYS_ptrace: c_long = 4000 + 26; ++pub const SYS_alarm: c_long = 4000 + 27; ++pub const SYS_pause: c_long = 4000 + 29; ++pub const SYS_utime: c_long = 4000 + 30; ++pub const SYS_stty: c_long = 4000 + 31; ++pub const SYS_gtty: c_long = 4000 + 32; ++pub const SYS_access: c_long = 4000 + 33; ++pub const SYS_nice: c_long = 4000 + 34; ++pub const SYS_ftime: c_long = 4000 + 35; ++pub const SYS_sync: c_long = 4000 + 36; ++pub const SYS_kill: c_long = 4000 + 37; ++pub const SYS_rename: c_long = 4000 + 38; ++pub const SYS_mkdir: c_long = 4000 + 39; ++pub const SYS_rmdir: c_long = 4000 + 40; ++pub const SYS_dup: c_long = 4000 + 41; ++pub const SYS_pipe: c_long = 4000 + 42; ++pub const SYS_times: c_long = 4000 + 43; ++pub const SYS_prof: c_long = 4000 + 44; ++pub const SYS_brk: c_long = 4000 + 45; ++pub const SYS_setgid: c_long = 4000 + 46; ++pub const SYS_getgid: c_long = 4000 + 47; ++pub const SYS_signal: c_long = 4000 + 48; ++pub const SYS_geteuid: c_long = 4000 + 49; ++pub const SYS_getegid: c_long = 4000 + 50; ++pub const SYS_acct: c_long = 4000 + 51; ++pub const SYS_umount2: c_long = 4000 + 52; ++pub const SYS_lock: c_long = 4000 + 53; ++pub const SYS_ioctl: c_long = 4000 + 54; ++pub const SYS_fcntl: c_long = 4000 + 55; ++pub const SYS_mpx: c_long = 4000 + 56; ++pub const SYS_setpgid: c_long = 4000 + 57; ++pub const SYS_ulimit: c_long = 4000 + 58; ++pub const SYS_umask: c_long = 4000 + 60; ++pub const SYS_chroot: c_long = 4000 + 61; ++pub const SYS_ustat: c_long = 4000 + 62; ++pub const SYS_dup2: c_long = 4000 + 63; ++pub const SYS_getppid: c_long = 4000 + 64; ++pub const SYS_getpgrp: c_long = 4000 + 65; ++pub const SYS_setsid: c_long = 4000 + 66; ++pub const SYS_sigaction: c_long = 4000 + 67; ++pub const SYS_sgetmask: c_long = 4000 + 68; ++pub const SYS_ssetmask: c_long = 4000 + 69; ++pub const SYS_setreuid: c_long = 4000 + 70; ++pub const SYS_setregid: c_long = 4000 + 71; ++pub const SYS_sigsuspend: c_long = 4000 + 72; ++pub const SYS_sigpending: c_long = 4000 + 73; ++pub const SYS_sethostname: c_long = 4000 + 74; ++pub const SYS_setrlimit: c_long = 4000 + 75; ++pub const SYS_getrlimit: c_long = 4000 + 76; ++pub const SYS_getrusage: c_long = 4000 + 77; ++pub const SYS_gettimeofday: c_long = 4000 + 78; ++pub const SYS_settimeofday: c_long = 4000 + 79; ++pub const SYS_getgroups: c_long = 4000 + 80; ++pub const SYS_setgroups: c_long = 4000 + 81; ++pub const SYS_symlink: c_long = 4000 + 83; ++pub const SYS_readlink: c_long = 4000 + 85; ++pub const SYS_uselib: c_long = 4000 + 86; ++pub const SYS_swapon: c_long = 4000 + 87; ++pub const SYS_reboot: c_long = 4000 + 88; ++pub const SYS_readdir: c_long = 4000 + 89; ++pub const SYS_mmap: c_long = 4000 + 90; ++pub const SYS_munmap: c_long = 4000 + 91; ++pub const SYS_truncate: c_long = 4000 + 92; ++pub const SYS_ftruncate: c_long = 4000 + 93; ++pub const SYS_fchmod: c_long = 4000 + 94; ++pub const SYS_fchown: c_long = 4000 + 95; ++pub const SYS_getpriority: c_long = 4000 + 96; ++pub const SYS_setpriority: c_long = 4000 + 97; ++pub const SYS_profil: c_long = 4000 + 98; ++pub const SYS_statfs: c_long = 4000 + 99; ++pub const SYS_fstatfs: c_long = 4000 + 100; ++pub const SYS_ioperm: c_long = 4000 + 101; ++pub const SYS_socketcall: c_long = 4000 + 102; ++pub const SYS_syslog: c_long = 4000 + 103; ++pub const SYS_setitimer: c_long = 4000 + 104; ++pub const SYS_getitimer: c_long = 4000 + 105; ++pub const SYS_stat: c_long = 4000 + 106; ++pub const SYS_lstat: c_long = 4000 + 107; ++pub const SYS_fstat: c_long = 4000 + 108; ++pub const SYS_iopl: c_long = 4000 + 110; ++pub const SYS_vhangup: c_long = 4000 + 111; ++pub const SYS_idle: c_long = 4000 + 112; ++pub const SYS_vm86: c_long = 4000 + 113; ++pub const SYS_wait4: c_long = 4000 + 114; ++pub const SYS_swapoff: c_long = 4000 + 115; ++pub const SYS_sysinfo: c_long = 4000 + 116; ++pub const SYS_ipc: c_long = 4000 + 117; ++pub const SYS_fsync: c_long = 4000 + 118; ++pub const SYS_sigreturn: c_long = 4000 + 119; ++pub const SYS_clone: c_long = 4000 + 120; ++pub const SYS_setdomainname: c_long = 4000 + 121; ++pub const SYS_uname: c_long = 4000 + 122; ++pub const SYS_modify_ldt: c_long = 4000 + 123; ++pub const SYS_adjtimex: c_long = 4000 + 124; ++pub const SYS_mprotect: c_long = 4000 + 125; ++pub const SYS_sigprocmask: c_long = 4000 + 126; ++pub const SYS_create_module: c_long = 4000 + 127; ++pub const SYS_init_module: c_long = 4000 + 128; ++pub const SYS_delete_module: c_long = 4000 + 129; ++pub const SYS_get_kernel_syms: c_long = 4000 + 130; ++pub const SYS_quotactl: c_long = 4000 + 131; ++pub const SYS_getpgid: c_long = 4000 + 132; ++pub const SYS_fchdir: c_long = 4000 + 133; ++pub const SYS_bdflush: c_long = 4000 + 134; ++pub const SYS_sysfs: c_long = 4000 + 135; ++pub const SYS_personality: c_long = 4000 + 136; ++pub const SYS_afs_syscall: c_long = 4000 + 137; ++pub const SYS_setfsuid: c_long = 4000 + 138; ++pub const SYS_setfsgid: c_long = 4000 + 139; ++pub const SYS__llseek: c_long = 4000 + 140; ++pub const SYS_getdents: c_long = 4000 + 141; ++pub const SYS__newselect: c_long = 4000 + 142; ++pub const SYS_flock: c_long = 4000 + 143; ++pub const SYS_msync: c_long = 4000 + 144; ++pub const SYS_readv: c_long = 4000 + 145; ++pub const SYS_writev: c_long = 4000 + 146; ++pub const SYS_cacheflush: c_long = 4000 + 147; ++pub const SYS_cachectl: c_long = 4000 + 148; ++pub const SYS_sysmips: c_long = 4000 + 149; ++pub const SYS_getsid: c_long = 4000 + 151; ++pub const SYS_fdatasync: c_long = 4000 + 152; ++pub const SYS__sysctl: c_long = 4000 + 153; ++pub const SYS_mlock: c_long = 4000 + 154; ++pub const SYS_munlock: c_long = 4000 + 155; ++pub const SYS_mlockall: c_long = 4000 + 156; ++pub const SYS_munlockall: c_long = 4000 + 157; ++pub const SYS_sched_setparam: c_long = 4000 + 158; ++pub const SYS_sched_getparam: c_long = 4000 + 159; ++pub const SYS_sched_setscheduler: c_long = 4000 + 160; ++pub const SYS_sched_getscheduler: c_long = 4000 + 161; ++pub const SYS_sched_yield: c_long = 4000 + 162; ++pub const SYS_sched_get_priority_max: c_long = 4000 + 163; ++pub const SYS_sched_get_priority_min: c_long = 4000 + 164; ++pub const SYS_sched_rr_get_interval: c_long = 4000 + 165; ++pub const SYS_nanosleep: c_long = 4000 + 166; ++pub const SYS_mremap: c_long = 4000 + 167; ++pub const SYS_accept: c_long = 4000 + 168; ++pub const SYS_bind: c_long = 4000 + 169; ++pub const SYS_connect: c_long = 4000 + 170; ++pub const SYS_getpeername: c_long = 4000 + 171; ++pub const SYS_getsockname: c_long = 4000 + 172; ++pub const SYS_getsockopt: c_long = 4000 + 173; ++pub const SYS_listen: c_long = 4000 + 174; ++pub const SYS_recv: c_long = 4000 + 175; ++pub const SYS_recvfrom: c_long = 4000 + 176; ++pub const SYS_recvmsg: c_long = 4000 + 177; ++pub const SYS_send: c_long = 4000 + 178; ++pub const SYS_sendmsg: c_long = 4000 + 179; ++pub const SYS_sendto: c_long = 4000 + 180; ++pub const SYS_setsockopt: c_long = 4000 + 181; ++pub const SYS_shutdown: c_long = 4000 + 182; ++pub const SYS_socket: c_long = 4000 + 183; ++pub const SYS_socketpair: c_long = 4000 + 184; ++pub const SYS_setresuid: c_long = 4000 + 185; ++pub const SYS_getresuid: c_long = 4000 + 186; ++pub const SYS_query_module: c_long = 4000 + 187; ++pub const SYS_poll: c_long = 4000 + 188; ++pub const SYS_nfsservctl: c_long = 4000 + 189; ++pub const SYS_setresgid: c_long = 4000 + 190; ++pub const SYS_getresgid: c_long = 4000 + 191; ++pub const SYS_prctl: c_long = 4000 + 192; ++pub const SYS_rt_sigreturn: c_long = 4000 + 193; ++pub const SYS_rt_sigaction: c_long = 4000 + 194; ++pub const SYS_rt_sigprocmask: c_long = 4000 + 195; ++pub const SYS_rt_sigpending: c_long = 4000 + 196; ++pub const SYS_rt_sigtimedwait: c_long = 4000 + 197; ++pub const SYS_rt_sigqueueinfo: c_long = 4000 + 198; ++pub const SYS_rt_sigsuspend: c_long = 4000 + 199; ++pub const SYS_pread64: c_long = 4000 + 200; ++pub const SYS_pwrite64: c_long = 4000 + 201; ++pub const SYS_chown: c_long = 4000 + 202; ++pub const SYS_getcwd: c_long = 4000 + 203; ++pub const SYS_capget: c_long = 4000 + 204; ++pub const SYS_capset: c_long = 4000 + 205; ++pub const SYS_sigaltstack: c_long = 4000 + 206; ++pub const SYS_sendfile: c_long = 4000 + 207; ++pub const SYS_getpmsg: c_long = 4000 + 208; ++pub const SYS_putpmsg: c_long = 4000 + 209; ++pub const SYS_mmap2: c_long = 4000 + 210; ++pub const SYS_truncate64: c_long = 4000 + 211; ++pub const SYS_ftruncate64: c_long = 4000 + 212; ++pub const SYS_stat64: c_long = 4000 + 213; ++pub const SYS_lstat64: c_long = 4000 + 214; ++pub const SYS_fstat64: c_long = 4000 + 215; ++pub const SYS_pivot_root: c_long = 4000 + 216; ++pub const SYS_mincore: c_long = 4000 + 217; ++pub const SYS_madvise: c_long = 4000 + 218; ++pub const SYS_getdents64: c_long = 4000 + 219; ++pub const SYS_fcntl64: c_long = 4000 + 220; ++pub const SYS_gettid: c_long = 4000 + 222; ++pub const SYS_readahead: c_long = 4000 + 223; ++pub const SYS_setxattr: c_long = 4000 + 224; ++pub const SYS_lsetxattr: c_long = 4000 + 225; ++pub const SYS_fsetxattr: c_long = 4000 + 226; ++pub const SYS_getxattr: c_long = 4000 + 227; ++pub const SYS_lgetxattr: c_long = 4000 + 228; ++pub const SYS_fgetxattr: c_long = 4000 + 229; ++pub const SYS_listxattr: c_long = 4000 + 230; ++pub const SYS_llistxattr: c_long = 4000 + 231; ++pub const SYS_flistxattr: c_long = 4000 + 232; ++pub const SYS_removexattr: c_long = 4000 + 233; ++pub const SYS_lremovexattr: c_long = 4000 + 234; ++pub const SYS_fremovexattr: c_long = 4000 + 235; ++pub const SYS_tkill: c_long = 4000 + 236; ++pub const SYS_sendfile64: c_long = 4000 + 237; ++pub const SYS_futex: c_long = 4000 + 238; ++pub const SYS_sched_setaffinity: c_long = 4000 + 239; ++pub const SYS_sched_getaffinity: c_long = 4000 + 240; ++pub const SYS_io_setup: c_long = 4000 + 241; ++pub const SYS_io_destroy: c_long = 4000 + 242; ++pub const SYS_io_getevents: c_long = 4000 + 243; ++pub const SYS_io_submit: c_long = 4000 + 244; ++pub const SYS_io_cancel: c_long = 4000 + 245; ++pub const SYS_exit_group: c_long = 4000 + 246; ++pub const SYS_lookup_dcookie: c_long = 4000 + 247; ++pub const SYS_epoll_create: c_long = 4000 + 248; ++pub const SYS_epoll_ctl: c_long = 4000 + 249; ++pub const SYS_epoll_wait: c_long = 4000 + 250; ++pub const SYS_remap_file_pages: c_long = 4000 + 251; ++pub const SYS_set_tid_address: c_long = 4000 + 252; ++pub const SYS_restart_syscall: c_long = 4000 + 253; ++pub const SYS_fadvise64: c_long = 4000 + 254; ++pub const SYS_statfs64: c_long = 4000 + 255; ++pub const SYS_fstatfs64: c_long = 4000 + 256; ++pub const SYS_timer_create: c_long = 4000 + 257; ++pub const SYS_timer_settime: c_long = 4000 + 258; ++pub const SYS_timer_gettime: c_long = 4000 + 259; ++pub const SYS_timer_getoverrun: c_long = 4000 + 260; ++pub const SYS_timer_delete: c_long = 4000 + 261; ++pub const SYS_clock_settime: c_long = 4000 + 262; ++pub const SYS_clock_gettime: c_long = 4000 + 263; ++pub const SYS_clock_getres: c_long = 4000 + 264; ++pub const SYS_clock_nanosleep: c_long = 4000 + 265; ++pub const SYS_tgkill: c_long = 4000 + 266; ++pub const SYS_utimes: c_long = 4000 + 267; ++pub const SYS_mbind: c_long = 4000 + 268; ++pub const SYS_get_mempolicy: c_long = 4000 + 269; ++pub const SYS_set_mempolicy: c_long = 4000 + 270; ++pub const SYS_mq_open: c_long = 4000 + 271; ++pub const SYS_mq_unlink: c_long = 4000 + 272; ++pub const SYS_mq_timedsend: c_long = 4000 + 273; ++pub const SYS_mq_timedreceive: c_long = 4000 + 274; ++pub const SYS_mq_notify: c_long = 4000 + 275; ++pub const SYS_mq_getsetattr: c_long = 4000 + 276; ++pub const SYS_vserver: c_long = 4000 + 277; ++pub const SYS_waitid: c_long = 4000 + 278; ++/* pub const SYS_sys_setaltroot: c_long = 4000 + 279; */ ++pub const SYS_add_key: c_long = 4000 + 280; ++pub const SYS_request_key: c_long = 4000 + 281; ++pub const SYS_keyctl: c_long = 4000 + 282; ++pub const SYS_set_thread_area: c_long = 4000 + 283; ++pub const SYS_inotify_init: c_long = 4000 + 284; ++pub const SYS_inotify_add_watch: c_long = 4000 + 285; ++pub const SYS_inotify_rm_watch: c_long = 4000 + 286; ++pub const SYS_migrate_pages: c_long = 4000 + 287; ++pub const SYS_openat: c_long = 4000 + 288; ++pub const SYS_mkdirat: c_long = 4000 + 289; ++pub const SYS_mknodat: c_long = 4000 + 290; ++pub const SYS_fchownat: c_long = 4000 + 291; ++pub const SYS_futimesat: c_long = 4000 + 292; ++pub const SYS_fstatat64: c_long = 4000 + 293; ++pub const SYS_unlinkat: c_long = 4000 + 294; ++pub const SYS_renameat: c_long = 4000 + 295; ++pub const SYS_linkat: c_long = 4000 + 296; ++pub const SYS_symlinkat: c_long = 4000 + 297; ++pub const SYS_readlinkat: c_long = 4000 + 298; ++pub const SYS_fchmodat: c_long = 4000 + 299; ++pub const SYS_faccessat: c_long = 4000 + 300; ++pub const SYS_pselect6: c_long = 4000 + 301; ++pub const SYS_ppoll: c_long = 4000 + 302; ++pub const SYS_unshare: c_long = 4000 + 303; ++pub const SYS_splice: c_long = 4000 + 304; ++pub const SYS_sync_file_range: c_long = 4000 + 305; ++pub const SYS_tee: c_long = 4000 + 306; ++pub const SYS_vmsplice: c_long = 4000 + 307; ++pub const SYS_move_pages: c_long = 4000 + 308; ++pub const SYS_set_robust_list: c_long = 4000 + 309; ++pub const SYS_get_robust_list: c_long = 4000 + 310; ++pub const SYS_kexec_load: c_long = 4000 + 311; ++pub const SYS_getcpu: c_long = 4000 + 312; ++pub const SYS_epoll_pwait: c_long = 4000 + 313; ++pub const SYS_ioprio_set: c_long = 4000 + 314; ++pub const SYS_ioprio_get: c_long = 4000 + 315; ++pub const SYS_utimensat: c_long = 4000 + 316; ++pub const SYS_signalfd: c_long = 4000 + 317; ++pub const SYS_timerfd: c_long = 4000 + 318; ++pub const SYS_eventfd: c_long = 4000 + 319; ++pub const SYS_fallocate: c_long = 4000 + 320; ++pub const SYS_timerfd_create: c_long = 4000 + 321; ++pub const SYS_timerfd_gettime: c_long = 4000 + 322; ++pub const SYS_timerfd_settime: c_long = 4000 + 323; ++pub const SYS_signalfd4: c_long = 4000 + 324; ++pub const SYS_eventfd2: c_long = 4000 + 325; ++pub const SYS_epoll_create1: c_long = 4000 + 326; ++pub const SYS_dup3: c_long = 4000 + 327; ++pub const SYS_pipe2: c_long = 4000 + 328; ++pub const SYS_inotify_init1: c_long = 4000 + 329; ++pub const SYS_preadv: c_long = 4000 + 330; ++pub const SYS_pwritev: c_long = 4000 + 331; ++pub const SYS_rt_tgsigqueueinfo: c_long = 4000 + 332; ++pub const SYS_perf_event_open: c_long = 4000 + 333; ++pub const SYS_accept4: c_long = 4000 + 334; ++pub const SYS_recvmmsg: c_long = 4000 + 335; ++pub const SYS_fanotify_init: c_long = 4000 + 336; ++pub const SYS_fanotify_mark: c_long = 4000 + 337; ++pub const SYS_prlimit64: c_long = 4000 + 338; ++pub const SYS_name_to_handle_at: c_long = 4000 + 339; ++pub const SYS_open_by_handle_at: c_long = 4000 + 340; ++pub const SYS_clock_adjtime: c_long = 4000 + 341; ++pub const SYS_syncfs: c_long = 4000 + 342; ++pub const SYS_sendmmsg: c_long = 4000 + 343; ++pub const SYS_setns: c_long = 4000 + 344; ++pub const SYS_process_vm_readv: c_long = 4000 + 345; ++pub const SYS_process_vm_writev: c_long = 4000 + 346; ++pub const SYS_kcmp: c_long = 4000 + 347; ++pub const SYS_finit_module: c_long = 4000 + 348; ++pub const SYS_sched_setattr: c_long = 4000 + 349; ++pub const SYS_sched_getattr: c_long = 4000 + 350; ++pub const SYS_renameat2: c_long = 4000 + 351; ++pub const SYS_seccomp: c_long = 4000 + 352; ++pub const SYS_getrandom: c_long = 4000 + 353; ++pub const SYS_memfd_create: c_long = 4000 + 354; ++pub const SYS_bpf: c_long = 4000 + 355; ++pub const SYS_execveat: c_long = 4000 + 356; ++pub const SYS_userfaultfd: c_long = 4000 + 357; ++pub const SYS_membarrier: c_long = 4000 + 358; ++pub const SYS_mlock2: c_long = 4000 + 359; ++pub const SYS_copy_file_range: c_long = 4000 + 360; ++pub const SYS_preadv2: c_long = 4000 + 361; ++pub const SYS_pwritev2: c_long = 4000 + 362; ++pub const SYS_pkey_mprotect: c_long = 4000 + 363; ++pub const SYS_pkey_alloc: c_long = 4000 + 364; ++pub const SYS_pkey_free: c_long = 4000 + 365; ++pub const SYS_statx: c_long = 4000 + 366; ++pub const SYS_pidfd_send_signal: c_long = 4000 + 424; ++pub const SYS_io_uring_setup: c_long = 4000 + 425; ++pub const SYS_io_uring_enter: c_long = 4000 + 426; ++pub const SYS_io_uring_register: c_long = 4000 + 427; ++pub const SYS_open_tree: c_long = 4000 + 428; ++pub const SYS_move_mount: c_long = 4000 + 429; ++pub const SYS_fsopen: c_long = 4000 + 430; ++pub const SYS_fsconfig: c_long = 4000 + 431; ++pub const SYS_fsmount: c_long = 4000 + 432; ++pub const SYS_fspick: c_long = 4000 + 433; ++pub const SYS_pidfd_open: c_long = 4000 + 434; ++pub const SYS_clone3: c_long = 4000 + 435; ++pub const SYS_close_range: c_long = 4000 + 436; ++pub const SYS_openat2: c_long = 4000 + 437; ++pub const SYS_pidfd_getfd: c_long = 4000 + 438; ++pub const SYS_faccessat2: c_long = 4000 + 439; ++pub const SYS_process_madvise: c_long = 4000 + 440; ++pub const SYS_epoll_pwait2: c_long = 4000 + 441; ++pub const SYS_mount_setattr: c_long = 4000 + 442; ++pub const SYS_quotactl_fd: c_long = 4000 + 443; ++pub const SYS_landlock_create_ruleset: c_long = 4000 + 444; ++pub const SYS_landlock_add_rule: c_long = 4000 + 445; ++pub const SYS_landlock_restrict_self: c_long = 4000 + 446; ++pub const SYS_memfd_secret: c_long = 4000 + 447; ++pub const SYS_process_mrelease: c_long = 4000 + 448; ++pub const SYS_futex_waitv: c_long = 4000 + 449; ++pub const SYS_set_mempolicy_home_node: c_long = 4000 + 450; ++ ++#[link(name = "util")] ++extern "C" { ++ pub fn sysctl( ++ name: *mut c_int, ++ namelen: c_int, ++ oldp: *mut c_void, ++ oldlenp: *mut size_t, ++ newp: *mut c_void, ++ newlen: size_t, ++ ) -> c_int; ++ pub fn glob64( ++ pattern: *const c_char, ++ flags: c_int, ++ errfunc: Option c_int>, ++ pglob: *mut glob64_t, ++ ) -> c_int; ++ pub fn globfree64(pglob: *mut glob64_t); ++ pub fn pthread_attr_getaffinity_np( ++ attr: *const crate::pthread_attr_t, ++ cpusetsize: size_t, ++ cpuset: *mut crate::cpu_set_t, ++ ) -> c_int; ++ pub fn pthread_attr_setaffinity_np( ++ attr: *mut crate::pthread_attr_t, ++ cpusetsize: size_t, ++ cpuset: *const crate::cpu_set_t, ++ ) -> c_int; ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/uclibc/mips/mips64/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,207 @@ ++use crate::off64_t; ++use crate::prelude::*; ++ ++pub type blkcnt_t = i64; ++pub type blksize_t = i64; ++pub type c_char = i8; ++pub type c_long = i64; ++pub type c_ulong = u64; ++pub type fsblkcnt_t = c_ulong; ++pub type fsfilcnt_t = c_ulong; ++pub type ino_t = u64; ++pub type nlink_t = u64; ++pub type off_t = i64; ++pub type suseconds_t = i64; ++pub type time_t = i64; ++pub type wchar_t = i32; ++ ++s! { ++ pub struct stat { ++ pub st_dev: c_ulong, ++ st_pad1: [c_long; 2], ++ pub st_ino: crate::ino_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: c_ulong, ++ st_pad2: [c_ulong; 1], ++ pub st_size: off_t, ++ st_pad3: c_long, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ pub st_blksize: crate::blksize_t, ++ st_pad4: c_long, ++ pub st_blocks: crate::blkcnt_t, ++ st_pad5: [c_long; 7], ++ } ++ ++ pub struct stat64 { ++ pub st_dev: c_ulong, ++ st_pad1: [c_long; 2], ++ pub st_ino: crate::ino64_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: c_ulong, ++ st_pad2: [c_long; 2], ++ pub st_size: off64_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ pub st_blksize: crate::blksize_t, ++ st_pad3: c_long, ++ pub st_blocks: crate::blkcnt64_t, ++ st_pad5: [c_long; 7], ++ } ++ ++ pub struct pthread_attr_t { ++ __size: [c_ulong; 7], ++ } ++ ++ pub struct sigaction { ++ pub sa_flags: c_int, ++ pub sa_sigaction: crate::sighandler_t, ++ pub sa_mask: sigset_t, ++ _restorer: *mut c_void, ++ } ++ ++ pub struct stack_t { ++ pub ss_sp: *mut c_void, ++ pub ss_size: size_t, ++ pub ss_flags: c_int, ++ } ++ ++ pub struct sigset_t { ++ __size: [c_ulong; 16], ++ } ++ ++ pub struct siginfo_t { ++ pub si_signo: c_int, ++ pub si_code: c_int, ++ pub si_errno: c_int, ++ _pad: c_int, ++ _pad2: [c_long; 14], ++ } ++ ++ pub struct ipc_perm { ++ pub __key: crate::key_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub cuid: crate::uid_t, ++ pub cgid: crate::gid_t, ++ pub mode: c_uint, ++ pub __seq: c_ushort, ++ __pad1: c_ushort, ++ __unused1: c_ulong, ++ __unused2: c_ulong, ++ } ++ ++ pub struct shmid_ds { ++ pub shm_perm: crate::ipc_perm, ++ pub shm_segsz: size_t, ++ pub shm_atime: crate::time_t, ++ pub shm_dtime: crate::time_t, ++ pub shm_ctime: crate::time_t, ++ pub shm_cpid: crate::pid_t, ++ pub shm_lpid: crate::pid_t, ++ pub shm_nattch: crate::shmatt_t, ++ __unused4: c_ulong, ++ __unused5: c_ulong, ++ } ++ ++ pub struct msqid_ds { ++ pub msg_perm: crate::ipc_perm, ++ pub msg_stime: crate::time_t, ++ pub msg_rtime: crate::time_t, ++ pub msg_ctime: crate::time_t, ++ __msg_cbytes: c_ulong, ++ pub msg_qnum: crate::msgqnum_t, ++ pub msg_qbytes: crate::msglen_t, ++ pub msg_lspid: crate::pid_t, ++ pub msg_lrpid: crate::pid_t, ++ __glibc_reserved4: c_ulong, ++ __glibc_reserved5: c_ulong, ++ } ++ ++ pub struct statfs { ++ pub f_type: c_long, ++ pub f_bsize: c_long, ++ pub f_frsize: c_long, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_files: crate::fsblkcnt_t, ++ pub f_ffree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ pub f_fsid: crate::fsid_t, ++ ++ pub f_namelen: c_long, ++ f_spare: [c_long; 6], ++ } ++ ++ pub struct msghdr { ++ pub msg_name: *mut c_void, ++ pub msg_namelen: crate::socklen_t, ++ pub msg_iov: *mut crate::iovec, ++ pub msg_iovlen: size_t, ++ pub msg_control: *mut c_void, ++ pub msg_controllen: size_t, ++ pub msg_flags: c_int, ++ } ++ ++ pub struct cmsghdr { ++ pub cmsg_len: size_t, ++ pub cmsg_level: c_int, ++ pub cmsg_type: c_int, ++ } ++ ++ pub struct termios { ++ pub c_iflag: crate::tcflag_t, ++ pub c_oflag: crate::tcflag_t, ++ pub c_cflag: crate::tcflag_t, ++ pub c_lflag: crate::tcflag_t, ++ pub c_line: crate::cc_t, ++ pub c_cc: [crate::cc_t; crate::NCCS], ++ } ++ ++ pub struct sysinfo { ++ pub uptime: c_long, ++ pub loads: [c_ulong; 3], ++ pub totalram: c_ulong, ++ pub freeram: c_ulong, ++ pub sharedram: c_ulong, ++ pub bufferram: c_ulong, ++ pub totalswap: c_ulong, ++ pub freeswap: c_ulong, ++ pub procs: c_ushort, ++ pub pad: c_ushort, ++ pub totalhigh: c_ulong, ++ pub freehigh: c_ulong, ++ pub mem_unit: c_uint, ++ pub _f: [c_char; 0], ++ } ++ ++ // FIXME(1.0): this is actually a union ++ #[cfg_attr(target_pointer_width = "32", repr(align(4)))] ++ #[cfg_attr(target_pointer_width = "64", repr(align(8)))] ++ pub struct sem_t { ++ __size: [c_char; 32], ++ } ++} ++ ++pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; ++pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; ++pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4; ++pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; ++pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; ++pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32; ++ ++pub const SYS_gettid: c_long = 5178; // Valid for n64 +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/uclibc/mips/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/uclibc/mips/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/uclibc/mips/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/uclibc/mips/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,312 @@ ++use crate::prelude::*; ++ ++pub type pthread_t = c_ulong; ++ ++pub const SFD_CLOEXEC: c_int = 0x080000; ++ ++pub const NCCS: usize = 32; ++ ++pub const O_TRUNC: c_int = 512; ++ ++pub const O_CLOEXEC: c_int = 0x80000; ++ ++pub const EBFONT: c_int = 59; ++pub const ENOSTR: c_int = 60; ++pub const ENODATA: c_int = 61; ++pub const ETIME: c_int = 62; ++pub const ENOSR: c_int = 63; ++pub const ENONET: c_int = 64; ++pub const ENOPKG: c_int = 65; ++pub const EREMOTE: c_int = 66; ++pub const ENOLINK: c_int = 67; ++pub const EADV: c_int = 68; ++pub const ESRMNT: c_int = 69; ++pub const ECOMM: c_int = 70; ++pub const EPROTO: c_int = 71; ++pub const EDOTDOT: c_int = 73; ++ ++pub const SA_NODEFER: c_uint = 0x40000000; ++pub const SA_RESETHAND: c_uint = 0x80000000; ++pub const SA_RESTART: c_uint = 0x10000000; ++pub const SA_NOCLDSTOP: c_uint = 0x00000001; ++ ++pub const EPOLL_CLOEXEC: c_int = 0x80000; ++ ++pub const EFD_CLOEXEC: c_int = 0x80000; ++ ++pub const TMP_MAX: c_uint = 238328; ++pub const _SC_2_C_VERSION: c_int = 96; ++pub const O_ACCMODE: c_int = 3; ++pub const O_DIRECT: c_int = 0x8000; ++pub const O_DIRECTORY: c_int = 0x10000; ++pub const O_NOFOLLOW: c_int = 0x20000; ++pub const O_NOATIME: c_int = 0x40000; ++pub const O_PATH: c_int = 0o010000000; ++ ++pub const O_APPEND: c_int = 8; ++pub const O_CREAT: c_int = 256; ++pub const O_EXCL: c_int = 1024; ++pub const O_NOCTTY: c_int = 2048; ++pub const O_NONBLOCK: c_int = 128; ++pub const O_SYNC: c_int = 0x10; ++pub const O_RSYNC: c_int = 0x10; ++pub const O_DSYNC: c_int = 0x10; ++pub const O_FSYNC: c_int = 0x10; ++pub const O_ASYNC: c_int = 0x1000; ++pub const O_LARGEFILE: c_int = 0x2000; ++pub const O_NDELAY: c_int = 0x80; ++ ++pub const SOCK_NONBLOCK: c_int = 128; ++pub const PIDFD_NONBLOCK: c_int = 128; ++ ++pub const EDEADLK: c_int = 45; ++pub const ENAMETOOLONG: c_int = 78; ++pub const ENOLCK: c_int = 46; ++pub const ENOSYS: c_int = 89; ++pub const ENOTEMPTY: c_int = 93; ++pub const ELOOP: c_int = 90; ++pub const ENOMSG: c_int = 35; ++pub const EIDRM: c_int = 36; ++pub const ECHRNG: c_int = 37; ++pub const EL2NSYNC: c_int = 38; ++pub const EL3HLT: c_int = 39; ++pub const EL3RST: c_int = 40; ++pub const ELNRNG: c_int = 41; ++pub const EUNATCH: c_int = 42; ++pub const ENOCSI: c_int = 43; ++pub const EL2HLT: c_int = 44; ++pub const EBADE: c_int = 50; ++pub const EBADR: c_int = 51; ++pub const EXFULL: c_int = 52; ++pub const FFDLY: c_int = 0o0100000; ++pub const ENOANO: c_int = 53; ++pub const EBADRQC: c_int = 54; ++pub const EBADSLT: c_int = 55; ++pub const EMULTIHOP: c_int = 74; ++pub const EOVERFLOW: c_int = 79; ++pub const ENOTUNIQ: c_int = 80; ++pub const EBADFD: c_int = 81; ++pub const EBADMSG: c_int = 77; ++pub const EREMCHG: c_int = 82; ++pub const ELIBACC: c_int = 83; ++pub const ELIBBAD: c_int = 84; ++pub const ELIBSCN: c_int = 85; ++pub const ELIBMAX: c_int = 86; ++pub const ELIBEXEC: c_int = 87; ++pub const EILSEQ: c_int = 88; ++pub const ERESTART: c_int = 91; ++pub const ESTRPIPE: c_int = 92; ++pub const EUSERS: c_int = 94; ++pub const ENOTSOCK: c_int = 95; ++pub const EDESTADDRREQ: c_int = 96; ++pub const EMSGSIZE: c_int = 97; ++pub const EPROTOTYPE: c_int = 98; ++pub const ENOPROTOOPT: c_int = 99; ++pub const EPROTONOSUPPORT: c_int = 120; ++pub const ESOCKTNOSUPPORT: c_int = 121; ++pub const EOPNOTSUPP: c_int = 122; ++pub const EPFNOSUPPORT: c_int = 123; ++pub const EAFNOSUPPORT: c_int = 124; ++pub const EADDRINUSE: c_int = 125; ++pub const EADDRNOTAVAIL: c_int = 126; ++pub const ENETDOWN: c_int = 127; ++pub const ENETUNREACH: c_int = 128; ++pub const ENETRESET: c_int = 129; ++pub const ECONNABORTED: c_int = 130; ++pub const ECONNRESET: c_int = 131; ++pub const ENOBUFS: c_int = 132; ++pub const EISCONN: c_int = 133; ++pub const ENOTCONN: c_int = 134; ++pub const ESHUTDOWN: c_int = 143; ++pub const ETOOMANYREFS: c_int = 144; ++pub const ETIMEDOUT: c_int = 145; ++pub const ECONNREFUSED: c_int = 146; ++pub const EHOSTDOWN: c_int = 147; ++pub const EHOSTUNREACH: c_int = 148; ++pub const EALREADY: c_int = 149; ++pub const EINPROGRESS: c_int = 150; ++pub const ESTALE: c_int = 151; ++pub const EUCLEAN: c_int = 135; ++pub const ENOTNAM: c_int = 137; ++pub const ENAVAIL: c_int = 138; ++pub const EISNAM: c_int = 139; ++pub const EREMOTEIO: c_int = 140; ++pub const EDQUOT: c_int = 1133; ++pub const ENOMEDIUM: c_int = 159; ++pub const EMEDIUMTYPE: c_int = 160; ++pub const ECANCELED: c_int = 158; ++pub const ENOKEY: c_int = 161; ++pub const EKEYEXPIRED: c_int = 162; ++pub const EKEYREVOKED: c_int = 163; ++pub const EKEYREJECTED: c_int = 164; ++pub const EOWNERDEAD: c_int = 165; ++pub const ENOTRECOVERABLE: c_int = 166; ++pub const ERFKILL: c_int = 167; ++ ++pub const MAP_NORESERVE: c_int = 0x400; ++pub const MAP_ANON: c_int = 0x800; ++pub const MAP_ANONYMOUS: c_int = 0x800; ++pub const MAP_GROWSDOWN: c_int = 0x1000; ++pub const MAP_DENYWRITE: c_int = 0x2000; ++pub const MAP_EXECUTABLE: c_int = 0x4000; ++pub const MAP_LOCKED: c_int = 0x8000; ++pub const MAP_POPULATE: c_int = 0x10000; ++pub const MAP_NONBLOCK: c_int = 0x20000; ++pub const MAP_STACK: c_int = 0x40000; ++ ++pub const NLDLY: crate::tcflag_t = 0o0000400; ++ ++pub const SOCK_STREAM: c_int = 2; ++pub const SOCK_DGRAM: c_int = 1; ++pub const SOCK_SEQPACKET: c_int = 5; ++ ++pub const SA_ONSTACK: c_uint = 0x08000000; ++pub const SA_SIGINFO: c_uint = 0x00000008; ++pub const SA_NOCLDWAIT: c_int = 0x00010000; ++ ++pub const SIGCHLD: c_int = 18; ++pub const SIGBUS: c_int = 10; ++pub const SIGTTIN: c_int = 26; ++pub const SIGTTOU: c_int = 27; ++pub const SIGXCPU: c_int = 30; ++pub const SIGXFSZ: c_int = 31; ++pub const SIGVTALRM: c_int = 28; ++pub const SIGPROF: c_int = 29; ++pub const SIGWINCH: c_int = 20; ++pub const SIGUSR1: c_int = 16; ++pub const SIGUSR2: c_int = 17; ++pub const SIGCONT: c_int = 25; ++pub const SIGSTOP: c_int = 23; ++pub const SIGTSTP: c_int = 24; ++pub const SIGURG: c_int = 21; ++pub const SIGIO: c_int = 22; ++pub const SIGSYS: c_int = 12; ++pub const SIGPWR: c_int = 19; ++pub const SIG_SETMASK: c_int = 3; ++pub const SIG_BLOCK: c_int = 0x1; ++pub const SIG_UNBLOCK: c_int = 0x2; ++ ++pub const POLLWRNORM: c_short = 0x004; ++pub const POLLWRBAND: c_short = 0x100; ++ ++pub const PTHREAD_STACK_MIN: size_t = 16384; ++ ++pub const VEOF: usize = 16; ++pub const VEOL: usize = 17; ++pub const VEOL2: usize = 6; ++pub const VMIN: usize = 4; ++pub const IEXTEN: crate::tcflag_t = 0x00000100; ++pub const TOSTOP: crate::tcflag_t = 0x00008000; ++pub const FLUSHO: crate::tcflag_t = 0x00002000; ++pub const TCSANOW: c_int = 0x540e; ++pub const TCSADRAIN: c_int = 0x540f; ++pub const TCSAFLUSH: c_int = 0x5410; ++ ++pub const CPU_SETSIZE: c_int = 0x400; ++ ++pub const EFD_NONBLOCK: c_int = 0x80; ++ ++pub const F_GETLK: c_int = 14; ++pub const F_SETLK: c_int = 6; ++pub const F_SETLKW: c_int = 7; ++ ++pub const SFD_NONBLOCK: c_int = 0x80; ++ ++pub const RTLD_GLOBAL: c_int = 0x4; ++ ++pub const SIGSTKSZ: size_t = 8192; ++pub const CBAUD: crate::tcflag_t = 0o0010017; ++pub const CBAUDEX: crate::tcflag_t = 0o0010000; ++pub const CIBAUD: crate::tcflag_t = 0o002003600000; ++pub const TAB1: crate::tcflag_t = 0x00000800; ++pub const TAB2: crate::tcflag_t = 0x00001000; ++pub const TAB3: crate::tcflag_t = 0x00001800; ++pub const TABDLY: crate::tcflag_t = 0o0014000; ++pub const CR1: crate::tcflag_t = 0x00000200; ++pub const CR2: crate::tcflag_t = 0x00000400; ++pub const CR3: crate::tcflag_t = 0x00000600; ++pub const FF1: crate::tcflag_t = 0x00008000; ++pub const BS1: crate::tcflag_t = 0x00002000; ++pub const BSDLY: crate::tcflag_t = 0o0020000; ++pub const VT1: crate::tcflag_t = 0x00004000; ++pub const VWERASE: usize = 14; ++pub const XTABS: crate::tcflag_t = 0o0014000; ++pub const VREPRINT: usize = 12; ++pub const VSUSP: usize = 10; ++pub const VSWTC: usize = 7; ++pub const VTDLY: c_int = 0o0040000; ++pub const VSTART: usize = 8; ++pub const VSTOP: usize = 9; ++pub const VDISCARD: usize = 13; ++pub const VTIME: usize = 5; ++pub const IXON: crate::tcflag_t = 0x00000400; ++pub const IXOFF: crate::tcflag_t = 0x00001000; ++pub const OLCUC: crate::tcflag_t = 0o0000002; ++pub const ONLCR: crate::tcflag_t = 0x4; ++pub const CSIZE: crate::tcflag_t = 0x00000030; ++pub const CS6: crate::tcflag_t = 0x00000010; ++pub const CS7: crate::tcflag_t = 0x00000020; ++pub const CS8: crate::tcflag_t = 0x00000030; ++pub const CSTOPB: crate::tcflag_t = 0x00000040; ++pub const CRDLY: c_int = 0o0003000; ++pub const CREAD: crate::tcflag_t = 0x00000080; ++pub const PARENB: crate::tcflag_t = 0x00000100; ++pub const PARODD: crate::tcflag_t = 0x00000200; ++pub const HUPCL: crate::tcflag_t = 0x00000400; ++pub const CLOCAL: crate::tcflag_t = 0x00000800; ++pub const ECHOKE: crate::tcflag_t = 0x00000800; ++pub const ECHOE: crate::tcflag_t = 0x00000010; ++pub const ECHOK: crate::tcflag_t = 0x00000020; ++pub const ECHONL: crate::tcflag_t = 0x00000040; ++pub const ECHOPRT: crate::tcflag_t = 0x00000400; ++pub const ECHOCTL: crate::tcflag_t = 0x00000200; ++pub const ISIG: crate::tcflag_t = 0x00000001; ++pub const ICANON: crate::tcflag_t = 0x00000002; ++pub const PENDIN: crate::tcflag_t = 0x00004000; ++pub const NOFLSH: crate::tcflag_t = 0x00000080; ++ ++pub const MAP_HUGETLB: c_int = 0x80000; ++ ++pub const B0: crate::speed_t = 0o000000; ++pub const B50: crate::speed_t = 0o000001; ++pub const B75: crate::speed_t = 0o000002; ++pub const B110: crate::speed_t = 0o000003; ++pub const B134: crate::speed_t = 0o000004; ++pub const B150: crate::speed_t = 0o000005; ++pub const B200: crate::speed_t = 0o000006; ++pub const B300: crate::speed_t = 0o000007; ++pub const B600: crate::speed_t = 0o000010; ++pub const B1200: crate::speed_t = 0o000011; ++pub const B1800: crate::speed_t = 0o000012; ++pub const B2400: crate::speed_t = 0o000013; ++pub const B4800: crate::speed_t = 0o000014; ++pub const B9600: crate::speed_t = 0o000015; ++pub const B19200: crate::speed_t = 0o000016; ++pub const B38400: crate::speed_t = 0o000017; ++pub const B57600: crate::speed_t = 0o010001; ++pub const B115200: crate::speed_t = 0o010002; ++pub const B230400: crate::speed_t = 0o010003; ++pub const B460800: crate::speed_t = 0o010004; ++pub const B500000: crate::speed_t = 0o010005; ++pub const B576000: crate::speed_t = 0o010006; ++pub const B921600: crate::speed_t = 0o010007; ++pub const B1000000: crate::speed_t = 0o010010; ++pub const B1152000: crate::speed_t = 0o010011; ++pub const B1500000: crate::speed_t = 0o010012; ++pub const B2000000: crate::speed_t = 0o010013; ++pub const B2500000: crate::speed_t = 0o010014; ++pub const B3000000: crate::speed_t = 0o010015; ++pub const B3500000: crate::speed_t = 0o010016; ++pub const B4000000: crate::speed_t = 0o010017; ++ ++cfg_if! { ++ if #[cfg(target_arch = "mips")] { ++ mod mips32; ++ pub use self::mips32::*; ++ } else if #[cfg(target_arch = "mips64")] { ++ mod mips64; ++ pub use self::mips64::*; ++ } else { ++ // Unknown target_arch ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/uclibc/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/uclibc/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/uclibc/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/uclibc/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,477 @@ ++use crate::off64_t; ++use crate::prelude::*; ++ ++pub type shmatt_t = c_ulong; ++pub type msgqnum_t = c_ulong; ++pub type msglen_t = c_ulong; ++pub type regoff_t = c_int; ++pub type rlim_t = c_ulong; ++pub type __rlimit_resource_t = c_ulong; ++pub type __priority_which_t = c_uint; ++ ++cfg_if! { ++ if #[cfg(doc)] { ++ // Used in `linux::arch` to define ioctl constants. ++ pub(crate) type Ioctl = c_ulong; ++ } else { ++ #[doc(hidden)] ++ pub type Ioctl = c_ulong; ++ } ++} ++ ++s! { ++ pub struct statvfs { ++ // Different than GNU! ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_favail: crate::fsfilcnt_t, ++ #[cfg(target_endian = "little")] ++ pub f_fsid: c_ulong, ++ #[cfg(target_pointer_width = "32")] ++ __f_unused: c_int, ++ #[cfg(target_endian = "big")] ++ pub f_fsid: c_ulong, ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ __f_spare: [c_int; 6], ++ } ++ ++ pub struct regex_t { ++ __buffer: *mut c_void, ++ __allocated: size_t, ++ __used: size_t, ++ __syntax: c_ulong, ++ __fastmap: *mut c_char, ++ __translate: *mut c_char, ++ __re_nsub: size_t, ++ __bitfield: u8, ++ } ++ ++ pub struct rtentry { ++ pub rt_pad1: c_ulong, ++ pub rt_dst: crate::sockaddr, ++ pub rt_gateway: crate::sockaddr, ++ pub rt_genmask: crate::sockaddr, ++ pub rt_flags: c_ushort, ++ pub rt_pad2: c_short, ++ pub rt_pad3: c_ulong, ++ pub rt_tos: c_uchar, ++ pub rt_class: c_uchar, ++ #[cfg(target_pointer_width = "64")] ++ pub rt_pad4: [c_short; 3usize], ++ #[cfg(not(target_pointer_width = "64"))] ++ pub rt_pad4: c_short, ++ pub rt_metric: c_short, ++ pub rt_dev: *mut c_char, ++ pub rt_mtu: c_ulong, ++ pub rt_window: c_ulong, ++ pub rt_irtt: c_ushort, ++ } ++ ++ pub struct __exit_status { ++ pub e_termination: c_short, ++ pub e_exit: c_short, ++ } ++ ++ pub struct ptrace_peeksiginfo_args { ++ pub off: crate::__u64, ++ pub flags: crate::__u32, ++ pub nr: crate::__s32, ++ } ++ ++ #[cfg_attr( ++ any( ++ target_pointer_width = "32", ++ target_arch = "x86_64", ++ target_arch = "powerpc64", ++ target_arch = "mips64", ++ target_arch = "s390x", ++ target_arch = "sparc64" ++ ), ++ repr(align(4)) ++ )] ++ #[cfg_attr( ++ not(any( ++ target_pointer_width = "32", ++ target_arch = "x86_64", ++ target_arch = "powerpc64", ++ target_arch = "mips64", ++ target_arch = "s390x", ++ target_arch = "sparc64" ++ )), ++ repr(align(8)) ++ )] ++ pub struct pthread_mutexattr_t { ++ size: [u8; crate::__SIZEOF_PTHREAD_MUTEXATTR_T], ++ } ++ ++ #[repr(align(4))] ++ pub struct pthread_condattr_t { ++ size: [u8; crate::__SIZEOF_PTHREAD_CONDATTR_T], ++ } ++} ++ ++impl siginfo_t { ++ pub unsafe fn si_addr(&self) -> *mut c_void { ++ #[repr(C)] ++ struct siginfo_sigfault { ++ _si_signo: c_int, ++ _si_errno: c_int, ++ _si_code: c_int, ++ si_addr: *mut c_void, ++ } ++ (*(self as *const siginfo_t as *const siginfo_sigfault)).si_addr ++ } ++ ++ pub unsafe fn si_value(&self) -> crate::sigval { ++ #[repr(C)] ++ struct siginfo_si_value { ++ _si_signo: c_int, ++ _si_errno: c_int, ++ _si_code: c_int, ++ _si_timerid: c_int, ++ _si_overrun: c_int, ++ si_value: crate::sigval, ++ } ++ (*(self as *const siginfo_t as *const siginfo_si_value)).si_value ++ } ++} ++ ++// Internal, for casts to access union fields ++#[repr(C)] ++struct sifields_sigchld { ++ si_pid: crate::pid_t, ++ si_uid: crate::uid_t, ++ si_status: c_int, ++ si_utime: c_long, ++ si_stime: c_long, ++} ++impl Copy for sifields_sigchld {} ++impl Clone for sifields_sigchld { ++ fn clone(&self) -> sifields_sigchld { ++ *self ++ } ++} ++ ++// Internal, for casts to access union fields ++#[repr(C)] ++union sifields { ++ _align_pointer: *mut c_void, ++ sigchld: sifields_sigchld, ++} ++ ++// Internal, for casts to access union fields. Note that some variants ++// of sifields start with a pointer, which makes the alignment of ++// sifields vary on 32-bit and 64-bit architectures. ++#[repr(C)] ++struct siginfo_f { ++ _siginfo_base: [c_int; 3], ++ sifields: sifields, ++} ++ ++impl siginfo_t { ++ unsafe fn sifields(&self) -> &sifields { ++ &(*(self as *const siginfo_t as *const siginfo_f)).sifields ++ } ++ ++ pub unsafe fn si_pid(&self) -> crate::pid_t { ++ self.sifields().sigchld.si_pid ++ } ++ ++ pub unsafe fn si_uid(&self) -> crate::uid_t { ++ self.sifields().sigchld.si_uid ++ } ++ ++ pub unsafe fn si_status(&self) -> c_int { ++ self.sifields().sigchld.si_status ++ } ++ ++ pub unsafe fn si_utime(&self) -> c_long { ++ self.sifields().sigchld.si_utime ++ } ++ ++ pub unsafe fn si_stime(&self) -> c_long { ++ self.sifields().sigchld.si_stime ++ } ++} ++ ++pub const MCL_CURRENT: c_int = 0x0001; ++pub const MCL_FUTURE: c_int = 0x0002; ++pub const MCL_ONFAULT: c_int = 0x0004; ++ ++pub const SIGEV_THREAD_ID: c_int = 4; ++ ++pub const AF_VSOCK: c_int = 40; ++ ++// Most `*_SUPER_MAGIC` constants are defined at the `linux_like` level; the ++// following are only available on newer Linux versions than the versions ++// currently used in CI in some configurations, so we define them here. ++pub const BINDERFS_SUPER_MAGIC: c_long = 0x6c6f6f70; ++pub const XFS_SUPER_MAGIC: c_long = 0x58465342; ++ ++pub const PTRACE_TRACEME: c_int = 0; ++pub const PTRACE_PEEKTEXT: c_int = 1; ++pub const PTRACE_PEEKDATA: c_int = 2; ++pub const PTRACE_PEEKUSER: c_int = 3; ++pub const PTRACE_POKETEXT: c_int = 4; ++pub const PTRACE_POKEDATA: c_int = 5; ++pub const PTRACE_POKEUSER: c_int = 6; ++pub const PTRACE_CONT: c_int = 7; ++pub const PTRACE_KILL: c_int = 8; ++pub const PTRACE_SINGLESTEP: c_int = 9; ++pub const PTRACE_GETREGS: c_int = 12; ++pub const PTRACE_SETREGS: c_int = 13; ++pub const PTRACE_GETFPREGS: c_int = 14; ++pub const PTRACE_SETFPREGS: c_int = 15; ++pub const PTRACE_ATTACH: c_int = 16; ++pub const PTRACE_DETACH: c_int = 17; ++pub const PTRACE_GETFPXREGS: c_int = 18; ++pub const PTRACE_SETFPXREGS: c_int = 19; ++pub const PTRACE_SYSCALL: c_int = 24; ++pub const PTRACE_SETOPTIONS: c_int = 0x4200; ++pub const PTRACE_GETEVENTMSG: c_int = 0x4201; ++pub const PTRACE_GETSIGINFO: c_int = 0x4202; ++pub const PTRACE_SETSIGINFO: c_int = 0x4203; ++pub const PTRACE_GETREGSET: c_int = 0x4204; ++pub const PTRACE_SETREGSET: c_int = 0x4205; ++pub const PTRACE_SEIZE: c_int = 0x4206; ++pub const PTRACE_INTERRUPT: c_int = 0x4207; ++pub const PTRACE_LISTEN: c_int = 0x4208; ++ ++pub const POSIX_FADV_DONTNEED: c_int = 4; ++pub const POSIX_FADV_NOREUSE: c_int = 5; ++ ++// These are different than GNU! ++pub const LC_CTYPE: c_int = 0; ++pub const LC_NUMERIC: c_int = 1; ++pub const LC_TIME: c_int = 3; ++pub const LC_COLLATE: c_int = 4; ++pub const LC_MONETARY: c_int = 2; ++pub const LC_MESSAGES: c_int = 5; ++pub const LC_ALL: c_int = 6; ++// end different section ++ ++// MS_ flags for mount(2) ++pub const MS_RMT_MASK: c_ulong = ++ crate::MS_RDONLY | crate::MS_SYNCHRONOUS | crate::MS_MANDLOCK | crate::MS_I_VERSION; ++ ++pub const ENOTSUP: c_int = EOPNOTSUPP; ++ ++pub const IPV6_JOIN_GROUP: c_int = 20; ++pub const IPV6_LEAVE_GROUP: c_int = 21; ++ ++// These are different from GNU ++pub const ABDAY_1: crate::nl_item = 0x300; ++pub const ABDAY_2: crate::nl_item = 0x301; ++pub const ABDAY_3: crate::nl_item = 0x302; ++pub const ABDAY_4: crate::nl_item = 0x303; ++pub const ABDAY_5: crate::nl_item = 0x304; ++pub const ABDAY_6: crate::nl_item = 0x305; ++pub const ABDAY_7: crate::nl_item = 0x306; ++pub const DAY_1: crate::nl_item = 0x307; ++pub const DAY_2: crate::nl_item = 0x308; ++pub const DAY_3: crate::nl_item = 0x309; ++pub const DAY_4: crate::nl_item = 0x30A; ++pub const DAY_5: crate::nl_item = 0x30B; ++pub const DAY_6: crate::nl_item = 0x30C; ++pub const DAY_7: crate::nl_item = 0x30D; ++pub const ABMON_1: crate::nl_item = 0x30E; ++pub const ABMON_2: crate::nl_item = 0x30F; ++pub const ABMON_3: crate::nl_item = 0x310; ++pub const ABMON_4: crate::nl_item = 0x311; ++pub const ABMON_5: crate::nl_item = 0x312; ++pub const ABMON_6: crate::nl_item = 0x313; ++pub const ABMON_7: crate::nl_item = 0x314; ++pub const ABMON_8: crate::nl_item = 0x315; ++pub const ABMON_9: crate::nl_item = 0x316; ++pub const ABMON_10: crate::nl_item = 0x317; ++pub const ABMON_11: crate::nl_item = 0x318; ++pub const ABMON_12: crate::nl_item = 0x319; ++pub const MON_1: crate::nl_item = 0x31A; ++pub const MON_2: crate::nl_item = 0x31B; ++pub const MON_3: crate::nl_item = 0x31C; ++pub const MON_4: crate::nl_item = 0x31D; ++pub const MON_5: crate::nl_item = 0x31E; ++pub const MON_6: crate::nl_item = 0x31F; ++pub const MON_7: crate::nl_item = 0x320; ++pub const MON_8: crate::nl_item = 0x321; ++pub const MON_9: crate::nl_item = 0x322; ++pub const MON_10: crate::nl_item = 0x323; ++pub const MON_11: crate::nl_item = 0x324; ++pub const MON_12: crate::nl_item = 0x325; ++pub const AM_STR: crate::nl_item = 0x326; ++pub const PM_STR: crate::nl_item = 0x327; ++pub const D_T_FMT: crate::nl_item = 0x328; ++pub const D_FMT: crate::nl_item = 0x329; ++pub const T_FMT: crate::nl_item = 0x32A; ++pub const T_FMT_AMPM: crate::nl_item = 0x32B; ++pub const ERA: crate::nl_item = 0x32C; ++pub const ERA_D_FMT: crate::nl_item = 0x32E; ++pub const ALT_DIGITS: crate::nl_item = 0x32F; ++pub const ERA_D_T_FMT: crate::nl_item = 0x330; ++pub const ERA_T_FMT: crate::nl_item = 0x331; ++pub const CODESET: crate::nl_item = 10; ++pub const CRNCYSTR: crate::nl_item = 0x215; ++pub const RADIXCHAR: crate::nl_item = 0x100; ++pub const THOUSEP: crate::nl_item = 0x101; ++pub const NOEXPR: crate::nl_item = 0x501; ++pub const YESSTR: crate::nl_item = 0x502; ++pub const NOSTR: crate::nl_item = 0x503; ++ ++// Different than Gnu. ++pub const FILENAME_MAX: c_uint = 4095; ++ ++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; ++pub const BUFSIZ: c_int = 4096; ++pub const EDEADLOCK: c_int = EDEADLK; ++pub const EXTA: c_uint = B19200; ++pub const EXTB: c_uint = B38400; ++pub const EXTPROC: crate::tcflag_t = 0o200000; ++pub const FOPEN_MAX: c_int = 16; ++pub const F_GETOWN: c_int = 9; ++pub const F_OFD_GETLK: c_int = 36; ++pub const F_OFD_SETLK: c_int = 37; ++pub const F_OFD_SETLKW: c_int = 38; ++pub const F_RDLCK: c_int = 0; ++pub const F_SETOWN: c_int = 8; ++pub const F_UNLCK: c_int = 2; ++pub const F_WRLCK: c_int = 1; ++pub const IPV6_MULTICAST_ALL: c_int = 29; ++pub const IPV6_ROUTER_ALERT_ISOLATE: c_int = 30; ++pub const MAP_HUGE_SHIFT: c_int = 26; ++pub const MAP_HUGE_MASK: c_int = 0x3f; ++pub const MAP_HUGE_64KB: c_int = 16 << MAP_HUGE_SHIFT; ++pub const MAP_HUGE_512KB: c_int = 19 << MAP_HUGE_SHIFT; ++pub const MAP_HUGE_1MB: c_int = 20 << MAP_HUGE_SHIFT; ++pub const MAP_HUGE_2MB: c_int = 21 << MAP_HUGE_SHIFT; ++pub const MAP_HUGE_8MB: c_int = 23 << MAP_HUGE_SHIFT; ++pub const MAP_HUGE_16MB: c_int = 24 << MAP_HUGE_SHIFT; ++pub const MAP_HUGE_32MB: c_int = 25 << MAP_HUGE_SHIFT; ++pub const MAP_HUGE_256MB: c_int = 28 << MAP_HUGE_SHIFT; ++pub const MAP_HUGE_512MB: c_int = 29 << MAP_HUGE_SHIFT; ++pub const MAP_HUGE_1GB: c_int = 30 << MAP_HUGE_SHIFT; ++pub const MAP_HUGE_2GB: c_int = 31 << MAP_HUGE_SHIFT; ++pub const MAP_HUGE_16GB: c_int = 34 << MAP_HUGE_SHIFT; ++pub const MINSIGSTKSZ: c_int = 2048; ++pub const MSG_COPY: c_int = 0o40000; ++pub const NI_MAXHOST: crate::socklen_t = 1025; ++pub const O_TMPFILE: c_int = 0o20000000 | O_DIRECTORY; ++pub const PACKET_MR_UNICAST: c_int = 3; ++pub const PF_NFC: c_int = 39; ++pub const PF_VSOCK: c_int = 40; ++pub const POSIX_MADV_DONTNEED: c_int = 4; ++pub const PTRACE_EVENT_STOP: c_int = 128; ++pub const PTRACE_GETSIGMASK: c_uint = 0x420a; ++pub const PTRACE_PEEKSIGINFO: c_int = 0x4209; ++pub const PTRACE_SETSIGMASK: c_uint = 0x420b; ++pub const RTLD_NOLOAD: c_int = 0x00004; ++pub const RUSAGE_THREAD: c_int = 1; ++pub const SHM_EXEC: c_int = 0o100000; ++pub const SIGPOLL: c_int = SIGIO; ++pub const SOCK_DCCP: c_int = 6; ++pub const SOCK_PACKET: c_int = 10; ++pub const TCP_COOKIE_TRANSACTIONS: c_int = 15; ++pub const UDP_GRO: c_int = 104; ++pub const UDP_SEGMENT: c_int = 103; ++pub const YESEXPR: c_int = ((5) << 8) | (0); ++ ++extern "C" { ++ pub fn gettimeofday(tp: *mut crate::timeval, tz: *mut crate::timezone) -> c_int; ++ ++ pub fn pthread_rwlockattr_getkind_np( ++ attr: *const crate::pthread_rwlockattr_t, ++ val: *mut c_int, ++ ) -> c_int; ++ pub fn pthread_rwlockattr_setkind_np( ++ attr: *mut crate::pthread_rwlockattr_t, ++ val: c_int, ++ ) -> c_int; ++ ++ pub fn ptrace(request: c_uint, ...) -> c_long; ++ ++ pub fn sendmmsg( ++ sockfd: c_int, ++ msgvec: *mut crate::mmsghdr, ++ vlen: c_uint, ++ flags: c_int, ++ ) -> c_int; ++ pub fn recvmmsg( ++ sockfd: c_int, ++ msgvec: *mut crate::mmsghdr, ++ vlen: c_uint, ++ flags: c_int, ++ timeout: *mut crate::timespec, ++ ) -> c_int; ++ ++ pub fn openpty( ++ amaster: *mut c_int, ++ aslave: *mut c_int, ++ name: *mut c_char, ++ termp: *mut termios, ++ winp: *mut crate::winsize, ++ ) -> c_int; ++ pub fn forkpty( ++ amaster: *mut c_int, ++ name: *mut c_char, ++ termp: *mut termios, ++ winp: *mut crate::winsize, ++ ) -> crate::pid_t; ++ ++ pub fn getnameinfo( ++ sa: *const crate::sockaddr, ++ salen: crate::socklen_t, ++ host: *mut c_char, ++ hostlen: crate::socklen_t, ++ serv: *mut c_char, ++ servlen: crate::socklen_t, ++ flags: c_int, ++ ) -> c_int; ++ ++ pub fn pwritev(fd: c_int, iov: *const crate::iovec, iovcnt: c_int, offset: off64_t) -> ssize_t; ++ pub fn preadv(fd: c_int, iov: *const crate::iovec, iovcnt: c_int, offset: off64_t) -> ssize_t; ++ ++ pub fn sethostid(hostid: c_long) -> c_int; ++ pub fn fanotify_mark( ++ fd: c_int, ++ flags: c_uint, ++ mask: u64, ++ dirfd: c_int, ++ path: *const c_char, ++ ) -> c_int; ++ pub fn getrlimit64(resource: crate::__rlimit_resource_t, rlim: *mut crate::rlimit64) -> c_int; ++ pub fn setrlimit64(resource: crate::__rlimit_resource_t, rlim: *const crate::rlimit64) ++ -> c_int; ++ pub fn getrlimit(resource: crate::__rlimit_resource_t, rlim: *mut crate::rlimit) -> c_int; ++ pub fn setrlimit(resource: crate::__rlimit_resource_t, rlim: *const crate::rlimit) -> c_int; ++ pub fn getpriority(which: crate::__priority_which_t, who: crate::id_t) -> c_int; ++ pub fn setpriority(which: crate::__priority_which_t, who: crate::id_t, prio: c_int) -> c_int; ++ pub fn getauxval(type_: c_ulong) -> c_ulong; ++} ++ ++cfg_if! { ++ if #[cfg(any(target_arch = "mips", target_arch = "mips64"))] { ++ mod mips; ++ pub use self::mips::*; ++ } else if #[cfg(target_arch = "x86_64")] { ++ mod x86_64; ++ pub use self::x86_64::*; ++ } else if #[cfg(target_arch = "arm")] { ++ mod arm; ++ pub use self::arm::*; ++ } else { ++ pub use unsupported_target; ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/uclibc/x86_64/l4re.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/uclibc/x86_64/l4re.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/uclibc/x86_64/l4re.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/uclibc/x86_64/l4re.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,55 @@ ++use crate::prelude::*; ++ ++/// L4Re specifics ++/// This module contains definitions required by various L4Re libc backends. ++/// Some of them are formally not part of the libc, but are a dependency of the ++/// libc and hence we should provide them here. ++ ++pub type l4_umword_t = c_ulong; // Unsigned machine word. ++pub type pthread_t = *mut c_void; ++ ++s! { ++ /// CPU sets. ++ pub struct l4_sched_cpu_set_t { ++ // from the L4Re docs ++ /// Combination of granularity and offset. ++ /// ++ /// The granularity defines how many CPUs each bit in map describes. ++ /// The offset is the number of the first CPU described by the first ++ /// bit in the bitmap. ++ /// offset must be a multiple of 2^graularity. ++ /// ++ /// | MSB | LSB | ++ /// | ---------------- | ------------------- | ++ /// | 8bit granularity | 24bit offset .. | ++ gran_offset: l4_umword_t, ++ /// Bitmap of CPUs. ++ map: l4_umword_t, ++ } ++} ++ ++#[cfg(target_os = "l4re")] ++#[allow(missing_debug_implementations)] ++pub struct pthread_attr_t { ++ pub __detachstate: c_int, ++ pub __schedpolicy: c_int, ++ pub __schedparam: super::__sched_param, ++ pub __inheritsched: c_int, ++ pub __scope: c_int, ++ pub __guardsize: size_t, ++ pub __stackaddr_set: c_int, ++ pub __stackaddr: *mut c_void, // better don't use it ++ pub __stacksize: size_t, ++ // L4Re specifics ++ pub affinity: l4_sched_cpu_set_t, ++ pub create_flags: c_uint, ++} ++ ++// L4Re requires a min stack size of 64k; that isn't defined in uClibc, but ++// somewhere in the core libraries. uClibc wants 16k, but that's not enough. ++pub const PTHREAD_STACK_MIN: usize = 65536; ++ ++// Misc other constants required for building. ++pub const SIGIO: c_int = 29; ++pub const B19200: crate::speed_t = 0o000016; ++pub const B38400: crate::speed_t = 0o000017; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/uclibc/x86_64/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/uclibc/x86_64/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/uclibc/x86_64/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/uclibc/x86_64/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,358 @@ ++//! Definitions for uclibc on 64bit systems ++ ++use crate::off64_t; ++use crate::prelude::*; ++ ++pub type blkcnt_t = i64; ++pub type blksize_t = i64; ++pub type clock_t = i64; ++pub type c_char = i8; ++pub type c_long = i64; ++pub type c_ulong = u64; ++pub type fsblkcnt_t = c_ulong; ++pub type fsfilcnt_t = c_ulong; ++pub type fsword_t = c_long; ++pub type ino_t = c_ulong; ++pub type nlink_t = c_uint; ++pub type off_t = c_long; ++// [uClibc docs] Note stat64 has the same shape as stat for x86-64. ++pub type stat64 = stat; ++pub type suseconds_t = c_long; ++pub type time_t = c_int; ++pub type wchar_t = c_int; ++ ++pub type fsblkcnt64_t = u64; ++pub type fsfilcnt64_t = u64; ++pub type __u64 = c_ulong; ++pub type __s64 = c_long; ++ ++s! { ++ pub struct ipc_perm { ++ pub __key: crate::key_t, ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub cuid: crate::uid_t, ++ pub cgid: crate::gid_t, ++ pub mode: c_ushort, // read / write ++ __pad1: c_ushort, ++ pub __seq: c_ushort, ++ __pad2: c_ushort, ++ __unused1: c_ulong, ++ __unused2: c_ulong, ++ } ++ ++ #[cfg(not(target_os = "l4re"))] ++ pub struct pthread_attr_t { ++ __detachstate: c_int, ++ __schedpolicy: c_int, ++ __schedparam: __sched_param, ++ __inheritsched: c_int, ++ __scope: c_int, ++ __guardsize: size_t, ++ __stackaddr_set: c_int, ++ __stackaddr: *mut c_void, // better don't use it ++ __stacksize: size_t, ++ } ++ ++ pub struct __sched_param { ++ __sched_priority: c_int, ++ } ++ ++ pub struct siginfo_t { ++ si_signo: c_int, // signal number ++ si_errno: c_int, // if not zero: error value of signal, see errno.h ++ si_code: c_int, // signal code ++ pub _pad: [c_int; 28], // unported union ++ _align: [usize; 0], ++ } ++ ++ pub struct shmid_ds { ++ pub shm_perm: crate::ipc_perm, ++ pub shm_segsz: size_t, // segment size in bytes ++ pub shm_atime: crate::time_t, // time of last shmat() ++ pub shm_dtime: crate::time_t, ++ pub shm_ctime: crate::time_t, ++ pub shm_cpid: crate::pid_t, ++ pub shm_lpid: crate::pid_t, ++ pub shm_nattch: crate::shmatt_t, ++ __unused1: c_ulong, ++ __unused2: c_ulong, ++ } ++ ++ pub struct msqid_ds { ++ pub msg_perm: crate::ipc_perm, ++ pub msg_stime: crate::time_t, ++ pub msg_rtime: crate::time_t, ++ pub msg_ctime: crate::time_t, ++ __msg_cbytes: c_ulong, ++ pub msg_qnum: crate::msgqnum_t, ++ pub msg_qbytes: crate::msglen_t, ++ pub msg_lspid: crate::pid_t, ++ pub msg_lrpid: crate::pid_t, ++ __ignored1: c_ulong, ++ __ignored2: c_ulong, ++ } ++ ++ pub struct sockaddr { ++ pub sa_family: crate::sa_family_t, ++ pub sa_data: [c_char; 14], ++ } ++ ++ pub struct sockaddr_in { ++ pub sin_family: crate::sa_family_t, ++ pub sin_port: crate::in_port_t, ++ pub sin_addr: crate::in_addr, ++ pub sin_zero: [u8; 8], ++ } ++ ++ pub struct sockaddr_in6 { ++ pub sin6_family: crate::sa_family_t, ++ pub sin6_port: crate::in_port_t, ++ pub sin6_flowinfo: u32, ++ pub sin6_addr: crate::in6_addr, ++ pub sin6_scope_id: u32, ++ } ++ ++ /* ------------------------------------------------------------ ++ * definitions below are *unverified* and might **break** the software ++ */ ++ ++ // pub struct in_addr { ++ // pub s_addr: in_addr_t, ++ // } ++ // ++ // pub struct in6_addr { ++ // pub s6_addr: [u8; 16], ++ // } ++ ++ pub struct stat { ++ pub st_dev: c_ulong, ++ pub st_ino: crate::ino_t, ++ // According to uclibc/libc/sysdeps/linux/x86_64/bits/stat.h, order of ++ // nlink and mode are swapped on 64 bit systems. ++ pub st_nlink: crate::nlink_t, ++ pub st_mode: crate::mode_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: c_ulong, // dev_t ++ pub st_size: off_t, // file size ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_ulong, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_ulong, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_ulong, ++ st_pad4: [c_long; 3], ++ } ++ ++ pub struct sigaction { ++ pub sa_handler: crate::sighandler_t, ++ pub sa_flags: c_ulong, ++ pub sa_restorer: Option, ++ pub sa_mask: crate::sigset_t, ++ } ++ ++ pub struct stack_t { ++ // FIXME ++ pub ss_sp: *mut c_void, ++ pub ss_flags: c_int, ++ pub ss_size: size_t, ++ } ++ ++ pub struct statfs { ++ // FIXME ++ pub f_type: fsword_t, ++ pub f_bsize: fsword_t, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_fsid: crate::fsid_t, ++ pub f_namelen: fsword_t, ++ pub f_frsize: fsword_t, ++ f_spare: [fsword_t; 5], ++ } ++ ++ pub struct statfs64 { ++ pub f_type: c_int, ++ pub f_bsize: c_int, ++ pub f_blocks: crate::fsblkcnt64_t, ++ pub f_bfree: crate::fsblkcnt64_t, ++ pub f_bavail: crate::fsblkcnt64_t, ++ pub f_files: crate::fsfilcnt64_t, ++ pub f_ffree: crate::fsfilcnt64_t, ++ pub f_fsid: crate::fsid_t, ++ pub f_namelen: c_int, ++ pub f_frsize: c_int, ++ pub f_flags: c_int, ++ pub f_spare: [c_int; 4], ++ } ++ ++ pub struct statvfs64 { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: u64, ++ pub f_bfree: u64, ++ pub f_bavail: u64, ++ pub f_files: u64, ++ pub f_ffree: u64, ++ pub f_favail: u64, ++ pub f_fsid: c_ulong, ++ __f_unused: c_int, ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ __f_spare: [c_int; 6], ++ } ++ ++ pub struct msghdr { ++ // FIXME ++ pub msg_name: *mut c_void, ++ pub msg_namelen: crate::socklen_t, ++ pub msg_iov: *mut crate::iovec, ++ pub msg_iovlen: size_t, ++ pub msg_control: *mut c_void, ++ pub msg_controllen: size_t, ++ pub msg_flags: c_int, ++ } ++ ++ pub struct termios { ++ // FIXME ++ pub c_iflag: crate::tcflag_t, ++ pub c_oflag: crate::tcflag_t, ++ pub c_cflag: crate::tcflag_t, ++ pub c_lflag: crate::tcflag_t, ++ pub c_line: crate::cc_t, ++ pub c_cc: [crate::cc_t; crate::NCCS], ++ } ++ ++ pub struct sigset_t { ++ // FIXME ++ __val: [c_ulong; 16], ++ } ++ ++ pub struct sysinfo { ++ // FIXME ++ pub uptime: c_long, ++ pub loads: [c_ulong; 3], ++ pub totalram: c_ulong, ++ pub freeram: c_ulong, ++ pub sharedram: c_ulong, ++ pub bufferram: c_ulong, ++ pub totalswap: c_ulong, ++ pub freeswap: c_ulong, ++ pub procs: c_ushort, ++ pub pad: c_ushort, ++ pub totalhigh: c_ulong, ++ pub freehigh: c_ulong, ++ pub mem_unit: c_uint, ++ pub _f: [c_char; 0], ++ } ++ ++ pub struct glob_t { ++ // FIXME ++ pub gl_pathc: size_t, ++ pub gl_pathv: *mut *mut c_char, ++ pub gl_offs: size_t, ++ pub gl_flags: c_int, ++ __unused1: *mut c_void, ++ __unused2: *mut c_void, ++ __unused3: *mut c_void, ++ __unused4: *mut c_void, ++ __unused5: *mut c_void, ++ } ++ ++ pub struct cpu_set_t { ++ // FIXME ++ #[cfg(target_pointer_width = "32")] ++ bits: [u32; 32], ++ #[cfg(target_pointer_width = "64")] ++ bits: [u64; 16], ++ } ++ ++ pub struct fsid_t { ++ // FIXME ++ __val: [c_int; 2], ++ } ++ ++ // FIXME(1.0): this is actually a union ++ pub struct sem_t { ++ #[cfg(target_pointer_width = "32")] ++ __size: [c_char; 16], ++ #[cfg(target_pointer_width = "64")] ++ __size: [c_char; 32], ++ __align: [c_long; 0], ++ } ++ ++ pub struct cmsghdr { ++ pub cmsg_len: size_t, ++ pub cmsg_level: c_int, ++ pub cmsg_type: c_int, ++ } ++} ++ ++s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ pub struct dirent { ++ pub d_ino: crate::ino64_t, ++ pub d_off: off64_t, ++ pub d_reclen: u16, ++ pub d_type: u8, ++ pub d_name: [c_char; 256], ++ } ++} ++ ++// constants ++pub const ENAMETOOLONG: c_int = 36; // File name too long ++pub const ENOTEMPTY: c_int = 39; // Directory not empty ++pub const ELOOP: c_int = 40; // Too many symbolic links encountered ++pub const EADDRINUSE: c_int = 98; // Address already in use ++pub const EADDRNOTAVAIL: c_int = 99; // Cannot assign requested address ++pub const ENETDOWN: c_int = 100; // Network is down ++pub const ENETUNREACH: c_int = 101; // Network is unreachable ++pub const ECONNABORTED: c_int = 103; // Software caused connection abort ++pub const ECONNREFUSED: c_int = 111; // Connection refused ++pub const ECONNRESET: c_int = 104; // Connection reset by peer ++pub const EDEADLK: c_int = 35; // Resource deadlock would occur ++pub const ENOSYS: c_int = 38; // Function not implemented ++pub const ENOTCONN: c_int = 107; // Transport endpoint is not connected ++pub const ETIMEDOUT: c_int = 110; // connection timed out ++pub const ESTALE: c_int = 116; // Stale file handle ++pub const EHOSTUNREACH: c_int = 113; // No route to host ++pub const EDQUOT: c_int = 122; // Quota exceeded ++pub const EOPNOTSUPP: c_int = 0x5f; ++pub const ENODATA: c_int = 0x3d; ++pub const O_APPEND: c_int = 0o2000; ++pub const O_ACCMODE: c_int = 0o003; ++pub const O_CLOEXEC: c_int = 0x80000; ++pub const O_CREAT: c_int = 0100; ++pub const O_DIRECTORY: c_int = 0o200000; ++pub const O_EXCL: c_int = 0o200; ++pub const O_NOFOLLOW: c_int = 0x20000; ++pub const O_NONBLOCK: c_int = 0o4000; ++pub const O_TRUNC: c_int = 0o1000; ++pub const NCCS: usize = 32; ++pub const SIG_SETMASK: c_int = 2; // Set the set of blocked signals ++pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; ++pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; ++pub const SOCK_DGRAM: c_int = 2; // connectionless, unreliable datagrams ++pub const SOCK_STREAM: c_int = 1; // …/common/bits/socket_type.h ++pub const __SIZEOF_PTHREAD_COND_T: usize = 48; ++pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; ++pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; ++pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8; ++pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32; ++pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4; ++pub const PIDFD_NONBLOCK: c_int = 0o4000; ++ ++cfg_if! { ++ if #[cfg(target_os = "l4re")] { ++ mod l4re; ++ pub use self::l4re::*; ++ } else { ++ mod other; ++ pub use other::*; ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/uclibc/x86_64/other.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/uclibc/x86_64/other.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/uclibc/x86_64/other.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/linux/uclibc/x86_64/other.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,7 @@ ++use crate::prelude::*; ++ ++// Thestyle checker discourages the use of #[cfg], so this has to go into a ++// separate module ++pub type pthread_t = c_ulong; ++ ++pub const PTHREAD_STACK_MIN: usize = 16384; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/linux_like/mod.rs 2024-12-28 15:35:00.000000000 -0500 +@@ -0,0 +1,2030 @@ ++use crate::prelude::*; ++ ++pub type sa_family_t = u16; ++pub type speed_t = c_uint; ++pub type tcflag_t = c_uint; ++pub type clockid_t = c_int; ++pub type timer_t = *mut c_void; ++pub type key_t = c_int; ++pub type id_t = c_uint; ++ ++missing! { ++ #[cfg_attr(feature = "extra_traits", derive(Debug))] ++ pub enum timezone {} ++} ++ ++s! { ++ pub struct in_addr { ++ pub s_addr: crate::in_addr_t, ++ } ++ ++ pub struct ip_mreq { ++ pub imr_multiaddr: in_addr, ++ pub imr_interface: in_addr, ++ } ++ ++ pub struct ip_mreqn { ++ pub imr_multiaddr: in_addr, ++ pub imr_address: in_addr, ++ pub imr_ifindex: c_int, ++ } ++ ++ pub struct ip_mreq_source { ++ pub imr_multiaddr: in_addr, ++ pub imr_interface: in_addr, ++ pub imr_sourceaddr: in_addr, ++ } ++ ++ pub struct sockaddr { ++ pub sa_family: sa_family_t, ++ pub sa_data: [c_char; 14], ++ } ++ ++ pub struct sockaddr_in { ++ pub sin_family: sa_family_t, ++ pub sin_port: crate::in_port_t, ++ pub sin_addr: crate::in_addr, ++ pub sin_zero: [u8; 8], ++ } ++ ++ pub struct sockaddr_in6 { ++ pub sin6_family: sa_family_t, ++ pub sin6_port: crate::in_port_t, ++ pub sin6_flowinfo: u32, ++ pub sin6_addr: crate::in6_addr, ++ pub sin6_scope_id: u32, ++ } ++ ++ // The order of the `ai_addr` field in this struct is crucial ++ // for converting between the Rust and C types. ++ pub struct addrinfo { ++ pub ai_flags: c_int, ++ pub ai_family: c_int, ++ pub ai_socktype: c_int, ++ pub ai_protocol: c_int, ++ pub ai_addrlen: socklen_t, ++ ++ #[cfg(any(target_os = "linux", target_os = "emscripten"))] ++ pub ai_addr: *mut crate::sockaddr, ++ ++ pub ai_canonname: *mut c_char, ++ ++ #[cfg(target_os = "android")] ++ pub ai_addr: *mut crate::sockaddr, ++ ++ pub ai_next: *mut addrinfo, ++ } ++ ++ pub struct sockaddr_ll { ++ pub sll_family: c_ushort, ++ pub sll_protocol: c_ushort, ++ pub sll_ifindex: c_int, ++ pub sll_hatype: c_ushort, ++ pub sll_pkttype: c_uchar, ++ pub sll_halen: c_uchar, ++ pub sll_addr: [c_uchar; 8], ++ } ++ ++ pub struct fd_set { ++ fds_bits: [c_ulong; FD_SETSIZE as usize / ULONG_SIZE], ++ } ++ ++ pub struct tm { ++ pub tm_sec: c_int, ++ pub tm_min: c_int, ++ pub tm_hour: c_int, ++ pub tm_mday: c_int, ++ pub tm_mon: c_int, ++ pub tm_year: c_int, ++ pub tm_wday: c_int, ++ pub tm_yday: c_int, ++ pub tm_isdst: c_int, ++ pub tm_gmtoff: c_long, ++ pub tm_zone: *const c_char, ++ } ++ ++ pub struct sched_param { ++ pub sched_priority: c_int, ++ #[cfg(any(target_env = "musl", target_os = "emscripten", target_env = "ohos"))] ++ pub sched_ss_low_priority: c_int, ++ #[cfg(any(target_env = "musl", target_os = "emscripten", target_env = "ohos"))] ++ pub sched_ss_repl_period: crate::timespec, ++ #[cfg(any(target_env = "musl", target_os = "emscripten", target_env = "ohos"))] ++ pub sched_ss_init_budget: crate::timespec, ++ #[cfg(any(target_env = "musl", target_os = "emscripten", target_env = "ohos"))] ++ pub sched_ss_max_repl: c_int, ++ } ++ ++ pub struct Dl_info { ++ pub dli_fname: *const c_char, ++ pub dli_fbase: *mut c_void, ++ pub dli_sname: *const c_char, ++ pub dli_saddr: *mut c_void, ++ } ++ ++ pub struct lconv { ++ pub decimal_point: *mut c_char, ++ pub thousands_sep: *mut c_char, ++ pub grouping: *mut c_char, ++ pub int_curr_symbol: *mut c_char, ++ pub currency_symbol: *mut c_char, ++ pub mon_decimal_point: *mut c_char, ++ pub mon_thousands_sep: *mut c_char, ++ pub mon_grouping: *mut c_char, ++ pub positive_sign: *mut c_char, ++ pub negative_sign: *mut c_char, ++ pub int_frac_digits: c_char, ++ pub frac_digits: c_char, ++ pub p_cs_precedes: c_char, ++ pub p_sep_by_space: c_char, ++ pub n_cs_precedes: c_char, ++ pub n_sep_by_space: c_char, ++ pub p_sign_posn: c_char, ++ pub n_sign_posn: c_char, ++ pub int_p_cs_precedes: c_char, ++ pub int_p_sep_by_space: c_char, ++ pub int_n_cs_precedes: c_char, ++ pub int_n_sep_by_space: c_char, ++ pub int_p_sign_posn: c_char, ++ pub int_n_sign_posn: c_char, ++ } ++ ++ pub struct in_pktinfo { ++ pub ipi_ifindex: c_int, ++ pub ipi_spec_dst: crate::in_addr, ++ pub ipi_addr: crate::in_addr, ++ } ++ ++ pub struct ifaddrs { ++ pub ifa_next: *mut ifaddrs, ++ pub ifa_name: *mut c_char, ++ pub ifa_flags: c_uint, ++ pub ifa_addr: *mut crate::sockaddr, ++ pub ifa_netmask: *mut crate::sockaddr, ++ pub ifa_ifu: *mut crate::sockaddr, // FIXME This should be a union ++ pub ifa_data: *mut c_void, ++ } ++ ++ pub struct in6_rtmsg { ++ rtmsg_dst: crate::in6_addr, ++ rtmsg_src: crate::in6_addr, ++ rtmsg_gateway: crate::in6_addr, ++ rtmsg_type: u32, ++ rtmsg_dst_len: u16, ++ rtmsg_src_len: u16, ++ rtmsg_metric: u32, ++ rtmsg_info: c_ulong, ++ rtmsg_flags: u32, ++ rtmsg_ifindex: c_int, ++ } ++ ++ pub struct arpreq { ++ pub arp_pa: crate::sockaddr, ++ pub arp_ha: crate::sockaddr, ++ pub arp_flags: c_int, ++ pub arp_netmask: crate::sockaddr, ++ pub arp_dev: [c_char; 16], ++ } ++ ++ pub struct arpreq_old { ++ pub arp_pa: crate::sockaddr, ++ pub arp_ha: crate::sockaddr, ++ pub arp_flags: c_int, ++ pub arp_netmask: crate::sockaddr, ++ } ++ ++ pub struct arphdr { ++ pub ar_hrd: u16, ++ pub ar_pro: u16, ++ pub ar_hln: u8, ++ pub ar_pln: u8, ++ pub ar_op: u16, ++ } ++ ++ pub struct mmsghdr { ++ pub msg_hdr: crate::msghdr, ++ pub msg_len: c_uint, ++ } ++} ++ ++cfg_if! { ++ if #[cfg(any(target_env = "gnu", target_os = "android"))] { ++ s! { ++ pub struct statx { ++ pub stx_mask: crate::__u32, ++ pub stx_blksize: crate::__u32, ++ pub stx_attributes: crate::__u64, ++ pub stx_nlink: crate::__u32, ++ pub stx_uid: crate::__u32, ++ pub stx_gid: crate::__u32, ++ pub stx_mode: crate::__u16, ++ __statx_pad1: [crate::__u16; 1], ++ pub stx_ino: crate::__u64, ++ pub stx_size: crate::__u64, ++ pub stx_blocks: crate::__u64, ++ pub stx_attributes_mask: crate::__u64, ++ pub stx_atime: statx_timestamp, ++ pub stx_btime: statx_timestamp, ++ pub stx_ctime: statx_timestamp, ++ pub stx_mtime: statx_timestamp, ++ pub stx_rdev_major: crate::__u32, ++ pub stx_rdev_minor: crate::__u32, ++ pub stx_dev_major: crate::__u32, ++ pub stx_dev_minor: crate::__u32, ++ pub stx_mnt_id: crate::__u64, ++ pub stx_dio_mem_align: crate::__u32, ++ pub stx_dio_offset_align: crate::__u32, ++ __statx_pad3: [crate::__u64; 12], ++ } ++ ++ pub struct statx_timestamp { ++ pub tv_sec: crate::__s64, ++ pub tv_nsec: crate::__u32, ++ __statx_timestamp_pad1: [crate::__s32; 1], ++ } ++ } ++ } ++} ++ ++s_no_extra_traits! { ++ #[cfg_attr( ++ any( ++ all( ++ target_arch = "x86", ++ not(target_env = "musl"), ++ not(target_os = "android") ++ ), ++ target_arch = "x86_64" ++ ), ++ repr(packed) ++ )] ++ pub struct epoll_event { ++ pub events: u32, ++ pub u64: u64, ++ } ++ ++ pub struct sockaddr_un { ++ pub sun_family: sa_family_t, ++ pub sun_path: [c_char; 108], ++ } ++ ++ pub struct sockaddr_storage { ++ pub ss_family: sa_family_t, ++ #[cfg(target_pointer_width = "32")] ++ __ss_pad2: [u8; 128 - 2 - 4], ++ #[cfg(target_pointer_width = "64")] ++ __ss_pad2: [u8; 128 - 2 - 8], ++ __ss_align: size_t, ++ } ++ ++ pub struct utsname { ++ pub sysname: [c_char; 65], ++ pub nodename: [c_char; 65], ++ pub release: [c_char; 65], ++ pub version: [c_char; 65], ++ pub machine: [c_char; 65], ++ pub domainname: [c_char; 65], ++ } ++ ++ pub struct sigevent { ++ pub sigev_value: crate::sigval, ++ pub sigev_signo: c_int, ++ pub sigev_notify: c_int, ++ // Actually a union. We only expose sigev_notify_thread_id because it's ++ // the most useful member ++ pub sigev_notify_thread_id: c_int, ++ #[cfg(target_pointer_width = "64")] ++ __unused1: [c_int; 11], ++ #[cfg(target_pointer_width = "32")] ++ __unused1: [c_int; 12], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for epoll_event { ++ fn eq(&self, other: &epoll_event) -> bool { ++ self.events == other.events && self.u64 == other.u64 ++ } ++ } ++ impl Eq for epoll_event {} ++ impl fmt::Debug for epoll_event { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ let events = self.events; ++ let u64 = self.u64; ++ f.debug_struct("epoll_event") ++ .field("events", &events) ++ .field("u64", &u64) ++ .finish() ++ } ++ } ++ impl hash::Hash for epoll_event { ++ fn hash(&self, state: &mut H) { ++ let events = self.events; ++ let u64 = self.u64; ++ events.hash(state); ++ u64.hash(state); ++ } ++ } ++ ++ impl PartialEq for sockaddr_un { ++ fn eq(&self, other: &sockaddr_un) -> bool { ++ self.sun_family == other.sun_family ++ && self ++ .sun_path ++ .iter() ++ .zip(other.sun_path.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for sockaddr_un {} ++ impl fmt::Debug for sockaddr_un { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sockaddr_un") ++ .field("sun_family", &self.sun_family) ++ // FIXME: .field("sun_path", &self.sun_path) ++ .finish() ++ } ++ } ++ impl hash::Hash for sockaddr_un { ++ fn hash(&self, state: &mut H) { ++ self.sun_family.hash(state); ++ self.sun_path.hash(state); ++ } ++ } ++ ++ impl PartialEq for sockaddr_storage { ++ fn eq(&self, other: &sockaddr_storage) -> bool { ++ self.ss_family == other.ss_family ++ && self ++ .__ss_pad2 ++ .iter() ++ .zip(other.__ss_pad2.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ ++ impl Eq for sockaddr_storage {} ++ ++ impl fmt::Debug for sockaddr_storage { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sockaddr_storage") ++ .field("ss_family", &self.ss_family) ++ .field("__ss_align", &self.__ss_align) ++ // FIXME: .field("__ss_pad2", &self.__ss_pad2) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for sockaddr_storage { ++ fn hash(&self, state: &mut H) { ++ self.ss_family.hash(state); ++ self.__ss_pad2.hash(state); ++ } ++ } ++ ++ impl PartialEq for utsname { ++ fn eq(&self, other: &utsname) -> bool { ++ self.sysname ++ .iter() ++ .zip(other.sysname.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .nodename ++ .iter() ++ .zip(other.nodename.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .release ++ .iter() ++ .zip(other.release.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .version ++ .iter() ++ .zip(other.version.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .machine ++ .iter() ++ .zip(other.machine.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .domainname ++ .iter() ++ .zip(other.domainname.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ ++ impl Eq for utsname {} ++ ++ impl fmt::Debug for utsname { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("utsname") ++ // FIXME: .field("sysname", &self.sysname) ++ // FIXME: .field("nodename", &self.nodename) ++ // FIXME: .field("release", &self.release) ++ // FIXME: .field("version", &self.version) ++ // FIXME: .field("machine", &self.machine) ++ // FIXME: .field("domainname", &self.domainname) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for utsname { ++ fn hash(&self, state: &mut H) { ++ self.sysname.hash(state); ++ self.nodename.hash(state); ++ self.release.hash(state); ++ self.version.hash(state); ++ self.machine.hash(state); ++ self.domainname.hash(state); ++ } ++ } ++ ++ impl PartialEq for sigevent { ++ fn eq(&self, other: &sigevent) -> bool { ++ self.sigev_value == other.sigev_value ++ && self.sigev_signo == other.sigev_signo ++ && self.sigev_notify == other.sigev_notify ++ && self.sigev_notify_thread_id == other.sigev_notify_thread_id ++ } ++ } ++ impl Eq for sigevent {} ++ impl fmt::Debug for sigevent { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sigevent") ++ .field("sigev_value", &self.sigev_value) ++ .field("sigev_signo", &self.sigev_signo) ++ .field("sigev_notify", &self.sigev_notify) ++ .field("sigev_notify_thread_id", &self.sigev_notify_thread_id) ++ .finish() ++ } ++ } ++ impl hash::Hash for sigevent { ++ fn hash(&self, state: &mut H) { ++ self.sigev_value.hash(state); ++ self.sigev_signo.hash(state); ++ self.sigev_notify.hash(state); ++ self.sigev_notify_thread_id.hash(state); ++ } ++ } ++ } ++} ++ ++// intentionally not public, only used for fd_set ++cfg_if! { ++ if #[cfg(target_pointer_width = "32")] { ++ const ULONG_SIZE: usize = 32; ++ } else if #[cfg(target_pointer_width = "64")] { ++ const ULONG_SIZE: usize = 64; ++ } else { ++ // Unknown target_pointer_width ++ } ++} ++ ++pub const EXIT_FAILURE: c_int = 1; ++pub const EXIT_SUCCESS: c_int = 0; ++pub const RAND_MAX: c_int = 2147483647; ++pub const EOF: c_int = -1; ++pub const SEEK_SET: c_int = 0; ++pub const SEEK_CUR: c_int = 1; ++pub const SEEK_END: c_int = 2; ++pub const _IOFBF: c_int = 0; ++pub const _IONBF: c_int = 2; ++pub const _IOLBF: c_int = 1; ++ ++pub const F_DUPFD: c_int = 0; ++pub const F_GETFD: c_int = 1; ++pub const F_SETFD: c_int = 2; ++pub const F_GETFL: c_int = 3; ++pub const F_SETFL: c_int = 4; ++ ++// Linux-specific fcntls ++pub const F_SETLEASE: c_int = 1024; ++pub const F_GETLEASE: c_int = 1025; ++pub const F_NOTIFY: c_int = 1026; ++pub const F_CANCELLK: c_int = 1029; ++pub const F_DUPFD_CLOEXEC: c_int = 1030; ++pub const F_SETPIPE_SZ: c_int = 1031; ++pub const F_GETPIPE_SZ: c_int = 1032; ++pub const F_ADD_SEALS: c_int = 1033; ++pub const F_GET_SEALS: c_int = 1034; ++ ++pub const F_SEAL_SEAL: c_int = 0x0001; ++pub const F_SEAL_SHRINK: c_int = 0x0002; ++pub const F_SEAL_GROW: c_int = 0x0004; ++pub const F_SEAL_WRITE: c_int = 0x0008; ++ ++// FIXME(#235): Include file sealing fcntls once we have a way to verify them. ++ ++pub const SIGTRAP: c_int = 5; ++ ++pub const PTHREAD_CREATE_JOINABLE: c_int = 0; ++pub const PTHREAD_CREATE_DETACHED: c_int = 1; ++ ++pub const CLOCK_REALTIME: crate::clockid_t = 0; ++pub const CLOCK_MONOTONIC: crate::clockid_t = 1; ++pub const CLOCK_PROCESS_CPUTIME_ID: crate::clockid_t = 2; ++pub const CLOCK_THREAD_CPUTIME_ID: crate::clockid_t = 3; ++pub const CLOCK_MONOTONIC_RAW: crate::clockid_t = 4; ++pub const CLOCK_REALTIME_COARSE: crate::clockid_t = 5; ++pub const CLOCK_MONOTONIC_COARSE: crate::clockid_t = 6; ++pub const CLOCK_BOOTTIME: crate::clockid_t = 7; ++pub const CLOCK_REALTIME_ALARM: crate::clockid_t = 8; ++pub const CLOCK_BOOTTIME_ALARM: crate::clockid_t = 9; ++pub const CLOCK_TAI: crate::clockid_t = 11; ++pub const TIMER_ABSTIME: c_int = 1; ++ ++pub const RUSAGE_SELF: c_int = 0; ++ ++pub const O_RDONLY: c_int = 0; ++pub const O_WRONLY: c_int = 1; ++pub const O_RDWR: c_int = 2; ++ ++pub const SOCK_CLOEXEC: c_int = O_CLOEXEC; ++ ++pub const S_IFIFO: crate::mode_t = 0o1_0000; ++pub const S_IFCHR: crate::mode_t = 0o2_0000; ++pub const S_IFBLK: crate::mode_t = 0o6_0000; ++pub const S_IFDIR: crate::mode_t = 0o4_0000; ++pub const S_IFREG: crate::mode_t = 0o10_0000; ++pub const S_IFLNK: crate::mode_t = 0o12_0000; ++pub const S_IFSOCK: crate::mode_t = 0o14_0000; ++pub const S_IFMT: crate::mode_t = 0o17_0000; ++pub const S_IRWXU: crate::mode_t = 0o0700; ++pub const S_IXUSR: crate::mode_t = 0o0100; ++pub const S_IWUSR: crate::mode_t = 0o0200; ++pub const S_IRUSR: crate::mode_t = 0o0400; ++pub const S_IRWXG: crate::mode_t = 0o0070; ++pub const S_IXGRP: crate::mode_t = 0o0010; ++pub const S_IWGRP: crate::mode_t = 0o0020; ++pub const S_IRGRP: crate::mode_t = 0o0040; ++pub const S_IRWXO: crate::mode_t = 0o0007; ++pub const S_IXOTH: crate::mode_t = 0o0001; ++pub const S_IWOTH: crate::mode_t = 0o0002; ++pub const S_IROTH: crate::mode_t = 0o0004; ++pub const F_OK: c_int = 0; ++pub const R_OK: c_int = 4; ++pub const W_OK: c_int = 2; ++pub const X_OK: c_int = 1; ++pub const STDIN_FILENO: c_int = 0; ++pub const STDOUT_FILENO: c_int = 1; ++pub const STDERR_FILENO: c_int = 2; ++pub const SIGHUP: c_int = 1; ++pub const SIGINT: c_int = 2; ++pub const SIGQUIT: c_int = 3; ++pub const SIGILL: c_int = 4; ++pub const SIGABRT: c_int = 6; ++pub const SIGFPE: c_int = 8; ++pub const SIGKILL: c_int = 9; ++pub const SIGSEGV: c_int = 11; ++pub const SIGPIPE: c_int = 13; ++pub const SIGALRM: c_int = 14; ++pub const SIGTERM: c_int = 15; ++ ++pub const PROT_NONE: c_int = 0; ++pub const PROT_READ: c_int = 1; ++pub const PROT_WRITE: c_int = 2; ++pub const PROT_EXEC: c_int = 4; ++ ++pub const XATTR_CREATE: c_int = 0x1; ++pub const XATTR_REPLACE: c_int = 0x2; ++ ++cfg_if! { ++ if #[cfg(target_os = "android")] { ++ pub const RLIM64_INFINITY: c_ulonglong = !0; ++ } else { ++ pub const RLIM64_INFINITY: crate::rlim64_t = !0; ++ } ++} ++ ++cfg_if! { ++ if #[cfg(target_env = "ohos")] { ++ pub const LC_CTYPE: c_int = 0; ++ pub const LC_NUMERIC: c_int = 1; ++ pub const LC_TIME: c_int = 2; ++ pub const LC_COLLATE: c_int = 3; ++ pub const LC_MONETARY: c_int = 4; ++ pub const LC_MESSAGES: c_int = 5; ++ pub const LC_PAPER: c_int = 6; ++ pub const LC_NAME: c_int = 7; ++ pub const LC_ADDRESS: c_int = 8; ++ pub const LC_TELEPHONE: c_int = 9; ++ pub const LC_MEASUREMENT: c_int = 10; ++ pub const LC_IDENTIFICATION: c_int = 11; ++ pub const LC_ALL: c_int = 12; ++ } else if #[cfg(not(target_env = "uclibc"))] { ++ pub const LC_CTYPE: c_int = 0; ++ pub const LC_NUMERIC: c_int = 1; ++ pub const LC_TIME: c_int = 2; ++ pub const LC_COLLATE: c_int = 3; ++ pub const LC_MONETARY: c_int = 4; ++ pub const LC_MESSAGES: c_int = 5; ++ pub const LC_ALL: c_int = 6; ++ } ++} ++ ++pub const LC_CTYPE_MASK: c_int = 1 << LC_CTYPE; ++pub const LC_NUMERIC_MASK: c_int = 1 << LC_NUMERIC; ++pub const LC_TIME_MASK: c_int = 1 << LC_TIME; ++pub const LC_COLLATE_MASK: c_int = 1 << LC_COLLATE; ++pub const LC_MONETARY_MASK: c_int = 1 << LC_MONETARY; ++pub const LC_MESSAGES_MASK: c_int = 1 << LC_MESSAGES; ++// LC_ALL_MASK defined per platform ++ ++pub const MAP_FILE: c_int = 0x0000; ++pub const MAP_SHARED: c_int = 0x0001; ++pub const MAP_PRIVATE: c_int = 0x0002; ++pub const MAP_FIXED: c_int = 0x0010; ++ ++pub const MAP_FAILED: *mut c_void = !0 as *mut c_void; ++ ++// MS_ flags for msync(2) ++pub const MS_ASYNC: c_int = 0x0001; ++pub const MS_INVALIDATE: c_int = 0x0002; ++pub const MS_SYNC: c_int = 0x0004; ++ ++// MS_ flags for mount(2) ++pub const MS_RDONLY: c_ulong = 0x01; ++pub const MS_NOSUID: c_ulong = 0x02; ++pub const MS_NODEV: c_ulong = 0x04; ++pub const MS_NOEXEC: c_ulong = 0x08; ++pub const MS_SYNCHRONOUS: c_ulong = 0x10; ++pub const MS_REMOUNT: c_ulong = 0x20; ++pub const MS_MANDLOCK: c_ulong = 0x40; ++pub const MS_DIRSYNC: c_ulong = 0x80; ++pub const MS_NOATIME: c_ulong = 0x0400; ++pub const MS_NODIRATIME: c_ulong = 0x0800; ++pub const MS_BIND: c_ulong = 0x1000; ++pub const MS_MOVE: c_ulong = 0x2000; ++pub const MS_REC: c_ulong = 0x4000; ++pub const MS_SILENT: c_ulong = 0x8000; ++pub const MS_POSIXACL: c_ulong = 0x010000; ++pub const MS_UNBINDABLE: c_ulong = 0x020000; ++pub const MS_PRIVATE: c_ulong = 0x040000; ++pub const MS_SLAVE: c_ulong = 0x080000; ++pub const MS_SHARED: c_ulong = 0x100000; ++pub const MS_RELATIME: c_ulong = 0x200000; ++pub const MS_KERNMOUNT: c_ulong = 0x400000; ++pub const MS_I_VERSION: c_ulong = 0x800000; ++pub const MS_STRICTATIME: c_ulong = 0x1000000; ++pub const MS_LAZYTIME: c_ulong = 0x2000000; ++pub const MS_ACTIVE: c_ulong = 0x40000000; ++pub const MS_MGC_VAL: c_ulong = 0xc0ed0000; ++pub const MS_MGC_MSK: c_ulong = 0xffff0000; ++ ++pub const SCM_RIGHTS: c_int = 0x01; ++pub const SCM_CREDENTIALS: c_int = 0x02; ++ ++pub const PROT_GROWSDOWN: c_int = 0x1000000; ++pub const PROT_GROWSUP: c_int = 0x2000000; ++ ++pub const MAP_TYPE: c_int = 0x000f; ++ ++pub const MADV_NORMAL: c_int = 0; ++pub const MADV_RANDOM: c_int = 1; ++pub const MADV_SEQUENTIAL: c_int = 2; ++pub const MADV_WILLNEED: c_int = 3; ++pub const MADV_DONTNEED: c_int = 4; ++pub const MADV_FREE: c_int = 8; ++pub const MADV_REMOVE: c_int = 9; ++pub const MADV_DONTFORK: c_int = 10; ++pub const MADV_DOFORK: c_int = 11; ++pub const MADV_MERGEABLE: c_int = 12; ++pub const MADV_UNMERGEABLE: c_int = 13; ++pub const MADV_HUGEPAGE: c_int = 14; ++pub const MADV_NOHUGEPAGE: c_int = 15; ++pub const MADV_DONTDUMP: c_int = 16; ++pub const MADV_DODUMP: c_int = 17; ++pub const MADV_WIPEONFORK: c_int = 18; ++pub const MADV_KEEPONFORK: c_int = 19; ++pub const MADV_COLD: c_int = 20; ++pub const MADV_PAGEOUT: c_int = 21; ++pub const MADV_HWPOISON: c_int = 100; ++cfg_if! { ++ if #[cfg(not(target_os = "emscripten"))] { ++ pub const MADV_POPULATE_READ: c_int = 22; ++ pub const MADV_POPULATE_WRITE: c_int = 23; ++ pub const MADV_DONTNEED_LOCKED: c_int = 24; ++ } ++} ++ ++pub const IFF_UP: c_int = 0x1; ++pub const IFF_BROADCAST: c_int = 0x2; ++pub const IFF_DEBUG: c_int = 0x4; ++pub const IFF_LOOPBACK: c_int = 0x8; ++pub const IFF_POINTOPOINT: c_int = 0x10; ++pub const IFF_NOTRAILERS: c_int = 0x20; ++pub const IFF_RUNNING: c_int = 0x40; ++pub const IFF_NOARP: c_int = 0x80; ++pub const IFF_PROMISC: c_int = 0x100; ++pub const IFF_ALLMULTI: c_int = 0x200; ++pub const IFF_MASTER: c_int = 0x400; ++pub const IFF_SLAVE: c_int = 0x800; ++pub const IFF_MULTICAST: c_int = 0x1000; ++pub const IFF_PORTSEL: c_int = 0x2000; ++pub const IFF_AUTOMEDIA: c_int = 0x4000; ++pub const IFF_DYNAMIC: c_int = 0x8000; ++ ++pub const SOL_IP: c_int = 0; ++pub const SOL_TCP: c_int = 6; ++pub const SOL_UDP: c_int = 17; ++pub const SOL_IPV6: c_int = 41; ++pub const SOL_ICMPV6: c_int = 58; ++pub const SOL_RAW: c_int = 255; ++pub const SOL_DECNET: c_int = 261; ++pub const SOL_X25: c_int = 262; ++pub const SOL_PACKET: c_int = 263; ++pub const SOL_ATM: c_int = 264; ++pub const SOL_AAL: c_int = 265; ++pub const SOL_IRDA: c_int = 266; ++pub const SOL_NETBEUI: c_int = 267; ++pub const SOL_LLC: c_int = 268; ++pub const SOL_DCCP: c_int = 269; ++pub const SOL_NETLINK: c_int = 270; ++pub const SOL_TIPC: c_int = 271; ++pub const SOL_BLUETOOTH: c_int = 274; ++pub const SOL_ALG: c_int = 279; ++ ++pub const AF_UNSPEC: c_int = 0; ++pub const AF_UNIX: c_int = 1; ++pub const AF_LOCAL: c_int = 1; ++pub const AF_INET: c_int = 2; ++pub const AF_AX25: c_int = 3; ++pub const AF_IPX: c_int = 4; ++pub const AF_APPLETALK: c_int = 5; ++pub const AF_NETROM: c_int = 6; ++pub const AF_BRIDGE: c_int = 7; ++pub const AF_ATMPVC: c_int = 8; ++pub const AF_X25: c_int = 9; ++pub const AF_INET6: c_int = 10; ++pub const AF_ROSE: c_int = 11; ++pub const AF_DECnet: c_int = 12; ++pub const AF_NETBEUI: c_int = 13; ++pub const AF_SECURITY: c_int = 14; ++pub const AF_KEY: c_int = 15; ++pub const AF_NETLINK: c_int = 16; ++pub const AF_ROUTE: c_int = AF_NETLINK; ++pub const AF_PACKET: c_int = 17; ++pub const AF_ASH: c_int = 18; ++pub const AF_ECONET: c_int = 19; ++pub const AF_ATMSVC: c_int = 20; ++pub const AF_RDS: c_int = 21; ++pub const AF_SNA: c_int = 22; ++pub const AF_IRDA: c_int = 23; ++pub const AF_PPPOX: c_int = 24; ++pub const AF_WANPIPE: c_int = 25; ++pub const AF_LLC: c_int = 26; ++pub const AF_CAN: c_int = 29; ++pub const AF_TIPC: c_int = 30; ++pub const AF_BLUETOOTH: c_int = 31; ++pub const AF_IUCV: c_int = 32; ++pub const AF_RXRPC: c_int = 33; ++pub const AF_ISDN: c_int = 34; ++pub const AF_PHONET: c_int = 35; ++pub const AF_IEEE802154: c_int = 36; ++pub const AF_CAIF: c_int = 37; ++pub const AF_ALG: c_int = 38; ++ ++pub const PF_UNSPEC: c_int = AF_UNSPEC; ++pub const PF_UNIX: c_int = AF_UNIX; ++pub const PF_LOCAL: c_int = AF_LOCAL; ++pub const PF_INET: c_int = AF_INET; ++pub const PF_AX25: c_int = AF_AX25; ++pub const PF_IPX: c_int = AF_IPX; ++pub const PF_APPLETALK: c_int = AF_APPLETALK; ++pub const PF_NETROM: c_int = AF_NETROM; ++pub const PF_BRIDGE: c_int = AF_BRIDGE; ++pub const PF_ATMPVC: c_int = AF_ATMPVC; ++pub const PF_X25: c_int = AF_X25; ++pub const PF_INET6: c_int = AF_INET6; ++pub const PF_ROSE: c_int = AF_ROSE; ++pub const PF_DECnet: c_int = AF_DECnet; ++pub const PF_NETBEUI: c_int = AF_NETBEUI; ++pub const PF_SECURITY: c_int = AF_SECURITY; ++pub const PF_KEY: c_int = AF_KEY; ++pub const PF_NETLINK: c_int = AF_NETLINK; ++pub const PF_ROUTE: c_int = AF_ROUTE; ++pub const PF_PACKET: c_int = AF_PACKET; ++pub const PF_ASH: c_int = AF_ASH; ++pub const PF_ECONET: c_int = AF_ECONET; ++pub const PF_ATMSVC: c_int = AF_ATMSVC; ++pub const PF_RDS: c_int = AF_RDS; ++pub const PF_SNA: c_int = AF_SNA; ++pub const PF_IRDA: c_int = AF_IRDA; ++pub const PF_PPPOX: c_int = AF_PPPOX; ++pub const PF_WANPIPE: c_int = AF_WANPIPE; ++pub const PF_LLC: c_int = AF_LLC; ++pub const PF_CAN: c_int = AF_CAN; ++pub const PF_TIPC: c_int = AF_TIPC; ++pub const PF_BLUETOOTH: c_int = AF_BLUETOOTH; ++pub const PF_IUCV: c_int = AF_IUCV; ++pub const PF_RXRPC: c_int = AF_RXRPC; ++pub const PF_ISDN: c_int = AF_ISDN; ++pub const PF_PHONET: c_int = AF_PHONET; ++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 MSG_OOB: c_int = 1; ++pub const MSG_PEEK: c_int = 2; ++pub const MSG_DONTROUTE: c_int = 4; ++pub const MSG_CTRUNC: c_int = 8; ++pub const MSG_TRUNC: c_int = 0x20; ++pub const MSG_DONTWAIT: c_int = 0x40; ++pub const MSG_EOR: c_int = 0x80; ++pub const MSG_WAITALL: c_int = 0x100; ++pub const MSG_FIN: c_int = 0x200; ++pub const MSG_SYN: c_int = 0x400; ++pub const MSG_CONFIRM: c_int = 0x800; ++pub const MSG_RST: c_int = 0x1000; ++pub const MSG_ERRQUEUE: c_int = 0x2000; ++pub const MSG_NOSIGNAL: c_int = 0x4000; ++pub const MSG_MORE: c_int = 0x8000; ++pub const MSG_WAITFORONE: c_int = 0x10000; ++pub const MSG_FASTOPEN: c_int = 0x20000000; ++pub const MSG_CMSG_CLOEXEC: c_int = 0x40000000; ++ ++pub const SCM_TIMESTAMP: c_int = SO_TIMESTAMP; ++ ++pub const SOCK_RAW: c_int = 3; ++pub const SOCK_RDM: c_int = 4; ++pub const IP_TOS: c_int = 1; ++pub const IP_TTL: c_int = 2; ++pub const IP_HDRINCL: c_int = 3; ++pub const IP_OPTIONS: c_int = 4; ++pub const IP_ROUTER_ALERT: c_int = 5; ++pub const IP_RECVOPTS: c_int = 6; ++pub const IP_RETOPTS: c_int = 7; ++pub const IP_PKTINFO: c_int = 8; ++pub const IP_PKTOPTIONS: c_int = 9; ++pub const IP_MTU_DISCOVER: c_int = 10; ++pub const IP_RECVERR: c_int = 11; ++pub const IP_RECVTTL: c_int = 12; ++pub const IP_RECVTOS: c_int = 13; ++pub const IP_MTU: c_int = 14; ++pub const IP_FREEBIND: c_int = 15; ++pub const IP_IPSEC_POLICY: c_int = 16; ++pub const IP_XFRM_POLICY: c_int = 17; ++pub const IP_PASSSEC: c_int = 18; ++pub const IP_TRANSPARENT: c_int = 19; ++pub const IP_ORIGDSTADDR: c_int = 20; ++pub const IP_RECVORIGDSTADDR: c_int = IP_ORIGDSTADDR; ++pub const IP_MINTTL: c_int = 21; ++pub const IP_NODEFRAG: c_int = 22; ++pub const IP_CHECKSUM: c_int = 23; ++pub const IP_BIND_ADDRESS_NO_PORT: c_int = 24; ++pub const IP_MULTICAST_IF: c_int = 32; ++pub const IP_MULTICAST_TTL: c_int = 33; ++pub const IP_MULTICAST_LOOP: c_int = 34; ++pub const IP_ADD_MEMBERSHIP: c_int = 35; ++pub const IP_DROP_MEMBERSHIP: c_int = 36; ++pub const IP_UNBLOCK_SOURCE: c_int = 37; ++pub const IP_BLOCK_SOURCE: c_int = 38; ++pub const IP_ADD_SOURCE_MEMBERSHIP: c_int = 39; ++pub const IP_DROP_SOURCE_MEMBERSHIP: c_int = 40; ++pub const IP_MSFILTER: c_int = 41; ++pub const IP_MULTICAST_ALL: c_int = 49; ++pub const IP_UNICAST_IF: c_int = 50; ++ ++pub const IP_DEFAULT_MULTICAST_TTL: c_int = 1; ++pub const IP_DEFAULT_MULTICAST_LOOP: c_int = 1; ++ ++pub const IP_PMTUDISC_DONT: c_int = 0; ++pub const IP_PMTUDISC_WANT: c_int = 1; ++pub const IP_PMTUDISC_DO: c_int = 2; ++pub const IP_PMTUDISC_PROBE: c_int = 3; ++pub const IP_PMTUDISC_INTERFACE: c_int = 4; ++pub const IP_PMTUDISC_OMIT: c_int = 5; ++ ++// IPPROTO_IP defined in src/unix/mod.rs ++/// Hop-by-hop option header ++pub const IPPROTO_HOPOPTS: c_int = 0; ++// IPPROTO_ICMP defined in src/unix/mod.rs ++/// group mgmt protocol ++pub const IPPROTO_IGMP: c_int = 2; ++/// for compatibility ++pub const IPPROTO_IPIP: c_int = 4; ++// IPPROTO_TCP defined in src/unix/mod.rs ++/// exterior gateway protocol ++pub const IPPROTO_EGP: c_int = 8; ++/// pup ++pub const IPPROTO_PUP: c_int = 12; ++// IPPROTO_UDP defined in src/unix/mod.rs ++/// xns idp ++pub const IPPROTO_IDP: c_int = 22; ++/// tp-4 w/ class negotiation ++pub const IPPROTO_TP: c_int = 29; ++/// DCCP ++pub const IPPROTO_DCCP: c_int = 33; ++// IPPROTO_IPV6 defined in src/unix/mod.rs ++/// IP6 routing header ++pub const IPPROTO_ROUTING: c_int = 43; ++/// IP6 fragmentation header ++pub const IPPROTO_FRAGMENT: c_int = 44; ++/// resource reservation ++pub const IPPROTO_RSVP: c_int = 46; ++/// General Routing Encap. ++pub const IPPROTO_GRE: c_int = 47; ++/// IP6 Encap Sec. Payload ++pub const IPPROTO_ESP: c_int = 50; ++/// IP6 Auth Header ++pub const IPPROTO_AH: c_int = 51; ++// IPPROTO_ICMPV6 defined in src/unix/mod.rs ++/// IP6 no next header ++pub const IPPROTO_NONE: c_int = 59; ++/// IP6 destination option ++pub const IPPROTO_DSTOPTS: c_int = 60; ++pub const IPPROTO_MTP: c_int = 92; ++/// encapsulation header ++pub const IPPROTO_ENCAP: c_int = 98; ++/// Protocol indep. multicast ++pub const IPPROTO_PIM: c_int = 103; ++/// IP Payload Comp. Protocol ++pub const IPPROTO_COMP: c_int = 108; ++/// SCTP ++pub const IPPROTO_SCTP: c_int = 132; ++pub const IPPROTO_MH: c_int = 135; ++pub const IPPROTO_UDPLITE: c_int = 136; ++/// raw IP packet ++pub const IPPROTO_RAW: c_int = 255; ++pub const IPPROTO_BEETPH: c_int = 94; ++pub const IPPROTO_MPLS: c_int = 137; ++/// Multipath TCP ++pub const IPPROTO_MPTCP: c_int = 262; ++/// Ethernet-within-IPv6 encapsulation. ++pub const IPPROTO_ETHERNET: c_int = 143; ++ ++pub const MCAST_EXCLUDE: c_int = 0; ++pub const MCAST_INCLUDE: c_int = 1; ++pub const MCAST_JOIN_GROUP: c_int = 42; ++pub const MCAST_BLOCK_SOURCE: c_int = 43; ++pub const MCAST_UNBLOCK_SOURCE: c_int = 44; ++pub const MCAST_LEAVE_GROUP: c_int = 45; ++pub const MCAST_JOIN_SOURCE_GROUP: c_int = 46; ++pub const MCAST_LEAVE_SOURCE_GROUP: c_int = 47; ++pub const MCAST_MSFILTER: c_int = 48; ++ ++pub const IPV6_ADDRFORM: c_int = 1; ++pub const IPV6_2292PKTINFO: c_int = 2; ++pub const IPV6_2292HOPOPTS: c_int = 3; ++pub const IPV6_2292DSTOPTS: c_int = 4; ++pub const IPV6_2292RTHDR: c_int = 5; ++pub const IPV6_2292PKTOPTIONS: c_int = 6; ++pub const IPV6_CHECKSUM: c_int = 7; ++pub const IPV6_2292HOPLIMIT: c_int = 8; ++pub const IPV6_NEXTHOP: c_int = 9; ++pub const IPV6_AUTHHDR: c_int = 10; ++pub const IPV6_UNICAST_HOPS: c_int = 16; ++pub const IPV6_MULTICAST_IF: c_int = 17; ++pub const IPV6_MULTICAST_HOPS: c_int = 18; ++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_ROUTER_ALERT: c_int = 22; ++pub const IPV6_MTU_DISCOVER: c_int = 23; ++pub const IPV6_MTU: c_int = 24; ++pub const IPV6_RECVERR: c_int = 25; ++pub const IPV6_V6ONLY: c_int = 26; ++pub const IPV6_JOIN_ANYCAST: c_int = 27; ++pub const IPV6_LEAVE_ANYCAST: c_int = 28; ++pub const IPV6_IPSEC_POLICY: c_int = 34; ++pub const IPV6_XFRM_POLICY: c_int = 35; ++pub const IPV6_HDRINCL: c_int = 36; ++pub const IPV6_RECVPKTINFO: c_int = 49; ++pub const IPV6_PKTINFO: c_int = 50; ++pub const IPV6_RECVHOPLIMIT: c_int = 51; ++pub const IPV6_HOPLIMIT: c_int = 52; ++pub const IPV6_RECVHOPOPTS: c_int = 53; ++pub const IPV6_HOPOPTS: c_int = 54; ++pub const IPV6_RTHDRDSTOPTS: c_int = 55; ++pub const IPV6_RECVRTHDR: c_int = 56; ++pub const IPV6_RTHDR: c_int = 57; ++pub const IPV6_RECVDSTOPTS: c_int = 58; ++pub const IPV6_DSTOPTS: c_int = 59; ++pub const IPV6_RECVPATHMTU: c_int = 60; ++pub const IPV6_PATHMTU: c_int = 61; ++pub const IPV6_DONTFRAG: c_int = 62; ++pub const IPV6_RECVTCLASS: c_int = 66; ++pub const IPV6_TCLASS: c_int = 67; ++pub const IPV6_AUTOFLOWLABEL: c_int = 70; ++pub const IPV6_ADDR_PREFERENCES: c_int = 72; ++pub const IPV6_MINHOPCOUNT: c_int = 73; ++pub const IPV6_ORIGDSTADDR: c_int = 74; ++pub const IPV6_RECVORIGDSTADDR: c_int = IPV6_ORIGDSTADDR; ++pub const IPV6_TRANSPARENT: c_int = 75; ++pub const IPV6_UNICAST_IF: c_int = 76; ++pub const IPV6_PREFER_SRC_TMP: c_int = 0x0001; ++pub const IPV6_PREFER_SRC_PUBLIC: c_int = 0x0002; ++pub const IPV6_PREFER_SRC_PUBTMP_DEFAULT: c_int = 0x0100; ++pub const IPV6_PREFER_SRC_COA: c_int = 0x0004; ++pub const IPV6_PREFER_SRC_HOME: c_int = 0x0400; ++pub const IPV6_PREFER_SRC_CGA: c_int = 0x0008; ++pub const IPV6_PREFER_SRC_NONCGA: c_int = 0x0800; ++ ++pub const IPV6_PMTUDISC_DONT: c_int = 0; ++pub const IPV6_PMTUDISC_WANT: c_int = 1; ++pub const IPV6_PMTUDISC_DO: c_int = 2; ++pub const IPV6_PMTUDISC_PROBE: c_int = 3; ++pub const IPV6_PMTUDISC_INTERFACE: c_int = 4; ++pub const IPV6_PMTUDISC_OMIT: c_int = 5; ++ ++pub const TCP_NODELAY: c_int = 1; ++pub const TCP_MAXSEG: c_int = 2; ++pub const TCP_CORK: c_int = 3; ++pub const TCP_KEEPIDLE: c_int = 4; ++pub const TCP_KEEPINTVL: c_int = 5; ++pub const TCP_KEEPCNT: c_int = 6; ++pub const TCP_SYNCNT: c_int = 7; ++pub const TCP_LINGER2: c_int = 8; ++pub const TCP_DEFER_ACCEPT: c_int = 9; ++pub const TCP_WINDOW_CLAMP: c_int = 10; ++pub const TCP_INFO: c_int = 11; ++pub const TCP_QUICKACK: c_int = 12; ++pub const TCP_CONGESTION: c_int = 13; ++pub const TCP_MD5SIG: c_int = 14; ++cfg_if! { ++ if #[cfg(all( ++ target_os = "linux", ++ any(target_env = "gnu", target_env = "musl", target_env = "ohos") ++ ))] { ++ // WARN: deprecated ++ pub const TCP_COOKIE_TRANSACTIONS: c_int = 15; ++ } ++} ++pub const TCP_THIN_LINEAR_TIMEOUTS: c_int = 16; ++pub const TCP_THIN_DUPACK: c_int = 17; ++pub const TCP_USER_TIMEOUT: c_int = 18; ++pub const TCP_REPAIR: c_int = 19; ++pub const TCP_REPAIR_QUEUE: c_int = 20; ++pub const TCP_QUEUE_SEQ: c_int = 21; ++pub const TCP_REPAIR_OPTIONS: c_int = 22; ++pub const TCP_FASTOPEN: c_int = 23; ++pub const TCP_TIMESTAMP: c_int = 24; ++pub const TCP_NOTSENT_LOWAT: c_int = 25; ++pub const TCP_CC_INFO: c_int = 26; ++pub const TCP_SAVE_SYN: c_int = 27; ++pub const TCP_SAVED_SYN: c_int = 28; ++cfg_if! { ++ if #[cfg(not(target_os = "emscripten"))] { ++ // NOTE: emscripten doesn't support these options yet. ++ ++ pub const TCP_REPAIR_WINDOW: c_int = 29; ++ pub const TCP_FASTOPEN_CONNECT: c_int = 30; ++ pub const TCP_ULP: c_int = 31; ++ pub const TCP_MD5SIG_EXT: c_int = 32; ++ pub const TCP_FASTOPEN_KEY: c_int = 33; ++ pub const TCP_FASTOPEN_NO_COOKIE: c_int = 34; ++ pub const TCP_ZEROCOPY_RECEIVE: c_int = 35; ++ pub const TCP_INQ: c_int = 36; ++ pub const TCP_CM_INQ: c_int = TCP_INQ; ++ // NOTE: Some CI images doesn't have this option yet. ++ // pub const TCP_TX_DELAY: c_int = 37; ++ pub const TCP_MD5SIG_MAXKEYLEN: usize = 80; ++ } ++} ++ ++pub const SO_DEBUG: c_int = 1; ++ ++pub const SHUT_RD: c_int = 0; ++pub const SHUT_WR: c_int = 1; ++pub const SHUT_RDWR: c_int = 2; ++ ++pub const LOCK_SH: c_int = 1; ++pub const LOCK_EX: c_int = 2; ++pub const LOCK_NB: c_int = 4; ++pub const LOCK_UN: c_int = 8; ++ ++pub const SS_ONSTACK: c_int = 1; ++pub const SS_DISABLE: c_int = 2; ++ ++pub const PATH_MAX: c_int = 4096; ++ ++pub const UIO_MAXIOV: c_int = 1024; ++ ++pub const FD_SETSIZE: usize = 1024; ++ ++pub const EPOLLIN: c_int = 0x1; ++pub const EPOLLPRI: c_int = 0x2; ++pub const EPOLLOUT: c_int = 0x4; ++pub const EPOLLERR: c_int = 0x8; ++pub const EPOLLHUP: c_int = 0x10; ++pub const EPOLLRDNORM: c_int = 0x40; ++pub const EPOLLRDBAND: c_int = 0x80; ++pub const EPOLLWRNORM: c_int = 0x100; ++pub const EPOLLWRBAND: c_int = 0x200; ++pub const EPOLLMSG: c_int = 0x400; ++pub const EPOLLRDHUP: c_int = 0x2000; ++pub const EPOLLEXCLUSIVE: c_int = 0x10000000; ++pub const EPOLLWAKEUP: c_int = 0x20000000; ++pub const EPOLLONESHOT: c_int = 0x40000000; ++pub const EPOLLET: c_int = 0x80000000; ++ ++pub const EPOLL_CTL_ADD: c_int = 1; ++pub const EPOLL_CTL_MOD: c_int = 3; ++pub const EPOLL_CTL_DEL: c_int = 2; ++ ++pub const MNT_FORCE: c_int = 0x1; ++pub const MNT_DETACH: c_int = 0x2; ++pub const MNT_EXPIRE: c_int = 0x4; ++pub const UMOUNT_NOFOLLOW: c_int = 0x8; ++ ++pub const Q_GETFMT: c_int = 0x800004; ++pub const Q_GETINFO: c_int = 0x800005; ++pub const Q_SETINFO: c_int = 0x800006; ++pub const QIF_BLIMITS: u32 = 1; ++pub const QIF_SPACE: u32 = 2; ++pub const QIF_ILIMITS: u32 = 4; ++pub const QIF_INODES: u32 = 8; ++pub const QIF_BTIME: u32 = 16; ++pub const QIF_ITIME: u32 = 32; ++pub const QIF_LIMITS: u32 = 5; ++pub const QIF_USAGE: u32 = 10; ++pub const QIF_TIMES: u32 = 48; ++pub const QIF_ALL: u32 = 63; ++ ++pub const Q_SYNC: c_int = 0x800001; ++pub const Q_QUOTAON: c_int = 0x800002; ++pub const Q_QUOTAOFF: c_int = 0x800003; ++pub const Q_GETQUOTA: c_int = 0x800007; ++pub const Q_SETQUOTA: c_int = 0x800008; ++ ++pub const TCIOFF: c_int = 2; ++pub const TCION: c_int = 3; ++pub const TCOOFF: c_int = 0; ++pub const TCOON: c_int = 1; ++pub const TCIFLUSH: c_int = 0; ++pub const TCOFLUSH: c_int = 1; ++pub const TCIOFLUSH: c_int = 2; ++pub const NL0: crate::tcflag_t = 0x00000000; ++pub const NL1: crate::tcflag_t = 0x00000100; ++pub const TAB0: crate::tcflag_t = 0x00000000; ++pub const CR0: crate::tcflag_t = 0x00000000; ++pub const FF0: crate::tcflag_t = 0x00000000; ++pub const BS0: crate::tcflag_t = 0x00000000; ++pub const VT0: crate::tcflag_t = 0x00000000; ++pub const VERASE: usize = 2; ++pub const VKILL: usize = 3; ++pub const VINTR: usize = 0; ++pub const VQUIT: usize = 1; ++pub const VLNEXT: usize = 15; ++pub const IGNBRK: crate::tcflag_t = 0x00000001; ++pub const BRKINT: crate::tcflag_t = 0x00000002; ++pub const IGNPAR: crate::tcflag_t = 0x00000004; ++pub const PARMRK: crate::tcflag_t = 0x00000008; ++pub const INPCK: crate::tcflag_t = 0x00000010; ++pub const ISTRIP: crate::tcflag_t = 0x00000020; ++pub const INLCR: crate::tcflag_t = 0x00000040; ++pub const IGNCR: crate::tcflag_t = 0x00000080; ++pub const ICRNL: crate::tcflag_t = 0x00000100; ++pub const IXANY: crate::tcflag_t = 0x00000800; ++pub const IMAXBEL: crate::tcflag_t = 0x00002000; ++pub const OPOST: crate::tcflag_t = 0x1; ++pub const CS5: crate::tcflag_t = 0x00000000; ++pub const CRTSCTS: crate::tcflag_t = 0x80000000; ++pub const ECHO: crate::tcflag_t = 0x00000008; ++pub const OCRNL: crate::tcflag_t = 0o000010; ++pub const ONOCR: crate::tcflag_t = 0o000020; ++pub const ONLRET: crate::tcflag_t = 0o000040; ++pub const OFILL: crate::tcflag_t = 0o000100; ++pub const OFDEL: crate::tcflag_t = 0o000200; ++ ++pub const CLONE_VM: c_int = 0x100; ++pub const CLONE_FS: c_int = 0x200; ++pub const CLONE_FILES: c_int = 0x400; ++pub const CLONE_SIGHAND: c_int = 0x800; ++pub const CLONE_PTRACE: c_int = 0x2000; ++pub const CLONE_VFORK: c_int = 0x4000; ++pub const CLONE_PARENT: c_int = 0x8000; ++pub const CLONE_THREAD: c_int = 0x10000; ++pub const CLONE_NEWNS: c_int = 0x20000; ++pub const CLONE_SYSVSEM: c_int = 0x40000; ++pub const CLONE_SETTLS: c_int = 0x80000; ++pub const CLONE_PARENT_SETTID: c_int = 0x100000; ++pub const CLONE_CHILD_CLEARTID: c_int = 0x200000; ++pub const CLONE_DETACHED: c_int = 0x400000; ++pub const CLONE_UNTRACED: c_int = 0x800000; ++pub const CLONE_CHILD_SETTID: c_int = 0x01000000; ++pub const CLONE_NEWCGROUP: c_int = 0x02000000; ++pub const CLONE_NEWUTS: c_int = 0x04000000; ++pub const CLONE_NEWIPC: c_int = 0x08000000; ++pub const CLONE_NEWUSER: c_int = 0x10000000; ++pub const CLONE_NEWPID: c_int = 0x20000000; ++pub const CLONE_NEWNET: c_int = 0x40000000; ++pub const CLONE_IO: c_int = 0x80000000; ++ ++pub const WNOHANG: c_int = 0x00000001; ++pub const WUNTRACED: c_int = 0x00000002; ++pub const WSTOPPED: c_int = WUNTRACED; ++pub const WEXITED: c_int = 0x00000004; ++pub const WCONTINUED: c_int = 0x00000008; ++pub const WNOWAIT: c_int = 0x01000000; ++ ++// Options for personality(2). ++pub const ADDR_NO_RANDOMIZE: c_int = 0x0040000; ++pub const MMAP_PAGE_ZERO: c_int = 0x0100000; ++pub const ADDR_COMPAT_LAYOUT: c_int = 0x0200000; ++pub const READ_IMPLIES_EXEC: c_int = 0x0400000; ++pub const ADDR_LIMIT_32BIT: c_int = 0x0800000; ++pub const SHORT_INODE: c_int = 0x1000000; ++pub const WHOLE_SECONDS: c_int = 0x2000000; ++pub const STICKY_TIMEOUTS: c_int = 0x4000000; ++pub const ADDR_LIMIT_3GB: c_int = 0x8000000; ++ ++// Options set using PTRACE_SETOPTIONS. ++pub const PTRACE_O_TRACESYSGOOD: c_int = 0x00000001; ++pub const PTRACE_O_TRACEFORK: c_int = 0x00000002; ++pub const PTRACE_O_TRACEVFORK: c_int = 0x00000004; ++pub const PTRACE_O_TRACECLONE: c_int = 0x00000008; ++pub const PTRACE_O_TRACEEXEC: c_int = 0x00000010; ++pub const PTRACE_O_TRACEVFORKDONE: c_int = 0x00000020; ++pub const PTRACE_O_TRACEEXIT: c_int = 0x00000040; ++pub const PTRACE_O_TRACESECCOMP: c_int = 0x00000080; ++pub const PTRACE_O_SUSPEND_SECCOMP: c_int = 0x00200000; ++pub const PTRACE_O_EXITKILL: c_int = 0x00100000; ++pub const PTRACE_O_MASK: c_int = 0x003000ff; ++ ++// Wait extended result codes for the above trace options. ++pub const PTRACE_EVENT_FORK: c_int = 1; ++pub const PTRACE_EVENT_VFORK: c_int = 2; ++pub const PTRACE_EVENT_CLONE: c_int = 3; ++pub const PTRACE_EVENT_EXEC: c_int = 4; ++pub const PTRACE_EVENT_VFORK_DONE: c_int = 5; ++pub const PTRACE_EVENT_EXIT: c_int = 6; ++pub const PTRACE_EVENT_SECCOMP: c_int = 7; ++ ++pub const __WNOTHREAD: c_int = 0x20000000; ++pub const __WALL: c_int = 0x40000000; ++pub const __WCLONE: c_int = 0x80000000; ++ ++pub const SPLICE_F_MOVE: c_uint = 0x01; ++pub const SPLICE_F_NONBLOCK: c_uint = 0x02; ++pub const SPLICE_F_MORE: c_uint = 0x04; ++pub const SPLICE_F_GIFT: c_uint = 0x08; ++ ++pub const RTLD_LOCAL: c_int = 0; ++pub const RTLD_LAZY: c_int = 1; ++ ++pub const POSIX_FADV_NORMAL: c_int = 0; ++pub const POSIX_FADV_RANDOM: c_int = 1; ++pub const POSIX_FADV_SEQUENTIAL: c_int = 2; ++pub const POSIX_FADV_WILLNEED: c_int = 3; ++ ++pub const AT_FDCWD: c_int = -100; ++pub const AT_SYMLINK_NOFOLLOW: c_int = 0x100; ++pub const AT_REMOVEDIR: c_int = 0x200; ++pub const AT_SYMLINK_FOLLOW: c_int = 0x400; ++pub const AT_NO_AUTOMOUNT: c_int = 0x800; ++pub const AT_EMPTY_PATH: c_int = 0x1000; ++pub const AT_RECURSIVE: c_int = 0x8000; ++ ++pub const LOG_CRON: c_int = 9 << 3; ++pub const LOG_AUTHPRIV: c_int = 10 << 3; ++pub const LOG_FTP: c_int = 11 << 3; ++pub const LOG_PERROR: c_int = 0x20; ++ ++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; ++pub const CLD_TRAPPED: c_int = 4; ++pub const CLD_STOPPED: c_int = 5; ++pub const CLD_CONTINUED: c_int = 6; ++ ++pub const SIGEV_SIGNAL: c_int = 0; ++pub const SIGEV_NONE: c_int = 1; ++pub const SIGEV_THREAD: c_int = 2; ++ ++pub const P_ALL: idtype_t = 0; ++pub const P_PID: idtype_t = 1; ++pub const P_PGID: idtype_t = 2; ++cfg_if! { ++ if #[cfg(not(target_os = "emscripten"))] { ++ pub const P_PIDFD: idtype_t = 3; ++ } ++} ++ ++pub const UTIME_OMIT: c_long = 1073741822; ++pub const UTIME_NOW: c_long = 1073741823; ++ ++pub const POLLIN: c_short = 0x1; ++pub const POLLPRI: c_short = 0x2; ++pub const POLLOUT: c_short = 0x4; ++pub const POLLERR: c_short = 0x8; ++pub const POLLHUP: c_short = 0x10; ++pub const POLLNVAL: c_short = 0x20; ++pub const POLLRDNORM: c_short = 0x040; ++pub const POLLRDBAND: c_short = 0x080; ++#[cfg(not(any(target_arch = "sparc", target_arch = "sparc64")))] ++pub const POLLRDHUP: c_short = 0x2000; ++#[cfg(any(target_arch = "sparc", target_arch = "sparc64"))] ++pub const POLLRDHUP: c_short = 0x800; ++ ++pub const IPTOS_LOWDELAY: u8 = 0x10; ++pub const IPTOS_THROUGHPUT: u8 = 0x08; ++pub const IPTOS_RELIABILITY: u8 = 0x04; ++pub const IPTOS_MINCOST: u8 = 0x02; ++ ++pub const IPTOS_PREC_NETCONTROL: u8 = 0xe0; ++pub const IPTOS_PREC_INTERNETCONTROL: u8 = 0xc0; ++pub const IPTOS_PREC_CRITIC_ECP: u8 = 0xa0; ++pub const IPTOS_PREC_FLASHOVERRIDE: u8 = 0x80; ++pub const IPTOS_PREC_FLASH: u8 = 0x60; ++pub const IPTOS_PREC_IMMEDIATE: u8 = 0x40; ++pub const IPTOS_PREC_PRIORITY: u8 = 0x20; ++pub const IPTOS_PREC_ROUTINE: u8 = 0x00; ++ ++pub const IPTOS_ECN_MASK: u8 = 0x03; ++pub const IPTOS_ECN_ECT1: u8 = 0x01; ++pub const IPTOS_ECN_ECT0: u8 = 0x02; ++pub const IPTOS_ECN_CE: u8 = 0x03; ++ ++pub const IPOPT_COPY: u8 = 0x80; ++pub const IPOPT_CLASS_MASK: u8 = 0x60; ++pub const IPOPT_NUMBER_MASK: u8 = 0x1f; ++ ++pub const IPOPT_CONTROL: u8 = 0x00; ++pub const IPOPT_RESERVED1: u8 = 0x20; ++pub const IPOPT_MEASUREMENT: u8 = 0x40; ++pub const IPOPT_RESERVED2: u8 = 0x60; ++pub const IPOPT_END: u8 = 0 | IPOPT_CONTROL; ++pub const IPOPT_NOOP: u8 = 1 | IPOPT_CONTROL; ++pub const IPOPT_SEC: u8 = 2 | IPOPT_CONTROL | IPOPT_COPY; ++pub const IPOPT_LSRR: u8 = 3 | IPOPT_CONTROL | IPOPT_COPY; ++pub const IPOPT_TIMESTAMP: u8 = 4 | IPOPT_MEASUREMENT; ++pub const IPOPT_RR: u8 = 7 | IPOPT_CONTROL; ++pub const IPOPT_SID: u8 = 8 | IPOPT_CONTROL | IPOPT_COPY; ++pub const IPOPT_SSRR: u8 = 9 | IPOPT_CONTROL | IPOPT_COPY; ++pub const IPOPT_RA: u8 = 20 | IPOPT_CONTROL | IPOPT_COPY; ++pub const IPVERSION: u8 = 4; ++pub const MAXTTL: u8 = 255; ++pub const IPDEFTTL: u8 = 64; ++pub const IPOPT_OPTVAL: u8 = 0; ++pub const IPOPT_OLEN: u8 = 1; ++pub const IPOPT_OFFSET: u8 = 2; ++pub const IPOPT_MINOFF: u8 = 4; ++pub const MAX_IPOPTLEN: u8 = 40; ++pub const IPOPT_NOP: u8 = IPOPT_NOOP; ++pub const IPOPT_EOL: u8 = IPOPT_END; ++pub const IPOPT_TS: u8 = IPOPT_TIMESTAMP; ++pub const IPOPT_TS_TSONLY: u8 = 0; ++pub const IPOPT_TS_TSANDADDR: u8 = 1; ++pub const IPOPT_TS_PRESPEC: u8 = 3; ++ ++pub const ARPOP_RREQUEST: u16 = 3; ++pub const ARPOP_RREPLY: u16 = 4; ++pub const ARPOP_InREQUEST: u16 = 8; ++pub const ARPOP_InREPLY: u16 = 9; ++pub const ARPOP_NAK: u16 = 10; ++ ++pub const ATF_NETMASK: c_int = 0x20; ++pub const ATF_DONTPUB: c_int = 0x40; ++ ++pub const ARPHRD_NETROM: u16 = 0; ++pub const ARPHRD_ETHER: u16 = 1; ++pub const ARPHRD_EETHER: u16 = 2; ++pub const ARPHRD_AX25: u16 = 3; ++pub const ARPHRD_PRONET: u16 = 4; ++pub const ARPHRD_CHAOS: u16 = 5; ++pub const ARPHRD_IEEE802: u16 = 6; ++pub const ARPHRD_ARCNET: u16 = 7; ++pub const ARPHRD_APPLETLK: u16 = 8; ++pub const ARPHRD_DLCI: u16 = 15; ++pub const ARPHRD_ATM: u16 = 19; ++pub const ARPHRD_METRICOM: u16 = 23; ++pub const ARPHRD_IEEE1394: u16 = 24; ++pub const ARPHRD_EUI64: u16 = 27; ++pub const ARPHRD_INFINIBAND: u16 = 32; ++ ++pub const ARPHRD_SLIP: u16 = 256; ++pub const ARPHRD_CSLIP: u16 = 257; ++pub const ARPHRD_SLIP6: u16 = 258; ++pub const ARPHRD_CSLIP6: u16 = 259; ++pub const ARPHRD_RSRVD: u16 = 260; ++pub const ARPHRD_ADAPT: u16 = 264; ++pub const ARPHRD_ROSE: u16 = 270; ++pub const ARPHRD_X25: u16 = 271; ++pub const ARPHRD_HWX25: u16 = 272; ++pub const ARPHRD_CAN: u16 = 280; ++pub const ARPHRD_PPP: u16 = 512; ++pub const ARPHRD_CISCO: u16 = 513; ++pub const ARPHRD_HDLC: u16 = ARPHRD_CISCO; ++pub const ARPHRD_LAPB: u16 = 516; ++pub const ARPHRD_DDCMP: u16 = 517; ++pub const ARPHRD_RAWHDLC: u16 = 518; ++ ++pub const ARPHRD_TUNNEL: u16 = 768; ++pub const ARPHRD_TUNNEL6: u16 = 769; ++pub const ARPHRD_FRAD: u16 = 770; ++pub const ARPHRD_SKIP: u16 = 771; ++pub const ARPHRD_LOOPBACK: u16 = 772; ++pub const ARPHRD_LOCALTLK: u16 = 773; ++pub const ARPHRD_FDDI: u16 = 774; ++pub const ARPHRD_BIF: u16 = 775; ++pub const ARPHRD_SIT: u16 = 776; ++pub const ARPHRD_IPDDP: u16 = 777; ++pub const ARPHRD_IPGRE: u16 = 778; ++pub const ARPHRD_PIMREG: u16 = 779; ++pub const ARPHRD_HIPPI: u16 = 780; ++pub const ARPHRD_ASH: u16 = 781; ++pub const ARPHRD_ECONET: u16 = 782; ++pub const ARPHRD_IRDA: u16 = 783; ++pub const ARPHRD_FCPP: u16 = 784; ++pub const ARPHRD_FCAL: u16 = 785; ++pub const ARPHRD_FCPL: u16 = 786; ++pub const ARPHRD_FCFABRIC: u16 = 787; ++pub const ARPHRD_IEEE802_TR: u16 = 800; ++pub const ARPHRD_IEEE80211: u16 = 801; ++pub const ARPHRD_IEEE80211_PRISM: u16 = 802; ++pub const ARPHRD_IEEE80211_RADIOTAP: u16 = 803; ++pub const ARPHRD_IEEE802154: u16 = 804; ++ ++pub const ARPHRD_VOID: u16 = 0xFFFF; ++pub const ARPHRD_NONE: u16 = 0xFFFE; ++ ++cfg_if! { ++ if #[cfg(target_os = "emscripten")] { ++ // Emscripten does not define any `*_SUPER_MAGIC` constants. ++ } else if #[cfg(not(target_arch = "s390x"))] { ++ pub const ADFS_SUPER_MAGIC: c_long = 0x0000adf5; ++ pub const AFFS_SUPER_MAGIC: c_long = 0x0000adff; ++ pub const AFS_SUPER_MAGIC: c_long = 0x5346414f; ++ pub const AUTOFS_SUPER_MAGIC: c_long = 0x0187; ++ pub const BPF_FS_MAGIC: c_long = 0xcafe4a11; ++ pub const BTRFS_SUPER_MAGIC: c_long = 0x9123683e; ++ pub const CGROUP2_SUPER_MAGIC: c_long = 0x63677270; ++ pub const CGROUP_SUPER_MAGIC: c_long = 0x27e0eb; ++ pub const CODA_SUPER_MAGIC: c_long = 0x73757245; ++ pub const CRAMFS_MAGIC: c_long = 0x28cd3d45; ++ pub const DEBUGFS_MAGIC: c_long = 0x64626720; ++ pub const DEVPTS_SUPER_MAGIC: c_long = 0x1cd1; ++ pub const ECRYPTFS_SUPER_MAGIC: c_long = 0xf15f; ++ pub const EFS_SUPER_MAGIC: c_long = 0x00414a53; ++ pub const EXT2_SUPER_MAGIC: c_long = 0x0000ef53; ++ pub const EXT3_SUPER_MAGIC: c_long = 0x0000ef53; ++ pub const EXT4_SUPER_MAGIC: c_long = 0x0000ef53; ++ pub const F2FS_SUPER_MAGIC: c_long = 0xf2f52010; ++ pub const FUSE_SUPER_MAGIC: c_long = 0x65735546; ++ pub const FUTEXFS_SUPER_MAGIC: c_long = 0xbad1dea; ++ pub const HOSTFS_SUPER_MAGIC: c_long = 0x00c0ffee; ++ pub const HPFS_SUPER_MAGIC: c_long = 0xf995e849; ++ pub const HUGETLBFS_MAGIC: c_long = 0x958458f6; ++ pub const ISOFS_SUPER_MAGIC: c_long = 0x00009660; ++ pub const JFFS2_SUPER_MAGIC: c_long = 0x000072b6; ++ pub const MINIX2_SUPER_MAGIC2: c_long = 0x00002478; ++ pub const MINIX2_SUPER_MAGIC: c_long = 0x00002468; ++ pub const MINIX3_SUPER_MAGIC: c_long = 0x4d5a; ++ pub const MINIX_SUPER_MAGIC2: c_long = 0x0000138f; ++ pub const MINIX_SUPER_MAGIC: c_long = 0x0000137f; ++ pub const MSDOS_SUPER_MAGIC: c_long = 0x00004d44; ++ pub const NCP_SUPER_MAGIC: c_long = 0x0000564c; ++ pub const NFS_SUPER_MAGIC: c_long = 0x00006969; ++ pub const NILFS_SUPER_MAGIC: c_long = 0x3434; ++ pub const OCFS2_SUPER_MAGIC: c_long = 0x7461636f; ++ pub const OPENPROM_SUPER_MAGIC: c_long = 0x00009fa1; ++ pub const OVERLAYFS_SUPER_MAGIC: c_long = 0x794c7630; ++ pub const PROC_SUPER_MAGIC: c_long = 0x00009fa0; ++ pub const QNX4_SUPER_MAGIC: c_long = 0x0000002f; ++ pub const QNX6_SUPER_MAGIC: c_long = 0x68191122; ++ pub const RDTGROUP_SUPER_MAGIC: c_long = 0x7655821; ++ pub const REISERFS_SUPER_MAGIC: c_long = 0x52654973; ++ pub const SECURITYFS_MAGIC: c_long = 0x73636673; ++ pub const SELINUX_MAGIC: c_long = 0xf97cff8c; ++ pub const SMACK_MAGIC: c_long = 0x43415d53; ++ pub const SMB_SUPER_MAGIC: c_long = 0x0000517b; ++ pub const SYSFS_MAGIC: c_long = 0x62656572; ++ pub const TMPFS_MAGIC: c_long = 0x01021994; ++ pub const TRACEFS_MAGIC: c_long = 0x74726163; ++ pub const UDF_SUPER_MAGIC: c_long = 0x15013346; ++ pub const USBDEVICE_SUPER_MAGIC: c_long = 0x00009fa2; ++ pub const XENFS_SUPER_MAGIC: c_long = 0xabba1974; ++ pub const NSFS_MAGIC: c_long = 0x6e736673; ++ } else if #[cfg(target_arch = "s390x")] { ++ pub const ADFS_SUPER_MAGIC: c_uint = 0x0000adf5; ++ pub const AFFS_SUPER_MAGIC: c_uint = 0x0000adff; ++ pub const AFS_SUPER_MAGIC: c_uint = 0x5346414f; ++ pub const AUTOFS_SUPER_MAGIC: c_uint = 0x0187; ++ pub const BPF_FS_MAGIC: c_uint = 0xcafe4a11; ++ pub const BTRFS_SUPER_MAGIC: c_uint = 0x9123683e; ++ pub const CGROUP2_SUPER_MAGIC: c_uint = 0x63677270; ++ pub const CGROUP_SUPER_MAGIC: c_uint = 0x27e0eb; ++ pub const CODA_SUPER_MAGIC: c_uint = 0x73757245; ++ pub const CRAMFS_MAGIC: c_uint = 0x28cd3d45; ++ pub const DEBUGFS_MAGIC: c_uint = 0x64626720; ++ pub const DEVPTS_SUPER_MAGIC: c_uint = 0x1cd1; ++ pub const ECRYPTFS_SUPER_MAGIC: c_uint = 0xf15f; ++ pub const EFS_SUPER_MAGIC: c_uint = 0x00414a53; ++ pub const EXT2_SUPER_MAGIC: c_uint = 0x0000ef53; ++ pub const EXT3_SUPER_MAGIC: c_uint = 0x0000ef53; ++ pub const EXT4_SUPER_MAGIC: c_uint = 0x0000ef53; ++ pub const F2FS_SUPER_MAGIC: c_uint = 0xf2f52010; ++ pub const FUSE_SUPER_MAGIC: c_uint = 0x65735546; ++ pub const FUTEXFS_SUPER_MAGIC: c_uint = 0xbad1dea; ++ pub const HOSTFS_SUPER_MAGIC: c_uint = 0x00c0ffee; ++ pub const HPFS_SUPER_MAGIC: c_uint = 0xf995e849; ++ pub const HUGETLBFS_MAGIC: c_uint = 0x958458f6; ++ pub const ISOFS_SUPER_MAGIC: c_uint = 0x00009660; ++ pub const JFFS2_SUPER_MAGIC: c_uint = 0x000072b6; ++ pub const MINIX2_SUPER_MAGIC2: c_uint = 0x00002478; ++ pub const MINIX2_SUPER_MAGIC: c_uint = 0x00002468; ++ pub const MINIX3_SUPER_MAGIC: c_uint = 0x4d5a; ++ pub const MINIX_SUPER_MAGIC2: c_uint = 0x0000138f; ++ pub const MINIX_SUPER_MAGIC: c_uint = 0x0000137f; ++ pub const MSDOS_SUPER_MAGIC: c_uint = 0x00004d44; ++ pub const NCP_SUPER_MAGIC: c_uint = 0x0000564c; ++ pub const NFS_SUPER_MAGIC: c_uint = 0x00006969; ++ pub const NILFS_SUPER_MAGIC: c_uint = 0x3434; ++ pub const OCFS2_SUPER_MAGIC: c_uint = 0x7461636f; ++ pub const OPENPROM_SUPER_MAGIC: c_uint = 0x00009fa1; ++ pub const OVERLAYFS_SUPER_MAGIC: c_uint = 0x794c7630; ++ pub const PROC_SUPER_MAGIC: c_uint = 0x00009fa0; ++ pub const QNX4_SUPER_MAGIC: c_uint = 0x0000002f; ++ pub const QNX6_SUPER_MAGIC: c_uint = 0x68191122; ++ pub const RDTGROUP_SUPER_MAGIC: c_uint = 0x7655821; ++ pub const REISERFS_SUPER_MAGIC: c_uint = 0x52654973; ++ pub const SECURITYFS_MAGIC: c_uint = 0x73636673; ++ pub const SELINUX_MAGIC: c_uint = 0xf97cff8c; ++ pub const SMACK_MAGIC: c_uint = 0x43415d53; ++ pub const SMB_SUPER_MAGIC: c_uint = 0x0000517b; ++ pub const SYSFS_MAGIC: c_uint = 0x62656572; ++ pub const TMPFS_MAGIC: c_uint = 0x01021994; ++ pub const TRACEFS_MAGIC: c_uint = 0x74726163; ++ pub const UDF_SUPER_MAGIC: c_uint = 0x15013346; ++ pub const USBDEVICE_SUPER_MAGIC: c_uint = 0x00009fa2; ++ pub const XENFS_SUPER_MAGIC: c_uint = 0xabba1974; ++ pub const NSFS_MAGIC: c_uint = 0x6e736673; ++ } ++} ++ ++cfg_if! { ++ if #[cfg(any(target_env = "gnu", target_os = "android"))] { ++ pub const AT_STATX_SYNC_TYPE: c_int = 0x6000; ++ pub const AT_STATX_SYNC_AS_STAT: c_int = 0x0000; ++ pub const AT_STATX_FORCE_SYNC: c_int = 0x2000; ++ pub const AT_STATX_DONT_SYNC: c_int = 0x4000; ++ pub const STATX_TYPE: c_uint = 0x0001; ++ pub const STATX_MODE: c_uint = 0x0002; ++ pub const STATX_NLINK: c_uint = 0x0004; ++ pub const STATX_UID: c_uint = 0x0008; ++ pub const STATX_GID: c_uint = 0x0010; ++ pub const STATX_ATIME: c_uint = 0x0020; ++ pub const STATX_MTIME: c_uint = 0x0040; ++ pub const STATX_CTIME: c_uint = 0x0080; ++ pub const STATX_INO: c_uint = 0x0100; ++ pub const STATX_SIZE: c_uint = 0x0200; ++ pub const STATX_BLOCKS: c_uint = 0x0400; ++ pub const STATX_BASIC_STATS: c_uint = 0x07ff; ++ pub const STATX_BTIME: c_uint = 0x0800; ++ pub const STATX_ALL: c_uint = 0x0fff; ++ pub const STATX_MNT_ID: c_uint = 0x1000; ++ pub const STATX_DIOALIGN: c_uint = 0x2000; ++ pub const STATX__RESERVED: c_int = 0x80000000; ++ pub const STATX_ATTR_COMPRESSED: c_int = 0x0004; ++ pub const STATX_ATTR_IMMUTABLE: c_int = 0x0010; ++ pub const STATX_ATTR_APPEND: c_int = 0x0020; ++ 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 STATX_ATTR_MOUNT_ROOT: c_int = 0x2000; ++ pub const STATX_ATTR_VERITY: c_int = 0x100000; ++ pub const STATX_ATTR_DAX: c_int = 0x200000; ++ } ++} ++ ++const_fn! { ++ {const} fn CMSG_ALIGN(len: usize) -> usize { ++ len + mem::size_of::() - 1 & !(mem::size_of::() - 1) ++ } ++} ++ ++f! { ++ pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr { ++ if (*mhdr).msg_controllen as usize >= mem::size_of::() { ++ (*mhdr).msg_control as *mut cmsghdr ++ } else { ++ 0 as *mut cmsghdr ++ } ++ } ++ ++ pub fn CMSG_DATA(cmsg: *const cmsghdr) -> *mut c_uchar { ++ cmsg.offset(1) as *mut c_uchar ++ } ++ ++ pub {const} fn CMSG_SPACE(length: c_uint) -> c_uint { ++ (CMSG_ALIGN(length as usize) + CMSG_ALIGN(mem::size_of::())) as c_uint ++ } ++ ++ pub {const} fn CMSG_LEN(length: c_uint) -> c_uint { ++ CMSG_ALIGN(mem::size_of::()) as c_uint + length ++ } ++ ++ pub fn FD_CLR(fd: c_int, set: *mut fd_set) -> () { ++ let fd = fd as usize; ++ let size = mem::size_of_val(&(*set).fds_bits[0]) * 8; ++ (*set).fds_bits[fd / size] &= !(1 << (fd % size)); ++ return; ++ } ++ ++ pub fn FD_ISSET(fd: c_int, set: *const fd_set) -> bool { ++ let fd = fd as usize; ++ let size = mem::size_of_val(&(*set).fds_bits[0]) * 8; ++ return ((*set).fds_bits[fd / size] & (1 << (fd % size))) != 0; ++ } ++ ++ pub fn FD_SET(fd: c_int, set: *mut fd_set) -> () { ++ let fd = fd as usize; ++ let size = mem::size_of_val(&(*set).fds_bits[0]) * 8; ++ (*set).fds_bits[fd / size] |= 1 << (fd % size); ++ return; ++ } ++ ++ pub fn FD_ZERO(set: *mut fd_set) -> () { ++ for slot in (*set).fds_bits.iter_mut() { ++ *slot = 0; ++ } ++ } ++} ++ ++safe_f! { ++ pub fn SIGRTMAX() -> c_int { ++ unsafe { __libc_current_sigrtmax() } ++ } ++ ++ pub fn SIGRTMIN() -> c_int { ++ unsafe { __libc_current_sigrtmin() } ++ } ++ ++ pub {const} fn WIFSTOPPED(status: c_int) -> bool { ++ (status & 0xff) == 0x7f ++ } ++ ++ pub {const} fn WSTOPSIG(status: c_int) -> c_int { ++ (status >> 8) & 0xff ++ } ++ ++ pub {const} fn WIFCONTINUED(status: c_int) -> bool { ++ status == 0xffff ++ } ++ ++ pub {const} fn WIFSIGNALED(status: c_int) -> bool { ++ ((status & 0x7f) + 1) as i8 >= 2 ++ } ++ ++ pub {const} fn WTERMSIG(status: c_int) -> c_int { ++ status & 0x7f ++ } ++ ++ pub {const} fn WIFEXITED(status: c_int) -> bool { ++ (status & 0x7f) == 0 ++ } ++ ++ pub {const} fn WEXITSTATUS(status: c_int) -> c_int { ++ (status >> 8) & 0xff ++ } ++ ++ pub {const} fn WCOREDUMP(status: c_int) -> bool { ++ (status & 0x80) != 0 ++ } ++ ++ pub {const} fn W_EXITCODE(ret: c_int, sig: c_int) -> c_int { ++ (ret << 8) | sig ++ } ++ ++ pub {const} fn W_STOPCODE(sig: c_int) -> c_int { ++ (sig << 8) | 0x7f ++ } ++ ++ pub {const} fn QCMD(cmd: c_int, type_: c_int) -> c_int { ++ (cmd << 8) | (type_ & 0x00ff) ++ } ++ ++ pub {const} fn IPOPT_COPIED(o: u8) -> u8 { ++ o & IPOPT_COPY ++ } ++ ++ pub {const} fn IPOPT_CLASS(o: u8) -> u8 { ++ o & IPOPT_CLASS_MASK ++ } ++ ++ pub {const} fn IPOPT_NUMBER(o: u8) -> u8 { ++ o & IPOPT_NUMBER_MASK ++ } ++ ++ pub {const} fn IPTOS_ECN(x: u8) -> u8 { ++ x & crate::IPTOS_ECN_MASK ++ } ++ ++ #[allow(ellipsis_inclusive_range_patterns)] ++ pub {const} fn KERNEL_VERSION(a: u32, b: u32, c: u32) -> u32 { ++ ((a << 16) + (b << 8)) ++ + match c { ++ 0..=255 => c, ++ _ => 255, ++ } ++ } ++} ++ ++extern "C" { ++ #[doc(hidden)] ++ pub fn __libc_current_sigrtmax() -> c_int; ++ #[doc(hidden)] ++ pub fn __libc_current_sigrtmin() -> c_int; ++ ++ pub fn sem_destroy(sem: *mut sem_t) -> c_int; ++ pub fn sem_init(sem: *mut sem_t, pshared: c_int, value: c_uint) -> c_int; ++ pub fn fdatasync(fd: c_int) -> c_int; ++ pub fn mincore(addr: *mut c_void, len: size_t, vec: *mut c_uchar) -> c_int; ++ ++ #[cfg_attr(gnu_time64_abi, link_name = "__clock_getres64")] ++ pub fn clock_getres(clk_id: crate::clockid_t, tp: *mut crate::timespec) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "__clock_gettime64")] ++ pub fn clock_gettime(clk_id: crate::clockid_t, tp: *mut crate::timespec) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "__clock_settime64")] ++ pub fn clock_settime(clk_id: crate::clockid_t, tp: *const crate::timespec) -> c_int; ++ pub fn clock_getcpuclockid(pid: crate::pid_t, clk_id: *mut crate::clockid_t) -> c_int; ++ ++ pub fn dirfd(dirp: *mut crate::DIR) -> c_int; ++ ++ pub fn pthread_getattr_np(native: crate::pthread_t, attr: *mut crate::pthread_attr_t) -> c_int; ++ pub fn pthread_attr_getstack( ++ attr: *const crate::pthread_attr_t, ++ stackaddr: *mut *mut c_void, ++ stacksize: *mut size_t, ++ ) -> c_int; ++ pub fn memalign(align: size_t, size: size_t) -> *mut c_void; ++ pub fn setgroups(ngroups: size_t, ptr: *const crate::gid_t) -> c_int; ++ pub fn pipe2(fds: *mut c_int, flags: c_int) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "statfs64")] ++ pub fn statfs(path: *const c_char, buf: *mut statfs) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "fstatfs64")] ++ pub fn fstatfs(fd: c_int, buf: *mut statfs) -> c_int; ++ pub fn memrchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void; ++ #[cfg_attr(gnu_time64_abi, link_name = "posix_fadvise64")] ++ pub fn posix_fadvise(fd: c_int, offset: off_t, len: off_t, advise: c_int) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "__futimens64")] ++ pub fn futimens(fd: c_int, times: *const crate::timespec) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "__utimensat64")] ++ pub fn utimensat( ++ dirfd: c_int, ++ path: *const c_char, ++ times: *const crate::timespec, ++ flag: c_int, ++ ) -> c_int; ++ pub fn duplocale(base: crate::locale_t) -> crate::locale_t; ++ pub fn freelocale(loc: crate::locale_t); ++ pub fn newlocale(mask: c_int, locale: *const c_char, base: crate::locale_t) -> crate::locale_t; ++ pub fn uselocale(loc: crate::locale_t) -> crate::locale_t; ++ pub fn mknodat(dirfd: c_int, pathname: *const c_char, mode: crate::mode_t, dev: dev_t) ++ -> c_int; ++ pub fn pthread_condattr_getclock( ++ attr: *const pthread_condattr_t, ++ clock_id: *mut clockid_t, ++ ) -> c_int; ++ pub fn pthread_condattr_setclock( ++ attr: *mut pthread_condattr_t, ++ clock_id: crate::clockid_t, ++ ) -> c_int; ++ pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t, pshared: c_int) -> c_int; ++ pub fn pthread_mutexattr_setpshared(attr: *mut pthread_mutexattr_t, pshared: c_int) -> c_int; ++ pub fn pthread_rwlockattr_getpshared( ++ attr: *const pthread_rwlockattr_t, ++ val: *mut c_int, ++ ) -> c_int; ++ pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, val: c_int) -> c_int; ++ pub fn ptsname_r(fd: c_int, buf: *mut c_char, buflen: size_t) -> c_int; ++ pub fn clearenv() -> c_int; ++ pub fn waitid( ++ idtype: idtype_t, ++ id: id_t, ++ infop: *mut crate::siginfo_t, ++ options: c_int, ++ ) -> c_int; ++ pub fn getresuid( ++ ruid: *mut crate::uid_t, ++ euid: *mut crate::uid_t, ++ suid: *mut crate::uid_t, ++ ) -> c_int; ++ pub fn getresgid( ++ rgid: *mut crate::gid_t, ++ egid: *mut crate::gid_t, ++ sgid: *mut crate::gid_t, ++ ) -> c_int; ++ pub fn acct(filename: *const c_char) -> c_int; ++ pub fn brk(addr: *mut c_void) -> c_int; ++ pub fn sbrk(increment: intptr_t) -> *mut c_void; ++ #[deprecated( ++ since = "0.2.66", ++ note = "causes memory corruption, see rust-lang/libc#1596" ++ )] ++ pub fn vfork() -> crate::pid_t; ++ pub fn setresgid(rgid: crate::gid_t, egid: crate::gid_t, sgid: crate::gid_t) -> c_int; ++ pub fn setresuid(ruid: crate::uid_t, euid: crate::uid_t, suid: crate::uid_t) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "__wait4_time64")] ++ pub fn wait4( ++ pid: crate::pid_t, ++ status: *mut c_int, ++ options: c_int, ++ rusage: *mut crate::rusage, ++ ) -> crate::pid_t; ++ pub fn login_tty(fd: c_int) -> c_int; ++ ++ // DIFF(main): changed to `*const *mut` in e77f551de9 ++ pub fn execvpe( ++ file: *const c_char, ++ argv: *const *const c_char, ++ envp: *const *const c_char, ++ ) -> c_int; ++ pub fn fexecve(fd: c_int, argv: *const *const c_char, envp: *const *const c_char) -> c_int; ++ ++ pub fn getifaddrs(ifap: *mut *mut crate::ifaddrs) -> c_int; ++ pub fn freeifaddrs(ifa: *mut crate::ifaddrs); ++ pub fn bind( ++ socket: c_int, ++ address: *const crate::sockaddr, ++ address_len: crate::socklen_t, ++ ) -> c_int; ++ ++ pub fn writev(fd: c_int, iov: *const crate::iovec, iovcnt: c_int) -> ssize_t; ++ pub fn readv(fd: c_int, iov: *const crate::iovec, iovcnt: c_int) -> ssize_t; ++ ++ #[cfg_attr(gnu_time64_abi, link_name = "__sendmsg64")] ++ pub fn sendmsg(fd: c_int, msg: *const crate::msghdr, flags: c_int) -> ssize_t; ++ #[cfg_attr(gnu_time64_abi, link_name = "__recvmsg64")] ++ pub fn recvmsg(fd: c_int, msg: *mut crate::msghdr, flags: c_int) -> ssize_t; ++ pub fn uname(buf: *mut crate::utsname) -> c_int; ++ ++ pub fn strchrnul(s: *const c_char, c: c_int) -> *mut c_char; ++ ++ pub fn strftime( ++ s: *mut c_char, ++ max: size_t, ++ format: *const c_char, ++ tm: *const crate::tm, ++ ) -> size_t; ++ pub fn strftime_l( ++ s: *mut c_char, ++ max: size_t, ++ format: *const c_char, ++ tm: *const crate::tm, ++ locale: crate::locale_t, ++ ) -> size_t; ++ pub fn strptime(s: *const c_char, format: *const c_char, tm: *mut crate::tm) -> *mut c_char; ++ ++ #[cfg_attr(gnu_time64_abi, link_name = "mkostemp64")] ++ pub fn mkostemp(template: *mut c_char, flags: c_int) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "mkostemps64")] ++ pub fn mkostemps(template: *mut c_char, suffixlen: c_int, flags: c_int) -> c_int; ++} ++ ++// LFS64 extensions ++// ++// * musl and Emscripten has 64-bit versions only so aliases the LFS64 symbols to the standard ones ++// * ulibc doesn't have preadv64/pwritev64 ++cfg_if! { ++ if #[cfg(not(any(target_env = "musl", target_os = "emscripten")))] { ++ extern "C" { ++ pub fn fstatfs64(fd: c_int, buf: *mut statfs64) -> c_int; ++ pub fn statvfs64(path: *const c_char, buf: *mut statvfs64) -> c_int; ++ pub fn fstatvfs64(fd: c_int, buf: *mut statvfs64) -> c_int; ++ pub fn statfs64(path: *const c_char, buf: *mut statfs64) -> c_int; ++ pub fn creat64(path: *const c_char, mode: mode_t) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "__fstat64_time64")] ++ pub fn fstat64(fildes: c_int, buf: *mut stat64) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "__fstatat64_time64")] ++ pub fn fstatat64( ++ dirfd: c_int, ++ pathname: *const c_char, ++ buf: *mut stat64, ++ flags: c_int, ++ ) -> c_int; ++ pub fn ftruncate64(fd: c_int, length: off64_t) -> c_int; ++ pub fn lseek64(fd: c_int, offset: off64_t, whence: c_int) -> off64_t; ++ #[cfg_attr(gnu_time64_abi, link_name = "__lstat64_time64")] ++ pub fn lstat64(path: *const c_char, buf: *mut stat64) -> c_int; ++ pub fn mmap64( ++ addr: *mut c_void, ++ len: size_t, ++ prot: c_int, ++ flags: c_int, ++ fd: c_int, ++ offset: off64_t, ++ ) -> *mut c_void; ++ pub fn open64(path: *const c_char, oflag: c_int, ...) -> c_int; ++ pub fn openat64(fd: c_int, path: *const c_char, oflag: c_int, ...) -> c_int; ++ pub fn posix_fadvise64( ++ fd: c_int, ++ offset: off64_t, ++ len: off64_t, ++ advise: c_int, ++ ) -> c_int; ++ pub fn pread64(fd: c_int, buf: *mut c_void, count: size_t, offset: off64_t) -> ssize_t; ++ pub fn pwrite64( ++ fd: c_int, ++ buf: *const c_void, ++ count: size_t, ++ offset: off64_t, ++ ) -> ssize_t; ++ pub fn readdir64(dirp: *mut crate::DIR) -> *mut crate::dirent64; ++ pub fn readdir64_r( ++ dirp: *mut crate::DIR, ++ entry: *mut crate::dirent64, ++ result: *mut *mut crate::dirent64, ++ ) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "__stat64_time64")] ++ pub fn stat64(path: *const c_char, buf: *mut stat64) -> c_int; ++ pub fn truncate64(path: *const c_char, length: off64_t) -> c_int; ++ } ++ } ++} ++ ++cfg_if! { ++ if #[cfg(not(any( ++ target_env = "uclibc", ++ target_env = "musl", ++ target_os = "emscripten" ++ )))] { ++ extern "C" { ++ pub fn preadv64( ++ fd: c_int, ++ iov: *const crate::iovec, ++ iovcnt: c_int, ++ offset: off64_t, ++ ) -> ssize_t; ++ pub fn pwritev64( ++ fd: c_int, ++ iov: *const crate::iovec, ++ iovcnt: c_int, ++ offset: off64_t, ++ ) -> ssize_t; ++ } ++ } ++} ++ ++cfg_if! { ++ if #[cfg(not(target_env = "uclibc"))] { ++ extern "C" { ++ // uclibc has separate non-const version of this function ++ pub fn forkpty( ++ amaster: *mut c_int, ++ name: *mut c_char, ++ termp: *const termios, ++ winp: *const crate::winsize, ++ ) -> crate::pid_t; ++ // uclibc has separate non-const version of this function ++ pub fn openpty( ++ amaster: *mut c_int, ++ aslave: *mut c_int, ++ name: *mut c_char, ++ termp: *const termios, ++ winp: *const crate::winsize, ++ ) -> c_int; ++ } ++ } ++} ++ ++// The statx syscall, available on some libcs. ++cfg_if! { ++ if #[cfg(any(target_env = "gnu", target_os = "android"))] { ++ extern "C" { ++ pub fn statx( ++ dirfd: c_int, ++ pathname: *const c_char, ++ flags: c_int, ++ mask: c_uint, ++ statxbuf: *mut statx, ++ ) -> c_int; ++ } ++ } ++} ++ ++cfg_if! { ++ if #[cfg(target_os = "emscripten")] { ++ mod emscripten; ++ pub use self::emscripten::*; ++ } else if #[cfg(target_os = "linux")] { ++ mod linux; ++ pub use self::linux::*; ++ } else if #[cfg(target_os = "l4re")] { ++ mod linux; ++ pub use self::linux::*; ++ } else if #[cfg(target_os = "android")] { ++ mod android; ++ pub use self::android::*; ++ } else { ++ // Unknown target_os ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/mod.rs 2024-12-28 15:35:00.000000000 -0500 +@@ -0,0 +1,1815 @@ ++//! Definitions found commonly among almost all Unix derivatives ++//! ++//! More functions and definitions can be found in the more specific modules ++//! according to the platform in question. ++ ++use crate::prelude::*; ++ ++pub type c_schar = i8; ++pub type c_uchar = u8; ++pub type c_short = i16; ++pub type c_ushort = u16; ++pub type c_int = i32; ++pub type c_uint = u32; ++pub type c_float = f32; ++pub type c_double = f64; ++pub type c_longlong = i64; ++pub type c_ulonglong = u64; ++pub type intmax_t = i64; ++pub type uintmax_t = u64; ++ ++pub type size_t = usize; ++pub type ptrdiff_t = isize; ++pub type intptr_t = isize; ++pub type uintptr_t = usize; ++pub type ssize_t = isize; ++ ++pub type pid_t = i32; ++pub type in_addr_t = u32; ++pub type in_port_t = u16; ++pub type sighandler_t = size_t; ++pub type cc_t = c_uchar; ++ ++cfg_if! { ++ if #[cfg(any( ++ target_os = "espidf", ++ target_os = "horizon", ++ target_os = "vita" ++ ))] { ++ pub type uid_t = c_ushort; ++ pub type gid_t = c_ushort; ++ } else if #[cfg(target_os = "nto")] { ++ pub type uid_t = i32; ++ pub type gid_t = i32; ++ } else { ++ pub type uid_t = u32; ++ pub type gid_t = u32; ++ } ++} ++ ++missing! { ++ #[cfg_attr(feature = "extra_traits", derive(Debug))] ++ pub enum DIR {} ++} ++pub type locale_t = *mut c_void; ++ ++s! { ++ pub struct group { ++ pub gr_name: *mut c_char, ++ pub gr_passwd: *mut c_char, ++ pub gr_gid: crate::gid_t, ++ pub gr_mem: *mut *mut c_char, ++ } ++ ++ pub struct utimbuf { ++ pub actime: time_t, ++ pub modtime: time_t, ++ } ++ ++ pub struct timeval { ++ pub tv_sec: time_t, ++ #[cfg(not(gnu_time64_abi))] ++ pub tv_usec: suseconds_t, ++ // For 64 bit time on 32 bit linux glibc, suseconds_t is still ++ // a 32 bit type. Using suseconds_t here will break the tests, use i64 instead ++ #[cfg(gnu_time64_abi)] ++ pub tv_usec: i64 ++ } ++ ++ // linux x32 compatibility ++ // See https://sourceware.org/bugzilla/show_bug.cgi?id=16437 ++ pub struct timespec { ++ pub tv_sec: time_t, ++ #[cfg(all(gnu_time64_abi, target_endian = "big"))] ++ __pad: i32, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ pub tv_nsec: i64, ++ #[cfg(not(all(target_arch = "x86_64", target_pointer_width = "32")))] ++ pub tv_nsec: c_long, ++ #[cfg(all(gnu_time64_abi, target_endian = "little"))] ++ __pad: i32, ++ } ++ ++ pub struct rlimit { ++ pub rlim_cur: rlim_t, ++ pub rlim_max: rlim_t, ++ } ++ ++ pub struct rusage { ++ pub ru_utime: timeval, ++ pub ru_stime: timeval, ++ pub ru_maxrss: c_long, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ __pad1: u32, ++ pub ru_ixrss: c_long, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ __pad2: u32, ++ pub ru_idrss: c_long, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ __pad3: u32, ++ pub ru_isrss: c_long, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ __pad4: u32, ++ pub ru_minflt: c_long, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ __pad5: u32, ++ pub ru_majflt: c_long, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ __pad6: u32, ++ pub ru_nswap: c_long, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ __pad7: u32, ++ pub ru_inblock: c_long, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ __pad8: u32, ++ pub ru_oublock: c_long, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ __pad9: u32, ++ pub ru_msgsnd: c_long, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ __pad10: u32, ++ pub ru_msgrcv: c_long, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ __pad11: u32, ++ pub ru_nsignals: c_long, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ __pad12: u32, ++ pub ru_nvcsw: c_long, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ __pad13: u32, ++ pub ru_nivcsw: c_long, ++ #[cfg(all(target_arch = "x86_64", target_pointer_width = "32"))] ++ __pad14: u32, ++ ++ #[cfg(any(target_env = "musl", target_env = "ohos", target_os = "emscripten"))] ++ __reserved: [c_long; 16], ++ } ++ ++ pub struct ipv6_mreq { ++ pub ipv6mr_multiaddr: in6_addr, ++ #[cfg(target_os = "android")] ++ pub ipv6mr_interface: c_int, ++ #[cfg(not(target_os = "android"))] ++ pub ipv6mr_interface: c_uint, ++ } ++ ++ pub struct hostent { ++ pub h_name: *mut c_char, ++ pub h_aliases: *mut *mut c_char, ++ pub h_addrtype: c_int, ++ pub h_length: c_int, ++ pub h_addr_list: *mut *mut c_char, ++ } ++ ++ pub struct iovec { ++ pub iov_base: *mut c_void, ++ pub iov_len: size_t, ++ } ++ ++ pub struct pollfd { ++ pub fd: c_int, ++ pub events: c_short, ++ pub revents: c_short, ++ } ++ ++ pub struct winsize { ++ pub ws_row: c_ushort, ++ pub ws_col: c_ushort, ++ pub ws_xpixel: c_ushort, ++ pub ws_ypixel: c_ushort, ++ } ++ ++ pub struct linger { ++ pub l_onoff: c_int, ++ pub l_linger: c_int, ++ } ++ ++ pub struct sigval { ++ // Actually a union of an int and a void* ++ pub sival_ptr: *mut c_void, ++ } ++ ++ // ++ pub struct itimerval { ++ pub it_interval: crate::timeval, ++ pub it_value: crate::timeval, ++ } ++ ++ // ++ pub struct tms { ++ pub tms_utime: crate::clock_t, ++ pub tms_stime: crate::clock_t, ++ pub tms_cutime: crate::clock_t, ++ pub tms_cstime: crate::clock_t, ++ } ++ ++ pub struct servent { ++ pub s_name: *mut c_char, ++ pub s_aliases: *mut *mut c_char, ++ pub s_port: c_int, ++ pub s_proto: *mut c_char, ++ } ++ ++ pub struct protoent { ++ pub p_name: *mut c_char, ++ pub p_aliases: *mut *mut c_char, ++ pub p_proto: c_int, ++ } ++ ++ #[repr(align(4))] ++ pub struct in6_addr { ++ pub s6_addr: [u8; 16], ++ } ++} ++ ++pub const INT_MIN: c_int = -2147483648; ++pub const INT_MAX: c_int = 2147483647; ++ ++pub const SIG_DFL: sighandler_t = 0 as sighandler_t; ++pub const SIG_IGN: sighandler_t = 1 as sighandler_t; ++pub const SIG_ERR: sighandler_t = !0 as sighandler_t; ++ ++cfg_if! { ++ if #[cfg(not(target_os = "nto"))] { ++ pub const DT_UNKNOWN: u8 = 0; ++ pub const DT_FIFO: u8 = 1; ++ pub const DT_CHR: u8 = 2; ++ pub const DT_DIR: u8 = 4; ++ pub const DT_BLK: u8 = 6; ++ pub const DT_REG: u8 = 8; ++ pub const DT_LNK: u8 = 10; ++ pub const DT_SOCK: u8 = 12; ++ } ++} ++cfg_if! { ++ if #[cfg(not(target_os = "redox"))] { ++ pub const FD_CLOEXEC: c_int = 0x1; ++ } ++} ++ ++cfg_if! { ++ if #[cfg(not(target_os = "nto"))] { ++ pub const USRQUOTA: c_int = 0; ++ pub const GRPQUOTA: c_int = 1; ++ } ++} ++pub const SIGIOT: c_int = 6; ++ ++pub const S_ISUID: crate::mode_t = 0o4000; ++pub const S_ISGID: crate::mode_t = 0o2000; ++pub const S_ISVTX: crate::mode_t = 0o1000; ++ ++cfg_if! { ++ if #[cfg(not(any( ++ target_os = "haiku", ++ target_os = "illumos", ++ target_os = "solaris" ++ )))] { ++ pub const IF_NAMESIZE: size_t = 16; ++ pub const IFNAMSIZ: size_t = IF_NAMESIZE; ++ } ++} ++ ++pub const LOG_EMERG: c_int = 0; ++pub const LOG_ALERT: c_int = 1; ++pub const LOG_CRIT: c_int = 2; ++pub const LOG_ERR: c_int = 3; ++pub const LOG_WARNING: c_int = 4; ++pub const LOG_NOTICE: c_int = 5; ++pub const LOG_INFO: c_int = 6; ++pub const LOG_DEBUG: c_int = 7; ++ ++pub const LOG_KERN: c_int = 0; ++pub const LOG_USER: c_int = 1 << 3; ++pub const LOG_MAIL: c_int = 2 << 3; ++pub const LOG_DAEMON: c_int = 3 << 3; ++pub const LOG_AUTH: c_int = 4 << 3; ++pub const LOG_SYSLOG: c_int = 5 << 3; ++pub const LOG_LPR: c_int = 6 << 3; ++pub const LOG_NEWS: c_int = 7 << 3; ++pub const LOG_UUCP: c_int = 8 << 3; ++pub const LOG_LOCAL0: c_int = 16 << 3; ++pub const LOG_LOCAL1: c_int = 17 << 3; ++pub const LOG_LOCAL2: c_int = 18 << 3; ++pub const LOG_LOCAL3: c_int = 19 << 3; ++pub const LOG_LOCAL4: c_int = 20 << 3; ++pub const LOG_LOCAL5: c_int = 21 << 3; ++pub const LOG_LOCAL6: c_int = 22 << 3; ++pub const LOG_LOCAL7: c_int = 23 << 3; ++ ++cfg_if! { ++ if #[cfg(not(target_os = "haiku"))] { ++ pub const LOG_PID: c_int = 0x01; ++ pub const LOG_CONS: c_int = 0x02; ++ pub const LOG_ODELAY: c_int = 0x04; ++ pub const LOG_NDELAY: c_int = 0x08; ++ pub const LOG_NOWAIT: c_int = 0x10; ++ } ++} ++pub const LOG_PRIMASK: c_int = 7; ++pub const LOG_FACMASK: c_int = 0x3f8; ++ ++cfg_if! { ++ if #[cfg(not(target_os = "nto"))] { ++ pub const PRIO_MIN: c_int = -20; ++ pub const PRIO_MAX: c_int = 20; ++ } ++} ++pub const IPPROTO_ICMP: c_int = 1; ++pub const IPPROTO_ICMPV6: c_int = 58; ++pub const IPPROTO_TCP: c_int = 6; ++pub const IPPROTO_UDP: c_int = 17; ++pub const IPPROTO_IP: c_int = 0; ++pub const IPPROTO_IPV6: c_int = 41; ++ ++pub const INADDR_LOOPBACK: in_addr_t = 2130706433; ++pub const INADDR_ANY: in_addr_t = 0; ++pub const INADDR_BROADCAST: in_addr_t = 4294967295; ++pub const INADDR_NONE: in_addr_t = 4294967295; ++ ++pub const IN6ADDR_LOOPBACK_INIT: in6_addr = in6_addr { ++ s6_addr: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1], ++}; ++ ++pub const IN6ADDR_ANY_INIT: in6_addr = in6_addr { ++ s6_addr: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], ++}; ++ ++pub const ARPOP_REQUEST: u16 = 1; ++pub const ARPOP_REPLY: u16 = 2; ++ ++pub const ATF_COM: c_int = 0x02; ++pub const ATF_PERM: c_int = 0x04; ++pub const ATF_PUBL: c_int = 0x08; ++pub const ATF_USETRAILERS: c_int = 0x10; ++ ++pub const FNM_PERIOD: c_int = 1 << 2; ++pub const FNM_NOMATCH: c_int = 1; ++ ++cfg_if! { ++ if #[cfg(any(target_os = "illumos", target_os = "solaris",))] { ++ pub const FNM_CASEFOLD: c_int = 1 << 3; ++ } else { ++ pub const FNM_CASEFOLD: c_int = 1 << 4; ++ } ++} ++ ++cfg_if! { ++ if #[cfg(any( ++ target_os = "macos", ++ target_os = "freebsd", ++ target_os = "android", ++ target_os = "openbsd", ++ ))] { ++ pub const FNM_PATHNAME: c_int = 1 << 1; ++ pub const FNM_NOESCAPE: c_int = 1 << 0; ++ } else { ++ pub const FNM_PATHNAME: c_int = 1 << 0; ++ pub const FNM_NOESCAPE: c_int = 1 << 1; ++ } ++} ++ ++extern "C" { ++ pub static in6addr_loopback: in6_addr; ++ pub static in6addr_any: in6_addr; ++} ++ ++cfg_if! { ++ if #[cfg(any( ++ target_os = "l4re", ++ target_os = "espidf", ++ target_os = "nuttx" ++ ))] { ++ // required libraries are linked externally for these platforms: ++ // * L4Re ++ // * ESP-IDF ++ // * NuttX ++ } else if #[cfg(feature = "std")] { ++ // cargo build, don't pull in anything extra as the std dep ++ // already pulls in all libs. ++ } else if #[cfg(all( ++ target_os = "linux", ++ any(target_env = "gnu", target_env = "uclibc"), ++ feature = "rustc-dep-of-std" ++ ))] { ++ #[link( ++ name = "util", ++ kind = "static", ++ modifiers = "-bundle", ++ cfg(target_feature = "crt-static") ++ )] ++ #[link( ++ name = "rt", ++ kind = "static", ++ modifiers = "-bundle", ++ cfg(target_feature = "crt-static") ++ )] ++ #[link( ++ name = "pthread", ++ kind = "static", ++ modifiers = "-bundle", ++ cfg(target_feature = "crt-static") ++ )] ++ #[link( ++ name = "m", ++ kind = "static", ++ modifiers = "-bundle", ++ cfg(target_feature = "crt-static") ++ )] ++ #[link( ++ name = "dl", ++ kind = "static", ++ modifiers = "-bundle", ++ cfg(target_feature = "crt-static") ++ )] ++ #[link( ++ name = "c", ++ kind = "static", ++ modifiers = "-bundle", ++ cfg(target_feature = "crt-static") ++ )] ++ #[link( ++ name = "gcc_eh", ++ kind = "static", ++ modifiers = "-bundle", ++ cfg(target_feature = "crt-static") ++ )] ++ #[link( ++ name = "gcc", ++ kind = "static", ++ modifiers = "-bundle", ++ cfg(target_feature = "crt-static") ++ )] ++ #[link( ++ name = "c", ++ kind = "static", ++ modifiers = "-bundle", ++ cfg(target_feature = "crt-static") ++ )] ++ #[link(name = "util", cfg(not(target_feature = "crt-static")))] ++ #[link(name = "rt", cfg(not(target_feature = "crt-static")))] ++ #[link(name = "pthread", cfg(not(target_feature = "crt-static")))] ++ #[link(name = "m", cfg(not(target_feature = "crt-static")))] ++ #[link(name = "dl", cfg(not(target_feature = "crt-static")))] ++ #[link(name = "c", cfg(not(target_feature = "crt-static")))] ++ extern "C" {} ++ } else if #[cfg(any(target_env = "musl", target_env = "ohos"))] { ++ #[cfg_attr( ++ feature = "rustc-dep-of-std", ++ link( ++ name = "c", ++ kind = "static", ++ modifiers = "-bundle", ++ cfg(target_feature = "crt-static") ++ ) ++ )] ++ #[cfg_attr( ++ feature = "rustc-dep-of-std", ++ link(name = "c", cfg(not(target_feature = "crt-static"))) ++ )] ++ extern "C" {} ++ } else if #[cfg(target_os = "emscripten")] { ++ // Don't pass -lc to Emscripten, it breaks. See: ++ // https://github.com/emscripten-core/emscripten/issues/22758 ++ } 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")))] ++ extern "C" {} ++ } else if #[cfg(any( ++ target_os = "macos", ++ target_os = "ios", ++ target_os = "tvos", ++ target_os = "watchos", ++ target_os = "visionos", ++ target_os = "android", ++ target_os = "openbsd", ++ target_os = "nto", ++ ))] { ++ #[link(name = "c")] ++ #[link(name = "m")] ++ extern "C" {} ++ } else if #[cfg(target_os = "haiku")] { ++ #[link(name = "root")] ++ #[link(name = "network")] ++ extern "C" {} ++ } else if #[cfg(target_env = "newlib")] { ++ #[link(name = "c")] ++ #[link(name = "m")] ++ extern "C" {} ++ } else if #[cfg(target_env = "illumos")] { ++ #[link(name = "c")] ++ #[link(name = "m")] ++ extern "C" {} ++ } else if #[cfg(target_os = "redox")] { ++ #[cfg_attr( ++ feature = "rustc-dep-of-std", ++ link( ++ name = "c", ++ kind = "static", ++ modifiers = "-bundle", ++ cfg(target_feature = "crt-static") ++ ) ++ )] ++ #[cfg_attr( ++ feature = "rustc-dep-of-std", ++ link(name = "c", cfg(not(target_feature = "crt-static"))) ++ )] ++ extern "C" {} ++ } else if #[cfg(target_os = "aix")] { ++ #[link(name = "c")] ++ #[link(name = "m")] ++ #[link(name = "bsd")] ++ #[link(name = "pthread")] ++ extern "C" {} ++ } else { ++ #[link(name = "c")] ++ #[link(name = "m")] ++ #[link(name = "rt")] ++ #[link(name = "pthread")] ++ extern "C" {} ++ } ++} ++ ++missing! { ++ #[cfg_attr(feature = "extra_traits", derive(Debug))] ++ pub enum FILE {} ++ #[cfg_attr(feature = "extra_traits", derive(Debug))] ++ pub enum fpos_t {} // FIXME: fill this out with a struct ++} ++ ++extern "C" { ++ pub fn isalnum(c: c_int) -> c_int; ++ pub fn isalpha(c: c_int) -> c_int; ++ pub fn iscntrl(c: c_int) -> c_int; ++ pub fn isdigit(c: c_int) -> c_int; ++ pub fn isgraph(c: c_int) -> c_int; ++ pub fn islower(c: c_int) -> c_int; ++ pub fn isprint(c: c_int) -> c_int; ++ pub fn ispunct(c: c_int) -> c_int; ++ pub fn isspace(c: c_int) -> c_int; ++ pub fn isupper(c: c_int) -> c_int; ++ pub fn isxdigit(c: c_int) -> c_int; ++ pub fn isblank(c: c_int) -> c_int; ++ pub fn tolower(c: c_int) -> c_int; ++ pub fn toupper(c: c_int) -> c_int; ++ pub fn qsort( ++ base: *mut c_void, ++ num: size_t, ++ size: size_t, ++ compar: Option c_int>, ++ ); ++ pub fn bsearch( ++ key: *const c_void, ++ base: *const c_void, ++ num: size_t, ++ size: size_t, ++ compar: Option c_int>, ++ ) -> *mut c_void; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "fopen$UNIX2003" ++ )] ++ #[cfg_attr(gnu_time64_abi, link_name = "fopen64")] ++ pub fn fopen(filename: *const c_char, mode: *const c_char) -> *mut FILE; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "freopen$UNIX2003" ++ )] ++ #[cfg_attr(gnu_time64_abi, link_name = "freopen64")] ++ pub fn freopen(filename: *const c_char, mode: *const c_char, file: *mut FILE) -> *mut FILE; ++ ++ pub fn fflush(file: *mut FILE) -> c_int; ++ pub fn fclose(file: *mut FILE) -> c_int; ++ pub fn remove(filename: *const c_char) -> c_int; ++ pub fn rename(oldname: *const c_char, newname: *const c_char) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "tmpfile64")] ++ pub fn tmpfile() -> *mut FILE; ++ pub fn setvbuf(stream: *mut FILE, buffer: *mut c_char, mode: c_int, size: size_t) -> c_int; ++ pub fn setbuf(stream: *mut FILE, buf: *mut c_char); ++ pub fn getchar() -> c_int; ++ pub fn putchar(c: c_int) -> c_int; ++ pub fn fgetc(stream: *mut FILE) -> c_int; ++ pub fn fgets(buf: *mut c_char, n: c_int, stream: *mut FILE) -> *mut c_char; ++ pub fn fputc(c: c_int, stream: *mut FILE) -> c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "fputs$UNIX2003" ++ )] ++ pub fn fputs(s: *const c_char, stream: *mut FILE) -> c_int; ++ pub fn puts(s: *const c_char) -> c_int; ++ pub fn ungetc(c: c_int, stream: *mut FILE) -> c_int; ++ pub fn fread(ptr: *mut c_void, size: size_t, nobj: size_t, stream: *mut FILE) -> size_t; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "fwrite$UNIX2003" ++ )] ++ pub fn fwrite(ptr: *const c_void, size: size_t, nobj: size_t, stream: *mut FILE) -> size_t; ++ pub fn fseek(stream: *mut FILE, offset: c_long, whence: c_int) -> c_int; ++ pub fn ftell(stream: *mut FILE) -> c_long; ++ pub fn rewind(stream: *mut FILE); ++ #[cfg_attr(target_os = "netbsd", link_name = "__fgetpos50")] ++ #[cfg_attr(gnu_time64_abi, link_name = "fgetpos64")] ++ pub fn fgetpos(stream: *mut FILE, ptr: *mut fpos_t) -> c_int; ++ #[cfg_attr(target_os = "netbsd", link_name = "__fsetpos50")] ++ #[cfg_attr(gnu_time64_abi, link_name = "fsetpos64")] ++ pub fn fsetpos(stream: *mut FILE, ptr: *const fpos_t) -> c_int; ++ pub fn feof(stream: *mut FILE) -> c_int; ++ pub fn ferror(stream: *mut FILE) -> c_int; ++ pub fn clearerr(stream: *mut FILE); ++ pub fn perror(s: *const c_char); ++ pub fn atof(s: *const c_char) -> c_double; ++ pub fn atoi(s: *const c_char) -> c_int; ++ pub fn atol(s: *const c_char) -> c_long; ++ pub fn atoll(s: *const c_char) -> c_longlong; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "strtod$UNIX2003" ++ )] ++ 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; ++ pub fn strtol(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_long; ++ pub fn strtoll(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_longlong; ++ pub fn strtoul(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulong; ++ pub fn strtoull(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulonglong; ++ pub fn calloc(nobj: size_t, size: size_t) -> *mut c_void; ++ pub fn malloc(size: size_t) -> *mut c_void; ++ pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void; ++ pub fn free(p: *mut c_void); ++ pub fn abort() -> !; ++ pub fn exit(status: c_int) -> !; ++ pub fn _exit(status: c_int) -> !; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "system$UNIX2003" ++ )] ++ pub fn system(s: *const c_char) -> c_int; ++ pub fn getenv(s: *const c_char) -> *mut c_char; ++ ++ pub fn strcpy(dst: *mut c_char, src: *const c_char) -> *mut c_char; ++ pub fn strncpy(dst: *mut c_char, src: *const c_char, n: size_t) -> *mut c_char; ++ pub fn stpcpy(dst: *mut c_char, src: *const c_char) -> *mut c_char; ++ pub fn strcat(s: *mut c_char, ct: *const c_char) -> *mut c_char; ++ pub fn strncat(s: *mut c_char, ct: *const c_char, n: size_t) -> *mut c_char; ++ pub fn strcmp(cs: *const c_char, ct: *const c_char) -> c_int; ++ pub fn strncmp(cs: *const c_char, ct: *const c_char, n: size_t) -> c_int; ++ pub fn strcoll(cs: *const c_char, ct: *const c_char) -> c_int; ++ pub fn strchr(cs: *const c_char, c: c_int) -> *mut c_char; ++ pub fn strrchr(cs: *const c_char, c: c_int) -> *mut c_char; ++ pub fn strspn(cs: *const c_char, ct: *const c_char) -> size_t; ++ pub fn strcspn(cs: *const c_char, ct: *const c_char) -> size_t; ++ pub fn strdup(cs: *const c_char) -> *mut c_char; ++ pub fn strndup(cs: *const c_char, n: size_t) -> *mut c_char; ++ pub fn strpbrk(cs: *const c_char, ct: *const c_char) -> *mut c_char; ++ pub fn strstr(cs: *const c_char, ct: *const c_char) -> *mut c_char; ++ pub fn strcasecmp(s1: *const c_char, s2: *const c_char) -> c_int; ++ pub fn strncasecmp(s1: *const c_char, s2: *const c_char, n: size_t) -> c_int; ++ pub fn strlen(cs: *const c_char) -> size_t; ++ pub fn strnlen(cs: *const c_char, maxlen: size_t) -> size_t; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "strerror$UNIX2003" ++ )] ++ pub fn strerror(n: c_int) -> *mut c_char; ++ pub fn strtok(s: *mut c_char, t: *const c_char) -> *mut c_char; ++ pub fn strtok_r(s: *mut c_char, t: *const c_char, p: *mut *mut c_char) -> *mut c_char; ++ pub fn strxfrm(s: *mut c_char, ct: *const c_char, n: size_t) -> size_t; ++ pub fn strsignal(sig: c_int) -> *mut c_char; ++ pub fn wcslen(buf: *const wchar_t) -> size_t; ++ pub fn wcstombs(dest: *mut c_char, src: *const wchar_t, n: size_t) -> size_t; ++ ++ pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void; ++ pub fn wmemchr(cx: *const wchar_t, c: wchar_t, n: size_t) -> *mut wchar_t; ++ pub fn memcmp(cx: *const c_void, ct: *const c_void, n: size_t) -> c_int; ++ pub fn memcpy(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void; ++ pub fn memmove(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void; ++ pub fn memset(dest: *mut c_void, c: c_int, n: size_t) -> *mut c_void; ++ pub fn memccpy(dest: *mut c_void, src: *const c_void, c: c_int, n: size_t) -> *mut c_void; ++} ++ ++extern "C" { ++ #[cfg_attr(target_os = "netbsd", link_name = "__getpwnam50")] ++ pub fn getpwnam(name: *const c_char) -> *mut passwd; ++ #[cfg_attr(target_os = "netbsd", link_name = "__getpwuid50")] ++ pub fn getpwuid(uid: crate::uid_t) -> *mut passwd; ++ ++ pub fn fprintf(stream: *mut crate::FILE, format: *const c_char, ...) -> c_int; ++ pub fn printf(format: *const c_char, ...) -> c_int; ++ pub fn snprintf(s: *mut c_char, n: size_t, format: *const c_char, ...) -> c_int; ++ pub fn sprintf(s: *mut c_char, format: *const c_char, ...) -> c_int; ++ #[cfg_attr( ++ all(target_os = "linux", not(target_env = "uclibc")), ++ link_name = "__isoc99_fscanf" ++ )] ++ pub fn fscanf(stream: *mut crate::FILE, format: *const c_char, ...) -> c_int; ++ #[cfg_attr( ++ all(target_os = "linux", not(target_env = "uclibc")), ++ link_name = "__isoc99_scanf" ++ )] ++ pub fn scanf(format: *const c_char, ...) -> c_int; ++ #[cfg_attr( ++ all(target_os = "linux", not(target_env = "uclibc")), ++ link_name = "__isoc99_sscanf" ++ )] ++ pub fn sscanf(s: *const c_char, format: *const c_char, ...) -> c_int; ++ pub fn getchar_unlocked() -> c_int; ++ pub fn putchar_unlocked(c: c_int) -> c_int; ++ ++ #[cfg(not(all(target_arch = "powerpc", target_vendor = "nintendo")))] ++ #[cfg_attr(target_os = "netbsd", link_name = "__socket30")] ++ #[cfg_attr(target_os = "illumos", link_name = "__xnet_socket")] ++ #[cfg_attr(target_os = "solaris", link_name = "__xnet7_socket")] ++ #[cfg_attr(target_os = "espidf", link_name = "lwip_socket")] ++ pub fn socket(domain: c_int, ty: c_int, protocol: c_int) -> c_int; ++ #[cfg(not(all(target_arch = "powerpc", target_vendor = "nintendo")))] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "connect$UNIX2003" ++ )] ++ #[cfg_attr( ++ any(target_os = "illumos", target_os = "solaris"), ++ link_name = "__xnet_connect" ++ )] ++ #[cfg_attr(target_os = "espidf", link_name = "lwip_connect")] ++ pub fn connect(socket: c_int, address: *const sockaddr, len: socklen_t) -> c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "listen$UNIX2003" ++ )] ++ #[cfg_attr(target_os = "espidf", link_name = "lwip_listen")] ++ pub fn listen(socket: c_int, backlog: c_int) -> c_int; ++ #[cfg(not(all(target_arch = "powerpc", target_vendor = "nintendo")))] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "accept$UNIX2003" ++ )] ++ #[cfg_attr(target_os = "espidf", link_name = "lwip_accept")] ++ pub fn accept(socket: c_int, address: *mut sockaddr, address_len: *mut socklen_t) -> c_int; ++ #[cfg(not(all(target_arch = "powerpc", target_vendor = "nintendo")))] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "getpeername$UNIX2003" ++ )] ++ #[cfg_attr(target_os = "espidf", link_name = "lwip_getpeername")] ++ pub fn getpeername(socket: c_int, address: *mut sockaddr, address_len: *mut socklen_t) ++ -> c_int; ++ #[cfg(not(all(target_arch = "powerpc", target_vendor = "nintendo")))] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "getsockname$UNIX2003" ++ )] ++ #[cfg_attr(target_os = "espidf", link_name = "lwip_getsockname")] ++ pub fn getsockname(socket: c_int, address: *mut sockaddr, address_len: *mut socklen_t) ++ -> c_int; ++ #[cfg_attr(target_os = "espidf", link_name = "lwip_setsockopt")] ++ #[cfg_attr(gnu_time64_abi, link_name = "__setsockopt64")] ++ pub fn setsockopt( ++ socket: c_int, ++ level: c_int, ++ name: c_int, ++ value: *const c_void, ++ option_len: socklen_t, ++ ) -> c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "socketpair$UNIX2003" ++ )] ++ #[cfg_attr( ++ any(target_os = "illumos", target_os = "solaris"), ++ link_name = "__xnet_socketpair" ++ )] ++ pub fn socketpair( ++ domain: c_int, ++ type_: c_int, ++ protocol: c_int, ++ socket_vector: *mut c_int, ++ ) -> c_int; ++ #[cfg(not(all(target_arch = "powerpc", target_vendor = "nintendo")))] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "sendto$UNIX2003" ++ )] ++ #[cfg_attr( ++ any(target_os = "illumos", target_os = "solaris"), ++ link_name = "__xnet_sendto" ++ )] ++ #[cfg_attr(target_os = "espidf", link_name = "lwip_sendto")] ++ pub fn sendto( ++ socket: c_int, ++ buf: *const c_void, ++ len: size_t, ++ flags: c_int, ++ addr: *const sockaddr, ++ addrlen: socklen_t, ++ ) -> ssize_t; ++ #[cfg_attr(target_os = "espidf", link_name = "lwip_shutdown")] ++ pub fn shutdown(socket: c_int, how: c_int) -> c_int; ++ ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "chmod$UNIX2003" ++ )] ++ pub fn chmod(path: *const c_char, mode: mode_t) -> c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "fchmod$UNIX2003" ++ )] ++ pub fn fchmod(fd: c_int, mode: mode_t) -> c_int; ++ ++ #[cfg_attr( ++ all(target_os = "macos", not(target_arch = "aarch64")), ++ link_name = "fstat$INODE64" ++ )] ++ #[cfg_attr(target_os = "netbsd", link_name = "__fstat50")] ++ #[cfg_attr( ++ all(target_os = "freebsd", any(freebsd11, freebsd10)), ++ link_name = "fstat@FBSD_1.0" ++ )] ++ #[cfg_attr(gnu_time64_abi, link_name = "__fstat64_time64")] ++ pub fn fstat(fildes: c_int, buf: *mut stat) -> c_int; ++ ++ pub fn mkdir(path: *const c_char, mode: mode_t) -> c_int; ++ ++ #[cfg_attr( ++ all(target_os = "macos", not(target_arch = "aarch64")), ++ link_name = "stat$INODE64" ++ )] ++ #[cfg_attr(target_os = "netbsd", link_name = "__stat50")] ++ #[cfg_attr( ++ all(target_os = "freebsd", any(freebsd11, freebsd10)), ++ link_name = "stat@FBSD_1.0" ++ )] ++ #[cfg_attr(gnu_time64_abi, link_name = "__stat64_time64")] ++ pub fn stat(path: *const c_char, buf: *mut stat) -> c_int; ++ ++ pub fn pclose(stream: *mut crate::FILE) -> c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "fdopen$UNIX2003" ++ )] ++ pub fn fdopen(fd: c_int, mode: *const c_char) -> *mut crate::FILE; ++ pub fn fileno(stream: *mut crate::FILE) -> c_int; ++ ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "open$UNIX2003" ++ )] ++ #[cfg_attr(gnu_time64_abi, link_name = "open64")] ++ pub fn open(path: *const c_char, oflag: c_int, ...) -> c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "creat$UNIX2003" ++ )] ++ #[cfg_attr(gnu_time64_abi, link_name = "creat64")] ++ pub fn creat(path: *const c_char, mode: mode_t) -> c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "fcntl$UNIX2003" ++ )] ++ #[cfg_attr(gnu_time64_abi, link_name = "__fcntl_time64")] ++ pub fn fcntl(fd: c_int, cmd: c_int, ...) -> c_int; ++ ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86_64"), ++ link_name = "opendir$INODE64" ++ )] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "opendir$INODE64$UNIX2003" ++ )] ++ #[cfg_attr(target_os = "netbsd", link_name = "__opendir30")] ++ pub fn opendir(dirname: *const c_char) -> *mut crate::DIR; ++ ++ #[cfg_attr( ++ all(target_os = "macos", not(target_arch = "aarch64")), ++ link_name = "readdir$INODE64" ++ )] ++ #[cfg_attr(target_os = "netbsd", link_name = "__readdir30")] ++ #[cfg_attr( ++ all(target_os = "freebsd", any(freebsd11, freebsd10)), ++ link_name = "readdir@FBSD_1.0" ++ )] ++ #[cfg_attr(gnu_time64_abi, link_name = "readdir64")] ++ pub fn readdir(dirp: *mut crate::DIR) -> *mut crate::dirent; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "closedir$UNIX2003" ++ )] ++ pub fn closedir(dirp: *mut crate::DIR) -> c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86_64"), ++ link_name = "rewinddir$INODE64" ++ )] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "rewinddir$INODE64$UNIX2003" ++ )] ++ pub fn rewinddir(dirp: *mut crate::DIR); ++ ++ pub fn fchmodat( ++ dirfd: c_int, ++ pathname: *const c_char, ++ mode: crate::mode_t, ++ flags: c_int, ++ ) -> c_int; ++ pub fn fchown(fd: c_int, owner: crate::uid_t, group: crate::gid_t) -> c_int; ++ pub fn fchownat( ++ dirfd: c_int, ++ pathname: *const c_char, ++ owner: crate::uid_t, ++ group: crate::gid_t, ++ flags: c_int, ++ ) -> c_int; ++ #[cfg_attr( ++ all(target_os = "macos", not(target_arch = "aarch64")), ++ link_name = "fstatat$INODE64" ++ )] ++ #[cfg_attr( ++ all(target_os = "freebsd", any(freebsd11, freebsd10)), ++ link_name = "fstatat@FBSD_1.1" ++ )] ++ #[cfg_attr(gnu_time64_abi, link_name = "__fstatat64_time64")] ++ pub fn fstatat(dirfd: c_int, pathname: *const c_char, buf: *mut stat, flags: c_int) -> c_int; ++ pub fn linkat( ++ olddirfd: c_int, ++ oldpath: *const c_char, ++ newdirfd: c_int, ++ newpath: *const c_char, ++ flags: c_int, ++ ) -> c_int; ++ pub fn renameat( ++ olddirfd: c_int, ++ oldpath: *const c_char, ++ newdirfd: c_int, ++ newpath: *const c_char, ++ ) -> c_int; ++ pub fn symlinkat(target: *const c_char, newdirfd: c_int, linkpath: *const c_char) -> c_int; ++ pub fn unlinkat(dirfd: c_int, pathname: *const c_char, flags: c_int) -> c_int; ++ ++ pub fn access(path: *const c_char, amode: c_int) -> c_int; ++ pub fn alarm(seconds: c_uint) -> c_uint; ++ pub fn chdir(dir: *const c_char) -> c_int; ++ pub fn fchdir(dirfd: c_int) -> c_int; ++ pub fn chown(path: *const c_char, uid: uid_t, gid: gid_t) -> c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "lchown$UNIX2003" ++ )] ++ pub fn lchown(path: *const c_char, uid: uid_t, gid: gid_t) -> c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "close$NOCANCEL$UNIX2003" ++ )] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86_64"), ++ link_name = "close$NOCANCEL" ++ )] ++ pub fn close(fd: c_int) -> c_int; ++ pub fn dup(fd: c_int) -> c_int; ++ pub fn dup2(src: c_int, dst: c_int) -> c_int; ++ ++ pub fn execl(path: *const c_char, arg0: *const c_char, ...) -> c_int; ++ pub fn execle(path: *const c_char, arg0: *const c_char, ...) -> c_int; ++ pub fn execlp(file: *const c_char, arg0: *const c_char, ...) -> c_int; ++ ++ // DIFF(main): changed to `*const *mut` in e77f551de9 ++ pub fn execv(prog: *const c_char, argv: *const *const c_char) -> c_int; ++ pub fn execve( ++ prog: *const c_char, ++ argv: *const *const c_char, ++ envp: *const *const c_char, ++ ) -> c_int; ++ pub fn execvp(c: *const c_char, argv: *const *const c_char) -> c_int; ++ ++ pub fn fork() -> pid_t; ++ pub fn fpathconf(filedes: c_int, name: c_int) -> c_long; ++ pub fn getcwd(buf: *mut c_char, size: size_t) -> *mut c_char; ++ pub fn getegid() -> gid_t; ++ pub fn geteuid() -> uid_t; ++ pub fn getgid() -> gid_t; ++ pub fn getgroups(ngroups_max: c_int, groups: *mut gid_t) -> c_int; ++ #[cfg_attr(target_os = "illumos", link_name = "getloginx")] ++ pub fn getlogin() -> *mut c_char; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "getopt$UNIX2003" ++ )] ++ pub fn getopt(argc: c_int, argv: *const *mut c_char, optstr: *const c_char) -> c_int; ++ pub fn getpgid(pid: pid_t) -> pid_t; ++ pub fn getpgrp() -> pid_t; ++ pub fn getpid() -> pid_t; ++ pub fn getppid() -> pid_t; ++ pub fn getuid() -> uid_t; ++ pub fn isatty(fd: c_int) -> c_int; ++ #[cfg_attr(target_os = "solaris", link_name = "__link_xpg4")] ++ pub fn link(src: *const c_char, dst: *const c_char) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "lseek64")] ++ pub fn lseek(fd: c_int, offset: off_t, whence: c_int) -> off_t; ++ pub fn pathconf(path: *const c_char, name: c_int) -> c_long; ++ pub fn pipe(fds: *mut c_int) -> c_int; ++ pub fn posix_memalign(memptr: *mut *mut c_void, align: size_t, size: size_t) -> c_int; ++ pub fn aligned_alloc(alignment: size_t, size: size_t) -> *mut c_void; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "read$UNIX2003" ++ )] ++ pub fn read(fd: c_int, buf: *mut c_void, count: size_t) -> ssize_t; ++ pub fn rmdir(path: *const c_char) -> c_int; ++ pub fn seteuid(uid: uid_t) -> c_int; ++ pub fn setegid(gid: gid_t) -> c_int; ++ pub fn setgid(gid: gid_t) -> c_int; ++ 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" ++ )] ++ pub fn sleep(secs: c_uint) -> c_uint; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "nanosleep$UNIX2003" ++ )] ++ #[cfg_attr(target_os = "netbsd", link_name = "__nanosleep50")] ++ #[cfg_attr(gnu_time64_abi, link_name = "__nanosleep64")] ++ pub fn nanosleep(rqtp: *const timespec, rmtp: *mut timespec) -> c_int; ++ pub fn tcgetpgrp(fd: c_int) -> pid_t; ++ pub fn tcsetpgrp(fd: c_int, pgrp: crate::pid_t) -> c_int; ++ pub fn ttyname(fd: c_int) -> *mut c_char; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "ttyname_r$UNIX2003" ++ )] ++ #[cfg_attr( ++ any(target_os = "illumos", target_os = "solaris"), ++ link_name = "__posix_ttyname_r" ++ )] ++ pub fn ttyname_r(fd: c_int, buf: *mut c_char, buflen: size_t) -> c_int; ++ pub fn unlink(c: *const c_char) -> c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "wait$UNIX2003" ++ )] ++ pub fn wait(status: *mut c_int) -> pid_t; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "waitpid$UNIX2003" ++ )] ++ pub fn waitpid(pid: pid_t, status: *mut c_int, options: c_int) -> pid_t; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "write$UNIX2003" ++ )] ++ pub fn write(fd: c_int, buf: *const c_void, count: size_t) -> ssize_t; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "pread$UNIX2003" ++ )] ++ #[cfg_attr(gnu_time64_abi, link_name = "pread64")] ++ pub fn pread(fd: c_int, buf: *mut c_void, count: size_t, offset: off_t) -> ssize_t; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "pwrite$UNIX2003" ++ )] ++ #[cfg_attr(gnu_time64_abi, link_name = "pwrite64")] ++ pub fn pwrite(fd: c_int, buf: *const c_void, count: size_t, offset: off_t) -> ssize_t; ++ pub fn umask(mask: mode_t) -> mode_t; ++ ++ #[cfg_attr(target_os = "netbsd", link_name = "__utime50")] ++ #[cfg_attr(gnu_time64_abi, link_name = "__utime64")] ++ pub fn utime(file: *const c_char, buf: *const utimbuf) -> c_int; ++ ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "kill$UNIX2003" ++ )] ++ pub fn kill(pid: pid_t, sig: c_int) -> c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "killpg$UNIX2003" ++ )] ++ pub fn killpg(pgrp: pid_t, sig: c_int) -> c_int; ++ ++ pub fn mlock(addr: *const c_void, len: size_t) -> c_int; ++ pub fn munlock(addr: *const c_void, len: size_t) -> c_int; ++ pub fn mlockall(flags: c_int) -> c_int; ++ pub fn munlockall() -> c_int; ++ ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "mmap$UNIX2003" ++ )] ++ #[cfg_attr(gnu_time64_abi, link_name = "mmap64")] ++ pub fn mmap( ++ addr: *mut c_void, ++ len: size_t, ++ prot: c_int, ++ flags: c_int, ++ fd: c_int, ++ offset: off_t, ++ ) -> *mut c_void; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "munmap$UNIX2003" ++ )] ++ pub fn munmap(addr: *mut c_void, len: size_t) -> c_int; ++ ++ pub fn if_nametoindex(ifname: *const c_char) -> c_uint; ++ pub fn if_indextoname(ifindex: c_uint, ifname: *mut c_char) -> *mut c_char; ++ ++ #[cfg_attr( ++ all(target_os = "macos", not(target_arch = "aarch64")), ++ link_name = "lstat$INODE64" ++ )] ++ #[cfg_attr(target_os = "netbsd", link_name = "__lstat50")] ++ #[cfg_attr( ++ all(target_os = "freebsd", any(freebsd11, freebsd10)), ++ link_name = "lstat@FBSD_1.0" ++ )] ++ #[cfg_attr(gnu_time64_abi, link_name = "__lstat64_time64")] ++ pub fn lstat(path: *const c_char, buf: *mut stat) -> c_int; ++ ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "fsync$UNIX2003" ++ )] ++ pub fn fsync(fd: c_int) -> c_int; ++ ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "setenv$UNIX2003" ++ )] ++ pub fn setenv(name: *const c_char, val: *const c_char, overwrite: c_int) -> c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "unsetenv$UNIX2003" ++ )] ++ #[cfg_attr(target_os = "netbsd", link_name = "__unsetenv13")] ++ pub fn unsetenv(name: *const c_char) -> c_int; ++ ++ pub fn symlink(path1: *const c_char, path2: *const c_char) -> c_int; ++ ++ #[cfg_attr(gnu_time64_abi, link_name = "truncate64")] ++ pub fn truncate(path: *const c_char, length: off_t) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "ftruncate64")] ++ pub fn ftruncate(fd: c_int, length: off_t) -> c_int; ++ ++ pub fn signal(signum: c_int, handler: sighandler_t) -> sighandler_t; ++ ++ #[cfg_attr(target_os = "netbsd", link_name = "__getrusage50")] ++ #[cfg_attr(gnu_time64_abi, link_name = "__getrusage64")] ++ pub fn getrusage(resource: c_int, usage: *mut rusage) -> c_int; ++ ++ #[cfg_attr( ++ any( ++ target_os = "macos", ++ target_os = "ios", ++ target_os = "tvos", ++ target_os = "watchos", ++ target_os = "visionos" ++ ), ++ link_name = "realpath$DARWIN_EXTSN" ++ )] ++ pub fn realpath(pathname: *const c_char, resolved: *mut c_char) -> *mut c_char; ++ ++ #[cfg_attr(target_os = "netbsd", link_name = "__times13")] ++ pub fn times(buf: *mut crate::tms) -> crate::clock_t; ++ ++ pub fn pthread_self() -> crate::pthread_t; ++ pub fn pthread_equal(t1: crate::pthread_t, t2: crate::pthread_t) -> c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "pthread_join$UNIX2003" ++ )] ++ pub fn pthread_join(native: crate::pthread_t, value: *mut *mut c_void) -> c_int; ++ pub fn pthread_exit(value: *mut c_void) -> !; ++ pub fn pthread_attr_init(attr: *mut crate::pthread_attr_t) -> c_int; ++ pub fn pthread_attr_destroy(attr: *mut crate::pthread_attr_t) -> c_int; ++ pub fn pthread_attr_getstacksize( ++ attr: *const crate::pthread_attr_t, ++ stacksize: *mut size_t, ++ ) -> c_int; ++ pub fn pthread_attr_setstacksize(attr: *mut crate::pthread_attr_t, stack_size: size_t) ++ -> c_int; ++ pub fn pthread_attr_setdetachstate(attr: *mut crate::pthread_attr_t, state: c_int) -> c_int; ++ pub fn pthread_detach(thread: crate::pthread_t) -> c_int; ++ #[cfg_attr(target_os = "netbsd", link_name = "__libc_thr_yield")] ++ pub fn sched_yield() -> c_int; ++ pub fn pthread_key_create( ++ key: *mut pthread_key_t, ++ dtor: Option, ++ ) -> c_int; ++ pub fn pthread_key_delete(key: pthread_key_t) -> c_int; ++ pub fn pthread_getspecific(key: pthread_key_t) -> *mut c_void; ++ pub fn pthread_setspecific(key: pthread_key_t, value: *const c_void) -> c_int; ++ pub fn pthread_mutex_init( ++ lock: *mut pthread_mutex_t, ++ attr: *const pthread_mutexattr_t, ++ ) -> c_int; ++ pub fn pthread_mutex_destroy(lock: *mut pthread_mutex_t) -> c_int; ++ pub fn pthread_mutex_lock(lock: *mut pthread_mutex_t) -> c_int; ++ pub fn pthread_mutex_trylock(lock: *mut pthread_mutex_t) -> c_int; ++ pub fn pthread_mutex_unlock(lock: *mut pthread_mutex_t) -> c_int; ++ ++ pub fn pthread_mutexattr_init(attr: *mut pthread_mutexattr_t) -> c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "pthread_mutexattr_destroy$UNIX2003" ++ )] ++ pub fn pthread_mutexattr_destroy(attr: *mut pthread_mutexattr_t) -> c_int; ++ pub fn pthread_mutexattr_settype(attr: *mut pthread_mutexattr_t, _type: c_int) -> c_int; ++ ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "pthread_cond_init$UNIX2003" ++ )] ++ pub fn pthread_cond_init(cond: *mut pthread_cond_t, attr: *const pthread_condattr_t) -> c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "pthread_cond_wait$UNIX2003" ++ )] ++ pub fn pthread_cond_wait(cond: *mut pthread_cond_t, lock: *mut pthread_mutex_t) -> c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "pthread_cond_timedwait$UNIX2003" ++ )] ++ #[cfg_attr(gnu_time64_abi, link_name = "__pthread_cond_timedwait64")] ++ pub fn pthread_cond_timedwait( ++ cond: *mut pthread_cond_t, ++ lock: *mut pthread_mutex_t, ++ abstime: *const crate::timespec, ++ ) -> c_int; ++ pub fn pthread_cond_signal(cond: *mut pthread_cond_t) -> c_int; ++ pub fn pthread_cond_broadcast(cond: *mut pthread_cond_t) -> c_int; ++ pub fn pthread_cond_destroy(cond: *mut pthread_cond_t) -> c_int; ++ pub fn pthread_condattr_init(attr: *mut pthread_condattr_t) -> c_int; ++ pub fn pthread_condattr_destroy(attr: *mut pthread_condattr_t) -> c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "pthread_rwlock_init$UNIX2003" ++ )] ++ pub fn pthread_rwlock_init( ++ lock: *mut pthread_rwlock_t, ++ attr: *const pthread_rwlockattr_t, ++ ) -> c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "pthread_rwlock_destroy$UNIX2003" ++ )] ++ pub fn pthread_rwlock_destroy(lock: *mut pthread_rwlock_t) -> c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "pthread_rwlock_rdlock$UNIX2003" ++ )] ++ pub fn pthread_rwlock_rdlock(lock: *mut pthread_rwlock_t) -> c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "pthread_rwlock_tryrdlock$UNIX2003" ++ )] ++ pub fn pthread_rwlock_tryrdlock(lock: *mut pthread_rwlock_t) -> c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "pthread_rwlock_wrlock$UNIX2003" ++ )] ++ pub fn pthread_rwlock_wrlock(lock: *mut pthread_rwlock_t) -> c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "pthread_rwlock_trywrlock$UNIX2003" ++ )] ++ pub fn pthread_rwlock_trywrlock(lock: *mut pthread_rwlock_t) -> c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "pthread_rwlock_unlock$UNIX2003" ++ )] ++ pub fn pthread_rwlock_unlock(lock: *mut pthread_rwlock_t) -> c_int; ++ pub fn pthread_rwlockattr_init(attr: *mut pthread_rwlockattr_t) -> c_int; ++ pub fn pthread_rwlockattr_destroy(attr: *mut pthread_rwlockattr_t) -> c_int; ++ ++ #[cfg_attr( ++ any(target_os = "illumos", target_os = "solaris"), ++ link_name = "__xnet_getsockopt" ++ )] ++ #[cfg_attr(target_os = "espidf", link_name = "lwip_getsockopt")] ++ #[cfg_attr(gnu_time64_abi, link_name = "__getsockopt64")] ++ pub fn getsockopt( ++ sockfd: c_int, ++ level: c_int, ++ optname: c_int, ++ optval: *mut c_void, ++ optlen: *mut crate::socklen_t, ++ ) -> c_int; ++ pub fn raise(signum: c_int) -> c_int; ++ ++ #[cfg_attr(target_os = "netbsd", link_name = "__utimes50")] ++ #[cfg_attr(gnu_time64_abi, link_name = "__utimes64")] ++ pub fn utimes(filename: *const c_char, times: *const crate::timeval) -> c_int; ++ pub fn dlopen(filename: *const c_char, flag: c_int) -> *mut c_void; ++ pub fn dlerror() -> *mut c_char; ++ pub fn dlsym(handle: *mut c_void, symbol: *const c_char) -> *mut c_void; ++ pub fn dlclose(handle: *mut c_void) -> c_int; ++ ++ #[cfg(not(all(target_arch = "powerpc", target_vendor = "nintendo")))] ++ #[cfg_attr( ++ any(target_os = "illumos", target_os = "solaris"), ++ link_name = "__xnet_getaddrinfo" ++ )] ++ #[cfg_attr(target_os = "espidf", link_name = "lwip_getaddrinfo")] ++ pub fn getaddrinfo( ++ node: *const c_char, ++ service: *const c_char, ++ hints: *const addrinfo, ++ res: *mut *mut addrinfo, ++ ) -> c_int; ++ #[cfg(not(all(target_arch = "powerpc", target_vendor = "nintendo")))] ++ #[cfg_attr(target_os = "espidf", link_name = "lwip_freeaddrinfo")] ++ pub fn freeaddrinfo(res: *mut addrinfo); ++ pub fn hstrerror(errcode: c_int) -> *const c_char; ++ pub fn gai_strerror(errcode: c_int) -> *const c_char; ++ #[cfg_attr( ++ any( ++ all( ++ target_os = "linux", ++ not(any(target_env = "musl", target_env = "ohos")) ++ ), ++ target_os = "freebsd", ++ target_os = "dragonfly", ++ target_os = "haiku" ++ ), ++ link_name = "__res_init" ++ )] ++ #[cfg_attr( ++ any( ++ target_os = "macos", ++ target_os = "ios", ++ target_os = "tvos", ++ target_os = "watchos", ++ target_os = "visionos" ++ ), ++ link_name = "res_9_init" ++ )] ++ pub fn res_init() -> c_int; ++ ++ #[cfg_attr(target_os = "netbsd", link_name = "__gmtime_r50")] ++ #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))] ++ // FIXME: for `time_t` ++ #[cfg_attr(gnu_time64_abi, link_name = "__gmtime64_r")] ++ pub fn gmtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm; ++ #[cfg_attr(target_os = "netbsd", link_name = "__localtime_r50")] ++ #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))] ++ // FIXME: for `time_t` ++ #[cfg_attr(gnu_time64_abi, link_name = "__localtime64_r")] ++ pub fn localtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "mktime$UNIX2003" ++ )] ++ #[cfg_attr(target_os = "netbsd", link_name = "__mktime50")] ++ #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))] ++ // FIXME: for `time_t` ++ #[cfg_attr(gnu_time64_abi, link_name = "__mktime64")] ++ pub fn mktime(tm: *mut tm) -> time_t; ++ #[cfg_attr(target_os = "netbsd", link_name = "__time50")] ++ #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))] ++ // FIXME: for `time_t` ++ #[cfg_attr(gnu_time64_abi, link_name = "__time64")] ++ pub fn time(time: *mut time_t) -> time_t; ++ #[cfg_attr(target_os = "netbsd", link_name = "__gmtime50")] ++ #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))] ++ // FIXME: for `time_t` ++ #[cfg_attr(gnu_time64_abi, link_name = "__gmtime64")] ++ pub fn gmtime(time_p: *const time_t) -> *mut tm; ++ #[cfg_attr(target_os = "netbsd", link_name = "__locatime50")] ++ #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))] ++ // FIXME: for `time_t` ++ #[cfg_attr(gnu_time64_abi, link_name = "__localtime64")] ++ pub fn localtime(time_p: *const time_t) -> *mut tm; ++ #[cfg_attr(target_os = "netbsd", link_name = "__difftime50")] ++ #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))] ++ // FIXME: for `time_t` ++ #[cfg_attr(gnu_time64_abi, link_name = "__difftime64")] ++ pub fn difftime(time1: time_t, time0: time_t) -> c_double; ++ #[cfg_attr(target_os = "netbsd", link_name = "__timegm50")] ++ #[cfg_attr(any(target_env = "musl", target_env = "ohos"), allow(deprecated))] ++ // FIXME: for `time_t` ++ #[cfg_attr(gnu_time64_abi, link_name = "__timegm64")] ++ pub fn timegm(tm: *mut crate::tm) -> time_t; ++ ++ #[cfg_attr(target_os = "netbsd", link_name = "__mknod50")] ++ #[cfg_attr( ++ all(target_os = "freebsd", any(freebsd11, freebsd10)), ++ link_name = "mknod@FBSD_1.0" ++ )] ++ pub fn mknod(pathname: *const c_char, mode: crate::mode_t, dev: crate::dev_t) -> c_int; ++ pub fn gethostname(name: *mut c_char, len: size_t) -> c_int; ++ pub fn endservent(); ++ pub fn getservbyname(name: *const c_char, proto: *const c_char) -> *mut servent; ++ pub fn getservbyport(port: c_int, proto: *const c_char) -> *mut servent; ++ pub fn getservent() -> *mut servent; ++ pub fn setservent(stayopen: c_int); ++ pub fn getprotobyname(name: *const c_char) -> *mut protoent; ++ pub fn getprotobynumber(proto: c_int) -> *mut protoent; ++ pub fn chroot(name: *const c_char) -> c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "usleep$UNIX2003" ++ )] ++ pub fn usleep(secs: c_uint) -> c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "send$UNIX2003" ++ )] ++ #[cfg_attr(target_os = "espidf", link_name = "lwip_send")] ++ pub fn send(socket: c_int, buf: *const c_void, len: size_t, flags: c_int) -> ssize_t; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "recv$UNIX2003" ++ )] ++ #[cfg_attr(target_os = "espidf", link_name = "lwip_recv")] ++ pub fn recv(socket: c_int, buf: *mut c_void, len: size_t, flags: c_int) -> ssize_t; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "putenv$UNIX2003" ++ )] ++ #[cfg_attr(target_os = "netbsd", link_name = "__putenv50")] ++ pub fn putenv(string: *mut c_char) -> c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "poll$UNIX2003" ++ )] ++ pub fn poll(fds: *mut pollfd, nfds: nfds_t, timeout: c_int) -> c_int; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86_64"), ++ link_name = "select$1050" ++ )] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "select$UNIX2003" ++ )] ++ #[cfg_attr(target_os = "netbsd", link_name = "__select50")] ++ #[cfg_attr(gnu_time64_abi, link_name = "__select64")] ++ pub fn select( ++ nfds: c_int, ++ readfds: *mut fd_set, ++ writefds: *mut fd_set, ++ errorfds: *mut fd_set, ++ timeout: *mut timeval, ++ ) -> c_int; ++ #[cfg_attr(target_os = "netbsd", link_name = "__setlocale50")] ++ pub fn setlocale(category: c_int, locale: *const c_char) -> *mut c_char; ++ pub fn localeconv() -> *mut lconv; ++ ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "sem_wait$UNIX2003" ++ )] ++ pub fn sem_wait(sem: *mut sem_t) -> c_int; ++ pub fn sem_trywait(sem: *mut sem_t) -> c_int; ++ pub fn sem_post(sem: *mut sem_t) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "statvfs64")] ++ pub fn statvfs(path: *const c_char, buf: *mut statvfs) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "fstatvfs64")] ++ pub fn fstatvfs(fd: c_int, buf: *mut statvfs) -> c_int; ++ ++ #[cfg_attr(target_os = "netbsd", link_name = "__sigemptyset14")] ++ pub fn sigemptyset(set: *mut sigset_t) -> c_int; ++ #[cfg_attr(target_os = "netbsd", link_name = "__sigaddset14")] ++ pub fn sigaddset(set: *mut sigset_t, signum: c_int) -> c_int; ++ #[cfg_attr(target_os = "netbsd", link_name = "__sigfillset14")] ++ pub fn sigfillset(set: *mut sigset_t) -> c_int; ++ #[cfg_attr(target_os = "netbsd", link_name = "__sigdelset14")] ++ pub fn sigdelset(set: *mut sigset_t, signum: c_int) -> c_int; ++ #[cfg_attr(target_os = "netbsd", link_name = "__sigismember14")] ++ pub fn sigismember(set: *const sigset_t, signum: c_int) -> c_int; ++ ++ #[cfg_attr(target_os = "netbsd", link_name = "__sigprocmask14")] ++ pub fn sigprocmask(how: c_int, set: *const sigset_t, oldset: *mut sigset_t) -> c_int; ++ #[cfg_attr(target_os = "netbsd", link_name = "__sigpending14")] ++ pub fn sigpending(set: *mut sigset_t) -> c_int; ++ ++ #[cfg_attr(target_os = "solaris", link_name = "__sysconf_xpg7")] ++ pub fn sysconf(name: c_int) -> c_long; ++ ++ pub fn mkfifo(path: *const c_char, mode: mode_t) -> c_int; ++ ++ #[cfg_attr(gnu_time64_abi, link_name = "fseeko64")] ++ pub fn fseeko(stream: *mut crate::FILE, offset: off_t, whence: c_int) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "ftello64")] ++ pub fn ftello(stream: *mut crate::FILE) -> off_t; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "tcdrain$UNIX2003" ++ )] ++ pub fn tcdrain(fd: c_int) -> c_int; ++ pub fn cfgetispeed(termios: *const crate::termios) -> crate::speed_t; ++ pub fn cfgetospeed(termios: *const crate::termios) -> crate::speed_t; ++ pub fn cfsetispeed(termios: *mut crate::termios, speed: crate::speed_t) -> c_int; ++ pub fn cfsetospeed(termios: *mut crate::termios, speed: crate::speed_t) -> c_int; ++ pub fn tcgetattr(fd: c_int, termios: *mut crate::termios) -> c_int; ++ pub fn tcsetattr(fd: c_int, optional_actions: c_int, termios: *const crate::termios) -> c_int; ++ pub fn tcflow(fd: c_int, action: c_int) -> c_int; ++ pub fn tcflush(fd: c_int, action: c_int) -> c_int; ++ pub fn tcgetsid(fd: c_int) -> crate::pid_t; ++ pub fn tcsendbreak(fd: c_int, duration: c_int) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "mkstemp64")] ++ pub fn mkstemp(template: *mut c_char) -> c_int; ++ pub fn mkdtemp(template: *mut c_char) -> *mut c_char; ++ ++ pub fn tmpnam(ptr: *mut c_char) -> *mut c_char; ++ ++ pub fn openlog(ident: *const c_char, logopt: c_int, facility: c_int); ++ pub fn closelog(); ++ pub fn setlogmask(maskpri: c_int) -> c_int; ++ #[cfg_attr(target_os = "macos", link_name = "syslog$DARWIN_EXTSN")] ++ pub fn syslog(priority: c_int, message: *const c_char, ...); ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "nice$UNIX2003" ++ )] ++ pub fn nice(incr: c_int) -> c_int; ++ ++ pub fn grantpt(fd: c_int) -> c_int; ++ pub fn posix_openpt(flags: c_int) -> c_int; ++ pub fn ptsname(fd: c_int) -> *mut c_char; ++ pub fn unlockpt(fd: c_int) -> c_int; ++ ++ pub fn strcasestr(cs: *const c_char, ct: *const c_char) -> *mut c_char; ++ pub fn getline(lineptr: *mut *mut c_char, n: *mut size_t, stream: *mut FILE) -> ssize_t; ++ ++ #[cfg_attr(gnu_time64_abi, link_name = "lockf64")] ++ pub fn lockf(fd: c_int, cmd: c_int, len: off_t) -> c_int; ++ ++} ++ ++safe_f! { ++ // It seems htonl, etc are macros on macOS. So we have to reimplement them. So let's ++ // reimplement them for all UNIX platforms ++ pub {const} fn htonl(hostlong: u32) -> u32 { ++ u32::to_be(hostlong) ++ } ++ pub {const} fn htons(hostshort: u16) -> u16 { ++ u16::to_be(hostshort) ++ } ++ pub {const} fn ntohl(netlong: u32) -> u32 { ++ u32::from_be(netlong) ++ } ++ pub {const} fn ntohs(netshort: u16) -> u16 { ++ u16::from_be(netshort) ++ } ++} ++ ++cfg_if! { ++ if #[cfg(not(any( ++ target_os = "emscripten", ++ target_os = "android", ++ target_os = "haiku", ++ target_os = "nto", ++ target_os = "solaris" ++ )))] { ++ extern "C" { ++ #[cfg_attr(gnu_time64_abi, link_name = "__adjtime64")] ++ pub fn adjtime(delta: *const timeval, olddelta: *mut timeval) -> c_int; ++ } ++ } else if #[cfg(target_os = "solaris")] { ++ extern "C" { ++ pub fn adjtime(delta: *mut timeval, olddelta: *mut timeval) -> c_int; ++ } ++ } ++} ++ ++cfg_if! { ++ if #[cfg(not(any( ++ target_os = "emscripten", ++ target_os = "android", ++ target_os = "nto" ++ )))] { ++ extern "C" { ++ pub fn stpncpy(dst: *mut c_char, src: *const c_char, n: size_t) -> *mut c_char; ++ } ++ } ++} ++ ++cfg_if! { ++ if #[cfg(not(target_os = "android"))] { ++ extern "C" { ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "confstr$UNIX2003" ++ )] ++ #[cfg_attr(target_os = "solaris", link_name = "__confstr_xpg7")] ++ pub fn confstr(name: c_int, buf: *mut c_char, len: size_t) -> size_t; ++ } ++ } ++} ++ ++cfg_if! { ++ if #[cfg(not(target_os = "aix"))] { ++ extern "C" { ++ pub fn dladdr(addr: *const c_void, info: *mut Dl_info) -> c_int; ++ } ++ } ++} ++ ++cfg_if! { ++ if #[cfg(not(target_os = "solaris"))] { ++ extern "C" { ++ pub fn flock(fd: c_int, operation: c_int) -> c_int; ++ } ++ } ++} ++ ++cfg_if! { ++ if #[cfg(not(any(target_env = "uclibc", target_os = "nto")))] { ++ extern "C" { ++ pub fn open_wmemstream(ptr: *mut *mut wchar_t, sizeloc: *mut size_t) -> *mut FILE; ++ } ++ } ++} ++ ++cfg_if! { ++ if #[cfg(not(target_os = "redox"))] { ++ extern "C" { ++ pub fn getsid(pid: pid_t) -> pid_t; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "pause$UNIX2003" ++ )] ++ pub fn pause() -> c_int; ++ ++ pub fn mkdirat(dirfd: c_int, pathname: *const c_char, mode: crate::mode_t) -> c_int; ++ #[cfg_attr(gnu_time64_abi, link_name = "openat64")] ++ pub fn openat(dirfd: c_int, pathname: *const c_char, flags: c_int, ...) -> c_int; ++ ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86_64"), ++ link_name = "fdopendir$INODE64" ++ )] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "fdopendir$INODE64$UNIX2003" ++ )] ++ pub fn fdopendir(fd: c_int) -> *mut crate::DIR; ++ ++ #[cfg_attr( ++ all(target_os = "macos", not(target_arch = "aarch64")), ++ link_name = "readdir_r$INODE64" ++ )] ++ #[cfg_attr(target_os = "netbsd", link_name = "__readdir_r30")] ++ #[cfg_attr( ++ all(target_os = "freebsd", any(freebsd11, freebsd10)), ++ link_name = "readdir_r@FBSD_1.0" ++ )] ++ #[allow(non_autolinks)] // FIXME: `<>` breaks line length limit. ++ /// The 64-bit libc on Solaris and illumos only has readdir_r. If a ++ /// 32-bit Solaris or illumos target is ever created, it should use ++ /// __posix_readdir_r. See libc(3LIB) on Solaris or illumos: ++ /// https://illumos.org/man/3lib/libc ++ /// https://docs.oracle.com/cd/E36784_01/html/E36873/libc-3lib.html ++ /// https://www.unix.com/man-page/opensolaris/3LIB/libc/ ++ #[cfg_attr(gnu_time64_abi, link_name = "readdir64_r")] ++ pub fn readdir_r( ++ dirp: *mut crate::DIR, ++ entry: *mut crate::dirent, ++ result: *mut *mut crate::dirent, ++ ) -> c_int; ++ } ++ } ++} ++ ++cfg_if! { ++ if #[cfg(target_os = "nto")] { ++ extern "C" { ++ pub fn readlinkat( ++ dirfd: c_int, ++ pathname: *const c_char, ++ buf: *mut c_char, ++ bufsiz: size_t, ++ ) -> c_int; ++ pub fn readlink(path: *const c_char, buf: *mut c_char, bufsz: size_t) -> c_int; ++ pub fn pselect( ++ nfds: c_int, ++ readfds: *mut fd_set, ++ writefds: *mut fd_set, ++ errorfds: *mut fd_set, ++ timeout: *mut timespec, ++ sigmask: *const sigset_t, ++ ) -> c_int; ++ pub fn sigaction(signum: c_int, act: *const sigaction, oldact: *mut sigaction) ++ -> c_int; ++ } ++ } else { ++ extern "C" { ++ pub fn readlinkat( ++ dirfd: c_int, ++ pathname: *const c_char, ++ buf: *mut c_char, ++ bufsiz: size_t, ++ ) -> ssize_t; ++ pub fn fmemopen(buf: *mut c_void, size: size_t, mode: *const c_char) -> *mut FILE; ++ pub fn open_memstream(ptr: *mut *mut c_char, sizeloc: *mut size_t) -> *mut FILE; ++ pub fn atexit(cb: extern "C" fn()) -> c_int; ++ #[cfg_attr(target_os = "netbsd", link_name = "__sigaction14")] ++ pub fn sigaction(signum: c_int, act: *const sigaction, oldact: *mut sigaction) ++ -> c_int; ++ pub fn readlink(path: *const c_char, buf: *mut c_char, bufsz: size_t) -> ssize_t; ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86_64"), ++ link_name = "pselect$1050" ++ )] ++ #[cfg_attr( ++ all(target_os = "macos", target_arch = "x86"), ++ link_name = "pselect$UNIX2003" ++ )] ++ #[cfg_attr(target_os = "netbsd", link_name = "__pselect50")] ++ #[cfg_attr(gnu_time64_abi, link_name = "__pselect64")] ++ pub fn pselect( ++ nfds: c_int, ++ readfds: *mut fd_set, ++ writefds: *mut fd_set, ++ errorfds: *mut fd_set, ++ timeout: *const timespec, ++ sigmask: *const sigset_t, ++ ) -> c_int; ++ } ++ } ++} ++ ++cfg_if! { ++ if #[cfg(not(any( ++ target_os = "solaris", ++ target_os = "illumos", ++ target_os = "nto", ++ )))] { ++ extern "C" { ++ pub fn cfmakeraw(termios: *mut crate::termios); ++ pub fn cfsetspeed(termios: *mut crate::termios, speed: crate::speed_t) -> c_int; ++ } ++ } ++} ++ ++extern "C" { ++ pub fn fnmatch(pattern: *const c_char, name: *const c_char, flags: c_int) -> c_int; ++} ++ ++cfg_if! { ++ if #[cfg(target_env = "newlib")] { ++ mod newlib; ++ pub use self::newlib::*; ++ } else if #[cfg(any( ++ target_os = "linux", ++ target_os = "l4re", ++ target_os = "android", ++ target_os = "emscripten" ++ ))] { ++ mod linux_like; ++ pub use self::linux_like::*; ++ } else if #[cfg(any( ++ target_os = "macos", ++ target_os = "ios", ++ target_os = "tvos", ++ target_os = "watchos", ++ target_os = "visionos", ++ target_os = "freebsd", ++ target_os = "dragonfly", ++ target_os = "openbsd", ++ target_os = "netbsd" ++ ))] { ++ mod bsd; ++ pub use self::bsd::*; ++ } else if #[cfg(any(target_os = "solaris", target_os = "illumos"))] { ++ mod solarish; ++ pub use self::solarish::*; ++ } else if #[cfg(target_os = "haiku")] { ++ mod haiku; ++ pub use self::haiku::*; ++ } else if #[cfg(target_os = "redox")] { ++ mod redox; ++ pub use self::redox::*; ++ } else if #[cfg(target_os = "nto")] { ++ mod nto; ++ pub use self::nto::*; ++ } else if #[cfg(target_os = "aix")] { ++ mod aix; ++ pub use self::aix::*; ++ } else if #[cfg(target_os = "hurd")] { ++ mod hurd; ++ pub use self::hurd::*; ++ } else if #[cfg(target_os = "nuttx")] { ++ mod nuttx; ++ pub use self::nuttx::*; ++ } else { ++ // Unknown target_os ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/newlib/aarch64/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/newlib/aarch64/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/newlib/aarch64/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/newlib/aarch64/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,56 @@ ++use crate::prelude::*; ++ ++pub type clock_t = c_long; ++pub type c_char = u8; ++pub type wchar_t = u32; ++ ++pub type c_long = i64; ++pub type c_ulong = u64; ++ ++s! { ++ pub struct sockaddr { ++ pub sa_len: u8, ++ pub sa_family: crate::sa_family_t, ++ pub sa_data: [c_char; 14], ++ } ++ ++ pub struct sockaddr_in6 { ++ pub sin6_len: u8, ++ pub sin6_family: crate::sa_family_t, ++ pub sin6_port: crate::in_port_t, ++ pub sin6_flowinfo: u32, ++ pub sin6_addr: crate::in6_addr, ++ pub sin6_scope_id: u32, ++ } ++ ++ pub struct sockaddr_in { ++ pub sin_len: u8, ++ pub sin_family: crate::sa_family_t, ++ pub sin_port: crate::in_port_t, ++ pub sin_addr: crate::in_addr, ++ pub sin_zero: [c_char; 8], ++ } ++} ++ ++pub const AF_INET6: c_int = 23; ++ ++pub const FIONBIO: c_ulong = 1; ++ ++pub const POLLIN: c_short = 0x1; ++pub const POLLPRI: c_short = 0x2; ++pub const POLLOUT: c_short = 0x4; ++pub const POLLERR: c_short = 0x8; ++pub const POLLHUP: c_short = 0x10; ++pub const POLLNVAL: c_short = 0x20; ++ ++pub const SOL_SOCKET: c_int = 65535; ++ ++pub const MSG_OOB: c_int = 1; ++pub const MSG_PEEK: c_int = 2; ++pub const MSG_DONTWAIT: c_int = 4; ++pub const MSG_DONTROUTE: c_int = 0; ++pub const MSG_WAITALL: c_int = 0; ++pub const MSG_MORE: c_int = 0; ++pub const MSG_NOSIGNAL: c_int = 0; ++ ++pub use crate::unix::newlib::generic::{dirent, sigset_t, stat}; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/newlib/arm/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/newlib/arm/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/newlib/arm/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/newlib/arm/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,58 @@ ++use crate::prelude::*; ++ ++pub type clock_t = c_long; ++pub type c_char = u8; ++pub type wchar_t = u32; ++ ++pub type c_long = i32; ++pub type c_ulong = u32; ++ ++s! { ++ pub struct sockaddr { ++ pub sa_family: crate::sa_family_t, ++ pub sa_data: [c_char; 14], ++ } ++ ++ pub struct sockaddr_in6 { ++ pub sin6_family: crate::sa_family_t, ++ pub sin6_port: crate::in_port_t, ++ pub sin6_flowinfo: u32, ++ pub sin6_addr: crate::in6_addr, ++ pub sin6_scope_id: u32, ++ } ++ ++ pub struct sockaddr_in { ++ pub sin_family: crate::sa_family_t, ++ pub sin_port: crate::in_port_t, ++ pub sin_addr: crate::in_addr, ++ pub sin_zero: [u8; 8], ++ } ++ ++ pub struct sockaddr_storage { ++ pub ss_family: crate::sa_family_t, ++ pub __ss_padding: [u8; 26], ++ } ++} ++ ++pub const AF_INET6: c_int = 23; ++ ++pub const FIONBIO: c_ulong = 1; ++ ++pub const POLLIN: c_short = 0x1; ++pub const POLLPRI: c_short = 0x2; ++pub const POLLHUP: c_short = 0x4; ++pub const POLLERR: c_short = 0x8; ++pub const POLLOUT: c_short = 0x10; ++pub const POLLNVAL: c_short = 0x20; ++ ++pub const SOL_SOCKET: c_int = 65535; ++ ++pub const MSG_OOB: c_int = 1; ++pub const MSG_PEEK: c_int = 2; ++pub const MSG_DONTWAIT: c_int = 4; ++pub const MSG_DONTROUTE: c_int = 0; ++pub const MSG_WAITALL: c_int = 0; ++pub const MSG_MORE: c_int = 0; ++pub const MSG_NOSIGNAL: c_int = 0; ++ ++pub use crate::unix::newlib::generic::{dirent, sigset_t, stat}; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/newlib/espidf/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/newlib/espidf/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/newlib/espidf/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/newlib/espidf/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,124 @@ ++use crate::prelude::*; ++ ++pub type clock_t = c_ulong; ++pub type c_char = u8; ++pub type wchar_t = u32; ++ ++pub type c_long = i32; ++pub type c_ulong = u32; ++ ++s! { ++ pub struct cmsghdr { ++ pub cmsg_len: crate::socklen_t, ++ pub cmsg_level: c_int, ++ pub cmsg_type: c_int, ++ } ++ ++ pub struct msghdr { ++ pub msg_name: *mut c_void, ++ pub msg_namelen: crate::socklen_t, ++ pub msg_iov: *mut crate::iovec, ++ pub msg_iovlen: c_int, ++ pub msg_control: *mut c_void, ++ pub msg_controllen: crate::socklen_t, ++ pub msg_flags: c_int, ++ } ++ ++ pub struct sockaddr_un { ++ pub sun_family: crate::sa_family_t, ++ pub sun_path: [c_char; 108], ++ } ++ ++ pub struct sockaddr { ++ pub sa_len: u8, ++ pub sa_family: crate::sa_family_t, ++ pub sa_data: [c_char; 14], ++ } ++ ++ pub struct sockaddr_in6 { ++ pub sin6_len: u8, ++ pub sin6_family: crate::sa_family_t, ++ pub sin6_port: crate::in_port_t, ++ pub sin6_flowinfo: u32, ++ pub sin6_addr: crate::in6_addr, ++ pub sin6_scope_id: u32, ++ } ++ ++ pub struct sockaddr_in { ++ pub sin_len: u8, ++ pub sin_family: crate::sa_family_t, ++ pub sin_port: crate::in_port_t, ++ pub sin_addr: crate::in_addr, ++ pub sin_zero: [c_char; 8], ++ } ++ ++ pub struct sockaddr_storage { ++ pub s2_len: u8, ++ pub ss_family: crate::sa_family_t, ++ pub s2_data1: [c_char; 2], ++ pub s2_data2: [u32; 3], ++ pub s2_data3: [u32; 3], ++ } ++} ++ ++pub const AF_UNIX: c_int = 1; ++pub const AF_INET6: c_int = 10; ++ ++pub const FIONBIO: c_ulong = 2147772030; ++ ++pub const POLLIN: c_short = 1 << 0; ++pub const POLLRDNORM: c_short = 1 << 1; ++pub const POLLRDBAND: c_short = 1 << 2; ++pub const POLLPRI: c_short = POLLRDBAND; ++pub const POLLOUT: c_short = 1 << 3; ++pub const POLLWRNORM: c_short = POLLOUT; ++pub const POLLWRBAND: c_short = 1 << 4; ++pub const POLLERR: c_short = 1 << 5; ++pub const POLLHUP: c_short = 1 << 6; ++ ++pub const SOL_SOCKET: c_int = 0xfff; ++ ++pub const MSG_OOB: c_int = 0x04; ++pub const MSG_PEEK: c_int = 0x01; ++pub const MSG_DONTWAIT: c_int = 0x08; ++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; ++ ++pub const SIGABRT: c_int = 6; ++pub const SIGFPE: c_int = 8; ++pub const SIGILL: c_int = 4; ++pub const SIGINT: c_int = 2; ++pub const SIGSEGV: c_int = 11; ++pub const SIGTERM: c_int = 15; ++pub const SIGHUP: c_int = 1; ++pub const SIGQUIT: c_int = 3; ++pub const NSIG: size_t = 32; ++ ++extern "C" { ++ pub fn pthread_create( ++ native: *mut crate::pthread_t, ++ attr: *const crate::pthread_attr_t, ++ f: extern "C" fn(_: *mut c_void) -> *mut c_void, ++ value: *mut c_void, ++ ) -> c_int; ++ ++ pub fn getrandom(buf: *mut c_void, buflen: size_t, flags: c_uint) -> ssize_t; ++ ++ pub fn gethostname(name: *mut c_char, namelen: ssize_t); ++ ++ #[link_name = "lwip_sendmsg"] ++ pub fn sendmsg(s: c_int, msg: *const crate::msghdr, flags: c_int) -> ssize_t; ++ #[link_name = "lwip_recvmsg"] ++ pub fn recvmsg(s: c_int, msg: *mut crate::msghdr, flags: c_int) -> ssize_t; ++ ++ pub fn eventfd(initval: c_uint, flags: c_int) -> c_int; ++} ++ ++pub use crate::unix::newlib::generic::{dirent, sigset_t, stat}; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/newlib/generic.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/newlib/generic.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/newlib/generic.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/newlib/generic.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,39 @@ ++//! Common types used by most newlib platforms ++ ++use crate::off_t; ++use crate::prelude::*; ++ ++s! { ++ pub struct sigset_t { ++ #[cfg(target_os = "horizon")] ++ __val: [c_ulong; 16], ++ #[cfg(not(target_os = "horizon"))] ++ __val: u32, ++ } ++ ++ pub struct stat { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ pub st_size: off_t, ++ pub st_atime: crate::time_t, ++ pub st_spare1: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_spare2: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_spare3: c_long, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_spare4: [c_long; 2usize], ++ } ++ ++ pub struct dirent { ++ pub d_ino: crate::ino_t, ++ pub d_type: c_uchar, ++ pub d_name: [c_char; 256usize], ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/newlib/horizon/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/newlib/horizon/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/newlib/horizon/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/newlib/horizon/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,282 @@ ++//! ARMv6K Nintendo 3DS C Newlib definitions ++ ++use crate::off_t; ++use crate::prelude::*; ++ ++pub type c_char = u8; ++pub type c_long = i32; ++pub type c_ulong = u32; ++ ++pub type wchar_t = c_uint; ++ ++pub type u_register_t = c_uint; ++pub type u_char = c_uchar; ++pub type u_short = c_ushort; ++pub type u_int = c_uint; ++pub type u_long = c_ulong; ++pub type ushort = c_ushort; ++pub type uint = c_uint; ++pub type ulong = c_ulong; ++pub type clock_t = c_ulong; ++pub type daddr_t = c_long; ++pub type caddr_t = *mut c_char; ++pub type sbintime_t = c_longlong; ++pub type sigset_t = c_ulong; ++ ++s! { ++ pub struct hostent { ++ pub h_name: *mut c_char, ++ pub h_aliases: *mut *mut c_char, ++ pub h_addrtype: u16, ++ pub h_length: u16, ++ pub h_addr_list: *mut *mut c_char, ++ } ++ ++ pub struct sockaddr { ++ pub sa_family: crate::sa_family_t, ++ pub sa_data: [c_char; 26usize], ++ } ++ ++ pub struct sockaddr_storage { ++ pub ss_family: crate::sa_family_t, ++ pub __ss_padding: [c_char; 26usize], ++ } ++ ++ pub struct sockaddr_in { ++ pub sin_family: crate::sa_family_t, ++ pub sin_port: crate::in_port_t, ++ pub sin_addr: crate::in_addr, ++ pub sin_zero: [c_char; 8], ++ } ++ ++ pub struct sockaddr_in6 { ++ pub sin6_family: crate::sa_family_t, ++ pub sin6_port: crate::in_port_t, ++ pub sin6_flowinfo: u32, ++ pub sin6_addr: crate::in6_addr, ++ pub sin6_scope_id: u32, ++ } ++ ++ pub struct sockaddr_un { ++ pub sun_len: c_uchar, ++ pub sun_family: crate::sa_family_t, ++ pub sun_path: [c_char; 104usize], ++ } ++ ++ pub struct sched_param { ++ pub sched_priority: c_int, ++ } ++ ++ pub struct stat { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ pub st_size: off_t, ++ pub st_atim: crate::timespec, ++ pub st_mtim: crate::timespec, ++ pub st_ctim: crate::timespec, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_spare4: [c_long; 2usize], ++ } ++} ++ ++pub const SIGEV_NONE: c_int = 1; ++pub const SIGEV_SIGNAL: c_int = 2; ++pub const SIGEV_THREAD: c_int = 3; ++pub const SA_NOCLDSTOP: c_int = 1; ++pub const MINSIGSTKSZ: c_int = 2048; ++pub const SIGSTKSZ: c_int = 8192; ++pub const SS_ONSTACK: c_int = 1; ++pub const SS_DISABLE: c_int = 2; ++pub const SIG_SETMASK: c_int = 0; ++pub const SIG_BLOCK: c_int = 1; ++pub const SIG_UNBLOCK: c_int = 2; ++pub const SIGHUP: c_int = 1; ++pub const SIGINT: c_int = 2; ++pub const SIGQUIT: c_int = 3; ++pub const SIGILL: c_int = 4; ++pub const SIGTRAP: c_int = 5; ++pub const SIGABRT: c_int = 6; ++pub const SIGEMT: c_int = 7; ++pub const SIGFPE: c_int = 8; ++pub const SIGKILL: c_int = 9; ++pub const SIGBUS: c_int = 10; ++pub const SIGSEGV: c_int = 11; ++pub const SIGSYS: c_int = 12; ++pub const SIGPIPE: c_int = 13; ++pub const SIGALRM: c_int = 14; ++pub const SIGTERM: c_int = 15; ++pub const SIGURG: c_int = 16; ++pub const SIGSTOP: c_int = 17; ++pub const SIGTSTP: c_int = 18; ++pub const SIGCONT: c_int = 19; ++pub const SIGCHLD: c_int = 20; ++pub const SIGCLD: c_int = 20; ++pub const SIGTTIN: c_int = 21; ++pub const SIGTTOU: c_int = 22; ++pub const SIGIO: c_int = 23; ++pub const SIGPOLL: c_int = 23; ++pub const SIGXCPU: c_int = 24; ++pub const SIGXFSZ: c_int = 25; ++pub const SIGVTALRM: c_int = 26; ++pub const SIGPROF: c_int = 27; ++pub const SIGWINCH: c_int = 28; ++pub const SIGLOST: c_int = 29; ++pub const SIGUSR1: c_int = 30; ++pub const SIGUSR2: c_int = 31; ++pub const NSIG: c_int = 32; ++pub const CLOCK_ENABLED: c_uint = 1; ++pub const CLOCK_DISABLED: c_uint = 0; ++pub const CLOCK_ALLOWED: c_uint = 1; ++pub const CLOCK_DISALLOWED: c_uint = 0; ++pub const TIMER_ABSTIME: c_uint = 4; ++pub const SOL_SOCKET: c_int = 65535; ++pub const MSG_OOB: c_int = 1; ++pub const MSG_PEEK: c_int = 2; ++pub const MSG_DONTWAIT: c_int = 4; ++pub const MSG_DONTROUTE: c_int = 0; ++pub const MSG_WAITALL: c_int = 0; ++pub const MSG_MORE: c_int = 0; ++pub const MSG_NOSIGNAL: c_int = 0; ++pub const SOL_CONFIG: c_uint = 65534; ++ ++pub const _SC_PAGESIZE: c_int = 8; ++pub const _SC_GETPW_R_SIZE_MAX: c_int = 51; ++ ++pub const PTHREAD_STACK_MIN: size_t = 4096; ++pub const WNOHANG: c_int = 1; ++ ++pub const POLLIN: c_short = 0x0001; ++pub const POLLPRI: c_short = 0x0002; ++pub const POLLOUT: c_short = 0x0004; ++pub const POLLRDNORM: c_short = 0x0040; ++pub const POLLWRNORM: c_short = POLLOUT; ++pub const POLLRDBAND: c_short = 0x0080; ++pub const POLLWRBAND: c_short = 0x0100; ++pub const POLLERR: c_short = 0x0008; ++pub const POLLHUP: c_short = 0x0010; ++pub const POLLNVAL: c_short = 0x0020; ++ ++pub const EAI_AGAIN: c_int = 2; ++pub const EAI_BADFLAGS: c_int = 3; ++pub const EAI_FAIL: c_int = 4; ++pub const EAI_SERVICE: c_int = 9; ++pub const EAI_SYSTEM: c_int = 11; ++pub const EAI_BADHINTS: c_int = 12; ++pub const EAI_PROTOCOL: c_int = 13; ++pub const EAI_OVERFLOW: c_int = 14; ++pub const EAI_MAX: c_int = 15; ++ ++pub const AF_UNIX: c_int = 1; ++pub const AF_INET6: c_int = 23; ++ ++pub const FIONBIO: c_ulong = 1; ++ ++pub const RTLD_DEFAULT: *mut c_void = 0 as *mut c_void; ++ ++// For pthread get/setschedparam ++pub const SCHED_FIFO: c_int = 1; ++pub const SCHED_RR: c_int = 2; ++ ++// For getrandom() ++pub const GRND_NONBLOCK: c_uint = 0x1; ++pub const GRND_RANDOM: c_uint = 0x2; ++ ++// Horizon OS works doesn't or can't hold any of this information ++safe_f! { ++ pub {const} fn WIFSTOPPED(_status: c_int) -> bool { ++ false ++ } ++ ++ pub {const} fn WSTOPSIG(_status: c_int) -> c_int { ++ 0 ++ } ++ ++ pub {const} fn WIFCONTINUED(_status: c_int) -> bool { ++ true ++ } ++ ++ pub {const} fn WIFSIGNALED(_status: c_int) -> bool { ++ false ++ } ++ ++ pub {const} fn WTERMSIG(_status: c_int) -> c_int { ++ 0 ++ } ++ ++ pub {const} fn WIFEXITED(_status: c_int) -> bool { ++ true ++ } ++ ++ pub {const} fn WEXITSTATUS(_status: c_int) -> c_int { ++ 0 ++ } ++ ++ pub {const} fn WCOREDUMP(_status: c_int) -> bool { ++ false ++ } ++} ++ ++extern "C" { ++ pub fn pthread_create( ++ native: *mut crate::pthread_t, ++ attr: *const crate::pthread_attr_t, ++ f: extern "C" fn(_: *mut c_void) -> *mut c_void, ++ value: *mut c_void, ++ ) -> c_int; ++ ++ pub fn pthread_attr_getschedparam( ++ attr: *const crate::pthread_attr_t, ++ param: *mut sched_param, ++ ) -> c_int; ++ ++ pub fn pthread_attr_setschedparam( ++ attr: *mut crate::pthread_attr_t, ++ param: *const sched_param, ++ ) -> c_int; ++ ++ pub fn pthread_attr_getprocessorid_np( ++ attr: *const crate::pthread_attr_t, ++ processor_id: *mut c_int, ++ ) -> c_int; ++ ++ pub fn pthread_attr_setprocessorid_np( ++ attr: *mut crate::pthread_attr_t, ++ processor_id: c_int, ++ ) -> c_int; ++ ++ pub fn pthread_getschedparam( ++ native: crate::pthread_t, ++ policy: *mut c_int, ++ param: *mut crate::sched_param, ++ ) -> c_int; ++ ++ pub fn pthread_setschedparam( ++ native: crate::pthread_t, ++ policy: c_int, ++ param: *const crate::sched_param, ++ ) -> c_int; ++ ++ pub fn pthread_condattr_getclock( ++ attr: *const crate::pthread_condattr_t, ++ clock_id: *mut crate::clockid_t, ++ ) -> c_int; ++ ++ pub fn pthread_condattr_setclock( ++ attr: *mut crate::pthread_condattr_t, ++ clock_id: crate::clockid_t, ++ ) -> c_int; ++ ++ pub fn pthread_getprocessorid_np() -> c_int; ++ ++ pub fn getrandom(buf: *mut c_void, buflen: size_t, flags: c_uint) -> ssize_t; ++ ++ pub fn gethostid() -> c_long; ++} ++ ++pub use crate::unix::newlib::generic::dirent; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/newlib/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/newlib/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/newlib/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/newlib/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,997 @@ ++use crate::prelude::*; ++ ++pub type blkcnt_t = i32; ++pub type blksize_t = i32; ++ ++pub type clockid_t = c_ulong; ++ ++cfg_if! { ++ if #[cfg(any(target_os = "espidf"))] { ++ pub type dev_t = c_short; ++ pub type ino_t = c_ushort; ++ pub type off_t = c_long; ++ } else if #[cfg(any(target_os = "vita"))] { ++ pub type dev_t = c_short; ++ pub type ino_t = c_ushort; ++ pub type off_t = c_int; ++ } else { ++ pub type dev_t = u32; ++ pub type ino_t = u32; ++ pub type off_t = i64; ++ } ++} ++ ++pub type fsblkcnt_t = u64; ++pub type fsfilcnt_t = u32; ++pub type id_t = u32; ++pub type key_t = c_int; ++pub type loff_t = c_longlong; ++pub type mode_t = c_uint; ++pub type nfds_t = u32; ++pub type nlink_t = c_ushort; ++pub type pthread_t = c_ulong; ++pub type pthread_key_t = c_uint; ++pub type rlim_t = u32; ++ ++cfg_if! { ++ if #[cfg(target_os = "horizon")] { ++ pub type sa_family_t = u16; ++ } else { ++ pub type sa_family_t = u8; ++ } ++} ++ ++pub type socklen_t = u32; ++pub type speed_t = u32; ++pub type suseconds_t = i32; ++cfg_if! { ++ if #[cfg(target_os = "espidf")] { ++ pub type tcflag_t = u16; ++ } else { ++ pub type tcflag_t = c_uint; ++ } ++} ++pub type useconds_t = u32; ++ ++cfg_if! { ++ if #[cfg(any( ++ target_os = "horizon", ++ all(target_os = "espidf", not(espidf_time32)) ++ ))] { ++ pub type time_t = c_longlong; ++ } else { ++ pub type time_t = i32; ++ } ++} ++ ++cfg_if! { ++ if #[cfg(not(target_os = "horizon"))] { ++ s! { ++ pub struct hostent { ++ pub h_name: *mut c_char, ++ pub h_aliases: *mut *mut c_char, ++ pub h_addrtype: c_int, ++ pub h_length: c_int, ++ pub h_addr_list: *mut *mut c_char, ++ pub h_addr: *mut c_char, ++ } ++ } ++ } ++} ++ ++s! { ++ // The order of the `ai_addr` field in this struct is crucial ++ // for converting between the Rust and C types. ++ pub struct addrinfo { ++ pub ai_flags: c_int, ++ pub ai_family: c_int, ++ pub ai_socktype: c_int, ++ pub ai_protocol: c_int, ++ pub ai_addrlen: socklen_t, ++ ++ #[cfg(target_os = "espidf")] ++ pub ai_addr: *mut sockaddr, ++ ++ pub ai_canonname: *mut c_char, ++ ++ #[cfg(not(any( ++ target_os = "espidf", ++ all(target_arch = "powerpc", target_vendor = "nintendo") ++ )))] ++ pub ai_addr: *mut sockaddr, ++ ++ pub ai_next: *mut addrinfo, ++ } ++ ++ pub struct ip_mreq { ++ pub imr_multiaddr: in_addr, ++ pub imr_interface: in_addr, ++ } ++ ++ pub struct linger { ++ pub l_onoff: c_int, ++ pub l_linger: c_int, ++ } ++ ++ pub struct in_addr { ++ pub s_addr: crate::in_addr_t, ++ } ++ ++ pub struct pollfd { ++ pub fd: c_int, ++ pub events: c_int, ++ pub revents: c_int, ++ } ++ ++ pub struct lconv { ++ pub decimal_point: *mut c_char, ++ pub thousands_sep: *mut c_char, ++ pub grouping: *mut c_char, ++ pub int_curr_symbol: *mut c_char, ++ pub currency_symbol: *mut c_char, ++ pub mon_decimal_point: *mut c_char, ++ pub mon_thousands_sep: *mut c_char, ++ pub mon_grouping: *mut c_char, ++ pub positive_sign: *mut c_char, ++ pub negative_sign: *mut c_char, ++ pub int_frac_digits: c_char, ++ pub frac_digits: c_char, ++ pub p_cs_precedes: c_char, ++ pub p_sep_by_space: c_char, ++ pub n_cs_precedes: c_char, ++ pub n_sep_by_space: c_char, ++ pub p_sign_posn: c_char, ++ pub n_sign_posn: c_char, ++ pub int_n_cs_precedes: c_char, ++ pub int_n_sep_by_space: c_char, ++ pub int_n_sign_posn: c_char, ++ pub int_p_cs_precedes: c_char, ++ pub int_p_sep_by_space: c_char, ++ pub int_p_sign_posn: c_char, ++ } ++ ++ pub struct tm { ++ pub tm_sec: c_int, ++ pub tm_min: c_int, ++ pub tm_hour: c_int, ++ pub tm_mday: c_int, ++ pub tm_mon: c_int, ++ pub tm_year: c_int, ++ pub tm_wday: c_int, ++ pub tm_yday: c_int, ++ pub tm_isdst: c_int, ++ } ++ ++ pub struct statvfs { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: fsblkcnt_t, ++ pub f_bfree: fsblkcnt_t, ++ pub f_bavail: fsblkcnt_t, ++ pub f_files: fsfilcnt_t, ++ pub f_ffree: fsfilcnt_t, ++ pub f_favail: fsfilcnt_t, ++ pub f_fsid: c_ulong, ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ } ++ ++ pub struct sigaction { ++ pub sa_handler: extern "C" fn(arg1: c_int), ++ pub sa_mask: sigset_t, ++ pub sa_flags: c_int, ++ } ++ ++ pub struct stack_t { ++ pub ss_sp: *mut c_void, ++ pub ss_flags: c_int, ++ pub ss_size: usize, ++ } ++ ++ pub struct fd_set { ++ // Unverified ++ fds_bits: [c_ulong; FD_SETSIZE as usize / ULONG_SIZE], ++ } ++ ++ pub struct passwd { ++ // Unverified ++ pub pw_name: *mut c_char, ++ pub pw_passwd: *mut c_char, ++ pub pw_uid: crate::uid_t, ++ pub pw_gid: crate::gid_t, ++ pub pw_gecos: *mut c_char, ++ pub pw_dir: *mut c_char, ++ pub pw_shell: *mut c_char, ++ } ++ ++ pub struct termios { ++ // Unverified ++ pub c_iflag: crate::tcflag_t, ++ pub c_oflag: crate::tcflag_t, ++ pub c_cflag: crate::tcflag_t, ++ pub c_lflag: crate::tcflag_t, ++ pub c_line: crate::cc_t, ++ pub c_cc: [crate::cc_t; crate::NCCS], ++ #[cfg(target_os = "espidf")] ++ pub c_ispeed: u32, ++ #[cfg(target_os = "espidf")] ++ pub c_ospeed: u32, ++ } ++ ++ pub struct sem_t { ++ // Unverified ++ __size: [c_char; 16], ++ } ++ ++ pub struct Dl_info { ++ // Unverified ++ pub dli_fname: *const c_char, ++ pub dli_fbase: *mut c_void, ++ pub dli_sname: *const c_char, ++ pub dli_saddr: *mut c_void, ++ } ++ ++ pub struct utsname { ++ // Unverified ++ pub sysname: [c_char; 65], ++ pub nodename: [c_char; 65], ++ pub release: [c_char; 65], ++ pub version: [c_char; 65], ++ pub machine: [c_char; 65], ++ pub domainname: [c_char; 65], ++ } ++ ++ pub struct cpu_set_t { ++ // Unverified ++ bits: [u32; 32], ++ } ++ ++ pub struct pthread_attr_t { ++ // Unverified ++ #[cfg(not(target_os = "espidf"))] ++ __size: [u8; __SIZEOF_PTHREAD_ATTR_T], ++ #[cfg(target_os = "espidf")] ++ pub is_initialized: i32, ++ #[cfg(target_os = "espidf")] ++ pub stackaddr: *mut c_void, ++ #[cfg(target_os = "espidf")] ++ pub stacksize: i32, ++ #[cfg(target_os = "espidf")] ++ pub contentionscope: i32, ++ #[cfg(target_os = "espidf")] ++ pub inheritsched: i32, ++ #[cfg(target_os = "espidf")] ++ pub schedpolicy: i32, ++ #[cfg(target_os = "espidf")] ++ pub schedparam: i32, ++ #[cfg(target_os = "espidf")] ++ pub detachstate: i32, ++ } ++ ++ pub struct pthread_rwlockattr_t { ++ // Unverified ++ __size: [u8; __SIZEOF_PTHREAD_RWLOCKATTR_T], ++ } ++ ++ #[cfg_attr( ++ all( ++ target_pointer_width = "32", ++ any(target_arch = "mips", target_arch = "arm", target_arch = "powerpc") ++ ), ++ repr(align(4)) ++ )] ++ #[cfg_attr( ++ any( ++ target_pointer_width = "64", ++ not(any(target_arch = "mips", target_arch = "arm", target_arch = "powerpc")) ++ ), ++ repr(align(8)) ++ )] ++ pub struct pthread_mutex_t { ++ // Unverified ++ size: [u8; crate::__SIZEOF_PTHREAD_MUTEX_T], ++ } ++ ++ #[cfg_attr( ++ all( ++ target_pointer_width = "32", ++ any(target_arch = "mips", target_arch = "arm", target_arch = "powerpc") ++ ), ++ repr(align(4)) ++ )] ++ #[cfg_attr( ++ any( ++ target_pointer_width = "64", ++ not(any(target_arch = "mips", target_arch = "arm", target_arch = "powerpc")) ++ ), ++ repr(align(8)) ++ )] ++ pub struct pthread_rwlock_t { ++ // Unverified ++ size: [u8; crate::__SIZEOF_PTHREAD_RWLOCK_T], ++ } ++ ++ #[cfg_attr( ++ any( ++ target_pointer_width = "32", ++ target_arch = "x86_64", ++ target_arch = "powerpc64", ++ target_arch = "mips64", ++ target_arch = "s390x", ++ target_arch = "sparc64" ++ ), ++ repr(align(4)) ++ )] ++ #[cfg_attr( ++ not(any( ++ target_pointer_width = "32", ++ target_arch = "x86_64", ++ target_arch = "powerpc64", ++ target_arch = "mips64", ++ target_arch = "s390x", ++ target_arch = "sparc64" ++ )), ++ repr(align(8)) ++ )] ++ pub struct pthread_mutexattr_t { ++ // Unverified ++ size: [u8; crate::__SIZEOF_PTHREAD_MUTEXATTR_T], ++ } ++ ++ #[repr(align(8))] ++ pub struct pthread_cond_t { ++ // Unverified ++ size: [u8; crate::__SIZEOF_PTHREAD_COND_T], ++ } ++ ++ #[repr(align(4))] ++ pub struct pthread_condattr_t { ++ // Unverified ++ size: [u8; crate::__SIZEOF_PTHREAD_CONDATTR_T], ++ } ++} ++ ++// unverified constants ++pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { ++ size: [__PTHREAD_INITIALIZER_BYTE; __SIZEOF_PTHREAD_MUTEX_T], ++}; ++pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { ++ size: [__PTHREAD_INITIALIZER_BYTE; __SIZEOF_PTHREAD_COND_T], ++}; ++pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { ++ size: [__PTHREAD_INITIALIZER_BYTE; __SIZEOF_PTHREAD_RWLOCK_T], ++}; ++ ++cfg_if! { ++ if #[cfg(target_os = "espidf")] { ++ pub const NCCS: usize = 11; ++ } else { ++ pub const NCCS: usize = 32; ++ } ++} ++ ++cfg_if! { ++ if #[cfg(target_os = "espidf")] { ++ const __PTHREAD_INITIALIZER_BYTE: u8 = 0xff; ++ pub const __SIZEOF_PTHREAD_ATTR_T: usize = 32; ++ pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 4; ++ pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 12; ++ pub const __SIZEOF_PTHREAD_COND_T: usize = 4; ++ pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 8; ++ pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 4; ++ pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 12; ++ pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32; ++ } else if #[cfg(target_os = "vita")] { ++ const __PTHREAD_INITIALIZER_BYTE: u8 = 0xff; ++ pub const __SIZEOF_PTHREAD_ATTR_T: usize = 4; ++ pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 4; ++ pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; ++ pub const __SIZEOF_PTHREAD_COND_T: usize = 4; ++ pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; ++ pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 4; ++ pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 4; ++ pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 4; ++ } else if #[cfg(target_os = "rtems")] { ++ const __PTHREAD_INITIALIZER_BYTE: u8 = 0x00; ++ pub const __SIZEOF_PTHREAD_ATTR_T: usize = 96; ++ pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 64; ++ pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 24; ++ pub const __SIZEOF_PTHREAD_COND_T: usize = 28; ++ pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 24; ++ pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 32; ++ pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8; ++ pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32; ++ } else { ++ const __PTHREAD_INITIALIZER_BYTE: u8 = 0; ++ pub const __SIZEOF_PTHREAD_ATTR_T: usize = 56; ++ pub const __SIZEOF_PTHREAD_MUTEX_T: usize = 40; ++ pub const __SIZEOF_PTHREAD_MUTEXATTR_T: usize = 4; ++ pub const __SIZEOF_PTHREAD_COND_T: usize = 48; ++ pub const __SIZEOF_PTHREAD_CONDATTR_T: usize = 4; ++ pub const __SIZEOF_PTHREAD_RWLOCK_T: usize = 56; ++ pub const __SIZEOF_PTHREAD_RWLOCKATTR_T: usize = 8; ++ pub const __SIZEOF_PTHREAD_BARRIER_T: usize = 32; ++ } ++} ++ ++pub const __SIZEOF_PTHREAD_BARRIERATTR_T: usize = 4; ++pub const __PTHREAD_MUTEX_HAVE_PREV: usize = 1; ++pub const __PTHREAD_RWLOCK_INT_FLAGS_SHARED: usize = 1; ++pub const PTHREAD_MUTEX_NORMAL: c_int = 0; ++pub const PTHREAD_MUTEX_RECURSIVE: c_int = 1; ++pub const PTHREAD_MUTEX_ERRORCHECK: c_int = 2; ++ ++cfg_if! { ++ if #[cfg(any(target_os = "horizon", target_os = "espidf"))] { ++ pub const FD_SETSIZE: usize = 64; ++ } else if #[cfg(target_os = "vita")] { ++ pub const FD_SETSIZE: usize = 256; ++ } else { ++ pub const FD_SETSIZE: usize = 1024; ++ } ++} ++// intentionally not public, only used for fd_set ++const ULONG_SIZE: usize = 32; ++ ++// Other constants ++pub const EPERM: c_int = 1; ++pub const ENOENT: c_int = 2; ++pub const ESRCH: c_int = 3; ++pub const EINTR: c_int = 4; ++pub const EIO: c_int = 5; ++pub const ENXIO: c_int = 6; ++pub const E2BIG: c_int = 7; ++pub const ENOEXEC: c_int = 8; ++pub const EBADF: c_int = 9; ++pub const ECHILD: c_int = 10; ++pub const EAGAIN: c_int = 11; ++pub const ENOMEM: c_int = 12; ++pub const EACCES: c_int = 13; ++pub const EFAULT: c_int = 14; ++pub const EBUSY: c_int = 16; ++pub const EEXIST: c_int = 17; ++pub const EXDEV: c_int = 18; ++pub const ENODEV: c_int = 19; ++pub const ENOTDIR: c_int = 20; ++pub const EISDIR: c_int = 21; ++pub const EINVAL: c_int = 22; ++pub const ENFILE: c_int = 23; ++pub const EMFILE: c_int = 24; ++pub const ENOTTY: c_int = 25; ++pub const ETXTBSY: c_int = 26; ++pub const EFBIG: c_int = 27; ++pub const ENOSPC: c_int = 28; ++pub const ESPIPE: c_int = 29; ++pub const EROFS: c_int = 30; ++pub const EMLINK: c_int = 31; ++pub const EPIPE: c_int = 32; ++pub const EDOM: c_int = 33; ++pub const ERANGE: c_int = 34; ++pub const ENOMSG: c_int = 35; ++pub const EIDRM: c_int = 36; ++pub const EDEADLK: c_int = 45; ++pub const ENOLCK: c_int = 46; ++pub const ENOSTR: c_int = 60; ++pub const ENODATA: c_int = 61; ++pub const ETIME: c_int = 62; ++pub const ENOSR: c_int = 63; ++pub const ENOLINK: c_int = 67; ++pub const EPROTO: c_int = 71; ++pub const EMULTIHOP: c_int = 74; ++pub const EBADMSG: c_int = 77; ++pub const EFTYPE: c_int = 79; ++pub const ENOSYS: c_int = 88; ++pub const ENOTEMPTY: c_int = 90; ++pub const ENAMETOOLONG: c_int = 91; ++pub const ELOOP: c_int = 92; ++pub const EOPNOTSUPP: c_int = 95; ++pub const EPFNOSUPPORT: c_int = 96; ++pub const ECONNRESET: c_int = 104; ++pub const ENOBUFS: c_int = 105; ++pub const EAFNOSUPPORT: c_int = 106; ++pub const EPROTOTYPE: c_int = 107; ++pub const ENOTSOCK: c_int = 108; ++pub const ENOPROTOOPT: c_int = 109; ++pub const ECONNREFUSED: c_int = 111; ++pub const EADDRINUSE: c_int = 112; ++pub const ECONNABORTED: c_int = 113; ++pub const ENETUNREACH: c_int = 114; ++pub const ENETDOWN: c_int = 115; ++pub const ETIMEDOUT: c_int = 116; ++pub const EHOSTDOWN: c_int = 117; ++pub const EHOSTUNREACH: c_int = 118; ++pub const EINPROGRESS: c_int = 119; ++pub const EALREADY: c_int = 120; ++pub const EDESTADDRREQ: c_int = 121; ++pub const EMSGSIZE: c_int = 122; ++pub const EPROTONOSUPPORT: c_int = 123; ++pub const EADDRNOTAVAIL: c_int = 125; ++pub const ENETRESET: c_int = 126; ++pub const EISCONN: c_int = 127; ++pub const ENOTCONN: c_int = 128; ++pub const ETOOMANYREFS: c_int = 129; ++pub const EDQUOT: c_int = 132; ++pub const ESTALE: c_int = 133; ++pub const ENOTSUP: c_int = 134; ++pub const EILSEQ: c_int = 138; ++pub const EOVERFLOW: c_int = 139; ++pub const ECANCELED: c_int = 140; ++pub const ENOTRECOVERABLE: c_int = 141; ++pub const EOWNERDEAD: c_int = 142; ++pub const EWOULDBLOCK: c_int = 11; ++ ++pub const F_DUPFD: c_int = 0; ++pub const F_GETFD: c_int = 1; ++pub const F_SETFD: c_int = 2; ++pub const F_GETFL: c_int = 3; ++pub const F_SETFL: c_int = 4; ++pub const F_GETOWN: c_int = 5; ++pub const F_SETOWN: c_int = 6; ++pub const F_GETLK: c_int = 7; ++pub const F_SETLK: c_int = 8; ++pub const F_SETLKW: c_int = 9; ++pub const F_RGETLK: c_int = 10; ++pub const F_RSETLK: c_int = 11; ++pub const F_CNVT: c_int = 12; ++pub const F_RSETLKW: c_int = 13; ++pub const F_DUPFD_CLOEXEC: c_int = 14; ++ ++pub const O_RDONLY: c_int = 0; ++pub const O_WRONLY: c_int = 1; ++pub const O_RDWR: c_int = 2; ++pub const O_APPEND: c_int = 8; ++pub const O_CREAT: c_int = 512; ++pub const O_TRUNC: c_int = 1024; ++pub const O_EXCL: c_int = 2048; ++pub const O_SYNC: c_int = 8192; ++pub const O_NONBLOCK: c_int = 16384; ++ ++pub const O_ACCMODE: c_int = 3; ++cfg_if! { ++ if #[cfg(target_os = "espidf")] { ++ pub const O_CLOEXEC: c_int = 0x40000; ++ } else { ++ pub const O_CLOEXEC: c_int = 0x80000; ++ } ++} ++ ++pub const RTLD_LAZY: c_int = 0x1; ++ ++pub const STDIN_FILENO: c_int = 0; ++pub const STDOUT_FILENO: c_int = 1; ++pub const STDERR_FILENO: c_int = 2; ++ ++pub const SEEK_SET: c_int = 0; ++pub const SEEK_CUR: c_int = 1; ++pub const SEEK_END: c_int = 2; ++ ++pub const FIOCLEX: c_ulong = 0x20006601; ++pub const FIONCLEX: c_ulong = 0x20006602; ++ ++pub const S_BLKSIZE: crate::mode_t = 1024; ++pub const S_IREAD: crate::mode_t = 0o0400; ++pub const S_IWRITE: crate::mode_t = 0o0200; ++pub const S_IEXEC: crate::mode_t = 0o0100; ++pub const S_ENFMT: crate::mode_t = 0o2000; ++pub const S_IFMT: crate::mode_t = 0o17_0000; ++pub const S_IFDIR: crate::mode_t = 0o4_0000; ++pub const S_IFCHR: crate::mode_t = 0o2_0000; ++pub const S_IFBLK: crate::mode_t = 0o6_0000; ++pub const S_IFREG: crate::mode_t = 0o10_0000; ++pub const S_IFLNK: crate::mode_t = 0o12_0000; ++pub const S_IFSOCK: crate::mode_t = 0o14_0000; ++pub const S_IFIFO: crate::mode_t = 0o1_0000; ++pub const S_IRUSR: crate::mode_t = 0o0400; ++pub const S_IWUSR: crate::mode_t = 0o0200; ++pub const S_IXUSR: crate::mode_t = 0o0100; ++pub const S_IRGRP: crate::mode_t = 0o0040; ++pub const S_IWGRP: crate::mode_t = 0o0020; ++pub const S_IXGRP: crate::mode_t = 0o0010; ++pub const S_IROTH: crate::mode_t = 0o0004; ++pub const S_IWOTH: crate::mode_t = 0o0002; ++pub const S_IXOTH: crate::mode_t = 0o0001; ++ ++pub const SOL_TCP: c_int = 6; ++ ++pub const PF_UNSPEC: c_int = 0; ++pub const PF_INET: c_int = 2; ++cfg_if! { ++ if #[cfg(target_os = "espidf")] { ++ pub const PF_INET6: c_int = 10; ++ } else { ++ pub const PF_INET6: c_int = 23; ++ } ++} ++ ++pub const AF_UNSPEC: c_int = 0; ++pub const AF_INET: c_int = 2; ++ ++pub const CLOCK_REALTIME: crate::clockid_t = 1; ++pub const CLOCK_MONOTONIC: crate::clockid_t = 4; ++pub const CLOCK_BOOTTIME: crate::clockid_t = 4; ++ ++pub const SOCK_STREAM: c_int = 1; ++pub const SOCK_DGRAM: c_int = 2; ++ ++pub const SHUT_RD: c_int = 0; ++pub const SHUT_WR: c_int = 1; ++pub const SHUT_RDWR: c_int = 2; ++ ++pub const SO_BINTIME: c_int = 0x2000; ++pub const SO_NO_OFFLOAD: c_int = 0x4000; ++pub const SO_NO_DDP: c_int = 0x8000; ++pub const SO_REUSEPORT_LB: c_int = 0x10000; ++pub const SO_LABEL: c_int = 0x1009; ++pub const SO_PEERLABEL: c_int = 0x1010; ++pub const SO_LISTENQLIMIT: c_int = 0x1011; ++pub const SO_LISTENQLEN: c_int = 0x1012; ++pub const SO_LISTENINCQLEN: c_int = 0x1013; ++pub const SO_SETFIB: c_int = 0x1014; ++pub const SO_USER_COOKIE: c_int = 0x1015; ++pub const SO_PROTOCOL: c_int = 0x1016; ++pub const SO_PROTOTYPE: c_int = SO_PROTOCOL; ++pub const SO_VENDOR: c_int = 0x80000000; ++pub const SO_DEBUG: c_int = 0x01; ++pub const SO_ACCEPTCONN: c_int = 0x0002; ++pub const SO_REUSEADDR: c_int = 0x0004; ++pub const SO_KEEPALIVE: c_int = 0x0008; ++pub const SO_DONTROUTE: c_int = 0x0010; ++pub const SO_BROADCAST: c_int = 0x0020; ++pub const SO_USELOOPBACK: c_int = 0x0040; ++pub const SO_LINGER: c_int = 0x0080; ++pub const SO_OOBINLINE: c_int = 0x0100; ++pub const SO_REUSEPORT: c_int = 0x0200; ++pub const SO_TIMESTAMP: c_int = 0x0400; ++pub const SO_NOSIGPIPE: c_int = 0x0800; ++pub const SO_ACCEPTFILTER: c_int = 0x1000; ++pub const SO_SNDBUF: c_int = 0x1001; ++pub const SO_RCVBUF: c_int = 0x1002; ++pub const SO_SNDLOWAT: c_int = 0x1003; ++pub const SO_RCVLOWAT: c_int = 0x1004; ++pub const SO_SNDTIMEO: c_int = 0x1005; ++pub const SO_RCVTIMEO: c_int = 0x1006; ++cfg_if! { ++ if #[cfg(target_os = "horizon")] { ++ pub const SO_ERROR: c_int = 0x1009; ++ } else { ++ pub const SO_ERROR: c_int = 0x1007; ++ } ++} ++pub const SO_TYPE: c_int = 0x1008; ++ ++pub const SOCK_CLOEXEC: c_int = O_CLOEXEC; ++ ++pub const INET_ADDRSTRLEN: c_int = 16; ++ ++// https://github.com/bminor/newlib/blob/HEAD/newlib/libc/sys/linux/include/net/if.h#L121 ++pub const IFF_UP: c_int = 0x1; // interface is up ++pub const IFF_BROADCAST: c_int = 0x2; // broadcast address valid ++pub const IFF_DEBUG: c_int = 0x4; // turn on debugging ++pub const IFF_LOOPBACK: c_int = 0x8; // is a loopback net ++pub const IFF_POINTOPOINT: c_int = 0x10; // interface is point-to-point link ++pub const IFF_NOTRAILERS: c_int = 0x20; // avoid use of trailers ++pub const IFF_RUNNING: c_int = 0x40; // resources allocated ++pub const IFF_NOARP: c_int = 0x80; // no address resolution protocol ++pub const IFF_PROMISC: c_int = 0x100; // receive all packets ++pub const IFF_ALLMULTI: c_int = 0x200; // receive all multicast packets ++pub const IFF_OACTIVE: c_int = 0x400; // transmission in progress ++pub const IFF_SIMPLEX: c_int = 0x800; // can't hear own transmissions ++pub const IFF_LINK0: c_int = 0x1000; // per link layer defined bit ++pub const IFF_LINK1: c_int = 0x2000; // per link layer defined bit ++pub const IFF_LINK2: c_int = 0x4000; // per link layer defined bit ++pub const IFF_ALTPHYS: c_int = IFF_LINK2; // use alternate physical connection ++pub const IFF_MULTICAST: c_int = 0x8000; // supports multicast ++ ++cfg_if! { ++ if #[cfg(target_os = "vita")] { ++ pub const TCP_NODELAY: c_int = 1; ++ pub const TCP_MAXSEG: c_int = 2; ++ } else if #[cfg(target_os = "espidf")] { ++ pub const TCP_NODELAY: c_int = 1; ++ pub const TCP_MAXSEG: c_int = 8194; ++ } else { ++ pub const TCP_NODELAY: c_int = 8193; ++ pub const TCP_MAXSEG: c_int = 8194; ++ } ++} ++ ++pub const TCP_NOPUSH: c_int = 4; ++pub const TCP_NOOPT: c_int = 8; ++cfg_if! { ++ if #[cfg(target_os = "espidf")] { ++ pub const TCP_KEEPIDLE: c_int = 3; ++ pub const TCP_KEEPINTVL: c_int = 4; ++ pub const TCP_KEEPCNT: c_int = 5; ++ } else { ++ pub const TCP_KEEPIDLE: c_int = 256; ++ pub const TCP_KEEPINTVL: c_int = 512; ++ pub const TCP_KEEPCNT: c_int = 1024; ++ } ++} ++ ++cfg_if! { ++ if #[cfg(target_os = "horizon")] { ++ pub const IP_TOS: c_int = 7; ++ } else if #[cfg(target_os = "espidf")] { ++ pub const IP_TOS: c_int = 1; ++ } else { ++ pub const IP_TOS: c_int = 3; ++ } ++} ++cfg_if! { ++ if #[cfg(target_os = "vita")] { ++ pub const IP_TTL: c_int = 4; ++ } else if #[cfg(target_os = "espidf")] { ++ pub const IP_TTL: c_int = 2; ++ } else { ++ pub const IP_TTL: c_int = 8; ++ } ++} ++ ++cfg_if! { ++ if #[cfg(target_os = "espidf")] { ++ pub const IP_MULTICAST_IF: c_int = 6; ++ pub const IP_MULTICAST_TTL: c_int = 5; ++ pub const IP_MULTICAST_LOOP: c_int = 7; ++ } else { ++ pub const IP_MULTICAST_IF: c_int = 9; ++ pub const IP_MULTICAST_TTL: c_int = 10; ++ pub const IP_MULTICAST_LOOP: c_int = 11; ++ } ++} ++ ++cfg_if! { ++ if #[cfg(target_os = "vita")] { ++ pub const IP_ADD_MEMBERSHIP: c_int = 12; ++ pub const IP_DROP_MEMBERSHIP: c_int = 13; ++ } else if #[cfg(target_os = "espidf")] { ++ pub const IP_ADD_MEMBERSHIP: c_int = 3; ++ pub const IP_DROP_MEMBERSHIP: c_int = 4; ++ } else { ++ pub const IP_ADD_MEMBERSHIP: c_int = 11; ++ pub const IP_DROP_MEMBERSHIP: c_int = 12; ++ } ++} ++pub const IPV6_UNICAST_HOPS: c_int = 4; ++cfg_if! { ++ if #[cfg(target_os = "espidf")] { ++ pub const IPV6_MULTICAST_IF: c_int = 768; ++ pub const IPV6_MULTICAST_HOPS: c_int = 769; ++ pub const IPV6_MULTICAST_LOOP: c_int = 770; ++ } else { ++ pub const IPV6_MULTICAST_IF: c_int = 9; ++ pub const IPV6_MULTICAST_HOPS: c_int = 10; ++ pub const IPV6_MULTICAST_LOOP: c_int = 11; ++ } ++} ++pub const IPV6_V6ONLY: c_int = 27; ++pub const IPV6_JOIN_GROUP: c_int = 12; ++pub const IPV6_LEAVE_GROUP: c_int = 13; ++pub const IPV6_ADD_MEMBERSHIP: c_int = 12; ++pub const IPV6_DROP_MEMBERSHIP: c_int = 13; ++ ++cfg_if! { ++ if #[cfg(target_os = "espidf")] { ++ pub const HOST_NOT_FOUND: c_int = 210; ++ pub const NO_DATA: c_int = 211; ++ pub const NO_RECOVERY: c_int = 212; ++ pub const TRY_AGAIN: c_int = 213; ++ } else { ++ pub const HOST_NOT_FOUND: c_int = 1; ++ pub const NO_DATA: c_int = 2; ++ pub const NO_RECOVERY: c_int = 3; ++ pub const TRY_AGAIN: c_int = 4; ++ } ++} ++pub const NO_ADDRESS: c_int = 2; ++ ++pub const AI_PASSIVE: c_int = 1; ++pub const AI_CANONNAME: c_int = 2; ++pub const AI_NUMERICHOST: c_int = 4; ++cfg_if! { ++ if #[cfg(target_os = "espidf")] { ++ pub const AI_NUMERICSERV: c_int = 8; ++ pub const AI_ADDRCONFIG: c_int = 64; ++ } else { ++ pub const AI_NUMERICSERV: c_int = 0; ++ pub const AI_ADDRCONFIG: c_int = 0; ++ } ++} ++ ++pub const NI_MAXHOST: c_int = 1025; ++pub const NI_MAXSERV: c_int = 32; ++pub const NI_NOFQDN: c_int = 1; ++pub const NI_NUMERICHOST: c_int = 2; ++pub const NI_NAMEREQD: c_int = 4; ++cfg_if! { ++ if #[cfg(target_os = "espidf")] { ++ pub const NI_NUMERICSERV: c_int = 8; ++ pub const NI_DGRAM: c_int = 16; ++ } else { ++ pub const NI_NUMERICSERV: c_int = 0; ++ pub const NI_DGRAM: c_int = 0; ++ } ++} ++ ++cfg_if! { ++ // Defined in vita/mod.rs for "vita" ++ if #[cfg(target_os = "espidf")] { ++ pub const EAI_FAMILY: c_int = 204; ++ pub const EAI_MEMORY: c_int = 203; ++ pub const EAI_NONAME: c_int = 200; ++ pub const EAI_SOCKTYPE: c_int = 10; ++ } else if #[cfg(not(target_os = "vita"))] { ++ pub const EAI_FAMILY: c_int = -303; ++ pub const EAI_MEMORY: c_int = -304; ++ pub const EAI_NONAME: c_int = -305; ++ pub const EAI_SOCKTYPE: c_int = -307; ++ } ++} ++ ++pub const EXIT_SUCCESS: c_int = 0; ++pub const EXIT_FAILURE: c_int = 1; ++ ++pub const PRIO_PROCESS: c_int = 0; ++pub const PRIO_PGRP: c_int = 1; ++pub const PRIO_USER: c_int = 2; ++ ++f! { ++ pub fn FD_CLR(fd: c_int, set: *mut fd_set) -> () { ++ let bits = mem::size_of_val(&(*set).fds_bits[0]) * 8; ++ let fd = fd as usize; ++ (*set).fds_bits[fd / bits] &= !(1 << (fd % bits)); ++ return; ++ } ++ ++ pub fn FD_ISSET(fd: c_int, set: *const fd_set) -> bool { ++ let bits = mem::size_of_val(&(*set).fds_bits[0]) * 8; ++ let fd = fd as usize; ++ return ((*set).fds_bits[fd / bits] & (1 << (fd % bits))) != 0; ++ } ++ ++ pub fn FD_SET(fd: c_int, set: *mut fd_set) -> () { ++ let bits = mem::size_of_val(&(*set).fds_bits[0]) * 8; ++ let fd = fd as usize; ++ (*set).fds_bits[fd / bits] |= 1 << (fd % bits); ++ return; ++ } ++ ++ pub fn FD_ZERO(set: *mut fd_set) -> () { ++ for slot in (*set).fds_bits.iter_mut() { ++ *slot = 0; ++ } ++ } ++} ++ ++extern "C" { ++ pub fn getrlimit(resource: c_int, rlim: *mut crate::rlimit) -> c_int; ++ pub fn setrlimit(resource: c_int, rlim: *const crate::rlimit) -> c_int; ++ ++ #[cfg_attr(target_os = "linux", link_name = "__xpg_strerror_r")] ++ pub fn strerror_r(errnum: c_int, buf: *mut c_char, buflen: size_t) -> c_int; ++ ++ pub fn sem_destroy(sem: *mut sem_t) -> c_int; ++ pub fn sem_init(sem: *mut sem_t, pshared: c_int, value: c_uint) -> c_int; ++ ++ pub fn abs(i: c_int) -> c_int; ++ pub fn labs(i: c_long) -> c_long; ++ pub fn rand() -> c_int; ++ pub fn srand(seed: c_uint); ++ ++ #[cfg(not(all(target_arch = "powerpc", target_vendor = "nintendo")))] ++ #[cfg_attr(target_os = "espidf", link_name = "lwip_bind")] ++ pub fn bind(fd: c_int, addr: *const sockaddr, len: socklen_t) -> c_int; ++ pub fn clock_settime(clock_id: crate::clockid_t, tp: *const crate::timespec) -> c_int; ++ pub fn clock_gettime(clock_id: crate::clockid_t, tp: *mut crate::timespec) -> c_int; ++ pub fn clock_getres(clock_id: crate::clockid_t, res: *mut crate::timespec) -> c_int; ++ #[cfg_attr(target_os = "espidf", link_name = "lwip_close")] ++ pub fn closesocket(sockfd: c_int) -> c_int; ++ pub fn ioctl(fd: c_int, request: c_ulong, ...) -> c_int; ++ #[cfg(not(all(target_arch = "powerpc", target_vendor = "nintendo")))] ++ #[cfg_attr(target_os = "espidf", link_name = "lwip_recvfrom")] ++ pub fn recvfrom( ++ fd: c_int, ++ buf: *mut c_void, ++ n: usize, ++ flags: c_int, ++ addr: *mut sockaddr, ++ addr_len: *mut socklen_t, ++ ) -> isize; ++ #[cfg(not(all(target_arch = "powerpc", target_vendor = "nintendo")))] ++ pub fn getnameinfo( ++ sa: *const sockaddr, ++ salen: socklen_t, ++ host: *mut c_char, ++ hostlen: socklen_t, ++ serv: *mut c_char, ++ servlen: socklen_t, ++ flags: c_int, ++ ) -> c_int; ++ pub fn memalign(align: size_t, size: size_t) -> *mut c_void; ++ ++ // DIFF(main): changed to `*const *mut` in e77f551de9 ++ pub fn fexecve(fd: c_int, argv: *const *const c_char, envp: *const *const c_char) -> c_int; ++ ++ pub fn gettimeofday(tp: *mut crate::timeval, tz: *mut c_void) -> c_int; ++ pub fn getgrgid_r( ++ gid: crate::gid_t, ++ grp: *mut crate::group, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut crate::group, ++ ) -> c_int; ++ pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> c_int; ++ pub fn sem_close(sem: *mut sem_t) -> c_int; ++ pub fn getdtablesize() -> c_int; ++ pub fn getgrnam_r( ++ name: *const c_char, ++ grp: *mut crate::group, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut crate::group, ++ ) -> c_int; ++ pub fn pthread_sigmask(how: c_int, set: *const sigset_t, oldset: *mut sigset_t) -> c_int; ++ pub fn sem_open(name: *const c_char, oflag: c_int, ...) -> *mut sem_t; ++ pub fn getgrnam(name: *const c_char) -> *mut crate::group; ++ pub fn pthread_kill(thread: crate::pthread_t, sig: c_int) -> c_int; ++ pub fn sem_unlink(name: *const c_char) -> c_int; ++ pub fn daemon(nochdir: c_int, noclose: c_int) -> c_int; ++ pub fn getpwnam_r( ++ name: *const c_char, ++ pwd: *mut passwd, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut passwd, ++ ) -> c_int; ++ pub fn getpwuid_r( ++ uid: crate::uid_t, ++ pwd: *mut passwd, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut passwd, ++ ) -> c_int; ++ pub fn sigwait(set: *const sigset_t, sig: *mut c_int) -> c_int; ++ pub fn pthread_atfork( ++ prepare: Option, ++ parent: Option, ++ child: Option, ++ ) -> c_int; ++ pub fn getgrgid(gid: crate::gid_t) -> *mut crate::group; ++ pub fn popen(command: *const c_char, mode: *const c_char) -> *mut crate::FILE; ++ pub fn uname(buf: *mut crate::utsname) -> c_int; ++} ++ ++mod generic; ++ ++cfg_if! { ++ if #[cfg(target_os = "espidf")] { ++ mod espidf; ++ pub use self::espidf::*; ++ } else if #[cfg(target_os = "horizon")] { ++ mod horizon; ++ pub use self::horizon::*; ++ } else if #[cfg(target_os = "vita")] { ++ mod vita; ++ pub use self::vita::*; ++ } else if #[cfg(target_arch = "arm")] { ++ mod arm; ++ pub use self::arm::*; ++ } else if #[cfg(target_arch = "aarch64")] { ++ mod aarch64; ++ pub use self::aarch64::*; ++ } else if #[cfg(target_arch = "powerpc")] { ++ mod powerpc; ++ pub use self::powerpc::*; ++ } else { ++ // Only tested on ARM so far. Other platforms might have different ++ // definitions for types and constants. ++ pub use target_arch_not_implemented; ++ } ++} ++ ++cfg_if! { ++ if #[cfg(target_os = "rtems")] { ++ mod rtems; ++ pub use self::rtems::*; ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/newlib/powerpc/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/newlib/powerpc/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/newlib/powerpc/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/newlib/powerpc/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,18 @@ ++use crate::prelude::*; ++ ++pub type clock_t = c_ulong; ++pub type c_char = u8; ++pub type wchar_t = c_int; ++ ++pub type c_long = i32; ++pub type c_ulong = u32; ++ ++pub use crate::unix::newlib::generic::{dirent, sigset_t, stat}; ++ ++// the newlib shipped with devkitPPC does not support the following components: ++// - sockaddr ++// - AF_INET6 ++// - FIONBIO ++// - POLL* ++// - SOL_SOCKET ++// - MSG_* +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/newlib/rtems/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/newlib/rtems/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/newlib/rtems/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/newlib/rtems/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,146 @@ ++// defined in architecture specific module ++ ++use crate::prelude::*; ++ ++s! { ++ pub struct sockaddr_un { ++ pub sun_family: crate::sa_family_t, ++ pub sun_path: [c_char; 108usize], ++ } ++} ++ ++pub const AF_UNIX: c_int = 1; ++ ++pub const RTLD_DEFAULT: *mut c_void = -2isize as *mut c_void; ++ ++pub const UTIME_OMIT: c_long = -1; ++pub const AT_FDCWD: c_int = -2; ++ ++pub const O_DIRECTORY: c_int = 0x200000; ++pub const O_NOFOLLOW: c_int = 0x100000; ++ ++pub const AT_EACCESS: c_int = 1; ++pub const AT_SYMLINK_NOFOLLOW: c_int = 2; ++pub const AT_SYMLINK_FOLLOW: c_int = 4; ++pub const AT_REMOVEDIR: c_int = 8; ++ ++// signal.h ++pub const SIG_BLOCK: c_int = 1; ++pub const SIG_UNBLOCK: c_int = 2; ++pub const SIG_SETMASK: c_int = 0; ++pub const SIGHUP: c_int = 1; ++pub const SIGINT: c_int = 2; ++pub const SIGQUIT: c_int = 3; ++pub const SIGILL: c_int = 4; ++pub const SIGTRAP: c_int = 5; ++pub const SIGABRT: c_int = 6; ++pub const SIGEMT: c_int = 7; ++pub const SIGFPE: c_int = 8; ++pub const SIGKILL: c_int = 9; ++pub const SIGBUS: c_int = 10; ++pub const SIGSEGV: c_int = 11; ++pub const SIGSYS: c_int = 12; ++pub const SIGPIPE: c_int = 13; ++pub const SIGALRM: c_int = 14; ++pub const SIGTERM: c_int = 15; ++pub const SIGURG: c_int = 16; ++pub const SIGSTOP: c_int = 17; ++pub const SIGTSTP: c_int = 18; ++pub const SIGCONT: c_int = 19; ++pub const SIGCHLD: c_int = 20; ++pub const SIGCLD: c_int = 20; ++pub const SIGTTIN: c_int = 21; ++pub const SIGTTOU: c_int = 22; ++pub const SIGIO: c_int = 23; ++pub const SIGWINCH: c_int = 24; ++pub const SIGUSR1: c_int = 25; ++pub const SIGUSR2: c_int = 26; ++pub const SIGRTMIN: c_int = 27; ++pub const SIGRTMAX: c_int = 31; ++pub const SIGXCPU: c_int = 24; ++pub const SIGXFSZ: c_int = 25; ++pub const SIGVTALRM: c_int = 26; ++pub const SIGPROF: c_int = 27; ++ ++pub const SA_NOCLDSTOP: c_ulong = 0x00000001; ++pub const SA_SIGINFO: c_ulong = 0x00000002; ++pub const SA_ONSTACK: c_ulong = 0x00000004; ++ ++pub const EAI_AGAIN: c_int = 2; ++pub const EAI_BADFLAGS: c_int = 3; ++pub const EAI_FAIL: c_int = 4; ++pub const EAI_SERVICE: c_int = 9; ++pub const EAI_SYSTEM: c_int = 11; ++pub const EAI_OVERFLOW: c_int = 14; ++ ++pub const _SC_PAGESIZE: c_int = 8; ++pub const _SC_GETPW_R_SIZE_MAX: c_int = 51; ++pub const PTHREAD_STACK_MIN: size_t = 0; ++ ++// sys/wait.h ++pub const WNOHANG: c_int = 1; ++pub const WUNTRACED: c_int = 2; ++ ++// sys/socket.h ++pub const SOMAXCONN: c_int = 128; ++ ++safe_f! { ++ pub {const} fn WIFSTOPPED(status: c_int) -> bool { ++ (status & 0xff) == 0x7f ++ } ++ ++ pub {const} fn WSTOPSIG(status: c_int) -> c_int { ++ // (status >> 8) & 0xff ++ WEXITSTATUS(status) ++ } ++ ++ pub {const} fn WIFSIGNALED(status: c_int) -> bool { ++ ((status & 0x7f) > 0) && ((status & 0x7f) < 0x7f) ++ } ++ ++ pub {const} fn WTERMSIG(status: c_int) -> c_int { ++ status & 0x7f ++ } ++ ++ pub {const} fn WIFEXITED(status: c_int) -> bool { ++ (status & 0xff) == 0 ++ } ++ ++ pub {const} fn WEXITSTATUS(status: c_int) -> c_int { ++ (status >> 8) & 0xff ++ } ++ ++ // RTEMS doesn't have native WIFCONTINUED. ++ pub {const} fn WIFCONTINUED(_status: c_int) -> bool { ++ true ++ } ++ ++ // RTEMS doesn't have native WCOREDUMP. ++ pub {const} fn WCOREDUMP(_status: c_int) -> bool { ++ false ++ } ++} ++ ++extern "C" { ++ pub fn futimens(fd: c_int, times: *const crate::timespec) -> c_int; ++ pub fn writev(fd: c_int, iov: *const crate::iovec, iovcnt: c_int) -> ssize_t; ++ pub fn readv(fd: c_int, iov: *const crate::iovec, iovcnt: c_int) -> ssize_t; ++ ++ pub fn pthread_create( ++ native: *mut crate::pthread_t, ++ attr: *const crate::pthread_attr_t, ++ f: extern "C" fn(_: *mut c_void) -> *mut c_void, ++ value: *mut c_void, ++ ) -> c_int; ++ ++ pub fn pthread_condattr_setclock( ++ attr: *mut crate::pthread_condattr_t, ++ clock_id: crate::clockid_t, ++ ) -> c_int; ++ ++ pub fn getentropy(buf: *mut c_void, buflen: size_t) -> c_int; ++ ++ pub fn arc4random_buf(buf: *mut core::ffi::c_void, nbytes: size_t); ++ ++ pub fn setgroups(ngroups: c_int, grouplist: *const crate::gid_t) -> c_int; ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/newlib/vita/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/newlib/vita/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/newlib/vita/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/newlib/vita/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,239 @@ ++use crate::off_t; ++use crate::prelude::*; ++ ++pub type clock_t = c_long; ++ ++pub type c_char = u8; ++pub type wchar_t = u32; ++ ++pub type c_long = i32; ++pub type c_ulong = u32; ++ ++pub type sigset_t = c_ulong; ++ ++s! { ++ pub struct msghdr { ++ pub msg_name: *mut c_void, ++ pub msg_namelen: crate::socklen_t, ++ pub msg_iov: *mut crate::iovec, ++ pub msg_iovlen: c_int, ++ pub msg_control: *mut c_void, ++ pub msg_controllen: crate::socklen_t, ++ pub msg_flags: c_int, ++ } ++ ++ pub struct sockaddr { ++ pub sa_len: u8, ++ pub sa_family: crate::sa_family_t, ++ pub sa_data: [c_char; 14], ++ } ++ ++ pub struct sockaddr_in6 { ++ pub sin6_len: u8, ++ pub sin6_family: crate::sa_family_t, ++ pub sin6_port: crate::in_port_t, ++ pub sin6_flowinfo: u32, ++ pub sin6_addr: crate::in6_addr, ++ pub sin6_vport: crate::in_port_t, ++ pub sin6_scope_id: u32, ++ } ++ ++ pub struct sockaddr_in { ++ pub sin_len: u8, ++ pub sin_family: crate::sa_family_t, ++ pub sin_port: crate::in_port_t, ++ pub sin_addr: crate::in_addr, ++ pub sin_vport: crate::in_port_t, ++ pub sin_zero: [u8; 6], ++ } ++ ++ pub struct sockaddr_un { ++ pub ss_len: u8, ++ pub sun_family: crate::sa_family_t, ++ pub sun_path: [c_char; 108usize], ++ } ++ ++ pub struct sockaddr_storage { ++ pub ss_len: u8, ++ pub ss_family: crate::sa_family_t, ++ pub __ss_pad1: [u8; 2], ++ pub __ss_align: i64, ++ pub __ss_pad2: [u8; 116], ++ } ++ ++ pub struct sched_param { ++ pub sched_priority: c_int, ++ } ++ ++ pub struct stat { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ pub st_size: off_t, ++ pub st_atime: crate::time_t, ++ pub st_mtime: crate::time_t, ++ pub st_ctime: crate::time_t, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_spare4: [c_long; 2usize], ++ } ++ ++ #[repr(align(8))] ++ pub struct dirent { ++ __offset: [u8; 88], ++ pub d_name: [c_char; 256usize], ++ __pad: [u8; 8], ++ } ++} ++ ++pub const AF_UNIX: c_int = 1; ++pub const AF_INET6: c_int = 24; ++ ++pub const SOCK_RAW: c_int = 3; ++pub const SOCK_RDM: c_int = 4; ++pub const SOCK_SEQPACKET: c_int = 5; ++ ++pub const SOMAXCONN: c_int = 128; ++ ++pub const FIONBIO: c_ulong = 1; ++ ++pub const POLLIN: c_short = 0x0001; ++pub const POLLPRI: c_short = POLLIN; ++pub const POLLOUT: c_short = 0x0004; ++pub const POLLRDNORM: c_short = POLLIN; ++pub const POLLRDBAND: c_short = POLLIN; ++pub const POLLWRNORM: c_short = POLLOUT; ++pub const POLLWRBAND: c_short = POLLOUT; ++pub const POLLERR: c_short = 0x0008; ++pub const POLLHUP: c_short = 0x0010; ++pub const POLLNVAL: c_short = 0x0020; ++ ++pub const RTLD_DEFAULT: *mut c_void = 0 as *mut c_void; ++ ++pub const SOL_SOCKET: c_int = 0xffff; ++pub const SO_NONBLOCK: c_int = 0x1100; ++ ++pub const MSG_OOB: c_int = 0x1; ++pub const MSG_PEEK: c_int = 0x2; ++pub const MSG_DONTROUTE: c_int = 0x4; ++pub const MSG_EOR: c_int = 0x8; ++pub const MSG_TRUNC: c_int = 0x10; ++pub const MSG_CTRUNC: c_int = 0x20; ++pub const MSG_WAITALL: c_int = 0x40; ++pub const MSG_DONTWAIT: c_int = 0x80; ++pub const MSG_BCAST: c_int = 0x100; ++pub const MSG_MCAST: c_int = 0x200; ++ ++pub const UTIME_OMIT: c_long = -1; ++pub const AT_FDCWD: c_int = -2; ++ ++pub const O_DIRECTORY: c_int = 0x200000; ++pub const O_NOFOLLOW: c_int = 0x100000; ++ ++pub const AT_EACCESS: c_int = 1; ++pub const AT_SYMLINK_NOFOLLOW: c_int = 2; ++pub const AT_SYMLINK_FOLLOW: c_int = 4; ++pub const AT_REMOVEDIR: c_int = 8; ++ ++pub const SIGHUP: c_int = 1; ++pub const SIGINT: c_int = 2; ++pub const SIGQUIT: c_int = 3; ++pub const SIGILL: c_int = 4; ++pub const SIGTRAP: c_int = 5; ++pub const SIGABRT: c_int = 6; ++pub const SIGEMT: c_int = 7; ++pub const SIGFPE: c_int = 8; ++pub const SIGKILL: c_int = 9; ++pub const SIGBUS: c_int = 10; ++pub const SIGSEGV: c_int = 11; ++pub const SIGSYS: c_int = 12; ++pub const SIGPIPE: c_int = 13; ++pub const SIGALRM: c_int = 14; ++pub const SIGTERM: c_int = 15; ++ ++pub const EAI_BADFLAGS: c_int = -1; ++pub const EAI_NONAME: c_int = -2; ++pub const EAI_AGAIN: c_int = -3; ++pub const EAI_FAIL: c_int = -4; ++pub const EAI_NODATA: c_int = -5; ++pub const EAI_FAMILY: c_int = -6; ++pub const EAI_SOCKTYPE: c_int = -7; ++pub const EAI_SERVICE: c_int = -8; ++pub const EAI_ADDRFAMILY: c_int = -9; ++pub const EAI_MEMORY: c_int = -10; ++pub const EAI_SYSTEM: c_int = -11; ++pub const EAI_OVERFLOW: c_int = -12; ++ ++pub const _SC_PAGESIZE: c_int = 8; ++pub const _SC_GETPW_R_SIZE_MAX: c_int = 51; ++pub const PTHREAD_STACK_MIN: size_t = 32 * 1024; ++ ++pub const IP_HDRINCL: c_int = 2; ++ ++extern "C" { ++ pub fn futimens(fd: c_int, times: *const crate::timespec) -> c_int; ++ pub fn writev(fd: c_int, iov: *const crate::iovec, iovcnt: c_int) -> ssize_t; ++ pub fn readv(fd: c_int, iov: *const crate::iovec, iovcnt: c_int) -> ssize_t; ++ ++ pub fn sendmsg(s: c_int, msg: *const crate::msghdr, flags: c_int) -> ssize_t; ++ pub fn recvmsg(s: c_int, msg: *mut crate::msghdr, flags: c_int) -> ssize_t; ++ ++ pub fn pthread_create( ++ native: *mut crate::pthread_t, ++ attr: *const crate::pthread_attr_t, ++ f: extern "C" fn(_: *mut c_void) -> *mut c_void, ++ value: *mut c_void, ++ ) -> c_int; ++ ++ pub fn pthread_attr_getschedparam( ++ attr: *const crate::pthread_attr_t, ++ param: *mut sched_param, ++ ) -> c_int; ++ ++ pub fn pthread_attr_setschedparam( ++ attr: *mut crate::pthread_attr_t, ++ param: *const sched_param, ++ ) -> c_int; ++ ++ pub fn pthread_attr_getprocessorid_np( ++ attr: *const crate::pthread_attr_t, ++ processor_id: *mut c_int, ++ ) -> c_int; ++ ++ pub fn pthread_attr_setprocessorid_np( ++ attr: *mut crate::pthread_attr_t, ++ processor_id: c_int, ++ ) -> c_int; ++ ++ pub fn pthread_getschedparam( ++ native: crate::pthread_t, ++ policy: *mut c_int, ++ param: *mut crate::sched_param, ++ ) -> c_int; ++ ++ pub fn pthread_setschedparam( ++ native: crate::pthread_t, ++ policy: c_int, ++ param: *const crate::sched_param, ++ ) -> c_int; ++ ++ pub fn pthread_condattr_getclock( ++ attr: *const crate::pthread_condattr_t, ++ clock_id: *mut crate::clockid_t, ++ ) -> c_int; ++ ++ pub fn pthread_condattr_setclock( ++ attr: *mut crate::pthread_condattr_t, ++ clock_id: crate::clockid_t, ++ ) -> c_int; ++ ++ pub fn pthread_getprocessorid_np() -> c_int; ++ ++ pub fn getentropy(buf: *mut c_void, buflen: size_t) -> c_int; ++ ++ pub fn pipe2(fds: *mut c_int, flags: c_int) -> c_int; ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/nto/aarch64.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/nto/aarch64.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/nto/aarch64.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/nto/aarch64.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,38 @@ ++use crate::prelude::*; ++ ++pub type c_char = u8; ++pub type wchar_t = u32; ++pub type c_long = i64; ++pub type c_ulong = u64; ++pub type time_t = i64; ++ ++s! { ++ pub struct aarch64_qreg_t { ++ pub qlo: u64, ++ pub qhi: u64, ++ } ++ ++ pub struct aarch64_fpu_registers { ++ pub reg: [crate::aarch64_qreg_t; 32], ++ pub fpsr: u32, ++ pub fpcr: u32, ++ } ++ ++ pub struct aarch64_cpu_registers { ++ pub gpr: [u64; 32], ++ pub elr: u64, ++ pub pstate: u64, ++ } ++ ++ #[repr(align(16))] ++ pub struct mcontext_t { ++ pub cpu: crate::aarch64_cpu_registers, ++ pub fpu: crate::aarch64_fpu_registers, ++ } ++ ++ pub struct stack_t { ++ pub ss_sp: *mut c_void, ++ pub ss_size: size_t, ++ pub ss_flags: c_int, ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/nto/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/nto/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/nto/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/nto/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,3492 @@ ++use crate::prelude::*; ++ ++pub type clock_t = u32; ++ ++pub type sa_family_t = u8; ++pub type speed_t = c_uint; ++pub type tcflag_t = c_uint; ++pub type clockid_t = c_int; ++pub type timer_t = c_int; ++pub type key_t = c_uint; ++pub type id_t = c_int; ++ ++pub type useconds_t = u32; ++pub type dev_t = u32; ++pub type socklen_t = u32; ++pub type mode_t = u32; ++pub type rlim64_t = u64; ++pub type mqd_t = c_int; ++pub type nfds_t = c_uint; ++pub type idtype_t = c_uint; ++pub type errno_t = c_int; ++pub type rsize_t = c_ulong; ++ ++pub type Elf32_Half = u16; ++pub type Elf32_Word = u32; ++pub type Elf32_Off = u32; ++pub type Elf32_Addr = u32; ++pub type Elf32_Lword = u64; ++pub type Elf32_Sword = i32; ++ ++pub type Elf64_Half = u16; ++pub type Elf64_Word = u32; ++pub type Elf64_Off = u64; ++pub type Elf64_Addr = u64; ++pub type Elf64_Xword = u64; ++pub type Elf64_Sxword = i64; ++pub type Elf64_Lword = u64; ++pub type Elf64_Sword = i32; ++ ++pub type Elf32_Section = u16; ++pub type Elf64_Section = u16; ++ ++pub type _Time32t = u32; ++ ++pub type pthread_t = c_int; ++pub type regoff_t = ssize_t; ++ ++pub type nlink_t = u32; ++pub type blksize_t = u32; ++pub type suseconds_t = i32; ++ ++pub type ino_t = u64; ++pub type off_t = i64; ++pub type blkcnt_t = u64; ++pub type msgqnum_t = u64; ++pub type msglen_t = u64; ++pub type fsblkcnt_t = u64; ++pub type fsfilcnt_t = u64; ++pub type rlim_t = u64; ++pub type posix_spawn_file_actions_t = *mut c_void; ++pub type posix_spawnattr_t = crate::uintptr_t; ++ ++pub type pthread_mutex_t = crate::sync_t; ++pub type pthread_mutexattr_t = crate::_sync_attr; ++pub type pthread_cond_t = crate::sync_t; ++pub type pthread_condattr_t = crate::_sync_attr; ++pub type pthread_rwlockattr_t = crate::_sync_attr; ++pub type pthread_key_t = c_int; ++pub type pthread_spinlock_t = sync_t; ++pub type pthread_barrierattr_t = _sync_attr; ++pub type sem_t = sync_t; ++ ++pub type nl_item = c_int; ++ ++#[cfg_attr(feature = "extra_traits", derive(Debug))] ++pub enum timezone {} ++impl Copy for timezone {} ++impl Clone for timezone { ++ fn clone(&self) -> timezone { ++ *self ++ } ++} ++ ++s! { ++ pub struct dirent_extra { ++ pub d_datalen: u16, ++ pub d_type: u16, ++ pub d_reserved: u32, ++ } ++ ++ pub struct stat { ++ pub st_ino: crate::ino_t, ++ pub st_size: off_t, ++ pub st_dev: crate::dev_t, ++ pub st_rdev: crate::dev_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub __old_st_mtime: crate::_Time32t, ++ pub __old_st_atime: crate::_Time32t, ++ pub __old_st_ctime: crate::_Time32t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_blocksize: crate::blksize_t, ++ pub st_nblocks: i32, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_mtim: crate::timespec, ++ pub st_atim: crate::timespec, ++ pub st_ctim: crate::timespec, ++ } ++ ++ pub struct ip_mreq { ++ pub imr_multiaddr: in_addr, ++ pub imr_interface: in_addr, ++ } ++ ++ #[repr(packed)] ++ pub struct in_addr { ++ pub s_addr: crate::in_addr_t, ++ } ++ ++ pub struct sockaddr { ++ pub sa_len: u8, ++ pub sa_family: sa_family_t, ++ pub sa_data: [c_char; 14], ++ } ++ ++ pub struct sockaddr_in { ++ pub sin_len: u8, ++ pub sin_family: sa_family_t, ++ pub sin_port: crate::in_port_t, ++ pub sin_addr: crate::in_addr, ++ pub sin_zero: [i8; 8], ++ } ++ ++ pub struct sockaddr_in6 { ++ pub sin6_len: u8, ++ pub sin6_family: sa_family_t, ++ pub sin6_port: crate::in_port_t, ++ pub sin6_flowinfo: u32, ++ pub sin6_addr: crate::in6_addr, ++ pub sin6_scope_id: u32, ++ } ++ ++ // The order of the `ai_addr` field in this struct is crucial ++ // for converting between the Rust and C types. ++ pub struct addrinfo { ++ pub ai_flags: c_int, ++ pub ai_family: c_int, ++ pub ai_socktype: c_int, ++ pub ai_protocol: c_int, ++ pub ai_addrlen: socklen_t, ++ pub ai_canonname: *mut c_char, ++ pub ai_addr: *mut crate::sockaddr, ++ pub ai_next: *mut addrinfo, ++ } ++ ++ pub struct fd_set { ++ fds_bits: [c_uint; 2 * FD_SETSIZE as usize / ULONG_SIZE], ++ } ++ ++ pub struct tm { ++ pub tm_sec: c_int, ++ pub tm_min: c_int, ++ pub tm_hour: c_int, ++ pub tm_mday: c_int, ++ pub tm_mon: c_int, ++ pub tm_year: c_int, ++ pub tm_wday: c_int, ++ pub tm_yday: c_int, ++ pub tm_isdst: c_int, ++ pub tm_gmtoff: c_long, ++ pub tm_zone: *const c_char, ++ } ++ ++ #[repr(align(8))] ++ pub struct sched_param { ++ pub sched_priority: c_int, ++ pub sched_curpriority: c_int, ++ pub reserved: [c_int; 10], ++ } ++ ++ #[repr(align(8))] ++ pub struct __sched_param { ++ pub __sched_priority: c_int, ++ pub __sched_curpriority: c_int, ++ pub reserved: [c_int; 10], ++ } ++ ++ pub struct Dl_info { ++ pub dli_fname: *const c_char, ++ pub dli_fbase: *mut c_void, ++ pub dli_sname: *const c_char, ++ pub dli_saddr: *mut c_void, ++ } ++ ++ pub struct lconv { ++ pub currency_symbol: *mut c_char, ++ pub int_curr_symbol: *mut c_char, ++ pub mon_decimal_point: *mut c_char, ++ pub mon_grouping: *mut c_char, ++ pub mon_thousands_sep: *mut c_char, ++ pub negative_sign: *mut c_char, ++ pub positive_sign: *mut c_char, ++ pub frac_digits: c_char, ++ pub int_frac_digits: c_char, ++ pub n_cs_precedes: c_char, ++ pub n_sep_by_space: c_char, ++ pub n_sign_posn: c_char, ++ pub p_cs_precedes: c_char, ++ pub p_sep_by_space: c_char, ++ pub p_sign_posn: c_char, ++ ++ pub int_n_cs_precedes: c_char, ++ pub int_n_sep_by_space: c_char, ++ pub int_n_sign_posn: c_char, ++ pub int_p_cs_precedes: c_char, ++ pub int_p_sep_by_space: c_char, ++ pub int_p_sign_posn: c_char, ++ ++ pub decimal_point: *mut c_char, ++ pub grouping: *mut c_char, ++ pub thousands_sep: *mut c_char, ++ ++ pub _Frac_grouping: *mut c_char, ++ pub _Frac_sep: *mut c_char, ++ pub _False: *mut c_char, ++ pub _True: *mut c_char, ++ ++ pub _No: *mut c_char, ++ pub _Yes: *mut c_char, ++ pub _Nostr: *mut c_char, ++ pub _Yesstr: *mut c_char, ++ pub _Reserved: [*mut c_char; 8], ++ } ++ ++ pub struct in_pktinfo { ++ pub ipi_addr: crate::in_addr, ++ pub ipi_ifindex: c_uint, ++ } ++ ++ pub struct ifaddrs { ++ pub ifa_next: *mut ifaddrs, ++ pub ifa_name: *mut c_char, ++ pub ifa_flags: c_uint, ++ pub ifa_addr: *mut crate::sockaddr, ++ pub ifa_netmask: *mut crate::sockaddr, ++ pub ifa_dstaddr: *mut crate::sockaddr, ++ pub ifa_data: *mut c_void, ++ } ++ ++ pub struct arpreq { ++ pub arp_pa: crate::sockaddr, ++ pub arp_ha: crate::sockaddr, ++ pub arp_flags: c_int, ++ } ++ ++ #[repr(packed)] ++ pub struct arphdr { ++ pub ar_hrd: u16, ++ pub ar_pro: u16, ++ pub ar_hln: u8, ++ pub ar_pln: u8, ++ pub ar_op: u16, ++ } ++ ++ pub struct mmsghdr { ++ pub msg_hdr: crate::msghdr, ++ pub msg_len: c_uint, ++ } ++ ++ #[repr(align(8))] ++ pub struct siginfo_t { ++ pub si_signo: c_int, ++ pub si_code: c_int, ++ pub si_errno: c_int, ++ __data: [u8; 36], // union ++ } ++ ++ pub struct sigaction { ++ pub sa_sigaction: crate::sighandler_t, ++ pub sa_flags: c_int, ++ pub sa_mask: crate::sigset_t, ++ } ++ ++ pub struct _sync { ++ _union: c_uint, ++ __owner: c_uint, ++ } ++ pub struct rlimit64 { ++ pub rlim_cur: rlim64_t, ++ pub rlim_max: rlim64_t, ++ } ++ ++ pub struct glob_t { ++ pub gl_pathc: size_t, ++ pub gl_matchc: c_int, ++ pub gl_pathv: *mut *mut c_char, ++ pub gl_offs: size_t, ++ pub gl_flags: c_int, ++ pub gl_errfunc: extern "C" fn(*const c_char, c_int) -> c_int, ++ ++ __unused1: *mut c_void, ++ __unused2: *mut c_void, ++ __unused3: *mut c_void, ++ __unused4: *mut c_void, ++ __unused5: *mut c_void, ++ } ++ ++ pub struct passwd { ++ pub pw_name: *mut c_char, ++ pub pw_passwd: *mut c_char, ++ pub pw_uid: crate::uid_t, ++ pub pw_gid: crate::gid_t, ++ pub pw_age: *mut c_char, ++ pub pw_comment: *mut c_char, ++ pub pw_gecos: *mut c_char, ++ pub pw_dir: *mut c_char, ++ pub pw_shell: *mut c_char, ++ } ++ ++ pub struct if_nameindex { ++ pub if_index: c_uint, ++ pub if_name: *mut c_char, ++ } ++ ++ pub struct sembuf { ++ pub sem_num: c_ushort, ++ pub sem_op: c_short, ++ pub sem_flg: c_short, ++ } ++ ++ pub struct Elf32_Ehdr { ++ pub e_ident: [c_uchar; 16], ++ pub e_type: Elf32_Half, ++ pub e_machine: Elf32_Half, ++ pub e_version: Elf32_Word, ++ pub e_entry: Elf32_Addr, ++ pub e_phoff: Elf32_Off, ++ pub e_shoff: Elf32_Off, ++ pub e_flags: Elf32_Word, ++ pub e_ehsize: Elf32_Half, ++ pub e_phentsize: Elf32_Half, ++ pub e_phnum: Elf32_Half, ++ pub e_shentsize: Elf32_Half, ++ pub e_shnum: Elf32_Half, ++ pub e_shstrndx: Elf32_Half, ++ } ++ ++ pub struct Elf64_Ehdr { ++ pub e_ident: [c_uchar; 16], ++ pub e_type: Elf64_Half, ++ pub e_machine: Elf64_Half, ++ pub e_version: Elf64_Word, ++ pub e_entry: Elf64_Addr, ++ pub e_phoff: Elf64_Off, ++ pub e_shoff: Elf64_Off, ++ pub e_flags: Elf64_Word, ++ pub e_ehsize: Elf64_Half, ++ pub e_phentsize: Elf64_Half, ++ pub e_phnum: Elf64_Half, ++ pub e_shentsize: Elf64_Half, ++ pub e_shnum: Elf64_Half, ++ pub e_shstrndx: Elf64_Half, ++ } ++ ++ pub struct Elf32_Sym { ++ pub st_name: Elf32_Word, ++ pub st_value: Elf32_Addr, ++ pub st_size: Elf32_Word, ++ pub st_info: c_uchar, ++ pub st_other: c_uchar, ++ pub st_shndx: Elf32_Section, ++ } ++ ++ pub struct Elf64_Sym { ++ pub st_name: Elf64_Word, ++ pub st_info: c_uchar, ++ pub st_other: c_uchar, ++ pub st_shndx: Elf64_Section, ++ pub st_value: Elf64_Addr, ++ pub st_size: Elf64_Xword, ++ } ++ ++ pub struct Elf32_Phdr { ++ pub p_type: Elf32_Word, ++ pub p_offset: Elf32_Off, ++ pub p_vaddr: Elf32_Addr, ++ pub p_paddr: Elf32_Addr, ++ pub p_filesz: Elf32_Word, ++ pub p_memsz: Elf32_Word, ++ pub p_flags: Elf32_Word, ++ pub p_align: Elf32_Word, ++ } ++ ++ pub struct Elf64_Phdr { ++ pub p_type: Elf64_Word, ++ pub p_flags: Elf64_Word, ++ pub p_offset: Elf64_Off, ++ pub p_vaddr: Elf64_Addr, ++ pub p_paddr: Elf64_Addr, ++ pub p_filesz: Elf64_Xword, ++ pub p_memsz: Elf64_Xword, ++ pub p_align: Elf64_Xword, ++ } ++ ++ pub struct Elf32_Shdr { ++ pub sh_name: Elf32_Word, ++ pub sh_type: Elf32_Word, ++ pub sh_flags: Elf32_Word, ++ pub sh_addr: Elf32_Addr, ++ pub sh_offset: Elf32_Off, ++ pub sh_size: Elf32_Word, ++ pub sh_link: Elf32_Word, ++ pub sh_info: Elf32_Word, ++ pub sh_addralign: Elf32_Word, ++ pub sh_entsize: Elf32_Word, ++ } ++ ++ pub struct Elf64_Shdr { ++ pub sh_name: Elf64_Word, ++ pub sh_type: Elf64_Word, ++ pub sh_flags: Elf64_Xword, ++ pub sh_addr: Elf64_Addr, ++ pub sh_offset: Elf64_Off, ++ pub sh_size: Elf64_Xword, ++ pub sh_link: Elf64_Word, ++ pub sh_info: Elf64_Word, ++ pub sh_addralign: Elf64_Xword, ++ pub sh_entsize: Elf64_Xword, ++ } ++ ++ pub struct in6_pktinfo { ++ pub ipi6_addr: crate::in6_addr, ++ pub ipi6_ifindex: c_uint, ++ } ++ ++ pub struct inotify_event { ++ pub wd: c_int, ++ pub mask: u32, ++ pub cookie: u32, ++ pub len: u32, ++ } ++ ++ pub struct regmatch_t { ++ pub rm_so: regoff_t, ++ pub rm_eo: regoff_t, ++ } ++ ++ pub struct msghdr { ++ pub msg_name: *mut c_void, ++ pub msg_namelen: crate::socklen_t, ++ pub msg_iov: *mut crate::iovec, ++ pub msg_iovlen: c_int, ++ pub msg_control: *mut c_void, ++ pub msg_controllen: crate::socklen_t, ++ pub msg_flags: c_int, ++ } ++ ++ pub struct cmsghdr { ++ pub cmsg_len: crate::socklen_t, ++ pub cmsg_level: c_int, ++ pub cmsg_type: c_int, ++ } ++ ++ pub struct termios { ++ pub c_iflag: crate::tcflag_t, ++ pub c_oflag: crate::tcflag_t, ++ pub c_cflag: crate::tcflag_t, ++ pub c_lflag: crate::tcflag_t, ++ pub c_cc: [crate::cc_t; crate::NCCS], ++ __reserved: [c_uint; 3], ++ pub c_ispeed: crate::speed_t, ++ pub c_ospeed: crate::speed_t, ++ } ++ ++ pub struct mallinfo { ++ pub arena: c_int, ++ pub ordblks: c_int, ++ pub smblks: c_int, ++ pub hblks: c_int, ++ pub hblkhd: c_int, ++ pub usmblks: c_int, ++ pub fsmblks: c_int, ++ pub uordblks: c_int, ++ pub fordblks: c_int, ++ pub keepcost: c_int, ++ } ++ ++ pub struct flock { ++ pub l_type: i16, ++ pub l_whence: i16, ++ pub l_zero1: i32, ++ pub l_start: off_t, ++ pub l_len: off_t, ++ pub l_pid: crate::pid_t, ++ pub l_sysid: u32, ++ } ++ ++ pub struct statvfs { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_favail: crate::fsfilcnt_t, ++ pub f_fsid: c_ulong, ++ pub f_basetype: [c_char; 16], ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ f_filler: [c_uint; 21], ++ } ++ ++ pub struct aiocb { ++ pub aio_fildes: c_int, ++ pub aio_reqprio: c_int, ++ pub aio_offset: off_t, ++ pub aio_buf: *mut c_void, ++ pub aio_nbytes: size_t, ++ pub aio_sigevent: crate::sigevent, ++ pub aio_lio_opcode: c_int, ++ pub _aio_lio_state: *mut c_void, ++ _aio_pad: [c_int; 3], ++ pub _aio_next: *mut crate::aiocb, ++ pub _aio_flag: c_uint, ++ pub _aio_iotype: c_uint, ++ pub _aio_result: ssize_t, ++ pub _aio_error: c_uint, ++ pub _aio_suspend: *mut c_void, ++ pub _aio_plist: *mut c_void, ++ pub _aio_policy: c_int, ++ pub _aio_param: crate::__sched_param, ++ } ++ ++ pub struct pthread_attr_t { ++ __data1: c_long, ++ __data2: [u8; 96], ++ } ++ ++ pub struct ipc_perm { ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub cuid: crate::uid_t, ++ pub cgid: crate::gid_t, ++ pub mode: crate::mode_t, ++ pub seq: c_uint, ++ pub key: crate::key_t, ++ _reserved: [c_int; 4], ++ } ++ ++ pub struct regex_t { ++ re_magic: c_int, ++ re_nsub: size_t, ++ re_endp: *const c_char, ++ re_g: *mut c_void, ++ } ++ ++ pub struct _thread_attr { ++ pub __flags: c_int, ++ pub __stacksize: size_t, ++ pub __stackaddr: *mut c_void, ++ pub __exitfunc: Option, ++ pub __policy: c_int, ++ pub __param: crate::__sched_param, ++ pub __guardsize: c_uint, ++ pub __prealloc: c_uint, ++ __spare: [c_int; 2], ++ } ++ ++ pub struct _sync_attr { ++ pub __protocol: c_int, ++ pub __flags: c_int, ++ pub __prioceiling: c_int, ++ pub __clockid: c_int, ++ pub __count: c_int, ++ __reserved: [c_int; 3], ++ } ++ ++ pub struct sockcred { ++ pub sc_uid: crate::uid_t, ++ pub sc_euid: crate::uid_t, ++ pub sc_gid: crate::gid_t, ++ pub sc_egid: crate::gid_t, ++ pub sc_ngroups: c_int, ++ pub sc_groups: [crate::gid_t; 1], ++ } ++ ++ pub struct bpf_program { ++ pub bf_len: c_uint, ++ pub bf_insns: *mut crate::bpf_insn, ++ } ++ ++ pub struct bpf_stat { ++ pub bs_recv: u64, ++ pub bs_drop: u64, ++ pub bs_capt: u64, ++ bs_padding: [u64; 13], ++ } ++ ++ pub struct bpf_version { ++ pub bv_major: c_ushort, ++ pub bv_minor: c_ushort, ++ } ++ ++ pub struct bpf_hdr { ++ pub bh_tstamp: crate::timeval, ++ pub bh_caplen: u32, ++ pub bh_datalen: u32, ++ pub bh_hdrlen: u16, ++ } ++ ++ pub struct bpf_insn { ++ pub code: u16, ++ pub jt: c_uchar, ++ pub jf: c_uchar, ++ pub k: u32, ++ } ++ ++ pub struct bpf_dltlist { ++ pub bfl_len: c_uint, ++ pub bfl_list: *mut c_uint, ++ } ++ ++ pub struct unpcbid { ++ pub unp_pid: crate::pid_t, ++ pub unp_euid: crate::uid_t, ++ pub unp_egid: crate::gid_t, ++ } ++ ++ pub struct dl_phdr_info { ++ pub dlpi_addr: crate::Elf64_Addr, ++ pub dlpi_name: *const c_char, ++ pub dlpi_phdr: *const crate::Elf64_Phdr, ++ pub dlpi_phnum: crate::Elf64_Half, ++ } ++ ++ #[repr(align(8))] ++ pub struct ucontext_t { ++ pub uc_link: *mut ucontext_t, ++ pub uc_sigmask: crate::sigset_t, ++ pub uc_stack: stack_t, ++ pub uc_mcontext: mcontext_t, ++ } ++} ++ ++s_no_extra_traits! { ++ pub struct sockaddr_un { ++ pub sun_len: u8, ++ pub sun_family: sa_family_t, ++ pub sun_path: [c_char; 104], ++ } ++ ++ pub struct sockaddr_storage { ++ pub ss_len: u8, ++ pub ss_family: sa_family_t, ++ __ss_pad1: [c_char; 6], ++ __ss_align: i64, ++ __ss_pad2: [c_char; 112], ++ } ++ ++ pub struct utsname { ++ pub sysname: [c_char; _SYSNAME_SIZE], ++ pub nodename: [c_char; _SYSNAME_SIZE], ++ pub release: [c_char; _SYSNAME_SIZE], ++ pub version: [c_char; _SYSNAME_SIZE], ++ pub machine: [c_char; _SYSNAME_SIZE], ++ } ++ ++ pub struct sigevent { ++ pub sigev_notify: c_int, ++ pub __padding1: c_int, ++ pub sigev_signo: c_int, // union ++ pub __padding2: c_int, ++ pub sigev_value: crate::sigval, ++ __sigev_un2: usize, // union ++ } ++ pub struct dirent { ++ pub d_ino: crate::ino_t, ++ pub d_offset: off_t, ++ pub d_reclen: c_short, ++ pub d_namelen: c_short, ++ pub d_name: [c_char; 1], // flex array ++ } ++ ++ pub struct sigset_t { ++ __val: [u32; 2], ++ } ++ ++ pub struct mq_attr { ++ pub mq_maxmsg: c_long, ++ pub mq_msgsize: c_long, ++ pub mq_flags: c_long, ++ pub mq_curmsgs: c_long, ++ pub mq_sendwait: c_long, ++ pub mq_recvwait: c_long, ++ } ++ ++ pub struct msg { ++ pub msg_next: *mut crate::msg, ++ pub msg_type: c_long, ++ pub msg_ts: c_ushort, ++ pub msg_spot: c_short, ++ _pad: [u8; 4], ++ } ++ ++ pub struct msqid_ds { ++ pub msg_perm: crate::ipc_perm, ++ pub msg_first: *mut crate::msg, ++ pub msg_last: *mut crate::msg, ++ pub msg_cbytes: crate::msglen_t, ++ pub msg_qnum: crate::msgqnum_t, ++ pub msg_qbytes: crate::msglen_t, ++ pub msg_lspid: crate::pid_t, ++ pub msg_lrpid: crate::pid_t, ++ pub msg_stime: crate::time_t, ++ msg_pad1: c_long, ++ pub msg_rtime: crate::time_t, ++ msg_pad2: c_long, ++ pub msg_ctime: crate::time_t, ++ msg_pad3: c_long, ++ msg_pad4: [c_long; 4], ++ } ++ ++ pub struct sockaddr_dl { ++ pub sdl_len: c_uchar, ++ pub sdl_family: crate::sa_family_t, ++ pub sdl_index: u16, ++ pub sdl_type: c_uchar, ++ pub sdl_nlen: c_uchar, ++ pub sdl_alen: c_uchar, ++ pub sdl_slen: c_uchar, ++ pub sdl_data: [c_char; 12], ++ } ++ ++ pub struct sync_t { ++ __u: c_uint, // union ++ pub __owner: c_uint, ++ } ++ ++ #[repr(align(4))] ++ pub struct pthread_barrier_t { ++ // union ++ __pad: [u8; 28], // union ++ } ++ ++ pub struct pthread_rwlock_t { ++ pub __active: c_int, ++ pub __blockedwriters: c_int, ++ pub __blockedreaders: c_int, ++ pub __heavy: c_int, ++ pub __lock: crate::pthread_mutex_t, // union ++ pub __rcond: crate::pthread_cond_t, // union ++ pub __wcond: crate::pthread_cond_t, // union ++ pub __owner: c_uint, ++ pub __spare: c_uint, ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ // sigevent ++ impl PartialEq for sigevent { ++ fn eq(&self, other: &sigevent) -> bool { ++ self.sigev_notify == other.sigev_notify ++ && self.sigev_signo == other.sigev_signo ++ && self.sigev_value == other.sigev_value ++ && self.__sigev_un2 == other.__sigev_un2 ++ } ++ } ++ impl Eq for sigevent {} ++ impl fmt::Debug for sigevent { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sigevent") ++ .field("sigev_notify", &self.sigev_notify) ++ .field("sigev_signo", &self.sigev_signo) ++ .field("sigev_value", &self.sigev_value) ++ .field("__sigev_un2", &self.__sigev_un2) ++ .finish() ++ } ++ } ++ impl hash::Hash for sigevent { ++ fn hash(&self, state: &mut H) { ++ self.sigev_notify.hash(state); ++ self.sigev_signo.hash(state); ++ self.sigev_value.hash(state); ++ self.__sigev_un2.hash(state); ++ } ++ } ++ ++ impl PartialEq for sockaddr_un { ++ fn eq(&self, other: &sockaddr_un) -> bool { ++ self.sun_len == other.sun_len ++ && self.sun_family == other.sun_family ++ && self ++ .sun_path ++ .iter() ++ .zip(other.sun_path.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for sockaddr_un {} ++ impl fmt::Debug for sockaddr_un { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sockaddr_un") ++ .field("sun_len", &self.sun_len) ++ .field("sun_family", &self.sun_family) ++ // FIXME: .field("sun_path", &self.sun_path) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for sockaddr_un { ++ fn hash(&self, state: &mut H) { ++ self.sun_len.hash(state); ++ self.sun_family.hash(state); ++ self.sun_path.hash(state); ++ } ++ } ++ ++ // sigset_t ++ impl PartialEq for sigset_t { ++ fn eq(&self, other: &sigset_t) -> bool { ++ self.__val == other.__val ++ } ++ } ++ impl Eq for sigset_t {} ++ impl fmt::Debug for sigset_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sigset_t") ++ .field("__val", &self.__val) ++ .finish() ++ } ++ } ++ impl hash::Hash for sigset_t { ++ fn hash(&self, state: &mut H) { ++ self.__val.hash(state); ++ } ++ } ++ ++ // msg ++ impl fmt::Debug for msg { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("msg") ++ .field("msg_next", &self.msg_next) ++ .field("msg_type", &self.msg_type) ++ .field("msg_ts", &self.msg_ts) ++ .field("msg_spot", &self.msg_spot) ++ .finish() ++ } ++ } ++ ++ // msqid_ds ++ impl fmt::Debug for msqid_ds { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("msqid_ds") ++ .field("msg_perm", &self.msg_perm) ++ .field("msg_first", &self.msg_first) ++ .field("msg_cbytes", &self.msg_cbytes) ++ .field("msg_qnum", &self.msg_qnum) ++ .field("msg_qbytes", &self.msg_qbytes) ++ .field("msg_lspid", &self.msg_lspid) ++ .field("msg_lrpid", &self.msg_lrpid) ++ .field("msg_stime", &self.msg_stime) ++ .field("msg_rtime", &self.msg_rtime) ++ .field("msg_ctime", &self.msg_ctime) ++ .finish() ++ } ++ } ++ ++ // sockaddr_dl ++ impl fmt::Debug for sockaddr_dl { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sockaddr_dl") ++ .field("sdl_len", &self.sdl_len) ++ .field("sdl_family", &self.sdl_family) ++ .field("sdl_index", &self.sdl_index) ++ .field("sdl_type", &self.sdl_type) ++ .field("sdl_nlen", &self.sdl_nlen) ++ .field("sdl_alen", &self.sdl_alen) ++ .field("sdl_slen", &self.sdl_slen) ++ .field("sdl_data", &self.sdl_data) ++ .finish() ++ } ++ } ++ impl PartialEq for sockaddr_dl { ++ fn eq(&self, other: &sockaddr_dl) -> bool { ++ self.sdl_len == other.sdl_len ++ && self.sdl_family == other.sdl_family ++ && self.sdl_index == other.sdl_index ++ && self.sdl_type == other.sdl_type ++ && self.sdl_nlen == other.sdl_nlen ++ && self.sdl_alen == other.sdl_alen ++ && self.sdl_slen == other.sdl_slen ++ && self ++ .sdl_data ++ .iter() ++ .zip(other.sdl_data.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for sockaddr_dl {} ++ impl hash::Hash for sockaddr_dl { ++ fn hash(&self, state: &mut H) { ++ self.sdl_len.hash(state); ++ self.sdl_family.hash(state); ++ self.sdl_index.hash(state); ++ self.sdl_type.hash(state); ++ self.sdl_nlen.hash(state); ++ self.sdl_alen.hash(state); ++ self.sdl_slen.hash(state); ++ self.sdl_data.hash(state); ++ } ++ } ++ ++ // sync_t ++ impl fmt::Debug for sync_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sync_t") ++ .field("__owner", &self.__owner) ++ .field("__u", &self.__u) ++ .finish() ++ } ++ } ++ ++ // pthread_barrier_t ++ impl fmt::Debug for pthread_barrier_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("pthread_barrier_t") ++ .field("__pad", &self.__pad) ++ .finish() ++ } ++ } ++ ++ // pthread_rwlock_t ++ impl fmt::Debug for pthread_rwlock_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("pthread_rwlock_t") ++ .field("__active", &self.__active) ++ .field("__blockedwriters", &self.__blockedwriters) ++ .field("__blockedreaders", &self.__blockedreaders) ++ .field("__heavy", &self.__heavy) ++ .field("__lock", &self.__lock) ++ .field("__rcond", &self.__rcond) ++ .field("__wcond", &self.__wcond) ++ .field("__owner", &self.__owner) ++ .field("__spare", &self.__spare) ++ .finish() ++ } ++ } ++ ++ // syspage_entry ++ impl fmt::Debug for syspage_entry { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("syspage_entry") ++ .field("size", &self.size) ++ .field("total_size", &self.total_size) ++ .field("type_", &self.type_) ++ .field("num_cpu", &self.num_cpu) ++ .field("system_private", &self.system_private) ++ .field("old_asinfo", &self.old_asinfo) ++ .field("hwinfo", &self.hwinfo) ++ .field("old_cpuinfo", &self.old_cpuinfo) ++ .field("old_cacheattr", &self.old_cacheattr) ++ .field("qtime", &self.qtime) ++ .field("callout", &self.callout) ++ .field("callin", &self.callin) ++ .field("typed_strings", &self.typed_strings) ++ .field("strings", &self.strings) ++ .field("old_intrinfo", &self.old_intrinfo) ++ .field("smp", &self.smp) ++ .field("pminfo", &self.pminfo) ++ .field("old_mdriver", &self.old_mdriver) ++ .field("new_asinfo", &self.new_asinfo) ++ .field("new_cpuinfo", &self.new_cpuinfo) ++ .field("new_cacheattr", &self.new_cacheattr) ++ .field("new_intrinfo", &self.new_intrinfo) ++ .field("new_mdriver", &self.new_mdriver) ++ .finish() ++ } ++ } ++ ++ impl PartialEq for utsname { ++ fn eq(&self, other: &utsname) -> bool { ++ self.sysname ++ .iter() ++ .zip(other.sysname.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .nodename ++ .iter() ++ .zip(other.nodename.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .release ++ .iter() ++ .zip(other.release.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .version ++ .iter() ++ .zip(other.version.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .machine ++ .iter() ++ .zip(other.machine.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ ++ impl Eq for utsname {} ++ ++ impl fmt::Debug for utsname { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("utsname") ++ // FIXME: .field("sysname", &self.sysname) ++ // FIXME: .field("nodename", &self.nodename) ++ // FIXME: .field("release", &self.release) ++ // FIXME: .field("version", &self.version) ++ // FIXME: .field("machine", &self.machine) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for utsname { ++ fn hash(&self, state: &mut H) { ++ self.sysname.hash(state); ++ self.nodename.hash(state); ++ self.release.hash(state); ++ self.version.hash(state); ++ self.machine.hash(state); ++ } ++ } ++ ++ impl PartialEq for mq_attr { ++ fn eq(&self, other: &mq_attr) -> bool { ++ self.mq_maxmsg == other.mq_maxmsg ++ && self.mq_msgsize == other.mq_msgsize ++ && self.mq_flags == other.mq_flags ++ && self.mq_curmsgs == other.mq_curmsgs ++ && self.mq_msgsize == other.mq_msgsize ++ && self.mq_sendwait == other.mq_sendwait ++ && self.mq_recvwait == other.mq_recvwait ++ } ++ } ++ ++ impl Eq for mq_attr {} ++ ++ impl fmt::Debug for mq_attr { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("mq_attr") ++ .field("mq_maxmsg", &self.mq_maxmsg) ++ .field("mq_msgsize", &self.mq_msgsize) ++ .field("mq_flags", &self.mq_flags) ++ .field("mq_curmsgs", &self.mq_curmsgs) ++ .field("mq_msgsize", &self.mq_msgsize) ++ .field("mq_sendwait", &self.mq_sendwait) ++ .field("mq_recvwait", &self.mq_recvwait) ++ .finish() ++ } ++ } ++ impl hash::Hash for mq_attr { ++ fn hash(&self, state: &mut H) { ++ self.mq_maxmsg.hash(state); ++ self.mq_msgsize.hash(state); ++ self.mq_flags.hash(state); ++ self.mq_curmsgs.hash(state); ++ self.mq_sendwait.hash(state); ++ self.mq_recvwait.hash(state); ++ } ++ } ++ ++ impl PartialEq for sockaddr_storage { ++ fn eq(&self, other: &sockaddr_storage) -> bool { ++ self.ss_len == other.ss_len ++ && self.ss_family == other.ss_family ++ && self.__ss_pad1 == other.__ss_pad1 ++ && self.__ss_align == other.__ss_align ++ && self ++ .__ss_pad2 ++ .iter() ++ .zip(other.__ss_pad2.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ ++ impl Eq for sockaddr_storage {} ++ ++ impl fmt::Debug for sockaddr_storage { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sockaddr_storage") ++ .field("ss_len", &self.ss_len) ++ .field("ss_family", &self.ss_family) ++ .field("__ss_pad1", &self.__ss_pad1) ++ .field("__ss_align", &self.__ss_align) ++ // FIXME: .field("__ss_pad2", &self.__ss_pad2) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for sockaddr_storage { ++ fn hash(&self, state: &mut H) { ++ self.ss_len.hash(state); ++ self.ss_family.hash(state); ++ self.__ss_pad1.hash(state); ++ self.__ss_align.hash(state); ++ self.__ss_pad2.hash(state); ++ } ++ } ++ ++ impl PartialEq for dirent { ++ fn eq(&self, other: &dirent) -> bool { ++ self.d_ino == other.d_ino ++ && self.d_offset == other.d_offset ++ && self.d_reclen == other.d_reclen ++ && self.d_namelen == other.d_namelen ++ && self.d_name[..self.d_namelen as _] ++ .iter() ++ .zip(other.d_name.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ ++ impl Eq for dirent {} ++ ++ impl fmt::Debug for dirent { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("dirent") ++ .field("d_ino", &self.d_ino) ++ .field("d_offset", &self.d_offset) ++ .field("d_reclen", &self.d_reclen) ++ .field("d_namelen", &self.d_namelen) ++ .field("d_name", &&self.d_name[..self.d_namelen as _]) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for dirent { ++ fn hash(&self, state: &mut H) { ++ self.d_ino.hash(state); ++ self.d_offset.hash(state); ++ self.d_reclen.hash(state); ++ self.d_namelen.hash(state); ++ self.d_name[..self.d_namelen as _].hash(state); ++ } ++ } ++ } ++} ++ ++pub const _SYSNAME_SIZE: usize = 256 + 1; ++pub const RLIM_INFINITY: crate::rlim_t = 0xfffffffffffffffd; ++pub const O_LARGEFILE: c_int = 0o0100000; ++ ++// intentionally not public, only used for fd_set ++cfg_if! { ++ if #[cfg(target_pointer_width = "32")] { ++ const ULONG_SIZE: usize = 32; ++ } else if #[cfg(target_pointer_width = "64")] { ++ const ULONG_SIZE: usize = 64; ++ } else { ++ // Unknown target_pointer_width ++ } ++} ++ ++pub const EXIT_FAILURE: c_int = 1; ++pub const EXIT_SUCCESS: c_int = 0; ++pub const RAND_MAX: c_int = 32767; ++pub const EOF: c_int = -1; ++pub const SEEK_SET: c_int = 0; ++pub const SEEK_CUR: c_int = 1; ++pub const SEEK_END: c_int = 2; ++pub const _IOFBF: c_int = 0; ++pub const _IONBF: c_int = 2; ++pub const _IOLBF: c_int = 1; ++ ++pub const F_DUPFD: c_int = 0; ++pub const F_GETFD: c_int = 1; ++pub const F_SETFD: c_int = 2; ++pub const F_GETFL: c_int = 3; ++pub const F_SETFL: c_int = 4; ++ ++pub const F_DUPFD_CLOEXEC: c_int = 5; ++ ++pub const SIGTRAP: c_int = 5; ++ ++pub const CLOCK_REALTIME: crate::clockid_t = 0; ++pub const CLOCK_MONOTONIC: crate::clockid_t = 2; ++pub const CLOCK_PROCESS_CPUTIME_ID: crate::clockid_t = 3; ++pub const CLOCK_THREAD_CPUTIME_ID: crate::clockid_t = 4; ++pub const TIMER_ABSTIME: c_uint = 0x80000000; ++ ++pub const RUSAGE_SELF: c_int = 0; ++ ++pub const F_OK: c_int = 0; ++pub const X_OK: c_int = 1; ++pub const W_OK: c_int = 2; ++pub const R_OK: c_int = 4; ++ ++pub const STDIN_FILENO: c_int = 0; ++pub const STDOUT_FILENO: c_int = 1; ++pub const STDERR_FILENO: c_int = 2; ++ ++pub const SIGHUP: c_int = 1; ++pub const SIGINT: c_int = 2; ++pub const SIGQUIT: c_int = 3; ++pub const SIGILL: c_int = 4; ++pub const SIGABRT: c_int = 6; ++pub const SIGFPE: c_int = 8; ++pub const SIGKILL: c_int = 9; ++pub const SIGSEGV: c_int = 11; ++pub const SIGPIPE: c_int = 13; ++pub const SIGALRM: c_int = 14; ++pub const SIGTERM: c_int = 15; ++ ++pub const PROT_NONE: c_int = 0x00000000; ++pub const PROT_READ: c_int = 0x00000100; ++pub const PROT_WRITE: c_int = 0x00000200; ++pub const PROT_EXEC: c_int = 0x00000400; ++ ++pub const MAP_FILE: c_int = 0; ++pub const MAP_SHARED: c_int = 1; ++pub const MAP_PRIVATE: c_int = 2; ++pub const MAP_FIXED: c_int = 0x10; ++ ++pub const MAP_FAILED: *mut c_void = !0 as *mut c_void; ++ ++pub const MS_ASYNC: c_int = 1; ++pub const MS_INVALIDATE: c_int = 4; ++pub const MS_SYNC: c_int = 2; ++ ++pub const SCM_RIGHTS: c_int = 0x01; ++pub const SCM_TIMESTAMP: c_int = 0x02; ++pub const SCM_CREDS: c_int = 0x04; ++ ++pub const MAP_TYPE: c_int = 0x3; ++ ++pub const IFF_UP: c_int = 0x00000001; ++pub const IFF_BROADCAST: c_int = 0x00000002; ++pub const IFF_DEBUG: c_int = 0x00000004; ++pub const IFF_LOOPBACK: c_int = 0x00000008; ++pub const IFF_POINTOPOINT: c_int = 0x00000010; ++pub const IFF_NOTRAILERS: c_int = 0x00000020; ++pub const IFF_RUNNING: c_int = 0x00000040; ++pub const IFF_NOARP: c_int = 0x00000080; ++pub const IFF_PROMISC: c_int = 0x00000100; ++pub const IFF_ALLMULTI: c_int = 0x00000200; ++pub const IFF_MULTICAST: c_int = 0x00008000; ++ ++pub const AF_UNSPEC: c_int = 0; ++pub const AF_UNIX: c_int = AF_LOCAL; ++pub const AF_LOCAL: c_int = 1; ++pub const AF_INET: c_int = 2; ++pub const AF_IPX: c_int = 23; ++pub const AF_APPLETALK: c_int = 16; ++pub const AF_INET6: c_int = 24; ++pub const AF_ROUTE: c_int = 17; ++pub const AF_SNA: c_int = 11; ++pub const AF_BLUETOOTH: c_int = 31; ++pub const AF_ISDN: c_int = 26; ++ ++pub const PF_UNSPEC: c_int = AF_UNSPEC; ++pub const PF_UNIX: c_int = PF_LOCAL; ++pub const PF_LOCAL: c_int = AF_LOCAL; ++pub const PF_INET: c_int = AF_INET; ++pub const PF_IPX: c_int = AF_IPX; ++pub const PF_APPLETALK: c_int = AF_APPLETALK; ++pub const PF_INET6: c_int = AF_INET6; ++pub const pseudo_AF_KEY: c_int = 29; ++pub const PF_KEY: c_int = pseudo_AF_KEY; ++pub const PF_ROUTE: c_int = AF_ROUTE; ++pub const PF_SNA: c_int = AF_SNA; ++ ++pub const PF_BLUETOOTH: c_int = AF_BLUETOOTH; ++pub const PF_ISDN: c_int = AF_ISDN; ++ ++pub const SOMAXCONN: c_int = 128; ++ ++pub const MSG_OOB: c_int = 0x0001; ++pub const MSG_PEEK: c_int = 0x0002; ++pub const MSG_DONTROUTE: c_int = 0x0004; ++pub const MSG_CTRUNC: c_int = 0x0020; ++pub const MSG_TRUNC: c_int = 0x0010; ++pub const MSG_DONTWAIT: c_int = 0x0080; ++pub const MSG_EOR: c_int = 0x0008; ++pub const MSG_WAITALL: c_int = 0x0040; ++pub const MSG_NOSIGNAL: c_int = 0x0800; ++pub const MSG_WAITFORONE: c_int = 0x2000; ++ ++pub const IP_TOS: c_int = 3; ++pub const IP_TTL: c_int = 4; ++pub const IP_HDRINCL: c_int = 2; ++pub const IP_OPTIONS: c_int = 1; ++pub const IP_RECVOPTS: c_int = 5; ++pub const IP_RETOPTS: c_int = 8; ++pub const IP_PKTINFO: c_int = 25; ++pub const IP_IPSEC_POLICY_COMPAT: c_int = 22; ++pub const IP_MULTICAST_IF: c_int = 9; ++pub const IP_MULTICAST_TTL: c_int = 10; ++pub const IP_MULTICAST_LOOP: c_int = 11; ++pub const IP_ADD_MEMBERSHIP: c_int = 12; ++pub const IP_DROP_MEMBERSHIP: c_int = 13; ++pub const IP_DEFAULT_MULTICAST_TTL: c_int = 1; ++pub const IP_DEFAULT_MULTICAST_LOOP: c_int = 1; ++ ++pub const IPPROTO_HOPOPTS: c_int = 0; ++pub const IPPROTO_IGMP: c_int = 2; ++pub const IPPROTO_IPIP: c_int = 4; ++pub const IPPROTO_EGP: c_int = 8; ++pub const IPPROTO_PUP: c_int = 12; ++pub const IPPROTO_IDP: c_int = 22; ++pub const IPPROTO_TP: c_int = 29; ++pub const IPPROTO_ROUTING: c_int = 43; ++pub const IPPROTO_FRAGMENT: c_int = 44; ++pub const IPPROTO_RSVP: c_int = 46; ++pub const IPPROTO_GRE: c_int = 47; ++pub const IPPROTO_ESP: c_int = 50; ++pub const IPPROTO_AH: c_int = 51; ++pub const IPPROTO_NONE: c_int = 59; ++pub const IPPROTO_DSTOPTS: c_int = 60; ++pub const IPPROTO_ENCAP: c_int = 98; ++pub const IPPROTO_PIM: c_int = 103; ++pub const IPPROTO_SCTP: c_int = 132; ++pub const IPPROTO_RAW: c_int = 255; ++pub const IPPROTO_MAX: c_int = 256; ++pub const IPPROTO_CARP: c_int = 112; ++pub const IPPROTO_DIVERT: c_int = 259; ++pub const IPPROTO_DONE: c_int = 257; ++pub const IPPROTO_EON: c_int = 80; ++pub const IPPROTO_ETHERIP: c_int = 97; ++pub const IPPROTO_GGP: c_int = 3; ++pub const IPPROTO_IPCOMP: c_int = 108; ++pub const IPPROTO_MOBILE: c_int = 55; ++ ++pub const IPV6_RTHDR_LOOSE: c_int = 0; ++pub const IPV6_RTHDR_STRICT: c_int = 1; ++pub const IPV6_UNICAST_HOPS: c_int = 4; ++pub const IPV6_MULTICAST_IF: c_int = 9; ++pub const IPV6_MULTICAST_HOPS: c_int = 10; ++pub const IPV6_MULTICAST_LOOP: c_int = 11; ++pub const IPV6_JOIN_GROUP: c_int = 12; ++pub const IPV6_LEAVE_GROUP: c_int = 13; ++pub const IPV6_CHECKSUM: c_int = 26; ++pub const IPV6_V6ONLY: c_int = 27; ++pub const IPV6_IPSEC_POLICY_COMPAT: c_int = 28; ++pub const IPV6_RTHDRDSTOPTS: c_int = 35; ++pub const IPV6_RECVPKTINFO: c_int = 36; ++pub const IPV6_RECVHOPLIMIT: c_int = 37; ++pub const IPV6_RECVRTHDR: c_int = 38; ++pub const IPV6_RECVHOPOPTS: c_int = 39; ++pub const IPV6_RECVDSTOPTS: c_int = 40; ++pub const IPV6_RECVPATHMTU: c_int = 43; ++pub const IPV6_PATHMTU: c_int = 44; ++pub const IPV6_PKTINFO: c_int = 46; ++pub const IPV6_HOPLIMIT: c_int = 47; ++pub const IPV6_NEXTHOP: c_int = 48; ++pub const IPV6_HOPOPTS: c_int = 49; ++pub const IPV6_DSTOPTS: c_int = 50; ++pub const IPV6_RECVTCLASS: c_int = 57; ++pub const IPV6_TCLASS: c_int = 61; ++pub const IPV6_DONTFRAG: c_int = 62; ++ ++pub const TCP_NODELAY: c_int = 0x01; ++pub const TCP_MAXSEG: c_int = 0x02; ++pub const TCP_MD5SIG: c_int = 0x10; ++pub const TCP_KEEPALIVE: c_int = 0x04; ++ ++pub const SHUT_RD: c_int = 0; ++pub const SHUT_WR: c_int = 1; ++pub const SHUT_RDWR: c_int = 2; ++ ++pub const LOCK_SH: c_int = 0x1; ++pub const LOCK_EX: c_int = 0x2; ++pub const LOCK_NB: c_int = 0x4; ++pub const LOCK_UN: c_int = 0x8; ++ ++pub const SS_ONSTACK: c_int = 1; ++pub const SS_DISABLE: c_int = 2; ++ ++pub const PATH_MAX: c_int = 1024; ++ ++pub const UIO_MAXIOV: c_int = 1024; ++ ++pub const FD_SETSIZE: usize = 256; ++ ++pub const TCIOFF: c_int = 0x0002; ++pub const TCION: c_int = 0x0003; ++pub const TCOOFF: c_int = 0x0000; ++pub const TCOON: c_int = 0x0001; ++pub const TCIFLUSH: c_int = 0; ++pub const TCOFLUSH: c_int = 1; ++pub const TCIOFLUSH: c_int = 2; ++pub const NL0: crate::tcflag_t = 0x000; ++pub const NL1: crate::tcflag_t = 0x100; ++pub const TAB0: crate::tcflag_t = 0x0000; ++pub const CR0: crate::tcflag_t = 0x000; ++pub const FF0: crate::tcflag_t = 0x0000; ++pub const BS0: crate::tcflag_t = 0x0000; ++pub const VT0: crate::tcflag_t = 0x0000; ++pub const VERASE: usize = 2; ++pub const VKILL: usize = 3; ++pub const VINTR: usize = 0; ++pub const VQUIT: usize = 1; ++pub const VLNEXT: usize = 15; ++pub const IGNBRK: crate::tcflag_t = 0x00000001; ++pub const BRKINT: crate::tcflag_t = 0x00000002; ++pub const IGNPAR: crate::tcflag_t = 0x00000004; ++pub const PARMRK: crate::tcflag_t = 0x00000008; ++pub const INPCK: crate::tcflag_t = 0x00000010; ++pub const ISTRIP: crate::tcflag_t = 0x00000020; ++pub const INLCR: crate::tcflag_t = 0x00000040; ++pub const IGNCR: crate::tcflag_t = 0x00000080; ++pub const ICRNL: crate::tcflag_t = 0x00000100; ++pub const IXANY: crate::tcflag_t = 0x00000800; ++pub const IMAXBEL: crate::tcflag_t = 0x00002000; ++pub const OPOST: crate::tcflag_t = 0x00000001; ++pub const CS5: crate::tcflag_t = 0x00; ++pub const ECHO: crate::tcflag_t = 0x00000008; ++pub const OCRNL: crate::tcflag_t = 0x00000008; ++pub const ONOCR: crate::tcflag_t = 0x00000010; ++pub const ONLRET: crate::tcflag_t = 0x00000020; ++pub const OFILL: crate::tcflag_t = 0x00000040; ++pub const OFDEL: crate::tcflag_t = 0x00000080; ++ ++pub const WNOHANG: c_int = 0x0040; ++pub const WUNTRACED: c_int = 0x0004; ++pub const WSTOPPED: c_int = WUNTRACED; ++pub const WEXITED: c_int = 0x0001; ++pub const WCONTINUED: c_int = 0x0008; ++pub const WNOWAIT: c_int = 0x0080; ++pub const WTRAPPED: c_int = 0x0002; ++ ++pub const RTLD_LOCAL: c_int = 0x0200; ++pub const RTLD_LAZY: c_int = 0x0001; ++ ++pub const POSIX_FADV_NORMAL: c_int = 0; ++pub const POSIX_FADV_RANDOM: c_int = 2; ++pub const POSIX_FADV_SEQUENTIAL: c_int = 1; ++pub const POSIX_FADV_WILLNEED: c_int = 3; ++ ++pub const AT_FDCWD: c_int = -100; ++pub const AT_EACCESS: c_int = 0x0001; ++pub const AT_SYMLINK_NOFOLLOW: c_int = 0x0002; ++pub const AT_SYMLINK_FOLLOW: c_int = 0x0004; ++pub const AT_REMOVEDIR: c_int = 0x0008; ++ ++pub const LOG_CRON: c_int = 9 << 3; ++pub const LOG_AUTHPRIV: c_int = 10 << 3; ++pub const LOG_FTP: c_int = 11 << 3; ++pub const LOG_PERROR: c_int = 0x20; ++ ++pub const PIPE_BUF: usize = 5120; ++ ++pub const CLD_EXITED: c_int = 1; ++pub const CLD_KILLED: c_int = 2; ++pub const CLD_DUMPED: c_int = 3; ++pub const CLD_TRAPPED: c_int = 4; ++pub const CLD_STOPPED: c_int = 5; ++pub const CLD_CONTINUED: c_int = 6; ++ ++pub const UTIME_OMIT: c_long = 0x40000002; ++pub const UTIME_NOW: c_long = 0x40000001; ++ ++pub const POLLIN: c_short = POLLRDNORM | POLLRDBAND; ++pub const POLLPRI: c_short = 0x0008; ++pub const POLLOUT: c_short = 0x0002; ++pub const POLLERR: c_short = 0x0020; ++pub const POLLHUP: c_short = 0x0040; ++pub const POLLNVAL: c_short = 0x1000; ++pub const POLLRDNORM: c_short = 0x0001; ++pub const POLLRDBAND: c_short = 0x0004; ++ ++pub const IPTOS_LOWDELAY: u8 = 0x10; ++pub const IPTOS_THROUGHPUT: u8 = 0x08; ++pub const IPTOS_RELIABILITY: u8 = 0x04; ++pub const IPTOS_MINCOST: u8 = 0x02; ++ ++pub const IPTOS_PREC_NETCONTROL: u8 = 0xe0; ++pub const IPTOS_PREC_INTERNETCONTROL: u8 = 0xc0; ++pub const IPTOS_PREC_CRITIC_ECP: u8 = 0xa0; ++pub const IPTOS_PREC_FLASHOVERRIDE: u8 = 0x80; ++pub const IPTOS_PREC_FLASH: u8 = 0x60; ++pub const IPTOS_PREC_IMMEDIATE: u8 = 0x40; ++pub const IPTOS_PREC_PRIORITY: u8 = 0x20; ++pub const IPTOS_PREC_ROUTINE: u8 = 0x00; ++ ++pub const IPTOS_ECN_MASK: u8 = 0x03; ++pub const IPTOS_ECN_ECT1: u8 = 0x01; ++pub const IPTOS_ECN_ECT0: u8 = 0x02; ++pub const IPTOS_ECN_CE: u8 = 0x03; ++ ++pub const IPOPT_CONTROL: u8 = 0x00; ++pub const IPOPT_RESERVED1: u8 = 0x20; ++pub const IPOPT_RESERVED2: u8 = 0x60; ++pub const IPOPT_LSRR: u8 = 131; ++pub const IPOPT_RR: u8 = 7; ++pub const IPOPT_SSRR: u8 = 137; ++pub const IPDEFTTL: u8 = 64; ++pub const IPOPT_OPTVAL: u8 = 0; ++pub const IPOPT_OLEN: u8 = 1; ++pub const IPOPT_OFFSET: u8 = 2; ++pub const IPOPT_MINOFF: u8 = 4; ++pub const IPOPT_NOP: u8 = 1; ++pub const IPOPT_EOL: u8 = 0; ++pub const IPOPT_TS: u8 = 68; ++pub const IPOPT_TS_TSONLY: u8 = 0; ++pub const IPOPT_TS_TSANDADDR: u8 = 1; ++pub const IPOPT_TS_PRESPEC: u8 = 3; ++ ++pub const MAX_IPOPTLEN: u8 = 40; ++pub const IPVERSION: u8 = 4; ++pub const MAXTTL: u8 = 255; ++ ++pub const ARPHRD_ETHER: u16 = 1; ++pub const ARPHRD_IEEE802: u16 = 6; ++pub const ARPHRD_ARCNET: u16 = 7; ++pub const ARPHRD_IEEE1394: u16 = 24; ++ ++pub const SOL_SOCKET: c_int = 0xffff; ++ ++pub const SO_DEBUG: c_int = 0x0001; ++pub const SO_REUSEADDR: c_int = 0x0004; ++pub const SO_TYPE: c_int = 0x1008; ++pub const SO_ERROR: c_int = 0x1007; ++pub const SO_DONTROUTE: c_int = 0x0010; ++pub const SO_BROADCAST: c_int = 0x0020; ++pub const SO_SNDBUF: c_int = 0x1001; ++pub const SO_RCVBUF: c_int = 0x1002; ++pub const SO_KEEPALIVE: c_int = 0x0008; ++pub const SO_OOBINLINE: c_int = 0x0100; ++pub const SO_LINGER: c_int = 0x0080; ++pub const SO_REUSEPORT: c_int = 0x0200; ++pub const SO_RCVLOWAT: c_int = 0x1004; ++pub const SO_SNDLOWAT: c_int = 0x1003; ++pub const SO_RCVTIMEO: c_int = 0x1006; ++pub const SO_SNDTIMEO: c_int = 0x1005; ++pub const SO_BINDTODEVICE: c_int = 0x0800; ++pub const SO_TIMESTAMP: c_int = 0x0400; ++pub const SO_ACCEPTCONN: c_int = 0x0002; ++ ++pub const TIOCM_LE: c_int = 0x0100; ++pub const TIOCM_DTR: c_int = 0x0001; ++pub const TIOCM_RTS: c_int = 0x0002; ++pub const TIOCM_ST: c_int = 0x0200; ++pub const TIOCM_SR: c_int = 0x0400; ++pub const TIOCM_CTS: c_int = 0x1000; ++pub const TIOCM_CAR: c_int = TIOCM_CD; ++pub const TIOCM_CD: c_int = 0x8000; ++pub const TIOCM_RNG: c_int = TIOCM_RI; ++pub const TIOCM_RI: c_int = 0x4000; ++pub const TIOCM_DSR: c_int = 0x2000; ++ ++pub const SCHED_OTHER: c_int = 3; ++pub const SCHED_FIFO: c_int = 1; ++pub const SCHED_RR: c_int = 2; ++ ++pub const IPC_PRIVATE: crate::key_t = 0; ++ ++pub const IPC_CREAT: c_int = 0o001000; ++pub const IPC_EXCL: c_int = 0o002000; ++pub const IPC_NOWAIT: c_int = 0o004000; ++ ++pub const IPC_RMID: c_int = 0; ++pub const IPC_SET: c_int = 1; ++pub const IPC_STAT: c_int = 2; ++ ++pub const MSG_NOERROR: c_int = 0o010000; ++ ++pub const LOG_NFACILITIES: c_int = 24; ++ ++pub const SEM_FAILED: *mut crate::sem_t = 0xFFFFFFFFFFFFFFFF as *mut sem_t; ++ ++pub const AI_PASSIVE: c_int = 0x00000001; ++pub const AI_CANONNAME: c_int = 0x00000002; ++pub const AI_NUMERICHOST: c_int = 0x00000004; ++ ++pub const AI_NUMERICSERV: c_int = 0x00000008; ++ ++pub const EAI_BADFLAGS: c_int = 3; ++pub const EAI_NONAME: c_int = 8; ++pub const EAI_AGAIN: c_int = 2; ++pub const EAI_FAIL: c_int = 4; ++pub const EAI_NODATA: c_int = 7; ++pub const EAI_FAMILY: c_int = 5; ++pub const EAI_SOCKTYPE: c_int = 10; ++pub const EAI_SERVICE: c_int = 9; ++pub const EAI_MEMORY: c_int = 6; ++pub const EAI_SYSTEM: c_int = 11; ++pub const EAI_OVERFLOW: c_int = 14; ++ ++pub const NI_NUMERICHOST: c_int = 0x00000002; ++pub const NI_NUMERICSERV: c_int = 0x00000008; ++pub const NI_NOFQDN: c_int = 0x00000001; ++pub const NI_NAMEREQD: c_int = 0x00000004; ++pub const NI_DGRAM: c_int = 0x00000010; ++ ++pub const AIO_CANCELED: c_int = 0; ++pub const AIO_NOTCANCELED: c_int = 2; ++pub const AIO_ALLDONE: c_int = 1; ++pub const LIO_READ: c_int = 1; ++pub const LIO_WRITE: c_int = 2; ++pub const LIO_NOP: c_int = 0; ++pub const LIO_WAIT: c_int = 1; ++pub const LIO_NOWAIT: c_int = 0; ++ ++pub const ITIMER_REAL: c_int = 0; ++pub const ITIMER_VIRTUAL: c_int = 1; ++pub const ITIMER_PROF: c_int = 2; ++ ++// DIFF(main): changed to `c_short` in f62eb023ab ++pub const POSIX_SPAWN_RESETIDS: c_int = 0x00000010; ++pub const POSIX_SPAWN_SETPGROUP: c_int = 0x00000001; ++pub const POSIX_SPAWN_SETSIGDEF: c_int = 0x00000004; ++pub const POSIX_SPAWN_SETSIGMASK: c_int = 0x00000002; ++pub const POSIX_SPAWN_SETSCHEDPARAM: c_int = 0x00000400; ++pub const POSIX_SPAWN_SETSCHEDULER: c_int = 0x00000040; ++ ++pub const IPTOS_ECN_NOT_ECT: u8 = 0x00; ++ ++pub const RTF_UP: c_ushort = 0x0001; ++pub const RTF_GATEWAY: c_ushort = 0x0002; ++ ++pub const RTF_HOST: c_ushort = 0x0004; ++pub const RTF_DYNAMIC: c_ushort = 0x0010; ++pub const RTF_MODIFIED: c_ushort = 0x0020; ++pub const RTF_REJECT: c_ushort = 0x0008; ++pub const RTF_STATIC: c_ushort = 0x0800; ++pub const RTF_XRESOLVE: c_ushort = 0x0200; ++pub const RTF_BROADCAST: u32 = 0x80000; ++pub const RTM_NEWADDR: u16 = 0xc; ++pub const RTM_DELADDR: u16 = 0xd; ++pub const RTA_DST: c_ushort = 0x1; ++pub const RTA_GATEWAY: c_ushort = 0x2; ++ ++pub const UDP_ENCAP: c_int = 100; ++ ++pub const IN_ACCESS: u32 = 0x00000001; ++pub const IN_MODIFY: u32 = 0x00000002; ++pub const IN_ATTRIB: u32 = 0x00000004; ++pub const IN_CLOSE_WRITE: u32 = 0x00000008; ++pub const IN_CLOSE_NOWRITE: u32 = 0x00000010; ++pub const IN_CLOSE: u32 = IN_CLOSE_WRITE | IN_CLOSE_NOWRITE; ++pub const IN_OPEN: u32 = 0x00000020; ++pub const IN_MOVED_FROM: u32 = 0x00000040; ++pub const IN_MOVED_TO: u32 = 0x00000080; ++pub const IN_MOVE: u32 = IN_MOVED_FROM | IN_MOVED_TO; ++pub const IN_CREATE: u32 = 0x00000100; ++pub const IN_DELETE: u32 = 0x00000200; ++pub const IN_DELETE_SELF: u32 = 0x00000400; ++pub const IN_MOVE_SELF: u32 = 0x00000800; ++pub const IN_UNMOUNT: u32 = 0x00002000; ++pub const IN_Q_OVERFLOW: u32 = 0x00004000; ++pub const IN_IGNORED: u32 = 0x00008000; ++pub const IN_ONLYDIR: u32 = 0x01000000; ++pub const IN_DONT_FOLLOW: u32 = 0x02000000; ++ ++pub const IN_ISDIR: u32 = 0x40000000; ++pub const IN_ONESHOT: u32 = 0x80000000; ++ ++pub const REG_EXTENDED: c_int = 0o0001; ++pub const REG_ICASE: c_int = 0o0002; ++pub const REG_NEWLINE: c_int = 0o0010; ++pub const REG_NOSUB: c_int = 0o0004; ++ ++pub const REG_NOTBOL: c_int = 0o00001; ++pub const REG_NOTEOL: c_int = 0o00002; ++ ++pub const REG_ENOSYS: c_int = 17; ++pub const REG_NOMATCH: c_int = 1; ++pub const REG_BADPAT: c_int = 2; ++pub const REG_ECOLLATE: c_int = 3; ++pub const REG_ECTYPE: c_int = 4; ++pub const REG_EESCAPE: c_int = 5; ++pub const REG_ESUBREG: c_int = 6; ++pub const REG_EBRACK: c_int = 7; ++pub const REG_EPAREN: c_int = 8; ++pub const REG_EBRACE: c_int = 9; ++pub const REG_BADBR: c_int = 10; ++pub const REG_ERANGE: c_int = 11; ++pub const REG_ESPACE: c_int = 12; ++pub const REG_BADRPT: c_int = 13; ++ ++// errno.h ++pub const EOK: c_int = 0; ++pub const EWOULDBLOCK: c_int = EAGAIN; ++pub const EPERM: c_int = 1; ++pub const ENOENT: c_int = 2; ++pub const ESRCH: c_int = 3; ++pub const EINTR: c_int = 4; ++pub const EIO: c_int = 5; ++pub const ENXIO: c_int = 6; ++pub const E2BIG: c_int = 7; ++pub const ENOEXEC: c_int = 8; ++pub const EBADF: c_int = 9; ++pub const ECHILD: c_int = 10; ++pub const EAGAIN: c_int = 11; ++pub const ENOMEM: c_int = 12; ++pub const EACCES: c_int = 13; ++pub const EFAULT: c_int = 14; ++pub const ENOTBLK: c_int = 15; ++pub const EBUSY: c_int = 16; ++pub const EEXIST: c_int = 17; ++pub const EXDEV: c_int = 18; ++pub const ENODEV: c_int = 19; ++pub const ENOTDIR: c_int = 20; ++pub const EISDIR: c_int = 21; ++pub const EINVAL: c_int = 22; ++pub const ENFILE: c_int = 23; ++pub const EMFILE: c_int = 24; ++pub const ENOTTY: c_int = 25; ++pub const ETXTBSY: c_int = 26; ++pub const EFBIG: c_int = 27; ++pub const ENOSPC: c_int = 28; ++pub const ESPIPE: c_int = 29; ++pub const EROFS: c_int = 30; ++pub const EMLINK: c_int = 31; ++pub const EPIPE: c_int = 32; ++pub const EDOM: c_int = 33; ++pub const ERANGE: c_int = 34; ++pub const ENOMSG: c_int = 35; ++pub const EIDRM: c_int = 36; ++pub const ECHRNG: c_int = 37; ++pub const EL2NSYNC: c_int = 38; ++pub const EL3HLT: c_int = 39; ++pub const EL3RST: c_int = 40; ++pub const ELNRNG: c_int = 41; ++pub const EUNATCH: c_int = 42; ++pub const ENOCSI: c_int = 43; ++pub const EL2HLT: c_int = 44; ++pub const EDEADLK: c_int = 45; ++pub const ENOLCK: c_int = 46; ++pub const ECANCELED: c_int = 47; ++pub const EDQUOT: c_int = 49; ++pub const EBADE: c_int = 50; ++pub const EBADR: c_int = 51; ++pub const EXFULL: c_int = 52; ++pub const ENOANO: c_int = 53; ++pub const EBADRQC: c_int = 54; ++pub const EBADSLT: c_int = 55; ++pub const EDEADLOCK: c_int = 56; ++pub const EBFONT: c_int = 57; ++pub const EOWNERDEAD: c_int = 58; ++pub const ENOSTR: c_int = 60; ++pub const ENODATA: c_int = 61; ++pub const ETIME: c_int = 62; ++pub const ENOSR: c_int = 63; ++pub const ENONET: c_int = 64; ++pub const ENOPKG: c_int = 65; ++pub const EREMOTE: c_int = 66; ++pub const ENOLINK: c_int = 67; ++pub const EADV: c_int = 68; ++pub const ESRMNT: c_int = 69; ++pub const ECOMM: c_int = 70; ++pub const EPROTO: c_int = 71; ++pub const EMULTIHOP: c_int = 74; ++pub const EBADMSG: c_int = 77; ++pub const ENAMETOOLONG: c_int = 78; ++pub const EOVERFLOW: c_int = 79; ++pub const ENOTUNIQ: c_int = 80; ++pub const EBADFD: c_int = 81; ++pub const EREMCHG: c_int = 82; ++pub const ELIBACC: c_int = 83; ++pub const ELIBBAD: c_int = 84; ++pub const ELIBSCN: c_int = 85; ++pub const ELIBMAX: c_int = 86; ++pub const ELIBEXEC: c_int = 87; ++pub const EILSEQ: c_int = 88; ++pub const ENOSYS: c_int = 89; ++pub const ELOOP: c_int = 90; ++pub const ERESTART: c_int = 91; ++pub const ESTRPIPE: c_int = 92; ++pub const ENOTEMPTY: c_int = 93; ++pub const EUSERS: c_int = 94; ++pub const ENOTRECOVERABLE: c_int = 95; ++pub const EOPNOTSUPP: c_int = 103; ++pub const EFPOS: c_int = 110; ++pub const ESTALE: c_int = 122; ++pub const EINPROGRESS: c_int = 236; ++pub const EALREADY: c_int = 237; ++pub const ENOTSOCK: c_int = 238; ++pub const EDESTADDRREQ: c_int = 239; ++pub const EMSGSIZE: c_int = 240; ++pub const EPROTOTYPE: c_int = 241; ++pub const ENOPROTOOPT: c_int = 242; ++pub const EPROTONOSUPPORT: c_int = 243; ++pub const ESOCKTNOSUPPORT: c_int = 244; ++pub const EPFNOSUPPORT: c_int = 246; ++pub const EAFNOSUPPORT: c_int = 247; ++pub const EADDRINUSE: c_int = 248; ++pub const EADDRNOTAVAIL: c_int = 249; ++pub const ENETDOWN: c_int = 250; ++pub const ENETUNREACH: c_int = 251; ++pub const ENETRESET: c_int = 252; ++pub const ECONNABORTED: c_int = 253; ++pub const ECONNRESET: c_int = 254; ++pub const ENOBUFS: c_int = 255; ++pub const EISCONN: c_int = 256; ++pub const ENOTCONN: c_int = 257; ++pub const ESHUTDOWN: c_int = 258; ++pub const ETOOMANYREFS: c_int = 259; ++pub const ETIMEDOUT: c_int = 260; ++pub const ECONNREFUSED: c_int = 261; ++pub const EHOSTDOWN: c_int = 264; ++pub const EHOSTUNREACH: c_int = 265; ++pub const EBADRPC: c_int = 272; ++pub const ERPCMISMATCH: c_int = 273; ++pub const EPROGUNAVAIL: c_int = 274; ++pub const EPROGMISMATCH: c_int = 275; ++pub const EPROCUNAVAIL: c_int = 276; ++pub const ENOREMOTE: c_int = 300; ++pub const ENONDP: c_int = 301; ++pub const EBADFSYS: c_int = 302; ++pub const EMORE: c_int = 309; ++pub const ECTRLTERM: c_int = 310; ++pub const ENOLIC: c_int = 311; ++pub const ESRVRFAULT: c_int = 312; ++pub const EENDIAN: c_int = 313; ++pub const ESECTYPEINVAL: c_int = 314; ++ ++pub const RUSAGE_CHILDREN: c_int = -1; ++pub const L_tmpnam: c_uint = 255; ++ ++pub const _PC_LINK_MAX: c_int = 1; ++pub const _PC_MAX_CANON: c_int = 2; ++pub const _PC_MAX_INPUT: c_int = 3; ++pub const _PC_NAME_MAX: c_int = 4; ++pub const _PC_PATH_MAX: c_int = 5; ++pub const _PC_PIPE_BUF: c_int = 6; ++pub const _PC_CHOWN_RESTRICTED: c_int = 9; ++pub const _PC_NO_TRUNC: c_int = 7; ++pub const _PC_VDISABLE: c_int = 8; ++pub const _PC_SYNC_IO: c_int = 14; ++pub const _PC_ASYNC_IO: c_int = 12; ++pub const _PC_PRIO_IO: c_int = 13; ++pub const _PC_SOCK_MAXBUF: c_int = 15; ++pub const _PC_FILESIZEBITS: c_int = 16; ++pub const _PC_REC_INCR_XFER_SIZE: c_int = 22; ++pub const _PC_REC_MAX_XFER_SIZE: c_int = 23; ++pub const _PC_REC_MIN_XFER_SIZE: c_int = 24; ++pub const _PC_REC_XFER_ALIGN: c_int = 25; ++pub const _PC_ALLOC_SIZE_MIN: c_int = 21; ++pub const _PC_SYMLINK_MAX: c_int = 17; ++pub const _PC_2_SYMLINKS: c_int = 20; ++ ++pub const _SC_PAGE_SIZE: c_int = _SC_PAGESIZE; ++pub const _SC_ARG_MAX: c_int = 1; ++pub const _SC_CHILD_MAX: c_int = 2; ++pub const _SC_CLK_TCK: c_int = 3; ++pub const _SC_NGROUPS_MAX: c_int = 4; ++pub const _SC_OPEN_MAX: c_int = 5; ++pub const _SC_JOB_CONTROL: c_int = 6; ++pub const _SC_SAVED_IDS: c_int = 7; ++pub const _SC_VERSION: c_int = 8; ++pub const _SC_PASS_MAX: c_int = 9; ++pub const _SC_PAGESIZE: c_int = 11; ++pub const _SC_XOPEN_VERSION: c_int = 12; ++pub const _SC_STREAM_MAX: c_int = 13; ++pub const _SC_TZNAME_MAX: c_int = 14; ++pub const _SC_AIO_LISTIO_MAX: c_int = 15; ++pub const _SC_AIO_MAX: c_int = 16; ++pub const _SC_AIO_PRIO_DELTA_MAX: c_int = 17; ++pub const _SC_DELAYTIMER_MAX: c_int = 18; ++pub const _SC_MQ_OPEN_MAX: c_int = 19; ++pub const _SC_MQ_PRIO_MAX: c_int = 20; ++pub const _SC_RTSIG_MAX: c_int = 21; ++pub const _SC_SEM_NSEMS_MAX: c_int = 22; ++pub const _SC_SEM_VALUE_MAX: c_int = 23; ++pub const _SC_SIGQUEUE_MAX: c_int = 24; ++pub const _SC_TIMER_MAX: c_int = 25; ++pub const _SC_ASYNCHRONOUS_IO: c_int = 26; ++pub const _SC_FSYNC: c_int = 27; ++pub const _SC_MAPPED_FILES: c_int = 28; ++pub const _SC_MEMLOCK: c_int = 29; ++pub const _SC_MEMLOCK_RANGE: c_int = 30; ++pub const _SC_MEMORY_PROTECTION: c_int = 31; ++pub const _SC_MESSAGE_PASSING: c_int = 32; ++pub const _SC_PRIORITIZED_IO: c_int = 33; ++pub const _SC_PRIORITY_SCHEDULING: c_int = 34; ++pub const _SC_REALTIME_SIGNALS: c_int = 35; ++pub const _SC_SEMAPHORES: c_int = 36; ++pub const _SC_SHARED_MEMORY_OBJECTS: c_int = 37; ++pub const _SC_SYNCHRONIZED_IO: c_int = 38; ++pub const _SC_TIMERS: c_int = 39; ++pub const _SC_GETGR_R_SIZE_MAX: c_int = 40; ++pub const _SC_GETPW_R_SIZE_MAX: c_int = 41; ++pub const _SC_LOGIN_NAME_MAX: c_int = 42; ++pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: c_int = 43; ++pub const _SC_THREAD_KEYS_MAX: c_int = 44; ++pub const _SC_THREAD_STACK_MIN: c_int = 45; ++pub const _SC_THREAD_THREADS_MAX: c_int = 46; ++pub const _SC_TTY_NAME_MAX: c_int = 47; ++pub const _SC_THREADS: c_int = 48; ++pub const _SC_THREAD_ATTR_STACKADDR: c_int = 49; ++pub const _SC_THREAD_ATTR_STACKSIZE: c_int = 50; ++pub const _SC_THREAD_PRIORITY_SCHEDULING: c_int = 51; ++pub const _SC_THREAD_PRIO_INHERIT: c_int = 52; ++pub const _SC_THREAD_PRIO_PROTECT: c_int = 53; ++pub const _SC_THREAD_PROCESS_SHARED: c_int = 54; ++pub const _SC_THREAD_SAFE_FUNCTIONS: c_int = 55; ++pub const _SC_2_CHAR_TERM: c_int = 56; ++pub const _SC_2_C_BIND: c_int = 57; ++pub const _SC_2_C_DEV: c_int = 58; ++pub const _SC_2_C_VERSION: c_int = 59; ++pub const _SC_2_FORT_DEV: c_int = 60; ++pub const _SC_2_FORT_RUN: c_int = 61; ++pub const _SC_2_LOCALEDEF: c_int = 62; ++pub const _SC_2_SW_DEV: c_int = 63; ++pub const _SC_2_UPE: c_int = 64; ++pub const _SC_2_VERSION: c_int = 65; ++pub const _SC_ATEXIT_MAX: c_int = 66; ++pub const _SC_AVPHYS_PAGES: c_int = 67; ++pub const _SC_BC_BASE_MAX: c_int = 68; ++pub const _SC_BC_DIM_MAX: c_int = 69; ++pub const _SC_BC_SCALE_MAX: c_int = 70; ++pub const _SC_BC_STRING_MAX: c_int = 71; ++pub const _SC_CHARCLASS_NAME_MAX: c_int = 72; ++pub const _SC_CHAR_BIT: c_int = 73; ++pub const _SC_CHAR_MAX: c_int = 74; ++pub const _SC_CHAR_MIN: c_int = 75; ++pub const _SC_COLL_WEIGHTS_MAX: c_int = 76; ++pub const _SC_EQUIV_CLASS_MAX: c_int = 77; ++pub const _SC_EXPR_NEST_MAX: c_int = 78; ++pub const _SC_INT_MAX: c_int = 79; ++pub const _SC_INT_MIN: c_int = 80; ++pub const _SC_LINE_MAX: c_int = 81; ++pub const _SC_LONG_BIT: c_int = 82; ++pub const _SC_MB_LEN_MAX: c_int = 83; ++pub const _SC_NL_ARGMAX: c_int = 84; ++pub const _SC_NL_LANGMAX: c_int = 85; ++pub const _SC_NL_MSGMAX: c_int = 86; ++pub const _SC_NL_NMAX: c_int = 87; ++pub const _SC_NL_SETMAX: c_int = 88; ++pub const _SC_NL_TEXTMAX: c_int = 89; ++pub const _SC_NPROCESSORS_CONF: c_int = 90; ++pub const _SC_NPROCESSORS_ONLN: c_int = 91; ++pub const _SC_NZERO: c_int = 92; ++pub const _SC_PHYS_PAGES: c_int = 93; ++pub const _SC_PII: c_int = 94; ++pub const _SC_PII_INTERNET: c_int = 95; ++pub const _SC_PII_INTERNET_DGRAM: c_int = 96; ++pub const _SC_PII_INTERNET_STREAM: c_int = 97; ++pub const _SC_PII_OSI: c_int = 98; ++pub const _SC_PII_OSI_CLTS: c_int = 99; ++pub const _SC_PII_OSI_COTS: c_int = 100; ++pub const _SC_PII_OSI_M: c_int = 101; ++pub const _SC_PII_SOCKET: c_int = 102; ++pub const _SC_PII_XTI: c_int = 103; ++pub const _SC_POLL: c_int = 104; ++pub const _SC_RE_DUP_MAX: c_int = 105; ++pub const _SC_SCHAR_MAX: c_int = 106; ++pub const _SC_SCHAR_MIN: c_int = 107; ++pub const _SC_SELECT: c_int = 108; ++pub const _SC_SHRT_MAX: c_int = 109; ++pub const _SC_SHRT_MIN: c_int = 110; ++pub const _SC_SSIZE_MAX: c_int = 111; ++pub const _SC_T_IOV_MAX: c_int = 112; ++pub const _SC_UCHAR_MAX: c_int = 113; ++pub const _SC_UINT_MAX: c_int = 114; ++pub const _SC_UIO_MAXIOV: c_int = 115; ++pub const _SC_ULONG_MAX: c_int = 116; ++pub const _SC_USHRT_MAX: c_int = 117; ++pub const _SC_WORD_BIT: c_int = 118; ++pub const _SC_XOPEN_CRYPT: c_int = 119; ++pub const _SC_XOPEN_ENH_I18N: c_int = 120; ++pub const _SC_XOPEN_SHM: c_int = 121; ++pub const _SC_XOPEN_UNIX: c_int = 122; ++pub const _SC_XOPEN_XCU_VERSION: c_int = 123; ++pub const _SC_XOPEN_XPG2: c_int = 124; ++pub const _SC_XOPEN_XPG3: c_int = 125; ++pub const _SC_XOPEN_XPG4: c_int = 126; ++pub const _SC_XBS5_ILP32_OFF32: c_int = 127; ++pub const _SC_XBS5_ILP32_OFFBIG: c_int = 128; ++pub const _SC_XBS5_LP64_OFF64: c_int = 129; ++pub const _SC_XBS5_LPBIG_OFFBIG: c_int = 130; ++pub const _SC_ADVISORY_INFO: c_int = 131; ++pub const _SC_CPUTIME: c_int = 132; ++pub const _SC_SPAWN: c_int = 133; ++pub const _SC_SPORADIC_SERVER: c_int = 134; ++pub const _SC_THREAD_CPUTIME: c_int = 135; ++pub const _SC_THREAD_SPORADIC_SERVER: c_int = 136; ++pub const _SC_TIMEOUTS: c_int = 137; ++pub const _SC_BARRIERS: c_int = 138; ++pub const _SC_CLOCK_SELECTION: c_int = 139; ++pub const _SC_MONOTONIC_CLOCK: c_int = 140; ++pub const _SC_READER_WRITER_LOCKS: c_int = 141; ++pub const _SC_SPIN_LOCKS: c_int = 142; ++pub const _SC_TYPED_MEMORY_OBJECTS: c_int = 143; ++pub const _SC_TRACE_EVENT_FILTER: c_int = 144; ++pub const _SC_TRACE: c_int = 145; ++pub const _SC_TRACE_INHERIT: c_int = 146; ++pub const _SC_TRACE_LOG: c_int = 147; ++pub const _SC_2_PBS: c_int = 148; ++pub const _SC_2_PBS_ACCOUNTING: c_int = 149; ++pub const _SC_2_PBS_CHECKPOINT: c_int = 150; ++pub const _SC_2_PBS_LOCATE: c_int = 151; ++pub const _SC_2_PBS_MESSAGE: c_int = 152; ++pub const _SC_2_PBS_TRACK: c_int = 153; ++pub const _SC_HOST_NAME_MAX: c_int = 154; ++pub const _SC_IOV_MAX: c_int = 155; ++pub const _SC_IPV6: c_int = 156; ++pub const _SC_RAW_SOCKETS: c_int = 157; ++pub const _SC_REGEXP: c_int = 158; ++pub const _SC_SHELL: c_int = 159; ++pub const _SC_SS_REPL_MAX: c_int = 160; ++pub const _SC_SYMLOOP_MAX: c_int = 161; ++pub const _SC_TRACE_EVENT_NAME_MAX: c_int = 162; ++pub const _SC_TRACE_NAME_MAX: c_int = 163; ++pub const _SC_TRACE_SYS_MAX: c_int = 164; ++pub const _SC_TRACE_USER_EVENT_MAX: c_int = 165; ++pub const _SC_V6_ILP32_OFF32: c_int = 166; ++pub const _SC_V6_ILP32_OFFBIG: c_int = 167; ++pub const _SC_V6_LP64_OFF64: c_int = 168; ++pub const _SC_V6_LPBIG_OFFBIG: c_int = 169; ++pub const _SC_XOPEN_REALTIME: c_int = 170; ++pub const _SC_XOPEN_REALTIME_THREADS: c_int = 171; ++pub const _SC_XOPEN_LEGACY: c_int = 172; ++pub const _SC_XOPEN_STREAMS: c_int = 173; ++pub const _SC_V7_ILP32_OFF32: c_int = 176; ++pub const _SC_V7_ILP32_OFFBIG: c_int = 177; ++pub const _SC_V7_LP64_OFF64: c_int = 178; ++pub const _SC_V7_LPBIG_OFFBIG: c_int = 179; ++ ++pub const GLOB_ERR: c_int = 0x0001; ++pub const GLOB_MARK: c_int = 0x0002; ++pub const GLOB_NOSORT: c_int = 0x0004; ++pub const GLOB_DOOFFS: c_int = 0x0008; ++pub const GLOB_NOCHECK: c_int = 0x0010; ++pub const GLOB_APPEND: c_int = 0x0020; ++pub const GLOB_NOESCAPE: c_int = 0x0040; ++ ++pub const GLOB_NOSPACE: c_int = 1; ++pub const GLOB_ABORTED: c_int = 2; ++pub const GLOB_NOMATCH: c_int = 3; ++ ++pub const S_IEXEC: mode_t = crate::S_IXUSR; ++pub const S_IWRITE: mode_t = crate::S_IWUSR; ++pub const S_IREAD: mode_t = crate::S_IRUSR; ++ ++pub const S_IFIFO: crate::mode_t = 0o1_0000; ++pub const S_IFCHR: crate::mode_t = 0o2_0000; ++pub const S_IFDIR: crate::mode_t = 0o4_0000; ++pub const S_IFBLK: crate::mode_t = 0o6_0000; ++pub const S_IFREG: crate::mode_t = 0o10_0000; ++pub const S_IFLNK: crate::mode_t = 0o12_0000; ++pub const S_IFSOCK: crate::mode_t = 0o14_0000; ++pub const S_IFMT: crate::mode_t = 0o17_0000; ++ ++pub const S_IXOTH: crate::mode_t = 0o0001; ++pub const S_IWOTH: crate::mode_t = 0o0002; ++pub const S_IROTH: crate::mode_t = 0o0004; ++pub const S_IRWXO: crate::mode_t = 0o0007; ++pub const S_IXGRP: crate::mode_t = 0o0010; ++pub const S_IWGRP: crate::mode_t = 0o0020; ++pub const S_IRGRP: crate::mode_t = 0o0040; ++pub const S_IRWXG: crate::mode_t = 0o0070; ++pub const S_IXUSR: crate::mode_t = 0o0100; ++pub const S_IWUSR: crate::mode_t = 0o0200; ++pub const S_IRUSR: crate::mode_t = 0o0400; ++pub const S_IRWXU: crate::mode_t = 0o0700; ++ ++pub const F_LOCK: c_int = 1; ++pub const F_TEST: c_int = 3; ++pub const F_TLOCK: c_int = 2; ++pub const F_ULOCK: c_int = 0; ++ ++pub const ST_RDONLY: c_ulong = 0x01; ++pub const ST_NOSUID: c_ulong = 0x04; ++pub const ST_NOEXEC: c_ulong = 0x02; ++pub const ST_NOATIME: c_ulong = 0x20; ++ ++pub const RTLD_NEXT: *mut c_void = -3i64 as *mut c_void; ++pub const RTLD_DEFAULT: *mut c_void = -2i64 as *mut c_void; ++pub const RTLD_NODELETE: c_int = 0x1000; ++pub const RTLD_NOW: c_int = 0x0002; ++ ++pub const EMPTY: c_short = 0; ++pub const RUN_LVL: c_short = 1; ++pub const BOOT_TIME: c_short = 2; ++pub const NEW_TIME: c_short = 4; ++pub const OLD_TIME: c_short = 3; ++pub const INIT_PROCESS: c_short = 5; ++pub const LOGIN_PROCESS: c_short = 6; ++pub const USER_PROCESS: c_short = 7; ++pub const DEAD_PROCESS: c_short = 8; ++pub const ACCOUNTING: c_short = 9; ++ ++pub const ENOTSUP: c_int = 48; ++ ++pub const BUFSIZ: c_uint = 1024; ++pub const TMP_MAX: c_uint = 26 * 26 * 26; ++pub const FOPEN_MAX: c_uint = 16; ++pub const FILENAME_MAX: c_uint = 255; ++ ++pub const NI_MAXHOST: crate::socklen_t = 1025; ++pub const M_KEEP: c_int = 4; ++pub const REG_STARTEND: c_int = 0o00004; ++pub const VEOF: usize = 4; ++ ++pub const RTLD_GLOBAL: c_int = 0x0100; ++pub const RTLD_NOLOAD: c_int = 0x0004; ++ ++pub const O_RDONLY: c_int = 0o000000; ++pub const O_WRONLY: c_int = 0o000001; ++pub const O_RDWR: c_int = 0o000002; ++ ++pub const O_EXEC: c_int = 0o00003; ++pub const O_ASYNC: c_int = 0o0200000; ++pub const O_NDELAY: c_int = O_NONBLOCK; ++pub const O_TRUNC: c_int = 0o001000; ++pub const O_CLOEXEC: c_int = 0o020000; ++pub const O_DIRECTORY: c_int = 0o4000000; ++pub const O_ACCMODE: c_int = 0o000007; ++pub const O_APPEND: c_int = 0o000010; ++pub const O_CREAT: c_int = 0o000400; ++pub const O_EXCL: c_int = 0o002000; ++pub const O_NOCTTY: c_int = 0o004000; ++pub const O_NONBLOCK: c_int = 0o000200; ++pub const O_SYNC: c_int = 0o000040; ++pub const O_RSYNC: c_int = 0o000100; ++pub const O_DSYNC: c_int = 0o000020; ++pub const O_NOFOLLOW: c_int = 0o010000; ++ ++pub const POSIX_FADV_DONTNEED: c_int = 4; ++pub const POSIX_FADV_NOREUSE: c_int = 5; ++ ++pub const SOCK_SEQPACKET: c_int = 5; ++pub const SOCK_STREAM: c_int = 1; ++pub const SOCK_DGRAM: c_int = 2; ++pub const SOCK_RAW: c_int = 3; ++pub const SOCK_RDM: c_int = 4; ++pub const SOCK_CLOEXEC: c_int = 0x10000000; ++ ++pub const SA_SIGINFO: c_int = 0x0002; ++pub const SA_NOCLDWAIT: c_int = 0x0020; ++pub const SA_NODEFER: c_int = 0x0010; ++pub const SA_RESETHAND: c_int = 0x0004; ++pub const SA_NOCLDSTOP: c_int = 0x0001; ++ ++pub const SIGTTIN: c_int = 26; ++pub const SIGTTOU: c_int = 27; ++pub const SIGXCPU: c_int = 30; ++pub const SIGXFSZ: c_int = 31; ++pub const SIGVTALRM: c_int = 28; ++pub const SIGPROF: c_int = 29; ++pub const SIGWINCH: c_int = 20; ++pub const SIGCHLD: c_int = 18; ++pub const SIGBUS: c_int = 10; ++pub const SIGUSR1: c_int = 16; ++pub const SIGUSR2: c_int = 17; ++pub const SIGCONT: c_int = 25; ++pub const SIGSTOP: c_int = 23; ++pub const SIGTSTP: c_int = 24; ++pub const SIGURG: c_int = 21; ++pub const SIGIO: c_int = SIGPOLL; ++pub const SIGSYS: c_int = 12; ++pub const SIGPOLL: c_int = 22; ++pub const SIGPWR: c_int = 19; ++pub const SIG_SETMASK: c_int = 2; ++pub const SIG_BLOCK: c_int = 0; ++pub const SIG_UNBLOCK: c_int = 1; ++ ++pub const POLLWRNORM: c_short = crate::POLLOUT; ++pub const POLLWRBAND: c_short = 0x0010; ++ ++pub const F_SETLK: c_int = 106; ++pub const F_SETLKW: c_int = 107; ++pub const F_ALLOCSP: c_int = 110; ++pub const F_FREESP: c_int = 111; ++pub const F_GETLK: c_int = 114; ++ ++pub const F_RDLCK: c_int = 1; ++pub const F_WRLCK: c_int = 2; ++pub const F_UNLCK: c_int = 3; ++ ++pub const NCCS: usize = 40; ++ ++pub const MAP_ANON: c_int = MAP_ANONYMOUS; ++pub const MAP_ANONYMOUS: c_int = 0x00080000; ++ ++pub const MCL_CURRENT: c_int = 0x000000001; ++pub const MCL_FUTURE: c_int = 0x000000002; ++ ++pub const _TIO_CBAUD: crate::tcflag_t = 15; ++pub const CBAUD: crate::tcflag_t = _TIO_CBAUD; ++pub const TAB1: crate::tcflag_t = 0x0800; ++pub const TAB2: crate::tcflag_t = 0x1000; ++pub const TAB3: crate::tcflag_t = 0x1800; ++pub const CR1: crate::tcflag_t = 0x200; ++pub const CR2: crate::tcflag_t = 0x400; ++pub const CR3: crate::tcflag_t = 0x600; ++pub const FF1: crate::tcflag_t = 0x8000; ++pub const BS1: crate::tcflag_t = 0x2000; ++pub const VT1: crate::tcflag_t = 0x4000; ++pub const VWERASE: usize = 14; ++pub const VREPRINT: usize = 12; ++pub const VSUSP: usize = 10; ++pub const VSTART: usize = 8; ++pub const VSTOP: usize = 9; ++pub const VDISCARD: usize = 13; ++pub const VTIME: usize = 17; ++pub const IXON: crate::tcflag_t = 0x00000400; ++pub const IXOFF: crate::tcflag_t = 0x00001000; ++pub const ONLCR: crate::tcflag_t = 0x00000004; ++pub const CSIZE: crate::tcflag_t = 0x00000030; ++pub const CS6: crate::tcflag_t = 0x10; ++pub const CS7: crate::tcflag_t = 0x20; ++pub const CS8: crate::tcflag_t = 0x30; ++pub const CSTOPB: crate::tcflag_t = 0x00000040; ++pub const CREAD: crate::tcflag_t = 0x00000080; ++pub const PARENB: crate::tcflag_t = 0x00000100; ++pub const PARODD: crate::tcflag_t = 0x00000200; ++pub const HUPCL: crate::tcflag_t = 0x00000400; ++pub const CLOCAL: crate::tcflag_t = 0x00000800; ++pub const ECHOKE: crate::tcflag_t = 0x00000800; ++pub const ECHOE: crate::tcflag_t = 0x00000010; ++pub const ECHOK: crate::tcflag_t = 0x00000020; ++pub const ECHONL: crate::tcflag_t = 0x00000040; ++pub const ECHOCTL: crate::tcflag_t = 0x00000200; ++pub const ISIG: crate::tcflag_t = 0x00000001; ++pub const ICANON: crate::tcflag_t = 0x00000002; ++pub const NOFLSH: crate::tcflag_t = 0x00000080; ++pub const OLCUC: crate::tcflag_t = 0x00000002; ++pub const NLDLY: crate::tcflag_t = 0x00000100; ++pub const CRDLY: crate::tcflag_t = 0x00000600; ++pub const TABDLY: crate::tcflag_t = 0x00001800; ++pub const BSDLY: crate::tcflag_t = 0x00002000; ++pub const FFDLY: crate::tcflag_t = 0x00008000; ++pub const VTDLY: crate::tcflag_t = 0x00004000; ++pub const XTABS: crate::tcflag_t = 0x1800; ++ ++pub const B0: crate::speed_t = 0; ++pub const B50: crate::speed_t = 1; ++pub const B75: crate::speed_t = 2; ++pub const B110: crate::speed_t = 3; ++pub const B134: crate::speed_t = 4; ++pub const B150: crate::speed_t = 5; ++pub const B200: crate::speed_t = 6; ++pub const B300: crate::speed_t = 7; ++pub const B600: crate::speed_t = 8; ++pub const B1200: crate::speed_t = 9; ++pub const B1800: crate::speed_t = 10; ++pub const B2400: crate::speed_t = 11; ++pub const B4800: crate::speed_t = 12; ++pub const B9600: crate::speed_t = 13; ++pub const B19200: crate::speed_t = 14; ++pub const B38400: crate::speed_t = 15; ++pub const EXTA: crate::speed_t = 14; ++pub const EXTB: crate::speed_t = 15; ++pub const B57600: crate::speed_t = 57600; ++pub const B115200: crate::speed_t = 115200; ++ ++pub const VEOL: usize = 5; ++pub const VEOL2: usize = 6; ++pub const VMIN: usize = 16; ++pub const IEXTEN: crate::tcflag_t = 0x00008000; ++pub const TOSTOP: crate::tcflag_t = 0x00000100; ++ ++pub const TCSANOW: c_int = 0x0001; ++pub const TCSADRAIN: c_int = 0x0002; ++pub const TCSAFLUSH: c_int = 0x0004; ++ ++pub const HW_MACHINE: c_int = 1; ++pub const HW_MODEL: c_int = 2; ++pub const HW_NCPU: c_int = 3; ++pub const HW_BYTEORDER: c_int = 4; ++pub const HW_PHYSMEM: c_int = 5; ++pub const HW_USERMEM: c_int = 6; ++pub const HW_PAGESIZE: c_int = 7; ++pub const HW_DISKNAMES: c_int = 8; ++pub const HW_IOSTATS: c_int = 9; ++pub const HW_MACHINE_ARCH: c_int = 10; ++pub const HW_ALIGNBYTES: c_int = 11; ++pub const HW_CNMAGIC: c_int = 12; ++pub const HW_PHYSMEM64: c_int = 13; ++pub const HW_USERMEM64: c_int = 14; ++pub const HW_IOSTATNAMES: c_int = 15; ++pub const HW_MAXID: c_int = 15; ++ ++pub const CTL_UNSPEC: c_int = 0; ++pub const CTL_KERN: c_int = 1; ++pub const CTL_VM: c_int = 2; ++pub const CTL_VFS: c_int = 3; ++pub const CTL_NET: c_int = 4; ++pub const CTL_DEBUG: c_int = 5; ++pub const CTL_HW: c_int = 6; ++pub const CTL_MACHDEP: c_int = 7; ++pub const CTL_USER: c_int = 8; ++pub const CTL_QNX: c_int = 9; ++pub const CTL_PROC: c_int = 10; ++pub const CTL_VENDOR: c_int = 11; ++pub const CTL_EMUL: c_int = 12; ++pub const CTL_SECURITY: c_int = 13; ++pub const CTL_MAXID: c_int = 14; ++ ++pub const DAY_1: crate::nl_item = 8; ++pub const DAY_2: crate::nl_item = 9; ++pub const DAY_3: crate::nl_item = 10; ++pub const DAY_4: crate::nl_item = 11; ++pub const DAY_5: crate::nl_item = 12; ++pub const DAY_6: crate::nl_item = 13; ++pub const DAY_7: crate::nl_item = 14; ++ ++pub const MON_1: crate::nl_item = 22; ++pub const MON_2: crate::nl_item = 23; ++pub const MON_3: crate::nl_item = 24; ++pub const MON_4: crate::nl_item = 25; ++pub const MON_5: crate::nl_item = 26; ++pub const MON_6: crate::nl_item = 27; ++pub const MON_7: crate::nl_item = 28; ++pub const MON_8: crate::nl_item = 29; ++pub const MON_9: crate::nl_item = 30; ++pub const MON_10: crate::nl_item = 31; ++pub const MON_11: crate::nl_item = 32; ++pub const MON_12: crate::nl_item = 33; ++ ++pub const ABDAY_1: crate::nl_item = 15; ++pub const ABDAY_2: crate::nl_item = 16; ++pub const ABDAY_3: crate::nl_item = 17; ++pub const ABDAY_4: crate::nl_item = 18; ++pub const ABDAY_5: crate::nl_item = 19; ++pub const ABDAY_6: crate::nl_item = 20; ++pub const ABDAY_7: crate::nl_item = 21; ++ ++pub const ABMON_1: crate::nl_item = 34; ++pub const ABMON_2: crate::nl_item = 35; ++pub const ABMON_3: crate::nl_item = 36; ++pub const ABMON_4: crate::nl_item = 37; ++pub const ABMON_5: crate::nl_item = 38; ++pub const ABMON_6: crate::nl_item = 39; ++pub const ABMON_7: crate::nl_item = 40; ++pub const ABMON_8: crate::nl_item = 41; ++pub const ABMON_9: crate::nl_item = 42; ++pub const ABMON_10: crate::nl_item = 43; ++pub const ABMON_11: crate::nl_item = 44; ++pub const ABMON_12: crate::nl_item = 45; ++ ++pub const AF_ARP: c_int = 28; ++pub const AF_CCITT: c_int = 10; ++pub const AF_CHAOS: c_int = 5; ++pub const AF_CNT: c_int = 21; ++pub const AF_COIP: c_int = 20; ++pub const AF_DATAKIT: c_int = 9; ++pub const AF_DECnet: c_int = 12; ++pub const AF_DLI: c_int = 13; ++pub const AF_E164: c_int = 26; ++pub const AF_ECMA: c_int = 8; ++pub const AF_HYLINK: c_int = 15; ++pub const AF_IEEE80211: c_int = 32; ++pub const AF_IMPLINK: c_int = 3; ++pub const AF_ISO: c_int = 7; ++pub const AF_LAT: c_int = 14; ++pub const AF_LINK: c_int = 18; ++pub const AF_NATM: c_int = 27; ++pub const AF_NS: c_int = 6; ++pub const AF_OSI: c_int = 7; ++pub const AF_PUP: c_int = 4; ++pub const ALT_DIGITS: crate::nl_item = 50; ++pub const AM_STR: crate::nl_item = 6; ++pub const B76800: crate::speed_t = 76800; ++ ++pub const BIOCFLUSH: c_int = 17000; ++pub const BIOCGBLEN: c_int = 1074020966; ++pub const BIOCGDLT: c_int = 1074020970; ++pub const BIOCGDLTLIST: c_int = -1072676233; ++pub const BIOCGETIF: c_int = 1083196011; ++pub const BIOCGHDRCMPLT: c_int = 1074020980; ++pub const BIOCGRTIMEOUT: c_int = 1074807406; ++pub const BIOCGSEESENT: c_int = 1074020984; ++pub const BIOCGSTATS: c_int = 1082147439; ++pub const BIOCIMMEDIATE: c_int = -2147204496; ++pub const BIOCPROMISC: c_int = 17001; ++pub const BIOCSBLEN: c_int = -1073462682; ++pub const BIOCSDLT: c_int = -2147204490; ++pub const BIOCSETF: c_int = -2146418073; ++pub const BIOCSETIF: c_int = -2138029460; ++pub const BIOCSHDRCMPLT: c_int = -2147204491; ++pub const BIOCSRTIMEOUT: c_int = -2146418067; ++pub const BIOCSSEESENT: c_int = -2147204487; ++pub const BIOCVERSION: c_int = 1074020977; ++ ++pub const BPF_ALIGNMENT: usize = mem::size_of::(); ++pub const CHAR_BIT: usize = 8; ++pub const CODESET: crate::nl_item = 1; ++pub const CRNCYSTR: crate::nl_item = 55; ++ ++pub const D_FLAG_FILTER: c_int = 0x00000001; ++pub const D_FLAG_STAT: c_int = 0x00000002; ++pub const D_FLAG_STAT_FORM_MASK: c_int = 0x000000f0; ++pub const D_FLAG_STAT_FORM_T32_2001: c_int = 0x00000010; ++pub const D_FLAG_STAT_FORM_T32_2008: c_int = 0x00000020; ++pub const D_FLAG_STAT_FORM_T64_2008: c_int = 0x00000030; ++pub const D_FLAG_STAT_FORM_UNSET: c_int = 0x00000000; ++ ++pub const D_FMT: crate::nl_item = 3; ++pub const D_GETFLAG: c_int = 1; ++pub const D_SETFLAG: c_int = 2; ++pub const D_T_FMT: crate::nl_item = 2; ++pub const ERA: crate::nl_item = 46; ++pub const ERA_D_FMT: crate::nl_item = 47; ++pub const ERA_D_T_FMT: crate::nl_item = 48; ++pub const ERA_T_FMT: crate::nl_item = 49; ++pub const RADIXCHAR: crate::nl_item = 51; ++pub const THOUSEP: crate::nl_item = 52; ++pub const YESEXPR: crate::nl_item = 53; ++pub const NOEXPR: crate::nl_item = 54; ++pub const F_GETOWN: c_int = 35; ++ ++pub const FIONBIO: c_int = -2147195266; ++pub const FIOASYNC: c_int = -2147195267; ++pub const FIOCLEX: c_int = 26113; ++pub const FIOGETOWN: c_int = 1074030203; ++pub const FIONCLEX: c_int = 26114; ++pub const FIONREAD: c_int = 1074030207; ++pub const FIONSPACE: c_int = 1074030200; ++pub const FIONWRITE: c_int = 1074030201; ++pub const FIOSETOWN: c_int = -2147195268; ++ ++pub const F_SETOWN: c_int = 36; ++pub const IFF_ACCEPTRTADV: c_int = 0x40000000; ++pub const IFF_IP6FORWARDING: c_int = 0x20000000; ++pub const IFF_LINK0: c_int = 0x00001000; ++pub const IFF_LINK1: c_int = 0x00002000; ++pub const IFF_LINK2: c_int = 0x00004000; ++pub const IFF_OACTIVE: c_int = 0x00000400; ++pub const IFF_SHIM: c_int = 0x80000000; ++pub const IFF_SIMPLEX: c_int = 0x00000800; ++pub const IHFLOW: tcflag_t = 0x00000001; ++pub const IIDLE: tcflag_t = 0x00000008; ++pub const IP_RECVDSTADDR: c_int = 7; ++pub const IP_RECVIF: c_int = 20; ++pub const IPTOS_ECN_NOTECT: u8 = 0x00; ++pub const IUCLC: tcflag_t = 0x00000200; ++pub const IUTF8: tcflag_t = 0x0004000; ++ ++pub const KERN_ARGMAX: c_int = 8; ++pub const KERN_ARND: c_int = 81; ++pub const KERN_BOOTTIME: c_int = 21; ++pub const KERN_CLOCKRATE: c_int = 12; ++pub const KERN_FILE: c_int = 15; ++pub const KERN_HOSTID: c_int = 11; ++pub const KERN_HOSTNAME: c_int = 10; ++pub const KERN_IOV_MAX: c_int = 38; ++pub const KERN_JOB_CONTROL: c_int = 19; ++pub const KERN_LOGSIGEXIT: c_int = 46; ++pub const KERN_MAXFILES: c_int = 7; ++pub const KERN_MAXID: c_int = 83; ++pub const KERN_MAXPROC: c_int = 6; ++pub const KERN_MAXVNODES: c_int = 5; ++pub const KERN_NGROUPS: c_int = 18; ++pub const KERN_OSRELEASE: c_int = 2; ++pub const KERN_OSREV: c_int = 3; ++pub const KERN_OSTYPE: c_int = 1; ++pub const KERN_POSIX1: c_int = 17; ++pub const KERN_PROC: c_int = 14; ++pub const KERN_PROC_ALL: c_int = 0; ++pub const KERN_PROC_ARGS: c_int = 48; ++pub const KERN_PROC_ENV: c_int = 3; ++pub const KERN_PROC_GID: c_int = 7; ++pub const KERN_PROC_PGRP: c_int = 2; ++pub const KERN_PROC_PID: c_int = 1; ++pub const KERN_PROC_RGID: c_int = 8; ++pub const KERN_PROC_RUID: c_int = 6; ++pub const KERN_PROC_SESSION: c_int = 3; ++pub const KERN_PROC_TTY: c_int = 4; ++pub const KERN_PROC_UID: c_int = 5; ++pub const KERN_PROF: c_int = 16; ++pub const KERN_SAVED_IDS: c_int = 20; ++pub const KERN_SECURELVL: c_int = 9; ++pub const KERN_VERSION: c_int = 4; ++pub const KERN_VNODE: c_int = 13; ++ ++pub const LC_ALL: c_int = 63; ++pub const LC_COLLATE: c_int = 1; ++pub const LC_CTYPE: c_int = 2; ++pub const LC_MESSAGES: c_int = 32; ++pub const LC_MONETARY: c_int = 4; ++pub const LC_NUMERIC: c_int = 8; ++pub const LC_TIME: c_int = 16; ++ ++pub const LOCAL_CONNWAIT: c_int = 0x0002; ++pub const LOCAL_CREDS: c_int = 0x0001; ++pub const LOCAL_PEEREID: c_int = 0x0003; ++ ++pub const MAP_STACK: c_int = 0x00001000; ++pub const MNT_NOEXEC: c_int = 0x02; ++pub const MNT_NOSUID: c_int = 0x04; ++pub const MNT_RDONLY: c_int = 0x01; ++ ++pub const MSG_NOTIFICATION: c_int = 0x0400; ++ ++pub const NET_RT_DUMP: c_int = 1; ++pub const NET_RT_FLAGS: c_int = 2; ++pub const NET_RT_IFLIST: c_int = 4; ++pub const NI_NUMERICSCOPE: c_int = 0x00000040; ++pub const OHFLOW: tcflag_t = 0x00000002; ++pub const P_ALL: idtype_t = 0; ++pub const PARSTK: tcflag_t = 0x00000004; ++pub const PF_ARP: c_int = 28; ++pub const PF_CCITT: c_int = 10; ++pub const PF_CHAOS: c_int = 5; ++pub const PF_CNT: c_int = 21; ++pub const PF_COIP: c_int = 20; ++pub const PF_DATAKIT: c_int = 9; ++pub const PF_DECnet: c_int = 12; ++pub const PF_DLI: c_int = 13; ++pub const PF_ECMA: c_int = 8; ++pub const PF_HYLINK: c_int = 15; ++pub const PF_IMPLINK: c_int = 3; ++pub const PF_ISO: c_int = 7; ++pub const PF_LAT: c_int = 14; ++pub const PF_LINK: c_int = 18; ++pub const PF_NATM: c_int = 27; ++pub const PF_OSI: c_int = 7; ++pub const PF_PIP: c_int = 25; ++pub const PF_PUP: c_int = 4; ++pub const PF_RTIP: c_int = 22; ++pub const PF_XTP: c_int = 19; ++pub const PM_STR: crate::nl_item = 7; ++pub const POSIX_MADV_DONTNEED: c_int = 4; ++pub const POSIX_MADV_NORMAL: c_int = 0; ++pub const POSIX_MADV_RANDOM: c_int = 2; ++pub const POSIX_MADV_SEQUENTIAL: c_int = 1; ++pub const POSIX_MADV_WILLNEED: c_int = 3; ++pub const _POSIX_VDISABLE: c_int = 0; ++pub const P_PGID: idtype_t = 2; ++pub const P_PID: idtype_t = 1; ++pub const PRIO_PGRP: c_int = 1; ++pub const PRIO_PROCESS: c_int = 0; ++pub const PRIO_USER: c_int = 2; ++pub const pseudo_AF_HDRCMPLT: c_int = 30; ++pub const pseudo_AF_PIP: c_int = 25; ++pub const pseudo_AF_RTIP: c_int = 22; ++pub const pseudo_AF_XTP: c_int = 19; ++pub const REG_ASSERT: c_int = 15; ++pub const REG_ATOI: c_int = 255; ++pub const REG_BACKR: c_int = 0x400; ++pub const REG_BASIC: c_int = 0x00; ++pub const REG_DUMP: c_int = 0x80; ++pub const REG_EMPTY: c_int = 14; ++pub const REG_INVARG: c_int = 16; ++pub const REG_ITOA: c_int = 0o400; ++pub const REG_LARGE: c_int = 0x200; ++pub const REG_NOSPEC: c_int = 0x10; ++pub const REG_OK: c_int = 0; ++pub const REG_PEND: c_int = 0x20; ++pub const REG_TRACE: c_int = 0x100; ++ ++pub const RLIMIT_AS: c_int = 6; ++pub const RLIMIT_CORE: c_int = 4; ++pub const RLIMIT_CPU: c_int = 0; ++pub const RLIMIT_DATA: c_int = 2; ++pub const RLIMIT_FSIZE: c_int = 1; ++pub const RLIMIT_MEMLOCK: c_int = 7; ++pub const RLIMIT_NOFILE: c_int = 5; ++pub const RLIMIT_NPROC: c_int = 8; ++pub const RLIMIT_RSS: c_int = 6; ++pub const RLIMIT_STACK: c_int = 3; ++pub const RLIMIT_VMEM: c_int = 6; ++#[deprecated(since = "0.2.64", note = "Not stable across OS versions")] ++pub const RLIM_NLIMITS: c_int = 14; ++ ++pub const SCHED_ADJTOHEAD: c_int = 5; ++pub const SCHED_ADJTOTAIL: c_int = 6; ++pub const SCHED_MAXPOLICY: c_int = 7; ++pub const SCHED_SETPRIO: c_int = 7; ++pub const SCHED_SPORADIC: c_int = 4; ++ ++pub const SHM_ANON: *mut c_char = -1isize as *mut c_char; ++pub const SIGCLD: c_int = SIGCHLD; ++pub const SIGDEADLK: c_int = 7; ++pub const SIGEMT: c_int = 7; ++pub const SIGEV_NONE: c_int = 0; ++pub const SIGEV_SIGNAL: c_int = 129; ++pub const SIGEV_THREAD: c_int = 135; ++pub const SIOCGIFADDR: c_int = -1064277727; ++pub const SO_FIB: c_int = 0x100a; ++pub const SO_OVERFLOWED: c_int = 0x1009; ++pub const SO_SETFIB: c_int = 0x100a; ++pub const SO_TXPRIO: c_int = 0x100b; ++pub const SO_USELOOPBACK: c_int = 0x0040; ++pub const SO_VLANPRIO: c_int = 0x100c; ++pub const _SS_ALIGNSIZE: usize = mem::size_of::(); ++pub const _SS_MAXSIZE: usize = 128; ++pub const _SS_PAD1SIZE: usize = _SS_ALIGNSIZE - 2; ++pub const _SS_PAD2SIZE: usize = _SS_MAXSIZE - 2 - _SS_PAD1SIZE - _SS_ALIGNSIZE; ++pub const TC_CPOSIX: tcflag_t = CLOCAL | CREAD | CSIZE | CSTOPB | HUPCL | PARENB | PARODD; ++pub const TCGETS: c_int = 0x404c540d; ++pub const TC_IPOSIX: tcflag_t = ++ BRKINT | ICRNL | IGNBRK | IGNPAR | INLCR | INPCK | ISTRIP | IXOFF | IXON | PARMRK; ++pub const TC_LPOSIX: tcflag_t = ++ ECHO | ECHOE | ECHOK | ECHONL | ICANON | IEXTEN | ISIG | NOFLSH | TOSTOP; ++pub const TC_OPOSIX: tcflag_t = OPOST; ++pub const T_FMT_AMPM: crate::nl_item = 5; ++ ++pub const TIOCCBRK: c_int = 29818; ++pub const TIOCCDTR: c_int = 29816; ++pub const TIOCDRAIN: c_int = 29790; ++pub const TIOCEXCL: c_int = 29709; ++pub const TIOCFLUSH: c_int = -2147191792; ++pub const TIOCGETA: c_int = 1078752275; ++pub const TIOCGPGRP: c_int = 1074033783; ++pub const TIOCGWINSZ: c_int = 1074295912; ++pub const TIOCMBIC: c_int = -2147191701; ++pub const TIOCMBIS: c_int = -2147191700; ++pub const TIOCMGET: c_int = 1074033770; ++pub const TIOCMSET: c_int = -2147191699; ++pub const TIOCNOTTY: c_int = 29809; ++pub const TIOCNXCL: c_int = 29710; ++pub const TIOCOUTQ: c_int = 1074033779; ++pub const TIOCPKT: c_int = -2147191696; ++pub const TIOCPKT_DATA: c_int = 0x00; ++pub const TIOCPKT_DOSTOP: c_int = 0x20; ++pub const TIOCPKT_FLUSHREAD: c_int = 0x01; ++pub const TIOCPKT_FLUSHWRITE: c_int = 0x02; ++pub const TIOCPKT_IOCTL: c_int = 0x40; ++pub const TIOCPKT_NOSTOP: c_int = 0x10; ++pub const TIOCPKT_START: c_int = 0x08; ++pub const TIOCPKT_STOP: c_int = 0x04; ++pub const TIOCSBRK: c_int = 29819; ++pub const TIOCSCTTY: c_int = 29793; ++pub const TIOCSDTR: c_int = 29817; ++pub const TIOCSETA: c_int = -2142473196; ++pub const TIOCSETAF: c_int = -2142473194; ++pub const TIOCSETAW: c_int = -2142473195; ++pub const TIOCSPGRP: c_int = -2147191690; ++pub const TIOCSTART: c_int = 29806; ++pub const TIOCSTI: c_int = -2147388302; ++pub const TIOCSTOP: c_int = 29807; ++pub const TIOCSWINSZ: c_int = -2146929561; ++ ++pub const USER_CS_PATH: c_int = 1; ++pub const USER_BC_BASE_MAX: c_int = 2; ++pub const USER_BC_DIM_MAX: c_int = 3; ++pub const USER_BC_SCALE_MAX: c_int = 4; ++pub const USER_BC_STRING_MAX: c_int = 5; ++pub const USER_COLL_WEIGHTS_MAX: c_int = 6; ++pub const USER_EXPR_NEST_MAX: c_int = 7; ++pub const USER_LINE_MAX: c_int = 8; ++pub const USER_RE_DUP_MAX: c_int = 9; ++pub const USER_POSIX2_VERSION: c_int = 10; ++pub const USER_POSIX2_C_BIND: c_int = 11; ++pub const USER_POSIX2_C_DEV: c_int = 12; ++pub const USER_POSIX2_CHAR_TERM: c_int = 13; ++pub const USER_POSIX2_FORT_DEV: c_int = 14; ++pub const USER_POSIX2_FORT_RUN: c_int = 15; ++pub const USER_POSIX2_LOCALEDEF: c_int = 16; ++pub const USER_POSIX2_SW_DEV: c_int = 17; ++pub const USER_POSIX2_UPE: c_int = 18; ++pub const USER_STREAM_MAX: c_int = 19; ++pub const USER_TZNAME_MAX: c_int = 20; ++pub const USER_ATEXIT_MAX: c_int = 21; ++pub const USER_MAXID: c_int = 22; ++ ++pub const VDOWN: usize = 31; ++pub const VINS: usize = 32; ++pub const VDEL: usize = 33; ++pub const VRUB: usize = 34; ++pub const VCAN: usize = 35; ++pub const VHOME: usize = 36; ++pub const VEND: usize = 37; ++pub const VSPARE3: usize = 38; ++pub const VSPARE4: usize = 39; ++pub const VSWTCH: usize = 7; ++pub const VDSUSP: usize = 11; ++pub const VFWD: usize = 18; ++pub const VLOGIN: usize = 19; ++pub const VPREFIX: usize = 20; ++pub const VSUFFIX: usize = 24; ++pub const VLEFT: usize = 28; ++pub const VRIGHT: usize = 29; ++pub const VUP: usize = 30; ++pub const XCASE: tcflag_t = 0x00000004; ++ ++pub const PTHREAD_BARRIER_SERIAL_THREAD: c_int = -1; ++pub const PTHREAD_CREATE_JOINABLE: c_int = 0x00; ++pub const PTHREAD_CREATE_DETACHED: c_int = 0x01; ++ ++pub const PTHREAD_MUTEX_ERRORCHECK: c_int = 1; ++pub const PTHREAD_MUTEX_RECURSIVE: c_int = 2; ++pub const PTHREAD_MUTEX_NORMAL: c_int = 3; ++pub const PTHREAD_STACK_MIN: size_t = 256; ++pub const PTHREAD_MUTEX_DEFAULT: c_int = 0; ++pub const PTHREAD_MUTEX_STALLED: c_int = 0x00; ++pub const PTHREAD_MUTEX_ROBUST: c_int = 0x10; ++pub const PTHREAD_PROCESS_PRIVATE: c_int = 0x00; ++pub const PTHREAD_PROCESS_SHARED: c_int = 0x01; ++ ++pub const PTHREAD_KEYS_MAX: usize = 128; ++ ++pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { ++ __u: 0x80000000, ++ __owner: 0xffffffff, ++}; ++pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { ++ __u: CLOCK_REALTIME as u32, ++ __owner: 0xfffffffb, ++}; ++pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { ++ __active: 0, ++ __blockedwriters: 0, ++ __blockedreaders: 0, ++ __heavy: 0, ++ __lock: PTHREAD_MUTEX_INITIALIZER, ++ __rcond: PTHREAD_COND_INITIALIZER, ++ __wcond: PTHREAD_COND_INITIALIZER, ++ __owner: -2i32 as c_uint, ++ __spare: 0, ++}; ++ ++const_fn! { ++ {const} fn _CMSG_ALIGN(len: usize) -> usize { ++ len + mem::size_of::() - 1 & !(mem::size_of::() - 1) ++ } ++ ++ {const} fn _ALIGN(p: usize, b: usize) -> usize { ++ (p + b - 1) & !(b - 1) ++ } ++} ++ ++f! { ++ pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr { ++ if (*mhdr).msg_controllen as usize >= mem::size_of::() { ++ (*mhdr).msg_control as *mut cmsghdr ++ } else { ++ 0 as *mut cmsghdr ++ } ++ } ++ ++ pub fn CMSG_NXTHDR(mhdr: *const crate::msghdr, cmsg: *const cmsghdr) -> *mut cmsghdr { ++ let msg = _CMSG_ALIGN((*cmsg).cmsg_len as usize); ++ let next = cmsg as usize + msg + _CMSG_ALIGN(mem::size_of::()); ++ if next > (*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize { ++ 0 as *mut cmsghdr ++ } else { ++ (cmsg as usize + msg) as *mut cmsghdr ++ } ++ } ++ ++ pub fn CMSG_DATA(cmsg: *const cmsghdr) -> *mut c_uchar { ++ (cmsg as *mut c_uchar).offset(_CMSG_ALIGN(mem::size_of::()) as isize) ++ } ++ ++ pub {const} fn CMSG_LEN(length: c_uint) -> c_uint { ++ _CMSG_ALIGN(mem::size_of::()) as c_uint + length ++ } ++ ++ pub {const} fn CMSG_SPACE(length: c_uint) -> c_uint { ++ (_CMSG_ALIGN(mem::size_of::()) + _CMSG_ALIGN(length as usize)) as c_uint ++ } ++ ++ pub fn FD_CLR(fd: c_int, set: *mut fd_set) -> () { ++ let fd = fd as usize; ++ let size = mem::size_of_val(&(*set).fds_bits[0]) * 8; ++ (*set).fds_bits[fd / size] &= !(1 << (fd % size)); ++ return; ++ } ++ ++ pub fn FD_ISSET(fd: c_int, set: *const fd_set) -> bool { ++ let fd = fd as usize; ++ let size = mem::size_of_val(&(*set).fds_bits[0]) * 8; ++ return ((*set).fds_bits[fd / size] & (1 << (fd % size))) != 0; ++ } ++ ++ pub fn FD_SET(fd: c_int, set: *mut fd_set) -> () { ++ let fd = fd as usize; ++ let size = mem::size_of_val(&(*set).fds_bits[0]) * 8; ++ (*set).fds_bits[fd / size] |= 1 << (fd % size); ++ return; ++ } ++ ++ pub fn FD_ZERO(set: *mut fd_set) -> () { ++ for slot in (*set).fds_bits.iter_mut() { ++ *slot = 0; ++ } ++ } ++ ++ pub fn _DEXTRA_FIRST(_d: *const dirent) -> *mut crate::dirent_extra { ++ let _f = &((*(_d)).d_name) as *const _; ++ let _s = _d as usize; ++ ++ _ALIGN(_s + _f as usize - _s + (*_d).d_namelen as usize + 1, 8) as *mut crate::dirent_extra ++ } ++ ++ pub fn _DEXTRA_VALID(_x: *const crate::dirent_extra, _d: *const dirent) -> bool { ++ let sz = _x as usize - _d as usize + mem::size_of::(); ++ let rsz = (*_d).d_reclen as usize; ++ ++ if sz > rsz || sz + (*_x).d_datalen as usize > rsz { ++ false ++ } else { ++ true ++ } ++ } ++ ++ pub fn _DEXTRA_NEXT(_x: *const crate::dirent_extra) -> *mut crate::dirent_extra { ++ _ALIGN( ++ _x as usize + mem::size_of::() + (*_x).d_datalen as usize, ++ 8, ++ ) as *mut crate::dirent_extra ++ } ++ ++ pub fn SOCKCREDSIZE(ngrps: usize) -> usize { ++ let ngrps = if ngrps > 0 { ngrps - 1 } else { 0 }; ++ mem::size_of::() + mem::size_of::() * ngrps ++ } ++ ++ pub fn major(dev: crate::dev_t) -> c_uint { ++ ((dev as c_uint) >> 10) & 0x3f ++ } ++ ++ pub fn minor(dev: crate::dev_t) -> c_uint { ++ (dev as c_uint) & 0x3ff ++ } ++} ++ ++safe_f! { ++ pub {const} fn WIFSTOPPED(status: c_int) -> bool { ++ (status & 0xff) == 0x7f ++ } ++ ++ pub {const} fn WSTOPSIG(status: c_int) -> c_int { ++ (status >> 8) & 0xff ++ } ++ ++ pub {const} fn WIFCONTINUED(status: c_int) -> bool { ++ status == 0xffff ++ } ++ ++ pub {const} fn WIFSIGNALED(status: c_int) -> bool { ++ ((status & 0x7f) + 1) as i8 >= 2 ++ } ++ ++ pub {const} fn WTERMSIG(status: c_int) -> c_int { ++ status & 0x7f ++ } ++ ++ pub {const} fn WIFEXITED(status: c_int) -> bool { ++ (status & 0x7f) == 0 ++ } ++ ++ pub {const} fn WEXITSTATUS(status: c_int) -> c_int { ++ (status >> 8) & 0xff ++ } ++ ++ pub {const} fn WCOREDUMP(status: c_int) -> bool { ++ (status & 0x80) != 0 ++ } ++ ++ pub {const} fn IPTOS_ECN(x: u8) -> u8 { ++ x & crate::IPTOS_ECN_MASK ++ } ++ ++ pub {const} fn makedev(major: c_uint, minor: c_uint) -> crate::dev_t { ++ ((major << 10) | (minor)) as crate::dev_t ++ } ++} ++ ++// Network related functions are provided by libsocket and regex ++// functions are provided by libregex. ++// In QNX <=7.0, libregex functions were included in libc itself. ++#[link(name = "socket")] ++#[cfg_attr(not(target_env = "nto70"), link(name = "regex"))] ++extern "C" { ++ pub fn sem_destroy(sem: *mut sem_t) -> c_int; ++ pub fn sem_init(sem: *mut sem_t, pshared: c_int, value: c_uint) -> c_int; ++ pub fn fdatasync(fd: c_int) -> c_int; ++ pub fn getpriority(which: c_int, who: crate::id_t) -> c_int; ++ pub fn setpriority(which: c_int, who: crate::id_t, prio: c_int) -> c_int; ++ pub fn mkfifoat(dirfd: c_int, pathname: *const c_char, mode: crate::mode_t) -> c_int; ++ pub fn mknodat( ++ __fd: c_int, ++ pathname: *const c_char, ++ mode: crate::mode_t, ++ dev: crate::dev_t, ++ ) -> c_int; ++ ++ pub fn clock_getres(clk_id: crate::clockid_t, tp: *mut crate::timespec) -> c_int; ++ pub fn clock_gettime(clk_id: crate::clockid_t, tp: *mut crate::timespec) -> c_int; ++ pub fn clock_settime(clk_id: crate::clockid_t, tp: *const crate::timespec) -> c_int; ++ pub fn clock_getcpuclockid(pid: crate::pid_t, clk_id: *mut crate::clockid_t) -> c_int; ++ ++ pub fn pthread_attr_getstack( ++ attr: *const crate::pthread_attr_t, ++ stackaddr: *mut *mut c_void, ++ stacksize: *mut size_t, ++ ) -> c_int; ++ pub fn memalign(align: size_t, size: size_t) -> *mut c_void; ++ pub fn setgroups(ngroups: c_int, ptr: *const crate::gid_t) -> c_int; ++ ++ pub fn posix_fadvise(fd: c_int, offset: off_t, len: off_t, advise: c_int) -> c_int; ++ pub fn futimens(fd: c_int, times: *const crate::timespec) -> c_int; ++ pub fn nl_langinfo(item: crate::nl_item) -> *mut c_char; ++ ++ pub fn utimensat( ++ dirfd: c_int, ++ path: *const c_char, ++ times: *const crate::timespec, ++ flag: c_int, ++ ) -> c_int; ++ ++ pub fn pthread_condattr_getclock( ++ attr: *const pthread_condattr_t, ++ clock_id: *mut clockid_t, ++ ) -> c_int; ++ pub fn pthread_condattr_setclock( ++ attr: *mut pthread_condattr_t, ++ clock_id: crate::clockid_t, ++ ) -> c_int; ++ pub fn pthread_condattr_setpshared(attr: *mut pthread_condattr_t, pshared: c_int) -> c_int; ++ pub fn pthread_mutexattr_setpshared(attr: *mut pthread_mutexattr_t, pshared: c_int) -> c_int; ++ pub fn pthread_rwlockattr_getpshared( ++ attr: *const pthread_rwlockattr_t, ++ val: *mut c_int, ++ ) -> c_int; ++ pub fn pthread_rwlockattr_setpshared(attr: *mut pthread_rwlockattr_t, val: c_int) -> c_int; ++ pub fn ptsname_r(fd: c_int, buf: *mut c_char, buflen: size_t) -> *mut c_char; ++ pub fn clearenv() -> c_int; ++ pub fn waitid( ++ idtype: idtype_t, ++ id: id_t, ++ infop: *mut crate::siginfo_t, ++ options: c_int, ++ ) -> c_int; ++ pub fn wait4( ++ pid: crate::pid_t, ++ status: *mut c_int, ++ options: c_int, ++ rusage: *mut crate::rusage, ++ ) -> crate::pid_t; ++ ++ // DIFF(main): changed to `*const *mut` in e77f551de9 ++ pub fn execvpe( ++ file: *const c_char, ++ argv: *const *const c_char, ++ envp: *const *const c_char, ++ ) -> c_int; ++ ++ pub fn getifaddrs(ifap: *mut *mut crate::ifaddrs) -> c_int; ++ pub fn freeifaddrs(ifa: *mut crate::ifaddrs); ++ pub fn bind( ++ socket: c_int, ++ address: *const crate::sockaddr, ++ address_len: crate::socklen_t, ++ ) -> c_int; ++ ++ pub fn writev(fd: c_int, iov: *const crate::iovec, iovcnt: c_int) -> ssize_t; ++ pub fn readv(fd: c_int, iov: *const crate::iovec, iovcnt: c_int) -> ssize_t; ++ ++ pub fn sendmsg(fd: c_int, msg: *const crate::msghdr, flags: c_int) -> ssize_t; ++ pub fn recvmsg(fd: c_int, msg: *mut crate::msghdr, flags: c_int) -> ssize_t; ++ pub fn openpty( ++ amaster: *mut c_int, ++ aslave: *mut c_int, ++ name: *mut c_char, ++ termp: *mut termios, ++ winp: *mut crate::winsize, ++ ) -> c_int; ++ pub fn forkpty( ++ amaster: *mut c_int, ++ name: *mut c_char, ++ termp: *mut termios, ++ winp: *mut crate::winsize, ++ ) -> crate::pid_t; ++ pub fn login_tty(fd: c_int) -> c_int; ++ ++ pub fn uname(buf: *mut crate::utsname) -> c_int; ++ ++ pub fn getpeereid(socket: c_int, euid: *mut crate::uid_t, egid: *mut crate::gid_t) -> c_int; ++ ++ pub fn strerror_r(errnum: c_int, buf: *mut c_char, buflen: size_t) -> c_int; ++ ++ pub fn abs(i: c_int) -> c_int; ++ pub fn labs(i: c_long) -> c_long; ++ pub fn rand() -> c_int; ++ pub fn srand(seed: c_uint); ++ ++ pub fn setpwent(); ++ pub fn endpwent(); ++ pub fn getpwent() -> *mut passwd; ++ pub fn setgrent(); ++ pub fn endgrent(); ++ pub fn getgrent() -> *mut crate::group; ++ pub fn setspent(); ++ pub fn endspent(); ++ ++ pub fn shm_open(name: *const c_char, oflag: c_int, mode: mode_t) -> c_int; ++ ++ pub fn ftok(pathname: *const c_char, proj_id: c_int) -> crate::key_t; ++ pub fn mprotect(addr: *mut c_void, len: size_t, prot: c_int) -> c_int; ++ ++ pub fn posix_fallocate(fd: c_int, offset: off_t, len: off_t) -> c_int; ++ pub fn mkostemp(template: *mut c_char, flags: c_int) -> c_int; ++ pub fn mkostemps(template: *mut c_char, suffixlen: c_int, flags: c_int) -> c_int; ++ pub fn sigtimedwait( ++ set: *const sigset_t, ++ info: *mut siginfo_t, ++ timeout: *const crate::timespec, ++ ) -> c_int; ++ pub fn sigwaitinfo(set: *const sigset_t, info: *mut siginfo_t) -> c_int; ++ pub fn pthread_setschedprio(native: crate::pthread_t, priority: c_int) -> c_int; ++ ++ pub fn if_nameindex() -> *mut if_nameindex; ++ pub fn if_freenameindex(ptr: *mut if_nameindex); ++ ++ pub fn glob( ++ pattern: *const c_char, ++ flags: c_int, ++ errfunc: Option c_int>, ++ pglob: *mut crate::glob_t, ++ ) -> c_int; ++ pub fn globfree(pglob: *mut crate::glob_t); ++ ++ pub fn posix_madvise(addr: *mut c_void, len: size_t, advice: c_int) -> c_int; ++ ++ pub fn shm_unlink(name: *const c_char) -> c_int; ++ ++ pub fn seekdir(dirp: *mut crate::DIR, loc: c_long); ++ ++ pub fn telldir(dirp: *mut crate::DIR) -> c_long; ++ ++ pub fn msync(addr: *mut c_void, len: size_t, flags: c_int) -> c_int; ++ ++ pub fn recvfrom( ++ socket: c_int, ++ buf: *mut c_void, ++ len: size_t, ++ flags: c_int, ++ addr: *mut crate::sockaddr, ++ addrlen: *mut crate::socklen_t, ++ ) -> ssize_t; ++ pub fn mkstemps(template: *mut c_char, suffixlen: c_int) -> c_int; ++ ++ pub fn getdomainname(name: *mut c_char, len: size_t) -> c_int; ++ pub fn setdomainname(name: *const c_char, len: size_t) -> c_int; ++ pub fn sync(); ++ pub fn pthread_getschedparam( ++ native: crate::pthread_t, ++ policy: *mut c_int, ++ param: *mut crate::sched_param, ++ ) -> c_int; ++ pub fn umount(target: *const c_char, flags: c_int) -> c_int; ++ pub fn sched_get_priority_max(policy: c_int) -> c_int; ++ pub fn settimeofday(tv: *const crate::timeval, tz: *const c_void) -> c_int; ++ pub fn sched_rr_get_interval(pid: crate::pid_t, tp: *mut crate::timespec) -> c_int; ++ pub fn sem_timedwait(sem: *mut sem_t, abstime: *const crate::timespec) -> c_int; ++ pub fn sem_getvalue(sem: *mut sem_t, sval: *mut c_int) -> c_int; ++ pub fn sched_setparam(pid: crate::pid_t, param: *const crate::sched_param) -> c_int; ++ pub fn mount( ++ special_device: *const c_char, ++ mount_directory: *const c_char, ++ flags: c_int, ++ mount_type: *const c_char, ++ mount_data: *const c_void, ++ mount_datalen: c_int, ++ ) -> c_int; ++ pub fn sched_getparam(pid: crate::pid_t, param: *mut crate::sched_param) -> c_int; ++ pub fn pthread_mutex_consistent(mutex: *mut pthread_mutex_t) -> c_int; ++ pub fn pthread_mutex_timedlock( ++ lock: *mut pthread_mutex_t, ++ abstime: *const crate::timespec, ++ ) -> c_int; ++ pub fn pthread_spin_init(lock: *mut crate::pthread_spinlock_t, pshared: c_int) -> c_int; ++ pub fn pthread_spin_destroy(lock: *mut crate::pthread_spinlock_t) -> c_int; ++ pub fn pthread_spin_lock(lock: *mut crate::pthread_spinlock_t) -> c_int; ++ pub fn pthread_spin_trylock(lock: *mut crate::pthread_spinlock_t) -> c_int; ++ pub fn pthread_spin_unlock(lock: *mut crate::pthread_spinlock_t) -> c_int; ++ pub fn pthread_barrierattr_init(__attr: *mut crate::pthread_barrierattr_t) -> c_int; ++ pub fn pthread_barrierattr_destroy(__attr: *mut crate::pthread_barrierattr_t) -> c_int; ++ pub fn pthread_barrierattr_getpshared( ++ __attr: *const crate::pthread_barrierattr_t, ++ __pshared: *mut c_int, ++ ) -> c_int; ++ pub fn pthread_barrierattr_setpshared( ++ __attr: *mut crate::pthread_barrierattr_t, ++ __pshared: c_int, ++ ) -> c_int; ++ pub fn pthread_barrier_init( ++ __barrier: *mut crate::pthread_barrier_t, ++ __attr: *const crate::pthread_barrierattr_t, ++ __count: c_uint, ++ ) -> c_int; ++ pub fn pthread_barrier_destroy(__barrier: *mut crate::pthread_barrier_t) -> c_int; ++ pub fn pthread_barrier_wait(__barrier: *mut crate::pthread_barrier_t) -> c_int; ++ ++ pub fn sched_getscheduler(pid: crate::pid_t) -> c_int; ++ pub fn clock_nanosleep( ++ clk_id: crate::clockid_t, ++ flags: c_int, ++ rqtp: *const crate::timespec, ++ rmtp: *mut crate::timespec, ++ ) -> c_int; ++ pub fn pthread_attr_getguardsize( ++ attr: *const crate::pthread_attr_t, ++ guardsize: *mut size_t, ++ ) -> c_int; ++ pub fn pthread_attr_setguardsize(attr: *mut crate::pthread_attr_t, guardsize: size_t) -> c_int; ++ pub fn sethostname(name: *const c_char, len: size_t) -> c_int; ++ pub fn sched_get_priority_min(policy: c_int) -> c_int; ++ pub fn pthread_condattr_getpshared( ++ attr: *const pthread_condattr_t, ++ pshared: *mut c_int, ++ ) -> c_int; ++ pub fn pthread_setschedparam( ++ native: crate::pthread_t, ++ policy: c_int, ++ param: *const crate::sched_param, ++ ) -> c_int; ++ pub fn sched_setscheduler( ++ pid: crate::pid_t, ++ policy: c_int, ++ param: *const crate::sched_param, ++ ) -> c_int; ++ pub fn sigsuspend(mask: *const crate::sigset_t) -> c_int; ++ pub fn getgrgid_r( ++ gid: crate::gid_t, ++ grp: *mut crate::group, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut crate::group, ++ ) -> c_int; ++ pub fn sem_close(sem: *mut sem_t) -> c_int; ++ pub fn getdtablesize() -> c_int; ++ pub fn getgrnam_r( ++ name: *const c_char, ++ grp: *mut crate::group, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut crate::group, ++ ) -> c_int; ++ pub fn initgroups(user: *const c_char, group: crate::gid_t) -> c_int; ++ pub fn pthread_sigmask(how: c_int, set: *const sigset_t, oldset: *mut sigset_t) -> c_int; ++ pub fn sem_open(name: *const c_char, oflag: c_int, ...) -> *mut sem_t; ++ pub fn getgrnam(name: *const c_char) -> *mut crate::group; ++ pub fn pthread_cancel(thread: crate::pthread_t) -> c_int; ++ pub fn pthread_kill(thread: crate::pthread_t, sig: c_int) -> c_int; ++ pub fn sem_unlink(name: *const c_char) -> c_int; ++ pub fn daemon(nochdir: c_int, noclose: c_int) -> c_int; ++ pub fn getpwnam_r( ++ name: *const c_char, ++ pwd: *mut passwd, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut passwd, ++ ) -> c_int; ++ pub fn getpwuid_r( ++ uid: crate::uid_t, ++ pwd: *mut passwd, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut passwd, ++ ) -> c_int; ++ pub fn sigwait(set: *const sigset_t, sig: *mut c_int) -> c_int; ++ pub fn pthread_atfork( ++ prepare: Option, ++ parent: Option, ++ child: Option, ++ ) -> c_int; ++ pub fn getgrgid(gid: crate::gid_t) -> *mut crate::group; ++ pub fn getgrouplist( ++ user: *const c_char, ++ group: crate::gid_t, ++ groups: *mut crate::gid_t, ++ ngroups: *mut c_int, ++ ) -> c_int; ++ pub fn pthread_mutexattr_getpshared( ++ attr: *const pthread_mutexattr_t, ++ pshared: *mut c_int, ++ ) -> c_int; ++ pub fn pthread_mutexattr_getrobust( ++ attr: *const pthread_mutexattr_t, ++ robustness: *mut c_int, ++ ) -> c_int; ++ pub fn pthread_mutexattr_setrobust(attr: *mut pthread_mutexattr_t, robustness: c_int) -> c_int; ++ pub fn pthread_create( ++ native: *mut crate::pthread_t, ++ attr: *const crate::pthread_attr_t, ++ f: extern "C" fn(*mut c_void) -> *mut c_void, ++ value: *mut c_void, ++ ) -> c_int; ++ pub fn getitimer(which: c_int, curr_value: *mut crate::itimerval) -> c_int; ++ pub fn setitimer( ++ which: c_int, ++ value: *const crate::itimerval, ++ ovalue: *mut crate::itimerval, ++ ) -> c_int; ++ pub fn posix_spawn( ++ pid: *mut crate::pid_t, ++ path: *const c_char, ++ file_actions: *const crate::posix_spawn_file_actions_t, ++ attrp: *const crate::posix_spawnattr_t, ++ argv: *const *mut c_char, ++ envp: *const *mut c_char, ++ ) -> c_int; ++ pub fn posix_spawnp( ++ pid: *mut crate::pid_t, ++ file: *const c_char, ++ file_actions: *const crate::posix_spawn_file_actions_t, ++ attrp: *const crate::posix_spawnattr_t, ++ argv: *const *mut c_char, ++ envp: *const *mut c_char, ++ ) -> 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_getsigdefault( ++ attr: *const posix_spawnattr_t, ++ default: *mut crate::sigset_t, ++ ) -> c_int; ++ pub fn posix_spawnattr_setsigdefault( ++ attr: *mut posix_spawnattr_t, ++ default: *const crate::sigset_t, ++ ) -> c_int; ++ pub fn posix_spawnattr_getsigmask( ++ attr: *const posix_spawnattr_t, ++ default: *mut crate::sigset_t, ++ ) -> c_int; ++ pub fn posix_spawnattr_setsigmask( ++ attr: *mut posix_spawnattr_t, ++ default: *const crate::sigset_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, ++ flags: *mut crate::pid_t, ++ ) -> c_int; ++ pub fn posix_spawnattr_setpgroup(attr: *mut posix_spawnattr_t, flags: crate::pid_t) -> c_int; ++ pub fn posix_spawnattr_getschedpolicy( ++ attr: *const posix_spawnattr_t, ++ flags: *mut c_int, ++ ) -> c_int; ++ pub fn posix_spawnattr_setschedpolicy(attr: *mut posix_spawnattr_t, flags: c_int) -> c_int; ++ pub fn posix_spawnattr_getschedparam( ++ attr: *const posix_spawnattr_t, ++ param: *mut crate::sched_param, ++ ) -> c_int; ++ pub fn posix_spawnattr_setschedparam( ++ attr: *mut posix_spawnattr_t, ++ param: *const crate::sched_param, ++ ) -> c_int; ++ ++ pub fn posix_spawn_file_actions_init(actions: *mut posix_spawn_file_actions_t) -> c_int; ++ pub fn posix_spawn_file_actions_destroy(actions: *mut posix_spawn_file_actions_t) -> c_int; ++ pub fn posix_spawn_file_actions_addopen( ++ actions: *mut posix_spawn_file_actions_t, ++ fd: c_int, ++ path: *const c_char, ++ oflag: c_int, ++ mode: crate::mode_t, ++ ) -> c_int; ++ pub fn posix_spawn_file_actions_addclose( ++ actions: *mut posix_spawn_file_actions_t, ++ fd: c_int, ++ ) -> c_int; ++ pub fn posix_spawn_file_actions_adddup2( ++ actions: *mut posix_spawn_file_actions_t, ++ fd: c_int, ++ newfd: c_int, ++ ) -> c_int; ++ pub fn popen(command: *const c_char, mode: *const c_char) -> *mut crate::FILE; ++ pub fn faccessat(dirfd: c_int, pathname: *const c_char, mode: c_int, flags: c_int) -> c_int; ++ pub fn inotify_rm_watch(fd: c_int, wd: c_int) -> c_int; ++ pub fn inotify_init() -> c_int; ++ pub fn inotify_add_watch(fd: c_int, path: *const c_char, mask: u32) -> c_int; ++ ++ pub fn gettid() -> crate::pid_t; ++ ++ pub fn pthread_getcpuclockid(thread: crate::pthread_t, clk_id: *mut crate::clockid_t) -> c_int; ++ ++ pub fn getnameinfo( ++ sa: *const crate::sockaddr, ++ salen: crate::socklen_t, ++ host: *mut c_char, ++ hostlen: crate::socklen_t, ++ serv: *mut c_char, ++ servlen: crate::socklen_t, ++ flags: c_int, ++ ) -> c_int; ++ ++ pub fn sendmmsg( ++ sockfd: c_int, ++ msgvec: *mut crate::mmsghdr, ++ vlen: c_uint, ++ flags: c_uint, ++ ) -> c_int; ++ pub fn recvmmsg( ++ sockfd: c_int, ++ msgvec: *mut crate::mmsghdr, ++ vlen: c_uint, ++ flags: c_uint, ++ timeout: *mut crate::timespec, ++ ) -> c_int; ++ ++ pub fn mallopt(param: c_int, value: i64) -> c_int; ++ pub fn gettimeofday(tp: *mut crate::timeval, tz: *mut c_void) -> c_int; ++ ++ pub fn ctermid(s: *mut c_char) -> *mut c_char; ++ pub fn ioctl(fd: c_int, request: c_int, ...) -> c_int; ++ ++ pub fn mallinfo() -> crate::mallinfo; ++ pub fn getpwent_r( ++ pwd: *mut crate::passwd, ++ buf: *mut c_char, ++ __bufsize: c_int, ++ __result: *mut *mut crate::passwd, ++ ) -> c_int; ++ pub fn pthread_getname_np(thread: crate::pthread_t, name: *mut c_char, len: c_int) -> c_int; ++ pub fn pthread_setname_np(thread: crate::pthread_t, name: *const c_char) -> c_int; ++ ++ pub fn sysctl( ++ _: *const c_int, ++ _: c_uint, ++ _: *mut c_void, ++ _: *mut size_t, ++ _: *const c_void, ++ _: size_t, ++ ) -> c_int; ++ ++ pub fn getrlimit(resource: c_int, rlim: *mut crate::rlimit) -> c_int; ++ pub fn setrlimit(resource: c_int, rlp: *const crate::rlimit) -> c_int; ++ ++ pub fn lio_listio( ++ __mode: c_int, ++ __list: *const *mut aiocb, ++ __nent: c_int, ++ __sig: *mut sigevent, ++ ) -> c_int; ++ ++ pub fn dl_iterate_phdr( ++ callback: Option< ++ unsafe extern "C" fn( ++ // The original .h file declares this as *const, but for consistency with other platforms, ++ // changing this to *mut to make it easier to use. ++ // Maybe in v0.3 all platforms should use this as a *const. ++ info: *mut dl_phdr_info, ++ size: size_t, ++ data: *mut c_void, ++ ) -> c_int, ++ >, ++ data: *mut c_void, ++ ) -> c_int; ++ ++ pub fn memset_s(s: *mut c_void, smax: size_t, c: c_int, n: size_t) -> c_int; ++ ++ pub fn regcomp(__preg: *mut crate::regex_t, __pattern: *const c_char, __cflags: c_int) ++ -> c_int; ++ pub fn regexec( ++ __preg: *const crate::regex_t, ++ __str: *const c_char, ++ __nmatch: size_t, ++ __pmatch: *mut crate::regmatch_t, ++ __eflags: c_int, ++ ) -> c_int; ++ pub fn regerror( ++ __errcode: c_int, ++ __preg: *const crate::regex_t, ++ __errbuf: *mut c_char, ++ __errbuf_size: size_t, ++ ) -> size_t; ++ pub fn regfree(__preg: *mut crate::regex_t); ++ pub fn dirfd(__dirp: *mut crate::DIR) -> c_int; ++ pub fn dircntl(dir: *mut crate::DIR, cmd: c_int, ...) -> c_int; ++ ++ pub fn aio_cancel(__fd: c_int, __aiocbp: *mut crate::aiocb) -> c_int; ++ pub fn aio_error(__aiocbp: *const crate::aiocb) -> c_int; ++ pub fn aio_fsync(__operation: c_int, __aiocbp: *mut crate::aiocb) -> c_int; ++ pub fn aio_read(__aiocbp: *mut crate::aiocb) -> c_int; ++ pub fn aio_return(__aiocpb: *mut crate::aiocb) -> ssize_t; ++ pub fn aio_suspend( ++ __list: *const *const crate::aiocb, ++ __nent: c_int, ++ __timeout: *const crate::timespec, ++ ) -> c_int; ++ pub fn aio_write(__aiocpb: *mut crate::aiocb) -> c_int; ++ ++ pub fn mq_close(__mqdes: crate::mqd_t) -> c_int; ++ pub fn mq_getattr(__mqdes: crate::mqd_t, __mqstat: *mut crate::mq_attr) -> c_int; ++ pub fn mq_notify(__mqdes: crate::mqd_t, __notification: *const crate::sigevent) -> c_int; ++ pub fn mq_open(__name: *const c_char, __oflag: c_int, ...) -> crate::mqd_t; ++ pub fn mq_receive( ++ __mqdes: crate::mqd_t, ++ __msg_ptr: *mut c_char, ++ __msg_len: size_t, ++ __msg_prio: *mut c_uint, ++ ) -> ssize_t; ++ pub fn mq_send( ++ __mqdes: crate::mqd_t, ++ __msg_ptr: *const c_char, ++ __msg_len: size_t, ++ __msg_prio: c_uint, ++ ) -> c_int; ++ pub fn mq_setattr( ++ __mqdes: crate::mqd_t, ++ __mqstat: *const mq_attr, ++ __omqstat: *mut mq_attr, ++ ) -> c_int; ++ pub fn mq_timedreceive( ++ __mqdes: crate::mqd_t, ++ __msg_ptr: *mut c_char, ++ __msg_len: size_t, ++ __msg_prio: *mut c_uint, ++ __abs_timeout: *const crate::timespec, ++ ) -> ssize_t; ++ pub fn mq_timedsend( ++ __mqdes: crate::mqd_t, ++ __msg_ptr: *const c_char, ++ __msg_len: size_t, ++ __msg_prio: c_uint, ++ __abs_timeout: *const crate::timespec, ++ ) -> c_int; ++ pub fn mq_unlink(__name: *const c_char) -> c_int; ++ pub fn __get_errno_ptr() -> *mut c_int; ++ ++ // System page, see https://www.qnx.com/developers/docs/7.1#com.qnx.doc.neutrino.building/topic/syspage/syspage_about.html ++ pub static mut _syspage_ptr: *mut syspage_entry; ++ ++ // Function on the stack after a call to pthread_create(). This is used ++ // as a sentinel to work around an infitnite loop in the unwinding code. ++ pub fn __my_thread_exit(value_ptr: *mut *const c_void); ++} ++ ++// Models the implementation in stdlib.h. Ctest will fail if trying to use the ++// default symbol from libc ++pub unsafe fn atexit(cb: extern "C" fn()) -> c_int { ++ extern "C" { ++ static __dso_handle: *mut c_void; ++ pub fn __cxa_atexit(cb: extern "C" fn(), __arg: *mut c_void, __dso: *mut c_void) -> c_int; ++ } ++ __cxa_atexit(cb, 0 as *mut c_void, __dso_handle) ++} ++ ++impl siginfo_t { ++ pub unsafe fn si_addr(&self) -> *mut c_void { ++ #[repr(C)] ++ struct siginfo_si_addr { ++ _pad: [u8; 32], ++ si_addr: *mut c_void, ++ } ++ (*(self as *const siginfo_t as *const siginfo_si_addr)).si_addr ++ } ++ ++ pub unsafe fn si_value(&self) -> crate::sigval { ++ #[repr(C)] ++ struct siginfo_si_value { ++ _pad: [u8; 32], ++ si_value: crate::sigval, ++ } ++ (*(self as *const siginfo_t as *const siginfo_si_value)).si_value ++ } ++ ++ pub unsafe fn si_pid(&self) -> crate::pid_t { ++ #[repr(C)] ++ struct siginfo_si_pid { ++ _pad: [u8; 16], ++ si_pid: crate::pid_t, ++ } ++ (*(self as *const siginfo_t as *const siginfo_si_pid)).si_pid ++ } ++ ++ pub unsafe fn si_uid(&self) -> crate::uid_t { ++ #[repr(C)] ++ struct siginfo_si_uid { ++ _pad: [u8; 24], ++ si_uid: crate::uid_t, ++ } ++ (*(self as *const siginfo_t as *const siginfo_si_uid)).si_uid ++ } ++ ++ pub unsafe fn si_status(&self) -> c_int { ++ #[repr(C)] ++ struct siginfo_si_status { ++ _pad: [u8; 28], ++ si_status: c_int, ++ } ++ (*(self as *const siginfo_t as *const siginfo_si_status)).si_status ++ } ++} ++ ++cfg_if! { ++ if #[cfg(target_arch = "x86_64")] { ++ mod x86_64; ++ pub use self::x86_64::*; ++ } else if #[cfg(target_arch = "aarch64")] { ++ mod aarch64; ++ pub use self::aarch64::*; ++ } else { ++ panic!("Unsupported arch"); ++ } ++} ++ ++mod neutrino; ++pub use self::neutrino::*; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/nto/neutrino.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/nto/neutrino.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/nto/neutrino.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/nto/neutrino.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,1268 @@ ++use crate::prelude::*; ++ ++pub type nto_job_t = crate::sync_t; ++ ++s! { ++ pub struct syspage_entry_info { ++ pub entry_off: u16, ++ pub entry_size: u16, ++ } ++ pub struct syspage_array_info { ++ entry_off: u16, ++ entry_size: u16, ++ element_size: u16, ++ } ++ ++ pub struct intrspin { ++ pub value: c_uint, // volatile ++ } ++ ++ pub struct iov_t { ++ pub iov_base: *mut c_void, // union ++ pub iov_len: size_t, ++ } ++ ++ pub struct _itimer { ++ pub nsec: u64, ++ pub interval_nsec: u64, ++ } ++ ++ pub struct _msg_info64 { ++ pub nd: u32, ++ pub srcnd: u32, ++ pub pid: crate::pid_t, ++ pub tid: i32, ++ pub chid: i32, ++ pub scoid: i32, ++ pub coid: i32, ++ pub priority: i16, ++ pub flags: i16, ++ pub msglen: isize, ++ pub srcmsglen: isize, ++ pub dstmsglen: isize, ++ pub type_id: u32, ++ reserved: u32, ++ } ++ ++ pub struct _cred_info { ++ pub ruid: crate::uid_t, ++ pub euid: crate::uid_t, ++ pub suid: crate::uid_t, ++ pub rgid: crate::gid_t, ++ pub egid: crate::gid_t, ++ pub sgid: crate::gid_t, ++ pub ngroups: u32, ++ pub grouplist: [crate::gid_t; 8], ++ } ++ ++ pub struct _client_info { ++ pub nd: u32, ++ pub pid: crate::pid_t, ++ pub sid: crate::pid_t, ++ pub flags: u32, ++ pub cred: crate::_cred_info, ++ } ++ ++ pub struct _client_able { ++ pub ability: u32, ++ pub flags: u32, ++ pub range_lo: u64, ++ pub range_hi: u64, ++ } ++ ++ pub struct nto_channel_config { ++ pub event: crate::sigevent, ++ pub num_pulses: c_uint, ++ pub rearm_threshold: c_uint, ++ pub options: c_uint, ++ reserved: [c_uint; 3], ++ } ++ ++ // TODO: The following structures are defined in a header file which doesn't ++ // appear as part of the default headers found in a standard installation ++ // of Neutrino 7.1 SDP. Commented out for now. ++ //pub struct _asyncmsg_put_header { ++ // pub err: c_int, ++ // pub iov: *mut crate::iov_t, ++ // pub parts: c_int, ++ // pub handle: c_uint, ++ // pub cb: Option< ++ // unsafe extern "C" fn( ++ // err: c_int, ++ // buf: *mut c_void, ++ // handle: c_uint, ++ // ) -> c_int>, ++ // pub put_hdr_flags: c_uint, ++ //} ++ ++ //pub struct _asyncmsg_connection_attr { ++ // pub call_back: Option< ++ // unsafe extern "C" fn( ++ // err: c_int, ++ // buff: *mut c_void, ++ // handle: c_uint, ++ // ) -> c_int>, ++ // pub buffer_size: size_t, ++ // pub max_num_buffer: c_uint, ++ // pub trigger_num_msg: c_uint, ++ // pub trigger_time: crate::_itimer, ++ // reserve: c_uint, ++ //} ++ ++ //pub struct _asyncmsg_connection_descriptor { ++ // pub flags: c_uint, ++ // pub sendq_size: c_uint, ++ // pub sendq_head: c_uint, ++ // pub sendq_tail: c_uint, ++ // pub sendq_free: c_uint, ++ // pub err: c_int, ++ // pub ev: crate::sigevent, ++ // pub num_curmsg: c_uint, ++ // pub ttimer: crate::timer_t, ++ // pub block_con: crate::pthread_cond_t, ++ // pub mu: crate::pthread_mutex_t, ++ // reserved: c_uint, ++ // pub attr: crate::_asyncmsg_connection_attr, ++ // pub reserves: [c_uint; 3], ++ // pub sendq: [crate::_asyncmsg_put_header; 1], // flexarray ++ //} ++ ++ pub struct __c_anonymous_struct_ev { ++ pub event: crate::sigevent, ++ pub coid: c_int, ++ } ++ ++ pub struct _channel_connect_attr { ++ // union ++ pub ev: crate::__c_anonymous_struct_ev, ++ } ++ ++ pub struct _sighandler_info { ++ pub siginfo: crate::siginfo_t, ++ pub handler: Option, ++ pub context: *mut c_void, ++ } ++ ++ pub struct __c_anonymous_struct_time { ++ pub length: c_uint, ++ pub scale: c_uint, ++ } ++ ++ pub struct _idle_hook { ++ pub hook_size: c_uint, ++ pub cmd: c_uint, ++ pub mode: c_uint, ++ pub latency: c_uint, ++ pub next_fire: u64, ++ pub curr_time: u64, ++ pub tod_adjust: u64, ++ pub resp: c_uint, ++ pub time: __c_anonymous_struct_time, ++ pub trigger: crate::sigevent, ++ pub intrs: *mut c_uint, ++ pub block_stack_size: c_uint, ++ } ++ ++ pub struct _clockadjust { ++ pub tick_count: u32, ++ pub tick_nsec_inc: i32, ++ } ++ ++ pub struct qtime_entry { ++ pub cycles_per_sec: u64, ++ pub nsec_tod_adjust: u64, // volatile ++ pub nsec: u64, // volatile ++ pub nsec_inc: u32, ++ pub boot_time: u32, ++ pub adjust: _clockadjust, ++ pub timer_rate: u32, ++ pub timer_scale: i32, ++ pub timer_load: u32, ++ pub intr: i32, ++ pub epoch: u32, ++ pub flags: u32, ++ pub rr_interval_mul: u32, ++ pub timer_load_hi: u32, ++ pub nsec_stable: u64, // volatile ++ pub timer_load_max: u64, ++ pub timer_prog_time: u32, ++ spare: [u32; 7], ++ } ++ ++ pub struct _sched_info { ++ pub priority_min: c_int, ++ pub priority_max: c_int, ++ pub interval: u64, ++ pub priority_priv: c_int, ++ reserved: [c_int; 11], ++ } ++ ++ pub struct _timer_info { ++ pub itime: crate::_itimer, ++ pub otime: crate::_itimer, ++ pub flags: u32, ++ pub tid: i32, ++ pub notify: i32, ++ pub clockid: crate::clockid_t, ++ pub overruns: u32, ++ pub event: crate::sigevent, // union ++ } ++ ++ pub struct _clockperiod { ++ pub nsec: u32, ++ pub fract: i32, ++ } ++} ++ ++s_no_extra_traits! { ++ #[repr(align(8))] ++ pub struct syspage_entry { ++ pub size: u16, ++ pub total_size: u16, ++ pub type_: u16, ++ pub num_cpu: u16, ++ pub system_private: syspage_entry_info, ++ pub old_asinfo: syspage_entry_info, ++ pub __mangle_name_to_cause_compilation_errs_meminfo: syspage_entry_info, ++ pub hwinfo: syspage_entry_info, ++ pub old_cpuinfo: syspage_entry_info, ++ pub old_cacheattr: syspage_entry_info, ++ pub qtime: syspage_entry_info, ++ pub callout: syspage_entry_info, ++ pub callin: syspage_entry_info, ++ pub typed_strings: syspage_entry_info, ++ pub strings: syspage_entry_info, ++ pub old_intrinfo: syspage_entry_info, ++ pub smp: syspage_entry_info, ++ pub pminfo: syspage_entry_info, ++ pub old_mdriver: syspage_entry_info, ++ spare0: [u32; 1], ++ __reserved: [u8; 160], // anonymous union with architecture dependent structs ++ pub new_asinfo: syspage_array_info, ++ pub new_cpuinfo: syspage_array_info, ++ pub new_cacheattr: syspage_array_info, ++ pub new_intrinfo: syspage_array_info, ++ pub new_mdriver: syspage_array_info, ++ } ++} ++ ++pub const SYSMGR_PID: u32 = 1; ++pub const SYSMGR_CHID: u32 = 1; ++pub const SYSMGR_COID: u32 = _NTO_SIDE_CHANNEL; ++pub const SYSMGR_HANDLE: u32 = 0; ++ ++pub const STATE_DEAD: c_int = 0x00; ++pub const STATE_RUNNING: c_int = 0x01; ++pub const STATE_READY: c_int = 0x02; ++pub const STATE_STOPPED: c_int = 0x03; ++pub const STATE_SEND: c_int = 0x04; ++pub const STATE_RECEIVE: c_int = 0x05; ++pub const STATE_REPLY: c_int = 0x06; ++pub const STATE_STACK: c_int = 0x07; ++pub const STATE_WAITTHREAD: c_int = 0x08; ++pub const STATE_WAITPAGE: c_int = 0x09; ++pub const STATE_SIGSUSPEND: c_int = 0x0a; ++pub const STATE_SIGWAITINFO: c_int = 0x0b; ++pub const STATE_NANOSLEEP: c_int = 0x0c; ++pub const STATE_MUTEX: c_int = 0x0d; ++pub const STATE_CONDVAR: c_int = 0x0e; ++pub const STATE_JOIN: c_int = 0x0f; ++pub const STATE_INTR: c_int = 0x10; ++pub const STATE_SEM: c_int = 0x11; ++pub const STATE_WAITCTX: c_int = 0x12; ++pub const STATE_NET_SEND: c_int = 0x13; ++pub const STATE_NET_REPLY: c_int = 0x14; ++pub const STATE_MAX: c_int = 0x18; ++ ++pub const _NTO_TIMEOUT_RECEIVE: i32 = 1 << STATE_RECEIVE; ++pub const _NTO_TIMEOUT_SEND: i32 = 1 << STATE_SEND; ++pub const _NTO_TIMEOUT_REPLY: i32 = 1 << STATE_REPLY; ++pub const _NTO_TIMEOUT_SIGSUSPEND: i32 = 1 << STATE_SIGSUSPEND; ++pub const _NTO_TIMEOUT_SIGWAITINFO: i32 = 1 << STATE_SIGWAITINFO; ++pub const _NTO_TIMEOUT_NANOSLEEP: i32 = 1 << STATE_NANOSLEEP; ++pub const _NTO_TIMEOUT_MUTEX: i32 = 1 << STATE_MUTEX; ++pub const _NTO_TIMEOUT_CONDVAR: i32 = 1 << STATE_CONDVAR; ++pub const _NTO_TIMEOUT_JOIN: i32 = 1 << STATE_JOIN; ++pub const _NTO_TIMEOUT_INTR: i32 = 1 << STATE_INTR; ++pub const _NTO_TIMEOUT_SEM: i32 = 1 << STATE_SEM; ++ ++pub const _NTO_MI_ENDIAN_BIG: u32 = 1; ++pub const _NTO_MI_ENDIAN_DIFF: u32 = 2; ++pub const _NTO_MI_UNBLOCK_REQ: u32 = 256; ++pub const _NTO_MI_NET_CRED_DIRTY: u32 = 512; ++pub const _NTO_MI_CONSTRAINED: u32 = 1024; ++pub const _NTO_MI_CHROOT: u32 = 2048; ++pub const _NTO_MI_BITS_64: u32 = 4096; ++pub const _NTO_MI_BITS_DIFF: u32 = 8192; ++pub const _NTO_MI_SANDBOX: u32 = 16384; ++ ++pub const _NTO_CI_ENDIAN_BIG: u32 = 1; ++pub const _NTO_CI_BKGND_PGRP: u32 = 4; ++pub const _NTO_CI_ORPHAN_PGRP: u32 = 8; ++pub const _NTO_CI_STOPPED: u32 = 128; ++pub const _NTO_CI_UNABLE: u32 = 256; ++pub const _NTO_CI_TYPE_ID: u32 = 512; ++pub const _NTO_CI_CHROOT: u32 = 2048; ++pub const _NTO_CI_BITS_64: u32 = 4096; ++pub const _NTO_CI_SANDBOX: u32 = 16384; ++pub const _NTO_CI_LOADER: u32 = 32768; ++pub const _NTO_CI_FULL_GROUPS: u32 = 2147483648; ++ ++pub const _NTO_TI_ACTIVE: u32 = 1; ++pub const _NTO_TI_ABSOLUTE: u32 = 2; ++pub const _NTO_TI_EXPIRED: u32 = 4; ++pub const _NTO_TI_TOD_BASED: u32 = 8; ++pub const _NTO_TI_TARGET_PROCESS: u32 = 16; ++pub const _NTO_TI_REPORT_TOLERANCE: u32 = 32; ++pub const _NTO_TI_PRECISE: u32 = 64; ++pub const _NTO_TI_TOLERANT: u32 = 128; ++pub const _NTO_TI_WAKEUP: u32 = 256; ++pub const _NTO_TI_PROCESS_TOLERANT: u32 = 512; ++pub const _NTO_TI_HIGH_RESOLUTION: u32 = 1024; ++ ++pub const _PULSE_TYPE: u32 = 0; ++pub const _PULSE_SUBTYPE: u32 = 0; ++pub const _PULSE_CODE_UNBLOCK: i32 = -32; ++pub const _PULSE_CODE_DISCONNECT: i32 = -33; ++pub const _PULSE_CODE_THREADDEATH: i32 = -34; ++pub const _PULSE_CODE_COIDDEATH: i32 = -35; ++pub const _PULSE_CODE_NET_ACK: i32 = -36; ++pub const _PULSE_CODE_NET_UNBLOCK: i32 = -37; ++pub const _PULSE_CODE_NET_DETACH: i32 = -38; ++pub const _PULSE_CODE_RESTART: i32 = -39; ++pub const _PULSE_CODE_NORESTART: i32 = -40; ++pub const _PULSE_CODE_UNBLOCK_RESTART: i32 = -41; ++pub const _PULSE_CODE_UNBLOCK_TIMER: i32 = -42; ++pub const _PULSE_CODE_MINAVAIL: u32 = 0; ++pub const _PULSE_CODE_MAXAVAIL: u32 = 127; ++ ++pub const _NTO_HARD_FLAGS_END: u32 = 1; ++ ++pub const _NTO_PULSE_IF_UNIQUE: u32 = 4096; ++pub const _NTO_PULSE_REPLACE: u32 = 8192; ++ ++pub const _NTO_PF_NOCLDSTOP: u32 = 1; ++pub const _NTO_PF_LOADING: u32 = 2; ++pub const _NTO_PF_TERMING: u32 = 4; ++pub const _NTO_PF_ZOMBIE: u32 = 8; ++pub const _NTO_PF_NOZOMBIE: u32 = 16; ++pub const _NTO_PF_FORKED: u32 = 32; ++pub const _NTO_PF_ORPHAN_PGRP: u32 = 64; ++pub const _NTO_PF_STOPPED: u32 = 128; ++pub const _NTO_PF_DEBUG_STOPPED: u32 = 256; ++pub const _NTO_PF_BKGND_PGRP: u32 = 512; ++pub const _NTO_PF_NOISYNC: u32 = 1024; ++pub const _NTO_PF_CONTINUED: u32 = 2048; ++pub const _NTO_PF_CHECK_INTR: u32 = 4096; ++pub const _NTO_PF_COREDUMP: u32 = 8192; ++pub const _NTO_PF_RING0: u32 = 32768; ++pub const _NTO_PF_SLEADER: u32 = 65536; ++pub const _NTO_PF_WAITINFO: u32 = 131072; ++pub const _NTO_PF_DESTROYALL: u32 = 524288; ++pub const _NTO_PF_NOCOREDUMP: u32 = 1048576; ++pub const _NTO_PF_WAITDONE: u32 = 4194304; ++pub const _NTO_PF_TERM_WAITING: u32 = 8388608; ++pub const _NTO_PF_ASLR: u32 = 16777216; ++pub const _NTO_PF_EXECED: u32 = 33554432; ++pub const _NTO_PF_APP_STOPPED: u32 = 67108864; ++pub const _NTO_PF_64BIT: u32 = 134217728; ++pub const _NTO_PF_NET: u32 = 268435456; ++pub const _NTO_PF_NOLAZYSTACK: u32 = 536870912; ++pub const _NTO_PF_NOEXEC_STACK: u32 = 1073741824; ++pub const _NTO_PF_LOADER_PERMS: u32 = 2147483648; ++ ++pub const _NTO_TF_INTR_PENDING: u32 = 65536; ++pub const _NTO_TF_DETACHED: u32 = 131072; ++pub const _NTO_TF_SHR_MUTEX: u32 = 262144; ++pub const _NTO_TF_SHR_MUTEX_EUID: u32 = 524288; ++pub const _NTO_TF_THREADS_HOLD: u32 = 1048576; ++pub const _NTO_TF_UNBLOCK_REQ: u32 = 4194304; ++pub const _NTO_TF_ALIGN_FAULT: u32 = 16777216; ++pub const _NTO_TF_SSTEP: u32 = 33554432; ++pub const _NTO_TF_ALLOCED_STACK: u32 = 67108864; ++pub const _NTO_TF_NOMULTISIG: u32 = 134217728; ++pub const _NTO_TF_LOW_LATENCY: u32 = 268435456; ++pub const _NTO_TF_IOPRIV: u32 = 2147483648; ++ ++pub const _NTO_TCTL_IO_PRIV: u32 = 1; ++pub const _NTO_TCTL_THREADS_HOLD: u32 = 2; ++pub const _NTO_TCTL_THREADS_CONT: u32 = 3; ++pub const _NTO_TCTL_RUNMASK: u32 = 4; ++pub const _NTO_TCTL_ALIGN_FAULT: u32 = 5; ++pub const _NTO_TCTL_RUNMASK_GET_AND_SET: u32 = 6; ++pub const _NTO_TCTL_PERFCOUNT: u32 = 7; ++pub const _NTO_TCTL_ONE_THREAD_HOLD: u32 = 8; ++pub const _NTO_TCTL_ONE_THREAD_CONT: u32 = 9; ++pub const _NTO_TCTL_RUNMASK_GET_AND_SET_INHERIT: u32 = 10; ++pub const _NTO_TCTL_NAME: u32 = 11; ++pub const _NTO_TCTL_RCM_GET_AND_SET: u32 = 12; ++pub const _NTO_TCTL_SHR_MUTEX: u32 = 13; ++pub const _NTO_TCTL_IO: u32 = 14; ++pub const _NTO_TCTL_NET_KIF_GET_AND_SET: u32 = 15; ++pub const _NTO_TCTL_LOW_LATENCY: u32 = 16; ++pub const _NTO_TCTL_ADD_EXIT_EVENT: u32 = 17; ++pub const _NTO_TCTL_DEL_EXIT_EVENT: u32 = 18; ++pub const _NTO_TCTL_IO_LEVEL: u32 = 19; ++pub const _NTO_TCTL_RESERVED: u32 = 2147483648; ++pub const _NTO_TCTL_IO_LEVEL_INHERIT: u32 = 1073741824; ++pub const _NTO_IO_LEVEL_NONE: u32 = 1; ++pub const _NTO_IO_LEVEL_1: u32 = 2; ++pub const _NTO_IO_LEVEL_2: u32 = 3; ++ ++pub const _NTO_THREAD_NAME_MAX: u32 = 100; ++ ++pub const _NTO_CHF_FIXED_PRIORITY: u32 = 1; ++pub const _NTO_CHF_UNBLOCK: u32 = 2; ++pub const _NTO_CHF_THREAD_DEATH: u32 = 4; ++pub const _NTO_CHF_DISCONNECT: u32 = 8; ++pub const _NTO_CHF_NET_MSG: u32 = 16; ++pub const _NTO_CHF_SENDER_LEN: u32 = 32; ++pub const _NTO_CHF_COID_DISCONNECT: u32 = 64; ++pub const _NTO_CHF_REPLY_LEN: u32 = 128; ++pub const _NTO_CHF_PULSE_POOL: u32 = 256; ++pub const _NTO_CHF_ASYNC_NONBLOCK: u32 = 512; ++pub const _NTO_CHF_ASYNC: u32 = 1024; ++pub const _NTO_CHF_GLOBAL: u32 = 2048; ++pub const _NTO_CHF_PRIVATE: u32 = 4096; ++pub const _NTO_CHF_MSG_PAUSING: u32 = 8192; ++pub const _NTO_CHF_INHERIT_RUNMASK: u32 = 16384; ++pub const _NTO_CHF_UNBLOCK_TIMER: u32 = 32768; ++ ++pub const _NTO_CHO_CUSTOM_EVENT: u32 = 1; ++ ++pub const _NTO_COF_CLOEXEC: u32 = 1; ++pub const _NTO_COF_DEAD: u32 = 2; ++pub const _NTO_COF_NOSHARE: u32 = 64; ++pub const _NTO_COF_NETCON: u32 = 128; ++pub const _NTO_COF_NONBLOCK: u32 = 256; ++pub const _NTO_COF_ASYNC: u32 = 512; ++pub const _NTO_COF_GLOBAL: u32 = 1024; ++pub const _NTO_COF_NOEVENT: u32 = 2048; ++pub const _NTO_COF_INSECURE: u32 = 4096; ++pub const _NTO_COF_REG_EVENTS: u32 = 8192; ++pub const _NTO_COF_UNREG_EVENTS: u32 = 16384; ++pub const _NTO_COF_MASK: u32 = 65535; ++ ++pub const _NTO_SIDE_CHANNEL: u32 = 1073741824; ++ ++pub const _NTO_CONNECTION_SCOID: u32 = 65536; ++pub const _NTO_GLOBAL_CHANNEL: u32 = 1073741824; ++ ++pub const _NTO_TIMEOUT_MASK: u32 = (1 << STATE_MAX) - 1; ++pub const _NTO_TIMEOUT_ACTIVE: u32 = 1 << STATE_MAX; ++pub const _NTO_TIMEOUT_IMMEDIATE: u32 = 1 << (STATE_MAX + 1); ++ ++pub const _NTO_IC_LATENCY: u32 = 0; ++ ++pub const _NTO_INTR_FLAGS_END: u32 = 1; ++pub const _NTO_INTR_FLAGS_NO_UNMASK: u32 = 2; ++pub const _NTO_INTR_FLAGS_PROCESS: u32 = 4; ++pub const _NTO_INTR_FLAGS_TRK_MSK: u32 = 8; ++pub const _NTO_INTR_FLAGS_ARRAY: u32 = 16; ++pub const _NTO_INTR_FLAGS_EXCLUSIVE: u32 = 32; ++pub const _NTO_INTR_FLAGS_FPU: u32 = 64; ++ ++pub const _NTO_INTR_CLASS_EXTERNAL: u32 = 0; ++pub const _NTO_INTR_CLASS_SYNTHETIC: u32 = 2147418112; ++ ++pub const _NTO_INTR_SPARE: u32 = 2147483647; ++ ++pub const _NTO_HOOK_IDLE: u32 = 2147418113; ++pub const _NTO_HOOK_OVERDRIVE: u32 = 2147418114; ++pub const _NTO_HOOK_LAST: u32 = 2147418114; ++pub const _NTO_HOOK_IDLE2_FLAG: u32 = 32768; ++ ++pub const _NTO_IH_CMD_SLEEP_SETUP: u32 = 1; ++pub const _NTO_IH_CMD_SLEEP_BLOCK: u32 = 2; ++pub const _NTO_IH_CMD_SLEEP_WAKEUP: u32 = 4; ++pub const _NTO_IH_CMD_SLEEP_ONLINE: u32 = 8; ++pub const _NTO_IH_RESP_NEEDS_BLOCK: u32 = 1; ++pub const _NTO_IH_RESP_NEEDS_WAKEUP: u32 = 2; ++pub const _NTO_IH_RESP_NEEDS_ONLINE: u32 = 4; ++pub const _NTO_IH_RESP_SYNC_TIME: u32 = 16; ++pub const _NTO_IH_RESP_SYNC_TLB: u32 = 32; ++pub const _NTO_IH_RESP_SUGGEST_OFFLINE: u32 = 256; ++pub const _NTO_IH_RESP_SLEEP_MODE_REACHED: u32 = 512; ++pub const _NTO_IH_RESP_DELIVER_INTRS: u32 = 1024; ++ ++pub const _NTO_READIOV_SEND: u32 = 0; ++pub const _NTO_READIOV_REPLY: u32 = 1; ++ ++pub const _NTO_KEYDATA_VTID: u32 = 2147483648; ++ ++pub const _NTO_KEYDATA_PATHSIGN: u32 = 32768; ++pub const _NTO_KEYDATA_OP_MASK: u32 = 255; ++pub const _NTO_KEYDATA_VERIFY: u32 = 0; ++pub const _NTO_KEYDATA_CALCULATE: u32 = 1; ++pub const _NTO_KEYDATA_CALCULATE_REUSE: u32 = 2; ++pub const _NTO_KEYDATA_PATHSIGN_VERIFY: u32 = 32768; ++pub const _NTO_KEYDATA_PATHSIGN_CALCULATE: u32 = 32769; ++pub const _NTO_KEYDATA_PATHSIGN_CALCULATE_REUSE: u32 = 32770; ++ ++pub const _NTO_SCTL_SETPRIOCEILING: u32 = 1; ++pub const _NTO_SCTL_GETPRIOCEILING: u32 = 2; ++pub const _NTO_SCTL_SETEVENT: u32 = 3; ++pub const _NTO_SCTL_MUTEX_WAKEUP: u32 = 4; ++pub const _NTO_SCTL_MUTEX_CONSISTENT: u32 = 5; ++pub const _NTO_SCTL_SEM_VALUE: u32 = 6; ++ ++pub const _NTO_CLIENTINFO_GETGROUPS: u32 = 1; ++pub const _NTO_CLIENTINFO_GETTYPEID: u32 = 2; ++ ++extern "C" { ++ pub fn ChannelCreate(__flags: c_uint) -> c_int; ++ pub fn ChannelCreate_r(__flags: c_uint) -> c_int; ++ pub fn ChannelCreatePulsePool(__flags: c_uint, __config: *const nto_channel_config) -> c_int; ++ pub fn ChannelCreateExt( ++ __flags: c_uint, ++ __mode: crate::mode_t, ++ __bufsize: usize, ++ __maxnumbuf: c_uint, ++ __ev: *const crate::sigevent, ++ __cred: *mut _cred_info, ++ ) -> c_int; ++ pub fn ChannelDestroy(__chid: c_int) -> c_int; ++ pub fn ChannelDestroy_r(__chid: c_int) -> c_int; ++ pub fn ConnectAttach( ++ __nd: u32, ++ __pid: crate::pid_t, ++ __chid: c_int, ++ __index: c_uint, ++ __flags: c_int, ++ ) -> c_int; ++ pub fn ConnectAttach_r( ++ __nd: u32, ++ __pid: crate::pid_t, ++ __chid: c_int, ++ __index: c_uint, ++ __flags: c_int, ++ ) -> c_int; ++ ++ // TODO: The following function uses a structure defined in a header file ++ // which doesn't appear as part of the default headers found in a ++ // standard installation of Neutrino 7.1 SDP. Commented out for now. ++ //pub fn ConnectAttachExt( ++ // __nd: u32, ++ // __pid: crate::pid_t, ++ // __chid: c_int, ++ // __index: c_uint, ++ // __flags: c_int, ++ // __cd: *mut _asyncmsg_connection_descriptor, ++ //) -> c_int; ++ pub fn ConnectDetach(__coid: c_int) -> c_int; ++ pub fn ConnectDetach_r(__coid: c_int) -> c_int; ++ pub fn ConnectServerInfo(__pid: crate::pid_t, __coid: c_int, __info: *mut _msg_info64) ++ -> c_int; ++ pub fn ConnectServerInfo_r( ++ __pid: crate::pid_t, ++ __coid: c_int, ++ __info: *mut _msg_info64, ++ ) -> c_int; ++ pub fn ConnectClientInfoExtraArgs( ++ __scoid: c_int, ++ __info_pp: *mut _client_info, ++ __ngroups: c_int, ++ __abilities: *mut _client_able, ++ __nable: c_int, ++ __type_id: *mut c_uint, ++ ) -> c_int; ++ pub fn ConnectClientInfoExtraArgs_r( ++ __scoid: c_int, ++ __info_pp: *mut _client_info, ++ __ngroups: c_int, ++ __abilities: *mut _client_able, ++ __nable: c_int, ++ __type_id: *mut c_uint, ++ ) -> c_int; ++ pub fn ConnectClientInfo(__scoid: c_int, __info: *mut _client_info, __ngroups: c_int) -> c_int; ++ pub fn ConnectClientInfo_r( ++ __scoid: c_int, ++ __info: *mut _client_info, ++ __ngroups: c_int, ++ ) -> c_int; ++ pub fn ConnectClientInfoExt( ++ __scoid: c_int, ++ __info_pp: *mut *mut _client_info, ++ flags: c_int, ++ ) -> c_int; ++ pub fn ClientInfoExtFree(__info_pp: *mut *mut _client_info) -> c_int; ++ pub fn ConnectClientInfoAble( ++ __scoid: c_int, ++ __info_pp: *mut *mut _client_info, ++ flags: c_int, ++ abilities: *mut _client_able, ++ nable: c_int, ++ ) -> c_int; ++ pub fn ConnectFlags( ++ __pid: crate::pid_t, ++ __coid: c_int, ++ __mask: c_uint, ++ __bits: c_uint, ++ ) -> c_int; ++ pub fn ConnectFlags_r( ++ __pid: crate::pid_t, ++ __coid: c_int, ++ __mask: c_uint, ++ __bits: c_uint, ++ ) -> c_int; ++ pub fn ChannelConnectAttr( ++ __id: c_uint, ++ __old_attr: *mut _channel_connect_attr, ++ __new_attr: *mut _channel_connect_attr, ++ __flags: c_uint, ++ ) -> c_int; ++ pub fn MsgSend( ++ __coid: c_int, ++ __smsg: *const c_void, ++ __sbytes: usize, ++ __rmsg: *mut c_void, ++ __rbytes: usize, ++ ) -> c_long; ++ pub fn MsgSend_r( ++ __coid: c_int, ++ __smsg: *const c_void, ++ __sbytes: usize, ++ __rmsg: *mut c_void, ++ __rbytes: usize, ++ ) -> c_long; ++ pub fn MsgSendnc( ++ __coid: c_int, ++ __smsg: *const c_void, ++ __sbytes: usize, ++ __rmsg: *mut c_void, ++ __rbytes: usize, ++ ) -> c_long; ++ pub fn MsgSendnc_r( ++ __coid: c_int, ++ __smsg: *const c_void, ++ __sbytes: usize, ++ __rmsg: *mut c_void, ++ __rbytes: usize, ++ ) -> c_long; ++ pub fn MsgSendsv( ++ __coid: c_int, ++ __smsg: *const c_void, ++ __sbytes: usize, ++ __riov: *const crate::iovec, ++ __rparts: usize, ++ ) -> c_long; ++ pub fn MsgSendsv_r( ++ __coid: c_int, ++ __smsg: *const c_void, ++ __sbytes: usize, ++ __riov: *const crate::iovec, ++ __rparts: usize, ++ ) -> c_long; ++ pub fn MsgSendsvnc( ++ __coid: c_int, ++ __smsg: *const c_void, ++ __sbytes: usize, ++ __riov: *const crate::iovec, ++ __rparts: usize, ++ ) -> c_long; ++ pub fn MsgSendsvnc_r( ++ __coid: c_int, ++ __smsg: *const c_void, ++ __sbytes: usize, ++ __riov: *const crate::iovec, ++ __rparts: usize, ++ ) -> c_long; ++ pub fn MsgSendvs( ++ __coid: c_int, ++ __siov: *const crate::iovec, ++ __sparts: usize, ++ __rmsg: *mut c_void, ++ __rbytes: usize, ++ ) -> c_long; ++ pub fn MsgSendvs_r( ++ __coid: c_int, ++ __siov: *const crate::iovec, ++ __sparts: usize, ++ __rmsg: *mut c_void, ++ __rbytes: usize, ++ ) -> c_long; ++ pub fn MsgSendvsnc( ++ __coid: c_int, ++ __siov: *const crate::iovec, ++ __sparts: usize, ++ __rmsg: *mut c_void, ++ __rbytes: usize, ++ ) -> c_long; ++ pub fn MsgSendvsnc_r( ++ __coid: c_int, ++ __siov: *const crate::iovec, ++ __sparts: usize, ++ __rmsg: *mut c_void, ++ __rbytes: usize, ++ ) -> c_long; ++ pub fn MsgSendv( ++ __coid: c_int, ++ __siov: *const crate::iovec, ++ __sparts: usize, ++ __riov: *const crate::iovec, ++ __rparts: usize, ++ ) -> c_long; ++ pub fn MsgSendv_r( ++ __coid: c_int, ++ __siov: *const crate::iovec, ++ __sparts: usize, ++ __riov: *const crate::iovec, ++ __rparts: usize, ++ ) -> c_long; ++ pub fn MsgSendvnc( ++ __coid: c_int, ++ __siov: *const crate::iovec, ++ __sparts: usize, ++ __riov: *const crate::iovec, ++ __rparts: usize, ++ ) -> c_long; ++ pub fn MsgSendvnc_r( ++ __coid: c_int, ++ __siov: *const crate::iovec, ++ __sparts: usize, ++ __riov: *const crate::iovec, ++ __rparts: usize, ++ ) -> c_long; ++ pub fn MsgReceive( ++ __chid: c_int, ++ __msg: *mut c_void, ++ __bytes: usize, ++ __info: *mut _msg_info64, ++ ) -> c_int; ++ pub fn MsgReceive_r( ++ __chid: c_int, ++ __msg: *mut c_void, ++ __bytes: usize, ++ __info: *mut _msg_info64, ++ ) -> c_int; ++ pub fn MsgReceivev( ++ __chid: c_int, ++ __iov: *const crate::iovec, ++ __parts: usize, ++ __info: *mut _msg_info64, ++ ) -> c_int; ++ pub fn MsgReceivev_r( ++ __chid: c_int, ++ __iov: *const crate::iovec, ++ __parts: usize, ++ __info: *mut _msg_info64, ++ ) -> c_int; ++ pub fn MsgReceivePulse( ++ __chid: c_int, ++ __pulse: *mut c_void, ++ __bytes: usize, ++ __info: *mut _msg_info64, ++ ) -> c_int; ++ pub fn MsgReceivePulse_r( ++ __chid: c_int, ++ __pulse: *mut c_void, ++ __bytes: usize, ++ __info: *mut _msg_info64, ++ ) -> c_int; ++ pub fn MsgReceivePulsev( ++ __chid: c_int, ++ __iov: *const crate::iovec, ++ __parts: usize, ++ __info: *mut _msg_info64, ++ ) -> c_int; ++ pub fn MsgReceivePulsev_r( ++ __chid: c_int, ++ __iov: *const crate::iovec, ++ __parts: usize, ++ __info: *mut _msg_info64, ++ ) -> c_int; ++ pub fn MsgReply( ++ __rcvid: c_int, ++ __status: c_long, ++ __msg: *const c_void, ++ __bytes: usize, ++ ) -> c_int; ++ pub fn MsgReply_r( ++ __rcvid: c_int, ++ __status: c_long, ++ __msg: *const c_void, ++ __bytes: usize, ++ ) -> c_int; ++ pub fn MsgReplyv( ++ __rcvid: c_int, ++ __status: c_long, ++ __iov: *const crate::iovec, ++ __parts: usize, ++ ) -> c_int; ++ pub fn MsgReplyv_r( ++ __rcvid: c_int, ++ __status: c_long, ++ __iov: *const crate::iovec, ++ __parts: usize, ++ ) -> c_int; ++ pub fn MsgReadiov( ++ __rcvid: c_int, ++ __iov: *const crate::iovec, ++ __parts: usize, ++ __offset: usize, ++ __flags: c_int, ++ ) -> isize; ++ pub fn MsgReadiov_r( ++ __rcvid: c_int, ++ __iov: *const crate::iovec, ++ __parts: usize, ++ __offset: usize, ++ __flags: c_int, ++ ) -> isize; ++ pub fn MsgRead(__rcvid: c_int, __msg: *mut c_void, __bytes: usize, __offset: usize) -> isize; ++ pub fn MsgRead_r(__rcvid: c_int, __msg: *mut c_void, __bytes: usize, __offset: usize) -> isize; ++ pub fn MsgReadv( ++ __rcvid: c_int, ++ __iov: *const crate::iovec, ++ __parts: usize, ++ __offset: usize, ++ ) -> isize; ++ pub fn MsgReadv_r( ++ __rcvid: c_int, ++ __iov: *const crate::iovec, ++ __parts: usize, ++ __offset: usize, ++ ) -> isize; ++ pub fn MsgWrite(__rcvid: c_int, __msg: *const c_void, __bytes: usize, __offset: usize) ++ -> isize; ++ pub fn MsgWrite_r( ++ __rcvid: c_int, ++ __msg: *const c_void, ++ __bytes: usize, ++ __offset: usize, ++ ) -> isize; ++ pub fn MsgWritev( ++ __rcvid: c_int, ++ __iov: *const crate::iovec, ++ __parts: usize, ++ __offset: usize, ++ ) -> isize; ++ pub fn MsgWritev_r( ++ __rcvid: c_int, ++ __iov: *const crate::iovec, ++ __parts: usize, ++ __offset: usize, ++ ) -> isize; ++ pub fn MsgSendPulse(__coid: c_int, __priority: c_int, __code: c_int, __value: c_int) -> c_int; ++ pub fn MsgSendPulse_r(__coid: c_int, __priority: c_int, __code: c_int, __value: c_int) ++ -> c_int; ++ pub fn MsgSendPulsePtr( ++ __coid: c_int, ++ __priority: c_int, ++ __code: c_int, ++ __value: *mut c_void, ++ ) -> c_int; ++ pub fn MsgSendPulsePtr_r( ++ __coid: c_int, ++ __priority: c_int, ++ __code: c_int, ++ __value: *mut c_void, ++ ) -> c_int; ++ pub fn MsgDeliverEvent(__rcvid: c_int, __event: *const crate::sigevent) -> c_int; ++ pub fn MsgDeliverEvent_r(__rcvid: c_int, __event: *const crate::sigevent) -> c_int; ++ pub fn MsgVerifyEvent(__rcvid: c_int, __event: *const crate::sigevent) -> c_int; ++ pub fn MsgVerifyEvent_r(__rcvid: c_int, __event: *const crate::sigevent) -> c_int; ++ pub fn MsgRegisterEvent(__event: *mut crate::sigevent, __coid: c_int) -> c_int; ++ pub fn MsgRegisterEvent_r(__event: *mut crate::sigevent, __coid: c_int) -> c_int; ++ pub fn MsgUnregisterEvent(__event: *const crate::sigevent) -> c_int; ++ pub fn MsgUnregisterEvent_r(__event: *const crate::sigevent) -> c_int; ++ pub fn MsgInfo(__rcvid: c_int, __info: *mut _msg_info64) -> c_int; ++ pub fn MsgInfo_r(__rcvid: c_int, __info: *mut _msg_info64) -> c_int; ++ pub fn MsgKeyData( ++ __rcvid: c_int, ++ __oper: c_int, ++ __key: u32, ++ __newkey: *mut u32, ++ __iov: *const crate::iovec, ++ __parts: c_int, ++ ) -> c_int; ++ pub fn MsgKeyData_r( ++ __rcvid: c_int, ++ __oper: c_int, ++ __key: u32, ++ __newkey: *mut u32, ++ __iov: *const crate::iovec, ++ __parts: c_int, ++ ) -> c_int; ++ pub fn MsgError(__rcvid: c_int, __err: c_int) -> c_int; ++ pub fn MsgError_r(__rcvid: c_int, __err: c_int) -> c_int; ++ pub fn MsgCurrent(__rcvid: c_int) -> c_int; ++ pub fn MsgCurrent_r(__rcvid: c_int) -> c_int; ++ pub fn MsgSendAsyncGbl( ++ __coid: c_int, ++ __smsg: *const c_void, ++ __sbytes: usize, ++ __msg_prio: c_uint, ++ ) -> c_int; ++ pub fn MsgSendAsync(__coid: c_int) -> c_int; ++ pub fn MsgReceiveAsyncGbl( ++ __chid: c_int, ++ __rmsg: *mut c_void, ++ __rbytes: usize, ++ __info: *mut _msg_info64, ++ __coid: c_int, ++ ) -> c_int; ++ pub fn MsgReceiveAsync(__chid: c_int, __iov: *const crate::iovec, __parts: c_uint) -> c_int; ++ pub fn MsgPause(__rcvid: c_int, __cookie: c_uint) -> c_int; ++ pub fn MsgPause_r(__rcvid: c_int, __cookie: c_uint) -> c_int; ++ ++ pub fn SignalKill( ++ __nd: u32, ++ __pid: crate::pid_t, ++ __tid: c_int, ++ __signo: c_int, ++ __code: c_int, ++ __value: c_int, ++ ) -> c_int; ++ pub fn SignalKill_r( ++ __nd: u32, ++ __pid: crate::pid_t, ++ __tid: c_int, ++ __signo: c_int, ++ __code: c_int, ++ __value: c_int, ++ ) -> c_int; ++ pub fn SignalKillSigval( ++ __nd: u32, ++ __pid: crate::pid_t, ++ __tid: c_int, ++ __signo: c_int, ++ __code: c_int, ++ __value: *const crate::sigval, ++ ) -> c_int; ++ pub fn SignalKillSigval_r( ++ __nd: u32, ++ __pid: crate::pid_t, ++ __tid: c_int, ++ __signo: c_int, ++ __code: c_int, ++ __value: *const crate::sigval, ++ ) -> c_int; ++ pub fn SignalReturn(__info: *mut _sighandler_info) -> c_int; ++ pub fn SignalFault(__sigcode: c_uint, __regs: *mut c_void, __refaddr: usize) -> c_int; ++ pub fn SignalAction( ++ __pid: crate::pid_t, ++ __sigstub: unsafe extern "C" fn(), ++ __signo: c_int, ++ __act: *const crate::sigaction, ++ __oact: *mut crate::sigaction, ++ ) -> c_int; ++ pub fn SignalAction_r( ++ __pid: crate::pid_t, ++ __sigstub: unsafe extern "C" fn(), ++ __signo: c_int, ++ __act: *const crate::sigaction, ++ __oact: *mut crate::sigaction, ++ ) -> c_int; ++ pub fn SignalProcmask( ++ __pid: crate::pid_t, ++ __tid: c_int, ++ __how: c_int, ++ __set: *const crate::sigset_t, ++ __oldset: *mut crate::sigset_t, ++ ) -> c_int; ++ pub fn SignalProcmask_r( ++ __pid: crate::pid_t, ++ __tid: c_int, ++ __how: c_int, ++ __set: *const crate::sigset_t, ++ __oldset: *mut crate::sigset_t, ++ ) -> c_int; ++ pub fn SignalSuspend(__set: *const crate::sigset_t) -> c_int; ++ pub fn SignalSuspend_r(__set: *const crate::sigset_t) -> c_int; ++ pub fn SignalWaitinfo(__set: *const crate::sigset_t, __info: *mut crate::siginfo_t) -> c_int; ++ pub fn SignalWaitinfo_r(__set: *const crate::sigset_t, __info: *mut crate::siginfo_t) -> c_int; ++ pub fn SignalWaitinfoMask( ++ __set: *const crate::sigset_t, ++ __info: *mut crate::siginfo_t, ++ __mask: *const crate::sigset_t, ++ ) -> c_int; ++ pub fn SignalWaitinfoMask_r( ++ __set: *const crate::sigset_t, ++ __info: *mut crate::siginfo_t, ++ __mask: *const crate::sigset_t, ++ ) -> c_int; ++ pub fn ThreadCreate( ++ __pid: crate::pid_t, ++ __func: unsafe extern "C" fn(__arg: *mut c_void) -> *mut c_void, ++ __arg: *mut c_void, ++ __attr: *const crate::_thread_attr, ++ ) -> c_int; ++ pub fn ThreadCreate_r( ++ __pid: crate::pid_t, ++ __func: unsafe extern "C" fn(__arg: *mut c_void) -> *mut c_void, ++ __arg: *mut c_void, ++ __attr: *const crate::_thread_attr, ++ ) -> c_int; ++ ++ pub fn ThreadDestroy(__tid: c_int, __priority: c_int, __status: *mut c_void) -> c_int; ++ pub fn ThreadDestroy_r(__tid: c_int, __priority: c_int, __status: *mut c_void) -> c_int; ++ pub fn ThreadDetach(__tid: c_int) -> c_int; ++ pub fn ThreadDetach_r(__tid: c_int) -> c_int; ++ pub fn ThreadJoin(__tid: c_int, __status: *mut *mut c_void) -> c_int; ++ pub fn ThreadJoin_r(__tid: c_int, __status: *mut *mut c_void) -> c_int; ++ pub fn ThreadCancel(__tid: c_int, __canstub: unsafe extern "C" fn()) -> c_int; ++ pub fn ThreadCancel_r(__tid: c_int, __canstub: unsafe extern "C" fn()) -> c_int; ++ pub fn ThreadCtl(__cmd: c_int, __data: *mut c_void) -> c_int; ++ pub fn ThreadCtl_r(__cmd: c_int, __data: *mut c_void) -> c_int; ++ pub fn ThreadCtlExt( ++ __pid: crate::pid_t, ++ __tid: c_int, ++ __cmd: c_int, ++ __data: *mut c_void, ++ ) -> c_int; ++ pub fn ThreadCtlExt_r( ++ __pid: crate::pid_t, ++ __tid: c_int, ++ __cmd: c_int, ++ __data: *mut c_void, ++ ) -> c_int; ++ ++ pub fn InterruptHookTrace( ++ __handler: Option *const crate::sigevent>, ++ __flags: c_uint, ++ ) -> c_int; ++ pub fn InterruptHookIdle( ++ __handler: Option, ++ __flags: c_uint, ++ ) -> c_int; ++ pub fn InterruptHookIdle2( ++ __handler: Option< ++ unsafe extern "C" fn(arg1: c_uint, arg2: *mut syspage_entry, arg3: *mut _idle_hook), ++ >, ++ __flags: c_uint, ++ ) -> c_int; ++ pub fn InterruptHookOverdriveEvent(__event: *const crate::sigevent, __flags: c_uint) -> c_int; ++ pub fn InterruptAttachEvent( ++ __intr: c_int, ++ __event: *const crate::sigevent, ++ __flags: c_uint, ++ ) -> c_int; ++ pub fn InterruptAttachEvent_r( ++ __intr: c_int, ++ __event: *const crate::sigevent, ++ __flags: c_uint, ++ ) -> c_int; ++ pub fn InterruptAttach( ++ __intr: c_int, ++ __handler: Option< ++ unsafe extern "C" fn(__area: *mut c_void, __id: c_int) -> *const crate::sigevent, ++ >, ++ __area: *const c_void, ++ __size: c_int, ++ __flags: c_uint, ++ ) -> c_int; ++ pub fn InterruptAttach_r( ++ __intr: c_int, ++ __handler: Option< ++ unsafe extern "C" fn(__area: *mut c_void, __id: c_int) -> *const crate::sigevent, ++ >, ++ __area: *const c_void, ++ __size: c_int, ++ __flags: c_uint, ++ ) -> c_int; ++ pub fn InterruptAttachArray( ++ __intr: c_int, ++ __handler: Option< ++ unsafe extern "C" fn(__area: *mut c_void, __id: c_int) -> *const *const crate::sigevent, ++ >, ++ __area: *const c_void, ++ __size: c_int, ++ __flags: c_uint, ++ ) -> c_int; ++ pub fn InterruptAttachArray_r( ++ __intr: c_int, ++ __handler: Option< ++ unsafe extern "C" fn(__area: *mut c_void, __id: c_int) -> *const *const crate::sigevent, ++ >, ++ __area: *const c_void, ++ __size: c_int, ++ __flags: c_uint, ++ ) -> c_int; ++ pub fn InterruptDetach(__id: c_int) -> c_int; ++ pub fn InterruptDetach_r(__id: c_int) -> c_int; ++ pub fn InterruptWait(__flags: c_int, __timeout: *const u64) -> c_int; ++ pub fn InterruptWait_r(__flags: c_int, __timeout: *const u64) -> c_int; ++ pub fn InterruptCharacteristic( ++ __type: c_int, ++ __id: c_int, ++ __new: *mut c_uint, ++ __old: *mut c_uint, ++ ) -> c_int; ++ pub fn InterruptCharacteristic_r( ++ __type: c_int, ++ __id: c_int, ++ __new: *mut c_uint, ++ __old: *mut c_uint, ++ ) -> c_int; ++ ++ pub fn SchedGet(__pid: crate::pid_t, __tid: c_int, __param: *mut crate::sched_param) -> c_int; ++ pub fn SchedGet_r(__pid: crate::pid_t, __tid: c_int, __param: *mut crate::sched_param) ++ -> c_int; ++ pub fn SchedGetCpuNum() -> c_uint; ++ pub fn SchedSet( ++ __pid: crate::pid_t, ++ __tid: c_int, ++ __algorithm: c_int, ++ __param: *const crate::sched_param, ++ ) -> c_int; ++ pub fn SchedSet_r( ++ __pid: crate::pid_t, ++ __tid: c_int, ++ __algorithm: c_int, ++ __param: *const crate::sched_param, ++ ) -> c_int; ++ pub fn SchedInfo( ++ __pid: crate::pid_t, ++ __algorithm: c_int, ++ __info: *mut crate::_sched_info, ++ ) -> c_int; ++ pub fn SchedInfo_r( ++ __pid: crate::pid_t, ++ __algorithm: c_int, ++ __info: *mut crate::_sched_info, ++ ) -> c_int; ++ pub fn SchedYield() -> c_int; ++ pub fn SchedYield_r() -> c_int; ++ pub fn SchedCtl(__cmd: c_int, __data: *mut c_void, __length: usize) -> c_int; ++ pub fn SchedCtl_r(__cmd: c_int, __data: *mut c_void, __length: usize) -> c_int; ++ pub fn SchedJobCreate(__job: *mut nto_job_t) -> c_int; ++ pub fn SchedJobCreate_r(__job: *mut nto_job_t) -> c_int; ++ pub fn SchedJobDestroy(__job: *mut nto_job_t) -> c_int; ++ pub fn SchedJobDestroy_r(__job: *mut nto_job_t) -> c_int; ++ pub fn SchedWaypoint( ++ __job: *mut nto_job_t, ++ __new: *const i64, ++ __max: *const i64, ++ __old: *mut i64, ++ ) -> c_int; ++ pub fn SchedWaypoint_r( ++ __job: *mut nto_job_t, ++ __new: *const i64, ++ __max: *const i64, ++ __old: *mut i64, ++ ) -> c_int; ++ ++ pub fn TimerCreate(__id: crate::clockid_t, __notify: *const crate::sigevent) -> c_int; ++ pub fn TimerCreate_r(__id: crate::clockid_t, __notify: *const crate::sigevent) -> c_int; ++ pub fn TimerDestroy(__id: crate::timer_t) -> c_int; ++ pub fn TimerDestroy_r(__id: crate::timer_t) -> c_int; ++ pub fn TimerSettime( ++ __id: crate::timer_t, ++ __flags: c_int, ++ __itime: *const crate::_itimer, ++ __oitime: *mut crate::_itimer, ++ ) -> c_int; ++ pub fn TimerSettime_r( ++ __id: crate::timer_t, ++ __flags: c_int, ++ __itime: *const crate::_itimer, ++ __oitime: *mut crate::_itimer, ++ ) -> c_int; ++ pub fn TimerInfo( ++ __pid: crate::pid_t, ++ __id: crate::timer_t, ++ __flags: c_int, ++ __info: *mut crate::_timer_info, ++ ) -> c_int; ++ pub fn TimerInfo_r( ++ __pid: crate::pid_t, ++ __id: crate::timer_t, ++ __flags: c_int, ++ __info: *mut crate::_timer_info, ++ ) -> c_int; ++ pub fn TimerAlarm( ++ __id: crate::clockid_t, ++ __itime: *const crate::_itimer, ++ __otime: *mut crate::_itimer, ++ ) -> c_int; ++ pub fn TimerAlarm_r( ++ __id: crate::clockid_t, ++ __itime: *const crate::_itimer, ++ __otime: *mut crate::_itimer, ++ ) -> c_int; ++ pub fn TimerTimeout( ++ __id: crate::clockid_t, ++ __flags: c_int, ++ __notify: *const crate::sigevent, ++ __ntime: *const u64, ++ __otime: *mut u64, ++ ) -> c_int; ++ pub fn TimerTimeout_r( ++ __id: crate::clockid_t, ++ __flags: c_int, ++ __notify: *const crate::sigevent, ++ __ntime: *const u64, ++ __otime: *mut u64, ++ ) -> c_int; ++ ++ pub fn SyncTypeCreate( ++ __type: c_uint, ++ __sync: *mut crate::sync_t, ++ __attr: *const crate::_sync_attr, ++ ) -> c_int; ++ pub fn SyncTypeCreate_r( ++ __type: c_uint, ++ __sync: *mut crate::sync_t, ++ __attr: *const crate::_sync_attr, ++ ) -> c_int; ++ pub fn SyncDestroy(__sync: *mut crate::sync_t) -> c_int; ++ pub fn SyncDestroy_r(__sync: *mut crate::sync_t) -> c_int; ++ pub fn SyncCtl(__cmd: c_int, __sync: *mut crate::sync_t, __data: *mut c_void) -> c_int; ++ pub fn SyncCtl_r(__cmd: c_int, __sync: *mut crate::sync_t, __data: *mut c_void) -> c_int; ++ pub fn SyncMutexEvent(__sync: *mut crate::sync_t, event: *const crate::sigevent) -> c_int; ++ pub fn SyncMutexEvent_r(__sync: *mut crate::sync_t, event: *const crate::sigevent) -> c_int; ++ pub fn SyncMutexLock(__sync: *mut crate::sync_t) -> c_int; ++ pub fn SyncMutexLock_r(__sync: *mut crate::sync_t) -> c_int; ++ pub fn SyncMutexUnlock(__sync: *mut crate::sync_t) -> c_int; ++ pub fn SyncMutexUnlock_r(__sync: *mut crate::sync_t) -> c_int; ++ pub fn SyncMutexRevive(__sync: *mut crate::sync_t) -> c_int; ++ pub fn SyncMutexRevive_r(__sync: *mut crate::sync_t) -> c_int; ++ pub fn SyncCondvarWait(__sync: *mut crate::sync_t, __mutex: *mut crate::sync_t) -> c_int; ++ pub fn SyncCondvarWait_r(__sync: *mut crate::sync_t, __mutex: *mut crate::sync_t) -> c_int; ++ pub fn SyncCondvarSignal(__sync: *mut crate::sync_t, __all: c_int) -> c_int; ++ pub fn SyncCondvarSignal_r(__sync: *mut crate::sync_t, __all: c_int) -> c_int; ++ pub fn SyncSemPost(__sync: *mut crate::sync_t) -> c_int; ++ pub fn SyncSemPost_r(__sync: *mut crate::sync_t) -> c_int; ++ pub fn SyncSemWait(__sync: *mut crate::sync_t, __tryto: c_int) -> c_int; ++ pub fn SyncSemWait_r(__sync: *mut crate::sync_t, __tryto: c_int) -> c_int; ++ ++ pub fn ClockTime(__id: crate::clockid_t, _new: *const u64, __old: *mut u64) -> c_int; ++ pub fn ClockTime_r(__id: crate::clockid_t, _new: *const u64, __old: *mut u64) -> c_int; ++ pub fn ClockAdjust( ++ __id: crate::clockid_t, ++ _new: *const crate::_clockadjust, ++ __old: *mut crate::_clockadjust, ++ ) -> c_int; ++ pub fn ClockAdjust_r( ++ __id: crate::clockid_t, ++ _new: *const crate::_clockadjust, ++ __old: *mut crate::_clockadjust, ++ ) -> c_int; ++ pub fn ClockPeriod( ++ __id: crate::clockid_t, ++ _new: *const crate::_clockperiod, ++ __old: *mut crate::_clockperiod, ++ __reserved: c_int, ++ ) -> c_int; ++ pub fn ClockPeriod_r( ++ __id: crate::clockid_t, ++ _new: *const crate::_clockperiod, ++ __old: *mut crate::_clockperiod, ++ __reserved: c_int, ++ ) -> c_int; ++ pub fn ClockId(__pid: crate::pid_t, __tid: c_int) -> c_int; ++ pub fn ClockId_r(__pid: crate::pid_t, __tid: c_int) -> c_int; ++ ++ // ++ //TODO: The following commented out functions are implemented in assembly. ++ // We can implmement them either via a C stub or rust's inline assembly. ++ // ++ //pub fn InterruptEnable(); ++ //pub fn InterruptDisable(); ++ pub fn InterruptMask(__intr: c_int, __id: c_int) -> c_int; ++ pub fn InterruptUnmask(__intr: c_int, __id: c_int) -> c_int; ++ //pub fn InterruptLock(__spin: *mut intrspin); ++ //pub fn InterruptUnlock(__spin: *mut intrspin); ++ //pub fn InterruptStatus() -> c_uint; ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/nto/x86_64.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/nto/x86_64.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/nto/x86_64.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/nto/x86_64.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,114 @@ ++use crate::prelude::*; ++ ++pub type c_char = i8; ++pub type wchar_t = u32; ++pub type c_long = i64; ++pub type c_ulong = u64; ++pub type time_t = i64; ++ ++s! { ++ #[repr(align(8))] ++ pub struct x86_64_cpu_registers { ++ pub rdi: u64, ++ pub rsi: u64, ++ pub rdx: u64, ++ pub r10: u64, ++ pub r8: u64, ++ pub r9: u64, ++ pub rax: u64, ++ pub rbx: u64, ++ pub rbp: u64, ++ pub rcx: u64, ++ pub r11: u64, ++ pub r12: u64, ++ pub r13: u64, ++ pub r14: u64, ++ pub r15: u64, ++ pub rip: u64, ++ pub cs: u32, ++ rsvd1: u32, ++ pub rflags: u64, ++ pub rsp: u64, ++ pub ss: u32, ++ rsvd2: u32, ++ } ++ ++ #[repr(align(8))] ++ pub struct mcontext_t { ++ pub cpu: x86_64_cpu_registers, ++ pub fpu: x86_64_fpu_registers, ++ } ++ ++ pub struct stack_t { ++ pub ss_sp: *mut c_void, ++ pub ss_size: size_t, ++ pub ss_flags: c_int, ++ } ++ ++ pub struct fsave_area_64 { ++ pub fpu_control_word: u32, ++ pub fpu_status_word: u32, ++ pub fpu_tag_word: u32, ++ pub fpu_ip: u32, ++ pub fpu_cs: u32, ++ pub fpu_op: u32, ++ pub fpu_ds: u32, ++ pub st_regs: [u8; 80], ++ } ++ ++ pub struct fxsave_area_64 { ++ pub fpu_control_word: u16, ++ pub fpu_status_word: u16, ++ pub fpu_tag_word: u16, ++ pub fpu_operand: u16, ++ pub fpu_rip: u64, ++ pub fpu_rdp: u64, ++ pub mxcsr: u32, ++ pub mxcsr_mask: u32, ++ pub st_regs: [u8; 128], ++ pub xmm_regs: [u8; 128], ++ reserved2: [u8; 224], ++ } ++ ++ pub struct fpu_extention_savearea_64 { ++ pub other: [u8; 512], ++ pub xstate_bv: u64, ++ pub xstate_undef: [u64; 7], ++ pub xstate_info: [u8; 224], ++ } ++} ++ ++s_no_extra_traits! { ++ pub union x86_64_fpu_registers { ++ pub fsave_area: fsave_area_64, ++ pub fxsave_area: fxsave_area_64, ++ pub xsave_area: fpu_extention_savearea_64, ++ pub data: [u8; 1024], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl Eq for x86_64_fpu_registers {} ++ ++ impl PartialEq for x86_64_fpu_registers { ++ fn eq(&self, other: &x86_64_fpu_registers) -> bool { ++ unsafe { ++ self.fsave_area == other.fsave_area ++ || self.fxsave_area == other.fxsave_area ++ || self.xsave_area == other.xsave_area ++ } ++ } ++ } ++ ++ impl hash::Hash for x86_64_fpu_registers { ++ fn hash(&self, state: &mut H) { ++ unsafe { ++ self.fsave_area.hash(state); ++ self.fxsave_area.hash(state); ++ self.xsave_area.hash(state); ++ } ++ } ++ } ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/nuttx/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/nuttx/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/nuttx/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/nuttx/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,564 @@ ++pub use crate::arch::c_char_def as c_char; ++use crate::prelude::*; ++use crate::{in6_addr, in_addr_t, timespec, DIR}; ++ ++pub type nlink_t = u16; ++pub type ino_t = u16; ++pub type blkcnt_t = u64; ++pub type blksize_t = i16; ++pub type c_long = isize; ++pub type c_ulong = usize; ++pub type cc_t = u8; ++pub type clock_t = i64; ++pub type dev_t = i32; ++pub type fsblkcnt_t = u64; ++pub type locale_t = *mut i8; ++pub type mode_t = u32; ++pub type nfds_t = u32; ++pub type off_t = i64; ++pub type pthread_key_t = i32; ++pub type pthread_mutexattr_t = u8; ++pub type pthread_rwlockattr_t = i32; ++pub type pthread_t = i32; ++pub type rlim_t = i64; ++pub type sa_family_t = u16; ++pub type socklen_t = u32; ++pub type speed_t = usize; ++pub type suseconds_t = i32; ++pub type tcflag_t = u32; ++pub type clockid_t = i32; ++pub type time_t = i64; ++pub type wchar_t = i32; ++ ++s! { ++ pub struct stat { ++ pub st_dev: dev_t, ++ pub st_ino: ino_t, ++ pub st_mode: mode_t, ++ pub st_nlink: u64, ++ pub st_uid: u32, ++ pub st_gid: u32, ++ pub st_rdev: dev_t, ++ pub st_size: off_t, ++ pub st_atim: timespec, ++ pub st_mtim: timespec, ++ pub st_ctim: timespec, ++ pub st_blksize: blksize_t, ++ pub st_blocks: i64, ++ __reserved: [usize; __DEFAULT_RESERVED_SIZE__], ++ } ++ ++ pub struct sockaddr { ++ pub sa_family: sa_family_t, ++ pub sa_data: [u8; 14], ++ } ++ ++ pub struct passwd { ++ pub pw_name: *const c_char, ++ pub pw_uid: u32, ++ pub pw_gid: u32, ++ pub pw_gecos: *const c_char, ++ pub pw_dir: *const c_char, ++ pub pw_shell: *const c_char, ++ __reserved: [usize; __DEFAULT_RESERVED_SIZE__], ++ } ++ ++ pub struct sem_t { ++ __val: [usize; __SEM_SIZE__], ++ } ++ ++ pub struct pthread_attr_t { ++ __val: [usize; __PTHREAD_ATTR_SIZE__], ++ } ++ ++ pub struct pthread_mutex_t { ++ __val: [usize; __PTHREAD_MUTEX_SIZE__], ++ } ++ ++ pub struct pthread_cond_t { ++ __val: [usize; __PTHREAD_COND_SIZE__], ++ } ++ ++ pub struct pthread_condattr_t { ++ __val: [usize; __PTHREAD_CONDATTR_SIZE__], ++ } ++ ++ pub struct Dl_info { ++ pub dli_fname: *const c_char, ++ pub dli_fbase: *mut c_void, ++ pub dli_sname: *const c_char, ++ pub dli_saddr: *mut c_void, ++ } ++ ++ pub struct lconv { ++ pub decimal_point: *const c_char, ++ pub thousands_sep: *const c_char, ++ pub grouping: *const c_char, ++ pub int_curr_symbol: *const c_char, ++ pub currency_symbol: *const c_char, ++ pub mon_decimal_point: *const c_char, ++ pub mon_thousands_sep: *const c_char, ++ pub mon_grouping: *const c_char, ++ pub positive_sign: *const c_char, ++ pub negative_sign: *const c_char, ++ pub int_frac_digits: i8, ++ pub frac_digits: i8, ++ pub p_cs_precedes: i8, ++ pub p_sep_by_space: i8, ++ pub n_cs_precedes: i8, ++ pub n_sep_by_space: i8, ++ pub p_sign_posn: i8, ++ pub n_sign_posn: i8, ++ pub int_n_cs_precedes: i8, ++ pub int_n_sep_by_space: i8, ++ pub int_n_sign_posn: i8, ++ pub int_p_cs_precedes: i8, ++ pub int_p_sep_by_space: i8, ++ pub int_p_sign_posn: i8, ++ __reserved: [usize; __DEFAULT_RESERVED_SIZE__], ++ } ++ ++ pub struct tm { ++ pub tm_sec: i32, ++ pub tm_min: i32, ++ pub tm_hour: i32, ++ pub tm_mday: i32, ++ pub tm_mon: i32, ++ pub tm_year: i32, ++ pub tm_wday: i32, ++ pub tm_yday: i32, ++ pub tm_isdst: i32, ++ pub tm_gmtoff: isize, ++ pub tm_zone: *const i8, ++ __reserved: [usize; __DEFAULT_RESERVED_SIZE__], ++ } ++ ++ pub struct addrinfo { ++ pub ai_flags: i32, ++ pub ai_family: i32, ++ pub ai_socktype: i32, ++ pub ai_protocol: i32, ++ pub ai_addrlen: socklen_t, ++ pub ai_addr: *mut sockaddr, ++ pub ai_canonname: *mut c_char, ++ pub ai_next: *mut addrinfo, ++ __reserved: [usize; __DEFAULT_RESERVED_SIZE__], ++ } ++ ++ pub struct pthread_rwlock_t { ++ __val: [usize; __PTHREAD_RWLOCK_SIZE__], ++ } ++ ++ pub struct statvfs { ++ pub f_bsize: usize, ++ pub f_frsize: usize, ++ pub f_blocks: fsblkcnt_t, ++ pub f_bfree: fsblkcnt_t, ++ pub f_bavail: fsblkcnt_t, ++ pub f_files: fsblkcnt_t, ++ pub f_ffree: fsblkcnt_t, ++ pub f_favail: fsblkcnt_t, ++ pub f_fsid: usize, ++ pub f_flag: usize, ++ pub f_namemax: usize, ++ __reserved: [usize; __DEFAULT_RESERVED_SIZE__], ++ } ++ ++ pub struct dirent { ++ pub d_type: u8, ++ pub d_name: [i8; __NAME_MAX__ + 1], ++ } ++ ++ pub struct fd_set { ++ __val: [u32; __FDSET_SIZE__], ++ } ++ ++ pub struct sigset_t { ++ __val: [u32; __SIGSET_SIZE__], ++ } ++ ++ pub struct sigaction { ++ pub sa_handler: usize, ++ pub sa_mask: sigset_t, ++ pub sa_flags: i32, ++ pub sa_user: usize, ++ __reserved: [usize; __DEFAULT_RESERVED_SIZE__], ++ } ++ ++ pub struct termios { ++ pub c_iflag: tcflag_t, ++ pub c_oflag: tcflag_t, ++ pub c_cflag: tcflag_t, ++ pub c_lflag: tcflag_t, ++ pub c_cc: [cc_t; 12], ++ pub c_speed: speed_t, ++ __reserved: [usize; __DEFAULT_RESERVED_SIZE__], ++ } ++ ++ pub struct in_addr { ++ pub s_addr: in_addr_t, ++ } ++ ++ pub struct sockaddr_in { ++ pub sin_family: sa_family_t, ++ pub sin_port: crate::in_port_t, ++ pub sin_addr: crate::in_addr, ++ pub sin_zero: [u8; 8], ++ } ++ ++ pub struct sockaddr_in6 { ++ pub sin6_family: sa_family_t, ++ pub sin6_port: crate::in_port_t, ++ pub sin6_flowinfo: u32, ++ pub sin6_addr: crate::in6_addr, ++ pub sin6_scope_id: u32, ++ } ++ ++ pub struct sockaddr_un { ++ pub sun_family: sa_family_t, ++ pub sun_path: [c_char; 108], ++ } ++ ++ pub struct sockaddr_storage { ++ pub ss_family: sa_family_t, ++ ss_data: [u32; __SOCKADDR_STORAGE_SIZE__], ++ } ++ ++ pub struct ip_mreq { ++ pub imr_multiaddr: in_addr, ++ pub imr_interface: in_addr, ++ } ++ ++ pub struct ipv6_mreq { ++ pub ipv6mr_multiaddr: in6_addr, ++ pub ipv6mr_interface: u32, ++ } ++ ++ pub struct timeval { ++ pub tv_sec: time_t, ++ pub tv_usec: suseconds_t, ++ } ++} ++ ++// Reserved two pointer size for reserved area for some structures. ++// This ensures that the size of these structures is large enough ++// if more fields are added in the NuttX side. ++// ++// These structures are that defined by POSIX but only necessary fields are included, ++// for example, struct passwd, https://pubs.opengroup.org/onlinepubs/009695399/basedefs/pwd.h.html, ++// POSIX only defines following fields in struct passwd: ++// char *pw_name User's login name. ++// uid_t pw_uid Numerical user ID. ++// gid_t pw_gid Numerical group ID. ++// char *pw_dir Initial working directory. ++// char *pw_shell Program to use as shell. ++// Other fields can be different depending on the implementation. ++ ++const __DEFAULT_RESERVED_SIZE__: usize = 2; ++ ++const __SOCKADDR_STORAGE_SIZE__: usize = 36; ++const __PTHREAD_ATTR_SIZE__: usize = 5; ++const __PTHREAD_MUTEX_SIZE__: usize = 9; ++const __PTHREAD_COND_SIZE__: usize = 7; ++const __PTHREAD_CONDATTR_SIZE__: usize = 5; ++const __PTHREAD_RWLOCK_SIZE__: usize = 17; ++const __SEM_SIZE__: usize = 6; ++const __NAME_MAX__: usize = 64; ++const __FDSET_SIZE__: usize = 10; ++const __SIGSET_SIZE__: usize = 8; ++ ++pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { ++ __val: [0; __PTHREAD_COND_SIZE__], ++}; ++pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { ++ __val: [0; __PTHREAD_MUTEX_SIZE__], ++}; ++ ++// dlfcn.h ++pub const RTLD_DEFAULT: *mut c_void = 0 as *mut c_void; ++ ++// stdlib.h ++pub const EXIT_SUCCESS: i32 = 0; ++pub const EXIT_FAILURE: i32 = 1; ++ ++// time.h ++pub const CLOCK_REALTIME: i32 = 0; ++pub const CLOCK_MONOTONIC: i32 = 1; ++ ++// errno.h ++pub const EPERM: i32 = 1; ++pub const ENOENT: i32 = 2; ++pub const ESRCH: i32 = 3; ++pub const EINTR: i32 = 4; ++pub const EIO: i32 = 5; ++pub const ENXIO: i32 = 6; ++pub const E2BIG: i32 = 7; ++pub const ENOEXEC: i32 = 8; ++pub const EBADF: i32 = 9; ++pub const ECHILD: i32 = 10; ++pub const EAGAIN: i32 = 11; ++pub const ENOMEM: i32 = 12; ++pub const EACCES: i32 = 13; ++pub const EFAULT: i32 = 14; ++pub const ENOTBLK: i32 = 15; ++pub const EBUSY: i32 = 16; ++pub const EEXIST: i32 = 17; ++pub const EXDEV: i32 = 18; ++pub const ENODEV: i32 = 19; ++pub const ENOTDIR: i32 = 20; ++pub const EISDIR: i32 = 21; ++pub const EINVAL: i32 = 22; ++pub const ENFILE: i32 = 23; ++pub const EMFILE: i32 = 24; ++pub const ENOTTY: i32 = 25; ++pub const ETXTBSY: i32 = 26; ++pub const EFBIG: i32 = 27; ++pub const ENOSPC: i32 = 28; ++pub const ESPIPE: i32 = 29; ++pub const EROFS: i32 = 30; ++pub const EMLINK: i32 = 31; ++pub const EPIPE: i32 = 32; ++pub const EDOM: i32 = 33; ++pub const ERANGE: i32 = 34; ++pub const EDEADLK: i32 = 35; ++pub const ENAMETOOLONG: i32 = 36; ++pub const ENOLCK: i32 = 37; ++pub const ENOSYS: i32 = 38; ++pub const ENOTEMPTY: i32 = 39; ++pub const ELOOP: i32 = 40; ++pub const EWOULDBLOCK: i32 = EAGAIN; ++pub const ENOMSG: i32 = 42; ++pub const EIDRM: i32 = 43; ++pub const ECHRNG: i32 = 44; ++pub const EL2NSYNC: i32 = 45; ++pub const EL3HLT: i32 = 46; ++pub const EL3RST: i32 = 47; ++pub const ELNRNG: i32 = 48; ++pub const EUNATCH: i32 = 49; ++pub const ENOCSI: i32 = 50; ++pub const EL2HLT: i32 = 51; ++pub const EBADE: i32 = 52; ++pub const EBADR: i32 = 53; ++pub const EXFULL: i32 = 54; ++pub const ENOANO: i32 = 55; ++pub const EBADRQC: i32 = 56; ++pub const EBADSLT: i32 = 57; ++pub const EDEADLOCK: i32 = EDEADLK; ++pub const EBFONT: i32 = 59; ++pub const ENOSTR: i32 = 60; ++pub const ENODATA: i32 = 61; ++pub const ETIME: i32 = 62; ++pub const ENOSR: i32 = 63; ++pub const ENONET: i32 = 64; ++pub const ENOPKG: i32 = 65; ++pub const EREMOTE: i32 = 66; ++pub const ENOLINK: i32 = 67; ++pub const EADV: i32 = 68; ++pub const ESRMNT: i32 = 69; ++pub const ECOMM: i32 = 70; ++pub const EPROTO: i32 = 71; ++pub const EMULTIHOP: i32 = 72; ++pub const EDOTDOT: i32 = 73; ++pub const EBADMSG: i32 = 74; ++pub const EOVERFLOW: i32 = 75; ++pub const ENOTUNIQ: i32 = 76; ++pub const EBADFD: i32 = 77; ++pub const EREMCHG: i32 = 78; ++pub const ELIBACC: i32 = 79; ++pub const ELIBBAD: i32 = 80; ++pub const ELIBSCN: i32 = 81; ++pub const ELIBMAX: i32 = 82; ++pub const ELIBEXEC: i32 = 83; ++pub const EILSEQ: i32 = 84; ++pub const ERESTART: i32 = 85; ++pub const ESTRPIPE: i32 = 86; ++pub const EUSERS: i32 = 87; ++pub const ENOTSOCK: i32 = 88; ++pub const EDESTADDRREQ: i32 = 89; ++pub const EMSGSIZE: i32 = 90; ++pub const EPROTOTYPE: i32 = 91; ++pub const ENOPROTOOPT: i32 = 92; ++pub const EPROTONOSUPPORT: i32 = 93; ++pub const ESOCKTNOSUPPORT: i32 = 94; ++pub const EOPNOTSUPP: i32 = 95; ++pub const EPFNOSUPPORT: i32 = 96; ++pub const EAFNOSUPPORT: i32 = 97; ++pub const EADDRINUSE: i32 = 98; ++pub const EADDRNOTAVAIL: i32 = 99; ++pub const ENETDOWN: i32 = 100; ++pub const ENETUNREACH: i32 = 101; ++pub const ENETRESET: i32 = 102; ++pub const ECONNABORTED: i32 = 103; ++pub const ECONNRESET: i32 = 104; ++pub const ENOBUFS: i32 = 105; ++pub const EISCONN: i32 = 106; ++pub const ENOTCONN: i32 = 107; ++pub const ESHUTDOWN: i32 = 108; ++pub const ETOOMANYREFS: i32 = 109; ++pub const ETIMEDOUT: i32 = 110; ++pub const ECONNREFUSED: i32 = 111; ++pub const EHOSTDOWN: i32 = 112; ++pub const EHOSTUNREACH: i32 = 113; ++pub const EALREADY: i32 = 114; ++pub const EINPROGRESS: i32 = 115; ++pub const ESTALE: i32 = 116; ++pub const EUCLEAN: i32 = 117; ++pub const ENOTNAM: i32 = 118; ++pub const ENAVAIL: i32 = 119; ++pub const EISNAM: i32 = 120; ++pub const EREMOTEIO: i32 = 121; ++pub const EDQUOT: i32 = 122; ++pub const ENOMEDIUM: i32 = 123; ++pub const EMEDIUMTYPE: i32 = 124; ++pub const ECANCELED: i32 = 125; ++pub const ENOKEY: i32 = 126; ++pub const EKEYEXPIRED: i32 = 127; ++pub const EKEYREVOKED: i32 = 128; ++pub const EKEYREJECTED: i32 = 129; ++pub const EOWNERDEAD: i32 = 130; ++pub const ENOTRECOVERABLE: i32 = 131; ++pub const ERFKILL: i32 = 132; ++pub const EHWPOISON: i32 = 133; ++pub const ELBIN: i32 = 134; ++pub const EFTYPE: i32 = 135; ++pub const ENMFILE: i32 = 136; ++pub const EPROCLIM: i32 = 137; ++pub const ENOTSUP: i32 = 138; ++pub const ENOSHARE: i32 = 139; ++pub const ECASECLASH: i32 = 140; ++ ++// fcntl.h ++pub const FIOCLEX: i32 = 0x30b; ++pub const F_SETFL: i32 = 0x9; ++pub const F_DUPFD_CLOEXEC: i32 = 0x12; ++pub const F_GETFD: i32 = 0x1; ++pub const F_GETFL: i32 = 0x2; ++pub const O_RDONLY: i32 = 0x1; ++pub const O_WRONLY: i32 = 0x2; ++pub const O_RDWR: i32 = 0x3; ++pub const O_CREAT: i32 = 0x4; ++pub const O_EXCL: i32 = 0x8; ++pub const O_NOCTTY: i32 = 0x0; ++pub const O_TRUNC: i32 = 0x20; ++pub const O_APPEND: i32 = 0x10; ++pub const O_NONBLOCK: i32 = 0x40; ++pub const O_DSYNC: i32 = 0x80; ++pub const O_DIRECT: i32 = 0x200; ++pub const O_LARGEFILE: i32 = 0x2000; ++pub const O_DIRECTORY: i32 = 0x800; ++pub const O_NOFOLLOW: i32 = 0x1000; ++pub const O_NOATIME: i32 = 0x40000; ++pub const O_CLOEXEC: i32 = 0x400; ++pub const O_ACCMODE: i32 = 0x0003; ++pub const AT_FDCWD: i32 = -100; ++pub const AT_REMOVEDIR: i32 = 0x200; ++ ++// sys/types.h ++pub const SEEK_SET: i32 = 0; ++pub const SEEK_CUR: i32 = 1; ++pub const SEEK_END: i32 = 2; ++ ++// sys/stat.h ++pub const S_IFDIR: u32 = 0x4000; ++pub const S_IFLNK: u32 = 0xA000; ++pub const S_IFREG: u32 = 0x8000; ++pub const S_IFMT: u32 = 0xF000; ++pub const S_IFIFO: u32 = 0x1000; ++pub const S_IFSOCK: u32 = 0xc000; ++pub const S_IFBLK: u32 = 0x6000; ++pub const S_IFCHR: u32 = 0x2000; ++pub const S_IRUSR: u32 = 0x100; ++pub const S_IWUSR: u32 = 0x80; ++pub const S_IXUSR: u32 = 0x40; ++pub const S_IRGRP: u32 = 0x20; ++pub const S_IWGRP: u32 = 0x10; ++pub const S_IXGRP: u32 = 0x8; ++pub const S_IROTH: u32 = 0x004; ++pub const S_IWOTH: u32 = 0x002; ++pub const S_IXOTH: u32 = 0x001; ++ ++// sys/poll.h ++pub const POLLIN: i16 = 0x01; ++pub const POLLOUT: i16 = 0x04; ++pub const POLLHUP: i16 = 0x10; ++pub const POLLERR: i16 = 0x08; ++pub const POLLNVAL: i16 = 0x20; ++ ++// sys/socket.h ++pub const AF_UNIX: i32 = 1; ++pub const SOCK_DGRAM: i32 = 2; ++pub const SOCK_STREAM: i32 = 1; ++pub const AF_INET: i32 = 2; ++pub const AF_INET6: i32 = 10; ++pub const MSG_PEEK: i32 = 0x02; ++pub const SOL_SOCKET: i32 = 1; ++pub const SHUT_WR: i32 = 2; ++pub const SHUT_RD: i32 = 1; ++pub const SHUT_RDWR: i32 = 3; ++pub const SO_ERROR: i32 = 4; ++pub const SO_REUSEADDR: i32 = 11; ++pub const SOMAXCONN: i32 = 8; ++pub const SO_LINGER: i32 = 6; ++pub const SO_RCVTIMEO: i32 = 0xa; ++pub const SO_SNDTIMEO: i32 = 0xe; ++pub const SO_BROADCAST: i32 = 1; ++ ++// netinet/tcp.h ++pub const TCP_NODELAY: i32 = 0x10; ++ ++// nuttx/fs/ioctl.h ++pub const FIONBIO: i32 = 0x30a; ++ ++// unistd.h ++pub const STDIN_FILENO: i32 = 0; ++pub const STDOUT_FILENO: i32 = 1; ++pub const STDERR_FILENO: i32 = 2; ++pub const _SC_PAGESIZE: i32 = 0x36; ++pub const _SC_THREAD_STACK_MIN: i32 = 0x58; ++pub const _SC_GETPW_R_SIZE_MAX: i32 = 0x25; ++ ++// signal.h ++pub const SIGPIPE: i32 = 13; ++ ++// pthread.h ++pub const PTHREAD_MUTEX_NORMAL: i32 = 0; ++ ++// netinet/in.h ++pub const IP_TTL: i32 = 0x1e; ++pub const IPV6_V6ONLY: i32 = 0x17; ++pub const IPV6_JOIN_GROUP: i32 = 0x11; ++pub const IPV6_LEAVE_GROUP: i32 = 0x12; ++pub const IP_MULTICAST_LOOP: i32 = 0x13; ++pub const IPV6_MULTICAST_LOOP: i32 = 0x15; ++pub const IP_MULTICAST_TTL: i32 = 0x12; ++pub const IP_ADD_MEMBERSHIP: i32 = 0x14; ++pub const IP_DROP_MEMBERSHIP: i32 = 0x15; ++ ++extern "C" { ++ pub fn bind(sockfd: i32, addr: *const sockaddr, addrlen: socklen_t) -> i32; ++ pub fn ioctl(fd: i32, request: i32, ...) -> i32; ++ pub fn dirfd(dirp: *mut DIR) -> i32; ++ pub fn recvfrom( ++ sockfd: i32, ++ buf: *mut c_void, ++ len: usize, ++ flags: i32, ++ src_addr: *mut sockaddr, ++ addrlen: *mut socklen_t, ++ ) -> i32; ++ ++ pub fn pthread_create( ++ thread: *mut pthread_t, ++ attr: *const pthread_attr_t, ++ start_routine: extern "C" fn(*mut c_void) -> *mut c_void, ++ arg: *mut c_void, ++ ) -> i32; ++ ++ pub fn clock_gettime(clockid: clockid_t, tp: *mut timespec) -> i32; ++ pub fn futimens(fd: i32, times: *const timespec) -> i32; ++ pub fn pthread_condattr_setclock(attr: *mut pthread_condattr_t, clock_id: clockid_t) -> i32; ++ pub fn pthread_set_name_np(thread: pthread_t, name: *const c_char) -> i32; ++ pub fn pthread_setname_np(thread: pthread_t, name: *const c_char) -> i32; ++ pub fn pthread_getname_np(thread: pthread_t, name: *mut c_char, len: usize) -> i32; ++ pub fn getrandom(buf: *mut c_void, buflen: usize, flags: u32) -> isize; ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/redox/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/redox/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/redox/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/redox/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,1423 @@ ++pub use crate::arch::c_char_def as c_char; ++use crate::prelude::*; ++ ++pub type wchar_t = i32; ++ ++cfg_if! { ++ if #[cfg(target_pointer_width = "32")] { ++ pub type c_long = i32; ++ pub type c_ulong = u32; ++ } ++} ++ ++cfg_if! { ++ if #[cfg(target_pointer_width = "64")] { ++ pub type c_long = i64; ++ pub type c_ulong = u64; ++ } ++} ++ ++pub type blkcnt_t = c_ulong; ++pub type blksize_t = c_long; ++pub type clock_t = c_long; ++pub type clockid_t = c_int; ++pub type dev_t = c_long; ++pub type fsblkcnt_t = c_ulong; ++pub type fsfilcnt_t = c_ulong; ++pub type ino_t = c_ulonglong; ++pub type mode_t = c_int; ++pub type nfds_t = c_ulong; ++pub type nlink_t = c_ulong; ++pub type off_t = c_longlong; ++pub type pthread_t = *mut c_void; ++// Must be usize due to library/std/sys_common/thread_local.rs, ++// should technically be *mut c_void ++pub type pthread_key_t = usize; ++pub type rlim_t = c_ulonglong; ++pub type sa_family_t = u16; ++pub type sem_t = *mut c_void; ++pub type sigset_t = c_ulonglong; ++pub type socklen_t = u32; ++pub type speed_t = u32; ++pub type suseconds_t = c_int; ++pub type tcflag_t = u32; ++pub type time_t = c_longlong; ++pub type id_t = c_uint; ++pub type pid_t = usize; ++pub type uid_t = u32; ++pub type gid_t = u32; ++ ++#[cfg_attr(feature = "extra_traits", derive(Debug))] ++pub enum timezone {} ++impl Copy for timezone {} ++impl Clone for timezone { ++ fn clone(&self) -> timezone { ++ *self ++ } ++} ++ ++s_no_extra_traits! { ++ #[repr(C)] ++ pub struct utsname { ++ pub sysname: [c_char; UTSLENGTH], ++ pub nodename: [c_char; UTSLENGTH], ++ pub release: [c_char; UTSLENGTH], ++ pub version: [c_char; UTSLENGTH], ++ pub machine: [c_char; UTSLENGTH], ++ pub domainname: [c_char; UTSLENGTH], ++ } ++ ++ pub struct dirent { ++ pub d_ino: crate::ino_t, ++ pub d_off: off_t, ++ pub d_reclen: c_ushort, ++ pub d_type: c_uchar, ++ pub d_name: [c_char; 256], ++ } ++ ++ pub struct sockaddr_un { ++ pub sun_family: crate::sa_family_t, ++ pub sun_path: [c_char; 108], ++ } ++ ++ pub struct sockaddr_storage { ++ pub ss_family: crate::sa_family_t, ++ __ss_padding: [u8; 128 - mem::size_of::() - mem::size_of::()], ++ __ss_align: c_ulong, ++ } ++} ++ ++s! { ++ pub struct addrinfo { ++ pub ai_flags: c_int, ++ pub ai_family: c_int, ++ pub ai_socktype: c_int, ++ pub ai_protocol: c_int, ++ pub ai_addrlen: size_t, ++ pub ai_canonname: *mut c_char, ++ pub ai_addr: *mut crate::sockaddr, ++ pub ai_next: *mut crate::addrinfo, ++ } ++ ++ pub struct Dl_info { ++ pub dli_fname: *const c_char, ++ pub dli_fbase: *mut c_void, ++ pub dli_sname: *const c_char, ++ pub dli_saddr: *mut c_void, ++ } ++ ++ pub struct epoll_event { ++ pub events: u32, ++ pub u64: u64, ++ pub _pad: u64, ++ } ++ ++ pub struct fd_set { ++ fds_bits: [c_ulong; crate::FD_SETSIZE as usize / ULONG_SIZE], ++ } ++ ++ pub struct in_addr { ++ pub s_addr: crate::in_addr_t, ++ } ++ ++ pub struct ip_mreq { ++ pub imr_multiaddr: crate::in_addr, ++ pub imr_interface: crate::in_addr, ++ } ++ ++ pub struct lconv { ++ pub currency_symbol: *const c_char, ++ pub decimal_point: *const c_char, ++ pub frac_digits: c_char, ++ pub grouping: *const c_char, ++ pub int_curr_symbol: *const c_char, ++ pub int_frac_digits: c_char, ++ pub mon_decimal_point: *const c_char, ++ pub mon_grouping: *const c_char, ++ pub mon_thousands_sep: *const c_char, ++ pub negative_sign: *const c_char, ++ pub n_cs_precedes: c_char, ++ pub n_sep_by_space: c_char, ++ pub n_sign_posn: c_char, ++ pub positive_sign: *const c_char, ++ pub p_cs_precedes: c_char, ++ pub p_sep_by_space: c_char, ++ pub p_sign_posn: c_char, ++ pub thousands_sep: *const c_char, ++ } ++ ++ pub struct passwd { ++ pub pw_name: *mut c_char, ++ pub pw_passwd: *mut c_char, ++ pub pw_uid: crate::uid_t, ++ pub pw_gid: crate::gid_t, ++ pub pw_gecos: *mut c_char, ++ pub pw_dir: *mut c_char, ++ pub pw_shell: *mut c_char, ++ } ++ ++ pub struct sigaction { ++ pub sa_sigaction: crate::sighandler_t, ++ pub sa_flags: c_ulong, ++ pub sa_restorer: Option, ++ pub sa_mask: crate::sigset_t, ++ } ++ ++ pub struct siginfo_t { ++ pub si_signo: c_int, ++ pub si_errno: c_int, ++ pub si_code: c_int, ++ _pad: [c_int; 29], ++ _align: [usize; 0], ++ } ++ ++ pub struct sockaddr { ++ pub sa_family: crate::sa_family_t, ++ pub sa_data: [c_char; 14], ++ } ++ ++ pub struct sockaddr_in { ++ pub sin_family: crate::sa_family_t, ++ pub sin_port: crate::in_port_t, ++ pub sin_addr: crate::in_addr, ++ pub sin_zero: [c_char; 8], ++ } ++ ++ pub struct sockaddr_in6 { ++ pub sin6_family: crate::sa_family_t, ++ pub sin6_port: crate::in_port_t, ++ pub sin6_flowinfo: u32, ++ pub sin6_addr: crate::in6_addr, ++ pub sin6_scope_id: u32, ++ } ++ ++ pub struct stat { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_mode: crate::mode_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ pub st_size: off_t, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ _pad: [c_char; 24], ++ } ++ ++ pub struct statvfs { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_favail: crate::fsfilcnt_t, ++ pub f_fsid: c_ulong, ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ } ++ ++ pub struct termios { ++ pub c_iflag: crate::tcflag_t, ++ pub c_oflag: crate::tcflag_t, ++ pub c_cflag: crate::tcflag_t, ++ pub c_lflag: crate::tcflag_t, ++ pub c_line: crate::cc_t, ++ pub c_cc: [crate::cc_t; crate::NCCS], ++ pub c_ispeed: crate::speed_t, ++ pub c_ospeed: crate::speed_t, ++ } ++ ++ pub struct tm { ++ pub tm_sec: c_int, ++ pub tm_min: c_int, ++ pub tm_hour: c_int, ++ pub tm_mday: c_int, ++ pub tm_mon: c_int, ++ pub tm_year: c_int, ++ pub tm_wday: c_int, ++ pub tm_yday: c_int, ++ pub tm_isdst: c_int, ++ pub tm_gmtoff: c_long, ++ pub tm_zone: *const c_char, ++ } ++ ++ pub struct ucred { ++ pub pid: pid_t, ++ pub uid: uid_t, ++ pub gid: gid_t, ++ } ++ ++ #[cfg_attr(target_pointer_width = "32", repr(C, align(4)))] ++ #[cfg_attr(target_pointer_width = "64", repr(C, align(8)))] ++ pub struct pthread_attr_t { ++ bytes: [u8; _PTHREAD_ATTR_SIZE], ++ } ++ #[repr(C)] ++ #[repr(align(4))] ++ pub struct pthread_barrier_t { ++ bytes: [u8; _PTHREAD_BARRIER_SIZE], ++ } ++ #[repr(C)] ++ #[repr(align(4))] ++ pub struct pthread_barrierattr_t { ++ bytes: [u8; _PTHREAD_BARRIERATTR_SIZE], ++ } ++ #[repr(C)] ++ #[repr(align(4))] ++ pub struct pthread_mutex_t { ++ bytes: [u8; _PTHREAD_MUTEX_SIZE], ++ } ++ #[repr(C)] ++ #[repr(align(4))] ++ pub struct pthread_rwlock_t { ++ bytes: [u8; _PTHREAD_RWLOCK_SIZE], ++ } ++ #[repr(C)] ++ #[repr(align(4))] ++ pub struct pthread_mutexattr_t { ++ bytes: [u8; _PTHREAD_MUTEXATTR_SIZE], ++ } ++ #[repr(C)] ++ #[repr(align(1))] ++ pub struct pthread_rwlockattr_t { ++ bytes: [u8; _PTHREAD_RWLOCKATTR_SIZE], ++ } ++ #[repr(C)] ++ #[repr(align(4))] ++ pub struct pthread_cond_t { ++ bytes: [u8; _PTHREAD_COND_SIZE], ++ } ++ #[repr(C)] ++ #[repr(align(4))] ++ pub struct pthread_condattr_t { ++ bytes: [u8; _PTHREAD_CONDATTR_SIZE], ++ } ++ #[repr(C)] ++ #[repr(align(4))] ++ pub struct pthread_once_t { ++ bytes: [u8; _PTHREAD_ONCE_SIZE], ++ } ++ #[repr(C)] ++ #[repr(align(4))] ++ pub struct pthread_spinlock_t { ++ bytes: [u8; _PTHREAD_SPINLOCK_SIZE], ++ } ++} ++const _PTHREAD_ATTR_SIZE: usize = 32; ++const _PTHREAD_RWLOCKATTR_SIZE: usize = 1; ++const _PTHREAD_RWLOCK_SIZE: usize = 4; ++const _PTHREAD_BARRIER_SIZE: usize = 24; ++const _PTHREAD_BARRIERATTR_SIZE: usize = 4; ++const _PTHREAD_CONDATTR_SIZE: usize = 8; ++const _PTHREAD_COND_SIZE: usize = 8; ++const _PTHREAD_MUTEX_SIZE: usize = 12; ++const _PTHREAD_MUTEXATTR_SIZE: usize = 20; ++const _PTHREAD_ONCE_SIZE: usize = 4; ++const _PTHREAD_SPINLOCK_SIZE: usize = 4; ++ ++pub const UTSLENGTH: usize = 65; ++ ++// intentionally not public, only used for fd_set ++cfg_if! { ++ if #[cfg(target_pointer_width = "32")] { ++ const ULONG_SIZE: usize = 32; ++ } else if #[cfg(target_pointer_width = "64")] { ++ const ULONG_SIZE: usize = 64; ++ } else { ++ // Unknown target_pointer_width ++ } ++} ++ ++// limits.h ++pub const PATH_MAX: c_int = 4096; ++ ++// fcntl.h ++pub const F_GETLK: c_int = 5; ++pub const F_SETLK: c_int = 6; ++pub const F_SETLKW: c_int = 7; ++pub const F_ULOCK: c_int = 0; ++pub const F_LOCK: c_int = 1; ++pub const F_TLOCK: c_int = 2; ++pub const F_TEST: c_int = 3; ++ ++// FIXME: relibc { ++pub const RTLD_DEFAULT: *mut c_void = 0i64 as *mut c_void; ++// } ++ ++// dlfcn.h ++pub const RTLD_LAZY: c_int = 0x0001; ++pub const RTLD_NOW: c_int = 0x0002; ++pub const RTLD_GLOBAL: c_int = 0x0100; ++pub const RTLD_LOCAL: c_int = 0x0000; ++ ++// errno.h ++pub const EPERM: c_int = 1; /* Operation not permitted */ ++pub const ENOENT: c_int = 2; /* No such file or directory */ ++pub const ESRCH: c_int = 3; /* No such process */ ++pub const EINTR: c_int = 4; /* Interrupted system call */ ++pub const EIO: c_int = 5; /* I/O error */ ++pub const ENXIO: c_int = 6; /* No such device or address */ ++pub const E2BIG: c_int = 7; /* Argument list too long */ ++pub const ENOEXEC: c_int = 8; /* Exec format error */ ++pub const EBADF: c_int = 9; /* Bad file number */ ++pub const ECHILD: c_int = 10; /* No child processes */ ++pub const EAGAIN: c_int = 11; /* Try again */ ++pub const ENOMEM: c_int = 12; /* Out of memory */ ++pub const EACCES: c_int = 13; /* Permission denied */ ++pub const EFAULT: c_int = 14; /* Bad address */ ++pub const ENOTBLK: c_int = 15; /* Block device required */ ++pub const EBUSY: c_int = 16; /* Device or resource busy */ ++pub const EEXIST: c_int = 17; /* File exists */ ++pub const EXDEV: c_int = 18; /* Cross-device link */ ++pub const ENODEV: c_int = 19; /* No such device */ ++pub const ENOTDIR: c_int = 20; /* Not a directory */ ++pub const EISDIR: c_int = 21; /* Is a directory */ ++pub const EINVAL: c_int = 22; /* Invalid argument */ ++pub const ENFILE: c_int = 23; /* File table overflow */ ++pub const EMFILE: c_int = 24; /* Too many open files */ ++pub const ENOTTY: c_int = 25; /* Not a typewriter */ ++pub const ETXTBSY: c_int = 26; /* Text file busy */ ++pub const EFBIG: c_int = 27; /* File too large */ ++pub const ENOSPC: c_int = 28; /* No space left on device */ ++pub const ESPIPE: c_int = 29; /* Illegal seek */ ++pub const EROFS: c_int = 30; /* Read-only file system */ ++pub const EMLINK: c_int = 31; /* Too many links */ ++pub const EPIPE: c_int = 32; /* Broken pipe */ ++pub const EDOM: c_int = 33; /* Math argument out of domain of func */ ++pub const ERANGE: c_int = 34; /* Math result not representable */ ++pub const EDEADLK: c_int = 35; /* Resource deadlock would occur */ ++pub const ENAMETOOLONG: c_int = 36; /* File name too long */ ++pub const ENOLCK: c_int = 37; /* No record locks available */ ++pub const ENOSYS: c_int = 38; /* Function not implemented */ ++pub const ENOTEMPTY: c_int = 39; /* Directory not empty */ ++pub const ELOOP: c_int = 40; /* Too many symbolic links encountered */ ++pub const EWOULDBLOCK: c_int = 41; /* Operation would block */ ++pub const ENOMSG: c_int = 42; /* No message of desired type */ ++pub const EIDRM: c_int = 43; /* Identifier removed */ ++pub const ECHRNG: c_int = 44; /* Channel number out of range */ ++pub const EL2NSYNC: c_int = 45; /* Level 2 not synchronized */ ++pub const EL3HLT: c_int = 46; /* Level 3 halted */ ++pub const EL3RST: c_int = 47; /* Level 3 reset */ ++pub const ELNRNG: c_int = 48; /* Link number out of range */ ++pub const EUNATCH: c_int = 49; /* Protocol driver not attached */ ++pub const ENOCSI: c_int = 50; /* No CSI structure available */ ++pub const EL2HLT: c_int = 51; /* Level 2 halted */ ++pub const EBADE: c_int = 52; /* Invalid exchange */ ++pub const EBADR: c_int = 53; /* Invalid request descriptor */ ++pub const EXFULL: c_int = 54; /* Exchange full */ ++pub const ENOANO: c_int = 55; /* No anode */ ++pub const EBADRQC: c_int = 56; /* Invalid request code */ ++pub const EBADSLT: c_int = 57; /* Invalid slot */ ++pub const EDEADLOCK: c_int = 58; /* Resource deadlock would occur */ ++pub const EBFONT: c_int = 59; /* Bad font file format */ ++pub const ENOSTR: c_int = 60; /* Device not a stream */ ++pub const ENODATA: c_int = 61; /* No data available */ ++pub const ETIME: c_int = 62; /* Timer expired */ ++pub const ENOSR: c_int = 63; /* Out of streams resources */ ++pub const ENONET: c_int = 64; /* Machine is not on the network */ ++pub const ENOPKG: c_int = 65; /* Package not installed */ ++pub const EREMOTE: c_int = 66; /* Object is remote */ ++pub const ENOLINK: c_int = 67; /* Link has been severed */ ++pub const EADV: c_int = 68; /* Advertise error */ ++pub const ESRMNT: c_int = 69; /* Srmount error */ ++pub const ECOMM: c_int = 70; /* Communication error on send */ ++pub const EPROTO: c_int = 71; /* Protocol error */ ++pub const EMULTIHOP: c_int = 72; /* Multihop attempted */ ++pub const EDOTDOT: c_int = 73; /* RFS specific error */ ++pub const EBADMSG: c_int = 74; /* Not a data message */ ++pub const EOVERFLOW: c_int = 75; /* Value too large for defined data type */ ++pub const ENOTUNIQ: c_int = 76; /* Name not unique on network */ ++pub const EBADFD: c_int = 77; /* File descriptor in bad state */ ++pub const EREMCHG: c_int = 78; /* Remote address changed */ ++pub const ELIBACC: c_int = 79; /* Can not access a needed shared library */ ++pub const ELIBBAD: c_int = 80; /* Accessing a corrupted shared library */ ++pub const ELIBSCN: c_int = 81; /* .lib section in a.out corrupted */ ++/* Attempting to link in too many shared libraries */ ++pub const ELIBMAX: c_int = 82; ++pub const ELIBEXEC: c_int = 83; /* Cannot exec a shared library directly */ ++pub const EILSEQ: c_int = 84; /* Illegal byte sequence */ ++/* Interrupted system call should be restarted */ ++pub const ERESTART: c_int = 85; ++pub const ESTRPIPE: c_int = 86; /* Streams pipe error */ ++pub const EUSERS: c_int = 87; /* Too many users */ ++pub const ENOTSOCK: c_int = 88; /* Socket operation on non-socket */ ++pub const EDESTADDRREQ: c_int = 89; /* Destination address required */ ++pub const EMSGSIZE: c_int = 90; /* Message too long */ ++pub const EPROTOTYPE: c_int = 91; /* Protocol wrong type for socket */ ++pub const ENOPROTOOPT: c_int = 92; /* Protocol not available */ ++pub const EPROTONOSUPPORT: c_int = 93; /* Protocol not supported */ ++pub const ESOCKTNOSUPPORT: c_int = 94; /* Socket type not supported */ ++/* Operation not supported on transport endpoint */ ++pub const EOPNOTSUPP: c_int = 95; ++pub const ENOTSUP: c_int = EOPNOTSUPP; ++pub const EPFNOSUPPORT: c_int = 96; /* Protocol family not supported */ ++/* Address family not supported by protocol */ ++pub const EAFNOSUPPORT: c_int = 97; ++pub const EADDRINUSE: c_int = 98; /* Address already in use */ ++pub const EADDRNOTAVAIL: c_int = 99; /* Cannot assign requested address */ ++pub const ENETDOWN: c_int = 100; /* Network is down */ ++pub const ENETUNREACH: c_int = 101; /* Network is unreachable */ ++/* Network dropped connection because of reset */ ++pub const ENETRESET: c_int = 102; ++pub const ECONNABORTED: c_int = 103; /* Software caused connection abort */ ++pub const ECONNRESET: c_int = 104; /* Connection reset by peer */ ++pub const ENOBUFS: c_int = 105; /* No buffer space available */ ++pub const EISCONN: c_int = 106; /* Transport endpoint is already connected */ ++pub const ENOTCONN: c_int = 107; /* Transport endpoint is not connected */ ++/* Cannot send after transport endpoint shutdown */ ++pub const ESHUTDOWN: c_int = 108; ++pub const ETOOMANYREFS: c_int = 109; /* Too many references: cannot splice */ ++pub const ETIMEDOUT: c_int = 110; /* Connection timed out */ ++pub const ECONNREFUSED: c_int = 111; /* Connection refused */ ++pub const EHOSTDOWN: c_int = 112; /* Host is down */ ++pub const EHOSTUNREACH: c_int = 113; /* No route to host */ ++pub const EALREADY: c_int = 114; /* Operation already in progress */ ++pub const EINPROGRESS: c_int = 115; /* Operation now in progress */ ++pub const ESTALE: c_int = 116; /* Stale NFS file handle */ ++pub const EUCLEAN: c_int = 117; /* Structure needs cleaning */ ++pub const ENOTNAM: c_int = 118; /* Not a XENIX named type file */ ++pub const ENAVAIL: c_int = 119; /* No XENIX semaphores available */ ++pub const EISNAM: c_int = 120; /* Is a named type file */ ++pub const EREMOTEIO: c_int = 121; /* Remote I/O error */ ++pub const EDQUOT: c_int = 122; /* Quota exceeded */ ++pub const ENOMEDIUM: c_int = 123; /* No medium found */ ++pub const EMEDIUMTYPE: c_int = 124; /* Wrong medium type */ ++pub const ECANCELED: c_int = 125; /* Operation Canceled */ ++pub const ENOKEY: c_int = 126; /* Required key not available */ ++pub const EKEYEXPIRED: c_int = 127; /* Key has expired */ ++pub const EKEYREVOKED: c_int = 128; /* Key has been revoked */ ++pub const EKEYREJECTED: c_int = 129; /* Key was rejected by service */ ++pub const EOWNERDEAD: c_int = 130; /* Owner died */ ++pub const ENOTRECOVERABLE: c_int = 131; /* State not recoverable */ ++ ++// fcntl.h ++pub const F_DUPFD: c_int = 0; ++pub const F_GETFD: c_int = 1; ++pub const F_SETFD: c_int = 2; ++pub const F_GETFL: c_int = 3; ++pub const F_SETFL: c_int = 4; ++// FIXME: relibc { ++pub const F_DUPFD_CLOEXEC: c_int = crate::F_DUPFD; ++// } ++pub const FD_CLOEXEC: c_int = 0x0100_0000; ++pub const O_RDONLY: c_int = 0x0001_0000; ++pub const O_WRONLY: c_int = 0x0002_0000; ++pub const O_RDWR: c_int = 0x0003_0000; ++pub const O_ACCMODE: c_int = 0x0003_0000; ++pub const O_NONBLOCK: c_int = 0x0004_0000; ++pub const O_APPEND: c_int = 0x0008_0000; ++pub const O_SHLOCK: c_int = 0x0010_0000; ++pub const O_EXLOCK: c_int = 0x0020_0000; ++pub const O_ASYNC: c_int = 0x0040_0000; ++pub const O_FSYNC: c_int = 0x0080_0000; ++pub const O_CLOEXEC: c_int = 0x0100_0000; ++pub const O_CREAT: c_int = 0x0200_0000; ++pub const O_TRUNC: c_int = 0x0400_0000; ++pub const O_EXCL: c_int = 0x0800_0000; ++pub const O_DIRECTORY: c_int = 0x1000_0000; ++pub const O_PATH: c_int = 0x2000_0000; ++pub const O_SYMLINK: c_int = 0x4000_0000; ++// Negative to allow it to be used as int ++// FIXME: Fix negative values missing from includes ++pub const O_NOFOLLOW: c_int = -0x8000_0000; ++ ++// locale.h ++pub const LC_ALL: c_int = 0; ++pub const LC_COLLATE: c_int = 1; ++pub const LC_CTYPE: c_int = 2; ++pub const LC_MESSAGES: c_int = 3; ++pub const LC_MONETARY: c_int = 4; ++pub const LC_NUMERIC: c_int = 5; ++pub const LC_TIME: c_int = 6; ++ ++// netdb.h ++pub const AI_PASSIVE: c_int = 0x0001; ++pub const AI_CANONNAME: c_int = 0x0002; ++pub const AI_NUMERICHOST: c_int = 0x0004; ++pub const AI_V4MAPPED: c_int = 0x0008; ++pub const AI_ALL: c_int = 0x0010; ++pub const AI_ADDRCONFIG: c_int = 0x0020; ++pub const AI_NUMERICSERV: c_int = 0x0400; ++pub const EAI_BADFLAGS: c_int = -1; ++pub const EAI_NONAME: c_int = -2; ++pub const EAI_AGAIN: c_int = -3; ++pub const EAI_FAIL: c_int = -4; ++pub const EAI_NODATA: c_int = -5; ++pub const EAI_FAMILY: c_int = -6; ++pub const EAI_SOCKTYPE: c_int = -7; ++pub const EAI_SERVICE: c_int = -8; ++pub const EAI_ADDRFAMILY: c_int = -9; ++pub const EAI_MEMORY: c_int = -10; ++pub const EAI_SYSTEM: c_int = -11; ++pub const EAI_OVERFLOW: c_int = -12; ++pub const NI_MAXHOST: c_int = 1025; ++pub const NI_MAXSERV: c_int = 32; ++pub const NI_NUMERICHOST: c_int = 0x0001; ++pub const NI_NUMERICSERV: c_int = 0x0002; ++pub const NI_NOFQDN: c_int = 0x0004; ++pub const NI_NAMEREQD: c_int = 0x0008; ++pub const NI_DGRAM: c_int = 0x0010; ++ ++// netinet/in.h ++// FIXME: relibc { ++pub const IP_TTL: c_int = 2; ++pub const IPV6_UNICAST_HOPS: c_int = 16; ++pub const IPV6_MULTICAST_IF: c_int = 17; ++pub const IPV6_MULTICAST_HOPS: c_int = 18; ++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 IP_MULTICAST_IF: c_int = 32; ++pub const IP_MULTICAST_TTL: c_int = 33; ++pub const IP_MULTICAST_LOOP: c_int = 34; ++pub const IP_ADD_MEMBERSHIP: c_int = 35; ++pub const IP_DROP_MEMBERSHIP: c_int = 36; ++pub const IP_TOS: c_int = 1; ++pub const IP_RECVTOS: c_int = 2; ++pub const IPPROTO_IGMP: c_int = 2; ++pub const IPPROTO_PUP: c_int = 12; ++pub const IPPROTO_IDP: c_int = 22; ++pub const IPPROTO_RAW: c_int = 255; ++pub const IPPROTO_MAX: c_int = 255; ++// } ++ ++// netinet/tcp.h ++pub const TCP_NODELAY: c_int = 1; ++// FIXME: relibc { ++pub const TCP_KEEPIDLE: c_int = 1; ++// } ++ ++// poll.h ++pub const POLLIN: c_short = 0x001; ++pub const POLLPRI: c_short = 0x002; ++pub const POLLOUT: c_short = 0x004; ++pub const POLLERR: c_short = 0x008; ++pub const POLLHUP: c_short = 0x010; ++pub const POLLNVAL: c_short = 0x020; ++pub const POLLRDNORM: c_short = 0x040; ++pub const POLLRDBAND: c_short = 0x080; ++pub const POLLWRNORM: c_short = 0x100; ++pub const POLLWRBAND: c_short = 0x200; ++ ++// pthread.h ++pub const PTHREAD_MUTEX_NORMAL: c_int = 0; ++pub const PTHREAD_MUTEX_RECURSIVE: c_int = 1; ++pub const PTHREAD_MUTEX_INITIALIZER: crate::pthread_mutex_t = crate::pthread_mutex_t { ++ bytes: [0; _PTHREAD_MUTEX_SIZE], ++}; ++pub const PTHREAD_COND_INITIALIZER: crate::pthread_cond_t = crate::pthread_cond_t { ++ bytes: [0; _PTHREAD_COND_SIZE], ++}; ++pub const PTHREAD_RWLOCK_INITIALIZER: crate::pthread_rwlock_t = crate::pthread_rwlock_t { ++ bytes: [0; _PTHREAD_RWLOCK_SIZE], ++}; ++pub const PTHREAD_STACK_MIN: size_t = 4096; ++ ++// signal.h ++pub const SIG_BLOCK: c_int = 0; ++pub const SIG_UNBLOCK: c_int = 1; ++pub const SIG_SETMASK: c_int = 2; ++pub const SIGHUP: c_int = 1; ++pub const SIGINT: c_int = 2; ++pub const SIGQUIT: c_int = 3; ++pub const SIGILL: c_int = 4; ++pub const SIGTRAP: c_int = 5; ++pub const SIGABRT: c_int = 6; ++pub const SIGBUS: c_int = 7; ++pub const SIGFPE: c_int = 8; ++pub const SIGKILL: c_int = 9; ++pub const SIGUSR1: c_int = 10; ++pub const SIGSEGV: c_int = 11; ++pub const SIGUSR2: c_int = 12; ++pub const SIGPIPE: c_int = 13; ++pub const SIGALRM: c_int = 14; ++pub const SIGTERM: c_int = 15; ++pub const SIGSTKFLT: c_int = 16; ++pub const SIGCHLD: c_int = 17; ++pub const SIGCONT: c_int = 18; ++pub const SIGSTOP: c_int = 19; ++pub const SIGTSTP: c_int = 20; ++pub const SIGTTIN: c_int = 21; ++pub const SIGTTOU: c_int = 22; ++pub const SIGURG: c_int = 23; ++pub const SIGXCPU: c_int = 24; ++pub const SIGXFSZ: c_int = 25; ++pub const SIGVTALRM: c_int = 26; ++pub const SIGPROF: c_int = 27; ++pub const SIGWINCH: c_int = 28; ++pub const SIGIO: c_int = 29; ++pub const SIGPWR: c_int = 30; ++pub const SIGSYS: c_int = 31; ++pub const NSIG: c_int = 32; ++ ++pub const SA_NOCLDSTOP: c_ulong = 0x00000001; ++pub const SA_NOCLDWAIT: c_ulong = 0x00000002; ++pub const SA_SIGINFO: c_ulong = 0x00000004; ++pub const SA_RESTORER: c_ulong = 0x04000000; ++pub const SA_ONSTACK: c_ulong = 0x08000000; ++pub const SA_RESTART: c_ulong = 0x10000000; ++pub const SA_NODEFER: c_ulong = 0x40000000; ++pub const SA_RESETHAND: c_ulong = 0x80000000; ++ ++// sys/file.h ++pub const LOCK_SH: c_int = 1; ++pub const LOCK_EX: c_int = 2; ++pub const LOCK_NB: c_int = 4; ++pub const LOCK_UN: c_int = 8; ++ ++// sys/epoll.h ++pub const EPOLL_CLOEXEC: c_int = 0x0100_0000; ++pub const EPOLL_CTL_ADD: c_int = 1; ++pub const EPOLL_CTL_DEL: c_int = 2; ++pub const EPOLL_CTL_MOD: c_int = 3; ++pub const EPOLLIN: c_int = 0x001; ++pub const EPOLLPRI: c_int = 0x002; ++pub const EPOLLOUT: c_int = 0x004; ++pub const EPOLLERR: c_int = 0x008; ++pub const EPOLLHUP: c_int = 0x010; ++pub const EPOLLNVAL: c_int = 0x020; ++pub const EPOLLRDNORM: c_int = 0x040; ++pub const EPOLLRDBAND: c_int = 0x080; ++pub const EPOLLWRNORM: c_int = 0x100; ++pub const EPOLLWRBAND: c_int = 0x200; ++pub const EPOLLMSG: c_int = 0x400; ++pub const EPOLLRDHUP: c_int = 0x2000; ++pub const EPOLLEXCLUSIVE: c_int = 1 << 28; ++pub const EPOLLWAKEUP: c_int = 1 << 29; ++pub const EPOLLONESHOT: c_int = 1 << 30; ++pub const EPOLLET: c_int = 1 << 31; ++ ++// sys/stat.h ++pub const S_IFMT: c_int = 0o17_0000; ++pub const S_IFDIR: c_int = 0o4_0000; ++pub const S_IFCHR: c_int = 0o2_0000; ++pub const S_IFBLK: c_int = 0o6_0000; ++pub const S_IFREG: c_int = 0o10_0000; ++pub const S_IFIFO: c_int = 0o1_0000; ++pub const S_IFLNK: c_int = 0o12_0000; ++pub const S_IFSOCK: c_int = 0o14_0000; ++pub const S_IRWXU: c_int = 0o0700; ++pub const S_IRUSR: c_int = 0o0400; ++pub const S_IWUSR: c_int = 0o0200; ++pub const S_IXUSR: c_int = 0o0100; ++pub const S_IRWXG: c_int = 0o0070; ++pub const S_IRGRP: c_int = 0o0040; ++pub const S_IWGRP: c_int = 0o0020; ++pub const S_IXGRP: c_int = 0o0010; ++pub const S_IRWXO: c_int = 0o0007; ++pub const S_IROTH: c_int = 0o0004; ++pub const S_IWOTH: c_int = 0o0002; ++pub const S_IXOTH: c_int = 0o0001; ++ ++// stdlib.h ++pub const EXIT_SUCCESS: c_int = 0; ++pub const EXIT_FAILURE: c_int = 1; ++ ++// sys/ioctl.h ++// FIXME: relibc { ++pub const FIONREAD: c_ulong = 0x541B; ++pub const FIONBIO: c_ulong = 0x5421; ++pub const FIOCLEX: c_ulong = 0x5451; ++// } ++pub const TCGETS: c_ulong = 0x5401; ++pub const TCSETS: c_ulong = 0x5402; ++pub const TCFLSH: c_ulong = 0x540B; ++pub const TIOCSCTTY: c_ulong = 0x540E; ++pub const TIOCGPGRP: c_ulong = 0x540F; ++pub const TIOCSPGRP: c_ulong = 0x5410; ++pub const TIOCGWINSZ: c_ulong = 0x5413; ++pub const TIOCSWINSZ: c_ulong = 0x5414; ++ ++// sys/mman.h ++pub const PROT_NONE: c_int = 0x0000; ++pub const PROT_READ: c_int = 0x0004; ++pub const PROT_WRITE: c_int = 0x0002; ++pub const PROT_EXEC: c_int = 0x0001; ++ ++pub const MADV_NORMAL: c_int = 0; ++pub const MADV_RANDOM: c_int = 1; ++pub const MADV_SEQUENTIAL: c_int = 2; ++pub const MADV_WILLNEED: c_int = 3; ++pub const MADV_DONTNEED: c_int = 4; ++ ++pub const MAP_SHARED: c_int = 0x0001; ++pub const MAP_PRIVATE: c_int = 0x0002; ++pub const MAP_ANON: c_int = 0x0020; ++pub const MAP_ANONYMOUS: c_int = MAP_ANON; ++pub const MAP_FIXED: c_int = 0x0010; ++pub const MAP_FAILED: *mut c_void = !0 as _; ++ ++pub const MS_ASYNC: c_int = 0x0001; ++pub const MS_INVALIDATE: c_int = 0x0002; ++pub const MS_SYNC: c_int = 0x0004; ++ ++// sys/select.h ++pub const FD_SETSIZE: usize = 1024; ++ ++// sys/socket.h ++pub const AF_INET: c_int = 2; ++pub const AF_INET6: c_int = 10; ++pub const AF_UNIX: c_int = 1; ++pub const AF_UNSPEC: c_int = 0; ++pub const PF_INET: c_int = 2; ++pub const PF_INET6: c_int = 10; ++pub const PF_UNIX: c_int = 1; ++pub const PF_UNSPEC: c_int = 0; ++pub const MSG_CTRUNC: c_int = 8; ++pub const MSG_DONTROUTE: c_int = 4; ++pub const MSG_EOR: c_int = 128; ++pub const MSG_OOB: c_int = 1; ++pub const MSG_PEEK: c_int = 2; ++pub const MSG_TRUNC: c_int = 32; ++pub const MSG_DONTWAIT: c_int = 64; ++pub const MSG_WAITALL: c_int = 256; ++pub const SHUT_RD: c_int = 0; ++pub const SHUT_WR: c_int = 1; ++pub const SHUT_RDWR: c_int = 2; ++pub const SO_DEBUG: c_int = 1; ++pub const SO_REUSEADDR: c_int = 2; ++pub const SO_TYPE: c_int = 3; ++pub const SO_ERROR: c_int = 4; ++pub const SO_DONTROUTE: c_int = 5; ++pub const SO_BROADCAST: c_int = 6; ++pub const SO_SNDBUF: c_int = 7; ++pub const SO_RCVBUF: c_int = 8; ++pub const SO_KEEPALIVE: c_int = 9; ++pub const SO_OOBINLINE: c_int = 10; ++pub const SO_NO_CHECK: c_int = 11; ++pub const SO_PRIORITY: c_int = 12; ++pub const SO_LINGER: c_int = 13; ++pub const SO_BSDCOMPAT: c_int = 14; ++pub const SO_REUSEPORT: c_int = 15; ++pub const SO_PASSCRED: c_int = 16; ++pub const SO_PEERCRED: c_int = 17; ++pub const SO_RCVLOWAT: c_int = 18; ++pub const SO_SNDLOWAT: c_int = 19; ++pub const SO_RCVTIMEO: c_int = 20; ++pub const SO_SNDTIMEO: c_int = 21; ++pub const SO_ACCEPTCONN: c_int = 30; ++pub const SO_PEERSEC: c_int = 31; ++pub const SO_SNDBUFFORCE: c_int = 32; ++pub const SO_RCVBUFFORCE: c_int = 33; ++pub const SO_PROTOCOL: c_int = 38; ++pub const SO_DOMAIN: c_int = 39; ++pub const SOCK_STREAM: c_int = 1; ++pub const SOCK_DGRAM: c_int = 2; ++pub const SOCK_RAW: c_int = 3; ++pub const SOCK_NONBLOCK: c_int = 0o4_000; ++pub const SOCK_CLOEXEC: c_int = 0o2_000_000; ++pub const SOCK_SEQPACKET: c_int = 5; ++pub const SOL_SOCKET: c_int = 1; ++pub const SOMAXCONN: c_int = 128; ++ ++// sys/termios.h ++pub const VEOF: usize = 0; ++pub const VEOL: usize = 1; ++pub const VEOL2: usize = 2; ++pub const VERASE: usize = 3; ++pub const VWERASE: usize = 4; ++pub const VKILL: usize = 5; ++pub const VREPRINT: usize = 6; ++pub const VSWTC: usize = 7; ++pub const VINTR: usize = 8; ++pub const VQUIT: usize = 9; ++pub const VSUSP: usize = 10; ++pub const VSTART: usize = 12; ++pub const VSTOP: usize = 13; ++pub const VLNEXT: usize = 14; ++pub const VDISCARD: usize = 15; ++pub const VMIN: usize = 16; ++pub const VTIME: usize = 17; ++pub const NCCS: usize = 32; ++ ++pub const IGNBRK: crate::tcflag_t = 0o000_001; ++pub const BRKINT: crate::tcflag_t = 0o000_002; ++pub const IGNPAR: crate::tcflag_t = 0o000_004; ++pub const PARMRK: crate::tcflag_t = 0o000_010; ++pub const INPCK: crate::tcflag_t = 0o000_020; ++pub const ISTRIP: crate::tcflag_t = 0o000_040; ++pub const INLCR: crate::tcflag_t = 0o000_100; ++pub const IGNCR: crate::tcflag_t = 0o000_200; ++pub const ICRNL: crate::tcflag_t = 0o000_400; ++pub const IXON: crate::tcflag_t = 0o001_000; ++pub const IXOFF: crate::tcflag_t = 0o002_000; ++ ++pub const OPOST: crate::tcflag_t = 0o000_001; ++pub const ONLCR: crate::tcflag_t = 0o000_002; ++pub const OLCUC: crate::tcflag_t = 0o000_004; ++pub const OCRNL: crate::tcflag_t = 0o000_010; ++pub const ONOCR: crate::tcflag_t = 0o000_020; ++pub const ONLRET: crate::tcflag_t = 0o000_040; ++pub const OFILL: crate::tcflag_t = 0o0000_100; ++pub const OFDEL: crate::tcflag_t = 0o0000_200; ++ ++pub const B0: speed_t = 0o000_000; ++pub const B50: speed_t = 0o000_001; ++pub const B75: speed_t = 0o000_002; ++pub const B110: speed_t = 0o000_003; ++pub const B134: speed_t = 0o000_004; ++pub const B150: speed_t = 0o000_005; ++pub const B200: speed_t = 0o000_006; ++pub const B300: speed_t = 0o000_007; ++pub const B600: speed_t = 0o000_010; ++pub const B1200: speed_t = 0o000_011; ++pub const B1800: speed_t = 0o000_012; ++pub const B2400: speed_t = 0o000_013; ++pub const B4800: speed_t = 0o000_014; ++pub const B9600: speed_t = 0o000_015; ++pub const B19200: speed_t = 0o000_016; ++pub const B38400: speed_t = 0o000_017; ++ ++pub const B57600: speed_t = 0o0_020; ++pub const B115200: speed_t = 0o0_021; ++pub const B230400: speed_t = 0o0_022; ++pub const B460800: speed_t = 0o0_023; ++pub const B500000: speed_t = 0o0_024; ++pub const B576000: speed_t = 0o0_025; ++pub const B921600: speed_t = 0o0_026; ++pub const B1000000: speed_t = 0o0_027; ++pub const B1152000: speed_t = 0o0_030; ++pub const B1500000: speed_t = 0o0_031; ++pub const B2000000: speed_t = 0o0_032; ++pub const B2500000: speed_t = 0o0_033; ++pub const B3000000: speed_t = 0o0_034; ++pub const B3500000: speed_t = 0o0_035; ++pub const B4000000: speed_t = 0o0_036; ++ ++pub const CSIZE: crate::tcflag_t = 0o001_400; ++pub const CS5: crate::tcflag_t = 0o000_000; ++pub const CS6: crate::tcflag_t = 0o000_400; ++pub const CS7: crate::tcflag_t = 0o001_000; ++pub const CS8: crate::tcflag_t = 0o001_400; ++ ++pub const CSTOPB: crate::tcflag_t = 0o002_000; ++pub const CREAD: crate::tcflag_t = 0o004_000; ++pub const PARENB: crate::tcflag_t = 0o010_000; ++pub const PARODD: crate::tcflag_t = 0o020_000; ++pub const HUPCL: crate::tcflag_t = 0o040_000; ++ ++pub const CLOCAL: crate::tcflag_t = 0o0100000; ++ ++pub const ISIG: crate::tcflag_t = 0x0000_0080; ++pub const ICANON: crate::tcflag_t = 0x0000_0100; ++pub const ECHO: crate::tcflag_t = 0x0000_0008; ++pub const ECHOE: crate::tcflag_t = 0x0000_0002; ++pub const ECHOK: crate::tcflag_t = 0x0000_0004; ++pub const ECHONL: crate::tcflag_t = 0x0000_0010; ++pub const NOFLSH: crate::tcflag_t = 0x8000_0000; ++pub const TOSTOP: crate::tcflag_t = 0x0040_0000; ++pub const IEXTEN: crate::tcflag_t = 0x0000_0400; ++ ++pub const TCOOFF: c_int = 0; ++pub const TCOON: c_int = 1; ++pub const TCIOFF: c_int = 2; ++pub const TCION: c_int = 3; ++ ++pub const TCIFLUSH: c_int = 0; ++pub const TCOFLUSH: c_int = 1; ++pub const TCIOFLUSH: c_int = 2; ++ ++pub const TCSANOW: c_int = 0; ++pub const TCSADRAIN: c_int = 1; ++pub const TCSAFLUSH: c_int = 2; ++ ++// sys/wait.h ++pub const WNOHANG: c_int = 1; ++pub const WUNTRACED: c_int = 2; ++ ++pub const WSTOPPED: c_int = 2; ++pub const WEXITED: c_int = 4; ++pub const WCONTINUED: c_int = 8; ++pub const WNOWAIT: c_int = 0x0100_0000; ++ ++pub const __WNOTHREAD: c_int = 0x2000_0000; ++pub const __WALL: c_int = 0x4000_0000; ++#[allow(overflowing_literals)] ++pub const __WCLONE: c_int = 0x8000_0000; ++ ++// time.h ++pub const CLOCK_REALTIME: c_int = 1; ++pub const CLOCK_MONOTONIC: c_int = 4; ++pub const CLOCK_PROCESS_CPUTIME_ID: crate::clockid_t = 2; ++pub const CLOCKS_PER_SEC: crate::clock_t = 1_000_000; ++ ++// unistd.h ++// POSIX.1 { ++pub const _SC_ARG_MAX: c_int = 0; ++pub const _SC_CHILD_MAX: c_int = 1; ++pub const _SC_CLK_TCK: c_int = 2; ++pub const _SC_NGROUPS_MAX: c_int = 3; ++pub const _SC_OPEN_MAX: c_int = 4; ++pub const _SC_STREAM_MAX: c_int = 5; ++pub const _SC_TZNAME_MAX: c_int = 6; ++// ... ++pub const _SC_VERSION: c_int = 29; ++pub const _SC_PAGESIZE: c_int = 30; ++pub const _SC_PAGE_SIZE: c_int = 30; ++// ... ++pub const _SC_RE_DUP_MAX: c_int = 44; ++// ... ++pub const _SC_LOGIN_NAME_MAX: c_int = 71; ++pub const _SC_TTY_NAME_MAX: c_int = 72; ++// ... ++pub const _SC_SYMLOOP_MAX: c_int = 173; ++// ... ++pub const _SC_HOST_NAME_MAX: c_int = 180; ++// } POSIX.1 ++ ++pub const F_OK: c_int = 0; ++pub const R_OK: c_int = 4; ++pub const W_OK: c_int = 2; ++pub const X_OK: c_int = 1; ++ ++pub const SEEK_SET: c_int = 0; ++pub const SEEK_CUR: c_int = 1; ++pub const SEEK_END: c_int = 2; ++pub const STDIN_FILENO: c_int = 0; ++pub const STDOUT_FILENO: c_int = 1; ++pub const STDERR_FILENO: c_int = 2; ++ ++pub const _PC_LINK_MAX: c_int = 0; ++pub const _PC_MAX_CANON: c_int = 1; ++pub const _PC_MAX_INPUT: c_int = 2; ++pub const _PC_NAME_MAX: c_int = 3; ++pub const _PC_PATH_MAX: c_int = 4; ++pub const _PC_PIPE_BUF: c_int = 5; ++pub const _PC_CHOWN_RESTRICTED: c_int = 6; ++pub const _PC_NO_TRUNC: c_int = 7; ++pub const _PC_VDISABLE: c_int = 8; ++pub const _PC_SYNC_IO: c_int = 9; ++pub const _PC_ASYNC_IO: c_int = 10; ++pub const _PC_PRIO_IO: c_int = 11; ++pub const _PC_SOCK_MAXBUF: c_int = 12; ++pub const _PC_FILESIZEBITS: c_int = 13; ++pub const _PC_REC_INCR_XFER_SIZE: c_int = 14; ++pub const _PC_REC_MAX_XFER_SIZE: c_int = 15; ++pub const _PC_REC_MIN_XFER_SIZE: c_int = 16; ++pub const _PC_REC_XFER_ALIGN: c_int = 17; ++pub const _PC_ALLOC_SIZE_MIN: c_int = 18; ++pub const _PC_SYMLINK_MAX: c_int = 19; ++pub const _PC_2_SYMLINKS: c_int = 20; ++ ++pub const PRIO_PROCESS: c_int = 0; ++pub const PRIO_PGRP: c_int = 1; ++pub const PRIO_USER: c_int = 2; ++ ++// wait.h ++f! { ++ pub fn FD_CLR(fd: c_int, set: *mut fd_set) -> () { ++ let fd = fd as usize; ++ let size = mem::size_of_val(&(*set).fds_bits[0]) * 8; ++ (*set).fds_bits[fd / size] &= !(1 << (fd % size)); ++ return; ++ } ++ ++ pub fn FD_ISSET(fd: c_int, set: *const fd_set) -> bool { ++ let fd = fd as usize; ++ let size = mem::size_of_val(&(*set).fds_bits[0]) * 8; ++ return ((*set).fds_bits[fd / size] & (1 << (fd % size))) != 0; ++ } ++ ++ pub fn FD_SET(fd: c_int, set: *mut fd_set) -> () { ++ let fd = fd as usize; ++ let size = mem::size_of_val(&(*set).fds_bits[0]) * 8; ++ (*set).fds_bits[fd / size] |= 1 << (fd % size); ++ return; ++ } ++ ++ pub fn FD_ZERO(set: *mut fd_set) -> () { ++ for slot in (*set).fds_bits.iter_mut() { ++ *slot = 0; ++ } ++ } ++} ++ ++safe_f! { ++ pub {const} fn WIFSTOPPED(status: c_int) -> bool { ++ (status & 0xff) == 0x7f ++ } ++ ++ pub {const} fn WSTOPSIG(status: c_int) -> c_int { ++ (status >> 8) & 0xff ++ } ++ ++ pub {const} fn WIFCONTINUED(status: c_int) -> bool { ++ status == 0xffff ++ } ++ ++ pub {const} fn WIFSIGNALED(status: c_int) -> bool { ++ ((status & 0x7f) + 1) as i8 >= 2 ++ } ++ ++ pub {const} fn WTERMSIG(status: c_int) -> c_int { ++ status & 0x7f ++ } ++ ++ pub {const} fn WIFEXITED(status: c_int) -> bool { ++ (status & 0x7f) == 0 ++ } ++ ++ pub {const} fn WEXITSTATUS(status: c_int) -> c_int { ++ (status >> 8) & 0xff ++ } ++ ++ pub {const} fn WCOREDUMP(status: c_int) -> bool { ++ (status & 0x80) != 0 ++ } ++} ++ ++extern "C" { ++ // errno.h ++ pub fn __errno_location() -> *mut c_int; ++ pub fn strerror_r(errnum: c_int, buf: *mut c_char, buflen: size_t) -> c_int; ++ ++ // unistd.h ++ pub fn pipe2(fds: *mut c_int, flags: c_int) -> c_int; ++ pub fn getdtablesize() -> c_int; ++ ++ // grp.h ++ pub fn getgrent() -> *mut crate::group; ++ pub fn setgrent(); ++ pub fn endgrent(); ++ pub fn getgrgid(gid: crate::gid_t) -> *mut crate::group; ++ pub fn getgrgid_r( ++ gid: crate::gid_t, ++ grp: *mut crate::group, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut crate::group, ++ ) -> c_int; ++ pub fn getgrnam(name: *const c_char) -> *mut crate::group; ++ pub fn getgrnam_r( ++ name: *const c_char, ++ grp: *mut crate::group, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut crate::group, ++ ) -> c_int; ++ pub fn getgrouplist( ++ user: *const c_char, ++ group: crate::gid_t, ++ groups: *mut crate::gid_t, ++ ngroups: *mut c_int, ++ ) -> c_int; ++ ++ // malloc.h ++ pub fn memalign(align: size_t, size: size_t) -> *mut c_void; ++ ++ // netdb.h ++ pub fn getnameinfo( ++ addr: *const crate::sockaddr, ++ addrlen: crate::socklen_t, ++ host: *mut c_char, ++ hostlen: crate::socklen_t, ++ serv: *mut c_char, ++ servlen: crate::socklen_t, ++ flags: c_int, ++ ) -> c_int; ++ ++ // pthread.h ++ pub fn pthread_atfork( ++ prepare: Option, ++ parent: Option, ++ child: Option, ++ ) -> c_int; ++ pub fn pthread_create( ++ tid: *mut crate::pthread_t, ++ attr: *const crate::pthread_attr_t, ++ start: extern "C" fn(*mut c_void) -> *mut c_void, ++ arg: *mut c_void, ++ ) -> c_int; ++ pub fn pthread_condattr_setclock( ++ attr: *mut pthread_condattr_t, ++ clock_id: crate::clockid_t, ++ ) -> c_int; ++ ++ //pty.h ++ pub fn openpty( ++ amaster: *mut c_int, ++ aslave: *mut c_int, ++ name: *mut c_char, ++ termp: *const termios, ++ winp: *const crate::winsize, ++ ) -> c_int; ++ ++ // pwd.h ++ pub fn getpwent() -> *mut passwd; ++ pub fn setpwent(); ++ pub fn endpwent(); ++ pub fn getpwnam_r( ++ name: *const c_char, ++ pwd: *mut passwd, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut passwd, ++ ) -> c_int; ++ pub fn getpwuid_r( ++ uid: crate::uid_t, ++ pwd: *mut passwd, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut passwd, ++ ) -> c_int; ++ ++ // signal.h ++ pub fn pthread_sigmask( ++ how: c_int, ++ set: *const crate::sigset_t, ++ oldset: *mut crate::sigset_t, ++ ) -> c_int; ++ pub fn pthread_cancel(thread: crate::pthread_t) -> c_int; ++ pub fn pthread_kill(thread: crate::pthread_t, sig: c_int) -> c_int; ++ pub fn sigtimedwait( ++ set: *const sigset_t, ++ sig: *mut siginfo_t, ++ timeout: *const crate::timespec, ++ ) -> c_int; ++ pub fn sigwait(set: *const sigset_t, sig: *mut c_int) -> c_int; ++ ++ // stdlib.h ++ pub fn getsubopt( ++ optionp: *mut *mut c_char, ++ tokens: *const *mut c_char, ++ valuep: *mut *mut c_char, ++ ) -> c_int; ++ pub fn reallocarray(ptr: *mut c_void, nmemb: size_t, size: size_t) -> *mut c_void; ++ ++ // string.h ++ pub fn explicit_bzero(p: *mut c_void, len: size_t); ++ pub fn strlcat(dst: *mut c_char, src: *const c_char, siz: size_t) -> size_t; ++ pub fn strlcpy(dst: *mut c_char, src: *const c_char, siz: size_t) -> size_t; ++ ++ // sys/epoll.h ++ pub fn epoll_create(size: c_int) -> c_int; ++ pub fn epoll_create1(flags: c_int) -> c_int; ++ pub fn epoll_wait( ++ epfd: c_int, ++ events: *mut crate::epoll_event, ++ maxevents: c_int, ++ timeout: c_int, ++ ) -> c_int; ++ pub fn epoll_ctl(epfd: c_int, op: c_int, fd: c_int, event: *mut crate::epoll_event) -> c_int; ++ ++ // sys/ioctl.h ++ pub fn ioctl(fd: c_int, request: c_ulong, ...) -> c_int; ++ ++ // sys/mman.h ++ pub fn madvise(addr: *mut c_void, len: size_t, advice: c_int) -> c_int; ++ pub fn msync(addr: *mut c_void, len: size_t, flags: c_int) -> c_int; ++ pub fn mprotect(addr: *mut c_void, len: size_t, prot: c_int) -> c_int; ++ pub fn shm_open(name: *const c_char, oflag: c_int, mode: mode_t) -> c_int; ++ pub fn shm_unlink(name: *const c_char) -> c_int; ++ ++ // sys/resource.h ++ pub fn getpriority(which: c_int, who: crate::id_t) -> c_int; ++ pub fn setpriority(which: c_int, who: crate::id_t, prio: c_int) -> c_int; ++ pub fn getrlimit(resource: c_int, rlim: *mut crate::rlimit) -> c_int; ++ pub fn setrlimit(resource: c_int, rlim: *const crate::rlimit) -> c_int; ++ ++ // sys/socket.h ++ pub fn bind( ++ socket: c_int, ++ address: *const crate::sockaddr, ++ address_len: crate::socklen_t, ++ ) -> c_int; ++ pub fn recvfrom( ++ socket: c_int, ++ buf: *mut c_void, ++ len: size_t, ++ flags: c_int, ++ addr: *mut crate::sockaddr, ++ addrlen: *mut crate::socklen_t, ++ ) -> ssize_t; ++ ++ // sys/stat.h ++ pub fn futimens(fd: c_int, times: *const crate::timespec) -> c_int; ++ ++ // sys/uio.h ++ pub fn readv(fd: c_int, iov: *const crate::iovec, iovcnt: c_int) -> ssize_t; ++ pub fn writev(fd: c_int, iov: *const crate::iovec, iovcnt: c_int) -> ssize_t; ++ ++ // sys/utsname.h ++ pub fn uname(utsname: *mut utsname) -> c_int; ++ ++ // time.h ++ pub fn gettimeofday(tp: *mut crate::timeval, tz: *mut crate::timezone) -> c_int; ++ pub fn clock_gettime(clk_id: crate::clockid_t, tp: *mut crate::timespec) -> c_int; ++ ++ // utmp.h ++ pub fn login_tty(fd: c_int) -> c_int; ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for dirent { ++ fn eq(&self, other: &dirent) -> bool { ++ self.d_ino == other.d_ino ++ && self.d_off == other.d_off ++ && self.d_reclen == other.d_reclen ++ && self.d_type == other.d_type ++ && self ++ .d_name ++ .iter() ++ .zip(other.d_name.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ ++ impl Eq for dirent {} ++ ++ impl fmt::Debug for dirent { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("dirent") ++ .field("d_ino", &self.d_ino) ++ .field("d_off", &self.d_off) ++ .field("d_reclen", &self.d_reclen) ++ .field("d_type", &self.d_type) ++ // FIXME: .field("d_name", &self.d_name) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for dirent { ++ fn hash(&self, state: &mut H) { ++ self.d_ino.hash(state); ++ self.d_off.hash(state); ++ self.d_reclen.hash(state); ++ self.d_type.hash(state); ++ self.d_name.hash(state); ++ } ++ } ++ ++ impl PartialEq for sockaddr_un { ++ fn eq(&self, other: &sockaddr_un) -> bool { ++ self.sun_family == other.sun_family ++ && self ++ .sun_path ++ .iter() ++ .zip(other.sun_path.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ ++ impl Eq for sockaddr_un {} ++ ++ impl fmt::Debug for sockaddr_un { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sockaddr_un") ++ .field("sun_family", &self.sun_family) ++ // FIXME: .field("sun_path", &self.sun_path) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for sockaddr_un { ++ fn hash(&self, state: &mut H) { ++ self.sun_family.hash(state); ++ self.sun_path.hash(state); ++ } ++ } ++ ++ impl PartialEq for sockaddr_storage { ++ fn eq(&self, other: &sockaddr_storage) -> bool { ++ self.ss_family == other.ss_family ++ && self.__ss_align == self.__ss_align ++ && self ++ .__ss_padding ++ .iter() ++ .zip(other.__ss_padding.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ ++ impl Eq for sockaddr_storage {} ++ ++ impl fmt::Debug for sockaddr_storage { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sockaddr_storage") ++ .field("ss_family", &self.ss_family) ++ .field("__ss_align", &self.__ss_align) ++ // FIXME: .field("__ss_padding", &self.__ss_padding) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for sockaddr_storage { ++ fn hash(&self, state: &mut H) { ++ self.ss_family.hash(state); ++ self.__ss_padding.hash(state); ++ self.__ss_align.hash(state); ++ } ++ } ++ ++ impl PartialEq for utsname { ++ fn eq(&self, other: &utsname) -> bool { ++ self.sysname ++ .iter() ++ .zip(other.sysname.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .nodename ++ .iter() ++ .zip(other.nodename.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .release ++ .iter() ++ .zip(other.release.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .version ++ .iter() ++ .zip(other.version.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .machine ++ .iter() ++ .zip(other.machine.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .domainname ++ .iter() ++ .zip(other.domainname.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ ++ impl Eq for utsname {} ++ ++ impl fmt::Debug for utsname { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("utsname") ++ // FIXME: .field("sysname", &self.sysname) ++ // FIXME: .field("nodename", &self.nodename) ++ // FIXME: .field("release", &self.release) ++ // FIXME: .field("version", &self.version) ++ // FIXME: .field("machine", &self.machine) ++ // FIXME: .field("domainname", &self.domainname) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for utsname { ++ fn hash(&self, state: &mut H) { ++ self.sysname.hash(state); ++ self.nodename.hash(state); ++ self.release.hash(state); ++ self.version.hash(state); ++ self.machine.hash(state); ++ self.domainname.hash(state); ++ } ++ } ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/solarish/compat.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/solarish/compat.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/solarish/compat.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/solarish/compat.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,215 @@ ++// Common functions that are unfortunately missing on illumos and ++// Solaris, but often needed by other crates. ++use core::cmp::min; ++ ++use crate::unix::solarish::*; ++use crate::{c_char, c_int, size_t}; ++ ++const PTEM: &[u8] = b"ptem\0"; ++const LDTERM: &[u8] = b"ldterm\0"; ++ ++pub unsafe fn cfmakeraw(termios: *mut crate::termios) { ++ (*termios).c_iflag &= ++ !(IMAXBEL | IGNBRK | BRKINT | PARMRK | ISTRIP | INLCR | IGNCR | ICRNL | IXON); ++ (*termios).c_oflag &= !OPOST; ++ (*termios).c_lflag &= !(ECHO | ECHONL | ICANON | ISIG | IEXTEN); ++ (*termios).c_cflag &= !(CSIZE | PARENB); ++ (*termios).c_cflag |= CS8; ++ ++ // By default, most software expects a pending read to block until at ++ // least one byte becomes available. As per termio(7I), this requires ++ // setting the MIN and TIME parameters appropriately. ++ // ++ // As a somewhat unfortunate artefact of history, the MIN and TIME slots ++ // in the control character array overlap with the EOF and EOL slots used ++ // for canonical mode processing. Because the EOF character needs to be ++ // the ASCII EOT value (aka Control-D), it has the byte value 4. When ++ // switching to raw mode, this is interpreted as a MIN value of 4; i.e., ++ // reads will block until at least four bytes have been input. ++ // ++ // Other platforms with a distinct MIN slot like Linux and FreeBSD appear ++ // to default to a MIN value of 1, so we'll force that value here: ++ (*termios).c_cc[VMIN] = 1; ++ (*termios).c_cc[VTIME] = 0; ++} ++ ++pub unsafe fn cfsetspeed(termios: *mut crate::termios, speed: crate::speed_t) -> c_int { ++ // Neither of these functions on illumos or Solaris actually ever ++ // return an error ++ crate::cfsetispeed(termios, speed); ++ crate::cfsetospeed(termios, speed); ++ 0 ++} ++ ++unsafe fn bail(fdm: c_int, fds: c_int) -> c_int { ++ let e = *___errno(); ++ if fds >= 0 { ++ crate::close(fds); ++ } ++ if fdm >= 0 { ++ crate::close(fdm); ++ } ++ *___errno() = e; ++ return -1; ++} ++ ++pub unsafe fn openpty( ++ amain: *mut c_int, ++ asubord: *mut c_int, ++ name: *mut c_char, ++ termp: *const termios, ++ winp: *const crate::winsize, ++) -> c_int { ++ // Open the main pseudo-terminal device, making sure not to set it as the ++ // controlling terminal for this process: ++ let fdm = crate::posix_openpt(O_RDWR | O_NOCTTY); ++ if fdm < 0 { ++ return -1; ++ } ++ ++ // Set permissions and ownership on the subordinate device and unlock it: ++ if crate::grantpt(fdm) < 0 || crate::unlockpt(fdm) < 0 { ++ return bail(fdm, -1); ++ } ++ ++ // Get the path name of the subordinate device: ++ let subordpath = crate::ptsname(fdm); ++ if subordpath.is_null() { ++ return bail(fdm, -1); ++ } ++ ++ // Open the subordinate device without setting it as the controlling ++ // terminal for this process: ++ let fds = crate::open(subordpath, O_RDWR | O_NOCTTY); ++ if fds < 0 { ++ return bail(fdm, -1); ++ } ++ ++ // Check if the STREAMS modules are already pushed: ++ let setup = crate::ioctl(fds, I_FIND, LDTERM.as_ptr()); ++ if setup < 0 { ++ return bail(fdm, fds); ++ } else if setup == 0 { ++ // The line discipline is not present, so push the appropriate STREAMS ++ // modules for the subordinate device: ++ if crate::ioctl(fds, I_PUSH, PTEM.as_ptr()) < 0 ++ || crate::ioctl(fds, I_PUSH, LDTERM.as_ptr()) < 0 ++ { ++ return bail(fdm, fds); ++ } ++ } ++ ++ // If provided, set the terminal parameters: ++ if !termp.is_null() && crate::tcsetattr(fds, TCSAFLUSH, termp) != 0 { ++ return bail(fdm, fds); ++ } ++ ++ // If provided, set the window size: ++ if !winp.is_null() && crate::ioctl(fds, TIOCSWINSZ, winp) < 0 { ++ return bail(fdm, fds); ++ } ++ ++ // If the caller wants the name of the subordinate device, copy it out. ++ // ++ // Note that this is a terrible interface: there appears to be no standard ++ // upper bound on the copy length for this pointer. Nobody should pass ++ // anything but NULL here, preferring instead to use ptsname(3C) directly. ++ if !name.is_null() { ++ crate::strcpy(name, subordpath); ++ } ++ ++ *amain = fdm; ++ *asubord = fds; ++ 0 ++} ++ ++pub unsafe fn forkpty( ++ amain: *mut c_int, ++ name: *mut c_char, ++ termp: *const termios, ++ winp: *const crate::winsize, ++) -> crate::pid_t { ++ let mut fds = -1; ++ ++ if openpty(amain, &mut fds, name, termp, winp) != 0 { ++ return -1; ++ } ++ ++ let pid = crate::fork(); ++ if pid < 0 { ++ return bail(*amain, fds); ++ } else if pid > 0 { ++ // In the parent process, we close the subordinate device and return the ++ // process ID of the new child: ++ crate::close(fds); ++ return pid; ++ } ++ ++ // The rest of this function executes in the child process. ++ ++ // Close the main side of the pseudo-terminal pair: ++ crate::close(*amain); ++ ++ // Use TIOCSCTTY to set the subordinate device as our controlling ++ // terminal. This will fail (with ENOTTY) if we are not the leader in ++ // our own session, so we call setsid() first. Finally, arrange for ++ // the pseudo-terminal to occupy the standard I/O descriptors. ++ if crate::setsid() < 0 ++ || crate::ioctl(fds, TIOCSCTTY, 0) < 0 ++ || crate::dup2(fds, 0) < 0 ++ || crate::dup2(fds, 1) < 0 ++ || crate::dup2(fds, 2) < 0 ++ { ++ // At this stage there are no particularly good ways to handle failure. ++ // Exit as abruptly as possible, using _exit() to avoid messing with any ++ // state still shared with the parent process. ++ crate::_exit(EXIT_FAILURE); ++ } ++ // Close the inherited descriptor, taking care to avoid closing the standard ++ // descriptors by mistake: ++ if fds > 2 { ++ crate::close(fds); ++ } ++ ++ 0 ++} ++ ++pub unsafe fn getpwent_r( ++ pwd: *mut passwd, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut passwd, ++) -> c_int { ++ let old_errno = *crate::___errno(); ++ *crate::___errno() = 0; ++ *result = native_getpwent_r(pwd, buf, min(buflen, c_int::max_value() as size_t) as c_int); ++ ++ let ret = if (*result).is_null() { ++ *crate::___errno() ++ } else { ++ 0 ++ }; ++ *crate::___errno() = old_errno; ++ ++ ret ++} ++ ++pub unsafe fn getgrent_r( ++ grp: *mut crate::group, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut crate::group, ++) -> c_int { ++ let old_errno = *crate::___errno(); ++ *crate::___errno() = 0; ++ *result = native_getgrent_r(grp, buf, min(buflen, c_int::max_value() as size_t) as c_int); ++ ++ let ret = if (*result).is_null() { ++ *crate::___errno() ++ } else { ++ 0 ++ }; ++ *crate::___errno() = old_errno; ++ ++ ret ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/solarish/illumos.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/solarish/illumos.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/solarish/illumos.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/solarish/illumos.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,349 @@ ++use crate::prelude::*; ++use crate::{ ++ exit_status, off_t, NET_MAC_AWARE, NET_MAC_AWARE_INHERIT, PRIV_AWARE_RESET, PRIV_DEBUG, ++ PRIV_PFEXEC, PRIV_XPOLICY, ++}; ++ ++pub type lgrp_rsrc_t = c_int; ++pub type lgrp_affinity_t = c_int; ++ ++s! { ++ pub struct aiocb { ++ pub aio_fildes: c_int, ++ pub aio_buf: *mut c_void, ++ pub aio_nbytes: size_t, ++ pub aio_offset: off_t, ++ pub aio_reqprio: c_int, ++ pub aio_sigevent: crate::sigevent, ++ pub aio_lio_opcode: c_int, ++ pub aio_resultp: crate::aio_result_t, ++ pub aio_state: c_int, ++ pub aio__pad: [c_int; 1], ++ } ++ ++ pub struct shmid_ds { ++ pub shm_perm: crate::ipc_perm, ++ pub shm_segsz: size_t, ++ pub shm_amp: *mut c_void, ++ pub shm_lkcnt: c_ushort, ++ pub shm_lpid: crate::pid_t, ++ pub shm_cpid: crate::pid_t, ++ pub shm_nattch: crate::shmatt_t, ++ pub shm_cnattch: c_ulong, ++ pub shm_atime: crate::time_t, ++ pub shm_dtime: crate::time_t, ++ pub shm_ctime: crate::time_t, ++ pub shm_pad4: [i64; 4], ++ } ++ ++ pub struct fil_info { ++ pub fi_flags: c_int, ++ pub fi_pos: c_int, ++ pub fi_name: [c_char; crate::FILNAME_MAX as usize], ++ } ++} ++ ++s_no_extra_traits! { ++ #[cfg_attr(any(target_arch = "x86", target_arch = "x86_64"), repr(packed(4)))] ++ pub struct epoll_event { ++ pub events: u32, ++ pub u64: u64, ++ } ++ ++ pub struct utmpx { ++ pub ut_user: [c_char; _UTX_USERSIZE], ++ pub ut_id: [c_char; _UTX_IDSIZE], ++ pub ut_line: [c_char; _UTX_LINESIZE], ++ pub ut_pid: crate::pid_t, ++ pub ut_type: c_short, ++ pub ut_exit: exit_status, ++ pub ut_tv: crate::timeval, ++ pub ut_session: c_int, ++ pub ut_pad: [c_int; _UTX_PADSIZE], ++ pub ut_syslen: c_short, ++ pub ut_host: [c_char; _UTX_HOSTSIZE], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for utmpx { ++ fn eq(&self, other: &utmpx) -> bool { ++ self.ut_type == other.ut_type ++ && self.ut_pid == other.ut_pid ++ && self.ut_user == other.ut_user ++ && self.ut_line == other.ut_line ++ && self.ut_id == other.ut_id ++ && self.ut_exit == other.ut_exit ++ && self.ut_session == other.ut_session ++ && self.ut_tv == other.ut_tv ++ && self.ut_syslen == other.ut_syslen ++ && self.ut_pad == other.ut_pad ++ && self ++ .ut_host ++ .iter() ++ .zip(other.ut_host.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ ++ impl Eq for utmpx {} ++ ++ impl fmt::Debug for utmpx { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("utmpx") ++ .field("ut_user", &self.ut_user) ++ .field("ut_id", &self.ut_id) ++ .field("ut_line", &self.ut_line) ++ .field("ut_pid", &self.ut_pid) ++ .field("ut_type", &self.ut_type) ++ .field("ut_exit", &self.ut_exit) ++ .field("ut_tv", &self.ut_tv) ++ .field("ut_session", &self.ut_session) ++ .field("ut_pad", &self.ut_pad) ++ .field("ut_syslen", &self.ut_syslen) ++ .field("ut_host", &&self.ut_host[..]) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for utmpx { ++ fn hash(&self, state: &mut H) { ++ self.ut_user.hash(state); ++ self.ut_type.hash(state); ++ self.ut_pid.hash(state); ++ self.ut_line.hash(state); ++ self.ut_id.hash(state); ++ self.ut_host.hash(state); ++ self.ut_exit.hash(state); ++ self.ut_session.hash(state); ++ self.ut_tv.hash(state); ++ self.ut_syslen.hash(state); ++ self.ut_pad.hash(state); ++ } ++ } ++ ++ impl PartialEq for epoll_event { ++ fn eq(&self, other: &epoll_event) -> bool { ++ self.events == other.events && self.u64 == other.u64 ++ } ++ } ++ impl Eq for epoll_event {} ++ impl fmt::Debug for epoll_event { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ let events = self.events; ++ let u64 = self.u64; ++ f.debug_struct("epoll_event") ++ .field("events", &events) ++ .field("u64", &u64) ++ .finish() ++ } ++ } ++ impl hash::Hash for epoll_event { ++ fn hash(&self, state: &mut H) { ++ let events = self.events; ++ let u64 = self.u64; ++ events.hash(state); ++ u64.hash(state); ++ } ++ } ++ } ++} ++ ++pub const _UTX_USERSIZE: usize = 32; ++pub const _UTX_LINESIZE: usize = 32; ++pub const _UTX_PADSIZE: usize = 5; ++pub const _UTX_IDSIZE: usize = 4; ++pub const _UTX_HOSTSIZE: usize = 257; ++ ++pub const AF_LOCAL: c_int = 1; // AF_UNIX ++pub const AF_FILE: c_int = 1; // AF_UNIX ++ ++pub const EFD_SEMAPHORE: c_int = 0x1; ++pub const EFD_NONBLOCK: c_int = 0x800; ++pub const EFD_CLOEXEC: c_int = 0x80000; ++ ++pub const POLLRDHUP: c_short = 0x4000; ++ ++pub const TCP_KEEPIDLE: c_int = 34; ++pub const TCP_KEEPCNT: c_int = 35; ++pub const TCP_KEEPINTVL: c_int = 36; ++pub const TCP_CONGESTION: c_int = 37; ++ ++// These constants are correct for 64-bit programs or 32-bit programs that are ++// not using large-file mode. If Rust ever supports anything other than 64-bit ++// compilation on illumos, this may require adjustment: ++pub const F_OFD_GETLK: c_int = 47; ++pub const F_OFD_SETLK: c_int = 48; ++pub const F_OFD_SETLKW: c_int = 49; ++pub const F_FLOCK: c_int = 53; ++pub const F_FLOCKW: c_int = 54; ++ ++pub const F_DUPFD_CLOEXEC: c_int = 37; ++pub const F_DUPFD_CLOFORK: c_int = 58; ++pub const F_DUP2FD_CLOEXEC: c_int = 36; ++pub const F_DUP2FD_CLOFORK: c_int = 57; ++pub const F_DUP3FD: c_int = 59; ++ ++pub const FD_CLOFORK: c_int = 2; ++ ++pub const FIL_ATTACH: c_int = 0x1; ++pub const FIL_DETACH: c_int = 0x2; ++pub const FIL_LIST: c_int = 0x3; ++pub const FILNAME_MAX: c_int = 32; ++pub const FILF_PROG: c_int = 0x1; ++pub const FILF_AUTO: c_int = 0x2; ++pub const FILF_BYPASS: c_int = 0x4; ++pub const SOL_FILTER: c_int = 0xfffc; ++ ++pub const MADV_PURGE: c_int = 9; ++ ++pub const POSIX_FADV_NORMAL: c_int = 0; ++pub const POSIX_FADV_RANDOM: c_int = 1; ++pub const POSIX_FADV_SEQUENTIAL: c_int = 2; ++pub const POSIX_FADV_WILLNEED: c_int = 3; ++pub const POSIX_FADV_DONTNEED: c_int = 4; ++pub const POSIX_FADV_NOREUSE: c_int = 5; ++ ++pub const SIGINFO: c_int = 41; ++ ++pub const O_DIRECT: c_int = 0x2000000; ++pub const O_CLOFORK: c_int = 0x4000000; ++ ++pub const MSG_CMSG_CLOEXEC: c_int = 0x1000; ++pub const MSG_CMSG_CLOFORK: c_int = 0x2000; ++ ++pub const PBIND_HARD: crate::processorid_t = -3; ++pub const PBIND_SOFT: crate::processorid_t = -4; ++ ++pub const PS_SYSTEM: c_int = 1; ++ ++pub const MAP_FILE: c_int = 0; ++ ++pub const MAP_32BIT: c_int = 0x80; ++ ++pub const AF_NCA: c_int = 28; ++ ++pub const PF_NCA: c_int = AF_NCA; ++ ++pub const LOCK_SH: c_int = 1; ++pub const LOCK_EX: c_int = 2; ++pub const LOCK_NB: c_int = 4; ++pub const LOCK_UN: c_int = 8; ++ ++pub const _PC_LAST: c_int = 101; ++ ++pub const VSTATUS: usize = 16; ++pub const VERASE2: usize = 17; ++ ++pub const EPOLLIN: c_int = 0x1; ++pub const EPOLLPRI: c_int = 0x2; ++pub const EPOLLOUT: c_int = 0x4; ++pub const EPOLLRDNORM: c_int = 0x40; ++pub const EPOLLRDBAND: c_int = 0x80; ++pub const EPOLLWRNORM: c_int = 0x100; ++pub const EPOLLWRBAND: c_int = 0x200; ++pub const EPOLLMSG: c_int = 0x400; ++pub const EPOLLERR: c_int = 0x8; ++pub const EPOLLHUP: c_int = 0x10; ++pub const EPOLLET: c_int = 0x80000000; ++pub const EPOLLRDHUP: c_int = 0x2000; ++pub const EPOLLONESHOT: c_int = 0x40000000; ++pub const EPOLLWAKEUP: c_int = 0x20000000; ++pub const EPOLLEXCLUSIVE: c_int = 0x10000000; ++pub const EPOLL_CLOEXEC: c_int = 0x80000; ++pub const EPOLL_CTL_ADD: c_int = 1; ++pub const EPOLL_CTL_MOD: c_int = 3; ++pub const EPOLL_CTL_DEL: c_int = 2; ++ ++pub const PRIV_USER: c_uint = PRIV_DEBUG ++ | NET_MAC_AWARE ++ | NET_MAC_AWARE_INHERIT ++ | PRIV_XPOLICY ++ | PRIV_AWARE_RESET ++ | PRIV_PFEXEC; ++ ++pub const LGRP_RSRC_COUNT: crate::lgrp_rsrc_t = 2; ++pub const LGRP_RSRC_CPU: crate::lgrp_rsrc_t = 0; ++pub const LGRP_RSRC_MEM: crate::lgrp_rsrc_t = 1; ++ ++pub const P_DISABLED: c_int = 0x008; ++ ++pub const AT_SUN_HWCAP2: c_uint = 2023; ++pub const AT_SUN_FPTYPE: c_uint = 2027; ++ ++pub const B1000000: crate::speed_t = 24; ++pub const B1152000: crate::speed_t = 25; ++pub const B1500000: crate::speed_t = 26; ++pub const B2000000: crate::speed_t = 27; ++pub const B2500000: crate::speed_t = 28; ++pub const B3000000: crate::speed_t = 29; ++pub const B3500000: crate::speed_t = 30; ++pub const B4000000: crate::speed_t = 31; ++ ++// sys/systeminfo.h ++pub const SI_ADDRESS_WIDTH: c_int = 520; ++ ++extern "C" { ++ pub fn eventfd(init: c_uint, flags: c_int) -> c_int; ++ ++ pub fn epoll_pwait( ++ epfd: c_int, ++ events: *mut crate::epoll_event, ++ maxevents: c_int, ++ timeout: c_int, ++ sigmask: *const crate::sigset_t, ++ ) -> c_int; ++ pub fn epoll_create(size: c_int) -> c_int; ++ pub fn epoll_create1(flags: c_int) -> c_int; ++ pub fn epoll_wait( ++ epfd: c_int, ++ events: *mut crate::epoll_event, ++ maxevents: c_int, ++ timeout: c_int, ++ ) -> c_int; ++ pub fn epoll_ctl(epfd: c_int, op: c_int, fd: c_int, event: *mut crate::epoll_event) -> c_int; ++ ++ pub fn mincore(addr: crate::caddr_t, len: size_t, vec: *mut c_char) -> c_int; ++ ++ pub fn pset_bind_lwp( ++ pset: crate::psetid_t, ++ id: crate::id_t, ++ pid: crate::pid_t, ++ opset: *mut crate::psetid_t, ++ ) -> c_int; ++ pub fn pset_getloadavg(pset: crate::psetid_t, load: *mut c_double, num: c_int) -> c_int; ++ ++ pub fn pthread_attr_get_np(thread: crate::pthread_t, attr: *mut crate::pthread_attr_t) ++ -> c_int; ++ pub fn pthread_attr_getstackaddr( ++ attr: *const crate::pthread_attr_t, ++ stackaddr: *mut *mut c_void, ++ ) -> c_int; ++ pub fn pthread_attr_setstack( ++ attr: *mut crate::pthread_attr_t, ++ stackaddr: *mut c_void, ++ stacksize: size_t, ++ ) -> c_int; ++ pub fn pthread_attr_setstackaddr( ++ attr: *mut crate::pthread_attr_t, ++ stackaddr: *mut c_void, ++ ) -> c_int; ++ ++ pub fn posix_fadvise(fd: c_int, offset: off_t, len: off_t, advice: c_int) -> c_int; ++ pub fn preadv(fd: c_int, iov: *const crate::iovec, iovcnt: c_int, offset: off_t) -> ssize_t; ++ pub fn pwritev(fd: c_int, iov: *const crate::iovec, iovcnt: c_int, offset: off_t) -> ssize_t; ++ pub fn getpagesizes2(pagesize: *mut size_t, nelem: c_int) -> c_int; ++ ++ pub fn ptsname_r(fildes: c_int, name: *mut c_char, namelen: size_t) -> c_int; ++ ++ pub fn syncfs(fd: c_int) -> c_int; ++ ++ pub fn strcasecmp_l(s1: *const c_char, s2: *const c_char, loc: crate::locale_t) -> c_int; ++ pub fn strncasecmp_l( ++ s1: *const c_char, ++ s2: *const c_char, ++ n: size_t, ++ loc: crate::locale_t, ++ ) -> c_int; ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/solarish/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/solarish/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/solarish/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/solarish/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,3185 @@ ++use core::mem::size_of; ++ ++pub use crate::arch::c_char_def as c_char; ++use crate::prelude::*; ++ ++pub type c_long = i64; ++pub type c_ulong = u64; ++pub type caddr_t = *mut c_char; ++ ++pub type clockid_t = c_int; ++pub type blkcnt_t = c_long; ++pub type clock_t = c_long; ++pub type daddr_t = c_long; ++pub type dev_t = c_ulong; ++pub type fsblkcnt_t = c_ulong; ++pub type fsfilcnt_t = c_ulong; ++pub type ino_t = c_ulong; ++pub type key_t = c_int; ++pub type major_t = c_uint; ++pub type minor_t = c_uint; ++pub type mode_t = c_uint; ++pub type nlink_t = c_uint; ++pub type rlim_t = c_ulong; ++pub type speed_t = c_uint; ++pub type tcflag_t = c_uint; ++pub type time_t = c_long; ++pub type timer_t = c_int; ++pub type wchar_t = c_int; ++pub type nfds_t = c_ulong; ++pub type projid_t = c_int; ++pub type zoneid_t = c_int; ++pub type psetid_t = c_int; ++pub type processorid_t = c_int; ++pub type chipid_t = c_int; ++pub type ctid_t = crate::id_t; ++ ++pub type suseconds_t = c_long; ++pub type off_t = c_long; ++pub type useconds_t = c_uint; ++pub type socklen_t = c_uint; ++pub type sa_family_t = u16; ++pub type pthread_t = c_uint; ++pub type pthread_key_t = c_uint; ++pub type thread_t = c_uint; ++pub type blksize_t = c_int; ++pub type nl_item = c_int; ++pub type mqd_t = *mut c_void; ++pub type id_t = c_int; ++pub type idtype_t = c_uint; ++pub type shmatt_t = c_ulong; ++ ++pub type lgrp_id_t = crate::id_t; ++pub type lgrp_mem_size_t = c_longlong; ++pub type lgrp_cookie_t = crate::uintptr_t; ++pub type lgrp_content_t = c_uint; ++pub type lgrp_lat_between_t = c_uint; ++pub type lgrp_mem_size_flag_t = c_uint; ++pub type lgrp_view_t = c_uint; ++ ++#[cfg_attr(feature = "extra_traits", derive(Debug))] ++pub enum timezone {} ++impl Copy for timezone {} ++impl Clone for timezone { ++ fn clone(&self) -> timezone { ++ *self ++ } ++} ++ ++#[cfg_attr(feature = "extra_traits", derive(Debug))] ++pub enum ucred_t {} ++impl Copy for ucred_t {} ++impl Clone for ucred_t { ++ fn clone(&self) -> ucred_t { ++ *self ++ } ++} ++ ++s! { ++ pub struct in_addr { ++ pub s_addr: crate::in_addr_t, ++ } ++ ++ pub struct ip_mreq { ++ pub imr_multiaddr: in_addr, ++ pub imr_interface: in_addr, ++ } ++ ++ pub struct ip_mreq_source { ++ pub imr_multiaddr: in_addr, ++ pub imr_sourceaddr: in_addr, ++ pub imr_interface: in_addr, ++ } ++ ++ pub struct ipc_perm { ++ pub uid: crate::uid_t, ++ pub gid: crate::gid_t, ++ pub cuid: crate::uid_t, ++ pub cgid: crate::gid_t, ++ pub mode: crate::mode_t, ++ pub seq: c_uint, ++ pub key: crate::key_t, ++ } ++ ++ pub struct sockaddr { ++ pub sa_family: sa_family_t, ++ pub sa_data: [c_char; 14], ++ } ++ ++ pub struct sockaddr_in { ++ pub sin_family: sa_family_t, ++ pub sin_port: crate::in_port_t, ++ pub sin_addr: crate::in_addr, ++ pub sin_zero: [c_char; 8], ++ } ++ ++ pub struct sockaddr_in6 { ++ pub sin6_family: sa_family_t, ++ pub sin6_port: crate::in_port_t, ++ pub sin6_flowinfo: u32, ++ pub sin6_addr: crate::in6_addr, ++ pub sin6_scope_id: u32, ++ pub __sin6_src_id: u32, ++ } ++ ++ pub struct in_pktinfo { ++ pub ipi_ifindex: c_uint, ++ pub ipi_spec_dst: crate::in_addr, ++ pub ipi_addr: crate::in_addr, ++ } ++ ++ pub struct in6_pktinfo { ++ pub ipi6_addr: crate::in6_addr, ++ pub ipi6_ifindex: c_uint, ++ } ++ ++ pub struct passwd { ++ pub pw_name: *mut c_char, ++ pub pw_passwd: *mut c_char, ++ pub pw_uid: crate::uid_t, ++ pub pw_gid: crate::gid_t, ++ pub pw_age: *mut c_char, ++ pub pw_comment: *mut c_char, ++ pub pw_gecos: *mut c_char, ++ pub pw_dir: *mut c_char, ++ pub pw_shell: *mut c_char, ++ } ++ ++ pub struct ifaddrs { ++ pub ifa_next: *mut ifaddrs, ++ pub ifa_name: *mut c_char, ++ pub ifa_flags: u64, ++ pub ifa_addr: *mut crate::sockaddr, ++ pub ifa_netmask: *mut crate::sockaddr, ++ pub ifa_dstaddr: *mut crate::sockaddr, ++ pub ifa_data: *mut c_void, ++ } ++ ++ pub struct itimerspec { ++ pub it_interval: crate::timespec, ++ pub it_value: crate::timespec, ++ } ++ ++ pub struct tm { ++ pub tm_sec: c_int, ++ pub tm_min: c_int, ++ pub tm_hour: c_int, ++ pub tm_mday: c_int, ++ pub tm_mon: c_int, ++ pub tm_year: c_int, ++ pub tm_wday: c_int, ++ pub tm_yday: c_int, ++ pub tm_isdst: c_int, ++ } ++ ++ pub struct msghdr { ++ pub msg_name: *mut c_void, ++ pub msg_namelen: crate::socklen_t, ++ pub msg_iov: *mut crate::iovec, ++ pub msg_iovlen: c_int, ++ pub msg_control: *mut c_void, ++ pub msg_controllen: crate::socklen_t, ++ pub msg_flags: c_int, ++ } ++ ++ pub struct cmsghdr { ++ pub cmsg_len: crate::socklen_t, ++ pub cmsg_level: c_int, ++ pub cmsg_type: c_int, ++ } ++ ++ pub struct pthread_attr_t { ++ __pthread_attrp: *mut c_void, ++ } ++ ++ pub struct pthread_mutex_t { ++ __pthread_mutex_flag1: u16, ++ __pthread_mutex_flag2: u8, ++ __pthread_mutex_ceiling: u8, ++ __pthread_mutex_type: u16, ++ __pthread_mutex_magic: u16, ++ __pthread_mutex_lock: u64, ++ __pthread_mutex_data: u64, ++ } ++ ++ pub struct pthread_mutexattr_t { ++ __pthread_mutexattrp: *mut c_void, ++ } ++ ++ pub struct pthread_cond_t { ++ __pthread_cond_flag: [u8; 4], ++ __pthread_cond_type: u16, ++ __pthread_cond_magic: u16, ++ __pthread_cond_data: u64, ++ } ++ ++ pub struct pthread_condattr_t { ++ __pthread_condattrp: *mut c_void, ++ } ++ ++ pub struct pthread_rwlock_t { ++ __pthread_rwlock_readers: i32, ++ __pthread_rwlock_type: u16, ++ __pthread_rwlock_magic: u16, ++ __pthread_rwlock_mutex: crate::pthread_mutex_t, ++ __pthread_rwlock_readercv: crate::pthread_cond_t, ++ __pthread_rwlock_writercv: crate::pthread_cond_t, ++ } ++ ++ pub struct pthread_rwlockattr_t { ++ __pthread_rwlockattrp: *mut c_void, ++ } ++ ++ pub struct dirent { ++ pub d_ino: crate::ino_t, ++ pub d_off: off_t, ++ pub d_reclen: u16, ++ pub d_name: [c_char; 3], ++ } ++ ++ pub struct glob_t { ++ pub gl_pathc: size_t, ++ pub gl_pathv: *mut *mut c_char, ++ pub gl_offs: size_t, ++ __unused1: *mut c_void, ++ __unused2: c_int, ++ #[cfg(target_os = "illumos")] ++ __unused3: c_int, ++ #[cfg(target_os = "illumos")] ++ __unused4: c_int, ++ #[cfg(target_os = "illumos")] ++ __unused5: *mut c_void, ++ #[cfg(target_os = "illumos")] ++ __unused6: *mut c_void, ++ #[cfg(target_os = "illumos")] ++ __unused7: *mut c_void, ++ #[cfg(target_os = "illumos")] ++ __unused8: *mut c_void, ++ #[cfg(target_os = "illumos")] ++ __unused9: *mut c_void, ++ #[cfg(target_os = "illumos")] ++ __unused10: *mut c_void, ++ } ++ ++ pub struct addrinfo { ++ pub ai_flags: c_int, ++ pub ai_family: c_int, ++ pub ai_socktype: c_int, ++ pub ai_protocol: c_int, ++ #[cfg(target_arch = "sparc64")] ++ __sparcv9_pad: c_int, ++ pub ai_addrlen: crate::socklen_t, ++ pub ai_canonname: *mut c_char, ++ pub ai_addr: *mut crate::sockaddr, ++ pub ai_next: *mut addrinfo, ++ } ++ ++ pub struct sigset_t { ++ bits: [u32; 4], ++ } ++ ++ pub struct sigaction { ++ pub sa_flags: c_int, ++ pub sa_sigaction: crate::sighandler_t, ++ pub sa_mask: sigset_t, ++ } ++ ++ pub struct stack_t { ++ pub ss_sp: *mut c_void, ++ pub ss_size: size_t, ++ pub ss_flags: c_int, ++ } ++ ++ pub struct statvfs { ++ pub f_bsize: c_ulong, ++ pub f_frsize: c_ulong, ++ pub f_blocks: crate::fsblkcnt_t, ++ pub f_bfree: crate::fsblkcnt_t, ++ pub f_bavail: crate::fsblkcnt_t, ++ pub f_files: crate::fsfilcnt_t, ++ pub f_ffree: crate::fsfilcnt_t, ++ pub f_favail: crate::fsfilcnt_t, ++ pub f_fsid: c_ulong, ++ pub f_basetype: [c_char; 16], ++ pub f_flag: c_ulong, ++ pub f_namemax: c_ulong, ++ pub f_fstr: [c_char; 32], ++ } ++ ++ pub struct sendfilevec_t { ++ pub sfv_fd: c_int, ++ pub sfv_flag: c_uint, ++ pub sfv_off: off_t, ++ pub sfv_len: size_t, ++ } ++ ++ pub struct sched_param { ++ pub sched_priority: c_int, ++ sched_pad: [c_int; 8], ++ } ++ ++ pub struct Dl_info { ++ pub dli_fname: *const c_char, ++ pub dli_fbase: *mut c_void, ++ pub dli_sname: *const c_char, ++ pub dli_saddr: *mut c_void, ++ } ++ ++ pub struct stat { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ pub st_size: off_t, ++ pub st_atime: crate::time_t, ++ pub st_atime_nsec: c_long, ++ pub st_mtime: crate::time_t, ++ pub st_mtime_nsec: c_long, ++ pub st_ctime: crate::time_t, ++ pub st_ctime_nsec: c_long, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_fstype: [c_char; _ST_FSTYPSZ as usize], ++ } ++ ++ pub struct termios { ++ pub c_iflag: crate::tcflag_t, ++ pub c_oflag: crate::tcflag_t, ++ pub c_cflag: crate::tcflag_t, ++ pub c_lflag: crate::tcflag_t, ++ pub c_cc: [crate::cc_t; crate::NCCS], ++ } ++ ++ pub struct lconv { ++ pub decimal_point: *mut c_char, ++ pub thousands_sep: *mut c_char, ++ pub grouping: *mut c_char, ++ pub int_curr_symbol: *mut c_char, ++ pub currency_symbol: *mut c_char, ++ pub mon_decimal_point: *mut c_char, ++ pub mon_thousands_sep: *mut c_char, ++ pub mon_grouping: *mut c_char, ++ pub positive_sign: *mut c_char, ++ pub negative_sign: *mut c_char, ++ pub int_frac_digits: c_char, ++ pub frac_digits: c_char, ++ pub p_cs_precedes: c_char, ++ pub p_sep_by_space: c_char, ++ pub n_cs_precedes: c_char, ++ pub n_sep_by_space: c_char, ++ pub p_sign_posn: c_char, ++ pub n_sign_posn: c_char, ++ pub int_p_cs_precedes: c_char, ++ pub int_p_sep_by_space: c_char, ++ pub int_n_cs_precedes: c_char, ++ pub int_n_sep_by_space: c_char, ++ pub int_p_sign_posn: c_char, ++ pub int_n_sign_posn: c_char, ++ } ++ ++ pub struct sem_t { ++ pub sem_count: u32, ++ pub sem_type: u16, ++ pub sem_magic: u16, ++ pub sem_pad1: [u64; 3], ++ pub sem_pad2: [u64; 2], ++ } ++ ++ pub struct flock { ++ pub l_type: c_short, ++ pub l_whence: c_short, ++ pub l_start: off_t, ++ pub l_len: off_t, ++ pub l_sysid: c_int, ++ pub l_pid: crate::pid_t, ++ pub l_pad: [c_long; 4], ++ } ++ ++ pub struct if_nameindex { ++ pub if_index: c_uint, ++ pub if_name: *mut c_char, ++ } ++ ++ pub struct mq_attr { ++ pub mq_flags: c_long, ++ pub mq_maxmsg: c_long, ++ pub mq_msgsize: c_long, ++ pub mq_curmsgs: c_long, ++ _pad: [c_int; 12], ++ } ++ ++ pub struct port_event { ++ pub portev_events: c_int, ++ pub portev_source: c_ushort, ++ pub portev_pad: c_ushort, ++ pub portev_object: crate::uintptr_t, ++ pub portev_user: *mut c_void, ++ } ++ ++ pub struct port_notify { ++ pub portnfy_port: c_int, ++ pub portnfy_user: *mut c_void, ++ } ++ ++ pub struct aio_result_t { ++ pub aio_return: ssize_t, ++ pub aio_errno: c_int, ++ } ++ ++ pub struct exit_status { ++ e_termination: c_short, ++ e_exit: c_short, ++ } ++ ++ pub struct utmp { ++ pub ut_user: [c_char; 8], ++ pub ut_id: [c_char; 4], ++ pub ut_line: [c_char; 12], ++ pub ut_pid: c_short, ++ pub ut_type: c_short, ++ pub ut_exit: exit_status, ++ pub ut_time: crate::time_t, ++ } ++ ++ pub struct timex { ++ pub modes: u32, ++ pub offset: i32, ++ pub freq: i32, ++ pub maxerror: i32, ++ pub esterror: i32, ++ pub status: i32, ++ pub constant: i32, ++ pub precision: i32, ++ pub tolerance: i32, ++ pub ppsfreq: i32, ++ pub jitter: i32, ++ pub shift: i32, ++ pub stabil: i32, ++ pub jitcnt: i32, ++ pub calcnt: i32, ++ pub errcnt: i32, ++ pub stbcnt: i32, ++ } ++ ++ pub struct ntptimeval { ++ pub time: crate::timeval, ++ pub maxerror: i32, ++ pub esterror: i32, ++ } ++ ++ pub struct mmapobj_result_t { ++ pub mr_addr: crate::caddr_t, ++ pub mr_msize: size_t, ++ pub mr_fsize: size_t, ++ pub mr_offset: size_t, ++ pub mr_prot: c_uint, ++ pub mr_flags: c_uint, ++ } ++ ++ pub struct lgrp_affinity_args_t { ++ pub idtype: crate::idtype_t, ++ pub id: crate::id_t, ++ pub lgrp: crate::lgrp_id_t, ++ pub aff: crate::lgrp_affinity_t, ++ } ++ ++ pub struct processor_info_t { ++ pub pi_state: c_int, ++ pub pi_processor_type: [c_char; PI_TYPELEN as usize], ++ pub pi_fputypes: [c_char; PI_FPUTYPE as usize], ++ pub pi_clock: c_int, ++ } ++ ++ pub struct option { ++ pub name: *const c_char, ++ pub has_arg: c_int, ++ pub flag: *mut c_int, ++ pub val: c_int, ++ } ++} ++ ++s_no_extra_traits! { ++ pub struct sockaddr_un { ++ pub sun_family: sa_family_t, ++ pub sun_path: [c_char; 108], ++ } ++ ++ pub struct utsname { ++ pub sysname: [c_char; 257], ++ pub nodename: [c_char; 257], ++ pub release: [c_char; 257], ++ pub version: [c_char; 257], ++ pub machine: [c_char; 257], ++ } ++ ++ pub struct fd_set { ++ #[cfg(target_pointer_width = "64")] ++ fds_bits: [i64; FD_SETSIZE as usize / 64], ++ #[cfg(target_pointer_width = "32")] ++ fds_bits: [i32; FD_SETSIZE as usize / 32], ++ } ++ ++ pub struct sockaddr_storage { ++ pub ss_family: crate::sa_family_t, ++ __ss_pad1: [u8; 6], ++ __ss_align: i64, ++ __ss_pad2: [u8; 240], ++ } ++ ++ #[cfg_attr(target_pointer_width = "64", repr(align(8)))] ++ pub struct siginfo_t { ++ pub si_signo: c_int, ++ pub si_code: c_int, ++ pub si_errno: c_int, ++ #[cfg(target_pointer_width = "64")] ++ pub si_pad: c_int, ++ ++ __data_pad: [c_int; SIGINFO_DATA_SIZE], ++ } ++ ++ pub struct sockaddr_dl { ++ pub sdl_family: c_ushort, ++ pub sdl_index: c_ushort, ++ pub sdl_type: c_uchar, ++ pub sdl_nlen: c_uchar, ++ pub sdl_alen: c_uchar, ++ pub sdl_slen: c_uchar, ++ pub sdl_data: [c_char; 244], ++ } ++ ++ pub struct sigevent { ++ pub sigev_notify: c_int, ++ pub sigev_signo: c_int, ++ pub sigev_value: crate::sigval, ++ pub ss_sp: *mut c_void, ++ pub sigev_notify_attributes: *const crate::pthread_attr_t, ++ __sigev_pad2: c_int, ++ } ++ ++ #[repr(align(16))] ++ pub union pad128_t { ++ // pub _q in this structure would be a "long double", of 16 bytes ++ pub _l: [i32; 4], ++ } ++ ++ #[repr(align(16))] ++ pub union upad128_t { ++ // pub _q in this structure would be a "long double", of 16 bytes ++ pub _l: [u32; 4], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for sockaddr_un { ++ fn eq(&self, other: &sockaddr_un) -> bool { ++ self.sun_family == other.sun_family ++ && self ++ .sun_path ++ .iter() ++ .zip(other.sun_path.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for sockaddr_un {} ++ impl fmt::Debug for sockaddr_un { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sockaddr_un") ++ .field("sun_family", &self.sun_family) ++ // FIXME: .field("sun_path", &self.sun_path) ++ .finish() ++ } ++ } ++ impl hash::Hash for sockaddr_un { ++ fn hash(&self, state: &mut H) { ++ self.sun_family.hash(state); ++ self.sun_path.hash(state); ++ } ++ } ++ ++ impl PartialEq for utsname { ++ fn eq(&self, other: &utsname) -> bool { ++ self.sysname ++ .iter() ++ .zip(other.sysname.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .nodename ++ .iter() ++ .zip(other.nodename.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .release ++ .iter() ++ .zip(other.release.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .version ++ .iter() ++ .zip(other.version.iter()) ++ .all(|(a, b)| a == b) ++ && self ++ .machine ++ .iter() ++ .zip(other.machine.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for utsname {} ++ impl fmt::Debug for utsname { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("utsname") ++ // FIXME: .field("sysname", &self.sysname) ++ // FIXME: .field("nodename", &self.nodename) ++ // FIXME: .field("release", &self.release) ++ // FIXME: .field("version", &self.version) ++ // FIXME: .field("machine", &self.machine) ++ .finish() ++ } ++ } ++ impl hash::Hash for utsname { ++ fn hash(&self, state: &mut H) { ++ self.sysname.hash(state); ++ self.nodename.hash(state); ++ self.release.hash(state); ++ self.version.hash(state); ++ self.machine.hash(state); ++ } ++ } ++ ++ impl PartialEq for fd_set { ++ fn eq(&self, other: &fd_set) -> bool { ++ self.fds_bits ++ .iter() ++ .zip(other.fds_bits.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for fd_set {} ++ impl fmt::Debug for fd_set { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("fd_set") ++ // FIXME: .field("fds_bits", &self.fds_bits) ++ .finish() ++ } ++ } ++ impl hash::Hash for fd_set { ++ fn hash(&self, state: &mut H) { ++ self.fds_bits.hash(state); ++ } ++ } ++ ++ impl PartialEq for sockaddr_storage { ++ fn eq(&self, other: &sockaddr_storage) -> bool { ++ self.ss_family == other.ss_family ++ && self.__ss_pad1 == other.__ss_pad1 ++ && self.__ss_align == other.__ss_align ++ && self ++ .__ss_pad2 ++ .iter() ++ .zip(other.__ss_pad2.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for sockaddr_storage {} ++ impl fmt::Debug for sockaddr_storage { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sockaddr_storage") ++ .field("ss_family", &self.ss_family) ++ .field("__ss_pad1", &self.__ss_pad1) ++ .field("__ss_align", &self.__ss_align) ++ // FIXME: .field("__ss_pad2", &self.__ss_pad2) ++ .finish() ++ } ++ } ++ impl hash::Hash for sockaddr_storage { ++ fn hash(&self, state: &mut H) { ++ self.ss_family.hash(state); ++ self.__ss_pad1.hash(state); ++ self.__ss_align.hash(state); ++ self.__ss_pad2.hash(state); ++ } ++ } ++ ++ impl siginfo_t { ++ /// The siginfo_t will have differing contents based on the delivered signal. Based on ++ /// `si_signo`, this determines how many of the `c_int` pad fields contain valid data ++ /// exposed by the C unions. ++ /// ++ /// It is not yet exhausitive for the OS-defined types, and defaults to assuming the ++ /// entire data pad area is "valid" for otherwise unrecognized signal numbers. ++ fn data_field_count(&self) -> usize { ++ match self.si_signo { ++ SIGSEGV | SIGBUS | SIGILL | SIGTRAP | SIGFPE => { ++ size_of::() / size_of::() ++ } ++ SIGCLD => size_of::() / size_of::(), ++ SIGHUP ++ | SIGINT ++ | SIGQUIT ++ | SIGABRT ++ | SIGSYS ++ | SIGPIPE ++ | SIGALRM ++ | SIGTERM ++ | crate::SIGUSR1 ++ | crate::SIGUSR2 ++ | SIGPWR ++ | SIGWINCH ++ | SIGURG => size_of::() / size_of::(), ++ _ => SIGINFO_DATA_SIZE, ++ } ++ } ++ } ++ impl PartialEq for siginfo_t { ++ fn eq(&self, other: &siginfo_t) -> bool { ++ if self.si_signo == other.si_signo ++ && self.si_code == other.si_code ++ && self.si_errno == other.si_errno ++ { ++ // FIXME: The `si_pad` field in the 64-bit version of the struct is ignored ++ // (for now) when doing comparisons. ++ ++ let field_count = self.data_field_count(); ++ self.__data_pad[..field_count] ++ .iter() ++ .zip(other.__data_pad[..field_count].iter()) ++ .all(|(a, b)| a == b) ++ } else { ++ false ++ } ++ } ++ } ++ impl Eq for siginfo_t {} ++ impl fmt::Debug for siginfo_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("siginfo_t") ++ .field("si_signo", &self.si_signo) ++ .field("si_code", &self.si_code) ++ .field("si_errno", &self.si_errno) ++ // FIXME: .field("__pad", &self.__pad) ++ .finish() ++ } ++ } ++ impl hash::Hash for siginfo_t { ++ fn hash(&self, state: &mut H) { ++ self.si_signo.hash(state); ++ self.si_code.hash(state); ++ self.si_errno.hash(state); ++ ++ // FIXME: The `si_pad` field in the 64-bit version of the struct is ignored ++ // (for now) when doing hashing. ++ ++ let field_count = self.data_field_count(); ++ self.__data_pad[..field_count].hash(state) ++ } ++ } ++ ++ impl PartialEq for sockaddr_dl { ++ fn eq(&self, other: &sockaddr_dl) -> bool { ++ self.sdl_family == other.sdl_family ++ && self.sdl_index == other.sdl_index ++ && self.sdl_type == other.sdl_type ++ && self.sdl_nlen == other.sdl_nlen ++ && self.sdl_alen == other.sdl_alen ++ && self.sdl_slen == other.sdl_slen ++ && self ++ .sdl_data ++ .iter() ++ .zip(other.sdl_data.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ impl Eq for sockaddr_dl {} ++ impl fmt::Debug for sockaddr_dl { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sockaddr_dl") ++ .field("sdl_family", &self.sdl_family) ++ .field("sdl_index", &self.sdl_index) ++ .field("sdl_type", &self.sdl_type) ++ .field("sdl_nlen", &self.sdl_nlen) ++ .field("sdl_alen", &self.sdl_alen) ++ .field("sdl_slen", &self.sdl_slen) ++ // FIXME: .field("sdl_data", &self.sdl_data) ++ .finish() ++ } ++ } ++ impl hash::Hash for sockaddr_dl { ++ fn hash(&self, state: &mut H) { ++ self.sdl_family.hash(state); ++ self.sdl_index.hash(state); ++ self.sdl_type.hash(state); ++ self.sdl_nlen.hash(state); ++ self.sdl_alen.hash(state); ++ self.sdl_slen.hash(state); ++ self.sdl_data.hash(state); ++ } ++ } ++ ++ impl PartialEq for sigevent { ++ fn eq(&self, other: &sigevent) -> bool { ++ self.sigev_notify == other.sigev_notify ++ && self.sigev_signo == other.sigev_signo ++ && self.sigev_value == other.sigev_value ++ && self.ss_sp == other.ss_sp ++ && self.sigev_notify_attributes == other.sigev_notify_attributes ++ } ++ } ++ impl Eq for sigevent {} ++ impl fmt::Debug for sigevent { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sigevent") ++ .field("sigev_notify", &self.sigev_notify) ++ .field("sigev_signo", &self.sigev_signo) ++ .field("sigev_value", &self.sigev_value) ++ .field("ss_sp", &self.ss_sp) ++ .field("sigev_notify_attributes", &self.sigev_notify_attributes) ++ .finish() ++ } ++ } ++ impl hash::Hash for sigevent { ++ fn hash(&self, state: &mut H) { ++ self.sigev_notify.hash(state); ++ self.sigev_signo.hash(state); ++ self.sigev_value.hash(state); ++ self.ss_sp.hash(state); ++ self.sigev_notify_attributes.hash(state); ++ } ++ } ++ ++ impl PartialEq for pad128_t { ++ fn eq(&self, other: &pad128_t) -> bool { ++ unsafe { ++ // FIXME: self._q == other._q || ++ self._l == other._l ++ } ++ } ++ } ++ impl Eq for pad128_t {} ++ impl hash::Hash for pad128_t { ++ fn hash(&self, state: &mut H) { ++ unsafe { ++ // FIXME: state.write_i64(self._q as i64); ++ self._l.hash(state); ++ } ++ } ++ } ++ impl PartialEq for upad128_t { ++ fn eq(&self, other: &upad128_t) -> bool { ++ unsafe { ++ // FIXME: self._q == other._q || ++ self._l == other._l ++ } ++ } ++ } ++ impl Eq for upad128_t {} ++ impl hash::Hash for upad128_t { ++ fn hash(&self, state: &mut H) { ++ unsafe { ++ // FIXME: state.write_i64(self._q as i64); ++ self._l.hash(state); ++ } ++ } ++ } ++ } ++} ++ ++cfg_if! { ++ if #[cfg(target_pointer_width = "64")] { ++ const SIGINFO_DATA_SIZE: usize = 60; ++ } else { ++ const SIGINFO_DATA_SIZE: usize = 29; ++ } ++} ++ ++#[repr(C)] ++struct siginfo_fault { ++ addr: *mut c_void, ++ trapno: c_int, ++ pc: *mut crate::caddr_t, ++} ++impl Copy for siginfo_fault {} ++impl Clone for siginfo_fault { ++ fn clone(&self) -> Self { ++ *self ++ } ++} ++ ++#[repr(C)] ++struct siginfo_cldval { ++ utime: crate::clock_t, ++ status: c_int, ++ stime: crate::clock_t, ++} ++impl Copy for siginfo_cldval {} ++impl Clone for siginfo_cldval { ++ fn clone(&self) -> Self { ++ *self ++ } ++} ++ ++#[repr(C)] ++struct siginfo_killval { ++ uid: crate::uid_t, ++ value: crate::sigval, ++ // Pad out to match the SIGCLD value size ++ _pad: *mut c_void, ++} ++impl Copy for siginfo_killval {} ++impl Clone for siginfo_killval { ++ fn clone(&self) -> Self { ++ *self ++ } ++} ++ ++#[repr(C)] ++struct siginfo_sigcld { ++ pid: crate::pid_t, ++ val: siginfo_cldval, ++ ctid: crate::ctid_t, ++ zoneid: crate::zoneid_t, ++} ++impl Copy for siginfo_sigcld {} ++impl Clone for siginfo_sigcld { ++ fn clone(&self) -> Self { ++ *self ++ } ++} ++ ++#[repr(C)] ++struct siginfo_kill { ++ pid: crate::pid_t, ++ val: siginfo_killval, ++ ctid: crate::ctid_t, ++ zoneid: crate::zoneid_t, ++} ++impl Copy for siginfo_kill {} ++impl Clone for siginfo_kill { ++ fn clone(&self) -> Self { ++ *self ++ } ++} ++ ++impl siginfo_t { ++ unsafe fn sidata(&self) -> T { ++ *((&self.__data_pad) as *const c_int as *const T) ++ } ++ pub unsafe fn si_addr(&self) -> *mut c_void { ++ let sifault: siginfo_fault = self.sidata(); ++ sifault.addr ++ } ++ pub unsafe fn si_uid(&self) -> crate::uid_t { ++ let kill: siginfo_kill = self.sidata(); ++ kill.val.uid ++ } ++ pub unsafe fn si_value(&self) -> crate::sigval { ++ let kill: siginfo_kill = self.sidata(); ++ kill.val.value ++ } ++ pub unsafe fn si_pid(&self) -> crate::pid_t { ++ let sigcld: siginfo_sigcld = self.sidata(); ++ sigcld.pid ++ } ++ pub unsafe fn si_status(&self) -> c_int { ++ let sigcld: siginfo_sigcld = self.sidata(); ++ sigcld.val.status ++ } ++ pub unsafe fn si_utime(&self) -> c_long { ++ let sigcld: siginfo_sigcld = self.sidata(); ++ sigcld.val.utime ++ } ++ pub unsafe fn si_stime(&self) -> c_long { ++ let sigcld: siginfo_sigcld = self.sidata(); ++ sigcld.val.stime ++ } ++} ++ ++pub const LC_CTYPE: c_int = 0; ++pub const LC_NUMERIC: c_int = 1; ++pub const LC_TIME: c_int = 2; ++pub const LC_COLLATE: c_int = 3; ++pub const LC_MONETARY: c_int = 4; ++pub const LC_MESSAGES: c_int = 5; ++pub const LC_ALL: c_int = 6; ++pub const LC_CTYPE_MASK: c_int = 1 << LC_CTYPE; ++pub const LC_NUMERIC_MASK: c_int = 1 << LC_NUMERIC; ++pub const LC_TIME_MASK: c_int = 1 << LC_TIME; ++pub const LC_COLLATE_MASK: c_int = 1 << LC_COLLATE; ++pub const LC_MONETARY_MASK: c_int = 1 << LC_MONETARY; ++pub const LC_MESSAGES_MASK: c_int = 1 << LC_MESSAGES; ++pub const LC_ALL_MASK: c_int = LC_CTYPE_MASK ++ | LC_NUMERIC_MASK ++ | LC_TIME_MASK ++ | LC_COLLATE_MASK ++ | LC_MONETARY_MASK ++ | LC_MESSAGES_MASK; ++ ++pub const DAY_1: crate::nl_item = 1; ++pub const DAY_2: crate::nl_item = 2; ++pub const DAY_3: crate::nl_item = 3; ++pub const DAY_4: crate::nl_item = 4; ++pub const DAY_5: crate::nl_item = 5; ++pub const DAY_6: crate::nl_item = 6; ++pub const DAY_7: crate::nl_item = 7; ++ ++pub const ABDAY_1: crate::nl_item = 8; ++pub const ABDAY_2: crate::nl_item = 9; ++pub const ABDAY_3: crate::nl_item = 10; ++pub const ABDAY_4: crate::nl_item = 11; ++pub const ABDAY_5: crate::nl_item = 12; ++pub const ABDAY_6: crate::nl_item = 13; ++pub const ABDAY_7: crate::nl_item = 14; ++ ++pub const MON_1: crate::nl_item = 15; ++pub const MON_2: crate::nl_item = 16; ++pub const MON_3: crate::nl_item = 17; ++pub const MON_4: crate::nl_item = 18; ++pub const MON_5: crate::nl_item = 19; ++pub const MON_6: crate::nl_item = 20; ++pub const MON_7: crate::nl_item = 21; ++pub const MON_8: crate::nl_item = 22; ++pub const MON_9: crate::nl_item = 23; ++pub const MON_10: crate::nl_item = 24; ++pub const MON_11: crate::nl_item = 25; ++pub const MON_12: crate::nl_item = 26; ++ ++pub const ABMON_1: crate::nl_item = 27; ++pub const ABMON_2: crate::nl_item = 28; ++pub const ABMON_3: crate::nl_item = 29; ++pub const ABMON_4: crate::nl_item = 30; ++pub const ABMON_5: crate::nl_item = 31; ++pub const ABMON_6: crate::nl_item = 32; ++pub const ABMON_7: crate::nl_item = 33; ++pub const ABMON_8: crate::nl_item = 34; ++pub const ABMON_9: crate::nl_item = 35; ++pub const ABMON_10: crate::nl_item = 36; ++pub const ABMON_11: crate::nl_item = 37; ++pub const ABMON_12: crate::nl_item = 38; ++ ++pub const RADIXCHAR: crate::nl_item = 39; ++pub const THOUSEP: crate::nl_item = 40; ++pub const YESSTR: crate::nl_item = 41; ++pub const NOSTR: crate::nl_item = 42; ++pub const CRNCYSTR: crate::nl_item = 43; ++ ++pub const D_T_FMT: crate::nl_item = 44; ++pub const D_FMT: crate::nl_item = 45; ++pub const T_FMT: crate::nl_item = 46; ++pub const AM_STR: crate::nl_item = 47; ++pub const PM_STR: crate::nl_item = 48; ++ ++pub const CODESET: crate::nl_item = 49; ++pub const T_FMT_AMPM: crate::nl_item = 50; ++pub const ERA: crate::nl_item = 51; ++pub const ERA_D_FMT: crate::nl_item = 52; ++pub const ERA_D_T_FMT: crate::nl_item = 53; ++pub const ERA_T_FMT: crate::nl_item = 54; ++pub const ALT_DIGITS: crate::nl_item = 55; ++pub const YESEXPR: crate::nl_item = 56; ++pub const NOEXPR: crate::nl_item = 57; ++pub const _DATE_FMT: crate::nl_item = 58; ++pub const MAXSTRMSG: crate::nl_item = 58; ++ ++pub const PATH_MAX: c_int = 1024; ++ ++pub const SA_ONSTACK: c_int = 0x00000001; ++pub const SA_RESETHAND: c_int = 0x00000002; ++pub const SA_RESTART: c_int = 0x00000004; ++pub const SA_SIGINFO: c_int = 0x00000008; ++pub const SA_NODEFER: c_int = 0x00000010; ++pub const SA_NOCLDWAIT: c_int = 0x00010000; ++pub const SA_NOCLDSTOP: c_int = 0x00020000; ++ ++pub const SS_ONSTACK: c_int = 1; ++pub const SS_DISABLE: c_int = 2; ++ ++pub const FIOCLEX: c_int = 0x20006601; ++pub const FIONCLEX: c_int = 0x20006602; ++pub const FIONREAD: c_int = 0x4004667f; ++pub const FIONBIO: c_int = 0x8004667e; ++pub const FIOASYNC: c_int = 0x8004667d; ++pub const FIOSETOWN: c_int = 0x8004667c; ++pub const FIOGETOWN: c_int = 0x4004667b; ++ ++pub const SIGCHLD: c_int = 18; ++pub const SIGCLD: c_int = SIGCHLD; ++pub const SIGBUS: c_int = 10; ++pub const SIG_BLOCK: c_int = 1; ++pub const SIG_UNBLOCK: c_int = 2; ++pub const SIG_SETMASK: c_int = 3; ++ ++pub const AIO_CANCELED: c_int = 0; ++pub const AIO_ALLDONE: c_int = 1; ++pub const AIO_NOTCANCELED: c_int = 2; ++pub const LIO_NOP: c_int = 0; ++pub const LIO_READ: c_int = 1; ++pub const LIO_WRITE: c_int = 2; ++pub const LIO_NOWAIT: c_int = 0; ++pub const LIO_WAIT: c_int = 1; ++ ++pub const SIGEV_NONE: c_int = 1; ++pub const SIGEV_SIGNAL: c_int = 2; ++pub const SIGEV_THREAD: c_int = 3; ++pub const SIGEV_PORT: c_int = 4; ++ ++pub const CLD_EXITED: c_int = 1; ++pub const CLD_KILLED: c_int = 2; ++pub const CLD_DUMPED: c_int = 3; ++pub const CLD_TRAPPED: c_int = 4; ++pub const CLD_STOPPED: c_int = 5; ++pub const CLD_CONTINUED: c_int = 6; ++ ++pub const IP_RECVDSTADDR: c_int = 0x7; ++pub const IP_PKTINFO: c_int = 0x1a; ++pub const IP_DONTFRAG: c_int = 0x1b; ++pub const IP_SEC_OPT: c_int = 0x22; ++ ++pub const IPV6_UNICAST_HOPS: c_int = 0x5; ++pub const IPV6_MULTICAST_IF: c_int = 0x6; ++pub const IPV6_MULTICAST_HOPS: c_int = 0x7; ++pub const IPV6_MULTICAST_LOOP: c_int = 0x8; ++pub const IPV6_PKTINFO: c_int = 0xb; ++pub const IPV6_RECVPKTINFO: c_int = 0x12; ++pub const IPV6_RECVTCLASS: c_int = 0x19; ++pub const IPV6_DONTFRAG: c_int = 0x21; ++pub const IPV6_SEC_OPT: c_int = 0x22; ++pub const IPV6_TCLASS: c_int = 0x26; ++pub const IPV6_V6ONLY: c_int = 0x27; ++ ++cfg_if! { ++ if #[cfg(target_pointer_width = "64")] { ++ pub const FD_SETSIZE: usize = 65536; ++ } else { ++ pub const FD_SETSIZE: usize = 1024; ++ } ++} ++ ++pub const ST_RDONLY: c_ulong = 1; ++pub const ST_NOSUID: c_ulong = 2; ++ ++pub const NI_MAXHOST: crate::socklen_t = 1025; ++pub const NI_MAXSERV: crate::socklen_t = 32; ++ ++pub const EXIT_FAILURE: c_int = 1; ++pub const EXIT_SUCCESS: c_int = 0; ++pub const RAND_MAX: c_int = 32767; ++pub const EOF: c_int = -1; ++pub const SEEK_SET: c_int = 0; ++pub const SEEK_CUR: c_int = 1; ++pub const SEEK_END: c_int = 2; ++pub const SEEK_DATA: c_int = 3; ++pub const SEEK_HOLE: c_int = 4; ++pub const _IOFBF: c_int = 0; ++pub const _IONBF: c_int = 4; ++pub const _IOLBF: c_int = 64; ++pub const BUFSIZ: c_uint = 1024; ++pub const FOPEN_MAX: c_uint = 20; ++pub const FILENAME_MAX: c_uint = 1024; ++pub const L_tmpnam: c_uint = 25; ++pub const TMP_MAX: c_uint = 17576; ++pub const PIPE_BUF: c_int = 5120; ++ ++pub const GRND_NONBLOCK: c_uint = 0x0001; ++pub const GRND_RANDOM: c_uint = 0x0002; ++ ++pub const O_RDONLY: c_int = 0; ++pub const O_WRONLY: c_int = 1; ++pub const O_RDWR: c_int = 2; ++pub const O_NDELAY: c_int = 0x04; ++pub const O_APPEND: c_int = 8; ++pub const O_DSYNC: c_int = 0x40; ++pub const O_RSYNC: c_int = 0x8000; ++pub const O_CREAT: c_int = 256; ++pub const O_EXCL: c_int = 1024; ++pub const O_NOCTTY: c_int = 2048; ++pub const O_TRUNC: c_int = 512; ++pub const O_NOFOLLOW: c_int = 0x20000; ++pub const O_SEARCH: c_int = 0x200000; ++pub const O_EXEC: c_int = 0x400000; ++pub const O_CLOEXEC: c_int = 0x800000; ++pub const O_ACCMODE: c_int = 0x600003; ++pub const O_XATTR: c_int = 0x4000; ++pub const O_DIRECTORY: c_int = 0x1000000; ++pub const S_IFIFO: mode_t = 0o1_0000; ++pub const S_IFCHR: mode_t = 0o2_0000; ++pub const S_IFBLK: mode_t = 0o6_0000; ++pub const S_IFDIR: mode_t = 0o4_0000; ++pub const S_IFREG: mode_t = 0o10_0000; ++pub const S_IFLNK: mode_t = 0o12_0000; ++pub const S_IFSOCK: mode_t = 0o14_0000; ++pub const S_IFMT: mode_t = 0o17_0000; ++pub const S_IEXEC: mode_t = 0o0100; ++pub const S_IWRITE: mode_t = 0o0200; ++pub const S_IREAD: mode_t = 0o0400; ++pub const S_IRWXU: mode_t = 0o0700; ++pub const S_IXUSR: mode_t = 0o0100; ++pub const S_IWUSR: mode_t = 0o0200; ++pub const S_IRUSR: mode_t = 0o0400; ++pub const S_IRWXG: mode_t = 0o0070; ++pub const S_IXGRP: mode_t = 0o0010; ++pub const S_IWGRP: mode_t = 0o0020; ++pub const S_IRGRP: mode_t = 0o0040; ++pub const S_IRWXO: mode_t = 0o0007; ++pub const S_IXOTH: mode_t = 0o0001; ++pub const S_IWOTH: mode_t = 0o0002; ++pub const S_IROTH: mode_t = 0o0004; ++pub const F_OK: c_int = 0; ++pub const R_OK: c_int = 4; ++pub const W_OK: c_int = 2; ++pub const X_OK: c_int = 1; ++pub const STDIN_FILENO: c_int = 0; ++pub const STDOUT_FILENO: c_int = 1; ++pub const STDERR_FILENO: c_int = 2; ++pub const F_LOCK: c_int = 1; ++pub const F_TEST: c_int = 3; ++pub const F_TLOCK: c_int = 2; ++pub const F_ULOCK: c_int = 0; ++pub const F_SETLK: c_int = 6; ++pub const F_SETLKW: c_int = 7; ++pub const F_GETLK: c_int = 14; ++pub const F_ALLOCSP: c_int = 10; ++pub const F_FREESP: c_int = 11; ++pub const F_BLOCKS: c_int = 18; ++pub const F_BLKSIZE: c_int = 19; ++pub const F_SHARE: c_int = 40; ++pub const F_UNSHARE: c_int = 41; ++pub const F_ISSTREAM: c_int = 13; ++pub const F_PRIV: c_int = 15; ++pub const F_NPRIV: c_int = 16; ++pub const F_QUOTACTL: c_int = 17; ++pub const F_GETOWN: c_int = 23; ++pub const F_SETOWN: c_int = 24; ++pub const F_REVOKE: c_int = 25; ++pub const F_HASREMOTELOCKS: c_int = 26; ++pub const SIGHUP: c_int = 1; ++pub const SIGINT: c_int = 2; ++pub const SIGQUIT: c_int = 3; ++pub const SIGILL: c_int = 4; ++pub const SIGABRT: c_int = 6; ++pub const SIGEMT: c_int = 7; ++pub const SIGFPE: c_int = 8; ++pub const SIGKILL: c_int = 9; ++pub const SIGSEGV: c_int = 11; ++pub const SIGSYS: c_int = 12; ++pub const SIGPIPE: c_int = 13; ++pub const SIGALRM: c_int = 14; ++pub const SIGTERM: c_int = 15; ++pub const SIGUSR1: c_int = 16; ++pub const SIGUSR2: c_int = 17; ++pub const SIGPWR: c_int = 19; ++pub const SIGWINCH: c_int = 20; ++pub const SIGURG: c_int = 21; ++pub const SIGPOLL: c_int = 22; ++pub const SIGIO: c_int = SIGPOLL; ++pub const SIGSTOP: c_int = 23; ++pub const SIGTSTP: c_int = 24; ++pub const SIGCONT: c_int = 25; ++pub const SIGTTIN: c_int = 26; ++pub const SIGTTOU: c_int = 27; ++pub const SIGVTALRM: c_int = 28; ++pub const SIGPROF: c_int = 29; ++pub const SIGXCPU: c_int = 30; ++pub const SIGXFSZ: c_int = 31; ++ ++pub const WNOHANG: c_int = 0x40; ++pub const WUNTRACED: c_int = 0x04; ++ ++pub const WEXITED: c_int = 0x01; ++pub const WTRAPPED: c_int = 0x02; ++pub const WSTOPPED: c_int = WUNTRACED; ++pub const WCONTINUED: c_int = 0x08; ++pub const WNOWAIT: c_int = 0x80; ++ ++pub const AT_FDCWD: c_int = 0xffd19553; ++pub const AT_SYMLINK_NOFOLLOW: c_int = 0x1000; ++pub const AT_SYMLINK_FOLLOW: c_int = 0x2000; ++pub const AT_REMOVEDIR: c_int = 0x1; ++pub const _AT_TRIGGER: c_int = 0x2; ++pub const AT_EACCESS: c_int = 0x4; ++ ++pub const P_PID: idtype_t = 0; ++pub const P_PPID: idtype_t = 1; ++pub const P_PGID: idtype_t = 2; ++pub const P_SID: idtype_t = 3; ++pub const P_CID: idtype_t = 4; ++pub const P_UID: idtype_t = 5; ++pub const P_GID: idtype_t = 6; ++pub const P_ALL: idtype_t = 7; ++pub const P_LWPID: idtype_t = 8; ++pub const P_TASKID: idtype_t = 9; ++pub const P_PROJID: idtype_t = 10; ++pub const P_POOLID: idtype_t = 11; ++pub const P_ZONEID: idtype_t = 12; ++pub const P_CTID: idtype_t = 13; ++pub const P_CPUID: idtype_t = 14; ++pub const P_PSETID: idtype_t = 15; ++ ++pub const PBIND_NONE: crate::processorid_t = -1; ++pub const PBIND_QUERY: crate::processorid_t = -2; ++ ++pub const PS_NONE: c_int = -1; ++pub const PS_QUERY: c_int = -2; ++pub const PS_MYID: c_int = -3; ++pub const PS_SOFT: c_int = -4; ++pub const PS_HARD: c_int = -5; ++pub const PS_QUERY_TYPE: c_int = -6; ++pub const PS_PRIVATE: c_int = 2; ++ ++pub const UTIME_OMIT: c_long = -2; ++pub const UTIME_NOW: c_long = -1; ++ ++pub const PROT_NONE: c_int = 0; ++pub const PROT_READ: c_int = 1; ++pub const PROT_WRITE: c_int = 2; ++pub const PROT_EXEC: c_int = 4; ++ ++pub const MAP_SHARED: c_int = 0x0001; ++pub const MAP_PRIVATE: c_int = 0x0002; ++pub const MAP_FIXED: c_int = 0x0010; ++pub const MAP_NORESERVE: c_int = 0x40; ++pub const MAP_ANON: c_int = 0x0100; ++pub const MAP_ANONYMOUS: c_int = 0x0100; ++pub const MAP_RENAME: c_int = 0x20; ++pub const MAP_ALIGN: c_int = 0x200; ++pub const MAP_TEXT: c_int = 0x400; ++pub const MAP_INITDATA: c_int = 0x800; ++pub const MAP_FAILED: *mut c_void = !0 as *mut c_void; ++ ++pub const MCL_CURRENT: c_int = 0x0001; ++pub const MCL_FUTURE: c_int = 0x0002; ++ ++pub const MS_SYNC: c_int = 0x0004; ++pub const MS_ASYNC: c_int = 0x0001; ++pub const MS_INVALIDATE: c_int = 0x0002; ++ ++pub const MMOBJ_PADDING: c_uint = 0x10000; ++pub const MMOBJ_INTERPRET: c_uint = 0x20000; ++pub const MR_PADDING: c_uint = 0x1; ++pub const MR_HDR_ELF: c_uint = 0x2; ++ ++pub const EPERM: c_int = 1; ++pub const ENOENT: c_int = 2; ++pub const ESRCH: c_int = 3; ++pub const EINTR: c_int = 4; ++pub const EIO: c_int = 5; ++pub const ENXIO: c_int = 6; ++pub const E2BIG: c_int = 7; ++pub const ENOEXEC: c_int = 8; ++pub const EBADF: c_int = 9; ++pub const ECHILD: c_int = 10; ++pub const EAGAIN: c_int = 11; ++pub const ENOMEM: c_int = 12; ++pub const EACCES: c_int = 13; ++pub const EFAULT: c_int = 14; ++pub const ENOTBLK: c_int = 15; ++pub const EBUSY: c_int = 16; ++pub const EEXIST: c_int = 17; ++pub const EXDEV: c_int = 18; ++pub const ENODEV: c_int = 19; ++pub const ENOTDIR: c_int = 20; ++pub const EISDIR: c_int = 21; ++pub const EINVAL: c_int = 22; ++pub const ENFILE: c_int = 23; ++pub const EMFILE: c_int = 24; ++pub const ENOTTY: c_int = 25; ++pub const ETXTBSY: c_int = 26; ++pub const EFBIG: c_int = 27; ++pub const ENOSPC: c_int = 28; ++pub const ESPIPE: c_int = 29; ++pub const EROFS: c_int = 30; ++pub const EMLINK: c_int = 31; ++pub const EPIPE: c_int = 32; ++pub const EDOM: c_int = 33; ++pub const ERANGE: c_int = 34; ++pub const ENOMSG: c_int = 35; ++pub const EIDRM: c_int = 36; ++pub const ECHRNG: c_int = 37; ++pub const EL2NSYNC: c_int = 38; ++pub const EL3HLT: c_int = 39; ++pub const EL3RST: c_int = 40; ++pub const ELNRNG: c_int = 41; ++pub const EUNATCH: c_int = 42; ++pub const ENOCSI: c_int = 43; ++pub const EL2HLT: c_int = 44; ++pub const EDEADLK: c_int = 45; ++pub const ENOLCK: c_int = 46; ++pub const ECANCELED: c_int = 47; ++pub const ENOTSUP: c_int = 48; ++pub const EDQUOT: c_int = 49; ++pub const EBADE: c_int = 50; ++pub const EBADR: c_int = 51; ++pub const EXFULL: c_int = 52; ++pub const ENOANO: c_int = 53; ++pub const EBADRQC: c_int = 54; ++pub const EBADSLT: c_int = 55; ++pub const EDEADLOCK: c_int = 56; ++pub const EBFONT: c_int = 57; ++pub const EOWNERDEAD: c_int = 58; ++pub const ENOTRECOVERABLE: c_int = 59; ++pub const ENOSTR: c_int = 60; ++pub const ENODATA: c_int = 61; ++pub const ETIME: c_int = 62; ++pub const ENOSR: c_int = 63; ++pub const ENONET: c_int = 64; ++pub const ENOPKG: c_int = 65; ++pub const EREMOTE: c_int = 66; ++pub const ENOLINK: c_int = 67; ++pub const EADV: c_int = 68; ++pub const ESRMNT: c_int = 69; ++pub const ECOMM: c_int = 70; ++pub const EPROTO: c_int = 71; ++pub const ELOCKUNMAPPED: c_int = 72; ++pub const ENOTACTIVE: c_int = 73; ++pub const EMULTIHOP: c_int = 74; ++pub const EADI: c_int = 75; ++pub const EBADMSG: c_int = 77; ++pub const ENAMETOOLONG: c_int = 78; ++pub const EOVERFLOW: c_int = 79; ++pub const ENOTUNIQ: c_int = 80; ++pub const EBADFD: c_int = 81; ++pub const EREMCHG: c_int = 82; ++pub const ELIBACC: c_int = 83; ++pub const ELIBBAD: c_int = 84; ++pub const ELIBSCN: c_int = 85; ++pub const ELIBMAX: c_int = 86; ++pub const ELIBEXEC: c_int = 87; ++pub const EILSEQ: c_int = 88; ++pub const ENOSYS: c_int = 89; ++pub const ELOOP: c_int = 90; ++pub const ERESTART: c_int = 91; ++pub const ESTRPIPE: c_int = 92; ++pub const ENOTEMPTY: c_int = 93; ++pub const EUSERS: c_int = 94; ++pub const ENOTSOCK: c_int = 95; ++pub const EDESTADDRREQ: c_int = 96; ++pub const EMSGSIZE: c_int = 97; ++pub const EPROTOTYPE: c_int = 98; ++pub const ENOPROTOOPT: c_int = 99; ++pub const EPROTONOSUPPORT: c_int = 120; ++pub const ESOCKTNOSUPPORT: c_int = 121; ++pub const EOPNOTSUPP: c_int = 122; ++pub const EPFNOSUPPORT: c_int = 123; ++pub const EAFNOSUPPORT: c_int = 124; ++pub const EADDRINUSE: c_int = 125; ++pub const EADDRNOTAVAIL: c_int = 126; ++pub const ENETDOWN: c_int = 127; ++pub const ENETUNREACH: c_int = 128; ++pub const ENETRESET: c_int = 129; ++pub const ECONNABORTED: c_int = 130; ++pub const ECONNRESET: c_int = 131; ++pub const ENOBUFS: c_int = 132; ++pub const EISCONN: c_int = 133; ++pub const ENOTCONN: c_int = 134; ++pub const ESHUTDOWN: c_int = 143; ++pub const ETOOMANYREFS: c_int = 144; ++pub const ETIMEDOUT: c_int = 145; ++pub const ECONNREFUSED: c_int = 146; ++pub const EHOSTDOWN: c_int = 147; ++pub const EHOSTUNREACH: c_int = 148; ++pub const EWOULDBLOCK: c_int = EAGAIN; ++pub const EALREADY: c_int = 149; ++pub const EINPROGRESS: c_int = 150; ++pub const ESTALE: c_int = 151; ++ ++pub const EAI_AGAIN: c_int = 2; ++pub const EAI_BADFLAGS: c_int = 3; ++pub const EAI_FAIL: c_int = 4; ++pub const EAI_FAMILY: c_int = 5; ++pub const EAI_MEMORY: c_int = 6; ++pub const EAI_NODATA: c_int = 7; ++pub const EAI_NONAME: c_int = 8; ++pub const EAI_SERVICE: c_int = 9; ++pub const EAI_SOCKTYPE: c_int = 10; ++pub const EAI_SYSTEM: c_int = 11; ++pub const EAI_OVERFLOW: c_int = 12; ++ ++pub const NI_NOFQDN: c_uint = 0x0001; ++pub const NI_NUMERICHOST: c_uint = 0x0002; ++pub const NI_NAMEREQD: c_uint = 0x0004; ++pub const NI_NUMERICSERV: c_uint = 0x0008; ++pub const NI_DGRAM: c_uint = 0x0010; ++pub const NI_WITHSCOPEID: c_uint = 0x0020; ++pub const NI_NUMERICSCOPE: c_uint = 0x0040; ++ ++pub const F_DUPFD: c_int = 0; ++pub const F_DUP2FD: c_int = 9; ++pub const F_GETFD: c_int = 1; ++pub const F_SETFD: c_int = 2; ++pub const F_GETFL: c_int = 3; ++pub const F_SETFL: c_int = 4; ++pub const F_GETXFL: c_int = 45; ++ ++pub const SIGTRAP: c_int = 5; ++ ++pub const GLOB_APPEND: c_int = 32; ++pub const GLOB_DOOFFS: c_int = 16; ++pub const GLOB_ERR: c_int = 1; ++pub const GLOB_MARK: c_int = 2; ++pub const GLOB_NOCHECK: c_int = 8; ++pub const GLOB_NOSORT: c_int = 4; ++pub const GLOB_NOESCAPE: c_int = 64; ++ ++pub const GLOB_NOSPACE: c_int = -2; ++pub const GLOB_ABORTED: c_int = -1; ++pub const GLOB_NOMATCH: c_int = -3; ++ ++pub const POLLIN: c_short = 0x1; ++pub const POLLPRI: c_short = 0x2; ++pub const POLLOUT: c_short = 0x4; ++pub const POLLERR: c_short = 0x8; ++pub const POLLHUP: c_short = 0x10; ++pub const POLLNVAL: c_short = 0x20; ++pub const POLLNORM: c_short = 0x0040; ++pub const POLLRDNORM: c_short = 0x0040; ++pub const POLLWRNORM: c_short = 0x4; /* POLLOUT */ ++pub const POLLRDBAND: c_short = 0x0080; ++pub const POLLWRBAND: c_short = 0x0100; ++ ++pub const POSIX_MADV_NORMAL: c_int = 0; ++pub const POSIX_MADV_RANDOM: c_int = 1; ++pub const POSIX_MADV_SEQUENTIAL: c_int = 2; ++pub const POSIX_MADV_WILLNEED: c_int = 3; ++pub const POSIX_MADV_DONTNEED: c_int = 4; ++ ++pub const PTHREAD_CREATE_JOINABLE: c_int = 0; ++pub const PTHREAD_CREATE_DETACHED: c_int = 0x40; ++pub const PTHREAD_PROCESS_SHARED: c_int = 1; ++pub const PTHREAD_PROCESS_PRIVATE: c_ushort = 0; ++pub const PTHREAD_STACK_MIN: size_t = 4096; ++ ++pub const SIGSTKSZ: size_t = 8192; ++ ++// https://illumos.org/man/3c/clock_gettime ++// https://github.com/illumos/illumos-gate/ ++// blob/HEAD/usr/src/lib/libc/amd64/sys/__clock_gettime.s ++// clock_gettime(3c) doesn't seem to accept anything other than CLOCK_REALTIME ++// or __CLOCK_REALTIME0 ++// ++// https://github.com/illumos/illumos-gate/ ++// blob/HEAD/usr/src/uts/common/sys/time_impl.h ++// Confusing! CLOCK_HIGHRES==CLOCK_MONOTONIC==4 ++// __CLOCK_REALTIME0==0 is an obsoleted version of CLOCK_REALTIME==3 ++pub const CLOCK_REALTIME: crate::clockid_t = 3; ++pub const CLOCK_MONOTONIC: crate::clockid_t = 4; ++pub const TIMER_RELTIME: c_int = 0; ++pub const TIMER_ABSTIME: c_int = 1; ++ ++pub const RLIMIT_CPU: c_int = 0; ++pub const RLIMIT_FSIZE: c_int = 1; ++pub const RLIMIT_DATA: c_int = 2; ++pub const RLIMIT_STACK: c_int = 3; ++pub const RLIMIT_CORE: c_int = 4; ++pub const RLIMIT_NOFILE: c_int = 5; ++pub const RLIMIT_VMEM: c_int = 6; ++pub const RLIMIT_AS: c_int = RLIMIT_VMEM; ++ ++#[deprecated(since = "0.2.64", note = "Not stable across OS versions")] ++pub const RLIM_NLIMITS: rlim_t = 7; ++pub const RLIM_INFINITY: rlim_t = 0xfffffffffffffffd; ++ ++pub const RUSAGE_SELF: c_int = 0; ++pub const RUSAGE_CHILDREN: c_int = -1; ++ ++pub const MADV_NORMAL: c_int = 0; ++pub const MADV_RANDOM: c_int = 1; ++pub const MADV_SEQUENTIAL: c_int = 2; ++pub const MADV_WILLNEED: c_int = 3; ++pub const MADV_DONTNEED: c_int = 4; ++pub const MADV_FREE: c_int = 5; ++pub const MADV_ACCESS_DEFAULT: c_int = 6; ++pub const MADV_ACCESS_LWP: c_int = 7; ++pub const MADV_ACCESS_MANY: c_int = 8; ++ ++pub const AF_UNSPEC: c_int = 0; ++pub const AF_UNIX: c_int = 1; ++pub const AF_INET: c_int = 2; ++pub const AF_IMPLINK: c_int = 3; ++pub const AF_PUP: c_int = 4; ++pub const AF_CHAOS: c_int = 5; ++pub const AF_NS: c_int = 6; ++pub const AF_NBS: c_int = 7; ++pub const AF_ECMA: c_int = 8; ++pub const AF_DATAKIT: c_int = 9; ++pub const AF_CCITT: c_int = 10; ++pub const AF_SNA: c_int = 11; ++pub const AF_DECnet: c_int = 12; ++pub const AF_DLI: c_int = 13; ++pub const AF_LAT: c_int = 14; ++pub const AF_HYLINK: c_int = 15; ++pub const AF_APPLETALK: c_int = 16; ++pub const AF_NIT: c_int = 17; ++pub const AF_802: c_int = 18; ++pub const AF_OSI: c_int = 19; ++pub const AF_X25: c_int = 20; ++pub const AF_OSINET: c_int = 21; ++pub const AF_GOSIP: c_int = 22; ++pub const AF_IPX: c_int = 23; ++pub const AF_ROUTE: c_int = 24; ++pub const AF_LINK: c_int = 25; ++pub const AF_INET6: c_int = 26; ++pub const AF_KEY: c_int = 27; ++pub const AF_POLICY: c_int = 29; ++pub const AF_INET_OFFLOAD: c_int = 30; ++pub const AF_TRILL: c_int = 31; ++pub const AF_PACKET: c_int = 32; ++ ++pub const PF_UNSPEC: c_int = AF_UNSPEC; ++pub const PF_UNIX: c_int = AF_UNIX; ++pub const PF_LOCAL: c_int = PF_UNIX; ++pub const PF_FILE: c_int = PF_UNIX; ++pub const PF_INET: c_int = AF_INET; ++pub const PF_IMPLINK: c_int = AF_IMPLINK; ++pub const PF_PUP: c_int = AF_PUP; ++pub const PF_CHAOS: c_int = AF_CHAOS; ++pub const PF_NS: c_int = AF_NS; ++pub const PF_NBS: c_int = AF_NBS; ++pub const PF_ECMA: c_int = AF_ECMA; ++pub const PF_DATAKIT: c_int = AF_DATAKIT; ++pub const PF_CCITT: c_int = AF_CCITT; ++pub const PF_SNA: c_int = AF_SNA; ++pub const PF_DECnet: c_int = AF_DECnet; ++pub const PF_DLI: c_int = AF_DLI; ++pub const PF_LAT: c_int = AF_LAT; ++pub const PF_HYLINK: c_int = AF_HYLINK; ++pub const PF_APPLETALK: c_int = AF_APPLETALK; ++pub const PF_NIT: c_int = AF_NIT; ++pub const PF_802: c_int = AF_802; ++pub const PF_OSI: c_int = AF_OSI; ++pub const PF_X25: c_int = AF_X25; ++pub const PF_OSINET: c_int = AF_OSINET; ++pub const PF_GOSIP: c_int = AF_GOSIP; ++pub const PF_IPX: c_int = AF_IPX; ++pub const PF_ROUTE: c_int = AF_ROUTE; ++pub const PF_LINK: c_int = AF_LINK; ++pub const PF_INET6: c_int = AF_INET6; ++pub const PF_KEY: c_int = AF_KEY; ++pub const PF_POLICY: c_int = AF_POLICY; ++pub const PF_INET_OFFLOAD: c_int = AF_INET_OFFLOAD; ++pub const PF_TRILL: c_int = AF_TRILL; ++pub const PF_PACKET: c_int = AF_PACKET; ++ ++pub const SOCK_DGRAM: c_int = 1; ++pub const SOCK_STREAM: c_int = 2; ++pub const SOCK_RAW: c_int = 4; ++pub const SOCK_RDM: c_int = 5; ++pub const SOCK_SEQPACKET: c_int = 6; ++pub const IP_MULTICAST_IF: c_int = 16; ++pub const IP_MULTICAST_TTL: c_int = 17; ++pub const IP_MULTICAST_LOOP: c_int = 18; ++pub const IP_HDRINCL: c_int = 2; ++pub const IP_TOS: c_int = 3; ++pub const IP_TTL: c_int = 4; ++pub const IP_ADD_MEMBERSHIP: c_int = 19; ++pub const IP_DROP_MEMBERSHIP: c_int = 20; ++pub const IPV6_JOIN_GROUP: c_int = 9; ++pub const IPV6_LEAVE_GROUP: c_int = 10; ++pub const IP_ADD_SOURCE_MEMBERSHIP: c_int = 23; ++pub const IP_DROP_SOURCE_MEMBERSHIP: c_int = 24; ++pub const IP_BLOCK_SOURCE: c_int = 21; ++pub const IP_UNBLOCK_SOURCE: c_int = 22; ++ ++// These TCP socket options are common between illumos and Solaris, while higher ++// numbers have generally diverged: ++pub const TCP_NODELAY: c_int = 0x1; ++pub const TCP_MAXSEG: c_int = 0x2; ++pub const TCP_KEEPALIVE: c_int = 0x8; ++pub const TCP_NOTIFY_THRESHOLD: c_int = 0x10; ++pub const TCP_ABORT_THRESHOLD: c_int = 0x11; ++pub const TCP_CONN_NOTIFY_THRESHOLD: c_int = 0x12; ++pub const TCP_CONN_ABORT_THRESHOLD: c_int = 0x13; ++pub const TCP_RECVDSTADDR: c_int = 0x14; ++pub const TCP_INIT_CWND: c_int = 0x15; ++pub const TCP_KEEPALIVE_THRESHOLD: c_int = 0x16; ++pub const TCP_KEEPALIVE_ABORT_THRESHOLD: c_int = 0x17; ++pub const TCP_CORK: c_int = 0x18; ++pub const TCP_RTO_INITIAL: c_int = 0x19; ++pub const TCP_RTO_MIN: c_int = 0x1a; ++pub const TCP_RTO_MAX: c_int = 0x1b; ++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; ++pub const SO_REUSEADDR: c_int = 0x0004; ++pub const SO_KEEPALIVE: c_int = 0x0008; ++pub const SO_DONTROUTE: c_int = 0x0010; ++pub const SO_BROADCAST: c_int = 0x0020; ++pub const SO_USELOOPBACK: c_int = 0x0040; ++pub const SO_LINGER: c_int = 0x0080; ++pub const SO_OOBINLINE: c_int = 0x0100; ++pub const SO_SNDBUF: c_int = 0x1001; ++pub const SO_RCVBUF: c_int = 0x1002; ++pub const SO_SNDLOWAT: c_int = 0x1003; ++pub const SO_RCVLOWAT: c_int = 0x1004; ++pub const SO_SNDTIMEO: c_int = 0x1005; ++pub const SO_RCVTIMEO: c_int = 0x1006; ++pub const SO_ERROR: c_int = 0x1007; ++pub const SO_TYPE: c_int = 0x1008; ++pub const SO_PROTOTYPE: c_int = 0x1009; ++pub const SO_DOMAIN: c_int = 0x100c; ++pub const SO_TIMESTAMP: c_int = 0x1013; ++pub const SO_EXCLBIND: c_int = 0x1015; ++ ++pub const SCM_RIGHTS: c_int = 0x1010; ++pub const SCM_UCRED: c_int = 0x1012; ++pub const SCM_TIMESTAMP: c_int = SO_TIMESTAMP; ++ ++pub const MSG_OOB: c_int = 0x1; ++pub const MSG_PEEK: c_int = 0x2; ++pub const MSG_DONTROUTE: c_int = 0x4; ++pub const MSG_EOR: c_int = 0x8; ++pub const MSG_CTRUNC: c_int = 0x10; ++pub const MSG_TRUNC: c_int = 0x20; ++pub const MSG_WAITALL: c_int = 0x40; ++pub const MSG_DONTWAIT: c_int = 0x80; ++pub const MSG_NOTIFICATION: c_int = 0x100; ++pub const MSG_NOSIGNAL: c_int = 0x200; ++pub const MSG_DUPCTRL: c_int = 0x800; ++pub const MSG_XPG4_2: c_int = 0x8000; ++pub const MSG_MAXIOVLEN: c_int = 16; ++ ++pub const IF_NAMESIZE: size_t = 32; ++pub const IFNAMSIZ: size_t = 16; ++ ++// https://docs.oracle.com/cd/E23824_01/html/821-1475/if-7p.html ++pub const IFF_UP: c_int = 0x0000000001; // Address is up ++pub const IFF_BROADCAST: c_int = 0x0000000002; // Broadcast address valid ++pub const IFF_DEBUG: c_int = 0x0000000004; // Turn on debugging ++pub const IFF_LOOPBACK: c_int = 0x0000000008; // Loopback net ++pub const IFF_POINTOPOINT: c_int = 0x0000000010; // Interface is p-to-p ++pub const IFF_NOTRAILERS: c_int = 0x0000000020; // Avoid use of trailers ++pub const IFF_RUNNING: c_int = 0x0000000040; // Resources allocated ++pub const IFF_NOARP: c_int = 0x0000000080; // No address res. protocol ++pub const IFF_PROMISC: c_int = 0x0000000100; // Receive all packets ++pub const IFF_ALLMULTI: c_int = 0x0000000200; // Receive all multicast pkts ++pub const IFF_INTELLIGENT: c_int = 0x0000000400; // Protocol code on board ++pub const IFF_MULTICAST: c_int = 0x0000000800; // Supports multicast ++ ++// Multicast using broadcst. add. ++pub const IFF_MULTI_BCAST: c_int = 0x0000001000; ++pub const IFF_UNNUMBERED: c_int = 0x0000002000; // Non-unique address ++pub const IFF_DHCPRUNNING: c_int = 0x0000004000; // DHCP controls interface ++pub const IFF_PRIVATE: c_int = 0x0000008000; // Do not advertise ++pub const IFF_NOXMIT: c_int = 0x0000010000; // Do not transmit pkts ++ ++// No address - just on-link subnet ++pub const IFF_NOLOCAL: c_int = 0x0000020000; ++pub const IFF_DEPRECATED: c_int = 0x0000040000; // Address is deprecated ++pub const IFF_ADDRCONF: c_int = 0x0000080000; // Addr. from stateless addrconf ++pub const IFF_ROUTER: c_int = 0x0000100000; // Router on interface ++pub const IFF_NONUD: c_int = 0x0000200000; // No NUD on interface ++pub const IFF_ANYCAST: c_int = 0x0000400000; // Anycast address ++pub const IFF_NORTEXCH: c_int = 0x0000800000; // Don't xchange rout. info ++pub const IFF_IPV4: c_int = 0x0001000000; // IPv4 interface ++pub const IFF_IPV6: c_int = 0x0002000000; // IPv6 interface ++pub const IFF_NOFAILOVER: c_int = 0x0008000000; // in.mpathd test address ++pub const IFF_FAILED: c_int = 0x0010000000; // Interface has failed ++pub const IFF_STANDBY: c_int = 0x0020000000; // Interface is a hot-spare ++pub const IFF_INACTIVE: c_int = 0x0040000000; // Functioning but not used ++pub const IFF_OFFLINE: c_int = 0x0080000000; // Interface is offline ++ // If CoS marking is supported ++pub const IFF_COS_ENABLED: c_longlong = 0x0200000000; ++pub const IFF_PREFERRED: c_longlong = 0x0400000000; // Prefer as source addr. ++pub const IFF_TEMPORARY: c_longlong = 0x0800000000; // RFC3041 ++pub const IFF_FIXEDMTU: c_longlong = 0x1000000000; // MTU set with SIOCSLIFMTU ++pub const IFF_VIRTUAL: c_longlong = 0x2000000000; // Cannot send/receive pkts ++pub const IFF_DUPLICATE: c_longlong = 0x4000000000; // Local address in use ++pub const IFF_IPMP: c_longlong = 0x8000000000; // IPMP IP interface ++ ++// sys/ipc.h: ++pub const IPC_ALLOC: c_int = 0x8000; ++pub const IPC_CREAT: c_int = 0x200; ++pub const IPC_EXCL: c_int = 0x400; ++pub const IPC_NOWAIT: c_int = 0x800; ++pub const IPC_PRIVATE: key_t = 0; ++pub const IPC_RMID: c_int = 10; ++pub const IPC_SET: c_int = 11; ++pub const IPC_SEAT: c_int = 12; ++ ++// sys/shm.h ++pub const SHM_R: c_int = 0o400; ++pub const SHM_W: c_int = 0o200; ++pub const SHM_RDONLY: c_int = 0o10000; ++pub const SHM_RND: c_int = 0o20000; ++pub const SHM_SHARE_MMU: c_int = 0o40000; ++pub const SHM_PAGEABLE: c_int = 0o100000; ++ ++pub const SHUT_RD: c_int = 0; ++pub const SHUT_WR: c_int = 1; ++pub const SHUT_RDWR: c_int = 2; ++ ++pub const F_RDLCK: c_short = 1; ++pub const F_WRLCK: c_short = 2; ++pub const F_UNLCK: c_short = 3; ++ ++pub const O_SYNC: c_int = 16; ++pub const O_NONBLOCK: c_int = 128; ++ ++pub const IPPROTO_RAW: c_int = 255; ++ ++pub const _PC_LINK_MAX: c_int = 1; ++pub const _PC_MAX_CANON: c_int = 2; ++pub const _PC_MAX_INPUT: c_int = 3; ++pub const _PC_NAME_MAX: c_int = 4; ++pub const _PC_PATH_MAX: c_int = 5; ++pub const _PC_PIPE_BUF: c_int = 6; ++pub const _PC_NO_TRUNC: c_int = 7; ++pub const _PC_VDISABLE: c_int = 8; ++pub const _PC_CHOWN_RESTRICTED: c_int = 9; ++pub const _PC_ASYNC_IO: c_int = 10; ++pub const _PC_PRIO_IO: c_int = 11; ++pub const _PC_SYNC_IO: c_int = 12; ++pub const _PC_ALLOC_SIZE_MIN: c_int = 13; ++pub const _PC_REC_INCR_XFER_SIZE: c_int = 14; ++pub const _PC_REC_MAX_XFER_SIZE: c_int = 15; ++pub const _PC_REC_MIN_XFER_SIZE: c_int = 16; ++pub const _PC_REC_XFER_ALIGN: c_int = 17; ++pub const _PC_SYMLINK_MAX: c_int = 18; ++pub const _PC_2_SYMLINKS: c_int = 19; ++pub const _PC_ACL_ENABLED: c_int = 20; ++pub const _PC_MIN_HOLE_SIZE: c_int = 21; ++pub const _PC_CASE_BEHAVIOR: c_int = 22; ++pub const _PC_SATTR_ENABLED: c_int = 23; ++pub const _PC_SATTR_EXISTS: c_int = 24; ++pub const _PC_ACCESS_FILTERING: c_int = 25; ++pub const _PC_TIMESTAMP_RESOLUTION: c_int = 26; ++pub const _PC_FILESIZEBITS: c_int = 67; ++pub const _PC_XATTR_ENABLED: c_int = 100; ++pub const _PC_XATTR_EXISTS: c_int = 101; ++ ++pub const _POSIX_VDISABLE: crate::cc_t = 0; ++ ++pub const _SC_ARG_MAX: c_int = 1; ++pub const _SC_CHILD_MAX: c_int = 2; ++pub const _SC_CLK_TCK: c_int = 3; ++pub const _SC_NGROUPS_MAX: c_int = 4; ++pub const _SC_OPEN_MAX: c_int = 5; ++pub const _SC_JOB_CONTROL: c_int = 6; ++pub const _SC_SAVED_IDS: c_int = 7; ++pub const _SC_VERSION: c_int = 8; ++pub const _SC_PASS_MAX: c_int = 9; ++pub const _SC_LOGNAME_MAX: c_int = 10; ++pub const _SC_PAGESIZE: c_int = 11; ++pub const _SC_PAGE_SIZE: c_int = _SC_PAGESIZE; ++pub const _SC_XOPEN_VERSION: c_int = 12; ++pub const _SC_NPROCESSORS_CONF: c_int = 14; ++pub const _SC_NPROCESSORS_ONLN: c_int = 15; ++pub const _SC_STREAM_MAX: c_int = 16; ++pub const _SC_TZNAME_MAX: c_int = 17; ++pub const _SC_AIO_LISTIO_MAX: c_int = 18; ++pub const _SC_AIO_MAX: c_int = 19; ++pub const _SC_AIO_PRIO_DELTA_MAX: c_int = 20; ++pub const _SC_ASYNCHRONOUS_IO: c_int = 21; ++pub const _SC_DELAYTIMER_MAX: c_int = 22; ++pub const _SC_FSYNC: c_int = 23; ++pub const _SC_MAPPED_FILES: c_int = 24; ++pub const _SC_MEMLOCK: c_int = 25; ++pub const _SC_MEMLOCK_RANGE: c_int = 26; ++pub const _SC_MEMORY_PROTECTION: c_int = 27; ++pub const _SC_MESSAGE_PASSING: c_int = 28; ++pub const _SC_MQ_OPEN_MAX: c_int = 29; ++pub const _SC_MQ_PRIO_MAX: c_int = 30; ++pub const _SC_PRIORITIZED_IO: c_int = 31; ++pub const _SC_PRIORITY_SCHEDULING: c_int = 32; ++pub const _SC_REALTIME_SIGNALS: c_int = 33; ++pub const _SC_RTSIG_MAX: c_int = 34; ++pub const _SC_SEMAPHORES: c_int = 35; ++pub const _SC_SEM_NSEMS_MAX: c_int = 36; ++pub const _SC_SEM_VALUE_MAX: c_int = 37; ++pub const _SC_SHARED_MEMORY_OBJECTS: c_int = 38; ++pub const _SC_SIGQUEUE_MAX: c_int = 39; ++pub const _SC_SIGRT_MIN: c_int = 40; ++pub const _SC_SIGRT_MAX: c_int = 41; ++pub const _SC_SYNCHRONIZED_IO: c_int = 42; ++pub const _SC_TIMERS: c_int = 43; ++pub const _SC_TIMER_MAX: c_int = 44; ++pub const _SC_2_C_BIND: c_int = 45; ++pub const _SC_2_C_DEV: c_int = 46; ++pub const _SC_2_C_VERSION: c_int = 47; ++pub const _SC_2_FORT_DEV: c_int = 48; ++pub const _SC_2_FORT_RUN: c_int = 49; ++pub const _SC_2_LOCALEDEF: c_int = 50; ++pub const _SC_2_SW_DEV: c_int = 51; ++pub const _SC_2_UPE: c_int = 52; ++pub const _SC_2_VERSION: c_int = 53; ++pub const _SC_BC_BASE_MAX: c_int = 54; ++pub const _SC_BC_DIM_MAX: c_int = 55; ++pub const _SC_BC_SCALE_MAX: c_int = 56; ++pub const _SC_BC_STRING_MAX: c_int = 57; ++pub const _SC_COLL_WEIGHTS_MAX: c_int = 58; ++pub const _SC_EXPR_NEST_MAX: c_int = 59; ++pub const _SC_LINE_MAX: c_int = 60; ++pub const _SC_RE_DUP_MAX: c_int = 61; ++pub const _SC_XOPEN_CRYPT: c_int = 62; ++pub const _SC_XOPEN_ENH_I18N: c_int = 63; ++pub const _SC_XOPEN_SHM: c_int = 64; ++pub const _SC_2_CHAR_TERM: c_int = 66; ++pub const _SC_XOPEN_XCU_VERSION: c_int = 67; ++pub const _SC_ATEXIT_MAX: c_int = 76; ++pub const _SC_IOV_MAX: c_int = 77; ++pub const _SC_XOPEN_UNIX: c_int = 78; ++pub const _SC_T_IOV_MAX: c_int = 79; ++pub const _SC_PHYS_PAGES: c_int = 500; ++pub const _SC_AVPHYS_PAGES: c_int = 501; ++pub const _SC_COHER_BLKSZ: c_int = 503; ++pub const _SC_SPLIT_CACHE: c_int = 504; ++pub const _SC_ICACHE_SZ: c_int = 505; ++pub const _SC_DCACHE_SZ: c_int = 506; ++pub const _SC_ICACHE_LINESZ: c_int = 507; ++pub const _SC_DCACHE_LINESZ: c_int = 508; ++pub const _SC_ICACHE_BLKSZ: c_int = 509; ++pub const _SC_DCACHE_BLKSZ: c_int = 510; ++pub const _SC_DCACHE_TBLKSZ: c_int = 511; ++pub const _SC_ICACHE_ASSOC: c_int = 512; ++pub const _SC_DCACHE_ASSOC: c_int = 513; ++pub const _SC_MAXPID: c_int = 514; ++pub const _SC_STACK_PROT: c_int = 515; ++pub const _SC_NPROCESSORS_MAX: c_int = 516; ++pub const _SC_CPUID_MAX: c_int = 517; ++pub const _SC_EPHID_MAX: c_int = 518; ++pub const _SC_THREAD_DESTRUCTOR_ITERATIONS: c_int = 568; ++pub const _SC_GETGR_R_SIZE_MAX: c_int = 569; ++pub const _SC_GETPW_R_SIZE_MAX: c_int = 570; ++pub const _SC_LOGIN_NAME_MAX: c_int = 571; ++pub const _SC_THREAD_KEYS_MAX: c_int = 572; ++pub const _SC_THREAD_STACK_MIN: c_int = 573; ++pub const _SC_THREAD_THREADS_MAX: c_int = 574; ++pub const _SC_TTY_NAME_MAX: c_int = 575; ++pub const _SC_THREADS: c_int = 576; ++pub const _SC_THREAD_ATTR_STACKADDR: c_int = 577; ++pub const _SC_THREAD_ATTR_STACKSIZE: c_int = 578; ++pub const _SC_THREAD_PRIORITY_SCHEDULING: c_int = 579; ++pub const _SC_THREAD_PRIO_INHERIT: c_int = 580; ++pub const _SC_THREAD_PRIO_PROTECT: c_int = 581; ++pub const _SC_THREAD_PROCESS_SHARED: c_int = 582; ++pub const _SC_THREAD_SAFE_FUNCTIONS: c_int = 583; ++pub const _SC_XOPEN_LEGACY: c_int = 717; ++pub const _SC_XOPEN_REALTIME: c_int = 718; ++pub const _SC_XOPEN_REALTIME_THREADS: c_int = 719; ++pub const _SC_XBS5_ILP32_OFF32: c_int = 720; ++pub const _SC_XBS5_ILP32_OFFBIG: c_int = 721; ++pub const _SC_XBS5_LP64_OFF64: c_int = 722; ++pub const _SC_XBS5_LPBIG_OFFBIG: c_int = 723; ++pub const _SC_2_PBS: c_int = 724; ++pub const _SC_2_PBS_ACCOUNTING: c_int = 725; ++pub const _SC_2_PBS_CHECKPOINT: c_int = 726; ++pub const _SC_2_PBS_LOCATE: c_int = 728; ++pub const _SC_2_PBS_MESSAGE: c_int = 729; ++pub const _SC_2_PBS_TRACK: c_int = 730; ++pub const _SC_ADVISORY_INFO: c_int = 731; ++pub const _SC_BARRIERS: c_int = 732; ++pub const _SC_CLOCK_SELECTION: c_int = 733; ++pub const _SC_CPUTIME: c_int = 734; ++pub const _SC_HOST_NAME_MAX: c_int = 735; ++pub const _SC_MONOTONIC_CLOCK: c_int = 736; ++pub const _SC_READER_WRITER_LOCKS: c_int = 737; ++pub const _SC_REGEXP: c_int = 738; ++pub const _SC_SHELL: c_int = 739; ++pub const _SC_SPAWN: c_int = 740; ++pub const _SC_SPIN_LOCKS: c_int = 741; ++pub const _SC_SPORADIC_SERVER: c_int = 742; ++pub const _SC_SS_REPL_MAX: c_int = 743; ++pub const _SC_SYMLOOP_MAX: c_int = 744; ++pub const _SC_THREAD_CPUTIME: c_int = 745; ++pub const _SC_THREAD_SPORADIC_SERVER: c_int = 746; ++pub const _SC_TIMEOUTS: c_int = 747; ++pub const _SC_TRACE: c_int = 748; ++pub const _SC_TRACE_EVENT_FILTER: c_int = 749; ++pub const _SC_TRACE_EVENT_NAME_MAX: c_int = 750; ++pub const _SC_TRACE_INHERIT: c_int = 751; ++pub const _SC_TRACE_LOG: c_int = 752; ++pub const _SC_TRACE_NAME_MAX: c_int = 753; ++pub const _SC_TRACE_SYS_MAX: c_int = 754; ++pub const _SC_TRACE_USER_EVENT_MAX: c_int = 755; ++pub const _SC_TYPED_MEMORY_OBJECTS: c_int = 756; ++pub const _SC_V6_ILP32_OFF32: c_int = 757; ++pub const _SC_V6_ILP32_OFFBIG: c_int = 758; ++pub const _SC_V6_LP64_OFF64: c_int = 759; ++pub const _SC_V6_LPBIG_OFFBIG: c_int = 760; ++pub const _SC_XOPEN_STREAMS: c_int = 761; ++pub const _SC_IPV6: c_int = 762; ++pub const _SC_RAW_SOCKETS: c_int = 763; ++ ++pub const _ST_FSTYPSZ: c_int = 16; ++ ++pub const _MUTEX_MAGIC: u16 = 0x4d58; // MX ++pub const _COND_MAGIC: u16 = 0x4356; // CV ++pub const _RWL_MAGIC: u16 = 0x5257; // RW ++ ++pub const NCCS: usize = 19; ++ ++pub const LOG_CRON: c_int = 15 << 3; ++ ++pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { ++ __pthread_mutex_flag1: 0, ++ __pthread_mutex_flag2: 0, ++ __pthread_mutex_ceiling: 0, ++ __pthread_mutex_type: PTHREAD_PROCESS_PRIVATE, ++ __pthread_mutex_magic: _MUTEX_MAGIC, ++ __pthread_mutex_lock: 0, ++ __pthread_mutex_data: 0, ++}; ++pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { ++ __pthread_cond_flag: [0; 4], ++ __pthread_cond_type: PTHREAD_PROCESS_PRIVATE, ++ __pthread_cond_magic: _COND_MAGIC, ++ __pthread_cond_data: 0, ++}; ++pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { ++ __pthread_rwlock_readers: 0, ++ __pthread_rwlock_type: PTHREAD_PROCESS_PRIVATE, ++ __pthread_rwlock_magic: _RWL_MAGIC, ++ __pthread_rwlock_mutex: PTHREAD_MUTEX_INITIALIZER, ++ __pthread_rwlock_readercv: PTHREAD_COND_INITIALIZER, ++ __pthread_rwlock_writercv: PTHREAD_COND_INITIALIZER, ++}; ++pub const PTHREAD_MUTEX_NORMAL: c_int = 0; ++pub const PTHREAD_MUTEX_ERRORCHECK: c_int = 2; ++pub const PTHREAD_MUTEX_RECURSIVE: c_int = 4; ++pub const PTHREAD_MUTEX_DEFAULT: c_int = crate::PTHREAD_MUTEX_NORMAL; ++ ++pub const RTLD_NEXT: *mut c_void = -1isize as *mut c_void; ++pub const RTLD_DEFAULT: *mut c_void = -2isize as *mut c_void; ++pub const RTLD_SELF: *mut c_void = -3isize as *mut c_void; ++pub const RTLD_PROBE: *mut c_void = -4isize as *mut c_void; ++ ++pub const RTLD_LAZY: c_int = 0x1; ++pub const RTLD_NOW: c_int = 0x2; ++pub const RTLD_NOLOAD: c_int = 0x4; ++pub const RTLD_GLOBAL: c_int = 0x100; ++pub const RTLD_LOCAL: c_int = 0x0; ++pub const RTLD_PARENT: c_int = 0x200; ++pub const RTLD_GROUP: c_int = 0x400; ++pub const RTLD_WORLD: c_int = 0x800; ++pub const RTLD_NODELETE: c_int = 0x1000; ++pub const RTLD_FIRST: c_int = 0x2000; ++pub const RTLD_CONFGEN: c_int = 0x10000; ++ ++pub const PORT_SOURCE_AIO: c_int = 1; ++pub const PORT_SOURCE_TIMER: c_int = 2; ++pub const PORT_SOURCE_USER: c_int = 3; ++pub const PORT_SOURCE_FD: c_int = 4; ++pub const PORT_SOURCE_ALERT: c_int = 5; ++pub const PORT_SOURCE_MQ: c_int = 6; ++pub const PORT_SOURCE_FILE: c_int = 7; ++ ++pub const NONROOT_USR: c_short = 2; ++ ++pub const EMPTY: c_short = 0; ++pub const RUN_LVL: c_short = 1; ++pub const BOOT_TIME: c_short = 2; ++pub const OLD_TIME: c_short = 3; ++pub const NEW_TIME: c_short = 4; ++pub const INIT_PROCESS: c_short = 5; ++pub const LOGIN_PROCESS: c_short = 6; ++pub const USER_PROCESS: c_short = 7; ++pub const DEAD_PROCESS: c_short = 8; ++pub const ACCOUNTING: c_short = 9; ++pub const DOWN_TIME: c_short = 10; ++ ++const _TIOC: c_int = ('T' as i32) << 8; ++const tIOC: c_int = ('t' as i32) << 8; ++pub const TCGETA: c_int = _TIOC | 1; ++pub const TCSETA: c_int = _TIOC | 2; ++pub const TCSETAW: c_int = _TIOC | 3; ++pub const TCSETAF: c_int = _TIOC | 4; ++pub const TCSBRK: c_int = _TIOC | 5; ++pub const TCXONC: c_int = _TIOC | 6; ++pub const TCFLSH: c_int = _TIOC | 7; ++pub const TCDSET: c_int = _TIOC | 32; ++pub const TCGETS: c_int = _TIOC | 13; ++pub const TCSETS: c_int = _TIOC | 14; ++pub const TCSANOW: c_int = _TIOC | 14; ++pub const TCSETSW: c_int = _TIOC | 15; ++pub const TCSADRAIN: c_int = _TIOC | 15; ++pub const TCSETSF: c_int = _TIOC | 16; ++pub const TCSAFLUSH: c_int = _TIOC | 16; ++pub const TCIFLUSH: c_int = 0; ++pub const TCOFLUSH: c_int = 1; ++pub const TCIOFLUSH: c_int = 2; ++pub const TCOOFF: c_int = 0; ++pub const TCOON: c_int = 1; ++pub const TCIOFF: c_int = 2; ++pub const TCION: c_int = 3; ++pub const TIOC: c_int = _TIOC; ++pub const TIOCKBON: c_int = _TIOC | 8; ++pub const TIOCKBOF: c_int = _TIOC | 9; ++pub const TIOCGWINSZ: c_int = _TIOC | 104; ++pub const TIOCSWINSZ: c_int = _TIOC | 103; ++pub const TIOCGSOFTCAR: c_int = _TIOC | 105; ++pub const TIOCSSOFTCAR: c_int = _TIOC | 106; ++pub const TIOCGPPS: c_int = _TIOC | 125; ++pub const TIOCSPPS: c_int = _TIOC | 126; ++pub const TIOCGPPSEV: c_int = _TIOC | 127; ++pub const TIOCGETD: c_int = tIOC | 0; ++pub const TIOCSETD: c_int = tIOC | 1; ++pub const TIOCHPCL: c_int = tIOC | 2; ++pub const TIOCGETP: c_int = tIOC | 8; ++pub const TIOCSETP: c_int = tIOC | 9; ++pub const TIOCSETN: c_int = tIOC | 10; ++pub const TIOCEXCL: c_int = tIOC | 13; ++pub const TIOCNXCL: c_int = tIOC | 14; ++pub const TIOCFLUSH: c_int = tIOC | 16; ++pub const TIOCSETC: c_int = tIOC | 17; ++pub const TIOCGETC: c_int = tIOC | 18; ++pub const TIOCLBIS: c_int = tIOC | 127; ++pub const TIOCLBIC: c_int = tIOC | 126; ++pub const TIOCLSET: c_int = tIOC | 125; ++pub const TIOCLGET: c_int = tIOC | 124; ++pub const TIOCSBRK: c_int = tIOC | 123; ++pub const TIOCCBRK: c_int = tIOC | 122; ++pub const TIOCSDTR: c_int = tIOC | 121; ++pub const TIOCCDTR: c_int = tIOC | 120; ++pub const TIOCSLTC: c_int = tIOC | 117; ++pub const TIOCGLTC: c_int = tIOC | 116; ++pub const TIOCOUTQ: c_int = tIOC | 115; ++pub const TIOCNOTTY: c_int = tIOC | 113; ++pub const TIOCSCTTY: c_int = tIOC | 132; ++pub const TIOCSTOP: c_int = tIOC | 111; ++pub const TIOCSTART: c_int = tIOC | 110; ++pub const TIOCSILOOP: c_int = tIOC | 109; ++pub const TIOCCILOOP: c_int = tIOC | 108; ++pub const TIOCGPGRP: c_int = tIOC | 20; ++pub const TIOCSPGRP: c_int = tIOC | 21; ++pub const TIOCGSID: c_int = tIOC | 22; ++pub const TIOCSTI: c_int = tIOC | 23; ++pub const TIOCMSET: c_int = tIOC | 26; ++pub const TIOCMBIS: c_int = tIOC | 27; ++pub const TIOCMBIC: c_int = tIOC | 28; ++pub const TIOCMGET: c_int = tIOC | 29; ++pub const TIOCREMOTE: c_int = tIOC | 30; ++pub const TIOCSIGNAL: c_int = tIOC | 31; ++ ++pub const TIOCM_LE: c_int = 0o0001; ++pub const TIOCM_DTR: c_int = 0o0002; ++pub const TIOCM_RTS: c_int = 0o0004; ++pub const TIOCM_ST: c_int = 0o0010; ++pub const TIOCM_SR: c_int = 0o0020; ++pub const TIOCM_CTS: c_int = 0o0040; ++pub const TIOCM_CAR: c_int = 0o0100; ++pub const TIOCM_CD: c_int = TIOCM_CAR; ++pub const TIOCM_RNG: c_int = 0o0200; ++pub const TIOCM_RI: c_int = TIOCM_RNG; ++pub const TIOCM_DSR: c_int = 0o0400; ++ ++/* termios */ ++pub const B0: speed_t = 0; ++pub const B50: speed_t = 1; ++pub const B75: speed_t = 2; ++pub const B110: speed_t = 3; ++pub const B134: speed_t = 4; ++pub const B150: speed_t = 5; ++pub const B200: speed_t = 6; ++pub const B300: speed_t = 7; ++pub const B600: speed_t = 8; ++pub const B1200: speed_t = 9; ++pub const B1800: speed_t = 10; ++pub const B2400: speed_t = 11; ++pub const B4800: speed_t = 12; ++pub const B9600: speed_t = 13; ++pub const B19200: speed_t = 14; ++pub const B38400: speed_t = 15; ++pub const B57600: speed_t = 16; ++pub const B76800: speed_t = 17; ++pub const B115200: speed_t = 18; ++pub const B153600: speed_t = 19; ++pub const B230400: speed_t = 20; ++pub const B307200: speed_t = 21; ++pub const B460800: speed_t = 22; ++pub const B921600: speed_t = 23; ++pub const CSTART: crate::tcflag_t = 0o21; ++pub const CSTOP: crate::tcflag_t = 0o23; ++pub const CSWTCH: crate::tcflag_t = 0o32; ++pub const CBAUD: crate::tcflag_t = 0o17; ++pub const CIBAUD: crate::tcflag_t = 0o3600000; ++pub const CBAUDEXT: crate::tcflag_t = 0o10000000; ++pub const CIBAUDEXT: crate::tcflag_t = 0o20000000; ++pub const CSIZE: crate::tcflag_t = 0o000060; ++pub const CS5: crate::tcflag_t = 0; ++pub const CS6: crate::tcflag_t = 0o000020; ++pub const CS7: crate::tcflag_t = 0o000040; ++pub const CS8: crate::tcflag_t = 0o000060; ++pub const CSTOPB: crate::tcflag_t = 0o000100; ++pub const ECHO: crate::tcflag_t = 0o000010; ++pub const ECHOE: crate::tcflag_t = 0o000020; ++pub const ECHOK: crate::tcflag_t = 0o000040; ++pub const ECHONL: crate::tcflag_t = 0o000100; ++pub const ECHOCTL: crate::tcflag_t = 0o001000; ++pub const ECHOPRT: crate::tcflag_t = 0o002000; ++pub const ECHOKE: crate::tcflag_t = 0o004000; ++pub const EXTPROC: crate::tcflag_t = 0o200000; ++pub const IGNBRK: crate::tcflag_t = 0o000001; ++pub const BRKINT: crate::tcflag_t = 0o000002; ++pub const IGNPAR: crate::tcflag_t = 0o000004; ++pub const PARMRK: crate::tcflag_t = 0o000010; ++pub const INPCK: crate::tcflag_t = 0o000020; ++pub const ISTRIP: crate::tcflag_t = 0o000040; ++pub const INLCR: crate::tcflag_t = 0o000100; ++pub const IGNCR: crate::tcflag_t = 0o000200; ++pub const ICRNL: crate::tcflag_t = 0o000400; ++pub const IUCLC: crate::tcflag_t = 0o001000; ++pub const IXON: crate::tcflag_t = 0o002000; ++pub const IXOFF: crate::tcflag_t = 0o010000; ++pub const IXANY: crate::tcflag_t = 0o004000; ++pub const IMAXBEL: crate::tcflag_t = 0o020000; ++pub const DOSMODE: crate::tcflag_t = 0o100000; ++pub const OPOST: crate::tcflag_t = 0o000001; ++pub const OLCUC: crate::tcflag_t = 0o000002; ++pub const ONLCR: crate::tcflag_t = 0o000004; ++pub const OCRNL: crate::tcflag_t = 0o000010; ++pub const ONOCR: crate::tcflag_t = 0o000020; ++pub const ONLRET: crate::tcflag_t = 0o000040; ++pub const OFILL: crate::tcflag_t = 0o0000100; ++pub const OFDEL: crate::tcflag_t = 0o0000200; ++pub const CREAD: crate::tcflag_t = 0o000200; ++pub const PARENB: crate::tcflag_t = 0o000400; ++pub const PARODD: crate::tcflag_t = 0o001000; ++pub const HUPCL: crate::tcflag_t = 0o002000; ++pub const CLOCAL: crate::tcflag_t = 0o004000; ++pub const CRTSXOFF: crate::tcflag_t = 0o10000000000; ++pub const CRTSCTS: crate::tcflag_t = 0o20000000000; ++pub const ISIG: crate::tcflag_t = 0o000001; ++pub const ICANON: crate::tcflag_t = 0o000002; ++pub const IEXTEN: crate::tcflag_t = 0o100000; ++pub const TOSTOP: crate::tcflag_t = 0o000400; ++pub const FLUSHO: crate::tcflag_t = 0o020000; ++pub const PENDIN: crate::tcflag_t = 0o040000; ++pub const NOFLSH: crate::tcflag_t = 0o000200; ++pub const VINTR: usize = 0; ++pub const VQUIT: usize = 1; ++pub const VERASE: usize = 2; ++pub const VKILL: usize = 3; ++pub const VEOF: usize = 4; ++pub const VEOL: usize = 5; ++pub const VEOL2: usize = 6; ++pub const VMIN: usize = 4; ++pub const VTIME: usize = 5; ++pub const VSWTCH: usize = 7; ++pub const VSTART: usize = 8; ++pub const VSTOP: usize = 9; ++pub const VSUSP: usize = 10; ++pub const VDSUSP: usize = 11; ++pub const VREPRINT: usize = 12; ++pub const VDISCARD: usize = 13; ++pub const VWERASE: usize = 14; ++pub const VLNEXT: usize = 15; ++ ++// ++const STR: c_int = (b'S' as c_int) << 8; ++pub const I_NREAD: c_int = STR | 0o1; ++pub const I_PUSH: c_int = STR | 0o2; ++pub const I_POP: c_int = STR | 0o3; ++pub const I_LOOK: c_int = STR | 0o4; ++pub const I_FLUSH: c_int = STR | 0o5; ++pub const I_SRDOPT: c_int = STR | 0o6; ++pub const I_GRDOPT: c_int = STR | 0o7; ++pub const I_STR: c_int = STR | 0o10; ++pub const I_SETSIG: c_int = STR | 0o11; ++pub const I_GETSIG: c_int = STR | 0o12; ++pub const I_FIND: c_int = STR | 0o13; ++pub const I_LINK: c_int = STR | 0o14; ++pub const I_UNLINK: c_int = STR | 0o15; ++pub const I_PEEK: c_int = STR | 0o17; ++pub const I_FDINSERT: c_int = STR | 0o20; ++pub const I_SENDFD: c_int = STR | 0o21; ++pub const I_RECVFD: c_int = STR | 0o16; ++pub const I_SWROPT: c_int = STR | 0o23; ++pub const I_GWROPT: c_int = STR | 0o24; ++pub const I_LIST: c_int = STR | 0o25; ++pub const I_PLINK: c_int = STR | 0o26; ++pub const I_PUNLINK: c_int = STR | 0o27; ++pub const I_ANCHOR: c_int = STR | 0o30; ++pub const I_FLUSHBAND: c_int = STR | 0o34; ++pub const I_CKBAND: c_int = STR | 0o35; ++pub const I_GETBAND: c_int = STR | 0o36; ++pub const I_ATMARK: c_int = STR | 0o37; ++pub const I_SETCLTIME: c_int = STR | 0o40; ++pub const I_GETCLTIME: c_int = STR | 0o41; ++pub const I_CANPUT: c_int = STR | 0o42; ++pub const I_SERROPT: c_int = STR | 0o43; ++pub const I_GERROPT: c_int = STR | 0o44; ++pub const I_ESETSIG: c_int = STR | 0o45; ++pub const I_EGETSIG: c_int = STR | 0o46; ++pub const __I_PUSH_NOCTTY: c_int = STR | 0o47; ++ ++// 3SOCKET flags ++pub const SOCK_CLOEXEC: c_int = 0x080000; ++pub const SOCK_NONBLOCK: c_int = 0x100000; ++pub const SOCK_NDELAY: c_int = 0x200000; ++ ++// ++pub const SCALE_KG: c_int = 1 << 6; ++pub const SCALE_KF: c_int = 1 << 16; ++pub const SCALE_KH: c_int = 1 << 2; ++pub const MAXTC: c_int = 1 << 6; ++pub const SCALE_PHASE: c_int = 1 << 22; ++pub const SCALE_USEC: c_int = 1 << 16; ++pub const SCALE_UPDATE: c_int = SCALE_KG * MAXTC; ++pub const FINEUSEC: c_int = 1 << 22; ++pub const MAXPHASE: c_int = 512000; ++pub const MAXFREQ: c_int = 512 * SCALE_USEC; ++pub const MAXTIME: c_int = 200 << PPS_AVG; ++pub const MINSEC: c_int = 16; ++pub const MAXSEC: c_int = 1200; ++pub const PPS_AVG: c_int = 2; ++pub const PPS_SHIFT: c_int = 2; ++pub const PPS_SHIFTMAX: c_int = 8; ++pub const PPS_VALID: c_int = 120; ++pub const MAXGLITCH: c_int = 30; ++pub const MOD_OFFSET: u32 = 0x0001; ++pub const MOD_FREQUENCY: u32 = 0x0002; ++pub const MOD_MAXERROR: u32 = 0x0004; ++pub const MOD_ESTERROR: u32 = 0x0008; ++pub const MOD_STATUS: u32 = 0x0010; ++pub const MOD_TIMECONST: u32 = 0x0020; ++pub const MOD_CLKB: u32 = 0x4000; ++pub const MOD_CLKA: u32 = 0x8000; ++pub const STA_PLL: u32 = 0x0001; ++pub const STA_PPSFREQ: i32 = 0x0002; ++pub const STA_PPSTIME: i32 = 0x0004; ++pub const STA_FLL: i32 = 0x0008; ++pub const STA_INS: i32 = 0x0010; ++pub const STA_DEL: i32 = 0x0020; ++pub const STA_UNSYNC: i32 = 0x0040; ++pub const STA_FREQHOLD: i32 = 0x0080; ++pub const STA_PPSSIGNAL: i32 = 0x0100; ++pub const STA_PPSJITTER: i32 = 0x0200; ++pub const STA_PPSWANDER: i32 = 0x0400; ++pub const STA_PPSERROR: i32 = 0x0800; ++pub const STA_CLOCKERR: i32 = 0x1000; ++pub const STA_RONLY: i32 = ++ STA_PPSSIGNAL | STA_PPSJITTER | STA_PPSWANDER | STA_PPSERROR | STA_CLOCKERR; ++pub const TIME_OK: i32 = 0; ++pub const TIME_INS: i32 = 1; ++pub const TIME_DEL: i32 = 2; ++pub const TIME_OOP: i32 = 3; ++pub const TIME_WAIT: i32 = 4; ++pub const TIME_ERROR: i32 = 5; ++ ++pub const PRIO_PROCESS: c_int = 0; ++pub const PRIO_PGRP: c_int = 1; ++pub const PRIO_USER: c_int = 2; ++ ++pub const SCHED_OTHER: c_int = 0; ++pub const SCHED_FIFO: c_int = 1; ++pub const SCHED_RR: c_int = 2; ++pub const SCHED_SYS: c_int = 3; ++pub const SCHED_IA: c_int = 4; ++pub const SCHED_FSS: c_int = 5; ++pub const SCHED_FX: c_int = 6; ++ ++// sys/priv.h ++pub const PRIV_DEBUG: c_uint = 0x0001; ++pub const PRIV_AWARE: c_uint = 0x0002; ++pub const PRIV_AWARE_INHERIT: c_uint = 0x0004; ++pub const __PROC_PROTECT: c_uint = 0x0008; ++pub const NET_MAC_AWARE: c_uint = 0x0010; ++pub const NET_MAC_AWARE_INHERIT: c_uint = 0x0020; ++pub const PRIV_AWARE_RESET: c_uint = 0x0040; ++pub const PRIV_XPOLICY: c_uint = 0x0080; ++pub const PRIV_PFEXEC: c_uint = 0x0100; ++ ++// sys/systeminfo.h ++pub const SI_SYSNAME: c_int = 1; ++pub const SI_HOSTNAME: c_int = 2; ++pub const SI_RELEASE: c_int = 3; ++pub const SI_VERSION: c_int = 4; ++pub const SI_MACHINE: c_int = 5; ++pub const SI_ARCHITECTURE: c_int = 6; ++pub const SI_HW_SERIAL: c_int = 7; ++pub const SI_HW_PROVIDER: c_int = 8; ++pub const SI_SET_HOSTNAME: c_int = 258; ++pub const SI_SET_SRPC_DOMAIN: c_int = 265; ++pub const SI_PLATFORM: c_int = 513; ++pub const SI_ISALIST: c_int = 514; ++pub const SI_DHCP_CACHE: c_int = 515; ++pub const SI_ARCHITECTURE_32: c_int = 516; ++pub const SI_ARCHITECTURE_64: c_int = 517; ++pub const SI_ARCHITECTURE_K: c_int = 518; ++pub const SI_ARCHITECTURE_NATIVE: c_int = 519; ++ ++// sys/lgrp_user.h ++pub const LGRP_COOKIE_NONE: crate::lgrp_cookie_t = 0; ++pub const LGRP_AFF_NONE: crate::lgrp_affinity_t = 0x0; ++pub const LGRP_AFF_WEAK: crate::lgrp_affinity_t = 0x10; ++pub const LGRP_AFF_STRONG: crate::lgrp_affinity_t = 0x100; ++pub const LGRP_CONTENT_ALL: crate::lgrp_content_t = 0; ++pub const LGRP_CONTENT_HIERARCHY: crate::lgrp_content_t = LGRP_CONTENT_ALL; ++pub const LGRP_CONTENT_DIRECT: crate::lgrp_content_t = 1; ++pub const LGRP_LAT_CPU_TO_MEM: crate::lgrp_lat_between_t = 0; ++pub const LGRP_MEM_SZ_FREE: crate::lgrp_mem_size_flag_t = 0; ++pub const LGRP_MEM_SZ_INSTALLED: crate::lgrp_mem_size_flag_t = 1; ++pub const LGRP_VIEW_CALLER: crate::lgrp_view_t = 0; ++pub const LGRP_VIEW_OS: crate::lgrp_view_t = 1; ++ ++// sys/processor.h ++ ++pub const P_OFFLINE: c_int = 0x001; ++pub const P_ONLINE: c_int = 0x002; ++pub const P_STATUS: c_int = 0x003; ++pub const P_FAULTED: c_int = 0x004; ++pub const P_POWEROFF: c_int = 0x005; ++pub const P_NOINTR: c_int = 0x006; ++pub const P_SPARE: c_int = 0x007; ++pub const P_FORCED: c_int = 0x10000000; ++pub const PI_TYPELEN: c_int = 16; ++pub const PI_FPUTYPE: c_int = 32; ++ ++// sys/auxv.h ++pub const AT_SUN_HWCAP: c_uint = 2009; ++ ++// As per sys/socket.h, header alignment must be 8 bytes on SPARC ++// and 4 bytes everywhere else: ++#[cfg(target_arch = "sparc64")] ++const _CMSG_HDR_ALIGNMENT: usize = 8; ++#[cfg(not(target_arch = "sparc64"))] ++const _CMSG_HDR_ALIGNMENT: usize = 4; ++ ++const _CMSG_DATA_ALIGNMENT: usize = size_of::(); ++ ++const NEWDEV: c_int = 1; ++ ++// sys/sendfile.h ++pub const SFV_FD_SELF: c_int = -2; ++ ++const_fn! { ++ {const} fn _CMSG_HDR_ALIGN(p: usize) -> usize { ++ (p + _CMSG_HDR_ALIGNMENT - 1) & !(_CMSG_HDR_ALIGNMENT - 1) ++ } ++ ++ {const} fn _CMSG_DATA_ALIGN(p: usize) -> usize { ++ (p + _CMSG_DATA_ALIGNMENT - 1) & !(_CMSG_DATA_ALIGNMENT - 1) ++ } ++} ++ ++f! { ++ pub fn CMSG_DATA(cmsg: *const cmsghdr) -> *mut c_uchar { ++ _CMSG_DATA_ALIGN(cmsg.offset(1) as usize) as *mut c_uchar ++ } ++ ++ pub {const} fn CMSG_LEN(length: c_uint) -> c_uint { ++ _CMSG_DATA_ALIGN(mem::size_of::()) as c_uint + length ++ } ++ ++ pub fn CMSG_FIRSTHDR(mhdr: *const crate::msghdr) -> *mut cmsghdr { ++ if ((*mhdr).msg_controllen as usize) < size_of::() { ++ 0 as *mut cmsghdr ++ } else { ++ (*mhdr).msg_control as *mut cmsghdr ++ } ++ } ++ ++ pub fn CMSG_NXTHDR(mhdr: *const crate::msghdr, cmsg: *const cmsghdr) -> *mut cmsghdr { ++ if cmsg.is_null() { ++ return crate::CMSG_FIRSTHDR(mhdr); ++ }; ++ let next = ++ _CMSG_HDR_ALIGN(cmsg as usize + (*cmsg).cmsg_len as usize + size_of::()); ++ let max = (*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize; ++ if next > max { ++ 0 as *mut cmsghdr ++ } else { ++ _CMSG_HDR_ALIGN(cmsg as usize + (*cmsg).cmsg_len as usize) as *mut cmsghdr ++ } ++ } ++ ++ pub {const} fn CMSG_SPACE(length: c_uint) -> c_uint { ++ _CMSG_HDR_ALIGN(size_of::() as usize + length as usize) as c_uint ++ } ++ ++ pub fn FD_CLR(fd: c_int, set: *mut fd_set) -> () { ++ let bits = mem::size_of_val(&(*set).fds_bits[0]) * 8; ++ let fd = fd as usize; ++ (*set).fds_bits[fd / bits] &= !(1 << (fd % bits)); ++ return; ++ } ++ ++ pub fn FD_ISSET(fd: c_int, set: *const fd_set) -> bool { ++ let bits = mem::size_of_val(&(*set).fds_bits[0]) * 8; ++ let fd = fd as usize; ++ return ((*set).fds_bits[fd / bits] & (1 << (fd % bits))) != 0; ++ } ++ ++ pub fn FD_SET(fd: c_int, set: *mut fd_set) -> () { ++ let bits = mem::size_of_val(&(*set).fds_bits[0]) * 8; ++ let fd = fd as usize; ++ (*set).fds_bits[fd / bits] |= 1 << (fd % bits); ++ return; ++ } ++ ++ pub fn FD_ZERO(set: *mut fd_set) -> () { ++ for slot in (*set).fds_bits.iter_mut() { ++ *slot = 0; ++ } ++ } ++} ++ ++safe_f! { ++ pub fn SIGRTMAX() -> c_int { ++ unsafe { crate::sysconf(_SC_SIGRT_MAX) as c_int } ++ } ++ ++ pub fn SIGRTMIN() -> c_int { ++ unsafe { crate::sysconf(_SC_SIGRT_MIN) as c_int } ++ } ++ ++ pub {const} fn WIFEXITED(status: c_int) -> bool { ++ (status & 0xFF) == 0 ++ } ++ ++ pub {const} fn WEXITSTATUS(status: c_int) -> c_int { ++ (status >> 8) & 0xFF ++ } ++ ++ pub {const} fn WTERMSIG(status: c_int) -> c_int { ++ status & 0x7F ++ } ++ ++ pub {const} fn WIFCONTINUED(status: c_int) -> bool { ++ (status & 0xffff) == 0xffff ++ } ++ ++ pub {const} fn WSTOPSIG(status: c_int) -> c_int { ++ (status & 0xff00) >> 8 ++ } ++ ++ pub {const} fn WIFSIGNALED(status: c_int) -> bool { ++ ((status & 0xff) > 0) && (status & 0xff00 == 0) ++ } ++ ++ pub {const} fn WIFSTOPPED(status: c_int) -> bool { ++ ((status & 0xff) == 0x7f) && ((status & 0xff00) != 0) ++ } ++ ++ pub {const} fn WCOREDUMP(status: c_int) -> bool { ++ (status & 0x80) != 0 ++ } ++ ++ pub {const} fn MR_GET_TYPE(flags: c_uint) -> c_uint { ++ flags & 0x0000ffff ++ } ++} ++ ++extern "C" { ++ pub fn getrlimit(resource: c_int, rlim: *mut crate::rlimit) -> c_int; ++ pub fn setrlimit(resource: c_int, rlim: *const crate::rlimit) -> c_int; ++ ++ pub fn strerror_r(errnum: c_int, buf: *mut c_char, buflen: size_t) -> c_int; ++ ++ pub fn sem_destroy(sem: *mut sem_t) -> c_int; ++ pub fn sem_init(sem: *mut sem_t, pshared: c_int, value: c_uint) -> c_int; ++ ++ pub fn abs(i: c_int) -> c_int; ++ pub fn acct(filename: *const c_char) -> c_int; ++ pub fn dirfd(dirp: *mut crate::DIR) -> c_int; ++ pub fn labs(i: c_long) -> c_long; ++ pub fn rand() -> c_int; ++ pub fn srand(seed: c_uint); ++ pub fn getentropy(buf: *mut c_void, buflen: size_t) -> c_int; ++ pub fn getrandom(bbuf: *mut c_void, buflen: size_t, flags: c_uint) -> ssize_t; ++ ++ pub fn gettimeofday(tp: *mut crate::timeval, tz: *mut c_void) -> c_int; ++ pub fn settimeofday(tp: *const crate::timeval, tz: *const c_void) -> c_int; ++ pub fn getifaddrs(ifap: *mut *mut crate::ifaddrs) -> c_int; ++ pub fn freeifaddrs(ifa: *mut crate::ifaddrs); ++ ++ pub fn stack_getbounds(sp: *mut crate::stack_t) -> c_int; ++ pub fn getgrouplist( ++ name: *const c_char, ++ basegid: crate::gid_t, ++ groups: *mut crate::gid_t, ++ ngroups: *mut c_int, ++ ) -> c_int; ++ pub fn initgroups(name: *const c_char, basegid: crate::gid_t) -> c_int; ++ pub fn setgroups(ngroups: c_int, ptr: *const crate::gid_t) -> c_int; ++ pub fn ioctl(fildes: c_int, request: c_int, ...) -> c_int; ++ pub fn mprotect(addr: *mut c_void, len: size_t, prot: c_int) -> c_int; ++ pub fn ___errno() -> *mut c_int; ++ pub fn clock_getres(clk_id: crate::clockid_t, tp: *mut crate::timespec) -> c_int; ++ pub fn clock_gettime(clk_id: crate::clockid_t, tp: *mut crate::timespec) -> c_int; ++ pub fn clock_nanosleep( ++ clk_id: crate::clockid_t, ++ flags: c_int, ++ rqtp: *const crate::timespec, ++ rmtp: *mut crate::timespec, ++ ) -> c_int; ++ pub fn clock_settime(clk_id: crate::clockid_t, tp: *const crate::timespec) -> c_int; ++ pub fn getnameinfo( ++ sa: *const crate::sockaddr, ++ salen: crate::socklen_t, ++ host: *mut c_char, ++ hostlen: crate::socklen_t, ++ serv: *mut c_char, ++ servlen: crate::socklen_t, ++ flags: c_int, ++ ) -> c_int; ++ pub fn setpwent(); ++ pub fn endpwent(); ++ pub fn getpwent() -> *mut passwd; ++ pub fn fdatasync(fd: c_int) -> c_int; ++ pub fn nl_langinfo_l(item: crate::nl_item, locale: crate::locale_t) -> *mut c_char; ++ pub fn duplocale(base: crate::locale_t) -> crate::locale_t; ++ pub fn freelocale(loc: crate::locale_t); ++ pub fn newlocale(mask: c_int, locale: *const c_char, base: crate::locale_t) -> crate::locale_t; ++ pub fn uselocale(loc: crate::locale_t) -> crate::locale_t; ++ pub fn getprogname() -> *const c_char; ++ pub fn setprogname(name: *const c_char); ++ pub fn getloadavg(loadavg: *mut c_double, nelem: c_int) -> c_int; ++ pub fn getpriority(which: c_int, who: c_int) -> c_int; ++ pub fn setpriority(which: c_int, who: c_int, prio: c_int) -> c_int; ++ ++ pub fn mknodat(dirfd: c_int, pathname: *const c_char, mode: crate::mode_t, dev: dev_t) ++ -> c_int; ++ pub fn mkfifoat(dirfd: c_int, pathname: *const c_char, mode: crate::mode_t) -> c_int; ++ pub fn sethostname(name: *const c_char, len: c_int) -> c_int; ++ pub fn if_nameindex() -> *mut if_nameindex; ++ pub fn if_freenameindex(ptr: *mut if_nameindex); ++ pub fn pthread_create( ++ native: *mut crate::pthread_t, ++ attr: *const crate::pthread_attr_t, ++ f: extern "C" fn(*mut c_void) -> *mut c_void, ++ value: *mut c_void, ++ ) -> c_int; ++ pub fn pthread_attr_getstack( ++ attr: *const crate::pthread_attr_t, ++ stackaddr: *mut *mut c_void, ++ stacksize: *mut size_t, ++ ) -> c_int; ++ pub fn pthread_condattr_getclock( ++ attr: *const pthread_condattr_t, ++ clock_id: *mut clockid_t, ++ ) -> c_int; ++ pub fn pthread_condattr_setclock( ++ attr: *mut pthread_condattr_t, ++ clock_id: crate::clockid_t, ++ ) -> c_int; ++ pub fn sem_timedwait(sem: *mut sem_t, abstime: *const crate::timespec) -> c_int; ++ pub fn sem_getvalue(sem: *mut sem_t, sval: *mut c_int) -> c_int; ++ pub fn pthread_mutex_timedlock( ++ lock: *mut pthread_mutex_t, ++ abstime: *const crate::timespec, ++ ) -> c_int; ++ pub fn pthread_getname_np(tid: crate::pthread_t, name: *mut c_char, len: size_t) -> c_int; ++ pub fn pthread_setname_np(tid: crate::pthread_t, name: *const c_char) -> c_int; ++ pub fn waitid( ++ idtype: idtype_t, ++ id: id_t, ++ infop: *mut crate::siginfo_t, ++ options: c_int, ++ ) -> c_int; ++ ++ #[cfg_attr(target_os = "illumos", link_name = "_glob_ext")] ++ pub fn glob( ++ pattern: *const c_char, ++ flags: c_int, ++ errfunc: Option c_int>, ++ pglob: *mut crate::glob_t, ++ ) -> c_int; ++ ++ #[cfg_attr(target_os = "illumos", link_name = "_globfree_ext")] ++ pub fn globfree(pglob: *mut crate::glob_t); ++ ++ pub fn posix_fallocate(fd: c_int, offset: off_t, len: off_t) -> c_int; ++ pub fn posix_madvise(addr: *mut c_void, len: size_t, advice: c_int) -> c_int; ++ ++ pub fn shmat(shmid: c_int, shmaddr: *const c_void, shmflg: c_int) -> *mut c_void; ++ ++ pub fn shmctl(shmid: c_int, cmd: c_int, buf: *mut crate::shmid_ds) -> c_int; ++ ++ pub fn shmdt(shmaddr: *const c_void) -> c_int; ++ ++ pub fn shmget(key: key_t, size: size_t, shmflg: c_int) -> c_int; ++ ++ pub fn shm_open(name: *const c_char, oflag: c_int, mode: crate::mode_t) -> c_int; ++ pub fn shm_unlink(name: *const c_char) -> c_int; ++ ++ pub fn seekdir(dirp: *mut crate::DIR, loc: c_long); ++ ++ pub fn telldir(dirp: *mut crate::DIR) -> c_long; ++ pub fn madvise(addr: *mut c_void, len: size_t, advice: c_int) -> c_int; ++ ++ pub fn msync(addr: *mut c_void, len: size_t, flags: c_int) -> c_int; ++ ++ pub fn memalign(align: size_t, size: size_t) -> *mut c_void; ++ ++ pub fn recvfrom( ++ socket: c_int, ++ buf: *mut c_void, ++ len: size_t, ++ flags: c_int, ++ addr: *mut crate::sockaddr, ++ addrlen: *mut crate::socklen_t, ++ ) -> ssize_t; ++ pub fn mkstemps(template: *mut c_char, suffixlen: c_int) -> c_int; ++ pub fn futimesat(fd: c_int, path: *const c_char, times: *const crate::timeval) -> c_int; ++ pub fn futimens(dirfd: c_int, times: *const crate::timespec) -> c_int; ++ pub fn utimensat( ++ dirfd: c_int, ++ path: *const c_char, ++ times: *const crate::timespec, ++ flag: c_int, ++ ) -> c_int; ++ pub fn nl_langinfo(item: crate::nl_item) -> *mut c_char; ++ ++ #[link_name = "__xnet_bind"] ++ pub fn bind( ++ socket: c_int, ++ address: *const crate::sockaddr, ++ address_len: crate::socklen_t, ++ ) -> c_int; ++ ++ pub fn writev(fd: c_int, iov: *const crate::iovec, iovcnt: c_int) -> ssize_t; ++ pub fn readv(fd: c_int, iov: *const crate::iovec, iovcnt: c_int) -> ssize_t; ++ ++ #[link_name = "__xnet_sendmsg"] ++ pub fn sendmsg(fd: c_int, msg: *const crate::msghdr, flags: c_int) -> ssize_t; ++ #[link_name = "__xnet_recvmsg"] ++ pub fn recvmsg(fd: c_int, msg: *mut crate::msghdr, flags: c_int) -> ssize_t; ++ pub fn accept4( ++ fd: c_int, ++ address: *mut sockaddr, ++ address_len: *mut socklen_t, ++ flags: c_int, ++ ) -> c_int; ++ ++ pub fn mq_open(name: *const c_char, oflag: c_int, ...) -> crate::mqd_t; ++ pub fn mq_close(mqd: crate::mqd_t) -> c_int; ++ pub fn mq_unlink(name: *const c_char) -> c_int; ++ pub fn mq_receive( ++ mqd: crate::mqd_t, ++ msg_ptr: *mut c_char, ++ msg_len: size_t, ++ msg_prio: *mut c_uint, ++ ) -> ssize_t; ++ pub fn mq_timedreceive( ++ mqd: crate::mqd_t, ++ msg_ptr: *mut c_char, ++ msg_len: size_t, ++ msg_prio: *mut c_uint, ++ abs_timeout: *const crate::timespec, ++ ) -> ssize_t; ++ pub fn mq_send( ++ mqd: crate::mqd_t, ++ msg_ptr: *const c_char, ++ msg_len: size_t, ++ msg_prio: c_uint, ++ ) -> c_int; ++ pub fn mq_timedsend( ++ mqd: crate::mqd_t, ++ msg_ptr: *const c_char, ++ msg_len: size_t, ++ msg_prio: c_uint, ++ abs_timeout: *const crate::timespec, ++ ) -> c_int; ++ pub fn mq_getattr(mqd: crate::mqd_t, attr: *mut crate::mq_attr) -> c_int; ++ pub fn mq_setattr( ++ mqd: crate::mqd_t, ++ newattr: *const crate::mq_attr, ++ oldattr: *mut crate::mq_attr, ++ ) -> c_int; ++ pub fn port_create() -> c_int; ++ pub fn port_associate( ++ port: c_int, ++ source: c_int, ++ object: crate::uintptr_t, ++ events: c_int, ++ user: *mut c_void, ++ ) -> c_int; ++ pub fn port_dissociate(port: c_int, source: c_int, object: crate::uintptr_t) -> c_int; ++ pub fn port_get(port: c_int, pe: *mut port_event, timeout: *mut crate::timespec) -> c_int; ++ pub fn port_getn( ++ port: c_int, ++ pe_list: *mut port_event, ++ max: c_uint, ++ nget: *mut c_uint, ++ timeout: *mut crate::timespec, ++ ) -> c_int; ++ pub fn port_send(port: c_int, events: c_int, user: *mut c_void) -> c_int; ++ pub fn port_sendn( ++ port_list: *mut c_int, ++ error_list: *mut c_int, ++ nent: c_uint, ++ events: c_int, ++ user: *mut c_void, ++ ) -> c_int; ++ #[cfg_attr( ++ any(target_os = "solaris", target_os = "illumos"), ++ link_name = "__posix_getgrgid_r" ++ )] ++ pub fn getgrgid_r( ++ gid: crate::gid_t, ++ grp: *mut crate::group, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut crate::group, ++ ) -> c_int; ++ pub fn sigaltstack(ss: *const stack_t, oss: *mut stack_t) -> c_int; ++ pub fn sigsuspend(mask: *const crate::sigset_t) -> c_int; ++ pub fn sem_close(sem: *mut sem_t) -> c_int; ++ pub fn getdtablesize() -> c_int; ++ ++ #[cfg_attr( ++ any(target_os = "solaris", target_os = "illumos"), ++ link_name = "__posix_getgrnam_r" ++ )] ++ pub fn getgrnam_r( ++ name: *const c_char, ++ grp: *mut crate::group, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut crate::group, ++ ) -> c_int; ++ pub fn thr_self() -> crate::thread_t; ++ pub fn pthread_sigmask(how: c_int, set: *const sigset_t, oldset: *mut sigset_t) -> c_int; ++ pub fn sem_open(name: *const c_char, oflag: c_int, ...) -> *mut sem_t; ++ pub fn getgrnam(name: *const c_char) -> *mut crate::group; ++ #[cfg_attr(target_os = "solaris", link_name = "__pthread_kill_xpg7")] ++ pub fn pthread_kill(thread: crate::pthread_t, sig: c_int) -> c_int; ++ pub fn sched_get_priority_min(policy: c_int) -> c_int; ++ pub fn sched_get_priority_max(policy: c_int) -> c_int; ++ pub fn sched_getparam(pid: crate::pid_t, param: *mut sched_param) -> c_int; ++ pub fn sched_setparam(pid: crate::pid_t, param: *const sched_param) -> c_int; ++ pub fn sched_getscheduler(pid: crate::pid_t) -> c_int; ++ pub fn sched_setscheduler( ++ pid: crate::pid_t, ++ policy: c_int, ++ param: *const crate::sched_param, ++ ) -> c_int; ++ pub fn sem_unlink(name: *const c_char) -> c_int; ++ pub fn daemon(nochdir: c_int, noclose: c_int) -> c_int; ++ #[cfg_attr( ++ any(target_os = "solaris", target_os = "illumos"), ++ link_name = "__posix_getpwnam_r" ++ )] ++ pub fn getpwnam_r( ++ name: *const c_char, ++ pwd: *mut passwd, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut passwd, ++ ) -> c_int; ++ #[cfg_attr( ++ any(target_os = "solaris", target_os = "illumos"), ++ link_name = "__posix_getpwuid_r" ++ )] ++ pub fn getpwuid_r( ++ uid: crate::uid_t, ++ pwd: *mut passwd, ++ buf: *mut c_char, ++ buflen: size_t, ++ result: *mut *mut passwd, ++ ) -> c_int; ++ #[cfg_attr( ++ any(target_os = "solaris", target_os = "illumos"), ++ link_name = "getpwent_r" ++ )] ++ fn native_getpwent_r(pwd: *mut passwd, buf: *mut c_char, buflen: c_int) -> *mut passwd; ++ #[cfg_attr( ++ any(target_os = "solaris", target_os = "illumos"), ++ link_name = "getgrent_r" ++ )] ++ fn native_getgrent_r( ++ grp: *mut crate::group, ++ buf: *mut c_char, ++ buflen: c_int, ++ ) -> *mut crate::group; ++ #[cfg_attr( ++ any(target_os = "solaris", target_os = "illumos"), ++ link_name = "__posix_sigwait" ++ )] ++ pub fn sigwait(set: *const sigset_t, sig: *mut c_int) -> c_int; ++ pub fn pthread_atfork( ++ prepare: Option, ++ parent: Option, ++ child: Option, ++ ) -> c_int; ++ pub fn getgrgid(gid: crate::gid_t) -> *mut crate::group; ++ pub fn setgrent(); ++ pub fn endgrent(); ++ pub fn getgrent() -> *mut crate::group; ++ pub fn popen(command: *const c_char, mode: *const c_char) -> *mut crate::FILE; ++ ++ pub fn dup3(src: c_int, dst: c_int, flags: c_int) -> c_int; ++ pub fn uname(buf: *mut crate::utsname) -> c_int; ++ pub fn pipe2(fds: *mut c_int, flags: c_int) -> c_int; ++ ++ pub fn makeutx(ux: *const utmpx) -> *mut utmpx; ++ pub fn modutx(ux: *const utmpx) -> *mut utmpx; ++ pub fn updwtmpx(file: *const c_char, ut: *mut utmpx); ++ pub fn utmpxname(file: *const c_char) -> c_int; ++ pub fn getutxent() -> *mut utmpx; ++ pub fn getutxid(ut: *const utmpx) -> *mut utmpx; ++ pub fn getutxline(ut: *const utmpx) -> *mut utmpx; ++ pub fn pututxline(ut: *const utmpx) -> *mut utmpx; ++ pub fn setutxent(); ++ pub fn endutxent(); ++ ++ pub fn endutent(); ++ pub fn getutent() -> *mut utmp; ++ pub fn getutid(u: *const utmp) -> *mut utmp; ++ pub fn getutline(u: *const utmp) -> *mut utmp; ++ pub fn pututline(u: *const utmp) -> *mut utmp; ++ pub fn setutent(); ++ pub fn utmpname(file: *const c_char) -> c_int; ++ ++ pub fn getutmp(ux: *const utmpx, u: *mut utmp); ++ pub fn getutmpx(u: *const utmp, ux: *mut utmpx); ++ pub fn updwtmp(file: *const c_char, u: *mut utmp); ++ ++ pub fn ntp_adjtime(buf: *mut timex) -> c_int; ++ pub fn ntp_gettime(buf: *mut ntptimeval) -> c_int; ++ ++ pub fn timer_create(clock_id: clockid_t, evp: *mut sigevent, timerid: *mut timer_t) -> c_int; ++ pub fn timer_delete(timerid: timer_t) -> c_int; ++ pub fn timer_getoverrun(timerid: timer_t) -> c_int; ++ pub fn timer_gettime(timerid: timer_t, value: *mut itimerspec) -> c_int; ++ pub fn timer_settime( ++ timerid: timer_t, ++ flags: c_int, ++ value: *const itimerspec, ++ ovalue: *mut itimerspec, ++ ) -> c_int; ++ ++ pub fn ucred_get(pid: crate::pid_t) -> *mut ucred_t; ++ pub fn getpeerucred(fd: c_int, ucred: *mut *mut ucred_t) -> c_int; ++ ++ pub fn ucred_free(ucred: *mut ucred_t); ++ ++ pub fn ucred_geteuid(ucred: *const ucred_t) -> crate::uid_t; ++ pub fn ucred_getruid(ucred: *const ucred_t) -> crate::uid_t; ++ pub fn ucred_getsuid(ucred: *const ucred_t) -> crate::uid_t; ++ pub fn ucred_getegid(ucred: *const ucred_t) -> crate::gid_t; ++ pub fn ucred_getrgid(ucred: *const ucred_t) -> crate::gid_t; ++ pub fn ucred_getsgid(ucred: *const ucred_t) -> crate::gid_t; ++ pub fn ucred_getgroups(ucred: *const ucred_t, groups: *mut *const crate::gid_t) -> c_int; ++ pub fn ucred_getpid(ucred: *const ucred_t) -> crate::pid_t; ++ pub fn ucred_getprojid(ucred: *const ucred_t) -> projid_t; ++ pub fn ucred_getzoneid(ucred: *const ucred_t) -> zoneid_t; ++ pub fn ucred_getpflags(ucred: *const ucred_t, flags: c_uint) -> c_uint; ++ ++ pub fn ucred_size() -> size_t; ++ ++ pub fn pset_create(newpset: *mut crate::psetid_t) -> c_int; ++ pub fn pset_destroy(pset: crate::psetid_t) -> c_int; ++ pub fn pset_assign( ++ pset: crate::psetid_t, ++ cpu: crate::processorid_t, ++ opset: *mut psetid_t, ++ ) -> c_int; ++ pub fn pset_info( ++ pset: crate::psetid_t, ++ tpe: *mut c_int, ++ numcpus: *mut c_uint, ++ cpulist: *mut processorid_t, ++ ) -> c_int; ++ pub fn pset_bind( ++ pset: crate::psetid_t, ++ idtype: crate::idtype_t, ++ id: crate::id_t, ++ opset: *mut psetid_t, ++ ) -> c_int; ++ pub fn pset_list(pset: *mut psetid_t, numpsets: *mut c_uint) -> c_int; ++ pub fn pset_setattr(pset: psetid_t, attr: c_uint) -> c_int; ++ pub fn pset_getattr(pset: psetid_t, attr: *mut c_uint) -> c_int; ++ pub fn processor_bind( ++ idtype: crate::idtype_t, ++ id: crate::id_t, ++ new_binding: crate::processorid_t, ++ old_binding: *mut processorid_t, ++ ) -> c_int; ++ pub fn p_online(processorid: crate::processorid_t, flag: c_int) -> c_int; ++ pub fn processor_info(processorid: crate::processorid_t, infop: *mut processor_info_t) ++ -> c_int; ++ ++ pub fn getexecname() -> *const c_char; ++ ++ pub fn gethostid() -> c_long; ++ ++ pub fn getpflags(flags: c_uint) -> c_uint; ++ pub fn setpflags(flags: c_uint, value: c_uint) -> c_int; ++ ++ pub fn sysinfo(command: c_int, buf: *mut c_char, count: c_long) -> c_int; ++ ++ pub fn faccessat(fd: c_int, path: *const c_char, amode: c_int, flag: c_int) -> c_int; ++ ++ // #include ++ #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] ++ pub fn dl_iterate_phdr( ++ callback: Option< ++ unsafe extern "C" fn(info: *mut dl_phdr_info, size: usize, data: *mut c_void) -> c_int, ++ >, ++ data: *mut c_void, ++ ) -> c_int; ++ pub fn getpagesize() -> c_int; ++ pub fn getpagesizes(pagesize: *mut size_t, nelem: c_int) -> c_int; ++ pub fn mmapobj( ++ fd: c_int, ++ flags: c_uint, ++ storage: *mut mmapobj_result_t, ++ elements: *mut c_uint, ++ arg: *mut c_void, ++ ) -> c_int; ++ pub fn meminfo( ++ inaddr: *const u64, ++ addr_count: c_int, ++ info_req: *const c_uint, ++ info_count: c_int, ++ outdata: *mut u64, ++ validity: *mut c_uint, ++ ) -> c_int; ++ ++ pub fn strsep(string: *mut *mut c_char, delim: *const c_char) -> *mut c_char; ++ ++ pub fn getisax(array: *mut u32, n: c_uint) -> c_uint; ++ ++ pub fn backtrace(buffer: *mut *mut c_void, size: c_int) -> c_int; ++ pub fn backtrace_symbols(buffer: *const *mut c_void, size: c_int) -> *mut *mut c_char; ++ pub fn backtrace_symbols_fd(buffer: *const *mut c_void, size: c_int, fd: c_int); ++ ++ pub fn getopt_long( ++ argc: c_int, ++ argv: *const *mut c_char, ++ optstring: *const c_char, ++ longopts: *const option, ++ longindex: *mut c_int, ++ ) -> c_int; ++ ++ pub fn sync(); ++ ++ pub fn aio_cancel(fd: c_int, aiocbp: *mut aiocb) -> c_int; ++ pub fn aio_error(aiocbp: *const aiocb) -> c_int; ++ pub fn aio_fsync(op: c_int, aiocbp: *mut aiocb) -> c_int; ++ pub fn aio_read(aiocbp: *mut aiocb) -> c_int; ++ pub fn aio_return(aiocbp: *mut aiocb) -> ssize_t; ++ pub fn aio_suspend( ++ aiocb_list: *const *const aiocb, ++ nitems: c_int, ++ timeout: *const crate::timespec, ++ ) -> c_int; ++ pub fn aio_waitn( ++ aiocb_list: *mut *mut aiocb, ++ nent: c_uint, ++ nwait: *mut c_uint, ++ timeout: *const crate::timespec, ++ ) -> c_int; ++ pub fn aio_write(aiocbp: *mut aiocb) -> c_int; ++ pub fn lio_listio( ++ mode: c_int, ++ aiocb_list: *const *mut aiocb, ++ nitems: c_int, ++ sevp: *mut sigevent, ++ ) -> c_int; ++ ++ pub fn __major(version: c_int, devnum: crate::dev_t) -> crate::major_t; ++ pub fn __minor(version: c_int, devnum: crate::dev_t) -> crate::minor_t; ++ pub fn __makedev( ++ version: c_int, ++ majdev: crate::major_t, ++ mindev: crate::minor_t, ++ ) -> crate::dev_t; ++ ++ pub fn arc4random() -> u32; ++ pub fn arc4random_buf(buf: *mut c_void, nbytes: size_t); ++ pub fn arc4random_uniform(upper_bound: u32) -> u32; ++} ++ ++#[link(name = "sendfile")] ++extern "C" { ++ pub fn sendfile(out_fd: c_int, in_fd: c_int, off: *mut off_t, len: size_t) -> ssize_t; ++ pub fn sendfilev( ++ fildes: c_int, ++ vec: *const sendfilevec_t, ++ sfvcnt: c_int, ++ xferred: *mut size_t, ++ ) -> ssize_t; ++} ++ ++#[link(name = "lgrp")] ++extern "C" { ++ pub fn lgrp_init(view: lgrp_view_t) -> lgrp_cookie_t; ++ pub fn lgrp_fini(cookie: lgrp_cookie_t) -> c_int; ++ pub fn lgrp_affinity_get( ++ idtype: crate::idtype_t, ++ id: crate::id_t, ++ lgrp: crate::lgrp_id_t, ++ ) -> crate::lgrp_affinity_t; ++ pub fn lgrp_affinity_set( ++ idtype: crate::idtype_t, ++ id: crate::id_t, ++ lgrp: crate::lgrp_id_t, ++ aff: lgrp_affinity_t, ++ ) -> c_int; ++ pub fn lgrp_cpus( ++ cookie: crate::lgrp_cookie_t, ++ lgrp: crate::lgrp_id_t, ++ cpuids: *mut crate::processorid_t, ++ count: c_uint, ++ content: crate::lgrp_content_t, ++ ) -> c_int; ++ pub fn lgrp_mem_size( ++ cookie: crate::lgrp_cookie_t, ++ lgrp: crate::lgrp_id_t, ++ tpe: crate::lgrp_mem_size_flag_t, ++ content: crate::lgrp_content_t, ++ ) -> crate::lgrp_mem_size_t; ++ pub fn lgrp_nlgrps(cookie: crate::lgrp_cookie_t) -> c_int; ++ pub fn lgrp_view(cookie: crate::lgrp_cookie_t) -> crate::lgrp_view_t; ++ pub fn lgrp_home(idtype: crate::idtype_t, id: crate::id_t) -> crate::lgrp_id_t; ++ pub fn lgrp_version(version: c_int) -> c_int; ++ pub fn lgrp_resources( ++ cookie: crate::lgrp_cookie_t, ++ lgrp: crate::lgrp_id_t, ++ lgrps: *mut crate::lgrp_id_t, ++ count: c_uint, ++ tpe: crate::lgrp_rsrc_t, ++ ) -> c_int; ++ pub fn lgrp_root(cookie: crate::lgrp_cookie_t) -> crate::lgrp_id_t; ++} ++ ++pub unsafe fn major(device: crate::dev_t) -> crate::major_t { ++ __major(NEWDEV, device) ++} ++ ++pub unsafe fn minor(device: crate::dev_t) -> crate::minor_t { ++ __minor(NEWDEV, device) ++} ++ ++pub unsafe fn makedev(maj: crate::major_t, min: crate::minor_t) -> crate::dev_t { ++ __makedev(NEWDEV, maj, min) ++} ++ ++mod compat; ++pub use self::compat::*; ++ ++cfg_if! { ++ if #[cfg(target_os = "illumos")] { ++ mod illumos; ++ pub use self::illumos::*; ++ } else if #[cfg(target_os = "solaris")] { ++ mod solaris; ++ pub use self::solaris::*; ++ } else { ++ // Unknown target_os ++ } ++} ++ ++cfg_if! { ++ if #[cfg(target_arch = "x86_64")] { ++ mod x86_64; ++ mod x86_common; ++ pub use self::x86_64::*; ++ pub use self::x86_common::*; ++ } else if #[cfg(target_arch = "x86")] { ++ mod x86; ++ mod x86_common; ++ pub use self::x86::*; ++ pub use self::x86_common::*; ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/solarish/solaris.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/solarish/solaris.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/solarish/solaris.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/solarish/solaris.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,235 @@ ++use crate::prelude::*; ++use crate::{ ++ exit_status, off_t, NET_MAC_AWARE, NET_MAC_AWARE_INHERIT, PRIV_AWARE_RESET, PRIV_DEBUG, ++ PRIV_PFEXEC, PRIV_XPOLICY, ++}; ++ ++pub type door_attr_t = c_uint; ++pub type door_id_t = c_ulonglong; ++pub type lgrp_affinity_t = c_uint; ++ ++e! { ++ #[repr(u32)] ++ pub enum lgrp_rsrc_t { ++ LGRP_RSRC_CPU = 0, ++ LGRP_RSRC_MEM = 1, ++ LGRP_RSRC_TYPES = 2, ++ } ++} ++ ++s! { ++ pub struct aiocb { ++ pub aio_fildes: c_int, ++ pub aio_buf: *mut c_void, ++ pub aio_nbytes: size_t, ++ pub aio_offset: off_t, ++ pub aio_reqprio: c_int, ++ pub aio_sigevent: crate::sigevent, ++ pub aio_lio_opcode: c_int, ++ pub aio_resultp: crate::aio_result_t, ++ pub aio_state: c_char, ++ pub aio_returned: c_char, ++ pub aio__pad1: [c_char; 2], ++ pub aio_flags: c_int, ++ } ++ ++ pub struct shmid_ds { ++ pub shm_perm: crate::ipc_perm, ++ pub shm_segsz: size_t, ++ pub shm_flags: crate::uintptr_t, ++ pub shm_lkcnt: c_ushort, ++ pub shm_lpid: crate::pid_t, ++ pub shm_cpid: crate::pid_t, ++ pub shm_nattch: crate::shmatt_t, ++ pub shm_cnattch: c_ulong, ++ pub shm_atime: crate::time_t, ++ pub shm_dtime: crate::time_t, ++ pub shm_ctime: crate::time_t, ++ pub shm_amp: *mut c_void, ++ pub shm_gransize: u64, ++ pub shm_allocated: u64, ++ pub shm_pad4: [i64; 1], ++ } ++ ++ pub struct xrs_t { ++ pub xrs_id: c_ulong, ++ pub xrs_ptr: *mut c_char, ++ } ++} ++ ++s_no_extra_traits! { ++ #[repr(packed)] ++ #[cfg_attr(feature = "extra_traits", allow(missing_debug_implementations))] ++ pub struct door_desc_t__d_data__d_desc { ++ pub d_descriptor: c_int, ++ pub d_id: crate::door_id_t, ++ } ++ ++ pub union door_desc_t__d_data { ++ pub d_desc: door_desc_t__d_data__d_desc, ++ d_resv: [c_int; 5], /* Check out /usr/include/sys/door.h */ ++ } ++ ++ #[cfg_attr(feature = "extra_traits", allow(missing_debug_implementations))] ++ pub struct door_desc_t { ++ pub d_attributes: door_attr_t, ++ pub d_data: door_desc_t__d_data, ++ } ++ ++ #[cfg_attr(feature = "extra_traits", allow(missing_debug_implementations))] ++ pub struct door_arg_t { ++ pub data_ptr: *const c_char, ++ pub data_size: size_t, ++ pub desc_ptr: *const door_desc_t, ++ pub dec_num: c_uint, ++ pub rbuf: *const c_char, ++ pub rsize: size_t, ++ } ++ ++ pub struct utmpx { ++ pub ut_user: [c_char; _UTMP_USER_LEN], ++ pub ut_id: [c_char; _UTMP_ID_LEN], ++ pub ut_line: [c_char; _UTMP_LINE_LEN], ++ pub ut_pid: crate::pid_t, ++ pub ut_type: c_short, ++ pub ut_exit: exit_status, ++ pub ut_tv: crate::timeval, ++ pub ut_session: c_int, ++ pub pad: [c_int; 5], ++ pub ut_syslen: c_short, ++ pub ut_host: [c_char; 257], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for utmpx { ++ fn eq(&self, other: &utmpx) -> bool { ++ self.ut_type == other.ut_type ++ && self.ut_pid == other.ut_pid ++ && self.ut_user == other.ut_user ++ && self.ut_line == other.ut_line ++ && self.ut_id == other.ut_id ++ && self.ut_exit == other.ut_exit ++ && self.ut_session == other.ut_session ++ && self.ut_tv == other.ut_tv ++ && self.ut_syslen == other.ut_syslen ++ && self.pad == other.pad ++ && self ++ .ut_host ++ .iter() ++ .zip(other.ut_host.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ ++ impl Eq for utmpx {} ++ ++ impl fmt::Debug for utmpx { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("utmpx") ++ .field("ut_user", &self.ut_user) ++ .field("ut_id", &self.ut_id) ++ .field("ut_line", &self.ut_line) ++ .field("ut_pid", &self.ut_pid) ++ .field("ut_type", &self.ut_type) ++ .field("ut_exit", &self.ut_exit) ++ .field("ut_tv", &self.ut_tv) ++ .field("ut_session", &self.ut_session) ++ .field("pad", &self.pad) ++ .field("ut_syslen", &self.ut_syslen) ++ .field("ut_host", &&self.ut_host[..]) ++ .finish() ++ } ++ } ++ ++ impl hash::Hash for utmpx { ++ fn hash(&self, state: &mut H) { ++ self.ut_user.hash(state); ++ self.ut_type.hash(state); ++ self.ut_pid.hash(state); ++ self.ut_line.hash(state); ++ self.ut_id.hash(state); ++ self.ut_host.hash(state); ++ self.ut_exit.hash(state); ++ self.ut_session.hash(state); ++ self.ut_tv.hash(state); ++ self.ut_syslen.hash(state); ++ self.pad.hash(state); ++ } ++ } ++ } ++} ++ ++pub const _UTMP_USER_LEN: usize = 32; ++pub const _UTMP_LINE_LEN: usize = 32; ++pub const _UTMP_ID_LEN: usize = 4; ++ ++pub const PORT_SOURCE_POSTWAIT: c_int = 8; ++pub const PORT_SOURCE_SIGNAL: c_int = 9; ++ ++pub const AF_LOCAL: c_int = 1; // AF_UNIX ++pub const AF_FILE: c_int = 1; // AF_UNIX ++ ++pub const TCP_KEEPIDLE: c_int = 0x1d; ++pub const TCP_KEEPINTVL: c_int = 0x1e; ++pub const TCP_KEEPCNT: c_int = 0x1f; ++ ++pub const F_DUPFD_CLOEXEC: c_int = 47; ++pub const F_DUPFD_CLOFORK: c_int = 49; ++pub const F_DUP2FD_CLOEXEC: c_int = 48; ++pub const F_DUP2FD_CLOFORK: c_int = 50; ++ ++pub const _PC_LAST: c_int = 102; ++ ++pub const PRIV_PROC_SENSITIVE: c_uint = 0x0008; ++pub const PRIV_PFEXEC_AUTH: c_uint = 0x0200; ++pub const PRIV_PROC_TPD: c_uint = 0x0400; ++pub const PRIV_TPD_UNSAFE: c_uint = 0x0800; ++pub const PRIV_PROC_TPD_RESET: c_uint = 0x1000; ++pub const PRIV_TPD_KILLABLE: c_uint = 0x2000; ++ ++pub const PRIV_USER: c_uint = PRIV_DEBUG ++ | PRIV_PROC_SENSITIVE ++ | NET_MAC_AWARE ++ | NET_MAC_AWARE_INHERIT ++ | PRIV_XPOLICY ++ | PRIV_AWARE_RESET ++ | PRIV_PFEXEC ++ | PRIV_PFEXEC_AUTH ++ | PRIV_PROC_TPD ++ | PRIV_TPD_UNSAFE ++ | PRIV_TPD_KILLABLE ++ | PRIV_PROC_TPD_RESET; ++ ++extern "C" { ++ // DIFF(main): changed to `*const *mut` in e77f551de9 ++ pub fn fexecve(fd: c_int, argv: *const *const c_char, envp: *const *const c_char) -> c_int; ++ ++ pub fn mincore(addr: *mut c_void, len: size_t, vec: *mut c_char) -> c_int; ++ ++ pub fn door_call(d: c_int, params: *mut door_arg_t) -> c_int; ++ pub fn door_return( ++ data_ptr: *mut c_char, ++ data_size: size_t, ++ desc_ptr: *mut door_desc_t, ++ num_desc: c_uint, ++ ) -> c_int; ++ pub fn door_create( ++ server_procedure: extern "C" fn( ++ cookie: *mut c_void, ++ argp: *mut c_char, ++ arg_size: size_t, ++ dp: *mut door_desc_t, ++ n_desc: c_uint, ++ ), ++ cookie: *mut c_void, ++ attributes: door_attr_t, ++ ) -> c_int; ++ ++ pub fn fattach(fildes: c_int, path: *const c_char) -> c_int; ++ ++ pub fn pthread_getattr_np(thread: crate::pthread_t, attr: *mut crate::pthread_attr_t) -> c_int; ++ ++ pub fn euidaccess(path: *const c_char, amode: c_int) -> c_int; ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/solarish/x86_64.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/solarish/x86_64.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/solarish/x86_64.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/solarish/x86_64.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,195 @@ ++use crate::prelude::*; ++ ++cfg_if! { ++ if #[cfg(target_os = "solaris")] { ++ use crate::unix::solarish::solaris; ++ } ++} ++ ++pub type greg_t = c_long; ++ ++pub type Elf64_Addr = c_ulong; ++pub type Elf64_Half = c_ushort; ++pub type Elf64_Off = c_ulong; ++pub type Elf64_Sword = c_int; ++pub type Elf64_Sxword = c_long; ++pub type Elf64_Word = c_uint; ++pub type Elf64_Xword = c_ulong; ++pub type Elf64_Lword = c_ulong; ++pub type Elf64_Phdr = __c_anonymous_Elf64_Phdr; ++ ++s! { ++ pub struct __c_anonymous_fpchip_state { ++ pub cw: u16, ++ pub sw: u16, ++ pub fctw: u8, ++ pub __fx_rsvd: u8, ++ pub fop: u16, ++ pub rip: u64, ++ pub rdp: u64, ++ pub mxcsr: u32, ++ pub mxcsr_mask: u32, ++ pub st: [crate::upad128_t; 8], ++ pub xmm: [crate::upad128_t; 16], ++ pub __fx_ign: [crate::upad128_t; 6], ++ pub status: u32, ++ pub xstatus: u32, ++ } ++ ++ pub struct __c_anonymous_Elf64_Phdr { ++ pub p_type: crate::Elf64_Word, ++ pub p_flags: crate::Elf64_Word, ++ pub p_offset: crate::Elf64_Off, ++ pub p_vaddr: crate::Elf64_Addr, ++ pub p_paddr: crate::Elf64_Addr, ++ pub p_filesz: crate::Elf64_Xword, ++ pub p_memsz: crate::Elf64_Xword, ++ pub p_align: crate::Elf64_Xword, ++ } ++ ++ pub struct dl_phdr_info { ++ pub dlpi_addr: crate::Elf64_Addr, ++ pub dlpi_name: *const c_char, ++ pub dlpi_phdr: *const crate::Elf64_Phdr, ++ pub dlpi_phnum: crate::Elf64_Half, ++ pub dlpi_adds: c_ulonglong, ++ pub dlpi_subs: c_ulonglong, ++ #[cfg(target_os = "solaris")] ++ pub dlpi_tls_modid: c_ulong, ++ #[cfg(target_os = "solaris")] ++ pub dlpi_tls_data: *mut c_void, ++ } ++} ++ ++s_no_extra_traits! { ++ pub union __c_anonymous_fp_reg_set { ++ pub fpchip_state: __c_anonymous_fpchip_state, ++ pub f_fpregs: [[u32; 13]; 10], ++ } ++ ++ pub struct fpregset_t { ++ pub fp_reg_set: __c_anonymous_fp_reg_set, ++ } ++ ++ pub struct mcontext_t { ++ pub gregs: [crate::greg_t; 28], ++ pub fpregs: fpregset_t, ++ } ++ ++ pub struct ucontext_t { ++ pub uc_flags: c_ulong, ++ pub uc_link: *mut ucontext_t, ++ pub uc_sigmask: crate::sigset_t, ++ pub uc_stack: crate::stack_t, ++ pub uc_mcontext: mcontext_t, ++ #[cfg(target_os = "illumos")] ++ pub uc_brand_data: [*mut c_void; 3], ++ #[cfg(target_os = "illumos")] ++ pub uc_xsave: c_long, ++ #[cfg(target_os = "illumos")] ++ pub uc_filler: c_long, ++ #[cfg(target_os = "solaris")] ++ pub uc_xrs: solaris::xrs_t, ++ #[cfg(target_os = "solaris")] ++ pub uc_filler: [c_long; 3], ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl PartialEq for __c_anonymous_fp_reg_set { ++ fn eq(&self, other: &__c_anonymous_fp_reg_set) -> bool { ++ unsafe { ++ self.fpchip_state == other.fpchip_state ++ || self ++ .f_fpregs ++ .iter() ++ .zip(other.f_fpregs.iter()) ++ .all(|(a, b)| a == b) ++ } ++ } ++ } ++ impl Eq for __c_anonymous_fp_reg_set {} ++ impl PartialEq for fpregset_t { ++ fn eq(&self, other: &fpregset_t) -> bool { ++ self.fp_reg_set == other.fp_reg_set ++ } ++ } ++ impl Eq for fpregset_t {} ++ impl fmt::Debug for fpregset_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("fpregset_t") ++ .field("fp_reg_set", &self.fp_reg_set) ++ .finish() ++ } ++ } ++ impl PartialEq for mcontext_t { ++ fn eq(&self, other: &mcontext_t) -> bool { ++ self.gregs == other.gregs && self.fpregs == other.fpregs ++ } ++ } ++ impl Eq for mcontext_t {} ++ impl fmt::Debug for mcontext_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("mcontext_t") ++ .field("gregs", &self.gregs) ++ .field("fpregs", &self.fpregs) ++ .finish() ++ } ++ } ++ impl PartialEq for ucontext_t { ++ fn eq(&self, other: &ucontext_t) -> bool { ++ self.uc_flags == other.uc_flags ++ && self.uc_link == other.uc_link ++ && self.uc_sigmask == other.uc_sigmask ++ && self.uc_stack == other.uc_stack ++ && self.uc_mcontext == other.uc_mcontext ++ && self.uc_filler == other.uc_filler ++ } ++ } ++ impl Eq for ucontext_t {} ++ impl fmt::Debug for ucontext_t { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("ucontext_t") ++ .field("uc_flags", &self.uc_flags) ++ .field("uc_link", &self.uc_link) ++ .field("uc_sigmask", &self.uc_sigmask) ++ .field("uc_stack", &self.uc_stack) ++ .field("uc_mcontext", &self.uc_mcontext) ++ .field("uc_filler", &self.uc_filler) ++ .finish() ++ } ++ } ++ } ++} ++ ++// sys/regset.h ++ ++pub const REG_GSBASE: c_int = 27; ++pub const REG_FSBASE: c_int = 26; ++pub const REG_DS: c_int = 25; ++pub const REG_ES: c_int = 24; ++pub const REG_GS: c_int = 23; ++pub const REG_FS: c_int = 22; ++pub const REG_SS: c_int = 21; ++pub const REG_RSP: c_int = 20; ++pub const REG_RFL: c_int = 19; ++pub const REG_CS: c_int = 18; ++pub const REG_RIP: c_int = 17; ++pub const REG_ERR: c_int = 16; ++pub const REG_TRAPNO: c_int = 15; ++pub const REG_RAX: c_int = 14; ++pub const REG_RCX: c_int = 13; ++pub const REG_RDX: c_int = 12; ++pub const REG_RBX: c_int = 11; ++pub const REG_RBP: c_int = 10; ++pub const REG_RSI: c_int = 9; ++pub const REG_RDI: c_int = 8; ++pub const REG_R8: c_int = 7; ++pub const REG_R9: c_int = 6; ++pub const REG_R10: c_int = 5; ++pub const REG_R11: c_int = 4; ++pub const REG_R12: c_int = 3; ++pub const REG_R13: c_int = 2; ++pub const REG_R14: c_int = 1; ++pub const REG_R15: c_int = 0; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/solarish/x86_common.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/solarish/x86_common.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/solarish/x86_common.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/solarish/x86_common.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,69 @@ ++// AT_SUN_HWCAP ++pub const AV_386_FPU: u32 = 0x00001; ++pub const AV_386_TSC: u32 = 0x00002; ++pub const AV_386_CX8: u32 = 0x00004; ++pub const AV_386_SEP: u32 = 0x00008; ++pub const AV_386_AMD_SYSC: u32 = 0x00010; ++pub const AV_386_CMOV: u32 = 0x00020; ++pub const AV_386_MMX: u32 = 0x00040; ++pub const AV_386_AMD_MMX: u32 = 0x00080; ++pub const AV_386_AMD_3DNow: u32 = 0x00100; ++pub const AV_386_AMD_3DNowx: u32 = 0x00200; ++pub const AV_386_FXSR: u32 = 0x00400; ++pub const AV_386_SSE: u32 = 0x00800; ++pub const AV_386_SSE2: u32 = 0x01000; ++pub const AV_386_CX16: u32 = 0x10000; ++pub const AV_386_AHF: u32 = 0x20000; ++pub const AV_386_TSCP: u32 = 0x40000; ++pub const AV_386_AMD_SSE4A: u32 = 0x80000; ++pub const AV_386_POPCNT: u32 = 0x100000; ++pub const AV_386_AMD_LZCNT: u32 = 0x200000; ++pub const AV_386_SSSE3: u32 = 0x400000; ++pub const AV_386_SSE4_1: u32 = 0x800000; ++pub const AV_386_SSE4_2: u32 = 0x1000000; ++pub const AV_386_MOVBE: u32 = 0x2000000; ++pub const AV_386_AES: u32 = 0x4000000; ++pub const AV_386_PCLMULQDQ: u32 = 0x8000000; ++pub const AV_386_XSAVE: u32 = 0x10000000; ++pub const AV_386_AVX: u32 = 0x20000000; ++cfg_if! { ++ if #[cfg(target_os = "illumos")] { ++ pub const AV_386_VMX: u32 = 0x40000000; ++ pub const AV_386_AMD_SVM: u32 = 0x80000000; ++ // AT_SUN_HWCAP2 ++ pub const AV_386_2_F16C: u32 = 0x00000001; ++ pub const AV_386_2_RDRAND: u32 = 0x00000002; ++ pub const AV_386_2_BMI1: u32 = 0x00000004; ++ pub const AV_386_2_BMI2: u32 = 0x00000008; ++ pub const AV_386_2_FMA: u32 = 0x00000010; ++ pub const AV_386_2_AVX2: u32 = 0x00000020; ++ pub const AV_386_2_ADX: u32 = 0x00000040; ++ pub const AV_386_2_RDSEED: u32 = 0x00000080; ++ pub const AV_386_2_AVX512F: u32 = 0x00000100; ++ pub const AV_386_2_AVX512DQ: u32 = 0x00000200; ++ pub const AV_386_2_AVX512IFMA: u32 = 0x00000400; ++ pub const AV_386_2_AVX512PF: u32 = 0x00000800; ++ pub const AV_386_2_AVX512ER: u32 = 0x00001000; ++ pub const AV_386_2_AVX512CD: u32 = 0x00002000; ++ pub const AV_386_2_AVX512BW: u32 = 0x00004000; ++ pub const AV_386_2_AVX512VL: u32 = 0x00008000; ++ pub const AV_386_2_AVX512VBMI: u32 = 0x00010000; ++ pub const AV_386_2_AVX512VPOPCDQ: u32 = 0x00020000; ++ pub const AV_386_2_AVX512_4NNIW: u32 = 0x00040000; ++ pub const AV_386_2_AVX512_4FMAPS: u32 = 0x00080000; ++ pub const AV_386_2_SHA: u32 = 0x00100000; ++ pub const AV_386_2_FSGSBASE: u32 = 0x00200000; ++ pub const AV_386_2_CLFLUSHOPT: u32 = 0x00400000; ++ pub const AV_386_2_CLWB: u32 = 0x00800000; ++ pub const AV_386_2_MONITORX: u32 = 0x01000000; ++ pub const AV_386_2_CLZERO: u32 = 0x02000000; ++ pub const AV_386_2_AVX512_VNNI: u32 = 0x04000000; ++ pub const AV_386_2_VPCLMULQDQ: u32 = 0x08000000; ++ pub const AV_386_2_VAES: u32 = 0x10000000; ++ // AT_SUN_FPTYPE ++ pub const AT_386_FPINFO_NONE: u32 = 0; ++ pub const AT_386_FPINFO_FXSAVE: u32 = 1; ++ pub const AT_386_FPINFO_XSAVE: u32 = 2; ++ pub const AT_386_FPINFO_XSAVE_AMD: u32 = 3; ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/unix/solarish/x86.rs mesa-25.3.3/subprojects/libc-0.2.169/src/unix/solarish/x86.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/unix/solarish/x86.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/unix/solarish/x86.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,31 @@ ++use crate::prelude::*; ++ ++pub type Elf32_Addr = c_ulong; ++pub type Elf32_Half = c_ushort; ++pub type Elf32_Off = c_ulong; ++pub type Elf32_Sword = c_long; ++pub type Elf32_Word = c_ulong; ++pub type Elf32_Lword = c_ulonglong; ++pub type Elf32_Phdr = __c_anonymous_Elf32_Phdr; ++ ++s! { ++ pub struct __c_anonymous_Elf32_Phdr { ++ pub p_type: Elf32_Word, ++ pub p_offset: Elf32_Off, ++ pub p_vaddr: Elf32_Addr, ++ pub p_paddr: Elf32_Addr, ++ pub p_filesz: Elf32_Word, ++ pub p_memsz: Elf32_Word, ++ pub p_flags: Elf32_Word, ++ pub p_align: Elf32_Word, ++ } ++ ++ pub struct dl_phdr_info { ++ pub dlpi_addr: Elf32_Addr, ++ pub dlpi_name: *const c_char, ++ pub dlpi_phdr: *const Elf32_Phdr, ++ pub dlpi_phnum: Elf32_Half, ++ pub dlpi_adds: c_ulonglong, ++ pub dlpi_subs: c_ulonglong, ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/vxworks/aarch64.rs mesa-25.3.3/subprojects/libc-0.2.169/src/vxworks/aarch64.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/vxworks/aarch64.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/vxworks/aarch64.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,4 @@ ++pub type c_char = u8; ++pub type wchar_t = u32; ++pub type c_long = i64; ++pub type c_ulong = u64; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/vxworks/arm.rs mesa-25.3.3/subprojects/libc-0.2.169/src/vxworks/arm.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/vxworks/arm.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/vxworks/arm.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,4 @@ ++pub type c_char = u8; ++pub type wchar_t = u32; ++pub type c_long = i32; ++pub type c_ulong = u32; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/vxworks/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/vxworks/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/vxworks/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/vxworks/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,2014 @@ ++//! Interface to VxWorks C library ++ ++use core::mem::size_of; ++use core::ptr::null_mut; ++ ++use crate::prelude::*; ++ ++#[cfg_attr(feature = "extra_traits", derive(Debug))] ++pub enum DIR {} ++impl Copy for DIR {} ++impl Clone for DIR { ++ fn clone(&self) -> DIR { ++ *self ++ } ++} ++ ++pub type c_schar = i8; ++pub type c_uchar = u8; ++pub type c_short = i16; ++pub type c_ushort = u16; ++pub type c_int = i32; ++pub type c_uint = u32; ++pub type c_float = f32; ++pub type c_double = f64; ++pub type c_longlong = i64; ++pub type c_ulonglong = u64; ++pub type intmax_t = i64; ++pub type uintmax_t = u64; ++ ++pub type uintptr_t = usize; ++pub type intptr_t = isize; ++pub type ptrdiff_t = isize; ++pub type size_t = crate::uintptr_t; ++pub type ssize_t = intptr_t; ++ ++pub type pid_t = c_int; ++pub type in_addr_t = u32; ++pub type sighandler_t = size_t; ++pub type cpuset_t = u32; ++ ++pub type blkcnt_t = c_long; ++pub type blksize_t = c_long; ++pub type ino_t = c_ulong; ++ ++pub type rlim_t = c_ulong; ++pub type suseconds_t = c_long; ++pub type time_t = c_long; ++ ++pub type errno_t = c_int; ++ ++pub type useconds_t = c_ulong; ++ ++pub type socklen_t = c_uint; ++ ++pub type pthread_t = c_ulong; ++ ++pub type clockid_t = c_int; ++ ++//defined for the structs ++pub type dev_t = c_ulong; ++pub type mode_t = c_int; ++pub type nlink_t = c_ulong; ++pub type uid_t = c_ushort; ++pub type gid_t = c_ushort; ++pub type sigset_t = c_ulonglong; ++pub type key_t = c_long; ++ ++pub type nfds_t = c_uint; ++pub type stat64 = crate::stat; ++ ++pub type pthread_key_t = c_ulong; ++ ++// From b_off_t.h ++pub type off_t = c_longlong; ++pub type off64_t = off_t; ++ ++// From b_BOOL.h ++pub type BOOL = c_int; ++ ++// From vxWind.h .. ++pub type _Vx_OBJ_HANDLE = c_int; ++pub type _Vx_TASK_ID = crate::_Vx_OBJ_HANDLE; ++pub type _Vx_MSG_Q_ID = crate::_Vx_OBJ_HANDLE; ++pub type _Vx_SEM_ID_KERNEL = crate::_Vx_OBJ_HANDLE; ++pub type _Vx_RTP_ID = crate::_Vx_OBJ_HANDLE; ++pub type _Vx_SD_ID = crate::_Vx_OBJ_HANDLE; ++pub type _Vx_CONDVAR_ID = crate::_Vx_OBJ_HANDLE; ++pub type _Vx_SEM_ID = *mut crate::_Vx_semaphore; ++pub type OBJ_HANDLE = crate::_Vx_OBJ_HANDLE; ++pub type TASK_ID = crate::OBJ_HANDLE; ++pub type MSG_Q_ID = crate::OBJ_HANDLE; ++pub type SEM_ID_KERNEL = crate::OBJ_HANDLE; ++pub type RTP_ID = crate::OBJ_HANDLE; ++pub type SD_ID = crate::OBJ_HANDLE; ++pub type CONDVAR_ID = crate::OBJ_HANDLE; ++pub type STATUS = crate::OBJ_HANDLE; ++ ++// From vxTypes.h ++pub type _Vx_usr_arg_t = isize; ++pub type _Vx_exit_code_t = isize; ++pub type _Vx_ticks_t = c_uint; ++pub type _Vx_ticks64_t = c_ulonglong; ++ ++pub type sa_family_t = c_uchar; ++ ++// mqueue.h ++pub type mqd_t = c_int; ++ ++#[cfg_attr(feature = "extra_traits", derive(Debug))] ++pub enum _Vx_semaphore {} ++impl Copy for _Vx_semaphore {} ++impl Clone for _Vx_semaphore { ++ fn clone(&self) -> _Vx_semaphore { ++ *self ++ } ++} ++ ++impl siginfo_t { ++ pub unsafe fn si_addr(&self) -> *mut c_void { ++ self.si_addr ++ } ++ ++ pub unsafe fn si_value(&self) -> crate::sigval { ++ self.si_value ++ } ++ ++ pub unsafe fn si_pid(&self) -> crate::pid_t { ++ self.si_pid ++ } ++ ++ pub unsafe fn si_uid(&self) -> crate::uid_t { ++ self.si_uid ++ } ++ ++ pub unsafe fn si_status(&self) -> c_int { ++ self.si_status ++ } ++} ++ ++s! { ++ // b_pthread_condattr_t.h ++ pub struct pthread_condattr_t { ++ pub condAttrStatus: c_int, ++ pub condAttrPshared: c_int, ++ pub condAttrClockId: crate::clockid_t, ++ } ++ ++ // b_pthread_cond_t.h ++ pub struct pthread_cond_t { ++ pub condSemId: crate::_Vx_SEM_ID, ++ pub condValid: c_int, ++ pub condInitted: c_int, ++ pub condRefCount: c_int, ++ pub condMutex: *mut crate::pthread_mutex_t, ++ pub condAttr: crate::pthread_condattr_t, ++ pub condSemName: [c_char; _PTHREAD_SHARED_SEM_NAME_MAX], ++ } ++ ++ // b_pthread_rwlockattr_t.h ++ pub struct pthread_rwlockattr_t { ++ pub rwlockAttrStatus: c_int, ++ pub rwlockAttrPshared: c_int, ++ pub rwlockAttrMaxReaders: c_uint, ++ pub rwlockAttrConformOpt: c_uint, ++ } ++ ++ // b_pthread_rwlock_t.h ++ pub struct pthread_rwlock_t { ++ pub rwlockSemId: crate::_Vx_SEM_ID, ++ pub rwlockReadersRefCount: c_uint, ++ pub rwlockValid: c_int, ++ pub rwlockInitted: c_int, ++ pub rwlockAttr: crate::pthread_rwlockattr_t, ++ pub rwlockSemName: [c_char; _PTHREAD_SHARED_SEM_NAME_MAX], ++ } ++ ++ // b_struct_timeval.h ++ pub struct timeval { ++ pub tv_sec: crate::time_t, ++ pub tv_usec: crate::suseconds_t, ++ } ++ ++ // socket.h ++ pub struct linger { ++ pub l_onoff: c_int, ++ pub l_linger: c_int, ++ } ++ ++ pub struct sockaddr { ++ pub sa_len: c_uchar, ++ pub sa_family: sa_family_t, ++ pub sa_data: [c_char; 14], ++ } ++ ++ pub struct iovec { ++ pub iov_base: *mut c_void, ++ pub iov_len: size_t, ++ } ++ ++ pub struct msghdr { ++ pub msg_name: *mut c_void, ++ pub msg_namelen: socklen_t, ++ pub msg_iov: *mut iovec, ++ pub msg_iovlen: c_int, ++ pub msg_control: *mut c_void, ++ pub msg_controllen: socklen_t, ++ pub msg_flags: c_int, ++ } ++ ++ pub struct cmsghdr { ++ pub cmsg_len: socklen_t, ++ pub cmsg_level: c_int, ++ pub cmsg_type: c_int, ++ } ++ ++ // poll.h ++ pub struct pollfd { ++ pub fd: c_int, ++ pub events: c_short, ++ pub revents: c_short, ++ } ++ ++ // resource.h ++ pub struct rlimit { ++ pub rlim_cur: crate::rlim_t, ++ pub rlim_max: crate::rlim_t, ++ } ++ ++ // stat.h ++ pub struct stat { ++ pub st_dev: crate::dev_t, ++ pub st_ino: crate::ino_t, ++ pub st_mode: crate::mode_t, ++ pub st_nlink: crate::nlink_t, ++ pub st_uid: crate::uid_t, ++ pub st_gid: crate::gid_t, ++ pub st_rdev: crate::dev_t, ++ pub st_size: off_t, ++ pub st_atime: crate::time_t, ++ pub st_mtime: crate::time_t, ++ pub st_ctime: crate::time_t, ++ pub st_blksize: crate::blksize_t, ++ pub st_blocks: crate::blkcnt_t, ++ pub st_attrib: c_uchar, ++ pub st_reserved1: c_int, ++ pub st_reserved2: c_int, ++ pub st_reserved3: c_int, ++ pub st_reserved4: c_int, ++ } ++ ++ //b_struct__Timespec.h ++ pub struct _Timespec { ++ pub tv_sec: crate::time_t, ++ pub tv_nsec: c_long, ++ } ++ ++ // b_struct__Sched_param.h ++ pub struct sched_param { ++ pub sched_priority: c_int, /* scheduling priority */ ++ pub sched_ss_low_priority: c_int, /* low scheduling priority */ ++ pub sched_ss_repl_period: crate::_Timespec, /* replenishment period */ ++ pub sched_ss_init_budget: crate::_Timespec, /* initial budget */ ++ pub sched_ss_max_repl: c_int, /* max pending replenishment */ ++ } ++ ++ // b_pthread_attr_t.h ++ pub struct pthread_attr_t { ++ pub threadAttrStatus: c_int, ++ pub threadAttrStacksize: size_t, ++ pub threadAttrStackaddr: *mut c_void, ++ pub threadAttrGuardsize: size_t, ++ pub threadAttrDetachstate: c_int, ++ pub threadAttrContentionscope: c_int, ++ pub threadAttrInheritsched: c_int, ++ pub threadAttrSchedpolicy: c_int, ++ pub threadAttrName: *mut c_char, ++ pub threadAttrOptions: c_int, ++ pub threadAttrSchedparam: crate::sched_param, ++ } ++ ++ // signal.h ++ ++ pub struct sigaction { ++ pub sa_u: crate::sa_u_t, ++ pub sa_mask: crate::sigset_t, ++ pub sa_flags: c_int, ++ } ++ ++ // b_stack_t.h ++ pub struct stack_t { ++ pub ss_sp: *mut c_void, ++ pub ss_size: size_t, ++ pub ss_flags: c_int, ++ } ++ ++ // signal.h ++ pub struct siginfo_t { ++ pub si_signo: c_int, ++ pub si_code: c_int, ++ pub si_value: crate::sigval, ++ pub si_errno: c_int, ++ pub si_status: c_int, ++ pub si_addr: *mut c_void, ++ pub si_uid: crate::uid_t, ++ pub si_pid: crate::pid_t, ++ } ++ ++ // pthread.h (krnl) ++ // b_pthread_mutexattr_t.h (usr) ++ pub struct pthread_mutexattr_t { ++ mutexAttrStatus: c_int, ++ mutexAttrPshared: c_int, ++ mutexAttrProtocol: c_int, ++ mutexAttrPrioceiling: c_int, ++ mutexAttrType: c_int, ++ } ++ ++ // pthread.h (krnl) ++ // b_pthread_mutex_t.h (usr) ++ pub struct pthread_mutex_t { ++ pub mutexSemId: crate::_Vx_SEM_ID, /*_Vx_SEM_ID ..*/ ++ pub mutexValid: c_int, ++ pub mutexInitted: c_int, ++ pub mutexCondRefCount: c_int, ++ pub mutexSavPriority: c_int, ++ pub mutexAttr: crate::pthread_mutexattr_t, ++ pub mutexSemName: [c_char; _PTHREAD_SHARED_SEM_NAME_MAX], ++ } ++ ++ // b_struct_timespec.h ++ pub struct timespec { ++ pub tv_sec: crate::time_t, ++ pub tv_nsec: c_long, ++ } ++ ++ // time.h ++ pub struct tm { ++ pub tm_sec: c_int, ++ pub tm_min: c_int, ++ pub tm_hour: c_int, ++ pub tm_mday: c_int, ++ pub tm_mon: c_int, ++ pub tm_year: c_int, ++ pub tm_wday: c_int, ++ pub tm_yday: c_int, ++ pub tm_isdst: c_int, ++ } ++ ++ // in.h ++ pub struct in_addr { ++ pub s_addr: in_addr_t, ++ } ++ ++ // in.h ++ pub struct ip_mreq { ++ pub imr_multiaddr: in_addr, ++ pub imr_interface: in_addr, ++ } ++ ++ // in6.h ++ #[repr(align(4))] ++ pub struct in6_addr { ++ pub s6_addr: [u8; 16], ++ } ++ ++ // in6.h ++ pub struct ipv6_mreq { ++ pub ipv6mr_multiaddr: in6_addr, ++ pub ipv6mr_interface: c_uint, ++ } ++ ++ // netdb.h ++ pub struct addrinfo { ++ pub ai_flags: c_int, ++ pub ai_family: c_int, ++ pub ai_socktype: c_int, ++ pub ai_protocol: c_int, ++ pub ai_addrlen: size_t, ++ pub ai_canonname: *mut c_char, ++ pub ai_addr: *mut crate::sockaddr, ++ pub ai_next: *mut crate::addrinfo, ++ } ++ ++ // in.h ++ pub struct sockaddr_in { ++ pub sin_len: u8, ++ pub sin_family: u8, ++ pub sin_port: u16, ++ pub sin_addr: crate::in_addr, ++ pub sin_zero: [c_char; 8], ++ } ++ ++ // in6.h ++ pub struct sockaddr_in6 { ++ pub sin6_len: u8, ++ pub sin6_family: u8, ++ pub sin6_port: u16, ++ pub sin6_flowinfo: u32, ++ pub sin6_addr: crate::in6_addr, ++ pub sin6_scope_id: u32, ++ } ++ ++ pub struct Dl_info { ++ pub dli_fname: *const c_char, ++ pub dli_fbase: *mut c_void, ++ pub dli_sname: *const c_char, ++ pub dli_saddr: *mut c_void, ++ } ++ ++ pub struct mq_attr { ++ pub mq_maxmsg: c_long, ++ pub mq_msgsize: c_long, ++ pub mq_flags: c_long, ++ pub mq_curmsgs: c_long, ++ } ++} ++ ++s_no_extra_traits! { ++ // dirent.h ++ pub struct dirent { ++ pub d_ino: crate::ino_t, ++ pub d_name: [c_char; _PARM_NAME_MAX as usize + 1], ++ } ++ ++ pub struct sockaddr_un { ++ pub sun_len: u8, ++ pub sun_family: sa_family_t, ++ pub sun_path: [c_char; 104], ++ } ++ ++ // rtpLibCommon.h ++ pub struct RTP_DESC { ++ pub status: c_int, ++ pub options: u32, ++ pub entrAddr: *mut c_void, ++ pub initTaskId: crate::TASK_ID, ++ pub parentId: crate::RTP_ID, ++ pub pathName: [c_char; VX_RTP_NAME_LENGTH as usize + 1], ++ pub taskCnt: c_int, ++ pub textStart: *mut c_void, ++ pub textEnd: *mut c_void, ++ } ++ // socket.h ++ pub struct sockaddr_storage { ++ pub ss_len: c_uchar, ++ pub ss_family: crate::sa_family_t, ++ pub __ss_pad1: [c_char; _SS_PAD1SIZE], ++ pub __ss_align: i32, ++ pub __ss_pad2: [c_char; _SS_PAD2SIZE], ++ } ++ ++ pub union sa_u_t { ++ pub sa_handler: Option !>, ++ pub sa_sigaction: ++ Option !>, ++ } ++ ++ pub union sigval { ++ pub sival_int: c_int, ++ pub sival_ptr: *mut c_void, ++ } ++} ++ ++cfg_if! { ++ if #[cfg(feature = "extra_traits")] { ++ impl fmt::Debug for dirent { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("dirent") ++ .field("d_ino", &self.d_ino) ++ .field("d_name", &&self.d_name[..]) ++ .finish() ++ } ++ } ++ ++ impl fmt::Debug for sockaddr_un { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sockaddr_un") ++ .field("sun_len", &self.sun_len) ++ .field("sun_family", &self.sun_family) ++ .field("sun_path", &&self.sun_path[..]) ++ .finish() ++ } ++ } ++ ++ impl fmt::Debug for RTP_DESC { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("RTP_DESC") ++ .field("status", &self.status) ++ .field("options", &self.options) ++ .field("entrAddr", &self.entrAddr) ++ .field("initTaskId", &self.initTaskId) ++ .field("parentId", &self.parentId) ++ .field("pathName", &&self.pathName[..]) ++ .field("taskCnt", &self.taskCnt) ++ .field("textStart", &self.textStart) ++ .field("textEnd", &self.textEnd) ++ .finish() ++ } ++ } ++ impl fmt::Debug for sockaddr_storage { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("sockaddr_storage") ++ .field("ss_len", &self.ss_len) ++ .field("ss_family", &self.ss_family) ++ .field("__ss_pad1", &&self.__ss_pad1[..]) ++ .field("__ss_align", &self.__ss_align) ++ .field("__ss_pad2", &&self.__ss_pad2[..]) ++ .finish() ++ } ++ } ++ ++ impl PartialEq for sa_u_t { ++ fn eq(&self, other: &sa_u_t) -> bool { ++ unsafe { ++ let h1 = match self.sa_handler { ++ Some(handler) => handler as usize, ++ None => 0 as usize, ++ }; ++ let h2 = match other.sa_handler { ++ Some(handler) => handler as usize, ++ None => 0 as usize, ++ }; ++ h1 == h2 ++ } ++ } ++ } ++ impl Eq for sa_u_t {} ++ impl hash::Hash for sa_u_t { ++ fn hash(&self, state: &mut H) { ++ unsafe { ++ let h = match self.sa_handler { ++ Some(handler) => handler as usize, ++ None => 0 as usize, ++ }; ++ h.hash(state) ++ } ++ } ++ } ++ ++ impl PartialEq for sigval { ++ fn eq(&self, other: &sigval) -> bool { ++ unsafe { self.sival_ptr as usize == other.sival_ptr as usize } ++ } ++ } ++ impl Eq for sigval {} ++ impl hash::Hash for sigval { ++ fn hash(&self, state: &mut H) { ++ unsafe { (self.sival_ptr as usize).hash(state) }; ++ } ++ } ++ } ++} ++ ++pub const STDIN_FILENO: c_int = 0; ++pub const STDOUT_FILENO: c_int = 1; ++pub const STDERR_FILENO: c_int = 2; ++ ++pub const EXIT_SUCCESS: c_int = 0; ++pub const EXIT_FAILURE: c_int = 1; ++ ++pub const EAI_SERVICE: c_int = 9; ++pub const EAI_SOCKTYPE: c_int = 10; ++pub const EAI_SYSTEM: c_int = 11; ++ ++// FIXME: This is not defined in vxWorks, but we have to define it here ++// to make the building pass for getrandom and std ++pub const RTLD_DEFAULT: *mut c_void = 0i64 as *mut c_void; ++ ++//Clock Lib Stuff ++pub const CLOCK_REALTIME: c_int = 0x0; ++pub const CLOCK_MONOTONIC: c_int = 0x1; ++pub const CLOCK_PROCESS_CPUTIME_ID: c_int = 0x2; ++pub const CLOCK_THREAD_CPUTIME_ID: c_int = 0x3; ++pub const TIMER_ABSTIME: c_int = 0x1; ++pub const TIMER_RELTIME: c_int = 0x0; ++ ++// PTHREAD STUFF ++pub const PTHREAD_INITIALIZED_OBJ: c_int = 0xF70990EF; ++pub const PTHREAD_DESTROYED_OBJ: c_int = -1; ++pub const PTHREAD_VALID_OBJ: c_int = 0xEC542A37; ++pub const PTHREAD_INVALID_OBJ: c_int = -1; ++pub const PTHREAD_UNUSED_YET_OBJ: c_int = -1; ++ ++pub const PTHREAD_PRIO_NONE: c_int = 0; ++pub const PTHREAD_PRIO_INHERIT: c_int = 1; ++pub const PTHREAD_PRIO_PROTECT: c_int = 2; ++ ++pub const PTHREAD_MUTEX_NORMAL: c_int = 0; ++pub const PTHREAD_MUTEX_ERRORCHECK: c_int = 1; ++pub const PTHREAD_MUTEX_RECURSIVE: c_int = 2; ++pub const PTHREAD_MUTEX_DEFAULT: c_int = PTHREAD_MUTEX_NORMAL; ++pub const PTHREAD_STACK_MIN: usize = 4096; ++pub const _PTHREAD_SHARED_SEM_NAME_MAX: usize = 30; ++ ++//sched.h ++pub const SCHED_FIFO: c_int = 0x01; ++pub const SCHED_RR: c_int = 0x02; ++pub const SCHED_OTHER: c_int = 0x04; ++pub const SCHED_SPORADIC: c_int = 0x08; ++pub const PRIO_PROCESS: c_uint = 0; ++pub const SCHED_FIFO_HIGH_PRI: c_int = 255; ++pub const SCHED_FIFO_LOW_PRI: c_int = 0; ++pub const SCHED_RR_HIGH_PRI: c_int = 255; ++pub const SCHED_RR_LOW_PRI: c_int = 0; ++pub const SCHED_SPORADIC_HIGH_PRI: c_int = 255; ++pub const SCHED_SPORADIC_LOW_PRI: c_int = 0; ++ ++// ERRNO STUFF ++pub const ERROR: c_int = -1; ++pub const OK: c_int = 0; ++pub const EPERM: c_int = 1; /* Not owner */ ++pub const ENOENT: c_int = 2; /* No such file or directory */ ++pub const ESRCH: c_int = 3; /* No such process */ ++pub const EINTR: c_int = 4; /* Interrupted system call */ ++pub const EIO: c_int = 5; /* I/O error */ ++pub const ENXIO: c_int = 6; /* No such device or address */ ++pub const E2BIG: c_int = 7; /* Arg list too long */ ++pub const ENOEXEC: c_int = 8; /* Exec format error */ ++pub const EBADF: c_int = 9; /* Bad file number */ ++pub const ECHILD: c_int = 10; /* No children */ ++pub const EAGAIN: c_int = 11; /* No more processes */ ++pub const ENOMEM: c_int = 12; /* Not enough core */ ++pub const EACCES: c_int = 13; /* Permission denied */ ++pub const EFAULT: c_int = 14; ++pub const ENOTEMPTY: c_int = 15; ++pub const EBUSY: c_int = 16; ++pub const EEXIST: c_int = 17; ++pub const EXDEV: c_int = 18; ++pub const ENODEV: c_int = 19; ++pub const ENOTDIR: c_int = 20; ++pub const EISDIR: c_int = 21; ++pub const EINVAL: c_int = 22; ++pub const ENAMETOOLONG: c_int = 26; ++pub const EFBIG: c_int = 27; ++pub const ENOSPC: c_int = 28; ++pub const ESPIPE: c_int = 29; ++pub const EROFS: c_int = 30; ++pub const EMLINK: c_int = 31; ++pub const EPIPE: c_int = 32; ++pub const EDEADLK: c_int = 33; ++pub const ERANGE: c_int = 38; ++pub const EDESTADDRREQ: c_int = 40; ++pub const EPROTOTYPE: c_int = 41; ++pub const ENOPROTOOPT: c_int = 42; ++pub const EPROTONOSUPPORT: c_int = 43; ++pub const ESOCKTNOSUPPORT: c_int = 44; ++pub const EOPNOTSUPP: c_int = 45; ++pub const EPFNOSUPPORT: c_int = 46; ++pub const EAFNOSUPPORT: c_int = 47; ++pub const EADDRINUSE: c_int = 48; ++pub const EADDRNOTAVAIL: c_int = 49; ++pub const ENOTSOCK: c_int = 50; ++pub const ENETUNREACH: c_int = 51; ++pub const ENETRESET: c_int = 52; ++pub const ECONNABORTED: c_int = 53; ++pub const ECONNRESET: c_int = 54; ++pub const ENOBUFS: c_int = 55; ++pub const EISCONN: c_int = 56; ++pub const ENOTCONN: c_int = 57; ++pub const ESHUTDOWN: c_int = 58; ++pub const ETOOMANYREFS: c_int = 59; ++pub const ETIMEDOUT: c_int = 60; ++pub const ECONNREFUSED: c_int = 61; ++pub const ENETDOWN: c_int = 62; ++pub const ETXTBSY: c_int = 63; ++pub const ELOOP: c_int = 64; ++pub const EHOSTUNREACH: c_int = 65; ++pub const EINPROGRESS: c_int = 68; ++pub const EALREADY: c_int = 69; ++pub const EWOULDBLOCK: c_int = 70; ++pub const ENOSYS: c_int = 71; ++pub const EDQUOT: c_int = 83; ++pub const ESTALE: c_int = 88; ++ ++// NFS errnos: Refer to pkgs_v2/storage/fs/nfs/h/nfs/nfsCommon.h ++const M_nfsStat: c_int = 48 << 16; ++enum nfsstat { ++ NFSERR_REMOTE = 71, ++ NFSERR_WFLUSH = 99, ++ NFSERR_BADHANDLE = 10001, ++ NFSERR_NOT_SYNC = 10002, ++ NFSERR_BAD_COOKIE = 10003, ++ NFSERR_TOOSMALL = 10005, ++ NFSERR_BADTYPE = 10007, ++ NFSERR_JUKEBOX = 10008, ++} ++ ++pub const S_nfsLib_NFS_OK: c_int = OK; ++pub const S_nfsLib_NFSERR_PERM: c_int = EPERM; ++pub const S_nfsLib_NFSERR_NOENT: c_int = ENOENT; ++pub const S_nfsLib_NFSERR_IO: c_int = EIO; ++pub const S_nfsLib_NFSERR_NXIO: c_int = ENXIO; ++pub const S_nfsLib_NFSERR_ACCESS: c_int = EACCES; ++pub const S_nfsLib_NFSERR_EXIST: c_int = EEXIST; ++pub const S_nfsLib_NFSERR_ENODEV: c_int = ENODEV; ++pub const S_nfsLib_NFSERR_NOTDIR: c_int = ENOTDIR; ++pub const S_nfsLib_NFSERR_ISDIR: c_int = EISDIR; ++pub const S_nfsLib_NFSERR_INVAL: c_int = EINVAL; ++pub const S_nfsLib_NFSERR_FBIG: c_int = EFBIG; ++pub const S_nfsLib_NFSERR_NOSPC: c_int = ENOSPC; ++pub const S_nfsLib_NFSERR_ROFS: c_int = EROFS; ++pub const S_nfsLib_NFSERR_NAMETOOLONG: c_int = ENAMETOOLONG; ++pub const S_nfsLib_NFSERR_NOTEMPTY: c_int = ENOTEMPTY; ++pub const S_nfsLib_NFSERR_DQUOT: c_int = EDQUOT; ++pub const S_nfsLib_NFSERR_STALE: c_int = ESTALE; ++pub const S_nfsLib_NFSERR_WFLUSH: c_int = M_nfsStat | nfsstat::NFSERR_WFLUSH as c_int; ++pub const S_nfsLib_NFSERR_REMOTE: c_int = M_nfsStat | nfsstat::NFSERR_REMOTE as c_int; ++pub const S_nfsLib_NFSERR_BADHANDLE: c_int = M_nfsStat | nfsstat::NFSERR_BADHANDLE as c_int; ++pub const S_nfsLib_NFSERR_NOT_SYNC: c_int = M_nfsStat | nfsstat::NFSERR_NOT_SYNC as c_int; ++pub const S_nfsLib_NFSERR_BAD_COOKIE: c_int = M_nfsStat | nfsstat::NFSERR_BAD_COOKIE as c_int; ++pub const S_nfsLib_NFSERR_NOTSUPP: c_int = EOPNOTSUPP; ++pub const S_nfsLib_NFSERR_TOOSMALL: c_int = M_nfsStat | nfsstat::NFSERR_TOOSMALL as c_int; ++pub const S_nfsLib_NFSERR_SERVERFAULT: c_int = EIO; ++pub const S_nfsLib_NFSERR_BADTYPE: c_int = M_nfsStat | nfsstat::NFSERR_BADTYPE as c_int; ++pub const S_nfsLib_NFSERR_JUKEBOX: c_int = M_nfsStat | nfsstat::NFSERR_JUKEBOX as c_int; ++ ++// internal offset values for below constants ++const taskErrorBase: c_int = 0x00030000; ++const semErrorBase: c_int = 0x00160000; ++const objErrorBase: c_int = 0x003d0000; ++ ++// taskLibCommon.h ++pub const S_taskLib_NAME_NOT_FOUND: c_int = taskErrorBase + 0x0065; ++pub const S_taskLib_TASK_HOOK_TABLE_FULL: c_int = taskErrorBase + 0x0066; ++pub const S_taskLib_TASK_HOOK_NOT_FOUND: c_int = taskErrorBase + 0x0067; ++pub const S_taskLib_ILLEGAL_PRIORITY: c_int = taskErrorBase + 0x0068; ++ ++// FIXME: could also be useful for TASK_DESC type ++pub const VX_TASK_NAME_LENGTH: c_int = 31; ++ ++// semLibCommon.h ++pub const S_semLib_INVALID_STATE: c_int = semErrorBase + 0x0065; ++pub const S_semLib_INVALID_OPTION: c_int = semErrorBase + 0x0066; ++pub const S_semLib_INVALID_QUEUE_TYPE: c_int = semErrorBase + 0x0067; ++pub const S_semLib_INVALID_OPERATION: c_int = semErrorBase + 0x0068; ++ ++// objLibCommon.h ++pub const S_objLib_OBJ_ID_ERROR: c_int = objErrorBase + 0x0001; ++pub const S_objLib_OBJ_UNAVAILABLE: c_int = objErrorBase + 0x0002; ++pub const S_objLib_OBJ_DELETED: c_int = objErrorBase + 0x0003; ++pub const S_objLib_OBJ_TIMEOUT: c_int = objErrorBase + 0x0004; ++pub const S_objLib_OBJ_NO_METHOD: c_int = objErrorBase + 0x0005; ++ ++// in.h ++pub const IPPROTO_IP: c_int = 0; ++pub const IPPROTO_IPV6: c_int = 41; ++ ++pub const IP_TTL: c_int = 4; ++pub const IP_MULTICAST_IF: c_int = 9; ++pub const IP_MULTICAST_TTL: c_int = 10; ++pub const IP_MULTICAST_LOOP: c_int = 11; ++pub const IP_ADD_MEMBERSHIP: c_int = 12; ++pub const IP_DROP_MEMBERSHIP: c_int = 13; ++ ++// in6.h ++pub const IPV6_V6ONLY: c_int = 1; ++pub const IPV6_UNICAST_HOPS: c_int = 4; ++pub const IPV6_MULTICAST_IF: c_int = 9; ++pub const IPV6_MULTICAST_HOPS: c_int = 10; ++pub const IPV6_MULTICAST_LOOP: c_int = 11; ++pub const IPV6_ADD_MEMBERSHIP: c_int = 12; ++pub const IPV6_DROP_MEMBERSHIP: c_int = 13; ++ ++// STAT Stuff ++pub const S_IFMT: c_int = 0o17_0000; ++pub const S_IFIFO: c_int = 0o1_0000; ++pub const S_IFCHR: c_int = 0o2_0000; ++pub const S_IFDIR: c_int = 0o4_0000; ++pub const S_IFBLK: c_int = 0o6_0000; ++pub const S_IFREG: c_int = 0o10_0000; ++pub const S_IFLNK: c_int = 0o12_0000; ++pub const S_IFSHM: c_int = 0o13_0000; ++pub const S_IFSOCK: c_int = 0o14_0000; ++pub const S_ISUID: c_int = 0o4000; ++pub const S_ISGID: c_int = 0o2000; ++pub const S_ISTXT: c_int = 0o1000; ++pub const S_ISVTX: c_int = 0o1000; ++pub const S_IRUSR: c_int = 0o0400; ++pub const S_IWUSR: c_int = 0o0200; ++pub const S_IXUSR: c_int = 0o0100; ++pub const S_IRWXU: c_int = 0o0700; ++pub const S_IRGRP: c_int = 0o0040; ++pub const S_IWGRP: c_int = 0o0020; ++pub const S_IXGRP: c_int = 0o0010; ++pub const S_IRWXG: c_int = 0o0070; ++pub const S_IROTH: c_int = 0o0004; ++pub const S_IWOTH: c_int = 0o0002; ++pub const S_IXOTH: c_int = 0o0001; ++pub const S_IRWXO: c_int = 0o0007; ++ ++// socket.h ++pub const SOL_SOCKET: c_int = 0xffff; ++pub const SOMAXCONN: c_int = 128; ++ ++pub const SO_DEBUG: c_int = 0x0001; ++pub const SO_REUSEADDR: c_int = 0x0004; ++pub const SO_KEEPALIVE: c_int = 0x0008; ++pub const SO_DONTROUTE: c_int = 0x0010; ++pub const SO_RCVLOWAT: c_int = 0x0012; ++pub const SO_SNDLOWAT: c_int = 0x0013; ++pub const SO_SNDTIMEO: c_int = 0x1005; ++pub const SO_ACCEPTCONN: c_int = 0x001e; ++pub const SO_BROADCAST: c_int = 0x0020; ++pub const SO_USELOOPBACK: c_int = 0x0040; ++pub const SO_LINGER: c_int = 0x0080; ++pub const SO_REUSEPORT: c_int = 0x0200; ++ ++pub const SO_VLAN: c_int = 0x8000; ++ ++pub const SO_SNDBUF: c_int = 0x1001; ++pub const SO_RCVBUF: c_int = 0x1002; ++pub const SO_RCVTIMEO: c_int = 0x1006; ++pub const SO_ERROR: c_int = 0x1007; ++pub const SO_TYPE: c_int = 0x1008; ++pub const SO_BINDTODEVICE: c_int = 0x1010; ++pub const SO_OOBINLINE: c_int = 0x1011; ++pub const SO_CONNTIMEO: c_int = 0x100a; ++ ++pub const SOCK_STREAM: c_int = 1; ++pub const SOCK_DGRAM: c_int = 2; ++pub const SOCK_RAW: c_int = 3; ++pub const SOCK_RDM: c_int = 4; ++pub const SOCK_SEQPACKET: c_int = 5; ++pub const SOCK_PACKET: c_int = 10; ++ ++pub const _SS_MAXSIZE: usize = 128; ++pub const _SS_ALIGNSIZE: usize = size_of::(); ++pub const _SS_PAD1SIZE: usize = ++ _SS_ALIGNSIZE - size_of::() - size_of::(); ++pub const _SS_PAD2SIZE: usize = _SS_MAXSIZE ++ - size_of::() ++ - size_of::() ++ - _SS_PAD1SIZE ++ - _SS_ALIGNSIZE; ++ ++pub const MSG_OOB: c_int = 0x0001; ++pub const MSG_PEEK: c_int = 0x0002; ++pub const MSG_DONTROUTE: c_int = 0x0004; ++pub const MSG_EOR: c_int = 0x0008; ++pub const MSG_TRUNC: c_int = 0x0010; ++pub const MSG_CTRUNC: c_int = 0x0020; ++pub const MSG_WAITALL: c_int = 0x0040; ++pub const MSG_DONTWAIT: c_int = 0x0080; ++pub const MSG_EOF: c_int = 0x0100; ++pub const MSG_EXP: c_int = 0x0200; ++pub const MSG_MBUF: c_int = 0x0400; ++pub const MSG_NOTIFICATION: c_int = 0x0800; ++pub const MSG_COMPAT: c_int = 0x8000; ++ ++pub const AF_UNSPEC: c_int = 0; ++pub const AF_LOCAL: c_int = 1; ++pub const AF_UNIX: c_int = AF_LOCAL; ++pub const AF_INET: c_int = 2; ++pub const AF_NETLINK: c_int = 16; ++pub const AF_ROUTE: c_int = 17; ++pub const AF_LINK: c_int = 18; ++pub const AF_PACKET: c_int = 19; ++pub const pseudo_AF_KEY: c_int = 27; ++pub const AF_KEY: c_int = pseudo_AF_KEY; ++pub const AF_INET6: c_int = 28; ++pub const AF_SOCKDEV: c_int = 31; ++pub const AF_TIPC: c_int = 33; ++pub const AF_MIPC: c_int = 34; ++pub const AF_MIPC_SAFE: c_int = 35; ++pub const AF_MAX: c_int = 37; ++ ++pub const SHUT_RD: c_int = 0; ++pub const SHUT_WR: c_int = 1; ++pub const SHUT_RDWR: c_int = 2; ++ ++pub const IPPROTO_TCP: c_int = 6; ++pub const TCP_NODELAY: c_int = 1; ++pub const TCP_MAXSEG: c_int = 2; ++pub const TCP_NOPUSH: c_int = 3; ++pub const TCP_KEEPIDLE: c_int = 4; ++pub const TCP_KEEPINTVL: c_int = 5; ++pub const TCP_KEEPCNT: c_int = 6; ++ ++// ioLib.h ++pub const FIONREAD: c_int = 0x40040001; ++pub const FIOFLUSH: c_int = 2; ++pub const FIOOPTIONS: c_int = 3; ++pub const FIOBAUDRATE: c_int = 4; ++pub const FIODISKFORMAT: c_int = 5; ++pub const FIODISKINIT: c_int = 6; ++pub const FIOSEEK: c_int = 7; ++pub const FIOWHERE: c_int = 8; ++pub const FIODIRENTRY: c_int = 9; ++pub const FIORENAME: c_int = 10; ++pub const FIOREADYCHANGE: c_int = 11; ++pub const FIODISKCHANGE: c_int = 13; ++pub const FIOCANCEL: c_int = 14; ++pub const FIOSQUEEZE: c_int = 15; ++pub const FIOGETNAME: c_int = 18; ++pub const FIONBIO: c_int = 0x90040010; ++ ++// limits.h ++pub const PATH_MAX: c_int = _PARM_PATH_MAX; ++pub const _POSIX_PATH_MAX: c_int = 256; ++ ++// Some poll stuff ++pub const POLLIN: c_short = 0x0001; ++pub const POLLPRI: c_short = 0x0002; ++pub const POLLOUT: c_short = 0x0004; ++pub const POLLRDNORM: c_short = 0x0040; ++pub const POLLWRNORM: c_short = POLLOUT; ++pub const POLLRDBAND: c_short = 0x0080; ++pub const POLLWRBAND: c_short = 0x0100; ++pub const POLLERR: c_short = 0x0008; ++pub const POLLHUP: c_short = 0x0010; ++pub const POLLNVAL: c_short = 0x0020; ++ ++// fnctlcom.h ++pub const FD_CLOEXEC: c_int = 1; ++pub const F_DUPFD: c_int = 0; ++pub const F_GETFD: c_int = 1; ++pub const F_SETFD: c_int = 2; ++pub const F_GETFL: c_int = 3; ++pub const F_SETFL: c_int = 4; ++pub const F_GETOWN: c_int = 5; ++pub const F_SETOWN: c_int = 6; ++pub const F_GETLK: c_int = 7; ++pub const F_SETLK: c_int = 8; ++pub const F_SETLKW: c_int = 9; ++pub const F_DUPFD_CLOEXEC: c_int = 14; ++ ++// signal.h ++pub const SIG_DFL: sighandler_t = 0 as sighandler_t; ++pub const SIG_IGN: sighandler_t = 1 as sighandler_t; ++pub const SIG_ERR: sighandler_t = -1 as isize as sighandler_t; ++ ++pub const SIGHUP: c_int = 1; ++pub const SIGINT: c_int = 2; ++pub const SIGQUIT: c_int = 3; ++pub const SIGILL: c_int = 4; ++pub const SIGTRAP: c_int = 5; ++pub const SIGABRT: c_int = 6; ++pub const SIGEMT: c_int = 7; ++pub const SIGFPE: c_int = 8; ++pub const SIGKILL: c_int = 9; ++pub const SIGBUS: c_int = 10; ++pub const SIGSEGV: c_int = 11; ++pub const SIGFMT: c_int = 12; ++pub const SIGPIPE: c_int = 13; ++pub const SIGALRM: c_int = 14; ++pub const SIGTERM: c_int = 15; ++pub const SIGCNCL: c_int = 16; ++pub const SIGSTOP: c_int = 17; ++pub const SIGTSTP: c_int = 18; ++pub const SIGCONT: c_int = 19; ++pub const SIGCHLD: c_int = 20; ++pub const SIGTTIN: c_int = 21; ++pub const SIGTTOU: c_int = 22; ++ ++pub const SIG_BLOCK: c_int = 1; ++pub const SIG_UNBLOCK: c_int = 2; ++pub const SIG_SETMASK: c_int = 3; ++ ++pub const SI_SYNC: c_int = 0; ++pub const SI_USER: c_int = -1; ++pub const SI_QUEUE: c_int = -2; ++pub const SI_TIMER: c_int = -3; ++pub const SI_ASYNCIO: c_int = -4; ++pub const SI_MESGQ: c_int = -5; ++pub const SI_CHILD: c_int = -6; ++pub const SI_KILL: c_int = SI_USER; ++ ++// vxParams.h definitions ++pub const _PARM_NAME_MAX: c_int = 255; ++pub const _PARM_PATH_MAX: c_int = 1024; ++ ++// WAIT STUFF ++pub const WNOHANG: c_int = 0x01; ++pub const WUNTRACED: c_int = 0x02; ++ ++const PTHREAD_MUTEXATTR_INITIALIZER: pthread_mutexattr_t = pthread_mutexattr_t { ++ mutexAttrStatus: PTHREAD_INITIALIZED_OBJ, ++ mutexAttrProtocol: PTHREAD_PRIO_NONE, ++ mutexAttrPrioceiling: 0, ++ mutexAttrType: PTHREAD_MUTEX_DEFAULT, ++ mutexAttrPshared: 1, ++}; ++pub const PTHREAD_MUTEX_INITIALIZER: pthread_mutex_t = pthread_mutex_t { ++ mutexSemId: null_mut(), ++ mutexValid: PTHREAD_VALID_OBJ, ++ mutexInitted: PTHREAD_UNUSED_YET_OBJ, ++ mutexCondRefCount: 0, ++ mutexSavPriority: -1, ++ mutexAttr: PTHREAD_MUTEXATTR_INITIALIZER, ++ mutexSemName: [0; _PTHREAD_SHARED_SEM_NAME_MAX], ++}; ++ ++const PTHREAD_CONDATTR_INITIALIZER: pthread_condattr_t = pthread_condattr_t { ++ condAttrStatus: 0xf70990ef, ++ condAttrPshared: 1, ++ condAttrClockId: CLOCK_REALTIME, ++}; ++pub const PTHREAD_COND_INITIALIZER: pthread_cond_t = pthread_cond_t { ++ condSemId: null_mut(), ++ condValid: PTHREAD_VALID_OBJ, ++ condInitted: PTHREAD_UNUSED_YET_OBJ, ++ condRefCount: 0, ++ condMutex: null_mut(), ++ condAttr: PTHREAD_CONDATTR_INITIALIZER, ++ condSemName: [0; _PTHREAD_SHARED_SEM_NAME_MAX], ++}; ++ ++const PTHREAD_RWLOCKATTR_INITIALIZER: pthread_rwlockattr_t = pthread_rwlockattr_t { ++ rwlockAttrStatus: PTHREAD_INITIALIZED_OBJ, ++ rwlockAttrPshared: 1, ++ rwlockAttrMaxReaders: 0, ++ rwlockAttrConformOpt: 1, ++}; ++pub const PTHREAD_RWLOCK_INITIALIZER: pthread_rwlock_t = pthread_rwlock_t { ++ rwlockSemId: null_mut(), ++ rwlockReadersRefCount: 0, ++ rwlockValid: PTHREAD_VALID_OBJ, ++ rwlockInitted: PTHREAD_UNUSED_YET_OBJ, ++ rwlockAttr: PTHREAD_RWLOCKATTR_INITIALIZER, ++ rwlockSemName: [0; _PTHREAD_SHARED_SEM_NAME_MAX], ++}; ++ ++pub const SEEK_SET: c_int = 0; ++pub const SEEK_CUR: c_int = 1; ++pub const SEEK_END: c_int = 2; ++ ++// rtpLibCommon.h ++pub const VX_RTP_NAME_LENGTH: c_int = 255; ++pub const RTP_ID_ERROR: crate::RTP_ID = -1; ++ ++// h/public/unistd.h ++pub const _SC_GETPW_R_SIZE_MAX: c_int = 21; // Via unistd.h ++pub const _SC_PAGESIZE: c_int = 39; ++pub const O_ACCMODE: c_int = 3; ++pub const O_CLOEXEC: c_int = 0x100000; // fcntlcom ++pub const O_EXCL: c_int = 0x0800; ++pub const O_CREAT: c_int = 0x0200; ++pub const O_TRUNC: c_int = 0x0400; ++pub const O_APPEND: c_int = 0x0008; ++pub const O_RDWR: c_int = 0x0002; ++pub const O_WRONLY: c_int = 0x0001; ++pub const O_RDONLY: c_int = 0; ++pub const O_NONBLOCK: c_int = 0x4000; ++ ++// mman.h ++pub const PROT_NONE: c_int = 0x0000; ++pub const PROT_READ: c_int = 0x0001; ++pub const PROT_WRITE: c_int = 0x0002; ++pub const PROT_EXEC: c_int = 0x0004; ++ ++pub const MAP_SHARED: c_int = 0x0001; ++pub const MAP_PRIVATE: c_int = 0x0002; ++pub const MAP_ANON: c_int = 0x0004; ++pub const MAP_ANONYMOUS: c_int = MAP_ANON; ++pub const MAP_FIXED: c_int = 0x0010; ++pub const MAP_CONTIG: c_int = 0x0020; ++ ++pub const MAP_FAILED: *mut c_void = !0 as *mut c_void; ++ ++#[cfg_attr(feature = "extra_traits", derive(Debug))] ++pub enum FILE {} ++impl Copy for FILE {} ++impl Clone for FILE { ++ fn clone(&self) -> FILE { ++ *self ++ } ++} ++#[cfg_attr(feature = "extra_traits", derive(Debug))] ++pub enum fpos_t {} // FIXME: fill this out with a struct ++impl Copy for fpos_t {} ++impl Clone for fpos_t { ++ fn clone(&self) -> fpos_t { ++ *self ++ } ++} ++ ++f! { ++ pub {const} fn CMSG_ALIGN(len: usize) -> usize { ++ len + mem::size_of::() - 1 & !(mem::size_of::() - 1) ++ } ++ ++ pub fn CMSG_NXTHDR(mhdr: *const msghdr, cmsg: *const cmsghdr) -> *mut cmsghdr { ++ let next = cmsg as usize ++ + CMSG_ALIGN((*cmsg).cmsg_len as usize) ++ + CMSG_ALIGN(mem::size_of::()); ++ let max = (*mhdr).msg_control as usize + (*mhdr).msg_controllen as usize; ++ if next <= max { ++ (cmsg as usize + CMSG_ALIGN((*cmsg).cmsg_len as usize)) as *mut cmsghdr ++ } else { ++ 0 as *mut cmsghdr ++ } ++ } ++ ++ pub fn CMSG_FIRSTHDR(mhdr: *const msghdr) -> *mut cmsghdr { ++ if (*mhdr).msg_controllen as usize > 0 { ++ (*mhdr).msg_control as *mut cmsghdr ++ } else { ++ 0 as *mut cmsghdr ++ } ++ } ++ ++ pub fn CMSG_DATA(cmsg: *const cmsghdr) -> *mut c_uchar { ++ (cmsg as *mut c_uchar).offset(CMSG_ALIGN(mem::size_of::()) as isize) ++ } ++ ++ pub {const} fn CMSG_SPACE(length: c_uint) -> c_uint { ++ (CMSG_ALIGN(length as usize) + CMSG_ALIGN(mem::size_of::())) as c_uint ++ } ++ ++ pub {const} fn CMSG_LEN(length: c_uint) -> c_uint { ++ CMSG_ALIGN(mem::size_of::()) as c_uint + length ++ } ++} ++ ++extern "C" { ++ pub fn isalnum(c: c_int) -> c_int; ++ pub fn isalpha(c: c_int) -> c_int; ++ pub fn iscntrl(c: c_int) -> c_int; ++ pub fn isdigit(c: c_int) -> c_int; ++ pub fn isgraph(c: c_int) -> c_int; ++ pub fn islower(c: c_int) -> c_int; ++ pub fn isprint(c: c_int) -> c_int; ++ pub fn ispunct(c: c_int) -> c_int; ++ pub fn isspace(c: c_int) -> c_int; ++ pub fn isupper(c: c_int) -> c_int; ++ pub fn isxdigit(c: c_int) -> c_int; ++ pub fn isblank(c: c_int) -> c_int; ++ pub fn tolower(c: c_int) -> c_int; ++ pub fn toupper(c: c_int) -> c_int; ++ pub fn fopen(filename: *const c_char, mode: *const c_char) -> *mut FILE; ++ pub fn freopen(filename: *const c_char, mode: *const c_char, file: *mut FILE) -> *mut FILE; ++ pub fn fflush(file: *mut FILE) -> c_int; ++ pub fn fclose(file: *mut FILE) -> c_int; ++ pub fn remove(filename: *const c_char) -> c_int; ++ pub fn rename(oldname: *const c_char, newname: *const c_char) -> c_int; ++ pub fn tmpfile() -> *mut FILE; ++ pub fn setvbuf(stream: *mut FILE, buffer: *mut c_char, mode: c_int, size: size_t) -> c_int; ++ pub fn setbuf(stream: *mut FILE, buf: *mut c_char); ++ pub fn getchar() -> c_int; ++ pub fn putchar(c: c_int) -> c_int; ++ pub fn fgetc(stream: *mut FILE) -> c_int; ++ pub fn fgets(buf: *mut c_char, n: c_int, stream: *mut FILE) -> *mut c_char; ++ pub fn fputc(c: c_int, stream: *mut FILE) -> c_int; ++ pub fn fputs(s: *const c_char, stream: *mut FILE) -> c_int; ++ pub fn puts(s: *const c_char) -> c_int; ++ pub fn ungetc(c: c_int, stream: *mut FILE) -> c_int; ++ pub fn fread(ptr: *mut c_void, size: size_t, nobj: size_t, stream: *mut FILE) -> size_t; ++ pub fn fwrite(ptr: *const c_void, size: size_t, nobj: size_t, stream: *mut FILE) -> size_t; ++ pub fn fseek(stream: *mut FILE, offset: c_long, whence: c_int) -> c_int; ++ pub fn ftell(stream: *mut FILE) -> c_long; ++ pub fn rewind(stream: *mut FILE); ++ pub fn fgetpos(stream: *mut FILE, ptr: *mut fpos_t) -> c_int; ++ pub fn fsetpos(stream: *mut FILE, ptr: *const fpos_t) -> c_int; ++ 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 atof(s: *const c_char) -> c_double; ++ pub fn atoi(s: *const c_char) -> c_int; ++ pub fn atol(s: *const c_char) -> c_long; ++ pub fn atoll(s: *const c_char) -> c_longlong; ++ 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; ++ pub fn strtol(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_long; ++ pub fn strtoll(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_longlong; ++ pub fn strtoul(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulong; ++ pub fn strtoull(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulonglong; ++ pub fn calloc(nobj: size_t, size: size_t) -> *mut c_void; ++ pub fn malloc(size: size_t) -> *mut c_void; ++ pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void; ++ pub fn free(p: *mut c_void); ++ pub fn abort() -> !; ++ pub fn exit(status: c_int) -> !; ++ pub fn atexit(cb: extern "C" fn()) -> c_int; ++ pub fn system(s: *const c_char) -> c_int; ++ pub fn getenv(s: *const c_char) -> *mut c_char; ++ ++ pub fn strcpy(dst: *mut c_char, src: *const c_char) -> *mut c_char; ++ pub fn strncpy(dst: *mut c_char, src: *const c_char, n: size_t) -> *mut c_char; ++ pub fn strcat(s: *mut c_char, ct: *const c_char) -> *mut c_char; ++ pub fn strncat(s: *mut c_char, ct: *const c_char, n: size_t) -> *mut c_char; ++ pub fn strcmp(cs: *const c_char, ct: *const c_char) -> c_int; ++ pub fn strncmp(cs: *const c_char, ct: *const c_char, n: size_t) -> c_int; ++ pub fn strcoll(cs: *const c_char, ct: *const c_char) -> c_int; ++ pub fn strchr(cs: *const c_char, c: c_int) -> *mut c_char; ++ pub fn strrchr(cs: *const c_char, c: c_int) -> *mut c_char; ++ pub fn strspn(cs: *const c_char, ct: *const c_char) -> size_t; ++ pub fn strcspn(cs: *const c_char, ct: *const c_char) -> size_t; ++ pub fn strdup(cs: *const c_char) -> *mut c_char; ++ pub fn strpbrk(cs: *const c_char, ct: *const c_char) -> *mut c_char; ++ pub fn strstr(cs: *const c_char, ct: *const c_char) -> *mut c_char; ++ pub fn strcasecmp(s1: *const c_char, s2: *const c_char) -> c_int; ++ pub fn strncasecmp(s1: *const c_char, s2: *const c_char, n: size_t) -> c_int; ++ pub fn strlen(cs: *const c_char) -> size_t; ++ pub fn strerror(n: c_int) -> *mut c_char; ++ pub fn strtok(s: *mut c_char, t: *const c_char) -> *mut c_char; ++ pub fn strxfrm(s: *mut c_char, ct: *const c_char, n: size_t) -> size_t; ++ pub fn wcslen(buf: *const wchar_t) -> size_t; ++ pub fn wcstombs(dest: *mut c_char, src: *const wchar_t, n: size_t) -> size_t; ++ ++ pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void; ++ pub fn wmemchr(cx: *const wchar_t, c: wchar_t, n: size_t) -> *mut wchar_t; ++ pub fn memcmp(cx: *const c_void, ct: *const c_void, n: size_t) -> c_int; ++ pub fn memcpy(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void; ++ pub fn memmove(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void; ++ pub fn memset(dest: *mut c_void, c: c_int, n: size_t) -> *mut c_void; ++} ++ ++extern "C" { ++ pub fn fprintf(stream: *mut crate::FILE, format: *const c_char, ...) -> c_int; ++ pub fn printf(format: *const c_char, ...) -> c_int; ++ pub fn snprintf(s: *mut c_char, n: size_t, format: *const c_char, ...) -> c_int; ++ pub fn sprintf(s: *mut c_char, format: *const c_char, ...) -> c_int; ++ pub fn fscanf(stream: *mut crate::FILE, format: *const c_char, ...) -> c_int; ++ pub fn scanf(format: *const c_char, ...) -> c_int; ++ pub fn sscanf(s: *const c_char, format: *const c_char, ...) -> c_int; ++ pub fn getchar_unlocked() -> c_int; ++ pub fn putchar_unlocked(c: c_int) -> c_int; ++ pub fn stat(path: *const c_char, buf: *mut stat) -> c_int; ++ pub fn fdopen(fd: c_int, mode: *const c_char) -> *mut crate::FILE; ++ pub fn fileno(stream: *mut crate::FILE) -> c_int; ++ pub fn creat(path: *const c_char, mode: mode_t) -> c_int; ++ pub fn rewinddir(dirp: *mut crate::DIR); ++ pub fn fchown(fd: c_int, owner: crate::uid_t, group: crate::gid_t) -> c_int; ++ pub fn access(path: *const c_char, amode: c_int) -> c_int; ++ pub fn alarm(seconds: c_uint) -> c_uint; ++ pub fn fchdir(dirfd: c_int) -> c_int; ++ pub fn chown(path: *const c_char, uid: uid_t, gid: gid_t) -> c_int; ++ pub fn fpathconf(filedes: c_int, name: c_int) -> c_long; ++ pub fn getegid() -> gid_t; ++ pub fn geteuid() -> uid_t; ++ pub fn getgroups(ngroups_max: c_int, groups: *mut gid_t) -> c_int; ++ pub fn getlogin() -> *mut c_char; ++ pub fn getopt(argc: c_int, argv: *const *mut c_char, optstr: *const c_char) -> c_int; ++ pub fn pathconf(path: *const c_char, name: c_int) -> c_long; ++ pub fn pause() -> c_int; ++ pub fn seteuid(uid: uid_t) -> c_int; ++ pub fn setegid(gid: gid_t) -> c_int; ++ pub fn sleep(secs: c_uint) -> c_uint; ++ pub fn ttyname(fd: c_int) -> *mut c_char; ++ pub fn wait(status: *mut c_int) -> pid_t; ++ pub fn umask(mask: mode_t) -> mode_t; ++ pub fn mlock(addr: *const c_void, len: size_t) -> c_int; ++ pub fn mlockall(flags: c_int) -> c_int; ++ pub fn munlockall() -> c_int; ++ ++ pub fn mmap( ++ addr: *mut c_void, ++ len: size_t, ++ prot: c_int, ++ flags: c_int, ++ fd: c_int, ++ offset: off_t, ++ ) -> *mut c_void; ++ pub fn munmap(addr: *mut c_void, len: size_t) -> c_int; ++ pub fn truncate(path: *const c_char, length: off_t) -> c_int; ++ pub fn shm_open(name: *const c_char, oflag: c_int, mode: crate::mode_t) -> c_int; ++ pub fn shm_unlink(name: *const c_char) -> c_int; ++ ++ pub fn gettimeofday(tp: *mut crate::timeval, tz: *mut c_void) -> c_int; ++ pub fn pthread_exit(value: *mut c_void) -> !; ++ pub fn pthread_attr_setdetachstate(attr: *mut crate::pthread_attr_t, state: c_int) -> c_int; ++ ++ pub fn strerror_r(errnum: c_int, buf: *mut c_char, buflen: size_t) -> c_int; ++ ++ pub fn sigaddset(set: *mut sigset_t, signum: c_int) -> c_int; ++ ++ pub fn sigaction(signum: c_int, act: *const sigaction, oldact: *mut sigaction) -> c_int; ++ ++ pub fn utimes(filename: *const c_char, times: *const crate::timeval) -> c_int; ++ ++ #[link_name = "_rtld_dlopen"] ++ pub fn dlopen(filename: *const c_char, flag: c_int) -> *mut c_void; ++ ++ #[link_name = "_rtld_dlerror"] ++ pub fn dlerror() -> *mut c_char; ++ ++ #[link_name = "_rtld_dlsym"] ++ pub fn dlsym(handle: *mut c_void, symbol: *const c_char) -> *mut c_void; ++ ++ #[link_name = "_rtld_dlclose"] ++ pub fn dlclose(handle: *mut c_void) -> c_int; ++ ++ #[link_name = "_rtld_dladdr"] ++ pub fn dladdr(addr: *mut c_void, info: *mut Dl_info) -> c_int; ++ ++ // time.h ++ pub fn gmtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm; ++ pub fn localtime_r(time_p: *const time_t, result: *mut tm) -> *mut tm; ++ pub fn mktime(tm: *mut tm) -> time_t; ++ pub fn time(time: *mut time_t) -> time_t; ++ pub fn gmtime(time_p: *const time_t) -> *mut tm; ++ pub fn localtime(time_p: *const time_t) -> *mut tm; ++ pub fn timegm(tm: *mut tm) -> time_t; ++ pub fn difftime(time1: time_t, time0: time_t) -> c_double; ++ pub fn gethostname(name: *mut c_char, len: size_t) -> c_int; ++ pub fn usleep(secs: crate::useconds_t) -> c_int; ++ pub fn putenv(string: *mut c_char) -> c_int; ++ pub fn setlocale(category: c_int, locale: *const c_char) -> *mut c_char; ++ ++ pub fn sigprocmask(how: c_int, set: *const sigset_t, oldset: *mut sigset_t) -> c_int; ++ pub fn sigpending(set: *mut sigset_t) -> c_int; ++ ++ pub fn mkfifo(path: *const c_char, mode: mode_t) -> c_int; ++ ++ pub fn fseeko(stream: *mut crate::FILE, offset: off_t, whence: c_int) -> c_int; ++ pub fn ftello(stream: *mut crate::FILE) -> off_t; ++ pub fn mkstemp(template: *mut c_char) -> c_int; ++ ++ pub fn tmpnam(ptr: *mut c_char) -> *mut c_char; ++ ++ pub fn openlog(ident: *const c_char, logopt: c_int, facility: c_int); ++ pub fn closelog(); ++ pub fn setlogmask(maskpri: c_int) -> c_int; ++ pub fn syslog(priority: c_int, message: *const c_char, ...); ++ pub fn getline(lineptr: *mut *mut c_char, n: *mut size_t, stream: *mut FILE) -> ssize_t; ++ ++} ++ ++extern "C" { ++ // stdlib.h ++ pub fn memalign(block_size: size_t, size_arg: size_t) -> *mut c_void; ++ ++ // ioLib.h ++ pub fn getcwd(buf: *mut c_char, size: size_t) -> *mut c_char; ++ ++ // ioLib.h ++ pub fn chdir(attr: *const c_char) -> c_int; ++ ++ // pthread.h ++ pub fn pthread_mutexattr_init(attr: *mut pthread_mutexattr_t) -> c_int; ++ ++ // pthread.h ++ pub fn pthread_mutexattr_destroy(attr: *mut pthread_mutexattr_t) -> c_int; ++ ++ // pthread.h ++ pub fn pthread_mutexattr_settype(pAttr: *mut crate::pthread_mutexattr_t, pType: c_int) ++ -> c_int; ++ ++ // pthread.h ++ pub fn pthread_mutex_init( ++ mutex: *mut pthread_mutex_t, ++ attr: *const pthread_mutexattr_t, ++ ) -> c_int; ++ ++ // pthread.h ++ pub fn pthread_mutex_destroy(mutex: *mut pthread_mutex_t) -> c_int; ++ ++ // pthread.h ++ pub fn pthread_mutex_lock(mutex: *mut pthread_mutex_t) -> c_int; ++ ++ // pthread.h ++ pub fn pthread_mutex_trylock(mutex: *mut pthread_mutex_t) -> c_int; ++ ++ // pthread.h ++ pub fn pthread_mutex_timedlock(attr: *mut pthread_mutex_t, spec: *const timespec) -> c_int; ++ ++ // pthread.h ++ pub fn pthread_mutex_unlock(mutex: *mut pthread_mutex_t) -> c_int; ++ ++ // pthread.h ++ pub fn pthread_attr_setname(pAttr: *mut crate::pthread_attr_t, name: *mut c_char) -> c_int; ++ ++ // pthread.h ++ pub fn pthread_attr_setstacksize(attr: *mut crate::pthread_attr_t, stacksize: size_t) -> c_int; ++ ++ // pthread.h ++ pub fn pthread_attr_getstacksize( ++ attr: *const crate::pthread_attr_t, ++ size: *mut size_t, ++ ) -> c_int; ++ ++ // pthread.h ++ pub fn pthread_attr_init(attr: *mut crate::pthread_attr_t) -> c_int; ++ ++ // pthread.h ++ pub fn pthread_create( ++ pThread: *mut crate::pthread_t, ++ pAttr: *const crate::pthread_attr_t, ++ start_routine: extern "C" fn(*mut c_void) -> *mut c_void, ++ value: *mut c_void, ++ ) -> c_int; ++ ++ //pthread.h ++ pub fn pthread_setschedparam( ++ native: crate::pthread_t, ++ policy: c_int, ++ param: *const crate::sched_param, ++ ) -> c_int; ++ ++ //pthread.h ++ pub fn pthread_getschedparam( ++ native: crate::pthread_t, ++ policy: *mut c_int, ++ param: *mut crate::sched_param, ++ ) -> c_int; ++ ++ //pthread.h ++ pub fn pthread_attr_setinheritsched( ++ attr: *mut crate::pthread_attr_t, ++ inheritsched: c_int, ++ ) -> c_int; ++ ++ //pthread.h ++ pub fn pthread_attr_setschedpolicy(attr: *mut crate::pthread_attr_t, policy: c_int) -> c_int; ++ ++ // pthread.h ++ pub fn pthread_attr_destroy(thread: *mut crate::pthread_attr_t) -> c_int; ++ ++ // pthread.h ++ pub fn pthread_detach(thread: crate::pthread_t) -> c_int; ++ ++ // int pthread_atfork (void (*)(void), void (*)(void), void (*)(void)); ++ pub fn pthread_atfork( ++ prepare: Option, ++ parent: Option, ++ child: Option, ++ ) -> c_int; ++ ++ // stat.h ++ pub fn fstat(fildes: c_int, buf: *mut stat) -> c_int; ++ ++ // stat.h ++ pub fn lstat(path: *const c_char, buf: *mut stat) -> c_int; ++ ++ // unistd.h ++ pub fn ftruncate(fd: c_int, length: off_t) -> c_int; ++ ++ // dirent.h ++ pub fn readdir_r( ++ pDir: *mut crate::DIR, ++ entry: *mut crate::dirent, ++ result: *mut *mut crate::dirent, ++ ) -> c_int; ++ ++ // dirent.h ++ pub fn readdir(pDir: *mut crate::DIR) -> *mut crate::dirent; ++ ++ // fcntl.h or ++ // ioLib.h ++ pub fn open(path: *const c_char, oflag: c_int, ...) -> c_int; ++ ++ // poll.h ++ pub fn poll(fds: *mut pollfd, nfds: nfds_t, timeout: c_int) -> c_int; ++ ++ // pthread.h ++ pub fn pthread_condattr_init(attr: *mut crate::pthread_condattr_t) -> c_int; ++ ++ // pthread.h ++ pub fn pthread_condattr_destroy(attr: *mut crate::pthread_condattr_t) -> c_int; ++ ++ // pthread.h ++ pub fn pthread_condattr_getclock( ++ pAttr: *const crate::pthread_condattr_t, ++ pClockId: *mut crate::clockid_t, ++ ) -> c_int; ++ ++ // pthread.h ++ pub fn pthread_condattr_setclock( ++ pAttr: *mut crate::pthread_condattr_t, ++ clockId: crate::clockid_t, ++ ) -> c_int; ++ ++ // pthread.h ++ pub fn pthread_cond_init( ++ cond: *mut crate::pthread_cond_t, ++ attr: *const crate::pthread_condattr_t, ++ ) -> c_int; ++ ++ // pthread.h ++ pub fn pthread_cond_destroy(cond: *mut pthread_cond_t) -> c_int; ++ ++ // pthread.h ++ pub fn pthread_cond_signal(cond: *mut crate::pthread_cond_t) -> c_int; ++ ++ // pthread.h ++ pub fn pthread_cond_broadcast(cond: *mut crate::pthread_cond_t) -> c_int; ++ ++ // pthread.h ++ pub fn pthread_cond_wait( ++ cond: *mut crate::pthread_cond_t, ++ mutex: *mut crate::pthread_mutex_t, ++ ) -> c_int; ++ ++ // pthread.h ++ pub fn pthread_rwlockattr_init(attr: *mut crate::pthread_rwlockattr_t) -> c_int; ++ ++ // pthread.h ++ pub fn pthread_rwlockattr_destroy(attr: *mut crate::pthread_rwlockattr_t) -> c_int; ++ ++ // pthread.h ++ pub fn pthread_rwlockattr_setmaxreaders( ++ attr: *mut crate::pthread_rwlockattr_t, ++ attr2: c_uint, ++ ) -> c_int; ++ ++ // pthread.h ++ pub fn pthread_rwlock_init( ++ attr: *mut crate::pthread_rwlock_t, ++ host: *const crate::pthread_rwlockattr_t, ++ ) -> c_int; ++ ++ // pthread.h ++ pub fn pthread_rwlock_destroy(attr: *mut crate::pthread_rwlock_t) -> c_int; ++ ++ // pthread.h ++ pub fn pthread_rwlock_rdlock(attr: *mut crate::pthread_rwlock_t) -> c_int; ++ ++ // pthread.h ++ pub fn pthread_rwlock_tryrdlock(attr: *mut crate::pthread_rwlock_t) -> c_int; ++ ++ // pthread.h ++ pub fn pthread_rwlock_timedrdlock( ++ attr: *mut crate::pthread_rwlock_t, ++ host: *const crate::timespec, ++ ) -> c_int; ++ ++ // pthread.h ++ pub fn pthread_rwlock_wrlock(attr: *mut crate::pthread_rwlock_t) -> c_int; ++ ++ // pthread.h ++ pub fn pthread_rwlock_trywrlock(attr: *mut crate::pthread_rwlock_t) -> c_int; ++ ++ // pthread.h ++ pub fn pthread_rwlock_timedwrlock( ++ attr: *mut crate::pthread_rwlock_t, ++ host: *const crate::timespec, ++ ) -> c_int; ++ ++ // pthread.h ++ pub fn pthread_rwlock_unlock(attr: *mut crate::pthread_rwlock_t) -> c_int; ++ ++ // pthread.h ++ pub fn pthread_key_create( ++ key: *mut crate::pthread_key_t, ++ dtor: Option, ++ ) -> c_int; ++ ++ // pthread.h ++ pub fn pthread_key_delete(key: crate::pthread_key_t) -> c_int; ++ ++ // pthread.h ++ pub fn pthread_setspecific(key: crate::pthread_key_t, value: *const c_void) -> c_int; ++ ++ // pthread.h ++ pub fn pthread_getspecific(key: crate::pthread_key_t) -> *mut c_void; ++ ++ // pthread.h ++ pub fn pthread_cond_timedwait( ++ cond: *mut crate::pthread_cond_t, ++ mutex: *mut crate::pthread_mutex_t, ++ abstime: *const crate::timespec, ++ ) -> c_int; ++ ++ // pthread.h ++ pub fn pthread_attr_getname(attr: *mut crate::pthread_attr_t, name: *mut *mut c_char) -> c_int; ++ ++ // pthread.h ++ pub fn pthread_join(thread: crate::pthread_t, status: *mut *mut c_void) -> c_int; ++ ++ // pthread.h ++ pub fn pthread_self() -> crate::pthread_t; ++ ++ // clockLib.h ++ pub fn clock_gettime(clock_id: crate::clockid_t, tp: *mut crate::timespec) -> c_int; ++ ++ // clockLib.h ++ pub fn clock_settime(clock_id: crate::clockid_t, tp: *const crate::timespec) -> c_int; ++ ++ // clockLib.h ++ pub fn clock_getres(clock_id: crate::clockid_t, res: *mut crate::timespec) -> c_int; ++ ++ // clockLib.h ++ pub fn clock_nanosleep( ++ clock_id: crate::clockid_t, ++ flags: c_int, ++ rqtp: *const crate::timespec, ++ rmtp: *mut crate::timespec, ++ ) -> c_int; ++ ++ // timerLib.h ++ pub fn nanosleep(rqtp: *const crate::timespec, rmtp: *mut crate::timespec) -> c_int; ++ ++ // socket.h ++ pub fn accept(s: c_int, addr: *mut crate::sockaddr, addrlen: *mut crate::socklen_t) -> c_int; ++ ++ // socket.h ++ pub fn bind(fd: c_int, addr: *const sockaddr, len: socklen_t) -> c_int; ++ ++ // socket.h ++ pub fn connect(s: c_int, name: *const crate::sockaddr, namelen: crate::socklen_t) -> c_int; ++ ++ // socket.h ++ pub fn getpeername( ++ s: c_int, ++ name: *mut crate::sockaddr, ++ namelen: *mut crate::socklen_t, ++ ) -> c_int; ++ ++ // socket.h ++ pub fn getsockname(socket: c_int, address: *mut sockaddr, address_len: *mut socklen_t) ++ -> c_int; ++ ++ // socket.h ++ pub fn getsockopt( ++ sockfd: c_int, ++ level: c_int, ++ optname: c_int, ++ optval: *mut c_void, ++ optlen: *mut crate::socklen_t, ++ ) -> c_int; ++ ++ // socket.h ++ pub fn listen(socket: c_int, backlog: c_int) -> c_int; ++ ++ // socket.h ++ pub fn recv(s: c_int, buf: *mut c_void, bufLen: size_t, flags: c_int) -> ssize_t; ++ ++ // socket.h ++ pub fn recvfrom( ++ s: c_int, ++ buf: *mut c_void, ++ bufLen: size_t, ++ flags: c_int, ++ from: *mut crate::sockaddr, ++ pFromLen: *mut crate::socklen_t, ++ ) -> ssize_t; ++ ++ pub fn recvmsg(socket: c_int, mp: *mut crate::msghdr, flags: c_int) -> ssize_t; ++ ++ // socket.h ++ pub fn send(socket: c_int, buf: *const c_void, len: size_t, flags: c_int) -> ssize_t; ++ ++ pub fn sendmsg(socket: c_int, mp: *const crate::msghdr, flags: c_int) -> ssize_t; ++ ++ // socket.h ++ pub fn sendto( ++ socket: c_int, ++ buf: *const c_void, ++ len: size_t, ++ flags: c_int, ++ addr: *const sockaddr, ++ addrlen: socklen_t, ++ ) -> ssize_t; ++ ++ // socket.h ++ pub fn setsockopt( ++ socket: c_int, ++ level: c_int, ++ name: c_int, ++ value: *const c_void, ++ option_len: socklen_t, ++ ) -> c_int; ++ ++ // socket.h ++ pub fn shutdown(s: c_int, how: c_int) -> c_int; ++ ++ // socket.h ++ pub fn socket(domain: c_int, _type: c_int, protocol: c_int) -> c_int; ++ ++ // icotl.h ++ pub fn ioctl(fd: c_int, request: c_int, ...) -> c_int; ++ ++ // fcntl.h ++ pub fn fcntl(fd: c_int, cmd: c_int, ...) -> c_int; ++ ++ // ntp_rfc2553.h for kernel ++ // netdb.h for user ++ pub fn gai_strerror(errcode: c_int) -> *mut c_char; ++ ++ // ioLib.h or ++ // unistd.h ++ pub fn close(fd: c_int) -> c_int; ++ ++ // ioLib.h or ++ // unistd.h ++ pub fn read(fd: c_int, buf: *mut c_void, count: size_t) -> ssize_t; ++ ++ // ioLib.h or ++ // unistd.h ++ pub fn write(fd: c_int, buf: *const c_void, count: size_t) -> ssize_t; ++ ++ // ioLib.h or ++ // unistd.h ++ pub fn isatty(fd: c_int) -> c_int; ++ ++ // ioLib.h or ++ // unistd.h ++ pub fn dup(src: c_int) -> c_int; ++ ++ // ioLib.h or ++ // unistd.h ++ pub fn dup2(src: c_int, dst: c_int) -> c_int; ++ ++ // ioLib.h or ++ // unistd.h ++ pub fn pipe(fds: *mut c_int) -> c_int; ++ ++ // ioLib.h or ++ // unistd.h ++ pub fn unlink(pathname: *const c_char) -> c_int; ++ ++ // unistd.h and ++ // ioLib.h ++ pub fn lseek(fd: c_int, offset: off_t, whence: c_int) -> off_t; ++ ++ // netdb.h ++ pub fn getaddrinfo( ++ node: *const c_char, ++ service: *const c_char, ++ hints: *const addrinfo, ++ res: *mut *mut addrinfo, ++ ) -> c_int; ++ ++ // netdb.h ++ pub fn freeaddrinfo(res: *mut addrinfo); ++ ++ // signal.h ++ pub fn signal(signum: c_int, handler: sighandler_t) -> sighandler_t; ++ ++ // unistd.h ++ pub fn getpid() -> pid_t; ++ ++ // unistd.h ++ pub fn getppid() -> pid_t; ++ ++ // wait.h ++ pub fn waitpid(pid: pid_t, status: *mut c_int, optons: c_int) -> pid_t; ++ ++ // unistd.h ++ pub fn sysconf(attr: c_int) -> c_long; ++ ++ // stdlib.h ++ pub fn setenv( ++ // setenv.c ++ envVarName: *const c_char, ++ envVarValue: *const c_char, ++ overwrite: c_int, ++ ) -> c_int; ++ ++ // stdlib.h ++ pub fn unsetenv( ++ // setenv.c ++ envVarName: *const c_char, ++ ) -> c_int; ++ ++ // stdlib.h ++ pub fn realpath(fileName: *const c_char, resolvedName: *mut c_char) -> *mut c_char; ++ ++ // unistd.h ++ pub fn link(src: *const c_char, dst: *const c_char) -> c_int; ++ ++ // unistd.h ++ pub fn readlink(path: *const c_char, buf: *mut c_char, bufsize: size_t) -> ssize_t; ++ ++ // unistd.h ++ pub fn symlink(path1: *const c_char, path2: *const c_char) -> c_int; ++ ++ // dirent.h ++ pub fn opendir(name: *const c_char) -> *mut crate::DIR; ++ ++ // unistd.h ++ pub fn rmdir(path: *const c_char) -> c_int; ++ ++ // stat.h ++ pub fn mkdir(dirName: *const c_char, mode: crate::mode_t) -> c_int; ++ ++ // stat.h ++ pub fn chmod(path: *const c_char, mode: crate::mode_t) -> c_int; ++ ++ // stat.h ++ pub fn fchmod(attr1: c_int, attr2: crate::mode_t) -> c_int; ++ ++ // unistd.h ++ pub fn fsync(fd: c_int) -> c_int; ++ ++ // dirent.h ++ pub fn closedir(ptr: *mut crate::DIR) -> c_int; ++ ++ //sched.h ++ pub fn sched_get_priority_max(policy: c_int) -> c_int; ++ ++ //sched.h ++ pub fn sched_get_priority_min(policy: c_int) -> c_int; ++ ++ //sched.h ++ pub fn sched_setparam(pid: crate::pid_t, param: *const crate::sched_param) -> c_int; ++ ++ //sched.h ++ pub fn sched_getparam(pid: crate::pid_t, param: *mut crate::sched_param) -> c_int; ++ ++ //sched.h ++ pub fn sched_setscheduler( ++ pid: crate::pid_t, ++ policy: c_int, ++ param: *const crate::sched_param, ++ ) -> c_int; ++ ++ //sched.h ++ pub fn sched_getscheduler(pid: crate::pid_t) -> c_int; ++ ++ //sched.h ++ pub fn sched_rr_get_interval(pid: crate::pid_t, tp: *mut crate::timespec) -> c_int; ++ ++ // sched.h ++ pub fn sched_yield() -> c_int; ++ ++ // errnoLib.h ++ pub fn errnoSet(err: c_int) -> c_int; ++ ++ // errnoLib.h ++ pub fn errnoGet() -> c_int; ++ ++ // unistd.h ++ pub fn _exit(status: c_int) -> !; ++ ++ // unistd.h ++ pub fn setgid(gid: crate::gid_t) -> c_int; ++ ++ // unistd.h ++ pub fn getgid() -> crate::gid_t; ++ ++ // unistd.h ++ pub fn setuid(uid: crate::uid_t) -> c_int; ++ ++ // unistd.h ++ pub fn getuid() -> crate::uid_t; ++ ++ // signal.h ++ pub fn sigemptyset(__set: *mut sigset_t) -> c_int; ++ ++ // pthread.h for kernel ++ // signal.h for user ++ pub fn pthread_sigmask(__how: c_int, __set: *const sigset_t, __oset: *mut sigset_t) -> c_int; ++ ++ // signal.h for user ++ pub fn kill(__pid: pid_t, __signo: c_int) -> c_int; ++ ++ // signal.h for user ++ pub fn sigqueue(__pid: pid_t, __signo: c_int, __value: crate::sigval) -> c_int; ++ ++ // signal.h for user ++ pub fn _sigqueue( ++ rtpId: crate::RTP_ID, ++ signo: c_int, ++ pValue: *const crate::sigval, ++ sigCode: c_int, ++ ) -> c_int; ++ ++ // signal.h ++ pub fn taskKill(taskId: crate::TASK_ID, signo: c_int) -> c_int; ++ ++ // signal.h ++ pub fn raise(__signo: c_int) -> c_int; ++ ++ // taskLibCommon.h ++ pub fn taskIdSelf() -> crate::TASK_ID; ++ pub fn taskDelay(ticks: crate::_Vx_ticks_t) -> c_int; ++ ++ // taskLib.h ++ pub fn taskNameSet(task_id: crate::TASK_ID, task_name: *mut c_char) -> c_int; ++ pub fn taskNameGet(task_id: crate::TASK_ID, buf_name: *mut c_char, bufsize: size_t) -> c_int; ++ ++ // rtpLibCommon.h ++ pub fn rtpInfoGet(rtpId: crate::RTP_ID, rtpStruct: *mut crate::RTP_DESC) -> c_int; ++ pub fn rtpSpawn( ++ pubrtpFileName: *const c_char, ++ argv: *mut *const c_char, ++ envp: *mut *const c_char, ++ priority: c_int, ++ uStackSize: size_t, ++ options: c_int, ++ taskOptions: c_int, ++ ) -> RTP_ID; ++ ++ // ioLib.h ++ pub fn _realpath(fileName: *const c_char, resolvedName: *mut c_char) -> *mut c_char; ++ ++ // pathLib.h ++ pub fn _pathIsAbsolute(filepath: *const c_char, pNameTail: *mut *const c_char) -> BOOL; ++ ++ pub fn writev(fd: c_int, iov: *const crate::iovec, iovcnt: c_int) -> ssize_t; ++ pub fn readv(fd: c_int, iov: *const crate::iovec, iovcnt: c_int) -> ssize_t; ++ ++ // randomNumGen.h ++ pub fn randBytes(buf: *mut c_uchar, length: c_int) -> c_int; ++ pub fn randABytes(buf: *mut c_uchar, length: c_int) -> c_int; ++ pub fn randUBytes(buf: *mut c_uchar, length: c_int) -> c_int; ++ pub fn randSecure() -> c_int; ++ ++ // mqueue.h ++ pub fn mq_open(name: *const c_char, oflag: c_int, ...) -> crate::mqd_t; ++ pub fn mq_close(mqd: crate::mqd_t) -> c_int; ++ pub fn mq_unlink(name: *const c_char) -> c_int; ++ pub fn mq_receive( ++ mqd: crate::mqd_t, ++ msg_ptr: *mut c_char, ++ msg_len: size_t, ++ msg_prio: *mut c_uint, ++ ) -> ssize_t; ++ pub fn mq_timedreceive( ++ mqd: crate::mqd_t, ++ msg_ptr: *mut c_char, ++ msg_len: size_t, ++ msg_prio: *mut c_uint, ++ abs_timeout: *const crate::timespec, ++ ) -> ssize_t; ++ pub fn mq_send( ++ mqd: crate::mqd_t, ++ msg_ptr: *const c_char, ++ msg_len: size_t, ++ msg_prio: c_uint, ++ ) -> c_int; ++ pub fn mq_timedsend( ++ mqd: crate::mqd_t, ++ msg_ptr: *const c_char, ++ msg_len: size_t, ++ msg_prio: c_uint, ++ abs_timeout: *const crate::timespec, ++ ) -> c_int; ++ pub fn mq_getattr(mqd: crate::mqd_t, attr: *mut crate::mq_attr) -> c_int; ++ pub fn mq_setattr( ++ mqd: crate::mqd_t, ++ newattr: *const crate::mq_attr, ++ oldattr: *mut crate::mq_attr, ++ ) -> c_int; ++ ++ // vxCpuLib.h ++ pub fn vxCpuEnabledGet() -> crate::cpuset_t; // Get set of running CPU's in the system ++ pub fn vxCpuConfiguredGet() -> crate::cpuset_t; // Get set of Configured CPU's in the system ++} ++ ++//Dummy functions, these don't really exist in VxWorks. ++ ++// wait.h macros ++safe_f! { ++ pub {const} fn WIFEXITED(status: c_int) -> bool { ++ (status & 0xFF00) == 0 ++ } ++ pub {const} fn WIFSIGNALED(status: c_int) -> bool { ++ (status & 0xFF00) != 0 ++ } ++ pub {const} fn WIFSTOPPED(status: c_int) -> bool { ++ (status & 0xFF0000) != 0 ++ } ++ pub {const} fn WEXITSTATUS(status: c_int) -> c_int { ++ status & 0xFF ++ } ++ pub {const} fn WTERMSIG(status: c_int) -> c_int { ++ (status >> 8) & 0xFF ++ } ++ pub {const} fn WSTOPSIG(status: c_int) -> c_int { ++ (status >> 16) & 0xFF ++ } ++} ++ ++pub fn pread(_fd: c_int, _buf: *mut c_void, _count: size_t, _offset: off64_t) -> ssize_t { ++ -1 ++} ++ ++pub fn pwrite(_fd: c_int, _buf: *const c_void, _count: size_t, _offset: off64_t) -> ssize_t { ++ -1 ++} ++pub fn posix_memalign(memptr: *mut *mut c_void, align: size_t, size: size_t) -> c_int { ++ // check to see if align is a power of 2 and if align is a multiple ++ // of sizeof(void *) ++ if (align & align - 1 != 0) || (align as usize % size_of::() != 0) { ++ return crate::EINVAL; ++ } ++ ++ unsafe { ++ // posix_memalign should not set errno ++ let e = crate::errnoGet(); ++ ++ let temp = memalign(align, size); ++ crate::errnoSet(e as c_int); ++ ++ if temp.is_null() { ++ crate::ENOMEM ++ } else { ++ *memptr = temp; ++ 0 ++ } ++ } ++} ++ ++cfg_if! { ++ if #[cfg(target_arch = "aarch64")] { ++ mod aarch64; ++ pub use self::aarch64::*; ++ } else if #[cfg(target_arch = "arm")] { ++ mod arm; ++ pub use self::arm::*; ++ } else if #[cfg(target_arch = "x86")] { ++ mod x86; ++ pub use self::x86::*; ++ } else if #[cfg(target_arch = "x86_64")] { ++ mod x86_64; ++ pub use self::x86_64::*; ++ } else if #[cfg(target_arch = "powerpc")] { ++ mod powerpc; ++ pub use self::powerpc::*; ++ } else if #[cfg(target_arch = "powerpc64")] { ++ mod powerpc64; ++ pub use self::powerpc64::*; ++ } else if #[cfg(target_arch = "riscv32")] { ++ mod riscv32; ++ pub use self::riscv32::*; ++ } else if #[cfg(target_arch = "riscv64")] { ++ mod riscv64; ++ pub use self::riscv64::*; ++ } else { ++ // Unknown target_arch ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/vxworks/powerpc64.rs mesa-25.3.3/subprojects/libc-0.2.169/src/vxworks/powerpc64.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/vxworks/powerpc64.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/vxworks/powerpc64.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,4 @@ ++pub type c_char = u8; ++pub type wchar_t = u32; ++pub type c_long = i64; ++pub type c_ulong = u64; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/vxworks/powerpc.rs mesa-25.3.3/subprojects/libc-0.2.169/src/vxworks/powerpc.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/vxworks/powerpc.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/vxworks/powerpc.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,4 @@ ++pub type c_char = u8; ++pub type wchar_t = u32; ++pub type c_long = i32; ++pub type c_ulong = u32; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/vxworks/riscv32.rs mesa-25.3.3/subprojects/libc-0.2.169/src/vxworks/riscv32.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/vxworks/riscv32.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/vxworks/riscv32.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,4 @@ ++pub type c_char = u8; ++pub type wchar_t = i32; ++pub type c_long = i32; ++pub type c_ulong = u32; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/vxworks/riscv64.rs mesa-25.3.3/subprojects/libc-0.2.169/src/vxworks/riscv64.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/vxworks/riscv64.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/vxworks/riscv64.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,4 @@ ++pub type c_char = u8; ++pub type wchar_t = i32; ++pub type c_long = i64; ++pub type c_ulong = u64; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/vxworks/x86_64.rs mesa-25.3.3/subprojects/libc-0.2.169/src/vxworks/x86_64.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/vxworks/x86_64.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/vxworks/x86_64.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,4 @@ ++pub type c_char = i8; ++pub type wchar_t = i32; ++pub type c_long = i64; ++pub type c_ulong = u64; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/vxworks/x86.rs mesa-25.3.3/subprojects/libc-0.2.169/src/vxworks/x86.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/vxworks/x86.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/vxworks/x86.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,4 @@ ++pub type c_char = i8; ++pub type wchar_t = i32; ++pub type c_long = i32; ++pub type c_ulong = u32; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/wasi/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/wasi/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/wasi/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/wasi/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,877 @@ ++//! [wasi-libc](https://github.com/WebAssembly/wasi-libc) definitions. ++//! ++//! `wasi-libc` project provides multiple libraries including emulated features, but we list only ++//! basic features with `libc.a` here. ++ ++use core::iter::Iterator; ++ ++use crate::prelude::*; ++ ++pub type c_char = i8; ++pub type c_uchar = u8; ++pub type c_schar = i8; ++pub type c_int = i32; ++pub type c_uint = u32; ++pub type c_short = i16; ++pub type c_ushort = u16; ++pub type c_long = i32; ++pub type c_ulong = u32; ++pub type c_longlong = i64; ++pub type c_ulonglong = u64; ++pub type intmax_t = i64; ++pub type uintmax_t = u64; ++pub type size_t = usize; ++pub type ssize_t = isize; ++pub type ptrdiff_t = isize; ++pub type intptr_t = isize; ++pub type uintptr_t = usize; ++pub type off_t = i64; ++pub type pid_t = i32; ++pub type clock_t = c_longlong; ++pub type time_t = c_longlong; ++pub type c_double = f64; ++pub type c_float = f32; ++pub type ino_t = u64; ++pub type sigset_t = c_uchar; ++pub type suseconds_t = c_longlong; ++pub type mode_t = u32; ++pub type dev_t = u64; ++pub type uid_t = u32; ++pub type gid_t = u32; ++pub type nlink_t = u64; ++pub type blksize_t = c_long; ++pub type blkcnt_t = i64; ++pub type nfds_t = c_ulong; ++pub type wchar_t = i32; ++pub type nl_item = c_int; ++pub type __wasi_rights_t = u64; ++ ++s_no_extra_traits! { ++ #[repr(align(16))] ++ #[allow(missing_debug_implementations)] ++ pub struct max_align_t { ++ priv_: [f64; 4], ++ } ++} ++ ++#[allow(missing_copy_implementations)] ++#[cfg_attr(feature = "extra_traits", derive(Debug))] ++pub enum FILE {} ++#[allow(missing_copy_implementations)] ++#[cfg_attr(feature = "extra_traits", derive(Debug))] ++pub enum DIR {} ++#[allow(missing_copy_implementations)] ++#[cfg_attr(feature = "extra_traits", derive(Debug))] ++pub enum __locale_struct {} ++ ++pub type locale_t = *mut __locale_struct; ++ ++s_paren! { ++ // in wasi-libc clockid_t is const struct __clockid* (where __clockid is an opaque struct), ++ // but that's an implementation detail that we don't want to have to deal with ++ #[repr(transparent)] ++ #[allow(dead_code)] ++ pub struct clockid_t(*const u8); ++} ++ ++unsafe impl Send for clockid_t {} ++unsafe impl Sync for clockid_t {} ++ ++s! { ++ #[repr(align(8))] ++ pub struct fpos_t { ++ data: [u8; 16], ++ } ++ ++ pub struct tm { ++ pub tm_sec: c_int, ++ pub tm_min: c_int, ++ pub tm_hour: c_int, ++ pub tm_mday: c_int, ++ pub tm_mon: c_int, ++ pub tm_year: c_int, ++ pub tm_wday: c_int, ++ pub tm_yday: c_int, ++ pub tm_isdst: c_int, ++ pub __tm_gmtoff: c_int, ++ pub __tm_zone: *const c_char, ++ pub __tm_nsec: c_int, ++ } ++ ++ pub struct timeval { ++ pub tv_sec: time_t, ++ pub tv_usec: suseconds_t, ++ } ++ ++ pub struct timespec { ++ pub tv_sec: time_t, ++ pub tv_nsec: c_long, ++ } ++ ++ pub struct tms { ++ pub tms_utime: clock_t, ++ pub tms_stime: clock_t, ++ pub tms_cutime: clock_t, ++ pub tms_cstime: clock_t, ++ } ++ ++ pub struct itimerspec { ++ pub it_interval: timespec, ++ pub it_value: timespec, ++ } ++ ++ pub struct iovec { ++ pub iov_base: *mut c_void, ++ pub iov_len: size_t, ++ } ++ ++ pub struct lconv { ++ pub decimal_point: *mut c_char, ++ pub thousands_sep: *mut c_char, ++ pub grouping: *mut c_char, ++ pub int_curr_symbol: *mut c_char, ++ pub currency_symbol: *mut c_char, ++ pub mon_decimal_point: *mut c_char, ++ pub mon_thousands_sep: *mut c_char, ++ pub mon_grouping: *mut c_char, ++ pub positive_sign: *mut c_char, ++ pub negative_sign: *mut c_char, ++ pub int_frac_digits: c_char, ++ pub frac_digits: c_char, ++ pub p_cs_precedes: c_char, ++ pub p_sep_by_space: c_char, ++ pub n_cs_precedes: c_char, ++ pub n_sep_by_space: c_char, ++ pub p_sign_posn: c_char, ++ pub n_sign_posn: c_char, ++ pub int_p_cs_precedes: c_char, ++ pub int_p_sep_by_space: c_char, ++ pub int_n_cs_precedes: c_char, ++ pub int_n_sep_by_space: c_char, ++ pub int_p_sign_posn: c_char, ++ pub int_n_sign_posn: c_char, ++ } ++ ++ pub struct pollfd { ++ pub fd: c_int, ++ pub events: c_short, ++ pub revents: c_short, ++ } ++ ++ pub struct rusage { ++ pub ru_utime: timeval, ++ pub ru_stime: timeval, ++ } ++ ++ pub struct stat { ++ pub st_dev: dev_t, ++ pub st_ino: ino_t, ++ pub st_nlink: nlink_t, ++ pub st_mode: mode_t, ++ pub st_uid: uid_t, ++ pub st_gid: gid_t, ++ __pad0: c_uint, ++ pub st_rdev: dev_t, ++ pub st_size: off_t, ++ pub st_blksize: blksize_t, ++ pub st_blocks: blkcnt_t, ++ pub st_atim: timespec, ++ pub st_mtim: timespec, ++ pub st_ctim: timespec, ++ __reserved: [c_longlong; 3], ++ } ++ ++ pub struct fd_set { ++ __nfds: usize, ++ __fds: [c_int; FD_SETSIZE as usize], ++ } ++} ++ ++// Declare dirent outside of s! so that it doesn't implement Copy, Eq, Hash, ++// etc., since it contains a flexible array member with a dynamic size. ++#[repr(C)] ++#[allow(missing_copy_implementations)] ++#[cfg_attr(feature = "extra_traits", derive(Debug))] ++pub struct dirent { ++ pub d_ino: ino_t, ++ pub d_type: c_uchar, ++ /// d_name is declared in WASI libc as a flexible array member, which ++ /// can't be directly expressed in Rust. As an imperfect workaround, ++ /// declare it as a zero-length array instead. ++ pub d_name: [c_char; 0], ++} ++ ++pub const EXIT_SUCCESS: c_int = 0; ++pub const EXIT_FAILURE: c_int = 1; ++pub const STDIN_FILENO: c_int = 0; ++pub const STDOUT_FILENO: c_int = 1; ++pub const STDERR_FILENO: c_int = 2; ++pub const SEEK_SET: c_int = 0; ++pub const SEEK_CUR: c_int = 1; ++pub const SEEK_END: c_int = 2; ++pub const _IOFBF: c_int = 0; ++pub const _IONBF: c_int = 2; ++pub const _IOLBF: c_int = 1; ++pub const F_GETFD: c_int = 1; ++pub const F_SETFD: c_int = 2; ++pub const F_GETFL: c_int = 3; ++pub const F_SETFL: c_int = 4; ++pub const FD_CLOEXEC: c_int = 1; ++pub const FD_SETSIZE: size_t = 1024; ++pub const O_APPEND: c_int = 0x0001; ++pub const O_DSYNC: c_int = 0x0002; ++pub const O_NONBLOCK: c_int = 0x0004; ++pub const O_RSYNC: c_int = 0x0008; ++pub const O_SYNC: c_int = 0x0010; ++pub const O_CREAT: c_int = 0x0001 << 12; ++pub const O_DIRECTORY: c_int = 0x0002 << 12; ++pub const O_EXCL: c_int = 0x0004 << 12; ++pub const O_TRUNC: c_int = 0x0008 << 12; ++pub const O_NOFOLLOW: c_int = 0x01000000; ++pub const O_EXEC: c_int = 0x02000000; ++pub const O_RDONLY: c_int = 0x04000000; ++pub const O_SEARCH: c_int = 0x08000000; ++pub const O_WRONLY: c_int = 0x10000000; ++pub const O_CLOEXEC: c_int = 0x0; ++pub const O_RDWR: c_int = O_WRONLY | O_RDONLY; ++pub const O_ACCMODE: c_int = O_EXEC | O_RDWR | O_SEARCH; ++pub const O_NOCTTY: c_int = 0x0; ++pub const POSIX_FADV_DONTNEED: c_int = 4; ++pub const POSIX_FADV_NOREUSE: c_int = 5; ++pub const POSIX_FADV_NORMAL: c_int = 0; ++pub const POSIX_FADV_RANDOM: c_int = 2; ++pub const POSIX_FADV_SEQUENTIAL: c_int = 1; ++pub const POSIX_FADV_WILLNEED: c_int = 3; ++pub const AT_FDCWD: c_int = -2; ++pub const AT_EACCESS: c_int = 0x0; ++pub const AT_SYMLINK_NOFOLLOW: c_int = 0x1; ++pub const AT_SYMLINK_FOLLOW: c_int = 0x2; ++pub const AT_REMOVEDIR: c_int = 0x4; ++pub const UTIME_OMIT: c_long = 0xfffffffe; ++pub const UTIME_NOW: c_long = 0xffffffff; ++pub const S_IFIFO: mode_t = 0o1_0000; ++pub const S_IFCHR: mode_t = 0o2_0000; ++pub const S_IFBLK: mode_t = 0o6_0000; ++pub const S_IFDIR: mode_t = 0o4_0000; ++pub const S_IFREG: mode_t = 0o10_0000; ++pub const S_IFLNK: mode_t = 0o12_0000; ++pub const S_IFSOCK: mode_t = 0o14_0000; ++pub const S_IFMT: mode_t = 0o17_0000; ++pub const S_IRWXO: mode_t = 0o0007; ++pub const S_IXOTH: mode_t = 0o0001; ++pub const S_IWOTH: mode_t = 0o0002; ++pub const S_IROTH: mode_t = 0o0004; ++pub const S_IRWXG: mode_t = 0o0070; ++pub const S_IXGRP: mode_t = 0o0010; ++pub const S_IWGRP: mode_t = 0o0020; ++pub const S_IRGRP: mode_t = 0o0040; ++pub const S_IRWXU: mode_t = 0o0700; ++pub const S_IXUSR: mode_t = 0o0100; ++pub const S_IWUSR: mode_t = 0o0200; ++pub const S_IRUSR: mode_t = 0o0400; ++pub const S_ISVTX: mode_t = 0o1000; ++pub const S_ISGID: mode_t = 0o2000; ++pub const S_ISUID: mode_t = 0o4000; ++pub const DT_UNKNOWN: u8 = 0; ++pub const DT_BLK: u8 = 1; ++pub const DT_CHR: u8 = 2; ++pub const DT_DIR: u8 = 3; ++pub const DT_REG: u8 = 4; ++pub const DT_LNK: u8 = 7; ++pub const FIONREAD: c_int = 1; ++pub const FIONBIO: c_int = 2; ++pub const F_OK: c_int = 0; ++pub const R_OK: c_int = 4; ++pub const W_OK: c_int = 2; ++pub const X_OK: c_int = 1; ++pub const POLLIN: c_short = 0x1; ++pub const POLLOUT: c_short = 0x2; ++pub const POLLERR: c_short = 0x1000; ++pub const POLLHUP: c_short = 0x2000; ++pub const POLLNVAL: c_short = 0x4000; ++pub const POLLRDNORM: c_short = 0x1; ++pub const POLLWRNORM: c_short = 0x2; ++ ++pub const E2BIG: c_int = 1; ++pub const EACCES: c_int = 2; ++pub const EADDRINUSE: c_int = 3; ++pub const EADDRNOTAVAIL: c_int = 4; ++pub const EAFNOSUPPORT: c_int = 5; ++pub const EAGAIN: c_int = 6; ++pub const EALREADY: c_int = 7; ++pub const EBADF: c_int = 8; ++pub const EBADMSG: c_int = 9; ++pub const EBUSY: c_int = 10; ++pub const ECANCELED: c_int = 11; ++pub const ECHILD: c_int = 12; ++pub const ECONNABORTED: c_int = 13; ++pub const ECONNREFUSED: c_int = 14; ++pub const ECONNRESET: c_int = 15; ++pub const EDEADLK: c_int = 16; ++pub const EDESTADDRREQ: c_int = 17; ++pub const EDOM: c_int = 18; ++pub const EDQUOT: c_int = 19; ++pub const EEXIST: c_int = 20; ++pub const EFAULT: c_int = 21; ++pub const EFBIG: c_int = 22; ++pub const EHOSTUNREACH: c_int = 23; ++pub const EIDRM: c_int = 24; ++pub const EILSEQ: c_int = 25; ++pub const EINPROGRESS: c_int = 26; ++pub const EINTR: c_int = 27; ++pub const EINVAL: c_int = 28; ++pub const EIO: c_int = 29; ++pub const EISCONN: c_int = 30; ++pub const EISDIR: c_int = 31; ++pub const ELOOP: c_int = 32; ++pub const EMFILE: c_int = 33; ++pub const EMLINK: c_int = 34; ++pub const EMSGSIZE: c_int = 35; ++pub const EMULTIHOP: c_int = 36; ++pub const ENAMETOOLONG: c_int = 37; ++pub const ENETDOWN: c_int = 38; ++pub const ENETRESET: c_int = 39; ++pub const ENETUNREACH: c_int = 40; ++pub const ENFILE: c_int = 41; ++pub const ENOBUFS: c_int = 42; ++pub const ENODEV: c_int = 43; ++pub const ENOENT: c_int = 44; ++pub const ENOEXEC: c_int = 45; ++pub const ENOLCK: c_int = 46; ++pub const ENOLINK: c_int = 47; ++pub const ENOMEM: c_int = 48; ++pub const ENOMSG: c_int = 49; ++pub const ENOPROTOOPT: c_int = 50; ++pub const ENOSPC: c_int = 51; ++pub const ENOSYS: c_int = 52; ++pub const ENOTCONN: c_int = 53; ++pub const ENOTDIR: c_int = 54; ++pub const ENOTEMPTY: c_int = 55; ++pub const ENOTRECOVERABLE: c_int = 56; ++pub const ENOTSOCK: c_int = 57; ++pub const ENOTSUP: c_int = 58; ++pub const ENOTTY: c_int = 59; ++pub const ENXIO: c_int = 60; ++pub const EOVERFLOW: c_int = 61; ++pub const EOWNERDEAD: c_int = 62; ++pub const EPERM: c_int = 63; ++pub const EPIPE: c_int = 64; ++pub const EPROTO: c_int = 65; ++pub const EPROTONOSUPPORT: c_int = 66; ++pub const EPROTOTYPE: c_int = 67; ++pub const ERANGE: c_int = 68; ++pub const EROFS: c_int = 69; ++pub const ESPIPE: c_int = 70; ++pub const ESRCH: c_int = 71; ++pub const ESTALE: c_int = 72; ++pub const ETIMEDOUT: c_int = 73; ++pub const ETXTBSY: c_int = 74; ++pub const EXDEV: c_int = 75; ++pub const ENOTCAPABLE: c_int = 76; ++pub const EOPNOTSUPP: c_int = ENOTSUP; ++pub const EWOULDBLOCK: c_int = EAGAIN; ++ ++pub const _SC_PAGESIZE: c_int = 30; ++pub const _SC_PAGE_SIZE: c_int = _SC_PAGESIZE; ++pub const _SC_IOV_MAX: c_int = 60; ++pub const _SC_SYMLOOP_MAX: c_int = 173; ++ ++cfg_if! { ++ if #[cfg(libc_ctest)] { ++ // skip these constants when this is active because `ctest` currently ++ // panics on parsing the constants below ++ } else { ++ // `addr_of!(EXTERN_STATIC)` is now safe; remove `unsafe` when MSRV >= 1.82 ++ #[allow(unused_unsafe)] ++ pub static CLOCK_MONOTONIC: clockid_t = ++ unsafe { clockid_t(core::ptr::addr_of!(_CLOCK_MONOTONIC)) }; ++ #[allow(unused_unsafe)] ++ pub static CLOCK_PROCESS_CPUTIME_ID: clockid_t = ++ unsafe { clockid_t(core::ptr::addr_of!(_CLOCK_PROCESS_CPUTIME_ID)) }; ++ #[allow(unused_unsafe)] ++ pub static CLOCK_REALTIME: clockid_t = ++ unsafe { clockid_t(core::ptr::addr_of!(_CLOCK_REALTIME)) }; ++ #[allow(unused_unsafe)] ++ pub static CLOCK_THREAD_CPUTIME_ID: clockid_t = ++ unsafe { clockid_t(core::ptr::addr_of!(_CLOCK_THREAD_CPUTIME_ID)) }; ++ } ++} ++ ++pub const ABDAY_1: crate::nl_item = 0x20000; ++pub const ABDAY_2: crate::nl_item = 0x20001; ++pub const ABDAY_3: crate::nl_item = 0x20002; ++pub const ABDAY_4: crate::nl_item = 0x20003; ++pub const ABDAY_5: crate::nl_item = 0x20004; ++pub const ABDAY_6: crate::nl_item = 0x20005; ++pub const ABDAY_7: crate::nl_item = 0x20006; ++ ++pub const DAY_1: crate::nl_item = 0x20007; ++pub const DAY_2: crate::nl_item = 0x20008; ++pub const DAY_3: crate::nl_item = 0x20009; ++pub const DAY_4: crate::nl_item = 0x2000A; ++pub const DAY_5: crate::nl_item = 0x2000B; ++pub const DAY_6: crate::nl_item = 0x2000C; ++pub const DAY_7: crate::nl_item = 0x2000D; ++ ++pub const ABMON_1: crate::nl_item = 0x2000E; ++pub const ABMON_2: crate::nl_item = 0x2000F; ++pub const ABMON_3: crate::nl_item = 0x20010; ++pub const ABMON_4: crate::nl_item = 0x20011; ++pub const ABMON_5: crate::nl_item = 0x20012; ++pub const ABMON_6: crate::nl_item = 0x20013; ++pub const ABMON_7: crate::nl_item = 0x20014; ++pub const ABMON_8: crate::nl_item = 0x20015; ++pub const ABMON_9: crate::nl_item = 0x20016; ++pub const ABMON_10: crate::nl_item = 0x20017; ++pub const ABMON_11: crate::nl_item = 0x20018; ++pub const ABMON_12: crate::nl_item = 0x20019; ++ ++pub const MON_1: crate::nl_item = 0x2001A; ++pub const MON_2: crate::nl_item = 0x2001B; ++pub const MON_3: crate::nl_item = 0x2001C; ++pub const MON_4: crate::nl_item = 0x2001D; ++pub const MON_5: crate::nl_item = 0x2001E; ++pub const MON_6: crate::nl_item = 0x2001F; ++pub const MON_7: crate::nl_item = 0x20020; ++pub const MON_8: crate::nl_item = 0x20021; ++pub const MON_9: crate::nl_item = 0x20022; ++pub const MON_10: crate::nl_item = 0x20023; ++pub const MON_11: crate::nl_item = 0x20024; ++pub const MON_12: crate::nl_item = 0x20025; ++ ++pub const AM_STR: crate::nl_item = 0x20026; ++pub const PM_STR: crate::nl_item = 0x20027; ++ ++pub const D_T_FMT: crate::nl_item = 0x20028; ++pub const D_FMT: crate::nl_item = 0x20029; ++pub const T_FMT: crate::nl_item = 0x2002A; ++pub const T_FMT_AMPM: crate::nl_item = 0x2002B; ++ ++pub const ERA: crate::nl_item = 0x2002C; ++pub const ERA_D_FMT: crate::nl_item = 0x2002E; ++pub const ALT_DIGITS: crate::nl_item = 0x2002F; ++pub const ERA_D_T_FMT: crate::nl_item = 0x20030; ++pub const ERA_T_FMT: crate::nl_item = 0x20031; ++ ++pub const CODESET: crate::nl_item = 14; ++pub const CRNCYSTR: crate::nl_item = 0x4000F; ++pub const RADIXCHAR: crate::nl_item = 0x10000; ++pub const THOUSEP: crate::nl_item = 0x10001; ++pub const YESEXPR: crate::nl_item = 0x50000; ++pub const NOEXPR: crate::nl_item = 0x50001; ++pub const YESSTR: crate::nl_item = 0x50002; ++pub const NOSTR: crate::nl_item = 0x50003; ++ ++f! { ++ pub fn FD_ISSET(fd: c_int, set: *const fd_set) -> bool { ++ let set = &*set; ++ let n = set.__nfds; ++ return set.__fds[..n].iter().any(|p| *p == fd); ++ } ++ ++ pub fn FD_SET(fd: c_int, set: *mut fd_set) -> () { ++ let set = &mut *set; ++ let n = set.__nfds; ++ if !set.__fds[..n].iter().any(|p| *p == fd) { ++ set.__nfds = n + 1; ++ set.__fds[n] = fd; ++ } ++ } ++ ++ pub fn FD_ZERO(set: *mut fd_set) -> () { ++ (*set).__nfds = 0; ++ return; ++ } ++} ++ ++#[cfg_attr( ++ feature = "rustc-dep-of-std", ++ link( ++ name = "c", ++ kind = "static", ++ modifiers = "-bundle", ++ cfg(target_feature = "crt-static") ++ ) ++)] ++#[cfg_attr( ++ feature = "rustc-dep-of-std", ++ link(name = "c", cfg(not(target_feature = "crt-static"))) ++)] ++extern "C" { ++ pub fn _Exit(code: c_int) -> !; ++ pub fn _exit(code: c_int) -> !; ++ pub fn abort() -> !; ++ pub fn aligned_alloc(a: size_t, b: size_t) -> *mut c_void; ++ pub fn calloc(amt: size_t, amt2: size_t) -> *mut c_void; ++ pub fn exit(code: c_int) -> !; ++ pub fn free(ptr: *mut c_void); ++ pub fn getenv(s: *const c_char) -> *mut c_char; ++ pub fn malloc(amt: size_t) -> *mut c_void; ++ pub fn malloc_usable_size(ptr: *mut c_void) -> size_t; ++ pub fn sbrk(increment: intptr_t) -> *mut c_void; ++ pub fn rand() -> c_int; ++ pub fn read(fd: c_int, ptr: *mut c_void, size: size_t) -> ssize_t; ++ pub fn realloc(ptr: *mut c_void, amt: size_t) -> *mut c_void; ++ pub fn setenv(k: *const c_char, v: *const c_char, a: c_int) -> c_int; ++ pub fn unsetenv(k: *const c_char) -> c_int; ++ pub fn clearenv() -> c_int; ++ pub fn write(fd: c_int, ptr: *const c_void, size: size_t) -> ssize_t; ++ pub static mut environ: *mut *mut c_char; ++ pub fn fopen(a: *const c_char, b: *const c_char) -> *mut FILE; ++ pub fn freopen(a: *const c_char, b: *const c_char, f: *mut FILE) -> *mut FILE; ++ pub fn fclose(f: *mut FILE) -> c_int; ++ pub fn remove(a: *const c_char) -> c_int; ++ pub fn rename(a: *const c_char, b: *const c_char) -> c_int; ++ pub fn feof(f: *mut FILE) -> c_int; ++ pub fn ferror(f: *mut FILE) -> c_int; ++ pub fn fflush(f: *mut FILE) -> c_int; ++ pub fn clearerr(f: *mut FILE); ++ pub fn fseek(f: *mut FILE, b: c_long, c: c_int) -> c_int; ++ pub fn ftell(f: *mut FILE) -> c_long; ++ pub fn rewind(f: *mut FILE); ++ pub fn fgetpos(f: *mut FILE, pos: *mut fpos_t) -> c_int; ++ pub fn fsetpos(f: *mut FILE, pos: *const fpos_t) -> c_int; ++ pub fn fread(buf: *mut c_void, a: size_t, b: size_t, f: *mut FILE) -> size_t; ++ pub fn fwrite(buf: *const c_void, a: size_t, b: size_t, f: *mut FILE) -> size_t; ++ pub fn fgetc(f: *mut FILE) -> c_int; ++ pub fn getc(f: *mut FILE) -> c_int; ++ pub fn getchar() -> c_int; ++ pub fn ungetc(a: c_int, f: *mut FILE) -> c_int; ++ pub fn fputc(a: c_int, f: *mut FILE) -> c_int; ++ pub fn putc(a: c_int, f: *mut FILE) -> c_int; ++ pub fn putchar(a: c_int) -> c_int; ++ pub fn fputs(a: *const c_char, f: *mut FILE) -> c_int; ++ pub fn puts(a: *const c_char) -> c_int; ++ pub fn perror(a: *const c_char); ++ pub fn srand(a: c_uint); ++ pub fn atexit(a: extern "C" fn()) -> c_int; ++ pub fn at_quick_exit(a: extern "C" fn()) -> c_int; ++ pub fn quick_exit(a: c_int) -> !; ++ pub fn posix_memalign(a: *mut *mut c_void, b: size_t, c: size_t) -> c_int; ++ pub fn rand_r(a: *mut c_uint) -> c_int; ++ pub fn random() -> c_long; ++ pub fn srandom(a: c_uint); ++ pub fn putenv(a: *mut c_char) -> c_int; ++ pub fn clock() -> clock_t; ++ pub fn time(a: *mut time_t) -> time_t; ++ pub fn difftime(a: time_t, b: time_t) -> c_double; ++ pub fn mktime(a: *mut tm) -> time_t; ++ pub fn strftime(a: *mut c_char, b: size_t, c: *const c_char, d: *const tm) -> size_t; ++ pub fn gmtime(a: *const time_t) -> *mut tm; ++ pub fn gmtime_r(a: *const time_t, b: *mut tm) -> *mut tm; ++ pub fn localtime(a: *const time_t) -> *mut tm; ++ pub fn localtime_r(a: *const time_t, b: *mut tm) -> *mut tm; ++ pub fn asctime_r(a: *const tm, b: *mut c_char) -> *mut c_char; ++ pub fn ctime_r(a: *const time_t, b: *mut c_char) -> *mut c_char; ++ ++ static _CLOCK_MONOTONIC: u8; ++ static _CLOCK_PROCESS_CPUTIME_ID: u8; ++ static _CLOCK_REALTIME: u8; ++ static _CLOCK_THREAD_CPUTIME_ID: u8; ++ pub fn nanosleep(a: *const timespec, b: *mut timespec) -> c_int; ++ pub fn clock_getres(a: clockid_t, b: *mut timespec) -> c_int; ++ pub fn clock_gettime(a: clockid_t, b: *mut timespec) -> c_int; ++ pub fn clock_nanosleep(a: clockid_t, a2: c_int, b: *const timespec, c: *mut timespec) -> c_int; ++ ++ pub fn isalnum(c: c_int) -> c_int; ++ pub fn isalpha(c: c_int) -> c_int; ++ pub fn iscntrl(c: c_int) -> c_int; ++ pub fn isdigit(c: c_int) -> c_int; ++ pub fn isgraph(c: c_int) -> c_int; ++ pub fn islower(c: c_int) -> c_int; ++ pub fn isprint(c: c_int) -> c_int; ++ pub fn ispunct(c: c_int) -> c_int; ++ pub fn isspace(c: c_int) -> c_int; ++ pub fn isupper(c: c_int) -> c_int; ++ pub fn isxdigit(c: c_int) -> c_int; ++ pub fn isblank(c: c_int) -> c_int; ++ pub fn tolower(c: c_int) -> c_int; ++ pub fn toupper(c: c_int) -> c_int; ++ pub fn setvbuf(stream: *mut FILE, buffer: *mut c_char, mode: c_int, size: size_t) -> c_int; ++ pub fn setbuf(stream: *mut FILE, buf: *mut c_char); ++ pub fn fgets(buf: *mut c_char, n: c_int, stream: *mut FILE) -> *mut c_char; ++ pub fn atof(s: *const c_char) -> c_double; ++ pub fn atoi(s: *const c_char) -> c_int; ++ pub fn atol(s: *const c_char) -> c_long; ++ pub fn atoll(s: *const c_char) -> c_longlong; ++ 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; ++ pub fn strtol(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_long; ++ pub fn strtoll(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_longlong; ++ pub fn strtoul(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulong; ++ pub fn strtoull(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulonglong; ++ ++ pub fn strcpy(dst: *mut c_char, src: *const c_char) -> *mut c_char; ++ pub fn strncpy(dst: *mut c_char, src: *const c_char, n: size_t) -> *mut c_char; ++ pub fn strcat(s: *mut c_char, ct: *const c_char) -> *mut c_char; ++ pub fn strncat(s: *mut c_char, ct: *const c_char, n: size_t) -> *mut c_char; ++ pub fn strcmp(cs: *const c_char, ct: *const c_char) -> c_int; ++ pub fn strncmp(cs: *const c_char, ct: *const c_char, n: size_t) -> c_int; ++ pub fn strcoll(cs: *const c_char, ct: *const c_char) -> c_int; ++ pub fn strchr(cs: *const c_char, c: c_int) -> *mut c_char; ++ pub fn strrchr(cs: *const c_char, c: c_int) -> *mut c_char; ++ pub fn strspn(cs: *const c_char, ct: *const c_char) -> size_t; ++ pub fn strcspn(cs: *const c_char, ct: *const c_char) -> size_t; ++ pub fn strdup(cs: *const c_char) -> *mut c_char; ++ pub fn strndup(cs: *const c_char, n: size_t) -> *mut c_char; ++ pub fn strpbrk(cs: *const c_char, ct: *const c_char) -> *mut c_char; ++ pub fn strstr(cs: *const c_char, ct: *const c_char) -> *mut c_char; ++ pub fn strcasecmp(s1: *const c_char, s2: *const c_char) -> c_int; ++ pub fn strncasecmp(s1: *const c_char, s2: *const c_char, n: size_t) -> c_int; ++ pub fn strlen(cs: *const c_char) -> size_t; ++ pub fn strnlen(cs: *const c_char, maxlen: size_t) -> size_t; ++ pub fn strerror(n: c_int) -> *mut c_char; ++ pub fn strtok(s: *mut c_char, t: *const c_char) -> *mut c_char; ++ pub fn strxfrm(s: *mut c_char, ct: *const c_char, n: size_t) -> size_t; ++ ++ pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void; ++ pub fn memcmp(cx: *const c_void, ct: *const c_void, n: size_t) -> c_int; ++ pub fn memcpy(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void; ++ pub fn memmove(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void; ++ pub fn memset(dest: *mut c_void, c: c_int, n: size_t) -> *mut c_void; ++ ++ pub fn fprintf(stream: *mut crate::FILE, format: *const c_char, ...) -> c_int; ++ pub fn printf(format: *const c_char, ...) -> c_int; ++ pub fn snprintf(s: *mut c_char, n: size_t, format: *const c_char, ...) -> c_int; ++ pub fn sprintf(s: *mut c_char, format: *const c_char, ...) -> c_int; ++ pub fn fscanf(stream: *mut crate::FILE, format: *const c_char, ...) -> c_int; ++ pub fn scanf(format: *const c_char, ...) -> c_int; ++ pub fn sscanf(s: *const c_char, format: *const c_char, ...) -> c_int; ++ pub fn getchar_unlocked() -> c_int; ++ pub fn putchar_unlocked(c: c_int) -> c_int; ++ ++ pub fn shutdown(socket: c_int, how: c_int) -> c_int; ++ pub fn fstat(fildes: c_int, buf: *mut stat) -> c_int; ++ pub fn mkdir(path: *const c_char, mode: mode_t) -> c_int; ++ pub fn stat(path: *const c_char, buf: *mut stat) -> c_int; ++ pub fn fdopen(fd: c_int, mode: *const c_char) -> *mut crate::FILE; ++ pub fn fileno(stream: *mut crate::FILE) -> c_int; ++ pub fn open(path: *const c_char, oflag: c_int, ...) -> c_int; ++ pub fn creat(path: *const c_char, mode: mode_t) -> c_int; ++ pub fn fcntl(fd: c_int, cmd: c_int, ...) -> c_int; ++ pub fn opendir(dirname: *const c_char) -> *mut crate::DIR; ++ pub fn fdopendir(fd: c_int) -> *mut crate::DIR; ++ pub fn readdir(dirp: *mut crate::DIR) -> *mut crate::dirent; ++ pub fn closedir(dirp: *mut crate::DIR) -> c_int; ++ pub fn rewinddir(dirp: *mut crate::DIR); ++ pub fn dirfd(dirp: *mut crate::DIR) -> c_int; ++ pub fn seekdir(dirp: *mut crate::DIR, loc: c_long); ++ pub fn telldir(dirp: *mut crate::DIR) -> c_long; ++ ++ pub fn openat(dirfd: c_int, pathname: *const c_char, flags: c_int, ...) -> c_int; ++ pub fn fstatat(dirfd: c_int, pathname: *const c_char, buf: *mut stat, flags: c_int) -> c_int; ++ pub fn linkat( ++ olddirfd: c_int, ++ oldpath: *const c_char, ++ newdirfd: c_int, ++ newpath: *const c_char, ++ flags: c_int, ++ ) -> c_int; ++ pub fn mkdirat(dirfd: c_int, pathname: *const c_char, mode: crate::mode_t) -> c_int; ++ pub fn readlinkat( ++ dirfd: c_int, ++ pathname: *const c_char, ++ buf: *mut c_char, ++ bufsiz: size_t, ++ ) -> ssize_t; ++ pub fn renameat( ++ olddirfd: c_int, ++ oldpath: *const c_char, ++ newdirfd: c_int, ++ newpath: *const c_char, ++ ) -> c_int; ++ pub fn symlinkat(target: *const c_char, newdirfd: c_int, linkpath: *const c_char) -> c_int; ++ pub fn unlinkat(dirfd: c_int, pathname: *const c_char, flags: c_int) -> c_int; ++ ++ pub fn access(path: *const c_char, amode: c_int) -> c_int; ++ pub fn close(fd: c_int) -> c_int; ++ pub fn fpathconf(filedes: c_int, name: c_int) -> c_long; ++ pub fn getopt(argc: c_int, argv: *const *mut c_char, optstr: *const c_char) -> c_int; ++ pub fn isatty(fd: c_int) -> c_int; ++ pub fn link(src: *const c_char, dst: *const c_char) -> c_int; ++ pub fn lseek(fd: c_int, offset: off_t, whence: c_int) -> off_t; ++ pub fn pathconf(path: *const c_char, name: c_int) -> c_long; ++ pub fn rmdir(path: *const c_char) -> c_int; ++ pub fn sleep(secs: c_uint) -> c_uint; ++ pub fn unlink(c: *const c_char) -> c_int; ++ pub fn pread(fd: c_int, buf: *mut c_void, count: size_t, offset: off_t) -> ssize_t; ++ pub fn pwrite(fd: c_int, buf: *const c_void, count: size_t, offset: off_t) -> ssize_t; ++ ++ pub fn lstat(path: *const c_char, buf: *mut stat) -> c_int; ++ ++ pub fn fsync(fd: c_int) -> c_int; ++ pub fn fdatasync(fd: c_int) -> c_int; ++ ++ pub fn symlink(path1: *const c_char, path2: *const c_char) -> c_int; ++ ++ pub fn truncate(path: *const c_char, length: off_t) -> c_int; ++ pub fn ftruncate(fd: c_int, length: off_t) -> c_int; ++ ++ pub fn getrusage(resource: c_int, usage: *mut rusage) -> c_int; ++ ++ pub fn gettimeofday(tp: *mut crate::timeval, tz: *mut c_void) -> c_int; ++ pub fn times(buf: *mut crate::tms) -> crate::clock_t; ++ ++ pub fn strerror_r(errnum: c_int, buf: *mut c_char, buflen: size_t) -> c_int; ++ ++ pub fn usleep(secs: c_uint) -> c_int; ++ pub fn send(socket: c_int, buf: *const c_void, len: size_t, flags: c_int) -> ssize_t; ++ pub fn recv(socket: c_int, buf: *mut c_void, len: size_t, flags: c_int) -> ssize_t; ++ pub fn poll(fds: *mut pollfd, nfds: nfds_t, timeout: c_int) -> c_int; ++ pub fn setlocale(category: c_int, locale: *const c_char) -> *mut c_char; ++ pub fn localeconv() -> *mut lconv; ++ ++ pub fn readlink(path: *const c_char, buf: *mut c_char, bufsz: size_t) -> ssize_t; ++ ++ pub fn timegm(tm: *mut crate::tm) -> time_t; ++ ++ pub fn sysconf(name: c_int) -> c_long; ++ ++ pub fn ioctl(fd: c_int, request: c_int, ...) -> c_int; ++ ++ pub fn fseeko(stream: *mut crate::FILE, offset: off_t, whence: c_int) -> c_int; ++ pub fn ftello(stream: *mut crate::FILE) -> off_t; ++ pub fn posix_fallocate(fd: c_int, offset: off_t, len: off_t) -> c_int; ++ ++ pub fn strcasestr(cs: *const c_char, ct: *const c_char) -> *mut c_char; ++ pub fn getline(lineptr: *mut *mut c_char, n: *mut size_t, stream: *mut FILE) -> ssize_t; ++ ++ pub fn faccessat(dirfd: c_int, pathname: *const c_char, mode: c_int, flags: c_int) -> c_int; ++ pub fn writev(fd: c_int, iov: *const crate::iovec, iovcnt: c_int) -> ssize_t; ++ pub fn readv(fd: c_int, iov: *const crate::iovec, iovcnt: c_int) -> ssize_t; ++ pub fn pwritev(fd: c_int, iov: *const crate::iovec, iovcnt: c_int, offset: off_t) -> ssize_t; ++ pub fn preadv(fd: c_int, iov: *const crate::iovec, iovcnt: c_int, offset: off_t) -> ssize_t; ++ pub fn posix_fadvise(fd: c_int, offset: off_t, len: off_t, advise: c_int) -> c_int; ++ pub fn futimens(fd: c_int, times: *const crate::timespec) -> c_int; ++ pub fn utimensat( ++ dirfd: c_int, ++ path: *const c_char, ++ times: *const crate::timespec, ++ flag: c_int, ++ ) -> c_int; ++ pub fn getentropy(buf: *mut c_void, buflen: size_t) -> c_int; ++ pub fn memrchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void; ++ pub fn abs(i: c_int) -> c_int; ++ pub fn labs(i: c_long) -> c_long; ++ pub fn duplocale(base: crate::locale_t) -> crate::locale_t; ++ pub fn freelocale(loc: crate::locale_t); ++ pub fn newlocale(mask: c_int, locale: *const c_char, base: crate::locale_t) -> crate::locale_t; ++ pub fn uselocale(loc: crate::locale_t) -> crate::locale_t; ++ pub fn sched_yield() -> c_int; ++ pub fn getcwd(buf: *mut c_char, size: size_t) -> *mut c_char; ++ pub fn chdir(dir: *const c_char) -> c_int; ++ ++ pub fn nl_langinfo(item: crate::nl_item) -> *mut c_char; ++ pub fn nl_langinfo_l(item: crate::nl_item, loc: crate::locale_t) -> *mut c_char; ++ ++ pub fn select( ++ nfds: c_int, ++ readfds: *mut fd_set, ++ writefds: *mut fd_set, ++ errorfds: *mut fd_set, ++ timeout: *const timeval, ++ ) -> c_int; ++ ++ pub fn __wasilibc_register_preopened_fd(fd: c_int, path: *const c_char) -> c_int; ++ pub fn __wasilibc_fd_renumber(fd: c_int, newfd: c_int) -> c_int; ++ pub fn __wasilibc_unlinkat(fd: c_int, path: *const c_char) -> c_int; ++ pub fn __wasilibc_rmdirat(fd: c_int, path: *const c_char) -> c_int; ++ pub fn __wasilibc_find_relpath( ++ path: *const c_char, ++ abs_prefix: *mut *const c_char, ++ relative_path: *mut *mut c_char, ++ relative_path_len: usize, ++ ) -> c_int; ++ pub fn __wasilibc_tell(fd: c_int) -> off_t; ++ pub fn __wasilibc_nocwd___wasilibc_unlinkat(dirfd: c_int, path: *const c_char) -> c_int; ++ pub fn __wasilibc_nocwd___wasilibc_rmdirat(dirfd: c_int, path: *const c_char) -> c_int; ++ pub fn __wasilibc_nocwd_linkat( ++ olddirfd: c_int, ++ oldpath: *const c_char, ++ newdirfd: c_int, ++ newpath: *const c_char, ++ flags: c_int, ++ ) -> c_int; ++ pub fn __wasilibc_nocwd_symlinkat( ++ target: *const c_char, ++ dirfd: c_int, ++ path: *const c_char, ++ ) -> c_int; ++ pub fn __wasilibc_nocwd_readlinkat( ++ dirfd: c_int, ++ path: *const c_char, ++ buf: *mut c_char, ++ bufsize: usize, ++ ) -> isize; ++ pub fn __wasilibc_nocwd_faccessat( ++ dirfd: c_int, ++ path: *const c_char, ++ mode: c_int, ++ flags: c_int, ++ ) -> c_int; ++ pub fn __wasilibc_nocwd_renameat( ++ olddirfd: c_int, ++ oldpath: *const c_char, ++ newdirfd: c_int, ++ newpath: *const c_char, ++ ) -> c_int; ++ pub fn __wasilibc_nocwd_openat_nomode(dirfd: c_int, path: *const c_char, flags: c_int) ++ -> c_int; ++ pub fn __wasilibc_nocwd_fstatat( ++ dirfd: c_int, ++ path: *const c_char, ++ buf: *mut stat, ++ flags: c_int, ++ ) -> c_int; ++ pub fn __wasilibc_nocwd_mkdirat_nomode(dirfd: c_int, path: *const c_char) -> c_int; ++ pub fn __wasilibc_nocwd_utimensat( ++ dirfd: c_int, ++ path: *const c_char, ++ times: *const crate::timespec, ++ flags: c_int, ++ ) -> c_int; ++ pub fn __wasilibc_nocwd_opendirat(dirfd: c_int, path: *const c_char) -> *mut crate::DIR; ++ pub fn __wasilibc_access(pathname: *const c_char, mode: c_int, flags: c_int) -> c_int; ++ pub fn __wasilibc_stat(pathname: *const c_char, buf: *mut stat, flags: c_int) -> c_int; ++ pub fn __wasilibc_utimens( ++ pathname: *const c_char, ++ times: *const crate::timespec, ++ flags: c_int, ++ ) -> c_int; ++ pub fn __wasilibc_link(oldpath: *const c_char, newpath: *const c_char, flags: c_int) -> c_int; ++ pub fn __wasilibc_link_oldat( ++ olddirfd: c_int, ++ oldpath: *const c_char, ++ newpath: *const c_char, ++ flags: c_int, ++ ) -> c_int; ++ pub fn __wasilibc_link_newat( ++ oldpath: *const c_char, ++ newdirfd: c_int, ++ newpath: *const c_char, ++ flags: c_int, ++ ) -> c_int; ++ pub fn __wasilibc_rename_oldat( ++ olddirfd: c_int, ++ oldpath: *const c_char, ++ newpath: *const c_char, ++ ) -> c_int; ++ pub fn __wasilibc_rename_newat( ++ oldpath: *const c_char, ++ newdirfd: c_int, ++ newpath: *const c_char, ++ ) -> c_int; ++ ++ pub fn arc4random() -> u32; ++ pub fn arc4random_buf(a: *mut c_void, b: size_t); ++ pub fn arc4random_uniform(a: u32) -> u32; ++ ++ pub fn __errno_location() -> *mut c_int; ++} ++ ++cfg_if! { ++ if #[cfg(target_env = "p2")] { ++ mod p2; ++ pub use self::p2::*; ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/wasi/p2.rs mesa-25.3.3/subprojects/libc-0.2.169/src/wasi/p2.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/wasi/p2.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/wasi/p2.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,188 @@ ++use crate::prelude::*; ++ ++pub type sa_family_t = c_ushort; ++pub type in_port_t = c_ushort; ++pub type in_addr_t = c_uint; ++ ++pub type socklen_t = c_uint; ++ ++s! { ++ #[repr(align(16))] ++ pub struct sockaddr { ++ pub sa_family: sa_family_t, ++ pub sa_data: [c_char; 0], ++ } ++ ++ pub struct in_addr { ++ pub s_addr: in_addr_t, ++ } ++ ++ #[repr(align(16))] ++ pub struct sockaddr_in { ++ pub sin_family: sa_family_t, ++ pub sin_port: in_port_t, ++ pub sin_addr: in_addr, ++ } ++ ++ #[repr(align(4))] ++ pub struct in6_addr { ++ pub s6_addr: [c_uchar; 16], ++ } ++ ++ #[repr(align(16))] ++ pub struct sockaddr_in6 { ++ pub sin6_family: sa_family_t, ++ pub sin6_port: in_port_t, ++ pub sin6_flowinfo: c_uint, ++ pub sin6_addr: in6_addr, ++ pub sin6_scope_id: c_uint, ++ } ++ ++ #[repr(align(16))] ++ pub struct sockaddr_storage { ++ pub ss_family: sa_family_t, ++ pub __ss_data: [c_char; 32], ++ } ++ ++ pub struct addrinfo { ++ pub ai_flags: c_int, ++ pub ai_family: c_int, ++ pub ai_socktype: c_int, ++ pub ai_protocol: c_int, ++ pub ai_addrlen: socklen_t, ++ pub ai_addr: *mut sockaddr, ++ pub ai_canonname: *mut c_char, ++ pub ai_next: *mut addrinfo, ++ } ++ ++ pub struct ip_mreq { ++ pub imr_multiaddr: in_addr, ++ pub imr_interface: in_addr, ++ } ++ ++ pub struct ipv6_mreq { ++ pub ipv6mr_multiaddr: in6_addr, ++ pub ipv6mr_interface: c_uint, ++ } ++ ++ pub struct linger { ++ pub l_onoff: c_int, ++ pub l_linger: c_int, ++ } ++} ++ ++pub const SHUT_RD: c_int = 1 << 0; ++pub const SHUT_WR: c_int = 1 << 1; ++pub const SHUT_RDWR: c_int = SHUT_RD | SHUT_WR; ++ ++pub const MSG_NOSIGNAL: c_int = 0x4000; ++pub const MSG_PEEK: c_int = 0x0002; ++ ++pub const SO_REUSEADDR: c_int = 2; ++pub const SO_TYPE: c_int = 3; ++pub const SO_ERROR: c_int = 4; ++pub const SO_BROADCAST: c_int = 6; ++pub const SO_SNDBUF: c_int = 7; ++pub const SO_RCVBUF: c_int = 8; ++pub const SO_KEEPALIVE: c_int = 9; ++pub const SO_LINGER: c_int = 13; ++pub const SO_ACCEPTCONN: c_int = 30; ++pub const SO_PROTOCOL: c_int = 38; ++pub const SO_DOMAIN: c_int = 39; ++pub const SO_RCVTIMEO: c_int = 66; ++pub const SO_SNDTIMEO: c_int = 67; ++ ++pub const SOCK_DGRAM: c_int = 5; ++pub const SOCK_STREAM: c_int = 6; ++pub const SOCK_NONBLOCK: c_int = 0x00004000; ++ ++pub const SOL_SOCKET: c_int = 0x7fffffff; ++ ++pub const AF_UNSPEC: c_int = 0; ++pub const AF_INET: c_int = 1; ++pub const AF_INET6: c_int = 2; ++ ++pub const IPPROTO_IP: c_int = 0; ++pub const IPPROTO_TCP: c_int = 6; ++pub const IPPROTO_UDP: c_int = 17; ++pub const IPPROTO_IPV6: c_int = 41; ++ ++pub const IP_TTL: c_int = 2; ++pub const IP_MULTICAST_TTL: c_int = 33; ++pub const IP_MULTICAST_LOOP: c_int = 34; ++pub const IP_ADD_MEMBERSHIP: c_int = 35; ++pub const IP_DROP_MEMBERSHIP: c_int = 36; ++ ++pub const IPV6_UNICAST_HOPS: c_int = 16; ++pub const IPV6_MULTICAST_LOOP: c_int = 19; ++pub const IPV6_JOIN_GROUP: c_int = 20; ++pub const IPV6_LEAVE_GROUP: c_int = 21; ++pub const IPV6_V6ONLY: c_int = 26; ++ ++pub const IPV6_ADD_MEMBERSHIP: c_int = IPV6_JOIN_GROUP; ++pub const IPV6_DROP_MEMBERSHIP: c_int = IPV6_LEAVE_GROUP; ++ ++pub const TCP_NODELAY: c_int = 1; ++pub const TCP_KEEPIDLE: c_int = 4; ++pub const TCP_KEEPINTVL: c_int = 5; ++pub const TCP_KEEPCNT: c_int = 6; ++ ++pub const EAI_SYSTEM: c_int = -11; ++ ++extern "C" { ++ pub fn socket(domain: c_int, type_: c_int, protocol: c_int) -> c_int; ++ pub fn connect(fd: c_int, name: *const sockaddr, addrlen: socklen_t) -> c_int; ++ pub fn bind(socket: c_int, addr: *const sockaddr, addrlen: socklen_t) -> c_int; ++ pub fn listen(socket: c_int, backlog: c_int) -> c_int; ++ pub fn accept(socket: c_int, addr: *mut sockaddr, addrlen: *mut socklen_t) -> c_int; ++ pub fn accept4( ++ socket: c_int, ++ addr: *mut sockaddr, ++ addrlen: *mut socklen_t, ++ flags: c_int, ++ ) -> c_int; ++ ++ pub fn getsockname(socket: c_int, addr: *mut sockaddr, addrlen: *mut socklen_t) -> c_int; ++ pub fn getpeername(socket: c_int, addr: *mut sockaddr, addrlen: *mut socklen_t) -> c_int; ++ ++ pub fn sendto( ++ socket: c_int, ++ buffer: *const c_void, ++ length: size_t, ++ flags: c_int, ++ addr: *const sockaddr, ++ addrlen: socklen_t, ++ ) -> ssize_t; ++ pub fn recvfrom( ++ socket: c_int, ++ buffer: *mut c_void, ++ length: size_t, ++ flags: c_int, ++ addr: *mut sockaddr, ++ addrlen: *mut socklen_t, ++ ) -> ssize_t; ++ ++ pub fn getsockopt( ++ sockfd: c_int, ++ level: c_int, ++ optname: c_int, ++ optval: *mut c_void, ++ optlen: *mut socklen_t, ++ ) -> c_int; ++ pub fn setsockopt( ++ sockfd: c_int, ++ level: c_int, ++ optname: c_int, ++ optval: *const c_void, ++ optlen: socklen_t, ++ ) -> c_int; ++ ++ pub fn getaddrinfo( ++ host: *const c_char, ++ serv: *const c_char, ++ hint: *const addrinfo, ++ res: *mut *mut addrinfo, ++ ) -> c_int; ++ pub fn freeaddrinfo(p: *mut addrinfo); ++ pub fn gai_strerror(ecode: c_int) -> *const c_char; ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/windows/gnu/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/windows/gnu/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/windows/gnu/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/windows/gnu/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,38 @@ ++use crate::prelude::*; ++ ++cfg_if! { ++ if #[cfg(target_pointer_width = "64")] { ++ s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ #[repr(align(16))] ++ pub struct max_align_t { ++ priv_: [f64; 4], ++ } ++ } ++ } else if #[cfg(target_pointer_width = "32")] { ++ s_no_extra_traits! { ++ #[allow(missing_debug_implementations)] ++ #[repr(align(16))] ++ pub struct max_align_t { ++ priv_: [i64; 6], ++ } ++ } ++ } ++} ++ ++pub const L_tmpnam: c_uint = 14; ++pub const TMP_MAX: c_uint = 0x7fff; ++ ++// stdio file descriptor numbers ++pub const STDIN_FILENO: c_int = 0; ++pub const STDOUT_FILENO: c_int = 1; ++pub const STDERR_FILENO: c_int = 2; ++ ++extern "C" { ++ pub fn strcasecmp(s1: *const c_char, s2: *const c_char) -> c_int; ++ pub fn strncasecmp(s1: *const c_char, s2: *const c_char, n: size_t) -> c_int; ++ ++ // NOTE: For MSVC target, `wmemchr` is only a inline function in `` ++ // header file. We cannot find a way to link to that symbol from Rust. ++ pub fn wmemchr(cx: *const crate::wchar_t, c: crate::wchar_t, n: size_t) -> *mut crate::wchar_t; ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/windows/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/windows/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/windows/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/windows/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,592 @@ ++//! Windows CRT definitions ++ ++use crate::prelude::*; ++ ++pub type c_schar = i8; ++pub type c_uchar = u8; ++pub type c_short = i16; ++pub type c_ushort = u16; ++pub type c_int = i32; ++pub type c_uint = u32; ++pub type c_float = f32; ++pub type c_double = f64; ++pub type c_longlong = i64; ++pub type c_ulonglong = u64; ++pub type intmax_t = i64; ++pub type uintmax_t = u64; ++ ++pub type size_t = usize; ++pub type ptrdiff_t = isize; ++pub type intptr_t = isize; ++pub type uintptr_t = usize; ++pub type ssize_t = isize; ++pub type sighandler_t = usize; ++ ++pub type c_char = i8; ++pub type c_long = i32; ++pub type c_ulong = u32; ++pub type wchar_t = u16; ++ ++pub type clock_t = i32; ++ ++pub type errno_t = c_int; ++ ++cfg_if! { ++ if #[cfg(all(target_arch = "x86", target_env = "gnu"))] { ++ pub type time_t = i32; ++ } else { ++ pub type time_t = i64; ++ } ++} ++ ++pub type off_t = i32; ++pub type dev_t = u32; ++pub type ino_t = u16; ++#[cfg_attr(feature = "extra_traits", derive(Debug))] ++pub enum timezone {} ++impl Copy for timezone {} ++impl Clone for timezone { ++ fn clone(&self) -> timezone { ++ *self ++ } ++} ++pub type time64_t = i64; ++ ++pub type SOCKET = crate::uintptr_t; ++ ++s! { ++ // note this is the struct called stat64 in Windows. Not stat, nor stati64. ++ pub struct stat { ++ pub st_dev: dev_t, ++ pub st_ino: ino_t, ++ pub st_mode: u16, ++ pub st_nlink: c_short, ++ pub st_uid: c_short, ++ pub st_gid: c_short, ++ pub st_rdev: dev_t, ++ pub st_size: i64, ++ pub st_atime: time64_t, ++ pub st_mtime: time64_t, ++ pub st_ctime: time64_t, ++ } ++ ++ // note that this is called utimbuf64 in Windows ++ pub struct utimbuf { ++ pub actime: time64_t, ++ pub modtime: time64_t, ++ } ++ ++ pub struct tm { ++ pub tm_sec: c_int, ++ pub tm_min: c_int, ++ pub tm_hour: c_int, ++ pub tm_mday: c_int, ++ pub tm_mon: c_int, ++ pub tm_year: c_int, ++ pub tm_wday: c_int, ++ pub tm_yday: c_int, ++ pub tm_isdst: c_int, ++ } ++ ++ pub struct timeval { ++ pub tv_sec: c_long, ++ pub tv_usec: c_long, ++ } ++ ++ pub struct timespec { ++ pub tv_sec: time_t, ++ pub tv_nsec: c_long, ++ } ++ ++ pub struct sockaddr { ++ pub sa_family: c_ushort, ++ pub sa_data: [c_char; 14], ++ } ++} ++ ++pub const INT_MIN: c_int = -2147483648; ++pub const INT_MAX: c_int = 2147483647; ++ ++pub const EXIT_FAILURE: c_int = 1; ++pub const EXIT_SUCCESS: c_int = 0; ++pub const RAND_MAX: c_int = 32767; ++pub const EOF: c_int = -1; ++pub const SEEK_SET: c_int = 0; ++pub const SEEK_CUR: c_int = 1; ++pub const SEEK_END: c_int = 2; ++pub const _IOFBF: c_int = 0; ++pub const _IONBF: c_int = 4; ++pub const _IOLBF: c_int = 64; ++pub const BUFSIZ: c_uint = 512; ++pub const FOPEN_MAX: c_uint = 20; ++pub const FILENAME_MAX: c_uint = 260; ++ ++// fcntl.h ++pub const O_RDONLY: c_int = 0x0000; ++pub const O_WRONLY: c_int = 0x0001; ++pub const O_RDWR: c_int = 0x0002; ++pub const O_APPEND: c_int = 0x0008; ++pub const O_CREAT: c_int = 0x0100; ++pub const O_TRUNC: c_int = 0x0200; ++pub const O_EXCL: c_int = 0x0400; ++pub const O_TEXT: c_int = 0x4000; ++pub const O_BINARY: c_int = 0x8000; ++pub const _O_WTEXT: c_int = 0x10000; ++pub const _O_U16TEXT: c_int = 0x20000; ++pub const _O_U8TEXT: c_int = 0x40000; ++pub const O_RAW: c_int = O_BINARY; ++pub const O_NOINHERIT: c_int = 0x0080; ++pub const O_TEMPORARY: c_int = 0x0040; ++pub const _O_SHORT_LIVED: c_int = 0x1000; ++pub const _O_OBTAIN_DIR: c_int = 0x2000; ++pub const O_SEQUENTIAL: c_int = 0x0020; ++pub const O_RANDOM: c_int = 0x0010; ++ ++pub const S_IFCHR: c_int = 0o2_0000; ++pub const S_IFDIR: c_int = 0o4_0000; ++pub const S_IFREG: c_int = 0o10_0000; ++pub const S_IFMT: c_int = 0o17_0000; ++pub const S_IEXEC: c_int = 0o0100; ++pub const S_IWRITE: c_int = 0o0200; ++pub const S_IREAD: c_int = 0o0400; ++ ++pub const LC_ALL: c_int = 0; ++pub const LC_COLLATE: c_int = 1; ++pub const LC_CTYPE: c_int = 2; ++pub const LC_MONETARY: c_int = 3; ++pub const LC_NUMERIC: c_int = 4; ++pub const LC_TIME: c_int = 5; ++ ++pub const EPERM: c_int = 1; ++pub const ENOENT: c_int = 2; ++pub const ESRCH: c_int = 3; ++pub const EINTR: c_int = 4; ++pub const EIO: c_int = 5; ++pub const ENXIO: c_int = 6; ++pub const E2BIG: c_int = 7; ++pub const ENOEXEC: c_int = 8; ++pub const EBADF: c_int = 9; ++pub const ECHILD: c_int = 10; ++pub const EAGAIN: c_int = 11; ++pub const ENOMEM: c_int = 12; ++pub const EACCES: c_int = 13; ++pub const EFAULT: c_int = 14; ++pub const EBUSY: c_int = 16; ++pub const EEXIST: c_int = 17; ++pub const EXDEV: c_int = 18; ++pub const ENODEV: c_int = 19; ++pub const ENOTDIR: c_int = 20; ++pub const EISDIR: c_int = 21; ++pub const EINVAL: c_int = 22; ++pub const ENFILE: c_int = 23; ++pub const EMFILE: c_int = 24; ++pub const ENOTTY: c_int = 25; ++pub const EFBIG: c_int = 27; ++pub const ENOSPC: c_int = 28; ++pub const ESPIPE: c_int = 29; ++pub const EROFS: c_int = 30; ++pub const EMLINK: c_int = 31; ++pub const EPIPE: c_int = 32; ++pub const EDOM: c_int = 33; ++pub const ERANGE: c_int = 34; ++pub const EDEADLK: c_int = 36; ++pub const EDEADLOCK: c_int = 36; ++pub const ENAMETOOLONG: c_int = 38; ++pub const ENOLCK: c_int = 39; ++pub const ENOSYS: c_int = 40; ++pub const ENOTEMPTY: c_int = 41; ++pub const EILSEQ: c_int = 42; ++pub const STRUNCATE: c_int = 80; ++ ++// POSIX Supplement (from errno.h) ++pub const EADDRINUSE: c_int = 100; ++pub const EADDRNOTAVAIL: c_int = 101; ++pub const EAFNOSUPPORT: c_int = 102; ++pub const EALREADY: c_int = 103; ++pub const EBADMSG: c_int = 104; ++pub const ECANCELED: c_int = 105; ++pub const ECONNABORTED: c_int = 106; ++pub const ECONNREFUSED: c_int = 107; ++pub const ECONNRESET: c_int = 108; ++pub const EDESTADDRREQ: c_int = 109; ++pub const EHOSTUNREACH: c_int = 110; ++pub const EIDRM: c_int = 111; ++pub const EINPROGRESS: c_int = 112; ++pub const EISCONN: c_int = 113; ++pub const ELOOP: c_int = 114; ++pub const EMSGSIZE: c_int = 115; ++pub const ENETDOWN: c_int = 116; ++pub const ENETRESET: c_int = 117; ++pub const ENETUNREACH: c_int = 118; ++pub const ENOBUFS: c_int = 119; ++pub const ENODATA: c_int = 120; ++pub const ENOLINK: c_int = 121; ++pub const ENOMSG: c_int = 122; ++pub const ENOPROTOOPT: c_int = 123; ++pub const ENOSR: c_int = 124; ++pub const ENOSTR: c_int = 125; ++pub const ENOTCONN: c_int = 126; ++pub const ENOTRECOVERABLE: c_int = 127; ++pub const ENOTSOCK: c_int = 128; ++pub const ENOTSUP: c_int = 129; ++pub const EOPNOTSUPP: c_int = 130; ++pub const EOVERFLOW: c_int = 132; ++pub const EOWNERDEAD: c_int = 133; ++pub const EPROTO: c_int = 134; ++pub const EPROTONOSUPPORT: c_int = 135; ++pub const EPROTOTYPE: c_int = 136; ++pub const ETIME: c_int = 137; ++pub const ETIMEDOUT: c_int = 138; ++pub const ETXTBSY: c_int = 139; ++pub const EWOULDBLOCK: c_int = 140; ++ ++// signal codes ++pub const SIGINT: c_int = 2; ++pub const SIGILL: c_int = 4; ++pub const SIGFPE: c_int = 8; ++pub const SIGSEGV: c_int = 11; ++pub const SIGTERM: c_int = 15; ++pub const SIGABRT: c_int = 22; ++pub const NSIG: c_int = 23; ++ ++pub const SIG_ERR: c_int = -1; ++pub const SIG_DFL: crate::sighandler_t = 0; ++pub const SIG_IGN: crate::sighandler_t = 1; ++pub const SIG_GET: crate::sighandler_t = 2; ++pub const SIG_SGE: crate::sighandler_t = 3; ++pub const SIG_ACK: crate::sighandler_t = 4; ++ ++// DIFF(main): removed in 458c58f409 ++// FIXME(msrv): done by `std` starting in 1.79.0 ++// inline comment below appeases style checker ++#[cfg(all(target_env = "msvc", feature = "rustc-dep-of-std"))] // " if " ++#[link(name = "msvcrt", cfg(not(target_feature = "crt-static")))] ++#[link(name = "libcmt", cfg(target_feature = "crt-static"))] ++extern "C" {} ++ ++#[cfg_attr(feature = "extra_traits", derive(Debug))] ++pub enum FILE {} ++impl Copy for FILE {} ++impl Clone for FILE { ++ fn clone(&self) -> FILE { ++ *self ++ } ++} ++#[cfg_attr(feature = "extra_traits", derive(Debug))] ++pub enum fpos_t {} // FIXME: fill this out with a struct ++impl Copy for fpos_t {} ++impl Clone for fpos_t { ++ fn clone(&self) -> fpos_t { ++ *self ++ } ++} ++ ++// Special handling for all print and scan type functions because of https://github.com/rust-lang/libc/issues/2860 ++cfg_if! { ++ if #[cfg(not(feature = "rustc-dep-of-std"))] { ++ #[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; ++ pub fn iscntrl(c: c_int) -> c_int; ++ pub fn isdigit(c: c_int) -> c_int; ++ pub fn isgraph(c: c_int) -> c_int; ++ pub fn islower(c: c_int) -> c_int; ++ pub fn isprint(c: c_int) -> c_int; ++ pub fn ispunct(c: c_int) -> c_int; ++ pub fn isspace(c: c_int) -> c_int; ++ pub fn isupper(c: c_int) -> c_int; ++ pub fn isxdigit(c: c_int) -> c_int; ++ pub fn isblank(c: c_int) -> c_int; ++ pub fn tolower(c: c_int) -> c_int; ++ pub fn toupper(c: c_int) -> c_int; ++ pub fn fopen(filename: *const c_char, mode: *const c_char) -> *mut FILE; ++ pub fn freopen(filename: *const c_char, mode: *const c_char, file: *mut FILE) -> *mut FILE; ++ pub fn fflush(file: *mut FILE) -> c_int; ++ pub fn fclose(file: *mut FILE) -> c_int; ++ pub fn remove(filename: *const c_char) -> c_int; ++ pub fn rename(oldname: *const c_char, newname: *const c_char) -> c_int; ++ pub fn tmpfile() -> *mut FILE; ++ pub fn setvbuf(stream: *mut FILE, buffer: *mut c_char, mode: c_int, size: size_t) -> c_int; ++ pub fn setbuf(stream: *mut FILE, buf: *mut c_char); ++ pub fn getchar() -> c_int; ++ pub fn putchar(c: c_int) -> c_int; ++ pub fn fgetc(stream: *mut FILE) -> c_int; ++ pub fn fgets(buf: *mut c_char, n: c_int, stream: *mut FILE) -> *mut c_char; ++ pub fn fputc(c: c_int, stream: *mut FILE) -> c_int; ++ pub fn fputs(s: *const c_char, stream: *mut FILE) -> c_int; ++ pub fn puts(s: *const c_char) -> c_int; ++ pub fn ungetc(c: c_int, stream: *mut FILE) -> c_int; ++ pub fn fread(ptr: *mut c_void, size: size_t, nobj: size_t, stream: *mut FILE) -> size_t; ++ pub fn fwrite(ptr: *const c_void, size: size_t, nobj: size_t, stream: *mut FILE) -> size_t; ++ pub fn fseek(stream: *mut FILE, offset: c_long, whence: c_int) -> c_int; ++ pub fn ftell(stream: *mut FILE) -> c_long; ++ pub fn rewind(stream: *mut FILE); ++ pub fn fgetpos(stream: *mut FILE, ptr: *mut fpos_t) -> c_int; ++ pub fn fsetpos(stream: *mut FILE, ptr: *const fpos_t) -> c_int; ++ 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 atof(s: *const c_char) -> c_double; ++ pub fn atoi(s: *const c_char) -> c_int; ++ pub fn atol(s: *const c_char) -> c_long; ++ pub fn atoll(s: *const c_char) -> c_longlong; ++ 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; ++ pub fn strtol(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_long; ++ pub fn strtoll(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_longlong; ++ pub fn strtoul(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulong; ++ pub fn strtoull(s: *const c_char, endp: *mut *mut c_char, base: c_int) -> c_ulonglong; ++ pub fn calloc(nobj: size_t, size: size_t) -> *mut c_void; ++ pub fn malloc(size: size_t) -> *mut c_void; ++ pub fn _msize(p: *mut c_void) -> size_t; ++ pub fn realloc(p: *mut c_void, size: size_t) -> *mut c_void; ++ pub fn free(p: *mut c_void); ++ pub fn abort() -> !; ++ pub fn exit(status: c_int) -> !; ++ pub fn _exit(status: c_int) -> !; ++ pub fn atexit(cb: extern "C" fn()) -> c_int; ++ pub fn system(s: *const c_char) -> c_int; ++ pub fn getenv(s: *const c_char) -> *mut c_char; ++ ++ pub fn strcpy(dst: *mut c_char, src: *const c_char) -> *mut c_char; ++ pub fn strncpy(dst: *mut c_char, src: *const c_char, n: size_t) -> *mut c_char; ++ pub fn strcat(s: *mut c_char, ct: *const c_char) -> *mut c_char; ++ pub fn strncat(s: *mut c_char, ct: *const c_char, n: size_t) -> *mut c_char; ++ pub fn strcmp(cs: *const c_char, ct: *const c_char) -> c_int; ++ pub fn strncmp(cs: *const c_char, ct: *const c_char, n: size_t) -> c_int; ++ pub fn strcoll(cs: *const c_char, ct: *const c_char) -> c_int; ++ pub fn strchr(cs: *const c_char, c: c_int) -> *mut c_char; ++ pub fn strrchr(cs: *const c_char, c: c_int) -> *mut c_char; ++ pub fn strspn(cs: *const c_char, ct: *const c_char) -> size_t; ++ pub fn strcspn(cs: *const c_char, ct: *const c_char) -> size_t; ++ pub fn strdup(cs: *const c_char) -> *mut c_char; ++ pub fn strpbrk(cs: *const c_char, ct: *const c_char) -> *mut c_char; ++ pub fn strstr(cs: *const c_char, ct: *const c_char) -> *mut c_char; ++ pub fn strlen(cs: *const c_char) -> size_t; ++ pub fn strnlen(cs: *const c_char, maxlen: size_t) -> size_t; ++ pub fn strerror(n: c_int) -> *mut c_char; ++ pub fn strtok(s: *mut c_char, t: *const c_char) -> *mut c_char; ++ pub fn strxfrm(s: *mut c_char, ct: *const c_char, n: size_t) -> size_t; ++ pub fn wcslen(buf: *const wchar_t) -> size_t; ++ pub fn wcstombs(dest: *mut c_char, src: *const wchar_t, n: size_t) -> size_t; ++ ++ pub fn memchr(cx: *const c_void, c: c_int, n: size_t) -> *mut c_void; ++ pub fn memcmp(cx: *const c_void, ct: *const c_void, n: size_t) -> c_int; ++ pub fn memcpy(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void; ++ pub fn memmove(dest: *mut c_void, src: *const c_void, n: size_t) -> *mut c_void; ++ pub fn memset(dest: *mut c_void, c: c_int, n: size_t) -> *mut c_void; ++ ++ pub fn abs(i: c_int) -> c_int; ++ pub fn labs(i: c_long) -> c_long; ++ pub fn rand() -> c_int; ++ pub fn srand(seed: c_uint); ++ ++ pub fn signal(signum: c_int, handler: sighandler_t) -> sighandler_t; ++ pub fn raise(signum: c_int) -> c_int; ++ ++ #[link_name = "_gmtime64_s"] ++ pub fn gmtime_s(destTime: *mut tm, srcTime: *const time_t) -> c_int; ++ #[link_name = "_localtime64_s"] ++ pub fn localtime_s(tmDest: *mut tm, sourceTime: *const time_t) -> crate::errno_t; ++ #[link_name = "_time64"] ++ pub fn time(destTime: *mut time_t) -> time_t; ++ #[link_name = "_chmod"] ++ pub fn chmod(path: *const c_char, mode: c_int) -> c_int; ++ #[link_name = "_wchmod"] ++ pub fn wchmod(path: *const wchar_t, mode: c_int) -> c_int; ++ #[link_name = "_mkdir"] ++ pub fn mkdir(path: *const c_char) -> c_int; ++ #[link_name = "_wrmdir"] ++ pub fn wrmdir(path: *const wchar_t) -> c_int; ++ #[link_name = "_fstat64"] ++ pub fn fstat(fildes: c_int, buf: *mut stat) -> c_int; ++ #[link_name = "_stat64"] ++ pub fn stat(path: *const c_char, buf: *mut stat) -> c_int; ++ #[link_name = "_wstat64"] ++ pub fn wstat(path: *const wchar_t, buf: *mut stat) -> c_int; ++ #[link_name = "_wutime64"] ++ pub fn wutime(file: *const wchar_t, buf: *mut utimbuf) -> c_int; ++ #[link_name = "_popen"] ++ pub fn popen(command: *const c_char, mode: *const c_char) -> *mut crate::FILE; ++ #[link_name = "_pclose"] ++ pub fn pclose(stream: *mut crate::FILE) -> c_int; ++ #[link_name = "_fdopen"] ++ pub fn fdopen(fd: c_int, mode: *const c_char) -> *mut crate::FILE; ++ #[link_name = "_fileno"] ++ pub fn fileno(stream: *mut crate::FILE) -> c_int; ++ #[link_name = "_open"] ++ pub fn open(path: *const c_char, oflag: c_int, ...) -> c_int; ++ #[link_name = "_wopen"] ++ pub fn wopen(path: *const wchar_t, oflag: c_int, ...) -> c_int; ++ #[link_name = "_creat"] ++ pub fn creat(path: *const c_char, mode: c_int) -> c_int; ++ #[link_name = "_access"] ++ pub fn access(path: *const c_char, amode: c_int) -> c_int; ++ #[link_name = "_chdir"] ++ pub fn chdir(dir: *const c_char) -> c_int; ++ #[link_name = "_close"] ++ pub fn close(fd: c_int) -> c_int; ++ #[link_name = "_dup"] ++ pub fn dup(fd: c_int) -> c_int; ++ #[link_name = "_dup2"] ++ pub fn dup2(src: c_int, dst: c_int) -> c_int; ++ #[link_name = "_execl"] ++ pub fn execl(path: *const c_char, arg0: *const c_char, ...) -> intptr_t; ++ #[link_name = "_wexecl"] ++ pub fn wexecl(path: *const wchar_t, arg0: *const wchar_t, ...) -> intptr_t; ++ #[link_name = "_execle"] ++ pub fn execle(path: *const c_char, arg0: *const c_char, ...) -> intptr_t; ++ #[link_name = "_wexecle"] ++ pub fn wexecle(path: *const wchar_t, arg0: *const wchar_t, ...) -> intptr_t; ++ #[link_name = "_execlp"] ++ pub fn execlp(path: *const c_char, arg0: *const c_char, ...) -> intptr_t; ++ #[link_name = "_wexeclp"] ++ pub fn wexeclp(path: *const wchar_t, arg0: *const wchar_t, ...) -> intptr_t; ++ #[link_name = "_execlpe"] ++ pub fn execlpe(path: *const c_char, arg0: *const c_char, ...) -> intptr_t; ++ #[link_name = "_wexeclpe"] ++ pub fn wexeclpe(path: *const wchar_t, arg0: *const wchar_t, ...) -> intptr_t; ++ #[link_name = "_execv"] ++ // DIFF(main): changed to `intptr_t` in e77f551de9 ++ pub fn execv(prog: *const c_char, argv: *const *const c_char) -> intptr_t; ++ #[link_name = "_execve"] ++ pub fn execve( ++ prog: *const c_char, ++ argv: *const *const c_char, ++ envp: *const *const c_char, ++ ) -> c_int; ++ #[link_name = "_execvp"] ++ pub fn execvp(c: *const c_char, argv: *const *const c_char) -> c_int; ++ #[link_name = "_execvpe"] ++ pub fn execvpe( ++ c: *const c_char, ++ argv: *const *const c_char, ++ envp: *const *const c_char, ++ ) -> c_int; ++ ++ #[link_name = "_wexecv"] ++ pub fn wexecv(prog: *const wchar_t, argv: *const *const wchar_t) -> intptr_t; ++ #[link_name = "_wexecve"] ++ pub fn wexecve( ++ prog: *const wchar_t, ++ argv: *const *const wchar_t, ++ envp: *const *const wchar_t, ++ ) -> intptr_t; ++ #[link_name = "_wexecvp"] ++ pub fn wexecvp(c: *const wchar_t, argv: *const *const wchar_t) -> intptr_t; ++ #[link_name = "_wexecvpe"] ++ pub fn wexecvpe( ++ c: *const wchar_t, ++ argv: *const *const wchar_t, ++ envp: *const *const wchar_t, ++ ) -> intptr_t; ++ #[link_name = "_getcwd"] ++ pub fn getcwd(buf: *mut c_char, size: c_int) -> *mut c_char; ++ #[link_name = "_getpid"] ++ pub fn getpid() -> c_int; ++ #[link_name = "_isatty"] ++ pub fn isatty(fd: c_int) -> c_int; ++ #[link_name = "_lseek"] ++ pub fn lseek(fd: c_int, offset: c_long, origin: c_int) -> c_long; ++ #[link_name = "_lseeki64"] ++ pub fn lseek64(fd: c_int, offset: c_longlong, origin: c_int) -> c_longlong; ++ #[link_name = "_pipe"] ++ pub fn pipe(fds: *mut c_int, psize: c_uint, textmode: c_int) -> c_int; ++ #[link_name = "_read"] ++ pub fn read(fd: c_int, buf: *mut c_void, count: c_uint) -> c_int; ++ #[link_name = "_rmdir"] ++ pub fn rmdir(path: *const c_char) -> c_int; ++ #[link_name = "_unlink"] ++ pub fn unlink(c: *const c_char) -> c_int; ++ #[link_name = "_write"] ++ pub fn write(fd: c_int, buf: *const c_void, count: c_uint) -> c_int; ++ #[link_name = "_commit"] ++ pub fn commit(fd: c_int) -> c_int; ++ #[link_name = "_get_osfhandle"] ++ pub fn get_osfhandle(fd: c_int) -> intptr_t; ++ #[link_name = "_open_osfhandle"] ++ pub fn open_osfhandle(osfhandle: intptr_t, flags: c_int) -> c_int; ++ pub fn setlocale(category: c_int, locale: *const c_char) -> *mut c_char; ++ #[link_name = "_wsetlocale"] ++ pub fn wsetlocale(category: c_int, locale: *const wchar_t) -> *mut wchar_t; ++ #[link_name = "_aligned_malloc"] ++ pub fn aligned_malloc(size: size_t, alignment: size_t) -> *mut c_void; ++ #[link_name = "_aligned_free"] ++ pub fn aligned_free(ptr: *mut c_void); ++ #[link_name = "_aligned_realloc"] ++ pub fn aligned_realloc(memblock: *mut c_void, size: size_t, alignment: size_t) -> *mut c_void; ++ #[link_name = "_putenv"] ++ pub fn putenv(envstring: *const c_char) -> c_int; ++ #[link_name = "_wputenv"] ++ pub fn wputenv(envstring: *const crate::wchar_t) -> c_int; ++ #[link_name = "_putenv_s"] ++ pub fn putenv_s(envstring: *const c_char, value_string: *const c_char) -> crate::errno_t; ++ #[link_name = "_wputenv_s"] ++ pub fn wputenv_s( ++ envstring: *const crate::wchar_t, ++ value_string: *const crate::wchar_t, ++ ) -> crate::errno_t; ++} ++ ++extern "system" { ++ pub fn listen(s: SOCKET, backlog: c_int) -> c_int; ++ pub fn accept(s: SOCKET, addr: *mut crate::sockaddr, addrlen: *mut c_int) -> SOCKET; ++ pub fn bind(s: SOCKET, name: *const crate::sockaddr, namelen: c_int) -> c_int; ++ pub fn connect(s: SOCKET, name: *const crate::sockaddr, namelen: c_int) -> c_int; ++ pub fn getpeername(s: SOCKET, name: *mut crate::sockaddr, nameln: *mut c_int) -> c_int; ++ pub fn getsockname(s: SOCKET, name: *mut crate::sockaddr, nameln: *mut c_int) -> c_int; ++ pub fn getsockopt( ++ s: SOCKET, ++ level: c_int, ++ optname: c_int, ++ optval: *mut c_char, ++ optlen: *mut c_int, ++ ) -> c_int; ++ pub fn recvfrom( ++ s: SOCKET, ++ buf: *mut c_char, ++ len: c_int, ++ flags: c_int, ++ from: *mut crate::sockaddr, ++ fromlen: *mut c_int, ++ ) -> c_int; ++ pub fn sendto( ++ s: SOCKET, ++ buf: *const c_char, ++ len: c_int, ++ flags: c_int, ++ to: *const crate::sockaddr, ++ tolen: c_int, ++ ) -> c_int; ++ pub fn setsockopt( ++ s: SOCKET, ++ level: c_int, ++ optname: c_int, ++ optval: *const c_char, ++ optlen: c_int, ++ ) -> c_int; ++ pub fn socket(af: c_int, socket_type: c_int, protocol: c_int) -> SOCKET; ++} ++ ++cfg_if! { ++ if #[cfg(all(target_env = "gnu"))] { ++ mod gnu; ++ pub use self::gnu::*; ++ } else if #[cfg(all(target_env = "msvc"))] { ++ mod msvc; ++ pub use self::msvc::*; ++ } else { ++ // Unknown target_env ++ } ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/windows/msvc/mod.rs mesa-25.3.3/subprojects/libc-0.2.169/src/windows/msvc/mod.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/windows/msvc/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/windows/msvc/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,17 @@ ++use crate::prelude::*; ++ ++pub const L_tmpnam: c_uint = 260; ++pub const TMP_MAX: c_uint = 0x7fff_ffff; ++ ++// POSIX Supplement (from errno.h) ++// This particular error code is only currently available in msvc toolchain ++pub const EOTHER: c_int = 131; ++ ++extern "C" { ++ #[link_name = "_stricmp"] ++ pub fn stricmp(s1: *const c_char, s2: *const c_char) -> c_int; ++ #[link_name = "_strnicmp"] ++ pub fn strnicmp(s1: *const c_char, s2: *const c_char, n: size_t) -> c_int; ++ #[link_name = "_memccpy"] ++ pub fn memccpy(dest: *mut c_void, src: *const c_void, c: c_int, count: size_t) -> *mut c_void; ++} +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/src/xous.rs mesa-25.3.3/subprojects/libc-0.2.169/src/xous.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/src/xous.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/src/xous.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,29 @@ ++//! Xous C type definitions ++ ++pub type c_schar = i8; ++pub type c_uchar = u8; ++pub type c_short = i16; ++pub type c_ushort = u16; ++pub type c_int = i32; ++pub type c_uint = u32; ++pub type c_float = f32; ++pub type c_double = f64; ++pub type c_longlong = i64; ++pub type c_ulonglong = u64; ++pub type intmax_t = i64; ++pub type uintmax_t = u64; ++ ++pub type size_t = usize; ++pub type ptrdiff_t = isize; ++pub type intptr_t = isize; ++pub type uintptr_t = usize; ++pub type ssize_t = isize; ++ ++pub type off_t = i64; ++pub type c_char = u8; ++pub type c_long = i64; ++pub type c_ulong = u64; ++pub type wchar_t = u32; ++ ++pub const INT_MIN: c_int = -2147483648; ++pub const INT_MAX: c_int = 2147483647; +diff -Nru mesa-25.3.3/subprojects/libc-0.2.169/tests/const_fn.rs mesa-25.3.3/subprojects/libc-0.2.169/tests/const_fn.rs +--- mesa-25.3.3/subprojects/libc-0.2.169/tests/const_fn.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2.169/tests/const_fn.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,3 @@ ++#[cfg(target_os = "linux")] ++const _FOO: libc::c_uint = unsafe { libc::CMSG_SPACE(1) }; ++//^ if CMSG_SPACE is not const, this will fail to compile +diff -Nru mesa-25.3.3/subprojects/libc-0.2-rs.wrap mesa-25.3.3/subprojects/libc-0.2-rs.wrap +--- mesa-25.3.3/subprojects/libc-0.2-rs.wrap 2026-01-01 13:34:04.000000000 -0500 ++++ mesa-25.3.3/subprojects/libc-0.2-rs.wrap 2026-05-29 13:40:53.000000000 -0500 +@@ -1,6 +1,4 @@ + [wrap-file] +-directory = libc-0.2.168 +-source_url = https://crates.io/api/v1/crates/libc/0.2.168/download +-source_filename = libc-0.2.168.tar.gz +-source_hash = 5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d ++directory = libc-0.2.169 + patch_directory = libc-0.2-rs ++ +diff -Nru mesa-25.3.3/subprojects/log-0.4.26/benches/value.rs mesa-25.3.3/subprojects/log-0.4.26/benches/value.rs +--- mesa-25.3.3/subprojects/log-0.4.26/benches/value.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/log-0.4.26/benches/value.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,27 @@ ++#![cfg(feature = "kv")] ++#![feature(test)] ++ ++use log::kv::Value; ++ ++#[bench] ++fn u8_to_value(b: &mut test::Bencher) { ++ b.iter(|| Value::from(1u8)); ++} ++ ++#[bench] ++fn u8_to_value_debug(b: &mut test::Bencher) { ++ b.iter(|| Value::from_debug(&1u8)); ++} ++ ++#[bench] ++fn str_to_value_debug(b: &mut test::Bencher) { ++ b.iter(|| Value::from_debug(&"a string")); ++} ++ ++#[bench] ++fn custom_to_value_debug(b: &mut test::Bencher) { ++ #[derive(Debug)] ++ struct A; ++ ++ b.iter(|| Value::from_debug(&A)); ++} +diff -Nru mesa-25.3.3/subprojects/log-0.4.26/.cargo-checksum.json mesa-25.3.3/subprojects/log-0.4.26/.cargo-checksum.json +--- mesa-25.3.3/subprojects/log-0.4.26/.cargo-checksum.json 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/log-0.4.26/.cargo-checksum.json 2025-03-09 16:38:42.000000000 -0500 +@@ -0,0 +1 @@ ++{"package":"Could not get crate checksum","files":{}} +diff -Nru mesa-25.3.3/subprojects/log-0.4.26/Cargo.toml mesa-25.3.3/subprojects/log-0.4.26/Cargo.toml +--- mesa-25.3.3/subprojects/log-0.4.26/Cargo.toml 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/log-0.4.26/Cargo.toml 2025-03-09 16:38:42.000000000 -0500 +@@ -0,0 +1,143 @@ ++# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO ++# ++# When uploading crates to the registry Cargo will automatically ++# "normalize" Cargo.toml files for maximal compatibility ++# with all versions of Cargo and also rewrite `path` dependencies ++# to registry (e.g., crates.io) dependencies. ++# ++# If you are reading this file be aware that the original Cargo.toml ++# will likely look very different (and much more reasonable). ++# See Cargo.toml.orig for the original contents. ++ ++[package] ++edition = "2021" ++rust-version = "1.60.0" ++name = "log" ++version = "0.4.26" ++authors = ["The Rust Project Developers"] ++build = false ++exclude = ["rfcs/**/*"] ++autolib = false ++autobins = false ++autoexamples = false ++autotests = false ++autobenches = false ++description = """ ++A lightweight logging facade for Rust ++""" ++documentation = "https://docs.rs/log" ++readme = "README.md" ++keywords = ["logging"] ++categories = ["development-tools::debugging"] ++license = "MIT OR Apache-2.0" ++repository = "https://github.com/rust-lang/log" ++ ++[package.metadata.docs.rs] ++features = [ ++ "std", ++ "serde", ++ "kv_std", ++ "kv_sval", ++ "kv_serde", ++] ++ ++[features] ++kv = [] ++kv_serde = [ ++ "kv_std", ++ "value-bag/serde", ++ "serde", ++] ++kv_std = [ ++ "std", ++ "kv", ++ "value-bag/error", ++] ++kv_sval = [ ++ "kv", ++ "value-bag/sval", ++ "sval", ++ "sval_ref", ++] ++kv_unstable = [ ++ "kv", ++ "value-bag", ++] ++kv_unstable_serde = [ ++ "kv_serde", ++ "kv_unstable_std", ++] ++kv_unstable_std = [ ++ "kv_std", ++ "kv_unstable", ++] ++kv_unstable_sval = [ ++ "kv_sval", ++ "kv_unstable", ++] ++max_level_debug = [] ++max_level_error = [] ++max_level_info = [] ++max_level_off = [] ++max_level_trace = [] ++max_level_warn = [] ++release_max_level_debug = [] ++release_max_level_error = [] ++release_max_level_info = [] ++release_max_level_off = [] ++release_max_level_trace = [] ++release_max_level_warn = [] ++std = [] ++ ++[lib] ++name = "log" ++path = "src/lib.rs" ++ ++[[disabled.bench]] ++name = "value" ++path = "benches/value.rs" ++ ++[dependencies.serde] ++version = "1.0" ++optional = true ++default-features = false ++ ++[dependencies.sval] ++version = "2.1" ++optional = true ++default-features = false ++ ++[dependencies.sval_ref] ++version = "2.1" ++optional = true ++default-features = false ++ ++[dependencies.value-bag] ++version = "1.7" ++features = ["inline-i128"] ++optional = true ++default-features = false ++ ++[dev-dependencies.proc-macro2] ++version = "1.0.63" ++default-features = false ++ ++[dev-dependencies.serde] ++version = "1.0" ++features = ["derive"] ++ ++[dev-dependencies.serde_json] ++version = "1.0" ++ ++[dev-dependencies.serde_test] ++version = "1.0" ++ ++[dev-dependencies.sval] ++version = "2.1" ++ ++[dev-dependencies.sval_derive] ++version = "2.1" ++ ++[dev-dependencies.value-bag] ++version = "1.7" ++features = ["test"] +diff -Nru mesa-25.3.3/subprojects/log-0.4.26/.cargo_vcs_info.json mesa-25.3.3/subprojects/log-0.4.26/.cargo_vcs_info.json +--- mesa-25.3.3/subprojects/log-0.4.26/.cargo_vcs_info.json 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/log-0.4.26/.cargo_vcs_info.json 2025-03-09 16:38:42.000000000 -0500 +@@ -0,0 +1,6 @@ ++{ ++ "git": { ++ "sha1": "5a915548178b06f16049e3a4d0de79251bdf9603" ++ }, ++ "path_in_vcs": "" ++} +\ No hay ningún carácter de nueva línea al final del archivo +diff -Nru mesa-25.3.3/subprojects/log-0.4.26/CHANGELOG.md mesa-25.3.3/subprojects/log-0.4.26/CHANGELOG.md +--- mesa-25.3.3/subprojects/log-0.4.26/CHANGELOG.md 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/log-0.4.26/CHANGELOG.md 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,378 @@ ++# Change Log ++ ++## [Unreleased] ++ ++## [0.4.26] - 2025-02-18 ++ ++## What's Changed ++* Derive `Clone` for `kv::Value` by @SpriteOvO in https://github.com/rust-lang/log/pull/668 ++* Add `spdlog-rs` link to crate doc by @SpriteOvO in https://github.com/rust-lang/log/pull/669 ++ ++ ++**Full Changelog**: https://github.com/rust-lang/log/compare/0.4.25...0.4.26 ++ ++## [0.4.25] - 2025-01-14 ++ ++## What's Changed ++* Revert loosening of kv cargo features by @KodrAus in https://github.com/rust-lang/log/pull/662 ++ ++ ++**Full Changelog**: https://github.com/rust-lang/log/compare/0.4.24...0.4.25 ++ ++## [0.4.24] - 2025-01-11 ++ ++## What's Changed ++* Fix up kv feature activation by @KodrAus in https://github.com/rust-lang/log/pull/659 ++ ++ ++**Full Changelog**: https://github.com/rust-lang/log/compare/0.4.23...0.4.24 ++ ++## [0.4.23] - 2025-01-10 (yanked) ++ ++## What's Changed ++* Fix some typos by @Kleinmarb in https://github.com/rust-lang/log/pull/637 ++* Add logforth to implementation by @tisonkun in https://github.com/rust-lang/log/pull/638 ++* Add `spdlog-rs` link to README by @SpriteOvO in https://github.com/rust-lang/log/pull/639 ++* Add correct lifetime to kv::Value::to_borrowed_str by @stevenroose in https://github.com/rust-lang/log/pull/643 ++* docs: Add logforth as an impl by @tisonkun in https://github.com/rust-lang/log/pull/642 ++* Add clang_log implementation by @DDAN-17 in https://github.com/rust-lang/log/pull/646 ++* Bind lifetimes of &str returned from Key by the lifetime of 'k rather than the lifetime of the Key struct by @gbbosak in https://github.com/rust-lang/log/pull/648 ++* Fix up key lifetimes and add method to try get a borrowed key by @KodrAus in https://github.com/rust-lang/log/pull/653 ++* Add Ftail implementation by @tjardoo in https://github.com/rust-lang/log/pull/652 ++ ++## New Contributors ++* @Kleinmarb made their first contribution in https://github.com/rust-lang/log/pull/637 ++* @tisonkun made their first contribution in https://github.com/rust-lang/log/pull/638 ++* @SpriteOvO made their first contribution in https://github.com/rust-lang/log/pull/639 ++* @stevenroose made their first contribution in https://github.com/rust-lang/log/pull/643 ++* @DDAN-17 made their first contribution in https://github.com/rust-lang/log/pull/646 ++* @gbbosak made their first contribution in https://github.com/rust-lang/log/pull/648 ++* @tjardoo made their first contribution in https://github.com/rust-lang/log/pull/652 ++ ++**Full Changelog**: https://github.com/rust-lang/log/compare/0.4.22...0.4.23 ++ ++## [0.4.22] - 2024-06-27 ++ ++## What's Changed ++* Add some clarifications to the library docs by @KodrAus in https://github.com/rust-lang/log/pull/620 ++* Add links to `colog` crate by @chrivers in https://github.com/rust-lang/log/pull/621 ++* adding line_number test + updating some testing infrastructure by @DIvkov575 in https://github.com/rust-lang/log/pull/619 ++* Clarify the actual set of functions that can race in _racy variants by @KodrAus in https://github.com/rust-lang/log/pull/623 ++* Replace deprecated std::sync::atomic::spin_loop_hint() by @Catamantaloedis in https://github.com/rust-lang/log/pull/625 ++* Check usage of max_level features by @Thomasdezeeuw in https://github.com/rust-lang/log/pull/627 ++* Remove unneeded import by @Thomasdezeeuw in https://github.com/rust-lang/log/pull/628 ++* Loosen orderings for logger initialization in https://github.com/rust-lang/log/pull/632. Originally by @pwoolcoc in https://github.com/rust-lang/log/pull/599 ++* Use Location::caller() for file and line info in https://github.com/rust-lang/log/pull/633. Originally by @Cassy343 in https://github.com/rust-lang/log/pull/520 ++ ++## New Contributors ++* @chrivers made their first contribution in https://github.com/rust-lang/log/pull/621 ++* @DIvkov575 made their first contribution in https://github.com/rust-lang/log/pull/619 ++* @Catamantaloedis made their first contribution in https://github.com/rust-lang/log/pull/625 ++ ++**Full Changelog**: https://github.com/rust-lang/log/compare/0.4.21...0.4.22 ++ ++## [0.4.21] - 2024-02-27 ++ ++## What's Changed ++* Minor clippy nits by @nyurik in https://github.com/rust-lang/log/pull/578 ++* Simplify Display impl by @nyurik in https://github.com/rust-lang/log/pull/579 ++* Set all crates to 2021 edition by @nyurik in https://github.com/rust-lang/log/pull/580 ++* Various changes based on review by @Thomasdezeeuw in https://github.com/rust-lang/log/pull/583 ++* Fix typo in file_static() method doc by @dimo414 in https://github.com/rust-lang/log/pull/590 ++* Specialize empty key value pairs by @EFanZh in https://github.com/rust-lang/log/pull/576 ++* Fix incorrect lifetime in Value::to_str() by @peterjoel in https://github.com/rust-lang/log/pull/587 ++* Remove some API of the key-value feature by @Thomasdezeeuw in https://github.com/rust-lang/log/pull/585 ++* Add logcontrol-log and log-reload by @swsnr in https://github.com/rust-lang/log/pull/595 ++* Add Serialization section to kv::Value docs by @Thomasdezeeuw in https://github.com/rust-lang/log/pull/593 ++* Rename Value::to_str to to_cow_str by @Thomasdezeeuw in https://github.com/rust-lang/log/pull/592 ++* Clarify documentation and simplify initialization of `STATIC_MAX_LEVEL` by @ptosi in https://github.com/rust-lang/log/pull/594 ++* Update docs to 2021 edition, test by @nyurik in https://github.com/rust-lang/log/pull/577 ++* Add "alterable_logger" link to README.md by @brummer-simon in https://github.com/rust-lang/log/pull/589 ++* Normalize line ending by @EFanZh in https://github.com/rust-lang/log/pull/602 ++* Remove `ok_or` in favor of `Option::ok_or` by @AngelicosPhosphoros in https://github.com/rust-lang/log/pull/607 ++* Use `Acquire` ordering for initialization check by @AngelicosPhosphoros in https://github.com/rust-lang/log/pull/610 ++* Get structured logging API ready for stabilization by @KodrAus in https://github.com/rust-lang/log/pull/613 ++ ++## New Contributors ++* @nyurik made their first contribution in https://github.com/rust-lang/log/pull/578 ++* @dimo414 made their first contribution in https://github.com/rust-lang/log/pull/590 ++* @peterjoel made their first contribution in https://github.com/rust-lang/log/pull/587 ++* @ptosi made their first contribution in https://github.com/rust-lang/log/pull/594 ++* @brummer-simon made their first contribution in https://github.com/rust-lang/log/pull/589 ++* @AngelicosPhosphoros made their first contribution in https://github.com/rust-lang/log/pull/607 ++ ++## [0.4.20] - 2023-07-11 ++ ++* Remove rustversion dev-dependency by @Thomasdezeeuw in https://github.com/rust-lang/log/pull/568 ++* Remove `local_inner_macros` usage by @EFanZh in https://github.com/rust-lang/log/pull/570 ++ ++## [0.4.19] - 2023-06-10 ++ ++* Use target_has_atomic instead of the old atomic_cas cfg by @GuillaumeGomez in https://github.com/rust-lang/log/pull/555 ++* Put MSRV into Cargo.toml by @est31 in https://github.com/rust-lang/log/pull/557 ++ ++## [0.4.18] - 2023-05-28 ++ ++* fix Markdown links (again) by @hellow554 in https://github.com/rust-lang/log/pull/513 ++* add cargo doc to workflow by @hellow554 in https://github.com/rust-lang/log/pull/515 ++* Apply Clippy lints by @hellow554 in https://github.com/rust-lang/log/pull/516 ++* Replace ad-hoc eq_ignore_ascii_case with slice::eq_ignore_ascii_case by @glandium in https://github.com/rust-lang/log/pull/519 ++* fix up windows targets by @KodrAus in https://github.com/rust-lang/log/pull/528 ++* typo fix by @jiangying000 in https://github.com/rust-lang/log/pull/529 ++* Remove dependency on cfg_if by @EriKWDev in https://github.com/rust-lang/log/pull/536 ++* GitHub Workflows security hardening by @sashashura in https://github.com/rust-lang/log/pull/538 ++* Fix build status badge by @atouchet in https://github.com/rust-lang/log/pull/539 ++* Add call_logger to the documentation by @a1ecbr0wn in https://github.com/rust-lang/log/pull/547 ++* Use stable internals for key-value API by @KodrAus in https://github.com/rust-lang/log/pull/550 ++* Change wording of list of implementations by @Thomasdezeeuw in https://github.com/rust-lang/log/pull/553 ++* Add std-logger to list of implementations by @Thomasdezeeuw in https://github.com/rust-lang/log/pull/554 ++* Add `set_max_level_racy` and gate `set_max_level` by @djkoloski in https://github.com/rust-lang/log/pull/544 ++* [doc] src/lib.rs : prefix an unused variable with an underscore by @OccupyMars2025 in https://github.com/rust-lang/log/pull/561 ++* [doc] src/macros.rs : correct grammar errors of an example in lib documentation by @OccupyMars2025 in https://github.com/rust-lang/log/pull/562 ++ ++## [0.4.17] - 2022-04-29 ++ ++* Update `kv_unstable` internal dependencies. ++ ++## [0.4.16] - 2022-03-22 ++ ++* Fix a conflict with unqualified `Option` use in macros. ++ ++## [0.4.15] - 2022-02-23 ++ ++* Silence a warning about the deprecated `spin_loop_hint`. ++* Relax ordering in the atomic `set_max_level` call. ++* Add thumbv4t-none-eabi to targets that don't support atomics ++* Allow levels to be iterated over. ++* Implement `Log` on some common wrapper types. ++* Improvements to test coverage. ++* Improvements to documentation. ++* Add key-value support to the `log!` macros. ++* Tighten `kv_unstable` internal dependencies, so they don't bump past their current alpha. ++* Add a simple visit API to `kv_unstable`. ++* Support `NonZero*` integers as values in structured logging ++* Support static strings as keys in structured logging ++ ++## [0.4.14] - 2021-01-27 ++ ++* Remove the `__private_api_log_lit` special case. ++* Fixed incorrect combination of `kv_unstable` and `std` features causing compile failures. ++* Remove unstable `Value::to_*` conversions that were incorrectly using `as`. ++* Rename unstable `Value::to_error` to `Value::to_borrowed_error`. ++ ++## [0.4.13] - 2021-01-11 ++ ++* This is the same as `0.4.11`, except with a `kv_unstable_std` feature added to aid migrating current dependents to `0.4.14` (which was originally going to be `0.4.13` until it was decided to create a patch from `0.4.11` to minimize disruption). ++ ++## [0.4.12] - 2020-12-24 ++ ++### New ++ ++* Support platforms without atomics by racing instead of failing to compile ++* Implement `Log` for `Box` ++* Update `cfg-if` to `1.0` ++* Internal reworks of the structured logging API. Removed the `Fill` API ++and added `source::as_map` and `source::as_list` to easily serialize a `Source` ++as either a map of `{key: value, ..}` or as a list of `[(key, value), ..]`. ++ ++### Fixed ++ ++* Fixed deserialization of `LevelFilter` to use their `u64` index variants ++ ++## [0.4.11] - 2020-07-09 ++ ++### New ++ ++* Support coercing structured values into concrete types. ++* Reference the `win_dbg_logger` in the readme. ++ ++### Fixed ++ ++* Updates a few deprecated items used internally. ++* Fixed issues in docs and expands sections. ++* Show the correct build badge in the readme. ++* Fix up a possible inference breakage with structured value errors. ++* Respect formatting flags in structured value formatting. ++ ++## [0.4.10] - 2019-12-16 (yanked) ++ ++### Fixed ++ ++* Fixed the `log!` macros, so they work in expression context (this regressed in `0.4.9`, which has been yanked). ++ ++## [0.4.9] - 2019-12-12 (yanked) ++ ++### Minimum Supported Rust Version ++ ++This release bumps the minimum compiler version to `1.31.0`. This was mainly needed for `cfg-if`, ++but between `1.16.0` and `1.31.0` there are a lot of language and library improvements we now ++take advantage of. ++ ++### New ++ ++* Unstable support for capturing key-value pairs in a record using the `log!` macros ++ ++### Improved ++ ++* Better documentation for max level filters. ++* Internal updates to line up with bumped MSRV ++ ++## [0.4.8] - 2019-07-28 ++ ++### New ++ ++* Support attempting to get `Record` fields as static strings. ++ ++## [0.4.7] - 2019-07-06 ++ ++### New ++ ++* Support for embedded environments with thread-unsafe initialization. ++* Initial unstable support for capturing structured data under the `kv_unstable` ++feature gate. This new API doesn't affect existing users and may change in future ++patches (so those changes may not appear in the changelog until it stabilizes). ++ ++### Improved ++ ++* Docs for using `log` with the 2018 edition. ++* Error messages for macros missing arguments. ++ ++## [0.4.6] - 2018-10-27 ++ ++### Improved ++ ++* Support 2018-style macro import for the `log_enabled!` macro. ++ ++## [0.4.5] - 2018-09-03 ++ ++### Improved ++ ++* Make `log`'s internal helper macros less likely to conflict with user-defined ++ macros. ++ ++## [0.4.4] - 2018-08-17 ++ ++### Improved ++ ++* Support 2018-style imports of the log macros. ++ ++## [0.4.3] - 2018-06-29 ++ ++### Improved ++ ++* More code generation improvements. ++ ++## [0.4.2] - 2018-06-05 ++ ++### Improved ++ ++* Log invocations now generate less code. ++ ++### Fixed ++ ++* Example Logger implementations now properly set the max log level. ++ ++## [0.4.1] - 2017-12-30 ++ ++### Fixed ++ ++* Some doc links were fixed. ++ ++## [0.4.0] - 2017-12-24 ++ ++The changes in this release include cleanup of some obscure functionality and a more robust public ++API designed to support bridges to other logging systems, and provide more flexibility to new ++features in the future. ++ ++### Compatibility ++ ++Vast portions of the Rust ecosystem use the 0.3.x release series of log, and we don't want to force ++the community to go through the pain of upgrading every crate to 0.4.x at the exact same time. Along ++with 0.4.0, we've published a new 0.3.9 release which acts as a "shim" over 0.4.0. This will allow ++crates using either version to coexist without losing messages from one side or the other. ++ ++There is one caveat - a log message generated by a crate using 0.4.x but consumed by a logging ++implementation using 0.3.x will not have a file name or module path. Applications affected by this ++can upgrade their logging implementations to one using 0.4.x to avoid losing this information. The ++other direction does not lose any information, fortunately! ++ ++**TL;DR** Libraries should feel comfortable upgrading to 0.4.0 without treating that as a breaking ++change. Applications may need to update their logging implementation (e.g. env-logger) to a newer ++version using log 0.4.x to avoid losing module and file information. ++ ++### New ++ ++* The crate is now `no_std` by default. ++* `Level` and `LevelFilter` now implement `Serialize` and `Deserialize` when the `serde` feature is ++ enabled. ++* The `Record` and `Metadata` types can now be constructed by third-party code via a builder API. ++* The `logger` free function returns a reference to the logger implementation. This, along with the ++ ability to construct `Record`s, makes it possible to bridge from another logging framework to ++ this one without digging into the private internals of the crate. The standard `error!` `warn!`, ++ etc., macros now exclusively use the public API of the crate rather than "secret" internal APIs. ++* `Log::flush` has been added to allow crates to tell the logging implementation to ensure that all ++ "in flight" log events have been persisted. This can be used, for example, just before an ++ application exits to ensure that asynchronous log sinks finish their work. ++ ++### Removed ++ ++* The `shutdown` and `shutdown_raw` functions have been removed. Supporting shutdown significantly ++ complicated the implementation and imposed a performance cost on each logging operation. ++* The `log_panics` function and its associated `nightly` Cargo feature have been removed. Use the ++ [log-panics](https://crates.io/crates/log-panics) instead. ++ ++### Changed ++ ++* The `Log` prefix has been removed from type names. For example, `LogLevelFilter` is now ++ `LevelFilter`, and `LogRecord` is now `Record`. ++* The `MaxLogLevelFilter` object has been removed in favor of a `set_max_level` free function. ++* The `set_logger` free functions have been restructured. The logger is now directly passed to the ++ functions rather than a closure which returns the logger. `set_logger` now takes a `&'static ++ Log` and is usable in `no_std` contexts in place of the old `set_logger_raw`. `set_boxed_logger` ++ is a convenience function which takes a `Box` but otherwise acts like `set_logger`. It ++ requires the `std` feature. ++* The `file` and `module_path` values in `Record` no longer have the `'static` lifetime to support ++ integration with other logging frameworks that don't provide a `'static` lifetime for the ++ equivalent values. ++* The `file`, `line`, and `module_path` values in `Record` are now `Option`s to support integration ++ with other logging frameworks that don't provide those values. ++ ++### In the Future ++ ++* We're looking to add support for *structured* logging - the inclusion of extra key-value pairs of ++ information in a log event in addition to the normal string message. This should be able to be ++ added in a backwards compatible manner to the 0.4.x series when the design is worked out. ++ ++## Older ++ ++Look at the [release tags] for information about older releases. ++ ++[Unreleased]: https://github.com/rust-lang-nursery/log/compare/0.4.26...HEAD ++[0.4.26]: https://github.com/rust-lang/log/compare/0.4.25...0.4.26 ++[0.4.25]: https://github.com/rust-lang/log/compare/0.4.24...0.4.25 ++[0.4.24]: https://github.com/rust-lang/log/compare/0.4.23...0.4.24 ++[0.4.23]: https://github.com/rust-lang/log/compare/0.4.22...0.4.23 ++[0.4.22]: https://github.com/rust-lang/log/compare/0.4.21...0.4.22 ++[0.4.21]: https://github.com/rust-lang/log/compare/0.4.20...0.4.21 ++[0.4.20]: https://github.com/rust-lang-nursery/log/compare/0.4.19...0.4.20 ++[0.4.19]: https://github.com/rust-lang-nursery/log/compare/0.4.18...0.4.19 ++[0.4.18]: https://github.com/rust-lang-nursery/log/compare/0.4.17...0.4.18 ++[0.4.17]: https://github.com/rust-lang-nursery/log/compare/0.4.16...0.4.17 ++[0.4.16]: https://github.com/rust-lang-nursery/log/compare/0.4.15...0.4.16 ++[0.4.15]: https://github.com/rust-lang-nursery/log/compare/0.4.13...0.4.15 ++[0.4.14]: https://github.com/rust-lang-nursery/log/compare/0.4.13...0.4.14 ++[0.4.13]: https://github.com/rust-lang-nursery/log/compare/0.4.11...0.4.13 ++[0.4.12]: https://github.com/rust-lang-nursery/log/compare/0.4.11...0.4.12 ++[0.4.11]: https://github.com/rust-lang-nursery/log/compare/0.4.10...0.4.11 ++[0.4.10]: https://github.com/rust-lang-nursery/log/compare/0.4.9...0.4.10 ++[0.4.9]: https://github.com/rust-lang-nursery/log/compare/0.4.8...0.4.9 ++[0.4.8]: https://github.com/rust-lang-nursery/log/compare/0.4.7...0.4.8 ++[0.4.7]: https://github.com/rust-lang-nursery/log/compare/0.4.6...0.4.7 ++[0.4.6]: https://github.com/rust-lang-nursery/log/compare/0.4.5...0.4.6 ++[0.4.5]: https://github.com/rust-lang-nursery/log/compare/0.4.4...0.4.5 ++[0.4.4]: https://github.com/rust-lang-nursery/log/compare/0.4.3...0.4.4 ++[0.4.3]: https://github.com/rust-lang-nursery/log/compare/0.4.2...0.4.3 ++[0.4.2]: https://github.com/rust-lang-nursery/log/compare/0.4.1...0.4.2 ++[0.4.1]: https://github.com/rust-lang-nursery/log/compare/0.4.0...0.4.1 ++[0.4.0]: https://github.com/rust-lang-nursery/log/compare/0.3.8...0.4.0 ++[release tags]: https://github.com/rust-lang-nursery/log/releases +diff -Nru mesa-25.3.3/subprojects/log-0.4.26/debian/patches/no-benches.patch mesa-25.3.3/subprojects/log-0.4.26/debian/patches/no-benches.patch +--- mesa-25.3.3/subprojects/log-0.4.26/debian/patches/no-benches.patch 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/log-0.4.26/debian/patches/no-benches.patch 2025-03-09 16:38:42.000000000 -0500 +@@ -0,0 +1,9 @@ ++Forwarded: not-needed ++Last-Update: 2025-03-09 ++--- a/Cargo.toml +++++ b/Cargo.toml ++@@ -95,3 +95,3 @@ ++ ++-[[bench]] +++[[disabled.bench]] ++ name = "value" +diff -Nru mesa-25.3.3/subprojects/log-0.4.26/debian/patches/series mesa-25.3.3/subprojects/log-0.4.26/debian/patches/series +--- mesa-25.3.3/subprojects/log-0.4.26/debian/patches/series 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/log-0.4.26/debian/patches/series 2025-03-09 16:38:42.000000000 -0500 +@@ -0,0 +1 @@ ++no-benches.patch +diff -Nru mesa-25.3.3/subprojects/log-0.4.26/.github/workflows/main.yml mesa-25.3.3/subprojects/log-0.4.26/.github/workflows/main.yml +--- mesa-25.3.3/subprojects/log-0.4.26/.github/workflows/main.yml 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/log-0.4.26/.github/workflows/main.yml 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,146 @@ ++name: CI ++on: [push, pull_request] ++ ++permissions: ++ contents: read # to fetch code (actions/checkout) ++ ++jobs: ++ test: ++ name: Test ++ runs-on: ${{ matrix.os }} ++ strategy: ++ matrix: ++ build: [stable, beta, nightly, macos, win32, win64, mingw] ++ include: ++ - build: stable ++ os: ubuntu-latest ++ rust: stable ++ - build: beta ++ os: ubuntu-latest ++ rust: beta ++ - build: nightly ++ os: ubuntu-latest ++ rust: nightly ++ - build: macos ++ os: macos-latest ++ rust: stable ++ - build: win32 ++ os: windows-latest ++ rust: stable-i686-pc-windows-msvc ++ - build: win64 ++ os: windows-latest ++ rust: stable-x86_64-pc-windows-msvc ++ - build: mingw ++ os: windows-latest ++ rust: stable-x86_64-pc-windows-gnu ++ steps: ++ - uses: actions/checkout@master ++ - name: Install Rust ++ run: | ++ rustup update ${{ matrix.rust }} --no-self-update ++ rustup default ${{ matrix.rust }} ++ cargo install cargo-hack ++ - run: cargo hack test --feature-powerset --lib --exclude-features max_level_off,max_level_error,max_level_warn,max_level_info,max_level_debug,max_level_trace,release_max_level_off,release_max_level_error,release_max_level_warn,release_max_level_info,release_max_level_debug,release_max_level_trace ++ - run: cargo run --verbose --manifest-path test_max_level_features/Cargo.toml ++ - run: cargo run --verbose --manifest-path test_max_level_features/Cargo.toml --release ++ ++ rustfmt: ++ name: Rustfmt ++ runs-on: ubuntu-latest ++ steps: ++ - uses: actions/checkout@master ++ - name: Install Rust ++ run: | ++ rustup update stable --no-self-update ++ rustup default stable ++ rustup component add rustfmt ++ # log repo does not use Cargo workspaces, so `cargo fmt` will not check all the code ++ # perhaps this should be changed in the future ++ - run: cargo fmt -- --check ++ - run: cargo fmt --manifest-path test_max_level_features/Cargo.toml -- --check ++ - run: cargo fmt --manifest-path tests/Cargo.toml -- --check ++ ++ clippy: ++ name: Clippy ++ runs-on: ubuntu-latest ++ steps: ++ - uses: actions/checkout@master ++ - name: Install Rust ++ run: | ++ rustup update stable --no-self-update ++ rustup default stable ++ rustup component add clippy ++ - run: cargo clippy --verbose ++ - run: cargo clippy --verbose --manifest-path test_max_level_features/Cargo.toml ++ - run: cargo clippy --verbose --manifest-path tests/Cargo.toml ++ ++ doc: ++ name: Check Documentation ++ runs-on: ubuntu-latest ++ steps: ++ - uses: actions/checkout@master ++ - name: Install Rust ++ run: | ++ rustup update stable --no-self-update ++ rustup default stable ++ rustup component add rust-docs ++ - name: Run rustdoc ++ run: RUSTDOCFLAGS="-D warnings" cargo doc --verbose --features std,serde,sval,sval_ref,value-bag,kv,kv_std,kv_sval,kv_serde ++ ++ features: ++ name: Feature check ++ runs-on: ubuntu-latest ++ steps: ++ - uses: actions/checkout@master ++ - name: Install Rust ++ run: | ++ rustup update nightly --no-self-update ++ rustup default nightly ++ - run: cargo build --verbose -Z avoid-dev-deps --features kv ++ - run: cargo build --verbose -Z avoid-dev-deps --features "kv std" ++ - run: cargo build --verbose -Z avoid-dev-deps --features "kv kv_sval" ++ - run: cargo build --verbose -Z avoid-dev-deps --features "kv kv_serde" ++ - run: cargo build --verbose -Z avoid-dev-deps --features "kv kv_std" ++ - run: cargo build --verbose -Z avoid-dev-deps --features "kv kv_sval kv_serde" ++ ++ minimalv: ++ name: Minimal versions ++ runs-on: ubuntu-latest ++ steps: ++ - uses: actions/checkout@master ++ - name: Install Rust ++ run: | ++ rustup update nightly --no-self-update ++ rustup default nightly ++ - run: cargo build --verbose -Z minimal-versions --features kv ++ - run: cargo build --verbose -Z minimal-versions --features "kv std" ++ - run: cargo build --verbose -Z minimal-versions --features "kv kv_sval" ++ - run: cargo build --verbose -Z minimal-versions --features "kv kv_serde" ++ - run: cargo build --verbose -Z minimal-versions --features "kv kv_std" ++ - run: cargo build --verbose -Z minimal-versions --features "kv kv_sval kv_serde" ++ ++ msrv: ++ name: MSRV ++ runs-on: ubuntu-latest ++ steps: ++ - uses: actions/checkout@master ++ - name: Install Rust ++ run: | ++ rustup update 1.60.0 --no-self-update ++ rustup default 1.60.0 ++ - run: | ++ cargo test --verbose --manifest-path tests/Cargo.toml ++ cargo test --verbose --manifest-path tests/Cargo.toml --features kv ++ ++ embedded: ++ name: Embedded ++ runs-on: ubuntu-latest ++ steps: ++ - uses: actions/checkout@master ++ - name: Install Rust ++ run: | ++ rustup update stable --no-self-update ++ rustup default stable ++ - run: rustup target add thumbv6m-none-eabi riscv32imc-unknown-none-elf ++ - run: cargo build --verbose --target=thumbv6m-none-eabi ++ - run: cargo build --verbose --target=riscv32imc-unknown-none-elf +diff -Nru mesa-25.3.3/subprojects/log-0.4.26/.gitignore mesa-25.3.3/subprojects/log-0.4.26/.gitignore +--- mesa-25.3.3/subprojects/log-0.4.26/.gitignore 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/log-0.4.26/.gitignore 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,3 @@ ++target/ ++Cargo.lock ++.idea/ +diff -Nru mesa-25.3.3/subprojects/log-0.4.26/LICENSE-APACHE mesa-25.3.3/subprojects/log-0.4.26/LICENSE-APACHE +--- mesa-25.3.3/subprojects/log-0.4.26/LICENSE-APACHE 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/log-0.4.26/LICENSE-APACHE 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,201 @@ ++ Apache License ++ Version 2.0, January 2004 ++ http://www.apache.org/licenses/ ++ ++TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION ++ ++1. Definitions. ++ ++ "License" shall mean the terms and conditions for use, reproduction, ++ and distribution as defined by Sections 1 through 9 of this document. ++ ++ "Licensor" shall mean the copyright owner or entity authorized by ++ the copyright owner that is granting the License. ++ ++ "Legal Entity" shall mean the union of the acting entity and all ++ other entities that control, are controlled by, or are under common ++ control with that entity. For the purposes of this definition, ++ "control" means (i) the power, direct or indirect, to cause the ++ direction or management of such entity, whether by contract or ++ otherwise, or (ii) ownership of fifty percent (50%) or more of the ++ outstanding shares, or (iii) beneficial ownership of such entity. ++ ++ "You" (or "Your") shall mean an individual or Legal Entity ++ exercising permissions granted by this License. ++ ++ "Source" form shall mean the preferred form for making modifications, ++ including but not limited to software source code, documentation ++ source, and configuration files. ++ ++ "Object" form shall mean any form resulting from mechanical ++ transformation or translation of a Source form, including but ++ not limited to compiled object code, generated documentation, ++ and conversions to other media types. ++ ++ "Work" shall mean the work of authorship, whether in Source or ++ Object form, made available under the License, as indicated by a ++ copyright notice that is included in or attached to the work ++ (an example is provided in the Appendix below). ++ ++ "Derivative Works" shall mean any work, whether in Source or Object ++ form, that is based on (or derived from) the Work and for which the ++ editorial revisions, annotations, elaborations, or other modifications ++ represent, as a whole, an original work of authorship. For the purposes ++ of this License, Derivative Works shall not include works that remain ++ separable from, or merely link (or bind by name) to the interfaces of, ++ the Work and Derivative Works thereof. ++ ++ "Contribution" shall mean any work of authorship, including ++ the original version of the Work and any modifications or additions ++ to that Work or Derivative Works thereof, that is intentionally ++ submitted to Licensor for inclusion in the Work by the copyright owner ++ or by an individual or Legal Entity authorized to submit on behalf of ++ the copyright owner. For the purposes of this definition, "submitted" ++ means any form of electronic, verbal, or written communication sent ++ to the Licensor or its representatives, including but not limited to ++ communication on electronic mailing lists, source code control systems, ++ and issue tracking systems that are managed by, or on behalf of, the ++ Licensor for the purpose of discussing and improving the Work, but ++ excluding communication that is conspicuously marked or otherwise ++ designated in writing by the copyright owner as "Not a Contribution." ++ ++ "Contributor" shall mean Licensor and any individual or Legal Entity ++ on behalf of whom a Contribution has been received by Licensor and ++ subsequently incorporated within the Work. ++ ++2. Grant of Copyright License. Subject to the terms and conditions of ++ this License, each Contributor hereby grants to You a perpetual, ++ worldwide, non-exclusive, no-charge, royalty-free, irrevocable ++ copyright license to reproduce, prepare Derivative Works of, ++ publicly display, publicly perform, sublicense, and distribute the ++ Work and such Derivative Works in Source or Object form. ++ ++3. Grant of Patent License. Subject to the terms and conditions of ++ this License, each Contributor hereby grants to You a perpetual, ++ worldwide, non-exclusive, no-charge, royalty-free, irrevocable ++ (except as stated in this section) patent license to make, have made, ++ use, offer to sell, sell, import, and otherwise transfer the Work, ++ where such license applies only to those patent claims licensable ++ by such Contributor that are necessarily infringed by their ++ Contribution(s) alone or by combination of their Contribution(s) ++ with the Work to which such Contribution(s) was submitted. If You ++ institute patent litigation against any entity (including a ++ cross-claim or counterclaim in a lawsuit) alleging that the Work ++ or a Contribution incorporated within the Work constitutes direct ++ or contributory patent infringement, then any patent licenses ++ granted to You under this License for that Work shall terminate ++ as of the date such litigation is filed. ++ ++4. Redistribution. You may reproduce and distribute copies of the ++ Work or Derivative Works thereof in any medium, with or without ++ modifications, and in Source or Object form, provided that You ++ meet the following conditions: ++ ++ (a) You must give any other recipients of the Work or ++ Derivative Works a copy of this License; and ++ ++ (b) You must cause any modified files to carry prominent notices ++ stating that You changed the files; and ++ ++ (c) You must retain, in the Source form of any Derivative Works ++ that You distribute, all copyright, patent, trademark, and ++ attribution notices from the Source form of the Work, ++ excluding those notices that do not pertain to any part of ++ the Derivative Works; and ++ ++ (d) If the Work includes a "NOTICE" text file as part of its ++ distribution, then any Derivative Works that You distribute must ++ include a readable copy of the attribution notices contained ++ within such NOTICE file, excluding those notices that do not ++ pertain to any part of the Derivative Works, in at least one ++ of the following places: within a NOTICE text file distributed ++ as part of the Derivative Works; within the Source form or ++ documentation, if provided along with the Derivative Works; or, ++ within a display generated by the Derivative Works, if and ++ wherever such third-party notices normally appear. The contents ++ of the NOTICE file are for informational purposes only and ++ do not modify the License. You may add Your own attribution ++ notices within Derivative Works that You distribute, alongside ++ or as an addendum to the NOTICE text from the Work, provided ++ that such additional attribution notices cannot be construed ++ as modifying the License. ++ ++ You may add Your own copyright statement to Your modifications and ++ may provide additional or different license terms and conditions ++ for use, reproduction, or distribution of Your modifications, or ++ for any such Derivative Works as a whole, provided Your use, ++ reproduction, and distribution of the Work otherwise complies with ++ the conditions stated in this License. ++ ++5. Submission of Contributions. Unless You explicitly state otherwise, ++ any Contribution intentionally submitted for inclusion in the Work ++ by You to the Licensor shall be under the terms and conditions of ++ this License, without any additional terms or conditions. ++ Notwithstanding the above, nothing herein shall supersede or modify ++ the terms of any separate license agreement you may have executed ++ with Licensor regarding such Contributions. ++ ++6. Trademarks. This License does not grant permission to use the trade ++ names, trademarks, service marks, or product names of the Licensor, ++ except as required for reasonable and customary use in describing the ++ origin of the Work and reproducing the content of the NOTICE file. ++ ++7. Disclaimer of Warranty. Unless required by applicable law or ++ agreed to in writing, Licensor provides the Work (and each ++ Contributor provides its Contributions) on an "AS IS" BASIS, ++ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or ++ implied, including, without limitation, any warranties or conditions ++ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A ++ PARTICULAR PURPOSE. You are solely responsible for determining the ++ appropriateness of using or redistributing the Work and assume any ++ risks associated with Your exercise of permissions under this License. ++ ++8. Limitation of Liability. In no event and under no legal theory, ++ whether in tort (including negligence), contract, or otherwise, ++ unless required by applicable law (such as deliberate and grossly ++ negligent acts) or agreed to in writing, shall any Contributor be ++ liable to You for damages, including any direct, indirect, special, ++ incidental, or consequential damages of any character arising as a ++ result of this License or out of the use or inability to use the ++ Work (including but not limited to damages for loss of goodwill, ++ work stoppage, computer failure or malfunction, or any and all ++ other commercial damages or losses), even if such Contributor ++ has been advised of the possibility of such damages. ++ ++9. Accepting Warranty or Additional Liability. While redistributing ++ the Work or Derivative Works thereof, You may choose to offer, ++ and charge a fee for, acceptance of support, warranty, indemnity, ++ or other liability obligations and/or rights consistent with this ++ License. However, in accepting such obligations, You may act only ++ on Your own behalf and on Your sole responsibility, not on behalf ++ of any other Contributor, and only if You agree to indemnify, ++ defend, and hold each Contributor harmless for any liability ++ incurred by, or claims asserted against, such Contributor by reason ++ of your accepting any such warranty or additional liability. ++ ++END OF TERMS AND CONDITIONS ++ ++APPENDIX: How to apply the Apache License to your work. ++ ++ To apply the Apache License to your work, attach the following ++ boilerplate notice, with the fields enclosed by brackets "[]" ++ replaced with your own identifying information. (Don't include ++ the brackets!) The text should be enclosed in the appropriate ++ comment syntax for the file format. We also recommend that a ++ file or class name and description of purpose be included on the ++ same "printed page" as the copyright notice for easier ++ identification within third-party archives. ++ ++Copyright [yyyy] [name of copyright owner] ++ ++Licensed under the Apache License, Version 2.0 (the "License"); ++you may not use this file except in compliance with the License. ++You may obtain a copy of the License at ++ ++ http://www.apache.org/licenses/LICENSE-2.0 ++ ++Unless required by applicable law or agreed to in writing, software ++distributed under the License is distributed on an "AS IS" BASIS, ++WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++See the License for the specific language governing permissions and ++limitations under the License. +diff -Nru mesa-25.3.3/subprojects/log-0.4.26/LICENSE-MIT mesa-25.3.3/subprojects/log-0.4.26/LICENSE-MIT +--- mesa-25.3.3/subprojects/log-0.4.26/LICENSE-MIT 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/log-0.4.26/LICENSE-MIT 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,25 @@ ++Copyright (c) 2014 The Rust Project Developers ++ ++Permission is hereby granted, free of charge, to any ++person obtaining a copy of this software and associated ++documentation files (the "Software"), to deal in the ++Software without restriction, including without ++limitation the rights to use, copy, modify, merge, ++publish, distribute, sublicense, and/or sell copies of ++the Software, and to permit persons to whom the Software ++is furnished to do so, subject to the following ++conditions: ++ ++The above copyright notice and this permission notice ++shall be included in all copies or substantial portions ++of the Software. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ++ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED ++TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A ++PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT ++SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ++CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION ++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR ++IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ++DEALINGS IN THE SOFTWARE. +diff -Nru mesa-25.3.3/subprojects/log-0.4.26/meson.build mesa-25.3.3/subprojects/log-0.4.26/meson.build +--- mesa-25.3.3/subprojects/log-0.4.26/meson.build 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/log-0.4.26/meson.build 2026-05-26 15:46:07.000000000 -0500 +@@ -0,0 +1,16 @@ ++# Copyright © 2024 Google ++# SPDX-License-Identifier: MIT ++ ++project('log', 'rust', version : '0.4.26', license : 'MIT OR Apache-2.0') ++ ++lib = static_library( ++ 'log', ++ 'src/lib.rs', ++ override_options : ['rust_std=2021', 'build.rust_std=2021'], ++ rust_abi : 'rust', ++ native : true, ++) ++ ++dep_log = declare_dependency( ++ link_with : [lib] ++) +diff -Nru mesa-25.3.3/subprojects/log-0.4.26/.meson-subproject-wrap-hash.txt mesa-25.3.3/subprojects/log-0.4.26/.meson-subproject-wrap-hash.txt +--- mesa-25.3.3/subprojects/log-0.4.26/.meson-subproject-wrap-hash.txt 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/log-0.4.26/.meson-subproject-wrap-hash.txt 2026-05-29 13:40:54.000000000 -0500 +@@ -0,0 +1 @@ ++70864c4f9d225e4592ab321807984cf996a4d4c0fdb17b8192e650e52c9f234f +diff -Nru mesa-25.3.3/subprojects/log-0.4.26/README.md mesa-25.3.3/subprojects/log-0.4.26/README.md +--- mesa-25.3.3/subprojects/log-0.4.26/README.md 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/log-0.4.26/README.md 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,134 @@ ++log ++=== ++ ++A Rust library providing a lightweight logging *facade*. ++ ++[![Build status](https://img.shields.io/github/actions/workflow/status/rust-lang/log/main.yml?branch=master)](https://github.com/rust-lang/log/actions) ++[![Latest version](https://img.shields.io/crates/v/log.svg)](https://crates.io/crates/log) ++[![Documentation](https://docs.rs/log/badge.svg)](https://docs.rs/log) ++![License](https://img.shields.io/crates/l/log.svg) ++ ++* [`log` documentation](https://docs.rs/log) ++ ++A logging facade provides a single logging API that abstracts over the actual ++logging implementation. Libraries can use the logging API provided by this ++crate, and the consumer of those libraries can choose the logging ++implementation that is most suitable for its use case. ++ ++ ++## Minimum supported `rustc` ++ ++`1.60.0+` ++ ++This version is explicitly tested in CI and may be bumped in any release as needed. Maintaining compatibility with older compilers is a priority though, so the bar for bumping the minimum supported version is set very high. Any changes to the supported minimum version will be called out in the release notes. ++ ++## Usage ++ ++### In libraries ++ ++Libraries should link only to the `log` crate, and use the provided macros to ++log whatever information will be useful to downstream consumers: ++ ++```toml ++[dependencies] ++log = "0.4" ++``` ++ ++```rust ++use log::{info, trace, warn}; ++ ++pub fn shave_the_yak(yak: &mut Yak) { ++ trace!("Commencing yak shaving"); ++ ++ loop { ++ match find_a_razor() { ++ Ok(razor) => { ++ info!("Razor located: {razor}"); ++ yak.shave(razor); ++ break; ++ } ++ Err(err) => { ++ warn!("Unable to locate a razor: {err}, retrying"); ++ } ++ } ++ } ++} ++``` ++ ++### In executables ++ ++In order to produce log output, executables have to use a logger implementation compatible with the facade. ++There are many available implementations to choose from, here are some options: ++ ++* Simple minimal loggers: ++ * [`env_logger`](https://docs.rs/env_logger/*/env_logger/) ++ * [`colog`](https://docs.rs/colog/*/colog/) ++ * [`simple_logger`](https://docs.rs/simple_logger/*/simple_logger/) ++ * [`simplelog`](https://docs.rs/simplelog/*/simplelog/) ++ * [`pretty_env_logger`](https://docs.rs/pretty_env_logger/*/pretty_env_logger/) ++ * [`stderrlog`](https://docs.rs/stderrlog/*/stderrlog/) ++ * [`flexi_logger`](https://docs.rs/flexi_logger/*/flexi_logger/) ++ * [`call_logger`](https://docs.rs/call_logger/*/call_logger/) ++ * [`std-logger`](https://docs.rs/std-logger/*/std_logger/) ++ * [`structured-logger`](https://docs.rs/structured-logger/latest/structured_logger/) ++ * [`clang_log`](https://docs.rs/clang_log/latest/clang_log) ++ * [`ftail`](https://docs.rs/ftail/latest/ftail/) ++* Complex configurable frameworks: ++ * [`log4rs`](https://docs.rs/log4rs/*/log4rs/) ++ * [`logforth`](https://docs.rs/logforth/*/logforth/) ++ * [`fern`](https://docs.rs/fern/*/fern/) ++ * [`spdlog-rs`](https://docs.rs/spdlog-rs/*/spdlog/) ++* Adaptors for other facilities: ++ * [`syslog`](https://docs.rs/syslog/*/syslog/) ++ * [`systemd-journal-logger`](https://docs.rs/systemd-journal-logger/*/systemd_journal_logger/) ++ * [`slog-stdlog`](https://docs.rs/slog-stdlog/*/slog_stdlog/) ++ * [`android_log`](https://docs.rs/android_log/*/android_log/) ++ * [`win_dbg_logger`](https://docs.rs/win_dbg_logger/*/win_dbg_logger/) ++ * [`db_logger`](https://docs.rs/db_logger/*/db_logger/) ++ * [`log-to-defmt`](https://docs.rs/log-to-defmt/*/log_to_defmt/) ++ * [`logcontrol-log`](https://docs.rs/logcontrol-log/*/logcontrol_log/) ++* For WebAssembly binaries: ++ * [`console_log`](https://docs.rs/console_log/*/console_log/) ++* For dynamic libraries: ++ * You may need to construct [an FFI-safe wrapper over `log`](https://github.com/rust-lang/log/issues/421) to initialize in your libraries. ++* Utilities: ++ * [`log_err`](https://docs.rs/log_err/*/log_err/) ++ * [`log-reload`](https://docs.rs/log-reload/*/log_reload/) ++ * [`alterable_logger`](https://docs.rs/alterable_logger/*/alterable_logger) ++ ++Executables should choose a logger implementation and initialize it early in the ++runtime of the program. Logger implementations will typically include a ++function to do this. Any log messages generated before the logger is ++initialized will be ignored. ++ ++The executable itself may use the `log` crate to log as well. ++ ++## Structured logging ++ ++If you enable the `kv` feature, you can associate structured data with your log records: ++ ++```rust ++use log::{info, trace, warn}; ++ ++pub fn shave_the_yak(yak: &mut Yak) { ++ // `yak:serde` will capture `yak` using its `serde::Serialize` impl ++ // ++ // You could also use `:?` for `Debug`, or `:%` for `Display`. For a ++ // full list, see the `log` crate documentation ++ trace!(target = "yak_events", yak:serde; "Commencing yak shaving"); ++ ++ loop { ++ match find_a_razor() { ++ Ok(razor) => { ++ info!(razor; "Razor located"); ++ yak.shave(razor); ++ break; ++ } ++ Err(e) => { ++ // `e:err` will capture `e` using its `std::error::Error` impl ++ warn!(e:err; "Unable to locate a razor, retrying"); ++ } ++ } ++ } ++} ++``` +diff -Nru mesa-25.3.3/subprojects/log-0.4.26/src/kv/error.rs mesa-25.3.3/subprojects/log-0.4.26/src/kv/error.rs +--- mesa-25.3.3/subprojects/log-0.4.26/src/kv/error.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/log-0.4.26/src/kv/error.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,94 @@ ++use std::fmt; ++ ++/// An error encountered while working with structured data. ++#[derive(Debug)] ++pub struct Error { ++ inner: Inner, ++} ++ ++#[derive(Debug)] ++enum Inner { ++ #[cfg(feature = "std")] ++ Boxed(std_support::BoxedError), ++ Msg(&'static str), ++ #[cfg(feature = "value-bag")] ++ Value(crate::kv::value::inner::Error), ++ Fmt, ++} ++ ++impl Error { ++ /// Create an error from a message. ++ pub fn msg(msg: &'static str) -> Self { ++ Error { ++ inner: Inner::Msg(msg), ++ } ++ } ++ ++ // Not public so we don't leak the `crate::kv::value::inner` API ++ #[cfg(feature = "value-bag")] ++ pub(super) fn from_value(err: crate::kv::value::inner::Error) -> Self { ++ Error { ++ inner: Inner::Value(err), ++ } ++ } ++ ++ // Not public so we don't leak the `crate::kv::value::inner` API ++ #[cfg(feature = "value-bag")] ++ pub(super) fn into_value(self) -> crate::kv::value::inner::Error { ++ match self.inner { ++ Inner::Value(err) => err, ++ #[cfg(feature = "kv_std")] ++ _ => crate::kv::value::inner::Error::boxed(self), ++ #[cfg(not(feature = "kv_std"))] ++ _ => crate::kv::value::inner::Error::msg("error inspecting a value"), ++ } ++ } ++} ++ ++impl fmt::Display for Error { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ use self::Inner::*; ++ match &self.inner { ++ #[cfg(feature = "std")] ++ Boxed(err) => err.fmt(f), ++ #[cfg(feature = "value-bag")] ++ Value(err) => err.fmt(f), ++ Msg(msg) => msg.fmt(f), ++ Fmt => fmt::Error.fmt(f), ++ } ++ } ++} ++ ++impl From for Error { ++ fn from(_: fmt::Error) -> Self { ++ Error { inner: Inner::Fmt } ++ } ++} ++ ++#[cfg(feature = "std")] ++mod std_support { ++ use super::*; ++ use std::{error, io}; ++ ++ pub(super) type BoxedError = Box; ++ ++ impl Error { ++ /// Create an error from a standard error type. ++ pub fn boxed(err: E) -> Self ++ where ++ E: Into, ++ { ++ Error { ++ inner: Inner::Boxed(err.into()), ++ } ++ } ++ } ++ ++ impl error::Error for Error {} ++ ++ impl From for Error { ++ fn from(err: io::Error) -> Self { ++ Error::boxed(err) ++ } ++ } ++} +diff -Nru mesa-25.3.3/subprojects/log-0.4.26/src/kv/key.rs mesa-25.3.3/subprojects/log-0.4.26/src/kv/key.rs +--- mesa-25.3.3/subprojects/log-0.4.26/src/kv/key.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/log-0.4.26/src/kv/key.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,163 @@ ++//! Structured keys. ++ ++use std::borrow::Borrow; ++use std::fmt; ++ ++/// A type that can be converted into a [`Key`](struct.Key.html). ++pub trait ToKey { ++ /// Perform the conversion. ++ fn to_key(&self) -> Key; ++} ++ ++impl<'a, T> ToKey for &'a T ++where ++ T: ToKey + ?Sized, ++{ ++ fn to_key(&self) -> Key { ++ (**self).to_key() ++ } ++} ++ ++impl<'k> ToKey for Key<'k> { ++ fn to_key(&self) -> Key { ++ Key { key: self.key } ++ } ++} ++ ++impl ToKey for str { ++ fn to_key(&self) -> Key { ++ Key::from_str(self) ++ } ++} ++ ++/// A key in a key-value. ++// These impls must only be based on the as_str() representation of the key ++// If a new field (such as an optional index) is added to the key they must not affect comparison ++#[derive(Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] ++pub struct Key<'k> { ++ // NOTE: This may become `Cow<'k, str>` ++ key: &'k str, ++} ++ ++impl<'k> Key<'k> { ++ /// Get a key from a borrowed string. ++ pub fn from_str(key: &'k str) -> Self { ++ Key { key } ++ } ++ ++ /// Get a borrowed string from this key. ++ /// ++ /// The lifetime of the returned string is bound to the borrow of `self` rather ++ /// than to `'k`. ++ pub fn as_str(&self) -> &str { ++ self.key ++ } ++ ++ /// Try get a borrowed string for the lifetime `'k` from this key. ++ /// ++ /// If the key is a borrow of a longer lived string, this method will return `Some`. ++ /// If the key is internally buffered, this method will return `None`. ++ pub fn to_borrowed_str(&self) -> Option<&'k str> { ++ // NOTE: If the internals of `Key` support buffering this ++ // won't be unconditionally `Some` anymore. We want to keep ++ // this option open ++ Some(self.key) ++ } ++} ++ ++impl<'k> fmt::Display for Key<'k> { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ self.key.fmt(f) ++ } ++} ++ ++impl<'k> AsRef for Key<'k> { ++ fn as_ref(&self) -> &str { ++ self.as_str() ++ } ++} ++ ++impl<'k> Borrow for Key<'k> { ++ fn borrow(&self) -> &str { ++ self.as_str() ++ } ++} ++ ++impl<'k> From<&'k str> for Key<'k> { ++ fn from(s: &'k str) -> Self { ++ Key::from_str(s) ++ } ++} ++ ++#[cfg(feature = "std")] ++mod std_support { ++ use super::*; ++ ++ use std::borrow::Cow; ++ ++ impl ToKey for String { ++ fn to_key(&self) -> Key { ++ Key::from_str(self) ++ } ++ } ++ ++ impl<'a> ToKey for Cow<'a, str> { ++ fn to_key(&self) -> Key { ++ Key::from_str(self) ++ } ++ } ++} ++ ++#[cfg(feature = "kv_sval")] ++mod sval_support { ++ use super::*; ++ ++ use sval::Value; ++ use sval_ref::ValueRef; ++ ++ impl<'a> Value for Key<'a> { ++ fn stream<'sval, S: sval::Stream<'sval> + ?Sized>( ++ &'sval self, ++ stream: &mut S, ++ ) -> sval::Result { ++ self.key.stream(stream) ++ } ++ } ++ ++ impl<'a> ValueRef<'a> for Key<'a> { ++ fn stream_ref + ?Sized>(&self, stream: &mut S) -> sval::Result { ++ self.key.stream(stream) ++ } ++ } ++} ++ ++#[cfg(feature = "kv_serde")] ++mod serde_support { ++ use super::*; ++ ++ use serde::{Serialize, Serializer}; ++ ++ impl<'a> Serialize for Key<'a> { ++ fn serialize(&self, serializer: S) -> Result ++ where ++ S: Serializer, ++ { ++ self.key.serialize(serializer) ++ } ++ } ++} ++ ++#[cfg(test)] ++mod tests { ++ use super::*; ++ ++ #[test] ++ fn key_from_string() { ++ assert_eq!("a key", Key::from_str("a key").as_str()); ++ } ++ ++ #[test] ++ fn key_to_borrowed() { ++ assert_eq!("a key", Key::from_str("a key").to_borrowed_str().unwrap()); ++ } ++} +diff -Nru mesa-25.3.3/subprojects/log-0.4.26/src/kv/mod.rs mesa-25.3.3/subprojects/log-0.4.26/src/kv/mod.rs +--- mesa-25.3.3/subprojects/log-0.4.26/src/kv/mod.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/log-0.4.26/src/kv/mod.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,265 @@ ++//! Structured logging. ++//! ++//! Add the `kv` feature to your `Cargo.toml` to enable ++//! this module: ++//! ++//! ```toml ++//! [dependencies.log] ++//! features = ["kv"] ++//! ``` ++//! ++//! # Structured logging in `log` ++//! ++//! Structured logging enhances traditional text-based log records with user-defined ++//! attributes. Structured logs can be analyzed using a variety of data processing ++//! techniques, without needing to find and parse attributes from unstructured text first. ++//! ++//! In `log`, user-defined attributes are part of a [`Source`] on the log record. ++//! Each attribute is a key-value; a pair of [`Key`] and [`Value`]. Keys are strings ++//! and values are a datum of any type that can be formatted or serialized. Simple types ++//! like strings, booleans, and numbers are supported, as well as arbitrarily complex ++//! structures involving nested objects and sequences. ++//! ++//! ## Adding key-values to log records ++//! ++//! Key-values appear before the message format in the `log!` macros: ++//! ++//! ``` ++//! # use log::info; ++//! info!(a = 1; "Something of interest"); ++//! ``` ++//! ++//! Key-values support the same shorthand identifier syntax as `format_args`: ++//! ++//! ``` ++//! # use log::info; ++//! let a = 1; ++//! ++//! info!(a; "Something of interest"); ++//! ``` ++//! ++//! Values are capturing using the [`ToValue`] trait by default. To capture a value ++//! using a different trait implementation, use a modifier after its key. Here's how ++//! the same example can capture `a` using its `Debug` implementation instead: ++//! ++//! ``` ++//! # use log::info; ++//! info!(a:? = 1; "Something of interest"); ++//! ``` ++//! ++//! The following capturing modifiers are supported: ++//! ++//! - `:?` will capture the value using `Debug`. ++//! - `:debug` will capture the value using `Debug`. ++//! - `:%` will capture the value using `Display`. ++//! - `:display` will capture the value using `Display`. ++//! - `:err` will capture the value using `std::error::Error` (requires the `kv_std` feature). ++//! - `:sval` will capture the value using `sval::Value` (requires the `kv_sval` feature). ++//! - `:serde` will capture the value using `serde::Serialize` (requires the `kv_serde` feature). ++//! ++//! ## Working with key-values on log records ++//! ++//! Use the [`Record::key_values`](../struct.Record.html#method.key_values) method to access key-values. ++//! ++//! Individual values can be pulled from the source by their key: ++//! ++//! ``` ++//! # fn main() -> Result<(), log::kv::Error> { ++//! use log::kv::{Source, Key, Value}; ++//! # let record = log::Record::builder().key_values(&[("a", 1)]).build(); ++//! ++//! // info!(a = 1; "Something of interest"); ++//! ++//! let a: Value = record.key_values().get(Key::from("a")).unwrap(); ++//! assert_eq!(1, a.to_i64().unwrap()); ++//! # Ok(()) ++//! # } ++//! ``` ++//! ++//! All key-values can also be enumerated using a [`VisitSource`]: ++//! ++//! ``` ++//! # fn main() -> Result<(), log::kv::Error> { ++//! use std::collections::BTreeMap; ++//! ++//! use log::kv::{self, Source, Key, Value, VisitSource}; ++//! ++//! struct Collect<'kvs>(BTreeMap, Value<'kvs>>); ++//! ++//! impl<'kvs> VisitSource<'kvs> for Collect<'kvs> { ++//! fn visit_pair(&mut self, key: Key<'kvs>, value: Value<'kvs>) -> Result<(), kv::Error> { ++//! self.0.insert(key, value); ++//! ++//! Ok(()) ++//! } ++//! } ++//! ++//! let mut visitor = Collect(BTreeMap::new()); ++//! ++//! # let record = log::Record::builder().key_values(&[("a", 1), ("b", 2), ("c", 3)]).build(); ++//! // info!(a = 1, b = 2, c = 3; "Something of interest"); ++//! ++//! record.key_values().visit(&mut visitor)?; ++//! ++//! let collected = visitor.0; ++//! ++//! assert_eq!( ++//! vec!["a", "b", "c"], ++//! collected ++//! .keys() ++//! .map(|k| k.as_str()) ++//! .collect::>(), ++//! ); ++//! # Ok(()) ++//! # } ++//! ``` ++//! ++//! [`Value`]s have methods for conversions to common types: ++//! ++//! ``` ++//! # fn main() -> Result<(), log::kv::Error> { ++//! use log::kv::{Source, Key}; ++//! # let record = log::Record::builder().key_values(&[("a", 1)]).build(); ++//! ++//! // info!(a = 1; "Something of interest"); ++//! ++//! let a = record.key_values().get(Key::from("a")).unwrap(); ++//! ++//! assert_eq!(1, a.to_i64().unwrap()); ++//! # Ok(()) ++//! # } ++//! ``` ++//! ++//! Values also have their own [`VisitValue`] type. Value visitors are a lightweight ++//! API for working with primitives types: ++//! ++//! ``` ++//! # fn main() -> Result<(), log::kv::Error> { ++//! use log::kv::{self, Source, Key, VisitValue}; ++//! # let record = log::Record::builder().key_values(&[("a", 1)]).build(); ++//! ++//! struct IsNumeric(bool); ++//! ++//! impl<'kvs> VisitValue<'kvs> for IsNumeric { ++//! fn visit_any(&mut self, _value: kv::Value) -> Result<(), kv::Error> { ++//! self.0 = false; ++//! Ok(()) ++//! } ++//! ++//! fn visit_u64(&mut self, _value: u64) -> Result<(), kv::Error> { ++//! self.0 = true; ++//! Ok(()) ++//! } ++//! ++//! fn visit_i64(&mut self, _value: i64) -> Result<(), kv::Error> { ++//! self.0 = true; ++//! Ok(()) ++//! } ++//! ++//! fn visit_u128(&mut self, _value: u128) -> Result<(), kv::Error> { ++//! self.0 = true; ++//! Ok(()) ++//! } ++//! ++//! fn visit_i128(&mut self, _value: i128) -> Result<(), kv::Error> { ++//! self.0 = true; ++//! Ok(()) ++//! } ++//! ++//! fn visit_f64(&mut self, _value: f64) -> Result<(), kv::Error> { ++//! self.0 = true; ++//! Ok(()) ++//! } ++//! } ++//! ++//! // info!(a = 1; "Something of interest"); ++//! ++//! let a = record.key_values().get(Key::from("a")).unwrap(); ++//! ++//! let mut visitor = IsNumeric(false); ++//! ++//! a.visit(&mut visitor)?; ++//! ++//! let is_numeric = visitor.0; ++//! ++//! assert!(is_numeric); ++//! # Ok(()) ++//! # } ++//! ``` ++//! ++//! To serialize a value to a format like JSON, you can also use either `serde` or `sval`: ++//! ++//! ``` ++//! # fn main() -> Result<(), Box> { ++//! # #[cfg(feature = "serde")] ++//! # { ++//! # use log::kv::Key; ++//! #[derive(serde::Serialize)] ++//! struct Data { ++//! a: i32, b: bool, ++//! c: &'static str, ++//! } ++//! ++//! let data = Data { a: 1, b: true, c: "Some data" }; ++//! ++//! # let source = [("a", log::kv::Value::from_serde(&data))]; ++//! # let record = log::Record::builder().key_values(&source).build(); ++//! // info!(a = data; "Something of interest"); ++//! ++//! let a = record.key_values().get(Key::from("a")).unwrap(); ++//! ++//! assert_eq!("{\"a\":1,\"b\":true,\"c\":\"Some data\"}", serde_json::to_string(&a)?); ++//! # } ++//! # Ok(()) ++//! # } ++//! ``` ++//! ++//! The choice of serialization framework depends on the needs of the consumer. ++//! If you're in a no-std environment, you can use `sval`. In other cases, you can use `serde`. ++//! Log producers and log consumers don't need to agree on the serialization framework. ++//! A value can be captured using its `serde::Serialize` implementation and still be serialized ++//! through `sval` without losing any structure or data. ++//! ++//! Values can also always be formatted using the standard `Debug` and `Display` ++//! traits: ++//! ++//! ``` ++//! # use log::kv::Key; ++//! # #[derive(Debug)] ++//! struct Data { ++//! a: i32, ++//! b: bool, ++//! c: &'static str, ++//! } ++//! ++//! let data = Data { a: 1, b: true, c: "Some data" }; ++//! ++//! # let source = [("a", log::kv::Value::from_debug(&data))]; ++//! # let record = log::Record::builder().key_values(&source).build(); ++//! // info!(a = data; "Something of interest"); ++//! ++//! let a = record.key_values().get(Key::from("a")).unwrap(); ++//! ++//! assert_eq!("Data { a: 1, b: true, c: \"Some data\" }", format!("{a:?}")); ++//! ``` ++ ++mod error; ++mod key; ++ ++#[cfg(not(feature = "kv_unstable"))] ++mod source; ++#[cfg(not(feature = "kv_unstable"))] ++mod value; ++ ++pub use self::error::Error; ++pub use self::key::{Key, ToKey}; ++pub use self::source::{Source, VisitSource}; ++pub use self::value::{ToValue, Value, VisitValue}; ++ ++#[cfg(feature = "kv_unstable")] ++pub mod source; ++#[cfg(feature = "kv_unstable")] ++pub mod value; ++ ++#[cfg(feature = "kv_unstable")] ++pub use self::source::Visitor; +diff -Nru mesa-25.3.3/subprojects/log-0.4.26/src/kv/source.rs mesa-25.3.3/subprojects/log-0.4.26/src/kv/source.rs +--- mesa-25.3.3/subprojects/log-0.4.26/src/kv/source.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/log-0.4.26/src/kv/source.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,514 @@ ++//! Sources for key-values. ++//! ++//! This module defines the [`Source`] type and supporting APIs for ++//! working with collections of key-values. ++ ++use crate::kv::{Error, Key, ToKey, ToValue, Value}; ++use std::fmt; ++ ++/// A source of key-values. ++/// ++/// The source may be a single pair, a set of pairs, or a filter over a set of pairs. ++/// Use the [`VisitSource`](trait.VisitSource.html) trait to inspect the structured data ++/// in a source. ++/// ++/// A source is like an iterator over its key-values, except with a push-based API ++/// instead of a pull-based one. ++/// ++/// # Examples ++/// ++/// Enumerating the key-values in a source: ++/// ++/// ``` ++/// # fn main() -> Result<(), log::kv::Error> { ++/// use log::kv::{self, Source, Key, Value, VisitSource}; ++/// ++/// // A `VisitSource` that prints all key-values ++/// // VisitSources are fed the key-value pairs of each key-values ++/// struct Printer; ++/// ++/// impl<'kvs> VisitSource<'kvs> for Printer { ++/// fn visit_pair(&mut self, key: Key<'kvs>, value: Value<'kvs>) -> Result<(), kv::Error> { ++/// println!("{key}: {value}"); ++/// ++/// Ok(()) ++/// } ++/// } ++/// ++/// // A source with 3 key-values ++/// // Common collection types implement the `Source` trait ++/// let source = &[ ++/// ("a", 1), ++/// ("b", 2), ++/// ("c", 3), ++/// ]; ++/// ++/// // Pass an instance of the `VisitSource` to a `Source` to visit it ++/// source.visit(&mut Printer)?; ++/// # Ok(()) ++/// # } ++/// ``` ++pub trait Source { ++ /// Visit key-values. ++ /// ++ /// A source doesn't have to guarantee any ordering or uniqueness of key-values. ++ /// If the given visitor returns an error then the source may early-return with it, ++ /// even if there are more key-values. ++ /// ++ /// # Implementation notes ++ /// ++ /// A source should yield the same key-values to a subsequent visitor unless ++ /// that visitor itself fails. ++ fn visit<'kvs>(&'kvs self, visitor: &mut dyn VisitSource<'kvs>) -> Result<(), Error>; ++ ++ /// Get the value for a given key. ++ /// ++ /// If the key appears multiple times in the source then which key is returned ++ /// is implementation specific. ++ /// ++ /// # Implementation notes ++ /// ++ /// A source that can provide a more efficient implementation of this method ++ /// should override it. ++ fn get(&self, key: Key) -> Option> { ++ get_default(self, key) ++ } ++ ++ /// Count the number of key-values that can be visited. ++ /// ++ /// # Implementation notes ++ /// ++ /// A source that knows the number of key-values upfront may provide a more ++ /// efficient implementation. ++ /// ++ /// A subsequent call to `visit` should yield the same number of key-values. ++ fn count(&self) -> usize { ++ count_default(self) ++ } ++} ++ ++/// The default implementation of `Source::get` ++fn get_default<'v>(source: &'v (impl Source + ?Sized), key: Key) -> Option> { ++ struct Get<'k, 'v> { ++ key: Key<'k>, ++ found: Option>, ++ } ++ ++ impl<'k, 'kvs> VisitSource<'kvs> for Get<'k, 'kvs> { ++ fn visit_pair(&mut self, key: Key<'kvs>, value: Value<'kvs>) -> Result<(), Error> { ++ if self.key == key { ++ self.found = Some(value); ++ } ++ ++ Ok(()) ++ } ++ } ++ ++ let mut get = Get { key, found: None }; ++ ++ let _ = source.visit(&mut get); ++ get.found ++} ++ ++/// The default implementation of `Source::count`. ++fn count_default(source: impl Source) -> usize { ++ struct Count(usize); ++ ++ impl<'kvs> VisitSource<'kvs> for Count { ++ fn visit_pair(&mut self, _: Key<'kvs>, _: Value<'kvs>) -> Result<(), Error> { ++ self.0 += 1; ++ ++ Ok(()) ++ } ++ } ++ ++ let mut count = Count(0); ++ let _ = source.visit(&mut count); ++ count.0 ++} ++ ++impl<'a, T> Source for &'a T ++where ++ T: Source + ?Sized, ++{ ++ fn visit<'kvs>(&'kvs self, visitor: &mut dyn VisitSource<'kvs>) -> Result<(), Error> { ++ Source::visit(&**self, visitor) ++ } ++ ++ fn get(&self, key: Key) -> Option> { ++ Source::get(&**self, key) ++ } ++ ++ fn count(&self) -> usize { ++ Source::count(&**self) ++ } ++} ++ ++impl Source for (K, V) ++where ++ K: ToKey, ++ V: ToValue, ++{ ++ fn visit<'kvs>(&'kvs self, visitor: &mut dyn VisitSource<'kvs>) -> Result<(), Error> { ++ visitor.visit_pair(self.0.to_key(), self.1.to_value()) ++ } ++ ++ fn get(&self, key: Key) -> Option> { ++ if self.0.to_key() == key { ++ Some(self.1.to_value()) ++ } else { ++ None ++ } ++ } ++ ++ fn count(&self) -> usize { ++ 1 ++ } ++} ++ ++impl Source for [S] ++where ++ S: Source, ++{ ++ fn visit<'kvs>(&'kvs self, visitor: &mut dyn VisitSource<'kvs>) -> Result<(), Error> { ++ for source in self { ++ source.visit(visitor)?; ++ } ++ ++ Ok(()) ++ } ++ ++ fn get(&self, key: Key) -> Option> { ++ for source in self { ++ if let Some(found) = source.get(key.clone()) { ++ return Some(found); ++ } ++ } ++ ++ None ++ } ++ ++ fn count(&self) -> usize { ++ self.iter().map(Source::count).sum() ++ } ++} ++ ++impl Source for [S; N] ++where ++ S: Source, ++{ ++ fn visit<'kvs>(&'kvs self, visitor: &mut dyn VisitSource<'kvs>) -> Result<(), Error> { ++ Source::visit(self as &[_], visitor) ++ } ++ ++ fn get(&self, key: Key) -> Option> { ++ Source::get(self as &[_], key) ++ } ++ ++ fn count(&self) -> usize { ++ Source::count(self as &[_]) ++ } ++} ++ ++impl Source for Option ++where ++ S: Source, ++{ ++ fn visit<'kvs>(&'kvs self, visitor: &mut dyn VisitSource<'kvs>) -> Result<(), Error> { ++ if let Some(source) = self { ++ source.visit(visitor)?; ++ } ++ ++ Ok(()) ++ } ++ ++ fn get(&self, key: Key) -> Option> { ++ self.as_ref().and_then(|s| s.get(key)) ++ } ++ ++ fn count(&self) -> usize { ++ self.as_ref().map_or(0, Source::count) ++ } ++} ++ ++/// A visitor for the key-value pairs in a [`Source`](trait.Source.html). ++pub trait VisitSource<'kvs> { ++ /// Visit a key-value pair. ++ fn visit_pair(&mut self, key: Key<'kvs>, value: Value<'kvs>) -> Result<(), Error>; ++} ++ ++impl<'a, 'kvs, T> VisitSource<'kvs> for &'a mut T ++where ++ T: VisitSource<'kvs> + ?Sized, ++{ ++ fn visit_pair(&mut self, key: Key<'kvs>, value: Value<'kvs>) -> Result<(), Error> { ++ (**self).visit_pair(key, value) ++ } ++} ++ ++impl<'a, 'b: 'a, 'kvs> VisitSource<'kvs> for fmt::DebugMap<'a, 'b> { ++ fn visit_pair(&mut self, key: Key<'kvs>, value: Value<'kvs>) -> Result<(), Error> { ++ self.entry(&key, &value); ++ Ok(()) ++ } ++} ++ ++impl<'a, 'b: 'a, 'kvs> VisitSource<'kvs> for fmt::DebugList<'a, 'b> { ++ fn visit_pair(&mut self, key: Key<'kvs>, value: Value<'kvs>) -> Result<(), Error> { ++ self.entry(&(key, value)); ++ Ok(()) ++ } ++} ++ ++impl<'a, 'b: 'a, 'kvs> VisitSource<'kvs> for fmt::DebugSet<'a, 'b> { ++ fn visit_pair(&mut self, key: Key<'kvs>, value: Value<'kvs>) -> Result<(), Error> { ++ self.entry(&(key, value)); ++ Ok(()) ++ } ++} ++ ++impl<'a, 'b: 'a, 'kvs> VisitSource<'kvs> for fmt::DebugTuple<'a, 'b> { ++ fn visit_pair(&mut self, key: Key<'kvs>, value: Value<'kvs>) -> Result<(), Error> { ++ self.field(&key); ++ self.field(&value); ++ Ok(()) ++ } ++} ++ ++#[cfg(feature = "std")] ++mod std_support { ++ use super::*; ++ use std::borrow::Borrow; ++ use std::collections::{BTreeMap, HashMap}; ++ use std::hash::{BuildHasher, Hash}; ++ use std::rc::Rc; ++ use std::sync::Arc; ++ ++ impl Source for Box ++ where ++ S: Source + ?Sized, ++ { ++ fn visit<'kvs>(&'kvs self, visitor: &mut dyn VisitSource<'kvs>) -> Result<(), Error> { ++ Source::visit(&**self, visitor) ++ } ++ ++ fn get(&self, key: Key) -> Option> { ++ Source::get(&**self, key) ++ } ++ ++ fn count(&self) -> usize { ++ Source::count(&**self) ++ } ++ } ++ ++ impl Source for Arc ++ where ++ S: Source + ?Sized, ++ { ++ fn visit<'kvs>(&'kvs self, visitor: &mut dyn VisitSource<'kvs>) -> Result<(), Error> { ++ Source::visit(&**self, visitor) ++ } ++ ++ fn get(&self, key: Key) -> Option> { ++ Source::get(&**self, key) ++ } ++ ++ fn count(&self) -> usize { ++ Source::count(&**self) ++ } ++ } ++ ++ impl Source for Rc ++ where ++ S: Source + ?Sized, ++ { ++ fn visit<'kvs>(&'kvs self, visitor: &mut dyn VisitSource<'kvs>) -> Result<(), Error> { ++ Source::visit(&**self, visitor) ++ } ++ ++ fn get(&self, key: Key) -> Option> { ++ Source::get(&**self, key) ++ } ++ ++ fn count(&self) -> usize { ++ Source::count(&**self) ++ } ++ } ++ ++ impl Source for Vec ++ where ++ S: Source, ++ { ++ fn visit<'kvs>(&'kvs self, visitor: &mut dyn VisitSource<'kvs>) -> Result<(), Error> { ++ Source::visit(&**self, visitor) ++ } ++ ++ fn get(&self, key: Key) -> Option> { ++ Source::get(&**self, key) ++ } ++ ++ fn count(&self) -> usize { ++ Source::count(&**self) ++ } ++ } ++ ++ impl<'kvs, V> VisitSource<'kvs> for Box ++ where ++ V: VisitSource<'kvs> + ?Sized, ++ { ++ fn visit_pair(&mut self, key: Key<'kvs>, value: Value<'kvs>) -> Result<(), Error> { ++ (**self).visit_pair(key, value) ++ } ++ } ++ ++ impl Source for HashMap ++ where ++ K: ToKey + Borrow + Eq + Hash, ++ V: ToValue, ++ S: BuildHasher, ++ { ++ fn visit<'kvs>(&'kvs self, visitor: &mut dyn VisitSource<'kvs>) -> Result<(), Error> { ++ for (key, value) in self { ++ visitor.visit_pair(key.to_key(), value.to_value())?; ++ } ++ Ok(()) ++ } ++ ++ fn get(&self, key: Key) -> Option> { ++ HashMap::get(self, key.as_str()).map(|v| v.to_value()) ++ } ++ ++ fn count(&self) -> usize { ++ self.len() ++ } ++ } ++ ++ impl Source for BTreeMap ++ where ++ K: ToKey + Borrow + Ord, ++ V: ToValue, ++ { ++ fn visit<'kvs>(&'kvs self, visitor: &mut dyn VisitSource<'kvs>) -> Result<(), Error> { ++ for (key, value) in self { ++ visitor.visit_pair(key.to_key(), value.to_value())?; ++ } ++ Ok(()) ++ } ++ ++ fn get(&self, key: Key) -> Option> { ++ BTreeMap::get(self, key.as_str()).map(|v| v.to_value()) ++ } ++ ++ fn count(&self) -> usize { ++ self.len() ++ } ++ } ++ ++ #[cfg(test)] ++ mod tests { ++ use crate::kv::value; ++ ++ use super::*; ++ ++ #[test] ++ fn count() { ++ assert_eq!(1, Source::count(&Box::new(("a", 1)))); ++ assert_eq!(2, Source::count(&vec![("a", 1), ("b", 2)])); ++ } ++ ++ #[test] ++ fn get() { ++ let source = vec![("a", 1), ("b", 2), ("a", 1)]; ++ assert_eq!( ++ value::inner::Token::I64(1), ++ Source::get(&source, Key::from_str("a")).unwrap().to_token() ++ ); ++ ++ let source = Box::new(None::<(&str, i32)>); ++ assert!(Source::get(&source, Key::from_str("a")).is_none()); ++ } ++ ++ #[test] ++ fn hash_map() { ++ let mut map = HashMap::new(); ++ map.insert("a", 1); ++ map.insert("b", 2); ++ ++ assert_eq!(2, Source::count(&map)); ++ assert_eq!( ++ value::inner::Token::I64(1), ++ Source::get(&map, Key::from_str("a")).unwrap().to_token() ++ ); ++ } ++ ++ #[test] ++ fn btree_map() { ++ let mut map = BTreeMap::new(); ++ map.insert("a", 1); ++ map.insert("b", 2); ++ ++ assert_eq!(2, Source::count(&map)); ++ assert_eq!( ++ value::inner::Token::I64(1), ++ Source::get(&map, Key::from_str("a")).unwrap().to_token() ++ ); ++ } ++ } ++} ++ ++// NOTE: Deprecated; but aliases can't carry this attribute ++#[cfg(feature = "kv_unstable")] ++pub use VisitSource as Visitor; ++ ++#[cfg(test)] ++mod tests { ++ use crate::kv::value; ++ ++ use super::*; ++ ++ #[test] ++ fn source_is_object_safe() { ++ fn _check(_: &dyn Source) {} ++ } ++ ++ #[test] ++ fn visitor_is_object_safe() { ++ fn _check(_: &dyn VisitSource) {} ++ } ++ ++ #[test] ++ fn count() { ++ struct OnePair { ++ key: &'static str, ++ value: i32, ++ } ++ ++ impl Source for OnePair { ++ fn visit<'kvs>(&'kvs self, visitor: &mut dyn VisitSource<'kvs>) -> Result<(), Error> { ++ visitor.visit_pair(self.key.to_key(), self.value.to_value()) ++ } ++ } ++ ++ assert_eq!(1, Source::count(&("a", 1))); ++ assert_eq!(2, Source::count(&[("a", 1), ("b", 2)] as &[_])); ++ assert_eq!(0, Source::count(&None::<(&str, i32)>)); ++ assert_eq!(1, Source::count(&OnePair { key: "a", value: 1 })); ++ } ++ ++ #[test] ++ fn get() { ++ let source = &[("a", 1), ("b", 2), ("a", 1)] as &[_]; ++ assert_eq!( ++ value::inner::Token::I64(1), ++ Source::get(source, Key::from_str("a")).unwrap().to_token() ++ ); ++ assert_eq!( ++ value::inner::Token::I64(2), ++ Source::get(source, Key::from_str("b")).unwrap().to_token() ++ ); ++ assert!(Source::get(&source, Key::from_str("c")).is_none()); ++ ++ let source = None::<(&str, i32)>; ++ assert!(Source::get(&source, Key::from_str("a")).is_none()); ++ } ++} +diff -Nru mesa-25.3.3/subprojects/log-0.4.26/src/kv/value.rs mesa-25.3.3/subprojects/log-0.4.26/src/kv/value.rs +--- mesa-25.3.3/subprojects/log-0.4.26/src/kv/value.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/log-0.4.26/src/kv/value.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,1395 @@ ++//! Structured values. ++//! ++//! This module defines the [`Value`] type and supporting APIs for ++//! capturing and serializing them. ++ ++use std::fmt; ++ ++pub use crate::kv::Error; ++ ++/// A type that can be converted into a [`Value`](struct.Value.html). ++pub trait ToValue { ++ /// Perform the conversion. ++ fn to_value(&self) -> Value; ++} ++ ++impl<'a, T> ToValue for &'a T ++where ++ T: ToValue + ?Sized, ++{ ++ fn to_value(&self) -> Value { ++ (**self).to_value() ++ } ++} ++ ++impl<'v> ToValue for Value<'v> { ++ fn to_value(&self) -> Value { ++ Value { ++ inner: self.inner.clone(), ++ } ++ } ++} ++ ++/// A value in a key-value. ++/// ++/// Values are an anonymous bag containing some structured datum. ++/// ++/// # Capturing values ++/// ++/// There are a few ways to capture a value: ++/// ++/// - Using the `Value::from_*` methods. ++/// - Using the `ToValue` trait. ++/// - Using the standard `From` trait. ++/// ++/// ## Using the `Value::from_*` methods ++/// ++/// `Value` offers a few constructor methods that capture values of different kinds. ++/// ++/// ``` ++/// use log::kv::Value; ++/// ++/// let value = Value::from_debug(&42i32); ++/// ++/// assert_eq!(None, value.to_i64()); ++/// ``` ++/// ++/// ## Using the `ToValue` trait ++/// ++/// The `ToValue` trait can be used to capture values generically. ++/// It's the bound used by `Source`. ++/// ++/// ``` ++/// # use log::kv::ToValue; ++/// let value = 42i32.to_value(); ++/// ++/// assert_eq!(Some(42), value.to_i64()); ++/// ``` ++/// ++/// ## Using the standard `From` trait ++/// ++/// Standard types that implement `ToValue` also implement `From`. ++/// ++/// ``` ++/// use log::kv::Value; ++/// ++/// let value = Value::from(42i32); ++/// ++/// assert_eq!(Some(42), value.to_i64()); ++/// ``` ++/// ++/// # Data model ++/// ++/// Values can hold one of a number of types: ++/// ++/// - **Null:** The absence of any other meaningful value. Note that ++/// `Some(Value::null())` is not the same as `None`. The former is ++/// `null` while the latter is `undefined`. This is important to be ++/// able to tell the difference between a key-value that was logged, ++/// but its value was empty (`Some(Value::null())`) and a key-value ++/// that was never logged at all (`None`). ++/// - **Strings:** `str`, `char`. ++/// - **Booleans:** `bool`. ++/// - **Integers:** `u8`-`u128`, `i8`-`i128`, `NonZero*`. ++/// - **Floating point numbers:** `f32`-`f64`. ++/// - **Errors:** `dyn (Error + 'static)`. ++/// - **`serde`:** Any type in `serde`'s data model. ++/// - **`sval`:** Any type in `sval`'s data model. ++/// ++/// # Serialization ++/// ++/// Values provide a number of ways to be serialized. ++/// ++/// For basic types the [`Value::visit`] method can be used to extract the ++/// underlying typed value. However, this is limited in the amount of types ++/// supported (see the [`VisitValue`] trait methods). ++/// ++/// For more complex types one of the following traits can be used: ++/// * `sval::Value`, requires the `kv_sval` feature. ++/// * `serde::Serialize`, requires the `kv_serde` feature. ++/// ++/// You don't need a visitor to serialize values through `serde` or `sval`. ++/// ++/// A value can always be serialized using any supported framework, regardless ++/// of how it was captured. If, for example, a value was captured using its ++/// `Display` implementation, it will serialize through `serde` as a string. If it was ++/// captured as a struct using `serde`, it will also serialize as a struct ++/// through `sval`, or can be formatted using a `Debug`-compatible representation. ++#[derive(Clone)] ++pub struct Value<'v> { ++ inner: inner::Inner<'v>, ++} ++ ++impl<'v> Value<'v> { ++ /// Get a value from a type implementing `ToValue`. ++ pub fn from_any(value: &'v T) -> Self ++ where ++ T: ToValue, ++ { ++ value.to_value() ++ } ++ ++ /// Get a value from a type implementing `std::fmt::Debug`. ++ pub fn from_debug(value: &'v T) -> Self ++ where ++ T: fmt::Debug, ++ { ++ Value { ++ inner: inner::Inner::from_debug(value), ++ } ++ } ++ ++ /// Get a value from a type implementing `std::fmt::Display`. ++ pub fn from_display(value: &'v T) -> Self ++ where ++ T: fmt::Display, ++ { ++ Value { ++ inner: inner::Inner::from_display(value), ++ } ++ } ++ ++ /// Get a value from a type implementing `serde::Serialize`. ++ #[cfg(feature = "kv_serde")] ++ pub fn from_serde(value: &'v T) -> Self ++ where ++ T: serde::Serialize, ++ { ++ Value { ++ inner: inner::Inner::from_serde1(value), ++ } ++ } ++ ++ /// Get a value from a type implementing `sval::Value`. ++ #[cfg(feature = "kv_sval")] ++ pub fn from_sval(value: &'v T) -> Self ++ where ++ T: sval::Value, ++ { ++ Value { ++ inner: inner::Inner::from_sval2(value), ++ } ++ } ++ ++ /// Get a value from a dynamic `std::fmt::Debug`. ++ pub fn from_dyn_debug(value: &'v dyn fmt::Debug) -> Self { ++ Value { ++ inner: inner::Inner::from_dyn_debug(value), ++ } ++ } ++ ++ /// Get a value from a dynamic `std::fmt::Display`. ++ pub fn from_dyn_display(value: &'v dyn fmt::Display) -> Self { ++ Value { ++ inner: inner::Inner::from_dyn_display(value), ++ } ++ } ++ ++ /// Get a value from a dynamic error. ++ #[cfg(feature = "kv_std")] ++ pub fn from_dyn_error(err: &'v (dyn std::error::Error + 'static)) -> Self { ++ Value { ++ inner: inner::Inner::from_dyn_error(err), ++ } ++ } ++ ++ /// Get a `null` value. ++ pub fn null() -> Self { ++ Value { ++ inner: inner::Inner::empty(), ++ } ++ } ++ ++ /// Get a value from an internal primitive. ++ fn from_inner(value: T) -> Self ++ where ++ T: Into>, ++ { ++ Value { ++ inner: value.into(), ++ } ++ } ++ ++ /// Inspect this value using a simple visitor. ++ /// ++ /// When the `kv_serde` or `kv_sval` features are enabled, you can also ++ /// serialize a value using its `Serialize` or `Value` implementation. ++ pub fn visit(&self, visitor: impl VisitValue<'v>) -> Result<(), Error> { ++ inner::visit(&self.inner, visitor) ++ } ++} ++ ++impl<'v> fmt::Debug for Value<'v> { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ fmt::Debug::fmt(&self.inner, f) ++ } ++} ++ ++impl<'v> fmt::Display for Value<'v> { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ fmt::Display::fmt(&self.inner, f) ++ } ++} ++ ++#[cfg(feature = "kv_serde")] ++impl<'v> serde::Serialize for Value<'v> { ++ fn serialize(&self, s: S) -> Result ++ where ++ S: serde::Serializer, ++ { ++ self.inner.serialize(s) ++ } ++} ++ ++#[cfg(feature = "kv_sval")] ++impl<'v> sval::Value for Value<'v> { ++ fn stream<'sval, S: sval::Stream<'sval> + ?Sized>(&'sval self, stream: &mut S) -> sval::Result { ++ sval::Value::stream(&self.inner, stream) ++ } ++} ++ ++#[cfg(feature = "kv_sval")] ++impl<'v> sval_ref::ValueRef<'v> for Value<'v> { ++ fn stream_ref + ?Sized>(&self, stream: &mut S) -> sval::Result { ++ sval_ref::ValueRef::stream_ref(&self.inner, stream) ++ } ++} ++ ++impl ToValue for str { ++ fn to_value(&self) -> Value { ++ Value::from(self) ++ } ++} ++ ++impl<'v> From<&'v str> for Value<'v> { ++ fn from(value: &'v str) -> Self { ++ Value::from_inner(value) ++ } ++} ++ ++impl ToValue for () { ++ fn to_value(&self) -> Value { ++ Value::from_inner(()) ++ } ++} ++ ++impl ToValue for Option ++where ++ T: ToValue, ++{ ++ fn to_value(&self) -> Value { ++ match *self { ++ Some(ref value) => value.to_value(), ++ None => Value::from_inner(()), ++ } ++ } ++} ++ ++macro_rules! impl_to_value_primitive { ++ ($($into_ty:ty,)*) => { ++ $( ++ impl ToValue for $into_ty { ++ fn to_value(&self) -> Value { ++ Value::from(*self) ++ } ++ } ++ ++ impl<'v> From<$into_ty> for Value<'v> { ++ fn from(value: $into_ty) -> Self { ++ Value::from_inner(value) ++ } ++ } ++ ++ impl<'v> From<&'v $into_ty> for Value<'v> { ++ fn from(value: &'v $into_ty) -> Self { ++ Value::from_inner(*value) ++ } ++ } ++ )* ++ }; ++} ++ ++macro_rules! impl_to_value_nonzero_primitive { ++ ($($into_ty:ident,)*) => { ++ $( ++ impl ToValue for std::num::$into_ty { ++ fn to_value(&self) -> Value { ++ Value::from(self.get()) ++ } ++ } ++ ++ impl<'v> From for Value<'v> { ++ fn from(value: std::num::$into_ty) -> Self { ++ Value::from(value.get()) ++ } ++ } ++ ++ impl<'v> From<&'v std::num::$into_ty> for Value<'v> { ++ fn from(value: &'v std::num::$into_ty) -> Self { ++ Value::from(value.get()) ++ } ++ } ++ )* ++ }; ++} ++ ++macro_rules! impl_value_to_primitive { ++ ($(#[doc = $doc:tt] $into_name:ident -> $into_ty:ty,)*) => { ++ impl<'v> Value<'v> { ++ $( ++ #[doc = $doc] ++ pub fn $into_name(&self) -> Option<$into_ty> { ++ self.inner.$into_name() ++ } ++ )* ++ } ++ } ++} ++ ++impl_to_value_primitive![ ++ usize, u8, u16, u32, u64, u128, isize, i8, i16, i32, i64, i128, f32, f64, char, bool, ++]; ++ ++#[rustfmt::skip] ++impl_to_value_nonzero_primitive![ ++ NonZeroUsize, NonZeroU8, NonZeroU16, NonZeroU32, NonZeroU64, NonZeroU128, ++ NonZeroIsize, NonZeroI8, NonZeroI16, NonZeroI32, NonZeroI64, NonZeroI128, ++]; ++ ++impl_value_to_primitive![ ++ #[doc = "Try convert this value into a `u64`."] ++ to_u64 -> u64, ++ #[doc = "Try convert this value into a `i64`."] ++ to_i64 -> i64, ++ #[doc = "Try convert this value into a `u128`."] ++ to_u128 -> u128, ++ #[doc = "Try convert this value into a `i128`."] ++ to_i128 -> i128, ++ #[doc = "Try convert this value into a `f64`."] ++ to_f64 -> f64, ++ #[doc = "Try convert this value into a `char`."] ++ to_char -> char, ++ #[doc = "Try convert this value into a `bool`."] ++ to_bool -> bool, ++]; ++ ++impl<'v> Value<'v> { ++ /// Try to convert this value into an error. ++ #[cfg(feature = "kv_std")] ++ pub fn to_borrowed_error(&self) -> Option<&(dyn std::error::Error + 'static)> { ++ self.inner.to_borrowed_error() ++ } ++ ++ /// Try to convert this value into a borrowed string. ++ pub fn to_borrowed_str(&self) -> Option<&'v str> { ++ self.inner.to_borrowed_str() ++ } ++} ++ ++#[cfg(feature = "kv_std")] ++mod std_support { ++ use std::borrow::Cow; ++ use std::rc::Rc; ++ use std::sync::Arc; ++ ++ use super::*; ++ ++ impl ToValue for Box ++ where ++ T: ToValue + ?Sized, ++ { ++ fn to_value(&self) -> Value { ++ (**self).to_value() ++ } ++ } ++ ++ impl ToValue for Arc ++ where ++ T: ToValue + ?Sized, ++ { ++ fn to_value(&self) -> Value { ++ (**self).to_value() ++ } ++ } ++ ++ impl ToValue for Rc ++ where ++ T: ToValue + ?Sized, ++ { ++ fn to_value(&self) -> Value { ++ (**self).to_value() ++ } ++ } ++ ++ impl ToValue for String { ++ fn to_value(&self) -> Value { ++ Value::from(&**self) ++ } ++ } ++ ++ impl<'v> ToValue for Cow<'v, str> { ++ fn to_value(&self) -> Value { ++ Value::from(&**self) ++ } ++ } ++ ++ impl<'v> Value<'v> { ++ /// Try convert this value into a string. ++ pub fn to_cow_str(&self) -> Option> { ++ self.inner.to_str() ++ } ++ } ++ ++ impl<'v> From<&'v String> for Value<'v> { ++ fn from(v: &'v String) -> Self { ++ Value::from(&**v) ++ } ++ } ++} ++ ++/// A visitor for a [`Value`]. ++/// ++/// Also see [`Value`'s documentation on seralization]. Value visitors are a simple alternative ++/// to a more fully-featured serialization framework like `serde` or `sval`. A value visitor ++/// can differentiate primitive types through methods like [`VisitValue::visit_bool`] and ++/// [`VisitValue::visit_str`], but more complex types like maps and sequences ++/// will fallthrough to [`VisitValue::visit_any`]. ++/// ++/// If you're trying to serialize a value to a format like JSON, you can use either `serde` ++/// or `sval` directly with the value. You don't need a visitor. ++/// ++/// [`Value`'s documentation on seralization]: Value#serialization ++pub trait VisitValue<'v> { ++ /// Visit a `Value`. ++ /// ++ /// This is the only required method on `VisitValue` and acts as a fallback for any ++ /// more specific methods that aren't overridden. ++ /// The `Value` may be formatted using its `fmt::Debug` or `fmt::Display` implementation, ++ /// or serialized using its `sval::Value` or `serde::Serialize` implementation. ++ fn visit_any(&mut self, value: Value) -> Result<(), Error>; ++ ++ /// Visit an empty value. ++ fn visit_null(&mut self) -> Result<(), Error> { ++ self.visit_any(Value::null()) ++ } ++ ++ /// Visit an unsigned integer. ++ fn visit_u64(&mut self, value: u64) -> Result<(), Error> { ++ self.visit_any(value.into()) ++ } ++ ++ /// Visit a signed integer. ++ fn visit_i64(&mut self, value: i64) -> Result<(), Error> { ++ self.visit_any(value.into()) ++ } ++ ++ /// Visit a big unsigned integer. ++ fn visit_u128(&mut self, value: u128) -> Result<(), Error> { ++ self.visit_any((value).into()) ++ } ++ ++ /// Visit a big signed integer. ++ fn visit_i128(&mut self, value: i128) -> Result<(), Error> { ++ self.visit_any((value).into()) ++ } ++ ++ /// Visit a floating point. ++ fn visit_f64(&mut self, value: f64) -> Result<(), Error> { ++ self.visit_any(value.into()) ++ } ++ ++ /// Visit a boolean. ++ fn visit_bool(&mut self, value: bool) -> Result<(), Error> { ++ self.visit_any(value.into()) ++ } ++ ++ /// Visit a string. ++ fn visit_str(&mut self, value: &str) -> Result<(), Error> { ++ self.visit_any(value.into()) ++ } ++ ++ /// Visit a string. ++ fn visit_borrowed_str(&mut self, value: &'v str) -> Result<(), Error> { ++ self.visit_str(value) ++ } ++ ++ /// Visit a Unicode character. ++ fn visit_char(&mut self, value: char) -> Result<(), Error> { ++ let mut b = [0; 4]; ++ self.visit_str(&*value.encode_utf8(&mut b)) ++ } ++ ++ /// Visit an error. ++ #[cfg(feature = "kv_std")] ++ fn visit_error(&mut self, err: &(dyn std::error::Error + 'static)) -> Result<(), Error> { ++ self.visit_any(Value::from_dyn_error(err)) ++ } ++ ++ /// Visit an error. ++ #[cfg(feature = "kv_std")] ++ fn visit_borrowed_error( ++ &mut self, ++ err: &'v (dyn std::error::Error + 'static), ++ ) -> Result<(), Error> { ++ self.visit_any(Value::from_dyn_error(err)) ++ } ++} ++ ++impl<'a, 'v, T: ?Sized> VisitValue<'v> for &'a mut T ++where ++ T: VisitValue<'v>, ++{ ++ fn visit_any(&mut self, value: Value) -> Result<(), Error> { ++ (**self).visit_any(value) ++ } ++ ++ fn visit_null(&mut self) -> Result<(), Error> { ++ (**self).visit_null() ++ } ++ ++ fn visit_u64(&mut self, value: u64) -> Result<(), Error> { ++ (**self).visit_u64(value) ++ } ++ ++ fn visit_i64(&mut self, value: i64) -> Result<(), Error> { ++ (**self).visit_i64(value) ++ } ++ ++ fn visit_u128(&mut self, value: u128) -> Result<(), Error> { ++ (**self).visit_u128(value) ++ } ++ ++ fn visit_i128(&mut self, value: i128) -> Result<(), Error> { ++ (**self).visit_i128(value) ++ } ++ ++ fn visit_f64(&mut self, value: f64) -> Result<(), Error> { ++ (**self).visit_f64(value) ++ } ++ ++ fn visit_bool(&mut self, value: bool) -> Result<(), Error> { ++ (**self).visit_bool(value) ++ } ++ ++ fn visit_str(&mut self, value: &str) -> Result<(), Error> { ++ (**self).visit_str(value) ++ } ++ ++ fn visit_borrowed_str(&mut self, value: &'v str) -> Result<(), Error> { ++ (**self).visit_borrowed_str(value) ++ } ++ ++ fn visit_char(&mut self, value: char) -> Result<(), Error> { ++ (**self).visit_char(value) ++ } ++ ++ #[cfg(feature = "kv_std")] ++ fn visit_error(&mut self, err: &(dyn std::error::Error + 'static)) -> Result<(), Error> { ++ (**self).visit_error(err) ++ } ++ ++ #[cfg(feature = "kv_std")] ++ fn visit_borrowed_error( ++ &mut self, ++ err: &'v (dyn std::error::Error + 'static), ++ ) -> Result<(), Error> { ++ (**self).visit_borrowed_error(err) ++ } ++} ++ ++#[cfg(feature = "value-bag")] ++pub(in crate::kv) mod inner { ++ /** ++ An implementation of `Value` based on a library called `value_bag`. ++ ++ `value_bag` was written specifically for use in `log`'s value, but was split out when it outgrew ++ the codebase here. It's a general-purpose type-erasure library that handles mapping between ++ more fully-featured serialization frameworks. ++ */ ++ use super::*; ++ ++ pub use value_bag::ValueBag as Inner; ++ ++ pub use value_bag::Error; ++ ++ #[cfg(test)] ++ pub use value_bag::test::TestToken as Token; ++ ++ pub fn visit<'v>( ++ inner: &Inner<'v>, ++ visitor: impl VisitValue<'v>, ++ ) -> Result<(), crate::kv::Error> { ++ struct InnerVisitValue(V); ++ ++ impl<'v, V> value_bag::visit::Visit<'v> for InnerVisitValue ++ where ++ V: VisitValue<'v>, ++ { ++ fn visit_any(&mut self, value: value_bag::ValueBag) -> Result<(), Error> { ++ self.0 ++ .visit_any(Value { inner: value }) ++ .map_err(crate::kv::Error::into_value) ++ } ++ ++ fn visit_empty(&mut self) -> Result<(), Error> { ++ self.0.visit_null().map_err(crate::kv::Error::into_value) ++ } ++ ++ fn visit_u64(&mut self, value: u64) -> Result<(), Error> { ++ self.0 ++ .visit_u64(value) ++ .map_err(crate::kv::Error::into_value) ++ } ++ ++ fn visit_i64(&mut self, value: i64) -> Result<(), Error> { ++ self.0 ++ .visit_i64(value) ++ .map_err(crate::kv::Error::into_value) ++ } ++ ++ fn visit_u128(&mut self, value: u128) -> Result<(), Error> { ++ self.0 ++ .visit_u128(value) ++ .map_err(crate::kv::Error::into_value) ++ } ++ ++ fn visit_i128(&mut self, value: i128) -> Result<(), Error> { ++ self.0 ++ .visit_i128(value) ++ .map_err(crate::kv::Error::into_value) ++ } ++ ++ fn visit_f64(&mut self, value: f64) -> Result<(), Error> { ++ self.0 ++ .visit_f64(value) ++ .map_err(crate::kv::Error::into_value) ++ } ++ ++ fn visit_bool(&mut self, value: bool) -> Result<(), Error> { ++ self.0 ++ .visit_bool(value) ++ .map_err(crate::kv::Error::into_value) ++ } ++ ++ fn visit_str(&mut self, value: &str) -> Result<(), Error> { ++ self.0 ++ .visit_str(value) ++ .map_err(crate::kv::Error::into_value) ++ } ++ ++ fn visit_borrowed_str(&mut self, value: &'v str) -> Result<(), Error> { ++ self.0 ++ .visit_borrowed_str(value) ++ .map_err(crate::kv::Error::into_value) ++ } ++ ++ fn visit_char(&mut self, value: char) -> Result<(), Error> { ++ self.0 ++ .visit_char(value) ++ .map_err(crate::kv::Error::into_value) ++ } ++ ++ #[cfg(feature = "kv_std")] ++ fn visit_error( ++ &mut self, ++ err: &(dyn std::error::Error + 'static), ++ ) -> Result<(), Error> { ++ self.0 ++ .visit_error(err) ++ .map_err(crate::kv::Error::into_value) ++ } ++ ++ #[cfg(feature = "kv_std")] ++ fn visit_borrowed_error( ++ &mut self, ++ err: &'v (dyn std::error::Error + 'static), ++ ) -> Result<(), Error> { ++ self.0 ++ .visit_borrowed_error(err) ++ .map_err(crate::kv::Error::into_value) ++ } ++ } ++ ++ inner ++ .visit(&mut InnerVisitValue(visitor)) ++ .map_err(crate::kv::Error::from_value) ++ } ++} ++ ++#[cfg(not(feature = "value-bag"))] ++pub(in crate::kv) mod inner { ++ /** ++ This is a dependency-free implementation of `Value` when there's no serialization frameworks involved. ++ In these simple cases a more fully featured solution like `value_bag` isn't needed, so we avoid pulling it in. ++ ++ There are a few things here that need to remain consistent with the `value_bag`-based implementation: ++ ++ 1. Conversions should always produce the same results. If a conversion here returns `Some`, then ++ the same `value_bag`-based conversion must also. Of particular note here are floats to ints; they're ++ based on the standard library's `TryInto` conversions, which need to be converted to `i32` or `u32`, ++ and then to `f64`. ++ 2. VisitValues should always be called in the same way. If a particular type of value calls `visit_i64`, ++ then the same `value_bag`-based visitor must also. ++ */ ++ use super::*; ++ ++ #[derive(Clone)] ++ pub enum Inner<'v> { ++ None, ++ Bool(bool), ++ Str(&'v str), ++ Char(char), ++ I64(i64), ++ U64(u64), ++ F64(f64), ++ I128(i128), ++ U128(u128), ++ Debug(&'v dyn fmt::Debug), ++ Display(&'v dyn fmt::Display), ++ } ++ ++ impl<'v> From<()> for Inner<'v> { ++ fn from(_: ()) -> Self { ++ Inner::None ++ } ++ } ++ ++ impl<'v> From for Inner<'v> { ++ fn from(v: bool) -> Self { ++ Inner::Bool(v) ++ } ++ } ++ ++ impl<'v> From for Inner<'v> { ++ fn from(v: char) -> Self { ++ Inner::Char(v) ++ } ++ } ++ ++ impl<'v> From for Inner<'v> { ++ fn from(v: f32) -> Self { ++ Inner::F64(v as f64) ++ } ++ } ++ ++ impl<'v> From for Inner<'v> { ++ fn from(v: f64) -> Self { ++ Inner::F64(v) ++ } ++ } ++ ++ impl<'v> From for Inner<'v> { ++ fn from(v: i8) -> Self { ++ Inner::I64(v as i64) ++ } ++ } ++ ++ impl<'v> From for Inner<'v> { ++ fn from(v: i16) -> Self { ++ Inner::I64(v as i64) ++ } ++ } ++ ++ impl<'v> From for Inner<'v> { ++ fn from(v: i32) -> Self { ++ Inner::I64(v as i64) ++ } ++ } ++ ++ impl<'v> From for Inner<'v> { ++ fn from(v: i64) -> Self { ++ Inner::I64(v as i64) ++ } ++ } ++ ++ impl<'v> From for Inner<'v> { ++ fn from(v: isize) -> Self { ++ Inner::I64(v as i64) ++ } ++ } ++ ++ impl<'v> From for Inner<'v> { ++ fn from(v: u8) -> Self { ++ Inner::U64(v as u64) ++ } ++ } ++ ++ impl<'v> From for Inner<'v> { ++ fn from(v: u16) -> Self { ++ Inner::U64(v as u64) ++ } ++ } ++ ++ impl<'v> From for Inner<'v> { ++ fn from(v: u32) -> Self { ++ Inner::U64(v as u64) ++ } ++ } ++ ++ impl<'v> From for Inner<'v> { ++ fn from(v: u64) -> Self { ++ Inner::U64(v as u64) ++ } ++ } ++ ++ impl<'v> From for Inner<'v> { ++ fn from(v: usize) -> Self { ++ Inner::U64(v as u64) ++ } ++ } ++ ++ impl<'v> From for Inner<'v> { ++ fn from(v: i128) -> Self { ++ Inner::I128(v) ++ } ++ } ++ ++ impl<'v> From for Inner<'v> { ++ fn from(v: u128) -> Self { ++ Inner::U128(v) ++ } ++ } ++ ++ impl<'v> From<&'v str> for Inner<'v> { ++ fn from(v: &'v str) -> Self { ++ Inner::Str(v) ++ } ++ } ++ ++ impl<'v> fmt::Debug for Inner<'v> { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ match self { ++ Inner::None => fmt::Debug::fmt(&None::<()>, f), ++ Inner::Bool(v) => fmt::Debug::fmt(v, f), ++ Inner::Str(v) => fmt::Debug::fmt(v, f), ++ Inner::Char(v) => fmt::Debug::fmt(v, f), ++ Inner::I64(v) => fmt::Debug::fmt(v, f), ++ Inner::U64(v) => fmt::Debug::fmt(v, f), ++ Inner::F64(v) => fmt::Debug::fmt(v, f), ++ Inner::I128(v) => fmt::Debug::fmt(v, f), ++ Inner::U128(v) => fmt::Debug::fmt(v, f), ++ Inner::Debug(v) => fmt::Debug::fmt(v, f), ++ Inner::Display(v) => fmt::Display::fmt(v, f), ++ } ++ } ++ } ++ ++ impl<'v> fmt::Display for Inner<'v> { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ match self { ++ Inner::None => fmt::Debug::fmt(&None::<()>, f), ++ Inner::Bool(v) => fmt::Display::fmt(v, f), ++ Inner::Str(v) => fmt::Display::fmt(v, f), ++ Inner::Char(v) => fmt::Display::fmt(v, f), ++ Inner::I64(v) => fmt::Display::fmt(v, f), ++ Inner::U64(v) => fmt::Display::fmt(v, f), ++ Inner::F64(v) => fmt::Display::fmt(v, f), ++ Inner::I128(v) => fmt::Display::fmt(v, f), ++ Inner::U128(v) => fmt::Display::fmt(v, f), ++ Inner::Debug(v) => fmt::Debug::fmt(v, f), ++ Inner::Display(v) => fmt::Display::fmt(v, f), ++ } ++ } ++ } ++ ++ impl<'v> Inner<'v> { ++ pub fn from_debug(value: &'v T) -> Self { ++ Inner::Debug(value) ++ } ++ ++ pub fn from_display(value: &'v T) -> Self { ++ Inner::Display(value) ++ } ++ ++ pub fn from_dyn_debug(value: &'v dyn fmt::Debug) -> Self { ++ Inner::Debug(value) ++ } ++ ++ pub fn from_dyn_display(value: &'v dyn fmt::Display) -> Self { ++ Inner::Display(value) ++ } ++ ++ pub fn empty() -> Self { ++ Inner::None ++ } ++ ++ pub fn to_bool(&self) -> Option { ++ match self { ++ Inner::Bool(v) => Some(*v), ++ _ => None, ++ } ++ } ++ ++ pub fn to_char(&self) -> Option { ++ match self { ++ Inner::Char(v) => Some(*v), ++ _ => None, ++ } ++ } ++ ++ pub fn to_f64(&self) -> Option { ++ match self { ++ Inner::F64(v) => Some(*v), ++ Inner::I64(v) => { ++ let v: i32 = (*v).try_into().ok()?; ++ v.try_into().ok() ++ } ++ Inner::U64(v) => { ++ let v: u32 = (*v).try_into().ok()?; ++ v.try_into().ok() ++ } ++ Inner::I128(v) => { ++ let v: i32 = (*v).try_into().ok()?; ++ v.try_into().ok() ++ } ++ Inner::U128(v) => { ++ let v: u32 = (*v).try_into().ok()?; ++ v.try_into().ok() ++ } ++ _ => None, ++ } ++ } ++ ++ pub fn to_i64(&self) -> Option { ++ match self { ++ Inner::I64(v) => Some(*v), ++ Inner::U64(v) => (*v).try_into().ok(), ++ Inner::I128(v) => (*v).try_into().ok(), ++ Inner::U128(v) => (*v).try_into().ok(), ++ _ => None, ++ } ++ } ++ ++ pub fn to_u64(&self) -> Option { ++ match self { ++ Inner::U64(v) => Some(*v), ++ Inner::I64(v) => (*v).try_into().ok(), ++ Inner::I128(v) => (*v).try_into().ok(), ++ Inner::U128(v) => (*v).try_into().ok(), ++ _ => None, ++ } ++ } ++ ++ pub fn to_u128(&self) -> Option { ++ match self { ++ Inner::U128(v) => Some(*v), ++ Inner::I64(v) => (*v).try_into().ok(), ++ Inner::U64(v) => (*v).try_into().ok(), ++ Inner::I128(v) => (*v).try_into().ok(), ++ _ => None, ++ } ++ } ++ ++ pub fn to_i128(&self) -> Option { ++ match self { ++ Inner::I128(v) => Some(*v), ++ Inner::I64(v) => (*v).try_into().ok(), ++ Inner::U64(v) => (*v).try_into().ok(), ++ Inner::U128(v) => (*v).try_into().ok(), ++ _ => None, ++ } ++ } ++ ++ pub fn to_borrowed_str(&self) -> Option<&'v str> { ++ match self { ++ Inner::Str(v) => Some(v), ++ _ => None, ++ } ++ } ++ ++ #[cfg(test)] ++ pub fn to_test_token(&self) -> Token { ++ match self { ++ Inner::None => Token::None, ++ Inner::Bool(v) => Token::Bool(*v), ++ Inner::Str(v) => Token::Str(*v), ++ Inner::Char(v) => Token::Char(*v), ++ Inner::I64(v) => Token::I64(*v), ++ Inner::U64(v) => Token::U64(*v), ++ Inner::F64(v) => Token::F64(*v), ++ Inner::I128(_) => unimplemented!(), ++ Inner::U128(_) => unimplemented!(), ++ Inner::Debug(_) => unimplemented!(), ++ Inner::Display(_) => unimplemented!(), ++ } ++ } ++ } ++ ++ #[cfg(test)] ++ #[derive(Debug, PartialEq)] ++ pub enum Token<'v> { ++ None, ++ Bool(bool), ++ Char(char), ++ Str(&'v str), ++ F64(f64), ++ I64(i64), ++ U64(u64), ++ } ++ ++ pub fn visit<'v>( ++ inner: &Inner<'v>, ++ mut visitor: impl VisitValue<'v>, ++ ) -> Result<(), crate::kv::Error> { ++ match inner { ++ Inner::None => visitor.visit_null(), ++ Inner::Bool(v) => visitor.visit_bool(*v), ++ Inner::Str(v) => visitor.visit_borrowed_str(*v), ++ Inner::Char(v) => visitor.visit_char(*v), ++ Inner::I64(v) => visitor.visit_i64(*v), ++ Inner::U64(v) => visitor.visit_u64(*v), ++ Inner::F64(v) => visitor.visit_f64(*v), ++ Inner::I128(v) => visitor.visit_i128(*v), ++ Inner::U128(v) => visitor.visit_u128(*v), ++ Inner::Debug(v) => visitor.visit_any(Value::from_dyn_debug(*v)), ++ Inner::Display(v) => visitor.visit_any(Value::from_dyn_display(*v)), ++ } ++ } ++} ++ ++impl<'v> Value<'v> { ++ /// Get a value from a type implementing `std::fmt::Debug`. ++ #[cfg(feature = "kv_unstable")] ++ #[deprecated(note = "use `from_debug` instead")] ++ pub fn capture_debug(value: &'v T) -> Self ++ where ++ T: fmt::Debug + 'static, ++ { ++ Value::from_debug(value) ++ } ++ ++ /// Get a value from a type implementing `std::fmt::Display`. ++ #[cfg(feature = "kv_unstable")] ++ #[deprecated(note = "use `from_display` instead")] ++ pub fn capture_display(value: &'v T) -> Self ++ where ++ T: fmt::Display + 'static, ++ { ++ Value::from_display(value) ++ } ++ ++ /// Get a value from an error. ++ #[cfg(feature = "kv_unstable_std")] ++ #[deprecated(note = "use `from_dyn_error` instead")] ++ pub fn capture_error(err: &'v T) -> Self ++ where ++ T: std::error::Error + 'static, ++ { ++ Value::from_dyn_error(err) ++ } ++ ++ /// Get a value from a type implementing `serde::Serialize`. ++ #[cfg(feature = "kv_unstable_serde")] ++ #[deprecated(note = "use `from_serde` instead")] ++ pub fn capture_serde(value: &'v T) -> Self ++ where ++ T: serde::Serialize + 'static, ++ { ++ Value::from_serde(value) ++ } ++ ++ /// Get a value from a type implementing `sval::Value`. ++ #[cfg(feature = "kv_unstable_sval")] ++ #[deprecated(note = "use `from_sval` instead")] ++ pub fn capture_sval(value: &'v T) -> Self ++ where ++ T: sval::Value + 'static, ++ { ++ Value::from_sval(value) ++ } ++ ++ /// Check whether this value can be downcast to `T`. ++ #[cfg(feature = "kv_unstable")] ++ #[deprecated( ++ note = "downcasting has been removed; log an issue at https://github.com/rust-lang/log/issues if this is something you rely on" ++ )] ++ pub fn is(&self) -> bool { ++ false ++ } ++ ++ /// Try downcast this value to `T`. ++ #[cfg(feature = "kv_unstable")] ++ #[deprecated( ++ note = "downcasting has been removed; log an issue at https://github.com/rust-lang/log/issues if this is something you rely on" ++ )] ++ pub fn downcast_ref(&self) -> Option<&T> { ++ None ++ } ++} ++ ++// NOTE: Deprecated; but aliases can't carry this attribute ++#[cfg(feature = "kv_unstable")] ++pub use VisitValue as Visit; ++ ++/// Get a value from a type implementing `std::fmt::Debug`. ++#[cfg(feature = "kv_unstable")] ++#[deprecated(note = "use the `key:? = value` macro syntax instead")] ++#[macro_export] ++macro_rules! as_debug { ++ ($capture:expr) => { ++ $crate::kv::Value::from_debug(&$capture) ++ }; ++} ++ ++/// Get a value from a type implementing `std::fmt::Display`. ++#[cfg(feature = "kv_unstable")] ++#[deprecated(note = "use the `key:% = value` macro syntax instead")] ++#[macro_export] ++macro_rules! as_display { ++ ($capture:expr) => { ++ $crate::kv::Value::from_display(&$capture) ++ }; ++} ++ ++/// Get a value from an error. ++#[cfg(feature = "kv_unstable_std")] ++#[deprecated(note = "use the `key:err = value` macro syntax instead")] ++#[macro_export] ++macro_rules! as_error { ++ ($capture:expr) => { ++ $crate::kv::Value::from_dyn_error(&$capture) ++ }; ++} ++ ++#[cfg(feature = "kv_unstable_serde")] ++#[deprecated(note = "use the `key:serde = value` macro syntax instead")] ++/// Get a value from a type implementing `serde::Serialize`. ++#[macro_export] ++macro_rules! as_serde { ++ ($capture:expr) => { ++ $crate::kv::Value::from_serde(&$capture) ++ }; ++} ++ ++/// Get a value from a type implementing `sval::Value`. ++#[cfg(feature = "kv_unstable_sval")] ++#[deprecated(note = "use the `key:sval = value` macro syntax instead")] ++#[macro_export] ++macro_rules! as_sval { ++ ($capture:expr) => { ++ $crate::kv::Value::from_sval(&$capture) ++ }; ++} ++ ++#[cfg(test)] ++pub(crate) mod tests { ++ use super::*; ++ ++ impl<'v> Value<'v> { ++ pub(crate) fn to_token(&self) -> inner::Token { ++ self.inner.to_test_token() ++ } ++ } ++ ++ fn unsigned() -> impl Iterator> { ++ vec![ ++ Value::from(8u8), ++ Value::from(16u16), ++ Value::from(32u32), ++ Value::from(64u64), ++ Value::from(1usize), ++ Value::from(std::num::NonZeroU8::new(8).unwrap()), ++ Value::from(std::num::NonZeroU16::new(16).unwrap()), ++ Value::from(std::num::NonZeroU32::new(32).unwrap()), ++ Value::from(std::num::NonZeroU64::new(64).unwrap()), ++ Value::from(std::num::NonZeroUsize::new(1).unwrap()), ++ ] ++ .into_iter() ++ } ++ ++ fn signed() -> impl Iterator> { ++ vec![ ++ Value::from(-8i8), ++ Value::from(-16i16), ++ Value::from(-32i32), ++ Value::from(-64i64), ++ Value::from(-1isize), ++ Value::from(std::num::NonZeroI8::new(-8).unwrap()), ++ Value::from(std::num::NonZeroI16::new(-16).unwrap()), ++ Value::from(std::num::NonZeroI32::new(-32).unwrap()), ++ Value::from(std::num::NonZeroI64::new(-64).unwrap()), ++ Value::from(std::num::NonZeroIsize::new(-1).unwrap()), ++ ] ++ .into_iter() ++ } ++ ++ fn float() -> impl Iterator> { ++ vec![Value::from(32.32f32), Value::from(64.64f64)].into_iter() ++ } ++ ++ fn bool() -> impl Iterator> { ++ vec![Value::from(true), Value::from(false)].into_iter() ++ } ++ ++ fn str() -> impl Iterator> { ++ vec![Value::from("a string"), Value::from("a loong string")].into_iter() ++ } ++ ++ fn char() -> impl Iterator> { ++ vec![Value::from('a'), Value::from('⛰')].into_iter() ++ } ++ ++ #[test] ++ fn test_to_value_display() { ++ assert_eq!(42u64.to_value().to_string(), "42"); ++ assert_eq!(42i64.to_value().to_string(), "42"); ++ assert_eq!(42.01f64.to_value().to_string(), "42.01"); ++ assert_eq!(true.to_value().to_string(), "true"); ++ assert_eq!('a'.to_value().to_string(), "a"); ++ assert_eq!("a loong string".to_value().to_string(), "a loong string"); ++ assert_eq!(Some(true).to_value().to_string(), "true"); ++ assert_eq!(().to_value().to_string(), "None"); ++ assert_eq!(None::.to_value().to_string(), "None"); ++ } ++ ++ #[test] ++ fn test_to_value_structured() { ++ assert_eq!(42u64.to_value().to_token(), inner::Token::U64(42)); ++ assert_eq!(42i64.to_value().to_token(), inner::Token::I64(42)); ++ assert_eq!(42.01f64.to_value().to_token(), inner::Token::F64(42.01)); ++ assert_eq!(true.to_value().to_token(), inner::Token::Bool(true)); ++ assert_eq!('a'.to_value().to_token(), inner::Token::Char('a')); ++ assert_eq!( ++ "a loong string".to_value().to_token(), ++ inner::Token::Str("a loong string".into()) ++ ); ++ assert_eq!(Some(true).to_value().to_token(), inner::Token::Bool(true)); ++ assert_eq!(().to_value().to_token(), inner::Token::None); ++ assert_eq!(None::.to_value().to_token(), inner::Token::None); ++ } ++ ++ #[test] ++ fn test_to_number() { ++ for v in unsigned() { ++ assert!(v.to_u64().is_some()); ++ assert!(v.to_i64().is_some()); ++ } ++ ++ for v in signed() { ++ assert!(v.to_i64().is_some()); ++ } ++ ++ for v in unsigned().chain(signed()).chain(float()) { ++ assert!(v.to_f64().is_some()); ++ } ++ ++ for v in bool().chain(str()).chain(char()) { ++ assert!(v.to_u64().is_none()); ++ assert!(v.to_i64().is_none()); ++ assert!(v.to_f64().is_none()); ++ } ++ } ++ ++ #[test] ++ fn test_to_float() { ++ // Only integers from i32::MIN..=u32::MAX can be converted into floats ++ assert!(Value::from(i32::MIN).to_f64().is_some()); ++ assert!(Value::from(u32::MAX).to_f64().is_some()); ++ ++ assert!(Value::from((i32::MIN as i64) - 1).to_f64().is_none()); ++ assert!(Value::from((u32::MAX as u64) + 1).to_f64().is_none()); ++ } ++ ++ #[test] ++ fn test_to_cow_str() { ++ for v in str() { ++ assert!(v.to_borrowed_str().is_some()); ++ ++ #[cfg(feature = "kv_std")] ++ assert!(v.to_cow_str().is_some()); ++ } ++ ++ let short_lived = String::from("short lived"); ++ let v = Value::from(&*short_lived); ++ ++ assert!(v.to_borrowed_str().is_some()); ++ ++ #[cfg(feature = "kv_std")] ++ assert!(v.to_cow_str().is_some()); ++ ++ for v in unsigned().chain(signed()).chain(float()).chain(bool()) { ++ assert!(v.to_borrowed_str().is_none()); ++ ++ #[cfg(feature = "kv_std")] ++ assert!(v.to_cow_str().is_none()); ++ } ++ } ++ ++ #[test] ++ fn test_to_bool() { ++ for v in bool() { ++ assert!(v.to_bool().is_some()); ++ } ++ ++ for v in unsigned() ++ .chain(signed()) ++ .chain(float()) ++ .chain(str()) ++ .chain(char()) ++ { ++ assert!(v.to_bool().is_none()); ++ } ++ } ++ ++ #[test] ++ fn test_to_char() { ++ for v in char() { ++ assert!(v.to_char().is_some()); ++ } ++ ++ for v in unsigned() ++ .chain(signed()) ++ .chain(float()) ++ .chain(str()) ++ .chain(bool()) ++ { ++ assert!(v.to_char().is_none()); ++ } ++ } ++ ++ #[test] ++ fn test_visit_integer() { ++ struct Extract(Option); ++ ++ impl<'v> VisitValue<'v> for Extract { ++ fn visit_any(&mut self, value: Value) -> Result<(), Error> { ++ unimplemented!("unexpected value: {value:?}") ++ } ++ ++ fn visit_u64(&mut self, value: u64) -> Result<(), Error> { ++ self.0 = Some(value); ++ ++ Ok(()) ++ } ++ } ++ ++ let mut extract = Extract(None); ++ Value::from(42u64).visit(&mut extract).unwrap(); ++ ++ assert_eq!(Some(42), extract.0); ++ } ++ ++ #[test] ++ fn test_visit_borrowed_str() { ++ struct Extract<'v>(Option<&'v str>); ++ ++ impl<'v> VisitValue<'v> for Extract<'v> { ++ fn visit_any(&mut self, value: Value) -> Result<(), Error> { ++ unimplemented!("unexpected value: {value:?}") ++ } ++ ++ fn visit_borrowed_str(&mut self, value: &'v str) -> Result<(), Error> { ++ self.0 = Some(value); ++ ++ Ok(()) ++ } ++ } ++ ++ let mut extract = Extract(None); ++ ++ let short_lived = String::from("A short-lived string"); ++ Value::from(&*short_lived).visit(&mut extract).unwrap(); ++ ++ assert_eq!(Some("A short-lived string"), extract.0); ++ } ++} +diff -Nru mesa-25.3.3/subprojects/log-0.4.26/src/lib.rs mesa-25.3.3/subprojects/log-0.4.26/src/lib.rs +--- mesa-25.3.3/subprojects/log-0.4.26/src/lib.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/log-0.4.26/src/lib.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,1886 @@ ++// Copyright 2015 The Rust Project Developers. See the COPYRIGHT ++// file at the top-level directory of this distribution and at ++// http://rust-lang.org/COPYRIGHT. ++// ++// Licensed under the Apache License, Version 2.0 or the MIT license ++// , at your ++// option. This file may not be copied, modified, or distributed ++// except according to those terms. ++ ++//! A lightweight logging facade. ++//! ++//! The `log` crate provides a single logging API that abstracts over the ++//! actual logging implementation. Libraries can use the logging API provided ++//! by this crate, and the consumer of those libraries can choose the logging ++//! implementation that is most suitable for its use case. ++//! ++//! If no logging implementation is selected, the facade falls back to a "noop" ++//! implementation that ignores all log messages. The overhead in this case ++//! is very small - just an integer load, comparison and jump. ++//! ++//! A log request consists of a _target_, a _level_, and a _body_. A target is a ++//! string which defaults to the module path of the location of the log request, ++//! though that default may be overridden. Logger implementations typically use ++//! the target to filter requests based on some user configuration. ++//! ++//! # Usage ++//! ++//! The basic use of the log crate is through the five logging macros: [`error!`], ++//! [`warn!`], [`info!`], [`debug!`] and [`trace!`] ++//! where `error!` represents the highest-priority log messages ++//! and `trace!` the lowest. The log messages are filtered by configuring ++//! the log level to exclude messages with a lower priority. ++//! Each of these macros accept format strings similarly to [`println!`]. ++//! ++//! ++//! [`error!`]: ./macro.error.html ++//! [`warn!`]: ./macro.warn.html ++//! [`info!`]: ./macro.info.html ++//! [`debug!`]: ./macro.debug.html ++//! [`trace!`]: ./macro.trace.html ++//! [`println!`]: https://doc.rust-lang.org/stable/std/macro.println.html ++//! ++//! Avoid writing expressions with side-effects in log statements. They may not be evaluated. ++//! ++//! ## In libraries ++//! ++//! Libraries should link only to the `log` crate, and use the provided ++//! macros to log whatever information will be useful to downstream consumers. ++//! ++//! ### Examples ++//! ++//! ``` ++//! # #[derive(Debug)] pub struct Yak(String); ++//! # impl Yak { fn shave(&mut self, _: u32) {} } ++//! # fn find_a_razor() -> Result { Ok(1) } ++//! use log::{info, warn}; ++//! ++//! pub fn shave_the_yak(yak: &mut Yak) { ++//! info!(target: "yak_events", "Commencing yak shaving for {yak:?}"); ++//! ++//! loop { ++//! match find_a_razor() { ++//! Ok(razor) => { ++//! info!("Razor located: {razor}"); ++//! yak.shave(razor); ++//! break; ++//! } ++//! Err(err) => { ++//! warn!("Unable to locate a razor: {err}, retrying"); ++//! } ++//! } ++//! } ++//! } ++//! # fn main() {} ++//! ``` ++//! ++//! ## In executables ++//! ++//! Executables should choose a logging implementation and initialize it early in the ++//! runtime of the program. Logging implementations will typically include a ++//! function to do this. Any log messages generated before ++//! the implementation is initialized will be ignored. ++//! ++//! The executable itself may use the `log` crate to log as well. ++//! ++//! ### Warning ++//! ++//! The logging system may only be initialized once. ++//! ++//! ## Structured logging ++//! ++//! If you enable the `kv` feature you can associate structured values ++//! with your log records. If we take the example from before, we can include ++//! some additional context besides what's in the formatted message: ++//! ++//! ``` ++//! # use serde::Serialize; ++//! # #[derive(Debug, Serialize)] pub struct Yak(String); ++//! # impl Yak { fn shave(&mut self, _: u32) {} } ++//! # fn find_a_razor() -> Result { Ok(1) } ++//! # #[cfg(feature = "kv_serde")] ++//! # fn main() { ++//! use log::{info, warn}; ++//! ++//! pub fn shave_the_yak(yak: &mut Yak) { ++//! info!(target: "yak_events", yak:serde; "Commencing yak shaving"); ++//! ++//! loop { ++//! match find_a_razor() { ++//! Ok(razor) => { ++//! info!(razor; "Razor located"); ++//! yak.shave(razor); ++//! break; ++//! } ++//! Err(e) => { ++//! warn!(e:err; "Unable to locate a razor, retrying"); ++//! } ++//! } ++//! } ++//! } ++//! # } ++//! # #[cfg(not(feature = "kv_serde"))] ++//! # fn main() {} ++//! ``` ++//! ++//! See the [`kv`] module documentation for more details. ++//! ++//! # Available logging implementations ++//! ++//! In order to produce log output executables have to use ++//! a logger implementation compatible with the facade. ++//! There are many available implementations to choose from, ++//! here are some of the most popular ones: ++//! ++//! * Simple minimal loggers: ++//! * [env_logger] ++//! * [colog] ++//! * [simple_logger] ++//! * [simplelog] ++//! * [pretty_env_logger] ++//! * [stderrlog] ++//! * [flexi_logger] ++//! * [call_logger] ++//! * [structured-logger] ++//! * [clang_log] ++//! * [ftail] ++//! * Complex configurable frameworks: ++//! * [log4rs] ++//! * [logforth] ++//! * [fern] ++//! * [spdlog-rs] ++//! * Adaptors for other facilities: ++//! * [syslog] ++//! * [slog-stdlog] ++//! * [systemd-journal-logger] ++//! * [android_log] ++//! * [win_dbg_logger] ++//! * [db_logger] ++//! * [log-to-defmt] ++//! * [logcontrol-log] ++//! * For WebAssembly binaries: ++//! * [console_log] ++//! * For dynamic libraries: ++//! * You may need to construct an FFI-safe wrapper over `log` to initialize in your libraries ++//! * Utilities: ++//! * [log_err] ++//! * [log-reload] ++//! ++//! # Implementing a Logger ++//! ++//! Loggers implement the [`Log`] trait. Here's a very basic example that simply ++//! logs all messages at the [`Error`][level_link], [`Warn`][level_link] or ++//! [`Info`][level_link] levels to stdout: ++//! ++//! ``` ++//! use log::{Record, Level, Metadata}; ++//! ++//! struct SimpleLogger; ++//! ++//! impl log::Log for SimpleLogger { ++//! fn enabled(&self, metadata: &Metadata) -> bool { ++//! metadata.level() <= Level::Info ++//! } ++//! ++//! fn log(&self, record: &Record) { ++//! if self.enabled(record.metadata()) { ++//! println!("{} - {}", record.level(), record.args()); ++//! } ++//! } ++//! ++//! fn flush(&self) {} ++//! } ++//! ++//! # fn main() {} ++//! ``` ++//! ++//! Loggers are installed by calling the [`set_logger`] function. The maximum ++//! log level also needs to be adjusted via the [`set_max_level`] function. The ++//! logging facade uses this as an optimization to improve performance of log ++//! messages at levels that are disabled. It's important to set it, as it ++//! defaults to [`Off`][filter_link], so no log messages will ever be captured! ++//! In the case of our example logger, we'll want to set the maximum log level ++//! to [`Info`][filter_link], since we ignore any [`Debug`][level_link] or ++//! [`Trace`][level_link] level log messages. A logging implementation should ++//! provide a function that wraps a call to [`set_logger`] and ++//! [`set_max_level`], handling initialization of the logger: ++//! ++//! ``` ++//! # use log::{Level, Metadata}; ++//! # struct SimpleLogger; ++//! # impl log::Log for SimpleLogger { ++//! # fn enabled(&self, _: &Metadata) -> bool { false } ++//! # fn log(&self, _: &log::Record) {} ++//! # fn flush(&self) {} ++//! # } ++//! # fn main() {} ++//! use log::{SetLoggerError, LevelFilter}; ++//! ++//! static LOGGER: SimpleLogger = SimpleLogger; ++//! ++//! pub fn init() -> Result<(), SetLoggerError> { ++//! log::set_logger(&LOGGER) ++//! .map(|()| log::set_max_level(LevelFilter::Info)) ++//! } ++//! ``` ++//! ++//! Implementations that adjust their configurations at runtime should take care ++//! to adjust the maximum log level as well. ++//! ++//! # Use with `std` ++//! ++//! `set_logger` requires you to provide a `&'static Log`, which can be hard to ++//! obtain if your logger depends on some runtime configuration. The ++//! `set_boxed_logger` function is available with the `std` Cargo feature. It is ++//! identical to `set_logger` except that it takes a `Box` rather than a ++//! `&'static Log`: ++//! ++//! ``` ++//! # use log::{Level, LevelFilter, Log, SetLoggerError, Metadata}; ++//! # struct SimpleLogger; ++//! # impl log::Log for SimpleLogger { ++//! # fn enabled(&self, _: &Metadata) -> bool { false } ++//! # fn log(&self, _: &log::Record) {} ++//! # fn flush(&self) {} ++//! # } ++//! # fn main() {} ++//! # #[cfg(feature = "std")] ++//! pub fn init() -> Result<(), SetLoggerError> { ++//! log::set_boxed_logger(Box::new(SimpleLogger)) ++//! .map(|()| log::set_max_level(LevelFilter::Info)) ++//! } ++//! ``` ++//! ++//! # Compile time filters ++//! ++//! Log levels can be statically disabled at compile time by enabling one of these Cargo features: ++//! ++//! * `max_level_off` ++//! * `max_level_error` ++//! * `max_level_warn` ++//! * `max_level_info` ++//! * `max_level_debug` ++//! * `max_level_trace` ++//! ++//! Log invocations at disabled levels will be skipped and will not even be present in the ++//! resulting binary. These features control the value of the `STATIC_MAX_LEVEL` constant. The ++//! logging macros check this value before logging a message. By default, no levels are disabled. ++//! ++//! It is possible to override this level for release builds only with the following features: ++//! ++//! * `release_max_level_off` ++//! * `release_max_level_error` ++//! * `release_max_level_warn` ++//! * `release_max_level_info` ++//! * `release_max_level_debug` ++//! * `release_max_level_trace` ++//! ++//! Libraries should avoid using the max level features because they're global and can't be changed ++//! once they're set. ++//! ++//! For example, a crate can disable trace level logs in debug builds and trace, debug, and info ++//! level logs in release builds with the following configuration: ++//! ++//! ```toml ++//! [dependencies] ++//! log = { version = "0.4", features = ["max_level_debug", "release_max_level_warn"] } ++//! ``` ++//! # Crate Feature Flags ++//! ++//! The following crate feature flags are available in addition to the filters. They are ++//! configured in your `Cargo.toml`. ++//! ++//! * `std` allows use of `std` crate instead of the default `core`. Enables using `std::error` and ++//! `set_boxed_logger` functionality. ++//! * `serde` enables support for serialization and deserialization of `Level` and `LevelFilter`. ++//! ++//! ```toml ++//! [dependencies] ++//! log = { version = "0.4", features = ["std", "serde"] } ++//! ``` ++//! ++//! # Version compatibility ++//! ++//! The 0.3 and 0.4 versions of the `log` crate are almost entirely compatible. Log messages ++//! made using `log` 0.3 will forward transparently to a logger implementation using `log` 0.4. Log ++//! messages made using `log` 0.4 will forward to a logger implementation using `log` 0.3, but the ++//! module path and file name information associated with the message will unfortunately be lost. ++//! ++//! [`Log`]: trait.Log.html ++//! [level_link]: enum.Level.html ++//! [filter_link]: enum.LevelFilter.html ++//! [`set_logger`]: fn.set_logger.html ++//! [`set_max_level`]: fn.set_max_level.html ++//! [`try_set_logger_raw`]: fn.try_set_logger_raw.html ++//! [`shutdown_logger_raw`]: fn.shutdown_logger_raw.html ++//! [env_logger]: https://docs.rs/env_logger/*/env_logger/ ++//! [colog]: https://docs.rs/colog/*/colog/ ++//! [simple_logger]: https://github.com/borntyping/rust-simple_logger ++//! [simplelog]: https://github.com/drakulix/simplelog.rs ++//! [pretty_env_logger]: https://docs.rs/pretty_env_logger/*/pretty_env_logger/ ++//! [stderrlog]: https://docs.rs/stderrlog/*/stderrlog/ ++//! [flexi_logger]: https://docs.rs/flexi_logger/*/flexi_logger/ ++//! [call_logger]: https://docs.rs/call_logger/*/call_logger/ ++//! [syslog]: https://docs.rs/syslog/*/syslog/ ++//! [slog-stdlog]: https://docs.rs/slog-stdlog/*/slog_stdlog/ ++//! [log4rs]: https://docs.rs/log4rs/*/log4rs/ ++//! [logforth]: https://docs.rs/logforth/*/logforth/ ++//! [fern]: https://docs.rs/fern/*/fern/ ++//! [spdlog-rs]: https://docs.rs/spdlog-rs/*/spdlog/ ++//! [systemd-journal-logger]: https://docs.rs/systemd-journal-logger/*/systemd_journal_logger/ ++//! [android_log]: https://docs.rs/android_log/*/android_log/ ++//! [win_dbg_logger]: https://docs.rs/win_dbg_logger/*/win_dbg_logger/ ++//! [db_logger]: https://docs.rs/db_logger/*/db_logger/ ++//! [log-to-defmt]: https://docs.rs/log-to-defmt/*/log_to_defmt/ ++//! [console_log]: https://docs.rs/console_log/*/console_log/ ++//! [structured-logger]: https://docs.rs/structured-logger/latest/structured_logger/ ++//! [logcontrol-log]: https://docs.rs/logcontrol-log/*/logcontrol_log/ ++//! [log_err]: https://docs.rs/log_err/*/log_err/ ++//! [log-reload]: https://docs.rs/log-reload/*/log_reload/ ++//! [clang_log]: https://docs.rs/clang_log/latest/clang_log ++//! [ftail]: https://docs.rs/ftail/latest/ftail ++ ++#![doc( ++ html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png", ++ html_favicon_url = "https://www.rust-lang.org/favicon.ico", ++ html_root_url = "https://docs.rs/log/0.4.26" ++)] ++#![warn(missing_docs)] ++#![deny(missing_debug_implementations, unconditional_recursion)] ++#![cfg_attr(all(not(feature = "std"), not(test)), no_std)] ++ ++#[cfg(any( ++ all(feature = "max_level_off", feature = "max_level_error"), ++ all(feature = "max_level_off", feature = "max_level_warn"), ++ all(feature = "max_level_off", feature = "max_level_info"), ++ all(feature = "max_level_off", feature = "max_level_debug"), ++ all(feature = "max_level_off", feature = "max_level_trace"), ++ all(feature = "max_level_error", feature = "max_level_warn"), ++ all(feature = "max_level_error", feature = "max_level_info"), ++ all(feature = "max_level_error", feature = "max_level_debug"), ++ all(feature = "max_level_error", feature = "max_level_trace"), ++ all(feature = "max_level_warn", feature = "max_level_info"), ++ all(feature = "max_level_warn", feature = "max_level_debug"), ++ all(feature = "max_level_warn", feature = "max_level_trace"), ++ all(feature = "max_level_info", feature = "max_level_debug"), ++ all(feature = "max_level_info", feature = "max_level_trace"), ++ all(feature = "max_level_debug", feature = "max_level_trace"), ++))] ++compile_error!("multiple max_level_* features set"); ++ ++#[rustfmt::skip] ++#[cfg(any( ++ all(feature = "release_max_level_off", feature = "release_max_level_error"), ++ all(feature = "release_max_level_off", feature = "release_max_level_warn"), ++ all(feature = "release_max_level_off", feature = "release_max_level_info"), ++ all(feature = "release_max_level_off", feature = "release_max_level_debug"), ++ all(feature = "release_max_level_off", feature = "release_max_level_trace"), ++ all(feature = "release_max_level_error", feature = "release_max_level_warn"), ++ all(feature = "release_max_level_error", feature = "release_max_level_info"), ++ all(feature = "release_max_level_error", feature = "release_max_level_debug"), ++ all(feature = "release_max_level_error", feature = "release_max_level_trace"), ++ all(feature = "release_max_level_warn", feature = "release_max_level_info"), ++ all(feature = "release_max_level_warn", feature = "release_max_level_debug"), ++ all(feature = "release_max_level_warn", feature = "release_max_level_trace"), ++ all(feature = "release_max_level_info", feature = "release_max_level_debug"), ++ all(feature = "release_max_level_info", feature = "release_max_level_trace"), ++ all(feature = "release_max_level_debug", feature = "release_max_level_trace"), ++))] ++compile_error!("multiple release_max_level_* features set"); ++ ++#[cfg(all(not(feature = "std"), not(test)))] ++extern crate core as std; ++ ++use std::cfg; ++#[cfg(feature = "std")] ++use std::error; ++use std::str::FromStr; ++use std::{cmp, fmt, mem}; ++ ++#[macro_use] ++mod macros; ++mod serde; ++ ++#[cfg(feature = "kv")] ++pub mod kv; ++ ++#[cfg(target_has_atomic = "ptr")] ++use std::sync::atomic::{AtomicUsize, Ordering}; ++ ++#[cfg(not(target_has_atomic = "ptr"))] ++use std::cell::Cell; ++#[cfg(not(target_has_atomic = "ptr"))] ++use std::sync::atomic::Ordering; ++ ++#[cfg(not(target_has_atomic = "ptr"))] ++struct AtomicUsize { ++ v: Cell, ++} ++ ++#[cfg(not(target_has_atomic = "ptr"))] ++impl AtomicUsize { ++ const fn new(v: usize) -> AtomicUsize { ++ AtomicUsize { v: Cell::new(v) } ++ } ++ ++ fn load(&self, _order: Ordering) -> usize { ++ self.v.get() ++ } ++ ++ fn store(&self, val: usize, _order: Ordering) { ++ self.v.set(val) ++ } ++ ++ #[cfg(target_has_atomic = "ptr")] ++ fn compare_exchange( ++ &self, ++ current: usize, ++ new: usize, ++ _success: Ordering, ++ _failure: Ordering, ++ ) -> Result { ++ let prev = self.v.get(); ++ if current == prev { ++ self.v.set(new); ++ } ++ Ok(prev) ++ } ++} ++ ++// Any platform without atomics is unlikely to have multiple cores, so ++// writing via Cell will not be a race condition. ++#[cfg(not(target_has_atomic = "ptr"))] ++unsafe impl Sync for AtomicUsize {} ++ ++// The LOGGER static holds a pointer to the global logger. It is protected by ++// the STATE static which determines whether LOGGER has been initialized yet. ++static mut LOGGER: &dyn Log = &NopLogger; ++ ++static STATE: AtomicUsize = AtomicUsize::new(0); ++ ++// There are three different states that we care about: the logger's ++// uninitialized, the logger's initializing (set_logger's been called but ++// LOGGER hasn't actually been set yet), or the logger's active. ++const UNINITIALIZED: usize = 0; ++const INITIALIZING: usize = 1; ++const INITIALIZED: usize = 2; ++ ++static MAX_LOG_LEVEL_FILTER: AtomicUsize = AtomicUsize::new(0); ++ ++static LOG_LEVEL_NAMES: [&str; 6] = ["OFF", "ERROR", "WARN", "INFO", "DEBUG", "TRACE"]; ++ ++static SET_LOGGER_ERROR: &str = "attempted to set a logger after the logging system \ ++ was already initialized"; ++static LEVEL_PARSE_ERROR: &str = ++ "attempted to convert a string that doesn't match an existing log level"; ++ ++/// An enum representing the available verbosity levels of the logger. ++/// ++/// Typical usage includes: checking if a certain `Level` is enabled with ++/// [`log_enabled!`](macro.log_enabled.html), specifying the `Level` of ++/// [`log!`](macro.log.html), and comparing a `Level` directly to a ++/// [`LevelFilter`](enum.LevelFilter.html). ++#[repr(usize)] ++#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)] ++pub enum Level { ++ /// The "error" level. ++ /// ++ /// Designates very serious errors. ++ // This way these line up with the discriminants for LevelFilter below ++ // This works because Rust treats field-less enums the same way as C does: ++ // https://doc.rust-lang.org/reference/items/enumerations.html#custom-discriminant-values-for-field-less-enumerations ++ Error = 1, ++ /// The "warn" level. ++ /// ++ /// Designates hazardous situations. ++ Warn, ++ /// The "info" level. ++ /// ++ /// Designates useful information. ++ Info, ++ /// The "debug" level. ++ /// ++ /// Designates lower priority information. ++ Debug, ++ /// The "trace" level. ++ /// ++ /// Designates very low priority, often extremely verbose, information. ++ Trace, ++} ++ ++impl PartialEq for Level { ++ #[inline] ++ fn eq(&self, other: &LevelFilter) -> bool { ++ *self as usize == *other as usize ++ } ++} ++ ++impl PartialOrd for Level { ++ #[inline] ++ fn partial_cmp(&self, other: &LevelFilter) -> Option { ++ Some((*self as usize).cmp(&(*other as usize))) ++ } ++} ++ ++impl FromStr for Level { ++ type Err = ParseLevelError; ++ fn from_str(level: &str) -> Result { ++ LOG_LEVEL_NAMES ++ .iter() ++ .position(|&name| name.eq_ignore_ascii_case(level)) ++ .into_iter() ++ .filter(|&idx| idx != 0) ++ .map(|idx| Level::from_usize(idx).unwrap()) ++ .next() ++ .ok_or(ParseLevelError(())) ++ } ++} ++ ++impl fmt::Display for Level { ++ fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { ++ fmt.pad(self.as_str()) ++ } ++} ++ ++impl Level { ++ fn from_usize(u: usize) -> Option { ++ match u { ++ 1 => Some(Level::Error), ++ 2 => Some(Level::Warn), ++ 3 => Some(Level::Info), ++ 4 => Some(Level::Debug), ++ 5 => Some(Level::Trace), ++ _ => None, ++ } ++ } ++ ++ /// Returns the most verbose logging level. ++ #[inline] ++ pub fn max() -> Level { ++ Level::Trace ++ } ++ ++ /// Converts the `Level` to the equivalent `LevelFilter`. ++ #[inline] ++ pub fn to_level_filter(&self) -> LevelFilter { ++ LevelFilter::from_usize(*self as usize).unwrap() ++ } ++ ++ /// Returns the string representation of the `Level`. ++ /// ++ /// This returns the same string as the `fmt::Display` implementation. ++ pub fn as_str(&self) -> &'static str { ++ LOG_LEVEL_NAMES[*self as usize] ++ } ++ ++ /// Iterate through all supported logging levels. ++ /// ++ /// The order of iteration is from more severe to less severe log messages. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use log::Level; ++ /// ++ /// let mut levels = Level::iter(); ++ /// ++ /// assert_eq!(Some(Level::Error), levels.next()); ++ /// assert_eq!(Some(Level::Trace), levels.last()); ++ /// ``` ++ pub fn iter() -> impl Iterator { ++ (1..6).map(|i| Self::from_usize(i).unwrap()) ++ } ++} ++ ++/// An enum representing the available verbosity level filters of the logger. ++/// ++/// A `LevelFilter` may be compared directly to a [`Level`]. Use this type ++/// to get and set the maximum log level with [`max_level()`] and [`set_max_level`]. ++/// ++/// [`Level`]: enum.Level.html ++/// [`max_level()`]: fn.max_level.html ++/// [`set_max_level`]: fn.set_max_level.html ++#[repr(usize)] ++#[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug, Hash)] ++pub enum LevelFilter { ++ /// A level lower than all log levels. ++ Off, ++ /// Corresponds to the `Error` log level. ++ Error, ++ /// Corresponds to the `Warn` log level. ++ Warn, ++ /// Corresponds to the `Info` log level. ++ Info, ++ /// Corresponds to the `Debug` log level. ++ Debug, ++ /// Corresponds to the `Trace` log level. ++ Trace, ++} ++ ++impl PartialEq for LevelFilter { ++ #[inline] ++ fn eq(&self, other: &Level) -> bool { ++ other.eq(self) ++ } ++} ++ ++impl PartialOrd for LevelFilter { ++ #[inline] ++ fn partial_cmp(&self, other: &Level) -> Option { ++ Some((*self as usize).cmp(&(*other as usize))) ++ } ++} ++ ++impl FromStr for LevelFilter { ++ type Err = ParseLevelError; ++ fn from_str(level: &str) -> Result { ++ LOG_LEVEL_NAMES ++ .iter() ++ .position(|&name| name.eq_ignore_ascii_case(level)) ++ .map(|p| LevelFilter::from_usize(p).unwrap()) ++ .ok_or(ParseLevelError(())) ++ } ++} ++ ++impl fmt::Display for LevelFilter { ++ fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { ++ fmt.pad(self.as_str()) ++ } ++} ++ ++impl LevelFilter { ++ fn from_usize(u: usize) -> Option { ++ match u { ++ 0 => Some(LevelFilter::Off), ++ 1 => Some(LevelFilter::Error), ++ 2 => Some(LevelFilter::Warn), ++ 3 => Some(LevelFilter::Info), ++ 4 => Some(LevelFilter::Debug), ++ 5 => Some(LevelFilter::Trace), ++ _ => None, ++ } ++ } ++ ++ /// Returns the most verbose logging level filter. ++ #[inline] ++ pub fn max() -> LevelFilter { ++ LevelFilter::Trace ++ } ++ ++ /// Converts `self` to the equivalent `Level`. ++ /// ++ /// Returns `None` if `self` is `LevelFilter::Off`. ++ #[inline] ++ pub fn to_level(&self) -> Option { ++ Level::from_usize(*self as usize) ++ } ++ ++ /// Returns the string representation of the `LevelFilter`. ++ /// ++ /// This returns the same string as the `fmt::Display` implementation. ++ pub fn as_str(&self) -> &'static str { ++ LOG_LEVEL_NAMES[*self as usize] ++ } ++ ++ /// Iterate through all supported filtering levels. ++ /// ++ /// The order of iteration is from less to more verbose filtering. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use log::LevelFilter; ++ /// ++ /// let mut levels = LevelFilter::iter(); ++ /// ++ /// assert_eq!(Some(LevelFilter::Off), levels.next()); ++ /// assert_eq!(Some(LevelFilter::Trace), levels.last()); ++ /// ``` ++ pub fn iter() -> impl Iterator { ++ (0..6).map(|i| Self::from_usize(i).unwrap()) ++ } ++} ++ ++#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)] ++enum MaybeStaticStr<'a> { ++ Static(&'static str), ++ Borrowed(&'a str), ++} ++ ++impl<'a> MaybeStaticStr<'a> { ++ #[inline] ++ fn get(&self) -> &'a str { ++ match *self { ++ MaybeStaticStr::Static(s) => s, ++ MaybeStaticStr::Borrowed(s) => s, ++ } ++ } ++} ++ ++/// The "payload" of a log message. ++/// ++/// # Use ++/// ++/// `Record` structures are passed as parameters to the [`log`][method.log] ++/// method of the [`Log`] trait. Logger implementors manipulate these ++/// structures in order to display log messages. `Record`s are automatically ++/// created by the [`log!`] macro and so are not seen by log users. ++/// ++/// Note that the [`level()`] and [`target()`] accessors are equivalent to ++/// `self.metadata().level()` and `self.metadata().target()` respectively. ++/// These methods are provided as a convenience for users of this structure. ++/// ++/// # Example ++/// ++/// The following example shows a simple logger that displays the level, ++/// module path, and message of any `Record` that is passed to it. ++/// ++/// ``` ++/// struct SimpleLogger; ++/// ++/// impl log::Log for SimpleLogger { ++/// fn enabled(&self, _metadata: &log::Metadata) -> bool { ++/// true ++/// } ++/// ++/// fn log(&self, record: &log::Record) { ++/// if !self.enabled(record.metadata()) { ++/// return; ++/// } ++/// ++/// println!("{}:{} -- {}", ++/// record.level(), ++/// record.target(), ++/// record.args()); ++/// } ++/// fn flush(&self) {} ++/// } ++/// ``` ++/// ++/// [method.log]: trait.Log.html#tymethod.log ++/// [`Log`]: trait.Log.html ++/// [`log!`]: macro.log.html ++/// [`level()`]: struct.Record.html#method.level ++/// [`target()`]: struct.Record.html#method.target ++#[derive(Clone, Debug)] ++pub struct Record<'a> { ++ metadata: Metadata<'a>, ++ args: fmt::Arguments<'a>, ++ module_path: Option>, ++ file: Option>, ++ line: Option, ++ #[cfg(feature = "kv")] ++ key_values: KeyValues<'a>, ++} ++ ++// This wrapper type is only needed so we can ++// `#[derive(Debug)]` on `Record`. It also ++// provides a useful `Debug` implementation for ++// the underlying `Source`. ++#[cfg(feature = "kv")] ++#[derive(Clone)] ++struct KeyValues<'a>(&'a dyn kv::Source); ++ ++#[cfg(feature = "kv")] ++impl<'a> fmt::Debug for KeyValues<'a> { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ let mut visitor = f.debug_map(); ++ self.0.visit(&mut visitor).map_err(|_| fmt::Error)?; ++ visitor.finish() ++ } ++} ++ ++impl<'a> Record<'a> { ++ /// Returns a new builder. ++ #[inline] ++ pub fn builder() -> RecordBuilder<'a> { ++ RecordBuilder::new() ++ } ++ ++ /// The message body. ++ #[inline] ++ pub fn args(&self) -> &fmt::Arguments<'a> { ++ &self.args ++ } ++ ++ /// Metadata about the log directive. ++ #[inline] ++ pub fn metadata(&self) -> &Metadata<'a> { ++ &self.metadata ++ } ++ ++ /// The verbosity level of the message. ++ #[inline] ++ pub fn level(&self) -> Level { ++ self.metadata.level() ++ } ++ ++ /// The name of the target of the directive. ++ #[inline] ++ pub fn target(&self) -> &'a str { ++ self.metadata.target() ++ } ++ ++ /// The module path of the message. ++ #[inline] ++ pub fn module_path(&self) -> Option<&'a str> { ++ self.module_path.map(|s| s.get()) ++ } ++ ++ /// The module path of the message, if it is a `'static` string. ++ #[inline] ++ pub fn module_path_static(&self) -> Option<&'static str> { ++ match self.module_path { ++ Some(MaybeStaticStr::Static(s)) => Some(s), ++ _ => None, ++ } ++ } ++ ++ /// The source file containing the message. ++ #[inline] ++ pub fn file(&self) -> Option<&'a str> { ++ self.file.map(|s| s.get()) ++ } ++ ++ /// The source file containing the message, if it is a `'static` string. ++ #[inline] ++ pub fn file_static(&self) -> Option<&'static str> { ++ match self.file { ++ Some(MaybeStaticStr::Static(s)) => Some(s), ++ _ => None, ++ } ++ } ++ ++ /// The line containing the message. ++ #[inline] ++ pub fn line(&self) -> Option { ++ self.line ++ } ++ ++ /// The structured key-value pairs associated with the message. ++ #[cfg(feature = "kv")] ++ #[inline] ++ pub fn key_values(&self) -> &dyn kv::Source { ++ self.key_values.0 ++ } ++ ++ /// Create a new [`RecordBuilder`](struct.RecordBuilder.html) based on this record. ++ #[cfg(feature = "kv")] ++ #[inline] ++ pub fn to_builder(&self) -> RecordBuilder { ++ RecordBuilder { ++ record: Record { ++ metadata: Metadata { ++ level: self.metadata.level, ++ target: self.metadata.target, ++ }, ++ args: self.args, ++ module_path: self.module_path, ++ file: self.file, ++ line: self.line, ++ key_values: self.key_values.clone(), ++ }, ++ } ++ } ++} ++ ++/// Builder for [`Record`](struct.Record.html). ++/// ++/// Typically should only be used by log library creators or for testing and "shim loggers". ++/// The `RecordBuilder` can set the different parameters of `Record` object, and returns ++/// the created object when `build` is called. ++/// ++/// # Examples ++/// ++/// ``` ++/// use log::{Level, Record}; ++/// ++/// let record = Record::builder() ++/// .args(format_args!("Error!")) ++/// .level(Level::Error) ++/// .target("myApp") ++/// .file(Some("server.rs")) ++/// .line(Some(144)) ++/// .module_path(Some("server")) ++/// .build(); ++/// ``` ++/// ++/// Alternatively, use [`MetadataBuilder`](struct.MetadataBuilder.html): ++/// ++/// ``` ++/// use log::{Record, Level, MetadataBuilder}; ++/// ++/// let error_metadata = MetadataBuilder::new() ++/// .target("myApp") ++/// .level(Level::Error) ++/// .build(); ++/// ++/// let record = Record::builder() ++/// .metadata(error_metadata) ++/// .args(format_args!("Error!")) ++/// .line(Some(433)) ++/// .file(Some("app.rs")) ++/// .module_path(Some("server")) ++/// .build(); ++/// ``` ++#[derive(Debug)] ++pub struct RecordBuilder<'a> { ++ record: Record<'a>, ++} ++ ++impl<'a> RecordBuilder<'a> { ++ /// Construct new `RecordBuilder`. ++ /// ++ /// The default options are: ++ /// ++ /// - `args`: [`format_args!("")`] ++ /// - `metadata`: [`Metadata::builder().build()`] ++ /// - `module_path`: `None` ++ /// - `file`: `None` ++ /// - `line`: `None` ++ /// ++ /// [`format_args!("")`]: https://doc.rust-lang.org/std/macro.format_args.html ++ /// [`Metadata::builder().build()`]: struct.MetadataBuilder.html#method.build ++ #[inline] ++ pub fn new() -> RecordBuilder<'a> { ++ RecordBuilder { ++ record: Record { ++ args: format_args!(""), ++ metadata: Metadata::builder().build(), ++ module_path: None, ++ file: None, ++ line: None, ++ #[cfg(feature = "kv")] ++ key_values: KeyValues(&None::<(kv::Key, kv::Value)>), ++ }, ++ } ++ } ++ ++ /// Set [`args`](struct.Record.html#method.args). ++ #[inline] ++ pub fn args(&mut self, args: fmt::Arguments<'a>) -> &mut RecordBuilder<'a> { ++ self.record.args = args; ++ self ++ } ++ ++ /// Set [`metadata`](struct.Record.html#method.metadata). Construct a `Metadata` object with [`MetadataBuilder`](struct.MetadataBuilder.html). ++ #[inline] ++ pub fn metadata(&mut self, metadata: Metadata<'a>) -> &mut RecordBuilder<'a> { ++ self.record.metadata = metadata; ++ self ++ } ++ ++ /// Set [`Metadata::level`](struct.Metadata.html#method.level). ++ #[inline] ++ pub fn level(&mut self, level: Level) -> &mut RecordBuilder<'a> { ++ self.record.metadata.level = level; ++ self ++ } ++ ++ /// Set [`Metadata::target`](struct.Metadata.html#method.target) ++ #[inline] ++ pub fn target(&mut self, target: &'a str) -> &mut RecordBuilder<'a> { ++ self.record.metadata.target = target; ++ self ++ } ++ ++ /// Set [`module_path`](struct.Record.html#method.module_path) ++ #[inline] ++ pub fn module_path(&mut self, path: Option<&'a str>) -> &mut RecordBuilder<'a> { ++ self.record.module_path = path.map(MaybeStaticStr::Borrowed); ++ self ++ } ++ ++ /// Set [`module_path`](struct.Record.html#method.module_path) to a `'static` string ++ #[inline] ++ pub fn module_path_static(&mut self, path: Option<&'static str>) -> &mut RecordBuilder<'a> { ++ self.record.module_path = path.map(MaybeStaticStr::Static); ++ self ++ } ++ ++ /// Set [`file`](struct.Record.html#method.file) ++ #[inline] ++ pub fn file(&mut self, file: Option<&'a str>) -> &mut RecordBuilder<'a> { ++ self.record.file = file.map(MaybeStaticStr::Borrowed); ++ self ++ } ++ ++ /// Set [`file`](struct.Record.html#method.file) to a `'static` string. ++ #[inline] ++ pub fn file_static(&mut self, file: Option<&'static str>) -> &mut RecordBuilder<'a> { ++ self.record.file = file.map(MaybeStaticStr::Static); ++ self ++ } ++ ++ /// Set [`line`](struct.Record.html#method.line) ++ #[inline] ++ pub fn line(&mut self, line: Option) -> &mut RecordBuilder<'a> { ++ self.record.line = line; ++ self ++ } ++ ++ /// Set [`key_values`](struct.Record.html#method.key_values) ++ #[cfg(feature = "kv")] ++ #[inline] ++ pub fn key_values(&mut self, kvs: &'a dyn kv::Source) -> &mut RecordBuilder<'a> { ++ self.record.key_values = KeyValues(kvs); ++ self ++ } ++ ++ /// Invoke the builder and return a `Record` ++ #[inline] ++ pub fn build(&self) -> Record<'a> { ++ self.record.clone() ++ } ++} ++ ++impl<'a> Default for RecordBuilder<'a> { ++ fn default() -> Self { ++ Self::new() ++ } ++} ++ ++/// Metadata about a log message. ++/// ++/// # Use ++/// ++/// `Metadata` structs are created when users of the library use ++/// logging macros. ++/// ++/// They are consumed by implementations of the `Log` trait in the ++/// `enabled` method. ++/// ++/// `Record`s use `Metadata` to determine the log message's severity ++/// and target. ++/// ++/// Users should use the `log_enabled!` macro in their code to avoid ++/// constructing expensive log messages. ++/// ++/// # Examples ++/// ++/// ``` ++/// use log::{Record, Level, Metadata}; ++/// ++/// struct MyLogger; ++/// ++/// impl log::Log for MyLogger { ++/// fn enabled(&self, metadata: &Metadata) -> bool { ++/// metadata.level() <= Level::Info ++/// } ++/// ++/// fn log(&self, record: &Record) { ++/// if self.enabled(record.metadata()) { ++/// println!("{} - {}", record.level(), record.args()); ++/// } ++/// } ++/// fn flush(&self) {} ++/// } ++/// ++/// # fn main(){} ++/// ``` ++#[derive(Clone, Eq, PartialEq, Ord, PartialOrd, Hash, Debug)] ++pub struct Metadata<'a> { ++ level: Level, ++ target: &'a str, ++} ++ ++impl<'a> Metadata<'a> { ++ /// Returns a new builder. ++ #[inline] ++ pub fn builder() -> MetadataBuilder<'a> { ++ MetadataBuilder::new() ++ } ++ ++ /// The verbosity level of the message. ++ #[inline] ++ pub fn level(&self) -> Level { ++ self.level ++ } ++ ++ /// The name of the target of the directive. ++ #[inline] ++ pub fn target(&self) -> &'a str { ++ self.target ++ } ++} ++ ++/// Builder for [`Metadata`](struct.Metadata.html). ++/// ++/// Typically should only be used by log library creators or for testing and "shim loggers". ++/// The `MetadataBuilder` can set the different parameters of a `Metadata` object, and returns ++/// the created object when `build` is called. ++/// ++/// # Example ++/// ++/// ``` ++/// let target = "myApp"; ++/// use log::{Level, MetadataBuilder}; ++/// let metadata = MetadataBuilder::new() ++/// .level(Level::Debug) ++/// .target(target) ++/// .build(); ++/// ``` ++#[derive(Eq, PartialEq, Ord, PartialOrd, Hash, Debug)] ++pub struct MetadataBuilder<'a> { ++ metadata: Metadata<'a>, ++} ++ ++impl<'a> MetadataBuilder<'a> { ++ /// Construct a new `MetadataBuilder`. ++ /// ++ /// The default options are: ++ /// ++ /// - `level`: `Level::Info` ++ /// - `target`: `""` ++ #[inline] ++ pub fn new() -> MetadataBuilder<'a> { ++ MetadataBuilder { ++ metadata: Metadata { ++ level: Level::Info, ++ target: "", ++ }, ++ } ++ } ++ ++ /// Setter for [`level`](struct.Metadata.html#method.level). ++ #[inline] ++ pub fn level(&mut self, arg: Level) -> &mut MetadataBuilder<'a> { ++ self.metadata.level = arg; ++ self ++ } ++ ++ /// Setter for [`target`](struct.Metadata.html#method.target). ++ #[inline] ++ pub fn target(&mut self, target: &'a str) -> &mut MetadataBuilder<'a> { ++ self.metadata.target = target; ++ self ++ } ++ ++ /// Returns a `Metadata` object. ++ #[inline] ++ pub fn build(&self) -> Metadata<'a> { ++ self.metadata.clone() ++ } ++} ++ ++impl<'a> Default for MetadataBuilder<'a> { ++ fn default() -> Self { ++ Self::new() ++ } ++} ++ ++/// A trait encapsulating the operations required of a logger. ++pub trait Log: Sync + Send { ++ /// Determines if a log message with the specified metadata would be ++ /// logged. ++ /// ++ /// This is used by the `log_enabled!` macro to allow callers to avoid ++ /// expensive computation of log message arguments if the message would be ++ /// discarded anyway. ++ /// ++ /// # For implementors ++ /// ++ /// This method isn't called automatically by the `log!` macros. ++ /// It's up to an implementation of the `Log` trait to call `enabled` in its own ++ /// `log` method implementation to guarantee that filtering is applied. ++ fn enabled(&self, metadata: &Metadata) -> bool; ++ ++ /// Logs the `Record`. ++ /// ++ /// # For implementors ++ /// ++ /// Note that `enabled` is *not* necessarily called before this method. ++ /// Implementations of `log` should perform all necessary filtering ++ /// internally. ++ fn log(&self, record: &Record); ++ ++ /// Flushes any buffered records. ++ /// ++ /// # For implementors ++ /// ++ /// This method isn't called automatically by the `log!` macros. ++ /// It can be called manually on shut-down to ensure any in-flight records are flushed. ++ fn flush(&self); ++} ++ ++// Just used as a dummy initial value for LOGGER ++struct NopLogger; ++ ++impl Log for NopLogger { ++ fn enabled(&self, _: &Metadata) -> bool { ++ false ++ } ++ ++ fn log(&self, _: &Record) {} ++ fn flush(&self) {} ++} ++ ++impl Log for &'_ T ++where ++ T: ?Sized + Log, ++{ ++ fn enabled(&self, metadata: &Metadata) -> bool { ++ (**self).enabled(metadata) ++ } ++ ++ fn log(&self, record: &Record) { ++ (**self).log(record); ++ } ++ fn flush(&self) { ++ (**self).flush(); ++ } ++} ++ ++#[cfg(feature = "std")] ++impl Log for std::boxed::Box ++where ++ T: ?Sized + Log, ++{ ++ fn enabled(&self, metadata: &Metadata) -> bool { ++ self.as_ref().enabled(metadata) ++ } ++ ++ fn log(&self, record: &Record) { ++ self.as_ref().log(record); ++ } ++ fn flush(&self) { ++ self.as_ref().flush(); ++ } ++} ++ ++#[cfg(feature = "std")] ++impl Log for std::sync::Arc ++where ++ T: ?Sized + Log, ++{ ++ fn enabled(&self, metadata: &Metadata) -> bool { ++ self.as_ref().enabled(metadata) ++ } ++ ++ fn log(&self, record: &Record) { ++ self.as_ref().log(record); ++ } ++ fn flush(&self) { ++ self.as_ref().flush(); ++ } ++} ++ ++/// Sets the global maximum log level. ++/// ++/// Generally, this should only be called by the active logging implementation. ++/// ++/// Note that `Trace` is the maximum level, because it provides the maximum amount of detail in the emitted logs. ++#[inline] ++#[cfg(target_has_atomic = "ptr")] ++pub fn set_max_level(level: LevelFilter) { ++ MAX_LOG_LEVEL_FILTER.store(level as usize, Ordering::Relaxed); ++} ++ ++/// A thread-unsafe version of [`set_max_level`]. ++/// ++/// This function is available on all platforms, even those that do not have ++/// support for atomics that is needed by [`set_max_level`]. ++/// ++/// In almost all cases, [`set_max_level`] should be preferred. ++/// ++/// # Safety ++/// ++/// This function is only safe to call when it cannot race with any other ++/// calls to `set_max_level` or `set_max_level_racy`. ++/// ++/// This can be upheld by (for example) making sure that **there are no other ++/// threads**, and (on embedded) that **interrupts are disabled**. ++/// ++/// It is safe to use all other logging functions while this function runs ++/// (including all logging macros). ++/// ++/// [`set_max_level`]: fn.set_max_level.html ++#[inline] ++pub unsafe fn set_max_level_racy(level: LevelFilter) { ++ // `MAX_LOG_LEVEL_FILTER` uses a `Cell` as the underlying primitive when a ++ // platform doesn't support `target_has_atomic = "ptr"`, so even though this looks the same ++ // as `set_max_level` it may have different safety properties. ++ MAX_LOG_LEVEL_FILTER.store(level as usize, Ordering::Relaxed); ++} ++ ++/// Returns the current maximum log level. ++/// ++/// The [`log!`], [`error!`], [`warn!`], [`info!`], [`debug!`], and [`trace!`] macros check ++/// this value and discard any message logged at a higher level. The maximum ++/// log level is set by the [`set_max_level`] function. ++/// ++/// [`log!`]: macro.log.html ++/// [`error!`]: macro.error.html ++/// [`warn!`]: macro.warn.html ++/// [`info!`]: macro.info.html ++/// [`debug!`]: macro.debug.html ++/// [`trace!`]: macro.trace.html ++/// [`set_max_level`]: fn.set_max_level.html ++#[inline(always)] ++pub fn max_level() -> LevelFilter { ++ // Since `LevelFilter` is `repr(usize)`, ++ // this transmute is sound if and only if `MAX_LOG_LEVEL_FILTER` ++ // is set to a usize that is a valid discriminant for `LevelFilter`. ++ // Since `MAX_LOG_LEVEL_FILTER` is private, the only time it's set ++ // is by `set_max_level` above, i.e. by casting a `LevelFilter` to `usize`. ++ // So any usize stored in `MAX_LOG_LEVEL_FILTER` is a valid discriminant. ++ unsafe { mem::transmute(MAX_LOG_LEVEL_FILTER.load(Ordering::Relaxed)) } ++} ++ ++/// Sets the global logger to a `Box`. ++/// ++/// This is a simple convenience wrapper over `set_logger`, which takes a ++/// `Box` rather than a `&'static Log`. See the documentation for ++/// [`set_logger`] for more details. ++/// ++/// Requires the `std` feature. ++/// ++/// # Errors ++/// ++/// An error is returned if a logger has already been set. ++/// ++/// [`set_logger`]: fn.set_logger.html ++#[cfg(all(feature = "std", target_has_atomic = "ptr"))] ++pub fn set_boxed_logger(logger: Box) -> Result<(), SetLoggerError> { ++ set_logger_inner(|| Box::leak(logger)) ++} ++ ++/// Sets the global logger to a `&'static Log`. ++/// ++/// This function may only be called once in the lifetime of a program. Any log ++/// events that occur before the call to `set_logger` completes will be ignored. ++/// ++/// This function does not typically need to be called manually. Logger ++/// implementations should provide an initialization method that installs the ++/// logger internally. ++/// ++/// # Availability ++/// ++/// This method is available even when the `std` feature is disabled. However, ++/// it is currently unavailable on `thumbv6` targets, which lack support for ++/// some atomic operations which are used by this function. Even on those ++/// targets, [`set_logger_racy`] will be available. ++/// ++/// # Errors ++/// ++/// An error is returned if a logger has already been set. ++/// ++/// # Examples ++/// ++/// ``` ++/// use log::{error, info, warn, Record, Level, Metadata, LevelFilter}; ++/// ++/// static MY_LOGGER: MyLogger = MyLogger; ++/// ++/// struct MyLogger; ++/// ++/// impl log::Log for MyLogger { ++/// fn enabled(&self, metadata: &Metadata) -> bool { ++/// metadata.level() <= Level::Info ++/// } ++/// ++/// fn log(&self, record: &Record) { ++/// if self.enabled(record.metadata()) { ++/// println!("{} - {}", record.level(), record.args()); ++/// } ++/// } ++/// fn flush(&self) {} ++/// } ++/// ++/// # fn main(){ ++/// log::set_logger(&MY_LOGGER).unwrap(); ++/// log::set_max_level(LevelFilter::Info); ++/// ++/// info!("hello log"); ++/// warn!("warning"); ++/// error!("oops"); ++/// # } ++/// ``` ++/// ++/// [`set_logger_racy`]: fn.set_logger_racy.html ++#[cfg(target_has_atomic = "ptr")] ++pub fn set_logger(logger: &'static dyn Log) -> Result<(), SetLoggerError> { ++ set_logger_inner(|| logger) ++} ++ ++#[cfg(target_has_atomic = "ptr")] ++fn set_logger_inner(make_logger: F) -> Result<(), SetLoggerError> ++where ++ F: FnOnce() -> &'static dyn Log, ++{ ++ match STATE.compare_exchange( ++ UNINITIALIZED, ++ INITIALIZING, ++ Ordering::Acquire, ++ Ordering::Relaxed, ++ ) { ++ Ok(UNINITIALIZED) => { ++ unsafe { ++ LOGGER = make_logger(); ++ } ++ STATE.store(INITIALIZED, Ordering::Release); ++ Ok(()) ++ } ++ Err(INITIALIZING) => { ++ while STATE.load(Ordering::Relaxed) == INITIALIZING { ++ std::hint::spin_loop(); ++ } ++ Err(SetLoggerError(())) ++ } ++ _ => Err(SetLoggerError(())), ++ } ++} ++ ++/// A thread-unsafe version of [`set_logger`]. ++/// ++/// This function is available on all platforms, even those that do not have ++/// support for atomics that is needed by [`set_logger`]. ++/// ++/// In almost all cases, [`set_logger`] should be preferred. ++/// ++/// # Safety ++/// ++/// This function is only safe to call when it cannot race with any other ++/// calls to `set_logger` or `set_logger_racy`. ++/// ++/// This can be upheld by (for example) making sure that **there are no other ++/// threads**, and (on embedded) that **interrupts are disabled**. ++/// ++/// It is safe to use other logging functions while this function runs ++/// (including all logging macros). ++/// ++/// [`set_logger`]: fn.set_logger.html ++pub unsafe fn set_logger_racy(logger: &'static dyn Log) -> Result<(), SetLoggerError> { ++ match STATE.load(Ordering::Acquire) { ++ UNINITIALIZED => { ++ LOGGER = logger; ++ STATE.store(INITIALIZED, Ordering::Release); ++ Ok(()) ++ } ++ INITIALIZING => { ++ // This is just plain UB, since we were racing another initialization function ++ unreachable!("set_logger_racy must not be used with other initialization functions") ++ } ++ _ => Err(SetLoggerError(())), ++ } ++} ++ ++/// The type returned by [`set_logger`] if [`set_logger`] has already been called. ++/// ++/// [`set_logger`]: fn.set_logger.html ++#[allow(missing_copy_implementations)] ++#[derive(Debug)] ++pub struct SetLoggerError(()); ++ ++impl fmt::Display for SetLoggerError { ++ fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { ++ fmt.write_str(SET_LOGGER_ERROR) ++ } ++} ++ ++// The Error trait is not available in libcore ++#[cfg(feature = "std")] ++impl error::Error for SetLoggerError {} ++ ++/// The type returned by [`from_str`] when the string doesn't match any of the log levels. ++/// ++/// [`from_str`]: https://doc.rust-lang.org/std/str/trait.FromStr.html#tymethod.from_str ++#[allow(missing_copy_implementations)] ++#[derive(Debug, PartialEq, Eq)] ++pub struct ParseLevelError(()); ++ ++impl fmt::Display for ParseLevelError { ++ fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { ++ fmt.write_str(LEVEL_PARSE_ERROR) ++ } ++} ++ ++// The Error trait is not available in libcore ++#[cfg(feature = "std")] ++impl error::Error for ParseLevelError {} ++ ++/// Returns a reference to the logger. ++/// ++/// If a logger has not been set, a no-op implementation is returned. ++pub fn logger() -> &'static dyn Log { ++ // Acquire memory ordering guarantees that current thread would see any ++ // memory writes that happened before store of the value ++ // into `STATE` with memory ordering `Release` or stronger. ++ // ++ // Since the value `INITIALIZED` is written only after `LOGGER` was ++ // initialized, observing it after `Acquire` load here makes both ++ // write to the `LOGGER` static and initialization of the logger ++ // internal state synchronized with current thread. ++ if STATE.load(Ordering::Acquire) != INITIALIZED { ++ static NOP: NopLogger = NopLogger; ++ &NOP ++ } else { ++ unsafe { LOGGER } ++ } ++} ++ ++// WARNING: this is not part of the crate's public API and is subject to change at any time ++#[doc(hidden)] ++pub mod __private_api; ++ ++/// The statically resolved maximum log level. ++/// ++/// See the crate level documentation for information on how to configure this. ++/// ++/// This value is checked by the log macros, but not by the `Log`ger returned by ++/// the [`logger`] function. Code that manually calls functions on that value ++/// should compare the level against this value. ++/// ++/// [`logger`]: fn.logger.html ++pub const STATIC_MAX_LEVEL: LevelFilter = match cfg!(debug_assertions) { ++ false if cfg!(feature = "release_max_level_off") => LevelFilter::Off, ++ false if cfg!(feature = "release_max_level_error") => LevelFilter::Error, ++ false if cfg!(feature = "release_max_level_warn") => LevelFilter::Warn, ++ false if cfg!(feature = "release_max_level_info") => LevelFilter::Info, ++ false if cfg!(feature = "release_max_level_debug") => LevelFilter::Debug, ++ false if cfg!(feature = "release_max_level_trace") => LevelFilter::Trace, ++ _ if cfg!(feature = "max_level_off") => LevelFilter::Off, ++ _ if cfg!(feature = "max_level_error") => LevelFilter::Error, ++ _ if cfg!(feature = "max_level_warn") => LevelFilter::Warn, ++ _ if cfg!(feature = "max_level_info") => LevelFilter::Info, ++ _ if cfg!(feature = "max_level_debug") => LevelFilter::Debug, ++ _ => LevelFilter::Trace, ++}; ++ ++#[cfg(test)] ++mod tests { ++ use super::{Level, LevelFilter, ParseLevelError, STATIC_MAX_LEVEL}; ++ ++ #[test] ++ fn test_levelfilter_from_str() { ++ let tests = [ ++ ("off", Ok(LevelFilter::Off)), ++ ("error", Ok(LevelFilter::Error)), ++ ("warn", Ok(LevelFilter::Warn)), ++ ("info", Ok(LevelFilter::Info)), ++ ("debug", Ok(LevelFilter::Debug)), ++ ("trace", Ok(LevelFilter::Trace)), ++ ("OFF", Ok(LevelFilter::Off)), ++ ("ERROR", Ok(LevelFilter::Error)), ++ ("WARN", Ok(LevelFilter::Warn)), ++ ("INFO", Ok(LevelFilter::Info)), ++ ("DEBUG", Ok(LevelFilter::Debug)), ++ ("TRACE", Ok(LevelFilter::Trace)), ++ ("asdf", Err(ParseLevelError(()))), ++ ]; ++ for &(s, ref expected) in &tests { ++ assert_eq!(expected, &s.parse()); ++ } ++ } ++ ++ #[test] ++ fn test_level_from_str() { ++ let tests = [ ++ ("OFF", Err(ParseLevelError(()))), ++ ("error", Ok(Level::Error)), ++ ("warn", Ok(Level::Warn)), ++ ("info", Ok(Level::Info)), ++ ("debug", Ok(Level::Debug)), ++ ("trace", Ok(Level::Trace)), ++ ("ERROR", Ok(Level::Error)), ++ ("WARN", Ok(Level::Warn)), ++ ("INFO", Ok(Level::Info)), ++ ("DEBUG", Ok(Level::Debug)), ++ ("TRACE", Ok(Level::Trace)), ++ ("asdf", Err(ParseLevelError(()))), ++ ]; ++ for &(s, ref expected) in &tests { ++ assert_eq!(expected, &s.parse()); ++ } ++ } ++ ++ #[test] ++ fn test_level_as_str() { ++ let tests = &[ ++ (Level::Error, "ERROR"), ++ (Level::Warn, "WARN"), ++ (Level::Info, "INFO"), ++ (Level::Debug, "DEBUG"), ++ (Level::Trace, "TRACE"), ++ ]; ++ for (input, expected) in tests { ++ assert_eq!(*expected, input.as_str()); ++ } ++ } ++ ++ #[test] ++ fn test_level_show() { ++ assert_eq!("INFO", Level::Info.to_string()); ++ assert_eq!("ERROR", Level::Error.to_string()); ++ } ++ ++ #[test] ++ fn test_levelfilter_show() { ++ assert_eq!("OFF", LevelFilter::Off.to_string()); ++ assert_eq!("ERROR", LevelFilter::Error.to_string()); ++ } ++ ++ #[test] ++ fn test_cross_cmp() { ++ assert!(Level::Debug > LevelFilter::Error); ++ assert!(LevelFilter::Warn < Level::Trace); ++ assert!(LevelFilter::Off < Level::Error); ++ } ++ ++ #[test] ++ fn test_cross_eq() { ++ assert!(Level::Error == LevelFilter::Error); ++ assert!(LevelFilter::Off != Level::Error); ++ assert!(Level::Trace == LevelFilter::Trace); ++ } ++ ++ #[test] ++ fn test_to_level() { ++ assert_eq!(Some(Level::Error), LevelFilter::Error.to_level()); ++ assert_eq!(None, LevelFilter::Off.to_level()); ++ assert_eq!(Some(Level::Debug), LevelFilter::Debug.to_level()); ++ } ++ ++ #[test] ++ fn test_to_level_filter() { ++ assert_eq!(LevelFilter::Error, Level::Error.to_level_filter()); ++ assert_eq!(LevelFilter::Trace, Level::Trace.to_level_filter()); ++ } ++ ++ #[test] ++ fn test_level_filter_as_str() { ++ let tests = &[ ++ (LevelFilter::Off, "OFF"), ++ (LevelFilter::Error, "ERROR"), ++ (LevelFilter::Warn, "WARN"), ++ (LevelFilter::Info, "INFO"), ++ (LevelFilter::Debug, "DEBUG"), ++ (LevelFilter::Trace, "TRACE"), ++ ]; ++ for (input, expected) in tests { ++ assert_eq!(*expected, input.as_str()); ++ } ++ } ++ ++ #[test] ++ #[cfg_attr(not(debug_assertions), ignore)] ++ fn test_static_max_level_debug() { ++ if cfg!(feature = "max_level_off") { ++ assert_eq!(STATIC_MAX_LEVEL, LevelFilter::Off); ++ } else if cfg!(feature = "max_level_error") { ++ assert_eq!(STATIC_MAX_LEVEL, LevelFilter::Error); ++ } else if cfg!(feature = "max_level_warn") { ++ assert_eq!(STATIC_MAX_LEVEL, LevelFilter::Warn); ++ } else if cfg!(feature = "max_level_info") { ++ assert_eq!(STATIC_MAX_LEVEL, LevelFilter::Info); ++ } else if cfg!(feature = "max_level_debug") { ++ assert_eq!(STATIC_MAX_LEVEL, LevelFilter::Debug); ++ } else { ++ assert_eq!(STATIC_MAX_LEVEL, LevelFilter::Trace); ++ } ++ } ++ ++ #[test] ++ #[cfg_attr(debug_assertions, ignore)] ++ fn test_static_max_level_release() { ++ if cfg!(feature = "release_max_level_off") { ++ assert_eq!(STATIC_MAX_LEVEL, LevelFilter::Off); ++ } else if cfg!(feature = "release_max_level_error") { ++ assert_eq!(STATIC_MAX_LEVEL, LevelFilter::Error); ++ } else if cfg!(feature = "release_max_level_warn") { ++ assert_eq!(STATIC_MAX_LEVEL, LevelFilter::Warn); ++ } else if cfg!(feature = "release_max_level_info") { ++ assert_eq!(STATIC_MAX_LEVEL, LevelFilter::Info); ++ } else if cfg!(feature = "release_max_level_debug") { ++ assert_eq!(STATIC_MAX_LEVEL, LevelFilter::Debug); ++ } else if cfg!(feature = "release_max_level_trace") { ++ assert_eq!(STATIC_MAX_LEVEL, LevelFilter::Trace); ++ } else if cfg!(feature = "max_level_off") { ++ assert_eq!(STATIC_MAX_LEVEL, LevelFilter::Off); ++ } else if cfg!(feature = "max_level_error") { ++ assert_eq!(STATIC_MAX_LEVEL, LevelFilter::Error); ++ } else if cfg!(feature = "max_level_warn") { ++ assert_eq!(STATIC_MAX_LEVEL, LevelFilter::Warn); ++ } else if cfg!(feature = "max_level_info") { ++ assert_eq!(STATIC_MAX_LEVEL, LevelFilter::Info); ++ } else if cfg!(feature = "max_level_debug") { ++ assert_eq!(STATIC_MAX_LEVEL, LevelFilter::Debug); ++ } else { ++ assert_eq!(STATIC_MAX_LEVEL, LevelFilter::Trace); ++ } ++ } ++ ++ #[test] ++ #[cfg(feature = "std")] ++ fn test_error_trait() { ++ use super::SetLoggerError; ++ let e = SetLoggerError(()); ++ assert_eq!( ++ &e.to_string(), ++ "attempted to set a logger after the logging system \ ++ was already initialized" ++ ); ++ } ++ ++ #[test] ++ fn test_metadata_builder() { ++ use super::MetadataBuilder; ++ let target = "myApp"; ++ let metadata_test = MetadataBuilder::new() ++ .level(Level::Debug) ++ .target(target) ++ .build(); ++ assert_eq!(metadata_test.level(), Level::Debug); ++ assert_eq!(metadata_test.target(), "myApp"); ++ } ++ ++ #[test] ++ fn test_metadata_convenience_builder() { ++ use super::Metadata; ++ let target = "myApp"; ++ let metadata_test = Metadata::builder() ++ .level(Level::Debug) ++ .target(target) ++ .build(); ++ assert_eq!(metadata_test.level(), Level::Debug); ++ assert_eq!(metadata_test.target(), "myApp"); ++ } ++ ++ #[test] ++ fn test_record_builder() { ++ use super::{MetadataBuilder, RecordBuilder}; ++ let target = "myApp"; ++ let metadata = MetadataBuilder::new().target(target).build(); ++ let fmt_args = format_args!("hello"); ++ let record_test = RecordBuilder::new() ++ .args(fmt_args) ++ .metadata(metadata) ++ .module_path(Some("foo")) ++ .file(Some("bar")) ++ .line(Some(30)) ++ .build(); ++ assert_eq!(record_test.metadata().target(), "myApp"); ++ assert_eq!(record_test.module_path(), Some("foo")); ++ assert_eq!(record_test.file(), Some("bar")); ++ assert_eq!(record_test.line(), Some(30)); ++ } ++ ++ #[test] ++ fn test_record_convenience_builder() { ++ use super::{Metadata, Record}; ++ let target = "myApp"; ++ let metadata = Metadata::builder().target(target).build(); ++ let fmt_args = format_args!("hello"); ++ let record_test = Record::builder() ++ .args(fmt_args) ++ .metadata(metadata) ++ .module_path(Some("foo")) ++ .file(Some("bar")) ++ .line(Some(30)) ++ .build(); ++ assert_eq!(record_test.target(), "myApp"); ++ assert_eq!(record_test.module_path(), Some("foo")); ++ assert_eq!(record_test.file(), Some("bar")); ++ assert_eq!(record_test.line(), Some(30)); ++ } ++ ++ #[test] ++ fn test_record_complete_builder() { ++ use super::{Level, Record}; ++ let target = "myApp"; ++ let record_test = Record::builder() ++ .module_path(Some("foo")) ++ .file(Some("bar")) ++ .line(Some(30)) ++ .target(target) ++ .level(Level::Error) ++ .build(); ++ assert_eq!(record_test.target(), "myApp"); ++ assert_eq!(record_test.level(), Level::Error); ++ assert_eq!(record_test.module_path(), Some("foo")); ++ assert_eq!(record_test.file(), Some("bar")); ++ assert_eq!(record_test.line(), Some(30)); ++ } ++ ++ #[test] ++ #[cfg(feature = "kv")] ++ fn test_record_key_values_builder() { ++ use super::Record; ++ use crate::kv::{self, VisitSource}; ++ ++ struct TestVisitSource { ++ seen_pairs: usize, ++ } ++ ++ impl<'kvs> VisitSource<'kvs> for TestVisitSource { ++ fn visit_pair( ++ &mut self, ++ _: kv::Key<'kvs>, ++ _: kv::Value<'kvs>, ++ ) -> Result<(), kv::Error> { ++ self.seen_pairs += 1; ++ Ok(()) ++ } ++ } ++ ++ let kvs: &[(&str, i32)] = &[("a", 1), ("b", 2)]; ++ let record_test = Record::builder().key_values(&kvs).build(); ++ ++ let mut visitor = TestVisitSource { seen_pairs: 0 }; ++ ++ record_test.key_values().visit(&mut visitor).unwrap(); ++ ++ assert_eq!(2, visitor.seen_pairs); ++ } ++ ++ #[test] ++ #[cfg(feature = "kv")] ++ fn test_record_key_values_get_coerce() { ++ use super::Record; ++ ++ let kvs: &[(&str, &str)] = &[("a", "1"), ("b", "2")]; ++ let record = Record::builder().key_values(&kvs).build(); ++ ++ assert_eq!( ++ "2", ++ record ++ .key_values() ++ .get("b".into()) ++ .expect("missing key") ++ .to_borrowed_str() ++ .expect("invalid value") ++ ); ++ } ++ ++ // Test that the `impl Log for Foo` blocks work ++ // This test mostly operates on a type level, so failures will be compile errors ++ #[test] ++ fn test_foreign_impl() { ++ use super::Log; ++ #[cfg(feature = "std")] ++ use std::sync::Arc; ++ ++ fn assert_is_log() {} ++ ++ assert_is_log::<&dyn Log>(); ++ ++ #[cfg(feature = "std")] ++ assert_is_log::>(); ++ ++ #[cfg(feature = "std")] ++ assert_is_log::>(); ++ ++ // Assert these statements for all T: Log + ?Sized ++ #[allow(unused)] ++ fn forall() { ++ #[cfg(feature = "std")] ++ assert_is_log::>(); ++ ++ assert_is_log::<&T>(); ++ ++ #[cfg(feature = "std")] ++ assert_is_log::>(); ++ } ++ } ++} +diff -Nru mesa-25.3.3/subprojects/log-0.4.26/src/macros.rs mesa-25.3.3/subprojects/log-0.4.26/src/macros.rs +--- mesa-25.3.3/subprojects/log-0.4.26/src/macros.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/log-0.4.26/src/macros.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,367 @@ ++// Copyright 2014-2015 The Rust Project Developers. See the COPYRIGHT ++// file at the top-level directory of this distribution and at ++// http://rust-lang.org/COPYRIGHT. ++// ++// Licensed under the Apache License, Version 2.0 or the MIT license ++// , at your ++// option. This file may not be copied, modified, or distributed ++// except according to those terms. ++ ++/// The standard logging macro. ++/// ++/// This macro will generically log with the specified `Level` and `format!` ++/// based argument list. ++/// ++/// # Examples ++/// ++/// ``` ++/// use log::{log, Level}; ++/// ++/// # fn main() { ++/// let data = (42, "Forty-two"); ++/// let private_data = "private"; ++/// ++/// log!(Level::Error, "Received errors: {}, {}", data.0, data.1); ++/// log!(target: "app_events", Level::Warn, "App warning: {}, {}, {}", ++/// data.0, data.1, private_data); ++/// # } ++/// ``` ++#[macro_export] ++macro_rules! log { ++ // log!(target: "my_target", Level::Info, key1:? = 42, key2 = true; "a {} event", "log"); ++ (target: $target:expr, $lvl:expr, $($key:tt $(:$capture:tt)? $(= $value:expr)?),+; $($arg:tt)+) => ({ ++ let lvl = $lvl; ++ if lvl <= $crate::STATIC_MAX_LEVEL && lvl <= $crate::max_level() { ++ $crate::__private_api::log::<&_>( ++ $crate::__private_api::format_args!($($arg)+), ++ lvl, ++ &($target, $crate::__private_api::module_path!(), $crate::__private_api::loc()), ++ &[$(($crate::__log_key!($key), $crate::__log_value!($key $(:$capture)* = $($value)*))),+] ++ ); ++ } ++ }); ++ ++ // log!(target: "my_target", Level::Info, "a {} event", "log"); ++ (target: $target:expr, $lvl:expr, $($arg:tt)+) => ({ ++ let lvl = $lvl; ++ if lvl <= $crate::STATIC_MAX_LEVEL && lvl <= $crate::max_level() { ++ $crate::__private_api::log( ++ $crate::__private_api::format_args!($($arg)+), ++ lvl, ++ &($target, $crate::__private_api::module_path!(), $crate::__private_api::loc()), ++ (), ++ ); ++ } ++ }); ++ ++ // log!(Level::Info, "a log event") ++ ($lvl:expr, $($arg:tt)+) => ($crate::log!(target: $crate::__private_api::module_path!(), $lvl, $($arg)+)); ++} ++ ++/// Logs a message at the error level. ++/// ++/// # Examples ++/// ++/// ``` ++/// use log::error; ++/// ++/// # fn main() { ++/// let (err_info, port) = ("No connection", 22); ++/// ++/// error!("Error: {err_info} on port {port}"); ++/// error!(target: "app_events", "App Error: {err_info}, Port: {port}"); ++/// # } ++/// ``` ++#[macro_export] ++macro_rules! error { ++ // error!(target: "my_target", key1 = 42, key2 = true; "a {} event", "log") ++ // error!(target: "my_target", "a {} event", "log") ++ (target: $target:expr, $($arg:tt)+) => ($crate::log!(target: $target, $crate::Level::Error, $($arg)+)); ++ ++ // error!("a {} event", "log") ++ ($($arg:tt)+) => ($crate::log!($crate::Level::Error, $($arg)+)) ++} ++ ++/// Logs a message at the warn level. ++/// ++/// # Examples ++/// ++/// ``` ++/// use log::warn; ++/// ++/// # fn main() { ++/// let warn_description = "Invalid Input"; ++/// ++/// warn!("Warning! {warn_description}!"); ++/// warn!(target: "input_events", "App received warning: {warn_description}"); ++/// # } ++/// ``` ++#[macro_export] ++macro_rules! warn { ++ // warn!(target: "my_target", key1 = 42, key2 = true; "a {} event", "log") ++ // warn!(target: "my_target", "a {} event", "log") ++ (target: $target:expr, $($arg:tt)+) => ($crate::log!(target: $target, $crate::Level::Warn, $($arg)+)); ++ ++ // warn!("a {} event", "log") ++ ($($arg:tt)+) => ($crate::log!($crate::Level::Warn, $($arg)+)) ++} ++ ++/// Logs a message at the info level. ++/// ++/// # Examples ++/// ++/// ``` ++/// use log::info; ++/// ++/// # fn main() { ++/// # struct Connection { port: u32, speed: f32 } ++/// let conn_info = Connection { port: 40, speed: 3.20 }; ++/// ++/// info!("Connected to port {} at {} Mb/s", conn_info.port, conn_info.speed); ++/// info!(target: "connection_events", "Successful connection, port: {}, speed: {}", ++/// conn_info.port, conn_info.speed); ++/// # } ++/// ``` ++#[macro_export] ++macro_rules! info { ++ // info!(target: "my_target", key1 = 42, key2 = true; "a {} event", "log") ++ // info!(target: "my_target", "a {} event", "log") ++ (target: $target:expr, $($arg:tt)+) => ($crate::log!(target: $target, $crate::Level::Info, $($arg)+)); ++ ++ // info!("a {} event", "log") ++ ($($arg:tt)+) => ($crate::log!($crate::Level::Info, $($arg)+)) ++} ++ ++/// Logs a message at the debug level. ++/// ++/// # Examples ++/// ++/// ``` ++/// use log::debug; ++/// ++/// # fn main() { ++/// # struct Position { x: f32, y: f32 } ++/// let pos = Position { x: 3.234, y: -1.223 }; ++/// ++/// debug!("New position: x: {}, y: {}", pos.x, pos.y); ++/// debug!(target: "app_events", "New position: x: {}, y: {}", pos.x, pos.y); ++/// # } ++/// ``` ++#[macro_export] ++macro_rules! debug { ++ // debug!(target: "my_target", key1 = 42, key2 = true; "a {} event", "log") ++ // debug!(target: "my_target", "a {} event", "log") ++ (target: $target:expr, $($arg:tt)+) => ($crate::log!(target: $target, $crate::Level::Debug, $($arg)+)); ++ ++ // debug!("a {} event", "log") ++ ($($arg:tt)+) => ($crate::log!($crate::Level::Debug, $($arg)+)) ++} ++ ++/// Logs a message at the trace level. ++/// ++/// # Examples ++/// ++/// ``` ++/// use log::trace; ++/// ++/// # fn main() { ++/// # struct Position { x: f32, y: f32 } ++/// let pos = Position { x: 3.234, y: -1.223 }; ++/// ++/// trace!("Position is: x: {}, y: {}", pos.x, pos.y); ++/// trace!(target: "app_events", "x is {} and y is {}", ++/// if pos.x >= 0.0 { "positive" } else { "negative" }, ++/// if pos.y >= 0.0 { "positive" } else { "negative" }); ++/// # } ++/// ``` ++#[macro_export] ++macro_rules! trace { ++ // trace!(target: "my_target", key1 = 42, key2 = true; "a {} event", "log") ++ // trace!(target: "my_target", "a {} event", "log") ++ (target: $target:expr, $($arg:tt)+) => ($crate::log!(target: $target, $crate::Level::Trace, $($arg)+)); ++ ++ // trace!("a {} event", "log") ++ ($($arg:tt)+) => ($crate::log!($crate::Level::Trace, $($arg)+)) ++} ++ ++/// Determines if a message logged at the specified level in that module will ++/// be logged. ++/// ++/// This can be used to avoid expensive computation of log message arguments if ++/// the message would be ignored anyway. ++/// ++/// # Examples ++/// ++/// ``` ++/// use log::Level::Debug; ++/// use log::{debug, log_enabled}; ++/// ++/// # fn foo() { ++/// if log_enabled!(Debug) { ++/// let data = expensive_call(); ++/// debug!("expensive debug data: {} {}", data.x, data.y); ++/// } ++/// if log_enabled!(target: "Global", Debug) { ++/// let data = expensive_call(); ++/// debug!(target: "Global", "expensive debug data: {} {}", data.x, data.y); ++/// } ++/// # } ++/// # struct Data { x: u32, y: u32 } ++/// # fn expensive_call() -> Data { Data { x: 0, y: 0 } } ++/// # fn main() {} ++/// ``` ++#[macro_export] ++macro_rules! log_enabled { ++ (target: $target:expr, $lvl:expr) => {{ ++ let lvl = $lvl; ++ lvl <= $crate::STATIC_MAX_LEVEL ++ && lvl <= $crate::max_level() ++ && $crate::__private_api::enabled(lvl, $target) ++ }}; ++ ($lvl:expr) => { ++ $crate::log_enabled!(target: $crate::__private_api::module_path!(), $lvl) ++ }; ++} ++ ++// These macros use a pattern of #[cfg]s to produce nicer error ++// messages when log features aren't available ++ ++#[doc(hidden)] ++#[macro_export] ++#[cfg(feature = "kv")] ++macro_rules! __log_key { ++ // key1 = 42 ++ ($($args:ident)*) => { ++ $crate::__private_api::stringify!($($args)*) ++ }; ++ // "key1" = 42 ++ ($($args:expr)*) => { ++ $($args)* ++ }; ++} ++ ++#[doc(hidden)] ++#[macro_export] ++#[cfg(not(feature = "kv"))] ++macro_rules! __log_key { ++ ($($args:tt)*) => { ++ compile_error!("key value support requires the `kv` feature of `log`") ++ }; ++} ++ ++#[doc(hidden)] ++#[macro_export] ++#[cfg(feature = "kv")] ++macro_rules! __log_value { ++ // Entrypoint ++ ($key:tt = $args:expr) => { ++ $crate::__log_value!(($args):value) ++ }; ++ ($key:tt :$capture:tt = $args:expr) => { ++ $crate::__log_value!(($args):$capture) ++ }; ++ ($key:ident =) => { ++ $crate::__log_value!(($key):value) ++ }; ++ ($key:ident :$capture:tt =) => { ++ $crate::__log_value!(($key):$capture) ++ }; ++ // ToValue ++ (($args:expr):value) => { ++ $crate::__private_api::capture_to_value(&&$args) ++ }; ++ // Debug ++ (($args:expr):?) => { ++ $crate::__private_api::capture_debug(&&$args) ++ }; ++ (($args:expr):debug) => { ++ $crate::__private_api::capture_debug(&&$args) ++ }; ++ // Display ++ (($args:expr):%) => { ++ $crate::__private_api::capture_display(&&$args) ++ }; ++ (($args:expr):display) => { ++ $crate::__private_api::capture_display(&&$args) ++ }; ++ //Error ++ (($args:expr):err) => { ++ $crate::__log_value_error!($args) ++ }; ++ // sval::Value ++ (($args:expr):sval) => { ++ $crate::__log_value_sval!($args) ++ }; ++ // serde::Serialize ++ (($args:expr):serde) => { ++ $crate::__log_value_serde!($args) ++ }; ++} ++ ++#[doc(hidden)] ++#[macro_export] ++#[cfg(not(feature = "kv"))] ++macro_rules! __log_value { ++ ($($args:tt)*) => { ++ compile_error!("key value support requires the `kv` feature of `log`") ++ }; ++} ++ ++#[doc(hidden)] ++#[macro_export] ++#[cfg(feature = "kv_sval")] ++macro_rules! __log_value_sval { ++ ($args:expr) => { ++ $crate::__private_api::capture_sval(&&$args) ++ }; ++} ++ ++#[doc(hidden)] ++#[macro_export] ++#[cfg(not(feature = "kv_sval"))] ++macro_rules! __log_value_sval { ++ ($args:expr) => { ++ compile_error!("capturing values as `sval::Value` requites the `kv_sval` feature of `log`") ++ }; ++} ++ ++#[doc(hidden)] ++#[macro_export] ++#[cfg(feature = "kv_serde")] ++macro_rules! __log_value_serde { ++ ($args:expr) => { ++ $crate::__private_api::capture_serde(&&$args) ++ }; ++} ++ ++#[doc(hidden)] ++#[macro_export] ++#[cfg(not(feature = "kv_serde"))] ++macro_rules! __log_value_serde { ++ ($args:expr) => { ++ compile_error!( ++ "capturing values as `serde::Serialize` requites the `kv_serde` feature of `log`" ++ ) ++ }; ++} ++ ++#[doc(hidden)] ++#[macro_export] ++#[cfg(feature = "kv_std")] ++macro_rules! __log_value_error { ++ ($args:expr) => { ++ $crate::__private_api::capture_error(&$args) ++ }; ++} ++ ++#[doc(hidden)] ++#[macro_export] ++#[cfg(not(feature = "kv_std"))] ++macro_rules! __log_value_error { ++ ($args:expr) => { ++ compile_error!( ++ "capturing values as `std::error::Error` requites the `kv_std` feature of `log`" ++ ) ++ }; ++} +diff -Nru mesa-25.3.3/subprojects/log-0.4.26/src/__private_api.rs mesa-25.3.3/subprojects/log-0.4.26/src/__private_api.rs +--- mesa-25.3.3/subprojects/log-0.4.26/src/__private_api.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/log-0.4.26/src/__private_api.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,123 @@ ++//! WARNING: this is not part of the crate's public API and is subject to change at any time ++ ++use self::sealed::KVs; ++use crate::{Level, Metadata, Record}; ++use std::fmt::Arguments; ++use std::panic::Location; ++pub use std::{format_args, module_path, stringify}; ++ ++#[cfg(not(feature = "kv"))] ++pub type Value<'a> = &'a str; ++ ++mod sealed { ++ /// Types for the `kv` argument. ++ pub trait KVs<'a> { ++ fn into_kvs(self) -> Option<&'a [(&'a str, super::Value<'a>)]>; ++ } ++} ++ ++// Types for the `kv` argument. ++ ++impl<'a> KVs<'a> for &'a [(&'a str, Value<'a>)] { ++ #[inline] ++ fn into_kvs(self) -> Option<&'a [(&'a str, Value<'a>)]> { ++ Some(self) ++ } ++} ++ ++impl<'a> KVs<'a> for () { ++ #[inline] ++ fn into_kvs(self) -> Option<&'a [(&'a str, Value<'a>)]> { ++ None ++ } ++} ++ ++// Log implementation. ++ ++fn log_impl( ++ args: Arguments, ++ level: Level, ++ &(target, module_path, loc): &(&str, &'static str, &'static Location), ++ kvs: Option<&[(&str, Value)]>, ++) { ++ #[cfg(not(feature = "kv"))] ++ if kvs.is_some() { ++ panic!("key-value support is experimental and must be enabled using the `kv` feature") ++ } ++ ++ let mut builder = Record::builder(); ++ ++ builder ++ .args(args) ++ .level(level) ++ .target(target) ++ .module_path_static(Some(module_path)) ++ .file_static(Some(loc.file())) ++ .line(Some(loc.line())); ++ ++ #[cfg(feature = "kv")] ++ builder.key_values(&kvs); ++ ++ crate::logger().log(&builder.build()); ++} ++ ++pub fn log<'a, K>( ++ args: Arguments, ++ level: Level, ++ target_module_path_and_loc: &(&str, &'static str, &'static Location), ++ kvs: K, ++) where ++ K: KVs<'a>, ++{ ++ log_impl(args, level, target_module_path_and_loc, kvs.into_kvs()) ++} ++ ++pub fn enabled(level: Level, target: &str) -> bool { ++ crate::logger().enabled(&Metadata::builder().level(level).target(target).build()) ++} ++ ++#[track_caller] ++pub fn loc() -> &'static Location<'static> { ++ Location::caller() ++} ++ ++#[cfg(feature = "kv")] ++mod kv_support { ++ use crate::kv; ++ ++ pub type Value<'a> = kv::Value<'a>; ++ ++ // NOTE: Many functions here accept a double reference &&V ++ // This is so V itself can be ?Sized, while still letting us ++ // erase it to some dyn Trait (because &T is sized) ++ ++ pub fn capture_to_value<'a, V: kv::ToValue + ?Sized>(v: &'a &'a V) -> Value<'a> { ++ v.to_value() ++ } ++ ++ pub fn capture_debug<'a, V: core::fmt::Debug + ?Sized>(v: &'a &'a V) -> Value<'a> { ++ Value::from_debug(v) ++ } ++ ++ pub fn capture_display<'a, V: core::fmt::Display + ?Sized>(v: &'a &'a V) -> Value<'a> { ++ Value::from_display(v) ++ } ++ ++ #[cfg(feature = "kv_std")] ++ pub fn capture_error<'a>(v: &'a (dyn std::error::Error + 'static)) -> Value<'a> { ++ Value::from_dyn_error(v) ++ } ++ ++ #[cfg(feature = "kv_sval")] ++ pub fn capture_sval<'a, V: sval::Value + ?Sized>(v: &'a &'a V) -> Value<'a> { ++ Value::from_sval(v) ++ } ++ ++ #[cfg(feature = "kv_serde")] ++ pub fn capture_serde<'a, V: serde::Serialize + ?Sized>(v: &'a &'a V) -> Value<'a> { ++ Value::from_serde(v) ++ } ++} ++ ++#[cfg(feature = "kv")] ++pub use self::kv_support::*; +diff -Nru mesa-25.3.3/subprojects/log-0.4.26/src/serde.rs mesa-25.3.3/subprojects/log-0.4.26/src/serde.rs +--- mesa-25.3.3/subprojects/log-0.4.26/src/serde.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/log-0.4.26/src/serde.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,397 @@ ++#![cfg(feature = "serde")] ++ ++use serde::de::{ ++ Deserialize, DeserializeSeed, Deserializer, EnumAccess, Error, Unexpected, VariantAccess, ++ Visitor, ++}; ++use serde::ser::{Serialize, Serializer}; ++ ++use crate::{Level, LevelFilter, LOG_LEVEL_NAMES}; ++ ++use std::fmt; ++use std::str::{self, FromStr}; ++ ++// The Deserialize impls are handwritten to be case-insensitive using FromStr. ++ ++impl Serialize for Level { ++ fn serialize(&self, serializer: S) -> Result ++ where ++ S: Serializer, ++ { ++ match *self { ++ Level::Error => serializer.serialize_unit_variant("Level", 0, "ERROR"), ++ Level::Warn => serializer.serialize_unit_variant("Level", 1, "WARN"), ++ Level::Info => serializer.serialize_unit_variant("Level", 2, "INFO"), ++ Level::Debug => serializer.serialize_unit_variant("Level", 3, "DEBUG"), ++ Level::Trace => serializer.serialize_unit_variant("Level", 4, "TRACE"), ++ } ++ } ++} ++ ++impl<'de> Deserialize<'de> for Level { ++ fn deserialize(deserializer: D) -> Result ++ where ++ D: Deserializer<'de>, ++ { ++ struct LevelIdentifier; ++ ++ impl<'de> Visitor<'de> for LevelIdentifier { ++ type Value = Level; ++ ++ fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { ++ formatter.write_str("log level") ++ } ++ ++ fn visit_u64(self, v: u64) -> Result ++ where ++ E: Error, ++ { ++ let variant = LOG_LEVEL_NAMES[1..] ++ .get(v as usize) ++ .ok_or_else(|| Error::invalid_value(Unexpected::Unsigned(v), &self))?; ++ ++ self.visit_str(variant) ++ } ++ ++ fn visit_str(self, s: &str) -> Result ++ where ++ E: Error, ++ { ++ // Case-insensitive. ++ FromStr::from_str(s).map_err(|_| Error::unknown_variant(s, &LOG_LEVEL_NAMES[1..])) ++ } ++ ++ fn visit_bytes(self, value: &[u8]) -> Result ++ where ++ E: Error, ++ { ++ let variant = str::from_utf8(value) ++ .map_err(|_| Error::invalid_value(Unexpected::Bytes(value), &self))?; ++ ++ self.visit_str(variant) ++ } ++ } ++ ++ impl<'de> DeserializeSeed<'de> for LevelIdentifier { ++ type Value = Level; ++ ++ fn deserialize(self, deserializer: D) -> Result ++ where ++ D: Deserializer<'de>, ++ { ++ deserializer.deserialize_identifier(LevelIdentifier) ++ } ++ } ++ ++ struct LevelEnum; ++ ++ impl<'de> Visitor<'de> for LevelEnum { ++ type Value = Level; ++ ++ fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { ++ formatter.write_str("log level") ++ } ++ ++ fn visit_enum(self, value: A) -> Result ++ where ++ A: EnumAccess<'de>, ++ { ++ let (level, variant) = value.variant_seed(LevelIdentifier)?; ++ // Every variant is a unit variant. ++ variant.unit_variant()?; ++ Ok(level) ++ } ++ } ++ ++ deserializer.deserialize_enum("Level", &LOG_LEVEL_NAMES[1..], LevelEnum) ++ } ++} ++ ++impl Serialize for LevelFilter { ++ fn serialize(&self, serializer: S) -> Result ++ where ++ S: Serializer, ++ { ++ match *self { ++ LevelFilter::Off => serializer.serialize_unit_variant("LevelFilter", 0, "OFF"), ++ LevelFilter::Error => serializer.serialize_unit_variant("LevelFilter", 1, "ERROR"), ++ LevelFilter::Warn => serializer.serialize_unit_variant("LevelFilter", 2, "WARN"), ++ LevelFilter::Info => serializer.serialize_unit_variant("LevelFilter", 3, "INFO"), ++ LevelFilter::Debug => serializer.serialize_unit_variant("LevelFilter", 4, "DEBUG"), ++ LevelFilter::Trace => serializer.serialize_unit_variant("LevelFilter", 5, "TRACE"), ++ } ++ } ++} ++ ++impl<'de> Deserialize<'de> for LevelFilter { ++ fn deserialize(deserializer: D) -> Result ++ where ++ D: Deserializer<'de>, ++ { ++ struct LevelFilterIdentifier; ++ ++ impl<'de> Visitor<'de> for LevelFilterIdentifier { ++ type Value = LevelFilter; ++ ++ fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { ++ formatter.write_str("log level filter") ++ } ++ ++ fn visit_u64(self, v: u64) -> Result ++ where ++ E: Error, ++ { ++ let variant = LOG_LEVEL_NAMES ++ .get(v as usize) ++ .ok_or_else(|| Error::invalid_value(Unexpected::Unsigned(v), &self))?; ++ ++ self.visit_str(variant) ++ } ++ ++ fn visit_str(self, s: &str) -> Result ++ where ++ E: Error, ++ { ++ // Case-insensitive. ++ FromStr::from_str(s).map_err(|_| Error::unknown_variant(s, &LOG_LEVEL_NAMES)) ++ } ++ ++ fn visit_bytes(self, value: &[u8]) -> Result ++ where ++ E: Error, ++ { ++ let variant = str::from_utf8(value) ++ .map_err(|_| Error::invalid_value(Unexpected::Bytes(value), &self))?; ++ ++ self.visit_str(variant) ++ } ++ } ++ ++ impl<'de> DeserializeSeed<'de> for LevelFilterIdentifier { ++ type Value = LevelFilter; ++ ++ fn deserialize(self, deserializer: D) -> Result ++ where ++ D: Deserializer<'de>, ++ { ++ deserializer.deserialize_identifier(LevelFilterIdentifier) ++ } ++ } ++ ++ struct LevelFilterEnum; ++ ++ impl<'de> Visitor<'de> for LevelFilterEnum { ++ type Value = LevelFilter; ++ ++ fn expecting(&self, formatter: &mut fmt::Formatter) -> fmt::Result { ++ formatter.write_str("log level filter") ++ } ++ ++ fn visit_enum(self, value: A) -> Result ++ where ++ A: EnumAccess<'de>, ++ { ++ let (level_filter, variant) = value.variant_seed(LevelFilterIdentifier)?; ++ // Every variant is a unit variant. ++ variant.unit_variant()?; ++ Ok(level_filter) ++ } ++ } ++ ++ deserializer.deserialize_enum("LevelFilter", &LOG_LEVEL_NAMES, LevelFilterEnum) ++ } ++} ++ ++#[cfg(test)] ++mod tests { ++ use crate::{Level, LevelFilter}; ++ use serde_test::{assert_de_tokens, assert_de_tokens_error, assert_tokens, Token}; ++ ++ fn level_token(variant: &'static str) -> Token { ++ Token::UnitVariant { ++ name: "Level", ++ variant, ++ } ++ } ++ ++ fn level_bytes_tokens(variant: &'static [u8]) -> [Token; 3] { ++ [ ++ Token::Enum { name: "Level" }, ++ Token::Bytes(variant), ++ Token::Unit, ++ ] ++ } ++ ++ fn level_variant_tokens(variant: u32) -> [Token; 3] { ++ [ ++ Token::Enum { name: "Level" }, ++ Token::U32(variant), ++ Token::Unit, ++ ] ++ } ++ ++ fn level_filter_token(variant: &'static str) -> Token { ++ Token::UnitVariant { ++ name: "LevelFilter", ++ variant, ++ } ++ } ++ ++ fn level_filter_bytes_tokens(variant: &'static [u8]) -> [Token; 3] { ++ [ ++ Token::Enum { ++ name: "LevelFilter", ++ }, ++ Token::Bytes(variant), ++ Token::Unit, ++ ] ++ } ++ ++ fn level_filter_variant_tokens(variant: u32) -> [Token; 3] { ++ [ ++ Token::Enum { ++ name: "LevelFilter", ++ }, ++ Token::U32(variant), ++ Token::Unit, ++ ] ++ } ++ ++ #[test] ++ fn test_level_ser_de() { ++ let cases = &[ ++ (Level::Error, [level_token("ERROR")]), ++ (Level::Warn, [level_token("WARN")]), ++ (Level::Info, [level_token("INFO")]), ++ (Level::Debug, [level_token("DEBUG")]), ++ (Level::Trace, [level_token("TRACE")]), ++ ]; ++ ++ for (s, expected) in cases { ++ assert_tokens(s, expected); ++ } ++ } ++ ++ #[test] ++ fn test_level_case_insensitive() { ++ let cases = &[ ++ (Level::Error, [level_token("error")]), ++ (Level::Warn, [level_token("warn")]), ++ (Level::Info, [level_token("info")]), ++ (Level::Debug, [level_token("debug")]), ++ (Level::Trace, [level_token("trace")]), ++ ]; ++ ++ for (s, expected) in cases { ++ assert_de_tokens(s, expected); ++ } ++ } ++ ++ #[test] ++ fn test_level_de_bytes() { ++ let cases = &[ ++ (Level::Error, level_bytes_tokens(b"ERROR")), ++ (Level::Warn, level_bytes_tokens(b"WARN")), ++ (Level::Info, level_bytes_tokens(b"INFO")), ++ (Level::Debug, level_bytes_tokens(b"DEBUG")), ++ (Level::Trace, level_bytes_tokens(b"TRACE")), ++ ]; ++ ++ for (value, tokens) in cases { ++ assert_de_tokens(value, tokens); ++ } ++ } ++ ++ #[test] ++ fn test_level_de_variant_index() { ++ let cases = &[ ++ (Level::Error, level_variant_tokens(0)), ++ (Level::Warn, level_variant_tokens(1)), ++ (Level::Info, level_variant_tokens(2)), ++ (Level::Debug, level_variant_tokens(3)), ++ (Level::Trace, level_variant_tokens(4)), ++ ]; ++ ++ for (value, tokens) in cases { ++ assert_de_tokens(value, tokens); ++ } ++ } ++ ++ #[test] ++ fn test_level_de_error() { ++ let msg = "unknown variant `errorx`, expected one of \ ++ `ERROR`, `WARN`, `INFO`, `DEBUG`, `TRACE`"; ++ assert_de_tokens_error::(&[level_token("errorx")], msg); ++ } ++ ++ #[test] ++ fn test_level_filter_ser_de() { ++ let cases = &[ ++ (LevelFilter::Off, [level_filter_token("OFF")]), ++ (LevelFilter::Error, [level_filter_token("ERROR")]), ++ (LevelFilter::Warn, [level_filter_token("WARN")]), ++ (LevelFilter::Info, [level_filter_token("INFO")]), ++ (LevelFilter::Debug, [level_filter_token("DEBUG")]), ++ (LevelFilter::Trace, [level_filter_token("TRACE")]), ++ ]; ++ ++ for (s, expected) in cases { ++ assert_tokens(s, expected); ++ } ++ } ++ ++ #[test] ++ fn test_level_filter_case_insensitive() { ++ let cases = &[ ++ (LevelFilter::Off, [level_filter_token("off")]), ++ (LevelFilter::Error, [level_filter_token("error")]), ++ (LevelFilter::Warn, [level_filter_token("warn")]), ++ (LevelFilter::Info, [level_filter_token("info")]), ++ (LevelFilter::Debug, [level_filter_token("debug")]), ++ (LevelFilter::Trace, [level_filter_token("trace")]), ++ ]; ++ ++ for (s, expected) in cases { ++ assert_de_tokens(s, expected); ++ } ++ } ++ ++ #[test] ++ fn test_level_filter_de_bytes() { ++ let cases = &[ ++ (LevelFilter::Off, level_filter_bytes_tokens(b"OFF")), ++ (LevelFilter::Error, level_filter_bytes_tokens(b"ERROR")), ++ (LevelFilter::Warn, level_filter_bytes_tokens(b"WARN")), ++ (LevelFilter::Info, level_filter_bytes_tokens(b"INFO")), ++ (LevelFilter::Debug, level_filter_bytes_tokens(b"DEBUG")), ++ (LevelFilter::Trace, level_filter_bytes_tokens(b"TRACE")), ++ ]; ++ ++ for (value, tokens) in cases { ++ assert_de_tokens(value, tokens); ++ } ++ } ++ ++ #[test] ++ fn test_level_filter_de_variant_index() { ++ let cases = &[ ++ (LevelFilter::Off, level_filter_variant_tokens(0)), ++ (LevelFilter::Error, level_filter_variant_tokens(1)), ++ (LevelFilter::Warn, level_filter_variant_tokens(2)), ++ (LevelFilter::Info, level_filter_variant_tokens(3)), ++ (LevelFilter::Debug, level_filter_variant_tokens(4)), ++ (LevelFilter::Trace, level_filter_variant_tokens(5)), ++ ]; ++ ++ for (value, tokens) in cases { ++ assert_de_tokens(value, tokens); ++ } ++ } ++ ++ #[test] ++ fn test_level_filter_de_error() { ++ let msg = "unknown variant `errorx`, expected one of \ ++ `OFF`, `ERROR`, `WARN`, `INFO`, `DEBUG`, `TRACE`"; ++ assert_de_tokens_error::(&[level_filter_token("errorx")], msg); ++ } ++} +diff -Nru mesa-25.3.3/subprojects/log-0.4.26/triagebot.toml mesa-25.3.3/subprojects/log-0.4.26/triagebot.toml +--- mesa-25.3.3/subprojects/log-0.4.26/triagebot.toml 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/log-0.4.26/triagebot.toml 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1 @@ ++[assign] +diff -Nru mesa-25.3.3/subprojects/log-0.4-rs.wrap mesa-25.3.3/subprojects/log-0.4-rs.wrap +--- mesa-25.3.3/subprojects/log-0.4-rs.wrap 2026-01-01 13:34:04.000000000 -0500 ++++ mesa-25.3.3/subprojects/log-0.4-rs.wrap 2026-05-29 13:40:54.000000000 -0500 +@@ -1,6 +1,4 @@ + [wrap-file] +-directory = log-0.4.27 +-source_url = https://crates.io/api/v1/crates/log/0.4.27/download +-source_filename = log-0.4.27.tar.gz +-source_hash = 13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94 ++directory = log-0.4.26 + patch_directory = log-0.4-rs ++ +diff -Nru mesa-25.3.3/subprojects/once_cell-1.20.2/bors.toml mesa-25.3.3/subprojects/once_cell-1.20.2/bors.toml +--- mesa-25.3.3/subprojects/once_cell-1.20.2/bors.toml 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/once_cell-1.20.2/bors.toml 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,2 @@ ++status = [ "Rust" ] ++delete_merged_branches = true +diff -Nru mesa-25.3.3/subprojects/once_cell-1.20.2/.cargo-checksum.json mesa-25.3.3/subprojects/once_cell-1.20.2/.cargo-checksum.json +--- mesa-25.3.3/subprojects/once_cell-1.20.2/.cargo-checksum.json 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/once_cell-1.20.2/.cargo-checksum.json 2024-10-15 15:05:29.000000000 -0500 +@@ -0,0 +1 @@ ++{"package":"Could not get crate checksum","files":{}} +diff -Nru mesa-25.3.3/subprojects/once_cell-1.20.2/Cargo.toml mesa-25.3.3/subprojects/once_cell-1.20.2/Cargo.toml +--- mesa-25.3.3/subprojects/once_cell-1.20.2/Cargo.toml 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/once_cell-1.20.2/Cargo.toml 2024-10-15 15:05:29.000000000 -0500 +@@ -0,0 +1,118 @@ ++# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO ++# ++# When uploading crates to the registry Cargo will automatically ++# "normalize" Cargo.toml files for maximal compatibility ++# with all versions of Cargo and also rewrite `path` dependencies ++# to registry (e.g., crates.io) dependencies. ++# ++# If you are reading this file be aware that the original Cargo.toml ++# will likely look very different (and much more reasonable). ++# See Cargo.toml.orig for the original contents. ++ ++[package] ++edition = "2021" ++rust-version = "1.60" ++name = "once_cell" ++version = "1.20.2" ++authors = ["Aleksey Kladov "] ++build = false ++exclude = [ ++ "*.png", ++ "*.svg", ++ "/Cargo.lock.msrv", ++ "rustfmt.toml", ++] ++autobins = false ++autoexamples = false ++autotests = false ++autobenches = false ++description = "Single assignment cells and lazy values." ++documentation = "https://docs.rs/once_cell" ++readme = "README.md" ++keywords = [ ++ "lazy", ++ "static", ++] ++categories = [ ++ "rust-patterns", ++ "memory-management", ++] ++license = "MIT OR Apache-2.0" ++repository = "https://github.com/matklad/once_cell" ++ ++[package.metadata.docs.rs] ++all-features = true ++rustdoc-args = ["--generate-link-to-definition"] ++ ++[lib] ++name = "once_cell" ++path = "src/lib.rs" ++ ++[[example]] ++name = "bench" ++path = "examples/bench.rs" ++required-features = ["std"] ++ ++[[example]] ++name = "bench_acquire" ++path = "examples/bench_acquire.rs" ++required-features = ["std"] ++ ++[[example]] ++name = "lazy_static" ++path = "examples/lazy_static.rs" ++required-features = ["std"] ++ ++[[example]] ++name = "reentrant_init_deadlocks" ++path = "examples/reentrant_init_deadlocks.rs" ++required-features = ["std"] ++ ++[[example]] ++name = "regex" ++path = "examples/regex.rs" ++required-features = ["std"] ++ ++[[example]] ++name = "test_synchronization" ++path = "examples/test_synchronization.rs" ++required-features = ["std"] ++ ++[[test]] ++name = "it" ++path = "tests/it/main.rs" ++ ++[dependencies.critical-section] ++version = "1.1.3" ++optional = true ++ ++[dependencies.parking_lot_core] ++version = "0.9.10" ++optional = true ++default-features = false ++ ++[dependencies.portable-atomic] ++version = "1.8" ++optional = true ++default-features = false ++ ++[dev-dependencies.critical-section] ++version = "1.1.3" ++features = ["std"] ++ ++[dev-dependencies.regex] ++version = "1.10.6" ++ ++[features] ++alloc = ["race"] ++atomic-polyfill = ["critical-section"] ++critical-section = [ ++ "dep:critical-section", ++ "portable-atomic", ++] ++default = ["std"] ++parking_lot = ["dep:parking_lot_core"] ++portable-atomic = ["dep:portable-atomic"] ++race = [] ++std = ["alloc"] ++unstable = [] +diff -Nru mesa-25.3.3/subprojects/once_cell-1.20.2/.cargo_vcs_info.json mesa-25.3.3/subprojects/once_cell-1.20.2/.cargo_vcs_info.json +--- mesa-25.3.3/subprojects/once_cell-1.20.2/.cargo_vcs_info.json 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/once_cell-1.20.2/.cargo_vcs_info.json 2024-10-15 15:05:29.000000000 -0500 +@@ -0,0 +1,6 @@ ++{ ++ "git": { ++ "sha1": "4fbd4a53509ca59c8e09efc2ab0a22f21de70f7e" ++ }, ++ "path_in_vcs": "" ++} +\ No hay ningún carácter de nueva línea al final del archivo +diff -Nru mesa-25.3.3/subprojects/once_cell-1.20.2/CHANGELOG.md mesa-25.3.3/subprojects/once_cell-1.20.2/CHANGELOG.md +--- mesa-25.3.3/subprojects/once_cell-1.20.2/CHANGELOG.md 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/once_cell-1.20.2/CHANGELOG.md 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,238 @@ ++# Changelog ++ ++## Unreleased ++ ++## 1.20.2 ++ ++- Remove `portable_atomic` from Cargo.lock if it is not, in fact, used: [#267](https://github.com/matklad/once_cell/pull/267) ++ This is a work-around for this cargo bug: https://github.com/rust-lang/cargo/issues/10801. ++ ++## 1.20.1 ++ ++- Allow using `race` module using just `portable_atomic`, without `critical_section` and provide ++ better error messages on targets without atomic CAS instruction, ++ [#265](https://github.com/matklad/once_cell/pull/265). ++ ++## 1.19.0 ++ ++- Use `portable-atomic` instead of `atomic-polyfill`, [#251](https://github.com/matklad/once_cell/pull/251). ++ ++## 1.18.0 ++ ++- `MSRV` is updated to 1.60.0 to take advantage of `dep:` syntax for cargo features, ++ removing "implementation details" from publicly visible surface. ++ ++## 1.17.2 ++ ++- Avoid unnecessary synchronization in `Lazy::{force,deref}_mut()`, [#231](https://github.com/matklad/once_cell/pull/231). ++ ++## 1.17.1 ++ ++- Make `OnceRef` implementation compliant with [strict provenance](https://github.com/rust-lang/rust/issues/95228). ++ ++## 1.17.0 ++ ++- Add `race::OnceRef` for storing a `&'a T`. ++ ++## 1.16.0 ++ ++- Add `no_std` implementation based on `critical-section`, ++ [#195](https://github.com/matklad/once_cell/pull/195). ++- Deprecate `atomic-polyfill` feature (use the new `critical-section` instead) ++ ++## 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). ++- Upgrade `atomic-polyfill` to `1.0` ++ ++## 1.13.0 ++ ++- Add `Lazy::get`, similar to `OnceCell::get`. ++ ++## 1.12.1 ++ ++- Remove incorrect `debug_assert`. ++ ++## 1.12.0 ++ ++- Add `OnceCell::wait`, a blocking variant of `get`. ++ ++## 1.11.0 ++ ++- Add `OnceCell::with_value` to create initialized `OnceCell` in `const` context. ++- Improve `Clone` implementation for `OnceCell`. ++- Rewrite `parking_lot` version on top of `parking_lot_core`, for even smaller cells! ++ ++## 1.10.0 ++ ++- upgrade `parking_lot` to `0.12.0` (note that this bumps MSRV with `parking_lot` feature enabled to `1.49.0`). ++ ++## 1.9.0 ++ ++- Added an `atomic-polyfill` optional dependency to compile `race` on platforms without atomics ++ ++## 1.8.0 ++ ++- Add `try_insert` API -- a version of `set` that returns a reference. ++ ++## 1.7.2 ++ ++- Improve code size when using parking_lot feature. ++ ++## 1.7.1 ++ ++- Fix `race::OnceBox` to also impl `Default` even if `T` doesn't impl `Default`. ++ ++## 1.7.0 ++ ++- Hide the `race` module behind (default) `race` feature. ++ Turns out that adding `race` by default was a breaking change on some platforms without atomics. ++ In this release, we make the module opt-out. ++ Technically, this is a breaking change for those who use `race` with `no_default_features`. ++ Given that the `race` module itself only several days old, the breakage is deemed acceptable. ++ ++## 1.6.0 ++ ++- Add `Lazy::into_value` ++- Stabilize `once_cell::race` module for "first one wins" no_std-compatible initialization flavor. ++- Migrate from deprecated `compare_and_swap` to `compare_exchange`. ++ ++## 1.5.2 ++ ++- `OnceBox` API uses `Box`. ++ This a breaking change to unstable API. ++ ++## 1.5.1 ++ ++- MSRV is increased to `1.36.0`. ++- document `once_cell::race` module. ++- introduce `alloc` feature for `OnceBox`. ++- fix `OnceBox::set`. ++ ++## 1.5.0 ++ ++- add new `once_cell::race` module for "first one wins" no_std-compatible initialization flavor. ++ The API is provisional, subject to change and is gated by the `unstable` cargo feature. ++ ++## 1.4.1 ++ ++- upgrade `parking_lot` to `0.11.0` ++- make `sync::OnceCell` pass https://doc.rust-lang.org/nomicon/dropck.html#an-escape-hatch[dropck] with `parking_lot` feature enabled. ++ This fixes a (minor) semver-incompatible changed introduced in `1.4.0` ++ ++## 1.4.0 ++ ++- upgrade `parking_lot` to `0.10` (note that this bumps MSRV with `parking_lot` feature enabled to `1.36.0`). ++- add `OnceCell::take`. ++- upgrade crossbeam utils (private dependency) to `0.7`. ++ ++## 1.3.1 ++ ++- remove unnecessary `F: fmt::Debug` bound from `impl fmt::Debug for Lazy`. ++ ++## 1.3.0 ++ ++- `Lazy` now implements `DerefMut`. ++- update implementation according to the latest changes in `std`. ++ ++## 1.2.0 ++ ++- add `sync::OnceCell::get_unchecked`. ++ ++## 1.1.0 ++ ++- implement `Default` for `Lazy`: it creates an empty `Lazy` which is initialized with `T::default` on first access. ++- add `OnceCell::get_mut`. ++ ++## 1.0.2 ++ ++- actually add `#![no_std]` attribute if std feature is not enabled. ++ ++## 1.0.1 ++ ++- fix unsoundness in `Lazy` if the initializing function panics. Thanks [@xfix](https://github.com/xfix)! ++- implement `RefUnwindSafe` for `Lazy`. ++- share more code between `std` and `parking_lot` implementations. ++- add F.A.Q section to the docs. ++ ++## 1.0.0 ++ ++- remove `parking_lot` from the list of default features. ++- add `std` default feature. Without `std`, only `unsync` module is supported. ++- implement `Eq` for `OnceCell`. ++- fix wrong `Sync` bound on `sync::Lazy`. ++- run the whole test suite with miri. ++ ++## 0.2.7 ++ ++- New implementation of `sync::OnceCell` if `parking_lot` feature is disabled. ++ It now employs a hand-rolled variant of `std::sync::Once`. ++- `sync::OnceCell::get_or_try_init` works without `parking_lot` as well! ++- document the effects of `parking_lot` feature: same performance but smaller types. ++ ++## 0.2.6 ++ ++- Updated `Lazy`'s `Deref` impl to requires only `FnOnce` instead of `Fn` ++ ++## 0.2.5 ++ ++- `Lazy` requires only `FnOnce` instead of `Fn` ++ ++## 0.2.4 ++ ++- nicer `fmt::Debug` implementation ++ ++## 0.2.3 ++ ++- update `parking_lot` to `0.9.0` ++- fix stacked borrows violation in `unsync::OnceCell::get` ++- implement `Clone` for `sync::OnceCell where T: Clone` ++ ++## 0.2.2 ++ ++- add `OnceCell::into_inner` which consumes a cell and returns an option ++ ++## 0.2.1 ++ ++- implement `sync::OnceCell::get_or_try_init` if `parking_lot` feature is enabled ++- switch internal `unsafe` implementation of `sync::OnceCell` from `Once` to `Mutex` ++- `sync::OnceCell::get_or_init` is twice as fast if cell is already initialized ++- implement `std::panic::RefUnwindSafe` and `std::panic::UnwindSafe` for `OnceCell` ++- better document behavior around panics ++ ++## 0.2.0 ++ ++- MSRV is now 1.31.1 ++- `Lazy::new` and `OnceCell::new` are now const-fns ++- `unsync_lazy` and `sync_lazy` macros are removed ++ ++## 0.1.8 ++ ++- update crossbeam-utils to 0.6 ++- enable bors-ng ++ ++## 0.1.7 ++ ++- cells implement `PartialEq` and `From` ++- MSRV is down to 1.24.1 ++- update `parking_lot` to `0.7.1` ++ ++## 0.1.6 ++ ++- `unsync::OnceCell` is `Clone` if `T` is `Clone`. ++ ++## 0.1.5 ++ ++- No changelog until this point :( +diff -Nru mesa-25.3.3/subprojects/once_cell-1.20.2/debian/patches/relax-test.diff mesa-25.3.3/subprojects/once_cell-1.20.2/debian/patches/relax-test.diff +--- mesa-25.3.3/subprojects/once_cell-1.20.2/debian/patches/relax-test.diff 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/once_cell-1.20.2/debian/patches/relax-test.diff 2024-10-15 15:05:29.000000000 -0500 +@@ -0,0 +1,12 @@ ++--- a/tests/it/sync_once_cell.rs +++++ b/tests/it/sync_once_cell.rs ++@@ -395,3 +395,3 @@ ++ ++-#[test] +++/*#[test] ++ #[cfg_attr(miri, ignore)] // miri doesn't support processes ++@@ -422,3 +422,3 @@ ++ } ++-} +++}*/ ++ +diff -Nru mesa-25.3.3/subprojects/once_cell-1.20.2/debian/patches/series mesa-25.3.3/subprojects/once_cell-1.20.2/debian/patches/series +--- mesa-25.3.3/subprojects/once_cell-1.20.2/debian/patches/series 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/once_cell-1.20.2/debian/patches/series 2024-10-15 15:05:29.000000000 -0500 +@@ -0,0 +1 @@ ++relax-test.diff +diff -Nru mesa-25.3.3/subprojects/once_cell-1.20.2/examples/bench_acquire.rs mesa-25.3.3/subprojects/once_cell-1.20.2/examples/bench_acquire.rs +--- mesa-25.3.3/subprojects/once_cell-1.20.2/examples/bench_acquire.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/once_cell-1.20.2/examples/bench_acquire.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,39 @@ ++//! Benchmark the overhead that the synchronization of `OnceCell::get` causes. ++//! We do some other operations that write to memory to get an imprecise but somewhat realistic ++//! measurement. ++ ++use once_cell::sync::OnceCell; ++use std::sync::atomic::{AtomicUsize, Ordering}; ++ ++const N_THREADS: usize = 16; ++const N_ROUNDS: usize = 1_000_000; ++ ++static CELL: OnceCell = OnceCell::new(); ++static OTHER: AtomicUsize = AtomicUsize::new(0); ++ ++fn main() { ++ let start = std::time::Instant::now(); ++ let threads = ++ (0..N_THREADS).map(|i| std::thread::spawn(move || thread_main(i))).collect::>(); ++ for thread in threads { ++ thread.join().unwrap(); ++ } ++ println!("{:?}", start.elapsed()); ++ println!("{:?}", OTHER.load(Ordering::Relaxed)); ++} ++ ++#[inline(never)] ++fn thread_main(i: usize) { ++ // The operations we do here don't really matter, as long as we do multiple writes, and ++ // everything is messy enough to prevent the compiler from optimizing the loop away. ++ let mut data = [i; 128]; ++ let mut accum = 0usize; ++ for _ in 0..N_ROUNDS { ++ let _value = CELL.get_or_init(|| i + 1); ++ let k = OTHER.fetch_add(data[accum & 0x7F] as usize, Ordering::Relaxed); ++ for j in data.iter_mut() { ++ *j = (*j).wrapping_add(accum); ++ accum = accum.wrapping_add(k); ++ } ++ } ++} +diff -Nru mesa-25.3.3/subprojects/once_cell-1.20.2/examples/bench.rs mesa-25.3.3/subprojects/once_cell-1.20.2/examples/bench.rs +--- mesa-25.3.3/subprojects/once_cell-1.20.2/examples/bench.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/once_cell-1.20.2/examples/bench.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,28 @@ ++use std::mem::size_of; ++ ++use once_cell::sync::OnceCell; ++ ++const N_THREADS: usize = 32; ++const N_ROUNDS: usize = 100_000_000; ++ ++static CELL: OnceCell = OnceCell::new(); ++ ++fn main() { ++ let start = std::time::Instant::now(); ++ let threads = ++ (0..N_THREADS).map(|i| std::thread::spawn(move || thread_main(i))).collect::>(); ++ for thread in threads { ++ thread.join().unwrap(); ++ } ++ println!("{:?}", start.elapsed()); ++ println!("size_of::>() = {:?}", size_of::>()); ++ println!("size_of::>() = {:?}", size_of::>()); ++ println!("size_of::>() = {:?}", size_of::>()); ++} ++ ++fn thread_main(i: usize) { ++ for _ in 0..N_ROUNDS { ++ let &value = CELL.get_or_init(|| i); ++ assert!(value < N_THREADS) ++ } ++} +diff -Nru mesa-25.3.3/subprojects/once_cell-1.20.2/examples/lazy_static.rs mesa-25.3.3/subprojects/once_cell-1.20.2/examples/lazy_static.rs +--- mesa-25.3.3/subprojects/once_cell-1.20.2/examples/lazy_static.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/once_cell-1.20.2/examples/lazy_static.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,36 @@ ++extern crate once_cell; ++ ++use once_cell::sync::{Lazy, OnceCell}; ++use std::collections::HashMap; ++ ++static HASHMAP: Lazy> = Lazy::new(|| { ++ let mut m = HashMap::new(); ++ m.insert(0, "foo"); ++ m.insert(1, "bar"); ++ m.insert(2, "baz"); ++ m ++}); ++ ++// Same, but completely without macros ++fn hashmap() -> &'static HashMap { ++ static INSTANCE: OnceCell> = OnceCell::new(); ++ INSTANCE.get_or_init(|| { ++ let mut m = HashMap::new(); ++ m.insert(0, "foo"); ++ m.insert(1, "bar"); ++ m.insert(2, "baz"); ++ m ++ }) ++} ++ ++fn main() { ++ // First access to `HASHMAP` initializes it ++ println!("The entry for `0` is \"{}\".", HASHMAP.get(&0).unwrap()); ++ ++ // Any further access to `HASHMAP` just returns the computed value ++ println!("The entry for `1` is \"{}\".", HASHMAP.get(&1).unwrap()); ++ ++ // The same works for function-style: ++ assert_eq!(hashmap().get(&0), Some(&"foo")); ++ assert_eq!(hashmap().get(&1), Some(&"bar")); ++} +diff -Nru mesa-25.3.3/subprojects/once_cell-1.20.2/examples/reentrant_init_deadlocks.rs mesa-25.3.3/subprojects/once_cell-1.20.2/examples/reentrant_init_deadlocks.rs +--- mesa-25.3.3/subprojects/once_cell-1.20.2/examples/reentrant_init_deadlocks.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/once_cell-1.20.2/examples/reentrant_init_deadlocks.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,14 @@ ++fn main() { ++ let cell = once_cell::sync::OnceCell::::new(); ++ cell.get_or_init(|| { ++ cell.get_or_init(|| 1); ++ 2 ++ }); ++} ++ ++/// Dummy test to make it seem hang when compiled as `--test` ++/// See https://github.com/matklad/once_cell/issues/79 ++#[test] ++fn dummy_test() { ++ std::thread::sleep(std::time::Duration::from_secs(4)); ++} +diff -Nru mesa-25.3.3/subprojects/once_cell-1.20.2/examples/regex.rs mesa-25.3.3/subprojects/once_cell-1.20.2/examples/regex.rs +--- mesa-25.3.3/subprojects/once_cell-1.20.2/examples/regex.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/once_cell-1.20.2/examples/regex.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,49 @@ ++use std::{str::FromStr, time::Instant}; ++ ++use regex::Regex; ++ ++macro_rules! regex { ++ ($re:literal $(,)?) => {{ ++ static RE: once_cell::sync::OnceCell = once_cell::sync::OnceCell::new(); ++ RE.get_or_init(|| regex::Regex::new($re).unwrap()) ++ }}; ++} ++ ++fn slow() { ++ let s = r##"13.28.24.13 - - [10/Mar/2016:19:29:25 +0100] "GET /etc/lib/pChart2/examples/index.php?Action=View&Script=../../../../cnf/db.php HTTP/1.1" 404 151 "-" "HTTP_Request2/2.2.1 (http://pear.php.net/package/http_request2) PHP/5.3.16""##; ++ ++ let mut total = 0; ++ for _ in 0..1000 { ++ let re = Regex::new( ++ r##"^(\S+) (\S+) (\S+) \[([^]]+)\] "([^"]*)" (\d+) (\d+) "([^"]*)" "([^"]*)"$"##, ++ ) ++ .unwrap(); ++ let size = usize::from_str(re.captures(s).unwrap().get(7).unwrap().as_str()).unwrap(); ++ total += size; ++ } ++ println!("{}", total); ++} ++ ++fn fast() { ++ let s = r##"13.28.24.13 - - [10/Mar/2016:19:29:25 +0100] "GET /etc/lib/pChart2/examples/index.php?Action=View&Script=../../../../cnf/db.php HTTP/1.1" 404 151 "-" "HTTP_Request2/2.2.1 (http://pear.php.net/package/http_request2) PHP/5.3.16""##; ++ ++ let mut total = 0; ++ for _ in 0..1000 { ++ let re: &Regex = regex!( ++ r##"^(\S+) (\S+) (\S+) \[([^]]+)\] "([^"]*)" (\d+) (\d+) "([^"]*)" "([^"]*)"$"##, ++ ); ++ let size = usize::from_str(re.captures(s).unwrap().get(7).unwrap().as_str()).unwrap(); ++ total += size; ++ } ++ println!("{}", total); ++} ++ ++fn main() { ++ let t = Instant::now(); ++ slow(); ++ println!("slow: {:?}", t.elapsed()); ++ ++ let t = Instant::now(); ++ fast(); ++ println!("fast: {:?}", t.elapsed()); ++} +diff -Nru mesa-25.3.3/subprojects/once_cell-1.20.2/examples/test_synchronization.rs mesa-25.3.3/subprojects/once_cell-1.20.2/examples/test_synchronization.rs +--- mesa-25.3.3/subprojects/once_cell-1.20.2/examples/test_synchronization.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/once_cell-1.20.2/examples/test_synchronization.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,38 @@ ++//! Test if the OnceCell properly synchronizes. ++//! Needs to be run in release mode. ++//! ++//! We create a `Vec` with `N_ROUNDS` of `OnceCell`s. All threads will walk the `Vec`, and race to ++//! be the first one to initialize a cell. ++//! Every thread adds the results of the cells it sees to an accumulator, which is compared at the ++//! end. ++//! All threads should end up with the same result. ++ ++use once_cell::sync::OnceCell; ++ ++const N_THREADS: usize = 32; ++const N_ROUNDS: usize = 1_000_000; ++ ++static CELLS: OnceCell>> = OnceCell::new(); ++static RESULT: OnceCell = OnceCell::new(); ++ ++fn main() { ++ let start = std::time::Instant::now(); ++ CELLS.get_or_init(|| vec![OnceCell::new(); N_ROUNDS]); ++ let threads = ++ (0..N_THREADS).map(|i| std::thread::spawn(move || thread_main(i))).collect::>(); ++ for thread in threads { ++ thread.join().unwrap(); ++ } ++ println!("{:?}", start.elapsed()); ++ println!("No races detected"); ++} ++ ++fn thread_main(i: usize) { ++ let cells = CELLS.get().unwrap(); ++ let mut accum = 0; ++ for cell in cells.iter() { ++ let &value = cell.get_or_init(|| i); ++ accum += value; ++ } ++ assert_eq!(RESULT.get_or_init(|| accum), &accum); ++} +diff -Nru mesa-25.3.3/subprojects/once_cell-1.20.2/.github/workflows/ci.yaml mesa-25.3.3/subprojects/once_cell-1.20.2/.github/workflows/ci.yaml +--- mesa-25.3.3/subprojects/once_cell-1.20.2/.github/workflows/ci.yaml 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/once_cell-1.20.2/.github/workflows/ci.yaml 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,28 @@ ++name: CI ++on: ++ pull_request: ++ push: ++ branches: ["master", "staging", "trying"] ++ ++env: ++ CARGO_INCREMENTAL: 0 ++ CARGO_NET_RETRY: 10 ++ CI: 1 ++ RUST_BACKTRACE: short ++ RUSTFLAGS: -D warnings ++ RUSTUP_MAX_RETRIES: 10 ++ ++jobs: ++ test: ++ name: Rust ++ runs-on: ubuntu-latest ++ ++ steps: ++ - uses: actions/checkout@v2 ++ with: ++ fetch-depth: 0 # fetch tags for publish ++ - uses: Swatinem/rust-cache@359a70e43a0bb8a13953b04a90f76428b4959bb6 ++ - run: cargo run -p xtask -- ci ++ env: ++ CARGO_REGISTRY_TOKEN: ${{ secrets.CRATES_IO_TOKEN }} ++ MIRIFLAGS: -Zmiri-strict-provenance +diff -Nru mesa-25.3.3/subprojects/once_cell-1.20.2/.gitignore mesa-25.3.3/subprojects/once_cell-1.20.2/.gitignore +--- mesa-25.3.3/subprojects/once_cell-1.20.2/.gitignore 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/once_cell-1.20.2/.gitignore 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,3 @@ ++/target ++/.vscode ++Cargo.lock +diff -Nru mesa-25.3.3/subprojects/once_cell-1.20.2/LICENSE-APACHE mesa-25.3.3/subprojects/once_cell-1.20.2/LICENSE-APACHE +--- mesa-25.3.3/subprojects/once_cell-1.20.2/LICENSE-APACHE 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/once_cell-1.20.2/LICENSE-APACHE 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,201 @@ ++ Apache License ++ Version 2.0, January 2004 ++ http://www.apache.org/licenses/ ++ ++TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION ++ ++1. Definitions. ++ ++ "License" shall mean the terms and conditions for use, reproduction, ++ and distribution as defined by Sections 1 through 9 of this document. ++ ++ "Licensor" shall mean the copyright owner or entity authorized by ++ the copyright owner that is granting the License. ++ ++ "Legal Entity" shall mean the union of the acting entity and all ++ other entities that control, are controlled by, or are under common ++ control with that entity. For the purposes of this definition, ++ "control" means (i) the power, direct or indirect, to cause the ++ direction or management of such entity, whether by contract or ++ otherwise, or (ii) ownership of fifty percent (50%) or more of the ++ outstanding shares, or (iii) beneficial ownership of such entity. ++ ++ "You" (or "Your") shall mean an individual or Legal Entity ++ exercising permissions granted by this License. ++ ++ "Source" form shall mean the preferred form for making modifications, ++ including but not limited to software source code, documentation ++ source, and configuration files. ++ ++ "Object" form shall mean any form resulting from mechanical ++ transformation or translation of a Source form, including but ++ not limited to compiled object code, generated documentation, ++ and conversions to other media types. ++ ++ "Work" shall mean the work of authorship, whether in Source or ++ Object form, made available under the License, as indicated by a ++ copyright notice that is included in or attached to the work ++ (an example is provided in the Appendix below). ++ ++ "Derivative Works" shall mean any work, whether in Source or Object ++ form, that is based on (or derived from) the Work and for which the ++ editorial revisions, annotations, elaborations, or other modifications ++ represent, as a whole, an original work of authorship. For the purposes ++ of this License, Derivative Works shall not include works that remain ++ separable from, or merely link (or bind by name) to the interfaces of, ++ the Work and Derivative Works thereof. ++ ++ "Contribution" shall mean any work of authorship, including ++ the original version of the Work and any modifications or additions ++ to that Work or Derivative Works thereof, that is intentionally ++ submitted to Licensor for inclusion in the Work by the copyright owner ++ or by an individual or Legal Entity authorized to submit on behalf of ++ the copyright owner. For the purposes of this definition, "submitted" ++ means any form of electronic, verbal, or written communication sent ++ to the Licensor or its representatives, including but not limited to ++ communication on electronic mailing lists, source code control systems, ++ and issue tracking systems that are managed by, or on behalf of, the ++ Licensor for the purpose of discussing and improving the Work, but ++ excluding communication that is conspicuously marked or otherwise ++ designated in writing by the copyright owner as "Not a Contribution." ++ ++ "Contributor" shall mean Licensor and any individual or Legal Entity ++ on behalf of whom a Contribution has been received by Licensor and ++ subsequently incorporated within the Work. ++ ++2. Grant of Copyright License. Subject to the terms and conditions of ++ this License, each Contributor hereby grants to You a perpetual, ++ worldwide, non-exclusive, no-charge, royalty-free, irrevocable ++ copyright license to reproduce, prepare Derivative Works of, ++ publicly display, publicly perform, sublicense, and distribute the ++ Work and such Derivative Works in Source or Object form. ++ ++3. Grant of Patent License. Subject to the terms and conditions of ++ this License, each Contributor hereby grants to You a perpetual, ++ worldwide, non-exclusive, no-charge, royalty-free, irrevocable ++ (except as stated in this section) patent license to make, have made, ++ use, offer to sell, sell, import, and otherwise transfer the Work, ++ where such license applies only to those patent claims licensable ++ by such Contributor that are necessarily infringed by their ++ Contribution(s) alone or by combination of their Contribution(s) ++ with the Work to which such Contribution(s) was submitted. If You ++ institute patent litigation against any entity (including a ++ cross-claim or counterclaim in a lawsuit) alleging that the Work ++ or a Contribution incorporated within the Work constitutes direct ++ or contributory patent infringement, then any patent licenses ++ granted to You under this License for that Work shall terminate ++ as of the date such litigation is filed. ++ ++4. Redistribution. You may reproduce and distribute copies of the ++ Work or Derivative Works thereof in any medium, with or without ++ modifications, and in Source or Object form, provided that You ++ meet the following conditions: ++ ++ (a) You must give any other recipients of the Work or ++ Derivative Works a copy of this License; and ++ ++ (b) You must cause any modified files to carry prominent notices ++ stating that You changed the files; and ++ ++ (c) You must retain, in the Source form of any Derivative Works ++ that You distribute, all copyright, patent, trademark, and ++ attribution notices from the Source form of the Work, ++ excluding those notices that do not pertain to any part of ++ the Derivative Works; and ++ ++ (d) If the Work includes a "NOTICE" text file as part of its ++ distribution, then any Derivative Works that You distribute must ++ include a readable copy of the attribution notices contained ++ within such NOTICE file, excluding those notices that do not ++ pertain to any part of the Derivative Works, in at least one ++ of the following places: within a NOTICE text file distributed ++ as part of the Derivative Works; within the Source form or ++ documentation, if provided along with the Derivative Works; or, ++ within a display generated by the Derivative Works, if and ++ wherever such third-party notices normally appear. The contents ++ of the NOTICE file are for informational purposes only and ++ do not modify the License. You may add Your own attribution ++ notices within Derivative Works that You distribute, alongside ++ or as an addendum to the NOTICE text from the Work, provided ++ that such additional attribution notices cannot be construed ++ as modifying the License. ++ ++ You may add Your own copyright statement to Your modifications and ++ may provide additional or different license terms and conditions ++ for use, reproduction, or distribution of Your modifications, or ++ for any such Derivative Works as a whole, provided Your use, ++ reproduction, and distribution of the Work otherwise complies with ++ the conditions stated in this License. ++ ++5. Submission of Contributions. Unless You explicitly state otherwise, ++ any Contribution intentionally submitted for inclusion in the Work ++ by You to the Licensor shall be under the terms and conditions of ++ this License, without any additional terms or conditions. ++ Notwithstanding the above, nothing herein shall supersede or modify ++ the terms of any separate license agreement you may have executed ++ with Licensor regarding such Contributions. ++ ++6. Trademarks. This License does not grant permission to use the trade ++ names, trademarks, service marks, or product names of the Licensor, ++ except as required for reasonable and customary use in describing the ++ origin of the Work and reproducing the content of the NOTICE file. ++ ++7. Disclaimer of Warranty. Unless required by applicable law or ++ agreed to in writing, Licensor provides the Work (and each ++ Contributor provides its Contributions) on an "AS IS" BASIS, ++ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or ++ implied, including, without limitation, any warranties or conditions ++ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A ++ PARTICULAR PURPOSE. You are solely responsible for determining the ++ appropriateness of using or redistributing the Work and assume any ++ risks associated with Your exercise of permissions under this License. ++ ++8. Limitation of Liability. In no event and under no legal theory, ++ whether in tort (including negligence), contract, or otherwise, ++ unless required by applicable law (such as deliberate and grossly ++ negligent acts) or agreed to in writing, shall any Contributor be ++ liable to You for damages, including any direct, indirect, special, ++ incidental, or consequential damages of any character arising as a ++ result of this License or out of the use or inability to use the ++ Work (including but not limited to damages for loss of goodwill, ++ work stoppage, computer failure or malfunction, or any and all ++ other commercial damages or losses), even if such Contributor ++ has been advised of the possibility of such damages. ++ ++9. Accepting Warranty or Additional Liability. While redistributing ++ the Work or Derivative Works thereof, You may choose to offer, ++ and charge a fee for, acceptance of support, warranty, indemnity, ++ or other liability obligations and/or rights consistent with this ++ License. However, in accepting such obligations, You may act only ++ on Your own behalf and on Your sole responsibility, not on behalf ++ of any other Contributor, and only if You agree to indemnify, ++ defend, and hold each Contributor harmless for any liability ++ incurred by, or claims asserted against, such Contributor by reason ++ of your accepting any such warranty or additional liability. ++ ++END OF TERMS AND CONDITIONS ++ ++APPENDIX: How to apply the Apache License to your work. ++ ++ To apply the Apache License to your work, attach the following ++ boilerplate notice, with the fields enclosed by brackets "[]" ++ replaced with your own identifying information. (Don't include ++ the brackets!) The text should be enclosed in the appropriate ++ comment syntax for the file format. We also recommend that a ++ file or class name and description of purpose be included on the ++ same "printed page" as the copyright notice for easier ++ identification within third-party archives. ++ ++Copyright [yyyy] [name of copyright owner] ++ ++Licensed under the Apache License, Version 2.0 (the "License"); ++you may not use this file except in compliance with the License. ++You may obtain a copy of the License at ++ ++ http://www.apache.org/licenses/LICENSE-2.0 ++ ++Unless required by applicable law or agreed to in writing, software ++distributed under the License is distributed on an "AS IS" BASIS, ++WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. ++See the License for the specific language governing permissions and ++limitations under the License. +diff -Nru mesa-25.3.3/subprojects/once_cell-1.20.2/LICENSE-MIT mesa-25.3.3/subprojects/once_cell-1.20.2/LICENSE-MIT +--- mesa-25.3.3/subprojects/once_cell-1.20.2/LICENSE-MIT 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/once_cell-1.20.2/LICENSE-MIT 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,23 @@ ++Permission is hereby granted, free of charge, to any ++person obtaining a copy of this software and associated ++documentation files (the "Software"), to deal in the ++Software without restriction, including without ++limitation the rights to use, copy, modify, merge, ++publish, distribute, sublicense, and/or sell copies of ++the Software, and to permit persons to whom the Software ++is furnished to do so, subject to the following ++conditions: ++ ++The above copyright notice and this permission notice ++shall be included in all copies or substantial portions ++of the Software. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ++ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED ++TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A ++PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT ++SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ++CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION ++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR ++IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ++DEALINGS IN THE SOFTWARE. +diff -Nru mesa-25.3.3/subprojects/once_cell-1.20.2/meson.build mesa-25.3.3/subprojects/once_cell-1.20.2/meson.build +--- mesa-25.3.3/subprojects/once_cell-1.20.2/meson.build 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/once_cell-1.20.2/meson.build 2026-05-26 15:46:07.000000000 -0500 +@@ -0,0 +1,18 @@ ++project('once_cell', 'rust', version : '1.20.2', license : 'MIT OR Apache-2.0') ++ ++rust_args = [ ++ '--cfg', 'feature="std"' ++] ++ ++lib = static_library( ++ 'once_cell', ++ 'src/lib.rs', ++ rust_args : rust_args, ++ override_options : ['rust_std=2018', 'build.rust_std=2018'], ++ rust_abi : 'rust', ++ native : true, ++) ++ ++dep_once_cell = declare_dependency( ++ link_with : [lib], ++) +diff -Nru mesa-25.3.3/subprojects/once_cell-1.20.2/.meson-subproject-wrap-hash.txt mesa-25.3.3/subprojects/once_cell-1.20.2/.meson-subproject-wrap-hash.txt +--- mesa-25.3.3/subprojects/once_cell-1.20.2/.meson-subproject-wrap-hash.txt 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/once_cell-1.20.2/.meson-subproject-wrap-hash.txt 2026-05-29 13:40:55.000000000 -0500 +@@ -0,0 +1 @@ ++7702998a8dbc90f4d2ed2252da50bff8740e1c359c53a3bd32fb43a45e1bc4cc +diff -Nru mesa-25.3.3/subprojects/once_cell-1.20.2/README.md mesa-25.3.3/subprojects/once_cell-1.20.2/README.md +--- mesa-25.3.3/subprojects/once_cell-1.20.2/README.md 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/once_cell-1.20.2/README.md 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,57 @@ ++

once_cell

++ ++ ++[![Build Status](https://github.com/matklad/once_cell/actions/workflows/ci.yaml/badge.svg)](https://github.com/matklad/once_cell/actions) ++[![Crates.io](https://img.shields.io/crates/v/once_cell.svg)](https://crates.io/crates/once_cell) ++[![API reference](https://docs.rs/once_cell/badge.svg)](https://docs.rs/once_cell/) ++ ++# Overview ++ ++`once_cell` provides two new cell-like types, `unsync::OnceCell` and `sync::OnceCell`. `OnceCell` ++might store arbitrary non-`Copy` types, can be assigned to at most once and provide direct access ++to the stored contents. In a nutshell, API looks *roughly* like this: ++ ++```rust ++impl OnceCell { ++ fn new() -> OnceCell { ... } ++ fn set(&self, value: T) -> Result<(), T> { ... } ++ fn get(&self) -> Option<&T> { ... } ++} ++``` ++ ++Note that, like with `RefCell` and `Mutex`, the `set` method requires only a shared reference. ++Because of the single assignment restriction `get` can return an `&T` instead of `Ref` ++or `MutexGuard`. ++ ++`once_cell` also has a `Lazy` type, build on top of `OnceCell` which provides the same API as ++the `lazy_static!` macro, but without using any macros: ++ ++```rust ++use std::{sync::Mutex, collections::HashMap}; ++use once_cell::sync::Lazy; ++ ++static GLOBAL_DATA: Lazy>> = Lazy::new(|| { ++ let mut m = HashMap::new(); ++ m.insert(13, "Spica".to_string()); ++ m.insert(74, "Hoyten".to_string()); ++ Mutex::new(m) ++}); ++ ++fn main() { ++ println!("{:?}", GLOBAL_DATA.lock().unwrap()); ++} ++``` ++ ++More patterns and use-cases are in the [docs](https://docs.rs/once_cell/)! ++ ++# Related crates ++ ++* [double-checked-cell](https://github.com/niklasf/double-checked-cell) ++* [lazy-init](https://crates.io/crates/lazy-init) ++* [lazycell](https://crates.io/crates/lazycell) ++* [mitochondria](https://crates.io/crates/mitochondria) ++* [lazy_static](https://crates.io/crates/lazy_static) ++* [async_once_cell](https://crates.io/crates/async_once_cell) ++* [generic_once_cell](https://crates.io/crates/generic_once_cell) (bring your own mutex) ++ ++Parts of `once_cell` API are included into `std` [as of Rust 1.70.0](https://github.com/rust-lang/rust/pull/105587). +diff -Nru mesa-25.3.3/subprojects/once_cell-1.20.2/src/imp_cs.rs mesa-25.3.3/subprojects/once_cell-1.20.2/src/imp_cs.rs +--- mesa-25.3.3/subprojects/once_cell-1.20.2/src/imp_cs.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/once_cell-1.20.2/src/imp_cs.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,78 @@ ++use core::panic::{RefUnwindSafe, UnwindSafe}; ++ ++use critical_section::{CriticalSection, Mutex}; ++use portable_atomic::{AtomicBool, Ordering}; ++ ++use crate::unsync; ++ ++pub(crate) struct OnceCell { ++ initialized: AtomicBool, ++ // Use `unsync::OnceCell` internally since `Mutex` does not provide ++ // interior mutability and to be able to re-use `get_or_try_init`. ++ value: Mutex>, ++} ++ ++// Why do we need `T: Send`? ++// Thread A creates a `OnceCell` and shares it with ++// scoped thread B, which fills the cell, which is ++// then destroyed by A. That is, destructor observes ++// a sent value. ++unsafe impl Sync for OnceCell {} ++unsafe impl Send for OnceCell {} ++ ++impl RefUnwindSafe for OnceCell {} ++impl UnwindSafe for OnceCell {} ++ ++impl OnceCell { ++ pub(crate) const fn new() -> OnceCell { ++ OnceCell { initialized: AtomicBool::new(false), value: Mutex::new(unsync::OnceCell::new()) } ++ } ++ ++ pub(crate) const fn with_value(value: T) -> OnceCell { ++ OnceCell { ++ initialized: AtomicBool::new(true), ++ value: Mutex::new(unsync::OnceCell::with_value(value)), ++ } ++ } ++ ++ #[inline] ++ pub(crate) fn is_initialized(&self) -> bool { ++ self.initialized.load(Ordering::Acquire) ++ } ++ ++ #[cold] ++ pub(crate) fn initialize(&self, f: F) -> Result<(), E> ++ where ++ F: FnOnce() -> Result, ++ { ++ critical_section::with(|cs| { ++ let cell = self.value.borrow(cs); ++ cell.get_or_try_init(f).map(|_| { ++ self.initialized.store(true, Ordering::Release); ++ }) ++ }) ++ } ++ ++ /// Get the reference to the underlying value, without checking if the cell ++ /// is initialized. ++ /// ++ /// # Safety ++ /// ++ /// Caller must ensure that the cell is in initialized state, and that ++ /// the contents are acquired by (synchronized to) this thread. ++ pub(crate) unsafe fn get_unchecked(&self) -> &T { ++ debug_assert!(self.is_initialized()); ++ // SAFETY: The caller ensures that the value is initialized and access synchronized. ++ self.value.borrow(CriticalSection::new()).get().unwrap_unchecked() ++ } ++ ++ #[inline] ++ pub(crate) fn get_mut(&mut self) -> Option<&mut T> { ++ self.value.get_mut().get_mut() ++ } ++ ++ #[inline] ++ pub(crate) fn into_inner(self) -> Option { ++ self.value.into_inner().into_inner() ++ } ++} +diff -Nru mesa-25.3.3/subprojects/once_cell-1.20.2/src/imp_pl.rs mesa-25.3.3/subprojects/once_cell-1.20.2/src/imp_pl.rs +--- mesa-25.3.3/subprojects/once_cell-1.20.2/src/imp_pl.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/once_cell-1.20.2/src/imp_pl.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,174 @@ ++use std::{ ++ cell::UnsafeCell, ++ panic::{RefUnwindSafe, UnwindSafe}, ++ sync::atomic::{AtomicU8, Ordering}, ++}; ++ ++pub(crate) struct OnceCell { ++ state: AtomicU8, ++ value: UnsafeCell>, ++} ++ ++const INCOMPLETE: u8 = 0x0; ++const RUNNING: u8 = 0x1; ++const COMPLETE: u8 = 0x2; ++ ++// Why do we need `T: Send`? ++// Thread A creates a `OnceCell` and shares it with ++// scoped thread B, which fills the cell, which is ++// then destroyed by A. That is, destructor observes ++// a sent value. ++unsafe impl Sync for OnceCell {} ++unsafe impl Send for OnceCell {} ++ ++impl RefUnwindSafe for OnceCell {} ++impl UnwindSafe for OnceCell {} ++ ++impl OnceCell { ++ pub(crate) const fn new() -> OnceCell { ++ OnceCell { state: AtomicU8::new(INCOMPLETE), value: UnsafeCell::new(None) } ++ } ++ ++ pub(crate) const fn with_value(value: T) -> OnceCell { ++ OnceCell { state: AtomicU8::new(COMPLETE), value: UnsafeCell::new(Some(value)) } ++ } ++ ++ /// Safety: synchronizes with store to value via Release/Acquire. ++ #[inline] ++ pub(crate) fn is_initialized(&self) -> bool { ++ self.state.load(Ordering::Acquire) == COMPLETE ++ } ++ ++ /// Safety: synchronizes with store to value via `is_initialized` or mutex ++ /// lock/unlock, writes value only once because of the mutex. ++ #[cold] ++ pub(crate) fn initialize(&self, f: F) -> Result<(), E> ++ where ++ F: FnOnce() -> Result, ++ { ++ let mut f = Some(f); ++ let mut res: Result<(), E> = Ok(()); ++ let slot: *mut Option = self.value.get(); ++ initialize_inner(&self.state, &mut || { ++ // We are calling user-supplied function and need to be careful. ++ // - if it returns Err, we unlock mutex and return without touching anything ++ // - if it panics, we unlock mutex and propagate panic without touching anything ++ // - if it calls `set` or `get_or_try_init` re-entrantly, we get a deadlock on ++ // mutex, which is important for safety. We *could* detect this and panic, ++ // but that is more complicated ++ // - finally, if it returns Ok, we store the value and store the flag with ++ // `Release`, which synchronizes with `Acquire`s. ++ let f = unsafe { f.take().unwrap_unchecked() }; ++ match f() { ++ Ok(value) => unsafe { ++ // Safe b/c we have a unique access and no panic may happen ++ // until the cell is marked as initialized. ++ debug_assert!((*slot).is_none()); ++ *slot = Some(value); ++ true ++ }, ++ Err(err) => { ++ res = Err(err); ++ false ++ } ++ } ++ }); ++ res ++ } ++ ++ #[cold] ++ pub(crate) fn wait(&self) { ++ let key = &self.state as *const _ as usize; ++ unsafe { ++ parking_lot_core::park( ++ key, ++ || self.state.load(Ordering::Acquire) != COMPLETE, ++ || (), ++ |_, _| (), ++ parking_lot_core::DEFAULT_PARK_TOKEN, ++ None, ++ ); ++ } ++ } ++ ++ /// Get the reference to the underlying value, without checking if the cell ++ /// is initialized. ++ /// ++ /// # Safety ++ /// ++ /// Caller must ensure that the cell is in initialized state, and that ++ /// the contents are acquired by (synchronized to) this thread. ++ pub(crate) unsafe fn get_unchecked(&self) -> &T { ++ debug_assert!(self.is_initialized()); ++ let slot = &*self.value.get(); ++ slot.as_ref().unwrap_unchecked() ++ } ++ ++ /// Gets the mutable reference to the underlying value. ++ /// Returns `None` if the cell is empty. ++ pub(crate) fn get_mut(&mut self) -> Option<&mut T> { ++ // Safe b/c we have an exclusive access ++ let slot: &mut Option = unsafe { &mut *self.value.get() }; ++ slot.as_mut() ++ } ++ ++ /// Consumes this `OnceCell`, returning the wrapped value. ++ /// Returns `None` if the cell was empty. ++ pub(crate) fn into_inner(self) -> Option { ++ self.value.into_inner() ++ } ++} ++ ++struct Guard<'a> { ++ state: &'a AtomicU8, ++ new_state: u8, ++} ++ ++impl<'a> Drop for Guard<'a> { ++ fn drop(&mut self) { ++ self.state.store(self.new_state, Ordering::Release); ++ unsafe { ++ let key = self.state as *const AtomicU8 as usize; ++ parking_lot_core::unpark_all(key, parking_lot_core::DEFAULT_UNPARK_TOKEN); ++ } ++ } ++} ++ ++// Note: this is intentionally monomorphic ++#[inline(never)] ++fn initialize_inner(state: &AtomicU8, init: &mut dyn FnMut() -> bool) { ++ loop { ++ let exchange = ++ state.compare_exchange_weak(INCOMPLETE, RUNNING, Ordering::Acquire, Ordering::Acquire); ++ match exchange { ++ Ok(_) => { ++ let mut guard = Guard { state, new_state: INCOMPLETE }; ++ if init() { ++ guard.new_state = COMPLETE; ++ } ++ return; ++ } ++ Err(COMPLETE) => return, ++ Err(RUNNING) => unsafe { ++ let key = state as *const AtomicU8 as usize; ++ parking_lot_core::park( ++ key, ++ || state.load(Ordering::Relaxed) == RUNNING, ++ || (), ++ |_, _| (), ++ parking_lot_core::DEFAULT_PARK_TOKEN, ++ None, ++ ); ++ }, ++ Err(INCOMPLETE) => (), ++ Err(_) => debug_assert!(false), ++ } ++ } ++} ++ ++#[test] ++fn test_size() { ++ use std::mem::size_of; ++ ++ assert_eq!(size_of::>(), 1 * size_of::() + size_of::()); ++} +diff -Nru mesa-25.3.3/subprojects/once_cell-1.20.2/src/imp_std.rs mesa-25.3.3/subprojects/once_cell-1.20.2/src/imp_std.rs +--- mesa-25.3.3/subprojects/once_cell-1.20.2/src/imp_std.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/once_cell-1.20.2/src/imp_std.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,415 @@ ++// There's a lot of scary concurrent code in this module, but it is copied from ++// `std::sync::Once` with two changes: ++// * no poisoning ++// * init function can fail ++ ++use std::{ ++ cell::{Cell, UnsafeCell}, ++ panic::{RefUnwindSafe, UnwindSafe}, ++ sync::atomic::{AtomicBool, AtomicPtr, Ordering}, ++ thread::{self, Thread}, ++}; ++ ++#[derive(Debug)] ++pub(crate) struct OnceCell { ++ // This `queue` field is the core of the implementation. It encodes two ++ // pieces of information: ++ // ++ // * The current state of the cell (`INCOMPLETE`, `RUNNING`, `COMPLETE`) ++ // * Linked list of threads waiting for the current cell. ++ // ++ // State is encoded in two low bits. Only `INCOMPLETE` and `RUNNING` states ++ // allow waiters. ++ queue: AtomicPtr, ++ value: UnsafeCell>, ++} ++ ++// Why do we need `T: Send`? ++// Thread A creates a `OnceCell` and shares it with ++// scoped thread B, which fills the cell, which is ++// then destroyed by A. That is, destructor observes ++// a sent value. ++unsafe impl Sync for OnceCell {} ++unsafe impl Send for OnceCell {} ++ ++impl RefUnwindSafe for OnceCell {} ++impl UnwindSafe for OnceCell {} ++ ++impl OnceCell { ++ pub(crate) const fn new() -> OnceCell { ++ OnceCell { queue: AtomicPtr::new(INCOMPLETE_PTR), value: UnsafeCell::new(None) } ++ } ++ ++ pub(crate) const fn with_value(value: T) -> OnceCell { ++ OnceCell { queue: AtomicPtr::new(COMPLETE_PTR), value: UnsafeCell::new(Some(value)) } ++ } ++ ++ /// Safety: synchronizes with store to value via Release/(Acquire|SeqCst). ++ #[inline] ++ pub(crate) fn is_initialized(&self) -> bool { ++ // An `Acquire` load is enough because that makes all the initialization ++ // operations visible to us, and, this being a fast path, weaker ++ // ordering helps with performance. This `Acquire` synchronizes with ++ // `SeqCst` operations on the slow path. ++ self.queue.load(Ordering::Acquire) == COMPLETE_PTR ++ } ++ ++ /// Safety: synchronizes with store to value via SeqCst read from state, ++ /// writes value only once because we never get to INCOMPLETE state after a ++ /// successful write. ++ #[cold] ++ pub(crate) fn initialize(&self, f: F) -> Result<(), E> ++ where ++ F: FnOnce() -> Result, ++ { ++ let mut f = Some(f); ++ let mut res: Result<(), E> = Ok(()); ++ let slot: *mut Option = self.value.get(); ++ initialize_or_wait( ++ &self.queue, ++ Some(&mut || { ++ let f = unsafe { f.take().unwrap_unchecked() }; ++ match f() { ++ Ok(value) => { ++ unsafe { *slot = Some(value) }; ++ true ++ } ++ Err(err) => { ++ res = Err(err); ++ false ++ } ++ } ++ }), ++ ); ++ res ++ } ++ ++ #[cold] ++ pub(crate) fn wait(&self) { ++ initialize_or_wait(&self.queue, None); ++ } ++ ++ /// Get the reference to the underlying value, without checking if the cell ++ /// is initialized. ++ /// ++ /// # Safety ++ /// ++ /// Caller must ensure that the cell is in initialized state, and that ++ /// the contents are acquired by (synchronized to) this thread. ++ pub(crate) unsafe fn get_unchecked(&self) -> &T { ++ debug_assert!(self.is_initialized()); ++ let slot = &*self.value.get(); ++ slot.as_ref().unwrap_unchecked() ++ } ++ ++ /// Gets the mutable reference to the underlying value. ++ /// Returns `None` if the cell is empty. ++ pub(crate) fn get_mut(&mut self) -> Option<&mut T> { ++ // Safe b/c we have a unique access. ++ unsafe { &mut *self.value.get() }.as_mut() ++ } ++ ++ /// Consumes this `OnceCell`, returning the wrapped value. ++ /// Returns `None` if the cell was empty. ++ #[inline] ++ pub(crate) fn into_inner(self) -> Option { ++ // Because `into_inner` takes `self` by value, the compiler statically ++ // verifies that it is not currently borrowed. ++ // So, it is safe to move out `Option`. ++ self.value.into_inner() ++ } ++} ++ ++// Three states that a OnceCell can be in, encoded into the lower bits of `queue` in ++// the OnceCell structure. ++const INCOMPLETE: usize = 0x0; ++const RUNNING: usize = 0x1; ++const COMPLETE: usize = 0x2; ++const INCOMPLETE_PTR: *mut Waiter = INCOMPLETE as *mut Waiter; ++const COMPLETE_PTR: *mut Waiter = COMPLETE as *mut Waiter; ++ ++// Mask to learn about the state. All other bits are the queue of waiters if ++// this is in the RUNNING state. ++const STATE_MASK: usize = 0x3; ++ ++/// Representation of a node in the linked list of waiters in the RUNNING state. ++/// A waiters is stored on the stack of the waiting threads. ++#[repr(align(4))] // Ensure the two lower bits are free to use as state bits. ++struct Waiter { ++ thread: Cell>, ++ signaled: AtomicBool, ++ next: *mut Waiter, ++} ++ ++/// Drains and notifies the queue of waiters on drop. ++struct Guard<'a> { ++ queue: &'a AtomicPtr, ++ new_queue: *mut Waiter, ++} ++ ++impl Drop for Guard<'_> { ++ fn drop(&mut self) { ++ let queue = self.queue.swap(self.new_queue, Ordering::AcqRel); ++ ++ let state = strict::addr(queue) & STATE_MASK; ++ assert_eq!(state, RUNNING); ++ ++ unsafe { ++ let mut waiter = strict::map_addr(queue, |q| q & !STATE_MASK); ++ while !waiter.is_null() { ++ let next = (*waiter).next; ++ let thread = (*waiter).thread.take().unwrap(); ++ (*waiter).signaled.store(true, Ordering::Release); ++ waiter = next; ++ thread.unpark(); ++ } ++ } ++ } ++} ++ ++// Corresponds to `std::sync::Once::call_inner`. ++// ++// Originally copied from std, but since modified to remove poisoning and to ++// support wait. ++// ++// Note: this is intentionally monomorphic ++#[inline(never)] ++fn initialize_or_wait(queue: &AtomicPtr, mut init: Option<&mut dyn FnMut() -> bool>) { ++ let mut curr_queue = queue.load(Ordering::Acquire); ++ ++ loop { ++ let curr_state = strict::addr(curr_queue) & STATE_MASK; ++ match (curr_state, &mut init) { ++ (COMPLETE, _) => return, ++ (INCOMPLETE, Some(init)) => { ++ let exchange = queue.compare_exchange( ++ curr_queue, ++ strict::map_addr(curr_queue, |q| (q & !STATE_MASK) | RUNNING), ++ Ordering::Acquire, ++ Ordering::Acquire, ++ ); ++ if let Err(new_queue) = exchange { ++ curr_queue = new_queue; ++ continue; ++ } ++ let mut guard = Guard { queue, new_queue: INCOMPLETE_PTR }; ++ if init() { ++ guard.new_queue = COMPLETE_PTR; ++ } ++ return; ++ } ++ (INCOMPLETE, None) | (RUNNING, _) => { ++ wait(queue, curr_queue); ++ curr_queue = queue.load(Ordering::Acquire); ++ } ++ _ => debug_assert!(false), ++ } ++ } ++} ++ ++fn wait(queue: &AtomicPtr, mut curr_queue: *mut Waiter) { ++ let curr_state = strict::addr(curr_queue) & STATE_MASK; ++ loop { ++ let node = Waiter { ++ thread: Cell::new(Some(thread::current())), ++ signaled: AtomicBool::new(false), ++ next: strict::map_addr(curr_queue, |q| q & !STATE_MASK), ++ }; ++ let me = &node as *const Waiter as *mut Waiter; ++ ++ let exchange = queue.compare_exchange( ++ curr_queue, ++ strict::map_addr(me, |q| q | curr_state), ++ Ordering::Release, ++ Ordering::Relaxed, ++ ); ++ if let Err(new_queue) = exchange { ++ if strict::addr(new_queue) & STATE_MASK != curr_state { ++ return; ++ } ++ curr_queue = new_queue; ++ continue; ++ } ++ ++ while !node.signaled.load(Ordering::Acquire) { ++ thread::park(); ++ } ++ break; ++ } ++} ++ ++// Polyfill of strict provenance from https://crates.io/crates/sptr. ++// ++// Use free-standing function rather than a trait to keep things simple and ++// avoid any potential conflicts with future stabile std API. ++mod strict { ++ #[must_use] ++ #[inline] ++ pub(crate) fn addr(ptr: *mut T) -> usize ++ where ++ T: Sized, ++ { ++ // FIXME(strict_provenance_magic): I am magic and should be a compiler intrinsic. ++ // SAFETY: Pointer-to-integer transmutes are valid (if you are okay with losing the ++ // provenance). ++ unsafe { core::mem::transmute(ptr) } ++ } ++ ++ #[must_use] ++ #[inline] ++ pub(crate) fn with_addr(ptr: *mut T, addr: usize) -> *mut T ++ where ++ T: Sized, ++ { ++ // FIXME(strict_provenance_magic): I am magic and should be a compiler intrinsic. ++ // ++ // In the mean-time, this operation is defined to be "as if" it was ++ // a wrapping_offset, so we can emulate it as such. This should properly ++ // restore pointer provenance even under today's compiler. ++ let self_addr = self::addr(ptr) as isize; ++ let dest_addr = addr as isize; ++ let offset = dest_addr.wrapping_sub(self_addr); ++ ++ // This is the canonical desugarring of this operation, ++ // but `pointer::cast` was only stabilized in 1.38. ++ // self.cast::().wrapping_offset(offset).cast::() ++ (ptr as *mut u8).wrapping_offset(offset) as *mut T ++ } ++ ++ #[must_use] ++ #[inline] ++ pub(crate) fn map_addr(ptr: *mut T, f: impl FnOnce(usize) -> usize) -> *mut T ++ where ++ T: Sized, ++ { ++ self::with_addr(ptr, f(addr(ptr))) ++ } ++} ++ ++// These test are snatched from std as well. ++#[cfg(test)] ++mod tests { ++ use std::panic; ++ use std::{sync::mpsc::channel, thread}; ++ ++ use super::OnceCell; ++ ++ impl OnceCell { ++ fn init(&self, f: impl FnOnce() -> T) { ++ enum Void {} ++ let _ = self.initialize(|| Ok::(f())); ++ } ++ } ++ ++ #[test] ++ fn smoke_once() { ++ static O: OnceCell<()> = OnceCell::new(); ++ let mut a = 0; ++ O.init(|| a += 1); ++ assert_eq!(a, 1); ++ O.init(|| a += 1); ++ assert_eq!(a, 1); ++ } ++ ++ #[test] ++ fn stampede_once() { ++ static O: OnceCell<()> = OnceCell::new(); ++ static mut RUN: bool = false; ++ ++ let (tx, rx) = channel(); ++ for _ in 0..10 { ++ let tx = tx.clone(); ++ thread::spawn(move || { ++ for _ in 0..4 { ++ thread::yield_now() ++ } ++ unsafe { ++ O.init(|| { ++ assert!(!RUN); ++ RUN = true; ++ }); ++ assert!(RUN); ++ } ++ tx.send(()).unwrap(); ++ }); ++ } ++ ++ unsafe { ++ O.init(|| { ++ assert!(!RUN); ++ RUN = true; ++ }); ++ assert!(RUN); ++ } ++ ++ for _ in 0..10 { ++ rx.recv().unwrap(); ++ } ++ } ++ ++ #[test] ++ fn poison_bad() { ++ static O: OnceCell<()> = OnceCell::new(); ++ ++ // poison the once ++ let t = panic::catch_unwind(|| { ++ O.init(|| panic!()); ++ }); ++ assert!(t.is_err()); ++ ++ // we can subvert poisoning, however ++ let mut called = false; ++ O.init(|| { ++ called = true; ++ }); ++ assert!(called); ++ ++ // once any success happens, we stop propagating the poison ++ O.init(|| {}); ++ } ++ ++ #[test] ++ fn wait_for_force_to_finish() { ++ static O: OnceCell<()> = OnceCell::new(); ++ ++ // poison the once ++ let t = panic::catch_unwind(|| { ++ O.init(|| panic!()); ++ }); ++ assert!(t.is_err()); ++ ++ // make sure someone's waiting inside the once via a force ++ let (tx1, rx1) = channel(); ++ let (tx2, rx2) = channel(); ++ let t1 = thread::spawn(move || { ++ O.init(|| { ++ tx1.send(()).unwrap(); ++ rx2.recv().unwrap(); ++ }); ++ }); ++ ++ rx1.recv().unwrap(); ++ ++ // put another waiter on the once ++ let t2 = thread::spawn(|| { ++ let mut called = false; ++ O.init(|| { ++ called = true; ++ }); ++ assert!(!called); ++ }); ++ ++ tx2.send(()).unwrap(); ++ ++ assert!(t1.join().is_ok()); ++ assert!(t2.join().is_ok()); ++ } ++ ++ #[test] ++ #[cfg(target_pointer_width = "64")] ++ fn test_size() { ++ use std::mem::size_of; ++ ++ assert_eq!(size_of::>(), 4 * size_of::()); ++ } ++} +diff -Nru mesa-25.3.3/subprojects/once_cell-1.20.2/src/lib.rs mesa-25.3.3/subprojects/once_cell-1.20.2/src/lib.rs +--- mesa-25.3.3/subprojects/once_cell-1.20.2/src/lib.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/once_cell-1.20.2/src/lib.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,1412 @@ ++//! # Overview ++//! ++//! `once_cell` provides two new cell-like types, [`unsync::OnceCell`] and ++//! [`sync::OnceCell`]. A `OnceCell` might store arbitrary non-`Copy` types, can ++//! be assigned to at most once and provides direct access to the stored ++//! contents. The core API looks *roughly* like this (and there's much more ++//! inside, read on!): ++//! ++//! ```rust,ignore ++//! impl OnceCell { ++//! const fn new() -> OnceCell { ... } ++//! fn set(&self, value: T) -> Result<(), T> { ... } ++//! fn get(&self) -> Option<&T> { ... } ++//! } ++//! ``` ++//! ++//! Note that, like with [`RefCell`] and [`Mutex`], the `set` method requires ++//! only a shared reference. Because of the single assignment restriction `get` ++//! can return a `&T` instead of `Ref` or `MutexGuard`. ++//! ++//! The `sync` flavor is thread-safe (that is, implements the [`Sync`] trait), ++//! while the `unsync` one is not. ++//! ++//! [`unsync::OnceCell`]: unsync/struct.OnceCell.html ++//! [`sync::OnceCell`]: sync/struct.OnceCell.html ++//! [`RefCell`]: https://doc.rust-lang.org/std/cell/struct.RefCell.html ++//! [`Mutex`]: https://doc.rust-lang.org/std/sync/struct.Mutex.html ++//! [`Sync`]: https://doc.rust-lang.org/std/marker/trait.Sync.html ++//! ++//! # Recipes ++//! ++//! `OnceCell` might be useful for a variety of patterns. ++//! ++//! ## Safe Initialization of Global Data ++//! ++//! ```rust ++//! use std::{env, io}; ++//! ++//! use once_cell::sync::OnceCell; ++//! ++//! #[derive(Debug)] ++//! pub struct Logger { ++//! // ... ++//! } ++//! static INSTANCE: OnceCell = OnceCell::new(); ++//! ++//! impl Logger { ++//! pub fn global() -> &'static Logger { ++//! INSTANCE.get().expect("logger is not initialized") ++//! } ++//! ++//! fn from_cli(args: env::Args) -> Result { ++//! // ... ++//! # Ok(Logger {}) ++//! } ++//! } ++//! ++//! fn main() { ++//! let logger = Logger::from_cli(env::args()).unwrap(); ++//! INSTANCE.set(logger).unwrap(); ++//! // use `Logger::global()` from now on ++//! } ++//! ``` ++//! ++//! ## Lazy Initialized Global Data ++//! ++//! This is essentially the `lazy_static!` macro, but without a macro. ++//! ++//! ```rust ++//! use std::{sync::Mutex, collections::HashMap}; ++//! ++//! use once_cell::sync::OnceCell; ++//! ++//! fn global_data() -> &'static Mutex> { ++//! static INSTANCE: OnceCell>> = OnceCell::new(); ++//! INSTANCE.get_or_init(|| { ++//! let mut m = HashMap::new(); ++//! m.insert(13, "Spica".to_string()); ++//! m.insert(74, "Hoyten".to_string()); ++//! Mutex::new(m) ++//! }) ++//! } ++//! ``` ++//! ++//! There are also the [`sync::Lazy`] and [`unsync::Lazy`] convenience types to ++//! streamline this pattern: ++//! ++//! ```rust ++//! use std::{sync::Mutex, collections::HashMap}; ++//! use once_cell::sync::Lazy; ++//! ++//! static GLOBAL_DATA: Lazy>> = Lazy::new(|| { ++//! let mut m = HashMap::new(); ++//! m.insert(13, "Spica".to_string()); ++//! m.insert(74, "Hoyten".to_string()); ++//! Mutex::new(m) ++//! }); ++//! ++//! fn main() { ++//! println!("{:?}", GLOBAL_DATA.lock().unwrap()); ++//! } ++//! ``` ++//! ++//! Note that the variable that holds `Lazy` is declared as `static`, *not* ++//! `const`. This is important: using `const` instead compiles, but works wrong. ++//! ++//! [`sync::Lazy`]: sync/struct.Lazy.html ++//! [`unsync::Lazy`]: unsync/struct.Lazy.html ++//! ++//! ## General purpose lazy evaluation ++//! ++//! Unlike `lazy_static!`, `Lazy` works with local variables. ++//! ++//! ```rust ++//! use once_cell::unsync::Lazy; ++//! ++//! fn main() { ++//! let ctx = vec![1, 2, 3]; ++//! let thunk = Lazy::new(|| { ++//! ctx.iter().sum::() ++//! }); ++//! assert_eq!(*thunk, 6); ++//! } ++//! ``` ++//! ++//! If you need a lazy field in a struct, you probably should use `OnceCell` ++//! directly, because that will allow you to access `self` during ++//! initialization. ++//! ++//! ```rust ++//! use std::{fs, path::PathBuf}; ++//! ++//! use once_cell::unsync::OnceCell; ++//! ++//! struct Ctx { ++//! config_path: PathBuf, ++//! config: OnceCell, ++//! } ++//! ++//! impl Ctx { ++//! pub fn get_config(&self) -> Result<&str, std::io::Error> { ++//! let cfg = self.config.get_or_try_init(|| { ++//! fs::read_to_string(&self.config_path) ++//! })?; ++//! Ok(cfg.as_str()) ++//! } ++//! } ++//! ``` ++//! ++//! ## Lazily Compiled Regex ++//! ++//! This is a `regex!` macro which takes a string literal and returns an ++//! *expression* that evaluates to a `&'static Regex`: ++//! ++//! ``` ++//! macro_rules! regex { ++//! ($re:literal $(,)?) => {{ ++//! static RE: once_cell::sync::OnceCell = once_cell::sync::OnceCell::new(); ++//! RE.get_or_init(|| regex::Regex::new($re).unwrap()) ++//! }}; ++//! } ++//! ``` ++//! ++//! This macro can be useful to avoid the "compile regex on every loop ++//! iteration" problem. ++//! ++//! ## Runtime `include_bytes!` ++//! ++//! The `include_bytes` macro is useful to include test resources, but it slows ++//! down test compilation a lot. An alternative is to load the resources at ++//! runtime: ++//! ++//! ``` ++//! use std::path::Path; ++//! ++//! use once_cell::sync::OnceCell; ++//! ++//! pub struct TestResource { ++//! path: &'static str, ++//! cell: OnceCell>, ++//! } ++//! ++//! impl TestResource { ++//! pub const fn new(path: &'static str) -> TestResource { ++//! TestResource { path, cell: OnceCell::new() } ++//! } ++//! pub fn bytes(&self) -> &[u8] { ++//! self.cell.get_or_init(|| { ++//! let dir = std::env::var("CARGO_MANIFEST_DIR").unwrap(); ++//! let path = Path::new(dir.as_str()).join(self.path); ++//! std::fs::read(&path).unwrap_or_else(|_err| { ++//! panic!("failed to load test resource: {}", path.display()) ++//! }) ++//! }).as_slice() ++//! } ++//! } ++//! ++//! static TEST_IMAGE: TestResource = TestResource::new("test_data/lena.png"); ++//! ++//! #[test] ++//! fn test_sobel_filter() { ++//! let rgb: &[u8] = TEST_IMAGE.bytes(); ++//! // ... ++//! # drop(rgb); ++//! } ++//! ``` ++//! ++//! ## `lateinit` ++//! ++//! `LateInit` type for delayed initialization. It is reminiscent of Kotlin's ++//! `lateinit` keyword and allows construction of cyclic data structures: ++//! ++//! ++//! ``` ++//! use once_cell::sync::OnceCell; ++//! ++//! pub struct LateInit { cell: OnceCell } ++//! ++//! impl LateInit { ++//! pub fn init(&self, value: T) { ++//! assert!(self.cell.set(value).is_ok()) ++//! } ++//! } ++//! ++//! impl Default for LateInit { ++//! fn default() -> Self { LateInit { cell: OnceCell::default() } } ++//! } ++//! ++//! impl std::ops::Deref for LateInit { ++//! type Target = T; ++//! fn deref(&self) -> &T { ++//! self.cell.get().unwrap() ++//! } ++//! } ++//! ++//! #[derive(Default)] ++//! struct A<'a> { ++//! b: LateInit<&'a B<'a>>, ++//! } ++//! ++//! #[derive(Default)] ++//! struct B<'a> { ++//! a: LateInit<&'a A<'a>> ++//! } ++//! ++//! ++//! fn build_cycle() { ++//! let a = A::default(); ++//! let b = B::default(); ++//! a.b.init(&b); ++//! b.a.init(&a); ++//! ++//! let _a = &a.b.a.b.a; ++//! } ++//! ``` ++//! ++//! # Comparison with std ++//! ++//! |`!Sync` types | Access Mode | Drawbacks | ++//! |----------------------|------------------------|-----------------------------------------------| ++//! |`Cell` | `T` | requires `T: Copy` for `get` | ++//! |`RefCell` | `RefMut` / `Ref` | may panic at runtime | ++//! |`unsync::OnceCell` | `&T` | assignable only once | ++//! ++//! |`Sync` types | Access Mode | Drawbacks | ++//! |----------------------|------------------------|-----------------------------------------------| ++//! |`AtomicT` | `T` | works only with certain `Copy` types | ++//! |`Mutex` | `MutexGuard` | may deadlock at runtime, may block the thread | ++//! |`sync::OnceCell` | `&T` | assignable only once, may block the thread | ++//! ++//! Technically, calling `get_or_init` will also cause a panic or a deadlock if ++//! it recursively calls itself. However, because the assignment can happen only ++//! once, such cases should be more rare than equivalents with `RefCell` and ++//! `Mutex`. ++//! ++//! # Minimum Supported `rustc` Version ++//! ++//! If only the `std`, `alloc`, or `race` features are enabled, MSRV will be ++//! updated conservatively, supporting at least latest 8 versions of the compiler. ++//! When using other features, like `parking_lot`, MSRV might be updated more ++//! frequently, up to the latest stable. In both cases, increasing MSRV is *not* ++//! considered a semver-breaking change and requires only a minor version bump. ++//! ++//! # Implementation details ++//! ++//! The implementation is based on the ++//! [`lazy_static`](https://github.com/rust-lang-nursery/lazy-static.rs/) and ++//! [`lazy_cell`](https://github.com/indiv0/lazycell/) crates and ++//! [`std::sync::Once`]. In some sense, `once_cell` just streamlines and unifies ++//! those APIs. ++//! ++//! To implement a sync flavor of `OnceCell`, this crates uses either a custom ++//! re-implementation of `std::sync::Once` or `parking_lot::Mutex`. This is ++//! controlled by the `parking_lot` feature (disabled by default). Performance ++//! is the same for both cases, but the `parking_lot` based `OnceCell` is ++//! smaller by up to 16 bytes. ++//! ++//! This crate uses `unsafe`. ++//! ++//! [`std::sync::Once`]: https://doc.rust-lang.org/std/sync/struct.Once.html ++//! ++//! # F.A.Q. ++//! ++//! **Should I use the sync or unsync flavor?** ++//! ++//! Because Rust compiler checks thread safety for you, it's impossible to ++//! accidentally use `unsync` where `sync` is required. So, use `unsync` in ++//! single-threaded code and `sync` in multi-threaded. It's easy to switch ++//! between the two if code becomes multi-threaded later. ++//! ++//! At the moment, `unsync` has an additional benefit that reentrant ++//! initialization causes a panic, which might be easier to debug than a ++//! deadlock. ++//! ++//! **Does this crate support async?** ++//! ++//! No, but you can use ++//! [`async_once_cell`](https://crates.io/crates/async_once_cell) instead. ++//! ++//! **Does this crate support `no_std`?** ++//! ++//! Yes, but with caveats. `OnceCell` is a synchronization primitive which ++//! _semantically_ relies on blocking. `OnceCell` guarantees that at most one ++//! `f` will be called to compute the value. If two threads of execution call ++//! `get_or_init` concurrently, one of them has to wait. ++//! ++//! Waiting fundamentally requires OS support. Execution environment needs to ++//! understand who waits on whom to prevent deadlocks due to priority inversion. ++//! You _could_ make code to compile by blindly using pure spinlocks, but the ++//! runtime behavior would be subtly wrong. ++//! ++//! Given these constraints, `once_cell` provides the following options: ++//! ++//! - The `race` module provides similar, but distinct synchronization primitive ++//! which is compatible with `no_std`. With `race`, the `f` function can be ++//! called multiple times by different threads, but only one thread will win ++//! to install the value. ++//! - `critical-section` feature (with a `-`, not `_`) uses `critical_section` ++//! to implement blocking. ++//! ++//! **Can I bring my own mutex?** ++//! ++//! There is [generic_once_cell](https://crates.io/crates/generic_once_cell) to ++//! allow just that. ++//! ++//! **Should I use `std::cell::OnceCell`, `once_cell`, or `lazy_static`?** ++//! ++//! If you can use `std` version (your MSRV is at least 1.70, and you don't need ++//! extra features `once_cell` provides), use `std`. Otherwise, use `once_cell`. ++//! Don't use `lazy_static`. ++//! ++//! # Related crates ++//! ++//! * Most of this crate's functionality is available in `std` starting with ++//! Rust 1.70. See `std::cell::OnceCell` and `std::sync::OnceLock`. ++//! * [double-checked-cell](https://github.com/niklasf/double-checked-cell) ++//! * [lazy-init](https://crates.io/crates/lazy-init) ++//! * [lazycell](https://crates.io/crates/lazycell) ++//! * [mitochondria](https://crates.io/crates/mitochondria) ++//! * [lazy_static](https://crates.io/crates/lazy_static) ++//! * [async_once_cell](https://crates.io/crates/async_once_cell) ++//! * [generic_once_cell](https://crates.io/crates/generic_once_cell) (bring ++//! your own mutex) ++ ++#![cfg_attr(not(feature = "std"), no_std)] ++ ++#[cfg(feature = "alloc")] ++extern crate alloc; ++ ++#[cfg(all(feature = "critical-section", not(feature = "std")))] ++#[path = "imp_cs.rs"] ++mod imp; ++ ++#[cfg(all(feature = "std", feature = "parking_lot"))] ++#[path = "imp_pl.rs"] ++mod imp; ++ ++#[cfg(all(feature = "std", not(feature = "parking_lot")))] ++#[path = "imp_std.rs"] ++mod imp; ++ ++/// Single-threaded version of `OnceCell`. ++pub mod unsync { ++ use core::{ ++ cell::{Cell, UnsafeCell}, ++ fmt, mem, ++ ops::{Deref, DerefMut}, ++ 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 `&` ++ /// references to the contents. ++ /// ++ /// [`std::cell::RefCell`]: https://doc.rust-lang.org/std/cell/struct.RefCell.html ++ /// ++ /// # Example ++ /// ``` ++ /// use once_cell::unsync::OnceCell; ++ /// ++ /// let cell = OnceCell::new(); ++ /// assert!(cell.get().is_none()); ++ /// ++ /// let value: &String = cell.get_or_init(|| { ++ /// "Hello, World!".to_string() ++ /// }); ++ /// assert_eq!(value, "Hello, World!"); ++ /// assert!(cell.get().is_some()); ++ /// ``` ++ pub struct OnceCell { ++ // Invariant: written to at most once. ++ inner: UnsafeCell>, ++ } ++ ++ // Similarly to a `Sync` bound on `sync::OnceCell`, we can use ++ // `&unsync::OnceCell` to sneak a `T` through `catch_unwind`, ++ // by initializing the cell in closure and extracting the value in the ++ // `Drop`. ++ impl RefUnwindSafe for OnceCell {} ++ impl UnwindSafe for OnceCell {} ++ ++ impl Default for OnceCell { ++ fn default() -> Self { ++ Self::new() ++ } ++ } ++ ++ impl fmt::Debug for OnceCell { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ match self.get() { ++ Some(v) => f.debug_tuple("OnceCell").field(v).finish(), ++ None => f.write_str("OnceCell(Uninit)"), ++ } ++ } ++ } ++ ++ impl Clone for OnceCell { ++ fn clone(&self) -> OnceCell { ++ match self.get() { ++ Some(value) => OnceCell::with_value(value.clone()), ++ None => OnceCell::new(), ++ } ++ } ++ ++ fn clone_from(&mut self, source: &Self) { ++ match (self.get_mut(), source.get()) { ++ (Some(this), Some(source)) => this.clone_from(source), ++ _ => *self = source.clone(), ++ } ++ } ++ } ++ ++ impl PartialEq for OnceCell { ++ fn eq(&self, other: &Self) -> bool { ++ self.get() == other.get() ++ } ++ } ++ ++ impl Eq for OnceCell {} ++ ++ impl From for OnceCell { ++ fn from(value: T) -> Self { ++ OnceCell::with_value(value) ++ } ++ } ++ ++ impl OnceCell { ++ /// Creates a new empty cell. ++ pub const fn new() -> OnceCell { ++ OnceCell { inner: UnsafeCell::new(None) } ++ } ++ ++ /// Creates a new initialized cell. ++ pub const fn with_value(value: T) -> OnceCell { ++ OnceCell { inner: UnsafeCell::new(Some(value)) } ++ } ++ ++ /// Gets a reference to the underlying value. ++ /// ++ /// Returns `None` if the cell is empty. ++ #[inline] ++ pub fn get(&self) -> Option<&T> { ++ // Safe due to `inner`'s invariant of being written to at most once. ++ // Had multiple writes to `inner` been allowed, a reference to the ++ // value we return now would become dangling by a write of a ++ // different value later. ++ unsafe { &*self.inner.get() }.as_ref() ++ } ++ ++ /// Gets a mutable reference to the underlying value. ++ /// ++ /// Returns `None` if the cell is empty. ++ /// ++ /// This method is allowed to violate the invariant of writing to a `OnceCell` ++ /// at most once because it requires `&mut` access to `self`. As with all ++ /// interior mutability, `&mut` access permits arbitrary modification: ++ /// ++ /// ``` ++ /// use once_cell::unsync::OnceCell; ++ /// ++ /// let mut cell: OnceCell = OnceCell::new(); ++ /// cell.set(92).unwrap(); ++ /// *cell.get_mut().unwrap() = 93; ++ /// assert_eq!(cell.get(), Some(&93)); ++ /// ``` ++ #[inline] ++ pub fn get_mut(&mut self) -> Option<&mut T> { ++ // Safe because we have unique access ++ unsafe { &mut *self.inner.get() }.as_mut() ++ } ++ ++ /// Sets the contents of this cell to `value`. ++ /// ++ /// Returns `Ok(())` if the cell was empty and `Err(value)` if it was ++ /// full. ++ /// ++ /// # Example ++ /// ``` ++ /// use once_cell::unsync::OnceCell; ++ /// ++ /// let cell = OnceCell::new(); ++ /// assert!(cell.get().is_none()); ++ /// ++ /// assert_eq!(cell.set(92), Ok(())); ++ /// assert_eq!(cell.set(62), Err(62)); ++ /// ++ /// assert!(cell.get().is_some()); ++ /// ``` ++ pub fn set(&self, value: T) -> Result<(), T> { ++ match self.try_insert(value) { ++ Ok(_) => Ok(()), ++ Err((_, value)) => Err(value), ++ } ++ } ++ ++ /// Like [`set`](Self::set), but also returns a reference to the final cell value. ++ /// ++ /// # Example ++ /// ``` ++ /// use once_cell::unsync::OnceCell; ++ /// ++ /// let cell = OnceCell::new(); ++ /// assert!(cell.get().is_none()); ++ /// ++ /// assert_eq!(cell.try_insert(92), Ok(&92)); ++ /// assert_eq!(cell.try_insert(62), Err((&92, 62))); ++ /// ++ /// assert!(cell.get().is_some()); ++ /// ``` ++ pub fn try_insert(&self, value: T) -> Result<&T, (&T, T)> { ++ if let Some(old) = self.get() { ++ return Err((old, value)); ++ } ++ ++ let slot = unsafe { &mut *self.inner.get() }; ++ // This is the only place where we set the slot, no races ++ // due to reentrancy/concurrency are possible, and we've ++ // checked that slot is currently `None`, so this write ++ // maintains the `inner`'s invariant. ++ *slot = Some(value); ++ Ok(unsafe { slot.as_ref().unwrap_unchecked() }) ++ } ++ ++ /// Gets the contents of the cell, initializing it with `f` ++ /// if the cell was empty. ++ /// ++ /// # Panics ++ /// ++ /// If `f` panics, the panic is propagated to the caller, and the cell ++ /// remains uninitialized. ++ /// ++ /// It is an error to reentrantly initialize the cell from `f`. Doing ++ /// so results in a panic. ++ /// ++ /// # Example ++ /// ``` ++ /// use once_cell::unsync::OnceCell; ++ /// ++ /// let cell = OnceCell::new(); ++ /// let value = cell.get_or_init(|| 92); ++ /// assert_eq!(value, &92); ++ /// let value = cell.get_or_init(|| unreachable!()); ++ /// assert_eq!(value, &92); ++ /// ``` ++ pub fn get_or_init(&self, f: F) -> &T ++ where ++ F: FnOnce() -> T, ++ { ++ enum Void {} ++ match self.get_or_try_init(|| Ok::(f())) { ++ Ok(val) => val, ++ Err(void) => match void {}, ++ } ++ } ++ ++ /// Gets the contents of the cell, initializing it with `f` if ++ /// the cell was empty. If the cell was empty and `f` failed, an ++ /// error is returned. ++ /// ++ /// # Panics ++ /// ++ /// If `f` panics, the panic is propagated to the caller, and the cell ++ /// remains uninitialized. ++ /// ++ /// It is an error to reentrantly initialize the cell from `f`. Doing ++ /// so results in a panic. ++ /// ++ /// # Example ++ /// ``` ++ /// use once_cell::unsync::OnceCell; ++ /// ++ /// let cell = OnceCell::new(); ++ /// assert_eq!(cell.get_or_try_init(|| Err(())), Err(())); ++ /// assert!(cell.get().is_none()); ++ /// let value = cell.get_or_try_init(|| -> Result { ++ /// Ok(92) ++ /// }); ++ /// assert_eq!(value, Ok(&92)); ++ /// assert_eq!(cell.get(), Some(&92)) ++ /// ``` ++ pub fn get_or_try_init(&self, f: F) -> Result<&T, E> ++ where ++ F: FnOnce() -> Result, ++ { ++ if let Some(val) = self.get() { ++ return Ok(val); ++ } ++ let val = f()?; ++ // Note that *some* forms of reentrant initialization might lead to ++ // UB (see `reentrant_init` test). I believe that just removing this ++ // `assert`, while keeping `set/get` would be sound, but it seems ++ // better to panic, rather than to silently use an old value. ++ assert!(self.set(val).is_ok(), "reentrant init"); ++ Ok(unsafe { self.get().unwrap_unchecked() }) ++ } ++ ++ /// Takes the value out of this `OnceCell`, moving it back to an uninitialized state. ++ /// ++ /// Has no effect and returns `None` if the `OnceCell` hasn't been initialized. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use once_cell::unsync::OnceCell; ++ /// ++ /// let mut cell: OnceCell = OnceCell::new(); ++ /// assert_eq!(cell.take(), None); ++ /// ++ /// let mut cell = OnceCell::new(); ++ /// cell.set("hello".to_string()).unwrap(); ++ /// assert_eq!(cell.take(), Some("hello".to_string())); ++ /// assert_eq!(cell.get(), None); ++ /// ``` ++ /// ++ /// This method is allowed to violate the invariant of writing to a `OnceCell` ++ /// at most once because it requires `&mut` access to `self`. As with all ++ /// interior mutability, `&mut` access permits arbitrary modification: ++ /// ++ /// ``` ++ /// use once_cell::unsync::OnceCell; ++ /// ++ /// let mut cell: OnceCell = OnceCell::new(); ++ /// cell.set(92).unwrap(); ++ /// cell = OnceCell::new(); ++ /// ``` ++ pub fn take(&mut self) -> Option { ++ mem::take(self).into_inner() ++ } ++ ++ /// Consumes the `OnceCell`, returning the wrapped value. ++ /// ++ /// Returns `None` if the cell was empty. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use once_cell::unsync::OnceCell; ++ /// ++ /// let cell: OnceCell = OnceCell::new(); ++ /// assert_eq!(cell.into_inner(), None); ++ /// ++ /// let cell = OnceCell::new(); ++ /// cell.set("hello".to_string()).unwrap(); ++ /// assert_eq!(cell.into_inner(), Some("hello".to_string())); ++ /// ``` ++ pub fn into_inner(self) -> Option { ++ // Because `into_inner` takes `self` by value, the compiler statically verifies ++ // that it is not currently borrowed. So it is safe to move out `Option`. ++ self.inner.into_inner() ++ } ++ } ++ ++ /// A value which is initialized on the first access. ++ /// ++ /// # Example ++ /// ``` ++ /// use once_cell::unsync::Lazy; ++ /// ++ /// let lazy: Lazy = Lazy::new(|| { ++ /// println!("initializing"); ++ /// 92 ++ /// }); ++ /// println!("ready"); ++ /// println!("{}", *lazy); ++ /// println!("{}", *lazy); ++ /// ++ /// // Prints: ++ /// // ready ++ /// // initializing ++ /// // 92 ++ /// // 92 ++ /// ``` ++ pub struct Lazy T> { ++ cell: OnceCell, ++ init: Cell>, ++ } ++ ++ impl RefUnwindSafe for Lazy where OnceCell: RefUnwindSafe {} ++ ++ impl fmt::Debug for Lazy { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("Lazy").field("cell", &self.cell).field("init", &"..").finish() ++ } ++ } ++ ++ impl Lazy { ++ /// Creates a new lazy value with the given initializing function. ++ /// ++ /// # Example ++ /// ``` ++ /// # fn main() { ++ /// use once_cell::unsync::Lazy; ++ /// ++ /// let hello = "Hello, World!".to_string(); ++ /// ++ /// let lazy = Lazy::new(|| hello.to_uppercase()); ++ /// ++ /// assert_eq!(&*lazy, "HELLO, WORLD!"); ++ /// # } ++ /// ``` ++ pub const fn new(init: F) -> Lazy { ++ Lazy { cell: OnceCell::new(), init: Cell::new(Some(init)) } ++ } ++ ++ /// Consumes this `Lazy` returning the stored value. ++ /// ++ /// Returns `Ok(value)` if `Lazy` is initialized and `Err(f)` otherwise. ++ pub fn into_value(this: Lazy) -> Result { ++ let cell = this.cell; ++ let init = this.init; ++ cell.into_inner().ok_or_else(|| { ++ init.take().unwrap_or_else(|| panic!("Lazy instance has previously been poisoned")) ++ }) ++ } ++ } ++ ++ impl T> Lazy { ++ /// Forces the evaluation of this lazy value and returns a reference to ++ /// the result. ++ /// ++ /// This is equivalent to the `Deref` impl, but is explicit. ++ /// ++ /// # Example ++ /// ``` ++ /// use once_cell::unsync::Lazy; ++ /// ++ /// let lazy = Lazy::new(|| 92); ++ /// ++ /// assert_eq!(Lazy::force(&lazy), &92); ++ /// assert_eq!(&*lazy, &92); ++ /// ``` ++ pub fn force(this: &Lazy) -> &T { ++ this.cell.get_or_init(|| match this.init.take() { ++ Some(f) => f(), ++ None => panic!("Lazy instance has previously been poisoned"), ++ }) ++ } ++ ++ /// 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 { ++ if this.cell.get_mut().is_none() { ++ let value = match this.init.get_mut().take() { ++ Some(f) => f(), ++ None => panic!("Lazy instance has previously been poisoned"), ++ }; ++ this.cell = OnceCell::with_value(value); ++ } ++ this.cell.get_mut().unwrap_or_else(|| unreachable!()) ++ } ++ ++ /// Gets the reference to the result of this lazy value if ++ /// it was initialized, otherwise returns `None`. ++ /// ++ /// # Example ++ /// ``` ++ /// use once_cell::unsync::Lazy; ++ /// ++ /// let lazy = Lazy::new(|| 92); ++ /// ++ /// assert_eq!(Lazy::get(&lazy), None); ++ /// assert_eq!(&*lazy, &92); ++ /// assert_eq!(Lazy::get(&lazy), Some(&92)); ++ /// ``` ++ 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 { ++ type Target = T; ++ fn deref(&self) -> &T { ++ Lazy::force(self) ++ } ++ } ++ ++ impl T> DerefMut for Lazy { ++ fn deref_mut(&mut self) -> &mut T { ++ Lazy::force_mut(self) ++ } ++ } ++ ++ impl Default for Lazy { ++ /// Creates a new lazy value using `Default` as the initializing function. ++ fn default() -> Lazy { ++ Lazy::new(T::default) ++ } ++ } ++} ++ ++/// Thread-safe, blocking version of `OnceCell`. ++#[cfg(any(feature = "std", feature = "critical-section"))] ++pub mod sync { ++ use core::{ ++ cell::Cell, ++ fmt, mem, ++ ops::{Deref, DerefMut}, ++ panic::RefUnwindSafe, ++ }; ++ ++ use super::imp::OnceCell as Imp; ++ ++ /// A thread-safe cell which can be written to only once. ++ /// ++ /// `OnceCell` provides `&` references to the contents without RAII guards. ++ /// ++ /// Reading a non-`None` value out of `OnceCell` establishes a ++ /// happens-before relationship with a corresponding write. For example, if ++ /// thread A initializes the cell with `get_or_init(f)`, and thread B ++ /// subsequently reads the result of this call, B also observes all the side ++ /// effects of `f`. ++ /// ++ /// # Example ++ /// ``` ++ /// use once_cell::sync::OnceCell; ++ /// ++ /// static CELL: OnceCell = OnceCell::new(); ++ /// assert!(CELL.get().is_none()); ++ /// ++ /// std::thread::spawn(|| { ++ /// let value: &String = CELL.get_or_init(|| { ++ /// "Hello, World!".to_string() ++ /// }); ++ /// assert_eq!(value, "Hello, World!"); ++ /// }).join().unwrap(); ++ /// ++ /// let value: Option<&String> = CELL.get(); ++ /// assert!(value.is_some()); ++ /// assert_eq!(value.unwrap().as_str(), "Hello, World!"); ++ /// ``` ++ pub struct OnceCell(Imp); ++ ++ impl Default for OnceCell { ++ fn default() -> OnceCell { ++ OnceCell::new() ++ } ++ } ++ ++ impl fmt::Debug for OnceCell { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ match self.get() { ++ Some(v) => f.debug_tuple("OnceCell").field(v).finish(), ++ None => f.write_str("OnceCell(Uninit)"), ++ } ++ } ++ } ++ ++ impl Clone for OnceCell { ++ fn clone(&self) -> OnceCell { ++ match self.get() { ++ Some(value) => Self::with_value(value.clone()), ++ None => Self::new(), ++ } ++ } ++ ++ fn clone_from(&mut self, source: &Self) { ++ match (self.get_mut(), source.get()) { ++ (Some(this), Some(source)) => this.clone_from(source), ++ _ => *self = source.clone(), ++ } ++ } ++ } ++ ++ impl From for OnceCell { ++ fn from(value: T) -> Self { ++ Self::with_value(value) ++ } ++ } ++ ++ impl PartialEq for OnceCell { ++ fn eq(&self, other: &OnceCell) -> bool { ++ self.get() == other.get() ++ } ++ } ++ ++ impl Eq for OnceCell {} ++ ++ impl OnceCell { ++ /// Creates a new empty cell. ++ pub const fn new() -> OnceCell { ++ OnceCell(Imp::new()) ++ } ++ ++ /// Creates a new initialized cell. ++ pub const fn with_value(value: T) -> OnceCell { ++ OnceCell(Imp::with_value(value)) ++ } ++ ++ /// Gets the reference to the underlying value. ++ /// ++ /// Returns `None` if the cell is empty, or being initialized. This ++ /// method never blocks. ++ pub fn get(&self) -> Option<&T> { ++ if self.0.is_initialized() { ++ // Safe b/c value is initialized. ++ Some(unsafe { self.get_unchecked() }) ++ } else { ++ None ++ } ++ } ++ ++ /// Gets the reference to the underlying value, blocking the current ++ /// thread until it is set. ++ /// ++ /// ``` ++ /// use once_cell::sync::OnceCell; ++ /// ++ /// let mut cell = std::sync::Arc::new(OnceCell::new()); ++ /// let t = std::thread::spawn({ ++ /// let cell = std::sync::Arc::clone(&cell); ++ /// move || cell.set(92).unwrap() ++ /// }); ++ /// ++ /// // Returns immediately, but might return None. ++ /// let _value_or_none = cell.get(); ++ /// ++ /// // Will return 92, but might block until the other thread does `.set`. ++ /// let value: &u32 = cell.wait(); ++ /// assert_eq!(*value, 92); ++ /// t.join().unwrap(); ++ /// ``` ++ #[cfg(feature = "std")] ++ pub fn wait(&self) -> &T { ++ if !self.0.is_initialized() { ++ self.0.wait() ++ } ++ debug_assert!(self.0.is_initialized()); ++ // Safe b/c of the wait call above and the fact that we didn't ++ // relinquish our borrow. ++ unsafe { self.get_unchecked() } ++ } ++ ++ /// Gets the mutable reference to the underlying value. ++ /// ++ /// Returns `None` if the cell is empty. ++ /// ++ /// This method is allowed to violate the invariant of writing to a `OnceCell` ++ /// at most once because it requires `&mut` access to `self`. As with all ++ /// interior mutability, `&mut` access permits arbitrary modification: ++ /// ++ /// ``` ++ /// use once_cell::sync::OnceCell; ++ /// ++ /// let mut cell: OnceCell = OnceCell::new(); ++ /// cell.set(92).unwrap(); ++ /// cell = OnceCell::new(); ++ /// ``` ++ #[inline] ++ pub fn get_mut(&mut self) -> Option<&mut T> { ++ self.0.get_mut() ++ } ++ ++ /// Get the reference to the underlying value, without checking if the ++ /// cell is initialized. ++ /// ++ /// # Safety ++ /// ++ /// Caller must ensure that the cell is in initialized state, and that ++ /// the contents are acquired by (synchronized to) this thread. ++ #[inline] ++ pub unsafe fn get_unchecked(&self) -> &T { ++ self.0.get_unchecked() ++ } ++ ++ /// Sets the contents of this cell to `value`. ++ /// ++ /// Returns `Ok(())` if the cell was empty and `Err(value)` if it was ++ /// full. ++ /// ++ /// # Example ++ /// ++ /// ``` ++ /// use once_cell::sync::OnceCell; ++ /// ++ /// static CELL: OnceCell = OnceCell::new(); ++ /// ++ /// fn main() { ++ /// assert!(CELL.get().is_none()); ++ /// ++ /// std::thread::spawn(|| { ++ /// assert_eq!(CELL.set(92), Ok(())); ++ /// }).join().unwrap(); ++ /// ++ /// assert_eq!(CELL.set(62), Err(62)); ++ /// assert_eq!(CELL.get(), Some(&92)); ++ /// } ++ /// ``` ++ pub fn set(&self, value: T) -> Result<(), T> { ++ match self.try_insert(value) { ++ Ok(_) => Ok(()), ++ Err((_, value)) => Err(value), ++ } ++ } ++ ++ /// Like [`set`](Self::set), but also returns a reference to the final cell value. ++ /// ++ /// # Example ++ /// ++ /// ``` ++ /// use once_cell::unsync::OnceCell; ++ /// ++ /// let cell = OnceCell::new(); ++ /// assert!(cell.get().is_none()); ++ /// ++ /// assert_eq!(cell.try_insert(92), Ok(&92)); ++ /// assert_eq!(cell.try_insert(62), Err((&92, 62))); ++ /// ++ /// assert!(cell.get().is_some()); ++ /// ``` ++ pub fn try_insert(&self, value: T) -> Result<&T, (&T, T)> { ++ let mut value = Some(value); ++ let res = self.get_or_init(|| unsafe { value.take().unwrap_unchecked() }); ++ match value { ++ None => Ok(res), ++ Some(value) => Err((res, value)), ++ } ++ } ++ ++ /// Gets the contents of the cell, initializing it with `f` if the cell ++ /// was empty. ++ /// ++ /// Many threads may call `get_or_init` concurrently with different ++ /// initializing functions, but it is guaranteed that only one function ++ /// will be executed. ++ /// ++ /// # Panics ++ /// ++ /// If `f` panics, the panic is propagated to the caller, and the cell ++ /// remains uninitialized. ++ /// ++ /// It is an error to reentrantly initialize the cell from `f`. The ++ /// exact outcome is unspecified. Current implementation deadlocks, but ++ /// this may be changed to a panic in the future. ++ /// ++ /// # Example ++ /// ``` ++ /// use once_cell::sync::OnceCell; ++ /// ++ /// let cell = OnceCell::new(); ++ /// let value = cell.get_or_init(|| 92); ++ /// assert_eq!(value, &92); ++ /// let value = cell.get_or_init(|| unreachable!()); ++ /// assert_eq!(value, &92); ++ /// ``` ++ pub fn get_or_init(&self, f: F) -> &T ++ where ++ F: FnOnce() -> T, ++ { ++ enum Void {} ++ match self.get_or_try_init(|| Ok::(f())) { ++ Ok(val) => val, ++ Err(void) => match void {}, ++ } ++ } ++ ++ /// Gets the contents of the cell, initializing it with `f` if ++ /// the cell was empty. If the cell was empty and `f` failed, an ++ /// error is returned. ++ /// ++ /// # Panics ++ /// ++ /// If `f` panics, the panic is propagated to the caller, and ++ /// the cell remains uninitialized. ++ /// ++ /// It is an error to reentrantly initialize the cell from `f`. ++ /// The exact outcome is unspecified. Current implementation ++ /// deadlocks, but this may be changed to a panic in the future. ++ /// ++ /// # Example ++ /// ``` ++ /// use once_cell::sync::OnceCell; ++ /// ++ /// let cell = OnceCell::new(); ++ /// assert_eq!(cell.get_or_try_init(|| Err(())), Err(())); ++ /// assert!(cell.get().is_none()); ++ /// let value = cell.get_or_try_init(|| -> Result { ++ /// Ok(92) ++ /// }); ++ /// assert_eq!(value, Ok(&92)); ++ /// assert_eq!(cell.get(), Some(&92)) ++ /// ``` ++ pub fn get_or_try_init(&self, f: F) -> Result<&T, E> ++ where ++ F: FnOnce() -> Result, ++ { ++ // Fast path check ++ if let Some(value) = self.get() { ++ return Ok(value); ++ } ++ ++ self.0.initialize(f)?; ++ ++ // Safe b/c value is initialized. ++ debug_assert!(self.0.is_initialized()); ++ Ok(unsafe { self.get_unchecked() }) ++ } ++ ++ /// Takes the value out of this `OnceCell`, moving it back to an uninitialized state. ++ /// ++ /// Has no effect and returns `None` if the `OnceCell` hasn't been initialized. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use once_cell::sync::OnceCell; ++ /// ++ /// let mut cell: OnceCell = OnceCell::new(); ++ /// assert_eq!(cell.take(), None); ++ /// ++ /// let mut cell = OnceCell::new(); ++ /// cell.set("hello".to_string()).unwrap(); ++ /// assert_eq!(cell.take(), Some("hello".to_string())); ++ /// assert_eq!(cell.get(), None); ++ /// ``` ++ /// ++ /// This method is allowed to violate the invariant of writing to a `OnceCell` ++ /// at most once because it requires `&mut` access to `self`. As with all ++ /// interior mutability, `&mut` access permits arbitrary modification: ++ /// ++ /// ``` ++ /// use once_cell::sync::OnceCell; ++ /// ++ /// let mut cell: OnceCell = OnceCell::new(); ++ /// cell.set(92).unwrap(); ++ /// cell = OnceCell::new(); ++ /// ``` ++ pub fn take(&mut self) -> Option { ++ mem::take(self).into_inner() ++ } ++ ++ /// Consumes the `OnceCell`, returning the wrapped value. Returns ++ /// `None` if the cell was empty. ++ /// ++ /// # Examples ++ /// ++ /// ``` ++ /// use once_cell::sync::OnceCell; ++ /// ++ /// let cell: OnceCell = OnceCell::new(); ++ /// assert_eq!(cell.into_inner(), None); ++ /// ++ /// let cell = OnceCell::new(); ++ /// cell.set("hello".to_string()).unwrap(); ++ /// assert_eq!(cell.into_inner(), Some("hello".to_string())); ++ /// ``` ++ #[inline] ++ pub fn into_inner(self) -> Option { ++ self.0.into_inner() ++ } ++ } ++ ++ /// A value which is initialized on the first access. ++ /// ++ /// This type is thread-safe and can be used in statics. ++ /// ++ /// # Example ++ /// ++ /// ``` ++ /// use std::collections::HashMap; ++ /// ++ /// use once_cell::sync::Lazy; ++ /// ++ /// static HASHMAP: Lazy> = Lazy::new(|| { ++ /// println!("initializing"); ++ /// let mut m = HashMap::new(); ++ /// m.insert(13, "Spica".to_string()); ++ /// m.insert(74, "Hoyten".to_string()); ++ /// m ++ /// }); ++ /// ++ /// fn main() { ++ /// println!("ready"); ++ /// std::thread::spawn(|| { ++ /// println!("{:?}", HASHMAP.get(&13)); ++ /// }).join().unwrap(); ++ /// println!("{:?}", HASHMAP.get(&74)); ++ /// ++ /// // Prints: ++ /// // ready ++ /// // initializing ++ /// // Some("Spica") ++ /// // Some("Hoyten") ++ /// } ++ /// ``` ++ pub struct Lazy T> { ++ cell: OnceCell, ++ init: Cell>, ++ } ++ ++ impl fmt::Debug for Lazy { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("Lazy").field("cell", &self.cell).field("init", &"..").finish() ++ } ++ } ++ ++ // We never create a `&F` from a `&Lazy` so it is fine to not impl ++ // `Sync` for `F`. We do create a `&mut Option` in `force`, but this is ++ // properly synchronized, so it only happens once so it also does not ++ // contribute to this impl. ++ unsafe impl Sync for Lazy where OnceCell: Sync {} ++ // auto-derived `Send` impl is OK. ++ ++ impl RefUnwindSafe for Lazy where OnceCell: RefUnwindSafe {} ++ ++ impl Lazy { ++ /// Creates a new lazy value with the given initializing ++ /// function. ++ pub const fn new(f: F) -> Lazy { ++ Lazy { cell: OnceCell::new(), init: Cell::new(Some(f)) } ++ } ++ ++ /// Consumes this `Lazy` returning the stored value. ++ /// ++ /// Returns `Ok(value)` if `Lazy` is initialized and `Err(f)` otherwise. ++ pub fn into_value(this: Lazy) -> Result { ++ let cell = this.cell; ++ let init = this.init; ++ cell.into_inner().ok_or_else(|| { ++ init.take().unwrap_or_else(|| panic!("Lazy instance has previously been poisoned")) ++ }) ++ } ++ } ++ ++ impl T> Lazy { ++ /// Forces the evaluation of this lazy value and ++ /// returns a reference to the result. This is equivalent ++ /// to the `Deref` impl, but is explicit. ++ /// ++ /// # Example ++ /// ``` ++ /// use once_cell::sync::Lazy; ++ /// ++ /// let lazy = Lazy::new(|| 92); ++ /// ++ /// assert_eq!(Lazy::force(&lazy), &92); ++ /// assert_eq!(&*lazy, &92); ++ /// ``` ++ pub fn force(this: &Lazy) -> &T { ++ this.cell.get_or_init(|| match this.init.take() { ++ Some(f) => f(), ++ None => panic!("Lazy instance has previously been poisoned"), ++ }) ++ } ++ ++ /// 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 { ++ if this.cell.get_mut().is_none() { ++ let value = match this.init.get_mut().take() { ++ Some(f) => f(), ++ None => panic!("Lazy instance has previously been poisoned"), ++ }; ++ this.cell = OnceCell::with_value(value); ++ } ++ this.cell.get_mut().unwrap_or_else(|| unreachable!()) ++ } ++ ++ /// Gets the reference to the result of this lazy value if ++ /// it was initialized, otherwise returns `None`. ++ /// ++ /// # Example ++ /// ``` ++ /// use once_cell::sync::Lazy; ++ /// ++ /// let lazy = Lazy::new(|| 92); ++ /// ++ /// assert_eq!(Lazy::get(&lazy), None); ++ /// assert_eq!(&*lazy, &92); ++ /// assert_eq!(Lazy::get(&lazy), Some(&92)); ++ /// ``` ++ 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 { ++ type Target = T; ++ fn deref(&self) -> &T { ++ Lazy::force(self) ++ } ++ } ++ ++ impl T> DerefMut for Lazy { ++ fn deref_mut(&mut self) -> &mut T { ++ Lazy::force_mut(self) ++ } ++ } ++ ++ impl Default for Lazy { ++ /// Creates a new lazy value using `Default` as the initializing function. ++ fn default() -> Lazy { ++ Lazy::new(T::default) ++ } ++ } ++ ++ /// ```compile_fail ++ /// struct S(*mut ()); ++ /// unsafe impl Sync for S {} ++ /// ++ /// fn share(_: &T) {} ++ /// share(&once_cell::sync::OnceCell::::new()); ++ /// ``` ++ /// ++ /// ```compile_fail ++ /// struct S(*mut ()); ++ /// unsafe impl Sync for S {} ++ /// ++ /// fn share(_: &T) {} ++ /// share(&once_cell::sync::Lazy::::new(|| unimplemented!())); ++ /// ``` ++ fn _dummy() {} ++} ++ ++#[cfg(feature = "race")] ++pub mod race; +diff -Nru mesa-25.3.3/subprojects/once_cell-1.20.2/src/race.rs mesa-25.3.3/subprojects/once_cell-1.20.2/src/race.rs +--- mesa-25.3.3/subprojects/once_cell-1.20.2/src/race.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/once_cell-1.20.2/src/race.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,419 @@ ++//! Thread-safe, non-blocking, "first one wins" flavor of `OnceCell`. ++//! ++//! If two threads race to initialize a type from the `race` module, they ++//! don't block, execute initialization function together, but only one of ++//! them stores the result. ++//! ++//! This module does not require `std` feature. ++//! ++//! # Atomic orderings ++//! ++//! All types in this module use `Acquire` and `Release` ++//! [atomic orderings](Ordering) for all their operations. While this is not ++//! strictly necessary for types other than `OnceBox`, it is useful for users as ++//! it allows them to be certain that after `get` or `get_or_init` returns on ++//! one thread, any side-effects caused by the setter thread prior to them ++//! calling `set` or `get_or_init` will be made visible to that thread; without ++//! it, it's possible for it to appear as if they haven't happened yet from the ++//! getter thread's perspective. This is an acceptable tradeoff to make since ++//! `Acquire` and `Release` have very little performance overhead on most ++//! architectures versus `Relaxed`. ++ ++#[cfg(not(feature = "portable-atomic"))] ++use core::sync::atomic; ++#[cfg(feature = "portable-atomic")] ++use portable_atomic as atomic; ++ ++use atomic::{AtomicPtr, AtomicUsize, Ordering}; ++use core::cell::UnsafeCell; ++use core::marker::PhantomData; ++use core::num::NonZeroUsize; ++use core::ptr; ++ ++/// A thread-safe cell which can be written to only once. ++#[derive(Default, Debug)] ++pub struct OnceNonZeroUsize { ++ inner: AtomicUsize, ++} ++ ++impl OnceNonZeroUsize { ++ /// Creates a new empty cell. ++ #[inline] ++ pub const fn new() -> OnceNonZeroUsize { ++ OnceNonZeroUsize { inner: AtomicUsize::new(0) } ++ } ++ ++ /// Gets the underlying value. ++ #[inline] ++ pub fn get(&self) -> Option { ++ let val = self.inner.load(Ordering::Acquire); ++ NonZeroUsize::new(val) ++ } ++ ++ /// Sets the contents of this cell to `value`. ++ /// ++ /// Returns `Ok(())` if the cell was empty and `Err(())` if it was ++ /// full. ++ #[inline] ++ pub fn set(&self, value: NonZeroUsize) -> Result<(), ()> { ++ let exchange = ++ self.inner.compare_exchange(0, value.get(), Ordering::AcqRel, Ordering::Acquire); ++ match exchange { ++ Ok(_) => Ok(()), ++ Err(_) => Err(()), ++ } ++ } ++ ++ /// Gets the contents of the cell, initializing it with `f` if the cell was ++ /// empty. ++ /// ++ /// If several threads concurrently run `get_or_init`, more than one `f` can ++ /// be called. However, all threads will return the same value, produced by ++ /// some `f`. ++ pub fn get_or_init(&self, f: F) -> NonZeroUsize ++ where ++ F: FnOnce() -> NonZeroUsize, ++ { ++ enum Void {} ++ match self.get_or_try_init(|| Ok::(f())) { ++ Ok(val) => val, ++ Err(void) => match void {}, ++ } ++ } ++ ++ /// Gets the contents of the cell, initializing it with `f` if ++ /// the cell was empty. If the cell was empty and `f` failed, an ++ /// error is returned. ++ /// ++ /// If several threads concurrently run `get_or_init`, more than one `f` can ++ /// be called. However, all threads will return the same value, produced by ++ /// some `f`. ++ pub fn get_or_try_init(&self, f: F) -> Result ++ where ++ F: FnOnce() -> Result, ++ { ++ let val = self.inner.load(Ordering::Acquire); ++ let res = match NonZeroUsize::new(val) { ++ Some(it) => it, ++ None => { ++ let mut val = f()?.get(); ++ let exchange = ++ self.inner.compare_exchange(0, val, Ordering::AcqRel, Ordering::Acquire); ++ if let Err(old) = exchange { ++ val = old; ++ } ++ unsafe { NonZeroUsize::new_unchecked(val) } ++ } ++ }; ++ Ok(res) ++ } ++} ++ ++/// A thread-safe cell which can be written to only once. ++#[derive(Default, Debug)] ++pub struct OnceBool { ++ inner: OnceNonZeroUsize, ++} ++ ++impl OnceBool { ++ /// Creates a new empty cell. ++ #[inline] ++ pub const fn new() -> OnceBool { ++ OnceBool { inner: OnceNonZeroUsize::new() } ++ } ++ ++ /// Gets the underlying value. ++ #[inline] ++ pub fn get(&self) -> Option { ++ self.inner.get().map(OnceBool::from_usize) ++ } ++ ++ /// Sets the contents of this cell to `value`. ++ /// ++ /// Returns `Ok(())` if the cell was empty and `Err(())` if it was ++ /// full. ++ #[inline] ++ pub fn set(&self, value: bool) -> Result<(), ()> { ++ self.inner.set(OnceBool::to_usize(value)) ++ } ++ ++ /// Gets the contents of the cell, initializing it with `f` if the cell was ++ /// empty. ++ /// ++ /// If several threads concurrently run `get_or_init`, more than one `f` can ++ /// be called. However, all threads will return the same value, produced by ++ /// some `f`. ++ pub fn get_or_init(&self, f: F) -> bool ++ where ++ F: FnOnce() -> bool, ++ { ++ OnceBool::from_usize(self.inner.get_or_init(|| OnceBool::to_usize(f()))) ++ } ++ ++ /// Gets the contents of the cell, initializing it with `f` if ++ /// the cell was empty. If the cell was empty and `f` failed, an ++ /// error is returned. ++ /// ++ /// If several threads concurrently run `get_or_init`, more than one `f` can ++ /// be called. However, all threads will return the same value, produced by ++ /// some `f`. ++ pub fn get_or_try_init(&self, f: F) -> Result ++ where ++ F: FnOnce() -> Result, ++ { ++ self.inner.get_or_try_init(|| f().map(OnceBool::to_usize)).map(OnceBool::from_usize) ++ } ++ ++ #[inline] ++ fn from_usize(value: NonZeroUsize) -> bool { ++ value.get() == 1 ++ } ++ ++ #[inline] ++ fn to_usize(value: bool) -> NonZeroUsize { ++ unsafe { NonZeroUsize::new_unchecked(if value { 1 } else { 2 }) } ++ } ++} ++ ++/// A thread-safe cell which can be written to only once. ++pub struct OnceRef<'a, T> { ++ inner: AtomicPtr, ++ ghost: PhantomData>, ++} ++ ++// TODO: Replace UnsafeCell with SyncUnsafeCell once stabilized ++unsafe impl<'a, T: Sync> Sync for OnceRef<'a, T> {} ++ ++impl<'a, T> core::fmt::Debug for OnceRef<'a, T> { ++ fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { ++ write!(f, "OnceRef({:?})", self.inner) ++ } ++} ++ ++impl<'a, T> Default for OnceRef<'a, T> { ++ fn default() -> Self { ++ Self::new() ++ } ++} ++ ++impl<'a, T> OnceRef<'a, T> { ++ /// Creates a new empty cell. ++ pub const fn new() -> OnceRef<'a, T> { ++ OnceRef { inner: AtomicPtr::new(ptr::null_mut()), ghost: PhantomData } ++ } ++ ++ /// Gets a reference to the underlying value. ++ pub fn get(&self) -> Option<&'a T> { ++ let ptr = self.inner.load(Ordering::Acquire); ++ unsafe { ptr.as_ref() } ++ } ++ ++ /// Sets the contents of this cell to `value`. ++ /// ++ /// Returns `Ok(())` if the cell was empty and `Err(value)` if it was ++ /// full. ++ pub fn set(&self, value: &'a T) -> Result<(), ()> { ++ let ptr = value as *const T as *mut T; ++ let exchange = ++ self.inner.compare_exchange(ptr::null_mut(), ptr, Ordering::AcqRel, Ordering::Acquire); ++ match exchange { ++ Ok(_) => Ok(()), ++ Err(_) => Err(()), ++ } ++ } ++ ++ /// Gets the contents of the cell, initializing it with `f` if the cell was ++ /// empty. ++ /// ++ /// If several threads concurrently run `get_or_init`, more than one `f` can ++ /// be called. However, all threads will return the same value, produced by ++ /// some `f`. ++ pub fn get_or_init(&self, f: F) -> &'a T ++ where ++ F: FnOnce() -> &'a T, ++ { ++ enum Void {} ++ match self.get_or_try_init(|| Ok::<&'a T, Void>(f())) { ++ Ok(val) => val, ++ Err(void) => match void {}, ++ } ++ } ++ ++ /// Gets the contents of the cell, initializing it with `f` if ++ /// the cell was empty. If the cell was empty and `f` failed, an ++ /// error is returned. ++ /// ++ /// If several threads concurrently run `get_or_init`, more than one `f` can ++ /// be called. However, all threads will return the same value, produced by ++ /// some `f`. ++ pub fn get_or_try_init(&self, f: F) -> Result<&'a T, E> ++ where ++ F: FnOnce() -> Result<&'a T, E>, ++ { ++ let mut ptr = self.inner.load(Ordering::Acquire); ++ ++ if ptr.is_null() { ++ // TODO replace with `cast_mut` when MSRV reaches 1.65.0 (also in `set`) ++ ptr = f()? as *const T as *mut T; ++ let exchange = self.inner.compare_exchange( ++ ptr::null_mut(), ++ ptr, ++ Ordering::AcqRel, ++ Ordering::Acquire, ++ ); ++ if let Err(old) = exchange { ++ ptr = old; ++ } ++ } ++ ++ Ok(unsafe { &*ptr }) ++ } ++ ++ /// ```compile_fail ++ /// use once_cell::race::OnceRef; ++ /// ++ /// let mut l = OnceRef::new(); ++ /// ++ /// { ++ /// let y = 2; ++ /// let mut r = OnceRef::new(); ++ /// r.set(&y).unwrap(); ++ /// core::mem::swap(&mut l, &mut r); ++ /// } ++ /// ++ /// // l now contains a dangling reference to y ++ /// eprintln!("uaf: {}", l.get().unwrap()); ++ /// ``` ++ fn _dummy() {} ++} ++ ++#[cfg(feature = "alloc")] ++pub use self::once_box::OnceBox; ++ ++#[cfg(feature = "alloc")] ++mod once_box { ++ use super::atomic::{AtomicPtr, Ordering}; ++ use core::{marker::PhantomData, ptr}; ++ ++ use alloc::boxed::Box; ++ ++ /// A thread-safe cell which can be written to only once. ++ pub struct OnceBox { ++ inner: AtomicPtr, ++ ghost: PhantomData>>, ++ } ++ ++ impl core::fmt::Debug for OnceBox { ++ fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { ++ write!(f, "OnceBox({:?})", self.inner.load(Ordering::Relaxed)) ++ } ++ } ++ ++ impl Default for OnceBox { ++ fn default() -> Self { ++ Self::new() ++ } ++ } ++ ++ impl Drop for OnceBox { ++ fn drop(&mut self) { ++ let ptr = *self.inner.get_mut(); ++ if !ptr.is_null() { ++ drop(unsafe { Box::from_raw(ptr) }) ++ } ++ } ++ } ++ ++ impl OnceBox { ++ /// Creates a new empty cell. ++ pub const fn new() -> OnceBox { ++ OnceBox { inner: AtomicPtr::new(ptr::null_mut()), ghost: PhantomData } ++ } ++ ++ /// Gets a reference to the underlying value. ++ pub fn get(&self) -> Option<&T> { ++ let ptr = self.inner.load(Ordering::Acquire); ++ if ptr.is_null() { ++ return None; ++ } ++ Some(unsafe { &*ptr }) ++ } ++ ++ /// Sets the contents of this cell to `value`. ++ /// ++ /// Returns `Ok(())` if the cell was empty and `Err(value)` if it was ++ /// full. ++ pub fn set(&self, value: Box) -> Result<(), Box> { ++ let ptr = Box::into_raw(value); ++ let exchange = self.inner.compare_exchange( ++ ptr::null_mut(), ++ ptr, ++ Ordering::AcqRel, ++ Ordering::Acquire, ++ ); ++ if exchange.is_err() { ++ let value = unsafe { Box::from_raw(ptr) }; ++ return Err(value); ++ } ++ Ok(()) ++ } ++ ++ /// Gets the contents of the cell, initializing it with `f` if the cell was ++ /// empty. ++ /// ++ /// If several threads concurrently run `get_or_init`, more than one `f` can ++ /// be called. However, all threads will return the same value, produced by ++ /// some `f`. ++ pub fn get_or_init(&self, f: F) -> &T ++ where ++ F: FnOnce() -> Box, ++ { ++ enum Void {} ++ match self.get_or_try_init(|| Ok::, Void>(f())) { ++ Ok(val) => val, ++ Err(void) => match void {}, ++ } ++ } ++ ++ /// Gets the contents of the cell, initializing it with `f` if ++ /// the cell was empty. If the cell was empty and `f` failed, an ++ /// error is returned. ++ /// ++ /// If several threads concurrently run `get_or_init`, more than one `f` can ++ /// be called. However, all threads will return the same value, produced by ++ /// some `f`. ++ pub fn get_or_try_init(&self, f: F) -> Result<&T, E> ++ where ++ F: FnOnce() -> Result, E>, ++ { ++ let mut ptr = self.inner.load(Ordering::Acquire); ++ ++ if ptr.is_null() { ++ let val = f()?; ++ ptr = Box::into_raw(val); ++ let exchange = self.inner.compare_exchange( ++ ptr::null_mut(), ++ ptr, ++ Ordering::AcqRel, ++ Ordering::Acquire, ++ ); ++ if let Err(old) = exchange { ++ drop(unsafe { Box::from_raw(ptr) }); ++ ptr = old; ++ } ++ }; ++ Ok(unsafe { &*ptr }) ++ } ++ } ++ ++ unsafe impl Sync for OnceBox {} ++ ++ /// ```compile_fail ++ /// struct S(*mut ()); ++ /// unsafe impl Sync for S {} ++ /// ++ /// fn share(_: &T) {} ++ /// share(&once_cell::race::OnceBox::::new()); ++ /// ``` ++ fn _dummy() {} ++} +diff -Nru mesa-25.3.3/subprojects/once_cell-1.20.2/tests/it/main.rs mesa-25.3.3/subprojects/once_cell-1.20.2/tests/it/main.rs +--- mesa-25.3.3/subprojects/once_cell-1.20.2/tests/it/main.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/once_cell-1.20.2/tests/it/main.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,12 @@ ++mod unsync_once_cell; ++#[cfg(any(feature = "std", feature = "critical-section"))] ++mod sync_once_cell; ++ ++mod unsync_lazy; ++#[cfg(any(feature = "std", feature = "critical-section"))] ++mod sync_lazy; ++ ++#[cfg(feature = "race")] ++mod race; ++#[cfg(all(feature = "race", feature = "alloc"))] ++mod race_once_box; +diff -Nru mesa-25.3.3/subprojects/once_cell-1.20.2/tests/it/race_once_box.rs mesa-25.3.3/subprojects/once_cell-1.20.2/tests/it/race_once_box.rs +--- mesa-25.3.3/subprojects/once_cell-1.20.2/tests/it/race_once_box.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/once_cell-1.20.2/tests/it/race_once_box.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,145 @@ ++#[cfg(feature = "std")] ++use std::sync::Barrier; ++use std::sync::{ ++ atomic::{AtomicUsize, Ordering::SeqCst}, ++ Arc, ++}; ++ ++use once_cell::race::OnceBox; ++ ++#[derive(Default)] ++struct Heap { ++ total: Arc, ++} ++ ++#[derive(Debug)] ++struct Pebble { ++ val: T, ++ total: Arc, ++} ++ ++impl Drop for Pebble { ++ fn drop(&mut self) { ++ self.total.fetch_sub(1, SeqCst); ++ } ++} ++ ++impl Heap { ++ fn total(&self) -> usize { ++ self.total.load(SeqCst) ++ } ++ fn new_pebble(&self, val: T) -> Pebble { ++ self.total.fetch_add(1, SeqCst); ++ Pebble { val, total: Arc::clone(&self.total) } ++ } ++} ++ ++#[cfg(feature = "std")] ++#[test] ++fn once_box_smoke_test() { ++ use std::thread::scope; ++ ++ let heap = Heap::default(); ++ let global_cnt = AtomicUsize::new(0); ++ let cell = OnceBox::new(); ++ let b = Barrier::new(128); ++ scope(|s| { ++ for _ in 0..128 { ++ s.spawn(|| { ++ let local_cnt = AtomicUsize::new(0); ++ cell.get_or_init(|| { ++ global_cnt.fetch_add(1, SeqCst); ++ local_cnt.fetch_add(1, SeqCst); ++ b.wait(); ++ Box::new(heap.new_pebble(())) ++ }); ++ assert_eq!(local_cnt.load(SeqCst), 1); ++ ++ cell.get_or_init(|| { ++ global_cnt.fetch_add(1, SeqCst); ++ local_cnt.fetch_add(1, SeqCst); ++ Box::new(heap.new_pebble(())) ++ }); ++ assert_eq!(local_cnt.load(SeqCst), 1); ++ }); ++ } ++ }); ++ assert!(cell.get().is_some()); ++ assert!(global_cnt.load(SeqCst) > 10); ++ ++ assert_eq!(heap.total(), 1); ++ drop(cell); ++ assert_eq!(heap.total(), 0); ++} ++ ++#[test] ++fn once_box_set() { ++ let heap = Heap::default(); ++ let cell = OnceBox::new(); ++ assert!(cell.get().is_none()); ++ ++ assert!(cell.set(Box::new(heap.new_pebble("hello"))).is_ok()); ++ assert_eq!(cell.get().unwrap().val, "hello"); ++ assert_eq!(heap.total(), 1); ++ ++ assert!(cell.set(Box::new(heap.new_pebble("world"))).is_err()); ++ assert_eq!(cell.get().unwrap().val, "hello"); ++ assert_eq!(heap.total(), 1); ++ ++ drop(cell); ++ assert_eq!(heap.total(), 0); ++} ++ ++#[cfg(feature = "std")] ++#[test] ++fn once_box_first_wins() { ++ use std::thread::scope; ++ ++ let cell = OnceBox::new(); ++ let val1 = 92; ++ let val2 = 62; ++ ++ let b1 = Barrier::new(2); ++ let b2 = Barrier::new(2); ++ let b3 = Barrier::new(2); ++ scope(|s| { ++ s.spawn(|| { ++ let r1 = cell.get_or_init(|| { ++ b1.wait(); ++ b2.wait(); ++ Box::new(val1) ++ }); ++ assert_eq!(*r1, val1); ++ b3.wait(); ++ }); ++ b1.wait(); ++ s.spawn(|| { ++ let r2 = cell.get_or_init(|| { ++ b2.wait(); ++ b3.wait(); ++ Box::new(val2) ++ }); ++ assert_eq!(*r2, val1); ++ }); ++ }); ++ ++ assert_eq!(cell.get(), Some(&val1)); ++} ++ ++#[test] ++fn once_box_reentrant() { ++ let cell = OnceBox::new(); ++ let res = cell.get_or_init(|| { ++ cell.get_or_init(|| Box::new("hello".to_string())); ++ Box::new("world".to_string()) ++ }); ++ assert_eq!(res, "hello"); ++} ++ ++#[test] ++fn once_box_default() { ++ struct Foo; ++ ++ let cell: OnceBox = Default::default(); ++ assert!(cell.get().is_none()); ++} +diff -Nru mesa-25.3.3/subprojects/once_cell-1.20.2/tests/it/race.rs mesa-25.3.3/subprojects/once_cell-1.20.2/tests/it/race.rs +--- mesa-25.3.3/subprojects/once_cell-1.20.2/tests/it/race.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/once_cell-1.20.2/tests/it/race.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,128 @@ ++#[cfg(feature = "std")] ++use std::sync::Barrier; ++use std::{ ++ num::NonZeroUsize, ++ sync::atomic::{AtomicUsize, Ordering::SeqCst}, ++ thread::scope, ++}; ++ ++use once_cell::race::{OnceBool, OnceNonZeroUsize}; ++ ++#[test] ++fn once_non_zero_usize_smoke_test() { ++ let cnt = AtomicUsize::new(0); ++ let cell = OnceNonZeroUsize::new(); ++ let val = NonZeroUsize::new(92).unwrap(); ++ scope(|s| { ++ s.spawn(|| { ++ assert_eq!( ++ cell.get_or_init(|| { ++ cnt.fetch_add(1, SeqCst); ++ val ++ }), ++ val ++ ); ++ assert_eq!(cnt.load(SeqCst), 1); ++ ++ assert_eq!( ++ cell.get_or_init(|| { ++ cnt.fetch_add(1, SeqCst); ++ val ++ }), ++ val ++ ); ++ assert_eq!(cnt.load(SeqCst), 1); ++ }); ++ }); ++ assert_eq!(cell.get(), Some(val)); ++ assert_eq!(cnt.load(SeqCst), 1); ++} ++ ++#[test] ++fn once_non_zero_usize_set() { ++ let val1 = NonZeroUsize::new(92).unwrap(); ++ let val2 = NonZeroUsize::new(62).unwrap(); ++ ++ let cell = OnceNonZeroUsize::new(); ++ ++ assert!(cell.set(val1).is_ok()); ++ assert_eq!(cell.get(), Some(val1)); ++ ++ assert!(cell.set(val2).is_err()); ++ assert_eq!(cell.get(), Some(val1)); ++} ++ ++#[cfg(feature = "std")] ++#[test] ++fn once_non_zero_usize_first_wins() { ++ let val1 = NonZeroUsize::new(92).unwrap(); ++ let val2 = NonZeroUsize::new(62).unwrap(); ++ ++ let cell = OnceNonZeroUsize::new(); ++ ++ let b1 = Barrier::new(2); ++ let b2 = Barrier::new(2); ++ let b3 = Barrier::new(2); ++ scope(|s| { ++ s.spawn(|| { ++ let r1 = cell.get_or_init(|| { ++ b1.wait(); ++ b2.wait(); ++ val1 ++ }); ++ assert_eq!(r1, val1); ++ b3.wait(); ++ }); ++ b1.wait(); ++ s.spawn(|| { ++ let r2 = cell.get_or_init(|| { ++ b2.wait(); ++ b3.wait(); ++ val2 ++ }); ++ assert_eq!(r2, val1); ++ }); ++ }); ++ ++ assert_eq!(cell.get(), Some(val1)); ++} ++ ++#[test] ++fn once_bool_smoke_test() { ++ let cnt = AtomicUsize::new(0); ++ let cell = OnceBool::new(); ++ scope(|s| { ++ s.spawn(|| { ++ assert_eq!( ++ cell.get_or_init(|| { ++ cnt.fetch_add(1, SeqCst); ++ false ++ }), ++ false ++ ); ++ assert_eq!(cnt.load(SeqCst), 1); ++ ++ assert_eq!( ++ cell.get_or_init(|| { ++ cnt.fetch_add(1, SeqCst); ++ false ++ }), ++ false ++ ); ++ assert_eq!(cnt.load(SeqCst), 1); ++ }); ++ }); ++ assert_eq!(cell.get(), Some(false)); ++ assert_eq!(cnt.load(SeqCst), 1); ++} ++ ++#[test] ++fn once_bool_set() { ++ let cell = OnceBool::new(); ++ ++ assert!(cell.set(false).is_ok()); ++ assert_eq!(cell.get(), Some(false)); ++ ++ assert!(cell.set(true).is_err()); ++ assert_eq!(cell.get(), Some(false)); ++} +diff -Nru mesa-25.3.3/subprojects/once_cell-1.20.2/tests/it/sync_lazy.rs mesa-25.3.3/subprojects/once_cell-1.20.2/tests/it/sync_lazy.rs +--- mesa-25.3.3/subprojects/once_cell-1.20.2/tests/it/sync_lazy.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/once_cell-1.20.2/tests/it/sync_lazy.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,176 @@ ++use std::{ ++ cell::Cell, ++ sync::atomic::{AtomicUsize, Ordering::SeqCst}, ++ thread::scope, ++}; ++ ++use once_cell::sync::{Lazy, OnceCell}; ++ ++#[test] ++fn lazy_new() { ++ let called = AtomicUsize::new(0); ++ let x = Lazy::new(|| { ++ called.fetch_add(1, SeqCst); ++ 92 ++ }); ++ ++ assert_eq!(called.load(SeqCst), 0); ++ ++ scope(|s| { ++ s.spawn(|| { ++ let y = *x - 30; ++ assert_eq!(y, 62); ++ assert_eq!(called.load(SeqCst), 1); ++ }); ++ }); ++ ++ let y = *x - 30; ++ assert_eq!(y, 62); ++ assert_eq!(called.load(SeqCst), 1); ++} ++ ++#[test] ++fn lazy_deref_mut() { ++ let called = AtomicUsize::new(0); ++ let mut x = Lazy::new(|| { ++ called.fetch_add(1, SeqCst); ++ 92 ++ }); ++ ++ assert_eq!(called.load(SeqCst), 0); ++ ++ let y = *x - 30; ++ assert_eq!(y, 62); ++ assert_eq!(called.load(SeqCst), 1); ++ ++ *x /= 2; ++ assert_eq!(*x, 46); ++ assert_eq!(called.load(SeqCst), 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); ++ ++ struct Foo(u8); ++ impl Default for Foo { ++ fn default() -> Self { ++ CALLED.fetch_add(1, SeqCst); ++ Foo(42) ++ } ++ } ++ ++ let lazy: Lazy> = <_>::default(); ++ ++ assert_eq!(CALLED.load(SeqCst), 0); ++ ++ assert_eq!(lazy.lock().unwrap().0, 42); ++ assert_eq!(CALLED.load(SeqCst), 1); ++ ++ lazy.lock().unwrap().0 = 21; ++ ++ assert_eq!(lazy.lock().unwrap().0, 21); ++ assert_eq!(CALLED.load(SeqCst), 1); ++} ++ ++#[test] ++fn static_lazy() { ++ static XS: Lazy> = Lazy::new(|| { ++ let mut xs = Vec::new(); ++ xs.push(1); ++ xs.push(2); ++ xs.push(3); ++ xs ++ }); ++ scope(|s| { ++ s.spawn(|| { ++ assert_eq!(&*XS, &vec![1, 2, 3]); ++ }); ++ }); ++ assert_eq!(&*XS, &vec![1, 2, 3]); ++} ++ ++#[test] ++fn static_lazy_via_fn() { ++ fn xs() -> &'static Vec { ++ static XS: OnceCell> = OnceCell::new(); ++ XS.get_or_init(|| { ++ let mut xs = Vec::new(); ++ xs.push(1); ++ xs.push(2); ++ xs.push(3); ++ xs ++ }) ++ } ++ assert_eq!(xs(), &vec![1, 2, 3]); ++} ++ ++#[test] ++fn lazy_into_value() { ++ let l: Lazy = Lazy::new(|| panic!()); ++ assert!(matches!(Lazy::into_value(l), Err(_))); ++ let l = Lazy::new(|| -> i32 { 92 }); ++ Lazy::force(&l); ++ assert!(matches!(Lazy::into_value(l), Ok(92))); ++} ++ ++#[test] ++fn lazy_poisoning() { ++ let x: Lazy = Lazy::new(|| panic!("kaboom")); ++ for _ in 0..2 { ++ let res = std::panic::catch_unwind(|| x.len()); ++ assert!(res.is_err()); ++ } ++} ++ ++#[test] ++// https://github.com/rust-lang/rust/issues/34761#issuecomment-256320669 ++fn arrrrrrrrrrrrrrrrrrrrrr() { ++ let lazy: Lazy<&String, _>; ++ { ++ let s = String::new(); ++ lazy = Lazy::new(|| &s); ++ _ = *lazy; ++ } ++} ++ ++#[test] ++fn lazy_is_sync_send() { ++ fn assert_traits() {} ++ assert_traits::>(); ++} +diff -Nru mesa-25.3.3/subprojects/once_cell-1.20.2/tests/it/sync_once_cell.rs mesa-25.3.3/subprojects/once_cell-1.20.2/tests/it/sync_once_cell.rs +--- mesa-25.3.3/subprojects/once_cell-1.20.2/tests/it/sync_once_cell.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/once_cell-1.20.2/tests/it/sync_once_cell.rs 2024-10-15 15:05:29.000000000 -0500 +@@ -0,0 +1,309 @@ ++use std::{ ++ sync::atomic::{AtomicUsize, Ordering::SeqCst}, ++ thread::scope, ++}; ++ ++#[cfg(feature = "std")] ++use std::sync::Barrier; ++ ++#[cfg(not(feature = "std"))] ++use core::cell::Cell; ++ ++use once_cell::sync::{Lazy, OnceCell}; ++ ++#[test] ++fn once_cell() { ++ let c = OnceCell::new(); ++ assert!(c.get().is_none()); ++ scope(|s| { ++ s.spawn(|| { ++ c.get_or_init(|| 92); ++ assert_eq!(c.get(), Some(&92)); ++ }); ++ }); ++ c.get_or_init(|| panic!("Kabom!")); ++ assert_eq!(c.get(), Some(&92)); ++} ++ ++#[test] ++fn once_cell_with_value() { ++ static CELL: OnceCell = OnceCell::with_value(12); ++ assert_eq!(CELL.get(), Some(&12)); ++} ++ ++#[test] ++fn once_cell_get_mut() { ++ let mut c = OnceCell::new(); ++ assert!(c.get_mut().is_none()); ++ c.set(90).unwrap(); ++ *c.get_mut().unwrap() += 2; ++ assert_eq!(c.get_mut(), Some(&mut 92)); ++} ++ ++#[test] ++fn once_cell_get_unchecked() { ++ let c = OnceCell::new(); ++ c.set(92).unwrap(); ++ unsafe { ++ assert_eq!(c.get_unchecked(), &92); ++ } ++} ++ ++#[test] ++fn once_cell_drop() { ++ static DROP_CNT: AtomicUsize = AtomicUsize::new(0); ++ struct Dropper; ++ impl Drop for Dropper { ++ fn drop(&mut self) { ++ DROP_CNT.fetch_add(1, SeqCst); ++ } ++ } ++ ++ let x = OnceCell::new(); ++ scope(|s| { ++ s.spawn(|| { ++ x.get_or_init(|| Dropper); ++ assert_eq!(DROP_CNT.load(SeqCst), 0); ++ drop(x); ++ }); ++ }); ++ assert_eq!(DROP_CNT.load(SeqCst), 1); ++} ++ ++#[test] ++fn once_cell_drop_empty() { ++ let x = OnceCell::::new(); ++ drop(x); ++} ++ ++#[test] ++fn clone() { ++ let s = OnceCell::new(); ++ let c = s.clone(); ++ assert!(c.get().is_none()); ++ ++ s.set("hello".to_string()).unwrap(); ++ let c = s.clone(); ++ assert_eq!(c.get().map(String::as_str), Some("hello")); ++} ++ ++#[test] ++fn get_or_try_init() { ++ let cell: OnceCell = OnceCell::new(); ++ assert!(cell.get().is_none()); ++ ++ let res = std::panic::catch_unwind(|| cell.get_or_try_init(|| -> Result<_, ()> { panic!() })); ++ assert!(res.is_err()); ++ assert!(cell.get().is_none()); ++ ++ assert_eq!(cell.get_or_try_init(|| Err(())), Err(())); ++ ++ assert_eq!(cell.get_or_try_init(|| Ok::<_, ()>("hello".to_string())), Ok(&"hello".to_string())); ++ assert_eq!(cell.get(), Some(&"hello".to_string())); ++} ++ ++#[cfg(feature = "std")] ++#[test] ++fn wait() { ++ let cell: OnceCell = OnceCell::new(); ++ scope(|s| { ++ s.spawn(|| cell.set("hello".to_string())); ++ let greeting = cell.wait(); ++ assert_eq!(greeting, "hello") ++ }); ++} ++ ++#[cfg(feature = "std")] ++#[test] ++fn get_or_init_stress() { ++ let n_threads = if cfg!(miri) { 30 } else { 1_000 }; ++ let n_cells = if cfg!(miri) { 30 } else { 1_000 }; ++ let cells: Vec<_> = std::iter::repeat_with(|| (Barrier::new(n_threads), OnceCell::new())) ++ .take(n_cells) ++ .collect(); ++ scope(|s| { ++ for t in 0..n_threads { ++ let cells = &cells; ++ s.spawn(move || { ++ for (i, (b, s)) in cells.iter().enumerate() { ++ b.wait(); ++ let j = if t % 2 == 0 { s.wait() } else { s.get_or_init(|| i) }; ++ assert_eq!(*j, i); ++ } ++ }); ++ } ++ }); ++} ++ ++#[test] ++fn from_impl() { ++ assert_eq!(OnceCell::from("value").get(), Some(&"value")); ++ assert_ne!(OnceCell::from("foo").get(), Some(&"bar")); ++} ++ ++#[test] ++fn partialeq_impl() { ++ assert!(OnceCell::from("value") == OnceCell::from("value")); ++ assert!(OnceCell::from("foo") != OnceCell::from("bar")); ++ ++ assert!(OnceCell::::new() == OnceCell::new()); ++ assert!(OnceCell::::new() != OnceCell::from("value".to_owned())); ++} ++ ++#[test] ++fn into_inner() { ++ let cell: OnceCell = OnceCell::new(); ++ assert_eq!(cell.into_inner(), None); ++ let cell = OnceCell::new(); ++ cell.set("hello".to_string()).unwrap(); ++ assert_eq!(cell.into_inner(), Some("hello".to_string())); ++} ++ ++#[test] ++fn debug_impl() { ++ let cell = OnceCell::new(); ++ assert_eq!(format!("{:#?}", cell), "OnceCell(Uninit)"); ++ cell.set(vec!["hello", "world"]).unwrap(); ++ assert_eq!( ++ format!("{:#?}", cell), ++ r#"OnceCell( ++ [ ++ "hello", ++ "world", ++ ], ++)"# ++ ); ++} ++ ++/*#[test] ++#[cfg_attr(miri, ignore)] // miri doesn't support processes ++#[cfg(feature = "std")] ++fn reentrant_init() { ++ let examples_dir = { ++ let mut exe = std::env::current_exe().unwrap(); ++ exe.pop(); ++ exe.pop(); ++ exe.push("examples"); ++ exe ++ }; ++ let bin = examples_dir ++ .join("reentrant_init_deadlocks") ++ .with_extension(std::env::consts::EXE_EXTENSION); ++ let mut guard = Guard { child: std::process::Command::new(bin).spawn().unwrap() }; ++ std::thread::sleep(std::time::Duration::from_secs(2)); ++ let status = guard.child.try_wait().unwrap(); ++ assert!(status.is_none()); ++ ++ struct Guard { ++ child: std::process::Child, ++ } ++ ++ impl Drop for Guard { ++ fn drop(&mut self) { ++ let _ = self.child.kill(); ++ } ++ } ++}*/ ++ ++#[cfg(not(feature = "std"))] ++#[test] ++#[should_panic(expected = "reentrant init")] ++fn reentrant_init() { ++ let x: OnceCell> = OnceCell::new(); ++ let dangling_ref: Cell> = Cell::new(None); ++ x.get_or_init(|| { ++ let r = x.get_or_init(|| Box::new(92)); ++ dangling_ref.set(Some(r)); ++ Box::new(62) ++ }); ++ eprintln!("use after free: {:?}", dangling_ref.get().unwrap()); ++} ++ ++#[test] ++fn eval_once_macro() { ++ macro_rules! eval_once { ++ (|| -> $ty:ty { ++ $($body:tt)* ++ }) => {{ ++ static ONCE_CELL: OnceCell<$ty> = OnceCell::new(); ++ fn init() -> $ty { ++ $($body)* ++ } ++ ONCE_CELL.get_or_init(init) ++ }}; ++ } ++ ++ let fib: &'static Vec = eval_once! { ++ || -> Vec { ++ let mut res = vec![1, 1]; ++ for i in 0..10 { ++ let next = res[i] + res[i + 1]; ++ res.push(next); ++ } ++ res ++ } ++ }; ++ assert_eq!(fib[5], 8) ++} ++ ++#[test] ++fn once_cell_does_not_leak_partially_constructed_boxes() { ++ let n_tries = if cfg!(miri) { 10 } else { 100 }; ++ let n_readers = 10; ++ let n_writers = 3; ++ const MSG: &str = "Hello, World"; ++ ++ for _ in 0..n_tries { ++ let cell: OnceCell = OnceCell::new(); ++ scope(|scope| { ++ for _ in 0..n_readers { ++ scope.spawn(|| loop { ++ if let Some(msg) = cell.get() { ++ assert_eq!(msg, MSG); ++ break; ++ } ++ }); ++ } ++ for _ in 0..n_writers { ++ let _ = scope.spawn(|| cell.set(MSG.to_owned())); ++ } ++ }); ++ } ++} ++ ++#[cfg(feature = "std")] ++#[test] ++fn get_does_not_block() { ++ let cell = OnceCell::new(); ++ let barrier = Barrier::new(2); ++ scope(|scope| { ++ scope.spawn(|| { ++ cell.get_or_init(|| { ++ barrier.wait(); ++ barrier.wait(); ++ "hello".to_string() ++ }); ++ }); ++ barrier.wait(); ++ assert_eq!(cell.get(), None); ++ barrier.wait(); ++ }); ++ assert_eq!(cell.get(), Some(&"hello".to_string())); ++} ++ ++#[test] ++// https://github.com/rust-lang/rust/issues/34761#issuecomment-256320669 ++fn arrrrrrrrrrrrrrrrrrrrrr() { ++ let cell = OnceCell::new(); ++ { ++ let s = String::new(); ++ cell.set(&s).unwrap(); ++ } ++} ++ ++#[test] ++fn once_cell_is_sync_send() { ++ fn assert_traits() {} ++ assert_traits::>(); ++ assert_traits::>(); ++} +diff -Nru mesa-25.3.3/subprojects/once_cell-1.20.2/tests/it/unsync_lazy.rs mesa-25.3.3/subprojects/once_cell-1.20.2/tests/it/unsync_lazy.rs +--- mesa-25.3.3/subprojects/once_cell-1.20.2/tests/it/unsync_lazy.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/once_cell-1.20.2/tests/it/unsync_lazy.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,134 @@ ++use core::{ ++ cell::Cell, ++ sync::atomic::{AtomicUsize, Ordering::SeqCst}, ++}; ++ ++use once_cell::unsync::Lazy; ++ ++#[test] ++fn lazy_new() { ++ let called = Cell::new(0); ++ let x = Lazy::new(|| { ++ called.set(called.get() + 1); ++ 92 ++ }); ++ ++ assert_eq!(called.get(), 0); ++ ++ let y = *x - 30; ++ assert_eq!(y, 62); ++ assert_eq!(called.get(), 1); ++ ++ let y = *x - 30; ++ assert_eq!(y, 62); ++ assert_eq!(called.get(), 1); ++} ++ ++#[test] ++fn lazy_deref_mut() { ++ let called = Cell::new(0); ++ let mut x = Lazy::new(|| { ++ called.set(called.get() + 1); ++ 92 ++ }); ++ ++ assert_eq!(called.get(), 0); ++ ++ let y = *x - 30; ++ assert_eq!(y, 62); ++ assert_eq!(called.get(), 1); ++ ++ *x /= 2; ++ assert_eq!(*x, 46); ++ 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); ++ ++ struct Foo(u8); ++ impl Default for Foo { ++ fn default() -> Self { ++ CALLED.fetch_add(1, SeqCst); ++ Foo(42) ++ } ++ } ++ ++ let lazy: Lazy> = <_>::default(); ++ ++ assert_eq!(CALLED.load(SeqCst), 0); ++ ++ assert_eq!(lazy.lock().unwrap().0, 42); ++ assert_eq!(CALLED.load(SeqCst), 1); ++ ++ lazy.lock().unwrap().0 = 21; ++ ++ assert_eq!(lazy.lock().unwrap().0, 21); ++ assert_eq!(CALLED.load(SeqCst), 1); ++} ++ ++#[test] ++fn lazy_into_value() { ++ let l: Lazy = Lazy::new(|| panic!()); ++ assert!(matches!(Lazy::into_value(l), Err(_))); ++ let l = Lazy::new(|| -> i32 { 92 }); ++ Lazy::force(&l); ++ assert!(matches!(Lazy::into_value(l), Ok(92))); ++} ++ ++#[test] ++#[cfg(feature = "std")] ++fn lazy_poisoning() { ++ let x: Lazy = Lazy::new(|| panic!("kaboom")); ++ for _ in 0..2 { ++ let res = std::panic::catch_unwind(|| x.len()); ++ assert!(res.is_err()); ++ } ++} ++ ++#[test] ++// https://github.com/rust-lang/rust/issues/34761#issuecomment-256320669 ++fn arrrrrrrrrrrrrrrrrrrrrr() { ++ let lazy: Lazy<&String, _>; ++ { ++ let s = String::new(); ++ lazy = Lazy::new(|| &s); ++ _ = *lazy; ++ } ++} +diff -Nru mesa-25.3.3/subprojects/once_cell-1.20.2/tests/it/unsync_once_cell.rs mesa-25.3.3/subprojects/once_cell-1.20.2/tests/it/unsync_once_cell.rs +--- mesa-25.3.3/subprojects/once_cell-1.20.2/tests/it/unsync_once_cell.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/once_cell-1.20.2/tests/it/unsync_once_cell.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,154 @@ ++use core::{ ++ cell::Cell, ++ sync::atomic::{AtomicUsize, Ordering::SeqCst}, ++}; ++ ++use once_cell::unsync::OnceCell; ++ ++#[test] ++fn once_cell() { ++ let c = OnceCell::new(); ++ assert!(c.get().is_none()); ++ c.get_or_init(|| 92); ++ assert_eq!(c.get(), Some(&92)); ++ ++ c.get_or_init(|| panic!("Kabom!")); ++ assert_eq!(c.get(), Some(&92)); ++} ++ ++#[test] ++fn once_cell_with_value() { ++ const CELL: OnceCell = OnceCell::with_value(12); ++ let cell = CELL; ++ assert_eq!(cell.get(), Some(&12)); ++} ++ ++#[test] ++fn once_cell_get_mut() { ++ let mut c = OnceCell::new(); ++ assert!(c.get_mut().is_none()); ++ c.set(90).unwrap(); ++ *c.get_mut().unwrap() += 2; ++ assert_eq!(c.get_mut(), Some(&mut 92)); ++} ++ ++#[test] ++fn once_cell_drop() { ++ static DROP_CNT: AtomicUsize = AtomicUsize::new(0); ++ struct Dropper; ++ impl Drop for Dropper { ++ fn drop(&mut self) { ++ DROP_CNT.fetch_add(1, SeqCst); ++ } ++ } ++ ++ let x = OnceCell::new(); ++ x.get_or_init(|| Dropper); ++ assert_eq!(DROP_CNT.load(SeqCst), 0); ++ drop(x); ++ assert_eq!(DROP_CNT.load(SeqCst), 1); ++} ++ ++#[test] ++fn once_cell_drop_empty() { ++ let x = OnceCell::::new(); ++ drop(x); ++} ++ ++#[test] ++fn clone() { ++ let s = OnceCell::new(); ++ let c = s.clone(); ++ assert!(c.get().is_none()); ++ ++ s.set("hello".to_string()).unwrap(); ++ let c = s.clone(); ++ assert_eq!(c.get().map(String::as_str), Some("hello")); ++} ++ ++#[test] ++fn get_or_try_init() { ++ let cell: OnceCell = OnceCell::new(); ++ assert!(cell.get().is_none()); ++ ++ let res = std::panic::catch_unwind(|| cell.get_or_try_init(|| -> Result<_, ()> { panic!() })); ++ assert!(res.is_err()); ++ assert!(cell.get().is_none()); ++ ++ assert_eq!(cell.get_or_try_init(|| Err(())), Err(())); ++ ++ assert_eq!(cell.get_or_try_init(|| Ok::<_, ()>("hello".to_string())), Ok(&"hello".to_string())); ++ assert_eq!(cell.get(), Some(&"hello".to_string())); ++} ++ ++#[test] ++fn from_impl() { ++ assert_eq!(OnceCell::from("value").get(), Some(&"value")); ++ assert_ne!(OnceCell::from("foo").get(), Some(&"bar")); ++} ++ ++#[test] ++fn partialeq_impl() { ++ assert!(OnceCell::from("value") == OnceCell::from("value")); ++ assert!(OnceCell::from("foo") != OnceCell::from("bar")); ++ ++ assert!(OnceCell::::new() == OnceCell::new()); ++ assert!(OnceCell::::new() != OnceCell::from("value".to_owned())); ++} ++ ++#[test] ++fn into_inner() { ++ let cell: OnceCell = OnceCell::new(); ++ assert_eq!(cell.into_inner(), None); ++ let cell = OnceCell::new(); ++ cell.set("hello".to_string()).unwrap(); ++ assert_eq!(cell.into_inner(), Some("hello".to_string())); ++} ++ ++#[test] ++fn debug_impl() { ++ let cell = OnceCell::new(); ++ assert_eq!(format!("{:#?}", cell), "OnceCell(Uninit)"); ++ cell.set(vec!["hello", "world"]).unwrap(); ++ assert_eq!( ++ format!("{:#?}", cell), ++ r#"OnceCell( ++ [ ++ "hello", ++ "world", ++ ], ++)"# ++ ); ++} ++ ++#[test] ++#[should_panic(expected = "reentrant init")] ++fn reentrant_init() { ++ let x: OnceCell> = OnceCell::new(); ++ let dangling_ref: Cell> = Cell::new(None); ++ x.get_or_init(|| { ++ let r = x.get_or_init(|| Box::new(92)); ++ dangling_ref.set(Some(r)); ++ Box::new(62) ++ }); ++ eprintln!("use after free: {:?}", dangling_ref.get().unwrap()); ++} ++ ++#[test] ++fn aliasing_in_get() { ++ let x = OnceCell::new(); ++ x.set(42).unwrap(); ++ let at_x = x.get().unwrap(); // --- (shared) borrow of inner `Option` --+ ++ let _ = x.set(27); // <-- temporary (unique) borrow of inner `Option` | ++ println!("{}", at_x); // <------- up until here ---------------------------+ ++} ++ ++#[test] ++// https://github.com/rust-lang/rust/issues/34761#issuecomment-256320669 ++fn arrrrrrrrrrrrrrrrrrrrrr() { ++ let cell = OnceCell::new(); ++ { ++ let s = String::new(); ++ cell.set(&s).unwrap(); ++ } ++} +diff -Nru mesa-25.3.3/subprojects/once_cell-1-rs.wrap mesa-25.3.3/subprojects/once_cell-1-rs.wrap +--- mesa-25.3.3/subprojects/once_cell-1-rs.wrap 2026-01-01 13:34:04.000000000 -0500 ++++ mesa-25.3.3/subprojects/once_cell-1-rs.wrap 2026-05-29 13:40:54.000000000 -0500 +@@ -1,6 +1,4 @@ + [wrap-file] +-directory = once_cell-1.8.0 +-source_url = https://crates.io/api/v1/crates/once_cell/1.8.0/download +-source_filename = once_cell-1.8.0.tar.gz +-source_hash = 692fcb63b64b1758029e0a96ee63e049ce8c5948587f2f7208df04625e5f6b56 ++directory = once_cell-1.20.2 + patch_directory = once_cell-1-rs ++ +diff -Nru mesa-25.3.3/subprojects/packagefiles/bitflags-2-rs/meson.build mesa-25.3.3/subprojects/packagefiles/bitflags-2-rs/meson.build +--- mesa-25.3.3/subprojects/packagefiles/bitflags-2-rs/meson.build 2026-01-01 13:34:04.000000000 -0500 ++++ mesa-25.3.3/subprojects/packagefiles/bitflags-2-rs/meson.build 2026-05-27 11:35:47.000000000 -0500 +@@ -1,12 +1,7 @@ + # Copyright © 2024 Google + # SPDX-License-Identifier: MIT + +-project( +- 'bitflags', +- 'rust', +- version : '2.9.1', +- license : 'MIT OR Apache-2.0', +-) ++project('bitflags', 'rust', version : '2.8.0', license : 'MIT OR Apache-2.0') + + lib = static_library( + 'bitflags', +diff -Nru mesa-25.3.3/subprojects/packagefiles/errno-0.3-rs/meson.build mesa-25.3.3/subprojects/packagefiles/errno-0.3-rs/meson.build +--- mesa-25.3.3/subprojects/packagefiles/errno-0.3-rs/meson.build 2026-01-01 13:34:04.000000000 -0500 ++++ mesa-25.3.3/subprojects/packagefiles/errno-0.3-rs/meson.build 2026-05-27 11:35:49.000000000 -0500 +@@ -1,12 +1,7 @@ + # Copyright © 2025 Google + # SPDX-License-Identifier: MIT + +-project( +- 'errno', +- 'rust', +- version : '0.3.12', +- license : 'MIT OR Apache-2.0', +-) ++project('errno', 'rust', version : '0.3.8', license : 'MIT OR Apache-2.0') + + libc = subproject('libc-0.2-rs').get_variable('lib') + +diff -Nru mesa-25.3.3/subprojects/packagefiles/hashbrown-0.14-rs/meson.build mesa-25.3.3/subprojects/packagefiles/hashbrown-0.14-rs/meson.build +--- mesa-25.3.3/subprojects/packagefiles/hashbrown-0.14-rs/meson.build 2026-01-01 13:34:04.000000000 -0500 ++++ mesa-25.3.3/subprojects/packagefiles/hashbrown-0.14-rs/meson.build 2026-05-26 15:46:05.000000000 -0500 +@@ -1,9 +1,4 @@ +-project( +- 'hashbrown', +- 'rust', +- version : '0.14.1', +- license : 'MIT OR Apache-2.0', +-) ++project('hashbrown', 'rust', version : '0.14.5', license : 'MIT OR Apache-2.0') + + rust_args = [ + '--cfg', 'feature="raw"' +diff -Nru mesa-25.3.3/subprojects/packagefiles/indexmap-2-rs/meson.build mesa-25.3.3/subprojects/packagefiles/indexmap-2-rs/meson.build +--- mesa-25.3.3/subprojects/packagefiles/indexmap-2-rs/meson.build 2026-01-01 13:34:04.000000000 -0500 ++++ mesa-25.3.3/subprojects/packagefiles/indexmap-2-rs/meson.build 2026-05-26 15:46:06.000000000 -0500 +@@ -1,9 +1,4 @@ +-project( +- 'indexmap', +- 'rust', +- version : '2.2.6', +- license : 'MIT OR Apache-2.0', +-) ++project('indexmap', 'rust', version : '2.7.0', license : 'MIT OR Apache-2.0') + + dep_equivalent = subproject('equivalent-1-rs').get_variable('dep_equivalent') + dep_hashbrown = subproject('hashbrown-0.14-rs').get_variable('dep_hashbrown') +diff -Nru mesa-25.3.3/subprojects/packagefiles/libc-0.2-rs/meson.build mesa-25.3.3/subprojects/packagefiles/libc-0.2-rs/meson.build +--- mesa-25.3.3/subprojects/packagefiles/libc-0.2-rs/meson.build 2026-01-01 13:34:04.000000000 -0500 ++++ mesa-25.3.3/subprojects/packagefiles/libc-0.2-rs/meson.build 2026-05-26 15:46:06.000000000 -0500 +@@ -1,12 +1,7 @@ + # Copyright © 2024 Google + # SPDX-License-Identifier: MIT + +-project( +- 'libc', +- 'rust', +- version : '0.2.168', +- license : 'MIT OR Apache-2.0', +-) ++project('libc', 'rust', version : '0.2.169', license : 'MIT OR Apache-2.0') + + libc_args = [ + '--cfg', 'feature="default"', +diff -Nru mesa-25.3.3/subprojects/packagefiles/log-0.4-rs/meson.build mesa-25.3.3/subprojects/packagefiles/log-0.4-rs/meson.build +--- mesa-25.3.3/subprojects/packagefiles/log-0.4-rs/meson.build 2026-01-01 13:34:04.000000000 -0500 ++++ mesa-25.3.3/subprojects/packagefiles/log-0.4-rs/meson.build 2026-05-26 15:46:07.000000000 -0500 +@@ -1,12 +1,7 @@ + # Copyright © 2024 Google + # SPDX-License-Identifier: MIT + +-project( +- 'log', +- 'rust', +- version : '0.4.27', +- license : 'MIT OR Apache-2.0', +-) ++project('log', 'rust', version : '0.4.26', license : 'MIT OR Apache-2.0') + + lib = static_library( + 'log', +diff -Nru mesa-25.3.3/subprojects/packagefiles/once_cell-1-rs/meson.build mesa-25.3.3/subprojects/packagefiles/once_cell-1-rs/meson.build +--- mesa-25.3.3/subprojects/packagefiles/once_cell-1-rs/meson.build 2026-01-01 13:34:04.000000000 -0500 ++++ mesa-25.3.3/subprojects/packagefiles/once_cell-1-rs/meson.build 2026-05-26 15:46:07.000000000 -0500 +@@ -1,9 +1,4 @@ +-project( +- 'once_cell', +- 'rust', +- version : '1.8.0', +- license : 'MIT OR Apache-2.0', +-) ++project('once_cell', 'rust', version : '1.20.2', license : 'MIT OR Apache-2.0') + + rust_args = [ + '--cfg', 'feature="std"' +diff -Nru mesa-25.3.3/subprojects/packagefiles/paste-1-rs/meson.build mesa-25.3.3/subprojects/packagefiles/paste-1-rs/meson.build +--- mesa-25.3.3/subprojects/packagefiles/paste-1-rs/meson.build 2026-01-01 13:34:04.000000000 -0500 ++++ mesa-25.3.3/subprojects/packagefiles/paste-1-rs/meson.build 2026-05-26 15:46:08.000000000 -0500 +@@ -1,9 +1,4 @@ +-project( +- 'paste', +- 'rust', +- version : '1.0.14', +- license : '(MIT or Apache-2.0)', +-) ++project('paste', 'rust', version : '1.0.15', license : '(MIT or Apache-2.0)') + + rust = import('rust') + +diff -Nru mesa-25.3.3/subprojects/packagefiles/proc-macro2-1-rs/meson.build mesa-25.3.3/subprojects/packagefiles/proc-macro2-1-rs/meson.build +--- mesa-25.3.3/subprojects/packagefiles/proc-macro2-1-rs/meson.build 2026-01-01 13:34:04.000000000 -0500 ++++ mesa-25.3.3/subprojects/packagefiles/proc-macro2-1-rs/meson.build 2026-05-26 15:46:08.000000000 -0500 +@@ -1,9 +1,4 @@ +-project( +- 'proc-macro2', +- 'rust', +- version : '1.0.86', +- license : 'MIT OR Apache-2.0', +-) ++project('proc-macro2', 'rust', version : '1.0.92', license : 'MIT OR Apache-2.0') + + rc = meson.get_compiler('rust') + +diff -Nru mesa-25.3.3/subprojects/packagefiles/quote-1-rs/meson.build mesa-25.3.3/subprojects/packagefiles/quote-1-rs/meson.build +--- mesa-25.3.3/subprojects/packagefiles/quote-1-rs/meson.build 2026-01-01 13:34:04.000000000 -0500 ++++ mesa-25.3.3/subprojects/packagefiles/quote-1-rs/meson.build 2026-05-26 15:46:09.000000000 -0500 +@@ -1,9 +1,4 @@ +-project( +- 'quote', +- 'rust', +- version : '1.0.35', +- license : 'MIT OR Apache-2.0', +-) ++project('quote', 'rust', version : '1.0.40', license : 'MIT OR Apache-2.0') + + rc = meson.get_compiler('rust') + +diff -Nru mesa-25.3.3/subprojects/packagefiles/rustc-hash-2-rs/meson.build mesa-25.3.3/subprojects/packagefiles/rustc-hash-2-rs/meson.build +--- mesa-25.3.3/subprojects/packagefiles/rustc-hash-2-rs/meson.build 2026-01-01 13:34:04.000000000 -0500 ++++ mesa-25.3.3/subprojects/packagefiles/rustc-hash-2-rs/meson.build 2026-05-26 15:46:09.000000000 -0500 +@@ -1,9 +1,4 @@ +-project( +- 'rustc_hash', +- 'rust', +- version : '2.1.1', +- license : 'MIT OR Apache-2.0', +-) ++project('rustc_hash', 'rust', version : '2.0.0', license : 'MIT OR Apache-2.0') + + rust_args = [ + '--cfg', 'feature="std"' +diff -Nru mesa-25.3.3/subprojects/packagefiles/syn-2-rs/meson.build mesa-25.3.3/subprojects/packagefiles/syn-2-rs/meson.build +--- mesa-25.3.3/subprojects/packagefiles/syn-2-rs/meson.build 2026-01-01 13:34:04.000000000 -0500 ++++ mesa-25.3.3/subprojects/packagefiles/syn-2-rs/meson.build 2026-05-26 15:46:09.000000000 -0500 +@@ -1,9 +1,4 @@ +-project( +- 'syn', +- 'rust', +- version : '2.0.87', +- license : 'MIT OR Apache-2.0', +-) ++project('syn', 'rust', version : '2.0.98', license : 'MIT OR Apache-2.0') + + rc = meson.get_compiler('rust') + +diff -Nru mesa-25.3.3/subprojects/packagefiles/unicode-ident-1-rs/meson.build mesa-25.3.3/subprojects/packagefiles/unicode-ident-1-rs/meson.build +--- mesa-25.3.3/subprojects/packagefiles/unicode-ident-1-rs/meson.build 2026-01-01 13:34:04.000000000 -0500 ++++ mesa-25.3.3/subprojects/packagefiles/unicode-ident-1-rs/meson.build 2026-05-26 15:46:10.000000000 -0500 +@@ -1,9 +1,4 @@ +-project( +- 'unicode-ident', +- 'rust', +- version : '1.0.12', +- license : '(MIT or Apache-2.0) AND Unicode-DFS-2016)', +-) ++project('unicode-ident', 'rust', version : '1.0.13', license : '(MIT or Apache-2.0) AND Unicode-DFS-2016)') + + lib = static_library( + 'unicode_ident', +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/build.rs mesa-25.3.3/subprojects/paste-1.0.15/build.rs +--- mesa-25.3.3/subprojects/paste-1.0.15/build.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/build.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,38 @@ ++use std::env; ++use std::process::Command; ++use std::str; ++ ++fn main() { ++ println!("cargo:rerun-if-changed=build.rs"); ++ ++ let version = match rustc_version() { ++ Some(version) => version, ++ None => return, ++ }; ++ ++ if version.minor >= 80 { ++ println!("cargo:rustc-check-cfg=cfg(no_literal_fromstr)"); ++ println!("cargo:rustc-check-cfg=cfg(feature, values(\"protocol_feature_paste\"))"); ++ } ++ ++ if version.minor < 54 { ++ // https://github.com/rust-lang/rust/pull/84717 ++ println!("cargo:rustc-cfg=no_literal_fromstr"); ++ } ++} ++ ++struct RustcVersion { ++ minor: u32, ++} ++ ++fn rustc_version() -> Option { ++ let rustc = env::var_os("RUSTC")?; ++ let output = Command::new(rustc).arg("--version").output().ok()?; ++ let version = str::from_utf8(&output.stdout).ok()?; ++ let mut pieces = version.split('.'); ++ if pieces.next() != Some("rustc 1") { ++ return None; ++ } ++ let minor = pieces.next()?.parse().ok()?; ++ Some(RustcVersion { minor }) ++} +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/.cargo-checksum.json mesa-25.3.3/subprojects/paste-1.0.15/.cargo-checksum.json +--- mesa-25.3.3/subprojects/paste-1.0.15/.cargo-checksum.json 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/.cargo-checksum.json 2024-09-14 20:00:12.000000000 -0500 +@@ -0,0 +1 @@ ++{"package":"Could not get crate checksum","files":{}} +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/Cargo.toml mesa-25.3.3/subprojects/paste-1.0.15/Cargo.toml +--- mesa-25.3.3/subprojects/paste-1.0.15/Cargo.toml 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/Cargo.toml 2024-09-14 20:00:12.000000000 -0500 +@@ -0,0 +1,69 @@ ++# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO ++# ++# When uploading crates to the registry Cargo will automatically ++# "normalize" Cargo.toml files for maximal compatibility ++# with all versions of Cargo and also rewrite `path` dependencies ++# to registry (e.g., crates.io) dependencies. ++# ++# If you are reading this file be aware that the original Cargo.toml ++# will likely look very different (and much more reasonable). ++# See Cargo.toml.orig for the original contents. ++ ++[package] ++edition = "2018" ++rust-version = "1.31" ++name = "paste" ++version = "1.0.15" ++authors = ["David Tolnay "] ++build = "build.rs" ++autobins = false ++autoexamples = false ++autotests = false ++autobenches = false ++description = "Macros for all your token pasting needs" ++documentation = "https://docs.rs/paste" ++readme = "README.md" ++keywords = ["macros"] ++categories = [ ++ "development-tools", ++ "no-std", ++ "no-std::no-alloc", ++] ++license = "MIT OR Apache-2.0" ++repository = "https://github.com/dtolnay/paste" ++ ++[package.metadata.docs.rs] ++rustdoc-args = ["--generate-link-to-definition"] ++targets = ["x86_64-unknown-linux-gnu"] ++ ++[lib] ++name = "paste" ++path = "src/lib.rs" ++proc-macro = true ++ ++[[test]] ++name = "test_item" ++path = "tests/test_item.rs" ++ ++[[test]] ++name = "test_attr" ++path = "tests/test_attr.rs" ++ ++[[test]] ++name = "compiletest" ++path = "tests/compiletest.rs" ++ ++[[test]] ++name = "test_doc" ++path = "tests/test_doc.rs" ++ ++[[test]] ++name = "test_expr" ++path = "tests/test_expr.rs" ++ ++[dev-dependencies.rustversion] ++version = "1.0" ++ ++[dev-dependencies.trybuild] ++version = "1.0.49" ++features = ["diff"] +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/.cargo_vcs_info.json mesa-25.3.3/subprojects/paste-1.0.15/.cargo_vcs_info.json +--- mesa-25.3.3/subprojects/paste-1.0.15/.cargo_vcs_info.json 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/.cargo_vcs_info.json 2024-09-14 20:00:12.000000000 -0500 +@@ -0,0 +1,6 @@ ++{ ++ "git": { ++ "sha1": "a2c7e27875277450ed28147623ba5218dd23e732" ++ }, ++ "path_in_vcs": "" ++} +\ No hay ningún carácter de nueva línea al final del archivo +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/debian/patches/remove-paste-test-suite.patch mesa-25.3.3/subprojects/paste-1.0.15/debian/patches/remove-paste-test-suite.patch +--- mesa-25.3.3/subprojects/paste-1.0.15/debian/patches/remove-paste-test-suite.patch 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/debian/patches/remove-paste-test-suite.patch 2024-09-14 20:00:12.000000000 -0500 +@@ -0,0 +1,39 @@ ++Index: paste/tests/test_attr.rs ++=================================================================== ++--- paste.orig/tests/test_attr.rs +++++ paste/tests/test_attr.rs ++@@ -1,9 +1,9 @@ ++ #![allow(clippy::let_underscore_untyped)] ++ ++ use paste::paste; ++-use paste_test_suite::paste_test; +++//use paste_test_suite::paste_test; ++ ++-#[test] +++/*#[test] ++ fn test_attr() { ++ paste! { ++ #[paste_test(k = "val" "ue")] ++@@ -23,7 +23,7 @@ fn test_attr() { ++ let _ = B; ++ let _ = C; ++ let _ = D; ++-} +++}*/ ++ ++ #[test] ++ fn test_paste_cfg() { ++Index: paste/Cargo.toml ++=================================================================== ++--- paste.orig/Cargo.toml +++++ paste/Cargo.toml ++@@ -61,9 +61,6 @@ path = "tests/test_doc.rs" ++ name = "test_expr" ++ path = "tests/test_expr.rs" ++ ++-[dev-dependencies.paste-test-suite] ++-version = "0" ++- ++ [dev-dependencies.rustversion] ++ version = "1.0" ++ +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/debian/patches/series mesa-25.3.3/subprojects/paste-1.0.15/debian/patches/series +--- mesa-25.3.3/subprojects/paste-1.0.15/debian/patches/series 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/debian/patches/series 2024-09-14 20:00:12.000000000 -0500 +@@ -0,0 +1 @@ ++remove-paste-test-suite.patch +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/.github/FUNDING.yml mesa-25.3.3/subprojects/paste-1.0.15/.github/FUNDING.yml +--- mesa-25.3.3/subprojects/paste-1.0.15/.github/FUNDING.yml 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/.github/FUNDING.yml 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1 @@ ++github: dtolnay +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/.github/workflows/ci.yml mesa-25.3.3/subprojects/paste-1.0.15/.github/workflows/ci.yml +--- mesa-25.3.3/subprojects/paste-1.0.15/.github/workflows/ci.yml 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/.github/workflows/ci.yml 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,97 @@ ++name: CI ++ ++on: ++ push: ++ pull_request: ++ workflow_dispatch: ++ schedule: [cron: "40 1 * * *"] ++ ++permissions: ++ contents: read ++ ++env: ++ RUSTFLAGS: -Dwarnings ++ ++jobs: ++ pre_ci: ++ uses: dtolnay/.github/.github/workflows/pre_ci.yml@master ++ ++ test: ++ name: Rust ${{matrix.rust}} ++ needs: pre_ci ++ if: needs.pre_ci.outputs.continue ++ runs-on: ubuntu-latest ++ strategy: ++ fail-fast: false ++ matrix: ++ rust: [nightly, beta, stable, 1.56.0] ++ timeout-minutes: 45 ++ steps: ++ - uses: actions/checkout@v4 ++ - uses: dtolnay/rust-toolchain@master ++ with: ++ toolchain: ${{matrix.rust}} ++ - name: Enable type layout randomization ++ run: echo RUSTFLAGS=${RUSTFLAGS}\ -Zrandomize-layout >> $GITHUB_ENV ++ if: matrix.rust == 'nightly' ++ - run: cargo test ++ ++ msrv: ++ name: Rust 1.31.0 ++ needs: pre_ci ++ if: needs.pre_ci.outputs.continue ++ runs-on: ubuntu-latest ++ timeout-minutes: 45 ++ steps: ++ - uses: actions/checkout@v4 ++ - uses: dtolnay/rust-toolchain@1.31.0 ++ - run: cargo check ++ ++ doc: ++ name: Documentation ++ needs: pre_ci ++ if: needs.pre_ci.outputs.continue ++ runs-on: ubuntu-latest ++ timeout-minutes: 45 ++ env: ++ RUSTDOCFLAGS: -Dwarnings ++ steps: ++ - uses: actions/checkout@v4 ++ - uses: dtolnay/rust-toolchain@nightly ++ - uses: dtolnay/install@cargo-docs-rs ++ - run: cargo docs-rs ++ ++ clippy: ++ name: Clippy ++ runs-on: ubuntu-latest ++ if: github.event_name != 'pull_request' ++ timeout-minutes: 45 ++ steps: ++ - uses: actions/checkout@v4 ++ - uses: dtolnay/rust-toolchain@clippy ++ - run: cargo clippy --tests -- -Dclippy::all -Dclippy::pedantic ++ ++ miri: ++ name: Miri ++ needs: pre_ci ++ if: needs.pre_ci.outputs.continue ++ runs-on: ubuntu-latest ++ timeout-minutes: 45 ++ steps: ++ - uses: actions/checkout@v4 ++ - uses: dtolnay/rust-toolchain@miri ++ - run: cargo miri setup ++ - run: cargo miri test ++ env: ++ MIRIFLAGS: -Zmiri-strict-provenance ++ ++ outdated: ++ name: Outdated ++ runs-on: ubuntu-latest ++ if: github.event_name != 'pull_request' ++ timeout-minutes: 45 ++ steps: ++ - uses: actions/checkout@v4 ++ - uses: dtolnay/rust-toolchain@stable ++ - uses: dtolnay/install@cargo-outdated ++ - run: cargo outdated --workspace --exit-code 1 +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/.gitignore mesa-25.3.3/subprojects/paste-1.0.15/.gitignore +--- mesa-25.3.3/subprojects/paste-1.0.15/.gitignore 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/.gitignore 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,3 @@ ++/target ++**/*.rs.bk ++Cargo.lock +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/LICENSE-APACHE mesa-25.3.3/subprojects/paste-1.0.15/LICENSE-APACHE +--- mesa-25.3.3/subprojects/paste-1.0.15/LICENSE-APACHE 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/LICENSE-APACHE 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,176 @@ ++ Apache License ++ Version 2.0, January 2004 ++ http://www.apache.org/licenses/ ++ ++TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION ++ ++1. Definitions. ++ ++ "License" shall mean the terms and conditions for use, reproduction, ++ and distribution as defined by Sections 1 through 9 of this document. ++ ++ "Licensor" shall mean the copyright owner or entity authorized by ++ the copyright owner that is granting the License. ++ ++ "Legal Entity" shall mean the union of the acting entity and all ++ other entities that control, are controlled by, or are under common ++ control with that entity. For the purposes of this definition, ++ "control" means (i) the power, direct or indirect, to cause the ++ direction or management of such entity, whether by contract or ++ otherwise, or (ii) ownership of fifty percent (50%) or more of the ++ outstanding shares, or (iii) beneficial ownership of such entity. ++ ++ "You" (or "Your") shall mean an individual or Legal Entity ++ exercising permissions granted by this License. ++ ++ "Source" form shall mean the preferred form for making modifications, ++ including but not limited to software source code, documentation ++ source, and configuration files. ++ ++ "Object" form shall mean any form resulting from mechanical ++ transformation or translation of a Source form, including but ++ not limited to compiled object code, generated documentation, ++ and conversions to other media types. ++ ++ "Work" shall mean the work of authorship, whether in Source or ++ Object form, made available under the License, as indicated by a ++ copyright notice that is included in or attached to the work ++ (an example is provided in the Appendix below). ++ ++ "Derivative Works" shall mean any work, whether in Source or Object ++ form, that is based on (or derived from) the Work and for which the ++ editorial revisions, annotations, elaborations, or other modifications ++ represent, as a whole, an original work of authorship. For the purposes ++ of this License, Derivative Works shall not include works that remain ++ separable from, or merely link (or bind by name) to the interfaces of, ++ the Work and Derivative Works thereof. ++ ++ "Contribution" shall mean any work of authorship, including ++ the original version of the Work and any modifications or additions ++ to that Work or Derivative Works thereof, that is intentionally ++ submitted to Licensor for inclusion in the Work by the copyright owner ++ or by an individual or Legal Entity authorized to submit on behalf of ++ the copyright owner. For the purposes of this definition, "submitted" ++ means any form of electronic, verbal, or written communication sent ++ to the Licensor or its representatives, including but not limited to ++ communication on electronic mailing lists, source code control systems, ++ and issue tracking systems that are managed by, or on behalf of, the ++ Licensor for the purpose of discussing and improving the Work, but ++ excluding communication that is conspicuously marked or otherwise ++ designated in writing by the copyright owner as "Not a Contribution." ++ ++ "Contributor" shall mean Licensor and any individual or Legal Entity ++ on behalf of whom a Contribution has been received by Licensor and ++ subsequently incorporated within the Work. ++ ++2. Grant of Copyright License. Subject to the terms and conditions of ++ this License, each Contributor hereby grants to You a perpetual, ++ worldwide, non-exclusive, no-charge, royalty-free, irrevocable ++ copyright license to reproduce, prepare Derivative Works of, ++ publicly display, publicly perform, sublicense, and distribute the ++ Work and such Derivative Works in Source or Object form. ++ ++3. Grant of Patent License. Subject to the terms and conditions of ++ this License, each Contributor hereby grants to You a perpetual, ++ worldwide, non-exclusive, no-charge, royalty-free, irrevocable ++ (except as stated in this section) patent license to make, have made, ++ use, offer to sell, sell, import, and otherwise transfer the Work, ++ where such license applies only to those patent claims licensable ++ by such Contributor that are necessarily infringed by their ++ Contribution(s) alone or by combination of their Contribution(s) ++ with the Work to which such Contribution(s) was submitted. If You ++ institute patent litigation against any entity (including a ++ cross-claim or counterclaim in a lawsuit) alleging that the Work ++ or a Contribution incorporated within the Work constitutes direct ++ or contributory patent infringement, then any patent licenses ++ granted to You under this License for that Work shall terminate ++ as of the date such litigation is filed. ++ ++4. Redistribution. You may reproduce and distribute copies of the ++ Work or Derivative Works thereof in any medium, with or without ++ modifications, and in Source or Object form, provided that You ++ meet the following conditions: ++ ++ (a) You must give any other recipients of the Work or ++ Derivative Works a copy of this License; and ++ ++ (b) You must cause any modified files to carry prominent notices ++ stating that You changed the files; and ++ ++ (c) You must retain, in the Source form of any Derivative Works ++ that You distribute, all copyright, patent, trademark, and ++ attribution notices from the Source form of the Work, ++ excluding those notices that do not pertain to any part of ++ the Derivative Works; and ++ ++ (d) If the Work includes a "NOTICE" text file as part of its ++ distribution, then any Derivative Works that You distribute must ++ include a readable copy of the attribution notices contained ++ within such NOTICE file, excluding those notices that do not ++ pertain to any part of the Derivative Works, in at least one ++ of the following places: within a NOTICE text file distributed ++ as part of the Derivative Works; within the Source form or ++ documentation, if provided along with the Derivative Works; or, ++ within a display generated by the Derivative Works, if and ++ wherever such third-party notices normally appear. The contents ++ of the NOTICE file are for informational purposes only and ++ do not modify the License. You may add Your own attribution ++ notices within Derivative Works that You distribute, alongside ++ or as an addendum to the NOTICE text from the Work, provided ++ that such additional attribution notices cannot be construed ++ as modifying the License. ++ ++ You may add Your own copyright statement to Your modifications and ++ may provide additional or different license terms and conditions ++ for use, reproduction, or distribution of Your modifications, or ++ for any such Derivative Works as a whole, provided Your use, ++ reproduction, and distribution of the Work otherwise complies with ++ the conditions stated in this License. ++ ++5. Submission of Contributions. Unless You explicitly state otherwise, ++ any Contribution intentionally submitted for inclusion in the Work ++ by You to the Licensor shall be under the terms and conditions of ++ this License, without any additional terms or conditions. ++ Notwithstanding the above, nothing herein shall supersede or modify ++ the terms of any separate license agreement you may have executed ++ with Licensor regarding such Contributions. ++ ++6. Trademarks. This License does not grant permission to use the trade ++ names, trademarks, service marks, or product names of the Licensor, ++ except as required for reasonable and customary use in describing the ++ origin of the Work and reproducing the content of the NOTICE file. ++ ++7. Disclaimer of Warranty. Unless required by applicable law or ++ agreed to in writing, Licensor provides the Work (and each ++ Contributor provides its Contributions) on an "AS IS" BASIS, ++ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or ++ implied, including, without limitation, any warranties or conditions ++ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A ++ PARTICULAR PURPOSE. You are solely responsible for determining the ++ appropriateness of using or redistributing the Work and assume any ++ risks associated with Your exercise of permissions under this License. ++ ++8. Limitation of Liability. In no event and under no legal theory, ++ whether in tort (including negligence), contract, or otherwise, ++ unless required by applicable law (such as deliberate and grossly ++ negligent acts) or agreed to in writing, shall any Contributor be ++ liable to You for damages, including any direct, indirect, special, ++ incidental, or consequential damages of any character arising as a ++ result of this License or out of the use or inability to use the ++ Work (including but not limited to damages for loss of goodwill, ++ work stoppage, computer failure or malfunction, or any and all ++ other commercial damages or losses), even if such Contributor ++ has been advised of the possibility of such damages. ++ ++9. Accepting Warranty or Additional Liability. While redistributing ++ the Work or Derivative Works thereof, You may choose to offer, ++ and charge a fee for, acceptance of support, warranty, indemnity, ++ or other liability obligations and/or rights consistent with this ++ License. However, in accepting such obligations, You may act only ++ on Your own behalf and on Your sole responsibility, not on behalf ++ of any other Contributor, and only if You agree to indemnify, ++ defend, and hold each Contributor harmless for any liability ++ incurred by, or claims asserted against, such Contributor by reason ++ of your accepting any such warranty or additional liability. ++ ++END OF TERMS AND CONDITIONS +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/LICENSE-MIT mesa-25.3.3/subprojects/paste-1.0.15/LICENSE-MIT +--- mesa-25.3.3/subprojects/paste-1.0.15/LICENSE-MIT 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/LICENSE-MIT 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,23 @@ ++Permission is hereby granted, free of charge, to any ++person obtaining a copy of this software and associated ++documentation files (the "Software"), to deal in the ++Software without restriction, including without ++limitation the rights to use, copy, modify, merge, ++publish, distribute, sublicense, and/or sell copies of ++the Software, and to permit persons to whom the Software ++is furnished to do so, subject to the following ++conditions: ++ ++The above copyright notice and this permission notice ++shall be included in all copies or substantial portions ++of the Software. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ++ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED ++TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A ++PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT ++SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ++CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION ++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR ++IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ++DEALINGS IN THE SOFTWARE. +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/meson.build mesa-25.3.3/subprojects/paste-1.0.15/meson.build +--- mesa-25.3.3/subprojects/paste-1.0.15/meson.build 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/meson.build 2026-05-26 15:46:08.000000000 -0500 +@@ -0,0 +1,13 @@ ++project('paste', 'rust', version : '1.0.15', license : '(MIT or Apache-2.0)') ++ ++rust = import('rust') ++ ++lib = rust.proc_macro( ++ 'paste', ++ files('src/lib.rs'), ++ override_options : ['rust_std=2018', 'build.rust_std=2018'] ++) ++ ++dep_paste = declare_dependency( ++ link_with : [lib], ++) +\ No hay ningún carácter de nueva línea al final del archivo +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/.meson-subproject-wrap-hash.txt mesa-25.3.3/subprojects/paste-1.0.15/.meson-subproject-wrap-hash.txt +--- mesa-25.3.3/subprojects/paste-1.0.15/.meson-subproject-wrap-hash.txt 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/.meson-subproject-wrap-hash.txt 2026-05-29 13:40:55.000000000 -0500 +@@ -0,0 +1 @@ ++aba6d321f49a503edee8d2ac3f68349c5f842b252d94bac7669262d5901b86b7 +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/README.md mesa-25.3.3/subprojects/paste-1.0.15/README.md +--- mesa-25.3.3/subprojects/paste-1.0.15/README.md 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/README.md 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,157 @@ ++Macros for all your token pasting needs ++======================================= ++ ++[github](https://github.com/dtolnay/paste) ++[crates.io](https://crates.io/crates/paste) ++[docs.rs](https://docs.rs/paste) ++[build status](https://github.com/dtolnay/paste/actions?query=branch%3Amaster) ++ ++The nightly-only [`concat_idents!`] macro in the Rust standard library is ++notoriously underpowered in that its concatenated identifiers can only refer to ++existing items, they can never be used to define something new. ++ ++[`concat_idents!`]: https://doc.rust-lang.org/std/macro.concat_idents.html ++ ++This crate provides a flexible way to paste together identifiers in a macro, ++including using pasted identifiers to define new items. ++ ++```toml ++[dependencies] ++paste = "1.0" ++``` ++ ++This approach works with any Rust compiler 1.31+. ++ ++
++ ++## Pasting identifiers ++ ++Within the `paste!` macro, identifiers inside `[<`...`>]` are pasted together to ++form a single identifier. ++ ++```rust ++use paste::paste; ++ ++paste! { ++ // Defines a const called `QRST`. ++ const []: &str = "success!"; ++} ++ ++fn main() { ++ assert_eq!( ++ paste! { [].len() }, ++ 8, ++ ); ++} ++``` ++ ++
++ ++## More elaborate example ++ ++The next example shows a macro that generates accessor methods for some struct ++fields. It demonstrates how you might find it useful to bundle a paste ++invocation inside of a macro\_rules macro. ++ ++```rust ++use paste::paste; ++ ++macro_rules! make_a_struct_and_getters { ++ ($name:ident { $($field:ident),* }) => { ++ // Define a struct. This expands to: ++ // ++ // pub struct S { ++ // a: String, ++ // b: String, ++ // c: String, ++ // } ++ pub struct $name { ++ $( ++ $field: String, ++ )* ++ } ++ ++ // Build an impl block with getters. This expands to: ++ // ++ // impl S { ++ // pub fn get_a(&self) -> &str { &self.a } ++ // pub fn get_b(&self) -> &str { &self.b } ++ // pub fn get_c(&self) -> &str { &self.c } ++ // } ++ paste! { ++ impl $name { ++ $( ++ pub fn [](&self) -> &str { ++ &self.$field ++ } ++ )* ++ } ++ } ++ } ++} ++ ++make_a_struct_and_getters!(S { a, b, c }); ++ ++fn call_some_getters(s: &S) -> bool { ++ s.get_a() == s.get_b() && s.get_c().is_empty() ++} ++``` ++ ++
++ ++## Case conversion ++ ++Use `$var:lower` or `$var:upper` in the segment list to convert an interpolated ++segment to lower- or uppercase as part of the paste. For example, `[]` would paste to `ld_bc_expr` if invoked with $reg=`Bc`. ++ ++Use `$var:snake` to convert CamelCase input to snake\_case. ++Use `$var:camel` to convert snake\_case to CamelCase. ++These compose, so for example `$var:snake:upper` would give you SCREAMING\_CASE. ++ ++The precise Unicode conversions are as defined by [`str::to_lowercase`] and ++[`str::to_uppercase`]. ++ ++[`str::to_lowercase`]: https://doc.rust-lang.org/std/primitive.str.html#method.to_lowercase ++[`str::to_uppercase`]: https://doc.rust-lang.org/std/primitive.str.html#method.to_uppercase ++ ++
++ ++## Pasting documentation strings ++ ++Within the `paste!` macro, arguments to a #\[doc ...\] attribute are implicitly ++concatenated together to form a coherent documentation string. ++ ++```rust ++use paste::paste; ++ ++macro_rules! method_new { ++ ($ret:ident) => { ++ paste! { ++ #[doc = "Create a new `" $ret "` object."] ++ pub fn new() -> $ret { todo!() } ++ } ++ }; ++} ++ ++pub struct Paste {} ++ ++method_new!(Paste); // expands to #[doc = "Create a new `Paste` object"] ++``` ++ ++
++ ++#### License ++ ++ ++Licensed under either of
Apache License, Version ++2.0 or MIT license at your option. ++ ++ ++
++ ++ ++Unless you explicitly state otherwise, any contribution intentionally submitted ++for inclusion in this crate by you, as defined in the Apache-2.0 license, shall ++be dual licensed as above, without any additional terms or conditions. ++ +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/src/attr.rs mesa-25.3.3/subprojects/paste-1.0.15/src/attr.rs +--- mesa-25.3.3/subprojects/paste-1.0.15/src/attr.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/src/attr.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,164 @@ ++use crate::error::Result; ++use crate::segment::{self, Segment}; ++use proc_macro::{Delimiter, Group, Spacing, Span, TokenStream, TokenTree}; ++use std::iter; ++use std::mem; ++use std::str::FromStr; ++ ++pub fn expand_attr( ++ attr: TokenStream, ++ span: Span, ++ contains_paste: &mut bool, ++) -> Result { ++ let mut tokens = attr.clone().into_iter(); ++ let mut leading_colons = 0; // $(::)? ++ let mut leading_path = 0; // $($ident)::+ ++ ++ let mut token; ++ let group = loop { ++ token = tokens.next(); ++ match token { ++ // colon after `$(:)?` ++ Some(TokenTree::Punct(ref punct)) ++ if punct.as_char() == ':' && leading_colons < 2 && leading_path == 0 => ++ { ++ leading_colons += 1; ++ } ++ // ident after `$(::)? $($ident ::)*` ++ Some(TokenTree::Ident(_)) if leading_colons != 1 && leading_path % 3 == 0 => { ++ leading_path += 1; ++ } ++ // colon after `$(::)? $($ident ::)* $ident $(:)?` ++ Some(TokenTree::Punct(ref punct)) if punct.as_char() == ':' && leading_path % 3 > 0 => { ++ leading_path += 1; ++ } ++ // eq+value after `$(::)? $($ident)::+` ++ Some(TokenTree::Punct(ref punct)) ++ if punct.as_char() == '=' && leading_path % 3 == 1 => ++ { ++ let mut count = 0; ++ if tokens.inspect(|_| count += 1).all(|tt| is_stringlike(&tt)) && count > 1 { ++ *contains_paste = true; ++ let leading = leading_colons + leading_path; ++ return do_paste_name_value_attr(attr, span, leading); ++ } ++ return Ok(attr); ++ } ++ // parens after `$(::)? $($ident)::+` ++ Some(TokenTree::Group(ref group)) ++ if group.delimiter() == Delimiter::Parenthesis && leading_path % 3 == 1 => ++ { ++ break group; ++ } ++ // bail out ++ _ => return Ok(attr), ++ } ++ }; ++ ++ // There can't be anything else after the first group in a valid attribute. ++ if tokens.next().is_some() { ++ return Ok(attr); ++ } ++ ++ let mut group_contains_paste = false; ++ let mut expanded = TokenStream::new(); ++ let mut nested_attr = TokenStream::new(); ++ for tt in group.stream() { ++ match &tt { ++ TokenTree::Punct(punct) if punct.as_char() == ',' => { ++ expanded.extend(expand_attr( ++ nested_attr, ++ group.span(), ++ &mut group_contains_paste, ++ )?); ++ expanded.extend(iter::once(tt)); ++ nested_attr = TokenStream::new(); ++ } ++ _ => nested_attr.extend(iter::once(tt)), ++ } ++ } ++ ++ if !nested_attr.is_empty() { ++ expanded.extend(expand_attr( ++ nested_attr, ++ group.span(), ++ &mut group_contains_paste, ++ )?); ++ } ++ ++ if group_contains_paste { ++ *contains_paste = true; ++ let mut group = Group::new(Delimiter::Parenthesis, expanded); ++ group.set_span(span); ++ Ok(attr ++ .into_iter() ++ // Just keep the initial ident in `#[ident(...)]`. ++ .take(leading_colons + leading_path) ++ .chain(iter::once(TokenTree::Group(group))) ++ .collect()) ++ } else { ++ Ok(attr) ++ } ++} ++ ++fn do_paste_name_value_attr(attr: TokenStream, span: Span, leading: usize) -> Result { ++ let mut expanded = TokenStream::new(); ++ let mut tokens = attr.into_iter().peekable(); ++ expanded.extend(tokens.by_ref().take(leading + 1)); // `doc =` ++ ++ let mut segments = segment::parse(&mut tokens)?; ++ ++ for segment in &mut segments { ++ if let Segment::String(string) = segment { ++ if let Some(open_quote) = string.value.find('"') { ++ if open_quote == 0 { ++ string.value.truncate(string.value.len() - 1); ++ string.value.remove(0); ++ } else { ++ let begin = open_quote + 1; ++ let end = string.value.rfind('"').unwrap(); ++ let raw_string = mem::replace(&mut string.value, String::new()); ++ for ch in raw_string[begin..end].chars() { ++ string.value.extend(ch.escape_default()); ++ } ++ } ++ } ++ } ++ } ++ ++ let mut lit = segment::paste(&segments)?; ++ lit.insert(0, '"'); ++ lit.push('"'); ++ ++ let mut lit = TokenStream::from_str(&lit) ++ .unwrap() ++ .into_iter() ++ .next() ++ .unwrap(); ++ lit.set_span(span); ++ expanded.extend(iter::once(lit)); ++ Ok(expanded) ++} ++ ++fn is_stringlike(token: &TokenTree) -> bool { ++ match token { ++ TokenTree::Ident(_) => true, ++ TokenTree::Literal(literal) => { ++ let repr = literal.to_string(); ++ !repr.starts_with('b') && !repr.starts_with('\'') ++ } ++ TokenTree::Group(group) => { ++ if group.delimiter() != Delimiter::None { ++ return false; ++ } ++ let mut inner = group.stream().into_iter(); ++ match inner.next() { ++ Some(first) => inner.next().is_none() && is_stringlike(&first), ++ None => false, ++ } ++ } ++ TokenTree::Punct(punct) => { ++ punct.as_char() == '\'' || punct.as_char() == ':' && punct.spacing() == Spacing::Alone ++ } ++ } ++} +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/src/error.rs mesa-25.3.3/subprojects/paste-1.0.15/src/error.rs +--- mesa-25.3.3/subprojects/paste-1.0.15/src/error.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/src/error.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,47 @@ ++use proc_macro::{Delimiter, Group, Ident, Literal, Punct, Spacing, Span, TokenStream, TokenTree}; ++use std::iter::FromIterator; ++ ++pub type Result = std::result::Result; ++ ++pub struct Error { ++ begin: Span, ++ end: Span, ++ msg: String, ++} ++ ++impl Error { ++ pub fn new(span: Span, msg: &str) -> Self { ++ Self::new2(span, span, msg) ++ } ++ ++ pub fn new2(begin: Span, end: Span, msg: &str) -> Self { ++ Error { ++ begin, ++ end, ++ msg: msg.to_owned(), ++ } ++ } ++ ++ pub fn to_compile_error(&self) -> TokenStream { ++ // compile_error! { $msg } ++ TokenStream::from_iter(vec![ ++ TokenTree::Ident(Ident::new("compile_error", self.begin)), ++ TokenTree::Punct({ ++ let mut punct = Punct::new('!', Spacing::Alone); ++ punct.set_span(self.begin); ++ punct ++ }), ++ TokenTree::Group({ ++ let mut group = Group::new(Delimiter::Brace, { ++ TokenStream::from_iter(vec![TokenTree::Literal({ ++ let mut string = Literal::string(&self.msg); ++ string.set_span(self.end); ++ string ++ })]) ++ }); ++ group.set_span(self.end); ++ group ++ }), ++ ]) ++ } ++} +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/src/lib.rs mesa-25.3.3/subprojects/paste-1.0.15/src/lib.rs +--- mesa-25.3.3/subprojects/paste-1.0.15/src/lib.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/src/lib.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,454 @@ ++//! [![github]](https://github.com/dtolnay/paste) [![crates-io]](https://crates.io/crates/paste) [![docs-rs]](https://docs.rs/paste) ++//! ++//! [github]: https://img.shields.io/badge/github-8da0cb?style=for-the-badge&labelColor=555555&logo=github ++//! [crates-io]: https://img.shields.io/badge/crates.io-fc8d62?style=for-the-badge&labelColor=555555&logo=rust ++//! [docs-rs]: https://img.shields.io/badge/docs.rs-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs ++//! ++//!
++//! ++//! The nightly-only [`concat_idents!`] macro in the Rust standard library is ++//! notoriously underpowered in that its concatenated identifiers can only refer to ++//! existing items, they can never be used to define something new. ++//! ++//! [`concat_idents!`]: https://doc.rust-lang.org/std/macro.concat_idents.html ++//! ++//! This crate provides a flexible way to paste together identifiers in a macro, ++//! including using pasted identifiers to define new items. ++//! ++//! This approach works with any Rust compiler 1.31+. ++//! ++//!
++//! ++//! # Pasting identifiers ++//! ++//! Within the `paste!` macro, identifiers inside `[<`...`>]` are pasted ++//! together to form a single identifier. ++//! ++//! ``` ++//! use paste::paste; ++//! ++//! paste! { ++//! // Defines a const called `QRST`. ++//! const []: &str = "success!"; ++//! } ++//! ++//! fn main() { ++//! assert_eq!( ++//! paste! { [].len() }, ++//! 8, ++//! ); ++//! } ++//! ``` ++//! ++//!

++//! ++//! # More elaborate example ++//! ++//! The next example shows a macro that generates accessor methods for some ++//! struct fields. It demonstrates how you might find it useful to bundle a ++//! paste invocation inside of a macro\_rules macro. ++//! ++//! ``` ++//! use paste::paste; ++//! ++//! macro_rules! make_a_struct_and_getters { ++//! ($name:ident { $($field:ident),* }) => { ++//! // Define a struct. This expands to: ++//! // ++//! // pub struct S { ++//! // a: String, ++//! // b: String, ++//! // c: String, ++//! // } ++//! pub struct $name { ++//! $( ++//! $field: String, ++//! )* ++//! } ++//! ++//! // Build an impl block with getters. This expands to: ++//! // ++//! // impl S { ++//! // pub fn get_a(&self) -> &str { &self.a } ++//! // pub fn get_b(&self) -> &str { &self.b } ++//! // pub fn get_c(&self) -> &str { &self.c } ++//! // } ++//! paste! { ++//! impl $name { ++//! $( ++//! pub fn [](&self) -> &str { ++//! &self.$field ++//! } ++//! )* ++//! } ++//! } ++//! } ++//! } ++//! ++//! make_a_struct_and_getters!(S { a, b, c }); ++//! ++//! fn call_some_getters(s: &S) -> bool { ++//! s.get_a() == s.get_b() && s.get_c().is_empty() ++//! } ++//! # ++//! # fn main() {} ++//! ``` ++//! ++//!

++//! ++//! # Case conversion ++//! ++//! Use `$var:lower` or `$var:upper` in the segment list to convert an ++//! interpolated segment to lower- or uppercase as part of the paste. For ++//! example, `[]` would paste to `ld_bc_expr` if invoked ++//! with $reg=`Bc`. ++//! ++//! Use `$var:snake` to convert CamelCase input to snake\_case. ++//! Use `$var:camel` to convert snake\_case to CamelCase. ++//! These compose, so for example `$var:snake:upper` would give you SCREAMING\_CASE. ++//! ++//! The precise Unicode conversions are as defined by [`str::to_lowercase`] and ++//! [`str::to_uppercase`]. ++//! ++//! [`str::to_lowercase`]: https://doc.rust-lang.org/std/primitive.str.html#method.to_lowercase ++//! [`str::to_uppercase`]: https://doc.rust-lang.org/std/primitive.str.html#method.to_uppercase ++//! ++//!
++//! ++//! # Pasting documentation strings ++//! ++//! Within the `paste!` macro, arguments to a #\[doc ...\] attribute are ++//! implicitly concatenated together to form a coherent documentation string. ++//! ++//! ``` ++//! use paste::paste; ++//! ++//! macro_rules! method_new { ++//! ($ret:ident) => { ++//! paste! { ++//! #[doc = "Create a new `" $ret "` object."] ++//! pub fn new() -> $ret { todo!() } ++//! } ++//! }; ++//! } ++//! ++//! pub struct Paste {} ++//! ++//! method_new!(Paste); // expands to #[doc = "Create a new `Paste` object"] ++//! ``` ++ ++#![doc(html_root_url = "https://docs.rs/paste/1.0.15")] ++#![allow( ++ clippy::derive_partial_eq_without_eq, ++ clippy::doc_markdown, ++ clippy::match_same_arms, ++ clippy::module_name_repetitions, ++ clippy::needless_doctest_main, ++ clippy::too_many_lines ++)] ++ ++extern crate proc_macro; ++ ++mod attr; ++mod error; ++mod segment; ++ ++use crate::attr::expand_attr; ++use crate::error::{Error, Result}; ++use crate::segment::Segment; ++use proc_macro::{Delimiter, Group, Ident, Punct, Spacing, Span, TokenStream, TokenTree}; ++use std::char; ++use std::iter; ++use std::panic; ++ ++#[proc_macro] ++pub fn paste(input: TokenStream) -> TokenStream { ++ let mut contains_paste = false; ++ let flatten_single_interpolation = true; ++ match expand( ++ input.clone(), ++ &mut contains_paste, ++ flatten_single_interpolation, ++ ) { ++ Ok(expanded) => { ++ if contains_paste { ++ expanded ++ } else { ++ input ++ } ++ } ++ Err(err) => err.to_compile_error(), ++ } ++} ++ ++#[doc(hidden)] ++#[proc_macro] ++pub fn item(input: TokenStream) -> TokenStream { ++ paste(input) ++} ++ ++#[doc(hidden)] ++#[proc_macro] ++pub fn expr(input: TokenStream) -> TokenStream { ++ paste(input) ++} ++ ++fn expand( ++ input: TokenStream, ++ contains_paste: &mut bool, ++ flatten_single_interpolation: bool, ++) -> Result { ++ let mut expanded = TokenStream::new(); ++ let mut lookbehind = Lookbehind::Other; ++ let mut prev_none_group = None::; ++ let mut tokens = input.into_iter().peekable(); ++ loop { ++ let token = tokens.next(); ++ if let Some(group) = prev_none_group.take() { ++ if match (&token, tokens.peek()) { ++ (Some(TokenTree::Punct(fst)), Some(TokenTree::Punct(snd))) => { ++ fst.as_char() == ':' && snd.as_char() == ':' && fst.spacing() == Spacing::Joint ++ } ++ _ => false, ++ } { ++ expanded.extend(group.stream()); ++ *contains_paste = true; ++ } else { ++ expanded.extend(iter::once(TokenTree::Group(group))); ++ } ++ } ++ match token { ++ Some(TokenTree::Group(group)) => { ++ let delimiter = group.delimiter(); ++ let content = group.stream(); ++ let span = group.span(); ++ if delimiter == Delimiter::Bracket && is_paste_operation(&content) { ++ let segments = parse_bracket_as_segments(content, span)?; ++ let pasted = segment::paste(&segments)?; ++ let tokens = pasted_to_tokens(pasted, span)?; ++ expanded.extend(tokens); ++ *contains_paste = true; ++ } else if flatten_single_interpolation ++ && delimiter == Delimiter::None ++ && is_single_interpolation_group(&content) ++ { ++ expanded.extend(content); ++ *contains_paste = true; ++ } else { ++ let mut group_contains_paste = false; ++ let is_attribute = delimiter == Delimiter::Bracket ++ && (lookbehind == Lookbehind::Pound || lookbehind == Lookbehind::PoundBang); ++ let mut nested = expand( ++ content, ++ &mut group_contains_paste, ++ flatten_single_interpolation && !is_attribute, ++ )?; ++ if is_attribute { ++ nested = expand_attr(nested, span, &mut group_contains_paste)?; ++ } ++ let group = if group_contains_paste { ++ let mut group = Group::new(delimiter, nested); ++ group.set_span(span); ++ *contains_paste = true; ++ group ++ } else { ++ group.clone() ++ }; ++ if delimiter != Delimiter::None { ++ expanded.extend(iter::once(TokenTree::Group(group))); ++ } else if lookbehind == Lookbehind::DoubleColon { ++ expanded.extend(group.stream()); ++ *contains_paste = true; ++ } else { ++ prev_none_group = Some(group); ++ } ++ } ++ lookbehind = Lookbehind::Other; ++ } ++ Some(TokenTree::Punct(punct)) => { ++ lookbehind = match punct.as_char() { ++ ':' if lookbehind == Lookbehind::JointColon => Lookbehind::DoubleColon, ++ ':' if punct.spacing() == Spacing::Joint => Lookbehind::JointColon, ++ '#' => Lookbehind::Pound, ++ '!' if lookbehind == Lookbehind::Pound => Lookbehind::PoundBang, ++ _ => Lookbehind::Other, ++ }; ++ expanded.extend(iter::once(TokenTree::Punct(punct))); ++ } ++ Some(other) => { ++ lookbehind = Lookbehind::Other; ++ expanded.extend(iter::once(other)); ++ } ++ None => return Ok(expanded), ++ } ++ } ++} ++ ++#[derive(PartialEq)] ++enum Lookbehind { ++ JointColon, ++ DoubleColon, ++ Pound, ++ PoundBang, ++ Other, ++} ++ ++// https://github.com/dtolnay/paste/issues/26 ++fn is_single_interpolation_group(input: &TokenStream) -> bool { ++ #[derive(PartialEq)] ++ enum State { ++ Init, ++ Ident, ++ Literal, ++ Apostrophe, ++ Lifetime, ++ Colon1, ++ Colon2, ++ } ++ ++ let mut state = State::Init; ++ for tt in input.clone() { ++ state = match (state, &tt) { ++ (State::Init, TokenTree::Ident(_)) => State::Ident, ++ (State::Init, TokenTree::Literal(_)) => State::Literal, ++ (State::Init, TokenTree::Punct(punct)) if punct.as_char() == '\'' => State::Apostrophe, ++ (State::Apostrophe, TokenTree::Ident(_)) => State::Lifetime, ++ (State::Ident, TokenTree::Punct(punct)) ++ if punct.as_char() == ':' && punct.spacing() == Spacing::Joint => ++ { ++ State::Colon1 ++ } ++ (State::Colon1, TokenTree::Punct(punct)) ++ if punct.as_char() == ':' && punct.spacing() == Spacing::Alone => ++ { ++ State::Colon2 ++ } ++ (State::Colon2, TokenTree::Ident(_)) => State::Ident, ++ _ => return false, ++ }; ++ } ++ ++ state == State::Ident || state == State::Literal || state == State::Lifetime ++} ++ ++fn is_paste_operation(input: &TokenStream) -> bool { ++ let mut tokens = input.clone().into_iter(); ++ ++ match &tokens.next() { ++ Some(TokenTree::Punct(punct)) if punct.as_char() == '<' => {} ++ _ => return false, ++ } ++ ++ let mut has_token = false; ++ loop { ++ match &tokens.next() { ++ Some(TokenTree::Punct(punct)) if punct.as_char() == '>' => { ++ return has_token && tokens.next().is_none(); ++ } ++ Some(_) => has_token = true, ++ None => return false, ++ } ++ } ++} ++ ++fn parse_bracket_as_segments(input: TokenStream, scope: Span) -> Result> { ++ let mut tokens = input.into_iter().peekable(); ++ ++ match &tokens.next() { ++ Some(TokenTree::Punct(punct)) if punct.as_char() == '<' => {} ++ Some(wrong) => return Err(Error::new(wrong.span(), "expected `<`")), ++ None => return Err(Error::new(scope, "expected `[< ... >]`")), ++ } ++ ++ let mut segments = segment::parse(&mut tokens)?; ++ ++ match &tokens.next() { ++ Some(TokenTree::Punct(punct)) if punct.as_char() == '>' => {} ++ Some(wrong) => return Err(Error::new(wrong.span(), "expected `>`")), ++ None => return Err(Error::new(scope, "expected `[< ... >]`")), ++ } ++ ++ if let Some(unexpected) = tokens.next() { ++ return Err(Error::new( ++ unexpected.span(), ++ "unexpected input, expected `[< ... >]`", ++ )); ++ } ++ ++ for segment in &mut segments { ++ if let Segment::String(string) = segment { ++ if string.value.starts_with("'\\u{") { ++ let hex = &string.value[4..string.value.len() - 2]; ++ if let Ok(unsigned) = u32::from_str_radix(hex, 16) { ++ if let Some(ch) = char::from_u32(unsigned) { ++ string.value.clear(); ++ string.value.push(ch); ++ continue; ++ } ++ } ++ } ++ if string.value.contains(&['#', '\\', '.', '+'][..]) ++ || string.value.starts_with("b'") ++ || string.value.starts_with("b\"") ++ || string.value.starts_with("br\"") ++ { ++ return Err(Error::new(string.span, "unsupported literal")); ++ } ++ let mut range = 0..string.value.len(); ++ if string.value.starts_with("r\"") { ++ range.start += 2; ++ range.end -= 1; ++ } else if string.value.starts_with(&['"', '\''][..]) { ++ range.start += 1; ++ range.end -= 1; ++ } ++ string.value = string.value[range].replace('-', "_"); ++ } ++ } ++ ++ Ok(segments) ++} ++ ++fn pasted_to_tokens(mut pasted: String, span: Span) -> Result { ++ let mut tokens = TokenStream::new(); ++ ++ #[cfg(not(no_literal_fromstr))] ++ { ++ use proc_macro::{LexError, Literal}; ++ use std::str::FromStr; ++ ++ if pasted.starts_with(|ch: char| ch.is_ascii_digit()) { ++ let literal = match panic::catch_unwind(|| Literal::from_str(&pasted)) { ++ Ok(Ok(literal)) => TokenTree::Literal(literal), ++ Ok(Err(LexError { .. })) | Err(_) => { ++ return Err(Error::new( ++ span, ++ &format!("`{:?}` is not a valid literal", pasted), ++ )); ++ } ++ }; ++ tokens.extend(iter::once(literal)); ++ return Ok(tokens); ++ } ++ } ++ ++ if pasted.starts_with('\'') { ++ let mut apostrophe = TokenTree::Punct(Punct::new('\'', Spacing::Joint)); ++ apostrophe.set_span(span); ++ tokens.extend(iter::once(apostrophe)); ++ pasted.remove(0); ++ } ++ ++ let ident = match panic::catch_unwind(|| Ident::new(&pasted, span)) { ++ Ok(ident) => TokenTree::Ident(ident), ++ Err(_) => { ++ return Err(Error::new( ++ span, ++ &format!("`{:?}` is not a valid identifier", pasted), ++ )); ++ } ++ }; ++ ++ tokens.extend(iter::once(ident)); ++ Ok(tokens) ++} +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/src/segment.rs mesa-25.3.3/subprojects/paste-1.0.15/src/segment.rs +--- mesa-25.3.3/subprojects/paste-1.0.15/src/segment.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/src/segment.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,233 @@ ++use crate::error::{Error, Result}; ++use proc_macro::{token_stream, Delimiter, Ident, Span, TokenTree}; ++use std::iter::Peekable; ++ ++pub(crate) enum Segment { ++ String(LitStr), ++ Apostrophe(Span), ++ Env(LitStr), ++ Modifier(Colon, Ident), ++} ++ ++pub(crate) struct LitStr { ++ pub value: String, ++ pub span: Span, ++} ++ ++pub(crate) struct Colon { ++ pub span: Span, ++} ++ ++pub(crate) fn parse(tokens: &mut Peekable) -> Result> { ++ let mut segments = Vec::new(); ++ while match tokens.peek() { ++ None => false, ++ Some(TokenTree::Punct(punct)) => punct.as_char() != '>', ++ Some(_) => true, ++ } { ++ match tokens.next().unwrap() { ++ TokenTree::Ident(ident) => { ++ let mut fragment = ident.to_string(); ++ if fragment.starts_with("r#") { ++ fragment = fragment.split_off(2); ++ } ++ if fragment == "env" ++ && match tokens.peek() { ++ Some(TokenTree::Punct(punct)) => punct.as_char() == '!', ++ _ => false, ++ } ++ { ++ let bang = tokens.next().unwrap(); // `!` ++ let expect_group = tokens.next(); ++ let parenthesized = match &expect_group { ++ Some(TokenTree::Group(group)) ++ if group.delimiter() == Delimiter::Parenthesis => ++ { ++ group ++ } ++ Some(wrong) => return Err(Error::new(wrong.span(), "expected `(`")), ++ None => { ++ return Err(Error::new2( ++ ident.span(), ++ bang.span(), ++ "expected `(` after `env!`", ++ )); ++ } ++ }; ++ let mut inner = parenthesized.stream().into_iter(); ++ let lit = match inner.next() { ++ Some(TokenTree::Literal(lit)) => lit, ++ Some(wrong) => { ++ return Err(Error::new(wrong.span(), "expected string literal")) ++ } ++ None => { ++ return Err(Error::new2( ++ ident.span(), ++ parenthesized.span(), ++ "expected string literal as argument to env! macro", ++ )) ++ } ++ }; ++ let lit_string = lit.to_string(); ++ if lit_string.starts_with('"') ++ && lit_string.ends_with('"') ++ && lit_string.len() >= 2 ++ { ++ // TODO: maybe handle escape sequences in the string if ++ // someone has a use case. ++ segments.push(Segment::Env(LitStr { ++ value: lit_string[1..lit_string.len() - 1].to_owned(), ++ span: lit.span(), ++ })); ++ } else { ++ return Err(Error::new(lit.span(), "expected string literal")); ++ } ++ if let Some(unexpected) = inner.next() { ++ return Err(Error::new( ++ unexpected.span(), ++ "unexpected token in env! macro", ++ )); ++ } ++ } else { ++ segments.push(Segment::String(LitStr { ++ value: fragment, ++ span: ident.span(), ++ })); ++ } ++ } ++ TokenTree::Literal(lit) => { ++ segments.push(Segment::String(LitStr { ++ value: lit.to_string(), ++ span: lit.span(), ++ })); ++ } ++ TokenTree::Punct(punct) => match punct.as_char() { ++ '_' => segments.push(Segment::String(LitStr { ++ value: "_".to_owned(), ++ span: punct.span(), ++ })), ++ '\'' => segments.push(Segment::Apostrophe(punct.span())), ++ ':' => { ++ let colon_span = punct.span(); ++ let colon = Colon { span: colon_span }; ++ let ident = match tokens.next() { ++ Some(TokenTree::Ident(ident)) => ident, ++ wrong => { ++ let span = wrong.as_ref().map_or(colon_span, TokenTree::span); ++ return Err(Error::new(span, "expected identifier after `:`")); ++ } ++ }; ++ segments.push(Segment::Modifier(colon, ident)); ++ } ++ _ => return Err(Error::new(punct.span(), "unexpected punct")), ++ }, ++ TokenTree::Group(group) => { ++ if group.delimiter() == Delimiter::None { ++ let mut inner = group.stream().into_iter().peekable(); ++ let nested = parse(&mut inner)?; ++ if let Some(unexpected) = inner.next() { ++ return Err(Error::new(unexpected.span(), "unexpected token")); ++ } ++ segments.extend(nested); ++ } else { ++ return Err(Error::new(group.span(), "unexpected token")); ++ } ++ } ++ } ++ } ++ Ok(segments) ++} ++ ++pub(crate) fn paste(segments: &[Segment]) -> Result { ++ let mut evaluated = Vec::new(); ++ let mut is_lifetime = false; ++ ++ for segment in segments { ++ match segment { ++ Segment::String(segment) => { ++ evaluated.push(segment.value.clone()); ++ } ++ Segment::Apostrophe(span) => { ++ if is_lifetime { ++ return Err(Error::new(*span, "unexpected lifetime")); ++ } ++ is_lifetime = true; ++ } ++ Segment::Env(var) => { ++ let resolved = match std::env::var(&var.value) { ++ Ok(resolved) => resolved, ++ Err(_) => { ++ return Err(Error::new( ++ var.span, ++ &format!("no such env var: {:?}", var.value), ++ )); ++ } ++ }; ++ let resolved = resolved.replace('-', "_"); ++ evaluated.push(resolved); ++ } ++ Segment::Modifier(colon, ident) => { ++ let last = match evaluated.pop() { ++ Some(last) => last, ++ None => { ++ return Err(Error::new2(colon.span, ident.span(), "unexpected modifier")) ++ } ++ }; ++ match ident.to_string().as_str() { ++ "lower" => { ++ evaluated.push(last.to_lowercase()); ++ } ++ "upper" => { ++ evaluated.push(last.to_uppercase()); ++ } ++ "snake" => { ++ let mut acc = String::new(); ++ let mut prev = '_'; ++ for ch in last.chars() { ++ if ch.is_uppercase() && prev != '_' { ++ acc.push('_'); ++ } ++ acc.push(ch); ++ prev = ch; ++ } ++ evaluated.push(acc.to_lowercase()); ++ } ++ "camel" => { ++ let mut acc = String::new(); ++ let mut prev = '_'; ++ for ch in last.chars() { ++ if ch != '_' { ++ if prev == '_' { ++ for chu in ch.to_uppercase() { ++ acc.push(chu); ++ } ++ } else if prev.is_uppercase() { ++ for chl in ch.to_lowercase() { ++ acc.push(chl); ++ } ++ } else { ++ acc.push(ch); ++ } ++ } ++ prev = ch; ++ } ++ evaluated.push(acc); ++ } ++ _ => { ++ return Err(Error::new2( ++ colon.span, ++ ident.span(), ++ "unsupported modifier", ++ )); ++ } ++ } ++ } ++ } ++ } ++ ++ let mut pasted = evaluated.into_iter().collect::(); ++ if is_lifetime { ++ pasted.insert(0, '\''); ++ } ++ Ok(pasted) ++} +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/tests/compiletest.rs mesa-25.3.3/subprojects/paste-1.0.15/tests/compiletest.rs +--- mesa-25.3.3/subprojects/paste-1.0.15/tests/compiletest.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/tests/compiletest.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,7 @@ ++#[rustversion::attr(not(nightly), ignore)] ++#[cfg_attr(miri, ignore)] ++#[test] ++fn ui() { ++ let t = trybuild::TestCases::new(); ++ t.compile_fail("tests/ui/*.rs"); ++} +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/tests/test_attr.rs mesa-25.3.3/subprojects/paste-1.0.15/tests/test_attr.rs +--- mesa-25.3.3/subprojects/paste-1.0.15/tests/test_attr.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/tests/test_attr.rs 2024-09-14 20:00:12.000000000 -0500 +@@ -0,0 +1,62 @@ ++#![allow(clippy::let_underscore_untyped)] ++ ++use paste::paste; ++//use paste_test_suite::paste_test; ++ ++/*#[test] ++fn test_attr() { ++ paste! { ++ #[paste_test(k = "val" "ue")] ++ struct A; ++ ++ #[paste_test_suite::paste_test(k = "val" "ue")] ++ struct B; ++ ++ #[::paste_test_suite::paste_test(k = "val" "ue")] ++ struct C; ++ ++ #[paste_test(k = "va" [] e)] ++ struct D; ++ } ++ ++ let _ = A; ++ let _ = B; ++ let _ = C; ++ let _ = D; ++}*/ ++ ++#[test] ++fn test_paste_cfg() { ++ macro_rules! m { ++ ($ret:ident, $width:expr) => { ++ paste! { ++ #[cfg(any(feature = "protocol_feature_" $ret:snake, target_pointer_width = "" $width))] ++ fn new() -> $ret { todo!() } ++ } ++ }; ++ } ++ ++ struct Paste; ++ ++ #[cfg(target_pointer_width = "64")] ++ m!(Paste, 64); ++ #[cfg(target_pointer_width = "32")] ++ m!(Paste, 32); ++ ++ let _ = new; ++} ++ ++#[test] ++fn test_path_in_attr() { ++ macro_rules! m { ++ (#[x = $x:ty]) => { ++ stringify!($x) ++ }; ++ } ++ ++ let ty = paste! { ++ m!(#[x = foo::Bar]) ++ }; ++ ++ assert_eq!("foo::Bar", ty); ++} +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/tests/test_doc.rs mesa-25.3.3/subprojects/paste-1.0.15/tests/test_doc.rs +--- mesa-25.3.3/subprojects/paste-1.0.15/tests/test_doc.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/tests/test_doc.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,79 @@ ++#![allow(clippy::let_underscore_untyped)] ++ ++use paste::paste; ++ ++#[test] ++fn test_paste_doc() { ++ macro_rules! m { ++ ($ret:ident) => { ++ paste! { ++ #[doc = "Create a new [`" $ret "`] object."] ++ fn new() -> $ret { todo!() } ++ } ++ }; ++ } ++ ++ struct Paste; ++ m!(Paste); ++ ++ let _ = new; ++} ++ ++macro_rules! get_doc { ++ (#[doc = $literal:tt]) => { ++ $literal ++ }; ++} ++ ++#[test] ++fn test_escaping() { ++ let doc = paste! { ++ get_doc!(#[doc = "s\"" r#"r#""#]) ++ }; ++ ++ let expected = "s\"r#\""; ++ assert_eq!(doc, expected); ++} ++ ++#[test] ++fn test_literals() { ++ let doc = paste! { ++ get_doc!(#[doc = "int=" 0x1 " bool=" true " float=" 0.01]) ++ }; ++ ++ let expected = "int=0x1 bool=true float=0.01"; ++ assert_eq!(doc, expected); ++} ++ ++#[test] ++fn test_case() { ++ let doc = paste! { ++ get_doc!(#[doc = "HTTP " get:upper "!"]) ++ }; ++ ++ let expected = "HTTP GET!"; ++ assert_eq!(doc, expected); ++} ++ ++// https://github.com/dtolnay/paste/issues/63 ++#[test] ++fn test_stringify() { ++ macro_rules! create { ++ ($doc:expr) => { ++ paste! { ++ #[doc = $doc] ++ pub struct Struct; ++ } ++ }; ++ } ++ ++ macro_rules! forward { ++ ($name:ident) => { ++ create!(stringify!($name)); ++ }; ++ } ++ ++ forward!(documentation); ++ ++ let _ = Struct; ++} +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/tests/test_expr.rs mesa-25.3.3/subprojects/paste-1.0.15/tests/test_expr.rs +--- mesa-25.3.3/subprojects/paste-1.0.15/tests/test_expr.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/tests/test_expr.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,285 @@ ++#![allow(clippy::let_underscore_untyped)] ++ ++use paste::paste; ++ ++#[test] ++fn test_shared_hygiene() { ++ paste! { ++ let [] = 1; ++ assert_eq!([], 1); ++ } ++} ++ ++#[test] ++fn test_repeat() { ++ const ROCKET_A: &str = "/a"; ++ const ROCKET_B: &str = "/b"; ++ ++ macro_rules! routes { ++ ($($route:ident),*) => {{ ++ paste! { ++ vec![$( [] ),*] ++ } ++ }} ++ } ++ ++ let routes = routes!(A, B); ++ assert_eq!(routes, vec!["/a", "/b"]); ++} ++ ++#[test] ++fn test_literal_to_identifier() { ++ const CONST0: &str = "const0"; ++ ++ let pasted = paste!([]); ++ assert_eq!(pasted, CONST0); ++ ++ let pasted = paste!([]); ++ assert_eq!(pasted, CONST0); ++ ++ let pasted = paste!([]); ++ assert_eq!(pasted, CONST0); ++ ++ let pasted = paste!([]); ++ assert_eq!(pasted, CONST0); ++ ++ let pasted = paste!([]); ++ assert_eq!(pasted, CONST0); ++} ++ ++#[test] ++fn test_literal_suffix() { ++ macro_rules! literal { ++ ($bit:tt) => { ++ paste!([<1_u $bit>]) ++ }; ++ } ++ ++ assert_eq!(literal!(32), 1); ++} ++ ++#[test] ++fn test_underscore() { ++ paste! { ++ const A_B: usize = 0; ++ assert_eq!([], 0); ++ } ++} ++ ++#[test] ++fn test_lifetime() { ++ paste! { ++ #[allow(dead_code)] ++ struct S<[<'d e>]> { ++ q: &[<'d e>] str, ++ } ++ } ++} ++ ++#[test] ++fn test_keyword() { ++ paste! { ++ struct []; ++ ++ let _ = Fmove; ++ } ++} ++ ++#[test] ++fn test_literal_str() { ++ paste! { ++ #[allow(non_camel_case_types)] ++ struct []; ++ ++ let _ = FooBar_Baz; ++ } ++} ++ ++#[test] ++fn test_env_literal() { ++ paste! { ++ struct []; ++ ++ let _ = Libenvbar; ++ } ++} ++ ++#[test] ++fn test_env_present() { ++ paste! { ++ struct []; ++ ++ let _ = Libpaste; ++ } ++} ++ ++#[test] ++fn test_raw_identifier() { ++ paste! { ++ struct []; ++ ++ let _ = Fmove; ++ } ++} ++ ++#[test] ++fn test_false_start() { ++ trait Trait { ++ fn f() -> usize; ++ } ++ ++ struct S; ++ ++ impl Trait for S { ++ fn f() -> usize { ++ 0 ++ } ++ } ++ ++ paste! { ++ let x = [::f()]; ++ assert_eq!(x[0], 0); ++ } ++} ++ ++#[test] ++fn test_local_variable() { ++ let yy = 0; ++ ++ paste! { ++ assert_eq!([], 0); ++ } ++} ++ ++#[test] ++fn test_empty() { ++ paste! { ++ assert_eq!(stringify!([]), "yy"); ++ assert_eq!(stringify!([<>]).replace(' ', ""), "[<>]"); ++ } ++} ++ ++#[test] ++fn test_env_to_lower() { ++ paste! { ++ struct []; ++ ++ let _ = Libpaste; ++ } ++} ++ ++#[test] ++fn test_env_to_upper() { ++ paste! { ++ const []: &str = "libpaste"; ++ ++ let _ = LIBPASTE; ++ } ++} ++ ++#[test] ++fn test_env_to_snake() { ++ paste! { ++ const []: &str = "libpaste"; ++ ++ let _ = LIBPASTE; ++ } ++} ++ ++#[test] ++fn test_env_to_camel() { ++ paste! { ++ #[allow(non_upper_case_globals)] ++ const []: &str = "libpaste"; ++ ++ let _ = LIBPaste; ++ } ++} ++ ++mod test_x86_feature_literal { ++ // work around https://github.com/rust-lang/rust/issues/72726 ++ ++ #[cfg(any(target_arch = "x86", target_arch = "x86_64"))] ++ macro_rules! my_is_x86_feature_detected { ++ ($feat:literal) => { ++ use paste::paste; ++ ++ paste! { ++ #[test] ++ fn test() { ++ let _ = is_x86_feature_detected!($feat); ++ } ++ } ++ }; ++ } ++ ++ #[cfg(not(any(target_arch = "x86", target_arch = "x86_64")))] ++ macro_rules! my_is_x86_feature_detected { ++ ($feat:literal) => { ++ #[ignore] ++ #[test] ++ fn test() {} ++ }; ++ } ++ ++ my_is_x86_feature_detected!("mmx"); ++} ++ ++#[rustversion::since(1.46)] ++mod test_local_setter { ++ // https://github.com/dtolnay/paste/issues/7 ++ ++ use paste::paste; ++ ++ #[derive(Default)] ++ struct Test { ++ val: i32, ++ } ++ ++ impl Test { ++ fn set_val(&mut self, arg: i32) { ++ self.val = arg; ++ } ++ } ++ ++ macro_rules! setter { ++ ($obj:expr, $field:ident, $value:expr) => { ++ paste! { $obj.[]($value); } ++ }; ++ ++ ($field:ident, $value:expr) => {{ ++ let mut new = Test::default(); ++ setter!(new, val, $value); ++ new ++ }}; ++ } ++ ++ #[test] ++ fn test_local_setter() { ++ let a = setter!(val, 42); ++ assert_eq!(a.val, 42); ++ } ++} ++ ++// https://github.com/dtolnay/paste/issues/85 ++#[test] ++fn test_top_level_none_delimiter() { ++ macro_rules! clone { ++ ($val:expr) => { ++ paste! { ++ $val.clone() ++ } ++ }; ++ } ++ ++ #[derive(Clone)] ++ struct A; ++ ++ impl A { ++ fn consume_self(self) { ++ let _ = self; ++ } ++ } ++ ++ clone!(&A).consume_self(); ++} +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/tests/test_item.rs mesa-25.3.3/subprojects/paste-1.0.15/tests/test_item.rs +--- mesa-25.3.3/subprojects/paste-1.0.15/tests/test_item.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/tests/test_item.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,271 @@ ++#![allow(clippy::let_underscore_untyped)] ++ ++mod test_basic { ++ use paste::paste; ++ ++ struct Struct; ++ ++ paste! { ++ impl Struct { ++ fn []() {} ++ } ++ } ++ ++ #[test] ++ fn test() { ++ Struct::abc(); ++ } ++} ++ ++mod test_in_impl { ++ use paste::paste; ++ ++ struct Struct; ++ ++ impl Struct { ++ paste! { ++ fn []() {} ++ } ++ } ++ ++ #[test] ++ fn test() { ++ Struct::abc(); ++ } ++} ++ ++mod test_none_delimited_single_ident { ++ use paste::paste; ++ ++ macro_rules! m { ++ ($id:ident) => { ++ paste! { ++ fn f() -> &'static str { ++ stringify!($id) ++ } ++ } ++ }; ++ } ++ ++ m!(i32x4); ++ ++ #[test] ++ fn test() { ++ assert_eq!(f(), "i32x4"); ++ } ++} ++ ++mod test_none_delimited_single_lifetime { ++ use paste::paste; ++ ++ macro_rules! m { ++ ($life:lifetime) => { ++ paste! { ++ pub struct S<$life>(#[allow(dead_code)] pub &$life ()); ++ impl<$life> S<$life> { ++ fn f() {} ++ } ++ } ++ }; ++ } ++ ++ m!('a); ++ ++ #[test] ++ fn test() { ++ S::f(); ++ } ++} ++ ++mod test_to_lower { ++ use paste::paste; ++ ++ macro_rules! m { ++ ($id:ident) => { ++ paste! { ++ fn [](_arg: u8) -> &'static str { ++ stringify!([<$id:lower>]) ++ } ++ } ++ }; ++ } ++ ++ m!(Test); ++ ++ #[test] ++ fn test_to_lower() { ++ assert_eq!(my_test_here(0), "test"); ++ } ++} ++ ++mod test_to_upper { ++ use paste::paste; ++ ++ macro_rules! m { ++ ($id:ident) => { ++ paste! { ++ const []: &str = stringify!([<$id:upper>]); ++ } ++ }; ++ } ++ ++ m!(Test); ++ ++ #[test] ++ fn test_to_upper() { ++ assert_eq!(MY_TEST_HERE, "TEST"); ++ } ++} ++ ++mod test_to_snake { ++ use paste::paste; ++ ++ macro_rules! m { ++ ($id:ident) => { ++ paste! { ++ const DEFAULT_SNAKE: &str = stringify!([<$id:snake>]); ++ const LOWER_SNAKE: &str = stringify!([<$id:snake:lower>]); ++ const UPPER_SNAKE: &str = stringify!([<$id:snake:upper>]); ++ } ++ }; ++ } ++ ++ m!(ThisIsButATest); ++ ++ #[test] ++ fn test_to_snake() { ++ assert_eq!(DEFAULT_SNAKE, "this_is_but_a_test"); ++ assert_eq!(LOWER_SNAKE, "this_is_but_a_test"); ++ assert_eq!(UPPER_SNAKE, "THIS_IS_BUT_A_TEST"); ++ } ++} ++ ++mod test_to_camel { ++ use paste::paste; ++ ++ macro_rules! m { ++ ($id:ident) => { ++ paste! { ++ const DEFAULT_CAMEL: &str = stringify!([<$id:camel>]); ++ const LOWER_CAMEL: &str = stringify!([<$id:camel:lower>]); ++ const UPPER_CAMEL: &str = stringify!([<$id:camel:upper>]); ++ } ++ }; ++ } ++ ++ m!(this_is_but_a_test); ++ ++ #[test] ++ fn test_to_camel() { ++ assert_eq!(DEFAULT_CAMEL, "ThisIsButATest"); ++ assert_eq!(LOWER_CAMEL, "thisisbutatest"); ++ assert_eq!(UPPER_CAMEL, "THISISBUTATEST"); ++ } ++} ++ ++mod test_doc_expr { ++ // https://github.com/dtolnay/paste/issues/29 ++ ++ use paste::paste; ++ ++ macro_rules! doc_expr { ++ ($doc:expr) => { ++ paste! { ++ #[doc = $doc] ++ pub struct S; ++ } ++ }; ++ } ++ ++ doc_expr!(stringify!(...)); ++ ++ #[test] ++ fn test_doc_expr() { ++ let _: S; ++ } ++} ++ ++mod test_type_in_path { ++ // https://github.com/dtolnay/paste/issues/31 ++ ++ use paste::paste; ++ ++ mod keys { ++ #[derive(Default)] ++ pub struct Mib(std::marker::PhantomData); ++ } ++ ++ macro_rules! types { ++ ($mib:ty) => { ++ paste! { ++ #[derive(Default)] ++ pub struct S(pub keys::$mib); ++ } ++ }; ++ } ++ ++ macro_rules! write { ++ ($fn:ident, $field:ty) => { ++ paste! { ++ pub fn $fn() -> $field { ++ $field::default() ++ } ++ } ++ }; ++ } ++ ++ types! {Mib<[usize; 2]>} ++ write! {get_a, keys::Mib} ++ write! {get_b, usize} ++ ++ #[test] ++ fn test_type_in_path() { ++ let _: S; ++ let _ = get_a; ++ let _ = get_b; ++ } ++} ++ ++mod test_type_in_fn_arg { ++ // https://github.com/dtolnay/paste/issues/38 ++ ++ use paste::paste; ++ ++ fn _jit_address(_node: ()) {} ++ ++ macro_rules! jit_reexport { ++ ($fn:ident, $arg:ident : $typ:ty) => { ++ paste! { ++ pub fn $fn($arg: $typ) { ++ [<_jit_ $fn>]($arg); ++ } ++ } ++ }; ++ } ++ ++ jit_reexport!(address, node: ()); ++ ++ #[test] ++ fn test_type_in_fn_arg() { ++ let _ = address; ++ } ++} ++ ++mod test_pat_in_expr_position { ++ // https://github.com/xiph/rav1e/pull/2324/files ++ ++ use paste::paste; ++ ++ macro_rules! rav1e_bad { ++ ($e:pat) => { ++ paste! { ++ #[test] ++ fn test() { ++ let _ = $e; ++ } ++ } ++ }; ++ } ++ ++ rav1e_bad!(std::fmt::Error); ++} +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/case-warning.rs mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/case-warning.rs +--- mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/case-warning.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/case-warning.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,15 @@ ++#![deny(warnings)] ++ ++use paste::paste; ++ ++macro_rules! m { ++ ($i:ident) => { ++ paste! { ++ pub fn []() {} ++ } ++ }; ++} ++ ++m!(Bar); ++ ++fn main() {} +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/case-warning.stderr mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/case-warning.stderr +--- mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/case-warning.stderr 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/case-warning.stderr 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,16 @@ ++error: function `fooBar` should have a snake case name ++ --> tests/ui/case-warning.rs:8:20 ++ | ++8 | pub fn []() {} ++ | ^^^^^^^^^^ help: convert the identifier to snake case: `foo_bar` ++... ++13 | m!(Bar); ++ | ------- in this macro invocation ++ | ++note: the lint level is defined here ++ --> tests/ui/case-warning.rs:1:9 ++ | ++1 | #![deny(warnings)] ++ | ^^^^^^^^ ++ = note: `#[deny(non_snake_case)]` implied by `#[deny(warnings)]` ++ = note: this error originates in the macro `m` (in Nightly builds, run with -Z macro-backtrace for more info) +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/env-empty.rs mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/env-empty.rs +--- mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/env-empty.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/env-empty.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,7 @@ ++use paste::paste; ++ ++paste! { ++ fn []() {} ++} ++ ++fn main() {} +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/env-empty.stderr mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/env-empty.stderr +--- mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/env-empty.stderr 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/env-empty.stderr 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,5 @@ ++error: expected string literal as argument to env! macro ++ --> tests/ui/env-empty.rs:4:10 ++ | ++4 | fn []() {} ++ | ^^^^^^ +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/env-non-string.rs mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/env-non-string.rs +--- mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/env-non-string.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/env-non-string.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,7 @@ ++use paste::paste; ++ ++paste! { ++ fn []() {} ++} ++ ++fn main() {} +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/env-non-string.stderr mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/env-non-string.stderr +--- mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/env-non-string.stderr 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/env-non-string.stderr 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,5 @@ ++error: expected string literal ++ --> tests/ui/env-non-string.rs:4:15 ++ | ++4 | fn []() {} ++ | ^^^^ +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/env-suffix.rs mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/env-suffix.rs +--- mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/env-suffix.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/env-suffix.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,7 @@ ++use paste::paste; ++ ++paste! { ++ fn []() {} ++} ++ ++fn main() {} +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/env-suffix.stderr mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/env-suffix.stderr +--- mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/env-suffix.stderr 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/env-suffix.stderr 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,5 @@ ++error: expected string literal ++ --> tests/ui/env-suffix.rs:4:15 ++ | ++4 | fn []() {} ++ | ^^^^^^^^^^^ +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/env-unexpected.rs mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/env-unexpected.rs +--- mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/env-unexpected.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/env-unexpected.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,7 @@ ++use paste::paste; ++ ++paste! { ++ fn []() {} ++} ++ ++fn main() {} +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/env-unexpected.stderr mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/env-unexpected.stderr +--- mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/env-unexpected.stderr 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/env-unexpected.stderr 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,5 @@ ++error: unexpected token in env! macro ++ --> tests/ui/env-unexpected.rs:4:21 ++ | ++4 | fn []() {} ++ | ^^^^^ +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/invalid-ident.rs mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/invalid-ident.rs +--- mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/invalid-ident.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/invalid-ident.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,15 @@ ++use paste::paste; ++ ++paste! { ++ fn [<0 f>]() {} ++} ++ ++paste! { ++ fn []() {} ++} ++ ++paste! { ++ fn []() {} ++} ++ ++fn main() {} +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/invalid-ident.stderr mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/invalid-ident.stderr +--- mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/invalid-ident.stderr 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/invalid-ident.stderr 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,26 @@ ++error: expected identifier, found `0f` ++ --> tests/ui/invalid-ident.rs:3:1 ++ | ++3 | / paste! { ++4 | | fn [<0 f>]() {} ++5 | | } ++ | |_^ expected identifier ++ | ++help: identifiers cannot start with a number ++ --> tests/ui/invalid-ident.rs:3:1 ++ | ++3 | paste! { ++ | ^ ++ = note: this error originates in the macro `paste` (in Nightly builds, run with -Z macro-backtrace for more info) ++ ++error: `"f\""` is not a valid identifier ++ --> tests/ui/invalid-ident.rs:8:8 ++ | ++8 | fn []() {} ++ | ^^^^^^^^^ ++ ++error: `"f'"` is not a valid identifier ++ --> tests/ui/invalid-ident.rs:12:8 ++ | ++12 | fn []() {} ++ | ^^^^^^^^^ +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/missing-paren-on-env.rs mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/missing-paren-on-env.rs +--- mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/missing-paren-on-env.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/missing-paren-on-env.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,7 @@ ++use paste::paste; ++ ++paste! { ++ fn []() {} ++} ++ ++fn main() {} +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/missing-paren-on-env.stderr mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/missing-paren-on-env.stderr +--- mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/missing-paren-on-env.stderr 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/missing-paren-on-env.stderr 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,5 @@ ++error: expected `(` ++ --> tests/ui/missing-paren-on-env.rs:4:15 ++ | ++4 | fn []() {} ++ | ^^^ +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/no-env-var.rs mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/no-env-var.rs +--- mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/no-env-var.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/no-env-var.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,7 @@ ++use paste::paste; ++ ++paste! { ++ fn []() {} ++} ++ ++fn main() {} +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/no-env-var.stderr mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/no-env-var.stderr +--- mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/no-env-var.stderr 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/no-env-var.stderr 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,5 @@ ++error: no such env var: "PASTE_UNKNOWN" ++ --> tests/ui/no-env-var.rs:4:17 ++ | ++4 | fn []() {} ++ | ^^^^^^^^^^^^^^^ +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/no-ident-after-colon.rs mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/no-ident-after-colon.rs +--- mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/no-ident-after-colon.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/no-ident-after-colon.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,7 @@ ++use paste::paste; ++ ++paste! { ++ fn []() {} ++} ++ ++fn main() {} +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/no-ident-after-colon.stderr mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/no-ident-after-colon.stderr +--- mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/no-ident-after-colon.stderr 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/no-ident-after-colon.stderr 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,5 @@ ++error: expected identifier after `:` ++ --> tests/ui/no-ident-after-colon.rs:4:15 ++ | ++4 | fn []() {} ++ | ^ +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/unexpected-group.rs mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/unexpected-group.rs +--- mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/unexpected-group.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/unexpected-group.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,7 @@ ++use paste::paste; ++ ++paste! { ++ fn []() {} ++} ++ ++fn main() {} +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/unexpected-group.stderr mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/unexpected-group.stderr +--- mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/unexpected-group.stderr 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/unexpected-group.stderr 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,5 @@ ++error: unexpected token ++ --> tests/ui/unexpected-group.rs:4:12 ++ | ++4 | fn []() {} ++ | ^^ +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/unexpected-modifier.rs mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/unexpected-modifier.rs +--- mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/unexpected-modifier.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/unexpected-modifier.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,7 @@ ++use paste::paste; ++ ++paste! { ++ fn [<:lower x>]() {} ++} ++ ++fn main() {} +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/unexpected-modifier.stderr mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/unexpected-modifier.stderr +--- mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/unexpected-modifier.stderr 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/unexpected-modifier.stderr 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,5 @@ ++error: unexpected modifier ++ --> tests/ui/unexpected-modifier.rs:4:10 ++ | ++4 | fn [<:lower x>]() {} ++ | ^^^^^^ +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/unexpected-punct.rs mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/unexpected-punct.rs +--- mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/unexpected-punct.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/unexpected-punct.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,7 @@ ++use paste::paste; ++ ++paste! { ++ fn []() {} ++} ++ ++fn main() {} +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/unexpected-punct.stderr mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/unexpected-punct.stderr +--- mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/unexpected-punct.stderr 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/unexpected-punct.stderr 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,5 @@ ++error: unexpected punct ++ --> tests/ui/unexpected-punct.rs:4:12 ++ | ++4 | fn []() {} ++ | ^ +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/unsupported-literal.rs mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/unsupported-literal.rs +--- mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/unsupported-literal.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/unsupported-literal.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,21 @@ ++use paste::paste; ++ ++paste! { ++ fn []() {} ++} ++ ++paste! { ++ // `xyz` is not correct. `xbyz` is certainly not correct. Maybe `x121z` ++ // would be justifiable but for now don't accept this. ++ fn []() {} ++} ++ ++paste! { ++ fn []() {} ++} ++ ++paste! { ++ fn []() {} ++} ++ ++fn main() {} +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/unsupported-literal.stderr mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/unsupported-literal.stderr +--- mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/unsupported-literal.stderr 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/unsupported-literal.stderr 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,23 @@ ++error: unsupported literal ++ --> tests/ui/unsupported-literal.rs:4:12 ++ | ++4 | fn []() {} ++ | ^^^^^^ ++ ++error: unsupported literal ++ --> tests/ui/unsupported-literal.rs:10:12 ++ | ++10 | fn []() {} ++ | ^^^^ ++ ++error: unsupported literal ++ --> tests/ui/unsupported-literal.rs:14:12 ++ | ++14 | fn []() {} ++ | ^^^^ ++ ++error: unsupported literal ++ --> tests/ui/unsupported-literal.rs:18:12 ++ | ++18 | fn []() {} ++ | ^^^^^ +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/unsupported-modifier.rs mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/unsupported-modifier.rs +--- mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/unsupported-modifier.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/unsupported-modifier.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,7 @@ ++use paste::paste; ++ ++paste! { ++ fn []() {} ++} ++ ++fn main() {} +diff -Nru mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/unsupported-modifier.stderr mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/unsupported-modifier.stderr +--- mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/unsupported-modifier.stderr 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1.0.15/tests/ui/unsupported-modifier.stderr 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,5 @@ ++error: unsupported modifier ++ --> tests/ui/unsupported-modifier.rs:4:11 ++ | ++4 | fn []() {} ++ | ^^^^^^^ +diff -Nru mesa-25.3.3/subprojects/paste-1-rs.wrap mesa-25.3.3/subprojects/paste-1-rs.wrap +--- mesa-25.3.3/subprojects/paste-1-rs.wrap 2026-01-01 13:34:04.000000000 -0500 ++++ mesa-25.3.3/subprojects/paste-1-rs.wrap 2026-05-29 13:40:55.000000000 -0500 +@@ -1,6 +1,4 @@ + [wrap-file] +-directory = paste-1.0.14 +-source_url = https://crates.io/api/v1/crates/paste/1.0.14/download +-source_filename = paste-1.0.14.tar.gz +-source_hash = de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c ++directory = paste-1.0.15 + patch_directory = paste-1-rs ++ +diff -Nru mesa-25.3.3/subprojects/proc-macro2-1.0.92/build/probe.rs mesa-25.3.3/subprojects/proc-macro2-1.0.92/build/probe.rs +--- mesa-25.3.3/subprojects/proc-macro2-1.0.92/build/probe.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/proc-macro2-1.0.92/build/probe.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,41 @@ ++// This code exercises the surface area that we expect of Span's unstable API. ++// If the current toolchain is able to compile it, then proc-macro2 is able to ++// offer these APIs too. ++ ++#![feature(proc_macro_span)] ++ ++extern crate proc_macro; ++ ++use core::ops::{Range, RangeBounds}; ++use proc_macro::{Literal, Span}; ++ ++pub fn byte_range(this: &Span) -> Range { ++ this.byte_range() ++} ++ ++pub fn start(this: &Span) -> Span { ++ this.start() ++} ++ ++pub fn end(this: &Span) -> Span { ++ this.end() ++} ++ ++pub fn line(this: &Span) -> usize { ++ this.line() ++} ++ ++pub fn column(this: &Span) -> usize { ++ this.column() ++} ++ ++pub fn join(this: &Span, other: Span) -> Option { ++ this.join(other) ++} ++ ++pub fn subspan>(this: &Literal, range: R) -> Option { ++ this.subspan(range) ++} ++ ++// Include in sccache cache key. ++const _: Option<&str> = option_env!("RUSTC_BOOTSTRAP"); +diff -Nru mesa-25.3.3/subprojects/proc-macro2-1.0.92/build.rs mesa-25.3.3/subprojects/proc-macro2-1.0.92/build.rs +--- mesa-25.3.3/subprojects/proc-macro2-1.0.92/build.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/proc-macro2-1.0.92/build.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,235 @@ ++#![allow(unknown_lints)] ++#![allow(unexpected_cfgs)] ++ ++use std::env; ++use std::ffi::OsString; ++use std::fs; ++use std::io::ErrorKind; ++use std::iter; ++use std::path::Path; ++use std::process::{self, Command, Stdio}; ++use std::str; ++ ++fn main() { ++ let rustc = rustc_minor_version().unwrap_or(u32::MAX); ++ ++ if rustc >= 80 { ++ println!("cargo:rustc-check-cfg=cfg(fuzzing)"); ++ println!("cargo:rustc-check-cfg=cfg(no_is_available)"); ++ println!("cargo:rustc-check-cfg=cfg(no_literal_byte_character)"); ++ println!("cargo:rustc-check-cfg=cfg(no_literal_c_string)"); ++ println!("cargo:rustc-check-cfg=cfg(no_source_text)"); ++ println!("cargo:rustc-check-cfg=cfg(proc_macro_span)"); ++ println!("cargo:rustc-check-cfg=cfg(procmacro2_backtrace)"); ++ println!("cargo:rustc-check-cfg=cfg(procmacro2_nightly_testing)"); ++ println!("cargo:rustc-check-cfg=cfg(procmacro2_semver_exempt)"); ++ println!("cargo:rustc-check-cfg=cfg(randomize_layout)"); ++ println!("cargo:rustc-check-cfg=cfg(span_locations)"); ++ println!("cargo:rustc-check-cfg=cfg(super_unstable)"); ++ println!("cargo:rustc-check-cfg=cfg(wrap_proc_macro)"); ++ } ++ ++ let docs_rs = env::var_os("DOCS_RS").is_some(); ++ let semver_exempt = cfg!(procmacro2_semver_exempt) || docs_rs; ++ if semver_exempt { ++ // https://github.com/dtolnay/proc-macro2/issues/147 ++ println!("cargo:rustc-cfg=procmacro2_semver_exempt"); ++ } ++ ++ if semver_exempt || cfg!(feature = "span-locations") { ++ // Provide methods Span::start and Span::end which give the line/column ++ // location of a token. This is behind a cfg because tracking location ++ // inside spans is a performance hit. ++ println!("cargo:rustc-cfg=span_locations"); ++ } ++ ++ if rustc < 57 { ++ // Do not use proc_macro::is_available() to detect whether the proc ++ // macro API is available vs needs to be polyfilled. Instead, use the ++ // proc macro API unconditionally and catch the panic that occurs if it ++ // isn't available. ++ println!("cargo:rustc-cfg=no_is_available"); ++ } ++ ++ if rustc < 66 { ++ // Do not call libproc_macro's Span::source_text. Always return None. ++ println!("cargo:rustc-cfg=no_source_text"); ++ } ++ ++ if rustc < 79 { ++ // Do not call Literal::byte_character nor Literal::c_string. They can ++ // be emulated by way of Literal::from_str. ++ println!("cargo:rustc-cfg=no_literal_byte_character"); ++ println!("cargo:rustc-cfg=no_literal_c_string"); ++ } ++ ++ if !cfg!(feature = "proc-macro") { ++ println!("cargo:rerun-if-changed=build.rs"); ++ return; ++ } ++ ++ println!("cargo:rerun-if-changed=build/probe.rs"); ++ ++ let proc_macro_span; ++ let consider_rustc_bootstrap; ++ if compile_probe(false) { ++ // This is a nightly or dev compiler, so it supports unstable features ++ // regardless of RUSTC_BOOTSTRAP. No need to rerun build script if ++ // RUSTC_BOOTSTRAP is changed. ++ proc_macro_span = true; ++ consider_rustc_bootstrap = false; ++ } else if let Some(rustc_bootstrap) = env::var_os("RUSTC_BOOTSTRAP") { ++ if compile_probe(true) { ++ // This is a stable or beta compiler for which the user has set ++ // RUSTC_BOOTSTRAP to turn on unstable features. Rerun build script ++ // if they change it. ++ proc_macro_span = true; ++ consider_rustc_bootstrap = true; ++ } else if rustc_bootstrap == "1" { ++ // This compiler does not support the proc macro Span API in the ++ // form that proc-macro2 expects. No need to pay attention to ++ // RUSTC_BOOTSTRAP. ++ proc_macro_span = false; ++ consider_rustc_bootstrap = false; ++ } else { ++ // This is a stable or beta compiler for which RUSTC_BOOTSTRAP is ++ // set to restrict the use of unstable features by this crate. ++ proc_macro_span = false; ++ consider_rustc_bootstrap = true; ++ } ++ } else { ++ // Without RUSTC_BOOTSTRAP, this compiler does not support the proc ++ // macro Span API in the form that proc-macro2 expects, but try again if ++ // the user turns on unstable features. ++ proc_macro_span = false; ++ consider_rustc_bootstrap = true; ++ } ++ ++ if proc_macro_span || !semver_exempt { ++ // Wrap types from libproc_macro rather than polyfilling the whole API. ++ // Enabled as long as procmacro2_semver_exempt is not set, because we ++ // can't emulate the unstable API without emulating everything else. ++ // Also enabled unconditionally on nightly, in which case the ++ // procmacro2_semver_exempt surface area is implemented by using the ++ // nightly-only proc_macro API. ++ println!("cargo:rustc-cfg=wrap_proc_macro"); ++ } ++ ++ if proc_macro_span { ++ // Enable non-dummy behavior of Span::start and Span::end methods which ++ // requires an unstable compiler feature. Enabled when building with ++ // nightly, unless `-Z allow-feature` in RUSTFLAGS disallows unstable ++ // features. ++ println!("cargo:rustc-cfg=proc_macro_span"); ++ } ++ ++ if semver_exempt && proc_macro_span { ++ // Implement the semver exempt API in terms of the nightly-only ++ // proc_macro API. ++ println!("cargo:rustc-cfg=super_unstable"); ++ } ++ ++ if consider_rustc_bootstrap { ++ println!("cargo:rerun-if-env-changed=RUSTC_BOOTSTRAP"); ++ } ++} ++ ++fn compile_probe(rustc_bootstrap: bool) -> bool { ++ if env::var_os("RUSTC_STAGE").is_some() { ++ // We are running inside rustc bootstrap. This is a highly non-standard ++ // environment with issues such as: ++ // ++ // https://github.com/rust-lang/cargo/issues/11138 ++ // https://github.com/rust-lang/rust/issues/114839 ++ // ++ // Let's just not use nightly features here. ++ return false; ++ } ++ ++ let rustc = cargo_env_var("RUSTC"); ++ let out_dir = cargo_env_var("OUT_DIR"); ++ let out_subdir = Path::new(&out_dir).join("probe"); ++ let probefile = Path::new("build").join("probe.rs"); ++ ++ if let Err(err) = fs::create_dir(&out_subdir) { ++ if err.kind() != ErrorKind::AlreadyExists { ++ eprintln!("Failed to create {}: {}", out_subdir.display(), err); ++ process::exit(1); ++ } ++ } ++ ++ let rustc_wrapper = env::var_os("RUSTC_WRAPPER").filter(|wrapper| !wrapper.is_empty()); ++ let rustc_workspace_wrapper = ++ env::var_os("RUSTC_WORKSPACE_WRAPPER").filter(|wrapper| !wrapper.is_empty()); ++ let mut rustc = rustc_wrapper ++ .into_iter() ++ .chain(rustc_workspace_wrapper) ++ .chain(iter::once(rustc)); ++ let mut cmd = Command::new(rustc.next().unwrap()); ++ cmd.args(rustc); ++ ++ if !rustc_bootstrap { ++ cmd.env_remove("RUSTC_BOOTSTRAP"); ++ } ++ ++ cmd.stderr(Stdio::null()) ++ .arg("--edition=2021") ++ .arg("--crate-name=proc_macro2") ++ .arg("--crate-type=lib") ++ .arg("--cap-lints=allow") ++ .arg("--emit=dep-info,metadata") ++ .arg("--out-dir") ++ .arg(&out_subdir) ++ .arg(probefile); ++ ++ if let Some(target) = env::var_os("TARGET") { ++ cmd.arg("--target").arg(target); ++ } ++ ++ // If Cargo wants to set RUSTFLAGS, use that. ++ if let Ok(rustflags) = env::var("CARGO_ENCODED_RUSTFLAGS") { ++ if !rustflags.is_empty() { ++ for arg in rustflags.split('\x1f') { ++ cmd.arg(arg); ++ } ++ } ++ } ++ ++ let success = match cmd.status() { ++ Ok(status) => status.success(), ++ Err(_) => false, ++ }; ++ ++ // Clean up to avoid leaving nondeterministic absolute paths in the dep-info ++ // file in OUT_DIR, which causes nonreproducible builds in build systems ++ // that treat the entire OUT_DIR as an artifact. ++ if let Err(err) = fs::remove_dir_all(&out_subdir) { ++ if err.kind() != ErrorKind::NotFound { ++ eprintln!("Failed to clean up {}: {}", out_subdir.display(), err); ++ process::exit(1); ++ } ++ } ++ ++ success ++} ++ ++fn rustc_minor_version() -> Option { ++ let rustc = cargo_env_var("RUSTC"); ++ let output = Command::new(rustc).arg("--version").output().ok()?; ++ let version = str::from_utf8(&output.stdout).ok()?; ++ let mut pieces = version.split('.'); ++ if pieces.next() != Some("rustc 1") { ++ return None; ++ } ++ pieces.next()?.parse().ok() ++} ++ ++fn cargo_env_var(key: &str) -> OsString { ++ env::var_os(key).unwrap_or_else(|| { ++ eprintln!( ++ "Environment variable ${} is not set during execution of build script", ++ key, ++ ); ++ process::exit(1); ++ }) ++} +diff -Nru mesa-25.3.3/subprojects/proc-macro2-1.0.92/.cargo-checksum.json mesa-25.3.3/subprojects/proc-macro2-1.0.92/.cargo-checksum.json +--- mesa-25.3.3/subprojects/proc-macro2-1.0.92/.cargo-checksum.json 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/proc-macro2-1.0.92/.cargo-checksum.json 2025-01-10 16:43:05.000000000 -0500 +@@ -0,0 +1 @@ ++{"package":"37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0","files":{}} +diff -Nru mesa-25.3.3/subprojects/proc-macro2-1.0.92/Cargo.toml mesa-25.3.3/subprojects/proc-macro2-1.0.92/Cargo.toml +--- mesa-25.3.3/subprojects/proc-macro2-1.0.92/Cargo.toml 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/proc-macro2-1.0.92/Cargo.toml 2025-01-10 16:43:05.000000000 -0500 +@@ -0,0 +1,105 @@ ++# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO ++# ++# When uploading crates to the registry Cargo will automatically ++# "normalize" Cargo.toml files for maximal compatibility ++# with all versions of Cargo and also rewrite `path` dependencies ++# to registry (e.g., crates.io) dependencies. ++# ++# If you are reading this file be aware that the original Cargo.toml ++# will likely look very different (and much more reasonable). ++# See Cargo.toml.orig for the original contents. ++ ++[package] ++edition = "2021" ++rust-version = "1.56" ++name = "proc-macro2" ++version = "1.0.92" ++authors = [ ++ "David Tolnay ", ++ "Alex Crichton ", ++] ++build = "build.rs" ++autolib = false ++autobins = false ++autoexamples = false ++autotests = false ++autobenches = false ++description = "A substitute implementation of the compiler's `proc_macro` API to decouple token-based libraries from the procedural macro use case." ++documentation = "https://docs.rs/proc-macro2" ++readme = "README.md" ++keywords = [ ++ "macros", ++ "syn", ++] ++categories = ["development-tools::procedural-macro-helpers"] ++license = "MIT OR Apache-2.0" ++repository = "https://github.com/dtolnay/proc-macro2" ++ ++[package.metadata.docs.rs] ++rustc-args = [ ++ "--cfg", ++ "procmacro2_semver_exempt", ++] ++rustdoc-args = [ ++ "--cfg", ++ "procmacro2_semver_exempt", ++ "--generate-link-to-definition", ++] ++targets = ["x86_64-unknown-linux-gnu"] ++ ++[package.metadata.playground] ++features = ["span-locations"] ++ ++[lib] ++name = "proc_macro2" ++path = "src/lib.rs" ++doc-scrape-examples = false ++ ++[[test]] ++name = "comments" ++path = "tests/comments.rs" ++ ++[[test]] ++name = "features" ++path = "tests/features.rs" ++ ++[[test]] ++name = "marker" ++path = "tests/marker.rs" ++ ++[[test]] ++name = "test" ++path = "tests/test.rs" ++ ++[[test]] ++name = "test_fmt" ++path = "tests/test_fmt.rs" ++ ++[[test]] ++name = "test_size" ++path = "tests/test_size.rs" ++ ++[dependencies.unicode-ident] ++version = "1.0" ++ ++[dev-dependencies.flate2] ++version = "1.0" ++ ++[dev-dependencies.quote] ++version = "1.0" ++default-features = false ++ ++[dev-dependencies.rayon] ++version = "1.0" ++ ++[dev-dependencies.rustversion] ++version = "1" ++ ++[dev-dependencies.tar] ++version = "0.4" ++ ++[features] ++default = ["proc-macro"] ++nightly = [] ++proc-macro = [] ++span-locations = [] +diff -Nru mesa-25.3.3/subprojects/proc-macro2-1.0.92/.cargo_vcs_info.json mesa-25.3.3/subprojects/proc-macro2-1.0.92/.cargo_vcs_info.json +--- mesa-25.3.3/subprojects/proc-macro2-1.0.92/.cargo_vcs_info.json 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/proc-macro2-1.0.92/.cargo_vcs_info.json 2025-01-10 16:43:05.000000000 -0500 +@@ -0,0 +1,6 @@ ++{ ++ "git": { ++ "sha1": "acc7d368209b3af57bba8c470f3c8f5f9234ec04" ++ }, ++ "path_in_vcs": "" ++} +\ No hay ningún carácter de nueva línea al final del archivo +diff -Nru mesa-25.3.3/subprojects/proc-macro2-1.0.92/.github/FUNDING.yml mesa-25.3.3/subprojects/proc-macro2-1.0.92/.github/FUNDING.yml +--- mesa-25.3.3/subprojects/proc-macro2-1.0.92/.github/FUNDING.yml 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/proc-macro2-1.0.92/.github/FUNDING.yml 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1 @@ ++github: dtolnay +diff -Nru mesa-25.3.3/subprojects/proc-macro2-1.0.92/.github/workflows/ci.yml mesa-25.3.3/subprojects/proc-macro2-1.0.92/.github/workflows/ci.yml +--- mesa-25.3.3/subprojects/proc-macro2-1.0.92/.github/workflows/ci.yml 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/proc-macro2-1.0.92/.github/workflows/ci.yml 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,226 @@ ++name: CI ++ ++on: ++ push: ++ pull_request: ++ workflow_dispatch: ++ schedule: [cron: "40 1 * * *"] ++ ++permissions: ++ contents: read ++ ++env: ++ RUSTFLAGS: -Dwarnings ++ ++jobs: ++ pre_ci: ++ uses: dtolnay/.github/.github/workflows/pre_ci.yml@master ++ ++ test: ++ name: Rust ${{matrix.rust}} ++ needs: pre_ci ++ if: needs.pre_ci.outputs.continue ++ runs-on: ubuntu-latest ++ strategy: ++ fail-fast: false ++ matrix: ++ rust: [1.63.0, stable, beta] ++ timeout-minutes: 45 ++ steps: ++ - uses: actions/checkout@v4 ++ - uses: dtolnay/rust-toolchain@master ++ with: ++ toolchain: ${{matrix.rust}} ++ components: rust-src ++ - run: cargo test ++ - run: cargo test --no-default-features ++ - run: cargo test --features span-locations ++ - name: RUSTFLAGS='--cfg procmacro2_semver_exempt' cargo test ++ run: cargo test ++ env: ++ RUSTFLAGS: --cfg procmacro2_semver_exempt ${{env.RUSTFLAGS}} ++ - name: RUSTFLAGS='--cfg procmacro2_semver_exempt' cargo test --no-default-features ++ run: cargo test --no-default-features ++ env: ++ RUSTFLAGS: --cfg procmacro2_semver_exempt ${{env.RUSTFLAGS}} ++ ++ nightly: ++ name: Rust nightly ++ needs: pre_ci ++ if: needs.pre_ci.outputs.continue ++ runs-on: ubuntu-latest ++ timeout-minutes: 45 ++ steps: ++ - uses: actions/checkout@v4 ++ - uses: dtolnay/rust-toolchain@nightly ++ with: ++ components: rust-src ++ - name: Enable type layout randomization ++ run: echo RUSTFLAGS=${RUSTFLAGS}\ -Zrandomize-layout\ --cfg=randomize_layout >> $GITHUB_ENV ++ - run: cargo check ++ env: ++ RUSTFLAGS: --cfg procmacro2_nightly_testing ${{env.RUSTFLAGS}} ++ - run: cargo test ++ - run: cargo test --no-default-features ++ - run: cargo test --no-default-features --test features -- --ignored make_sure_no_proc_macro # run the ignored test to make sure the `proc-macro` feature is disabled ++ - run: cargo test --features span-locations ++ - run: cargo test --manifest-path tests/ui/Cargo.toml ++ - name: RUSTFLAGS='--cfg procmacro2_semver_exempt' cargo test ++ run: cargo test ++ env: ++ RUSTFLAGS: --cfg procmacro2_semver_exempt ${{env.RUSTFLAGS}} ++ - name: RUSTFLAGS='--cfg procmacro2_semver_exempt' cargo test --no-default-features ++ run: cargo test --no-default-features ++ env: ++ RUSTFLAGS: --cfg procmacro2_semver_exempt ${{env.RUSTFLAGS}} ++ - name: RUSTFLAGS='-Z allow-features=' cargo test ++ run: cargo test ++ env: ++ RUSTFLAGS: -Z allow-features= --cfg procmacro2_backtrace ${{env.RUSTFLAGS}} ++ - uses: actions/upload-artifact@v4 ++ if: always() ++ with: ++ name: Cargo.lock ++ path: Cargo.lock ++ continue-on-error: true ++ ++ layout: ++ name: Layout ++ needs: pre_ci ++ if: needs.pre_ci.outputs.continue ++ runs-on: ubuntu-latest ++ timeout-minutes: 45 ++ steps: ++ - uses: actions/checkout@v4 ++ - uses: dtolnay/rust-toolchain@nightly ++ with: ++ components: rust-src ++ - run: cargo test --test test_size ++ - run: cargo test --test test_size --features span-locations ++ - run: cargo test --test test_size --no-default-features ++ - run: cargo test --test test_size --no-default-features --features span-locations ++ ++ msrv: ++ name: Rust 1.56.0 ++ needs: pre_ci ++ if: needs.pre_ci.outputs.continue ++ runs-on: ubuntu-latest ++ timeout-minutes: 45 ++ steps: ++ - uses: actions/checkout@v4 ++ - uses: dtolnay/rust-toolchain@1.56.0 ++ with: ++ components: rust-src ++ - run: cargo check ++ - run: cargo check --no-default-features ++ - run: cargo check --features span-locations ++ - name: RUSTFLAGS='--cfg procmacro2_semver_exempt' cargo check ++ run: cargo check ++ env: ++ RUSTFLAGS: --cfg procmacro2_semver_exempt ${{env.RUSTFLAGS}} ++ - name: RUSTFLAGS='--cfg procmacro2_semver_exempt' cargo check --no-default-features ++ run: cargo check --no-default-features ++ env: ++ RUSTFLAGS: --cfg procmacro2_semver_exempt ${{env.RUSTFLAGS}} ++ ++ minimal: ++ name: Minimal versions ++ needs: pre_ci ++ if: needs.pre_ci.outputs.continue ++ runs-on: ubuntu-latest ++ timeout-minutes: 45 ++ steps: ++ - uses: actions/checkout@v4 ++ - uses: dtolnay/rust-toolchain@nightly ++ - run: cargo generate-lockfile -Z minimal-versions ++ - run: cargo check --locked ++ ++ webassembly: ++ name: WebAssembly ++ needs: pre_ci ++ if: needs.pre_ci.outputs.continue ++ runs-on: ubuntu-latest ++ timeout-minutes: 45 ++ steps: ++ - uses: actions/checkout@v4 ++ - uses: dtolnay/rust-toolchain@nightly ++ with: ++ target: wasm32-unknown-unknown ++ components: rust-src ++ - run: cargo test --target wasm32-unknown-unknown --no-run ++ ++ fuzz: ++ name: Fuzz ++ needs: pre_ci ++ if: needs.pre_ci.outputs.continue ++ runs-on: ubuntu-latest ++ timeout-minutes: 45 ++ steps: ++ - uses: actions/checkout@v4 ++ - uses: dtolnay/rust-toolchain@nightly ++ with: ++ components: rust-src ++ - uses: dtolnay/install@cargo-fuzz ++ - run: cargo fuzz check ++ - run: cargo check --no-default-features --features afl ++ working-directory: fuzz ++ - uses: dtolnay/install@honggfuzz ++ - run: sudo apt-get update # https://github.com/actions/runner-images/issues/8953 ++ - run: sudo apt-get install binutils-dev libunwind-dev ++ - run: cargo hfuzz build --no-default-features --features honggfuzz ++ working-directory: fuzz ++ ++ doc: ++ name: Documentation ++ needs: pre_ci ++ if: needs.pre_ci.outputs.continue ++ runs-on: ubuntu-latest ++ timeout-minutes: 45 ++ env: ++ RUSTDOCFLAGS: -Dwarnings ++ steps: ++ - uses: actions/checkout@v4 ++ - uses: dtolnay/rust-toolchain@nightly ++ with: ++ components: rust-src ++ - uses: dtolnay/install@cargo-docs-rs ++ - run: cargo docs-rs ++ ++ clippy: ++ name: Clippy ++ runs-on: ubuntu-latest ++ if: github.event_name != 'pull_request' ++ timeout-minutes: 45 ++ steps: ++ - uses: actions/checkout@v4 ++ - uses: dtolnay/rust-toolchain@nightly ++ with: ++ components: clippy, rust-src ++ - run: cargo clippy --tests -- -Dclippy::all -Dclippy::pedantic ++ - run: cargo clippy --tests --all-features -- -Dclippy::all -Dclippy::pedantic ++ ++ miri: ++ name: Miri ++ needs: pre_ci ++ if: needs.pre_ci.outputs.continue ++ runs-on: ubuntu-latest ++ timeout-minutes: 45 ++ steps: ++ - uses: actions/checkout@v4 ++ - uses: dtolnay/rust-toolchain@miri ++ - run: cargo miri setup ++ - run: cargo miri test ++ env: ++ MIRIFLAGS: -Zmiri-strict-provenance ++ ++ outdated: ++ name: Outdated ++ runs-on: ubuntu-latest ++ if: github.event_name != 'pull_request' ++ timeout-minutes: 45 ++ steps: ++ - uses: actions/checkout@v4 ++ - uses: dtolnay/rust-toolchain@stable ++ - uses: dtolnay/install@cargo-outdated ++ - run: cargo outdated --workspace --exit-code 1 ++ - run: cargo outdated --manifest-path fuzz/Cargo.toml --exit-code 1 +diff -Nru mesa-25.3.3/subprojects/proc-macro2-1.0.92/.gitignore mesa-25.3.3/subprojects/proc-macro2-1.0.92/.gitignore +--- mesa-25.3.3/subprojects/proc-macro2-1.0.92/.gitignore 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/proc-macro2-1.0.92/.gitignore 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,3 @@ ++/target ++**/*.rs.bk ++Cargo.lock +diff -Nru mesa-25.3.3/subprojects/proc-macro2-1.0.92/LICENSE-APACHE mesa-25.3.3/subprojects/proc-macro2-1.0.92/LICENSE-APACHE +--- mesa-25.3.3/subprojects/proc-macro2-1.0.92/LICENSE-APACHE 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/proc-macro2-1.0.92/LICENSE-APACHE 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,176 @@ ++ Apache License ++ Version 2.0, January 2004 ++ http://www.apache.org/licenses/ ++ ++TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION ++ ++1. Definitions. ++ ++ "License" shall mean the terms and conditions for use, reproduction, ++ and distribution as defined by Sections 1 through 9 of this document. ++ ++ "Licensor" shall mean the copyright owner or entity authorized by ++ the copyright owner that is granting the License. ++ ++ "Legal Entity" shall mean the union of the acting entity and all ++ other entities that control, are controlled by, or are under common ++ control with that entity. For the purposes of this definition, ++ "control" means (i) the power, direct or indirect, to cause the ++ direction or management of such entity, whether by contract or ++ otherwise, or (ii) ownership of fifty percent (50%) or more of the ++ outstanding shares, or (iii) beneficial ownership of such entity. ++ ++ "You" (or "Your") shall mean an individual or Legal Entity ++ exercising permissions granted by this License. ++ ++ "Source" form shall mean the preferred form for making modifications, ++ including but not limited to software source code, documentation ++ source, and configuration files. ++ ++ "Object" form shall mean any form resulting from mechanical ++ transformation or translation of a Source form, including but ++ not limited to compiled object code, generated documentation, ++ and conversions to other media types. ++ ++ "Work" shall mean the work of authorship, whether in Source or ++ Object form, made available under the License, as indicated by a ++ copyright notice that is included in or attached to the work ++ (an example is provided in the Appendix below). ++ ++ "Derivative Works" shall mean any work, whether in Source or Object ++ form, that is based on (or derived from) the Work and for which the ++ editorial revisions, annotations, elaborations, or other modifications ++ represent, as a whole, an original work of authorship. For the purposes ++ of this License, Derivative Works shall not include works that remain ++ separable from, or merely link (or bind by name) to the interfaces of, ++ the Work and Derivative Works thereof. ++ ++ "Contribution" shall mean any work of authorship, including ++ the original version of the Work and any modifications or additions ++ to that Work or Derivative Works thereof, that is intentionally ++ submitted to Licensor for inclusion in the Work by the copyright owner ++ or by an individual or Legal Entity authorized to submit on behalf of ++ the copyright owner. For the purposes of this definition, "submitted" ++ means any form of electronic, verbal, or written communication sent ++ to the Licensor or its representatives, including but not limited to ++ communication on electronic mailing lists, source code control systems, ++ and issue tracking systems that are managed by, or on behalf of, the ++ Licensor for the purpose of discussing and improving the Work, but ++ excluding communication that is conspicuously marked or otherwise ++ designated in writing by the copyright owner as "Not a Contribution." ++ ++ "Contributor" shall mean Licensor and any individual or Legal Entity ++ on behalf of whom a Contribution has been received by Licensor and ++ subsequently incorporated within the Work. ++ ++2. Grant of Copyright License. Subject to the terms and conditions of ++ this License, each Contributor hereby grants to You a perpetual, ++ worldwide, non-exclusive, no-charge, royalty-free, irrevocable ++ copyright license to reproduce, prepare Derivative Works of, ++ publicly display, publicly perform, sublicense, and distribute the ++ Work and such Derivative Works in Source or Object form. ++ ++3. Grant of Patent License. Subject to the terms and conditions of ++ this License, each Contributor hereby grants to You a perpetual, ++ worldwide, non-exclusive, no-charge, royalty-free, irrevocable ++ (except as stated in this section) patent license to make, have made, ++ use, offer to sell, sell, import, and otherwise transfer the Work, ++ where such license applies only to those patent claims licensable ++ by such Contributor that are necessarily infringed by their ++ Contribution(s) alone or by combination of their Contribution(s) ++ with the Work to which such Contribution(s) was submitted. If You ++ institute patent litigation against any entity (including a ++ cross-claim or counterclaim in a lawsuit) alleging that the Work ++ or a Contribution incorporated within the Work constitutes direct ++ or contributory patent infringement, then any patent licenses ++ granted to You under this License for that Work shall terminate ++ as of the date such litigation is filed. ++ ++4. Redistribution. You may reproduce and distribute copies of the ++ Work or Derivative Works thereof in any medium, with or without ++ modifications, and in Source or Object form, provided that You ++ meet the following conditions: ++ ++ (a) You must give any other recipients of the Work or ++ Derivative Works a copy of this License; and ++ ++ (b) You must cause any modified files to carry prominent notices ++ stating that You changed the files; and ++ ++ (c) You must retain, in the Source form of any Derivative Works ++ that You distribute, all copyright, patent, trademark, and ++ attribution notices from the Source form of the Work, ++ excluding those notices that do not pertain to any part of ++ the Derivative Works; and ++ ++ (d) If the Work includes a "NOTICE" text file as part of its ++ distribution, then any Derivative Works that You distribute must ++ include a readable copy of the attribution notices contained ++ within such NOTICE file, excluding those notices that do not ++ pertain to any part of the Derivative Works, in at least one ++ of the following places: within a NOTICE text file distributed ++ as part of the Derivative Works; within the Source form or ++ documentation, if provided along with the Derivative Works; or, ++ within a display generated by the Derivative Works, if and ++ wherever such third-party notices normally appear. The contents ++ of the NOTICE file are for informational purposes only and ++ do not modify the License. You may add Your own attribution ++ notices within Derivative Works that You distribute, alongside ++ or as an addendum to the NOTICE text from the Work, provided ++ that such additional attribution notices cannot be construed ++ as modifying the License. ++ ++ You may add Your own copyright statement to Your modifications and ++ may provide additional or different license terms and conditions ++ for use, reproduction, or distribution of Your modifications, or ++ for any such Derivative Works as a whole, provided Your use, ++ reproduction, and distribution of the Work otherwise complies with ++ the conditions stated in this License. ++ ++5. Submission of Contributions. Unless You explicitly state otherwise, ++ any Contribution intentionally submitted for inclusion in the Work ++ by You to the Licensor shall be under the terms and conditions of ++ this License, without any additional terms or conditions. ++ Notwithstanding the above, nothing herein shall supersede or modify ++ the terms of any separate license agreement you may have executed ++ with Licensor regarding such Contributions. ++ ++6. Trademarks. This License does not grant permission to use the trade ++ names, trademarks, service marks, or product names of the Licensor, ++ except as required for reasonable and customary use in describing the ++ origin of the Work and reproducing the content of the NOTICE file. ++ ++7. Disclaimer of Warranty. Unless required by applicable law or ++ agreed to in writing, Licensor provides the Work (and each ++ Contributor provides its Contributions) on an "AS IS" BASIS, ++ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or ++ implied, including, without limitation, any warranties or conditions ++ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A ++ PARTICULAR PURPOSE. You are solely responsible for determining the ++ appropriateness of using or redistributing the Work and assume any ++ risks associated with Your exercise of permissions under this License. ++ ++8. Limitation of Liability. In no event and under no legal theory, ++ whether in tort (including negligence), contract, or otherwise, ++ unless required by applicable law (such as deliberate and grossly ++ negligent acts) or agreed to in writing, shall any Contributor be ++ liable to You for damages, including any direct, indirect, special, ++ incidental, or consequential damages of any character arising as a ++ result of this License or out of the use or inability to use the ++ Work (including but not limited to damages for loss of goodwill, ++ work stoppage, computer failure or malfunction, or any and all ++ other commercial damages or losses), even if such Contributor ++ has been advised of the possibility of such damages. ++ ++9. Accepting Warranty or Additional Liability. While redistributing ++ the Work or Derivative Works thereof, You may choose to offer, ++ and charge a fee for, acceptance of support, warranty, indemnity, ++ or other liability obligations and/or rights consistent with this ++ License. However, in accepting such obligations, You may act only ++ on Your own behalf and on Your sole responsibility, not on behalf ++ of any other Contributor, and only if You agree to indemnify, ++ defend, and hold each Contributor harmless for any liability ++ incurred by, or claims asserted against, such Contributor by reason ++ of your accepting any such warranty or additional liability. ++ ++END OF TERMS AND CONDITIONS +diff -Nru mesa-25.3.3/subprojects/proc-macro2-1.0.92/LICENSE-MIT mesa-25.3.3/subprojects/proc-macro2-1.0.92/LICENSE-MIT +--- mesa-25.3.3/subprojects/proc-macro2-1.0.92/LICENSE-MIT 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/proc-macro2-1.0.92/LICENSE-MIT 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,23 @@ ++Permission is hereby granted, free of charge, to any ++person obtaining a copy of this software and associated ++documentation files (the "Software"), to deal in the ++Software without restriction, including without ++limitation the rights to use, copy, modify, merge, ++publish, distribute, sublicense, and/or sell copies of ++the Software, and to permit persons to whom the Software ++is furnished to do so, subject to the following ++conditions: ++ ++The above copyright notice and this permission notice ++shall be included in all copies or substantial portions ++of the Software. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ++ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED ++TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A ++PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT ++SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ++CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION ++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR ++IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ++DEALINGS IN THE SOFTWARE. +diff -Nru mesa-25.3.3/subprojects/proc-macro2-1.0.92/meson.build mesa-25.3.3/subprojects/proc-macro2-1.0.92/meson.build +--- mesa-25.3.3/subprojects/proc-macro2-1.0.92/meson.build 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/proc-macro2-1.0.92/meson.build 2026-05-26 15:46:08.000000000 -0500 +@@ -0,0 +1,59 @@ ++project('proc-macro2', 'rust', version : '1.0.92', license : 'MIT OR Apache-2.0') ++ ++rc = meson.get_compiler('rust') ++ ++if rc.version().version_compare('< 1.31') ++ error('Minimum rustc supported version is 1.31') ++endif ++ ++rust_args = [ ++ '--cfg', 'feature="proc-macro"', ++ '--cfg', 'feature="default"', ++ '--cfg', 'use_proc_macro', ++ '--cfg', 'wrap_proc_macro', ++] ++if rc.version().version_compare('< 1.32') ++ rust_args += ['--cfg', 'no_libprocmacro_unwind_safe'] ++endif ++if rc.version().version_compare('< 1.39') ++ rust_args += ['--cfg', 'no_bind_by_move_pattern_guard'] ++endif ++if rc.version().version_compare('< 1.44') ++ rust_args += ['--cfg', 'no_lexerror_display'] ++endif ++if rc.version().version_compare('< 1.45') ++ rust_args += ['--cfg', 'no_hygiene'] ++endif ++if rc.version().version_compare('< 1.47') ++ rust_args += ['--cfg', 'no_ident_new_raw'] ++endif ++if rc.version().version_compare('< 1.54') ++ rust_args += ['--cfg', 'no_literal_from_str'] ++endif ++if rc.version().version_compare('< 1.55') ++ rust_args += ['--cfg', 'no_group_open_close'] ++endif ++if rc.version().version_compare('< 1.57') ++ rust_args += ['--cfg', 'no_is_available'] ++endif ++if rc.version().version_compare('< 1.66') ++ rust_args += ['--cfg', 'no_source_text'] ++endif ++if rc.version().version_compare('< 1.79') ++ rust_args += [ ++ '--cfg', 'no_literal_byte_character', ++ '--cfg', 'no_literal_c_string', ++ ] ++endif ++ ++u_ind = subproject('unicode-ident-1-rs').get_variable('lib') ++ ++lib = static_library( ++ 'proc_macro2', ++ 'src/lib.rs', ++ rust_args : rust_args, ++ override_options : ['rust_std=2021', 'build.rust_std=2021'], ++ link_with : u_ind, ++ rust_abi : 'rust', ++ native : true, ++) +diff -Nru mesa-25.3.3/subprojects/proc-macro2-1.0.92/.meson-subproject-wrap-hash.txt mesa-25.3.3/subprojects/proc-macro2-1.0.92/.meson-subproject-wrap-hash.txt +--- mesa-25.3.3/subprojects/proc-macro2-1.0.92/.meson-subproject-wrap-hash.txt 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/proc-macro2-1.0.92/.meson-subproject-wrap-hash.txt 2026-05-29 13:40:56.000000000 -0500 +@@ -0,0 +1 @@ ++63d1984ff44504b8495263bea369650f4f07cad9eea900ea8ad82bf576f824ae +diff -Nru mesa-25.3.3/subprojects/proc-macro2-1.0.92/README.md mesa-25.3.3/subprojects/proc-macro2-1.0.92/README.md +--- mesa-25.3.3/subprojects/proc-macro2-1.0.92/README.md 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/proc-macro2-1.0.92/README.md 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,94 @@ ++# proc-macro2 ++ ++[github](https://github.com/dtolnay/proc-macro2) ++[crates.io](https://crates.io/crates/proc-macro2) ++[docs.rs](https://docs.rs/proc-macro2) ++[build status](https://github.com/dtolnay/proc-macro2/actions?query=branch%3Amaster) ++ ++A wrapper around the procedural macro API of the compiler's `proc_macro` crate. ++This library serves two purposes: ++ ++- **Bring proc-macro-like functionality to other contexts like build.rs and ++ main.rs.** Types from `proc_macro` are entirely specific to procedural macros ++ and cannot ever exist in code outside of a procedural macro. Meanwhile ++ `proc_macro2` types may exist anywhere including non-macro code. By developing ++ foundational libraries like [syn] and [quote] against `proc_macro2` rather ++ than `proc_macro`, the procedural macro ecosystem becomes easily applicable to ++ many other use cases and we avoid reimplementing non-macro equivalents of ++ those libraries. ++ ++- **Make procedural macros unit testable.** As a consequence of being specific ++ to procedural macros, nothing that uses `proc_macro` can be executed from a ++ unit test. In order for helper libraries or components of a macro to be ++ testable in isolation, they must be implemented using `proc_macro2`. ++ ++[syn]: https://github.com/dtolnay/syn ++[quote]: https://github.com/dtolnay/quote ++ ++## Usage ++ ++```toml ++[dependencies] ++proc-macro2 = "1.0" ++``` ++ ++The skeleton of a typical procedural macro typically looks like this: ++ ++```rust ++extern crate proc_macro; ++ ++#[proc_macro_derive(MyDerive)] ++pub fn my_derive(input: proc_macro::TokenStream) -> proc_macro::TokenStream { ++ let input = proc_macro2::TokenStream::from(input); ++ ++ let output: proc_macro2::TokenStream = { ++ /* transform input */ ++ }; ++ ++ proc_macro::TokenStream::from(output) ++} ++``` ++ ++If parsing with [Syn], you'll use [`parse_macro_input!`] instead to propagate ++parse errors correctly back to the compiler when parsing fails. ++ ++[`parse_macro_input!`]: https://docs.rs/syn/2.0/syn/macro.parse_macro_input.html ++ ++## Unstable features ++ ++The default feature set of proc-macro2 tracks the most recent stable compiler ++API. Functionality in `proc_macro` that is not yet stable is not exposed by ++proc-macro2 by default. ++ ++To opt into the additional APIs available in the most recent nightly compiler, ++the `procmacro2_semver_exempt` config flag must be passed to rustc. We will ++polyfill those nightly-only APIs back to Rust 1.56.0. As these are unstable APIs ++that track the nightly compiler, minor versions of proc-macro2 may make breaking ++changes to them at any time. ++ ++``` ++RUSTFLAGS='--cfg procmacro2_semver_exempt' cargo build ++``` ++ ++Note that this must not only be done for your crate, but for any crate that ++depends on your crate. This infectious nature is intentional, as it serves as a ++reminder that you are outside of the normal semver guarantees. ++ ++Semver exempt methods are marked as such in the proc-macro2 documentation. ++ ++
++ ++#### License ++ ++ ++Licensed under either of
Apache License, Version ++2.0 or MIT license at your option. ++ ++ ++
++ ++ ++Unless you explicitly state otherwise, any contribution intentionally submitted ++for inclusion in this crate by you, as defined in the Apache-2.0 license, shall ++be dual licensed as above, without any additional terms or conditions. ++ +diff -Nru mesa-25.3.3/subprojects/proc-macro2-1.0.92/rust-toolchain.toml mesa-25.3.3/subprojects/proc-macro2-1.0.92/rust-toolchain.toml +--- mesa-25.3.3/subprojects/proc-macro2-1.0.92/rust-toolchain.toml 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/proc-macro2-1.0.92/rust-toolchain.toml 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,2 @@ ++[toolchain] ++components = ["rust-src"] +diff -Nru mesa-25.3.3/subprojects/proc-macro2-1.0.92/src/detection.rs mesa-25.3.3/subprojects/proc-macro2-1.0.92/src/detection.rs +--- mesa-25.3.3/subprojects/proc-macro2-1.0.92/src/detection.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/proc-macro2-1.0.92/src/detection.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,75 @@ ++use core::sync::atomic::{AtomicUsize, Ordering}; ++use std::sync::Once; ++ ++static WORKS: AtomicUsize = AtomicUsize::new(0); ++static INIT: Once = Once::new(); ++ ++pub(crate) fn inside_proc_macro() -> bool { ++ match WORKS.load(Ordering::Relaxed) { ++ 1 => return false, ++ 2 => return true, ++ _ => {} ++ } ++ ++ INIT.call_once(initialize); ++ inside_proc_macro() ++} ++ ++pub(crate) fn force_fallback() { ++ WORKS.store(1, Ordering::Relaxed); ++} ++ ++pub(crate) fn unforce_fallback() { ++ initialize(); ++} ++ ++#[cfg(not(no_is_available))] ++fn initialize() { ++ let available = proc_macro::is_available(); ++ WORKS.store(available as usize + 1, Ordering::Relaxed); ++} ++ ++// Swap in a null panic hook to avoid printing "thread panicked" to stderr, ++// then use catch_unwind to determine whether the compiler's proc_macro is ++// working. When proc-macro2 is used from outside of a procedural macro all ++// of the proc_macro crate's APIs currently panic. ++// ++// The Once is to prevent the possibility of this ordering: ++// ++// thread 1 calls take_hook, gets the user's original hook ++// thread 1 calls set_hook with the null hook ++// thread 2 calls take_hook, thinks null hook is the original hook ++// thread 2 calls set_hook with the null hook ++// thread 1 calls set_hook with the actual original hook ++// thread 2 calls set_hook with what it thinks is the original hook ++// ++// in which the user's hook has been lost. ++// ++// There is still a race condition where a panic in a different thread can ++// happen during the interval that the user's original panic hook is ++// unregistered such that their hook is incorrectly not called. This is ++// sufficiently unlikely and less bad than printing panic messages to stderr ++// on correct use of this crate. Maybe there is a libstd feature request ++// here. For now, if a user needs to guarantee that this failure mode does ++// not occur, they need to call e.g. `proc_macro2::Span::call_site()` from ++// the main thread before launching any other threads. ++#[cfg(no_is_available)] ++fn initialize() { ++ use std::panic::{self, PanicInfo}; ++ ++ type PanicHook = dyn Fn(&PanicInfo) + Sync + Send + 'static; ++ ++ let null_hook: Box = Box::new(|_panic_info| { /* ignore */ }); ++ let sanity_check = &*null_hook as *const PanicHook; ++ let original_hook = panic::take_hook(); ++ panic::set_hook(null_hook); ++ ++ let works = panic::catch_unwind(proc_macro::Span::call_site).is_ok(); ++ WORKS.store(works as usize + 1, Ordering::Relaxed); ++ ++ let hopefully_null_hook = panic::take_hook(); ++ panic::set_hook(original_hook); ++ if sanity_check != &*hopefully_null_hook { ++ panic!("observed race condition in proc_macro2::inside_proc_macro"); ++ } ++} +diff -Nru mesa-25.3.3/subprojects/proc-macro2-1.0.92/src/extra.rs mesa-25.3.3/subprojects/proc-macro2-1.0.92/src/extra.rs +--- mesa-25.3.3/subprojects/proc-macro2-1.0.92/src/extra.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/proc-macro2-1.0.92/src/extra.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,151 @@ ++//! Items which do not have a correspondence to any API in the proc_macro crate, ++//! but are necessary to include in proc-macro2. ++ ++use crate::fallback; ++use crate::imp; ++use crate::marker::{ProcMacroAutoTraits, MARKER}; ++use crate::Span; ++use core::fmt::{self, Debug}; ++ ++/// Invalidate any `proc_macro2::Span` that exist on the current thread. ++/// ++/// The implementation of `Span` uses thread-local data structures and this ++/// function clears them. Calling any method on a `Span` on the current thread ++/// created prior to the invalidation will return incorrect values or crash. ++/// ++/// This function is useful for programs that process more than 232 ++/// bytes of Rust source code on the same thread. Just like rustc, proc-macro2 ++/// uses 32-bit source locations, and these wrap around when the total source ++/// code processed by the same thread exceeds 232 bytes (4 ++/// gigabytes). After a wraparound, `Span` methods such as `source_text()` can ++/// return wrong data. ++/// ++/// # Example ++/// ++/// As of late 2023, there is 200 GB of Rust code published on crates.io. ++/// Looking at just the newest version of every crate, it is 16 GB of code. So a ++/// workload that involves parsing it all would overflow a 32-bit source ++/// location unless spans are being invalidated. ++/// ++/// ``` ++/// use flate2::read::GzDecoder; ++/// use std::ffi::OsStr; ++/// use std::io::{BufReader, Read}; ++/// use std::str::FromStr; ++/// use tar::Archive; ++/// ++/// rayon::scope(|s| { ++/// for krate in every_version_of_every_crate() { ++/// s.spawn(move |_| { ++/// proc_macro2::extra::invalidate_current_thread_spans(); ++/// ++/// let reader = BufReader::new(krate); ++/// let tar = GzDecoder::new(reader); ++/// let mut archive = Archive::new(tar); ++/// for entry in archive.entries().unwrap() { ++/// let mut entry = entry.unwrap(); ++/// let path = entry.path().unwrap(); ++/// if path.extension() != Some(OsStr::new("rs")) { ++/// continue; ++/// } ++/// let mut content = String::new(); ++/// entry.read_to_string(&mut content).unwrap(); ++/// match proc_macro2::TokenStream::from_str(&content) { ++/// Ok(tokens) => {/* ... */}, ++/// Err(_) => continue, ++/// } ++/// } ++/// }); ++/// } ++/// }); ++/// # ++/// # fn every_version_of_every_crate() -> Vec { ++/// # Vec::new() ++/// # } ++/// ``` ++/// ++/// # Panics ++/// ++/// This function is not applicable to and will panic if called from a ++/// procedural macro. ++#[cfg(span_locations)] ++#[cfg_attr(docsrs, doc(cfg(feature = "span-locations")))] ++pub fn invalidate_current_thread_spans() { ++ crate::imp::invalidate_current_thread_spans(); ++} ++ ++/// An object that holds a [`Group`]'s `span_open()` and `span_close()` together ++/// in a more compact representation than holding those 2 spans individually. ++/// ++/// [`Group`]: crate::Group ++#[derive(Copy, Clone)] ++pub struct DelimSpan { ++ inner: DelimSpanEnum, ++ _marker: ProcMacroAutoTraits, ++} ++ ++#[derive(Copy, Clone)] ++enum DelimSpanEnum { ++ #[cfg(wrap_proc_macro)] ++ Compiler { ++ join: proc_macro::Span, ++ open: proc_macro::Span, ++ close: proc_macro::Span, ++ }, ++ Fallback(fallback::Span), ++} ++ ++impl DelimSpan { ++ pub(crate) fn new(group: &imp::Group) -> Self { ++ #[cfg(wrap_proc_macro)] ++ let inner = match group { ++ imp::Group::Compiler(group) => DelimSpanEnum::Compiler { ++ join: group.span(), ++ open: group.span_open(), ++ close: group.span_close(), ++ }, ++ imp::Group::Fallback(group) => DelimSpanEnum::Fallback(group.span()), ++ }; ++ ++ #[cfg(not(wrap_proc_macro))] ++ let inner = DelimSpanEnum::Fallback(group.span()); ++ ++ DelimSpan { ++ inner, ++ _marker: MARKER, ++ } ++ } ++ ++ /// Returns a span covering the entire delimited group. ++ pub fn join(&self) -> Span { ++ match &self.inner { ++ #[cfg(wrap_proc_macro)] ++ DelimSpanEnum::Compiler { join, .. } => Span::_new(imp::Span::Compiler(*join)), ++ DelimSpanEnum::Fallback(span) => Span::_new_fallback(*span), ++ } ++ } ++ ++ /// Returns a span for the opening punctuation of the group only. ++ pub fn open(&self) -> Span { ++ match &self.inner { ++ #[cfg(wrap_proc_macro)] ++ DelimSpanEnum::Compiler { open, .. } => Span::_new(imp::Span::Compiler(*open)), ++ DelimSpanEnum::Fallback(span) => Span::_new_fallback(span.first_byte()), ++ } ++ } ++ ++ /// Returns a span for the closing punctuation of the group only. ++ pub fn close(&self) -> Span { ++ match &self.inner { ++ #[cfg(wrap_proc_macro)] ++ DelimSpanEnum::Compiler { close, .. } => Span::_new(imp::Span::Compiler(*close)), ++ DelimSpanEnum::Fallback(span) => Span::_new_fallback(span.last_byte()), ++ } ++ } ++} ++ ++impl Debug for DelimSpan { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ Debug::fmt(&self.join(), f) ++ } ++} +diff -Nru mesa-25.3.3/subprojects/proc-macro2-1.0.92/src/fallback.rs mesa-25.3.3/subprojects/proc-macro2-1.0.92/src/fallback.rs +--- mesa-25.3.3/subprojects/proc-macro2-1.0.92/src/fallback.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/proc-macro2-1.0.92/src/fallback.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,1266 @@ ++#[cfg(wrap_proc_macro)] ++use crate::imp; ++#[cfg(span_locations)] ++use crate::location::LineColumn; ++use crate::parse::{self, Cursor}; ++use crate::rcvec::{RcVec, RcVecBuilder, RcVecIntoIter, RcVecMut}; ++use crate::{Delimiter, Spacing, TokenTree}; ++#[cfg(all(span_locations, not(fuzzing)))] ++use alloc::collections::BTreeMap; ++#[cfg(all(span_locations, not(fuzzing)))] ++use core::cell::RefCell; ++#[cfg(span_locations)] ++use core::cmp; ++use core::fmt::{self, Debug, Display, Write}; ++use core::mem::ManuallyDrop; ++#[cfg(span_locations)] ++use core::ops::Range; ++use core::ops::RangeBounds; ++use core::ptr; ++use core::str; ++#[cfg(feature = "proc-macro")] ++use core::str::FromStr; ++use std::ffi::CStr; ++#[cfg(wrap_proc_macro)] ++use std::panic; ++#[cfg(procmacro2_semver_exempt)] ++use std::path::PathBuf; ++ ++/// Force use of proc-macro2's fallback implementation of the API for now, even ++/// if the compiler's implementation is available. ++pub fn force() { ++ #[cfg(wrap_proc_macro)] ++ crate::detection::force_fallback(); ++} ++ ++/// Resume using the compiler's implementation of the proc macro API if it is ++/// available. ++pub fn unforce() { ++ #[cfg(wrap_proc_macro)] ++ crate::detection::unforce_fallback(); ++} ++ ++#[derive(Clone)] ++pub(crate) struct TokenStream { ++ inner: RcVec, ++} ++ ++#[derive(Debug)] ++pub(crate) struct LexError { ++ pub(crate) span: Span, ++} ++ ++impl LexError { ++ pub(crate) fn span(&self) -> Span { ++ self.span ++ } ++ ++ pub(crate) fn call_site() -> Self { ++ LexError { ++ span: Span::call_site(), ++ } ++ } ++} ++ ++impl TokenStream { ++ pub(crate) fn new() -> Self { ++ TokenStream { ++ inner: RcVecBuilder::new().build(), ++ } ++ } ++ ++ pub(crate) fn from_str_checked(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()); ++ } ++ ++ parse::token_stream(cursor) ++ } ++ ++ #[cfg(feature = "proc-macro")] ++ pub(crate) fn from_str_unchecked(src: &str) -> Self { ++ Self::from_str_checked(src).unwrap() ++ } ++ ++ pub(crate) fn is_empty(&self) -> bool { ++ self.inner.len() == 0 ++ } ++ ++ fn take_inner(self) -> RcVecBuilder { ++ let nodrop = ManuallyDrop::new(self); ++ unsafe { ptr::read(&nodrop.inner) }.make_owned() ++ } ++} ++ ++fn push_token_from_proc_macro(mut vec: RcVecMut, token: TokenTree) { ++ // https://github.com/dtolnay/proc-macro2/issues/235 ++ match token { ++ TokenTree::Literal(crate::Literal { ++ #[cfg(wrap_proc_macro)] ++ inner: crate::imp::Literal::Fallback(literal), ++ #[cfg(not(wrap_proc_macro))] ++ inner: literal, ++ .. ++ }) if literal.repr.starts_with('-') => { ++ push_negative_literal(vec, literal); ++ } ++ _ => vec.push(token), ++ } ++ ++ #[cold] ++ fn push_negative_literal(mut vec: RcVecMut, mut literal: Literal) { ++ literal.repr.remove(0); ++ let mut punct = crate::Punct::new('-', Spacing::Alone); ++ punct.set_span(crate::Span::_new_fallback(literal.span)); ++ vec.push(TokenTree::Punct(punct)); ++ vec.push(TokenTree::Literal(crate::Literal::_new_fallback(literal))); ++ } ++} ++ ++// Nonrecursive to prevent stack overflow. ++impl Drop for TokenStream { ++ fn drop(&mut self) { ++ let mut inner = match self.inner.get_mut() { ++ Some(inner) => inner, ++ None => return, ++ }; ++ while let Some(token) = inner.pop() { ++ let group = match token { ++ TokenTree::Group(group) => group.inner, ++ _ => continue, ++ }; ++ #[cfg(wrap_proc_macro)] ++ let group = match group { ++ crate::imp::Group::Fallback(group) => group, ++ crate::imp::Group::Compiler(_) => continue, ++ }; ++ inner.extend(group.stream.take_inner()); ++ } ++ } ++} ++ ++pub(crate) struct TokenStreamBuilder { ++ inner: RcVecBuilder, ++} ++ ++impl TokenStreamBuilder { ++ pub(crate) fn new() -> Self { ++ TokenStreamBuilder { ++ inner: RcVecBuilder::new(), ++ } ++ } ++ ++ pub(crate) fn with_capacity(cap: usize) -> Self { ++ TokenStreamBuilder { ++ inner: RcVecBuilder::with_capacity(cap), ++ } ++ } ++ ++ pub(crate) fn push_token_from_parser(&mut self, tt: TokenTree) { ++ self.inner.push(tt); ++ } ++ ++ pub(crate) fn build(self) -> TokenStream { ++ TokenStream { ++ inner: self.inner.build(), ++ } ++ } ++} ++ ++#[cfg(span_locations)] ++fn get_cursor(src: &str) -> Cursor { ++ #[cfg(fuzzing)] ++ return Cursor { rest: src, off: 1 }; ++ ++ // Create a dummy file & add it to the source map ++ #[cfg(not(fuzzing))] ++ SOURCE_MAP.with(|sm| { ++ let mut sm = sm.borrow_mut(); ++ let span = sm.add_file(src); ++ Cursor { ++ rest: src, ++ off: span.lo, ++ } ++ }) ++} ++ ++#[cfg(not(span_locations))] ++fn get_cursor(src: &str) -> Cursor { ++ Cursor { rest: src } ++} ++ ++impl Display for LexError { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.write_str("cannot parse string into token stream") ++ } ++} ++ ++impl Display for TokenStream { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ let mut joint = false; ++ for (i, tt) in self.inner.iter().enumerate() { ++ if i != 0 && !joint { ++ write!(f, " ")?; ++ } ++ joint = false; ++ match tt { ++ TokenTree::Group(tt) => Display::fmt(tt, f), ++ TokenTree::Ident(tt) => Display::fmt(tt, f), ++ TokenTree::Punct(tt) => { ++ joint = tt.spacing() == Spacing::Joint; ++ Display::fmt(tt, f) ++ } ++ TokenTree::Literal(tt) => Display::fmt(tt, f), ++ }?; ++ } ++ ++ Ok(()) ++ } ++} ++ ++impl Debug for TokenStream { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.write_str("TokenStream ")?; ++ f.debug_list().entries(self.clone()).finish() ++ } ++} ++ ++#[cfg(feature = "proc-macro")] ++impl From for TokenStream { ++ fn from(inner: proc_macro::TokenStream) -> Self { ++ TokenStream::from_str_unchecked(&inner.to_string()) ++ } ++} ++ ++#[cfg(feature = "proc-macro")] ++impl From for proc_macro::TokenStream { ++ fn from(inner: TokenStream) -> Self { ++ proc_macro::TokenStream::from_str_unchecked(&inner.to_string()) ++ } ++} ++ ++impl From for TokenStream { ++ fn from(tree: TokenTree) -> Self { ++ let mut stream = RcVecBuilder::new(); ++ push_token_from_proc_macro(stream.as_mut(), tree); ++ TokenStream { ++ inner: stream.build(), ++ } ++ } ++} ++ ++impl FromIterator for TokenStream { ++ fn from_iter>(tokens: I) -> Self { ++ let mut stream = TokenStream::new(); ++ stream.extend(tokens); ++ stream ++ } ++} ++ ++impl FromIterator for TokenStream { ++ fn from_iter>(streams: I) -> Self { ++ let mut v = RcVecBuilder::new(); ++ ++ for stream in streams { ++ v.extend(stream.take_inner()); ++ } ++ ++ TokenStream { inner: v.build() } ++ } ++} ++ ++impl Extend for TokenStream { ++ fn extend>(&mut self, tokens: I) { ++ let mut vec = self.inner.make_mut(); ++ tokens ++ .into_iter() ++ .for_each(|token| push_token_from_proc_macro(vec.as_mut(), token)); ++ } ++} ++ ++impl Extend for TokenStream { ++ fn extend>(&mut self, streams: I) { ++ self.inner.make_mut().extend(streams.into_iter().flatten()); ++ } ++} ++ ++pub(crate) type TokenTreeIter = RcVecIntoIter; ++ ++impl IntoIterator for TokenStream { ++ type Item = TokenTree; ++ type IntoIter = TokenTreeIter; ++ ++ fn into_iter(self) -> TokenTreeIter { ++ self.take_inner().into_iter() ++ } ++} ++ ++#[cfg(procmacro2_semver_exempt)] ++#[derive(Clone, PartialEq, Eq)] ++pub(crate) struct SourceFile { ++ path: PathBuf, ++} ++ ++#[cfg(procmacro2_semver_exempt)] ++impl SourceFile { ++ /// Get the path to this source file as a string. ++ pub(crate) fn path(&self) -> PathBuf { ++ self.path.clone() ++ } ++ ++ pub(crate) fn is_real(&self) -> bool { ++ false ++ } ++} ++ ++#[cfg(procmacro2_semver_exempt)] ++impl Debug for SourceFile { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.debug_struct("SourceFile") ++ .field("path", &self.path()) ++ .field("is_real", &self.is_real()) ++ .finish() ++ } ++} ++ ++#[cfg(all(span_locations, not(fuzzing)))] ++thread_local! { ++ static SOURCE_MAP: RefCell = RefCell::new(SourceMap { ++ // Start with a single dummy file which all call_site() and def_site() ++ // spans reference. ++ files: vec![FileInfo { ++ source_text: String::new(), ++ span: Span { lo: 0, hi: 0 }, ++ lines: vec![0], ++ char_index_to_byte_offset: BTreeMap::new(), ++ }], ++ }); ++} ++ ++#[cfg(span_locations)] ++pub(crate) fn invalidate_current_thread_spans() { ++ #[cfg(not(fuzzing))] ++ SOURCE_MAP.with(|sm| sm.borrow_mut().files.truncate(1)); ++} ++ ++#[cfg(all(span_locations, not(fuzzing)))] ++struct FileInfo { ++ source_text: String, ++ span: Span, ++ lines: Vec, ++ char_index_to_byte_offset: BTreeMap, ++} ++ ++#[cfg(all(span_locations, not(fuzzing)))] ++impl FileInfo { ++ fn offset_line_column(&self, offset: usize) -> LineColumn { ++ assert!(self.span_within(Span { ++ lo: offset as u32, ++ hi: offset as u32, ++ })); ++ let offset = offset - self.span.lo as usize; ++ match self.lines.binary_search(&offset) { ++ Ok(found) => LineColumn { ++ line: found + 1, ++ column: 0, ++ }, ++ Err(idx) => LineColumn { ++ line: idx, ++ column: offset - self.lines[idx - 1], ++ }, ++ } ++ } ++ ++ fn span_within(&self, span: Span) -> bool { ++ span.lo >= self.span.lo && span.hi <= self.span.hi ++ } ++ ++ fn byte_range(&mut self, span: Span) -> Range { ++ let lo_char = (span.lo - self.span.lo) as usize; ++ ++ // Look up offset of the largest already-computed char index that is ++ // less than or equal to the current requested one. We resume counting ++ // chars from that point. ++ let (&last_char_index, &last_byte_offset) = self ++ .char_index_to_byte_offset ++ .range(..=lo_char) ++ .next_back() ++ .unwrap_or((&0, &0)); ++ ++ let lo_byte = if last_char_index == lo_char { ++ last_byte_offset ++ } else { ++ let total_byte_offset = match self.source_text[last_byte_offset..] ++ .char_indices() ++ .nth(lo_char - last_char_index) ++ { ++ Some((additional_offset, _ch)) => last_byte_offset + additional_offset, ++ None => self.source_text.len(), ++ }; ++ self.char_index_to_byte_offset ++ .insert(lo_char, total_byte_offset); ++ total_byte_offset ++ }; ++ ++ let trunc_lo = &self.source_text[lo_byte..]; ++ let char_len = (span.hi - span.lo) as usize; ++ lo_byte..match trunc_lo.char_indices().nth(char_len) { ++ Some((offset, _ch)) => lo_byte + offset, ++ None => self.source_text.len(), ++ } ++ } ++ ++ fn source_text(&mut self, span: Span) -> String { ++ let byte_range = self.byte_range(span); ++ self.source_text[byte_range].to_owned() ++ } ++} ++ ++/// Computes the offsets of each line in the given source string ++/// and the total number of characters ++#[cfg(all(span_locations, not(fuzzing)))] ++fn lines_offsets(s: &str) -> (usize, Vec) { ++ let mut lines = vec![0]; ++ let mut total = 0; ++ ++ for ch in s.chars() { ++ total += 1; ++ if ch == '\n' { ++ lines.push(total); ++ } ++ } ++ ++ (total, lines) ++} ++ ++#[cfg(all(span_locations, not(fuzzing)))] ++struct SourceMap { ++ files: Vec, ++} ++ ++#[cfg(all(span_locations, not(fuzzing)))] ++impl SourceMap { ++ fn next_start_pos(&self) -> u32 { ++ // Add 1 so there's always space between files. ++ // ++ // We'll always have at least 1 file, as we initialize our files list ++ // with a dummy file. ++ self.files.last().unwrap().span.hi + 1 ++ } ++ ++ fn add_file(&mut self, src: &str) -> Span { ++ let (len, lines) = lines_offsets(src); ++ let lo = self.next_start_pos(); ++ let span = Span { ++ lo, ++ hi: lo + (len as u32), ++ }; ++ ++ self.files.push(FileInfo { ++ source_text: src.to_owned(), ++ span, ++ lines, ++ // Populated lazily by source_text(). ++ char_index_to_byte_offset: BTreeMap::new(), ++ }); ++ ++ span ++ } ++ ++ #[cfg(procmacro2_semver_exempt)] ++ fn filepath(&self, span: Span) -> PathBuf { ++ for (i, file) in self.files.iter().enumerate() { ++ if file.span_within(span) { ++ return PathBuf::from(if i == 0 { ++ "".to_owned() ++ } else { ++ format!("", i) ++ }); ++ } ++ } ++ unreachable!("Invalid span with no related FileInfo!"); ++ } ++ ++ fn fileinfo(&self, span: Span) -> &FileInfo { ++ for file in &self.files { ++ if file.span_within(span) { ++ return file; ++ } ++ } ++ unreachable!("Invalid span with no related FileInfo!"); ++ } ++ ++ fn fileinfo_mut(&mut self, span: Span) -> &mut FileInfo { ++ for file in &mut self.files { ++ if file.span_within(span) { ++ return file; ++ } ++ } ++ unreachable!("Invalid span with no related FileInfo!"); ++ } ++} ++ ++#[derive(Clone, Copy, PartialEq, Eq)] ++pub(crate) struct Span { ++ #[cfg(span_locations)] ++ pub(crate) lo: u32, ++ #[cfg(span_locations)] ++ pub(crate) hi: u32, ++} ++ ++impl Span { ++ #[cfg(not(span_locations))] ++ pub(crate) fn call_site() -> Self { ++ Span {} ++ } ++ ++ #[cfg(span_locations)] ++ pub(crate) fn call_site() -> Self { ++ Span { lo: 0, hi: 0 } ++ } ++ ++ pub(crate) fn mixed_site() -> Self { ++ Span::call_site() ++ } ++ ++ #[cfg(procmacro2_semver_exempt)] ++ pub(crate) fn def_site() -> Self { ++ Span::call_site() ++ } ++ ++ pub(crate) fn resolved_at(&self, _other: Span) -> Span { ++ // Stable spans consist only of line/column information, so ++ // `resolved_at` and `located_at` only select which span the ++ // caller wants line/column information from. ++ *self ++ } ++ ++ pub(crate) fn located_at(&self, other: Span) -> Span { ++ other ++ } ++ ++ #[cfg(procmacro2_semver_exempt)] ++ pub(crate) fn source_file(&self) -> SourceFile { ++ #[cfg(fuzzing)] ++ return SourceFile { ++ path: PathBuf::from(""), ++ }; ++ ++ #[cfg(not(fuzzing))] ++ SOURCE_MAP.with(|sm| { ++ let sm = sm.borrow(); ++ let path = sm.filepath(*self); ++ SourceFile { path } ++ }) ++ } ++ ++ #[cfg(span_locations)] ++ pub(crate) fn byte_range(&self) -> Range { ++ #[cfg(fuzzing)] ++ return 0..0; ++ ++ #[cfg(not(fuzzing))] ++ { ++ if self.is_call_site() { ++ 0..0 ++ } else { ++ SOURCE_MAP.with(|sm| sm.borrow_mut().fileinfo_mut(*self).byte_range(*self)) ++ } ++ } ++ } ++ ++ #[cfg(span_locations)] ++ pub(crate) fn start(&self) -> LineColumn { ++ #[cfg(fuzzing)] ++ return LineColumn { line: 0, column: 0 }; ++ ++ #[cfg(not(fuzzing))] ++ SOURCE_MAP.with(|sm| { ++ let sm = sm.borrow(); ++ let fi = sm.fileinfo(*self); ++ fi.offset_line_column(self.lo as usize) ++ }) ++ } ++ ++ #[cfg(span_locations)] ++ pub(crate) fn end(&self) -> LineColumn { ++ #[cfg(fuzzing)] ++ return LineColumn { line: 0, column: 0 }; ++ ++ #[cfg(not(fuzzing))] ++ SOURCE_MAP.with(|sm| { ++ let sm = sm.borrow(); ++ let fi = sm.fileinfo(*self); ++ fi.offset_line_column(self.hi as usize) ++ }) ++ } ++ ++ #[cfg(not(span_locations))] ++ pub(crate) fn join(&self, _other: Span) -> Option { ++ Some(Span {}) ++ } ++ ++ #[cfg(span_locations)] ++ pub(crate) fn join(&self, other: Span) -> Option { ++ #[cfg(fuzzing)] ++ return { ++ let _ = other; ++ None ++ }; ++ ++ #[cfg(not(fuzzing))] ++ SOURCE_MAP.with(|sm| { ++ let sm = sm.borrow(); ++ // If `other` is not within the same FileInfo as us, return None. ++ if !sm.fileinfo(*self).span_within(other) { ++ return None; ++ } ++ Some(Span { ++ lo: cmp::min(self.lo, other.lo), ++ hi: cmp::max(self.hi, other.hi), ++ }) ++ }) ++ } ++ ++ #[cfg(not(span_locations))] ++ pub(crate) fn source_text(&self) -> Option { ++ None ++ } ++ ++ #[cfg(span_locations)] ++ pub(crate) fn source_text(&self) -> Option { ++ #[cfg(fuzzing)] ++ return None; ++ ++ #[cfg(not(fuzzing))] ++ { ++ if self.is_call_site() { ++ None ++ } else { ++ Some(SOURCE_MAP.with(|sm| sm.borrow_mut().fileinfo_mut(*self).source_text(*self))) ++ } ++ } ++ } ++ ++ #[cfg(not(span_locations))] ++ pub(crate) fn first_byte(self) -> Self { ++ self ++ } ++ ++ #[cfg(span_locations)] ++ pub(crate) fn first_byte(self) -> Self { ++ Span { ++ lo: self.lo, ++ hi: cmp::min(self.lo.saturating_add(1), self.hi), ++ } ++ } ++ ++ #[cfg(not(span_locations))] ++ pub(crate) fn last_byte(self) -> Self { ++ self ++ } ++ ++ #[cfg(span_locations)] ++ pub(crate) fn last_byte(self) -> Self { ++ Span { ++ lo: cmp::max(self.hi.saturating_sub(1), self.lo), ++ hi: self.hi, ++ } ++ } ++ ++ #[cfg(span_locations)] ++ fn is_call_site(&self) -> bool { ++ self.lo == 0 && self.hi == 0 ++ } ++} ++ ++impl Debug for Span { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ #[cfg(span_locations)] ++ return write!(f, "bytes({}..{})", self.lo, self.hi); ++ ++ #[cfg(not(span_locations))] ++ write!(f, "Span") ++ } ++} ++ ++pub(crate) fn debug_span_field_if_nontrivial(debug: &mut fmt::DebugStruct, span: Span) { ++ #[cfg(span_locations)] ++ { ++ if span.is_call_site() { ++ return; ++ } ++ } ++ ++ if cfg!(span_locations) { ++ debug.field("span", &span); ++ } ++} ++ ++#[derive(Clone)] ++pub(crate) struct Group { ++ delimiter: Delimiter, ++ stream: TokenStream, ++ span: Span, ++} ++ ++impl Group { ++ pub(crate) fn new(delimiter: Delimiter, stream: TokenStream) -> Self { ++ Group { ++ delimiter, ++ stream, ++ span: Span::call_site(), ++ } ++ } ++ ++ pub(crate) fn delimiter(&self) -> Delimiter { ++ self.delimiter ++ } ++ ++ pub(crate) fn stream(&self) -> TokenStream { ++ self.stream.clone() ++ } ++ ++ pub(crate) fn span(&self) -> Span { ++ self.span ++ } ++ ++ pub(crate) fn span_open(&self) -> Span { ++ self.span.first_byte() ++ } ++ ++ pub(crate) fn span_close(&self) -> Span { ++ self.span.last_byte() ++ } ++ ++ pub(crate) fn set_span(&mut self, span: Span) { ++ self.span = span; ++ } ++} ++ ++impl Display for Group { ++ // We attempt to match libproc_macro's formatting. ++ // Empty parens: () ++ // Nonempty parens: (...) ++ // Empty brackets: [] ++ // Nonempty brackets: [...] ++ // Empty braces: { } ++ // Nonempty braces: { ... } ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ let (open, close) = match self.delimiter { ++ Delimiter::Parenthesis => ("(", ")"), ++ Delimiter::Brace => ("{ ", "}"), ++ Delimiter::Bracket => ("[", "]"), ++ Delimiter::None => ("", ""), ++ }; ++ ++ f.write_str(open)?; ++ Display::fmt(&self.stream, f)?; ++ if self.delimiter == Delimiter::Brace && !self.stream.inner.is_empty() { ++ f.write_str(" ")?; ++ } ++ f.write_str(close)?; ++ ++ Ok(()) ++ } ++} ++ ++impl Debug for Group { ++ fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { ++ let mut debug = fmt.debug_struct("Group"); ++ debug.field("delimiter", &self.delimiter); ++ debug.field("stream", &self.stream); ++ debug_span_field_if_nontrivial(&mut debug, self.span); ++ debug.finish() ++ } ++} ++ ++#[derive(Clone)] ++pub(crate) struct Ident { ++ sym: Box, ++ span: Span, ++ raw: bool, ++} ++ ++impl Ident { ++ #[track_caller] ++ pub(crate) fn new_checked(string: &str, span: Span) -> Self { ++ validate_ident(string); ++ Ident::new_unchecked(string, span) ++ } ++ ++ pub(crate) fn new_unchecked(string: &str, span: Span) -> Self { ++ Ident { ++ sym: Box::from(string), ++ span, ++ raw: false, ++ } ++ } ++ ++ #[track_caller] ++ pub(crate) fn new_raw_checked(string: &str, span: Span) -> Self { ++ validate_ident_raw(string); ++ Ident::new_raw_unchecked(string, span) ++ } ++ ++ pub(crate) fn new_raw_unchecked(string: &str, span: Span) -> Self { ++ Ident { ++ sym: Box::from(string), ++ span, ++ raw: true, ++ } ++ } ++ ++ pub(crate) fn span(&self) -> Span { ++ self.span ++ } ++ ++ pub(crate) fn set_span(&mut self, span: Span) { ++ self.span = span; ++ } ++} ++ ++pub(crate) fn is_ident_start(c: char) -> bool { ++ c == '_' || unicode_ident::is_xid_start(c) ++} ++ ++pub(crate) fn is_ident_continue(c: char) -> bool { ++ unicode_ident::is_xid_continue(c) ++} ++ ++#[track_caller] ++fn validate_ident(string: &str) { ++ if string.is_empty() { ++ panic!("Ident is not allowed to be empty; use Option"); ++ } ++ ++ if string.bytes().all(|digit| b'0' <= digit && digit <= b'9') { ++ panic!("Ident cannot be a number; use Literal instead"); ++ } ++ ++ fn ident_ok(string: &str) -> bool { ++ let mut chars = string.chars(); ++ let first = chars.next().unwrap(); ++ if !is_ident_start(first) { ++ return false; ++ } ++ for ch in chars { ++ if !is_ident_continue(ch) { ++ return false; ++ } ++ } ++ true ++ } ++ ++ if !ident_ok(string) { ++ panic!("{:?} is not a valid Ident", string); ++ } ++} ++ ++#[track_caller] ++fn validate_ident_raw(string: &str) { ++ validate_ident(string); ++ ++ match string { ++ "_" | "super" | "self" | "Self" | "crate" => { ++ panic!("`r#{}` cannot be a raw identifier", string); ++ } ++ _ => {} ++ } ++} ++ ++impl PartialEq for Ident { ++ fn eq(&self, other: &Ident) -> bool { ++ self.sym == other.sym && self.raw == other.raw ++ } ++} ++ ++impl PartialEq for Ident ++where ++ T: ?Sized + AsRef, ++{ ++ fn eq(&self, other: &T) -> bool { ++ let other = other.as_ref(); ++ if self.raw { ++ other.starts_with("r#") && *self.sym == other[2..] ++ } else { ++ *self.sym == *other ++ } ++ } ++} ++ ++impl Display for Ident { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ if self.raw { ++ f.write_str("r#")?; ++ } ++ Display::fmt(&self.sym, f) ++ } ++} ++ ++#[allow(clippy::missing_fields_in_debug)] ++impl Debug for Ident { ++ // Ident(proc_macro), Ident(r#union) ++ #[cfg(not(span_locations))] ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ let mut debug = f.debug_tuple("Ident"); ++ debug.field(&format_args!("{}", self)); ++ debug.finish() ++ } ++ ++ // Ident { ++ // sym: proc_macro, ++ // span: bytes(128..138) ++ // } ++ #[cfg(span_locations)] ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ let mut debug = f.debug_struct("Ident"); ++ debug.field("sym", &format_args!("{}", self)); ++ debug_span_field_if_nontrivial(&mut debug, self.span); ++ debug.finish() ++ } ++} ++ ++#[derive(Clone)] ++pub(crate) struct Literal { ++ pub(crate) repr: String, ++ span: Span, ++} ++ ++macro_rules! suffixed_numbers { ++ ($($name:ident => $kind:ident,)*) => ($( ++ pub(crate) fn $name(n: $kind) -> Literal { ++ Literal::_new(format!(concat!("{}", stringify!($kind)), n)) ++ } ++ )*) ++} ++ ++macro_rules! unsuffixed_numbers { ++ ($($name:ident => $kind:ident,)*) => ($( ++ pub(crate) fn $name(n: $kind) -> Literal { ++ Literal::_new(n.to_string()) ++ } ++ )*) ++} ++ ++impl Literal { ++ pub(crate) fn _new(repr: String) -> Self { ++ Literal { ++ repr, ++ span: Span::call_site(), ++ } ++ } ++ ++ pub(crate) fn from_str_checked(repr: &str) -> Result { ++ let mut cursor = get_cursor(repr); ++ #[cfg(span_locations)] ++ let lo = cursor.off; ++ ++ let negative = cursor.starts_with_char('-'); ++ if negative { ++ cursor = cursor.advance(1); ++ if !cursor.starts_with_fn(|ch| ch.is_ascii_digit()) { ++ return Err(LexError::call_site()); ++ } ++ } ++ ++ if let Ok((rest, mut literal)) = parse::literal(cursor) { ++ if rest.is_empty() { ++ if negative { ++ literal.repr.insert(0, '-'); ++ } ++ literal.span = Span { ++ #[cfg(span_locations)] ++ lo, ++ #[cfg(span_locations)] ++ hi: rest.off, ++ }; ++ return Ok(literal); ++ } ++ } ++ Err(LexError::call_site()) ++ } ++ ++ pub(crate) unsafe fn from_str_unchecked(repr: &str) -> Self { ++ Literal::_new(repr.to_owned()) ++ } ++ ++ suffixed_numbers! { ++ u8_suffixed => u8, ++ u16_suffixed => u16, ++ u32_suffixed => u32, ++ u64_suffixed => u64, ++ u128_suffixed => u128, ++ usize_suffixed => usize, ++ i8_suffixed => i8, ++ i16_suffixed => i16, ++ i32_suffixed => i32, ++ i64_suffixed => i64, ++ i128_suffixed => i128, ++ isize_suffixed => isize, ++ ++ f32_suffixed => f32, ++ f64_suffixed => f64, ++ } ++ ++ unsuffixed_numbers! { ++ u8_unsuffixed => u8, ++ u16_unsuffixed => u16, ++ u32_unsuffixed => u32, ++ u64_unsuffixed => u64, ++ u128_unsuffixed => u128, ++ usize_unsuffixed => usize, ++ i8_unsuffixed => i8, ++ i16_unsuffixed => i16, ++ i32_unsuffixed => i32, ++ i64_unsuffixed => i64, ++ i128_unsuffixed => i128, ++ isize_unsuffixed => isize, ++ } ++ ++ pub(crate) fn f32_unsuffixed(f: f32) -> Literal { ++ let mut s = f.to_string(); ++ if !s.contains('.') { ++ s.push_str(".0"); ++ } ++ Literal::_new(s) ++ } ++ ++ pub(crate) fn f64_unsuffixed(f: f64) -> Literal { ++ let mut s = f.to_string(); ++ if !s.contains('.') { ++ s.push_str(".0"); ++ } ++ Literal::_new(s) ++ } ++ ++ pub(crate) fn string(string: &str) -> Literal { ++ let mut repr = String::with_capacity(string.len() + 2); ++ repr.push('"'); ++ escape_utf8(string, &mut repr); ++ repr.push('"'); ++ Literal::_new(repr) ++ } ++ ++ pub(crate) fn character(ch: char) -> Literal { ++ let mut repr = String::new(); ++ repr.push('\''); ++ if ch == '"' { ++ // escape_debug turns this into '\"' which is unnecessary. ++ repr.push(ch); ++ } else { ++ repr.extend(ch.escape_debug()); ++ } ++ repr.push('\''); ++ Literal::_new(repr) ++ } ++ ++ pub(crate) fn byte_character(byte: u8) -> Literal { ++ let mut repr = "b'".to_string(); ++ #[allow(clippy::match_overlapping_arm)] ++ match byte { ++ b'\0' => repr.push_str(r"\0"), ++ b'\t' => repr.push_str(r"\t"), ++ b'\n' => repr.push_str(r"\n"), ++ b'\r' => repr.push_str(r"\r"), ++ b'\'' => repr.push_str(r"\'"), ++ b'\\' => repr.push_str(r"\\"), ++ b'\x20'..=b'\x7E' => repr.push(byte as char), ++ _ => { ++ let _ = write!(repr, r"\x{:02X}", byte); ++ } ++ } ++ repr.push('\''); ++ Literal::_new(repr) ++ } ++ ++ pub(crate) fn byte_string(bytes: &[u8]) -> Literal { ++ let mut repr = "b\"".to_string(); ++ let mut bytes = bytes.iter(); ++ while let Some(&b) = bytes.next() { ++ #[allow(clippy::match_overlapping_arm)] ++ match b { ++ b'\0' => repr.push_str(match bytes.as_slice().first() { ++ // circumvent clippy::octal_escapes lint ++ Some(b'0'..=b'7') => r"\x00", ++ _ => r"\0", ++ }), ++ b'\t' => repr.push_str(r"\t"), ++ b'\n' => repr.push_str(r"\n"), ++ b'\r' => repr.push_str(r"\r"), ++ b'"' => repr.push_str("\\\""), ++ b'\\' => repr.push_str(r"\\"), ++ b'\x20'..=b'\x7E' => repr.push(b as char), ++ _ => { ++ let _ = write!(repr, r"\x{:02X}", b); ++ } ++ } ++ } ++ repr.push('"'); ++ Literal::_new(repr) ++ } ++ ++ pub(crate) fn c_string(string: &CStr) -> Literal { ++ let mut repr = "c\"".to_string(); ++ let mut bytes = string.to_bytes(); ++ while !bytes.is_empty() { ++ let (valid, invalid) = match str::from_utf8(bytes) { ++ Ok(all_valid) => { ++ bytes = b""; ++ (all_valid, bytes) ++ } ++ Err(utf8_error) => { ++ let (valid, rest) = bytes.split_at(utf8_error.valid_up_to()); ++ let valid = str::from_utf8(valid).unwrap(); ++ let invalid = utf8_error ++ .error_len() ++ .map_or(rest, |error_len| &rest[..error_len]); ++ bytes = &bytes[valid.len() + invalid.len()..]; ++ (valid, invalid) ++ } ++ }; ++ escape_utf8(valid, &mut repr); ++ for &byte in invalid { ++ let _ = write!(repr, r"\x{:02X}", byte); ++ } ++ } ++ repr.push('"'); ++ Literal::_new(repr) ++ } ++ ++ pub(crate) fn span(&self) -> Span { ++ self.span ++ } ++ ++ pub(crate) fn set_span(&mut self, span: Span) { ++ self.span = span; ++ } ++ ++ pub(crate) fn subspan>(&self, range: R) -> Option { ++ #[cfg(not(span_locations))] ++ { ++ let _ = range; ++ None ++ } ++ ++ #[cfg(span_locations)] ++ { ++ use core::ops::Bound; ++ ++ let lo = match range.start_bound() { ++ Bound::Included(start) => { ++ let start = u32::try_from(*start).ok()?; ++ self.span.lo.checked_add(start)? ++ } ++ Bound::Excluded(start) => { ++ let start = u32::try_from(*start).ok()?; ++ self.span.lo.checked_add(start)?.checked_add(1)? ++ } ++ Bound::Unbounded => self.span.lo, ++ }; ++ let hi = match range.end_bound() { ++ Bound::Included(end) => { ++ let end = u32::try_from(*end).ok()?; ++ self.span.lo.checked_add(end)?.checked_add(1)? ++ } ++ Bound::Excluded(end) => { ++ let end = u32::try_from(*end).ok()?; ++ self.span.lo.checked_add(end)? ++ } ++ Bound::Unbounded => self.span.hi, ++ }; ++ if lo <= hi && hi <= self.span.hi { ++ Some(Span { lo, hi }) ++ } else { ++ None ++ } ++ } ++ } ++} ++ ++impl Display for Literal { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ Display::fmt(&self.repr, f) ++ } ++} ++ ++impl Debug for Literal { ++ fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { ++ let mut debug = fmt.debug_struct("Literal"); ++ debug.field("lit", &format_args!("{}", self.repr)); ++ debug_span_field_if_nontrivial(&mut debug, self.span); ++ debug.finish() ++ } ++} ++ ++fn escape_utf8(string: &str, repr: &mut String) { ++ let mut chars = string.chars(); ++ while let Some(ch) = chars.next() { ++ if ch == '\0' { ++ repr.push_str( ++ if chars ++ .as_str() ++ .starts_with(|next| '0' <= next && next <= '7') ++ { ++ // circumvent clippy::octal_escapes lint ++ r"\x00" ++ } else { ++ r"\0" ++ }, ++ ); ++ } else if ch == '\'' { ++ // escape_debug turns this into "\'" which is unnecessary. ++ repr.push(ch); ++ } else { ++ repr.extend(ch.escape_debug()); ++ } ++ } ++} ++ ++#[cfg(feature = "proc-macro")] ++pub(crate) trait FromStr2: FromStr { ++ #[cfg(wrap_proc_macro)] ++ fn valid(src: &str) -> bool; ++ ++ #[cfg(wrap_proc_macro)] ++ fn from_str_checked(src: &str) -> Result { ++ // Validate using fallback parser, because rustc is incapable of ++ // returning a recoverable Err for certain invalid token streams, and ++ // will instead permanently poison the compilation. ++ if !Self::valid(src) { ++ return Err(imp::LexError::CompilerPanic); ++ } ++ ++ // Catch panic to work around https://github.com/rust-lang/rust/issues/58736. ++ match panic::catch_unwind(|| Self::from_str(src)) { ++ Ok(Ok(ok)) => Ok(ok), ++ Ok(Err(lex)) => Err(imp::LexError::Compiler(lex)), ++ Err(_panic) => Err(imp::LexError::CompilerPanic), ++ } ++ } ++ ++ fn from_str_unchecked(src: &str) -> Self { ++ Self::from_str(src).unwrap() ++ } ++} ++ ++#[cfg(feature = "proc-macro")] ++impl FromStr2 for proc_macro::TokenStream { ++ #[cfg(wrap_proc_macro)] ++ fn valid(src: &str) -> bool { ++ TokenStream::from_str_checked(src).is_ok() ++ } ++} ++ ++#[cfg(feature = "proc-macro")] ++impl FromStr2 for proc_macro::Literal { ++ #[cfg(wrap_proc_macro)] ++ fn valid(src: &str) -> bool { ++ Literal::from_str_checked(src).is_ok() ++ } ++} +diff -Nru mesa-25.3.3/subprojects/proc-macro2-1.0.92/src/lib.rs mesa-25.3.3/subprojects/proc-macro2-1.0.92/src/lib.rs +--- mesa-25.3.3/subprojects/proc-macro2-1.0.92/src/lib.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/proc-macro2-1.0.92/src/lib.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,1389 @@ ++//! [![github]](https://github.com/dtolnay/proc-macro2) [![crates-io]](https://crates.io/crates/proc-macro2) [![docs-rs]](crate) ++//! ++//! [github]: https://img.shields.io/badge/github-8da0cb?style=for-the-badge&labelColor=555555&logo=github ++//! [crates-io]: https://img.shields.io/badge/crates.io-fc8d62?style=for-the-badge&labelColor=555555&logo=rust ++//! [docs-rs]: https://img.shields.io/badge/docs.rs-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs ++//! ++//!
++//! ++//! A wrapper around the procedural macro API of the compiler's [`proc_macro`] ++//! crate. This library serves two purposes: ++//! ++//! [`proc_macro`]: https://doc.rust-lang.org/proc_macro/ ++//! ++//! - **Bring proc-macro-like functionality to other contexts like build.rs and ++//! main.rs.** Types from `proc_macro` are entirely specific to procedural ++//! macros and cannot ever exist in code outside of a procedural macro. ++//! Meanwhile `proc_macro2` types may exist anywhere including non-macro code. ++//! By developing foundational libraries like [syn] and [quote] against ++//! `proc_macro2` rather than `proc_macro`, the procedural macro ecosystem ++//! becomes easily applicable to many other use cases and we avoid ++//! reimplementing non-macro equivalents of those libraries. ++//! ++//! - **Make procedural macros unit testable.** As a consequence of being ++//! specific to procedural macros, nothing that uses `proc_macro` can be ++//! executed from a unit test. In order for helper libraries or components of ++//! a macro to be testable in isolation, they must be implemented using ++//! `proc_macro2`. ++//! ++//! [syn]: https://github.com/dtolnay/syn ++//! [quote]: https://github.com/dtolnay/quote ++//! ++//! # Usage ++//! ++//! The skeleton of a typical procedural macro typically looks like this: ++//! ++//! ``` ++//! extern crate proc_macro; ++//! ++//! # const IGNORE: &str = stringify! { ++//! #[proc_macro_derive(MyDerive)] ++//! # }; ++//! # #[cfg(wrap_proc_macro)] ++//! pub fn my_derive(input: proc_macro::TokenStream) -> proc_macro::TokenStream { ++//! let input = proc_macro2::TokenStream::from(input); ++//! ++//! let output: proc_macro2::TokenStream = { ++//! /* transform input */ ++//! # input ++//! }; ++//! ++//! proc_macro::TokenStream::from(output) ++//! } ++//! ``` ++//! ++//! If parsing with [Syn], you'll use [`parse_macro_input!`] instead to ++//! propagate parse errors correctly back to the compiler when parsing fails. ++//! ++//! [`parse_macro_input!`]: https://docs.rs/syn/2.0/syn/macro.parse_macro_input.html ++//! ++//! # Unstable features ++//! ++//! The default feature set of proc-macro2 tracks the most recent stable ++//! compiler API. Functionality in `proc_macro` that is not yet stable is not ++//! exposed by proc-macro2 by default. ++//! ++//! To opt into the additional APIs available in the most recent nightly ++//! compiler, the `procmacro2_semver_exempt` config flag must be passed to ++//! rustc. We will polyfill those nightly-only APIs back to Rust 1.56.0. As ++//! these are unstable APIs that track the nightly compiler, minor versions of ++//! proc-macro2 may make breaking changes to them at any time. ++//! ++//! ```sh ++//! RUSTFLAGS='--cfg procmacro2_semver_exempt' cargo build ++//! ``` ++//! ++//! Note that this must not only be done for your crate, but for any crate that ++//! depends on your crate. This infectious nature is intentional, as it serves ++//! as a reminder that you are outside of the normal semver guarantees. ++//! ++//! Semver exempt methods are marked as such in the proc-macro2 documentation. ++//! ++//! # Thread-Safety ++//! ++//! Most types in this crate are `!Sync` because the underlying compiler ++//! types make use of thread-local memory, meaning they cannot be accessed from ++//! 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.92")] ++#![cfg_attr(any(proc_macro_span, super_unstable), feature(proc_macro_span))] ++#![cfg_attr(super_unstable, feature(proc_macro_def_site))] ++#![cfg_attr(docsrs, feature(doc_cfg))] ++#![deny(unsafe_op_in_unsafe_fn)] ++#![allow( ++ clippy::cast_lossless, ++ clippy::cast_possible_truncation, ++ clippy::checked_conversions, ++ clippy::doc_markdown, ++ clippy::incompatible_msrv, ++ clippy::items_after_statements, ++ clippy::iter_without_into_iter, ++ clippy::let_underscore_untyped, ++ clippy::manual_assert, ++ clippy::manual_range_contains, ++ clippy::missing_panics_doc, ++ clippy::missing_safety_doc, ++ clippy::must_use_candidate, ++ clippy::needless_doctest_main, ++ clippy::needless_lifetimes, ++ clippy::new_without_default, ++ clippy::return_self_not_must_use, ++ clippy::shadow_unrelated, ++ clippy::trivially_copy_pass_by_ref, ++ clippy::unnecessary_wraps, ++ clippy::unused_self, ++ clippy::used_underscore_binding, ++ clippy::vec_init_then_push ++)] ++ ++#[cfg(all(procmacro2_semver_exempt, wrap_proc_macro, not(super_unstable)))] ++compile_error! {"\ ++ Something is not right. If you've tried to turn on \ ++ procmacro2_semver_exempt, you need to ensure that it \ ++ is turned on for the compilation of the proc-macro2 \ ++ build script as well. ++"} ++ ++#[cfg(all( ++ procmacro2_nightly_testing, ++ feature = "proc-macro", ++ not(proc_macro_span) ++))] ++compile_error! {"\ ++ Build script probe failed to compile. ++"} ++ ++extern crate alloc; ++ ++#[cfg(feature = "proc-macro")] ++extern crate proc_macro; ++ ++mod marker; ++mod parse; ++mod rcvec; ++ ++#[cfg(wrap_proc_macro)] ++mod detection; ++ ++// Public for proc_macro2::fallback::force() and unforce(), but those are quite ++// a niche use case so we omit it from rustdoc. ++#[doc(hidden)] ++pub mod fallback; ++ ++pub mod extra; ++ ++#[cfg(not(wrap_proc_macro))] ++use crate::fallback as imp; ++#[path = "wrapper.rs"] ++#[cfg(wrap_proc_macro)] ++mod imp; ++ ++#[cfg(span_locations)] ++mod location; ++ ++use crate::extra::DelimSpan; ++use crate::marker::{ProcMacroAutoTraits, MARKER}; ++use core::cmp::Ordering; ++use core::fmt::{self, Debug, Display}; ++use core::hash::{Hash, Hasher}; ++#[cfg(span_locations)] ++use core::ops::Range; ++use core::ops::RangeBounds; ++use core::str::FromStr; ++use std::error::Error; ++use std::ffi::CStr; ++#[cfg(procmacro2_semver_exempt)] ++use std::path::PathBuf; ++ ++#[cfg(span_locations)] ++#[cfg_attr(docsrs, doc(cfg(feature = "span-locations")))] ++pub use crate::location::LineColumn; ++ ++/// An abstract stream of tokens, or more concretely a sequence of token trees. ++/// ++/// This type provides interfaces for iterating over token trees and for ++/// collecting token trees into one stream. ++/// ++/// Token stream is both the input and output of `#[proc_macro]`, ++/// `#[proc_macro_attribute]` and `#[proc_macro_derive]` definitions. ++#[derive(Clone)] ++pub struct TokenStream { ++ inner: imp::TokenStream, ++ _marker: ProcMacroAutoTraits, ++} ++ ++/// Error returned from `TokenStream::from_str`. ++pub struct LexError { ++ inner: imp::LexError, ++ _marker: ProcMacroAutoTraits, ++} ++ ++impl TokenStream { ++ fn _new(inner: imp::TokenStream) -> Self { ++ TokenStream { ++ inner, ++ _marker: MARKER, ++ } ++ } ++ ++ fn _new_fallback(inner: fallback::TokenStream) -> Self { ++ TokenStream { ++ inner: imp::TokenStream::from(inner), ++ _marker: MARKER, ++ } ++ } ++ ++ /// Returns an empty `TokenStream` containing no token trees. ++ pub fn new() -> Self { ++ TokenStream::_new(imp::TokenStream::new()) ++ } ++ ++ /// Checks if this `TokenStream` is empty. ++ pub fn is_empty(&self) -> bool { ++ self.inner.is_empty() ++ } ++} ++ ++/// `TokenStream::default()` returns an empty stream, ++/// i.e. this is equivalent with `TokenStream::new()`. ++impl Default for TokenStream { ++ fn default() -> Self { ++ TokenStream::new() ++ } ++} ++ ++/// Attempts to break the string into tokens and parse those tokens into a token ++/// stream. ++/// ++/// May fail for a number of reasons, for example, if the string contains ++/// unbalanced delimiters or characters not existing in the language. ++/// ++/// NOTE: Some errors may cause panics instead of returning `LexError`. We ++/// reserve the right to change these errors into `LexError`s later. ++impl FromStr for TokenStream { ++ type Err = LexError; ++ ++ fn from_str(src: &str) -> Result { ++ match imp::TokenStream::from_str_checked(src) { ++ Ok(tokens) => Ok(TokenStream::_new(tokens)), ++ Err(lex) => Err(LexError { ++ inner: lex, ++ _marker: MARKER, ++ }), ++ } ++ } ++} ++ ++#[cfg(feature = "proc-macro")] ++#[cfg_attr(docsrs, doc(cfg(feature = "proc-macro")))] ++impl From for TokenStream { ++ fn from(inner: proc_macro::TokenStream) -> Self { ++ TokenStream::_new(imp::TokenStream::from(inner)) ++ } ++} ++ ++#[cfg(feature = "proc-macro")] ++#[cfg_attr(docsrs, doc(cfg(feature = "proc-macro")))] ++impl From for proc_macro::TokenStream { ++ fn from(inner: TokenStream) -> Self { ++ proc_macro::TokenStream::from(inner.inner) ++ } ++} ++ ++impl From for TokenStream { ++ fn from(token: TokenTree) -> Self { ++ TokenStream::_new(imp::TokenStream::from(token)) ++ } ++} ++ ++impl Extend for TokenStream { ++ fn extend>(&mut self, streams: I) { ++ self.inner.extend(streams); ++ } ++} ++ ++impl Extend for TokenStream { ++ fn extend>(&mut self, streams: I) { ++ self.inner ++ .extend(streams.into_iter().map(|stream| stream.inner)); ++ } ++} ++ ++/// Collects a number of token trees into a single stream. ++impl FromIterator for TokenStream { ++ fn from_iter>(streams: I) -> Self { ++ TokenStream::_new(streams.into_iter().collect()) ++ } ++} ++impl FromIterator for TokenStream { ++ fn from_iter>(streams: I) -> Self { ++ TokenStream::_new(streams.into_iter().map(|i| i.inner).collect()) ++ } ++} ++ ++/// Prints the token stream as a string that is supposed to be losslessly ++/// convertible back into the same token stream (modulo spans), except for ++/// possibly `TokenTree::Group`s with `Delimiter::None` delimiters and negative ++/// numeric literals. ++impl Display for TokenStream { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ Display::fmt(&self.inner, f) ++ } ++} ++ ++/// Prints token in a form convenient for debugging. ++impl Debug for TokenStream { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ Debug::fmt(&self.inner, f) ++ } ++} ++ ++impl LexError { ++ pub fn span(&self) -> Span { ++ Span::_new(self.inner.span()) ++ } ++} ++ ++impl Debug for LexError { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ Debug::fmt(&self.inner, f) ++ } ++} ++ ++impl Display for LexError { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ Display::fmt(&self.inner, f) ++ } ++} ++ ++impl Error for LexError {} ++ ++/// The source file of a given `Span`. ++/// ++/// This type is semver exempt and not exposed by default. ++#[cfg(all(procmacro2_semver_exempt, any(not(wrap_proc_macro), super_unstable)))] ++#[cfg_attr(docsrs, doc(cfg(procmacro2_semver_exempt)))] ++#[derive(Clone, PartialEq, Eq)] ++pub struct SourceFile { ++ inner: imp::SourceFile, ++ _marker: ProcMacroAutoTraits, ++} ++ ++#[cfg(all(procmacro2_semver_exempt, any(not(wrap_proc_macro), super_unstable)))] ++impl SourceFile { ++ fn _new(inner: imp::SourceFile) -> Self { ++ SourceFile { ++ inner, ++ _marker: MARKER, ++ } ++ } ++ ++ /// Get the path to this source file. ++ /// ++ /// ### Note ++ /// ++ /// If the code span associated with this `SourceFile` was generated by an ++ /// external macro, this may not be an actual path on the filesystem. Use ++ /// [`is_real`] to check. ++ /// ++ /// Also note that even if `is_real` returns `true`, if ++ /// `--remap-path-prefix` was passed on the command line, the path as given ++ /// may not actually be valid. ++ /// ++ /// [`is_real`]: #method.is_real ++ pub fn path(&self) -> PathBuf { ++ self.inner.path() ++ } ++ ++ /// Returns `true` if this source file is a real source file, and not ++ /// generated by an external macro's expansion. ++ pub fn is_real(&self) -> bool { ++ self.inner.is_real() ++ } ++} ++ ++#[cfg(all(procmacro2_semver_exempt, any(not(wrap_proc_macro), super_unstable)))] ++impl Debug for SourceFile { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ Debug::fmt(&self.inner, f) ++ } ++} ++ ++/// A region of source code, along with macro expansion information. ++#[derive(Copy, Clone)] ++pub struct Span { ++ inner: imp::Span, ++ _marker: ProcMacroAutoTraits, ++} ++ ++impl Span { ++ fn _new(inner: imp::Span) -> Self { ++ Span { ++ inner, ++ _marker: MARKER, ++ } ++ } ++ ++ fn _new_fallback(inner: fallback::Span) -> Self { ++ Span { ++ inner: imp::Span::from(inner), ++ _marker: MARKER, ++ } ++ } ++ ++ /// The span of the invocation of the current procedural macro. ++ /// ++ /// Identifiers created with this span will be resolved as if they were ++ /// written directly at the macro call location (call-site hygiene) and ++ /// other code at the macro call site will be able to refer to them as well. ++ pub fn call_site() -> Self { ++ Span::_new(imp::Span::call_site()) ++ } ++ ++ /// The span located at the invocation of the procedural macro, but with ++ /// local variables, labels, and `$crate` resolved at the definition site ++ /// of the macro. This is the same hygiene behavior as `macro_rules`. ++ pub fn mixed_site() -> Self { ++ Span::_new(imp::Span::mixed_site()) ++ } ++ ++ /// A span that resolves at the macro definition site. ++ /// ++ /// This method is semver exempt and not exposed by default. ++ #[cfg(procmacro2_semver_exempt)] ++ #[cfg_attr(docsrs, doc(cfg(procmacro2_semver_exempt)))] ++ pub fn def_site() -> Self { ++ Span::_new(imp::Span::def_site()) ++ } ++ ++ /// Creates a new span with the same line/column information as `self` but ++ /// that resolves symbols as though it were at `other`. ++ pub fn resolved_at(&self, other: Span) -> Span { ++ Span::_new(self.inner.resolved_at(other.inner)) ++ } ++ ++ /// Creates a new span with the same name resolution behavior as `self` but ++ /// with the line/column information of `other`. ++ pub fn located_at(&self, other: Span) -> Span { ++ Span::_new(self.inner.located_at(other.inner)) ++ } ++ ++ /// Convert `proc_macro2::Span` to `proc_macro::Span`. ++ /// ++ /// This method is available when building with a nightly compiler, or when ++ /// building with rustc 1.29+ *without* semver exempt features. ++ /// ++ /// # Panics ++ /// ++ /// Panics if called from outside of a procedural macro. Unlike ++ /// `proc_macro2::Span`, the `proc_macro::Span` type can only exist within ++ /// the context of a procedural macro invocation. ++ #[cfg(wrap_proc_macro)] ++ pub fn unwrap(self) -> proc_macro::Span { ++ self.inner.unwrap() ++ } ++ ++ // Soft deprecated. Please use Span::unwrap. ++ #[cfg(wrap_proc_macro)] ++ #[doc(hidden)] ++ pub fn unstable(self) -> proc_macro::Span { ++ self.unwrap() ++ } ++ ++ /// The original source file into which this span points. ++ /// ++ /// This method is semver exempt and not exposed by default. ++ #[cfg(all(procmacro2_semver_exempt, any(not(wrap_proc_macro), super_unstable)))] ++ #[cfg_attr(docsrs, doc(cfg(procmacro2_semver_exempt)))] ++ pub fn source_file(&self) -> SourceFile { ++ SourceFile::_new(self.inner.source_file()) ++ } ++ ++ /// Returns the span's byte position range in the source file. ++ /// ++ /// This method requires the `"span-locations"` feature to be enabled. ++ /// ++ /// When executing in a procedural macro context, the returned range is only ++ /// accurate if compiled with a nightly toolchain. The stable toolchain does ++ /// not have this information available. When executing outside of a ++ /// procedural macro, such as main.rs or build.rs, the byte range is always ++ /// accurate regardless of toolchain. ++ #[cfg(span_locations)] ++ #[cfg_attr(docsrs, doc(cfg(feature = "span-locations")))] ++ pub fn byte_range(&self) -> Range { ++ self.inner.byte_range() ++ } ++ ++ /// Get the starting line/column in the source file for this span. ++ /// ++ /// This method requires the `"span-locations"` feature to be enabled. ++ /// ++ /// When executing in a procedural macro context, the returned line/column ++ /// are only meaningful if compiled with a nightly toolchain. The stable ++ /// toolchain does not have this information available. When executing ++ /// outside of a procedural macro, such as main.rs or build.rs, the ++ /// line/column are always meaningful regardless of toolchain. ++ #[cfg(span_locations)] ++ #[cfg_attr(docsrs, doc(cfg(feature = "span-locations")))] ++ pub fn start(&self) -> LineColumn { ++ self.inner.start() ++ } ++ ++ /// Get the ending line/column in the source file for this span. ++ /// ++ /// This method requires the `"span-locations"` feature to be enabled. ++ /// ++ /// When executing in a procedural macro context, the returned line/column ++ /// are only meaningful if compiled with a nightly toolchain. The stable ++ /// toolchain does not have this information available. When executing ++ /// outside of a procedural macro, such as main.rs or build.rs, the ++ /// line/column are always meaningful regardless of toolchain. ++ #[cfg(span_locations)] ++ #[cfg_attr(docsrs, doc(cfg(feature = "span-locations")))] ++ pub fn end(&self) -> LineColumn { ++ self.inner.end() ++ } ++ ++ /// Create a new span encompassing `self` and `other`. ++ /// ++ /// Returns `None` if `self` and `other` are from different files. ++ /// ++ /// Warning: the underlying [`proc_macro::Span::join`] method is ++ /// nightly-only. When called from within a procedural macro not using a ++ /// nightly compiler, this method will always return `None`. ++ /// ++ /// [`proc_macro::Span::join`]: https://doc.rust-lang.org/proc_macro/struct.Span.html#method.join ++ pub fn join(&self, other: Span) -> Option { ++ self.inner.join(other.inner).map(Span::_new) ++ } ++ ++ /// Compares two spans to see if they're equal. ++ /// ++ /// This method is semver exempt and not exposed by default. ++ #[cfg(procmacro2_semver_exempt)] ++ #[cfg_attr(docsrs, doc(cfg(procmacro2_semver_exempt)))] ++ pub fn eq(&self, other: &Span) -> bool { ++ self.inner.eq(&other.inner) ++ } ++ ++ /// Returns the source text behind a span. This preserves the original ++ /// source code, including spaces and comments. It only returns a result if ++ /// the span corresponds to real source code. ++ /// ++ /// Note: The observable result of a macro should only rely on the tokens ++ /// and not on this source text. The result of this function is a best ++ /// effort to be used for diagnostics only. ++ pub fn source_text(&self) -> Option { ++ self.inner.source_text() ++ } ++} ++ ++/// Prints a span in a form convenient for debugging. ++impl Debug for Span { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ Debug::fmt(&self.inner, f) ++ } ++} ++ ++/// A single token or a delimited sequence of token trees (e.g. `[1, (), ..]`). ++#[derive(Clone)] ++pub enum TokenTree { ++ /// A token stream surrounded by bracket delimiters. ++ Group(Group), ++ /// An identifier. ++ Ident(Ident), ++ /// A single punctuation character (`+`, `,`, `$`, etc.). ++ Punct(Punct), ++ /// A literal character (`'a'`), string (`"hello"`), number (`2.3`), etc. ++ Literal(Literal), ++} ++ ++impl TokenTree { ++ /// Returns the span of this tree, delegating to the `span` method of ++ /// the contained token or a delimited stream. ++ pub fn span(&self) -> Span { ++ match self { ++ TokenTree::Group(t) => t.span(), ++ TokenTree::Ident(t) => t.span(), ++ TokenTree::Punct(t) => t.span(), ++ TokenTree::Literal(t) => t.span(), ++ } ++ } ++ ++ /// Configures the span for *only this token*. ++ /// ++ /// Note that if this token is a `Group` then this method will not configure ++ /// the span of each of the internal tokens, this will simply delegate to ++ /// the `set_span` method of each variant. ++ pub fn set_span(&mut self, span: Span) { ++ match self { ++ TokenTree::Group(t) => t.set_span(span), ++ TokenTree::Ident(t) => t.set_span(span), ++ TokenTree::Punct(t) => t.set_span(span), ++ TokenTree::Literal(t) => t.set_span(span), ++ } ++ } ++} ++ ++impl From for TokenTree { ++ fn from(g: Group) -> Self { ++ TokenTree::Group(g) ++ } ++} ++ ++impl From for TokenTree { ++ fn from(g: Ident) -> Self { ++ TokenTree::Ident(g) ++ } ++} ++ ++impl From for TokenTree { ++ fn from(g: Punct) -> Self { ++ TokenTree::Punct(g) ++ } ++} ++ ++impl From for TokenTree { ++ fn from(g: Literal) -> Self { ++ TokenTree::Literal(g) ++ } ++} ++ ++/// Prints the token tree as a string that is supposed to be losslessly ++/// convertible back into the same token tree (modulo spans), except for ++/// possibly `TokenTree::Group`s with `Delimiter::None` delimiters and negative ++/// numeric literals. ++impl Display for TokenTree { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ match self { ++ TokenTree::Group(t) => Display::fmt(t, f), ++ TokenTree::Ident(t) => Display::fmt(t, f), ++ TokenTree::Punct(t) => Display::fmt(t, f), ++ TokenTree::Literal(t) => Display::fmt(t, f), ++ } ++ } ++} ++ ++/// Prints token tree in a form convenient for debugging. ++impl Debug for TokenTree { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ // Each of these has the name in the struct type in the derived debug, ++ // so don't bother with an extra layer of indirection ++ match self { ++ TokenTree::Group(t) => Debug::fmt(t, f), ++ TokenTree::Ident(t) => { ++ let mut debug = f.debug_struct("Ident"); ++ debug.field("sym", &format_args!("{}", t)); ++ imp::debug_span_field_if_nontrivial(&mut debug, t.span().inner); ++ debug.finish() ++ } ++ TokenTree::Punct(t) => Debug::fmt(t, f), ++ TokenTree::Literal(t) => Debug::fmt(t, f), ++ } ++ } ++} ++ ++/// A delimited token stream. ++/// ++/// A `Group` internally contains a `TokenStream` which is surrounded by ++/// `Delimiter`s. ++#[derive(Clone)] ++pub struct Group { ++ inner: imp::Group, ++} ++ ++/// Describes how a sequence of token trees is delimited. ++#[derive(Copy, Clone, Debug, Eq, PartialEq)] ++pub enum Delimiter { ++ /// `( ... )` ++ Parenthesis, ++ /// `{ ... }` ++ Brace, ++ /// `[ ... ]` ++ Bracket, ++ /// `∅ ... ∅` ++ /// ++ /// An invisible delimiter, that may, for example, appear around tokens ++ /// coming from a "macro variable" `$var`. It is important to preserve ++ /// operator priorities in cases like `$var * 3` where `$var` is `1 + 2`. ++ /// Invisible delimiters may not survive roundtrip of a token stream through ++ /// a string. ++ /// ++ ///
++ /// ++ /// Note: rustc currently can ignore the grouping of tokens delimited by `None` in the output ++ /// of a proc_macro. Only `None`-delimited groups created by a macro_rules macro in the input ++ /// of a proc_macro macro are preserved, and only in very specific circumstances. ++ /// Any `None`-delimited groups (re)created by a proc_macro will therefore not preserve ++ /// operator priorities as indicated above. The other `Delimiter` variants should be used ++ /// instead in this context. This is a rustc bug. For details, see ++ /// [rust-lang/rust#67062](https://github.com/rust-lang/rust/issues/67062). ++ /// ++ ///
++ None, ++} ++ ++impl Group { ++ fn _new(inner: imp::Group) -> Self { ++ Group { inner } ++ } ++ ++ fn _new_fallback(inner: fallback::Group) -> Self { ++ Group { ++ inner: imp::Group::from(inner), ++ } ++ } ++ ++ /// Creates a new `Group` with the given delimiter and token stream. ++ /// ++ /// This constructor will set the span for this group to ++ /// `Span::call_site()`. To change the span you can use the `set_span` ++ /// method below. ++ pub fn new(delimiter: Delimiter, stream: TokenStream) -> Self { ++ Group { ++ inner: imp::Group::new(delimiter, stream.inner), ++ } ++ } ++ ++ /// Returns the punctuation used as the delimiter for this group: a set of ++ /// parentheses, square brackets, or curly braces. ++ pub fn delimiter(&self) -> Delimiter { ++ self.inner.delimiter() ++ } ++ ++ /// Returns the `TokenStream` of tokens that are delimited in this `Group`. ++ /// ++ /// Note that the returned token stream does not include the delimiter ++ /// returned above. ++ pub fn stream(&self) -> TokenStream { ++ TokenStream::_new(self.inner.stream()) ++ } ++ ++ /// Returns the span for the delimiters of this token stream, spanning the ++ /// entire `Group`. ++ /// ++ /// ```text ++ /// pub fn span(&self) -> Span { ++ /// ^^^^^^^ ++ /// ``` ++ pub fn span(&self) -> Span { ++ Span::_new(self.inner.span()) ++ } ++ ++ /// Returns the span pointing to the opening delimiter of this group. ++ /// ++ /// ```text ++ /// pub fn span_open(&self) -> Span { ++ /// ^ ++ /// ``` ++ pub fn span_open(&self) -> Span { ++ Span::_new(self.inner.span_open()) ++ } ++ ++ /// Returns the span pointing to the closing delimiter of this group. ++ /// ++ /// ```text ++ /// pub fn span_close(&self) -> Span { ++ /// ^ ++ /// ``` ++ pub fn span_close(&self) -> Span { ++ Span::_new(self.inner.span_close()) ++ } ++ ++ /// Returns an object that holds this group's `span_open()` and ++ /// `span_close()` together (in a more compact representation than holding ++ /// those 2 spans individually). ++ pub fn delim_span(&self) -> DelimSpan { ++ DelimSpan::new(&self.inner) ++ } ++ ++ /// Configures the span for this `Group`'s delimiters, but not its internal ++ /// tokens. ++ /// ++ /// This method will **not** set the span of all the internal tokens spanned ++ /// by this group, but rather it will only set the span of the delimiter ++ /// tokens at the level of the `Group`. ++ pub fn set_span(&mut self, span: Span) { ++ self.inner.set_span(span.inner); ++ } ++} ++ ++/// Prints the group as a string that should be losslessly convertible back ++/// into the same group (modulo spans), except for possibly `TokenTree::Group`s ++/// with `Delimiter::None` delimiters. ++impl Display for Group { ++ fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { ++ Display::fmt(&self.inner, formatter) ++ } ++} ++ ++impl Debug for Group { ++ fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { ++ Debug::fmt(&self.inner, formatter) ++ } ++} ++ ++/// A `Punct` is a single punctuation character like `+`, `-` or `#`. ++/// ++/// Multicharacter operators like `+=` are represented as two instances of ++/// `Punct` with different forms of `Spacing` returned. ++#[derive(Clone)] ++pub struct Punct { ++ ch: char, ++ spacing: Spacing, ++ span: Span, ++} ++ ++/// Whether a `Punct` is followed immediately by another `Punct` or followed by ++/// another token or whitespace. ++#[derive(Copy, Clone, Debug, Eq, PartialEq)] ++pub enum Spacing { ++ /// E.g. `+` is `Alone` in `+ =`, `+ident` or `+()`. ++ Alone, ++ /// E.g. `+` is `Joint` in `+=` or `'` is `Joint` in `'#`. ++ /// ++ /// Additionally, single quote `'` can join with identifiers to form ++ /// lifetimes `'ident`. ++ Joint, ++} ++ ++impl Punct { ++ /// Creates a new `Punct` from the given character and spacing. ++ /// ++ /// The `ch` argument must be a valid punctuation character permitted by the ++ /// language, otherwise the function will panic. ++ /// ++ /// The returned `Punct` will have the default span of `Span::call_site()` ++ /// which can be further configured with the `set_span` method below. ++ pub fn new(ch: char, spacing: Spacing) -> Self { ++ if let '!' | '#' | '$' | '%' | '&' | '\'' | '*' | '+' | ',' | '-' | '.' | '/' | ':' | ';' ++ | '<' | '=' | '>' | '?' | '@' | '^' | '|' | '~' = ch ++ { ++ Punct { ++ ch, ++ spacing, ++ span: Span::call_site(), ++ } ++ } else { ++ panic!("unsupported proc macro punctuation character {:?}", ch); ++ } ++ } ++ ++ /// Returns the value of this punctuation character as `char`. ++ pub fn as_char(&self) -> char { ++ self.ch ++ } ++ ++ /// Returns the spacing of this punctuation character, indicating whether ++ /// it's immediately followed by another `Punct` in the token stream, so ++ /// they can potentially be combined into a multicharacter operator ++ /// (`Joint`), or it's followed by some other token or whitespace (`Alone`) ++ /// so the operator has certainly ended. ++ pub fn spacing(&self) -> Spacing { ++ self.spacing ++ } ++ ++ /// Returns the span for this punctuation character. ++ pub fn span(&self) -> Span { ++ self.span ++ } ++ ++ /// Configure the span for this punctuation character. ++ pub fn set_span(&mut self, span: Span) { ++ self.span = span; ++ } ++} ++ ++/// Prints the punctuation character as a string that should be losslessly ++/// convertible back into the same character. ++impl Display for Punct { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ Display::fmt(&self.ch, f) ++ } ++} ++ ++impl Debug for Punct { ++ fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result { ++ let mut debug = fmt.debug_struct("Punct"); ++ debug.field("char", &self.ch); ++ debug.field("spacing", &self.spacing); ++ imp::debug_span_field_if_nontrivial(&mut debug, self.span.inner); ++ debug.finish() ++ } ++} ++ ++/// A word of Rust code, which may be a keyword or legal variable name. ++/// ++/// An identifier consists of at least one Unicode code point, the first of ++/// which has the XID_Start property and the rest of which have the XID_Continue ++/// property. ++/// ++/// - The empty string is not an identifier. Use `Option`. ++/// - A lifetime is not an identifier. Use `syn::Lifetime` instead. ++/// ++/// An identifier constructed with `Ident::new` is permitted to be a Rust ++/// keyword, though parsing one through its [`Parse`] implementation rejects ++/// Rust keywords. Use `input.call(Ident::parse_any)` when parsing to match the ++/// behaviour of `Ident::new`. ++/// ++/// [`Parse`]: https://docs.rs/syn/2.0/syn/parse/trait.Parse.html ++/// ++/// # Examples ++/// ++/// A new ident can be created from a string using the `Ident::new` function. ++/// A span must be provided explicitly which governs the name resolution ++/// behavior of the resulting identifier. ++/// ++/// ``` ++/// use proc_macro2::{Ident, Span}; ++/// ++/// fn main() { ++/// let call_ident = Ident::new("calligraphy", Span::call_site()); ++/// ++/// println!("{}", call_ident); ++/// } ++/// ``` ++/// ++/// An ident can be interpolated into a token stream using the `quote!` macro. ++/// ++/// ``` ++/// use proc_macro2::{Ident, Span}; ++/// use quote::quote; ++/// ++/// fn main() { ++/// let ident = Ident::new("demo", Span::call_site()); ++/// ++/// // Create a variable binding whose name is this ident. ++/// let expanded = quote! { let #ident = 10; }; ++/// ++/// // Create a variable binding with a slightly different name. ++/// let temp_ident = Ident::new(&format!("new_{}", ident), Span::call_site()); ++/// let expanded = quote! { let #temp_ident = 10; }; ++/// } ++/// ``` ++/// ++/// A string representation of the ident is available through the `to_string()` ++/// method. ++/// ++/// ``` ++/// # use proc_macro2::{Ident, Span}; ++/// # ++/// # let ident = Ident::new("another_identifier", Span::call_site()); ++/// # ++/// // Examine the ident as a string. ++/// let ident_string = ident.to_string(); ++/// if ident_string.len() > 60 { ++/// println!("Very long identifier: {}", ident_string) ++/// } ++/// ``` ++#[derive(Clone)] ++pub struct Ident { ++ inner: imp::Ident, ++ _marker: ProcMacroAutoTraits, ++} ++ ++impl Ident { ++ fn _new(inner: imp::Ident) -> Self { ++ Ident { ++ inner, ++ _marker: MARKER, ++ } ++ } ++ ++ fn _new_fallback(inner: fallback::Ident) -> Self { ++ Ident { ++ inner: imp::Ident::from(inner), ++ _marker: MARKER, ++ } ++ } ++ ++ /// Creates a new `Ident` with the given `string` as well as the specified ++ /// `span`. ++ /// ++ /// The `string` argument must be a valid identifier permitted by the ++ /// language, otherwise the function will panic. ++ /// ++ /// Note that `span`, currently in rustc, configures the hygiene information ++ /// for this identifier. ++ /// ++ /// As of this time `Span::call_site()` explicitly opts-in to "call-site" ++ /// hygiene meaning that identifiers created with this span will be resolved ++ /// as if they were written directly at the location of the macro call, and ++ /// other code at the macro call site will be able to refer to them as well. ++ /// ++ /// Later spans like `Span::def_site()` will allow to opt-in to ++ /// "definition-site" hygiene meaning that identifiers created with this ++ /// span will be resolved at the location of the macro definition and other ++ /// code at the macro call site will not be able to refer to them. ++ /// ++ /// Due to the current importance of hygiene this constructor, unlike other ++ /// tokens, requires a `Span` to be specified at construction. ++ /// ++ /// # Panics ++ /// ++ /// Panics if the input string is neither a keyword nor a legal variable ++ /// name. If you are not sure whether the string contains an identifier and ++ /// need to handle an error case, use ++ /// syn::parse_str::<Ident> ++ /// rather than `Ident::new`. ++ #[track_caller] ++ pub fn new(string: &str, span: Span) -> Self { ++ Ident::_new(imp::Ident::new_checked(string, span.inner)) ++ } ++ ++ /// Same as `Ident::new`, but creates a raw identifier (`r#ident`). The ++ /// `string` argument must be a valid identifier permitted by the language ++ /// (including keywords, e.g. `fn`). Keywords which are usable in path ++ /// segments (e.g. `self`, `super`) are not supported, and will cause a ++ /// panic. ++ #[track_caller] ++ pub fn new_raw(string: &str, span: Span) -> Self { ++ Ident::_new(imp::Ident::new_raw_checked(string, span.inner)) ++ } ++ ++ /// Returns the span of this `Ident`. ++ pub fn span(&self) -> Span { ++ Span::_new(self.inner.span()) ++ } ++ ++ /// Configures the span of this `Ident`, possibly changing its hygiene ++ /// context. ++ pub fn set_span(&mut self, span: Span) { ++ self.inner.set_span(span.inner); ++ } ++} ++ ++impl PartialEq for Ident { ++ fn eq(&self, other: &Ident) -> bool { ++ self.inner == other.inner ++ } ++} ++ ++impl PartialEq for Ident ++where ++ T: ?Sized + AsRef, ++{ ++ fn eq(&self, other: &T) -> bool { ++ self.inner == other ++ } ++} ++ ++impl Eq for Ident {} ++ ++impl PartialOrd for Ident { ++ fn partial_cmp(&self, other: &Ident) -> Option { ++ Some(self.cmp(other)) ++ } ++} ++ ++impl Ord for Ident { ++ fn cmp(&self, other: &Ident) -> Ordering { ++ self.to_string().cmp(&other.to_string()) ++ } ++} ++ ++impl Hash for Ident { ++ fn hash(&self, hasher: &mut H) { ++ self.to_string().hash(hasher); ++ } ++} ++ ++/// Prints the identifier as a string that should be losslessly convertible back ++/// into the same identifier. ++impl Display for Ident { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ Display::fmt(&self.inner, f) ++ } ++} ++ ++impl Debug for Ident { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ Debug::fmt(&self.inner, f) ++ } ++} ++ ++/// A literal string (`"hello"`), byte string (`b"hello"`), character (`'a'`), ++/// byte character (`b'a'`), an integer or floating point number with or without ++/// a suffix (`1`, `1u8`, `2.3`, `2.3f32`). ++/// ++/// Boolean literals like `true` and `false` do not belong here, they are ++/// `Ident`s. ++#[derive(Clone)] ++pub struct Literal { ++ inner: imp::Literal, ++ _marker: ProcMacroAutoTraits, ++} ++ ++macro_rules! suffixed_int_literals { ++ ($($name:ident => $kind:ident,)*) => ($( ++ /// Creates a new suffixed integer literal with the specified value. ++ /// ++ /// This function will create an integer like `1u32` where the integer ++ /// value specified is the first part of the token and the integral is ++ /// also suffixed at the end. Literals created from negative numbers may ++ /// not survive roundtrips through `TokenStream` or strings and may be ++ /// broken into two tokens (`-` and positive literal). ++ /// ++ /// Literals created through this method have the `Span::call_site()` ++ /// span by default, which can be configured with the `set_span` method ++ /// below. ++ pub fn $name(n: $kind) -> Literal { ++ Literal::_new(imp::Literal::$name(n)) ++ } ++ )*) ++} ++ ++macro_rules! unsuffixed_int_literals { ++ ($($name:ident => $kind:ident,)*) => ($( ++ /// Creates a new unsuffixed integer literal with the specified value. ++ /// ++ /// This function will create an integer like `1` where the integer ++ /// value specified is the first part of the token. No suffix is ++ /// specified on this token, meaning that invocations like ++ /// `Literal::i8_unsuffixed(1)` are equivalent to ++ /// `Literal::u32_unsuffixed(1)`. Literals created from negative numbers ++ /// may not survive roundtrips through `TokenStream` or strings and may ++ /// be broken into two tokens (`-` and positive literal). ++ /// ++ /// Literals created through this method have the `Span::call_site()` ++ /// span by default, which can be configured with the `set_span` method ++ /// below. ++ pub fn $name(n: $kind) -> Literal { ++ Literal::_new(imp::Literal::$name(n)) ++ } ++ )*) ++} ++ ++impl Literal { ++ fn _new(inner: imp::Literal) -> Self { ++ Literal { ++ inner, ++ _marker: MARKER, ++ } ++ } ++ ++ fn _new_fallback(inner: fallback::Literal) -> Self { ++ Literal { ++ inner: imp::Literal::from(inner), ++ _marker: MARKER, ++ } ++ } ++ ++ suffixed_int_literals! { ++ u8_suffixed => u8, ++ u16_suffixed => u16, ++ u32_suffixed => u32, ++ u64_suffixed => u64, ++ u128_suffixed => u128, ++ usize_suffixed => usize, ++ i8_suffixed => i8, ++ i16_suffixed => i16, ++ i32_suffixed => i32, ++ i64_suffixed => i64, ++ i128_suffixed => i128, ++ isize_suffixed => isize, ++ } ++ ++ unsuffixed_int_literals! { ++ u8_unsuffixed => u8, ++ u16_unsuffixed => u16, ++ u32_unsuffixed => u32, ++ u64_unsuffixed => u64, ++ u128_unsuffixed => u128, ++ usize_unsuffixed => usize, ++ i8_unsuffixed => i8, ++ i16_unsuffixed => i16, ++ i32_unsuffixed => i32, ++ i64_unsuffixed => i64, ++ i128_unsuffixed => i128, ++ isize_unsuffixed => isize, ++ } ++ ++ /// Creates a new unsuffixed floating-point literal. ++ /// ++ /// This constructor is similar to those like `Literal::i8_unsuffixed` where ++ /// the float's value is emitted directly into the token but no suffix is ++ /// used, so it may be inferred to be a `f64` later in the compiler. ++ /// Literals created from negative numbers may not survive round-trips ++ /// through `TokenStream` or strings and may be broken into two tokens (`-` ++ /// and positive literal). ++ /// ++ /// # Panics ++ /// ++ /// This function requires that the specified float is finite, for example ++ /// if it is infinity or NaN this function will panic. ++ pub fn f64_unsuffixed(f: f64) -> Literal { ++ assert!(f.is_finite()); ++ Literal::_new(imp::Literal::f64_unsuffixed(f)) ++ } ++ ++ /// Creates a new suffixed floating-point literal. ++ /// ++ /// This constructor will create a literal like `1.0f64` where the value ++ /// specified is the preceding part of the token and `f64` is the suffix of ++ /// the token. This token will always be inferred to be an `f64` in the ++ /// compiler. Literals created from negative numbers may not survive ++ /// round-trips through `TokenStream` or strings and may be broken into two ++ /// tokens (`-` and positive literal). ++ /// ++ /// # Panics ++ /// ++ /// This function requires that the specified float is finite, for example ++ /// if it is infinity or NaN this function will panic. ++ pub fn f64_suffixed(f: f64) -> Literal { ++ assert!(f.is_finite()); ++ Literal::_new(imp::Literal::f64_suffixed(f)) ++ } ++ ++ /// Creates a new unsuffixed floating-point literal. ++ /// ++ /// This constructor is similar to those like `Literal::i8_unsuffixed` where ++ /// the float's value is emitted directly into the token but no suffix is ++ /// used, so it may be inferred to be a `f64` later in the compiler. ++ /// Literals created from negative numbers may not survive round-trips ++ /// through `TokenStream` or strings and may be broken into two tokens (`-` ++ /// and positive literal). ++ /// ++ /// # Panics ++ /// ++ /// This function requires that the specified float is finite, for example ++ /// if it is infinity or NaN this function will panic. ++ pub fn f32_unsuffixed(f: f32) -> Literal { ++ assert!(f.is_finite()); ++ Literal::_new(imp::Literal::f32_unsuffixed(f)) ++ } ++ ++ /// Creates a new suffixed floating-point literal. ++ /// ++ /// This constructor will create a literal like `1.0f32` where the value ++ /// specified is the preceding part of the token and `f32` is the suffix of ++ /// the token. This token will always be inferred to be an `f32` in the ++ /// compiler. Literals created from negative numbers may not survive ++ /// round-trips through `TokenStream` or strings and may be broken into two ++ /// tokens (`-` and positive literal). ++ /// ++ /// # Panics ++ /// ++ /// This function requires that the specified float is finite, for example ++ /// if it is infinity or NaN this function will panic. ++ pub fn f32_suffixed(f: f32) -> Literal { ++ assert!(f.is_finite()); ++ Literal::_new(imp::Literal::f32_suffixed(f)) ++ } ++ ++ /// String literal. ++ pub fn string(string: &str) -> Literal { ++ Literal::_new(imp::Literal::string(string)) ++ } ++ ++ /// Character literal. ++ pub fn character(ch: char) -> Literal { ++ Literal::_new(imp::Literal::character(ch)) ++ } ++ ++ /// Byte character literal. ++ pub fn byte_character(byte: u8) -> Literal { ++ Literal::_new(imp::Literal::byte_character(byte)) ++ } ++ ++ /// Byte string literal. ++ pub fn byte_string(bytes: &[u8]) -> Literal { ++ Literal::_new(imp::Literal::byte_string(bytes)) ++ } ++ ++ /// C string literal. ++ pub fn c_string(string: &CStr) -> Literal { ++ Literal::_new(imp::Literal::c_string(string)) ++ } ++ ++ /// Returns the span encompassing this literal. ++ pub fn span(&self) -> Span { ++ Span::_new(self.inner.span()) ++ } ++ ++ /// Configures the span associated for this literal. ++ pub fn set_span(&mut self, span: Span) { ++ self.inner.set_span(span.inner); ++ } ++ ++ /// Returns a `Span` that is a subset of `self.span()` containing only ++ /// the source bytes in range `range`. Returns `None` if the would-be ++ /// trimmed span is outside the bounds of `self`. ++ /// ++ /// Warning: the underlying [`proc_macro::Literal::subspan`] method is ++ /// nightly-only. When called from within a procedural macro not using a ++ /// nightly compiler, this method will always return `None`. ++ /// ++ /// [`proc_macro::Literal::subspan`]: https://doc.rust-lang.org/proc_macro/struct.Literal.html#method.subspan ++ pub fn subspan>(&self, range: R) -> Option { ++ self.inner.subspan(range).map(Span::_new) ++ } ++ ++ // Intended for the `quote!` macro to use when constructing a proc-macro2 ++ // token out of a macro_rules $:literal token, which is already known to be ++ // a valid literal. This avoids reparsing/validating the literal's string ++ // representation. This is not public API other than for quote. ++ #[doc(hidden)] ++ pub unsafe fn from_str_unchecked(repr: &str) -> Self { ++ Literal::_new(unsafe { imp::Literal::from_str_unchecked(repr) }) ++ } ++} ++ ++impl FromStr for Literal { ++ type Err = LexError; ++ ++ fn from_str(repr: &str) -> Result { ++ match imp::Literal::from_str_checked(repr) { ++ Ok(lit) => Ok(Literal::_new(lit)), ++ Err(lex) => Err(LexError { ++ inner: lex, ++ _marker: MARKER, ++ }), ++ } ++ } ++} ++ ++impl Debug for Literal { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ Debug::fmt(&self.inner, f) ++ } ++} ++ ++impl Display for Literal { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ Display::fmt(&self.inner, f) ++ } ++} ++ ++/// Public implementation details for the `TokenStream` type, such as iterators. ++pub mod token_stream { ++ use crate::marker::{ProcMacroAutoTraits, MARKER}; ++ use crate::{imp, TokenTree}; ++ use core::fmt::{self, Debug}; ++ ++ pub use crate::TokenStream; ++ ++ /// An iterator over `TokenStream`'s `TokenTree`s. ++ /// ++ /// The iteration is "shallow", e.g. the iterator doesn't recurse into ++ /// delimited groups, and returns whole groups as token trees. ++ #[derive(Clone)] ++ pub struct IntoIter { ++ inner: imp::TokenTreeIter, ++ _marker: ProcMacroAutoTraits, ++ } ++ ++ impl Iterator for IntoIter { ++ type Item = TokenTree; ++ ++ fn next(&mut self) -> Option { ++ self.inner.next() ++ } ++ ++ fn size_hint(&self) -> (usize, Option) { ++ self.inner.size_hint() ++ } ++ } ++ ++ impl Debug for IntoIter { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ f.write_str("TokenStream ")?; ++ f.debug_list().entries(self.clone()).finish() ++ } ++ } ++ ++ impl IntoIterator for TokenStream { ++ type Item = TokenTree; ++ type IntoIter = IntoIter; ++ ++ fn into_iter(self) -> IntoIter { ++ IntoIter { ++ inner: self.inner.into_iter(), ++ _marker: MARKER, ++ } ++ } ++ } ++} +diff -Nru mesa-25.3.3/subprojects/proc-macro2-1.0.92/src/location.rs mesa-25.3.3/subprojects/proc-macro2-1.0.92/src/location.rs +--- mesa-25.3.3/subprojects/proc-macro2-1.0.92/src/location.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/proc-macro2-1.0.92/src/location.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,29 @@ ++use core::cmp::Ordering; ++ ++/// A line-column pair representing the start or end of a `Span`. ++/// ++/// This type is semver exempt and not exposed by default. ++#[cfg_attr(docsrs, doc(cfg(feature = "span-locations")))] ++#[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] ++pub struct LineColumn { ++ /// The 1-indexed line in the source file on which the span starts or ends ++ /// (inclusive). ++ pub line: usize, ++ /// The 0-indexed column (in UTF-8 characters) in the source file on which ++ /// the span starts or ends (inclusive). ++ pub column: usize, ++} ++ ++impl Ord for LineColumn { ++ fn cmp(&self, other: &Self) -> Ordering { ++ self.line ++ .cmp(&other.line) ++ .then(self.column.cmp(&other.column)) ++ } ++} ++ ++impl PartialOrd for LineColumn { ++ fn partial_cmp(&self, other: &Self) -> Option { ++ Some(self.cmp(other)) ++ } ++} +diff -Nru mesa-25.3.3/subprojects/proc-macro2-1.0.92/src/marker.rs mesa-25.3.3/subprojects/proc-macro2-1.0.92/src/marker.rs +--- mesa-25.3.3/subprojects/proc-macro2-1.0.92/src/marker.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/proc-macro2-1.0.92/src/marker.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,17 @@ ++use alloc::rc::Rc; ++use core::marker::PhantomData; ++use core::panic::{RefUnwindSafe, UnwindSafe}; ++ ++// Zero sized marker with the correct set of autotrait impls we want all proc ++// macro types to have. ++#[derive(Copy, Clone)] ++#[cfg_attr( ++ all(procmacro2_semver_exempt, any(not(wrap_proc_macro), super_unstable)), ++ derive(PartialEq, Eq) ++)] ++pub(crate) struct ProcMacroAutoTraits(PhantomData>); ++ ++pub(crate) const MARKER: ProcMacroAutoTraits = ProcMacroAutoTraits(PhantomData); ++ ++impl UnwindSafe for ProcMacroAutoTraits {} ++impl RefUnwindSafe for ProcMacroAutoTraits {} +diff -Nru mesa-25.3.3/subprojects/proc-macro2-1.0.92/src/parse.rs mesa-25.3.3/subprojects/proc-macro2-1.0.92/src/parse.rs +--- mesa-25.3.3/subprojects/proc-macro2-1.0.92/src/parse.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/proc-macro2-1.0.92/src/parse.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,992 @@ ++use crate::fallback::{ ++ self, is_ident_continue, is_ident_start, Group, Ident, LexError, Literal, Span, TokenStream, ++ TokenStreamBuilder, ++}; ++use crate::{Delimiter, Punct, Spacing, TokenTree}; ++use core::char; ++use core::str::{Bytes, CharIndices, Chars}; ++ ++#[derive(Copy, Clone, Eq, PartialEq)] ++pub(crate) struct Cursor<'a> { ++ pub(crate) rest: &'a str, ++ #[cfg(span_locations)] ++ pub(crate) off: u32, ++} ++ ++impl<'a> Cursor<'a> { ++ pub(crate) fn advance(&self, bytes: usize) -> Cursor<'a> { ++ let (_front, rest) = self.rest.split_at(bytes); ++ Cursor { ++ rest, ++ #[cfg(span_locations)] ++ off: self.off + _front.chars().count() as u32, ++ } ++ } ++ ++ pub(crate) fn starts_with(&self, s: &str) -> bool { ++ self.rest.starts_with(s) ++ } ++ ++ pub(crate) fn starts_with_char(&self, ch: char) -> bool { ++ self.rest.starts_with(ch) ++ } ++ ++ pub(crate) fn starts_with_fn(&self, f: Pattern) -> bool ++ where ++ Pattern: FnMut(char) -> bool, ++ { ++ self.rest.starts_with(f) ++ } ++ ++ pub(crate) fn is_empty(&self) -> bool { ++ self.rest.is_empty() ++ } ++ ++ fn len(&self) -> usize { ++ self.rest.len() ++ } ++ ++ fn as_bytes(&self) -> &'a [u8] { ++ self.rest.as_bytes() ++ } ++ ++ fn bytes(&self) -> Bytes<'a> { ++ self.rest.bytes() ++ } ++ ++ fn chars(&self) -> Chars<'a> { ++ self.rest.chars() ++ } ++ ++ fn char_indices(&self) -> CharIndices<'a> { ++ self.rest.char_indices() ++ } ++ ++ fn parse(&self, tag: &str) -> Result, Reject> { ++ if self.starts_with(tag) { ++ Ok(self.advance(tag.len())) ++ } else { ++ Err(Reject) ++ } ++ } ++} ++ ++pub(crate) struct Reject; ++type PResult<'a, O> = Result<(Cursor<'a>, O), Reject>; ++ ++fn skip_whitespace(input: Cursor) -> Cursor { ++ let mut s = input; ++ ++ while !s.is_empty() { ++ let byte = s.as_bytes()[0]; ++ if byte == b'/' { ++ if s.starts_with("//") ++ && (!s.starts_with("///") || s.starts_with("////")) ++ && !s.starts_with("//!") ++ { ++ let (cursor, _) = take_until_newline_or_eof(s); ++ s = cursor; ++ continue; ++ } else if s.starts_with("/**/") { ++ s = s.advance(4); ++ continue; ++ } else if s.starts_with("/*") ++ && (!s.starts_with("/**") || s.starts_with("/***")) ++ && !s.starts_with("/*!") ++ { ++ match block_comment(s) { ++ Ok((rest, _)) => { ++ s = rest; ++ continue; ++ } ++ Err(Reject) => return s, ++ } ++ } ++ } ++ match byte { ++ b' ' | 0x09..=0x0d => { ++ s = s.advance(1); ++ continue; ++ } ++ b if b.is_ascii() => {} ++ _ => { ++ let ch = s.chars().next().unwrap(); ++ if is_whitespace(ch) { ++ s = s.advance(ch.len_utf8()); ++ continue; ++ } ++ } ++ } ++ return s; ++ } ++ s ++} ++ ++fn block_comment(input: Cursor) -> PResult<&str> { ++ if !input.starts_with("/*") { ++ return Err(Reject); ++ } ++ ++ let mut depth = 0usize; ++ let bytes = input.as_bytes(); ++ let mut i = 0usize; ++ let upper = bytes.len() - 1; ++ ++ while i < upper { ++ if bytes[i] == b'/' && bytes[i + 1] == b'*' { ++ depth += 1; ++ i += 1; // eat '*' ++ } else if bytes[i] == b'*' && bytes[i + 1] == b'/' { ++ depth -= 1; ++ if depth == 0 { ++ return Ok((input.advance(i + 2), &input.rest[..i + 2])); ++ } ++ i += 1; // eat '/' ++ } ++ i += 1; ++ } ++ ++ Err(Reject) ++} ++ ++fn is_whitespace(ch: char) -> bool { ++ // Rust treats left-to-right mark and right-to-left mark as whitespace ++ ch.is_whitespace() || ch == '\u{200e}' || ch == '\u{200f}' ++} ++ ++fn word_break(input: Cursor) -> Result { ++ match input.chars().next() { ++ Some(ch) if is_ident_continue(ch) => Err(Reject), ++ Some(_) | None => Ok(input), ++ } ++} ++ ++// Rustc's representation of a macro expansion error in expression position or ++// type position. ++const ERROR: &str = "(/*ERROR*/)"; ++ ++pub(crate) fn token_stream(mut input: Cursor) -> Result { ++ let mut trees = TokenStreamBuilder::new(); ++ let mut stack = Vec::new(); ++ ++ loop { ++ input = skip_whitespace(input); ++ ++ if let Ok((rest, ())) = doc_comment(input, &mut trees) { ++ input = rest; ++ continue; ++ } ++ ++ #[cfg(span_locations)] ++ let lo = input.off; ++ ++ let first = match input.bytes().next() { ++ Some(first) => first, ++ None => match stack.last() { ++ None => return Ok(trees.build()), ++ #[cfg(span_locations)] ++ Some((lo, _frame)) => { ++ return Err(LexError { ++ span: Span { lo: *lo, hi: *lo }, ++ }) ++ } ++ #[cfg(not(span_locations))] ++ Some(_frame) => return Err(LexError { span: Span {} }), ++ }, ++ }; ++ ++ if let Some(open_delimiter) = match first { ++ b'(' if !input.starts_with(ERROR) => Some(Delimiter::Parenthesis), ++ b'[' => Some(Delimiter::Bracket), ++ b'{' => Some(Delimiter::Brace), ++ _ => None, ++ } { ++ input = input.advance(1); ++ let frame = (open_delimiter, trees); ++ #[cfg(span_locations)] ++ let frame = (lo, frame); ++ stack.push(frame); ++ trees = TokenStreamBuilder::new(); ++ } else if let Some(close_delimiter) = match first { ++ b')' => Some(Delimiter::Parenthesis), ++ b']' => Some(Delimiter::Bracket), ++ b'}' => Some(Delimiter::Brace), ++ _ => None, ++ } { ++ let frame = match stack.pop() { ++ Some(frame) => frame, ++ None => return Err(lex_error(input)), ++ }; ++ #[cfg(span_locations)] ++ let (lo, frame) = frame; ++ let (open_delimiter, outer) = frame; ++ if open_delimiter != close_delimiter { ++ return Err(lex_error(input)); ++ } ++ input = input.advance(1); ++ let mut g = Group::new(open_delimiter, trees.build()); ++ g.set_span(Span { ++ #[cfg(span_locations)] ++ lo, ++ #[cfg(span_locations)] ++ hi: input.off, ++ }); ++ trees = outer; ++ trees.push_token_from_parser(TokenTree::Group(crate::Group::_new_fallback(g))); ++ } else { ++ let (rest, mut tt) = match leaf_token(input) { ++ Ok((rest, tt)) => (rest, tt), ++ Err(Reject) => return Err(lex_error(input)), ++ }; ++ tt.set_span(crate::Span::_new_fallback(Span { ++ #[cfg(span_locations)] ++ lo, ++ #[cfg(span_locations)] ++ hi: rest.off, ++ })); ++ trees.push_token_from_parser(tt); ++ input = rest; ++ } ++ } ++} ++ ++fn lex_error(cursor: Cursor) -> LexError { ++ #[cfg(not(span_locations))] ++ let _ = cursor; ++ LexError { ++ span: Span { ++ #[cfg(span_locations)] ++ lo: cursor.off, ++ #[cfg(span_locations)] ++ hi: cursor.off, ++ }, ++ } ++} ++ ++fn leaf_token(input: Cursor) -> PResult { ++ if let Ok((input, l)) = literal(input) { ++ // must be parsed before ident ++ Ok((input, TokenTree::Literal(crate::Literal::_new_fallback(l)))) ++ } else if let Ok((input, p)) = punct(input) { ++ Ok((input, TokenTree::Punct(p))) ++ } else if let Ok((input, i)) = ident(input) { ++ Ok((input, TokenTree::Ident(i))) ++ } else if input.starts_with(ERROR) { ++ let rest = input.advance(ERROR.len()); ++ let repr = crate::Literal::_new_fallback(Literal::_new(ERROR.to_owned())); ++ Ok((rest, TokenTree::Literal(repr))) ++ } else { ++ Err(Reject) ++ } ++} ++ ++fn ident(input: Cursor) -> PResult { ++ if [ ++ "r\"", "r#\"", "r##", "b\"", "b\'", "br\"", "br#", "c\"", "cr\"", "cr#", ++ ] ++ .iter() ++ .any(|prefix| input.starts_with(prefix)) ++ { ++ Err(Reject) ++ } else { ++ ident_any(input) ++ } ++} ++ ++fn ident_any(input: Cursor) -> PResult { ++ let raw = input.starts_with("r#"); ++ let rest = input.advance((raw as usize) << 1); ++ ++ let (rest, sym) = ident_not_raw(rest)?; ++ ++ if !raw { ++ let ident = ++ crate::Ident::_new_fallback(Ident::new_unchecked(sym, fallback::Span::call_site())); ++ return Ok((rest, ident)); ++ } ++ ++ match sym { ++ "_" | "super" | "self" | "Self" | "crate" => return Err(Reject), ++ _ => {} ++ } ++ ++ let ident = ++ crate::Ident::_new_fallback(Ident::new_raw_unchecked(sym, fallback::Span::call_site())); ++ Ok((rest, ident)) ++} ++ ++fn ident_not_raw(input: Cursor) -> PResult<&str> { ++ let mut chars = input.char_indices(); ++ ++ match chars.next() { ++ Some((_, ch)) if is_ident_start(ch) => {} ++ _ => return Err(Reject), ++ } ++ ++ let mut end = input.len(); ++ for (i, ch) in chars { ++ if !is_ident_continue(ch) { ++ end = i; ++ break; ++ } ++ } ++ ++ Ok((input.advance(end), &input.rest[..end])) ++} ++ ++pub(crate) fn literal(input: Cursor) -> PResult { ++ let rest = literal_nocapture(input)?; ++ let end = input.len() - rest.len(); ++ Ok((rest, Literal::_new(input.rest[..end].to_string()))) ++} ++ ++fn literal_nocapture(input: Cursor) -> Result { ++ if let Ok(ok) = string(input) { ++ Ok(ok) ++ } else if let Ok(ok) = byte_string(input) { ++ Ok(ok) ++ } else if let Ok(ok) = c_string(input) { ++ Ok(ok) ++ } else if let Ok(ok) = byte(input) { ++ Ok(ok) ++ } else if let Ok(ok) = character(input) { ++ Ok(ok) ++ } else if let Ok(ok) = float(input) { ++ Ok(ok) ++ } else if let Ok(ok) = int(input) { ++ Ok(ok) ++ } else { ++ Err(Reject) ++ } ++} ++ ++fn literal_suffix(input: Cursor) -> Cursor { ++ match ident_not_raw(input) { ++ Ok((input, _)) => input, ++ Err(Reject) => input, ++ } ++} ++ ++fn string(input: Cursor) -> Result { ++ if let Ok(input) = input.parse("\"") { ++ cooked_string(input) ++ } else if let Ok(input) = input.parse("r") { ++ raw_string(input) ++ } else { ++ Err(Reject) ++ } ++} ++ ++fn cooked_string(mut input: Cursor) -> Result { ++ let mut chars = input.char_indices(); ++ ++ while let Some((i, ch)) = chars.next() { ++ match ch { ++ '"' => { ++ let input = input.advance(i + 1); ++ return Ok(literal_suffix(input)); ++ } ++ '\r' => match chars.next() { ++ Some((_, '\n')) => {} ++ _ => break, ++ }, ++ '\\' => match chars.next() { ++ Some((_, 'x')) => { ++ backslash_x_char(&mut chars)?; ++ } ++ Some((_, 'n' | 'r' | 't' | '\\' | '\'' | '"' | '0')) => {} ++ Some((_, 'u')) => { ++ backslash_u(&mut chars)?; ++ } ++ Some((newline, ch @ ('\n' | '\r'))) => { ++ input = input.advance(newline + 1); ++ trailing_backslash(&mut input, ch as u8)?; ++ chars = input.char_indices(); ++ } ++ _ => break, ++ }, ++ _ch => {} ++ } ++ } ++ Err(Reject) ++} ++ ++fn raw_string(input: Cursor) -> Result { ++ let (input, delimiter) = delimiter_of_raw_string(input)?; ++ let mut bytes = input.bytes().enumerate(); ++ while let Some((i, byte)) = bytes.next() { ++ match byte { ++ b'"' if input.rest[i + 1..].starts_with(delimiter) => { ++ let rest = input.advance(i + 1 + delimiter.len()); ++ return Ok(literal_suffix(rest)); ++ } ++ b'\r' => match bytes.next() { ++ Some((_, b'\n')) => {} ++ _ => break, ++ }, ++ _ => {} ++ } ++ } ++ Err(Reject) ++} ++ ++fn byte_string(input: Cursor) -> Result { ++ if let Ok(input) = input.parse("b\"") { ++ cooked_byte_string(input) ++ } else if let Ok(input) = input.parse("br") { ++ raw_byte_string(input) ++ } else { ++ Err(Reject) ++ } ++} ++ ++fn cooked_byte_string(mut input: Cursor) -> Result { ++ let mut bytes = input.bytes().enumerate(); ++ while let Some((offset, b)) = bytes.next() { ++ match b { ++ b'"' => { ++ let input = input.advance(offset + 1); ++ return Ok(literal_suffix(input)); ++ } ++ b'\r' => match bytes.next() { ++ Some((_, b'\n')) => {} ++ _ => break, ++ }, ++ b'\\' => match bytes.next() { ++ Some((_, b'x')) => { ++ backslash_x_byte(&mut bytes)?; ++ } ++ Some((_, b'n' | b'r' | b't' | b'\\' | b'0' | b'\'' | b'"')) => {} ++ Some((newline, b @ (b'\n' | b'\r'))) => { ++ input = input.advance(newline + 1); ++ trailing_backslash(&mut input, b)?; ++ bytes = input.bytes().enumerate(); ++ } ++ _ => break, ++ }, ++ b if b.is_ascii() => {} ++ _ => break, ++ } ++ } ++ Err(Reject) ++} ++ ++fn delimiter_of_raw_string(input: Cursor) -> PResult<&str> { ++ for (i, byte) in input.bytes().enumerate() { ++ match byte { ++ b'"' => { ++ if i > 255 { ++ // https://github.com/rust-lang/rust/pull/95251 ++ return Err(Reject); ++ } ++ return Ok((input.advance(i + 1), &input.rest[..i])); ++ } ++ b'#' => {} ++ _ => break, ++ } ++ } ++ Err(Reject) ++} ++ ++fn raw_byte_string(input: Cursor) -> Result { ++ let (input, delimiter) = delimiter_of_raw_string(input)?; ++ let mut bytes = input.bytes().enumerate(); ++ while let Some((i, byte)) = bytes.next() { ++ match byte { ++ b'"' if input.rest[i + 1..].starts_with(delimiter) => { ++ let rest = input.advance(i + 1 + delimiter.len()); ++ return Ok(literal_suffix(rest)); ++ } ++ b'\r' => match bytes.next() { ++ Some((_, b'\n')) => {} ++ _ => break, ++ }, ++ other => { ++ if !other.is_ascii() { ++ break; ++ } ++ } ++ } ++ } ++ Err(Reject) ++} ++ ++fn c_string(input: Cursor) -> Result { ++ if let Ok(input) = input.parse("c\"") { ++ cooked_c_string(input) ++ } else if let Ok(input) = input.parse("cr") { ++ raw_c_string(input) ++ } else { ++ Err(Reject) ++ } ++} ++ ++fn raw_c_string(input: Cursor) -> Result { ++ let (input, delimiter) = delimiter_of_raw_string(input)?; ++ let mut bytes = input.bytes().enumerate(); ++ while let Some((i, byte)) = bytes.next() { ++ match byte { ++ b'"' if input.rest[i + 1..].starts_with(delimiter) => { ++ let rest = input.advance(i + 1 + delimiter.len()); ++ return Ok(literal_suffix(rest)); ++ } ++ b'\r' => match bytes.next() { ++ Some((_, b'\n')) => {} ++ _ => break, ++ }, ++ b'\0' => break, ++ _ => {} ++ } ++ } ++ Err(Reject) ++} ++ ++fn cooked_c_string(mut input: Cursor) -> Result { ++ let mut chars = input.char_indices(); ++ ++ while let Some((i, ch)) = chars.next() { ++ match ch { ++ '"' => { ++ let input = input.advance(i + 1); ++ return Ok(literal_suffix(input)); ++ } ++ '\r' => match chars.next() { ++ Some((_, '\n')) => {} ++ _ => break, ++ }, ++ '\\' => match chars.next() { ++ Some((_, 'x')) => { ++ backslash_x_nonzero(&mut chars)?; ++ } ++ Some((_, 'n' | 'r' | 't' | '\\' | '\'' | '"')) => {} ++ Some((_, 'u')) => { ++ if backslash_u(&mut chars)? == '\0' { ++ break; ++ } ++ } ++ Some((newline, ch @ ('\n' | '\r'))) => { ++ input = input.advance(newline + 1); ++ trailing_backslash(&mut input, ch as u8)?; ++ chars = input.char_indices(); ++ } ++ _ => break, ++ }, ++ '\0' => break, ++ _ch => {} ++ } ++ } ++ Err(Reject) ++} ++ ++fn byte(input: Cursor) -> Result { ++ let input = input.parse("b'")?; ++ let mut bytes = input.bytes().enumerate(); ++ let ok = match bytes.next().map(|(_, b)| b) { ++ Some(b'\\') => match bytes.next().map(|(_, b)| b) { ++ Some(b'x') => backslash_x_byte(&mut bytes).is_ok(), ++ Some(b'n' | b'r' | b't' | b'\\' | b'0' | b'\'' | b'"') => true, ++ _ => false, ++ }, ++ b => b.is_some(), ++ }; ++ if !ok { ++ return Err(Reject); ++ } ++ let (offset, _) = bytes.next().ok_or(Reject)?; ++ if !input.chars().as_str().is_char_boundary(offset) { ++ return Err(Reject); ++ } ++ let input = input.advance(offset).parse("'")?; ++ Ok(literal_suffix(input)) ++} ++ ++fn character(input: Cursor) -> Result { ++ let input = input.parse("'")?; ++ let mut chars = input.char_indices(); ++ let ok = match chars.next().map(|(_, ch)| ch) { ++ Some('\\') => match chars.next().map(|(_, ch)| ch) { ++ Some('x') => backslash_x_char(&mut chars).is_ok(), ++ Some('u') => backslash_u(&mut chars).is_ok(), ++ Some('n' | 'r' | 't' | '\\' | '0' | '\'' | '"') => true, ++ _ => false, ++ }, ++ ch => ch.is_some(), ++ }; ++ if !ok { ++ return Err(Reject); ++ } ++ let (idx, _) = chars.next().ok_or(Reject)?; ++ let input = input.advance(idx).parse("'")?; ++ Ok(literal_suffix(input)) ++} ++ ++macro_rules! next_ch { ++ ($chars:ident @ $pat:pat) => { ++ match $chars.next() { ++ Some((_, ch)) => match ch { ++ $pat => ch, ++ _ => return Err(Reject), ++ }, ++ None => return Err(Reject), ++ } ++ }; ++} ++ ++fn backslash_x_char(chars: &mut I) -> Result<(), Reject> ++where ++ I: Iterator, ++{ ++ next_ch!(chars @ '0'..='7'); ++ next_ch!(chars @ '0'..='9' | 'a'..='f' | 'A'..='F'); ++ Ok(()) ++} ++ ++fn backslash_x_byte(chars: &mut I) -> Result<(), Reject> ++where ++ I: Iterator, ++{ ++ next_ch!(chars @ b'0'..=b'9' | b'a'..=b'f' | b'A'..=b'F'); ++ next_ch!(chars @ b'0'..=b'9' | b'a'..=b'f' | b'A'..=b'F'); ++ Ok(()) ++} ++ ++fn backslash_x_nonzero(chars: &mut I) -> Result<(), Reject> ++where ++ I: Iterator, ++{ ++ let first = next_ch!(chars @ '0'..='9' | 'a'..='f' | 'A'..='F'); ++ let second = next_ch!(chars @ '0'..='9' | 'a'..='f' | 'A'..='F'); ++ if first == '0' && second == '0' { ++ Err(Reject) ++ } else { ++ Ok(()) ++ } ++} ++ ++fn backslash_u(chars: &mut I) -> Result ++where ++ I: Iterator, ++{ ++ next_ch!(chars @ '{'); ++ let mut value = 0; ++ let mut len = 0; ++ for (_, ch) in chars { ++ let digit = match ch { ++ '0'..='9' => ch as u8 - b'0', ++ 'a'..='f' => 10 + ch as u8 - b'a', ++ 'A'..='F' => 10 + ch as u8 - b'A', ++ '_' if len > 0 => continue, ++ '}' if len > 0 => return char::from_u32(value).ok_or(Reject), ++ _ => break, ++ }; ++ if len == 6 { ++ break; ++ } ++ value *= 0x10; ++ value += u32::from(digit); ++ len += 1; ++ } ++ Err(Reject) ++} ++ ++fn trailing_backslash(input: &mut Cursor, mut last: u8) -> Result<(), Reject> { ++ let mut whitespace = input.bytes().enumerate(); ++ loop { ++ if last == b'\r' && whitespace.next().map_or(true, |(_, b)| b != b'\n') { ++ return Err(Reject); ++ } ++ match whitespace.next() { ++ Some((_, b @ (b' ' | b'\t' | b'\n' | b'\r'))) => { ++ last = b; ++ } ++ Some((offset, _)) => { ++ *input = input.advance(offset); ++ return Ok(()); ++ } ++ None => return Err(Reject), ++ } ++ } ++} ++ ++fn float(input: Cursor) -> Result { ++ let mut rest = float_digits(input)?; ++ if let Some(ch) = rest.chars().next() { ++ if is_ident_start(ch) { ++ rest = ident_not_raw(rest)?.0; ++ } ++ } ++ word_break(rest) ++} ++ ++fn float_digits(input: Cursor) -> Result { ++ let mut chars = input.chars().peekable(); ++ match chars.next() { ++ Some(ch) if '0' <= ch && ch <= '9' => {} ++ _ => return Err(Reject), ++ } ++ ++ let mut len = 1; ++ let mut has_dot = false; ++ let mut has_exp = false; ++ while let Some(&ch) = chars.peek() { ++ match ch { ++ '0'..='9' | '_' => { ++ chars.next(); ++ len += 1; ++ } ++ '.' => { ++ if has_dot { ++ break; ++ } ++ chars.next(); ++ if chars ++ .peek() ++ .map_or(false, |&ch| ch == '.' || is_ident_start(ch)) ++ { ++ return Err(Reject); ++ } ++ len += 1; ++ has_dot = true; ++ } ++ 'e' | 'E' => { ++ chars.next(); ++ len += 1; ++ has_exp = true; ++ break; ++ } ++ _ => break, ++ } ++ } ++ ++ if !(has_dot || has_exp) { ++ return Err(Reject); ++ } ++ ++ if has_exp { ++ let token_before_exp = if has_dot { ++ Ok(input.advance(len - 1)) ++ } else { ++ Err(Reject) ++ }; ++ let mut has_sign = false; ++ let mut has_exp_value = false; ++ while let Some(&ch) = chars.peek() { ++ match ch { ++ '+' | '-' => { ++ if has_exp_value { ++ break; ++ } ++ if has_sign { ++ return token_before_exp; ++ } ++ chars.next(); ++ len += 1; ++ has_sign = true; ++ } ++ '0'..='9' => { ++ chars.next(); ++ len += 1; ++ has_exp_value = true; ++ } ++ '_' => { ++ chars.next(); ++ len += 1; ++ } ++ _ => break, ++ } ++ } ++ if !has_exp_value { ++ return token_before_exp; ++ } ++ } ++ ++ Ok(input.advance(len)) ++} ++ ++fn int(input: Cursor) -> Result { ++ let mut rest = digits(input)?; ++ if let Some(ch) = rest.chars().next() { ++ if is_ident_start(ch) { ++ rest = ident_not_raw(rest)?.0; ++ } ++ } ++ word_break(rest) ++} ++ ++fn digits(mut input: Cursor) -> Result { ++ let base = if input.starts_with("0x") { ++ input = input.advance(2); ++ 16 ++ } else if input.starts_with("0o") { ++ input = input.advance(2); ++ 8 ++ } else if input.starts_with("0b") { ++ input = input.advance(2); ++ 2 ++ } else { ++ 10 ++ }; ++ ++ let mut len = 0; ++ let mut empty = true; ++ for b in input.bytes() { ++ match b { ++ b'0'..=b'9' => { ++ let digit = (b - b'0') as u64; ++ if digit >= base { ++ return Err(Reject); ++ } ++ } ++ b'a'..=b'f' => { ++ let digit = 10 + (b - b'a') as u64; ++ if digit >= base { ++ break; ++ } ++ } ++ b'A'..=b'F' => { ++ let digit = 10 + (b - b'A') as u64; ++ if digit >= base { ++ break; ++ } ++ } ++ b'_' => { ++ if empty && base == 10 { ++ return Err(Reject); ++ } ++ len += 1; ++ continue; ++ } ++ _ => break, ++ }; ++ len += 1; ++ empty = false; ++ } ++ if empty { ++ Err(Reject) ++ } else { ++ Ok(input.advance(len)) ++ } ++} ++ ++fn punct(input: Cursor) -> PResult { ++ let (rest, ch) = punct_char(input)?; ++ if ch == '\'' { ++ if ident_any(rest)?.0.starts_with_char('\'') { ++ Err(Reject) ++ } else { ++ Ok((rest, Punct::new('\'', Spacing::Joint))) ++ } ++ } else { ++ let kind = match punct_char(rest) { ++ Ok(_) => Spacing::Joint, ++ Err(Reject) => Spacing::Alone, ++ }; ++ Ok((rest, Punct::new(ch, kind))) ++ } ++} ++ ++fn punct_char(input: Cursor) -> PResult { ++ if input.starts_with("//") || input.starts_with("/*") { ++ // Do not accept `/` of a comment as a punct. ++ return Err(Reject); ++ } ++ ++ let mut chars = input.chars(); ++ let first = match chars.next() { ++ Some(ch) => ch, ++ None => { ++ return Err(Reject); ++ } ++ }; ++ let recognized = "~!@#$%^&*-=+|;:,<.>/?'"; ++ if recognized.contains(first) { ++ Ok((input.advance(first.len_utf8()), first)) ++ } else { ++ Err(Reject) ++ } ++} ++ ++fn doc_comment<'a>(input: Cursor<'a>, trees: &mut TokenStreamBuilder) -> PResult<'a, ()> { ++ #[cfg(span_locations)] ++ let lo = input.off; ++ let (rest, (comment, inner)) = doc_comment_contents(input)?; ++ let fallback_span = Span { ++ #[cfg(span_locations)] ++ lo, ++ #[cfg(span_locations)] ++ hi: rest.off, ++ }; ++ let span = crate::Span::_new_fallback(fallback_span); ++ ++ let mut scan_for_bare_cr = comment; ++ while let Some(cr) = scan_for_bare_cr.find('\r') { ++ let rest = &scan_for_bare_cr[cr + 1..]; ++ if !rest.starts_with('\n') { ++ return Err(Reject); ++ } ++ scan_for_bare_cr = rest; ++ } ++ ++ let mut pound = Punct::new('#', Spacing::Alone); ++ pound.set_span(span); ++ trees.push_token_from_parser(TokenTree::Punct(pound)); ++ ++ if inner { ++ let mut bang = Punct::new('!', Spacing::Alone); ++ bang.set_span(span); ++ trees.push_token_from_parser(TokenTree::Punct(bang)); ++ } ++ ++ let doc_ident = crate::Ident::_new_fallback(Ident::new_unchecked("doc", fallback_span)); ++ let mut equal = Punct::new('=', Spacing::Alone); ++ equal.set_span(span); ++ let mut literal = crate::Literal::_new_fallback(Literal::string(comment)); ++ literal.set_span(span); ++ let mut bracketed = TokenStreamBuilder::with_capacity(3); ++ bracketed.push_token_from_parser(TokenTree::Ident(doc_ident)); ++ bracketed.push_token_from_parser(TokenTree::Punct(equal)); ++ bracketed.push_token_from_parser(TokenTree::Literal(literal)); ++ let group = Group::new(Delimiter::Bracket, bracketed.build()); ++ let mut group = crate::Group::_new_fallback(group); ++ group.set_span(span); ++ trees.push_token_from_parser(TokenTree::Group(group)); ++ ++ Ok((rest, ())) ++} ++ ++fn doc_comment_contents(input: Cursor) -> PResult<(&str, bool)> { ++ if input.starts_with("//!") { ++ let input = input.advance(3); ++ let (input, s) = take_until_newline_or_eof(input); ++ Ok((input, (s, true))) ++ } else if input.starts_with("/*!") { ++ let (input, s) = block_comment(input)?; ++ Ok((input, (&s[3..s.len() - 2], true))) ++ } else if input.starts_with("///") { ++ let input = input.advance(3); ++ if input.starts_with_char('/') { ++ return Err(Reject); ++ } ++ let (input, s) = take_until_newline_or_eof(input); ++ Ok((input, (s, false))) ++ } else if input.starts_with("/**") && !input.rest[3..].starts_with('*') { ++ let (input, s) = block_comment(input)?; ++ Ok((input, (&s[3..s.len() - 2], false))) ++ } else { ++ Err(Reject) ++ } ++} ++ ++fn take_until_newline_or_eof(input: Cursor) -> (Cursor, &str) { ++ let chars = input.char_indices(); ++ ++ for (i, ch) in chars { ++ if ch == '\n' { ++ return (input.advance(i), &input.rest[..i]); ++ } else if ch == '\r' && input.rest[i + 1..].starts_with('\n') { ++ return (input.advance(i + 1), &input.rest[..i]); ++ } ++ } ++ ++ (input.advance(input.len()), input.rest) ++} +diff -Nru mesa-25.3.3/subprojects/proc-macro2-1.0.92/src/rcvec.rs mesa-25.3.3/subprojects/proc-macro2-1.0.92/src/rcvec.rs +--- mesa-25.3.3/subprojects/proc-macro2-1.0.92/src/rcvec.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/proc-macro2-1.0.92/src/rcvec.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,145 @@ ++use alloc::rc::Rc; ++use alloc::vec; ++use core::mem; ++use core::panic::RefUnwindSafe; ++use core::slice; ++ ++pub(crate) struct RcVec { ++ inner: Rc>, ++} ++ ++pub(crate) struct RcVecBuilder { ++ inner: Vec, ++} ++ ++pub(crate) struct RcVecMut<'a, T> { ++ inner: &'a mut Vec, ++} ++ ++#[derive(Clone)] ++pub(crate) struct RcVecIntoIter { ++ inner: vec::IntoIter, ++} ++ ++impl RcVec { ++ pub(crate) fn is_empty(&self) -> bool { ++ self.inner.is_empty() ++ } ++ ++ pub(crate) fn len(&self) -> usize { ++ self.inner.len() ++ } ++ ++ pub(crate) fn iter(&self) -> slice::Iter { ++ self.inner.iter() ++ } ++ ++ pub(crate) fn make_mut(&mut self) -> RcVecMut ++ where ++ T: Clone, ++ { ++ RcVecMut { ++ inner: Rc::make_mut(&mut self.inner), ++ } ++ } ++ ++ pub(crate) fn get_mut(&mut self) -> Option> { ++ let inner = Rc::get_mut(&mut self.inner)?; ++ Some(RcVecMut { inner }) ++ } ++ ++ pub(crate) fn make_owned(mut self) -> RcVecBuilder ++ where ++ T: Clone, ++ { ++ let vec = if let Some(owned) = Rc::get_mut(&mut self.inner) { ++ mem::take(owned) ++ } else { ++ Vec::clone(&self.inner) ++ }; ++ RcVecBuilder { inner: vec } ++ } ++} ++ ++impl RcVecBuilder { ++ pub(crate) fn new() -> Self { ++ RcVecBuilder { inner: Vec::new() } ++ } ++ ++ pub(crate) fn with_capacity(cap: usize) -> Self { ++ RcVecBuilder { ++ inner: Vec::with_capacity(cap), ++ } ++ } ++ ++ pub(crate) fn push(&mut self, element: T) { ++ self.inner.push(element); ++ } ++ ++ pub(crate) fn extend(&mut self, iter: impl IntoIterator) { ++ self.inner.extend(iter); ++ } ++ ++ pub(crate) fn as_mut(&mut self) -> RcVecMut { ++ RcVecMut { ++ inner: &mut self.inner, ++ } ++ } ++ ++ pub(crate) fn build(self) -> RcVec { ++ RcVec { ++ inner: Rc::new(self.inner), ++ } ++ } ++} ++ ++impl<'a, T> RcVecMut<'a, T> { ++ pub(crate) fn push(&mut self, element: T) { ++ self.inner.push(element); ++ } ++ ++ pub(crate) fn extend(&mut self, iter: impl IntoIterator) { ++ self.inner.extend(iter); ++ } ++ ++ pub(crate) fn pop(&mut self) -> Option { ++ self.inner.pop() ++ } ++ ++ pub(crate) fn as_mut(&mut self) -> RcVecMut { ++ RcVecMut { inner: self.inner } ++ } ++} ++ ++impl Clone for RcVec { ++ fn clone(&self) -> Self { ++ RcVec { ++ inner: Rc::clone(&self.inner), ++ } ++ } ++} ++ ++impl IntoIterator for RcVecBuilder { ++ type Item = T; ++ type IntoIter = RcVecIntoIter; ++ ++ fn into_iter(self) -> Self::IntoIter { ++ RcVecIntoIter { ++ inner: self.inner.into_iter(), ++ } ++ } ++} ++ ++impl Iterator for RcVecIntoIter { ++ type Item = T; ++ ++ fn next(&mut self) -> Option { ++ self.inner.next() ++ } ++ ++ fn size_hint(&self) -> (usize, Option) { ++ self.inner.size_hint() ++ } ++} ++ ++impl RefUnwindSafe for RcVec where T: RefUnwindSafe {} +diff -Nru mesa-25.3.3/subprojects/proc-macro2-1.0.92/src/wrapper.rs mesa-25.3.3/subprojects/proc-macro2-1.0.92/src/wrapper.rs +--- mesa-25.3.3/subprojects/proc-macro2-1.0.92/src/wrapper.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/proc-macro2-1.0.92/src/wrapper.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,1003 @@ ++use crate::detection::inside_proc_macro; ++use crate::fallback::{self, FromStr2 as _}; ++#[cfg(span_locations)] ++use crate::location::LineColumn; ++use crate::{Delimiter, Punct, Spacing, TokenTree}; ++use core::fmt::{self, Debug, Display}; ++#[cfg(span_locations)] ++use core::ops::Range; ++use core::ops::RangeBounds; ++use std::ffi::CStr; ++#[cfg(super_unstable)] ++use std::path::PathBuf; ++ ++#[derive(Clone)] ++pub(crate) enum TokenStream { ++ Compiler(DeferredTokenStream), ++ Fallback(fallback::TokenStream), ++} ++ ++// Work around https://github.com/rust-lang/rust/issues/65080. ++// In `impl Extend for TokenStream` which is used heavily by quote, ++// we hold on to the appended tokens and do proc_macro::TokenStream::extend as ++// late as possible to batch together consecutive uses of the Extend impl. ++#[derive(Clone)] ++pub(crate) struct DeferredTokenStream { ++ stream: proc_macro::TokenStream, ++ extra: Vec, ++} ++ ++pub(crate) enum LexError { ++ Compiler(proc_macro::LexError), ++ Fallback(fallback::LexError), ++ ++ // Rustc was supposed to return a LexError, but it panicked instead. ++ // https://github.com/rust-lang/rust/issues/58736 ++ CompilerPanic, ++} ++ ++#[cold] ++fn mismatch(line: u32) -> ! { ++ #[cfg(procmacro2_backtrace)] ++ { ++ let backtrace = std::backtrace::Backtrace::force_capture(); ++ panic!("compiler/fallback mismatch L{}\n\n{}", line, backtrace) ++ } ++ #[cfg(not(procmacro2_backtrace))] ++ { ++ panic!("compiler/fallback mismatch L{}", line) ++ } ++} ++ ++impl DeferredTokenStream { ++ fn new(stream: proc_macro::TokenStream) -> Self { ++ DeferredTokenStream { ++ stream, ++ extra: Vec::new(), ++ } ++ } ++ ++ fn is_empty(&self) -> bool { ++ self.stream.is_empty() && self.extra.is_empty() ++ } ++ ++ fn evaluate_now(&mut self) { ++ // If-check provides a fast short circuit for the common case of `extra` ++ // being empty, which saves a round trip over the proc macro bridge. ++ // Improves macro expansion time in winrt by 6% in debug mode. ++ if !self.extra.is_empty() { ++ self.stream.extend(self.extra.drain(..)); ++ } ++ } ++ ++ fn into_token_stream(mut self) -> proc_macro::TokenStream { ++ self.evaluate_now(); ++ self.stream ++ } ++} ++ ++impl TokenStream { ++ pub(crate) fn new() -> Self { ++ if inside_proc_macro() { ++ TokenStream::Compiler(DeferredTokenStream::new(proc_macro::TokenStream::new())) ++ } else { ++ TokenStream::Fallback(fallback::TokenStream::new()) ++ } ++ } ++ ++ pub(crate) fn from_str_checked(src: &str) -> Result { ++ if inside_proc_macro() { ++ Ok(TokenStream::Compiler(DeferredTokenStream::new( ++ proc_macro::TokenStream::from_str_checked(src)?, ++ ))) ++ } else { ++ Ok(TokenStream::Fallback( ++ fallback::TokenStream::from_str_checked(src)?, ++ )) ++ } ++ } ++ ++ pub(crate) fn is_empty(&self) -> bool { ++ match self { ++ TokenStream::Compiler(tts) => tts.is_empty(), ++ TokenStream::Fallback(tts) => tts.is_empty(), ++ } ++ } ++ ++ fn unwrap_nightly(self) -> proc_macro::TokenStream { ++ match self { ++ TokenStream::Compiler(s) => s.into_token_stream(), ++ TokenStream::Fallback(_) => mismatch(line!()), ++ } ++ } ++ ++ fn unwrap_stable(self) -> fallback::TokenStream { ++ match self { ++ TokenStream::Compiler(_) => mismatch(line!()), ++ TokenStream::Fallback(s) => s, ++ } ++ } ++} ++ ++impl Display for TokenStream { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ match self { ++ TokenStream::Compiler(tts) => Display::fmt(&tts.clone().into_token_stream(), f), ++ TokenStream::Fallback(tts) => Display::fmt(tts, f), ++ } ++ } ++} ++ ++impl From for TokenStream { ++ fn from(inner: proc_macro::TokenStream) -> Self { ++ TokenStream::Compiler(DeferredTokenStream::new(inner)) ++ } ++} ++ ++impl From for proc_macro::TokenStream { ++ fn from(inner: TokenStream) -> Self { ++ match inner { ++ TokenStream::Compiler(inner) => inner.into_token_stream(), ++ TokenStream::Fallback(inner) => { ++ proc_macro::TokenStream::from_str_unchecked(&inner.to_string()) ++ } ++ } ++ } ++} ++ ++impl From for TokenStream { ++ fn from(inner: fallback::TokenStream) -> Self { ++ TokenStream::Fallback(inner) ++ } ++} ++ ++// Assumes inside_proc_macro(). ++fn into_compiler_token(token: TokenTree) -> proc_macro::TokenTree { ++ match token { ++ TokenTree::Group(tt) => proc_macro::TokenTree::Group(tt.inner.unwrap_nightly()), ++ TokenTree::Punct(tt) => { ++ let spacing = match tt.spacing() { ++ Spacing::Joint => proc_macro::Spacing::Joint, ++ Spacing::Alone => proc_macro::Spacing::Alone, ++ }; ++ let mut punct = proc_macro::Punct::new(tt.as_char(), spacing); ++ punct.set_span(tt.span().inner.unwrap_nightly()); ++ proc_macro::TokenTree::Punct(punct) ++ } ++ TokenTree::Ident(tt) => proc_macro::TokenTree::Ident(tt.inner.unwrap_nightly()), ++ TokenTree::Literal(tt) => proc_macro::TokenTree::Literal(tt.inner.unwrap_nightly()), ++ } ++} ++ ++impl From for TokenStream { ++ fn from(token: TokenTree) -> Self { ++ if inside_proc_macro() { ++ TokenStream::Compiler(DeferredTokenStream::new(proc_macro::TokenStream::from( ++ into_compiler_token(token), ++ ))) ++ } else { ++ TokenStream::Fallback(fallback::TokenStream::from(token)) ++ } ++ } ++} ++ ++impl FromIterator for TokenStream { ++ fn from_iter>(trees: I) -> Self { ++ if inside_proc_macro() { ++ TokenStream::Compiler(DeferredTokenStream::new( ++ trees.into_iter().map(into_compiler_token).collect(), ++ )) ++ } else { ++ TokenStream::Fallback(trees.into_iter().collect()) ++ } ++ } ++} ++ ++impl FromIterator for TokenStream { ++ fn from_iter>(streams: I) -> Self { ++ let mut streams = streams.into_iter(); ++ match streams.next() { ++ Some(TokenStream::Compiler(mut first)) => { ++ first.evaluate_now(); ++ first.stream.extend(streams.map(|s| match s { ++ TokenStream::Compiler(s) => s.into_token_stream(), ++ TokenStream::Fallback(_) => mismatch(line!()), ++ })); ++ TokenStream::Compiler(first) ++ } ++ Some(TokenStream::Fallback(mut first)) => { ++ first.extend(streams.map(|s| match s { ++ TokenStream::Fallback(s) => s, ++ TokenStream::Compiler(_) => mismatch(line!()), ++ })); ++ TokenStream::Fallback(first) ++ } ++ None => TokenStream::new(), ++ } ++ } ++} ++ ++impl Extend for TokenStream { ++ fn extend>(&mut self, stream: I) { ++ match self { ++ TokenStream::Compiler(tts) => { ++ // Here is the reason for DeferredTokenStream. ++ for token in stream { ++ tts.extra.push(into_compiler_token(token)); ++ } ++ } ++ TokenStream::Fallback(tts) => tts.extend(stream), ++ } ++ } ++} ++ ++impl Extend for TokenStream { ++ fn extend>(&mut self, streams: I) { ++ match self { ++ TokenStream::Compiler(tts) => { ++ tts.evaluate_now(); ++ tts.stream ++ .extend(streams.into_iter().map(TokenStream::unwrap_nightly)); ++ } ++ TokenStream::Fallback(tts) => { ++ tts.extend(streams.into_iter().map(TokenStream::unwrap_stable)); ++ } ++ } ++ } ++} ++ ++impl Debug for TokenStream { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ match self { ++ TokenStream::Compiler(tts) => Debug::fmt(&tts.clone().into_token_stream(), f), ++ TokenStream::Fallback(tts) => Debug::fmt(tts, f), ++ } ++ } ++} ++ ++impl LexError { ++ pub(crate) fn span(&self) -> Span { ++ match self { ++ LexError::Compiler(_) | LexError::CompilerPanic => Span::call_site(), ++ LexError::Fallback(e) => Span::Fallback(e.span()), ++ } ++ } ++} ++ ++impl From for LexError { ++ fn from(e: proc_macro::LexError) -> Self { ++ LexError::Compiler(e) ++ } ++} ++ ++impl From for LexError { ++ fn from(e: fallback::LexError) -> Self { ++ LexError::Fallback(e) ++ } ++} ++ ++impl Debug for LexError { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ match self { ++ LexError::Compiler(e) => Debug::fmt(e, f), ++ LexError::Fallback(e) => Debug::fmt(e, f), ++ LexError::CompilerPanic => { ++ let fallback = fallback::LexError::call_site(); ++ Debug::fmt(&fallback, f) ++ } ++ } ++ } ++} ++ ++impl Display for LexError { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ match self { ++ LexError::Compiler(e) => Display::fmt(e, f), ++ LexError::Fallback(e) => Display::fmt(e, f), ++ LexError::CompilerPanic => { ++ let fallback = fallback::LexError::call_site(); ++ Display::fmt(&fallback, f) ++ } ++ } ++ } ++} ++ ++#[derive(Clone)] ++pub(crate) enum TokenTreeIter { ++ Compiler(proc_macro::token_stream::IntoIter), ++ Fallback(fallback::TokenTreeIter), ++} ++ ++impl IntoIterator for TokenStream { ++ type Item = TokenTree; ++ type IntoIter = TokenTreeIter; ++ ++ fn into_iter(self) -> TokenTreeIter { ++ match self { ++ TokenStream::Compiler(tts) => { ++ TokenTreeIter::Compiler(tts.into_token_stream().into_iter()) ++ } ++ TokenStream::Fallback(tts) => TokenTreeIter::Fallback(tts.into_iter()), ++ } ++ } ++} ++ ++impl Iterator for TokenTreeIter { ++ type Item = TokenTree; ++ ++ fn next(&mut self) -> Option { ++ let token = match self { ++ TokenTreeIter::Compiler(iter) => iter.next()?, ++ TokenTreeIter::Fallback(iter) => return iter.next(), ++ }; ++ Some(match token { ++ proc_macro::TokenTree::Group(tt) => { ++ TokenTree::Group(crate::Group::_new(Group::Compiler(tt))) ++ } ++ proc_macro::TokenTree::Punct(tt) => { ++ let spacing = match tt.spacing() { ++ proc_macro::Spacing::Joint => Spacing::Joint, ++ proc_macro::Spacing::Alone => Spacing::Alone, ++ }; ++ let mut o = Punct::new(tt.as_char(), spacing); ++ o.set_span(crate::Span::_new(Span::Compiler(tt.span()))); ++ TokenTree::Punct(o) ++ } ++ proc_macro::TokenTree::Ident(s) => { ++ TokenTree::Ident(crate::Ident::_new(Ident::Compiler(s))) ++ } ++ proc_macro::TokenTree::Literal(l) => { ++ TokenTree::Literal(crate::Literal::_new(Literal::Compiler(l))) ++ } ++ }) ++ } ++ ++ fn size_hint(&self) -> (usize, Option) { ++ match self { ++ TokenTreeIter::Compiler(tts) => tts.size_hint(), ++ TokenTreeIter::Fallback(tts) => tts.size_hint(), ++ } ++ } ++} ++ ++#[derive(Clone, PartialEq, Eq)] ++#[cfg(super_unstable)] ++pub(crate) enum SourceFile { ++ Compiler(proc_macro::SourceFile), ++ Fallback(fallback::SourceFile), ++} ++ ++#[cfg(super_unstable)] ++impl SourceFile { ++ fn nightly(sf: proc_macro::SourceFile) -> Self { ++ SourceFile::Compiler(sf) ++ } ++ ++ /// Get the path to this source file as a string. ++ pub(crate) fn path(&self) -> PathBuf { ++ match self { ++ SourceFile::Compiler(a) => a.path(), ++ SourceFile::Fallback(a) => a.path(), ++ } ++ } ++ ++ pub(crate) fn is_real(&self) -> bool { ++ match self { ++ SourceFile::Compiler(a) => a.is_real(), ++ SourceFile::Fallback(a) => a.is_real(), ++ } ++ } ++} ++ ++#[cfg(super_unstable)] ++impl Debug for SourceFile { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ match self { ++ SourceFile::Compiler(a) => Debug::fmt(a, f), ++ SourceFile::Fallback(a) => Debug::fmt(a, f), ++ } ++ } ++} ++ ++#[derive(Copy, Clone)] ++pub(crate) enum Span { ++ Compiler(proc_macro::Span), ++ Fallback(fallback::Span), ++} ++ ++impl Span { ++ pub(crate) fn call_site() -> Self { ++ if inside_proc_macro() { ++ Span::Compiler(proc_macro::Span::call_site()) ++ } else { ++ Span::Fallback(fallback::Span::call_site()) ++ } ++ } ++ ++ pub(crate) fn mixed_site() -> Self { ++ if inside_proc_macro() { ++ Span::Compiler(proc_macro::Span::mixed_site()) ++ } else { ++ Span::Fallback(fallback::Span::mixed_site()) ++ } ++ } ++ ++ #[cfg(super_unstable)] ++ pub(crate) fn def_site() -> Self { ++ if inside_proc_macro() { ++ Span::Compiler(proc_macro::Span::def_site()) ++ } else { ++ Span::Fallback(fallback::Span::def_site()) ++ } ++ } ++ ++ pub(crate) fn resolved_at(&self, other: Span) -> Span { ++ match (self, other) { ++ (Span::Compiler(a), Span::Compiler(b)) => Span::Compiler(a.resolved_at(b)), ++ (Span::Fallback(a), Span::Fallback(b)) => Span::Fallback(a.resolved_at(b)), ++ (Span::Compiler(_), Span::Fallback(_)) => mismatch(line!()), ++ (Span::Fallback(_), Span::Compiler(_)) => mismatch(line!()), ++ } ++ } ++ ++ pub(crate) fn located_at(&self, other: Span) -> Span { ++ match (self, other) { ++ (Span::Compiler(a), Span::Compiler(b)) => Span::Compiler(a.located_at(b)), ++ (Span::Fallback(a), Span::Fallback(b)) => Span::Fallback(a.located_at(b)), ++ (Span::Compiler(_), Span::Fallback(_)) => mismatch(line!()), ++ (Span::Fallback(_), Span::Compiler(_)) => mismatch(line!()), ++ } ++ } ++ ++ pub(crate) fn unwrap(self) -> proc_macro::Span { ++ match self { ++ Span::Compiler(s) => s, ++ Span::Fallback(_) => panic!("proc_macro::Span is only available in procedural macros"), ++ } ++ } ++ ++ #[cfg(super_unstable)] ++ pub(crate) fn source_file(&self) -> SourceFile { ++ match self { ++ Span::Compiler(s) => SourceFile::nightly(s.source_file()), ++ Span::Fallback(s) => SourceFile::Fallback(s.source_file()), ++ } ++ } ++ ++ #[cfg(span_locations)] ++ pub(crate) fn byte_range(&self) -> Range { ++ match self { ++ #[cfg(proc_macro_span)] ++ Span::Compiler(s) => s.byte_range(), ++ #[cfg(not(proc_macro_span))] ++ Span::Compiler(_) => 0..0, ++ Span::Fallback(s) => s.byte_range(), ++ } ++ } ++ ++ #[cfg(span_locations)] ++ pub(crate) fn start(&self) -> LineColumn { ++ match self { ++ #[cfg(proc_macro_span)] ++ Span::Compiler(s) => LineColumn { ++ line: s.line(), ++ column: s.column().saturating_sub(1), ++ }, ++ #[cfg(not(proc_macro_span))] ++ Span::Compiler(_) => LineColumn { line: 0, column: 0 }, ++ Span::Fallback(s) => s.start(), ++ } ++ } ++ ++ #[cfg(span_locations)] ++ pub(crate) fn end(&self) -> LineColumn { ++ match self { ++ #[cfg(proc_macro_span)] ++ Span::Compiler(s) => { ++ let end = s.end(); ++ LineColumn { ++ line: end.line(), ++ column: end.column().saturating_sub(1), ++ } ++ } ++ #[cfg(not(proc_macro_span))] ++ Span::Compiler(_) => LineColumn { line: 0, column: 0 }, ++ Span::Fallback(s) => s.end(), ++ } ++ } ++ ++ pub(crate) fn join(&self, other: Span) -> Option { ++ let ret = match (self, other) { ++ #[cfg(proc_macro_span)] ++ (Span::Compiler(a), Span::Compiler(b)) => Span::Compiler(a.join(b)?), ++ (Span::Fallback(a), Span::Fallback(b)) => Span::Fallback(a.join(b)?), ++ _ => return None, ++ }; ++ Some(ret) ++ } ++ ++ #[cfg(super_unstable)] ++ pub(crate) fn eq(&self, other: &Span) -> bool { ++ match (self, other) { ++ (Span::Compiler(a), Span::Compiler(b)) => a.eq(b), ++ (Span::Fallback(a), Span::Fallback(b)) => a.eq(b), ++ _ => false, ++ } ++ } ++ ++ pub(crate) fn source_text(&self) -> Option { ++ match self { ++ #[cfg(not(no_source_text))] ++ Span::Compiler(s) => s.source_text(), ++ #[cfg(no_source_text)] ++ Span::Compiler(_) => None, ++ Span::Fallback(s) => s.source_text(), ++ } ++ } ++ ++ fn unwrap_nightly(self) -> proc_macro::Span { ++ match self { ++ Span::Compiler(s) => s, ++ Span::Fallback(_) => mismatch(line!()), ++ } ++ } ++} ++ ++impl From for crate::Span { ++ fn from(proc_span: proc_macro::Span) -> Self { ++ crate::Span::_new(Span::Compiler(proc_span)) ++ } ++} ++ ++impl From for Span { ++ fn from(inner: fallback::Span) -> Self { ++ Span::Fallback(inner) ++ } ++} ++ ++impl Debug for Span { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ match self { ++ Span::Compiler(s) => Debug::fmt(s, f), ++ Span::Fallback(s) => Debug::fmt(s, f), ++ } ++ } ++} ++ ++pub(crate) fn debug_span_field_if_nontrivial(debug: &mut fmt::DebugStruct, span: Span) { ++ match span { ++ Span::Compiler(s) => { ++ debug.field("span", &s); ++ } ++ Span::Fallback(s) => fallback::debug_span_field_if_nontrivial(debug, s), ++ } ++} ++ ++#[derive(Clone)] ++pub(crate) enum Group { ++ Compiler(proc_macro::Group), ++ Fallback(fallback::Group), ++} ++ ++impl Group { ++ pub(crate) fn new(delimiter: Delimiter, stream: TokenStream) -> Self { ++ match stream { ++ TokenStream::Compiler(tts) => { ++ let delimiter = match delimiter { ++ Delimiter::Parenthesis => proc_macro::Delimiter::Parenthesis, ++ Delimiter::Bracket => proc_macro::Delimiter::Bracket, ++ Delimiter::Brace => proc_macro::Delimiter::Brace, ++ Delimiter::None => proc_macro::Delimiter::None, ++ }; ++ Group::Compiler(proc_macro::Group::new(delimiter, tts.into_token_stream())) ++ } ++ TokenStream::Fallback(stream) => { ++ Group::Fallback(fallback::Group::new(delimiter, stream)) ++ } ++ } ++ } ++ ++ pub(crate) fn delimiter(&self) -> Delimiter { ++ match self { ++ Group::Compiler(g) => match g.delimiter() { ++ proc_macro::Delimiter::Parenthesis => Delimiter::Parenthesis, ++ proc_macro::Delimiter::Bracket => Delimiter::Bracket, ++ proc_macro::Delimiter::Brace => Delimiter::Brace, ++ proc_macro::Delimiter::None => Delimiter::None, ++ }, ++ Group::Fallback(g) => g.delimiter(), ++ } ++ } ++ ++ pub(crate) fn stream(&self) -> TokenStream { ++ match self { ++ Group::Compiler(g) => TokenStream::Compiler(DeferredTokenStream::new(g.stream())), ++ Group::Fallback(g) => TokenStream::Fallback(g.stream()), ++ } ++ } ++ ++ pub(crate) fn span(&self) -> Span { ++ match self { ++ Group::Compiler(g) => Span::Compiler(g.span()), ++ Group::Fallback(g) => Span::Fallback(g.span()), ++ } ++ } ++ ++ pub(crate) fn span_open(&self) -> Span { ++ match self { ++ Group::Compiler(g) => Span::Compiler(g.span_open()), ++ Group::Fallback(g) => Span::Fallback(g.span_open()), ++ } ++ } ++ ++ pub(crate) fn span_close(&self) -> Span { ++ match self { ++ Group::Compiler(g) => Span::Compiler(g.span_close()), ++ Group::Fallback(g) => Span::Fallback(g.span_close()), ++ } ++ } ++ ++ pub(crate) fn set_span(&mut self, span: Span) { ++ match (self, span) { ++ (Group::Compiler(g), Span::Compiler(s)) => g.set_span(s), ++ (Group::Fallback(g), Span::Fallback(s)) => g.set_span(s), ++ (Group::Compiler(_), Span::Fallback(_)) => mismatch(line!()), ++ (Group::Fallback(_), Span::Compiler(_)) => mismatch(line!()), ++ } ++ } ++ ++ fn unwrap_nightly(self) -> proc_macro::Group { ++ match self { ++ Group::Compiler(g) => g, ++ Group::Fallback(_) => mismatch(line!()), ++ } ++ } ++} ++ ++impl From for Group { ++ fn from(g: fallback::Group) -> Self { ++ Group::Fallback(g) ++ } ++} ++ ++impl Display for Group { ++ fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { ++ match self { ++ Group::Compiler(group) => Display::fmt(group, formatter), ++ Group::Fallback(group) => Display::fmt(group, formatter), ++ } ++ } ++} ++ ++impl Debug for Group { ++ fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { ++ match self { ++ Group::Compiler(group) => Debug::fmt(group, formatter), ++ Group::Fallback(group) => Debug::fmt(group, formatter), ++ } ++ } ++} ++ ++#[derive(Clone)] ++pub(crate) enum Ident { ++ Compiler(proc_macro::Ident), ++ Fallback(fallback::Ident), ++} ++ ++impl Ident { ++ #[track_caller] ++ pub(crate) fn new_checked(string: &str, span: Span) -> Self { ++ match span { ++ Span::Compiler(s) => Ident::Compiler(proc_macro::Ident::new(string, s)), ++ Span::Fallback(s) => Ident::Fallback(fallback::Ident::new_checked(string, s)), ++ } ++ } ++ ++ #[track_caller] ++ pub(crate) fn new_raw_checked(string: &str, span: Span) -> Self { ++ match span { ++ Span::Compiler(s) => Ident::Compiler(proc_macro::Ident::new_raw(string, s)), ++ Span::Fallback(s) => Ident::Fallback(fallback::Ident::new_raw_checked(string, s)), ++ } ++ } ++ ++ pub(crate) fn span(&self) -> Span { ++ match self { ++ Ident::Compiler(t) => Span::Compiler(t.span()), ++ Ident::Fallback(t) => Span::Fallback(t.span()), ++ } ++ } ++ ++ pub(crate) fn set_span(&mut self, span: Span) { ++ match (self, span) { ++ (Ident::Compiler(t), Span::Compiler(s)) => t.set_span(s), ++ (Ident::Fallback(t), Span::Fallback(s)) => t.set_span(s), ++ (Ident::Compiler(_), Span::Fallback(_)) => mismatch(line!()), ++ (Ident::Fallback(_), Span::Compiler(_)) => mismatch(line!()), ++ } ++ } ++ ++ fn unwrap_nightly(self) -> proc_macro::Ident { ++ match self { ++ Ident::Compiler(s) => s, ++ Ident::Fallback(_) => mismatch(line!()), ++ } ++ } ++} ++ ++impl From for Ident { ++ fn from(inner: fallback::Ident) -> Self { ++ Ident::Fallback(inner) ++ } ++} ++ ++impl PartialEq for Ident { ++ fn eq(&self, other: &Ident) -> bool { ++ match (self, other) { ++ (Ident::Compiler(t), Ident::Compiler(o)) => t.to_string() == o.to_string(), ++ (Ident::Fallback(t), Ident::Fallback(o)) => t == o, ++ (Ident::Compiler(_), Ident::Fallback(_)) => mismatch(line!()), ++ (Ident::Fallback(_), Ident::Compiler(_)) => mismatch(line!()), ++ } ++ } ++} ++ ++impl PartialEq for Ident ++where ++ T: ?Sized + AsRef, ++{ ++ fn eq(&self, other: &T) -> bool { ++ let other = other.as_ref(); ++ match self { ++ Ident::Compiler(t) => t.to_string() == other, ++ Ident::Fallback(t) => t == other, ++ } ++ } ++} ++ ++impl Display for Ident { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ match self { ++ Ident::Compiler(t) => Display::fmt(t, f), ++ Ident::Fallback(t) => Display::fmt(t, f), ++ } ++ } ++} ++ ++impl Debug for Ident { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ match self { ++ Ident::Compiler(t) => Debug::fmt(t, f), ++ Ident::Fallback(t) => Debug::fmt(t, f), ++ } ++ } ++} ++ ++#[derive(Clone)] ++pub(crate) enum Literal { ++ Compiler(proc_macro::Literal), ++ Fallback(fallback::Literal), ++} ++ ++macro_rules! suffixed_numbers { ++ ($($name:ident => $kind:ident,)*) => ($( ++ pub(crate) fn $name(n: $kind) -> Literal { ++ if inside_proc_macro() { ++ Literal::Compiler(proc_macro::Literal::$name(n)) ++ } else { ++ Literal::Fallback(fallback::Literal::$name(n)) ++ } ++ } ++ )*) ++} ++ ++macro_rules! unsuffixed_integers { ++ ($($name:ident => $kind:ident,)*) => ($( ++ pub(crate) fn $name(n: $kind) -> Literal { ++ if inside_proc_macro() { ++ Literal::Compiler(proc_macro::Literal::$name(n)) ++ } else { ++ Literal::Fallback(fallback::Literal::$name(n)) ++ } ++ } ++ )*) ++} ++ ++impl Literal { ++ pub(crate) fn from_str_checked(repr: &str) -> Result { ++ if inside_proc_macro() { ++ let literal = proc_macro::Literal::from_str_checked(repr)?; ++ Ok(Literal::Compiler(literal)) ++ } else { ++ let literal = fallback::Literal::from_str_checked(repr)?; ++ Ok(Literal::Fallback(literal)) ++ } ++ } ++ ++ pub(crate) unsafe fn from_str_unchecked(repr: &str) -> Self { ++ if inside_proc_macro() { ++ Literal::Compiler(proc_macro::Literal::from_str_unchecked(repr)) ++ } else { ++ Literal::Fallback(unsafe { fallback::Literal::from_str_unchecked(repr) }) ++ } ++ } ++ ++ suffixed_numbers! { ++ u8_suffixed => u8, ++ u16_suffixed => u16, ++ u32_suffixed => u32, ++ u64_suffixed => u64, ++ u128_suffixed => u128, ++ usize_suffixed => usize, ++ i8_suffixed => i8, ++ i16_suffixed => i16, ++ i32_suffixed => i32, ++ i64_suffixed => i64, ++ i128_suffixed => i128, ++ isize_suffixed => isize, ++ ++ f32_suffixed => f32, ++ f64_suffixed => f64, ++ } ++ ++ unsuffixed_integers! { ++ u8_unsuffixed => u8, ++ u16_unsuffixed => u16, ++ u32_unsuffixed => u32, ++ u64_unsuffixed => u64, ++ u128_unsuffixed => u128, ++ usize_unsuffixed => usize, ++ i8_unsuffixed => i8, ++ i16_unsuffixed => i16, ++ i32_unsuffixed => i32, ++ i64_unsuffixed => i64, ++ i128_unsuffixed => i128, ++ isize_unsuffixed => isize, ++ } ++ ++ pub(crate) fn f32_unsuffixed(f: f32) -> Literal { ++ if inside_proc_macro() { ++ Literal::Compiler(proc_macro::Literal::f32_unsuffixed(f)) ++ } else { ++ Literal::Fallback(fallback::Literal::f32_unsuffixed(f)) ++ } ++ } ++ ++ pub(crate) fn f64_unsuffixed(f: f64) -> Literal { ++ if inside_proc_macro() { ++ Literal::Compiler(proc_macro::Literal::f64_unsuffixed(f)) ++ } else { ++ Literal::Fallback(fallback::Literal::f64_unsuffixed(f)) ++ } ++ } ++ ++ pub(crate) fn string(string: &str) -> Literal { ++ if inside_proc_macro() { ++ Literal::Compiler(proc_macro::Literal::string(string)) ++ } else { ++ Literal::Fallback(fallback::Literal::string(string)) ++ } ++ } ++ ++ pub(crate) fn character(ch: char) -> Literal { ++ if inside_proc_macro() { ++ Literal::Compiler(proc_macro::Literal::character(ch)) ++ } else { ++ Literal::Fallback(fallback::Literal::character(ch)) ++ } ++ } ++ ++ pub(crate) fn byte_character(byte: u8) -> Literal { ++ if inside_proc_macro() { ++ Literal::Compiler({ ++ #[cfg(not(no_literal_byte_character))] ++ { ++ proc_macro::Literal::byte_character(byte) ++ } ++ ++ #[cfg(no_literal_byte_character)] ++ { ++ let fallback = fallback::Literal::byte_character(byte); ++ proc_macro::Literal::from_str_unchecked(&fallback.repr) ++ } ++ }) ++ } else { ++ Literal::Fallback(fallback::Literal::byte_character(byte)) ++ } ++ } ++ ++ pub(crate) fn byte_string(bytes: &[u8]) -> Literal { ++ if inside_proc_macro() { ++ Literal::Compiler(proc_macro::Literal::byte_string(bytes)) ++ } else { ++ Literal::Fallback(fallback::Literal::byte_string(bytes)) ++ } ++ } ++ ++ pub(crate) fn c_string(string: &CStr) -> Literal { ++ if inside_proc_macro() { ++ Literal::Compiler({ ++ #[cfg(not(no_literal_c_string))] ++ { ++ proc_macro::Literal::c_string(string) ++ } ++ ++ #[cfg(no_literal_c_string)] ++ { ++ let fallback = fallback::Literal::c_string(string); ++ proc_macro::Literal::from_str_unchecked(&fallback.repr) ++ } ++ }) ++ } else { ++ Literal::Fallback(fallback::Literal::c_string(string)) ++ } ++ } ++ ++ pub(crate) fn span(&self) -> Span { ++ match self { ++ Literal::Compiler(lit) => Span::Compiler(lit.span()), ++ Literal::Fallback(lit) => Span::Fallback(lit.span()), ++ } ++ } ++ ++ pub(crate) fn set_span(&mut self, span: Span) { ++ match (self, span) { ++ (Literal::Compiler(lit), Span::Compiler(s)) => lit.set_span(s), ++ (Literal::Fallback(lit), Span::Fallback(s)) => lit.set_span(s), ++ (Literal::Compiler(_), Span::Fallback(_)) => mismatch(line!()), ++ (Literal::Fallback(_), Span::Compiler(_)) => mismatch(line!()), ++ } ++ } ++ ++ pub(crate) fn subspan>(&self, range: R) -> Option { ++ match self { ++ #[cfg(proc_macro_span)] ++ Literal::Compiler(lit) => lit.subspan(range).map(Span::Compiler), ++ #[cfg(not(proc_macro_span))] ++ Literal::Compiler(_lit) => None, ++ Literal::Fallback(lit) => lit.subspan(range).map(Span::Fallback), ++ } ++ } ++ ++ fn unwrap_nightly(self) -> proc_macro::Literal { ++ match self { ++ Literal::Compiler(s) => s, ++ Literal::Fallback(_) => mismatch(line!()), ++ } ++ } ++} ++ ++impl From for Literal { ++ fn from(s: fallback::Literal) -> Self { ++ Literal::Fallback(s) ++ } ++} ++ ++impl Display for Literal { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ match self { ++ Literal::Compiler(t) => Display::fmt(t, f), ++ Literal::Fallback(t) => Display::fmt(t, f), ++ } ++ } ++} ++ ++impl Debug for Literal { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ match self { ++ Literal::Compiler(t) => Debug::fmt(t, f), ++ Literal::Fallback(t) => Debug::fmt(t, f), ++ } ++ } ++} ++ ++#[cfg(span_locations)] ++pub(crate) fn invalidate_current_thread_spans() { ++ if inside_proc_macro() { ++ panic!( ++ "proc_macro2::extra::invalidate_current_thread_spans is not available in procedural macros" ++ ); ++ } else { ++ crate::fallback::invalidate_current_thread_spans(); ++ } ++} +diff -Nru mesa-25.3.3/subprojects/proc-macro2-1.0.92/tests/comments.rs mesa-25.3.3/subprojects/proc-macro2-1.0.92/tests/comments.rs +--- mesa-25.3.3/subprojects/proc-macro2-1.0.92/tests/comments.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/proc-macro2-1.0.92/tests/comments.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,105 @@ ++#![allow(clippy::assertions_on_result_states)] ++ ++use proc_macro2::{Delimiter, Literal, Spacing, TokenStream, TokenTree}; ++ ++// #[doc = "..."] -> "..." ++fn lit_of_outer_doc_comment(tokens: &TokenStream) -> Literal { ++ lit_of_doc_comment(tokens, false) ++} ++ ++// #![doc = "..."] -> "..." ++fn lit_of_inner_doc_comment(tokens: &TokenStream) -> Literal { ++ lit_of_doc_comment(tokens, true) ++} ++ ++fn lit_of_doc_comment(tokens: &TokenStream, inner: bool) -> Literal { ++ let mut iter = tokens.clone().into_iter(); ++ match iter.next().unwrap() { ++ TokenTree::Punct(punct) => { ++ assert_eq!(punct.as_char(), '#'); ++ assert_eq!(punct.spacing(), Spacing::Alone); ++ } ++ _ => panic!("wrong token {:?}", tokens), ++ } ++ if inner { ++ match iter.next().unwrap() { ++ TokenTree::Punct(punct) => { ++ assert_eq!(punct.as_char(), '!'); ++ assert_eq!(punct.spacing(), Spacing::Alone); ++ } ++ _ => panic!("wrong token {:?}", tokens), ++ } ++ } ++ iter = match iter.next().unwrap() { ++ TokenTree::Group(group) => { ++ assert_eq!(group.delimiter(), Delimiter::Bracket); ++ assert!(iter.next().is_none(), "unexpected token {:?}", tokens); ++ group.stream().into_iter() ++ } ++ _ => panic!("wrong token {:?}", tokens), ++ }; ++ match iter.next().unwrap() { ++ TokenTree::Ident(ident) => assert_eq!(ident.to_string(), "doc"), ++ _ => panic!("wrong token {:?}", tokens), ++ } ++ match iter.next().unwrap() { ++ TokenTree::Punct(punct) => { ++ assert_eq!(punct.as_char(), '='); ++ assert_eq!(punct.spacing(), Spacing::Alone); ++ } ++ _ => panic!("wrong token {:?}", tokens), ++ } ++ match iter.next().unwrap() { ++ TokenTree::Literal(literal) => { ++ assert!(iter.next().is_none(), "unexpected token {:?}", tokens); ++ literal ++ } ++ _ => panic!("wrong token {:?}", tokens), ++ } ++} ++ ++#[test] ++fn closed_immediately() { ++ let stream = "/**/".parse::().unwrap(); ++ let tokens = stream.into_iter().collect::>(); ++ assert!(tokens.is_empty(), "not empty -- {:?}", tokens); ++} ++ ++#[test] ++fn incomplete() { ++ assert!("/*/".parse::().is_err()); ++} ++ ++#[test] ++fn lit() { ++ let stream = "/// doc".parse::().unwrap(); ++ let lit = lit_of_outer_doc_comment(&stream); ++ assert_eq!(lit.to_string(), "\" doc\""); ++ ++ let stream = "//! doc".parse::().unwrap(); ++ let lit = lit_of_inner_doc_comment(&stream); ++ assert_eq!(lit.to_string(), "\" doc\""); ++ ++ let stream = "/** doc */".parse::().unwrap(); ++ let lit = lit_of_outer_doc_comment(&stream); ++ assert_eq!(lit.to_string(), "\" doc \""); ++ ++ let stream = "/*! doc */".parse::().unwrap(); ++ let lit = lit_of_inner_doc_comment(&stream); ++ assert_eq!(lit.to_string(), "\" doc \""); ++} ++ ++#[test] ++fn carriage_return() { ++ let stream = "///\r\n".parse::().unwrap(); ++ let lit = lit_of_outer_doc_comment(&stream); ++ assert_eq!(lit.to_string(), "\"\""); ++ ++ let stream = "/**\r\n*/".parse::().unwrap(); ++ let lit = lit_of_outer_doc_comment(&stream); ++ assert_eq!(lit.to_string(), "\"\\r\\n\""); ++ ++ "///\r".parse::().unwrap_err(); ++ "///\r \n".parse::().unwrap_err(); ++ "/**\r \n*/".parse::().unwrap_err(); ++} +diff -Nru mesa-25.3.3/subprojects/proc-macro2-1.0.92/tests/features.rs mesa-25.3.3/subprojects/proc-macro2-1.0.92/tests/features.rs +--- mesa-25.3.3/subprojects/proc-macro2-1.0.92/tests/features.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/proc-macro2-1.0.92/tests/features.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,8 @@ ++#[test] ++#[ignore] ++fn make_sure_no_proc_macro() { ++ assert!( ++ !cfg!(feature = "proc-macro"), ++ "still compiled with proc_macro?" ++ ); ++} +diff -Nru mesa-25.3.3/subprojects/proc-macro2-1.0.92/tests/marker.rs mesa-25.3.3/subprojects/proc-macro2-1.0.92/tests/marker.rs +--- mesa-25.3.3/subprojects/proc-macro2-1.0.92/tests/marker.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/proc-macro2-1.0.92/tests/marker.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,100 @@ ++#![allow(clippy::extra_unused_type_parameters)] ++ ++use proc_macro2::{ ++ Delimiter, Group, Ident, LexError, Literal, Punct, Spacing, Span, TokenStream, TokenTree, ++}; ++ ++macro_rules! assert_impl { ++ ($ty:ident is $($marker:ident) and +) => { ++ #[test] ++ #[allow(non_snake_case)] ++ fn $ty() { ++ fn assert_implemented() {} ++ assert_implemented::<$ty>(); ++ } ++ }; ++ ++ ($ty:ident is not $($marker:ident) or +) => { ++ #[test] ++ #[allow(non_snake_case)] ++ fn $ty() { ++ $( ++ { ++ // Implemented for types that implement $marker. ++ #[allow(dead_code)] ++ trait IsNotImplemented { ++ fn assert_not_implemented() {} ++ } ++ impl IsNotImplemented for T {} ++ ++ // Implemented for the type being tested. ++ trait IsImplemented { ++ fn assert_not_implemented() {} ++ } ++ impl IsImplemented for $ty {} ++ ++ // If $ty does not implement $marker, there is no ambiguity ++ // in the following trait method call. ++ <$ty>::assert_not_implemented(); ++ } ++ )+ ++ } ++ }; ++} ++ ++assert_impl!(Delimiter is Send and Sync); ++assert_impl!(Spacing is Send and Sync); ++ ++assert_impl!(Group is not Send or Sync); ++assert_impl!(Ident is not Send or Sync); ++assert_impl!(LexError is not Send or Sync); ++assert_impl!(Literal is not Send or Sync); ++assert_impl!(Punct is not Send or Sync); ++assert_impl!(Span is not Send or Sync); ++assert_impl!(TokenStream is not Send or Sync); ++assert_impl!(TokenTree is not Send or Sync); ++ ++#[cfg(procmacro2_semver_exempt)] ++mod semver_exempt { ++ use proc_macro2::{LineColumn, SourceFile}; ++ ++ assert_impl!(LineColumn is Send and Sync); ++ ++ assert_impl!(SourceFile is not Send or Sync); ++} ++ ++mod unwind_safe { ++ use proc_macro2::{ ++ Delimiter, Group, Ident, LexError, Literal, Punct, Spacing, Span, TokenStream, TokenTree, ++ }; ++ #[cfg(procmacro2_semver_exempt)] ++ use proc_macro2::{LineColumn, SourceFile}; ++ use std::panic::{RefUnwindSafe, UnwindSafe}; ++ ++ macro_rules! assert_unwind_safe { ++ ($($types:ident)*) => { ++ $( ++ assert_impl!($types is UnwindSafe and RefUnwindSafe); ++ )* ++ }; ++ } ++ ++ assert_unwind_safe! { ++ Delimiter ++ Group ++ Ident ++ LexError ++ Literal ++ Punct ++ Spacing ++ Span ++ TokenStream ++ TokenTree ++ } ++ ++ #[cfg(procmacro2_semver_exempt)] ++ assert_unwind_safe! { ++ LineColumn ++ SourceFile ++ } ++} +diff -Nru mesa-25.3.3/subprojects/proc-macro2-1.0.92/tests/test_fmt.rs mesa-25.3.3/subprojects/proc-macro2-1.0.92/tests/test_fmt.rs +--- mesa-25.3.3/subprojects/proc-macro2-1.0.92/tests/test_fmt.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/proc-macro2-1.0.92/tests/test_fmt.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,28 @@ ++#![allow(clippy::from_iter_instead_of_collect)] ++ ++use proc_macro2::{Delimiter, Group, Ident, Span, TokenStream, TokenTree}; ++use std::iter; ++ ++#[test] ++fn test_fmt_group() { ++ let ident = Ident::new("x", Span::call_site()); ++ let inner = TokenStream::from_iter(iter::once(TokenTree::Ident(ident))); ++ let parens_empty = Group::new(Delimiter::Parenthesis, TokenStream::new()); ++ let parens_nonempty = Group::new(Delimiter::Parenthesis, inner.clone()); ++ let brackets_empty = Group::new(Delimiter::Bracket, TokenStream::new()); ++ let brackets_nonempty = Group::new(Delimiter::Bracket, inner.clone()); ++ let braces_empty = Group::new(Delimiter::Brace, TokenStream::new()); ++ let braces_nonempty = Group::new(Delimiter::Brace, inner.clone()); ++ let none_empty = Group::new(Delimiter::None, TokenStream::new()); ++ let none_nonempty = Group::new(Delimiter::None, inner); ++ ++ // Matches libproc_macro. ++ assert_eq!("()", parens_empty.to_string()); ++ assert_eq!("(x)", parens_nonempty.to_string()); ++ assert_eq!("[]", brackets_empty.to_string()); ++ assert_eq!("[x]", brackets_nonempty.to_string()); ++ assert_eq!("{ }", braces_empty.to_string()); ++ assert_eq!("{ x }", braces_nonempty.to_string()); ++ assert_eq!("", none_empty.to_string()); ++ assert_eq!("x", none_nonempty.to_string()); ++} +diff -Nru mesa-25.3.3/subprojects/proc-macro2-1.0.92/tests/test.rs mesa-25.3.3/subprojects/proc-macro2-1.0.92/tests/test.rs +--- mesa-25.3.3/subprojects/proc-macro2-1.0.92/tests/test.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/proc-macro2-1.0.92/tests/test.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,905 @@ ++#![allow( ++ clippy::assertions_on_result_states, ++ clippy::items_after_statements, ++ clippy::needless_pass_by_value, ++ clippy::needless_raw_string_hashes, ++ clippy::non_ascii_literal, ++ clippy::octal_escapes ++)] ++ ++use proc_macro2::{Ident, Literal, Punct, Spacing, Span, TokenStream, TokenTree}; ++use std::ffi::CStr; ++use std::iter; ++use std::str::{self, FromStr}; ++ ++#[test] ++fn idents() { ++ assert_eq!( ++ Ident::new("String", Span::call_site()).to_string(), ++ "String" ++ ); ++ assert_eq!(Ident::new("fn", Span::call_site()).to_string(), "fn"); ++ assert_eq!(Ident::new("_", Span::call_site()).to_string(), "_"); ++} ++ ++#[test] ++fn raw_idents() { ++ assert_eq!( ++ Ident::new_raw("String", Span::call_site()).to_string(), ++ "r#String" ++ ); ++ assert_eq!(Ident::new_raw("fn", Span::call_site()).to_string(), "r#fn"); ++} ++ ++#[test] ++#[should_panic(expected = "`r#_` cannot be a raw identifier")] ++fn ident_raw_underscore() { ++ Ident::new_raw("_", Span::call_site()); ++} ++ ++#[test] ++#[should_panic(expected = "`r#super` cannot be a raw identifier")] ++fn ident_raw_reserved() { ++ Ident::new_raw("super", Span::call_site()); ++} ++ ++#[test] ++#[should_panic(expected = "Ident is not allowed to be empty; use Option")] ++fn ident_empty() { ++ Ident::new("", Span::call_site()); ++} ++ ++#[test] ++#[should_panic(expected = "Ident cannot be a number; use Literal instead")] ++fn ident_number() { ++ Ident::new("255", Span::call_site()); ++} ++ ++#[test] ++#[should_panic(expected = "\"a#\" is not a valid Ident")] ++fn ident_invalid() { ++ Ident::new("a#", Span::call_site()); ++} ++ ++#[test] ++#[should_panic(expected = "not a valid Ident")] ++fn raw_ident_empty() { ++ Ident::new("r#", Span::call_site()); ++} ++ ++#[test] ++#[should_panic(expected = "not a valid Ident")] ++fn raw_ident_number() { ++ Ident::new("r#255", Span::call_site()); ++} ++ ++#[test] ++#[should_panic(expected = "\"r#a#\" is not a valid Ident")] ++fn raw_ident_invalid() { ++ Ident::new("r#a#", Span::call_site()); ++} ++ ++#[test] ++#[should_panic(expected = "not a valid Ident")] ++fn lifetime_empty() { ++ Ident::new("'", Span::call_site()); ++} ++ ++#[test] ++#[should_panic(expected = "not a valid Ident")] ++fn lifetime_number() { ++ Ident::new("'255", Span::call_site()); ++} ++ ++#[test] ++#[should_panic(expected = r#""'a#" is not a valid Ident"#)] ++fn lifetime_invalid() { ++ Ident::new("'a#", Span::call_site()); ++} ++ ++#[test] ++fn literal_string() { ++ #[track_caller] ++ fn assert(literal: Literal, expected: &str) { ++ assert_eq!(literal.to_string(), expected.trim()); ++ } ++ ++ assert(Literal::string(""), r#" "" "#); ++ assert(Literal::string("aA"), r#" "aA" "#); ++ assert(Literal::string("\t"), r#" "\t" "#); ++ assert(Literal::string("❤"), r#" "❤" "#); ++ assert(Literal::string("'"), r#" "'" "#); ++ assert(Literal::string("\""), r#" "\"" "#); ++ assert(Literal::string("\0"), r#" "\0" "#); ++ assert(Literal::string("\u{1}"), r#" "\u{1}" "#); ++ assert( ++ Literal::string("a\00b\07c\08d\0e\0"), ++ r#" "a\x000b\x007c\08d\0e\0" "#, ++ ); ++ ++ "\"\\\r\n x\"".parse::().unwrap(); ++ "\"\\\r\n \rx\"".parse::().unwrap_err(); ++} ++ ++#[test] ++fn literal_raw_string() { ++ "r\"\r\n\"".parse::().unwrap(); ++ ++ fn raw_string_literal_with_hashes(n: usize) -> String { ++ let mut literal = String::new(); ++ literal.push('r'); ++ literal.extend(iter::repeat('#').take(n)); ++ literal.push('"'); ++ literal.push('"'); ++ literal.extend(iter::repeat('#').take(n)); ++ literal ++ } ++ ++ raw_string_literal_with_hashes(255) ++ .parse::() ++ .unwrap(); ++ ++ // https://github.com/rust-lang/rust/pull/95251 ++ raw_string_literal_with_hashes(256) ++ .parse::() ++ .unwrap_err(); ++} ++ ++#[test] ++fn literal_byte_character() { ++ #[track_caller] ++ fn assert(literal: Literal, expected: &str) { ++ assert_eq!(literal.to_string(), expected.trim()); ++ } ++ ++ assert(Literal::byte_character(b'a'), r#" b'a' "#); ++ assert(Literal::byte_character(b'\0'), r#" b'\0' "#); ++ assert(Literal::byte_character(b'\t'), r#" b'\t' "#); ++ assert(Literal::byte_character(b'\n'), r#" b'\n' "#); ++ assert(Literal::byte_character(b'\r'), r#" b'\r' "#); ++ assert(Literal::byte_character(b'\''), r#" b'\'' "#); ++ assert(Literal::byte_character(b'\\'), r#" b'\\' "#); ++ assert(Literal::byte_character(b'\x1f'), r#" b'\x1F' "#); ++ assert(Literal::byte_character(b'"'), r#" b'"' "#); ++} ++ ++#[test] ++fn literal_byte_string() { ++ #[track_caller] ++ fn assert(literal: Literal, expected: &str) { ++ assert_eq!(literal.to_string(), expected.trim()); ++ } ++ ++ assert(Literal::byte_string(b""), r#" b"" "#); ++ assert(Literal::byte_string(b"\0"), r#" b"\0" "#); ++ assert(Literal::byte_string(b"\t"), r#" b"\t" "#); ++ assert(Literal::byte_string(b"\n"), r#" b"\n" "#); ++ assert(Literal::byte_string(b"\r"), r#" b"\r" "#); ++ assert(Literal::byte_string(b"\""), r#" b"\"" "#); ++ assert(Literal::byte_string(b"\\"), r#" b"\\" "#); ++ assert(Literal::byte_string(b"\x1f"), r#" b"\x1F" "#); ++ assert(Literal::byte_string(b"'"), r#" b"'" "#); ++ assert( ++ Literal::byte_string(b"a\00b\07c\08d\0e\0"), ++ r#" b"a\x000b\x007c\08d\0e\0" "#, ++ ); ++ ++ "b\"\\\r\n x\"".parse::().unwrap(); ++ "b\"\\\r\n \rx\"".parse::().unwrap_err(); ++ "b\"\\\r\n \u{a0}x\"".parse::().unwrap_err(); ++ "br\"\u{a0}\"".parse::().unwrap_err(); ++} ++ ++#[test] ++fn literal_c_string() { ++ #[track_caller] ++ fn assert(literal: Literal, expected: &str) { ++ assert_eq!(literal.to_string(), expected.trim()); ++ } ++ ++ assert(Literal::c_string(<&CStr>::default()), r#" c"" "#); ++ assert( ++ Literal::c_string(CStr::from_bytes_with_nul(b"aA\0").unwrap()), ++ r#" c"aA" "#, ++ ); ++ assert( ++ Literal::c_string(CStr::from_bytes_with_nul(b"aA\0").unwrap()), ++ r#" c"aA" "#, ++ ); ++ assert( ++ Literal::c_string(CStr::from_bytes_with_nul(b"\t\0").unwrap()), ++ r#" c"\t" "#, ++ ); ++ assert( ++ Literal::c_string(CStr::from_bytes_with_nul(b"\xE2\x9D\xA4\0").unwrap()), ++ r#" c"❤" "#, ++ ); ++ assert( ++ Literal::c_string(CStr::from_bytes_with_nul(b"'\0").unwrap()), ++ r#" c"'" "#, ++ ); ++ assert( ++ Literal::c_string(CStr::from_bytes_with_nul(b"\"\0").unwrap()), ++ r#" c"\"" "#, ++ ); ++ assert( ++ Literal::c_string(CStr::from_bytes_with_nul(b"\x7F\xFF\xFE\xCC\xB3\0").unwrap()), ++ r#" c"\u{7f}\xFF\xFE\u{333}" "#, ++ ); ++ ++ let strings = r###" ++ c"hello\x80我叫\u{1F980}" // from the RFC ++ cr"\" ++ cr##"Hello "world"!"## ++ c"\t\n\r\"\\" ++ "###; ++ ++ let mut tokens = strings.parse::().unwrap().into_iter(); ++ ++ for expected in &[ ++ r#"c"hello\x80我叫\u{1F980}""#, ++ r#"cr"\""#, ++ r###"cr##"Hello "world"!"##"###, ++ r#"c"\t\n\r\"\\""#, ++ ] { ++ match tokens.next().unwrap() { ++ TokenTree::Literal(literal) => { ++ assert_eq!(literal.to_string(), *expected); ++ } ++ unexpected => panic!("unexpected token: {:?}", unexpected), ++ } ++ } ++ ++ if let Some(unexpected) = tokens.next() { ++ panic!("unexpected token: {:?}", unexpected); ++ } ++ ++ for invalid in &[r#"c"\0""#, r#"c"\x00""#, r#"c"\u{0}""#, "c\"\0\""] { ++ if let Ok(unexpected) = invalid.parse::() { ++ panic!("unexpected token: {:?}", unexpected); ++ } ++ } ++} ++ ++#[test] ++fn literal_character() { ++ #[track_caller] ++ fn assert(literal: Literal, expected: &str) { ++ assert_eq!(literal.to_string(), expected.trim()); ++ } ++ ++ assert(Literal::character('a'), r#" 'a' "#); ++ assert(Literal::character('\t'), r#" '\t' "#); ++ assert(Literal::character('❤'), r#" '❤' "#); ++ assert(Literal::character('\''), r#" '\'' "#); ++ assert(Literal::character('"'), r#" '"' "#); ++ assert(Literal::character('\0'), r#" '\0' "#); ++ assert(Literal::character('\u{1}'), r#" '\u{1}' "#); ++} ++ ++#[test] ++fn literal_integer() { ++ #[track_caller] ++ fn assert(literal: Literal, expected: &str) { ++ assert_eq!(literal.to_string(), expected); ++ } ++ ++ assert(Literal::u8_suffixed(10), "10u8"); ++ assert(Literal::u16_suffixed(10), "10u16"); ++ assert(Literal::u32_suffixed(10), "10u32"); ++ assert(Literal::u64_suffixed(10), "10u64"); ++ assert(Literal::u128_suffixed(10), "10u128"); ++ assert(Literal::usize_suffixed(10), "10usize"); ++ ++ assert(Literal::i8_suffixed(10), "10i8"); ++ assert(Literal::i16_suffixed(10), "10i16"); ++ assert(Literal::i32_suffixed(10), "10i32"); ++ assert(Literal::i64_suffixed(10), "10i64"); ++ assert(Literal::i128_suffixed(10), "10i128"); ++ assert(Literal::isize_suffixed(10), "10isize"); ++ ++ assert(Literal::u8_unsuffixed(10), "10"); ++ assert(Literal::u16_unsuffixed(10), "10"); ++ assert(Literal::u32_unsuffixed(10), "10"); ++ assert(Literal::u64_unsuffixed(10), "10"); ++ assert(Literal::u128_unsuffixed(10), "10"); ++ assert(Literal::usize_unsuffixed(10), "10"); ++ ++ assert(Literal::i8_unsuffixed(10), "10"); ++ assert(Literal::i16_unsuffixed(10), "10"); ++ assert(Literal::i32_unsuffixed(10), "10"); ++ assert(Literal::i64_unsuffixed(10), "10"); ++ assert(Literal::i128_unsuffixed(10), "10"); ++ assert(Literal::isize_unsuffixed(10), "10"); ++ ++ assert(Literal::i32_suffixed(-10), "-10i32"); ++ assert(Literal::i32_unsuffixed(-10), "-10"); ++} ++ ++#[test] ++fn literal_float() { ++ #[track_caller] ++ fn assert(literal: Literal, expected: &str) { ++ assert_eq!(literal.to_string(), expected); ++ } ++ ++ assert(Literal::f32_suffixed(10.0), "10f32"); ++ assert(Literal::f32_suffixed(-10.0), "-10f32"); ++ assert(Literal::f64_suffixed(10.0), "10f64"); ++ assert(Literal::f64_suffixed(-10.0), "-10f64"); ++ ++ assert(Literal::f32_unsuffixed(10.0), "10.0"); ++ assert(Literal::f32_unsuffixed(-10.0), "-10.0"); ++ assert(Literal::f64_unsuffixed(10.0), "10.0"); ++ assert(Literal::f64_unsuffixed(-10.0), "-10.0"); ++ ++ assert( ++ Literal::f64_unsuffixed(1e100), ++ "10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0", ++ ); ++} ++ ++#[test] ++fn literal_suffix() { ++ fn token_count(p: &str) -> usize { ++ p.parse::().unwrap().into_iter().count() ++ } ++ ++ assert_eq!(token_count("999u256"), 1); ++ assert_eq!(token_count("999r#u256"), 3); ++ assert_eq!(token_count("1."), 1); ++ assert_eq!(token_count("1.f32"), 3); ++ assert_eq!(token_count("1.0_0"), 1); ++ assert_eq!(token_count("1._0"), 3); ++ assert_eq!(token_count("1._m"), 3); ++ assert_eq!(token_count("\"\"s"), 1); ++ assert_eq!(token_count("r\"\"r"), 1); ++ assert_eq!(token_count("r#\"\"#r"), 1); ++ assert_eq!(token_count("b\"\"b"), 1); ++ assert_eq!(token_count("br\"\"br"), 1); ++ assert_eq!(token_count("br#\"\"#br"), 1); ++ assert_eq!(token_count("c\"\"c"), 1); ++ assert_eq!(token_count("cr\"\"cr"), 1); ++ assert_eq!(token_count("cr#\"\"#cr"), 1); ++ assert_eq!(token_count("'c'c"), 1); ++ assert_eq!(token_count("b'b'b"), 1); ++ assert_eq!(token_count("0E"), 1); ++ assert_eq!(token_count("0o0A"), 1); ++ assert_eq!(token_count("0E--0"), 4); ++ assert_eq!(token_count("0.0ECMA"), 1); ++} ++ ++#[test] ++fn literal_iter_negative() { ++ let negative_literal = Literal::i32_suffixed(-3); ++ let tokens = TokenStream::from(TokenTree::Literal(negative_literal)); ++ let mut iter = tokens.into_iter(); ++ match iter.next().unwrap() { ++ TokenTree::Punct(punct) => { ++ assert_eq!(punct.as_char(), '-'); ++ assert_eq!(punct.spacing(), Spacing::Alone); ++ } ++ unexpected => panic!("unexpected token {:?}", unexpected), ++ } ++ match iter.next().unwrap() { ++ TokenTree::Literal(literal) => { ++ assert_eq!(literal.to_string(), "3i32"); ++ } ++ unexpected => panic!("unexpected token {:?}", unexpected), ++ } ++ assert!(iter.next().is_none()); ++} ++ ++#[test] ++fn literal_parse() { ++ assert!("1".parse::().is_ok()); ++ assert!("-1".parse::().is_ok()); ++ assert!("-1u12".parse::().is_ok()); ++ assert!("1.0".parse::().is_ok()); ++ assert!("-1.0".parse::().is_ok()); ++ assert!("-1.0f12".parse::().is_ok()); ++ assert!("'a'".parse::().is_ok()); ++ assert!("\"\n\"".parse::().is_ok()); ++ assert!("0 1".parse::().is_err()); ++ assert!(" 0".parse::().is_err()); ++ assert!("0 ".parse::().is_err()); ++ assert!("/* comment */0".parse::().is_err()); ++ assert!("0/* comment */".parse::().is_err()); ++ assert!("0// comment".parse::().is_err()); ++ assert!("- 1".parse::().is_err()); ++ assert!("- 1.0".parse::().is_err()); ++ assert!("-\"\"".parse::().is_err()); ++} ++ ++#[test] ++fn literal_span() { ++ let positive = "0.1".parse::().unwrap(); ++ let negative = "-0.1".parse::().unwrap(); ++ let subspan = positive.subspan(1..2); ++ ++ #[cfg(not(span_locations))] ++ { ++ let _ = negative; ++ assert!(subspan.is_none()); ++ } ++ ++ #[cfg(span_locations)] ++ { ++ assert_eq!(positive.span().start().column, 0); ++ assert_eq!(positive.span().end().column, 3); ++ assert_eq!(negative.span().start().column, 0); ++ assert_eq!(negative.span().end().column, 4); ++ assert_eq!(subspan.unwrap().source_text().unwrap(), "."); ++ } ++ ++ assert!(positive.subspan(1..4).is_none()); ++} ++ ++#[cfg(span_locations)] ++#[test] ++fn source_text() { ++ let input = " 𓀕 a z "; ++ let mut tokens = input ++ .parse::() ++ .unwrap() ++ .into_iter(); ++ ++ let first = tokens.next().unwrap(); ++ assert_eq!("𓀕", first.span().source_text().unwrap()); ++ ++ let second = tokens.next().unwrap(); ++ let third = tokens.next().unwrap(); ++ assert_eq!("z", third.span().source_text().unwrap()); ++ assert_eq!("a", second.span().source_text().unwrap()); ++} ++ ++#[test] ++fn roundtrip() { ++ fn roundtrip(p: &str) { ++ println!("parse: {}", p); ++ let s = p.parse::().unwrap().to_string(); ++ println!("first: {}", s); ++ let s2 = s.parse::().unwrap().to_string(); ++ assert_eq!(s, s2); ++ } ++ roundtrip("a"); ++ roundtrip("<<"); ++ roundtrip("<<="); ++ roundtrip( ++ " ++ 1 ++ 1.0 ++ 1f32 ++ 2f64 ++ 1usize ++ 4isize ++ 4e10 ++ 1_000 ++ 1_0i32 ++ 8u8 ++ 9 ++ 0 ++ 0xffffffffffffffffffffffffffffffff ++ 1x ++ 1u80 ++ 1f320 ++ ", ++ ); ++ roundtrip("'a"); ++ roundtrip("'_"); ++ roundtrip("'static"); ++ roundtrip(r"'\u{10__FFFF}'"); ++ roundtrip("\"\\u{10_F0FF__}foo\\u{1_0_0_0__}\""); ++} ++ ++#[test] ++fn fail() { ++ fn fail(p: &str) { ++ if let Ok(s) = p.parse::() { ++ panic!("should have failed to parse: {}\n{:#?}", p, s); ++ } ++ } ++ fail("' static"); ++ fail("r#1"); ++ fail("r#_"); ++ fail("\"\\u{0000000}\""); // overlong unicode escape (rust allows at most 6 hex digits) ++ fail("\"\\u{999999}\""); // outside of valid range of char ++ fail("\"\\u{_0}\""); // leading underscore ++ fail("\"\\u{}\""); // empty ++ fail("b\"\r\""); // bare carriage return in byte string ++ fail("r\"\r\""); // bare carriage return in raw string ++ fail("\"\\\r \""); // backslash carriage return ++ fail("'aa'aa"); ++ fail("br##\"\"#"); ++ fail("cr##\"\"#"); ++ fail("\"\\\n\u{85}\r\""); ++} ++ ++#[cfg(span_locations)] ++#[test] ++fn span_test() { ++ check_spans( ++ "\ ++/// This is a document comment ++testing 123 ++{ ++ testing 234 ++}", ++ &[ ++ (1, 0, 1, 30), // # ++ (1, 0, 1, 30), // [ ... ] ++ (1, 0, 1, 30), // doc ++ (1, 0, 1, 30), // = ++ (1, 0, 1, 30), // "This is..." ++ (2, 0, 2, 7), // testing ++ (2, 8, 2, 11), // 123 ++ (3, 0, 5, 1), // { ... } ++ (4, 2, 4, 9), // testing ++ (4, 10, 4, 13), // 234 ++ ], ++ ); ++} ++ ++#[cfg(procmacro2_semver_exempt)] ++#[test] ++fn default_span() { ++ let start = Span::call_site().start(); ++ assert_eq!(start.line, 1); ++ assert_eq!(start.column, 0); ++ let end = Span::call_site().end(); ++ assert_eq!(end.line, 1); ++ assert_eq!(end.column, 0); ++ let source_file = Span::call_site().source_file(); ++ assert_eq!(source_file.path().to_string_lossy(), ""); ++ assert!(!source_file.is_real()); ++} ++ ++#[cfg(procmacro2_semver_exempt)] ++#[test] ++fn span_join() { ++ let source1 = "aaa\nbbb" ++ .parse::() ++ .unwrap() ++ .into_iter() ++ .collect::>(); ++ let source2 = "ccc\nddd" ++ .parse::() ++ .unwrap() ++ .into_iter() ++ .collect::>(); ++ ++ assert!(source1[0].span().source_file() != source2[0].span().source_file()); ++ assert_eq!( ++ source1[0].span().source_file(), ++ source1[1].span().source_file() ++ ); ++ ++ let joined1 = source1[0].span().join(source1[1].span()); ++ let joined2 = source1[0].span().join(source2[0].span()); ++ assert!(joined1.is_some()); ++ assert!(joined2.is_none()); ++ ++ let start = joined1.unwrap().start(); ++ let end = joined1.unwrap().end(); ++ assert_eq!(start.line, 1); ++ assert_eq!(start.column, 0); ++ assert_eq!(end.line, 2); ++ assert_eq!(end.column, 3); ++ ++ assert_eq!( ++ joined1.unwrap().source_file(), ++ source1[0].span().source_file() ++ ); ++} ++ ++#[test] ++fn no_panic() { ++ let s = str::from_utf8(b"b\'\xc2\x86 \x00\x00\x00^\"").unwrap(); ++ assert!(s.parse::().is_err()); ++} ++ ++#[test] ++fn punct_before_comment() { ++ let mut tts = TokenStream::from_str("~// comment").unwrap().into_iter(); ++ match tts.next().unwrap() { ++ TokenTree::Punct(tt) => { ++ assert_eq!(tt.as_char(), '~'); ++ assert_eq!(tt.spacing(), Spacing::Alone); ++ } ++ wrong => panic!("wrong token {:?}", wrong), ++ } ++} ++ ++#[test] ++fn joint_last_token() { ++ // This test verifies that we match the behavior of libproc_macro *not* in ++ // the range nightly-2020-09-06 through nightly-2020-09-10, in which this ++ // behavior was temporarily broken. ++ // See https://github.com/rust-lang/rust/issues/76399 ++ ++ let joint_punct = Punct::new(':', Spacing::Joint); ++ let stream = TokenStream::from(TokenTree::Punct(joint_punct)); ++ let punct = match stream.into_iter().next().unwrap() { ++ TokenTree::Punct(punct) => punct, ++ _ => unreachable!(), ++ }; ++ assert_eq!(punct.spacing(), Spacing::Joint); ++} ++ ++#[test] ++fn raw_identifier() { ++ let mut tts = TokenStream::from_str("r#dyn").unwrap().into_iter(); ++ match tts.next().unwrap() { ++ TokenTree::Ident(raw) => assert_eq!("r#dyn", raw.to_string()), ++ wrong => panic!("wrong token {:?}", wrong), ++ } ++ assert!(tts.next().is_none()); ++} ++ ++#[test] ++fn test_debug_ident() { ++ let ident = Ident::new("proc_macro", Span::call_site()); ++ ++ #[cfg(not(span_locations))] ++ let expected = "Ident(proc_macro)"; ++ ++ #[cfg(span_locations)] ++ let expected = "Ident { sym: proc_macro }"; ++ ++ assert_eq!(expected, format!("{:?}", ident)); ++} ++ ++#[test] ++fn test_debug_tokenstream() { ++ let tts = TokenStream::from_str("[a + 1]").unwrap(); ++ ++ #[cfg(not(span_locations))] ++ let expected = "\ ++TokenStream [ ++ Group { ++ delimiter: Bracket, ++ stream: TokenStream [ ++ Ident { ++ sym: a, ++ }, ++ Punct { ++ char: '+', ++ spacing: Alone, ++ }, ++ Literal { ++ lit: 1, ++ }, ++ ], ++ }, ++]\ ++ "; ++ ++ #[cfg(not(span_locations))] ++ let expected_before_trailing_commas = "\ ++TokenStream [ ++ Group { ++ delimiter: Bracket, ++ stream: TokenStream [ ++ Ident { ++ sym: a ++ }, ++ Punct { ++ char: '+', ++ spacing: Alone ++ }, ++ Literal { ++ lit: 1 ++ } ++ ] ++ } ++]\ ++ "; ++ ++ #[cfg(span_locations)] ++ let expected = "\ ++TokenStream [ ++ Group { ++ delimiter: Bracket, ++ stream: TokenStream [ ++ Ident { ++ sym: a, ++ span: bytes(2..3), ++ }, ++ Punct { ++ char: '+', ++ spacing: Alone, ++ span: bytes(4..5), ++ }, ++ Literal { ++ lit: 1, ++ span: bytes(6..7), ++ }, ++ ], ++ span: bytes(1..8), ++ }, ++]\ ++ "; ++ ++ #[cfg(span_locations)] ++ let expected_before_trailing_commas = "\ ++TokenStream [ ++ Group { ++ delimiter: Bracket, ++ stream: TokenStream [ ++ Ident { ++ sym: a, ++ span: bytes(2..3) ++ }, ++ Punct { ++ char: '+', ++ spacing: Alone, ++ span: bytes(4..5) ++ }, ++ Literal { ++ lit: 1, ++ span: bytes(6..7) ++ } ++ ], ++ span: bytes(1..8) ++ } ++]\ ++ "; ++ ++ let actual = format!("{:#?}", tts); ++ if actual.ends_with(",\n]") { ++ assert_eq!(expected, actual); ++ } else { ++ assert_eq!(expected_before_trailing_commas, actual); ++ } ++} ++ ++#[test] ++fn default_tokenstream_is_empty() { ++ let default_token_stream = ::default(); ++ ++ assert!(default_token_stream.is_empty()); ++} ++ ++#[test] ++fn tokenstream_size_hint() { ++ let tokens = "a b (c d) e".parse::().unwrap(); ++ ++ assert_eq!(tokens.into_iter().size_hint(), (4, Some(4))); ++} ++ ++#[test] ++fn tuple_indexing() { ++ // This behavior may change depending on https://github.com/rust-lang/rust/pull/71322 ++ let mut tokens = "tuple.0.0".parse::().unwrap().into_iter(); ++ assert_eq!("tuple", tokens.next().unwrap().to_string()); ++ assert_eq!(".", tokens.next().unwrap().to_string()); ++ assert_eq!("0.0", tokens.next().unwrap().to_string()); ++ assert!(tokens.next().is_none()); ++} ++ ++#[cfg(span_locations)] ++#[test] ++fn non_ascii_tokens() { ++ check_spans("// abc", &[]); ++ check_spans("// ábc", &[]); ++ check_spans("// abc x", &[]); ++ check_spans("// ábc x", &[]); ++ check_spans("/* abc */ x", &[(1, 10, 1, 11)]); ++ check_spans("/* ábc */ x", &[(1, 10, 1, 11)]); ++ check_spans("/* ab\nc */ x", &[(2, 5, 2, 6)]); ++ check_spans("/* áb\nc */ x", &[(2, 5, 2, 6)]); ++ check_spans("/*** abc */ x", &[(1, 12, 1, 13)]); ++ check_spans("/*** ábc */ x", &[(1, 12, 1, 13)]); ++ check_spans(r#""abc""#, &[(1, 0, 1, 5)]); ++ check_spans(r#""ábc""#, &[(1, 0, 1, 5)]); ++ check_spans(r##"r#"abc"#"##, &[(1, 0, 1, 8)]); ++ check_spans(r##"r#"ábc"#"##, &[(1, 0, 1, 8)]); ++ check_spans("r#\"a\nc\"#", &[(1, 0, 2, 3)]); ++ check_spans("r#\"á\nc\"#", &[(1, 0, 2, 3)]); ++ check_spans("'a'", &[(1, 0, 1, 3)]); ++ check_spans("'á'", &[(1, 0, 1, 3)]); ++ check_spans("//! abc", &[(1, 0, 1, 7), (1, 0, 1, 7), (1, 0, 1, 7)]); ++ check_spans("//! ábc", &[(1, 0, 1, 7), (1, 0, 1, 7), (1, 0, 1, 7)]); ++ check_spans("//! abc\n", &[(1, 0, 1, 7), (1, 0, 1, 7), (1, 0, 1, 7)]); ++ check_spans("//! ábc\n", &[(1, 0, 1, 7), (1, 0, 1, 7), (1, 0, 1, 7)]); ++ check_spans("/*! abc */", &[(1, 0, 1, 10), (1, 0, 1, 10), (1, 0, 1, 10)]); ++ check_spans("/*! ábc */", &[(1, 0, 1, 10), (1, 0, 1, 10), (1, 0, 1, 10)]); ++ check_spans("/*! a\nc */", &[(1, 0, 2, 4), (1, 0, 2, 4), (1, 0, 2, 4)]); ++ check_spans("/*! á\nc */", &[(1, 0, 2, 4), (1, 0, 2, 4), (1, 0, 2, 4)]); ++ check_spans("abc", &[(1, 0, 1, 3)]); ++ check_spans("ábc", &[(1, 0, 1, 3)]); ++ check_spans("ábć", &[(1, 0, 1, 3)]); ++ check_spans("abc// foo", &[(1, 0, 1, 3)]); ++ check_spans("ábc// foo", &[(1, 0, 1, 3)]); ++ check_spans("ábć// foo", &[(1, 0, 1, 3)]); ++ check_spans("b\"a\\\n c\"", &[(1, 0, 2, 3)]); ++} ++ ++#[cfg(span_locations)] ++fn check_spans(p: &str, mut lines: &[(usize, usize, usize, usize)]) { ++ let ts = p.parse::().unwrap(); ++ check_spans_internal(ts, &mut lines); ++ assert!(lines.is_empty(), "leftover ranges: {:?}", lines); ++} ++ ++#[cfg(span_locations)] ++fn check_spans_internal(ts: TokenStream, lines: &mut &[(usize, usize, usize, usize)]) { ++ for i in ts { ++ if let Some((&(sline, scol, eline, ecol), rest)) = lines.split_first() { ++ *lines = rest; ++ ++ let start = i.span().start(); ++ assert_eq!(start.line, sline, "sline did not match for {}", i); ++ assert_eq!(start.column, scol, "scol did not match for {}", i); ++ ++ let end = i.span().end(); ++ assert_eq!(end.line, eline, "eline did not match for {}", i); ++ assert_eq!(end.column, ecol, "ecol did not match for {}", i); ++ ++ if let TokenTree::Group(g) = i { ++ check_spans_internal(g.stream().clone(), lines); ++ } ++ } ++ } ++} ++ ++#[test] ++fn whitespace() { ++ // space, horizontal tab, vertical tab, form feed, carriage return, line ++ // feed, non-breaking space, left-to-right mark, right-to-left mark ++ let various_spaces = " \t\u{b}\u{c}\r\n\u{a0}\u{200e}\u{200f}"; ++ let tokens = various_spaces.parse::().unwrap(); ++ assert_eq!(tokens.into_iter().count(), 0); ++ ++ let lone_carriage_returns = " \r \r\r\n "; ++ lone_carriage_returns.parse::().unwrap(); ++} ++ ++#[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(); ++} ++ ++#[cfg(span_locations)] ++fn create_span() -> proc_macro2::Span { ++ let tts: TokenStream = "1".parse().unwrap(); ++ match tts.into_iter().next().unwrap() { ++ TokenTree::Literal(literal) => literal.span(), ++ _ => unreachable!(), ++ } ++} ++ ++#[cfg(span_locations)] ++#[test] ++fn test_invalidate_current_thread_spans() { ++ let actual = format!("{:#?}", create_span()); ++ assert_eq!(actual, "bytes(1..2)"); ++ let actual = format!("{:#?}", create_span()); ++ assert_eq!(actual, "bytes(3..4)"); ++ ++ proc_macro2::extra::invalidate_current_thread_spans(); ++ ++ let actual = format!("{:#?}", create_span()); ++ // Test that span offsets have been reset after the call ++ // to invalidate_current_thread_spans() ++ assert_eq!(actual, "bytes(1..2)"); ++} ++ ++#[cfg(span_locations)] ++#[test] ++#[should_panic(expected = "Invalid span with no related FileInfo!")] ++fn test_use_span_after_invalidation() { ++ let span = create_span(); ++ ++ proc_macro2::extra::invalidate_current_thread_spans(); ++ ++ span.source_text(); ++} +diff -Nru mesa-25.3.3/subprojects/proc-macro2-1.0.92/tests/test_size.rs mesa-25.3.3/subprojects/proc-macro2-1.0.92/tests/test_size.rs +--- mesa-25.3.3/subprojects/proc-macro2-1.0.92/tests/test_size.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/proc-macro2-1.0.92/tests/test_size.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,81 @@ ++#![allow(unused_attributes)] ++ ++extern crate proc_macro; ++ ++use std::mem; ++ ++#[rustversion::attr(before(1.64), ignore = "requires Rust 1.64+")] ++#[cfg_attr(not(target_pointer_width = "64"), ignore = "only applicable to 64-bit")] ++#[cfg_attr(randomize_layout, ignore = "disabled due to randomized layout")] ++#[test] ++fn test_proc_macro_size() { ++ assert_eq!(mem::size_of::(), 4); ++ assert_eq!(mem::size_of::>(), 4); ++ assert_eq!(mem::size_of::(), 20); ++ assert_eq!(mem::size_of::(), 12); ++ assert_eq!(mem::size_of::(), 8); ++ assert_eq!(mem::size_of::(), 16); ++ assert_eq!(mem::size_of::(), 4); ++} ++ ++#[cfg_attr(not(target_pointer_width = "64"), ignore = "only applicable to 64-bit")] ++#[cfg_attr(randomize_layout, ignore = "disabled due to randomized layout")] ++#[cfg_attr(wrap_proc_macro, ignore = "wrapper mode")] ++#[cfg_attr(span_locations, ignore = "span locations are on")] ++#[test] ++fn test_proc_macro2_fallback_size_without_locations() { ++ assert_eq!(mem::size_of::(), 0); ++ assert_eq!(mem::size_of::>(), 1); ++ assert_eq!(mem::size_of::(), 16); ++ assert_eq!(mem::size_of::(), 24); ++ assert_eq!(mem::size_of::(), 8); ++ assert_eq!(mem::size_of::(), 24); ++ assert_eq!(mem::size_of::(), 8); ++} ++ ++#[cfg_attr(not(target_pointer_width = "64"), ignore = "only applicable to 64-bit")] ++#[cfg_attr(randomize_layout, ignore = "disabled due to randomized layout")] ++#[cfg_attr(wrap_proc_macro, ignore = "wrapper mode")] ++#[cfg_attr(not(span_locations), ignore = "span locations are off")] ++#[test] ++fn test_proc_macro2_fallback_size_with_locations() { ++ assert_eq!(mem::size_of::(), 8); ++ assert_eq!(mem::size_of::>(), 12); ++ assert_eq!(mem::size_of::(), 24); ++ assert_eq!(mem::size_of::(), 32); ++ assert_eq!(mem::size_of::(), 16); ++ assert_eq!(mem::size_of::(), 32); ++ assert_eq!(mem::size_of::(), 8); ++} ++ ++#[rustversion::attr(before(1.71), ignore = "requires Rust 1.71+")] ++#[cfg_attr(not(target_pointer_width = "64"), ignore = "only applicable to 64-bit")] ++#[cfg_attr(randomize_layout, ignore = "disabled due to randomized layout")] ++#[cfg_attr(not(wrap_proc_macro), ignore = "fallback mode")] ++#[cfg_attr(span_locations, ignore = "span locations are on")] ++#[test] ++fn test_proc_macro2_wrapper_size_without_locations() { ++ assert_eq!(mem::size_of::(), 4); ++ assert_eq!(mem::size_of::>(), 8); ++ assert_eq!(mem::size_of::(), 24); ++ assert_eq!(mem::size_of::(), 24); ++ assert_eq!(mem::size_of::(), 12); ++ assert_eq!(mem::size_of::(), 24); ++ assert_eq!(mem::size_of::(), 32); ++} ++ ++#[rustversion::attr(before(1.65), ignore = "requires Rust 1.65+")] ++#[cfg_attr(not(target_pointer_width = "64"), ignore = "only applicable to 64-bit")] ++#[cfg_attr(randomize_layout, ignore = "disabled due to randomized layout")] ++#[cfg_attr(not(wrap_proc_macro), ignore = "fallback mode")] ++#[cfg_attr(not(span_locations), ignore = "span locations are off")] ++#[test] ++fn test_proc_macro2_wrapper_size_with_locations() { ++ assert_eq!(mem::size_of::(), 12); ++ assert_eq!(mem::size_of::>(), 12); ++ assert_eq!(mem::size_of::(), 32); ++ assert_eq!(mem::size_of::(), 32); ++ assert_eq!(mem::size_of::(), 20); ++ assert_eq!(mem::size_of::(), 32); ++ assert_eq!(mem::size_of::(), 32); ++} +diff -Nru mesa-25.3.3/subprojects/proc-macro2-1-rs.wrap mesa-25.3.3/subprojects/proc-macro2-1-rs.wrap +--- mesa-25.3.3/subprojects/proc-macro2-1-rs.wrap 2026-01-01 13:34:04.000000000 -0500 ++++ mesa-25.3.3/subprojects/proc-macro2-1-rs.wrap 2026-05-29 13:40:55.000000000 -0500 +@@ -1,6 +1,4 @@ + [wrap-file] +-directory = proc-macro2-1.0.86 +-source_url = https://crates.io/api/v1/crates/proc-macro2/1.0.86/download +-source_filename = proc-macro2-1.0.86.tar.gz +-source_hash = 5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77 ++directory = proc-macro2-1.0.92 + patch_directory = proc-macro2-1-rs ++ +diff -Nru mesa-25.3.3/subprojects/quote-1.0.40/.cargo-checksum.json mesa-25.3.3/subprojects/quote-1.0.40/.cargo-checksum.json +--- mesa-25.3.3/subprojects/quote-1.0.40/.cargo-checksum.json 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/quote-1.0.40/.cargo-checksum.json 2025-04-06 23:35:59.000000000 -0500 +@@ -0,0 +1 @@ ++{"package":"1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d","files":{}} +diff -Nru mesa-25.3.3/subprojects/quote-1.0.40/Cargo.toml mesa-25.3.3/subprojects/quote-1.0.40/Cargo.toml +--- mesa-25.3.3/subprojects/quote-1.0.40/Cargo.toml 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/quote-1.0.40/Cargo.toml 2025-04-06 23:35:59.000000000 -0500 +@@ -0,0 +1,69 @@ ++# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO ++# ++# When uploading crates to the registry Cargo will automatically ++# "normalize" Cargo.toml files for maximal compatibility ++# with all versions of Cargo and also rewrite `path` dependencies ++# to registry (e.g., crates.io) dependencies. ++# ++# If you are reading this file be aware that the original Cargo.toml ++# will likely look very different (and much more reasonable). ++# See Cargo.toml.orig for the original contents. ++ ++[package] ++edition = "2018" ++rust-version = "1.56" ++name = "quote" ++version = "1.0.40" ++authors = ["David Tolnay "] ++build = false ++autolib = false ++autobins = false ++autoexamples = false ++autotests = false ++autobenches = false ++description = "Quasi-quoting macro quote!(...)" ++documentation = "https://docs.rs/quote/" ++readme = "README.md" ++keywords = [ ++ "macros", ++ "syn", ++] ++categories = ["development-tools::procedural-macro-helpers"] ++license = "MIT OR Apache-2.0" ++repository = "https://github.com/dtolnay/quote" ++ ++[package.metadata.docs.rs] ++rustdoc-args = [ ++ "--generate-link-to-definition", ++ "--extern-html-root-url=core=https://doc.rust-lang.org", ++ "--extern-html-root-url=alloc=https://doc.rust-lang.org", ++ "--extern-html-root-url=std=https://doc.rust-lang.org", ++] ++targets = ["x86_64-unknown-linux-gnu"] ++ ++[features] ++default = ["proc-macro"] ++proc-macro = ["proc-macro2/proc-macro"] ++ ++[lib] ++name = "quote" ++path = "src/lib.rs" ++ ++[[test]] ++name = "compiletest" ++path = "tests/compiletest.rs" ++ ++[[test]] ++name = "test" ++path = "tests/test.rs" ++ ++[dependencies.proc-macro2] ++version = "1.0.80" ++default-features = false ++ ++[dev-dependencies.rustversion] ++version = "1.0" ++ ++[dev-dependencies.trybuild] ++version = "1.0.66" ++features = ["diff"] +diff -Nru mesa-25.3.3/subprojects/quote-1.0.40/.cargo_vcs_info.json mesa-25.3.3/subprojects/quote-1.0.40/.cargo_vcs_info.json +--- mesa-25.3.3/subprojects/quote-1.0.40/.cargo_vcs_info.json 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/quote-1.0.40/.cargo_vcs_info.json 2025-04-06 23:35:59.000000000 -0500 +@@ -0,0 +1,6 @@ ++{ ++ "git": { ++ "sha1": "ab1e92c27a492e6077e203a6f85496bb4b1522e8" ++ }, ++ "path_in_vcs": "" ++} +\ No hay ningún carácter de nueva línea al final del archivo +diff -Nru mesa-25.3.3/subprojects/quote-1.0.40/.github/FUNDING.yml mesa-25.3.3/subprojects/quote-1.0.40/.github/FUNDING.yml +--- mesa-25.3.3/subprojects/quote-1.0.40/.github/FUNDING.yml 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/quote-1.0.40/.github/FUNDING.yml 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1 @@ ++github: dtolnay +diff -Nru mesa-25.3.3/subprojects/quote-1.0.40/.github/workflows/ci.yml mesa-25.3.3/subprojects/quote-1.0.40/.github/workflows/ci.yml +--- mesa-25.3.3/subprojects/quote-1.0.40/.github/workflows/ci.yml 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/quote-1.0.40/.github/workflows/ci.yml 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,110 @@ ++name: CI ++ ++on: ++ push: ++ pull_request: ++ workflow_dispatch: ++ schedule: [cron: "40 1 * * *"] ++ ++permissions: ++ contents: read ++ ++env: ++ RUSTFLAGS: -Dwarnings ++ ++jobs: ++ pre_ci: ++ uses: dtolnay/.github/.github/workflows/pre_ci.yml@master ++ ++ test: ++ name: Rust ${{matrix.rust}} ++ needs: pre_ci ++ if: needs.pre_ci.outputs.continue ++ runs-on: ubuntu-latest ++ strategy: ++ fail-fast: false ++ matrix: ++ rust: [nightly, stable, beta, 1.56.0] ++ timeout-minutes: 45 ++ steps: ++ - uses: actions/checkout@v4 ++ - uses: dtolnay/rust-toolchain@master ++ with: ++ toolchain: ${{matrix.rust}} ++ components: rust-src ++ - name: Enable type layout randomization ++ run: echo RUSTFLAGS=${RUSTFLAGS}\ -Zrandomize-layout >> $GITHUB_ENV ++ if: matrix.rust == 'nightly' ++ - run: cargo test ++ - run: cargo run --manifest-path benches/Cargo.toml ++ - uses: actions/upload-artifact@v4 ++ if: matrix.rust == 'nightly' && always() ++ with: ++ name: Cargo.lock ++ path: Cargo.lock ++ continue-on-error: true ++ ++ minimal: ++ name: Minimal versions ++ needs: pre_ci ++ if: needs.pre_ci.outputs.continue ++ runs-on: ubuntu-latest ++ timeout-minutes: 45 ++ steps: ++ - uses: actions/checkout@v4 ++ - uses: dtolnay/rust-toolchain@nightly ++ - run: cargo generate-lockfile -Z minimal-versions ++ - run: cargo check --locked ++ ++ doc: ++ name: Documentation ++ needs: pre_ci ++ if: needs.pre_ci.outputs.continue ++ runs-on: ubuntu-latest ++ timeout-minutes: 45 ++ env: ++ RUSTDOCFLAGS: -Dwarnings ++ steps: ++ - uses: actions/checkout@v4 ++ - uses: dtolnay/rust-toolchain@nightly ++ with: ++ components: rust-src ++ - uses: dtolnay/install@cargo-docs-rs ++ - run: cargo docs-rs ++ ++ clippy: ++ name: Clippy ++ runs-on: ubuntu-latest ++ if: github.event_name != 'pull_request' ++ timeout-minutes: 45 ++ steps: ++ - uses: actions/checkout@v4 ++ - uses: dtolnay/rust-toolchain@nightly ++ with: ++ components: clippy, rust-src ++ - run: cargo clippy --tests --workspace -- -Dclippy::all -Dclippy::pedantic ++ ++ miri: ++ name: Miri ++ needs: pre_ci ++ if: needs.pre_ci.outputs.continue ++ runs-on: ubuntu-latest ++ timeout-minutes: 45 ++ steps: ++ - uses: actions/checkout@v4 ++ - uses: dtolnay/rust-toolchain@miri ++ - run: cargo miri setup ++ - run: cargo miri test ++ env: ++ MIRIFLAGS: -Zmiri-strict-provenance ++ ++ outdated: ++ name: Outdated ++ runs-on: ubuntu-latest ++ if: github.event_name != 'pull_request' ++ timeout-minutes: 45 ++ steps: ++ - uses: actions/checkout@v4 ++ - uses: dtolnay/rust-toolchain@stable ++ - uses: dtolnay/install@cargo-outdated ++ - run: cargo outdated --workspace --exit-code 1 +diff -Nru mesa-25.3.3/subprojects/quote-1.0.40/.gitignore mesa-25.3.3/subprojects/quote-1.0.40/.gitignore +--- mesa-25.3.3/subprojects/quote-1.0.40/.gitignore 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/quote-1.0.40/.gitignore 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,2 @@ ++/target/ ++/Cargo.lock +diff -Nru mesa-25.3.3/subprojects/quote-1.0.40/LICENSE-APACHE mesa-25.3.3/subprojects/quote-1.0.40/LICENSE-APACHE +--- mesa-25.3.3/subprojects/quote-1.0.40/LICENSE-APACHE 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/quote-1.0.40/LICENSE-APACHE 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,176 @@ ++ Apache License ++ Version 2.0, January 2004 ++ http://www.apache.org/licenses/ ++ ++TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION ++ ++1. Definitions. ++ ++ "License" shall mean the terms and conditions for use, reproduction, ++ and distribution as defined by Sections 1 through 9 of this document. ++ ++ "Licensor" shall mean the copyright owner or entity authorized by ++ the copyright owner that is granting the License. ++ ++ "Legal Entity" shall mean the union of the acting entity and all ++ other entities that control, are controlled by, or are under common ++ control with that entity. For the purposes of this definition, ++ "control" means (i) the power, direct or indirect, to cause the ++ direction or management of such entity, whether by contract or ++ otherwise, or (ii) ownership of fifty percent (50%) or more of the ++ outstanding shares, or (iii) beneficial ownership of such entity. ++ ++ "You" (or "Your") shall mean an individual or Legal Entity ++ exercising permissions granted by this License. ++ ++ "Source" form shall mean the preferred form for making modifications, ++ including but not limited to software source code, documentation ++ source, and configuration files. ++ ++ "Object" form shall mean any form resulting from mechanical ++ transformation or translation of a Source form, including but ++ not limited to compiled object code, generated documentation, ++ and conversions to other media types. ++ ++ "Work" shall mean the work of authorship, whether in Source or ++ Object form, made available under the License, as indicated by a ++ copyright notice that is included in or attached to the work ++ (an example is provided in the Appendix below). ++ ++ "Derivative Works" shall mean any work, whether in Source or Object ++ form, that is based on (or derived from) the Work and for which the ++ editorial revisions, annotations, elaborations, or other modifications ++ represent, as a whole, an original work of authorship. For the purposes ++ of this License, Derivative Works shall not include works that remain ++ separable from, or merely link (or bind by name) to the interfaces of, ++ the Work and Derivative Works thereof. ++ ++ "Contribution" shall mean any work of authorship, including ++ the original version of the Work and any modifications or additions ++ to that Work or Derivative Works thereof, that is intentionally ++ submitted to Licensor for inclusion in the Work by the copyright owner ++ or by an individual or Legal Entity authorized to submit on behalf of ++ the copyright owner. For the purposes of this definition, "submitted" ++ means any form of electronic, verbal, or written communication sent ++ to the Licensor or its representatives, including but not limited to ++ communication on electronic mailing lists, source code control systems, ++ and issue tracking systems that are managed by, or on behalf of, the ++ Licensor for the purpose of discussing and improving the Work, but ++ excluding communication that is conspicuously marked or otherwise ++ designated in writing by the copyright owner as "Not a Contribution." ++ ++ "Contributor" shall mean Licensor and any individual or Legal Entity ++ on behalf of whom a Contribution has been received by Licensor and ++ subsequently incorporated within the Work. ++ ++2. Grant of Copyright License. Subject to the terms and conditions of ++ this License, each Contributor hereby grants to You a perpetual, ++ worldwide, non-exclusive, no-charge, royalty-free, irrevocable ++ copyright license to reproduce, prepare Derivative Works of, ++ publicly display, publicly perform, sublicense, and distribute the ++ Work and such Derivative Works in Source or Object form. ++ ++3. Grant of Patent License. Subject to the terms and conditions of ++ this License, each Contributor hereby grants to You a perpetual, ++ worldwide, non-exclusive, no-charge, royalty-free, irrevocable ++ (except as stated in this section) patent license to make, have made, ++ use, offer to sell, sell, import, and otherwise transfer the Work, ++ where such license applies only to those patent claims licensable ++ by such Contributor that are necessarily infringed by their ++ Contribution(s) alone or by combination of their Contribution(s) ++ with the Work to which such Contribution(s) was submitted. If You ++ institute patent litigation against any entity (including a ++ cross-claim or counterclaim in a lawsuit) alleging that the Work ++ or a Contribution incorporated within the Work constitutes direct ++ or contributory patent infringement, then any patent licenses ++ granted to You under this License for that Work shall terminate ++ as of the date such litigation is filed. ++ ++4. Redistribution. You may reproduce and distribute copies of the ++ Work or Derivative Works thereof in any medium, with or without ++ modifications, and in Source or Object form, provided that You ++ meet the following conditions: ++ ++ (a) You must give any other recipients of the Work or ++ Derivative Works a copy of this License; and ++ ++ (b) You must cause any modified files to carry prominent notices ++ stating that You changed the files; and ++ ++ (c) You must retain, in the Source form of any Derivative Works ++ that You distribute, all copyright, patent, trademark, and ++ attribution notices from the Source form of the Work, ++ excluding those notices that do not pertain to any part of ++ the Derivative Works; and ++ ++ (d) If the Work includes a "NOTICE" text file as part of its ++ distribution, then any Derivative Works that You distribute must ++ include a readable copy of the attribution notices contained ++ within such NOTICE file, excluding those notices that do not ++ pertain to any part of the Derivative Works, in at least one ++ of the following places: within a NOTICE text file distributed ++ as part of the Derivative Works; within the Source form or ++ documentation, if provided along with the Derivative Works; or, ++ within a display generated by the Derivative Works, if and ++ wherever such third-party notices normally appear. The contents ++ of the NOTICE file are for informational purposes only and ++ do not modify the License. You may add Your own attribution ++ notices within Derivative Works that You distribute, alongside ++ or as an addendum to the NOTICE text from the Work, provided ++ that such additional attribution notices cannot be construed ++ as modifying the License. ++ ++ You may add Your own copyright statement to Your modifications and ++ may provide additional or different license terms and conditions ++ for use, reproduction, or distribution of Your modifications, or ++ for any such Derivative Works as a whole, provided Your use, ++ reproduction, and distribution of the Work otherwise complies with ++ the conditions stated in this License. ++ ++5. Submission of Contributions. Unless You explicitly state otherwise, ++ any Contribution intentionally submitted for inclusion in the Work ++ by You to the Licensor shall be under the terms and conditions of ++ this License, without any additional terms or conditions. ++ Notwithstanding the above, nothing herein shall supersede or modify ++ the terms of any separate license agreement you may have executed ++ with Licensor regarding such Contributions. ++ ++6. Trademarks. This License does not grant permission to use the trade ++ names, trademarks, service marks, or product names of the Licensor, ++ except as required for reasonable and customary use in describing the ++ origin of the Work and reproducing the content of the NOTICE file. ++ ++7. Disclaimer of Warranty. Unless required by applicable law or ++ agreed to in writing, Licensor provides the Work (and each ++ Contributor provides its Contributions) on an "AS IS" BASIS, ++ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or ++ implied, including, without limitation, any warranties or conditions ++ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A ++ PARTICULAR PURPOSE. You are solely responsible for determining the ++ appropriateness of using or redistributing the Work and assume any ++ risks associated with Your exercise of permissions under this License. ++ ++8. Limitation of Liability. In no event and under no legal theory, ++ whether in tort (including negligence), contract, or otherwise, ++ unless required by applicable law (such as deliberate and grossly ++ negligent acts) or agreed to in writing, shall any Contributor be ++ liable to You for damages, including any direct, indirect, special, ++ incidental, or consequential damages of any character arising as a ++ result of this License or out of the use or inability to use the ++ Work (including but not limited to damages for loss of goodwill, ++ work stoppage, computer failure or malfunction, or any and all ++ other commercial damages or losses), even if such Contributor ++ has been advised of the possibility of such damages. ++ ++9. Accepting Warranty or Additional Liability. While redistributing ++ the Work or Derivative Works thereof, You may choose to offer, ++ and charge a fee for, acceptance of support, warranty, indemnity, ++ or other liability obligations and/or rights consistent with this ++ License. However, in accepting such obligations, You may act only ++ on Your own behalf and on Your sole responsibility, not on behalf ++ of any other Contributor, and only if You agree to indemnify, ++ defend, and hold each Contributor harmless for any liability ++ incurred by, or claims asserted against, such Contributor by reason ++ of your accepting any such warranty or additional liability. ++ ++END OF TERMS AND CONDITIONS +diff -Nru mesa-25.3.3/subprojects/quote-1.0.40/LICENSE-MIT mesa-25.3.3/subprojects/quote-1.0.40/LICENSE-MIT +--- mesa-25.3.3/subprojects/quote-1.0.40/LICENSE-MIT 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/quote-1.0.40/LICENSE-MIT 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,23 @@ ++Permission is hereby granted, free of charge, to any ++person obtaining a copy of this software and associated ++documentation files (the "Software"), to deal in the ++Software without restriction, including without ++limitation the rights to use, copy, modify, merge, ++publish, distribute, sublicense, and/or sell copies of ++the Software, and to permit persons to whom the Software ++is furnished to do so, subject to the following ++conditions: ++ ++The above copyright notice and this permission notice ++shall be included in all copies or substantial portions ++of the Software. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ++ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED ++TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A ++PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT ++SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ++CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION ++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR ++IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ++DEALINGS IN THE SOFTWARE. +diff -Nru mesa-25.3.3/subprojects/quote-1.0.40/meson.build mesa-25.3.3/subprojects/quote-1.0.40/meson.build +--- mesa-25.3.3/subprojects/quote-1.0.40/meson.build 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/quote-1.0.40/meson.build 2026-05-26 15:46:09.000000000 -0500 +@@ -0,0 +1,27 @@ ++project('quote', 'rust', version : '1.0.40', license : 'MIT OR Apache-2.0') ++ ++rc = meson.get_compiler('rust') ++ ++if rc.version().version_compare('< 1.31') ++ error('Minimum rustc supported version is 1.31') ++endif ++ ++rust_args = ['--cfg', 'feature="default"', '--cfg', 'feature="proc-macro"'] ++if rc.version().version_compare('< 1.53') ++ rust_args += ['--cfg', 'needs_invalid_span_workaround'] ++endif ++ ++pm2 = subproject('proc-macro2-1-rs').get_variable('lib') ++ ++# XXX: workround for meson bug: https://github.com/mesonbuild/meson/issues/11306 ++rust_args += ['-L', 'dependency=subprojects/unicode-ident-1-rs'] ++ ++lib = static_library( ++ 'quote', ++ 'src/lib.rs', ++ rust_args : rust_args, ++ override_options : ['rust_std=2018', 'build.rust_std=2018'], ++ link_with : pm2, ++ rust_abi : 'rust', ++ native : true, ++) +diff -Nru mesa-25.3.3/subprojects/quote-1.0.40/.meson-subproject-wrap-hash.txt mesa-25.3.3/subprojects/quote-1.0.40/.meson-subproject-wrap-hash.txt +--- mesa-25.3.3/subprojects/quote-1.0.40/.meson-subproject-wrap-hash.txt 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/quote-1.0.40/.meson-subproject-wrap-hash.txt 2026-05-29 13:40:56.000000000 -0500 +@@ -0,0 +1 @@ ++0547d326c8f1fd228ed8cb89bdd57a311e4ce69299b5fc05168570febe176e48 +diff -Nru mesa-25.3.3/subprojects/quote-1.0.40/README.md mesa-25.3.3/subprojects/quote-1.0.40/README.md +--- mesa-25.3.3/subprojects/quote-1.0.40/README.md 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/quote-1.0.40/README.md 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,271 @@ ++Rust Quasi-Quoting ++================== ++ ++[github](https://github.com/dtolnay/quote) ++[crates.io](https://crates.io/crates/quote) ++[docs.rs](https://docs.rs/quote) ++[build status](https://github.com/dtolnay/quote/actions?query=branch%3Amaster) ++ ++This crate provides the [`quote!`] macro for turning Rust syntax tree data ++structures into tokens of source code. ++ ++[`quote!`]: https://docs.rs/quote/1.0/quote/macro.quote.html ++ ++Procedural macros in Rust receive a stream of tokens as input, execute arbitrary ++Rust code to determine how to manipulate those tokens, and produce a stream of ++tokens to hand back to the compiler to compile into the caller's crate. ++Quasi-quoting is a solution to one piece of that — producing tokens to ++return to the compiler. ++ ++The idea of quasi-quoting is that we write *code* that we treat as *data*. ++Within the `quote!` macro, we can write what looks like code to our text editor ++or IDE. We get all the benefits of the editor's brace matching, syntax ++highlighting, indentation, and maybe autocompletion. But rather than compiling ++that as code into the current crate, we can treat it as data, pass it around, ++mutate it, and eventually hand it back to the compiler as tokens to compile into ++the macro caller's crate. ++ ++This crate is motivated by the procedural macro use case, but is a ++general-purpose Rust quasi-quoting library and is not specific to procedural ++macros. ++ ++```toml ++[dependencies] ++quote = "1.0" ++``` ++ ++*Version requirement: Quote supports rustc 1.56 and up.*
++[*Release notes*](https://github.com/dtolnay/quote/releases) ++ ++
++ ++## Syntax ++ ++The quote crate provides a [`quote!`] macro within which you can write Rust code ++that gets packaged into a [`TokenStream`] and can be treated as data. You should ++think of `TokenStream` as representing a fragment of Rust source code. ++ ++[`TokenStream`]: https://docs.rs/proc-macro2/1.0/proc_macro2/struct.TokenStream.html ++ ++Within the `quote!` macro, interpolation is done with `#var`. Any type ++implementing the [`quote::ToTokens`] trait can be interpolated. This includes ++most Rust primitive types as well as most of the syntax tree types from [`syn`]. ++ ++[`quote::ToTokens`]: https://docs.rs/quote/1.0/quote/trait.ToTokens.html ++[`syn`]: https://github.com/dtolnay/syn ++ ++```rust ++let tokens = quote! { ++ struct SerializeWith #generics #where_clause { ++ value: &'a #field_ty, ++ phantom: core::marker::PhantomData<#item_ty>, ++ } ++ ++ impl #generics serde::Serialize for SerializeWith #generics #where_clause { ++ fn serialize(&self, serializer: S) -> Result ++ where ++ S: serde::Serializer, ++ { ++ #path(self.value, serializer) ++ } ++ } ++ ++ SerializeWith { ++ value: #value, ++ phantom: core::marker::PhantomData::<#item_ty>, ++ } ++}; ++``` ++ ++
++ ++## Repetition ++ ++Repetition is done using `#(...)*` or `#(...),*` similar to `macro_rules!`. This ++iterates through the elements of any variable interpolated within the repetition ++and inserts a copy of the repetition body for each one. The variables in an ++interpolation may be a `Vec`, slice, `BTreeSet`, or any `Iterator`. ++ ++- `#(#var)*` — no separators ++- `#(#var),*` — the character before the asterisk is used as a separator ++- `#( struct #var; )*` — the repetition can contain other things ++- `#( #k => println!("{}", #v), )*` — even multiple interpolations ++ ++Note that there is a difference between `#(#var ,)*` and `#(#var),*`—the latter ++does not produce a trailing comma. This matches the behavior of delimiters in ++`macro_rules!`. ++ ++
++ ++## Returning tokens to the compiler ++ ++The `quote!` macro evaluates to an expression of type ++`proc_macro2::TokenStream`. Meanwhile Rust procedural macros are expected to ++return the type `proc_macro::TokenStream`. ++ ++The difference between the two types is that `proc_macro` types are entirely ++specific to procedural macros and cannot ever exist in code outside of a ++procedural macro, while `proc_macro2` types may exist anywhere including tests ++and non-macro code like main.rs and build.rs. This is why even the procedural ++macro ecosystem is largely built around `proc_macro2`, because that ensures the ++libraries are unit testable and accessible in non-macro contexts. ++ ++There is a [`From`]-conversion in both directions so returning the output of ++`quote!` from a procedural macro usually looks like `tokens.into()` or ++`proc_macro::TokenStream::from(tokens)`. ++ ++[`From`]: https://doc.rust-lang.org/std/convert/trait.From.html ++ ++
++ ++## Examples ++ ++### Combining quoted fragments ++ ++Usually you don't end up constructing an entire final `TokenStream` in one ++piece. Different parts may come from different helper functions. The tokens ++produced by `quote!` themselves implement `ToTokens` and so can be interpolated ++into later `quote!` invocations to build up a final result. ++ ++```rust ++let type_definition = quote! {...}; ++let methods = quote! {...}; ++ ++let tokens = quote! { ++ #type_definition ++ #methods ++}; ++``` ++ ++### Constructing identifiers ++ ++Suppose we have an identifier `ident` which came from somewhere in a macro ++input and we need to modify it in some way for the macro output. Let's consider ++prepending the identifier with an underscore. ++ ++Simply interpolating the identifier next to an underscore will not have the ++behavior of concatenating them. The underscore and the identifier will continue ++to be two separate tokens as if you had written `_ x`. ++ ++```rust ++// incorrect ++quote! { ++ let mut _#ident = 0; ++} ++``` ++ ++The solution is to build a new identifier token with the correct value. As this ++is such a common case, the `format_ident!` macro provides a convenient utility ++for doing so correctly. ++ ++```rust ++let varname = format_ident!("_{}", ident); ++quote! { ++ let mut #varname = 0; ++} ++``` ++ ++Alternatively, the APIs provided by Syn and proc-macro2 can be used to directly ++build the identifier. This is roughly equivalent to the above, but will not ++handle `ident` being a raw identifier. ++ ++```rust ++let concatenated = format!("_{}", ident); ++let varname = syn::Ident::new(&concatenated, ident.span()); ++quote! { ++ let mut #varname = 0; ++} ++``` ++ ++### Making method calls ++ ++Let's say our macro requires some type specified in the macro input to have a ++constructor called `new`. We have the type in a variable called `field_type` of ++type `syn::Type` and want to invoke the constructor. ++ ++```rust ++// incorrect ++quote! { ++ let value = #field_type::new(); ++} ++``` ++ ++This works only sometimes. If `field_type` is `String`, the expanded code ++contains `String::new()` which is fine. But if `field_type` is something like ++`Vec` then the expanded code is `Vec::new()` which is invalid syntax. ++Ordinarily in handwritten Rust we would write `Vec::::new()` but for macros ++often the following is more convenient. ++ ++```rust ++quote! { ++ let value = <#field_type>::new(); ++} ++``` ++ ++This expands to `>::new()` which behaves correctly. ++ ++A similar pattern is appropriate for trait methods. ++ ++```rust ++quote! { ++ let value = <#field_type as core::default::Default>::default(); ++} ++``` ++ ++
++ ++## Hygiene ++ ++Any interpolated tokens preserve the `Span` information provided by their ++`ToTokens` implementation. Tokens that originate within a `quote!` invocation ++are spanned with [`Span::call_site()`]. ++ ++[`Span::call_site()`]: https://docs.rs/proc-macro2/1.0/proc_macro2/struct.Span.html#method.call_site ++ ++A different span can be provided explicitly through the [`quote_spanned!`] ++macro. ++ ++[`quote_spanned!`]: https://docs.rs/quote/1.0/quote/macro.quote_spanned.html ++ ++
++ ++## Non-macro code generators ++ ++When using `quote` in a build.rs or main.rs and writing the output out to a ++file, consider having the code generator pass the tokens through [prettyplease] ++before writing. This way if an error occurs in the generated code it is ++convenient for a human to read and debug. ++ ++Be aware that no kind of hygiene or span information is retained when tokens are ++written to a file; the conversion from tokens to source code is lossy. ++ ++Example usage in build.rs: ++ ++```rust ++let output = quote! { ... }; ++let syntax_tree = syn::parse2(output).unwrap(); ++let formatted = prettyplease::unparse(&syntax_tree); ++ ++let out_dir = env::var_os("OUT_DIR").unwrap(); ++let dest_path = Path::new(&out_dir).join("out.rs"); ++fs::write(dest_path, formatted).unwrap(); ++``` ++ ++[prettyplease]: https://github.com/dtolnay/prettyplease ++ ++
++ ++#### License ++ ++ ++Licensed under either of Apache License, Version ++2.0 or MIT license at your option. ++ ++ ++
++ ++ ++Unless you explicitly state otherwise, any contribution intentionally submitted ++for inclusion in this crate by you, as defined in the Apache-2.0 license, shall ++be dual licensed as above, without any additional terms or conditions. ++ +diff -Nru mesa-25.3.3/subprojects/quote-1.0.40/rust-toolchain.toml mesa-25.3.3/subprojects/quote-1.0.40/rust-toolchain.toml +--- mesa-25.3.3/subprojects/quote-1.0.40/rust-toolchain.toml 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/quote-1.0.40/rust-toolchain.toml 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,2 @@ ++[toolchain] ++components = ["rust-src"] +diff -Nru mesa-25.3.3/subprojects/quote-1.0.40/src/ext.rs mesa-25.3.3/subprojects/quote-1.0.40/src/ext.rs +--- mesa-25.3.3/subprojects/quote-1.0.40/src/ext.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/quote-1.0.40/src/ext.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,110 @@ ++use super::ToTokens; ++use core::iter; ++use proc_macro2::{TokenStream, TokenTree}; ++ ++/// TokenStream extension trait with methods for appending tokens. ++/// ++/// This trait is sealed and cannot be implemented outside of the `quote` crate. ++pub trait TokenStreamExt: private::Sealed { ++ /// For use by `ToTokens` implementations. ++ /// ++ /// Appends the token specified to this list of tokens. ++ fn append(&mut self, token: U) ++ where ++ U: Into; ++ ++ /// For use by `ToTokens` implementations. ++ /// ++ /// ``` ++ /// # use quote::{quote, TokenStreamExt, ToTokens}; ++ /// # use proc_macro2::TokenStream; ++ /// # ++ /// struct X; ++ /// ++ /// impl ToTokens for X { ++ /// fn to_tokens(&self, tokens: &mut TokenStream) { ++ /// tokens.append_all(&[true, false]); ++ /// } ++ /// } ++ /// ++ /// let tokens = quote!(#X); ++ /// assert_eq!(tokens.to_string(), "true false"); ++ /// ``` ++ fn append_all(&mut self, iter: I) ++ where ++ I: IntoIterator, ++ I::Item: ToTokens; ++ ++ /// For use by `ToTokens` implementations. ++ /// ++ /// Appends all of the items in the iterator `I`, separated by the tokens ++ /// `U`. ++ fn append_separated(&mut self, iter: I, op: U) ++ where ++ I: IntoIterator, ++ I::Item: ToTokens, ++ U: ToTokens; ++ ++ /// For use by `ToTokens` implementations. ++ /// ++ /// Appends all tokens in the iterator `I`, appending `U` after each ++ /// element, including after the last element of the iterator. ++ fn append_terminated(&mut self, iter: I, term: U) ++ where ++ I: IntoIterator, ++ I::Item: ToTokens, ++ U: ToTokens; ++} ++ ++impl TokenStreamExt for TokenStream { ++ fn append(&mut self, token: U) ++ where ++ U: Into, ++ { ++ self.extend(iter::once(token.into())); ++ } ++ ++ fn append_all(&mut self, iter: I) ++ where ++ I: IntoIterator, ++ I::Item: ToTokens, ++ { ++ for token in iter { ++ token.to_tokens(self); ++ } ++ } ++ ++ fn append_separated(&mut self, iter: I, op: U) ++ where ++ I: IntoIterator, ++ I::Item: ToTokens, ++ U: ToTokens, ++ { ++ for (i, token) in iter.into_iter().enumerate() { ++ if i > 0 { ++ op.to_tokens(self); ++ } ++ token.to_tokens(self); ++ } ++ } ++ ++ fn append_terminated(&mut self, iter: I, term: U) ++ where ++ I: IntoIterator, ++ I::Item: ToTokens, ++ U: ToTokens, ++ { ++ for token in iter { ++ token.to_tokens(self); ++ term.to_tokens(self); ++ } ++ } ++} ++ ++mod private { ++ use proc_macro2::TokenStream; ++ ++ pub trait Sealed {} ++ ++ impl Sealed for TokenStream {} ++} +diff -Nru mesa-25.3.3/subprojects/quote-1.0.40/src/format.rs mesa-25.3.3/subprojects/quote-1.0.40/src/format.rs +--- mesa-25.3.3/subprojects/quote-1.0.40/src/format.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/quote-1.0.40/src/format.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,168 @@ ++/// Formatting macro for constructing `Ident`s. ++/// ++///
++/// ++/// # Syntax ++/// ++/// Syntax is copied from the [`format!`] macro, supporting both positional and ++/// named arguments. ++/// ++/// Only a limited set of formatting traits are supported. The current mapping ++/// of format types to traits is: ++/// ++/// * `{}` ⇒ [`IdentFragment`] ++/// * `{:o}` ⇒ [`Octal`](std::fmt::Octal) ++/// * `{:x}` ⇒ [`LowerHex`](std::fmt::LowerHex) ++/// * `{:X}` ⇒ [`UpperHex`](std::fmt::UpperHex) ++/// * `{:b}` ⇒ [`Binary`](std::fmt::Binary) ++/// ++/// See [`std::fmt`] for more information. ++/// ++///
++/// ++/// # IdentFragment ++/// ++/// Unlike `format!`, this macro uses the [`IdentFragment`] formatting trait by ++/// default. This trait is like `Display`, with a few differences: ++/// ++/// * `IdentFragment` is only implemented for a limited set of types, such as ++/// unsigned integers and strings. ++/// * [`Ident`] arguments will have their `r#` prefixes stripped, if present. ++/// ++/// [`IdentFragment`]: crate::IdentFragment ++/// [`Ident`]: proc_macro2::Ident ++/// ++///
++/// ++/// # Hygiene ++/// ++/// The [`Span`] of the first `Ident` argument is used as the span of the final ++/// identifier, falling back to [`Span::call_site`] when no identifiers are ++/// provided. ++/// ++/// ``` ++/// # use quote::format_ident; ++/// # let ident = format_ident!("Ident"); ++/// // If `ident` is an Ident, the span of `my_ident` will be inherited from it. ++/// let my_ident = format_ident!("My{}{}", ident, "IsCool"); ++/// assert_eq!(my_ident, "MyIdentIsCool"); ++/// ``` ++/// ++/// Alternatively, the span can be overridden by passing the `span` named ++/// argument. ++/// ++/// ``` ++/// # use quote::format_ident; ++/// # const IGNORE_TOKENS: &'static str = stringify! { ++/// let my_span = /* ... */; ++/// # }; ++/// # let my_span = proc_macro2::Span::call_site(); ++/// format_ident!("MyIdent", span = my_span); ++/// ``` ++/// ++/// [`Span`]: proc_macro2::Span ++/// [`Span::call_site`]: proc_macro2::Span::call_site ++/// ++///


++/// ++/// # Panics ++/// ++/// This method will panic if the resulting formatted string is not a valid ++/// identifier. ++/// ++///
++/// ++/// # Examples ++/// ++/// Composing raw and non-raw identifiers: ++/// ``` ++/// # use quote::format_ident; ++/// let my_ident = format_ident!("My{}", "Ident"); ++/// assert_eq!(my_ident, "MyIdent"); ++/// ++/// let raw = format_ident!("r#Raw"); ++/// assert_eq!(raw, "r#Raw"); ++/// ++/// let my_ident_raw = format_ident!("{}Is{}", my_ident, raw); ++/// assert_eq!(my_ident_raw, "MyIdentIsRaw"); ++/// ``` ++/// ++/// Integer formatting options: ++/// ``` ++/// # use quote::format_ident; ++/// let num: u32 = 10; ++/// ++/// let decimal = format_ident!("Id_{}", num); ++/// assert_eq!(decimal, "Id_10"); ++/// ++/// let octal = format_ident!("Id_{:o}", num); ++/// assert_eq!(octal, "Id_12"); ++/// ++/// let binary = format_ident!("Id_{:b}", num); ++/// assert_eq!(binary, "Id_1010"); ++/// ++/// let lower_hex = format_ident!("Id_{:x}", num); ++/// assert_eq!(lower_hex, "Id_a"); ++/// ++/// let upper_hex = format_ident!("Id_{:X}", num); ++/// assert_eq!(upper_hex, "Id_A"); ++/// ``` ++#[macro_export] ++macro_rules! format_ident { ++ ($fmt:expr) => { ++ $crate::format_ident_impl!([ ++ $crate::__private::Option::None, ++ $fmt ++ ]) ++ }; ++ ++ ($fmt:expr, $($rest:tt)*) => { ++ $crate::format_ident_impl!([ ++ $crate::__private::Option::None, ++ $fmt ++ ] $($rest)*) ++ }; ++} ++ ++#[macro_export] ++#[doc(hidden)] ++macro_rules! format_ident_impl { ++ // Final state ++ ([$span:expr, $($fmt:tt)*]) => { ++ $crate::__private::mk_ident( ++ &$crate::__private::format!($($fmt)*), ++ $span, ++ ) ++ }; ++ ++ // Span argument ++ ([$old:expr, $($fmt:tt)*] span = $span:expr) => { ++ $crate::format_ident_impl!([$old, $($fmt)*] span = $span,) ++ }; ++ ([$old:expr, $($fmt:tt)*] span = $span:expr, $($rest:tt)*) => { ++ $crate::format_ident_impl!([ ++ $crate::__private::Option::Some::<$crate::__private::Span>($span), ++ $($fmt)* ++ ] $($rest)*) ++ }; ++ ++ // Named argument ++ ([$span:expr, $($fmt:tt)*] $name:ident = $arg:expr) => { ++ $crate::format_ident_impl!([$span, $($fmt)*] $name = $arg,) ++ }; ++ ([$span:expr, $($fmt:tt)*] $name:ident = $arg:expr, $($rest:tt)*) => { ++ match $crate::__private::IdentFragmentAdapter(&$arg) { ++ arg => $crate::format_ident_impl!([$span.or(arg.span()), $($fmt)*, $name = arg] $($rest)*), ++ } ++ }; ++ ++ // Positional argument ++ ([$span:expr, $($fmt:tt)*] $arg:expr) => { ++ $crate::format_ident_impl!([$span, $($fmt)*] $arg,) ++ }; ++ ([$span:expr, $($fmt:tt)*] $arg:expr, $($rest:tt)*) => { ++ match $crate::__private::IdentFragmentAdapter(&$arg) { ++ arg => $crate::format_ident_impl!([$span.or(arg.span()), $($fmt)*, arg] $($rest)*), ++ } ++ }; ++} +diff -Nru mesa-25.3.3/subprojects/quote-1.0.40/src/ident_fragment.rs mesa-25.3.3/subprojects/quote-1.0.40/src/ident_fragment.rs +--- mesa-25.3.3/subprojects/quote-1.0.40/src/ident_fragment.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/quote-1.0.40/src/ident_fragment.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,88 @@ ++use alloc::borrow::Cow; ++use core::fmt; ++use proc_macro2::{Ident, Span}; ++ ++/// Specialized formatting trait used by `format_ident!`. ++/// ++/// [`Ident`] arguments formatted using this trait will have their `r#` prefix ++/// stripped, if present. ++/// ++/// See [`format_ident!`] for more information. ++/// ++/// [`format_ident!`]: crate::format_ident ++pub trait IdentFragment { ++ /// Format this value as an identifier fragment. ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result; ++ ++ /// Span associated with this `IdentFragment`. ++ /// ++ /// If non-`None`, may be inherited by formatted identifiers. ++ fn span(&self) -> Option { ++ None ++ } ++} ++ ++impl IdentFragment for &T { ++ fn span(&self) -> Option { ++ ::span(*self) ++ } ++ ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ IdentFragment::fmt(*self, f) ++ } ++} ++ ++impl IdentFragment for &mut T { ++ fn span(&self) -> Option { ++ ::span(*self) ++ } ++ ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ IdentFragment::fmt(*self, f) ++ } ++} ++ ++impl IdentFragment for Ident { ++ fn span(&self) -> Option { ++ Some(self.span()) ++ } ++ ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ let id = self.to_string(); ++ if let Some(id) = id.strip_prefix("r#") { ++ fmt::Display::fmt(id, f) ++ } else { ++ fmt::Display::fmt(&id[..], f) ++ } ++ } ++} ++ ++impl IdentFragment for Cow<'_, T> ++where ++ T: IdentFragment + ToOwned + ?Sized, ++{ ++ fn span(&self) -> Option { ++ T::span(self) ++ } ++ ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ T::fmt(self, f) ++ } ++} ++ ++// Limited set of types which this is implemented for, as we want to avoid types ++// which will often include non-identifier characters in their `Display` impl. ++macro_rules! ident_fragment_display { ++ ($($T:ty),*) => { ++ $( ++ impl IdentFragment for $T { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ fmt::Display::fmt(self, f) ++ } ++ } ++ )* ++ }; ++} ++ ++ident_fragment_display!(bool, str, String, char); ++ident_fragment_display!(u8, u16, u32, u64, u128, usize); +diff -Nru mesa-25.3.3/subprojects/quote-1.0.40/src/lib.rs mesa-25.3.3/subprojects/quote-1.0.40/src/lib.rs +--- mesa-25.3.3/subprojects/quote-1.0.40/src/lib.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/quote-1.0.40/src/lib.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,1454 @@ ++//! [![github]](https://github.com/dtolnay/quote) [![crates-io]](https://crates.io/crates/quote) [![docs-rs]](https://docs.rs/quote) ++//! ++//! [github]: https://img.shields.io/badge/github-8da0cb?style=for-the-badge&labelColor=555555&logo=github ++//! [crates-io]: https://img.shields.io/badge/crates.io-fc8d62?style=for-the-badge&labelColor=555555&logo=rust ++//! [docs-rs]: https://img.shields.io/badge/docs.rs-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs ++//! ++//!
++//! ++//! This crate provides the [`quote!`] macro for turning Rust syntax tree data ++//! structures into tokens of source code. ++//! ++//! Procedural macros in Rust receive a stream of tokens as input, execute ++//! arbitrary Rust code to determine how to manipulate those tokens, and produce ++//! a stream of tokens to hand back to the compiler to compile into the caller's ++//! crate. Quasi-quoting is a solution to one piece of that — producing ++//! tokens to return to the compiler. ++//! ++//! The idea of quasi-quoting is that we write *code* that we treat as *data*. ++//! Within the `quote!` macro, we can write what looks like code to our text ++//! editor or IDE. We get all the benefits of the editor's brace matching, ++//! syntax highlighting, indentation, and maybe autocompletion. But rather than ++//! compiling that as code into the current crate, we can treat it as data, pass ++//! it around, mutate it, and eventually hand it back to the compiler as tokens ++//! to compile into the macro caller's crate. ++//! ++//! This crate is motivated by the procedural macro use case, but is a ++//! general-purpose Rust quasi-quoting library and is not specific to procedural ++//! macros. ++//! ++//! ```toml ++//! [dependencies] ++//! quote = "1.0" ++//! ``` ++//! ++//!
++//! ++//! # Example ++//! ++//! The following quasi-quoted block of code is something you might find in [a] ++//! procedural macro having to do with data structure serialization. The `#var` ++//! syntax performs interpolation of runtime variables into the quoted tokens. ++//! Check out the documentation of the [`quote!`] macro for more detail about ++//! the syntax. See also the [`quote_spanned!`] macro which is important for ++//! implementing hygienic procedural macros. ++//! ++//! [a]: https://serde.rs/ ++//! ++//! ``` ++//! # use quote::quote; ++//! # ++//! # let generics = ""; ++//! # let where_clause = ""; ++//! # let field_ty = ""; ++//! # let item_ty = ""; ++//! # let path = ""; ++//! # let value = ""; ++//! # ++//! let tokens = quote! { ++//! struct SerializeWith #generics #where_clause { ++//! value: &'a #field_ty, ++//! phantom: core::marker::PhantomData<#item_ty>, ++//! } ++//! ++//! impl #generics serde::Serialize for SerializeWith #generics #where_clause { ++//! fn serialize(&self, serializer: S) -> Result ++//! where ++//! S: serde::Serializer, ++//! { ++//! #path(self.value, serializer) ++//! } ++//! } ++//! ++//! SerializeWith { ++//! value: #value, ++//! phantom: core::marker::PhantomData::<#item_ty>, ++//! } ++//! }; ++//! ``` ++//! ++//!
++//! ++//! # Non-macro code generators ++//! ++//! When using `quote` in a build.rs or main.rs and writing the output out to a ++//! file, consider having the code generator pass the tokens through ++//! [prettyplease] before writing. This way if an error occurs in the generated ++//! code it is convenient for a human to read and debug. ++//! ++//! [prettyplease]: https://github.com/dtolnay/prettyplease ++ ++// Quote types in rustdoc of other crates get linked to here. ++#![doc(html_root_url = "https://docs.rs/quote/1.0.40")] ++#![allow( ++ clippy::doc_markdown, ++ clippy::elidable_lifetime_names, ++ clippy::missing_errors_doc, ++ clippy::missing_panics_doc, ++ clippy::module_name_repetitions, ++ clippy::needless_lifetimes, ++ // false positive https://github.com/rust-lang/rust-clippy/issues/6983 ++ clippy::wrong_self_convention, ++)] ++ ++extern crate alloc; ++ ++#[cfg(feature = "proc-macro")] ++extern crate proc_macro; ++ ++mod ext; ++mod format; ++mod ident_fragment; ++mod to_tokens; ++ ++// Not public API. ++#[doc(hidden)] ++#[path = "runtime.rs"] ++pub mod __private; ++ ++pub use crate::ext::TokenStreamExt; ++pub use crate::ident_fragment::IdentFragment; ++pub use crate::to_tokens::ToTokens; ++ ++// Not public API. ++#[doc(hidden)] ++pub mod spanned; ++ ++macro_rules! __quote { ++ ($quote:item) => { ++ /// The whole point. ++ /// ++ /// Performs variable interpolation against the input and produces it as ++ /// [`proc_macro2::TokenStream`]. ++ /// ++ /// Note: for returning tokens to the compiler in a procedural macro, use ++ /// `.into()` on the result to convert to [`proc_macro::TokenStream`]. ++ /// ++ ///
++ /// ++ /// # Interpolation ++ /// ++ /// Variable interpolation is done with `#var` (similar to `$var` in ++ /// `macro_rules!` macros). This grabs the `var` variable that is currently in ++ /// scope and inserts it in that location in the output tokens. Any type ++ /// implementing the [`ToTokens`] trait can be interpolated. This includes most ++ /// Rust primitive types as well as most of the syntax tree types from the [Syn] ++ /// crate. ++ /// ++ /// [Syn]: https://github.com/dtolnay/syn ++ /// ++ /// Repetition is done using `#(...)*` or `#(...),*` again similar to ++ /// `macro_rules!`. This iterates through the elements of any variable ++ /// interpolated within the repetition and inserts a copy of the repetition body ++ /// for each one. The variables in an interpolation may be a `Vec`, slice, ++ /// `BTreeSet`, or any `Iterator`. ++ /// ++ /// - `#(#var)*` — no separators ++ /// - `#(#var),*` — the character before the asterisk is used as a separator ++ /// - `#( struct #var; )*` — the repetition can contain other tokens ++ /// - `#( #k => println!("{}", #v), )*` — even multiple interpolations ++ /// ++ ///
++ /// ++ /// # Hygiene ++ /// ++ /// Any interpolated tokens preserve the `Span` information provided by their ++ /// `ToTokens` implementation. Tokens that originate within the `quote!` ++ /// invocation are spanned with [`Span::call_site()`]. ++ /// ++ /// [`Span::call_site()`]: proc_macro2::Span::call_site ++ /// ++ /// A different span can be provided through the [`quote_spanned!`] macro. ++ /// ++ ///
++ /// ++ /// # Return type ++ /// ++ /// The macro evaluates to an expression of type `proc_macro2::TokenStream`. ++ /// Meanwhile Rust procedural macros are expected to return the type ++ /// `proc_macro::TokenStream`. ++ /// ++ /// The difference between the two types is that `proc_macro` types are entirely ++ /// specific to procedural macros and cannot ever exist in code outside of a ++ /// procedural macro, while `proc_macro2` types may exist anywhere including ++ /// tests and non-macro code like main.rs and build.rs. This is why even the ++ /// procedural macro ecosystem is largely built around `proc_macro2`, because ++ /// that ensures the libraries are unit testable and accessible in non-macro ++ /// contexts. ++ /// ++ /// There is a [`From`]-conversion in both directions so returning the output of ++ /// `quote!` from a procedural macro usually looks like `tokens.into()` or ++ /// `proc_macro::TokenStream::from(tokens)`. ++ /// ++ ///
++ /// ++ /// # Examples ++ /// ++ /// ### Procedural macro ++ /// ++ /// The structure of a basic procedural macro is as follows. Refer to the [Syn] ++ /// crate for further useful guidance on using `quote!` as part of a procedural ++ /// macro. ++ /// ++ /// [Syn]: https://github.com/dtolnay/syn ++ /// ++ /// ``` ++ /// # #[cfg(any())] ++ /// extern crate proc_macro; ++ /// # extern crate proc_macro2; ++ /// ++ /// # #[cfg(any())] ++ /// use proc_macro::TokenStream; ++ /// # use proc_macro2::TokenStream; ++ /// use quote::quote; ++ /// ++ /// # const IGNORE_TOKENS: &'static str = stringify! { ++ /// #[proc_macro_derive(HeapSize)] ++ /// # }; ++ /// pub fn derive_heap_size(input: TokenStream) -> TokenStream { ++ /// // Parse the input and figure out what implementation to generate... ++ /// # const IGNORE_TOKENS: &'static str = stringify! { ++ /// let name = /* ... */; ++ /// let expr = /* ... */; ++ /// # }; ++ /// # ++ /// # let name = 0; ++ /// # let expr = 0; ++ /// ++ /// let expanded = quote! { ++ /// // The generated impl. ++ /// impl heapsize::HeapSize for #name { ++ /// fn heap_size_of_children(&self) -> usize { ++ /// #expr ++ /// } ++ /// } ++ /// }; ++ /// ++ /// // Hand the output tokens back to the compiler. ++ /// TokenStream::from(expanded) ++ /// } ++ /// ``` ++ /// ++ ///


++ /// ++ /// ### Combining quoted fragments ++ /// ++ /// Usually you don't end up constructing an entire final `TokenStream` in one ++ /// piece. Different parts may come from different helper functions. The tokens ++ /// produced by `quote!` themselves implement `ToTokens` and so can be ++ /// interpolated into later `quote!` invocations to build up a final result. ++ /// ++ /// ``` ++ /// # use quote::quote; ++ /// # ++ /// let type_definition = quote! {...}; ++ /// let methods = quote! {...}; ++ /// ++ /// let tokens = quote! { ++ /// #type_definition ++ /// #methods ++ /// }; ++ /// ``` ++ /// ++ ///


++ /// ++ /// ### Constructing identifiers ++ /// ++ /// Suppose we have an identifier `ident` which came from somewhere in a macro ++ /// input and we need to modify it in some way for the macro output. Let's ++ /// consider prepending the identifier with an underscore. ++ /// ++ /// Simply interpolating the identifier next to an underscore will not have the ++ /// behavior of concatenating them. The underscore and the identifier will ++ /// continue to be two separate tokens as if you had written `_ x`. ++ /// ++ /// ``` ++ /// # use proc_macro2::{self as syn, Span}; ++ /// # use quote::quote; ++ /// # ++ /// # let ident = syn::Ident::new("i", Span::call_site()); ++ /// # ++ /// // incorrect ++ /// quote! { ++ /// let mut _#ident = 0; ++ /// } ++ /// # ; ++ /// ``` ++ /// ++ /// The solution is to build a new identifier token with the correct value. As ++ /// this is such a common case, the [`format_ident!`] macro provides a ++ /// convenient utility for doing so correctly. ++ /// ++ /// ``` ++ /// # use proc_macro2::{Ident, Span}; ++ /// # use quote::{format_ident, quote}; ++ /// # ++ /// # let ident = Ident::new("i", Span::call_site()); ++ /// # ++ /// let varname = format_ident!("_{}", ident); ++ /// quote! { ++ /// let mut #varname = 0; ++ /// } ++ /// # ; ++ /// ``` ++ /// ++ /// Alternatively, the APIs provided by Syn and proc-macro2 can be used to ++ /// directly build the identifier. This is roughly equivalent to the above, but ++ /// will not handle `ident` being a raw identifier. ++ /// ++ /// ``` ++ /// # use proc_macro2::{self as syn, Span}; ++ /// # use quote::quote; ++ /// # ++ /// # let ident = syn::Ident::new("i", Span::call_site()); ++ /// # ++ /// let concatenated = format!("_{}", ident); ++ /// let varname = syn::Ident::new(&concatenated, ident.span()); ++ /// quote! { ++ /// let mut #varname = 0; ++ /// } ++ /// # ; ++ /// ``` ++ /// ++ ///


++ /// ++ /// ### Making method calls ++ /// ++ /// Let's say our macro requires some type specified in the macro input to have ++ /// a constructor called `new`. We have the type in a variable called ++ /// `field_type` of type `syn::Type` and want to invoke the constructor. ++ /// ++ /// ``` ++ /// # use quote::quote; ++ /// # ++ /// # let field_type = quote!(...); ++ /// # ++ /// // incorrect ++ /// quote! { ++ /// let value = #field_type::new(); ++ /// } ++ /// # ; ++ /// ``` ++ /// ++ /// This works only sometimes. If `field_type` is `String`, the expanded code ++ /// contains `String::new()` which is fine. But if `field_type` is something ++ /// like `Vec` then the expanded code is `Vec::new()` which is invalid ++ /// syntax. Ordinarily in handwritten Rust we would write `Vec::::new()` ++ /// but for macros often the following is more convenient. ++ /// ++ /// ``` ++ /// # use quote::quote; ++ /// # ++ /// # let field_type = quote!(...); ++ /// # ++ /// quote! { ++ /// let value = <#field_type>::new(); ++ /// } ++ /// # ; ++ /// ``` ++ /// ++ /// This expands to `>::new()` which behaves correctly. ++ /// ++ /// A similar pattern is appropriate for trait methods. ++ /// ++ /// ``` ++ /// # use quote::quote; ++ /// # ++ /// # let field_type = quote!(...); ++ /// # ++ /// quote! { ++ /// let value = <#field_type as core::default::Default>::default(); ++ /// } ++ /// # ; ++ /// ``` ++ /// ++ ///


++ /// ++ /// ### Interpolating text inside of doc comments ++ /// ++ /// Neither doc comments nor string literals get interpolation behavior in ++ /// quote: ++ /// ++ /// ```compile_fail ++ /// quote! { ++ /// /// try to interpolate: #ident ++ /// /// ++ /// /// ... ++ /// } ++ /// ``` ++ /// ++ /// ```compile_fail ++ /// quote! { ++ /// #[doc = "try to interpolate: #ident"] ++ /// } ++ /// ``` ++ /// ++ /// Instead the best way to build doc comments that involve variables is by ++ /// formatting the doc string literal outside of quote. ++ /// ++ /// ```rust ++ /// # use proc_macro2::{Ident, Span}; ++ /// # use quote::quote; ++ /// # ++ /// # const IGNORE: &str = stringify! { ++ /// let msg = format!(...); ++ /// # }; ++ /// # ++ /// # let ident = Ident::new("var", Span::call_site()); ++ /// # let msg = format!("try to interpolate: {}", ident); ++ /// quote! { ++ /// #[doc = #msg] ++ /// /// ++ /// /// ... ++ /// } ++ /// # ; ++ /// ``` ++ /// ++ ///


++ /// ++ /// ### Indexing into a tuple struct ++ /// ++ /// When interpolating indices of a tuple or tuple struct, we need them not to ++ /// appears suffixed as integer literals by interpolating them as [`syn::Index`] ++ /// instead. ++ /// ++ /// [`syn::Index`]: https://docs.rs/syn/2.0/syn/struct.Index.html ++ /// ++ /// ```compile_fail ++ /// let i = 0usize..self.fields.len(); ++ /// ++ /// // expands to 0 + self.0usize.heap_size() + self.1usize.heap_size() + ... ++ /// // which is not valid syntax ++ /// quote! { ++ /// 0 #( + self.#i.heap_size() )* ++ /// } ++ /// ``` ++ /// ++ /// ``` ++ /// # use proc_macro2::{Ident, TokenStream}; ++ /// # use quote::quote; ++ /// # ++ /// # mod syn { ++ /// # use proc_macro2::{Literal, TokenStream}; ++ /// # use quote::{ToTokens, TokenStreamExt}; ++ /// # ++ /// # pub struct Index(usize); ++ /// # ++ /// # impl From for Index { ++ /// # fn from(i: usize) -> Self { ++ /// # Index(i) ++ /// # } ++ /// # } ++ /// # ++ /// # impl ToTokens for Index { ++ /// # fn to_tokens(&self, tokens: &mut TokenStream) { ++ /// # tokens.append(Literal::usize_unsuffixed(self.0)); ++ /// # } ++ /// # } ++ /// # } ++ /// # ++ /// # struct Struct { ++ /// # fields: Vec, ++ /// # } ++ /// # ++ /// # impl Struct { ++ /// # fn example(&self) -> TokenStream { ++ /// let i = (0..self.fields.len()).map(syn::Index::from); ++ /// ++ /// // expands to 0 + self.0.heap_size() + self.1.heap_size() + ... ++ /// quote! { ++ /// 0 #( + self.#i.heap_size() )* ++ /// } ++ /// # } ++ /// # } ++ /// ``` ++ $quote ++ }; ++} ++ ++#[cfg(doc)] ++__quote![ ++ #[macro_export] ++ macro_rules! quote { ++ ($($tt:tt)*) => { ++ ... ++ }; ++ } ++]; ++ ++#[cfg(not(doc))] ++__quote![ ++ #[macro_export] ++ macro_rules! quote { ++ () => { ++ $crate::__private::TokenStream::new() ++ }; ++ ++ // Special case rule for a single tt, for performance. ++ ($tt:tt) => {{ ++ let mut _s = $crate::__private::TokenStream::new(); ++ $crate::quote_token!{$tt _s} ++ _s ++ }}; ++ ++ // Special case rules for two tts, for performance. ++ (# $var:ident) => {{ ++ let mut _s = $crate::__private::TokenStream::new(); ++ $crate::ToTokens::to_tokens(&$var, &mut _s); ++ _s ++ }}; ++ ($tt1:tt $tt2:tt) => {{ ++ let mut _s = $crate::__private::TokenStream::new(); ++ $crate::quote_token!{$tt1 _s} ++ $crate::quote_token!{$tt2 _s} ++ _s ++ }}; ++ ++ // Rule for any other number of tokens. ++ ($($tt:tt)*) => {{ ++ let mut _s = $crate::__private::TokenStream::new(); ++ $crate::quote_each_token!{_s $($tt)*} ++ _s ++ }}; ++ } ++]; ++ ++macro_rules! __quote_spanned { ++ ($quote_spanned:item) => { ++ /// Same as `quote!`, but applies a given span to all tokens originating within ++ /// the macro invocation. ++ /// ++ ///
++ /// ++ /// # Syntax ++ /// ++ /// A span expression of type [`Span`], followed by `=>`, followed by the tokens ++ /// to quote. The span expression should be brief — use a variable for ++ /// anything more than a few characters. There should be no space before the ++ /// `=>` token. ++ /// ++ /// [`Span`]: proc_macro2::Span ++ /// ++ /// ``` ++ /// # use proc_macro2::Span; ++ /// # use quote::quote_spanned; ++ /// # ++ /// # const IGNORE_TOKENS: &'static str = stringify! { ++ /// let span = /* ... */; ++ /// # }; ++ /// # let span = Span::call_site(); ++ /// # let init = 0; ++ /// ++ /// // On one line, use parentheses. ++ /// let tokens = quote_spanned!(span=> Box::into_raw(Box::new(#init))); ++ /// ++ /// // On multiple lines, place the span at the top and use braces. ++ /// let tokens = quote_spanned! {span=> ++ /// Box::into_raw(Box::new(#init)) ++ /// }; ++ /// ``` ++ /// ++ /// The lack of space before the `=>` should look jarring to Rust programmers ++ /// and this is intentional. The formatting is designed to be visibly ++ /// off-balance and draw the eye a particular way, due to the span expression ++ /// being evaluated in the context of the procedural macro and the remaining ++ /// tokens being evaluated in the generated code. ++ /// ++ ///
++ /// ++ /// # Hygiene ++ /// ++ /// Any interpolated tokens preserve the `Span` information provided by their ++ /// `ToTokens` implementation. Tokens that originate within the `quote_spanned!` ++ /// invocation are spanned with the given span argument. ++ /// ++ ///
++ /// ++ /// # Example ++ /// ++ /// The following procedural macro code uses `quote_spanned!` to assert that a ++ /// particular Rust type implements the [`Sync`] trait so that references can be ++ /// safely shared between threads. ++ /// ++ /// ``` ++ /// # use quote::{quote_spanned, TokenStreamExt, ToTokens}; ++ /// # use proc_macro2::{Span, TokenStream}; ++ /// # ++ /// # struct Type; ++ /// # ++ /// # impl Type { ++ /// # fn span(&self) -> Span { ++ /// # Span::call_site() ++ /// # } ++ /// # } ++ /// # ++ /// # impl ToTokens for Type { ++ /// # fn to_tokens(&self, _tokens: &mut TokenStream) {} ++ /// # } ++ /// # ++ /// # let ty = Type; ++ /// # let call_site = Span::call_site(); ++ /// # ++ /// let ty_span = ty.span(); ++ /// let assert_sync = quote_spanned! {ty_span=> ++ /// struct _AssertSync where #ty: Sync; ++ /// }; ++ /// ``` ++ /// ++ /// If the assertion fails, the user will see an error like the following. The ++ /// input span of their type is highlighted in the error. ++ /// ++ /// ```text ++ /// error[E0277]: the trait bound `*const (): std::marker::Sync` is not satisfied ++ /// --> src/main.rs:10:21 ++ /// | ++ /// 10 | static ref PTR: *const () = &(); ++ /// | ^^^^^^^^^ `*const ()` cannot be shared between threads safely ++ /// ``` ++ /// ++ /// In this example it is important for the where-clause to be spanned with the ++ /// line/column information of the user's input type so that error messages are ++ /// placed appropriately by the compiler. ++ $quote_spanned ++ }; ++} ++ ++#[cfg(doc)] ++__quote_spanned![ ++ #[macro_export] ++ macro_rules! quote_spanned { ++ ($span:expr=> $($tt:tt)*) => { ++ ... ++ }; ++ } ++]; ++ ++#[cfg(not(doc))] ++__quote_spanned![ ++ #[macro_export] ++ macro_rules! quote_spanned { ++ ($span:expr=>) => {{ ++ let _: $crate::__private::Span = $crate::__private::get_span($span).__into_span(); ++ $crate::__private::TokenStream::new() ++ }}; ++ ++ // Special case rule for a single tt, for performance. ++ ($span:expr=> $tt:tt) => {{ ++ let mut _s = $crate::__private::TokenStream::new(); ++ let _span: $crate::__private::Span = $crate::__private::get_span($span).__into_span(); ++ $crate::quote_token_spanned!{$tt _s _span} ++ _s ++ }}; ++ ++ // Special case rules for two tts, for performance. ++ ($span:expr=> # $var:ident) => {{ ++ let mut _s = $crate::__private::TokenStream::new(); ++ let _: $crate::__private::Span = $crate::__private::get_span($span).__into_span(); ++ $crate::ToTokens::to_tokens(&$var, &mut _s); ++ _s ++ }}; ++ ($span:expr=> $tt1:tt $tt2:tt) => {{ ++ let mut _s = $crate::__private::TokenStream::new(); ++ let _span: $crate::__private::Span = $crate::__private::get_span($span).__into_span(); ++ $crate::quote_token_spanned!{$tt1 _s _span} ++ $crate::quote_token_spanned!{$tt2 _s _span} ++ _s ++ }}; ++ ++ // Rule for any other number of tokens. ++ ($span:expr=> $($tt:tt)*) => {{ ++ let mut _s = $crate::__private::TokenStream::new(); ++ let _span: $crate::__private::Span = $crate::__private::get_span($span).__into_span(); ++ $crate::quote_each_token_spanned!{_s _span $($tt)*} ++ _s ++ }}; ++ } ++]; ++ ++// Extract the names of all #metavariables and pass them to the $call macro. ++// ++// in: pounded_var_names!(then!(...) a #b c #( #d )* #e) ++// out: then!(... b); ++// then!(... d); ++// then!(... e); ++#[macro_export] ++#[doc(hidden)] ++macro_rules! pounded_var_names { ++ ($call:ident! $extra:tt $($tts:tt)*) => { ++ $crate::pounded_var_names_with_context!{$call! $extra ++ (@ $($tts)*) ++ ($($tts)* @) ++ } ++ }; ++} ++ ++#[macro_export] ++#[doc(hidden)] ++macro_rules! pounded_var_names_with_context { ++ ($call:ident! $extra:tt ($($b1:tt)*) ($($curr:tt)*)) => { ++ $( ++ $crate::pounded_var_with_context!{$call! $extra $b1 $curr} ++ )* ++ }; ++} ++ ++#[macro_export] ++#[doc(hidden)] ++macro_rules! pounded_var_with_context { ++ ($call:ident! $extra:tt $b1:tt ( $($inner:tt)* )) => { ++ $crate::pounded_var_names!{$call! $extra $($inner)*} ++ }; ++ ++ ($call:ident! $extra:tt $b1:tt [ $($inner:tt)* ]) => { ++ $crate::pounded_var_names!{$call! $extra $($inner)*} ++ }; ++ ++ ($call:ident! $extra:tt $b1:tt { $($inner:tt)* }) => { ++ $crate::pounded_var_names!{$call! $extra $($inner)*} ++ }; ++ ++ ($call:ident!($($extra:tt)*) # $var:ident) => { ++ $crate::$call!($($extra)* $var); ++ }; ++ ++ ($call:ident! $extra:tt $b1:tt $curr:tt) => {}; ++} ++ ++#[macro_export] ++#[doc(hidden)] ++macro_rules! quote_bind_into_iter { ++ ($has_iter:ident $var:ident) => { ++ // `mut` may be unused if $var occurs multiple times in the list. ++ #[allow(unused_mut)] ++ let (mut $var, i) = $var.quote_into_iter(); ++ let $has_iter = $has_iter | i; ++ }; ++} ++ ++#[macro_export] ++#[doc(hidden)] ++macro_rules! quote_bind_next_or_break { ++ ($var:ident) => { ++ let $var = match $var.next() { ++ Some(_x) => $crate::__private::RepInterp(_x), ++ None => break, ++ }; ++ }; ++} ++ ++// The obvious way to write this macro is as a tt muncher. This implementation ++// does something more complex for two reasons. ++// ++// - With a tt muncher it's easy to hit Rust's built-in recursion_limit, which ++// this implementation avoids because it isn't tail recursive. ++// ++// - Compile times for a tt muncher are quadratic relative to the length of ++// the input. This implementation is linear, so it will be faster ++// (potentially much faster) for big inputs. However, the constant factors ++// of this implementation are higher than that of a tt muncher, so it is ++// somewhat slower than a tt muncher if there are many invocations with ++// short inputs. ++// ++// An invocation like this: ++// ++// quote_each_token!(_s a b c d e f g h i j); ++// ++// expands to this: ++// ++// quote_tokens_with_context!(_s ++// (@ @ @ @ @ @ a b c d e f g h i j) ++// (@ @ @ @ @ a b c d e f g h i j @) ++// (@ @ @ @ a b c d e f g h i j @ @) ++// (@ @ @ (a) (b) (c) (d) (e) (f) (g) (h) (i) (j) @ @ @) ++// (@ @ a b c d e f g h i j @ @ @ @) ++// (@ a b c d e f g h i j @ @ @ @ @) ++// (a b c d e f g h i j @ @ @ @ @ @) ++// ); ++// ++// which gets transposed and expanded to this: ++// ++// quote_token_with_context!(_s @ @ @ @ @ @ a); ++// quote_token_with_context!(_s @ @ @ @ @ a b); ++// quote_token_with_context!(_s @ @ @ @ a b c); ++// quote_token_with_context!(_s @ @ @ (a) b c d); ++// quote_token_with_context!(_s @ @ a (b) c d e); ++// quote_token_with_context!(_s @ a b (c) d e f); ++// quote_token_with_context!(_s a b c (d) e f g); ++// quote_token_with_context!(_s b c d (e) f g h); ++// quote_token_with_context!(_s c d e (f) g h i); ++// quote_token_with_context!(_s d e f (g) h i j); ++// quote_token_with_context!(_s e f g (h) i j @); ++// quote_token_with_context!(_s f g h (i) j @ @); ++// quote_token_with_context!(_s g h i (j) @ @ @); ++// quote_token_with_context!(_s h i j @ @ @ @); ++// quote_token_with_context!(_s i j @ @ @ @ @); ++// quote_token_with_context!(_s j @ @ @ @ @ @); ++// ++// Without having used muncher-style recursion, we get one invocation of ++// quote_token_with_context for each original tt, with three tts of context on ++// either side. This is enough for the longest possible interpolation form (a ++// repetition with separator, as in `# (#var) , *`) to be fully represented with ++// the first or last tt in the middle. ++// ++// The middle tt (surrounded by parentheses) is the tt being processed. ++// ++// - When it is a `#`, quote_token_with_context can do an interpolation. The ++// interpolation kind will depend on the three subsequent tts. ++// ++// - When it is within a later part of an interpolation, it can be ignored ++// because the interpolation has already been done. ++// ++// - When it is not part of an interpolation it can be pushed as a single ++// token into the output. ++// ++// - When the middle token is an unparenthesized `@`, that call is one of the ++// first 3 or last 3 calls of quote_token_with_context and does not ++// correspond to one of the original input tokens, so turns into nothing. ++#[macro_export] ++#[doc(hidden)] ++macro_rules! quote_each_token { ++ ($tokens:ident $($tts:tt)*) => { ++ $crate::quote_tokens_with_context!{$tokens ++ (@ @ @ @ @ @ $($tts)*) ++ (@ @ @ @ @ $($tts)* @) ++ (@ @ @ @ $($tts)* @ @) ++ (@ @ @ $(($tts))* @ @ @) ++ (@ @ $($tts)* @ @ @ @) ++ (@ $($tts)* @ @ @ @ @) ++ ($($tts)* @ @ @ @ @ @) ++ } ++ }; ++} ++ ++// See the explanation on quote_each_token. ++#[macro_export] ++#[doc(hidden)] ++macro_rules! quote_each_token_spanned { ++ ($tokens:ident $span:ident $($tts:tt)*) => { ++ $crate::quote_tokens_with_context_spanned!{$tokens $span ++ (@ @ @ @ @ @ $($tts)*) ++ (@ @ @ @ @ $($tts)* @) ++ (@ @ @ @ $($tts)* @ @) ++ (@ @ @ $(($tts))* @ @ @) ++ (@ @ $($tts)* @ @ @ @) ++ (@ $($tts)* @ @ @ @ @) ++ ($($tts)* @ @ @ @ @ @) ++ } ++ }; ++} ++ ++// See the explanation on quote_each_token. ++#[macro_export] ++#[doc(hidden)] ++macro_rules! quote_tokens_with_context { ++ ($tokens:ident ++ ($($b3:tt)*) ($($b2:tt)*) ($($b1:tt)*) ++ ($($curr:tt)*) ++ ($($a1:tt)*) ($($a2:tt)*) ($($a3:tt)*) ++ ) => { ++ $( ++ $crate::quote_token_with_context!{$tokens $b3 $b2 $b1 $curr $a1 $a2 $a3} ++ )* ++ }; ++} ++ ++// See the explanation on quote_each_token. ++#[macro_export] ++#[doc(hidden)] ++macro_rules! quote_tokens_with_context_spanned { ++ ($tokens:ident $span:ident ++ ($($b3:tt)*) ($($b2:tt)*) ($($b1:tt)*) ++ ($($curr:tt)*) ++ ($($a1:tt)*) ($($a2:tt)*) ($($a3:tt)*) ++ ) => { ++ $( ++ $crate::quote_token_with_context_spanned!{$tokens $span $b3 $b2 $b1 $curr $a1 $a2 $a3} ++ )* ++ }; ++} ++ ++// See the explanation on quote_each_token. ++#[macro_export] ++#[doc(hidden)] ++macro_rules! quote_token_with_context { ++ // Unparenthesized `@` indicates this call does not correspond to one of the ++ // original input tokens. Ignore it. ++ ($tokens:ident $b3:tt $b2:tt $b1:tt @ $a1:tt $a2:tt $a3:tt) => {}; ++ ++ // A repetition with no separator. ++ ($tokens:ident $b3:tt $b2:tt $b1:tt (#) ( $($inner:tt)* ) * $a3:tt) => {{ ++ use $crate::__private::ext::*; ++ let has_iter = $crate::__private::ThereIsNoIteratorInRepetition; ++ $crate::pounded_var_names!{quote_bind_into_iter!(has_iter) () $($inner)*} ++ let _: $crate::__private::HasIterator = has_iter; ++ // This is `while true` instead of `loop` because if there are no ++ // iterators used inside of this repetition then the body would not ++ // contain any `break`, so the compiler would emit unreachable code ++ // warnings on anything below the loop. We use has_iter to detect and ++ // fail to compile when there are no iterators, so here we just work ++ // around the unneeded extra warning. ++ while true { ++ $crate::pounded_var_names!{quote_bind_next_or_break!() () $($inner)*} ++ $crate::quote_each_token!{$tokens $($inner)*} ++ } ++ }}; ++ // ... and one step later. ++ ($tokens:ident $b3:tt $b2:tt # (( $($inner:tt)* )) * $a2:tt $a3:tt) => {}; ++ // ... and one step later. ++ ($tokens:ident $b3:tt # ( $($inner:tt)* ) (*) $a1:tt $a2:tt $a3:tt) => {}; ++ ++ // A repetition with separator. ++ ($tokens:ident $b3:tt $b2:tt $b1:tt (#) ( $($inner:tt)* ) $sep:tt *) => {{ ++ use $crate::__private::ext::*; ++ let mut _i = 0usize; ++ let has_iter = $crate::__private::ThereIsNoIteratorInRepetition; ++ $crate::pounded_var_names!{quote_bind_into_iter!(has_iter) () $($inner)*} ++ let _: $crate::__private::HasIterator = has_iter; ++ while true { ++ $crate::pounded_var_names!{quote_bind_next_or_break!() () $($inner)*} ++ if _i > 0 { ++ $crate::quote_token!{$sep $tokens} ++ } ++ _i += 1; ++ $crate::quote_each_token!{$tokens $($inner)*} ++ } ++ }}; ++ // ... and one step later. ++ ($tokens:ident $b3:tt $b2:tt # (( $($inner:tt)* )) $sep:tt * $a3:tt) => {}; ++ // ... and one step later. ++ ($tokens:ident $b3:tt # ( $($inner:tt)* ) ($sep:tt) * $a2:tt $a3:tt) => {}; ++ // (A special case for `#(var)**`, where the first `*` is treated as the ++ // repetition symbol and the second `*` is treated as an ordinary token.) ++ ($tokens:ident # ( $($inner:tt)* ) * (*) $a1:tt $a2:tt $a3:tt) => { ++ // https://github.com/dtolnay/quote/issues/130 ++ $crate::quote_token!{* $tokens} ++ }; ++ // ... and one step later. ++ ($tokens:ident # ( $($inner:tt)* ) $sep:tt (*) $a1:tt $a2:tt $a3:tt) => {}; ++ ++ // A non-repetition interpolation. ++ ($tokens:ident $b3:tt $b2:tt $b1:tt (#) $var:ident $a2:tt $a3:tt) => { ++ $crate::ToTokens::to_tokens(&$var, &mut $tokens); ++ }; ++ // ... and one step later. ++ ($tokens:ident $b3:tt $b2:tt # ($var:ident) $a1:tt $a2:tt $a3:tt) => {}; ++ ++ // An ordinary token, not part of any interpolation. ++ ($tokens:ident $b3:tt $b2:tt $b1:tt ($curr:tt) $a1:tt $a2:tt $a3:tt) => { ++ $crate::quote_token!{$curr $tokens} ++ }; ++} ++ ++// See the explanation on quote_each_token, and on the individual rules of ++// quote_token_with_context. ++#[macro_export] ++#[doc(hidden)] ++macro_rules! quote_token_with_context_spanned { ++ ($tokens:ident $span:ident $b3:tt $b2:tt $b1:tt @ $a1:tt $a2:tt $a3:tt) => {}; ++ ++ ($tokens:ident $span:ident $b3:tt $b2:tt $b1:tt (#) ( $($inner:tt)* ) * $a3:tt) => {{ ++ use $crate::__private::ext::*; ++ let has_iter = $crate::__private::ThereIsNoIteratorInRepetition; ++ $crate::pounded_var_names!{quote_bind_into_iter!(has_iter) () $($inner)*} ++ let _: $crate::__private::HasIterator = has_iter; ++ while true { ++ $crate::pounded_var_names!{quote_bind_next_or_break!() () $($inner)*} ++ $crate::quote_each_token_spanned!{$tokens $span $($inner)*} ++ } ++ }}; ++ ($tokens:ident $span:ident $b3:tt $b2:tt # (( $($inner:tt)* )) * $a2:tt $a3:tt) => {}; ++ ($tokens:ident $span:ident $b3:tt # ( $($inner:tt)* ) (*) $a1:tt $a2:tt $a3:tt) => {}; ++ ++ ($tokens:ident $span:ident $b3:tt $b2:tt $b1:tt (#) ( $($inner:tt)* ) $sep:tt *) => {{ ++ use $crate::__private::ext::*; ++ let mut _i = 0usize; ++ let has_iter = $crate::__private::ThereIsNoIteratorInRepetition; ++ $crate::pounded_var_names!{quote_bind_into_iter!(has_iter) () $($inner)*} ++ let _: $crate::__private::HasIterator = has_iter; ++ while true { ++ $crate::pounded_var_names!{quote_bind_next_or_break!() () $($inner)*} ++ if _i > 0 { ++ $crate::quote_token_spanned!{$sep $tokens $span} ++ } ++ _i += 1; ++ $crate::quote_each_token_spanned!{$tokens $span $($inner)*} ++ } ++ }}; ++ ($tokens:ident $span:ident $b3:tt $b2:tt # (( $($inner:tt)* )) $sep:tt * $a3:tt) => {}; ++ ($tokens:ident $span:ident $b3:tt # ( $($inner:tt)* ) ($sep:tt) * $a2:tt $a3:tt) => {}; ++ ($tokens:ident $span:ident # ( $($inner:tt)* ) * (*) $a1:tt $a2:tt $a3:tt) => { ++ // https://github.com/dtolnay/quote/issues/130 ++ $crate::quote_token_spanned!{* $tokens $span} ++ }; ++ ($tokens:ident $span:ident # ( $($inner:tt)* ) $sep:tt (*) $a1:tt $a2:tt $a3:tt) => {}; ++ ++ ($tokens:ident $span:ident $b3:tt $b2:tt $b1:tt (#) $var:ident $a2:tt $a3:tt) => { ++ $crate::ToTokens::to_tokens(&$var, &mut $tokens); ++ }; ++ ($tokens:ident $span:ident $b3:tt $b2:tt # ($var:ident) $a1:tt $a2:tt $a3:tt) => {}; ++ ++ ($tokens:ident $span:ident $b3:tt $b2:tt $b1:tt ($curr:tt) $a1:tt $a2:tt $a3:tt) => { ++ $crate::quote_token_spanned!{$curr $tokens $span} ++ }; ++} ++ ++// These rules are ordered by approximate token frequency, at least for the ++// first 10 or so, to improve compile times. Having `ident` first is by far the ++// most important because it's typically 2-3x more common than the next most ++// common token. ++// ++// Separately, we put the token being matched in the very front so that failing ++// rules may fail to match as quickly as possible. ++#[macro_export] ++#[doc(hidden)] ++macro_rules! quote_token { ++ ($ident:ident $tokens:ident) => { ++ $crate::__private::push_ident(&mut $tokens, stringify!($ident)); ++ }; ++ ++ (:: $tokens:ident) => { ++ $crate::__private::push_colon2(&mut $tokens); ++ }; ++ ++ (( $($inner:tt)* ) $tokens:ident) => { ++ $crate::__private::push_group( ++ &mut $tokens, ++ $crate::__private::Delimiter::Parenthesis, ++ $crate::quote!($($inner)*), ++ ); ++ }; ++ ++ ([ $($inner:tt)* ] $tokens:ident) => { ++ $crate::__private::push_group( ++ &mut $tokens, ++ $crate::__private::Delimiter::Bracket, ++ $crate::quote!($($inner)*), ++ ); ++ }; ++ ++ ({ $($inner:tt)* } $tokens:ident) => { ++ $crate::__private::push_group( ++ &mut $tokens, ++ $crate::__private::Delimiter::Brace, ++ $crate::quote!($($inner)*), ++ ); ++ }; ++ ++ (# $tokens:ident) => { ++ $crate::__private::push_pound(&mut $tokens); ++ }; ++ ++ (, $tokens:ident) => { ++ $crate::__private::push_comma(&mut $tokens); ++ }; ++ ++ (. $tokens:ident) => { ++ $crate::__private::push_dot(&mut $tokens); ++ }; ++ ++ (; $tokens:ident) => { ++ $crate::__private::push_semi(&mut $tokens); ++ }; ++ ++ (: $tokens:ident) => { ++ $crate::__private::push_colon(&mut $tokens); ++ }; ++ ++ (+ $tokens:ident) => { ++ $crate::__private::push_add(&mut $tokens); ++ }; ++ ++ (+= $tokens:ident) => { ++ $crate::__private::push_add_eq(&mut $tokens); ++ }; ++ ++ (& $tokens:ident) => { ++ $crate::__private::push_and(&mut $tokens); ++ }; ++ ++ (&& $tokens:ident) => { ++ $crate::__private::push_and_and(&mut $tokens); ++ }; ++ ++ (&= $tokens:ident) => { ++ $crate::__private::push_and_eq(&mut $tokens); ++ }; ++ ++ (@ $tokens:ident) => { ++ $crate::__private::push_at(&mut $tokens); ++ }; ++ ++ (! $tokens:ident) => { ++ $crate::__private::push_bang(&mut $tokens); ++ }; ++ ++ (^ $tokens:ident) => { ++ $crate::__private::push_caret(&mut $tokens); ++ }; ++ ++ (^= $tokens:ident) => { ++ $crate::__private::push_caret_eq(&mut $tokens); ++ }; ++ ++ (/ $tokens:ident) => { ++ $crate::__private::push_div(&mut $tokens); ++ }; ++ ++ (/= $tokens:ident) => { ++ $crate::__private::push_div_eq(&mut $tokens); ++ }; ++ ++ (.. $tokens:ident) => { ++ $crate::__private::push_dot2(&mut $tokens); ++ }; ++ ++ (... $tokens:ident) => { ++ $crate::__private::push_dot3(&mut $tokens); ++ }; ++ ++ (..= $tokens:ident) => { ++ $crate::__private::push_dot_dot_eq(&mut $tokens); ++ }; ++ ++ (= $tokens:ident) => { ++ $crate::__private::push_eq(&mut $tokens); ++ }; ++ ++ (== $tokens:ident) => { ++ $crate::__private::push_eq_eq(&mut $tokens); ++ }; ++ ++ (>= $tokens:ident) => { ++ $crate::__private::push_ge(&mut $tokens); ++ }; ++ ++ (> $tokens:ident) => { ++ $crate::__private::push_gt(&mut $tokens); ++ }; ++ ++ (<= $tokens:ident) => { ++ $crate::__private::push_le(&mut $tokens); ++ }; ++ ++ (< $tokens:ident) => { ++ $crate::__private::push_lt(&mut $tokens); ++ }; ++ ++ (*= $tokens:ident) => { ++ $crate::__private::push_mul_eq(&mut $tokens); ++ }; ++ ++ (!= $tokens:ident) => { ++ $crate::__private::push_ne(&mut $tokens); ++ }; ++ ++ (| $tokens:ident) => { ++ $crate::__private::push_or(&mut $tokens); ++ }; ++ ++ (|= $tokens:ident) => { ++ $crate::__private::push_or_eq(&mut $tokens); ++ }; ++ ++ (|| $tokens:ident) => { ++ $crate::__private::push_or_or(&mut $tokens); ++ }; ++ ++ (? $tokens:ident) => { ++ $crate::__private::push_question(&mut $tokens); ++ }; ++ ++ (-> $tokens:ident) => { ++ $crate::__private::push_rarrow(&mut $tokens); ++ }; ++ ++ (<- $tokens:ident) => { ++ $crate::__private::push_larrow(&mut $tokens); ++ }; ++ ++ (% $tokens:ident) => { ++ $crate::__private::push_rem(&mut $tokens); ++ }; ++ ++ (%= $tokens:ident) => { ++ $crate::__private::push_rem_eq(&mut $tokens); ++ }; ++ ++ (=> $tokens:ident) => { ++ $crate::__private::push_fat_arrow(&mut $tokens); ++ }; ++ ++ (<< $tokens:ident) => { ++ $crate::__private::push_shl(&mut $tokens); ++ }; ++ ++ (<<= $tokens:ident) => { ++ $crate::__private::push_shl_eq(&mut $tokens); ++ }; ++ ++ (>> $tokens:ident) => { ++ $crate::__private::push_shr(&mut $tokens); ++ }; ++ ++ (>>= $tokens:ident) => { ++ $crate::__private::push_shr_eq(&mut $tokens); ++ }; ++ ++ (* $tokens:ident) => { ++ $crate::__private::push_star(&mut $tokens); ++ }; ++ ++ (- $tokens:ident) => { ++ $crate::__private::push_sub(&mut $tokens); ++ }; ++ ++ (-= $tokens:ident) => { ++ $crate::__private::push_sub_eq(&mut $tokens); ++ }; ++ ++ ($lifetime:lifetime $tokens:ident) => { ++ $crate::__private::push_lifetime(&mut $tokens, stringify!($lifetime)); ++ }; ++ ++ (_ $tokens:ident) => { ++ $crate::__private::push_underscore(&mut $tokens); ++ }; ++ ++ ($other:tt $tokens:ident) => { ++ $crate::__private::parse(&mut $tokens, stringify!($other)); ++ }; ++} ++ ++// See the comment above `quote_token!` about the rule ordering. ++#[macro_export] ++#[doc(hidden)] ++macro_rules! quote_token_spanned { ++ ($ident:ident $tokens:ident $span:ident) => { ++ $crate::__private::push_ident_spanned(&mut $tokens, $span, stringify!($ident)); ++ }; ++ ++ (:: $tokens:ident $span:ident) => { ++ $crate::__private::push_colon2_spanned(&mut $tokens, $span); ++ }; ++ ++ (( $($inner:tt)* ) $tokens:ident $span:ident) => { ++ $crate::__private::push_group_spanned( ++ &mut $tokens, ++ $span, ++ $crate::__private::Delimiter::Parenthesis, ++ $crate::quote_spanned!($span=> $($inner)*), ++ ); ++ }; ++ ++ ([ $($inner:tt)* ] $tokens:ident $span:ident) => { ++ $crate::__private::push_group_spanned( ++ &mut $tokens, ++ $span, ++ $crate::__private::Delimiter::Bracket, ++ $crate::quote_spanned!($span=> $($inner)*), ++ ); ++ }; ++ ++ ({ $($inner:tt)* } $tokens:ident $span:ident) => { ++ $crate::__private::push_group_spanned( ++ &mut $tokens, ++ $span, ++ $crate::__private::Delimiter::Brace, ++ $crate::quote_spanned!($span=> $($inner)*), ++ ); ++ }; ++ ++ (# $tokens:ident $span:ident) => { ++ $crate::__private::push_pound_spanned(&mut $tokens, $span); ++ }; ++ ++ (, $tokens:ident $span:ident) => { ++ $crate::__private::push_comma_spanned(&mut $tokens, $span); ++ }; ++ ++ (. $tokens:ident $span:ident) => { ++ $crate::__private::push_dot_spanned(&mut $tokens, $span); ++ }; ++ ++ (; $tokens:ident $span:ident) => { ++ $crate::__private::push_semi_spanned(&mut $tokens, $span); ++ }; ++ ++ (: $tokens:ident $span:ident) => { ++ $crate::__private::push_colon_spanned(&mut $tokens, $span); ++ }; ++ ++ (+ $tokens:ident $span:ident) => { ++ $crate::__private::push_add_spanned(&mut $tokens, $span); ++ }; ++ ++ (+= $tokens:ident $span:ident) => { ++ $crate::__private::push_add_eq_spanned(&mut $tokens, $span); ++ }; ++ ++ (& $tokens:ident $span:ident) => { ++ $crate::__private::push_and_spanned(&mut $tokens, $span); ++ }; ++ ++ (&& $tokens:ident $span:ident) => { ++ $crate::__private::push_and_and_spanned(&mut $tokens, $span); ++ }; ++ ++ (&= $tokens:ident $span:ident) => { ++ $crate::__private::push_and_eq_spanned(&mut $tokens, $span); ++ }; ++ ++ (@ $tokens:ident $span:ident) => { ++ $crate::__private::push_at_spanned(&mut $tokens, $span); ++ }; ++ ++ (! $tokens:ident $span:ident) => { ++ $crate::__private::push_bang_spanned(&mut $tokens, $span); ++ }; ++ ++ (^ $tokens:ident $span:ident) => { ++ $crate::__private::push_caret_spanned(&mut $tokens, $span); ++ }; ++ ++ (^= $tokens:ident $span:ident) => { ++ $crate::__private::push_caret_eq_spanned(&mut $tokens, $span); ++ }; ++ ++ (/ $tokens:ident $span:ident) => { ++ $crate::__private::push_div_spanned(&mut $tokens, $span); ++ }; ++ ++ (/= $tokens:ident $span:ident) => { ++ $crate::__private::push_div_eq_spanned(&mut $tokens, $span); ++ }; ++ ++ (.. $tokens:ident $span:ident) => { ++ $crate::__private::push_dot2_spanned(&mut $tokens, $span); ++ }; ++ ++ (... $tokens:ident $span:ident) => { ++ $crate::__private::push_dot3_spanned(&mut $tokens, $span); ++ }; ++ ++ (..= $tokens:ident $span:ident) => { ++ $crate::__private::push_dot_dot_eq_spanned(&mut $tokens, $span); ++ }; ++ ++ (= $tokens:ident $span:ident) => { ++ $crate::__private::push_eq_spanned(&mut $tokens, $span); ++ }; ++ ++ (== $tokens:ident $span:ident) => { ++ $crate::__private::push_eq_eq_spanned(&mut $tokens, $span); ++ }; ++ ++ (>= $tokens:ident $span:ident) => { ++ $crate::__private::push_ge_spanned(&mut $tokens, $span); ++ }; ++ ++ (> $tokens:ident $span:ident) => { ++ $crate::__private::push_gt_spanned(&mut $tokens, $span); ++ }; ++ ++ (<= $tokens:ident $span:ident) => { ++ $crate::__private::push_le_spanned(&mut $tokens, $span); ++ }; ++ ++ (< $tokens:ident $span:ident) => { ++ $crate::__private::push_lt_spanned(&mut $tokens, $span); ++ }; ++ ++ (*= $tokens:ident $span:ident) => { ++ $crate::__private::push_mul_eq_spanned(&mut $tokens, $span); ++ }; ++ ++ (!= $tokens:ident $span:ident) => { ++ $crate::__private::push_ne_spanned(&mut $tokens, $span); ++ }; ++ ++ (| $tokens:ident $span:ident) => { ++ $crate::__private::push_or_spanned(&mut $tokens, $span); ++ }; ++ ++ (|= $tokens:ident $span:ident) => { ++ $crate::__private::push_or_eq_spanned(&mut $tokens, $span); ++ }; ++ ++ (|| $tokens:ident $span:ident) => { ++ $crate::__private::push_or_or_spanned(&mut $tokens, $span); ++ }; ++ ++ (? $tokens:ident $span:ident) => { ++ $crate::__private::push_question_spanned(&mut $tokens, $span); ++ }; ++ ++ (-> $tokens:ident $span:ident) => { ++ $crate::__private::push_rarrow_spanned(&mut $tokens, $span); ++ }; ++ ++ (<- $tokens:ident $span:ident) => { ++ $crate::__private::push_larrow_spanned(&mut $tokens, $span); ++ }; ++ ++ (% $tokens:ident $span:ident) => { ++ $crate::__private::push_rem_spanned(&mut $tokens, $span); ++ }; ++ ++ (%= $tokens:ident $span:ident) => { ++ $crate::__private::push_rem_eq_spanned(&mut $tokens, $span); ++ }; ++ ++ (=> $tokens:ident $span:ident) => { ++ $crate::__private::push_fat_arrow_spanned(&mut $tokens, $span); ++ }; ++ ++ (<< $tokens:ident $span:ident) => { ++ $crate::__private::push_shl_spanned(&mut $tokens, $span); ++ }; ++ ++ (<<= $tokens:ident $span:ident) => { ++ $crate::__private::push_shl_eq_spanned(&mut $tokens, $span); ++ }; ++ ++ (>> $tokens:ident $span:ident) => { ++ $crate::__private::push_shr_spanned(&mut $tokens, $span); ++ }; ++ ++ (>>= $tokens:ident $span:ident) => { ++ $crate::__private::push_shr_eq_spanned(&mut $tokens, $span); ++ }; ++ ++ (* $tokens:ident $span:ident) => { ++ $crate::__private::push_star_spanned(&mut $tokens, $span); ++ }; ++ ++ (- $tokens:ident $span:ident) => { ++ $crate::__private::push_sub_spanned(&mut $tokens, $span); ++ }; ++ ++ (-= $tokens:ident $span:ident) => { ++ $crate::__private::push_sub_eq_spanned(&mut $tokens, $span); ++ }; ++ ++ ($lifetime:lifetime $tokens:ident $span:ident) => { ++ $crate::__private::push_lifetime_spanned(&mut $tokens, $span, stringify!($lifetime)); ++ }; ++ ++ (_ $tokens:ident $span:ident) => { ++ $crate::__private::push_underscore_spanned(&mut $tokens, $span); ++ }; ++ ++ ($other:tt $tokens:ident $span:ident) => { ++ $crate::__private::parse_spanned(&mut $tokens, $span, stringify!($other)); ++ }; ++} +diff -Nru mesa-25.3.3/subprojects/quote-1.0.40/src/runtime.rs mesa-25.3.3/subprojects/quote-1.0.40/src/runtime.rs +--- mesa-25.3.3/subprojects/quote-1.0.40/src/runtime.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/quote-1.0.40/src/runtime.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,492 @@ ++use self::get_span::{GetSpan, GetSpanBase, GetSpanInner}; ++use crate::{IdentFragment, ToTokens, TokenStreamExt}; ++use core::fmt; ++use core::iter; ++use core::ops::BitOr; ++use proc_macro2::{Group, Ident, Punct, Spacing, TokenTree}; ++ ++#[doc(hidden)] ++pub use alloc::format; ++#[doc(hidden)] ++pub use core::option::Option; ++ ++#[doc(hidden)] ++pub type Delimiter = proc_macro2::Delimiter; ++#[doc(hidden)] ++pub type Span = proc_macro2::Span; ++#[doc(hidden)] ++pub type TokenStream = proc_macro2::TokenStream; ++ ++#[doc(hidden)] ++pub struct HasIterator; // True ++#[doc(hidden)] ++pub struct ThereIsNoIteratorInRepetition; // False ++ ++impl BitOr for ThereIsNoIteratorInRepetition { ++ type Output = ThereIsNoIteratorInRepetition; ++ fn bitor(self, _rhs: ThereIsNoIteratorInRepetition) -> ThereIsNoIteratorInRepetition { ++ ThereIsNoIteratorInRepetition ++ } ++} ++ ++impl BitOr for HasIterator { ++ type Output = HasIterator; ++ fn bitor(self, _rhs: ThereIsNoIteratorInRepetition) -> HasIterator { ++ HasIterator ++ } ++} ++ ++impl BitOr for ThereIsNoIteratorInRepetition { ++ type Output = HasIterator; ++ fn bitor(self, _rhs: HasIterator) -> HasIterator { ++ HasIterator ++ } ++} ++ ++impl BitOr for HasIterator { ++ type Output = HasIterator; ++ fn bitor(self, _rhs: HasIterator) -> HasIterator { ++ HasIterator ++ } ++} ++ ++/// Extension traits used by the implementation of `quote!`. These are defined ++/// in separate traits, rather than as a single trait due to ambiguity issues. ++/// ++/// These traits expose a `quote_into_iter` method which should allow calling ++/// whichever impl happens to be applicable. Calling that method repeatedly on ++/// the returned value should be idempotent. ++#[doc(hidden)] ++pub mod ext { ++ use super::RepInterp; ++ use super::{HasIterator as HasIter, ThereIsNoIteratorInRepetition as DoesNotHaveIter}; ++ use crate::ToTokens; ++ use alloc::collections::btree_set::{self, BTreeSet}; ++ use core::slice; ++ ++ /// Extension trait providing the `quote_into_iter` method on iterators. ++ #[doc(hidden)] ++ pub trait RepIteratorExt: Iterator + Sized { ++ fn quote_into_iter(self) -> (Self, HasIter) { ++ (self, HasIter) ++ } ++ } ++ ++ impl RepIteratorExt for T {} ++ ++ /// Extension trait providing the `quote_into_iter` method for ++ /// non-iterable types. These types interpolate the same value in each ++ /// iteration of the repetition. ++ #[doc(hidden)] ++ pub trait RepToTokensExt { ++ /// Pretend to be an iterator for the purposes of `quote_into_iter`. ++ /// This allows repeated calls to `quote_into_iter` to continue ++ /// correctly returning DoesNotHaveIter. ++ fn next(&self) -> Option<&Self> { ++ Some(self) ++ } ++ ++ fn quote_into_iter(&self) -> (&Self, DoesNotHaveIter) { ++ (self, DoesNotHaveIter) ++ } ++ } ++ ++ impl RepToTokensExt for T {} ++ ++ /// Extension trait providing the `quote_into_iter` method for types that ++ /// can be referenced as an iterator. ++ #[doc(hidden)] ++ pub trait RepAsIteratorExt<'q> { ++ type Iter: Iterator; ++ ++ fn quote_into_iter(&'q self) -> (Self::Iter, HasIter); ++ } ++ ++ impl<'q, T: RepAsIteratorExt<'q> + ?Sized> RepAsIteratorExt<'q> for &T { ++ type Iter = T::Iter; ++ ++ fn quote_into_iter(&'q self) -> (Self::Iter, HasIter) { ++ ::quote_into_iter(*self) ++ } ++ } ++ ++ impl<'q, T: RepAsIteratorExt<'q> + ?Sized> RepAsIteratorExt<'q> for &mut T { ++ type Iter = T::Iter; ++ ++ fn quote_into_iter(&'q self) -> (Self::Iter, HasIter) { ++ ::quote_into_iter(*self) ++ } ++ } ++ ++ impl<'q, T: 'q> RepAsIteratorExt<'q> for [T] { ++ type Iter = slice::Iter<'q, T>; ++ ++ fn quote_into_iter(&'q self) -> (Self::Iter, HasIter) { ++ (self.iter(), HasIter) ++ } ++ } ++ ++ impl<'q, T: 'q, const N: usize> RepAsIteratorExt<'q> for [T; N] { ++ type Iter = slice::Iter<'q, T>; ++ ++ fn quote_into_iter(&'q self) -> (Self::Iter, HasIter) { ++ (self.iter(), HasIter) ++ } ++ } ++ ++ impl<'q, T: 'q> RepAsIteratorExt<'q> for Vec { ++ type Iter = slice::Iter<'q, T>; ++ ++ fn quote_into_iter(&'q self) -> (Self::Iter, HasIter) { ++ (self.iter(), HasIter) ++ } ++ } ++ ++ impl<'q, T: 'q> RepAsIteratorExt<'q> for BTreeSet { ++ type Iter = btree_set::Iter<'q, T>; ++ ++ fn quote_into_iter(&'q self) -> (Self::Iter, HasIter) { ++ (self.iter(), HasIter) ++ } ++ } ++ ++ impl<'q, T: RepAsIteratorExt<'q>> RepAsIteratorExt<'q> for RepInterp { ++ type Iter = T::Iter; ++ ++ fn quote_into_iter(&'q self) -> (Self::Iter, HasIter) { ++ self.0.quote_into_iter() ++ } ++ } ++} ++ ++// Helper type used within interpolations to allow for repeated binding names. ++// Implements the relevant traits, and exports a dummy `next()` method. ++#[derive(Copy, Clone)] ++#[doc(hidden)] ++pub struct RepInterp(pub T); ++ ++impl RepInterp { ++ // This method is intended to look like `Iterator::next`, and is called when ++ // a name is bound multiple times, as the previous binding will shadow the ++ // original `Iterator` object. This allows us to avoid advancing the ++ // iterator multiple times per iteration. ++ pub fn next(self) -> Option { ++ Some(self.0) ++ } ++} ++ ++impl Iterator for RepInterp { ++ type Item = T::Item; ++ ++ fn next(&mut self) -> Option { ++ self.0.next() ++ } ++} ++ ++impl ToTokens for RepInterp { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ self.0.to_tokens(tokens); ++ } ++} ++ ++#[doc(hidden)] ++#[inline] ++pub fn get_span(span: T) -> GetSpan { ++ GetSpan(GetSpanInner(GetSpanBase(span))) ++} ++ ++mod get_span { ++ use core::ops::Deref; ++ use proc_macro2::extra::DelimSpan; ++ use proc_macro2::Span; ++ ++ pub struct GetSpan(pub(crate) GetSpanInner); ++ ++ pub struct GetSpanInner(pub(crate) GetSpanBase); ++ ++ pub struct GetSpanBase(pub(crate) T); ++ ++ impl GetSpan { ++ #[inline] ++ pub fn __into_span(self) -> Span { ++ ((self.0).0).0 ++ } ++ } ++ ++ impl GetSpanInner { ++ #[inline] ++ pub fn __into_span(&self) -> Span { ++ (self.0).0.join() ++ } ++ } ++ ++ impl GetSpanBase { ++ #[allow(clippy::unused_self)] ++ pub fn __into_span(&self) -> T { ++ unreachable!() ++ } ++ } ++ ++ impl Deref for GetSpan { ++ type Target = GetSpanInner; ++ ++ #[inline] ++ fn deref(&self) -> &Self::Target { ++ &self.0 ++ } ++ } ++ ++ impl Deref for GetSpanInner { ++ type Target = GetSpanBase; ++ ++ #[inline] ++ fn deref(&self) -> &Self::Target { ++ &self.0 ++ } ++ } ++} ++ ++#[doc(hidden)] ++pub fn push_group(tokens: &mut TokenStream, delimiter: Delimiter, inner: TokenStream) { ++ tokens.append(Group::new(delimiter, inner)); ++} ++ ++#[doc(hidden)] ++pub fn push_group_spanned( ++ tokens: &mut TokenStream, ++ span: Span, ++ delimiter: Delimiter, ++ inner: TokenStream, ++) { ++ let mut g = Group::new(delimiter, inner); ++ g.set_span(span); ++ tokens.append(g); ++} ++ ++#[doc(hidden)] ++pub fn parse(tokens: &mut TokenStream, s: &str) { ++ let s: TokenStream = s.parse().expect("invalid token stream"); ++ tokens.extend(iter::once(s)); ++} ++ ++#[doc(hidden)] ++pub fn parse_spanned(tokens: &mut TokenStream, span: Span, s: &str) { ++ let s: TokenStream = s.parse().expect("invalid token stream"); ++ tokens.extend(s.into_iter().map(|t| respan_token_tree(t, span))); ++} ++ ++// Token tree with every span replaced by the given one. ++fn respan_token_tree(mut token: TokenTree, span: Span) -> TokenTree { ++ match &mut token { ++ TokenTree::Group(g) => { ++ let stream = g ++ .stream() ++ .into_iter() ++ .map(|token| respan_token_tree(token, span)) ++ .collect(); ++ *g = Group::new(g.delimiter(), stream); ++ g.set_span(span); ++ } ++ other => other.set_span(span), ++ } ++ token ++} ++ ++#[doc(hidden)] ++pub fn push_ident(tokens: &mut TokenStream, s: &str) { ++ let span = Span::call_site(); ++ push_ident_spanned(tokens, span, s); ++} ++ ++#[doc(hidden)] ++pub fn push_ident_spanned(tokens: &mut TokenStream, span: Span, s: &str) { ++ tokens.append(ident_maybe_raw(s, span)); ++} ++ ++#[doc(hidden)] ++pub fn push_lifetime(tokens: &mut TokenStream, lifetime: &str) { ++ tokens.extend([ ++ TokenTree::Punct(Punct::new('\'', Spacing::Joint)), ++ TokenTree::Ident(Ident::new(&lifetime[1..], Span::call_site())), ++ ]); ++} ++ ++#[doc(hidden)] ++pub fn push_lifetime_spanned(tokens: &mut TokenStream, span: Span, lifetime: &str) { ++ tokens.extend([ ++ TokenTree::Punct({ ++ let mut apostrophe = Punct::new('\'', Spacing::Joint); ++ apostrophe.set_span(span); ++ apostrophe ++ }), ++ TokenTree::Ident(Ident::new(&lifetime[1..], span)), ++ ]); ++} ++ ++macro_rules! push_punct { ++ ($name:ident $spanned:ident $char1:tt) => { ++ #[doc(hidden)] ++ pub fn $name(tokens: &mut TokenStream) { ++ tokens.append(Punct::new($char1, Spacing::Alone)); ++ } ++ #[doc(hidden)] ++ pub fn $spanned(tokens: &mut TokenStream, span: Span) { ++ let mut punct = Punct::new($char1, Spacing::Alone); ++ punct.set_span(span); ++ tokens.append(punct); ++ } ++ }; ++ ($name:ident $spanned:ident $char1:tt $char2:tt) => { ++ #[doc(hidden)] ++ pub fn $name(tokens: &mut TokenStream) { ++ tokens.append(Punct::new($char1, Spacing::Joint)); ++ tokens.append(Punct::new($char2, Spacing::Alone)); ++ } ++ #[doc(hidden)] ++ pub fn $spanned(tokens: &mut TokenStream, span: Span) { ++ let mut punct = Punct::new($char1, Spacing::Joint); ++ punct.set_span(span); ++ tokens.append(punct); ++ let mut punct = Punct::new($char2, Spacing::Alone); ++ punct.set_span(span); ++ tokens.append(punct); ++ } ++ }; ++ ($name:ident $spanned:ident $char1:tt $char2:tt $char3:tt) => { ++ #[doc(hidden)] ++ pub fn $name(tokens: &mut TokenStream) { ++ tokens.append(Punct::new($char1, Spacing::Joint)); ++ tokens.append(Punct::new($char2, Spacing::Joint)); ++ tokens.append(Punct::new($char3, Spacing::Alone)); ++ } ++ #[doc(hidden)] ++ pub fn $spanned(tokens: &mut TokenStream, span: Span) { ++ let mut punct = Punct::new($char1, Spacing::Joint); ++ punct.set_span(span); ++ tokens.append(punct); ++ let mut punct = Punct::new($char2, Spacing::Joint); ++ punct.set_span(span); ++ tokens.append(punct); ++ let mut punct = Punct::new($char3, Spacing::Alone); ++ punct.set_span(span); ++ tokens.append(punct); ++ } ++ }; ++} ++ ++push_punct!(push_add push_add_spanned '+'); ++push_punct!(push_add_eq push_add_eq_spanned '+' '='); ++push_punct!(push_and push_and_spanned '&'); ++push_punct!(push_and_and push_and_and_spanned '&' '&'); ++push_punct!(push_and_eq push_and_eq_spanned '&' '='); ++push_punct!(push_at push_at_spanned '@'); ++push_punct!(push_bang push_bang_spanned '!'); ++push_punct!(push_caret push_caret_spanned '^'); ++push_punct!(push_caret_eq push_caret_eq_spanned '^' '='); ++push_punct!(push_colon push_colon_spanned ':'); ++push_punct!(push_colon2 push_colon2_spanned ':' ':'); ++push_punct!(push_comma push_comma_spanned ','); ++push_punct!(push_div push_div_spanned '/'); ++push_punct!(push_div_eq push_div_eq_spanned '/' '='); ++push_punct!(push_dot push_dot_spanned '.'); ++push_punct!(push_dot2 push_dot2_spanned '.' '.'); ++push_punct!(push_dot3 push_dot3_spanned '.' '.' '.'); ++push_punct!(push_dot_dot_eq push_dot_dot_eq_spanned '.' '.' '='); ++push_punct!(push_eq push_eq_spanned '='); ++push_punct!(push_eq_eq push_eq_eq_spanned '=' '='); ++push_punct!(push_ge push_ge_spanned '>' '='); ++push_punct!(push_gt push_gt_spanned '>'); ++push_punct!(push_le push_le_spanned '<' '='); ++push_punct!(push_lt push_lt_spanned '<'); ++push_punct!(push_mul_eq push_mul_eq_spanned '*' '='); ++push_punct!(push_ne push_ne_spanned '!' '='); ++push_punct!(push_or push_or_spanned '|'); ++push_punct!(push_or_eq push_or_eq_spanned '|' '='); ++push_punct!(push_or_or push_or_or_spanned '|' '|'); ++push_punct!(push_pound push_pound_spanned '#'); ++push_punct!(push_question push_question_spanned '?'); ++push_punct!(push_rarrow push_rarrow_spanned '-' '>'); ++push_punct!(push_larrow push_larrow_spanned '<' '-'); ++push_punct!(push_rem push_rem_spanned '%'); ++push_punct!(push_rem_eq push_rem_eq_spanned '%' '='); ++push_punct!(push_fat_arrow push_fat_arrow_spanned '=' '>'); ++push_punct!(push_semi push_semi_spanned ';'); ++push_punct!(push_shl push_shl_spanned '<' '<'); ++push_punct!(push_shl_eq push_shl_eq_spanned '<' '<' '='); ++push_punct!(push_shr push_shr_spanned '>' '>'); ++push_punct!(push_shr_eq push_shr_eq_spanned '>' '>' '='); ++push_punct!(push_star push_star_spanned '*'); ++push_punct!(push_sub push_sub_spanned '-'); ++push_punct!(push_sub_eq push_sub_eq_spanned '-' '='); ++ ++#[doc(hidden)] ++pub fn push_underscore(tokens: &mut TokenStream) { ++ push_underscore_spanned(tokens, Span::call_site()); ++} ++ ++#[doc(hidden)] ++pub fn push_underscore_spanned(tokens: &mut TokenStream, span: Span) { ++ tokens.append(Ident::new("_", span)); ++} ++ ++// Helper method for constructing identifiers from the `format_ident!` macro, ++// handling `r#` prefixes. ++#[doc(hidden)] ++pub fn mk_ident(id: &str, span: Option) -> Ident { ++ let span = span.unwrap_or_else(Span::call_site); ++ ident_maybe_raw(id, span) ++} ++ ++fn ident_maybe_raw(id: &str, span: Span) -> Ident { ++ if let Some(id) = id.strip_prefix("r#") { ++ Ident::new_raw(id, span) ++ } else { ++ Ident::new(id, span) ++ } ++} ++ ++// Adapts from `IdentFragment` to `fmt::Display` for use by the `format_ident!` ++// macro, and exposes span information from these fragments. ++// ++// This struct also has forwarding implementations of the formatting traits ++// `Octal`, `LowerHex`, `UpperHex`, and `Binary` to allow for their use within ++// `format_ident!`. ++#[derive(Copy, Clone)] ++#[doc(hidden)] ++pub struct IdentFragmentAdapter(pub T); ++ ++impl IdentFragmentAdapter { ++ pub fn span(&self) -> Option { ++ self.0.span() ++ } ++} ++ ++impl fmt::Display for IdentFragmentAdapter { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ IdentFragment::fmt(&self.0, f) ++ } ++} ++ ++impl fmt::Octal for IdentFragmentAdapter { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ fmt::Octal::fmt(&self.0, f) ++ } ++} ++ ++impl fmt::LowerHex for IdentFragmentAdapter { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ fmt::LowerHex::fmt(&self.0, f) ++ } ++} ++ ++impl fmt::UpperHex for IdentFragmentAdapter { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ fmt::UpperHex::fmt(&self.0, f) ++ } ++} ++ ++impl fmt::Binary for IdentFragmentAdapter { ++ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { ++ fmt::Binary::fmt(&self.0, f) ++ } ++} +diff -Nru mesa-25.3.3/subprojects/quote-1.0.40/src/spanned.rs mesa-25.3.3/subprojects/quote-1.0.40/src/spanned.rs +--- mesa-25.3.3/subprojects/quote-1.0.40/src/spanned.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/quote-1.0.40/src/spanned.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,50 @@ ++use crate::ToTokens; ++use proc_macro2::extra::DelimSpan; ++use proc_macro2::{Span, TokenStream}; ++ ++// Not public API other than via the syn crate. Use syn::spanned::Spanned. ++pub trait Spanned: private::Sealed { ++ fn __span(&self) -> Span; ++} ++ ++impl Spanned for Span { ++ fn __span(&self) -> Span { ++ *self ++ } ++} ++ ++impl Spanned for DelimSpan { ++ fn __span(&self) -> Span { ++ self.join() ++ } ++} ++ ++impl Spanned for T { ++ fn __span(&self) -> Span { ++ join_spans(self.into_token_stream()) ++ } ++} ++ ++fn join_spans(tokens: TokenStream) -> Span { ++ let mut iter = tokens.into_iter().map(|tt| tt.span()); ++ ++ let first = match iter.next() { ++ Some(span) => span, ++ None => return Span::call_site(), ++ }; ++ ++ iter.fold(None, |_prev, next| Some(next)) ++ .and_then(|last| first.join(last)) ++ .unwrap_or(first) ++} ++ ++mod private { ++ use crate::ToTokens; ++ use proc_macro2::extra::DelimSpan; ++ use proc_macro2::Span; ++ ++ pub trait Sealed {} ++ impl Sealed for Span {} ++ impl Sealed for DelimSpan {} ++ impl Sealed for T {} ++} +diff -Nru mesa-25.3.3/subprojects/quote-1.0.40/src/to_tokens.rs mesa-25.3.3/subprojects/quote-1.0.40/src/to_tokens.rs +--- mesa-25.3.3/subprojects/quote-1.0.40/src/to_tokens.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/quote-1.0.40/src/to_tokens.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,271 @@ ++use super::TokenStreamExt; ++use alloc::borrow::Cow; ++use alloc::rc::Rc; ++use core::iter; ++use proc_macro2::{Group, Ident, Literal, Punct, Span, TokenStream, TokenTree}; ++use std::ffi::{CStr, CString}; ++ ++/// Types that can be interpolated inside a `quote!` invocation. ++pub trait ToTokens { ++ /// Write `self` to the given `TokenStream`. ++ /// ++ /// The token append methods provided by the [`TokenStreamExt`] extension ++ /// trait may be useful for implementing `ToTokens`. ++ /// ++ /// # Example ++ /// ++ /// Example implementation for a struct representing Rust paths like ++ /// `std::cmp::PartialEq`: ++ /// ++ /// ``` ++ /// use proc_macro2::{TokenTree, Spacing, Span, Punct, TokenStream}; ++ /// use quote::{TokenStreamExt, ToTokens}; ++ /// ++ /// pub struct Path { ++ /// pub global: bool, ++ /// pub segments: Vec, ++ /// } ++ /// ++ /// impl ToTokens for Path { ++ /// fn to_tokens(&self, tokens: &mut TokenStream) { ++ /// for (i, segment) in self.segments.iter().enumerate() { ++ /// if i > 0 || self.global { ++ /// // Double colon `::` ++ /// tokens.append(Punct::new(':', Spacing::Joint)); ++ /// tokens.append(Punct::new(':', Spacing::Alone)); ++ /// } ++ /// segment.to_tokens(tokens); ++ /// } ++ /// } ++ /// } ++ /// # ++ /// # pub struct PathSegment; ++ /// # ++ /// # impl ToTokens for PathSegment { ++ /// # fn to_tokens(&self, tokens: &mut TokenStream) { ++ /// # unimplemented!() ++ /// # } ++ /// # } ++ /// ``` ++ fn to_tokens(&self, tokens: &mut TokenStream); ++ ++ /// Convert `self` directly into a `TokenStream` object. ++ /// ++ /// This method is implicitly implemented using `to_tokens`, and acts as a ++ /// convenience method for consumers of the `ToTokens` trait. ++ fn to_token_stream(&self) -> TokenStream { ++ let mut tokens = TokenStream::new(); ++ self.to_tokens(&mut tokens); ++ tokens ++ } ++ ++ /// Convert `self` directly into a `TokenStream` object. ++ /// ++ /// This method is implicitly implemented using `to_tokens`, and acts as a ++ /// convenience method for consumers of the `ToTokens` trait. ++ fn into_token_stream(self) -> TokenStream ++ where ++ Self: Sized, ++ { ++ self.to_token_stream() ++ } ++} ++ ++impl ToTokens for &T { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ (**self).to_tokens(tokens); ++ } ++} ++ ++impl ToTokens for &mut T { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ (**self).to_tokens(tokens); ++ } ++} ++ ++impl<'a, T: ?Sized + ToOwned + ToTokens> ToTokens for Cow<'a, T> { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ (**self).to_tokens(tokens); ++ } ++} ++ ++impl ToTokens for Box { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ (**self).to_tokens(tokens); ++ } ++} ++ ++impl ToTokens for Rc { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ (**self).to_tokens(tokens); ++ } ++} ++ ++impl ToTokens for Option { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ if let Some(t) = self { ++ t.to_tokens(tokens); ++ } ++ } ++} ++ ++impl ToTokens for str { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ tokens.append(Literal::string(self)); ++ } ++} ++ ++impl ToTokens for String { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ self.as_str().to_tokens(tokens); ++ } ++} ++ ++impl ToTokens for i8 { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ tokens.append(Literal::i8_suffixed(*self)); ++ } ++} ++ ++impl ToTokens for i16 { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ tokens.append(Literal::i16_suffixed(*self)); ++ } ++} ++ ++impl ToTokens for i32 { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ tokens.append(Literal::i32_suffixed(*self)); ++ } ++} ++ ++impl ToTokens for i64 { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ tokens.append(Literal::i64_suffixed(*self)); ++ } ++} ++ ++impl ToTokens for i128 { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ tokens.append(Literal::i128_suffixed(*self)); ++ } ++} ++ ++impl ToTokens for isize { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ tokens.append(Literal::isize_suffixed(*self)); ++ } ++} ++ ++impl ToTokens for u8 { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ tokens.append(Literal::u8_suffixed(*self)); ++ } ++} ++ ++impl ToTokens for u16 { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ tokens.append(Literal::u16_suffixed(*self)); ++ } ++} ++ ++impl ToTokens for u32 { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ tokens.append(Literal::u32_suffixed(*self)); ++ } ++} ++ ++impl ToTokens for u64 { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ tokens.append(Literal::u64_suffixed(*self)); ++ } ++} ++ ++impl ToTokens for u128 { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ tokens.append(Literal::u128_suffixed(*self)); ++ } ++} ++ ++impl ToTokens for usize { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ tokens.append(Literal::usize_suffixed(*self)); ++ } ++} ++ ++impl ToTokens for f32 { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ tokens.append(Literal::f32_suffixed(*self)); ++ } ++} ++ ++impl ToTokens for f64 { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ tokens.append(Literal::f64_suffixed(*self)); ++ } ++} ++ ++impl ToTokens for char { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ tokens.append(Literal::character(*self)); ++ } ++} ++ ++impl ToTokens for bool { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ let word = if *self { "true" } else { "false" }; ++ tokens.append(Ident::new(word, Span::call_site())); ++ } ++} ++ ++impl ToTokens for CStr { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ tokens.append(Literal::c_string(self)); ++ } ++} ++ ++impl ToTokens for CString { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ tokens.append(Literal::c_string(self)); ++ } ++} ++ ++impl ToTokens for Group { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ tokens.append(self.clone()); ++ } ++} ++ ++impl ToTokens for Ident { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ tokens.append(self.clone()); ++ } ++} ++ ++impl ToTokens for Punct { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ tokens.append(self.clone()); ++ } ++} ++ ++impl ToTokens for Literal { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ tokens.append(self.clone()); ++ } ++} ++ ++impl ToTokens for TokenTree { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ tokens.append(self.clone()); ++ } ++} ++ ++impl ToTokens for TokenStream { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ tokens.extend(iter::once(self.clone())); ++ } ++ ++ fn into_token_stream(self) -> TokenStream { ++ self ++ } ++} +diff -Nru mesa-25.3.3/subprojects/quote-1.0.40/tests/compiletest.rs mesa-25.3.3/subprojects/quote-1.0.40/tests/compiletest.rs +--- mesa-25.3.3/subprojects/quote-1.0.40/tests/compiletest.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/quote-1.0.40/tests/compiletest.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,7 @@ ++#[rustversion::attr(not(nightly), ignore = "requires nightly")] ++#[cfg_attr(miri, ignore = "incompatible with miri")] ++#[test] ++fn ui() { ++ let t = trybuild::TestCases::new(); ++ t.compile_fail("tests/ui/*.rs"); ++} +diff -Nru mesa-25.3.3/subprojects/quote-1.0.40/tests/test.rs mesa-25.3.3/subprojects/quote-1.0.40/tests/test.rs +--- mesa-25.3.3/subprojects/quote-1.0.40/tests/test.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/quote-1.0.40/tests/test.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,568 @@ ++#![allow( ++ clippy::disallowed_names, ++ clippy::let_underscore_untyped, ++ clippy::shadow_unrelated, ++ clippy::unseparated_literal_suffix, ++ clippy::used_underscore_binding ++)] ++ ++extern crate proc_macro; ++ ++use proc_macro2::{Delimiter, Group, Ident, Span, TokenStream}; ++use quote::{format_ident, quote, quote_spanned, TokenStreamExt}; ++use std::borrow::Cow; ++use std::collections::BTreeSet; ++use std::ffi::{CStr, CString}; ++ ++struct X; ++ ++impl quote::ToTokens for X { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ tokens.append(Ident::new("X", Span::call_site())); ++ } ++} ++ ++#[test] ++fn test_quote_impl() { ++ let tokens = quote! { ++ impl<'a, T: ToTokens> ToTokens for &'a T { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ (**self).to_tokens(tokens) ++ } ++ } ++ }; ++ ++ let expected = concat!( ++ "impl < 'a , T : ToTokens > ToTokens for & 'a T { ", ++ "fn to_tokens (& self , tokens : & mut TokenStream) { ", ++ "(* * self) . to_tokens (tokens) ", ++ "} ", ++ "}" ++ ); ++ ++ assert_eq!(expected, tokens.to_string()); ++} ++ ++#[test] ++fn test_quote_spanned_impl() { ++ let span = Span::call_site(); ++ let tokens = quote_spanned! {span=> ++ impl<'a, T: ToTokens> ToTokens for &'a T { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ (**self).to_tokens(tokens) ++ } ++ } ++ }; ++ ++ let expected = concat!( ++ "impl < 'a , T : ToTokens > ToTokens for & 'a T { ", ++ "fn to_tokens (& self , tokens : & mut TokenStream) { ", ++ "(* * self) . to_tokens (tokens) ", ++ "} ", ++ "}" ++ ); ++ ++ assert_eq!(expected, tokens.to_string()); ++} ++ ++#[test] ++fn test_substitution() { ++ let x = X; ++ let tokens = quote!(#x <#x> (#x) [#x] {#x}); ++ ++ let expected = "X < X > (X) [X] { X }"; ++ ++ assert_eq!(expected, tokens.to_string()); ++} ++ ++#[test] ++fn test_iter() { ++ let primes = &[X, X, X, X]; ++ ++ assert_eq!("X X X X", quote!(#(#primes)*).to_string()); ++ ++ assert_eq!("X , X , X , X ,", quote!(#(#primes,)*).to_string()); ++ ++ assert_eq!("X , X , X , X", quote!(#(#primes),*).to_string()); ++} ++ ++#[test] ++fn test_array() { ++ let array: [u8; 40] = [0; 40]; ++ let _ = quote!(#(#array #array)*); ++ ++ let ref_array: &[u8; 40] = &[0; 40]; ++ let _ = quote!(#(#ref_array #ref_array)*); ++ ++ let ref_slice: &[u8] = &[0; 40]; ++ let _ = quote!(#(#ref_slice #ref_slice)*); ++ ++ let array: [X; 2] = [X, X]; // !Copy ++ let _ = quote!(#(#array #array)*); ++ ++ let ref_array: &[X; 2] = &[X, X]; ++ let _ = quote!(#(#ref_array #ref_array)*); ++ ++ let ref_slice: &[X] = &[X, X]; ++ let _ = quote!(#(#ref_slice #ref_slice)*); ++ ++ let array_of_array: [[u8; 2]; 2] = [[0; 2]; 2]; ++ let _ = quote!(#(#(#array_of_array)*)*); ++} ++ ++#[test] ++fn test_advanced() { ++ let generics = quote!( <'a, T> ); ++ ++ let where_clause = quote!( where T: Serialize ); ++ ++ let field_ty = quote!(String); ++ ++ let item_ty = quote!(Cow<'a, str>); ++ ++ let path = quote!(SomeTrait::serialize_with); ++ ++ let value = quote!(self.x); ++ ++ let tokens = quote! { ++ struct SerializeWith #generics #where_clause { ++ value: &'a #field_ty, ++ phantom: ::std::marker::PhantomData<#item_ty>, ++ } ++ ++ impl #generics ::serde::Serialize for SerializeWith #generics #where_clause { ++ fn serialize(&self, s: &mut S) -> Result<(), S::Error> ++ where S: ::serde::Serializer ++ { ++ #path(self.value, s) ++ } ++ } ++ ++ SerializeWith { ++ value: #value, ++ phantom: ::std::marker::PhantomData::<#item_ty>, ++ } ++ }; ++ ++ let expected = concat!( ++ "struct SerializeWith < 'a , T > where T : Serialize { ", ++ "value : & 'a String , ", ++ "phantom : :: std :: marker :: PhantomData < Cow < 'a , str > > , ", ++ "} ", ++ "impl < 'a , T > :: serde :: Serialize for SerializeWith < 'a , T > where T : Serialize { ", ++ "fn serialize < S > (& self , s : & mut S) -> Result < () , S :: Error > ", ++ "where S : :: serde :: Serializer ", ++ "{ ", ++ "SomeTrait :: serialize_with (self . value , s) ", ++ "} ", ++ "} ", ++ "SerializeWith { ", ++ "value : self . x , ", ++ "phantom : :: std :: marker :: PhantomData :: < Cow < 'a , str > > , ", ++ "}" ++ ); ++ ++ assert_eq!(expected, tokens.to_string()); ++} ++ ++#[test] ++fn test_integer() { ++ let ii8 = -1i8; ++ let ii16 = -1i16; ++ let ii32 = -1i32; ++ let ii64 = -1i64; ++ let ii128 = -1i128; ++ let iisize = -1isize; ++ let uu8 = 1u8; ++ let uu16 = 1u16; ++ let uu32 = 1u32; ++ let uu64 = 1u64; ++ let uu128 = 1u128; ++ let uusize = 1usize; ++ ++ let tokens = quote! { ++ 1 1i32 1u256 ++ #ii8 #ii16 #ii32 #ii64 #ii128 #iisize ++ #uu8 #uu16 #uu32 #uu64 #uu128 #uusize ++ }; ++ let expected = ++ "1 1i32 1u256 - 1i8 - 1i16 - 1i32 - 1i64 - 1i128 - 1isize 1u8 1u16 1u32 1u64 1u128 1usize"; ++ assert_eq!(expected, tokens.to_string()); ++} ++ ++#[test] ++fn test_floating() { ++ let e32 = 2.345f32; ++ ++ let e64 = 2.345f64; ++ ++ let tokens = quote! { ++ #e32 ++ #e64 ++ }; ++ let expected = concat!("2.345f32 2.345f64"); ++ assert_eq!(expected, tokens.to_string()); ++} ++ ++#[test] ++fn test_char() { ++ let zero = '\u{1}'; ++ let pound = '#'; ++ let quote = '"'; ++ let apost = '\''; ++ let newline = '\n'; ++ let heart = '\u{2764}'; ++ ++ let tokens = quote! { ++ #zero #pound #quote #apost #newline #heart ++ }; ++ let expected = "'\\u{1}' '#' '\"' '\\'' '\\n' '\u{2764}'"; ++ assert_eq!(expected, tokens.to_string()); ++} ++ ++#[test] ++fn test_str() { ++ let s = "\u{1} a 'b \" c"; ++ let tokens = quote!(#s); ++ let expected = "\"\\u{1} a 'b \\\" c\""; ++ assert_eq!(expected, tokens.to_string()); ++} ++ ++#[test] ++fn test_string() { ++ let s = "\u{1} a 'b \" c".to_string(); ++ let tokens = quote!(#s); ++ let expected = "\"\\u{1} a 'b \\\" c\""; ++ assert_eq!(expected, tokens.to_string()); ++} ++ ++#[test] ++fn test_c_str() { ++ let s = CStr::from_bytes_with_nul(b"\x01 a 'b \" c\0").unwrap(); ++ let tokens = quote!(#s); ++ let expected = "c\"\\u{1} a 'b \\\" c\""; ++ assert_eq!(expected, tokens.to_string()); ++} ++ ++#[test] ++fn test_c_string() { ++ let s = CString::new(&b"\x01 a 'b \" c"[..]).unwrap(); ++ let tokens = quote!(#s); ++ let expected = "c\"\\u{1} a 'b \\\" c\""; ++ assert_eq!(expected, tokens.to_string()); ++} ++ ++#[test] ++fn test_interpolated_literal() { ++ macro_rules! m { ++ ($literal:literal) => { ++ quote!($literal) ++ }; ++ } ++ ++ let tokens = m!(1); ++ let expected = "1"; ++ assert_eq!(expected, tokens.to_string()); ++ ++ let tokens = m!(-1); ++ let expected = "- 1"; ++ assert_eq!(expected, tokens.to_string()); ++ ++ let tokens = m!(true); ++ let expected = "true"; ++ assert_eq!(expected, tokens.to_string()); ++ ++ let tokens = m!(-true); ++ let expected = "- true"; ++ assert_eq!(expected, tokens.to_string()); ++} ++ ++#[test] ++fn test_ident() { ++ let foo = Ident::new("Foo", Span::call_site()); ++ let bar = Ident::new(&format!("Bar{}", 7), Span::call_site()); ++ let tokens = quote!(struct #foo; enum #bar {}); ++ let expected = "struct Foo ; enum Bar7 { }"; ++ assert_eq!(expected, tokens.to_string()); ++} ++ ++#[test] ++fn test_underscore() { ++ let tokens = quote!(let _;); ++ let expected = "let _ ;"; ++ assert_eq!(expected, tokens.to_string()); ++} ++ ++#[test] ++fn test_duplicate() { ++ let ch = 'x'; ++ ++ let tokens = quote!(#ch #ch); ++ ++ let expected = "'x' 'x'"; ++ assert_eq!(expected, tokens.to_string()); ++} ++ ++#[test] ++fn test_fancy_repetition() { ++ let foo = vec!["a", "b"]; ++ let bar = vec![true, false]; ++ ++ let tokens = quote! { ++ #(#foo: #bar),* ++ }; ++ ++ let expected = r#""a" : true , "b" : false"#; ++ assert_eq!(expected, tokens.to_string()); ++} ++ ++#[test] ++fn test_nested_fancy_repetition() { ++ let nested = vec![vec!['a', 'b', 'c'], vec!['x', 'y', 'z']]; ++ ++ let tokens = quote! { ++ #( ++ #(#nested)* ++ ),* ++ }; ++ ++ let expected = "'a' 'b' 'c' , 'x' 'y' 'z'"; ++ assert_eq!(expected, tokens.to_string()); ++} ++ ++#[test] ++fn test_duplicate_name_repetition() { ++ let foo = &["a", "b"]; ++ ++ let tokens = quote! { ++ #(#foo: #foo),* ++ #(#foo: #foo),* ++ }; ++ ++ let expected = r#""a" : "a" , "b" : "b" "a" : "a" , "b" : "b""#; ++ assert_eq!(expected, tokens.to_string()); ++} ++ ++#[test] ++fn test_duplicate_name_repetition_no_copy() { ++ let foo = vec!["a".to_owned(), "b".to_owned()]; ++ ++ let tokens = quote! { ++ #(#foo: #foo),* ++ }; ++ ++ let expected = r#""a" : "a" , "b" : "b""#; ++ assert_eq!(expected, tokens.to_string()); ++} ++ ++#[test] ++fn test_btreeset_repetition() { ++ let mut set = BTreeSet::new(); ++ set.insert("a".to_owned()); ++ set.insert("b".to_owned()); ++ ++ let tokens = quote! { ++ #(#set: #set),* ++ }; ++ ++ let expected = r#""a" : "a" , "b" : "b""#; ++ assert_eq!(expected, tokens.to_string()); ++} ++ ++#[test] ++fn test_variable_name_conflict() { ++ // The implementation of `#(...),*` uses the variable `_i` but it should be ++ // fine, if a little confusing when debugging. ++ let _i = vec!['a', 'b']; ++ let tokens = quote! { #(#_i),* }; ++ let expected = "'a' , 'b'"; ++ assert_eq!(expected, tokens.to_string()); ++} ++ ++#[test] ++fn test_nonrep_in_repetition() { ++ let rep = vec!["a", "b"]; ++ let nonrep = "c"; ++ ++ let tokens = quote! { ++ #(#rep #rep : #nonrep #nonrep),* ++ }; ++ ++ let expected = r#""a" "a" : "c" "c" , "b" "b" : "c" "c""#; ++ assert_eq!(expected, tokens.to_string()); ++} ++ ++#[test] ++fn test_empty_quote() { ++ let tokens = quote!(); ++ assert_eq!("", tokens.to_string()); ++} ++ ++#[test] ++fn test_box_str() { ++ let b = "str".to_owned().into_boxed_str(); ++ let tokens = quote! { #b }; ++ assert_eq!("\"str\"", tokens.to_string()); ++} ++ ++#[test] ++fn test_cow() { ++ let owned: Cow = Cow::Owned(Ident::new("owned", Span::call_site())); ++ ++ let ident = Ident::new("borrowed", Span::call_site()); ++ let borrowed = Cow::Borrowed(&ident); ++ ++ let tokens = quote! { #owned #borrowed }; ++ assert_eq!("owned borrowed", tokens.to_string()); ++} ++ ++#[test] ++fn test_closure() { ++ fn field_i(i: usize) -> Ident { ++ format_ident!("__field{}", i) ++ } ++ ++ let fields = (0usize..3) ++ .map(field_i as fn(_) -> _) ++ .map(|var| quote! { #var }); ++ ++ let tokens = quote! { #(#fields)* }; ++ assert_eq!("__field0 __field1 __field2", tokens.to_string()); ++} ++ ++#[test] ++fn test_append_tokens() { ++ let mut a = quote!(a); ++ let b = quote!(b); ++ a.append_all(b); ++ assert_eq!("a b", a.to_string()); ++} ++ ++#[test] ++fn test_format_ident() { ++ let id0 = format_ident!("Aa"); ++ let id1 = format_ident!("Hello{x}", x = id0); ++ let id2 = format_ident!("Hello{x}", x = 5usize); ++ let id3 = format_ident!("Hello{}_{x}", id0, x = 10usize); ++ let id4 = format_ident!("Aa", span = Span::call_site()); ++ let id5 = format_ident!("Hello{}", Cow::Borrowed("World")); ++ ++ assert_eq!(id0, "Aa"); ++ assert_eq!(id1, "HelloAa"); ++ assert_eq!(id2, "Hello5"); ++ assert_eq!(id3, "HelloAa_10"); ++ assert_eq!(id4, "Aa"); ++ assert_eq!(id5, "HelloWorld"); ++} ++ ++#[test] ++fn test_format_ident_strip_raw() { ++ let id = format_ident!("r#struct"); ++ let my_id = format_ident!("MyId{}", id); ++ let raw_my_id = format_ident!("r#MyId{}", id); ++ ++ assert_eq!(id, "r#struct"); ++ assert_eq!(my_id, "MyIdstruct"); ++ assert_eq!(raw_my_id, "r#MyIdstruct"); ++} ++ ++#[test] ++fn test_outer_line_comment() { ++ let tokens = quote! { ++ /// doc ++ }; ++ let expected = "# [doc = r\" doc\"]"; ++ assert_eq!(expected, tokens.to_string()); ++} ++ ++#[test] ++fn test_inner_line_comment() { ++ let tokens = quote! { ++ //! doc ++ }; ++ let expected = "# ! [doc = r\" doc\"]"; ++ assert_eq!(expected, tokens.to_string()); ++} ++ ++#[test] ++fn test_outer_block_comment() { ++ let tokens = quote! { ++ /** doc */ ++ }; ++ let expected = "# [doc = r\" doc \"]"; ++ assert_eq!(expected, tokens.to_string()); ++} ++ ++#[test] ++fn test_inner_block_comment() { ++ let tokens = quote! { ++ /*! doc */ ++ }; ++ let expected = "# ! [doc = r\" doc \"]"; ++ assert_eq!(expected, tokens.to_string()); ++} ++ ++#[test] ++fn test_outer_attr() { ++ let tokens = quote! { ++ #[inline] ++ }; ++ let expected = "# [inline]"; ++ assert_eq!(expected, tokens.to_string()); ++} ++ ++#[test] ++fn test_inner_attr() { ++ let tokens = quote! { ++ #![no_std] ++ }; ++ let expected = "# ! [no_std]"; ++ assert_eq!(expected, tokens.to_string()); ++} ++ ++// https://github.com/dtolnay/quote/issues/130 ++#[test] ++fn test_star_after_repetition() { ++ let c = vec!['0', '1']; ++ let tokens = quote! { ++ #( ++ f(#c); ++ )* ++ *out = None; ++ }; ++ let expected = "f ('0') ; f ('1') ; * out = None ;"; ++ assert_eq!(expected, tokens.to_string()); ++} ++ ++#[test] ++fn test_quote_raw_id() { ++ let id = quote!(r#raw_id); ++ assert_eq!(id.to_string(), "r#raw_id"); ++} ++ ++#[test] ++fn test_type_inference_for_span() { ++ trait CallSite { ++ fn get() -> Self; ++ } ++ ++ impl CallSite for Span { ++ fn get() -> Self { ++ Span::call_site() ++ } ++ } ++ ++ let span = Span::call_site(); ++ let _ = quote_spanned!(span=> ...); ++ ++ let delim_span = Group::new(Delimiter::Parenthesis, TokenStream::new()).delim_span(); ++ let _ = quote_spanned!(delim_span=> ...); ++ ++ let inferred = CallSite::get(); ++ let _ = quote_spanned!(inferred=> ...); ++ ++ if false { ++ let proc_macro_span = proc_macro::Span::call_site(); ++ let _ = quote_spanned!(proc_macro_span.into()=> ...); ++ } ++} +diff -Nru mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/does-not-have-iter-interpolated-dup.rs mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/does-not-have-iter-interpolated-dup.rs +--- mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/does-not-have-iter-interpolated-dup.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/does-not-have-iter-interpolated-dup.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,9 @@ ++use quote::quote; ++ ++fn main() { ++ let nonrep = ""; ++ ++ // Without some protection against repetitions with no iterator somewhere ++ // inside, this would loop infinitely. ++ quote!(#(#nonrep #nonrep)*); ++} +diff -Nru mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/does-not-have-iter-interpolated-dup.stderr mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/does-not-have-iter-interpolated-dup.stderr +--- mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/does-not-have-iter-interpolated-dup.stderr 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/does-not-have-iter-interpolated-dup.stderr 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,11 @@ ++error[E0308]: mismatched types ++ --> tests/ui/does-not-have-iter-interpolated-dup.rs:8:5 ++ | ++8 | quote!(#(#nonrep #nonrep)*); ++ | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ ++ | | ++ | expected `HasIterator`, found `ThereIsNoIteratorInRepetition` ++ | expected due to this ++ | here the type of `has_iter` is inferred to be `ThereIsNoIteratorInRepetition` ++ | ++ = note: this error originates in the macro `$crate::quote_token_with_context` which comes from the expansion of the macro `quote` (in Nightly builds, run with -Z macro-backtrace for more info) +diff -Nru mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/does-not-have-iter-interpolated.rs mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/does-not-have-iter-interpolated.rs +--- mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/does-not-have-iter-interpolated.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/does-not-have-iter-interpolated.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,9 @@ ++use quote::quote; ++ ++fn main() { ++ let nonrep = ""; ++ ++ // Without some protection against repetitions with no iterator somewhere ++ // inside, this would loop infinitely. ++ quote!(#(#nonrep)*); ++} +diff -Nru mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/does-not-have-iter-interpolated.stderr mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/does-not-have-iter-interpolated.stderr +--- mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/does-not-have-iter-interpolated.stderr 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/does-not-have-iter-interpolated.stderr 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,11 @@ ++error[E0308]: mismatched types ++ --> tests/ui/does-not-have-iter-interpolated.rs:8:5 ++ | ++8 | quote!(#(#nonrep)*); ++ | ^^^^^^^^^^^^^^^^^^^ ++ | | ++ | expected `HasIterator`, found `ThereIsNoIteratorInRepetition` ++ | expected due to this ++ | here the type of `has_iter` is inferred to be `ThereIsNoIteratorInRepetition` ++ | ++ = note: this error originates in the macro `$crate::quote_token_with_context` which comes from the expansion of the macro `quote` (in Nightly builds, run with -Z macro-backtrace for more info) +diff -Nru mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/does-not-have-iter.rs mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/does-not-have-iter.rs +--- mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/does-not-have-iter.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/does-not-have-iter.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,5 @@ ++use quote::quote; ++ ++fn main() { ++ quote!(#(a b)*); ++} +diff -Nru mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/does-not-have-iter-separated.rs mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/does-not-have-iter-separated.rs +--- mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/does-not-have-iter-separated.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/does-not-have-iter-separated.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,5 @@ ++use quote::quote; ++ ++fn main() { ++ quote!(#(a b),*); ++} +diff -Nru mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/does-not-have-iter-separated.stderr mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/does-not-have-iter-separated.stderr +--- mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/does-not-have-iter-separated.stderr 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/does-not-have-iter-separated.stderr 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,10 @@ ++error[E0308]: mismatched types ++ --> tests/ui/does-not-have-iter-separated.rs:4:5 ++ | ++4 | quote!(#(a b),*); ++ | ^^^^^^^^^^^^^^^^ ++ | | ++ | expected `HasIterator`, found `ThereIsNoIteratorInRepetition` ++ | expected due to this ++ | ++ = note: this error originates in the macro `$crate::quote_token_with_context` which comes from the expansion of the macro `quote` (in Nightly builds, run with -Z macro-backtrace for more info) +diff -Nru mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/does-not-have-iter.stderr mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/does-not-have-iter.stderr +--- mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/does-not-have-iter.stderr 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/does-not-have-iter.stderr 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,10 @@ ++error[E0308]: mismatched types ++ --> tests/ui/does-not-have-iter.rs:4:5 ++ | ++4 | quote!(#(a b)*); ++ | ^^^^^^^^^^^^^^^ ++ | | ++ | expected `HasIterator`, found `ThereIsNoIteratorInRepetition` ++ | expected due to this ++ | ++ = note: this error originates in the macro `$crate::quote_token_with_context` which comes from the expansion of the macro `quote` (in Nightly builds, run with -Z macro-backtrace for more info) +diff -Nru mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/not-quotable.rs mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/not-quotable.rs +--- mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/not-quotable.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/not-quotable.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,7 @@ ++use quote::quote; ++use std::net::Ipv4Addr; ++ ++fn main() { ++ let ip = Ipv4Addr::LOCALHOST; ++ let _ = quote! { #ip }; ++} +diff -Nru mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/not-quotable.stderr mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/not-quotable.stderr +--- mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/not-quotable.stderr 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/not-quotable.stderr 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,20 @@ ++error[E0277]: the trait bound `Ipv4Addr: ToTokens` is not satisfied ++ --> tests/ui/not-quotable.rs:6:13 ++ | ++6 | let _ = quote! { #ip }; ++ | ^^^^^^^^^^^^^^ ++ | | ++ | the trait `ToTokens` is not implemented for `Ipv4Addr` ++ | required by a bound introduced by this call ++ | ++ = help: the following other types implement trait `ToTokens`: ++ &T ++ &mut T ++ Box ++ CStr ++ CString ++ Cow<'a, T> ++ Option ++ Rc ++ and $N others ++ = note: this error originates in the macro `quote` (in Nightly builds, run with -Z macro-backtrace for more info) +diff -Nru mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/not-repeatable.rs mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/not-repeatable.rs +--- mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/not-repeatable.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/not-repeatable.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,8 @@ ++use quote::quote; ++ ++struct Ipv4Addr; ++ ++fn main() { ++ let ip = Ipv4Addr; ++ let _ = quote! { #(#ip)* }; ++} +diff -Nru mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/not-repeatable.stderr mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/not-repeatable.stderr +--- mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/not-repeatable.stderr 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/not-repeatable.stderr 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,34 @@ ++error[E0599]: the method `quote_into_iter` exists for struct `Ipv4Addr`, but its trait bounds were not satisfied ++ --> tests/ui/not-repeatable.rs:7:13 ++ | ++3 | struct Ipv4Addr; ++ | --------------- method `quote_into_iter` not found for this struct because it doesn't satisfy `Ipv4Addr: Iterator`, `Ipv4Addr: ToTokens`, `Ipv4Addr: ext::RepIteratorExt` or `Ipv4Addr: ext::RepToTokensExt` ++... ++7 | let _ = quote! { #(#ip)* }; ++ | ^^^^^^^^^^^^^^^^^^ method cannot be called on `Ipv4Addr` due to unsatisfied trait bounds ++ | ++ = note: the following trait bounds were not satisfied: ++ `Ipv4Addr: Iterator` ++ which is required by `Ipv4Addr: ext::RepIteratorExt` ++ `&Ipv4Addr: Iterator` ++ which is required by `&Ipv4Addr: ext::RepIteratorExt` ++ `Ipv4Addr: ToTokens` ++ which is required by `Ipv4Addr: ext::RepToTokensExt` ++ `&mut Ipv4Addr: Iterator` ++ which is required by `&mut Ipv4Addr: ext::RepIteratorExt` ++note: the traits `Iterator` and `ToTokens` must be implemented ++ --> src/to_tokens.rs ++ | ++ | pub trait ToTokens { ++ | ^^^^^^^^^^^^^^^^^^ ++ | ++ ::: $RUST/core/src/iter/traits/iterator.rs ++ | ++ | pub trait Iterator { ++ | ^^^^^^^^^^^^^^^^^^ ++ = help: items from traits can only be used if the trait is implemented and in scope ++ = note: the following traits define an item `quote_into_iter`, perhaps you need to implement one of them: ++ candidate #1: `ext::RepAsIteratorExt` ++ candidate #2: `ext::RepIteratorExt` ++ candidate #3: `ext::RepToTokensExt` ++ = note: this error originates in the macro `$crate::quote_bind_into_iter` which comes from the expansion of the macro `quote` (in Nightly builds, run with -Z macro-backtrace for more info) +diff -Nru mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/wrong-type-span.rs mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/wrong-type-span.rs +--- mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/wrong-type-span.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/wrong-type-span.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,7 @@ ++use quote::quote_spanned; ++ ++fn main() { ++ let span = ""; ++ let x = 0i32; ++ quote_spanned!(span=> #x); ++} +diff -Nru mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/wrong-type-span.stderr mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/wrong-type-span.stderr +--- mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/wrong-type-span.stderr 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/quote-1.0.40/tests/ui/wrong-type-span.stderr 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,10 @@ ++error[E0308]: mismatched types ++ --> tests/ui/wrong-type-span.rs:6:5 ++ | ++6 | quote_spanned!(span=> #x); ++ | ^^^^^^^^^^^^^^^^^^^^^^^^^ ++ | | ++ | expected `Span`, found `&str` ++ | expected due to this ++ | ++ = note: this error originates in the macro `quote_spanned` (in Nightly builds, run with -Z macro-backtrace for more info) +diff -Nru mesa-25.3.3/subprojects/quote-1-rs.wrap mesa-25.3.3/subprojects/quote-1-rs.wrap +--- mesa-25.3.3/subprojects/quote-1-rs.wrap 2026-01-01 13:34:04.000000000 -0500 ++++ mesa-25.3.3/subprojects/quote-1-rs.wrap 2026-05-29 13:40:56.000000000 -0500 +@@ -1,6 +1,4 @@ + [wrap-file] +-directory = quote-1.0.35 +-source_url = https://crates.io/api/v1/crates/quote/1.0.35/download +-source_filename = quote-1.0.35.tar.gz +-source_hash = 291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef ++directory = quote-1.0.40 + patch_directory = quote-1-rs ++ +diff -Nru mesa-25.3.3/subprojects/rustc-hash-2.0.0/.cargo-checksum.json mesa-25.3.3/subprojects/rustc-hash-2.0.0/.cargo-checksum.json +--- mesa-25.3.3/subprojects/rustc-hash-2.0.0/.cargo-checksum.json 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/rustc-hash-2.0.0/.cargo-checksum.json 2025-01-23 14:29:29.000000000 -0500 +@@ -0,0 +1 @@ ++{"package":"583034fd73374156e66797ed8e5b0d5690409c9226b22d87cb7f19821c05d152","files":{}} +diff -Nru mesa-25.3.3/subprojects/rustc-hash-2.0.0/Cargo.toml mesa-25.3.3/subprojects/rustc-hash-2.0.0/Cargo.toml +--- mesa-25.3.3/subprojects/rustc-hash-2.0.0/Cargo.toml 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/rustc-hash-2.0.0/Cargo.toml 2025-01-23 14:29:29.000000000 -0500 +@@ -0,0 +1,39 @@ ++# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO ++# ++# When uploading crates to the registry Cargo will automatically ++# "normalize" Cargo.toml files for maximal compatibility ++# with all versions of Cargo and also rewrite `path` dependencies ++# to registry (e.g., crates.io) dependencies. ++# ++# If you are reading this file be aware that the original Cargo.toml ++# will likely look very different (and much more reasonable). ++# See Cargo.toml.orig for the original contents. ++ ++[package] ++edition = "2021" ++name = "rustc-hash" ++version = "2.0.0" ++authors = ["The Rust Project Developers"] ++description = "A speedy, non-cryptographic hashing algorithm used by rustc" ++readme = "README.md" ++keywords = [ ++ "hash", ++ "hasher", ++ "fxhash", ++ "rustc", ++] ++license = "Apache-2.0/MIT" ++repository = "https://github.com/rust-lang/rustc-hash" ++ ++[dependencies.rand] ++version = "0.8" ++optional = true ++ ++[features] ++default = ["std"] ++nightly = [] ++rand = [ ++ "dep:rand", ++ "std", ++] ++std = [] +diff -Nru mesa-25.3.3/subprojects/rustc-hash-2.0.0/.cargo_vcs_info.json mesa-25.3.3/subprojects/rustc-hash-2.0.0/.cargo_vcs_info.json +--- mesa-25.3.3/subprojects/rustc-hash-2.0.0/.cargo_vcs_info.json 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/rustc-hash-2.0.0/.cargo_vcs_info.json 2025-01-23 14:29:29.000000000 -0500 +@@ -0,0 +1,6 @@ ++{ ++ "git": { ++ "sha1": "8f258eec1f9e4a328fa0f7d370fcf7d51251ce96" ++ }, ++ "path_in_vcs": "" ++} +\ No hay ningún carácter de nueva línea al final del archivo +diff -Nru mesa-25.3.3/subprojects/rustc-hash-2.0.0/CHANGELOG.md mesa-25.3.3/subprojects/rustc-hash-2.0.0/CHANGELOG.md +--- mesa-25.3.3/subprojects/rustc-hash-2.0.0/CHANGELOG.md 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/rustc-hash-2.0.0/CHANGELOG.md 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,19 @@ ++## 2.0.0 ++ ++- Replace hash with faster and better finalized hash. ++ This replaces the previous "fxhash" algorithm originating in Firefox ++ with a custom hasher designed and implemented by Orson Peters ([`@orlp`](https://github.com/orlp)). ++ It was measured to have slightly better performance for rustc, has better theoretical properties ++ and also includes a signficantly better string hasher. ++- Fix `no_std` builds ++ ++## 1.2.0 (**YANKED**) ++ ++**Note: This version has been yanked due to issues with the `no_std` feature!** ++ ++- Add a `FxBuildHasher` unit struct ++- Improve documentation ++- Add seed API for supplying custom seeds other than 0 ++- Add `FxRandomState` based on `rand` (behind the `rand` feature) for random seeds ++- Make many functions `const fn` ++- Implement `Clone` for `FxHasher` struct +diff -Nru mesa-25.3.3/subprojects/rustc-hash-2.0.0/CODE_OF_CONDUCT.md mesa-25.3.3/subprojects/rustc-hash-2.0.0/CODE_OF_CONDUCT.md +--- mesa-25.3.3/subprojects/rustc-hash-2.0.0/CODE_OF_CONDUCT.md 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/rustc-hash-2.0.0/CODE_OF_CONDUCT.md 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,3 @@ ++# The Rust Code of Conduct ++ ++The Code of Conduct for this repository [can be found online](https://www.rust-lang.org/conduct.html). +\ No hay ningún carácter de nueva línea al final del archivo +diff -Nru mesa-25.3.3/subprojects/rustc-hash-2.0.0/.github/workflows/rust.yml mesa-25.3.3/subprojects/rustc-hash-2.0.0/.github/workflows/rust.yml +--- mesa-25.3.3/subprojects/rustc-hash-2.0.0/.github/workflows/rust.yml 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/rustc-hash-2.0.0/.github/workflows/rust.yml 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,19 @@ ++name: Rust ++ ++on: [push, pull_request] ++ ++jobs: ++ build: ++ runs-on: ${{ matrix.os }}-latest ++ steps: ++ - uses: actions/checkout@v4 ++ - uses: rust-lang/simpleinfra/github-actions/simple-ci@master ++ - name: "32-bit cross testing" ++ run: | ++ rustup toolchain install nightly ++ rustup override set nightly ++ rustup component add miri ++ cargo +nightly miri test --target i686-unknown-linux-gnu ++ strategy: ++ matrix: ++ os: [ubuntu, windows, macos] +diff -Nru mesa-25.3.3/subprojects/rustc-hash-2.0.0/.gitignore mesa-25.3.3/subprojects/rustc-hash-2.0.0/.gitignore +--- mesa-25.3.3/subprojects/rustc-hash-2.0.0/.gitignore 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/rustc-hash-2.0.0/.gitignore 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,3 @@ ++/target ++**/*.rs.bk ++/Cargo.lock +diff -Nru mesa-25.3.3/subprojects/rustc-hash-2.0.0/LICENSE-APACHE mesa-25.3.3/subprojects/rustc-hash-2.0.0/LICENSE-APACHE +--- mesa-25.3.3/subprojects/rustc-hash-2.0.0/LICENSE-APACHE 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/rustc-hash-2.0.0/LICENSE-APACHE 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,176 @@ ++ Apache License ++ Version 2.0, January 2004 ++ http://www.apache.org/licenses/ ++ ++TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION ++ ++1. Definitions. ++ ++ "License" shall mean the terms and conditions for use, reproduction, ++ and distribution as defined by Sections 1 through 9 of this document. ++ ++ "Licensor" shall mean the copyright owner or entity authorized by ++ the copyright owner that is granting the License. ++ ++ "Legal Entity" shall mean the union of the acting entity and all ++ other entities that control, are controlled by, or are under common ++ control with that entity. For the purposes of this definition, ++ "control" means (i) the power, direct or indirect, to cause the ++ direction or management of such entity, whether by contract or ++ otherwise, or (ii) ownership of fifty percent (50%) or more of the ++ outstanding shares, or (iii) beneficial ownership of such entity. ++ ++ "You" (or "Your") shall mean an individual or Legal Entity ++ exercising permissions granted by this License. ++ ++ "Source" form shall mean the preferred form for making modifications, ++ including but not limited to software source code, documentation ++ source, and configuration files. ++ ++ "Object" form shall mean any form resulting from mechanical ++ transformation or translation of a Source form, including but ++ not limited to compiled object code, generated documentation, ++ and conversions to other media types. ++ ++ "Work" shall mean the work of authorship, whether in Source or ++ Object form, made available under the License, as indicated by a ++ copyright notice that is included in or attached to the work ++ (an example is provided in the Appendix below). ++ ++ "Derivative Works" shall mean any work, whether in Source or Object ++ form, that is based on (or derived from) the Work and for which the ++ editorial revisions, annotations, elaborations, or other modifications ++ represent, as a whole, an original work of authorship. For the purposes ++ of this License, Derivative Works shall not include works that remain ++ separable from, or merely link (or bind by name) to the interfaces of, ++ the Work and Derivative Works thereof. ++ ++ "Contribution" shall mean any work of authorship, including ++ the original version of the Work and any modifications or additions ++ to that Work or Derivative Works thereof, that is intentionally ++ submitted to Licensor for inclusion in the Work by the copyright owner ++ or by an individual or Legal Entity authorized to submit on behalf of ++ the copyright owner. For the purposes of this definition, "submitted" ++ means any form of electronic, verbal, or written communication sent ++ to the Licensor or its representatives, including but not limited to ++ communication on electronic mailing lists, source code control systems, ++ and issue tracking systems that are managed by, or on behalf of, the ++ Licensor for the purpose of discussing and improving the Work, but ++ excluding communication that is conspicuously marked or otherwise ++ designated in writing by the copyright owner as "Not a Contribution." ++ ++ "Contributor" shall mean Licensor and any individual or Legal Entity ++ on behalf of whom a Contribution has been received by Licensor and ++ subsequently incorporated within the Work. ++ ++2. Grant of Copyright License. Subject to the terms and conditions of ++ this License, each Contributor hereby grants to You a perpetual, ++ worldwide, non-exclusive, no-charge, royalty-free, irrevocable ++ copyright license to reproduce, prepare Derivative Works of, ++ publicly display, publicly perform, sublicense, and distribute the ++ Work and such Derivative Works in Source or Object form. ++ ++3. Grant of Patent License. Subject to the terms and conditions of ++ this License, each Contributor hereby grants to You a perpetual, ++ worldwide, non-exclusive, no-charge, royalty-free, irrevocable ++ (except as stated in this section) patent license to make, have made, ++ use, offer to sell, sell, import, and otherwise transfer the Work, ++ where such license applies only to those patent claims licensable ++ by such Contributor that are necessarily infringed by their ++ Contribution(s) alone or by combination of their Contribution(s) ++ with the Work to which such Contribution(s) was submitted. If You ++ institute patent litigation against any entity (including a ++ cross-claim or counterclaim in a lawsuit) alleging that the Work ++ or a Contribution incorporated within the Work constitutes direct ++ or contributory patent infringement, then any patent licenses ++ granted to You under this License for that Work shall terminate ++ as of the date such litigation is filed. ++ ++4. Redistribution. You may reproduce and distribute copies of the ++ Work or Derivative Works thereof in any medium, with or without ++ modifications, and in Source or Object form, provided that You ++ meet the following conditions: ++ ++ (a) You must give any other recipients of the Work or ++ Derivative Works a copy of this License; and ++ ++ (b) You must cause any modified files to carry prominent notices ++ stating that You changed the files; and ++ ++ (c) You must retain, in the Source form of any Derivative Works ++ that You distribute, all copyright, patent, trademark, and ++ attribution notices from the Source form of the Work, ++ excluding those notices that do not pertain to any part of ++ the Derivative Works; and ++ ++ (d) If the Work includes a "NOTICE" text file as part of its ++ distribution, then any Derivative Works that You distribute must ++ include a readable copy of the attribution notices contained ++ within such NOTICE file, excluding those notices that do not ++ pertain to any part of the Derivative Works, in at least one ++ of the following places: within a NOTICE text file distributed ++ as part of the Derivative Works; within the Source form or ++ documentation, if provided along with the Derivative Works; or, ++ within a display generated by the Derivative Works, if and ++ wherever such third-party notices normally appear. The contents ++ of the NOTICE file are for informational purposes only and ++ do not modify the License. You may add Your own attribution ++ notices within Derivative Works that You distribute, alongside ++ or as an addendum to the NOTICE text from the Work, provided ++ that such additional attribution notices cannot be construed ++ as modifying the License. ++ ++ You may add Your own copyright statement to Your modifications and ++ may provide additional or different license terms and conditions ++ for use, reproduction, or distribution of Your modifications, or ++ for any such Derivative Works as a whole, provided Your use, ++ reproduction, and distribution of the Work otherwise complies with ++ the conditions stated in this License. ++ ++5. Submission of Contributions. Unless You explicitly state otherwise, ++ any Contribution intentionally submitted for inclusion in the Work ++ by You to the Licensor shall be under the terms and conditions of ++ this License, without any additional terms or conditions. ++ Notwithstanding the above, nothing herein shall supersede or modify ++ the terms of any separate license agreement you may have executed ++ with Licensor regarding such Contributions. ++ ++6. Trademarks. This License does not grant permission to use the trade ++ names, trademarks, service marks, or product names of the Licensor, ++ except as required for reasonable and customary use in describing the ++ origin of the Work and reproducing the content of the NOTICE file. ++ ++7. Disclaimer of Warranty. Unless required by applicable law or ++ agreed to in writing, Licensor provides the Work (and each ++ Contributor provides its Contributions) on an "AS IS" BASIS, ++ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or ++ implied, including, without limitation, any warranties or conditions ++ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A ++ PARTICULAR PURPOSE. You are solely responsible for determining the ++ appropriateness of using or redistributing the Work and assume any ++ risks associated with Your exercise of permissions under this License. ++ ++8. Limitation of Liability. In no event and under no legal theory, ++ whether in tort (including negligence), contract, or otherwise, ++ unless required by applicable law (such as deliberate and grossly ++ negligent acts) or agreed to in writing, shall any Contributor be ++ liable to You for damages, including any direct, indirect, special, ++ incidental, or consequential damages of any character arising as a ++ result of this License or out of the use or inability to use the ++ Work (including but not limited to damages for loss of goodwill, ++ work stoppage, computer failure or malfunction, or any and all ++ other commercial damages or losses), even if such Contributor ++ has been advised of the possibility of such damages. ++ ++9. Accepting Warranty or Additional Liability. While redistributing ++ the Work or Derivative Works thereof, You may choose to offer, ++ and charge a fee for, acceptance of support, warranty, indemnity, ++ or other liability obligations and/or rights consistent with this ++ License. However, in accepting such obligations, You may act only ++ on Your own behalf and on Your sole responsibility, not on behalf ++ of any other Contributor, and only if You agree to indemnify, ++ defend, and hold each Contributor harmless for any liability ++ incurred by, or claims asserted against, such Contributor by reason ++ of your accepting any such warranty or additional liability. ++ ++END OF TERMS AND CONDITIONS +\ No hay ningún carácter de nueva línea al final del archivo +diff -Nru mesa-25.3.3/subprojects/rustc-hash-2.0.0/LICENSE-MIT mesa-25.3.3/subprojects/rustc-hash-2.0.0/LICENSE-MIT +--- mesa-25.3.3/subprojects/rustc-hash-2.0.0/LICENSE-MIT 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/rustc-hash-2.0.0/LICENSE-MIT 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,23 @@ ++Permission is hereby granted, free of charge, to any ++person obtaining a copy of this software and associated ++documentation files (the "Software"), to deal in the ++Software without restriction, including without ++limitation the rights to use, copy, modify, merge, ++publish, distribute, sublicense, and/or sell copies of ++the Software, and to permit persons to whom the Software ++is furnished to do so, subject to the following ++conditions: ++ ++The above copyright notice and this permission notice ++shall be included in all copies or substantial portions ++of the Software. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ++ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED ++TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A ++PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT ++SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ++CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION ++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR ++IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ++DEALINGS IN THE SOFTWARE. +\ No hay ningún carácter de nueva línea al final del archivo +diff -Nru mesa-25.3.3/subprojects/rustc-hash-2.0.0/meson.build mesa-25.3.3/subprojects/rustc-hash-2.0.0/meson.build +--- mesa-25.3.3/subprojects/rustc-hash-2.0.0/meson.build 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/rustc-hash-2.0.0/meson.build 2026-05-26 15:46:09.000000000 -0500 +@@ -0,0 +1,17 @@ ++project('rustc_hash', 'rust', version : '2.0.0', license : 'MIT OR Apache-2.0') ++ ++rust_args = [ ++ '--cfg', 'feature="std"' ++] ++ ++lib = static_library( ++ 'rustc_hash', ++ 'src/lib.rs', ++ rust_args : rust_args, ++ override_options : ['rust_std=2021', 'build.rust_std=2021'], ++ rust_abi : 'rust', ++) ++ ++dep_rustc_hash = declare_dependency( ++ link_with : [lib], ++) +diff -Nru mesa-25.3.3/subprojects/rustc-hash-2.0.0/.meson-subproject-wrap-hash.txt mesa-25.3.3/subprojects/rustc-hash-2.0.0/.meson-subproject-wrap-hash.txt +--- mesa-25.3.3/subprojects/rustc-hash-2.0.0/.meson-subproject-wrap-hash.txt 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/rustc-hash-2.0.0/.meson-subproject-wrap-hash.txt 2026-05-29 13:40:57.000000000 -0500 +@@ -0,0 +1 @@ ++7d99fd54f52657489527ffc5ebed027d5c9a617b938a9b1c62b5b1d742ad3dfb +diff -Nru mesa-25.3.3/subprojects/rustc-hash-2.0.0/README.md mesa-25.3.3/subprojects/rustc-hash-2.0.0/README.md +--- mesa-25.3.3/subprojects/rustc-hash-2.0.0/README.md 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/rustc-hash-2.0.0/README.md 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,42 @@ ++# rustc-hash ++ ++[![crates.io](https://img.shields.io/crates/v/rustc-hash.svg)](https://crates.io/crates/rustc-hash) ++[![Documentation](https://docs.rs/rustc-hash/badge.svg)](https://docs.rs/rustc-hash) ++ ++A speedy, non-cryptographic hashing algorithm used by `rustc`. ++The [hash map in `std`](https://doc.rust-lang.org/std/collections/struct.HashMap.html) uses SipHash by default, which provides resistance against DOS attacks. ++These attacks aren't a concern in the compiler so we prefer to use a quicker, ++non-cryptographic hash algorithm. ++ ++The original hash algorithm provided by this crate was one taken from Firefox, ++hence the hasher it provides is called FxHasher. This name is kept for backwards ++compatibility, but the underlying hash has since been replaced. The current ++design for the hasher is a polynomial hash finished with a single bit rotation, ++together with a wyhash-inspired compression function for strings/slices, both ++designed by Orson Peters. ++ ++For `rustc` we have tried many different hashing algorithms. Hashing speed is ++critical, especially for single integers. Spending more CPU cycles on a higher ++quality hash does not reduce hash collisions enough to make the compiler faster ++on real-world benchmarks. ++ ++## Usage ++ ++This crate provides `FxHashMap` and `FxHashSet` as collections. ++They are simply type aliases for their `std::collection` counterparts using the Fx hasher. ++ ++```rust ++use rustc_hash::FxHashMap; ++ ++let mut map: FxHashMap = FxHashMap::default(); ++map.insert(22, 44); ++``` ++ ++### `no_std` ++ ++The `std` feature is on by default to enable collections. ++It can be turned off in `Cargo.toml` like so: ++ ++```toml ++rustc-hash = { version = "2.0", default-features = false } ++``` +diff -Nru mesa-25.3.3/subprojects/rustc-hash-2.0.0/src/lib.rs mesa-25.3.3/subprojects/rustc-hash-2.0.0/src/lib.rs +--- mesa-25.3.3/subprojects/rustc-hash-2.0.0/src/lib.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/rustc-hash-2.0.0/src/lib.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,459 @@ ++//! A speedy, non-cryptographic hashing algorithm used by `rustc`. ++//! ++//! # Example ++//! ++//! ```rust ++//! # #[cfg(feature = "std")] ++//! # fn main() { ++//! use rustc_hash::FxHashMap; ++//! ++//! let mut map: FxHashMap = FxHashMap::default(); ++//! map.insert(22, 44); ++//! # } ++//! # #[cfg(not(feature = "std"))] ++//! # fn main() { } ++//! ``` ++ ++#![no_std] ++#![cfg_attr(feature = "nightly", feature(hasher_prefixfree_extras))] ++ ++#[cfg(feature = "std")] ++extern crate std; ++ ++#[cfg(feature = "rand")] ++extern crate rand; ++ ++#[cfg(feature = "rand")] ++mod random_state; ++ ++mod seeded_state; ++ ++use core::default::Default; ++use core::hash::{BuildHasher, Hasher}; ++#[cfg(feature = "std")] ++use std::collections::{HashMap, HashSet}; ++ ++/// Type alias for a hash map that uses the Fx hashing algorithm. ++#[cfg(feature = "std")] ++pub type FxHashMap = HashMap; ++ ++/// Type alias for a hash set that uses the Fx hashing algorithm. ++#[cfg(feature = "std")] ++pub type FxHashSet = HashSet; ++ ++#[cfg(feature = "rand")] ++pub use random_state::{FxHashMapRand, FxHashSetRand, FxRandomState}; ++ ++pub use seeded_state::FxSeededState; ++#[cfg(feature = "std")] ++pub use seeded_state::{FxHashMapSeed, FxHashSetSeed}; ++ ++/// A speedy hash algorithm for use within rustc. The hashmap in liballoc ++/// by default uses SipHash which isn't quite as speedy as we want. In the ++/// compiler we're not really worried about DOS attempts, so we use a fast ++/// non-cryptographic hash. ++/// ++/// The current implementation is a fast polynomial hash with a single ++/// bit rotation as a finishing step designed by Orson Peters. ++#[derive(Clone)] ++pub struct FxHasher { ++ hash: usize, ++} ++ ++// One might view a polynomial hash ++// m[0] * k + m[1] * k^2 + m[2] * k^3 + ... ++// as a multilinear hash with keystream k[..] ++// m[0] * k[0] + m[1] * k[1] + m[2] * k[2] + ... ++// where keystream k just happens to be generated using a multiplicative ++// congrential pseudorandom number generator (MCG). For that reason we chose a ++// constant that was found to be good for a MCG in: ++// "Computationally Easy, Spectrally Good Multipliers for Congruential ++// Pseudorandom Number Generators" by Guy Steele and Sebastiano Vigna. ++#[cfg(target_pointer_width = "64")] ++const K: usize = 0xf1357aea2e62a9c5; ++#[cfg(target_pointer_width = "32")] ++const K: usize = 0x93d765dd; ++ ++impl FxHasher { ++ /// Creates a `fx` hasher with a given seed. ++ pub const fn with_seed(seed: usize) -> FxHasher { ++ FxHasher { hash: seed } ++ } ++ ++ /// Creates a default `fx` hasher. ++ pub const fn default() -> FxHasher { ++ FxHasher { hash: 0 } ++ } ++} ++ ++impl Default for FxHasher { ++ #[inline] ++ fn default() -> FxHasher { ++ Self::default() ++ } ++} ++ ++impl FxHasher { ++ #[inline] ++ fn add_to_hash(&mut self, i: usize) { ++ self.hash = self.hash.wrapping_add(i).wrapping_mul(K); ++ } ++} ++ ++impl Hasher for FxHasher { ++ #[inline] ++ fn write(&mut self, bytes: &[u8]) { ++ // Compress the byte string to a single u64 and add to our hash. ++ self.write_u64(hash_bytes(bytes)); ++ } ++ ++ #[inline] ++ fn write_u8(&mut self, i: u8) { ++ self.add_to_hash(i as usize); ++ } ++ ++ #[inline] ++ fn write_u16(&mut self, i: u16) { ++ self.add_to_hash(i as usize); ++ } ++ ++ #[inline] ++ fn write_u32(&mut self, i: u32) { ++ self.add_to_hash(i as usize); ++ } ++ ++ #[inline] ++ fn write_u64(&mut self, i: u64) { ++ self.add_to_hash(i as usize); ++ #[cfg(target_pointer_width = "32")] ++ self.add_to_hash((i >> 32) as usize); ++ } ++ ++ #[inline] ++ fn write_u128(&mut self, i: u128) { ++ self.add_to_hash(i as usize); ++ #[cfg(target_pointer_width = "32")] ++ self.add_to_hash((i >> 32) as usize); ++ self.add_to_hash((i >> 64) as usize); ++ #[cfg(target_pointer_width = "32")] ++ self.add_to_hash((i >> 96) as usize); ++ } ++ ++ #[inline] ++ fn write_usize(&mut self, i: usize) { ++ self.add_to_hash(i); ++ } ++ ++ #[cfg(feature = "nightly")] ++ #[inline] ++ fn write_length_prefix(&mut self, _len: usize) { ++ // Most cases will specialize hash_slice to call write(), which encodes ++ // the length already in a more efficient manner than we could here. For ++ // HashDoS-resistance you would still need to include this for the ++ // non-slice collection hashes, but for the purposes of rustc we do not ++ // care and do not wish to pay the performance penalty of mixing in len ++ // for those collections. ++ } ++ ++ #[cfg(feature = "nightly")] ++ #[inline] ++ fn write_str(&mut self, s: &str) { ++ // Similarly here, write already encodes the length, so nothing special ++ // is needed. ++ self.write(s.as_bytes()) ++ } ++ ++ #[inline] ++ fn finish(&self) -> u64 { ++ // Since we used a multiplicative hash our top bits have the most ++ // entropy (with the top bit having the most, decreasing as you go). ++ // As most hash table implementations (including hashbrown) compute ++ // the bucket index from the bottom bits we want to move bits from the ++ // top to the bottom. Ideally we'd rotate left by exactly the hash table ++ // size, but as we don't know this we'll choose 20 bits, giving decent ++ // entropy up until 2^20 table sizes. On 32-bit hosts we'll dial it ++ // back down a bit to 15 bits. ++ ++ #[cfg(target_pointer_width = "64")] ++ const ROTATE: u32 = 20; ++ #[cfg(target_pointer_width = "32")] ++ const ROTATE: u32 = 15; ++ ++ self.hash.rotate_left(ROTATE) as u64 ++ ++ // A bit reversal would be even better, except hashbrown also expects ++ // good entropy in the top 7 bits and a bit reverse would fill those ++ // bits with low entropy. More importantly, bit reversals are very slow ++ // on x86-64. A byte reversal is relatively fast, but still has a 2 ++ // cycle latency on x86-64 compared to the 1 cycle latency of a rotate. ++ // It also suffers from the hashbrown-top-7-bit-issue. ++ } ++} ++ ++// Nothing special, digits of pi. ++const SEED1: u64 = 0x243f6a8885a308d3; ++const SEED2: u64 = 0x13198a2e03707344; ++const PREVENT_TRIVIAL_ZERO_COLLAPSE: u64 = 0xa4093822299f31d0; ++ ++#[inline] ++fn multiply_mix(x: u64, y: u64) -> u64 { ++ #[cfg(target_pointer_width = "64")] ++ { ++ // We compute the full u64 x u64 -> u128 product, this is a single mul ++ // instruction on x86-64, one mul plus one mulhi on ARM64. ++ let full = (x as u128) * (y as u128); ++ let lo = full as u64; ++ let hi = (full >> 64) as u64; ++ ++ // The middle bits of the full product fluctuate the most with small ++ // changes in the input. This is the top bits of lo and the bottom bits ++ // of hi. We can thus make the entire output fluctuate with small ++ // changes to the input by XOR'ing these two halves. ++ lo ^ hi ++ ++ // Unfortunately both 2^64 + 1 and 2^64 - 1 have small prime factors, ++ // otherwise combining with + or - could result in a really strong hash, as: ++ // x * y = 2^64 * hi + lo = (-1) * hi + lo = lo - hi, (mod 2^64 + 1) ++ // x * y = 2^64 * hi + lo = 1 * hi + lo = lo + hi, (mod 2^64 - 1) ++ // Multiplicative hashing is universal in a field (like mod p). ++ } ++ ++ #[cfg(target_pointer_width = "32")] ++ { ++ // u64 x u64 -> u128 product is prohibitively expensive on 32-bit. ++ // Decompose into 32-bit parts. ++ let lx = x as u32; ++ let ly = y as u32; ++ let hx = (x >> 32) as u32; ++ let hy = (y >> 32) as u32; ++ ++ // u32 x u32 -> u64 the low bits of one with the high bits of the other. ++ let afull = (lx as u64) * (hy as u64); ++ let bfull = (hx as u64) * (ly as u64); ++ ++ // Combine, swapping low/high of one of them so the upper bits of the ++ // product of one combine with the lower bits of the other. ++ afull ^ bfull.rotate_right(32) ++ } ++} ++ ++/// A wyhash-inspired non-collision-resistant hash for strings/slices designed ++/// by Orson Peters, with a focus on small strings and small codesize. ++/// ++/// The 64-bit version of this hash passes the SMHasher3 test suite on the full ++/// 64-bit output, that is, f(hash_bytes(b) ^ f(seed)) for some good avalanching ++/// permutation f() passed all tests with zero failures. When using the 32-bit ++/// version of multiply_mix this hash has a few non-catastrophic failures where ++/// there are a handful more collisions than an optimal hash would give. ++/// ++/// We don't bother avalanching here as we'll feed this hash into a ++/// multiplication after which we take the high bits, which avalanches for us. ++#[inline] ++fn hash_bytes(bytes: &[u8]) -> u64 { ++ let len = bytes.len(); ++ let mut s0 = SEED1; ++ let mut s1 = SEED2; ++ ++ if len <= 16 { ++ // XOR the input into s0, s1. ++ if len >= 8 { ++ s0 ^= u64::from_le_bytes(bytes[0..8].try_into().unwrap()); ++ s1 ^= u64::from_le_bytes(bytes[len - 8..].try_into().unwrap()); ++ } else if len >= 4 { ++ s0 ^= u32::from_le_bytes(bytes[0..4].try_into().unwrap()) as u64; ++ s1 ^= u32::from_le_bytes(bytes[len - 4..].try_into().unwrap()) as u64; ++ } else if len > 0 { ++ let lo = bytes[0]; ++ let mid = bytes[len / 2]; ++ let hi = bytes[len - 1]; ++ s0 ^= lo as u64; ++ s1 ^= ((hi as u64) << 8) | mid as u64; ++ } ++ } else { ++ // Handle bulk (can partially overlap with suffix). ++ let mut off = 0; ++ while off < len - 16 { ++ let x = u64::from_le_bytes(bytes[off..off + 8].try_into().unwrap()); ++ let y = u64::from_le_bytes(bytes[off + 8..off + 16].try_into().unwrap()); ++ ++ // Replace s1 with a mix of s0, x, and y, and s0 with s1. ++ // This ensures the compiler can unroll this loop into two ++ // independent streams, one operating on s0, the other on s1. ++ // ++ // Since zeroes are a common input we prevent an immediate trivial ++ // collapse of the hash function by XOR'ing a constant with y. ++ let t = multiply_mix(s0 ^ x, PREVENT_TRIVIAL_ZERO_COLLAPSE ^ y); ++ s0 = s1; ++ s1 = t; ++ off += 16; ++ } ++ ++ let suffix = &bytes[len - 16..]; ++ s0 ^= u64::from_le_bytes(suffix[0..8].try_into().unwrap()); ++ s1 ^= u64::from_le_bytes(suffix[8..16].try_into().unwrap()); ++ } ++ ++ multiply_mix(s0, s1) ^ (len as u64) ++} ++ ++/// An implementation of [`BuildHasher`] that produces [`FxHasher`]s. ++/// ++/// ``` ++/// use std::hash::BuildHasher; ++/// use rustc_hash::FxBuildHasher; ++/// assert_ne!(FxBuildHasher.hash_one(1), FxBuildHasher.hash_one(2)); ++/// ``` ++#[derive(Copy, Clone, Default)] ++pub struct FxBuildHasher; ++ ++impl BuildHasher for FxBuildHasher { ++ type Hasher = FxHasher; ++ fn build_hasher(&self) -> FxHasher { ++ FxHasher::default() ++ } ++} ++ ++#[cfg(test)] ++mod tests { ++ #[cfg(not(any(target_pointer_width = "64", target_pointer_width = "32")))] ++ compile_error!("The test suite only supports 64 bit and 32 bit usize"); ++ ++ use crate::{FxBuildHasher, FxHasher}; ++ use core::hash::{BuildHasher, Hash, Hasher}; ++ ++ macro_rules! test_hash { ++ ( ++ $( ++ hash($value:expr) == $result:expr, ++ )* ++ ) => { ++ $( ++ assert_eq!(FxBuildHasher.hash_one($value), $result); ++ )* ++ }; ++ } ++ ++ const B32: bool = cfg!(target_pointer_width = "32"); ++ ++ #[test] ++ fn unsigned() { ++ test_hash! { ++ hash(0_u8) == 0, ++ hash(1_u8) == if B32 { 3001993707 } else { 12583873379513078615 }, ++ hash(100_u8) == if B32 { 3844759569 } else { 4008740938959785536 }, ++ hash(u8::MAX) == if B32 { 999399879 } else { 17600987023830959190 }, ++ ++ hash(0_u16) == 0, ++ hash(1_u16) == if B32 { 3001993707 } else { 12583873379513078615 }, ++ hash(100_u16) == if B32 { 3844759569 } else { 4008740938959785536 }, ++ hash(u16::MAX) == if B32 { 3440503042 } else { 4001367065645062987 }, ++ ++ hash(0_u32) == 0, ++ hash(1_u32) == if B32 { 3001993707 } else { 12583873379513078615 }, ++ hash(100_u32) == if B32 { 3844759569 } else { 4008740938959785536 }, ++ hash(u32::MAX) == if B32 { 1293006356 } else { 17126373362251322066 }, ++ ++ hash(0_u64) == 0, ++ hash(1_u64) == if B32 { 275023839 } else { 12583873379513078615 }, ++ hash(100_u64) == if B32 { 1732383522 } else { 4008740938959785536 }, ++ hash(u64::MAX) == if B32 { 1017982517 } else { 5862870694197521576 }, ++ ++ hash(0_u128) == 0, ++ hash(1_u128) == if B32 { 1860738631 } else { 12885773367358079611 }, ++ hash(100_u128) == if B32 { 1389515751 } else { 15751995649841559633 }, ++ hash(u128::MAX) == if B32 { 2156022013 } else { 11423841400550042156 }, ++ ++ hash(0_usize) == 0, ++ hash(1_usize) == if B32 { 3001993707 } else { 12583873379513078615 }, ++ hash(100_usize) == if B32 { 3844759569 } else { 4008740938959785536 }, ++ hash(usize::MAX) == if B32 { 1293006356 } else { 5862870694197521576 }, ++ } ++ } ++ ++ #[test] ++ fn signed() { ++ test_hash! { ++ hash(i8::MIN) == if B32 { 2000713177 } else { 5869058164817243095 }, ++ hash(0_i8) == 0, ++ hash(1_i8) == if B32 { 3001993707 } else { 12583873379513078615 }, ++ hash(100_i8) == if B32 { 3844759569 } else { 4008740938959785536 }, ++ hash(i8::MAX) == if B32 { 3293686765 } else { 11731928859014764671 }, ++ ++ hash(i16::MIN) == if B32 { 1073764727 } else { 8292620222579070801 }, ++ hash(0_i16) == 0, ++ hash(1_i16) == if B32 { 3001993707 } else { 12583873379513078615 }, ++ hash(100_i16) == if B32 { 3844759569 } else { 4008740938959785536 }, ++ hash(i16::MAX) == if B32 { 2366738315 } else { 14155490916776592377 }, ++ ++ hash(i32::MIN) == if B32 { 16384 } else { 5631751334026900245 }, ++ hash(0_i32) == 0, ++ hash(1_i32) == if B32 { 3001993707 } else { 12583873379513078615 }, ++ hash(100_i32) == if B32 { 3844759569 } else { 4008740938959785536 }, ++ hash(i32::MAX) == if B32 { 1293022740 } else { 11494622028224421821 }, ++ ++ hash(i64::MIN) == if B32 { 16384 } else { 524288 }, ++ hash(0_i64) == 0, ++ hash(1_i64) == if B32 { 275023839 } else { 12583873379513078615 }, ++ hash(100_i64) == if B32 { 1732383522 } else { 4008740938959785536 }, ++ hash(i64::MAX) == if B32 { 1017998901 } else { 5862870694198045864 }, ++ ++ hash(i128::MIN) == if B32 { 16384 } else { 524288 }, ++ hash(0_i128) == 0, ++ hash(1_i128) == if B32 { 1860738631 } else { 12885773367358079611 }, ++ hash(100_i128) == if B32 { 1389515751 } else { 15751995649841559633 }, ++ hash(i128::MAX) == if B32 { 2156005629 } else { 11423841400549517868 }, ++ ++ hash(isize::MIN) == if B32 { 16384 } else { 524288 }, ++ hash(0_isize) == 0, ++ hash(1_isize) == if B32 { 3001993707 } else { 12583873379513078615 }, ++ hash(100_isize) == if B32 { 3844759569 } else { 4008740938959785536 }, ++ hash(isize::MAX) == if B32 { 1293022740 } else { 5862870694198045864 }, ++ } ++ } ++ ++ // Avoid relying on any `Hash` implementations in the standard library. ++ struct HashBytes(&'static [u8]); ++ impl Hash for HashBytes { ++ fn hash(&self, state: &mut H) { ++ state.write(self.0); ++ } ++ } ++ ++ #[test] ++ fn bytes() { ++ test_hash! { ++ hash(HashBytes(&[])) == if B32 { 2673204745 } else { 5175017818631658678 }, ++ hash(HashBytes(&[0])) == if B32 { 2948228584 } else { 11037888512829180254 }, ++ hash(HashBytes(&[0, 0, 0, 0, 0, 0])) == if B32 { 3223252423 } else { 6891281800865632452 }, ++ hash(HashBytes(&[1])) == if B32 { 2943445104 } else { 4127763515449136980 }, ++ hash(HashBytes(&[2])) == if B32 { 1055423297 } else { 11322700005987241762 }, ++ hash(HashBytes(b"uwu")) == if B32 { 2699662140 } else { 2129615206728903013 }, ++ hash(HashBytes(b"These are some bytes for testing rustc_hash.")) == if B32 { 2303640537 } else { 5513083560975408889 }, ++ } ++ } ++ ++ #[test] ++ fn with_seed_actually_different() { ++ let seeds = [ ++ [1, 2], ++ [42, 17], ++ [124436707, 99237], ++ [usize::MIN, usize::MAX], ++ ]; ++ ++ for [a_seed, b_seed] in seeds { ++ let a = || FxHasher::with_seed(a_seed); ++ let b = || FxHasher::with_seed(b_seed); ++ ++ for x in u8::MIN..=u8::MAX { ++ let mut a = a(); ++ let mut b = b(); ++ ++ x.hash(&mut a); ++ x.hash(&mut b); ++ ++ assert_ne!(a.finish(), b.finish()) ++ } ++ } ++ } ++} +diff -Nru mesa-25.3.3/subprojects/rustc-hash-2.0.0/src/random_state.rs mesa-25.3.3/subprojects/rustc-hash-2.0.0/src/random_state.rs +--- mesa-25.3.3/subprojects/rustc-hash-2.0.0/src/random_state.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/rustc-hash-2.0.0/src/random_state.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,92 @@ ++use std::collections::{HashMap, HashSet}; ++ ++use crate::FxHasher; ++ ++/// Type alias for a hashmap using the `fx` hash algorithm with [`FxRandomState`]. ++pub type FxHashMapRand = HashMap; ++ ++/// Type alias for a hashmap using the `fx` hash algorithm with [`FxRandomState`]. ++pub type FxHashSetRand = HashSet; ++ ++/// `FxRandomState` is an alternative state for `HashMap` types. ++/// ++/// A particular instance `FxRandomState` will create the same instances of ++/// [`Hasher`], but the hashers created by two different `FxRandomState` ++/// instances are unlikely to produce the same result for the same values. ++pub struct FxRandomState { ++ seed: usize, ++} ++ ++impl FxRandomState { ++ /// Constructs a new `FxRandomState` that is initialized with random seed. ++ pub fn new() -> FxRandomState { ++ use rand::Rng; ++ use std::{cell::Cell, thread_local}; ++ ++ // This mirrors what `std::collections::hash_map::RandomState` does, as of 2024-01-14. ++ // ++ // Basically ++ // 1. Cache result of the rng in a thread local, so repeatedly ++ // creating maps is cheaper ++ // 2. Change the cached result on every creation, so maps created ++ // on the same thread don't have the same iteration order ++ thread_local!(static SEED: Cell = { ++ Cell::new(rand::thread_rng().gen()) ++ }); ++ ++ SEED.with(|seed| { ++ let s = seed.get(); ++ seed.set(s.wrapping_add(1)); ++ FxRandomState { seed: s } ++ }) ++ } ++} ++ ++impl core::hash::BuildHasher for FxRandomState { ++ type Hasher = FxHasher; ++ ++ fn build_hasher(&self) -> Self::Hasher { ++ FxHasher::with_seed(self.seed) ++ } ++} ++ ++impl Default for FxRandomState { ++ fn default() -> Self { ++ Self::new() ++ } ++} ++ ++#[cfg(test)] ++mod tests { ++ use std::thread; ++ ++ use crate::FxHashMapRand; ++ ++ #[test] ++ fn random_states_are_different() { ++ let a = FxHashMapRand::<&str, u32>::default(); ++ let b = FxHashMapRand::<&str, u32>::default(); ++ ++ // That's the whole point of them being random! ++ // ++ // N.B.: `FxRandomState` uses a thread-local set to a random value and then incremented, ++ // which means that this is *guaranteed* to pass :> ++ assert_ne!(a.hasher().seed, b.hasher().seed); ++ } ++ ++ #[test] ++ fn random_states_are_different_cross_thread() { ++ // This is similar to the test above, but uses two different threads, so they both get ++ // completely random, unrelated values. ++ // ++ // This means that this test is technically flaky, but the probability of it failing is ++ // `1 / 2.pow(bit_size_of::())`. Or 1/1.7e19 for 64 bit platforms or 1/4294967295 ++ // for 32 bit platforms. I suppose this is acceptable. ++ let a = FxHashMapRand::<&str, u32>::default(); ++ let b = thread::spawn(|| FxHashMapRand::<&str, u32>::default()) ++ .join() ++ .unwrap(); ++ ++ assert_ne!(a.hasher().seed, b.hasher().seed); ++ } ++} +diff -Nru mesa-25.3.3/subprojects/rustc-hash-2.0.0/src/seeded_state.rs mesa-25.3.3/subprojects/rustc-hash-2.0.0/src/seeded_state.rs +--- mesa-25.3.3/subprojects/rustc-hash-2.0.0/src/seeded_state.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/rustc-hash-2.0.0/src/seeded_state.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,53 @@ ++use crate::FxHasher; ++ ++/// Type alias for a hashmap using the `fx` hash algorithm with [`FxSeededState`]. ++#[cfg(feature = "std")] ++pub type FxHashMapSeed = std::collections::HashMap; ++ ++/// Type alias for a hashmap using the `fx` hash algorithm with [`FxSeededState`]. ++#[cfg(feature = "std")] ++pub type FxHashSetSeed = std::collections::HashSet; ++ ++/// [`FxSetState`] is an alternative state for `HashMap` types, allowing to use [`FxHasher`] with a set seed. ++/// ++/// ``` ++/// # use std::collections::HashMap; ++/// use rustc_hash::FxSeededState; ++/// ++/// let mut map = HashMap::with_hasher(FxSeededState::with_seed(12)); ++/// map.insert(15, 610); ++/// assert_eq!(map[&15], 610); ++/// ``` ++pub struct FxSeededState { ++ seed: usize, ++} ++ ++impl FxSeededState { ++ /// Constructs a new `FxSeededState` that is initialized with a `seed`. ++ pub const fn with_seed(seed: usize) -> FxSeededState { ++ Self { seed } ++ } ++} ++ ++impl core::hash::BuildHasher for FxSeededState { ++ type Hasher = FxHasher; ++ ++ fn build_hasher(&self) -> Self::Hasher { ++ FxHasher::with_seed(self.seed) ++ } ++} ++ ++#[cfg(test)] ++mod tests { ++ use core::hash::BuildHasher; ++ ++ use crate::FxSeededState; ++ ++ #[test] ++ fn different_states_are_different() { ++ let a = FxSeededState::with_seed(1); ++ let b = FxSeededState::with_seed(2); ++ ++ assert_ne!(a.build_hasher().hash, b.build_hasher().hash); ++ } ++} +diff -Nru mesa-25.3.3/subprojects/rustc-hash-2-rs.wrap mesa-25.3.3/subprojects/rustc-hash-2-rs.wrap +--- mesa-25.3.3/subprojects/rustc-hash-2-rs.wrap 2026-01-01 13:34:04.000000000 -0500 ++++ mesa-25.3.3/subprojects/rustc-hash-2-rs.wrap 2026-05-29 13:40:56.000000000 -0500 +@@ -1,6 +1,4 @@ + [wrap-file] +-directory = rustc-hash-2.1.1 +-source_url = https://crates.io/api/v1/crates/rustc-hash/2.1.1/download +-source_filename = rustc-hash-2.1.1.tar.gz +-source_hash = 357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d ++directory = rustc-hash-2.0.0 + patch_directory = rustc-hash-2-rs ++ +diff -Nru mesa-25.3.3/subprojects/syn-2.0.98/benches/file.rs mesa-25.3.3/subprojects/syn-2.0.98/benches/file.rs +--- mesa-25.3.3/subprojects/syn-2.0.98/benches/file.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/syn-2.0.98/benches/file.rs 2025-04-06 23:47:11.000000000 -0500 +@@ -0,0 +1,59 @@ ++/* ++// $ cargo bench --features full,test --bench file ++ ++#![feature(rustc_private, test)] ++#![recursion_limit = "1024"] ++#![allow( ++ clippy::items_after_statements, ++ clippy::manual_let_else, ++ clippy::match_like_matches_macro, ++ clippy::missing_panics_doc, ++ clippy::must_use_candidate, ++ clippy::needless_lifetimes, ++ clippy::uninlined_format_args ++)] ++ ++extern crate test; ++ ++#[macro_use] ++#[path = "../tests/macros/mod.rs"] ++mod macros; ++ ++#[allow(dead_code)] ++#[path = "../tests/repo/mod.rs"] ++mod repo; ++ ++use proc_macro2::{Span, TokenStream}; ++use std::fs; ++use std::str::FromStr; ++use syn::parse::{ParseStream, Parser}; ++use test::Bencher; ++ ++const FILE: &str = "tests/rust/library/core/src/str/mod.rs"; ++ ++fn get_tokens() -> TokenStream { ++ repo::clone_rust(); ++ let content = fs::read_to_string(FILE).unwrap(); ++ TokenStream::from_str(&content).unwrap() ++} ++ ++#[bench] ++fn baseline(b: &mut Bencher) { ++ let tokens = get_tokens(); ++ b.iter(|| drop(tokens.clone())); ++} ++ ++#[bench] ++fn create_token_buffer(b: &mut Bencher) { ++ let tokens = get_tokens(); ++ fn immediate_fail(_input: ParseStream) -> syn::Result<()> { ++ Err(syn::Error::new(Span::call_site(), "")) ++ } ++ b.iter(|| immediate_fail.parse2(tokens.clone())); ++} ++ ++#[bench] ++fn parse_file(b: &mut Bencher) { ++ let tokens = get_tokens(); ++ b.iter(|| syn::parse2::(tokens.clone())); ++}*/ +diff -Nru mesa-25.3.3/subprojects/syn-2.0.98/benches/rust.rs mesa-25.3.3/subprojects/syn-2.0.98/benches/rust.rs +--- mesa-25.3.3/subprojects/syn-2.0.98/benches/rust.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/syn-2.0.98/benches/rust.rs 2025-04-06 23:47:11.000000000 -0500 +@@ -0,0 +1,198 @@ ++fn main() { ++ eprintln!("Debian: this bench is disabled due to dependency on reqwest.\n\ ++ To run it, please unapply debian/patches/remove-reqwest.patch."); ++/* ++// $ cargo bench --features full,test --bench rust ++// ++// Syn only, useful for profiling: ++// $ RUSTFLAGS='--cfg syn_only' cargo build --release --features full,test --bench rust ++ ++#![cfg_attr(not(syn_only), feature(rustc_private))] ++#![recursion_limit = "1024"] ++#![allow( ++ clippy::arc_with_non_send_sync, ++ clippy::cast_lossless, ++ clippy::let_underscore_untyped, ++ clippy::manual_let_else, ++ clippy::match_like_matches_macro, ++ clippy::needless_lifetimes, ++ clippy::uninlined_format_args, ++ clippy::unnecessary_wraps ++)] ++ ++#[macro_use] ++#[path = "../tests/macros/mod.rs"] ++mod macros; ++ ++#[allow(dead_code)] ++#[path = "../tests/repo/mod.rs"] ++mod repo; ++ ++use std::fs; ++use std::path::Path; ++use std::time::{Duration, Instant}; ++ ++#[cfg(not(syn_only))] ++mod tokenstream_parse { ++ use proc_macro2::TokenStream; ++ use std::path::Path; ++ use std::str::FromStr; ++ ++ pub fn bench(_path: &Path, content: &str) -> Result<(), ()> { ++ TokenStream::from_str(content).map(drop).map_err(drop) ++ } ++} ++ ++mod syn_parse { ++ use std::path::Path; ++ ++ pub fn bench(_path: &Path, content: &str) -> Result<(), ()> { ++ syn::parse_file(content).map(drop).map_err(drop) ++ } ++} ++ ++#[cfg(not(syn_only))] ++mod librustc_parse { ++ extern crate rustc_data_structures; ++ extern crate rustc_driver; ++ extern crate rustc_error_messages; ++ extern crate rustc_errors; ++ extern crate rustc_parse; ++ extern crate rustc_session; ++ extern crate rustc_span; ++ ++ use crate::repo; ++ use rustc_data_structures::sync::Lrc; ++ use rustc_error_messages::FluentBundle; ++ use rustc_errors::emitter::Emitter; ++ use rustc_errors::registry::Registry; ++ use rustc_errors::translation::Translate; ++ use rustc_errors::{DiagCtxt, DiagInner}; ++ use rustc_session::parse::ParseSess; ++ use rustc_span::source_map::{FilePathMapping, SourceMap}; ++ use rustc_span::FileName; ++ use std::path::Path; ++ ++ pub fn bench(path: &Path, content: &str) -> Result<(), ()> { ++ struct SilentEmitter; ++ ++ impl Emitter for SilentEmitter { ++ fn emit_diagnostic(&mut self, _diag: DiagInner, _registry: &Registry) {} ++ fn source_map(&self) -> Option<&SourceMap> { ++ None ++ } ++ } ++ ++ impl Translate for SilentEmitter { ++ fn fluent_bundle(&self) -> Option<&FluentBundle> { ++ None ++ } ++ fn fallback_fluent_bundle(&self) -> &FluentBundle { ++ panic!("silent emitter attempted to translate a diagnostic"); ++ } ++ } ++ ++ let edition = repo::edition(path).parse().unwrap(); ++ rustc_span::create_session_if_not_set_then(edition, |_| { ++ let source_map = Lrc::new(SourceMap::new(FilePathMapping::empty())); ++ let emitter = Box::new(SilentEmitter); ++ let handler = DiagCtxt::new(emitter); ++ let sess = ParseSess::with_dcx(handler, source_map); ++ let name = FileName::Custom("bench".to_owned()); ++ let mut parser = ++ rustc_parse::new_parser_from_source_str(&sess, name, content.to_owned()).unwrap(); ++ if let Err(diagnostic) = parser.parse_crate_mod() { ++ diagnostic.cancel(); ++ return Err(()); ++ } ++ Ok(()) ++ }) ++ } ++} ++ ++#[cfg(not(syn_only))] ++mod read_from_disk { ++ use std::path::Path; ++ ++ pub fn bench(_path: &Path, content: &str) -> Result<(), ()> { ++ let _ = content; ++ Ok(()) ++ } ++} ++ ++fn exec(mut codepath: impl FnMut(&Path, &str) -> Result<(), ()>) -> Duration { ++ let begin = Instant::now(); ++ let mut success = 0; ++ let mut total = 0; ++ ++ ["tests/rust/compiler", "tests/rust/library"] ++ .iter() ++ .flat_map(|dir| { ++ walkdir::WalkDir::new(dir) ++ .into_iter() ++ .filter_entry(repo::base_dir_filter) ++ }) ++ .for_each(|entry| { ++ let entry = entry.unwrap(); ++ let path = entry.path(); ++ if path.is_dir() { ++ return; ++ } ++ let content = fs::read_to_string(path).unwrap(); ++ let ok = codepath(path, &content).is_ok(); ++ success += ok as usize; ++ total += 1; ++ if !ok { ++ eprintln!("FAIL {}", path.display()); ++ } ++ }); ++ ++ assert_eq!(success, total); ++ begin.elapsed() ++} ++ ++fn main() { ++ repo::clone_rust(); ++ ++ macro_rules! testcases { ++ ($($(#[$cfg:meta])* $name:ident,)*) => { ++ [ ++ $( ++ $(#[$cfg])* ++ (stringify!($name), $name::bench as fn(&Path, &str) -> Result<(), ()>), ++ )* ++ ] ++ }; ++ } ++ ++ #[cfg(not(syn_only))] ++ { ++ let mut lines = 0; ++ let mut files = 0; ++ exec(|_path, content| { ++ lines += content.lines().count(); ++ files += 1; ++ Ok(()) ++ }); ++ eprintln!("\n{} lines in {} files", lines, files); ++ } ++ ++ for (name, f) in testcases!( ++ #[cfg(not(syn_only))] ++ read_from_disk, ++ #[cfg(not(syn_only))] ++ tokenstream_parse, ++ syn_parse, ++ #[cfg(not(syn_only))] ++ librustc_parse, ++ ) { ++ eprint!("{:20}", format!("{}:", name)); ++ let elapsed = exec(f); ++ eprintln!( ++ "elapsed={}.{:03}s", ++ elapsed.as_secs(), ++ elapsed.subsec_millis(), ++ ); ++ } ++ eprintln!();*/ ++} +diff -Nru mesa-25.3.3/subprojects/syn-2.0.98/.cargo-checksum.json mesa-25.3.3/subprojects/syn-2.0.98/.cargo-checksum.json +--- mesa-25.3.3/subprojects/syn-2.0.98/.cargo-checksum.json 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/syn-2.0.98/.cargo-checksum.json 2025-04-06 23:47:11.000000000 -0500 +@@ -0,0 +1 @@ ++{"package":"Could not get crate checksum","files":{}} +diff -Nru mesa-25.3.3/subprojects/syn-2.0.98/Cargo.toml mesa-25.3.3/subprojects/syn-2.0.98/Cargo.toml +--- mesa-25.3.3/subprojects/syn-2.0.98/Cargo.toml 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/syn-2.0.98/Cargo.toml 2025-04-06 23:47:11.000000000 -0500 +@@ -0,0 +1,271 @@ ++# THIS FILE IS AUTOMATICALLY GENERATED BY CARGO ++# ++# When uploading crates to the registry Cargo will automatically ++# "normalize" Cargo.toml files for maximal compatibility ++# with all versions of Cargo and also rewrite `path` dependencies ++# to registry (e.g., crates.io) dependencies. ++# ++# If you are reading this file be aware that the original Cargo.toml ++# will likely look very different (and much more reasonable). ++# See Cargo.toml.orig for the original contents. ++ ++[package] ++edition = "2021" ++rust-version = "1.61" ++name = "syn" ++version = "2.0.98" ++authors = ["David Tolnay "] ++build = false ++include = [ ++ "/benches/**", ++ "/Cargo.toml", ++ "/LICENSE-APACHE", ++ "/LICENSE-MIT", ++ "/README.md", ++ "/src/**", ++ "/tests/**", ++] ++autolib = false ++autobins = false ++autoexamples = false ++autotests = false ++autobenches = false ++description = "Parser for Rust source code" ++documentation = "https://docs.rs/syn" ++readme = "README.md" ++keywords = [ ++ "macros", ++ "syn", ++] ++categories = [ ++ "development-tools::procedural-macro-helpers", ++ "parser-implementations", ++] ++license = "MIT OR Apache-2.0" ++repository = "https://github.com/dtolnay/syn" ++ ++[package.metadata.docs.rs] ++all-features = true ++rustdoc-args = [ ++ "--generate-link-to-definition", ++ "--extend-css=src/gen/token.css", ++] ++targets = ["x86_64-unknown-linux-gnu"] ++ ++[package.metadata.playground] ++features = [ ++ "full", ++ "visit", ++ "visit-mut", ++ "fold", ++ "extra-traits", ++] ++ ++[features] ++clone-impls = [] ++default = [ ++ "derive", ++ "parsing", ++ "printing", ++ "clone-impls", ++ "proc-macro", ++] ++derive = [] ++extra-traits = [] ++fold = [] ++full = [] ++parsing = [] ++printing = ["dep:quote"] ++proc-macro = [ ++ "proc-macro2/proc-macro", ++ "quote?/proc-macro", ++] ++visit = [] ++visit-mut = [] ++ ++[lib] ++name = "syn" ++path = "src/lib.rs" ++doc-scrape-examples = false ++ ++[[test]] ++name = "regression" ++path = "tests/regression.rs" ++required-features = ["parsing", "full", "extra-traits"] ++ ++[[test]] ++name = "test_asyncness" ++path = "tests/test_asyncness.rs" ++required-features = ["full", "derive"] ++ ++[[test]] ++name = "test_attribute" ++path = "tests/test_attribute.rs" ++required-features = ["full", "derive"] ++ ++[[test]] ++name = "test_derive_input" ++path = "tests/test_derive_input.rs" ++required-features = ["full", "extra-traits", "derive"] ++ ++#[[test]] ++#name = "test_expr" ++#path = "tests/test_expr.rs" ++#required-features = ["full", "extra-traits", "derive"] ++ ++[[test]] ++name = "test_generics" ++path = "tests/test_generics.rs" ++required-features = ["full", "derive"] ++ ++[[test]] ++name = "test_grouping" ++path = "tests/test_grouping.rs" ++required-features = ["full", "derive"] ++ ++[[test]] ++name = "test_ident" ++path = "tests/test_ident.rs" ++required-features = ["parsing"] ++ ++[[test]] ++name = "test_item" ++path = "tests/test_item.rs" ++required-features = ["full", "derive"] ++ ++[[test]] ++name = "test_iterators" ++path = "tests/test_iterators.rs" ++required-features = ["full", "derive"] ++ ++[[test]] ++name = "test_lit" ++path = "tests/test_lit.rs" ++required-features = ["full", "extra-traits", "derive"] ++ ++[[test]] ++name = "test_meta" ++path = "tests/test_meta.rs" ++required-features = ["full", "extra-traits", "derive"] ++ ++[[test]] ++name = "test_parse_buffer" ++path = "tests/test_parse_buffer.rs" ++required-features = ["parsing"] ++ ++[[test]] ++name = "test_parse_quote" ++path = "tests/test_parse_quote.rs" ++ ++[[test]] ++name = "test_parse_stream" ++path = "tests/test_parse_stream.rs" ++required-features = ["parsing"] ++ ++[[test]] ++name = "test_pat" ++path = "tests/test_pat.rs" ++required-features = ["full", "extra-traits", "derive"] ++ ++[[test]] ++name = "test_path" ++path = "tests/test_path.rs" ++required-features = ["full", "derive"] ++ ++[[test]] ++name = "test_receiver" ++path = "tests/test_receiver.rs" ++required-features = ["full", "derive"] ++ ++[[test]] ++name = "test_shebang" ++path = "tests/test_shebang.rs" ++required-features = ["full", "derive"] ++ ++[[test]] ++name = "test_size" ++path = "tests/test_size.rs" ++required-features = ["full"] ++ ++[[test]] ++name = "test_stmt" ++path = "tests/test_stmt.rs" ++required-features = ["full", "derive"] ++ ++[[test]] ++name = "test_token_trees" ++path = "tests/test_token_trees.rs" ++required-features = ["full", "derive"] ++ ++[[test]] ++name = "test_ty" ++path = "tests/test_ty.rs" ++required-features = ["full", "extra-traits", "derive"] ++ ++#[[test]] ++#name = "test_unparenthesize" ++#path = "tests/test_unparenthesize.rs" ++#required-features = ["full", "visit-mut", "parsing", "derive"] ++ ++[[test]] ++name = "test_visibility" ++path = "tests/test_visibility.rs" ++required-features = ["full", "extra-traits", "derive"] ++ ++[[test]] ++name = "zzz_stable" ++path = "tests/zzz_stable.rs" ++ ++[[bench]] ++name = "file" ++path = "benches/file.rs" ++required-features = [ ++ "full", ++ "parsing", ++] ++ ++[dependencies.proc-macro2] ++version = "1.0.91" ++default-features = false ++ ++[dependencies.quote] ++version = "1.0.35" ++optional = true ++default-features = false ++ ++[dependencies.unicode-ident] ++version = "1" ++ ++[dev-dependencies.anyhow] ++version = "1" ++ ++[dev-dependencies.automod] ++version = "1" ++ ++[dev-dependencies.insta] ++version = "1" ++ ++[dev-dependencies.ref-cast] ++version = "1" ++ ++[dev-dependencies.rustversion] ++version = "1" ++ ++[dev-dependencies.termcolor] ++version = "1" ++ ++[target."cfg(not(miri))".dev-dependencies.flate2] ++version = "1" ++ ++[target."cfg(not(miri))".dev-dependencies.rayon] ++version = "1" ++ ++#[target."cfg(not(miri))".dev-dependencies.reqwest] ++#version = "0.12" ++#features = ["blocking"] ++ ++[target."cfg(not(miri))".dev-dependencies.tar] ++version = "0.4.16" ++ ++[target."cfg(not(miri))".dev-dependencies.walkdir] ++version = "2.3.2" +diff -Nru mesa-25.3.3/subprojects/syn-2.0.98/.cargo_vcs_info.json mesa-25.3.3/subprojects/syn-2.0.98/.cargo_vcs_info.json +--- mesa-25.3.3/subprojects/syn-2.0.98/.cargo_vcs_info.json 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/syn-2.0.98/.cargo_vcs_info.json 2025-04-06 23:47:11.000000000 -0500 +@@ -0,0 +1,6 @@ ++{ ++ "git": { ++ "sha1": "71f3808e0dba5a9dc8255ecc1c63a5da8b61b3e4" ++ }, ++ "path_in_vcs": "" ++} +\ No hay ningún carácter de nueva línea al final del archivo +diff -Nru mesa-25.3.3/subprojects/syn-2.0.98/debian/patches/disable-tests-compiler-internals.patch mesa-25.3.3/subprojects/syn-2.0.98/debian/patches/disable-tests-compiler-internals.patch +--- mesa-25.3.3/subprojects/syn-2.0.98/debian/patches/disable-tests-compiler-internals.patch 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/syn-2.0.98/debian/patches/disable-tests-compiler-internals.patch 2025-04-06 23:47:11.000000000 -0500 +@@ -0,0 +1,34 @@ ++Index: syn/Cargo.toml ++=================================================================== ++--- syn.orig/Cargo.toml +++++ syn/Cargo.toml ++@@ -108,10 +108,10 @@ name = "test_derive_input" ++ path = "tests/test_derive_input.rs" ++ required-features = ["full", "extra-traits", "derive"] ++ ++-[[test]] ++-name = "test_expr" ++-path = "tests/test_expr.rs" ++-required-features = ["full", "extra-traits", "derive"] +++#[[test]] +++#name = "test_expr" +++#path = "tests/test_expr.rs" +++#required-features = ["full", "extra-traits", "derive"] ++ ++ [[test]] ++ name = "test_generics" ++@@ -202,10 +202,10 @@ name = "test_ty" ++ path = "tests/test_ty.rs" ++ required-features = ["full", "extra-traits", "derive"] ++ ++-[[test]] ++-name = "test_unparenthesize" ++-path = "tests/test_unparenthesize.rs" ++-required-features = ["full", "visit-mut", "parsing", "derive"] +++#[[test]] +++#name = "test_unparenthesize" +++#path = "tests/test_unparenthesize.rs" +++#required-features = ["full", "visit-mut", "parsing", "derive"] ++ ++ [[test]] ++ name = "test_visibility" +diff -Nru mesa-25.3.3/subprojects/syn-2.0.98/debian/patches/disable-tests-requiring-nightly.patch mesa-25.3.3/subprojects/syn-2.0.98/debian/patches/disable-tests-requiring-nightly.patch +--- mesa-25.3.3/subprojects/syn-2.0.98/debian/patches/disable-tests-requiring-nightly.patch 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/syn-2.0.98/debian/patches/disable-tests-requiring-nightly.patch 2025-04-06 23:47:11.000000000 -0500 +@@ -0,0 +1,22 @@ ++diff --git a/tests/test_lit.rs b/tests/test_lit.rs ++index a7194ab..deaaeb0 100644 ++--- a/tests/test_lit.rs +++++ b/tests/test_lit.rs ++@@ -103,7 +103,7 @@ fn byte_strings() { ++ test_byte_string("br##\"...\"##q", b"..."); ++ } ++ ++-#[test] +++/*#[test] ++ fn c_strings() { ++ #[track_caller] ++ fn test_c_string(s: &str, value: &CStr) { ++@@ -140,7 +140,7 @@ fn c_strings() { ++ r#" c"hello\x80我叫\u{1F980}" "#, // from the RFC ++ c"hello\x80我叫\u{1F980}", ++ ); ++-} +++}*/ ++ ++ #[test] ++ fn bytes() { +diff -Nru mesa-25.3.3/subprojects/syn-2.0.98/debian/patches/disable-unparenthesize-test.patch mesa-25.3.3/subprojects/syn-2.0.98/debian/patches/disable-unparenthesize-test.patch +--- mesa-25.3.3/subprojects/syn-2.0.98/debian/patches/disable-unparenthesize-test.patch 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/syn-2.0.98/debian/patches/disable-unparenthesize-test.patch 2025-04-06 23:47:11.000000000 -0500 +@@ -0,0 +1,22 @@ ++diff --git a/tests/test_unparenthesize.rs b/tests/test_unparenthesize.rs ++index 5db2e57..dad2be6 100644 ++--- a/tests/test_unparenthesize.rs +++++ b/tests/test_unparenthesize.rs ++@@ -22,7 +22,7 @@ ++ mod common; ++ mod repo; ++ ++-#[test] +++/*#[test] ++ fn test_unparenthesize() { ++ repo::rayon_init(); ++ repo::clone_rust(); ++@@ -35,7 +35,7 @@ ++ if failed > 0 { ++ panic!("{} failures", failed); ++ } ++-} +++}*/ ++ ++ fn test(path: &Path, failed: &AtomicUsize) { ++ let content = fs::read_to_string(path).unwrap(); +diff -Nru mesa-25.3.3/subprojects/syn-2.0.98/debian/patches/fix-test-feature-gates.patch mesa-25.3.3/subprojects/syn-2.0.98/debian/patches/fix-test-feature-gates.patch +--- mesa-25.3.3/subprojects/syn-2.0.98/debian/patches/fix-test-feature-gates.patch 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/syn-2.0.98/debian/patches/fix-test-feature-gates.patch 2025-04-06 23:47:11.000000000 -0500 +@@ -0,0 +1,157 @@ ++diff --git a/Cargo.toml b/Cargo.toml ++index 8cb5f06..0af6cb7 100644 ++--- a/Cargo.toml +++++ b/Cargo.toml ++@@ -91,54 +91,67 @@ ++ [[test]] ++ name = "regression" ++ path = "tests/regression.rs" +++required-features = ["parsing", "full", "extra-traits"] ++ ++ [[test]] ++ name = "test_asyncness" ++ path = "tests/test_asyncness.rs" +++required-features = ["full", "derive"] ++ ++ [[test]] ++ name = "test_attribute" ++ path = "tests/test_attribute.rs" +++required-features = ["full", "derive"] ++ ++ [[test]] ++ name = "test_derive_input" ++ path = "tests/test_derive_input.rs" +++required-features = ["full", "extra-traits", "derive"] ++ ++ [[test]] ++ name = "test_expr" ++ path = "tests/test_expr.rs" +++required-features = ["full", "extra-traits", "derive"] ++ ++ [[test]] ++ name = "test_generics" ++ path = "tests/test_generics.rs" +++required-features = ["full", "derive"] ++ ++ [[test]] ++ name = "test_grouping" ++ path = "tests/test_grouping.rs" +++required-features = ["full", "derive"] ++ ++ [[test]] ++ name = "test_ident" ++ path = "tests/test_ident.rs" +++required-features = ["parsing"] ++ ++ [[test]] ++ name = "test_item" ++ path = "tests/test_item.rs" +++required-features = ["full", "derive"] ++ ++ [[test]] ++ name = "test_iterators" ++ path = "tests/test_iterators.rs" +++required-features = ["full", "derive"] ++ ++ [[test]] ++ name = "test_lit" ++ path = "tests/test_lit.rs" +++required-features = ["full", "extra-traits", "derive"] ++ ++ [[test]] ++ name = "test_meta" ++ path = "tests/test_meta.rs" +++required-features = ["full", "extra-traits", "derive"] ++ ++ [[test]] ++ name = "test_parse_buffer" ++ path = "tests/test_parse_buffer.rs" +++required-features = ["parsing"] ++ ++ [[test]] ++ name = "test_parse_quote" ++@@ -147,46 +160,57 @@ ++ [[test]] ++ name = "test_parse_stream" ++ path = "tests/test_parse_stream.rs" +++required-features = ["parsing"] ++ ++ [[test]] ++ name = "test_pat" ++ path = "tests/test_pat.rs" +++required-features = ["full", "extra-traits", "derive"] ++ ++ [[test]] ++ name = "test_path" ++ path = "tests/test_path.rs" +++required-features = ["full", "derive"] ++ ++ [[test]] ++ name = "test_receiver" ++ path = "tests/test_receiver.rs" +++required-features = ["full", "derive"] ++ ++ [[test]] ++ name = "test_shebang" ++ path = "tests/test_shebang.rs" +++required-features = ["full", "derive"] ++ ++ [[test]] ++ name = "test_size" ++ path = "tests/test_size.rs" +++required-features = ["full"] ++ ++ [[test]] ++ name = "test_stmt" ++ path = "tests/test_stmt.rs" +++required-features = ["full", "derive"] ++ ++ [[test]] ++ name = "test_token_trees" ++ path = "tests/test_token_trees.rs" +++required-features = ["full", "derive"] ++ ++ [[test]] ++ name = "test_ty" ++ path = "tests/test_ty.rs" +++required-features = ["full", "extra-traits", "derive"] ++ ++ [[test]] ++ name = "test_unparenthesize" ++ path = "tests/test_unparenthesize.rs" +++required-features = ["full", "visit-mut", "parsing", "derive"] ++ ++ [[test]] ++ name = "test_visibility" ++ path = "tests/test_visibility.rs" +++required-features = ["full", "extra-traits", "derive"] ++ ++ [[test]] ++ name = "zzz_stable" ++diff --git a/tests/macros/mod.rs b/tests/macros/mod.rs ++index 024075c..9e870bf 100644 ++--- a/tests/macros/mod.rs +++++ b/tests/macros/mod.rs ++@@ -1,3 +1,4 @@ +++#![cfg(feature = "parsing")] ++ #![allow(unused_macros, unused_macro_rules)] ++ ++ #[path = "../debug/mod.rs"] ++diff --git a/tests/test_parse_quote.rs b/tests/test_parse_quote.rs ++index c3a9004..75bf60a 100644 ++--- a/tests/test_parse_quote.rs +++++ b/tests/test_parse_quote.rs ++@@ -1,3 +1,4 @@ +++#![cfg(all(feature = "parsing", feature = "printing", feature = "full"))] ++ #![allow(clippy::needless_lifetimes, clippy::uninlined_format_args)] ++ ++ #[macro_use] ++diff --git a/tests/test_parse_stream.rs b/tests/test_parse_stream.rs ++index a650fc8..7962f00 100644 ++--- a/tests/test_parse_stream.rs +++++ b/tests/test_parse_stream.rs ++@@ -1,3 +1,4 @@ +++#![cfg(feature = "printing")] // printing = ["dep:quote"] ++ #![allow(clippy::items_after_statements, clippy::let_underscore_untyped)] ++ ++ use proc_macro2::{Delimiter, Group, Punct, Spacing, Span, TokenStream, TokenTree}; +diff -Nru mesa-25.3.3/subprojects/syn-2.0.98/debian/patches/remove-reqwest.patch mesa-25.3.3/subprojects/syn-2.0.98/debian/patches/remove-reqwest.patch +--- mesa-25.3.3/subprojects/syn-2.0.98/debian/patches/remove-reqwest.patch 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/syn-2.0.98/debian/patches/remove-reqwest.patch 2025-04-06 23:47:11.000000000 -0500 +@@ -0,0 +1,106 @@ ++diff --git a/Cargo.toml b/Cargo.toml ++index 3f36a10..8cb5f06 100644 ++--- a/Cargo.toml +++++ b/Cargo.toml ++@@ -236,9 +236,9 @@ ++ [target."cfg(not(miri))".dev-dependencies.rayon] ++ version = "1" ++ ++-[target."cfg(not(miri))".dev-dependencies.reqwest] ++-version = "0.12" ++-features = ["blocking"] +++#[target."cfg(not(miri))".dev-dependencies.reqwest] +++#version = "0.12" +++#features = ["blocking"] ++ ++ [target."cfg(not(miri))".dev-dependencies.tar] ++ version = "0.4.16" ++diff --git a/benches/file.rs b/benches/file.rs ++index 5754d20..f479e6b 100644 ++--- a/benches/file.rs +++++ b/benches/file.rs ++@@ -1,3 +1,4 @@ +++/* ++ // $ cargo bench --features full,test --bench file ++ ++ #![feature(rustc_private, test)] ++@@ -55,4 +56,4 @@ ++ fn parse_file(b: &mut Bencher) { ++ let tokens = get_tokens(); ++ b.iter(|| syn::parse2::(tokens.clone())); ++-} +++}*/ ++diff --git a/benches/rust.rs b/benches/rust.rs ++index 75a9f91..c0b1e10 100644 ++--- a/benches/rust.rs +++++ b/benches/rust.rs ++@@ -1,3 +1,7 @@ +++fn main() { +++ eprintln!("Debian: this bench is disabled due to dependency on reqwest.\n\ +++ To run it, please unapply debian/patches/remove-reqwest.patch."); +++/* ++ // $ cargo bench --features full,test --bench rust ++ // ++ // Syn only, useful for profiling: ++@@ -190,5 +194,5 @@ ++ elapsed.subsec_millis(), ++ ); ++ } ++- eprintln!(); +++ eprintln!();*/ ++ } ++diff --git a/tests/repo/mod.rs b/tests/repo/mod.rs ++index 96f039c..3130aef 100644 ++--- a/tests/repo/mod.rs +++++ b/tests/repo/mod.rs ++@@ -484,6 +484,7 @@ ++ } ++ ++ pub fn clone_rust() { +++ return; ++ let needs_clone = match fs::read_to_string("tests/rust/COMMIT") { ++ Err(_) => true, ++ Ok(contents) => contents.trim() != REVISION, ++@@ -529,7 +530,7 @@ ++ } ++ ++ fn download_and_unpack() -> Result<()> { ++- let url = format!( +++ /*let url = format!( ++ "https://github.com/rust-lang/rust/archive/{}.tar.gz", ++ REVISION ++ ); ++@@ -555,6 +556,6 @@ ++ entry.unpack(&out)?; ++ } ++ ++- fs::write("tests/rust/COMMIT", REVISION)?; +++ fs::write("tests/rust/COMMIT", REVISION)?;*/ ++ Ok(()) ++ } ++diff --git a/tests/test_precedence.rs b/tests/test_precedence.rs ++index 7231bd6..2c42792 100644 ++--- a/tests/test_precedence.rs +++++ b/tests/test_precedence.rs ++@@ -60,7 +60,7 @@ ++ #[path = "../src/scan_expr.rs"] ++ mod scan_expr; ++ ++-#[test] +++//#[test] ++ fn test_rustc_precedence() { ++ repo::rayon_init(); ++ repo::clone_rust(); ++diff --git a/tests/test_round_trip.rs b/tests/test_round_trip.rs ++index 197552f..e6a93c4 100644 ++--- a/tests/test_round_trip.rs +++++ b/tests/test_round_trip.rs ++@@ -49,7 +49,7 @@ ++ mod common; ++ mod repo; ++ ++-#[test] +++//#[test] ++ fn test_round_trip() { ++ repo::rayon_init(); ++ repo::clone_rust(); +diff -Nru mesa-25.3.3/subprojects/syn-2.0.98/debian/patches/remove-rustc-crates.patch mesa-25.3.3/subprojects/syn-2.0.98/debian/patches/remove-rustc-crates.patch +--- mesa-25.3.3/subprojects/syn-2.0.98/debian/patches/remove-rustc-crates.patch 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/syn-2.0.98/debian/patches/remove-rustc-crates.patch 2025-04-06 23:47:11.000000000 -0500 +@@ -0,0 +1,39 @@ ++diff --git a/Cargo.toml b/Cargo.toml ++index 17612e4..3f36a10 100644 ++--- a/Cargo.toml +++++ b/Cargo.toml ++@@ -157,18 +157,10 @@ ++ path = "tests/test_path.rs" ++ ++ [[test]] ++-name = "test_precedence" ++-path = "tests/test_precedence.rs" ++- ++-[[test]] ++ name = "test_receiver" ++ path = "tests/test_receiver.rs" ++ ++ [[test]] ++-name = "test_round_trip" ++-path = "tests/test_round_trip.rs" ++- ++-[[test]] ++ name = "test_shebang" ++ path = "tests/test_shebang.rs" ++ ++@@ -206,15 +198,6 @@ ++ required-features = [ ++ "full", ++ "parsing", ++-] ++- ++-[[bench]] ++-name = "rust" ++-path = "benches/rust.rs" ++-harness = false ++-required-features = [ ++- "full", ++- "parsing", ++ ] ++ ++ [dependencies.proc-macro2] +diff -Nru mesa-25.3.3/subprojects/syn-2.0.98/debian/patches/remove-syn-test-suite.patch mesa-25.3.3/subprojects/syn-2.0.98/debian/patches/remove-syn-test-suite.patch +--- mesa-25.3.3/subprojects/syn-2.0.98/debian/patches/remove-syn-test-suite.patch 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/syn-2.0.98/debian/patches/remove-syn-test-suite.patch 2025-04-06 23:47:11.000000000 -0500 +@@ -0,0 +1,22 @@ ++diff --git a/Cargo.toml b/Cargo.toml ++index 8293b96..17612e4 100644 ++--- a/Cargo.toml +++++ b/Cargo.toml ++@@ -80,7 +80,6 @@ ++ "proc-macro2/proc-macro", ++ "quote?/proc-macro", ++ ] ++-test = ["syn-test-suite/all-features"] ++ visit = [] ++ visit-mut = [] ++ ++@@ -245,9 +244,6 @@ ++ [dev-dependencies.rustversion] ++ version = "1" ++ ++-[dev-dependencies.syn-test-suite] ++-version = "0" ++- ++ [dev-dependencies.termcolor] ++ version = "1" ++ +diff -Nru mesa-25.3.3/subprojects/syn-2.0.98/debian/patches/series mesa-25.3.3/subprojects/syn-2.0.98/debian/patches/series +--- mesa-25.3.3/subprojects/syn-2.0.98/debian/patches/series 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/syn-2.0.98/debian/patches/series 2025-04-06 23:47:11.000000000 -0500 +@@ -0,0 +1,7 @@ ++remove-syn-test-suite.patch ++remove-rustc-crates.patch ++remove-reqwest.patch ++fix-test-feature-gates.patch ++disable-tests-requiring-nightly.patch ++disable-unparenthesize-test.patch ++disable-tests-compiler-internals.patch +diff -Nru mesa-25.3.3/subprojects/syn-2.0.98/LICENSE-APACHE mesa-25.3.3/subprojects/syn-2.0.98/LICENSE-APACHE +--- mesa-25.3.3/subprojects/syn-2.0.98/LICENSE-APACHE 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/syn-2.0.98/LICENSE-APACHE 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,176 @@ ++ Apache License ++ Version 2.0, January 2004 ++ http://www.apache.org/licenses/ ++ ++TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION ++ ++1. Definitions. ++ ++ "License" shall mean the terms and conditions for use, reproduction, ++ and distribution as defined by Sections 1 through 9 of this document. ++ ++ "Licensor" shall mean the copyright owner or entity authorized by ++ the copyright owner that is granting the License. ++ ++ "Legal Entity" shall mean the union of the acting entity and all ++ other entities that control, are controlled by, or are under common ++ control with that entity. For the purposes of this definition, ++ "control" means (i) the power, direct or indirect, to cause the ++ direction or management of such entity, whether by contract or ++ otherwise, or (ii) ownership of fifty percent (50%) or more of the ++ outstanding shares, or (iii) beneficial ownership of such entity. ++ ++ "You" (or "Your") shall mean an individual or Legal Entity ++ exercising permissions granted by this License. ++ ++ "Source" form shall mean the preferred form for making modifications, ++ including but not limited to software source code, documentation ++ source, and configuration files. ++ ++ "Object" form shall mean any form resulting from mechanical ++ transformation or translation of a Source form, including but ++ not limited to compiled object code, generated documentation, ++ and conversions to other media types. ++ ++ "Work" shall mean the work of authorship, whether in Source or ++ Object form, made available under the License, as indicated by a ++ copyright notice that is included in or attached to the work ++ (an example is provided in the Appendix below). ++ ++ "Derivative Works" shall mean any work, whether in Source or Object ++ form, that is based on (or derived from) the Work and for which the ++ editorial revisions, annotations, elaborations, or other modifications ++ represent, as a whole, an original work of authorship. For the purposes ++ of this License, Derivative Works shall not include works that remain ++ separable from, or merely link (or bind by name) to the interfaces of, ++ the Work and Derivative Works thereof. ++ ++ "Contribution" shall mean any work of authorship, including ++ the original version of the Work and any modifications or additions ++ to that Work or Derivative Works thereof, that is intentionally ++ submitted to Licensor for inclusion in the Work by the copyright owner ++ or by an individual or Legal Entity authorized to submit on behalf of ++ the copyright owner. For the purposes of this definition, "submitted" ++ means any form of electronic, verbal, or written communication sent ++ to the Licensor or its representatives, including but not limited to ++ communication on electronic mailing lists, source code control systems, ++ and issue tracking systems that are managed by, or on behalf of, the ++ Licensor for the purpose of discussing and improving the Work, but ++ excluding communication that is conspicuously marked or otherwise ++ designated in writing by the copyright owner as "Not a Contribution." ++ ++ "Contributor" shall mean Licensor and any individual or Legal Entity ++ on behalf of whom a Contribution has been received by Licensor and ++ subsequently incorporated within the Work. ++ ++2. Grant of Copyright License. Subject to the terms and conditions of ++ this License, each Contributor hereby grants to You a perpetual, ++ worldwide, non-exclusive, no-charge, royalty-free, irrevocable ++ copyright license to reproduce, prepare Derivative Works of, ++ publicly display, publicly perform, sublicense, and distribute the ++ Work and such Derivative Works in Source or Object form. ++ ++3. Grant of Patent License. Subject to the terms and conditions of ++ this License, each Contributor hereby grants to You a perpetual, ++ worldwide, non-exclusive, no-charge, royalty-free, irrevocable ++ (except as stated in this section) patent license to make, have made, ++ use, offer to sell, sell, import, and otherwise transfer the Work, ++ where such license applies only to those patent claims licensable ++ by such Contributor that are necessarily infringed by their ++ Contribution(s) alone or by combination of their Contribution(s) ++ with the Work to which such Contribution(s) was submitted. If You ++ institute patent litigation against any entity (including a ++ cross-claim or counterclaim in a lawsuit) alleging that the Work ++ or a Contribution incorporated within the Work constitutes direct ++ or contributory patent infringement, then any patent licenses ++ granted to You under this License for that Work shall terminate ++ as of the date such litigation is filed. ++ ++4. Redistribution. You may reproduce and distribute copies of the ++ Work or Derivative Works thereof in any medium, with or without ++ modifications, and in Source or Object form, provided that You ++ meet the following conditions: ++ ++ (a) You must give any other recipients of the Work or ++ Derivative Works a copy of this License; and ++ ++ (b) You must cause any modified files to carry prominent notices ++ stating that You changed the files; and ++ ++ (c) You must retain, in the Source form of any Derivative Works ++ that You distribute, all copyright, patent, trademark, and ++ attribution notices from the Source form of the Work, ++ excluding those notices that do not pertain to any part of ++ the Derivative Works; and ++ ++ (d) If the Work includes a "NOTICE" text file as part of its ++ distribution, then any Derivative Works that You distribute must ++ include a readable copy of the attribution notices contained ++ within such NOTICE file, excluding those notices that do not ++ pertain to any part of the Derivative Works, in at least one ++ of the following places: within a NOTICE text file distributed ++ as part of the Derivative Works; within the Source form or ++ documentation, if provided along with the Derivative Works; or, ++ within a display generated by the Derivative Works, if and ++ wherever such third-party notices normally appear. The contents ++ of the NOTICE file are for informational purposes only and ++ do not modify the License. You may add Your own attribution ++ notices within Derivative Works that You distribute, alongside ++ or as an addendum to the NOTICE text from the Work, provided ++ that such additional attribution notices cannot be construed ++ as modifying the License. ++ ++ You may add Your own copyright statement to Your modifications and ++ may provide additional or different license terms and conditions ++ for use, reproduction, or distribution of Your modifications, or ++ for any such Derivative Works as a whole, provided Your use, ++ reproduction, and distribution of the Work otherwise complies with ++ the conditions stated in this License. ++ ++5. Submission of Contributions. Unless You explicitly state otherwise, ++ any Contribution intentionally submitted for inclusion in the Work ++ by You to the Licensor shall be under the terms and conditions of ++ this License, without any additional terms or conditions. ++ Notwithstanding the above, nothing herein shall supersede or modify ++ the terms of any separate license agreement you may have executed ++ with Licensor regarding such Contributions. ++ ++6. Trademarks. This License does not grant permission to use the trade ++ names, trademarks, service marks, or product names of the Licensor, ++ except as required for reasonable and customary use in describing the ++ origin of the Work and reproducing the content of the NOTICE file. ++ ++7. Disclaimer of Warranty. Unless required by applicable law or ++ agreed to in writing, Licensor provides the Work (and each ++ Contributor provides its Contributions) on an "AS IS" BASIS, ++ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or ++ implied, including, without limitation, any warranties or conditions ++ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A ++ PARTICULAR PURPOSE. You are solely responsible for determining the ++ appropriateness of using or redistributing the Work and assume any ++ risks associated with Your exercise of permissions under this License. ++ ++8. Limitation of Liability. In no event and under no legal theory, ++ whether in tort (including negligence), contract, or otherwise, ++ unless required by applicable law (such as deliberate and grossly ++ negligent acts) or agreed to in writing, shall any Contributor be ++ liable to You for damages, including any direct, indirect, special, ++ incidental, or consequential damages of any character arising as a ++ result of this License or out of the use or inability to use the ++ Work (including but not limited to damages for loss of goodwill, ++ work stoppage, computer failure or malfunction, or any and all ++ other commercial damages or losses), even if such Contributor ++ has been advised of the possibility of such damages. ++ ++9. Accepting Warranty or Additional Liability. While redistributing ++ the Work or Derivative Works thereof, You may choose to offer, ++ and charge a fee for, acceptance of support, warranty, indemnity, ++ or other liability obligations and/or rights consistent with this ++ License. However, in accepting such obligations, You may act only ++ on Your own behalf and on Your sole responsibility, not on behalf ++ of any other Contributor, and only if You agree to indemnify, ++ defend, and hold each Contributor harmless for any liability ++ incurred by, or claims asserted against, such Contributor by reason ++ of your accepting any such warranty or additional liability. ++ ++END OF TERMS AND CONDITIONS +diff -Nru mesa-25.3.3/subprojects/syn-2.0.98/LICENSE-MIT mesa-25.3.3/subprojects/syn-2.0.98/LICENSE-MIT +--- mesa-25.3.3/subprojects/syn-2.0.98/LICENSE-MIT 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/syn-2.0.98/LICENSE-MIT 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,23 @@ ++Permission is hereby granted, free of charge, to any ++person obtaining a copy of this software and associated ++documentation files (the "Software"), to deal in the ++Software without restriction, including without ++limitation the rights to use, copy, modify, merge, ++publish, distribute, sublicense, and/or sell copies of ++the Software, and to permit persons to whom the Software ++is furnished to do so, subject to the following ++conditions: ++ ++The above copyright notice and this permission notice ++shall be included in all copies or substantial portions ++of the Software. ++ ++THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ++ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED ++TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A ++PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT ++SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY ++CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION ++OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR ++IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ++DEALINGS IN THE SOFTWARE. +diff -Nru mesa-25.3.3/subprojects/syn-2.0.98/meson.build mesa-25.3.3/subprojects/syn-2.0.98/meson.build +--- mesa-25.3.3/subprojects/syn-2.0.98/meson.build 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/syn-2.0.98/meson.build 2026-05-26 15:46:09.000000000 -0500 +@@ -0,0 +1,47 @@ ++project('syn', 'rust', version : '2.0.98', license : 'MIT OR Apache-2.0') ++ ++rc = meson.get_compiler('rust') ++ ++ ++rust_args = [ ++ '--cfg', 'feature="default"', ++ '--cfg', 'feature="derive"', ++ '--cfg', 'feature="parsing"', ++ '--cfg', 'feature="printing"', ++ '--cfg', 'feature="clone-impls"', ++ '--cfg', 'feature="proc-macro"', ++ '--cfg', 'feature="quote"', ++ '--cfg', 'feature="full"', ++ '--cfg', 'feature="visit-mut"', ++] ++if rc.version().version_compare('< 1.36') ++ rust_args += ['--cfg', 'syn_omit_await_from_token_macro'] ++endif ++if rc.version().version_compare('< 1.39') ++ rust_args += ['--cfg', 'syn_no_const_vec_new'] ++endif ++if rc.version().version_compare('< 1.40') ++ rust_args += ['--cfg', 'syn_no_non_exhaustive'] ++endif ++if rc.version().version_compare('< 1.56') ++ rust_args += ['--cfg', 'syn_no_negative_literal_parse'] ++endif ++ ++u_ind = subproject('unicode-ident-1-rs').get_variable('lib') ++quote = subproject('quote-1-rs').get_variable('lib') ++pm2 = subproject('proc-macro2-1-rs').get_variable('lib') ++ ++ ++lib = static_library( ++ 'syn', ++ 'src/lib.rs', ++ rust_args : rust_args, ++ override_options : ['rust_std=2021', 'build.rust_std=2021'], ++ link_with : [u_ind, quote, pm2], ++ rust_abi : 'rust', ++ native : true, ++) ++ ++dep_syn = declare_dependency( ++ link_with : [lib, u_ind, quote, pm2], ++) +diff -Nru mesa-25.3.3/subprojects/syn-2.0.98/.meson-subproject-wrap-hash.txt mesa-25.3.3/subprojects/syn-2.0.98/.meson-subproject-wrap-hash.txt +--- mesa-25.3.3/subprojects/syn-2.0.98/.meson-subproject-wrap-hash.txt 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/syn-2.0.98/.meson-subproject-wrap-hash.txt 2026-05-29 13:40:57.000000000 -0500 +@@ -0,0 +1 @@ ++9ee8102e035e92c1c2c316841108ee14a3f243f217f9f7737f48ab65ee031508 +diff -Nru mesa-25.3.3/subprojects/syn-2.0.98/README.md mesa-25.3.3/subprojects/syn-2.0.98/README.md +--- mesa-25.3.3/subprojects/syn-2.0.98/README.md 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/syn-2.0.98/README.md 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,284 @@ ++Parser for Rust source code ++=========================== ++ ++[github](https://github.com/dtolnay/syn) ++[crates.io](https://crates.io/crates/syn) ++[docs.rs](https://docs.rs/syn) ++[build status](https://github.com/dtolnay/syn/actions?query=branch%3Amaster) ++ ++Syn is a parsing library for parsing a stream of Rust tokens into a syntax tree ++of Rust source code. ++ ++Currently this library is geared toward use in Rust procedural macros, but ++contains some APIs that may be useful more generally. ++ ++- **Data structures** — Syn provides a complete syntax tree that can represent ++ any valid Rust source code. The syntax tree is rooted at [`syn::File`] which ++ represents a full source file, but there are other entry points that may be ++ useful to procedural macros including [`syn::Item`], [`syn::Expr`] and ++ [`syn::Type`]. ++ ++- **Derives** — Of particular interest to derive macros is [`syn::DeriveInput`] ++ which is any of the three legal input items to a derive macro. An example ++ below shows using this type in a library that can derive implementations of a ++ user-defined trait. ++ ++- **Parsing** — Parsing in Syn is built around [parser functions] with the ++ signature `fn(ParseStream) -> Result`. Every syntax tree node defined by ++ Syn is individually parsable and may be used as a building block for custom ++ syntaxes, or you may dream up your own brand new syntax without involving any ++ of our syntax tree types. ++ ++- **Location information** — Every token parsed by Syn is associated with a ++ `Span` that tracks line and column information back to the source of that ++ token. These spans allow a procedural macro to display detailed error messages ++ pointing to all the right places in the user's code. There is an example of ++ this below. ++ ++- **Feature flags** — Functionality is aggressively feature gated so your ++ procedural macros enable only what they need, and do not pay in compile time ++ for all the rest. ++ ++[`syn::File`]: https://docs.rs/syn/2.0/syn/struct.File.html ++[`syn::Item`]: https://docs.rs/syn/2.0/syn/enum.Item.html ++[`syn::Expr`]: https://docs.rs/syn/2.0/syn/enum.Expr.html ++[`syn::Type`]: https://docs.rs/syn/2.0/syn/enum.Type.html ++[`syn::DeriveInput`]: https://docs.rs/syn/2.0/syn/struct.DeriveInput.html ++[parser functions]: https://docs.rs/syn/2.0/syn/parse/index.html ++ ++*Version requirement: Syn supports rustc 1.61 and up.* ++ ++[*Release notes*](https://github.com/dtolnay/syn/releases) ++ ++
++ ++## Resources ++ ++The best way to learn about procedural macros is by writing some. Consider ++working through [this procedural macro workshop][workshop] to get familiar with ++the different types of procedural macros. The workshop contains relevant links ++into the Syn documentation as you work through each project. ++ ++[workshop]: https://github.com/dtolnay/proc-macro-workshop ++ ++
++ ++## Example of a derive macro ++ ++The canonical derive macro using Syn looks like this. We write an ordinary Rust ++function tagged with a `proc_macro_derive` attribute and the name of the trait ++we are deriving. Any time that derive appears in the user's code, the Rust ++compiler passes their data structure as tokens into our macro. We get to execute ++arbitrary Rust code to figure out what to do with those tokens, then hand some ++tokens back to the compiler to compile into the user's crate. ++ ++[`TokenStream`]: https://doc.rust-lang.org/proc_macro/struct.TokenStream.html ++ ++```toml ++[dependencies] ++syn = "2.0" ++quote = "1.0" ++ ++[lib] ++proc-macro = true ++``` ++ ++```rust ++use proc_macro::TokenStream; ++use quote::quote; ++use syn::{parse_macro_input, DeriveInput}; ++ ++#[proc_macro_derive(MyMacro)] ++pub fn my_macro(input: TokenStream) -> TokenStream { ++ // Parse the input tokens into a syntax tree ++ let input = parse_macro_input!(input as DeriveInput); ++ ++ // Build the output, possibly using quasi-quotation ++ let expanded = quote! { ++ // ... ++ }; ++ ++ // Hand the output tokens back to the compiler ++ TokenStream::from(expanded) ++} ++``` ++ ++The [`heapsize`] example directory shows a complete working implementation of a ++derive macro. The example derives a `HeapSize` trait which computes an estimate ++of the amount of heap memory owned by a value. ++ ++[`heapsize`]: examples/heapsize ++ ++```rust ++pub trait HeapSize { ++ /// Total number of bytes of heap memory owned by `self`. ++ fn heap_size_of_children(&self) -> usize; ++} ++``` ++ ++The derive macro allows users to write `#[derive(HeapSize)]` on data structures ++in their program. ++ ++```rust ++#[derive(HeapSize)] ++struct Demo<'a, T: ?Sized> { ++ a: Box, ++ b: u8, ++ c: &'a str, ++ d: String, ++} ++``` ++ ++
++ ++## Spans and error reporting ++ ++The token-based procedural macro API provides great control over where the ++compiler's error messages are displayed in user code. Consider the error the ++user sees if one of their field types does not implement `HeapSize`. ++ ++```rust ++#[derive(HeapSize)] ++struct Broken { ++ ok: String, ++ bad: std::thread::Thread, ++} ++``` ++ ++By tracking span information all the way through the expansion of a procedural ++macro as shown in the `heapsize` example, token-based macros in Syn are able to ++trigger errors that directly pinpoint the source of the problem. ++ ++```console ++error[E0277]: the trait bound `std::thread::Thread: HeapSize` is not satisfied ++ --> src/main.rs:7:5 ++ | ++7 | bad: std::thread::Thread, ++ | ^^^^^^^^^^^^^^^^^^^^^^^^ the trait `HeapSize` is not implemented for `std::thread::Thread` ++``` ++ ++
++ ++## Parsing a custom syntax ++ ++The [`lazy-static`] example directory shows the implementation of a ++`functionlike!(...)` procedural macro in which the input tokens are parsed using ++Syn's parsing API. ++ ++[`lazy-static`]: examples/lazy-static ++ ++The example reimplements the popular `lazy_static` crate from crates.io as a ++procedural macro. ++ ++```rust ++lazy_static! { ++ static ref USERNAME: Regex = Regex::new("^[a-z0-9_-]{3,16}$").unwrap(); ++} ++``` ++ ++The implementation shows how to trigger custom warnings and error messages on ++the macro input. ++ ++```console ++warning: come on, pick a more creative name ++ --> src/main.rs:10:16 ++ | ++10 | static ref FOO: String = "lazy_static".to_owned(); ++ | ^^^ ++``` ++ ++
++ ++## Testing ++ ++When testing macros, we often care not just that the macro can be used ++successfully but also that when the macro is provided with invalid input it ++produces maximally helpful error messages. Consider using the [`trybuild`] crate ++to write tests for errors that are emitted by your macro or errors detected by ++the Rust compiler in the expanded code following misuse of the macro. Such tests ++help avoid regressions from later refactors that mistakenly make an error no ++longer trigger or be less helpful than it used to be. ++ ++[`trybuild`]: https://github.com/dtolnay/trybuild ++ ++
++ ++## Debugging ++ ++When developing a procedural macro it can be helpful to look at what the ++generated code looks like. Use `cargo rustc -- -Zunstable-options ++--pretty=expanded` or the [`cargo expand`] subcommand. ++ ++[`cargo expand`]: https://github.com/dtolnay/cargo-expand ++ ++To show the expanded code for some crate that uses your procedural macro, run ++`cargo expand` from that crate. To show the expanded code for one of your own ++test cases, run `cargo expand --test the_test_case` where the last argument is ++the name of the test file without the `.rs` extension. ++ ++This write-up by Brandon W Maister discusses debugging in more detail: ++[Debugging Rust's new Custom Derive system][debugging]. ++ ++[debugging]: https://quodlibetor.github.io/posts/debugging-rusts-new-custom-derive-system/ ++ ++
++ ++## Optional features ++ ++Syn puts a lot of functionality behind optional features in order to optimize ++compile time for the most common use cases. The following features are ++available. ++ ++- **`derive`** *(enabled by default)* — Data structures for representing the ++ possible input to a derive macro, including structs and enums and types. ++- **`full`** — Data structures for representing the syntax tree of all valid ++ Rust source code, including items and expressions. ++- **`parsing`** *(enabled by default)* — Ability to parse input tokens into a ++ syntax tree node of a chosen type. ++- **`printing`** *(enabled by default)* — Ability to print a syntax tree node as ++ tokens of Rust source code. ++- **`visit`** — Trait for traversing a syntax tree. ++- **`visit-mut`** — Trait for traversing and mutating in place a syntax tree. ++- **`fold`** — Trait for transforming an owned syntax tree. ++- **`clone-impls`** *(enabled by default)* — Clone impls for all syntax tree ++ types. ++- **`extra-traits`** — Debug, Eq, PartialEq, Hash impls for all syntax tree ++ types. ++- **`proc-macro`** *(enabled by default)* — Runtime dependency on the dynamic ++ library libproc_macro from rustc toolchain. ++ ++
++ ++## Proc macro shim ++ ++Syn operates on the token representation provided by the [proc-macro2] crate ++from crates.io rather than using the compiler's built in proc-macro crate ++directly. This enables code using Syn to execute outside of the context of a ++procedural macro, such as in unit tests or build.rs, and we avoid needing ++incompatible ecosystems for proc macros vs non-macro use cases. ++ ++In general all of your code should be written against proc-macro2 rather than ++proc-macro. The one exception is in the signatures of procedural macro entry ++points, which are required by the language to use `proc_macro::TokenStream`. ++ ++The proc-macro2 crate will automatically detect and use the compiler's data ++structures when a procedural macro is active. ++ ++[proc-macro2]: https://docs.rs/proc-macro2/1.0/proc_macro2/ ++ ++
++ ++#### License ++ ++ ++Licensed under either of Apache License, Version ++2.0 or MIT license at your option. ++ ++ ++
++ ++ ++Unless you explicitly state otherwise, any contribution intentionally submitted ++for inclusion in this crate by you, as defined in the Apache-2.0 license, shall ++be dual licensed as above, without any additional terms or conditions. ++ +diff -Nru mesa-25.3.3/subprojects/syn-2.0.98/src/attr.rs mesa-25.3.3/subprojects/syn-2.0.98/src/attr.rs +--- mesa-25.3.3/subprojects/syn-2.0.98/src/attr.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/syn-2.0.98/src/attr.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,836 @@ ++#[cfg(feature = "parsing")] ++use crate::error::Error; ++#[cfg(feature = "parsing")] ++use crate::error::Result; ++use crate::expr::Expr; ++use crate::mac::MacroDelimiter; ++#[cfg(feature = "parsing")] ++use crate::meta::{self, ParseNestedMeta}; ++#[cfg(feature = "parsing")] ++use crate::parse::{Parse, ParseStream, Parser}; ++use crate::path::Path; ++use crate::token; ++use proc_macro2::TokenStream; ++#[cfg(feature = "printing")] ++use std::iter; ++#[cfg(feature = "printing")] ++use std::slice; ++ ++ast_struct! { ++ /// An attribute, like `#[repr(transparent)]`. ++ /// ++ ///
++ /// ++ /// # Syntax ++ /// ++ /// Rust has six types of attributes. ++ /// ++ /// - Outer attributes like `#[repr(transparent)]`. These appear outside or ++ /// in front of the item they describe. ++ /// ++ /// - Inner attributes like `#![feature(proc_macro)]`. These appear inside ++ /// of the item they describe, usually a module. ++ /// ++ /// - Outer one-line doc comments like `/// Example`. ++ /// ++ /// - Inner one-line doc comments like `//! Please file an issue`. ++ /// ++ /// - Outer documentation blocks `/** Example */`. ++ /// ++ /// - Inner documentation blocks `/*! Please file an issue */`. ++ /// ++ /// The `style` field of type `AttrStyle` distinguishes whether an attribute ++ /// is outer or inner. ++ /// ++ /// Every attribute has a `path` that indicates the intended interpretation ++ /// of the rest of the attribute's contents. The path and the optional ++ /// additional contents are represented together in the `meta` field of the ++ /// attribute in three possible varieties: ++ /// ++ /// - Meta::Path — attributes whose information content conveys just a ++ /// path, for example the `#[test]` attribute. ++ /// ++ /// - Meta::List — attributes that carry arbitrary tokens after the ++ /// path, surrounded by a delimiter (parenthesis, bracket, or brace). For ++ /// example `#[derive(Copy)]` or `#[precondition(x < 5)]`. ++ /// ++ /// - Meta::NameValue — attributes with an `=` sign after the path, ++ /// followed by a Rust expression. For example `#[path = ++ /// "sys/windows.rs"]`. ++ /// ++ /// All doc comments are represented in the NameValue style with a path of ++ /// "doc", as this is how they are processed by the compiler and by ++ /// `macro_rules!` macros. ++ /// ++ /// ```text ++ /// #[derive(Copy, Clone)] ++ /// ~~~~~~Path ++ /// ^^^^^^^^^^^^^^^^^^^Meta::List ++ /// ++ /// #[path = "sys/windows.rs"] ++ /// ~~~~Path ++ /// ^^^^^^^^^^^^^^^^^^^^^^^Meta::NameValue ++ /// ++ /// #[test] ++ /// ^^^^Meta::Path ++ /// ``` ++ /// ++ ///
++ /// ++ /// # Parsing from tokens to Attribute ++ /// ++ /// This type does not implement the [`Parse`] trait and thus cannot be ++ /// parsed directly by [`ParseStream::parse`]. Instead use ++ /// [`ParseStream::call`] with one of the two parser functions ++ /// [`Attribute::parse_outer`] or [`Attribute::parse_inner`] depending on ++ /// which you intend to parse. ++ /// ++ /// [`Parse`]: crate::parse::Parse ++ /// [`ParseStream::parse`]: crate::parse::ParseBuffer::parse ++ /// [`ParseStream::call`]: crate::parse::ParseBuffer::call ++ /// ++ /// ``` ++ /// use syn::{Attribute, Ident, Result, Token}; ++ /// use syn::parse::{Parse, ParseStream}; ++ /// ++ /// // Parses a unit struct with attributes. ++ /// // ++ /// // #[path = "s.tmpl"] ++ /// // struct S; ++ /// struct UnitStruct { ++ /// attrs: Vec, ++ /// struct_token: Token![struct], ++ /// name: Ident, ++ /// semi_token: Token![;], ++ /// } ++ /// ++ /// impl Parse for UnitStruct { ++ /// fn parse(input: ParseStream) -> Result { ++ /// Ok(UnitStruct { ++ /// attrs: input.call(Attribute::parse_outer)?, ++ /// struct_token: input.parse()?, ++ /// name: input.parse()?, ++ /// semi_token: input.parse()?, ++ /// }) ++ /// } ++ /// } ++ /// ``` ++ /// ++ ///


++ /// ++ /// # Parsing from Attribute to structured arguments ++ /// ++ /// The grammar of attributes in Rust is very flexible, which makes the ++ /// syntax tree not that useful on its own. In particular, arguments of the ++ /// `Meta::List` variety of attribute are held in an arbitrary `tokens: ++ /// TokenStream`. Macros are expected to check the `path` of the attribute, ++ /// decide whether they recognize it, and then parse the remaining tokens ++ /// according to whatever grammar they wish to require for that kind of ++ /// attribute. Use [`parse_args()`] to parse those tokens into the expected ++ /// data structure. ++ /// ++ /// [`parse_args()`]: Attribute::parse_args ++ /// ++ ///


++ /// ++ /// # Doc comments ++ /// ++ /// The compiler transforms doc comments, such as `/// comment` and `/*! ++ /// comment */`, into attributes before macros are expanded. Each comment is ++ /// expanded into an attribute of the form `#[doc = r"comment"]`. ++ /// ++ /// As an example, the following `mod` items are expanded identically: ++ /// ++ /// ``` ++ /// # use syn::{ItemMod, parse_quote}; ++ /// let doc: ItemMod = parse_quote! { ++ /// /// Single line doc comments ++ /// /// We write so many! ++ /// /** ++ /// * Multi-line comments... ++ /// * May span many lines ++ /// */ ++ /// mod example { ++ /// //! Of course, they can be inner too ++ /// /*! And fit in a single line */ ++ /// } ++ /// }; ++ /// let attr: ItemMod = parse_quote! { ++ /// #[doc = r" Single line doc comments"] ++ /// #[doc = r" We write so many!"] ++ /// #[doc = r" ++ /// * Multi-line comments... ++ /// * May span many lines ++ /// "] ++ /// mod example { ++ /// #![doc = r" Of course, they can be inner too"] ++ /// #![doc = r" And fit in a single line "] ++ /// } ++ /// }; ++ /// assert_eq!(doc, attr); ++ /// ``` ++ #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))] ++ pub struct Attribute { ++ pub pound_token: Token![#], ++ pub style: AttrStyle, ++ pub bracket_token: token::Bracket, ++ pub meta: Meta, ++ } ++} ++ ++impl Attribute { ++ /// Returns the path that identifies the interpretation of this attribute. ++ /// ++ /// For example this would return the `test` in `#[test]`, the `derive` in ++ /// `#[derive(Copy)]`, and the `path` in `#[path = "sys/windows.rs"]`. ++ pub fn path(&self) -> &Path { ++ self.meta.path() ++ } ++ ++ /// Parse the arguments to the attribute as a syntax tree. ++ /// ++ /// This is similar to pulling out the `TokenStream` from `Meta::List` and ++ /// doing `syn::parse2::(meta_list.tokens)`, except that using ++ /// `parse_args` the error message has a more useful span when `tokens` is ++ /// empty. ++ /// ++ /// The surrounding delimiters are *not* included in the input to the ++ /// parser. ++ /// ++ /// ```text ++ /// #[my_attr(value < 5)] ++ /// ^^^^^^^^^ what gets parsed ++ /// ``` ++ /// ++ /// # Example ++ /// ++ /// ``` ++ /// use syn::{parse_quote, Attribute, Expr}; ++ /// ++ /// let attr: Attribute = parse_quote! { ++ /// #[precondition(value < 5)] ++ /// }; ++ /// ++ /// if attr.path().is_ident("precondition") { ++ /// let precondition: Expr = attr.parse_args()?; ++ /// // ... ++ /// } ++ /// # anyhow::Ok(()) ++ /// ``` ++ #[cfg(feature = "parsing")] ++ #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))] ++ pub fn parse_args(&self) -> Result { ++ self.parse_args_with(T::parse) ++ } ++ ++ /// Parse the arguments to the attribute using the given parser. ++ /// ++ /// # Example ++ /// ++ /// ``` ++ /// use syn::{parse_quote, Attribute}; ++ /// ++ /// let attr: Attribute = parse_quote! { ++ /// #[inception { #[brrrrrrraaaaawwwwrwrrrmrmrmmrmrmmmmm] }] ++ /// }; ++ /// ++ /// let bwom = attr.parse_args_with(Attribute::parse_outer)?; ++ /// ++ /// // Attribute does not have a Parse impl, so we couldn't directly do: ++ /// // let bwom: Attribute = attr.parse_args()?; ++ /// # anyhow::Ok(()) ++ /// ``` ++ #[cfg(feature = "parsing")] ++ #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))] ++ pub fn parse_args_with(&self, parser: F) -> Result { ++ match &self.meta { ++ Meta::Path(path) => Err(crate::error::new2( ++ path.segments.first().unwrap().ident.span(), ++ path.segments.last().unwrap().ident.span(), ++ format!( ++ "expected attribute arguments in parentheses: {}[{}(...)]", ++ parsing::DisplayAttrStyle(&self.style), ++ parsing::DisplayPath(path), ++ ), ++ )), ++ Meta::NameValue(meta) => Err(Error::new( ++ meta.eq_token.span, ++ format_args!( ++ "expected parentheses: {}[{}(...)]", ++ parsing::DisplayAttrStyle(&self.style), ++ parsing::DisplayPath(&meta.path), ++ ), ++ )), ++ Meta::List(meta) => meta.parse_args_with(parser), ++ } ++ } ++ ++ /// Parse the arguments to the attribute, expecting it to follow the ++ /// conventional structure used by most of Rust's built-in attributes. ++ /// ++ /// The [*Meta Item Attribute Syntax*][syntax] section in the Rust reference ++ /// explains the convention in more detail. Not all attributes follow this ++ /// convention, so [`parse_args()`][Self::parse_args] is available if you ++ /// need to parse arbitrarily goofy attribute syntax. ++ /// ++ /// [syntax]: https://doc.rust-lang.org/reference/attributes.html#meta-item-attribute-syntax ++ /// ++ /// # Example ++ /// ++ /// We'll parse a struct, and then parse some of Rust's `#[repr]` attribute ++ /// syntax. ++ /// ++ /// ``` ++ /// use syn::{parenthesized, parse_quote, token, ItemStruct, LitInt}; ++ /// ++ /// let input: ItemStruct = parse_quote! { ++ /// #[repr(C, align(4))] ++ /// pub struct MyStruct(u16, u32); ++ /// }; ++ /// ++ /// let mut repr_c = false; ++ /// let mut repr_transparent = false; ++ /// let mut repr_align = None::; ++ /// let mut repr_packed = None::; ++ /// for attr in &input.attrs { ++ /// if attr.path().is_ident("repr") { ++ /// attr.parse_nested_meta(|meta| { ++ /// // #[repr(C)] ++ /// if meta.path.is_ident("C") { ++ /// repr_c = true; ++ /// return Ok(()); ++ /// } ++ /// ++ /// // #[repr(transparent)] ++ /// if meta.path.is_ident("transparent") { ++ /// repr_transparent = true; ++ /// return Ok(()); ++ /// } ++ /// ++ /// // #[repr(align(N))] ++ /// if meta.path.is_ident("align") { ++ /// let content; ++ /// parenthesized!(content in meta.input); ++ /// let lit: LitInt = content.parse()?; ++ /// let n: usize = lit.base10_parse()?; ++ /// repr_align = Some(n); ++ /// return Ok(()); ++ /// } ++ /// ++ /// // #[repr(packed)] or #[repr(packed(N))], omitted N means 1 ++ /// if meta.path.is_ident("packed") { ++ /// if meta.input.peek(token::Paren) { ++ /// let content; ++ /// parenthesized!(content in meta.input); ++ /// let lit: LitInt = content.parse()?; ++ /// let n: usize = lit.base10_parse()?; ++ /// repr_packed = Some(n); ++ /// } else { ++ /// repr_packed = Some(1); ++ /// } ++ /// return Ok(()); ++ /// } ++ /// ++ /// Err(meta.error("unrecognized repr")) ++ /// })?; ++ /// } ++ /// } ++ /// # anyhow::Ok(()) ++ /// ``` ++ /// ++ /// # Alternatives ++ /// ++ /// In some cases, for attributes which have nested layers of structured ++ /// content, the following less flexible approach might be more convenient: ++ /// ++ /// ``` ++ /// # use syn::{parse_quote, ItemStruct}; ++ /// # ++ /// # let input: ItemStruct = parse_quote! { ++ /// # #[repr(C, align(4))] ++ /// # pub struct MyStruct(u16, u32); ++ /// # }; ++ /// # ++ /// use syn::punctuated::Punctuated; ++ /// use syn::{parenthesized, token, Error, LitInt, Meta, Token}; ++ /// ++ /// let mut repr_c = false; ++ /// let mut repr_transparent = false; ++ /// let mut repr_align = None::; ++ /// let mut repr_packed = None::; ++ /// for attr in &input.attrs { ++ /// if attr.path().is_ident("repr") { ++ /// let nested = attr.parse_args_with(Punctuated::::parse_terminated)?; ++ /// for meta in nested { ++ /// match meta { ++ /// // #[repr(C)] ++ /// Meta::Path(path) if path.is_ident("C") => { ++ /// repr_c = true; ++ /// } ++ /// ++ /// // #[repr(align(N))] ++ /// Meta::List(meta) if meta.path.is_ident("align") => { ++ /// let lit: LitInt = meta.parse_args()?; ++ /// let n: usize = lit.base10_parse()?; ++ /// repr_align = Some(n); ++ /// } ++ /// ++ /// /* ... */ ++ /// ++ /// _ => { ++ /// return Err(Error::new_spanned(meta, "unrecognized repr")); ++ /// } ++ /// } ++ /// } ++ /// } ++ /// } ++ /// # Ok(()) ++ /// ``` ++ #[cfg(feature = "parsing")] ++ #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))] ++ pub fn parse_nested_meta( ++ &self, ++ logic: impl FnMut(ParseNestedMeta) -> Result<()>, ++ ) -> Result<()> { ++ self.parse_args_with(meta::parser(logic)) ++ } ++ ++ /// Parses zero or more outer attributes from the stream. ++ /// ++ /// # Example ++ /// ++ /// See ++ /// [*Parsing from tokens to Attribute*](#parsing-from-tokens-to-attribute). ++ #[cfg(feature = "parsing")] ++ #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))] ++ pub fn parse_outer(input: ParseStream) -> Result> { ++ let mut attrs = Vec::new(); ++ while input.peek(Token![#]) { ++ attrs.push(input.call(parsing::single_parse_outer)?); ++ } ++ Ok(attrs) ++ } ++ ++ /// Parses zero or more inner attributes from the stream. ++ /// ++ /// # Example ++ /// ++ /// See ++ /// [*Parsing from tokens to Attribute*](#parsing-from-tokens-to-attribute). ++ #[cfg(feature = "parsing")] ++ #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))] ++ pub fn parse_inner(input: ParseStream) -> Result> { ++ let mut attrs = Vec::new(); ++ parsing::parse_inner(input, &mut attrs)?; ++ Ok(attrs) ++ } ++} ++ ++ast_enum! { ++ /// Distinguishes between attributes that decorate an item and attributes ++ /// that are contained within an item. ++ /// ++ /// # Outer attributes ++ /// ++ /// - `#[repr(transparent)]` ++ /// - `/// # Example` ++ /// - `/** Please file an issue */` ++ /// ++ /// # Inner attributes ++ /// ++ /// - `#![feature(proc_macro)]` ++ /// - `//! # Example` ++ /// - `/*! Please file an issue */` ++ #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))] ++ pub enum AttrStyle { ++ Outer, ++ Inner(Token![!]), ++ } ++} ++ ++ast_enum! { ++ /// Content of a compile-time structured attribute. ++ /// ++ /// ## Path ++ /// ++ /// A meta path is like the `test` in `#[test]`. ++ /// ++ /// ## List ++ /// ++ /// A meta list is like the `derive(Copy)` in `#[derive(Copy)]`. ++ /// ++ /// ## NameValue ++ /// ++ /// A name-value meta is like the `path = "..."` in `#[path = ++ /// "sys/windows.rs"]`. ++ /// ++ /// # Syntax tree enum ++ /// ++ /// This type is a [syntax tree enum]. ++ /// ++ /// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums ++ #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))] ++ pub enum Meta { ++ Path(Path), ++ ++ /// A structured list within an attribute, like `derive(Copy, Clone)`. ++ List(MetaList), ++ ++ /// A name-value pair within an attribute, like `feature = "nightly"`. ++ NameValue(MetaNameValue), ++ } ++} ++ ++ast_struct! { ++ /// A structured list within an attribute, like `derive(Copy, Clone)`. ++ #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))] ++ pub struct MetaList { ++ pub path: Path, ++ pub delimiter: MacroDelimiter, ++ pub tokens: TokenStream, ++ } ++} ++ ++ast_struct! { ++ /// A name-value pair within an attribute, like `feature = "nightly"`. ++ #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))] ++ pub struct MetaNameValue { ++ pub path: Path, ++ pub eq_token: Token![=], ++ pub value: Expr, ++ } ++} ++ ++impl Meta { ++ /// Returns the path that begins this structured meta item. ++ /// ++ /// For example this would return the `test` in `#[test]`, the `derive` in ++ /// `#[derive(Copy)]`, and the `path` in `#[path = "sys/windows.rs"]`. ++ pub fn path(&self) -> &Path { ++ match self { ++ Meta::Path(path) => path, ++ Meta::List(meta) => &meta.path, ++ Meta::NameValue(meta) => &meta.path, ++ } ++ } ++ ++ /// Error if this is a `Meta::List` or `Meta::NameValue`. ++ #[cfg(feature = "parsing")] ++ #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))] ++ pub fn require_path_only(&self) -> Result<&Path> { ++ let error_span = match self { ++ Meta::Path(path) => return Ok(path), ++ Meta::List(meta) => meta.delimiter.span().open(), ++ Meta::NameValue(meta) => meta.eq_token.span, ++ }; ++ Err(Error::new(error_span, "unexpected token in attribute")) ++ } ++ ++ /// Error if this is a `Meta::Path` or `Meta::NameValue`. ++ #[cfg(feature = "parsing")] ++ #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))] ++ pub fn require_list(&self) -> Result<&MetaList> { ++ match self { ++ Meta::List(meta) => Ok(meta), ++ Meta::Path(path) => Err(crate::error::new2( ++ path.segments.first().unwrap().ident.span(), ++ path.segments.last().unwrap().ident.span(), ++ format!( ++ "expected attribute arguments in parentheses: `{}(...)`", ++ parsing::DisplayPath(path), ++ ), ++ )), ++ Meta::NameValue(meta) => Err(Error::new(meta.eq_token.span, "expected `(`")), ++ } ++ } ++ ++ /// Error if this is a `Meta::Path` or `Meta::List`. ++ #[cfg(feature = "parsing")] ++ #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))] ++ pub fn require_name_value(&self) -> Result<&MetaNameValue> { ++ match self { ++ Meta::NameValue(meta) => Ok(meta), ++ Meta::Path(path) => Err(crate::error::new2( ++ path.segments.first().unwrap().ident.span(), ++ path.segments.last().unwrap().ident.span(), ++ format!( ++ "expected a value for this attribute: `{} = ...`", ++ parsing::DisplayPath(path), ++ ), ++ )), ++ Meta::List(meta) => Err(Error::new(meta.delimiter.span().open(), "expected `=`")), ++ } ++ } ++} ++ ++impl MetaList { ++ /// See [`Attribute::parse_args`]. ++ #[cfg(feature = "parsing")] ++ #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))] ++ pub fn parse_args(&self) -> Result { ++ self.parse_args_with(T::parse) ++ } ++ ++ /// See [`Attribute::parse_args_with`]. ++ #[cfg(feature = "parsing")] ++ #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))] ++ pub fn parse_args_with(&self, parser: F) -> Result { ++ let scope = self.delimiter.span().close(); ++ crate::parse::parse_scoped(parser, scope, self.tokens.clone()) ++ } ++ ++ /// See [`Attribute::parse_nested_meta`]. ++ #[cfg(feature = "parsing")] ++ #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))] ++ pub fn parse_nested_meta( ++ &self, ++ logic: impl FnMut(ParseNestedMeta) -> Result<()>, ++ ) -> Result<()> { ++ self.parse_args_with(meta::parser(logic)) ++ } ++} ++ ++#[cfg(feature = "printing")] ++pub(crate) trait FilterAttrs<'a> { ++ type Ret: Iterator; ++ ++ fn outer(self) -> Self::Ret; ++ #[cfg(feature = "full")] ++ fn inner(self) -> Self::Ret; ++} ++ ++#[cfg(feature = "printing")] ++impl<'a> FilterAttrs<'a> for &'a [Attribute] { ++ type Ret = iter::Filter, fn(&&Attribute) -> bool>; ++ ++ fn outer(self) -> Self::Ret { ++ fn is_outer(attr: &&Attribute) -> bool { ++ match attr.style { ++ AttrStyle::Outer => true, ++ AttrStyle::Inner(_) => false, ++ } ++ } ++ self.iter().filter(is_outer) ++ } ++ ++ #[cfg(feature = "full")] ++ fn inner(self) -> Self::Ret { ++ fn is_inner(attr: &&Attribute) -> bool { ++ match attr.style { ++ AttrStyle::Inner(_) => true, ++ AttrStyle::Outer => false, ++ } ++ } ++ self.iter().filter(is_inner) ++ } ++} ++ ++impl From for Meta { ++ fn from(meta: Path) -> Meta { ++ Meta::Path(meta) ++ } ++} ++ ++impl From for Meta { ++ fn from(meta: MetaList) -> Meta { ++ Meta::List(meta) ++ } ++} ++ ++impl From for Meta { ++ fn from(meta: MetaNameValue) -> Meta { ++ Meta::NameValue(meta) ++ } ++} ++ ++#[cfg(feature = "parsing")] ++pub(crate) mod parsing { ++ use crate::attr::{AttrStyle, Attribute, Meta, MetaList, MetaNameValue}; ++ use crate::error::Result; ++ use crate::expr::{Expr, ExprLit}; ++ use crate::lit::Lit; ++ use crate::parse::discouraged::Speculative as _; ++ use crate::parse::{Parse, ParseStream}; ++ use crate::path::Path; ++ use crate::{mac, token}; ++ use proc_macro2::Ident; ++ use std::fmt::{self, Display}; ++ ++ pub(crate) fn parse_inner(input: ParseStream, attrs: &mut Vec) -> Result<()> { ++ while input.peek(Token![#]) && input.peek2(Token![!]) { ++ attrs.push(input.call(single_parse_inner)?); ++ } ++ Ok(()) ++ } ++ ++ pub(crate) fn single_parse_inner(input: ParseStream) -> Result { ++ let content; ++ Ok(Attribute { ++ pound_token: input.parse()?, ++ style: AttrStyle::Inner(input.parse()?), ++ bracket_token: bracketed!(content in input), ++ meta: content.parse()?, ++ }) ++ } ++ ++ pub(crate) fn single_parse_outer(input: ParseStream) -> Result { ++ let content; ++ Ok(Attribute { ++ pound_token: input.parse()?, ++ style: AttrStyle::Outer, ++ bracket_token: bracketed!(content in input), ++ meta: content.parse()?, ++ }) ++ } ++ ++ #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))] ++ impl Parse for Meta { ++ fn parse(input: ParseStream) -> Result { ++ let path = parse_outermost_meta_path(input)?; ++ parse_meta_after_path(path, input) ++ } ++ } ++ ++ #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))] ++ impl Parse for MetaList { ++ fn parse(input: ParseStream) -> Result { ++ let path = parse_outermost_meta_path(input)?; ++ parse_meta_list_after_path(path, input) ++ } ++ } ++ ++ #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))] ++ impl Parse for MetaNameValue { ++ fn parse(input: ParseStream) -> Result { ++ let path = parse_outermost_meta_path(input)?; ++ parse_meta_name_value_after_path(path, input) ++ } ++ } ++ ++ // Unlike meta::parse_meta_path which accepts arbitrary keywords in the path, ++ // only the `unsafe` keyword is accepted as an attribute's outermost path. ++ fn parse_outermost_meta_path(input: ParseStream) -> Result { ++ if input.peek(Token![unsafe]) { ++ let unsafe_token: Token![unsafe] = input.parse()?; ++ Ok(Path::from(Ident::new("unsafe", unsafe_token.span))) ++ } else { ++ Path::parse_mod_style(input) ++ } ++ } ++ ++ pub(crate) fn parse_meta_after_path(path: Path, input: ParseStream) -> Result { ++ if input.peek(token::Paren) || input.peek(token::Bracket) || input.peek(token::Brace) { ++ parse_meta_list_after_path(path, input).map(Meta::List) ++ } else if input.peek(Token![=]) { ++ parse_meta_name_value_after_path(path, input).map(Meta::NameValue) ++ } else { ++ Ok(Meta::Path(path)) ++ } ++ } ++ ++ fn parse_meta_list_after_path(path: Path, input: ParseStream) -> Result { ++ let (delimiter, tokens) = mac::parse_delimiter(input)?; ++ Ok(MetaList { ++ path, ++ delimiter, ++ tokens, ++ }) ++ } ++ ++ fn parse_meta_name_value_after_path(path: Path, input: ParseStream) -> Result { ++ let eq_token: Token![=] = input.parse()?; ++ let ahead = input.fork(); ++ let lit: Option = ahead.parse()?; ++ let value = if let (Some(lit), true) = (lit, ahead.is_empty()) { ++ input.advance_to(&ahead); ++ Expr::Lit(ExprLit { ++ attrs: Vec::new(), ++ lit, ++ }) ++ } else if input.peek(Token![#]) && input.peek2(token::Bracket) { ++ return Err(input.error("unexpected attribute inside of attribute")); ++ } else { ++ input.parse()? ++ }; ++ Ok(MetaNameValue { ++ path, ++ eq_token, ++ value, ++ }) ++ } ++ ++ pub(super) struct DisplayAttrStyle<'a>(pub &'a AttrStyle); ++ ++ impl<'a> Display for DisplayAttrStyle<'a> { ++ fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { ++ formatter.write_str(match self.0 { ++ AttrStyle::Outer => "#", ++ AttrStyle::Inner(_) => "#!", ++ }) ++ } ++ } ++ ++ pub(super) struct DisplayPath<'a>(pub &'a Path); ++ ++ impl<'a> Display for DisplayPath<'a> { ++ fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { ++ for (i, segment) in self.0.segments.iter().enumerate() { ++ if i > 0 || self.0.leading_colon.is_some() { ++ formatter.write_str("::")?; ++ } ++ write!(formatter, "{}", segment.ident)?; ++ } ++ Ok(()) ++ } ++ } ++} ++ ++#[cfg(feature = "printing")] ++mod printing { ++ use crate::attr::{AttrStyle, Attribute, Meta, MetaList, MetaNameValue}; ++ use crate::path; ++ use crate::path::printing::PathStyle; ++ use proc_macro2::TokenStream; ++ use quote::ToTokens; ++ ++ #[cfg_attr(docsrs, doc(cfg(feature = "printing")))] ++ impl ToTokens for Attribute { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ self.pound_token.to_tokens(tokens); ++ if let AttrStyle::Inner(b) = &self.style { ++ b.to_tokens(tokens); ++ } ++ self.bracket_token.surround(tokens, |tokens| { ++ self.meta.to_tokens(tokens); ++ }); ++ } ++ } ++ ++ #[cfg_attr(docsrs, doc(cfg(feature = "printing")))] ++ impl ToTokens for Meta { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ match self { ++ Meta::Path(path) => path::printing::print_path(tokens, path, PathStyle::Mod), ++ Meta::List(meta_list) => meta_list.to_tokens(tokens), ++ Meta::NameValue(meta_name_value) => meta_name_value.to_tokens(tokens), ++ } ++ } ++ } ++ ++ #[cfg_attr(docsrs, doc(cfg(feature = "printing")))] ++ impl ToTokens for MetaList { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ path::printing::print_path(tokens, &self.path, PathStyle::Mod); ++ self.delimiter.surround(tokens, self.tokens.clone()); ++ } ++ } ++ ++ #[cfg_attr(docsrs, doc(cfg(feature = "printing")))] ++ impl ToTokens for MetaNameValue { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ path::printing::print_path(tokens, &self.path, PathStyle::Mod); ++ self.eq_token.to_tokens(tokens); ++ self.value.to_tokens(tokens); ++ } ++ } ++} +diff -Nru mesa-25.3.3/subprojects/syn-2.0.98/src/bigint.rs mesa-25.3.3/subprojects/syn-2.0.98/src/bigint.rs +--- mesa-25.3.3/subprojects/syn-2.0.98/src/bigint.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/syn-2.0.98/src/bigint.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,66 @@ ++use std::ops::{AddAssign, MulAssign}; ++ ++// For implementing base10_digits() accessor on LitInt. ++pub(crate) struct BigInt { ++ digits: Vec, ++} ++ ++impl BigInt { ++ pub(crate) fn new() -> Self { ++ BigInt { digits: Vec::new() } ++ } ++ ++ pub(crate) fn to_string(&self) -> String { ++ let mut repr = String::with_capacity(self.digits.len()); ++ ++ let mut has_nonzero = false; ++ for digit in self.digits.iter().rev() { ++ has_nonzero |= *digit != 0; ++ if has_nonzero { ++ repr.push((*digit + b'0') as char); ++ } ++ } ++ ++ if repr.is_empty() { ++ repr.push('0'); ++ } ++ ++ repr ++ } ++ ++ fn reserve_two_digits(&mut self) { ++ let len = self.digits.len(); ++ let desired = ++ len + !self.digits.ends_with(&[0, 0]) as usize + !self.digits.ends_with(&[0]) as usize; ++ self.digits.resize(desired, 0); ++ } ++} ++ ++impl AddAssign for BigInt { ++ // Assumes increment <16. ++ fn add_assign(&mut self, mut increment: u8) { ++ self.reserve_two_digits(); ++ ++ let mut i = 0; ++ while increment > 0 { ++ let sum = self.digits[i] + increment; ++ self.digits[i] = sum % 10; ++ increment = sum / 10; ++ i += 1; ++ } ++ } ++} ++ ++impl MulAssign for BigInt { ++ // Assumes base <=16. ++ fn mul_assign(&mut self, base: u8) { ++ self.reserve_two_digits(); ++ ++ let mut carry = 0; ++ for digit in &mut self.digits { ++ let prod = *digit * base + carry; ++ *digit = prod % 10; ++ carry = prod / 10; ++ } ++ } ++} +diff -Nru mesa-25.3.3/subprojects/syn-2.0.98/src/buffer.rs mesa-25.3.3/subprojects/syn-2.0.98/src/buffer.rs +--- mesa-25.3.3/subprojects/syn-2.0.98/src/buffer.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/syn-2.0.98/src/buffer.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,433 @@ ++//! A stably addressed token buffer supporting efficient traversal based on a ++//! cheaply copyable cursor. ++ ++// This module is heavily commented as it contains most of the unsafe code in ++// Syn, and caution should be used when editing it. The public-facing interface ++// is 100% safe but the implementation is fragile internally. ++ ++use crate::Lifetime; ++use proc_macro2::extra::DelimSpan; ++use proc_macro2::{Delimiter, Group, Ident, Literal, Punct, Spacing, Span, TokenStream, TokenTree}; ++use std::cmp::Ordering; ++use std::marker::PhantomData; ++ ++/// 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), ++ Ident(Ident), ++ Punct(Punct), ++ Literal(Literal), ++ // End entries contain the offset (negative) to the start of the buffer, and ++ // offset (negative) to the matching Group entry. ++ End(isize, isize), ++} ++ ++/// A buffer that can be efficiently traversed multiple times, unlike ++/// `TokenStream` which requires a deep copy in order to traverse more than ++/// once. ++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]>, ++} ++ ++impl TokenBuffer { ++ fn recursive_new(entries: &mut Vec, stream: TokenStream) { ++ for tt in stream { ++ 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::Group(group) => { ++ let group_start_index = entries.len(); ++ entries.push(Entry::End(0, 0)); // we replace this below ++ Self::recursive_new(entries, group.stream()); ++ let group_end_index = entries.len(); ++ let group_offset = group_end_index - group_start_index; ++ entries.push(Entry::End( ++ -(group_end_index as isize), ++ -(group_offset as isize), ++ )); ++ entries[group_start_index] = Entry::Group(group, group_offset); ++ } ++ } ++ } ++ } ++ ++ /// Creates a `TokenBuffer` containing all the tokens from the input ++ /// `proc_macro::TokenStream`. ++ #[cfg(feature = "proc-macro")] ++ #[cfg_attr(docsrs, doc(cfg(feature = "proc-macro")))] ++ pub fn new(stream: proc_macro::TokenStream) -> Self { ++ Self::new2(stream.into()) ++ } ++ ++ /// 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(-(entries.len() as isize), 0)); ++ Self { ++ entries: entries.into_boxed_slice(), ++ } ++ } ++ ++ /// 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)) } ++ } ++} ++ ++/// A cheaply copyable cursor into a `TokenBuffer`. ++/// ++/// This cursor holds a shared reference into the immutable data which is used ++/// internally to represent a `TokenStream`, and can be efficiently manipulated ++/// and copied around. ++/// ++/// An empty `Cursor` can be created directly, or one may create a `TokenBuffer` ++/// object and get a cursor to its first token with `begin()`. ++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 ++ // 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 ++ // valid. ++ marker: PhantomData<&'a Entry>, ++} ++ ++impl<'a> Cursor<'a> { ++ /// Creates a cursor referencing a static empty TokenStream. ++ pub fn empty() -> Self { ++ // It's safe in this situation for us to put an `Entry` object in global ++ // storage, despite it not actually being safe to send across threads ++ // (`Ident` is a reference into a thread-local table). This is because ++ // this entry never includes a `Ident` object. ++ // ++ // This wrapper struct allows us to break the rules and put a `Sync` ++ // object in global storage. ++ struct UnsafeSyncEntry(Entry); ++ unsafe impl Sync for UnsafeSyncEntry {} ++ static EMPTY_ENTRY: UnsafeSyncEntry = UnsafeSyncEntry(Entry::End(0, 0)); ++ ++ Cursor { ++ ptr: &EMPTY_ENTRY.0, ++ scope: &EMPTY_ENTRY.0, ++ marker: PhantomData, ++ } ++ } ++ ++ /// This create method intelligently exits non-explicitly-entered ++ /// `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 ++ // 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(..) = unsafe { &*ptr } { ++ if ptr == scope { ++ break; ++ } ++ ptr = unsafe { ptr.add(1) }; ++ } ++ ++ Cursor { ++ ptr, ++ scope, ++ marker: PhantomData, ++ } ++ } ++ ++ /// Get the current entry. ++ fn entry(self) -> &'a Entry { ++ unsafe { &*self.ptr } ++ } ++ ++ /// 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 { Cursor::create(self.ptr.offset(1), self.scope) } ++ } ++ ++ /// While the cursor is looking at a `None`-delimited group, move it to look ++ /// at the first token inside instead. If the group is empty, this will move ++ /// the cursor past the `None`-delimited group. ++ /// ++ /// WARNING: This mutates its argument. ++ fn ignore_none(&mut self) { ++ while let Entry::Group(group, _) = self.entry() { ++ if group.delimiter() == Delimiter::None { ++ unsafe { *self = self.bump_ignore_group() }; ++ } else { ++ break; ++ } ++ } ++ } ++ ++ /// Checks whether the cursor is currently pointing at the end of its valid ++ /// scope. ++ pub fn eof(self) -> bool { ++ // We're at eof if we're at the end of our scope. ++ self.ptr == self.scope ++ } ++ ++ /// If the cursor is pointing at a `Ident`, returns it along with a cursor ++ /// pointing at the next `TokenTree`. ++ 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() })), ++ _ => None, ++ } ++ } ++ ++ /// If the cursor is pointing at a `Punct`, returns it along with a cursor ++ /// pointing at the next `TokenTree`. ++ pub fn punct(mut self) -> Option<(Punct, Cursor<'a>)> { ++ self.ignore_none(); ++ match self.entry() { ++ Entry::Punct(punct) if punct.as_char() != '\'' => { ++ Some((punct.clone(), unsafe { self.bump_ignore_group() })) ++ } ++ _ => None, ++ } ++ } ++ ++ /// If the cursor is pointing at a `Literal`, return it along with a cursor ++ /// pointing at the next `TokenTree`. ++ 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() })), ++ _ => None, ++ } ++ } ++ ++ /// If the cursor is pointing at a `Lifetime`, returns it along with a ++ /// cursor pointing at the next `TokenTree`. ++ pub fn lifetime(mut self) -> Option<(Lifetime, 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)) ++ } ++ _ => None, ++ } ++ } ++ ++ /// If the cursor is pointing at a `Group` with the given delimiter, returns ++ /// a cursor into that group and one pointing to the next `TokenTree`. ++ pub fn group(mut self, delim: Delimiter) -> Option<(Cursor<'a>, DelimSpan, Cursor<'a>)> { ++ // If we're not trying to enter a none-delimited group, we want to ++ // ignore them. We have to make sure to _not_ ignore them when we want ++ // to enter them, of course. For obvious reasons. ++ if delim != Delimiter::None { ++ self.ignore_none(); ++ } ++ ++ if let Entry::Group(group, end_offset) = self.entry() { ++ if group.delimiter() == delim { ++ let span = group.delim_span(); ++ 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, span, after_group)); ++ } ++ } ++ ++ None ++ } ++ ++ /// If the cursor is pointing at a `Group`, returns a cursor into the group ++ /// and one pointing to the next `TokenTree`. ++ pub fn any_group(self) -> Option<(Cursor<'a>, Delimiter, DelimSpan, Cursor<'a>)> { ++ if let Entry::Group(group, end_offset) = self.entry() { ++ let delimiter = group.delimiter(); ++ let span = group.delim_span(); ++ 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, delimiter, span, after_group)); ++ } ++ ++ None ++ } ++ ++ pub(crate) fn any_group_token(self) -> Option<(Group, Cursor<'a>)> { ++ if let Entry::Group(group, end_offset) = self.entry() { ++ let end_of_group = unsafe { self.ptr.add(*end_offset) }; ++ let after_group = unsafe { Cursor::create(end_of_group, self.scope) }; ++ return Some((group.clone(), after_group)); ++ } ++ ++ None ++ } ++ ++ /// Copies all remaining tokens visible from this cursor into a ++ /// `TokenStream`. ++ pub fn token_stream(self) -> TokenStream { ++ let mut tts = Vec::new(); ++ let mut cursor = self; ++ while let Some((tt, rest)) = cursor.token_tree() { ++ tts.push(tt); ++ cursor = rest; ++ } ++ tts.into_iter().collect() ++ } ++ ++ /// If the cursor is pointing at a `TokenTree`, returns it along with a ++ /// cursor pointing at the next `TokenTree`. ++ /// ++ /// Returns `None` if the cursor has reached the end of its stream. ++ /// ++ /// 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 rest = unsafe { Cursor::create(self.ptr.add(len), self.scope) }; ++ Some((tree, rest)) ++ } ++ ++ /// Returns the `Span` of the current token, or `Span::call_site()` if this ++ /// cursor points to eof. ++ pub fn span(mut self) -> Span { ++ match self.entry() { ++ Entry::Group(group, _) => group.span(), ++ Entry::Literal(literal) => literal.span(), ++ Entry::Ident(ident) => ident.span(), ++ Entry::Punct(punct) => punct.span(), ++ Entry::End(_, offset) => { ++ self.ptr = unsafe { self.ptr.offset(*offset) }; ++ if let Entry::Group(group, _) = self.entry() { ++ group.span_close() ++ } else { ++ Span::call_site() ++ } ++ } ++ } ++ } ++ ++ /// Returns the `Span` of the token immediately prior to the position of ++ /// this cursor, or of the current token if there is no previous one. ++ #[cfg(any(feature = "full", feature = "derive"))] ++ pub(crate) fn prev_span(mut self) -> Span { ++ if start_of_buffer(self) < self.ptr { ++ self.ptr = unsafe { self.ptr.offset(-1) }; ++ } ++ self.span() ++ } ++ ++ /// Skip over the next token that is not a None-delimited group, without ++ /// cloning it. Returns `None` if this cursor points to eof. ++ /// ++ /// This method treats `'lifetimes` as a single token. ++ pub(crate) fn skip(mut self) -> Option> { ++ self.ignore_none(); ++ ++ let len = match self.entry() { ++ Entry::End(..) => return 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, ++ } ++ } ++ ++ Entry::Group(_, end_offset) => *end_offset, ++ _ => 1, ++ }; ++ ++ Some(unsafe { Cursor::create(self.ptr.add(len), self.scope) }) ++ } ++ ++ pub(crate) fn scope_delimiter(self) -> Delimiter { ++ match unsafe { &*self.scope } { ++ Entry::End(_, offset) => match unsafe { &*self.scope.offset(*offset) } { ++ Entry::Group(group, _) => group.delimiter(), ++ _ => Delimiter::None, ++ }, ++ _ => unreachable!(), ++ } ++ } ++} ++ ++impl<'a> Copy for Cursor<'a> {} ++ ++impl<'a> Clone for Cursor<'a> { ++ fn clone(&self) -> Self { ++ *self ++ } ++} ++ ++impl<'a> Eq for Cursor<'a> {} ++ ++impl<'a> PartialEq for Cursor<'a> { ++ fn eq(&self, other: &Self) -> bool { ++ self.ptr == other.ptr ++ } ++} ++ ++impl<'a> PartialOrd for Cursor<'a> { ++ fn partial_cmp(&self, other: &Self) -> Option { ++ if same_buffer(*self, *other) { ++ Some(cmp_assuming_same_buffer(*self, *other)) ++ } else { ++ None ++ } ++ } ++} ++ ++pub(crate) fn same_scope(a: Cursor, b: Cursor) -> bool { ++ a.scope == b.scope ++} ++ ++pub(crate) fn same_buffer(a: Cursor, b: Cursor) -> bool { ++ start_of_buffer(a) == start_of_buffer(b) ++} ++ ++fn start_of_buffer(cursor: Cursor) -> *const Entry { ++ unsafe { ++ match &*cursor.scope { ++ Entry::End(offset, _) => cursor.scope.offset(*offset), ++ _ => unreachable!(), ++ } ++ } ++} ++ ++pub(crate) fn cmp_assuming_same_buffer(a: Cursor, b: Cursor) -> Ordering { ++ a.ptr.cmp(&b.ptr) ++} ++ ++pub(crate) fn open_span_of_group(cursor: Cursor) -> Span { ++ match cursor.entry() { ++ Entry::Group(group, _) => group.span_open(), ++ _ => cursor.span(), ++ } ++} +diff -Nru mesa-25.3.3/subprojects/syn-2.0.98/src/classify.rs mesa-25.3.3/subprojects/syn-2.0.98/src/classify.rs +--- mesa-25.3.3/subprojects/syn-2.0.98/src/classify.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/syn-2.0.98/src/classify.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,311 @@ ++#[cfg(feature = "full")] ++use crate::expr::Expr; ++#[cfg(any(feature = "printing", feature = "full"))] ++use crate::generics::TypeParamBound; ++#[cfg(any(feature = "printing", feature = "full"))] ++use crate::path::{Path, PathArguments}; ++#[cfg(any(feature = "printing", feature = "full"))] ++use crate::punctuated::Punctuated; ++#[cfg(any(feature = "printing", feature = "full"))] ++use crate::ty::{ReturnType, Type}; ++#[cfg(feature = "full")] ++use proc_macro2::{Delimiter, TokenStream, TokenTree}; ++#[cfg(any(feature = "printing", feature = "full"))] ++use std::ops::ControlFlow; ++ ++#[cfg(feature = "full")] ++pub(crate) fn requires_semi_to_be_stmt(expr: &Expr) -> bool { ++ match expr { ++ Expr::Macro(expr) => !expr.mac.delimiter.is_brace(), ++ _ => requires_comma_to_be_match_arm(expr), ++ } ++} ++ ++#[cfg(feature = "full")] ++pub(crate) fn requires_comma_to_be_match_arm(expr: &Expr) -> bool { ++ match expr { ++ Expr::If(_) ++ | Expr::Match(_) ++ | Expr::Block(_) | Expr::Unsafe(_) // both under ExprKind::Block in rustc ++ | Expr::While(_) ++ | Expr::Loop(_) ++ | Expr::ForLoop(_) ++ | Expr::TryBlock(_) ++ | Expr::Const(_) => false, ++ ++ Expr::Array(_) ++ | Expr::Assign(_) ++ | Expr::Async(_) ++ | Expr::Await(_) ++ | Expr::Binary(_) ++ | Expr::Break(_) ++ | Expr::Call(_) ++ | Expr::Cast(_) ++ | Expr::Closure(_) ++ | Expr::Continue(_) ++ | Expr::Field(_) ++ | Expr::Group(_) ++ | Expr::Index(_) ++ | Expr::Infer(_) ++ | Expr::Let(_) ++ | Expr::Lit(_) ++ | Expr::Macro(_) ++ | Expr::MethodCall(_) ++ | Expr::Paren(_) ++ | Expr::Path(_) ++ | Expr::Range(_) ++ | Expr::RawAddr(_) ++ | Expr::Reference(_) ++ | Expr::Repeat(_) ++ | Expr::Return(_) ++ | Expr::Struct(_) ++ | Expr::Try(_) ++ | Expr::Tuple(_) ++ | Expr::Unary(_) ++ | Expr::Yield(_) ++ | Expr::Verbatim(_) => true, ++ } ++} ++ ++#[cfg(feature = "printing")] ++pub(crate) fn trailing_unparameterized_path(mut ty: &Type) -> bool { ++ loop { ++ match ty { ++ Type::BareFn(t) => match &t.output { ++ ReturnType::Default => return false, ++ ReturnType::Type(_, ret) => ty = ret, ++ }, ++ Type::ImplTrait(t) => match last_type_in_bounds(&t.bounds) { ++ ControlFlow::Break(trailing_path) => return trailing_path, ++ ControlFlow::Continue(t) => ty = t, ++ }, ++ Type::Path(t) => match last_type_in_path(&t.path) { ++ ControlFlow::Break(trailing_path) => return trailing_path, ++ ControlFlow::Continue(t) => ty = t, ++ }, ++ Type::Ptr(t) => ty = &t.elem, ++ Type::Reference(t) => ty = &t.elem, ++ Type::TraitObject(t) => match last_type_in_bounds(&t.bounds) { ++ ControlFlow::Break(trailing_path) => return trailing_path, ++ ControlFlow::Continue(t) => ty = t, ++ }, ++ ++ Type::Array(_) ++ | Type::Group(_) ++ | Type::Infer(_) ++ | Type::Macro(_) ++ | Type::Never(_) ++ | Type::Paren(_) ++ | Type::Slice(_) ++ | Type::Tuple(_) ++ | Type::Verbatim(_) => return false, ++ } ++ } ++ ++ fn last_type_in_path(path: &Path) -> ControlFlow { ++ match &path.segments.last().unwrap().arguments { ++ PathArguments::None => ControlFlow::Break(true), ++ PathArguments::AngleBracketed(_) => ControlFlow::Break(false), ++ PathArguments::Parenthesized(arg) => match &arg.output { ++ ReturnType::Default => ControlFlow::Break(false), ++ ReturnType::Type(_, ret) => ControlFlow::Continue(ret), ++ }, ++ } ++ } ++ ++ fn last_type_in_bounds( ++ bounds: &Punctuated, ++ ) -> ControlFlow { ++ match bounds.last().unwrap() { ++ TypeParamBound::Trait(t) => last_type_in_path(&t.path), ++ TypeParamBound::Lifetime(_) ++ | TypeParamBound::PreciseCapture(_) ++ | TypeParamBound::Verbatim(_) => ControlFlow::Break(false), ++ } ++ } ++} ++ ++/// Whether the expression's first token is the label of a loop/block. ++#[cfg(all(feature = "printing", feature = "full"))] ++pub(crate) fn expr_leading_label(mut expr: &Expr) -> bool { ++ loop { ++ match expr { ++ Expr::Block(e) => return e.label.is_some(), ++ Expr::ForLoop(e) => return e.label.is_some(), ++ Expr::Loop(e) => return e.label.is_some(), ++ Expr::While(e) => return e.label.is_some(), ++ ++ Expr::Assign(e) => expr = &e.left, ++ Expr::Await(e) => expr = &e.base, ++ Expr::Binary(e) => expr = &e.left, ++ Expr::Call(e) => expr = &e.func, ++ Expr::Cast(e) => expr = &e.expr, ++ Expr::Field(e) => expr = &e.base, ++ Expr::Index(e) => expr = &e.expr, ++ Expr::MethodCall(e) => expr = &e.receiver, ++ Expr::Range(e) => match &e.start { ++ Some(start) => expr = start, ++ None => return false, ++ }, ++ Expr::Try(e) => expr = &e.expr, ++ ++ Expr::Array(_) ++ | Expr::Async(_) ++ | Expr::Break(_) ++ | Expr::Closure(_) ++ | Expr::Const(_) ++ | Expr::Continue(_) ++ | Expr::Group(_) ++ | Expr::If(_) ++ | Expr::Infer(_) ++ | Expr::Let(_) ++ | Expr::Lit(_) ++ | Expr::Macro(_) ++ | Expr::Match(_) ++ | Expr::Paren(_) ++ | Expr::Path(_) ++ | Expr::RawAddr(_) ++ | Expr::Reference(_) ++ | Expr::Repeat(_) ++ | Expr::Return(_) ++ | Expr::Struct(_) ++ | Expr::TryBlock(_) ++ | Expr::Tuple(_) ++ | Expr::Unary(_) ++ | Expr::Unsafe(_) ++ | Expr::Verbatim(_) ++ | Expr::Yield(_) => return false, ++ } ++ } ++} ++ ++/// Whether the expression's last token is `}`. ++#[cfg(feature = "full")] ++pub(crate) fn expr_trailing_brace(mut expr: &Expr) -> bool { ++ loop { ++ match expr { ++ Expr::Async(_) ++ | Expr::Block(_) ++ | Expr::Const(_) ++ | Expr::ForLoop(_) ++ | Expr::If(_) ++ | Expr::Loop(_) ++ | Expr::Match(_) ++ | Expr::Struct(_) ++ | Expr::TryBlock(_) ++ | Expr::Unsafe(_) ++ | Expr::While(_) => return true, ++ ++ Expr::Assign(e) => expr = &e.right, ++ Expr::Binary(e) => expr = &e.right, ++ Expr::Break(e) => match &e.expr { ++ Some(e) => expr = e, ++ None => return false, ++ }, ++ Expr::Cast(e) => return type_trailing_brace(&e.ty), ++ Expr::Closure(e) => expr = &e.body, ++ Expr::Let(e) => expr = &e.expr, ++ Expr::Macro(e) => return e.mac.delimiter.is_brace(), ++ Expr::Range(e) => match &e.end { ++ Some(end) => expr = end, ++ None => return false, ++ }, ++ Expr::RawAddr(e) => expr = &e.expr, ++ Expr::Reference(e) => expr = &e.expr, ++ Expr::Return(e) => match &e.expr { ++ Some(e) => expr = e, ++ None => return false, ++ }, ++ Expr::Unary(e) => expr = &e.expr, ++ Expr::Verbatim(e) => return tokens_trailing_brace(e), ++ Expr::Yield(e) => match &e.expr { ++ Some(e) => expr = e, ++ None => return false, ++ }, ++ ++ Expr::Array(_) ++ | Expr::Await(_) ++ | Expr::Call(_) ++ | Expr::Continue(_) ++ | Expr::Field(_) ++ | Expr::Group(_) ++ | Expr::Index(_) ++ | Expr::Infer(_) ++ | Expr::Lit(_) ++ | Expr::MethodCall(_) ++ | Expr::Paren(_) ++ | Expr::Path(_) ++ | Expr::Repeat(_) ++ | Expr::Try(_) ++ | Expr::Tuple(_) => return false, ++ } ++ } ++ ++ fn type_trailing_brace(mut ty: &Type) -> bool { ++ loop { ++ match ty { ++ Type::BareFn(t) => match &t.output { ++ ReturnType::Default => return false, ++ ReturnType::Type(_, ret) => ty = ret, ++ }, ++ Type::ImplTrait(t) => match last_type_in_bounds(&t.bounds) { ++ ControlFlow::Break(trailing_brace) => return trailing_brace, ++ ControlFlow::Continue(t) => ty = t, ++ }, ++ Type::Macro(t) => return t.mac.delimiter.is_brace(), ++ Type::Path(t) => match last_type_in_path(&t.path) { ++ Some(t) => ty = t, ++ None => return false, ++ }, ++ Type::Ptr(t) => ty = &t.elem, ++ Type::Reference(t) => ty = &t.elem, ++ Type::TraitObject(t) => match last_type_in_bounds(&t.bounds) { ++ ControlFlow::Break(trailing_brace) => return trailing_brace, ++ ControlFlow::Continue(t) => ty = t, ++ }, ++ Type::Verbatim(t) => return tokens_trailing_brace(t), ++ ++ Type::Array(_) ++ | Type::Group(_) ++ | Type::Infer(_) ++ | Type::Never(_) ++ | Type::Paren(_) ++ | Type::Slice(_) ++ | Type::Tuple(_) => return false, ++ } ++ } ++ } ++ ++ fn last_type_in_path(path: &Path) -> Option<&Type> { ++ match &path.segments.last().unwrap().arguments { ++ PathArguments::None | PathArguments::AngleBracketed(_) => None, ++ PathArguments::Parenthesized(arg) => match &arg.output { ++ ReturnType::Default => None, ++ ReturnType::Type(_, ret) => Some(ret), ++ }, ++ } ++ } ++ ++ fn last_type_in_bounds( ++ bounds: &Punctuated, ++ ) -> ControlFlow { ++ match bounds.last().unwrap() { ++ TypeParamBound::Trait(t) => match last_type_in_path(&t.path) { ++ Some(t) => ControlFlow::Continue(t), ++ None => ControlFlow::Break(false), ++ }, ++ TypeParamBound::Lifetime(_) | TypeParamBound::PreciseCapture(_) => { ++ ControlFlow::Break(false) ++ } ++ TypeParamBound::Verbatim(t) => ControlFlow::Break(tokens_trailing_brace(t)), ++ } ++ } ++ ++ fn tokens_trailing_brace(tokens: &TokenStream) -> bool { ++ if let Some(TokenTree::Group(last)) = tokens.clone().into_iter().last() { ++ last.delimiter() == Delimiter::Brace ++ } else { ++ false ++ } ++ } ++} +diff -Nru mesa-25.3.3/subprojects/syn-2.0.98/src/custom_keyword.rs mesa-25.3.3/subprojects/syn-2.0.98/src/custom_keyword.rs +--- mesa-25.3.3/subprojects/syn-2.0.98/src/custom_keyword.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/syn-2.0.98/src/custom_keyword.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,260 @@ ++/// Define a type that supports parsing and printing a given identifier as if it ++/// were a keyword. ++/// ++/// # Usage ++/// ++/// As a convention, it is recommended that this macro be invoked within a ++/// module called `kw` or `keyword` and that the resulting parser be invoked ++/// with a `kw::` or `keyword::` prefix. ++/// ++/// ``` ++/// mod kw { ++/// syn::custom_keyword!(whatever); ++/// } ++/// ``` ++/// ++/// The generated syntax tree node supports the following operations just like ++/// any built-in keyword token. ++/// ++/// - [Peeking] — `input.peek(kw::whatever)` ++/// ++/// - [Parsing] — `input.parse::()?` ++/// ++/// - [Printing] — `quote!( ... #whatever_token ... )` ++/// ++/// - Construction from a [`Span`] — `let whatever_token = kw::whatever(sp)` ++/// ++/// - Field access to its span — `let sp = whatever_token.span` ++/// ++/// [Peeking]: crate::parse::ParseBuffer::peek ++/// [Parsing]: crate::parse::ParseBuffer::parse ++/// [Printing]: quote::ToTokens ++/// [`Span`]: proc_macro2::Span ++/// ++/// # Example ++/// ++/// This example parses input that looks like `bool = true` or `str = "value"`. ++/// The key must be either the identifier `bool` or the identifier `str`. If ++/// `bool`, the value may be either `true` or `false`. If `str`, the value may ++/// be any string literal. ++/// ++/// The symbols `bool` and `str` are not reserved keywords in Rust so these are ++/// not considered keywords in the `syn::token` module. Like any other ++/// identifier that is not a keyword, these can be declared as custom keywords ++/// by crates that need to use them as such. ++/// ++/// ``` ++/// use syn::{LitBool, LitStr, Result, Token}; ++/// use syn::parse::{Parse, ParseStream}; ++/// ++/// mod kw { ++/// syn::custom_keyword!(bool); ++/// syn::custom_keyword!(str); ++/// } ++/// ++/// enum Argument { ++/// Bool { ++/// bool_token: kw::bool, ++/// eq_token: Token![=], ++/// value: LitBool, ++/// }, ++/// Str { ++/// str_token: kw::str, ++/// eq_token: Token![=], ++/// value: LitStr, ++/// }, ++/// } ++/// ++/// impl Parse for Argument { ++/// fn parse(input: ParseStream) -> Result { ++/// let lookahead = input.lookahead1(); ++/// if lookahead.peek(kw::bool) { ++/// Ok(Argument::Bool { ++/// bool_token: input.parse::()?, ++/// eq_token: input.parse()?, ++/// value: input.parse()?, ++/// }) ++/// } else if lookahead.peek(kw::str) { ++/// Ok(Argument::Str { ++/// str_token: input.parse::()?, ++/// eq_token: input.parse()?, ++/// value: input.parse()?, ++/// }) ++/// } else { ++/// Err(lookahead.error()) ++/// } ++/// } ++/// } ++/// ``` ++#[macro_export] ++macro_rules! custom_keyword { ++ ($ident:ident) => { ++ #[allow(non_camel_case_types)] ++ pub struct $ident { ++ #[allow(dead_code)] ++ pub span: $crate::__private::Span, ++ } ++ ++ #[doc(hidden)] ++ #[allow(dead_code, non_snake_case)] ++ pub fn $ident<__S: $crate::__private::IntoSpans<$crate::__private::Span>>( ++ span: __S, ++ ) -> $ident { ++ $ident { ++ span: $crate::__private::IntoSpans::into_spans(span), ++ } ++ } ++ ++ const _: () = { ++ impl $crate::__private::Default for $ident { ++ fn default() -> Self { ++ $ident { ++ span: $crate::__private::Span::call_site(), ++ } ++ } ++ } ++ ++ $crate::impl_parse_for_custom_keyword!($ident); ++ $crate::impl_to_tokens_for_custom_keyword!($ident); ++ $crate::impl_clone_for_custom_keyword!($ident); ++ $crate::impl_extra_traits_for_custom_keyword!($ident); ++ }; ++ }; ++} ++ ++// Not public API. ++#[cfg(feature = "parsing")] ++#[doc(hidden)] ++#[macro_export] ++macro_rules! impl_parse_for_custom_keyword { ++ ($ident:ident) => { ++ // For peek. ++ impl $crate::__private::CustomToken for $ident { ++ fn peek(cursor: $crate::buffer::Cursor) -> $crate::__private::bool { ++ if let $crate::__private::Some((ident, _rest)) = cursor.ident() { ++ ident == $crate::__private::stringify!($ident) ++ } else { ++ false ++ } ++ } ++ ++ fn display() -> &'static $crate::__private::str { ++ $crate::__private::concat!("`", $crate::__private::stringify!($ident), "`") ++ } ++ } ++ ++ impl $crate::parse::Parse for $ident { ++ fn parse(input: $crate::parse::ParseStream) -> $crate::parse::Result<$ident> { ++ input.step(|cursor| { ++ if let $crate::__private::Some((ident, rest)) = cursor.ident() { ++ if ident == $crate::__private::stringify!($ident) { ++ return $crate::__private::Ok(($ident { span: ident.span() }, rest)); ++ } ++ } ++ $crate::__private::Err(cursor.error($crate::__private::concat!( ++ "expected `", ++ $crate::__private::stringify!($ident), ++ "`", ++ ))) ++ }) ++ } ++ } ++ }; ++} ++ ++// Not public API. ++#[cfg(not(feature = "parsing"))] ++#[doc(hidden)] ++#[macro_export] ++macro_rules! impl_parse_for_custom_keyword { ++ ($ident:ident) => {}; ++} ++ ++// Not public API. ++#[cfg(feature = "printing")] ++#[doc(hidden)] ++#[macro_export] ++macro_rules! impl_to_tokens_for_custom_keyword { ++ ($ident:ident) => { ++ impl $crate::__private::ToTokens for $ident { ++ fn to_tokens(&self, tokens: &mut $crate::__private::TokenStream2) { ++ let ident = $crate::Ident::new($crate::__private::stringify!($ident), self.span); ++ $crate::__private::TokenStreamExt::append(tokens, ident); ++ } ++ } ++ }; ++} ++ ++// Not public API. ++#[cfg(not(feature = "printing"))] ++#[doc(hidden)] ++#[macro_export] ++macro_rules! impl_to_tokens_for_custom_keyword { ++ ($ident:ident) => {}; ++} ++ ++// Not public API. ++#[cfg(feature = "clone-impls")] ++#[doc(hidden)] ++#[macro_export] ++macro_rules! impl_clone_for_custom_keyword { ++ ($ident:ident) => { ++ impl $crate::__private::Copy for $ident {} ++ ++ #[allow(clippy::expl_impl_clone_on_copy)] ++ impl $crate::__private::Clone for $ident { ++ fn clone(&self) -> Self { ++ *self ++ } ++ } ++ }; ++} ++ ++// Not public API. ++#[cfg(not(feature = "clone-impls"))] ++#[doc(hidden)] ++#[macro_export] ++macro_rules! impl_clone_for_custom_keyword { ++ ($ident:ident) => {}; ++} ++ ++// Not public API. ++#[cfg(feature = "extra-traits")] ++#[doc(hidden)] ++#[macro_export] ++macro_rules! impl_extra_traits_for_custom_keyword { ++ ($ident:ident) => { ++ impl $crate::__private::Debug for $ident { ++ fn fmt(&self, f: &mut $crate::__private::Formatter) -> $crate::__private::FmtResult { ++ $crate::__private::Formatter::write_str( ++ f, ++ $crate::__private::concat!( ++ "Keyword [", ++ $crate::__private::stringify!($ident), ++ "]", ++ ), ++ ) ++ } ++ } ++ ++ impl $crate::__private::Eq for $ident {} ++ ++ impl $crate::__private::PartialEq for $ident { ++ fn eq(&self, _other: &Self) -> $crate::__private::bool { ++ true ++ } ++ } ++ ++ impl $crate::__private::Hash for $ident { ++ fn hash<__H: $crate::__private::Hasher>(&self, _state: &mut __H) {} ++ } ++ }; ++} ++ ++// Not public API. ++#[cfg(not(feature = "extra-traits"))] ++#[doc(hidden)] ++#[macro_export] ++macro_rules! impl_extra_traits_for_custom_keyword { ++ ($ident:ident) => {}; ++} +diff -Nru mesa-25.3.3/subprojects/syn-2.0.98/src/custom_punctuation.rs mesa-25.3.3/subprojects/syn-2.0.98/src/custom_punctuation.rs +--- mesa-25.3.3/subprojects/syn-2.0.98/src/custom_punctuation.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/syn-2.0.98/src/custom_punctuation.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,304 @@ ++/// Define a type that supports parsing and printing a multi-character symbol ++/// as if it were a punctuation token. ++/// ++/// # Usage ++/// ++/// ``` ++/// syn::custom_punctuation!(LeftRightArrow, <=>); ++/// ``` ++/// ++/// The generated syntax tree node supports the following operations just like ++/// any built-in punctuation token. ++/// ++/// - [Peeking] — `input.peek(LeftRightArrow)` ++/// ++/// - [Parsing] — `input.parse::()?` ++/// ++/// - [Printing] — `quote!( ... #lrarrow ... )` ++/// ++/// - Construction from a [`Span`] — `let lrarrow = LeftRightArrow(sp)` ++/// ++/// - Construction from multiple [`Span`] — `let lrarrow = LeftRightArrow([sp, sp, sp])` ++/// ++/// - Field access to its spans — `let spans = lrarrow.spans` ++/// ++/// [Peeking]: crate::parse::ParseBuffer::peek ++/// [Parsing]: crate::parse::ParseBuffer::parse ++/// [Printing]: quote::ToTokens ++/// [`Span`]: proc_macro2::Span ++/// ++/// # Example ++/// ++/// ``` ++/// use proc_macro2::{TokenStream, TokenTree}; ++/// use syn::parse::{Parse, ParseStream, Peek, Result}; ++/// use syn::punctuated::Punctuated; ++/// use syn::Expr; ++/// ++/// syn::custom_punctuation!(PathSeparator, ); ++/// ++/// // expr expr expr ... ++/// struct PathSegments { ++/// segments: Punctuated, ++/// } ++/// ++/// impl Parse for PathSegments { ++/// fn parse(input: ParseStream) -> Result { ++/// let mut segments = Punctuated::new(); ++/// ++/// let first = parse_until(input, PathSeparator)?; ++/// segments.push_value(syn::parse2(first)?); ++/// ++/// while input.peek(PathSeparator) { ++/// segments.push_punct(input.parse()?); ++/// ++/// let next = parse_until(input, PathSeparator)?; ++/// segments.push_value(syn::parse2(next)?); ++/// } ++/// ++/// Ok(PathSegments { segments }) ++/// } ++/// } ++/// ++/// fn parse_until(input: ParseStream, end: E) -> Result { ++/// let mut tokens = TokenStream::new(); ++/// while !input.is_empty() && !input.peek(end) { ++/// let next: TokenTree = input.parse()?; ++/// tokens.extend(Some(next)); ++/// } ++/// Ok(tokens) ++/// } ++/// ++/// fn main() { ++/// let input = r#" a::b c::d::e "#; ++/// let _: PathSegments = syn::parse_str(input).unwrap(); ++/// } ++/// ``` ++#[macro_export] ++macro_rules! custom_punctuation { ++ ($ident:ident, $($tt:tt)+) => { ++ pub struct $ident { ++ #[allow(dead_code)] ++ pub spans: $crate::custom_punctuation_repr!($($tt)+), ++ } ++ ++ #[doc(hidden)] ++ #[allow(dead_code, non_snake_case)] ++ pub fn $ident<__S: $crate::__private::IntoSpans<$crate::custom_punctuation_repr!($($tt)+)>>( ++ spans: __S, ++ ) -> $ident { ++ let _validate_len = 0 $(+ $crate::custom_punctuation_len!(strict, $tt))*; ++ $ident { ++ spans: $crate::__private::IntoSpans::into_spans(spans) ++ } ++ } ++ ++ const _: () = { ++ impl $crate::__private::Default for $ident { ++ fn default() -> Self { ++ $ident($crate::__private::Span::call_site()) ++ } ++ } ++ ++ $crate::impl_parse_for_custom_punctuation!($ident, $($tt)+); ++ $crate::impl_to_tokens_for_custom_punctuation!($ident, $($tt)+); ++ $crate::impl_clone_for_custom_punctuation!($ident, $($tt)+); ++ $crate::impl_extra_traits_for_custom_punctuation!($ident, $($tt)+); ++ }; ++ }; ++} ++ ++// Not public API. ++#[cfg(feature = "parsing")] ++#[doc(hidden)] ++#[macro_export] ++macro_rules! impl_parse_for_custom_punctuation { ++ ($ident:ident, $($tt:tt)+) => { ++ impl $crate::__private::CustomToken for $ident { ++ fn peek(cursor: $crate::buffer::Cursor) -> $crate::__private::bool { ++ $crate::__private::peek_punct(cursor, $crate::stringify_punct!($($tt)+)) ++ } ++ ++ fn display() -> &'static $crate::__private::str { ++ $crate::__private::concat!("`", $crate::stringify_punct!($($tt)+), "`") ++ } ++ } ++ ++ impl $crate::parse::Parse for $ident { ++ fn parse(input: $crate::parse::ParseStream) -> $crate::parse::Result<$ident> { ++ let spans: $crate::custom_punctuation_repr!($($tt)+) = ++ $crate::__private::parse_punct(input, $crate::stringify_punct!($($tt)+))?; ++ Ok($ident(spans)) ++ } ++ } ++ }; ++} ++ ++// Not public API. ++#[cfg(not(feature = "parsing"))] ++#[doc(hidden)] ++#[macro_export] ++macro_rules! impl_parse_for_custom_punctuation { ++ ($ident:ident, $($tt:tt)+) => {}; ++} ++ ++// Not public API. ++#[cfg(feature = "printing")] ++#[doc(hidden)] ++#[macro_export] ++macro_rules! impl_to_tokens_for_custom_punctuation { ++ ($ident:ident, $($tt:tt)+) => { ++ impl $crate::__private::ToTokens for $ident { ++ fn to_tokens(&self, tokens: &mut $crate::__private::TokenStream2) { ++ $crate::__private::print_punct($crate::stringify_punct!($($tt)+), &self.spans, tokens) ++ } ++ } ++ }; ++} ++ ++// Not public API. ++#[cfg(not(feature = "printing"))] ++#[doc(hidden)] ++#[macro_export] ++macro_rules! impl_to_tokens_for_custom_punctuation { ++ ($ident:ident, $($tt:tt)+) => {}; ++} ++ ++// Not public API. ++#[cfg(feature = "clone-impls")] ++#[doc(hidden)] ++#[macro_export] ++macro_rules! impl_clone_for_custom_punctuation { ++ ($ident:ident, $($tt:tt)+) => { ++ impl $crate::__private::Copy for $ident {} ++ ++ #[allow(clippy::expl_impl_clone_on_copy)] ++ impl $crate::__private::Clone for $ident { ++ fn clone(&self) -> Self { ++ *self ++ } ++ } ++ }; ++} ++ ++// Not public API. ++#[cfg(not(feature = "clone-impls"))] ++#[doc(hidden)] ++#[macro_export] ++macro_rules! impl_clone_for_custom_punctuation { ++ ($ident:ident, $($tt:tt)+) => {}; ++} ++ ++// Not public API. ++#[cfg(feature = "extra-traits")] ++#[doc(hidden)] ++#[macro_export] ++macro_rules! impl_extra_traits_for_custom_punctuation { ++ ($ident:ident, $($tt:tt)+) => { ++ impl $crate::__private::Debug for $ident { ++ fn fmt(&self, f: &mut $crate::__private::Formatter) -> $crate::__private::FmtResult { ++ $crate::__private::Formatter::write_str(f, $crate::__private::stringify!($ident)) ++ } ++ } ++ ++ impl $crate::__private::Eq for $ident {} ++ ++ impl $crate::__private::PartialEq for $ident { ++ fn eq(&self, _other: &Self) -> $crate::__private::bool { ++ true ++ } ++ } ++ ++ impl $crate::__private::Hash for $ident { ++ fn hash<__H: $crate::__private::Hasher>(&self, _state: &mut __H) {} ++ } ++ }; ++} ++ ++// Not public API. ++#[cfg(not(feature = "extra-traits"))] ++#[doc(hidden)] ++#[macro_export] ++macro_rules! impl_extra_traits_for_custom_punctuation { ++ ($ident:ident, $($tt:tt)+) => {}; ++} ++ ++// Not public API. ++#[doc(hidden)] ++#[macro_export] ++macro_rules! custom_punctuation_repr { ++ ($($tt:tt)+) => { ++ [$crate::__private::Span; 0 $(+ $crate::custom_punctuation_len!(lenient, $tt))+] ++ }; ++} ++ ++// Not public API. ++#[doc(hidden)] ++#[macro_export] ++#[rustfmt::skip] ++macro_rules! custom_punctuation_len { ++ ($mode:ident, &) => { 1 }; ++ ($mode:ident, &&) => { 2 }; ++ ($mode:ident, &=) => { 2 }; ++ ($mode:ident, @) => { 1 }; ++ ($mode:ident, ^) => { 1 }; ++ ($mode:ident, ^=) => { 2 }; ++ ($mode:ident, :) => { 1 }; ++ ($mode:ident, ,) => { 1 }; ++ ($mode:ident, $) => { 1 }; ++ ($mode:ident, .) => { 1 }; ++ ($mode:ident, ..) => { 2 }; ++ ($mode:ident, ...) => { 3 }; ++ ($mode:ident, ..=) => { 3 }; ++ ($mode:ident, =) => { 1 }; ++ ($mode:ident, ==) => { 2 }; ++ ($mode:ident, =>) => { 2 }; ++ ($mode:ident, >=) => { 2 }; ++ ($mode:ident, >) => { 1 }; ++ ($mode:ident, <-) => { 2 }; ++ ($mode:ident, <=) => { 2 }; ++ ($mode:ident, <) => { 1 }; ++ ($mode:ident, -) => { 1 }; ++ ($mode:ident, -=) => { 2 }; ++ ($mode:ident, !=) => { 2 }; ++ ($mode:ident, !) => { 1 }; ++ ($mode:ident, |) => { 1 }; ++ ($mode:ident, |=) => { 2 }; ++ ($mode:ident, ||) => { 2 }; ++ ($mode:ident, ::) => { 2 }; ++ ($mode:ident, %) => { 1 }; ++ ($mode:ident, %=) => { 2 }; ++ ($mode:ident, +) => { 1 }; ++ ($mode:ident, +=) => { 2 }; ++ ($mode:ident, #) => { 1 }; ++ ($mode:ident, ?) => { 1 }; ++ ($mode:ident, ->) => { 2 }; ++ ($mode:ident, ;) => { 1 }; ++ ($mode:ident, <<) => { 2 }; ++ ($mode:ident, <<=) => { 3 }; ++ ($mode:ident, >>) => { 2 }; ++ ($mode:ident, >>=) => { 3 }; ++ ($mode:ident, /) => { 1 }; ++ ($mode:ident, /=) => { 2 }; ++ ($mode:ident, *) => { 1 }; ++ ($mode:ident, *=) => { 2 }; ++ ($mode:ident, ~) => { 1 }; ++ (lenient, $tt:tt) => { 0 }; ++ (strict, $tt:tt) => {{ $crate::custom_punctuation_unexpected!($tt); 0 }}; ++} ++ ++// Not public API. ++#[doc(hidden)] ++#[macro_export] ++macro_rules! custom_punctuation_unexpected { ++ () => {}; ++} ++ ++// Not public API. ++#[doc(hidden)] ++#[macro_export] ++macro_rules! stringify_punct { ++ ($($tt:tt)+) => { ++ $crate::__private::concat!($($crate::__private::stringify!($tt)),+) ++ }; ++} +diff -Nru mesa-25.3.3/subprojects/syn-2.0.98/src/data.rs mesa-25.3.3/subprojects/syn-2.0.98/src/data.rs +--- mesa-25.3.3/subprojects/syn-2.0.98/src/data.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/syn-2.0.98/src/data.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,424 @@ ++use crate::attr::Attribute; ++use crate::expr::{Expr, Index, Member}; ++use crate::ident::Ident; ++use crate::punctuated::{self, Punctuated}; ++use crate::restriction::{FieldMutability, Visibility}; ++use crate::token; ++use crate::ty::Type; ++ ++ast_struct! { ++ /// An enum variant. ++ #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))] ++ pub struct Variant { ++ pub attrs: Vec, ++ ++ /// Name of the variant. ++ pub ident: Ident, ++ ++ /// Content stored in the variant. ++ pub fields: Fields, ++ ++ /// Explicit discriminant: `Variant = 1` ++ pub discriminant: Option<(Token![=], Expr)>, ++ } ++} ++ ++ast_enum_of_structs! { ++ /// Data stored within an enum variant or struct. ++ /// ++ /// # Syntax tree enum ++ /// ++ /// This type is a [syntax tree enum]. ++ /// ++ /// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums ++ #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))] ++ pub enum Fields { ++ /// Named fields of a struct or struct variant such as `Point { x: f64, ++ /// y: f64 }`. ++ Named(FieldsNamed), ++ ++ /// Unnamed fields of a tuple struct or tuple variant such as `Some(T)`. ++ Unnamed(FieldsUnnamed), ++ ++ /// Unit struct or unit variant such as `None`. ++ Unit, ++ } ++} ++ ++ast_struct! { ++ /// Named fields of a struct or struct variant such as `Point { x: f64, ++ /// y: f64 }`. ++ #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))] ++ pub struct FieldsNamed { ++ pub brace_token: token::Brace, ++ pub named: Punctuated, ++ } ++} ++ ++ast_struct! { ++ /// Unnamed fields of a tuple struct or tuple variant such as `Some(T)`. ++ #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))] ++ pub struct FieldsUnnamed { ++ pub paren_token: token::Paren, ++ pub unnamed: Punctuated, ++ } ++} ++ ++impl Fields { ++ /// Get an iterator over the borrowed [`Field`] items in this object. This ++ /// iterator can be used to iterate over a named or unnamed struct or ++ /// variant's fields uniformly. ++ pub fn iter(&self) -> punctuated::Iter { ++ match self { ++ Fields::Unit => crate::punctuated::empty_punctuated_iter(), ++ Fields::Named(f) => f.named.iter(), ++ Fields::Unnamed(f) => f.unnamed.iter(), ++ } ++ } ++ ++ /// Get an iterator over the mutably borrowed [`Field`] items in this ++ /// object. This iterator can be used to iterate over a named or unnamed ++ /// struct or variant's fields uniformly. ++ pub fn iter_mut(&mut self) -> punctuated::IterMut { ++ match self { ++ Fields::Unit => crate::punctuated::empty_punctuated_iter_mut(), ++ Fields::Named(f) => f.named.iter_mut(), ++ Fields::Unnamed(f) => f.unnamed.iter_mut(), ++ } ++ } ++ ++ /// Returns the number of fields. ++ pub fn len(&self) -> usize { ++ match self { ++ Fields::Unit => 0, ++ Fields::Named(f) => f.named.len(), ++ Fields::Unnamed(f) => f.unnamed.len(), ++ } ++ } ++ ++ /// Returns `true` if there are zero fields. ++ pub fn is_empty(&self) -> bool { ++ match self { ++ Fields::Unit => true, ++ Fields::Named(f) => f.named.is_empty(), ++ Fields::Unnamed(f) => f.unnamed.is_empty(), ++ } ++ } ++ ++ return_impl_trait! { ++ /// Get an iterator over the fields of a struct or variant as [`Member`]s. ++ /// This iterator can be used to iterate over a named or unnamed struct or ++ /// variant's fields uniformly. ++ /// ++ /// # Example ++ /// ++ /// The following is a simplistic [`Clone`] derive for structs. (A more ++ /// complete implementation would additionally want to infer trait bounds on ++ /// the generic type parameters.) ++ /// ++ /// ``` ++ /// # use quote::quote; ++ /// # ++ /// fn derive_clone(input: &syn::ItemStruct) -> proc_macro2::TokenStream { ++ /// let ident = &input.ident; ++ /// let members = input.fields.members(); ++ /// let (impl_generics, ty_generics, where_clause) = input.generics.split_for_impl(); ++ /// quote! { ++ /// impl #impl_generics Clone for #ident #ty_generics #where_clause { ++ /// fn clone(&self) -> Self { ++ /// Self { ++ /// #(#members: self.#members.clone()),* ++ /// } ++ /// } ++ /// } ++ /// } ++ /// } ++ /// ``` ++ /// ++ /// For structs with named fields, it produces an expression like `Self { a: ++ /// self.a.clone() }`. For structs with unnamed fields, `Self { 0: ++ /// self.0.clone() }`. And for unit structs, `Self {}`. ++ pub fn members(&self) -> impl Iterator + Clone + '_ [Members] { ++ Members { ++ fields: self.iter(), ++ index: 0, ++ } ++ } ++ } ++} ++ ++impl IntoIterator for Fields { ++ type Item = Field; ++ type IntoIter = punctuated::IntoIter; ++ ++ fn into_iter(self) -> Self::IntoIter { ++ match self { ++ Fields::Unit => Punctuated::::new().into_iter(), ++ Fields::Named(f) => f.named.into_iter(), ++ Fields::Unnamed(f) => f.unnamed.into_iter(), ++ } ++ } ++} ++ ++impl<'a> IntoIterator for &'a Fields { ++ type Item = &'a Field; ++ type IntoIter = punctuated::Iter<'a, Field>; ++ ++ fn into_iter(self) -> Self::IntoIter { ++ self.iter() ++ } ++} ++ ++impl<'a> IntoIterator for &'a mut Fields { ++ type Item = &'a mut Field; ++ type IntoIter = punctuated::IterMut<'a, Field>; ++ ++ fn into_iter(self) -> Self::IntoIter { ++ self.iter_mut() ++ } ++} ++ ++ast_struct! { ++ /// A field of a struct or enum variant. ++ #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))] ++ pub struct Field { ++ pub attrs: Vec, ++ ++ pub vis: Visibility, ++ ++ pub mutability: FieldMutability, ++ ++ /// Name of the field, if any. ++ /// ++ /// Fields of tuple structs have no names. ++ pub ident: Option, ++ ++ pub colon_token: Option, ++ ++ pub ty: Type, ++ } ++} ++ ++pub struct Members<'a> { ++ fields: punctuated::Iter<'a, Field>, ++ index: u32, ++} ++ ++impl<'a> Iterator for Members<'a> { ++ type Item = Member; ++ ++ fn next(&mut self) -> Option { ++ let field = self.fields.next()?; ++ let member = match &field.ident { ++ Some(ident) => Member::Named(ident.clone()), ++ None => { ++ #[cfg(all(feature = "parsing", feature = "printing"))] ++ let span = crate::spanned::Spanned::span(&field.ty); ++ #[cfg(not(all(feature = "parsing", feature = "printing")))] ++ let span = proc_macro2::Span::call_site(); ++ Member::Unnamed(Index { ++ index: self.index, ++ span, ++ }) ++ } ++ }; ++ self.index += 1; ++ Some(member) ++ } ++} ++ ++impl<'a> Clone for Members<'a> { ++ fn clone(&self) -> Self { ++ Members { ++ fields: self.fields.clone(), ++ index: self.index, ++ } ++ } ++} ++ ++#[cfg(feature = "parsing")] ++pub(crate) mod parsing { ++ use crate::attr::Attribute; ++ use crate::data::{Field, Fields, FieldsNamed, FieldsUnnamed, Variant}; ++ use crate::error::Result; ++ use crate::expr::Expr; ++ use crate::ext::IdentExt as _; ++ use crate::ident::Ident; ++ #[cfg(not(feature = "full"))] ++ use crate::parse::discouraged::Speculative as _; ++ use crate::parse::{Parse, ParseStream}; ++ use crate::restriction::{FieldMutability, Visibility}; ++ #[cfg(not(feature = "full"))] ++ use crate::scan_expr::scan_expr; ++ use crate::token; ++ use crate::ty::Type; ++ use crate::verbatim; ++ ++ #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))] ++ impl Parse for Variant { ++ fn parse(input: ParseStream) -> Result { ++ let attrs = input.call(Attribute::parse_outer)?; ++ let _visibility: Visibility = input.parse()?; ++ let ident: Ident = input.parse()?; ++ let fields = if input.peek(token::Brace) { ++ Fields::Named(input.parse()?) ++ } else if input.peek(token::Paren) { ++ Fields::Unnamed(input.parse()?) ++ } else { ++ Fields::Unit ++ }; ++ let discriminant = if input.peek(Token![=]) { ++ let eq_token: Token![=] = input.parse()?; ++ #[cfg(feature = "full")] ++ let discriminant: Expr = input.parse()?; ++ #[cfg(not(feature = "full"))] ++ let discriminant = { ++ let begin = input.fork(); ++ let ahead = input.fork(); ++ let mut discriminant: Result = ahead.parse(); ++ if discriminant.is_ok() { ++ input.advance_to(&ahead); ++ } else if scan_expr(input).is_ok() { ++ discriminant = Ok(Expr::Verbatim(verbatim::between(&begin, input))); ++ } ++ discriminant? ++ }; ++ Some((eq_token, discriminant)) ++ } else { ++ None ++ }; ++ Ok(Variant { ++ attrs, ++ ident, ++ fields, ++ discriminant, ++ }) ++ } ++ } ++ ++ #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))] ++ impl Parse for FieldsNamed { ++ fn parse(input: ParseStream) -> Result { ++ let content; ++ Ok(FieldsNamed { ++ brace_token: braced!(content in input), ++ named: content.parse_terminated(Field::parse_named, Token![,])?, ++ }) ++ } ++ } ++ ++ #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))] ++ impl Parse for FieldsUnnamed { ++ fn parse(input: ParseStream) -> Result { ++ let content; ++ Ok(FieldsUnnamed { ++ paren_token: parenthesized!(content in input), ++ unnamed: content.parse_terminated(Field::parse_unnamed, Token![,])?, ++ }) ++ } ++ } ++ ++ impl Field { ++ /// Parses a named (braced struct) field. ++ #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))] ++ pub fn parse_named(input: ParseStream) -> Result { ++ let attrs = input.call(Attribute::parse_outer)?; ++ let vis: Visibility = input.parse()?; ++ ++ let unnamed_field = cfg!(feature = "full") && input.peek(Token![_]); ++ let ident = if unnamed_field { ++ input.call(Ident::parse_any) ++ } else { ++ input.parse() ++ }?; ++ ++ let colon_token: Token![:] = input.parse()?; ++ ++ let ty: Type = if unnamed_field ++ && (input.peek(Token![struct]) ++ || input.peek(Token![union]) && input.peek2(token::Brace)) ++ { ++ let begin = input.fork(); ++ input.call(Ident::parse_any)?; ++ input.parse::()?; ++ Type::Verbatim(verbatim::between(&begin, input)) ++ } else { ++ input.parse()? ++ }; ++ ++ Ok(Field { ++ attrs, ++ vis, ++ mutability: FieldMutability::None, ++ ident: Some(ident), ++ colon_token: Some(colon_token), ++ ty, ++ }) ++ } ++ ++ /// Parses an unnamed (tuple struct) field. ++ #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))] ++ pub fn parse_unnamed(input: ParseStream) -> Result { ++ Ok(Field { ++ attrs: input.call(Attribute::parse_outer)?, ++ vis: input.parse()?, ++ mutability: FieldMutability::None, ++ ident: None, ++ colon_token: None, ++ ty: input.parse()?, ++ }) ++ } ++ } ++} ++ ++#[cfg(feature = "printing")] ++mod printing { ++ use crate::data::{Field, FieldsNamed, FieldsUnnamed, Variant}; ++ use crate::print::TokensOrDefault; ++ use proc_macro2::TokenStream; ++ use quote::{ToTokens, TokenStreamExt}; ++ ++ #[cfg_attr(docsrs, doc(cfg(feature = "printing")))] ++ impl ToTokens for Variant { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ tokens.append_all(&self.attrs); ++ self.ident.to_tokens(tokens); ++ self.fields.to_tokens(tokens); ++ if let Some((eq_token, disc)) = &self.discriminant { ++ eq_token.to_tokens(tokens); ++ disc.to_tokens(tokens); ++ } ++ } ++ } ++ ++ #[cfg_attr(docsrs, doc(cfg(feature = "printing")))] ++ impl ToTokens for FieldsNamed { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ self.brace_token.surround(tokens, |tokens| { ++ self.named.to_tokens(tokens); ++ }); ++ } ++ } ++ ++ #[cfg_attr(docsrs, doc(cfg(feature = "printing")))] ++ impl ToTokens for FieldsUnnamed { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ self.paren_token.surround(tokens, |tokens| { ++ self.unnamed.to_tokens(tokens); ++ }); ++ } ++ } ++ ++ #[cfg_attr(docsrs, doc(cfg(feature = "printing")))] ++ impl ToTokens for Field { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ tokens.append_all(&self.attrs); ++ self.vis.to_tokens(tokens); ++ if let Some(ident) = &self.ident { ++ ident.to_tokens(tokens); ++ TokensOrDefault(&self.colon_token).to_tokens(tokens); ++ } ++ self.ty.to_tokens(tokens); ++ } ++ } ++} +diff -Nru mesa-25.3.3/subprojects/syn-2.0.98/src/derive.rs mesa-25.3.3/subprojects/syn-2.0.98/src/derive.rs +--- mesa-25.3.3/subprojects/syn-2.0.98/src/derive.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/syn-2.0.98/src/derive.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,259 @@ ++use crate::attr::Attribute; ++use crate::data::{Fields, FieldsNamed, Variant}; ++use crate::generics::Generics; ++use crate::ident::Ident; ++use crate::punctuated::Punctuated; ++use crate::restriction::Visibility; ++use crate::token; ++ ++ast_struct! { ++ /// Data structure sent to a `proc_macro_derive` macro. ++ #[cfg_attr(docsrs, doc(cfg(feature = "derive")))] ++ pub struct DeriveInput { ++ pub attrs: Vec, ++ pub vis: Visibility, ++ pub ident: Ident, ++ pub generics: Generics, ++ pub data: Data, ++ } ++} ++ ++ast_enum! { ++ /// The storage of a struct, enum or union data structure. ++ /// ++ /// # Syntax tree enum ++ /// ++ /// This type is a [syntax tree enum]. ++ /// ++ /// [syntax tree enum]: crate::expr::Expr#syntax-tree-enums ++ #[cfg_attr(docsrs, doc(cfg(feature = "derive")))] ++ pub enum Data { ++ Struct(DataStruct), ++ Enum(DataEnum), ++ Union(DataUnion), ++ } ++} ++ ++ast_struct! { ++ /// A struct input to a `proc_macro_derive` macro. ++ #[cfg_attr(docsrs, doc(cfg(feature = "derive")))] ++ pub struct DataStruct { ++ pub struct_token: Token![struct], ++ pub fields: Fields, ++ pub semi_token: Option, ++ } ++} ++ ++ast_struct! { ++ /// An enum input to a `proc_macro_derive` macro. ++ #[cfg_attr(docsrs, doc(cfg(feature = "derive")))] ++ pub struct DataEnum { ++ pub enum_token: Token![enum], ++ pub brace_token: token::Brace, ++ pub variants: Punctuated, ++ } ++} ++ ++ast_struct! { ++ /// An untagged union input to a `proc_macro_derive` macro. ++ #[cfg_attr(docsrs, doc(cfg(feature = "derive")))] ++ pub struct DataUnion { ++ pub union_token: Token![union], ++ pub fields: FieldsNamed, ++ } ++} ++ ++#[cfg(feature = "parsing")] ++pub(crate) mod parsing { ++ use crate::attr::Attribute; ++ use crate::data::{Fields, FieldsNamed, Variant}; ++ use crate::derive::{Data, DataEnum, DataStruct, DataUnion, DeriveInput}; ++ use crate::error::Result; ++ use crate::generics::{Generics, WhereClause}; ++ use crate::ident::Ident; ++ use crate::parse::{Parse, ParseStream}; ++ use crate::punctuated::Punctuated; ++ use crate::restriction::Visibility; ++ use crate::token; ++ ++ #[cfg_attr(docsrs, doc(cfg(feature = "parsing")))] ++ impl Parse for DeriveInput { ++ fn parse(input: ParseStream) -> Result { ++ let attrs = input.call(Attribute::parse_outer)?; ++ let vis = input.parse::()?; ++ ++ let lookahead = input.lookahead1(); ++ if lookahead.peek(Token![struct]) { ++ let struct_token = input.parse::()?; ++ let ident = input.parse::()?; ++ let generics = input.parse::()?; ++ let (where_clause, fields, semi) = data_struct(input)?; ++ Ok(DeriveInput { ++ attrs, ++ vis, ++ ident, ++ generics: Generics { ++ where_clause, ++ ..generics ++ }, ++ data: Data::Struct(DataStruct { ++ struct_token, ++ fields, ++ semi_token: semi, ++ }), ++ }) ++ } else if lookahead.peek(Token![enum]) { ++ let enum_token = input.parse::()?; ++ let ident = input.parse::()?; ++ let generics = input.parse::()?; ++ let (where_clause, brace, variants) = data_enum(input)?; ++ Ok(DeriveInput { ++ attrs, ++ vis, ++ ident, ++ generics: Generics { ++ where_clause, ++ ..generics ++ }, ++ data: Data::Enum(DataEnum { ++ enum_token, ++ brace_token: brace, ++ variants, ++ }), ++ }) ++ } else if lookahead.peek(Token![union]) { ++ let union_token = input.parse::()?; ++ let ident = input.parse::()?; ++ let generics = input.parse::()?; ++ let (where_clause, fields) = data_union(input)?; ++ Ok(DeriveInput { ++ attrs, ++ vis, ++ ident, ++ generics: Generics { ++ where_clause, ++ ..generics ++ }, ++ data: Data::Union(DataUnion { ++ union_token, ++ fields, ++ }), ++ }) ++ } else { ++ Err(lookahead.error()) ++ } ++ } ++ } ++ ++ pub(crate) fn data_struct( ++ input: ParseStream, ++ ) -> Result<(Option, Fields, Option)> { ++ let mut lookahead = input.lookahead1(); ++ let mut where_clause = None; ++ if lookahead.peek(Token![where]) { ++ where_clause = Some(input.parse()?); ++ lookahead = input.lookahead1(); ++ } ++ ++ if where_clause.is_none() && lookahead.peek(token::Paren) { ++ let fields = input.parse()?; ++ ++ lookahead = input.lookahead1(); ++ if lookahead.peek(Token![where]) { ++ where_clause = Some(input.parse()?); ++ lookahead = input.lookahead1(); ++ } ++ ++ if lookahead.peek(Token![;]) { ++ let semi = input.parse()?; ++ Ok((where_clause, Fields::Unnamed(fields), Some(semi))) ++ } else { ++ Err(lookahead.error()) ++ } ++ } else if lookahead.peek(token::Brace) { ++ let fields = input.parse()?; ++ Ok((where_clause, Fields::Named(fields), None)) ++ } else if lookahead.peek(Token![;]) { ++ let semi = input.parse()?; ++ Ok((where_clause, Fields::Unit, Some(semi))) ++ } else { ++ Err(lookahead.error()) ++ } ++ } ++ ++ pub(crate) fn data_enum( ++ input: ParseStream, ++ ) -> Result<( ++ Option, ++ token::Brace, ++ Punctuated, ++ )> { ++ let where_clause = input.parse()?; ++ ++ let content; ++ let brace = braced!(content in input); ++ let variants = content.parse_terminated(Variant::parse, Token![,])?; ++ ++ Ok((where_clause, brace, variants)) ++ } ++ ++ pub(crate) fn data_union(input: ParseStream) -> Result<(Option, FieldsNamed)> { ++ let where_clause = input.parse()?; ++ let fields = input.parse()?; ++ Ok((where_clause, fields)) ++ } ++} ++ ++#[cfg(feature = "printing")] ++mod printing { ++ use crate::attr::FilterAttrs; ++ use crate::data::Fields; ++ use crate::derive::{Data, DeriveInput}; ++ use crate::print::TokensOrDefault; ++ use proc_macro2::TokenStream; ++ use quote::ToTokens; ++ ++ #[cfg_attr(docsrs, doc(cfg(feature = "printing")))] ++ impl ToTokens for DeriveInput { ++ fn to_tokens(&self, tokens: &mut TokenStream) { ++ for attr in self.attrs.outer() { ++ attr.to_tokens(tokens); ++ } ++ self.vis.to_tokens(tokens); ++ match &self.data { ++ Data::Struct(d) => d.struct_token.to_tokens(tokens), ++ Data::Enum(d) => d.enum_token.to_tokens(tokens), ++ Data::Union(d) => d.union_token.to_tokens(tokens), ++ } ++ self.ident.to_tokens(tokens); ++ self.generics.to_tokens(tokens); ++ match &self.data { ++ Data::Struct(data) => match &data.fields { ++ Fields::Named(fields) => { ++ self.generics.where_clause.to_tokens(tokens); ++ fields.to_tokens(tokens); ++ } ++ Fields::Unnamed(fields) => { ++ fields.to_tokens(tokens); ++ self.generics.where_clause.to_tokens(tokens); ++ TokensOrDefault(&data.semi_token).to_tokens(tokens); ++ } ++ Fields::Unit => { ++ self.generics.where_clause.to_tokens(tokens); ++ TokensOrDefault(&data.semi_token).to_tokens(tokens); ++ } ++ }, ++ Data::Enum(data) => { ++ self.generics.where_clause.to_tokens(tokens); ++ data.brace_token.surround(tokens, |tokens| { ++ data.variants.to_tokens(tokens); ++ }); ++ } ++ Data::Union(data) => { ++ self.generics.where_clause.to_tokens(tokens); ++ data.fields.to_tokens(tokens); ++ } ++ } ++ } ++ } ++} +diff -Nru mesa-25.3.3/subprojects/syn-2.0.98/src/discouraged.rs mesa-25.3.3/subprojects/syn-2.0.98/src/discouraged.rs +--- mesa-25.3.3/subprojects/syn-2.0.98/src/discouraged.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/syn-2.0.98/src/discouraged.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,225 @@ ++//! Extensions to the parsing API with niche applicability. ++ ++use crate::buffer::Cursor; ++use crate::error::Result; ++use crate::parse::{inner_unexpected, ParseBuffer, Unexpected}; ++use proc_macro2::extra::DelimSpan; ++use proc_macro2::Delimiter; ++use std::cell::Cell; ++use std::mem; ++use std::rc::Rc; ++ ++/// Extensions to the `ParseStream` API to support speculative parsing. ++pub trait Speculative { ++ /// Advance this parse stream to the position of a forked parse stream. ++ /// ++ /// This is the opposite operation to [`ParseStream::fork`]. You can fork a ++ /// parse stream, perform some speculative parsing, then join the original ++ /// stream to the fork to "commit" the parsing from the fork to the main ++ /// stream. ++ /// ++ /// If you can avoid doing this, you should, as it limits the ability to ++ /// generate useful errors. That said, it is often the only way to parse ++ /// syntax of the form `A* B*` for arbitrary syntax `A` and `B`. The problem ++ /// is that when the fork fails to parse an `A`, it's impossible to tell ++ /// whether that was because of a syntax error and the user meant to provide ++ /// an `A`, or that the `A`s are finished and it's time to start parsing ++ /// `B`s. Use with care. ++ /// ++ /// Also note that if `A` is a subset of `B`, `A* B*` can be parsed by ++ /// parsing `B*` and removing the leading members of `A` from the ++ /// repetition, bypassing the need to involve the downsides associated with ++ /// speculative parsing. ++ /// ++ /// [`ParseStream::fork`]: ParseBuffer::fork ++ /// ++ /// # Example ++ /// ++ /// There has been chatter about the possibility of making the colons in the ++ /// turbofish syntax like `path::to::` no longer required by accepting ++ /// `path::to` in expression position. Specifically, according to [RFC ++ /// 2544], [`PathSegment`] parsing should always try to consume a following ++ /// `<` token as the start of generic arguments, and reset to the `<` if ++ /// that fails (e.g. the token is acting as a less-than operator). ++ /// ++ /// This is the exact kind of parsing behavior which requires the "fork, ++ /// try, commit" behavior that [`ParseStream::fork`] discourages. With ++ /// `advance_to`, we can avoid having to parse the speculatively parsed ++ /// content a second time. ++ /// ++ /// This change in behavior can be implemented in syn by replacing just the ++ /// `Parse` implementation for `PathSegment`: ++ /// ++ /// ``` ++ /// # use syn::ext::IdentExt; ++ /// use syn::parse::discouraged::Speculative; ++ /// # use syn::parse::{Parse, ParseStream}; ++ /// # use syn::{Ident, PathArguments, Result, Token}; ++ /// ++ /// pub struct PathSegment { ++ /// pub ident: Ident, ++ /// pub arguments: PathArguments, ++ /// } ++ /// # ++ /// # impl From for PathSegment ++ /// # where ++ /// # T: Into, ++ /// # { ++ /// # fn from(ident: T) -> Self { ++ /// # PathSegment { ++ /// # ident: ident.into(), ++ /// # arguments: PathArguments::None, ++ /// # } ++ /// # } ++ /// # } ++ /// ++ /// impl Parse for PathSegment { ++ /// fn parse(input: ParseStream) -> Result { ++ /// if input.peek(Token![super]) ++ /// || input.peek(Token![self]) ++ /// || input.peek(Token![Self]) ++ /// || input.peek(Token![crate]) ++ /// { ++ /// let ident = input.call(Ident::parse_any)?; ++ /// return Ok(PathSegment::from(ident)); ++ /// } ++ /// ++ /// let ident = input.parse()?; ++ /// if input.peek(Token![::]) && input.peek3(Token![<]) { ++ /// return Ok(PathSegment { ++ /// ident, ++ /// arguments: PathArguments::AngleBracketed(input.parse()?), ++ /// }); ++ /// } ++ /// if input.peek(Token![<]) && !input.peek(Token![<=]) { ++ /// let fork = input.fork(); ++ /// if let Ok(arguments) = fork.parse() { ++ /// input.advance_to(&fork); ++ /// return Ok(PathSegment { ++ /// ident, ++ /// arguments: PathArguments::AngleBracketed(arguments), ++ /// }); ++ /// } ++ /// } ++ /// Ok(PathSegment::from(ident)) ++ /// } ++ /// } ++ /// ++ /// # syn::parse_str::("a").unwrap(); ++ /// ``` ++ /// ++ /// # Drawbacks ++ /// ++ /// The main drawback of this style of speculative parsing is in error ++ /// presentation. Even if the lookahead is the "correct" parse, the error ++ /// that is shown is that of the "fallback" parse. To use the same example ++ /// as the turbofish above, take the following unfinished "turbofish": ++ /// ++ /// ```text ++ /// let _ = f<&'a fn(), for<'a> serde::>(); ++ /// ``` ++ /// ++ /// If this is parsed as generic arguments, we can provide the error message ++ /// ++ /// ```text ++ /// error: expected identifier ++ /// --> src.rs:L:C ++ /// | ++ /// L | let _ = f<&'a fn(), for<'a> serde::>(); ++ /// | ^ ++ /// ``` ++ /// ++ /// but if parsed using the above speculative parsing, it falls back to ++ /// assuming that the `<` is a less-than when it fails to parse the generic ++ /// arguments, and tries to interpret the `&'a` as the start of a labelled ++ /// loop, resulting in the much less helpful error ++ /// ++ /// ```text ++ /// error: expected `:` ++ /// --> src.rs:L:C ++ /// | ++ /// L | let _ = f<&'a fn(), for<'a> serde::>(); ++ /// | ^^ ++ /// ``` ++ /// ++ /// This can be mitigated with various heuristics (two examples: show both ++ /// forks' parse errors, or show the one that consumed more tokens), but ++ /// when you can control the grammar, sticking to something that can be ++ /// parsed LL(3) and without the LL(*) speculative parsing this makes ++ /// possible, displaying reasonable errors becomes much more simple. ++ /// ++ /// [RFC 2544]: https://github.com/rust-lang/rfcs/pull/2544 ++ /// [`PathSegment`]: crate::PathSegment ++ /// ++ /// # Performance ++ /// ++ /// This method performs a cheap fixed amount of work that does not depend ++ /// on how far apart the two streams are positioned. ++ /// ++ /// # Panics ++ /// ++ /// The forked stream in the argument of `advance_to` must have been ++ /// obtained by forking `self`. Attempting to advance to any other stream ++ /// will cause a panic. ++ fn advance_to(&self, fork: &Self); ++} ++ ++impl<'a> Speculative for ParseBuffer<'a> { ++ fn advance_to(&self, fork: &Self) { ++ if !crate::buffer::same_scope(self.cursor(), fork.cursor()) { ++ panic!("fork was not derived from the advancing parse stream"); ++ } ++ ++ let (self_unexp, self_sp) = inner_unexpected(self); ++ let (fork_unexp, fork_sp) = inner_unexpected(fork); ++ if !Rc::ptr_eq(&self_unexp, &fork_unexp) { ++ match (fork_sp, self_sp) { ++ // Unexpected set on the fork, but not on `self`, copy it over. ++ (Some((span, delimiter)), None) => { ++ self_unexp.set(Unexpected::Some(span, delimiter)); ++ } ++ // Unexpected unset. Use chain to propagate errors from fork. ++ (None, None) => { ++ fork_unexp.set(Unexpected::Chain(self_unexp)); ++ ++ // Ensure toplevel 'unexpected' tokens from the fork don't ++ // bubble up the chain by replacing the root `unexpected` ++ // pointer, only 'unexpected' tokens from existing group ++ // parsers should bubble. ++ fork.unexpected ++ .set(Some(Rc::new(Cell::new(Unexpected::None)))); ++ } ++ // Unexpected has been set on `self`. No changes needed. ++ (_, Some(_)) => {} ++ } ++ } ++ ++ // See comment on `cell` in the struct definition. ++ self.cell ++ .set(unsafe { mem::transmute::>(fork.cursor()) }); ++ } ++} ++ ++/// Extensions to the `ParseStream` API to support manipulating invisible ++/// delimiters the same as if they were visible. ++pub trait AnyDelimiter { ++ /// Returns the delimiter, the span of the delimiter token, and the nested ++ /// contents for further parsing. ++ fn parse_any_delimiter(&self) -> Result<(Delimiter, DelimSpan, ParseBuffer)>; ++} ++ ++impl<'a> AnyDelimiter for ParseBuffer<'a> { ++ fn parse_any_delimiter(&self) -> Result<(Delimiter, DelimSpan, ParseBuffer)> { ++ self.step(|cursor| { ++ if let Some((content, delimiter, span, rest)) = cursor.any_group() { ++ let scope = span.close(); ++ let nested = crate::parse::advance_step_cursor(cursor, content); ++ let unexpected = crate::parse::get_unexpected(self); ++ let content = crate::parse::new_parse_buffer(scope, nested, unexpected); ++ Ok(((delimiter, span, content), rest)) ++ } else { ++ Err(cursor.error("expected any delimiter")) ++ } ++ }) ++ } ++} +diff -Nru mesa-25.3.3/subprojects/syn-2.0.98/src/drops.rs mesa-25.3.3/subprojects/syn-2.0.98/src/drops.rs +--- mesa-25.3.3/subprojects/syn-2.0.98/src/drops.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/syn-2.0.98/src/drops.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,58 @@ ++use std::iter; ++use std::mem::ManuallyDrop; ++use std::ops::{Deref, DerefMut}; ++use std::option; ++use std::slice; ++ ++#[repr(transparent)] ++pub(crate) struct NoDrop(ManuallyDrop); ++ ++impl NoDrop { ++ pub(crate) fn new(value: T) -> Self ++ where ++ T: TrivialDrop, ++ { ++ NoDrop(ManuallyDrop::new(value)) ++ } ++} ++ ++impl Deref for NoDrop { ++ type Target = T; ++ fn deref(&self) -> &Self::Target { ++ &self.0 ++ } ++} ++ ++impl DerefMut for NoDrop { ++ fn deref_mut(&mut self) -> &mut Self::Target { ++ &mut self.0 ++ } ++} ++ ++pub(crate) trait TrivialDrop {} ++ ++impl TrivialDrop for iter::Empty {} ++impl TrivialDrop for slice::Iter<'_, T> {} ++impl TrivialDrop for slice::IterMut<'_, T> {} ++impl TrivialDrop for option::IntoIter<&T> {} ++impl TrivialDrop for option::IntoIter<&mut T> {} ++ ++#[test] ++fn test_needs_drop() { ++ use std::mem::needs_drop; ++ ++ struct NeedsDrop; ++ ++ impl Drop for NeedsDrop { ++ fn drop(&mut self) {} ++ } ++ ++ assert!(needs_drop::()); ++ ++ // Test each of the types with a handwritten TrivialDrop impl above. ++ assert!(!needs_drop::>()); ++ assert!(!needs_drop::>()); ++ assert!(!needs_drop::>()); ++ assert!(!needs_drop::>()); ++ assert!(!needs_drop::>()); ++} +diff -Nru mesa-25.3.3/subprojects/syn-2.0.98/src/error.rs mesa-25.3.3/subprojects/syn-2.0.98/src/error.rs +--- mesa-25.3.3/subprojects/syn-2.0.98/src/error.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/syn-2.0.98/src/error.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,467 @@ ++#[cfg(feature = "parsing")] ++use crate::buffer::Cursor; ++use crate::thread::ThreadBound; ++use proc_macro2::{ ++ Delimiter, Group, Ident, LexError, Literal, Punct, Spacing, Span, TokenStream, TokenTree, ++}; ++#[cfg(feature = "printing")] ++use quote::ToTokens; ++use std::fmt::{self, Debug, Display}; ++use std::slice; ++use std::vec; ++ ++/// The result of a Syn parser. ++pub type Result = std::result::Result; ++ ++/// Error returned when a Syn parser cannot parse the input tokens. ++/// ++/// # Error reporting in proc macros ++/// ++/// The correct way to report errors back to the compiler from a procedural ++/// macro is by emitting an appropriately spanned invocation of ++/// [`compile_error!`] in the generated code. This produces a better diagnostic ++/// message than simply panicking the macro. ++/// ++/// [`compile_error!`]: std::compile_error! ++/// ++/// When parsing macro input, the [`parse_macro_input!`] macro handles the ++/// conversion to `compile_error!` automatically. ++/// ++/// [`parse_macro_input!`]: crate::parse_macro_input! ++/// ++/// ``` ++/// # extern crate proc_macro; ++/// # ++/// use proc_macro::TokenStream; ++/// use syn::parse::{Parse, ParseStream, Result}; ++/// use syn::{parse_macro_input, ItemFn}; ++/// ++/// # const IGNORE: &str = stringify! { ++/// #[proc_macro_attribute] ++/// # }; ++/// pub fn my_attr(args: TokenStream, input: TokenStream) -> TokenStream { ++/// let args = parse_macro_input!(args as MyAttrArgs); ++/// let input = parse_macro_input!(input as ItemFn); ++/// ++/// /* ... */ ++/// # TokenStream::new() ++/// } ++/// ++/// struct MyAttrArgs { ++/// # _k: [(); { stringify! { ++/// ... ++/// # }; 0 }] ++/// } ++/// ++/// impl Parse for MyAttrArgs { ++/// fn parse(input: ParseStream) -> Result { ++/// # stringify! { ++/// ... ++/// # }; ++/// # unimplemented!() ++/// } ++/// } ++/// ``` ++/// ++/// For errors that arise later than the initial parsing stage, the ++/// [`.to_compile_error()`] or [`.into_compile_error()`] methods can be used to ++/// perform an explicit conversion to `compile_error!`. ++/// ++/// [`.to_compile_error()`]: Error::to_compile_error ++/// [`.into_compile_error()`]: Error::into_compile_error ++/// ++/// ``` ++/// # extern crate proc_macro; ++/// # ++/// # use proc_macro::TokenStream; ++/// # use syn::{parse_macro_input, DeriveInput}; ++/// # ++/// # const IGNORE: &str = stringify! { ++/// #[proc_macro_derive(MyDerive)] ++/// # }; ++/// pub fn my_derive(input: TokenStream) -> TokenStream { ++/// let input = parse_macro_input!(input as DeriveInput); ++/// ++/// // fn(DeriveInput) -> syn::Result ++/// expand::my_derive(input) ++/// .unwrap_or_else(syn::Error::into_compile_error) ++/// .into() ++/// } ++/// # ++/// # mod expand { ++/// # use proc_macro2::TokenStream; ++/// # use syn::{DeriveInput, Result}; ++/// # ++/// # pub fn my_derive(input: DeriveInput) -> Result { ++/// # unimplemented!() ++/// # } ++/// # } ++/// ``` ++pub struct Error { ++ messages: Vec, ++} ++ ++struct ErrorMessage { ++ // Span is implemented as an index into a thread-local interner to keep the ++ // size small. It is not safe to access from a different thread. We want ++ // errors to be Send and Sync to play nicely with ecosystem crates for error ++ // handling, so pin the span we're given to its original thread and assume ++ // it is Span::call_site if accessed from any other thread. ++ span: ThreadBound, ++ message: String, ++} ++ ++// Cannot use std::ops::Range because that does not implement Copy, ++// whereas ThreadBound requires a Copy impl as a way to ensure no Drop impls ++// are involved. ++struct SpanRange { ++ start: Span, ++ end: Span, ++} ++ ++#[cfg(test)] ++struct _Test ++where ++ Error: Send + Sync; ++ ++impl Error { ++ /// Usually the [`ParseStream::error`] method will be used instead, which ++ /// automatically uses the correct span from the current position of the ++ /// parse stream. ++ /// ++ /// Use `Error::new` when the error needs to be triggered on some span other ++ /// than where the parse stream is currently positioned. ++ /// ++ /// [`ParseStream::error`]: crate::parse::ParseBuffer::error ++ /// ++ /// # Example ++ /// ++ /// ``` ++ /// use syn::{Error, Ident, LitStr, Result, Token}; ++ /// use syn::parse::ParseStream; ++ /// ++ /// // Parses input that looks like `name = "string"` where the key must be ++ /// // the identifier `name` and the value may be any string literal. ++ /// // Returns the string literal. ++ /// fn parse_name(input: ParseStream) -> Result { ++ /// let name_token: Ident = input.parse()?; ++ /// if name_token != "name" { ++ /// // Trigger an error not on the current position of the stream, ++ /// // but on the position of the unexpected identifier. ++ /// return Err(Error::new(name_token.span(), "expected `name`")); ++ /// } ++ /// input.parse::()?; ++ /// let s: LitStr = input.parse()?; ++ /// Ok(s) ++ /// } ++ /// ``` ++ pub fn new(span: Span, message: T) -> Self { ++ return new(span, message.to_string()); ++ ++ fn new(span: Span, message: String) -> Error { ++ Error { ++ messages: vec![ErrorMessage { ++ span: ThreadBound::new(SpanRange { ++ start: span, ++ end: span, ++ }), ++ message, ++ }], ++ } ++ } ++ } ++ ++ /// Creates an error with the specified message spanning the given syntax ++ /// tree node. ++ /// ++ /// Unlike the `Error::new` constructor, this constructor takes an argument ++ /// `tokens` which is a syntax tree node. This allows the resulting `Error` ++ /// to attempt to span all tokens inside of `tokens`. While you would ++ /// typically be able to use the `Spanned` trait with the above `Error::new` ++ /// constructor, implementation limitations today mean that ++ /// `Error::new_spanned` may provide a higher-quality error message on ++ /// stable Rust. ++ /// ++ /// When in doubt it's recommended to stick to `Error::new` (or ++ /// `ParseStream::error`)! ++ #[cfg(feature = "printing")] ++ #[cfg_attr(docsrs, doc(cfg(feature = "printing")))] ++ pub fn new_spanned(tokens: T, message: U) -> Self { ++ return new_spanned(tokens.into_token_stream(), message.to_string()); ++ ++ fn new_spanned(tokens: TokenStream, message: String) -> Error { ++ let mut iter = tokens.into_iter(); ++ let start = iter.next().map_or_else(Span::call_site, |t| t.span()); ++ let end = iter.last().map_or(start, |t| t.span()); ++ Error { ++ messages: vec![ErrorMessage { ++ span: ThreadBound::new(SpanRange { start, end }), ++ message, ++ }], ++ } ++ } ++ } ++ ++ /// The source location of the error. ++ /// ++ /// Spans are not thread-safe so this function returns `Span::call_site()` ++ /// if called from a different thread than the one on which the `Error` was ++ /// originally created. ++ pub fn span(&self) -> Span { ++ let SpanRange { start, end } = match self.messages[0].span.get() { ++ Some(span) => *span, ++ None => return Span::call_site(), ++ }; ++ start.join(end).unwrap_or(start) ++ } ++ ++ /// Render the error as an invocation of [`compile_error!`]. ++ /// ++ /// The [`parse_macro_input!`] macro provides a convenient way to invoke ++ /// this method correctly in a procedural macro. ++ /// ++ /// [`compile_error!`]: std::compile_error! ++ /// [`parse_macro_input!`]: crate::parse_macro_input! ++ pub fn to_compile_error(&self) -> TokenStream { ++ self.messages ++ .iter() ++ .map(ErrorMessage::to_compile_error) ++ .collect() ++ } ++ ++ /// Render the error as an invocation of [`compile_error!`]. ++ /// ++ /// [`compile_error!`]: std::compile_error! ++ /// ++ /// # Example ++ /// ++ /// ``` ++ /// # extern crate proc_macro; ++ /// # ++ /// use proc_macro::TokenStream; ++ /// use syn::{parse_macro_input, DeriveInput, Error}; ++ /// ++ /// # const _: &str = stringify! { ++ /// #[proc_macro_derive(MyTrait)] ++ /// # }; ++ /// pub fn derive_my_trait(input: TokenStream) -> TokenStream { ++ /// let input = parse_macro_input!(input as DeriveInput); ++ /// my_trait::expand(input) ++ /// .unwrap_or_else(Error::into_compile_error) ++ /// .into() ++ /// } ++ /// ++ /// mod my_trait { ++ /// use proc_macro2::TokenStream; ++ /// use syn::{DeriveInput, Result}; ++ /// ++ /// pub(crate) fn expand(input: DeriveInput) -> Result { ++ /// /* ... */ ++ /// # unimplemented!() ++ /// } ++ /// } ++ /// ``` ++ pub fn into_compile_error(self) -> TokenStream { ++ self.to_compile_error() ++ } ++ ++ /// Add another error message to self such that when `to_compile_error()` is ++ /// called, both errors will be emitted together. ++ pub fn combine(&mut self, another: Error) { ++ self.messages.extend(another.messages); ++ } ++} ++ ++impl ErrorMessage { ++ fn to_compile_error(&self) -> TokenStream { ++ let (start, end) = match self.span.get() { ++ Some(range) => (range.start, range.end), ++ None => (Span::call_site(), Span::call_site()), ++ }; ++ ++ // ::core::compile_error!($message) ++ TokenStream::from_iter([ ++ TokenTree::Punct({ ++ let mut punct = Punct::new(':', Spacing::Joint); ++ punct.set_span(start); ++ punct ++ }), ++ TokenTree::Punct({ ++ let mut punct = Punct::new(':', Spacing::Alone); ++ punct.set_span(start); ++ punct ++ }), ++ TokenTree::Ident(Ident::new("core", start)), ++ TokenTree::Punct({ ++ let mut punct = Punct::new(':', Spacing::Joint); ++ punct.set_span(start); ++ punct ++ }), ++ TokenTree::Punct({ ++ let mut punct = Punct::new(':', Spacing::Alone); ++ punct.set_span(start); ++ punct ++ }), ++ TokenTree::Ident(Ident::new("compile_error", start)), ++ TokenTree::Punct({ ++ let mut punct = Punct::new('!', Spacing::Alone); ++ punct.set_span(start); ++ punct ++ }), ++ TokenTree::Group({ ++ let mut group = Group::new(Delimiter::Brace, { ++ TokenStream::from_iter([TokenTree::Literal({ ++ let mut string = Literal::string(&self.message); ++ string.set_span(end); ++ string ++ })]) ++ }); ++ group.set_span(end); ++ group ++ }), ++ ]) ++ } ++} ++ ++#[cfg(feature = "parsing")] ++pub(crate) fn new_at(scope: Span, cursor: Cursor, message: T) -> Error { ++ if cursor.eof() { ++ Error::new(scope, format!("unexpected end of input, {}", message)) ++ } else { ++ let span = crate::buffer::open_span_of_group(cursor); ++ Error::new(span, message) ++ } ++} ++ ++#[cfg(all(feature = "parsing", any(feature = "full", feature = "derive")))] ++pub(crate) fn new2(start: Span, end: Span, message: T) -> Error { ++ return new2(start, end, message.to_string()); ++ ++ fn new2(start: Span, end: Span, message: String) -> Error { ++ Error { ++ messages: vec![ErrorMessage { ++ span: ThreadBound::new(SpanRange { start, end }), ++ message, ++ }], ++ } ++ } ++} ++ ++impl Debug for Error { ++ fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { ++ if self.messages.len() == 1 { ++ formatter ++ .debug_tuple("Error") ++ .field(&self.messages[0]) ++ .finish() ++ } else { ++ formatter ++ .debug_tuple("Error") ++ .field(&self.messages) ++ .finish() ++ } ++ } ++} ++ ++impl Debug for ErrorMessage { ++ fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { ++ Debug::fmt(&self.message, formatter) ++ } ++} ++ ++impl Display for Error { ++ fn fmt(&self, formatter: &mut fmt::Formatter) -> fmt::Result { ++ formatter.write_str(&self.messages[0].message) ++ } ++} ++ ++impl Clone for Error { ++ fn clone(&self) -> Self { ++ Error { ++ messages: self.messages.clone(), ++ } ++ } ++} ++ ++impl Clone for ErrorMessage { ++ fn clone(&self) -> Self { ++ ErrorMessage { ++ span: self.span, ++ message: self.message.clone(), ++ } ++ } ++} ++ ++impl Clone for SpanRange { ++ fn clone(&self) -> Self { ++ *self ++ } ++} ++ ++impl Copy for SpanRange {} ++ ++impl std::error::Error for Error {} ++ ++impl From for Error { ++ fn from(err: LexError) -> Self { ++ Error::new(err.span(), err) ++ } ++} ++ ++impl IntoIterator for Error { ++ type Item = Error; ++ type IntoIter = IntoIter; ++ ++ fn into_iter(self) -> Self::IntoIter { ++ IntoIter { ++ messages: self.messages.into_iter(), ++ } ++ } ++} ++ ++pub struct IntoIter { ++ messages: vec::IntoIter, ++} ++ ++impl Iterator for IntoIter { ++ type Item = Error; ++ ++ fn next(&mut self) -> Option { ++ Some(Error { ++ messages: vec![self.messages.next()?], ++ }) ++ } ++} ++ ++impl<'a> IntoIterator for &'a Error { ++ type Item = Error; ++ type IntoIter = Iter<'a>; ++ ++ fn into_iter(self) -> Self::IntoIter { ++ Iter { ++ messages: self.messages.iter(), ++ } ++ } ++} ++ ++pub struct Iter<'a> { ++ messages: slice::Iter<'a, ErrorMessage>, ++} ++ ++impl<'a> Iterator for Iter<'a> { ++ type Item = Error; ++ ++ fn next(&mut self) -> Option { ++ Some(Error { ++ messages: vec![self.messages.next()?.clone()], ++ }) ++ } ++} ++ ++impl Extend for Error { ++ fn extend>(&mut self, iter: T) { ++ for err in iter { ++ self.combine(err); ++ } ++ } ++} +diff -Nru mesa-25.3.3/subprojects/syn-2.0.98/src/export.rs mesa-25.3.3/subprojects/syn-2.0.98/src/export.rs +--- mesa-25.3.3/subprojects/syn-2.0.98/src/export.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/syn-2.0.98/src/export.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,73 @@ ++#[doc(hidden)] ++pub use std::clone::Clone; ++#[doc(hidden)] ++pub use std::cmp::{Eq, PartialEq}; ++#[doc(hidden)] ++pub use std::concat; ++#[doc(hidden)] ++pub use std::default::Default; ++#[doc(hidden)] ++pub use std::fmt::Debug; ++#[doc(hidden)] ++pub use std::hash::{Hash, Hasher}; ++#[doc(hidden)] ++pub use std::marker::Copy; ++#[doc(hidden)] ++pub use std::option::Option::{None, Some}; ++#[doc(hidden)] ++pub use std::result::Result::{Err, Ok}; ++#[doc(hidden)] ++pub use std::stringify; ++ ++#[doc(hidden)] ++pub type Formatter<'a> = std::fmt::Formatter<'a>; ++#[doc(hidden)] ++pub type FmtResult = std::fmt::Result; ++ ++#[doc(hidden)] ++pub type bool = std::primitive::bool; ++#[doc(hidden)] ++pub type str = std::primitive::str; ++ ++#[cfg(feature = "printing")] ++#[doc(hidden)] ++pub use quote; ++ ++#[doc(hidden)] ++pub type Span = proc_macro2::Span; ++#[doc(hidden)] ++pub type TokenStream2 = proc_macro2::TokenStream; ++ ++#[cfg(feature = "parsing")] ++#[doc(hidden)] ++pub use crate::group::{parse_braces, parse_brackets, parse_parens}; ++ ++#[doc(hidden)] ++pub use crate::span::IntoSpans; ++ ++#[cfg(all(feature = "parsing", feature = "printing"))] ++#[doc(hidden)] ++pub use crate::parse_quote::parse as parse_quote; ++ ++#[cfg(feature = "parsing")] ++#[doc(hidden)] ++pub use crate::token::parsing::{peek_punct, punct as parse_punct}; ++ ++#[cfg(feature = "printing")] ++#[doc(hidden)] ++pub use crate::token::printing::punct as print_punct; ++ ++#[cfg(feature = "parsing")] ++#[doc(hidden)] ++pub use crate::token::private::CustomToken; ++ ++#[cfg(feature = "proc-macro")] ++#[doc(hidden)] ++pub type TokenStream = proc_macro::TokenStream; ++ ++#[cfg(feature = "printing")] ++#[doc(hidden)] ++pub use quote::{ToTokens, TokenStreamExt}; ++ ++#[doc(hidden)] ++pub struct private(pub(crate) ()); +diff -Nru mesa-25.3.3/subprojects/syn-2.0.98/src/expr.rs mesa-25.3.3/subprojects/syn-2.0.98/src/expr.rs +--- mesa-25.3.3/subprojects/syn-2.0.98/src/expr.rs 1969-12-31 19:00:00.000000000 -0500 ++++ mesa-25.3.3/subprojects/syn-2.0.98/src/expr.rs 2006-07-23 20:21:28.000000000 -0500 +@@ -0,0 +1,4101 @@ ++use crate::attr::Attribute; ++#[cfg(all(feature = "parsing", feature = "full"))] ++use crate::error::Result; ++#[cfg(feature = "parsing")] ++use crate::ext::IdentExt as _; ++#[cfg(feature = "full")] ++use crate::generics::BoundLifetimes; ++use crate::ident::Ident; ++#[cfg(any(feature = "parsing", feature = "full"))] ++use crate::lifetime::Lifetime; ++use crate::lit::Lit; ++use crate::mac::Macro; ++use crate::op::{BinOp, UnOp}; ++#[cfg(feature = "parsing")] ++use crate::parse::ParseStream; ++#[cfg(feature = "full")] ++use crate::pat::Pat; ++use crate::path::{AngleBracketedGenericArguments, Path, QSelf}; ++use crate::punctuated::Punctuated; ++#[cfg(feature = "full")] ++use crate::stmt::Block; ++use crate::token; ++#[cfg(feature = "full")] ++use crate::ty::ReturnType; ++use crate::ty::Type; ++use proc_macro2::{Span, TokenStream}; ++#[cfg(feature = "printing")] ++use quote::IdentFragment; ++#[cfg(feature = "printing")] ++use std::fmt::{self, Display}; ++use std::hash::{Hash, Hasher}; ++#[cfg(all(feature = "parsing", feature = "full"))] ++use std::mem; ++ ++ast_enum_of_structs! { ++ /// A Rust expression. ++ /// ++ /// *This type is available only if Syn is built with the `"derive"` or `"full"` ++ /// feature, but most of the variants are not available unless "full" is enabled.* ++ /// ++ /// # Syntax tree enums ++ /// ++ /// This type is a syntax tree enum. In Syn this and other syntax tree enums ++ /// are designed to be traversed using the following rebinding idiom. ++ /// ++ /// ``` ++ /// # use syn::Expr; ++ /// # ++ /// # fn example(expr: Expr) { ++ /// # const IGNORE: &str = stringify! { ++ /// let expr: Expr = /* ... */; ++ /// # }; ++ /// match expr { ++ /// Expr::MethodCall(expr) => { ++ /// /* ... */ ++ /// } ++ /// Expr::Cast(expr) => { ++ /// /* ... */ ++ /// } ++ /// Expr::If(expr) => { ++ /// /* ... */ ++ /// } ++ /// ++ /// /* ... */ ++ /// # _ => {} ++ /// # } ++ /// # } ++ /// ``` ++ /// ++ /// We begin with a variable `expr` of type `Expr` that has no fields ++ /// (because it is an enum), and by matching on it and rebinding a variable ++ /// with the same name `expr` we effectively imbue our variable with all of ++ /// the data fields provided by the variant that it turned out to be. So for ++ /// example above if we ended up in the `MethodCall` case then we get to use ++ /// `expr.receiver`, `expr.args` etc; if we ended up in the `If` case we get ++ /// to use `expr.cond`, `expr.then_branch`, `expr.else_branch`. ++ /// ++ /// This approach avoids repeating the variant names twice on every line. ++ /// ++ /// ``` ++ /// # use syn::{Expr, ExprMethodCall}; ++ /// # ++ /// # fn example(expr: Expr) { ++ /// // Repetitive; recommend not doing this. ++ /// match expr { ++ /// Expr::MethodCall(ExprMethodCall { method, args, .. }) => { ++ /// # } ++ /// # _ => {} ++ /// # } ++ /// # } ++ /// ``` ++ /// ++ /// In general, the name to which a syntax tree enum variant is bound should ++ /// be a suitable name for the complete syntax tree enum type. ++ /// ++ /// ``` ++ /// # use syn::{Expr, ExprField}; ++ /// # ++ /// # fn example(discriminant: ExprField) { ++ /// // Binding is called `base` which is the name I would use if I were ++ /// // assigning `*discriminant.base` without an `if let`. ++ /// if let Expr::Tuple(base) = *discriminant.base { ++ /// # } ++ /// # } ++ /// ``` ++ /// ++ /// A sign that you may not be choosing the right variable names is if you ++ /// see names getting repeated in your code, like accessing ++ /// `receiver.receiver` or `pat.pat` or `cond.cond`. ++ #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))] ++ #[non_exhaustive] ++ pub enum Expr { ++ /// A slice literal expression: `[a, b, c, d]`. ++ Array(ExprArray), ++ ++ /// An assignment expression: `a = compute()`. ++ Assign(ExprAssign), ++ ++ /// An async block: `async { ... }`. ++ Async(ExprAsync), ++ ++ /// An await expression: `fut.await`. ++ Await(ExprAwait), ++ ++ /// A binary operation: `a + b`, `a += b`. ++ Binary(ExprBinary), ++ ++ /// A blocked scope: `{ ... }`. ++ Block(ExprBlock), ++ ++ /// A `break`, with an optional label to break and an optional ++ /// expression. ++ Break(ExprBreak), ++ ++ /// A function call expression: `invoke(a, b)`. ++ Call(ExprCall), ++ ++ /// A cast expression: `foo as f64`. ++ Cast(ExprCast), ++ ++ /// A closure expression: `|a, b| a + b`. ++ Closure(ExprClosure), ++ ++ /// A const block: `const { ... }`. ++ Const(ExprConst), ++ ++ /// A `continue`, with an optional label. ++ Continue(ExprContinue), ++ ++ /// Access of a named struct field (`obj.k`) or unnamed tuple struct ++ /// field (`obj.0`). ++ Field(ExprField), ++ ++ /// A for loop: `for pat in expr { ... }`. ++ ForLoop(ExprForLoop), ++ ++ /// An expression contained within invisible delimiters. ++ /// ++ /// This variant is important for faithfully representing the precedence ++ /// of expressions and is related to `None`-delimited spans in a ++ /// `TokenStream`. ++ Group(ExprGroup), ++ ++ /// An `if` expression with an optional `else` block: `if expr { ... } ++ /// else { ... }`. ++ /// ++ /// The `else` branch expression may only be an `If` or `Block` ++ /// expression, not any of the other types of expression. ++ If(ExprIf), ++ ++ /// A square bracketed indexing expression: `vector[2]`. ++ Index(ExprIndex), ++ ++ /// The inferred value of a const generic argument, denoted `_`. ++ Infer(ExprInfer), ++ ++ /// A `let` guard: `let Some(x) = opt`. ++ Let(ExprLet), ++ ++ /// A literal in place of an expression: `1`, `"foo"`. ++ Lit(ExprLit), ++ ++ /// Conditionless loop: `loop { ... }`. ++ Loop(ExprLoop), ++ ++ /// A macro invocation expression: `format!("{}", q)`. ++ Macro(ExprMacro), ++ ++ /// A `match` expression: `match n { Some(n) => {}, None => {} }`. ++ Match(ExprMatch), ++ ++ /// A method call expression: `x.foo::(a, b)`. ++ MethodCall(ExprMethodCall), ++ ++ /// A parenthesized expression: `(a + b)`. ++ Paren(ExprParen), ++ ++ /// A path like `std::mem::replace` possibly containing generic ++ /// parameters and a qualified self-type. ++ /// ++ /// A plain identifier like `x` is a path of length 1. ++ Path(ExprPath), ++ ++ /// A range expression: `1..2`, `1..`, `..2`, `1..=2`, `..=2`. ++ Range(ExprRange), ++ ++ /// Address-of operation: `&raw const place` or `&raw mut place`. ++ RawAddr(ExprRawAddr), ++ ++ /// A referencing operation: `&a` or `&mut a`. ++ Reference(ExprReference), ++ ++ /// An array literal constructed from one repeated element: `[0u8; N]`. ++ Repeat(ExprRepeat), ++ ++ /// A `return`, with an optional value to be returned. ++ Return(ExprReturn), ++ ++ /// A struct literal expression: `Point { x: 1, y: 1 }`. ++ /// ++ /// The `rest` provides the value of the remaining fields as in `S { a: ++ /// 1, b: 1, ..rest }`. ++ Struct(ExprStruct), ++ ++ /// A try-expression: `expr?`. ++ Try(ExprTry), ++ ++ /// A try block: `try { ... }`. ++ TryBlock(ExprTryBlock), ++ ++ /// A tuple expression: `(a, b, c, d)`. ++ Tuple(ExprTuple), ++ ++ /// A unary operation: `!x`, `*x`. ++ Unary(ExprUnary), ++ ++ /// An unsafe block: `unsafe { ... }`. ++ Unsafe(ExprUnsafe), ++ ++ /// Tokens in expression position not interpreted by Syn. ++ Verbatim(TokenStream), ++ ++ /// A while loop: `while expr { ... }`. ++ While(ExprWhile), ++ ++ /// A yield expression: `yield expr`. ++ Yield(ExprYield), ++ ++ // For testing exhaustiveness in downstream code, use the following idiom: ++ // ++ // match expr { ++ // #![cfg_attr(test, deny(non_exhaustive_omitted_patterns))] ++ // ++ // Expr::Array(expr) => {...} ++ // Expr::Assign(expr) => {...} ++ // ... ++ // Expr::Yield(expr) => {...} ++ // ++ // _ => { /* some sane fallback */ } ++ // } ++ // ++ // This way we fail your tests but don't break your library when adding ++ // a variant. You will be notified by a test failure when a variant is ++ // added, so that you can add code to handle it, but your library will ++ // continue to compile and work for downstream users in the interim. ++ } ++} ++ ++ast_struct! { ++ /// A slice literal expression: `[a, b, c, d]`. ++ #[cfg_attr(docsrs, doc(cfg(feature = "full")))] ++ pub struct ExprArray #full { ++ pub attrs: Vec, ++ pub bracket_token: token::Bracket, ++ pub elems: Punctuated, ++ } ++} ++ ++ast_struct! { ++ /// An assignment expression: `a = compute()`. ++ #[cfg_attr(docsrs, doc(cfg(feature = "full")))] ++ pub struct ExprAssign #full { ++ pub attrs: Vec, ++ pub left: Box, ++ pub eq_token: Token![=], ++ pub right: Box, ++ } ++} ++ ++ast_struct! { ++ /// An async block: `async { ... }`. ++ #[cfg_attr(docsrs, doc(cfg(feature = "full")))] ++ pub struct ExprAsync #full { ++ pub attrs: Vec, ++ pub async_token: Token![async], ++ pub capture: Option, ++ pub block: Block, ++ } ++} ++ ++ast_struct! { ++ /// An await expression: `fut.await`. ++ #[cfg_attr(docsrs, doc(cfg(feature = "full")))] ++ pub struct ExprAwait #full { ++ pub attrs: Vec, ++ pub base: Box, ++ pub dot_token: Token![.], ++ pub await_token: Token![await], ++ } ++} ++ ++ast_struct! { ++ /// A binary operation: `a + b`, `a += b`. ++ #[cfg_attr(docsrs, doc(cfg(any(feature = "full", feature = "derive"))))] ++ pub struct ExprBinary { ++ pub attrs: Vec, ++ pub left: Box, ++ pub op: BinOp, ++ pub right: Box, ++ } ++} ++ ++ast_struct! { ++ /// A blocked scope: `{ ... }`. ++ #[cfg_attr(docsrs, doc(cfg(feature = "full")))] ++ pub struct ExprBlock #full { ++ pub attrs: Vec, ++ pub label: Option